diff --git a/DEPS b/DEPS index 9455b4ad..1a42beb 100644 --- a/DEPS +++ b/DEPS
@@ -239,7 +239,7 @@ # Three lines of non-changing comments so that # the commit queue can handle CLs rolling Skia # and whatever else without interference from each other. - 'skia_revision': 'dc60ca197e0280fb2fe82e42321498a0443b408f', + 'skia_revision': 'fec9a3027c9e54b6671769c8d04d07382214c557', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling V8 # and whatever else without interference from each other. @@ -247,7 +247,7 @@ # Three lines of non-changing comments so that # the commit queue can handle CLs rolling ANGLE # and whatever else without interference from each other. - 'angle_revision': 'feb599ad894ba42e14c89a0c61f34bad8d575eeb', + 'angle_revision': '89e11878b275b15735eaf273ababfa6fd43a2e3d', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling SwiftShader # and whatever else without interference from each other. @@ -799,7 +799,7 @@ 'packages': [ { 'package': 'chromium/third_party/androidx', - 'version': 'rjqESjGVnqj61OsILGz2zAx9aZu_63YrdoiwrUlJrHoC', + 'version': 'JA8W6XUESiIusRecU6mz7G-zjV6Tk4hlDO5hwQf6i8YC', }, ], 'condition': 'checkout_android', @@ -1038,7 +1038,7 @@ }, 'src/third_party/depot_tools': - Var('chromium_git') + '/chromium/tools/depot_tools.git' + '@' + 'e88997a2613aaaabd83718ef25ff9a47bb70090c', + Var('chromium_git') + '/chromium/tools/depot_tools.git' + '@' + '168ca4d812a03fc41408c8eb8fdca34083a7a135', 'src/third_party/devtools-frontend/src': Var('chromium_git') + '/devtools/devtools-frontend' + '@' + Var('devtools_frontend_revision'), @@ -1603,7 +1603,7 @@ 'src/third_party/usrsctp/usrsctplib': Var('chromium_git') + '/external/github.com/sctplab/usrsctp' + '@' + '62d7d0c928c9a040dce96aa2f16c00e7e67d59cb', - 'src/third_party/vulkan-deps': '{chromium_git}/vulkan-deps@a8221eed597007ec8c52726562c1371195c41b08', + 'src/third_party/vulkan-deps': '{chromium_git}/vulkan-deps@39f3a18bdfbeba94a9a308b82401a8a0554db454', 'src/third_party/vulkan_memory_allocator': Var('chromium_git') + '/external/github.com/GPUOpen-LibrariesAndSDKs/VulkanMemoryAllocator.git' + '@' + '5e49f57a6e71a026a54eb42e366de09a4142d24e', @@ -1642,7 +1642,7 @@ Var('chromium_git') + '/external/github.com/gpuweb/cts.git' + '@' + 'c843f8d63c8c17acfbb7d48e09059a581ba779b9', 'src/third_party/webrtc': - Var('webrtc_git') + '/src.git' + '@' + 'd525e2d9f71f02832a8c8d2d63d47b96c16a00fe', + Var('webrtc_git') + '/src.git' + '@' + 'f8e160e1c9f8e805e94be71e2f2da3259dd88b8f', 'src/third_party/libgifcodec': Var('skia_git') + '/libgifcodec' + '@'+ Var('libgifcodec_revision'), @@ -1700,7 +1700,7 @@ Var('chromium_git') + '/v8/v8.git' + '@' + Var('v8_revision'), 'src-internal': { - 'url': 'https://chrome-internal.googlesource.com/chrome/src-internal.git@cc4f8ef12d745384de360d967ac3f324fdeb8b67', + 'url': 'https://chrome-internal.googlesource.com/chrome/src-internal.git@f7b514b75b96bd18231b35b438d44d1e8756fedb', 'condition': 'checkout_src_internal', },
diff --git a/ash/BUILD.gn b/ash/BUILD.gn index 8b298f3..e14e547 100644 --- a/ash/BUILD.gn +++ b/ash/BUILD.gn
@@ -2178,7 +2178,6 @@ # on it. TODO(stevenjb): Assert on //chromeos/dbus/cryptohome_client once it # is extracted from //chromeos/dbus. https://crbug.com/647367. "//chromeos/cryptohome", - "//chromeos/login/auth", "//chromeos/tpm", # Ash should not depend upon content at all.
diff --git a/ash/capture_mode/capture_mode_unittests.cc b/ash/capture_mode/capture_mode_unittests.cc index 596bfd87..d719c2dc 100644 --- a/ash/capture_mode/capture_mode_unittests.cc +++ b/ash/capture_mode/capture_mode_unittests.cc
@@ -41,6 +41,7 @@ #include "ash/projector/test/mock_projector_client.h" #include "ash/public/cpp/capture_mode/capture_mode_test_api.h" #include "ash/public/cpp/holding_space/holding_space_test_api.h" +#include "ash/public/cpp/projector/projector_new_screencast_precondition.h" #include "ash/public/cpp/projector/projector_session.h" #include "ash/public/cpp/shell_window_ids.h" #include "ash/root_window_controller.h" @@ -5044,7 +5045,8 @@ controller->StartVideoRecordingImmediatelyForTesting(); EXPECT_TRUE(controller->is_recording_in_progress()); EXPECT_FALSE(ProjectorSession::Get()->is_active()); - EXPECT_FALSE(ProjectorController::Get()->CanStartNewSession()); + EXPECT_NE(ProjectorController::Get()->GetNewScreencastPrecondition().state, + NewScreencastPreconditionState::kEnabled); } namespace {
diff --git a/ash/components/BUILD.gn b/ash/components/BUILD.gn index a580d5b..1418baa 100644 --- a/ash/components/BUILD.gn +++ b/ash/components/BUILD.gn
@@ -18,6 +18,7 @@ "//ash/components/drivefs:unit_tests", "//ash/components/fwupd:unit_tests", "//ash/components/geolocation:unit_tests", + "//ash/components/login/auth:unit_tests", "//ash/components/login/session:unit_tests", "//ash/components/peripheral_notification:unit_tests", "//ash/components/phonehub:unit_tests",
diff --git a/chromeos/login/auth/BUILD.gn b/ash/components/login/auth/BUILD.gn similarity index 94% rename from chromeos/login/auth/BUILD.gn rename to ash/components/login/auth/BUILD.gn index 51e7da6a9..06e5b8c 100644 --- a/chromeos/login/auth/BUILD.gn +++ b/ash/components/login/auth/BUILD.gn
@@ -2,13 +2,14 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. +import("//build/config/chromeos/ui_mode.gni") import("//testing/test.gni") import("//third_party/protobuf/proto_library.gni") -assert(is_chromeos, "Non-Chrome-OS builds must not depend on //chromeos") +assert(is_chromeos_ash, "Non-Chrome-OS builds must not depend on //ash") component("auth") { - defines = [ "IS_CHROMEOS_LOGIN_AUTH_IMPL" ] + defines = [ "IS_ASH_LOGIN_AUTH_IMPL" ] public_deps = [ ":challenge_response_key" ] deps = [ "//ash/constants", @@ -109,7 +110,7 @@ # This is a separate targat to avoid a circular dependency with # chromeos/cryptohome. source_set("challenge_response_key") { - defines = [ "IS_CHROMEOS_LOGIN_AUTH_IMPL" ] + defines = [ "IS_ASH_LOGIN_AUTH_IMPL" ] deps = [ "//base" ] sources = [ "challenge_response_key.cc",
diff --git a/chromeos/login/auth/DEPS b/ash/components/login/auth/DEPS similarity index 100% rename from chromeos/login/auth/DEPS rename to ash/components/login/auth/DEPS
diff --git a/chromeos/login/auth/DIR_METADATA b/ash/components/login/auth/DIR_METADATA similarity index 100% rename from chromeos/login/auth/DIR_METADATA rename to ash/components/login/auth/DIR_METADATA
diff --git a/chromeos/login/auth/auth_attempt_state.cc b/ash/components/login/auth/auth_attempt_state.cc similarity index 96% rename from chromeos/login/auth/auth_attempt_state.cc rename to ash/components/login/auth/auth_attempt_state.cc index ecbd54b4..67aa045 100644 --- a/chromeos/login/auth/auth_attempt_state.cc +++ b/ash/components/login/auth/auth_attempt_state.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/login/auth/auth_attempt_state.h" +#include "ash/components/login/auth/auth_attempt_state.h" #include <utility>
diff --git a/chromeos/login/auth/auth_attempt_state.h b/ash/components/login/auth/auth_attempt_state.h similarity index 89% rename from chromeos/login/auth/auth_attempt_state.h rename to ash/components/login/auth/auth_attempt_state.h index aa5f3b8..489076b 100644 --- a/chromeos/login/auth/auth_attempt_state.h +++ b/ash/components/login/auth/auth_attempt_state.h
@@ -2,16 +2,16 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef CHROMEOS_LOGIN_AUTH_AUTH_ATTEMPT_STATE_H_ -#define CHROMEOS_LOGIN_AUTH_AUTH_ATTEMPT_STATE_H_ +#ifndef ASH_COMPONENTS_LOGIN_AUTH_AUTH_ATTEMPT_STATE_H_ +#define ASH_COMPONENTS_LOGIN_AUTH_AUTH_ATTEMPT_STATE_H_ #include <memory> #include <string> +#include "ash/components/login/auth/auth_status_consumer.h" +#include "ash/components/login/auth/user_context.h" #include "base/component_export.h" #include "base/memory/weak_ptr.h" -#include "chromeos/login/auth/auth_status_consumer.h" -#include "chromeos/login/auth/user_context.h" #include "google_apis/gaia/gaia_auth_consumer.h" #include "third_party/cros_system_api/dbus/service_constants.h" @@ -19,7 +19,7 @@ // Tracks the state associated with a single attempt to log in to chromium OS. // Enforces that methods are only called on the UI thread. -class COMPONENT_EXPORT(CHROMEOS_LOGIN_AUTH) AuthAttemptState +class COMPONENT_EXPORT(ASH_LOGIN_AUTH) AuthAttemptState : public base::SupportsWeakPtr<AuthAttemptState> { public: // Used to initialize for a login attempt. @@ -88,4 +88,4 @@ } // namespace chromeos -#endif // CHROMEOS_LOGIN_AUTH_AUTH_ATTEMPT_STATE_H_ +#endif // ASH_COMPONENTS_LOGIN_AUTH_AUTH_ATTEMPT_STATE_H_
diff --git a/chromeos/login/auth/auth_session_authenticator.cc b/ash/components/login/auth/auth_session_authenticator.cc similarity index 99% rename from chromeos/login/auth/auth_session_authenticator.cc rename to ash/components/login/auth/auth_session_authenticator.cc index fd0000d6..51d5f161 100644 --- a/chromeos/login/auth/auth_session_authenticator.cc +++ b/ash/components/login/auth/auth_session_authenticator.cc
@@ -2,8 +2,11 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "chromeos/login/auth/auth_session_authenticator.h" +#include "ash/components/login/auth/auth_session_authenticator.h" +#include "ash/components/login/auth/cryptohome_key_constants.h" +#include "ash/components/login/auth/cryptohome_parameter_utils.h" +#include "ash/components/login/auth/user_context.h" #include "base/bind.h" #include "base/callback.h" #include "base/callback_helpers.h" @@ -14,9 +17,6 @@ #include "chromeos/cryptohome/userdataauth_util.h" #include "chromeos/dbus/cryptohome/UserDataAuth.pb.h" #include "chromeos/dbus/userdataauth/userdataauth_client.h" -#include "chromeos/login/auth/cryptohome_key_constants.h" -#include "chromeos/login/auth/cryptohome_parameter_utils.h" -#include "chromeos/login/auth/user_context.h" #include "components/device_event_log/device_event_log.h" #include "components/user_manager/user_names.h"
diff --git a/chromeos/login/auth/auth_session_authenticator.h b/ash/components/login/auth/auth_session_authenticator.h similarity index 96% rename from chromeos/login/auth/auth_session_authenticator.h rename to ash/components/login/auth/auth_session_authenticator.h index 83aa0238..b38b703 100644 --- a/chromeos/login/auth/auth_session_authenticator.h +++ b/ash/components/login/auth/auth_session_authenticator.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_LOGIN_AUTH_AUTH_SESSION_AUTHENTICATOR_H_ -#define CHROMEOS_LOGIN_AUTH_AUTH_SESSION_AUTHENTICATOR_H_ +#ifndef ASH_COMPONENTS_LOGIN_AUTH_AUTH_SESSION_AUTHENTICATOR_H_ +#define ASH_COMPONENTS_LOGIN_AUTH_AUTH_SESSION_AUTHENTICATOR_H_ +#include "ash/components/login/auth/authenticator.h" +#include "ash/components/login/auth/safe_mode_delegate.h" #include "base/component_export.h" #include "base/memory/weak_ptr.h" #include "chromeos/dbus/cryptohome/UserDataAuth.pb.h" -#include "chromeos/login/auth/authenticator.h" -#include "chromeos/login/auth/safe_mode_delegate.h" #include "components/account_id/account_id.h" #include "components/user_manager/user_type.h" #include "third_party/abseil-cpp/absl/types/optional.h" @@ -45,7 +45,7 @@ // * Different ways to hash plain text key // * Different ways to create crytohome key from key in UserContext -class COMPONENT_EXPORT(CHROMEOS_LOGIN_AUTH) AuthSessionAuthenticator +class COMPONENT_EXPORT(ASH_LOGIN_AUTH) AuthSessionAuthenticator : public Authenticator { public: AuthSessionAuthenticator( @@ -279,4 +279,4 @@ } // namespace chromeos -#endif // CHROMEOS_LOGIN_AUTH_AUTH_SESSION_AUTHENTICATOR_H_ +#endif // ASH_COMPONENTS_LOGIN_AUTH_AUTH_SESSION_AUTHENTICATOR_H_
diff --git a/chromeos/login/auth/auth_status_consumer.cc b/ash/components/login/auth/auth_status_consumer.cc similarity index 88% rename from chromeos/login/auth/auth_status_consumer.cc rename to ash/components/login/auth/auth_status_consumer.cc index 261c11b..c071c76 100644 --- a/chromeos/login/auth/auth_status_consumer.cc +++ b/ash/components/login/auth/auth_status_consumer.cc
@@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "chromeos/login/auth/auth_status_consumer.h" +#include "ash/components/login/auth/auth_status_consumer.h" + #include "base/notreached.h" namespace chromeos {
diff --git a/chromeos/login/auth/auth_status_consumer.h b/ash/components/login/auth/auth_status_consumer.h similarity index 94% rename from chromeos/login/auth/auth_status_consumer.h rename to ash/components/login/auth/auth_status_consumer.h index 77d8485..45277bf44 100644 --- a/chromeos/login/auth/auth_status_consumer.h +++ b/ash/components/login/auth/auth_status_consumer.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_LOGIN_AUTH_AUTH_STATUS_CONSUMER_H_ -#define CHROMEOS_LOGIN_AUTH_AUTH_STATUS_CONSUMER_H_ +#ifndef ASH_COMPONENTS_LOGIN_AUTH_AUTH_STATUS_CONSUMER_H_ +#define ASH_COMPONENTS_LOGIN_AUTH_AUTH_STATUS_CONSUMER_H_ #include <string> @@ -19,7 +19,7 @@ class UserContext; -class COMPONENT_EXPORT(CHROMEOS_LOGIN_AUTH) AuthFailure { +class COMPONENT_EXPORT(ASH_LOGIN_AUTH) AuthFailure { public: // Enum used for UMA. Do NOT reorder or remove entry. Don't forget to // update LoginFailureReason enum in enums.xml when adding new entries. @@ -132,7 +132,7 @@ // An interface that defines the callbacks for objects that the // Authenticator class will call to report the success/failure of // authentication for Chromium OS. -class COMPONENT_EXPORT(CHROMEOS_LOGIN_AUTH) AuthStatusConsumer +class COMPONENT_EXPORT(ASH_LOGIN_AUTH) AuthStatusConsumer : public base::CheckedObserver { public: ~AuthStatusConsumer() override = default; @@ -159,4 +159,4 @@ using ::chromeos::AuthStatusConsumer; } // namespace ash -#endif // CHROMEOS_LOGIN_AUTH_AUTH_STATUS_CONSUMER_H_ +#endif // ASH_COMPONENTS_LOGIN_AUTH_AUTH_STATUS_CONSUMER_H_
diff --git a/chromeos/login/auth/authenticator.cc b/ash/components/login/auth/authenticator.cc similarity index 89% rename from chromeos/login/auth/authenticator.cc rename to ash/components/login/auth/authenticator.cc index 4db29ea..de78867 100644 --- a/chromeos/login/auth/authenticator.cc +++ b/ash/components/login/auth/authenticator.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/login/auth/authenticator.h" +#include "ash/components/login/auth/authenticator.h" namespace chromeos {
diff --git a/chromeos/login/auth/authenticator.h b/ash/components/login/auth/authenticator.h similarity index 92% rename from chromeos/login/auth/authenticator.h rename to ash/components/login/auth/authenticator.h index 337cf40..9ebc624 100644 --- a/chromeos/login/auth/authenticator.h +++ b/ash/components/login/auth/authenticator.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_LOGIN_AUTH_AUTHENTICATOR_H_ -#define CHROMEOS_LOGIN_AUTH_AUTHENTICATOR_H_ +#ifndef ASH_COMPONENTS_LOGIN_AUTH_AUTHENTICATOR_H_ +#define ASH_COMPONENTS_LOGIN_AUTH_AUTHENTICATOR_H_ #include <string> +#include "ash/components/login/auth/auth_status_consumer.h" #include "base/component_export.h" #include "base/memory/ref_counted.h" -#include "chromeos/login/auth/auth_status_consumer.h" #include "google_apis/gaia/gaia_auth_consumer.h" class AccountId; @@ -23,7 +23,7 @@ // 1. On successful authentication, will call consumer_->OnAuthSuccess(). // 2. On failure, will call consumer_->OnAuthFailure(). // 3. On password change, will call consumer_->OnPasswordChangeDetected(). -class COMPONENT_EXPORT(CHROMEOS_LOGIN_AUTH) Authenticator +class COMPONENT_EXPORT(ASH_LOGIN_AUTH) Authenticator : public base::RefCountedThreadSafe<Authenticator> { public: explicit Authenticator(AuthStatusConsumer* consumer); @@ -101,4 +101,4 @@ using ::chromeos::Authenticator; } -#endif // CHROMEOS_LOGIN_AUTH_AUTHENTICATOR_H_ +#endif // ASH_COMPONENTS_LOGIN_AUTH_AUTHENTICATOR_H_
diff --git a/chromeos/login/auth/challenge_response/cert_utils.cc b/ash/components/login/auth/challenge_response/cert_utils.cc similarity index 96% rename from chromeos/login/auth/challenge_response/cert_utils.cc rename to ash/components/login/auth/challenge_response/cert_utils.cc index c743c073..7749c1f 100644 --- a/chromeos/login/auth/challenge_response/cert_utils.cc +++ b/ash/components/login/auth/challenge_response/cert_utils.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/login/auth/challenge_response/cert_utils.h" +#include "ash/components/login/auth/challenge_response/cert_utils.h" #include <string>
diff --git a/chromeos/login/auth/challenge_response/cert_utils.h b/ash/components/login/auth/challenge_response/cert_utils.h similarity index 76% rename from chromeos/login/auth/challenge_response/cert_utils.h rename to ash/components/login/auth/challenge_response/cert_utils.h index 9ee7f9e..ae82327 100644 --- a/chromeos/login/auth/challenge_response/cert_utils.h +++ b/ash/components/login/auth/challenge_response/cert_utils.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_LOGIN_AUTH_CHALLENGE_RESPONSE_CERT_UTILS_H_ -#define CHROMEOS_LOGIN_AUTH_CHALLENGE_RESPONSE_CERT_UTILS_H_ +#ifndef ASH_COMPONENTS_LOGIN_AUTH_CHALLENGE_RESPONSE_CERT_UTILS_H_ +#define ASH_COMPONENTS_LOGIN_AUTH_CHALLENGE_RESPONSE_CERT_UTILS_H_ #include <cstdint> #include <vector> +#include "ash/components/login/auth/challenge_response_key.h" #include "base/component_export.h" -#include "chromeos/login/auth/challenge_response_key.h" #include "third_party/abseil-cpp/absl/types/optional.h" namespace net { @@ -20,14 +20,14 @@ // Maps from the TLS 1.3 SignatureScheme value into the challenge-response key // algorithm. -COMPONENT_EXPORT(CHROMEOS_LOGIN_AUTH) +COMPONENT_EXPORT(ASH_LOGIN_AUTH) absl::optional<ChallengeResponseKey::SignatureAlgorithm> GetChallengeResponseKeyAlgorithmFromSsl(uint16_t ssl_algorithm); // Constructs the ChallengeResponseKey instance based on the public key referred // by the specified certificate and on the specified list of supported // algorithms. Returns false on failure. -bool COMPONENT_EXPORT(CHROMEOS_LOGIN_AUTH) ExtractChallengeResponseKeyFromCert( +bool COMPONENT_EXPORT(ASH_LOGIN_AUTH) ExtractChallengeResponseKeyFromCert( const net::X509Certificate& certificate, const std::vector<ChallengeResponseKey::SignatureAlgorithm>& signature_algorithms, @@ -41,4 +41,4 @@ using ::chromeos::GetChallengeResponseKeyAlgorithmFromSsl; } -#endif // CHROMEOS_LOGIN_AUTH_CHALLENGE_RESPONSE_CERT_UTILS_H_ +#endif // ASH_COMPONENTS_LOGIN_AUTH_CHALLENGE_RESPONSE_CERT_UTILS_H_
diff --git a/chromeos/login/auth/challenge_response/cert_utils_unittest.cc b/ash/components/login/auth/challenge_response/cert_utils_unittest.cc similarity index 93% rename from chromeos/login/auth/challenge_response/cert_utils_unittest.cc rename to ash/components/login/auth/challenge_response/cert_utils_unittest.cc index 923769d..8b2514d 100644 --- a/chromeos/login/auth/challenge_response/cert_utils_unittest.cc +++ b/ash/components/login/auth/challenge_response/cert_utils_unittest.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/login/auth/challenge_response/cert_utils.h" +#include "ash/components/login/auth/challenge_response/cert_utils.h" #include <string> #include <vector> +#include "ash/components/login/auth/challenge_response_key.h" #include "base/hash/sha1.h" #include "base/memory/ref_counted.h" -#include "chromeos/login/auth/challenge_response_key.h" #include "net/cert/x509_certificate.h" #include "net/test/cert_test_util.h" #include "net/test/test_certificate_data.h"
diff --git a/chromeos/login/auth/challenge_response/key_label_utils.cc b/ash/components/login/auth/challenge_response/key_label_utils.cc similarity index 94% rename from chromeos/login/auth/challenge_response/key_label_utils.cc rename to ash/components/login/auth/challenge_response/key_label_utils.cc index 967df1e..4f25897 100644 --- a/chromeos/login/auth/challenge_response/key_label_utils.cc +++ b/ash/components/login/auth/challenge_response/key_label_utils.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/login/auth/challenge_response/key_label_utils.h" +#include "ash/components/login/auth/challenge_response/key_label_utils.h" #include "base/check_op.h" #include "base/strings/string_number_conversions.h"
diff --git a/chromeos/login/auth/challenge_response/key_label_utils.h b/ash/components/login/auth/challenge_response/key_label_utils.h similarity index 66% rename from chromeos/login/auth/challenge_response/key_label_utils.h rename to ash/components/login/auth/challenge_response/key_label_utils.h index 98a04e6..8bbbbb2 100644 --- a/chromeos/login/auth/challenge_response/key_label_utils.h +++ b/ash/components/login/auth/challenge_response/key_label_utils.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_LOGIN_AUTH_CHALLENGE_RESPONSE_KEY_LABEL_UTILS_H_ -#define CHROMEOS_LOGIN_AUTH_CHALLENGE_RESPONSE_KEY_LABEL_UTILS_H_ +#ifndef ASH_COMPONENTS_LOGIN_AUTH_CHALLENGE_RESPONSE_KEY_LABEL_UTILS_H_ +#define ASH_COMPONENTS_LOGIN_AUTH_CHALLENGE_RESPONSE_KEY_LABEL_UTILS_H_ #include <string> #include <vector> -#include "chromeos/login/auth/challenge_response_key.h" +#include "ash/components/login/auth/challenge_response_key.h" namespace chromeos { @@ -20,4 +20,4 @@ } // namespace chromeos -#endif // CHROMEOS_LOGIN_AUTH_CHALLENGE_RESPONSE_KEY_LABEL_UTILS_H_ +#endif // ASH_COMPONENTS_LOGIN_AUTH_CHALLENGE_RESPONSE_KEY_LABEL_UTILS_H_
diff --git a/chromeos/login/auth/challenge_response/known_user_pref_utils.cc b/ash/components/login/auth/challenge_response/known_user_pref_utils.cc similarity index 97% rename from chromeos/login/auth/challenge_response/known_user_pref_utils.cc rename to ash/components/login/auth/challenge_response/known_user_pref_utils.cc index d69e5fb..5aaf6e0e 100644 --- a/chromeos/login/auth/challenge_response/known_user_pref_utils.cc +++ b/ash/components/login/auth/challenge_response/known_user_pref_utils.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/login/auth/challenge_response/known_user_pref_utils.h" +#include "ash/components/login/auth/challenge_response/known_user_pref_utils.h" #include <utility>
diff --git a/chromeos/login/auth/challenge_response/known_user_pref_utils.h b/ash/components/login/auth/challenge_response/known_user_pref_utils.h similarity index 77% rename from chromeos/login/auth/challenge_response/known_user_pref_utils.h rename to ash/components/login/auth/challenge_response/known_user_pref_utils.h index 30407ee..3df3993 100644 --- a/chromeos/login/auth/challenge_response/known_user_pref_utils.h +++ b/ash/components/login/auth/challenge_response/known_user_pref_utils.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_LOGIN_AUTH_CHALLENGE_RESPONSE_KNOWN_USER_PREF_UTILS_H_ -#define CHROMEOS_LOGIN_AUTH_CHALLENGE_RESPONSE_KNOWN_USER_PREF_UTILS_H_ +#ifndef ASH_COMPONENTS_LOGIN_AUTH_CHALLENGE_RESPONSE_KNOWN_USER_PREF_UTILS_H_ +#define ASH_COMPONENTS_LOGIN_AUTH_CHALLENGE_RESPONSE_KNOWN_USER_PREF_UTILS_H_ #include <string> #include <vector> +#include "ash/components/login/auth/challenge_response_key.h" #include "base/component_export.h" -#include "chromeos/login/auth/challenge_response_key.h" namespace base { class Value; @@ -25,11 +25,11 @@ // Subject Public Key Info. // * "extension_id" - contains the base64-encoded id of the extension that is // used to sign the key. -base::Value COMPONENT_EXPORT(CHROMEOS_LOGIN_AUTH) +base::Value COMPONENT_EXPORT(ASH_LOGIN_AUTH) SerializeChallengeResponseKeysForKnownUser( const std::vector<ChallengeResponseKey>& challenge_response_keys); -bool COMPONENT_EXPORT(CHROMEOS_LOGIN_AUTH) +bool COMPONENT_EXPORT(ASH_LOGIN_AUTH) DeserializeChallengeResponseKeyFromKnownUser( const base::Value& pref_value, std::vector<DeserializedChallengeResponseKey>* @@ -43,4 +43,4 @@ using ::chromeos::SerializeChallengeResponseKeysForKnownUser; } -#endif // CHROMEOS_LOGIN_AUTH_CHALLENGE_RESPONSE_KNOWN_USER_PREF_UTILS_H_ +#endif // ASH_COMPONENTS_LOGIN_AUTH_CHALLENGE_RESPONSE_KNOWN_USER_PREF_UTILS_H_
diff --git a/chromeos/login/auth/challenge_response_key.cc b/ash/components/login/auth/challenge_response_key.cc similarity index 92% rename from chromeos/login/auth/challenge_response_key.cc rename to ash/components/login/auth/challenge_response_key.cc index 22cc940..89c51f7 100644 --- a/chromeos/login/auth/challenge_response_key.cc +++ b/ash/components/login/auth/challenge_response_key.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/login/auth/challenge_response_key.h" +#include "ash/components/login/auth/challenge_response_key.h" namespace chromeos {
diff --git a/chromeos/login/auth/challenge_response_key.h b/ash/components/login/auth/challenge_response_key.h similarity index 88% rename from chromeos/login/auth/challenge_response_key.h rename to ash/components/login/auth/challenge_response_key.h index 70efe0d..aa4db5c 100644 --- a/chromeos/login/auth/challenge_response_key.h +++ b/ash/components/login/auth/challenge_response_key.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_LOGIN_AUTH_CHALLENGE_RESPONSE_KEY_H_ -#define CHROMEOS_LOGIN_AUTH_CHALLENGE_RESPONSE_KEY_H_ +#ifndef ASH_COMPONENTS_LOGIN_AUTH_CHALLENGE_RESPONSE_KEY_H_ +#define ASH_COMPONENTS_LOGIN_AUTH_CHALLENGE_RESPONSE_KEY_H_ #include <string> #include <vector> @@ -17,7 +17,7 @@ // cryptographic key to be challenged, the signature algorithms supported for // the challenge, and the id of the extension that handles the // challenge-response. -class COMPONENT_EXPORT(CHROMEOS_LOGIN_AUTH) ChallengeResponseKey { +class COMPONENT_EXPORT(ASH_LOGIN_AUTH) ChallengeResponseKey { public: // Cryptographic signature algorithm type for challenge requests. enum class SignatureAlgorithm { @@ -67,7 +67,7 @@ }; // Contains the parts of a ChallengeResponseKey that can be persisted to disk. -struct COMPONENT_EXPORT(CHROMEOS_LOGIN_AUTH) DeserializedChallengeResponseKey { +struct COMPONENT_EXPORT(ASH_LOGIN_AUTH) DeserializedChallengeResponseKey { std::string public_key_spki_der; std::string extension_id; }; @@ -81,4 +81,4 @@ using ::chromeos::DeserializedChallengeResponseKey; } // namespace ash -#endif // CHROMEOS_LOGIN_AUTH_CHALLENGE_RESPONSE_KEY_H_ +#endif // ASH_COMPONENTS_LOGIN_AUTH_CHALLENGE_RESPONSE_KEY_H_
diff --git a/chromeos/login/auth/cryptohome_authenticator.cc b/ash/components/login/auth/cryptohome_authenticator.cc similarity index 98% rename from chromeos/login/auth/cryptohome_authenticator.cc rename to ash/components/login/auth/cryptohome_authenticator.cc index d23ec18c..ef65e93 100644 --- a/chromeos/login/auth/cryptohome_authenticator.cc +++ b/ash/components/login/auth/cryptohome_authenticator.cc
@@ -2,13 +2,18 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "chromeos/login/auth/cryptohome_authenticator.h" +#include "ash/components/login/auth/cryptohome_authenticator.h" #include <stdint.h> #include <memory> #include <vector> +#include "ash/components/login/auth/auth_status_consumer.h" +#include "ash/components/login/auth/cryptohome_key_constants.h" +#include "ash/components/login/auth/cryptohome_parameter_utils.h" +#include "ash/components/login/auth/key.h" +#include "ash/components/login/auth/user_context.h" #include "ash/constants/ash_switches.h" #include "base/bind.h" #include "base/files/file_path.h" @@ -22,11 +27,6 @@ #include "chromeos/cryptohome/userdataauth_util.h" #include "chromeos/dbus/userdataauth/cryptohome_misc_client.h" #include "chromeos/dbus/userdataauth/userdataauth_client.h" -#include "chromeos/login/auth/auth_status_consumer.h" -#include "chromeos/login/auth/cryptohome_key_constants.h" -#include "chromeos/login/auth/cryptohome_parameter_utils.h" -#include "chromeos/login/auth/key.h" -#include "chromeos/login/auth/user_context.h" #include "chromeos/login/login_state/login_state.h" #include "chromeos/metrics/login_event_recorder.h" #include "components/account_id/account_id.h"
diff --git a/chromeos/login/auth/cryptohome_authenticator.h b/ash/components/login/auth/cryptohome_authenticator.h similarity index 95% rename from chromeos/login/auth/cryptohome_authenticator.h rename to ash/components/login/auth/cryptohome_authenticator.h index 24985b9..f2ae81d6 100644 --- a/chromeos/login/auth/cryptohome_authenticator.h +++ b/ash/components/login/auth/cryptohome_authenticator.h
@@ -2,22 +2,22 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef CHROMEOS_LOGIN_AUTH_CRYPTOHOME_AUTHENTICATOR_H_ -#define CHROMEOS_LOGIN_AUTH_CRYPTOHOME_AUTHENTICATOR_H_ +#ifndef ASH_COMPONENTS_LOGIN_AUTH_CRYPTOHOME_AUTHENTICATOR_H_ +#define ASH_COMPONENTS_LOGIN_AUTH_CRYPTOHOME_AUTHENTICATOR_H_ #include <memory> #include <string> +#include "ash/components/login/auth/auth_attempt_state.h" +#include "ash/components/login/auth/authenticator.h" +#include "ash/components/login/auth/safe_mode_delegate.h" +#include "ash/components/login/auth/test_attempt_state.h" #include "base/compiler_specific.h" #include "base/component_export.h" #include "base/gtest_prod_util.h" #include "base/synchronization/lock.h" #include "base/task/sequenced_task_runner.h" #include "chromeos/dbus/cryptohome/UserDataAuth.pb.h" -#include "chromeos/login/auth/auth_attempt_state.h" -#include "chromeos/login/auth/authenticator.h" -#include "chromeos/login/auth/safe_mode_delegate.h" -#include "chromeos/login/auth/test_attempt_state.h" #include "google_apis/gaia/gaia_auth_consumer.h" #include "third_party/abseil-cpp/absl/types/optional.h" @@ -55,7 +55,7 @@ // Old password failure: NEED_OLD_PW // Old password ok: RECOVER_MOUNT > CONTINUE > ONLINE_LOGIN // -class COMPONENT_EXPORT(CHROMEOS_LOGIN_AUTH) CryptohomeAuthenticator +class COMPONENT_EXPORT(ASH_LOGIN_AUTH) CryptohomeAuthenticator : public Authenticator { public: enum AuthState { @@ -270,4 +270,4 @@ using ::chromeos::CryptohomeAuthenticator; } -#endif // CHROMEOS_LOGIN_AUTH_CRYPTOHOME_AUTHENTICATOR_H_ +#endif // ASH_COMPONENTS_LOGIN_AUTH_CRYPTOHOME_AUTHENTICATOR_H_
diff --git a/chromeos/login/auth/cryptohome_key_constants.cc b/ash/components/login/auth/cryptohome_key_constants.cc similarity index 92% rename from chromeos/login/auth/cryptohome_key_constants.cc rename to ash/components/login/auth/cryptohome_key_constants.cc index d6f8967..fb1d6ec 100644 --- a/chromeos/login/auth/cryptohome_key_constants.cc +++ b/ash/components/login/auth/cryptohome_key_constants.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/login/auth/cryptohome_key_constants.h" +#include "ash/components/login/auth/cryptohome_key_constants.h" namespace chromeos {
diff --git a/chromeos/login/auth/cryptohome_key_constants.h b/ash/components/login/auth/cryptohome_key_constants.h similarity index 66% rename from chromeos/login/auth/cryptohome_key_constants.h rename to ash/components/login/auth/cryptohome_key_constants.h index 38e1ba8..340dd0f0 100644 --- a/chromeos/login/auth/cryptohome_key_constants.h +++ b/ash/components/login/auth/cryptohome_key_constants.h
@@ -2,23 +2,23 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef CHROMEOS_LOGIN_AUTH_CRYPTOHOME_KEY_CONSTANTS_H_ -#define CHROMEOS_LOGIN_AUTH_CRYPTOHOME_KEY_CONSTANTS_H_ +#ifndef ASH_COMPONENTS_LOGIN_AUTH_CRYPTOHOME_KEY_CONSTANTS_H_ +#define ASH_COMPONENTS_LOGIN_AUTH_CRYPTOHOME_KEY_CONSTANTS_H_ #include "base/component_export.h" namespace chromeos { -COMPONENT_EXPORT(CHROMEOS_LOGIN_AUTH) +COMPONENT_EXPORT(ASH_LOGIN_AUTH) extern const char kCryptohomeGaiaKeyLabel[]; -COMPONENT_EXPORT(CHROMEOS_LOGIN_AUTH) +COMPONENT_EXPORT(ASH_LOGIN_AUTH) extern const char kCryptohomePinLabel[]; -COMPONENT_EXPORT(CHROMEOS_LOGIN_AUTH) +COMPONENT_EXPORT(ASH_LOGIN_AUTH) extern const char kCryptohomePublicMountLabel[]; -COMPONENT_EXPORT(CHROMEOS_LOGIN_AUTH) +COMPONENT_EXPORT(ASH_LOGIN_AUTH) extern const char kCryptohomeWildcardLabel[]; } // namespace chromeos @@ -30,4 +30,4 @@ using ::chromeos::kCryptohomePinLabel; } -#endif // CHROMEOS_LOGIN_AUTH_CRYPTOHOME_KEY_CONSTANTS_H_ +#endif // ASH_COMPONENTS_LOGIN_AUTH_CRYPTOHOME_KEY_CONSTANTS_H_
diff --git a/chromeos/login/auth/cryptohome_parameter_utils.cc b/ash/components/login/auth/cryptohome_parameter_utils.cc similarity index 90% rename from chromeos/login/auth/cryptohome_parameter_utils.cc rename to ash/components/login/auth/cryptohome_parameter_utils.cc index bb2610ac..f8b6ab5 100644 --- a/chromeos/login/auth/cryptohome_parameter_utils.cc +++ b/ash/components/login/auth/cryptohome_parameter_utils.cc
@@ -2,13 +2,13 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "chromeos/login/auth/cryptohome_parameter_utils.h" +#include "ash/components/login/auth/cryptohome_parameter_utils.h" +#include "ash/components/login/auth/challenge_response/key_label_utils.h" +#include "ash/components/login/auth/key.h" +#include "ash/components/login/auth/user_context.h" #include "base/check_op.h" #include "chromeos/cryptohome/cryptohome_parameters.h" -#include "chromeos/login/auth/challenge_response/key_label_utils.h" -#include "chromeos/login/auth/key.h" -#include "chromeos/login/auth/user_context.h" using cryptohome::KeyDefinition;
diff --git a/chromeos/login/auth/cryptohome_parameter_utils.h b/ash/components/login/auth/cryptohome_parameter_utils.h similarity index 79% rename from chromeos/login/auth/cryptohome_parameter_utils.h rename to ash/components/login/auth/cryptohome_parameter_utils.h index ec5f390..327ecba 100644 --- a/chromeos/login/auth/cryptohome_parameter_utils.h +++ b/ash/components/login/auth/cryptohome_parameter_utils.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_LOGIN_AUTH_CRYPTOHOME_PARAMETER_UTILS_H_ -#define CHROMEOS_LOGIN_AUTH_CRYPTOHOME_PARAMETER_UTILS_H_ +#ifndef ASH_COMPONENTS_LOGIN_AUTH_CRYPTOHOME_PARAMETER_UTILS_H_ +#define ASH_COMPONENTS_LOGIN_AUTH_CRYPTOHOME_PARAMETER_UTILS_H_ #include "base/component_export.h" @@ -22,17 +22,17 @@ // Creates the cryptohome key definition structure based on the credentials and // other information from the given user context. -COMPONENT_EXPORT(CHROMEOS_LOGIN_AUTH) +COMPONENT_EXPORT(ASH_LOGIN_AUTH) cryptohome::KeyDefinition CreateKeyDefFromUserContext( const UserContext& user_context); // Similar to CreateKeyDefFromUserContext(), but the returned value is // slightly altered to be suitable for authorization requests to cryptohome. -COMPONENT_EXPORT(CHROMEOS_LOGIN_AUTH) +COMPONENT_EXPORT(ASH_LOGIN_AUTH) cryptohome::KeyDefinition CreateAuthorizationKeyDefFromUserContext( const UserContext& user_context); } // namespace cryptohome_parameter_utils } // namespace chromeos -#endif // CHROMEOS_LOGIN_AUTH_CRYPTOHOME_PARAMETER_UTILS_H_ +#endif // ASH_COMPONENTS_LOGIN_AUTH_CRYPTOHOME_PARAMETER_UTILS_H_
diff --git a/chromeos/login/auth/extended_authenticator.cc b/ash/components/login/auth/extended_authenticator.cc similarity index 79% rename from chromeos/login/auth/extended_authenticator.cc rename to ash/components/login/auth/extended_authenticator.cc index 6901c25f..404f0a6 100644 --- a/chromeos/login/auth/extended_authenticator.cc +++ b/ash/components/login/auth/extended_authenticator.cc
@@ -2,9 +2,9 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "chromeos/login/auth/extended_authenticator.h" +#include "ash/components/login/auth/extended_authenticator.h" -#include "chromeos/login/auth/extended_authenticator_impl.h" +#include "ash/components/login/auth/extended_authenticator_impl.h" namespace chromeos {
diff --git a/chromeos/login/auth/extended_authenticator.h b/ash/components/login/auth/extended_authenticator.h similarity index 94% rename from chromeos/login/auth/extended_authenticator.h rename to ash/components/login/auth/extended_authenticator.h index a1ca11d..86eba1e4 100644 --- a/chromeos/login/auth/extended_authenticator.h +++ b/ash/components/login/auth/extended_authenticator.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_LOGIN_AUTH_EXTENDED_AUTHENTICATOR_H_ -#define CHROMEOS_LOGIN_AUTH_EXTENDED_AUTHENTICATOR_H_ +#ifndef ASH_COMPONENTS_LOGIN_AUTH_EXTENDED_AUTHENTICATOR_H_ +#define ASH_COMPONENTS_LOGIN_AUTH_EXTENDED_AUTHENTICATOR_H_ #include <memory> #include <string> @@ -26,7 +26,7 @@ // Typical flow: // AuthenticateToMount() calls cryptohomed to perform offline login, // AuthenticateToCreate() calls cryptohomed to create new cryptohome. -class COMPONENT_EXPORT(CHROMEOS_LOGIN_AUTH) ExtendedAuthenticator +class COMPONENT_EXPORT(ASH_LOGIN_AUTH) ExtendedAuthenticator : public base::RefCountedThreadSafe<ExtendedAuthenticator> { public: enum AuthState { @@ -112,4 +112,4 @@ using ::chromeos::ExtendedAuthenticator; } -#endif // CHROMEOS_LOGIN_AUTH_EXTENDED_AUTHENTICATOR_H_ +#endif // ASH_COMPONENTS_LOGIN_AUTH_EXTENDED_AUTHENTICATOR_H_
diff --git a/chromeos/login/auth/extended_authenticator_impl.cc b/ash/components/login/auth/extended_authenticator_impl.cc similarity index 97% rename from chromeos/login/auth/extended_authenticator_impl.cc rename to ash/components/login/auth/extended_authenticator_impl.cc index cd7c4140..00b0e3c77 100644 --- a/chromeos/login/auth/extended_authenticator_impl.cc +++ b/ash/components/login/auth/extended_authenticator_impl.cc
@@ -2,10 +2,14 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "chromeos/login/auth/extended_authenticator_impl.h" +#include "ash/components/login/auth/extended_authenticator_impl.h" #include <stddef.h> +#include "ash/components/login/auth/auth_status_consumer.h" +#include "ash/components/login/auth/cryptohome_parameter_utils.h" +#include "ash/components/login/auth/key.h" +#include "ash/components/login/auth/user_context.h" #include "base/bind.h" #include "base/strings/string_number_conversions.h" #include "base/strings/string_util.h" @@ -14,10 +18,6 @@ #include "chromeos/cryptohome/system_salt_getter.h" #include "chromeos/cryptohome/userdataauth_util.h" #include "chromeos/dbus/userdataauth/userdataauth_client.h" -#include "chromeos/login/auth/auth_status_consumer.h" -#include "chromeos/login/auth/cryptohome_parameter_utils.h" -#include "chromeos/login/auth/key.h" -#include "chromeos/login/auth/user_context.h" #include "chromeos/metrics/login_event_recorder.h" #include "components/account_id/account_id.h" #include "crypto/sha2.h"
diff --git a/chromeos/login/auth/extended_authenticator_impl.h b/ash/components/login/auth/extended_authenticator_impl.h similarity index 91% rename from chromeos/login/auth/extended_authenticator_impl.h rename to ash/components/login/auth/extended_authenticator_impl.h index 3a4c3919..1e7da2b 100644 --- a/chromeos/login/auth/extended_authenticator_impl.h +++ b/ash/components/login/auth/extended_authenticator_impl.h
@@ -2,17 +2,17 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef CHROMEOS_LOGIN_AUTH_EXTENDED_AUTHENTICATOR_IMPL_H_ -#define CHROMEOS_LOGIN_AUTH_EXTENDED_AUTHENTICATOR_IMPL_H_ +#ifndef ASH_COMPONENTS_LOGIN_AUTH_EXTENDED_AUTHENTICATOR_IMPL_H_ +#define ASH_COMPONENTS_LOGIN_AUTH_EXTENDED_AUTHENTICATOR_IMPL_H_ #include <memory> #include <string> +#include "ash/components/login/auth/extended_authenticator.h" #include "base/callback.h" #include "base/compiler_specific.h" #include "base/component_export.h" #include "chromeos/dbus/cryptohome/UserDataAuth.pb.h" -#include "chromeos/login/auth/extended_authenticator.h" #include "third_party/abseil-cpp/absl/types/optional.h" #include "third_party/cros_system_api/dbus/service_constants.h" @@ -22,7 +22,7 @@ class UserContext; // Implements ExtendedAuthenticator. -class COMPONENT_EXPORT(CHROMEOS_LOGIN_AUTH) ExtendedAuthenticatorImpl +class COMPONENT_EXPORT(ASH_LOGIN_AUTH) ExtendedAuthenticatorImpl : public ExtendedAuthenticator { public: static scoped_refptr<ExtendedAuthenticatorImpl> Create( @@ -95,4 +95,4 @@ } // namespace chromeos -#endif // CHROMEOS_LOGIN_AUTH_EXTENDED_AUTHENTICATOR_IMPL_H_ +#endif // ASH_COMPONENTS_LOGIN_AUTH_EXTENDED_AUTHENTICATOR_IMPL_H_
diff --git a/chromeos/login/auth/fake_extended_authenticator.cc b/ash/components/login/auth/fake_extended_authenticator.cc similarity index 95% rename from chromeos/login/auth/fake_extended_authenticator.cc rename to ash/components/login/auth/fake_extended_authenticator.cc index 2e7ef974..aa4b400 100644 --- a/chromeos/login/auth/fake_extended_authenticator.cc +++ b/ash/components/login/auth/fake_extended_authenticator.cc
@@ -2,10 +2,10 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "chromeos/login/auth/fake_extended_authenticator.h" +#include "ash/components/login/auth/fake_extended_authenticator.h" +#include "ash/components/login/auth/auth_status_consumer.h" #include "base/notreached.h" -#include "chromeos/login/auth/auth_status_consumer.h" #include "components/account_id/account_id.h" namespace chromeos {
diff --git a/chromeos/login/auth/fake_extended_authenticator.h b/ash/components/login/auth/fake_extended_authenticator.h similarity index 84% rename from chromeos/login/auth/fake_extended_authenticator.h rename to ash/components/login/auth/fake_extended_authenticator.h index db913cbf..258a5747 100644 --- a/chromeos/login/auth/fake_extended_authenticator.h +++ b/ash/components/login/auth/fake_extended_authenticator.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_LOGIN_AUTH_FAKE_EXTENDED_AUTHENTICATOR_H_ -#define CHROMEOS_LOGIN_AUTH_FAKE_EXTENDED_AUTHENTICATOR_H_ +#ifndef ASH_COMPONENTS_LOGIN_AUTH_FAKE_EXTENDED_AUTHENTICATOR_H_ +#define ASH_COMPONENTS_LOGIN_AUTH_FAKE_EXTENDED_AUTHENTICATOR_H_ +#include "ash/components/login/auth/extended_authenticator.h" +#include "ash/components/login/auth/user_context.h" #include "base/component_export.h" -#include "chromeos/login/auth/extended_authenticator.h" -#include "chromeos/login/auth/user_context.h" namespace chromeos { class AuthFailure; -class COMPONENT_EXPORT(CHROMEOS_LOGIN_AUTH) FakeExtendedAuthenticator +class COMPONENT_EXPORT(ASH_LOGIN_AUTH) FakeExtendedAuthenticator : public ExtendedAuthenticator { public: FakeExtendedAuthenticator(AuthStatusConsumer* consumer, @@ -64,4 +64,4 @@ using ::chromeos::FakeExtendedAuthenticator; } -#endif // CHROMEOS_LOGIN_AUTH_FAKE_EXTENDED_AUTHENTICATOR_H_ +#endif // ASH_COMPONENTS_LOGIN_AUTH_FAKE_EXTENDED_AUTHENTICATOR_H_
diff --git a/chromeos/login/auth/key.cc b/ash/components/login/auth/key.cc similarity index 98% rename from chromeos/login/auth/key.cc rename to ash/components/login/auth/key.cc index 465ab67..d8a06c3 100644 --- a/chromeos/login/auth/key.cc +++ b/ash/components/login/auth/key.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/login/auth/key.h" +#include "ash/components/login/auth/key.h" #include <memory>
diff --git a/chromeos/login/auth/key.h b/ash/components/login/auth/key.h similarity index 91% rename from chromeos/login/auth/key.h rename to ash/components/login/auth/key.h index 09d76e6..9cfe4126 100644 --- a/chromeos/login/auth/key.h +++ b/ash/components/login/auth/key.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_LOGIN_AUTH_KEY_H_ -#define CHROMEOS_LOGIN_AUTH_KEY_H_ +#ifndef ASH_COMPONENTS_LOGIN_AUTH_KEY_H_ +#define ASH_COMPONENTS_LOGIN_AUTH_KEY_H_ #include <string> @@ -15,7 +15,7 @@ // passwords to generate keys as well as the use of pre-hashed keys. // // TODO(crbug.com/826417): Consider making this class movable. -class COMPONENT_EXPORT(CHROMEOS_LOGIN_AUTH) Key { +class COMPONENT_EXPORT(ASH_LOGIN_AUTH) Key { public: enum KeyType { // Plain text password. @@ -69,4 +69,4 @@ using ::chromeos::Key; } -#endif // CHROMEOS_LOGIN_AUTH_KEY_H_ +#endif // ASH_COMPONENTS_LOGIN_AUTH_KEY_H_
diff --git a/chromeos/login/auth/key_unittest.cc b/ash/components/login/auth/key_unittest.cc similarity index 97% rename from chromeos/login/auth/key_unittest.cc rename to ash/components/login/auth/key_unittest.cc index 26a6c8d..0ea0613 100644 --- a/chromeos/login/auth/key_unittest.cc +++ b/ash/components/login/auth/key_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/login/auth/key.h" +#include "ash/components/login/auth/key.h" #include "testing/gtest/include/gtest/gtest.h"
diff --git a/chromeos/login/auth/login_performer.cc b/ash/components/login/auth/login_performer.cc similarity index 99% rename from chromeos/login/auth/login_performer.cc rename to ash/components/login/auth/login_performer.cc index 6939c89..39d1809 100644 --- a/chromeos/login/auth/login_performer.cc +++ b/ash/components/login/auth/login_performer.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/login/auth/login_performer.h" +#include "ash/components/login/auth/login_performer.h" #include "base/bind.h" #include "base/location.h"
diff --git a/chromeos/login/auth/login_performer.h b/ash/components/login/auth/login_performer.h similarity index 94% rename from chromeos/login/auth/login_performer.h rename to ash/components/login/auth/login_performer.h index 7f657f6..5cf4e6f 100644 --- a/chromeos/login/auth/login_performer.h +++ b/ash/components/login/auth/login_performer.h
@@ -2,20 +2,20 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef CHROMEOS_LOGIN_AUTH_LOGIN_PERFORMER_H_ -#define CHROMEOS_LOGIN_AUTH_LOGIN_PERFORMER_H_ +#ifndef ASH_COMPONENTS_LOGIN_AUTH_LOGIN_PERFORMER_H_ +#define ASH_COMPONENTS_LOGIN_AUTH_LOGIN_PERFORMER_H_ #include <memory> #include <string> +#include "ash/components/login/auth/auth_status_consumer.h" +#include "ash/components/login/auth/authenticator.h" +#include "ash/components/login/auth/extended_authenticator.h" +#include "ash/components/login/auth/user_context.h" #include "base/callback.h" #include "base/component_export.h" #include "base/memory/weak_ptr.h" #include "base/sequence_checker.h" -#include "chromeos/login/auth/auth_status_consumer.h" -#include "chromeos/login/auth/authenticator.h" -#include "chromeos/login/auth/extended_authenticator.h" -#include "chromeos/login/auth/user_context.h" #include "components/user_manager/user_type.h" #include "google_apis/gaia/google_service_auth_error.h" #include "third_party/abseil-cpp/absl/types/optional.h" @@ -36,7 +36,7 @@ // If auth is succeeded, cookie fetcher is executed, LP instance deletes itself. // // If |delegate_| is not NULL it will handle error messages, password input. -class COMPONENT_EXPORT(CHROMEOS_LOGIN_AUTH) LoginPerformer +class COMPONENT_EXPORT(ASH_LOGIN_AUTH) LoginPerformer : public AuthStatusConsumer { public: enum class AuthorizationMode { @@ -218,4 +218,4 @@ using ::chromeos::LoginPerformer; } -#endif // CHROMEOS_LOGIN_AUTH_LOGIN_PERFORMER_H_ +#endif // ASH_COMPONENTS_LOGIN_AUTH_LOGIN_PERFORMER_H_
diff --git a/chromeos/login/auth/mock_auth_status_consumer.cc b/ash/components/login/auth/mock_auth_status_consumer.cc similarity index 96% rename from chromeos/login/auth/mock_auth_status_consumer.cc rename to ash/components/login/auth/mock_auth_status_consumer.cc index 93574c5..eb371447 100644 --- a/chromeos/login/auth/mock_auth_status_consumer.cc +++ b/ash/components/login/auth/mock_auth_status_consumer.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/login/auth/mock_auth_status_consumer.h" +#include "ash/components/login/auth/mock_auth_status_consumer.h" #include "base/run_loop.h" #include "google_apis/gaia/gaia_auth_consumer.h"
diff --git a/chromeos/login/auth/mock_auth_status_consumer.h b/ash/components/login/auth/mock_auth_status_consumer.h similarity index 83% rename from chromeos/login/auth/mock_auth_status_consumer.h rename to ash/components/login/auth/mock_auth_status_consumer.h index d95d2f5..9ab1ed5d 100644 --- a/chromeos/login/auth/mock_auth_status_consumer.h +++ b/ash/components/login/auth/mock_auth_status_consumer.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_LOGIN_AUTH_MOCK_AUTH_STATUS_CONSUMER_H_ -#define CHROMEOS_LOGIN_AUTH_MOCK_AUTH_STATUS_CONSUMER_H_ +#ifndef ASH_COMPONENTS_LOGIN_AUTH_MOCK_AUTH_STATUS_CONSUMER_H_ +#define ASH_COMPONENTS_LOGIN_AUTH_MOCK_AUTH_STATUS_CONSUMER_H_ +#include "ash/components/login/auth/auth_status_consumer.h" +#include "ash/components/login/auth/user_context.h" #include "base/callback.h" #include "base/component_export.h" -#include "chromeos/login/auth/auth_status_consumer.h" -#include "chromeos/login/auth/user_context.h" #include "testing/gmock/include/gmock/gmock.h" namespace chromeos { -class COMPONENT_EXPORT(CHROMEOS_LOGIN_AUTH) MockAuthStatusConsumer +class COMPONENT_EXPORT(ASH_LOGIN_AUTH) MockAuthStatusConsumer : public AuthStatusConsumer { public: explicit MockAuthStatusConsumer(base::OnceClosure quit_closure); @@ -59,4 +59,4 @@ using ::chromeos::MockAuthStatusConsumer; } -#endif // CHROMEOS_LOGIN_AUTH_MOCK_AUTH_STATUS_CONSUMER_H_ +#endif // ASH_COMPONENTS_LOGIN_AUTH_MOCK_AUTH_STATUS_CONSUMER_H_
diff --git a/chromeos/login/auth/password_visibility_utils.cc b/ash/components/login/auth/password_visibility_utils.cc similarity index 90% rename from chromeos/login/auth/password_visibility_utils.cc rename to ash/components/login/auth/password_visibility_utils.cc index 6d7f09b..92ded90 100644 --- a/chromeos/login/auth/password_visibility_utils.cc +++ b/ash/components/login/auth/password_visibility_utils.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/login/auth/password_visibility_utils.h" +#include "ash/components/login/auth/password_visibility_utils.h" #include "components/user_manager/known_user.h"
diff --git a/chromeos/login/auth/password_visibility_utils.h b/ash/components/login/auth/password_visibility_utils.h similarity index 68% rename from chromeos/login/auth/password_visibility_utils.h rename to ash/components/login/auth/password_visibility_utils.h index 222cf9f..10c1eb9 100644 --- a/chromeos/login/auth/password_visibility_utils.h +++ b/ash/components/login/auth/password_visibility_utils.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_LOGIN_AUTH_PASSWORD_VISIBILITY_UTILS_H_ -#define CHROMEOS_LOGIN_AUTH_PASSWORD_VISIBILITY_UTILS_H_ +#ifndef ASH_COMPONENTS_LOGIN_AUTH_PASSWORD_VISIBILITY_UTILS_H_ +#define ASH_COMPONENTS_LOGIN_AUTH_PASSWORD_VISIBILITY_UTILS_H_ #include "base/component_export.h" @@ -15,11 +15,11 @@ // Whether the account has a user facing password that the user can enter for // security checks. -bool COMPONENT_EXPORT(CHROMEOS_LOGIN_AUTH) +bool COMPONENT_EXPORT(ASH_LOGIN_AUTH) AccountHasUserFacingPassword(const AccountId& account_id); } // namespace password_visibility } // namespace chromeos -#endif // CHROMEOS_LOGIN_AUTH_PASSWORD_VISIBILITY_UTILS_H_ +#endif // ASH_COMPONENTS_LOGIN_AUTH_PASSWORD_VISIBILITY_UTILS_H_
diff --git a/chromeos/login/auth/safe_mode_delegate.h b/ash/components/login/auth/safe_mode_delegate.h similarity index 88% rename from chromeos/login/auth/safe_mode_delegate.h rename to ash/components/login/auth/safe_mode_delegate.h index 53b6683..555630e 100644 --- a/chromeos/login/auth/safe_mode_delegate.h +++ b/ash/components/login/auth/safe_mode_delegate.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_LOGIN_AUTH_SAFE_MODE_DELEGATE_H_ -#define CHROMEOS_LOGIN_AUTH_SAFE_MODE_DELEGATE_H_ +#ifndef ASH_COMPONENTS_LOGIN_AUTH_SAFE_MODE_DELEGATE_H_ +#define ASH_COMPONENTS_LOGIN_AUTH_SAFE_MODE_DELEGATE_H_ #include "base/callback.h" #include "base/component_export.h" @@ -20,7 +20,7 @@ // This inteface abstracts interface between code that performs cryptohome // mounting and code that has access to DeviceSettings. -class COMPONENT_EXPORT(CHROMEOS_LOGIN_AUTH) SafeModeDelegate { +class COMPONENT_EXPORT(ASH_LOGIN_AUTH) SafeModeDelegate { public: SafeModeDelegate() = default; virtual ~SafeModeDelegate() = default; @@ -50,4 +50,4 @@ using ::chromeos::SafeModeDelegate; } -#endif // CHROMEOS_LOGIN_AUTH_SAFE_MODE_DELEGATE_H_ +#endif // ASH_COMPONENTS_LOGIN_AUTH_SAFE_MODE_DELEGATE_H_
diff --git a/chromeos/login/auth/saml_password_attributes.cc b/ash/components/login/auth/saml_password_attributes.cc similarity index 97% rename from chromeos/login/auth/saml_password_attributes.cc rename to ash/components/login/auth/saml_password_attributes.cc index 64a956b8..021ca53 100644 --- a/chromeos/login/auth/saml_password_attributes.cc +++ b/ash/components/login/auth/saml_password_attributes.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/login/auth/saml_password_attributes.h" +#include "ash/components/login/auth/saml_password_attributes.h" #include "ash/constants/ash_pref_names.h" #include "base/strings/string_number_conversions.h"
diff --git a/chromeos/login/auth/saml_password_attributes.h b/ash/components/login/auth/saml_password_attributes.h similarity index 90% rename from chromeos/login/auth/saml_password_attributes.h rename to ash/components/login/auth/saml_password_attributes.h index a4f096c..b39a80b 100644 --- a/chromeos/login/auth/saml_password_attributes.h +++ b/ash/components/login/auth/saml_password_attributes.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_LOGIN_AUTH_SAML_PASSWORD_ATTRIBUTES_H_ -#define CHROMEOS_LOGIN_AUTH_SAML_PASSWORD_ATTRIBUTES_H_ +#ifndef ASH_COMPONENTS_LOGIN_AUTH_SAML_PASSWORD_ATTRIBUTES_H_ +#define ASH_COMPONENTS_LOGIN_AUTH_SAML_PASSWORD_ATTRIBUTES_H_ #include <string> @@ -24,7 +24,7 @@ // the PrefService. // The IdP is not required to set these, so any or all of them may be missing - // the has_*() functions are for checking which attributes are set. -class COMPONENT_EXPORT(CHROMEOS_LOGIN_AUTH) SamlPasswordAttributes { +class COMPONENT_EXPORT(ASH_LOGIN_AUTH) SamlPasswordAttributes { public: SamlPasswordAttributes(); SamlPasswordAttributes(const base::Time& modified_time, @@ -79,4 +79,4 @@ using ::chromeos::SamlPasswordAttributes; } -#endif // CHROMEOS_LOGIN_AUTH_SAML_PASSWORD_ATTRIBUTES_H_ +#endif // ASH_COMPONENTS_LOGIN_AUTH_SAML_PASSWORD_ATTRIBUTES_H_
diff --git a/chromeos/login/auth/saml_password_attributes_unittest.cc b/ash/components/login/auth/saml_password_attributes_unittest.cc similarity index 97% rename from chromeos/login/auth/saml_password_attributes_unittest.cc rename to ash/components/login/auth/saml_password_attributes_unittest.cc index 1b32888..0faf21e 100644 --- a/chromeos/login/auth/saml_password_attributes_unittest.cc +++ b/ash/components/login/auth/saml_password_attributes_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/login/auth/saml_password_attributes.h" +#include "ash/components/login/auth/saml_password_attributes.h" #include "components/prefs/pref_registry_simple.h" #include "components/prefs/testing_pref_service.h"
diff --git a/chromeos/login/auth/stub_authenticator.cc b/ash/components/login/auth/stub_authenticator.cc similarity index 98% rename from chromeos/login/auth/stub_authenticator.cc rename to ash/components/login/auth/stub_authenticator.cc index dd319ddf..ca8260e 100644 --- a/chromeos/login/auth/stub_authenticator.cc +++ b/ash/components/login/auth/stub_authenticator.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/login/auth/stub_authenticator.h" +#include "ash/components/login/auth/stub_authenticator.h" #include "base/bind.h" #include "base/location.h"
diff --git a/chromeos/login/auth/stub_authenticator.h b/ash/components/login/auth/stub_authenticator.h similarity index 88% rename from chromeos/login/auth/stub_authenticator.h rename to ash/components/login/auth/stub_authenticator.h index d367a6d3..82905b6 100644 --- a/chromeos/login/auth/stub_authenticator.h +++ b/ash/components/login/auth/stub_authenticator.h
@@ -2,17 +2,17 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef CHROMEOS_LOGIN_AUTH_STUB_AUTHENTICATOR_H_ -#define CHROMEOS_LOGIN_AUTH_STUB_AUTHENTICATOR_H_ +#ifndef ASH_COMPONENTS_LOGIN_AUTH_STUB_AUTHENTICATOR_H_ +#define ASH_COMPONENTS_LOGIN_AUTH_STUB_AUTHENTICATOR_H_ #include <string> +#include "ash/components/login/auth/auth_status_consumer.h" +#include "ash/components/login/auth/authenticator.h" +#include "ash/components/login/auth/user_context.h" #include "base/callback.h" #include "base/component_export.h" #include "base/task/single_thread_task_runner.h" -#include "chromeos/login/auth/auth_status_consumer.h" -#include "chromeos/login/auth/authenticator.h" -#include "chromeos/login/auth/user_context.h" class AccountId; @@ -21,7 +21,7 @@ class AuthStatusConsumer; class StubAuthenticatorBuilder; -class COMPONENT_EXPORT(CHROMEOS_LOGIN_AUTH) StubAuthenticator +class COMPONENT_EXPORT(ASH_LOGIN_AUTH) StubAuthenticator : public Authenticator { public: enum class DataRecoveryStatus { @@ -102,4 +102,4 @@ using ::chromeos::StubAuthenticator; } -#endif // CHROMEOS_LOGIN_AUTH_STUB_AUTHENTICATOR_H_ +#endif // ASH_COMPONENTS_LOGIN_AUTH_STUB_AUTHENTICATOR_H_
diff --git a/chromeos/login/auth/stub_authenticator_builder.cc b/ash/components/login/auth/stub_authenticator_builder.cc similarity index 96% rename from chromeos/login/auth/stub_authenticator_builder.cc rename to ash/components/login/auth/stub_authenticator_builder.cc index 3cd0c01..6c2f129f0 100644 --- a/chromeos/login/auth/stub_authenticator_builder.cc +++ b/ash/components/login/auth/stub_authenticator_builder.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/login/auth/stub_authenticator_builder.h" +#include "ash/components/login/auth/stub_authenticator_builder.h" namespace chromeos {
diff --git a/chromeos/login/auth/stub_authenticator_builder.h b/ash/components/login/auth/stub_authenticator_builder.h similarity index 86% rename from chromeos/login/auth/stub_authenticator_builder.h rename to ash/components/login/auth/stub_authenticator_builder.h index 3e531879..d8d519a 100644 --- a/chromeos/login/auth/stub_authenticator_builder.h +++ b/ash/components/login/auth/stub_authenticator_builder.h
@@ -2,23 +2,23 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef CHROMEOS_LOGIN_AUTH_STUB_AUTHENTICATOR_BUILDER_H_ -#define CHROMEOS_LOGIN_AUTH_STUB_AUTHENTICATOR_BUILDER_H_ +#ifndef ASH_COMPONENTS_LOGIN_AUTH_STUB_AUTHENTICATOR_BUILDER_H_ +#define ASH_COMPONENTS_LOGIN_AUTH_STUB_AUTHENTICATOR_BUILDER_H_ #include <string> +#include "ash/components/login/auth/auth_status_consumer.h" +#include "ash/components/login/auth/stub_authenticator.h" +#include "ash/components/login/auth/user_context.h" #include "base/component_export.h" #include "base/memory/ref_counted.h" -#include "chromeos/login/auth/auth_status_consumer.h" -#include "chromeos/login/auth/stub_authenticator.h" -#include "chromeos/login/auth/user_context.h" namespace chromeos { // Helper class for creating a StubAuthenticator with certain configuration. // Useful in tests for injecting StubAuthenticators to be used during user // login. -class COMPONENT_EXPORT(CHROMEOS_LOGIN_AUTH) StubAuthenticatorBuilder { +class COMPONENT_EXPORT(ASH_LOGIN_AUTH) StubAuthenticatorBuilder { public: explicit StubAuthenticatorBuilder(const UserContext& expected_user_context); @@ -78,4 +78,4 @@ using ::chromeos::StubAuthenticatorBuilder; } -#endif // CHROMEOS_LOGIN_AUTH_STUB_AUTHENTICATOR_BUILDER_H_ +#endif // ASH_COMPONENTS_LOGIN_AUTH_STUB_AUTHENTICATOR_BUILDER_H_
diff --git a/chromeos/login/auth/sync_trusted_vault_keys.cc b/ash/components/login/auth/sync_trusted_vault_keys.cc similarity index 98% rename from chromeos/login/auth/sync_trusted_vault_keys.cc rename to ash/components/login/auth/sync_trusted_vault_keys.cc index 1d97b8ed..cedc043 100644 --- a/chromeos/login/auth/sync_trusted_vault_keys.cc +++ b/ash/components/login/auth/sync_trusted_vault_keys.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/login/auth/sync_trusted_vault_keys.h" +#include "ash/components/login/auth/sync_trusted_vault_keys.h" #include "base/bind.h" #include "base/callback.h"
diff --git a/chromeos/login/auth/sync_trusted_vault_keys.h b/ash/components/login/auth/sync_trusted_vault_keys.h similarity index 87% rename from chromeos/login/auth/sync_trusted_vault_keys.h rename to ash/components/login/auth/sync_trusted_vault_keys.h index 0698af5..334dd168 100644 --- a/chromeos/login/auth/sync_trusted_vault_keys.h +++ b/ash/components/login/auth/sync_trusted_vault_keys.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_LOGIN_AUTH_SYNC_TRUSTED_VAULT_KEYS_H_ -#define CHROMEOS_LOGIN_AUTH_SYNC_TRUSTED_VAULT_KEYS_H_ +#ifndef ASH_COMPONENTS_LOGIN_AUTH_SYNC_TRUSTED_VAULT_KEYS_H_ +#define ASH_COMPONENTS_LOGIN_AUTH_SYNC_TRUSTED_VAULT_KEYS_H_ #include <string> #include <vector> @@ -17,7 +17,7 @@ namespace chromeos { // Struct which holds keys about a user's encryption keys during signin flow. -class COMPONENT_EXPORT(CHROMEOS_LOGIN_AUTH) SyncTrustedVaultKeys { +class COMPONENT_EXPORT(ASH_LOGIN_AUTH) SyncTrustedVaultKeys { public: SyncTrustedVaultKeys(); SyncTrustedVaultKeys(const SyncTrustedVaultKeys&); @@ -62,4 +62,4 @@ using ::chromeos::SyncTrustedVaultKeys; } -#endif // CHROMEOS_LOGIN_AUTH_SYNC_TRUSTED_VAULT_KEYS_H_ +#endif // ASH_COMPONENTS_LOGIN_AUTH_SYNC_TRUSTED_VAULT_KEYS_H_
diff --git a/chromeos/login/auth/sync_trusted_vault_keys_unittest.cc b/ash/components/login/auth/sync_trusted_vault_keys_unittest.cc similarity index 98% rename from chromeos/login/auth/sync_trusted_vault_keys_unittest.cc rename to ash/components/login/auth/sync_trusted_vault_keys_unittest.cc index 923c255..f6d9333 100644 --- a/chromeos/login/auth/sync_trusted_vault_keys_unittest.cc +++ b/ash/components/login/auth/sync_trusted_vault_keys_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/login/auth/sync_trusted_vault_keys.h" +#include "ash/components/login/auth/sync_trusted_vault_keys.h" #include "base/values.h" #include "testing/gmock/include/gmock/gmock.h"
diff --git a/chromeos/login/auth/test_attempt_state.cc b/ash/components/login/auth/test_attempt_state.cc similarity index 94% rename from chromeos/login/auth/test_attempt_state.cc rename to ash/components/login/auth/test_attempt_state.cc index 7b33023..0ad09f8 100644 --- a/chromeos/login/auth/test_attempt_state.cc +++ b/ash/components/login/auth/test_attempt_state.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/login/auth/test_attempt_state.h" +#include "ash/components/login/auth/test_attempt_state.h" #include <utility>
diff --git a/chromeos/login/auth/test_attempt_state.h b/ash/components/login/auth/test_attempt_state.h similarity index 78% rename from chromeos/login/auth/test_attempt_state.h rename to ash/components/login/auth/test_attempt_state.h index 9393553..2318f5e 100644 --- a/chromeos/login/auth/test_attempt_state.h +++ b/ash/components/login/auth/test_attempt_state.h
@@ -2,22 +2,22 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef CHROMEOS_LOGIN_AUTH_TEST_ATTEMPT_STATE_H_ -#define CHROMEOS_LOGIN_AUTH_TEST_ATTEMPT_STATE_H_ +#ifndef ASH_COMPONENTS_LOGIN_AUTH_TEST_ATTEMPT_STATE_H_ +#define ASH_COMPONENTS_LOGIN_AUTH_TEST_ATTEMPT_STATE_H_ #include <memory> +#include "ash/components/login/auth/auth_attempt_state.h" +#include "ash/components/login/auth/auth_status_consumer.h" #include "base/compiler_specific.h" #include "base/component_export.h" -#include "chromeos/login/auth/auth_attempt_state.h" -#include "chromeos/login/auth/auth_status_consumer.h" #include "google_apis/gaia/gaia_auth_consumer.h" namespace chromeos { class UserContext; -class COMPONENT_EXPORT(CHROMEOS_LOGIN_AUTH) TestAttemptState +class COMPONENT_EXPORT(ASH_LOGIN_AUTH) TestAttemptState : public AuthAttemptState { public: explicit TestAttemptState(std::unique_ptr<UserContext> credentials); @@ -47,4 +47,4 @@ using ::chromeos::TestAttemptState; } -#endif // CHROMEOS_LOGIN_AUTH_TEST_ATTEMPT_STATE_H_ +#endif // ASH_COMPONENTS_LOGIN_AUTH_TEST_ATTEMPT_STATE_H_
diff --git a/chromeos/login/auth/user_context.cc b/ash/components/login/auth/user_context.cc similarity index 98% rename from chromeos/login/auth/user_context.cc rename to ash/components/login/auth/user_context.cc index 29bfacd..296f457 100644 --- a/chromeos/login/auth/user_context.cc +++ b/ash/components/login/auth/user_context.cc
@@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "chromeos/login/auth/user_context.h" +#include "ash/components/login/auth/user_context.h" + #include "components/user_manager/user.h" #include "components/user_manager/user_manager.h" #include "components/user_manager/user_names.h"
diff --git a/chromeos/login/auth/user_context.h b/ash/components/login/auth/user_context.h similarity index 94% rename from chromeos/login/auth/user_context.h rename to ash/components/login/auth/user_context.h index b89ad081..732522e 100644 --- a/chromeos/login/auth/user_context.h +++ b/ash/components/login/auth/user_context.h
@@ -2,16 +2,16 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef CHROMEOS_LOGIN_AUTH_USER_CONTEXT_H_ -#define CHROMEOS_LOGIN_AUTH_USER_CONTEXT_H_ +#ifndef ASH_COMPONENTS_LOGIN_AUTH_USER_CONTEXT_H_ +#define ASH_COMPONENTS_LOGIN_AUTH_USER_CONTEXT_H_ #include <string> +#include "ash/components/login/auth/challenge_response_key.h" +#include "ash/components/login/auth/key.h" +#include "ash/components/login/auth/saml_password_attributes.h" +#include "ash/components/login/auth/sync_trusted_vault_keys.h" #include "base/component_export.h" -#include "chromeos/login/auth/challenge_response_key.h" -#include "chromeos/login/auth/key.h" -#include "chromeos/login/auth/saml_password_attributes.h" -#include "chromeos/login/auth/sync_trusted_vault_keys.h" #include "components/account_id/account_id.h" #include "components/password_manager/core/browser/password_hash_data.h" #include "components/user_manager/user_type.h" @@ -30,7 +30,7 @@ // |auth_code_|. // The |user_id_hash_| is used to locate the user's home directory // mount point for the user. It is set when the mount has been completed. -class COMPONENT_EXPORT(CHROMEOS_LOGIN_AUTH) UserContext { +class COMPONENT_EXPORT(ASH_LOGIN_AUTH) UserContext { public: // The authentication flow used during sign-in. enum AuthFlow { @@ -198,4 +198,4 @@ using ::chromeos::UserContext; } -#endif // CHROMEOS_LOGIN_AUTH_USER_CONTEXT_H_ +#endif // ASH_COMPONENTS_LOGIN_AUTH_USER_CONTEXT_H_
diff --git a/ash/constants/ash_features.cc b/ash/constants/ash_features.cc index acf18902d..03b1008c 100644 --- a/ash/constants/ash_features.cc +++ b/ash/constants/ash_features.cc
@@ -1192,6 +1192,10 @@ const base::Feature kTerminalSSH{"TerminalSSH", base::FEATURE_DISABLED_BY_DEFAULT}; +// Enables tmux integration in the Terminal System App. +const base::Feature kTerminalTmuxIntegration{"TerminalTmuxIntegration", + base::FEATURE_DISABLED_BY_DEFAULT}; + // Enables the Settings UI to show data usage for cellular networks. const base::Feature kTrafficCountersSettingsUi{ "TrafficCountersSettingsUi", base::FEATURE_ENABLED_BY_DEFAULT};
diff --git a/ash/constants/ash_features.h b/ash/constants/ash_features.h index 56d9c8b6..6375779d 100644 --- a/ash/constants/ash_features.h +++ b/ash/constants/ash_features.h
@@ -453,6 +453,8 @@ COMPONENT_EXPORT(ASH_CONSTANTS) extern const base::Feature kTelemetryExtension; COMPONENT_EXPORT(ASH_CONSTANTS) extern const base::Feature kTerminalSSH; COMPONENT_EXPORT(ASH_CONSTANTS) +extern const base::Feature kTerminalTmuxIntegration; +COMPONENT_EXPORT(ASH_CONSTANTS) extern const base::Feature kTrafficCountersSettingsUi; COMPONENT_EXPORT(ASH_CONSTANTS) extern const base::Feature kTrilinearFiltering; COMPONENT_EXPORT(ASH_CONSTANTS)
diff --git a/ash/login/ui/smart_lock_auth_factor_model.cc b/ash/login/ui/smart_lock_auth_factor_model.cc index 1ddab8a..eb29a25 100644 --- a/ash/login/ui/smart_lock_auth_factor_model.cc +++ b/ash/login/ui/smart_lock_auth_factor_model.cc
@@ -150,8 +150,7 @@ } bool SmartLockAuthFactorModel::ShouldAnnounceLabel() const { - // TODO(crbug.com/1233614): Return 'true' depending on SmartLockState. - return false; + return true; } int SmartLockAuthFactorModel::GetAccessibleNameId() const {
diff --git a/ash/login/ui/smart_lock_auth_factor_model_unittest.cc b/ash/login/ui/smart_lock_auth_factor_model_unittest.cc index 29c8ebe..b5d3dfa 100644 --- a/ash/login/ui/smart_lock_auth_factor_model_unittest.cc +++ b/ash/login/ui/smart_lock_auth_factor_model_unittest.cc
@@ -227,6 +227,7 @@ } EXPECT_EQ(testcase.label_id, model_->GetLabelId()); EXPECT_EQ(testcase.accessible_name_id, model_->GetAccessibleNameId()); + EXPECT_TRUE(model_->ShouldAnnounceLabel()); } }
diff --git a/ash/projector/projector_controller_impl.cc b/ash/projector/projector_controller_impl.cc index 0b298ba..921be9e 100644 --- a/ash/projector/projector_controller_impl.cc +++ b/ash/projector/projector_controller_impl.cc
@@ -9,6 +9,7 @@ #include "ash/projector/projector_metadata_controller.h" #include "ash/projector/projector_ui_controller.h" #include "ash/public/cpp/projector/projector_client.h" +#include "ash/public/cpp/projector/projector_new_screencast_precondition.h" #include "ash/public/cpp/projector/projector_session.h" #include "ash/shell.h" #include "ash/strings/grit/ash_strings.h" @@ -79,7 +80,8 @@ void ProjectorControllerImpl::StartProjectorSession( const std::string& storage_dir) { - DCHECK(CanStartNewSession()); + DCHECK_EQ(GetNewScreencastPrecondition().state, + NewScreencastPreconditionState::kEnabled); auto* controller = CaptureModeController::Get(); if (!controller->is_recording_in_progress()) { @@ -156,12 +158,62 @@ ProjectorController::AreExtendedProjectorFeaturesDisabled(); } -bool ProjectorControllerImpl::CanStartNewSession() const { - // TODO(crbug.com/1165435) Add other pre-conditions to starting a new - // projector session. - return IsEligible() && !projector_session_->is_active() && - client_->IsDriveFsMounted() && - !CaptureModeController::Get()->is_recording_in_progress(); +NewScreencastPrecondition +ProjectorControllerImpl::GetNewScreencastPrecondition() const { + NewScreencastPrecondition result; + + // For development purposes on the x11 simulator, on-device speech recognition + // and DriveFS are not supported. + if (!ProjectorController::AreExtendedProjectorFeaturesDisabled()) { + switch (speech_recognition_availability_) { + case SpeechRecognitionAvailability:: + kOnDeviceSpeechRecognitionNotSupported: + result.state = NewScreencastPreconditionState::kDisabled; + result.reasons = {NewScreencastPreconditionReason:: + kOnDeviceSpeechRecognitionNotSupported}; + return result; + case SpeechRecognitionAvailability::kUserLanguageNotSupported: + result.state = NewScreencastPreconditionState::kDisabled; + result.reasons = { + NewScreencastPreconditionReason::kUserLocaleNotSupported}; + return result; + + // We will attempt to install SODA. + case SpeechRecognitionAvailability::kSodaNotInstalled: + case SpeechRecognitionAvailability::kSodaInstalling: + result.state = NewScreencastPreconditionState::kDisabled; + result.reasons = { + NewScreencastPreconditionReason::kSodaDownloadInProgress}; + return result; + case SpeechRecognitionAvailability::kAvailable: + break; + } + + if (!client_->IsDriveFsMounted()) { + result.state = NewScreencastPreconditionState::kDisabled; + result.reasons = {NewScreencastPreconditionReason::kOthers}; + return result; + } + + // TODO(crbug.com/1165435) Disable New Screencast button when out of disk + // space or drive quota. + } + + if (projector_session_->is_active()) { + result.state = NewScreencastPreconditionState::kDisabled; + result.reasons = {NewScreencastPreconditionReason::kInProjectorSession}; + return result; + } + + if (CaptureModeController::Get()->is_recording_in_progress()) { + result.state = NewScreencastPreconditionState::kDisabled; + result.reasons = { + NewScreencastPreconditionReason::kScreenRecordingInProgress}; + return result; + } + + result.state = NewScreencastPreconditionState::kEnabled; + return result; } void ProjectorControllerImpl::OnToolSet(const AnnotatorTool& tool) { @@ -190,8 +242,11 @@ } void ProjectorControllerImpl::OnRecordingStarted(bool is_in_projector_mode) { - if (!is_in_projector_mode) + if (!is_in_projector_mode) { + OnNewScreencastPreconditionChanged(); return; + } + ui_controller_->ShowToolbar(); StartSpeechRecognition(); ui_controller_->OnRecordingStateChanged(true /* started */); @@ -199,8 +254,11 @@ } void ProjectorControllerImpl::OnRecordingEnded(bool is_in_projector_mode) { - if (!is_in_projector_mode) + if (!is_in_projector_mode) { + OnNewScreencastPreconditionChanged(); return; + } + DCHECK(projector_session_->is_active()); StopSpeechRecognition(); @@ -279,7 +337,7 @@ } void ProjectorControllerImpl::OnNewScreencastPreconditionChanged() { - client_->OnNewScreencastPreconditionChanged(CanStartNewSession()); + client_->OnNewScreencastPreconditionChanged(GetNewScreencastPrecondition()); } void ProjectorControllerImpl::SetProjectorUiControllerForTest(
diff --git a/ash/projector/projector_controller_impl.h b/ash/projector/projector_controller_impl.h index 9076ce9..7bb8cf4 100644 --- a/ash/projector/projector_controller_impl.h +++ b/ash/projector/projector_controller_impl.h
@@ -50,7 +50,7 @@ void OnTranscription(const media::SpeechRecognitionResult& result) override; void OnTranscriptionError() override; bool IsEligible() const override; - bool CanStartNewSession() const override; + NewScreencastPrecondition GetNewScreencastPrecondition() const override; void OnToolSet(const AnnotatorTool& tool) override; void OnUndoRedoAvailabilityChanged(bool undo_available, bool redo_available) override;
diff --git a/ash/projector/projector_controller_unittest.cc b/ash/projector/projector_controller_unittest.cc index 5ae437d..7f6e716 100644 --- a/ash/projector/projector_controller_unittest.cc +++ b/ash/projector/projector_controller_unittest.cc
@@ -14,6 +14,7 @@ #include "ash/projector/test/mock_projector_client.h" #include "ash/projector/test/mock_projector_metadata_controller.h" #include "ash/projector/test/mock_projector_ui_controller.h" +#include "ash/public/cpp/projector/projector_new_screencast_precondition.h" #include "ash/public/cpp/projector/projector_session.h" #include "ash/test/ash_test_base.h" #include "base/files/file_path.h" @@ -235,7 +236,9 @@ EXPECT_CALL(mock_client_, CloseSelfieCam()).Times(1); EXPECT_CALL(mock_client_, OpenProjectorApp()); EXPECT_CALL(mock_client_, - OnNewScreencastPreconditionChanged(/*can_start=*/false)); + OnNewScreencastPreconditionChanged(NewScreencastPrecondition( + NewScreencastPreconditionState::kDisabled, + {NewScreencastPreconditionReason::kInProjectorSession}))); // Advance clock to 20:02:10 Jan 2nd, 2021. base::Time start_time; @@ -248,8 +251,10 @@ base::RunLoop runLoop; controller_->CreateScreencastContainerFolder(base::BindLambdaForTesting( [&](const base::FilePath& screencast_file_path_no_extension) { - EXPECT_CALL(mock_client_, - OnNewScreencastPreconditionChanged(/*can_start=*/true)); + EXPECT_CALL( + mock_client_, + OnNewScreencastPreconditionChanged(NewScreencastPrecondition( + NewScreencastPreconditionState::kEnabled, {}))); EXPECT_CALL(mock_client_, StopSpeechRecognition()); EXPECT_CALL(*mock_ui_controller_,
diff --git a/ash/projector/projector_feature_pod_controller.cc b/ash/projector/projector_feature_pod_controller.cc index 75d526a..4b305f7 100644 --- a/ash/projector/projector_feature_pod_controller.cc +++ b/ash/projector/projector_feature_pod_controller.cc
@@ -7,6 +7,7 @@ #include "ash/projector/model/projector_session_impl.h" #include "ash/projector/projector_controller_impl.h" #include "ash/projector/projector_ui_controller.h" +#include "ash/public/cpp/projector/projector_new_screencast_precondition.h" #include "ash/public/cpp/projector/projector_session.h" #include "ash/resources/vector_icons/vector_icons.h" #include "ash/session/session_controller_impl.h" @@ -48,7 +49,8 @@ DCHECK(projector_controller); button_->SetVisible( !Shell::Get()->session_controller()->IsUserSessionBlocked() && - projector_controller->CanStartNewSession()); + projector_controller->GetNewScreencastPrecondition().state == + NewScreencastPreconditionState::kEnabled); button_->SetToggled( projector_controller->ui_controller()->model()->bar_enabled()); return button_;
diff --git a/ash/projector/test/mock_projector_client.h b/ash/projector/test/mock_projector_client.h index fb806a96..a678185 100644 --- a/ash/projector/test/mock_projector_client.h +++ b/ash/projector/test/mock_projector_client.h
@@ -33,7 +33,8 @@ MOCK_METHOD0(CloseSelfieCam, void()); MOCK_CONST_METHOD0(OpenProjectorApp, void()); MOCK_CONST_METHOD0(MinimizeProjectorApp, void()); - MOCK_CONST_METHOD1(OnNewScreencastPreconditionChanged, void(bool)); + MOCK_CONST_METHOD1(OnNewScreencastPreconditionChanged, + void(const NewScreencastPrecondition&)); bool IsSelfieCamVisible() const override; void SetSelfieCamVisible(bool visible);
diff --git a/ash/public/cpp/BUILD.gn b/ash/public/cpp/BUILD.gn index 600a4ffb..6267301 100644 --- a/ash/public/cpp/BUILD.gn +++ b/ash/public/cpp/BUILD.gn
@@ -235,6 +235,8 @@ "projector/projector_client.h", "projector/projector_controller.cc", "projector/projector_controller.h", + "projector/projector_new_screencast_precondition.cc", + "projector/projector_new_screencast_precondition.h", "projector/projector_session.cc", "projector/projector_session.h", "resize_shadow_type.h",
diff --git a/ash/public/cpp/projector/projector_client.h b/ash/public/cpp/projector/projector_client.h index 3bd432d..b04c0aa 100644 --- a/ash/public/cpp/projector/projector_client.h +++ b/ash/public/cpp/projector/projector_client.h
@@ -13,6 +13,8 @@ namespace ash { +struct NewScreencastPrecondition; + // Creates interface to access Browser side functionalities for the // ProjectorControllerImpl. class ASH_PUBLIC_EXPORT ProjectorClient { @@ -41,7 +43,8 @@ virtual bool IsSelfieCamVisible() const = 0; // Notifies the Projector SWA if it can trigger a new Projector session. - virtual void OnNewScreencastPreconditionChanged(bool can_start) const = 0; + virtual void OnNewScreencastPreconditionChanged( + const NewScreencastPrecondition& precondition) const = 0; }; } // namespace ash
diff --git a/ash/public/cpp/projector/projector_controller.h b/ash/public/cpp/projector/projector_controller.h index 9bf25fde1..1456344 100644 --- a/ash/public/cpp/projector/projector_controller.h +++ b/ash/public/cpp/projector/projector_controller.h
@@ -12,6 +12,7 @@ namespace ash { struct AnnotatorTool; +struct NewScreencastPrecondition; // File extension of Projector metadata file. It is used to identify Projector // screencasts at processing pending screencasts and fetching screencast list. @@ -74,7 +75,7 @@ virtual bool IsEligible() const = 0; // Returns true if we can start a new Projector session. - virtual bool CanStartNewSession() const = 0; + virtual NewScreencastPrecondition GetNewScreencastPrecondition() const = 0; // The following functions are callbacks from the annotator back to the // ProjectorController.
diff --git a/ash/public/cpp/projector/projector_new_screencast_precondition.cc b/ash/public/cpp/projector/projector_new_screencast_precondition.cc new file mode 100644 index 0000000..813dbb4 --- /dev/null +++ b/ash/public/cpp/projector/projector_new_screencast_precondition.cc
@@ -0,0 +1,48 @@ +// Copyright 2021 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 "ash/public/cpp/projector/projector_new_screencast_precondition.h" + +#include "base/values.h" + +namespace ash { + +namespace { +constexpr char kState[] = "state"; +constexpr char kReasons[] = "reasons"; +} // namespace + +NewScreencastPrecondition::NewScreencastPrecondition() = default; + +NewScreencastPrecondition::NewScreencastPrecondition( + NewScreencastPreconditionState new_state, + const std::vector<NewScreencastPreconditionReason>& new_state_reason) + : state(new_state), reasons(new_state_reason) {} + +NewScreencastPrecondition::NewScreencastPrecondition( + const NewScreencastPrecondition&) = default; + +NewScreencastPrecondition& NewScreencastPrecondition::operator=( + const NewScreencastPrecondition&) = default; + +NewScreencastPrecondition::~NewScreencastPrecondition() = default; + +base::Value NewScreencastPrecondition::ToValue() const { + base::Value result(base::Value::Type::DICTIONARY); + result.SetIntKey(kState, static_cast<int>(state)); + + base::Value reasons_value(base::Value::Type::LIST); + for (const auto& reason : reasons) + reasons_value.Append(static_cast<int>(reason)); + + result.SetKey(kReasons, std::move(reasons_value)); + return result; +} + +bool NewScreencastPrecondition::operator==( + const NewScreencastPrecondition& rhs) const { + return rhs.state == state && rhs.reasons == reasons; +} + +} // namespace ash
diff --git a/ash/public/cpp/projector/projector_new_screencast_precondition.h b/ash/public/cpp/projector/projector_new_screencast_precondition.h new file mode 100644 index 0000000..e60dedc --- /dev/null +++ b/ash/public/cpp/projector/projector_new_screencast_precondition.h
@@ -0,0 +1,64 @@ +// Copyright 2021 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 ASH_PUBLIC_CPP_PROJECTOR_PROJECTOR_NEW_SCREENCAST_PRECONDITION_H_ +#define ASH_PUBLIC_CPP_PROJECTOR_PROJECTOR_NEW_SCREENCAST_PRECONDITION_H_ + +#include <vector> + +#include "ash/public/cpp/ash_public_export.h" + +namespace base { +class Value; +} // namespace base + +namespace ash { + +// The new screencast button state in the Projector SWA. +// Ensure that this enum class is synchronized with +// NewScreencastPreconditionState enum in +// //ash/webui/projector_app/resources/communication/message_types.js. +enum class ASH_PUBLIC_EXPORT NewScreencastPreconditionState { + // The new screencast button is visible but is disabled. + kDisabled = 1, + // The new screencast button is enabled and the user can create new ones now. + kEnabled = 2 +}; + +// The reason for the new screencast button state. +// Ensure that this enum class is synchronized with +// NewScreencastPreconditionReason enum in +// //ash/webui/projector_app/resources/communication/message_types.js. +enum class ASH_PUBLIC_EXPORT NewScreencastPreconditionReason { + kOnDeviceSpeechRecognitionNotSupported = 1, + kUserLocaleNotSupported = 2, + kInProjectorSession = 3, + kScreenRecordingInProgress = 4, + kSodaDownloadInProgress = 5, + kOutOfDiskSpace = 6, + kNoMic = 7, + kOthers = 8 +}; + +// Struct used to provide the new screen cast precondition state and the reasons +// for such a state. +struct ASH_PUBLIC_EXPORT NewScreencastPrecondition { + NewScreencastPrecondition(); + NewScreencastPrecondition( + NewScreencastPreconditionState new_state, + const std::vector<NewScreencastPreconditionReason>& new_state_reason); + NewScreencastPrecondition(const NewScreencastPrecondition&); + NewScreencastPrecondition& operator=(const NewScreencastPrecondition&); + ~NewScreencastPrecondition(); + + base::Value ToValue() const; + bool operator==(const NewScreencastPrecondition& rhs) const; + + NewScreencastPreconditionState state; + std::vector<NewScreencastPreconditionReason> reasons; +}; + +} // namespace ash + +#endif // ASH_PUBLIC_CPP_PROJECTOR_PROJECTOR_NEW_SCREENCAST_PRECONDITION_H_
diff --git a/ash/public/cpp/test/mock_projector_controller.h b/ash/public/cpp/test/mock_projector_controller.h index f5e6f7d6..ea07bb0 100644 --- a/ash/public/cpp/test/mock_projector_controller.h +++ b/ash/public/cpp/test/mock_projector_controller.h
@@ -6,6 +6,7 @@ #define ASH_PUBLIC_CPP_TEST_MOCK_PROJECTOR_CONTROLLER_H_ #include "ash/public/cpp/projector/projector_controller.h" +#include "ash/public/cpp/projector/projector_new_screencast_precondition.h" #include "testing/gmock/include/gmock/gmock.h" namespace ash { @@ -27,7 +28,7 @@ MOCK_METHOD0(OnTranscriptionError, void()); MOCK_METHOD1(SetProjectorToolsVisible, void(bool is_visible)); MOCK_CONST_METHOD0(IsEligible, bool()); - MOCK_CONST_METHOD0(CanStartNewSession, bool()); + MOCK_CONST_METHOD0(GetNewScreencastPrecondition, NewScreencastPrecondition()); MOCK_METHOD1(OnToolSet, void(const AnnotatorTool& tool)); MOCK_METHOD2(OnUndoRedoAvailabilityChanged, void(bool undo_available, bool redo_available));
diff --git a/ash/quick_pair/common/fast_pair/fast_pair_metrics.h b/ash/quick_pair/common/fast_pair/fast_pair_metrics.h index 36ee1b34..71d76d86 100644 --- a/ash/quick_pair/common/fast_pair/fast_pair_metrics.h +++ b/ash/quick_pair/common/fast_pair/fast_pair_metrics.h
@@ -21,10 +21,12 @@ kDiscoveryUiShown = 1, kDiscoveryUiDismissed = 11, kDiscoveryUiConnectPressed = 12, + kDiscoveryUiDismissedByUser = 13, kPairingFailed = 121, kPairingSucceeded = 122, kErrorUiDismissed = 1211, kErrorUiSettingsPressed = 1212, + kErrorUiDismissedByUser = 1213, }; // These values are persisted to logs. Entries should not be renumbered and
diff --git a/ash/quick_pair/keyed_service/quick_pair_metrics_logger.cc b/ash/quick_pair/keyed_service/quick_pair_metrics_logger.cc index 8eb0540..1631fae 100644 --- a/ash/quick_pair/keyed_service/quick_pair_metrics_logger.cc +++ b/ash/quick_pair/keyed_service/quick_pair_metrics_logger.cc
@@ -67,7 +67,6 @@ base::TimeDelta total_pair_time = base::TimeTicks::Now() - device_pairing_start_timestamps_[device]; AttemptRecordingTotalUxPairTime(*device, total_pair_time); - RecordPairingMethod(PairingMethod::kFastPair); // The classic address is assigned to the Device during the @@ -101,6 +100,10 @@ device_pairing_start_timestamps_[device] = base::TimeTicks::Now(); break; case DiscoveryAction::kDismissedByUser: + AttemptRecordingFastPairEngagementFlow( + *device, FastPairEngagementFlowEvent::kDiscoveryUiDismissedByUser); + feature_usage_metrics_logger_->RecordUsage(/*success=*/true); + break; case DiscoveryAction::kDismissed: AttemptRecordingFastPairEngagementFlow( *device, FastPairEngagementFlowEvent::kDiscoveryUiDismissed); @@ -118,6 +121,9 @@ *device, FastPairEngagementFlowEvent::kErrorUiSettingsPressed); break; case PairingFailedAction::kDismissedByUser: + AttemptRecordingFastPairEngagementFlow( + *device, FastPairEngagementFlowEvent::kErrorUiDismissedByUser); + break; case PairingFailedAction::kDismissed: AttemptRecordingFastPairEngagementFlow( *device, FastPairEngagementFlowEvent::kErrorUiDismissed);
diff --git a/ash/quick_pair/keyed_service/quick_pair_metrics_logger_unittest.cc b/ash/quick_pair/keyed_service/quick_pair_metrics_logger_unittest.cc index 57cf0e2..83547adf 100644 --- a/ash/quick_pair/keyed_service/quick_pair_metrics_logger_unittest.cc +++ b/ash/quick_pair/keyed_service/quick_pair_metrics_logger_unittest.cc
@@ -139,6 +139,21 @@ void SimulateDiscoveryUiDismissed(Protocol protocol) { switch (protocol) { case Protocol::kFastPairInitial: + mock_ui_broker_->NotifyDiscoveryAction(initial_device_, + DiscoveryAction::kDismissed); + break; + case Protocol::kFastPairSubsequent: + mock_ui_broker_->NotifyDiscoveryAction(subsequent_device_, + DiscoveryAction::kDismissed); + break; + case Protocol::kFastPairRetroactive: + break; + } + } + + void SimulateDiscoveryUiDismissedByUser(Protocol protocol) { + switch (protocol) { + case Protocol::kFastPairInitial: mock_ui_broker_->NotifyDiscoveryAction( initial_device_, DiscoveryAction::kDismissedByUser); break; @@ -198,7 +213,7 @@ } } - void SimulateErrorUiDismissed(Protocol protocol) { + void SimulateErrorUiDismissedByUser(Protocol protocol) { switch (protocol) { case Protocol::kFastPairInitial: mock_ui_broker_->NotifyPairingFailedAction( @@ -213,6 +228,21 @@ } } + void SimulateErrorUiDismissed(Protocol protocol) { + switch (protocol) { + case Protocol::kFastPairInitial: + mock_ui_broker_->NotifyPairingFailedAction( + initial_device_, PairingFailedAction::kDismissed); + break; + case Protocol::kFastPairSubsequent: + mock_ui_broker_->NotifyPairingFailedAction( + subsequent_device_, PairingFailedAction::kDismissed); + break; + case Protocol::kFastPairRetroactive: + break; + } + } + void SimulateErrorUiSettingsPressed(Protocol protocol) { switch (protocol) { case Protocol::kFastPairInitial: @@ -354,6 +384,14 @@ kFastPairEngagementFlowMetricInitial, FastPairEngagementFlowEvent::kErrorUiSettingsPressed), 0); + EXPECT_EQ(histogram_tester().GetBucketCount( + kFastPairEngagementFlowMetricInitial, + FastPairEngagementFlowEvent::kErrorUiDismissedByUser), + 0); + EXPECT_EQ(histogram_tester().GetBucketCount( + kFastPairEngagementFlowMetricInitial, + FastPairEngagementFlowEvent::kDiscoveryUiDismissedByUser), + 0); } TEST_F(QuickPairMetricsLoggerTest, LogDiscoveryUiShown_Subsequent) { @@ -387,6 +425,14 @@ kFastPairEngagementFlowMetricSubsequent, FastPairEngagementFlowEvent::kErrorUiSettingsPressed), 0); + EXPECT_EQ(histogram_tester().GetBucketCount( + kFastPairEngagementFlowMetricSubsequent, + FastPairEngagementFlowEvent::kErrorUiDismissedByUser), + 0); + EXPECT_EQ(histogram_tester().GetBucketCount( + kFastPairEngagementFlowMetricSubsequent, + FastPairEngagementFlowEvent::kDiscoveryUiDismissedByUser), + 0); } TEST_F(QuickPairMetricsLoggerTest, LogDiscoveryUiDismissed_Initial) { @@ -420,6 +466,55 @@ kFastPairEngagementFlowMetricInitial, FastPairEngagementFlowEvent::kErrorUiSettingsPressed), 0); + EXPECT_EQ(histogram_tester().GetBucketCount( + kFastPairEngagementFlowMetricInitial, + FastPairEngagementFlowEvent::kErrorUiDismissedByUser), + 0); + EXPECT_EQ(histogram_tester().GetBucketCount( + kFastPairEngagementFlowMetricInitial, + FastPairEngagementFlowEvent::kDiscoveryUiDismissedByUser), + 0); +} + +TEST_F(QuickPairMetricsLoggerTest, LogDiscoveryUiDismissedByUser_Initial) { + SimulateDiscoveryUiDismissedByUser(Protocol::kFastPairInitial); + base::RunLoop().RunUntilIdle(); + EXPECT_EQ(histogram_tester().GetBucketCount( + kFastPairEngagementFlowMetricInitial, + FastPairEngagementFlowEvent::kDiscoveryUiShown), + 0); + EXPECT_EQ(histogram_tester().GetBucketCount( + kFastPairEngagementFlowMetricInitial, + FastPairEngagementFlowEvent::kDiscoveryUiDismissed), + 0); + EXPECT_EQ(histogram_tester().GetBucketCount( + kFastPairEngagementFlowMetricInitial, + FastPairEngagementFlowEvent::kDiscoveryUiConnectPressed), + 0); + EXPECT_EQ(histogram_tester().GetBucketCount( + kFastPairEngagementFlowMetricInitial, + FastPairEngagementFlowEvent::kPairingFailed), + 0); + EXPECT_EQ(histogram_tester().GetBucketCount( + kFastPairEngagementFlowMetricInitial, + FastPairEngagementFlowEvent::kPairingSucceeded), + 0); + EXPECT_EQ(histogram_tester().GetBucketCount( + kFastPairEngagementFlowMetricInitial, + FastPairEngagementFlowEvent::kErrorUiDismissed), + 0); + EXPECT_EQ(histogram_tester().GetBucketCount( + kFastPairEngagementFlowMetricInitial, + FastPairEngagementFlowEvent::kErrorUiSettingsPressed), + 0); + EXPECT_EQ(histogram_tester().GetBucketCount( + kFastPairEngagementFlowMetricInitial, + FastPairEngagementFlowEvent::kErrorUiDismissedByUser), + 0); + EXPECT_EQ(histogram_tester().GetBucketCount( + kFastPairEngagementFlowMetricInitial, + FastPairEngagementFlowEvent::kDiscoveryUiDismissedByUser), + 1); } TEST_F(QuickPairMetricsLoggerTest, LogDiscoveryUiDismissed_Subsequent) { @@ -453,6 +548,55 @@ kFastPairEngagementFlowMetricSubsequent, FastPairEngagementFlowEvent::kErrorUiSettingsPressed), 0); + EXPECT_EQ(histogram_tester().GetBucketCount( + kFastPairEngagementFlowMetricSubsequent, + FastPairEngagementFlowEvent::kErrorUiDismissedByUser), + 0); + EXPECT_EQ(histogram_tester().GetBucketCount( + kFastPairEngagementFlowMetricSubsequent, + FastPairEngagementFlowEvent::kDiscoveryUiDismissedByUser), + 0); +} + +TEST_F(QuickPairMetricsLoggerTest, LogDiscoveryUiDismissedByUser_Subsequent) { + SimulateDiscoveryUiDismissedByUser(Protocol::kFastPairSubsequent); + base::RunLoop().RunUntilIdle(); + EXPECT_EQ(histogram_tester().GetBucketCount( + kFastPairEngagementFlowMetricSubsequent, + FastPairEngagementFlowEvent::kDiscoveryUiShown), + 0); + EXPECT_EQ(histogram_tester().GetBucketCount( + kFastPairEngagementFlowMetricSubsequent, + FastPairEngagementFlowEvent::kDiscoveryUiDismissed), + 0); + EXPECT_EQ(histogram_tester().GetBucketCount( + kFastPairEngagementFlowMetricSubsequent, + FastPairEngagementFlowEvent::kDiscoveryUiConnectPressed), + 0); + EXPECT_EQ(histogram_tester().GetBucketCount( + kFastPairEngagementFlowMetricSubsequent, + FastPairEngagementFlowEvent::kPairingFailed), + 0); + EXPECT_EQ(histogram_tester().GetBucketCount( + kFastPairEngagementFlowMetricSubsequent, + FastPairEngagementFlowEvent::kPairingSucceeded), + 0); + EXPECT_EQ(histogram_tester().GetBucketCount( + kFastPairEngagementFlowMetricSubsequent, + FastPairEngagementFlowEvent::kErrorUiDismissed), + 0); + EXPECT_EQ(histogram_tester().GetBucketCount( + kFastPairEngagementFlowMetricSubsequent, + FastPairEngagementFlowEvent::kErrorUiSettingsPressed), + 0); + EXPECT_EQ(histogram_tester().GetBucketCount( + kFastPairEngagementFlowMetricSubsequent, + FastPairEngagementFlowEvent::kErrorUiDismissedByUser), + 0); + EXPECT_EQ(histogram_tester().GetBucketCount( + kFastPairEngagementFlowMetricSubsequent, + FastPairEngagementFlowEvent::kDiscoveryUiDismissedByUser), + 1); } TEST_F(QuickPairMetricsLoggerTest, LogDiscoveryUiConnectPressed_Initial) { @@ -486,6 +630,14 @@ kFastPairEngagementFlowMetricInitial, FastPairEngagementFlowEvent::kErrorUiSettingsPressed), 0); + EXPECT_EQ(histogram_tester().GetBucketCount( + kFastPairEngagementFlowMetricInitial, + FastPairEngagementFlowEvent::kErrorUiDismissedByUser), + 0); + EXPECT_EQ(histogram_tester().GetBucketCount( + kFastPairEngagementFlowMetricInitial, + FastPairEngagementFlowEvent::kDiscoveryUiDismissedByUser), + 0); } TEST_F(QuickPairMetricsLoggerTest, LogDiscoveryUiConnectPressed_Subsequent) { @@ -519,6 +671,14 @@ kFastPairEngagementFlowMetricSubsequent, FastPairEngagementFlowEvent::kErrorUiSettingsPressed), 0); + EXPECT_EQ(histogram_tester().GetBucketCount( + kFastPairEngagementFlowMetricSubsequent, + FastPairEngagementFlowEvent::kErrorUiDismissedByUser), + 0); + EXPECT_EQ(histogram_tester().GetBucketCount( + kFastPairEngagementFlowMetricSubsequent, + FastPairEngagementFlowEvent::kDiscoveryUiDismissedByUser), + 0); } TEST_F(QuickPairMetricsLoggerTest, LogPairingFailed_Initial) { @@ -552,6 +712,14 @@ kFastPairEngagementFlowMetricInitial, FastPairEngagementFlowEvent::kErrorUiSettingsPressed), 0); + EXPECT_EQ(histogram_tester().GetBucketCount( + kFastPairEngagementFlowMetricInitial, + FastPairEngagementFlowEvent::kErrorUiDismissedByUser), + 0); + EXPECT_EQ(histogram_tester().GetBucketCount( + kFastPairEngagementFlowMetricInitial, + FastPairEngagementFlowEvent::kDiscoveryUiDismissedByUser), + 0); } TEST_F(QuickPairMetricsLoggerTest, LogPairingFailed_Subsequent) { @@ -585,6 +753,14 @@ kFastPairEngagementFlowMetricSubsequent, FastPairEngagementFlowEvent::kErrorUiSettingsPressed), 0); + EXPECT_EQ(histogram_tester().GetBucketCount( + kFastPairEngagementFlowMetricSubsequent, + FastPairEngagementFlowEvent::kErrorUiDismissedByUser), + 0); + EXPECT_EQ(histogram_tester().GetBucketCount( + kFastPairEngagementFlowMetricSubsequent, + FastPairEngagementFlowEvent::kDiscoveryUiDismissedByUser), + 0); } TEST_F(QuickPairMetricsLoggerTest, LogPairingSucceeded_Initial) { @@ -618,6 +794,14 @@ kFastPairEngagementFlowMetricInitial, FastPairEngagementFlowEvent::kErrorUiSettingsPressed), 0); + EXPECT_EQ(histogram_tester().GetBucketCount( + kFastPairEngagementFlowMetricInitial, + FastPairEngagementFlowEvent::kErrorUiDismissedByUser), + 0); + EXPECT_EQ(histogram_tester().GetBucketCount( + kFastPairEngagementFlowMetricInitial, + FastPairEngagementFlowEvent::kDiscoveryUiDismissedByUser), + 0); } TEST_F(QuickPairMetricsLoggerTest, LogPairingSucceeded_Subsequent) { @@ -651,6 +835,14 @@ kFastPairEngagementFlowMetricSubsequent, FastPairEngagementFlowEvent::kErrorUiSettingsPressed), 0); + EXPECT_EQ(histogram_tester().GetBucketCount( + kFastPairEngagementFlowMetricSubsequent, + FastPairEngagementFlowEvent::kErrorUiDismissedByUser), + 0); + EXPECT_EQ(histogram_tester().GetBucketCount( + kFastPairEngagementFlowMetricSubsequent, + FastPairEngagementFlowEvent::kDiscoveryUiDismissedByUser), + 0); } TEST_F(QuickPairMetricsLoggerTest, LogErrorUiDismissed_Initial) { @@ -684,6 +876,55 @@ kFastPairEngagementFlowMetricInitial, FastPairEngagementFlowEvent::kErrorUiSettingsPressed), 0); + EXPECT_EQ(histogram_tester().GetBucketCount( + kFastPairEngagementFlowMetricInitial, + FastPairEngagementFlowEvent::kErrorUiDismissedByUser), + 0); + EXPECT_EQ(histogram_tester().GetBucketCount( + kFastPairEngagementFlowMetricInitial, + FastPairEngagementFlowEvent::kDiscoveryUiDismissedByUser), + 0); +} + +TEST_F(QuickPairMetricsLoggerTest, LogErrorUiDismissedByUser_Initial) { + SimulateErrorUiDismissedByUser(Protocol::kFastPairInitial); + base::RunLoop().RunUntilIdle(); + EXPECT_EQ(histogram_tester().GetBucketCount( + kFastPairEngagementFlowMetricInitial, + FastPairEngagementFlowEvent::kDiscoveryUiShown), + 0); + EXPECT_EQ(histogram_tester().GetBucketCount( + kFastPairEngagementFlowMetricInitial, + FastPairEngagementFlowEvent::kDiscoveryUiDismissed), + 0); + EXPECT_EQ(histogram_tester().GetBucketCount( + kFastPairEngagementFlowMetricInitial, + FastPairEngagementFlowEvent::kDiscoveryUiConnectPressed), + 0); + EXPECT_EQ(histogram_tester().GetBucketCount( + kFastPairEngagementFlowMetricInitial, + FastPairEngagementFlowEvent::kPairingFailed), + 0); + EXPECT_EQ(histogram_tester().GetBucketCount( + kFastPairEngagementFlowMetricInitial, + FastPairEngagementFlowEvent::kPairingSucceeded), + 0); + EXPECT_EQ(histogram_tester().GetBucketCount( + kFastPairEngagementFlowMetricInitial, + FastPairEngagementFlowEvent::kErrorUiDismissed), + 0); + EXPECT_EQ(histogram_tester().GetBucketCount( + kFastPairEngagementFlowMetricInitial, + FastPairEngagementFlowEvent::kErrorUiSettingsPressed), + 0); + EXPECT_EQ(histogram_tester().GetBucketCount( + kFastPairEngagementFlowMetricInitial, + FastPairEngagementFlowEvent::kErrorUiDismissedByUser), + 1); + EXPECT_EQ(histogram_tester().GetBucketCount( + kFastPairEngagementFlowMetricInitial, + FastPairEngagementFlowEvent::kDiscoveryUiDismissedByUser), + 0); } TEST_F(QuickPairMetricsLoggerTest, LogErrorUiDismissed_Subsequent) { @@ -717,6 +958,55 @@ kFastPairEngagementFlowMetricSubsequent, FastPairEngagementFlowEvent::kErrorUiSettingsPressed), 0); + EXPECT_EQ(histogram_tester().GetBucketCount( + kFastPairEngagementFlowMetricSubsequent, + FastPairEngagementFlowEvent::kErrorUiDismissedByUser), + 0); + EXPECT_EQ(histogram_tester().GetBucketCount( + kFastPairEngagementFlowMetricSubsequent, + FastPairEngagementFlowEvent::kDiscoveryUiDismissedByUser), + 0); +} + +TEST_F(QuickPairMetricsLoggerTest, LogErrorUiDismissedByUser_Subsequent) { + SimulateErrorUiDismissedByUser(Protocol::kFastPairSubsequent); + base::RunLoop().RunUntilIdle(); + EXPECT_EQ(histogram_tester().GetBucketCount( + kFastPairEngagementFlowMetricSubsequent, + FastPairEngagementFlowEvent::kDiscoveryUiShown), + 0); + EXPECT_EQ(histogram_tester().GetBucketCount( + kFastPairEngagementFlowMetricSubsequent, + FastPairEngagementFlowEvent::kDiscoveryUiDismissed), + 0); + EXPECT_EQ(histogram_tester().GetBucketCount( + kFastPairEngagementFlowMetricSubsequent, + FastPairEngagementFlowEvent::kDiscoveryUiConnectPressed), + 0); + EXPECT_EQ(histogram_tester().GetBucketCount( + kFastPairEngagementFlowMetricSubsequent, + FastPairEngagementFlowEvent::kPairingFailed), + 0); + EXPECT_EQ(histogram_tester().GetBucketCount( + kFastPairEngagementFlowMetricSubsequent, + FastPairEngagementFlowEvent::kPairingSucceeded), + 0); + EXPECT_EQ(histogram_tester().GetBucketCount( + kFastPairEngagementFlowMetricSubsequent, + FastPairEngagementFlowEvent::kErrorUiDismissed), + 0); + EXPECT_EQ(histogram_tester().GetBucketCount( + kFastPairEngagementFlowMetricSubsequent, + FastPairEngagementFlowEvent::kErrorUiSettingsPressed), + 0); + EXPECT_EQ(histogram_tester().GetBucketCount( + kFastPairEngagementFlowMetricSubsequent, + FastPairEngagementFlowEvent::kErrorUiDismissedByUser), + 1); + EXPECT_EQ(histogram_tester().GetBucketCount( + kFastPairEngagementFlowMetricSubsequent, + FastPairEngagementFlowEvent::kDiscoveryUiDismissedByUser), + 0); } TEST_F(QuickPairMetricsLoggerTest, LogErrorUiSettingsPressed_Initial) { @@ -750,6 +1040,14 @@ kFastPairEngagementFlowMetricInitial, FastPairEngagementFlowEvent::kErrorUiSettingsPressed), 1); + EXPECT_EQ(histogram_tester().GetBucketCount( + kFastPairEngagementFlowMetricInitial, + FastPairEngagementFlowEvent::kErrorUiDismissedByUser), + 0); + EXPECT_EQ(histogram_tester().GetBucketCount( + kFastPairEngagementFlowMetricInitial, + FastPairEngagementFlowEvent::kDiscoveryUiDismissedByUser), + 0); } TEST_F(QuickPairMetricsLoggerTest, LogErrorUiSettingsPressed_Subsequent) { @@ -783,6 +1081,14 @@ kFastPairEngagementFlowMetricSubsequent, FastPairEngagementFlowEvent::kErrorUiSettingsPressed), 1); + EXPECT_EQ(histogram_tester().GetBucketCount( + kFastPairEngagementFlowMetricSubsequent, + FastPairEngagementFlowEvent::kErrorUiDismissedByUser), + 0); + EXPECT_EQ(histogram_tester().GetBucketCount( + kFastPairEngagementFlowMetricSubsequent, + FastPairEngagementFlowEvent::kDiscoveryUiDismissedByUser), + 0); } TEST_F(QuickPairMetricsLoggerTest, LogPairTime_Initial) {
diff --git a/ash/shell.h b/ash/shell.h index f36c16b..1ae942b4 100644 --- a/ash/shell.h +++ b/ash/shell.h
@@ -667,7 +667,6 @@ friend class AcceleratorControllerTest; friend class AshTestHelper; friend class RootWindowController; - friend class ScopedRootWindowForNewWindows; friend class ShellTestApi; friend class SmsObserverTest;
diff --git a/ash/system/message_center/unified_message_center_bubble.cc b/ash/system/message_center/unified_message_center_bubble.cc index f2c1abce..28d4dc6 100644 --- a/ash/system/message_center/unified_message_center_bubble.cc +++ b/ash/system/message_center/unified_message_center_bubble.cc
@@ -106,8 +106,8 @@ float radius = kBubbleCornerRadius; widget_layer->SetRoundedCornerRadius({radius, radius, radius, radius}); widget_layer->SetIsFastRoundedCorner(true); + widget_layer->Add(border_->layer()); } - widget_layer->Add(border_->layer()); bubble_view_->InitializeAndShowBubble(); message_center_view_->Init(); @@ -173,8 +173,10 @@ kUnifiedMessageCenterBubbleSpacing); bubble_view_->ChangeAnchorRect(anchor_rect); - bubble_widget_->GetLayer()->StackAtTop(border_->layer()); - border_->layer()->SetBounds(message_center_view_->GetContentsBounds()); + if (!features::IsNotificationsRefreshEnabled()) { + bubble_widget_->GetLayer()->StackAtTop(border_->layer()); + border_->layer()->SetBounds(message_center_view_->GetContentsBounds()); + } } void UnifiedMessageCenterBubble::FocusEntered(bool reverse) { @@ -229,6 +231,24 @@ bubble_view_->Layout(); } +void UnifiedMessageCenterBubble::OnViewVisibilityChanged( + views::View* observed_view, + views::View* starting_view) { + // Hide the message center widget if the message center is not + // visible. This is to ensure we do not see an empty bubble. + + if (observed_view != message_center_view_) + return; + + if (observed_view->GetVisible()) { + bubble_widget_->Show(); + return; + } + + tray_->ActivateBubble(); + bubble_widget_->Hide(); +} + void UnifiedMessageCenterBubble::OnWidgetDestroying(views::Widget* widget) { CHECK_EQ(bubble_widget_, widget); tray_->tray_event_filter()->RemoveBubble(this);
diff --git a/ash/system/message_center/unified_message_center_bubble.h b/ash/system/message_center/unified_message_center_bubble.h index f506602..3f72264 100644 --- a/ash/system/message_center/unified_message_center_bubble.h +++ b/ash/system/message_center/unified_message_center_bubble.h
@@ -88,6 +88,8 @@ // views::ViewObserver: void OnViewPreferredSizeChanged(views::View* observed_view) override; + void OnViewVisibilityChanged(views::View* observed_view, + views::View* starting_view) override; // views::WidgetObserver: void OnWidgetDestroying(views::Widget* widget) override;
diff --git a/ash/system/time/calendar_view_unittest.cc b/ash/system/time/calendar_view_unittest.cc index b29ae916..4cf8ca97 100644 --- a/ash/system/time/calendar_view_unittest.cc +++ b/ash/system/time/calendar_view_unittest.cc
@@ -768,7 +768,7 @@ } // The month views and header should animate when scrolling up or down. -TEST_F(CalendarViewAnimationTest, DISABLED_MonthAndHeaderAnimation) { +TEST_F(CalendarViewAnimationTest, MonthAndHeaderAnimation) { ui::ScopedAnimationDurationScaleMode test_duration_mode( ui::ScopedAnimationDurationScaleMode::NORMAL_DURATION);
diff --git a/ash/system/unified/hps_notify_controller.cc b/ash/system/unified/hps_notify_controller.cc index 1595a03..bcca78c 100644 --- a/ash/system/unified/hps_notify_controller.cc +++ b/ash/system/unified/hps_notify_controller.cc
@@ -66,7 +66,8 @@ const bool session_active = session_state == session_manager::SessionState::ACTIVE; ReconfigureHps(hps_available_, session_active, pref_enabled_); - UpdateIconVisibility(session_active, hps_state_, pref_enabled_); + UpdateIconVisibility(session_active, hps_state_ && session_active, + pref_enabled_); } void HpsNotifyController::OnActiveUserPrefServiceChanged( @@ -76,7 +77,8 @@ const bool pref_enabled = pref_service->GetBoolean(prefs::kSnoopingProtectionEnabled); ReconfigureHps(hps_available_, session_active_, pref_enabled); - UpdateIconVisibility(session_active_, hps_state_, pref_enabled); + UpdateIconVisibility(session_active_, hps_state_ && pref_enabled, + pref_enabled); // Re-subscribe to pref changes. pref_change_registrar_ = std::make_unique<PrefChangeRegistrar>(); @@ -92,6 +94,8 @@ } void HpsNotifyController::OnRestart() { + DCHECK(!hps_state_); + ReconfigureHps(/*hps_available_=*/true, session_active_, pref_enabled_); } @@ -214,7 +218,8 @@ const bool pref_enabled = pref_change_registrar_->prefs()->GetBoolean( prefs::kSnoopingProtectionEnabled); ReconfigureHps(hps_available_, session_active_, pref_enabled); - UpdateIconVisibility(session_active_, hps_state_, pref_enabled); + UpdateIconVisibility(session_active_, hps_state_ && pref_enabled, + pref_enabled); } } // namespace ash
diff --git a/ash/system/unified/hps_notify_controller_unittest.cc b/ash/system/unified/hps_notify_controller_unittest.cc index 83e1b2d..19907ed 100644 --- a/ash/system/unified/hps_notify_controller_unittest.cc +++ b/ash/system/unified/hps_notify_controller_unittest.cc
@@ -315,6 +315,24 @@ EXPECT_TRUE(controller_->IsIconVisible()); } +// Check that the controller state stays consistent even when the daemon starts +// and stops. +TEST_F(HpsNotifyControllerTestPresent, ClearHpsState) { + SimulateLogin(); + SetEnabledPref(true); + EXPECT_EQ(controller_->IsIconVisible(), true); + + // This should internally clear the cached daemon state. + SetEnabledPref(false); + EXPECT_EQ(controller_->IsIconVisible(), false); + + // Note: we don't exhaust the run loop here since we want to check the + // controller state _before_ it is updated by asynchronous DBus calls. + Shell::Get()->session_controller()->GetActivePrefService()->SetBoolean( + prefs::kSnoopingProtectionEnabled, true); + EXPECT_EQ(controller_->IsIconVisible(), false); +} + // Fixture with the DBus service initially unavailable (using a minimal set of // valid params). class HpsNotifyControllerTestUnavailable : public HpsNotifyControllerTestBase {
diff --git a/ash/webui/camera_app_ui/resources/js/barcode_chip.js b/ash/webui/camera_app_ui/resources/js/barcode_chip.ts similarity index 84% rename from ash/webui/camera_app_ui/resources/js/barcode_chip.js rename to ash/webui/camera_app_ui/resources/js/barcode_chip.ts index 2a18044..796a944 100644 --- a/ash/webui/camera_app_ui/resources/js/barcode_chip.js +++ b/ash/webui/camera_app_ui/resources/js/barcode_chip.ts
@@ -21,21 +21,18 @@ /** * The detected string that is being shown currently. - * @type {?string} */ -let currentCode = null; +let currentCode: string|null = null; /** * The barcode chip container that is being shown currently. - * @type {?HTMLElement} */ -let currentChip = null; +let currentChip: HTMLElement|null = null; /** * The countdown timer for dismissing the chip. - * @type {?OneShotTimer} */ -let currentTimer = null; +let currentTimer: OneShotTimer|null = null; /** * Resets the variables of the current state and dismisses the chip. @@ -51,9 +48,9 @@ /** * Activates the chip on container and starts the timer. - * @param {!HTMLElement} container The container of the chip. + * @param container The container of the chip. */ -function activate(container) { +function activate(container: HTMLElement) { container.classList.remove('invisible'); currentChip = container; @@ -67,10 +64,8 @@ /** * Checks whether a string is a regular url link with http or https protocol. - * @param {string} s - * @return {boolean} */ -function isSafeUrl(s) { +function isSafeUrl(s: string): boolean { try { const url = new URL(s); if (url.protocol !== 'http:' && url.protocol !== 'https:') { @@ -87,13 +82,15 @@ /** * Setups the copy button. - * @param {!HTMLElement} container The container for the button. - * @param {string} content The content to be copied. - * @param {!I18nString} snackbarLabel The label to be displayed on snackbar when - * the content is copied. - * @return {!HTMLElement} The copy button element. + * @param container The container for the button. + * @param content The content to be copied. + * @param snackbarLabel The label to be displayed on snackbar when the content + * is copied. + * @return The copy button element. */ -function setupCopyButton(container, content, snackbarLabel) { +function setupCopyButton( + container: HTMLElement, content: string, + snackbarLabel: I18nString): HTMLElement { const copyButton = dom.getFrom(container, '.barcode-copy-button', HTMLButtonElement); copyButton.onclick = async () => { @@ -105,9 +102,8 @@ /** * Shows an actionable url chip. - * @param {string} url */ -function showUrl(url) { +function showUrl(url: string) { const container = dom.get('#barcode-chip-url-container', HTMLDivElement); activate(container); @@ -128,9 +124,8 @@ /** * Shows an actionable text chip. - * @param {string} text */ -function showText(text) { +function showText(text: string) { const container = dom.get('#barcode-chip-text-container', HTMLDivElement); activate(container); container.classList.remove('expanded'); @@ -161,9 +156,8 @@ /** * Shows an actionable chip for the string detected from a barcode. - * @param {string} code */ -export async function show(code) { +export async function show(code: string): Promise<void> { if (code === currentCode) { if (currentTimer !== null) { // Extend the duration by resetting the timeout. @@ -192,7 +186,7 @@ /** * Dismisses the current barcode chip if it's being shown. */ -export function dismiss() { +export function dismiss(): void { if (currentTimer === null) { return; }
diff --git a/ash/webui/camera_app_ui/resources/js/js.gni b/ash/webui/camera_app_ui/resources/js/js.gni index 29372572..b2f1d687 100644 --- a/ash/webui/camera_app_ui/resources/js/js.gni +++ b/ash/webui/camera_app_ui/resources/js/js.gni
@@ -7,7 +7,7 @@ "app_window.ts", "assert.ts", "async_job_queue.ts", - "barcode_chip.js", + "barcode_chip.ts", "css.ts", "device/camera3_device_info.js", "device/constraints_preferrer.js",
diff --git a/ash/webui/personalization_app/mojom/personalization_app.mojom b/ash/webui/personalization_app/mojom/personalization_app.mojom index 1c96352..ed87407 100644 --- a/ash/webui/personalization_app/mojom/personalization_app.mojom +++ b/ash/webui/personalization_app/mojom/personalization_app.mojom
@@ -129,7 +129,7 @@ // Fetch the number of photos the user has stored in Google Photos. |count| // will be -1 on failure. - FetchGooglePhotosCount() => (int64 count); + FetchGooglePhotosCount() => (int32 count); // Fetch a list of FilePath objects from the local file system. |images| // will be null on failure.
diff --git a/ash/webui/personalization_app/resources/trusted/personalization_actions.ts b/ash/webui/personalization_app/resources/trusted/personalization_actions.ts index 0ad0715..c174834 100644 --- a/ash/webui/personalization_app/resources/trusted/personalization_actions.ts +++ b/ash/webui/personalization_app/resources/trusted/personalization_actions.ts
@@ -258,13 +258,13 @@ export type SetGooglePhotosCountAction = Action&{ name: ActionName.SET_GOOGLE_PHOTOS_COUNT; - count: bigint|null; + count: number|null; }; /** * Sets the count of Google Photos photos. May be called with null on error. */ -export function setGooglePhotosCountAction(count: bigint| +export function setGooglePhotosCountAction(count: number| null): SetGooglePhotosCountAction { return {count, name: ActionName.SET_GOOGLE_PHOTOS_COUNT}; }
diff --git a/ash/webui/personalization_app/resources/trusted/personalization_state.ts b/ash/webui/personalization_app/resources/trusted/personalization_state.ts index eca4523..ebc95b52 100644 --- a/ash/webui/personalization_app/resources/trusted/personalization_state.ts +++ b/ash/webui/personalization_app/resources/trusted/personalization_state.ts
@@ -28,7 +28,7 @@ * initialized, then either null (in error state) or a valid Array. */ export interface GooglePhotosState { - count: bigint|null|undefined; + count: number|null|undefined; albums: WallpaperCollection[]|null|undefined; photos: unknown[]|null|undefined; photosByAlbumId: Record<string, unknown[]|null|undefined>;
diff --git a/ash/webui/personalization_app/resources/trusted/wallpaper/wallpaper_collections_element.js b/ash/webui/personalization_app/resources/trusted/wallpaper/wallpaper_collections_element.js index e6b0492..2f852e54 100644 --- a/ash/webui/personalization_app/resources/trusted/wallpaper/wallpaper_collections_element.js +++ b/ash/webui/personalization_app/resources/trusted/wallpaper/wallpaper_collections_element.js
@@ -11,7 +11,7 @@ import './styles.js'; import {kMaximumLocalImagePreviews} from '/common/constants.js'; -import {isNonEmptyArray, isNullOrArray, isNullOrBigint, promisifyOnload} from '/common/utils.js'; +import {isNonEmptyArray, isNullOrArray, isNullOrNumber, promisifyOnload} from '/common/utils.js'; import {sendCollections, sendGooglePhotosCount, sendGooglePhotosPhotos, sendImageCounts, sendLocalImageData, sendLocalImages, sendVisible} from '/trusted/iframe_api.js'; import {afterNextRender, html} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js'; @@ -370,7 +370,7 @@ */ async onGooglePhotosCountChanged_( googlePhotosCount, googlePhotosCountLoading) { - if (googlePhotosCountLoading || !isNullOrBigint(googlePhotosCount)) { + if (googlePhotosCountLoading || !isNullOrNumber(googlePhotosCount)) { return; } const iframe = await this.iframePromise_;
diff --git a/ash/webui/personalization_app/resources/trusted/wallpaper/wallpaper_controller.ts b/ash/webui/personalization_app/resources/trusted/wallpaper/wallpaper_controller.ts index 6b7b412..bc1885e 100644 --- a/ash/webui/personalization_app/resources/trusted/wallpaper/wallpaper_controller.ts +++ b/ash/webui/personalization_app/resources/trusted/wallpaper/wallpaper_controller.ts
@@ -108,7 +108,7 @@ store: PersonalizationStore): Promise<void> { store.dispatch(action.beginLoadGooglePhotosCountAction()); const {count} = await provider.fetchGooglePhotosCount(); - store.dispatch(action.setGooglePhotosCountAction(count >= 0n ? count : null)); + store.dispatch(action.setGooglePhotosCountAction(count >= 0 ? count : null)); } /** Fetches the list of Google Photos photos and saves it to the store. */ @@ -309,8 +309,8 @@ // If the count of Google Photos photos is zero or null, it's not necesssary // to query the server for the list of albums/photos. const count = store.data.googlePhotos.count; - if (count === 0n || count === null) { - const /** ?Array<undefined> */ result = count === 0n ? [] : null; + if (count === 0 || count === null) { + const /** ?Array<undefined> */ result = count === 0 ? [] : null; store.beginBatchUpdate(); store.dispatch(action.beginLoadGooglePhotosAlbumsAction()); store.dispatch(action.beginLoadGooglePhotosPhotosAction());
diff --git a/ash/webui/personalization_app/resources/untrusted/collections_grid.js b/ash/webui/personalization_app/resources/untrusted/collections_grid.js index 88f5cce..3d7a353 100644 --- a/ash/webui/personalization_app/resources/untrusted/collections_grid.js +++ b/ash/webui/personalization_app/resources/untrusted/collections_grid.js
@@ -9,7 +9,7 @@ import {afterNextRender, html, PolymerElement} from 'chrome-untrusted://personalization/polymer/v3_0/polymer/polymer_bundled.min.js'; import {EventType, kMaximumLocalImagePreviews} from '../common/constants.js'; -import {getLoadingPlaceholderAnimationDelay, getNumberOfGridItemsPerRow, isNullOrArray, isNullOrBigint, isSelectionEvent} from '../common/utils.js'; +import {getLoadingPlaceholderAnimationDelay, getNumberOfGridItemsPerRow, isNullOrArray, isNullOrNumber, isSelectionEvent} from '../common/utils.js'; import {selectCollection, selectGooglePhotosCollection, selectLocalCollection, validateReceivedData} from '../untrusted/iframe_api.js'; /** @@ -65,7 +65,7 @@ /** * Get the text to display for number of images. - * @param {?bigint|?number|undefined} x + * @param {?number|undefined} x * @return {string} */ function getCountText(x) { @@ -80,7 +80,7 @@ case 1n: return loadTimeData.getString('oneImage'); default: - if (!['bigint', 'number'].includes(typeof x) || x < 0) { + if ('number' !== typeof x || x < 0) { console.error('Received an impossible value'); return ''; } @@ -91,7 +91,7 @@ /** * Returns the tile to display for the Google Photos collection. * @param {?Array<undefined>} googlePhotos - * @param {?bigint} googlePhotosCount + * @param {?number} googlePhotosCount * @return {!ImageTile} */ function getGooglePhotosTile(googlePhotos, googlePhotosCount) { @@ -193,7 +193,7 @@ /** * The count of Google Photos photos. - * @type {?bigint} + * @type {?number} * @private */ googlePhotosCount_: { @@ -330,10 +330,10 @@ /** * Invoked on changes to the list and count of Google Photos photos. * @param {?Array<undefined>} googlePhotos - * @param {?bigint} googlePhotosCount + * @param {?number} googlePhotosCount */ onGooglePhotosLoaded_(googlePhotos, googlePhotosCount) { - if (isNullOrArray(googlePhotos) && isNullOrBigint(googlePhotosCount)) { + if (isNullOrArray(googlePhotos) && isNullOrNumber(googlePhotosCount)) { const tile = getGooglePhotosTile(googlePhotos, googlePhotosCount); this.set('tiles_.1', tile); }
diff --git a/ash/webui/personalization_app/resources/untrusted/iframe_api.ts b/ash/webui/personalization_app/resources/untrusted/iframe_api.ts index 13ce9a7..b674cf62 100644 --- a/ash/webui/personalization_app/resources/untrusted/iframe_api.ts +++ b/ash/webui/personalization_app/resources/untrusted/iframe_api.ts
@@ -4,7 +4,7 @@ import {assert, assertNotReached} from '../common/assert.m.js'; import * as constants from '../common/constants.js'; -import {isNonEmptyArray, isNullOrArray, isNullOrBigint} from '../common/utils.js'; +import {isNonEmptyArray, isNullOrArray, isNullOrNumber} from '../common/utils.js'; /** * @fileoverview Helper functions for communicating between trusted and @@ -76,7 +76,7 @@ return data.collections ?? []; } case constants.EventType.SEND_GOOGLE_PHOTOS_COUNT: { - assert(isNullOrBigint(data.count), 'Expected photos count'); + assert(isNullOrNumber(data.count), 'Expected photos count'); return data.count; } case constants.EventType.SEND_GOOGLE_PHOTOS_PHOTOS: {
diff --git a/ash/webui/projector_app/projector_app_client.h b/ash/webui/projector_app/projector_app_client.h index 51b19689..edd30c0 100644 --- a/ash/webui/projector_app/projector_app_client.h +++ b/ash/webui/projector_app/projector_app_client.h
@@ -26,6 +26,8 @@ namespace ash { +struct NewScreencastPrecondition; + // TODO(b/201468756): pendings screencasts are sorted by created time. Add // `created_time` field to PendingScreencast. Screencasts might fail to // upload. Add `failed_to_upload` field to PendingScreencast. Implement upload @@ -52,7 +54,8 @@ public: // Used to notify the Projector SWA app on whether it can start a new // screencast session. - virtual void OnNewScreencastPreconditionChanged(bool can_start) = 0; + virtual void OnNewScreencastPreconditionChanged( + const NewScreencastPrecondition& precondition) = 0; // Observes the pending screencast state change events. virtual void OnScreencastsPendingStatusChanged( @@ -86,7 +89,8 @@ // Used to notify the Projector SWA app on whether it can start a new // screencast session. - virtual void OnNewScreencastPreconditionChanged(bool can_start) = 0; + virtual void OnNewScreencastPreconditionChanged( + const NewScreencastPrecondition& precondition) = 0; // Returns pending screencast uploaded by primary user. virtual const std::set<PendingScreencast>& GetPendingScreencasts() const = 0;
diff --git a/ash/webui/projector_app/projector_message_handler.cc b/ash/webui/projector_app/projector_message_handler.cc index 586acec..2d3996b 100644 --- a/ash/webui/projector_app/projector_message_handler.cc +++ b/ash/webui/projector_app/projector_message_handler.cc
@@ -10,6 +10,7 @@ #include "ash/constants/ash_features.h" #include "ash/constants/ash_pref_names.h" #include "ash/public/cpp/projector/projector_controller.h" +#include "ash/public/cpp/projector/projector_new_screencast_precondition.h" #include "ash/webui/projector_app/projector_app_client.h" #include "base/bind.h" #include "base/check.h" @@ -47,10 +48,6 @@ constexpr char kOtherStr[] = "OTHER"; constexpr char kTokenFetchFailureStr[] = "TOKEN_FETCH_FAILURE"; -// Projector NewScreencastPreconditionState keys. -constexpr char kNewScreencastPreconditionState[] = "state"; -constexpr char kNewScreencastPreconditionReasons[] = "reasons"; - // Struct used to describe args to set user's preference. struct SetUserPrefArgs { std::string pref_name; @@ -147,25 +144,6 @@ return rejected_response; } -base::Value GetNewScreencastPreconditionValue(bool can_start) { - // TODO(b/204233075): Provide Hidden state if device doesn't support on-device - // speech recognition. - auto state = can_start ? NewScreencastPreconditionState::kEnabled - : NewScreencastPreconditionState::kDisabled; - base::Value response(base::Value::Type::DICTIONARY); - response.SetIntKey(kNewScreencastPreconditionState, static_cast<int>(state)); - - base::Value reasons(base::Value::Type::LIST); - - if (!can_start) { - // TODO(b/204233075): Provide more fine grained than kOthers. - reasons.Append(static_cast<int>(NewScreencastPreconditionReason::kOthers)); - } - - response.SetKey(kNewScreencastPreconditionReasons, std::move(reasons)); - return response; -} - } // namespace ProjectorMessageHandler::ProjectorMessageHandler(PrefService* pref_service) @@ -256,10 +234,10 @@ } void ProjectorMessageHandler::OnNewScreencastPreconditionChanged( - bool can_start) { + const NewScreencastPrecondition& precondition) { AllowJavascript(); FireWebUIListener("onNewScreencastPreconditionChanged", - GetNewScreencastPreconditionValue(can_start)); + precondition.ToValue()); } void ProjectorMessageHandler::GetAccounts(base::Value::ConstListView args) { @@ -296,9 +274,10 @@ // Check that there is only one argument which is the callback id. DCHECK_EQ(args.size(), 1u); - ResolveJavascriptCallback( - args[0], GetNewScreencastPreconditionValue( - ProjectorController::Get()->CanStartNewSession())); + ResolveJavascriptCallback(args[0], + base::Value(ProjectorController::Get() + ->GetNewScreencastPrecondition() + .ToValue())); } void ProjectorMessageHandler::StartProjectorSession( @@ -320,7 +299,9 @@ // TODO(b/195113693): Start the projector session with the selected account // and folder. auto* controller = ProjectorController::Get(); - if (!controller->CanStartNewSession()) { + + if (controller->GetNewScreencastPrecondition().state != + NewScreencastPreconditionState::kEnabled) { ResolveJavascriptCallback(args[0], base::Value(false)); return; }
diff --git a/ash/webui/projector_app/projector_message_handler.h b/ash/webui/projector_app/projector_message_handler.h index f1fa384..24a0538 100644 --- a/ash/webui/projector_app/projector_message_handler.h +++ b/ash/webui/projector_app/projector_message_handler.h
@@ -7,6 +7,7 @@ #include <set> +#include "ash/public/cpp/projector/projector_new_screencast_precondition.h" #include "ash/webui/projector_app/projector_app_client.h" #include "ash/webui/projector_app/projector_oauth_token_fetcher.h" #include "ash/webui/projector_app/projector_xhr_sender.h" @@ -30,37 +31,6 @@ kTokenFetchFailure, }; -// The new screencast button state in the Projector SWA. -// Ensure that this enum class is synchronized with -// NewScreencastPreconditionState enum in -// //ash/webui/projector_app/resources/communication/message_types.js. -enum class NewScreencastPreconditionState { - // The new screencast button is visible but is disabled. - kDisabled = 1, - // The new screencast button is enabled and the user can create new ones now. - kEnabled = 2, - // The new screencast button is hidden. - kHidden = 3 -}; - -// The reason for the new screencast button state. -// Ensure that this enum class is synchronized with -// NewScreencastPreconditionReason enum in -// //ash/webui/projector_app/resources/communication/message_types.js. -enum class NewScreencastPreconditionReason { - // Reasons for NewScreenCastPreconditionState.kHidden state: - kOnDeviceSpeechRecognitionNotSupported = 1, - kUserLocaleNotSupported = 2, - - // Reasons for NewScreenCastPreconditionState.kDisabled state: - kInProjectorSession = 3, - kScreenRecordingInProgress = 4, - kSodaDownloadInProgress = 5, - kOutOfDiskSpace = 6, - kNoMic = 7, - kOthers = 8 -}; - // Handles messages from the Projector WebUIs (i.e. chrome://projector). class ProjectorMessageHandler : public content::WebUIMessageHandler, public ProjectorAppClient::Observer { @@ -76,7 +46,8 @@ void RegisterMessages() override; // ProjectorAppClient:Observer: - void OnNewScreencastPreconditionChanged(bool can_start) override; + void OnNewScreencastPreconditionChanged( + const NewScreencastPrecondition& precondition) override; void set_web_ui_for_test(content::WebUI* web_ui) { set_web_ui(web_ui); }
diff --git a/ash/webui/projector_app/resources/communication/message_types.js b/ash/webui/projector_app/resources/communication/message_types.js index e93baf0..f7a65a2 100644 --- a/ash/webui/projector_app/resources/communication/message_types.js +++ b/ash/webui/projector_app/resources/communication/message_types.js
@@ -44,7 +44,6 @@ export const NewScreencastPreconditionState = { DISABLED: 1, ENABLED: 2, - HIDDEN: 3, }; /** @@ -53,11 +52,8 @@ * @enum {number} */ export const NewScreencastPreconditionReason = { - // Reasons for NEW_SCREENCAST_PRECONDITION_STATE.HIDDEN state: ON_DEVICE_RECOGNITION_NOT_SUPPORTED: 1, USER_LOCALE_NOT_SUPPORTED: 2, - - // Reasons for NEW_SCREENCAST_PRECONDITION_STATE.DISABLED state: IN_PROJECTOR_SESSION: 3, SCREEN_RECORDING_IN_PROGRESS: 4, SODA_DOWNLOAD_IN_PROGRESS: 5,
diff --git a/ash/webui/projector_app/test/mock_app_client.h b/ash/webui/projector_app/test/mock_app_client.h index efd4447..36cc1eb 100644 --- a/ash/webui/projector_app/test/mock_app_client.h +++ b/ash/webui/projector_app/test/mock_app_client.h
@@ -43,7 +43,8 @@ MOCK_METHOD1(AddObserver, void(Observer*)); MOCK_METHOD1(RemoveObserver, void(Observer*)); - MOCK_METHOD1(OnNewScreencastPreconditionChanged, void(bool)); + MOCK_METHOD1(OnNewScreencastPreconditionChanged, + void(const NewScreencastPrecondition&)); MOCK_CONST_METHOD0(GetPendingScreencasts, const std::set<PendingScreencast>&()); MOCK_METHOD0(ShouldDownloadSoda, bool());
diff --git a/ash/webui/projector_app/test/projector_message_handler_unittest.cc b/ash/webui/projector_app/test/projector_message_handler_unittest.cc index f7ca065..6bd56d46 100644 --- a/ash/webui/projector_app/test/projector_message_handler_unittest.cc +++ b/ash/webui/projector_app/test/projector_message_handler_unittest.cc
@@ -6,6 +6,7 @@ #include "ash/constants/ash_pref_names.h" #include "ash/public/cpp/projector/projector_controller.h" +#include "ash/public/cpp/projector/projector_new_screencast_precondition.h" #include "ash/public/cpp/test/mock_projector_controller.h" #include "ash/webui/projector_app/test/mock_app_client.h" #include "base/files/file_path.h" @@ -147,9 +148,12 @@ } TEST_F(ProjectorMessageHandlerUnitTest, CanStartProjectorSession) { - EXPECT_CALL(controller(), CanStartNewSession()); - ON_CALL(controller(), CanStartNewSession) - .WillByDefault(testing::Return(true)); + NewScreencastPrecondition precondition; + precondition.state = NewScreencastPreconditionState::kEnabled; + + EXPECT_CALL(controller(), GetNewScreencastPrecondition()); + ON_CALL(controller(), GetNewScreencastPrecondition) + .WillByDefault(testing::Return(precondition)); base::ListValue list_args; list_args.Append(kGetNewScreencastPreconditionCallback); @@ -270,13 +274,14 @@ EXPECT_EQ("UNSUPPORTED_URL", *error); } -TEST_F(ProjectorMessageHandlerUnitTest, CanStartNewSession) { - message_handler()->OnNewScreencastPreconditionChanged(/** canStart = */ true); - const content::TestWebUI::CallData& call_data = FetchCallData(0); +TEST_F(ProjectorMessageHandlerUnitTest, NewScreencastPreconditionChanged) { + NewScreencastPrecondition precondition; + precondition.state = NewScreencastPreconditionState::kEnabled; + message_handler()->OnNewScreencastPreconditionChanged(precondition); + const content::TestWebUI::CallData& call_data = *(web_ui().call_data()[0]); EXPECT_EQ(call_data.function_name(), kWebUIListenerCall); EXPECT_EQ(call_data.arg1()->GetString(), kOnNewScreencastPreconditionChanged); - EXPECT_EQ(*(call_data.arg2()->FindIntKey(kState)), - static_cast<int>(NewScreencastPreconditionState::kEnabled)); + EXPECT_EQ(*(call_data.arg2()), precondition.ToValue()); } TEST_F(ProjectorMessageHandlerUnitTest, OnSodaProgress) { @@ -462,7 +467,7 @@ } class ProjectorSessionStartUnitTest - : public ::testing::WithParamInterface<bool>, + : public ::testing::WithParamInterface<NewScreencastPrecondition>, public ProjectorMessageHandlerUnitTest { public: ProjectorSessionStartUnitTest() = default; @@ -473,10 +478,12 @@ }; TEST_P(ProjectorSessionStartUnitTest, ProjectorSessionTest) { - bool success = GetParam(); - EXPECT_CALL(controller(), CanStartNewSession()); - ON_CALL(controller(), CanStartNewSession) - .WillByDefault(testing::Return(success)); + const auto& precondition = GetParam(); + EXPECT_CALL(controller(), GetNewScreencastPrecondition()); + ON_CALL(controller(), GetNewScreencastPrecondition) + .WillByDefault(testing::Return(precondition)); + + bool success = precondition.state == NewScreencastPreconditionState::kEnabled; EXPECT_CALL(controller(), StartProjectorSession("folderId")) .Times(success ? 1 : 0); @@ -500,9 +507,14 @@ EXPECT_EQ(call_data.arg3()->GetBool(), success); } -INSTANTIATE_TEST_CASE_P(SessionStartSuccessFailTest, - ProjectorSessionStartUnitTest, - ::testing::Values(true, false)); +INSTANTIATE_TEST_CASE_P( + SessionStartSuccessFailTest, + ProjectorSessionStartUnitTest, + ::testing::Values( + NewScreencastPrecondition(NewScreencastPreconditionState::kEnabled, {}), + NewScreencastPrecondition( + NewScreencastPreconditionState::kDisabled, + {NewScreencastPreconditionReason::kInProjectorSession}))); // Tests getting and setting the Projector onboarding preferences. // Parameterized by the preference strings.
diff --git a/base/BUILD.gn b/base/BUILD.gn index 7ebd6d3f..b9c5b65 100644 --- a/base/BUILD.gn +++ b/base/BUILD.gn
@@ -3749,7 +3749,10 @@ sources += [ "allocator/winheap_stubs_win_unittest.cc" ] } - sources += [ "allocator/allocator_shim_default_dispatch_to_partition_alloc_unittest.cc" ] + sources += [ + "allocator/allocator_shim_default_dispatch_to_partition_alloc_unittest.cc", + "allocator/partition_alloc_support_unittest.cc", + ] } if (enable_base_tracing) {
diff --git a/base/allocator/allocator_shim_default_dispatch_to_partition_alloc.cc b/base/allocator/allocator_shim_default_dispatch_to_partition_alloc.cc index a0e313c..342a2bb 100644 --- a/base/allocator/allocator_shim_default_dispatch_to_partition_alloc.cc +++ b/base/allocator/allocator_shim_default_dispatch_to_partition_alloc.cc
@@ -6,9 +6,12 @@ #include <atomic> #include <cstddef> +#include <map> +#include <string> #include "base/allocator/allocator_shim_internals.h" #include "base/allocator/buildflags.h" +#include "base/allocator/partition_alloc_features.h" #include "base/allocator/partition_allocator/allocation_guard.h" #include "base/allocator/partition_allocator/memory_reclaimer.h" #include "base/allocator/partition_allocator/partition_alloc.h" @@ -19,6 +22,7 @@ #include "base/allocator/partition_allocator/partition_stats.h" #include "base/bits.h" #include "base/compiler_specific.h" +#include "base/feature_list.h" #include "base/ignore_result.h" #include "base/memory/nonscannable_memory.h" #include "base/numerics/checked_math.h"
diff --git a/base/allocator/partition_alloc_support.cc b/base/allocator/partition_alloc_support.cc index 7433741..ab9a6c4 100644 --- a/base/allocator/partition_alloc_support.cc +++ b/base/allocator/partition_alloc_support.cc
@@ -4,7 +4,13 @@ #include "base/allocator/partition_alloc_support.h" +#include <map> +#include <string> + +#include "base/allocator/buildflags.h" +#include "base/allocator/partition_alloc_features.h" #include "base/allocator/partition_allocator/memory_reclaimer.h" +#include "base/allocator/partition_allocator/partition_alloc_config.h" #include "base/allocator/partition_allocator/starscan/pcscan.h" #include "base/allocator/partition_allocator/starscan/stats_collector.h" #include "base/allocator/partition_allocator/starscan/stats_reporter.h" @@ -12,6 +18,7 @@ #include "base/bind.h" #include "base/callback.h" #include "base/check.h" +#include "base/feature_list.h" #include "base/ignore_result.h" #include "base/metrics/histogram_functions.h" #include "base/no_destructor.h" @@ -189,5 +196,222 @@ BindRepeating(&ReclaimPeriodically)); } +std::map<std::string, std::string> ProposeSyntheticFinchTrials( + bool is_enterprise) { + std::map<std::string, std::string> trials; + + // Records whether or not PartitionAlloc is used as the default allocator. + trials.emplace("PartitionAllocEverywhere", +#if BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC) + "Enabled" +#else + "Disabled" +#endif + ); + + // Records whether or not PartitionAlloc-Everywhere is enabled, and whether + // PCScan is enabled on top of it. This is meant for a 3-way experiment with 2 + // binaries: + // - binary A: deployed to 33% users, with PA-E and PCScan off. + // - binary B: deployed to 66% users, with PA-E on, half of which having + // PCScan on + // + // NOTE, deliberately don't use PA_ALLOW_PCSCAN which depends on bitness. + // In the 32-bit case, PCScan is always disabled, but we'll deliberately + // misrepresent it as enabled here (and later ignored when analyzing results), + // in order to keep each population at 33%. + trials.emplace( + "PartitionAllocEverywhereAndPCScan", +#if BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC) + FeatureList::IsEnabled(features::kPartitionAllocPCScanBrowserOnly) + ? "EnabledWithPCScan" + : "EnabledWithoutPCScan" +#else + "Disabled" +#endif // BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC) + ); + +#if BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC) + // BackupRefPtr_Effective and PCScan_Effective record whether or not + // BackupRefPtr and/or PCScan are enabled. The experiments aren't independent, + // so having a synthetic Finch will help look only at cases where one isn't + // affected by the other. + + // Whether PartitionAllocBackupRefPtr is enabled (as determined by + // FeatureList::IsEnabled). + bool brp_finch_enabled = false; + ALLOW_UNUSED_LOCAL(brp_finch_enabled); + // Whether PartitionAllocBackupRefPtr is set up for the default behavior. The + // default behavior is when either the Finch flag is disabled, or is enabled + // in brp-mode=disabled (these two options are equivalent). + bool brp_nondefault_behavior = false; + ALLOW_UNUSED_LOCAL(brp_nondefault_behavior); + // Whether PartitionAllocBackupRefPtr is set up to enable BRP protection. It + // requires the Finch flag to be enabled and brp-mode!=disabled*. Some modes, + // e.g. disabled-but-3-way-split, do something (hence can't be considered the + // default behavior), but don't enable BRP protection. + bool brp_truly_enabled = false; + ALLOW_UNUSED_LOCAL(brp_truly_enabled); +#if BUILDFLAG(USE_BACKUP_REF_PTR) + if (FeatureList::IsEnabled(features::kPartitionAllocBackupRefPtr)) + brp_finch_enabled = true; + if (brp_finch_enabled && features::kBackupRefPtrModeParam.Get() != + features::BackupRefPtrMode::kDisabled) + brp_nondefault_behavior = true; + if (brp_finch_enabled && features::kBackupRefPtrModeParam.Get() == + features::BackupRefPtrMode::kEnabled) + brp_truly_enabled = true; +#endif // BUILDFLAG(USE_BACKUP_REF_PTR) + bool pcscan_enabled = +#if defined(PA_ALLOW_PCSCAN) + FeatureList::IsEnabled(features::kPartitionAllocPCScanBrowserOnly); +#else + false; +#endif + + std::string brp_group_name; + if (pcscan_enabled) { + // If PCScan is enabled, just ignore the population. + brp_group_name = "Ignore_PCScanIsOn"; + } else if (!brp_finch_enabled) { + // The control group is actually disguised as "enabled", but in fact it's + // disabled using a param. This is to differentiate the population that + // participates in the control group, from the population that isn't in any + // group. + brp_group_name = "Ignore_NoGroup"; + } else { + switch (features::kBackupRefPtrModeParam.Get()) { + case features::BackupRefPtrMode::kDisabled: + brp_group_name = "Disabled"; + break; + case features::BackupRefPtrMode::kEnabled: +#if BUILDFLAG(PUT_REF_COUNT_IN_PREVIOUS_SLOT) + brp_group_name = "EnabledPrevSlot"; +#else + brp_group_name = "EnabledBeforeAlloc"; +#endif + break; + case features::BackupRefPtrMode::kDisabledButSplitPartitions2Way: + brp_group_name = "DisabledBut2WaySplit"; + break; + case features::BackupRefPtrMode::kDisabledButSplitPartitions3Way: + brp_group_name = "DisabledBut3WaySplit"; + break; + } + + if (features::kBackupRefPtrModeParam.Get() != + features::BackupRefPtrMode::kDisabled) { + std::string process_selector; + switch (features::kBackupRefPtrEnabledProcessesParam.Get()) { + case features::BackupRefPtrEnabledProcesses::kBrowserOnly: + process_selector = "BrowserOnly"; + break; + case features::BackupRefPtrEnabledProcesses::kBrowserAndRenderer: + process_selector = "BrowserAndRenderer"; + break; + case features::BackupRefPtrEnabledProcesses::kNonRenderer: + process_selector = "NonRenderer"; + break; + case features::BackupRefPtrEnabledProcesses::kAllProcesses: + process_selector = "AllProcesses"; + break; + } + + brp_group_name += ("_" + process_selector); + } + } + trials.emplace("BackupRefPtr_Effective", brp_group_name); + + std::string pcscan_group_name; + std::string pcscan_group_name_fallback; +#if defined(PA_ALLOW_PCSCAN) + if (brp_truly_enabled) { + // If BRP protection is enabled, just ignore the population. Check + // brp_truly_enabled, not brp_finch_enabled, because there are certain modes + // where BRP protection is actually disabled. + pcscan_group_name = "Ignore_BRPIsOn"; + } else { + pcscan_group_name = (pcscan_enabled ? "Enabled" : "Disabled"); + } + // In case we are incorrect that PCScan is independent of partition-split + // modes, create a fallback trial that only takes into account the BRP Finch + // settings that preserve the default behavior. + if (brp_nondefault_behavior) { + pcscan_group_name_fallback = "Ignore_BRPIsOn"; + } else { + pcscan_group_name_fallback = (pcscan_enabled ? "Enabled" : "Disabled"); + } +#else + // On certain platforms, PCScan is not supported and permanently disabled. + // Don't lump it into "Disabled", so that belonging to "Enabled"/"Disabled" is + // fully controlled by Finch and thus have identical population sizes. + pcscan_group_name = "Unavailable"; + pcscan_group_name_fallback = "Unavailable"; +#endif // defined(PA_ALLOW_PCSCAN) + trials.emplace("PCScan_Effective", pcscan_group_name); + trials.emplace("PCScan_Effective_Fallback", pcscan_group_name_fallback); + + // This synthetic Finch setting reflects the new USE_BACKUP_REF_PTR behavior, + // which simply compiles in the BackupRefPtr support, but keeps it disabled at + // run-time (which can be further enabled via Finch). + trials.emplace("BackupRefPtrSupport", +#if BUILDFLAG(USE_BACKUP_REF_PTR) + "CompiledIn" +#else + "Disabled" +#endif // BUILDFLAG(USE_BACKUP_REF_PTR) + ); +#endif // BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC) + + // This synthetic field trial for the BackupRefPtr binary A/B experiment is + // set up such that: + // 1) Enterprises are excluded from experiment, to make sure we honor + // ChromeVariations policy. + // 2) The experiment binary (USE_BACKUP_REF_PTR) is delivered via Google + // Update to fraction X of the non-enterprise population. + // 3) The control group is established in fraction X of non-enterprise + // popluation via Finch (PartitionAllocBackupRefPtrControl). Since this + // Finch is applicable only to 1-X of the non-enterprise population, we + // need to set it to Y=X/(1-X). E.g. if X=.333, Y=.5; if X=.01, Y=.0101. +#if BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC) +#if BUILDFLAG(USE_BACKUP_REF_PTR) + constexpr bool kIsBrpOn = true; // experiment binary only +#else + constexpr bool kIsBrpOn = false; // non-experiment binary +#endif + const bool is_brp_control = + FeatureList::IsEnabled(features::kPartitionAllocBackupRefPtrControl); + const char* group_name; + if (is_enterprise) { + if (kIsBrpOn) { // is_enterprise && kIsBrpOn + group_name = "Excluded_Enterprise_BrpOn"; + } else { // is_enterprise && !kIsBrpOn + group_name = "Excluded_Enterprise_BrpOff"; + } + } else { + if (kIsBrpOn) { // !is_enterprise && kIsBrpOn + group_name = "Enabled"; + } else { // !is_enterprise && !kIsBrpOn + if (is_brp_control) { + group_name = "Control"; + } else { + group_name = "Excluded_NonEnterprise"; + } + } + } + trials.emplace("BackupRefPtrNoEnterprise", group_name); +#endif // BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC) + + trials.emplace("FakeBinaryExperiment", +#if BUILDFLAG(USE_FAKE_BINARY_EXPERIMENT) + "Enabled" +#else + "Disabled" +#endif + ); + + return trials; +} + } // namespace allocator } // namespace base
diff --git a/base/allocator/partition_alloc_support.h b/base/allocator/partition_alloc_support.h index 356f75eb..d73bca7 100644 --- a/base/allocator/partition_alloc_support.h +++ b/base/allocator/partition_alloc_support.h
@@ -5,6 +5,9 @@ #ifndef BASE_ALLOCATOR_PARTITION_ALLOC_SUPPORT_H_ #define BASE_ALLOCATOR_PARTITION_ALLOC_SUPPORT_H_ +#include <map> +#include <string> + #include "base/allocator/partition_allocator/partition_alloc_config.h" #include "base/base_export.h" #include "base/memory/scoped_refptr.h" @@ -23,6 +26,9 @@ BASE_EXPORT void StartMemoryReclaimer( scoped_refptr<SequencedTaskRunner> task_runner); +BASE_EXPORT std::map<std::string, std::string> ProposeSyntheticFinchTrials( + bool is_enterprise); + } // namespace allocator } // namespace base
diff --git a/base/allocator/partition_alloc_support_unittest.cc b/base/allocator/partition_alloc_support_unittest.cc new file mode 100644 index 0000000..22b2d16 --- /dev/null +++ b/base/allocator/partition_alloc_support_unittest.cc
@@ -0,0 +1,158 @@ +// Copyright 2021 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 "base/allocator/partition_alloc_support.h" + +#include <string> +#include <utility> +#include <vector> + +#include "base/allocator/buildflags.h" +#include "base/allocator/partition_alloc_features.h" +#include "base/allocator/partition_allocator/partition_alloc_config.h" +#include "base/compiler_specific.h" +#include "base/feature_list.h" +#include "base/test/scoped_feature_list.h" +#include "testing/gtest/include/gtest/gtest.h" + +namespace base { +namespace allocator { + +#if BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC) +TEST(PartitionAllocSupportTest, ProposeSyntheticFinchTrials_BRPAndPCScan) { + for (bool pcscan_enabled : {false, true}) { + test::ScopedFeatureList pcscan_scope; + std::vector<Feature> empty_list = {}; + std::vector<Feature> pcscan_list = { + features::kPartitionAllocPCScanBrowserOnly}; + pcscan_scope.InitWithFeatures(pcscan_enabled ? pcscan_list : empty_list, + pcscan_enabled ? empty_list : pcscan_list); +#if !defined(PA_ALLOW_PCSCAN) + pcscan_enabled = false; +#endif + + std::string brp_expectation = + pcscan_enabled ? "Ignore_PCScanIsOn" : "Ignore_NoGroup"; + std::string pcscan_expectation = +#if defined(PA_ALLOW_PCSCAN) + pcscan_enabled ? "Enabled" : "Disabled"; +#else + "Unavailable"; +#endif + + auto trials = ProposeSyntheticFinchTrials(false); + auto group_iter = trials.find("BackupRefPtr_Effective"); + EXPECT_NE(group_iter, trials.end()); + EXPECT_EQ(group_iter->second, brp_expectation); + group_iter = trials.find("PCScan_Effective"); + EXPECT_NE(group_iter, trials.end()); + EXPECT_EQ(group_iter->second, pcscan_expectation); + group_iter = trials.find("PCScan_Effective_Fallback"); + EXPECT_NE(group_iter, trials.end()); + EXPECT_EQ(group_iter->second, pcscan_expectation); + + { + test::ScopedFeatureList brp_scope; + brp_scope.InitAndEnableFeatureWithParameters( + features::kPartitionAllocBackupRefPtr, {}); + + pcscan_expectation = "Unavailable"; +#if BUILDFLAG(USE_BACKUP_REF_PTR) + brp_expectation = pcscan_enabled ? "Ignore_PCScanIsOn" +#if BUILDFLAG(PUT_REF_COUNT_IN_PREVIOUS_SLOT) + : "EnabledPrevSlot_BrowserOnly"; +#else + : "EnabledBeforeAlloc_" + "BrowserOnly"; +#endif // BUILDFLAG(PUT_REF_COUNT_IN_PREVIOUS_SLOT) +#if defined(PA_ALLOW_PCSCAN) + pcscan_expectation = "Ignore_BRPIsOn"; +#endif +#else // BUILDFLAG(USE_BACKUP_REF_PTR) + brp_expectation = pcscan_enabled ? "Ignore_PCScanIsOn" : "Ignore_NoGroup"; +#if defined(PA_ALLOW_PCSCAN) + pcscan_expectation = pcscan_enabled ? "Enabled" : "Disabled"; +#endif +#endif // BUILDFLAG(USE_BACKUP_REF_PTR) + + trials = ProposeSyntheticFinchTrials(false); + group_iter = trials.find("BackupRefPtr_Effective"); + EXPECT_NE(group_iter, trials.end()); + EXPECT_EQ(group_iter->second, brp_expectation); + group_iter = trials.find("PCScan_Effective"); + EXPECT_NE(group_iter, trials.end()); + EXPECT_EQ(group_iter->second, pcscan_expectation); + group_iter = trials.find("PCScan_Effective_Fallback"); + EXPECT_NE(group_iter, trials.end()); + EXPECT_EQ(group_iter->second, pcscan_expectation); + } + + const std::string kEnabledMode = +#if BUILDFLAG(PUT_REF_COUNT_IN_PREVIOUS_SLOT) + "PrevSlot_"; +#else + "BeforeAlloc_"; +#endif + const std::vector<std::pair<std::string, std::string>> kModes = { + {"disabled", "Disabled"}, + {"enabled", "Enabled" + kEnabledMode}, + {"disabled-but-2-way-split", "DisabledBut2WaySplit_"}, + {"disabled-but-3-way-split", "DisabledBut3WaySplit_"}}; + const std::vector<std::pair<std::string, std::string>> kProcesses = { + {"browser-only", "BrowserOnly"}, + {"browser-and-renderer", "BrowserAndRenderer"}, + {"non-renderer", "NonRenderer"}, + {"all-processes", "AllProcesses"}}; + + for (auto mode : kModes) { + for (auto process_set : kProcesses) { + test::ScopedFeatureList brp_scope; + brp_scope.InitAndEnableFeatureWithParameters( + features::kPartitionAllocBackupRefPtr, + {{"brp-mode", mode.first}, + {"enabled-processes", process_set.first}}); + +#if BUILDFLAG(USE_BACKUP_REF_PTR) + brp_expectation = pcscan_enabled ? "Ignore_PCScanIsOn" : mode.second; + bool brp_unavailable = false; +#else + brp_expectation = + pcscan_enabled ? "Ignore_PCScanIsOn" : "Ignore_NoGroup"; + bool brp_unavailable = true; +#endif + ALLOW_UNUSED_LOCAL(brp_unavailable); + if (brp_expectation[brp_expectation.length() - 1] == '_') { + brp_expectation += process_set.second; + } + pcscan_expectation = "Unavailable"; + std::string pcscan_expectation_fallback = "Unavailable"; +#if defined(PA_ALLOW_PCSCAN) + pcscan_expectation = + (brp_unavailable || mode.first.find("disabled") == 0) + ? (pcscan_enabled ? "Enabled" : "Disabled") + : "Ignore_BRPIsOn"; + pcscan_expectation_fallback = + (brp_unavailable || mode.first == "disabled") + ? (pcscan_enabled ? "Enabled" : "Disabled") + : "Ignore_BRPIsOn"; +#endif + + trials = ProposeSyntheticFinchTrials(false); + group_iter = trials.find("BackupRefPtr_Effective"); + EXPECT_NE(group_iter, trials.end()); + EXPECT_EQ(group_iter->second, brp_expectation); + group_iter = trials.find("PCScan_Effective"); + EXPECT_NE(group_iter, trials.end()); + EXPECT_EQ(group_iter->second, pcscan_expectation); + group_iter = trials.find("PCScan_Effective_Fallback"); + EXPECT_NE(group_iter, trials.end()); + EXPECT_EQ(group_iter->second, pcscan_expectation_fallback); + } + } + } +} +#endif // BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC) + +} // namespace allocator +} // namespace base
diff --git a/base/android/java/src/org/chromium/base/process_launcher/BindService.java b/base/android/java/src/org/chromium/base/process_launcher/BindService.java index a0cd005e6..fe3c7e3 100644 --- a/base/android/java/src/org/chromium/base/process_launcher/BindService.java +++ b/base/android/java/src/org/chromium/base/process_launcher/BindService.java
@@ -41,7 +41,7 @@ context, intent, flags, instanceName, executor, connection); } - if (Build.VERSION.SDK_INT < Build.VERSION_CODES.N) { + if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.N) { return bindServiceByCall(context, intent, connection, flags); }
diff --git a/build/fuchsia/linux.sdk.sha1 b/build/fuchsia/linux.sdk.sha1 index 7ab9e48..d25fb92 100644 --- a/build/fuchsia/linux.sdk.sha1 +++ b/build/fuchsia/linux.sdk.sha1
@@ -1 +1 @@ -7.20211215.1.1 +7.20211215.3.1
diff --git a/build/fuchsia/linux_internal.sdk.sha1 b/build/fuchsia/linux_internal.sdk.sha1 index 8f85665..d25fb92 100644 --- a/build/fuchsia/linux_internal.sdk.sha1 +++ b/build/fuchsia/linux_internal.sdk.sha1
@@ -1 +1 @@ -7.20211215.2.1 +7.20211215.3.1
diff --git a/build/fuchsia/mac.sdk.sha1 b/build/fuchsia/mac.sdk.sha1 index 7ab9e48..d25fb92 100644 --- a/build/fuchsia/mac.sdk.sha1 +++ b/build/fuchsia/mac.sdk.sha1
@@ -1 +1 @@ -7.20211215.1.1 +7.20211215.3.1
diff --git a/chrome/android/chrome_test_java_sources.gni b/chrome/android/chrome_test_java_sources.gni index 18f3ce53..e7c446f3 100644 --- a/chrome/android/chrome_test_java_sources.gni +++ b/chrome/android/chrome_test_java_sources.gni
@@ -346,6 +346,7 @@ "javatests/src/org/chromium/chrome/browser/omnibox/suggestions/CachedZeroSuggestionsManagerUnitTest.java", "javatests/src/org/chromium/chrome/browser/omnibox/suggestions/DropdownItemViewInfoListBuilderUnitTest.java", "javatests/src/org/chromium/chrome/browser/omnibox/suggestions/DropdownItemViewInfoListManagerUnitTest.java", + "javatests/src/org/chromium/chrome/browser/omnibox/suggestions/OmniboxPedalsTest.java", "javatests/src/org/chromium/chrome/browser/omnibox/suggestions/SwitchToTabTest.java", "javatests/src/org/chromium/chrome/browser/omnibox/suggestions/answer/AnswerSuggestionProcessorUnitTest.java", "javatests/src/org/chromium/chrome/browser/omnibox/suggestions/base/BaseSuggestionProcessorTest.java",
diff --git a/chrome/android/java/res/values/styles.xml b/chrome/android/java/res/values/styles.xml index e5e6508..f044866 100644 --- a/chrome/android/java/res/values/styles.xml +++ b/chrome/android/java/res/values/styles.xml
@@ -125,7 +125,7 @@ <item name="android:textColorLink">@macro/default_text_color_link</item> <item name="colorPrimaryDark">@android:color/black</item> <item name="colorAccent">@macro/default_control_color_active</item> - <item name="colorControlHighlight">@color/control_highlight_color</item> + <item name="colorControlHighlight">@macro/default_control_color_highlight</item> <item name="spinnerStyle">@style/SpinnerStyle</item> <item name="textInputStyle">@style/Widget.BrowserUI.TextInputLayout</item>
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkItemRow.java b/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkItemRow.java index 8bdf6b6..5fcac63d 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkItemRow.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkItemRow.java
@@ -27,6 +27,7 @@ private RoundedIconGenerator mIconGenerator; private final int mMinIconSize; private final int mDisplayedIconSize; + private boolean mFaviconCancelled; /** * Constructor for inflating from XML. @@ -79,15 +80,22 @@ mStartIconView.setImageDrawable(null); mTitleView.setText(item.getTitle()); mDescriptionView.setText(item.getUrlForDisplay()); + mFaviconCancelled = false; mDelegate.getLargeIconBridge().getLargeIconForUrl(mUrl, mMinIconSize, this); return item; } + /** Allows cancellation of the favicon. */ + protected void cancelFavicon() { + mFaviconCancelled = true; + } + // LargeIconCallback implementation. @Override public void onLargeIconAvailable(Bitmap icon, int fallbackColor, boolean isFallbackColorDefault, @IconType int iconType) { + if (mFaviconCancelled) return; Drawable iconDrawable = FaviconUtils.getIconDrawableWithoutFilter( icon, mUrl, fallbackColor, mIconGenerator, getResources(), mDisplayedIconSize); setStartIconDrawable(iconDrawable);
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkItemsAdapter.java b/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkItemsAdapter.java index 0726acc..88f3e5b 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkItemsAdapter.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkItemsAdapter.java
@@ -26,6 +26,8 @@ import org.chromium.chrome.browser.bookmarks.BookmarkRow.Location; import org.chromium.chrome.browser.feature_engagement.TrackerFactory; import org.chromium.chrome.browser.flags.ChromeFeatureList; +import org.chromium.chrome.browser.power_bookmarks.PowerBookmarkMeta; +import org.chromium.chrome.browser.power_bookmarks.PowerBookmarkType; import org.chromium.chrome.browser.profiles.Profile; import org.chromium.chrome.browser.subscriptions.CommerceSubscriptionsServiceFactory; import org.chromium.chrome.browser.sync.SyncService; @@ -147,6 +149,17 @@ return position; } + private void filterForPriceTrackingCategory(List<BookmarkId> bookmarks) { + for (int i = bookmarks.size() - 1; i >= 0; i--) { + PowerBookmarkMeta meta = mDelegate.getModel().getPowerBookmarkMeta(bookmarks.get(i)); + if (meta == null || meta.getType() != PowerBookmarkType.SHOPPING + || !meta.getShoppingSpecifics().getIsPriceTracked()) { + bookmarks.remove(i); + continue; + } + } + } + private void setBookmarks(List<BookmarkId> bookmarks) { clearHighlight(); mElements.clear(); @@ -157,6 +170,10 @@ } updateHeader(false); + if (BookmarkId.SHOPPING_FOLDER.equals(mCurrentFolder)) { + filterForPriceTrackingCategory(bookmarks); + } + for (BookmarkId bookmarkId : bookmarks) { BookmarkItem item = mDelegate.getModel().getBookmarkById(bookmarkId);
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkSaveFlowCoordinator.java b/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkSaveFlowCoordinator.java index c6a8625..19309b1 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkSaveFlowCoordinator.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkSaveFlowCoordinator.java
@@ -109,9 +109,11 @@ @Nullable PowerBookmarkMeta meta) { mDestroyChecker.checkNotDestroyed(); mBottomSheetContent = new BookmarkSaveFlowBottomSheetContent(mBookmarkSaveFlowView); + // Order matters here: Calling show on the mediator first allows the height to be fully + // determined before the sheet is shown. + mMediator.show(bookmarkId, meta, fromExplicitTrackUi, wasBookmarkMoved); boolean shown = mBottomSheetController.requestShowContent(mBottomSheetContent, /* animate= */ true); - mMediator.show(bookmarkId, meta, fromExplicitTrackUi, wasBookmarkMoved); AccessibilityManager am = (AccessibilityManager) mContext.getSystemService(Context.ACCESSIBILITY_SERVICE);
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkSaveFlowMediator.java b/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkSaveFlowMediator.java index 26a2606..7d0ce4d 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkSaveFlowMediator.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkSaveFlowMediator.java
@@ -8,7 +8,7 @@ import android.widget.CompoundButton; import androidx.annotation.Nullable; -import androidx.core.content.res.ResourcesCompat; +import androidx.appcompat.content.res.AppCompatResources; import org.chromium.base.Callback; import org.chromium.base.CallbackController; @@ -171,10 +171,9 @@ void setPriceTrackingIconForEnabledState(boolean enabled) { mPropertyModel.set(BookmarkSaveFlowProperties.NOTIFICATION_SWITCH_START_ICON, - ResourcesCompat.getDrawable(mContext.getResources(), + AppCompatResources.getDrawable(mContext, enabled ? R.drawable.price_tracking_enabled_filled - : R.drawable.price_tracking_disabled, - /*theme=*/null)); + : R.drawable.price_tracking_disabled)); } void destroy() {
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/PowerBookmarkShoppingItemRow.java b/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/PowerBookmarkShoppingItemRow.java index c345af1..a8f3988 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/PowerBookmarkShoppingItemRow.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/PowerBookmarkShoppingItemRow.java
@@ -105,7 +105,12 @@ mImageFetcher.fetchImage( ImageFetcher.Params.create(leadImageUrl, ImageFetcher.POWER_BOOKMARKS_CLIENT_NAME, mDesiredImageSize, mDesiredImageSize), - (image) -> { setStartIconDrawable(new BitmapDrawable(getResources(), image)); }); + (image) -> { + // We've successfully fetched an image. Cancel any pending requests for the + // favicon. + cancelFavicon(); + setStartIconDrawable(new BitmapDrawable(getResources(), image)); + }); setPriceInfoChip(originalPrice, currentPrice); setPriceTrackingButton(priceTrackingEnabled);
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/omnibox/suggestions/OmniboxPedalsTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/omnibox/suggestions/OmniboxPedalsTest.java new file mode 100644 index 0000000..6115ff8 --- /dev/null +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/omnibox/suggestions/OmniboxPedalsTest.java
@@ -0,0 +1,239 @@ +// Copyright 2021 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.omnibox.suggestions; + +import android.app.Activity; + +import androidx.test.filters.MediumTest; + +import org.hamcrest.Matchers; +import org.junit.Assert; +import org.junit.Before; +import org.junit.Rule; +import org.junit.Test; +import org.junit.runner.RunWith; + +import org.chromium.base.ThreadUtils; +import org.chromium.base.test.util.CommandLineFlags; +import org.chromium.base.test.util.Criteria; +import org.chromium.base.test.util.CriteriaHelper; +import org.chromium.chrome.R; +import org.chromium.chrome.browser.flags.ChromeSwitches; +import org.chromium.chrome.browser.omnibox.LocationBarLayout; +import org.chromium.chrome.browser.omnibox.UrlBar; +import org.chromium.chrome.browser.omnibox.action.OmniboxPedalType; +import org.chromium.chrome.test.ChromeJUnit4ClassRunner; +import org.chromium.chrome.test.ChromeTabbedActivityTestRule; +import org.chromium.chrome.test.util.OmniboxTestUtils; +import org.chromium.chrome.test.util.WaitForFocusHelper; +import org.chromium.chrome.test.util.browser.Features.EnableFeatures; +import org.chromium.components.omnibox.AutocompleteMatch; +import org.chromium.content_public.browser.test.util.TestThreadUtils; + +/** + * Tests of the Omnibox Pedals feature. + */ +@RunWith(ChromeJUnit4ClassRunner.class) +@CommandLineFlags.Add({ChromeSwitches.DISABLE_FIRST_RUN_EXPERIENCE}) +public class OmniboxPedalsTest { + @Rule + public ChromeTabbedActivityTestRule mActivityTestRule = new ChromeTabbedActivityTestRule(); + + @Before + public void setUp() throws InterruptedException { + mActivityTestRule.startMainActivityOnBlankPage(); + } + + /** + * Type the |text| into |activity|'s url_bar. + * + * @param activity The Activity which url_bar is in. + * @param text The text will be typed into url_bar. + */ + private void typeInOmnibox(Activity activity, String text) throws InterruptedException { + final UrlBar urlBar = activity.findViewById(R.id.url_bar); + Assert.assertNotNull(urlBar); + + WaitForFocusHelper.acquireFocusForView(urlBar); + OmniboxTestUtils.waitForFocusAndKeyboardActive(urlBar, true); + + TestThreadUtils.runOnUiThreadBlocking(() -> { urlBar.setText(text); }); + } + + /** + * Find the Omnibox Pedal suggestion which suggests the |pedalType|, and return the + * suggestion. This method needs to run on the UI thread. + * + * @param locationBarLayout The layout which omnibox suggestions will show in. + * @param pedalType The Omnibox pedal type to be found. + * @return The suggesstion which suggests the matching OmniboxPedalType. + */ + private AutocompleteMatch findOmniboxPedalSuggestion( + LocationBarLayout locationBarLayout, @OmniboxPedalType int pedalType) { + ThreadUtils.assertOnUiThread(); + + AutocompleteCoordinator coordinator = locationBarLayout.getAutocompleteCoordinator(); + // Find the first matching suggestion. + for (int i = 0; i < coordinator.getSuggestionCount(); ++i) { + AutocompleteMatch suggestion = coordinator.getSuggestionAt(i); + if (suggestion != null && suggestion.getOmniboxPedal() != null + && suggestion.getOmniboxPedal().getID() == pedalType) { + return suggestion; + } + } + return null; + } + + @Test + @MediumTest + @EnableFeatures("OmniboxPedalsAndroidBatch1") + public void testClearBrowsingDataOmniboxPedalSuggestion() throws InterruptedException { + LocationBarLayout locationBarLayout = + (LocationBarLayout) mActivityTestRule.getActivity().findViewById(R.id.location_bar); + typeInOmnibox(mActivityTestRule.getActivity(), "Clear data"); + + CriteriaHelper.pollUiThread(() -> { + AutocompleteMatch matchSuggestion = findOmniboxPedalSuggestion( + locationBarLayout, OmniboxPedalType.CLEAR_BROWSING_DATA); + Criteria.checkThat(matchSuggestion, Matchers.notNullValue()); + }); + } + + @Test + @MediumTest + @EnableFeatures("OmniboxPedalsAndroidBatch1") + public void testManagePasswordsOmniboxPedalSuggestion() throws InterruptedException { + LocationBarLayout locationBarLayout = + (LocationBarLayout) mActivityTestRule.getActivity().findViewById(R.id.location_bar); + typeInOmnibox(mActivityTestRule.getActivity(), "Manage passwords"); + + CriteriaHelper.pollUiThread(() -> { + AutocompleteMatch matchSuggestion = findOmniboxPedalSuggestion( + locationBarLayout, OmniboxPedalType.MANAGE_PASSWORDS); + Criteria.checkThat(matchSuggestion, Matchers.notNullValue()); + }); + } + + @Test + @MediumTest + @EnableFeatures("OmniboxPedalsAndroidBatch1") + public void testManagePaymentMethodsOmniboxPedalSuggestion() throws InterruptedException { + LocationBarLayout locationBarLayout = + (LocationBarLayout) mActivityTestRule.getActivity().findViewById(R.id.location_bar); + typeInOmnibox(mActivityTestRule.getActivity(), "Manage payment methods"); + + CriteriaHelper.pollUiThread(() -> { + AutocompleteMatch matchSuggestion = findOmniboxPedalSuggestion( + locationBarLayout, OmniboxPedalType.UPDATE_CREDIT_CARD); + Criteria.checkThat(matchSuggestion, Matchers.notNullValue()); + }); + } + + @Test + @MediumTest + @EnableFeatures("OmniboxPedalsAndroidBatch1") + public void testOpenIncognitoTabOmniboxPedalSuggestion() throws InterruptedException { + LocationBarLayout locationBarLayout = + (LocationBarLayout) mActivityTestRule.getActivity().findViewById(R.id.location_bar); + typeInOmnibox(mActivityTestRule.getActivity(), "Open Incognito"); + + CriteriaHelper.pollUiThread(() -> { + AutocompleteMatch matchSuggestion = findOmniboxPedalSuggestion( + locationBarLayout, OmniboxPedalType.LAUNCH_INCOGNITO); + Criteria.checkThat(matchSuggestion, Matchers.notNullValue()); + }); + } + + @Test + @MediumTest + @EnableFeatures("OmniboxPedalsAndroidBatch1") + public void testRunChromeSafetyCheckOmniboxPedalSuggestion() throws InterruptedException { + LocationBarLayout locationBarLayout = + (LocationBarLayout) mActivityTestRule.getActivity().findViewById(R.id.location_bar); + typeInOmnibox(mActivityTestRule.getActivity(), "Run safety check"); + + CriteriaHelper.pollUiThread(() -> { + AutocompleteMatch matchSuggestion = findOmniboxPedalSuggestion( + locationBarLayout, OmniboxPedalType.RUN_CHROME_SAFETY_CHECK); + Criteria.checkThat(matchSuggestion, Matchers.notNullValue()); + }); + } + + @Test + @MediumTest + @EnableFeatures("OmniboxPedalsAndroidBatch1") + public void testManageSiteSettingsOmniboxPedalSuggestion() throws InterruptedException { + LocationBarLayout locationBarLayout = + (LocationBarLayout) mActivityTestRule.getActivity().findViewById(R.id.location_bar); + typeInOmnibox(mActivityTestRule.getActivity(), "Change site permissions"); + + CriteriaHelper.pollUiThread(() -> { + AutocompleteMatch matchSuggestion = findOmniboxPedalSuggestion( + locationBarLayout, OmniboxPedalType.MANAGE_SITE_SETTINGS); + Criteria.checkThat(matchSuggestion, Matchers.notNullValue()); + }); + } + + @Test + @MediumTest + @EnableFeatures("OmniboxPedalsAndroidBatch1") + public void testManageChromeSettingsOmniboxPedalSuggestion() throws InterruptedException { + LocationBarLayout locationBarLayout = + (LocationBarLayout) mActivityTestRule.getActivity().findViewById(R.id.location_bar); + typeInOmnibox(mActivityTestRule.getActivity(), "manage settings"); + + CriteriaHelper.pollUiThread(() -> { + AutocompleteMatch matchSuggestion = findOmniboxPedalSuggestion( + locationBarLayout, OmniboxPedalType.MANAGE_CHROME_SETTINGS); + Criteria.checkThat(matchSuggestion, Matchers.notNullValue()); + }); + } + + @Test + @MediumTest + @EnableFeatures("OmniboxPedalsAndroidBatch1") + public void testViewYourChromeHistoryOmniboxPedalSuggestion() throws InterruptedException { + LocationBarLayout locationBarLayout = + (LocationBarLayout) mActivityTestRule.getActivity().findViewById(R.id.location_bar); + typeInOmnibox(mActivityTestRule.getActivity(), "view chrome history"); + + CriteriaHelper.pollUiThread(() -> { + AutocompleteMatch matchSuggestion = findOmniboxPedalSuggestion( + locationBarLayout, OmniboxPedalType.VIEW_CHROME_HISTORY); + Criteria.checkThat(matchSuggestion, Matchers.notNullValue()); + }); + } + + @Test + @MediumTest + @EnableFeatures("OmniboxPedalsAndroidBatch1") + public void testManageAccessibilitySettingsOmniboxPedalSuggestion() + throws InterruptedException { + LocationBarLayout locationBarLayout = + (LocationBarLayout) mActivityTestRule.getActivity().findViewById(R.id.location_bar); + typeInOmnibox(mActivityTestRule.getActivity(), "Chrome accessibility"); + + CriteriaHelper.pollUiThread(() -> { + AutocompleteMatch matchSuggestion = findOmniboxPedalSuggestion( + locationBarLayout, OmniboxPedalType.MANAGE_CHROME_ACCESSIBILITY); + Criteria.checkThat(matchSuggestion, Matchers.notNullValue()); + }); + } + + @Test + @MediumTest + @EnableFeatures("OmniboxPedalsAndroidBatch1") + public void testPlayChromeDinoGameOmniboxPedalSuggestion() throws InterruptedException { + LocationBarLayout locationBarLayout = + (LocationBarLayout) mActivityTestRule.getActivity().findViewById(R.id.location_bar); + typeInOmnibox(mActivityTestRule.getActivity(), "Dino game"); + + CriteriaHelper.pollUiThread(() -> { + AutocompleteMatch matchSuggestion = findOmniboxPedalSuggestion( + locationBarLayout, OmniboxPedalType.PLAY_CHROME_DINO_GAME); + Criteria.checkThat(matchSuggestion, Matchers.notNullValue()); + }); + } +}
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/portals/PortalsTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/portals/PortalsTest.java index c1ee4e1..da1554e 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/portals/PortalsTest.java +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/portals/PortalsTest.java
@@ -40,6 +40,7 @@ import org.chromium.base.test.util.MinAndroidSdkLevel; import org.chromium.chrome.R; import org.chromium.chrome.browser.app.ChromeActivity; +import org.chromium.chrome.browser.flags.ChromeFeatureList; import org.chromium.chrome.browser.flags.ChromeSwitches; import org.chromium.chrome.browser.history.BrowsingHistoryBridge; import org.chromium.chrome.browser.history.HistoryItem; @@ -50,6 +51,7 @@ import org.chromium.chrome.browser.tab.Tab; import org.chromium.chrome.test.ChromeJUnit4ClassRunner; import org.chromium.chrome.test.ChromeTabbedActivityTestRule; +import org.chromium.chrome.test.util.browser.Features.DisableFeatures; import org.chromium.chrome.test.util.browser.webapps.WebappTestPage; import org.chromium.components.location.LocationUtils; import org.chromium.components.permissions.PermissionDialogController; @@ -457,6 +459,9 @@ @Test @MediumTest @Feature({"Portals"}) + // See https://crbug.com/1278223#c19. Remove this feature flag once + // portals are migrated off the multiple webcontents architecture. + @DisableFeatures({ChromeFeatureList.MESSAGES_FOR_ANDROID_INFRASTRUCTURE}) public void testHttpBasicAuthenticationInPortal() throws Exception { mActivityTestRule.startMainActivityWithURL( mTestServer.getURL("/chrome/test/data/android/about.html"));
diff --git a/chrome/app/generated_resources.grd b/chrome/app/generated_resources.grd index 4d25d7a..e56e458 100644 --- a/chrome/app/generated_resources.grd +++ b/chrome/app/generated_resources.grd
@@ -5049,6 +5049,12 @@ <message name="IDS_EXTENSIONS_MENU_SITE_ACCESS_TAB_TITLE" desc="Title of the site access tab in the Extensions Menu"> Permissions </message> + <message name="IDS_EXTENSIONS_MENU_SITE_ACCESS_TAB_HAS_ACCESS_SECTION_TITLE" desc="Header for section of extensions that can access the current site's data. $1 is replaced with the current site."> + Allowed to read and change <ph name="SITE_NAME">$1<ex>google.com</ex></ph> + </message> + <message name="IDS_EXTENSIONS_MENU_SITE_ACCESS_TAB_REQUESTS_ACCESS_SECTION_TITLE" desc="Header for section of extensions that request access to the current site's data. $1 is replaced with the current site."> + Requested to read and change <ph name="SITE_NAME">$1<ex>google.com</ex></ph> + </message> <message name="IDS_EXTENSIONS_MENU_EXTENSIONS_TAB_TITLE" desc="Title of the installed extensions tab in the Extensions Menu"> Installed </message>
diff --git a/chrome/app/generated_resources_grd/IDS_EXTENSIONS_MENU_SITE_ACCESS_TAB_HAS_ACCESS_SECTION_TITLE.png.sha1 b/chrome/app/generated_resources_grd/IDS_EXTENSIONS_MENU_SITE_ACCESS_TAB_HAS_ACCESS_SECTION_TITLE.png.sha1 new file mode 100644 index 0000000..553e376 --- /dev/null +++ b/chrome/app/generated_resources_grd/IDS_EXTENSIONS_MENU_SITE_ACCESS_TAB_HAS_ACCESS_SECTION_TITLE.png.sha1
@@ -0,0 +1 @@ +2eb1b882e9c8fa5d2aa0f27a4d84ccb5e1b0a3fc \ No newline at end of file
diff --git a/chrome/app/generated_resources_grd/IDS_EXTENSIONS_MENU_SITE_ACCESS_TAB_REQUESTS_ACCESS_SECTION_TITLE.png.sha1 b/chrome/app/generated_resources_grd/IDS_EXTENSIONS_MENU_SITE_ACCESS_TAB_REQUESTS_ACCESS_SECTION_TITLE.png.sha1 new file mode 100644 index 0000000..553e376 --- /dev/null +++ b/chrome/app/generated_resources_grd/IDS_EXTENSIONS_MENU_SITE_ACCESS_TAB_REQUESTS_ACCESS_SECTION_TITLE.png.sha1
@@ -0,0 +1 @@ +2eb1b882e9c8fa5d2aa0f27a4d84ccb5e1b0a3fc \ No newline at end of file
diff --git a/chrome/browser/BUILD.gn b/chrome/browser/BUILD.gn index 27d216d..e74dac9 100644 --- a/chrome/browser/BUILD.gn +++ b/chrome/browser/BUILD.gn
@@ -529,6 +529,8 @@ "file_system_access/file_system_access_tab_helper.h", "file_util_service.cc", "file_util_service.h", + "first_party_sets/first_party_sets_pref_names.cc", + "first_party_sets/first_party_sets_pref_names.h", "first_party_sets/first_party_sets_util.cc", "first_party_sets/first_party_sets_util.h", "flag_descriptions.cc", @@ -5133,8 +5135,8 @@ "lacros/account_manager/profile_account_manager_factory.h", "lacros/app_mode/kiosk_session_service_lacros.cc", "lacros/app_mode/kiosk_session_service_lacros.h", - "lacros/arc_icon_cache_lacros.cc", - "lacros/arc_icon_cache_lacros.h", + "lacros/arc/arc_icon_cache.cc", + "lacros/arc/arc_icon_cache.h", "lacros/automation_manager_lacros.cc", "lacros/automation_manager_lacros.h", "lacros/browser_service_lacros.cc", @@ -7687,12 +7689,12 @@ deps += [ "//ash/components/attestation:test_support", "//ash/components/disks", + "//ash/components/login/auth", "//ash/public/cpp", "//chrome/test:test_support_ui", "//chromeos:test_support", "//chromeos/dbus", "//chromeos/dbus/cros_disks", - "//chromeos/login/auth", "//components/session_manager/core", "//components/soda", "//components/user_manager:test_support",
diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc index e2b5687..337c3a81 100644 --- a/chrome/browser/about_flags.cc +++ b/chrome/browser/about_flags.cc
@@ -3592,6 +3592,10 @@ {"terminal-ssh", flag_descriptions::kTerminalSSHName, flag_descriptions::kTerminalSSHDescription, kOsCrOS, FEATURE_VALUE_TYPE(chromeos::features::kTerminalSSH)}, + {"terminal-tmux-integration", + flag_descriptions::kTerminalTmuxIntegrationName, + flag_descriptions::kTerminalTmuxIntegrationDescription, kOsCrOS, + FEATURE_VALUE_TYPE(chromeos::features::kTerminalTmuxIntegration)}, {"crostini-use-lxd-4", flag_descriptions::kCrostiniUseLxd4Name, flag_descriptions::kCrostiniUseLxd4Description, kOsCrOS, FEATURE_VALUE_TYPE(chromeos::features::kCrostiniUseLxd4)},
diff --git a/chrome/browser/app_controller_mac.h b/chrome/browser/app_controller_mac.h index 8178d56..66374b4 100644 --- a/chrome/browser/app_controller_mac.h +++ b/chrome/browser/app_controller_mac.h
@@ -200,6 +200,15 @@ // keyEquivalent. - (void)updateMenuItemKeyEquivalents; +// Returns YES if `window` is a normal, tabbed, non-app browser window. +// Serves as a swizzle point for unit tests to avoid creating Browser +// instances. +- (BOOL)windowHasBrowserTabs:(NSWindow*)window; + +// Testing API. +- (void)setCloseWindowMenuItemForTesting:(NSMenuItem*)menuItem; +- (void)setCloseTabMenuItemForTesting:(NSMenuItem*)menuItem; + @end #endif // __OBJC__
diff --git a/chrome/browser/app_controller_mac.mm b/chrome/browser/app_controller_mac.mm index 2e33807d..fc8a075b 100644 --- a/chrome/browser/app_controller_mac.mm +++ b/chrome/browser/app_controller_mac.mm
@@ -1832,24 +1832,38 @@ _menuState.get(), _lastProfile)); } +- (BOOL)windowHasBrowserTabs:(NSWindow*)window { + if (!window) { + return NO; + } + Browser* browser = chrome::FindBrowserWithWindow(window); + return browser && browser->is_type_normal(); +} + - (void)updateMenuItemKeyEquivalents { BOOL enableCloseTabShortcut = NO; + id target = [NSApp targetForAction:@selector(performClose:)]; - // |target| is an instance of NSPopover or NSWindow. - // If a popover (likely the dictionary lookup popover), we want Cmd-W to - // close the popover so map it to "Close Window". - // Otherwise, map Cmd-W to "Close Tab" if it's a browser window. - if ([target isKindOfClass:[NSWindow class]]) { - NSWindow* window = target; - NSWindow* mainWindow = [NSApp mainWindow]; - if (!window || ([window parentWindow] == mainWindow)) { - // If the target window is a child of the main window (e.g. a bubble), the - // main window should be the one that handles the close menu item action. - window = mainWindow; + // If `target` is a popover (likely the dictionary lookup popover) the + // main window should handle the close menu item action. + NSWindow* targetWindow = nil; + if ([target isKindOfClass:[NSPopover class]]) { + targetWindow = + [[[base::mac::ObjCCast<NSPopover>(target) contentViewController] view] + window]; + } else { + targetWindow = base::mac::ObjCCast<NSWindow>(target); + } + + if (targetWindow != nil) { + // If `targetWindow` is a child (a popover or bubble) the parent should + // handle the command. + if ([targetWindow parentWindow] != nil) { + targetWindow = [targetWindow parentWindow]; } - Browser* browser = chrome::FindBrowserWithWindow(window); - enableCloseTabShortcut = browser && browser->is_type_normal(); + + enableCloseTabShortcut = [self windowHasBrowserTabs:targetWindow]; } [self adjustCloseWindowMenuItemKeyEquivalent:enableCloseTabShortcut]; @@ -1971,6 +1985,14 @@ }); } +- (void)setCloseWindowMenuItemForTesting:(NSMenuItem*)menuItem { + _closeWindowMenuItem = menuItem; +} + +- (void)setCloseTabMenuItemForTesting:(NSMenuItem*)menuItem { + _closeTabMenuItem = menuItem; +} + @end // @implementation AppController //---------------------------------------------------------------------------
diff --git a/chrome/browser/app_controller_mac_unittest.mm b/chrome/browser/app_controller_mac_unittest.mm index bdfd7dcd..526d1b7 100644 --- a/chrome/browser/app_controller_mac_unittest.mm +++ b/chrome/browser/app_controller_mac_unittest.mm
@@ -7,6 +7,7 @@ #include "base/callback_helpers.h" #include "base/files/file_path.h" #include "base/mac/scoped_nsobject.h" +#include "base/mac/scoped_objc_class_swizzler.h" #include "base/run_loop.h" #include "base/strings/utf_string_conversions.h" #include "chrome/app/chrome_command_ids.h" @@ -21,6 +22,39 @@ #include "content/public/test/browser_task_environment.h" #include "testing/platform_test.h" +namespace { + +id* TargetForAction() { + static id targetForAction; + return &targetForAction; +} + +} // namespace + +@interface FakeBrowserWindow : NSWindow +@end + +@implementation FakeBrowserWindow +@end + +// A class providing alternative implementations of various methods. +@interface AppControllerKeyEquivalentTestHelper : NSObject +- (id)targetForAction:(SEL)selector; +- (BOOL)windowHasBrowserTabs:(NSWindow*)window; +@end + +@implementation AppControllerKeyEquivalentTestHelper + +- (id)targetForAction:(SEL)selector { + return *TargetForAction(); +} + +- (BOOL)windowHasBrowserTabs:(NSWindow*)window { + return [window isKindOfClass:[FakeBrowserWindow class]]; +} + +@end + class AppControllerTest : public PlatformTest { protected: AppControllerTest() @@ -44,6 +78,78 @@ TestingProfile* profile_; }; +class AppControllerKeyEquivalentTest : public PlatformTest { + protected: + AppControllerKeyEquivalentTest() {} + + void SetUp() override { + PlatformTest::SetUp(); + + nsAppTargetForActionSwizzler_ = + std::make_unique<base::mac::ScopedObjCClassSwizzler>( + [NSApp class], [AppControllerKeyEquivalentTestHelper class], + @selector(targetForAction:)); + appControllerSwizzler_ = + std::make_unique<base::mac::ScopedObjCClassSwizzler>( + [AppController class], [AppControllerKeyEquivalentTestHelper class], + @selector(windowHasBrowserTabs:)); + + appController_.reset([[AppController alloc] init]); + + closeWindowMenuItem_.reset([[NSMenuItem alloc] initWithTitle:@"" + action:0 + keyEquivalent:@""]); + [appController_ setCloseWindowMenuItemForTesting:closeWindowMenuItem_]; + + closeTabMenuItem_.reset([[NSMenuItem alloc] initWithTitle:@"" + action:0 + keyEquivalent:@""]); + [appController_ setCloseTabMenuItemForTesting:closeTabMenuItem_]; + } + + void CheckMenuItemsMatchBrowserWindow() { + ASSERT_EQ([NSApp targetForAction:@selector(performClose:)], + *TargetForAction()); + + [appController_ updateMenuItemKeyEquivalents]; + + EXPECT_TRUE([[closeWindowMenuItem_ keyEquivalent] isEqualToString:@"W"]); + EXPECT_EQ([closeWindowMenuItem_ keyEquivalentModifierMask], + NSCommandKeyMask); + EXPECT_TRUE([[closeTabMenuItem_ keyEquivalent] isEqualToString:@"w"]); + EXPECT_EQ([closeTabMenuItem_ keyEquivalentModifierMask], NSCommandKeyMask); + } + + void CheckMenuItemsMatchNonBrowserWindow() { + ASSERT_EQ([NSApp targetForAction:@selector(performClose:)], + *TargetForAction()); + + [appController_ updateMenuItemKeyEquivalents]; + + EXPECT_TRUE([[closeWindowMenuItem_ keyEquivalent] isEqualToString:@"w"]); + EXPECT_EQ([closeWindowMenuItem_ keyEquivalentModifierMask], + NSCommandKeyMask); + EXPECT_TRUE([[closeTabMenuItem_ keyEquivalent] isEqualToString:@""]); + EXPECT_EQ([closeTabMenuItem_ keyEquivalentModifierMask], 0UL); + } + + void TearDown() override { + PlatformTest::TearDown(); + + [appController_ setCloseWindowMenuItemForTesting:nil]; + [appController_ setCloseTabMenuItemForTesting:nil]; + *TargetForAction() = nil; + } + + private: + std::unique_ptr<base::mac::ScopedObjCClassSwizzler> + nsAppTargetForActionSwizzler_; + std::unique_ptr<base::mac::ScopedObjCClassSwizzler> appControllerSwizzler_; + base::scoped_nsobject<AppController> appController_; + base::scoped_nsobject<NSMenuItem> closeWindowMenuItem_; + base::scoped_nsobject<NSMenuItem> closeTabMenuItem_; +}; + TEST_F(AppControllerTest, DockMenuProfileNotLoaded) { base::scoped_nsobject<AppController> ac([[AppController alloc] init]); NSMenu* menu = [ac applicationDockMenu:NSApp]; @@ -96,3 +202,89 @@ EXPECT_EQ(dest_path2, [ac lastProfile]->GetPath()); } + +// Tests key equivalents for Close Window when target is a child window (like a +// bubble). +TEST_F(AppControllerKeyEquivalentTest, UpdateMenuItemsForBubbleWindow) { + // Set up the "bubble" and main window. + const NSRect kContentRect = NSMakeRect(0.0, 0.0, 10.0, 10.0); + base::scoped_nsobject<NSWindow> childWindow([[NSWindow alloc] + initWithContentRect:kContentRect + styleMask:NSWindowStyleMaskClosable + backing:NSBackingStoreBuffered + defer:YES]); + base::scoped_nsobject<NSWindow> browserWindow([[FakeBrowserWindow alloc] + initWithContentRect:kContentRect + styleMask:NSWindowStyleMaskClosable + backing:NSBackingStoreBuffered + defer:YES]); + + [browserWindow addChildWindow:childWindow ordered:NSWindowAbove]; + + *TargetForAction() = childWindow; + + CheckMenuItemsMatchBrowserWindow(); +} + +// Tests key equivalents for Close Window when target is an NSPopOver. +TEST_F(AppControllerKeyEquivalentTest, UpdateMenuItemsForPopover) { + // Set up the popover and main window. + const NSRect kContentRect = NSMakeRect(0.0, 0.0, 10.0, 10.0); + base::scoped_nsobject<NSPopover> popover([[NSPopover alloc] init]); + base::scoped_nsobject<NSWindow> popoverWindow([[NSWindow alloc] + initWithContentRect:kContentRect + styleMask:NSWindowStyleMaskClosable + backing:NSBackingStoreBuffered + defer:YES]); + [popover + setContentViewController:[[[NSViewController alloc] init] autorelease]]; + [[popover contentViewController] setView:[popoverWindow contentView]]; + base::scoped_nsobject<NSWindow> browserWindow([[FakeBrowserWindow alloc] + initWithContentRect:kContentRect + styleMask:NSWindowStyleMaskClosable + backing:NSBackingStoreBuffered + defer:YES]); + [browserWindow addChildWindow:popoverWindow ordered:NSWindowAbove]; + + *TargetForAction() = popover; + + CheckMenuItemsMatchBrowserWindow(); +} + +// Tests key equivalents for Close Window when target is a browser window. +TEST_F(AppControllerKeyEquivalentTest, UpdateMenuItemsForBrowserWindow) { + // Set up the browser window. + const NSRect kContentRect = NSMakeRect(0.0, 0.0, 10.0, 10.0); + base::scoped_nsobject<NSWindow> browserWindow([[FakeBrowserWindow alloc] + initWithContentRect:kContentRect + styleMask:NSWindowStyleMaskClosable + backing:NSBackingStoreBuffered + defer:YES]); + + *TargetForAction() = browserWindow; + + CheckMenuItemsMatchBrowserWindow(); +} + +// Tests key equivalents for Close Window when target is not a browser window. +TEST_F(AppControllerKeyEquivalentTest, UpdateMenuItemsForNonBrowserWindow) { + // Set up the window. + const NSRect kContentRect = NSMakeRect(0.0, 0.0, 10.0, 10.0); + base::scoped_nsobject<NSWindow> mainWindow([[NSWindow alloc] + initWithContentRect:kContentRect + styleMask:NSWindowStyleMaskClosable + backing:NSBackingStoreBuffered + defer:YES]); + + *TargetForAction() = mainWindow; + + CheckMenuItemsMatchNonBrowserWindow(); +} + +// Tests key equivalents for Close Window when target is not a window. +TEST_F(AppControllerKeyEquivalentTest, UpdateMenuItemsForNonWindow) { + base::scoped_nsobject<NSObject> nonWindowObject([[NSObject alloc] init]); + *TargetForAction() = nonWindowObject; + + CheckMenuItemsMatchNonBrowserWindow(); +}
diff --git a/chrome/browser/apps/app_service/metrics/app_platform_metrics.cc b/chrome/browser/apps/app_service/metrics/app_platform_metrics.cc index eb510825..e0466e8 100644 --- a/chrome/browser/apps/app_service/metrics/app_platform_metrics.cc +++ b/chrome/browser/apps/app_service/metrics/app_platform_metrics.cc
@@ -382,6 +382,136 @@ } // static +ukm::SourceId AppPlatformMetrics::GetSourceId(Profile* profile, + const std::string& app_id) { + if (!AppServiceProxyFactory::IsAppServiceAvailableForProfile(profile)) { + return ukm::kInvalidSourceId; + } + + ukm::SourceId source_id = ukm::kInvalidSourceId; + apps::mojom::AppType app_type = GetAppType(profile, app_id); + if (!ShouldRecordUkmForAppTypeName(ConvertMojomAppTypToAppType(app_type))) { + return ukm::kInvalidSourceId; + } + + switch (app_type) { + case apps::mojom::AppType::kBuiltIn: + case apps::mojom::AppType::kChromeApp: + case apps::mojom::AppType::kExtension: + source_id = ukm::AppSourceUrlRecorder::GetSourceIdForChromeApp(app_id); + break; + case apps::mojom::AppType::kArc: + case apps::mojom::AppType::kWeb: + case apps::mojom::AppType::kSystemWeb: { + std::string publisher_id; + apps::mojom::InstallReason install_reason; + apps::AppServiceProxyFactory::GetForProfile(profile) + ->AppRegistryCache() + .ForOneApp(app_id, [&publisher_id, + &install_reason](const apps::AppUpdate& update) { + publisher_id = update.PublisherId(); + install_reason = update.InstallReason(); + }); + if (publisher_id.empty()) { + return ukm::kInvalidSourceId; + } + if (app_type == apps::mojom::AppType::kArc) { + source_id = ukm::AppSourceUrlRecorder::GetSourceIdForArcPackageName( + publisher_id); + break; + } + if (app_type == apps::mojom::AppType::kSystemWeb || + install_reason == apps::mojom::InstallReason::kSystem) { + // For system web apps, call GetSourceIdForChromeApp to record the app + // id because the url could be filtered by the server side. + source_id = ukm::AppSourceUrlRecorder::GetSourceIdForChromeApp(app_id); + break; + } + source_id = + ukm::AppSourceUrlRecorder::GetSourceIdForPWA(GURL(publisher_id)); + break; + } + case apps::mojom::AppType::kCrostini: + source_id = GetSourceIdForCrostini(profile, app_id); + break; + case apps::mojom::AppType::kBorealis: + source_id = GetSourceIdForBorealis(profile, app_id); + break; + case apps::mojom::AppType::kUnknown: + case apps::mojom::AppType::kMacOs: + case apps::mojom::AppType::kPluginVm: + case apps::mojom::AppType::kStandaloneBrowser: + case apps::mojom::AppType::kStandaloneBrowserChromeApp: + case apps::mojom::AppType::kRemote: + return ukm::kInvalidSourceId; + } + return source_id; +} + +// static +ukm::SourceId AppPlatformMetrics::GetSourceIdForBorealis( + Profile* profile, + const std::string& app_id) { + // Most Borealis apps are identified by a numeric ID, except these. + if (app_id == borealis::kBorealisMainAppId) { + return ukm::AppSourceUrlRecorder::GetSourceIdForBorealis("client"); + } else if (app_id == borealis::kBorealisAppId) { + return ukm::AppSourceUrlRecorder::GetSourceIdForBorealis("installer"); + } else if (app_id.find(borealis::kIgnoredAppIdPrefix) != std::string::npos) { + // These are not real apps from a user's point of view, + // so it doesn't make sense to record metrics for them. + return ukm::kInvalidSourceId; + } + + auto* registry = + guest_os::GuestOsRegistryServiceFactory::GetForProfile(profile); + auto registration = registry->GetRegistration(app_id); + if (!registration) { + // If there's no registration then we're not allowed to record anything that + // could identify the app (and we don't know the app name anyway), but + // recording every unregistered app in one big bucket is fine. + // + // In general all Borealis apps should be registered, so if we do see this + // Source ID being reported, that's a bug. + LOG(WARNING) << "Couldn't get Borealis ID for UNREGISTERED app " << app_id; + return ukm::AppSourceUrlRecorder::GetSourceIdForBorealis("UNREGISTERED"); + } + absl::optional<int> borealis_id = + borealis::GetBorealisAppId(registration->Exec()); + if (!borealis_id) + LOG(WARNING) << "Couldn't get Borealis ID for registered app " << app_id; + return ukm::AppSourceUrlRecorder::GetSourceIdForBorealis( + borealis_id ? base::NumberToString(borealis_id.value()) : "NoId"); +} + +// static +ukm::SourceId AppPlatformMetrics::GetSourceIdForCrostini( + Profile* profile, + const std::string& app_id) { + if (app_id == crostini::kCrostiniTerminalSystemAppId) { + // The terminal is special, since it's actually a web app (though one we + // count as Crostini) it doesn't have a desktop id, so give it a fake one. + return ukm::AppSourceUrlRecorder::GetSourceIdForCrostini("CrostiniTerminal", + "Terminal"); + } + auto* registry = + guest_os::GuestOsRegistryServiceFactory::GetForProfile(profile); + auto registration = registry->GetRegistration(app_id); + if (!registration) { + // If there's no registration then we're not allowed to record anything that + // could identify the app (and we don't know the app name anyway), but + // recording every unregistered app in one big bucket is fine. + return ukm::AppSourceUrlRecorder::GetSourceIdForCrostini("UNREGISTERED", + "UNREGISTERED"); + } + auto desktop_id = registration->DesktopFileId() == "" + ? "NoId" + : registration->DesktopFileId(); + return ukm::AppSourceUrlRecorder::GetSourceIdForCrostini( + desktop_id, registration->Name()); +} + +// static std::string AppPlatformMetrics::GetAppsCountHistogramNameForTest( AppTypeName app_type_name) { return kAppsCountHistogramPrefix + GetAppTypeHistogramName(app_type_name); @@ -477,7 +607,7 @@ apps::AppTypeName app_type_name = GetAppTypeName(profile_, app_type, app_id, container); - ukm::SourceId source_id = GetSourceId(app_id); + ukm::SourceId source_id = GetSourceId(profile_, app_id); if (source_id == ukm::kInvalidSourceId) { return; } @@ -498,7 +628,7 @@ GetAppTypeName(profile_, app_type, app_id, apps::mojom::LaunchContainer::kLaunchContainerNone); - ukm::SourceId source_id = GetSourceId(app_id); + ukm::SourceId source_id = GetSourceId(profile_, app_id); if (source_id == ukm::kInvalidSourceId) { return; } @@ -755,7 +885,7 @@ app_type_v2_running_time_per_five_minutes_[app_type_name_v2] += running_time; if (usage_time_it == usage_time_per_five_minutes_.end()) { - auto source_id = GetSourceId(app_id); + auto source_id = GetSourceId(profile_, app_id); if (source_id != ukm::kInvalidSourceId) { usage_time_per_five_minutes_[it->first].source_id = source_id; usage_time_it = usage_time_per_five_minutes_.find(it->first); @@ -897,7 +1027,7 @@ auto usage_time_it = usage_time_per_five_minutes_.find(it.first); if (usage_time_it == usage_time_per_five_minutes_.end()) { - auto source_id = GetSourceId(it.second.app_id); + auto source_id = GetSourceId(profile_, it.second.app_id); if (source_id != ukm::kInvalidSourceId) { usage_time_per_five_minutes_[it.first].source_id = source_id; usage_time_it = usage_time_per_five_minutes_.find(it.first); @@ -965,7 +1095,7 @@ GetAppTypeName(profile_, update.AppType(), update.AppId(), apps::mojom::LaunchContainer::kLaunchContainerNone); - ukm::SourceId source_id = GetSourceId(update.AppId()); + ukm::SourceId source_id = GetSourceId(profile_, update.AppId()); if (source_id == ukm::kInvalidSourceId) { return; } @@ -980,122 +1110,4 @@ ukm::AppSourceUrlRecorder::MarkSourceForDeletion(source_id); } -ukm::SourceId AppPlatformMetrics::GetSourceId(const std::string& app_id) { - ukm::SourceId source_id = ukm::kInvalidSourceId; - apps::mojom::AppType app_type = GetAppType(profile_, app_id); - if (!ShouldRecordUkmForAppTypeName(ConvertMojomAppTypToAppType(app_type))) { - return ukm::kInvalidSourceId; - } - - switch (app_type) { - case apps::mojom::AppType::kBuiltIn: - case apps::mojom::AppType::kChromeApp: - case apps::mojom::AppType::kExtension: - source_id = ukm::AppSourceUrlRecorder::GetSourceIdForChromeApp(app_id); - break; - case apps::mojom::AppType::kArc: - case apps::mojom::AppType::kWeb: - case apps::mojom::AppType::kSystemWeb: { - std::string publisher_id; - apps::mojom::InstallReason install_reason; - app_registry_cache_.ForOneApp(app_id, [&publisher_id, &install_reason]( - const apps::AppUpdate& update) { - publisher_id = update.PublisherId(); - install_reason = update.InstallReason(); - }); - if (publisher_id.empty()) { - return ukm::kInvalidSourceId; - } - if (app_type == apps::mojom::AppType::kArc) { - source_id = ukm::AppSourceUrlRecorder::GetSourceIdForArcPackageName( - publisher_id); - break; - } - if (app_type == apps::mojom::AppType::kSystemWeb || - install_reason == apps::mojom::InstallReason::kSystem) { - // For system web apps, call GetSourceIdForChromeApp to record the app - // id because the url could be filtered by the server side. - source_id = ukm::AppSourceUrlRecorder::GetSourceIdForChromeApp(app_id); - break; - } - source_id = - ukm::AppSourceUrlRecorder::GetSourceIdForPWA(GURL(publisher_id)); - break; - } - case apps::mojom::AppType::kCrostini: - source_id = GetSourceIdForCrostini(app_id); - break; - case apps::mojom::AppType::kBorealis: - source_id = GetSourceIdForBorealis(app_id); - break; - case apps::mojom::AppType::kUnknown: - case apps::mojom::AppType::kMacOs: - case apps::mojom::AppType::kPluginVm: - case apps::mojom::AppType::kStandaloneBrowser: - case apps::mojom::AppType::kStandaloneBrowserChromeApp: - case apps::mojom::AppType::kRemote: - return ukm::kInvalidSourceId; - } - return source_id; -} - -ukm::SourceId AppPlatformMetrics::GetSourceIdForBorealis( - const std::string& app_id) { - // Most Borealis apps are identified by a numeric ID, except these. - if (app_id == borealis::kBorealisMainAppId) { - return ukm::AppSourceUrlRecorder::GetSourceIdForBorealis("client"); - } else if (app_id == borealis::kBorealisAppId) { - return ukm::AppSourceUrlRecorder::GetSourceIdForBorealis("installer"); - } else if (app_id.find(borealis::kIgnoredAppIdPrefix) != std::string::npos) { - // These are not real apps from a user's point of view, - // so it doesn't make sense to record metrics for them. - return ukm::kInvalidSourceId; - } - - auto* registry = - guest_os::GuestOsRegistryServiceFactory::GetForProfile(profile_); - auto registration = registry->GetRegistration(app_id); - if (!registration) { - // If there's no registration then we're not allowed to record anything that - // could identify the app (and we don't know the app name anyway), but - // recording every unregistered app in one big bucket is fine. - // - // In general all Borealis apps should be registered, so if we do see this - // Source ID being reported, that's a bug. - LOG(WARNING) << "Couldn't get Borealis ID for UNREGISTERED app " << app_id; - return ukm::AppSourceUrlRecorder::GetSourceIdForBorealis("UNREGISTERED"); - } - absl::optional<int> borealis_id = - borealis::GetBorealisAppId(registration->Exec()); - if (!borealis_id) - LOG(WARNING) << "Couldn't get Borealis ID for registered app " << app_id; - return ukm::AppSourceUrlRecorder::GetSourceIdForBorealis( - borealis_id ? base::NumberToString(borealis_id.value()) : "NoId"); -} - -ukm::SourceId AppPlatformMetrics::GetSourceIdForCrostini( - const std::string& app_id) { - if (app_id == crostini::kCrostiniTerminalSystemAppId) { - // The terminal is special, since it's actually a web app (though one we - // count as Crostini) it doesn't have a desktop id, so give it a fake one. - return ukm::AppSourceUrlRecorder::GetSourceIdForCrostini("CrostiniTerminal", - "Terminal"); - } - auto* registry = - guest_os::GuestOsRegistryServiceFactory::GetForProfile(profile_); - auto registration = registry->GetRegistration(app_id); - if (!registration) { - // If there's no registration then we're not allowed to record anything that - // could identify the app (and we don't know the app name anyway), but - // recording every unregistered app in one big bucket is fine. - return ukm::AppSourceUrlRecorder::GetSourceIdForCrostini("UNREGISTERED", - "UNREGISTERED"); - } - auto desktop_id = registration->DesktopFileId() == "" - ? "NoId" - : registration->DesktopFileId(); - return ukm::AppSourceUrlRecorder::GetSourceIdForCrostini( - desktop_id, registration->Name()); -} - } // namespace apps
diff --git a/chrome/browser/apps/app_service/metrics/app_platform_metrics.h b/chrome/browser/apps/app_service/metrics/app_platform_metrics.h index 19796b0..92751d5 100644 --- a/chrome/browser/apps/app_service/metrics/app_platform_metrics.h +++ b/chrome/browser/apps/app_service/metrics/app_platform_metrics.h
@@ -83,6 +83,17 @@ AppPlatformMetrics& operator=(const AppPlatformMetrics&) = delete; ~AppPlatformMetrics() override; + // Returns the SourceId of UKM for `app_id`. + static ukm::SourceId GetSourceId(Profile* profile, const std::string& app_id); + + // Returns the SourceId for a Borealis app_id. + static ukm::SourceId GetSourceIdForBorealis(Profile* profile, + const std::string& app_id); + + // Gets the source id for a Crostini app_id. + static ukm::SourceId GetSourceIdForCrostini(Profile* profile, + const std::string& app_id); + // UMA metrics name for installed apps count in Chrome OS. static std::string GetAppsCountHistogramNameForTest( AppTypeName app_type_name); @@ -220,15 +231,6 @@ void RecordAppsInstallUkm(const apps::AppUpdate& update, InstallTime install_time); - // Returns the SourceId of UKM for `app_id`. - ukm::SourceId GetSourceId(const std::string& app_id); - - // Returns the SourceId for a Borealis app_id. - ukm::SourceId GetSourceIdForBorealis(const std::string& app_id); - - // Gets the source id for a Crostini app_id. - ukm::SourceId GetSourceIdForCrostini(const std::string& app_id); - Profile* const profile_ = nullptr; AppRegistryCache& app_registry_cache_;
diff --git a/chrome/browser/apps/guest_view/web_view_browsertest.cc b/chrome/browser/apps/guest_view/web_view_browsertest.cc index 40183a9..cdda7e5 100644 --- a/chrome/browser/apps/guest_view/web_view_browsertest.cc +++ b/chrome/browser/apps/guest_view/web_view_browsertest.cc
@@ -1618,7 +1618,45 @@ } IN_PROC_BROWSER_TEST_F(WebViewNewWindowTest, Shim_TestNewWindowNoReferrerLink) { + GURL newwindow_url("about:blank#noreferrer"); + content::TestNavigationObserver observer(newwindow_url); + observer.StartWatchingNewWebContents(); + TestHelper("testNewWindowNoReferrerLink", "web_view/shim", NEEDS_TEST_SERVER); + + // The first <webview> tag in the test will run window.open(), which the + // embedder will translate into an injected second <webview> tag. Ensure + // that both <webview>'s are in guest SiteInstances and in the same + // StoragePartition. + GetGuestViewManager()->WaitForNumGuestsCreated(2); + std::vector<content::WebContents*> guest_contents_list; + GetGuestViewManager()->GetGuestWebContentsList(&guest_contents_list); + ASSERT_EQ(2u, guest_contents_list.size()); + content::WebContents* guest1 = guest_contents_list[0]; + content::WebContents* guest2 = guest_contents_list[1]; + ASSERT_NE(guest1, guest2); + auto* guest_instance1 = guest1->GetMainFrame()->GetSiteInstance(); + auto* guest_instance2 = guest2->GetMainFrame()->GetSiteInstance(); + EXPECT_TRUE(guest_instance1->IsGuest()); + EXPECT_TRUE(guest_instance2->IsGuest()); + EXPECT_EQ(guest_instance1->GetStoragePartitionConfig(), + guest_instance2->GetStoragePartitionConfig()); + + // Until <webview> guests have site isolation, both guests should be in the + // same SiteInstance, even in this `opener_suppressed` case which typically + // places the new window in a new BrowsingInstance. + // + // TODO(alexmos): revisit this once <webview> guests support site isolation. + EXPECT_EQ(guest_instance1, guest_instance2); + + // Check that the source SiteInstance used when the first guest opened the + // new noreferrer window is also a guest SiteInstance in the same + // StoragePartition. + observer.Wait(); + ASSERT_TRUE(observer.last_source_site_instance()); + EXPECT_TRUE(observer.last_source_site_instance()->IsGuest()); + EXPECT_EQ(observer.last_source_site_instance()->GetStoragePartitionConfig(), + guest_instance1->GetStoragePartitionConfig()); } IN_PROC_BROWSER_TEST_F(WebViewNewWindowTest,
diff --git a/chrome/browser/ash/app_mode/kiosk_app_data.cc b/chrome/browser/ash/app_mode/kiosk_app_data.cc index c1764f0..0a2e00199 100644 --- a/chrome/browser/ash/app_mode/kiosk_app_data.cc +++ b/chrome/browser/ash/app_mode/kiosk_app_data.cc
@@ -225,15 +225,15 @@ } std::string required_platform_version; - if (manifest.FindPath( - extensions::manifest_keys::kKioskRequiredPlatformVersion) && - (!manifest.GetString( - extensions::manifest_keys::kKioskRequiredPlatformVersion, - &required_platform_version) || - !extensions::KioskModeInfo::IsValidPlatformVersion( - required_platform_version))) { - ReportFailure(); - return; + if (const base::Value* temp = manifest.FindPath( + extensions::manifest_keys::kKioskRequiredPlatformVersion)) { + if (!temp->is_string() || + !extensions::KioskModeInfo::IsValidPlatformVersion( + temp->GetString())) { + ReportFailure(); + return; + } + required_platform_version = temp->GetString(); } if (client_)
diff --git a/chrome/browser/ash/app_mode/kiosk_app_launch_error.cc b/chrome/browser/ash/app_mode/kiosk_app_launch_error.cc index 2390676..e1775176 100644 --- a/chrome/browser/ash/app_mode/kiosk_app_launch_error.cc +++ b/chrome/browser/ash/app_mode/kiosk_app_launch_error.cc
@@ -4,11 +4,11 @@ #include "chrome/browser/ash/app_mode/kiosk_app_launch_error.h" +#include "ash/components/login/auth/auth_status_consumer.h" #include "base/metrics/histogram_macros.h" #include "chrome/browser/ash/app_mode/kiosk_app_manager.h" #include "chrome/browser/browser_process.h" #include "chrome/grit/generated_resources.h" -#include "chromeos/login/auth/auth_status_consumer.h" #include "components/prefs/scoped_user_pref_update.h" #include "ui/base/l10n/l10n_util.h"
diff --git a/chrome/browser/ash/app_mode/kiosk_app_launch_error.h b/chrome/browser/ash/app_mode/kiosk_app_launch_error.h index 4e8e4ee..8fa88a5c 100644 --- a/chrome/browser/ash/app_mode/kiosk_app_launch_error.h +++ b/chrome/browser/ash/app_mode/kiosk_app_launch_error.h
@@ -9,7 +9,7 @@ // TODO(https://crbug.com/1164001): forward declare AuthFailure when migrated // to ash/components/. -#include "chromeos/login/auth/auth_status_consumer.h" +#include "ash/components/login/auth/auth_status_consumer.h" namespace ash {
diff --git a/chrome/browser/ash/app_mode/kiosk_app_launch_error_unittest.cc b/chrome/browser/ash/app_mode/kiosk_app_launch_error_unittest.cc index ac1c1eb..b51b3a4 100644 --- a/chrome/browser/ash/app_mode/kiosk_app_launch_error_unittest.cc +++ b/chrome/browser/ash/app_mode/kiosk_app_launch_error_unittest.cc
@@ -6,11 +6,11 @@ #include <string> +#include "ash/components/login/auth/auth_status_consumer.h" #include "chrome/browser/ash/app_mode/kiosk_app_manager.h" #include "chrome/grit/generated_resources.h" #include "chrome/test/base/scoped_testing_local_state.h" #include "chrome/test/base/testing_browser_process.h" -#include "chromeos/login/auth/auth_status_consumer.h" #include "testing/gtest/include/gtest/gtest.h" #include "ui/base/l10n/l10n_util.h"
diff --git a/chrome/browser/ash/app_mode/kiosk_external_update_validator.cc b/chrome/browser/ash/app_mode/kiosk_external_update_validator.cc index 4a37e0a..440c4e2d 100644 --- a/chrome/browser/ash/app_mode/kiosk_external_update_validator.cc +++ b/chrome/browser/ash/app_mode/kiosk_external_update_validator.cc
@@ -62,12 +62,12 @@ DCHECK(crx_file_.extension_id == extension->id()); std::string minimum_browser_version; - if (!extension->manifest()->GetString( - extensions::manifest_keys::kMinimumChromeVersion, - &minimum_browser_version)) { + if (const std::string* temp = extension->manifest()->FindStringPath( + extensions::manifest_keys::kMinimumChromeVersion)) { + minimum_browser_version = *temp; + } else { LOG(ERROR) << "Can't find minimum browser version for app " << crx_file_.extension_id; - minimum_browser_version.clear(); } content::GetUIThreadTaskRunner({})->PostTask(
diff --git a/chrome/browser/ash/app_mode/kiosk_profile_loader.cc b/chrome/browser/ash/app_mode/kiosk_profile_loader.cc index 5d2b5237..49d06b07 100644 --- a/chrome/browser/ash/app_mode/kiosk_profile_loader.cc +++ b/chrome/browser/ash/app_mode/kiosk_profile_loader.cc
@@ -6,6 +6,8 @@ #include <memory> +#include "ash/components/login/auth/auth_status_consumer.h" +#include "ash/components/login/auth/user_context.h" #include "base/bind.h" #include "base/ignore_result.h" #include "base/location.h" @@ -22,8 +24,6 @@ #include "chrome/browser/lifetime/application_lifetime.h" #include "chromeos/dbus/dbus_thread_manager.h" #include "chromeos/dbus/userdataauth/userdataauth_client.h" -#include "chromeos/login/auth/auth_status_consumer.h" -#include "chromeos/login/auth/user_context.h" #include "components/account_id/account_id.h" #include "components/user_manager/user_names.h" #include "content/public/browser/browser_thread.h"
diff --git a/chrome/browser/ash/app_mode/kiosk_profile_loader.h b/chrome/browser/ash/app_mode/kiosk_profile_loader.h index dacfda9..242162d6f 100644 --- a/chrome/browser/ash/app_mode/kiosk_profile_loader.h +++ b/chrome/browser/ash/app_mode/kiosk_profile_loader.h
@@ -8,13 +8,13 @@ #include <memory> #include <string> +#include "ash/components/login/auth/login_performer.h" +// TODO(https://crbug.com/1164001): remove when migrated to ash/components/. +#include "ash/components/login/auth/user_context.h" #include "base/callback.h" #include "chrome/browser/ash/app_mode/kiosk_app_launch_error.h" #include "chrome/browser/ash/app_mode/kiosk_app_manager_base.h" #include "chrome/browser/ash/login/session/user_session_manager.h" -#include "chromeos/login/auth/login_performer.h" -// TODO(https://crbug.com/1164001): remove when migrated to ash/components/. -#include "chromeos/login/auth/user_context.h" #include "components/account_id/account_id.h" class Profile;
diff --git a/chrome/browser/ash/arc/intent_helper/open_with_menu.h b/chrome/browser/ash/arc/intent_helper/open_with_menu.h index ac00711..3c6b137 100644 --- a/chrome/browser/ash/arc/intent_helper/open_with_menu.h +++ b/chrome/browser/ash/arc/intent_helper/open_with_menu.h
@@ -10,7 +10,7 @@ #include <utility> #include <vector> -#include "components/arc/intent_helper/link_handler_model.h" +#include "components/arc/common/intent_helper/link_handler_model.h" #include "components/renderer_context_menu/render_view_context_menu_observer.h" #include "ui/base/models/simple_menu_model.h" #include "url/gurl.h"
diff --git a/chrome/browser/ash/arc/intent_helper/open_with_menu_unittest.cc b/chrome/browser/ash/arc/intent_helper/open_with_menu_unittest.cc index eff262172..1e839d9ce 100644 --- a/chrome/browser/ash/arc/intent_helper/open_with_menu_unittest.cc +++ b/chrome/browser/ash/arc/intent_helper/open_with_menu_unittest.cc
@@ -14,7 +14,7 @@ #include "chrome/app/chrome_command_ids.h" #include "chrome/browser/renderer_context_menu/mock_render_view_context_menu.h" #include "chrome/grit/generated_resources.h" -#include "components/arc/intent_helper/link_handler_model.h" +#include "components/arc/common/intent_helper/link_handler_model.h" #include "components/renderer_context_menu/render_view_context_menu_observer.h" #include "components/renderer_context_menu/render_view_context_menu_proxy.h" #include "content/public/test/browser_task_environment.h"
diff --git a/chrome/browser/ash/borealis/borealis_capabilities.cc b/chrome/browser/ash/borealis/borealis_capabilities.cc new file mode 100644 index 0000000..8bab12c --- /dev/null +++ b/chrome/browser/ash/borealis/borealis_capabilities.cc
@@ -0,0 +1,17 @@ +// Copyright 2021 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 "chrome/browser/ash/borealis/borealis_capabilities.h" + +#include "third_party/cros_system_api/constants/vm_tools.h" + +namespace borealis { + +BorealisCapabilities::~BorealisCapabilities() = default; + +std::string BorealisCapabilities::GetSecurityContext() const { + return vm_tools::kConciergeSecurityContext; +} + +} // namespace borealis
diff --git a/chrome/browser/ash/borealis/borealis_capabilities.h b/chrome/browser/ash/borealis/borealis_capabilities.h new file mode 100644 index 0000000..dcfa1d0d --- /dev/null +++ b/chrome/browser/ash/borealis/borealis_capabilities.h
@@ -0,0 +1,24 @@ +// Copyright 2021 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 CHROME_BROWSER_ASH_BOREALIS_BOREALIS_CAPABILITIES_H_ +#define CHROME_BROWSER_ASH_BOREALIS_BOREALIS_CAPABILITIES_H_ + +#include "components/exo/capabilities.h" + +namespace borealis { + +// Controls what specialized behaviours the exo server will have when dealing +// with borealis clients. +class BorealisCapabilities : public exo::Capabilities { + public: + ~BorealisCapabilities() override; + + // exo::Capabilities overrides: + std::string GetSecurityContext() const override; +}; + +} // namespace borealis + +#endif // CHROME_BROWSER_ASH_BOREALIS_BOREALIS_CAPABILITIES_H_
diff --git a/chrome/browser/ash/borealis/borealis_context.h b/chrome/browser/ash/borealis/borealis_context.h index 86e7630..f4c84209 100644 --- a/chrome/browser/ash/borealis/borealis_context.h +++ b/chrome/browser/ash/borealis/borealis_context.h
@@ -49,6 +49,11 @@ const base::FilePath& disk_path() const { return disk_path_; } void set_disk_path(base::FilePath path) { disk_path_ = std::move(path); } + const base::FilePath& wayland_path() const { return wayland_path_; } + void set_wayland_path(base::FilePath path) { + wayland_path_ = std::move(path); + } + BorealisDiskManager& get_disk_manager() { return *disk_manager_.get(); } void SetDiskManagerForTesting( std::unique_ptr<BorealisDiskManager> disk_manager); @@ -66,6 +71,7 @@ std::string vm_name_; std::string container_name_; base::FilePath disk_path_; + base::FilePath wayland_path_; // This instance listens for the session to finish and issues an automatic // shutdown when it does. std::unique_ptr<BorealisLifetimeObserver> lifetime_observer_;
diff --git a/chrome/browser/ash/borealis/borealis_context_manager_impl.cc b/chrome/browser/ash/borealis/borealis_context_manager_impl.cc index 9069a44..46d95c7 100644 --- a/chrome/browser/ash/borealis/borealis_context_manager_impl.cc +++ b/chrome/browser/ash/borealis/borealis_context_manager_impl.cc
@@ -204,6 +204,7 @@ base::queue<std::unique_ptr<BorealisTask>> task_queue; task_queue.push(std::make_unique<MountDlc>()); task_queue.push(std::make_unique<CreateDiskImage>()); + task_queue.push(std::make_unique<RequestWaylandServer>()); task_queue.push(std::make_unique<StartBorealisVm>()); task_queue.push( std::make_unique<AwaitBorealisStartup>(profile_, kBorealisVmName));
diff --git a/chrome/browser/ash/borealis/borealis_features.cc b/chrome/browser/ash/borealis/borealis_features.cc index bd69a53..b3490a6 100644 --- a/chrome/browser/ash/borealis/borealis_features.cc +++ b/chrome/browser/ash/borealis/borealis_features.cc
@@ -12,24 +12,44 @@ #include "chromeos/tpm/install_attributes.h" #include "components/prefs/pref_service.h" +using AllowStatus = borealis::BorealisFeatures::AllowStatus; + namespace borealis { -BorealisFeatures::BorealisFeatures(Profile* profile) : profile_(profile) {} - -bool BorealisFeatures::IsAllowed() { +// static +AllowStatus BorealisFeatures::GetAllowanceForProfile(Profile* profile) { if (!base::FeatureList::IsEnabled(features::kBorealis)) - return false; + return AllowStatus::kFeatureDisabled; bool allowed_for_device; if (ash::CrosSettings::Get()->GetBoolean(ash::kBorealisAllowedForDevice, &allowed_for_device)) { if (!allowed_for_device) - return false; + return AllowStatus::kDevicePolicyBlocked; } - if (!profile_->GetPrefs()->GetBoolean(prefs::kBorealisAllowedForUser)) - return false; + if (!profile->GetPrefs()->GetBoolean(prefs::kBorealisAllowedForUser)) + return AllowStatus::kUserPrefBlocked; + return AllowStatus::kAllowed; +} + +BorealisFeatures::BorealisFeatures(Profile* profile) : profile_(profile) {} + +namespace { + +bool g_should_show_reason = true; + +} // namespace + +bool BorealisFeatures::IsAllowed() { + AllowStatus reason = GetAllowanceForProfile(profile_); + if (reason != AllowStatus::kAllowed) { + LOG_IF(ERROR, g_should_show_reason) + << "Borealis is not allowed: " << reason; + g_should_show_reason = false; + return false; + } return true; } @@ -40,3 +60,16 @@ } } // namespace borealis + +std::ostream& operator<<(std::ostream& os, const AllowStatus& reason) { + switch (reason) { + case AllowStatus::kAllowed: + return os << "Borealis is allowed"; + case AllowStatus::kFeatureDisabled: + return os << "Borealis feature is unavailable"; + case AllowStatus::kDevicePolicyBlocked: + return os << "Device is enrolled and borealis is disabled by policy"; + case AllowStatus::kUserPrefBlocked: + return os << "User profile preferences disallow borealis"; + } +}
diff --git a/chrome/browser/ash/borealis/borealis_features.h b/chrome/browser/ash/borealis/borealis_features.h index fbbe5d12..23906a82 100644 --- a/chrome/browser/ash/borealis/borealis_features.h +++ b/chrome/browser/ash/borealis/borealis_features.h
@@ -5,12 +5,27 @@ #ifndef CHROME_BROWSER_ASH_BOREALIS_BOREALIS_FEATURES_H_ #define CHROME_BROWSER_ASH_BOREALIS_BOREALIS_FEATURES_H_ +#include <ostream> +#include <string> + class Profile; namespace borealis { class BorealisFeatures { public: + // Enumeration for the reasons borealis might be allowed or not. + enum class AllowStatus { + kAllowed, + kFeatureDisabled, + kDevicePolicyBlocked, + kUserPrefBlocked, + }; + + // Static accessor for the allowed-ness check. Returns an AllowStatus + // relevant to the given |profile|. + static AllowStatus GetAllowanceForProfile(Profile* profile); + // Creates a per-profile instance of the feature-checker for borealis. explicit BorealisFeatures(Profile* profile); @@ -27,4 +42,7 @@ } // namespace borealis +std::ostream& operator<<(std::ostream& os, + const borealis::BorealisFeatures::AllowStatus& reason); + #endif // CHROME_BROWSER_ASH_BOREALIS_BOREALIS_FEATURES_H_
diff --git a/chrome/browser/ash/borealis/borealis_metrics.cc b/chrome/browser/ash/borealis/borealis_metrics.cc index c75f4be..cb26ab22 100644 --- a/chrome/browser/ash/borealis/borealis_metrics.cc +++ b/chrome/browser/ash/borealis/borealis_metrics.cc
@@ -189,14 +189,16 @@ case borealis::BorealisStartupResult::kCancelled: return stream << "Cancelled"; case borealis::BorealisStartupResult::kMountFailed: - return stream << "Mount Failed"; + return stream << "Mount failed"; case borealis::BorealisStartupResult::kDiskImageFailed: - return stream << "Disk Image Failed"; + return stream << "Disk Image failed"; case borealis::BorealisStartupResult::kStartVmFailed: - return stream << "Start VM Failed"; + return stream << "Start VM failed"; case borealis::BorealisStartupResult::kAwaitBorealisStartupFailed: - return stream << "Await Borealis Startup Failed"; + return stream << "Await Borealis Startup failed"; case borealis::BorealisStartupResult::kSyncDiskFailed: return stream << "Syncing Disk failed"; + case borealis::BorealisStartupResult::kRequestWaylandFailed: + return stream << "Request Wayland failed"; } }
diff --git a/chrome/browser/ash/borealis/borealis_metrics.h b/chrome/browser/ash/borealis/borealis_metrics.h index 0d4d402..c5d322c 100644 --- a/chrome/browser/ash/borealis/borealis_metrics.h +++ b/chrome/browser/ash/borealis/borealis_metrics.h
@@ -74,7 +74,8 @@ kStartVmFailed = 4, kAwaitBorealisStartupFailed = 5, kSyncDiskFailed = 6, - kMaxValue = kSyncDiskFailed, + kRequestWaylandFailed = 7, + kMaxValue = kRequestWaylandFailed, }; // These values are persisted to logs. Entries should not be renumbered and
diff --git a/chrome/browser/ash/borealis/borealis_service.h b/chrome/browser/ash/borealis/borealis_service.h index dc05aba..8b69c9c 100644 --- a/chrome/browser/ash/borealis/borealis_service.h +++ b/chrome/browser/ash/borealis/borealis_service.h
@@ -19,6 +19,7 @@ class BorealisInstaller; class BorealisLaunchOptions; class BorealisShutdownMonitor; +class BorealisWaylandInterface; class BorealisWindowManager; // A common location for all the interdependant components of borealis. @@ -37,6 +38,7 @@ virtual BorealisInstaller& Installer() = 0; virtual BorealisLaunchOptions& LaunchOptions() = 0; virtual BorealisShutdownMonitor& ShutdownMonitor() = 0; + virtual BorealisWaylandInterface& WaylandInterface() = 0; virtual BorealisWindowManager& WindowManager() = 0; };
diff --git a/chrome/browser/ash/borealis/borealis_service_fake.cc b/chrome/browser/ash/borealis/borealis_service_fake.cc index 68f313d..7f14df6 100644 --- a/chrome/browser/ash/borealis/borealis_service_fake.cc +++ b/chrome/browser/ash/borealis/borealis_service_fake.cc
@@ -20,6 +20,7 @@ }))); } +BorealisServiceFake::BorealisServiceFake() = default; BorealisServiceFake::~BorealisServiceFake() = default; BorealisAppLauncher& BorealisServiceFake::AppLauncher() { @@ -62,6 +63,11 @@ return *shutdown_monitor_; } +BorealisWaylandInterface& BorealisServiceFake::WaylandInterface() { + CHECK(wayland_interface_); + return *wayland_interface_; +} + BorealisWindowManager& BorealisServiceFake::WindowManager() { CHECK(window_manager_); return *window_manager_; @@ -100,6 +106,11 @@ shutdown_monitor_ = shutdown_monitor; } +void BorealisServiceFake::SetWaylandInterfaceForTesting( + BorealisWaylandInterface* wayland_interface) { + wayland_interface_ = wayland_interface; +} + void BorealisServiceFake::SetWindowManagerForTesting( BorealisWindowManager* window_manager) { window_manager_ = window_manager;
diff --git a/chrome/browser/ash/borealis/borealis_service_fake.h b/chrome/browser/ash/borealis/borealis_service_fake.h index 8c8cad3..cb966f0d 100644 --- a/chrome/browser/ash/borealis/borealis_service_fake.h +++ b/chrome/browser/ash/borealis/borealis_service_fake.h
@@ -20,6 +20,7 @@ static BorealisServiceFake* UseFakeForTesting( content::BrowserContext* context); + BorealisServiceFake(); ~BorealisServiceFake() override; BorealisAppLauncher& AppLauncher() override; @@ -30,6 +31,7 @@ BorealisInstaller& Installer() override; BorealisLaunchOptions& LaunchOptions() override; BorealisShutdownMonitor& ShutdownMonitor() override; + BorealisWaylandInterface& WaylandInterface() override; BorealisWindowManager& WindowManager() override; void SetAppLauncherForTesting(BorealisAppLauncher* app_launcher); @@ -41,6 +43,8 @@ void SetInstallerForTesting(BorealisInstaller* installer); void SetLaunchOptionsForTesting(BorealisLaunchOptions* launch_options); void SetShutdownMonitorForTesting(BorealisShutdownMonitor* shutdown_monitor); + void SetWaylandInterfaceForTesting( + BorealisWaylandInterface* wayland_interface); void SetWindowManagerForTesting(BorealisWindowManager* window_manager); private: @@ -52,6 +56,7 @@ BorealisInstaller* installer_ = nullptr; BorealisLaunchOptions* launch_options_ = nullptr; BorealisShutdownMonitor* shutdown_monitor_ = nullptr; + BorealisWaylandInterface* wayland_interface_ = nullptr; BorealisWindowManager* window_manager_ = nullptr; };
diff --git a/chrome/browser/ash/borealis/borealis_service_impl.cc b/chrome/browser/ash/borealis/borealis_service_impl.cc index d1fd543..76700078 100644 --- a/chrome/browser/ash/borealis/borealis_service_impl.cc +++ b/chrome/browser/ash/borealis/borealis_service_impl.cc
@@ -3,6 +3,7 @@ // found in the LICENSE file. #include "chrome/browser/ash/borealis/borealis_service_impl.h" +#include "chrome/browser/ash/borealis/borealis_service.h" namespace borealis { @@ -16,6 +17,7 @@ installer_(profile_), launch_options_(profile_), shutdown_monitor_(profile_), + wayland_interface_(profile_), window_manager_(profile_) {} BorealisServiceImpl::~BorealisServiceImpl() = default; @@ -52,6 +54,10 @@ return shutdown_monitor_; } +BorealisWaylandInterface& BorealisServiceImpl::WaylandInterface() { + return wayland_interface_; +} + BorealisWindowManager& BorealisServiceImpl::WindowManager() { return window_manager_; }
diff --git a/chrome/browser/ash/borealis/borealis_service_impl.h b/chrome/browser/ash/borealis/borealis_service_impl.h index cc03c45..f0aea56 100644 --- a/chrome/browser/ash/borealis/borealis_service_impl.h +++ b/chrome/browser/ash/borealis/borealis_service_impl.h
@@ -14,6 +14,7 @@ #include "chrome/browser/ash/borealis/borealis_launch_options.h" #include "chrome/browser/ash/borealis/borealis_service.h" #include "chrome/browser/ash/borealis/borealis_shutdown_monitor.h" +#include "chrome/browser/ash/borealis/borealis_wayland_interface.h" #include "chrome/browser/ash/borealis/borealis_window_manager.h" namespace borealis { @@ -34,6 +35,7 @@ BorealisInstaller& Installer() override; BorealisLaunchOptions& LaunchOptions() override; BorealisShutdownMonitor& ShutdownMonitor() override; + BorealisWaylandInterface& WaylandInterface() override; BorealisWindowManager& WindowManager() override; Profile* const profile_; @@ -46,6 +48,7 @@ BorealisInstallerImpl installer_; BorealisLaunchOptions launch_options_; BorealisShutdownMonitor shutdown_monitor_; + BorealisWaylandInterface wayland_interface_; BorealisWindowManager window_manager_; };
diff --git a/chrome/browser/ash/borealis/borealis_task.cc b/chrome/browser/ash/borealis/borealis_task.cc index 26bafc9..d1a4dde 100644 --- a/chrome/browser/ash/borealis/borealis_task.cc +++ b/chrome/browser/ash/borealis/borealis_task.cc
@@ -25,6 +25,7 @@ #include "chrome/browser/ash/borealis/borealis_metrics.h" #include "chrome/browser/ash/borealis/borealis_service.h" #include "chrome/browser/ash/borealis/borealis_util.h" +#include "chrome/browser/ash/borealis/borealis_wayland_interface.h" #include "chrome/browser/ash/profiles/profile_helper.h" #include "chrome/browser/profiles/profile.h" #include "chromeos/dbus/concierge/concierge_service.pb.h" @@ -116,6 +117,30 @@ Complete(BorealisStartupResult::kSuccess, ""); } +RequestWaylandServer::RequestWaylandServer() + : BorealisTask("RequestWaylandServer") {} +RequestWaylandServer::~RequestWaylandServer() = default; + +void RequestWaylandServer::RunInternal(BorealisContext* context) { + borealis::BorealisService::GetForProfile(context->profile()) + ->WaylandInterface() + .GetWaylandServer(base::BindOnce(&RequestWaylandServer::OnServerRequested, + weak_factory_.GetWeakPtr(), context)); +} + +void RequestWaylandServer::OnServerRequested( + BorealisContext* context, + BorealisCapabilities* capabilities, + const base::FilePath& server_path) { + if (!capabilities) { + Complete(BorealisStartupResult::kRequestWaylandFailed, + "Failed to create a wayland server"); + return; + } + context->set_wayland_path(server_path); + Complete(BorealisStartupResult::kSuccess, ""); +} + namespace { bool GetDeveloperMode() { @@ -165,6 +190,8 @@ absl::optional<base::File> external_disk) { vm_tools::concierge::StartVmRequest request; request.mutable_vm()->set_dlc_id(kBorealisDlcName); + request.mutable_vm()->set_wayland_server( + context->wayland_path().AsUTF8Unsafe()); request.set_start_termina(false); request.set_owner_id( chromeos::ProfileHelper::GetUserIdHashFromProfile(context->profile()));
diff --git a/chrome/browser/ash/borealis/borealis_task.h b/chrome/browser/ash/borealis/borealis_task.h index cd2e287f..7d3ae92 100644 --- a/chrome/browser/ash/borealis/borealis_task.h +++ b/chrome/browser/ash/borealis/borealis_task.h
@@ -15,6 +15,7 @@ namespace borealis { +class BorealisCapabilities; class BorealisContext; // BorealisTasks are collections of operations that are run by the @@ -72,6 +73,22 @@ base::WeakPtrFactory<CreateDiskImage> weak_factory_{this}; }; +// Requests a wayland server from Exo for use by the borealis VM. +class RequestWaylandServer : public BorealisTask { + public: + RequestWaylandServer(); + ~RequestWaylandServer() override; + + // BorealisTask overrides: + void RunInternal(BorealisContext* context) override; + + private: + void OnServerRequested(BorealisContext* context, + BorealisCapabilities* capabilities, + const base::FilePath& server_path); + base::WeakPtrFactory<RequestWaylandServer> weak_factory_{this}; +}; + // Instructs Concierge to start the Borealis VM. class StartBorealisVm : public BorealisTask { public:
diff --git a/chrome/browser/ash/borealis/borealis_wayland_interface.cc b/chrome/browser/ash/borealis/borealis_wayland_interface.cc new file mode 100644 index 0000000..038778b --- /dev/null +++ b/chrome/browser/ash/borealis/borealis_wayland_interface.cc
@@ -0,0 +1,60 @@ +// Copyright 2021 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 "chrome/browser/ash/borealis/borealis_wayland_interface.h" + +#include "base/callback.h" +#include "chrome/browser/ash/borealis/borealis_capabilities.h" +#include "components/exo/server/wayland_server_controller.h" + +namespace borealis { + +BorealisWaylandInterface::BorealisWaylandInterface(Profile* profile) + : profile_(profile), capabilities_(nullptr) { + (void)profile_; +} + +BorealisWaylandInterface::~BorealisWaylandInterface() { + if (capabilities_ && !server_path_.empty()) + exo::WaylandServerController::Get()->DeleteServer(server_path_); +} + +void BorealisWaylandInterface::GetWaylandServer( + base::OnceCallback<void(BorealisCapabilities*, const base::FilePath&)> + callback) { + if (capabilities_) { + // If there is a current operation in-progress we will just bail out. Its + // very unlikely that the user can run into this and if they do a retry will + // work. + if (server_path_.empty()) { + std::move(callback).Run(nullptr, {}); + return; + } + std::move(callback).Run(capabilities_, server_path_); + return; + } + auto caps = std::make_unique<BorealisCapabilities>(); + server_path_ = {}; + capabilities_ = caps.get(); + exo::WaylandServerController::Get()->CreateServer( + std::move(caps), + base::BindOnce(&BorealisWaylandInterface::OnWaylandServerCreated, + weak_factory_.GetWeakPtr(), std::move(callback))); +} + +void BorealisWaylandInterface::OnWaylandServerCreated( + base::OnceCallback<void(BorealisCapabilities*, const base::FilePath&)> + callback, + bool success, + const base::FilePath& server_path) { + if (!success) { + capabilities_ = nullptr; + std::move(callback).Run(nullptr, {}); + return; + } + server_path_ = server_path; + std::move(callback).Run(capabilities_, server_path_); +} + +} // namespace borealis
diff --git a/chrome/browser/ash/borealis/borealis_wayland_interface.h b/chrome/browser/ash/borealis/borealis_wayland_interface.h new file mode 100644 index 0000000..35f4bcb7 --- /dev/null +++ b/chrome/browser/ash/borealis/borealis_wayland_interface.h
@@ -0,0 +1,57 @@ +// Copyright 2021 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 CHROME_BROWSER_ASH_BOREALIS_BOREALIS_WAYLAND_INTERFACE_H_ +#define CHROME_BROWSER_ASH_BOREALIS_BOREALIS_WAYLAND_INTERFACE_H_ + +#include "base/callback_forward.h" +#include "base/files/file_path.h" +#include "base/memory/weak_ptr.h" + +class Profile; + +namespace borealis { + +class BorealisCapabilities; + +// This class tracks/owns the necessary information to allow borealis to deal +// with exo. Primarily this means the BorealisCapabilities (which define what +// exo does specially for borealis) and the server's path (which we pass to +// concierge). +// +// This class lazily requests server creation, so that we don't create a server +// unless we actually need it. If the server has been created, this class will +// clean it up in its own destruction (which is tied to the user's session). In +// practice this means that multiple invocations of borealis will all use the +// same server, rather than creating and destroying for each invocation. +class BorealisWaylandInterface { + public: + explicit BorealisWaylandInterface(Profile* profile); + ~BorealisWaylandInterface(); + + // Invokes the callback with the handle to the wayland server once one is + // available. + void GetWaylandServer( + base::OnceCallback<void(BorealisCapabilities*, const base::FilePath&)> + callback); + + private: + // Called by Exo when the GetWaylandServer request completes. + void OnWaylandServerCreated( + base::OnceCallback<void(BorealisCapabilities*, const base::FilePath&)> + callback, + bool success, + const base::FilePath& server_path); + + Profile* const profile_; + // This is owned by Exo, once the server is created. + BorealisCapabilities* capabilities_; + base::FilePath server_path_; + + base::WeakPtrFactory<BorealisWaylandInterface> weak_factory_{this}; +}; + +} // namespace borealis + +#endif // CHROME_BROWSER_ASH_BOREALIS_BOREALIS_WAYLAND_INTERFACE_H_
diff --git a/chrome/browser/ash/crosapi/BUILD.gn b/chrome/browser/ash/crosapi/BUILD.gn index bfb0ba52..5621768 100644 --- a/chrome/browser/ash/crosapi/BUILD.gn +++ b/chrome/browser/ash/crosapi/BUILD.gn
@@ -162,6 +162,7 @@ "//ash/components/account_manager", "//ash/components/arc/mojom", "//ash/components/arc/session", + "//ash/components/login/auth", "//ash/components/settings:settings", "//ash/constants", "//base", @@ -185,7 +186,6 @@ "//chromeos/dbus/update_engine", "//chromeos/dbus/upstart", "//chromeos/dbus/userdataauth:userdataauth_proto", - "//chromeos/login/auth", "//chromeos/login/login_state", "//chromeos/network", "//chromeos/printing",
diff --git a/chrome/browser/ash/crosapi/arc_ash.cc b/chrome/browser/ash/crosapi/arc_ash.cc index d9afdb0a..d3b630aa 100644 --- a/chrome/browser/ash/crosapi/arc_ash.cc +++ b/chrome/browser/ash/crosapi/arc_ash.cc
@@ -10,7 +10,6 @@ #include "ash/components/arc/session/arc_bridge_service.h" #include "ash/components/arc/session/arc_service_manager.h" #include "base/bind.h" -#include "base/notreached.h" #include "chrome/browser/profiles/profile.h" #include "components/arc/intent_helper/arc_intent_helper_bridge.h" @@ -26,6 +25,31 @@ namespace crosapi { +namespace { + +// Retrurns IntentHelperHolder for getting mojom API. +// Return nullptr if not ready or supported. +arc::ConnectionHolder<arc::mojom::IntentHelperInstance, + arc::mojom::IntentHelperHost>* +GetIntentHelperHolder() { + auto* arc_service_manager = arc::ArcServiceManager::Get(); + if (!arc_service_manager) { + LOG(WARNING) << "ARC is not ready"; + return nullptr; + } + + auto* intent_helper_holder = + arc_service_manager->arc_bridge_service()->intent_helper(); + if (!intent_helper_holder->IsConnected()) { + LOG(WARNING) << "ARC intent helper instance is not ready."; + return nullptr; + } + + return intent_helper_holder; +} + +} // namespace + ArcAsh::ArcAsh() = default; ArcAsh::~ArcAsh() = default; @@ -72,18 +96,9 @@ std::vector<mojom::ActivityNamePtr> activities, mojom::ScaleFactor scale_factor, RequestActivityIconsCallback callback) { - auto* arc_service_manager = arc::ArcServiceManager::Get(); - if (!arc_service_manager) { - LOG(WARNING) << "ARC is not ready"; + auto* intent_helper_holder = GetIntentHelperHolder(); + if (!intent_helper_holder) return; - } - - auto* intent_helper_holder = - arc_service_manager->arc_bridge_service()->intent_helper(); - if (!intent_helper_holder->IsConnected()) { - LOG(WARNING) << "ARC intent helper instance is not ready."; - return; - } auto* instance = ARC_GET_INSTANCE_FOR_METHOD(intent_helper_holder, RequestActivityIcons); @@ -127,7 +142,49 @@ void ArcAsh::RequestUrlHandlerList(const std::string& url, RequestUrlHandlerListCallback callback) { - NOTIMPLEMENTED(); + auto* intent_helper_holder = GetIntentHelperHolder(); + if (!intent_helper_holder) + return; + + auto* instance = + ARC_GET_INSTANCE_FOR_METHOD(intent_helper_holder, RequestUrlHandlerList); + if (!instance) { + LOG(WARNING) << "RequestUrlHandlerList is not supported."; + return; + } + + instance->RequestUrlHandlerList( + url, base::BindOnce(&ArcAsh::ConvertIntentHandlerInfo, + weak_ptr_factory_.GetWeakPtr(), std::move(callback))); +} + +void ArcAsh::ConvertIntentHandlerInfo( + RequestUrlHandlerListCallback callback, + std::vector<arc::mojom::IntentHandlerInfoPtr> handlers) { + // Convert handlers to crosapi::mojom::IntentHandlerInfoPtr from + // arc::mojom::IntentHandlerInfoPtr. + std::vector<mojom::IntentHandlerInfoPtr> converted_handlers; + for (const auto& handler : handlers) { + mojom::IntentHandlerInfoPtr converted_handler(mojom::IntentHandlerInfo::New( + handler->name, handler->package_name, handler->activity_name)); + converted_handlers.push_back(std::move(converted_handler)); + } + std::move(callback).Run(std::move(converted_handlers)); +} + +void ArcAsh::HandleUrl(const std::string& url, + const std::string& package_name) { + auto* intent_helper_holder = GetIntentHelperHolder(); + if (!intent_helper_holder) + return; + + auto* instance = ARC_GET_INSTANCE_FOR_METHOD(intent_helper_holder, HandleUrl); + if (!instance) { + LOG(WARNING) << "HandleUrl is not supported."; + return; + } + + instance->HandleUrl(url, package_name); } void ArcAsh::OnIconInvalidated(const std::string& package_name) {
diff --git a/chrome/browser/ash/crosapi/arc_ash.h b/chrome/browser/ash/crosapi/arc_ash.h index db87ba4..31aceed 100644 --- a/chrome/browser/ash/crosapi/arc_ash.h +++ b/chrome/browser/ash/crosapi/arc_ash.h
@@ -40,6 +40,8 @@ RequestActivityIconsCallback callback) override; void RequestUrlHandlerList(const std::string& url, RequestUrlHandlerListCallback callback) override; + void HandleUrl(const std::string& url, + const std::string& package_name) override; // arc::ArcLacrosObserver: void OnIconInvalidated(const std::string& package_name) override; @@ -49,6 +51,10 @@ // Called when activity icons are sent. void ConvertActivityIcons(RequestActivityIconsCallback callback, std::vector<arc::mojom::ActivityIconPtr> icons); + // Called when intent handler list is sent. + void ConvertIntentHandlerInfo( + RequestUrlHandlerListCallback callback, + std::vector<arc::mojom::IntentHandlerInfoPtr> handlers); // This class supports any number of connections. mojo::ReceiverSet<mojom::Arc> receivers_;
diff --git a/chrome/browser/ash/crosapi/authentication_ash.cc b/chrome/browser/ash/crosapi/authentication_ash.cc index c293829f..c72c09b1 100644 --- a/chrome/browser/ash/crosapi/authentication_ash.cc +++ b/chrome/browser/ash/crosapi/authentication_ash.cc
@@ -6,13 +6,13 @@ #include <utility> +#include "ash/components/login/auth/extended_authenticator.h" #include "base/check.h" #include "chrome/browser/extensions/api/passwords_private/passwords_private_utils_chromeos.h" #include "chrome/browser/extensions/api/quick_unlock_private/quick_unlock_private_ash_utils.h" #include "chrome/browser/profiles/profile.h" #include "chrome/browser/profiles/profile_manager.h" #include "chrome/common/extensions/api/quick_unlock_private.h" -#include "chromeos/login/auth/extended_authenticator.h" #include "content/public/browser/browser_thread.h" #include "third_party/abseil-cpp/absl/types/optional.h"
diff --git a/chrome/browser/ash/input_method/assistive_suggester_client_filter.cc b/chrome/browser/ash/input_method/assistive_suggester_client_filter.cc index d36bc13..96817f1a 100644 --- a/chrome/browser/ash/input_method/assistive_suggester_client_filter.cc +++ b/chrome/browser/ash/input_method/assistive_suggester_client_filter.cc
@@ -36,11 +36,12 @@ "voice.google.com", }; +// TODO(b/3339115): Add web.skype.com back to the list after compatibility +// issues are solved. const char* kAllowedDomainsForMultiWordSuggester[] = { - "discord.com", "messenger.com", "web.whatsapp.com", - "web.skype.com", "duo.google.com", "hangouts.google.com", - "chat.google.com", "messages.google.com", "web.telegram.org", - "voice.google.com", + "discord.com", "messenger.com", "web.whatsapp.com", + "duo.google.com", "hangouts.google.com", "chat.google.com", + "messages.google.com", "web.telegram.org", "voice.google.com", }; const char* kTestUrls[] = {
diff --git a/chrome/browser/ash/input_method/multi_word_suggester.cc b/chrome/browser/ash/input_method/multi_word_suggester.cc index 74a3288..2073aa2 100644 --- a/chrome/browser/ash/input_method/multi_word_suggester.cc +++ b/chrome/browser/ash/input_method/multi_word_suggester.cc
@@ -311,9 +311,13 @@ ? new_confirmed_length : suggestion_->initial_confirmed_length; - if (state_ == State::kTrackingLastSuggestionShown && + // Are we still tracking the last suggestion shown to the user? + bool no_longer_tracking = + state_ == State::kTrackingLastSuggestionShown && (new_confirmed_length == 0 || - new_confirmed_length < suggestion_->initial_confirmed_length)) { + new_confirmed_length < suggestion_->initial_confirmed_length); + + if (no_longer_tracking || !surrounding_text_.cursor_at_end_of_text) { UpdateState(State::kSuggestionDismissed); ResetSuggestion(); return;
diff --git a/chrome/browser/ash/input_method/multi_word_suggester_unittest.cc b/chrome/browser/ash/input_method/multi_word_suggester_unittest.cc index f417c735..845438c 100644 --- a/chrome/browser/ash/input_method/multi_word_suggester_unittest.cc +++ b/chrome/browser/ash/input_method/multi_word_suggester_unittest.cc
@@ -531,6 +531,26 @@ EXPECT_FALSE(before_suggestion_point); } +TEST(MultiWordSuggesterTest, DismissesSuggestionAfterCursorMoveFromEndOfText) { + FakeSuggestionHandler suggestion_handler; + MultiWordSuggester suggester(&suggestion_handler); + + std::vector<TextSuggestion> suggestions = { + TextSuggestion{.mode = TextSuggestionMode::kCompletion, + .type = TextSuggestionType::kMultiWord, + .text = " for the example"}, + }; + + suggester.OnFocus(kFocusedContextId); + suggester.OnSurroundingTextChanged(u"this is some text fo", 20, 20); + suggester.OnExternalSuggestionsUpdated(suggestions); + suggester.OnSurroundingTextChanged(u"this is some text for", 21, 21); + suggester.Suggest(u"this is some text for", 21, 21); + suggester.OnSurroundingTextChanged(u"this is some text for", 15, 15); + + EXPECT_FALSE(suggester.Suggest(u"this is some text for", 15, 15)); +} + TEST(MultiWordSuggesterTest, ReturnsGenericActionIfNoSuggestionHasBeenShown) { FakeSuggestionHandler suggestion_handler; MultiWordSuggester suggester(&suggestion_handler);
diff --git a/chrome/browser/ash/login/auth/chrome_cryptohome_authenticator.h b/chrome/browser/ash/login/auth/chrome_cryptohome_authenticator.h index f668410..08641ad46 100644 --- a/chrome/browser/ash/login/auth/chrome_cryptohome_authenticator.h +++ b/chrome/browser/ash/login/auth/chrome_cryptohome_authenticator.h
@@ -5,7 +5,7 @@ #ifndef CHROME_BROWSER_ASH_LOGIN_AUTH_CHROME_CRYPTOHOME_AUTHENTICATOR_H_ #define CHROME_BROWSER_ASH_LOGIN_AUTH_CHROME_CRYPTOHOME_AUTHENTICATOR_H_ -#include "chromeos/login/auth/cryptohome_authenticator.h" +#include "ash/components/login/auth/cryptohome_authenticator.h" namespace ash {
diff --git a/chrome/browser/ash/login/auth/chrome_login_performer.h b/chrome/browser/ash/login/auth/chrome_login_performer.h index 2af4bd7b..f1a3499 100644 --- a/chrome/browser/ash/login/auth/chrome_login_performer.h +++ b/chrome/browser/ash/login/auth/chrome_login_performer.h
@@ -8,13 +8,13 @@ #include <memory> #include <string> +#include "ash/components/login/auth/auth_status_consumer.h" +#include "ash/components/login/auth/authenticator.h" +#include "ash/components/login/auth/extended_authenticator.h" +#include "ash/components/login/auth/login_performer.h" +#include "ash/components/login/auth/user_context.h" #include "base/memory/weak_ptr.h" #include "chrome/browser/ash/policy/login/wildcard_login_checker.h" -#include "chromeos/login/auth/auth_status_consumer.h" -#include "chromeos/login/auth/authenticator.h" -#include "chromeos/login/auth/extended_authenticator.h" -#include "chromeos/login/auth/login_performer.h" -#include "chromeos/login/auth/user_context.h" #include "components/user_manager/user_type.h" #include "content/public/browser/notification_observer.h" #include "content/public/browser/notification_registrar.h"
diff --git a/chrome/browser/ash/login/auth/chrome_safe_mode_delegate.h b/chrome/browser/ash/login/auth/chrome_safe_mode_delegate.h index 88fbb15..6e53534f 100644 --- a/chrome/browser/ash/login/auth/chrome_safe_mode_delegate.h +++ b/chrome/browser/ash/login/auth/chrome_safe_mode_delegate.h
@@ -5,7 +5,7 @@ #ifndef CHROME_BROWSER_ASH_LOGIN_AUTH_CHROME_SAFE_MODE_DELEGATE_H_ #define CHROME_BROWSER_ASH_LOGIN_AUTH_CHROME_SAFE_MODE_DELEGATE_H_ -#include "chromeos/login/auth/safe_mode_delegate.h" +#include "ash/components/login/auth/safe_mode_delegate.h" namespace ash {
diff --git a/chrome/browser/ash/login/auth/cryptohome_authenticator_unittest.cc b/chrome/browser/ash/login/auth/cryptohome_authenticator_unittest.cc index a73e9262..ca6fce9 100644 --- a/chrome/browser/ash/login/auth/cryptohome_authenticator_unittest.cc +++ b/chrome/browser/ash/login/auth/cryptohome_authenticator_unittest.cc
@@ -9,6 +9,11 @@ #include <utility> #include <vector> +#include "ash/components/login/auth/cryptohome_key_constants.h" +#include "ash/components/login/auth/key.h" +#include "ash/components/login/auth/mock_auth_status_consumer.h" +#include "ash/components/login/auth/test_attempt_state.h" +#include "ash/components/login/auth/user_context.h" #include "ash/constants/ash_switches.h" #include "base/bind.h" #include "base/command_line.h" @@ -36,11 +41,6 @@ #include "chromeos/dbus/cryptohome/rpc.pb.h" #include "chromeos/dbus/userdataauth/fake_cryptohome_misc_client.h" #include "chromeos/dbus/userdataauth/fake_userdataauth_client.h" -#include "chromeos/login/auth/cryptohome_key_constants.h" -#include "chromeos/login/auth/key.h" -#include "chromeos/login/auth/mock_auth_status_consumer.h" -#include "chromeos/login/auth/test_attempt_state.h" -#include "chromeos/login/auth/user_context.h" #include "chromeos/login/login_state/login_state.h" #include "components/ownership/mock_owner_key_util.h" #include "components/user_manager/scoped_user_manager.h"
diff --git a/chrome/browser/ash/login/challenge_response_auth_keys_loader.cc b/chrome/browser/ash/login/challenge_response_auth_keys_loader.cc index df1463e8..9515f6d 100644 --- a/chrome/browser/ash/login/challenge_response_auth_keys_loader.cc +++ b/chrome/browser/ash/login/challenge_response_auth_keys_loader.cc
@@ -9,6 +9,8 @@ #include <utility> #include <vector> +#include "ash/components/login/auth/challenge_response/cert_utils.h" +#include "ash/components/login/auth/challenge_response/known_user_pref_utils.h" #include "base/bind.h" #include "base/callback.h" #include "base/containers/flat_set.h" @@ -22,8 +24,6 @@ #include "chrome/browser/ash/certificate_provider/certificate_provider_service_factory.h" #include "chrome/browser/ash/profiles/profile_helper.h" #include "chrome/browser/profiles/profile.h" -#include "chromeos/login/auth/challenge_response/cert_utils.h" -#include "chromeos/login/auth/challenge_response/known_user_pref_utils.h" #include "components/account_id/account_id.h" #include "components/prefs/pref_service.h" #include "components/user_manager/known_user.h"
diff --git a/chrome/browser/ash/login/challenge_response_auth_keys_loader.h b/chrome/browser/ash/login/challenge_response_auth_keys_loader.h index 1231fc6..6fa2d8d8 100644 --- a/chrome/browser/ash/login/challenge_response_auth_keys_loader.h +++ b/chrome/browser/ash/login/challenge_response_auth_keys_loader.h
@@ -8,11 +8,11 @@ #include <string> #include <vector> +#include "ash/components/login/auth/challenge_response_key.h" #include "base/memory/weak_ptr.h" #include "base/scoped_observation.h" #include "chrome/browser/profiles/profile.h" #include "chrome/browser/profiles/profile_observer.h" -#include "chromeos/login/auth/challenge_response_key.h" #include "net/ssl/client_cert_identity.h" class AccountId;
diff --git a/chrome/browser/ash/login/challenge_response_auth_keys_loader_browsertest.cc b/chrome/browser/ash/login/challenge_response_auth_keys_loader_browsertest.cc index ec4efc3..adea739 100644 --- a/chrome/browser/ash/login/challenge_response_auth_keys_loader_browsertest.cc +++ b/chrome/browser/ash/login/challenge_response_auth_keys_loader_browsertest.cc
@@ -6,6 +6,8 @@ #include <vector> +#include "ash/components/login/auth/challenge_response/known_user_pref_utils.h" +#include "ash/components/login/auth/challenge_response_key.h" #include "base/callback_helpers.h" #include "base/run_loop.h" #include "base/scoped_observation.h" @@ -16,8 +18,6 @@ #include "chrome/browser/ash/profiles/profile_helper.h" #include "chrome/browser/policy/extension_force_install_mixin.h" #include "chrome/browser/profiles/profile.h" -#include "chromeos/login/auth/challenge_response/known_user_pref_utils.h" -#include "chromeos/login/auth/challenge_response_key.h" #include "components/account_id/account_id.h" #include "components/user_manager/known_user.h" #include "content/public/test/browser_test.h"
diff --git a/chrome/browser/ash/login/crash_restore_browsertest.cc b/chrome/browser/ash/login/crash_restore_browsertest.cc index 95bd54d9..e61d459 100644 --- a/chrome/browser/ash/login/crash_restore_browsertest.cc +++ b/chrome/browser/ash/login/crash_restore_browsertest.cc
@@ -6,6 +6,7 @@ #include <utility> #include <vector> +#include "ash/components/login/auth/user_context.h" #include "ash/constants/ash_switches.h" #include "base/command_line.h" #include "base/files/file_path.h" @@ -32,7 +33,6 @@ #include "chromeos/dbus/session_manager/fake_session_manager_client.h" #include "chromeos/dbus/session_manager/session_manager_client.h" #include "chromeos/dbus/userdataauth/userdataauth_client.h" -#include "chromeos/login/auth/user_context.h" #include "components/account_id/account_id.h" #include "components/session_manager/core/session_manager.h" #include "components/user_manager/user.h"
diff --git a/chrome/browser/ash/login/device_family_link_allowed_policy_browsertest.cc b/chrome/browser/ash/login/device_family_link_allowed_policy_browsertest.cc index c4c8836..c668df69 100644 --- a/chrome/browser/ash/login/device_family_link_allowed_policy_browsertest.cc +++ b/chrome/browser/ash/login/device_family_link_allowed_policy_browsertest.cc
@@ -4,6 +4,8 @@ #include <memory> +#include "ash/components/login/auth/stub_authenticator_builder.h" +#include "ash/components/login/auth/user_context.h" #include "ash/components/settings/cros_settings_names.h" #include "ash/constants/ash_features.h" #include "ash/public/cpp/login_screen_test_api.h" @@ -18,8 +20,6 @@ #include "chrome/browser/ash/policy/core/device_policy_cros_browser_test.h" #include "chrome/browser/chrome_notification_types.h" #include "chrome/browser/lifetime/application_lifetime.h" -#include "chromeos/login/auth/stub_authenticator_builder.h" -#include "chromeos/login/auth/user_context.h" #include "components/account_id/account_id.h" #include "components/policy/proto/chrome_device_policy.pb.h" #include "components/user_manager/user_manager.h"
diff --git a/chrome/browser/ash/login/easy_unlock/easy_unlock_create_keys_operation.cc b/chrome/browser/ash/login/easy_unlock/easy_unlock_create_keys_operation.cc index 0fb92dc..f47fd60 100644 --- a/chrome/browser/ash/login/easy_unlock/easy_unlock_create_keys_operation.cc +++ b/chrome/browser/ash/login/easy_unlock/easy_unlock_create_keys_operation.cc
@@ -9,6 +9,7 @@ #include <memory> #include <string> +#include "ash/components/login/auth/key.h" #include "base/base64url.h" #include "base/bind.h" #include "base/logging.h" @@ -22,7 +23,6 @@ #include "chromeos/dbus/dbus_thread_manager.h" #include "chromeos/dbus/easy_unlock/easy_unlock_client.h" #include "chromeos/dbus/userdataauth/userdataauth_client.h" -#include "chromeos/login/auth/key.h" #include "crypto/encryptor.h" #include "crypto/random.h" #include "crypto/symmetric_key.h"
diff --git a/chrome/browser/ash/login/easy_unlock/easy_unlock_create_keys_operation.h b/chrome/browser/ash/login/easy_unlock/easy_unlock_create_keys_operation.h index e291d747..bbcc3a0 100644 --- a/chrome/browser/ash/login/easy_unlock/easy_unlock_create_keys_operation.h +++ b/chrome/browser/ash/login/easy_unlock/easy_unlock_create_keys_operation.h
@@ -10,11 +10,11 @@ #include <memory> #include <string> +#include "ash/components/login/auth/user_context.h" #include "base/callback.h" #include "base/memory/weak_ptr.h" #include "chrome/browser/ash/login/easy_unlock/easy_unlock_types.h" #include "chromeos/dbus/cryptohome/UserDataAuth.pb.h" -#include "chromeos/login/auth/user_context.h" #include "third_party/abseil-cpp/absl/types/optional.h" #include "third_party/cros_system_api/dbus/service_constants.h"
diff --git a/chrome/browser/ash/login/easy_unlock/easy_unlock_get_keys_operation.h b/chrome/browser/ash/login/easy_unlock/easy_unlock_get_keys_operation.h index 27b8a13..9e996f98 100644 --- a/chrome/browser/ash/login/easy_unlock/easy_unlock_get_keys_operation.h +++ b/chrome/browser/ash/login/easy_unlock/easy_unlock_get_keys_operation.h
@@ -7,12 +7,12 @@ #include <stddef.h> +#include "ash/components/login/auth/user_context.h" #include "base/callback.h" #include "base/memory/weak_ptr.h" #include "chrome/browser/ash/login/easy_unlock/easy_unlock_types.h" #include "chromeos/dbus/cryptohome/UserDataAuth.pb.h" #include "chromeos/dbus/cryptohome/rpc.pb.h" -#include "chromeos/login/auth/user_context.h" #include "third_party/abseil-cpp/absl/types/optional.h" #include "third_party/cros_system_api/dbus/service_constants.h"
diff --git a/chrome/browser/ash/login/easy_unlock/easy_unlock_key_manager.h b/chrome/browser/ash/login/easy_unlock/easy_unlock_key_manager.h index 0a83b21c..baf93cf 100644 --- a/chrome/browser/ash/login/easy_unlock/easy_unlock_key_manager.h +++ b/chrome/browser/ash/login/easy_unlock/easy_unlock_key_manager.h
@@ -11,14 +11,14 @@ #include <memory> #include <string> +// TODO(https://crbug.com/1164001): move to forward declaration +#include "ash/components/login/auth/user_context.h" #include "base/callback.h" #include "base/containers/circular_deque.h" #include "base/memory/weak_ptr.h" #include "chrome/browser/ash/login/easy_unlock/easy_unlock_get_keys_operation.h" #include "chrome/browser/ash/login/easy_unlock/easy_unlock_refresh_keys_operation.h" #include "chrome/browser/ash/login/easy_unlock/easy_unlock_types.h" -// TODO(https://crbug.com/1164001): move to forward declaration -#include "chromeos/login/auth/user_context.h" class AccountId;
diff --git a/chrome/browser/ash/login/easy_unlock/easy_unlock_refresh_keys_operation.h b/chrome/browser/ash/login/easy_unlock/easy_unlock_refresh_keys_operation.h index fe12f27..7b612d6 100644 --- a/chrome/browser/ash/login/easy_unlock/easy_unlock_refresh_keys_operation.h +++ b/chrome/browser/ash/login/easy_unlock/easy_unlock_refresh_keys_operation.h
@@ -7,10 +7,10 @@ #include <string> +#include "ash/components/login/auth/user_context.h" #include "base/callback.h" #include "base/memory/weak_ptr.h" #include "chrome/browser/ash/login/easy_unlock/easy_unlock_types.h" -#include "chromeos/login/auth/user_context.h" namespace ash { class EasyUnlockCreateKeysOperation;
diff --git a/chrome/browser/ash/login/easy_unlock/easy_unlock_remove_keys_operation.h b/chrome/browser/ash/login/easy_unlock/easy_unlock_remove_keys_operation.h index df04215ac..df5df42 100644 --- a/chrome/browser/ash/login/easy_unlock/easy_unlock_remove_keys_operation.h +++ b/chrome/browser/ash/login/easy_unlock/easy_unlock_remove_keys_operation.h
@@ -7,10 +7,10 @@ #include <stddef.h> +#include "ash/components/login/auth/user_context.h" #include "base/callback.h" #include "base/memory/weak_ptr.h" #include "chromeos/dbus/cryptohome/UserDataAuth.pb.h" -#include "chromeos/login/auth/user_context.h" #include "third_party/abseil-cpp/absl/types/optional.h" #include "third_party/cros_system_api/dbus/service_constants.h"
diff --git a/chrome/browser/ash/login/easy_unlock/easy_unlock_service.cc b/chrome/browser/ash/login/easy_unlock/easy_unlock_service.cc index b08655b..5c33631 100644 --- a/chrome/browser/ash/login/easy_unlock/easy_unlock_service.cc +++ b/chrome/browser/ash/login/easy_unlock/easy_unlock_service.cc
@@ -7,6 +7,7 @@ #include <memory> #include <utility> +#include "ash/components/login/auth/user_context.h" #include "ash/components/proximity_auth/proximity_auth_local_state_pref_manager.h" #include "ash/components/proximity_auth/proximity_auth_profile_pref_manager.h" #include "ash/components/proximity_auth/proximity_auth_system.h" @@ -41,7 +42,6 @@ #include "chromeos/components/multidevice/logging/logging.h" #include "chromeos/dbus/dbus_thread_manager.h" #include "chromeos/dbus/power/power_manager_client.h" -#include "chromeos/login/auth/user_context.h" #include "components/account_id/account_id.h" #include "components/pref_registry/pref_registry_syncable.h" #include "components/prefs/pref_registry_simple.h"
diff --git a/chrome/browser/ash/login/easy_unlock/easy_unlock_service_signin.cc b/chrome/browser/ash/login/easy_unlock/easy_unlock_service_signin.cc index 621d74a..48773a7 100644 --- a/chrome/browser/ash/login/easy_unlock/easy_unlock_service_signin.cc +++ b/chrome/browser/ash/login/easy_unlock/easy_unlock_service_signin.cc
@@ -8,6 +8,7 @@ #include <memory> +#include "ash/components/login/auth/user_context.h" #include "ash/components/proximity_auth/proximity_auth_local_state_pref_manager.h" #include "ash/components/proximity_auth/smart_lock_metrics_recorder.h" #include "ash/public/cpp/smartlock_state.h" @@ -34,7 +35,6 @@ #include "chromeos/components/multidevice/remote_device_cache.h" #include "chromeos/components/multidevice/remote_device_ref.h" #include "chromeos/components/multidevice/software_feature_state.h" -#include "chromeos/login/auth/user_context.h" #include "chromeos/login/login_state/login_state.h" #include "chromeos/tpm/tpm_token_loader.h"
diff --git a/chrome/browser/ash/login/easy_unlock/easy_unlock_user_login_flow.h b/chrome/browser/ash/login/easy_unlock/easy_unlock_user_login_flow.h index c09981acf..440041f 100644 --- a/chrome/browser/ash/login/easy_unlock/easy_unlock_user_login_flow.h +++ b/chrome/browser/ash/login/easy_unlock/easy_unlock_user_login_flow.h
@@ -5,9 +5,9 @@ #ifndef CHROME_BROWSER_ASH_LOGIN_EASY_UNLOCK_EASY_UNLOCK_USER_LOGIN_FLOW_H_ #define CHROME_BROWSER_ASH_LOGIN_EASY_UNLOCK_EASY_UNLOCK_USER_LOGIN_FLOW_H_ -#include "chrome/browser/ash/login/user_flow.h" // TODO(https://crbug.com/1164001): move to forward declaration -#include "chromeos/login/auth/user_context.h" +#include "ash/components/login/auth/user_context.h" +#include "chrome/browser/ash/login/user_flow.h" class AccountId;
diff --git a/chrome/browser/ash/login/encryption_migration_browsertest.cc b/chrome/browser/ash/login/encryption_migration_browsertest.cc index 8f5ed5e..ca27fcd 100644 --- a/chrome/browser/ash/login/encryption_migration_browsertest.cc +++ b/chrome/browser/ash/login/encryption_migration_browsertest.cc
@@ -4,6 +4,8 @@ #include <string> +#include "ash/components/login/auth/stub_authenticator_builder.h" +#include "ash/components/login/auth/user_context.h" #include "ash/constants/ash_switches.h" #include "ash/public/cpp/login_screen_test_api.h" #include "base/command_line.h" @@ -26,8 +28,6 @@ #include "chromeos/dbus/power/fake_power_manager_client.h" #include "chromeos/dbus/session_manager/fake_session_manager_client.h" #include "chromeos/dbus/userdataauth/fake_userdataauth_client.h" -#include "chromeos/login/auth/stub_authenticator_builder.h" -#include "chromeos/login/auth/user_context.h" #include "components/account_id/account_id.h" #include "components/user_manager/known_user.h" #include "content/public/test/browser_test.h"
diff --git a/chrome/browser/ash/login/enterprise_user_session_metrics.cc b/chrome/browser/ash/login/enterprise_user_session_metrics.cc index f6935c41..4a7df02d 100644 --- a/chrome/browser/ash/login/enterprise_user_session_metrics.cc +++ b/chrome/browser/ash/login/enterprise_user_session_metrics.cc
@@ -6,6 +6,7 @@ #include <algorithm> +#include "ash/components/login/auth/user_context.h" #include "base/check.h" #include "base/metrics/histogram_functions.h" #include "base/metrics/histogram_macros.h" @@ -15,7 +16,6 @@ #include "chrome/browser/browser_process.h" #include "chrome/browser/browser_process_platform_part.h" #include "chrome/common/pref_names.h" -#include "chromeos/login/auth/user_context.h" #include "components/prefs/pref_registry_simple.h" #include "components/prefs/pref_service.h"
diff --git a/chrome/browser/ash/login/enterprise_user_session_metrics.h b/chrome/browser/ash/login/enterprise_user_session_metrics.h index afdd3f9..11aa14e 100644 --- a/chrome/browser/ash/login/enterprise_user_session_metrics.h +++ b/chrome/browser/ash/login/enterprise_user_session_metrics.h
@@ -5,10 +5,10 @@ #ifndef CHROME_BROWSER_ASH_LOGIN_ENTERPRISE_USER_SESSION_METRICS_H_ #define CHROME_BROWSER_ASH_LOGIN_ENTERPRISE_USER_SESSION_METRICS_H_ +// TODO(https://crbug.com/1164001): move to forward declaration.h +#include "ash/components/login/auth/user_context.h" #include "base/time/time.h" #include "components/user_manager/user_type.h" -// TODO(https://crbug.com/1164001): move to forward declaration.h -#include "chromeos/login/auth/user_context.h" class PrefRegistrySimple;
diff --git a/chrome/browser/ash/login/enterprise_user_session_metrics_unittest.cc b/chrome/browser/ash/login/enterprise_user_session_metrics_unittest.cc index 73b0991..1be564c 100644 --- a/chrome/browser/ash/login/enterprise_user_session_metrics_unittest.cc +++ b/chrome/browser/ash/login/enterprise_user_session_metrics_unittest.cc
@@ -6,12 +6,12 @@ #include <memory> +#include "ash/components/login/auth/user_context.h" #include "base/test/metrics/histogram_tester.h" #include "base/time/time.h" #include "chrome/browser/ash/login/demo_mode/demo_session.h" #include "chrome/test/base/scoped_testing_local_state.h" #include "chrome/test/base/testing_browser_process.h" -#include "chromeos/login/auth/user_context.h" #include "chromeos/tpm/stub_install_attributes.h" #include "components/account_id/account_id.h" #include "content/public/test/browser_task_environment.h"
diff --git a/chrome/browser/ash/login/existing_user_controller.cc b/chrome/browser/ash/login/existing_user_controller.cc index d25ba5d..2fff492 100644 --- a/chrome/browser/ash/login/existing_user_controller.cc +++ b/chrome/browser/ash/login/existing_user_controller.cc
@@ -10,6 +10,7 @@ #include "ash/components/arc/arc_util.h" #include "ash/components/arc/enterprise/arc_data_snapshotd_manager.h" +#include "ash/components/login/auth/key.h" #include "ash/components/login/session/session_termination_manager.h" #include "ash/components/settings/cros_settings_names.h" #include "ash/constants/ash_pref_names.h" @@ -95,7 +96,6 @@ #include "chromeos/dbus/power/power_manager_client.h" #include "chromeos/dbus/session_manager/session_manager_client.h" #include "chromeos/dbus/userdataauth/userdataauth_client.h" -#include "chromeos/login/auth/key.h" #include "chromeos/strings/grit/chromeos_strings.h" #include "components/account_id/account_id.h" #include "components/google/core/common/google_util.h"
diff --git a/chrome/browser/ash/login/existing_user_controller.h b/chrome/browser/ash/login/existing_user_controller.h index 46cb2ad5..410a27fd 100644 --- a/chrome/browser/ash/login/existing_user_controller.h +++ b/chrome/browser/ash/login/existing_user_controller.h
@@ -10,6 +10,8 @@ #include <memory> #include <string> +#include "ash/components/login/auth/login_performer.h" +#include "ash/components/login/auth/user_context.h" #include "base/callback_forward.h" #include "base/gtest_prod_util.h" #include "base/memory/weak_ptr.h" @@ -22,8 +24,6 @@ #include "chrome/browser/ash/login/session/user_session_manager.h" #include "chrome/browser/ash/login/ui/login_display.h" #include "chrome/browser/ash/settings/device_settings_service.h" -#include "chromeos/login/auth/login_performer.h" -#include "chromeos/login/auth/user_context.h" #include "components/account_id/account_id.h" #include "components/user_manager/user.h" #include "components/user_manager/user_manager.h"
diff --git a/chrome/browser/ash/login/existing_user_controller_browsertest.cc b/chrome/browser/ash/login/existing_user_controller_browsertest.cc index 3118517d..fd8c9e8 100644 --- a/chrome/browser/ash/login/existing_user_controller_browsertest.cc +++ b/chrome/browser/ash/login/existing_user_controller_browsertest.cc
@@ -7,6 +7,9 @@ #include "ash/components/arc/enterprise/arc_data_snapshotd_manager.h" #include "ash/components/arc/test/arc_util_test_support.h" +#include "ash/components/login/auth/key.h" +#include "ash/components/login/auth/stub_authenticator_builder.h" +#include "ash/components/login/auth/user_context.h" #include "ash/components/settings/cros_settings_names.h" #include "ash/components/settings/cros_settings_provider.h" #include "ash/constants/ash_switches.h" @@ -67,9 +70,6 @@ #include "chromeos/dbus/power/fake_power_manager_client.h" #include "chromeos/dbus/session_manager/fake_session_manager_client.h" #include "chromeos/dbus/userdataauth/fake_userdataauth_client.h" -#include "chromeos/login/auth/key.h" -#include "chromeos/login/auth/stub_authenticator_builder.h" -#include "chromeos/login/auth/user_context.h" #include "chromeos/network/network_state_test_helper.h" #include "chromeos/strings/grit/chromeos_strings.h" #include "components/account_id/account_id.h"
diff --git a/chrome/browser/ash/login/helper.cc b/chrome/browser/ash/login/helper.cc index 22d0186..11dbdc3 100644 --- a/chrome/browser/ash/login/helper.cc +++ b/chrome/browser/ash/login/helper.cc
@@ -6,6 +6,7 @@ #include <memory> +#include "ash/components/login/auth/user_context.h" #include "base/bind.h" #include "base/command_line.h" #include "base/json/json_reader.h" @@ -20,7 +21,6 @@ #include "chrome/browser/password_manager/password_reuse_manager_factory.h" #include "chrome/browser/profiles/profile.h" #include "chrome/grit/generated_resources.h" -#include "chromeos/login/auth/user_context.h" #include "chromeos/network/managed_network_configuration_handler.h" #include "chromeos/network/network_connection_handler.h" #include "chromeos/network/network_handler.h"
diff --git a/chrome/browser/ash/login/lock/screen_locker.cc b/chrome/browser/ash/login/lock/screen_locker.cc index de26604..e581a15 100644 --- a/chrome/browser/ash/login/lock/screen_locker.cc +++ b/chrome/browser/ash/login/lock/screen_locker.cc
@@ -7,6 +7,8 @@ #include <algorithm> #include "ash/components/audio/sounds.h" +#include "ash/components/login/auth/authenticator.h" +#include "ash/components/login/auth/extended_authenticator.h" #include "ash/components/login/session/session_termination_manager.h" #include "ash/constants/ash_pref_names.h" #include "ash/public/cpp/login_screen.h" @@ -54,8 +56,6 @@ #include "chrome/grit/generated_resources.h" #include "chromeos/dbus/biod/constants.pb.h" #include "chromeos/dbus/session_manager/session_manager_client.h" -#include "chromeos/login/auth/authenticator.h" -#include "chromeos/login/auth/extended_authenticator.h" #include "components/password_manager/core/browser/hash_password_manager.h" #include "components/prefs/pref_change_registrar.h" #include "components/session_manager/core/session_manager.h"
diff --git a/chrome/browser/ash/login/lock/screen_locker.h b/chrome/browser/ash/login/lock/screen_locker.h index 6ff1853..23e03f18 100644 --- a/chrome/browser/ash/login/lock/screen_locker.h +++ b/chrome/browser/ash/login/lock/screen_locker.h
@@ -10,6 +10,13 @@ #include <string> #include <vector> +#include "ash/components/login/auth/auth_status_consumer.h" +// TODO(https://crbug.com/1164001): move to forward declaration. +#include "ash/components/login/auth/authenticator.h" +#include "ash/components/login/auth/challenge_response_key.h" +// TODO(https://crbug.com/1164001): move to forward declaration. +#include "ash/components/login/auth/extended_authenticator.h" +#include "ash/components/login/auth/user_context.h" #include "ash/public/cpp/login_types.h" #include "base/callback_forward.h" #include "base/memory/ref_counted.h" @@ -21,13 +28,6 @@ #include "chrome/browser/ash/login/help_app_launcher.h" #include "chrome/browser/ash/login/security_token_pin_dialog_host_login_impl.h" #include "chrome/browser/ash/login/ui/login_display.h" -#include "chromeos/login/auth/auth_status_consumer.h" -// TODO(https://crbug.com/1164001): move to forward declaration. -#include "chromeos/login/auth/authenticator.h" -#include "chromeos/login/auth/challenge_response_key.h" -// TODO(https://crbug.com/1164001): move to forward declaration. -#include "chromeos/login/auth/extended_authenticator.h" -#include "chromeos/login/auth/user_context.h" #include "components/user_manager/user.h" #include "components/user_manager/user_manager.h" #include "mojo/public/cpp/bindings/receiver.h"
diff --git a/chrome/browser/ash/login/lock/screen_locker_tester.cc b/chrome/browser/ash/login/lock/screen_locker_tester.cc index 50c6397..ae6abb6 100644 --- a/chrome/browser/ash/login/lock/screen_locker_tester.cc +++ b/chrome/browser/ash/login/lock/screen_locker_tester.cc
@@ -7,17 +7,17 @@ #include <cstdint> #include <string> +#include "ash/components/login/auth/auth_status_consumer.h" +#include "ash/components/login/auth/fake_extended_authenticator.h" +#include "ash/components/login/auth/key.h" +#include "ash/components/login/auth/stub_authenticator.h" +#include "ash/components/login/auth/user_context.h" #include "ash/public/cpp/login_screen_test_api.h" #include "base/run_loop.h" #include "base/scoped_observation.h" #include "base/strings/utf_string_conversions.h" #include "chrome/browser/ash/login/lock/screen_locker.h" #include "chrome/browser/chrome_notification_types.h" -#include "chromeos/login/auth/auth_status_consumer.h" -#include "chromeos/login/auth/fake_extended_authenticator.h" -#include "chromeos/login/auth/key.h" -#include "chromeos/login/auth/stub_authenticator.h" -#include "chromeos/login/auth/user_context.h" #include "components/session_manager/session_manager_types.h" #include "content/public/browser/notification_service.h" #include "content/public/browser/render_frame_host.h"
diff --git a/chrome/browser/ash/login/login_client_cert_usage_observer.cc b/chrome/browser/ash/login/login_client_cert_usage_observer.cc index 957a62b..0de8860 100644 --- a/chrome/browser/ash/login/login_client_cert_usage_observer.cc +++ b/chrome/browser/ash/login/login_client_cert_usage_observer.cc
@@ -7,13 +7,13 @@ #include <cstdint> #include <string> +#include "ash/components/login/auth/challenge_response/cert_utils.h" #include "base/logging.h" #include "base/strings/string_piece.h" #include "chrome/browser/ash/certificate_provider/certificate_provider_service.h" #include "chrome/browser/ash/certificate_provider/certificate_provider_service_factory.h" #include "chrome/browser/ash/profiles/profile_helper.h" #include "chrome/browser/profiles/profile.h" -#include "chromeos/login/auth/challenge_response/cert_utils.h" #include "net/cert/asn1_util.h" #include "net/cert/x509_util.h" #include "third_party/abseil-cpp/absl/types/optional.h"
diff --git a/chrome/browser/ash/login/login_client_cert_usage_observer.h b/chrome/browser/ash/login/login_client_cert_usage_observer.h index 2f256e5..d3aa679 100644 --- a/chrome/browser/ash/login/login_client_cert_usage_observer.h +++ b/chrome/browser/ash/login/login_client_cert_usage_observer.h
@@ -8,9 +8,9 @@ #include <string> #include <vector> +#include "ash/components/login/auth/challenge_response_key.h" #include "base/memory/ref_counted.h" #include "chrome/browser/ash/certificate_provider/certificate_provider_service.h" -#include "chromeos/login/auth/challenge_response_key.h" #include "net/cert/x509_certificate.h" namespace ash {
diff --git a/chrome/browser/ash/login/login_manager_test.cc b/chrome/browser/ash/login/login_manager_test.cc index 8319a6f..b2ef8043 100644 --- a/chrome/browser/ash/login/login_manager_test.cc +++ b/chrome/browser/ash/login/login_manager_test.cc
@@ -6,6 +6,8 @@ #include <string> +#include "ash/components/login/auth/key.h" +#include "ash/components/login/auth/user_context.h" #include "ash/constants/ash_switches.h" #include "ash/metrics/login_unlock_throughput_recorder.h" #include "ash/shell.h" @@ -20,8 +22,6 @@ #include "chrome/browser/ash/login/test/profile_prepared_waiter.h" #include "chrome/browser/ash/login/ui/login_display_host_webui.h" #include "chrome/browser/browser_process.h" -#include "chromeos/login/auth/key.h" -#include "chromeos/login/auth/user_context.h" #include "components/account_id/account_id.h" #include "components/prefs/scoped_user_pref_update.h" #include "components/user_manager/known_user.h"
diff --git a/chrome/browser/ash/login/login_manager_test.h b/chrome/browser/ash/login/login_manager_test.h index f88de0e..8c7c08a 100644 --- a/chrome/browser/ash/login/login_manager_test.h +++ b/chrome/browser/ash/login/login_manager_test.h
@@ -7,10 +7,10 @@ #include <string> +// TODO(https://crbug.com/1164001): move to forward declaration. +#include "ash/components/login/auth/user_context.h" #include "chrome/browser/ash/login/test/embedded_test_server_setup_mixin.h" #include "chrome/test/base/mixin_based_in_process_browser_test.h" -// TODO(https://crbug.com/1164001): move to forward declaration. -#include "chromeos/login/auth/user_context.h" class AccountId;
diff --git a/chrome/browser/ash/login/login_ui_keyboard_browsertest.cc b/chrome/browser/ash/login/login_ui_keyboard_browsertest.cc index 188ebde..ac52e211 100644 --- a/chrome/browser/ash/login/login_ui_keyboard_browsertest.cc +++ b/chrome/browser/ash/login/login_ui_keyboard_browsertest.cc
@@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include "ash/components/login/auth/user_context.h" #include "ash/constants/ash_features.h" #include "ash/public/cpp/login_screen_test_api.h" #include "base/command_line.h" @@ -32,7 +33,6 @@ #include "chrome/browser/ui/ash/login_screen_shown_observer.h" #include "chrome/browser/ui/webui/chromeos/login/user_creation_screen_handler.h" #include "chrome/common/pref_names.h" -#include "chromeos/login/auth/user_context.h" #include "components/prefs/pref_service.h" #include "components/user_manager/known_user.h" #include "content/public/test/browser_test.h"
diff --git a/chrome/browser/ash/login/oobe_browsertest.cc b/chrome/browser/ash/login/oobe_browsertest.cc index 576dc2d49..1329f38 100644 --- a/chrome/browser/ash/login/oobe_browsertest.cc +++ b/chrome/browser/ash/login/oobe_browsertest.cc
@@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include "ash/components/login/auth/cryptohome_key_constants.h" #include "ash/constants/ash_switches.h" #include "ash/display/window_tree_host_manager.h" #include "ash/public/cpp/test/shell_test_api.h" @@ -33,7 +34,6 @@ #include "chromeos/dbus/cryptohome/key.pb.h" #include "chromeos/dbus/cryptohome/rpc.pb.h" #include "chromeos/dbus/userdataauth/fake_userdataauth_client.h" -#include "chromeos/login/auth/cryptohome_key_constants.h" #include "components/account_id/account_id.h" #include "components/user_manager/known_user.h" #include "components/user_manager/user.h"
diff --git a/chrome/browser/ash/login/password_change_browsertest.cc b/chrome/browser/ash/login/password_change_browsertest.cc index 7213849..b089c1a23 100644 --- a/chrome/browser/ash/login/password_change_browsertest.cc +++ b/chrome/browser/ash/login/password_change_browsertest.cc
@@ -6,6 +6,9 @@ #include <string> #include <utility> +#include "ash/components/login/auth/stub_authenticator.h" +#include "ash/components/login/auth/stub_authenticator_builder.h" +#include "ash/components/login/auth/user_context.h" #include "ash/public/cpp/login_screen_test_api.h" #include "base/auto_reset.h" #include "base/bind.h" @@ -35,9 +38,6 @@ #include "chrome/browser/ui/webui/chromeos/login/gaia_password_changed_screen_handler.h" #include "chrome/browser/ui/webui/chromeos/login/gaia_screen_handler.h" #include "chrome/test/base/interactive_test_utils.h" -#include "chromeos/login/auth/stub_authenticator.h" -#include "chromeos/login/auth/stub_authenticator_builder.h" -#include "chromeos/login/auth/user_context.h" #include "components/account_id/account_id.h" #include "components/user_manager/known_user.h" #include "components/user_manager/user_manager.h"
diff --git a/chrome/browser/ash/login/quick_unlock/auth_token.cc b/chrome/browser/ash/login/quick_unlock/auth_token.cc index 6e2b9805c..43379b8 100644 --- a/chrome/browser/ash/login/quick_unlock/auth_token.cc +++ b/chrome/browser/ash/login/quick_unlock/auth_token.cc
@@ -4,10 +4,10 @@ #include "chrome/browser/ash/login/quick_unlock/auth_token.h" +#include "ash/components/login/auth/user_context.h" #include "base/bind.h" #include "base/task/single_thread_task_runner.h" #include "base/threading/thread_task_runner_handle.h" -#include "chromeos/login/auth/user_context.h" namespace ash { namespace quick_unlock {
diff --git a/chrome/browser/ash/login/quick_unlock/pin_backend.h b/chrome/browser/ash/login/quick_unlock/pin_backend.h index 6342344..770127c 100644 --- a/chrome/browser/ash/login/quick_unlock/pin_backend.h +++ b/chrome/browser/ash/login/quick_unlock/pin_backend.h
@@ -7,8 +7,8 @@ #include <string> +#include "ash/components/login/auth/key.h" #include "base/callback.h" -#include "chromeos/login/auth/key.h" #include "components/prefs/pref_service.h" class AccountId;
diff --git a/chrome/browser/ash/login/quick_unlock/pin_storage_cryptohome.cc b/chrome/browser/ash/login/quick_unlock/pin_storage_cryptohome.cc index bab2448..4a63422c 100644 --- a/chrome/browser/ash/login/quick_unlock/pin_storage_cryptohome.cc +++ b/chrome/browser/ash/login/quick_unlock/pin_storage_cryptohome.cc
@@ -4,6 +4,8 @@ #include "chrome/browser/ash/login/quick_unlock/pin_storage_cryptohome.h" +#include "ash/components/login/auth/cryptohome_key_constants.h" +#include "ash/components/login/auth/user_context.h" #include "ash/constants/ash_pref_names.h" #include "base/bind.h" #include "base/logging.h" @@ -15,8 +17,6 @@ #include "chromeos/cryptohome/userdataauth_util.h" #include "chromeos/dbus/dbus_thread_manager.h" #include "chromeos/dbus/userdataauth/userdataauth_client.h" -#include "chromeos/login/auth/cryptohome_key_constants.h" -#include "chromeos/login/auth/user_context.h" #include "components/account_id/account_id.h" #include "components/user_manager/known_user.h"
diff --git a/chrome/browser/ash/login/quick_unlock/pin_storage_cryptohome.h b/chrome/browser/ash/login/quick_unlock/pin_storage_cryptohome.h index 88e4b31..74e6576cf 100644 --- a/chrome/browser/ash/login/quick_unlock/pin_storage_cryptohome.h +++ b/chrome/browser/ash/login/quick_unlock/pin_storage_cryptohome.h
@@ -7,10 +7,10 @@ #include <string> +// TODO(https://crbug.com/1164001): move to forward declaration +#include "ash/components/login/auth/user_context.h" #include "base/callback.h" #include "base/memory/weak_ptr.h" -// TODO(https://crbug.com/1164001): move to forward declaration -#include "chromeos/login/auth/user_context.h" #include "third_party/abseil-cpp/absl/types/optional.h" class AccountId;
diff --git a/chrome/browser/ash/login/quick_unlock/pin_storage_cryptohome_unittest.cc b/chrome/browser/ash/login/quick_unlock/pin_storage_cryptohome_unittest.cc index c3d30365..068589c6 100644 --- a/chrome/browser/ash/login/quick_unlock/pin_storage_cryptohome_unittest.cc +++ b/chrome/browser/ash/login/quick_unlock/pin_storage_cryptohome_unittest.cc
@@ -6,6 +6,7 @@ #include <vector> +#include "ash/components/login/auth/cryptohome_key_constants.h" #include "base/bind.h" #include "base/logging.h" #include "base/run_loop.h" @@ -17,7 +18,6 @@ #include "chromeos/dbus/cryptohome/rpc.pb.h" #include "chromeos/dbus/userdataauth/fake_cryptohome_misc_client.h" #include "chromeos/dbus/userdataauth/fake_userdataauth_client.h" -#include "chromeos/login/auth/cryptohome_key_constants.h" #include "content/public/test/browser_task_environment.h" #include "testing/gtest/include/gtest/gtest.h"
diff --git a/chrome/browser/ash/login/quick_unlock/pin_storage_prefs.h b/chrome/browser/ash/login/quick_unlock/pin_storage_prefs.h index bd88f71c..0b6dd60 100644 --- a/chrome/browser/ash/login/quick_unlock/pin_storage_prefs.h +++ b/chrome/browser/ash/login/quick_unlock/pin_storage_prefs.h
@@ -7,8 +7,8 @@ #include <string> +#include "ash/components/login/auth/key.h" #include "base/gtest_prod_util.h" -#include "chromeos/login/auth/key.h" class PrefRegistrySimple; class PrefService;
diff --git a/chrome/browser/ash/login/quick_unlock/quick_unlock_storage.h b/chrome/browser/ash/login/quick_unlock/quick_unlock_storage.h index 420ae82..7bf69db 100644 --- a/chrome/browser/ash/login/quick_unlock/quick_unlock_storage.h +++ b/chrome/browser/ash/login/quick_unlock/quick_unlock_storage.h
@@ -5,9 +5,9 @@ #ifndef CHROME_BROWSER_ASH_LOGIN_QUICK_UNLOCK_QUICK_UNLOCK_STORAGE_H_ #define CHROME_BROWSER_ASH_LOGIN_QUICK_UNLOCK_QUICK_UNLOCK_STORAGE_H_ +#include "ash/components/login/auth/user_context.h" #include "base/time/default_clock.h" #include "base/time/time.h" -#include "chromeos/login/auth/user_context.h" #include "components/keyed_service/core/keyed_service.h" class Profile;
diff --git a/chrome/browser/ash/login/quick_unlock/quick_unlock_storage_unittest.cc b/chrome/browser/ash/login/quick_unlock/quick_unlock_storage_unittest.cc index 8f00eef..c9226ab 100644 --- a/chrome/browser/ash/login/quick_unlock/quick_unlock_storage_unittest.cc +++ b/chrome/browser/ash/login/quick_unlock/quick_unlock_storage_unittest.cc
@@ -6,6 +6,7 @@ #include <memory> +#include "ash/components/login/auth/user_context.h" #include "ash/constants/ash_pref_names.h" #include "base/time/time.h" #include "chrome/browser/ash/login/quick_unlock/auth_token.h" @@ -14,7 +15,6 @@ #include "chrome/browser/ash/login/quick_unlock/quick_unlock_factory.h" #include "chrome/browser/ash/login/quick_unlock/quick_unlock_utils.h" #include "chrome/test/base/testing_profile.h" -#include "chromeos/login/auth/user_context.h" #include "components/prefs/pref_service.h" #include "content/public/test/browser_task_environment.h" #include "testing/gtest/include/gtest/gtest.h"
diff --git a/chrome/browser/ash/login/reporting/login_logout_reporter.h b/chrome/browser/ash/login/reporting/login_logout_reporter.h index 2a8db2a..32a3cdc9 100644 --- a/chrome/browser/ash/login/reporting/login_logout_reporter.h +++ b/chrome/browser/ash/login/reporting/login_logout_reporter.h
@@ -5,12 +5,12 @@ #ifndef CHROME_BROWSER_ASH_LOGIN_REPORTING_LOGIN_LOGOUT_REPORTER_H_ #define CHROME_BROWSER_ASH_LOGIN_REPORTING_LOGIN_LOGOUT_REPORTER_H_ +#include "ash/components/login/auth/auth_status_consumer.h" #include "base/containers/queue.h" #include "base/scoped_observation.h" #include "chrome/browser/ash/policy/status_collector/managed_session_service.h" #include "chrome/browser/policy/messaging_layer/proto/synced/login_logout_event.pb.h" #include "chrome/browser/profiles/profile.h" -#include "chromeos/login/auth/auth_status_consumer.h" #include "components/policy/core/common/cloud/dm_token.h" #include "components/reporting/client/report_queue_provider.h"
diff --git a/chrome/browser/ash/login/saml/in_session_password_change_manager.cc b/chrome/browser/ash/login/saml/in_session_password_change_manager.cc index 3ab97b4..8856e64 100644 --- a/chrome/browser/ash/login/saml/in_session_password_change_manager.cc +++ b/chrome/browser/ash/login/saml/in_session_password_change_manager.cc
@@ -4,6 +4,7 @@ #include "chrome/browser/ash/login/saml/in_session_password_change_manager.h" +#include "ash/components/login/auth/user_context.h" #include "ash/constants/ash_features.h" #include "ash/public/cpp/session/session_activation_observer.h" #include "ash/public/cpp/session/session_controller.h" @@ -21,7 +22,6 @@ #include "chrome/browser/profiles/profile.h" #include "chrome/browser/ui/webui/chromeos/in_session_password_change/password_change_dialogs.h" #include "chrome/common/chrome_features.h" -#include "chromeos/login/auth/user_context.h" #include "components/prefs/pref_service.h" #include "components/user_manager/known_user.h" #include "components/user_manager/user_manager.h"
diff --git a/chrome/browser/ash/login/saml/in_session_password_change_manager.h b/chrome/browser/ash/login/saml/in_session_password_change_manager.h index 44bc26f..e66c3a94 100644 --- a/chrome/browser/ash/login/saml/in_session_password_change_manager.h +++ b/chrome/browser/ash/login/saml/in_session_password_change_manager.h
@@ -8,16 +8,16 @@ #include <memory> #include <string> +#include "ash/components/login/auth/auth_status_consumer.h" +// TODO(https://crbug.com/1164001): move to forward declaration. +#include "ash/components/login/auth/cryptohome_authenticator.h" +// TODO(https://crbug.com/1164001): move to forward declaration. +#include "ash/components/login/auth/user_context.h" #include "ash/public/cpp/session/session_activation_observer.h" #include "base/memory/scoped_refptr.h" #include "base/observer_list.h" #include "base/time/time.h" #include "chrome/browser/ash/login/saml/password_sync_token_fetcher.h" -#include "chromeos/login/auth/auth_status_consumer.h" -// TODO(https://crbug.com/1164001): move to forward declaration. -#include "chromeos/login/auth/cryptohome_authenticator.h" -// TODO(https://crbug.com/1164001): move to forward declaration. -#include "chromeos/login/auth/user_context.h" class Profile;
diff --git a/chrome/browser/ash/login/saml/in_session_password_change_manager_unittest.cc b/chrome/browser/ash/login/saml/in_session_password_change_manager_unittest.cc index 3cc66df8..0bb5853 100644 --- a/chrome/browser/ash/login/saml/in_session_password_change_manager_unittest.cc +++ b/chrome/browser/ash/login/saml/in_session_password_change_manager_unittest.cc
@@ -4,6 +4,7 @@ #include "chrome/browser/ash/login/saml/in_session_password_change_manager.h" +#include "ash/components/login/auth/saml_password_attributes.h" #include "ash/public/cpp/session/session_activation_observer.h" #include "ash/public/cpp/session/session_controller.h" #include "base/strings/utf_string_conversions.h" @@ -17,7 +18,6 @@ #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/login/auth/saml_password_attributes.h" #include "components/user_manager/scoped_user_manager.h" #include "components/user_manager/user_names.h" #include "content/public/test/browser_task_environment.h"
diff --git a/chrome/browser/ash/login/saml/in_session_password_sync_manager.cc b/chrome/browser/ash/login/saml/in_session_password_sync_manager.cc index 6a2cb02..2d3ad137 100644 --- a/chrome/browser/ash/login/saml/in_session_password_sync_manager.cc +++ b/chrome/browser/ash/login/saml/in_session_password_sync_manager.cc
@@ -6,6 +6,8 @@ #include <utility> +#include "ash/components/login/auth/extended_authenticator.h" +#include "ash/components/login/auth/user_context.h" #include "ash/components/proximity_auth/screenlock_bridge.h" #include "ash/constants/ash_switches.h" #include "base/command_line.h" @@ -19,8 +21,6 @@ #include "chrome/browser/ash/login/saml/password_sync_token_fetcher.h" #include "chrome/browser/ash/profiles/profile_helper.h" #include "chrome/browser/ash/settings/cros_settings.h" -#include "chromeos/login/auth/extended_authenticator.h" -#include "chromeos/login/auth/user_context.h" #include "components/prefs/pref_service.h" #include "components/session_manager/core/session_manager.h" #include "components/session_manager/core/session_manager_observer.h"
diff --git a/chrome/browser/ash/login/saml/in_session_password_sync_manager.h b/chrome/browser/ash/login/saml/in_session_password_sync_manager.h index c0cd50a..1fa3d80 100644 --- a/chrome/browser/ash/login/saml/in_session_password_sync_manager.h +++ b/chrome/browser/ash/login/saml/in_session_password_sync_manager.h
@@ -8,18 +8,18 @@ #include <memory> #include <string> +#include "ash/components/login/auth/auth_status_consumer.h" +// TODO(https://crbug.com/1164001): move to forward declaration. +#include "ash/components/login/auth/cryptohome_authenticator.h" +// TODO(https://crbug.com/1164001): move to forward declaration. +#include "ash/components/login/auth/extended_authenticator.h" +#include "ash/components/login/auth/user_context.h" #include "ash/components/proximity_auth/screenlock_bridge.h" +#include "base/callback_forward.h" #include "base/time/clock.h" #include "chrome/browser/ash/login/saml/password_sync_token_fetcher.h" #include "chrome/browser/profiles/profile.h" #include "chrome/browser/ui/webui/chromeos/in_session_password_change/lock_screen_reauth_dialogs.h" -#include "chromeos/login/auth/auth_status_consumer.h" -// TODO(https://crbug.com/1164001): move to forward declaration. -#include "chromeos/login/auth/cryptohome_authenticator.h" -// TODO(https://crbug.com/1164001): move to forward declaration. -#include "base/callback_forward.h" -#include "chromeos/login/auth/extended_authenticator.h" -#include "chromeos/login/auth/user_context.h" #include "components/account_id/account_id.h" #include "components/keyed_service/core/keyed_service.h" #include "components/prefs/pref_change_registrar.h"
diff --git a/chrome/browser/ash/login/saml/in_session_password_sync_manager_unittest.cc b/chrome/browser/ash/login/saml/in_session_password_sync_manager_unittest.cc index 4672625..c3d7268 100644 --- a/chrome/browser/ash/login/saml/in_session_password_sync_manager_unittest.cc +++ b/chrome/browser/ash/login/saml/in_session_password_sync_manager_unittest.cc
@@ -4,6 +4,7 @@ #include "chrome/browser/ash/login/saml/in_session_password_sync_manager.h" +#include "ash/components/login/auth/user_context.h" #include "ash/constants/ash_features.h" #include "base/test/scoped_feature_list.h" #include "base/time/default_clock.h" @@ -15,7 +16,6 @@ #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/login/auth/user_context.h" #include "components/user_manager/known_user.h" #include "components/user_manager/scoped_user_manager.h" #include "components/user_manager/user_names.h"
diff --git a/chrome/browser/ash/login/saml/password_expiry_notification.cc b/chrome/browser/ash/login/saml/password_expiry_notification.cc index 57eed67..a1b997ef 100644 --- a/chrome/browser/ash/login/saml/password_expiry_notification.cc +++ b/chrome/browser/ash/login/saml/password_expiry_notification.cc
@@ -8,6 +8,7 @@ #include <string> #include <vector> +#include "ash/components/login/auth/saml_password_attributes.h" #include "ash/public/cpp/notification_utils.h" #include "ash/public/cpp/session/session_activation_observer.h" #include "ash/public/cpp/session/session_controller.h" @@ -26,7 +27,6 @@ #include "chrome/browser/profiles/profile_manager.h" #include "chrome/browser/ui/webui/chromeos/in_session_password_change/password_change_ui.h" #include "chrome/common/pref_names.h" -#include "chromeos/login/auth/saml_password_attributes.h" #include "chromeos/strings/grit/chromeos_strings.h" #include "components/prefs/pref_service.h" #include "components/vector_icons/vector_icons.h"
diff --git a/chrome/browser/ash/login/saml/password_expiry_notification_unittest.cc b/chrome/browser/ash/login/saml/password_expiry_notification_unittest.cc index e64bced..3f20e75 100644 --- a/chrome/browser/ash/login/saml/password_expiry_notification_unittest.cc +++ b/chrome/browser/ash/login/saml/password_expiry_notification_unittest.cc
@@ -4,6 +4,7 @@ #include "chrome/browser/ash/login/saml/password_expiry_notification.h" +#include "ash/components/login/auth/saml_password_attributes.h" #include "ash/public/cpp/session/session_activation_observer.h" #include "ash/public/cpp/session/session_controller.h" #include "base/strings/utf_string_conversions.h" @@ -17,7 +18,6 @@ #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/login/auth/saml_password_attributes.h" #include "components/user_manager/scoped_user_manager.h" #include "components/user_manager/user_names.h" #include "content/public/test/browser_task_environment.h"
diff --git a/chrome/browser/ash/login/saml/password_sync_token_verifier_unittest.cc b/chrome/browser/ash/login/saml/password_sync_token_verifier_unittest.cc index 4292183..4e978ce 100644 --- a/chrome/browser/ash/login/saml/password_sync_token_verifier_unittest.cc +++ b/chrome/browser/ash/login/saml/password_sync_token_verifier_unittest.cc
@@ -4,6 +4,7 @@ #include "chrome/browser/ash/login/saml/password_sync_token_verifier.h" +#include "ash/components/login/auth/user_context.h" #include "base/test/metrics/histogram_tester.h" #include "base/time/default_clock.h" #include "chrome/browser/ash/login/login_pref_names.h" @@ -13,7 +14,6 @@ #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/login/auth/user_context.h" #include "components/user_manager/known_user.h" #include "components/user_manager/scoped_user_manager.h" #include "components/user_manager/user_names.h"
diff --git a/chrome/browser/ash/login/saml/saml_browsertest.cc b/chrome/browser/ash/login/saml/saml_browsertest.cc index 6148980..c714403c 100644 --- a/chrome/browser/ash/login/saml/saml_browsertest.cc +++ b/chrome/browser/ash/login/saml/saml_browsertest.cc
@@ -8,6 +8,8 @@ #include <utility> #include "ash/components/attestation/mock_attestation_flow.h" +#include "ash/components/login/auth/key.h" +#include "ash/components/login/auth/saml_password_attributes.h" #include "ash/components/settings/cros_settings_names.h" #include "ash/constants/ash_features.h" #include "ash/constants/ash_switches.h" @@ -77,8 +79,6 @@ #include "chromeos/dbus/shill/shill_manager_client.h" #include "chromeos/dbus/userdataauth/fake_cryptohome_misc_client.h" #include "chromeos/dbus/userdataauth/fake_userdataauth_client.h" -#include "chromeos/login/auth/key.h" -#include "chromeos/login/auth/saml_password_attributes.h" #include "chromeos/tpm/stub_install_attributes.h" #include "components/account_id/account_id.h" #include "components/content_settings/core/browser/host_content_settings_map.h"
diff --git a/chrome/browser/ash/login/saml/saml_profile_prefs.cc b/chrome/browser/ash/login/saml/saml_profile_prefs.cc index 51d887b..796aceb4 100644 --- a/chrome/browser/ash/login/saml/saml_profile_prefs.cc +++ b/chrome/browser/ash/login/saml/saml_profile_prefs.cc
@@ -4,9 +4,9 @@ #include "chrome/browser/ash/login/saml/saml_profile_prefs.h" +#include "ash/components/login/auth/saml_password_attributes.h" #include "chrome/browser/ash/login/login_constants.h" #include "chrome/browser/ash/login/login_pref_names.h" -#include "chromeos/login/auth/saml_password_attributes.h" #include "components/prefs/pref_registry_simple.h" namespace ash {
diff --git a/chrome/browser/ash/login/screens/active_directory_login_screen.cc b/chrome/browser/ash/login/screens/active_directory_login_screen.cc index 9ced5b0..2acc851 100644 --- a/chrome/browser/ash/login/screens/active_directory_login_screen.cc +++ b/chrome/browser/ash/login/screens/active_directory_login_screen.cc
@@ -4,6 +4,8 @@ #include "chrome/browser/ash/login/screens/active_directory_login_screen.h" +#include "ash/components/login/auth/cryptohome_key_constants.h" +#include "ash/components/login/auth/key.h" #include "chrome/browser/ash/login/screens/signin_fatal_error_screen.h" #include "chrome/browser/ash/login/ui/login_display_host.h" #include "chrome/browser/ash/login/ui/signin_ui.h" @@ -12,8 +14,6 @@ #include "chrome/browser/ui/webui/chromeos/login/enrollment_screen_handler.h" #include "chrome/browser/ui/webui/chromeos/login/error_screen_handler.h" #include "chrome/grit/generated_resources.h" -#include "chromeos/login/auth/cryptohome_key_constants.h" -#include "chromeos/login/auth/key.h" #include "chromeos/network/network_state.h" #include "chromeos/network/network_state_handler.h" #include "components/user_manager/known_user.h"
diff --git a/chrome/browser/ash/login/screens/active_directory_login_screen.h b/chrome/browser/ash/login/screens/active_directory_login_screen.h index 16c4c99..02249482 100644 --- a/chrome/browser/ash/login/screens/active_directory_login_screen.h +++ b/chrome/browser/ash/login/screens/active_directory_login_screen.h
@@ -8,6 +8,8 @@ #include <memory> #include <string> +// TODO(https://crbug.com/1164001): move to forward declaration. +#include "ash/components/login/auth/key.h" #include "base/callback.h" #include "base/scoped_observation.h" #include "chrome/browser/ash/authpolicy/authpolicy_helper.h" @@ -16,8 +18,6 @@ // TODO(https://crbug.com/1164001): move to forward declaration. #include "chrome/browser/ui/webui/chromeos/login/active_directory_login_screen_handler.h" #include "chrome/browser/ui/webui/chromeos/login/network_state_informer.h" -// TODO(https://crbug.com/1164001): move to forward declaration. -#include "chromeos/login/auth/key.h" namespace ash {
diff --git a/chrome/browser/ash/login/screens/active_directory_password_change_screen.cc b/chrome/browser/ash/login/screens/active_directory_password_change_screen.cc index 36db75a..16d4fe26 100644 --- a/chrome/browser/ash/login/screens/active_directory_password_change_screen.cc +++ b/chrome/browser/ash/login/screens/active_directory_password_change_screen.cc
@@ -6,13 +6,13 @@ #include <memory> +#include "ash/components/login/auth/cryptohome_key_constants.h" +#include "ash/components/login/auth/key.h" #include "base/bind.h" #include "chrome/browser/ash/login/ui/login_display_host.h" #include "chrome/browser/ui/webui/chromeos/login/active_directory_password_change_screen_handler.h" #include "chrome/browser/ui/webui/chromeos/login/signin_screen_handler.h" #include "chrome/grit/generated_resources.h" -#include "chromeos/login/auth/cryptohome_key_constants.h" -#include "chromeos/login/auth/key.h" #include "components/user_manager/known_user.h" #include "ui/base/l10n/l10n_util.h"
diff --git a/chrome/browser/ash/login/screens/active_directory_password_change_screen.h b/chrome/browser/ash/login/screens/active_directory_password_change_screen.h index e147a5a0..7ff1170 100644 --- a/chrome/browser/ash/login/screens/active_directory_password_change_screen.h +++ b/chrome/browser/ash/login/screens/active_directory_password_change_screen.h
@@ -8,13 +8,13 @@ #include <memory> #include <string> +// TODO(https://crbug.com/1164001): move to forward declaration. +#include "ash/components/login/auth/key.h" #include "chrome/browser/ash/authpolicy/authpolicy_helper.h" #include "chrome/browser/ash/login/screen_manager.h" #include "chrome/browser/ash/login/screens/base_screen.h" // TODO(https://crbug.com/1164001): move to forward declaration. #include "chrome/browser/ui/webui/chromeos/login/active_directory_password_change_screen_handler.h" -// TODO(https://crbug.com/1164001): move to forward declaration. -#include "chromeos/login/auth/key.h" namespace authpolicy { class ActiveDirectoryAccountInfo;
diff --git a/chrome/browser/ash/login/screens/encryption_migration_screen.h b/chrome/browser/ash/login/screens/encryption_migration_screen.h index d7b12de..7f101936 100644 --- a/chrome/browser/ash/login/screens/encryption_migration_screen.h +++ b/chrome/browser/ash/login/screens/encryption_migration_screen.h
@@ -8,6 +8,7 @@ #include <memory> #include <string> +#include "ash/components/login/auth/user_context.h" #include "base/callback_forward.h" #include "base/scoped_observation.h" #include "chrome/browser/ash/login/screens/base_screen.h" @@ -20,7 +21,6 @@ #include "chromeos/dbus/cryptohome/rpc.pb.h" #include "chromeos/dbus/power/power_manager_client.h" #include "chromeos/dbus/userdataauth/userdataauth_client.h" -#include "chromeos/login/auth/user_context.h" #include "mojo/public/cpp/bindings/remote.h" #include "services/device/public/mojom/wake_lock.mojom.h" #include "third_party/cros_system_api/dbus/cryptohome/dbus-constants.h"
diff --git a/chrome/browser/ash/login/screens/encryption_migration_screen_unittest.cc b/chrome/browser/ash/login/screens/encryption_migration_screen_unittest.cc index d84f752..614b47d 100644 --- a/chrome/browser/ash/login/screens/encryption_migration_screen_unittest.cc +++ b/chrome/browser/ash/login/screens/encryption_migration_screen_unittest.cc
@@ -5,6 +5,8 @@ #include <memory> #include <utility> +#include "ash/components/login/auth/key.h" +#include "ash/components/login/auth/user_context.h" #include "base/bind.h" #include "base/memory/ptr_util.h" #include "base/test/task_environment.h" @@ -18,8 +20,6 @@ #include "chromeos/dbus/power/fake_power_manager_client.h" #include "chromeos/dbus/power/power_policy_controller.h" #include "chromeos/dbus/userdataauth/fake_userdataauth_client.h" -#include "chromeos/login/auth/key.h" -#include "chromeos/login/auth/user_context.h" #include "components/account_id/account_id.h" #include "components/user_manager/scoped_user_manager.h" #include "components/user_manager/user_names.h"
diff --git a/chrome/browser/ash/login/screens/error_screen.h b/chrome/browser/ash/login/screens/error_screen.h index 696a9220..36d0c30 100644 --- a/chrome/browser/ash/login/screens/error_screen.h +++ b/chrome/browser/ash/login/screens/error_screen.h
@@ -7,6 +7,7 @@ #include <memory> +#include "ash/components/login/auth/login_performer.h" #include "base/callback_list.h" #include "base/memory/weak_ptr.h" #include "chrome/browser/ash/login/screens/base_screen.h" @@ -17,7 +18,6 @@ // 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/login/auth/login_performer.h" #include "chromeos/network/network_connection_observer.h" #include "components/web_modal/web_contents_modal_dialog_manager_delegate.h"
diff --git a/chrome/browser/ash/login/screens/family_link_notice_browsertest.cc b/chrome/browser/ash/login/screens/family_link_notice_browsertest.cc index fa1d47ef..2fdc2fb 100644 --- a/chrome/browser/ash/login/screens/family_link_notice_browsertest.cc +++ b/chrome/browser/ash/login/screens/family_link_notice_browsertest.cc
@@ -3,6 +3,7 @@ // found in the LICENSE file. #include "chrome/browser/ash/login/screens/family_link_notice_screen.h" +#include "ash/components/login/auth/stub_authenticator_builder.h" #include "ash/constants/ash_features.h" #include "chrome/browser/ash/login/oobe_screen.h" #include "chrome/browser/ash/login/test/fake_gaia_mixin.h" @@ -19,7 +20,6 @@ #include "chrome/browser/ui/webui/chromeos/login/family_link_notice_screen_handler.h" #include "chrome/browser/ui/webui/chromeos/login/user_creation_screen_handler.h" #include "chrome/common/pref_names.h" -#include "chromeos/login/auth/stub_authenticator_builder.h" #include "components/prefs/pref_service.h" #include "content/public/test/browser_test.h"
diff --git a/chrome/browser/ash/login/screens/offline_login_screen.cc b/chrome/browser/ash/login/screens/offline_login_screen.cc index cd9cf72..12570951 100644 --- a/chrome/browser/ash/login/screens/offline_login_screen.cc +++ b/chrome/browser/ash/login/screens/offline_login_screen.cc
@@ -4,6 +4,8 @@ #include "chrome/browser/ash/login/screens/offline_login_screen.h" +#include "ash/components/login/auth/key.h" +#include "ash/components/login/auth/user_context.h" #include "base/bind.h" #include "base/metrics/histogram_functions.h" #include "base/time/default_clock.h" @@ -21,8 +23,6 @@ #include "chrome/browser/ui/webui/chromeos/login/offline_login_screen_handler.h" #include "chrome/grit/chromium_strings.h" #include "chrome/grit/generated_resources.h" -#include "chromeos/login/auth/key.h" -#include "chromeos/login/auth/user_context.h" #include "components/user_manager/known_user.h" #include "google_apis/gaia/gaia_auth_util.h"
diff --git a/chrome/browser/ash/login/screens/pin_setup_screen.cc b/chrome/browser/ash/login/screens/pin_setup_screen.cc index cb5bf83..b55155e6 100644 --- a/chrome/browser/ash/login/screens/pin_setup_screen.cc +++ b/chrome/browser/ash/login/screens/pin_setup_screen.cc
@@ -6,6 +6,8 @@ #include <memory> +#include "ash/components/login/auth/cryptohome_key_constants.h" +#include "ash/components/login/auth/user_context.h" #include "ash/constants/ash_features.h" #include "ash/constants/ash_switches.h" #include "ash/public/cpp/tablet_mode.h" @@ -22,8 +24,6 @@ #include "chrome/browser/policy/profile_policy_connector.h" #include "chrome/browser/profiles/profile_manager.h" #include "chrome/browser/ui/webui/chromeos/login/pin_setup_screen_handler.h" -#include "chromeos/login/auth/cryptohome_key_constants.h" -#include "chromeos/login/auth/user_context.h" #include "components/prefs/pref_service.h" #include "components/user_manager/user_manager.h"
diff --git a/chrome/browser/ash/login/screens/pin_setup_screen_browsertest.cc b/chrome/browser/ash/login/screens/pin_setup_screen_browsertest.cc index 6c7db81..50452880 100644 --- a/chrome/browser/ash/login/screens/pin_setup_screen_browsertest.cc +++ b/chrome/browser/ash/login/screens/pin_setup_screen_browsertest.cc
@@ -4,6 +4,7 @@ #include "chrome/browser/ash/login/screens/pin_setup_screen.h" +#include "ash/components/login/auth/stub_authenticator_builder.h" #include "ash/constants/ash_features.h" #include "ash/public/cpp/test/shell_test_api.h" #include "base/auto_reset.h" @@ -24,7 +25,6 @@ #include "chrome/browser/ash/login/wizard_controller.h" #include "chrome/browser/ui/webui/chromeos/login/pin_setup_screen_handler.h" #include "chromeos/dbus/userdataauth/fake_userdataauth_client.h" -#include "chromeos/login/auth/stub_authenticator_builder.h" #include "components/user_manager/user_type.h" #include "content/public/test/browser_test.h" #include "testing/gmock/include/gmock/gmock.h"
diff --git a/chrome/browser/ash/login/security_token_login_browsertest.cc b/chrome/browser/ash/login/security_token_login_browsertest.cc index 4a5c3fb..0c9ba72 100644 --- a/chrome/browser/ash/login/security_token_login_browsertest.cc +++ b/chrome/browser/ash/login/security_token_login_browsertest.cc
@@ -8,6 +8,8 @@ #include <utility> #include <vector> +#include "ash/components/login/auth/auth_status_consumer.h" +#include "ash/components/login/auth/challenge_response/known_user_pref_utils.h" #include "ash/constants/ash_switches.h" #include "ash/public/cpp/login_screen_test_api.h" #include "ash/public/cpp/session/session_controller.h" @@ -38,8 +40,6 @@ #include "chromeos/dbus/cryptohome/rpc.pb.h" #include "chromeos/dbus/dbus_method_call_status.h" #include "chromeos/dbus/userdataauth/fake_userdataauth_client.h" -#include "chromeos/login/auth/auth_status_consumer.h" -#include "chromeos/login/auth/challenge_response/known_user_pref_utils.h" #include "components/account_id/account_id.h" #include "components/policy/core/browser/browser_policy_connector.h" #include "components/policy/core/common/mock_configuration_policy_provider.h"
diff --git a/chrome/browser/ash/login/security_token_session_controller.cc b/chrome/browser/ash/login/security_token_session_controller.cc index 2989b7f2..3510d59 100644 --- a/chrome/browser/ash/login/security_token_session_controller.cc +++ b/chrome/browser/ash/login/security_token_session_controller.cc
@@ -7,6 +7,8 @@ #include <string> #include <vector> +#include "ash/components/login/auth/challenge_response/known_user_pref_utils.h" +#include "ash/components/login/auth/challenge_response_key.h" #include "ash/public/cpp/notification_utils.h" #include "base/bind.h" #include "base/callback_helpers.h" @@ -29,8 +31,6 @@ #include "chrome/browser/ui/ash/security_token_session_restriction_view.h" #include "chrome/common/pref_names.h" #include "chrome/grit/generated_resources.h" -#include "chromeos/login/auth/challenge_response/known_user_pref_utils.h" -#include "chromeos/login/auth/challenge_response_key.h" #include "chromeos/ui/vector_icons/vector_icons.h" #include "components/prefs/pref_change_registrar.h" #include "components/prefs/pref_registry_simple.h"
diff --git a/chrome/browser/ash/login/session/user_session_manager.cc b/chrome/browser/ash/login/session/user_session_manager.cc index de97b05..8b4bed6 100644 --- a/chrome/browser/ash/login/session/user_session_manager.cc +++ b/chrome/browser/ash/login/session/user_session_manager.cc
@@ -16,6 +16,9 @@ #include "ash/components/account_manager/account_manager_factory.h" #include "ash/components/arc/arc_prefs.h" +#include "ash/components/login/auth/auth_session_authenticator.h" +#include "ash/components/login/auth/challenge_response/known_user_pref_utils.h" +#include "ash/components/login/auth/stub_authenticator_builder.h" #include "ash/components/login/session/session_termination_manager.h" #include "ash/components/settings/cros_settings_names.h" #include "ash/constants/ash_features.h" @@ -123,9 +126,6 @@ #include "chromeos/dbus/session_manager/session_manager_client.h" #include "chromeos/dbus/tpm_manager/tpm_manager.pb.h" #include "chromeos/dbus/tpm_manager/tpm_manager_client.h" -#include "chromeos/login/auth/auth_session_authenticator.h" -#include "chromeos/login/auth/challenge_response/known_user_pref_utils.h" -#include "chromeos/login/auth/stub_authenticator_builder.h" #include "chromeos/network/portal_detector/network_portal_detector.h" #include "chromeos/network/portal_detector/network_portal_detector_strategy.h" #include "chromeos/tpm/prepare_tpm.h"
diff --git a/chrome/browser/ash/login/session/user_session_manager.h b/chrome/browser/ash/login/session/user_session_manager.h index 46089f2..c6d680e 100644 --- a/chrome/browser/ash/login/session/user_session_manager.h +++ b/chrome/browser/ash/login/session/user_session_manager.h
@@ -13,6 +13,12 @@ #include <vector> #include "ash/components/arc/net/always_on_vpn_manager.h" +// TODO(https://crbug.com/1164001): move to forward declaration. +#include "ash/components/login/auth/auth_status_consumer.h" +#include "ash/components/login/auth/authenticator.h" +// TODO(https://crbug.com/1164001): move to forward declaration. +#include "ash/components/login/auth/stub_authenticator_builder.h" +#include "ash/components/login/auth/user_context.h" #include "base/callback.h" #include "base/containers/flat_map.h" #include "base/containers/flat_set.h" @@ -41,12 +47,6 @@ #include "chrome/browser/ash/web_applications/help_app/help_app_notification_controller.h" #include "chromeos/dbus/session_manager/session_manager_client.h" #include "chromeos/dbus/tpm_manager/tpm_manager.pb.h" -// TODO(https://crbug.com/1164001): move to forward declaration. -#include "chromeos/login/auth/auth_status_consumer.h" -#include "chromeos/login/auth/authenticator.h" -// TODO(https://crbug.com/1164001): move to forward declaration. -#include "chromeos/login/auth/stub_authenticator_builder.h" -#include "chromeos/login/auth/user_context.h" #include "components/user_manager/user.h" #include "components/user_manager/user_manager.h" #include "services/network/public/cpp/network_connection_tracker.h"
diff --git a/chrome/browser/ash/login/session/user_session_manager_test.cc b/chrome/browser/ash/login/session/user_session_manager_test.cc index 3af7e20..71ed9fea 100644 --- a/chrome/browser/ash/login/session/user_session_manager_test.cc +++ b/chrome/browser/ash/login/session/user_session_manager_test.cc
@@ -4,6 +4,8 @@ #include "chrome/browser/ash/login/session/user_session_manager.h" +#include "ash/components/login/auth/key.h" +#include "ash/components/login/auth/user_context.h" #include "base/callback_helpers.h" #include "base/strings/utf_string_conversions.h" #include "chrome/browser/ash/login/demo_mode/demo_session.h" @@ -15,8 +17,6 @@ #include "chrome/test/base/testing_profile_manager.h" #include "chromeos/dbus/session_manager/fake_session_manager_client.h" #include "chromeos/dbus/session_manager/session_manager_client.h" -#include "chromeos/login/auth/key.h" -#include "chromeos/login/auth/user_context.h" #include "components/language/core/browser/pref_names.h" #include "components/sync_preferences/testing_pref_service_syncable.h" #include "components/user_manager/fake_user_manager.h"
diff --git a/chrome/browser/ash/login/session/user_session_manager_test_api.cc b/chrome/browser/ash/login/session/user_session_manager_test_api.cc index e6ef0f1..9c53928 100644 --- a/chrome/browser/ash/login/session/user_session_manager_test_api.cc +++ b/chrome/browser/ash/login/session/user_session_manager_test_api.cc
@@ -4,7 +4,7 @@ #include "chrome/browser/ash/login/session/user_session_manager_test_api.h" -#include "chromeos/login/auth/stub_authenticator_builder.h" +#include "ash/components/login/auth/stub_authenticator_builder.h" namespace ash { namespace test {
diff --git a/chrome/browser/ash/login/shill_profile_loading_browsertest.cc b/chrome/browser/ash/login/shill_profile_loading_browsertest.cc index a82145c..55eb7a9 100644 --- a/chrome/browser/ash/login/shill_profile_loading_browsertest.cc +++ b/chrome/browser/ash/login/shill_profile_loading_browsertest.cc
@@ -14,6 +14,7 @@ // This test case verifies that chrome triggers LoadShillProfile for the // unmanaged user case and the managed user with/without network policy cases. +#include "ash/components/login/auth/user_context.h" #include "ash/public/cpp/login_screen_test_api.h" #include "base/bind.h" #include "base/bind_internal.h" @@ -29,7 +30,6 @@ #include "chromeos/dbus/session_manager/fake_session_manager_client.h" #include "chromeos/dbus/session_manager/session_manager_client.h" #include "chromeos/dbus/shill/fake_shill_profile_client.h" -#include "chromeos/login/auth/user_context.h" #include "components/account_id/account_id.h" #include "components/policy/proto/chrome_settings.pb.h" #include "components/user_manager/user_names.h"
diff --git a/chrome/browser/ash/login/signin/oauth2_browsertest.cc b/chrome/browser/ash/login/signin/oauth2_browsertest.cc index 869cc53..c702fa7 100644 --- a/chrome/browser/ash/login/signin/oauth2_browsertest.cc +++ b/chrome/browser/ash/login/signin/oauth2_browsertest.cc
@@ -7,6 +7,8 @@ #include <string> #include <utility> +#include "ash/components/login/auth/key.h" +#include "ash/components/login/auth/user_context.h" #include "ash/public/cpp/login_screen_test_api.h" #include "base/bind.h" #include "base/memory/ref_counted.h" @@ -43,8 +45,6 @@ #include "chrome/common/chrome_paths.h" #include "chrome/common/chrome_switches.h" #include "chrome/test/base/ui_test_utils.h" -#include "chromeos/login/auth/key.h" -#include "chromeos/login/auth/user_context.h" #include "components/account_id/account_id.h" #include "components/javascript_dialogs/tab_modal_dialog_manager.h" #include "components/prefs/pref_service.h"
diff --git a/chrome/browser/ash/login/signin/oauth2_token_initializer.h b/chrome/browser/ash/login/signin/oauth2_token_initializer.h index 0265ec01..1671947 100644 --- a/chrome/browser/ash/login/signin/oauth2_token_initializer.h +++ b/chrome/browser/ash/login/signin/oauth2_token_initializer.h
@@ -7,9 +7,9 @@ #include <memory> +#include "ash/components/login/auth/user_context.h" #include "base/callback.h" #include "chrome/browser/ash/login/signin/oauth2_token_fetcher.h" -#include "chromeos/login/auth/user_context.h" namespace ash {
diff --git a/chrome/browser/ash/login/signin/offline_signin_limiter.h b/chrome/browser/ash/login/signin/offline_signin_limiter.h index 3eb0207..09dce0c 100644 --- a/chrome/browser/ash/login/signin/offline_signin_limiter.h +++ b/chrome/browser/ash/login/signin/offline_signin_limiter.h
@@ -7,10 +7,10 @@ #include <memory> +#include "ash/components/login/auth/user_context.h" #include "base/power_monitor/power_observer.h" #include "base/time/time.h" #include "base/timer/wall_clock_timer.h" -#include "chromeos/login/auth/user_context.h" #include "components/keyed_service/core/keyed_service.h" #include "components/prefs/pref_change_registrar.h" #include "components/session_manager/core/session_manager_observer.h"
diff --git a/chrome/browser/ash/login/test/logged_in_user_mixin.cc b/chrome/browser/ash/login/test/logged_in_user_mixin.cc index 73aa8c7f..c7eb50d 100644 --- a/chrome/browser/ash/login/test/logged_in_user_mixin.cc +++ b/chrome/browser/ash/login/test/logged_in_user_mixin.cc
@@ -6,9 +6,9 @@ #include <vector> +#include "ash/components/login/auth/stub_authenticator_builder.h" +#include "ash/components/login/auth/user_context.h" #include "chrome/browser/ash/login/wizard_controller.h" -#include "chromeos/login/auth/stub_authenticator_builder.h" -#include "chromeos/login/auth/user_context.h" #include "components/account_id/account_id.h" #include "net/dns/mock_host_resolver.h"
diff --git a/chrome/browser/ash/login/test/login_manager_mixin.cc b/chrome/browser/ash/login/test/login_manager_mixin.cc index a79991b..5fc81a52 100644 --- a/chrome/browser/ash/login/test/login_manager_mixin.cc +++ b/chrome/browser/ash/login/test/login_manager_mixin.cc
@@ -8,6 +8,10 @@ #include <string> #include <utility> +#include "ash/components/login/auth/auth_status_consumer.h" +#include "ash/components/login/auth/key.h" +#include "ash/components/login/auth/stub_authenticator_builder.h" +#include "ash/components/login/auth/user_context.h" #include "base/command_line.h" #include "base/containers/contains.h" #include "base/strings/string_util.h" @@ -23,10 +27,6 @@ #include "chrome/browser/ash/login/ui/login_display_host.h" #include "chrome/browser/browser_process.h" #include "chrome/browser/ui/webui/chromeos/login/gaia_screen_handler.h" -#include "chromeos/login/auth/auth_status_consumer.h" -#include "chromeos/login/auth/key.h" -#include "chromeos/login/auth/stub_authenticator_builder.h" -#include "chromeos/login/auth/user_context.h" #include "components/prefs/pref_service.h" #include "components/prefs/scoped_user_pref_update.h" #include "components/user_manager/known_user.h"
diff --git a/chrome/browser/ash/login/test/login_manager_mixin.h b/chrome/browser/ash/login/test/login_manager_mixin.h index c108d32..76befd9 100644 --- a/chrome/browser/ash/login/test/login_manager_mixin.h +++ b/chrome/browser/ash/login/test/login_manager_mixin.h
@@ -8,13 +8,13 @@ #include <memory> #include <vector> +// TODO(https://crbug.com/1164001): move to forward declaration. +#include "ash/components/login/auth/stub_authenticator_builder.h" +#include "ash/components/login/auth/user_context.h" #include "chrome/browser/ash/login/test/fake_gaia_mixin.h" #include "chrome/browser/ash/login/test/local_state_mixin.h" #include "chrome/browser/ash/login/test/session_flags_manager.h" #include "chrome/test/base/mixin_based_in_process_browser_test.h" -// TODO(https://crbug.com/1164001): move to forward declaration. -#include "chromeos/login/auth/stub_authenticator_builder.h" -#include "chromeos/login/auth/user_context.h" #include "components/account_id/account_id.h" #include "components/user_manager/user.h" #include "components/user_manager/user_type.h"
diff --git a/chrome/browser/ash/login/test/offline_login_test_mixin.cc b/chrome/browser/ash/login/test/offline_login_test_mixin.cc index 49d1e9a5..2244953b 100644 --- a/chrome/browser/ash/login/test/offline_login_test_mixin.cc +++ b/chrome/browser/ash/login/test/offline_login_test_mixin.cc
@@ -4,6 +4,7 @@ #include "chrome/browser/ash/login/test/offline_login_test_mixin.h" +#include "ash/components/login/auth/user_context.h" #include "ash/components/settings/cros_settings_names.h" #include "ash/components/settings/cros_settings_provider.h" #include "chrome/browser/ash/login/session/user_session_manager_test_api.h" @@ -19,7 +20,6 @@ #include "chrome/browser/browser_process.h" #include "chrome/browser/ui/webui/chromeos/login/error_screen_handler.h" #include "chrome/test/base/mixin_based_in_process_browser_test.h" -#include "chromeos/login/auth/user_context.h" #include "chromeos/network/network_state_test_helper.h" #include "content/public/test/test_utils.h"
diff --git a/chrome/browser/ash/login/test/profile_prepared_waiter.h b/chrome/browser/ash/login/test/profile_prepared_waiter.h index 7744f27b..af53f5a56 100644 --- a/chrome/browser/ash/login/test/profile_prepared_waiter.h +++ b/chrome/browser/ash/login/test/profile_prepared_waiter.h
@@ -5,8 +5,8 @@ #ifndef CHROME_BROWSER_ASH_LOGIN_TEST_PROFILE_PREPARED_WAITER_H_ #define CHROME_BROWSER_ASH_LOGIN_TEST_PROFILE_PREPARED_WAITER_H_ +#include "ash/components/login/auth/auth_status_consumer.h" #include "base/run_loop.h" -#include "chromeos/login/auth/auth_status_consumer.h" #include "components/account_id/account_id.h" namespace ash {
diff --git a/chrome/browser/ash/login/ui/login_display.h b/chrome/browser/ash/login/ui/login_display.h index f9c00f1..4a66bee6 100644 --- a/chrome/browser/ash/login/ui/login_display.h +++ b/chrome/browser/ash/login/ui/login_display.h
@@ -5,11 +5,11 @@ #ifndef CHROME_BROWSER_ASH_LOGIN_UI_LOGIN_DISPLAY_H_ #define CHROME_BROWSER_ASH_LOGIN_UI_LOGIN_DISPLAY_H_ +// TODO(https://crbug.com/1164001): move to forward declaration. +#include "ash/components/login/auth/user_context.h" #include "base/callback.h" #include "chrome/browser/ash/login/help_app_launcher.h" #include "chrome/browser/ash/login/signin_specifics.h" -// TODO(https://crbug.com/1164001): move to forward declaration. -#include "chromeos/login/auth/user_context.h" #include "components/user_manager/user.h" #include "components/user_manager/user_manager.h" #include "ui/gfx/geometry/rect.h"
diff --git a/chrome/browser/ash/login/ui/login_display_host_mojo.cc b/chrome/browser/ash/login/ui/login_display_host_mojo.cc index a30c24f..cd18a45e 100644 --- a/chrome/browser/ash/login/ui/login_display_host_mojo.cc +++ b/chrome/browser/ash/login/ui/login_display_host_mojo.cc
@@ -6,6 +6,7 @@ #include <utility> +#include "ash/components/login/auth/user_context.h" #include "ash/constants/ash_features.h" #include "ash/constants/ash_pref_names.h" #include "ash/constants/ash_switches.h" @@ -45,7 +46,6 @@ #include "chrome/browser/ui/webui/chromeos/login/signin_fatal_error_screen_handler.h" #include "chrome/browser/ui/webui/chromeos/login/user_creation_screen_handler.h" #include "chrome/common/channel_info.h" -#include "chromeos/login/auth/user_context.h" #include "components/startup_metric_utils/browser/startup_metric_utils.h" #include "components/user_manager/known_user.h" #include "components/user_manager/user.h"
diff --git a/chrome/browser/ash/login/ui/login_display_host_mojo.h b/chrome/browser/ash/login/ui/login_display_host_mojo.h index 90333667..1533a80 100644 --- a/chrome/browser/ash/login/ui/login_display_host_mojo.h +++ b/chrome/browser/ash/login/ui/login_display_host_mojo.h
@@ -9,6 +9,8 @@ #include <string> #include <vector> +#include "ash/components/login/auth/auth_status_consumer.h" +#include "ash/components/login/auth/challenge_response_key.h" #include "base/callback_forward.h" #include "base/memory/weak_ptr.h" #include "base/observer_list.h" @@ -20,8 +22,6 @@ #include "chrome/browser/ash/login/ui/oobe_ui_dialog_delegate.h" #include "chrome/browser/ui/ash/login_screen_client_impl.h" #include "chrome/browser/ui/webui/chromeos/login/oobe_ui.h" -#include "chromeos/login/auth/auth_status_consumer.h" -#include "chromeos/login/auth/challenge_response_key.h" #include "third_party/abseil-cpp/absl/types/optional.h" #include "ui/views/view.h" #include "ui/views/view_observer.h"
diff --git a/chrome/browser/ash/login/ui/signin_ui.h b/chrome/browser/ash/login/ui/signin_ui.h index 2e126b3..c733ca2 100644 --- a/chrome/browser/ash/login/ui/signin_ui.h +++ b/chrome/browser/ash/login/ui/signin_ui.h
@@ -4,10 +4,10 @@ #ifndef CHROME_BROWSER_ASH_LOGIN_UI_SIGNIN_UI_H_ #define CHROME_BROWSER_ASH_LOGIN_UI_SIGNIN_UI_H_ +#include "ash/components/login/auth/user_context.h" #include "base/callback.h" #include "chrome/browser/ash/login/oobe_screen.h" #include "chrome/browser/ash/login/screens/encryption_migration_mode.h" -#include "chromeos/login/auth/user_context.h" #include "components/account_id/account_id.h" namespace ash {
diff --git a/chrome/browser/ash/login/user_flags_login_browsertest.cc b/chrome/browser/ash/login/user_flags_login_browsertest.cc index 8599e5a..1516fdd8 100644 --- a/chrome/browser/ash/login/user_flags_login_browsertest.cc +++ b/chrome/browser/ash/login/user_flags_login_browsertest.cc
@@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include "ash/components/login/auth/user_context.h" #include "base/test/bind.h" #include "chrome/browser/about_flags.h" #include "chrome/browser/ash/login/session/user_session_manager_test_api.h" @@ -13,7 +14,6 @@ #include "chrome/test/base/mixin_based_in_process_browser_test.h" #include "chromeos/cryptohome/cryptohome_parameters.h" #include "chromeos/dbus/session_manager/fake_session_manager_client.h" -#include "chromeos/login/auth/user_context.h" #include "components/flags_ui/feature_entry_macros.h" #include "components/flags_ui/flags_state.h" #include "components/flags_ui/pref_service_flags_storage.h"
diff --git a/chrome/browser/ash/login/user_flow.h b/chrome/browser/ash/login/user_flow.h index 60dbcfe6..e14a997 100644 --- a/chrome/browser/ash/login/user_flow.h +++ b/chrome/browser/ash/login/user_flow.h
@@ -5,9 +5,9 @@ #ifndef CHROME_BROWSER_ASH_LOGIN_USER_FLOW_H_ #define CHROME_BROWSER_ASH_LOGIN_USER_FLOW_H_ -#include "chromeos/login/auth/auth_status_consumer.h" +#include "ash/components/login/auth/auth_status_consumer.h" // TODO(https://crbug.com/1164001): move to forward declaration. -#include "chromeos/login/auth/user_context.h" +#include "ash/components/login/auth/user_context.h" #include "components/account_id/account_id.h" #include "components/user_manager/user.h"
diff --git a/chrome/browser/ash/login/wizard_context.cc b/chrome/browser/ash/login/wizard_context.cc index bba478a..58c6d6a 100644 --- a/chrome/browser/ash/login/wizard_context.cc +++ b/chrome/browser/ash/login/wizard_context.cc
@@ -4,9 +4,9 @@ #include "chrome/browser/ash/login/wizard_context.h" +#include "ash/components/login/auth/user_context.h" #include "build/branding_buildflags.h" #include "chrome/browser/ui/webui/chromeos/login/family_link_notice_screen_handler.h" -#include "chromeos/login/auth/user_context.h" namespace ash {
diff --git a/chrome/browser/ash/login/wizard_context.h b/chrome/browser/ash/login/wizard_context.h index f4a79c49..06542ca 100644 --- a/chrome/browser/ash/login/wizard_context.h +++ b/chrome/browser/ash/login/wizard_context.h
@@ -7,10 +7,10 @@ #include <memory> +// TODO(https://crbug.com/1164001): move to forward declaration. +#include "ash/components/login/auth/user_context.h" #include "base/values.h" #include "chrome/browser/ash/login/oobe_screen.h" -// TODO(https://crbug.com/1164001): move to forward declaration. -#include "chromeos/login/auth/user_context.h" namespace ash {
diff --git a/chrome/browser/ash/platform_keys/key_permissions/key_permissions_manager_browsertest.cc b/chrome/browser/ash/platform_keys/key_permissions/key_permissions_manager_browsertest.cc index b2baf9c..e766d510 100644 --- a/chrome/browser/ash/platform_keys/key_permissions/key_permissions_manager_browsertest.cc +++ b/chrome/browser/ash/platform_keys/key_permissions/key_permissions_manager_browsertest.cc
@@ -10,6 +10,7 @@ #include <utility> #include <vector> +#include "ash/components/login/auth/user_context.h" #include "base/values.h" #include "chrome/browser/ash/login/test/device_state_mixin.h" #include "chrome/browser/ash/login/test/login_manager_mixin.h" @@ -26,7 +27,6 @@ #include "chrome/browser/profiles/profile_manager.h" #include "chrome/common/pref_names.h" #include "chrome/test/base/mixin_based_in_process_browser_test.h" -#include "chromeos/login/auth/user_context.h" #include "components/prefs/pref_test_utils.h" #include "components/signin/public/identity_manager/identity_test_utils.h" #include "content/public/test/browser_test.h"
diff --git a/chrome/browser/ash/platform_keys/platform_keys_service_browsertest.cc b/chrome/browser/ash/platform_keys/platform_keys_service_browsertest.cc index e6f9041..5cf231cc 100644 --- a/chrome/browser/ash/platform_keys/platform_keys_service_browsertest.cc +++ b/chrome/browser/ash/platform_keys/platform_keys_service_browsertest.cc
@@ -8,6 +8,7 @@ #include <utility> #include <vector> +#include "ash/components/login/auth/user_context.h" #include "base/bind.h" #include "base/callback.h" #include "base/command_line.h" @@ -40,7 +41,6 @@ #include "chrome/browser/ui/browser.h" #include "chrome/test/base/mixin_based_in_process_browser_test.h" #include "chrome/test/base/testing_profile.h" -#include "chromeos/login/auth/user_context.h" #include "components/policy/core/common/policy_switches.h" #include "components/signin/public/identity_manager/identity_test_utils.h" #include "content/public/browser/browser_task_traits.h"
diff --git a/chrome/browser/ash/policy/affiliation/affiliation_test_helper.cc b/chrome/browser/ash/policy/affiliation/affiliation_test_helper.cc index fb1cc7728..6f6518a1 100644 --- a/chrome/browser/ash/policy/affiliation/affiliation_test_helper.cc +++ b/chrome/browser/ash/policy/affiliation/affiliation_test_helper.cc
@@ -9,6 +9,8 @@ #include <memory> #include <string> +#include "ash/components/login/auth/key.h" +#include "ash/components/login/auth/user_context.h" #include "ash/constants/ash_switches.h" #include "base/command_line.h" #include "base/containers/contains.h" @@ -30,8 +32,6 @@ #include "chromeos/dbus/session_manager/fake_session_manager_client.h" #include "chromeos/dbus/session_manager/session_manager_client.h" #include "chromeos/dbus/userdataauth/userdataauth_client.h" -#include "chromeos/login/auth/key.h" -#include "chromeos/login/auth/user_context.h" #include "components/account_id/account_id.h" #include "components/policy/core/common/cloud/cloud_policy_core.h" #include "components/policy/core/common/cloud/cloud_policy_store.h"
diff --git a/chrome/browser/ash/policy/core/device_local_account_browsertest.cc b/chrome/browser/ash/policy/core/device_local_account_browsertest.cc index 08ecd02..40c86e2 100644 --- a/chrome/browser/ash/policy/core/device_local_account_browsertest.cc +++ b/chrome/browser/ash/policy/core/device_local_account_browsertest.cc
@@ -11,6 +11,7 @@ #include <utility> #include <vector> +#include "ash/components/login/auth/user_context.h" #include "ash/components/settings/timezone_settings.h" #include "ash/constants/ash_paths.h" #include "ash/constants/ash_switches.h" @@ -113,7 +114,6 @@ #include "chrome/grit/chromium_strings.h" #include "chrome/grit/generated_resources.h" #include "chromeos/dbus/session_manager/fake_session_manager_client.h" -#include "chromeos/login/auth/user_context.h" #include "chromeos/network/policy_certificate_provider.h" #include "components/crx_file/crx_verifier.h" #include "components/policy/core/common/cloud/cloud_policy_constants.h"
diff --git a/chrome/browser/ash/policy/login/login_policy_test_base.cc b/chrome/browser/ash/policy/login/login_policy_test_base.cc index b426f85..8b8655b 100644 --- a/chrome/browser/ash/policy/login/login_policy_test_base.cc +++ b/chrome/browser/ash/policy/login/login_policy_test_base.cc
@@ -6,6 +6,7 @@ #include <memory> +#include "ash/components/login/auth/user_context.h" #include "ash/constants/ash_switches.h" #include "base/values.h" #include "chrome/browser/ash/login/test/login_manager_mixin.h" @@ -17,7 +18,6 @@ #include "chrome/browser/ash/profiles/profile_helper.h" #include "chrome/browser/ui/webui/chromeos/login/gaia_screen_handler.h" #include "chrome/browser/ui/webui/chromeos/login/signin_screen_handler.h" -#include "chromeos/login/auth/user_context.h" #include "google_apis/gaia/fake_gaia.h" #include "testing/gtest/include/gtest/gtest.h"
diff --git a/chrome/browser/ash/policy/status_collector/managed_session_service.h b/chrome/browser/ash/policy/status_collector/managed_session_service.h index bc9c1765..a71d3d1 100644 --- a/chrome/browser/ash/policy/status_collector/managed_session_service.h +++ b/chrome/browser/ash/policy/status_collector/managed_session_service.h
@@ -5,6 +5,7 @@ #ifndef CHROME_BROWSER_ASH_POLICY_STATUS_COLLECTOR_MANAGED_SESSION_SERVICE_H_ #define CHROME_BROWSER_ASH_POLICY_STATUS_COLLECTOR_MANAGED_SESSION_SERVICE_H_ +#include "ash/components/login/auth/auth_status_consumer.h" #include "ash/components/login/session/session_termination_manager.h" #include "base/observer_list.h" #include "base/observer_list_types.h" @@ -16,7 +17,6 @@ #include "chrome/browser/profiles/profile.h" #include "chrome/browser/profiles/profile_observer.h" #include "chromeos/dbus/power/power_manager_client.h" -#include "chromeos/login/auth/auth_status_consumer.h" #include "components/account_id/account_id.h" #include "components/session_manager/core/session_manager.h" #include "components/session_manager/core/session_manager_observer.h"
diff --git a/chrome/browser/ash/remote_apps/remote_apps_manager_browsertest.cc b/chrome/browser/ash/remote_apps/remote_apps_manager_browsertest.cc index 6b60992a..0ecfac87 100644 --- a/chrome/browser/ash/remote_apps/remote_apps_manager_browsertest.cc +++ b/chrome/browser/ash/remote_apps/remote_apps_manager_browsertest.cc
@@ -7,6 +7,7 @@ #include "ash/app_list/app_list_model_provider.h" #include "ash/app_list/model/app_list_item.h" #include "ash/app_list/model/app_list_model.h" +#include "ash/components/login/auth/user_context.h" #include "ash/constants/ash_switches.h" #include "ash/public/cpp/accelerators.h" #include "ash/public/cpp/app_list/app_list_types.h" @@ -34,7 +35,6 @@ #include "chrome/browser/ui/app_list/app_list_client_impl.h" #include "chrome/browser/ui/app_list/app_list_syncable_service_factory.h" #include "chrome/browser/ui/ash/shelf/chrome_shelf_controller.h" -#include "chromeos/login/auth/user_context.h" #include "components/account_id/account_id.h" #include "components/policy/proto/chrome_device_policy.pb.h" #include "components/services/app_service/public/cpp/icon_types.h"
diff --git a/chrome/browser/ash/web_applications/personalization_app/chrome_personalization_app_ui_delegate_unittest.cc b/chrome/browser/ash/web_applications/personalization_app/chrome_personalization_app_ui_delegate_unittest.cc index a3a1d7ec..56d5652 100644 --- a/chrome/browser/ash/web_applications/personalization_app/chrome_personalization_app_ui_delegate_unittest.cc +++ b/chrome/browser/ash/web_applications/personalization_app/chrome_personalization_app_ui_delegate_unittest.cc
@@ -347,7 +347,7 @@ TEST_P(ChromePersonalizationAppUiDelegateGooglePhotosTest, FetchCount) { base::RunLoop loop; wallpaper_provider_remote()->get()->FetchGooglePhotosCount( - base::BindLambdaForTesting([&, this](int64_t count) { + base::BindLambdaForTesting([&, this](int count) { EXPECT_EQ(count, GooglePhotosEnabled() ? 0 : -1); loop.QuitClosure().Run(); }));
diff --git a/chrome/browser/chrome_content_browser_client.cc b/chrome/browser/chrome_content_browser_client.cc index 90760c852..c0d0af03 100644 --- a/chrome/browser/chrome_content_browser_client.cc +++ b/chrome/browser/chrome_content_browser_client.cc
@@ -55,6 +55,7 @@ #include "chrome/browser/federated_learning/floc_eligibility_observer.h" #include "chrome/browser/federated_learning/floc_id_provider.h" #include "chrome/browser/federated_learning/floc_id_provider_factory.h" +#include "chrome/browser/first_party_sets/first_party_sets_pref_names.h" #include "chrome/browser/font_access/chrome_font_access_delegate.h" #include "chrome/browser/font_family_cache.h" #include "chrome/browser/gpu/chrome_browser_main_extra_parts_gpu.h" @@ -285,6 +286,7 @@ #include "media/media_buildflags.h" #include "media/mojo/buildflags.h" #include "mojo/public/cpp/bindings/remote.h" +#include "net/base/features.h" #include "net/cookies/site_for_cookies.h" #include "net/ssl/client_cert_store.h" #include "net/ssl/ssl_cert_request_info.h" @@ -6377,3 +6379,24 @@ ->GetPrefs() ->GetBoolean(prefs::kOriginAgentClusterDefaultEnabled); } + +bool ChromeContentBrowserClient::IsFirstPartySetsEnabled() { + // TODO(https://crbug.com/1269360): move this logic into + // FirstPartySetsUtil::IsFirstPartySetsEnabled + if (!base::FeatureList::IsEnabled(net::features::kFirstPartySets)) { + return false; + } + + PrefService* local_state; + if (g_browser_process) { + local_state = g_browser_process->local_state(); + } else { + local_state = startup_data_.chrome_feature_list_creator()->local_state(); + } + + if (!local_state || + !local_state->HasPrefPath(first_party_sets::kFirstPartySetsEnabled)) { + return true; + } + return local_state->GetBoolean(first_party_sets::kFirstPartySetsEnabled); +}
diff --git a/chrome/browser/chrome_content_browser_client.h b/chrome/browser/chrome_content_browser_client.h index ee247be..5c543af 100644 --- a/chrome/browser/chrome_content_browser_client.h +++ b/chrome/browser/chrome_content_browser_client.h
@@ -766,6 +766,7 @@ void OnWebContentsCreated(content::WebContents* web_contents) override; bool IsFindInPageDisabledForOrigin(const url::Origin& origin) override; + bool IsFirstPartySetsEnabled() override; void FlushBackgroundAttributions(base::OnceClosure callback) override; bool ShouldPreconnectNavigation(
diff --git a/chrome/browser/chromeos/BUILD.gn b/chrome/browser/chromeos/BUILD.gn index 95265de8..8a6aaeb8 100644 --- a/chrome/browser/chromeos/BUILD.gn +++ b/chrome/browser/chromeos/BUILD.gn
@@ -94,6 +94,7 @@ "//ash/components/enhanced_network_tts/mojom", "//ash/components/fwupd", "//ash/components/geolocation", + "//ash/components/login/auth", "//ash/components/login/session", "//ash/components/peripheral_notification", "//ash/components/phonehub", @@ -296,7 +297,6 @@ "//chromeos/ime:gencode", "//chromeos/language/language_packs", "//chromeos/language/public/mojom", - "//chromeos/login/auth", "//chromeos/login/login_state", "//chromeos/memory", "//chromeos/network", @@ -334,6 +334,7 @@ "//chromeos/utils", "//components/app_restore", "//components/arc", + "//components/arc/common", "//components/autofill/core/browser", "//components/browser_sync", "//components/captive_portal/core", @@ -351,6 +352,7 @@ "//components/embedder_support:browser_util", "//components/enterprise", "//components/exo", + "//components/exo/server", "//components/favicon/core", "//components/feedback", "//components/feedback/content", @@ -1076,6 +1078,8 @@ "../ash/borealis/borealis_app_launcher.h", "../ash/borealis/borealis_app_uninstaller.cc", "../ash/borealis/borealis_app_uninstaller.h", + "../ash/borealis/borealis_capabilities.cc", + "../ash/borealis/borealis_capabilities.h", "../ash/borealis/borealis_context.cc", "../ash/borealis/borealis_context.h", "../ash/borealis/borealis_context_manager.h", @@ -1120,6 +1124,8 @@ "../ash/borealis/borealis_task.h", "../ash/borealis/borealis_util.cc", "../ash/borealis/borealis_util.h", + "../ash/borealis/borealis_wayland_interface.cc", + "../ash/borealis/borealis_wayland_interface.h", "../ash/borealis/borealis_window_manager.cc", "../ash/borealis/borealis_window_manager.h", "../ash/borealis/infra/described.h", @@ -3815,6 +3821,7 @@ "//ash/components/attestation:test_support", "//ash/components/drivefs", "//ash/components/drivefs:test_support", + "//ash/components/login/auth", "//ash/components/settings", "//ash/constants", "//ash/services/ime:test_support", @@ -3834,7 +3841,6 @@ "//chromeos/dbus/session_manager", "//chromeos/dbus/userdataauth:userdataauth", "//chromeos/dbus/userdataauth:userdataauth_proto", - "//chromeos/login/auth", "//chromeos/printing", "//chromeos/services/multidevice_setup/public/cpp:test_support", "//chromeos/system", @@ -4697,6 +4703,7 @@ "//ash/components/attestation:test_support", "//ash/components/audio", "//ash/components/disks:test_support", + "//ash/components/login/auth", "//ash/components/phonehub:test_support", "//ash/components/proximity_auth", "//ash/components/proximity_auth:test_support", @@ -4750,7 +4757,6 @@ "//chromeos/dbus/virtual_file_provider", "//chromeos/dbus/vm_plugin_dispatcher", "//chromeos/ime:gencode", - "//chromeos/login/auth", "//chromeos/login/login_state", "//chromeos/login/login_state:test_support", "//chromeos/network", @@ -4769,6 +4775,7 @@ "//chromeos/ui/frame:test_support", "//components/account_manager_core:test_support", "//components/arc", + "//components/arc/common", "//components/component_updater:test_support", "//components/content_settings/core/browser", "//components/crx_file",
diff --git a/chrome/browser/chromeos/extensions/login_screen/login/login_api.cc b/chrome/browser/chromeos/extensions/login_screen/login/login_api.cc index d940e02..d8030e1 100644 --- a/chrome/browser/chromeos/extensions/login_screen/login/login_api.cc +++ b/chrome/browser/chromeos/extensions/login_screen/login/login_api.cc
@@ -7,6 +7,8 @@ #include <memory> #include <string> +#include "ash/components/login/auth/key.h" +#include "ash/components/login/auth/user_context.h" #include "base/bind.h" #include "base/logging.h" #include "base/values.h" @@ -19,8 +21,6 @@ #include "chrome/browser/lifetime/application_lifetime.h" #include "chrome/common/extensions/api/login.h" #include "chrome/common/pref_names.h" -#include "chromeos/login/auth/key.h" -#include "chromeos/login/auth/user_context.h" #include "components/prefs/pref_service.h" #include "components/session_manager/core/session_manager.h" #include "components/user_manager/user.h"
diff --git a/chrome/browser/chromeos/extensions/login_screen/login/login_api_lock_handler.cc b/chrome/browser/chromeos/extensions/login_screen/login/login_api_lock_handler.cc index eb5db909..ed3a1328 100644 --- a/chrome/browser/chromeos/extensions/login_screen/login/login_api_lock_handler.cc +++ b/chrome/browser/chromeos/extensions/login_screen/login/login_api_lock_handler.cc
@@ -6,11 +6,11 @@ #include <utility> +#include "ash/components/login/auth/user_context.h" #include "base/bind.h" #include "base/no_destructor.h" #include "chrome/browser/ash/login/lock/screen_locker.h" #include "chrome/browser/ui/ash/session_controller_client_impl.h" -#include "chromeos/login/auth/user_context.h" namespace chromeos {
diff --git a/chrome/browser/chromeos/extensions/login_screen/login/login_api_unittest.cc b/chrome/browser/chromeos/extensions/login_screen/login/login_api_unittest.cc index ca8fbf0..964f216 100644 --- a/chrome/browser/chromeos/extensions/login_screen/login/login_api_unittest.cc +++ b/chrome/browser/chromeos/extensions/login_screen/login/login_api_unittest.cc
@@ -9,6 +9,8 @@ #include <string> #include <utility> +#include "ash/components/login/auth/key.h" +#include "ash/components/login/auth/user_context.h" #include "ash/components/settings/cros_settings_names.h" #include "base/callback.h" #include "base/callback_helpers.h" @@ -30,8 +32,6 @@ #include "chrome/common/pref_names.h" #include "chrome/test/base/testing_profile.h" #include "chrome/test/base/testing_profile_manager.h" -#include "chromeos/login/auth/key.h" -#include "chromeos/login/auth/user_context.h" #include "components/account_id/account_id.h" #include "components/prefs/pref_service.h" #include "components/session_manager/core/session_manager.h"
diff --git a/chrome/browser/chromeos/extensions/login_screen/login/shared_session_handler.cc b/chrome/browser/chromeos/extensions/login_screen/login/shared_session_handler.cc index 48c3856e..5fa4a40 100644 --- a/chrome/browser/chromeos/extensions/login_screen/login/shared_session_handler.cc +++ b/chrome/browser/chromeos/extensions/login_screen/login/shared_session_handler.cc
@@ -6,6 +6,7 @@ #include <utility> +#include "ash/components/login/auth/user_context.h" #include "ash/components/settings/cros_settings_names.h" #include "base/bind.h" #include "base/no_destructor.h" @@ -15,7 +16,6 @@ #include "chrome/browser/chromeos/extensions/login_screen/login/login_api.h" #include "chrome/browser/chromeos/extensions/login_screen/login/login_api_lock_handler.h" #include "chrome/browser/ui/ash/session_controller_client_impl.h" -#include "chromeos/login/auth/user_context.h" #include "components/session_manager/core/session_manager.h" #include "components/session_manager/session_manager_types.h" #include "components/user_manager/user.h"
diff --git a/chrome/browser/component_updater/first_party_sets_component_installer.cc b/chrome/browser/component_updater/first_party_sets_component_installer.cc index e4725ee..0f469640 100644 --- a/chrome/browser/component_updater/first_party_sets_component_installer.cc +++ b/chrome/browser/component_updater/first_party_sets_component_installer.cc
@@ -15,7 +15,10 @@ #include "base/task/post_task.h" #include "base/task/thread_pool.h" #include "base/version.h" +#include "chrome/browser/browser_process.h" +#include "chrome/browser/first_party_sets/first_party_sets_pref_names.h" #include "components/component_updater/component_updater_paths.h" +#include "components/prefs/pref_service.h" #include "content/public/browser/network_service_instance.h" #include "net/base/features.h" #include "net/cookies/cookie_util.h" @@ -50,14 +53,30 @@ return *instance; } +// Determine if First-Party Sets is enabled by checking both the feature +// and the enterprise policy. +bool IsFirstPartySetsEnabled() { + // TODO(https://crbug.com/1269360): move this logic into + // FirstPartySetsUtil + if (!base::FeatureList::IsEnabled(net::features::kFirstPartySets)) { + return false; + } + auto* local_state = g_browser_process->local_state(); + if (!local_state || + !local_state->HasPrefPath(first_party_sets::kFirstPartySetsEnabled)) { + return true; + } + return local_state->GetBoolean(first_party_sets::kFirstPartySetsEnabled); +} + // Invokes `on_sets_ready` with the contents of the component, if: // * the component has been installed; and -// * the `kFirstPartySets` feature is enabled; and +// * First-Party Sets is enabled; and // * the component was read successfully. void SetFirstPartySetsConfig( base::OnceCallback<void(base::File)> on_sets_ready) { const base::FilePath instance_path = GetConfigPathInstance(); - if (instance_path.empty() || !net::cookie_util::IsFirstPartySetsEnabled()) { + if (instance_path.empty() || !IsFirstPartySetsEnabled()) { return; }
diff --git a/chrome/browser/devtools/BUILD.gn b/chrome/browser/devtools/BUILD.gn index 53a271ff..c2f6d9d2 100644 --- a/chrome/browser/devtools/BUILD.gn +++ b/chrome/browser/devtools/BUILD.gn
@@ -141,7 +141,6 @@ "//components/viz/host", "//components/web_modal", "//components/zoom", - "//extensions/browser", "//net/server:http_server", "//skia", "//third_party/icu", @@ -229,6 +228,7 @@ ] } } + if (is_mac) { sources += [ "devtools_dock_tile_mac.mm" ] } else { @@ -272,7 +272,10 @@ } if (enable_extensions) { - deps += [ "//chrome/common/extensions/api" ] + deps += [ + "//chrome/common/extensions/api", + "//extensions/browser", + ] } }
diff --git a/chrome/browser/extensions/BUILD.gn b/chrome/browser/extensions/BUILD.gn index e6dccdf..5852e8c 100644 --- a/chrome/browser/extensions/BUILD.gn +++ b/chrome/browser/extensions/BUILD.gn
@@ -1108,6 +1108,7 @@ "//ash/components/attestation", "//ash/components/disks", "//ash/components/enhanced_network_tts/mojom", + "//ash/components/login/auth", "//ash/components/proximity_auth", "//ash/components/settings", "//ash/constants", @@ -1133,7 +1134,6 @@ "//chromeos/dbus/util", "//chromeos/language/language_packs", "//chromeos/language/public/mojom", - "//chromeos/login/auth", "//chromeos/login/login_state", "//chromeos/network", "//chromeos/process_proxy",
diff --git a/chrome/browser/extensions/api/passwords_private/passwords_private_utils_chromeos.cc b/chrome/browser/extensions/api/passwords_private/passwords_private_utils_chromeos.cc index 7490450..1c906765 100644 --- a/chrome/browser/extensions/api/passwords_private/passwords_private_utils_chromeos.cc +++ b/chrome/browser/extensions/api/passwords_private/passwords_private_utils_chromeos.cc
@@ -7,12 +7,12 @@ #include "components/password_manager/core/browser/password_access_authenticator.h" #if BUILDFLAG(IS_CHROMEOS_ASH) +#include "ash/components/login/auth/password_visibility_utils.h" #include "chrome/browser/ash/login/quick_unlock/auth_token.h" #include "chrome/browser/ash/login/quick_unlock/quick_unlock_factory.h" #include "chrome/browser/ash/login/quick_unlock/quick_unlock_storage.h" #include "chrome/browser/ash/profiles/profile_helper.h" #include "chrome/browser/profiles/profile.h" -#include "chromeos/login/auth/password_visibility_utils.h" #include "components/user_manager/user.h" #endif // BUILDFLAG(IS_CHROMEOS_ASH)
diff --git a/chrome/browser/extensions/api/quick_unlock_private/quick_unlock_private_api.cc b/chrome/browser/extensions/api/quick_unlock_private/quick_unlock_private_api.cc index ffe0ac6a..bc013a8c 100644 --- a/chrome/browser/extensions/api/quick_unlock_private/quick_unlock_private_api.cc +++ b/chrome/browser/extensions/api/quick_unlock_private/quick_unlock_private_api.cc
@@ -8,6 +8,8 @@ #include <string> #include <utility> +#include "ash/components/login/auth/extended_authenticator.h" +#include "ash/components/login/auth/user_context.h" #include "ash/constants/ash_pref_names.h" #include "base/bind.h" #include "base/containers/contains.h" @@ -21,8 +23,6 @@ #include "chrome/browser/extensions/api/quick_unlock_private/quick_unlock_private_ash_utils.h" #include "chrome/browser/profiles/profile.h" #include "chrome/browser/profiles/profile_manager.h" -#include "chromeos/login/auth/extended_authenticator.h" -#include "chromeos/login/auth/user_context.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/extensions/api/quick_unlock_private/quick_unlock_private_api_unittest.cc b/chrome/browser/extensions/api/quick_unlock_private/quick_unlock_private_api_unittest.cc index 45677b6..236fbb4f 100644 --- a/chrome/browser/extensions/api/quick_unlock_private/quick_unlock_private_api_unittest.cc +++ b/chrome/browser/extensions/api/quick_unlock_private/quick_unlock_private_api_unittest.cc
@@ -8,6 +8,7 @@ #include <memory> +#include "ash/components/login/auth/fake_extended_authenticator.h" #include "ash/constants/ash_features.h" #include "ash/constants/ash_pref_names.h" #include "base/bind.h" @@ -40,7 +41,6 @@ #include "chromeos/cryptohome/system_salt_getter.h" #include "chromeos/dbus/userdataauth/fake_cryptohome_misc_client.h" #include "chromeos/dbus/userdataauth/fake_userdataauth_client.h" -#include "chromeos/login/auth/fake_extended_authenticator.h" #include "chromeos/services/device_sync/public/cpp/fake_device_sync_client.h" #include "chromeos/services/multidevice_setup/public/cpp/fake_multidevice_setup_client.h" #include "chromeos/services/secure_channel/public/cpp/client/fake_secure_channel_client.h"
diff --git a/chrome/browser/extensions/api/quick_unlock_private/quick_unlock_private_ash_utils.cc b/chrome/browser/extensions/api/quick_unlock_private/quick_unlock_private_ash_utils.cc index 8df8222..2c1674d 100644 --- a/chrome/browser/extensions/api/quick_unlock_private/quick_unlock_private_ash_utils.cc +++ b/chrome/browser/extensions/api/quick_unlock_private/quick_unlock_private_ash_utils.cc
@@ -6,6 +6,8 @@ #include <utility> +#include "ash/components/login/auth/extended_authenticator.h" +#include "ash/components/login/auth/user_context.h" #include "base/bind.h" #include "chrome/browser/ash/login/quick_unlock/auth_token.h" #include "chrome/browser/ash/login/quick_unlock/fingerprint_storage.h" @@ -15,8 +17,6 @@ #include "chrome/browser/ash/profiles/profile_helper.h" #include "chrome/browser/profiles/profile.h" #include "chrome/common/extensions/api/quick_unlock_private.h" -#include "chromeos/login/auth/extended_authenticator.h" -#include "chromeos/login/auth/user_context.h" #include "content/public/browser/browser_task_traits.h" #include "content/public/browser/browser_thread.h"
diff --git a/chrome/browser/extensions/api/quick_unlock_private/quick_unlock_private_ash_utils.h b/chrome/browser/extensions/api/quick_unlock_private/quick_unlock_private_ash_utils.h index bbb50c8..253e5d1 100644 --- a/chrome/browser/extensions/api/quick_unlock_private/quick_unlock_private_ash_utils.h +++ b/chrome/browser/extensions/api/quick_unlock_private/quick_unlock_private_ash_utils.h
@@ -7,9 +7,9 @@ #include <memory> +#include "ash/components/login/auth/auth_status_consumer.h" #include "base/callback.h" #include "base/memory/ref_counted.h" -#include "chromeos/login/auth/auth_status_consumer.h" #include "content/public/browser/browser_thread.h" class Profile;
diff --git a/chrome/browser/extensions/api/runtime/runtime_apitest.cc b/chrome/browser/extensions/api/runtime/runtime_apitest.cc index 45c92f0..1c6eb79 100644 --- a/chrome/browser/extensions/api/runtime/runtime_apitest.cc +++ b/chrome/browser/extensions/api/runtime/runtime_apitest.cc
@@ -279,6 +279,14 @@ EXPECT_TRUE(reload_catcher.GetNextResult()); } +// Tests sending messages from a webpage in the extension using +// chrome.runtime.sendMessage and responding to those from the extension's +// service worker in a chrome.runtime.onMessage listener. +IN_PROC_BROWSER_TEST_F(ExtensionApiTest, ChromeRuntimeSendMessage) { + ASSERT_TRUE( + RunExtensionTest("runtime/send_message", {.page_url = "test.html"})); +} + // Tests that updating a terminated extension sends runtime.onInstalled event // with correct previousVersion. // Regression test for https://crbug.com/724563.
diff --git a/chrome/browser/extensions/api/storage/managed_value_store_cache.cc b/chrome/browser/extensions/api/storage/managed_value_store_cache.cc index 8c8e789..7971c45 100644 --- a/chrome/browser/extensions/api/storage/managed_value_store_cache.cc +++ b/chrome/browser/extensions/api/storage/managed_value_store_cache.cc
@@ -188,9 +188,8 @@ for (ExtensionSet::const_iterator it = extensions->begin(); it != extensions->end(); ++it) { - std::string schema_file; - if (!(*it)->manifest()->GetString( - manifest_keys::kStorageManagedSchema, &schema_file)) { + if (!(*it)->manifest()->FindStringPath( + manifest_keys::kStorageManagedSchema)) { // TODO(joaodasilva): Remove this. http://crbug.com/325349 (*components)[(*it)->id()] = policy::Schema(); continue;
diff --git a/chrome/browser/extensions/extension_management.cc b/chrome/browser/extensions/extension_management.cc index a9b3713a..d5a1f3e 100644 --- a/chrome/browser/extensions/extension_management.cc +++ b/chrome/browser/extensions/extension_management.cc
@@ -129,10 +129,10 @@ ExtensionManagement::InstallationMode ExtensionManagement::GetInstallationMode( const Extension* extension) { - std::string update_url; - if (extension->manifest()->GetString(manifest_keys::kUpdateURL, &update_url)) - return GetInstallationMode(extension->id(), update_url); - return GetInstallationMode(extension->id(), std::string()); + const std::string* update_url = + extension->manifest()->FindStringPath(manifest_keys::kUpdateURL); + return GetInstallationMode(extension->id(), + update_url ? *update_url : std::string()); } ExtensionManagement::InstallationMode ExtensionManagement::GetInstallationMode( @@ -282,10 +282,10 @@ APIPermissionSet ExtensionManagement::GetBlockedAPIPermissions( const Extension* extension) { - std::string update_url; - if (extension->manifest()->GetString(manifest_keys::kUpdateURL, &update_url)) - return GetBlockedAPIPermissions(extension->id(), update_url); - return GetBlockedAPIPermissions(extension->id(), std::string()); + const std::string* update_url = + extension->manifest()->FindStringPath(manifest_keys::kUpdateURL); + return GetBlockedAPIPermissions(extension->id(), + update_url ? *update_url : std::string()); } APIPermissionSet ExtensionManagement::GetBlockedAPIPermissions( @@ -364,10 +364,10 @@ bool ExtensionManagement::IsPermissionSetAllowed(const Extension* extension, const PermissionSet& perms) { - std::string update_url; - if (extension->manifest()->GetString(manifest_keys::kUpdateURL, &update_url)) - return IsPermissionSetAllowed(extension->id(), update_url, perms); - return IsPermissionSetAllowed(extension->id(), std::string(), perms); + const std::string* update_url = + extension->manifest()->FindStringPath(manifest_keys::kUpdateURL); + return IsPermissionSetAllowed( + extension->id(), update_url ? *update_url : std::string(), perms); } bool ExtensionManagement::IsPermissionSetAllowed( @@ -436,8 +436,7 @@ pref_names::kAllowedTypes, true, base::Value::Type::LIST)); const base::DictionaryValue* dict_pref = static_cast<const base::DictionaryValue*>( - LoadPreference(pref_names::kExtensionManagement, - true, + LoadPreference(pref_names::kExtensionManagement, true, base::Value::Type::DICTIONARY)); const base::Value* extension_request_pref = LoadPreference( prefs::kCloudExtensionRequestEnabled, false, base::Value::Type::BOOLEAN); @@ -559,7 +558,8 @@ subdict, internal::IndividualSettings::SCOPE_UPDATE_URL)) { settings_by_update_url_.erase(update_url); LOG(WARNING) << "Malformed Extension Management settings for " - "extensions with update url: " << update_url << "."; + "extensions with update url: " + << update_url << "."; } } else { std::vector<std::string> extension_ids = base::SplitString( @@ -830,8 +830,7 @@ DependsOn(InstallStageTrackerFactory::GetInstance()); } -ExtensionManagementFactory::~ExtensionManagementFactory() { -} +ExtensionManagementFactory::~ExtensionManagementFactory() {} KeyedService* ExtensionManagementFactory::BuildServiceInstanceFor( content::BrowserContext* context) const {
diff --git a/chrome/browser/extensions/extension_tabs_apitest.cc b/chrome/browser/extensions/extension_tabs_apitest.cc index f25b344..a0443a8 100644 --- a/chrome/browser/extensions/extension_tabs_apitest.cc +++ b/chrome/browser/extensions/extension_tabs_apitest.cc
@@ -372,6 +372,13 @@ ASSERT_TRUE(RunExtensionTest("tabs/tab_opener_id")); } +// Tests sending messages from an extension's service worker using +// chrome.tabs.sendMessage to a webpage in the extension listening for them +// using chrome.runtime.OnMessage. +IN_PROC_BROWSER_TEST_F(ExtensionApiTabTest, SendMessage) { + ASSERT_TRUE(RunExtensionTest("tabs/send_message")); +} + class IncognitoExtensionApiTabTest : public ExtensionApiTabTest, public testing::WithParamInterface<bool> { };
diff --git a/chrome/browser/feed/android/BUILD.gn b/chrome/browser/feed/android/BUILD.gn index 84386fc3..d83afcf0 100644 --- a/chrome/browser/feed/android/BUILD.gn +++ b/chrome/browser/feed/android/BUILD.gn
@@ -161,12 +161,10 @@ "java/res/color/menu_footer_chip_background.xml", "java/res/drawable-hdpi/follow_accelerator_shadow.9.png", "java/res/drawable-mdpi/follow_accelerator_shadow.9.png", - "java/res/drawable-v24/new_tab_page_multi_feed_header_background.xml", "java/res/drawable-xhdpi/follow_accelerator_shadow.9.png", "java/res/drawable-xxhdpi/follow_accelerator_shadow.9.png", "java/res/drawable/back_to_top_arrow.xml", "java/res/drawable/feed_header_border_background.xml", - "java/res/drawable/new_tab_page_multi_feed_header_background.xml", "java/res/drawable/rounded_corners.xml", "java/res/drawable/web_feed_post_follow_illustration.xml", "java/res/layout/back_to_top_bubble.xml", @@ -192,6 +190,7 @@ "java/res/values/attrs.xml", "java/res/values/colors.xml", "java/res/values/dimens.xml", + "java/res/values/drawables.xml", "java/res/values/styles.xml", "java/res/xml/feed_autoplay_preferences.xml", "java/res/xml/tab_layout_badge.xml",
diff --git a/chrome/browser/feed/android/java/res/values/drawables.xml b/chrome/browser/feed/android/java/res/values/drawables.xml new file mode 100644 index 0000000..c05af148 --- /dev/null +++ b/chrome/browser/feed/android/java/res/values/drawables.xml
@@ -0,0 +1,8 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- Copyright 2021 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. --> + +<resources> + <drawable name="new_tab_page_multi_feed_header_background">@drawable/rectangle_surface_1</drawable> +</resources>
diff --git a/chrome/browser/first_party_sets/README.md b/chrome/browser/first_party_sets/README.md new file mode 100644 index 0000000..f72acb1b --- /dev/null +++ b/chrome/browser/first_party_sets/README.md
@@ -0,0 +1,13 @@ +First-Party Sets +================ + +This directory is home to all First-Party Sets related code that requires being in the browser process (under chrome/browser/). + +Most other First-Party Sets code lives in the Network Service under [/services/network/first_party_sets/](https://source.chromium.org/chromium/chromium/src/+/main:services/network/first_party_sets/). + +Relevant documentation: + +[Github explainer](https://github.com/privacycg/first-party-sets) + +[First-Party Sets & SameParty Prototype Design Doc](https://docs.google.com/document/d/16m5IfppdmmL-Zwk9zW8tJD4iHTVGJOLRP7g-QwBwX5c/edit?usp=sharing) +
diff --git a/chrome/browser/first_party_sets/first_party_sets_pref_names.cc b/chrome/browser/first_party_sets/first_party_sets_pref_names.cc new file mode 100644 index 0000000..ccfcd728 --- /dev/null +++ b/chrome/browser/first_party_sets/first_party_sets_pref_names.cc
@@ -0,0 +1,22 @@ +// Copyright 2021 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 "chrome/browser/first_party_sets/first_party_sets_pref_names.h" + +#include "components/pref_registry/pref_registry_syncable.h" +#include "components/prefs/pref_registry_simple.h" + +namespace first_party_sets { + +// *************** LOCAL STATE PREFS *************** + +// A boolean pref indicating whether First-Party Sets is enabled by enterprise +// policy. +const char kFirstPartySetsEnabled[] = "first_party_sets.enabled"; + +void RegisterLocalStatePrefs(PrefRegistrySimple* registry) { + registry->RegisterBooleanPref(kFirstPartySetsEnabled, true); +} + +} // namespace first_party_sets
diff --git a/chrome/browser/first_party_sets/first_party_sets_pref_names.h b/chrome/browser/first_party_sets/first_party_sets_pref_names.h new file mode 100644 index 0000000..1acf3f37 --- /dev/null +++ b/chrome/browser/first_party_sets/first_party_sets_pref_names.h
@@ -0,0 +1,19 @@ +// Copyright 2021 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 CHROME_BROWSER_FIRST_PARTY_SETS_FIRST_PARTY_SETS_PREF_NAMES_H_ +#define CHROME_BROWSER_FIRST_PARTY_SETS_FIRST_PARTY_SETS_PREF_NAMES_H_ + +class PrefRegistrySimple; + +namespace first_party_sets { + +// Add Local State prefs below. +extern const char kFirstPartySetsEnabled[]; + +void RegisterLocalStatePrefs(PrefRegistrySimple* registry); + +} // namespace first_party_sets + +#endif // CHROME_BROWSER_FIRST_PARTY_SETS_FIRST_PARTY_SETS_PREF_NAMES_H_
diff --git a/chrome/browser/first_party_sets/first_party_sets_util.cc b/chrome/browser/first_party_sets/first_party_sets_util.cc index 7bdfadc5..a2fed2e 100644 --- a/chrome/browser/first_party_sets/first_party_sets_util.cc +++ b/chrome/browser/first_party_sets/first_party_sets_util.cc
@@ -84,4 +84,4 @@ base::BindOnce(&LoadSetsFromDisk, persisted_sets_path), base::BindOnce(&SendPersistedSets, std::move(send_sets), persisted_sets_path)); -} \ No newline at end of file +}
diff --git a/chrome/browser/flag-metadata.json b/chrome/browser/flag-metadata.json index 8255dad..ef04e3eb 100644 --- a/chrome/browser/flag-metadata.json +++ b/chrome/browser/flag-metadata.json
@@ -5330,6 +5330,11 @@ "expiry_milestone": 100 }, { + "name": "terminal-tmux-integration", + "owners": [ "lxj", "easy", "//chrome/browser/ash/guest_os/OWNERS" ], + "expiry_milestone": 102 + }, + { "name": "theme-refactor-android", "owners": [ "sinansahin@google.com", "twellington", "clank-app-team@google.com" ], "expiry_milestone": 100
diff --git a/chrome/browser/flag_descriptions.cc b/chrome/browser/flag_descriptions.cc index c9ef782..64fbb67f 100644 --- a/chrome/browser/flag_descriptions.cc +++ b/chrome/browser/flag_descriptions.cc
@@ -5129,6 +5129,11 @@ const char kTerminalSSHDescription[] = "Enables SSH tabs in the Terminal System App."; +const char kTerminalTmuxIntegrationName[] = "Terminal tmux integration"; +const char kTerminalTmuxIntegrationDescription[] = + "Enables integration with tmux control mode (tmux -CC) in the Terminal " + "System App."; + const char kTetherName[] = "Instant Tethering"; const char kTetherDescription[] = "Enables Instant Tethering. Instant Tethering allows your nearby Google "
diff --git a/chrome/browser/flag_descriptions.h b/chrome/browser/flag_descriptions.h index 093ba12..0c8f014 100644 --- a/chrome/browser/flag_descriptions.h +++ b/chrome/browser/flag_descriptions.h
@@ -2963,6 +2963,9 @@ extern const char kTerminalSSHName[]; extern const char kTerminalSSHDescription[]; +extern const char kTerminalTmuxIntegrationName[]; +extern const char kTerminalTmuxIntegrationDescription[]; + extern const char kTetherName[]; extern const char kTetherDescription[];
diff --git a/chrome/browser/global_keyboard_shortcuts_mac.mm b/chrome/browser/global_keyboard_shortcuts_mac.mm index 35c02336..06fddcc 100644 --- a/chrome/browser/global_keyboard_shortcuts_mac.mm +++ b/chrome/browser/global_keyboard_shortcuts_mac.mm
@@ -171,6 +171,7 @@ {true, false, false, true, kVK_UpArrow, IDC_FOCUS_PREVIOUS_PANE}, {true, true, false, false, kVK_ANSI_A, IDC_TAB_SEARCH}, {true, true, false, true, kVK_ANSI_A, IDC_FOCUS_INACTIVE_POPUP_FOR_ACCESSIBILITY}, + {true, false, true, false, kVK_ANSI_F, IDC_FULLSCREEN}, }); // clang-format on
diff --git a/chrome/browser/lacros/DEPS b/chrome/browser/lacros/DEPS index 1a5b0d5..d376652 100644 --- a/chrome/browser/lacros/DEPS +++ b/chrome/browser/lacros/DEPS
@@ -1,6 +1,6 @@ include_rules = [ "+chrome/browser/ui/views", "+components/account_manager_core", - "+components/arc", + "+components/arc/lacros", "+components/memory_pressure", ]
diff --git a/chrome/browser/lacros/arc/arc_icon_cache.cc b/chrome/browser/lacros/arc/arc_icon_cache.cc new file mode 100644 index 0000000..6e25bf1 --- /dev/null +++ b/chrome/browser/lacros/arc/arc_icon_cache.cc
@@ -0,0 +1,89 @@ +// Copyright 2021 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 "chrome/browser/lacros/arc/arc_icon_cache.h" + +#include "base/callback.h" +#include "chromeos/lacros/lacros_service.h" +#include "components/arc/common/intent_helper/link_handler_model.h" + +ArcIconCache::ArcIconCache() = default; + +ArcIconCache::~ArcIconCache() { + arc::LinkHandlerModel::SetDelegate(nullptr); +} + +void ArcIconCache::Start() { + auto* lacros_service = chromeos::LacrosService::Get(); + if (!lacros_service->IsAvailable<crosapi::mojom::Arc>()) { + LOG(WARNING) << "ARC is not supported in Lacros."; + return; + } + arc::LinkHandlerModel::SetDelegate(this); + lacros_service->GetRemote<crosapi::mojom::Arc>()->AddObserver( + receiver_.BindNewPipeAndPassRemoteWithVersion()); +} + +void ArcIconCache::OnIconInvalidated(const std::string& package_name) { + DCHECK_CALLED_ON_VALID_THREAD(thread_checker_); + icon_loader_.InvalidateIcons(package_name); +} + +ArcIconCache::GetResult ArcIconCache::GetActivityIcons( + const std::vector<ActivityName>& activities, + OnIconsReadyCallback cb) { + DCHECK_CALLED_ON_VALID_THREAD(thread_checker_); + return icon_loader_.GetActivityIcons(activities, std::move(cb)); +} + +bool ArcIconCache::RequestUrlHandlerList( + const std::string& url, + RequestUrlHandlerListCallback callback) { + auto* service = chromeos::LacrosService::Get(); + if (!service || !service->IsAvailable<crosapi::mojom::Arc>()) { + LOG(WARNING) << "ARC is not supported in Lacros."; + return false; + } + + if (service->GetInterfaceVersion(crosapi::mojom::Arc::Uuid_) < + int{crosapi::mojom::Arc::MethodMinVersions:: + kRequestUrlHandlerListMinVersion}) { + LOG(WARNING) << "RequestUrlHandlerList is not supported in Lacros."; + return false; + } + + service->GetRemote<crosapi::mojom::Arc>()->RequestUrlHandlerList( + url, base::BindOnce(&ArcIconCache::OnRequestUrlHandlerList, + weak_ptr_factory_.GetWeakPtr(), std::move(callback))); + return true; +} + +void ArcIconCache::OnRequestUrlHandlerList( + RequestUrlHandlerListCallback callback, + std::vector<crosapi::mojom::IntentHandlerInfoPtr> handlers) { + std::vector<IntentHandlerInfo> converted_handlers; + for (auto const& handler : handlers) { + converted_handlers.push_back(IntentHandlerInfo( + handler->name, handler->package_name, handler->activity_name)); + } + std::move(callback).Run(std::move(converted_handlers)); +} + +bool ArcIconCache::HandleUrl(const std::string& url, + const std::string& package_name) { + auto* service = chromeos::LacrosService::Get(); + if (!service || !service->IsAvailable<crosapi::mojom::Arc>()) { + LOG(WARNING) << "ARC is not supported in Lacros."; + return false; + } + + if (service->GetInterfaceVersion(crosapi::mojom::Arc::Uuid_) < + int{crosapi::mojom::Arc::MethodMinVersions::kHandleUrlMinVersion}) { + LOG(WARNING) << "HandleUrl is not supported in Lacros."; + return false; + } + + service->GetRemote<crosapi::mojom::Arc>()->HandleUrl(url, package_name); + return true; +}
diff --git a/chrome/browser/lacros/arc/arc_icon_cache.h b/chrome/browser/lacros/arc/arc_icon_cache.h new file mode 100644 index 0000000..0a13c59 --- /dev/null +++ b/chrome/browser/lacros/arc/arc_icon_cache.h
@@ -0,0 +1,65 @@ +// Copyright 2021 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 CHROME_BROWSER_LACROS_ARC_ARC_ICON_CACHE_H_ +#define CHROME_BROWSER_LACROS_ARC_ARC_ICON_CACHE_H_ + +#include <string> +#include <vector> + +#include "base/memory/weak_ptr.h" +#include "base/threading/thread_checker.h" +#include "chromeos/crosapi/mojom/arc.mojom.h" +#include "components/arc/common/intent_helper/activity_icon_loader.h" +#include "components/arc/common/intent_helper/link_handler_model_delegate.h" +#include "mojo/public/cpp/bindings/receiver.h" + +// This class receives arc icon info updates from Ash. It can only be used on +// the main thread. +class ArcIconCache : public arc::LinkHandlerModelDelegate, + public crosapi::mojom::ArcObserver { + public: + ArcIconCache(); + ArcIconCache(const ArcIconCache&) = delete; + ArcIconCache& operator=(const ArcIconCache&) = delete; + ~ArcIconCache() override; + + // Start observing ARC in ash-chrome. + void Start(); + + // arc::LinkHandlerModelDelegate: + // Retrieves icons for the |activities| and calls |cb|. + // See ActivityIconLoader::GetActivityIcons() for more details. + GetResult GetActivityIcons(const std::vector<ActivityName>& activities, + OnIconsReadyCallback cb) override; + // Calls RequestUrlHandlerList mojo API. + bool RequestUrlHandlerList(const std::string& url, + RequestUrlHandlerListCallback callback) override; + // Calls HandleUrl mojo API. + bool HandleUrl(const std::string& url, + const std::string& package_name) override; + + private: + THREAD_CHECKER(thread_checker_); + + // crosapi::mojom::ArcObserver + void OnIconInvalidated(const std::string& package_name) override; + + // Convert vector of crosapi::mojom::IntentHandlerInfoPtr to vector of + // ArcIconCacheDelegate::IntentHandlerInfo. + void OnRequestUrlHandlerList( + RequestUrlHandlerListCallback callback, + std::vector<crosapi::mojom::IntentHandlerInfoPtr> handlers); + + // Cached activity icons. + ActivityIconLoader icon_loader_; + + // Receives mojo messages from ash-chrome. + mojo::Receiver<crosapi::mojom::ArcObserver> receiver_{this}; + + // This must come last to make sure weak pointers are invalidated first. + base::WeakPtrFactory<ArcIconCache> weak_ptr_factory_{this}; +}; + +#endif // CHROME_BROWSER_LACROS_ARC_ARC_ICON_CACHE_H_
diff --git a/chrome/browser/lacros/arc_icon_cache_lacros.cc b/chrome/browser/lacros/arc_icon_cache_lacros.cc deleted file mode 100644 index 50930e8b..0000000 --- a/chrome/browser/lacros/arc_icon_cache_lacros.cc +++ /dev/null
@@ -1,25 +0,0 @@ -// Copyright 2021 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 "chrome/browser/lacros/arc_icon_cache_lacros.h" - -#include "chromeos/lacros/lacros_service.h" - -ArcIconCacheLacros::ArcIconCacheLacros() = default; -ArcIconCacheLacros::~ArcIconCacheLacros() = default; - -void ArcIconCacheLacros::Start() { - auto* lacros_service = chromeos::LacrosService::Get(); - if (!lacros_service->IsAvailable<crosapi::mojom::Arc>()) { - LOG(WARNING) << "ARC is not supported in Lacros."; - return; - } - lacros_service->GetRemote<crosapi::mojom::Arc>()->AddObserver( - receiver_.BindNewPipeAndPassRemoteWithVersion()); -} - -void ArcIconCacheLacros::OnIconInvalidated(const std::string& package_name) { - DCHECK_CALLED_ON_VALID_THREAD(thread_checker_); - icon_loader_.InvalidateIcons(package_name); -}
diff --git a/chrome/browser/lacros/arc_icon_cache_lacros.h b/chrome/browser/lacros/arc_icon_cache_lacros.h deleted file mode 100644 index eb856fb3..0000000 --- a/chrome/browser/lacros/arc_icon_cache_lacros.h +++ /dev/null
@@ -1,40 +0,0 @@ -// Copyright 2021 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 CHROME_BROWSER_LACROS_ARC_ICON_CACHE_LACROS_H_ -#define CHROME_BROWSER_LACROS_ARC_ICON_CACHE_LACROS_H_ - -#include <string> - -#include "base/threading/thread_checker.h" -#include "chromeos/crosapi/mojom/arc.mojom.h" -#include "components/arc/common/intent_helper/activity_icon_loader.h" -#include "mojo/public/cpp/bindings/receiver.h" - -// This class receives arc icon info updates from Ash. It can only be used on -// the main thread. -class ArcIconCacheLacros : public crosapi::mojom::ArcObserver { - public: - ArcIconCacheLacros(); - ArcIconCacheLacros(const ArcIconCacheLacros&) = delete; - ArcIconCacheLacros& operator=(const ArcIconCacheLacros&) = delete; - ~ArcIconCacheLacros() override; - - // Start observing ARC in ash-chrome. - void Start(); - - private: - THREAD_CHECKER(thread_checker_); - - // crosapi::mojom::ArcObserver - void OnIconInvalidated(const std::string& package_name) override; - - // Cached activity icons. - arc::internal::ActivityIconLoader icon_loader_; - - // Receives mojo messages from ash-chrome. - mojo::Receiver<crosapi::mojom::ArcObserver> receiver_{this}; -}; - -#endif // CHROME_BROWSER_LACROS_ARC_ICON_CACHE_LACROS_H_
diff --git a/chrome/browser/lacros/browser_service_lacros.cc b/chrome/browser/lacros/browser_service_lacros.cc index d7b3c0d..c5f586b 100644 --- a/chrome/browser/lacros/browser_service_lacros.cc +++ b/chrome/browser/lacros/browser_service_lacros.cc
@@ -256,6 +256,7 @@ if (url.SchemeIs(content::kChromeUIScheme) && (url.host() == chrome::kChromeUIFlagsHost || url.host() == chrome::kChromeUIVersionHost || + url.host() == chrome::kChromeUIAboutHost || url.host() == chrome::kChromeUIComponentsHost)) { if (ActivateTabMatchingURLWithoutRef(profile, url)) { std::move(callback).Run();
diff --git a/chrome/browser/lacros/chrome_browser_main_extra_parts_lacros.cc b/chrome/browser/lacros/chrome_browser_main_extra_parts_lacros.cc index 4a3cf03..487bdbb 100644 --- a/chrome/browser/lacros/chrome_browser_main_extra_parts_lacros.cc +++ b/chrome/browser/lacros/chrome_browser_main_extra_parts_lacros.cc
@@ -5,7 +5,7 @@ #include "chrome/browser/lacros/chrome_browser_main_extra_parts_lacros.h" #include "chrome/browser/lacros/app_mode/kiosk_session_service_lacros.h" -#include "chrome/browser/lacros/arc_icon_cache_lacros.h" +#include "chrome/browser/lacros/arc/arc_icon_cache.h" #include "chrome/browser/lacros/automation_manager_lacros.h" #include "chrome/browser/lacros/browser_service_lacros.h" #include "chrome/browser/lacros/download_controller_client_lacros.h" @@ -78,7 +78,7 @@ } #endif - arc_icon_cache_ = std::make_unique<ArcIconCacheLacros>(); + arc_icon_cache_ = std::make_unique<ArcIconCache>(); arc_icon_cache_->Start(); // Start Lacros' drive mount point path caching, since it is available in Ash.
diff --git a/chrome/browser/lacros/chrome_browser_main_extra_parts_lacros.h b/chrome/browser/lacros/chrome_browser_main_extra_parts_lacros.h index 5ff9ce6..7a56eac7 100644 --- a/chrome/browser/lacros/chrome_browser_main_extra_parts_lacros.h +++ b/chrome/browser/lacros/chrome_browser_main_extra_parts_lacros.h
@@ -9,7 +9,7 @@ #include <memory> -class ArcIconCacheLacros; +class ArcIconCache; class AutomationManagerLacros; class BrowserServiceLacros; class DriveFsCache; @@ -46,7 +46,7 @@ void PostBrowserStart() override; // Receiver and cache of arc icon info updates. - std::unique_ptr<ArcIconCacheLacros> arc_icon_cache_; + std::unique_ptr<ArcIconCache> arc_icon_cache_; std::unique_ptr<AutomationManagerLacros> automation_manager_;
diff --git a/chrome/browser/lookalikes/lookalike_url_navigation_throttle.cc b/chrome/browser/lookalikes/lookalike_url_navigation_throttle.cc index 5a57edab..fccffdd1 100644 --- a/chrome/browser/lookalikes/lookalike_url_navigation_throttle.cc +++ b/chrome/browser/lookalikes/lookalike_url_navigation_throttle.cc
@@ -369,7 +369,7 @@ match_type == LookalikeUrlMatchType::kCharacterSwapTop500) { GURL lookalike_url = first_is_lookalike ? first_url : last_url; - navigation_handle()->GetWebContents()->GetMainFrame()->AddMessageToConsole( + navigation_handle()->GetRenderFrameHost()->AddMessageToConsole( blink::mojom::ConsoleMessageLevel::kWarning, base::StringPrintf( "Chrome has determined that %s could be fake or fraudulent.\n\n"
diff --git a/chrome/browser/metrics/chrome_browser_main_extra_parts_metrics.cc b/chrome/browser/metrics/chrome_browser_main_extra_parts_metrics.cc index 86f5d07..7393962c 100644 --- a/chrome/browser/metrics/chrome_browser_main_extra_parts_metrics.cc +++ b/chrome/browser/metrics/chrome_browser_main_extra_parts_metrics.cc
@@ -8,9 +8,7 @@ #include <memory> #include <string> -#include "base/allocator/buildflags.h" -#include "base/allocator/partition_alloc_features.h" -#include "base/allocator/partition_allocator/partition_alloc_config.h" +#include "base/allocator/partition_alloc_support.h" #include "base/bind.h" #include "base/command_line.h" #include "base/cpu.h" @@ -585,176 +583,6 @@ #endif // defined(OS_WIN) - // Records whether or not PartitionAlloc is used as the default allocator. - ChromeMetricsServiceAccessor::RegisterSyntheticFieldTrial( - "PartitionAllocEverywhere", -#if BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC) - "Enabled" -#else - "Disabled" -#endif - ); - - // Records whether or not PartitionAlloc-Everywhere is enabled, and whether - // PCScan is enabled on top of it. This is meant for a 3-way experiment with 2 - // binaries: - // - binary A: deployed to 33% users, with PA-E and PCScan off. - // - binary B: deployed to 66% users, with PA-E on, half of which having - // PCScan on - // - // NOTE, deliberately don't use PA_ALLOW_PCSCAN which depends on bitness. - // In the 32-bit case, PCScan is always disabled, but we'll deliberately - // misrepresent it as enabled here (and later ignored when analyzing results), - // in order to keep each population at 33%. - ChromeMetricsServiceAccessor::RegisterSyntheticFieldTrial( - "PartitionAllocEverywhereAndPCScan", -#if BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC) - base::FeatureList::IsEnabled( - base::features::kPartitionAllocPCScanBrowserOnly) - ? "EnabledWithPCScan" - : "EnabledWithoutPCScan" -#else - "Disabled" -#endif // BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC) - ); - - // BackupRefPtr_Effective and PCScan_Effective record whether or not - // BackupRefPtr and/or PCScan are enabled. The experiments aren't independent, - // so having a synthetic Finch will help look only at cases where one isn't - // affected by the other. - -#if BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC) - // Whether PartitionAllocBackupRefPtr is enabled (as determined by - // FeatureList::IsEnabled). - bool brp_finch_enabled = false; - ALLOW_UNUSED_LOCAL(brp_finch_enabled); - // Whether PartitionAllocBackupRefPtr is set up for the default behavior. The - // default behavior is when either the Finch flag is disabled, or is enabled - // in brp-mode=disabled (these two options are equivalent). - bool brp_nondefault_behavior = false; - ALLOW_UNUSED_LOCAL(brp_nondefault_behavior); - // Whether PartitionAllocBackupRefPtr is set up to enable BRP protection. It - // requires the Finch flag to be enabled and brp-mode!=disabled*. Some modes, - // e.g. disabled-but-3-way-split, do something (hence can't be considered the - // default behavior), but don't enable BRP protection. - bool brp_truly_enabled = false; - ALLOW_UNUSED_LOCAL(brp_truly_enabled); -#if BUILDFLAG(USE_BACKUP_REF_PTR) - if (base::FeatureList::IsEnabled(base::features::kPartitionAllocBackupRefPtr)) - brp_finch_enabled = true; - if (brp_finch_enabled && base::features::kBackupRefPtrModeParam.Get() != - base::features::BackupRefPtrMode::kDisabled) - brp_nondefault_behavior = true; - if (brp_finch_enabled && base::features::kBackupRefPtrModeParam.Get() == - base::features::BackupRefPtrMode::kEnabled) - brp_truly_enabled = true; -#endif // BUILDFLAG(USE_BACKUP_REF_PTR) - bool pcscan_enabled = -#if defined(PA_ALLOW_PCSCAN) - base::FeatureList::IsEnabled( - base::features::kPartitionAllocPCScanBrowserOnly); -#else - false; -#endif - - std::string brp_group_name; - if (pcscan_enabled) { - // If PCScan is enabled, just ignore the population. - brp_group_name = "Ignore_PCScanIsOn"; - } else if (!brp_finch_enabled) { - // The control group is actually disguised as "enabled", but in fact it's - // disabled using a param. This is to differentiate the population that - // participates in the control group, from the population that isn't in any - // group. - brp_group_name = "Ignore_NoGroup"; - } else { - switch (base::features::kBackupRefPtrModeParam.Get()) { - case base::features::BackupRefPtrMode::kDisabled: - brp_group_name = "Disabled"; - break; - case base::features::BackupRefPtrMode::kEnabled: -#if BUILDFLAG(PUT_REF_COUNT_IN_PREVIOUS_SLOT) - brp_group_name = "EnabledPrevSlot"; -#else - brp_group_name = "EnabledBeforeAlloc"; -#endif - break; - case base::features::BackupRefPtrMode::kDisabledButSplitPartitions2Way: - brp_group_name = "DisabledBut2WaySplit"; - break; - case base::features::BackupRefPtrMode::kDisabledButSplitPartitions3Way: - brp_group_name = "DisabledBut3WaySplit"; - break; - } - - if (base::features::kBackupRefPtrModeParam.Get() != - base::features::BackupRefPtrMode::kDisabled) { - std::string process_selector; - switch (base::features::kBackupRefPtrEnabledProcessesParam.Get()) { - case base::features::BackupRefPtrEnabledProcesses::kBrowserOnly: - process_selector = "BrowserOnly"; - break; - case base::features::BackupRefPtrEnabledProcesses::kBrowserAndRenderer: - process_selector = "BrowserAndRenderer"; - break; - case base::features::BackupRefPtrEnabledProcesses::kNonRenderer: - process_selector = "NonRenderer"; - break; - case base::features::BackupRefPtrEnabledProcesses::kAllProcesses: - process_selector = "AllProcesses"; - break; - } - - brp_group_name += ("_" + process_selector); - } - } - ChromeMetricsServiceAccessor::RegisterSyntheticFieldTrial( - "BackupRefPtr_Effective", brp_group_name); - - std::string pcscan_group_name; - std::string pcscan_group_name_fallback; -#if defined(PA_ALLOW_PCSCAN) - if (brp_truly_enabled) { - // If BRP protection is enabled, just ignore the population. Check - // brp_truly_enabled, not brp_finch_enabled, because there are certain modes - // where BRP protection is actually disabled. - pcscan_group_name = "Ignore_BRPIsOn"; - } else { - pcscan_group_name = (pcscan_enabled ? "Enabled" : "Disabled"); - } - // In case we are incorrect that PCScan is independent of partition-split - // modes, create a fallback trial that only takes into account the BRP Finch - // settings that preserve the default behavior. - if (brp_nondefault_behavior) { - pcscan_group_name_fallback = "Ignore_BRPIsOn"; - } else { - pcscan_group_name_fallback = (pcscan_enabled ? "Enabled" : "Disabled"); - } -#else - // On certain platforms, PCScan is not supported and permanently disabled. - // Don't lump it into "Disabled", so that belonging to "Enabled"/"Disabled" is - // fully controlled by Finch and thus have identical population sizes. - pcscan_group_name = "Unavailable"; - pcscan_group_name_fallback = "Unavailable"; -#endif // defined(PA_ALLOW_PCSCAN) - ChromeMetricsServiceAccessor::RegisterSyntheticFieldTrial("PCScan_Effective", - pcscan_group_name); - ChromeMetricsServiceAccessor::RegisterSyntheticFieldTrial( - "PCScan_Effective_Fallback", pcscan_group_name_fallback); - - // This synthetic Finch setting reflects the new USE_BACKUP_REF_PTR behavior, - // which simply compiles in the BackupRefPtr support, but keeps it disabled at - // run-time (which can be further enabled via Finch). - ChromeMetricsServiceAccessor::RegisterSyntheticFieldTrial( - "BackupRefPtrSupport", -#if BUILDFLAG(USE_BACKUP_REF_PTR) - "CompiledIn" -#else - "Disabled" -#endif // BUILDFLAG(USE_BACKUP_REF_PTR) - ); -#endif // BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC) - #if defined(OS_ANDROID) // No need to filter out on Android, because it doesn't support // ChromeVariations policy. @@ -773,54 +601,15 @@ "EnterpriseSynthetic", is_enterprise ? "IsEnterprise" : "IsNotEnterprise"); - // This synthetic field trial for the BackupRefPtr binary A/B experiment is - // set up such that: - // 1) Enterprises are excluded from experiment, to make sure we honor - // ChromeVariations policy. - // 2) The experiment binary (USE_BACKUP_REF_PTR) is delivered via Google - // Update to fraction X of the non-enterprise population. - // 3) The control group is established in fraction X of non-enterprise - // popluation via Finch (PartitionAllocBackupRefPtrControl). Since this - // Finch is applicable only to 1-X of the non-enterprise population, we - // need to set it to Y=X/(1-X). E.g. if X=.333, Y=.5; if X=.01, Y=.0101. -#if BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC) -#if BUILDFLAG(USE_BACKUP_REF_PTR) - constexpr bool kIsBrpOn = true; // experiment binary only -#else - constexpr bool kIsBrpOn = false; // non-experiment binary -#endif - const bool is_brp_control = base::FeatureList::IsEnabled( - base::features::kPartitionAllocBackupRefPtrControl); - const char* group_name; - if (is_enterprise) { - if (kIsBrpOn) { // is_enterprise && kIsBrpOn - group_name = "Excluded_Enterprise_BrpOn"; - } else { // is_enterprise && !kIsBrpOn - group_name = "Excluded_Enterprise_BrpOff"; - } - } else { - if (kIsBrpOn) { // !is_enterprise && kIsBrpOn - group_name = "Enabled"; - } else { // !is_enterprise && !kIsBrpOn - if (is_brp_control) { - group_name = "Control"; - } else { - group_name = "Excluded_NonEnterprise"; - } - } + // Register synthetic Finch trials proposed by PartitionAlloc. + auto pa_trials = base::allocator::ProposeSyntheticFinchTrials(is_enterprise); + for (auto& trial : pa_trials) { + std::string trial_name; + std::string group_name; + std::tie(trial_name, group_name) = trial; + ChromeMetricsServiceAccessor::RegisterSyntheticFieldTrial(trial_name, + group_name); } - ChromeMetricsServiceAccessor::RegisterSyntheticFieldTrial( - "BackupRefPtrNoEnterprise", group_name); -#endif // BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC) - - ChromeMetricsServiceAccessor::RegisterSyntheticFieldTrial( - "FakeBinaryExperiment", -#if BUILDFLAG(USE_FAKE_BINARY_EXPERIMENT) - "Enabled" -#else - "Disabled" -#endif - ); } void ChromeBrowserMainExtraPartsMetrics::PostBrowserStart() {
diff --git a/chrome/browser/net/nss_context_chromeos_browsertest.cc b/chrome/browser/net/nss_context_chromeos_browsertest.cc index 0b25ee7..dac17e6 100644 --- a/chrome/browser/net/nss_context_chromeos_browsertest.cc +++ b/chrome/browser/net/nss_context_chromeos_browsertest.cc
@@ -6,6 +6,7 @@ #include <memory> +#include "ash/components/login/auth/user_context.h" #include "base/bind.h" #include "base/run_loop.h" #include "chrome/browser/ash/login/login_manager_test.h" @@ -17,7 +18,6 @@ #include "chrome/browser/ash/scoped_test_system_nss_key_slot_mixin.h" #include "chrome/browser/net/nss_service.h" #include "chrome/browser/profiles/profile.h" -#include "chromeos/login/auth/user_context.h" #include "components/account_id/account_id.h" #include "components/signin/public/identity_manager/identity_test_utils.h" #include "components/user_manager/user.h"
diff --git a/chrome/browser/password_manager/chrome_password_manager_client.cc b/chrome/browser/password_manager/chrome_password_manager_client.cc index 377f8cfd..a211aabd 100644 --- a/chrome/browser/password_manager/chrome_password_manager_client.cc +++ b/chrome/browser/password_manager/chrome_password_manager_client.cc
@@ -92,6 +92,7 @@ #include "content/public/browser/child_process_security_policy.h" #include "content/public/browser/navigation_entry.h" #include "content/public/browser/navigation_handle.h" +#include "content/public/browser/page.h" #include "content/public/browser/render_frame_host.h" #include "content/public/browser/render_view_host.h" #include "content/public/browser/render_widget_host_view.h" @@ -1280,14 +1281,7 @@ log_manager_->SetSuspended(web_contents()->GetWebUI() != nullptr); } -void ChromePasswordManagerClient::DidFinishNavigation( - content::NavigationHandle* navigation_handle) { - if (!navigation_handle->IsInPrimaryMainFrame() || - navigation_handle->IsSameDocument() || - !navigation_handle->HasCommitted()) { - return; - } - +void ChromePasswordManagerClient::PrimaryPageChanged(content::Page& page) { // Send any collected metrics by destroying the metrics recorder. metrics_recorder_.reset(); @@ -1301,8 +1295,8 @@ password_reuse_detection_manager_.DidNavigateMainFrame(GetLastCommittedURL()); - AddToWidgetInputEventObservers( - navigation_handle->GetRenderFrameHost()->GetRenderWidgetHost(), this); + AddToWidgetInputEventObservers(page.GetMainDocument().GetRenderWidgetHost(), + this); #if defined(OS_ANDROID) // This unblocklisted info is only used after form submission to determine
diff --git a/chrome/browser/password_manager/chrome_password_manager_client.h b/chrome/browser/password_manager/chrome_password_manager_client.h index 291fe99..2f329c3 100644 --- a/chrome/browser/password_manager/chrome_password_manager_client.h +++ b/chrome/browser/password_manager/chrome_password_manager_client.h
@@ -316,8 +316,7 @@ // content::WebContentsObserver overrides. void DidStartNavigation( content::NavigationHandle* navigation_handle) override; - void DidFinishNavigation( - content::NavigationHandle* navigation_handle) override; + void PrimaryPageChanged(content::Page& page) override; void WebContentsDestroyed() override; // TODO(crbug.com/1006430): Paste event is not captured on Android. #if !defined(OS_ANDROID)
diff --git a/chrome/browser/prefs/browser_prefs.cc b/chrome/browser/prefs/browser_prefs.cc index 7cde01a..e6d8b31 100644 --- a/chrome/browser/prefs/browser_prefs.cc +++ b/chrome/browser/prefs/browser_prefs.cc
@@ -26,6 +26,7 @@ #include "chrome/browser/enterprise/reporting/prefs.h" #include "chrome/browser/enterprise/util/managed_browser_utils.h" #include "chrome/browser/external_protocol/external_protocol_handler.h" +#include "chrome/browser/first_party_sets/first_party_sets_pref_names.h" #include "chrome/browser/first_run/first_run.h" #include "chrome/browser/gpu/gpu_mode_manager.h" #include "chrome/browser/lifetime/browser_shutdown.h" @@ -932,6 +933,7 @@ enterprise_reporting::RegisterLocalStatePrefs(registry); ExternalProtocolHandler::RegisterPrefs(registry); flags_ui::PrefServiceFlagsStorage::RegisterPrefs(registry); + first_party_sets::RegisterLocalStatePrefs(registry); GpuModeManager::RegisterPrefs(registry); signin::IdentityManager::RegisterLocalStatePrefs(registry); invalidation::FCMInvalidationService::RegisterPrefs(registry);
diff --git a/chrome/browser/resources/chromeos/accessibility/accessibility_common/dictation/parse/pumpkin_parse_strategy.js b/chrome/browser/resources/chromeos/accessibility/accessibility_common/dictation/parse/pumpkin_parse_strategy.js index 25a2674..52ef24c5 100644 --- a/chrome/browser/resources/chromeos/accessibility/accessibility_common/dictation/parse/pumpkin_parse_strategy.js +++ b/chrome/browser/resources/chromeos/accessibility/accessibility_common/dictation/parse/pumpkin_parse_strategy.js
@@ -90,15 +90,15 @@ const pumpkinTagger = new speech.pumpkin.api.js.PumpkinTagger.PumpkinTagger(); try { - const path = `dictation/pumpkin/${locale}/`; + const path = `${PumpkinParseStrategy.PUMPKIN_DIR}${locale}/`; let success = await pumpkinTagger.initializeFromPumpkinConfig( - `${path}pumpkin_config.binarypb`); + `${path}${PumpkinParseStrategy.PUMPKIN_CONFIG_PROTO_SRC}`); if (!success) { console.warn('Failed to load PumpkinTagger from PumpkinConfig.'); return false; } - success = - await pumpkinTagger.loadActionFrame(`${path}action_config.binarypb`); + success = await pumpkinTagger.loadActionFrame( + `${path}${PumpkinParseStrategy.PUMPKIN_ACTION_CONFIG_PROTO_SRC}`); if (!success) { console.warn('Failed to load Pumpkin ActionConfig.'); return false; @@ -119,7 +119,7 @@ async loadPumpkinScripts_() { const pumpkinTaggerScript = /** @type {!HTMLScriptElement} */ (document.createElement('script')); - pumpkinTaggerScript.src = 'dictation/pumpkin/js_pumpkin_tagger_bin.js'; + pumpkinTaggerScript.src = PumpkinParseStrategy.PUMPKIN_TAGGER_SRC; const taggerLoadPromise = new Promise((resolve, reject) => { pumpkinTaggerScript.addEventListener('load', () => { resolve(); @@ -130,7 +130,7 @@ const wasmModuleScript = /** @type {!HTMLScriptElement} */ (document.createElement('script')); - wasmModuleScript.src = 'dictation/pumpkin/tagger_wasm_main.js'; + wasmModuleScript.src = PumpkinParseStrategy.PUMPKIN_WASM_SRC; const moduleLoadPromise = new Promise((resolve, reject) => { goog['global']['Module'] = { onRuntimeInitialized() { @@ -257,3 +257,40 @@ NUM_ARG: 'NUM_ARG', OPEN_ENDED_TEXT: 'OPEN_ENDED_TEXT', }; + +/** + * The pumpkin/ directory, relative to the accessibility common base directory. + * @type {string} + * @const + */ +PumpkinParseStrategy.PUMPKIN_DIR = 'dictation/parse/pumpkin/'; + +/** + * The path to the pumpkin tagger source file. + * @type {string} + * @const + */ +PumpkinParseStrategy.PUMPKIN_TAGGER_SRC = + PumpkinParseStrategy.PUMPKIN_DIR + 'js_pumpkin_tagger_bin.js'; + +/** + * The path to the pumpkin web assembly module source file. + * @type {string} + * @const + */ +PumpkinParseStrategy.PUMPKIN_WASM_SRC = + PumpkinParseStrategy.PUMPKIN_DIR + 'tagger_wasm_main.js'; + +/** + * The name of the pumpkin config binary proto file. + * @type {string} + * @const + */ +PumpkinParseStrategy.PUMPKIN_CONFIG_PROTO_SRC = 'pumpkin_config.binarypb'; + +/** + * The name of the pumpkin action config binary proto file. + * @type {string} + * @const + */ +PumpkinParseStrategy.PUMPKIN_ACTION_CONFIG_PROTO_SRC = 'action_config.binarypb';
diff --git a/chrome/browser/resources/print_preview/data/user_manager.ts b/chrome/browser/resources/print_preview/data/user_manager.ts index e3fc377..fd8e412d 100644 --- a/chrome/browser/resources/print_preview/data/user_manager.ts +++ b/chrome/browser/resources/print_preview/data/user_manager.ts
@@ -20,7 +20,7 @@ const PrintPreviewUserManagerElementBase = WebUIListenerMixin(PolymerElement); -export class PrintPreviewUserManagerElement extends +class PrintPreviewUserManagerElement extends PrintPreviewUserManagerElementBase { static get is() { return 'print-preview-user-manager';
diff --git a/chrome/browser/resources/print_preview/print_preview.ts b/chrome/browser/resources/print_preview/print_preview.ts index 09693e743..e9dc09f 100644 --- a/chrome/browser/resources/print_preview/print_preview.ts +++ b/chrome/browser/resources/print_preview/print_preview.ts
@@ -29,7 +29,6 @@ export {ScalingType} from './data/scaling.js'; export {Size} from './data/size.js'; export {Error, State} from './data/state.js'; -export {PrintPreviewUserManagerElement} from './data/user_manager.js'; export {BackgroundGraphicsModeRestriction, CapabilitiesResponse, ColorModeRestriction, DuplexModeRestriction, NativeInitialSettings, NativeLayer, NativeLayerImpl} from './native_layer.js'; // <if expr="chromeos or lacros"> export {PinModeRestriction} from './native_layer.js';
diff --git a/chrome/browser/resources/print_preview/ui/settings_select.ts b/chrome/browser/resources/print_preview/ui/settings_select.ts index 30c77f7..25aeae40 100644 --- a/chrome/browser/resources/print_preview/ui/settings_select.ts +++ b/chrome/browser/resources/print_preview/ui/settings_select.ts
@@ -8,7 +8,7 @@ import {assert, assertNotReached} from 'chrome://resources/js/assert.m.js'; import {html, PolymerElement} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js'; -import {CapabilityWithReset, SelectOption} from '../data/cdd.js'; +import {SelectOption} from '../data/cdd.js'; import {getStringForCurrentLocale} from '../print_preview_utils.js'; import {SelectMixin} from './select_mixin.js'; @@ -40,7 +40,7 @@ } ariaLabel: string; - capability: CapabilityWithReset&{option: SelectOption[]}; + capability: SelectOption[]; settingName: string; disabled: boolean;
diff --git a/chrome/browser/safe_browsing/incident_reporting/extension_data_collection.cc b/chrome/browser/safe_browsing/incident_reporting/extension_data_collection.cc index d09e7a8..c0cd773 100644 --- a/chrome/browser/safe_browsing/incident_reporting/extension_data_collection.cc +++ b/chrome/browser/safe_browsing/incident_reporting/extension_data_collection.cc
@@ -51,10 +51,9 @@ extension_info->set_state(Info::STATE_TERMINATED); extension_info->set_type(extension.GetType()); - std::string update_url; - if (extension.manifest()->GetString(extensions::manifest_keys::kUpdateURL, - &update_url)) { - extension_info->set_update_url(update_url); + if (const std::string* update_url = extension.manifest()->FindStringPath( + extensions::manifest_keys::kUpdateURL)) { + extension_info->set_update_url(*update_url); } extension_info->set_installed_by_default(
diff --git a/chrome/browser/sharing_hub/sharing_hub_features.cc b/chrome/browser/sharing_hub/sharing_hub_features.cc index 96dcc4e..fe0aa58 100644 --- a/chrome/browser/sharing_hub/sharing_hub_features.cc +++ b/chrome/browser/sharing_hub/sharing_hub_features.cc
@@ -20,9 +20,9 @@ bool SharingHubDisabledByPolicy(content::BrowserContext* context) { #if !defined(OS_ANDROID) && !defined(OS_CHROMEOS) const PrefService* prefs = Profile::FromBrowserContext(context)->GetPrefs(); - return prefs->GetBoolean(prefs::kDesktopSharingHubEnabled); + return !prefs->GetBoolean(prefs::kDesktopSharingHubEnabled); #else - return true; + return false; #endif }
diff --git a/chrome/browser/ui/BUILD.gn b/chrome/browser/ui/BUILD.gn index 7cc9513f..5070e8d 100644 --- a/chrome/browser/ui/BUILD.gn +++ b/chrome/browser/ui/BUILD.gn
@@ -2898,6 +2898,7 @@ "//ash/components/disks", "//ash/components/drivefs", "//ash/components/drivefs/mojom:mojom", + "//ash/components/login/auth", "//ash/components/login/session", "//ash/components/peripheral_notification", "//ash/components/phonehub", @@ -3011,7 +3012,6 @@ "//chromeos/dbus/userdataauth", "//chromeos/dbus/userdataauth:userdataauth_proto", "//chromeos/dbus/util", - "//chromeos/login/auth", "//chromeos/login/login_state", "//chromeos/network", "//chromeos/printing",
diff --git a/chrome/browser/ui/android/omnibox/java/src/org/chromium/chrome/browser/omnibox/suggestions/CachedZeroSuggestionsManager.java b/chrome/browser/ui/android/omnibox/java/src/org/chromium/chrome/browser/omnibox/suggestions/CachedZeroSuggestionsManager.java index ff7dfa7..e4c24ce 100644 --- a/chrome/browser/ui/android/omnibox/java/src/org/chromium/chrome/browser/omnibox/suggestions/CachedZeroSuggestionsManager.java +++ b/chrome/browser/ui/android/omnibox/java/src/org/chromium/chrome/browser/omnibox/suggestions/CachedZeroSuggestionsManager.java
@@ -182,7 +182,7 @@ AutocompleteMatch suggestion = new AutocompleteMatch(nativeType, subtypes, isSearchType, 0, 0, displayText, classifications, description, classifications, null, null, url, GURL.emptyGURL(), null, isDeletable, postContentType, postData, groupId, - null, null, false, null); + null, null, false, null, null); suggestions.add(suggestion); }
diff --git a/chrome/browser/ui/app_list/app_service/app_service_context_menu.cc b/chrome/browser/ui/app_list/app_service/app_service_context_menu.cc index 0d8e24e..db7d178 100644 --- a/chrome/browser/ui/app_list/app_service/app_service_context_menu.cc +++ b/chrome/browser/ui/app_list/app_service/app_service_context_menu.cc
@@ -104,6 +104,20 @@ controller->ShowOptionsPage(profile, app_id); } +void ExecuteLaunchCommand(app_list::AppContextMenuDelegate* delegate, + int event_flags, + bool post_task) { + DCHECK(delegate); + if (post_task) { + content::GetUIThreadTaskRunner({})->PostTask( + FROM_HERE, base::BindOnce(ExecuteLaunchCommand, delegate, event_flags, + /*post_task=*/false)); + return; + } + + delegate->ExecuteLaunchCommand(event_flags); +} + } // namespace AppServiceContextMenu::AppServiceContextMenu( @@ -164,7 +178,7 @@ controller()->GetAppListDisplayId()); switch (command_id) { case ash::LAUNCH_NEW: - delegate()->ExecuteLaunchCommand(event_flags); + ExecuteLaunchCommand(delegate(), event_flags, /*post_task=*/true); ash::full_restore::FullRestoreService::MaybeCloseNotification(profile()); break;
diff --git a/chrome/browser/ui/ash/assistant/assistant_test_mixin.cc b/chrome/browser/ui/ash/assistant/assistant_test_mixin.cc index de06155..dbe8ce27 100644 --- a/chrome/browser/ui/ash/assistant/assistant_test_mixin.cc +++ b/chrome/browser/ui/ash/assistant/assistant_test_mixin.cc
@@ -11,6 +11,7 @@ #include "ash/assistant/model/ui/assistant_card_element.h" #include "ash/assistant/ui/assistant_ui_constants.h" #include "ash/assistant/ui/main_stage/assistant_ui_element_view.h" +#include "ash/components/login/auth/user_context.h" #include "ash/constants/ash_switches.h" #include "ash/public/cpp/assistant/assistant_state.h" #include "ash/public/cpp/test/assistant_test_api.h" @@ -24,7 +25,6 @@ #include "chrome/browser/profiles/profile_manager.h" #include "chrome/browser/ui/ash/assistant/test_support/fake_s3_server.h" #include "chrome/test/base/mixin_based_in_process_browser_test.h" -#include "chromeos/login/auth/user_context.h" #include "components/account_id/account_id.h" #include "components/language/core/browser/pref_names.h" #include "google_apis/gaia/gaia_urls.h"
diff --git a/chrome/browser/ui/ash/in_session_auth_dialog_client.h b/chrome/browser/ui/ash/in_session_auth_dialog_client.h index 8115e14fd..512023c 100644 --- a/chrome/browser/ui/ash/in_session_auth_dialog_client.h +++ b/chrome/browser/ui/ash/in_session_auth_dialog_client.h
@@ -5,13 +5,13 @@ #ifndef CHROME_BROWSER_UI_ASH_IN_SESSION_AUTH_DIALOG_CLIENT_H_ #define CHROME_BROWSER_UI_ASH_IN_SESSION_AUTH_DIALOG_CLIENT_H_ +#include "ash/components/login/auth/auth_status_consumer.h" +#include "ash/components/login/auth/extended_authenticator.h" +#include "ash/components/login/auth/user_context.h" #include "ash/public/cpp/in_session_auth_dialog_client.h" #include "base/callback.h" #include "base/memory/scoped_refptr.h" #include "base/memory/weak_ptr.h" -#include "chromeos/login/auth/auth_status_consumer.h" -#include "chromeos/login/auth/extended_authenticator.h" -#include "chromeos/login/auth/user_context.h" #include "third_party/abseil-cpp/absl/types/optional.h" namespace aura {
diff --git a/chrome/browser/ui/ash/in_session_auth_dialog_client_unittest.cc b/chrome/browser/ui/ash/in_session_auth_dialog_client_unittest.cc index 787ef9b..2f9d7783 100644 --- a/chrome/browser/ui/ash/in_session_auth_dialog_client_unittest.cc +++ b/chrome/browser/ui/ash/in_session_auth_dialog_client_unittest.cc
@@ -4,6 +4,7 @@ #include "chrome/browser/ui/ash/in_session_auth_dialog_client.h" +#include "ash/components/login/auth/fake_extended_authenticator.h" #include "ash/public/cpp/in_session_auth_dialog_client.h" #include "ash/public/cpp/in_session_auth_dialog_controller.h" #include "base/callback.h" @@ -12,7 +13,6 @@ #include "base/test/bind.h" #include "chrome/browser/ash/login/users/fake_chrome_user_manager.h" #include "chrome/browser/ash/profiles/profile_helper.h" -#include "chromeos/login/auth/fake_extended_authenticator.h" #include "components/account_id/account_id.h" #include "components/user_manager/scoped_user_manager.h" #include "content/public/test/browser_task_environment.h"
diff --git a/chrome/browser/ui/ash/projector/projector_app_client_impl.cc b/chrome/browser/ui/ash/projector/projector_app_client_impl.cc index 737a4316..31bf81b 100644 --- a/chrome/browser/ui/ash/projector/projector_app_client_impl.cc +++ b/chrome/browser/ui/ash/projector/projector_app_client_impl.cc
@@ -96,9 +96,9 @@ } void ProjectorAppClientImpl::OnNewScreencastPreconditionChanged( - bool can_start) { + const ash::NewScreencastPrecondition& precondition) { for (auto& observer : observers_) - observer.OnNewScreencastPreconditionChanged(can_start); + observer.OnNewScreencastPreconditionChanged(precondition); } const std::set<ash::PendingScreencast>&
diff --git a/chrome/browser/ui/ash/projector/projector_app_client_impl.h b/chrome/browser/ui/ash/projector/projector_app_client_impl.h index 794db21..a5930c7a2 100644 --- a/chrome/browser/ui/ash/projector/projector_app_client_impl.h +++ b/chrome/browser/ui/ash/projector/projector_app_client_impl.h
@@ -39,7 +39,8 @@ void RemoveObserver(Observer* observer) override; signin::IdentityManager* GetIdentityManager() override; network::mojom::URLLoaderFactory* GetUrlLoaderFactory() override; - void OnNewScreencastPreconditionChanged(bool can_start) override; + void OnNewScreencastPreconditionChanged( + const ash::NewScreencastPrecondition& precondition) override; const std::set<ash::PendingScreencast>& GetPendingScreencasts() const override; bool ShouldDownloadSoda() override;
diff --git a/chrome/browser/ui/ash/projector/projector_client_impl.cc b/chrome/browser/ui/ash/projector/projector_client_impl.cc index 3350747..fd63d61 100644 --- a/chrome/browser/ui/ash/projector/projector_client_impl.cc +++ b/chrome/browser/ui/ash/projector/projector_client_impl.cc
@@ -169,6 +169,7 @@ } void ProjectorClientImpl::OnNewScreencastPreconditionChanged( - bool can_start) const { - ash::ProjectorAppClient::Get()->OnNewScreencastPreconditionChanged(can_start); + const ash::NewScreencastPrecondition& precondition) const { + ash::ProjectorAppClient::Get()->OnNewScreencastPreconditionChanged( + precondition); }
diff --git a/chrome/browser/ui/ash/projector/projector_client_impl.h b/chrome/browser/ui/ash/projector/projector_client_impl.h index c2fe2c9..b6009d4 100644 --- a/chrome/browser/ui/ash/projector/projector_client_impl.h +++ b/chrome/browser/ui/ash/projector/projector_client_impl.h
@@ -48,7 +48,8 @@ bool IsDriveFsMounted() const override; void OpenProjectorApp() const override; void MinimizeProjectorApp() const override; - void OnNewScreencastPreconditionChanged(bool can_start) const override; + void OnNewScreencastPreconditionChanged( + const ash::NewScreencastPrecondition& precondition) const override; // SpeechRecognizerDelegate: void OnSpeechResult(
diff --git a/chrome/browser/ui/omnibox/omnibox_pedal_implementations.cc b/chrome/browser/ui/omnibox/omnibox_pedal_implementations.cc index 3456b7b..d2e8131c 100644 --- a/chrome/browser/ui/omnibox/omnibox_pedal_implementations.cc +++ b/chrome/browser/ui/omnibox/omnibox_pedal_implementations.cc
@@ -85,7 +85,6 @@ // ============================================================================= -#if !defined(OS_ANDROID) class OmniboxPedalManagePasswords : public OmniboxPedal { public: OmniboxPedalManagePasswords() @@ -123,11 +122,9 @@ protected: ~OmniboxPedalManagePasswords() override = default; }; -#endif // !defined(OS_ANDROID) // ============================================================================= -#if !defined(OS_ANDROID) class OmniboxPedalUpdateCreditCard : public OmniboxPedal { public: OmniboxPedalUpdateCreditCard() @@ -166,11 +163,9 @@ protected: ~OmniboxPedalUpdateCreditCard() override = default; }; -#endif // !defined(OS_ANDROID) // ============================================================================= -#if !defined(OS_ANDROID) class OmniboxPedalLaunchIncognito : public OmniboxPedal { public: OmniboxPedalLaunchIncognito() @@ -218,7 +213,6 @@ protected: ~OmniboxPedalLaunchIncognito() override = default; }; -#endif // !defined(OS_ANDROID) // ============================================================================= @@ -318,7 +312,6 @@ // ============================================================================= -#if !defined(OS_ANDROID) class OmniboxPedalRunChromeSafetyCheck : public OmniboxPedal { public: OmniboxPedalRunChromeSafetyCheck() @@ -362,7 +355,6 @@ protected: ~OmniboxPedalRunChromeSafetyCheck() override = default; }; -#endif // !defined(OS_ANDROID) // ============================================================================= @@ -530,7 +522,6 @@ // ============================================================================= -#if !defined(OS_ANDROID) class OmniboxPedalManageSiteSettings : public OmniboxPedal { public: OmniboxPedalManageSiteSettings() @@ -564,7 +555,6 @@ protected: ~OmniboxPedalManageSiteSettings() override = default; }; -#endif // !defined(OS_ANDROID) // ============================================================================= @@ -1115,7 +1105,6 @@ // ============================================================================= -#if !defined(OS_ANDROID) class OmniboxPedalPlayChromeDinoGame : public OmniboxPedal { public: OmniboxPedalPlayChromeDinoGame() @@ -1183,7 +1172,6 @@ protected: ~OmniboxPedalPlayChromeDinoGame() override = default; }; -#endif // !defined(OS_ANDROID) // ============================================================================= @@ -1268,7 +1256,6 @@ // ============================================================================= -#if !defined(OS_ANDROID) class OmniboxPedalManageChromeSettings : public OmniboxPedal { public: OmniboxPedalManageChromeSettings() @@ -1300,7 +1287,6 @@ protected: ~OmniboxPedalManageChromeSettings() override = default; }; -#endif // !defined(OS_ANDROID) // ============================================================================= @@ -1340,7 +1326,6 @@ // ============================================================================= -#if !defined(OS_ANDROID) class OmniboxPedalViewChromeHistory : public OmniboxPedal { public: OmniboxPedalViewChromeHistory() @@ -1372,7 +1357,6 @@ protected: ~OmniboxPedalViewChromeHistory() override = default; }; -#endif // !defined(OS_ANDROID) // ============================================================================= @@ -1425,7 +1409,6 @@ // ============================================================================= -#if !defined(OS_ANDROID) class OmniboxPedalManageChromeAccessibility : public OmniboxPedal { public: OmniboxPedalManageChromeAccessibility() @@ -1457,7 +1440,6 @@ protected: ~OmniboxPedalManageChromeAccessibility() override = default; }; -#endif // !defined(OS_ANDROID) // ============================================================================= @@ -1631,6 +1613,15 @@ #if defined(OS_ANDROID) if (OmniboxFieldTrial::IsPedalsAndroidBatch1Enabled()) { add(new OmniboxPedalClearBrowsingData(incognito)); + add(new OmniboxPedalManagePasswords()); + add(new OmniboxPedalUpdateCreditCard()); + add(new OmniboxPedalLaunchIncognito()); + add(new OmniboxPedalRunChromeSafetyCheck()); + add(new OmniboxPedalPlayChromeDinoGame()); + add(new OmniboxPedalManageSiteSettings()); + add(new OmniboxPedalManageChromeSettings()); + add(new OmniboxPedalViewChromeHistory()); + add(new OmniboxPedalManageChromeAccessibility()); } #else // defined(OS_ANDROID)
diff --git a/chrome/browser/ui/search/ntp_user_data_logger.cc b/chrome/browser/ui/search/ntp_user_data_logger.cc index 221687b..66ac34aa 100644 --- a/chrome/browser/ui/search/ntp_user_data_logger.cc +++ b/chrome/browser/ui/search/ntp_user_data_logger.cc
@@ -10,6 +10,7 @@ #include "base/metrics/histogram_functions.h" #include "base/metrics/histogram_macros.h" #include "base/metrics/user_metrics.h" +#include "base/trace_event/trace_event.h" #include "chrome/browser/after_startup_task_utils.h" #include "chrome/browser/search/background/ntp_custom_background_service.h" #include "chrome/browser/search/background/ntp_custom_background_service_factory.h" @@ -24,6 +25,8 @@ namespace { +constexpr char kUIEventCategory[] = "ui"; + // Logs CustomizedShortcutSettings on the NTP. void LogCustomizedShortcutSettings(bool using_most_visited, bool is_visible) { CustomizedShortcutSettings setting; @@ -276,12 +279,17 @@ UMA_HISTOGRAM_CUSTOM_TIMES(name, sample, base::Milliseconds(1), \ base::Seconds(60), 100) -NTPUserDataLogger::NTPUserDataLogger(Profile* profile, const GURL& ntp_url) - : has_emitted_(false), - should_record_doodle_load_time_(true), - during_startup_(!AfterStartupTaskUtils::IsBrowserStartupComplete()), +NTPUserDataLogger::NTPUserDataLogger(Profile* profile, + const GURL& ntp_url, + base::Time ntp_navigation_start_time) + : during_startup_(!AfterStartupTaskUtils::IsBrowserStartupComplete()), ntp_url_(ntp_url), - profile_(profile) {} + profile_(profile), + // TODO(https://crbug.com/1280310): Migrate NTP navigation startup time + // from base::Time to base::TimeTicks top avoid time glitches. + ntp_navigation_start_time_( + base::TimeTicks::UnixEpoch() + + (ntp_navigation_start_time - base::Time::UnixEpoch())) {} NTPUserDataLogger::~NTPUserDataLogger() = default; @@ -328,6 +336,8 @@ break; case NTP_ONE_GOOGLE_BAR_SHOWN: UMA_HISTOGRAM_LOAD_TIME("NewTabPage.OneGoogleBar.ShownTime", time); + EmitNtpTraceEvent("NewTabPage.OneGoogleBar.ShownTime", time); + break; case NTP_BACKGROUND_CUSTOMIZED: case NTP_SHORTCUT_CUSTOMIZED: @@ -372,6 +382,8 @@ break; case NTP_MIDDLE_SLOT_PROMO_SHOWN: UMA_HISTOGRAM_LOAD_TIME("NewTabPage.Promos.ShownTime", time); + EmitNtpTraceEvent("NewTabPage.Promos.ShownTime", time); + break; case NTP_MIDDLE_SLOT_PROMO_LINK_CLICKED: UMA_HISTOGRAM_EXACT_LINEAR("NewTabPage.Promos.LinkClicked", 1, 1); @@ -401,6 +413,7 @@ break; case NTP_APP_RENDERED: UMA_HISTOGRAM_LOAD_TIME("NewTabPage.MainUi.ShownTime", time); + EmitNtpTraceEvent("NewTabPage.MainUi.ShownTime", time); break; } } @@ -513,6 +526,16 @@ during_startup_ = false; } +void NTPUserDataLogger::EmitNtpTraceEvent(const char* event_name, + base::TimeDelta duration) { + TRACE_EVENT_NESTABLE_ASYNC_BEGIN_WITH_TIMESTAMP0(kUIEventCategory, event_name, + TRACE_ID_LOCAL(this), + ntp_navigation_start_time_); + TRACE_EVENT_NESTABLE_ASYNC_END_WITH_TIMESTAMP0( + kUIEventCategory, event_name, TRACE_ID_LOCAL(this), + ntp_navigation_start_time_ + duration); +} + void NTPUserDataLogger::RecordDoodleImpression(base::TimeDelta time, bool is_cta, bool from_cache) { @@ -520,6 +543,8 @@ is_cta ? LOGO_IMPRESSION_TYPE_CTA : LOGO_IMPRESSION_TYPE_STATIC; UMA_HISTOGRAM_ENUMERATION("NewTabPage.LogoShown", logo_type, LOGO_IMPRESSION_TYPE_MAX); + EmitNtpTraceEvent("NewTabPage.LogoShown", time); + if (from_cache) { UMA_HISTOGRAM_ENUMERATION("NewTabPage.LogoShown.FromCache", logo_type, LOGO_IMPRESSION_TYPE_MAX);
diff --git a/chrome/browser/ui/search/ntp_user_data_logger.h b/chrome/browser/ui/search/ntp_user_data_logger.h index e4ef648..86624f9 100644 --- a/chrome/browser/ui/search/ntp_user_data_logger.h +++ b/chrome/browser/ui/search/ntp_user_data_logger.h
@@ -26,7 +26,9 @@ class NTPUserDataLogger { public: // Creates a NTPUserDataLogger. MUST be called only when the NTP is active. - NTPUserDataLogger(Profile* profile, const GURL& ntp_url); + NTPUserDataLogger(Profile* profile, + const GURL& ntp_url, + base::Time ntp_navigation_start_time); NTPUserDataLogger(const NTPUserDataLogger&) = delete; NTPUserDataLogger& operator=(const NTPUserDataLogger&) = delete; @@ -70,6 +72,8 @@ bool using_most_visited, bool is_visible); + void EmitNtpTraceEvent(const char* event_name, base::TimeDelta duration); + void RecordDoodleImpression(base::TimeDelta time, bool is_cta, bool from_cache); @@ -92,9 +96,9 @@ logged_impressions_; // Whether we have already emitted NTP stats for this web contents. - bool has_emitted_; + bool has_emitted_ = false; - bool should_record_doodle_load_time_; + bool should_record_doodle_load_time_ = true; // Are stats being logged during Chrome startup? bool during_startup_; @@ -104,6 +108,9 @@ // The profile in which this New Tab Page was loaded. raw_ptr<Profile> profile_; + + // Keeps the starting time of NTP navigation. + const base::TimeTicks ntp_navigation_start_time_; }; #endif // CHROME_BROWSER_UI_SEARCH_NTP_USER_DATA_LOGGER_H_
diff --git a/chrome/browser/ui/search/ntp_user_data_logger_unittest.cc b/chrome/browser/ui/search/ntp_user_data_logger_unittest.cc index 5d03715..5ea8a2f 100644 --- a/chrome/browser/ui/search/ntp_user_data_logger_unittest.cc +++ b/chrome/browser/ui/search/ntp_user_data_logger_unittest.cc
@@ -70,7 +70,7 @@ class TestNTPUserDataLogger : public NTPUserDataLogger { public: explicit TestNTPUserDataLogger(const GURL& ntp_url) - : NTPUserDataLogger(nullptr, ntp_url) {} + : NTPUserDataLogger(nullptr, ntp_url, base::Time::Now()) {} ~TestNTPUserDataLogger() override {}
diff --git a/chrome/browser/ui/views/extensions/extensions_tabbed_menu_view.cc b/chrome/browser/ui/views/extensions/extensions_tabbed_menu_view.cc index 4590489..ed660cc 100644 --- a/chrome/browser/ui/views/extensions/extensions_tabbed_menu_view.cc +++ b/chrome/browser/ui/views/extensions/extensions_tabbed_menu_view.cc
@@ -5,14 +5,19 @@ #include "chrome/browser/ui/views/extensions/extensions_tabbed_menu_view.h" #include <algorithm> +#include <memory> #include <string> #include "base/feature_list.h" #include "base/i18n/case_conversion.h" +#include "base/strings/utf_string_conversions.h" #include "chrome/browser/ui/browser.h" +#include "chrome/browser/ui/extensions/extension_action_view_controller.h" #include "chrome/browser/ui/toolbar/toolbar_action_view_controller.h" #include "chrome/browser/ui/toolbar/toolbar_actions_model.h" #include "chrome/browser/ui/ui_features.h" +#include "chrome/browser/ui/views/chrome_layout_provider.h" +#include "chrome/browser/ui/views/chrome_typography.h" #include "chrome/browser/ui/views/extensions/extensions_menu_item_view.h" #include "chrome/browser/ui/views/extensions/extensions_toolbar_container.h" #include "chrome/grit/generated_resources.h" @@ -95,7 +100,14 @@ browser_(browser), extensions_container_(extensions_container), toolbar_model_(ToolbarActionsModel::Get(browser_->profile())), - allow_pinning_(allow_pinning) { + allow_pinning_(allow_pinning), + requests_access_{ + nullptr, nullptr, + IDS_EXTENSIONS_MENU_SITE_ACCESS_TAB_REQUESTS_ACCESS_SECTION_TITLE, + ToolbarActionViewController::PageInteractionStatus::kPending}, + has_access_{nullptr, nullptr, + IDS_EXTENSIONS_MENU_SITE_ACCESS_TAB_HAS_ACCESS_SECTION_TITLE, + ToolbarActionViewController::PageInteractionStatus::kActive} { // Ensure layer masking is used for the extensions menu to ensure buttons with // layer effects sitting flush with the bottom of the bubble are clipped // appropriately. @@ -115,8 +127,6 @@ // Let anchor view's MenuButtonController handle the highlight. set_highlight_button_when_shown(false); - set_fixed_width(views::LayoutProvider::Get()->GetDistanceMetric( - views::DISTANCE_BUBBLE_PREFERRED_WIDTH)); SetLayoutManager(std::make_unique<views::BoxLayout>( views::BoxLayout::Orientation::kVertical)); @@ -182,6 +192,26 @@ return menu_item_views; } +std::vector<ExtensionsMenuItemView*> +ExtensionsTabbedMenuView::GetHasAccessItemsForTesting() const { + std::vector<ExtensionsMenuItemView*> menu_item_views; + if (IsShowing()) { + for (views::View* view : has_access_.items->children()) + menu_item_views.push_back(GetAsMenuItemView(view)); + } + return menu_item_views; +} + +std::vector<ExtensionsMenuItemView*> +ExtensionsTabbedMenuView::GetRequestsAccessItemsForTesting() const { + std::vector<ExtensionsMenuItemView*> menu_item_views; + if (IsShowing()) { + for (views::View* view : requests_access_.items->children()) + menu_item_views.push_back(GetAsMenuItemView(view)); + } + return menu_item_views; +} + size_t ExtensionsTabbedMenuView::GetSelectedTabIndex() const { return tabbed_pane_->GetSelectedTabIndex(); } @@ -204,6 +234,8 @@ Update(); } +// TODO(crbug.com/1263310): Update site access items for toolbar changes. + void ExtensionsTabbedMenuView::OnToolbarActionAdded( const ToolbarActionsModel::ActionId& action_id) { auto extension_name = toolbar_model_->GetExtensionName(action_id); @@ -259,9 +291,8 @@ tabbed_pane_ = AddChildView(std::make_unique<views::TabbedPane>()); tabbed_pane_->SetFocusBehavior(views::View::FocusBehavior::NEVER); - // TODO(crbug.com/1263310): Populate site access tab. CreateTab(tabbed_pane_, 0, IDS_EXTENSIONS_MENU_SITE_ACCESS_TAB_TITLE, - std::make_unique<views::View>()); + CreateSiteAccessContainer()); auto installed_items = std::make_unique<views::View>(); installed_items->SetLayoutManager(std::make_unique<views::BoxLayout>( @@ -280,8 +311,13 @@ toolbar_model_->action_ids().end()); std::sort(sorted_ids.begin(), sorted_ids.end(), sort_by_name); - for (size_t i = 0; i < sorted_ids.size(); ++i) + for (size_t i = 0; i < sorted_ids.size(); ++i) { CreateAndInsertInstalledExtension(sorted_ids[i], i); + CreateAndInsertSiteAccessItem(sorted_ids[i]); + } + + UpdateSiteAccessSectionsVisibility(); + ConsistencyCheck(); } @@ -292,6 +328,61 @@ } } +std::unique_ptr<views::View> +ExtensionsTabbedMenuView::CreateSiteAccessContainer() { + auto site_access_container = std::make_unique<views::View>(); + site_access_container->SetLayoutManager(std::make_unique<views::BoxLayout>( + views::BoxLayout::Orientation::kVertical)); + + auto current_site = base::UTF8ToUTF16(browser_->tab_strip_model() + ->GetActiveWebContents() + ->GetLastCommittedURL() + .host()); + + auto create_section = + [current_site](ExtensionsTabbedMenuView::SiteAccessSection* section) { + auto section_container = std::make_unique<views::View>(); + section->container = section_container.get(); + section_container->SetLayoutManager(std::make_unique<views::BoxLayout>( + views::BoxLayout::Orientation::kVertical)); + + const int horizontal_spacing = + ChromeLayoutProvider::Get()->GetDistanceMetric( + views::DISTANCE_BUTTON_HORIZONTAL_PADDING); + + // Add an emphasized short header explaining the section. + auto header = std::make_unique<views::Label>( + l10n_util::GetStringFUTF16(section->header_string_id, current_site), + ChromeTextContext::CONTEXT_DIALOG_BODY_TEXT_SMALL, + ChromeTextStyle::STYLE_EMPHASIZED); + header->SetHorizontalAlignment(gfx::ALIGN_LEFT); + header->SetBorder(views::CreateEmptyBorder( + ChromeLayoutProvider::Get()->GetDistanceMetric( + DISTANCE_CONTROL_LIST_VERTICAL), + horizontal_spacing, 0, horizontal_spacing)); + section_container->AddChildView(std::move(header)); + + // Add an empty section for the menu items of the section. Items will be + // populated later. + auto items = std::make_unique<views::View>(); + items->SetLayoutManager(std::make_unique<views::BoxLayout>( + views::BoxLayout::Orientation::kVertical)); + section->items = items.get(); + section_container->AddChildView(std::move(items)); + + // Start off with the section invisible. We'll update it as we add items + // if necessary. + section_container->SetVisible(false); + + return section_container; + }; + + site_access_container->AddChildView(create_section(&requests_access_)); + site_access_container->AddChildView(create_section(&has_access_)); + + return site_access_container; +} + void ExtensionsTabbedMenuView::CreateAndInsertInstalledExtension( const ToolbarActionsModel::ActionId& id, int index) { @@ -304,6 +395,48 @@ installed_items_->AddChildViewAt(std::move(item), index); } +void ExtensionsTabbedMenuView::CreateAndInsertSiteAccessItem( + const ToolbarActionsModel::ActionId& id) { + std::unique_ptr<ExtensionActionViewController> controller = + ExtensionActionViewController::Create(id, browser_, + extensions_container_); + auto item = std::make_unique<ExtensionsMenuItemView>( + ExtensionsMenuItemView::MenuItemType::kSiteAccess, browser_, + std::move(controller), allow_pinning_); + + const ToolbarActionViewController::PageInteractionStatus status = + item->view_controller()->GetPageInteractionStatus( + browser_->tab_strip_model()->GetActiveWebContents()); + + switch (status) { + case ToolbarActionViewController::PageInteractionStatus::kNone: + break; + case ToolbarActionViewController::PageInteractionStatus::kPending: + requests_access_.items->AddChildView(std::move(item)); + break; + case ToolbarActionViewController::PageInteractionStatus::kActive: + has_access_.items->AddChildView(std::move(item)); + break; + } +} + +void ExtensionsTabbedMenuView::UpdateSiteAccessSectionsVisibility() { + auto update_section = [](SiteAccessSection* section) { + bool should_be_visible = !section->items->children().empty(); + if (section->container->GetVisible() != should_be_visible) + section->container->SetVisible(should_be_visible); + }; + + update_section(&has_access_); + update_section(&requests_access_); + + // TODO(crbug.com/1263310): If no extensions have or request access to the + // current site, show respective message. + + // TODO(crbug.com/1263310): If user is on a chrome:-scheme page, show + // respective message. +} + void ExtensionsTabbedMenuView::ConsistencyCheck() { #if DCHECK_IS_ON() const base::flat_set<std::string>& action_ids = toolbar_model_->action_ids();
diff --git a/chrome/browser/ui/views/extensions/extensions_tabbed_menu_view.h b/chrome/browser/ui/views/extensions/extensions_tabbed_menu_view.h index 02e22ea..a976861 100644 --- a/chrome/browser/ui/views/extensions/extensions_tabbed_menu_view.h +++ b/chrome/browser/ui/views/extensions/extensions_tabbed_menu_view.h
@@ -14,6 +14,7 @@ #include "ui/views/bubble/bubble_dialog_delegate_view.h" namespace views { +class View; class TabbedPane; } // namespace views @@ -62,6 +63,14 @@ // exists. std::vector<ExtensionsMenuItemView*> GetInstalledItemsForTesting() const; + // Returns the currently-showing `has_access_` extension items in the site + // access tab, if any exists. + std::vector<ExtensionsMenuItemView*> GetHasAccessItemsForTesting() const; + + // Returns the currently-showing `requests_access_` extension items in the + // site access tab, if any exists. + std::vector<ExtensionsMenuItemView*> GetRequestsAccessItemsForTesting() const; + // Returns the index of the currently selected tab. size_t GetSelectedTabIndex() const; @@ -88,17 +97,43 @@ void OnToolbarPinnedActionsChanged() override; private: + struct SiteAccessSection { + // The root view for this section used to toggle the visibility of the + // entire section (depending on whether there are any menu items). + raw_ptr<views::View> container; + + // The view containing only the menu items for this section. + raw_ptr<views::View> items; + + // The id of the string to use for the section heading. Does not include the + // current site string. + const int header_string_id; + + // The PageInteractionStatus that this section is handling. + const ToolbarActionViewController::PageInteractionStatus page_status; + }; + // Initially creates the tabs. void Populate(); // Updates the menu. void Update(); + // Creates and returns the site access container with empty sections. + std::unique_ptr<views::View> CreateSiteAccessContainer(); + // Adds a menu item in the installed extensions for a newly-added extension. void CreateAndInsertInstalledExtension( const ToolbarActionsModel::ActionId& id, int index); + // Adds a menu item in the corresponding site access section. + void CreateAndInsertSiteAccessItem(const ToolbarActionsModel::ActionId& id); + + // Updates the visibility of the site access sections. A given section should + // be visible if there are any extensions displayed in it. + void UpdateSiteAccessSectionsVisibility(); + // Runs a set of consistency checks on the appearance of the menu. This is a // no-op if DCHECKs are disabled. void ConsistencyCheck(); @@ -117,6 +152,10 @@ // separated for easy insertion and iteration of menu items. The children are // guaranteed to only be ExtensionMenuItemViews. views::View* installed_items_ = nullptr; + + // The different sections in the site access tab. + SiteAccessSection requests_access_; + SiteAccessSection has_access_; }; #endif // CHROME_BROWSER_UI_VIEWS_EXTENSIONS_EXTENSIONS_TABBED_MENU_VIEW_H_
diff --git a/chrome/browser/ui/views/extensions/extensions_tabbed_menu_view_unittest.cc b/chrome/browser/ui/views/extensions/extensions_tabbed_menu_view_unittest.cc index 1f86629..81e9185 100644 --- a/chrome/browser/ui/views/extensions/extensions_tabbed_menu_view_unittest.cc +++ b/chrome/browser/ui/views/extensions/extensions_tabbed_menu_view_unittest.cc
@@ -67,6 +67,10 @@ ExtensionsTabbedMenuViewUnitTest& operator=( const ExtensionsTabbedMenuViewUnitTest&) = delete; + content::WebContentsTester* web_contents_tester() { + return web_contents_tester_; + } + ExtensionsToolbarButton* extensions_button() { return extensions_container() ->GetExtensionsToolbarControls() @@ -84,11 +88,23 @@ return ExtensionsTabbedMenuView::GetExtensionsTabbedMenuViewForTesting() ->GetInstalledItemsForTesting(); } + std::vector<ExtensionsMenuItemView*> has_access_items() { + return ExtensionsTabbedMenuView::GetExtensionsTabbedMenuViewForTesting() + ->GetHasAccessItemsForTesting(); + } + std::vector<ExtensionsMenuItemView*> requests_access_items() { + return ExtensionsTabbedMenuView::GetExtensionsTabbedMenuViewForTesting() + ->GetRequestsAccessItemsForTesting(); + } // Asserts there is exactly 1 menu item and then returns it. ExtensionsMenuItemView* GetOnlyInstalledMenuItem(); - void ShowTabbedMenu(); + // Opens the tabbed menu in the installed tab. + void ShowInstalledTabInMenu(); + + // Opens the tabbed menu in the site access tab. + void ShowSiteAccessTabInMenu(); void ClickSiteAccessButton(); void ClickExtensionsButton(); @@ -99,8 +115,12 @@ extensions_tabbed_menu()->GetWidget()->LayoutRootViewIfNecessary(); } + // ExtensionsToolbarUnitTest: + void SetUp() override; + private: base::test::ScopedFeatureList scoped_feature_list_; + content::WebContentsTester* web_contents_tester_; }; ExtensionsTabbedMenuViewUnitTest::ExtensionsTabbedMenuViewUnitTest() { @@ -108,6 +128,13 @@ features::kExtensionsMenuAccessControl); } +void ExtensionsTabbedMenuViewUnitTest::SetUp() { + ExtensionsToolbarUnitTest::SetUp(); + // Menu needs web contents at construction, so we need to add them to every + // test. + web_contents_tester_ = AddWebContentsAndGetTester(); +} + ExtensionsMenuItemView* ExtensionsTabbedMenuViewUnitTest::GetOnlyInstalledMenuItem() { std::vector<ExtensionsMenuItemView*> items = installed_items(); @@ -118,12 +145,18 @@ return *items.begin(); } -void ExtensionsTabbedMenuViewUnitTest::ShowTabbedMenu() { +void ExtensionsTabbedMenuViewUnitTest::ShowInstalledTabInMenu() { ExtensionsTabbedMenuView::ShowBubble( extensions_button(), browser(), extensions_container(), ExtensionsToolbarButton::ButtonType::kExtensions, true); } +void ExtensionsTabbedMenuViewUnitTest::ShowSiteAccessTabInMenu() { + ExtensionsTabbedMenuView::ShowBubble( + extensions_button(), browser(), extensions_container(), + ExtensionsToolbarButton::ButtonType::kSiteAccess, true); +} + void ExtensionsTabbedMenuViewUnitTest::ClickSiteAccessButton() { ClickButton(site_access_button()); LayoutContainerIfNecessary(); @@ -146,16 +179,13 @@ } TEST_F(ExtensionsTabbedMenuViewUnitTest, ButtonOpensAndClosesCorrespondingTab) { - content::WebContentsTester* web_contents_tester = - AddWebContentsAndGetTester(); - // Load an extension with all urls permissions so the site access button is // visible. InstallExtensionWithHostPermissions("all_urls", {"<all_urls>"}); // Navigate to an url where the extension should have access to. const GURL url("http://www.a.com"); - web_contents_tester->NavigateAndCommit(url); + web_contents_tester()->NavigateAndCommit(url); WaitForAnimation(); EXPECT_TRUE(site_access_button()->GetVisible()); EXPECT_FALSE(ExtensionsTabbedMenuView::IsShowing()); @@ -184,16 +214,13 @@ } TEST_F(ExtensionsTabbedMenuViewUnitTest, TogglingButtonsClosesMenu) { - content::WebContentsTester* web_contents_tester = - AddWebContentsAndGetTester(); - // Load an extension with all urls permissions so the site access button is // visible. InstallExtensionWithHostPermissions("all_urls", {"<all_urls>"}); // Navigate to an url where the extension should have access to. const GURL url("http://www.a.com"); - web_contents_tester->NavigateAndCommit(url); + web_contents_tester()->NavigateAndCommit(url); WaitForAnimation(); EXPECT_TRUE(site_access_button()->GetVisible()); EXPECT_FALSE(ExtensionsTabbedMenuView::IsShowing()); @@ -232,7 +259,7 @@ constexpr char kExtensionName[] = "Test 1"; InstallExtension(kExtensionName); - ShowTabbedMenu(); + ShowInstalledTabInMenu(); ASSERT_EQ(installed_items().size(), 1u); EXPECT_EQ(base::UTF16ToUTF8((*installed_items().begin()) @@ -252,7 +279,7 @@ constexpr char kExtensionCName[] = "C Extension"; InstallExtension(kExtensionCName); - ShowTabbedMenu(); + ShowInstalledTabInMenu(); std::vector<ExtensionsMenuItemView*> items = installed_items(); ASSERT_EQ(items.size(), 4u); @@ -268,7 +295,7 @@ constexpr char kName[] = "Test Name"; InstallExtension(kName); - ShowTabbedMenu(); + ShowInstalledTabInMenu(); ExtensionsMenuItemView* installed_item = GetOnlyInstalledMenuItem(); ASSERT_TRUE(installed_item); @@ -297,7 +324,8 @@ constexpr char kExtensionC[] = "C Extension"; InstallExtension(kExtensionC); - ShowTabbedMenu(); + ShowInstalledTabInMenu(); + std::vector<ExtensionsMenuItemView*> items = installed_items(); // Verify the order of the extensions is A,B,C. @@ -355,7 +383,7 @@ InstalledTab_PinnedExtensionAppearsInAnotherWindow) { InstallExtension("Test Name"); - ShowTabbedMenu(); + ShowInstalledTabInMenu(); AdditionalBrowser browser2( CreateBrowser(browser()->profile(), browser()->type(), @@ -385,7 +413,7 @@ InstallExtension(kExtensionA); InstallExtension(kExtensionC); - ShowTabbedMenu(); + ShowInstalledTabInMenu(); // Verify the order of the extensions is A,C. { @@ -428,7 +456,7 @@ constexpr char kName[] = "Test Extension"; auto extension_id = InstallExtension(kName)->id(); - ShowTabbedMenu(); + ShowInstalledTabInMenu(); ExtensionsMenuItemView* menu_item = GetOnlyInstalledMenuItem(); EXPECT_EQ(installed_items().size(), 1u); @@ -464,7 +492,7 @@ scoped_refptr<const extensions::Extension> extension = loader.LoadExtension(extension_directory.UnpackedPath()); - ShowTabbedMenu(); + ShowInstalledTabInMenu(); ExtensionsMenuItemView* installed_item = GetOnlyInstalledMenuItem(); EXPECT_EQ(installed_items().size(), 1u); @@ -502,7 +530,7 @@ scoped_refptr<const extensions::Extension> extension = loader.LoadExtension(extension_directory.UnpackedPath()); - ShowTabbedMenu(); + ShowInstalledTabInMenu(); ExtensionsMenuItemView* installed_item = GetOnlyInstalledMenuItem(); EXPECT_EQ(installed_items().size(), 1u); @@ -531,10 +559,37 @@ EXPECT_FALSE(views::IsViewClass<ToolbarActionView>(child)); } +TEST_F(ExtensionsTabbedMenuViewUnitTest, + SiteAccessTab_ExtensionsInCorrectSiteAccessSection) { + constexpr char kHasAccessName[] = "Has Access Extension"; + InstallExtensionWithHostPermissions(kHasAccessName, {"<all_urls>"}); + constexpr char kNoAccessName[] = "No Access Extension"; + InstallExtension(kNoAccessName); + + const GURL url_a("http://www.a.com"); + web_contents_tester()->NavigateAndCommit(url_a); + ShowSiteAccessTabInMenu(); + + // Extension with <all_urls> permission has site access by default (except for + // forbidden websites such as chrome:-scheme), and it should be in the has + // access section. + ASSERT_EQ(has_access_items().size(), 1u); + EXPECT_EQ(base::UTF16ToUTF8((*has_access_items().begin()) + ->primary_action_button_for_testing() + ->label_text_for_testing()), + kHasAccessName); + // Extension with no host permissions does not have site access, and it should + // not be in any site access section. + EXPECT_EQ(requests_access_items().size(), 0u); +} + +// TODO(crbug.com/1263310): Verify menu gets updated after permission changes +// using the menu item dropdown. + TEST_F(ExtensionsTabbedMenuViewUnitTest, WindowTitle) { InstallExtension("Test Extension"); - ShowTabbedMenu(); + ShowInstalledTabInMenu(); ExtensionsTabbedMenuView* menu = extensions_tabbed_menu(); EXPECT_FALSE(menu->GetWindowTitle().empty());
diff --git a/chrome/browser/ui/webui/chromeos/in_session_password_change/confirm_password_change_handler.cc b/chrome/browser/ui/webui/chromeos/in_session_password_change/confirm_password_change_handler.cc index af0eaf2..3dda452 100644 --- a/chrome/browser/ui/webui/chromeos/in_session_password_change/confirm_password_change_handler.cc +++ b/chrome/browser/ui/webui/chromeos/in_session_password_change/confirm_password_change_handler.cc
@@ -6,12 +6,12 @@ #include <string> +#include "ash/components/login/auth/saml_password_attributes.h" #include "base/check.h" #include "base/values.h" #include "chrome/browser/ash/login/saml/in_session_password_change_manager.h" #include "chrome/browser/profiles/profile.h" #include "chrome/common/pref_names.h" -#include "chromeos/login/auth/saml_password_attributes.h" #include "components/prefs/pref_service.h" #include "components/user_manager/user_manager.h"
diff --git a/chrome/browser/ui/webui/chromeos/in_session_password_change/lock_screen_reauth_handler.cc b/chrome/browser/ui/webui/chromeos/in_session_password_change/lock_screen_reauth_handler.cc index e3be9c71..a77dca0 100644 --- a/chrome/browser/ui/webui/chromeos/in_session_password_change/lock_screen_reauth_handler.cc +++ b/chrome/browser/ui/webui/chromeos/in_session_password_change/lock_screen_reauth_handler.cc
@@ -4,6 +4,8 @@ #include "chrome/browser/ui/webui/chromeos/in_session_password_change/lock_screen_reauth_handler.h" +#include "ash/components/login/auth/challenge_response/cert_utils.h" +#include "ash/components/login/auth/cryptohome_key_constants.h" #include "ash/constants/ash_features.h" #include "base/notreached.h" #include "chrome/browser/ash/login/saml/in_session_password_sync_manager.h" @@ -18,8 +20,6 @@ #include "chrome/grit/generated_resources.h" #include "chrome/installer/util/google_update_settings.h" #include "chromeos/dbus/util/version_loader.h" -#include "chromeos/login/auth/challenge_response/cert_utils.h" -#include "chromeos/login/auth/cryptohome_key_constants.h" #include "components/account_id/account_id.h" #include "components/signin/public/identity_manager/account_info.h" #include "components/user_manager/known_user.h"
diff --git a/chrome/browser/ui/webui/chromeos/in_session_password_change/password_change_handler.cc b/chrome/browser/ui/webui/chromeos/in_session_password_change/password_change_handler.cc index 6f390fb..a0984a5 100644 --- a/chrome/browser/ui/webui/chromeos/in_session_password_change/password_change_handler.cc +++ b/chrome/browser/ui/webui/chromeos/in_session_password_change/password_change_handler.cc
@@ -6,6 +6,7 @@ #include <string> +#include "ash/components/login/auth/saml_password_attributes.h" #include "base/logging.h" #include "base/values.h" #include "chrome/browser/ash/login/auth/chrome_cryptohome_authenticator.h" @@ -13,7 +14,6 @@ #include "chrome/browser/ash/login/saml/in_session_password_change_manager.h" #include "chrome/browser/ash/profiles/profile_helper.h" #include "chrome/browser/profiles/profile.h" -#include "chromeos/login/auth/saml_password_attributes.h" #include "components/prefs/pref_service.h" #include "components/user_manager/user_manager.h"
diff --git a/chrome/browser/ui/webui/chromeos/in_session_password_change/password_change_ui.cc b/chrome/browser/ui/webui/chromeos/in_session_password_change/password_change_ui.cc index 117674b..e6d6433b 100644 --- a/chrome/browser/ui/webui/chromeos/in_session_password_change/password_change_ui.cc +++ b/chrome/browser/ui/webui/chromeos/in_session_password_change/password_change_ui.cc
@@ -6,6 +6,7 @@ #include <memory> +#include "ash/components/login/auth/saml_password_attributes.h" #include "ash/constants/ash_switches.h" #include "base/bind.h" #include "base/command_line.h" @@ -22,7 +23,6 @@ #include "chrome/common/webui_url_constants.h" #include "chrome/grit/browser_resources.h" #include "chrome/grit/generated_resources.h" -#include "chromeos/login/auth/saml_password_attributes.h" #include "chromeos/strings/grit/chromeos_strings.h" #include "components/prefs/pref_service.h" #include "components/strings/grit/components_strings.h"
diff --git a/chrome/browser/ui/webui/chromeos/in_session_password_change/urgent_password_expiry_notification_handler.cc b/chrome/browser/ui/webui/chromeos/in_session_password_change/urgent_password_expiry_notification_handler.cc index d4f27df..4030125 100644 --- a/chrome/browser/ui/webui/chromeos/in_session_password_change/urgent_password_expiry_notification_handler.cc +++ b/chrome/browser/ui/webui/chromeos/in_session_password_change/urgent_password_expiry_notification_handler.cc
@@ -6,12 +6,12 @@ #include <string> +#include "ash/components/login/auth/saml_password_attributes.h" #include "base/values.h" #include "chrome/browser/ash/login/saml/in_session_password_change_manager.h" #include "chrome/browser/ash/login/saml/password_expiry_notification.h" #include "chrome/browser/profiles/profile.h" #include "chrome/common/pref_names.h" -#include "chromeos/login/auth/saml_password_attributes.h" #include "components/prefs/pref_service.h" #include "components/user_manager/user_manager.h"
diff --git a/chrome/browser/ui/webui/chromeos/login/gaia_screen_handler.cc b/chrome/browser/ui/webui/chromeos/login/gaia_screen_handler.cc index 991a0d7..43f4705 100644 --- a/chrome/browser/ui/webui/chromeos/login/gaia_screen_handler.cc +++ b/chrome/browser/ui/webui/chromeos/login/gaia_screen_handler.cc
@@ -7,6 +7,11 @@ #include <memory> #include <string> +#include "ash/components/login/auth/challenge_response/cert_utils.h" +#include "ash/components/login/auth/cryptohome_key_constants.h" +#include "ash/components/login/auth/saml_password_attributes.h" +#include "ash/components/login/auth/sync_trusted_vault_keys.h" +#include "ash/components/login/auth/user_context.h" #include "ash/components/security_token_pin/constants.h" #include "ash/components/security_token_pin/error_generator.h" #include "ash/components/settings/cros_settings_names.h" @@ -78,11 +83,6 @@ #include "chrome/installer/util/google_update_settings.h" #include "chromeos/components/onc/certificate_scope.h" #include "chromeos/dbus/util/version_loader.h" -#include "chromeos/login/auth/challenge_response/cert_utils.h" -#include "chromeos/login/auth/cryptohome_key_constants.h" -#include "chromeos/login/auth/saml_password_attributes.h" -#include "chromeos/login/auth/sync_trusted_vault_keys.h" -#include "chromeos/login/auth/user_context.h" #include "chromeos/strings/grit/chromeos_strings.h" #include "components/login/localized_values_builder.h" #include "components/policy/proto/chrome_device_policy.pb.h"
diff --git a/chrome/browser/ui/webui/chromeos/login/online_login_helper.cc b/chrome/browser/ui/webui/chromeos/login/online_login_helper.cc index 8a749ec..ecdba24 100644 --- a/chrome/browser/ui/webui/chromeos/login/online_login_helper.cc +++ b/chrome/browser/ui/webui/chromeos/login/online_login_helper.cc
@@ -4,6 +4,8 @@ #include "chrome/browser/ui/webui/chromeos/login/online_login_helper.h" +#include "ash/components/login/auth/challenge_response/cert_utils.h" +#include "ash/components/login/auth/cryptohome_key_constants.h" #include "chrome/browser/ash/login/signin_partition_manager.h" #include "chrome/browser/ash/login/ui/login_display_host_webui.h" #include "chrome/browser/ash/login/ui/signin_ui.h" @@ -13,8 +15,6 @@ #include "chrome/grit/generated_resources.h" #include "chrome/installer/util/google_update_settings.h" #include "chromeos/dbus/util/version_loader.h" -#include "chromeos/login/auth/challenge_response/cert_utils.h" -#include "chromeos/login/auth/cryptohome_key_constants.h" #include "components/sync/driver/sync_driver_switches.h" #include "content/public/browser/storage_partition.h" #include "google_apis/gaia/gaia_urls.h"
diff --git a/chrome/browser/ui/webui/chromeos/login/online_login_helper.h b/chrome/browser/ui/webui/chromeos/login/online_login_helper.h index cc3925f..2044646 100644 --- a/chrome/browser/ui/webui/chromeos/login/online_login_helper.h +++ b/chrome/browser/ui/webui/chromeos/login/online_login_helper.h
@@ -7,12 +7,12 @@ #include <string> +#include "ash/components/login/auth/cryptohome_authenticator.h" #include "chrome/browser/ash/login/login_client_cert_usage_observer.h" #include "chrome/browser/ash/login/signin_partition_manager.h" #include "chrome/browser/ash/login/ui/login_display_host.h" #include "chrome/browser/ash/login/ui/signin_ui.h" #include "chrome/browser/extensions/api/cookies/cookies_api.h" -#include "chromeos/login/auth/cryptohome_authenticator.h" #include "components/login/base_screen_handler_utils.h" #include "components/user_manager/user_manager.h" #include "content/public/browser/storage_partition.h"
diff --git a/chrome/browser/ui/webui/chromeos/login/signin_screen_handler.cc b/chrome/browser/ui/webui/chromeos/login/signin_screen_handler.cc index 1a667453..6be341c 100644 --- a/chrome/browser/ui/webui/chromeos/login/signin_screen_handler.cc +++ b/chrome/browser/ui/webui/chromeos/login/signin_screen_handler.cc
@@ -11,6 +11,8 @@ #include <utility> #include <vector> +#include "ash/components/login/auth/key.h" +#include "ash/components/login/auth/user_context.h" #include "ash/components/proximity_auth/screenlock_bridge.h" #include "ash/public/mojom/tray_action.mojom.h" #include "base/bind.h" @@ -68,8 +70,6 @@ #include "chrome/common/url_constants.h" #include "chrome/grit/generated_resources.h" #include "chromeos/dbus/dbus_thread_manager.h" -#include "chromeos/login/auth/key.h" -#include "chromeos/login/auth/user_context.h" #include "chromeos/network/network_state.h" #include "chromeos/network/network_state_handler.h" #include "chromeos/strings/grit/chromeos_strings.h"
diff --git a/chrome/browser/ui/webui/cr_components/most_visited/most_visited_handler.cc b/chrome/browser/ui/webui/cr_components/most_visited/most_visited_handler.cc index 527b9a953..1083297 100644 --- a/chrome/browser/ui/webui/cr_components/most_visited/most_visited_handler.cc +++ b/chrome/browser/ui/webui/cr_components/most_visited/most_visited_handler.cc
@@ -52,7 +52,7 @@ most_visited_sites_( ChromeMostVisitedSitesFactory::NewForProfile(profile)), web_contents_(web_contents), - logger_(profile, ntp_url), + logger_(profile, ntp_url, ntp_navigation_start_time), ntp_navigation_start_time_(ntp_navigation_start_time), page_handler_(this, std::move(pending_page_handler)), page_(std::move(pending_page)) {
diff --git a/chrome/browser/ui/webui/history_clusters/history_clusters_handler.cc b/chrome/browser/ui/webui/history_clusters/history_clusters_handler.cc index b94e0ee..9c68f83 100644 --- a/chrome/browser/ui/webui/history_clusters/history_clusters_handler.cc +++ b/chrome/browser/ui/webui/history_clusters/history_clusters_handler.cc
@@ -20,6 +20,7 @@ #include "chrome/browser/search_engines/template_url_service_factory.h" #include "chrome/browser/ui/browser.h" #include "chrome/browser/ui/browser_finder.h" +#include "components/history/core/browser/history_types.h" #include "components/history_clusters/core/features.h" #include "components/history_clusters/core/history_clusters_prefs.h" #include "components/prefs/pref_service.h" @@ -36,7 +37,8 @@ namespace { // Creates a `mojom::VisitPtr` from a `history_clusters::Visit`. -mojom::URLVisitPtr VisitToMojom(Profile* profile, const Visit& visit) { +mojom::URLVisitPtr VisitToMojom(Profile* profile, + const history::ClusterVisit& visit) { auto visit_mojom = mojom::URLVisit::New(); visit_mojom->normalized_url = visit.normalized_url;
diff --git a/chrome/browser/ui/webui/history_clusters/history_clusters_handler_unittest.cc b/chrome/browser/ui/webui/history_clusters/history_clusters_handler_unittest.cc index 38f0536..3de98e0 100644 --- a/chrome/browser/ui/webui/history_clusters/history_clusters_handler_unittest.cc +++ b/chrome/browser/ui/webui/history_clusters/history_clusters_handler_unittest.cc
@@ -24,10 +24,11 @@ namespace { -Visit CreateVisit(std::string url, - float score, - std::vector<std::string> related_searches = {}) { - Visit visit; +history::ClusterVisit CreateVisit( + std::string url, + float score, + std::vector<std::string> related_searches = {}) { + history::ClusterVisit visit; visit.annotated_visit = { {GURL{url}, 0}, {}, {}, {}, 0, 0, history::VisitSource::SOURCE_BROWSED}; visit.annotated_visit.content_annotations.related_searches = related_searches; @@ -54,7 +55,7 @@ QueryClustersResult result; // High scoring visits should always be above the fold. - Cluster cluster1; + history::Cluster cluster1; cluster1.cluster_id = 4; cluster1.visits.push_back(CreateVisit("https://high-score-1", 1)); cluster1.visits.push_back(CreateVisit("https://high-score-2", .8)); @@ -64,7 +65,7 @@ cluster1.keywords.push_back(u"keyword"); // Low scoring visits should be above the fold only if they're one of top 4. - Cluster cluster2; + history::Cluster cluster2; cluster2.cluster_id = 6; cluster2.visits.push_back(CreateVisit("https://low-score-1", .4)); cluster2.visits.push_back(CreateVisit("https://low-score-2", .4)); @@ -74,7 +75,7 @@ cluster2.keywords.push_back(u"keyword"); // 0 scoring visits should be above the fold only if they're 1st. - Cluster cluster3; + history::Cluster cluster3; cluster3.cluster_id = 8; cluster3.visits.push_back(CreateVisit("https://zero-score-1", 0)); cluster3.visits.push_back(CreateVisit("https://zero-score-2", 0)); @@ -131,7 +132,7 @@ TEST_F(HistoryClustersHandlerTest, QueryClustersResultToMojom_RelatedSearches) { QueryClustersResult result; - Cluster cluster; + history::Cluster cluster; cluster.cluster_id = 4; // Should include the top visit's related searches. cluster.visits.push_back(
diff --git a/chrome/browser/ui/webui/new_tab_page/new_tab_page_handler.cc b/chrome/browser/ui/webui/new_tab_page/new_tab_page_handler.cc index 8c9d607..83bddc5 100644 --- a/chrome/browser/ui/webui/new_tab_page/new_tab_page_handler.cc +++ b/chrome/browser/ui/webui/new_tab_page/new_tab_page_handler.cc
@@ -360,7 +360,9 @@ profile_(profile), web_contents_(web_contents), ntp_navigation_start_time_(ntp_navigation_start_time), - logger_(profile, GURL(chrome::kChromeUINewTabPageURL)), + logger_(profile, + GURL(chrome::kChromeUINewTabPageURL), + ntp_navigation_start_time), promo_service_(PromoServiceFactory::GetForProfile(profile)), page_{std::move(pending_page)}, receiver_{this, std::move(pending_page_handler)} {
diff --git a/chrome/browser/ui/webui/settings/settings_ui.cc b/chrome/browser/ui/webui/settings/settings_ui.cc index 6153eca..9b40b57a 100644 --- a/chrome/browser/ui/webui/settings/settings_ui.cc +++ b/chrome/browser/ui/webui/settings/settings_ui.cc
@@ -103,6 +103,7 @@ #if BUILDFLAG(IS_CHROMEOS_ASH) #include "ash/components/account_manager/account_manager_factory.h" #include "ash/components/arc/arc_util.h" +#include "ash/components/login/auth/password_visibility_utils.h" #include "ash/components/phonehub/phone_hub_manager.h" #include "ash/constants/ash_features.h" #include "ash/webui/eche_app_ui/eche_app_manager.h" @@ -120,7 +121,6 @@ #include "chrome/browser/ui/webui/settings/chromeos/multidevice_handler.h" #include "chrome/common/chrome_switches.h" #include "chrome/grit/browser_resources.h" -#include "chromeos/login/auth/password_visibility_utils.h" #include "components/account_manager_core/chromeos/account_manager.h" #include "components/account_manager_core/chromeos/account_manager_facade_factory.h" #include "components/user_manager/user.h"
diff --git a/chrome/browser/web_applications/preinstalled_web_app_manager.cc b/chrome/browser/web_applications/preinstalled_web_app_manager.cc index 3cc9c4aed..55585133 100644 --- a/chrome/browser/web_applications/preinstalled_web_app_manager.cc +++ b/chrome/browser/web_applications/preinstalled_web_app_manager.cc
@@ -345,9 +345,9 @@ const char* PreinstalledWebAppManager::kHistogramAppToReplaceStillInstalledCount = "WebApp.Preinstalled.AppToReplaceStillInstalledCount"; -const char* - PreinstalledWebAppManager::kHistogramAppToReplaceStillSyncInstalledCount = - "WebApp.Preinstalled.AppToReplaceStillSyncInstalledCount"; +const char* PreinstalledWebAppManager:: + kHistogramAppToReplaceStillDefaultInstalledCount = + "WebApp.Preinstalled.AppToReplaceStillDefaultInstalledCount"; const char* PreinstalledWebAppManager:: kHistogramAppToReplaceStillInstalledInShelfCount = "WebApp.Preinstalled.AppToReplaceStillInstalledInShelfCount"; @@ -632,7 +632,7 @@ size_t uninstall_and_replace_count = 0; size_t app_to_replace_still_installed_count = 0; - size_t app_to_replace_still_sync_installed_count = 0; + size_t app_to_replace_still_default_installed_count = 0; size_t app_to_replace_still_installed_in_shelf_count = 0; for (const auto& url_and_result : install_results) { @@ -675,7 +675,7 @@ ++app_to_replace_still_installed_count; if (!extensions::IsExtensionDefaultInstalled(profile_, replace_id)) - ++app_to_replace_still_sync_installed_count; + ++app_to_replace_still_default_installed_count; if (ui_manager_->CanAddAppToQuickLaunchBar()) { if (ui_manager_->IsAppInQuickLaunchBar(result.app_id.value())) @@ -689,8 +689,8 @@ base::UmaHistogramCounts100(kHistogramAppToReplaceStillInstalledCount, app_to_replace_still_installed_count); - base::UmaHistogramCounts100(kHistogramAppToReplaceStillSyncInstalledCount, - app_to_replace_still_sync_installed_count); + base::UmaHistogramCounts100(kHistogramAppToReplaceStillDefaultInstalledCount, + app_to_replace_still_default_installed_count); base::UmaHistogramCounts100(kHistogramAppToReplaceStillInstalledInShelfCount, app_to_replace_still_installed_in_shelf_count);
diff --git a/chrome/browser/web_applications/preinstalled_web_app_manager.h b/chrome/browser/web_applications/preinstalled_web_app_manager.h index 82e966aa..84ea633 100644 --- a/chrome/browser/web_applications/preinstalled_web_app_manager.h +++ b/chrome/browser/web_applications/preinstalled_web_app_manager.h
@@ -71,7 +71,7 @@ static const char* kHistogramInstallResult; static const char* kHistogramUninstallAndReplaceCount; static const char* kHistogramAppToReplaceStillInstalledCount; - static const char* kHistogramAppToReplaceStillSyncInstalledCount; + static const char* kHistogramAppToReplaceStillDefaultInstalledCount; static const char* kHistogramAppToReplaceStillInstalledInShelfCount; static void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry);
diff --git a/chrome/browser/web_applications/preinstalled_web_app_migration_browsertest.cc b/chrome/browser/web_applications/preinstalled_web_app_migration_browsertest.cc index c1d978a..84b2b46 100644 --- a/chrome/browser/web_applications/preinstalled_web_app_migration_browsertest.cc +++ b/chrome/browser/web_applications/preinstalled_web_app_migration_browsertest.cc
@@ -586,7 +586,7 @@ 1); histograms.ExpectUniqueSample( PreinstalledWebAppManager:: - kHistogramAppToReplaceStillSyncInstalledCount, + kHistogramAppToReplaceStillDefaultInstalledCount, 0, 1); histograms.ExpectUniqueSample( PreinstalledWebAppManager:: @@ -607,7 +607,7 @@ 1); histograms.ExpectUniqueSample( PreinstalledWebAppManager:: - kHistogramAppToReplaceStillSyncInstalledCount, + kHistogramAppToReplaceStillDefaultInstalledCount, 1, 1); // Neither app has been added to the shelf.
diff --git a/chrome/build/linux.pgo.txt b/chrome/build/linux.pgo.txt index 411643f..b0c86d47 100644 --- a/chrome/build/linux.pgo.txt +++ b/chrome/build/linux.pgo.txt
@@ -1 +1 @@ -chrome-linux-main-1639591173-b7d6da1a5c5f60f0b1959e21ff4b40acc3fbb5da.profdata +chrome-linux-main-1639612728-dac077a8ded011f5ad0cbb0bd45b03560bfb98d0.profdata
diff --git a/chrome/build/mac.pgo.txt b/chrome/build/mac.pgo.txt index 5014d5c..2cb0868 100644 --- a/chrome/build/mac.pgo.txt +++ b/chrome/build/mac.pgo.txt
@@ -1 +1 @@ -chrome-mac-main-1639591173-0244749f96275593dcee7f94bfec65b371fce288.profdata +chrome-mac-main-1639612728-ae0265bcbcdf930224c3c28fafee767fff83f4be.profdata
diff --git a/chrome/build/win32.pgo.txt b/chrome/build/win32.pgo.txt index 2837d9c..90ba097 100644 --- a/chrome/build/win32.pgo.txt +++ b/chrome/build/win32.pgo.txt
@@ -1 +1 @@ -chrome-win32-main-1639580383-b8027ac27b70be2c1132df9ac8ecd76a61e2f927.profdata +chrome-win32-main-1639612728-e8e64734f8e5716007ad68e2c4ef4d5f158d480a.profdata
diff --git a/chrome/build/win64.pgo.txt b/chrome/build/win64.pgo.txt index fa53f5a..e53aefb 100644 --- a/chrome/build/win64.pgo.txt +++ b/chrome/build/win64.pgo.txt
@@ -1 +1 @@ -chrome-win64-main-1639591173-ef599e7e9308fc3ef78ebdbcc6c39423184c7325.profdata +chrome-win64-main-1639601907-594c75e7715d0569dfdcf80bf8cac2ae316ab6dc.profdata
diff --git a/chrome/common/extensions/api/storage/storage_schema_manifest_handler.cc b/chrome/common/extensions/api/storage/storage_schema_manifest_handler.cc index 06837d0..86115be 100644 --- a/chrome/common/extensions/api/storage/storage_schema_manifest_handler.cc +++ b/chrome/common/extensions/api/storage/storage_schema_manifest_handler.cc
@@ -35,7 +35,10 @@ const Extension* extension, std::string* error) { std::string path; - extension->manifest()->GetString(kStorageManagedSchema, &path); + if (const std::string* temp = + extension->manifest()->FindStringPath(kStorageManagedSchema)) { + path = *temp; + } base::FilePath file = base::FilePath::FromUTF8Unsafe(path); if (file.IsAbsolute() || file.ReferencesParent()) { *error = base::StringPrintf("%s must be a relative path without ..", @@ -59,8 +62,7 @@ bool StorageSchemaManifestHandler::Parse(Extension* extension, std::u16string* error) { - std::string path; - if (!extension->manifest()->GetString(kStorageManagedSchema, &path)) { + if (extension->manifest()->FindStringPath(kStorageManagedSchema) == nullptr) { *error = base::ASCIIToUTF16( base::StringPrintf("%s must be a string", kStorageManagedSchema)); return false;
diff --git a/chrome/common/extensions/chrome_manifest_url_handlers.cc b/chrome/common/extensions/chrome_manifest_url_handlers.cc index 2139f6bf..42bdbd1 100644 --- a/chrome/common/extensions/chrome_manifest_url_handlers.cc +++ b/chrome/common/extensions/chrome_manifest_url_handlers.cc
@@ -58,12 +58,13 @@ bool DevToolsPageHandler::Parse(Extension* extension, std::u16string* error) { std::unique_ptr<ManifestURL> manifest_url(new ManifestURL); - std::string devtools_str; - if (!extension->manifest()->GetString(keys::kDevToolsPage, &devtools_str)) { + const std::string* devtools_str = + extension->manifest()->FindStringPath(keys::kDevToolsPage); + if (!devtools_str) { *error = errors::kInvalidDevToolsPage; return false; } - GURL url = extension->GetResourceURL(devtools_str); + GURL url = extension->GetResourceURL(*devtools_str); const bool is_extension_url = url.SchemeIs(kExtensionScheme) && url.host_piece() == extension->id(); // TODO(caseq): using http(s) is unsupported and will be disabled in m83.
diff --git a/chrome/common/extensions/manifest_handlers/minimum_chrome_version_checker.cc b/chrome/common/extensions/manifest_handlers/minimum_chrome_version_checker.cc index 1edfe6d..6b1b7cb 100644 --- a/chrome/common/extensions/manifest_handlers/minimum_chrome_version_checker.cc +++ b/chrome/common/extensions/manifest_handlers/minimum_chrome_version_checker.cc
@@ -27,14 +27,14 @@ bool MinimumChromeVersionChecker::Parse(Extension* extension, std::u16string* error) { - std::string minimum_version_string; - if (!extension->manifest()->GetString(keys::kMinimumChromeVersion, - &minimum_version_string)) { + const std::string* minimum_version_string = + extension->manifest()->FindStringPath(keys::kMinimumChromeVersion); + if (minimum_version_string == nullptr) { *error = errors::kInvalidMinimumChromeVersion; return false; } - base::Version minimum_version(minimum_version_string); + base::Version minimum_version(*minimum_version_string); if (!minimum_version.IsValid()) { *error = errors::kInvalidMinimumChromeVersion; return false; @@ -49,8 +49,7 @@ if (current_version.CompareTo(minimum_version) < 0) { *error = ErrorUtils::FormatErrorMessageUTF16( errors::kChromeVersionTooLow, - l10n_util::GetStringUTF8(IDS_PRODUCT_NAME), - minimum_version_string); + l10n_util::GetStringUTF8(IDS_PRODUCT_NAME), *minimum_version_string); return false; } return true;
diff --git a/chrome/common/extensions/manifest_unittest.cc b/chrome/common/extensions/manifest_unittest.cc index f80a9f4..fd761e2 100644 --- a/chrome/common/extensions/manifest_unittest.cc +++ b/chrome/common/extensions/manifest_unittest.cc
@@ -109,14 +109,16 @@ AssertType(manifest.get(), Manifest::TYPE_EXTENSION); // The known key 'background.page' should be accessible. - std::string value; - EXPECT_TRUE(manifest->GetString(keys::kBackgroundPage, &value)); - EXPECT_EQ("bg.html", value); + const std::string* background_page = + manifest->FindStringPath(keys::kBackgroundPage); + ASSERT_TRUE(background_page); + EXPECT_EQ("bg.html", *background_page); - // The unknown key 'unknown_key' should be accesible. - value.clear(); - EXPECT_TRUE(manifest->GetString("unknown_key", &value)); - EXPECT_EQ("foo", value); + // The unknown key 'unknown_key' should be accessible. + const std::string* unknown_key_value = + manifest->FindStringPath("unknown_key"); + ASSERT_TRUE(unknown_key_value); + EXPECT_EQ("foo", *unknown_key_value); // Test EqualsForTesting. auto manifest2 = std::make_unique<Manifest>(
diff --git a/chrome/test/BUILD.gn b/chrome/test/BUILD.gn index 85d0971..d683e3d 100644 --- a/chrome/test/BUILD.gn +++ b/chrome/test/BUILD.gn
@@ -350,11 +350,16 @@ "//components/ukm:test_support", "//components/ukm:ukm_test_helper", "//components/web_modal", - "//extensions/browser:test_support", - "//extensions/common:test_support", "//ui/snapshot", ] + if (enable_extensions) { + public_deps += [ + "//extensions/browser:test_support", + "//extensions/common:test_support", + ] + } + deps += [ "//components/constrained_window" ] sources += [ @@ -1070,7 +1075,6 @@ "//chrome/browser/continuous_search:browser_tests", "//chrome/browser/devtools", "//chrome/browser/devtools:test_support", - "//chrome/browser/extensions:test_support", "//chrome/browser/image_decoder:browser_tests", "//chrome/browser/media/router:media_router_feature", "//chrome/browser/media/router:test_support", @@ -1297,9 +1301,6 @@ "//device/bluetooth:mocks", "//device/fido:cablev2_test_util", "//device/fido:test_support", - "//extensions/browser/updater", - "//extensions/buildflags", - "//extensions/renderer", "//google_apis:test_support", "//media:media_buildflags", "//media:test_support", @@ -1360,6 +1361,15 @@ "//v8", ] + if (enable_extensions) { + deps += [ + "//chrome/browser/extensions:test_support", + "//extensions/browser/updater", + "//extensions/buildflags", + "//extensions/renderer", + ] + } + # Runtime dependencies data_deps = [ "//chrome:browser_tests_pak", @@ -1540,7 +1550,6 @@ "../browser/enterprise/connectors/connectors_service_browsertest.cc", "../browser/enterprise/reporting/report_scheduler_browsertest.cc", "../browser/enterprise/util/managed_browser_utils_browsertest.cc", - "../browser/extensions/protocol_handler_apitest.cc", "../browser/fast_shutdown_browsertest.cc", "../browser/favicon/content_favicon_driver_browsertest.cc", "../browser/federated_learning/floc_eligibility_browsertest.cc", @@ -2153,10 +2162,6 @@ "../browser/speech/speech_recognition_browsertest.cc", ] - if (enable_extensions) { - sources += [ "../browser/extensions/preinstalled_apps_browsertest.cc" ] - } - if (enable_click_to_call) { sources += [ "../browser/ui/views/sharing/click_to_call_browsertest.cc" ] } @@ -2703,10 +2708,12 @@ "../browser/extensions/navigation_observer_browsertest.cc", "../browser/extensions/options_page_apitest.cc", "../browser/extensions/page_action_browsertest.cc", + "../browser/extensions/preinstalled_apps_browsertest.cc", "../browser/extensions/printer_provider_apitest.cc", "../browser/extensions/process_management_browsertest.cc", "../browser/extensions/process_manager_browsertest.cc", "../browser/extensions/process_util_browsertest.cc", + "../browser/extensions/protocol_handler_apitest.cc", "../browser/extensions/renderer_initialization_browsertest.cc", "../browser/extensions/sandboxed_pages_apitest.cc", "../browser/extensions/script_executor_browsertest.cc", @@ -2796,23 +2803,53 @@ if (is_chromeos_ash) { sources += [ "../browser/apps/platform_apps/api/arc_apps_private/arc_apps_private_apitest.cc", + "../browser/chromeos/extensions/accessibility_features_apitest.cc", + "../browser/chromeos/extensions/action_handlers/action_handlers_apitest.cc", + "../browser/chromeos/extensions/autotest_private/autotest_private_apitest.cc", + "../browser/chromeos/extensions/default_keyboard_extension_browser_test.cc", + "../browser/chromeos/extensions/default_keyboard_extension_browser_test.h", + "../browser/chromeos/extensions/echo_private_apitest.cc", + "../browser/chromeos/extensions/file_manager/file_manager_private_apitest.cc", + "../browser/chromeos/extensions/file_system_provider/file_system_provider_apitest.cc", + "../browser/chromeos/extensions/incoming_native_messaging_apitest.cc", + "../browser/chromeos/extensions/info_private_apitest.cc", + "../browser/chromeos/extensions/input_method_apitest_chromeos.cc", + "../browser/chromeos/extensions/login_screen/login/cleanup/extension_cleanup_handler_browsertest.cc", + "../browser/chromeos/extensions/login_screen/login/login_apitest.cc", + "../browser/chromeos/extensions/login_screen/login_screen_ui/login_screen_ui_apitest.cc", + "../browser/chromeos/extensions/speech/speech_recognition_private_apitest.cc", + "../browser/chromeos/extensions/speech/speech_recognition_private_base_test.cc", + "../browser/chromeos/extensions/speech/speech_recognition_private_base_test.h", + "../browser/chromeos/extensions/speech/speech_recognition_private_manager_browsertest.cc", + "../browser/chromeos/extensions/speech/speech_recognition_private_recognizer_browsertest.cc", + "../browser/chromeos/extensions/users_private/users_private_apitest.cc", + "../browser/chromeos/extensions/wallpaper_apitest.cc", + "../browser/chromeos/extensions/wallpaper_manager_browsertest.cc", + "../browser/chromeos/extensions/wallpaper_private_apitest.cc", + "../browser/chromeos/extensions/wm/wm_desks_private_apitest.cc", "../browser/extensions/api/bluetooth_low_energy/bluetooth_low_energy_apitest_chromeos.cc", + "../browser/extensions/api/certificate_provider/certificate_provider_apitest.cc", "../browser/extensions/api/crash_report_private/crash_report_private_apitest.cc", "../browser/extensions/api/enterprise_device_attributes/enterprise_device_attributes_apitest.cc", "../browser/extensions/api/enterprise_networking_attributes/enterprise_networking_attributes_ash_apitest.cc", "../browser/extensions/api/enterprise_platform_keys/enterprise_platform_keys_apitest_nss.cc", + "../browser/extensions/api/file_manager/file_browser_handler_api_ash_test.cc", "../browser/extensions/api/file_system/file_system_apitest_chromeos.cc", "../browser/extensions/api/force_installed_affiliated_extension_apitest.cc", "../browser/extensions/api/force_installed_affiliated_extension_apitest.h", "../browser/extensions/api/input_ime/input_ime_apitest_chromeos.cc", + "../browser/extensions/api/networking_private/networking_private_apitest.cc", + "../browser/extensions/api/networking_private/networking_private_chromeos_apitest.cc", "../browser/extensions/api/platform_keys/platform_keys_apitest_nss.cc", "../browser/extensions/api/platform_keys/platform_keys_test_base.cc", "../browser/extensions/api/platform_keys/platform_keys_test_base.h", + "../browser/extensions/api/settings_private/settings_private_browsertest_chromeos.cc", "../browser/extensions/api/system_display/system_display_chromeos_apitest.cc", "../browser/extensions/api/terminal/terminal_private_apitest.cc", "../browser/extensions/api/terminal/terminal_private_browsertest.cc", "../browser/extensions/api/video_capture/video_capture_apitest_chromeos.cc", "../browser/extensions/api/virtual_keyboard_private/virtual_keyboard_private_apitest.cc", + "../browser/extensions/api/vpn_provider/vpn_provider_apitest.cc", ] deps += [ @@ -3395,30 +3432,6 @@ "../browser/ash/web_applications/system_web_app_integration_test.h", "../browser/ash/wilco_dtc_supportd/wilco_dtc_supportd_web_request_service_browsertest.cc", "../browser/chrome_main_browsertest.cc", - "../browser/chromeos/extensions/accessibility_features_apitest.cc", - "../browser/chromeos/extensions/action_handlers/action_handlers_apitest.cc", - "../browser/chromeos/extensions/autotest_private/autotest_private_apitest.cc", - "../browser/chromeos/extensions/default_keyboard_extension_browser_test.cc", - "../browser/chromeos/extensions/default_keyboard_extension_browser_test.h", - "../browser/chromeos/extensions/echo_private_apitest.cc", - "../browser/chromeos/extensions/file_manager/file_manager_private_apitest.cc", - "../browser/chromeos/extensions/file_system_provider/file_system_provider_apitest.cc", - "../browser/chromeos/extensions/incoming_native_messaging_apitest.cc", - "../browser/chromeos/extensions/info_private_apitest.cc", - "../browser/chromeos/extensions/input_method_apitest_chromeos.cc", - "../browser/chromeos/extensions/login_screen/login/cleanup/extension_cleanup_handler_browsertest.cc", - "../browser/chromeos/extensions/login_screen/login/login_apitest.cc", - "../browser/chromeos/extensions/login_screen/login_screen_ui/login_screen_ui_apitest.cc", - "../browser/chromeos/extensions/speech/speech_recognition_private_apitest.cc", - "../browser/chromeos/extensions/speech/speech_recognition_private_base_test.cc", - "../browser/chromeos/extensions/speech/speech_recognition_private_base_test.h", - "../browser/chromeos/extensions/speech/speech_recognition_private_manager_browsertest.cc", - "../browser/chromeos/extensions/speech/speech_recognition_private_recognizer_browsertest.cc", - "../browser/chromeos/extensions/users_private/users_private_apitest.cc", - "../browser/chromeos/extensions/wallpaper_apitest.cc", - "../browser/chromeos/extensions/wallpaper_manager_browsertest.cc", - "../browser/chromeos/extensions/wallpaper_private_apitest.cc", - "../browser/chromeos/extensions/wm/wm_desks_private_apitest.cc", "../browser/chromeos/policy/dlp/data_transfer_dlp_controller_browsertest.cc", "../browser/chromeos/policy/dlp/dlp_content_restriction_set_browsertest.cc", "../browser/chromeos/policy/dlp/dlp_content_tab_helper_browsertest.cc", @@ -3433,12 +3446,6 @@ "../browser/chromeos/policy/dlp/mock_dlp_rules_manager.h", "../browser/device_api/device_attribute_api_browsertest.cc", "../browser/drive/drive_notification_manager_factory_browsertest.cc", - "../browser/extensions/api/certificate_provider/certificate_provider_apitest.cc", - "../browser/extensions/api/file_manager/file_browser_handler_api_ash_test.cc", - "../browser/extensions/api/networking_private/networking_private_apitest.cc", - "../browser/extensions/api/networking_private/networking_private_chromeos_apitest.cc", - "../browser/extensions/api/settings_private/settings_private_browsertest_chromeos.cc", - "../browser/extensions/api/vpn_provider/vpn_provider_apitest.cc", "../browser/metrics/chromeos_metrics_provider_browsertest.cc", "../browser/metrics/family_link_user_metrics_provider_browsertest.cc", "../browser/metrics/family_user_metrics_provider_browsertest.cc", @@ -3669,6 +3676,9 @@ "//ash/components/drivefs:test_support", "//ash/components/drivefs/mojom", "//ash/components/geolocation", + "//ash/components/login/auth", + "//ash/components/login/auth:challenge_response_key", + "//ash/components/login/auth:test_support", "//ash/components/smbfs", "//ash/components/timezone", "//ash/keyboard/ui:test_support", @@ -3738,9 +3748,6 @@ "//chromeos/dbus/update_engine", "//chromeos/dbus/upstart", "//chromeos/dbus/vm_plugin_dispatcher", - "//chromeos/login/auth", - "//chromeos/login/auth:challenge_response_key", - "//chromeos/login/auth:test_support", "//chromeos/login/login_state:test_support", "//chromeos/process_proxy", "//chromeos/services/assistant:lib", @@ -6292,6 +6299,7 @@ "//ash/components/audio", "//ash/components/disks", "//ash/components/disks:test_support", + "//ash/components/login/auth:test_support", "//ash/components/login/session", "//ash/components/proximity_auth", "//ash/components/proximity_auth:test_support", @@ -6331,7 +6339,6 @@ "//chromeos/dbus/shill", "//chromeos/dbus/update_engine", "//chromeos/dbus/update_engine:proto", - "//chromeos/login/auth:test_support", "//chromeos/login/login_state:test_support", "//chromeos/services/assistant/public/cpp", "//chromeos/services/assistant/public/shared", @@ -8626,10 +8633,10 @@ if (is_chromeos_ash) { deps += [ + "//ash/components/login/auth", "//chrome/browser/chromeos:test_support", "//chrome/browser/media/router:test_support", "//chromeos/dbus", - "//chromeos/login/auth", "//chromeos/ui/frame:test_support", "//components/exo/wayland:weston_test_stub", "//ui/display:display_manager_test_api",
diff --git a/chrome/test/data/extensions/api_test/runtime/send_message/manifest.json b/chrome/test/data/extensions/api_test/runtime/send_message/manifest.json new file mode 100644 index 0000000..25683a9 --- /dev/null +++ b/chrome/test/data/extensions/api_test/runtime/send_message/manifest.json
@@ -0,0 +1,9 @@ +{ + "name": "chrome.runtime.sendMessage test", + "version": "0.1", + "manifest_version": 3, + "description": "end-to-end browser test for chrome.runtime.sendMessage API", + "background": { + "service_worker": "worker.js" + } +}
diff --git a/chrome/test/data/extensions/api_test/runtime/send_message/test.html b/chrome/test/data/extensions/api_test/runtime/send_message/test.html new file mode 100644 index 0000000..fe6404c --- /dev/null +++ b/chrome/test/data/extensions/api_test/runtime/send_message/test.html
@@ -0,0 +1,6 @@ +<!-- + * Copyright 2021 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. +--> +<script src="test.js"></script>
diff --git a/chrome/test/data/extensions/api_test/runtime/send_message/test.js b/chrome/test/data/extensions/api_test/runtime/send_message/test.js new file mode 100644 index 0000000..523c0af --- /dev/null +++ b/chrome/test/data/extensions/api_test/runtime/send_message/test.js
@@ -0,0 +1,11 @@ +// Copyright 2021 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 sendMessageWithCallback() { + chrome.runtime.sendMessage('ping', (response) => { + chrome.test.assertEq('pong', response); + chrome.test.assertNoLastError(); + chrome.test.succeed(); + }); +}]);
diff --git a/chrome/test/data/extensions/api_test/runtime/send_message/worker.js b/chrome/test/data/extensions/api_test/runtime/send_message/worker.js new file mode 100644 index 0000000..a3d17a8 --- /dev/null +++ b/chrome/test/data/extensions/api_test/runtime/send_message/worker.js
@@ -0,0 +1,11 @@ +// Copyright 2021 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. + +// A simple onMessage listener we can send a "ping" message to and get a "pong" +// message back. +chrome.runtime.onMessage.addListener((request, sender, sendResponse) => { + const response = + request == 'ping' ? 'pong' : 'Unexpected message: ${request}'; + sendResponse(response); +});
diff --git a/chrome/test/data/extensions/api_test/tabs/send_message/echo.js b/chrome/test/data/extensions/api_test/tabs/send_message/echo.js new file mode 100644 index 0000000..5ad38e0 --- /dev/null +++ b/chrome/test/data/extensions/api_test/tabs/send_message/echo.js
@@ -0,0 +1,11 @@ +// Copyright 2021 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. + +// A simple onMessage listener that responds to "ping" messages with a "pong" +// message. +chrome.runtime.onMessage.addListener((request, sender, sendResponse) => { + const response = + request == 'ping' ? 'pong' : `Unexpected message: ${request}`; + sendResponse(response); +});
diff --git a/chrome/test/data/extensions/api_test/tabs/send_message/manifest.json b/chrome/test/data/extensions/api_test/tabs/send_message/manifest.json new file mode 100644 index 0000000..7f4b3e9 --- /dev/null +++ b/chrome/test/data/extensions/api_test/tabs/send_message/manifest.json
@@ -0,0 +1,17 @@ +{ + "name": "chrome.tabs.sendMessage test", + "version": "0.1", + "manifest_version": 3, + "description": "end-to-end browser test for chrome.tabs.sendMessage API", + "background": { + "service_worker": "worker.js", + "type": "module" + }, + "content_scripts": [ + { + "matches": ["http://*/*"], + "js": ["echo.js"], + "run_at": "document_start" + } + ] +}
diff --git a/chrome/test/data/extensions/api_test/tabs/send_message/worker.js b/chrome/test/data/extensions/api_test/tabs/send_message/worker.js new file mode 100644 index 0000000..30ff2dfa --- /dev/null +++ b/chrome/test/data/extensions/api_test/tabs/send_message/worker.js
@@ -0,0 +1,26 @@ +// Copyright 2021 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 {openTab} from '/_test_resources/test_util/tabs_util.js'; + +// A test tab which has the listener we are sending messages to injected as a +// content script. +var testTab = null; + +chrome.test.runTests([ + async function setup() { + const config = await chrome.test.getConfig(); + let url = `http://example.com:${config.testServer.port}/empty.html`; + testTab = await openTab(url); + chrome.test.succeed(); + }, + + function sendMessageWithCallback() { + chrome.tabs.sendMessage(testTab.id, 'ping', (response) => { + chrome.test.assertNoLastError(); + chrome.test.assertEq('pong', response); + chrome.test.succeed(); + }); + } +]);
diff --git a/chrome/test/data/extensions/platform_apps/web_view/shim/guest_noreferrer.html b/chrome/test/data/extensions/platform_apps/web_view/shim/guest_noreferrer.html index 1004d14..caa768f6 100644 --- a/chrome/test/data/extensions/platform_apps/web_view/shim/guest_noreferrer.html +++ b/chrome/test/data/extensions/platform_apps/web_view/shim/guest_noreferrer.html
@@ -14,7 +14,7 @@ </script> </head> <body style="padding: 0; margin: 0;"> -<a id="link" href="about:blank" +<a id="link" href="about:blank#noreferrer" rel="noreferrer" target="_blank">Noreferrer guest link</a> </body> </html>
diff --git a/chrome/test/data/extensions/platform_apps/windows_api_opening_absolute_urls/background.js b/chrome/test/data/extensions/platform_apps/windows_api_opening_absolute_urls/background.js new file mode 100644 index 0000000..91739c27 --- /dev/null +++ b/chrome/test/data/extensions/platform_apps/windows_api_opening_absolute_urls/background.js
@@ -0,0 +1,36 @@ +// Copyright 2021 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 openChromeUrl() { + // The app is loaded as a component, so it should be able to load + // chrome:-scheme URLs. + chrome.app.window.create('chrome://version', (win) => { + // The returned `win` here is null because it's inaccessible (by design) + // by the Chrome app. But there should be no last error, signaling that + // the call succeeded. The C++ will verify the presence of the opened tab + // after the app finishes running. + chrome.test.assertFalse(!!win); + chrome.test.assertNoLastError(); + chrome.test.succeed(); + }); + }, + function openFileUrlFails() { + // Attempting to opening a file URL should fail. https://crbug.com/1276046. + chrome.test.getConfig((config) => { + // The customArg provided by the C++ points to a file URL in the test + // data directory. + chrome.app.window.create(config.customArg, (win) => { + chrome.test.assertFalse(!!win); + // TODO(devlin): This error message isn't entirely accurate (file URLs + // are local). It should probably say something like "must point to a + // resource contained by this app" or something. + chrome.test.assertLastError( + 'The URL used for window creation must be local ' + + 'for security reasons.'); + chrome.test.succeed(); + }); + }); + }, +]);
diff --git a/chrome/test/data/extensions/platform_apps/windows_api_opening_absolute_urls/manifest.json b/chrome/test/data/extensions/platform_apps/windows_api_opening_absolute_urls/manifest.json new file mode 100644 index 0000000..af516573 --- /dev/null +++ b/chrome/test/data/extensions/platform_apps/windows_api_opening_absolute_urls/manifest.json
@@ -0,0 +1,9 @@ +{ + "name": "Test opening absolute URLs", + "manifest_version": 2, + "version": "0.1", + "app": { + "background": { "scripts": ["background.js"] } + }, + "key": "MIGdMA0GCSqGSIb3DQEBAQUAA4GLADCBhwKBgQDFFBqmJf6+xgNeQhSwunB7Vdi+peXwR6uf09DKBmStju73Cjhggl3x+i7jfeRvGguJA1nnxK45dHktx5ppyy2w16nFKFcfIAN9dP6RrfPWuHVxw1AzNCRm/VutRLje1e9Kk3xtXAw9Vj3N0/txZ3u8HOr62YUDIyFcS87+Yo/a9QIBIw==" +}
diff --git a/chrome/test/data/extensions/theme/Cached Theme.pak b/chrome/test/data/extensions/theme/Cached Theme.pak deleted file mode 100644 index cc16deb3..0000000 --- a/chrome/test/data/extensions/theme/Cached Theme.pak +++ /dev/null Binary files differ
diff --git a/chrome/test/data/webui/chromeos/personalization_app/personalization_app_controller_test.js b/chrome/test/data/webui/chromeos/personalization_app/personalization_app_controller_test.js index b4ef8c2..6dc497f 100644 --- a/chrome/test/data/webui/chromeos/personalization_app/personalization_app_controller_test.js +++ b/chrome/test/data/webui/chromeos/personalization_app/personalization_app_controller_test.js
@@ -61,7 +61,7 @@ let expectedCount, expectedAlbums, expectedPhotos; if (isGooglePhotosIntegrationEnabled) { - expectedCount = 0n; + expectedCount = 0; expectedAlbums = []; expectedPhotos = []; } else { @@ -802,4 +802,4 @@ ], personalizationStore.states.map(filterAndFlattenState(['error']))); }); -}); \ No newline at end of file +});
diff --git a/chrome/test/data/webui/chromeos/personalization_app/test_wallpaper_interface_provider.js b/chrome/test/data/webui/chromeos/personalization_app/test_wallpaper_interface_provider.js index fecf712..120c5f1 100644 --- a/chrome/test/data/webui/chromeos/personalization_app/test_wallpaper_interface_provider.js +++ b/chrome/test/data/webui/chromeos/personalization_app/test_wallpaper_interface_provider.js
@@ -162,7 +162,7 @@ fetchGooglePhotosCount() { this.methodCalled('fetchGooglePhotosCount'); const count = - loadTimeData.getBoolean('isGooglePhotosIntegrationEnabled') ? 0n : -1n; + loadTimeData.getBoolean('isGooglePhotosIntegrationEnabled') ? 0 : -1; return Promise.resolve({count: count}); }
diff --git a/chrome/test/data/webui/chromeos/personalization_app/wallpaper_collections_element_test.js b/chrome/test/data/webui/chromeos/personalization_app/wallpaper_collections_element_test.js index 9490a018..992a679 100644 --- a/chrome/test/data/webui/chromeos/personalization_app/wallpaper_collections_element_test.js +++ b/chrome/test/data/webui/chromeos/personalization_app/wallpaper_collections_element_test.js
@@ -65,7 +65,7 @@ wallpaperCollectionsElement = initElement(WallpaperCollections.is); - personalizationStore.data.googlePhotos.count = 1234n; + personalizationStore.data.googlePhotos.count = 1234; personalizationStore.data.loading.googlePhotos.count = false; personalizationStore.notifyObservers();
diff --git a/chrome/test/data/webui/print_preview/BUILD.gn b/chrome/test/data/webui/print_preview/BUILD.gn index 8009019..66cac052e 100644 --- a/chrome/test/data/webui/print_preview/BUILD.gn +++ b/chrome/test/data/webui/print_preview/BUILD.gn
@@ -28,13 +28,9 @@ "print_preview_sidebar_test.ts", "print_preview_test_utils.ts", "restore_state_test.ts", - "user_manager_test.ts", + "user_manager_test.js", ] -if (is_mac || is_win) { - preprocessed_tests += [ "system_dialog_browsertest.ts" ] -} - # Print Preview test files that do not require preprocessing. If adding # // <if expr to any file below, move it to the list above. non_preprocessed_tests = [ @@ -66,7 +62,8 @@ "scaling_settings_interactive_test.ts", "scaling_settings_test.ts", "select_mixin_test.ts", - "settings_select_test.ts", + "settings_select_test.js", + "system_dialog_browsertest.js", "test_plugin_proxy.ts", ]
diff --git a/chrome/test/data/webui/print_preview/settings_select_test.ts b/chrome/test/data/webui/print_preview/settings_select_test.js similarity index 69% rename from chrome/test/data/webui/print_preview/settings_select_test.ts rename to chrome/test/data/webui/print_preview/settings_select_test.js index 8546782..7ab0a22 100644 --- a/chrome/test/data/webui/print_preview/settings_select_test.ts +++ b/chrome/test/data/webui/print_preview/settings_select_test.js
@@ -3,21 +3,21 @@ // found in the LICENSE file. import 'chrome://print/print_preview.js'; - -import {PrintPreviewModelElement, PrintPreviewSettingsSelectElement} from 'chrome://print/print_preview.js'; +import {assert} from 'chrome://resources/js/assert.m.js'; import {flush} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js'; -import {assertEquals, assertFalse, assertTrue} from 'chrome://webui-test/chai_assert.js'; import {eventToPromise, fakeDataBind} from 'chrome://webui-test/test_util.js'; - import {getMediaSizeCapabilityWithCustomNames, selectOption} from './print_preview_test_utils.js'; suite('SettingsSelectTest', function() { - let settingsSelect: PrintPreviewSettingsSelectElement; + /** @type {?PrintPreviewSettingsSelectElement} */ + let settingsSelect = null; - let model: PrintPreviewModelElement; + /** @type {?PrintPreviewModelElement} */ + let model = null; + /** @override */ setup(function() { - document.body.innerHTML = ''; + PolymerTest.clearBody(); model = document.createElement('print-preview-model'); document.body.appendChild(model); @@ -35,20 +35,20 @@ // Set a capability with custom paper sizes. settingsSelect.settingName = 'mediaSize'; settingsSelect.capability = getMediaSizeCapabilityWithCustomNames(); - const customLocalizedMediaName = - settingsSelect.capability!.option[0]!.custom_display_name_localized![0]! - .value; + const customLocalizedMediaName = settingsSelect.capability.option[0] + .custom_display_name_localized[0] + .value; const customMediaName = - settingsSelect.capability!.option[1]!.custom_display_name; + settingsSelect.capability.option[1].custom_display_name; flush(); - const select = settingsSelect.shadowRoot!.querySelector('select')!; + const select = settingsSelect.shadowRoot.querySelector('select'); // Verify that the selected option and names are as expected. assertEquals(0, select.selectedIndex); assertEquals(2, select.options.length); assertEquals( - customLocalizedMediaName, select.options[0]!.textContent!.trim()); - assertEquals(customMediaName, select.options[1]!.textContent!.trim()); + customLocalizedMediaName, select.options[0].textContent.trim()); + assertEquals(customMediaName, select.options[1].textContent.trim()); }); test('set setting', async () => { @@ -72,23 +72,23 @@ ], }; flush(); - const option0 = JSON.stringify(settingsSelect.capability!.option[0]!); - const option1 = JSON.stringify(settingsSelect.capability!.option[1]!); - const select = settingsSelect.shadowRoot!.querySelector('select')!; + const option0 = JSON.stringify(settingsSelect.capability.option[0]); + const option1 = JSON.stringify(settingsSelect.capability.option[1]); + const select = settingsSelect.shadowRoot.querySelector('select'); // Normally done for initialization by the model and parent section. settingsSelect.set( - 'settings.fruit.value', settingsSelect.capability!.option[1]!); + 'settings.fruit.value', settingsSelect.capability.option[1]); settingsSelect.selectValue(option1); // Verify that the selected option and names are as expected. assertEquals(2, select.options.length); assertEquals(1, select.selectedIndex); assertFalse(settingsSelect.getSetting('fruit').setFromUi); - assertEquals('lime', select.options[0]!.textContent!.trim()); - assertEquals('orange', select.options[1]!.textContent!.trim()); - assertEquals(option0, select.options[0]!.value); - assertEquals(option1, select.options[1]!.value); + assertEquals('lime', select.options[0].textContent.trim()); + assertEquals('orange', select.options[1].textContent.trim()); + assertEquals(option0, select.options[0].value); + assertEquals(option1, select.options[1].value); // Verify that selecting an new option in the dropdown sets the setting. await selectOption(settingsSelect, option0);
diff --git a/chrome/test/data/webui/print_preview/system_dialog_browsertest.js b/chrome/test/data/webui/print_preview/system_dialog_browsertest.js new file mode 100644 index 0000000..5ba9176 --- /dev/null +++ b/chrome/test/data/webui/print_preview/system_dialog_browsertest.js
@@ -0,0 +1,136 @@ +// 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. + +import {Destination, DestinationConnectionStatus, DestinationOrigin, DestinationType, NativeLayerImpl, PluginProxyImpl, PrintPreviewLinkContainerElement, PrintPreviewSidebarElement, whenReady} from 'chrome://print/print_preview.js'; +import {assert} from 'chrome://resources/js/assert.m.js'; +import {isWindows} from 'chrome://resources/js/cr.m.js'; +import {eventToPromise, waitBeforeNextRender} from 'chrome://webui-test/test_util.js'; +import {NativeLayerStub} from './native_layer_stub.js'; +import {getCddTemplate, getDefaultInitialSettings, selectOption} from './print_preview_test_utils.js'; +import {TestPluginProxy} from './test_plugin_proxy.js'; + +window.system_dialog_browsertest = {}; +system_dialog_browsertest.suiteName = 'SystemDialogBrowserTest'; +/** @enum {string} */ +system_dialog_browsertest.TestNames = { + LinkTriggersLocalPrint: 'link triggers local print', + InvalidSettingsDisableLink: 'invalid settings disable link', +}; + +suite(system_dialog_browsertest.suiteName, function() { + /** @type {?PrintPreviewSidebarElement} */ + let sidebar = null; + + /** @type {?NativeLayer} */ + let nativeLayer = null; + + /** @type {?PrintPreviewLinkContainerElement} */ + let linkContainer = null; + + /** @type {?HTMLElement} */ + let link = null; + + /** @type {string} */ + let printTicketKey = ''; + + /** @override */ + setup(function() { + nativeLayer = new NativeLayerStub(); + NativeLayerImpl.setInstance(nativeLayer); + document.body.innerHTML = ''; + + const initialSettings = getDefaultInitialSettings(); + nativeLayer.setInitialSettings(initialSettings); + nativeLayer.setLocalDestinations( + [{deviceName: initialSettings.printerName, printerName: 'FooName'}]); + const pluginProxy = new TestPluginProxy(); + PluginProxyImpl.setInstance(pluginProxy); + + const page = document.createElement('print-preview-app'); + document.body.appendChild(page); + const previewArea = page.$.previewArea; + sidebar = page.shadowRoot.querySelector('print-preview-sidebar'); + return Promise + .all([ + waitBeforeNextRender(page), + whenReady(), + nativeLayer.whenCalled('getInitialSettings'), + nativeLayer.whenCalled('getPrinterCapabilities'), + ]) + .then(function() { + linkContainer = + sidebar.shadowRoot.querySelector('print-preview-link-container'); + return nativeLayer.whenCalled('getPreview'); + }) + .then(function() { + assertEquals('FooDevice', page.destination_.id); + link = isWindows ? linkContainer.$.systemDialogLink : + linkContainer.$.openPdfInPreviewLink; + printTicketKey = isWindows ? 'showSystemDialog' : 'openPDFInPreview'; + }); + }); + + test( + assert(system_dialog_browsertest.TestNames.LinkTriggersLocalPrint), + function() { + assertFalse(linkContainer.disabled); + assertFalse(link.hidden); + link.click(); + // Should result in a print call and dialog should close. + return nativeLayer.whenCalled('print').then(function(printTicket) { + expectTrue(JSON.parse(printTicket)[printTicketKey]); + return nativeLayer.whenCalled('dialogClose'); + }); + }); + + test( + assert(system_dialog_browsertest.TestNames.InvalidSettingsDisableLink), + function() { + assertFalse(linkContainer.disabled); + assertFalse(link.hidden); + + const moreSettingsElement = + sidebar.shadowRoot.querySelector('print-preview-more-settings'); + moreSettingsElement.$.label.click(); + const scalingSettings = + sidebar.shadowRoot.querySelector('print-preview-scaling-settings'); + assertFalse(scalingSettings.hidden); + nativeLayer.resetResolver('getPreview'); + let previewCalls = 0; + + // Set scaling settings to custom. + return selectOption( + scalingSettings, + scalingSettings.ScalingValue.CUSTOM.toString()) + .then(() => { + previewCalls = nativeLayer.getCallCount('getPreview'); + + // Set an invalid input. + const scalingSettingsInput = + scalingSettings.shadowRoot + .querySelector('print-preview-number-settings-section') + .$.userValue.inputElement; + scalingSettingsInput.value = '0'; + scalingSettingsInput.dispatchEvent( + new CustomEvent('input', {composed: true, bubbles: true})); + + return eventToPromise('input-change', scalingSettings); + }) + .then(() => { + // Expect disabled print button + const parentElement = sidebar.shadowRoot.querySelector( + 'print-preview-button-strip'); + const printButton = + parentElement.shadowRoot.querySelector('.action-button'); + assertTrue(printButton.disabled); + assertTrue(linkContainer.disabled); + assertFalse(link.hidden); + assertTrue(link.querySelector('cr-icon-button').disabled); + + // No new preview + assertEquals( + previewCalls, nativeLayer.getCallCount('getPreview')); + }); + }); +});
diff --git a/chrome/test/data/webui/print_preview/system_dialog_browsertest.ts b/chrome/test/data/webui/print_preview/system_dialog_browsertest.ts deleted file mode 100644 index d68c9ec..0000000 --- a/chrome/test/data/webui/print_preview/system_dialog_browsertest.ts +++ /dev/null
@@ -1,142 +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. - -import {CrButtonElement, NativeLayerImpl, PluginProxyImpl, PrintPreviewLinkContainerElement, PrintPreviewSidebarElement, ScalingType, whenReady} from 'chrome://print/print_preview.js'; -import {assert} from 'chrome://resources/js/assert.m.js'; -import {assertEquals, assertFalse, assertTrue} from 'chrome://webui-test/chai_assert.js'; -import {eventToPromise, waitBeforeNextRender} from 'chrome://webui-test/test_util.js'; -import {NativeLayerStub} from './native_layer_stub.js'; -import {getDefaultInitialSettings, selectOption} from './print_preview_test_utils.js'; -import {TestPluginProxy} from './test_plugin_proxy.js'; - -const system_dialog_browsertest = { - suiteName: 'SystemDialogBrowserTest', - TestNames: { - LinkTriggersLocalPrint: 'link triggers local print', - InvalidSettingsDisableLink: 'invalid settings disable link', - }, -}; - -Object.assign(window, {system_dialog_browsertest: system_dialog_browsertest}); - -suite(system_dialog_browsertest.suiteName, function() { - let sidebar: PrintPreviewSidebarElement; - - let nativeLayer: NativeLayerStub; - - let linkContainer: PrintPreviewLinkContainerElement; - - let link: HTMLElement; - - // <if expr="is_win"> - let printTicketKey: string = 'showSystemDialog'; - // </if> - // <if expr="is_macosx"> - let printTicketKey: string = 'openPDFinPreview'; - // </if> - - setup(function() { - nativeLayer = new NativeLayerStub(); - NativeLayerImpl.setInstance(nativeLayer); - document.body.innerHTML = ''; - - const initialSettings = getDefaultInitialSettings(); - nativeLayer.setInitialSettings(initialSettings); - nativeLayer.setLocalDestinations( - [{deviceName: initialSettings.printerName, printerName: 'FooName'}]); - const pluginProxy = new TestPluginProxy(); - PluginProxyImpl.setInstance(pluginProxy); - - const page = document.createElement('print-preview-app'); - document.body.appendChild(page); - sidebar = page.shadowRoot!.querySelector('print-preview-sidebar')!; - return Promise - .all([ - waitBeforeNextRender(page), - whenReady(), - nativeLayer.whenCalled('getInitialSettings'), - nativeLayer.whenCalled('getPrinterCapabilities'), - ]) - .then(function() { - linkContainer = sidebar.shadowRoot!.querySelector( - 'print-preview-link-container')!; - return nativeLayer.whenCalled('getPreview'); - }) - .then(function() { - assertEquals( - 'FooDevice', - sidebar.shadowRoot! - .querySelector( - 'print-preview-destination-settings')!.destination!.id); - // <if expr="is_win"> - link = linkContainer.$.systemDialogLink; - // </if> - // <if expr="is_macosx"> - link = linkContainer.$.openPdfInPreviewLink; - // </if> - }); - }); - - test( - assert(system_dialog_browsertest.TestNames.LinkTriggersLocalPrint), - function() { - assertFalse(linkContainer.disabled); - assertFalse(link.hidden); - link.click(); - // Should result in a print call and dialog should close. - return nativeLayer.whenCalled('print').then((printTicket: string) => { - assertTrue(JSON.parse(printTicket)[printTicketKey]); - return nativeLayer.whenCalled('dialogClose'); - }); - }); - - test( - assert(system_dialog_browsertest.TestNames.InvalidSettingsDisableLink), - function() { - assertFalse(linkContainer.disabled); - assertFalse(link.hidden); - - const moreSettingsElement = - sidebar.shadowRoot!.querySelector('print-preview-more-settings')!; - moreSettingsElement.$.label.click(); - const scalingSettings = sidebar.shadowRoot!.querySelector( - 'print-preview-scaling-settings')!; - assertFalse(scalingSettings.hidden); - nativeLayer.resetResolver('getPreview'); - let previewCalls = 0; - - // Set scaling settings to custom. - return selectOption(scalingSettings, ScalingType.CUSTOM.toString()) - .then(() => { - previewCalls = nativeLayer.getCallCount('getPreview'); - - // Set an invalid input. - const scalingSettingsInput = - scalingSettings.shadowRoot! - .querySelector('print-preview-number-settings-section')!.$ - .userValue.inputElement; - scalingSettingsInput.value = '0'; - scalingSettingsInput.dispatchEvent( - new CustomEvent('input', {composed: true, bubbles: true})); - - return eventToPromise('input-change', scalingSettings); - }) - .then(() => { - // Expect disabled print button - const parentElement = sidebar.shadowRoot!.querySelector( - 'print-preview-button-strip')!; - const printButton = - parentElement.shadowRoot!.querySelector<CrButtonElement>( - '.action-button')!; - assertTrue(printButton.disabled); - assertTrue(linkContainer.disabled); - assertFalse(link.hidden); - assertTrue(link.querySelector('cr-icon-button')!.disabled); - - // No new preview - assertEquals( - previewCalls, nativeLayer.getCallCount('getPreview')); - }); - }); -});
diff --git a/chrome/test/data/webui/print_preview/tsconfig_base.json b/chrome/test/data/webui/print_preview/tsconfig_base.json index 63561619..6dbee097 100644 --- a/chrome/test/data/webui/print_preview/tsconfig_base.json +++ b/chrome/test/data/webui/print_preview/tsconfig_base.json
@@ -1,6 +1,7 @@ { "extends": "../../../../../tools/typescript/tsconfig_base.json", "compilerOptions": { + "allowJs": true, "typeRoots": [ "./../../../../../third_party/node/node_modules/@types" ]
diff --git a/chrome/test/data/webui/print_preview/user_manager_test.ts b/chrome/test/data/webui/print_preview/user_manager_test.js similarity index 81% rename from chrome/test/data/webui/print_preview/user_manager_test.ts rename to chrome/test/data/webui/print_preview/user_manager_test.js index 15f5297..35546ce 100644 --- a/chrome/test/data/webui/print_preview/user_manager_test.ts +++ b/chrome/test/data/webui/print_preview/user_manager_test.js
@@ -2,11 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -import {CloudPrintInterfaceImpl, DestinationStore, LocalDestinationInfo, NativeLayerImpl, PrintPreviewUserManagerElement} from 'chrome://print/print_preview.js'; +import {CloudPrintInterfaceImpl, DestinationStore, NativeLayerImpl} from 'chrome://print/print_preview.js'; +import {assert} from 'chrome://resources/js/assert.m.js'; import {webUIListenerCallback} from 'chrome://resources/js/cr.m.js'; -import {assertEquals} from 'chrome://webui-test/chai_assert.js'; import {CloudPrintInterfaceStub} from './cloud_print_interface_stub.js'; + // <if expr="chromeos or lacros"> import {setNativeLayerCrosInstance} from './native_layer_cros_stub.js'; // </if> @@ -16,21 +17,27 @@ suite('UserManagerTest', function() { - let userManager: PrintPreviewUserManagerElement; + /** @type {?PrintPreviewUserManagerElement} */ + let userManager = null; - let destinationStore: DestinationStore; + /** @type {?DestinationStore} */ + let destinationStore = null; - let nativeLayer: NativeLayerStub; + /** @type {?NativeLayer} */ + let nativeLayer = null; - let cloudPrintInterface: CloudPrintInterfaceStub; + /** @type {?CloudPrintInterface} */ + let cloudPrintInterface = null; - const account1: string = 'foo@chromium.org'; - const account2: string = 'bar@chromium.org'; + const account1 = 'foo@chromium.org'; + const account2 = 'bar@chromium.org'; + /** @override */ suiteSetup(function() { setupTestListenerElement(); }); + /** @override */ setup(function() { document.body.innerHTML = ''; @@ -50,12 +57,14 @@ // Initialize destination store. destinationStore = createDestinationStore(); destinationStore.setCloudPrintInterface(cloudPrintInterface); - const localDestinations: LocalDestinationInfo[] = []; - getDestinations(localDestinations); + const localDestinations = []; + const destinations = getDestinations(localDestinations); nativeLayer.setLocalDestinations(localDestinations); // Set up user manager + userManager.appKioskMode = false; userManager.destinationStore = destinationStore; + userManager.shouldReloadCookies = false; userManager.cloudPrintDisabled = false; document.body.appendChild(userManager);
diff --git a/chrome/updater/win/setup/setup_util.cc b/chrome/updater/win/setup/setup_util.cc index a136926..3173d9a2 100644 --- a/chrome/updater/win/setup/setup_util.cc +++ b/chrome/updater/win/setup/setup_util.cc
@@ -35,30 +35,7 @@ #include "chrome/updater/win/win_constants.h" #include "chrome/updater/win/win_util.h" -// Specialization for std::hash so that IID instances can be stored in an -// associative container. This implementation of the hash function adds -// together four 32-bit integers which make up an IID. The function does not -// have to be efficient or guarantee no collisions. It is used infrequently, -// for a small number of IIDs, and the container deals with collisions. -template <> -struct std::hash<IID> { - size_t operator()(const IID& iid) const { - return iid.Data1 + (iid.Data2 + (iid.Data3 << 16)) + [&iid]() { - size_t val = 0; - for (int i = 0; i < 2; ++i) { - for (int j = 0; j < 4; ++j) { - val += (iid.Data4[j + i * 4] << (j * 4)); - } - } - return val; - }(); - } -}; - namespace updater { -namespace { - -} // namespace bool RegisterWakeTask(const base::CommandLine& run_command, UpdaterScope scope) {
diff --git a/chrome/updater/win/win_util.h b/chrome/updater/win/win_util.h index f5f00979..97ee823 100644 --- a/chrome/updater/win/win_util.h +++ b/chrome/updater/win/win_util.h
@@ -7,10 +7,11 @@ #include <winerror.h> -#include <stdint.h> - +#include <cstdint> #include <string> +#include "base/containers/span.h" +#include "base/hash/hash.h" #include "base/process/process_iterator.h" #include "base/win/atl.h" #include "base/win/scoped_handle.h" @@ -21,6 +22,17 @@ class FilePath; } +// Specialization for std::hash so that IID values can be stored in an +// associative container. +template <> +struct std::hash<IID> { + size_t operator()(const IID& iid) const { + static_assert(sizeof(iid) == 16, "IID storage must be contiguous."); + return base::FastHash(base::span<const uint8_t>( + reinterpret_cast<const uint8_t*>(&iid), sizeof(iid))); + } +}; + namespace updater { class ProcessFilterName : public base::ProcessFilter {
diff --git a/chromecast/cast_core/BUILD.gn b/chromecast/cast_core/BUILD.gn index 07da09b..9ca6302 100644 --- a/chromecast/cast_core/BUILD.gn +++ b/chromecast/cast_core/BUILD.gn
@@ -111,18 +111,22 @@ "//chromecast/base", "//chromecast/base:chromecast_switches", "//chromecast/base:default_create_sys_info", - "//chromecast/browser:browser_base", - "//chromecast/browser:public", + "//chromecast/browser", "//third_party/blink/public/common:headers", - "//third_party/cast_core/public/src/proto/v2:core_application_service_proto", "//third_party/grpc:grpc++", ] + public_deps = [ + "//chromecast/browser:public", + "//third_party/cast_core/public/src/proto/v2:core_application_service_proto", + ] + if (enable_chromecast_extensions) { sources += [ "grpc_webui_controller_extension.cc", "grpc_webui_controller_extension.h", ] + deps += [ "//components/guest_view/browser", "//extensions/browser", @@ -174,16 +178,17 @@ ] public_deps = [ + ":runtime_application_dispatcher", "//base", + "//chromecast/browser", "//chromecast/media/cma/backend/proxy:headers", + "//chromecast/metrics:cast_event_builder_simple", "//chromecast/service", ] } -cast_source_set("cast_runtime_service_impl") { +cast_source_set("runtime_application_dispatcher") { sources = [ - "cast_runtime_service_impl.cc", - "cast_runtime_service_impl.h", "runtime_application_base.cc", "runtime_application_base.h", "runtime_application_dispatcher.cc", @@ -195,14 +200,13 @@ ] public_deps = [ - ":cast_runtime_service", ":grpc_impl", ":grpc_support", ":grpc_webui", ":metrics_recorder", ":runtime_application", "//base", - "//chromecast/browser:public", + "//chromecast/browser", "//chromecast/common:feature_constants", "//components/cast_streaming/public/mojom", "//components/url_rewrite/browser", @@ -217,7 +221,6 @@ deps = [ ":core_service_bindings", ":streaming_receiver_session_client", - "//chromecast/browser:browser_base", "//chromecast/cast_core/url_rewrite", "//chromecast/metrics:cast_event_builder_simple", "//components/cast/message_port", @@ -228,14 +231,66 @@ "//third_party/blink/public/common:headers", "//third_party/openscreen/src/cast/common:public", ] +} - if (chromecast_branding == "public") { - sources += [ "cast_runtime_service_simple.cc" ] +cast_source_set("streaming_receiver_session_client") { + sources = [ + "streaming_receiver_session_client.cc", + "streaming_receiver_session_client.h", + ] + + public_deps = [ + "//base", + "//chromecast/browser:public", + "//components/cast/message_port", + "//components/cast_streaming/browser", + ] + + deps = [ + "//base", + "//chromecast/shared:platform_info_serializer", + "//components/cast/message_port:message_port_core", + "//components/cast_streaming/public", + "//components/cast_streaming/public/mojom", + "//content/public/browser", + "//mojo/public/cpp/bindings", + "//third_party/blink/public/common:headers", + ] +} + +cast_source_set("browser") { + sources = [ + "cast_core_switches.h", + "cast_runtime_content_browser_client.cc", + "cast_runtime_content_browser_client.h", + ] + + deps = [ + ":cast_runtime_service", + ":cors_exempt_headers", + "//base", + "//components/url_rewrite/browser", + "//components/url_rewrite/common", + "//content/public/common", + "//media", + "//third_party/cast_core/public/src/proto/runtime:runtime_service_proto", + ] + + public_deps = [ "//chromecast/browser" ] + + if (enable_cast_media_runtime) { + sources += [ "cast_content_browser_client_factory.cc" ] } else { - deps += [ "//chromecast/internal/cast_core/runtime:cast_runtime_service" ] + deps += [ "//chromecast/browser:simple_client" ] } } +cast_source_set("browser_simple") { + sources = [ "cast_runtime_content_browser_client_simple.cc" ] + + deps = [ ":browser" ] +} + cast_source_set("renderer") { sources = [ "cast_runtime_content_renderer_client.cc", @@ -262,72 +317,6 @@ if (enable_cast_media_runtime) { sources += [ "cast_content_renderer_client_factory.cc" ] } - - # TODO(vigeni): Doesn't look like this is needed. - if (chromecast_branding != "public") { - deps += [ "//chromecast/internal/cast_core/runtime:renderer" ] - } -} - -cast_source_set("browser") { - sources = [ - "cast_core_switches.h", - "cast_runtime_content_browser_client.cc", - "cast_runtime_content_browser_client.h", - ] - - deps = [ - ":cast_runtime_service", - ":cors_exempt_headers", - ":runtime_application", - "//base", - "//components/url_rewrite/browser", - "//components/url_rewrite/common", - "//content/public/common", - "//media", - "//third_party/cast_core/public/src/proto/runtime:runtime_service_proto", - ] - - public_deps = [ - "//chromecast/browser", - ] - - if (enable_cast_media_runtime) { - sources += [ "cast_content_browser_client_factory.cc" ] - } else { - deps += [ "//chromecast/browser:simple_client" ] - } - - if (chromecast_branding == "public") { - sources += [ "cast_runtime_content_browser_client_simple.cc" ] - } else { - deps += [ "//chromecast/internal/cast_core/runtime:browser" ] - } -} - -cast_source_set("streaming_receiver_session_client") { - sources = [ - "streaming_receiver_session_client.cc", - "streaming_receiver_session_client.h", - ] - - public_deps = [ - "//base", - "//chromecast/browser:public", - "//components/cast/message_port", - "//components/cast_streaming/browser", - ] - - deps = [ - "//base", - "//chromecast/shared:platform_info_serializer", - "//components/cast/message_port:message_port_core", - "//components/cast_streaming/public", - "//components/cast_streaming/public/mojom", - "//content/public/browser", - "//mojo/public/cpp/bindings", - "//third_party/blink/public/common:headers", - ] } # When built for use with Cast Core, enble_cast_media_runtime must be true. @@ -335,13 +324,14 @@ sources = [ "cast_runtime_main.cc" ] deps = [ - ":browser", - ":cast_runtime_service_impl", + ":browser_simple", ":renderer", "//chromecast:cast_shell_pak", "//chromecast:chromecast_locales_pak", "//chromecast/app", "//chromecast/base:default_create_sys_info", + "//chromecast/browser:browser_base", + "//chromecast/browser:prefs_simple", "//chromecast/browser:simple_main_parts", "//chromecast/utility:simple_client", "//content/public/app", @@ -371,41 +361,48 @@ "cast_runtime_histogram_flattener_unittest.cc", "cast_runtime_metrics_test_helpers.cc", "cast_runtime_metrics_test_helpers.h", - "cast_runtime_service_dummy.cc", "cors_exempt_headers_unittest.cc", "grpc_resource_data_source_unittest.cc", "streaming_receiver_session_client_unittest.cc", ] deps = [ - ":browser", - ":cast_runtime_service", ":cors_exempt_headers", ":grpc_webui", ":metrics_recorder", ":streaming_receiver_session_client", "//base", "//base/test:test_support", - "//chromecast/base/metrics", - "//chromecast/browser:simple_main_parts", "//chromecast/browser:test_support", - "//chromecast/cast_core/url_rewrite:unit_tests", "//chromecast/common:cors_exempt_headers", "//chromecast/shared:platform_info_serializer", "//components/cast_streaming/browser", - "//components/cast_streaming/public/mojom", - "//mojo/core/test:run_all_unittests", - "//mojo/public/cpp/bindings", + "//components/cast_streaming/public", "//testing/gmock", "//testing/gtest", "//third_party/cast_core/public/src/proto/metrics:metrics_recorder_proto", - "//third_party/cast_core/public/src/proto/v2:core_application_service_proto", "//third_party/grpc:grpc++", - "//third_party/inspector_protocol:crdtp", "//third_party/metrics_proto", ] } +# A group of all unit test targets to be linked internally. +group("all_unit_tests") { + testonly = true + + deps = [ + ":unit_tests", + "//chromecast/cast_core/url_rewrite:unit_tests", + ] +} + test("cast_cast_core_unittests") { - deps = [ ":unit_tests" ] + deps = [ + ":all_unit_tests", + ":browser_simple", + ":renderer", + "//chromecast/browser:prefs_simple", + "//chromecast/browser:simple_main_parts", + "//mojo/core/test:run_all_unittests", + ] }
diff --git a/chromecast/cast_core/cast_runtime_content_browser_client.cc b/chromecast/cast_core/cast_runtime_content_browser_client.cc index 1af1429..5b75fb5 100644 --- a/chromecast/cast_core/cast_runtime_content_browser_client.cc +++ b/chromecast/cast_core/cast_runtime_content_browser_client.cc
@@ -25,6 +25,10 @@ CastRuntimeContentBrowserClient::~CastRuntimeContentBrowserClient() = default; +CastRuntimeService* CastRuntimeContentBrowserClient::GetCastRuntimeService() { + return cast_runtime_service_; +} + std::unique_ptr<CastService> CastRuntimeContentBrowserClient::CreateCastService( content::BrowserContext* browser_context, CastSystemMemoryPressureEvaluatorAdjuster* memory_pressure_adjuster, @@ -41,9 +45,8 @@ return client->GetSystemNetworkContext(); }, this); - auto cast_runtime_service = CastRuntimeService::Create( - GetMediaTaskRunner(), web_service, media_pipeline_backend_manager(), - std::move(network_context_getter), pref_service, video_plane_controller); + auto cast_runtime_service = std::make_unique<CastRuntimeService>( + web_service, std::move(network_context_getter)); cast_runtime_service_ = cast_runtime_service.get(); return cast_runtime_service; } @@ -108,9 +111,10 @@ std::unique_ptr<blink::URLLoaderThrottle> CastRuntimeContentBrowserClient::CreateUrlRewriteRulesThrottle( content::WebContents* web_contents) { - DCHECK(cast_runtime_service_); + CastRuntimeService* cast_runtime_service = GetCastRuntimeService(); + DCHECK(cast_runtime_service); - RuntimeApplication* app = cast_runtime_service_->GetRuntimeApplication(); + RuntimeApplication* app = cast_runtime_service->GetRuntimeApplication(); DCHECK(app); url_rewrite::UrlRequestRewriteRulesManager* url_rewrite_rules_manager =
diff --git a/chromecast/cast_core/cast_runtime_content_browser_client.h b/chromecast/cast_core/cast_runtime_content_browser_client.h index 61fb5dd3..c1f0b5be 100644 --- a/chromecast/cast_core/cast_runtime_content_browser_client.h +++ b/chromecast/cast_core/cast_runtime_content_browser_client.h
@@ -21,6 +21,9 @@ CastFeatureListCreator* feature_list_creator); ~CastRuntimeContentBrowserClient() override; + // Returns an instance of |CastRuntimeService|. + virtual CastRuntimeService* GetCastRuntimeService(); + // CastContentBrowserClient overrides: std::unique_ptr<CastService> CreateCastService( content::BrowserContext* browser_context, @@ -30,7 +33,7 @@ CastWindowManager* window_manager, CastWebService* web_service, DisplaySettingsManager* display_settings_manager, - shell::AccessibilityServiceImpl* accessibility_service) final; + shell::AccessibilityServiceImpl* accessibility_service) override; void OverrideWebkitPrefs(content::WebContents* web_contents, blink::web_pref::WebPreferences* prefs) override; std::unique_ptr<::media::CdmFactory> CreateCdmFactory(
diff --git a/chromecast/cast_core/cast_runtime_service.cc b/chromecast/cast_core/cast_runtime_service.cc index 0772752..bfa3ed3 100644 --- a/chromecast/cast_core/cast_runtime_service.cc +++ b/chromecast/cast_core/cast_runtime_service.cc
@@ -4,8 +4,63 @@ #include "chromecast/cast_core/cast_runtime_service.h" +#include "base/command_line.h" +#include "base/process/process.h" +#include "chromecast/browser/cast_browser_process.h" +#include "chromecast/metrics/cast_event_builder_simple.h" + namespace chromecast { +namespace { + +const char kCastCoreRuntimeIdSwitch[] = "cast-core-runtime-id"; +const char kRuntimeServicePathSwitch[] = "runtime-service-path"; + +} // namespace + +CastRuntimeService::CastRuntimeService( + CastWebService* web_service, + NetworkContextGetter network_context_getter) + : app_dispatcher_(web_service, this, std::move(network_context_getter)) {} CastRuntimeService::~CastRuntimeService() = default; +void CastRuntimeService::InitializeInternal() {} + +void CastRuntimeService::FinalizeInternal() {} + +void CastRuntimeService::StartInternal() { + auto* command_line = base::CommandLine::ForCurrentProcess(); + std::string runtime_id = + command_line->GetSwitchValueASCII(kCastCoreRuntimeIdSwitch); + std::string runtime_service_path = + command_line->GetSwitchValueASCII(kRuntimeServicePathSwitch); + if (!app_dispatcher_.Start(runtime_id, runtime_service_path)) { + base::Process::TerminateCurrentProcessImmediately(1); + } +} + +void CastRuntimeService::StopInternal() { + app_dispatcher_.Stop(); +} + +std::unique_ptr<CastEventBuilder> CastRuntimeService::CreateEventBuilder() { + return std::make_unique<CastEventBuilderSimple>(); +} + +const std::string& CastRuntimeService::GetAudioChannelEndpoint() { + return app_dispatcher_.GetCastMediaServiceGrpcEndpoint(); +} + +WebCryptoServer* CastRuntimeService::GetWebCryptoServer() { + return nullptr; +} + +receiver::MediaManager* CastRuntimeService::GetMediaManager() { + return nullptr; +} + +RuntimeApplication* CastRuntimeService::GetRuntimeApplication() { + return app_dispatcher_.GetRuntimeApplication(); +} + } // namespace chromecast
diff --git a/chromecast/cast_core/cast_runtime_service.h b/chromecast/cast_core/cast_runtime_service.h index f7b63923..816658d 100644 --- a/chromecast/cast_core/cast_runtime_service.h +++ b/chromecast/cast_core/cast_runtime_service.h
@@ -8,15 +8,12 @@ #include <memory> #include "base/memory/scoped_refptr.h" +#include "chromecast/cast_core/cast_runtime_metrics_recorder.h" +#include "chromecast/cast_core/cast_runtime_service.h" +#include "chromecast/cast_core/runtime_application_dispatcher.h" #include "chromecast/media/cma/backend/proxy/cast_runtime_audio_channel_endpoint_manager.h" #include "chromecast/service/cast_service.h" -class PrefService; - -namespace base { -class SingleThreadTaskRunner; -} // namespace base - namespace network { namespace mojom { class NetworkContext; @@ -29,11 +26,6 @@ class WebCryptoServer; class RuntimeApplication; -namespace media { -class MediaPipelineBackendManager; -class VideoPlaneController; -} // namespace media - namespace receiver { class MediaManager; } // namespace receiver @@ -43,34 +35,40 @@ // implementation. class CastRuntimeService : public CastService, + public CastRuntimeMetricsRecorder::EventBuilderFactory, public media::CastRuntimeAudioChannelEndpointManager { public: using NetworkContextGetter = base::RepeatingCallback<network::mojom::NetworkContext*()>; - // Creates an instance of |CastRuntimeService| interface. - static std::unique_ptr<CastRuntimeService> Create( - scoped_refptr<base::SingleThreadTaskRunner> task_runner, - CastWebService* web_service, - media::MediaPipelineBackendManager* media_pipeline_backend_manager, - NetworkContextGetter network_context_getter, - PrefService* pref_service, - media::VideoPlaneController* video_plane_controller); - + CastRuntimeService(CastWebService* web_service, + NetworkContextGetter network_context_getter); ~CastRuntimeService() override; // Returns WebCryptoServer. - virtual WebCryptoServer* GetWebCryptoServer() = 0; + virtual WebCryptoServer* GetWebCryptoServer(); // Returns MediaManager. - virtual receiver::MediaManager* GetMediaManager() = 0; - - // Returns a pointer to CastWebService object with lifespan - // equal to CastRuntimeService main object. - virtual CastWebService* GetCastWebService() = 0; + virtual receiver::MediaManager* GetMediaManager(); // Returns a pointer to RuntimeApplication. - virtual RuntimeApplication* GetRuntimeApplication() = 0; + virtual RuntimeApplication* GetRuntimeApplication(); + + protected: + // CastService implementation: + void InitializeInternal() override; + void FinalizeInternal() override; + void StartInternal() override; + void StopInternal() override; + + // CastRuntimeMetricsRecorder::EventBuilderFactory implementation: + std::unique_ptr<CastEventBuilder> CreateEventBuilder() override; + + // CastRuntimeAudioChannelEndpointManager implementation: + const std::string& GetAudioChannelEndpoint() override; + + private: + RuntimeApplicationDispatcher app_dispatcher_; }; } // namespace chromecast
diff --git a/chromecast/cast_core/cast_runtime_service_dummy.cc b/chromecast/cast_core/cast_runtime_service_dummy.cc deleted file mode 100644 index c6b0fe3..0000000 --- a/chromecast/cast_core/cast_runtime_service_dummy.cc +++ /dev/null
@@ -1,50 +0,0 @@ -// Copyright 2021 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 "chromecast/cast_core/cast_runtime_service.h" - -#include "base/no_destructor.h" -#include "base/task/single_thread_task_runner.h" - -namespace chromecast { - -namespace { - -class CastRuntimeServiceDummy : public CastRuntimeService { - public: - ~CastRuntimeServiceDummy() override = default; - - // CastRuntimeService implementation: - WebCryptoServer* GetWebCryptoServer() override { return nullptr; } - receiver::MediaManager* GetMediaManager() override { return nullptr; } - CastWebService* GetCastWebService() override { return nullptr; } - RuntimeApplication* GetRuntimeApplication() override { return nullptr; } - - // CastService implementation: - void InitializeInternal() override {} - void FinalizeInternal() override {} - void StartInternal() override {} - void StopInternal() override {} - - // CastRuntimeAudioChannelEndpointManager implementation: - const std::string& GetAudioChannelEndpoint() override { - static const std::string kFakeAudioChannelEndpoint = ""; - return kFakeAudioChannelEndpoint; - } -}; - -} // namespace - -// static -std::unique_ptr<CastRuntimeService> CastRuntimeService::Create( - scoped_refptr<base::SingleThreadTaskRunner> task_runner, - CastWebService* web_service, - media::MediaPipelineBackendManager* media_pipeline_backend_manager, - CastRuntimeService::NetworkContextGetter network_context_getter, - PrefService* pref_service, - media::VideoPlaneController* video_plane_controller) { - return std::make_unique<CastRuntimeServiceDummy>(); -} - -} // namespace chromecast
diff --git a/chromecast/cast_core/cast_runtime_service_impl.cc b/chromecast/cast_core/cast_runtime_service_impl.cc deleted file mode 100644 index 4e334890..0000000 --- a/chromecast/cast_core/cast_runtime_service_impl.cc +++ /dev/null
@@ -1,71 +0,0 @@ -// Copyright 2021 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 "chromecast/cast_core/cast_runtime_service_impl.h" - -#include "base/command_line.h" -#include "base/process/process.h" -#include "chromecast/browser/cast_browser_process.h" -#include "chromecast/metrics/cast_event_builder_simple.h" - -namespace chromecast { -namespace { - -const char kCastCoreRuntimeIdSwitch[] = "cast-core-runtime-id"; -const char kRuntimeServicePathSwitch[] = "runtime-service-path"; - -} // namespace - -CastRuntimeServiceImpl::CastRuntimeServiceImpl( - CastWebService* web_service, - NetworkContextGetter network_context_getter) - : web_service_(web_service), - app_dispatcher_(web_service, this, std::move(network_context_getter)) {} - -CastRuntimeServiceImpl::~CastRuntimeServiceImpl() = default; - -void CastRuntimeServiceImpl::InitializeInternal() {} - -void CastRuntimeServiceImpl::FinalizeInternal() {} - -void CastRuntimeServiceImpl::StartInternal() { - auto* command_line = base::CommandLine::ForCurrentProcess(); - std::string runtime_id = - command_line->GetSwitchValueASCII(kCastCoreRuntimeIdSwitch); - std::string runtime_service_path = - command_line->GetSwitchValueASCII(kRuntimeServicePathSwitch); - if (!app_dispatcher_.Start(runtime_id, runtime_service_path)) { - base::Process::TerminateCurrentProcessImmediately(1); - } -} - -void CastRuntimeServiceImpl::StopInternal() { - app_dispatcher_.Stop(); -} - -std::unique_ptr<CastEventBuilder> CastRuntimeServiceImpl::CreateEventBuilder() { - return std::make_unique<CastEventBuilderSimple>(); -} - -const std::string& CastRuntimeServiceImpl::GetAudioChannelEndpoint() { - return app_dispatcher_.GetCastMediaServiceGrpcEndpoint(); -} - -WebCryptoServer* CastRuntimeServiceImpl::GetWebCryptoServer() { - return nullptr; -} - -receiver::MediaManager* CastRuntimeServiceImpl::GetMediaManager() { - return nullptr; -} - -CastWebService* CastRuntimeServiceImpl::GetCastWebService() { - return web_service_; -} - -RuntimeApplication* CastRuntimeServiceImpl::GetRuntimeApplication() { - return app_dispatcher_.GetRuntimeApplication(); -} - -} // namespace chromecast
diff --git a/chromecast/cast_core/cast_runtime_service_impl.h b/chromecast/cast_core/cast_runtime_service_impl.h deleted file mode 100644 index 46353972..0000000 --- a/chromecast/cast_core/cast_runtime_service_impl.h +++ /dev/null
@@ -1,57 +0,0 @@ -// Copyright 2021 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 CHROMECAST_CAST_CORE_CAST_RUNTIME_SERVICE_IMPL_H_ -#define CHROMECAST_CAST_CORE_CAST_RUNTIME_SERVICE_IMPL_H_ - -#include <memory> - -#include "chromecast/cast_core/cast_runtime_metrics_recorder.h" -#include "chromecast/cast_core/cast_runtime_service.h" -#include "chromecast/cast_core/runtime_application_dispatcher.h" - -namespace chromecast { - -class CastWebService; -class CastEventBuilder; -class RuntimeApplication; - -// This interface is to be used for building the Cast Runtime Service and act as -// the border between shared Chromium code and the specifics of that -// implementation. -class CastRuntimeServiceImpl - : public CastRuntimeService, - public CastRuntimeMetricsRecorder::EventBuilderFactory { - public: - CastRuntimeServiceImpl(CastWebService* web_service, - NetworkContextGetter network_context_getter); - ~CastRuntimeServiceImpl() override; - - protected: - // CastService implementation: - void InitializeInternal() override; - void FinalizeInternal() override; - void StartInternal() override; - void StopInternal() override; - - // CastRuntimeMetricsRecorder::EventBuilderFactory implementation: - std::unique_ptr<CastEventBuilder> CreateEventBuilder() override; - - // CastRuntimeService implementation: - WebCryptoServer* GetWebCryptoServer() override; - receiver::MediaManager* GetMediaManager() override; - CastWebService* GetCastWebService() override; - RuntimeApplication* GetRuntimeApplication() override; - - // CastRuntimeAudioChannelEndpointManager implementation: - const std::string& GetAudioChannelEndpoint() override; - - private: - CastWebService* const web_service_; - RuntimeApplicationDispatcher app_dispatcher_; -}; - -} // namespace chromecast - -#endif // CHROMECAST_CAST_CORE_CAST_RUNTIME_SERVICE_IMPL_H_
diff --git a/chromecast/cast_core/cast_runtime_service_simple.cc b/chromecast/cast_core/cast_runtime_service_simple.cc deleted file mode 100644 index efb682a..0000000 --- a/chromecast/cast_core/cast_runtime_service_simple.cc +++ /dev/null
@@ -1,22 +0,0 @@ -// Copyright 2021 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 "base/task/single_thread_task_runner.h" -#include "chromecast/cast_core/cast_runtime_service.h" -#include "chromecast/cast_core/cast_runtime_service_impl.h" - -namespace chromecast { - -std::unique_ptr<CastRuntimeService> CastRuntimeService::Create( - scoped_refptr<base::SingleThreadTaskRunner> task_runner, - CastWebService* web_service, - media::MediaPipelineBackendManager* media_pipeline_backend_manager, - CastRuntimeService::NetworkContextGetter network_context_getter, - PrefService* pref_service, - media::VideoPlaneController* video_plane_controller) { - return std::make_unique<CastRuntimeServiceImpl>( - web_service, std::move(network_context_getter)); -} - -} // namespace chromecast
diff --git a/chromecast/common/cast_redirect_manifest_handler.cc b/chromecast/common/cast_redirect_manifest_handler.cc index 0fd6c01..1953627 100644 --- a/chromecast/common/cast_redirect_manifest_handler.cc +++ b/chromecast/common/cast_redirect_manifest_handler.cc
@@ -42,9 +42,9 @@ } } - std::string url; - if (extension->manifest()->GetString(kCastUrl, &url)) { - info->cast_url = url; + if (const std::string* url = + extension->manifest()->FindStringPath(kCastUrl)) { + info->cast_url = *url; } if (!info->redirects.empty() || !info->cast_url.empty()) {
diff --git a/chromeos/BUILD.gn b/chromeos/BUILD.gn index b4bd9245..c39bc75 100644 --- a/chromeos/BUILD.gn +++ b/chromeos/BUILD.gn
@@ -74,7 +74,6 @@ if (is_chromeos_ash) { deps += [ "//chromeos/dbus:test_support", - "//chromeos/login/auth:test_support", "//chromeos/login/login_state:test_support", "//chromeos/network:test_support", "//chromeos/tpm:test_support", @@ -117,7 +116,6 @@ "//chromeos/dbus:unit_tests", "//chromeos/dbus/services:unit_tests", "//chromeos/language/language_packs:unit_tests", - "//chromeos/login/auth:unit_tests", "//chromeos/login/login_state:unit_tests", "//chromeos/memory:unit_tests", "//chromeos/network:test_support",
diff --git a/chromeos/crosapi/mojom/arc.mojom b/chromeos/crosapi/mojom/arc.mojom index 736b0ed..5384f93 100644 --- a/chromeos/crosapi/mojom/arc.mojom +++ b/chromeos/crosapi/mojom/arc.mojom
@@ -76,8 +76,8 @@ }; // Interacts with ARC. -// Next version: 1 -// Next method id: 3 +// Next version: 2 +// Next method id: 4 [Stable, Uuid="a39a22dd-2f5c-4c99-b0ea-d83d5b1c987f"] interface Arc { // Registers ArcObserver in Lacros-chrome to Ash-chrome @@ -97,4 +97,8 @@ // An array of IntentHandlerInfo will be returned. RequestUrlHandlerList@2(string url) => (array<IntentHandlerInfo> handlers); + + // Handles the URL by sending an ACTION_VIEW intent to the package. The + // most suitable activity for the URL within the package will be started. + [MinVersion=1] HandleUrl@3(string url, string package_name); };
diff --git a/chromeos/cryptohome/BUILD.gn b/chromeos/cryptohome/BUILD.gn index 5e4461f3..8b0d926 100644 --- a/chromeos/cryptohome/BUILD.gn +++ b/chromeos/cryptohome/BUILD.gn
@@ -10,13 +10,13 @@ component("cryptohome") { defines = [ "IS_CHROMEOS_CRYPTOHOME_IMPL" ] deps = [ + "//ash/components/login/auth:challenge_response_key", "//base", "//chromeos/dbus:common", "//chromeos/dbus/cryptohome", "//chromeos/dbus/cryptohome:cryptohome_proto", "//chromeos/dbus/userdataauth:userdataauth", "//chromeos/dbus/userdataauth:userdataauth_proto", - "//chromeos/login/auth:challenge_response_key", "//components/account_id", "//components/device_event_log", "//components/user_manager", @@ -37,13 +37,13 @@ testonly = true deps = [ ":cryptohome", + "//ash/components/login/auth:challenge_response_key", "//base", "//base/test:test_support", "//chromeos/dbus:test_support", "//chromeos/dbus/cryptohome:cryptohome_proto", "//chromeos/dbus/userdataauth:userdataauth", "//chromeos/dbus/userdataauth:userdataauth_proto", - "//chromeos/login/auth:challenge_response_key", "//testing/gtest:gtest", ] sources = [
diff --git a/chromeos/cryptohome/DEPS b/chromeos/cryptohome/DEPS index fc7d0d5a..410db217 100644 --- a/chromeos/cryptohome/DEPS +++ b/chromeos/cryptohome/DEPS
@@ -1,9 +1,9 @@ noparent = True include_rules = [ + "+ash/components/login/auth", "+base", "+chromeos/dbus", - "+chromeos/login/auth", "+components/account_id", "+components/device_event_log", "+components/user_manager",
diff --git a/chromeos/cryptohome/cryptohome_parameters.h b/chromeos/cryptohome/cryptohome_parameters.h index dcf6bf1..f4f1fc3 100644 --- a/chromeos/cryptohome/cryptohome_parameters.h +++ b/chromeos/cryptohome/cryptohome_parameters.h
@@ -11,9 +11,9 @@ #include <string> #include <vector> +#include "ash/components/login/auth/challenge_response_key.h" #include "base/component_export.h" #include "chromeos/dbus/cryptohome/rpc.pb.h" -#include "chromeos/login/auth/challenge_response_key.h" class AccountId;
diff --git a/chromeos/cryptohome/cryptohome_util_unittest.cc b/chromeos/cryptohome/cryptohome_util_unittest.cc index 418a40fe9..1ac8195d 100644 --- a/chromeos/cryptohome/cryptohome_util_unittest.cc +++ b/chromeos/cryptohome/cryptohome_util_unittest.cc
@@ -6,10 +6,10 @@ #include <string> +#include "ash/components/login/auth/challenge_response_key.h" #include "chromeos/cryptohome/cryptohome_parameters.h" #include "chromeos/dbus/cryptohome/key.pb.h" #include "chromeos/dbus/cryptohome/rpc.pb.h" -#include "chromeos/login/auth/challenge_response_key.h" #include "testing/gtest/include/gtest/gtest.h" #include "third_party/abseil-cpp/absl/types/optional.h"
diff --git a/chromeos/dbus/BUILD.gn b/chromeos/dbus/BUILD.gn index 208375a6..ac47de7f 100644 --- a/chromeos/dbus/BUILD.gn +++ b/chromeos/dbus/BUILD.gn
@@ -125,6 +125,7 @@ "//base/test:test_support", "//chromeos/dbus/audio", "//chromeos/dbus/authpolicy", + "//chromeos/dbus/authpolicy:authpolicy_proto", "//chromeos/dbus/biod:test_support", "//chromeos/dbus/cec_service:unit_tests", "//chromeos/dbus/cros_disks:unit_tests",
diff --git a/chromeos/network/metrics/network_metrics_helper.cc b/chromeos/network/metrics/network_metrics_helper.cc index 75fff821..8d8198bf 100644 --- a/chromeos/network/metrics/network_metrics_helper.cc +++ b/chromeos/network/metrics/network_metrics_helper.cc
@@ -44,8 +44,19 @@ const std::vector<std::string> GetEthernetNetworkTypeHistograms( const NetworkState* network_state) { - // TODO(b/207589664): Determine histogram variant names for Ethernet. - return {}; + const std::string kEthernetPrefix = "Ethernet"; + const std::string kEapInfix = ".Eap"; + const std::string kNoEapInfix = ".NoEap"; + + std::vector<std::string> ethernet_histograms{kEthernetPrefix}; + if (GetNetworkStateHandler()->GetEAPForEthernet(network_state->path(), + /*connected_only=*/true)) { + ethernet_histograms.emplace_back(kEthernetPrefix + kEapInfix); + } else { + ethernet_histograms.emplace_back(kEthernetPrefix + kNoEapInfix); + } + + return ethernet_histograms; } const std::vector<std::string> GetWifiNetworkTypeHistograms(
diff --git a/chromeos/network/metrics/network_metrics_helper_unittest.cc b/chromeos/network/metrics/network_metrics_helper_unittest.cc index 82d38fa..23fb4df8 100644 --- a/chromeos/network/metrics/network_metrics_helper_unittest.cc +++ b/chromeos/network/metrics/network_metrics_helper_unittest.cc
@@ -9,6 +9,7 @@ #include "base/run_loop.h" #include "base/test/metrics/histogram_tester.h" #include "base/test/task_environment.h" +#include "chromeos/dbus/shill/shill_device_client.h" #include "chromeos/dbus/shill/shill_service_client.h" #include "chromeos/network/network_handler_test_helper.h" #include "components/prefs/testing_pref_service.h" @@ -44,8 +45,18 @@ const char kWifiPasswordProtectedConnectResultAllHistogram[] = "Network.WiFi.SecurityPasswordProtected.ConnectionResult.All"; +// LogAllConnectionResult() Ethernet histograms. +const char kEthernetConnectResultAllHistogram[] = + "Network.Ethernet.ConnectionResult.All"; +const char kEthernetEapConnectResultAllHistogram[] = + "Network.Ethernet.Eap.ConnectionResult.All"; +const char kEthernetNoEapConnectResultAllHistogram[] = + "Network.Ethernet.NoEap.ConnectionResult.All"; + const char kTestGuid[] = "test_guid"; const char kTestServicePath[] = "/service/network"; +const char kTestServicePath1[] = "/service/network1"; +const char kTestDevicePath[] = "/device/network"; const char kTestName[] = "network_name"; const char kTestVpnHost[] = "test host"; @@ -201,4 +212,53 @@ kWifiPasswordProtectedConnectResultAllHistogram, 1); } +TEST_F(NetworkMetricsHelperTest, LogAllConnectionResultEthernetNoEap) { + shill_service_client_->AddService(kTestServicePath, kTestGuid, kTestName, + shill::kTypeEthernet, shill::kStateIdle, + /*visible=*/true); + shill_service_client_->SetServiceProperty(kTestServicePath, + shill::kSecurityClassProperty, + base::Value(shill::kSecurityNone)); + base::RunLoop().RunUntilIdle(); + + NetworkMetricsHelper::LogAllConnectionResult(kTestGuid, + shill::kErrorNotRegistered); + histogram_tester_->ExpectTotalCount(kEthernetConnectResultAllHistogram, 1); + histogram_tester_->ExpectTotalCount(kEthernetEapConnectResultAllHistogram, 0); + histogram_tester_->ExpectTotalCount(kEthernetNoEapConnectResultAllHistogram, + 1); +} + +TEST_F(NetworkMetricsHelperTest, LogAllConnectionResultEthernetEap) { + ShillDeviceClient::TestInterface* device_test = + network_handler_test_helper_->device_test(); + device_test->ClearDevices(); + device_test->AddDevice(kTestDevicePath, shill::kTypeEthernet, kTestName); + shill_service_client_->AddService(kTestServicePath1, kTestGuid, kTestName, + shill::kTypeEthernetEap, shill::kStateIdle, + /*visible=*/true); + shill_service_client_->AddService(kTestServicePath, kTestGuid, kTestName, + shill::kTypeEthernet, shill::kStateIdle, + /*visible=*/true); + + shill_service_client_->SetServiceProperty( + kTestServicePath, shill::kStateProperty, base::Value(shill::kStateReady)); + + shill_service_client_->SetServiceProperty(kTestServicePath, + shill::kSecurityClassProperty, + base::Value(shill::kSecurity8021x)); + + device_test->SetDeviceProperty(kTestDevicePath, + shill::kEapAuthenticationCompletedProperty, + base::Value(true), /*notify_changed=*/true); + base::RunLoop().RunUntilIdle(); + + NetworkMetricsHelper::LogAllConnectionResult(kTestGuid, + shill::kErrorNotRegistered); + histogram_tester_->ExpectTotalCount(kEthernetConnectResultAllHistogram, 1); + histogram_tester_->ExpectTotalCount(kEthernetEapConnectResultAllHistogram, 1); + histogram_tester_->ExpectTotalCount(kEthernetNoEapConnectResultAllHistogram, + 0); +} + } // namespace chromeos
diff --git a/chromeos/profiles/orderfile.newest.txt b/chromeos/profiles/orderfile.newest.txt index d5652da..05233f5 100644 --- a/chromeos/profiles/orderfile.newest.txt +++ b/chromeos/profiles/orderfile.newest.txt
@@ -1 +1 @@ -chromeos-chrome-orderfile-field-98-4729.0-1638787322-benchmark-98.0.4758.5-r1.orderfile.xz +chromeos-chrome-orderfile-field-98-4744.1-1639393599-benchmark-98.0.4758.7-r1.orderfile.xz
diff --git a/components/BUILD.gn b/components/BUILD.gn index 8707a86f..894a287 100644 --- a/components/BUILD.gn +++ b/components/BUILD.gn
@@ -928,6 +928,7 @@ "//components/gcm_driver/android:components_gcm_driver_junit_tests", "//components/image_fetcher:junit", "//components/installedapp/android:junit", + "//components/language/android:junit", "//components/media_router/browser/android:junit", "//components/messages/android:junit", "//components/messages/android/internal:junit",
diff --git a/components/arc/BUILD.gn b/components/arc/BUILD.gn index 2bc11e5..ae01a8e 100644 --- a/components/arc/BUILD.gn +++ b/components/arc/BUILD.gn
@@ -17,8 +17,6 @@ "intent_helper/intent_constants.h", "intent_helper/intent_filter.cc", "intent_helper/intent_filter.h", - "intent_helper/link_handler_model.cc", - "intent_helper/link_handler_model.h", "intent_helper/open_url_delegate.h", ] @@ -53,7 +51,6 @@ "intent_helper/arc_intent_helper_bridge_unittest.cc", "intent_helper/custom_tab_unittest.cc", "intent_helper/intent_filter_unittest.cc", - "intent_helper/link_handler_model_unittest.cc", ] deps = [
diff --git a/components/arc/common/BUILD.gn b/components/arc/common/BUILD.gn index 5e4067e..075cdc1 100644 --- a/components/arc/common/BUILD.gn +++ b/components/arc/common/BUILD.gn
@@ -10,11 +10,15 @@ "intent_helper/activity_icon_loader.cc", "intent_helper/activity_icon_loader.h", "intent_helper/adaptive_icon_delegate.h", + "intent_helper/link_handler_model.cc", + "intent_helper/link_handler_model.h", + "intent_helper/link_handler_model_delegate.h", ] deps = [ "//base", "//build:chromeos_buildflags", + "//components/google/core/common", "//ui/base", "//ui/gfx", "//url:url", @@ -22,7 +26,9 @@ if (is_chromeos_ash) { deps += [ + "//ash/components/arc", "//ash/components/arc:arc_base_utils", + "//ash/components/arc:arc_metrics_constants", "//ash/components/arc/mojom", "//ash/components/arc/session", ] @@ -38,12 +44,16 @@ source_set("unit_tests") { testonly = true - sources = [ "intent_helper/activity_icon_loader_unittest.cc" ] + sources = [ + "intent_helper/activity_icon_loader_unittest.cc", + "intent_helper/link_handler_model_unittest.cc", + ] deps = [ ":common", "//base/test:test_support", "//testing/gtest", "//ui/gfx", + "//url:url", ] }
diff --git a/components/arc/common/intent_helper/DEPS b/components/arc/common/intent_helper/DEPS index a80fe55e..78adacd3 100644 --- a/components/arc/common/intent_helper/DEPS +++ b/components/arc/common/intent_helper/DEPS
@@ -1,9 +1,11 @@ include_rules = [ "+ash/components/arc/arc_util.h", + "+ash/components/arc/metrics", + "+ash/components/arc/mojom", + "+ash/components/arc/session", "+chromeos/crosapi/mojom", "+chromeos/lacros", - "+components/arc/mojom", - "+components/arc/session", + "+components/google/core/common/google_util.h", "+ui/base", "+ui/gfx", ]
diff --git a/components/arc/intent_helper/link_handler_model.cc b/components/arc/common/intent_helper/link_handler_model.cc similarity index 60% rename from components/arc/intent_helper/link_handler_model.cc rename to components/arc/common/intent_helper/link_handler_model.cc index 971badd..1ae71472 100644 --- a/components/arc/intent_helper/link_handler_model.cc +++ b/components/arc/common/intent_helper/link_handler_model.cc
@@ -2,28 +2,33 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "components/arc/intent_helper/link_handler_model.h" +#include "components/arc/common/intent_helper/link_handler_model.h" #include <utility> -#include "ash/components/arc/metrics/arc_metrics_constants.h" -#include "ash/components/arc/metrics/arc_metrics_service.h" -#include "ash/components/arc/session/arc_bridge_service.h" -#include "ash/components/arc/session/arc_service_manager.h" #include "base/bind.h" #include "base/memory/ptr_util.h" #include "base/metrics/histogram_macros.h" +#include "base/notreached.h" #include "base/strings/utf_string_conversions.h" -#include "components/arc/intent_helper/arc_intent_helper_bridge.h" +#include "build/chromeos_buildflags.h" #include "components/google/core/common/google_util.h" #include "url/url_util.h" +#if BUILDFLAG(IS_CHROMEOS_ASH) +#include "ash/components/arc/metrics/arc_metrics_constants.h" +#include "ash/components/arc/metrics/arc_metrics_service.h" +#endif + namespace arc { namespace { constexpr int kMaxValueLen = 2048; +// Not owned. Must outlive all LinkHandlerModel instances. +LinkHandlerModelDelegate* g_link_handler_model_delegate = nullptr; + bool GetQueryValue(const GURL& url, const std::string& key_to_find, std::u16string* out) { @@ -69,33 +74,40 @@ } void LinkHandlerModel::OpenLinkWithHandler(uint32_t handler_id) { - auto* arc_service_manager = ArcServiceManager::Get(); - if (!arc_service_manager) - return; - auto* instance = ARC_GET_INSTANCE_FOR_METHOD( - arc_service_manager->arc_bridge_service()->intent_helper(), HandleUrl); - if (!instance) - return; if (handler_id >= handlers_.size()) return; - instance->HandleUrl(url_.spec(), handlers_[handler_id]->package_name); + if (!g_link_handler_model_delegate) { + LOG(DFATAL) << "LinkHandlerModelDelegate is not set."; + return; + } + + if (!g_link_handler_model_delegate->HandleUrl( + url_.spec(), handlers_[handler_id].package_name)) { + return; + } + +#if BUILDFLAG(IS_CHROMEOS_ASH) + // TODO(crbug.com/1275075): Take metrics in Lacros as well. ArcMetricsService::RecordArcUserInteraction( context_, arc::UserInteractionType::APP_STARTED_FROM_LINK_CONTEXT_MENU); +#endif +} + +// static +void LinkHandlerModel::SetDelegate(LinkHandlerModelDelegate* delegate) { + // SetDelegate should be called only when overwriting nullptr or unsetting to + // nullptr except for testing. + if (g_link_handler_model_delegate && delegate) { + LOG(ERROR) << "g_link_handler_model_delegate is modified. " + << "This should not happen except for testing."; + } + g_link_handler_model_delegate = delegate; } LinkHandlerModel::LinkHandlerModel() = default; bool LinkHandlerModel::Init(content::BrowserContext* context, const GURL& url) { - auto* arc_service_manager = ArcServiceManager::Get(); - if (!arc_service_manager) - return false; - auto* instance = ARC_GET_INSTANCE_FOR_METHOD( - arc_service_manager->arc_bridge_service()->intent_helper(), - RequestUrlHandlerList); - if (!instance) - return false; - DCHECK(context); context_ = context; @@ -104,33 +116,51 @@ // callback function, OnUrlHandlerList, is called within a few milliseconds // even on the slowest Chromebook we support. url_ = RewriteUrlFromQueryIfAvailable(url); - instance->RequestUrlHandlerList( + + if (!g_link_handler_model_delegate) { + // g_link_handler_model_delegate should be already set on the product. + // It is not set for some tests such as browser_tests since crosapi is + // disabled. + LOG(ERROR) << "LinkHandlerModelDelegate is not set. " + << "This should not happen except for testing."; + return false; + } + + return g_link_handler_model_delegate->RequestUrlHandlerList( url_.spec(), base::BindOnce(&LinkHandlerModel::OnUrlHandlerList, weak_ptr_factory_.GetWeakPtr())); - return true; } void LinkHandlerModel::OnUrlHandlerList( - std::vector<mojom::IntentHandlerInfoPtr> handlers) { - handlers_ = ArcIntentHelperBridge::FilterOutIntentHelper(std::move(handlers)); + std::vector<LinkHandlerModelDelegate::IntentHandlerInfo> handlers) { + for (auto& handler : handlers) { + if (handler.package_name == "org.chromium.arc.intent_helper") + continue; + handlers_.push_back(std::move(handler)); + } bool icon_info_notified = false; - auto* intent_helper_bridge = - ArcIntentHelperBridge::GetForBrowserContext(context_); - if (intent_helper_bridge) { - std::vector<ArcIntentHelperBridge::ActivityName> activities; - for (size_t i = 0; i < handlers_.size(); ++i) { - activities.emplace_back(handlers_[i]->package_name, - handlers_[i]->activity_name); - } - const ArcIntentHelperBridge::GetResult result = - intent_helper_bridge->GetActivityIcons( - activities, base::BindOnce(&LinkHandlerModel::NotifyObserver, - weak_ptr_factory_.GetWeakPtr())); - icon_info_notified = - internal::ActivityIconLoader::HasIconsReadyCallbackRun(result); + if (!g_link_handler_model_delegate) { + // g_link_handler_model_delegate should be already set on the product. + // It is not set for some tests such as browser_tests since crosapi is + // disabled. + LOG(ERROR) << "LinkHandlerModelDelegate is not set. " + << "This should not happen except for testing."; } + std::vector<LinkHandlerModelDelegate::ActivityName> activities; + for (size_t i = 0; i < handlers_.size(); ++i) { + activities.emplace_back(handlers_[i].package_name, + handlers_[i].activity_name); + } + const LinkHandlerModelDelegate::GetResult result = + g_link_handler_model_delegate->GetActivityIcons( + activities, base::BindOnce(&LinkHandlerModel::NotifyObserver, + weak_ptr_factory_.GetWeakPtr())); + icon_info_notified = + LinkHandlerModelDelegate::ActivityIconLoader::HasIconsReadyCallbackRun( + result); + if (!icon_info_notified) { // Call NotifyObserver() without icon information, unless // GetActivityIcons has already called it. Otherwise if we delay the @@ -140,7 +170,7 @@ } void LinkHandlerModel::NotifyObserver( - std::unique_ptr<ArcIntentHelperBridge::ActivityToIconsMap> icons) { + std::unique_ptr<LinkHandlerModelDelegate::ActivityToIconsMap> icons) { if (icons) { icons_.insert(icons->begin(), icons->end()); icons.reset(); @@ -149,13 +179,13 @@ std::vector<LinkHandlerInfo> handlers; for (size_t i = 0; i < handlers_.size(); ++i) { gfx::Image icon; - const ArcIntentHelperBridge::ActivityName activity( - handlers_[i]->package_name, handlers_[i]->activity_name); + const LinkHandlerModelDelegate::ActivityName activity( + handlers_[i].package_name, handlers_[i].activity_name); const auto it = icons_.find(activity); if (it != icons_.end()) icon = it->second.icon16; // Use the handler's index as an ID. - LinkHandlerInfo handler = {base::UTF8ToUTF16(handlers_[i]->name), icon, + LinkHandlerInfo handler = {base::UTF8ToUTF16(handlers_[i].name), icon, static_cast<uint32_t>(i)}; handlers.push_back(handler); }
diff --git a/components/arc/intent_helper/link_handler_model.h b/components/arc/common/intent_helper/link_handler_model.h similarity index 76% rename from components/arc/intent_helper/link_handler_model.h rename to components/arc/common/intent_helper/link_handler_model.h index 7d63af27..6a98ff9 100644 --- a/components/arc/intent_helper/link_handler_model.h +++ b/components/arc/common/intent_helper/link_handler_model.h
@@ -2,17 +2,16 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef COMPONENTS_ARC_INTENT_HELPER_LINK_HANDLER_MODEL_H_ -#define COMPONENTS_ARC_INTENT_HELPER_LINK_HANDLER_MODEL_H_ +#ifndef COMPONENTS_ARC_COMMON_INTENT_HELPER_LINK_HANDLER_MODEL_H_ +#define COMPONENTS_ARC_COMMON_INTENT_HELPER_LINK_HANDLER_MODEL_H_ #include <memory> #include <string> #include <vector> -#include "ash/components/arc/mojom/intent_helper.mojom.h" #include "base/memory/weak_ptr.h" #include "base/observer_list.h" -#include "components/arc/intent_helper/arc_intent_helper_bridge.h" +#include "components/arc/common/intent_helper/link_handler_model_delegate.h" #include "url/gurl.h" namespace content { @@ -52,6 +51,9 @@ static GURL RewriteUrlFromQueryIfAvailableForTesting(const GURL& url); + // Sets the LinkHandlerModelDelegate instance. + static void SetDelegate(LinkHandlerModelDelegate* delegate); + private: LinkHandlerModel(); @@ -60,9 +62,10 @@ // the caller should delete |this| object. bool Init(content::BrowserContext* context, const GURL& url); - void OnUrlHandlerList(std::vector<mojom::IntentHandlerInfoPtr> handlers); + void OnUrlHandlerList( + std::vector<LinkHandlerModelDelegate::IntentHandlerInfo> handlers); void NotifyObserver( - std::unique_ptr<ArcIntentHelperBridge::ActivityToIconsMap> icons); + std::unique_ptr<LinkHandlerModelDelegate::ActivityToIconsMap> icons); // Checks if the |url| matches the following pattern: // "http(s)://<valid_google_hostname>/url?...&url=<valid_url>&..." @@ -77,13 +80,13 @@ base::ObserverList<Observer>::Unchecked observer_list_; // Url handler info passed from ARC. - std::vector<mojom::IntentHandlerInfoPtr> handlers_; + std::vector<LinkHandlerModelDelegate::IntentHandlerInfo> handlers_; // Activity icon info passed from ARC. - ArcIntentHelperBridge::ActivityToIconsMap icons_; + LinkHandlerModelDelegate::ActivityToIconsMap icons_; base::WeakPtrFactory<LinkHandlerModel> weak_ptr_factory_{this}; }; } // namespace arc -#endif // COMPONENTS_ARC_INTENT_HELPER_LINK_HANDLER_MODEL_H_ +#endif // COMPONENTS_ARC_COMMON_INTENT_HELPER_LINK_HANDLER_MODEL_H_
diff --git a/components/arc/common/intent_helper/link_handler_model_delegate.h b/components/arc/common/intent_helper/link_handler_model_delegate.h new file mode 100644 index 0000000..d9c2dc3 --- /dev/null +++ b/components/arc/common/intent_helper/link_handler_model_delegate.h
@@ -0,0 +1,67 @@ +// Copyright 2021 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 COMPONENTS_ARC_COMMON_INTENT_HELPER_LINK_HANDLER_MODEL_DELEGATE_H_ +#define COMPONENTS_ARC_COMMON_INTENT_HELPER_LINK_HANDLER_MODEL_DELEGATE_H_ + +#include <string> +#include <vector> + +#include "base/callback.h" +#include "components/arc/common/intent_helper/activity_icon_loader.h" + +namespace arc { + +// LinkHandlerModelDelegate provides API to access to ARC Activity Icons cache. +class LinkHandlerModelDelegate { + public: + virtual ~LinkHandlerModelDelegate() = default; + + // internal::ActivityIconLoader types. + using ActivityIconLoader = internal::ActivityIconLoader; + using ActivityName = internal::ActivityIconLoader::ActivityName; + using ActivityToIconsMap = internal::ActivityIconLoader::ActivityToIconsMap; + using GetResult = internal::ActivityIconLoader::GetResult; + using OnIconsReadyCallback = + internal::ActivityIconLoader::OnIconsReadyCallback; + + struct IntentHandlerInfo { + IntentHandlerInfo(const std::string& name, + const std::string& package_name, + const std::string& activity_name) + : name(name), + package_name(package_name), + activity_name(activity_name) {} + ~IntentHandlerInfo() = default; + + // The name of the package used as a description text. + std::string name; + // The name of the package used as an ID. + std::string package_name; + // A hint for retrieving the package's icon. + std::string activity_name; + }; + + using RequestUrlHandlerListCallback = + base::OnceCallback<void(std::vector<IntentHandlerInfo>)>; + + // Retrieves icons for the |activities| and calls |callback|. + // See internal::ActivityIconLoader::GetActivityIcons() for more details. + virtual GetResult GetActivityIcons( + const std::vector<ActivityName>& activities, + OnIconsReadyCallback callback) = 0; + + // Calls RequestUrlHandlerList mojo API. + virtual bool RequestUrlHandlerList( + const std::string& url, + RequestUrlHandlerListCallback callback) = 0; + + // Calls HandleUrl mojo API. + virtual bool HandleUrl(const std::string& url, + const std::string& package_name) = 0; +}; + +} // namespace arc + +#endif // COMPONENTS_ARC_COMMON_INTENT_HELPER_LINK_HANDLER_MODEL_DELEGATE_H_
diff --git a/components/arc/intent_helper/link_handler_model_unittest.cc b/components/arc/common/intent_helper/link_handler_model_unittest.cc similarity index 98% rename from components/arc/intent_helper/link_handler_model_unittest.cc rename to components/arc/common/intent_helper/link_handler_model_unittest.cc index 56bb968..1745dd9 100644 --- a/components/arc/intent_helper/link_handler_model_unittest.cc +++ b/components/arc/common/intent_helper/link_handler_model_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 "components/arc/intent_helper/link_handler_model.h" +#include "components/arc/common/intent_helper/link_handler_model.h" #include <string>
diff --git a/components/arc/intent_helper/arc_intent_helper_bridge.cc b/components/arc/intent_helper/arc_intent_helper_bridge.cc index fa25fcb2..239264c 100644 --- a/components/arc/intent_helper/arc_intent_helper_bridge.cc +++ b/components/arc/intent_helper/arc_intent_helper_bridge.cc
@@ -20,6 +20,7 @@ #include "base/metrics/histogram_macros.h" #include "base/strings/string_util.h" #include "base/values.h" +#include "components/arc/common/intent_helper/link_handler_model.h" #include "components/arc/intent_helper/control_camera_app_delegate.h" #include "components/arc/intent_helper/intent_constants.h" #include "components/arc/intent_helper/open_url_delegate.h" @@ -160,11 +161,13 @@ arc_bridge_service_(bridge_service), allowed_arc_schemes_(std::cbegin(kArcSchemes), std::cend(kArcSchemes)) { arc_bridge_service_->intent_helper()->SetHost(this); + LinkHandlerModel::SetDelegate(this); } ArcIntentHelperBridge::~ArcIntentHelperBridge() { DCHECK_CALLED_ON_VALID_THREAD(thread_checker_); arc_bridge_service_->intent_helper()->SetHost(nullptr); + LinkHandlerModel::SetDelegate(nullptr); for (auto& observer : observer_list_) observer.OnArcIntentHelperBridgeDestruction(); } @@ -376,6 +379,57 @@ return icon_loader_.GetActivityIcons(activities, std::move(callback)); } +bool ArcIntentHelperBridge::RequestUrlHandlerList( + const std::string& url, + RequestUrlHandlerListCallback callback) { + auto* arc_service_manager = ArcServiceManager::Get(); + arc::mojom::IntentHelperInstance* instance = nullptr; + + if (arc_service_manager) { + instance = ARC_GET_INSTANCE_FOR_METHOD( + arc_service_manager->arc_bridge_service()->intent_helper(), + RequestUrlHandlerList); + } + if (!instance) { + LOG(ERROR) << "Failed to get instance for RequestUrlHandlerList()."; + return false; + } + + instance->RequestUrlHandlerList( + url, base::BindOnce(&ArcIntentHelperBridge::OnRequestUrlHandlerList, + weak_ptr_factory_.GetWeakPtr(), std::move(callback))); + return true; +} + +void ArcIntentHelperBridge::OnRequestUrlHandlerList( + RequestUrlHandlerListCallback callback, + std::vector<mojom::IntentHandlerInfoPtr> handlers) { + std::vector<IntentHandlerInfo> converted_handlers; + for (auto const& handler : handlers) { + converted_handlers.push_back(IntentHandlerInfo( + handler->name, handler->package_name, handler->activity_name)); + } + std::move(callback).Run(std::move(converted_handlers)); +} + +bool ArcIntentHelperBridge::HandleUrl(const std::string& url, + const std::string& package_name) { + auto* arc_service_manager = ArcServiceManager::Get(); + arc::mojom::IntentHelperInstance* instance = nullptr; + + if (arc_service_manager) { + instance = ARC_GET_INSTANCE_FOR_METHOD( + arc_service_manager->arc_bridge_service()->intent_helper(), HandleUrl); + } + if (!instance) { + LOG(ERROR) << "Failed to get instance for HandleUrl()."; + return false; + } + + instance->HandleUrl(url, package_name); + return true; +} + bool ArcIntentHelperBridge::ShouldChromeHandleUrl(const GURL& url) { if (!url.SchemeIsHTTPOrHTTPS()) { // Chrome will handle everything that is not http and https.
diff --git a/components/arc/intent_helper/arc_intent_helper_bridge.h b/components/arc/intent_helper/arc_intent_helper_bridge.h index 04bda76..ccbc28f 100644 --- a/components/arc/intent_helper/arc_intent_helper_bridge.h +++ b/components/arc/intent_helper/arc_intent_helper_bridge.h
@@ -12,9 +12,10 @@ #include <vector> #include "ash/components/arc/mojom/intent_helper.mojom.h" +#include "base/memory/weak_ptr.h" #include "base/observer_list.h" #include "base/threading/thread_checker.h" -#include "components/arc/common/intent_helper/activity_icon_loader.h" +#include "components/arc/common/intent_helper/link_handler_model_delegate.h" #include "components/arc/intent_helper/arc_intent_helper_observer.h" #include "components/keyed_service/core/keyed_service.h" #include "url/gurl.h" @@ -35,7 +36,8 @@ // Receives intents from ARC. class ArcIntentHelperBridge : public KeyedService, - public mojom::IntentHelperHost { + public mojom::IntentHelperHost, + public LinkHandlerModelDelegate { public: class Delegate { public: @@ -111,16 +113,13 @@ void OnOpenAppWithIntent(const GURL& start_url, arc::mojom::LaunchIntentPtr intent) override; - // Retrieves icons for the |activities| and calls |callback|. - // See ActivityIconLoader::GetActivityIcons() for more details. - using ActivityName = internal::ActivityIconLoader::ActivityName; - // A part of OnIconsReadyCallback signature. - using ActivityToIconsMap = internal::ActivityIconLoader::ActivityToIconsMap; - using OnIconsReadyCallback = - internal::ActivityIconLoader::OnIconsReadyCallback; - using GetResult = internal::ActivityIconLoader::GetResult; + // LinkHandlerModelDelegete: GetResult GetActivityIcons(const std::vector<ActivityName>& activities, - OnIconsReadyCallback callback); + OnIconsReadyCallback callback) override; + bool RequestUrlHandlerList(const std::string& url, + RequestUrlHandlerListCallback callback) override; + bool HandleUrl(const std::string& url, + const std::string& package_name) override; // Returns true when |url| can only be handled by Chrome. Otherwise, which is // when there might be one or more ARC apps that can handle |url|, returns @@ -164,10 +163,16 @@ private: THREAD_CHECKER(thread_checker_); + // Convert vector of mojom::IntentHandlerInfoPtr to vector of + // LinkHandlerModelDelegate::IntentHandlerInfo. + void OnRequestUrlHandlerList( + RequestUrlHandlerListCallback callback, + std::vector<mojom::IntentHandlerInfoPtr> handlers); + content::BrowserContext* const context_; ArcBridgeService* const arc_bridge_service_; // Owned by ArcServiceManager. - internal::ActivityIconLoader icon_loader_; + ActivityIconLoader icon_loader_; // A map of each package name to the intent filters for that package. // Used to determine if Chrome should handle a URL without handing off to @@ -189,6 +194,8 @@ std::vector<IntentFilter> deleted_preferred_apps_; std::unique_ptr<Delegate> delegate_; + + base::WeakPtrFactory<ArcIntentHelperBridge> weak_ptr_factory_{this}; }; } // namespace arc
diff --git a/components/browser_ui/styles/android/BUILD.gn b/components/browser_ui/styles/android/BUILD.gn index a8dcf9e..b296042 100644 --- a/components/browser_ui/styles/android/BUILD.gn +++ b/components/browser_ui/styles/android/BUILD.gn
@@ -23,6 +23,7 @@ android_resources("java_resources") { sources = [ + "java/res/color-v29/default_control_color_highlight.xml", "java/res/color/default_icon_color_accent1_tint_list.xml", "java/res/color/default_icon_color_light_tint_list.xml", "java/res/color/default_icon_color_secondary_light_tint_list.xml",
diff --git a/components/browser_ui/styles/android/java/res/color-v29/default_control_color_highlight.xml b/components/browser_ui/styles/android/java/res/color-v29/default_control_color_highlight.xml new file mode 100644 index 0000000..83d9240 --- /dev/null +++ b/components/browser_ui/styles/android/java/res/color-v29/default_control_color_highlight.xml
@@ -0,0 +1,9 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- Copyright 2021 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. --> + +<selector xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:tools="http://schemas.android.com/tools" tools:ignore="UnusedResources"> + <item android:alpha="@dimen/control_highlight_alpha" android:color="?attr/colorOnSurface" /> +</selector>
diff --git a/components/browser_ui/styles/android/java/res/values-night/colors.xml b/components/browser_ui/styles/android/java/res/values-night/colors.xml index 5c5c4bbd2..b6b7e151 100644 --- a/components/browser_ui/styles/android/java/res/values-night/colors.xml +++ b/components/browser_ui/styles/android/java/res/values-night/colors.xml
@@ -6,5 +6,7 @@ <resources> <!-- Control colors for toggles, checkboxes, radio buttons, list item highlight, and accent. Note that these should NOT be used for icon tint. --> - <color name="control_highlight_color">@color/default_control_color_highlight_dark</color> + <color name="default_control_color_highlight_baseline"> + @color/default_control_color_highlight_dark + </color> </resources>
diff --git a/components/browser_ui/styles/android/java/res/values/colors.xml b/components/browser_ui/styles/android/java/res/values/colors.xml index 312a0b1..059e4132 100644 --- a/components/browser_ui/styles/android/java/res/values/colors.xml +++ b/components/browser_ui/styles/android/java/res/values/colors.xml
@@ -19,9 +19,14 @@ <!-- Control colors for toggles, checkboxes, ratio buttons, list item highlight, and accent. Note that these should NOT be used for icon tint. --> - <color name="control_highlight_color" tools:ignore="UnusedResources"> + <color name="default_control_color_highlight_baseline" tools:ignore="UnusedResources"> @color/default_control_color_highlight_light </color> + <!-- A color state list cannot be used as view's background below Android Q, so we define this + color for older versions. --> + <color name="default_control_color_highlight"> + @color/default_control_color_highlight_baseline + </color> <!-- Favicons --> <color name="default_favicon_background_color">@color/default_control_color_normal_light</color>
diff --git a/components/browser_ui/styles/android/java/res/values/dimens.xml b/components/browser_ui/styles/android/java/res/values/dimens.xml index 6806760..f78a941 100644 --- a/components/browser_ui/styles/android/java/res/values/dimens.xml +++ b/components/browser_ui/styles/android/java/res/values/dimens.xml
@@ -20,4 +20,5 @@ <item name="text_highlight_alpha" format="float" type="dimen">0.2</item> <item name="progress_bar_bg_alpha" format="float" type="dimen">0.2</item> + <item name="control_highlight_alpha" format="float" type="dimen">0.1</item> </resources>
diff --git a/components/browser_ui/styles/android/java/res/values/semantic_colors_dynamic.xml b/components/browser_ui/styles/android/java/res/values/semantic_colors_dynamic.xml index b7f3f279..6564600 100644 --- a/components/browser_ui/styles/android/java/res/values/semantic_colors_dynamic.xml +++ b/components/browser_ui/styles/android/java/res/values/semantic_colors_dynamic.xml
@@ -8,6 +8,7 @@ <macro name="default_bg_color">?attr/colorSurface</macro> <macro name="default_bg_color_elev_0">?attr/colorSurface</macro> <macro name="default_control_color_active">?attr/colorPrimary</macro> + <macro name="default_control_color_highlight">@color/default_control_color_highlight</macro> <macro name="default_control_color_normal">?attr/colorOnSurfaceVariant</macro> <macro name="default_icon_color">?attr/colorOnSurface</macro> <macro name="default_icon_color_accent1">?attr/colorPrimary</macro> @@ -22,6 +23,7 @@ <macro name="default_bg_color">@color/default_bg_color_baseline</macro> <macro name="default_bg_color_elev_0">@color/default_bg_color_elev_0_baseline</macro> <macro name="default_control_color_active">@color/default_control_color_active_baseline</macro> + <macro name="default_control_color_highlight">@color/default_control_color_highlight_baseline</macro> <macro name="default_control_color_normal">@color/default_control_color_normal_baseline</macro> <macro name="default_icon_color">@color/default_icon_color_baseline</macro> <macro name="default_icon_color_accent1">@color/default_icon_color_accent1_baseline</macro>
diff --git a/components/browser_ui/styles/android/java/res/values/styles.xml b/components/browser_ui/styles/android/java/res/values/styles.xml index ab4e2a5..1af4b85d 100644 --- a/components/browser_ui/styles/android/java/res/values/styles.xml +++ b/components/browser_ui/styles/android/java/res/values/styles.xml
@@ -102,7 +102,7 @@ <item name="android:listDivider">@null</item> <item name="android:listPreferredItemHeightSmall">48dp</item> <item name="android:textAppearance">@style/TextAppearance.TextLarge.Primary</item> - <item name="colorControlHighlight">@color/control_highlight_color</item> + <item name="colorControlHighlight">@macro/default_control_color_highlight</item> </style> <style name="OverflowMenuThemeOverlay" parent="Base.OverflowMenuThemeOverlay" /> @@ -117,7 +117,7 @@ <item name="android:textColorHighlight">@color/text_highlight_color</item> <!-- Overriding AppCompat values --> - <item name="colorControlHighlight">@color/control_highlight_color</item> + <item name="colorControlHighlight">@macro/default_control_color_highlight</item> <item name="spinnerStyle">@style/SpinnerStyle</item> <!-- Depending on if the support library or framework is inflating the
diff --git a/components/browser_ui/styles/android/java/res/values/themes.xml b/components/browser_ui/styles/android/java/res/values/themes.xml index 2f1ef35a..32bd90f 100644 --- a/components/browser_ui/styles/android/java/res/values/themes.xml +++ b/components/browser_ui/styles/android/java/res/values/themes.xml
@@ -35,7 +35,7 @@ <!-- Widget colors: checkboxes, switches, buttons, etc. --> <item name="colorControlNormal">@macro/default_control_color_normal</item> <item name="colorControlActivated">@macro/default_control_color_active</item> - <item name="colorControlHighlight">@color/control_highlight_color</item> + <item name="colorControlHighlight">@macro/default_control_color_highlight</item> <!-- Elevation overlays --> <item name="elevationOverlayEnabled">true</item> @@ -98,7 +98,7 @@ <!-- Widget colors: checkboxes, switches, buttons, etc. --> <item name="colorControlNormal">@macro/default_control_color_normal</item> <item name="colorControlActivated">@macro/default_control_color_active</item> - <item name="colorControlHighlight">@color/control_highlight_color</item> + <item name="colorControlHighlight">@macro/default_control_color_highlight</item> <!-- Elevation overlays --> <item name="elevationOverlayEnabled">true</item> @@ -143,7 +143,7 @@ <item name="colorAccent">@macro/default_control_color_active</item> <item name="colorControlNormal">@macro/default_control_color_normal</item> <item name="colorControlActivated">@macro/default_control_color_active</item> - <item name="colorControlHighlight">@color/control_highlight_color</item> + <item name="colorControlHighlight">@macro/default_control_color_highlight</item> <item name="spinnerStyle">@style/SpinnerStyle</item> <!-- Depending on if the support library or framework is inflating the
diff --git a/components/browser_ui/widget/android/BUILD.gn b/components/browser_ui/widget/android/BUILD.gn index 15e553f..6a647bd 100644 --- a/components/browser_ui/widget/android/BUILD.gn +++ b/components/browser_ui/widget/android/BUILD.gn
@@ -159,8 +159,9 @@ "java/res/drawable-mdpi/ic_drag_handle_grey600_24dp.png", "java/res/drawable-mdpi/ic_more_vert_24dp_on_dark_bg.png", "java/res/drawable-mdpi/ic_more_vert_24dp_on_light_bg.png", + "java/res/drawable-v24/oval_surface_1.xml", + "java/res/drawable-v24/rectangle_surface_1.xml", "java/res/drawable-v24/rounded_rectangle_surface_1.xml", - "java/res/drawable-v24/tile_view_icon_background_modern.xml", "java/res/drawable-xhdpi/btn_delete_24dp.png", "java/res/drawable-xhdpi/btn_info.png", "java/res/drawable-xhdpi/ic_arrow_back_white_24dp.png", @@ -196,13 +197,14 @@ "java/res/drawable/list_item_icon_modern_bg.xml", "java/res/drawable/list_item_icon_modern_bg_rect.xml", "java/res/drawable/modern_toolbar_text_box_background.xml", + "java/res/drawable/oval_surface_1.xml", "java/res/drawable/query_tile_overlay.xml", + "java/res/drawable/rectangle_surface_1.xml", "java/res/drawable/rounded_rectangle_surface_1.xml", "java/res/drawable/search_toolbar_modern_bg.xml", "java/res/drawable/tile_view_highlight.xml", "java/res/drawable/tile_view_highlight_mask.xml", "java/res/drawable/tile_view_highlight_plain.xml", - "java/res/drawable/tile_view_icon_background_modern.xml", "java/res/layout/app_menu_divider.xml", "java/res/layout/app_menu_layout.xml", "java/res/layout/date_divided_adapter_header_view_holder.xml",
diff --git a/components/browser_ui/widget/android/java/res/drawable-v24/tile_view_icon_background_modern.xml b/components/browser_ui/widget/android/java/res/drawable-v24/oval_surface_1.xml similarity index 99% rename from components/browser_ui/widget/android/java/res/drawable-v24/tile_view_icon_background_modern.xml rename to components/browser_ui/widget/android/java/res/drawable-v24/oval_surface_1.xml index 3e6fe96..d8540e7e 100644 --- a/components/browser_ui/widget/android/java/res/drawable-v24/tile_view_icon_background_modern.xml +++ b/components/browser_ui/widget/android/java/res/drawable-v24/oval_surface_1.xml
@@ -2,7 +2,6 @@ <!-- Copyright 2021 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. --> - <org.chromium.components.browser_ui.widget.SurfaceColorDrawable xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto"
diff --git a/chrome/browser/feed/android/java/res/drawable-v24/new_tab_page_multi_feed_header_background.xml b/components/browser_ui/widget/android/java/res/drawable-v24/rectangle_surface_1.xml similarity index 98% rename from chrome/browser/feed/android/java/res/drawable-v24/new_tab_page_multi_feed_header_background.xml rename to components/browser_ui/widget/android/java/res/drawable-v24/rectangle_surface_1.xml index 174c425..3839a9c0 100644 --- a/chrome/browser/feed/android/java/res/drawable-v24/new_tab_page_multi_feed_header_background.xml +++ b/components/browser_ui/widget/android/java/res/drawable-v24/rectangle_surface_1.xml
@@ -2,9 +2,8 @@ <!-- Copyright 2021 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. --> - <org.chromium.components.browser_ui.widget.SurfaceColorDrawable xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:shape="rectangle" - app:surfaceElevation="@dimen/default_elevation_1"/> \ No newline at end of file + app:surfaceElevation="@dimen/default_elevation_1"/>
diff --git a/chrome/browser/feed/android/java/res/drawable/new_tab_page_multi_feed_header_background.xml b/components/browser_ui/widget/android/java/res/drawable/oval_surface_1.xml similarity index 74% copy from chrome/browser/feed/android/java/res/drawable/new_tab_page_multi_feed_header_background.xml copy to components/browser_ui/widget/android/java/res/drawable/oval_surface_1.xml index 01a5512..4333784 100644 --- a/chrome/browser/feed/android/java/res/drawable/new_tab_page_multi_feed_header_background.xml +++ b/components/browser_ui/widget/android/java/res/drawable/oval_surface_1.xml
@@ -5,6 +5,6 @@ <shape xmlns:android="http://schemas.android.com/apk/res/android" - android:shape="rectangle"> - <solid android:color="@color/default_bg_color_elev_1_baseline" /> -</shape> \ No newline at end of file + android:shape="oval"> + <solid android:color="@color/default_bg_color_elev_1_baseline" /> +</shape>
diff --git a/chrome/browser/feed/android/java/res/drawable/new_tab_page_multi_feed_header_background.xml b/components/browser_ui/widget/android/java/res/drawable/rectangle_surface_1.xml similarity index 98% rename from chrome/browser/feed/android/java/res/drawable/new_tab_page_multi_feed_header_background.xml rename to components/browser_ui/widget/android/java/res/drawable/rectangle_surface_1.xml index 01a5512..952d69e 100644 --- a/chrome/browser/feed/android/java/res/drawable/new_tab_page_multi_feed_header_background.xml +++ b/components/browser_ui/widget/android/java/res/drawable/rectangle_surface_1.xml
@@ -7,4 +7,4 @@ xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle"> <solid android:color="@color/default_bg_color_elev_1_baseline" /> -</shape> \ No newline at end of file +</shape>
diff --git a/components/browser_ui/widget/android/java/res/drawable/tile_view_icon_background_modern.xml b/components/browser_ui/widget/android/java/res/drawable/tile_view_icon_background_modern.xml deleted file mode 100644 index f285e07..0000000 --- a/components/browser_ui/widget/android/java/res/drawable/tile_view_icon_background_modern.xml +++ /dev/null
@@ -1,10 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- Copyright 2017 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. --> - -<shape - xmlns:android="http://schemas.android.com/apk/res/android" - android:shape="oval"> - <solid android:color="@color/default_bg_color_secondary" /> -</shape>
diff --git a/components/browser_ui/widget/android/java/res/values/drawables.xml b/components/browser_ui/widget/android/java/res/values/drawables.xml index d8acce7..0859b44 100644 --- a/components/browser_ui/widget/android/java/res/values/drawables.xml +++ b/components/browser_ui/widget/android/java/res/values/drawables.xml
@@ -5,4 +5,5 @@ <resources> <drawable name="ic_more_vert_24dp">@drawable/ic_more_vert_24dp_on_light_bg</drawable> + <drawable name="tile_view_icon_background_modern">@drawable/oval_surface_1</drawable> </resources>
diff --git a/components/exo/capabilities.h b/components/exo/capabilities.h index 543a8361..f9bf211 100644 --- a/components/exo/capabilities.h +++ b/components/exo/capabilities.h
@@ -6,6 +6,7 @@ #define COMPONENTS_EXO_CAPABILITIES_H_ #include <memory> +#include <string> namespace exo {
diff --git a/components/exo/server/wayland_server_controller.h b/components/exo/server/wayland_server_controller.h index 50f6f85..b2f38848 100644 --- a/components/exo/server/wayland_server_controller.h +++ b/components/exo/server/wayland_server_controller.h
@@ -58,8 +58,16 @@ std::unique_ptr<InputMethodSurfaceManager> input_method_surface_manager, std::unique_ptr<ToastSurfaceManager> toast_surface_manager); + // Creates a wayland server with the given set of |capabilities|. Invokes + // |callback| with the success flag indicating whether the request + // succeeded/failed. If successful, the server and its |capabilities| will + // persist until DeleteServer() is called. void CreateServer(std::unique_ptr<Capabilities> capabilities, wayland::Server::StartCallback callback); + + // Removes the wayland server with a socket at |path|. This server, along with + // its capabilities, will be deleted, and wayland clients will no longer be + // able to connect to it. void DeleteServer(const base::FilePath& path); private:
diff --git a/components/feed/core/proto/v2/wire/action_payload.proto b/components/feed/core/proto/v2/wire/action_payload.proto index 28ef27a2..e8697d75c 100644 --- a/components/feed/core/proto/v2/wire/action_payload.proto +++ b/components/feed/core/proto/v2/wire/action_payload.proto
@@ -9,5 +9,5 @@ option optimize_for = LITE_RUNTIME; message ActionPayload { - optional bytes action_payload_data = 257605906; + repeated bytes batched_action_payload_data = 370974597; }
diff --git a/components/feed/core/proto/v2/wire/reliability_logging_enums.proto b/components/feed/core/proto/v2/wire/reliability_logging_enums.proto index 035465a6..320dfc1 100644 --- a/components/feed/core/proto/v2/wire/reliability_logging_enums.proto +++ b/components/feed/core/proto/v2/wire/reliability_logging_enums.proto
@@ -23,8 +23,17 @@ NO_CARDS_RESPONSE_ERROR_ZERO_CARDS = 27; NO_CARDS_UNKNOWN_REASON = 29; FAILED_TO_RENDER = 5; + SEARCH_BOX_TAPPED = 7; + VOICE_SEARCH_TAPPED = 8; NAVIGATED_TO_ANOTHER_TAB = 10; + ACCOUNT_PARTICLE_DISC_TAPPED = 13; + OVERFLOW_MANAGE_INTERESTS_TAPPED = 31; + CARD_TAPPED = 46; + CONFIGURATION_CHANGED = 30; FRAGMENT_STOPPED = 11 [deprecated = true]; + FRAGMENT_PAUSED = 43; + UNKNOWN_HIDE_REASON = 44; + NAVIGATED_BACK = 9; ABORTED_DUE_TO_INVALID_STATE = 6; NAVIGATED_AWAY_IN_APP = 35; FEED_HIDDEN = 36;
diff --git a/components/feed/core/proto/v2/wire/web_feeds.proto b/components/feed/core/proto/v2/wire/web_feeds.proto index 2f60e30..b404d74b 100644 --- a/components/feed/core/proto/v2/wire/web_feeds.proto +++ b/components/feed/core/proto/v2/wire/web_feeds.proto
@@ -43,6 +43,7 @@ string name = 1; string web_page_uri = 2; } + string canonical_uri = 5; repeated string page_rss_uris = 3; ConsistencyToken consistency_token = 4; }
diff --git a/components/feed/core/v2/api_test/feed_api_test.cc b/components/feed/core/v2/api_test/feed_api_test.cc index 900704c..2c9a542 100644 --- a/components/feed/core/v2/api_test/feed_api_test.cc +++ b/components/feed/core/v2/api_test/feed_api_test.cc
@@ -110,7 +110,7 @@ pad = " " + std::string(pad_size - 1, 'a'); } - action.mutable_action_payload()->set_action_payload_data( + action.mutable_action_payload()->add_batched_action_payload_data( base::StrCat({base::NumberToString(id), pad})); return action; }
diff --git a/components/feed/core/v2/test/proto_printer.cc b/components/feed/core/v2/test/proto_printer.cc index 579f713..b8d366fe 100644 --- a/components/feed/core/v2/test/proto_printer.cc +++ b/components/feed/core/v2/test/proto_printer.cc
@@ -152,7 +152,7 @@ } TextProtoPrinter& operator<<(const feedwire::ActionPayload& v) { BeginMessage(); - PRINT_FIELD(action_payload_data); + PRINT_FIELD(batched_action_payload_data); EndMessage(); return *this; }
diff --git a/components/feed/feed_feature_list.cc b/components/feed/feed_feature_list.cc index 1e870d3..ae3c3c9b 100644 --- a/components/feed/feed_feature_list.cc +++ b/components/feed/feed_feature_list.cc
@@ -61,7 +61,7 @@ const base::Feature kXsurfaceMetricsReporting{ "XsurfaceMetricsReporting", base::FEATURE_DISABLED_BY_DEFAULT}; const base::Feature kReliabilityLogging{"FeedReliabilityLogging", - base::FEATURE_DISABLED_BY_DEFAULT}; + base::FEATURE_ENABLED_BY_DEFAULT}; const base::Feature kFeedInteractiveRefresh{"FeedInteractiveRefresh", base::FEATURE_ENABLED_BY_DEFAULT}; const base::Feature kFeedLoadingPlaceholder{"FeedLoadingPlaceholder",
diff --git a/components/history/core/browser/history_types.cc b/components/history/core/browser/history_types.cc index 8e9bebdf..4d5518a 100644 --- a/components/history/core/browser/history_types.cc +++ b/components/history/core/browser/history_types.cc
@@ -413,6 +413,9 @@ ClusterVisit::ClusterVisit() = default; ClusterVisit::~ClusterVisit() = default; ClusterVisit::ClusterVisit(const ClusterVisit&) = default; +ClusterVisit::ClusterVisit(ClusterVisit&&) = default; +ClusterVisit& ClusterVisit::operator=(const ClusterVisit&) = default; +ClusterVisit& ClusterVisit::operator=(ClusterVisit&&) = default; Cluster::Cluster() = default; Cluster::Cluster(int64_t cluster_id,
diff --git a/components/history/core/browser/history_types.h b/components/history/core/browser/history_types.h index feeb9af..88f015d 100644 --- a/components/history/core/browser/history_types.h +++ b/components/history/core/browser/history_types.h
@@ -807,6 +807,9 @@ ClusterVisit(); ~ClusterVisit(); ClusterVisit(const ClusterVisit&); + ClusterVisit(ClusterVisit&&); + ClusterVisit& operator=(const ClusterVisit&); + ClusterVisit& operator=(ClusterVisit&&); AnnotatedVisit annotated_visit; @@ -819,6 +822,13 @@ // its vector. The worse duplicates will have an empty vector here. std::vector<VisitID> duplicate_visit_ids; + // A list of visits that have been de-duplicated into this visit. After + // post-processing by the service, this will be populated with the visits + // marked within `duplicate_visit_ids`. + // TODO(tommycli): Move the un-flattening into the backend and eliminate + // `duplicate_visit_ids`. + std::vector<ClusterVisit> duplicate_visits; + // The normalized URL for the visit (i.e. a SRP URL normalized based on the // user's default search provider). GURL normalized_url;
diff --git a/components/history_clusters/core/history_clusters_service.cc b/components/history_clusters/core/history_clusters_service.cc index b860857a..56cdee7 100644 --- a/components/history_clusters/core/history_clusters_service.cc +++ b/components/history_clusters/core/history_clusters_service.cc
@@ -121,17 +121,6 @@ clusters->end()); } -// Transforms a `ClusterVisit` to a `Visit`. This will `std::move` members and -// `cluster_visit` should not be used afterwards. Some fields won't be copied -// over as they're not represented or represented differently by `Visit`. -Visit ClusterVisitToVisit(history::ClusterVisit&& cluster_visit) { - Visit visit; - visit.annotated_visit = std::move(cluster_visit.annotated_visit); - visit.normalized_url = std::move(cluster_visit.normalized_url); - visit.score = cluster_visit.score; - return visit; -} - // Gets a loggable JSON representation of `visits`. std::string GetDebugJSONForVisits( const std::vector<history::AnnotatedVisit>& visits) { @@ -477,19 +466,15 @@ } // static -std::vector<Cluster> HistoryClustersService::CollapseDuplicateVisits( - std::vector<history::Cluster>&& raw_clusters) { - std::vector<Cluster> result_clusters; - for (const auto& raw_cluster : raw_clusters) { - Cluster cluster; - cluster.cluster_id = raw_cluster.cluster_id; - cluster.keywords = raw_cluster.keywords; - +void HistoryClustersService::CollapseDuplicateVisits( + std::vector<history::Cluster>* clusters) { + DCHECK(clusters); + for (auto& cluster : *clusters) { // Identify child visits, i.e. visits that are marked duplicate and are not // canonical. We use the temporary vector `child_visits_vector` in order to // construct the set in 1 go as each set insertion is O(n). std::vector<history::VisitID> child_visits_vector; - for (const auto& cluster_visit : raw_cluster.visits) { + for (const auto& cluster_visit : cluster.visits) { for (const auto& duplicate_id : cluster_visit.duplicate_visit_ids) child_visits_vector.push_back(duplicate_id); } @@ -498,10 +483,10 @@ // Split the visits into child visits, stored in a map for constant lookup // later, and parent visits. Because we're `std::move`ing visits, - // `raw_cluster.visits` should not be used after this iteration. + // `cluster.visits` should not be used after this iteration. base::flat_map<int64_t, history::ClusterVisit> child_visits_map; std::vector<history::ClusterVisit> parent_visits; - for (const auto& cluster_visit : raw_cluster.visits) { + for (const auto& cluster_visit : cluster.visits) { const auto& id = cluster_visit.annotated_visit.visit_row.visit_id; if (child_visits_set.contains(id)) child_visits_map[id] = std::move(cluster_visit); @@ -509,28 +494,21 @@ parent_visits.push_back(std::move(cluster_visit)); } - // Move the child visits from the map of `ClusterVisit`s to the vector of - // `Visit`s. Because we're `std::move`ing visits, `child_visits_map` and - // `parent_visits` should not be used after this iteration. Order matters, - // `parent_visits` preserved `raw_cluster.visits` order above, and we keep - // the same order for `cluster.visits`. - for (auto& cluster_visit : parent_visits) { - std::vector<Visit> duplicate_visits; - for (const auto& duplicate_id : cluster_visit.duplicate_visit_ids) { + // Move the child visits into the duplicates vectors of the parents. + // Because we're `std::move`ing visits, `child_visits_map` and + // should not be used after this iteration. Order matters, `parent_visits` + // preserves the order of `cluster.visits`. + for (auto& visit : parent_visits) { + for (const auto& duplicate_id : visit.duplicate_visit_ids) { DCHECK(child_visits_map.count(duplicate_id)); - duplicate_visits.push_back( - ClusterVisitToVisit(std::move(child_visits_map[duplicate_id]))); + visit.duplicate_visits.push_back( + std::move(child_visits_map[duplicate_id])); } - auto visit = ClusterVisitToVisit(std::move(cluster_visit)); - visit.duplicate_visits = std::move(duplicate_visits); - cluster.visits.push_back(std::move(visit)); } - - result_clusters.push_back(std::move(cluster)); + // Transfer the newly constructed unflattened list of parent visits back + // into the cluster. + cluster.visits = std::move(parent_visits); } - - DCHECK_EQ(result_clusters.size(), raw_clusters.size()); - return result_clusters; } void HistoryClustersService::ClearKeywordCache() { @@ -699,7 +677,8 @@ } FilterClustersMatchingQuery(query, &raw_clusters); - result.clusters = CollapseDuplicateVisits(std::move(raw_clusters)); + CollapseDuplicateVisits(&raw_clusters); + result.clusters = raw_clusters; return result; }
diff --git a/components/history_clusters/core/history_clusters_service.h b/components/history_clusters/core/history_clusters_service.h index 6bdb792..50cd1a29 100644 --- a/components/history_clusters/core/history_clusters_service.h +++ b/components/history_clusters/core/history_clusters_service.h
@@ -158,12 +158,10 @@ // keystroke, the cache may be ready and return true then. bool DoesQueryMatchAnyCluster(const std::string& query); - // Converts the vector of history::Cluster types to history_clusters::Cluster - // by collapsing all the duplicate visits into the canonical visits, thereby + // Collapses all the duplicate visits into the canonical visits, thereby // "unflattening" the output of the backend. Public for testing purposes. - // `raw_clusters` will be cannibalized and should not be used again. - static std::vector<Cluster> CollapseDuplicateVisits( - std::vector<history::Cluster>&& raw_clusters); + // TODO(tommycli): Move into the backend. + static void CollapseDuplicateVisits(std::vector<history::Cluster>* clusters); // Clears `all_keywords_cache_` and cancels any pending tasks to populate it. void ClearKeywordCache();
diff --git a/components/history_clusters/core/history_clusters_service_unittest.cc b/components/history_clusters/core/history_clusters_service_unittest.cc index 815fcd9..403a9cc 100644 --- a/components/history_clusters/core/history_clusters_service_unittest.cc +++ b/components/history_clusters/core/history_clusters_service_unittest.cc
@@ -297,29 +297,28 @@ TEST_F(HistoryClustersServiceTest, UnflattenDuplicatesUnitTest) { // This tests the unflatten-duplicates method in more detail as a unit test. - history::Cluster raw_cluster; - auto& raw_visits = raw_cluster.visits; + std::vector<history::Cluster> clusters; + clusters.emplace_back(history::Cluster()); + auto& visits = clusters[0].visits; // Add ten visits, numbered from 1 to 8. (1-based, just like History.) for (size_t i = 0; i < 8; ++i) { - raw_visits.emplace_back(); - raw_visits[i].annotated_visit.visit_row.visit_id = i + 1; + visits.emplace_back(); + visits[i].annotated_visit.visit_row.visit_id = i + 1; } // Collapse 1, 2, 3 into visit 4. Visits 1 and 2 have related searches. // Visit 3 had omnibox_url_copied == true. - ASSERT_EQ(raw_visits[3].annotated_visit.visit_row.visit_id, 4); - raw_visits[3].duplicate_visit_ids = {1, 2, 3}; + ASSERT_EQ(visits[3].annotated_visit.visit_row.visit_id, 4); + visits[3].duplicate_visit_ids = {1, 2, 3}; // Collapse 7 into visit 6. - ASSERT_EQ(raw_visits[5].annotated_visit.visit_row.visit_id, 6); - raw_visits[5].duplicate_visit_ids = {7}; + ASSERT_EQ(visits[5].annotated_visit.visit_row.visit_id, 6); + visits[5].duplicate_visit_ids = {7}; // Canonical visits should be {4, {1,2,3}}, {5, {}}, {6, {7}}, {8, {}}. - auto clusters = - history_clusters_service_->CollapseDuplicateVisits({raw_cluster}); + history_clusters_service_->CollapseDuplicateVisits(&clusters); ASSERT_EQ(clusters.size(), 1u); - auto& visits = clusters[0].visits; ASSERT_EQ(visits.size(), 4u); // Visit 4 should have 1, 2, and 3 as duplicates.
diff --git a/components/history_clusters/core/history_clusters_types.cc b/components/history_clusters/core/history_clusters_types.cc index 625ef1c05..751e552 100644 --- a/components/history_clusters/core/history_clusters_types.cc +++ b/components/history_clusters/core/history_clusters_types.cc
@@ -6,20 +6,6 @@ namespace history_clusters { -Visit::Visit() = default; -Visit::~Visit() = default; -Visit::Visit(const Visit&) = default; -Visit::Visit(Visit&&) = default; -Visit& Visit::operator=(const Visit&) = default; -Visit& Visit::operator=(Visit&&) = default; - -Cluster::Cluster() = default; -Cluster::~Cluster() = default; -Cluster::Cluster(const Cluster&) = default; -Cluster::Cluster(Cluster&&) = default; -Cluster& Cluster::operator=(const Cluster&) = default; -Cluster& Cluster::operator=(Cluster&&) = default; - QueryClustersResult::QueryClustersResult() = default; QueryClustersResult::~QueryClustersResult() = default; QueryClustersResult::QueryClustersResult(const QueryClustersResult&) = default;
diff --git a/components/history_clusters/core/history_clusters_types.h b/components/history_clusters/core/history_clusters_types.h index 50383da..44abcdb 100644 --- a/components/history_clusters/core/history_clusters_types.h +++ b/components/history_clusters/core/history_clusters_types.h
@@ -14,60 +14,13 @@ namespace history_clusters { -// Differs from history::ClusterVisit in that the duplicate visits are -// collapsed inline with the metadata subsumed into the canonical visit. -struct Visit { - Visit(); - ~Visit(); - Visit(const Visit&); - Visit(Visit&&); - Visit& operator=(const Visit&); - Visit& operator=(Visit&&); - - history::AnnotatedVisit annotated_visit; - - // A floating point score in the range [0, 1] describing how important this - // visit is to the containing cluster. - float score = 0.0; - - // A list of visits that have been de-duplicated into this visit. - std::vector<Visit> duplicate_visits; - - // The normalized URL for the visit (i.e. an SRP URL normalized based on the - // user's default search provider). - GURL normalized_url; -}; - -// Differs from history::Cluster in that the visits are de-duplicated and -// metadata collapsed already. -struct Cluster { - Cluster(); - ~Cluster(); - Cluster(const Cluster&); - Cluster(Cluster&&); - Cluster& operator=(const Cluster&); - Cluster& operator=(Cluster&&); - - // An unique but opaque cluster ID. - int64_t cluster_id; - - // The constituent already de-duplicated visits of this cluster. - std::vector<Visit> visits; - - // The keywords associated with this cluster that should never be explicitly - // presented within the UI. - // TODO(tommycli): Eliminate this field after removing the usage in - // `PopulateClusterKeywordCache()`. - std::vector<std::u16string> keywords; -}; - // The result data returned by `QueryClusters()`. struct QueryClustersResult { QueryClustersResult(); ~QueryClustersResult(); QueryClustersResult(const QueryClustersResult&); - std::vector<Cluster> clusters; + std::vector<history::Cluster> clusters; // A nullopt `continuation_end_time` means we have exhausted History. // Note that this differs from History itself, which uses base::Time() as the
diff --git a/components/language/android/BUILD.gn b/components/language/android/BUILD.gn index 58ca0d3b..1703bd3 100644 --- a/components/language/android/BUILD.gn +++ b/components/language/android/BUILD.gn
@@ -29,6 +29,7 @@ "java/src/org/chromium/components/language/AndroidLanguageMetricsBridge.java", "java/src/org/chromium/components/language/GeoLanguageProviderBridge.java", "java/src/org/chromium/components/language/LanguageProfileController.java", + "java/src/org/chromium/components/language/LanguageProfileMetricsLogger.java", ] deps = [ @@ -61,6 +62,28 @@ ] } +java_library("junit") { + # Skip platform checks since Robolectric depends on requires_android targets. + bypass_platform_checks = true + testonly = true + sources = [ "java/src/org/chromium/components/language/LanguageProfileControllerUnitTest.java" ] + deps = [ + ":java", + ":ulp_delegate_java", + "//base:base_java", + "//base:base_java_test_support", + "//base:base_junit_test_support", + "//components/browser_ui/widget/android:java", + "//content/public/android:content_java", + "//content/public/test/android:content_java_test_support", + "//third_party/android_deps:robolectric_all_java", + "//third_party/androidx:androidx_test_runner_java", + "//third_party/junit", + "//third_party/mockito:mockito_java", + "//ui/android:ui_java", + ] +} + android_library("javatests") { testonly = true
diff --git a/components/language/android/java/src/org/chromium/components/language/LanguageProfileController.java b/components/language/android/java/src/org/chromium/components/language/LanguageProfileController.java index 919b107..12a0886 100644 --- a/components/language/android/java/src/org/chromium/components/language/LanguageProfileController.java +++ b/components/language/android/java/src/org/chromium/components/language/LanguageProfileController.java
@@ -19,6 +19,7 @@ private static final int TIMEOUT_IN_SECONDS = 60; private LanguageProfileDelegate mDelegate; + private LanguageProfileMetricsLogger mLogger = new LanguageProfileMetricsLogger(); /** * @param delegate LanguageProfileDelegate to use. @@ -34,19 +35,27 @@ * @return A list of language tags ordered by preference for |accountName| */ public List<String> getLanguagePreferences(String accountName) { + boolean signedIn = accountName != null; ThreadUtils.assertOnBackgroundThread(); if (!mDelegate.isULPSupported()) { - // (TODO:https://crbug.com/1258261) Add initiation histogram. Log.d(TAG, "ULP not available"); + mLogger.recordInitiationStatus( + signedIn, LanguageProfileMetricsLogger.ULPInitiationStatus.NOT_SUPPORTED); return new ArrayList<String>(); } try { - return mDelegate.getLanguagePreferences(accountName, TIMEOUT_IN_SECONDS); + List<String> languages = + mDelegate.getLanguagePreferences(accountName, TIMEOUT_IN_SECONDS); + mLogger.recordInitiationStatus( + signedIn, LanguageProfileMetricsLogger.ULPInitiationStatus.SUCCESS); + return languages; } catch (TimeoutException e) { - // (TODO:https://crbug.com/1258261) Add initiation histogram. + mLogger.recordInitiationStatus( + signedIn, LanguageProfileMetricsLogger.ULPInitiationStatus.TIMED_OUT); Log.d(TAG, "ULP getLanguagePreferences timed out"); } catch (Exception e) { - // (TODO:https://crbug.com/1258261) Add initiation histogram. + mLogger.recordInitiationStatus( + signedIn, LanguageProfileMetricsLogger.ULPInitiationStatus.FAILURE); Log.d(TAG, "ULP getLanguagePreferences threw exception:", e); } return new ArrayList<String>();
diff --git a/components/language/android/java/src/org/chromium/components/language/LanguageProfileControllerUnitTest.java b/components/language/android/java/src/org/chromium/components/language/LanguageProfileControllerUnitTest.java new file mode 100644 index 0000000..34e84ef1 --- /dev/null +++ b/components/language/android/java/src/org/chromium/components/language/LanguageProfileControllerUnitTest.java
@@ -0,0 +1,179 @@ +// Copyright 2021 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.components.language; + +import androidx.test.filters.SmallTest; + +import org.junit.Assert; +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.robolectric.annotation.Config; + +import org.chromium.base.ThreadUtils; +import org.chromium.base.metrics.RecordHistogram; +import org.chromium.base.metrics.test.ShadowRecordHistogram; +import org.chromium.base.test.BaseRobolectricTestRunner; + +import java.util.ArrayList; +import java.util.List; +import java.util.concurrent.TimeoutException; + +/** + * Tests for LanguageProfileController. + */ +@RunWith(BaseRobolectricTestRunner.class) +@Config(manifest = Config.NONE, shadows = {ShadowRecordHistogram.class}) +public class LanguageProfileControllerUnitTest { + @Before + public void setUp() { + ShadowRecordHistogram.reset(); + ThreadUtils.setThreadAssertsDisabledForTesting(true); + mController = new LanguageProfileController(mDelegate); + } + + LanguageProfileDelegate mDelegate = new LanguageProfileDelegate() { + @Override + public boolean isULPSupported() { + return true; + } + + @Override + public List<String> getLanguagePreferences(String accountName, int timeoutInSeconds) { + return new ArrayList<String>(); + } + }; + LanguageProfileController mController; + + @Test + @SmallTest + public void testSuccess() { + mController.getLanguagePreferences("myaccount"); + + Assert.assertEquals(1, + RecordHistogram.getHistogramTotalCountForTesting( + LanguageProfileMetricsLogger.INITIATION_STATUS_HISTOGRAM)); + Assert.assertEquals(1, + RecordHistogram.getHistogramValueCountForTesting( + LanguageProfileMetricsLogger.INITIATION_STATUS_HISTOGRAM, + LanguageProfileMetricsLogger.ULPInitiationStatus.SUCCESS)); + // Ensure that only the signed-in histograms are populated. + Assert.assertEquals(1, + RecordHistogram.getHistogramTotalCountForTesting( + LanguageProfileMetricsLogger.SIGNED_IN_INITIATION_STATUS_HISTOGRAM)); + Assert.assertEquals(1, + RecordHistogram.getHistogramValueCountForTesting( + LanguageProfileMetricsLogger.SIGNED_IN_INITIATION_STATUS_HISTOGRAM, + LanguageProfileMetricsLogger.ULPInitiationStatus.SUCCESS)); + Assert.assertEquals(0, + RecordHistogram.getHistogramTotalCountForTesting( + LanguageProfileMetricsLogger.SIGNED_OUT_INITIATION_STATUS_HISTOGRAM)); + } + + @Test + @SmallTest + public void testSignedOut() { + mController.getLanguagePreferences(null); + + Assert.assertEquals(1, + RecordHistogram.getHistogramTotalCountForTesting( + LanguageProfileMetricsLogger.INITIATION_STATUS_HISTOGRAM)); + Assert.assertEquals(1, + RecordHistogram.getHistogramValueCountForTesting( + LanguageProfileMetricsLogger.INITIATION_STATUS_HISTOGRAM, + LanguageProfileMetricsLogger.ULPInitiationStatus.SUCCESS)); + // Ensure that only the signed-out histograms are populated. + Assert.assertEquals(1, + RecordHistogram.getHistogramTotalCountForTesting( + LanguageProfileMetricsLogger.SIGNED_OUT_INITIATION_STATUS_HISTOGRAM)); + Assert.assertEquals(1, + RecordHistogram.getHistogramValueCountForTesting( + LanguageProfileMetricsLogger.SIGNED_OUT_INITIATION_STATUS_HISTOGRAM, + LanguageProfileMetricsLogger.ULPInitiationStatus.SUCCESS)); + Assert.assertEquals(0, + RecordHistogram.getHistogramTotalCountForTesting( + LanguageProfileMetricsLogger.SIGNED_IN_INITIATION_STATUS_HISTOGRAM)); + } + + @Test + @SmallTest + public void testNotAvailable() { + mController = new LanguageProfileController(new LanguageProfileDelegate() { + @Override + public boolean isULPSupported() { + return false; + } + + @Override + public List<String> getLanguagePreferences(String accountName, int timeoutInSeconds) { + return new ArrayList<String>(); + } + }); + + mController.getLanguagePreferences("myaccount"); + + Assert.assertEquals(1, + RecordHistogram.getHistogramTotalCountForTesting( + LanguageProfileMetricsLogger.INITIATION_STATUS_HISTOGRAM)); + Assert.assertEquals(1, + RecordHistogram.getHistogramValueCountForTesting( + LanguageProfileMetricsLogger.INITIATION_STATUS_HISTOGRAM, + LanguageProfileMetricsLogger.ULPInitiationStatus.NOT_SUPPORTED)); + } + + @Test + @SmallTest + public void testTimeout() { + mController = new LanguageProfileController(new LanguageProfileDelegate() { + @Override + public boolean isULPSupported() { + return true; + } + + @Override + public List<String> getLanguagePreferences(String accountName, int timeoutInSeconds) + throws TimeoutException { + throw new TimeoutException("error!"); + } + }); + + mController.getLanguagePreferences("myaccount"); + + Assert.assertEquals(1, + RecordHistogram.getHistogramTotalCountForTesting( + LanguageProfileMetricsLogger.INITIATION_STATUS_HISTOGRAM)); + Assert.assertEquals(1, + RecordHistogram.getHistogramValueCountForTesting( + LanguageProfileMetricsLogger.INITIATION_STATUS_HISTOGRAM, + LanguageProfileMetricsLogger.ULPInitiationStatus.TIMED_OUT)); + } + + @Test + @SmallTest + public void testFailure() { + mController = new LanguageProfileController(new LanguageProfileDelegate() { + @Override + public boolean isULPSupported() { + return true; + } + + @Override + public List<String> getLanguagePreferences(String accountName, int timeoutInSeconds) + throws InterruptedException { + throw new InterruptedException("error!"); + } + }); + + mController.getLanguagePreferences("myaccount"); + + Assert.assertEquals(1, + RecordHistogram.getHistogramTotalCountForTesting( + LanguageProfileMetricsLogger.INITIATION_STATUS_HISTOGRAM)); + Assert.assertEquals(1, + RecordHistogram.getHistogramValueCountForTesting( + LanguageProfileMetricsLogger.INITIATION_STATUS_HISTOGRAM, + LanguageProfileMetricsLogger.ULPInitiationStatus.FAILURE)); + } +}
diff --git a/components/language/android/java/src/org/chromium/components/language/LanguageProfileMetricsLogger.java b/components/language/android/java/src/org/chromium/components/language/LanguageProfileMetricsLogger.java new file mode 100644 index 0000000..6d67676 --- /dev/null +++ b/components/language/android/java/src/org/chromium/components/language/LanguageProfileMetricsLogger.java
@@ -0,0 +1,55 @@ +// Copyright 2021 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.components.language; + +import androidx.annotation.IntDef; +import androidx.annotation.VisibleForTesting; + +import org.chromium.base.metrics.RecordHistogram; + +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; + +/** + * Class to record metrics about the user's Language Profile (ULP). + */ +public class LanguageProfileMetricsLogger { + @VisibleForTesting + static final String INITIATION_STATUS_HISTOGRAM = "LanguageUsage.ULP.Initiation.Status"; + @VisibleForTesting + static final String SIGNED_IN_INITIATION_STATUS_HISTOGRAM = + "LanguageUsage.ULP.Initiation.Status.SignedIn"; + @VisibleForTesting + static final String SIGNED_OUT_INITIATION_STATUS_HISTOGRAM = + "LanguageUsage.ULP.Initiation.Status.DefaultAccount"; + + // These values are persisted to logs. Entries should not be renumbered and + // numeric values should never be reused. + @IntDef({ULPInitiationStatus.SUCCESS, ULPInitiationStatus.NOT_SUPPORTED, + ULPInitiationStatus.TIMED_OUT, ULPInitiationStatus.FAILURE}) + @Retention(RetentionPolicy.SOURCE) + @interface ULPInitiationStatus { + int SUCCESS = 0; + int NOT_SUPPORTED = 1; + int TIMED_OUT = 2; + int FAILURE = 3; + + // STOP: When updating this, also update values in enums.xml and make sure to update the + // IntDef above. + int NUM_ENTRIES = 4; + } + + public void recordInitiationStatus(boolean signedIn, @ULPInitiationStatus int initStatus) { + RecordHistogram.recordEnumeratedHistogram( + INITIATION_STATUS_HISTOGRAM, initStatus, ULPInitiationStatus.NUM_ENTRIES); + if (signedIn) { + RecordHistogram.recordEnumeratedHistogram(SIGNED_IN_INITIATION_STATUS_HISTOGRAM, + initStatus, ULPInitiationStatus.NUM_ENTRIES); + } else { + RecordHistogram.recordEnumeratedHistogram(SIGNED_OUT_INITIATION_STATUS_HISTOGRAM, + initStatus, ULPInitiationStatus.NUM_ENTRIES); + } + } +}
diff --git a/components/messages/README.md b/components/messages/README.md index 929a79e..560d317b 100644 --- a/components/messages/README.md +++ b/components/messages/README.md
@@ -1,30 +1,44 @@ # Messages UI -Message UI is an alternative to InfoBar UI on Android. It provides a set of APIs and a consistent, ephemeral and trustworthy UI with various lifecycles and priorities. +Message UI is an alternative to InfoBar UI on Android. It provides a set of APIs +and a consistent, ephemeral and trustworthy UI with various lifecycles and +priorities. [TOC] ## Overview -Each message should include at least 3 properties: title, primary icon and primary button text. +Each message should include at least 3 properties: title, primary icon and +primary button text. -Each message will automatically be displayed, hidden and dismissed according to given scope (see details below) and can be dismissed automatically or manually. By default, each message will be automatically dismissed after around 10s after it is displayed. The timer will be reset if the text or icon on the UI is changed or if the Message is re-shown. Also, users can dismiss the message by swiping the UI upwards, leftwards and rightwards. The feature clients can also manually dismiss the message through provided APIs if necessary. +Each message will automatically be displayed, hidden and dismissed according to +given scope (see details below) and can be dismissed automatically or manually. +By default, each message will be automatically dismissed after around 10s after +it is displayed. The timer will be reset if the text or icon on the UI is +changed or if the Message is re-shown. Also, users can dismiss the message by +swiping the UI upwards, leftwards and rightwards. The feature clients can also +manually dismiss the message through provided APIs if necessary. ## Developing a new Message UI Feature -You need to do the following things to enable your message UI, all described in detail below. +You need to do the following things to enable your message UI, all described in +detail below. -1. [Declare your message UI](#Declaring-your-message-UI) by adding a Message Identifier. +1. [Declare your message UI](#Declaring-your-message-ui) by adding a Message Identifier. 2. [Build a message model](#Build-a-message-model). 3. [Enqueue your message model](#Enqueue-your-message-model). ## Declare your message UI -You need to create a `MessageIdentifier` that represents your Message UI, which distinguishes it from other message UIs and enables some feature-specific metrics to be recorded. +You need to create a `MessageIdentifier` that represents your Message UI, which +distinguishes it from other message UIs and enables some feature-specific metrics +to be recorded. -The MessageIdentifier is defined as an `enum` and a string, which should be appended in following files (you can refer to [this CL](https://chromium-review.googlesource.com/c/chromium/src/+/3139695) as an example): +The MessageIdentifier is defined as an `enum` and a string, which should be +appended in following files (you can refer to +[this CL](https://chromium-review.googlesource.com/c/chromium/src/+/3139695) as an example): 1. `components/messages/android/message_enums.h` [[1](https://chromium-review.googlesource.com/c/chromium/src/+/3139695/4/components/messages/android/message_enums.h#90)] 2. MessageIdentifier in `tools/metrics/histograms/enums.xml` [[1](https://chromium-review.googlesource.com/c/chromium/src/+/3139695/4/tools/metrics/histograms/enums.xml#55511)] @@ -39,73 +53,137 @@ Only some of them are required: 1. TITLE: the main text of the message UI -2. ICON / ICON_RESOURCE_ID: the primary icon of the message UI, located at the start side of the UI. -3. PRIMARY_BUTTON_TEXT: the label of the primary button, located at the end of the message UI. +2. ICON / ICON_RESOURCE_ID: the primary icon of the message UI, located at the + start side of the UI. +3. PRIMARY_BUTTON_TEXT: the label of the primary button, located at the end of + the message UI. The rest are optional, but some of those are very commonly used: -1. DESCRIPTION: the description / subtitle of the message UI, usually used to help explain the purpose of the message UI. -2. ON_PRIMARY_ACTION: the callback function triggered when the user clicks on the primary button. Only called once. After this function is triggered, the message itself will be dismissed. -3. ON_SECONDARY_ACTION / SECONDARY_BUTTON_MENU_TEXT / SECONDARY_ICON_CONTENT_DESCRIPTION / SECONDARY_ICON / SECONDARY_ICON_RESOURCE_ID: these are used to set a secondary action / menu. If SECONDARY_BUTTON_MENU_TEXT is configured, clicking on the secondary button will trigger a single-menu-item popup menu. Clicking on the secondary icon does not guarantee that the message will be automatically dismissed. We recommend the feature code to manually dismiss the message when secondary action callback is triggered. - 1. Note: there are changes in-flight to allow multiple menu items. Documentation will be updated once that lands. -4. ON_DISMISSED: the callback function triggered when the message UI is dismissed. Dismiss means the message has been removed from the queue and will not be displayed again. +1. DESCRIPTION: the description / subtitle of the message UI, usually used to + help explain the purpose of the message UI. +2. ON_PRIMARY_ACTION: the callback function triggered when the user clicks on + the primary button. Only called once. After this function is triggered, the + message itself will be dismissed. +3. ON_SECONDARY_ACTION / SECONDARY_BUTTON_MENU_TEXT / SECONDARY_ICON_CONTENT_DESCRIPTION + / SECONDARY_ICON / SECONDARY_ICON_RESOURCE_ID: these are used to set a + secondary action / menu. If SECONDARY_BUTTON_MENU_TEXT is configured, clicking + on the secondary button will trigger a single-menu-item popup menu. + Clicking on the secondary icon does not guarantee that the message will be + automatically dismissed. We recommend the feature code to manually dismiss + the message when secondary action callback is triggered. + 1. Note: there are changes in-flight to allow multiple menu items. + Documentation will be updated once that lands. +4. ON_DISMISSED: the callback function triggered when the message UI is dismissed. + Dismiss means the message has been removed from the queue and will not be displayed again. -You can refer to [this CL](https://chromium-review.googlesource.com/c/chromium/src/+/3039479/17/chrome/android/java/src/org/chromium/chrome/browser/survey/ChromeSurveyController.java#239) as an example on the Java side and [this CL](https://chromium-review.googlesource.com/c/chromium/src/+/3161257/5/chrome/browser/android/oom_intervention/near_oom_reduction_message_delegate.cc#35) as an example on the Native side. +You can refer to +[this CL](https://chromium-review.googlesource.com/c/chromium/src/+/3039479/17/chrome/android/java/src/org/chromium/chrome/browser/survey/ChromeSurveyController.java#239) +as an example on the Java side and +[this CL](https://chromium-review.googlesource.com/c/chromium/src/+/3161257/5/chrome/browser/android/oom_intervention/near_oom_reduction_message_delegate.cc#35) +as an example on the Native side. Some other, less commonly used properties are: -* ICON_TINT_COLOR: the default icon color is blue. Use this to update the icon color and set TINT_NONE to disable the icon tint color. -* DESCRIPTION_MAX_LINES: set max lines of the description. The default when this property isn't set is to show all the description texts, which may occupy too much screen space. +* ICON_TINT_COLOR: the default icon color is blue. Use this to update the icon + color and set TINT_NONE to disable the icon tint color. +* DESCRIPTION_MAX_LINES: set max lines of the description. The default when this + property isn't set is to show all the description texts, which may occupy too much screen space. ## Enqueue your message model -After the model is defined and ready to be displayed, it should be enqueued by calling MessageDispatcher#enqueueMessage and providing the model, scope, and priority. +After the model is defined and ready to be displayed, it should be enqueued by +calling MessageDispatcher#enqueueMessage and providing the model, scope, +and priority. ### MessageDispatcher -MessageDispatcher is per-window object. In Java, use[ MessageDispatcherProvider#from](https://source.chromium.org/chromium/chromium/src/+/main:components/messages/android/java/src/org/chromium/components/messages/MessageDispatcherProvider.java;l=35) to get a dispatcher available in the current window, which can be null if native initialization is not finished yet. In C++, use messages::MessageDispatcherBridge::Get() instead. +MessageDispatcher is per-window object. In Java, use +[MessageDispatcherProvider#from](https://source.chromium.org/chromium/chromium/src/+/main:components/messages/android/java/src/org/chromium/components/messages/MessageDispatcherProvider.java;l=35) +to get a dispatcher available in the current window, which can be null if native +initialization is not finished yet. In C++, use +messages::MessageDispatcherBridge::Get() instead. ### Scope -Message scope can also be seen as the life cycle of a message UI. It pre-defines when and where messages should be displayed and dismissed. There are 3 scopes in total (components/messages/android/message_enums.h): +Message scope can also be seen as the life cycle of a message UI. It pre-defines +when and where messages should be displayed and dismissed. There are 3 scopes in +total (components/messages/android/message_enums.h): -1. **Navigation**: messages of navigation will be displayed only on the web page for which they are enqueued. It will be hidden (not dismissed) when the user switches to another tab and displayed again when the user returns to the target tab. It will be dismissed when user navigates to another page, such as navigating to [https://chromium.org](https://chromium.org) from [https://google.com](https://google.com) or navigating to [https://google.com/about](https://google.com/about) from [https://google.com/settings](https://google.com/settings), and also dismissed when the tab where the page lives is closed. This should be used when the content and purpose of the Message is tightly related to a certain page. For example, password messages should be only displayed on the page where the user submits the password and dismissed if the user navigates to another page. -2. **Window**: messages of window scope will be displayed as long as the current window is alive (current window is dead usually when app is closed or user merges windows). It can be displayed on any tab and web page. So this scope should be used only when the content and purpose of the message is unrelated to the web page. For example, Sync Error message is related to the app rather than the page and works as an app-level notification. Use #EnqueueWindowScopedMessage to enqueue a window-scoped message. -3. **Web_Contents**: this one is rarely used and usually not recommended unless really necessary. The only difference between web_contents scope and navigation scope is that messages of web_contents scope do not dismiss when the user navigates to another page; i.e. it is only dismissed when its associated tab is closed. +1. **Navigation**: messages of navigation will be displayed only on the web page + for which they are enqueued. It will be hidden (not dismissed) when the user + switches to another tab and displayed again when the user returns to the + target tab. It will be dismissed when user navigates to another page, such as + navigating to [https://chromium.org](https://chromium.org) from + [https://google.com](https://google.com) or navigating to + [https://google.com/about](https://google.com/about) from + [https://google.com/settings](https://google.com/settings), and also + dismissed when the tab where the page lives is closed. This should be used + when the content and purpose of the Message is tightly related to a certain + page. For example, password messages should be only displayed on the page + where the user submits the password and dismissed if the user navigates to + another page. +2. **Window**: messages of window scope will be displayed as long as the current + window is alive (current window is dead usually when app is closed or user + merges windows). It can be displayed on any tab and web page. So this scope + should be used only when the content and purpose of the message is unrelated + to the web page. For example, Sync Error message is related to the app rather + than the page and works as an app-level notification. Use + #EnqueueWindowScopedMessage to enqueue a window-scoped message. +3. **Web_Contents**: this one is rarely used and usually not recommended unless + really necessary. The only difference between web_contents scope and navigation + scope is that messages of web_contents scope do not dismiss when the user + navigates to another page; i.e. it is only dismissed when its associated + tab is closed. ### Priority There are two types of priority: urgent (a.k.a high) and normal (a.k.a low). -Urgent messages will be displayed ASAP, in spite of enqueued messages of normal properties. Urgent should only be used when the message is so important that you want users to take an action ASAP, such as a serious security risk found on the page the user is visiting. Otherwise, use normal in most cases. +Urgent messages will be displayed ASAP, in spite of enqueued messages of normal +properties. Urgent should only be used when the message is so important that you +want users to take an action ASAP, such as a serious security risk found on the +page the user is visiting. Otherwise, use normal in most cases. ## Dismiss your message -As explained in [Overview](#Overview), by default, the message will be dismissed in the following cases: +As explained in [Overview](#Overview), by default, the message will be dismissed +in the following cases: -1. Timeout -2. Swiping gesture -3. Primary action button is clicked -4. The given scope is destroyed +* Timeout +* Swiping gesture +* Primary action button is clicked +* The given scope is destroyed -In addition, messages can be dismissed by feature client code so that the message won’t be displayed any more. Use MessageDispatcher#dismissMessage to dismiss the message. The dismiss callback will still be triggered. +In addition, messages can be dismissed by feature client code so that the +message won’t be displayed any more. Use MessageDispatcher#dismissMessage to +dismiss the message. The dismiss callback will still be triggered. ## Ownership in native -In native, MessageDispatcherBridge#EnqueueMessage will return a MessageWrapper object. The feature client is responsible for managing it. We recommend dismissing the message manually if the MessageWrapper object is still alive when the owner of the MessageWrapper object is destroyed. +In native, MessageDispatcherBridge#EnqueueMessage will return a MessageWrapper +object. The feature client is responsible for managing it. We recommend +dismissing the message manually if the MessageWrapper object is still alive when +the owner of the MessageWrapper object is destroyed. ## Test -On the Java side, [components/messages/android/test/…/messages/MessagesTestHelper.java ](https://source.chromium.org/chromium/chromium/src/+/main:components/messages/android/test/java/src/org/chromium/components/messages/MessagesTestHelper.java) is available to get all current enqueued messages and get the property model of a certain message. +On the Java side, +[components/messages/android/test/…/messages/MessagesTestHelper.java](https://source.chromium.org/chromium/chromium/src/+/main:components/messages/android/test/java/src/org/chromium/components/messages/MessagesTestHelper.java) +is available to get all current enqueued messages and get the property model of a certain message. -In native, components/messages/android/mock_message_dispatcher_bridge.h is available to test whether a message is enqueued and trigger some callbacks manually. You can refer to [this CL](https://chromium-review.googlesource.com/c/chromium/src/+/3161257/5/chrome/browser/android/oom_intervention/near_oom_reduction_message_delegate_unittest.cc) as an example. +In native, components/messages/android/mock_message_dispatcher_bridge.h is +available to test whether a message is enqueued and trigger some callbacks +manually. You can refer to +[this CL](https://chromium-review.googlesource.com/c/chromium/src/+/3161257/5/chrome/browser/android/oom_intervention/near_oom_reduction_message_delegate_unittest.cc) +as an example. ## Built-in Metrics @@ -114,24 +192,34 @@ **Android.Messages.Enqueued** -Records the message identifier each time a message is enqueued through MessageDispatcher. This histogram can be used for getting a count of messages broken down by message identifier. +Records the message identifier each time a message is enqueued through +MessageDispatcher. This histogram can be used for getting a count of messages +broken down by message identifier. **Android.Messages.Dismissed.{MessageIdentifier}** -Records the reason why this message is dismissed, such as primary action, timer, gesture and so on. +Records the reason why this message is dismissed, such as primary action, timer, +gesture and so on. **Android.Messages.TimeToAction.Dismiss.{MessageIdentifier}** -Records the time interval the message was displayed on the screen before the user dismissed it with a gesture. The metric is NOT recorded when the user presses primary or secondary button or when the message is auto-dismissed based on timer. +Records the time interval the message was displayed on the screen before the +user dismissed it with a gesture. The metric is NOT recorded when the user +presses primary or secondary button or when the message is auto-dismissed based +on timer. **Android.Messages.TimeToAction.{MessageIdentifier}** -Records the time interval the message was displayed on the screen before the user explicitly dismissed it. The metric is recorded when the user presses the primary or secondary button, or dismisses the message with a gesture. +Records the time interval the message was displayed on the screen before the +user explicitly dismissed it. The metric is recorded when the user presses the +primary or secondary button, or dismisses the message with a gesture. ## Built-in Finch Parameter to control the duration -Using `autodismiss_duration_ms_{MessageIdentifier}` inside the feature `MessagesForAndroidInfrastructure` to configure the duration through finch. This method does not require any code changes in clients. E.g.: +Using `autodismiss_duration_ms_{MessageIdentifier}` inside the feature +`MessagesForAndroidInfrastructure` to configure the duration through finch. +This method does not require any code changes in clients. E.g.: ``` @@ -143,4 +231,6 @@ } ``` -**Warning**: MessagesForAndroidInfrastructure is enabled in default. **DO NOT** disable it in any group. Disabling MessagesForAndroidInfrastructure will break other experiments depending on that flag. +> **Warning**: MessagesForAndroidInfrastructure is enabled by default. +> **DO NOT** disable it in any group. Disabling MessagesForAndroidInfrastructure +> will break other experiments depending on that flag.
diff --git a/components/messages/android/internal/java/src/org/chromium/components/messages/MessageQueueManagerTest.java b/components/messages/android/internal/java/src/org/chromium/components/messages/MessageQueueManagerTest.java index df05849..f7a2b0e 100644 --- a/components/messages/android/internal/java/src/org/chromium/components/messages/MessageQueueManagerTest.java +++ b/components/messages/android/internal/java/src/org/chromium/components/messages/MessageQueueManagerTest.java
@@ -18,6 +18,7 @@ import static org.mockito.Mockito.when; import android.os.Build; +import android.view.ViewGroup; import androidx.test.filters.SmallTest; @@ -36,8 +37,8 @@ import org.chromium.base.test.util.DisableIf; import org.chromium.components.messages.MessageQueueManager.MessageState; import org.chromium.components.messages.MessageScopeChange.ChangeType; -import org.chromium.content_public.browser.Visibility; import org.chromium.content_public.browser.test.mock.MockWebContents; +import org.chromium.ui.base.ViewAndroidDelegate; import org.chromium.ui.base.WindowAndroid; /** @@ -74,10 +75,12 @@ } } - private static class InactiveMockWebContents extends MockWebContents { + private static class ActiveMockWebContents extends MockWebContents { @Override - public @Visibility int getVisibility() { - return Visibility.HIDDEN; + public ViewAndroidDelegate getViewAndroidDelegate() { + ViewGroup view = Mockito.mock(ViewGroup.class); + when(view.getVisibility()).thenReturn(ViewGroup.VISIBLE); + return ViewAndroidDelegate.createBasicDelegate(view); } } @@ -95,10 +98,10 @@ private static final int SCOPE_TYPE = MessageScopeType.NAVIGATION; private static final ScopeKey SCOPE_INSTANCE_ID = - new ScopeKey(SCOPE_TYPE, new MockWebContents()); + new ScopeKey(SCOPE_TYPE, new ActiveMockWebContents()); private static final ScopeKey SCOPE_INSTANCE_ID_A = - new ScopeKey(SCOPE_TYPE, new MockWebContents()); + new ScopeKey(SCOPE_TYPE, new ActiveMockWebContents()); @Before public void setUp() { @@ -344,8 +347,8 @@ MessageQueueDelegate delegate = Mockito.spy(mEmptyDelegate); MessageQueueManager queueManager = new MessageQueueManager(); queueManager.setDelegate(delegate); - final ScopeKey inactiveScopeKey = new ScopeKey(SCOPE_TYPE, new InactiveMockWebContents()); - final ScopeKey inactiveScopeKey2 = new ScopeKey(SCOPE_TYPE, new InactiveMockWebContents()); + final ScopeKey inactiveScopeKey = new ScopeKey(SCOPE_TYPE, new MockWebContents()); + final ScopeKey inactiveScopeKey2 = new ScopeKey(SCOPE_TYPE, new MockWebContents()); MessageStateHandler m1 = Mockito.spy(new EmptyMessageStateHandler()); queueManager.enqueueMessage(m1, m1, inactiveScopeKey2, false); @@ -393,9 +396,9 @@ MessageQueueManager queueManager = new MessageQueueManager(); queueManager.setDelegate(delegate); final ScopeKey navScopeKey = - new ScopeKey(MessageScopeType.NAVIGATION, new MockWebContents()); + new ScopeKey(MessageScopeType.NAVIGATION, new ActiveMockWebContents()); final ScopeKey windowScopeKey = - new ScopeKey(MessageScopeType.WEB_CONTENTS, new MockWindowAndroidWebContents()); + new ScopeKey(new MockWindowAndroidWebContents().getTopLevelNativeWindow()); MessageStateHandler m1 = Mockito.spy(new EmptyMessageStateHandler()); queueManager.enqueueMessage(m1, m1, navScopeKey, false);
diff --git a/components/messages/android/internal/java/src/org/chromium/components/messages/ScopeChangeController.java b/components/messages/android/internal/java/src/org/chromium/components/messages/ScopeChangeController.java index ce24451..ae149043 100644 --- a/components/messages/android/internal/java/src/org/chromium/components/messages/ScopeChangeController.java +++ b/components/messages/android/internal/java/src/org/chromium/components/messages/ScopeChangeController.java
@@ -4,6 +4,8 @@ package org.chromium.components.messages; +import android.view.View; + import androidx.annotation.Nullable; import org.chromium.base.ActivityState; @@ -12,8 +14,10 @@ import org.chromium.content_public.browser.NavigationController; import org.chromium.content_public.browser.NavigationEntry; import org.chromium.content_public.browser.Visibility; +import org.chromium.content_public.browser.WebContents; import org.chromium.content_public.browser.WebContentsObserver; import org.chromium.ui.base.PageTransition; +import org.chromium.ui.base.ViewAndroidDelegate; import org.chromium.ui.base.WindowAndroid; import org.chromium.ui.base.WindowAndroid.ActivityStateObserver; @@ -79,22 +83,30 @@ super(scopeKey.webContents); mDelegate = delegate; mScopeKey = scopeKey; - mDelegate.onScopeChange(new MessageScopeChange(mScopeKey.scopeType, scopeKey, - scopeKey.webContents.getVisibility() == Visibility.VISIBLE - ? ChangeType.ACTIVE - : ChangeType.INACTIVE)); + int changeType = ChangeType.INACTIVE; + WebContents webContents = scopeKey.webContents; + if (webContents != null && webContents.getViewAndroidDelegate() != null + && webContents.getVisibility() == Visibility.VISIBLE) { + ViewAndroidDelegate viewAndroidDelegate = webContents.getViewAndroidDelegate(); + if (viewAndroidDelegate.getContainerView() != null + && viewAndroidDelegate.getContainerView().getVisibility() == View.VISIBLE) { + changeType = ChangeType.ACTIVE; + } else { + changeType = ChangeType.INACTIVE; + } + } + mDelegate.onScopeChange( + new MessageScopeChange(mScopeKey.scopeType, scopeKey, changeType)); } @Override - public void wasShown() { - super.wasShown(); + public void onWebContentsFocused() { mDelegate.onScopeChange( new MessageScopeChange(mScopeKey.scopeType, mScopeKey, ChangeType.ACTIVE)); } @Override - public void wasHidden() { - super.wasHidden(); + public void onWebContentsLostFocus() { mDelegate.onScopeChange( new MessageScopeChange(mScopeKey.scopeType, mScopeKey, ChangeType.INACTIVE)); }
diff --git a/components/messages/android/internal/java/src/org/chromium/components/messages/ScopeChangeControllerTest.java b/components/messages/android/internal/java/src/org/chromium/components/messages/ScopeChangeControllerTest.java index f6fd252..e2c054b8 100644 --- a/components/messages/android/internal/java/src/org/chromium/components/messages/ScopeChangeControllerTest.java +++ b/components/messages/android/internal/java/src/org/chromium/components/messages/ScopeChangeControllerTest.java
@@ -70,8 +70,9 @@ Assert.assertEquals("Scope type should be inactive when page is hidden", ChangeType.INACTIVE, captor.getValue().changeType); - observer.wasShown(); + observer.onWebContentsFocused(); expectedOnScopeChangeCalls++; + verify(delegate, times(expectedOnScopeChangeCalls) .description("Delegate should be called when page is shown")) @@ -79,7 +80,7 @@ Assert.assertEquals("Scope type should be active when page is shown", ChangeType.ACTIVE, captor.getValue().changeType); - observer.wasHidden(); + observer.onWebContentsLostFocus(); expectedOnScopeChangeCalls++; verify(delegate, times(expectedOnScopeChangeCalls)
diff --git a/components/network_session_configurator/browser/network_session_configurator_unittest.cc b/components/network_session_configurator/browser/network_session_configurator_unittest.cc index 7239cc7..39d3678 100644 --- a/components/network_session_configurator/browser/network_session_configurator_unittest.cc +++ b/components/network_session_configurator/browser/network_session_configurator_unittest.cc
@@ -71,7 +71,6 @@ EXPECT_FALSE(params_.enable_http2_settings_grease); EXPECT_FALSE(params_.greased_http2_frame); EXPECT_FALSE(params_.http2_end_stream_with_data_frame); - EXPECT_TRUE(params_.enable_websocket_over_http2); EXPECT_TRUE(params_.enable_quic); EXPECT_TRUE(quic_params_.retry_without_alt_svc_on_quic_errors);
diff --git a/components/omnibox/browser/BUILD.gn b/components/omnibox/browser/BUILD.gn index 93d4703..06f274d 100644 --- a/components/omnibox/browser/BUILD.gn +++ b/components/omnibox/browser/BUILD.gn
@@ -399,6 +399,7 @@ "android/java/src/org/chromium/components/omnibox/SecurityButtonAnimationDelegate.java", "android/java/src/org/chromium/components/omnibox/SecurityStatusIcon.java", "android/java/src/org/chromium/components/omnibox/SuggestionAnswer.java", + "android/java/src/org/chromium/components/omnibox/action/OmniboxPedal.java", ] resources_package = "org.chromium.components.omnibox" @@ -423,6 +424,7 @@ java_cpp_enum("browser_java_enums_srcjar") { sources = [ + "actions/omnibox_pedal_concepts.h", "autocomplete_match.h", "autocomplete_match_type.h", "suggestion_answer.h", @@ -436,6 +438,7 @@ "android/java/src/org/chromium/components/omnibox/AutocompleteSchemeClassifier.java", "android/java/src/org/chromium/components/omnibox/OmniboxUrlEmphasizer.java", "android/java/src/org/chromium/components/omnibox/SuggestionAnswer.java", + "android/java/src/org/chromium/components/omnibox/action/OmniboxPedal.java", ] } }
diff --git a/components/omnibox/browser/actions/omnibox_action.cc b/components/omnibox/browser/actions/omnibox_action.cc index 4271cf8..d03ee25 100644 --- a/components/omnibox/browser/actions/omnibox_action.cc +++ b/components/omnibox/browser/actions/omnibox_action.cc
@@ -103,6 +103,13 @@ return 0; } +#if defined(OS_ANDROID) +base::android::ScopedJavaGlobalRef<jobject> OmniboxAction::GetJavaObject() + const { + return base::android::ScopedJavaGlobalRef<jobject>(); +} +#endif + void OmniboxAction::OpenURL(OmniboxAction::ExecutionContext& context, const GURL& url) const { // Set `match_type` as if the user just typed |url| verbatim.
diff --git a/components/omnibox/browser/actions/omnibox_action.h b/components/omnibox/browser/actions/omnibox_action.h index 6d49c84..1a1c4e84 100644 --- a/components/omnibox/browser/actions/omnibox_action.h +++ b/components/omnibox/browser/actions/omnibox_action.h
@@ -26,6 +26,10 @@ } #endif +#if defined(OS_ANDROID) +#include "base/android/scoped_java_ref.h" +#endif + class AutocompleteInput; class AutocompleteProviderClient; @@ -119,6 +123,10 @@ // Provides read access to labels associated with this Action. const LabelStrings& GetLabelStrings() const; + // Returns the destination URL for navigation Actions, Otherwise, returns an + // empty URL. + const GURL& getUrl() const { return url_; } + // Records that the action was shown at index `position` in the popup. virtual void RecordActionShown(size_t position) const {} @@ -150,6 +158,10 @@ // Returns an ID used to identify some actions. Not defined for all Actions. virtual int32_t GetID() const; +#if defined(OS_ANDROID) + virtual base::android::ScopedJavaGlobalRef<jobject> GetJavaObject() const; +#endif + protected: friend class base::RefCounted<OmniboxAction>; virtual ~OmniboxAction();
diff --git a/components/omnibox/browser/actions/omnibox_pedal.cc b/components/omnibox/browser/actions/omnibox_pedal.cc index 3e6be22..9995527 100644 --- a/components/omnibox/browser/actions/omnibox_pedal.cc +++ b/components/omnibox/browser/actions/omnibox_pedal.cc
@@ -21,6 +21,13 @@ #include "components/omnibox/browser/vector_icons.h" // nogncheck #endif +#if defined(OS_ANDROID) +#include "base/android/jni_android.h" +#include "base/android/jni_string.h" +#include "components/omnibox/browser/jni_headers/OmniboxPedal_jni.h" +#include "url/android/gurl_android.h" +#endif + OmniboxPedal::TokenSequence::TokenSequence(size_t reserve_size) { tokens_.reserve(reserve_size); } @@ -232,7 +239,11 @@ OmniboxPedal::OmniboxPedal(OmniboxPedalId id, LabelStrings strings, GURL url) : OmniboxAction(strings, url), id_(id), - verbatim_synonym_group_(false, true, 0) {} + verbatim_synonym_group_(false, true, 0) { +#if defined(OS_ANDROID) + CreateOrUpdateJavaObject(); +#endif +} OmniboxPedal::~OmniboxPedal() = default; @@ -247,10 +258,16 @@ ->GetAsString(&strings_.accessibility_hint); ui_strings.FindKey("spoken_suggestion_description_suffix") ->GetAsString(&strings_.accessibility_suffix); +#if defined(OS_ANDROID) + CreateOrUpdateJavaObject(); +#endif } void OmniboxPedal::SetNavigationUrl(const GURL& url) { url_ = url; +#if defined(OS_ANDROID) + CreateOrUpdateJavaObject(); +#endif } #if defined(SUPPORT_PEDALS_VECTOR_ICONS) @@ -318,3 +335,21 @@ return static_cast<int32_t>(id()); } +#if defined(OS_ANDROID) +base::android::ScopedJavaGlobalRef<jobject> OmniboxPedal::GetJavaObject() + const { + return j_omnibox_action_; +} + +void OmniboxPedal::CreateOrUpdateJavaObject() { + JNIEnv* env = base::android::AttachCurrentThread(); + j_omnibox_action_.Reset(Java_OmniboxPedal_build( + env, GetID(), base::android::ConvertUTF16ToJavaString(env, strings_.hint), + base::android::ConvertUTF16ToJavaString(env, + strings_.suggestion_contents), + base::android::ConvertUTF16ToJavaString(env, + strings_.accessibility_suffix), + base::android::ConvertUTF16ToJavaString(env, strings_.accessibility_hint), + url::GURLAndroid::FromNativeGURL(env, url_))); +} +#endif
diff --git a/components/omnibox/browser/actions/omnibox_pedal.h b/components/omnibox/browser/actions/omnibox_pedal.h index 174a085..54f95a4 100644 --- a/components/omnibox/browser/actions/omnibox_pedal.h +++ b/components/omnibox/browser/actions/omnibox_pedal.h
@@ -232,6 +232,11 @@ size_t EstimateMemoryUsage() const override; int32_t GetID() const override; +#if defined(OS_ANDROID) + base::android::ScopedJavaGlobalRef<jobject> GetJavaObject() const override; + void CreateOrUpdateJavaObject(); +#endif + protected: FRIEND_TEST_ALL_PREFIXES(OmniboxPedalTest, SynonymGroupErasesFirstMatchOnly); FRIEND_TEST_ALL_PREFIXES(OmniboxPedalTest, SynonymGroupsDriveConceptMatches); @@ -249,6 +254,10 @@ SynonymGroup verbatim_synonym_group_; std::vector<SynonymGroup> synonym_groups_; + +#if defined(OS_ANDROID) + base::android::ScopedJavaGlobalRef<jobject> j_omnibox_action_; +#endif }; // This is a simple pedal suitable only for use by tests.
diff --git a/components/omnibox/browser/actions/omnibox_pedal_concepts.h b/components/omnibox/browser/actions/omnibox_pedal_concepts.h index ab75c76..f9d8dbd 100644 --- a/components/omnibox/browser/actions/omnibox_pedal_concepts.h +++ b/components/omnibox/browser/actions/omnibox_pedal_concepts.h
@@ -16,6 +16,10 @@ // Also used in the Omnibox.SuggestionUsed.Pedal histogram. Do not remove or // reuse values. If any pedal types are removed from Chrome, the associated ID // will remain and be marked as obsolete. +// +// Automatically generate a corresponding Java enum: +// GENERATED_JAVA_ENUM_PACKAGE: org.chromium.chrome.browser.omnibox.action +// GENERATED_JAVA_CLASS_NAME_OVERRIDE: OmniboxPedalType enum class OmniboxPedalId { NONE = 0,
diff --git a/components/omnibox/browser/android/java/src/org/chromium/components/omnibox/AutocompleteMatch.java b/components/omnibox/browser/android/java/src/org/chromium/components/omnibox/AutocompleteMatch.java index acabb7d0..014e90782 100644 --- a/components/omnibox/browser/android/java/src/org/chromium/components/omnibox/AutocompleteMatch.java +++ b/components/omnibox/browser/android/java/src/org/chromium/components/omnibox/AutocompleteMatch.java
@@ -14,6 +14,7 @@ import org.chromium.base.annotations.CalledByNative; import org.chromium.base.annotations.NativeMethods; import org.chromium.chrome.browser.omnibox.MatchClassificationStyle; +import org.chromium.components.omnibox.action.OmniboxPedal; import org.chromium.components.query_tiles.QueryTile; import org.chromium.url.GURL; @@ -102,6 +103,7 @@ private boolean mHasTabMatch; private final @Nullable List<NavsuggestTile> mNavsuggestTiles; private long mNativeMatch; + private final @Nullable OmniboxPedal mOmniboxPedal; public AutocompleteMatch(int nativeType, Set<Integer> subtypes, boolean isSearchType, int relevance, int transition, String displayText, @@ -110,7 +112,7 @@ String fillIntoEdit, GURL url, GURL imageUrl, String imageDominantColor, boolean isDeletable, String postContentType, byte[] postData, int groupId, List<QueryTile> queryTiles, byte[] clipboardImageData, boolean hasTabMatch, - List<NavsuggestTile> navsuggestTiles) { + List<NavsuggestTile> navsuggestTiles, OmniboxPedal omniboxPedal) { if (subtypes == null) { subtypes = Collections.emptySet(); } @@ -138,6 +140,7 @@ mClipboardImageData = clipboardImageData; mHasTabMatch = hasTabMatch; mNavsuggestTiles = navsuggestTiles; + mOmniboxPedal = omniboxPedal; } @CalledByNative @@ -149,7 +152,7 @@ GURL url, GURL imageUrl, String imageDominantColor, boolean isDeletable, String postContentType, byte[] postData, int groupId, List<QueryTile> tiles, byte[] clipboardImageData, boolean hasTabMatch, String[] navsuggestTitles, - GURL[] navsuggestUrls) { + GURL[] navsuggestUrls, OmniboxPedal omniboxPedal) { assert contentClassificationOffsets.length == contentClassificationStyles.length; List<MatchClassification> contentClassifications = new ArrayList<>(); for (int i = 0; i < contentClassificationOffsets.length; i++) { @@ -172,7 +175,7 @@ relevance, transition, contents, contentClassifications, description, new ArrayList<>(), answer, fillIntoEdit, url, imageUrl, imageDominantColor, isDeletable, postContentType, postData, groupId, tiles, clipboardImageData, - hasTabMatch, navsuggestTiles); + hasTabMatch, navsuggestTiles, omniboxPedal); match.updateNativeObjectRef(nativeObject); match.setDescription( description, descriptionClassificationOffsets, descriptionClassificationStyles); @@ -317,6 +320,11 @@ return mHasTabMatch; } + @Nullable + public OmniboxPedal getOmniboxPedal() { + return mOmniboxPedal; + } + /** * @return The image data for the image clipbaord suggestion. This data has already been * validated in C++ and is safe to use in the browser process.
diff --git a/components/omnibox/browser/android/java/src/org/chromium/components/omnibox/action/OmniboxPedal.java b/components/omnibox/browser/android/java/src/org/chromium/components/omnibox/action/OmniboxPedal.java new file mode 100644 index 0000000..01c21f2 --- /dev/null +++ b/components/omnibox/browser/android/java/src/org/chromium/components/omnibox/action/OmniboxPedal.java
@@ -0,0 +1,85 @@ +// Copyright 2021 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.components.omnibox.action; + +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; + +import org.chromium.base.annotations.CalledByNative; +import org.chromium.url.GURL; + +/** + * Omnibox Actions are additional actions associated with Omnibox Matches. For more information, + * please check on OmniboxAction class definition on native side. + */ +public class OmniboxPedal { + private final int mId; + private final @NonNull String mHint; + private final @NonNull String mSuggestionContents; + private final @NonNull String mAccessibilitySuffix; + private final @NonNull String mAccessibilityHint; + private final @Nullable GURL mUrl; + + public OmniboxPedal(int id, @NonNull String hint, @NonNull String suggestionContents, + @NonNull String accessibilitySuffix, @NonNull String accessibilityHint, + @Nullable GURL url) { + mId = id; + mHint = hint; + mSuggestionContents = suggestionContents; + mAccessibilitySuffix = accessibilitySuffix; + mAccessibilityHint = accessibilityHint; + mUrl = url; + } + + /** + * @return an ID used to identify some actions. Not defined for all Actions. + */ + public int getID() { + return mId; + } + + /** + * @return the hint for the action. + */ + public @NonNull String getHint() { + return mHint; + } + + /** + * @return the suggestion contents for the action. + */ + public @NonNull String getSuggestionContents() { + return mSuggestionContents; + } + + /** + * @return the accessibility suffix for the action. + */ + public @NonNull String getAccessibilitySuffix() { + return mAccessibilitySuffix; + } + + /** + * @return the accessibility hint for the action. + */ + public @NonNull String getAccessibilityHint() { + return mAccessibilityHint; + } + + /** + * @return the URL for the action. + */ + public @Nullable GURL getUrl() { + return mUrl; + } + + @CalledByNative + private static OmniboxPedal build(int id, @NonNull String hint, + @NonNull String suggestionContents, @NonNull String accessibilitySuffix, + @NonNull String accessibilityHint, @Nullable GURL url) { + return new OmniboxPedal( + id, hint, suggestionContents, accessibilitySuffix, accessibilityHint, url); + } +} \ No newline at end of file
diff --git a/components/omnibox/browser/android/javatests/src/org/chromium/components/omnibox/AutocompleteMatchBuilder.java b/components/omnibox/browser/android/javatests/src/org/chromium/components/omnibox/AutocompleteMatchBuilder.java index cbeec842..520c1e5 100644 --- a/components/omnibox/browser/android/javatests/src/org/chromium/components/omnibox/AutocompleteMatchBuilder.java +++ b/components/omnibox/browser/android/javatests/src/org/chromium/components/omnibox/AutocompleteMatchBuilder.java
@@ -8,6 +8,7 @@ import org.chromium.chrome.browser.omnibox.MatchClassificationStyle; import org.chromium.chrome.browser.omnibox.OmniboxSuggestionType; +import org.chromium.components.omnibox.action.OmniboxPedal; import org.chromium.components.query_tiles.QueryTile; import org.chromium.url.GURL; @@ -43,6 +44,7 @@ private byte[] mClipboardImageData; private boolean mHasTabMatch; private List<AutocompleteMatch.NavsuggestTile> mNavsuggestTiles; + private OmniboxPedal mOmniboxPedal; /** * Create a suggestion builder for a search suggestion. @@ -92,6 +94,7 @@ mClipboardImageData = null; mHasTabMatch = false; mNavsuggestTiles = null; + mOmniboxPedal = null; mDisplayTextClassifications.add( new AutocompleteMatch.MatchClassification(0, MatchClassificationStyle.NONE)); @@ -110,7 +113,7 @@ mDisplayText, mDisplayTextClassifications, mDescription, mDescriptionClassifications, mAnswer, mFillIntoEdit, mUrl, mImageUrl, mImageDominantColor, mIsDeletable, mPostContentType, mPostData, mGroupId, - mQueryTiles, mClipboardImageData, mHasTabMatch, mNavsuggestTiles); + mQueryTiles, mClipboardImageData, mHasTabMatch, mNavsuggestTiles, mOmniboxPedal); } /** @@ -257,4 +260,13 @@ mNavsuggestTiles = tiles; return this; } + + /** + * @param omniboxPedal Omnibox pedal. + * @return Omnibox suggestion builder. + */ + public AutocompleteMatchBuilder setOmniboxPedal(OmniboxPedal omniboxPedal) { + mOmniboxPedal = omniboxPedal; + return this; + } }
diff --git a/components/omnibox/browser/autocomplete_match_android.cc b/components/omnibox/browser/autocomplete_match_android.cc index 525882c..19d0aea 100644 --- a/components/omnibox/browser/autocomplete_match_android.cc +++ b/components/omnibox/browser/autocomplete_match_android.cc
@@ -86,6 +86,11 @@ std::vector<int> temp_subtypes(subtypes.begin(), subtypes.end()); + ScopedJavaLocalRef<jobject> j_action_obj; + if (action) { + j_action_obj = action->GetJavaObject(); + } + java_match_ = std::make_unique<ScopedJavaGlobalRef<jobject>>( Java_AutocompleteMatch_build( env, reinterpret_cast<intptr_t>(this), type, @@ -106,7 +111,8 @@ j_query_tiles, ToJavaByteArray(env, clipboard_image_data), has_tab_match.value_or(false), ToJavaArrayOfStrings(env, navsuggest_titles), - url::GURLAndroid::ToJavaArrayOfGURLs(env, navsuggest_urls))); + url::GURLAndroid::ToJavaArrayOfGURLs(env, navsuggest_urls), + j_action_obj)); return ScopedJavaLocalRef<jobject>(*java_match_); }
diff --git a/components/safe_browsing/content/renderer/phishing_classifier/flatbuffer_scorer.cc b/components/safe_browsing/content/renderer/phishing_classifier/flatbuffer_scorer.cc index da3f5e1..baed01e 100644 --- a/components/safe_browsing/content/renderer/phishing_classifier/flatbuffer_scorer.cc +++ b/components/safe_browsing/content/renderer/phishing_classifier/flatbuffer_scorer.cc
@@ -184,7 +184,8 @@ NOTIMPLEMENTED(); } -#if BUILDFLAG(BUILD_WITH_TFLITE_LIB) +#if BUILDFLAG(BUILD_WITH_TFLITE_LIB) && !defined(OS_CHROMEOS) && \ + !BUILDFLAG(IS_CHROMEOS_ASH) && !BUILDFLAG(IS_CHROMEOS_LACROS) void FlatBufferModelScorer::ApplyVisualTfLiteModel( const SkBitmap& bitmap, base::OnceCallback<void(std::vector<double>)> callback) {
diff --git a/components/safe_browsing/content/renderer/phishing_classifier/flatbuffer_scorer.h b/components/safe_browsing/content/renderer/phishing_classifier/flatbuffer_scorer.h index 9f15f13..b7da115 100644 --- a/components/safe_browsing/content/renderer/phishing_classifier/flatbuffer_scorer.h +++ b/components/safe_browsing/content/renderer/phishing_classifier/flatbuffer_scorer.h
@@ -26,6 +26,7 @@ #include "base/files/memory_mapped_file.h" #include "base/memory/read_only_shared_memory_region.h" #include "base/strings/string_piece.h" +#include "build/build_config.h" #include "components/safe_browsing/content/renderer/phishing_classifier/scorer.h" #include "components/safe_browsing/core/common/fbs/client_model_generated.h" #include "components/safe_browsing/core/common/proto/client_model.pb.h" @@ -53,7 +54,9 @@ base::OnceCallback<void(std::unique_ptr<ClientPhishingRequest>)> callback) const override; -#if BUILDFLAG(BUILD_WITH_TFLITE_LIB) +// TODO(crbug/1278502): This is disabled as a temporary measure due to crashes. +#if BUILDFLAG(BUILD_WITH_TFLITE_LIB) && !defined(OS_CHROMEOS) && \ + !BUILDFLAG(IS_CHROMEOS_ASH) && !BUILDFLAG(IS_CHROMEOS_LACROS) void ApplyVisualTfLiteModel( const SkBitmap& bitmap, base::OnceCallback<void(std::vector<double>)> callback) override;
diff --git a/components/safe_browsing/content/renderer/phishing_classifier/phishing_classifier.cc b/components/safe_browsing/content/renderer/phishing_classifier/phishing_classifier.cc index 00751119..229c38d 100644 --- a/components/safe_browsing/content/renderer/phishing_classifier/phishing_classifier.cc +++ b/components/safe_browsing/content/renderer/phishing_classifier/phishing_classifier.cc
@@ -288,7 +288,9 @@ *bitmap_, std::move(verdict), base::BindOnce(&PhishingClassifier::OnVisualTargetsMatched, weak_factory_.GetWeakPtr())); -#elif BUILDFLAG(BUILD_WITH_TFLITE_LIB) +// TODO(crbug/1278502): This is disabled as a temporary measure due to crashes. +#elif BUILDFLAG(BUILD_WITH_TFLITE_LIB) && !defined(OS_CHROMEOS) && \ + !BUILDFLAG(IS_CHROMEOS_ASH) && !BUILDFLAG(IS_CHROMEOS_LACROS) scorer_->ApplyVisualTfLiteModel( *bitmap_, base::BindOnce(&PhishingClassifier::OnVisualTfLiteModelDone, weak_factory_.GetWeakPtr(), std::move(verdict))); @@ -306,7 +308,9 @@ base::UmaHistogramTimes("SBClientPhishing.VisualComparisonTime", base::TimeTicks::Now() - visual_matching_start_); -#if BUILDFLAG(BUILD_WITH_TFLITE_LIB) +// TODO(crbug/1278502): This is disabled as a temporary measure due to crashes. +#if BUILDFLAG(BUILD_WITH_TFLITE_LIB) && !defined(OS_CHROMEOS) && \ + !BUILDFLAG(IS_CHROMEOS_ASH) && !BUILDFLAG(IS_CHROMEOS_LACROS) scorer_->ApplyVisualTfLiteModel( *bitmap_, base::BindOnce(&PhishingClassifier::OnVisualTfLiteModelDone, weak_factory_.GetWeakPtr(), std::move(verdict)));
diff --git a/components/safe_browsing/content/renderer/phishing_classifier/protobuf_scorer.cc b/components/safe_browsing/content/renderer/phishing_classifier/protobuf_scorer.cc index f1ee990..3e19986 100644 --- a/components/safe_browsing/content/renderer/phishing_classifier/protobuf_scorer.cc +++ b/components/safe_browsing/content/renderer/phishing_classifier/protobuf_scorer.cc
@@ -152,7 +152,8 @@ std::move(callback)); } -#if BUILDFLAG(BUILD_WITH_TFLITE_LIB) +#if BUILDFLAG(BUILD_WITH_TFLITE_LIB) && !defined(OS_CHROMEOS) && \ + !BUILDFLAG(IS_CHROMEOS_ASH) && !BUILDFLAG(IS_CHROMEOS_LACROS) void ProtobufModelScorer::ApplyVisualTfLiteModel( const SkBitmap& bitmap, base::OnceCallback<void(std::vector<double>)> callback) {
diff --git a/components/safe_browsing/content/renderer/phishing_classifier/protobuf_scorer.h b/components/safe_browsing/content/renderer/phishing_classifier/protobuf_scorer.h index 13833034..850b622 100644 --- a/components/safe_browsing/content/renderer/phishing_classifier/protobuf_scorer.h +++ b/components/safe_browsing/content/renderer/phishing_classifier/protobuf_scorer.h
@@ -25,6 +25,7 @@ #include "base/files/file.h" #include "base/files/memory_mapped_file.h" #include "base/strings/string_piece.h" +#include "build/build_config.h" #include "components/safe_browsing/content/renderer/phishing_classifier/scorer.h" #include "components/safe_browsing/core/common/proto/client_model.pb.h" #include "components/safe_browsing/core/common/proto/csd.pb.h" @@ -51,7 +52,9 @@ base::OnceCallback<void(std::unique_ptr<ClientPhishingRequest>)> callback) const override; -#if BUILDFLAG(BUILD_WITH_TFLITE_LIB) +// TODO(crbug/1278502): This is disabled as a temporary measure due to crashes. +#if BUILDFLAG(BUILD_WITH_TFLITE_LIB) && !defined(OS_CHROMEOS) && \ + !BUILDFLAG(IS_CHROMEOS_ASH) && !BUILDFLAG(IS_CHROMEOS_LACROS) void ApplyVisualTfLiteModel( const SkBitmap& bitmap, base::OnceCallback<void(std::vector<double>)> callback) override;
diff --git a/components/safe_browsing/content/renderer/phishing_classifier/scorer.h b/components/safe_browsing/content/renderer/phishing_classifier/scorer.h index ac228a7..cd59ea2 100644 --- a/components/safe_browsing/content/renderer/phishing_classifier/scorer.h +++ b/components/safe_browsing/content/renderer/phishing_classifier/scorer.h
@@ -77,7 +77,9 @@ base::OnceCallback<void(std::unique_ptr<ClientPhishingRequest>)> callback) const = 0; -#if BUILDFLAG(BUILD_WITH_TFLITE_LIB) +// TODO(crbug/1278502): This is disabled as a temporary measure due to crashes. +#if BUILDFLAG(BUILD_WITH_TFLITE_LIB) && !defined(OS_CHROMEOS) && \ + !BUILDFLAG(IS_CHROMEOS_ASH) && !BUILDFLAG(IS_CHROMEOS_LACROS) // This method applies the TfLite visual model to the given bitmap. It // asynchronously returns the list of scores for each category, in the same // order as `tflite_thresholds()`.
diff --git a/components/safe_browsing/core/browser/BUILD.gn b/components/safe_browsing/core/browser/BUILD.gn index 31de9f4..9ee8f36f6 100644 --- a/components/safe_browsing/core/browser/BUILD.gn +++ b/components/safe_browsing/core/browser/BUILD.gn
@@ -151,7 +151,6 @@ ] deps = [ "//base", - "//components/crash/core/common:crash_key", "//components/keyed_service/core", "//components/prefs", "//components/safe_browsing/core/common:safe_browsing_prefs",
diff --git a/components/safe_browsing/core/browser/DEPS b/components/safe_browsing/core/browser/DEPS index 5f70e72..810704b 100644 --- a/components/safe_browsing/core/browser/DEPS +++ b/components/safe_browsing/core/browser/DEPS
@@ -1,5 +1,4 @@ include_rules = [ - "+components/crash/core/common/crash_key.h", "+components/history/core/browser", "+components/sessions/core/session_id.h", "+components/version_info",
diff --git a/components/safe_browsing/core/browser/safe_browsing_metrics_collector.cc b/components/safe_browsing/core/browser/safe_browsing_metrics_collector.cc index a99e58d..73104b01 100644 --- a/components/safe_browsing/core/browser/safe_browsing_metrics_collector.cc +++ b/components/safe_browsing/core/browser/safe_browsing_metrics_collector.cc
@@ -4,13 +4,11 @@ #include "components/safe_browsing/core/browser/safe_browsing_metrics_collector.h" -#include "base/debug/dump_without_crashing.h" #include "base/json/values_util.h" #include "base/logging.h" #include "base/metrics/histogram_functions.h" #include "base/strings/string_number_conversions.h" #include "base/time/time.h" -#include "components/crash/core/common/crash_key.h" #include "components/prefs/pref_service.h" #include "components/prefs/scoped_user_pref_update.h" #include "components/safe_browsing/core/common/safe_browsing_prefs.h" @@ -248,8 +246,6 @@ } void SafeBrowsingMetricsCollector::OnEnhancedProtectionPrefChanged() { - LogTemporaryDebugInfo(); - // Pref changed by policy is not initiated by users, so this case is ignored. if (IsSafeBrowsingPolicyManaged(*pref_service_)) { return; @@ -295,27 +291,6 @@ } absl::optional<SafeBrowsingMetricsCollector::Event> -SafeBrowsingMetricsCollector::GetEarliestEventFromEventType( - UserState user_state, - EventType event_type) { - const base::Value* event_dict = GetSafeBrowsingEventDictionary(user_state); - - if (!event_dict) { - return absl::nullopt; - } - - const base::Value* timestamps = - event_dict->FindListKey(EventTypeToPrefKey(event_type)); - - if (timestamps && timestamps->GetList().size() > 0) { - base::Time time = PrefValueToTime(timestamps->GetList().front()); - return Event(event_type, time); - } - - return absl::nullopt; -} - -absl::optional<SafeBrowsingMetricsCollector::Event> SafeBrowsingMetricsCollector::GetLatestEventFromEventTypeFilter( UserState user_state, EventTypeFilter event_type_filter) { @@ -572,94 +547,6 @@ : "LongEnabled"; } -void SafeBrowsingMetricsCollector::LogTemporaryDebugInfo() { - auto bool_to_string = [](bool value) { return value ? "T" : "F"; }; - - auto get_timestamp = [](absl::optional<Event> event) { - return event - ? base::NumberToString(event.value() - .timestamp.ToDeltaSinceWindowsEpoch() - .InSeconds()) - : "N/A"; - }; - - std::string latest_enabled_timestamp = - get_timestamp(GetLatestEventFromEventType(UserState::kEnhancedProtection, - EventType::USER_STATE_ENABLED)); - std::string latest_disabled_timestamp = - get_timestamp(GetLatestEventFromEventType( - UserState::kEnhancedProtection, EventType::USER_STATE_DISABLED)); - std::string earliest_enabled_timestamp = - get_timestamp(GetEarliestEventFromEventType( - UserState::kEnhancedProtection, EventType::USER_STATE_ENABLED)); - std::string earliest_disabled_timestamp = - get_timestamp(GetEarliestEventFromEventType( - UserState::kEnhancedProtection, EventType::USER_STATE_DISABLED)); - - std::string disabled_times_ever = base::NumberToString(GetEventCountSince( - UserState::kEnhancedProtection, EventType::USER_STATE_DISABLED, - base::Time::Now() - base::Days(3650))); - std::string enabled_times_ever = base::NumberToString(GetEventCountSince( - UserState::kEnhancedProtection, EventType::USER_STATE_ENABLED, - base::Time::Now() - base::Days(3650))); - std::string disabled_times_last_28_days = - base::NumberToString(GetEventCountSince( - UserState::kEnhancedProtection, EventType::USER_STATE_DISABLED, - base::Time::Now() - base::Days(28))); - std::string enabled_times_last_28_days = - base::NumberToString(GetEventCountSince( - UserState::kEnhancedProtection, EventType::USER_STATE_ENABLED, - base::Time::Now() - base::Days(28))); - - static crash_reporter::CrashKeyString<4> is_safe_browsing_policy_managed_cks( - "is_safe_browsing_policy_managed"); - static crash_reporter::CrashKeyString<4> is_safe_browsing_enhanced_cks( - "is_safe_browsing_enhanced"); - static crash_reporter::CrashKeyString<32> latest_enabled_timestamp_cks( - "latest_enabled_timestamp"); - static crash_reporter::CrashKeyString<32> latest_disabled_timestamp_cks( - "latest_disabled_timestamp"); - static crash_reporter::CrashKeyString<32> earliest_enabled_timestamp_cks( - "earliest_enabled_timestamp"); - static crash_reporter::CrashKeyString<32> earliest_disabled_timestamp_cks( - "earliest_disabled_timestamp"); - static crash_reporter::CrashKeyString<4> disabled_times_ever_cks( - "disabled_times_ever"); - static crash_reporter::CrashKeyString<4> enabled_times_ever_cks( - "enabled_times_ever"); - static crash_reporter::CrashKeyString<4> disabled_times_last_28_days_cks( - "disabled_times_last_28_days"); - static crash_reporter::CrashKeyString<4> enabled_times_last_28_days_cks( - "enabled_times_last_28_days"); - - // Wrap setting the values in a ScopedCrashKeyString so the values get cleared - // once the variables are out of scope. - crash_reporter::ScopedCrashKeyString scope_0( - &is_safe_browsing_policy_managed_cks, - bool_to_string(IsSafeBrowsingPolicyManaged(*pref_service_))); - crash_reporter::ScopedCrashKeyString scope_1( - &is_safe_browsing_enhanced_cks, - bool_to_string(pref_service_->GetBoolean(prefs::kSafeBrowsingEnhanced))); - crash_reporter::ScopedCrashKeyString scope_2(&latest_enabled_timestamp_cks, - latest_enabled_timestamp); - crash_reporter::ScopedCrashKeyString scope_3(&latest_disabled_timestamp_cks, - latest_disabled_timestamp); - crash_reporter::ScopedCrashKeyString scope_4(&earliest_enabled_timestamp_cks, - earliest_enabled_timestamp); - crash_reporter::ScopedCrashKeyString scope_5(&earliest_disabled_timestamp_cks, - earliest_disabled_timestamp); - crash_reporter::ScopedCrashKeyString scope_6(&disabled_times_ever_cks, - disabled_times_ever); - crash_reporter::ScopedCrashKeyString scope_7(&enabled_times_ever_cks, - enabled_times_ever); - crash_reporter::ScopedCrashKeyString scope_8(&disabled_times_last_28_days_cks, - disabled_times_last_28_days); - crash_reporter::ScopedCrashKeyString scope_9(&enabled_times_last_28_days_cks, - enabled_times_last_28_days); - - base::debug::DumpWithoutCrashing(); -} - SafeBrowsingMetricsCollector::Event::Event(EventType type, base::Time timestamp) : type(type), timestamp(timestamp) {}
diff --git a/components/safe_browsing/core/browser/safe_browsing_metrics_collector.h b/components/safe_browsing/core/browser/safe_browsing_metrics_collector.h index f327f593..c35e481b 100644 --- a/components/safe_browsing/core/browser/safe_browsing_metrics_collector.h +++ b/components/safe_browsing/core/browser/safe_browsing_metrics_collector.h
@@ -154,11 +154,6 @@ // MetricsCollectorTimesDisabledEnabledDuration in histograms.xml. std::string GetTimesDisabledSuffix(); - // Temporary functions used for debugging crbug/1270521#c8 - void LogTemporaryDebugInfo(); - absl::optional<SafeBrowsingMetricsCollector::Event> - GetEarliestEventFromEventType(UserState user_state, EventType event_type); - // Gets the latest event timestamp for events filtered by |event_type_filter|. // Returns nullopt if none of the events happened in the past. absl::optional<base::Time> GetLatestEventTimestamp(
diff --git a/components/user_manager/known_user.h b/components/user_manager/known_user.h index 21fa6cf..245a4a3 100644 --- a/components/user_manager/known_user.h +++ b/components/user_manager/known_user.h
@@ -187,7 +187,7 @@ // Setter and getter for the information about challenge-response keys that // can be used by this user to authenticate. The getter returns a null value // when the property isn't present. For the format of the value, refer to - // chromeos/login/auth/challenge_response/known_user_pref_utils.h. + // ash/components/login/auth/challenge_response/known_user_pref_utils.h. void SetChallengeResponseKeys(const AccountId& account_id, base::Value value); base::Value GetChallengeResponseKeys(const AccountId& account_id); @@ -493,7 +493,7 @@ // be used by this user to authenticate. // The getter returns a null value when the property isn't present. // For the format of the value, refer to -// chromeos/login/auth/challenge_response/known_user_pref_utils.h. +// ash/components/login/auth/challenge_response/known_user_pref_utils.h. // TODO(https://crbug.com/1150434): Deprecated, use // KnownUser::SetChallengeResponseKeys instead. void USER_MANAGER_EXPORT SetChallengeResponseKeys(const AccountId& account_id,
diff --git a/content/browser/back_forward_cache_features_browsertest.cc b/content/browser/back_forward_cache_features_browsertest.cc index ec8d8d5..26e7783 100644 --- a/content/browser/back_forward_cache_features_browsertest.cc +++ b/content/browser/back_forward_cache_features_browsertest.cc
@@ -2659,7 +2659,7 @@ // was inside bfcache. // The test is flaky on multiple platforms: crbug.com/1033270 IN_PROC_BROWSER_TEST_F(GeolocationBackForwardCacheBrowserTest, - DISABLED_CancelGeolocationRequestInFlight) { + CancelGeolocationRequestInFlight) { ASSERT_TRUE(embedded_test_server()->Start()); GURL url_a(embedded_test_server()->GetURL("/title1.html")); GURL url_b(embedded_test_server()->GetURL("b.com", "/title1.html"));
diff --git a/content/browser/browser_child_process_host_impl.cc b/content/browser/browser_child_process_host_impl.cc index fc23b94..59ebb5f4 100644 --- a/content/browser/browser_child_process_host_impl.cc +++ b/content/browser/browser_child_process_host_impl.cc
@@ -106,6 +106,12 @@ observer.BrowserChildProcessKilled(data, info); } +void NotifyProcessLaunchFailed(const ChildProcessData& data, + const ChildProcessTerminationInfo& info) { + for (auto& observer : g_browser_child_process_observers.Get()) + observer.BrowserChildProcessLaunchFailed(data, info); +} + memory_instrumentation::mojom::ProcessType GetCoordinatorClientProcessType( ProcessType process_type) { switch (process_type) { @@ -501,8 +507,29 @@ PROCESS_TYPE_MAX); break; } - default: + case base::TERMINATION_STATUS_LAUNCH_FAILED: { + // This is handled in OnProcessLaunchFailed. + NOTREACHED(); break; + } + case base::TERMINATION_STATUS_NORMAL_TERMINATION: { + // TODO(wfh): This should not be hit but is sometimes. Investigate. + break; + } + case base::TERMINATION_STATUS_OOM: { + // TODO(wfh): Decide to what to do with OOMs here. + break; + } +#if defined(OS_WIN) + case base::TERMINATION_STATUS_INTEGRITY_FAILURE: { + // TODO(wfh): Decide to what to do with CIG failures here. + break; + } +#endif // OS_WIN + case base::TERMINATION_STATUS_MAX_ENUM: { + NOTREACHED(); + break; + } } #endif // OS_ANDROID UMA_HISTOGRAM_ENUMERATION("ChildProcess.Disconnected2", @@ -566,9 +593,6 @@ memory_size = 64 << 10; // 64 KiB metrics_name = "PpapiBrokerMetrics"; break; - - default: - return; } // Create the shared memory segment and attach an allocator to it. @@ -597,7 +621,15 @@ } void BrowserChildProcessHostImpl::OnProcessLaunchFailed(int error_code) { + DCHECK_CURRENTLY_ON(BrowserThread::UI); delegate_->OnProcessLaunchFailed(error_code); + ChildProcessTerminationInfo info = + child_process_->GetChildTerminationInfo(/*known_dead=*/true); + DCHECK_EQ(info.status, base::TERMINATION_STATUS_LAUNCH_FAILED); + + GetUIThreadTaskRunner({})->PostTask( + FROM_HERE, + base::BindOnce(&NotifyProcessLaunchFailed, data_.Duplicate(), info)); notify_child_connection_status_ = false; delete delegate_; // Will delete us }
diff --git a/content/browser/child_process_launcher.cc b/content/browser/child_process_launcher.cc index 54b53b1..9468bea 100644 --- a/content/browser/child_process_launcher.cc +++ b/content/browser/child_process_launcher.cc
@@ -111,9 +111,11 @@ helper_, std::move(to_pass), priority)); } -void ChildProcessLauncher::Notify( - ChildProcessLauncherHelper::Process process, - int error_code) { +void ChildProcessLauncher::Notify(ChildProcessLauncherHelper::Process process, +#if defined(OS_WIN) + DWORD last_error, +#endif + int error_code) { DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); starting_ = false; process_ = std::move(process); @@ -123,6 +125,10 @@ client_->OnProcessLaunched(); } else { termination_info_.status = base::TERMINATION_STATUS_LAUNCH_FAILED; + termination_info_.exit_code = error_code; +#if defined(OS_WIN) + termination_info_.last_error = last_error; +#endif // NOTE: May delete |this|. client_->OnProcessLaunchFailed(error_code);
diff --git a/content/browser/child_process_launcher.h b/content/browser/child_process_launcher.h index ead37c7..ac5b59e 100644 --- a/content/browser/child_process_launcher.h +++ b/content/browser/child_process_launcher.h
@@ -29,6 +29,10 @@ #include "content/public/browser/android/child_process_importance.h" #endif +#if defined(OS_WIN) +#include "base/win/windows_types.h" +#endif + namespace base { class CommandLine; } @@ -241,6 +245,9 @@ // Notifies the client about the result of the operation. void Notify(internal::ChildProcessLauncherHelper::Process process, +#if defined(OS_WIN) + DWORD last_error, +#endif int error_code); raw_ptr<Client> client_;
diff --git a/content/browser/child_process_launcher_helper.cc b/content/browser/child_process_launcher_helper.cc index 58f7c2e..31f3f1fd 100644 --- a/content/browser/child_process_launcher_helper.cc +++ b/content/browser/child_process_launcher_helper.cc
@@ -144,7 +144,6 @@ can_use_warm_up_connection_, #endif &is_synchronous_launch, &launch_result); - AfterLaunchOnLauncherThread(process, options); } @@ -156,6 +155,11 @@ void ChildProcessLauncherHelper::PostLaunchOnLauncherThread( ChildProcessLauncherHelper::Process process, int launch_result) { +#if defined(OS_WIN) + // The LastError is set on the launcher thread, but needs to be transferred to + // the Client thread. + DWORD last_error = ::GetLastError(); +#endif if (mojo_channel_) mojo_channel_->RemoteProcessLaunchAttempted(); @@ -189,14 +193,25 @@ client_task_runner_->PostTask( FROM_HERE, base::BindOnce(&ChildProcessLauncherHelper::PostLaunchOnClientThread, - this, std::move(process), launch_result)); + this, std::move(process), +#if defined(OS_WIN) + last_error, +#endif + launch_result)); } void ChildProcessLauncherHelper::PostLaunchOnClientThread( ChildProcessLauncherHelper::Process process, +#if defined(OS_WIN) + DWORD last_error, +#endif int error_code) { if (child_process_launcher_) { - child_process_launcher_->Notify(std::move(process), error_code); + child_process_launcher_->Notify(std::move(process), +#if defined(OS_WIN) + last_error, +#endif + error_code); } else if (process.process.IsValid() && terminate_on_shutdown_) { // Client is gone, terminate the process. ForceNormalProcessTerminationAsync(std::move(process));
diff --git a/content/browser/child_process_launcher_helper.h b/content/browser/child_process_launcher_helper.h index cac56185..4ef383e 100644 --- a/content/browser/child_process_launcher_helper.h +++ b/content/browser/child_process_launcher_helper.h
@@ -29,6 +29,7 @@ #endif #if defined(OS_WIN) +#include "base/win/windows_types.h" #include "sandbox/win/src/sandbox_types.h" #else #include "content/public/browser/posix_file_descriptor_info.h" @@ -159,6 +160,9 @@ // Posted by PostLaunchOnLauncherThread onto the client thread. void PostLaunchOnClientThread(ChildProcessLauncherHelper::Process process, +#if defined(OS_WIN) + DWORD last_error, +#endif int error_code); // See ChildProcessLauncher::GetChildTerminationInfo for more info.
diff --git a/content/browser/child_process_launcher_helper_win.cc b/content/browser/child_process_launcher_helper_win.cc index 0406842..e4ec0ff 100644 --- a/content/browser/child_process_launcher_helper_win.cc +++ b/content/browser/child_process_launcher_helper_win.cc
@@ -4,6 +4,7 @@ #include "base/files/file_path.h" #include "base/path_service.h" +#include "base/process/process.h" #include "base/strings/string_number_conversions.h" #include "base/win/scoped_handle.h" #include "base/win/win_util.h" @@ -69,6 +70,8 @@ win_options.start_hidden = true; ChildProcessLauncherHelper::Process process; process.process = base::LaunchElevatedProcess(*command_line(), win_options); + *launch_result = process.process.IsValid() ? LAUNCH_RESULT_SUCCESS + : LAUNCH_RESULT_FAILURE; return process; } ChildProcessLauncherHelper::Process process;
diff --git a/content/browser/network_service_instance_impl.cc b/content/browser/network_service_instance_impl.cc index 76459eae..4017bdf 100644 --- a/content/browser/network_service_instance_impl.cc +++ b/content/browser/network_service_instance_impl.cc
@@ -573,6 +573,9 @@ net::NetworkChangeNotifier::GetConnectionSubtype()); network_service_params->default_observer = g_client->BindURLLoaderNetworkServiceObserver(); + network_service_params->first_party_sets_enabled = + GetContentClient()->browser()->IsFirstPartySetsEnabled(); + #if defined(OS_POSIX) // Send Kerberos environment variables to the network service. if (IsOutOfProcessNetworkService()) {
diff --git a/content/browser/resources/attribution_reporting/attribution_internals.css b/content/browser/resources/attribution_reporting/attribution_internals.css index 318fd95..40afbe9 100644 --- a/content/browser/resources/attribution_reporting/attribution_internals.css +++ b/content/browser/resources/attribution_reporting/attribution_internals.css
@@ -45,7 +45,6 @@ border: 1px solid #cecece; border-radius: 3px; line-height: 1.5; - overflow-x: scroll; padding: 19px; } @@ -55,8 +54,7 @@ border-radius: 4px; border-style: solid; border-width: 1px; - display: inline-block; - + overflow-x: scroll; } table {
diff --git a/content/browser/resources/attribution_reporting/attribution_internals.html b/content/browser/resources/attribution_reporting/attribution_internals.html index 253668d..0287749 100644 --- a/content/browser/resources/attribution_reporting/attribution_internals.html +++ b/content/browser/resources/attribution_reporting/attribution_internals.html
@@ -33,12 +33,12 @@ <h2> Sent and Pending Reports </h2> <div class="content"> <div> + <button id="send-reports">Send All Pending Reports</button> + </div> + <div> <span id="debug-mode-content"></span> </div> <div class="table-wrapper" id="report-table-wrapper"></div> - <div> - <button id="send-reports">Send All Pending Reports</button> - </div> </div> </div> </body>
diff --git a/content/browser/site_instance_impl.cc b/content/browser/site_instance_impl.cc index 28f0c58..d65dd30d 100644 --- a/content/browser/site_instance_impl.cc +++ b/content/browser/site_instance_impl.cc
@@ -613,6 +613,12 @@ scoped_refptr<SiteInstanceImpl> SiteInstanceImpl::GetRelatedSiteInstanceImpl( const UrlInfo& url_info) { + if (IsGuest()) { + // Until guests support site isolation (https://crbug.com/1267977), there + // should only be one guest SiteInstance per BrowsingInstance. + return this; + } + return browsing_instance_->GetSiteInstanceForURL( url_info, /* allow_default_instance */ true); }
diff --git a/content/browser/utility_process_host_browsertest.cc b/content/browser/utility_process_host_browsertest.cc index 085e49a..6ecfcd3 100644 --- a/content/browser/utility_process_host_browsertest.cc +++ b/content/browser/utility_process_host_browsertest.cc
@@ -3,16 +3,21 @@ // found in the LICENSE file. #include "base/bind.h" +#include "base/command_line.h" +#include "base/files/file_path.h" #include "base/run_loop.h" #include "base/strings/utf_string_conversions.h" #include "build/build_config.h" +#include "content/browser/child_process_launcher.h" #include "content/browser/utility_process_host.h" #include "content/public/browser/browser_child_process_observer.h" #include "content/public/browser/browser_task_traits.h" #include "content/public/browser/browser_thread.h" #include "content/public/browser/child_process_data.h" #include "content/public/browser/child_process_termination_info.h" +#include "content/public/common/content_client.h" #include "content/public/common/content_features.h" +#include "content/public/common/content_switches.h" #include "content/public/test/browser_test.h" #include "content/public/test/content_browser_test.h" #include "content/public/test/content_browser_test_utils.h" @@ -26,6 +31,7 @@ #if defined(OS_WIN) #include <windows.h> #include "sandbox/policy/mojom/sandbox.mojom.h" +#include "sandbox/win/src/sandbox_types.h" #endif // OS_WIN namespace content { @@ -39,18 +45,31 @@ class UtilityProcessHostBrowserTest : public BrowserChildProcessObserver, public ContentBrowserTest { public: - void RunUtilityProcess(bool elevated, bool crash) { + void RunUtilityProcess(bool elevated, bool crash, bool fail_launch) { DCHECK_CURRENTLY_ON(BrowserThread::UI); BrowserChildProcessObserver::Add(this); has_crashed = false; + has_failed_launch = false; base::RunLoop run_loop; - done_closure_ = - base::BindOnce(&UtilityProcessHostBrowserTest::DoneRunning, - base::Unretained(this), run_loop.QuitClosure(), crash); + done_closure_ = base::BindOnce(&UtilityProcessHostBrowserTest::DoneRunning, + base::Unretained(this), + run_loop.QuitClosure(), crash, fail_launch); UtilityProcessHost* host = new UtilityProcessHost(); host->SetName(u"TestProcess"); host->SetMetricsName(kTestProcessName); + if (fail_launch) { +#if defined(OS_WIN) + // The Windows sandbox does not like the child process being a different + // process, so launch unsandboxed for the purpose of this test. + host->SetSandboxType(sandbox::mojom::Sandbox::kNoSandbox); +#endif + // Simulate a catastrophic launch failure for all child processes by + // making the path to the process non-existent. + base::CommandLine::ForCurrentProcess()->AppendSwitchPath( + switches::kBrowserSubprocessPath, + base::FilePath(FILE_PATH_LITERAL("non_existent_path"))); + } #if defined(OS_WIN) if (elevated) host->SetSandboxType( @@ -74,10 +93,15 @@ } protected: - void DoneRunning(base::OnceClosure quit_closure, bool expect_crashed) { + void DoneRunning(base::OnceClosure quit_closure, + bool expect_crashed, + bool expect_failed_launch) { DCHECK_CURRENTLY_ON(BrowserThread::UI); BrowserChildProcessObserver::Remove(this); + base::CommandLine::ForCurrentProcess()->RemoveSwitch( + switches::kBrowserSubprocessPath); EXPECT_EQ(expect_crashed, has_crashed); + EXPECT_EQ(expect_failed_launch, has_failed_launch); std::move(quit_closure).Run(); } @@ -99,6 +123,7 @@ // Access on UI thread. bool has_crashed; + bool has_failed_launch; private: // content::BrowserChildProcessObserver implementation: @@ -131,26 +156,59 @@ ResetService(); std::move(done_closure_).Run(); } + + void BrowserChildProcessLaunchFailed( + const ChildProcessData& data, + const ChildProcessTerminationInfo& info) override { + DCHECK_CURRENTLY_ON(BrowserThread::UI); + EXPECT_EQ(info.status, base::TERMINATION_STATUS_LAUNCH_FAILED); +#if defined(OS_WIN) + // On Windows, the sandbox code handles all non-elevated process launches. + EXPECT_EQ(sandbox::SBOX_ERROR_CANNOT_LAUNCH_UNSANDBOXED_PROCESS, + info.exit_code); + // File not found because subprocess called 'non_existent_path.exe' does not + // exist. + EXPECT_EQ(DWORD{ERROR_FILE_NOT_FOUND}, info.last_error); +#else + EXPECT_EQ(LAUNCH_RESULT_FAILURE, info.exit_code); +#endif + EXPECT_EQ(kTestProcessName, data.metrics_name); + has_failed_launch = true; + ResetService(); + std::move(done_closure_).Run(); + } }; IN_PROC_BROWSER_TEST_F(UtilityProcessHostBrowserTest, LaunchProcess) { - RunUtilityProcess(false, false); + RunUtilityProcess(/*elevated=*/false, /*crash=*/false, /*fail_launch=*/false); } IN_PROC_BROWSER_TEST_F(UtilityProcessHostBrowserTest, LaunchProcessAndCrash) { - RunUtilityProcess(false, true); + RunUtilityProcess(/*elevated=*/false, /*crash=*/true, /*fail_launch=*/false); } +// This test won't work as-is on POSIX platforms, where fork()+exec() is used to +// launch child processes, failure does not happen until exec(), therefore the +// test will see a valid child process followed by a +// TERMINATION_STATUS_ABNORMAL_TERMINATION of the forked process. However, +// posix_spawn() is used on macOS. +// See also ServiceProcessLauncherTest.FailToLaunchProcess. +#if !defined(OS_POSIX) || defined(OS_MAC) +IN_PROC_BROWSER_TEST_F(UtilityProcessHostBrowserTest, FailToLaunchProcess) { + RunUtilityProcess(/*elevated=*/false, /*crash=*/false, /*fail_launch=*/true); +} +#endif // !defined(OS_POSIX) || defined(OS_MAC) + #if defined(OS_WIN) IN_PROC_BROWSER_TEST_F(UtilityProcessHostBrowserTest, LaunchElevatedProcess) { - RunUtilityProcess(true, false); + RunUtilityProcess(/*elevated=*/true, /*crash=*/false, /*fail_launch=*/false); } // Disabled because currently this causes a WER dialog to appear. IN_PROC_BROWSER_TEST_F(UtilityProcessHostBrowserTest, DISABLED_LaunchElevatedProcessAndCrash) { - RunUtilityProcess(true, true); + RunUtilityProcess(/*elevated=*/true, /*crash=*/true, /*fail_launch=*/false); } -#endif +#endif // defined(OS_WIN) } // namespace content
diff --git a/content/browser/webid/idp_network_request_manager.cc b/content/browser/webid/idp_network_request_manager.cc index 2efbc03..7aa5badd 100644 --- a/content/browser/webid/idp_network_request_manager.cc +++ b/content/browser/webid/idp_network_request_manager.cc
@@ -54,7 +54,7 @@ constexpr char kIdTokenKey[] = "id_token"; // Token request body keys -constexpr char kAccountKey[] = "account_id"; +constexpr char kAccountKey[] = "sub"; constexpr char kRequestKey[] = "request"; // Revoke request body keys. @@ -127,7 +127,9 @@ absl::optional<content::IdentityRequestAccount> ParseAccount( const base::Value& account) { - auto* account_id = account.FindStringKey("account_id"); + // TODO(yigu): Per spec the account id field should be "account_id" instead of + // "sub". Using "sub" temporarily to unblock partner deployment. + auto* account_id = account.FindStringKey("sub"); auto* email = account.FindStringKey("email"); auto* name = account.FindStringKey("name"); auto* given_name = account.FindStringKey("given_name");
diff --git a/content/browser/webid/idp_network_request_manager_unittest.cc b/content/browser/webid/idp_network_request_manager_unittest.cc index ad140ec..ca20f1c6 100644 --- a/content/browser/webid/idp_network_request_manager_unittest.cc +++ b/content/browser/webid/idp_network_request_manager_unittest.cc
@@ -120,7 +120,7 @@ const auto* test_single_account_json = R"({ "accounts" : [ { - "account_id" : "1234", + "sub" : "1234", "email": "ken@idp.test", "name": "Ken R. Example", "given_name": "Ken", @@ -144,14 +144,14 @@ const auto* test_accounts_json = R"({ "accounts" : [ { - "account_id" : "1234", + "sub" : "1234", "email": "ken@idp.test", "name": "Ken R. Example", "given_name": "Ken", "picture": "https://idp.test/profile/1" }, { - "account_id" : "5678", + "sub" : "5678", "email": "sam@idp.test", "name": "Sam G. Test", "given_name": "Sam", @@ -176,7 +176,7 @@ const auto* test_accounts_json = R"({ "accounts" : [ { - "account_id" : "1234", + "sub" : "1234", "email": "ken@idp.test", "name": "Ken R. Example" } @@ -211,7 +211,7 @@ } { const auto* test_accounts_missing_email_json = R"({"accounts" : [{ - "account_id" : "1234", + "sub" : "1234", "name": "Ken R. Example" }]})"; AccountsResponse accounts_response; @@ -225,7 +225,7 @@ } { const auto* test_accounts_missing_name_json = R"({"accounts" : [{ - "account_id" : "1234", + "sub" : "1234", "email": "ken@idp.test" }]})"; AccountsResponse accounts_response; @@ -243,13 +243,13 @@ const auto* test_accounts_json = R"({ "accounts" : [ { - "account_id" : "1234", + "sub" : "1234", "email": "ken@idp.test", "name": "Ken R. Example", "picture": "https://idp.test/profile/1234" }, { - "account_id" : "567", + "sub" : "567", "email": "sam@idp.test", "name": "Sam R. Example", "picture": "invalid_url" @@ -275,7 +275,7 @@ const auto* json = R"({ "accounts" : [ { - "account_id" : "1234", + "sub" : "1234", "email": "ken@idp.test", "%s": "%s" } @@ -330,7 +330,7 @@ const char test_accounts_json[] = R"({ "accounts" : [ { - "account_id" : "1234", + "sub" : "1234", "email": "ken@idp.test", "name": "Ken R. Example" } @@ -358,7 +358,7 @@ const char test_accounts_json[] = R"({ "accounts" : [ { - "account_id" : "1234", + "sub" : "1234", "email": "ken@idp.test", "name": "Ken R. Example" } @@ -383,7 +383,7 @@ const char test_accounts_json[] = R"({ "accounts" : [ { - "account_id" : "1234", + "sub" : "1234", "email": "ken@idp.test", "name": "Ken R. Example" } @@ -408,7 +408,7 @@ const char test_accounts_json[] = R"({ "accounts" : [ { - "account_id" : "1234", + "sub" : "1234", "email": "ken@idp.test", "name": "Ken R. Example" } @@ -435,7 +435,7 @@ const char test_accounts_json[] = R"({ "accounts" : [ { - "account_id" : "1234", + "sub" : "1234", "email": "ken@idp.test", "name": "Ken R. Example" } @@ -469,9 +469,8 @@ ASSERT_EQ(network::DataElement::Tag::kBytes, elem.type()); const network::DataElementBytes& byte_elem = elem.As<network::DataElementBytes>(); - EXPECT_EQ( - "{\"account_id\":\"yyy\",\"request\":{\"client_id\":\"xxx\"}}", - byte_elem.AsStringPiece()); + EXPECT_EQ("{\"request\":{\"client_id\":\"xxx\"},\"sub\":\"yyy\"}", + byte_elem.AsStringPiece()); }); test_url_loader_factory().SetInterceptor(interceptor); RevokeResponse status = SendRevokeRequestAndWaitForResponse("xxx", "yyy");
diff --git a/content/public/android/java/src/org/chromium/content/browser/accessibility/AccessibilityNodeInfoUtils.java b/content/public/android/java/src/org/chromium/content/browser/accessibility/AccessibilityNodeInfoUtils.java index 93a54dc1..f387091 100644 --- a/content/public/android/java/src/org/chromium/content/browser/accessibility/AccessibilityNodeInfoUtils.java +++ b/content/public/android/java/src/org/chromium/content/browser/accessibility/AccessibilityNodeInfoUtils.java
@@ -4,6 +4,7 @@ package org.chromium.content.browser.accessibility; +import static org.chromium.content.browser.accessibility.WebContentsAccessibilityImpl.EXTRAS_KEY_OFFSCREEN; import static org.chromium.content.browser.accessibility.WebContentsAccessibilityImpl.EXTRAS_KEY_SUPPORTED_ELEMENTS; import static org.chromium.content.browser.accessibility.WebContentsAccessibilityImpl.EXTRAS_KEY_UNCLIPPED_BOTTOM; import static org.chromium.content.browser.accessibility.WebContentsAccessibilityImpl.EXTRAS_KEY_UNCLIPPED_TOP; @@ -42,14 +43,18 @@ builder.append(classNameParts[classNameParts.length - 1]); // Print text unless it is empty (null is allowed). - if (node.getText() == null || !node.getText().toString().isEmpty()) { - builder.append(" text:\"").append(node.getText()).append("\""); + if (node.getText() == null) { + builder.append(" text:\"null\""); + } else if (!node.getText().toString().isEmpty()) { + builder.append(" text:\"") + .append(node.getText().toString().replace("\n", "\\n")) + .append("\""); } // Text properties - Only print when non-null. if (node.getContentDescription() != null) { builder.append(" contentDescription:\"") - .append(node.getContentDescription()) + .append(node.getContentDescription().toString().replace("\n", "\\n")) .append("\""); } if (node.getViewIdResourceName() != null) { @@ -292,6 +297,12 @@ continue; } + // To prevent flakiness or dependency on screensize/form factor, drop the "offscreen" + // Bundle extra. + if (key.equals(EXTRAS_KEY_OFFSCREEN)) { + continue; + } + // Simplify the key String before printing to make test outputs easier to read. bundleStrings.add(key.replace("AccessibilityNodeInfo.", "") + "=\"" + extras.get(key).toString() + "\"");
diff --git a/content/public/android/javatests/src/org/chromium/content/browser/accessibility/WebContentsAccessibilityTreeTest.java b/content/public/android/javatests/src/org/chromium/content/browser/accessibility/WebContentsAccessibilityTreeTest.java index 0d02553..3d36dae 100644 --- a/content/public/android/javatests/src/org/chromium/content/browser/accessibility/WebContentsAccessibilityTreeTest.java +++ b/content/public/android/javatests/src/org/chromium/content/browser/accessibility/WebContentsAccessibilityTreeTest.java
@@ -159,8 +159,8 @@ @Test @SmallTest - public void test_a() { - performHtmlTest("a.html"); + public void test_aNameCalc() { + performHtmlTest("a-name-calc.html"); } @Test @@ -171,12 +171,6 @@ @Test @SmallTest - public void test_aNameCalc() { - performHtmlTest("a-name-calc.html"); - } - - @Test - @SmallTest public void test_aNestedStructure() { performHtmlTest("a-nested-structure.html"); } @@ -189,31 +183,1165 @@ @Test @SmallTest - public void test_aOnclick() { - performHtmlTest("a-onclick.html"); - } - - @Test - @SmallTest - public void test_aWithBefore() { - performHtmlTest("a-with-before.html"); - } - - @Test - @SmallTest public void test_aWithImg() { performHtmlTest("a-with-img.html"); } @Test @SmallTest + public void test_a() { + performHtmlTest("a.html"); + } + + @Test + @SmallTest + public void test_abbr() { + performHtmlTest("abbr.html"); + } + + @Test + @SmallTest + public void test_accordion() { + performHtmlTest("accordion.html"); + } + + @Test + @SmallTest + public void test_actionVerbs() { + performHtmlTest("action-verbs.html"); + } + + @Test + @SmallTest + public void test_actions() { + performHtmlTest("actions.html"); + } + + @Test + @SmallTest + public void test_address() { + performHtmlTest("address.html"); + } + + @Test + @SmallTest + public void test_area() { + performHtmlTest("area.html"); + } + + @Test + @SmallTest + public void test_article() { + performHtmlTest("article.html"); + } + + @Test + @SmallTest + public void test_aside() { + performHtmlTest("aside.html"); + } + + @Test + @SmallTest + public void test_b() { + performHtmlTest("b.html"); + } + + @Test + @SmallTest + public void test_bdo() { + performHtmlTest("bdo.html"); + } + + @Test + @SmallTest + public void test_blockquoteLevels() { + performHtmlTest("blockquote-levels.html"); + } + + @Test + @SmallTest + public void test_blockquote() { + performHtmlTest("blockquote.html"); + } + + @Test + @SmallTest + public void test_body() { + performHtmlTest("body.html"); + } + + @Test + @SmallTest + public void test_br() { + performHtmlTest("br.html"); + } + + @Test + @SmallTest + public void test_buttonNameCalc() { + performHtmlTest("button-name-calc.html"); + } + + @Test + @SmallTest + public void test_buttonWithListboxPopup() { + performHtmlTest("button-with-listbox-popup.html"); + } + + @Test + @SmallTest + public void test_button() { + performHtmlTest("button.html"); + } + + @Test + @SmallTest + public void test_canvasFallback() { + performHtmlTest("canvas-fallback.html"); + } + + @Test + @SmallTest + public void test_canvas() { + performHtmlTest("canvas.html"); + } + + @Test + @SmallTest + public void test_caption() { + performHtmlTest("caption.html"); + } + + @Test + @SmallTest + public void test_characterLocations() { + performHtmlTest("character-locations.html"); + } + + @Test + @SmallTest + public void test_checkboxNameCalc() { + performHtmlTest("checkbox-name-calc.html"); + } + + @Test + @SmallTest + public void test_cite() { + performHtmlTest("cite.html"); + } + + @Test + @SmallTest + public void test_clickableAncestor() { + performHtmlTest("clickable-ancestor.html"); + } + + @Test + @SmallTest + public void test_clickableScore() { + performHtmlTest("clickable-score.html"); + } + + @Test + @SmallTest + public void test_code() { + performHtmlTest("code.html"); + } + + @Test + @SmallTest + public void test_col() { + performHtmlTest("col.html"); + } + + @Test + @SmallTest + public void test_colgroup() { + performHtmlTest("colgroup.html"); + } + + @Test + @SmallTest + public void test_comboboxOptgroup() { + performHtmlTest("combobox-optgroup.html"); + } + + @Test + @SmallTest + public void test_contenteditableDescendants() { + performHtmlTest("contenteditable-descendants.html"); + } + + @Test + @SmallTest + public void test_contenteditableWithEmbeddedContenteditables() { + performHtmlTest("contenteditable-with-embedded-contenteditables.html"); + } + + @Test + @SmallTest + public void test_contenteditableWithNoDescendants() { + performHtmlTest("contenteditable-with-no-descendants.html"); + } + + @Test + @SmallTest + public void test_continuations() { + performHtmlTest("continuations.html"); + } + + @Test + @SmallTest + public void test_dd() { + performHtmlTest("dd.html"); + } + + @Test + @SmallTest + public void test_del() { + performHtmlTest("del.html"); + } + + @Test + @SmallTest + public void test_details() { + performHtmlTest("details.html"); + } + + @Test + @SmallTest + public void test_dfn() { + performHtmlTest("dfn.html"); + } + + @Test + @SmallTest + public void test_dialog() { + performHtmlTest("dialog.html"); + } + + @Test + @SmallTest + public void test_disabled() { + performHtmlTest("disabled.html"); + } + + @Test + @SmallTest + public void test_div() { + performHtmlTest("div.html"); + } + + @Test + @SmallTest + public void test_dl() { + performHtmlTest("dl.html"); + } + + @Test + @SmallTest + public void test_dt() { + performHtmlTest("dt.html"); + } + + @Test + @SmallTest + public void test_elementClassIdSrcAttr() { + performHtmlTest("element-class-id-src-attr.html"); + } + + @Test + @SmallTest + public void test_em() { + performHtmlTest("em.html"); + } + + @Test + @SmallTest + public void test_embed() { + performHtmlTest("embed.html"); + } + + @Test + @SmallTest + public void test_fieldset() { + performHtmlTest("fieldset.html"); + } + + @Test + @SmallTest + public void test_figcaption() { + performHtmlTest("figcaption.html"); + } + + @Test + @SmallTest + public void test_figure() { + performHtmlTest("figure.html"); + } + + @Test + @SmallTest + public void test_fixedWidthText() { + performHtmlTest("fixed-width-text.html"); + } + + @Test + @SmallTest + public void test_footerInsideOtherSection() { + performHtmlTest("footer-inside-other-section.html"); + } + + @Test + @SmallTest + public void test_footer() { + performHtmlTest("footer.html"); + } + + @Test + @SmallTest + public void test_form() { + performHtmlTest("form.html"); + } + + @Test + @SmallTest + public void test_frameset() { + performHtmlTest("frameset.html"); + } + + @Test + @SmallTest + public void test_headerInsideOtherSection() { + performHtmlTest("header-inside-other-section.html"); + } + + @Test + @SmallTest + public void test_header() { + performHtmlTest("header.html"); + } + + @Test + @SmallTest + public void test_headingWithTabindex() { + performHtmlTest("heading-with-tabIndex.html"); + } + + @Test + @SmallTest + public void test_heading() { + performHtmlTest("heading.html"); + } + + @Test + @SmallTest + public void test_hr() { + performHtmlTest("hr.html"); + } + + @Test + @SmallTest + public void test_html() { + performHtmlTest("html.html"); + } + + @Test + @SmallTest + public void test_i() { + performHtmlTest("i.html"); + } + + @Test + @SmallTest + public void test_id() { + performHtmlTest("id.html"); + } + + @Test + @SmallTest + public void test_iframeAriaHidden() { + performHtmlTest("iframe-aria-hidden.html"); + } + + @Test + @SmallTest + public void test_iframeCoordinatesCrossProcess() { + performHtmlTest("iframe-coordinates-cross-process.html"); + } + + @Test + @SmallTest + public void test_iframeCrossProcess() { + performHtmlTest("iframe-cross-process.html"); + } + + @Test + @SmallTest + public void test_iframeEmptyPositioned() { + performHtmlTest("iframe-empty-positioned.html"); + } + + @Test + @SmallTest + public void test_iframeFocus() { + performHtmlTest("iframe-focus.html"); + } + + @Test + @SmallTest + public void test_iframePresentational() { + performHtmlTest("iframe-presentational.html"); + } + + @Test + @SmallTest + public void test_iframeTransform() { + performHtmlTest("iframe-transform.html"); + } + + @Test + @SmallTest + public void test_iframeTraversal() { + performHtmlTest("iframe-traversal.html"); + } + + @Test + @SmallTest + public void test_iframe() { + performHtmlTest("iframe.html"); + } + + @Test + @SmallTest + public void test_imgEmptyAlt() { + performHtmlTest("img-empty-alt.html"); + } + + @Test + @SmallTest + public void test_imgLinkEmptyAlt() { + performHtmlTest("img-link-empty-alt.html"); + } + + @Test + @SmallTest + public void test_img() { + performHtmlTest("img.html"); + } + + @Test + @SmallTest + public void test_inPageLinks() { + performHtmlTest("in-page-links.html"); + } + + @Test + @SmallTest + public void test_inputButton() { + performHtmlTest("input-button.html"); + } + + @Test + @SmallTest + public void test_inputCheckboxLabel() { + performHtmlTest("input-checkbox-label.html"); + } + + @Test + @SmallTest + public void test_inputColorWithPopupOpen() { + performHtmlTest("input-color-with-popup-open.html"); + } + + @Test + @SmallTest + public void test_inputColor() { + performHtmlTest("input-color.html"); + } + + @Test + @SmallTest + public void test_inputDateWithPopupOpenMultipleForWin() { + performHtmlTest("input-date-with-popup-open-multiple-for-win.html"); + } + + @Test + @SmallTest + public void test_inputDateWithPopupOpenMultiple() { + performHtmlTest("input-date-with-popup-open-multiple.html"); + } + + @Test + @SmallTest + public void test_inputDateWithPopupOpen() { + performHtmlTest("input-date-with-popup-open.html"); + } + + @Test + @SmallTest + public void test_inputDate() { + performHtmlTest("input-date.html"); + } + + @Test + @SmallTest + public void test_inputDatetimeLocal() { + performHtmlTest("input-datetime-local.html"); + } + + @Test + @SmallTest + public void test_inputDatetime() { + performHtmlTest("input-datetime.html"); + } + + @Test + @SmallTest + public void test_inputEmail() { + performHtmlTest("input-email.html"); + } + + @Test + @SmallTest + public void test_inputFile() { + performHtmlTest("input-file.html"); + } + + @Test + @SmallTest + public void test_inputImage() { + performHtmlTest("input-image.html"); + } + + @Test + @SmallTest + public void test_inputList() { + performHtmlTest("input-list.html"); + } + + @Test + @SmallTest + public void test_inputMonth() { + performHtmlTest("input-month.html"); + } + + @Test + @SmallTest + public void test_inputNumber() { + performHtmlTest("input-number.html"); + } + + @Test + @SmallTest + public void test_inputRadioCheckboxLabel() { + performHtmlTest("input-radio-checkbox-label.html"); + } + + @Test + @SmallTest + public void test_inputRadioInMenu() { + performHtmlTest("input-radio-in-menu.html"); + } + + @Test + @SmallTest + public void test_inputRadio() { + performHtmlTest("input-radio.html"); + } + + @Test + @SmallTest + public void test_inputRange() { + performHtmlTest("input-range.html"); + } + + @Test + @SmallTest + public void test_inputReset() { + performHtmlTest("input-reset.html"); + } + + @Test + @SmallTest + public void test_inputSearch() { + performHtmlTest("input-search.html"); + } + + @Test + @SmallTest + public void test_inputSubmit() { + performHtmlTest("input-submit.html"); + } + + @Test + @SmallTest + public void test_inputSuggestionsSourceElement() { + performHtmlTest("input-suggestions-source-element.html"); + } + + @Test + @SmallTest + public void test_inputTel() { + performHtmlTest("input-tel.html"); + } + + @Test + @SmallTest + public void test_inputTextNameCalc() { + performHtmlTest("input-text-name-calc.html"); + } + + @Test + @SmallTest + public void test_inputTextReadOnly() { + performHtmlTest("input-text-read-only.html"); + } + + @Test + @SmallTest + public void test_inputTextValue() { + performHtmlTest("input-text-value.html"); + } + + @Test + @SmallTest + public void test_inputText() { + performHtmlTest("input-text.html"); + } + + @Test + @SmallTest + public void test_inputTimeWithPopupOpen() { + performHtmlTest("input-time-with-popup-open.html"); + } + + @Test + @SmallTest + public void test_inputTime() { + performHtmlTest("input-time.html"); + } + + @Test + @SmallTest + public void test_inputUrl() { + performHtmlTest("input-url.html"); + } + + @Test + @SmallTest + public void test_inputWeek() { + performHtmlTest("input-week.html"); + } + + @Test + @SmallTest + public void test_ins() { + performHtmlTest("ins.html"); + } + + @Test + @SmallTest + public void test_isInteresting() { + performHtmlTest("isInteresting.html"); + } + + @Test + @SmallTest + public void test_label() { + performHtmlTest("label.html"); + } + + @Test + @SmallTest + public void test_landmark() { + performHtmlTest("landmark.html"); + } + + @Test + @SmallTest + public void test_legend() { + performHtmlTest("legend.html"); + } + + @Test + @SmallTest + public void test_li() { + performHtmlTest("li.html"); + } + + @Test + @SmallTest + public void test_linkInsideHeading() { + performHtmlTest("link-inside-heading.html"); + } + + @Test + @SmallTest + public void test_listItemAriaSetsizeUnknownFlattened() { + performHtmlTest("list-item-aria-setsize-unknown-flattened.html"); + } + + @Test + @SmallTest + public void test_listItemAriaSetsizeUnknown() { + performHtmlTest("list-item-aria-setsize-unknown.html"); + } + + @Test + @SmallTest + public void test_listMarkers() { + performHtmlTest("list-markers.html"); + } + + @Test + @SmallTest + public void test_list() { + performHtmlTest("list.html"); + } + + @Test + @SmallTest + public void test_main() { + performHtmlTest("main.html"); + } + + @Test + @SmallTest + public void test_mapAnyContents() { + performHtmlTest("map-any-contents.html"); + } + + @Test + @SmallTest + public void test_mark() { + performHtmlTest("mark.html"); + } + + @Test + @SmallTest + public void test_math() { + performHtmlTest("math.html"); + } + + @Test + @SmallTest + public void test_menu() { + performHtmlTest("menu.html"); + } + + @Test + @SmallTest + public void test_meter() { + performHtmlTest("meter.html"); + } + + @Test + @SmallTest + public void test_navigation() { + performHtmlTest("navigation.html"); + } + + @Test + @SmallTest + public void test_nestedlist() { + performHtmlTest("nestedlist.html"); + } + + @Test + @SmallTest + public void test_object() { + performHtmlTest("object.html"); + } + + @Test + @SmallTest + public void test_offscreenIframeContent() { + performHtmlTest("offscreen-iframe-content.html"); + } + + @Test + @SmallTest + public void test_offscreenIframe() { + performHtmlTest("offscreen-iframe.html"); + } + + @Test + @SmallTest + public void test_offscreenSelect() { + performHtmlTest("offscreen-select.html"); + } + + @Test + @SmallTest + public void test_ol() { + performHtmlTest("ol.html"); + } + + @Test + @SmallTest + public void test_optgroup() { + performHtmlTest("optgroup.html"); + } + + @Test + @SmallTest + public void test_output() { + performHtmlTest("output.html"); + } + + @Test + @SmallTest + public void test_overflowActions() { + performHtmlTest("overflow-actions.html"); + } + + @Test + @SmallTest + public void test_p() { + performHtmlTest("p.html"); + } + + @Test + @SmallTest + public void test_param() { + performHtmlTest("param.html"); + } + + @Test + @SmallTest + public void test_picture() { + performHtmlTest("picture.html"); + } + + @Test + @SmallTest + public void test_portalWithWidgetInside() { + performHtmlTest("portal-with-widget-inside.html"); + } + + @Test + @SmallTest + public void test_portal() { + performHtmlTest("portal.html"); + } + + @Test + @SmallTest + public void test_pre() { + performHtmlTest("pre.html"); + } + + @Test + @SmallTest + public void test_progress() { + performHtmlTest("progress.html"); + } + + @Test + @SmallTest + public void test_q() { + performHtmlTest("q.html"); + } + + @Test + @SmallTest + public void test_replacedNodeAcrossTrees() { + performHtmlTest("replaced-node-across-trees.html"); + } + + @Test + @SmallTest + public void test_ruby() { + performHtmlTest("ruby.html"); + } + + @Test + @SmallTest + public void test_s() { + performHtmlTest("s.html"); + } + + @Test + @SmallTest + public void test_samp() { + performHtmlTest("samp.html"); + } + + @Test + @SmallTest + public void test_scrollableOverflow() { + performHtmlTest("scrollable-overflow.html"); + } + + @Test + @SmallTest + public void test_scrollableTextarea() { + performHtmlTest("scrollable-textarea.html"); + } + + @Test + @SmallTest + public void test_scrollable() { + performHtmlTest("scrollable.html"); + } + + @Test + @SmallTest + public void test_section() { + performHtmlTest("section.html"); + } + + @Test + @SmallTest + public void test_select() { + performHtmlTest("select.html"); + } + + @Test + @SmallTest + public void test_selectionContainer() { + performHtmlTest("selection-container.html"); + } + + @Test + @SmallTest + public void test_selectmenu() { + performHtmlTest("selectmenu.html"); + } + + @Test + @SmallTest + public void test_simple_spans() { + performHtmlTest("simple_spans.html"); + } + + @Test + @SmallTest + public void test_small() { + performHtmlTest("small.html"); + } + + @Test + @SmallTest + public void test_span() { + performHtmlTest("span.html"); + } + + @Test + @SmallTest + public void test_spansSeparatedBySpace() { + performHtmlTest("spans-separated-by-space.html"); + } + + @Test + @SmallTest + public void test_strong() { + performHtmlTest("strong.html"); + } + + @Test + @SmallTest + public void test_sub() { + performHtmlTest("sub.html"); + } + + @Test + @SmallTest + public void test_summary() { + performHtmlTest("summary.html"); + } + + @Test + @SmallTest + public void test_sup() { + performHtmlTest("sup.html"); + } + + @Test + @SmallTest + public void test_svgAsObjectSource() { + performHtmlTest("svg-as-object-source.html"); + } + + @Test + @SmallTest + public void test_svgChildOfButton() { + performHtmlTest("svg-child-of-button.html"); + } + + @Test + @SmallTest + public void test_svgChildOfSvg() { + performHtmlTest("svg-child-of-svg.html"); + } + + @Test + @SmallTest + public void test_svgDescInGroup() { + performHtmlTest("svg-desc-in-group.html"); + } + + @Test + @SmallTest + public void test_svgStyleElement() { + performHtmlTest("svg-style-element.html"); + } + + @Test + @SmallTest + public void test_svgSymbolWithRole() { + performHtmlTest("svg-symbol-with-role.html"); + } + + @Test + @SmallTest + public void test_svgTextAlternativeComputation() { + performHtmlTest("svg-text-alternative-computation.html"); + } + + @Test + @SmallTest + public void test_svgWithClickableRect() { + performHtmlTest("svg-with-clickable-rect.html"); + } + + @Test + @SmallTest + public void test_svgWithForeignObject() { + performHtmlTest("svg-with-foreign-object.html"); + } + + @Test + @SmallTest + public void test_svgWithLinkToDocument() { + performHtmlTest("svg-with-link-to-document.html"); + } + + @Test + @SmallTest + public void test_svgWithNonLinkAnchors() { + performHtmlTest("svg-with-non-link-anchors.html"); + } + + @Test + @SmallTest + public void test_svg() { + performHtmlTest("svg.html"); + } + + @Test + @SmallTest + public void test_tabindexExposeChildren() { + performHtmlTest("tabindex-expose-children.html"); + } + + @Test + @SmallTest + public void test_tableFocusableSections() { + performHtmlTest("table-focusable-sections.html"); + } + + @Test + @SmallTest + public void test_tableLayout() { + performHtmlTest("table-layout.html"); + } + + @Test + @SmallTest + public void test_tablePresentation() { + performHtmlTest("table-presentation.html"); + } + + @Test + @SmallTest + public void test_tableSimple2() { + performHtmlTest("table-simple-2.html"); + } + + @Test + @SmallTest public void test_tableSimple() { performHtmlTest("table-simple.html"); } @Test @SmallTest - public void test_clickableScore() { - performHtmlTest("clickable-score.html"); + public void test_tableSpans() { + performHtmlTest("table-spans.html"); + } + + @Test + @SmallTest + public void test_tableThColheader() { + performHtmlTest("table-th-colheader.html"); + } + + @Test + @SmallTest + public void test_tableThRowheader() { + performHtmlTest("table-th-rowheader.html"); + } + + @Test + @SmallTest + public void test_tableTheadTbodyTfoot() { + performHtmlTest("table-thead-tbody-tfoot.html"); + } + + @Test + @SmallTest + public void test_textAlign() { + performHtmlTest("text-align.html"); + } + + @Test + @SmallTest + public void test_textIndent() { + performHtmlTest("text-indent.html"); + } + + @Test + @SmallTest + public void test_textareaReadOnly() { + performHtmlTest("textarea-read-only.html"); + } + + @Test + @SmallTest + public void test_textarea() { + performHtmlTest("textarea.html"); + } + + @Test + @SmallTest + public void test_time() { + performHtmlTest("time.html"); + } + + @Test + @SmallTest + public void test_ulContenteditable() { + performHtmlTest("ul-contenteditable.html"); + } + + @Test + @SmallTest + public void test_ul() { + performHtmlTest("ul.html"); + } + + @Test + @SmallTest + public void test_var() { + performHtmlTest("var.html"); + } + + @Test + @SmallTest + public void test_wbr() { + performHtmlTest("wbr.html"); } } \ No newline at end of file
diff --git a/content/public/browser/browser_child_process_observer.h b/content/public/browser/browser_child_process_observer.h index 62472a0..e5d3d059 100644 --- a/content/public/browser/browser_child_process_observer.h +++ b/content/public/browser/browser_child_process_observer.h
@@ -37,6 +37,13 @@ const ChildProcessData& data, const ChildProcessTerminationInfo& info) {} + // Called when a child process never launches successfully. In this case, + // info.status will be TERMINATION_STATUS_LAUNCH_FAILED and info.exit_code + // will contain a platform specific launch failure error code. + virtual void BrowserChildProcessLaunchFailed( + const ChildProcessData& data, + const ChildProcessTerminationInfo& info) {} + // Note for Android. There is no way to reliably distinguish between Crash // and Kill. Arbitrarily choose all abnormal terminations on Android to call // BrowserChildProcessKilled, which means BrowserChildProcessCrashed will
diff --git a/content/public/browser/child_process_termination_info.h b/content/public/browser/child_process_termination_info.h index 94965dd7..b8ddf3b1 100644 --- a/content/public/browser/child_process_termination_info.h +++ b/content/public/browser/child_process_termination_info.h
@@ -14,6 +14,10 @@ #include "base/android/child_process_binding_types.h" #endif +#if defined(OS_WIN) +#include "base/win/windows_types.h" +#endif + namespace content { struct CONTENT_EXPORT ChildProcessTerminationInfo { @@ -58,6 +62,11 @@ // -2 means not applicable because process is not ranked. int best_effort_reverse_rank = -1; #endif + +#if defined(OS_WIN) + // The LastError if there was a failure to launch the process. + DWORD last_error; +#endif }; } // namespace content
diff --git a/content/public/browser/content_browser_client.cc b/content/public/browser/content_browser_client.cc index f26ff21..0e1d23f 100644 --- a/content/public/browser/content_browser_client.cc +++ b/content/public/browser/content_browser_client.cc
@@ -46,6 +46,7 @@ #include "content/public/common/url_utils.h" #include "media/audio/audio_manager.h" #include "media/mojo/mojom/media_service.mojom.h" +#include "net/base/features.h" #include "net/cookies/site_for_cookies.h" #include "net/ssl/client_cert_identity.h" #include "net/ssl/client_cert_store.h" @@ -1306,4 +1307,8 @@ return false; } +bool ContentBrowserClient::IsFirstPartySetsEnabled() { + return base::FeatureList::IsEnabled(net::features::kFirstPartySets); +} + } // namespace content
diff --git a/content/public/browser/content_browser_client.h b/content/public/browser/content_browser_client.h index d50c7e0..67728551 100644 --- a/content/public/browser/content_browser_client.h +++ b/content/public/browser/content_browser_client.h
@@ -2187,6 +2187,9 @@ // Whether a navigation in |browser_context| should preconnect early. virtual bool ShouldPreconnectNavigation(BrowserContext* browser_context); + + // Returns true if First-Party Sets is enabled. + virtual bool IsFirstPartySetsEnabled(); }; } // namespace content
diff --git a/content/public/test/test_navigation_observer.cc b/content/public/test/test_navigation_observer.cc index 31f5536..355a54d 100644 --- a/content/public/test/test_navigation_observer.cc +++ b/content/public/test/test_navigation_observer.cc
@@ -285,6 +285,7 @@ : NAVIGATION_TYPE_UNKNOWN; last_nav_entry_id_ = NavigationRequest::From(navigation_handle)->nav_entry_id(); + last_source_site_instance_ = navigation_handle->GetSourceSiteInstance(); // Allow extending classes to fetch data available via navigation_handle. NavigationOfInterestDidFinish(navigation_handle);
diff --git a/content/public/test/test_navigation_observer.h b/content/public/test/test_navigation_observer.h index 3de29e7e..c34fd95 100644 --- a/content/public/test/test_navigation_observer.h +++ b/content/public/test/test_navigation_observer.h
@@ -131,6 +131,10 @@ // matched URL if set). int last_nav_entry_id() const { return last_nav_entry_id_; } + SiteInstance* last_source_site_instance() const { + return last_source_site_instance_.get(); + } + protected: // Register this TestNavigationObserver as an observer of the |web_contents|. void RegisterAsObserver(WebContents* web_contents); @@ -267,6 +271,8 @@ // The navigation entry ID of the last navigation. int last_nav_entry_id_ = 0; + scoped_refptr<SiteInstance> last_source_site_instance_; + // The MessageLoopRunner used to spin the message loop. scoped_refptr<MessageLoopRunner> message_loop_runner_;
diff --git a/content/test/BUILD.gn b/content/test/BUILD.gn index dbd6c99..54af4c3d 100644 --- a/content/test/BUILD.gn +++ b/content/test/BUILD.gn
@@ -1597,6 +1597,7 @@ deps += [ "//net:net_resources", + "//sandbox", "//third_party/blink/public:resources", "//third_party/blink/public/strings", "//third_party/iaccessible2",
diff --git a/content/test/data/accessibility/html/a-name-calc-expected-android-external.txt b/content/test/data/accessibility/html/a-name-calc-expected-android-external.txt index 2131e11e..2fa6e09 100644 --- a/content/test/data/accessibility/html/a-name-calc-expected-android-external.txt +++ b/content/test/data/accessibility/html/a-name-calc-expected-android-external.txt
@@ -10,9 +10,9 @@ ++TextView text:" " actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="staticText"] ++View text:"null" contentDescription:"LabelledBy3" clickable focusable actions:[FOCUS, CLICK, AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="link", clickableScore="300", roleDescription="link", targetUrl="file:///storage/emulated/0/chromium_tests_root/content/test/data/accessibility/html/a-name-calc.html#"] ++++TextView text:"InnerText3" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="staticText"] -++View text:"null" contentDescription:"Title4" clickable focusable actions:[FOCUS, CLICK, AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="link", clickableScore="300", offscreen="true", roleDescription="link", targetUrl="file:///storage/emulated/0/chromium_tests_root/content/test/data/accessibility/html/a-name-calc.html#"] -++View text:"null" contentDescription:"Label5" clickable focusable actions:[FOCUS, CLICK, AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="link", clickableScore="300", offscreen="true", roleDescription="link", targetUrl="file:///storage/emulated/0/chromium_tests_root/content/test/data/accessibility/html/a-name-calc.html#"] -++View text:"null" contentDescription:"LabelledBy6" clickable focusable actions:[FOCUS, CLICK, AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="link", clickableScore="300", offscreen="true", roleDescription="link", targetUrl="file:///storage/emulated/0/chromium_tests_root/content/test/data/accessibility/html/a-name-calc.html#"] +++View text:"null" contentDescription:"Title4" clickable focusable actions:[FOCUS, CLICK, AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="link", clickableScore="300", roleDescription="link", targetUrl="file:///storage/emulated/0/chromium_tests_root/content/test/data/accessibility/html/a-name-calc.html#"] +++View text:"null" contentDescription:"Label5" clickable focusable actions:[FOCUS, CLICK, AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="link", clickableScore="300", roleDescription="link", targetUrl="file:///storage/emulated/0/chromium_tests_root/content/test/data/accessibility/html/a-name-calc.html#"] +++View text:"null" contentDescription:"LabelledBy6" clickable focusable actions:[FOCUS, CLICK, AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="link", clickableScore="300", roleDescription="link", targetUrl="file:///storage/emulated/0/chromium_tests_root/content/test/data/accessibility/html/a-name-calc.html#"] ++View actions:[AX_FOCUS] bundle:[chromeRole="paragraph"] ++++TextView text:"LabelledBy3" viewIdResName:"label3" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="genericContainer"] ++++TextView text:" " actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="staticText"]
diff --git a/content/test/data/accessibility/html/a-no-text-expected-android-external.txt b/content/test/data/accessibility/html/a-no-text-expected-android-external.txt index 50c6f98..a0c591f 100644 --- a/content/test/data/accessibility/html/a-no-text-expected-android-external.txt +++ b/content/test/data/accessibility/html/a-no-text-expected-android-external.txt
@@ -1,21 +1,21 @@ WebView focusable focused scrollable actions:[CLEAR_FOCUS, AX_FOCUS] bundle:[chromeRole="rootWebArea", hasImage="true"] ++View actions:[AX_FOCUS] bundle:[chromeRole="genericContainer", hasImage="true"] ++++View text:"null" contentDescription:"dest1" clickable focusable actions:[FOCUS, CLICK, AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="link", clickableScore="300", hasImage="true", roleDescription="link", targetUrl="file:///storage/emulated/0/chromium_tests_root/content/test/data/accessibility/html/dest1"] -++++++Image actions:[AX_FOCUS] bundle:[chromeRole="image", clickableScore="100", hasImage="true", offscreen="true", roleDescription="graphic"] +++++++Image actions:[AX_FOCUS] bundle:[chromeRole="image", clickableScore="100", hasImage="true", roleDescription="graphic"] ++++View text:"null" contentDescription:"dest2" clickable focusable actions:[FOCUS, CLICK, AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="link", clickableScore="300", hasImage="true", roleDescription="link", targetUrl="file:///dest2"] -++++++Image actions:[AX_FOCUS] bundle:[chromeRole="image", clickableScore="100", hasImage="true", offscreen="true", roleDescription="graphic"] +++++++Image actions:[AX_FOCUS] bundle:[chromeRole="image", clickableScore="100", hasImage="true", roleDescription="graphic"] ++++View text:"null" contentDescription:"dest3" clickable focusable actions:[FOCUS, CLICK, AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="link", clickableScore="300", hasImage="true", roleDescription="link", targetUrl="file:///storage/emulated/0/chromium_tests_root/content/test/data/accessibility/html/dest3/"] -++++++Image actions:[AX_FOCUS] bundle:[chromeRole="image", clickableScore="100", hasImage="true", offscreen="true", roleDescription="graphic"] +++++++Image actions:[AX_FOCUS] bundle:[chromeRole="image", clickableScore="100", hasImage="true", roleDescription="graphic"] ++++View text:"null" contentDescription:"dest4" clickable focusable actions:[FOCUS, CLICK, AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="link", clickableScore="300", hasImage="true", roleDescription="link", targetUrl="http://example.com/dest4"] -++++++Image actions:[AX_FOCUS] bundle:[chromeRole="image", clickableScore="100", hasImage="true", offscreen="true", roleDescription="graphic"] +++++++Image actions:[AX_FOCUS] bundle:[chromeRole="image", clickableScore="100", hasImage="true", roleDescription="graphic"] ++++View text:"null" contentDescription:"dest5" clickable focusable actions:[FOCUS, CLICK, AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="link", clickableScore="300", hasImage="true", roleDescription="link", targetUrl="http://example.com/dest5/"] -++++++Image actions:[AX_FOCUS] bundle:[chromeRole="image", clickableScore="100", hasImage="true", offscreen="true", roleDescription="graphic"] +++++++Image actions:[AX_FOCUS] bundle:[chromeRole="image", clickableScore="100", hasImage="true", roleDescription="graphic"] ++++View text:"null" contentDescription:"dest6" clickable focusable actions:[FOCUS, CLICK, AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="link", clickableScore="300", hasImage="true", roleDescription="link", targetUrl="file:///storage/emulated/0/chromium_tests_root/content/test/data/accessibility/html/dest6.html"] -++++++Image actions:[AX_FOCUS] bundle:[chromeRole="image", clickableScore="100", hasImage="true", offscreen="true", roleDescription="graphic"] +++++++Image actions:[AX_FOCUS] bundle:[chromeRole="image", clickableScore="100", hasImage="true", roleDescription="graphic"] ++++View text:"null" contentDescription:"dest7" clickable focusable actions:[FOCUS, CLICK, AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="link", clickableScore="300", hasImage="true", roleDescription="link", targetUrl="http://example.com/dest7.html"] -++++++Image actions:[AX_FOCUS] bundle:[chromeRole="image", clickableScore="100", hasImage="true", offscreen="true", roleDescription="graphic"] +++++++Image actions:[AX_FOCUS] bundle:[chromeRole="image", clickableScore="100", hasImage="true", roleDescription="graphic"] ++++View text:"null" contentDescription:"dest.8" clickable focusable actions:[FOCUS, CLICK, AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="link", clickableScore="300", hasImage="true", roleDescription="link", targetUrl="http://example.com/dest.8.html"] -++++++Image actions:[AX_FOCUS] bundle:[chromeRole="image", clickableScore="100", hasImage="true", offscreen="true", roleDescription="graphic"] +++++++Image actions:[AX_FOCUS] bundle:[chromeRole="image", clickableScore="100", hasImage="true", roleDescription="graphic"] ++++View text:"null" contentDescription:"greenbox" clickable focusable actions:[FOCUS, CLICK, AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="link", clickableScore="300", hasImage="true", roleDescription="link", targetUrl="file:///storage/emulated/0/chromium_tests_root/content/test/data/accessibility/html/dest9.html"] ++++++Image text:"greenbox" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="image", clickableScore="100", hasImage="true", roleDescription="graphic", targetUrl="file:///storage/emulated/0/chromium_tests_root/content/test/data/accessibility/html/greenbox.png"] ++++TextView text:" " actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="staticText"]
diff --git a/content/test/data/accessibility/html/a-onclick-expected-android-external.txt b/content/test/data/accessibility/html/a-onclick-expected-android-external.txt deleted file mode 100644 index 995f0eb..0000000 --- a/content/test/data/accessibility/html/a-onclick-expected-android-external.txt +++ /dev/null
@@ -1,5 +0,0 @@ -WebView focusable focused scrollable actions:[CLEAR_FOCUS, AX_FOCUS] bundle:[chromeRole="rootWebArea"] -++View text:"null" contentDescription:"link with no href but onclick" clickable actions:[CLICK, AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="link", clickableScore="300", roleDescription="link"] -++++TextView text:"link with no href but onclick" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="staticText"] -++View text:"null" contentDescription:"link with no href and click handler added via script" viewIdResName:"add-click-handler-to-me" clickable actions:[CLICK, AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="link", clickableScore="300", roleDescription="link"] -++++TextView text:"link with no href and click handler added via script" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="staticText"] \ No newline at end of file
diff --git a/content/test/data/accessibility/html/a-with-before-expected-android-external.txt b/content/test/data/accessibility/html/a-with-before-expected-android-external.txt deleted file mode 100644 index 8b95135..0000000 --- a/content/test/data/accessibility/html/a-with-before-expected-android-external.txt +++ /dev/null
@@ -1,7 +0,0 @@ -WebView focusable focused scrollable actions:[CLEAR_FOCUS, AX_FOCUS] bundle:[chromeRole="rootWebArea"] -++View actions:[AX_FOCUS] bundle:[chromeRole="genericContainer"] -++++TextView text:"Here is a " actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="staticText"] -++++View text:"null" contentDescription:"[linked] link" clickable focusable actions:[FOCUS, CLICK, AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="link", clickableScore="300", roleDescription="link", targetUrl="http://google.com/"] -++++++TextView text:"[linked] " actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="staticText"] -++++++TextView text:"link" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="staticText"] -++++TextView text:"." actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="staticText"] \ No newline at end of file
diff --git a/content/test/data/accessibility/html/abbr-expected-android-external.txt b/content/test/data/accessibility/html/abbr-expected-android-external.txt new file mode 100644 index 0000000..3b1b0f6 --- /dev/null +++ b/content/test/data/accessibility/html/abbr-expected-android-external.txt
@@ -0,0 +1,5 @@ +WebView focusable focused scrollable actions:[CLEAR_FOCUS, AX_FOCUS] bundle:[chromeRole="rootWebArea"] +++View actions:[AX_FOCUS] bundle:[chromeRole="paragraph"] +++++TextView text:"The " actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="staticText"] +++++View text:"World Health Organization" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="abbr"] +++++TextView text:" was founded in 1948." actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="staticText"] \ No newline at end of file
diff --git a/content/test/data/accessibility/html/accordion-expected-android-external.txt b/content/test/data/accessibility/html/accordion-expected-android-external.txt new file mode 100644 index 0000000..7dcb49a --- /dev/null +++ b/content/test/data/accessibility/html/accordion-expected-android-external.txt
@@ -0,0 +1,13 @@ +WebView focusable focused scrollable actions:[CLEAR_FOCUS, AX_FOCUS] bundle:[chromeRole="rootWebArea"] +++View text:"Accordion Section #1" CollectionItemInfo:[heading, rowIndex=0, rowSpan=0, colIndex=0, colSpan=0] actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="heading", roleDescription="heading 3"] +++++Button text:"Accordion Section #1" viewIdResName:"header1control" clickable focusable CollectionItemInfo:[heading, rowIndex=0, rowSpan=0, colIndex=0, colSpan=0] actions:[FOCUS, CLICK, AX_FOCUS, NEXT, PREVIOUS, COLLAPSE] bundle:[chromeRole="button", clickableScore="300", roleDescription="button"] +++View text:"Accordion Section #1" viewIdResName:"section1" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="region", roleDescription="region"] +++++TextView text:"Content for first section of accordion element." actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="paragraph"] +++View text:"Accordion Section #2" CollectionItemInfo:[heading, rowIndex=0, rowSpan=0, colIndex=0, colSpan=0] actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="heading", roleDescription="heading 3"] +++++Button text:"Accordion Section #2" viewIdResName:"header2control" clickable focusable CollectionItemInfo:[heading, rowIndex=0, rowSpan=0, colIndex=0, colSpan=0] actions:[FOCUS, CLICK, AX_FOCUS, NEXT, PREVIOUS, EXPAND] bundle:[chromeRole="button", clickableScore="300", roleDescription="button"] +++View text:"Accordion Section #3" CollectionItemInfo:[heading, rowIndex=0, rowSpan=0, colIndex=0, colSpan=0] actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="heading", roleDescription="heading 3"] +++++Button text:"Accordion Section #3" viewIdResName:"header3control" clickable focusable CollectionItemInfo:[heading, rowIndex=0, rowSpan=0, colIndex=0, colSpan=0] actions:[FOCUS, CLICK, AX_FOCUS, NEXT, PREVIOUS, EXPAND] bundle:[chromeRole="button", clickableScore="300", roleDescription="button"] +++View text:"Accordion Section #4" CollectionItemInfo:[heading, rowIndex=0, rowSpan=0, colIndex=0, colSpan=0] actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="heading", roleDescription="heading 3"] +++++Button text:"Accordion Section #4" viewIdResName:"header4control" clickable disabled focusable CollectionItemInfo:[heading, rowIndex=0, rowSpan=0, colIndex=0, colSpan=0] actions:[FOCUS, CLICK, AX_FOCUS, NEXT, PREVIOUS, COLLAPSE] bundle:[chromeRole="button", roleDescription="button"] +++View text:"Accordion Section #4" viewIdResName:"section3" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="region", roleDescription="region"] +++++TextView text:"Content for forth section of accordion element. This section will always be visible but disabled." actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="paragraph"] \ No newline at end of file
diff --git a/content/test/data/accessibility/html/action-verbs-expected-android-external.txt b/content/test/data/accessibility/html/action-verbs-expected-android-external.txt new file mode 100644 index 0000000..3721123 --- /dev/null +++ b/content/test/data/accessibility/html/action-verbs-expected-android-external.txt
@@ -0,0 +1,32 @@ +WebView text:"Action verbs" focusable focused scrollable actions:[CLEAR_FOCUS, AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="rootWebArea"] +++TextView text:"Generic div" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="genericContainer"] +++TextView text:"Heading" CollectionItemInfo:[heading, rowIndex=0, rowSpan=0, colIndex=0, colSpan=0] actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="heading", roleDescription="heading 1"] +++Button text:"Button" clickable focusable actions:[FOCUS, CLICK, AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="button", clickableScore="300", roleDescription="button"] +++View text:"null" contentDescription:"Link" clickable focusable actions:[FOCUS, CLICK, AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="link", clickableScore="300", roleDescription="link", targetUrl="file:///storage/emulated/0/chromium_tests_root/content/test/data/accessibility/html/action-verbs.html#"] +++++TextView text:"Link" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="staticText"] +++EditText clickable editable focusable inputType:1 textSelectionStart:0 textSelectionEnd:0 actions:[FOCUS, CLICK, AX_FOCUS, PASTE, SET_TEXT, IME_ENTER] bundle:[chromeRole="textField", clickableScore="300"] +++EditText clickable editable focusable inputType:1 textSelectionStart:0 textSelectionEnd:0 actions:[FOCUS, CLICK, AX_FOCUS, PASTE, SET_TEXT, IME_ENTER] bundle:[chromeRole="searchBox", clickableScore="300", roleDescription="search text field"] +++EditText clickable editable focusable multiLine textSelectionStart:0 textSelectionEnd:0 actions:[FOCUS, CLICK, AX_FOCUS, PASTE, SET_TEXT, IME_ENTER] bundle:[chromeRole="textField", clickableScore="300"] +++EditText clickable editable focusable multiLine textSelectionStart:0 textSelectionEnd:0 actions:[FOCUS, CLICK, AX_FOCUS, PASTE, SET_TEXT, IME_ENTER] bundle:[chromeRole="textField", clickableScore="300"] +++CheckBox checkable clickable focusable actions:[FOCUS, CLICK, AX_FOCUS] bundle:[chromeRole="checkBox", clickableScore="300", roleDescription="checkbox"] +++CheckBox checkable checked clickable focusable actions:[FOCUS, CLICK, AX_FOCUS] bundle:[chromeRole="checkBox", clickableScore="300", roleDescription="checkbox"] +++RadioButton checkable clickable focusable actions:[FOCUS, CLICK, AX_FOCUS] bundle:[chromeRole="radioButton", clickableScore="300", roleDescription="radio button"] +++ToggleButton text:"ARIA Switch" checkable clickable focusable actions:[FOCUS, CLICK, AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="switch", clickableScore="300", roleDescription="switch"] +++View actions:[AX_FOCUS] bundle:[chromeRole="details"] +++++View text:"Summary" clickable focusable actions:[FOCUS, CLICK, AX_FOCUS, NEXT, PREVIOUS, EXPAND] bundle:[chromeRole="disclosureTriangle", clickableScore="300", roleDescription="disclosure triangle"] +++View text:"Pop-up button" canOpenPopUp clickable focusable actions:[FOCUS, CLICK, AX_FOCUS, NEXT, PREVIOUS, EXPAND] bundle:[chromeRole="popUpButton", clickableScore="300", roleDescription="menu pop up button"] +++TextView text:"Div with click handler" clickable actions:[CLICK, AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="genericContainer", clickableScore="200"] +++View clickable actions:[CLICK, AX_FOCUS] bundle:[chromeRole="group", clickableScore="200"] +++++TextView text:"Paragraph with click handler on parent" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="paragraph", clickableScore="100"] +++View actions:[AX_FOCUS] bundle:[chromeRole="menu", roleDescription="menu"] +++++MenuItem text:"Menu item 1" clickable actions:[CLICK, AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="menuItem", clickableScore="300", roleDescription="menu item"] +++++MenuItem text:"Menu item 2" checkable checked clickable actions:[CLICK, AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="menuItemCheckBox", clickableScore="300", roleDescription="checkbox"] +++++MenuItem text:"Menu item 3" checkable clickable actions:[CLICK, AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="menuItemRadio", clickableScore="300", roleDescription="radio button"] +++Button text:"ARIA Button" clickable actions:[CLICK, AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="button", clickableScore="300", roleDescription="button"] +++Button text:"ARIA button with tab index" clickable focusable actions:[FOCUS, CLICK, AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="button", clickableScore="300", roleDescription="button"] +++Button text:"ARIA button with negative tab index" clickable focusable actions:[FOCUS, CLICK, AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="button", clickableScore="300", roleDescription="button"] +++View clickable actions:[CLICK, AX_FOCUS] bundle:[chromeRole="genericContainer", clickableScore="200"] +++++Button text:"ARIA button that is an active descendant" viewIdResName:"active-descendant-button" clickable focusable actions:[FOCUS, CLICK, AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="button", clickableScore="300", roleDescription="button"] +++View clickable actions:[CLICK, AX_FOCUS] bundle:[chromeRole="genericContainer", clickableScore="200"] +++++ToggleButton text:"ARIA switch in clickable container" checkable clickable actions:[CLICK, AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="switch", clickableScore="300", roleDescription="switch"] +++++TextView text:"Generic in clickable container" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="genericContainer", clickableScore="100"] \ No newline at end of file
diff --git a/content/test/data/accessibility/html/actions-expected-android-external.txt b/content/test/data/accessibility/html/actions-expected-android-external.txt new file mode 100644 index 0000000..29779fb --- /dev/null +++ b/content/test/data/accessibility/html/actions-expected-android-external.txt
@@ -0,0 +1,4 @@ +WebView text:"Actions" focusable focused scrollable actions:[CLEAR_FOCUS, AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="rootWebArea"] +++View actions:[AX_FOCUS] bundle:[chromeRole="genericContainer"] +++++SeekBar text:"50" clickable focusable RangeInfo:[current=50.0, min=1.0, max=100.0] actions:[FOCUS, CLICK, AX_FOCUS, NEXT, PREVIOUS, SCROLL_FORWARD, SCROLL_BACKWARD, SET_PROGRESS] bundle:[chromeRole="slider", roleDescription="slider"] +++++EditText clickable editable focusable inputType:1 textSelectionStart:0 textSelectionEnd:0 actions:[FOCUS, CLICK, AX_FOCUS, PASTE, SET_TEXT, IME_ENTER] bundle:[chromeRole="textField", clickableScore="300", hint="Test textfield"] \ No newline at end of file
diff --git a/content/test/data/accessibility/html/address-expected-android-external.txt b/content/test/data/accessibility/html/address-expected-android-external.txt new file mode 100644 index 0000000..a8bd99c --- /dev/null +++ b/content/test/data/accessibility/html/address-expected-android-external.txt
@@ -0,0 +1,2 @@ +WebView focusable focused scrollable actions:[CLEAR_FOCUS, AX_FOCUS] bundle:[chromeRole="rootWebArea"] +++TextView text:"Please contact John Citizen for more information." actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="genericContainer"] \ No newline at end of file
diff --git a/content/test/data/accessibility/html/area-expected-android-external.txt b/content/test/data/accessibility/html/area-expected-android-external.txt new file mode 100644 index 0000000..3f987614 --- /dev/null +++ b/content/test/data/accessibility/html/area-expected-android-external.txt
@@ -0,0 +1,5 @@ +WebView focusable focused scrollable actions:[CLEAR_FOCUS, AX_FOCUS] bundle:[chromeRole="rootWebArea", hasImage="true"] +++View actions:[AX_FOCUS] bundle:[chromeRole="genericContainer", hasImage="true"] +++++Image text:"pipe" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="image", hasImage="true", roleDescription="graphic", targetUrl="file:///storage/emulated/0/chromium_tests_root/content/test/data/accessibility/html/pipe.jpg"] +++++++View text:"null" contentDescription:"pipe1" clickable focusable actions:[FOCUS, CLICK, AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="link", clickableScore="300", roleDescription="link", targetUrl="file:///storage/emulated/0/chromium_tests_root/content/test/data/accessibility/html/fake.htm"] +++++++TextView text:"pipe2" clickable actions:[CLICK, AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="staticText", clickableScore="200"] \ No newline at end of file
diff --git a/content/test/data/accessibility/html/article-expected-android-external.txt b/content/test/data/accessibility/html/article-expected-android-external.txt new file mode 100644 index 0000000..3a8b91d --- /dev/null +++ b/content/test/data/accessibility/html/article-expected-android-external.txt
@@ -0,0 +1,2 @@ +WebView focusable focused scrollable actions:[CLEAR_FOCUS, AX_FOCUS] bundle:[chromeRole="rootWebArea"] +++View text:"This is an article element." actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="article", roleDescription="article"] \ No newline at end of file
diff --git a/content/test/data/accessibility/html/aside-expected-android-external.txt b/content/test/data/accessibility/html/aside-expected-android-external.txt new file mode 100644 index 0000000..2590c5e5 --- /dev/null +++ b/content/test/data/accessibility/html/aside-expected-android-external.txt
@@ -0,0 +1,5 @@ +WebView focusable focused scrollable actions:[CLEAR_FOCUS, AX_FOCUS] bundle:[chromeRole="rootWebArea"] +++TextView text:"The aside tag defines some content aside from the content it is placed in." actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="paragraph"] +++View actions:[AX_FOCUS] bundle:[chromeRole="complementary", roleDescription="complementary"] +++++TextView text:"Aside tag" CollectionItemInfo:[heading, rowIndex=0, rowSpan=0, colIndex=0, colSpan=0] actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="heading", roleDescription="heading 4"] +++++TextView text:"The aside content should be related to the surrounding content." actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="paragraph"] \ No newline at end of file
diff --git a/content/test/data/accessibility/html/b-expected-android-external.txt b/content/test/data/accessibility/html/b-expected-android-external.txt new file mode 100644 index 0000000..2734761 --- /dev/null +++ b/content/test/data/accessibility/html/b-expected-android-external.txt
@@ -0,0 +1,2 @@ +WebView focusable focused scrollable actions:[CLEAR_FOCUS, AX_FOCUS] bundle:[chromeRole="rootWebArea"] +++TextView text:"Some bold text" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="paragraph"] \ No newline at end of file
diff --git a/content/test/data/accessibility/html/bdo-expected-android-external.txt b/content/test/data/accessibility/html/bdo-expected-android-external.txt new file mode 100644 index 0000000..66303d3 --- /dev/null +++ b/content/test/data/accessibility/html/bdo-expected-android-external.txt
@@ -0,0 +1,2 @@ +WebView focusable focused scrollable actions:[CLEAR_FOCUS, AX_FOCUS] bundle:[chromeRole="rootWebArea"] +++TextView text:"Some LTR text Some RTL text with some LTR text embedded" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="genericContainer"] \ No newline at end of file
diff --git a/content/test/data/accessibility/html/blockquote-expected-android-external.txt b/content/test/data/accessibility/html/blockquote-expected-android-external.txt new file mode 100644 index 0000000..fe42e5b6 --- /dev/null +++ b/content/test/data/accessibility/html/blockquote-expected-android-external.txt
@@ -0,0 +1,4 @@ +WebView focusable focused scrollable actions:[CLEAR_FOCUS, AX_FOCUS] bundle:[chromeRole="rootWebArea"] +++View actions:[AX_FOCUS] bundle:[chromeRole="blockquote", roleDescription="blockquote"] +++++TextView text:"First blockquote has a child element." actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="paragraph"] +++View text:"Second blockquote has no child." actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="blockquote", roleDescription="blockquote"] \ No newline at end of file
diff --git a/content/test/data/accessibility/html/blockquote-levels-expected-android-external.txt b/content/test/data/accessibility/html/blockquote-levels-expected-android-external.txt new file mode 100644 index 0000000..013530e --- /dev/null +++ b/content/test/data/accessibility/html/blockquote-levels-expected-android-external.txt
@@ -0,0 +1,6 @@ +WebView focusable focused scrollable actions:[CLEAR_FOCUS, AX_FOCUS] bundle:[chromeRole="rootWebArea"] +++View actions:[AX_FOCUS] bundle:[chromeRole="blockquote", roleDescription="blockquote"] +++++TextView text:"Top level" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="staticText"] +++++View actions:[AX_FOCUS] bundle:[chromeRole="blockquote", roleDescription="blockquote"] +++++++TextView text:"Sub" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="staticText"] +++++++View text:"Sub-sub" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="blockquote", roleDescription="blockquote"] \ No newline at end of file
diff --git a/content/test/data/accessibility/html/body-expected-android-external.txt b/content/test/data/accessibility/html/body-expected-android-external.txt new file mode 100644 index 0000000..2cdd1a3 --- /dev/null +++ b/content/test/data/accessibility/html/body-expected-android-external.txt
@@ -0,0 +1,2 @@ +WebView focusable focused scrollable actions:[CLEAR_FOCUS, AX_FOCUS] bundle:[chromeRole="rootWebArea"] +++TextView text:"This test is for body tag" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="paragraph"] \ No newline at end of file
diff --git a/content/test/data/accessibility/html/br-expected-android-external.txt b/content/test/data/accessibility/html/br-expected-android-external.txt new file mode 100644 index 0000000..4faf4c9 --- /dev/null +++ b/content/test/data/accessibility/html/br-expected-android-external.txt
@@ -0,0 +1,5 @@ +WebView focusable focused scrollable actions:[CLEAR_FOCUS, AX_FOCUS] bundle:[chromeRole="rootWebArea"] +++View text:"\n" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="lineBreak"] +++TextView text:"Text line 1" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="staticText"] +++TextView text:"Text line 2\nText line 3" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="paragraph"] +++View text:"\n" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="lineBreak"] \ No newline at end of file
diff --git a/content/test/data/accessibility/html/button-expected-android-external.txt b/content/test/data/accessibility/html/button-expected-android-external.txt new file mode 100644 index 0000000..89d96e4 --- /dev/null +++ b/content/test/data/accessibility/html/button-expected-android-external.txt
@@ -0,0 +1,3 @@ +WebView focusable focused scrollable actions:[CLEAR_FOCUS, AX_FOCUS] bundle:[chromeRole="rootWebArea"] +++View actions:[AX_FOCUS] bundle:[chromeRole="genericContainer"] +++++Button text:"Click me!" clickable focusable actions:[FOCUS, CLICK, AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="button", clickableScore="300", roleDescription="button"] \ No newline at end of file
diff --git a/content/test/data/accessibility/html/button-name-calc-expected-android-external.txt b/content/test/data/accessibility/html/button-name-calc-expected-android-external.txt new file mode 100644 index 0000000..9981138f --- /dev/null +++ b/content/test/data/accessibility/html/button-name-calc-expected-android-external.txt
@@ -0,0 +1,18 @@ +WebView focusable focused scrollable actions:[CLEAR_FOCUS, AX_FOCUS] bundle:[chromeRole="rootWebArea"] +++Button text:"InnerText0" viewIdResName:"c0" clickable focusable actions:[FOCUS, CLICK, AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="button", clickableScore="300", roleDescription="button"] +++Button text:"InnerText1" viewIdResName:"c1" clickable focusable actions:[FOCUS, CLICK, AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="button", clickableScore="300", hint="Title1", roleDescription="button"] +++Button text:"AriaLabel2" viewIdResName:"c2" clickable focusable actions:[FOCUS, CLICK, AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="button", clickableScore="300", hint="Title2", roleDescription="button"] +++Button text:"LabelledBy3" viewIdResName:"c3" clickable focusable actions:[FOCUS, CLICK, AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="button", clickableScore="300", hint="Title3", roleDescription="button"] +++Button text:"LabelledBy4" viewIdResName:"c4" clickable focusable actions:[FOCUS, CLICK, AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="button", clickableScore="300", hint="DescribedBy4", roleDescription="button"] +++Button text:"InnerText5" viewIdResName:"c5" clickable focusable actions:[FOCUS, CLICK, AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="button", clickableScore="300", hint="DescribedBy5", roleDescription="button"] +++Button text:"Outer inner" clickable focusable actions:[FOCUS, CLICK, AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="button", clickableScore="300", roleDescription="button"] +++Button text:"Outer inner1" clickable focusable actions:[FOCUS, CLICK, AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="button", clickableScore="300", roleDescription="button"] +++Button text:"Outer grandchild" clickable focusable actions:[FOCUS, CLICK, AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="button", clickableScore="300", roleDescription="button"] +++View actions:[AX_FOCUS] bundle:[chromeRole="paragraph"] +++++TextView text:"LabelledBy3" viewIdResName:"lb3" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="genericContainer"] +++++TextView text:" " actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="staticText"] +++++TextView text:"LabelledBy4" viewIdResName:"lb4" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="genericContainer"] +++++TextView text:" " actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="staticText"] +++++TextView text:"DescribedBy4" viewIdResName:"db4" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="genericContainer"] +++++TextView text:" " actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="staticText"] +++++TextView text:"DescribedBy5" viewIdResName:"db5" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="genericContainer"] \ No newline at end of file
diff --git a/content/test/data/accessibility/html/button-with-listbox-popup-expected-android-external.txt b/content/test/data/accessibility/html/button-with-listbox-popup-expected-android-external.txt new file mode 100644 index 0000000..7dbf46b5 --- /dev/null +++ b/content/test/data/accessibility/html/button-with-listbox-popup-expected-android-external.txt
@@ -0,0 +1,8 @@ +WebView focusable focused scrollable actions:[CLEAR_FOCUS, AX_FOCUS] bundle:[chromeRole="rootWebArea"] +++View viewIdResName:"test1" actions:[AX_FOCUS] bundle:[chromeRole="genericContainer"] +++++TextView text:"Choose one:" viewIdResName:"span" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="genericContainer"] +++++View text:"Choose one: Foo" viewIdResName:"test" canOpenPopUp clickable focusable actions:[FOCUS, CLICK, AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="popUpButton", clickableScore="300", roleDescription="pop up button"] +++++ListView text:"Choose one:, 3 items" viewIdResName:"options" clickable focusable CollectionInfo:[rows=3, cols=0] actions:[FOCUS, CLICK, AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="listBox", clickableScore="300", roleDescription="list box"] +++++++View text:"Baz, in list, item 1 of 3" viewIdResName:"option1" clickable focusable CollectionItemInfo:[rowIndex=0, rowSpan=0, colIndex=0, colSpan=0] actions:[FOCUS, CLICK, AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="listBoxOption", clickableScore="200"] +++++++View text:"Bar, in list, item 2 of 3" viewIdResName:"option2" clickable focusable CollectionItemInfo:[rowIndex=1, rowSpan=0, colIndex=0, colSpan=0] actions:[FOCUS, CLICK, AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="listBoxOption", clickableScore="200"] +++++++View text:"Foo, in list, item 3 of 3" viewIdResName:"option3" clickable focusable CollectionItemInfo:[rowIndex=2, rowSpan=0, colIndex=0, colSpan=0] actions:[FOCUS, CLICK, AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="listBoxOption", clickableScore="200"] \ No newline at end of file
diff --git a/content/test/data/accessibility/html/canvas-expected-android-external.txt b/content/test/data/accessibility/html/canvas-expected-android-external.txt new file mode 100644 index 0000000..711a5df8 --- /dev/null +++ b/content/test/data/accessibility/html/canvas-expected-android-external.txt
@@ -0,0 +1,6 @@ +WebView focusable focused scrollable actions:[CLEAR_FOCUS, AX_FOCUS] bundle:[chromeRole="rootWebArea", hasImage="true"] +++View actions:[AX_FOCUS] bundle:[chromeRole="genericContainer", hasImage="true"] +++++Image text:"Static fallback" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="canvas", hasImage="true"] +++++Image actions:[AX_FOCUS] bundle:[chromeRole="canvas", hasImage="true"] +++++++View text:"null" contentDescription:"Interactive fallback" clickable focusable actions:[FOCUS, CLICK, AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="link", clickableScore="300", roleDescription="link", targetUrl="file:///storage/emulated/0/chromium_tests_root/content/test/data/accessibility/html/canvas.html#"] +++++++++TextView text:"Interactive fallback" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="staticText"] \ No newline at end of file
diff --git a/content/test/data/accessibility/html/canvas-fallback-expected-android-external.txt b/content/test/data/accessibility/html/canvas-fallback-expected-android-external.txt new file mode 100644 index 0000000..019b0e83 --- /dev/null +++ b/content/test/data/accessibility/html/canvas-fallback-expected-android-external.txt
@@ -0,0 +1,15 @@ +WebView focusable focused scrollable actions:[CLEAR_FOCUS, AX_FOCUS] bundle:[chromeRole="rootWebArea", hasImage="true"] +++View actions:[AX_FOCUS] bundle:[chromeRole="genericContainer", hasImage="true"] +++++Image text:"Static fallback" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="canvas", hasImage="true"] +++++Image actions:[AX_FOCUS] bundle:[chromeRole="canvas", hasImage="true"] +++++++TextView text:"\n " actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="staticText"] +++++++TextView text:"Line breaking content in a fallback" viewIdResName:"p1" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="paragraph", hint="Aria hidden paragraph in fallback content"] +++++++TextView text:"\n " actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="staticText"] +++++++TextView text:"This is another paragraph in fallback" viewIdResName:"p2" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="paragraph", hint="Visibility hidden paragraph in fallback content"] +++++++TextView text:"\n " actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="staticText"] +++++++TextView text:"Aria hidden paragraph in fallback content" viewIdResName:"h1" notVisibleToUser CollectionItemInfo:[heading, rowIndex=0, rowSpan=0, colIndex=0, colSpan=0] actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="heading", roleDescription="heading 1"] +++++++TextView text:"\n " actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="staticText"] +++++++TextView text:"Display none text in fallback content " notVisibleToUser CollectionItemInfo:[heading, rowIndex=0, rowSpan=0, colIndex=0, colSpan=0] actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="heading", roleDescription="heading 1"] +++++++TextView text:"\n " actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="staticText"] +++++++TextView text:"Visibility hidden paragraph in fallback content" viewIdResName:"h2" notVisibleToUser CollectionItemInfo:[heading, rowIndex=0, rowSpan=0, colIndex=0, colSpan=0] actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="heading", roleDescription="heading 2"] +++++++TextView text:"\n " actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="staticText"] \ No newline at end of file
diff --git a/content/test/data/accessibility/html/caption-expected-android-external.txt b/content/test/data/accessibility/html/caption-expected-android-external.txt new file mode 100644 index 0000000..d4f7401 --- /dev/null +++ b/content/test/data/accessibility/html/caption-expected-android-external.txt
@@ -0,0 +1,17 @@ +WebView focusable focused scrollable actions:[CLEAR_FOCUS, AX_FOCUS] bundle:[chromeRole="rootWebArea"] +++GridView text:"Browser and Engine" CollectionInfo:[rows=3, cols=2] actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="table", roleDescription="table"] +++++View text:"Browser and Engine" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="caption"] +++++View actions:[AX_FOCUS] bundle:[chromeRole="row"] +++++++View text:"Browser" CollectionItemInfo:[heading, rowIndex=0, rowSpan=1, colIndex=0, colSpan=1] actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="columnHeader", roleDescription="column header"] +++++++View text:"Engine" CollectionItemInfo:[heading, rowIndex=0, rowSpan=1, colIndex=1, colSpan=1] actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="columnHeader", roleDescription="column header"] +++++View actions:[AX_FOCUS] bundle:[chromeRole="row"] +++++++View text:"Chrome" CollectionItemInfo:[rowIndex=1, rowSpan=1, colIndex=0, colSpan=1] actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="cell"] +++++++View text:"Blink" CollectionItemInfo:[rowIndex=1, rowSpan=1, colIndex=1, colSpan=1] actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="cell"] +++++View actions:[AX_FOCUS] bundle:[chromeRole="row"] +++++++View text:"Safari" CollectionItemInfo:[rowIndex=2, rowSpan=1, colIndex=0, colSpan=1] actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="cell"] +++++++View text:"WebKit" CollectionItemInfo:[rowIndex=2, rowSpan=1, colIndex=1, colSpan=1] actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="cell"] +++GridView text:"Name" CollectionInfo:[rows=1, cols=2] actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="table", hint="Description", roleDescription="table"] +++++View text:"Description" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="caption"] +++++View actions:[AX_FOCUS] bundle:[chromeRole="row"] +++++++View text:"A" CollectionItemInfo:[rowIndex=0, rowSpan=1, colIndex=0, colSpan=1] actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="cell"] +++++++View text:"B" CollectionItemInfo:[rowIndex=0, rowSpan=1, colIndex=1, colSpan=1] actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="cell"] \ No newline at end of file
diff --git a/content/test/data/accessibility/html/character-locations-expected-android-external.txt b/content/test/data/accessibility/html/character-locations-expected-android-external.txt new file mode 100644 index 0000000..3688f011 --- /dev/null +++ b/content/test/data/accessibility/html/character-locations-expected-android-external.txt
@@ -0,0 +1,9 @@ +WebView text:"Character Locations" focusable focused scrollable actions:[CLEAR_FOCUS, AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="rootWebArea", hasImage="true"] +++TextView text:"Heading" CollectionItemInfo:[heading, rowIndex=0, rowSpan=0, colIndex=0, colSpan=0] actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="heading", roleDescription="heading 1"] +++TextView text:"Paragraph" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="paragraph"] +++Button text:"Button" clickable focusable actions:[FOCUS, CLICK, AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="button", clickableScore="300", roleDescription="button"] +++EditText text:"Input" clickable editable focusable inputType:1 textSelectionStart:0 textSelectionEnd:0 actions:[FOCUS, CLICK, AX_FOCUS, NEXT, PREVIOUS, COPY, PASTE, CUT, SET_SELECTION, SET_TEXT, IME_ENTER] bundle:[chromeRole="textField", clickableScore="300"] +++EditText text:"Textarea" clickable editable focusable multiLine textSelectionStart:0 textSelectionEnd:0 actions:[FOCUS, CLICK, AX_FOCUS, NEXT, PREVIOUS, COPY, PASTE, CUT, SET_SELECTION, SET_TEXT, IME_ENTER] bundle:[chromeRole="textField", clickableScore="300"] +++Image text:"Image with alt text" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="image", hasImage="true", roleDescription="graphic"] +++View text:"null" contentDescription:"Image inside link" clickable focusable actions:[FOCUS, CLICK, AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="link", clickableScore="300", hasImage="true", roleDescription="link", targetUrl="file:///storage/emulated/0/chromium_tests_root/content/test/data/accessibility/html/character-locations.html#"] +++++Image text:"Image inside link" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="image", clickableScore="100", hasImage="true", roleDescription="graphic"] \ No newline at end of file
diff --git a/content/test/data/accessibility/html/checkbox-name-calc-expected-android-external.txt b/content/test/data/accessibility/html/checkbox-name-calc-expected-android-external.txt new file mode 100644 index 0000000..da6b79b --- /dev/null +++ b/content/test/data/accessibility/html/checkbox-name-calc-expected-android-external.txt
@@ -0,0 +1,22 @@ +WebView focusable focused scrollable actions:[CLEAR_FOCUS, AX_FOCUS] bundle:[chromeRole="rootWebArea"] +++CheckBox text:"Title0" viewIdResName:"c0" checkable clickable focusable actions:[FOCUS, CLICK, AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="checkBox", clickableScore="300", roleDescription="checkbox"] +++CheckBox text:"Label1" viewIdResName:"c1" checkable clickable focusable actions:[FOCUS, CLICK, AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="checkBox", clickableScore="300", hint="Title1", roleDescription="checkbox"] +++CheckBox text:"AriaLabel2" viewIdResName:"c2" checkable clickable focusable actions:[FOCUS, CLICK, AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="checkBox", clickableScore="300", hint="Title2", roleDescription="checkbox"] +++CheckBox text:"LabelledBy3" viewIdResName:"c3" checkable clickable focusable actions:[FOCUS, CLICK, AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="checkBox", clickableScore="300", hint="Title3", roleDescription="checkbox"] +++CheckBox text:"LabelledBy4" viewIdResName:"c4" checkable clickable focusable actions:[FOCUS, CLICK, AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="checkBox", clickableScore="300", hint="DescribedBy4", roleDescription="checkbox"] +++CheckBox viewIdResName:"c5" checkable clickable focusable actions:[FOCUS, CLICK, AX_FOCUS] bundle:[chromeRole="checkBox", clickableScore="300", hint="DescribedBy5", roleDescription="checkbox"] +++View actions:[AX_FOCUS] bundle:[chromeRole="paragraph"] +++++TextView text:" " actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="staticText"] +++++View text:"Label2" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="labelText"] +++++TextView text:" " actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="staticText"] +++++View text:"Label3" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="labelText"] +++++TextView text:" " actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="staticText"] +++++View text:"Label4" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="labelText"] +++++TextView text:" " actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="staticText"] +++++TextView text:"LabelledBy3" viewIdResName:"lb3" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="genericContainer"] +++++TextView text:" " actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="staticText"] +++++TextView text:"LabelledBy4" viewIdResName:"lb4" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="genericContainer"] +++++TextView text:" " actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="staticText"] +++++TextView text:"DescribedBy4" viewIdResName:"db4" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="genericContainer"] +++++TextView text:" " actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="staticText"] +++++TextView text:"DescribedBy5" viewIdResName:"db5" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="genericContainer"] \ No newline at end of file
diff --git a/content/test/data/accessibility/html/cite-expected-android-external.txt b/content/test/data/accessibility/html/cite-expected-android-external.txt new file mode 100644 index 0000000..2c2219c --- /dev/null +++ b/content/test/data/accessibility/html/cite-expected-android-external.txt
@@ -0,0 +1,3 @@ +WebView focusable focused scrollable actions:[CLEAR_FOCUS, AX_FOCUS] bundle:[chromeRole="rootWebArea", hasImage="true"] +++Image text:"Pipe" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="image", hasImage="true", roleDescription="graphic", targetUrl="file:///storage/emulated/0/chromium_tests_root/content/test/data/accessibility/html/pipe.jpg"] +++TextView text:"The pipe clicked by SomeOne." actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="paragraph"] \ No newline at end of file
diff --git a/content/test/data/accessibility/html/clickable-ancestor-expected-android-external.txt b/content/test/data/accessibility/html/clickable-ancestor-expected-android-external.txt new file mode 100644 index 0000000..b7e66e4 --- /dev/null +++ b/content/test/data/accessibility/html/clickable-ancestor-expected-android-external.txt
@@ -0,0 +1,6 @@ +WebView text:"Checking nodes marked as clickable" focusable focused scrollable actions:[CLEAR_FOCUS, AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="rootWebArea"] +++TextView text:"Generic div" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="genericContainer"] +++TextView text:"Heading" CollectionItemInfo:[heading, rowIndex=0, rowSpan=0, colIndex=0, colSpan=0] actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="heading", roleDescription="heading 1"] +++Button text:"Button" clickable focusable actions:[FOCUS, CLICK, AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="button", clickableScore="300", roleDescription="button"] +++View clickable actions:[CLICK, AX_FOCUS] bundle:[chromeRole="group", clickableScore="200"] +++++TextView text:"Paragraph with click handler on parent and should be not marked as clickable" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="paragraph", clickableScore="100"] \ No newline at end of file
diff --git a/content/test/data/accessibility/html/code-expected-android-external.txt b/content/test/data/accessibility/html/code-expected-android-external.txt new file mode 100644 index 0000000..4a33aaaa --- /dev/null +++ b/content/test/data/accessibility/html/code-expected-android-external.txt
@@ -0,0 +1,2 @@ +WebView focusable focused scrollable actions:[CLEAR_FOCUS, AX_FOCUS] bundle:[chromeRole="rootWebArea"] +++TextView text:"A piece of computer code" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="genericContainer"] \ No newline at end of file
diff --git a/content/test/data/accessibility/html/col-expected-android-external.txt b/content/test/data/accessibility/html/col-expected-android-external.txt new file mode 100644 index 0000000..ef0a92c5 --- /dev/null +++ b/content/test/data/accessibility/html/col-expected-android-external.txt
@@ -0,0 +1,8 @@ +WebView focusable focused scrollable actions:[CLEAR_FOCUS, AX_FOCUS] bundle:[chromeRole="rootWebArea"] +++GridView CollectionInfo:[rows=2, cols=2] actions:[AX_FOCUS] bundle:[chromeRole="table", roleDescription="table"] +++++View actions:[AX_FOCUS] bundle:[chromeRole="row"] +++++++View text:"Browser" CollectionItemInfo:[heading, rowIndex=0, rowSpan=1, colIndex=0, colSpan=1] actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="columnHeader", roleDescription="column header"] +++++++View text:"Rendering Engine" CollectionItemInfo:[heading, rowIndex=0, rowSpan=1, colIndex=1, colSpan=1] actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="columnHeader", roleDescription="column header"] +++++View actions:[AX_FOCUS] bundle:[chromeRole="row"] +++++++View text:"Chrome" CollectionItemInfo:[rowIndex=1, rowSpan=1, colIndex=0, colSpan=1] actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="cell"] +++++++View text:"Blink" CollectionItemInfo:[rowIndex=1, rowSpan=1, colIndex=1, colSpan=1] actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="cell"] \ No newline at end of file
diff --git a/content/test/data/accessibility/html/colgroup-expected-android-external.txt b/content/test/data/accessibility/html/colgroup-expected-android-external.txt new file mode 100644 index 0000000..eef87a0 --- /dev/null +++ b/content/test/data/accessibility/html/colgroup-expected-android-external.txt
@@ -0,0 +1,8 @@ +WebView focusable focused scrollable actions:[CLEAR_FOCUS, AX_FOCUS] bundle:[chromeRole="rootWebArea"] +++GridView CollectionInfo:[rows=2, cols=2] actions:[AX_FOCUS] bundle:[chromeRole="table", roleDescription="table"] +++++View actions:[AX_FOCUS] bundle:[chromeRole="row"] +++++++View text:"Single" CollectionItemInfo:[heading, rowIndex=0, rowSpan=1, colIndex=0, colSpan=1] actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="columnHeader", roleDescription="column header"] +++++++View text:"Pair" CollectionItemInfo:[heading, rowIndex=0, rowSpan=1, colIndex=1, colSpan=1] actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="columnHeader", roleDescription="column header"] +++++View actions:[AX_FOCUS] bundle:[chromeRole="row"] +++++++View text:"A" CollectionItemInfo:[rowIndex=1, rowSpan=1, colIndex=0, colSpan=1] actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="cell"] +++++++View text:"AA" CollectionItemInfo:[rowIndex=1, rowSpan=1, colIndex=1, colSpan=1] actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="cell"] \ No newline at end of file
diff --git a/content/test/data/accessibility/html/combobox-optgroup-expected-android-external.txt b/content/test/data/accessibility/html/combobox-optgroup-expected-android-external.txt new file mode 100644 index 0000000..ed230ff1 --- /dev/null +++ b/content/test/data/accessibility/html/combobox-optgroup-expected-android-external.txt
@@ -0,0 +1,3 @@ +WebView focusable focused scrollable actions:[CLEAR_FOCUS, AX_FOCUS] bundle:[chromeRole="rootWebArea"] +++View actions:[AX_FOCUS] bundle:[chromeRole="genericContainer"] +++++View text:"Mercedes Label" canOpenPopUp clickable focusable actions:[FOCUS, CLICK, AX_FOCUS, NEXT, PREVIOUS, EXPAND] bundle:[chromeRole="popUpButton", clickableScore="300", roleDescription="menu pop up button"] \ No newline at end of file
diff --git a/content/test/data/accessibility/html/contenteditable-descendants-expected-android-external.txt b/content/test/data/accessibility/html/contenteditable-descendants-expected-android-external.txt new file mode 100644 index 0000000..2bc4b611b --- /dev/null +++ b/content/test/data/accessibility/html/contenteditable-descendants-expected-android-external.txt
@@ -0,0 +1,20 @@ +WebView focusable focused scrollable actions:[CLEAR_FOCUS, AX_FOCUS] bundle:[chromeRole="rootWebArea", hasImage="true"] +++EditText text:"A contenteditable with a link and an and a .\n\nAlways expose editable tables as tables.\nEditable list item." clickable editable focusable multiLine textSelectionStart:0 textSelectionEnd:0 actions:[FOCUS, CLICK, AX_FOCUS, NEXT, PREVIOUS, COPY, PASTE, CUT, SET_SELECTION, SET_TEXT, IME_ENTER] bundle:[chromeRole="genericContainer", clickableScore="200", hasImage="true"] +++++View actions:[AX_FOCUS] bundle:[chromeRole="paragraph", clickableScore="100", hasImage="true"] +++++++TextView text:"A contenteditable with a " actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="staticText"] +++++++View text:"null" contentDescription:"link" clickable actions:[CLICK, AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="link", clickableScore="300", roleDescription="link", targetUrl="file:///storage/emulated/0/chromium_tests_root/content/test/data/accessibility/html/contenteditable-descendants.html#"] +++++++++TextView text:"link" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="staticText"] +++++++TextView text:" and an " actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="staticText"] +++++++Image text:"Image" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="image", clickableScore="100", hasImage="true", roleDescription="graphic"] +++++++TextView text:" and a " actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="staticText"] +++++++Button text:"Button" clickable focusable actions:[FOCUS, CLICK, AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="button", clickableScore="300", roleDescription="button"] +++++++TextView text:"." actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="staticText"] +++++GridView CollectionInfo:[rows=1, cols=1] actions:[AX_FOCUS] bundle:[chromeRole="table", clickableScore="100", roleDescription="table"] +++++++View actions:[AX_FOCUS] bundle:[chromeRole="row", clickableScore="100"] +++++++++View text:"Always expose editable tables as tables." CollectionItemInfo:[rowIndex=0, rowSpan=1, colIndex=0, colSpan=1] actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="cell", clickableScore="100"] +++++ListView CollectionInfo:[rows=1, cols=0] actions:[AX_FOCUS] bundle:[chromeRole="list", clickableScore="100"] +++++++View CollectionItemInfo:[rowIndex=0, rowSpan=0, colIndex=0, colSpan=0] actions:[AX_FOCUS] bundle:[chromeRole="listItem", clickableScore="100"] +++++++++View text:"1. " actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="listMarker", clickableScore="100"] +++++++++TextView text:"Editable list item." actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="staticText"] +++TextView text:"Non-editable paragraph." actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="paragraph"] +++EditText text:"Should keep the role but change the state." clickable editable focusable multiLine textSelectionStart:0 textSelectionEnd:0 actions:[FOCUS, CLICK, AX_FOCUS, NEXT, PREVIOUS, COPY, PASTE, CUT, SET_SELECTION, SET_TEXT, IME_ENTER] bundle:[chromeRole="paragraph", clickableScore="200"] \ No newline at end of file
diff --git a/content/test/data/accessibility/html/contenteditable-with-embedded-contenteditables-expected-android-external.txt b/content/test/data/accessibility/html/contenteditable-with-embedded-contenteditables-expected-android-external.txt new file mode 100644 index 0000000..e02f8ad --- /dev/null +++ b/content/test/data/accessibility/html/contenteditable-with-embedded-contenteditables-expected-android-external.txt
@@ -0,0 +1,7 @@ +WebView focusable focused scrollable actions:[CLEAR_FOCUS, AX_FOCUS] bundle:[chromeRole="rootWebArea"] +++EditText text:"This is editable.\n\nThis is not editable.\n\n\nBut this one is.\n\nSo is this one." clickable editable focusable multiLine textSelectionStart:0 textSelectionEnd:0 actions:[FOCUS, CLICK, AX_FOCUS, NEXT, PREVIOUS, COPY, PASTE, CUT, SET_SELECTION, SET_TEXT, IME_ENTER] bundle:[chromeRole="genericContainer", clickableScore="200"] +++++TextView text:"This is editable." actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="paragraph", clickableScore="100"] +++++TextView text:"This is not editable." actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="staticText"] +++++View text:"\n" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="lineBreak", clickableScore="100"] +++++EditText text:"But this one is." clickable editable focusable multiLine textSelectionStart:0 textSelectionEnd:0 actions:[FOCUS, CLICK, AX_FOCUS, NEXT, PREVIOUS, COPY, PASTE, CUT, SET_SELECTION, SET_TEXT, IME_ENTER] bundle:[chromeRole="paragraph", clickableScore="200"] +++++EditText text:"So is this one." clickable editable multiLine textSelectionStart:0 textSelectionEnd:0 actions:[CLICK, AX_FOCUS, NEXT, PREVIOUS, COPY, PASTE, CUT, SET_SELECTION, SET_TEXT, IME_ENTER] bundle:[chromeRole="paragraph", clickableScore="200"] \ No newline at end of file
diff --git a/content/test/data/accessibility/html/contenteditable-with-no-descendants-expected-android-external.txt b/content/test/data/accessibility/html/contenteditable-with-no-descendants-expected-android-external.txt new file mode 100644 index 0000000..3ad28d27 --- /dev/null +++ b/content/test/data/accessibility/html/contenteditable-with-no-descendants-expected-android-external.txt
@@ -0,0 +1,5 @@ +WebView focusable focused scrollable actions:[CLEAR_FOCUS, AX_FOCUS] bundle:[chromeRole="rootWebArea"] +++EditText clickable editable focusable multiLine textSelectionStart:0 textSelectionEnd:0 actions:[FOCUS, CLICK, AX_FOCUS, PASTE, SET_TEXT, IME_ENTER] bundle:[chromeRole="genericContainer", clickableScore="200", hint="label"] +++EditText clickable editable focusable multiLine textSelectionStart:0 textSelectionEnd:0 actions:[FOCUS, CLICK, AX_FOCUS, PASTE, SET_TEXT, IME_ENTER] bundle:[chromeRole="genericContainer", clickableScore="200", hint="description"] +++EditText clickable editable focusable multiLine textSelectionStart:0 textSelectionEnd:0 actions:[FOCUS, CLICK, AX_FOCUS, PASTE, SET_TEXT, IME_ENTER] bundle:[chromeRole="genericContainer", clickableScore="200", hint="title"] +++TextView text:"description" viewIdResName:"description" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="paragraph"] \ No newline at end of file
diff --git a/content/test/data/accessibility/html/continuations-expected-android-external.txt b/content/test/data/accessibility/html/continuations-expected-android-external.txt new file mode 100644 index 0000000..90be058 --- /dev/null +++ b/content/test/data/accessibility/html/continuations-expected-android-external.txt
@@ -0,0 +1,25 @@ +WebView focusable focused scrollable actions:[CLEAR_FOCUS, AX_FOCUS] bundle:[chromeRole="rootWebArea"] +++View text:"Group 1" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="group"] +++++View actions:[AX_FOCUS] bundle:[chromeRole="genericContainer"] +++++++Button text:"Before" viewIdResName:"before" clickable focusable actions:[FOCUS, CLICK, AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="button", clickableScore="300", roleDescription="button"] +++++TextView text:"After" viewIdResName:"after" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="genericContainer"] +++View text:"Group 2" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="group"] +++++TextView text:"Before" viewIdResName:"before" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="genericContainer"] +++++TextView text:"After" viewIdResName:"after" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="genericContainer"] +++View text:"Group 3" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="group"] +++++View actions:[AX_FOCUS] bundle:[chromeRole="genericContainer"] +++++++TextView text:"Before" viewIdResName:"before" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="genericContainer"] +++++View viewIdResName:"ever" actions:[AX_FOCUS] bundle:[chromeRole="genericContainer"] +++++++TextView text:"Ever " actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="genericContainer"] +++++++View text:"null" contentDescription:"After" viewIdResName:"after" clickable focusable actions:[FOCUS, CLICK, AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="link", clickableScore="300", roleDescription="link", targetUrl="file:///storage/emulated/0/chromium_tests_root/content/test/data/accessibility/html/continuations.html#"] +++++++++TextView text:"After" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="staticText"] +++View text:"Group 4" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="group"] +++++TextView text:"Before" viewIdResName:"before" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="genericContainer"] +++++TextView text:"After" viewIdResName:"after" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="paragraph"] +++View text:"Group 5" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="group"] +++++TextView text:"Italic only " actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="staticText"] +++++TextView text:"italic and bold" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="staticText"] +++++TextView text:"Wow, a block!" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="genericContainer"] +++++TextView text:"Wow, another block!" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="genericContainer"] +++++TextView text:"More italic and bold text" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="staticText"] +++++TextView text:" More italic text" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="staticText"] \ No newline at end of file
diff --git a/content/test/data/accessibility/html/dd-expected-android-external.txt b/content/test/data/accessibility/html/dd-expected-android-external.txt new file mode 100644 index 0000000..4f5bfc9 --- /dev/null +++ b/content/test/data/accessibility/html/dd-expected-android-external.txt
@@ -0,0 +1,4 @@ +WebView focusable focused scrollable actions:[CLEAR_FOCUS, AX_FOCUS] bundle:[chromeRole="rootWebArea"] +++ListView CollectionInfo:[rows=1, cols=0] actions:[AX_FOCUS] bundle:[chromeRole="descriptionList"] +++++View text:"Coffee" CollectionItemInfo:[rowIndex=0, rowSpan=0, colIndex=0, colSpan=0] actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="descriptionListTerm"] +++++View text:"Black hot drink" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="descriptionListDetail", roleDescription="definition"] \ No newline at end of file
diff --git a/content/test/data/accessibility/html/del-expected-android-external.txt b/content/test/data/accessibility/html/del-expected-android-external.txt new file mode 100644 index 0000000..254b5957 --- /dev/null +++ b/content/test/data/accessibility/html/del-expected-android-external.txt
@@ -0,0 +1,4 @@ +WebView focusable focused scrollable actions:[CLEAR_FOCUS, AX_FOCUS] bundle:[chromeRole="rootWebArea"] +++View actions:[AX_FOCUS] bundle:[chromeRole="paragraph"] +++++TextView text:"I am " actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="staticText"] +++++View text:"vegetarian" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="contentDeletion", roleDescription="deletion"] \ No newline at end of file
diff --git a/content/test/data/accessibility/html/details-expected-android-external.txt b/content/test/data/accessibility/html/details-expected-android-external.txt new file mode 100644 index 0000000..fd2b4fb3 --- /dev/null +++ b/content/test/data/accessibility/html/details-expected-android-external.txt
@@ -0,0 +1,6 @@ +WebView focusable focused scrollable actions:[CLEAR_FOCUS, AX_FOCUS] bundle:[chromeRole="rootWebArea"] +++View actions:[AX_FOCUS] bundle:[chromeRole="details"] +++++View text:"details tag" clickable focusable actions:[FOCUS, CLICK, AX_FOCUS, NEXT, PREVIOUS, EXPAND] bundle:[chromeRole="disclosureTriangle", clickableScore="300", roleDescription="disclosure triangle"] +++View actions:[AX_FOCUS] bundle:[chromeRole="details"] +++++View text:"details tag open" clickable focusable actions:[FOCUS, CLICK, AX_FOCUS, NEXT, PREVIOUS, COLLAPSE] bundle:[chromeRole="disclosureTriangle", clickableScore="300", roleDescription="disclosure triangle"] +++++TextView text:"The details tag with open specifies that the details should be visible (open) to the user." actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="paragraph"] \ No newline at end of file
diff --git a/content/test/data/accessibility/html/dfn-expected-android-external.txt b/content/test/data/accessibility/html/dfn-expected-android-external.txt new file mode 100644 index 0000000..96ee515 --- /dev/null +++ b/content/test/data/accessibility/html/dfn-expected-android-external.txt
@@ -0,0 +1,2 @@ +WebView focusable focused scrollable actions:[CLEAR_FOCUS, AX_FOCUS] bundle:[chromeRole="rootWebArea"] +++TextView text:"Web Browser A computer program with a graphical user interface for displaying HTML files, used to navigate the World Wide Web." actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="genericContainer"] \ No newline at end of file
diff --git a/content/test/data/accessibility/html/dialog-expected-android-external.txt b/content/test/data/accessibility/html/dialog-expected-android-external.txt new file mode 100644 index 0000000..9f74902 --- /dev/null +++ b/content/test/data/accessibility/html/dialog-expected-android-external.txt
@@ -0,0 +1,2 @@ +WebView focusable focused scrollable actions:[CLEAR_FOCUS, AX_FOCUS] bundle:[chromeRole="rootWebArea"] +++Dialog text:"Text in dialog" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="dialog", roleDescription="dialog"] \ No newline at end of file
diff --git a/content/test/data/accessibility/html/disabled-expected-android-external.txt b/content/test/data/accessibility/html/disabled-expected-android-external.txt new file mode 100644 index 0000000..4aaebb5 --- /dev/null +++ b/content/test/data/accessibility/html/disabled-expected-android-external.txt
@@ -0,0 +1,13 @@ +WebView focusable focused scrollable actions:[CLEAR_FOCUS, AX_FOCUS] bundle:[chromeRole="rootWebArea"] +++CheckBox text:"Enabled" checkable clickable focusable actions:[FOCUS, CLICK, AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="checkBox", clickableScore="300", roleDescription="checkbox"] +++CheckBox text:"Disabled" checkable clickable disabled actions:[CLICK, AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="checkBox", roleDescription="checkbox"] +++Button text:"Enabled" clickable focusable actions:[FOCUS, CLICK, AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="button", clickableScore="300", roleDescription="button"] +++Button text:"Disabled" clickable disabled actions:[CLICK, AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="button", roleDescription="button"] +++View actions:[AX_FOCUS] bundle:[chromeRole="section"] +++++TextView text:"Enabled form " actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="staticText"] +++++CheckBox text:"Checkbox" checkable clickable focusable actions:[FOCUS, CLICK, AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="checkBox", clickableScore="300", roleDescription="checkbox"] +++++Button text:"Button" clickable focusable actions:[FOCUS, CLICK, AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="button", clickableScore="300", roleDescription="button"] +++View disabled actions:[AX_FOCUS] bundle:[chromeRole="section"] +++++TextView text:"Disabled form " actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="staticText"] +++++CheckBox text:"Checkbox" checkable clickable disabled focusable actions:[FOCUS, CLICK, AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="checkBox", roleDescription="checkbox"] +++++Button text:"Button" clickable disabled focusable actions:[FOCUS, CLICK, AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="button", roleDescription="button"] \ No newline at end of file
diff --git a/content/test/data/accessibility/html/div-expected-android-external.txt b/content/test/data/accessibility/html/div-expected-android-external.txt new file mode 100644 index 0000000..eb2bcef --- /dev/null +++ b/content/test/data/accessibility/html/div-expected-android-external.txt
@@ -0,0 +1,3 @@ +WebView focusable focused scrollable actions:[CLEAR_FOCUS, AX_FOCUS] bundle:[chromeRole="rootWebArea"] +++TextView text:"Unfocusable div" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="genericContainer"] +++TextView text:"Focusable div" focusable actions:[FOCUS, AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="genericContainer"] \ No newline at end of file
diff --git a/content/test/data/accessibility/html/dl-expected-android-external.txt b/content/test/data/accessibility/html/dl-expected-android-external.txt new file mode 100644 index 0000000..70f14d0 --- /dev/null +++ b/content/test/data/accessibility/html/dl-expected-android-external.txt
@@ -0,0 +1,5 @@ +WebView focusable focused scrollable actions:[CLEAR_FOCUS, AX_FOCUS] bundle:[chromeRole="rootWebArea"] +++ListView CollectionInfo:[rows=1, cols=0] actions:[AX_FOCUS] bundle:[chromeRole="descriptionList"] +++++View text:"Term" CollectionItemInfo:[rowIndex=0, rowSpan=0, colIndex=0, colSpan=0] actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="descriptionListTerm"] +++++View text:"Description" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="descriptionListDetail", roleDescription="definition"] +++View text:"Definition" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="definition", roleDescription="definition"] \ No newline at end of file
diff --git a/content/test/data/accessibility/html/dt-expected-android-external.txt b/content/test/data/accessibility/html/dt-expected-android-external.txt new file mode 100644 index 0000000..4f5bfc9 --- /dev/null +++ b/content/test/data/accessibility/html/dt-expected-android-external.txt
@@ -0,0 +1,4 @@ +WebView focusable focused scrollable actions:[CLEAR_FOCUS, AX_FOCUS] bundle:[chromeRole="rootWebArea"] +++ListView CollectionInfo:[rows=1, cols=0] actions:[AX_FOCUS] bundle:[chromeRole="descriptionList"] +++++View text:"Coffee" CollectionItemInfo:[rowIndex=0, rowSpan=0, colIndex=0, colSpan=0] actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="descriptionListTerm"] +++++View text:"Black hot drink" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="descriptionListDetail", roleDescription="definition"] \ No newline at end of file
diff --git a/content/test/data/accessibility/html/element-class-id-src-attr-expected-android-external.txt b/content/test/data/accessibility/html/element-class-id-src-attr-expected-android-external.txt new file mode 100644 index 0000000..7b0e8ef --- /dev/null +++ b/content/test/data/accessibility/html/element-class-id-src-attr-expected-android-external.txt
@@ -0,0 +1,3 @@ +WebView focusable focused scrollable actions:[CLEAR_FOCUS, AX_FOCUS] bundle:[chromeRole="rootWebArea", hasImage="true"] +++TextView text:"Image" viewIdResName:"headerID" CollectionItemInfo:[heading, rowIndex=0, rowSpan=0, colIndex=0, colSpan=0] actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="heading", roleDescription="heading 1"] +++Image text:"ImageAlt" viewIdResName:"imageID" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="image", hasImage="true", roleDescription="graphic", targetUrl="file:///storage/emulated/0/chromium_tests_root/content/test/data/accessibility/html/greenbox.png"] \ No newline at end of file
diff --git a/content/test/data/accessibility/html/em-expected-android-external.txt b/content/test/data/accessibility/html/em-expected-android-external.txt new file mode 100644 index 0000000..63717d27 --- /dev/null +++ b/content/test/data/accessibility/html/em-expected-android-external.txt
@@ -0,0 +1,2 @@ +WebView focusable focused scrollable actions:[CLEAR_FOCUS, AX_FOCUS] bundle:[chromeRole="rootWebArea"] +++TextView text:"One word is emphasized." actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="genericContainer"] \ No newline at end of file
diff --git a/content/test/data/accessibility/html/embed-expected-android-external.txt b/content/test/data/accessibility/html/embed-expected-android-external.txt new file mode 100644 index 0000000..9d80d01 --- /dev/null +++ b/content/test/data/accessibility/html/embed-expected-android-external.txt
@@ -0,0 +1,3 @@ +WebView focusable focused scrollable actions:[CLEAR_FOCUS, AX_FOCUS] bundle:[chromeRole="rootWebArea"] +++View actions:[AX_FOCUS] bundle:[chromeRole="genericContainer"] +++++View actions:[AX_FOCUS] bundle:[chromeRole="embeddedObject", roleDescription="object"] \ No newline at end of file
diff --git a/content/test/data/accessibility/html/fieldset-expected-android-external.txt b/content/test/data/accessibility/html/fieldset-expected-android-external.txt new file mode 100644 index 0000000..4a691544 --- /dev/null +++ b/content/test/data/accessibility/html/fieldset-expected-android-external.txt
@@ -0,0 +1,7 @@ +WebView focusable focused scrollable actions:[CLEAR_FOCUS, AX_FOCUS] bundle:[chromeRole="rootWebArea"] +++View actions:[AX_FOCUS] bundle:[chromeRole="section"] +++++View text:"Browser Engines:" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="group"] +++++++View text:"Browser Engines:" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="legend"] +++View text:"Which cake do you prefer?" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="group"] +++++View actions:[AX_FOCUS] bundle:[chromeRole="legend"] +++++++TextView text:"Which cake do you prefer?" CollectionItemInfo:[heading, rowIndex=0, rowSpan=0, colIndex=0, colSpan=0] actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="heading", roleDescription="heading 2"] \ No newline at end of file
diff --git a/content/test/data/accessibility/html/figcaption-expected-android-external.txt b/content/test/data/accessibility/html/figcaption-expected-android-external.txt new file mode 100644 index 0000000..d7fda8e --- /dev/null +++ b/content/test/data/accessibility/html/figcaption-expected-android-external.txt
@@ -0,0 +1,4 @@ +WebView focusable focused scrollable actions:[CLEAR_FOCUS, AX_FOCUS] bundle:[chromeRole="rootWebArea", hasImage="true"] +++View text:"Fig.1 - A green Box" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="figure", hasImage="true", roleDescription="graphic"] +++++Image text:"This is a green box." actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="image", hasImage="true", roleDescription="graphic", targetUrl="file:///storage/emulated/0/chromium_tests_root/content/test/data/accessibility/html/greenbox.png"] +++++View text:"Fig.1 - A green Box" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="figcaption"] \ No newline at end of file
diff --git a/content/test/data/accessibility/html/figure-expected-android-external.txt b/content/test/data/accessibility/html/figure-expected-android-external.txt new file mode 100644 index 0000000..e3d7c99 --- /dev/null +++ b/content/test/data/accessibility/html/figure-expected-android-external.txt
@@ -0,0 +1,3 @@ +WebView focusable focused scrollable actions:[CLEAR_FOCUS, AX_FOCUS] bundle:[chromeRole="rootWebArea", hasImage="true"] +++View actions:[AX_FOCUS] bundle:[chromeRole="figure", hasImage="true", roleDescription="graphic"] +++++Image text:"Sunspots" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="image", hasImage="true", roleDescription="graphic", targetUrl="file:///storage/emulated/0/chromium_tests_root/content/test/data/accessibility/html/pipe.jpg"] \ No newline at end of file
diff --git a/content/test/data/accessibility/html/fixed-width-text-expected-android-external.txt b/content/test/data/accessibility/html/fixed-width-text-expected-android-external.txt new file mode 100644 index 0000000..14ad851 --- /dev/null +++ b/content/test/data/accessibility/html/fixed-width-text-expected-android-external.txt
@@ -0,0 +1,2 @@ +WebView focusable focused scrollable actions:[CLEAR_FOCUS, AX_FOCUS] bundle:[chromeRole="rootWebArea"] +++TextView text:"Hello,\nWorld" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="paragraph"] \ No newline at end of file
diff --git a/content/test/data/accessibility/html/footer-expected-android-external.txt b/content/test/data/accessibility/html/footer-expected-android-external.txt new file mode 100644 index 0000000..013110c --- /dev/null +++ b/content/test/data/accessibility/html/footer-expected-android-external.txt
@@ -0,0 +1,2 @@ +WebView focusable focused scrollable actions:[CLEAR_FOCUS, AX_FOCUS] bundle:[chromeRole="rootWebArea"] +++View text:"Footer element" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="footer", roleDescription="footer"] \ No newline at end of file
diff --git a/content/test/data/accessibility/html/footer-inside-other-section-expected-android-external.txt b/content/test/data/accessibility/html/footer-inside-other-section-expected-android-external.txt new file mode 100644 index 0000000..b01c29f --- /dev/null +++ b/content/test/data/accessibility/html/footer-inside-other-section-expected-android-external.txt
@@ -0,0 +1,10 @@ +WebView focusable focused scrollable actions:[CLEAR_FOCUS, AX_FOCUS] bundle:[chromeRole="rootWebArea"] +++View actions:[AX_FOCUS] bundle:[chromeRole="article", roleDescription="article"] +++++View actions:[AX_FOCUS] bundle:[chromeRole="footerAsNonLandmark"] +++++++TextView text:"footer inside article." actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="paragraph"] +++View actions:[AX_FOCUS] bundle:[chromeRole="section"] +++++View actions:[AX_FOCUS] bundle:[chromeRole="footerAsNonLandmark"] +++++++TextView text:"footer inside section." actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="paragraph"] +++View actions:[AX_FOCUS] bundle:[chromeRole="main", roleDescription="main"] +++++View actions:[AX_FOCUS] bundle:[chromeRole="footerAsNonLandmark"] +++++++TextView text:"footer inside main." actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="paragraph"] \ No newline at end of file
diff --git a/content/test/data/accessibility/html/form-expected-android-external.txt b/content/test/data/accessibility/html/form-expected-android-external.txt new file mode 100644 index 0000000..4440ddfb --- /dev/null +++ b/content/test/data/accessibility/html/form-expected-android-external.txt
@@ -0,0 +1,5 @@ +WebView focusable focused scrollable actions:[CLEAR_FOCUS, AX_FOCUS] bundle:[chromeRole="rootWebArea"] +++View actions:[AX_FOCUS] bundle:[chromeRole="section"] +++++Button text:"Submit" clickable focusable actions:[FOCUS, CLICK, AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="button", clickableScore="300", roleDescription="button"] +++View text:"Name" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="form"] +++++Button text:"Submit" clickable focusable actions:[FOCUS, CLICK, AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="button", clickableScore="300", roleDescription="button"] \ No newline at end of file
diff --git a/content/test/data/accessibility/html/frameset-expected-android-external.txt b/content/test/data/accessibility/html/frameset-expected-android-external.txt new file mode 100644 index 0000000..f735a4c9b --- /dev/null +++ b/content/test/data/accessibility/html/frameset-expected-android-external.txt
@@ -0,0 +1,15 @@ +WebView focusable focused scrollable actions:[CLEAR_FOCUS, AX_FOCUS] bundle:[chromeRole="rootWebArea"] +++View actions:[AX_FOCUS] bundle:[chromeRole="iframe"] +++++View scrollable actions:[AX_FOCUS] bundle:[chromeRole="rootWebArea"] +++++++View actions:[AX_FOCUS] bundle:[chromeRole="paragraph"] +++++++++TextView text:"My favorite browser is " actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="staticText"] +++++++++View text:"ABC" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="contentDeletion", roleDescription="deletion"] +++++++++TextView text:" " actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="staticText"] +++++++++View text:"Chrome" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="contentInsertion", roleDescription="insertion"] +++++++++TextView text:"!" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="staticText"] +++View actions:[AX_FOCUS] bundle:[chromeRole="iframe"] +++++View scrollable actions:[AX_FOCUS] bundle:[chromeRole="rootWebArea"] +++++++View actions:[AX_FOCUS] bundle:[chromeRole="paragraph"] +++++++++TextView text:"This test is to check " actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="staticText"] +++++++++View text:"mark tag" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="mark", roleDescription="highlight"] +++++++++TextView text:"." actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="staticText"] \ No newline at end of file
diff --git a/content/test/data/accessibility/html/header-expected-android-external.txt b/content/test/data/accessibility/html/header-expected-android-external.txt new file mode 100644 index 0000000..39b47beb --- /dev/null +++ b/content/test/data/accessibility/html/header-expected-android-external.txt
@@ -0,0 +1,2 @@ +WebView focusable focused scrollable actions:[CLEAR_FOCUS, AX_FOCUS] bundle:[chromeRole="rootWebArea"] +++View text:"Chromium Browser" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="header", roleDescription="banner"] \ No newline at end of file
diff --git a/content/test/data/accessibility/html/header-inside-other-section-expected-android-external.txt b/content/test/data/accessibility/html/header-inside-other-section-expected-android-external.txt new file mode 100644 index 0000000..a7cd68f --- /dev/null +++ b/content/test/data/accessibility/html/header-inside-other-section-expected-android-external.txt
@@ -0,0 +1,10 @@ +WebView focusable focused scrollable actions:[CLEAR_FOCUS, AX_FOCUS] bundle:[chromeRole="rootWebArea"] +++View actions:[AX_FOCUS] bundle:[chromeRole="article", roleDescription="article"] +++++View actions:[AX_FOCUS] bundle:[chromeRole="headerAsNonLandmark"] +++++++TextView text:"Header inside article." actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="paragraph"] +++View actions:[AX_FOCUS] bundle:[chromeRole="section"] +++++View actions:[AX_FOCUS] bundle:[chromeRole="headerAsNonLandmark"] +++++++TextView text:"Header inside section." actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="paragraph"] +++View actions:[AX_FOCUS] bundle:[chromeRole="main", roleDescription="main"] +++++View actions:[AX_FOCUS] bundle:[chromeRole="headerAsNonLandmark"] +++++++TextView text:"Header inside main." actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="paragraph"] \ No newline at end of file
diff --git a/content/test/data/accessibility/html/heading-expected-android-external.txt b/content/test/data/accessibility/html/heading-expected-android-external.txt new file mode 100644 index 0000000..f8ecfc1 --- /dev/null +++ b/content/test/data/accessibility/html/heading-expected-android-external.txt
@@ -0,0 +1,7 @@ +WebView focusable focused scrollable actions:[CLEAR_FOCUS, AX_FOCUS] bundle:[chromeRole="rootWebArea"] +++TextView text:"Heading 1" CollectionItemInfo:[heading, rowIndex=0, rowSpan=0, colIndex=0, colSpan=0] actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="heading", roleDescription="heading 1"] +++TextView text:"Heading 2" CollectionItemInfo:[heading, rowIndex=0, rowSpan=0, colIndex=0, colSpan=0] actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="heading", roleDescription="heading 2"] +++TextView text:"Heading 3" CollectionItemInfo:[heading, rowIndex=0, rowSpan=0, colIndex=0, colSpan=0] actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="heading", roleDescription="heading 3"] +++TextView text:"Heading 4" CollectionItemInfo:[heading, rowIndex=0, rowSpan=0, colIndex=0, colSpan=0] actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="heading", roleDescription="heading 4"] +++TextView text:"Heading 5" CollectionItemInfo:[heading, rowIndex=0, rowSpan=0, colIndex=0, colSpan=0] actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="heading", roleDescription="heading 5"] +++TextView text:"Heading 6" CollectionItemInfo:[heading, rowIndex=0, rowSpan=0, colIndex=0, colSpan=0] actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="heading", roleDescription="heading 6"] \ No newline at end of file
diff --git a/content/test/data/accessibility/html/heading-with-tabIndex-expected-android-external.txt b/content/test/data/accessibility/html/heading-with-tabIndex-expected-android-external.txt new file mode 100644 index 0000000..080f43f --- /dev/null +++ b/content/test/data/accessibility/html/heading-with-tabIndex-expected-android-external.txt
@@ -0,0 +1,5 @@ +WebView focusable focused scrollable actions:[CLEAR_FOCUS, AX_FOCUS] bundle:[chromeRole="rootWebArea"] +++TextView text:"Heading 2, no tabIndex" CollectionItemInfo:[heading, rowIndex=0, rowSpan=0, colIndex=0, colSpan=0] actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="heading", roleDescription="heading 2"] +++TextView text:"Heading 1, tabIndex of negative 1" focusable CollectionItemInfo:[heading, rowIndex=0, rowSpan=0, colIndex=0, colSpan=0] actions:[FOCUS, AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="heading", roleDescription="heading 1"] +++TextView text:"Heading 3, tabIndex of 0" focusable CollectionItemInfo:[heading, rowIndex=0, rowSpan=0, colIndex=0, colSpan=0] actions:[FOCUS, AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="heading", roleDescription="heading 3"] +++TextView text:"Heading 4, tabIndex of 1" focusable CollectionItemInfo:[heading, rowIndex=0, rowSpan=0, colIndex=0, colSpan=0] actions:[FOCUS, AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="heading", roleDescription="heading 4"] \ No newline at end of file
diff --git a/content/test/data/accessibility/html/hr-expected-android-external.txt b/content/test/data/accessibility/html/hr-expected-android-external.txt new file mode 100644 index 0000000..9f4a433 --- /dev/null +++ b/content/test/data/accessibility/html/hr-expected-android-external.txt
@@ -0,0 +1,6 @@ +WebView focusable focused scrollable actions:[CLEAR_FOCUS, AX_FOCUS] bundle:[chromeRole="rootWebArea"] +++TextView text:"Before." actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="paragraph"] +++View text:"Dividing line" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="splitter", roleDescription="splitter"] +++TextView text:"Middle." actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="paragraph"] +++View actions:[AX_FOCUS] bundle:[chromeRole="splitter", roleDescription="splitter"] +++TextView text:"After." actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="paragraph"] \ No newline at end of file
diff --git a/content/test/data/accessibility/html/html-expected-android-external.txt b/content/test/data/accessibility/html/html-expected-android-external.txt new file mode 100644 index 0000000..a2911a9 --- /dev/null +++ b/content/test/data/accessibility/html/html-expected-android-external.txt
@@ -0,0 +1,3 @@ +WebView text:"HTML element" focusable focused scrollable actions:[CLEAR_FOCUS, AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="rootWebArea"] +++View text:"BODY element" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="genericContainer"] +++++Button text:"Button element" clickable focusable actions:[FOCUS, CLICK, AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="button", clickableScore="300", roleDescription="button"] \ No newline at end of file
diff --git a/content/test/data/accessibility/html/i-expected-android-external.txt b/content/test/data/accessibility/html/i-expected-android-external.txt new file mode 100644 index 0000000..f33d1bc --- /dev/null +++ b/content/test/data/accessibility/html/i-expected-android-external.txt
@@ -0,0 +1,2 @@ +WebView focusable focused scrollable actions:[CLEAR_FOCUS, AX_FOCUS] bundle:[chromeRole="rootWebArea"] +++TextView text:"This is to check italic property using i tag." actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="paragraph"] \ No newline at end of file
diff --git a/content/test/data/accessibility/html/id-expected-android-external.txt b/content/test/data/accessibility/html/id-expected-android-external.txt new file mode 100644 index 0000000..283ee446 --- /dev/null +++ b/content/test/data/accessibility/html/id-expected-android-external.txt
@@ -0,0 +1,3 @@ +WebView focusable focused scrollable actions:[CLEAR_FOCUS, AX_FOCUS] bundle:[chromeRole="rootWebArea"] +++TextView text:"No id" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="paragraph"] +++TextView text:"Has id" viewIdResName:"para2" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="paragraph"] \ No newline at end of file
diff --git a/content/test/data/accessibility/html/iframe-aria-hidden-expected-android-external.txt b/content/test/data/accessibility/html/iframe-aria-hidden-expected-android-external.txt new file mode 100644 index 0000000..6fa2f44 --- /dev/null +++ b/content/test/data/accessibility/html/iframe-aria-hidden-expected-android-external.txt
@@ -0,0 +1,5 @@ +WebView focusable focused scrollable actions:[CLEAR_FOCUS, AX_FOCUS] bundle:[chromeRole="rootWebArea"] +++View notVisibleToUser actions:[AX_FOCUS] bundle:[chromeRole="iframe"] +++++View scrollable actions:[AX_FOCUS] bundle:[chromeRole="rootWebArea"] +++View notVisibleToUser actions:[AX_FOCUS] bundle:[chromeRole="iframe"] +++++View scrollable actions:[AX_FOCUS] bundle:[chromeRole="rootWebArea"] \ No newline at end of file
diff --git a/content/test/data/accessibility/html/iframe-coordinates-cross-process-expected-android-external.txt b/content/test/data/accessibility/html/iframe-coordinates-cross-process-expected-android-external.txt new file mode 100644 index 0000000..36bdb48 --- /dev/null +++ b/content/test/data/accessibility/html/iframe-coordinates-cross-process-expected-android-external.txt
@@ -0,0 +1,13 @@ +WebView focusable focused actions:[CLEAR_FOCUS, AX_FOCUS] bundle:[chromeRole="rootWebArea"] +++View actions:[AX_FOCUS] bundle:[chromeRole="genericContainer"] +++++Button text:"Button" clickable focusable actions:[FOCUS, CLICK, AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="button", clickableScore="300", roleDescription="button"] +++View actions:[AX_FOCUS] bundle:[chromeRole="genericContainer"] +++++Button text:"Button" clickable focusable actions:[FOCUS, CLICK, AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="button", clickableScore="300", roleDescription="button"] +++View actions:[AX_FOCUS] bundle:[chromeRole="genericContainer"] +++++View viewIdResName:"frame1" actions:[AX_FOCUS] bundle:[chromeRole="iframe"] +++++++View text:"Error" focusable scrollable actions:[FOCUS, AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="rootWebArea"] +++++++++TextView text:"Could not load the requested resource.\nError code: -6 (net::ERR_FILE_NOT_FOUND)" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="genericContainer"] +++View actions:[AX_FOCUS] bundle:[chromeRole="genericContainer"] +++++View viewIdResName:"frame2" actions:[AX_FOCUS] bundle:[chromeRole="iframe"] +++++++View text:"Error" focusable scrollable actions:[FOCUS, AX_FOCUS, NEXT, PREVIOUS, SCROLL_FORWARD, SCROLL_DOWN, SCROLL_RIGHT, PAGE_DOWN, PAGE_RIGHT] bundle:[chromeRole="rootWebArea"] +++++++++TextView text:"Could not load the requested resource.\nError code: -6 (net::ERR_FILE_NOT_FOUND)" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="genericContainer"] \ No newline at end of file
diff --git a/content/test/data/accessibility/html/iframe-cross-process-expected-android-external.txt b/content/test/data/accessibility/html/iframe-cross-process-expected-android-external.txt new file mode 100644 index 0000000..eff08d8a --- /dev/null +++ b/content/test/data/accessibility/html/iframe-cross-process-expected-android-external.txt
@@ -0,0 +1,7 @@ +WebView focusable focused scrollable actions:[CLEAR_FOCUS, AX_FOCUS] bundle:[chromeRole="rootWebArea"] +++TextView text:"Before frame" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="paragraph"] +++View actions:[AX_FOCUS] bundle:[chromeRole="genericContainer"] +++++View focusable actions:[FOCUS, AX_FOCUS] bundle:[chromeRole="iframe"] +++++++View text:"Error" focusable scrollable actions:[FOCUS, AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="rootWebArea"] +++++++++TextView text:"Could not load the requested resource.\nError code: -6 (net::ERR_FILE_NOT_FOUND)" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="genericContainer"] +++TextView text:"After frame" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="paragraph"] \ No newline at end of file
diff --git a/content/test/data/accessibility/html/iframe-empty-positioned-expected-android-external.txt b/content/test/data/accessibility/html/iframe-empty-positioned-expected-android-external.txt new file mode 100644 index 0000000..abdb4b7 --- /dev/null +++ b/content/test/data/accessibility/html/iframe-empty-positioned-expected-android-external.txt
@@ -0,0 +1,5 @@ +WebView focusable focused scrollable actions:[CLEAR_FOCUS, AX_FOCUS] bundle:[chromeRole="rootWebArea"] +++View actions:[AX_FOCUS] bundle:[chromeRole="iframe"] +++++View scrollable actions:[AX_FOCUS] bundle:[chromeRole="rootWebArea"] +++View actions:[AX_FOCUS] bundle:[chromeRole="iframe"] +++++View scrollable actions:[AX_FOCUS] bundle:[chromeRole="rootWebArea"] \ No newline at end of file
diff --git a/content/test/data/accessibility/html/iframe-expected-android-external.txt b/content/test/data/accessibility/html/iframe-expected-android-external.txt new file mode 100644 index 0000000..3e5ebdd --- /dev/null +++ b/content/test/data/accessibility/html/iframe-expected-android-external.txt
@@ -0,0 +1,4 @@ +WebView focusable focused scrollable actions:[CLEAR_FOCUS, AX_FOCUS] bundle:[chromeRole="rootWebArea"] +++View actions:[AX_FOCUS] bundle:[chromeRole="genericContainer"] +++++View focusable actions:[FOCUS, AX_FOCUS] bundle:[chromeRole="iframe"] +++++++View scrollable actions:[AX_FOCUS] bundle:[chromeRole="rootWebArea"] \ No newline at end of file
diff --git a/content/test/data/accessibility/html/iframe-focus-expected-android-external.txt b/content/test/data/accessibility/html/iframe-focus-expected-android-external.txt new file mode 100644 index 0000000..19cc36c --- /dev/null +++ b/content/test/data/accessibility/html/iframe-focus-expected-android-external.txt
@@ -0,0 +1,10 @@ +WebView focusable focused scrollable actions:[CLEAR_FOCUS, AX_FOCUS] bundle:[chromeRole="rootWebArea"] +++View actions:[AX_FOCUS] bundle:[chromeRole="genericContainer"] +++++View actions:[AX_FOCUS] bundle:[chromeRole="iframe"] +++++++View scrollable actions:[AX_FOCUS, SCROLL_FORWARD, SCROLL_RIGHT, PAGE_RIGHT] bundle:[chromeRole="rootWebArea"] +++++++++Button text:"Button with focus handler" clickable focusable actions:[FOCUS, CLICK, AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="button", clickableScore="300", roleDescription="button"] +++++++++TextView viewIdResName:"focused_log" actions:[AX_FOCUS] bundle:[chromeRole="genericContainer"] +++++View actions:[AX_FOCUS] bundle:[chromeRole="iframe"] +++++++View scrollable actions:[AX_FOCUS, SCROLL_FORWARD, SCROLL_RIGHT, PAGE_RIGHT] bundle:[chromeRole="rootWebArea"] +++++++++View actions:[AX_FOCUS] bundle:[chromeRole="genericContainer"] +++++++++++Button text:"Ordinary Button" clickable focusable actions:[FOCUS, CLICK, AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="button", clickableScore="300", roleDescription="button"] \ No newline at end of file
diff --git a/content/test/data/accessibility/html/iframe-presentational-expected-android-external.txt b/content/test/data/accessibility/html/iframe-presentational-expected-android-external.txt new file mode 100644 index 0000000..e4ea816f --- /dev/null +++ b/content/test/data/accessibility/html/iframe-presentational-expected-android-external.txt
@@ -0,0 +1,4 @@ +WebView focusable focused scrollable actions:[CLEAR_FOCUS, AX_FOCUS] bundle:[chromeRole="rootWebArea"] +++View actions:[AX_FOCUS] bundle:[chromeRole="genericContainer"] +++++View actions:[AX_FOCUS] bundle:[chromeRole="iframePresentational"] +++++++View scrollable actions:[AX_FOCUS] bundle:[chromeRole="rootWebArea"] \ No newline at end of file
diff --git a/content/test/data/accessibility/html/iframe-transform-expected-android-external.txt b/content/test/data/accessibility/html/iframe-transform-expected-android-external.txt new file mode 100644 index 0000000..cb29266 --- /dev/null +++ b/content/test/data/accessibility/html/iframe-transform-expected-android-external.txt
@@ -0,0 +1,7 @@ +WebView focusable focused scrollable actions:[CLEAR_FOCUS, AX_FOCUS] bundle:[chromeRole="rootWebArea"] +++View actions:[AX_FOCUS] bundle:[chromeRole="iframe"] +++++View scrollable actions:[AX_FOCUS] bundle:[chromeRole="rootWebArea", hasImage="true"] +++++++Image actions:[AX_FOCUS] bundle:[chromeRole="image", hasImage="true", roleDescription="graphic"] +++View actions:[AX_FOCUS] bundle:[chromeRole="iframe"] +++++View scrollable actions:[AX_FOCUS] bundle:[chromeRole="rootWebArea", hasImage="true"] +++++++Image actions:[AX_FOCUS] bundle:[chromeRole="image", hasImage="true", roleDescription="graphic"] \ No newline at end of file
diff --git a/content/test/data/accessibility/html/iframe-traversal-expected-android-external.txt b/content/test/data/accessibility/html/iframe-traversal-expected-android-external.txt new file mode 100644 index 0000000..4fd2618 --- /dev/null +++ b/content/test/data/accessibility/html/iframe-traversal-expected-android-external.txt
@@ -0,0 +1,7 @@ +WebView focusable focused scrollable actions:[CLEAR_FOCUS, AX_FOCUS] bundle:[chromeRole="rootWebArea"] +++TextView text:"Before iframe" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="paragraph"] +++View actions:[AX_FOCUS] bundle:[chromeRole="genericContainer"] +++++View actions:[AX_FOCUS] bundle:[chromeRole="iframe"] +++++++View text:"Error" focusable scrollable actions:[FOCUS, AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="rootWebArea"] +++++++++TextView text:"Could not load the requested resource.\nError code: -6 (net::ERR_FILE_NOT_FOUND)" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="genericContainer"] +++TextView text:"After iframe" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="paragraph"] \ No newline at end of file
diff --git a/content/test/data/accessibility/html/img-empty-alt-expected-android-external.txt b/content/test/data/accessibility/html/img-empty-alt-expected-android-external.txt new file mode 100644 index 0000000..31520f9 --- /dev/null +++ b/content/test/data/accessibility/html/img-empty-alt-expected-android-external.txt
@@ -0,0 +1,5 @@ +WebView focusable focused scrollable actions:[CLEAR_FOCUS, AX_FOCUS] bundle:[chromeRole="rootWebArea", hasImage="true"] +++View actions:[AX_FOCUS] bundle:[chromeRole="genericContainer", hasImage="true"] +++++Image actions:[AX_FOCUS] bundle:[chromeRole="image", hasImage="true", roleDescription="graphic", targetUrl="file:///storage/emulated/0/chromium_tests_root/content/test/data/accessibility/html/read.jpg"] +++++Image text:"read" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="image", hasImage="true", roleDescription="graphic", targetUrl="file:///storage/emulated/0/chromium_tests_root/content/test/data/accessibility/html/read.jpg"] +++++Image text:"full" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="image", hasImage="true", roleDescription="graphic", targetUrl="file:///storage/emulated/0/chromium_tests_root/content/test/data/accessibility/html/read.jpg"] \ No newline at end of file
diff --git a/content/test/data/accessibility/html/img-expected-android-external.txt b/content/test/data/accessibility/html/img-expected-android-external.txt new file mode 100644 index 0000000..779b59d --- /dev/null +++ b/content/test/data/accessibility/html/img-expected-android-external.txt
@@ -0,0 +1,8 @@ +WebView focusable focused scrollable actions:[CLEAR_FOCUS, AX_FOCUS] bundle:[chromeRole="rootWebArea", hasImage="true"] +++View actions:[AX_FOCUS] bundle:[chromeRole="genericContainer", hasImage="true"] +++++Image text:"pipe" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="image", hasImage="true", roleDescription="graphic", targetUrl="file:///storage/emulated/0/chromium_tests_root/content/test/data/accessibility/html/pipe.jpg"] +++++TextView text:" " actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="staticText"] +++++TextView text:" " actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="staticText"] +++++Image text:" " actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="image", hasImage="true", roleDescription="graphic", targetUrl="file:///storage/emulated/0/chromium_tests_root/content/test/data/accessibility/html/pipe.jpg"] +++++TextView text:" " actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="staticText"] +++++Image text:"SVG face" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="image", hasImage="true", roleDescription="graphic", targetUrl="file:///storage/emulated/0/chromium_tests_root/content/test/data/accessibility/html/svg-face.svg"] \ No newline at end of file
diff --git a/content/test/data/accessibility/html/img-link-empty-alt-expected-android-external.txt b/content/test/data/accessibility/html/img-link-empty-alt-expected-android-external.txt new file mode 100644 index 0000000..34463c4 --- /dev/null +++ b/content/test/data/accessibility/html/img-link-empty-alt-expected-android-external.txt
@@ -0,0 +1,11 @@ +WebView focusable focused scrollable actions:[CLEAR_FOCUS, AX_FOCUS] bundle:[chromeRole="rootWebArea", hasImage="true"] +++View actions:[AX_FOCUS] bundle:[chromeRole="genericContainer", hasImage="true"] +++++View text:"null" contentDescription:"unread " clickable focusable actions:[FOCUS, CLICK, AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="link", clickableScore="300", roleDescription="link", targetUrl="file:///storage/emulated/0/chromium_tests_root/content/test/data/accessibility/html/foo"] +++++++TextView text:"unread " actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="staticText"] +++++View text:"null" contentDescription:"read " clickable focusable actions:[FOCUS, CLICK, AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="link", clickableScore="300", roleDescription="link", targetUrl="file:///storage/emulated/0/chromium_tests_root/content/test/data/accessibility/html/foo"] +++++++TextView text:"read " actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="staticText"] +++++View text:"null" contentDescription:"read " clickable focusable actions:[FOCUS, CLICK, AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="link", clickableScore="300", roleDescription="link", targetUrl="file:///storage/emulated/0/chromium_tests_root/content/test/data/accessibility/html/foo"] +++++++TextView text:"read " actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="staticText"] +++++View text:"null" contentDescription:"read" clickable focusable actions:[FOCUS, CLICK, AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="link", clickableScore="300", hasImage="true", roleDescription="link", targetUrl="file:///storage/emulated/0/chromium_tests_root/content/test/data/accessibility/html/foo"] +++++++Image text:"read" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="image", clickableScore="100", hasImage="true", roleDescription="graphic", targetUrl="file:///storage/emulated/0/chromium_tests_root/content/test/data/accessibility/html/read.jpg"] +++++++TextView text:"read" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="staticText"] \ No newline at end of file
diff --git a/content/test/data/accessibility/html/in-page-links-expected-android-external.txt b/content/test/data/accessibility/html/in-page-links-expected-android-external.txt new file mode 100644 index 0000000..68886a8 --- /dev/null +++ b/content/test/data/accessibility/html/in-page-links-expected-android-external.txt
@@ -0,0 +1,31 @@ +WebView focusable focused scrollable actions:[CLEAR_FOCUS, AX_FOCUS] bundle:[chromeRole="rootWebArea"] +++View text:"null" contentDescription:"Empty anchor" viewIdResName:"anchor1" clickable focusable actions:[FOCUS, CLICK, AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="link", clickableScore="300", roleDescription="link", targetUrl="file:///storage/emulated/0/chromium_tests_root/content/test/data/accessibility/html/in-page-links.html#emptyAnchor"] +++++TextView text:"Empty anchor" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="staticText"] +++TextView text:" " actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="staticText"] +++View text:"null" contentDescription:"Anchor with content" viewIdResName:"anchor2" clickable focusable actions:[FOCUS, CLICK, AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="link", clickableScore="300", roleDescription="link", targetUrl="file:///storage/emulated/0/chromium_tests_root/content/test/data/accessibility/html/in-page-links.html#anchorWithContent"] +++++TextView text:"Anchor with content" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="staticText"] +++TextView text:" " actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="staticText"] +++View text:"null" contentDescription:"Anchor with ID" viewIdResName:"anchor3" clickable focusable actions:[FOCUS, CLICK, AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="link", clickableScore="300", roleDescription="link", targetUrl="file:///storage/emulated/0/chromium_tests_root/content/test/data/accessibility/html/in-page-links.html#anchorWithID"] +++++TextView text:"Anchor with ID" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="staticText"] +++TextView text:" " actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="staticText"] +++View text:"null" contentDescription:"Empty span" viewIdResName:"anchor4" clickable focusable actions:[FOCUS, CLICK, AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="link", clickableScore="300", roleDescription="link", targetUrl="file:///storage/emulated/0/chromium_tests_root/content/test/data/accessibility/html/in-page-links.html#emptySpan"] +++++TextView text:"Empty span" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="staticText"] +++TextView text:" " actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="staticText"] +++View text:"null" contentDescription:"Span with content" viewIdResName:"anchor5" clickable focusable actions:[FOCUS, CLICK, AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="link", clickableScore="300", roleDescription="link", targetUrl="file:///storage/emulated/0/chromium_tests_root/content/test/data/accessibility/html/in-page-links.html#spanWithContent"] +++++TextView text:"Span with content" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="staticText"] +++TextView text:" " actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="staticText"] +++View text:"null" contentDescription:"Paragraph with content" viewIdResName:"anchor6" clickable focusable actions:[FOCUS, CLICK, AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="link", clickableScore="300", roleDescription="link", targetUrl="file:///storage/emulated/0/chromium_tests_root/content/test/data/accessibility/html/in-page-links.html#paragraphWithContent"] +++++TextView text:"Paragraph with content" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="staticText"] +++View actions:[AX_FOCUS] bundle:[chromeRole="paragraph"] +++++TextView actions:[AX_FOCUS] bundle:[chromeRole="genericContainer"] +++++TextView text:"After empty anchor" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="staticText"] +++View actions:[AX_FOCUS] bundle:[chromeRole="paragraph"] +++++TextView text:"Anchor with content" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="genericContainer"] +++View actions:[AX_FOCUS] bundle:[chromeRole="paragraph"] +++++TextView text:"Anchor with ID" viewIdResName:"anchorWithID" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="genericContainer"] +++View actions:[AX_FOCUS] bundle:[chromeRole="paragraph"] +++++TextView viewIdResName:"emptySpan" actions:[AX_FOCUS] bundle:[chromeRole="genericContainer"] +++++TextView text:"After empty span" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="staticText"] +++View actions:[AX_FOCUS] bundle:[chromeRole="paragraph"] +++++TextView text:"Span with content" viewIdResName:"spanWithContent" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="genericContainer"] +++TextView text:"Paragraph with content" viewIdResName:"paragraphWithContent" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="paragraph"] \ No newline at end of file
diff --git a/content/test/data/accessibility/html/input-button-expected-android-external.txt b/content/test/data/accessibility/html/input-button-expected-android-external.txt new file mode 100644 index 0000000..8198032 --- /dev/null +++ b/content/test/data/accessibility/html/input-button-expected-android-external.txt
@@ -0,0 +1,4 @@ +WebView focusable focused scrollable actions:[CLEAR_FOCUS, AX_FOCUS] bundle:[chromeRole="rootWebArea"] +++View actions:[AX_FOCUS] bundle:[chromeRole="genericContainer"] +++++Button text:"Button" clickable focusable actions:[FOCUS, CLICK, AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="button", clickableScore="300", roleDescription="button"] +++++Button text:"Name" clickable focusable actions:[FOCUS, CLICK, AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="button", clickableScore="300", hint="Description", roleDescription="button"] \ No newline at end of file
diff --git a/content/test/data/accessibility/html/input-checkbox-label-expected-android-external.txt b/content/test/data/accessibility/html/input-checkbox-label-expected-android-external.txt new file mode 100644 index 0000000..6df49e4 --- /dev/null +++ b/content/test/data/accessibility/html/input-checkbox-label-expected-android-external.txt
@@ -0,0 +1,3 @@ +WebView focusable focused scrollable actions:[CLEAR_FOCUS, AX_FOCUS] bundle:[chromeRole="rootWebArea"] +++View actions:[AX_FOCUS] bundle:[chromeRole="genericContainer"] +++++CheckBox text:"Checkbox Title" checkable clickable focusable actions:[FOCUS, CLICK, AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="checkBox", clickableScore="300", roleDescription="checkbox"] \ No newline at end of file
diff --git a/content/test/data/accessibility/html/input-color-expected-android-external.txt b/content/test/data/accessibility/html/input-color-expected-android-external.txt new file mode 100644 index 0000000..d18c0223 --- /dev/null +++ b/content/test/data/accessibility/html/input-color-expected-android-external.txt
@@ -0,0 +1,3 @@ +WebView focusable focused scrollable actions:[CLEAR_FOCUS, AX_FOCUS] bundle:[chromeRole="rootWebArea"] +++View actions:[AX_FOCUS] bundle:[chromeRole="genericContainer"] +++++Spinner text:"#FF9900" clickable focusable actions:[FOCUS, CLICK, AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="colorWell", clickableScore="300", roleDescription="color picker"] \ No newline at end of file
diff --git a/content/test/data/accessibility/html/input-color-with-popup-open-expected-android-external.txt b/content/test/data/accessibility/html/input-color-with-popup-open-expected-android-external.txt new file mode 100644 index 0000000..d18c0223 --- /dev/null +++ b/content/test/data/accessibility/html/input-color-with-popup-open-expected-android-external.txt
@@ -0,0 +1,3 @@ +WebView focusable focused scrollable actions:[CLEAR_FOCUS, AX_FOCUS] bundle:[chromeRole="rootWebArea"] +++View actions:[AX_FOCUS] bundle:[chromeRole="genericContainer"] +++++Spinner text:"#FF9900" clickable focusable actions:[FOCUS, CLICK, AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="colorWell", clickableScore="300", roleDescription="color picker"] \ No newline at end of file
diff --git a/content/test/data/accessibility/html/input-date-expected-android-external.txt b/content/test/data/accessibility/html/input-date-expected-android-external.txt new file mode 100644 index 0000000..653cbe0 --- /dev/null +++ b/content/test/data/accessibility/html/input-date-expected-android-external.txt
@@ -0,0 +1,4 @@ +WebView focusable focused scrollable actions:[CLEAR_FOCUS, AX_FOCUS] bundle:[chromeRole="rootWebArea"] +++View actions:[AX_FOCUS] bundle:[chromeRole="genericContainer"] +++++Spinner text:"2008-09-01" clickable focusable inputType:20 actions:[FOCUS, CLICK, AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="date", clickableScore="300", roleDescription="date picker"] +++++Spinner text:"2008-09-01" clickable focusable inputType:20 actions:[FOCUS, CLICK, AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="date", clickableScore="300", hint="When", roleDescription="date picker"] \ No newline at end of file
diff --git a/content/test/data/accessibility/html/input-date-with-popup-open-expected-android-external.txt b/content/test/data/accessibility/html/input-date-with-popup-open-expected-android-external.txt new file mode 100644 index 0000000..510d01d --- /dev/null +++ b/content/test/data/accessibility/html/input-date-with-popup-open-expected-android-external.txt
@@ -0,0 +1,3 @@ +WebView focusable focused scrollable actions:[CLEAR_FOCUS, AX_FOCUS] bundle:[chromeRole="rootWebArea"] +++View actions:[AX_FOCUS] bundle:[chromeRole="genericContainer"] +++++Spinner text:"2008-09-01" clickable focusable inputType:20 actions:[FOCUS, CLICK, AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="date", clickableScore="300", roleDescription="date picker"] \ No newline at end of file
diff --git a/content/test/data/accessibility/html/input-date-with-popup-open-multiple-expected-android-external.txt b/content/test/data/accessibility/html/input-date-with-popup-open-multiple-expected-android-external.txt new file mode 100644 index 0000000..34d7a75 --- /dev/null +++ b/content/test/data/accessibility/html/input-date-with-popup-open-multiple-expected-android-external.txt
@@ -0,0 +1,5 @@ +WebView focusable focused scrollable actions:[CLEAR_FOCUS, AX_FOCUS] bundle:[chromeRole="rootWebArea"] +++View actions:[AX_FOCUS] bundle:[chromeRole="genericContainer"] +++++Spinner text:"2008-09-01" clickable focusable inputType:20 actions:[FOCUS, CLICK, AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="date", clickableScore="300", roleDescription="date picker"] +++++Spinner text:"2008-09-01" clickable focusable inputType:20 actions:[FOCUS, CLICK, AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="date", clickableScore="300", roleDescription="date picker"] +++++Spinner text:"2008-09-01" clickable focusable inputType:20 actions:[FOCUS, CLICK, AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="date", clickableScore="300", hint="Third date picker", roleDescription="date picker"] \ No newline at end of file
diff --git a/content/test/data/accessibility/html/input-date-with-popup-open-multiple-for-win-expected-android-external.txt b/content/test/data/accessibility/html/input-date-with-popup-open-multiple-for-win-expected-android-external.txt new file mode 100644 index 0000000..34d7a75 --- /dev/null +++ b/content/test/data/accessibility/html/input-date-with-popup-open-multiple-for-win-expected-android-external.txt
@@ -0,0 +1,5 @@ +WebView focusable focused scrollable actions:[CLEAR_FOCUS, AX_FOCUS] bundle:[chromeRole="rootWebArea"] +++View actions:[AX_FOCUS] bundle:[chromeRole="genericContainer"] +++++Spinner text:"2008-09-01" clickable focusable inputType:20 actions:[FOCUS, CLICK, AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="date", clickableScore="300", roleDescription="date picker"] +++++Spinner text:"2008-09-01" clickable focusable inputType:20 actions:[FOCUS, CLICK, AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="date", clickableScore="300", roleDescription="date picker"] +++++Spinner text:"2008-09-01" clickable focusable inputType:20 actions:[FOCUS, CLICK, AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="date", clickableScore="300", hint="Third date picker", roleDescription="date picker"] \ No newline at end of file
diff --git a/content/test/data/accessibility/html/input-datetime-expected-android-external.txt b/content/test/data/accessibility/html/input-datetime-expected-android-external.txt new file mode 100644 index 0000000..fe9d6d0 --- /dev/null +++ b/content/test/data/accessibility/html/input-datetime-expected-android-external.txt
@@ -0,0 +1,4 @@ +WebView focusable focused scrollable actions:[CLEAR_FOCUS, AX_FOCUS] bundle:[chromeRole="rootWebArea"] +++View actions:[AX_FOCUS] bundle:[chromeRole="genericContainer"] +++++EditText text:"1/1/2015 1:00AM" clickable editable focusable inputType:4 textSelectionStart:0 textSelectionEnd:0 actions:[FOCUS, CLICK, AX_FOCUS, NEXT, PREVIOUS, COPY, PASTE, CUT, SET_SELECTION, SET_TEXT, IME_ENTER] bundle:[chromeRole="textField", clickableScore="300"] +++++EditText text:"1/1/2015 1:00AM" clickable editable focusable inputType:4 textSelectionStart:0 textSelectionEnd:0 actions:[FOCUS, CLICK, AX_FOCUS, NEXT, PREVIOUS, COPY, PASTE, CUT, SET_SELECTION, SET_TEXT, IME_ENTER] bundle:[chromeRole="textField", clickableScore="300", hint="Launch"] \ No newline at end of file
diff --git a/content/test/data/accessibility/html/input-datetime-local-expected-android-external.txt b/content/test/data/accessibility/html/input-datetime-local-expected-android-external.txt new file mode 100644 index 0000000..cd4bf0a --- /dev/null +++ b/content/test/data/accessibility/html/input-datetime-local-expected-android-external.txt
@@ -0,0 +1,3 @@ +WebView focusable focused scrollable actions:[CLEAR_FOCUS, AX_FOCUS] bundle:[chromeRole="rootWebArea"] +++View actions:[AX_FOCUS] bundle:[chromeRole="genericContainer"] +++++Spinner clickable focusable inputType:4 actions:[FOCUS, CLICK, AX_FOCUS] bundle:[chromeRole="dateTime", clickableScore="300", roleDescription="local date and time picker"] \ No newline at end of file
diff --git a/content/test/data/accessibility/html/input-email-expected-android-external.txt b/content/test/data/accessibility/html/input-email-expected-android-external.txt new file mode 100644 index 0000000..0ee9e0e --- /dev/null +++ b/content/test/data/accessibility/html/input-email-expected-android-external.txt
@@ -0,0 +1,3 @@ +WebView focusable focused scrollable actions:[CLEAR_FOCUS, AX_FOCUS] bundle:[chromeRole="rootWebArea"] +++View actions:[AX_FOCUS] bundle:[chromeRole="genericContainer"] +++++EditText text:"someone@example.com" clickable editable focusable inputType:209 textSelectionStart:0 textSelectionEnd:0 actions:[FOCUS, CLICK, AX_FOCUS, NEXT, PREVIOUS, COPY, PASTE, CUT, SET_SELECTION, SET_TEXT, IME_ENTER] bundle:[chromeRole="textField", clickableScore="300"] \ No newline at end of file
diff --git a/content/test/data/accessibility/html/input-file-expected-android-external.txt b/content/test/data/accessibility/html/input-file-expected-android-external.txt new file mode 100644 index 0000000..be2e67a --- /dev/null +++ b/content/test/data/accessibility/html/input-file-expected-android-external.txt
@@ -0,0 +1,3 @@ +WebView focusable focused scrollable actions:[CLEAR_FOCUS, AX_FOCUS] bundle:[chromeRole="rootWebArea"] +++View actions:[AX_FOCUS] bundle:[chromeRole="genericContainer"] +++++Button text:"No file chosen, Choose File" clickable focusable actions:[FOCUS, CLICK, AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="button", clickableScore="300", roleDescription="button"] \ No newline at end of file
diff --git a/content/test/data/accessibility/html/input-image-expected-android-external.txt b/content/test/data/accessibility/html/input-image-expected-android-external.txt new file mode 100644 index 0000000..b0273d1 --- /dev/null +++ b/content/test/data/accessibility/html/input-image-expected-android-external.txt
@@ -0,0 +1,3 @@ +WebView focusable focused scrollable actions:[CLEAR_FOCUS, AX_FOCUS] bundle:[chromeRole="rootWebArea"] +++View viewIdResName:"body" actions:[AX_FOCUS] bundle:[chromeRole="genericContainer"] +++++Button text:"Submit" clickable focusable actions:[FOCUS, CLICK, AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="button", clickableScore="300", roleDescription="button"] \ No newline at end of file
diff --git a/content/test/data/accessibility/html/input-list-expected-android-external.txt b/content/test/data/accessibility/html/input-list-expected-android-external.txt new file mode 100644 index 0000000..f1834c4 --- /dev/null +++ b/content/test/data/accessibility/html/input-list-expected-android-external.txt
@@ -0,0 +1,5 @@ +WebView focusable focused scrollable actions:[CLEAR_FOCUS, AX_FOCUS] bundle:[chromeRole="rootWebArea"] +++View actions:[AX_FOCUS] bundle:[chromeRole="genericContainer"] +++++View actions:[AX_FOCUS] bundle:[chromeRole="labelText"] +++++++TextView text:"Choose a pokemon " actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="staticText"] +++++++EditText canOpenPopUp clickable editable focusable inputType:1 textSelectionStart:0 textSelectionEnd:0 actions:[FOCUS, CLICK, AX_FOCUS, PASTE, SET_TEXT, IME_ENTER] bundle:[chromeRole="textFieldWithComboBox", clickableScore="300", hint="Choose a pokemon"] \ No newline at end of file
diff --git a/content/test/data/accessibility/html/input-month-expected-android-external.txt b/content/test/data/accessibility/html/input-month-expected-android-external.txt new file mode 100644 index 0000000..7ce2028b --- /dev/null +++ b/content/test/data/accessibility/html/input-month-expected-android-external.txt
@@ -0,0 +1,3 @@ +WebView focusable focused scrollable actions:[CLEAR_FOCUS, AX_FOCUS] bundle:[chromeRole="rootWebArea"] +++View actions:[AX_FOCUS] bundle:[chromeRole="genericContainer"] +++++Spinner clickable focusable inputType:20 actions:[FOCUS, CLICK, AX_FOCUS] bundle:[chromeRole="dateTime", clickableScore="300", roleDescription="month picker"] \ No newline at end of file
diff --git a/content/test/data/accessibility/html/input-number-expected-android-external.txt b/content/test/data/accessibility/html/input-number-expected-android-external.txt new file mode 100644 index 0000000..dcdb466 --- /dev/null +++ b/content/test/data/accessibility/html/input-number-expected-android-external.txt
@@ -0,0 +1,4 @@ +WebView focusable focused scrollable actions:[CLEAR_FOCUS, AX_FOCUS] bundle:[chromeRole="rootWebArea"] +++View actions:[AX_FOCUS] bundle:[chromeRole="genericContainer"] +++++EditText text:"1" clickable editable focusable inputType:2 textSelectionStart:0 textSelectionEnd:0 actions:[FOCUS, CLICK, AX_FOCUS, NEXT, PREVIOUS, COPY, PASTE, CUT, SET_SELECTION, SET_TEXT, SET_PROGRESS, IME_ENTER] bundle:[chromeRole="spinButton", clickableScore="300", roleDescription="spin button"] +++++EditText text:"6" clickable editable focusable inputType:2 textSelectionStart:0 textSelectionEnd:0 actions:[FOCUS, CLICK, AX_FOCUS, NEXT, PREVIOUS, COPY, PASTE, CUT, SET_SELECTION, SET_TEXT, SET_PROGRESS, IME_ENTER] bundle:[chromeRole="spinButton", clickableScore="300", roleDescription="spin button"] \ No newline at end of file
diff --git a/content/test/data/accessibility/html/input-radio-checkbox-label-expected-android-external.txt b/content/test/data/accessibility/html/input-radio-checkbox-label-expected-android-external.txt new file mode 100644 index 0000000..d1df339 --- /dev/null +++ b/content/test/data/accessibility/html/input-radio-checkbox-label-expected-android-external.txt
@@ -0,0 +1,10 @@ +WebView focusable focused scrollable actions:[CLEAR_FOCUS, AX_FOCUS] bundle:[chromeRole="rootWebArea"] +++View actions:[AX_FOCUS] bundle:[chromeRole="genericContainer"] +++++RadioButton text:"label ignored for radio button" viewIdResName:"radio1" checkable clickable focusable actions:[FOCUS, CLICK, AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="radioButton", clickableScore="300", roleDescription="radio button"] +++++CheckBox text:"label ignored for checkbox" viewIdResName:"checkbox1" checkable clickable focusable actions:[FOCUS, CLICK, AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="checkBox", clickableScore="300", roleDescription="checkbox"] +++++View text:"label exposed for radio button " focusable actions:[FOCUS, AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="labelText"] +++++++TextView text:"label exposed for radio button " actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="staticText"] +++++++RadioButton text:"label exposed for radio button" viewIdResName:"radio2" checkable clickable focusable actions:[FOCUS, CLICK, AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="radioButton", clickableScore="300", roleDescription="radio button"] +++++View text:"label exposed for checkbox " focusable actions:[FOCUS, AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="labelText"] +++++++TextView text:"label exposed for checkbox " actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="staticText"] +++++++CheckBox text:"label exposed for checkbox" viewIdResName:"checkbox2" checkable clickable focusable actions:[FOCUS, CLICK, AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="checkBox", clickableScore="300", roleDescription="checkbox"] \ No newline at end of file
diff --git a/content/test/data/accessibility/html/input-radio-expected-android-external.txt b/content/test/data/accessibility/html/input-radio-expected-android-external.txt new file mode 100644 index 0000000..19224730 --- /dev/null +++ b/content/test/data/accessibility/html/input-radio-expected-android-external.txt
@@ -0,0 +1,13 @@ +WebView focusable focused scrollable actions:[CLEAR_FOCUS, AX_FOCUS] bundle:[chromeRole="rootWebArea"] +++View actions:[AX_FOCUS] bundle:[chromeRole="section"] +++++RadioButton checkable clickable focusable actions:[FOCUS, CLICK, AX_FOCUS] bundle:[chromeRole="radioButton", clickableScore="300", roleDescription="radio button"] +++++TextView text:"Radio1" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="staticText"] +++++View text:"\n" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="lineBreak"] +++++RadioButton checkable clickable focusable actions:[FOCUS, CLICK, AX_FOCUS] bundle:[chromeRole="radioButton", clickableScore="300", roleDescription="radio button"] +++++TextView text:"Radio2" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="staticText"] +++View actions:[AX_FOCUS] bundle:[chromeRole="section"] +++++RadioButton text:"Radio3" checkable clickable focusable actions:[FOCUS, CLICK, AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="radioButton", clickableScore="300", roleDescription="radio button"] +++++RadioButton text:"Radio4" checkable checked clickable focusable actions:[FOCUS, CLICK, AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="radioButton", clickableScore="300", roleDescription="radio button"] +++View actions:[AX_FOCUS] bundle:[chromeRole="section"] +++++RadioButton text:"Radio5" checkable clickable focusable actions:[FOCUS, CLICK, AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="radioButton", clickableScore="300", roleDescription="radio button"] +++++RadioButton text:"Radio6" checkable checked clickable focusable actions:[FOCUS, CLICK, AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="radioButton", clickableScore="300", roleDescription="radio button"] \ No newline at end of file
diff --git a/content/test/data/accessibility/html/input-radio-in-menu-expected-android-external.txt b/content/test/data/accessibility/html/input-radio-in-menu-expected-android-external.txt new file mode 100644 index 0000000..5351022 --- /dev/null +++ b/content/test/data/accessibility/html/input-radio-in-menu-expected-android-external.txt
@@ -0,0 +1,11 @@ +WebView focusable focused scrollable actions:[CLEAR_FOCUS, AX_FOCUS] bundle:[chromeRole="rootWebArea"] +++View actions:[AX_FOCUS] bundle:[chromeRole="menu", roleDescription="menu"] +++++RadioButton checkable checked clickable focusable actions:[FOCUS, CLICK, AX_FOCUS] bundle:[chromeRole="radioButton", clickableScore="300", roleDescription="radio button"] +++++TextView text:"Radio0 " actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="staticText"] +++++RadioButton checkable clickable focusable actions:[FOCUS, CLICK, AX_FOCUS] bundle:[chromeRole="radioButton", clickableScore="300", roleDescription="radio button"] +++++TextView text:"Radio1 " actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="staticText"] +++++RadioButton text:"Radio2" checkable clickable focusable actions:[FOCUS, CLICK, AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="radioButton", clickableScore="300", roleDescription="radio button"] +++View actions:[AX_FOCUS] bundle:[chromeRole="menu", roleDescription="menu"] +++++RadioButton text:"Radio3" checkable clickable focusable actions:[FOCUS, CLICK, AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="radioButton", clickableScore="300", roleDescription="radio button"] +++++RadioButton checkable clickable focusable actions:[FOCUS, CLICK, AX_FOCUS] bundle:[chromeRole="radioButton", clickableScore="300", roleDescription="radio button"] +++++RadioButton checkable checked clickable focusable actions:[FOCUS, CLICK, AX_FOCUS] bundle:[chromeRole="radioButton", clickableScore="300", roleDescription="radio button"] \ No newline at end of file
diff --git a/content/test/data/accessibility/html/input-range-expected-android-external.txt b/content/test/data/accessibility/html/input-range-expected-android-external.txt new file mode 100644 index 0000000..c8acf7f --- /dev/null +++ b/content/test/data/accessibility/html/input-range-expected-android-external.txt
@@ -0,0 +1,7 @@ +WebView focusable focused scrollable actions:[CLEAR_FOCUS, AX_FOCUS] bundle:[chromeRole="rootWebArea"] +++View actions:[AX_FOCUS] bundle:[chromeRole="genericContainer"] +++++SeekBar text:"5" clickable focusable RangeInfo:[current=5.0, min=1.0, max=10.0] actions:[FOCUS, CLICK, AX_FOCUS, NEXT, PREVIOUS, SCROLL_FORWARD, SCROLL_BACKWARD, SET_PROGRESS] bundle:[chromeRole="slider", roleDescription="slider"] +++++SeekBar text:"3" clickable focusable RangeInfo:[current=3.0, min=1.0, max=10.0] actions:[FOCUS, CLICK, AX_FOCUS, NEXT, PREVIOUS, SCROLL_FORWARD, SCROLL_BACKWARD, SET_PROGRESS] bundle:[chromeRole="slider", roleDescription="slider"] +++++SeekBar text:"Medium" clickable focusable actions:[FOCUS, CLICK, AX_FOCUS, NEXT, PREVIOUS, SCROLL_FORWARD, SCROLL_BACKWARD, SET_PROGRESS] bundle:[chromeRole="slider", roleDescription="slider"] +++++SeekBar text:"Friday" clickable focusable actions:[FOCUS, CLICK, AX_FOCUS, NEXT, PREVIOUS, SCROLL_BACKWARD, SET_PROGRESS] bundle:[chromeRole="slider", roleDescription="slider"] +++++SeekBar text:"0.2" clickable focusable RangeInfo:[current=0.2, min=-1.0, max=1.0] actions:[FOCUS, CLICK, AX_FOCUS, NEXT, PREVIOUS, SCROLL_FORWARD, SCROLL_BACKWARD, SET_PROGRESS] bundle:[chromeRole="slider", roleDescription="slider"] \ No newline at end of file
diff --git a/content/test/data/accessibility/html/input-reset-expected-android-external.txt b/content/test/data/accessibility/html/input-reset-expected-android-external.txt new file mode 100644 index 0000000..ce02aef --- /dev/null +++ b/content/test/data/accessibility/html/input-reset-expected-android-external.txt
@@ -0,0 +1,4 @@ +WebView focusable focused scrollable actions:[CLEAR_FOCUS, AX_FOCUS] bundle:[chromeRole="rootWebArea"] +++View actions:[AX_FOCUS] bundle:[chromeRole="genericContainer"] +++++EditText clickable editable focusable inputType:1 textSelectionStart:0 textSelectionEnd:0 actions:[FOCUS, CLICK, AX_FOCUS, PASTE, SET_TEXT, IME_ENTER] bundle:[chromeRole="textField", clickableScore="300"] +++++Button text:"Reset" clickable focusable actions:[FOCUS, CLICK, AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="button", clickableScore="300", roleDescription="button"] \ No newline at end of file
diff --git a/content/test/data/accessibility/html/input-search-expected-android-external.txt b/content/test/data/accessibility/html/input-search-expected-android-external.txt new file mode 100644 index 0000000..a8dfd6c0e --- /dev/null +++ b/content/test/data/accessibility/html/input-search-expected-android-external.txt
@@ -0,0 +1,3 @@ +WebView focusable focused scrollable actions:[CLEAR_FOCUS, AX_FOCUS] bundle:[chromeRole="rootWebArea"] +++View actions:[AX_FOCUS] bundle:[chromeRole="genericContainer"] +++++EditText text:"Search terms" clickable editable focusable inputType:1 textSelectionStart:0 textSelectionEnd:0 actions:[FOCUS, CLICK, AX_FOCUS, NEXT, PREVIOUS, COPY, PASTE, CUT, SET_SELECTION, SET_TEXT, IME_ENTER] bundle:[chromeRole="searchBox", clickableScore="300", roleDescription="search text field"] \ No newline at end of file
diff --git a/content/test/data/accessibility/html/input-submit-expected-android-external.txt b/content/test/data/accessibility/html/input-submit-expected-android-external.txt new file mode 100644 index 0000000..f81a6fe --- /dev/null +++ b/content/test/data/accessibility/html/input-submit-expected-android-external.txt
@@ -0,0 +1,10 @@ +WebView focusable focused scrollable actions:[CLEAR_FOCUS, AX_FOCUS] bundle:[chromeRole="rootWebArea", hasImage="true"] +++View actions:[AX_FOCUS] bundle:[chromeRole="section"] +++++EditText clickable editable focusable inputType:1 textSelectionStart:0 textSelectionEnd:0 actions:[FOCUS, CLICK, AX_FOCUS, PASTE, SET_TEXT, IME_ENTER] bundle:[chromeRole="textField", clickableScore="300"] +++++Button text:"First submit in a form is a valid default button" clickable focusable actions:[FOCUS, CLICK, AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="button", clickableScore="300", roleDescription="button"] +++++Button text:"Second submit in a form not a valid default button" clickable focusable actions:[FOCUS, CLICK, AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="button", clickableScore="300", roleDescription="button"] +++View actions:[AX_FOCUS] bundle:[chromeRole="section", hasImage="true"] +++++EditText clickable editable focusable inputType:1 textSelectionStart:0 textSelectionEnd:0 actions:[FOCUS, CLICK, AX_FOCUS, PASTE, SET_TEXT, IME_ENTER] bundle:[chromeRole="textField", clickableScore="300"] +++++Button text:"First image button in a form is a valid default button" clickable focusable actions:[FOCUS, CLICK, AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="button", clickableScore="300", hasImage="true", roleDescription="button"] +++++Button text:"Second image button in a form not a valid default button" clickable focusable actions:[FOCUS, CLICK, AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="button", clickableScore="300", hasImage="true", roleDescription="button"] +++Button text:"Submit outside of form not a valid default button" clickable focusable actions:[FOCUS, CLICK, AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="button", clickableScore="300", roleDescription="button"] \ No newline at end of file
diff --git a/content/test/data/accessibility/html/input-suggestions-source-element-expected-android-external.txt b/content/test/data/accessibility/html/input-suggestions-source-element-expected-android-external.txt new file mode 100644 index 0000000..96fe1fb --- /dev/null +++ b/content/test/data/accessibility/html/input-suggestions-source-element-expected-android-external.txt
@@ -0,0 +1,3 @@ +WebView focusable focused scrollable actions:[CLEAR_FOCUS, AX_FOCUS] bundle:[chromeRole="rootWebArea"] +++View actions:[AX_FOCUS] bundle:[chromeRole="genericContainer"] +++++EditText canOpenPopUp clickable editable focusable inputType:1 textSelectionStart:0 textSelectionEnd:0 actions:[FOCUS, CLICK, AX_FOCUS, PASTE, SET_TEXT, IME_ENTER] bundle:[chromeRole="textFieldWithComboBox", clickableScore="300"] \ No newline at end of file
diff --git a/content/test/data/accessibility/html/input-tel-expected-android-external.txt b/content/test/data/accessibility/html/input-tel-expected-android-external.txt new file mode 100644 index 0000000..b5ce652 --- /dev/null +++ b/content/test/data/accessibility/html/input-tel-expected-android-external.txt
@@ -0,0 +1,3 @@ +WebView focusable focused scrollable actions:[CLEAR_FOCUS, AX_FOCUS] bundle:[chromeRole="rootWebArea"] +++View actions:[AX_FOCUS] bundle:[chromeRole="genericContainer"] +++++EditText text:"123-456-7890" clickable editable focusable inputType:3 textSelectionStart:0 textSelectionEnd:0 actions:[FOCUS, CLICK, AX_FOCUS, NEXT, PREVIOUS, COPY, PASTE, CUT, SET_SELECTION, SET_TEXT, IME_ENTER] bundle:[chromeRole="textField", clickableScore="300"] \ No newline at end of file
diff --git a/content/test/data/accessibility/html/input-text-expected-android-external.txt b/content/test/data/accessibility/html/input-text-expected-android-external.txt new file mode 100644 index 0000000..7541aee7 --- /dev/null +++ b/content/test/data/accessibility/html/input-text-expected-android-external.txt
@@ -0,0 +1,3 @@ +WebView focusable scrollable actions:[FOCUS, AX_FOCUS] bundle:[chromeRole="rootWebArea"] +++View actions:[AX_FOCUS] bundle:[chromeRole="genericContainer"] +++++EditText clickable editable focusable focused inputType:1 textSelectionStart:0 textSelectionEnd:0 actions:[CLEAR_FOCUS, CLICK, AX_FOCUS, PASTE, SET_TEXT, IME_ENTER] bundle:[chromeRole="textField", clickableScore="300", hint="Name"] \ No newline at end of file
diff --git a/content/test/data/accessibility/html/input-text-name-calc-expected-android-external.txt b/content/test/data/accessibility/html/input-text-name-calc-expected-android-external.txt new file mode 100644 index 0000000..b42de60 --- /dev/null +++ b/content/test/data/accessibility/html/input-text-name-calc-expected-android-external.txt
@@ -0,0 +1,27 @@ +WebView focusable focused scrollable actions:[CLEAR_FOCUS, AX_FOCUS] bundle:[chromeRole="rootWebArea"] +++EditText viewIdResName:"c0" clickable editable focusable inputType:1 textSelectionStart:0 textSelectionEnd:0 actions:[FOCUS, CLICK, AX_FOCUS, PASTE, SET_TEXT, IME_ENTER] bundle:[chromeRole="textField", clickableScore="300", hint="Title0"] +++EditText viewIdResName:"c1" clickable editable focusable inputType:1 textSelectionStart:0 textSelectionEnd:0 actions:[FOCUS, CLICK, AX_FOCUS, PASTE, SET_TEXT, IME_ENTER] bundle:[chromeRole="textField", clickableScore="300", hint="Label1 Title1"] +++EditText viewIdResName:"c2" clickable editable focusable inputType:1 textSelectionStart:0 textSelectionEnd:0 actions:[FOCUS, CLICK, AX_FOCUS, PASTE, SET_TEXT, IME_ENTER] bundle:[chromeRole="textField", clickableScore="300", hint="AriaLabel2 Title2"] +++EditText viewIdResName:"c3" clickable editable focusable inputType:1 textSelectionStart:0 textSelectionEnd:0 actions:[FOCUS, CLICK, AX_FOCUS, PASTE, SET_TEXT, IME_ENTER] bundle:[chromeRole="textField", clickableScore="300", hint="LabelledBy3 Title3"] +++EditText viewIdResName:"c4" clickable editable focusable inputType:1 textSelectionStart:0 textSelectionEnd:0 actions:[FOCUS, CLICK, AX_FOCUS, PASTE, SET_TEXT, IME_ENTER] bundle:[chromeRole="textField", clickableScore="300", hint="Placeholder4"] +++EditText viewIdResName:"c4a" clickable editable focusable inputType:1 textSelectionStart:0 textSelectionEnd:0 actions:[FOCUS, CLICK, AX_FOCUS, PASTE, SET_TEXT, IME_ENTER] bundle:[chromeRole="textField", clickableScore="300", hint="ARIA Placeholder4a"] +++EditText viewIdResName:"c4b" clickable editable focusable inputType:1 textSelectionStart:0 textSelectionEnd:0 actions:[FOCUS, CLICK, AX_FOCUS, PASTE, SET_TEXT, IME_ENTER] bundle:[chromeRole="textField", clickableScore="300", hint="Placeholder4b"] +++EditText viewIdResName:"c5" clickable editable focusable inputType:1 textSelectionStart:0 textSelectionEnd:0 actions:[FOCUS, CLICK, AX_FOCUS, PASTE, SET_TEXT, IME_ENTER] bundle:[chromeRole="textField", clickableScore="300", hint="Placeholder5 Title5"] +++EditText viewIdResName:"c6" clickable editable focusable inputType:1 textSelectionStart:0 textSelectionEnd:0 actions:[FOCUS, CLICK, AX_FOCUS, PASTE, SET_TEXT, IME_ENTER] bundle:[chromeRole="textField", clickableScore="300", hint="LabelledBy6 DescribedBy6"] +++EditText viewIdResName:"c7" clickable editable focusable inputType:1 textSelectionStart:0 textSelectionEnd:0 actions:[FOCUS, CLICK, AX_FOCUS, PASTE, SET_TEXT, IME_ENTER] bundle:[chromeRole="textField", clickableScore="300", hint="AriaLabel7 Placeholder7 DescribedBy7"] +++View actions:[AX_FOCUS] bundle:[chromeRole="paragraph"] +++++View text:"Label1" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="labelText"] +++++TextView text:" " actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="staticText"] +++++View text:"Label2" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="labelText"] +++++TextView text:" " actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="staticText"] +++++View text:"Label3" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="labelText"] +++++TextView text:" " actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="staticText"] +++++View text:"Label6" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="labelText"] +++++TextView text:" " actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="staticText"] +++++TextView text:"LabelledBy3" viewIdResName:"lb3" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="genericContainer"] +++++TextView text:" " actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="staticText"] +++++TextView text:"LabelledBy6" viewIdResName:"lb6" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="genericContainer"] +++++TextView text:" " actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="staticText"] +++++TextView text:"DescribedBy6" viewIdResName:"db6" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="genericContainer"] +++++TextView text:" " actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="staticText"] +++++TextView text:"DescribedBy7" viewIdResName:"db7" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="genericContainer"] \ No newline at end of file
diff --git a/content/test/data/accessibility/html/input-text-read-only-expected-android-external.txt b/content/test/data/accessibility/html/input-text-read-only-expected-android-external.txt new file mode 100644 index 0000000..5c74ca1 --- /dev/null +++ b/content/test/data/accessibility/html/input-text-read-only-expected-android-external.txt
@@ -0,0 +1,3 @@ +WebView focusable scrollable actions:[FOCUS, AX_FOCUS] bundle:[chromeRole="rootWebArea"] +++View actions:[AX_FOCUS] bundle:[chromeRole="genericContainer"] +++++EditText clickable editable disabled focusable focused inputType:1 textSelectionStart:0 textSelectionEnd:0 actions:[CLEAR_FOCUS, CLICK, AX_FOCUS] bundle:[chromeRole="textField", clickableScore="300", hint="Name"] \ No newline at end of file
diff --git a/content/test/data/accessibility/html/input-text-value-expected-android-external.txt b/content/test/data/accessibility/html/input-text-value-expected-android-external.txt new file mode 100644 index 0000000..ade67af --- /dev/null +++ b/content/test/data/accessibility/html/input-text-value-expected-android-external.txt
@@ -0,0 +1,15 @@ +WebView focusable focused scrollable actions:[CLEAR_FOCUS, AX_FOCUS] bundle:[chromeRole="rootWebArea"] +++View actions:[AX_FOCUS] bundle:[chromeRole="genericContainer"] +++++View text:"l1" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="labelText"] +++++EditText viewIdResName:"i1" clickable editable focusable inputType:1 textSelectionStart:0 textSelectionEnd:0 actions:[FOCUS, CLICK, AX_FOCUS, PASTE, SET_TEXT, IME_ENTER] bundle:[chromeRole="textField", clickableScore="300", hint="l1"] +++++View text:"l2" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="labelText"] +++++EditText text:"value" viewIdResName:"i2" clickable editable focusable inputType:1 textSelectionStart:0 textSelectionEnd:0 actions:[FOCUS, CLICK, AX_FOCUS, NEXT, PREVIOUS, COPY, PASTE, CUT, SET_SELECTION, SET_TEXT, IME_ENTER] bundle:[chromeRole="textField", clickableScore="300", hint="l2"] +++++EditText clickable editable focusable inputType:1 textSelectionStart:0 textSelectionEnd:0 actions:[FOCUS, CLICK, AX_FOCUS, PASTE, SET_TEXT, IME_ENTER] bundle:[chromeRole="textField", clickableScore="300", hint="l2"] +++++EditText text:"value *" clickable editable focusable inputType:1 textSelectionStart:0 textSelectionEnd:0 actions:[FOCUS, CLICK, AX_FOCUS, NEXT, PREVIOUS, COPY, PASTE, CUT, SET_SELECTION, SET_TEXT, IME_ENTER] bundle:[chromeRole="textField", clickableScore="300", hint="l2"] +++++View text:"Email" viewIdResName:"l3" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="labelText"] +++++TextView viewIdResName:"l4" actions:[AX_FOCUS] bundle:[chromeRole="genericContainer"] +++++EditText clickable editable focusable inputType:1 textSelectionStart:0 textSelectionEnd:0 actions:[FOCUS, CLICK, AX_FOCUS, PASTE, SET_TEXT, IME_ENTER] bundle:[chromeRole="textField", clickableScore="300", hint="Email"] +++++EditText text:"value" clickable editable focusable inputType:1 textSelectionStart:0 textSelectionEnd:0 actions:[FOCUS, CLICK, AX_FOCUS, NEXT, PREVIOUS, COPY, PASTE, CUT, SET_SELECTION, SET_TEXT, IME_ENTER] bundle:[chromeRole="textField", clickableScore="300", hint="Email"] +++++EditText clickable editable focusable multiLine textSelectionStart:0 textSelectionEnd:0 actions:[FOCUS, CLICK, AX_FOCUS, PASTE, SET_TEXT, IME_ENTER] bundle:[chromeRole="textField", clickableScore="300", hint="l5"] +++++EditText text:"Value" clickable editable focusable multiLine textSelectionStart:0 textSelectionEnd:0 actions:[FOCUS, CLICK, AX_FOCUS, NEXT, PREVIOUS, COPY, PASTE, CUT, SET_SELECTION, SET_TEXT, IME_ENTER] bundle:[chromeRole="textField", clickableScore="300", hint="l6"] +++++EditText text:"value" clickable editable focusable inputType:1 textSelectionStart:0 textSelectionEnd:0 actions:[FOCUS, CLICK, AX_FOCUS, NEXT, PREVIOUS, COPY, PASTE, CUT, SET_SELECTION, SET_TEXT, IME_ENTER] bundle:[chromeRole="textField", clickableScore="300", hint="Name Description"] \ No newline at end of file
diff --git a/content/test/data/accessibility/html/input-time-expected-android-external.txt b/content/test/data/accessibility/html/input-time-expected-android-external.txt new file mode 100644 index 0000000..36df1fa --- /dev/null +++ b/content/test/data/accessibility/html/input-time-expected-android-external.txt
@@ -0,0 +1,4 @@ +WebView focusable focused scrollable actions:[CLEAR_FOCUS, AX_FOCUS] bundle:[chromeRole="rootWebArea"] +++View actions:[AX_FOCUS] bundle:[chromeRole="genericContainer"] +++++Spinner text:"00:00:00" clickable focusable inputType:36 actions:[FOCUS, CLICK, AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="inputTime", clickableScore="300", roleDescription="time picker"] +++++Spinner text:"00:00:00" clickable focusable inputType:36 actions:[FOCUS, CLICK, AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="inputTime", clickableScore="300", hint="Breakfast", roleDescription="time picker"] \ No newline at end of file
diff --git a/content/test/data/accessibility/html/input-time-with-popup-open-expected-android-external.txt b/content/test/data/accessibility/html/input-time-with-popup-open-expected-android-external.txt new file mode 100644 index 0000000..984879d6 --- /dev/null +++ b/content/test/data/accessibility/html/input-time-with-popup-open-expected-android-external.txt
@@ -0,0 +1,3 @@ +WebView focusable focused scrollable actions:[CLEAR_FOCUS, AX_FOCUS] bundle:[chromeRole="rootWebArea"] +++View actions:[AX_FOCUS] bundle:[chromeRole="genericContainer"] +++++Spinner text:"13:50:02.922" clickable focusable inputType:36 actions:[FOCUS, CLICK, AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="inputTime", clickableScore="300", roleDescription="time picker"] \ No newline at end of file
diff --git a/content/test/data/accessibility/html/input-url-expected-android-external.txt b/content/test/data/accessibility/html/input-url-expected-android-external.txt new file mode 100644 index 0000000..3b5ebf14 --- /dev/null +++ b/content/test/data/accessibility/html/input-url-expected-android-external.txt
@@ -0,0 +1,3 @@ +WebView focusable focused scrollable actions:[CLEAR_FOCUS, AX_FOCUS] bundle:[chromeRole="rootWebArea"] +++View actions:[AX_FOCUS] bundle:[chromeRole="genericContainer"] +++++EditText text:"example.com" error:"Invalid entry" clickable contentInvalid editable focusable inputType:17 textSelectionStart:0 textSelectionEnd:0 actions:[FOCUS, CLICK, AX_FOCUS, NEXT, PREVIOUS, COPY, PASTE, CUT, SET_SELECTION, SET_TEXT, IME_ENTER] bundle:[chromeRole="textField", clickableScore="300"] \ No newline at end of file
diff --git a/content/test/data/accessibility/html/input-week-expected-android-external.txt b/content/test/data/accessibility/html/input-week-expected-android-external.txt new file mode 100644 index 0000000..967b9cc --- /dev/null +++ b/content/test/data/accessibility/html/input-week-expected-android-external.txt
@@ -0,0 +1,3 @@ +WebView focusable focused scrollable actions:[CLEAR_FOCUS, AX_FOCUS] bundle:[chromeRole="rootWebArea"] +++View actions:[AX_FOCUS] bundle:[chromeRole="genericContainer"] +++++Spinner clickable focusable inputType:4 actions:[FOCUS, CLICK, AX_FOCUS] bundle:[chromeRole="dateTime", clickableScore="300", roleDescription="week picker"] \ No newline at end of file
diff --git a/content/test/data/accessibility/html/ins-expected-android-external.txt b/content/test/data/accessibility/html/ins-expected-android-external.txt new file mode 100644 index 0000000..83728cd --- /dev/null +++ b/content/test/data/accessibility/html/ins-expected-android-external.txt
@@ -0,0 +1,7 @@ +WebView focusable focused scrollable actions:[CLEAR_FOCUS, AX_FOCUS] bundle:[chromeRole="rootWebArea"] +++View actions:[AX_FOCUS] bundle:[chromeRole="paragraph"] +++++TextView text:"My favorite browser is " actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="staticText"] +++++View text:"ABC" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="contentDeletion", roleDescription="deletion"] +++++TextView text:" " actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="staticText"] +++++View text:"Chrome" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="contentInsertion", roleDescription="insertion"] +++++TextView text:"!" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="staticText"] \ No newline at end of file
diff --git a/content/test/data/accessibility/html/isInteresting-expected-android-external.txt b/content/test/data/accessibility/html/isInteresting-expected-android-external.txt new file mode 100644 index 0000000..d2892b1 --- /dev/null +++ b/content/test/data/accessibility/html/isInteresting-expected-android-external.txt
@@ -0,0 +1,4 @@ +WebView focusable focused scrollable actions:[CLEAR_FOCUS, AX_FOCUS] bundle:[chromeRole="rootWebArea"] +++TextView text:"A non focusable child of a control should not be interesting on Android" CollectionItemInfo:[heading, rowIndex=0, rowSpan=0, colIndex=0, colSpan=0] actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="heading", roleDescription="heading 1"] +++TextView text:"Div with click handler" clickable actions:[CLICK, AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="genericContainer", clickableScore="200"] +++Button text:"I am interesting" clickable actions:[CLICK, AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="button", clickableScore="300", roleDescription="button"] \ No newline at end of file
diff --git a/content/test/data/accessibility/html/label-expected-android-external.txt b/content/test/data/accessibility/html/label-expected-android-external.txt new file mode 100644 index 0000000..6d69b86 --- /dev/null +++ b/content/test/data/accessibility/html/label-expected-android-external.txt
@@ -0,0 +1,3 @@ +WebView focusable focused scrollable actions:[CLEAR_FOCUS, AX_FOCUS] bundle:[chromeRole="rootWebArea"] +++View actions:[AX_FOCUS] bundle:[chromeRole="genericContainer"] +++++View text:"Label" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="labelText"] \ No newline at end of file
diff --git a/content/test/data/accessibility/html/landmark-expected-android-external.txt b/content/test/data/accessibility/html/landmark-expected-android-external.txt new file mode 100644 index 0000000..aed17d4 --- /dev/null +++ b/content/test/data/accessibility/html/landmark-expected-android-external.txt
@@ -0,0 +1,94 @@ +WebView focusable focused scrollable actions:[CLEAR_FOCUS, AX_FOCUS] bundle:[chromeRole="rootWebArea"] +++View text:"This is a header element." actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="header", roleDescription="banner"] +++View text:"This is an aside element." actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="complementary", roleDescription="complementary"] +++TextView text:"This is an address element." actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="genericContainer"] +++View text:"This is a footer element." actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="footer", roleDescription="footer"] +++View text:"This is a form element." actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="section"] +++View text:"This is a main element." actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="main", roleDescription="main"] +++View text:"This is a nav element." actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="navigation", roleDescription="navigation"] +++View text:"This is an ARIA application landmark." actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="application", roleDescription="application"] +++View text:"This is an ARIA banner landmark." actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="banner", roleDescription="banner"] +++View text:"This is an ARIA complementary landmark." actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="complementary", roleDescription="complementary"] +++View text:"This is an ARIA contentinfo landmark." actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="contentInfo", roleDescription="content information"] +++View text:"This is an ARIA form landmark." actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="form"] +++View text:"This is an ARIA main landmark." actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="main", roleDescription="main"] +++View text:"This is an ARIA navigation landmark." actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="navigation", roleDescription="navigation"] +++View text:"This is an ARIA search landmark." actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="search", roleDescription="search"] +++View actions:[AX_FOCUS] bundle:[chromeRole="article", roleDescription="article"] +++++View text:"This should NOT banner role." actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="headerAsNonLandmark"] +++View actions:[AX_FOCUS] bundle:[chromeRole="complementary", roleDescription="complementary"] +++++View text:"This should NOT have banner role." actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="headerAsNonLandmark"] +++View actions:[AX_FOCUS] bundle:[chromeRole="navigation", roleDescription="navigation"] +++++View text:"This should NOT have banner role." actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="headerAsNonLandmark"] +++View actions:[AX_FOCUS] bundle:[chromeRole="section"] +++++View text:"This should NOT have banner role." actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="headerAsNonLandmark"] +++View actions:[AX_FOCUS] bundle:[chromeRole="blockquote", roleDescription="blockquote"] +++++View text:"This should NOT have banner role." actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="headerAsNonLandmark"] +++View actions:[AX_FOCUS] bundle:[chromeRole="details"] +++++View text:"Details" clickable focusable actions:[FOCUS, CLICK, AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="disclosureTriangle", clickableScore="300", roleDescription="disclosure triangle"] +++View actions:[AX_FOCUS] bundle:[chromeRole="group"] +++++View text:"This should NOT have banner role." actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="headerAsNonLandmark"] +++View actions:[AX_FOCUS] bundle:[chromeRole="figure", roleDescription="graphic"] +++++View text:"This should NOT have banner role." actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="headerAsNonLandmark"] +++View actions:[AX_FOCUS] bundle:[chromeRole="group"] +++++View text:"This should NOT have banner role." actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="headerAsNonLandmark"] +++View actions:[AX_FOCUS] bundle:[chromeRole="main", roleDescription="main"] +++++View text:"This should NOT have banner role." actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="headerAsNonLandmark"] +++View actions:[AX_FOCUS] bundle:[chromeRole="article", roleDescription="article"] +++++View text:"This should NOT banner role." actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="headerAsNonLandmark"] +++View actions:[AX_FOCUS] bundle:[chromeRole="complementary", roleDescription="complementary"] +++++View text:"This should NOT have banner role." actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="headerAsNonLandmark"] +++View actions:[AX_FOCUS] bundle:[chromeRole="navigation", roleDescription="navigation"] +++++View text:"This should NOT have banner role." actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="headerAsNonLandmark"] +++View actions:[AX_FOCUS] bundle:[chromeRole="section"] +++++View text:"This should NOT have banner role." actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="headerAsNonLandmark"] +++View actions:[AX_FOCUS] bundle:[chromeRole="blockquote", roleDescription="blockquote"] +++++View text:"This should NOT have banner role." actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="headerAsNonLandmark"] +++View actions:[AX_FOCUS] bundle:[chromeRole="details"] +++++View text:"Details" clickable focusable actions:[FOCUS, CLICK, AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="disclosureTriangle", clickableScore="300", roleDescription="disclosure triangle"] +++View actions:[AX_FOCUS] bundle:[chromeRole="group"] +++++View text:"This should NOT have banner role." actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="headerAsNonLandmark"] +++View actions:[AX_FOCUS] bundle:[chromeRole="figure", roleDescription="graphic"] +++++View text:"This should NOT have banner role." actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="headerAsNonLandmark"] +++View text:"This should NOT have banner role." actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="headerAsNonLandmark"] +++View actions:[AX_FOCUS] bundle:[chromeRole="main", roleDescription="main"] +++++View text:"This should NOT have banner role." actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="headerAsNonLandmark"] +++View actions:[AX_FOCUS] bundle:[chromeRole="article", roleDescription="article"] +++++View text:"This should NOT footer role." actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="footerAsNonLandmark"] +++View actions:[AX_FOCUS] bundle:[chromeRole="complementary", roleDescription="complementary"] +++++View text:"This should NOT have footer role." actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="footerAsNonLandmark"] +++View actions:[AX_FOCUS] bundle:[chromeRole="navigation", roleDescription="navigation"] +++++View text:"This should NOT have footer role." actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="footerAsNonLandmark"] +++View actions:[AX_FOCUS] bundle:[chromeRole="section"] +++++View text:"This should NOT have footer role." actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="footerAsNonLandmark"] +++View actions:[AX_FOCUS] bundle:[chromeRole="blockquote", roleDescription="blockquote"] +++++View text:"This should NOT have footer role." actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="footerAsNonLandmark"] +++View actions:[AX_FOCUS] bundle:[chromeRole="details"] +++++View text:"Details" clickable focusable actions:[FOCUS, CLICK, AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="disclosureTriangle", clickableScore="300", roleDescription="disclosure triangle"] +++View actions:[AX_FOCUS] bundle:[chromeRole="group"] +++++View text:"This should NOT have footer role." actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="footerAsNonLandmark"] +++View actions:[AX_FOCUS] bundle:[chromeRole="figure", roleDescription="graphic"] +++++View text:"This should NOT have footer role." actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="footerAsNonLandmark"] +++View text:"This should NOT have footer role." actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="footerAsNonLandmark"] +++View actions:[AX_FOCUS] bundle:[chromeRole="main", roleDescription="main"] +++++View text:"This should NOT have footer role." actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="footerAsNonLandmark"] +++View actions:[AX_FOCUS] bundle:[chromeRole="article", roleDescription="article"] +++++View text:"This should NOT footer role." actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="footerAsNonLandmark"] +++View actions:[AX_FOCUS] bundle:[chromeRole="complementary", roleDescription="complementary"] +++++View text:"This should NOT have footer role." actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="footerAsNonLandmark"] +++View actions:[AX_FOCUS] bundle:[chromeRole="navigation", roleDescription="navigation"] +++++View text:"This should NOT have footer role." actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="footerAsNonLandmark"] +++View actions:[AX_FOCUS] bundle:[chromeRole="section"] +++++View text:"This should NOT have footer role." actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="footerAsNonLandmark"] +++View actions:[AX_FOCUS] bundle:[chromeRole="blockquote", roleDescription="blockquote"] +++++View text:"This should NOT have footer role." actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="footerAsNonLandmark"] +++View actions:[AX_FOCUS] bundle:[chromeRole="details"] +++++View text:"Details" clickable focusable actions:[FOCUS, CLICK, AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="disclosureTriangle", clickableScore="300", roleDescription="disclosure triangle"] +++View actions:[AX_FOCUS] bundle:[chromeRole="group"] +++++View text:"This should NOT have footer role." actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="footerAsNonLandmark"] +++View actions:[AX_FOCUS] bundle:[chromeRole="figure", roleDescription="graphic"] +++++View text:"This should NOT have footer role." actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="footerAsNonLandmark"] +++View actions:[AX_FOCUS] bundle:[chromeRole="group"] +++++View text:"This should NOT have footer role." actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="footerAsNonLandmark"] +++View actions:[AX_FOCUS] bundle:[chromeRole="main", roleDescription="main"] +++++View text:"This should NOT have footer role." actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="footerAsNonLandmark"] \ No newline at end of file
diff --git a/content/test/data/accessibility/html/legend-expected-android-external.txt b/content/test/data/accessibility/html/legend-expected-android-external.txt new file mode 100644 index 0000000..4ccd99b5 --- /dev/null +++ b/content/test/data/accessibility/html/legend-expected-android-external.txt
@@ -0,0 +1,8 @@ +WebView focusable focused scrollable actions:[CLEAR_FOCUS, AX_FOCUS] bundle:[chromeRole="rootWebArea"] +++View actions:[AX_FOCUS] bundle:[chromeRole="section"] +++++View text:"Browser Engines:" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="group"] +++++++View text:"Browser Engines:" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="legend"] +++++++TextView text:"Browser: " actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="staticText"] +++++++EditText clickable editable focusable inputType:1 textSelectionStart:0 textSelectionEnd:0 actions:[FOCUS, CLICK, AX_FOCUS, PASTE, SET_TEXT, IME_ENTER] bundle:[chromeRole="textField", clickableScore="300"] +++++++TextView text:" Rendering Engine: " actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="staticText"] +++++++EditText clickable editable focusable inputType:1 textSelectionStart:0 textSelectionEnd:0 actions:[FOCUS, CLICK, AX_FOCUS, PASTE, SET_TEXT, IME_ENTER] bundle:[chromeRole="textField", clickableScore="300"] \ No newline at end of file
diff --git a/content/test/data/accessibility/html/li-expected-android-external.txt b/content/test/data/accessibility/html/li-expected-android-external.txt new file mode 100644 index 0000000..77a442be --- /dev/null +++ b/content/test/data/accessibility/html/li-expected-android-external.txt
@@ -0,0 +1,11 @@ +WebView focusable focused scrollable actions:[CLEAR_FOCUS, AX_FOCUS] bundle:[chromeRole="rootWebArea"] +++ListView CollectionInfo:[rows=3, cols=0] actions:[AX_FOCUS] bundle:[chromeRole="list"] +++++View text:"Custom name" CollectionItemInfo:[rowIndex=0, rowSpan=0, colIndex=0, colSpan=0] actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="listItem"] +++++++View text:"• " actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="listMarker"] +++++++TextView text:"Item 1" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="staticText"] +++++View CollectionItemInfo:[rowIndex=1, rowSpan=0, colIndex=0, colSpan=0] actions:[AX_FOCUS] bundle:[chromeRole="listItem"] +++++++View text:"• " actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="listMarker"] +++++++TextView text:"Item 2" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="staticText"] +++++View CollectionItemInfo:[rowIndex=2, rowSpan=0, colIndex=0, colSpan=0] actions:[AX_FOCUS] bundle:[chromeRole="listItem"] +++++++View text:"• " actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="listMarker"] +++++++TextView text:"Item 3" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="staticText"] \ No newline at end of file
diff --git a/content/test/data/accessibility/html/link-inside-heading-expected-android-external.txt b/content/test/data/accessibility/html/link-inside-heading-expected-android-external.txt new file mode 100644 index 0000000..647a157cf --- /dev/null +++ b/content/test/data/accessibility/html/link-inside-heading-expected-android-external.txt
@@ -0,0 +1,4 @@ +WebView focusable focused scrollable actions:[CLEAR_FOCUS, AX_FOCUS] bundle:[chromeRole="rootWebArea"] +++View text:"Link In Heading" clickable CollectionItemInfo:[heading, rowIndex=0, rowSpan=0, colIndex=0, colSpan=0] actions:[CLICK, AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="heading", roleDescription="heading 1 link"] +++++View text:"null" contentDescription:"Link In Heading" clickable focusable CollectionItemInfo:[heading, rowIndex=0, rowSpan=0, colIndex=0, colSpan=0] actions:[FOCUS, CLICK, AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="link", clickableScore="300", roleDescription="heading 1 link", targetUrl="file:///storage/emulated/0/chromium_tests_root/content/test/data/accessibility/html/link-inside-heading.html#"] +++++++TextView text:"Link In Heading" CollectionItemInfo:[heading, rowIndex=0, rowSpan=0, colIndex=0, colSpan=0] actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="staticText"] \ No newline at end of file
diff --git a/content/test/data/accessibility/html/list-expected-android-external.txt b/content/test/data/accessibility/html/list-expected-android-external.txt new file mode 100644 index 0000000..dfa8a26 --- /dev/null +++ b/content/test/data/accessibility/html/list-expected-android-external.txt
@@ -0,0 +1,17 @@ +WebView focusable focused scrollable actions:[CLEAR_FOCUS, AX_FOCUS] bundle:[chromeRole="rootWebArea"] +++ListView CollectionInfo:[rows=3, cols=0] actions:[AX_FOCUS] bundle:[chromeRole="list"] +++++View CollectionItemInfo:[rowIndex=0, rowSpan=0, colIndex=0, colSpan=0] actions:[AX_FOCUS] bundle:[chromeRole="listItem"] +++++++View text:"• " actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="listMarker"] +++++++TextView text:"tic" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="staticText"] +++++View CollectionItemInfo:[rowIndex=1, rowSpan=0, colIndex=0, colSpan=0] actions:[AX_FOCUS] bundle:[chromeRole="listItem"] +++++++View text:"• " actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="listMarker"] +++++++TextView text:"tac" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="staticText"] +++++View CollectionItemInfo:[rowIndex=2, rowSpan=0, colIndex=0, colSpan=0] actions:[AX_FOCUS] bundle:[chromeRole="listItem"] +++++++View text:"• " actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="listMarker"] +++++++TextView text:"toe" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="staticText"] +++ListView CollectionInfo:[rows=3, cols=0] actions:[AX_FOCUS] bundle:[chromeRole="list"] +++++View text:"tic" CollectionItemInfo:[rowIndex=0, rowSpan=0, colIndex=0, colSpan=0] actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="listItem"] +++++TextView text:" " actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="staticText"] +++++View text:"tac" CollectionItemInfo:[rowIndex=1, rowSpan=0, colIndex=0, colSpan=0] actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="listItem"] +++++TextView text:" " actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="staticText"] +++++View text:"toe" CollectionItemInfo:[rowIndex=2, rowSpan=0, colIndex=0, colSpan=0] actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="listItem"] \ No newline at end of file
diff --git a/content/test/data/accessibility/html/list-item-aria-setsize-unknown-expected-android-external.txt b/content/test/data/accessibility/html/list-item-aria-setsize-unknown-expected-android-external.txt new file mode 100644 index 0000000..e513e7c --- /dev/null +++ b/content/test/data/accessibility/html/list-item-aria-setsize-unknown-expected-android-external.txt
@@ -0,0 +1,10 @@ +WebView focusable focused scrollable actions:[CLEAR_FOCUS, AX_FOCUS] bundle:[chromeRole="rootWebArea"] +++ListView CollectionInfo:[hierarchical, rows=8, cols=0] actions:[AX_FOCUS] bundle:[chromeRole="list"] +++++View text:"Level 1, item 5 of set size unknown" CollectionItemInfo:[rowIndex=4, rowSpan=0, colIndex=0, colSpan=0] actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="listItem"] +++++View CollectionItemInfo:[rowIndex=5, rowSpan=0, colIndex=0, colSpan=0] actions:[AX_FOCUS] bundle:[chromeRole="listItem"] +++++++TextView text:"Level 1, item 6 of set size unknown" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="staticText"] +++++++ListView CollectionInfo:[hierarchical, rows=7, cols=0] actions:[AX_FOCUS] bundle:[chromeRole="list"] +++++++++View text:"Level 2, item 6 of set size unknown" CollectionItemInfo:[rowIndex=5, rowSpan=0, colIndex=0, colSpan=0] actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="listItem"] +++++++++View text:"Level 2, item 7 of set size unknown" CollectionItemInfo:[rowIndex=6, rowSpan=0, colIndex=0, colSpan=0] actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="listItem"] +++++View text:"Level 1, item 7 of set size 2" CollectionItemInfo:[rowIndex=6, rowSpan=0, colIndex=0, colSpan=0] actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="listItem"] +++++View text:"Level 1, item 8 of set size 3" CollectionItemInfo:[rowIndex=7, rowSpan=0, colIndex=0, colSpan=0] actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="listItem"] \ No newline at end of file
diff --git a/content/test/data/accessibility/html/list-item-aria-setsize-unknown-flattened-expected-android-external.txt b/content/test/data/accessibility/html/list-item-aria-setsize-unknown-flattened-expected-android-external.txt new file mode 100644 index 0000000..c7ff673a --- /dev/null +++ b/content/test/data/accessibility/html/list-item-aria-setsize-unknown-flattened-expected-android-external.txt
@@ -0,0 +1,22 @@ +WebView focusable focused scrollable actions:[CLEAR_FOCUS, AX_FOCUS] bundle:[chromeRole="rootWebArea"] +++ListView CollectionInfo:[rows=1, cols=0] actions:[AX_FOCUS] bundle:[chromeRole="list"] +++++View text:"Level 1, item 1 of set size unknown" CollectionItemInfo:[rowIndex=0, rowSpan=0, colIndex=0, colSpan=0] actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="listItem"] +++ListView CollectionInfo:[rows=1, cols=0] actions:[AX_FOCUS] bundle:[chromeRole="list"] +++++View text:"++Level 2, item 1 of set size unknown" CollectionItemInfo:[rowIndex=0, rowSpan=0, colIndex=0, colSpan=0] actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="listItem"] +++ListView CollectionInfo:[rows=2, cols=0] actions:[AX_FOCUS] bundle:[chromeRole="list"] +++++View text:"++Level 2, item 2 of set size unknown" CollectionItemInfo:[rowIndex=1, rowSpan=0, colIndex=0, colSpan=0] actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="listItem"] +++ListView CollectionInfo:[rows=3, cols=0] actions:[AX_FOCUS] bundle:[chromeRole="list"] +++++View text:"++Level 2, item 3 of set size unknown" CollectionItemInfo:[rowIndex=2, rowSpan=0, colIndex=0, colSpan=0] actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="listItem"] +++ListView CollectionInfo:[rows=1, cols=0] actions:[AX_FOCUS] bundle:[chromeRole="list"] +++++View text:"++++Level 3, item 1 of set size unknown" CollectionItemInfo:[rowIndex=0, rowSpan=0, colIndex=0, colSpan=0] actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="listItem"] +++ListView CollectionInfo:[rows=2, cols=0] actions:[AX_FOCUS] bundle:[chromeRole="list"] +++++View text:"++++Level 3, item 2 of set size unknown" CollectionItemInfo:[rowIndex=1, rowSpan=0, colIndex=0, colSpan=0] actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="listItem"] +++ListView CollectionInfo:[rows=2, cols=0] actions:[AX_FOCUS] bundle:[chromeRole="list"] +++++View text:"Level 1, item 2 of set size unknown" CollectionItemInfo:[rowIndex=1, rowSpan=0, colIndex=0, colSpan=0] actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="listItem"] +++ListView CollectionInfo:[rows=3, cols=0] actions:[AX_FOCUS] bundle:[chromeRole="list"] +++++View text:"Level 1, item 3 of set size unknown" CollectionItemInfo:[rowIndex=2, rowSpan=0, colIndex=0, colSpan=0] actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="listItem"] +++ListView CollectionInfo:[hierarchical, rows=0, cols=0] actions:[AX_FOCUS] bundle:[chromeRole="list"] +++++ListView CollectionInfo:[hierarchical, rows=4, cols=0] actions:[AX_FOCUS] bundle:[chromeRole="list"] +++++++View text:"Level Unspecified, aria-setsize attribute does not exist, item 4 of set size 4" CollectionItemInfo:[rowIndex=3, rowSpan=0, colIndex=0, colSpan=0] actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="listItem"] +++++ListView CollectionInfo:[hierarchical, rows=5, cols=0] actions:[AX_FOCUS] bundle:[chromeRole="list"] +++++++View text:"Level Unspecified, aria-setsize attribute does not exist, item 5 of set size 5" CollectionItemInfo:[rowIndex=4, rowSpan=0, colIndex=0, colSpan=0] actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="listItem"] \ No newline at end of file
diff --git a/content/test/data/accessibility/html/list-markers-expected-android-external.txt b/content/test/data/accessibility/html/list-markers-expected-android-external.txt new file mode 100644 index 0000000..8332ce6 --- /dev/null +++ b/content/test/data/accessibility/html/list-markers-expected-android-external.txt
@@ -0,0 +1,17 @@ +WebView focusable focused scrollable actions:[CLEAR_FOCUS, AX_FOCUS] bundle:[chromeRole="rootWebArea"] +++ListView CollectionInfo:[rows=3, cols=0] actions:[AX_FOCUS] bundle:[chromeRole="list"] +++++View CollectionItemInfo:[rowIndex=0, rowSpan=0, colIndex=0, colSpan=0] actions:[AX_FOCUS] bundle:[chromeRole="listItem"] +++++++View text:"• " actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="listMarker"] +++++++TextView text:"First item properly groups itself despite " actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="staticText"] +++++++TextView text:"bolded" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="staticText"] +++++++TextView text:" text." actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="staticText"] +++++View CollectionItemInfo:[rowIndex=1, rowSpan=0, colIndex=0, colSpan=0] actions:[AX_FOCUS] bundle:[chromeRole="listItem"] +++++++View text:"• " actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="listMarker"] +++++++TextView text:"This should also be " actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="staticText"] +++++++TextView text:"seen" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="staticText"] +++++++TextView text:" as a group." actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="staticText"] +++++View CollectionItemInfo:[rowIndex=2, rowSpan=0, colIndex=0, colSpan=0] actions:[AX_FOCUS] bundle:[chromeRole="listItem"] +++++++View text:"• " actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="listMarker"] +++++++TextView text:"Some " actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="staticText"] +++++++TextView text:"more" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="staticText"] +++++++TextView text:" text." actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="staticText"] \ No newline at end of file
diff --git a/content/test/data/accessibility/html/main-expected-android-external.txt b/content/test/data/accessibility/html/main-expected-android-external.txt new file mode 100644 index 0000000..bf4f891 --- /dev/null +++ b/content/test/data/accessibility/html/main-expected-android-external.txt
@@ -0,0 +1,3 @@ +WebView focusable focused scrollable actions:[CLEAR_FOCUS, AX_FOCUS] bundle:[chromeRole="rootWebArea"] +++View text:"This is main element." actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="main", roleDescription="main"] +++View text:"This is an ARIA role main." actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="main", roleDescription="main"] \ No newline at end of file
diff --git a/content/test/data/accessibility/html/map-any-contents-expected-android-external.txt b/content/test/data/accessibility/html/map-any-contents-expected-android-external.txt new file mode 100644 index 0000000..5a3cb51 --- /dev/null +++ b/content/test/data/accessibility/html/map-any-contents-expected-android-external.txt
@@ -0,0 +1,10 @@ +WebView focusable focused scrollable actions:[CLEAR_FOCUS, AX_FOCUS] bundle:[chromeRole="rootWebArea", hasImage="true"] +++Image text:"pipe" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="image", hasImage="true", roleDescription="graphic", targetUrl="file:///storage/emulated/0/chromium_tests_root/content/test/data/accessibility/html/pipe.jpg"] +++++TextView text:"Headings are allowed in a map" CollectionItemInfo:[heading, rowIndex=0, rowSpan=0, colIndex=0, colSpan=0] actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="heading", roleDescription="heading 1"] +++++View text:"null" contentDescription:"pipe1" clickable focusable actions:[FOCUS, CLICK, AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="link", clickableScore="300", roleDescription="link", targetUrl="file:///storage/emulated/0/chromium_tests_root/content/test/data/accessibility/html/fake.htm"] +++++View actions:[AX_FOCUS] bundle:[chromeRole="paragraph"] +++++++TextView text:"So are " actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="staticText"] +++++++View text:"other elements" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="mark", roleDescription="highlight"] +++++++TextView text:"!" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="staticText"] +++++TextView text:"pipe2" clickable actions:[CLICK, AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="staticText", clickableScore="200"] +++++Button text:"Even a button" clickable focusable actions:[FOCUS, CLICK, AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="button", clickableScore="300", roleDescription="button"] \ No newline at end of file
diff --git a/content/test/data/accessibility/html/mark-expected-android-external.txt b/content/test/data/accessibility/html/mark-expected-android-external.txt new file mode 100644 index 0000000..6ee348e --- /dev/null +++ b/content/test/data/accessibility/html/mark-expected-android-external.txt
@@ -0,0 +1,5 @@ +WebView focusable focused scrollable actions:[CLEAR_FOCUS, AX_FOCUS] bundle:[chromeRole="rootWebArea"] +++View actions:[AX_FOCUS] bundle:[chromeRole="paragraph"] +++++TextView text:"This test is to check " actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="staticText"] +++++View text:"mark tag" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="mark", roleDescription="highlight"] +++++TextView text:"." actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="staticText"] \ No newline at end of file
diff --git a/content/test/data/accessibility/html/math-expected-android-external.txt b/content/test/data/accessibility/html/math-expected-android-external.txt new file mode 100644 index 0000000..ad9df7e --- /dev/null +++ b/content/test/data/accessibility/html/math-expected-android-external.txt
@@ -0,0 +1,3 @@ +WebView focusable focused scrollable actions:[CLEAR_FOCUS, AX_FOCUS] bundle:[chromeRole="rootWebArea"] +++View actions:[AX_FOCUS] bundle:[chromeRole="genericContainer"] +++++View text:"𝐴2+𝐵2" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="math", roleDescription="math"] \ No newline at end of file
diff --git a/content/test/data/accessibility/html/menu-expected-android-external.txt b/content/test/data/accessibility/html/menu-expected-android-external.txt new file mode 100644 index 0000000..21836439 --- /dev/null +++ b/content/test/data/accessibility/html/menu-expected-android-external.txt
@@ -0,0 +1,5 @@ +WebView focusable focused scrollable actions:[CLEAR_FOCUS, AX_FOCUS] bundle:[chromeRole="rootWebArea"] +++TextView text:"Menu is deprecated, but it may still be used semantically with list item children. For more history, see crbug.com/87553." actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="paragraph"] +++ListView CollectionInfo:[rows=2, cols=0] actions:[AX_FOCUS] bundle:[chromeRole="list"] +++++View text:"Cats" CollectionItemInfo:[rowIndex=0, rowSpan=0, colIndex=0, colSpan=0] actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="listItem"] +++++View text:"Dogs" CollectionItemInfo:[rowIndex=1, rowSpan=0, colIndex=0, colSpan=0] actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="listItem"] \ No newline at end of file
diff --git a/content/test/data/accessibility/html/meter-expected-android-external.txt b/content/test/data/accessibility/html/meter-expected-android-external.txt new file mode 100644 index 0000000..58db7b8 --- /dev/null +++ b/content/test/data/accessibility/html/meter-expected-android-external.txt
@@ -0,0 +1,3 @@ +WebView focusable focused scrollable actions:[CLEAR_FOCUS, AX_FOCUS] bundle:[chromeRole="rootWebArea"] +++View actions:[AX_FOCUS] bundle:[chromeRole="genericContainer"] +++++ProgressBar text:"2" RangeInfo:[current=2.0, min=1.0, max=10.0] actions:[AX_FOCUS, NEXT, PREVIOUS, SET_PROGRESS] bundle:[chromeRole="meter", roleDescription="meter"] \ No newline at end of file
diff --git a/content/test/data/accessibility/html/navigation-expected-android-external.txt b/content/test/data/accessibility/html/navigation-expected-android-external.txt new file mode 100644 index 0000000..4419803f --- /dev/null +++ b/content/test/data/accessibility/html/navigation-expected-android-external.txt
@@ -0,0 +1,4 @@ +WebView focusable focused scrollable actions:[CLEAR_FOCUS, AX_FOCUS] bundle:[chromeRole="rootWebArea"] +++View actions:[AX_FOCUS] bundle:[chromeRole="navigation", roleDescription="navigation"] +++++View text:"null" contentDescription:"Don't click on me" clickable focusable actions:[FOCUS, CLICK, AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="link", clickableScore="300", roleDescription="link", targetUrl="file:///fake/"] +++++++TextView text:"Don't click on me" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="staticText"] \ No newline at end of file
diff --git a/content/test/data/accessibility/html/nestedlist-expected-android-external.txt b/content/test/data/accessibility/html/nestedlist-expected-android-external.txt new file mode 100644 index 0000000..9a80e501 --- /dev/null +++ b/content/test/data/accessibility/html/nestedlist-expected-android-external.txt
@@ -0,0 +1,30 @@ +WebView focusable focused scrollable actions:[CLEAR_FOCUS, AX_FOCUS] bundle:[chromeRole="rootWebArea"] +++TextView text:"This is a multi-leveled list" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="paragraph"] +++ListView CollectionInfo:[hierarchical, rows=3, cols=0] actions:[AX_FOCUS] bundle:[chromeRole="list"] +++++View CollectionItemInfo:[rowIndex=0, rowSpan=0, colIndex=0, colSpan=0] actions:[AX_FOCUS] bundle:[chromeRole="listItem"] +++++++View text:"1. " actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="listMarker"] +++++++TextView text:"Sports" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="staticText"] +++++++ListView CollectionInfo:[hierarchical, rows=2, cols=0] actions:[AX_FOCUS] bundle:[chromeRole="list"] +++++++++View CollectionItemInfo:[rowIndex=0, rowSpan=0, colIndex=0, colSpan=0] actions:[AX_FOCUS] bundle:[chromeRole="listItem"] +++++++++++View text:"1. " actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="listMarker"] +++++++++++TextView text:"Tennis" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="staticText"] +++++++++View CollectionItemInfo:[rowIndex=1, rowSpan=0, colIndex=0, colSpan=0] actions:[AX_FOCUS] bundle:[chromeRole="listItem"] +++++++++++View text:"2. " actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="listMarker"] +++++++++++TextView text:"basketball" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="staticText"] +++++View CollectionItemInfo:[rowIndex=1, rowSpan=0, colIndex=0, colSpan=0] actions:[AX_FOCUS] bundle:[chromeRole="listItem"] +++++++View text:"2. " actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="listMarker"] +++++++TextView text:"Books" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="staticText"] +++++++ListView CollectionInfo:[hierarchical, rows=3, cols=0] actions:[AX_FOCUS] bundle:[chromeRole="list"] +++++++++View CollectionItemInfo:[rowIndex=0, rowSpan=0, colIndex=0, colSpan=0] actions:[AX_FOCUS] bundle:[chromeRole="listItem"] +++++++++++View text:"1. " actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="listMarker"] +++++++++++TextView text:"Oliver Twist" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="staticText"] +++++++++View CollectionItemInfo:[rowIndex=1, rowSpan=0, colIndex=0, colSpan=0] actions:[AX_FOCUS] bundle:[chromeRole="listItem"] +++++++++++View text:"2. " actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="listMarker"] +++++++++++TextView text:"Kindred" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="staticText"] +++++++++View CollectionItemInfo:[rowIndex=2, rowSpan=0, colIndex=0, colSpan=0] actions:[AX_FOCUS] bundle:[chromeRole="listItem"] +++++++++++View text:"3. " actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="listMarker"] +++++++++++TextView text:"The Promise of Sleep" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="staticText"] +++++View CollectionItemInfo:[rowIndex=2, rowSpan=0, colIndex=0, colSpan=0] actions:[AX_FOCUS] bundle:[chromeRole="listItem"] +++++++View text:"3. " actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="listMarker"] +++++++TextView text:"Recipes" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="staticText"] +++++ListView CollectionInfo:[hierarchical, rows=0, cols=0] actions:[AX_FOCUS] bundle:[chromeRole="list"] \ No newline at end of file
diff --git a/content/test/data/accessibility/html/object-expected-android-external.txt b/content/test/data/accessibility/html/object-expected-android-external.txt new file mode 100644 index 0000000..e1ecb4e --- /dev/null +++ b/content/test/data/accessibility/html/object-expected-android-external.txt
@@ -0,0 +1,3 @@ +WebView focusable focused scrollable actions:[CLEAR_FOCUS, AX_FOCUS] bundle:[chromeRole="rootWebArea"] +++View actions:[AX_FOCUS] bundle:[chromeRole="genericContainer"] +++++View actions:[AX_FOCUS] bundle:[chromeRole="pluginObject", roleDescription="object"] \ No newline at end of file
diff --git a/content/test/data/accessibility/html/offscreen-iframe-content-expected-android-external.txt b/content/test/data/accessibility/html/offscreen-iframe-content-expected-android-external.txt new file mode 100644 index 0000000..7f029ff --- /dev/null +++ b/content/test/data/accessibility/html/offscreen-iframe-content-expected-android-external.txt
@@ -0,0 +1,3 @@ +WebView focusable focused scrollable actions:[CLEAR_FOCUS, AX_FOCUS] bundle:[chromeRole="rootWebArea"] +++View text:"iframe_onscreen" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="group"] +++View text:"iframe_offscreen" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="group"] \ No newline at end of file
diff --git a/content/test/data/accessibility/html/offscreen-iframe-expected-android-external.txt b/content/test/data/accessibility/html/offscreen-iframe-expected-android-external.txt new file mode 100644 index 0000000..a620b58 --- /dev/null +++ b/content/test/data/accessibility/html/offscreen-iframe-expected-android-external.txt
@@ -0,0 +1,6 @@ +WebView focusable focused scrollable actions:[CLEAR_FOCUS, AX_FOCUS] bundle:[chromeRole="rootWebArea"] +++View actions:[AX_FOCUS] bundle:[chromeRole="genericContainer"] +++++View actions:[AX_FOCUS] bundle:[chromeRole="iframe"] +++++++View scrollable actions:[AX_FOCUS, SCROLL_FORWARD, SCROLL_DOWN, PAGE_DOWN] bundle:[chromeRole="rootWebArea"] +++++++++View text:"iframe_onscreen" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="group"] +++++++++View text:"iframe_offscreen" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="group"] \ No newline at end of file
diff --git a/content/test/data/accessibility/html/offscreen-select-expected-android-external.txt b/content/test/data/accessibility/html/offscreen-select-expected-android-external.txt new file mode 100644 index 0000000..6e20b94 --- /dev/null +++ b/content/test/data/accessibility/html/offscreen-select-expected-android-external.txt
@@ -0,0 +1,3 @@ +WebView focusable focused scrollable actions:[CLEAR_FOCUS, AX_FOCUS] bundle:[chromeRole="rootWebArea"] +++View text:"Onscreen 1" canOpenPopUp clickable focusable actions:[FOCUS, CLICK, AX_FOCUS, NEXT, PREVIOUS, EXPAND] bundle:[chromeRole="popUpButton", clickableScore="300", roleDescription="menu pop up button"] +++View text:"Offscreen 1" canOpenPopUp clickable focusable actions:[FOCUS, CLICK, AX_FOCUS, NEXT, PREVIOUS, EXPAND] bundle:[chromeRole="popUpButton", clickableScore="300", roleDescription="menu pop up button"] \ No newline at end of file
diff --git a/content/test/data/accessibility/html/ol-expected-android-external.txt b/content/test/data/accessibility/html/ol-expected-android-external.txt new file mode 100644 index 0000000..7c2d507 --- /dev/null +++ b/content/test/data/accessibility/html/ol-expected-android-external.txt
@@ -0,0 +1,21 @@ +WebView focusable focused scrollable actions:[CLEAR_FOCUS, AX_FOCUS] bundle:[chromeRole="rootWebArea"] +++ListView CollectionInfo:[rows=3, cols=0] actions:[AX_FOCUS] bundle:[chromeRole="list"] +++++View CollectionItemInfo:[rowIndex=0, rowSpan=0, colIndex=0, colSpan=0] actions:[AX_FOCUS] bundle:[chromeRole="listItem"] +++++++View text:"1. " actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="listMarker"] +++++++TextView text:"Chrome" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="staticText"] +++++View CollectionItemInfo:[rowIndex=1, rowSpan=0, colIndex=0, colSpan=0] actions:[AX_FOCUS] bundle:[chromeRole="listItem"] +++++++View text:"2. " actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="listMarker"] +++++++TextView text:"Safari" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="staticText"] +++++View CollectionItemInfo:[rowIndex=2, rowSpan=0, colIndex=0, colSpan=0] actions:[AX_FOCUS] bundle:[chromeRole="listItem"] +++++++View text:"3. " actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="listMarker"] +++++++TextView text:"IE" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="staticText"] +++ListView CollectionInfo:[rows=3, cols=0] actions:[AX_FOCUS] bundle:[chromeRole="list"] +++++View CollectionItemInfo:[rowIndex=0, rowSpan=0, colIndex=0, colSpan=0] actions:[AX_FOCUS] bundle:[chromeRole="listItem"] +++++++View text:"10. " actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="listMarker"] +++++++TextView text:"Android" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="staticText"] +++++View CollectionItemInfo:[rowIndex=1, rowSpan=0, colIndex=0, colSpan=0] actions:[AX_FOCUS] bundle:[chromeRole="listItem"] +++++++View text:"11. " actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="listMarker"] +++++++TextView text:"Mac" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="staticText"] +++++View CollectionItemInfo:[rowIndex=2, rowSpan=0, colIndex=0, colSpan=0] actions:[AX_FOCUS] bundle:[chromeRole="listItem"] +++++++View text:"12. " actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="listMarker"] +++++++TextView text:"Windows" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="staticText"] \ No newline at end of file
diff --git a/content/test/data/accessibility/html/optgroup-expected-android-external.txt b/content/test/data/accessibility/html/optgroup-expected-android-external.txt new file mode 100644 index 0000000..f3bdfcff --- /dev/null +++ b/content/test/data/accessibility/html/optgroup-expected-android-external.txt
@@ -0,0 +1,12 @@ +WebView focusable focused scrollable actions:[CLEAR_FOCUS, AX_FOCUS] bundle:[chromeRole="rootWebArea"] +++View actions:[AX_FOCUS] bundle:[chromeRole="genericContainer"] +++++View viewIdResName:"listbox" canOpenPopUp clickable focusable actions:[FOCUS, CLICK, AX_FOCUS, EXPAND] bundle:[chromeRole="popUpButton", clickableScore="300", roleDescription="menu pop up button"] +++++++View notVisibleToUser actions:[AX_FOCUS] bundle:[chromeRole="menuListPopup"] +++++++++View text:"One" viewIdResName:"listbox_option_enabled_one" clickable focusable notVisibleToUser actions:[FOCUS, CLICK, AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="menuListOption", clickableScore="300"] +++++++++View text:"Two" clickable focusable notVisibleToUser actions:[FOCUS, CLICK, AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="menuListOption", clickableScore="300"] +++++++++View text:"Three" clickable focusable notVisibleToUser actions:[FOCUS, CLICK, AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="menuListOption", clickableScore="300"] +++++++++View text:"Four" clickable focusable notVisibleToUser actions:[FOCUS, CLICK, AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="menuListOption", clickableScore="300"] +++++++++View text:"One" viewIdResName:"listbox_option_disabled_one" clickable disabled notVisibleToUser actions:[CLICK, AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="menuListOption", clickableScore="300"] +++++++++View text:"Two" clickable disabled notVisibleToUser actions:[CLICK, AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="menuListOption", clickableScore="300"] +++++++++View text:"Three" clickable disabled notVisibleToUser actions:[CLICK, AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="menuListOption", clickableScore="300"] +++++++++View text:"Four" clickable disabled notVisibleToUser actions:[CLICK, AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="menuListOption", clickableScore="300"] \ No newline at end of file
diff --git a/content/test/data/accessibility/html/output-expected-android-external.txt b/content/test/data/accessibility/html/output-expected-android-external.txt new file mode 100644 index 0000000..b53aaab2 --- /dev/null +++ b/content/test/data/accessibility/html/output-expected-android-external.txt
@@ -0,0 +1,7 @@ +WebView focusable focused scrollable actions:[CLEAR_FOCUS, AX_FOCUS] bundle:[chromeRole="rootWebArea"] +++View actions:[AX_FOCUS] bundle:[chromeRole="section"] +++++EditText clickable editable focusable inputType:2 textSelectionStart:0 textSelectionEnd:0 actions:[FOCUS, CLICK, AX_FOCUS, PASTE, SET_TEXT, SET_PROGRESS, IME_ENTER] bundle:[chromeRole="spinButton", clickableScore="300", roleDescription="spin button"] +++++TextView text:" + " actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="staticText"] +++++EditText clickable editable focusable inputType:2 textSelectionStart:0 textSelectionEnd:0 actions:[FOCUS, CLICK, AX_FOCUS, PASTE, SET_TEXT, SET_PROGRESS, IME_ENTER] bundle:[chromeRole="spinButton", clickableScore="300", roleDescription="spin button"] +++++TextView text:" =" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="staticText"] +++++View actions:[AX_FOCUS] bundle:[chromeRole="status", roleDescription="status"] \ No newline at end of file
diff --git a/content/test/data/accessibility/html/overflow-actions-expected-android-external.txt b/content/test/data/accessibility/html/overflow-actions-expected-android-external.txt new file mode 100644 index 0000000..914b9b28 --- /dev/null +++ b/content/test/data/accessibility/html/overflow-actions-expected-android-external.txt
@@ -0,0 +1,7 @@ +WebView focusable focused scrollable actions:[CLEAR_FOCUS, AX_FOCUS] bundle:[chromeRole="rootWebArea"] +++View scrollable actions:[AX_FOCUS, SCROLL_FORWARD, SCROLL_DOWN, PAGE_DOWN] bundle:[chromeRole="genericContainer"] +++++TextView text:"Example Paragraph 1" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="paragraph"] +++++TextView text:"Example Paragraph 2" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="paragraph"] +++View actions:[AX_FOCUS] bundle:[chromeRole="genericContainer"] +++++TextView text:"Example Paragraph 1" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="paragraph"] +++++TextView text:"Example Paragraph 2" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="paragraph"] \ No newline at end of file
diff --git a/content/test/data/accessibility/html/p-expected-android-external.txt b/content/test/data/accessibility/html/p-expected-android-external.txt new file mode 100644 index 0000000..57bd1a2 --- /dev/null +++ b/content/test/data/accessibility/html/p-expected-android-external.txt
@@ -0,0 +1,4 @@ +WebView focusable focused scrollable actions:[CLEAR_FOCUS, AX_FOCUS] bundle:[chromeRole="rootWebArea"] +++TextView text:"Before" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="staticText"] +++TextView text:"Paragraph" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="paragraph"] +++TextView text:"After" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="staticText"] \ No newline at end of file
diff --git a/content/test/data/accessibility/html/param-expected-android-external.txt b/content/test/data/accessibility/html/param-expected-android-external.txt new file mode 100644 index 0000000..e1ecb4e --- /dev/null +++ b/content/test/data/accessibility/html/param-expected-android-external.txt
@@ -0,0 +1,3 @@ +WebView focusable focused scrollable actions:[CLEAR_FOCUS, AX_FOCUS] bundle:[chromeRole="rootWebArea"] +++View actions:[AX_FOCUS] bundle:[chromeRole="genericContainer"] +++++View actions:[AX_FOCUS] bundle:[chromeRole="pluginObject", roleDescription="object"] \ No newline at end of file
diff --git a/content/test/data/accessibility/html/picture-expected-android-external.txt b/content/test/data/accessibility/html/picture-expected-android-external.txt new file mode 100644 index 0000000..5b90f30 --- /dev/null +++ b/content/test/data/accessibility/html/picture-expected-android-external.txt
@@ -0,0 +1,5 @@ +WebView focusable focused scrollable actions:[CLEAR_FOCUS, AX_FOCUS] bundle:[chromeRole="rootWebArea", hasImage="true"] +++View actions:[AX_FOCUS] bundle:[chromeRole="genericContainer", hasImage="true"] +++++Image text:"x" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="image", hasImage="true", roleDescription="graphic", targetUrl="file:///storage/emulated/0/chromium_tests_root/content/test/data/accessibility/html/400.webp"] +++++Image text:" " actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="image", hasImage="true", roleDescription="graphic", targetUrl="file:///storage/emulated/0/chromium_tests_root/content/test/data/accessibility/html/400.webp"] +++++Image text:"400" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="image", hasImage="true", roleDescription="graphic", targetUrl="file:///storage/emulated/0/chromium_tests_root/content/test/data/accessibility/html/400.webp"] \ No newline at end of file
diff --git a/content/test/data/accessibility/html/portal-expected-android-external.txt b/content/test/data/accessibility/html/portal-expected-android-external.txt new file mode 100644 index 0000000..3eb1fe9 --- /dev/null +++ b/content/test/data/accessibility/html/portal-expected-android-external.txt
@@ -0,0 +1,4 @@ +WebView focusable focused scrollable actions:[CLEAR_FOCUS, AX_FOCUS] bundle:[chromeRole="rootWebArea"] +++TextView text:"Before portal" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="paragraph"] +++TextView text:"portal" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="genericContainer"] +++TextView text:"After portal" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="paragraph"] \ No newline at end of file
diff --git a/content/test/data/accessibility/html/portal-with-widget-inside-expected-android-external.txt b/content/test/data/accessibility/html/portal-with-widget-inside-expected-android-external.txt new file mode 100644 index 0000000..3eb1fe9 --- /dev/null +++ b/content/test/data/accessibility/html/portal-with-widget-inside-expected-android-external.txt
@@ -0,0 +1,4 @@ +WebView focusable focused scrollable actions:[CLEAR_FOCUS, AX_FOCUS] bundle:[chromeRole="rootWebArea"] +++TextView text:"Before portal" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="paragraph"] +++TextView text:"portal" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="genericContainer"] +++TextView text:"After portal" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="paragraph"] \ No newline at end of file
diff --git a/content/test/data/accessibility/html/pre-expected-android-external.txt b/content/test/data/accessibility/html/pre-expected-android-external.txt new file mode 100644 index 0000000..c51a66b --- /dev/null +++ b/content/test/data/accessibility/html/pre-expected-android-external.txt
@@ -0,0 +1,5 @@ +WebView focusable focused scrollable actions:[CLEAR_FOCUS, AX_FOCUS] bundle:[chromeRole="rootWebArea"] +++TextView text:"This test is to check pre\nformatting." viewIdResName:"pre" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="pre"] +++TextView text:"This test is to check pre\nformatting" viewIdResName:"div-pre" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="genericContainer"] +++TextView text:"This test is to check pre\nformatting." viewIdResName:"div-pre-wrap" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="genericContainer"] +++TextView text:"This test is to check pre formatting." viewIdResName:"div-normal" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="genericContainer"] \ No newline at end of file
diff --git a/content/test/data/accessibility/html/progress-expected-android-external.txt b/content/test/data/accessibility/html/progress-expected-android-external.txt new file mode 100644 index 0000000..599873db --- /dev/null +++ b/content/test/data/accessibility/html/progress-expected-android-external.txt
@@ -0,0 +1,4 @@ +WebView focusable focused scrollable actions:[CLEAR_FOCUS, AX_FOCUS] bundle:[chromeRole="rootWebArea"] +++View actions:[AX_FOCUS] bundle:[chromeRole="genericContainer"] +++++ProgressBar text:"22" RangeInfo:[current=22.0, min=0.0, max=100.0] actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="progressIndicator", roleDescription="progress indicator"] +++++ProgressBar text:"indeterminate" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="progressIndicator", roleDescription="progress indicator"] \ No newline at end of file
diff --git a/content/test/data/accessibility/html/q-expected-android-external.txt b/content/test/data/accessibility/html/q-expected-android-external.txt new file mode 100644 index 0000000..6db5226 --- /dev/null +++ b/content/test/data/accessibility/html/q-expected-android-external.txt
@@ -0,0 +1,2 @@ +WebView focusable focused scrollable actions:[CLEAR_FOCUS, AX_FOCUS] bundle:[chromeRole="rootWebArea"] +++TextView text:"This is "Chromium Blink" based browser." actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="paragraph"] \ No newline at end of file
diff --git a/content/test/data/accessibility/html/replaced-node-across-trees-expected-android-external.txt b/content/test/data/accessibility/html/replaced-node-across-trees-expected-android-external.txt new file mode 100644 index 0000000..0297e6f --- /dev/null +++ b/content/test/data/accessibility/html/replaced-node-across-trees-expected-android-external.txt
@@ -0,0 +1,8 @@ +WebView focusable focused scrollable actions:[CLEAR_FOCUS, AX_FOCUS] bundle:[chromeRole="rootWebArea"] +++TextView text:"Before frame" viewIdResName:"s1" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="genericContainer"] +++View actions:[AX_FOCUS] bundle:[chromeRole="genericContainer"] +++++View focusable actions:[FOCUS, AX_FOCUS] bundle:[chromeRole="iframe"] +++++++View scrollable actions:[AX_FOCUS] bundle:[chromeRole="rootWebArea"] +++++++++View actions:[AX_FOCUS] bundle:[chromeRole="genericContainer"] +++++++++++TextView text:"Text in iframe" viewIdResName:"s1" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="genericContainer"] +++TextView text:"After frame" viewIdResName:"s2" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="genericContainer"] \ No newline at end of file
diff --git a/content/test/data/accessibility/html/ruby-expected-android-external.txt b/content/test/data/accessibility/html/ruby-expected-android-external.txt new file mode 100644 index 0000000..54027b91 --- /dev/null +++ b/content/test/data/accessibility/html/ruby-expected-android-external.txt
@@ -0,0 +1,7 @@ +WebView focusable focused scrollable actions:[CLEAR_FOCUS, AX_FOCUS] bundle:[chromeRole="rootWebArea"] +++View text:"ruby base" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="ruby", hint="ruby text"] +++View actions:[AX_FOCUS] bundle:[chromeRole="paragraph"] +++++View text:"ruby base" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="ruby", hint="ruby text"] +++View actions:[AX_FOCUS] bundle:[chromeRole="paragraph"] +++++TextView text:"Hi! " actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="staticText"] +++++View text:"ruby base" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="ruby", hint="ruby text"] \ No newline at end of file
diff --git a/content/test/data/accessibility/html/s-expected-android-external.txt b/content/test/data/accessibility/html/s-expected-android-external.txt new file mode 100644 index 0000000..e96a8d0 --- /dev/null +++ b/content/test/data/accessibility/html/s-expected-android-external.txt
@@ -0,0 +1,2 @@ +WebView focusable focused scrollable actions:[CLEAR_FOCUS, AX_FOCUS] bundle:[chromeRole="rootWebArea"] +++TextView text:"My car is blue." actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="genericContainer"] \ No newline at end of file
diff --git a/content/test/data/accessibility/html/samp-expected-android-external.txt b/content/test/data/accessibility/html/samp-expected-android-external.txt new file mode 100644 index 0000000..9c31122 --- /dev/null +++ b/content/test/data/accessibility/html/samp-expected-android-external.txt
@@ -0,0 +1,2 @@ +WebView focusable focused scrollable actions:[CLEAR_FOCUS, AX_FOCUS] bundle:[chromeRole="rootWebArea"] +++TextView text:"Sample output from a computer program" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="genericContainer"] \ No newline at end of file
diff --git a/content/test/data/accessibility/html/scrollable-expected-android-external.txt b/content/test/data/accessibility/html/scrollable-expected-android-external.txt new file mode 100644 index 0000000..2d160005 --- /dev/null +++ b/content/test/data/accessibility/html/scrollable-expected-android-external.txt
@@ -0,0 +1,4 @@ +WebView focusable focused scrollable actions:[CLEAR_FOCUS, AX_FOCUS] bundle:[chromeRole="rootWebArea"] +++TextView text:"not scrollable" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="genericContainer"] +++TextView scrollable actions:[AX_FOCUS, SCROLL_FORWARD, SCROLL_RIGHT, PAGE_RIGHT] bundle:[chromeRole="genericContainer"] +++TextView scrollable actions:[AX_FOCUS, SCROLL_FORWARD, SCROLL_DOWN, PAGE_DOWN] bundle:[chromeRole="genericContainer"] \ No newline at end of file
diff --git a/content/test/data/accessibility/html/scrollable-overflow-expected-android-external.txt b/content/test/data/accessibility/html/scrollable-overflow-expected-android-external.txt new file mode 100644 index 0000000..4d6b4dc --- /dev/null +++ b/content/test/data/accessibility/html/scrollable-overflow-expected-android-external.txt
@@ -0,0 +1,26 @@ +WebView focusable focused scrollable actions:[CLEAR_FOCUS, AX_FOCUS] bundle:[chromeRole="rootWebArea"] +++TextView text:"no overflow" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="paragraph"] +++TextView text:"clipped large lots of text more text" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="paragraph"] +++EditText text:"ab cd" clickable editable focusable multiLine scrollable textSelectionStart:0 textSelectionEnd:0 actions:[FOCUS, CLICK, AX_FOCUS, NEXT, PREVIOUS, SCROLL_FORWARD, COPY, PASTE, CUT, SET_SELECTION, SET_TEXT, SCROLL_DOWN, PAGE_DOWN, IME_ENTER] bundle:[chromeRole="textField", clickableScore="300"] +++View actions:[AX_FOCUS] bundle:[chromeRole="genericContainer"] +++++TextView text:"tiny" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="paragraph"] +++View actions:[AX_FOCUS] bundle:[chromeRole="group"] +++++View actions:[AX_FOCUS] bundle:[chromeRole="genericContainer"] +++++++TextView text:"x=hidden" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="paragraph"] +++++View scrollable actions:[AX_FOCUS, SCROLL_FORWARD, SCROLL_DOWN, SCROLL_RIGHT, PAGE_DOWN, PAGE_RIGHT] bundle:[chromeRole="genericContainer"] +++++++TextView text:"x=hidden" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="paragraph"] +++++View scrollable actions:[AX_FOCUS, SCROLL_FORWARD, SCROLL_RIGHT, PAGE_RIGHT] bundle:[chromeRole="genericContainer"] +++++++TextView text:"x=auto" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="paragraph"] +++++View scrollable actions:[AX_FOCUS, SCROLL_FORWARD, SCROLL_RIGHT, PAGE_RIGHT] bundle:[chromeRole="genericContainer"] +++++++TextView text:"x=scroll" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="paragraph"] +++++TextView text:"x=visible" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="paragraph"] +++View actions:[AX_FOCUS] bundle:[chromeRole="group"] +++++View actions:[AX_FOCUS] bundle:[chromeRole="genericContainer"] +++++++TextView text:"y=hidden" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="paragraph"] +++++View scrollable actions:[AX_FOCUS, SCROLL_FORWARD, SCROLL_DOWN, SCROLL_RIGHT, PAGE_DOWN, PAGE_RIGHT] bundle:[chromeRole="genericContainer"] +++++++TextView text:"y=hidden" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="paragraph"] +++++View scrollable actions:[AX_FOCUS, SCROLL_FORWARD, SCROLL_DOWN, PAGE_DOWN] bundle:[chromeRole="genericContainer"] +++++++TextView text:"y=auto" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="paragraph"] +++++View scrollable actions:[AX_FOCUS, SCROLL_FORWARD, SCROLL_DOWN, PAGE_DOWN] bundle:[chromeRole="genericContainer"] +++++++TextView text:"y=scroll" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="paragraph"] +++++TextView text:"y=visible" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="paragraph"] \ No newline at end of file
diff --git a/content/test/data/accessibility/html/scrollable-textarea-expected-android-external.txt b/content/test/data/accessibility/html/scrollable-textarea-expected-android-external.txt new file mode 100644 index 0000000..a23e189 --- /dev/null +++ b/content/test/data/accessibility/html/scrollable-textarea-expected-android-external.txt
@@ -0,0 +1,4 @@ +WebView focusable focused scrollable actions:[CLEAR_FOCUS, AX_FOCUS] bundle:[chromeRole="rootWebArea"] +++View actions:[AX_FOCUS] bundle:[chromeRole="genericContainer"] +++++EditText text:"little" clickable editable focusable multiLine textSelectionStart:0 textSelectionEnd:0 actions:[FOCUS, CLICK, AX_FOCUS, NEXT, PREVIOUS, COPY, PASTE, CUT, SET_SELECTION, SET_TEXT, IME_ENTER] bundle:[chromeRole="textField", clickableScore="300"] +++++EditText text:"lots+of+text+ lots+of+text+ lots+of+text+ lots+of+text+ lots+of+text+ lots+of+text+ lots+of+text+ lots+of+text+ lots+of+text+ lots+of+text+ lots+of+text+ lots+of+text" clickable editable focusable multiLine scrollable textSelectionStart:0 textSelectionEnd:0 actions:[FOCUS, CLICK, AX_FOCUS, NEXT, PREVIOUS, SCROLL_FORWARD, COPY, PASTE, CUT, SET_SELECTION, SET_TEXT, SCROLL_DOWN, PAGE_DOWN, IME_ENTER] bundle:[chromeRole="textField", clickableScore="300"] \ No newline at end of file
diff --git a/content/test/data/accessibility/html/section-expected-android-external.txt b/content/test/data/accessibility/html/section-expected-android-external.txt new file mode 100644 index 0000000..bb679f84 --- /dev/null +++ b/content/test/data/accessibility/html/section-expected-android-external.txt
@@ -0,0 +1,6 @@ +WebView focusable focused scrollable actions:[CLEAR_FOCUS, AX_FOCUS] bundle:[chromeRole="rootWebArea"] +++View text:"An unnamed section element gets the section role." actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="section"] +++View text:"name" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="region", roleDescription="region"] +++View text:"Named section element #2 gets the region role" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="region", roleDescription="region"] +++++TextView text:"Named section element #2 gets the region role" viewIdResName:"section1" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="genericContainer"] +++View text:"name" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="region", roleDescription="region"] \ No newline at end of file
diff --git a/content/test/data/accessibility/html/select-expected-android-external.txt b/content/test/data/accessibility/html/select-expected-android-external.txt new file mode 100644 index 0000000..7fcd8392 --- /dev/null +++ b/content/test/data/accessibility/html/select-expected-android-external.txt
@@ -0,0 +1,11 @@ +WebView focusable focused scrollable actions:[CLEAR_FOCUS, AX_FOCUS] bundle:[chromeRole="rootWebArea"] +++View actions:[AX_FOCUS] bundle:[chromeRole="genericContainer"] +++++View text:"Placeholder option" viewIdResName:"A" canOpenPopUp clickable focusable actions:[FOCUS, CLICK, AX_FOCUS, NEXT, PREVIOUS, EXPAND] bundle:[chromeRole="popUpButton", clickableScore="300", roleDescription="menu pop up button"] +++++View text:"Option 2" viewIdResName:"B" canOpenPopUp clickable focusable actions:[FOCUS, CLICK, AX_FOCUS, NEXT, PREVIOUS, EXPAND] bundle:[chromeRole="popUpButton", clickableScore="300", roleDescription="menu pop up button"] +++++View text:"Option 1" viewIdResName:"C" canOpenPopUp clickable focusable actions:[FOCUS, CLICK, AX_FOCUS, NEXT, PREVIOUS, EXPAND] bundle:[chromeRole="popUpButton", clickableScore="300", roleDescription="menu pop up button"] +++++View text:"0 selected" viewIdResName:"D" canOpenPopUp clickable focusable actions:[FOCUS, CLICK, AX_FOCUS, NEXT, PREVIOUS, EXPAND] bundle:[chromeRole="popUpButton", clickableScore="300", roleDescription="menu pop up button"] +++++View viewIdResName:"E" canOpenPopUp clickable focusable actions:[FOCUS, CLICK, AX_FOCUS, EXPAND] bundle:[chromeRole="popUpButton", clickableScore="300", roleDescription="menu pop up button"] +++++++View notVisibleToUser actions:[AX_FOCUS] bundle:[chromeRole="menuListPopup"] +++++++++View text:"Option 1" clickable focusable notVisibleToUser actions:[FOCUS, CLICK, AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="menuListOption", clickableScore="300"] +++++++++View text:"Option 2" clickable focusable notVisibleToUser actions:[FOCUS, CLICK, AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="menuListOption", clickableScore="300"] +++++++++View text:"Option 3" clickable focusable notVisibleToUser actions:[FOCUS, CLICK, AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="menuListOption", clickableScore="300"] \ No newline at end of file
diff --git a/content/test/data/accessibility/html/selection-container-expected-android-external.txt b/content/test/data/accessibility/html/selection-container-expected-android-external.txt new file mode 100644 index 0000000..4f92284 --- /dev/null +++ b/content/test/data/accessibility/html/selection-container-expected-android-external.txt
@@ -0,0 +1,3 @@ +WebView focusable focused scrollable actions:[CLEAR_FOCUS, AX_FOCUS] bundle:[chromeRole="rootWebArea"] +++View actions:[AX_FOCUS] bundle:[chromeRole="genericContainer"] +++++View text:"selection_list" viewIdResName:"listbox" canOpenPopUp clickable focusable actions:[FOCUS, CLICK, AX_FOCUS, NEXT, PREVIOUS, EXPAND] bundle:[chromeRole="popUpButton", clickableScore="300", roleDescription="menu pop up button"] \ No newline at end of file
diff --git a/content/test/data/accessibility/html/selectmenu-expected-android-external.txt b/content/test/data/accessibility/html/selectmenu-expected-android-external.txt new file mode 100644 index 0000000..d373a3e4 --- /dev/null +++ b/content/test/data/accessibility/html/selectmenu-expected-android-external.txt
@@ -0,0 +1,11 @@ +WebView focusable focused scrollable actions:[CLEAR_FOCUS, AX_FOCUS] bundle:[chromeRole="rootWebArea"] +++View actions:[AX_FOCUS] bundle:[chromeRole="genericContainer"] +++++View viewIdResName:"A" actions:[AX_FOCUS] bundle:[chromeRole="genericContainer"] +++++++View text:"Option 1, in list, item 1 of 0" clickable focusable CollectionItemInfo:[rowIndex=0, rowSpan=0, colIndex=0, colSpan=0] actions:[FOCUS, CLICK, AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="listBoxOption", clickableScore="200"] +++++++View text:"Option 2, in list, item 1 of 0" clickable focusable CollectionItemInfo:[rowIndex=0, rowSpan=0, colIndex=0, colSpan=0] actions:[FOCUS, CLICK, AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="listBoxOption", clickableScore="200"] +++++++View text:"Option 3, in list, item 1 of 0" clickable focusable CollectionItemInfo:[rowIndex=0, rowSpan=0, colIndex=0, colSpan=0] actions:[FOCUS, CLICK, AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="listBoxOption", clickableScore="200"] +++++View viewIdResName:"B" actions:[AX_FOCUS] bundle:[chromeRole="genericContainer"] +++++++TextView text:"Custom selectmenu button" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="genericContainer"] +++++++View text:"Option 1, in list, item 1 of 0" clickable focusable CollectionItemInfo:[rowIndex=0, rowSpan=0, colIndex=0, colSpan=0] actions:[FOCUS, CLICK, AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="listBoxOption", clickableScore="200"] +++++++View text:"Option 2, in list, item 1 of 0" clickable focusable CollectionItemInfo:[rowIndex=0, rowSpan=0, colIndex=0, colSpan=0] actions:[FOCUS, CLICK, AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="listBoxOption", clickableScore="200"] +++++++View text:"Option 3, in list, item 1 of 0" clickable focusable CollectionItemInfo:[rowIndex=0, rowSpan=0, colIndex=0, colSpan=0] actions:[FOCUS, CLICK, AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="listBoxOption", clickableScore="200"] \ No newline at end of file
diff --git a/content/test/data/accessibility/html/simple_spans-expected-android-external.txt b/content/test/data/accessibility/html/simple_spans-expected-android-external.txt new file mode 100644 index 0000000..bbe49ae --- /dev/null +++ b/content/test/data/accessibility/html/simple_spans-expected-android-external.txt
@@ -0,0 +1,5 @@ +WebView focusable focused scrollable actions:[CLEAR_FOCUS, AX_FOCUS] bundle:[chromeRole="rootWebArea"] +++View actions:[AX_FOCUS] bundle:[chromeRole="genericContainer"] +++++TextView text:"Some text" viewIdResName:"s1" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="genericContainer"] +++++TextView text:" " actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="staticText"] +++++TextView text:"3.14159" viewIdResName:"s2" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="genericContainer"] \ No newline at end of file
diff --git a/content/test/data/accessibility/html/small-expected-android-external.txt b/content/test/data/accessibility/html/small-expected-android-external.txt new file mode 100644 index 0000000..09584c05 --- /dev/null +++ b/content/test/data/accessibility/html/small-expected-android-external.txt
@@ -0,0 +1,2 @@ +WebView focusable focused scrollable actions:[CLEAR_FOCUS, AX_FOCUS] bundle:[chromeRole="rootWebArea"] +++TextView text:"Chromiumopen source project" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="paragraph"] \ No newline at end of file
diff --git a/content/test/data/accessibility/html/span-expected-android-external.txt b/content/test/data/accessibility/html/span-expected-android-external.txt new file mode 100644 index 0000000..009be53 --- /dev/null +++ b/content/test/data/accessibility/html/span-expected-android-external.txt
@@ -0,0 +1,40 @@ +WebView focusable focused scrollable actions:[CLEAR_FOCUS, AX_FOCUS] bundle:[chromeRole="rootWebArea"] +++TextView text:"This paragraph has text in spans." actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="paragraph"] +++View actions:[AX_FOCUS] bundle:[chromeRole="paragraph"] +++++TextView text:"E1. Eat" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="staticText"] +++++TextView text:" " actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="staticText"] +++++View text:"null" contentDescription:"space" clickable focusable actions:[FOCUS, CLICK, AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="link", clickableScore="300", roleDescription="link", targetUrl="file:///storage/emulated/0/chromium_tests_root/content/test/data/accessibility/html/span.html#"] +++++++TextView text:"space" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="staticText"] +++View actions:[AX_FOCUS] bundle:[chromeRole="paragraph"] +++++TextView text:"E2. Eat" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="staticText"] +++++TextView text:" " actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="staticText"] +++++View text:"null" contentDescription:"space" clickable focusable actions:[FOCUS, CLICK, AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="link", clickableScore="300", roleDescription="link", targetUrl="file:///storage/emulated/0/chromium_tests_root/content/test/data/accessibility/html/span.html#"] +++++++TextView text:"space" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="staticText"] +++View actions:[AX_FOCUS] bundle:[chromeRole="paragraph"] +++++TextView text:"E3. Eat" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="staticText"] +++++TextView text:" " actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="staticText"] +++++View text:"null" contentDescription:"space" clickable focusable actions:[FOCUS, CLICK, AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="link", clickableScore="300", roleDescription="link", targetUrl="file:///storage/emulated/0/chromium_tests_root/content/test/data/accessibility/html/span.html#"] +++++++TextView text:"space" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="staticText"] +++View actions:[AX_FOCUS] bundle:[chromeRole="paragraph"] +++++View text:"null" contentDescription:"E4. Eat" clickable focusable actions:[FOCUS, CLICK, AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="link", clickableScore="300", roleDescription="link", targetUrl="file:///storage/emulated/0/chromium_tests_root/content/test/data/accessibility/html/span.html#"] +++++++TextView text:"E4. Eat" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="staticText"] +++++TextView text:" " actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="staticText"] +++++TextView text:"space" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="staticText"] +++View actions:[AX_FOCUS] bundle:[chromeRole="paragraph"] +++++View text:"null" contentDescription:"E5. Eat" clickable focusable actions:[FOCUS, CLICK, AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="link", clickableScore="300", roleDescription="link", targetUrl="file:///storage/emulated/0/chromium_tests_root/content/test/data/accessibility/html/span.html#"] +++++++TextView text:"E5. Eat" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="staticText"] +++++TextView text:" " actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="staticText"] +++++TextView text:"space" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="staticText"] +++View actions:[AX_FOCUS] bundle:[chromeRole="paragraph"] +++++View text:"null" contentDescription:"E6. Eat" clickable focusable actions:[FOCUS, CLICK, AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="link", clickableScore="300", roleDescription="link", targetUrl="file:///storage/emulated/0/chromium_tests_root/content/test/data/accessibility/html/span.html#"] +++++++TextView text:"E6. Eat" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="staticText"] +++++TextView text:" " actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="staticText"] +++++TextView text:"space" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="staticText"] +++TextView text:"K1. Keep space" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="paragraph"] +++TextView text:"K2. Keep space" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="paragraph"] +++TextView text:"K3. Keep space" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="paragraph"] +++TextView text:"K4. Keep space" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="paragraph"] +++TextView text:"K5. Keep space" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="paragraph"] +++TextView text:"K6. Keep space" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="paragraph"] +++TextView text:"K7. Keep space" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="paragraph"] +++TextView text:"K8. Keep space" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="paragraph"] \ No newline at end of file
diff --git a/content/test/data/accessibility/html/spans-separated-by-space-expected-android-external.txt b/content/test/data/accessibility/html/spans-separated-by-space-expected-android-external.txt new file mode 100644 index 0000000..984671b --- /dev/null +++ b/content/test/data/accessibility/html/spans-separated-by-space-expected-android-external.txt
@@ -0,0 +1,2 @@ +WebView focusable focused scrollable actions:[CLEAR_FOCUS, AX_FOCUS] bundle:[chromeRole="rootWebArea"] +++TextView text:"Hello world" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="genericContainer"] \ No newline at end of file
diff --git a/content/test/data/accessibility/html/strong-expected-android-external.txt b/content/test/data/accessibility/html/strong-expected-android-external.txt new file mode 100644 index 0000000..8d43a3173 --- /dev/null +++ b/content/test/data/accessibility/html/strong-expected-android-external.txt
@@ -0,0 +1,2 @@ +WebView focusable focused scrollable actions:[CLEAR_FOCUS, AX_FOCUS] bundle:[chromeRole="rootWebArea"] +++TextView text:"Strong text" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="genericContainer"] \ No newline at end of file
diff --git a/content/test/data/accessibility/html/sub-expected-android-external.txt b/content/test/data/accessibility/html/sub-expected-android-external.txt new file mode 100644 index 0000000..e87871b --- /dev/null +++ b/content/test/data/accessibility/html/sub-expected-android-external.txt
@@ -0,0 +1,17 @@ +WebView focusable focused scrollable actions:[CLEAR_FOCUS, AX_FOCUS] bundle:[chromeRole="rootWebArea"] +++View actions:[AX_FOCUS] bundle:[chromeRole="paragraph"] +++++TextView text:"This text contains " actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="staticText"] +++++View text:"subscript" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="subscript"] +++++TextView text:" text." actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="staticText"] +++View actions:[AX_FOCUS] bundle:[chromeRole="paragraph"] +++++TextView text:"H" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="staticText"] +++++View actions:[AX_FOCUS] bundle:[chromeRole="subscript"] +++++++TextView text:" " actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="staticText"] +++++++View actions:[AX_FOCUS] bundle:[chromeRole="contentDeletion", roleDescription="deletion"] +++++++++View text:"3" focusable actions:[FOCUS, AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="genericContainer"] +++++++TextView text:" " actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="staticText"] +++++++View actions:[AX_FOCUS] bundle:[chromeRole="contentInsertion", roleDescription="insertion"] +++++++++View text:"null" contentDescription:"2" clickable focusable actions:[FOCUS, CLICK, AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="link", clickableScore="300", roleDescription="link", targetUrl="file:///storage/emulated/0/chromium_tests_root/content/test/data/accessibility/html/sub.html#"] +++++++++++TextView text:"better" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="genericContainer", clickableScore="100"] +++++++TextView text:" " actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="staticText"] +++++TextView text:"O" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="staticText"] \ No newline at end of file
diff --git a/content/test/data/accessibility/html/summary-expected-android-external.txt b/content/test/data/accessibility/html/summary-expected-android-external.txt new file mode 100644 index 0000000..1fad624e --- /dev/null +++ b/content/test/data/accessibility/html/summary-expected-android-external.txt
@@ -0,0 +1,5 @@ +WebView focusable focused scrollable actions:[CLEAR_FOCUS, AX_FOCUS] bundle:[chromeRole="rootWebArea"] +++View actions:[AX_FOCUS] bundle:[chromeRole="details"] +++++View text:"details tag" clickable focusable actions:[FOCUS, CLICK, AX_FOCUS, NEXT, PREVIOUS, EXPAND] bundle:[chromeRole="disclosureTriangle", clickableScore="300", roleDescription="disclosure triangle"] +++View actions:[AX_FOCUS] bundle:[chromeRole="details"] +++++View text:"name" clickable focusable actions:[FOCUS, CLICK, AX_FOCUS, NEXT, PREVIOUS, EXPAND] bundle:[chromeRole="disclosureTriangle", clickableScore="300", hint="details #2", roleDescription="disclosure triangle"] \ No newline at end of file
diff --git a/content/test/data/accessibility/html/sup-expected-android-external.txt b/content/test/data/accessibility/html/sup-expected-android-external.txt new file mode 100644 index 0000000..9a7d07f2 --- /dev/null +++ b/content/test/data/accessibility/html/sup-expected-android-external.txt
@@ -0,0 +1,5 @@ +WebView focusable focused scrollable actions:[CLEAR_FOCUS, AX_FOCUS] bundle:[chromeRole="rootWebArea"] +++View actions:[AX_FOCUS] bundle:[chromeRole="paragraph"] +++++TextView text:"This text contains" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="staticText"] +++++View text:"superscript" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="superscript"] +++++TextView text:"text." actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="staticText"] \ No newline at end of file
diff --git a/content/test/data/accessibility/html/svg-as-object-source-expected-android-external.txt b/content/test/data/accessibility/html/svg-as-object-source-expected-android-external.txt new file mode 100644 index 0000000..e57c8a5 --- /dev/null +++ b/content/test/data/accessibility/html/svg-as-object-source-expected-android-external.txt
@@ -0,0 +1,4 @@ +WebView focusable focused scrollable actions:[CLEAR_FOCUS, AX_FOCUS] bundle:[chromeRole="rootWebArea"] +++View actions:[AX_FOCUS] bundle:[chromeRole="genericContainer"] +++++View text:"object without space" focusable actions:[FOCUS, AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="pluginObject", roleDescription="object"] +++++View text:"object with space" focusable actions:[FOCUS, AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="pluginObject", roleDescription="object"] \ No newline at end of file
diff --git a/content/test/data/accessibility/html/svg-child-of-button-expected-android-external.txt b/content/test/data/accessibility/html/svg-child-of-button-expected-android-external.txt new file mode 100644 index 0000000..39488e5 --- /dev/null +++ b/content/test/data/accessibility/html/svg-child-of-button-expected-android-external.txt
@@ -0,0 +1,3 @@ +WebView focusable focused scrollable actions:[CLEAR_FOCUS, AX_FOCUS] bundle:[chromeRole="rootWebArea", hasImage="true"] +++View actions:[AX_FOCUS] bundle:[chromeRole="genericContainer", hasImage="true"] +++++Button text:"Search" clickable focusable actions:[FOCUS, CLICK, AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="button", clickableScore="300", hasImage="true", roleDescription="button"] \ No newline at end of file
diff --git a/content/test/data/accessibility/html/svg-child-of-svg-expected-android-external.txt b/content/test/data/accessibility/html/svg-child-of-svg-expected-android-external.txt new file mode 100644 index 0000000..8e2851e --- /dev/null +++ b/content/test/data/accessibility/html/svg-child-of-svg-expected-android-external.txt
@@ -0,0 +1,6 @@ +WebView focusable focused scrollable actions:[CLEAR_FOCUS, AX_FOCUS] bundle:[chromeRole="rootWebArea", hasImage="true"] +++View actions:[AX_FOCUS] bundle:[chromeRole="genericContainer", hasImage="true"] +++++Image text:"Has two simple children" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="image", hasImage="true", roleDescription="graphic"] +++++Image text:"Has two focusable children" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="svgRoot", hasImage="true", roleDescription="graphic"] +++++++View focusable actions:[FOCUS, AX_FOCUS] bundle:[chromeRole="group"] +++++++View focusable actions:[FOCUS, AX_FOCUS] bundle:[chromeRole="group"] \ No newline at end of file
diff --git a/content/test/data/accessibility/html/svg-desc-in-group-expected-android-external.txt b/content/test/data/accessibility/html/svg-desc-in-group-expected-android-external.txt new file mode 100644 index 0000000..4f2814a --- /dev/null +++ b/content/test/data/accessibility/html/svg-desc-in-group-expected-android-external.txt
@@ -0,0 +1,5 @@ +WebView focusable focused scrollable actions:[CLEAR_FOCUS, AX_FOCUS] bundle:[chromeRole="rootWebArea", hasImage="true"] +++View actions:[AX_FOCUS] bundle:[chromeRole="genericContainer", hasImage="true"] +++++Image actions:[AX_FOCUS] bundle:[chromeRole="svgRoot", hasImage="true", roleDescription="graphic"] +++++++View actions:[AX_FOCUS] bundle:[chromeRole="group", hint="Group with circle and text"] +++++++++TextView text:"hello world" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="genericContainer"] \ No newline at end of file
diff --git a/content/test/data/accessibility/html/svg-expected-android-external.txt b/content/test/data/accessibility/html/svg-expected-android-external.txt new file mode 100644 index 0000000..0ac6bf1 --- /dev/null +++ b/content/test/data/accessibility/html/svg-expected-android-external.txt
@@ -0,0 +1,4 @@ +WebView focusable focused scrollable actions:[CLEAR_FOCUS, AX_FOCUS] bundle:[chromeRole="rootWebArea", hasImage="true"] +++View actions:[AX_FOCUS] bundle:[chromeRole="genericContainer", hasImage="true"] +++++Image text:"svg" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="svgRoot", hasImage="true", hint="SVG Title Tag", roleDescription="graphic"] +++++++TextView text:"Test" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="genericContainer"] \ No newline at end of file
diff --git a/content/test/data/accessibility/html/svg-style-element-expected-android-external.txt b/content/test/data/accessibility/html/svg-style-element-expected-android-external.txt new file mode 100644 index 0000000..b1a19ee4 --- /dev/null +++ b/content/test/data/accessibility/html/svg-style-element-expected-android-external.txt
@@ -0,0 +1,3 @@ +WebView focusable focused scrollable actions:[CLEAR_FOCUS, AX_FOCUS] bundle:[chromeRole="rootWebArea"] +++View actions:[AX_FOCUS] bundle:[chromeRole="genericContainer"] +++++Button text:"Kettle" clickable focusable actions:[FOCUS, CLICK, AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="button", clickableScore="300", roleDescription="button"] \ No newline at end of file
diff --git a/content/test/data/accessibility/html/svg-symbol-with-role-expected-android-external.txt b/content/test/data/accessibility/html/svg-symbol-with-role-expected-android-external.txt new file mode 100644 index 0000000..0bb22b2 --- /dev/null +++ b/content/test/data/accessibility/html/svg-symbol-with-role-expected-android-external.txt
@@ -0,0 +1,5 @@ +WebView focusable focused scrollable actions:[CLEAR_FOCUS, AX_FOCUS] bundle:[chromeRole="rootWebArea", hasImage="true"] +++View actions:[AX_FOCUS] bundle:[chromeRole="genericContainer", hasImage="true"] +++++Image actions:[AX_FOCUS] bundle:[chromeRole="svgRoot", hasImage="true", roleDescription="graphic"] +++++++Button text:"Click me!" viewIdResName:"myRect" clickable actions:[CLICK, AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="button", roleDescription="button"] +++++++Button text:"Click me!" viewIdResName:"myRect" clickable actions:[CLICK, AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="button", roleDescription="button"] \ No newline at end of file
diff --git a/content/test/data/accessibility/html/svg-text-alternative-computation-expected-android-external.txt b/content/test/data/accessibility/html/svg-text-alternative-computation-expected-android-external.txt new file mode 100644 index 0000000..887d5b8 --- /dev/null +++ b/content/test/data/accessibility/html/svg-text-alternative-computation-expected-android-external.txt
@@ -0,0 +1,41 @@ +WebView focusable focused scrollable actions:[CLEAR_FOCUS, AX_FOCUS] bundle:[chromeRole="rootWebArea", hasImage="true"] +++View actions:[AX_FOCUS] bundle:[chromeRole="genericContainer", hasImage="true"] +++++Image actions:[AX_FOCUS] bundle:[chromeRole="svgRoot", hasImage="true", roleDescription="graphic"] +++++++View text:"null" contentDescription:"Link (from aria-labelledby)" clickable focusable actions:[FOCUS, CLICK, AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="link", clickableScore="300", hint="Link (from title)", roleDescription="link", targetUrl="file:///storage/emulated/0/chromium_tests_root/content/test/data/accessibility/html/foo.html"] +++++Image actions:[AX_FOCUS] bundle:[chromeRole="svgRoot", hasImage="true", roleDescription="graphic"] +++++++View text:"null" contentDescription:"Link (from aria-label)" clickable focusable actions:[FOCUS, CLICK, AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="link", clickableScore="300", hint="Link (from title)", roleDescription="link", targetUrl="file:///storage/emulated/0/chromium_tests_root/content/test/data/accessibility/html/foo.html"] +++++Image actions:[AX_FOCUS] bundle:[chromeRole="svgRoot", hasImage="true", roleDescription="graphic"] +++++++View text:"null" contentDescription:"Link (from title)" clickable focusable actions:[FOCUS, CLICK, AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="link", clickableScore="300", hint="Link (from xlink:title)", roleDescription="link", targetUrl="file:///storage/emulated/0/chromium_tests_root/content/test/data/accessibility/html/foo.html"] +++++Image actions:[AX_FOCUS] bundle:[chromeRole="svgRoot", hasImage="true", roleDescription="graphic"] +++++++View text:"null" contentDescription:"Link (from xlink:title)" clickable focusable actions:[FOCUS, CLICK, AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="link", clickableScore="300", roleDescription="link", targetUrl="file:///storage/emulated/0/chromium_tests_root/content/test/data/accessibility/html/foo.html"] +++++Image actions:[AX_FOCUS] bundle:[chromeRole="svgRoot", hasImage="true", roleDescription="graphic"] +++++++View text:"Circle (from aria-labelledby)" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="graphicsSymbol", hasImage="true", roleDescription="graphics symbol"] +++++Image actions:[AX_FOCUS] bundle:[chromeRole="svgRoot", hasImage="true", roleDescription="graphic"] +++++++View text:"Circle (from aria-label)" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="graphicsSymbol", hasImage="true", roleDescription="graphics symbol"] +++++Image actions:[AX_FOCUS] bundle:[chromeRole="svgRoot", hasImage="true", roleDescription="graphic"] +++++++View text:"Circle (from title)" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="graphicsSymbol", hasImage="true", roleDescription="graphics symbol"] +++++Image actions:[AX_FOCUS] bundle:[chromeRole="svgRoot", hasImage="true", roleDescription="graphic"] +++++++View text:"Circle (From first use element's title)" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="graphicsObject", roleDescription="graphics object"] +++++++View text:"Circle (From second use element's title)" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="graphicsObject", roleDescription="graphics object"] +++++Image actions:[AX_FOCUS] bundle:[chromeRole="svgRoot", hasImage="true", roleDescription="graphic"] +++++++View text:"Rectangle Symbol (From symbol's title)" viewIdResName:"myRect" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="group"] +++++++View text:"Rectangle Symbol (From symbol's title)" viewIdResName:"myRect" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="group"] +++++Image actions:[AX_FOCUS] bundle:[chromeRole="svgRoot", hasImage="true", roleDescription="graphic"] +++++++View text:"null" contentDescription:"Link (from title)" clickable focusable actions:[FOCUS, CLICK, AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="link", clickableScore="300", hint="Link (from aria-describedby)", roleDescription="link", targetUrl="file:///storage/emulated/0/chromium_tests_root/content/test/data/accessibility/html/foo.html"] +++++Image actions:[AX_FOCUS] bundle:[chromeRole="svgRoot", hasImage="true", roleDescription="graphic"] +++++++View text:"null" contentDescription:"Link (from title)" clickable focusable actions:[FOCUS, CLICK, AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="link", clickableScore="300", hint="Link (from aria-description)", roleDescription="link", targetUrl="file:///storage/emulated/0/chromium_tests_root/content/test/data/accessibility/html/foo.html"] +++++Image actions:[AX_FOCUS] bundle:[chromeRole="svgRoot", hasImage="true", roleDescription="graphic"] +++++++View text:"null" contentDescription:"Link (from title)" clickable focusable actions:[FOCUS, CLICK, AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="link", clickableScore="300", hint="Link (from desc)", roleDescription="link", targetUrl="file:///storage/emulated/0/chromium_tests_root/content/test/data/accessibility/html/foo.html"] +++++Image actions:[AX_FOCUS] bundle:[chromeRole="svgRoot", hasImage="true", roleDescription="graphic"] +++++++View text:"null" contentDescription:"Link (from aria-label)" clickable focusable actions:[FOCUS, CLICK, AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="link", clickableScore="300", hint="Link (from title)", roleDescription="link", targetUrl="file:///storage/emulated/0/chromium_tests_root/content/test/data/accessibility/html/foo.html"] +++++Image actions:[AX_FOCUS] bundle:[chromeRole="svgRoot", hasImage="true", roleDescription="graphic"] +++++++View text:"null" contentDescription:"Link (from title)" clickable focusable actions:[FOCUS, CLICK, AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="link", clickableScore="300", hint="Link (from xlink:title)", roleDescription="link", targetUrl="file:///storage/emulated/0/chromium_tests_root/content/test/data/accessibility/html/foo.html"] +++++Image actions:[AX_FOCUS] bundle:[chromeRole="svgRoot", hasImage="true", roleDescription="graphic"] +++++++View actions:[AX_FOCUS] bundle:[chromeRole="graphicsObject", hint="Circle (From first use element's desc)", roleDescription="graphics object"] +++++++View actions:[AX_FOCUS] bundle:[chromeRole="graphicsObject", hint="Circle (From second use element's desc)", roleDescription="graphics object"] +++++Image actions:[AX_FOCUS] bundle:[chromeRole="svgRoot", hasImage="true", roleDescription="graphic"] +++++++View text:"Circle 1" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="graphicsObject", hint="Circle (From first use element's title)", roleDescription="graphics object"] +++++++View text:"Circle 2" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="graphicsObject", hint="Circle (From second use element's title)", roleDescription="graphics object"] +++++Image actions:[AX_FOCUS] bundle:[chromeRole="svgRoot", hasImage="true", roleDescription="graphic"] +++++++View viewIdResName:"myRect2" actions:[AX_FOCUS] bundle:[chromeRole="group", hint="Rectangle Symbol (From symbol's desc)"] +++++++View viewIdResName:"myRect2" actions:[AX_FOCUS] bundle:[chromeRole="group", hint="Rectangle Symbol (From symbol's desc)"] \ No newline at end of file
diff --git a/content/test/data/accessibility/html/svg-with-clickable-rect-expected-android-external.txt b/content/test/data/accessibility/html/svg-with-clickable-rect-expected-android-external.txt new file mode 100644 index 0000000..b17c971 --- /dev/null +++ b/content/test/data/accessibility/html/svg-with-clickable-rect-expected-android-external.txt
@@ -0,0 +1,4 @@ +WebView focusable focused scrollable actions:[CLEAR_FOCUS, AX_FOCUS] bundle:[chromeRole="rootWebArea", hasImage="true"] +++View actions:[AX_FOCUS] bundle:[chromeRole="genericContainer", hasImage="true"] +++++Image actions:[AX_FOCUS] bundle:[chromeRole="svgRoot", hasImage="true", roleDescription="graphic"] +++++++View viewIdResName:"clickable" clickable actions:[CLICK, AX_FOCUS] bundle:[chromeRole="graphicsSymbol", clickableScore="200", hasImage="true", roleDescription="graphics symbol"] \ No newline at end of file
diff --git a/content/test/data/accessibility/html/svg-with-foreign-object-expected-android-external.txt b/content/test/data/accessibility/html/svg-with-foreign-object-expected-android-external.txt new file mode 100644 index 0000000..7148893 --- /dev/null +++ b/content/test/data/accessibility/html/svg-with-foreign-object-expected-android-external.txt
@@ -0,0 +1,4 @@ +WebView focusable focused scrollable actions:[CLEAR_FOCUS, AX_FOCUS] bundle:[chromeRole="rootWebArea", hasImage="true"] +++View actions:[AX_FOCUS] bundle:[chromeRole="genericContainer", hasImage="true"] +++++Image actions:[AX_FOCUS] bundle:[chromeRole="svgRoot", hasImage="true", roleDescription="graphic"] +++++++TextView text:"Hello world" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="paragraph"] \ No newline at end of file
diff --git a/content/test/data/accessibility/html/svg-with-link-to-document-expected-android-external.txt b/content/test/data/accessibility/html/svg-with-link-to-document-expected-android-external.txt new file mode 100644 index 0000000..7b82f3d0 --- /dev/null +++ b/content/test/data/accessibility/html/svg-with-link-to-document-expected-android-external.txt
@@ -0,0 +1,4 @@ +WebView focusable focused scrollable actions:[CLEAR_FOCUS, AX_FOCUS] bundle:[chromeRole="rootWebArea", hasImage="true"] +++View actions:[AX_FOCUS] bundle:[chromeRole="genericContainer", hasImage="true"] +++++Image text:"svg" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="svgRoot", hasImage="true", roleDescription="graphic"] +++++++View text:"null" contentDescription:"svg-with-link-to-document" clickable focusable actions:[FOCUS, CLICK, AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="link", clickableScore="300", roleDescription="link", targetUrl="file:///storage/emulated/0/chromium_tests_root/content/test/data/accessibility/html/svg-with-link-to-document.html#"] \ No newline at end of file
diff --git a/content/test/data/accessibility/html/svg-with-non-link-anchors-expected-android-external.txt b/content/test/data/accessibility/html/svg-with-non-link-anchors-expected-android-external.txt new file mode 100644 index 0000000..d39b972 --- /dev/null +++ b/content/test/data/accessibility/html/svg-with-non-link-anchors-expected-android-external.txt
@@ -0,0 +1,8 @@ +WebView focusable focused scrollable actions:[CLEAR_FOCUS, AX_FOCUS] bundle:[chromeRole="rootWebArea", hasImage="true"] +++View actions:[AX_FOCUS] bundle:[chromeRole="genericContainer", hasImage="true"] +++++Image text:"Text descendants" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="svgRoot", hasImage="true", roleDescription="graphic"] +++++++View actions:[AX_FOCUS] bundle:[chromeRole="genericContainer"] +++++++++TextView text:"focusable" focusable actions:[FOCUS, AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="genericContainer"] +++++++TextView text:"not focusable" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="genericContainer"] +++++Image text:"Not text descendants" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="svgRoot", hasImage="true", roleDescription="graphic"] +++++++View focusable actions:[FOCUS, AX_FOCUS] bundle:[chromeRole="group"] \ No newline at end of file
diff --git a/content/test/data/accessibility/html/tabindex-expose-children-expected-android-external.txt b/content/test/data/accessibility/html/tabindex-expose-children-expected-android-external.txt new file mode 100644 index 0000000..07da67c9 --- /dev/null +++ b/content/test/data/accessibility/html/tabindex-expose-children-expected-android-external.txt
@@ -0,0 +1,10 @@ +WebView focusable focused scrollable actions:[CLEAR_FOCUS, AX_FOCUS] bundle:[chromeRole="rootWebArea"] +++View actions:[AX_FOCUS] bundle:[chromeRole="layoutTable"] +++++View actions:[AX_FOCUS] bundle:[chromeRole="layoutTableRow"] +++++++View text:"1." actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="layoutTableCell"] +++++++View text:"2." actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="layoutTableCell"] +++View text:"3. 4." focusable actions:[FOCUS, AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="genericContainer"] +++++View actions:[AX_FOCUS] bundle:[chromeRole="layoutTable"] +++++++View actions:[AX_FOCUS] bundle:[chromeRole="layoutTableRow"] +++++++++View text:"3." actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="layoutTableCell"] +++++++++View text:"4." actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="layoutTableCell"] \ No newline at end of file
diff --git a/content/test/data/accessibility/html/table-focusable-sections-expected-android-external.txt b/content/test/data/accessibility/html/table-focusable-sections-expected-android-external.txt new file mode 100644 index 0000000..f213885 --- /dev/null +++ b/content/test/data/accessibility/html/table-focusable-sections-expected-android-external.txt
@@ -0,0 +1,17 @@ +WebView text:"Table example - focusable thead, tbody, tfoot" focusable focused scrollable actions:[CLEAR_FOCUS, AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="rootWebArea"] +++GridView CollectionInfo:[rows=4, cols=2] actions:[AX_FOCUS] bundle:[chromeRole="table", roleDescription="table"] +++++View focusable actions:[FOCUS, AX_FOCUS] bundle:[chromeRole="rowGroup"] +++++++View actions:[AX_FOCUS] bundle:[chromeRole="row"] +++++++++View text:"Sum" CollectionItemInfo:[heading, rowIndex=0, rowSpan=1, colIndex=0, colSpan=1] actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="columnHeader", roleDescription="column header"] +++++++++View text:"Subtraction" CollectionItemInfo:[heading, rowIndex=0, rowSpan=1, colIndex=1, colSpan=1] actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="columnHeader", roleDescription="column header"] +++++View focusable actions:[FOCUS, AX_FOCUS] bundle:[chromeRole="rowGroup"] +++++++View actions:[AX_FOCUS] bundle:[chromeRole="row"] +++++++++View text:"10" CollectionItemInfo:[rowIndex=1, rowSpan=1, colIndex=0, colSpan=1] actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="cell"] +++++++++View text:"7" CollectionItemInfo:[rowIndex=1, rowSpan=1, colIndex=1, colSpan=1] actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="cell"] +++++++View actions:[AX_FOCUS] bundle:[chromeRole="row"] +++++++++View text:"2" CollectionItemInfo:[rowIndex=2, rowSpan=1, colIndex=0, colSpan=1] actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="cell"] +++++++++View text:"4" CollectionItemInfo:[rowIndex=2, rowSpan=1, colIndex=1, colSpan=1] actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="cell"] +++++View focusable actions:[FOCUS, AX_FOCUS] bundle:[chromeRole="rowGroup"] +++++++View actions:[AX_FOCUS] bundle:[chromeRole="row"] +++++++++View text:"12" CollectionItemInfo:[rowIndex=3, rowSpan=1, colIndex=0, colSpan=1] actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="cell"] +++++++++View text:"3" CollectionItemInfo:[rowIndex=3, rowSpan=1, colIndex=1, colSpan=1] actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="cell"] \ No newline at end of file
diff --git a/content/test/data/accessibility/html/table-layout-expected-android-external.txt b/content/test/data/accessibility/html/table-layout-expected-android-external.txt new file mode 100644 index 0000000..25d6253 --- /dev/null +++ b/content/test/data/accessibility/html/table-layout-expected-android-external.txt
@@ -0,0 +1,14 @@ +WebView text:"Table example #2" focusable focused scrollable actions:[CLEAR_FOCUS, AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="rootWebArea"] +++View actions:[AX_FOCUS] bundle:[chromeRole="layoutTable"] +++++View actions:[AX_FOCUS] bundle:[chromeRole="layoutTableRow"] +++++++View text:"1" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="layoutTableCell"] +++++++View text:"2" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="layoutTableCell"] +++++++View text:"3" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="layoutTableCell"] +++++View actions:[AX_FOCUS] bundle:[chromeRole="layoutTableRow"] +++++++View text:"4" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="layoutTableCell"] +++++++View text:"5" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="layoutTableCell"] +++++++View text:"6" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="layoutTableCell"] +++++View actions:[AX_FOCUS] bundle:[chromeRole="layoutTableRow"] +++++++View text:"7" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="layoutTableCell"] +++++++View text:"8" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="layoutTableCell"] +++++++View text:"9" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="layoutTableCell"] \ No newline at end of file
diff --git a/content/test/data/accessibility/html/table-presentation-expected-android-external.txt b/content/test/data/accessibility/html/table-presentation-expected-android-external.txt new file mode 100644 index 0000000..1221450 --- /dev/null +++ b/content/test/data/accessibility/html/table-presentation-expected-android-external.txt
@@ -0,0 +1,5 @@ +WebView text:"Table with role=presentation" focusable focused scrollable actions:[CLEAR_FOCUS, AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="rootWebArea"] +++TextView text:"1" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="genericContainer"] +++TextView text:"2" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="genericContainer"] +++TextView text:"4" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="genericContainer"] +++TextView text:"5" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="genericContainer"] \ No newline at end of file
diff --git a/content/test/data/accessibility/html/table-simple-2-expected-android-external.txt b/content/test/data/accessibility/html/table-simple-2-expected-android-external.txt new file mode 100644 index 0000000..25d6253 --- /dev/null +++ b/content/test/data/accessibility/html/table-simple-2-expected-android-external.txt
@@ -0,0 +1,14 @@ +WebView text:"Table example #2" focusable focused scrollable actions:[CLEAR_FOCUS, AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="rootWebArea"] +++View actions:[AX_FOCUS] bundle:[chromeRole="layoutTable"] +++++View actions:[AX_FOCUS] bundle:[chromeRole="layoutTableRow"] +++++++View text:"1" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="layoutTableCell"] +++++++View text:"2" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="layoutTableCell"] +++++++View text:"3" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="layoutTableCell"] +++++View actions:[AX_FOCUS] bundle:[chromeRole="layoutTableRow"] +++++++View text:"4" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="layoutTableCell"] +++++++View text:"5" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="layoutTableCell"] +++++++View text:"6" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="layoutTableCell"] +++++View actions:[AX_FOCUS] bundle:[chromeRole="layoutTableRow"] +++++++View text:"7" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="layoutTableCell"] +++++++View text:"8" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="layoutTableCell"] +++++++View text:"9" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="layoutTableCell"] \ No newline at end of file
diff --git a/content/test/data/accessibility/html/table-spans-expected-android-external.txt b/content/test/data/accessibility/html/table-spans-expected-android-external.txt new file mode 100644 index 0000000..d479cf4 --- /dev/null +++ b/content/test/data/accessibility/html/table-spans-expected-android-external.txt
@@ -0,0 +1,14 @@ +WebView text:"Table example with rowspan and colspan" focusable focused scrollable actions:[CLEAR_FOCUS, AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="rootWebArea"] +++GridView CollectionInfo:[rows=2, cols=2] actions:[AX_FOCUS] bundle:[chromeRole="table", roleDescription="table"] +++++View actions:[AX_FOCUS] bundle:[chromeRole="row"] +++++++View text:"AD" CollectionItemInfo:[rowIndex=0, rowSpan=2, colIndex=0, colSpan=1] actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="cell"] +++++++View text:"BC" CollectionItemInfo:[rowIndex=0, rowSpan=1, colIndex=1, colSpan=1] actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="cell"] +++++View actions:[AX_FOCUS] bundle:[chromeRole="row"] +++++++View text:"EF" CollectionItemInfo:[rowIndex=1, rowSpan=1, colIndex=1, colSpan=1] actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="cell"] +++GridView CollectionInfo:[rows=2, cols=3] actions:[AX_FOCUS] bundle:[chromeRole="table", roleDescription="table"] +++++View actions:[AX_FOCUS] bundle:[chromeRole="row"] +++++++View text:"AD" CollectionItemInfo:[rowIndex=0, rowSpan=2, colIndex=0, colSpan=1] actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="cell"] +++++++View text:"BC" CollectionItemInfo:[rowIndex=0, rowSpan=1, colIndex=1, colSpan=2] actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="cell"] +++++View actions:[AX_FOCUS] bundle:[chromeRole="row"] +++++++View text:"EF" CollectionItemInfo:[rowIndex=1, rowSpan=1, colIndex=1, colSpan=1] actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="cell"] +++++++View text:"GH" CollectionItemInfo:[rowIndex=1, rowSpan=1, colIndex=2, colSpan=1] actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="cell"] \ No newline at end of file
diff --git a/content/test/data/accessibility/html/table-th-colheader-expected-android-external.txt b/content/test/data/accessibility/html/table-th-colheader-expected-android-external.txt new file mode 100644 index 0000000..22c92b76 --- /dev/null +++ b/content/test/data/accessibility/html/table-th-colheader-expected-android-external.txt
@@ -0,0 +1,8 @@ +WebView focusable focused scrollable actions:[CLEAR_FOCUS, AX_FOCUS] bundle:[chromeRole="rootWebArea"] +++GridView CollectionInfo:[rows=2, cols=2] actions:[AX_FOCUS] bundle:[chromeRole="table", roleDescription="table"] +++++View actions:[AX_FOCUS] bundle:[chromeRole="row"] +++++++View text:"Firstname" CollectionItemInfo:[heading, rowIndex=0, rowSpan=1, colIndex=0, colSpan=1] actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="columnHeader", roleDescription="column header"] +++++++View text:"Lastname" CollectionItemInfo:[heading, rowIndex=0, rowSpan=1, colIndex=1, colSpan=1] actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="columnHeader", roleDescription="column header"] +++++View actions:[AX_FOCUS] bundle:[chromeRole="row"] +++++++View text:"Jill" CollectionItemInfo:[rowIndex=1, rowSpan=1, colIndex=0, colSpan=1] actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="cell"] +++++++View text:"Smith" CollectionItemInfo:[rowIndex=1, rowSpan=1, colIndex=1, colSpan=1] actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="cell"] \ No newline at end of file
diff --git a/content/test/data/accessibility/html/table-th-rowheader-expected-android-external.txt b/content/test/data/accessibility/html/table-th-rowheader-expected-android-external.txt new file mode 100644 index 0000000..d5617946 --- /dev/null +++ b/content/test/data/accessibility/html/table-th-rowheader-expected-android-external.txt
@@ -0,0 +1,8 @@ +WebView text:"Table example - th rowheader" focusable focused scrollable actions:[CLEAR_FOCUS, AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="rootWebArea"] +++GridView CollectionInfo:[rows=2, cols=2] actions:[AX_FOCUS] bundle:[chromeRole="table", roleDescription="table"] +++++View actions:[AX_FOCUS] bundle:[chromeRole="row"] +++++++View text:"Firstname" CollectionItemInfo:[heading, rowIndex=0, rowSpan=1, colIndex=0, colSpan=1] actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="rowHeader", roleDescription="row header"] +++++++View text:"Jill" CollectionItemInfo:[rowIndex=0, rowSpan=1, colIndex=1, colSpan=1] actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="cell"] +++++View actions:[AX_FOCUS] bundle:[chromeRole="row"] +++++++View text:"Lastname" CollectionItemInfo:[heading, rowIndex=1, rowSpan=1, colIndex=0, colSpan=1] actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="rowHeader", roleDescription="row header"] +++++++View text:"Smith" CollectionItemInfo:[rowIndex=1, rowSpan=1, colIndex=1, colSpan=1] actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="cell"] \ No newline at end of file
diff --git a/content/test/data/accessibility/html/table-thead-tbody-tfoot-expected-android-external.txt b/content/test/data/accessibility/html/table-thead-tbody-tfoot-expected-android-external.txt new file mode 100644 index 0000000..f8f9708 --- /dev/null +++ b/content/test/data/accessibility/html/table-thead-tbody-tfoot-expected-android-external.txt
@@ -0,0 +1,14 @@ +WebView text:"Table example - thead, tbody, tfoot" focusable focused scrollable actions:[CLEAR_FOCUS, AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="rootWebArea"] +++GridView CollectionInfo:[rows=4, cols=2] actions:[AX_FOCUS] bundle:[chromeRole="table", roleDescription="table"] +++++View actions:[AX_FOCUS] bundle:[chromeRole="row"] +++++++View text:"Sum" CollectionItemInfo:[heading, rowIndex=0, rowSpan=1, colIndex=0, colSpan=1] actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="columnHeader", roleDescription="column header"] +++++++View text:"Subtraction" CollectionItemInfo:[heading, rowIndex=0, rowSpan=1, colIndex=1, colSpan=1] actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="columnHeader", roleDescription="column header"] +++++View actions:[AX_FOCUS] bundle:[chromeRole="row"] +++++++View text:"10" CollectionItemInfo:[rowIndex=1, rowSpan=1, colIndex=0, colSpan=1] actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="cell"] +++++++View text:"7" CollectionItemInfo:[rowIndex=1, rowSpan=1, colIndex=1, colSpan=1] actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="cell"] +++++View actions:[AX_FOCUS] bundle:[chromeRole="row"] +++++++View text:"2" CollectionItemInfo:[rowIndex=2, rowSpan=1, colIndex=0, colSpan=1] actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="cell"] +++++++View text:"4" CollectionItemInfo:[rowIndex=2, rowSpan=1, colIndex=1, colSpan=1] actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="cell"] +++++View actions:[AX_FOCUS] bundle:[chromeRole="row"] +++++++View text:"12" CollectionItemInfo:[rowIndex=3, rowSpan=1, colIndex=0, colSpan=1] actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="cell"] +++++++View text:"3" CollectionItemInfo:[rowIndex=3, rowSpan=1, colIndex=1, colSpan=1] actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="cell"] \ No newline at end of file
diff --git a/content/test/data/accessibility/html/text-align-expected-android-external.txt b/content/test/data/accessibility/html/text-align-expected-android-external.txt new file mode 100644 index 0000000..732e34f --- /dev/null +++ b/content/test/data/accessibility/html/text-align-expected-android-external.txt
@@ -0,0 +1,12 @@ +WebView focusable focused scrollable actions:[CLEAR_FOCUS, AX_FOCUS] bundle:[chromeRole="rootWebArea"] +++TextView text:"Left-aligned text" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="genericContainer"] +++TextView text:"Right-aligned text" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="genericContainer"] +++TextView text:"Centered text" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="genericContainer"] +++TextView text:"Justified text" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="genericContainer"] +++TextView text:"Webkit left-aligned text" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="genericContainer"] +++TextView text:"Webkit right-aligned text" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="genericContainer"] +++TextView text:"Webkit centered text" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="genericContainer"] +++TextView text:"Start-aligned text" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="genericContainer"] +++TextView text:"End-aligned text" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="genericContainer"] +++TextView text:"No text alignment specified" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="genericContainer"] +++TextView text:"Invalid text alignment" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="genericContainer"] \ No newline at end of file
diff --git a/content/test/data/accessibility/html/text-indent-expected-android-external.txt b/content/test/data/accessibility/html/text-indent-expected-android-external.txt new file mode 100644 index 0000000..aff17c8 --- /dev/null +++ b/content/test/data/accessibility/html/text-indent-expected-android-external.txt
@@ -0,0 +1,8 @@ +WebView focusable focused scrollable actions:[CLEAR_FOCUS, AX_FOCUS] bundle:[chromeRole="rootWebArea"] +++TextView text:"Text indent 50px" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="genericContainer"] +++TextView text:"Text indent -50px" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="genericContainer"] +++TextView text:"Text indent 0px" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="genericContainer"] +++TextView text:"Text indent initial" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="genericContainer"] +++TextView text:"Text indent inherit" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="genericContainer"] +++TextView text:"No text indent specified" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="genericContainer"] +++TextView text:"Invalid text indent" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="genericContainer"] \ No newline at end of file
diff --git a/content/test/data/accessibility/html/textarea-expected-android-external.txt b/content/test/data/accessibility/html/textarea-expected-android-external.txt new file mode 100644 index 0000000..77ffa1c1 --- /dev/null +++ b/content/test/data/accessibility/html/textarea-expected-android-external.txt
@@ -0,0 +1,3 @@ +WebView focusable focused scrollable actions:[CLEAR_FOCUS, AX_FOCUS] bundle:[chromeRole="rootWebArea"] +++View actions:[AX_FOCUS] bundle:[chromeRole="genericContainer"] +++++EditText text:"The \ntextarea tag defines a multi-line text input control.\n" clickable editable focusable multiLine textSelectionStart:0 textSelectionEnd:0 actions:[FOCUS, CLICK, AX_FOCUS, NEXT, PREVIOUS, COPY, PASTE, CUT, SET_SELECTION, SET_TEXT, IME_ENTER] bundle:[chromeRole="textField", clickableScore="300"] \ No newline at end of file
diff --git a/content/test/data/accessibility/html/textarea-read-only-expected-android-external.txt b/content/test/data/accessibility/html/textarea-read-only-expected-android-external.txt new file mode 100644 index 0000000..0bf0b96 --- /dev/null +++ b/content/test/data/accessibility/html/textarea-read-only-expected-android-external.txt
@@ -0,0 +1,3 @@ +WebView focusable focused scrollable actions:[CLEAR_FOCUS, AX_FOCUS] bundle:[chromeRole="rootWebArea"] +++View actions:[AX_FOCUS] bundle:[chromeRole="genericContainer"] +++++EditText text:"The textarea tag defines a multi-line text input control.\n" clickable editable disabled focusable multiLine textSelectionStart:0 textSelectionEnd:0 actions:[FOCUS, CLICK, AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="textField", clickableScore="300"] \ No newline at end of file
diff --git a/content/test/data/accessibility/html/time-expected-android-external.txt b/content/test/data/accessibility/html/time-expected-android-external.txt new file mode 100644 index 0000000..3d58de3 --- /dev/null +++ b/content/test/data/accessibility/html/time-expected-android-external.txt
@@ -0,0 +1,5 @@ +WebView focusable focused scrollable actions:[CLEAR_FOCUS, AX_FOCUS] bundle:[chromeRole="rootWebArea"] +++View actions:[AX_FOCUS] bundle:[chromeRole="genericContainer"] +++++View text:"10:00" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="time"] +++++TextView text:" " actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="staticText"] +++++View text:"Valentines day" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="time"] \ No newline at end of file
diff --git a/content/test/data/accessibility/html/ul-contenteditable-expected-android-external.txt b/content/test/data/accessibility/html/ul-contenteditable-expected-android-external.txt new file mode 100644 index 0000000..3c5c608e --- /dev/null +++ b/content/test/data/accessibility/html/ul-contenteditable-expected-android-external.txt
@@ -0,0 +1,2 @@ +WebView focusable focused scrollable actions:[CLEAR_FOCUS, AX_FOCUS] bundle:[chromeRole="rootWebArea"] +++EditText text:"Hello\n\nBye" clickable editable focusable multiLine textSelectionStart:0 textSelectionEnd:0 actions:[FOCUS, CLICK, AX_FOCUS, NEXT, PREVIOUS, COPY, PASTE, CUT, SET_SELECTION, SET_TEXT, IME_ENTER] bundle:[chromeRole="textField", clickableScore="300"] \ No newline at end of file
diff --git a/content/test/data/accessibility/html/ul-expected-android-external.txt b/content/test/data/accessibility/html/ul-expected-android-external.txt new file mode 100644 index 0000000..bd202b4f --- /dev/null +++ b/content/test/data/accessibility/html/ul-expected-android-external.txt
@@ -0,0 +1,11 @@ +WebView focusable focused scrollable actions:[CLEAR_FOCUS, AX_FOCUS] bundle:[chromeRole="rootWebArea"] +++ListView CollectionInfo:[rows=3, cols=0] actions:[AX_FOCUS] bundle:[chromeRole="list"] +++++View CollectionItemInfo:[rowIndex=0, rowSpan=0, colIndex=0, colSpan=0] actions:[AX_FOCUS] bundle:[chromeRole="listItem"] +++++++View text:"• " actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="listMarker"] +++++++TextView text:"Item 1" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="staticText"] +++++View CollectionItemInfo:[rowIndex=1, rowSpan=0, colIndex=0, colSpan=0] actions:[AX_FOCUS] bundle:[chromeRole="listItem"] +++++++View text:"• " actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="listMarker"] +++++++TextView text:"Item 2" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="staticText"] +++++View CollectionItemInfo:[rowIndex=2, rowSpan=0, colIndex=0, colSpan=0] actions:[AX_FOCUS] bundle:[chromeRole="listItem"] +++++++View text:"• " actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="listMarker"] +++++++TextView text:"Item 3" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="staticText"] \ No newline at end of file
diff --git a/content/test/data/accessibility/html/var-expected-android-external.txt b/content/test/data/accessibility/html/var-expected-android-external.txt new file mode 100644 index 0000000..eaff036e --- /dev/null +++ b/content/test/data/accessibility/html/var-expected-android-external.txt
@@ -0,0 +1,2 @@ +WebView focusable focused scrollable actions:[CLEAR_FOCUS, AX_FOCUS] bundle:[chromeRole="rootWebArea"] +++TextView text:"Variable" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="genericContainer"] \ No newline at end of file
diff --git a/content/test/data/accessibility/html/wbr-expected-android-external.txt b/content/test/data/accessibility/html/wbr-expected-android-external.txt new file mode 100644 index 0000000..d4efeda --- /dev/null +++ b/content/test/data/accessibility/html/wbr-expected-android-external.txt
@@ -0,0 +1,2 @@ +WebView focusable focused scrollable actions:[CLEAR_FOCUS, AX_FOCUS] bundle:[chromeRole="rootWebArea"] +++TextView text:"Supercalifragilisticexpialidocious" actions:[AX_FOCUS, NEXT, PREVIOUS] bundle:[chromeRole="genericContainer"] \ No newline at end of file
diff --git a/content/test/gpu/gpu_tests/test_expectations/pixel_expectations.txt b/content/test/gpu/gpu_tests/test_expectations/pixel_expectations.txt index dd791fac..4c4fe62 100644 --- a/content/test/gpu/gpu_tests/test_expectations/pixel_expectations.txt +++ b/content/test/gpu/gpu_tests/test_expectations/pixel_expectations.txt
@@ -311,11 +311,6 @@ # Fuchsia issues crbug.com/1157136 [ fuchsia skia-renderer-vulkan ] Pixel_OffscreenCanvasWebGLDefault [ Failure ] -# Fails on Android WebView due to requiring embedding viz clients. crbug.com/805739 -# Produces black images on Nexus 5Xs in Android Webview (android-nexus-5x) crbug.com/984352 -# Fails on Pixel 2 (android-pixel-2) crbug.com/966069 -crbug.com/805739 [ android ] Pixel_CanvasLowLatency2D [ Failure ] - crbug.com/624256 [ android ] Pixel_SolidColorBackground [ Failure ] # Failing on Nexus 5; haven't investigated why yet. @@ -337,19 +332,12 @@ # Fails on Nexus 5 crbug.com/883500 [ android android-nexus-5 ] Pixel_BackgroundImage [ Failure ] -crbug.com/1029389 [ android android-nexus-5 ] Pixel_PrecisionRoundedCorner [ Failure ] # Flakes on Nexus 5X. crbug.com/883500 [ android android-chromium android-nexus-5x ] Pixel_BackgroundImage [ RetryOnFailure ] crbug.com/1065514 [ android android-chromium android-nexus-5x ] Pixel_WebGLReadPixelsTabSwitch [ RetryOnFailure ] -crbug.com/1121476 [ android android-chromium android-nexus-5x ] Pixel_Canvas2DTabSwitch [ RetryOnFailure ] -crbug.com/1220766 [ android android-chromium android-nexus-5x ] Pixel_WebGLPreservedAfterTabSwitch [ RetryOnFailure ] crbug.com/1278885 [ android android-chromium android-nexus-5x skia-renderer-gl ] Pixel_OffscreenCanvasTransferToImageBitmap [ RetryOnFailure ] -# Frequently fails on Nexus 5X -crbug.com/1157136 [ android android-chromium android-nexus-5x skia-renderer-disabled ] Pixel_OffscreenCanvasWebGLDefault [ Failure ] -crbug.com/1157136 [ android android-chromium android-nexus-5x skia-renderer-gl ] Pixel_OffscreenCanvasWebGLDefault [ Failure ] - # Mark all webview tests as RetryOnFailure due to Nexus 5x driver bug. crbug.com/950932 [ android-webview-instrumentation android-nexus-5x ] * [ RetryOnFailure ] @@ -373,28 +361,18 @@ crbug.com/974380 [ mac ] Pixel_OffscreenCanvasUnaccelerated2DGPUCompositingWorker [ Failure ] # Skia Renderer, producing incorrect color in one quadrant -crbug.com/1008450 [ android skia-renderer-vulkan ] Pixel_Video_BackdropFilter [ Failure ] crbug.com/1008450 [ android skia-renderer-gl ] Pixel_Video_MP4_Rounded_Corner [ Failure ] -crbug.com/1008450 [ android skia-renderer-vulkan ] Pixel_Video_MP4_Rounded_Corner [ Failure ] # Flaky test on SkiaRenderer vulkan android bot. crbug.com/1252081 [ android skia-renderer-vulkan ] Pixel_OffscreenCanvasWebGLPaintAfterResize [ RetryOnFailure ] -# Produces blank images on Intel HD 630 w/ Mesa 19.0.2 -crbug.com/976861 [ linux intel-0x5912 skia-renderer-disabled ] Pixel_OffscreenCanvasTransferToImageBitmap [ Failure ] -crbug.com/976861 [ linux intel-0x5912 skia-renderer-gl ] Pixel_OffscreenCanvasTransferToImageBitmap [ Failure ] -crbug.com/976861 [ linux intel-0x5912 skia-renderer-vulkan ] Pixel_OffscreenCanvasTransferToImageBitmap [ Failure ] - # Producing incorrect image on Win10 Intel HD 630 and UHD 630 w/ 26.20.100.6912 # or later drivers. crbug.com/997313 [ win intel-0x5912 skia-renderer-gl ] Pixel_WebGL_PremultipliedAlpha_False [ Failure ] crbug.com/997313 [ win intel-0x3e92 skia-renderer-gl ] Pixel_WebGL_PremultipliedAlpha_False [ Failure ] # Times out on Pixel 4s in webview. -crbug.com/1176918 [ android android-pixel-4 android-webview-instrumentation skia-renderer-gl ] Pixel_Video_BackdropFilter [ Failure ] crbug.com/1176918 [ android android-pixel-4 android-webview-instrumentation skia-renderer-gl ] Pixel_Video_Context_Loss_VP9 [ Failure ] -# MP4 tests only flakily timeout. -crbug.com/1176918 [ android android-pixel-4 android-webview-instrumentation skia-renderer-gl ] Pixel_Video_MP4* [ RetryOnFailure ] # HDR rendering with PQ color space appears to be broken on Windows RS2. # TODO(sunnyps): Revert this temporary suppression after ensuring pixel tests @@ -452,12 +430,8 @@ # Failures on Mac FYI arm64 Release (Apple DTK) crbug.com/1175753 [ mac release apple-apple-m1 ] Pixel_Video_BackdropFilter [ Failure ] -# Long-standing flake on Kevin devices due to disappearing mailbox. -crbug.com/1200504 [ chromeos chromeos-board-kevin ] Pixel_OffscreenCanvasWebGLPaintAfterResize [ RetryOnFailure ] - # Flakily crashes on Lacros-like Linux configuration. crbug.com/1209344 [ linux display-server-wayland intel skia-renderer-gl ] Pixel_Video_Context_Loss_VP9 [ RetryOnFailure ] -crbug.com/1209344 [ linux display-server-wayland intel skia-renderer-gl ] Pixel_Video_MP4 [ RetryOnFailure ] crbug.com/1271184 [ linux display-server-wayland intel skia-renderer-gl ] Pixel_Video_Context_Loss_MP4 [ RetryOnFailure ] # WebGPU pixel tests fail on Win10+SkiaRenderer+Dawn. @@ -466,12 +440,6 @@ # Flaky on Pixel 4 crbug.com/1215747 [ android android-pixel-4 skia-renderer-gl ] Pixel_OffscreenCanvasWebGLDefault [ RetryOnFailure ] -# Flaky on Nexus 5X -crbug.com/1215747 [ android android-nexus-5x skia-renderer-gl ] Pixel_OffscreenCanvasIBRCWebGLWorker [ RetryOnFailure ] - -# Flaky on Android, haven't investigated why yet. -crbug.com/1221258 [ android ] Pixel_OffscreenCanvas2DResizeOnWorker [ Failure ] - # Pixel tests are flakily asserting in GPU process on SkiaRenderer/Vulkan crbug.com/1230743 [ linux skia-renderer-vulkan ] Pixel_* [ RetryOnFailure ] @@ -507,10 +475,6 @@ crbug.com/1213542 [ skia-renderer-gl mac intel-0x3e9b no-passthrough ] Pixel_Video_Media_Stream_Incompatible_Stride [ RetryOnFailure ] crbug.com/1213542 [ skia-renderer-gl mac amd-0x6821 passthrough ] Pixel_Video_Media_Stream_Incompatible_Stride [ RetryOnFailure ] -# OffscreenCanvas pixel tests flaky crashes on ChromeOS Kevin -crbug.com/1275741 [ chromeos chromeos-board-kevin skia-renderer-gl ] Pixel_OffscreenCanvas2DResizeOnWorker [ RetryOnFailure ] -crbug.com/1275741 [ chromeos chromeos-board-kevin skia-renderer-gl ] Pixel_OffscreenCanvasIBRCWebGLMain [ RetryOnFailure ] - # Flaky on Pixel 4 Android WebView crbug.com/1276605 [ android android-pixel-4 android-webview-instrumentation skia-renderer-gl ] Pixel_OffscreenCanvasTransferToImageBitmap [ RetryOnFailure ] crbug.com/1278893 [ android android-pixel-4 android-webview-instrumentation skia-renderer-gl ] Pixel_OffscreenCanvasWebGLPaintAfterResize [ RetryOnFailure ]
diff --git a/content/test/gpu/gpu_tests/test_expectations/webgl2_conformance_expectations.txt b/content/test/gpu/gpu_tests/test_expectations/webgl2_conformance_expectations.txt index 81fcef4..fd2e37c 100644 --- a/content/test/gpu/gpu_tests/test_expectations/webgl2_conformance_expectations.txt +++ b/content/test/gpu/gpu_tests/test_expectations/webgl2_conformance_expectations.txt
@@ -77,21 +77,37 @@ # execution. The browser is restarted even after expected test # failures. [ win ] WebglExtension_WEBGL_compressed_texture_astc [ Skip ] -[ mac ] WebglExtension_WEBGL_compressed_texture_astc [ Skip ] +# ASTC textures are expected to be supported on M1 Macs. +[ mac no-passthrough ] WebglExtension_WEBGL_compressed_texture_astc [ Skip ] +[ mac passthrough angle-opengl ] WebglExtension_WEBGL_compressed_texture_astc [ Skip ] +[ mac passthrough angle-metal amd ] WebglExtension_WEBGL_compressed_texture_astc [ Skip ] +[ mac passthrough angle-metal intel ] WebglExtension_WEBGL_compressed_texture_astc [ Skip ] +[ mac passthrough angle-metal nvidia ] WebglExtension_WEBGL_compressed_texture_astc [ Skip ] [ linux ] WebglExtension_WEBGL_compressed_texture_astc [ Skip ] [ win ] WebglExtension_WEBGL_compressed_texture_etc [ Skip ] -[ mac ] WebglExtension_WEBGL_compressed_texture_etc [ Skip ] +# ETC textures are expected to be supported on M1 Macs. +[ mac no-passthrough ] WebglExtension_WEBGL_compressed_texture_etc [ Skip ] +[ mac passthrough angle-opengl ] WebglExtension_WEBGL_compressed_texture_etc [ Skip ] +[ mac passthrough angle-metal amd ] WebglExtension_WEBGL_compressed_texture_etc [ Skip ] +[ mac passthrough angle-metal intel ] WebglExtension_WEBGL_compressed_texture_etc [ Skip ] +[ mac passthrough angle-metal nvidia ] WebglExtension_WEBGL_compressed_texture_etc [ Skip ] [ linux ] WebglExtension_WEBGL_compressed_texture_etc [ Skip ] [ win ] WebglExtension_WEBGL_compressed_texture_etc1 [ Skip ] -[ mac ] WebglExtension_WEBGL_compressed_texture_etc1 [ Skip ] +# ETC textures are expected to be supported on M1 Macs. +[ mac no-passthrough ] WebglExtension_WEBGL_compressed_texture_etc1 [ Skip ] +[ mac passthrough angle-opengl ] WebglExtension_WEBGL_compressed_texture_etc1 [ Skip ] +[ mac passthrough angle-metal amd ] WebglExtension_WEBGL_compressed_texture_etc1 [ Skip ] +[ mac passthrough angle-metal intel ] WebglExtension_WEBGL_compressed_texture_etc1 [ Skip ] +[ mac passthrough angle-metal nvidia ] WebglExtension_WEBGL_compressed_texture_etc1 [ Skip ] [ linux ] WebglExtension_WEBGL_compressed_texture_etc1 [ Skip ] [ win ] WebglExtension_WEBGL_compressed_texture_pvrtc [ Skip ] [ mac ] WebglExtension_WEBGL_compressed_texture_pvrtc [ Skip ] [ linux ] WebglExtension_WEBGL_compressed_texture_pvrtc [ Skip ] [ win ] WebglExtension_WEBGL_compressed_texture_s3tc_srgb [ Skip ] -[ mac ] WebglExtension_WEBGL_compressed_texture_s3tc_srgb [ Skip ] [ linux ] WebglExtension_WEBGL_compressed_texture_s3tc_srgb [ Skip ] -[ mac ] WebglExtension_EXT_texture_compression_bptc [ Skip ] +# BPTC textures are supported on macOS only on the Metal backend. +[ mac no-passthrough ] WebglExtension_EXT_texture_compression_bptc [ Skip ] +[ mac passthrough angle-opengl ] WebglExtension_EXT_texture_compression_bptc [ Skip ] [ android qualcomm ] WebglExtension_EXT_texture_compression_bptc [ Skip ] [ android qualcomm ] WebglExtension_EXT_texture_compression_rgtc [ Skip ] [ desktop no-passthrough ] WebglExtension_EXT_color_buffer_half_float [ Skip ]
diff --git a/content/test/gpu/gpu_tests/test_expectations/webgl_conformance_expectations.txt b/content/test/gpu/gpu_tests/test_expectations/webgl_conformance_expectations.txt index ce5f030..4f9cb153 100644 --- a/content/test/gpu/gpu_tests/test_expectations/webgl_conformance_expectations.txt +++ b/content/test/gpu/gpu_tests/test_expectations/webgl_conformance_expectations.txt
@@ -77,24 +77,40 @@ # execution. The browser is restarted even after expected test # failures. [ win ] WebglExtension_WEBGL_compressed_texture_astc [ Skip ] -[ mac ] WebglExtension_WEBGL_compressed_texture_astc [ Skip ] +# ASTC textures are expected to be supported on M1 Macs. +[ mac no-passthrough ] WebglExtension_WEBGL_compressed_texture_astc [ Skip ] +[ mac passthrough angle-opengl ] WebglExtension_WEBGL_compressed_texture_astc [ Skip ] +[ mac passthrough angle-metal amd ] WebglExtension_WEBGL_compressed_texture_astc [ Skip ] +[ mac passthrough angle-metal intel ] WebglExtension_WEBGL_compressed_texture_astc [ Skip ] +[ mac passthrough angle-metal nvidia ] WebglExtension_WEBGL_compressed_texture_astc [ Skip ] [ linux ] WebglExtension_WEBGL_compressed_texture_astc [ Skip ] [ win ] WebglExtension_WEBGL_compressed_texture_etc [ Skip ] -[ mac ] WebglExtension_WEBGL_compressed_texture_etc [ Skip ] +# ETC textures are expected to be supported on M1 Macs. +[ mac no-passthrough ] WebglExtension_WEBGL_compressed_texture_etc [ Skip ] +[ mac passthrough angle-opengl ] WebglExtension_WEBGL_compressed_texture_etc [ Skip ] +[ mac passthrough angle-metal amd ] WebglExtension_WEBGL_compressed_texture_etc [ Skip ] +[ mac passthrough angle-metal intel ] WebglExtension_WEBGL_compressed_texture_etc [ Skip ] +[ mac passthrough angle-metal nvidia ] WebglExtension_WEBGL_compressed_texture_etc [ Skip ] [ linux ] WebglExtension_WEBGL_compressed_texture_etc [ Skip ] [ win ] WebglExtension_WEBGL_compressed_texture_etc1 [ Skip ] -[ mac ] WebglExtension_WEBGL_compressed_texture_etc1 [ Skip ] +# ETC textures are expected to be supported on M1 Macs. +[ mac no-passthrough ] WebglExtension_WEBGL_compressed_texture_etc1 [ Skip ] +[ mac passthrough angle-opengl ] WebglExtension_WEBGL_compressed_texture_etc1 [ Skip ] +[ mac passthrough angle-metal amd ] WebglExtension_WEBGL_compressed_texture_etc1 [ Skip ] +[ mac passthrough angle-metal intel ] WebglExtension_WEBGL_compressed_texture_etc1 [ Skip ] +[ mac passthrough angle-metal nvidia ] WebglExtension_WEBGL_compressed_texture_etc1 [ Skip ] [ linux ] WebglExtension_WEBGL_compressed_texture_etc1 [ Skip ] [ win ] WebglExtension_WEBGL_compressed_texture_pvrtc [ Skip ] [ mac ] WebglExtension_WEBGL_compressed_texture_pvrtc [ Skip ] [ linux ] WebglExtension_WEBGL_compressed_texture_pvrtc [ Skip ] [ fuchsia ] WebglExtension_WEBGL_compressed_texture_pvrtc [ Skip ] [ win ] WebglExtension_WEBGL_compressed_texture_s3tc_srgb [ Skip ] -[ mac ] WebglExtension_WEBGL_compressed_texture_s3tc_srgb [ Skip ] [ linux ] WebglExtension_WEBGL_compressed_texture_s3tc_srgb [ Skip ] [ android ] WebglExtension_WEBGL_compressed_texture_s3tc_srgb [ Skip ] [ fuchsia ] WebglExtension_WEBGL_compressed_texture_s3tc_srgb [ Skip ] -[ mac ] WebglExtension_EXT_texture_compression_bptc [ Skip ] +# BPTC textures are supported on macOS only on the Metal backend. +[ mac no-passthrough ] WebglExtension_EXT_texture_compression_bptc [ Skip ] +[ mac passthrough angle-opengl ] WebglExtension_EXT_texture_compression_bptc [ Skip ] crbug.com/808744 [ android ] WebglExtension_EXT_disjoint_timer_query [ Skip ] crbug.com/808744 [ fuchsia ] WebglExtension_EXT_disjoint_timer_query [ Skip ] crbug.com/849576 [ no-passthrough ] WebglExtension_KHR_parallel_shader_compile [ Skip ]
diff --git a/docs/gpu/gpu_testing_bot_details.md b/docs/gpu/gpu_testing_bot_details.md index 7a04d2a..056ad217 100644 --- a/docs/gpu/gpu_testing_bot_details.md +++ b/docs/gpu/gpu_testing_bot_details.md
@@ -415,7 +415,7 @@ 1. Updates [`ci.star`][ci.star] and its related generated files [`cr-buildbucket.cfg`][cr-buildbucket.cfg], [`luci-scheduler.cfg`][luci-scheduler.cfg], and - ['luci-milo.cfg`][luci-milo.cfg]: + [`luci-milo.cfg`][luci-milo.cfg]: * Use the appropriate definition for the type of the bot being added, for example, `ci.gpu_fyi_thin_tester()` should be used for all CI tester bots on GPU FYI waterfall. @@ -681,7 +681,12 @@ 1. If an "experimental" version of this bot doesn't yet exist, follow the instructions above for [How to add a new tester bot to the chromium.gpu.fyi waterfall](#How-to-add-a-new-tester-bot-to-the-chromium_gpu_fyi-waterfall) - to deploy one. + to deploy one. However, you do not need to request additional GCE resources + since there should be enough spare capacity in the GPU builderless pool to + handle them. +1. If an "experimental" version does already exist, move it from the + `chromium.gpu.experimental` console to its default console in + [`ci.star`][ci.star] and unpause it in the [luci scheduler]. 1. Have this experimental bot target the new version of the driver or the OS in [`waterfalls.pyl`][waterfalls.pyl] and [`mixins.pyl`][mixins.pyl]. [Sample CL][sample driver cl]. @@ -718,6 +723,10 @@ added above. 1. Remove the old driver or OS version from the `_stable` mixin, leaving just the new stable version. +1. Clean up the "experimental" version of the bot by pausing it in the + [luci scheduler] and moving it to the `chromium.gpu.experimental` console in + [`ci.star`][ci.star]. This is done by adding a `console_view` argument to + its `console_view_entry`. Note that we leave the experimental bot in place. We could reclaim it, but it seems worthwhile to continuously test the "next" version of graphics drivers as @@ -725,6 +734,7 @@ [sample driver cl]: https://chromium-review.googlesource.com/c/chromium/src/+/1726875 [updating gold baselines]: http://go/gpu-pixel-wrangler-info#how-to-keep-the-bots-green +[luci scheduler]: https://luci-scheduler.appspot.com/ ## Credentials for various servers
diff --git a/docs/testing/web_tests_in_content_shell.md b/docs/testing/web_tests_in_content_shell.md index 7b3174e..c9b4b5b 100644 --- a/docs/testing/web_tests_in_content_shell.md +++ b/docs/testing/web_tests_in_content_shell.md
@@ -84,7 +84,7 @@ out/Release: ```bash -vpython3 third_party/blink/tools/run_blink_httpd.py -t <build directory> +vpython third_party/blink/tools/run_blink_httpd.py -t <build directory> ``` Then run the test with a localhost URL: @@ -101,7 +101,7 @@ tests require some setup before running in Content Shell: ```bash -vpython3 third_party/blink/tools/run_blink_wptserve.py -t <build directory> +vpython third_party/blink/tools/run_blink_wptserve.py -t <build directory> ``` Then run the test: @@ -144,7 +144,7 @@ start the server: ```bash -vpython3 third_party/blink/tools/run_blink_wptserve.py +vpython third_party/blink/tools/run_blink_wptserve.py ``` Then start Content Shell with some additional flags:
diff --git a/extensions/browser/api/app_window/app_window_api.cc b/extensions/browser/api/app_window/app_window_api.cc index 63175adc..12f396b 100644 --- a/extensions/browser/api/app_window/app_window_api.cc +++ b/extensions/browser/api/app_window/app_window_api.cc
@@ -149,15 +149,16 @@ EXTENSION_FUNCTION_VALIDATE(params.get()); GURL url = extension()->GetResourceURL(params->url); - // Allow absolute URLs for component apps, otherwise prepend the extension - // path. - // TODO(devlin): Investigate if this is still used. If not, kill it dead! + // URLs normally must be relative to the extension. We make an exception + // to allow component apps to open chrome URLs (e.g. for the settings page + // on ChromeOS). GURL absolute = GURL(params->url); if (absolute.has_scheme()) { - if (extension()->location() == mojom::ManifestLocation::kComponent) { + if (extension()->location() == mojom::ManifestLocation::kComponent && + absolute.SchemeIs(content::kChromeUIScheme)) { url = absolute; } else { - // Show error when url passed isn't local. + // Show error when url passed isn't valid. return RespondNow(Error(app_window_constants::kInvalidUrlParameter)); } }
diff --git a/extensions/browser/api/app_window/app_window_apitest.cc b/extensions/browser/api/app_window/app_window_apitest.cc index ba52b4d..6dd6d36 100644 --- a/extensions/browser/api/app_window/app_window_apitest.cc +++ b/extensions/browser/api/app_window/app_window_apitest.cc
@@ -12,12 +12,14 @@ #include "chrome/common/chrome_switches.h" #include "chrome/test/base/testing_profile.h" #include "components/version_info/version_info.h" +#include "content/public/browser/web_contents.h" #include "content/public/test/browser_test.h" #include "extensions/browser/app_window/app_window.h" #include "extensions/browser/app_window/app_window_registry.h" #include "extensions/browser/app_window/native_app_window.h" #include "extensions/common/features/feature_channel.h" #include "extensions/test/extension_test_message_listener.h" +#include "net/base/filename_util.h" #include "ui/base/base_window.h" #include "ui/gfx/geometry/rect.h" @@ -190,6 +192,28 @@ << message_; } +// Tests that component extensions are allowed to open chrome:-scheme URLs in +// app windows, but not other absolute URLs. +IN_PROC_BROWSER_TEST_F(AppWindowApiTest, OpeningAbsoluteURLs) { + base::FilePath file_path = test_data_dir_.AppendASCII("body1.html"); + GURL file_url = net::FilePathToFileURL(file_path); + EXPECT_TRUE(RunExtensionTest( + "platform_apps/windows_api_opening_absolute_urls", + {.custom_arg = file_url.spec().c_str(), .launch_as_platform_app = true}, + {.load_as_component = true})) + << message_; + // The app should have successfully opened the chrome://version page. + AppWindowRegistry::AppWindowList app_windows = + AppWindowRegistry::Get(profile())->GetAppWindowsForApp( + last_loaded_extension_id()); + ASSERT_EQ(1u, app_windows.size()); + content::WebContents* app_window_contents = + (*app_windows.begin())->web_contents(); + EXPECT_EQ(GURL("chrome://version"), + app_window_contents->GetLastCommittedURL()); + EXPECT_FALSE(app_window_contents->GetMainFrame()->IsErrorDocument()); +} + #if BUILDFLAG(IS_CHROMEOS_ASH) IN_PROC_BROWSER_TEST_F(AppWindowApiTest, ImeWindowHasPermissions) { EXPECT_TRUE(RunExtensionTest(
diff --git a/extensions/browser/load_and_localize_file.cc b/extensions/browser/load_and_localize_file.cc index f3450e2d..33b296c 100644 --- a/extensions/browser/load_and_localize_file.cc +++ b/extensions/browser/load_and_localize_file.cc
@@ -101,8 +101,10 @@ })); std::string extension_default_locale; - extension.manifest()->GetString(manifest_keys::kDefaultLocale, - &extension_default_locale); + if (const std::string* temp = + extension.manifest()->FindStringPath(manifest_keys::kDefaultLocale)) { + extension_default_locale = *temp; + } auto gzip_permission = extension_l10n_util::GetGzippedMessagesPermissionForExtension(&extension);
diff --git a/extensions/common/extension.cc b/extensions/common/extension.cc index fdbb6d7..40ca522 100644 --- a/extensions/common/extension.cc +++ b/extensions/common/extension.cc
@@ -502,7 +502,6 @@ } std::string Extension::DifferentialFingerprint() const { - std::string fingerprint; // We currently support two sources of differential fingerprints: // server-provided and synthesized. Fingerprints are of the format V.FP, where // V indicates the fingerprint type (1 for SHA256 hash, 2 for app version) and @@ -510,9 +509,10 @@ // (a hash of the extension CRX), so use that when available, otherwise // synthesize a 2.VERSION fingerprint for use. For more information, see // https://github.com/google/omaha/blob/master/doc/ServerProtocolV3.md#packages--fingerprints - return manifest_->GetString(keys::kDifferentialFingerprint, &fingerprint) - ? fingerprint - : "2." + VersionString(); + if (const std::string* fingerprint = + manifest_->FindStringPath(keys::kDifferentialFingerprint)) + return *fingerprint; + return "2." + VersionString(); } std::string Extension::GetVersionForDisplay() const { @@ -611,8 +611,10 @@ if (!LoadRequiredFeatures(error)) return false; - // We don't need to validate because InitExtensionID already did that. - manifest_->GetString(keys::kPublicKey, &public_key_); + if (const std::string* temp = manifest()->FindStringPath(keys::kPublicKey)) { + // We don't need to validate because ComputeExtensionId() already did that. + public_key_ = *temp; + } extension_origin_ = Extension::CreateOriginFromExtensionId(id()); extension_url_ = Extension::GetBaseURLFromExtensionId(id()); @@ -650,36 +652,38 @@ } bool Extension::LoadName(std::u16string* error) { - std::u16string localized_name; - if (!manifest_->GetString(keys::kName, &localized_name)) { + const std::string* non_localized_name_ptr = + manifest_->FindStringPath(keys::kName); + if (non_localized_name_ptr == nullptr) { *error = errors::kInvalidName16; return false; } - non_localized_name_ = base::UTF16ToUTF8(localized_name); + non_localized_name_ = *non_localized_name_ptr; std::u16string sanitized_name = - base::CollapseWhitespace(localized_name, true); + base::CollapseWhitespace(base::UTF8ToUTF16(non_localized_name_), true); base::i18n::SanitizeUserSuppliedString(&sanitized_name); display_name_ = base::UTF16ToUTF8(sanitized_name); return true; } bool Extension::LoadVersion(std::u16string* error) { - std::string version_str; - if (!manifest_->GetString(keys::kVersion, &version_str)) { + const std::string* version_str = manifest_->FindStringPath(keys::kVersion); + if (version_str == nullptr) { *error = errors::kInvalidVersion; return false; } - version_ = base::Version(version_str); + version_ = base::Version(*version_str); if (!version_.IsValid() || version_.components().size() > 4) { *error = errors::kInvalidVersion; return false; } - if (manifest_->FindKey(keys::kVersionName)) { - if (!manifest_->GetString(keys::kVersionName, &version_name_)) { + if (const base::Value* temp = manifest_->FindKey(keys::kVersionName)) { + if (!temp->is_string()) { *error = errors::kInvalidVersionName; return false; } + version_name_ = temp->GetString(); } return true; } @@ -789,10 +793,12 @@ } bool Extension::LoadDescription(std::u16string* error) { - if (manifest_->FindKey(keys::kDescription) && - !manifest_->GetString(keys::kDescription, &description_)) { - *error = errors::kInvalidDescription; - return false; + if (const base::Value* temp = manifest_->FindKey(keys::kDescription)) { + if (!temp->is_string()) { + *error = errors::kInvalidDescription; + return false; + } + description_ = temp->GetString(); } return true; } @@ -832,14 +838,14 @@ } bool Extension::LoadShortName(std::u16string* error) { - if (manifest_->FindKey(keys::kShortName)) { - std::u16string localized_short_name; - if (!manifest_->GetString(keys::kShortName, &localized_short_name) || - localized_short_name.empty()) { + if (const base::Value* temp = manifest_->FindKey(keys::kShortName)) { + const std::string* localized_short_name_utf8 = temp->GetIfString(); + if (!localized_short_name_utf8 || localized_short_name_utf8->empty()) { *error = errors::kInvalidShortName; return false; } - + std::u16string localized_short_name = + base::UTF8ToUTF16(*localized_short_name_utf8); base::i18n::AdjustStringForLocaleDirection(&localized_short_name); short_name_ = base::UTF16ToUTF8(localized_short_name); } else {
diff --git a/extensions/common/manifest.cc b/extensions/common/manifest.cc index 0451f04..23ec971 100644 --- a/extensions/common/manifest.cc +++ b/extensions/common/manifest.cc
@@ -337,14 +337,8 @@ return available_values_->FindIntPath(path); } -bool Manifest::GetString( - const std::string& path, std::string* out_value) const { - return available_values_->GetString(path, out_value); -} - -bool Manifest::GetString(const std::string& path, - std::u16string* out_value) const { - return available_values_->GetString(path, out_value); +const std::string* Manifest::FindStringPath(base::StringPiece path) const { + return available_values_->FindStringPath(path); } bool Manifest::GetDictionary(
diff --git a/extensions/common/manifest.h b/extensions/common/manifest.h index 8eefa8d4..70f0c5f 100644 --- a/extensions/common/manifest.h +++ b/extensions/common/manifest.h
@@ -174,10 +174,7 @@ const base::Value* FindPath(base::StringPiece path) const; absl::optional<bool> FindBoolPath(base::StringPiece path) const; absl::optional<int> FindIntPath(base::StringPiece path) const; - // TODO(crbug/1187061): Update these methods to use non-deprecated - // base::Value methods. - bool GetString(const std::string& path, std::string* out_value) const; - bool GetString(const std::string& path, std::u16string* out_value) const; + const std::string* FindStringPath(base::StringPiece path) const; // Deprecated: Use the GetDictionary() overload that accepts a base::Value // output parameter instead. bool GetDictionary(const std::string& path,
diff --git a/extensions/common/manifest_handlers/default_locale_handler.cc b/extensions/common/manifest_handlers/default_locale_handler.cc index ff47f36..de40adab 100644 --- a/extensions/common/manifest_handlers/default_locale_handler.cc +++ b/extensions/common/manifest_handlers/default_locale_handler.cc
@@ -39,12 +39,16 @@ bool DefaultLocaleHandler::Parse(Extension* extension, std::u16string* error) { std::unique_ptr<LocaleInfo> info(new LocaleInfo); - if (!extension->manifest()->GetString(keys::kDefaultLocale, - &info->default_locale) || - !l10n_util::IsValidLocaleSyntax(info->default_locale)) { + + const std::string* default_locale = + extension->manifest()->FindStringPath(keys::kDefaultLocale); + if (default_locale == nullptr || + !l10n_util::IsValidLocaleSyntax(*default_locale)) { *error = manifest_errors::kInvalidDefaultLocale16; return false; } + info->default_locale = *default_locale; + extension->SetManifestData(keys::kDefaultLocale, std::move(info)); return true; }
diff --git a/extensions/common/manifest_handlers/kiosk_mode_info.cc b/extensions/common/manifest_handlers/kiosk_mode_info.cc index 8a1c7c8..e84e306 100644 --- a/extensions/common/manifest_handlers/kiosk_mode_info.cc +++ b/extensions/common/manifest_handlers/kiosk_mode_info.cc
@@ -181,12 +181,14 @@ // Optional kiosk.required_platform_version key. std::string required_platform_version; - if (manifest->FindPath(keys::kKioskRequiredPlatformVersion) && - (!manifest->GetString(keys::kKioskRequiredPlatformVersion, - &required_platform_version) || - !KioskModeInfo::IsValidPlatformVersion(required_platform_version))) { - *error = manifest_errors::kInvalidKioskRequiredPlatformVersion; - return false; + if (const base::Value* temp = + manifest->FindPath(keys::kKioskRequiredPlatformVersion)) { + if (!temp->is_string() || + !KioskModeInfo::IsValidPlatformVersion(temp->GetString())) { + *error = manifest_errors::kInvalidKioskRequiredPlatformVersion; + return false; + } + required_platform_version = temp->GetString(); } // Optional kiosk.always_update key.
diff --git a/extensions/common/manifest_handlers/mime_types_handler.cc b/extensions/common/manifest_handlers/mime_types_handler.cc index 182fecd0..bb86605 100644 --- a/extensions/common/manifest_handlers/mime_types_handler.cc +++ b/extensions/common/manifest_handlers/mime_types_handler.cc
@@ -157,10 +157,9 @@ info->handler_.AddMIMEType(entry.GetString()); } - std::string mime_types_handler; - if (extension->manifest()->GetString(keys::kMimeTypesHandler, - &mime_types_handler)) { - info->handler_.set_handler_url(mime_types_handler); + if (const std::string* mime_types_handler = + extension->manifest()->FindStringPath(keys::kMimeTypesHandler)) { + info->handler_.set_handler_url(*mime_types_handler); } extension->SetManifestData(keys::kMimeTypesHandler, std::move(info));
diff --git a/extensions/common/manifest_handlers/options_page_info.cc b/extensions/common/manifest_handlers/options_page_info.cc index 3ddcbad..29c44ef 100644 --- a/extensions/common/manifest_handlers/options_page_info.cc +++ b/extensions/common/manifest_handlers/options_page_info.cc
@@ -178,11 +178,13 @@ const Manifest* manifest = extension->manifest(); std::string options_page_string; - if (manifest->FindPath(keys::kOptionsPage) && - !manifest->GetString(keys::kOptionsPage, &options_page_string)) { - *error = ErrorUtils::FormatErrorMessageUTF16(errors::kInvalidOptionsPage, - keys::kOptionsPage); - return false; + if (const base::Value* temp = manifest->FindPath(keys::kOptionsPage)) { + if (!temp->is_string()) { + *error = ErrorUtils::FormatErrorMessageUTF16(errors::kInvalidOptionsPage, + keys::kOptionsPage); + return false; + } + options_page_string = temp->GetString(); } const base::Value* options_ui_value = manifest->FindPath(keys::kOptionsUI);
diff --git a/extensions/common/manifest_url_handlers.cc b/extensions/common/manifest_url_handlers.cc index 7b9bd96a..dde34dd 100644 --- a/extensions/common/manifest_url_handlers.cc +++ b/extensions/common/manifest_url_handlers.cc
@@ -100,18 +100,18 @@ bool HomepageURLHandler::Parse(Extension* extension, std::u16string* error) { std::unique_ptr<ManifestURL> manifest_url(new ManifestURL); - std::string homepage_url_str; - if (!extension->manifest()->GetString(keys::kHomepageURL, - &homepage_url_str)) { + const std::string* homepage_url_str = + extension->manifest()->FindStringPath(keys::kHomepageURL); + if (homepage_url_str == nullptr) { *error = ErrorUtils::FormatErrorMessageUTF16(errors::kInvalidHomepageURL, std::string()); return false; } - manifest_url->url_ = GURL(homepage_url_str); + manifest_url->url_ = GURL(*homepage_url_str); if (!manifest_url->url_.is_valid() || !manifest_url->url_.SchemeIsHTTPOrHTTPS()) { - *error = ErrorUtils::FormatErrorMessageUTF16( - errors::kInvalidHomepageURL, homepage_url_str); + *error = ErrorUtils::FormatErrorMessageUTF16(errors::kInvalidHomepageURL, + *homepage_url_str); return false; } extension->SetManifestData(keys::kHomepageURL, std::move(manifest_url)); @@ -131,19 +131,20 @@ bool UpdateURLHandler::Parse(Extension* extension, std::u16string* error) { std::unique_ptr<ManifestURL> manifest_url(new ManifestURL); - std::string tmp_update_url; - if (!extension->manifest()->GetString(keys::kUpdateURL, &tmp_update_url)) { + const std::string* tmp_update_url = + extension->manifest()->FindStringPath(keys::kUpdateURL); + if (tmp_update_url == nullptr) { *error = ErrorUtils::FormatErrorMessageUTF16(errors::kInvalidUpdateURL, std::string()); return false; } - manifest_url->url_ = GURL(tmp_update_url); + manifest_url->url_ = GURL(*tmp_update_url); if (!manifest_url->url_.is_valid() || manifest_url->url_.has_ref()) { - *error = ErrorUtils::FormatErrorMessageUTF16( - errors::kInvalidUpdateURL, tmp_update_url); + *error = ErrorUtils::FormatErrorMessageUTF16(errors::kInvalidUpdateURL, + *tmp_update_url); return false; } @@ -164,18 +165,19 @@ bool AboutPageHandler::Parse(Extension* extension, std::u16string* error) { std::unique_ptr<ManifestURL> manifest_url(new ManifestURL); - std::string about_str; - if (!extension->manifest()->GetString(keys::kAboutPage, &about_str)) { + const std::string* about_str = + extension->manifest()->FindStringPath(keys::kAboutPage); + if (about_str == nullptr) { *error = errors::kInvalidAboutPage; return false; } - GURL absolute(about_str); + GURL absolute(*about_str); if (absolute.is_valid()) { *error = errors::kInvalidAboutPageExpectRelativePath; return false; } - manifest_url->url_ = extension->GetResourceURL(about_str); + manifest_url->url_ = extension->GetResourceURL(*about_str); if (!manifest_url->url_.is_valid()) { *error = errors::kInvalidAboutPage; return false;
diff --git a/extensions/renderer/module_system.cc b/extensions/renderer/module_system.cc index 28f70a1..4d39cee 100644 --- a/extensions/renderer/module_system.cc +++ b/extensions/renderer/module_system.cc
@@ -375,25 +375,9 @@ } // static -void ModuleSystem::NativeLazyFieldGetter( - v8::Local<v8::Name> property, - const v8::PropertyCallbackInfo<v8::Value>& info) { - LazyFieldGetterInner(property.As<v8::String>(), info, - &ModuleSystem::RequireNativeFromString); -} - -// static void ModuleSystem::LazyFieldGetter( v8::Local<v8::Name> property, const v8::PropertyCallbackInfo<v8::Value>& info) { - LazyFieldGetterInner(property.As<v8::String>(), info, &ModuleSystem::Require); -} - -// static -void ModuleSystem::LazyFieldGetterInner( - v8::Local<v8::String> property, - const v8::PropertyCallbackInfo<v8::Value>& info, - RequireFunction require_function) { CHECK(!info.Data().IsEmpty()); CHECK(info.Data()->IsObject()); v8::Isolate* isolate = info.GetIsolate(); @@ -439,7 +423,7 @@ v8::TryCatch try_catch(isolate); v8::Local<v8::Value> module_value; - if (!(module_system->*require_function)(name).ToLocal(&module_value)) { + if (!module_system->Require(name).ToLocal(&module_value)) { module_system->HandleException(try_catch); return; } @@ -505,15 +489,6 @@ const std::string& field, const std::string& module_name, const std::string& module_field) { - SetLazyField( - object, field, module_name, module_field, &ModuleSystem::LazyFieldGetter); -} - -void ModuleSystem::SetLazyField(v8::Local<v8::Object> object, - const std::string& field, - const std::string& module_name, - const std::string& module_field, - v8::AccessorNameGetterCallback getter) { CHECK(field.size() < v8::String::kMaxLength); CHECK(module_name.size() < v8::String::kMaxLength); CHECK(module_field.size() < v8::String::kMaxLength); @@ -528,22 +503,11 @@ SetPrivateProperty(context, parameters, kModuleField, ToV8StringUnsafe(GetIsolate(), module_field.c_str())); auto maybe = object->SetAccessor( - context, ToV8StringUnsafe(GetIsolate(), field.c_str()), getter, NULL, - parameters); + context, ToV8StringUnsafe(GetIsolate(), field.c_str()), + &ModuleSystem::LazyFieldGetter, NULL, parameters); CHECK(v8_helpers::IsTrue(maybe)); } -void ModuleSystem::SetNativeLazyField(v8::Local<v8::Object> object, - const std::string& field, - const std::string& module_name, - const std::string& module_field) { - SetLazyField(object, - field, - module_name, - module_field, - &ModuleSystem::NativeLazyFieldGetter); -} - void ModuleSystem::OnNativeBindingCreated( const std::string& api_name, v8::Local<v8::Value> api_bridge_value) {
diff --git a/extensions/renderer/module_system.h b/extensions/renderer/module_system.h index 41907fc4..6324c0a 100644 --- a/extensions/renderer/module_system.h +++ b/extensions/renderer/module_system.h
@@ -85,12 +85,6 @@ // Require the specified module. This is the equivalent of calling // require('module_name') from the loaded JS files. v8::MaybeLocal<v8::Object> Require(const std::string& module_name); - void Require(const v8::FunctionCallbackInfo<v8::Value>& args); - - // Run |code| in the current context with the name |name| used for stack - // traces. - v8::Local<v8::Value> RunString(v8::Local<v8::String> code, - v8::Local<v8::String> name); // Calls the specified method exported by the specified module. This is // equivalent to calling require('module_name').method_name() from JS. Note: @@ -123,31 +117,6 @@ // tests to mock out native modules. void OverrideNativeHandlerForTest(const std::string& name); - // Make |object|.|field| lazily evaluate to the result of - // require(|module_name|)[|module_field|]. - // - // TODO(kalman): All targets for this method are ObjectBackedNativeHandlers, - // move this logic into those classes (in fact, the chrome - // object is the only client, only that needs to implement it). - void SetLazyField(v8::Local<v8::Object> object, - const std::string& field, - const std::string& module_name, - const std::string& module_field); - - void SetLazyField(v8::Local<v8::Object> object, - const std::string& field, - const std::string& module_name, - const std::string& module_field, - v8::AccessorNameGetterCallback getter); - - // Make |object|.|field| lazily evaluate to the result of - // requireNative(|module_name|)[|module_field|]. - // TODO(kalman): Same as above. - void SetNativeLazyField(v8::Local<v8::Object> object, - const std::string& field, - const std::string& module_name, - const std::string& module_field); - // Passes exceptions to |handler| rather than console::Fatal. void SetExceptionHandlerForTest(std::unique_ptr<ExceptionHandler> handler) { exception_handler_ = std::move(handler); @@ -176,14 +145,25 @@ typedef std::map<std::string, std::unique_ptr<NativeHandler>> NativeHandlerMap; + // Run |code| in the current context with the name |name| used for stack + // traces. + v8::Local<v8::Value> RunString(v8::Local<v8::String> code, + v8::Local<v8::String> name); + + // Make |object|.|field| lazily evaluate to the result of + // require(|module_name|)[|module_field|]. + // + // TODO(kalman): All targets for this method are ObjectBackedNativeHandlers, + // move this logic into those classes (in fact, the chrome + // object is the only client, only that needs to implement it). + void SetLazyField(v8::Local<v8::Object> object, + const std::string& field, + const std::string& module_name, + const std::string& module_field); + // Retrieves the lazily defined field specified by |property|. static void LazyFieldGetter(v8::Local<v8::Name> property, const v8::PropertyCallbackInfo<v8::Value>& info); - // Retrieves the lazily defined field specified by |property| on a native - // object. - static void NativeLazyFieldGetter( - v8::Local<v8::Name> property, - const v8::PropertyCallbackInfo<v8::Value>& info); // Called when an exception is thrown but not caught. void HandleException(const v8::TryCatch& try_catch); @@ -196,15 +176,6 @@ v8::Local<v8::Value> RequireForJsInner(v8::Local<v8::String> module_name, bool create); - typedef v8::MaybeLocal<v8::Object>(ModuleSystem::*RequireFunction)( - const std::string&); - // Base implementation of a LazyFieldGetter which uses |require_fn| to require - // modules. - static void LazyFieldGetterInner( - v8::Local<v8::String> property, - const v8::PropertyCallbackInfo<v8::Value>& info, - RequireFunction require_function); - // Return the named source file stored in the source map. // |args[0]| - the name of a source file in source_map_. v8::Local<v8::Value> GetSource(const std::string& module_name);
diff --git a/extensions/renderer/module_system_test.cc b/extensions/renderer/module_system_test.cc index b34ba606..51acc056 100644 --- a/extensions/renderer/module_system_test.cc +++ b/extensions/renderer/module_system_test.cc
@@ -262,6 +262,14 @@ return handle_scope.Escape(object); } +void ModuleSystemTestEnvironment::SetLazyField( + v8::Local<v8::Object> object, + const std::string& field, + const std::string& module_name, + const std::string& module_field) { + module_system()->SetLazyField(object, field, module_name, module_field); +} + ModuleSystemTest::ModuleSystemTest() : isolate_holder_(task_environment_.GetMainThreadTaskRunner(), gin::IsolateHolder::IsolateType::kTest),
diff --git a/extensions/renderer/module_system_test.h b/extensions/renderer/module_system_test.h index 7ac87d4..66d6a440 100644 --- a/extensions/renderer/module_system_test.h +++ b/extensions/renderer/module_system_test.h
@@ -58,6 +58,12 @@ // Create an empty object in the global scope with name |name|. v8::Local<v8::Object> CreateGlobal(const std::string& name); + // Registers a native field in the ModuleSystem. + void SetLazyField(v8::Local<v8::Object> object, + const std::string& field, + const std::string& module_name, + const std::string& module_field); + void ShutdownGin(); void ShutdownModuleSystem();
diff --git a/extensions/renderer/module_system_unittest.cc b/extensions/renderer/module_system_unittest.cc index 6d2ffab8..1eeba3df0 100644 --- a/extensions/renderer/module_system_unittest.cc +++ b/extensions/renderer/module_system_unittest.cc
@@ -155,7 +155,7 @@ v8::Local<v8::Object> object = env()->CreateGlobal("object"); - env()->module_system()->SetLazyField(object, "blah", "lazy", "x"); + env()->SetLazyField(object, "blah", "lazy", "x"); env()->RegisterModule("test", "var assert = requireNative('assert');" @@ -176,7 +176,7 @@ v8::Local<v8::Object> object = env()->CreateGlobal("object"); - env()->module_system()->SetLazyField(object, "thing", "lazy", "object"); + env()->SetLazyField(object, "thing", "lazy", "object"); env()->RegisterModule("test", "var assert = requireNative('assert');" @@ -198,7 +198,7 @@ v8::Local<v8::Object> object = env()->CreateGlobal("object"); - env()->module_system()->SetLazyField(object, "x", "lazy", "x"); + env()->SetLazyField(object, "x", "lazy", "x"); env()->RegisterModule("test", "var assert = requireNative('assert');" @@ -217,7 +217,7 @@ env()->RegisterModule("lazy", "exports.$set('x', 5);"); v8::Local<v8::Object> object = env()->CreateGlobal("object"); - env()->module_system()->SetLazyField(object, "x", "lazy", "x"); + env()->SetLazyField(object, "x", "lazy", "x"); env()->RegisterModule("test", "object.x;" "requireNative('assert').AssertTrue(true);"); @@ -233,7 +233,7 @@ v8::Local<v8::Object> object = env()->CreateGlobal("object"); - env()->module_system()->SetLazyField(object, "thing", "lazy", "output"); + env()->SetLazyField(object, "thing", "lazy", "output"); env()->RegisterModule("test", "var assert = requireNative('assert');"
diff --git a/extensions/renderer/resources/mime_handler_private_custom_bindings.js b/extensions/renderer/resources/mime_handler_private_custom_bindings.js index df2162f..66c9e46e 100644 --- a/extensions/renderer/resources/mime_handler_private_custom_bindings.js +++ b/extensions/renderer/resources/mime_handler_private_custom_bindings.js
@@ -6,7 +6,8 @@ * Custom bindings for the mime handler API. */ -var utils = require('utils'); +var exceptionHandler = require('uncaught_exception_handler'); +var logActivity = requireNative('activityLogger'); var NO_STREAM_ERROR = 'Streams are only available from a mime handler view guest.'; @@ -17,6 +18,34 @@ } loadScript('extensions/common/api/mime_handler.mojom'); +// DO NOT USE. This causes problems with safe builtins, and makes migration to +// native bindings more difficult. +function handleRequestWithPromiseDoNotUse( + binding, apiName, methodName, customizedFunction) { + var fullName = apiName + '.' + methodName; + var extensionId = requireNative('process').GetExtensionId(); + binding.setHandleRequest(methodName, function() { + logActivity.LogAPICall(extensionId, fullName, $Array.slice(arguments)); + var stack = exceptionHandler.getExtensionStackTrace(); + var callback = arguments[arguments.length - 1]; + var args = $Array.slice(arguments, 0, arguments.length - 1); + var keepAlive = require('keep_alive').createKeepAlive(); + $Function.apply(customizedFunction, this, args).then(function(result) { + if (callback) { + exceptionHandler.safeCallbackApply( + fullName, callback, [result], stack); + } + }).catch(function(error) { + if (callback) { + var message = exceptionHandler.safeErrorToString(error, true); + bindingUtil.runCallbackWithLastError(message, callback); + } + }).then(function() { + keepAlive.close(); + }); + }); +}; + var servicePtr = new extensions.mimeHandler.MimeHandlerServicePtr; Mojo.bindInterface( extensions.mimeHandler.MimeHandlerService.name, @@ -60,7 +89,7 @@ apiBridge.registerCustomHook(function(bindingsAPI) { var apiFunctions = bindingsAPI.apiFunctions; - utils.handleRequestWithPromiseDoNotUse( + handleRequestWithPromiseDoNotUse( apiFunctions, 'mimeHandlerPrivate', 'getStreamInfo', function() { if (!streamInfoPromise) @@ -73,7 +102,7 @@ servicePtr.setPdfPluginAttributes(pdfPluginAttributes); }); - utils.handleRequestWithPromiseDoNotUse( + handleRequestWithPromiseDoNotUse( apiFunctions, 'mimeHandlerPrivate', 'setShowBeforeUnloadDialog', function(showDialog) { return beforeUnloadControlPtr.setShowBeforeUnloadDialog(showDialog);
diff --git a/extensions/renderer/resources/utils.js b/extensions/renderer/resources/utils.js index cb55b5d..dede8b9 100644 --- a/extensions/renderer/resources/utils.js +++ b/extensions/renderer/resources/utils.js
@@ -3,8 +3,6 @@ // found in the LICENSE file. var nativeDeepCopy = requireNative('utils').deepCopy; -var logActivity = requireNative('activityLogger'); -var exceptionHandler = require('uncaught_exception_handler'); /** * An object forEach. Calls |f| with each (key, value) pair of |obj|, using @@ -175,38 +173,8 @@ return nativeDeepCopy(value); } -// DO NOT USE. This causes problems with safe builtins, and makes migration to -// native bindings more difficult. -function handleRequestWithPromiseDoNotUse( - binding, apiName, methodName, customizedFunction) { - var fullName = apiName + '.' + methodName; - var extensionId = requireNative('process').GetExtensionId(); - binding.setHandleRequest(methodName, function() { - logActivity.LogAPICall(extensionId, fullName, $Array.slice(arguments)); - var stack = exceptionHandler.getExtensionStackTrace(); - var callback = arguments[arguments.length - 1]; - var args = $Array.slice(arguments, 0, arguments.length - 1); - var keepAlive = require('keep_alive').createKeepAlive(); - $Function.apply(customizedFunction, this, args).then(function(result) { - if (callback) { - exceptionHandler.safeCallbackApply( - fullName, callback, [result], stack); - } - }).catch(function(error) { - if (callback) { - var message = exceptionHandler.safeErrorToString(error, true); - bindingUtil.runCallbackWithLastError(message, callback); - } - }).then(function() { - keepAlive.close(); - }); - }); -}; - exports.$set('forEach', forEach); exports.$set('lookup', lookup); exports.$set('defineProperty', defineProperty); exports.$set('expose', expose); exports.$set('deepCopy', deepCopy); -exports.$set('handleRequestWithPromiseDoNotUse', - handleRequestWithPromiseDoNotUse);
diff --git a/fuchsia/engine/browser/frame_impl.h b/fuchsia/engine/browser/frame_impl.h index 38b5f88..ea50835 100644 --- a/fuchsia/engine/browser/frame_impl.h +++ b/fuchsia/engine/browser/frame_impl.h
@@ -84,7 +84,9 @@ FrameImpl(const FrameImpl&) = delete; FrameImpl& operator=(const FrameImpl&) = delete; - uint64_t media_session_id() const { return media_session_id_; } + absl::optional<uint64_t> media_session_id() const { + return media_session_id_; + } FramePermissionController* permission_controller() { return &permission_controller_; @@ -360,7 +362,7 @@ // Session ID to use for fuchsia.media.AudioConsumer. Set with // SetMediaSessionId(). - uint64_t media_session_id_ = 0; + absl::optional<uint64_t> media_session_id_; // Stored settings for web contents in the current Frame. fuchsia::web::ContentAreaSettings content_area_settings_;
diff --git a/fuchsia/engine/browser/fuchsia_media_resource_provider_impl.cc b/fuchsia/engine/browser/fuchsia_media_resource_provider_impl.cc index 35db0e5..11cd249 100644 --- a/fuchsia/engine/browser/fuchsia_media_resource_provider_impl.cc +++ b/fuchsia/engine/browser/fuchsia_media_resource_provider_impl.cc
@@ -32,6 +32,13 @@ FuchsiaMediaResourceProviderImpl::~FuchsiaMediaResourceProviderImpl() = default; +void FuchsiaMediaResourceProviderImpl::ShouldUseAudioConsumer( + ShouldUseAudioConsumerCallback callback) { + auto* frame_impl = FrameImpl::FromRenderFrameHost(render_frame_host()); + DCHECK(frame_impl); + std::move(callback).Run(frame_impl->media_session_id().has_value()); +} + void FuchsiaMediaResourceProviderImpl::CreateAudioConsumer( fidl::InterfaceRequest<fuchsia::media::AudioConsumer> request) { if (base::CommandLine::ForCurrentProcess()->HasSwitch( @@ -47,7 +54,14 @@ ->Connect<fuchsia::media::SessionAudioConsumerFactory>(); auto* frame_impl = FrameImpl::FromRenderFrameHost(render_frame_host()); DCHECK(frame_impl); - factory->CreateAudioConsumer(frame_impl->media_session_id(), + + if (!frame_impl->media_session_id().has_value()) { + LOG(WARNING) << "Renderer tried creating AudioConsumer for a Frame without " + "media_session_id()."; + return; + } + + factory->CreateAudioConsumer(frame_impl->media_session_id().value(), std::move(request)); }
diff --git a/fuchsia/engine/browser/fuchsia_media_resource_provider_impl.h b/fuchsia/engine/browser/fuchsia_media_resource_provider_impl.h index 68459cf..fb23f171 100644 --- a/fuchsia/engine/browser/fuchsia_media_resource_provider_impl.h +++ b/fuchsia/engine/browser/fuchsia_media_resource_provider_impl.h
@@ -41,6 +41,7 @@ receiver); // media::mojom::FuchsiaMediaResourceProvider: + void ShouldUseAudioConsumer(ShouldUseAudioConsumerCallback callback) override; void CreateAudioConsumer( fidl::InterfaceRequest<fuchsia::media::AudioConsumer> request) override; void CreateAudioCapturer(
diff --git a/fuchsia/engine/renderer/web_engine_audio_device_factory.cc b/fuchsia/engine/renderer/web_engine_audio_device_factory.cc index c88b599..d624e277 100644 --- a/fuchsia/engine/renderer/web_engine_audio_device_factory.cc +++ b/fuchsia/engine/renderer/web_engine_audio_device_factory.cc
@@ -62,10 +62,6 @@ // Return nullptr for WebRTC streams. This will cause the caller to // fallback to AudioOutputDevice, which outputs through // AudioOutputStreamFuchsia. - // - // TODO(crbug.com/1066203): Make sure FuchsiaAudioOutputDevice doesn't - // increase latency (or degrade quality otherwise) and then switch to - // using FuchsiaAudioOutputDevice for WebRTC. return nullptr; // kNone is used in AudioDeviceFactory::GetOutputDeviceInfo() to get @@ -90,6 +86,13 @@ render_frame->GetBrowserInterfaceBroker()->GetInterface( media_resource_provider.BindNewPipeAndPassReceiver()); + // If AudioConsumer is not enabled then fallback to AudioOutputDevice. + bool use_audio_consumer = false; + if (!media_resource_provider->ShouldUseAudioConsumer(&use_audio_consumer) || + !use_audio_consumer) { + return nullptr; + } + // AudioConsumer can be used only to output to the default device. if (!params.device_id.empty()) return nullptr;
diff --git a/fuchsia/engine/renderer/web_engine_content_renderer_client.cc b/fuchsia/engine/renderer/web_engine_content_renderer_client.cc index e22dedad6..f06f33f 100644 --- a/fuchsia/engine/renderer/web_engine_content_renderer_client.cc +++ b/fuchsia/engine/renderer/web_engine_content_renderer_client.cc
@@ -25,6 +25,7 @@ #include "services/network/public/cpp/features.h" #include "services/service_manager/public/cpp/binder_registry.h" #include "third_party/blink/public/common/associated_interfaces/associated_interface_registry.h" +#include "third_party/blink/public/common/browser_interface_broker_proxy.h" #include "third_party/blink/public/web/web_view.h" #include "third_party/widevine/cdm/widevine_cdm_common.h" @@ -271,9 +272,22 @@ media::DecoderFactory* decoder_factory, base::RepeatingCallback<media::GpuVideoAcceleratorFactories*()> get_gpu_factories_cb) { + auto* interface_broker = render_frame->GetBrowserInterfaceBroker(); + + mojo::Remote<media::mojom::FuchsiaMediaResourceProvider> + media_resource_provider; + interface_broker->GetInterface( + media_resource_provider.BindNewPipeAndPassReceiver()); + + bool use_audio_consumer = false; + if (!media_resource_provider->ShouldUseAudioConsumer(&use_audio_consumer) || + !use_audio_consumer) { + return nullptr; + } + return std::make_unique<WebEngineMediaRendererFactory>( media_log, decoder_factory, std::move(get_gpu_factories_cb), - render_frame->GetBrowserInterfaceBroker()); + std::move(media_resource_provider)); } bool WebEngineContentRendererClient::RunClosureWhenInForeground(
diff --git a/fuchsia/engine/renderer/web_engine_media_renderer_factory.cc b/fuchsia/engine/renderer/web_engine_media_renderer_factory.cc index 2db54fb0..4b3b62c4 100644 --- a/fuchsia/engine/renderer/web_engine_media_renderer_factory.cc +++ b/fuchsia/engine/renderer/web_engine_media_renderer_factory.cc
@@ -11,24 +11,21 @@ #include "base/bind.h" #include "fuchsia/engine/renderer/web_engine_audio_renderer.h" #include "media/base/decoder_factory.h" -#include "media/fuchsia/mojom/fuchsia_media_resource_provider.mojom.h" #include "media/renderers/renderer_impl.h" #include "media/renderers/video_renderer_impl.h" #include "media/video/gpu_memory_buffer_video_frame_pool.h" #include "media/video/gpu_video_accelerator_factories.h" -#include "mojo/public/cpp/bindings/pending_remote.h" -#include "mojo/public/cpp/bindings/remote.h" -#include "third_party/blink/public/common/browser_interface_broker_proxy.h" WebEngineMediaRendererFactory::WebEngineMediaRendererFactory( media::MediaLog* media_log, media::DecoderFactory* decoder_factory, GetGpuFactoriesCB get_gpu_factories_cb, - blink::BrowserInterfaceBrokerProxy* interface_broker) + mojo::Remote<media::mojom::FuchsiaMediaResourceProvider> + media_resource_provider) : media_log_(media_log), decoder_factory_(decoder_factory), get_gpu_factories_cb_(std::move(get_gpu_factories_cb)), - interface_broker_(interface_broker) { + media_resource_provider_(std::move(media_resource_provider)) { DCHECK(decoder_factory_); } @@ -54,16 +51,8 @@ media::VideoRendererSink* video_renderer_sink, media::RequestOverlayInfoCB request_overlay_info_cb, const gfx::ColorSpace& target_color_space) { - mojo::PendingRemote<media::mojom::FuchsiaMediaResourceProvider> - media_resource_provider; - interface_broker_->GetInterface( - media_resource_provider.InitWithNewPipeAndPassReceiver()); - - mojo::Remote<media::mojom::FuchsiaMediaResourceProvider> - remote_media_resource_provider; - remote_media_resource_provider.Bind(std::move(media_resource_provider)); fidl::InterfaceHandle<fuchsia::media::AudioConsumer> audio_consumer_handle; - remote_media_resource_provider->CreateAudioConsumer( + media_resource_provider_->CreateAudioConsumer( audio_consumer_handle.NewRequest()); auto audio_renderer = std::make_unique<WebEngineAudioRenderer>( media_log_, std::move(audio_consumer_handle));
diff --git a/fuchsia/engine/renderer/web_engine_media_renderer_factory.h b/fuchsia/engine/renderer/web_engine_media_renderer_factory.h index c94c454..886a9f2 100644 --- a/fuchsia/engine/renderer/web_engine_media_renderer_factory.h +++ b/fuchsia/engine/renderer/web_engine_media_renderer_factory.h
@@ -10,10 +10,8 @@ #include "base/callback.h" #include "media/base/renderer_factory.h" - -namespace blink { -class BrowserInterfaceBrokerProxy; -} // namespace blink +#include "media/fuchsia/mojom/fuchsia_media_resource_provider.mojom.h" +#include "mojo/public/cpp/bindings/remote.h" namespace media { class AudioRendererSink; @@ -35,7 +33,8 @@ media::MediaLog* media_log, media::DecoderFactory* decoder_factory, GetGpuFactoriesCB get_gpu_factories_cb, - blink::BrowserInterfaceBrokerProxy* interface_broker); + mojo::Remote<media::mojom::FuchsiaMediaResourceProvider> + media_resource_provider); ~WebEngineMediaRendererFactory() override; // RendererFactory interface. @@ -63,7 +62,8 @@ // Creates factories for supporting video accelerators. May be null. GetGpuFactoriesCB get_gpu_factories_cb_; - blink::BrowserInterfaceBrokerProxy* const interface_broker_; + mojo::Remote<media::mojom::FuchsiaMediaResourceProvider> + media_resource_provider_; }; #endif // FUCHSIA_ENGINE_RENDERER_WEB_ENGINE_MEDIA_RENDERER_FACTORY_H_
diff --git a/fuchsia/engine/web_engine_integration_test.cc b/fuchsia/engine/web_engine_integration_test.cc index 91c46809..8a3933f 100644 --- a/fuchsia/engine/web_engine_integration_test.cc +++ b/fuchsia/engine/web_engine_integration_test.cc
@@ -347,7 +347,7 @@ TEST_F(WebEngineIntegrationMediaTest, PlayAudio) { CreateContextAndFrame(ContextParamsWithAudioAndTestData()); - static uint16_t kTestMediaSessionId = 43; + static const uint16_t kTestMediaSessionId = 43; frame_->SetMediaSessionId(kTestMediaSessionId); ASSERT_NO_FATAL_FAILURE(LoadUrlAndExpectResponse( @@ -388,6 +388,9 @@ [&is_requested](auto request) { is_requested = true; })); ZX_CHECK(status == ZX_OK, status) << "AddPublicService"; + static const uint16_t kTestMediaSessionId = 1; + frame_->SetMediaSessionId(kTestMediaSessionId); + ASSERT_NO_FATAL_FAILURE(LoadUrlAndExpectResponse( "fuchsia-dir://testdata/play_audio.html", cr_fuchsia::CreateLoadUrlParamsWithUserActivation())); @@ -399,6 +402,9 @@ TEST_F(WebEngineIntegrationMediaTest, PlayVideo) { CreateContextAndFrame(ContextParamsWithAudioAndTestData()); + static const uint16_t kTestMediaSessionId = 1; + frame_->SetMediaSessionId(kTestMediaSessionId); + ASSERT_NO_FATAL_FAILURE(LoadUrlAndExpectResponse( kAutoplayVp9OpusToEndUrl, cr_fuchsia::CreateLoadUrlParamsWithUserActivation())); @@ -609,6 +615,9 @@ fuchsia::web::ContextFeatureFlags::AUDIO); CreateContextAndFrame(std::move(create_params)); + static const uint16_t kTestMediaSessionId = 1; + frame_->SetMediaSessionId(kTestMediaSessionId); + ASSERT_NO_FATAL_FAILURE(LoadUrlAndExpectResponse( kAutoplayVp9OpusToEndUrl, cr_fuchsia::CreateLoadUrlParamsWithUserActivation())); @@ -630,6 +639,9 @@ ContextParamsWithAudioAndTestData(); CreateContextAndFrame(std::move(create_params)); + static const uint16_t kTestMediaSessionId = 1; + frame_->SetMediaSessionId(kTestMediaSessionId); + ASSERT_NO_FATAL_FAILURE(LoadUrlAndExpectResponse( kAutoplayVp9OpusToEndUrl, cr_fuchsia::CreateLoadUrlParamsWithUserActivation()));
diff --git a/infra/config/generated/luci/luci-scheduler.cfg b/infra/config/generated/luci/luci-scheduler.cfg index 48811d0..b6db6fd7 100644 --- a/infra/config/generated/luci/luci-scheduler.cfg +++ b/infra/config/generated/luci/luci-scheduler.cfg
@@ -4825,7 +4825,7 @@ job { id: "flakiness-data-packager" realm: "flakiness" - schedule: "0 8 * * *" + schedule: "0 */6 * * *" acl_sets: "flakiness" buildbucket { server: "cr-buildbucket.appspot.com"
diff --git a/infra/config/subprojects/flakiness/flakiness.star b/infra/config/subprojects/flakiness/flakiness.star index 49c0bf2..4905345 100644 --- a/infra/config/subprojects/flakiness/flakiness.star +++ b/infra/config/subprojects/flakiness/flakiness.star
@@ -51,5 +51,5 @@ short_name = "model", ), executable = "recipe:flakiness/generate_builder_test_data", - schedule = "0 8 * * *", + schedule = "0 */6 * * *", )
diff --git a/ios/chrome/browser/ui/tab_switcher/tab_grid/tab_grid_top_toolbar.mm b/ios/chrome/browser/ui/tab_switcher/tab_grid/tab_grid_top_toolbar.mm index c7438856..b32abb1 100644 --- a/ios/chrome/browser/ui/tab_switcher/tab_grid/tab_grid_top_toolbar.mm +++ b/ios/chrome/browser/ui/tab_switcher/tab_grid/tab_grid_top_toolbar.mm
@@ -249,8 +249,7 @@ UIBarButtonItem* trailingButton = _doneButton; _selectionModeFixedSpace.width = 0; if ([self shouldUseCompactLayout:traitCollection]) { - if (IsTabsSearchEnabled() && _mode == TabGridModeNormal && - _page != TabGridPageRemoteTabs) { + if (IsTabsSearchEnabled() && _mode == TabGridModeNormal) { _leadingButton = _searchButton; } else { _leadingButton = _spaceItem; @@ -299,8 +298,7 @@ _leadingButton = _selectAllButton; } - if (IsTabsSearchEnabled() && _mode == TabGridModeNormal && - _page != TabGridPageRemoteTabs) { + if (IsTabsSearchEnabled() && _mode == TabGridModeNormal) { [self setItems:@[ _leadingButton, _iconButtonAdditionalSpaceItem, _searchButton, _spaceItem, centralItem, _spaceItem, trailingButton
diff --git a/ios/chrome/browser/ui/tab_switcher/tab_grid/tab_grid_view_controller.mm b/ios/chrome/browser/ui/tab_switcher/tab_grid/tab_grid_view_controller.mm index 8523124..feded2f 100644 --- a/ios/chrome/browser/ui/tab_switcher/tab_grid/tab_grid_view_controller.mm +++ b/ios/chrome/browser/ui/tab_switcher/tab_grid/tab_grid_view_controller.mm
@@ -616,7 +616,7 @@ self.regularTabsViewController.mode = self.tabGridMode; self.incognitoTabsViewController.mode = self.tabGridMode; self.topToolbar.mode = self.tabGridMode; - self.scrollView.scrollEnabled = (self.tabGridMode != TabGridModeSelection); + self.scrollView.scrollEnabled = (self.tabGridMode == TabGridModeNormal); if (mode == TabGridModeSelection) [self updateSelectionModeToolbars]; }
diff --git a/media/fuchsia/mojom/fuchsia_media_resource_provider.mojom b/media/fuchsia/mojom/fuchsia_media_resource_provider.mojom index 596727b..95449dd 100644 --- a/media/fuchsia/mojom/fuchsia_media_resource_provider.mojom +++ b/media/fuchsia/mojom/fuchsia_media_resource_provider.mojom
@@ -17,6 +17,12 @@ // Interface used by the render to create media resources. Instances are // document-scoped. interface FuchsiaMediaResourceProvider { + // Returns true if the frame should use AudioConsumer to render audio + // streams. The call needs to be synchronous because `media::Renderer` needs + // to be constructed synchronously. + [Sync] + ShouldUseAudioConsumer() => (bool result); + // Creates a fuchsia.media.AudioConsumer for the current frame. CreateAudioConsumer(AudioConsumerRequest request);
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 6a79c21..3df2b67 100644 --- a/mojo/public/tools/bindings/generators/cpp_templates/interface_definition.tmpl +++ b/mojo/public/tools/bindings/generators/cpp_templates/interface_definition.tmpl
@@ -135,6 +135,10 @@ method_name=event_name, parameter_group="input_parameters", trace_event_type='_BEGIN')}} +#else +{#- Output a minimal trace event if MOJO_TRACE_ENABLED is false. #} +{%- set event_name = "%s::%s" % (class_name, method.name) %} + {{interface_macros.trace_event(method_name=event_name)}} #endif const bool kExpectsResponse = true; const bool kIsSync = true;
diff --git a/net/http/http_network_session.cc b/net/http/http_network_session.cc index efdc1f0..72c7332 100644 --- a/net/http/http_network_session.cc +++ b/net/http/http_network_session.cc
@@ -100,7 +100,6 @@ http2_end_stream_with_data_frame(false), time_func(&base::TimeTicks::Now), enable_http2_alternative_service(false), - enable_websocket_over_http2(true), enable_quic(true), enable_quic_proxies_for_https_urls(false), disable_idle_sockets_close_on_memory_pressure(false),
diff --git a/net/http/http_network_session.h b/net/http/http_network_session.h index d874a299..27295e0 100644 --- a/net/http/http_network_session.h +++ b/net/http/http_network_session.h
@@ -136,8 +136,6 @@ SpdySessionPool::TimeFunc time_func; // Whether to enable HTTP/2 Alt-Svc entries. bool enable_http2_alternative_service; - // Whether to enable Websocket over HTTP/2. - bool enable_websocket_over_http2; // Enables 0-RTT support. bool enable_early_data;
diff --git a/net/http/http_stream_factory_job.cc b/net/http/http_stream_factory_job.cc index b347619a..cfb8eb2 100644 --- a/net/http/http_stream_factory_job.cc +++ b/net/http/http_stream_factory_job.cc
@@ -130,8 +130,7 @@ is_websocket_(is_websocket), try_websocket_over_http2_(is_websocket_ && origin_url_.SchemeIs(url::kWssScheme) && - proxy_info_.is_direct() && - session_->params().enable_websocket_over_http2), + proxy_info_.is_direct()), // Don't use IP connection pooling for HTTP over HTTPS proxies. It doesn't // get us much, and testing it is more effort than its worth. enable_ip_based_pooling_(
diff --git a/net/spdy/spdy_test_util_common.cc b/net/spdy/spdy_test_util_common.cc index f969c80..ddd4402 100644 --- a/net/spdy/spdy_test_util_common.cc +++ b/net/spdy/spdy_test_util_common.cc
@@ -371,8 +371,6 @@ params.time_func = session_deps->time_func; params.enable_http2_alternative_service = session_deps->enable_http2_alternative_service; - params.enable_websocket_over_http2 = - session_deps->enable_websocket_over_http2; params.enable_http2_settings_grease = session_deps->enable_http2_settings_grease; params.greased_http2_frame = session_deps->greased_http2_frame;
diff --git a/net/websockets/websocket_test_util.cc b/net/websockets/websocket_test_util.cc index c37c17b..dacd52e2 100644 --- a/net/websockets/websocket_test_util.cc +++ b/net/websockets/websocket_test_util.cc
@@ -231,7 +231,6 @@ auto params = std::make_unique<HttpNetworkSessionParams>(); params->enable_spdy_ping_based_connection_checking = false; params->enable_quic = false; - params->enable_websocket_over_http2 = true; params->disable_idle_sockets_close_on_memory_pressure = false; url_request_context_.set_http_network_session_params(std::move(params)); }
diff --git a/sandbox/policy/win/sandbox_win.cc b/sandbox/policy/win/sandbox_win.cc index 497d535f..d37d2bd 100644 --- a/sandbox/policy/win/sandbox_win.cc +++ b/sandbox/policy/win/sandbox_win.cc
@@ -25,6 +25,7 @@ #include "base/no_destructor.h" #include "base/path_service.h" #include "base/process/launch.h" +#include "base/process/process.h" #include "base/strings/strcat.h" #include "base/strings/string_number_conversions.h" #include "base/strings/string_split.h" @@ -805,6 +806,8 @@ } *process = base::LaunchProcess(cmd_line, options); + if (!process->IsValid()) + return SBOX_ERROR_CANNOT_LAUNCH_UNSANDBOXED_PROCESS; return SBOX_ALL_OK; }
diff --git a/sandbox/win/src/sandbox_types.h b/sandbox/win/src/sandbox_types.h index 3c81948..2bb42163 100644 --- a/sandbox/win/src/sandbox_types.h +++ b/sandbox/win/src/sandbox_types.h
@@ -146,6 +146,9 @@ SBOX_ERROR_CANNOT_CREATE_LOWBOX_IMPERSONATION_TOKEN = 61, // Cannot create a sandbox policy for an unsandboxed process. SBOX_ERROR_UNSANDBOXED_PROCESS = 62, + // Could not create the unsandboxed process. Extended error from + // base::LaunchProcess will be in GetLastError(). + SBOX_ERROR_CANNOT_LAUNCH_UNSANDBOXED_PROCESS = 63, // Placeholder for last item of the enum. SBOX_ERROR_LAST };
diff --git a/services/network/first_party_sets/first_party_sets.cc b/services/network/first_party_sets/first_party_sets.cc index bd86b312..d563a1e6 100644 --- a/services/network/first_party_sets/first_party_sets.cc +++ b/services/network/first_party_sets/first_party_sets.cc
@@ -78,7 +78,7 @@ } // namespace -FirstPartySets::FirstPartySets() = default; +FirstPartySets::FirstPartySets(bool enabled) : enabled_(enabled) {} FirstPartySets::~FirstPartySets() { DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); @@ -86,7 +86,7 @@ void FirstPartySets::SetManuallySpecifiedSet(const std::string& flag_value) { DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); - if (!net::cookie_util::IsFirstPartySetsEnabled()) + if (!enabled_) return; manually_specified_set_ = CanonicalizeSet(base::SplitString( @@ -99,7 +99,7 @@ void FirstPartySets::ParseAndSet(base::File sets_file) { DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); - if (!net::cookie_util::IsFirstPartySetsEnabled()) + if (!enabled_) return; base::ThreadPool::PostTaskAndReplyWithResult( FROM_HERE, {base::MayBlock(), base::TaskPriority::BEST_EFFORT}, @@ -110,7 +110,7 @@ void FirstPartySets::OnReadSetsFile(const std::string& raw_sets) { DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); - if (!net::cookie_util::IsFirstPartySetsEnabled()) + if (!enabled_) return; bool is_v1_format = raw_sets.find('[') < raw_sets.find('{'); @@ -315,6 +315,11 @@ ClearSiteDataOnChangedSetsIfReady(); } +void FirstPartySets::SetEnabledForTesting(bool enabled) { + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); + enabled_ = enabled; +} + base::flat_set<net::SchemefulSite> FirstPartySets::ComputeSetsDiff( const base::flat_map<net::SchemefulSite, net::SchemefulSite>& old_sets) const {
diff --git a/services/network/first_party_sets/first_party_sets.h b/services/network/first_party_sets/first_party_sets.h index 386031e..d62c774 100644 --- a/services/network/first_party_sets/first_party_sets.h +++ b/services/network/first_party_sets/first_party_sets.h
@@ -27,12 +27,17 @@ // updated by the component updater via |ParseAndSet|. class FirstPartySets { public: - FirstPartySets(); + explicit FirstPartySets(bool enabled); ~FirstPartySets(); FirstPartySets(const FirstPartySets&) = delete; FirstPartySets& operator=(const FirstPartySets&) = delete; + bool is_enabled() const { + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); + return enabled_; + } + // Stores the First-Party Set that was provided via the `kUseFirstPartySet` // flag/switch. // @@ -94,6 +99,8 @@ // JSON-encoded string representation of a map of site -> site. void SetOnSiteDataCleared( base::OnceCallback<void(const std::string&)> callback); + // Sets the enabled_ attribute for testing. + void SetEnabledForTesting(bool enabled); // Returns nullopt if First-Party Sets are disabled or if the input is not in // a nontrivial set. @@ -161,6 +168,7 @@ bool persisted_sets_ready_ GUARDED_BY_CONTEXT(sequence_checker_) = false; bool component_sets_ready_ GUARDED_BY_CONTEXT(sequence_checker_) = false; bool manual_sets_ready_ GUARDED_BY_CONTEXT(sequence_checker_) = false; + bool enabled_ GUARDED_BY_CONTEXT(sequence_checker_) = false; // The callback runs after the site state clearing is completed. base::OnceCallback<void(const std::string&)> on_site_data_cleared_ GUARDED_BY_CONTEXT(sequence_checker_);
diff --git a/services/network/first_party_sets/first_party_sets_unittest.cc b/services/network/first_party_sets/first_party_sets_unittest.cc index 5e19e77..10c3497 100644 --- a/services/network/first_party_sets/first_party_sets_unittest.cc +++ b/services/network/first_party_sets/first_party_sets_unittest.cc
@@ -40,13 +40,7 @@ class FirstPartySetsTest : public ::testing::Test { public: - explicit FirstPartySetsTest(bool enabled) { - if (enabled) { - feature_list_.InitAndEnableFeature(net::features::kFirstPartySets); - } else { - feature_list_.InitAndDisableFeature(net::features::kFirstPartySets); - } - } + explicit FirstPartySetsTest(bool enabled) : sets_(enabled) {} void SetComponentSetsAndWait(base::StringPiece content) { SetComponentSetsAndWait(sets_, content); @@ -100,9 +94,8 @@ } TEST_F(FirstPartySetsDisabledTest, SetsManuallySpecified_IgnoresValid) { - FirstPartySets sets; - sets.SetManuallySpecifiedSet("https://example.test,https://member.test"); - EXPECT_THAT(sets.Sets(), IsEmpty()); + sets().SetManuallySpecifiedSet("https://example.test,https://member.test"); + EXPECT_THAT(sets().Sets(), IsEmpty()); } TEST_F(FirstPartySetsDisabledTest, IsInNontrivialFirstPartySet) { @@ -130,36 +123,34 @@ net::SchemefulSite example(GURL("https://example.test")); net::SchemefulSite wss_member(GURL("wss://member1.test")); - FirstPartySets sets; - // Works if the site is provided with WSS scheme instead of HTTPS. - EXPECT_THAT(sets.ComputeContext(wss_member, &member, {member, example}), + EXPECT_THAT(sets().ComputeContext(wss_member, &member, {member, example}), net::SamePartyContext(Type::kCrossParty, Type::kCrossParty, Type::kSameParty)); - EXPECT_THAT(sets.ComputeContext(example, &member, {member}), + EXPECT_THAT(sets().ComputeContext(example, &member, {member}), net::SamePartyContext(Type::kCrossParty)); - EXPECT_THAT(sets.ComputeContext(member, &example, {member}), + EXPECT_THAT(sets().ComputeContext(member, &example, {member}), net::SamePartyContext(Type::kCrossParty)); // Top&resource differs from Ancestors. - EXPECT_THAT(sets.ComputeContext(member, &member, {example}), + EXPECT_THAT(sets().ComputeContext(member, &member, {example}), net::SamePartyContext(Type::kCrossParty, Type::kCrossParty, Type::kSameParty)); // Metrics values infer singleton sets when appropriate. - EXPECT_THAT(sets.ComputeContext(member, &member, {member}), + EXPECT_THAT(sets().ComputeContext(member, &member, {member}), net::SamePartyContext(Type::kCrossParty, Type::kSameParty, Type::kSameParty)); - EXPECT_THAT(sets.ComputeContext(member, &example, {member}), + EXPECT_THAT(sets().ComputeContext(member, &example, {member}), net::SamePartyContext(Type::kCrossParty)); - EXPECT_THAT(sets.ComputeContext(example, &member, {member}), + EXPECT_THAT(sets().ComputeContext(example, &member, {member}), net::SamePartyContext(Type::kCrossParty)); - EXPECT_THAT(sets.ComputeContext(member, &member, {example}), + EXPECT_THAT(sets().ComputeContext(member, &member, {example}), net::SamePartyContext(Type::kCrossParty, Type::kCrossParty, Type::kSameParty)); - EXPECT_THAT(sets.ComputeContext(member, &member, {member, example}), + EXPECT_THAT(sets().ComputeContext(member, &member, {member, example}), net::SamePartyContext(Type::kCrossParty, Type::kCrossParty, Type::kSameParty)); } @@ -178,7 +169,7 @@ }; TEST_F(FirstPartySetsEnabledTest, Sets_IsEmpty) { - EXPECT_THAT(FirstPartySets().Sets(), IsEmpty()); + EXPECT_THAT(sets().Sets(), IsEmpty()); } TEST_F(FirstPartySetsEnabledTest, ParsesJSON) { @@ -881,7 +872,7 @@ ] )"), old_sets); - EXPECT_THAT(FirstPartySets().ComputeSetsDiff(old_sets), + EXPECT_THAT(FirstPartySets(true).ComputeSetsDiff(old_sets), UnorderedElementsAre(SerializesTo("https://example.test"), SerializesTo("https://member1.test"))); } @@ -892,7 +883,7 @@ [&](const std::string& got) { callback_calls++; }); // component sets not ready. { - FirstPartySets sets; + FirstPartySets sets(true); callback_calls = 0; sets.SetPersistedSets("{}"); sets.SetManuallySpecifiedSet(""); @@ -901,7 +892,7 @@ } // manual sets not ready. { - FirstPartySets sets; + FirstPartySets sets(true); callback_calls = 0; SetComponentSetsAndWait(sets, "[]"); sets.SetPersistedSets("{}"); @@ -910,7 +901,7 @@ } // persisted sets not ready. { - FirstPartySets sets; + FirstPartySets sets(true); callback_calls = 0; SetComponentSetsAndWait(sets, "[]"); sets.SetManuallySpecifiedSet(""); @@ -919,7 +910,7 @@ } // callback not set. { - FirstPartySets sets; + FirstPartySets sets(true); callback_calls = 0; SetComponentSetsAndWait(sets, "[]"); sets.SetManuallySpecifiedSet("");
diff --git a/services/network/network_service.cc b/services/network/network_service.cc index 6c6c065f..e7dc472 100644 --- a/services/network/network_service.cc +++ b/services/network/network_service.cc
@@ -345,8 +345,9 @@ std::move(params->default_observer)); } - first_party_sets_ = std::make_unique<FirstPartySets>(); - if (net::cookie_util::IsFirstPartySetsEnabled()) { + first_party_sets_ = + std::make_unique<FirstPartySets>(params->first_party_sets_enabled); + if (first_party_sets_->is_enabled()) { first_party_sets_->SetManuallySpecifiedSet( command_line->GetSwitchValueASCII(switches::kUseFirstPartySet)); }
diff --git a/services/network/network_service.h b/services/network/network_service.h index 9b2dd4a..3dcea20 100644 --- a/services/network/network_service.h +++ b/services/network/network_service.h
@@ -249,9 +249,7 @@ } #endif - const FirstPartySets* first_party_sets() const { - return first_party_sets_.get(); - } + FirstPartySets* first_party_sets() const { return first_party_sets_.get(); } bool os_crypt_config_set() const { return os_crypt_config_set_; }
diff --git a/services/network/network_service_unittest.cc b/services/network/network_service_unittest.cc index 7080123..1a156af 100644 --- a/services/network/network_service_unittest.cc +++ b/services/network/network_service_unittest.cc
@@ -9,6 +9,7 @@ #include "base/base64.h" #include "base/bind.h" +#include "base/command_line.h" #include "base/containers/span.h" #include "base/files/file_util.h" #include "base/files/scoped_temp_dir.h" @@ -898,11 +899,14 @@ ~NetworkServiceTestWithService() override {} void SetUp() override { + base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); test_server_.AddDefaultHandlers(base::FilePath(kServicesTestData)); ASSERT_TRUE(test_server_.Start()); - scoped_features_.InitAndEnableFeature(net::features::kFirstPartySets); service_ = NetworkService::CreateForTesting(); service_->Bind(network_service_.BindNewPipeAndPassReceiver()); + service_->first_party_sets()->SetEnabledForTesting(true); + service_->first_party_sets()->SetManuallySpecifiedSet( + command_line->GetSwitchValueASCII(switches::kUseFirstPartySet)); } void CreateNetworkContext() {
diff --git a/services/network/public/mojom/network_service.mojom b/services/network/public/mojom/network_service.mojom index 9e4c3ee7..5d44e01 100644 --- a/services/network/public/mojom/network_service.mojom +++ b/services/network/public/mojom/network_service.mojom
@@ -137,6 +137,10 @@ // An URLLoaderFactory can provide its own URLLoaderNetworkServiceObserver // but if it does not, this default will be used. pending_remote<URLLoaderNetworkServiceObserver> default_observer; + + // A boolean provided by the Browser Process in order to plumb into the + // First-Party Sets attribute during NetworkService::Initialize(). + bool first_party_sets_enabled; }; // Information about how logging should be configured.
diff --git a/services/network/restricted_cookie_manager_unittest.cc b/services/network/restricted_cookie_manager_unittest.cc index 3ec5579..8f906f9 100644 --- a/services/network/restricted_cookie_manager_unittest.cc +++ b/services/network/restricted_cookie_manager_unittest.cc
@@ -384,9 +384,8 @@ class SamePartyEnabledRestrictedCookieManagerTest : public RestrictedCookieManagerTest { public: - SamePartyEnabledRestrictedCookieManagerTest() { + SamePartyEnabledRestrictedCookieManagerTest() : first_party_sets_(true) { feature_list_.InitAndEnableFeature(net::features::kFirstPartySets); - first_party_sets_.SetManuallySpecifiedSet( "https://example.com,https://member1.com"); auto cookie_access_delegate = std::make_unique<CookieAccessDelegateImpl>(
diff --git a/testing/buildbot/chrome.json b/testing/buildbot/chrome.json index 6facfeb6..84031f6 100644 --- a/testing/buildbot/chrome.json +++ b/testing/buildbot/chrome.json
@@ -1713,7 +1713,7 @@ { "args": [], "cros_board": "atlas", - "cros_img": "atlas-release/R99-14395.0.0", + "cros_img": "atlas-release/R99-14396.0.0", "name": "lacros_all_tast_tests_ATLAS_LKGM", "resultdb": { "enable": true, @@ -1773,7 +1773,7 @@ { "args": [], "cros_board": "eve", - "cros_img": "eve-release/R99-14395.0.0", + "cros_img": "eve-release/R99-14396.0.0", "name": "lacros_all_tast_tests_EVE_LKGM", "resultdb": { "enable": true, @@ -1878,7 +1878,7 @@ { "args": [], "cros_board": "kevin", - "cros_img": "kevin-release/R99-14395.0.0", + "cros_img": "kevin-release/R99-14396.0.0", "name": "lacros_all_tast_tests_KEVIN_LKGM", "resultdb": { "enable": true, @@ -1893,7 +1893,7 @@ { "args": [], "cros_board": "kevin", - "cros_img": "kevin-release/R99-14395.0.0", + "cros_img": "kevin-release/R99-14396.0.0", "name": "ozone_unittests_KEVIN_LKGM", "resultdb": { "enable": true, @@ -1907,7 +1907,7 @@ { "args": [], "cros_board": "kevin", - "cros_img": "kevin-release/R99-14395.0.0", + "cros_img": "kevin-release/R99-14396.0.0", "name": "viz_unittests_KEVIN_LKGM", "resultdb": { "enable": true,
diff --git a/testing/buildbot/chromium.android.json b/testing/buildbot/chromium.android.json index 33dde372..0c73659 100644 --- a/testing/buildbot/chromium.android.json +++ b/testing/buildbot/chromium.android.json
@@ -24588,7 +24588,7 @@ "name": "shard #${SHARD_INDEX} logcats" } ], - "quickrun_shards": 2, + "quickrun_shards": 3, "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" }, "test": "android_browsertests", @@ -28438,7 +28438,7 @@ "name": "shard #${SHARD_INDEX} logcats" } ], - "quickrun_shards": 4, + "quickrun_shards": 6, "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com", "shards": 2 }, @@ -37221,7 +37221,7 @@ "name": "shard #${SHARD_INDEX} logcats" } ], - "quickrun_shards": 4, + "quickrun_shards": 6, "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com", "shards": 2 }, @@ -37646,7 +37646,7 @@ "name": "shard #${SHARD_INDEX} logcats" } ], - "quickrun_shards": 30, + "quickrun_shards": 40, "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com", "shards": 15 },
diff --git a/testing/buildbot/chromium.chromiumos.json b/testing/buildbot/chromium.chromiumos.json index acb9a55..9ae0b0a 100644 --- a/testing/buildbot/chromium.chromiumos.json +++ b/testing/buildbot/chromium.chromiumos.json
@@ -247,6 +247,7 @@ } ] }, + "quickrun_shards": 4, "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com", "shards": 4 }, @@ -714,6 +715,7 @@ } ] }, + "quickrun_shards": 6, "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com", "shards": 3 },
diff --git a/testing/buildbot/chromium.gpu.json b/testing/buildbot/chromium.gpu.json index b7d498e..4fa22bd 100644 --- a/testing/buildbot/chromium.gpu.json +++ b/testing/buildbot/chromium.gpu.json
@@ -4472,6 +4472,7 @@ } ], "idempotent": false, + "quickrun_shards": 2, "service_account": "chrome-gpu-gold@chops-service-accounts.iam.gserviceaccount.com" }, "test_id_prefix": "ninja://chrome/test:telemetry_gpu_integration_test/"
diff --git a/testing/buildbot/chromium.win.json b/testing/buildbot/chromium.win.json index a807318..5277ffe8 100644 --- a/testing/buildbot/chromium.win.json +++ b/testing/buildbot/chromium.win.json
@@ -1834,6 +1834,7 @@ "os": "Windows-10-19042" } ], + "quickrun_shards": 30, "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com", "shards": 15 },
diff --git a/testing/buildbot/internal.chromeos.fyi.json b/testing/buildbot/internal.chromeos.fyi.json index c0490d7..a78fd1df 100644 --- a/testing/buildbot/internal.chromeos.fyi.json +++ b/testing/buildbot/internal.chromeos.fyi.json
@@ -1096,7 +1096,7 @@ { "args": [], "cros_board": "octopus", - "cros_img": "octopus-release/R99-14395.0.0", + "cros_img": "octopus-release/R99-14396.0.0", "name": "lacros_fyi_tast_tests_OCTOPUS_LKGM", "swarming": {}, "tast_expr": "(\"group:mainline\" && \"dep:lacros\" && !informational)", @@ -1140,7 +1140,7 @@ { "args": [], "cros_board": "octopus", - "cros_img": "octopus-release/R99-14395.0.0", + "cros_img": "octopus-release/R99-14396.0.0", "name": "ozone_unittests_OCTOPUS_LKGM", "swarming": {}, "test": "ozone_unittests", @@ -1188,7 +1188,7 @@ { "args": [], "cros_board": "kevin", - "cros_img": "kevin-release/R99-14395.0.0", + "cros_img": "kevin-release/R99-14396.0.0", "name": "lacros_all_tast_tests_KEVIN_LKGM", "swarming": {}, "tast_expr": "(\"group:mainline\" && \"dep:lacros\" && \"dep:lacros_unstable\")", @@ -1199,7 +1199,7 @@ { "args": [], "cros_board": "kevin", - "cros_img": "kevin-release/R99-14395.0.0", + "cros_img": "kevin-release/R99-14396.0.0", "name": "ozone_unittests_KEVIN_LKGM", "swarming": {}, "test": "ozone_unittests", @@ -1209,7 +1209,7 @@ { "args": [], "cros_board": "kevin", - "cros_img": "kevin-release/R99-14395.0.0", + "cros_img": "kevin-release/R99-14396.0.0", "name": "viz_unittests_KEVIN_LKGM", "swarming": {}, "test": "viz_unittests",
diff --git a/testing/buildbot/test_suite_exceptions.pyl b/testing/buildbot/test_suite_exceptions.pyl index 470b76e..98b75c0 100644 --- a/testing/buildbot/test_suite_exceptions.pyl +++ b/testing/buildbot/test_suite_exceptions.pyl
@@ -32,7 +32,7 @@ }, 'android-marshmallow-arm64-rel': { 'swarming': { - 'quickrun_shards': 2, + 'quickrun_shards': 3, }, }, 'android-marshmallow-arm64-rel-rts': { @@ -43,7 +43,7 @@ 'android-marshmallow-x86-rel': { 'swarming': { 'shards': 2, - 'quickrun_shards': 4, + 'quickrun_shards': 6, }, }, 'android-pie-arm64-rel': { @@ -59,7 +59,7 @@ }, ], 'shards': 2, - 'quickrun_shards': 4, + 'quickrun_shards': 6, }, }, 'android-pie-x86-rel': { @@ -678,6 +678,7 @@ # This is for slow test execution that often becomes a critical path of # swarming jobs. crbug.com/868114 'shards': 15, + 'quickrun_shards': 30, } }, 'Win10 Tests x64 20h2': { @@ -842,6 +843,11 @@ }, 'chrome_all_tast_tests': { 'modifications': { + 'chromeos-amd64-generic-rel': { + 'swarming': { + 'quickrun_shards': 4, + }, + }, 'chromeos-betty-pi-arc-cfi-thin-lto-chrome': { 'args': [ # This bot sets symbol_level=2, which doesn't fit inside a normal VM. @@ -1302,7 +1308,7 @@ }, 'android-pie-arm64-rel': { 'swarming': { - 'quickrun_shards': 30 + 'quickrun_shards': 40 } }, 'android-pie-x86-rel': { @@ -2308,6 +2314,11 @@ '--test-launcher-filter-file=../../testing/buildbot/filters/android.emulator.net_unittests.filter', ], }, + 'chromeos-amd64-generic-rel': { + 'swarming': { + 'quickrun_shards': 6, + }, + }, 'fuchsia-code-coverage': { 'swarming': { 'shards': 14, @@ -2505,6 +2516,11 @@ '--extra-browser-args=--disable-wcg-for-test', ], }, + 'Win10 x64 Release (NVIDIA)': { + 'swarming': { + 'quickrun_shards': 2, + }, + }, }, 'replacements': { # The V8 builders pass the V8 revision for ${got_revision}, so instead
diff --git a/testing/buildbot/variants.pyl b/testing/buildbot/variants.pyl index 59b5a55..f9daaf6 100644 --- a/testing/buildbot/variants.pyl +++ b/testing/buildbot/variants.pyl
@@ -563,8 +563,8 @@ 'CROS_ATLAS_LKGM': { 'skylab': { 'cros_board': 'atlas', - 'cros_chrome_version': '99.0.4759.0', - 'cros_img': 'atlas-release/R99-14395.0.0', + 'cros_chrome_version': '99.0.4761.0', + 'cros_img': 'atlas-release/R99-14396.0.0', }, 'enabled': True, 'identifier': 'ATLAS_LKGM', @@ -599,8 +599,8 @@ 'CROS_EVE_LKGM': { 'skylab': { 'cros_board': 'eve', - 'cros_chrome_version': '99.0.4759.0', - 'cros_img': 'eve-release/R99-14395.0.0', + 'cros_chrome_version': '99.0.4761.0', + 'cros_img': 'eve-release/R99-14396.0.0', }, 'enabled': True, 'identifier': 'EVE_LKGM', @@ -635,8 +635,8 @@ 'CROS_KEVIN_LKGM': { 'skylab': { 'cros_board': 'kevin', - 'cros_chrome_version': '99.0.4759.0', - 'cros_img': 'kevin-release/R99-14395.0.0', + 'cros_chrome_version': '99.0.4761.0', + 'cros_img': 'kevin-release/R99-14396.0.0', }, 'enabled': True, 'identifier': 'KEVIN_LKGM', @@ -644,8 +644,8 @@ 'CROS_OCTOPUS_LKGM': { 'skylab': { 'cros_board': 'octopus', - 'cros_chrome_version': '99.0.4759.0', - 'cros_img': 'octopus-release/R99-14395.0.0', + 'cros_chrome_version': '99.0.4761.0', + 'cros_img': 'octopus-release/R99-14396.0.0', }, 'enabled': True, 'identifier': 'OCTOPUS_LKGM',
diff --git a/testing/scripts/wpt_android_lib.py b/testing/scripts/wpt_android_lib.py index c1fbd8b..af802c3 100644 --- a/testing/scripts/wpt_android_lib.py +++ b/testing/scripts/wpt_android_lib.py
@@ -79,6 +79,14 @@ self.output_directory = os.path.join(SRC_DIR, 'out', self.options.target) self.mojo_js_directory = os.path.join(self.output_directory, 'gen') + def _wpt_report(self): + env = os.environ.copy() + if 'GTEST_SHARD_INDEX' in env: + shard_index = int(env['GTEST_SHARD_INDEX']) + return 'wpt_reports_%s_%d.json' % (self.options.product, shard_index) + else: + return 'wpt_reports_%s.json' % self.options.product + @property def rest_args(self): rest_args = super(WPTAndroidAdapter, self).rest_args @@ -141,7 +149,7 @@ if self.options.log_wptreport: wpt_output = self.options.isolated_script_test_output self.wptreport = os.path.join(os.path.dirname(wpt_output), - 'reports.json') + self._wpt_report()) rest_args.extend(['--log-wptreport', self.wptreport])
diff --git a/testing/scripts/wpt_common.py b/testing/scripts/wpt_common.py index a6e66b4..6576376 100644 --- a/testing/scripts/wpt_common.py +++ b/testing/scripts/wpt_common.py
@@ -109,10 +109,39 @@ os.path.join(layout_test_results, 'results.html')) if self.wptreport: - self.fs.copyfile( - self.wptreport, - os.path.join(layout_test_results, - os.path.basename(self.wptreport))) + self._process_wpt_report(self.wptreport) + + def get_wpt_revision(self): + checkout_script = os.path.join( + common.SRC_DIR, "third_party", "wpt_tools", "checkout.sh") + with open(checkout_script) as f: + for line in f.readlines(): + if line.startswith("WPT_HEAD"): + rev = line.rstrip()[len("WPT_HEAD")+1:] + return rev + return None + + def _process_wpt_report(self, wptreport): + layout_test_results = os.path.join(os.path.dirname(self.wpt_output), + self.layout_test_results_subdir) + dst = os.path.join(layout_test_results, + os.path.basename(wptreport)) + with open(wptreport) as f_src, open(dst, "w") as f_dst: + data = json.load(f_src) + # update revision to use upstream revision + rev = self.get_wpt_revision() + if rev: + data["run_info"]["revision"] = rev + # dump the result to layout-test-results + json.dump(data, f_dst) + + # upload the report to ResultDB + artifact = { + os.path.basename(wptreport): { + 'filePath': dst + } + } + self.sink.report_invocation_level_artifacts(artifact) def process_wptrunner_output(self, full_results_json,
diff --git a/testing/variations/fieldtrial_testing_config.json b/testing/variations/fieldtrial_testing_config.json index 6d1a6657..3ac8570b 100644 --- a/testing/variations/fieldtrial_testing_config.json +++ b/testing/variations/fieldtrial_testing_config.json
@@ -1472,6 +1472,26 @@ ] } ], + "AvoidUnnecessaryBeforeUnloadCheck": [ + { + "platforms": [ + "android", + "chromeos", + "chromeos_lacros", + "linux", + "mac", + "windows" + ], + "experiments": [ + { + "name": "Enabled", + "enable_features": [ + "AvoidUnnecessaryBeforeUnloadCheck" + ] + } + ] + } + ], "BackForwardCache": [ { "platforms": [
diff --git a/third_party/blink/public/BUILD.gn b/third_party/blink/public/BUILD.gn index 2d426d8..2b3f9f6 100644 --- a/third_party/blink/public/BUILD.gn +++ b/third_party/blink/public/BUILD.gn
@@ -424,6 +424,7 @@ if (is_win) { sources += [ "platform/web_font_prewarmer.h", + "web/win/web_font_family_names.h", "web/win/web_font_rendering.h", ] }
diff --git a/third_party/blink/public/mojom/web_feature/web_feature.mojom b/third_party/blink/public/mojom/web_feature/web_feature.mojom index f0e42e3..20db929c 100644 --- a/third_party/blink/public/mojom/web_feature/web_feature.mojom +++ b/third_party/blink/public/mojom/web_feature/web_feature.mojom
@@ -3403,6 +3403,7 @@ kAllowPaymentRequestAttributeHasEffect = 4094, kV8PaymentResponse_Retry_Method = 4095, kWebAppManifestUserPreferences = 4096, + kV8HTMLInputElement_ShowPicker_Method = 4097, // Add new features immediately above this line. Don't change assigned
diff --git a/third_party/blink/public/web/web_local_frame.h b/third_party/blink/public/web/web_local_frame.h index 9d92ae9..a0e3492 100644 --- a/third_party/blink/public/web/web_local_frame.h +++ b/third_party/blink/public/web/web_local_frame.h
@@ -14,6 +14,7 @@ #include "base/memory/weak_ptr.h" #include "base/types/pass_key.h" #include "base/unguessable_token.h" +#include "build/build_config.h" #include "components/viz/common/surfaces/frame_sink_id.h" #include "services/network/public/mojom/web_sandbox_flags.mojom-shared.h" #include "third_party/abseil-cpp/absl/types/optional.h" @@ -97,6 +98,10 @@ struct WebPrintPresetOptions; struct WebScriptSource; +#if defined(OS_WIN) +struct WebFontFamilyNames; +#endif + namespace mojom { enum class TreeScopeType; } @@ -821,6 +826,13 @@ // See |blink::Frame::LastActivationWasRestricted()|. virtual bool LastActivationWasRestricted() const = 0; + // Fonts -------------------------------------------------------------------- + +#if defined(OS_WIN) + // Returns the font family names currently used. + virtual WebFontFamilyNames GetWebFontFamilyNames() const = 0; +#endif + // Testing ------------------------------------------------------------------ // Get the total spool size (the bounding box of all the pages placed after
diff --git a/third_party/blink/public/web/win/web_font_family_names.h b/third_party/blink/public/web/win/web_font_family_names.h new file mode 100644 index 0000000..f99b895 --- /dev/null +++ b/third_party/blink/public/web/win/web_font_family_names.h
@@ -0,0 +1,22 @@ +// Copyright 2021 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 THIRD_PARTY_BLINK_PUBLIC_WEB_WIN_WEB_FONT_FAMILY_NAMES_H_ +#define THIRD_PARTY_BLINK_PUBLIC_WEB_WIN_WEB_FONT_FAMILY_NAMES_H_ + +#include "third_party/blink/public/platform/web_common.h" +#include "third_party/blink/public/platform/web_string.h" +#include "third_party/blink/public/platform/web_vector.h" + +namespace blink { + +// Used to record the font family names needed to render a frame. +struct BLINK_EXPORT WebFontFamilyNames { + WebVector<WebString> primary_family_names; + WebVector<WebString> fallback_family_names; +}; + +} // namespace blink + +#endif // THIRD_PARTY_BLINK_PUBLIC_WEB_WIN_WEB_FONT_FAMILY_NAMES_H_
diff --git a/third_party/blink/public/web/win/web_font_rendering.h b/third_party/blink/public/web/win/web_font_rendering.h index 3e99e47..01d3711d 100644 --- a/third_party/blink/public/web/win/web_font_rendering.h +++ b/third_party/blink/public/web/win/web_font_rendering.h
@@ -21,6 +21,7 @@ // Set an instance of |WebFontPrewarmer|. The instance must be kept alive // until the process exits. BLINK_EXPORT static void SetFontPrewarmer(WebFontPrewarmer*); + BLINK_EXPORT static WebFontPrewarmer* GetFontPrewarmer(); BLINK_EXPORT static void AddSideloadedFontForTesting(sk_sp<SkTypeface>); BLINK_EXPORT static void SetMenuFontMetrics(const WebString& family_name, int32_t font_height);
diff --git a/third_party/blink/renderer/core/app_history/app_history.cc b/third_party/blink/renderer/core/app_history/app_history.cc index 411c4de..658865c 100644 --- a/third_party/blink/renderer/core/app_history/app_history.cc +++ b/third_party/blink/renderer/core/app_history/app_history.cc
@@ -373,7 +373,7 @@ AppHistoryResult* AppHistory::navigate(ScriptState* script_state, const String& url, AppHistoryNavigateOptions* options) { - KURL completed_url(GetSupplementable()->Url(), url); + KURL completed_url = GetSupplementable()->CompleteURL(url); if (!completed_url.IsValid()) { return EarlyErrorResult(script_state, DOMExceptionCode::kSyntaxError, "Invalid URL '" + completed_url.GetString() + "'.");
diff --git a/third_party/blink/renderer/core/display_lock/display_lock_utilities.cc b/third_party/blink/renderer/core/display_lock/display_lock_utilities.cc index 5e5058f..f36a0a2 100644 --- a/third_party/blink/renderer/core/display_lock/display_lock_utilities.cc +++ b/third_party/blink/renderer/core/display_lock/display_lock_utilities.cc
@@ -4,6 +4,7 @@ #include "third_party/blink/renderer/core/display_lock/display_lock_utilities.h" +#include "third_party/blink/public/mojom/web_feature/web_feature.mojom-blink.h" #include "third_party/blink/renderer/core/display_lock/display_lock_context.h" #include "third_party/blink/renderer/core/display_lock/display_lock_document_state.h" #include "third_party/blink/renderer/core/dom/element.h" @@ -18,6 +19,7 @@ #include "third_party/blink/renderer/core/inspector/console_message.h" #include "third_party/blink/renderer/core/inspector/inspector_trace_events.h" #include "third_party/blink/renderer/core/layout/layout_embedded_content.h" +#include "third_party/blink/renderer/core/layout/layout_shift_tracker.h" #include "third_party/blink/renderer/core/layout/layout_view.h" #include <set> @@ -822,11 +824,13 @@ } for (HTMLElement* element : elements_to_reveal) { - element->removeAttribute(html_names::kHiddenAttr); + element->DispatchEvent( + *Event::CreateBubble(event_type_names::kBeforematch)); } - // TODO(crbug.com/1055002): Fire the beforematch event here on all - // |elements_to_reveal|. + for (HTMLElement* element : elements_to_reveal) { + element->removeAttribute(html_names::kHiddenAttr); + } return elements_to_reveal.size(); }
diff --git a/third_party/blink/renderer/core/editing/finder/text_finder.cc b/third_party/blink/renderer/core/editing/finder/text_finder.cc index 7f2d7a0..dfcba94 100644 --- a/third_party/blink/renderer/core/editing/finder/text_finder.cc +++ b/third_party/blink/renderer/core/editing/finder/text_finder.cc
@@ -37,6 +37,7 @@ #include "third_party/blink/public/web/web_local_frame_client.h" #include "third_party/blink/public/web/web_view_client.h" #include "third_party/blink/renderer/core/accessibility/ax_object_cache_base.h" +#include "third_party/blink/renderer/core/display_lock/display_lock_document_state.h" #include "third_party/blink/renderer/core/display_lock/display_lock_utilities.h" #include "third_party/blink/renderer/core/dom/focus_params.h" #include "third_party/blink/renderer/core/dom/range.h" @@ -70,21 +71,6 @@ namespace blink { -namespace { - -// Returns the element which the beforematch event should be fired on given a -// matching range. -Element* GetBeforematchElement(const Range& range) { - // Find-in-page matches can't span multiple block-level elements (because - // the text will be broken by newlines between blocks), so first we find the - // block-level element which contains the match. - // This means we only need to traverse up from one node in the range, in - // this case we are traversing from the start position of the range. - return EnclosingBlock(range.StartPosition(), kCannotCrossEditingBoundary); -} - -} // namespace - TextFinder::FindMatch::FindMatch(Range* range, int ordinal) : range_(range), ordinal_(ordinal) {} @@ -95,8 +81,10 @@ static void AutoExpandSearchableHiddenElementsUpFrameTree(Range* range) { const Node& first_node = *range->FirstNode(); bool needs_style_and_layout = false; + bool needs_layout_shift_allowance = false; - // TODO(vmpstr): Rework this, since it is only used for bookkeeping. + // TODO(crbug.com/1280097): Rework this, since it is only used for + // bookkeeping. DisplayLockUtilities::ActivateFindInPageMatchRangeIfNeeded( EphemeralRangeInFlatTree(range)); @@ -110,16 +98,31 @@ if (RuntimeEnabledFeatures::AutoExpandDetailsElementEnabled() && HTMLDetailsElement::ExpandDetailsAncestors(first_node)) { needs_style_and_layout = true; + needs_layout_shift_allowance = true; UseCounter::Count(first_node.GetDocument(), WebFeature::kAutoExpandedDetailsForFindInPage); } // If the active match is hidden inside a hidden=until-found element, then we // should reveal it so find-in-page can scroll to it. - needs_style_and_layout |= - RuntimeEnabledFeatures::BeforeMatchEventEnabled( + if (RuntimeEnabledFeatures::BeforeMatchEventEnabled( first_node.GetExecutionContext()) && - DisplayLockUtilities::RevealHiddenUntilFoundAncestors(first_node); + DisplayLockUtilities::RevealHiddenUntilFoundAncestors(first_node)) { + needs_style_and_layout = true; + needs_layout_shift_allowance = true; + UseCounter::Count(first_node.GetDocument(), + WebFeature::kBeforematchRevealedHiddenMatchable); + first_node.GetDocument() + .MarkHasFindInPageBeforematchExpandedHiddenMatchable(); + } + + if (needs_layout_shift_allowance) { + first_node.GetDocument() + .GetFrame() + ->View() + ->GetLayoutShiftTracker() + .NotifyFindInPageInput(); + } // Also reveal expandables up the frame tree. for (Frame *frame = first_node.GetDocument().GetFrame(), @@ -166,8 +169,6 @@ const EphemeralRangeInFlatTree range(match); const Node& first_node = *match->FirstNode(); - AutoExpandSearchableHiddenElementsUpFrameTree(match); - // We don't always have a LayoutObject for the node we're trying to scroll to // after the async step: crbug.com/1129341 if (!first_node.GetLayoutObject()) @@ -217,6 +218,16 @@ bool* active_now, Range* first_match, bool wrapped_around) { + // Searching text without forcing DisplayLocks is likely to hit bad layout + // state, so force them here and update style and layout in order to get good + // layout state. + auto forced_activatable_locks = GetFrame() + ->GetDocument() + ->GetDisplayLockDocumentState() + .GetScopedForceActivatableLocks(); + GetFrame()->GetDocument()->UpdateStyleAndLayout( + DocumentUpdateReason::kFindInPage); + if (options.new_session) { // This find-in-page is redone due to the frame finishing loading. // If we can, just reuse the old active match; @@ -301,16 +312,10 @@ scroll_context->range = active_match_.Get(); scroll_context->first_match = first_match ? first_match : active_match_.Get(); scroll_context->wrapped_around = wrapped_around; - Element* beforematch_element = GetBeforematchElement(*active_match_); - scroll_context->was_match_hidden = - beforematch_element && - DisplayLockUtilities::NearestHiddenMatchableInclusiveAncestor( - *beforematch_element); if (options.run_synchronously_for_testing) { - FireBeforematchEvent(std::move(scroll_context)); + Scroll(std::move(scroll_context)); } else { - scroll_task_.Reset(WTF::Bind(&TextFinder::FireBeforematchEvent, - WrapWeakPersistent(this), + scroll_task_.Reset(WTF::Bind(&TextFinder::Scroll, WrapWeakPersistent(this), std::move(scroll_context))); GetFrame()->GetDocument()->EnqueueAnimationFrameTask( scroll_task_.callback()); @@ -902,100 +907,27 @@ visitor->Trace(find_matches_cache_); } -void TextFinder::FireBeforematchEvent( - std::unique_ptr<AsyncScrollContext> context) { - // During the async step, the match may have been removed from the dom. - if (context->range->collapsed()) { - // Up-to-date, clean tree is required for finding text in page, since it - // relies on TextIterator to look over the text. - GetFrame()->GetDocument()->UpdateStyleAndLayout( - DocumentUpdateReason::kFindInPage); +void TextFinder::Scroll(std::unique_ptr<AsyncScrollContext> context) { + AutoExpandSearchableHiddenElementsUpFrameTree(context->range); + // During the async step or AutoExpandSearchableHiddenElementsUpFrameTree, the + // match may have been removed from the dom, gotten DisplayLocked, etc. + if (context->range->collapsed() || !context->range->IsConnected() || + DisplayLockUtilities::LockedAncestorPreventingPaint( + *context->range->FirstNode())) { // If the range we were going to scroll to was removed, then we should // continue to search for the next match. // We don't need to worry about the case where another Find has already been // initiated, because if it was, then the task to run this would have been // canceled. active_match_ = context->range; + FindInternal(context->identifier, context->search_text, context->options, context->wrap_within_frame, /*active_now=*/nullptr, context->first_match, context->wrapped_around); return; } - if (RuntimeEnabledFeatures::BeforeMatchEventEnabled( - GetFrame()->GetDocument()->GetExecutionContext())) { - Element* beforematch_element = GetBeforematchElement(*context->range); - // Note that we don't check the `range.EndPosition()` since we just activate - // the beginning of the range. In find-in-page cases, the end position is - // the same since the matches cannot cross block boundaries. However, in - // scroll-to-text, the range might be different, but we still just activate - // the beginning of the range. See - // https://github.com/WICG/display-locking/issues/125 for more details. - if (beforematch_element) { - // If the beforematch event handler causes layout shift, then we should - // give it layout shift allowance because it is responding to the user - // initiated find-in-page. - OwnerFrame() - .GetFrameView() - ->GetLayoutShiftTracker() - .NotifyFindInPageInput(); - beforematch_element->DispatchEvent( - *Event::CreateBubble(event_type_names::kBeforematch)); - } - // TODO(jarhar): Consider what to do based on DOM/style modifications made - // by the beforematch event here and write tests for it once we decide on a - // behavior here: https://github.com/WICG/display-locking/issues/150 - } - - if (context->options.run_synchronously_for_testing) { - // We need to update style and layout to account for script modifying - // dom/style before scrolling when we are running synchronously. - GetFrame()->GetDocument()->UpdateStyleAndLayout( - DocumentUpdateReason::kFindInPage); - Scroll(std::move(context)); - } else { - scroll_task_.Reset(WTF::Bind(&TextFinder::Scroll, WrapWeakPersistent(this), - std::move(context))); - GetFrame()->GetDocument()->EnqueueAnimationFrameTask( - scroll_task_.callback()); - } -} - -void TextFinder::Scroll(std::unique_ptr<AsyncScrollContext> context) { - // The beforematch event, as well as any other script that may have run during - // the async step, may have removed the matching text from the dom, in which - // case we shouldn't scroll to it. - // Likewise, if the target scroll element is display locked, then we shouldn't - // scroll to it. - Element* beforematch_element = GetBeforematchElement(*context->range); - if (context->range->collapsed() || !context->range->IsConnected() || - (beforematch_element && - DisplayLockUtilities::NearestHiddenMatchableInclusiveAncestor( - *beforematch_element))) { - // If the range we were going to scroll to was removed or display locked, - // then we should continue to search for the next match. - // We don't need to worry about the case where another Find has already been - // initiated, because if it was, then the task to run this would have been - // canceled. - // We also need to re-assign to active_match_ here in order to make sure the - // search starts from context->range. active_match_ may have been unassigned - // during the async steps. - active_match_ = context->range->IsConnected() ? context->range : nullptr; - FindInternal(context->identifier, context->search_text, context->options, - context->wrap_within_frame, /*active_now=*/nullptr, - context->first_match, context->wrapped_around); - return; - } - - if (context->was_match_hidden) { - UseCounter::Count(GetFrame()->GetDocument(), - WebFeature::kBeforematchRevealedHiddenMatchable); - GetFrame() - ->GetDocument() - ->MarkHasFindInPageBeforematchExpandedHiddenMatchable(); - } - ScrollToVisible(context->range); // If the user is browsing a page with autosizing, adjust the zoom to the
diff --git a/third_party/blink/renderer/core/editing/finder/text_finder.h b/third_party/blink/renderer/core/editing/finder/text_finder.h index fc078f3..ed06c04 100644 --- a/third_party/blink/renderer/core/editing/finder/text_finder.h +++ b/third_party/blink/renderer/core/editing/finder/text_finder.h
@@ -155,10 +155,6 @@ // Range to fire beforematch on and scroll to. active_match_ may get // unassigned during the async steps, so we need to save it here. Persistent<Range> range; - - // If the match had the content-visibility: hidden-matchable property in the - // ancestor chain at the time of finding the matching text. - bool was_match_hidden; }; // Same as Find but with extra internal parameters used to track incremental @@ -224,7 +220,6 @@ return *owner_frame_; } - void FireBeforematchEvent(std::unique_ptr<AsyncScrollContext> context); void Scroll(std::unique_ptr<AsyncScrollContext> context); Member<WebLocalFrameImpl> owner_frame_;
diff --git a/third_party/blink/renderer/core/editing/finder/text_finder_test.cc b/third_party/blink/renderer/core/editing/finder/text_finder_test.cc index 7ee51a62..7e390a372 100644 --- a/third_party/blink/renderer/core/editing/finder/text_finder_test.cc +++ b/third_party/blink/renderer/core/editing/finder/text_finder_test.cc
@@ -10,7 +10,6 @@ #include "third_party/blink/public/platform/platform.h" #include "third_party/blink/public/web/web_document.h" #include "third_party/blink/renderer/bindings/core/v8/v8_binding_for_testing.h" -#include "third_party/blink/renderer/core/display_lock/display_lock_document_state.h" #include "third_party/blink/renderer/core/dom/comment.h" #include "third_party/blink/renderer/core/dom/document.h" #include "third_party/blink/renderer/core/dom/node_list.h" @@ -641,6 +640,7 @@ const foo = document.createElement('div'); foo.textContent = 'foo'; + foo.setAttribute('hidden', 'until-found'); document.body.appendChild(foo); window.beforematchFiredOnFoo = false; foo.addEventListener('beforematch', () => { @@ -649,6 +649,7 @@ const bar = document.createElement('div'); bar.textContent = 'bar'; + bar.setAttribute('hidden', 'until-found'); document.body.appendChild(bar); window.beforematchFiredOnBar = false; bar.addEventListener('beforematch', () => { @@ -694,6 +695,7 @@ document.body.appendChild(spacer); const foo = document.createElement('div'); + foo.setAttribute('hidden', 'until-found'); foo.textContent = 'foo'; document.body.appendChild(foo); window.beforematchFiredOnFoo = false; @@ -728,34 +730,15 @@ LoadURL("https://example.com/test.html"); request.Complete(R"HTML( <!DOCTYPE html> - <style> - .hidden { - content-visibility: hidden-matchable; - } - </style> - - <div id=hiddenid class=hidden>hidden</div> - - <script> - hiddenid.addEventListener('beforematch', () => { - requestAnimationFrame(() => { - hiddenid.classList.remove('hidden'); - }, 0); - }); - </script> + <div id=hiddenid hidden=until-found>hidden</div> )HTML"); Compositor().BeginFrame(); - auto forced_activatable_locks = GetDocument() - .GetDisplayLockDocumentState() - .GetScopedForceActivatableLocks(); - GetDocument().UpdateStyleAndLayout(DocumentUpdateReason::kFindInPage); GetTextFinder().Find(/*identifier=*/0, WebString(String("hidden")), *mojom::blink::FindOptions::New(), /*wrap_within_frame=*/false); Compositor().BeginFrame(); - Compositor().BeginFrame(); HeapVector<Member<DocumentMarker>> markers = GetDocument().Markers().Markers(); @@ -769,21 +752,7 @@ LoadURL("https://example.com/test.html"); request.Complete(R"HTML( <!DOCTYPE html> - <style> - .hidden { - content-visibility: hidden-matchable; - } - </style> - - <div id=hiddenid class=hidden>hidden</div> - - <script> - hiddenid.addEventListener('beforematch', () => { - requestAnimationFrame(() => { - hiddenid.classList.remove('hidden'); - }, 0); - }); - </script> + <div id=hiddenid hidden=until-found>hidden</div> )HTML"); Compositor().BeginFrame(); @@ -792,57 +761,23 @@ static_cast<ukm::TestUkmRecorder*>(GetDocument().UkmRecorder()); EXPECT_EQ(recorder->entries_count(), 0u); - auto forced_activatable_locks = GetDocument() - .GetDisplayLockDocumentState() - .GetScopedForceActivatableLocks(); - GetDocument().UpdateStyleAndLayout(DocumentUpdateReason::kFindInPage); GetTextFinder().Find(/*identifier=*/0, WebString(String("hidden")), *mojom::blink::FindOptions::New(), /*wrap_within_frame=*/false); Compositor().BeginFrame(); - Compositor().BeginFrame(); auto entries = recorder->GetEntriesByName("Blink.FindInPage"); - ASSERT_EQ(entries.size(), 1u); + // There are two entries because + // DisplayLockUtilities::ActivateFindInPageMatchRangeIfNeeded followed by + // DisplayLockContext::CommitForActivationWithSignal sets a + // "HasFindInPageContentVisibilityActiveMatch" UKM. + ASSERT_EQ(entries.size(), 2u); - EXPECT_TRUE(ukm::TestUkmRecorder::EntryHasMetric( + EXPECT_FALSE(ukm::TestUkmRecorder::EntryHasMetric( entries[0], "BeforematchExpandedHiddenMatchable")); -} - -TEST_F(TextFinderSimTest, BeforeMatchExpandedHiddenMatchableUkmNoHandler) { - SimRequest request("https://example.com/test.html", "text/html"); - LoadURL("https://example.com/test.html"); - request.Complete(R"HTML( - <!DOCTYPE html> - <style> - .hidden { - content-visibility: hidden-matchable; - } - </style> - - <div id=hiddenid class=hidden>hidden</div> - )HTML"); - Compositor().BeginFrame(); - - GetDocument().ukm_recorder_ = std::make_unique<ukm::TestUkmRecorder>(); - auto* recorder = - static_cast<ukm::TestUkmRecorder*>(GetDocument().UkmRecorder()); - EXPECT_EQ(recorder->entries_count(), 0u); - - auto forced_activatable_locks = GetDocument() - .GetDisplayLockDocumentState() - .GetScopedForceActivatableLocks(); - GetDocument().UpdateStyleAndLayout(DocumentUpdateReason::kFindInPage); - GetTextFinder().Find(/*identifier=*/0, WebString(String("hidden")), - *mojom::blink::FindOptions::New(), - /*wrap_within_frame=*/false); - - Compositor().BeginFrame(); - Compositor().BeginFrame(); - - auto entries = recorder->GetEntriesByName("Blink.FindInPage"); - EXPECT_EQ(entries.size(), 0u); + EXPECT_TRUE(ukm::TestUkmRecorder::EntryHasMetric( + entries[1], "BeforematchExpandedHiddenMatchable")); } TEST_F(TextFinderSimTest, BeforeMatchExpandedHiddenMatchableUseCounter) { @@ -850,34 +785,15 @@ LoadURL("https://example.com/test.html"); request.Complete(R"HTML( <!DOCTYPE html> - <style> - .hidden { - content-visibility: hidden-matchable; - } - </style> - - <div id=hiddenid class=hidden>hidden</div> - - <script> - hiddenid.addEventListener('beforematch', () => { - requestAnimationFrame(() => { - hiddenid.classList.remove('hidden'); - }, 0); - }); - </script> + <div id=hiddenid hidden=until-found>hidden</div> )HTML"); Compositor().BeginFrame(); - auto forced_activatable_locks = GetDocument() - .GetDisplayLockDocumentState() - .GetScopedForceActivatableLocks(); - GetDocument().UpdateStyleAndLayout(DocumentUpdateReason::kFindInPage); GetTextFinder().Find(/*identifier=*/0, WebString(String("hidden")), *mojom::blink::FindOptions::New(), /*wrap_within_frame=*/false); Compositor().BeginFrame(); - Compositor().BeginFrame(); EXPECT_TRUE(GetDocument().IsUseCounted( WebFeature::kBeforematchRevealedHiddenMatchable)); @@ -889,26 +805,15 @@ LoadURL("https://example.com/test.html"); request.Complete(R"HTML( <!DOCTYPE html> - <style> - .hidden { - content-visibility: hidden-matchable; - } - </style> - - <div id=hiddenid class=hidden>hidden</div> + <div id=hiddenid>hidden</div> )HTML"); Compositor().BeginFrame(); - auto forced_activatable_locks = GetDocument() - .GetDisplayLockDocumentState() - .GetScopedForceActivatableLocks(); - GetDocument().UpdateStyleAndLayout(DocumentUpdateReason::kFindInPage); GetTextFinder().Find(/*identifier=*/0, WebString(String("hidden")), *mojom::blink::FindOptions::New(), /*wrap_within_frame=*/false); Compositor().BeginFrame(); - Compositor().BeginFrame(); EXPECT_FALSE(GetDocument().IsUseCounted( WebFeature::kBeforematchRevealedHiddenMatchable));
diff --git a/third_party/blink/renderer/core/frame/find_in_page.cc b/third_party/blink/renderer/core/frame/find_in_page.cc index 11c1a62..22c97f56 100644 --- a/third_party/blink/renderer/core/frame/find_in_page.cc +++ b/third_party/blink/renderer/core/frame/find_in_page.cc
@@ -174,16 +174,6 @@ // Unlikely, but just in case we try to find-in-page on a detached frame. DCHECK(frame_->GetFrame()->GetPage()); - auto forced_activatable_locks = frame_->GetFrame() - ->GetDocument() - ->GetDisplayLockDocumentState() - .GetScopedForceActivatableLocks(); - - // Up-to-date, clean tree is required for finding text in page, since it - // relies on TextIterator to look over the text. - frame_->GetFrame()->GetDocument()->UpdateStyleAndLayout( - DocumentUpdateReason::kFindInPage); - return EnsureTextFinder().Find(identifier, search_text, options, wrap_within_frame, active_now); }
diff --git a/third_party/blink/renderer/core/frame/local_frame_view.cc b/third_party/blink/renderer/core/frame/local_frame_view.cc index 0fe738f..43ca630 100644 --- a/third_party/blink/renderer/core/frame/local_frame_view.cc +++ b/third_party/blink/renderer/core/frame/local_frame_view.cc
@@ -130,7 +130,6 @@ #include "third_party/blink/renderer/core/page/validation_message_client.h" #include "third_party/blink/renderer/core/paint/block_paint_invalidator.h" #include "third_party/blink/renderer/core/paint/compositing/composited_layer_mapping.h" -#include "third_party/blink/renderer/core/paint/compositing/compositing_inputs_updater.h" #include "third_party/blink/renderer/core/paint/compositing/paint_layer_compositor.h" #include "third_party/blink/renderer/core/paint/cull_rect_updater.h" #include "third_party/blink/renderer/core/paint/frame_painter.h"
diff --git a/third_party/blink/renderer/core/frame/web_local_frame_impl.cc b/third_party/blink/renderer/core/frame/web_local_frame_impl.cc index 287ebf4..643e74f0 100644 --- a/third_party/blink/renderer/core/frame/web_local_frame_impl.cc +++ b/third_party/blink/renderer/core/frame/web_local_frame_impl.cc
@@ -266,6 +266,11 @@ #include "third_party/blink/renderer/platform/wtf/casting.h" #include "third_party/blink/renderer/platform/wtf/hash_map.h" +#if defined(OS_WIN) +#include "third_party/blink/public/web/win/web_font_family_names.h" +#include "third_party/blink/renderer/core/layout/layout_font_accessor_win.h" +#endif + namespace blink { namespace { @@ -670,6 +675,21 @@ return GetFrame()->LastActivationWasRestricted(); } +#if defined(OS_WIN) +WebFontFamilyNames WebLocalFrameImpl::GetWebFontFamilyNames() const { + FontFamilyNames font_family_names; + GetFontsUsedByFrame(*GetFrame(), font_family_names); + WebFontFamilyNames result; + for (const String& font_family_name : font_family_names.primary_fonts) + result.primary_family_names.push_back(font_family_name); + for (const String& font_family_name : font_family_names.fallback_fonts) { + if (!font_family_names.primary_fonts.Contains(font_family_name)) + result.fallback_family_names.push_back(font_family_name); + } + return result; +} +#endif + WebLocalFrame* WebLocalFrame::FrameForContext(v8::Local<v8::Context> context) { return WebLocalFrameImpl::FromFrame(ToLocalFrameIfNotDetached(context)); }
diff --git a/third_party/blink/renderer/core/frame/web_local_frame_impl.h b/third_party/blink/renderer/core/frame/web_local_frame_impl.h index 9af2d999..acdd80b 100644 --- a/third_party/blink/renderer/core/frame/web_local_frame_impl.h +++ b/third_party/blink/renderer/core/frame/web_local_frame_impl.h
@@ -328,6 +328,9 @@ bool HasTransientUserActivation() override; bool ConsumeTransientUserActivation(UserActivationUpdateSource) override; bool LastActivationWasRestricted() const override; +#if defined(OS_WIN) + WebFontFamilyNames GetWebFontFamilyNames() const override; +#endif void SetTargetToCurrentHistoryItem(const WebString& target) override; void UpdateCurrentHistoryItem() override; PageState CurrentHistoryItemToPageState() override;
diff --git a/third_party/blink/renderer/core/html/forms/html_input_element.cc b/third_party/blink/renderer/core/html/forms/html_input_element.cc index b1655b0..31937b1 100644 --- a/third_party/blink/renderer/core/html/forms/html_input_element.cc +++ b/third_party/blink/renderer/core/html/forms/html_input_element.cc
@@ -2190,8 +2190,8 @@ } } -// Show a browser picker for this input element (crbug.com/939561). -// https://github.com/whatwg/html/issues/6909 +// Show a browser picker for this input element. +// https://html.spec.whatwg.org/multipage/input.html#dom-input-showpicker void HTMLInputElement::showPicker(ExceptionState& exception_state) { LocalFrame* frame = GetDocument().GetFrame(); // In cross-origin iframes it should throw a "SecurityError" DOMException
diff --git a/third_party/blink/renderer/core/html/forms/html_input_element.idl b/third_party/blink/renderer/core/html/forms/html_input_element.idl index 3dda7bd..36b3b91 100644 --- a/third_party/blink/renderer/core/html/forms/html_input_element.idl +++ b/third_party/blink/renderer/core/html/forms/html_input_element.idl
@@ -104,8 +104,8 @@ // https://w3c.github.io/html-media-capture/#the-capture-attribute [Measure, RuntimeEnabled=MediaCapture, Reflect] attribute DOMString capture; - // https://github.com/whatwg/html/issues/6909 - [RaisesException, RuntimeEnabled=HTMLInputElementShowPicker] void showPicker(); + // https://html.spec.whatwg.org/multipage/input.html#dom-input-showpicker + [Measure, RaisesException, RuntimeEnabled=HTMLInputElementShowPicker] void showPicker(); // Non-standard APIs [Reflect, MeasureAs=PrefixedDirectoryAttribute] attribute boolean webkitdirectory;
diff --git a/third_party/blink/renderer/core/layout/build.gni b/third_party/blink/renderer/core/layout/build.gni index 716b9ca..84608af 100644 --- a/third_party/blink/renderer/core/layout/build.gni +++ b/third_party/blink/renderer/core/layout/build.gni
@@ -756,6 +756,8 @@ "layout_theme_win.cc", "layout_theme_win.h", "web_font_rendering_win.cc", + "layout_font_accessor_win.h", + "layout_font_accessor_win.cc", ] } else { # Not Windows. blink_core_sources_layout += [ "layout_theme_font_provider_default.cc" ]
diff --git a/third_party/blink/renderer/core/layout/layout_box.h b/third_party/blink/renderer/core/layout/layout_box.h index e55839c..a9ee443 100644 --- a/third_party/blink/renderer/core/layout/layout_box.h +++ b/third_party/blink/renderer/core/layout/layout_box.h
@@ -2085,6 +2085,11 @@ // call SetBackgroundPaintLocation() with the value to be used for painting. BackgroundPaintLocation ComputeBackgroundPaintLocationIfComposited() const; + bool HasFragmentItems() const { + NOT_DESTROYED(); + return ChildrenInline() && PhysicalFragments().HasFragmentItems(); + } + protected: ~LayoutBox() override; @@ -2196,10 +2201,6 @@ TextDirection ResolvedDirection() const; private: - bool HasFragmentItems() const { - NOT_DESTROYED(); - return ChildrenInline() && PhysicalFragments().HasFragmentItems(); - } inline bool LayoutOverflowIsSet() const { NOT_DESTROYED(); return overflow_ && overflow_->layout_overflow;
diff --git a/third_party/blink/renderer/core/layout/layout_font_accessor_win.cc b/third_party/blink/renderer/core/layout/layout_font_accessor_win.cc new file mode 100644 index 0000000..d371e354 --- /dev/null +++ b/third_party/blink/renderer/core/layout/layout_font_accessor_win.cc
@@ -0,0 +1,87 @@ +// Copyright 2021 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 "third_party/blink/renderer/core/layout/layout_font_accessor_win.h" + +#include "third_party/blink/renderer/core/frame/local_frame.h" +#include "third_party/blink/renderer/core/layout/layout_block_flow.h" +#include "third_party/blink/renderer/core/layout/layout_box.h" +#include "third_party/blink/renderer/core/layout/layout_object.h" +#include "third_party/blink/renderer/core/layout/layout_view.h" +#include "third_party/blink/renderer/core/layout/ng/inline/ng_fragment_item.h" +#include "third_party/blink/renderer/core/layout/ng/inline/ng_inline_cursor.h" +#include "third_party/blink/renderer/core/layout/ng/ng_link.h" +#include "third_party/blink/renderer/core/layout/ng/ng_physical_box_fragment.h" +#include "third_party/blink/renderer/platform/fonts/font_platform_data.h" +#include "third_party/blink/renderer/platform/fonts/shaping/shape_result_view.h" +#include "third_party/blink/renderer/platform/fonts/simple_font_data.h" + +namespace blink { + +namespace { + +void GetFontsUsedByLayoutObject(const LayoutObject& layout_object, + FontFamilyNames& result); + +void GetFontsUsedByFragment(const NGPhysicalBoxFragment& fragment, + FontFamilyNames& result) { + for (NGInlineCursor cursor(fragment); cursor; cursor.MoveToNext()) { + const NGFragmentItem& item = *cursor.Current().Item(); + if (item.IsText()) { + const ShapeResultView* shape_result_view = item.TextShapeResult(); + if (shape_result_view) { + const String font_family = + shape_result_view->PrimaryFont()->PlatformData().FontFamilyName(); + if (!font_family.IsEmpty()) + result.primary_fonts.insert(font_family); + HashSet<const SimpleFontData*> fallback_font_data; + shape_result_view->FallbackFonts(&fallback_font_data); + for (const SimpleFontData* font_data : fallback_font_data) { + result.fallback_fonts.insert( + font_data->PlatformData().FontFamilyName()); + } + } + continue; + } + + // If this is a nested BFC (e.g., inline block, floats), compute its area. + if (item.Type() == NGFragmentItem::kBox) { + if (const auto* layout_box = DynamicTo<LayoutBox>(item.GetLayoutObject())) + GetFontsUsedByLayoutObject(*layout_box, result); + } + } + + // Traverse out-of-flow children. They are not in |NGFragmentItems|. + for (const NGLink& child : fragment.Children()) { + if (const auto* child_layout_box = + DynamicTo<LayoutBox>(child->GetLayoutObject())) + GetFontsUsedByLayoutObject(*child_layout_box, result); + } +} + +void GetFontsUsedByLayoutObject(const LayoutObject& layout_object, + FontFamilyNames& result) { + const LayoutObject* target = &layout_object; + while (target) { + // Use |NGInlineCursor| to traverse if |target| is an IFC. + if (const auto* block_flow = DynamicTo<LayoutBlockFlow>(target)) { + if (block_flow->HasFragmentItems()) { + for (const NGPhysicalBoxFragment& fragment : + block_flow->PhysicalFragments()) + GetFontsUsedByFragment(fragment, result); + target = target->NextInPreOrderAfterChildren(&layout_object); + continue; + } + } + target = target->NextInPreOrder(&layout_object); + } +} + +} // namespace + +void GetFontsUsedByFrame(const LocalFrame& frame, FontFamilyNames& result) { + GetFontsUsedByLayoutObject(frame.ContentLayoutObject()->RootBox(), result); +} + +} // namespace blink
diff --git a/third_party/blink/renderer/core/layout/layout_font_accessor_win.h b/third_party/blink/renderer/core/layout/layout_font_accessor_win.h new file mode 100644 index 0000000..2063b15 --- /dev/null +++ b/third_party/blink/renderer/core/layout/layout_font_accessor_win.h
@@ -0,0 +1,24 @@ +// Copyright 2021 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 THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_LAYOUT_FONT_ACCESSOR_WIN_H_ +#define THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_LAYOUT_FONT_ACCESSOR_WIN_H_ + +#include "third_party/blink/renderer/platform/wtf/hash_set.h" +#include "third_party/blink/renderer/platform/wtf/text/wtf_string.h" + +namespace blink { + +class LocalFrame; + +struct FontFamilyNames { + WTF::HashSet<WTF::String> primary_fonts; + WTF::HashSet<WTF::String> fallback_fonts; +}; + +void GetFontsUsedByFrame(const LocalFrame& frame, FontFamilyNames& result); + +} // namespace blink + +#endif // THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_LAYOUT_FONT_ACCESSOR_WIN_H_
diff --git a/third_party/blink/renderer/core/layout/layout_inline_test.cc b/third_party/blink/renderer/core/layout/layout_inline_test.cc index 40f84c2..1000e0c 100644 --- a/third_party/blink/renderer/core/layout/layout_inline_test.cc +++ b/third_party/blink/renderer/core/layout/layout_inline_test.cc
@@ -82,30 +82,42 @@ TEST_F(LayoutInlineTest, SimpleContinuation) { SetBodyInnerHTML( - "<span id='splitInline'><i id='before'></i><h1 id='blockChild'></h1><i " - "id='after'></i></span>"); + "<span id='splitInline'>" + "<i id='before'></i>" + "<h1 id='blockChild'></h1>" + "<i id='after'></i>" + "</span>"); auto* split_inline_part1 = To<LayoutInline>(GetLayoutObjectByElementId("splitInline")); ASSERT_TRUE(split_inline_part1); ASSERT_TRUE(split_inline_part1->FirstChild()); - EXPECT_EQ(split_inline_part1->FirstChild(), - GetLayoutObjectByElementId("before")); - EXPECT_FALSE(split_inline_part1->FirstChild()->NextSibling()); + auto* before = GetLayoutObjectByElementId("before"); + EXPECT_EQ(split_inline_part1->FirstChild(), before); + auto* block_child = GetLayoutObjectByElementId("blockChild"); + auto* after = GetLayoutObjectByElementId("after"); + if (RuntimeEnabledFeatures::LayoutNGBlockInInlineEnabled()) { + EXPECT_EQ(split_inline_part1->FirstChild(), before); + LayoutObject* anonymous = block_child->Parent(); + EXPECT_TRUE(anonymous->IsBlockInInline()); + EXPECT_EQ(before->NextSibling(), anonymous); + EXPECT_EQ(anonymous->NextSibling(), after); + EXPECT_FALSE(after->NextSibling()); + } else { + EXPECT_FALSE(split_inline_part1->FirstChild()->NextSibling()); + auto* block = To<LayoutBlockFlow>(split_inline_part1->Continuation()); + ASSERT_TRUE(block); + ASSERT_TRUE(block->FirstChild()); + EXPECT_EQ(block->FirstChild(), block_child); + EXPECT_FALSE(block->FirstChild()->NextSibling()); - auto* block = To<LayoutBlockFlow>(split_inline_part1->Continuation()); - ASSERT_TRUE(block); - ASSERT_TRUE(block->FirstChild()); - EXPECT_EQ(block->FirstChild(), GetLayoutObjectByElementId("blockChild")); - EXPECT_FALSE(block->FirstChild()->NextSibling()); - - auto* split_inline_part2 = To<LayoutInline>(block->Continuation()); - ASSERT_TRUE(split_inline_part2); - ASSERT_TRUE(split_inline_part2->FirstChild()); - EXPECT_EQ(split_inline_part2->FirstChild(), - GetLayoutObjectByElementId("after")); - EXPECT_FALSE(split_inline_part2->FirstChild()->NextSibling()); - EXPECT_FALSE(split_inline_part2->Continuation()); + auto* split_inline_part2 = To<LayoutInline>(block->Continuation()); + ASSERT_TRUE(split_inline_part2); + ASSERT_TRUE(split_inline_part2->FirstChild()); + EXPECT_EQ(split_inline_part2->FirstChild(), after); + EXPECT_FALSE(split_inline_part2->FirstChild()->NextSibling()); + EXPECT_FALSE(split_inline_part2->Continuation()); + } } TEST_F(LayoutInlineTest, BlockInInlineRemove) { @@ -380,7 +392,7 @@ font: 20px/20px Ahem; } </style> - <div> + <div style="width: 400px"> <span>xx<br> <span id="target">yy <div style="width:111px;height:222px;background:yellow"></div> @@ -391,9 +403,11 @@ )HTML"); auto* target = To<LayoutInline>(GetLayoutObjectByElementId("target")); - EXPECT_EQ(PhysicalRect(0, 20, 111, 222 + 20 * 2), + const int width = + RuntimeEnabledFeatures::LayoutNGBlockInInlineEnabled() ? 400 : 111; + EXPECT_EQ(PhysicalRect(0, 20, width, 222 + 20 * 2), target->VisualRectInDocument()); - EXPECT_EQ(PhysicalRect(0, 20, 111, 222 + 20 * 2), + EXPECT_EQ(PhysicalRect(0, 20, width, 222 + 20 * 2), target->VisualRectInDocument(kUseGeometryMapper)); } @@ -417,7 +431,9 @@ )HTML"); auto* target = To<LayoutInline>(GetLayoutObjectByElementId("target")); - PhysicalRect expected(400 - 111 - 20 * 3, 0, 111 + 20 * 2, 222); + const int height = + RuntimeEnabledFeatures::LayoutNGBlockInInlineEnabled() ? 400 : 222; + PhysicalRect expected(400 - 111 - 20 * 3, 0, 111 + 20 * 2, height); EXPECT_EQ(expected, target->VisualRectInDocument()); EXPECT_EQ(expected, target->VisualRectInDocument(kUseGeometryMapper)); } @@ -622,6 +638,7 @@ body { margin: 30px 50px; font: 20px/20px Ahem; + width: 400px; } </style> <br><br> @@ -654,7 +671,9 @@ ->AbsoluteBoundingBoxRectHandlingEmptyInline()); // This rect covers the overflowing images and continuations. // 168 = (30 + 4) * 2 + 100. 4 is the descent of the font. - EXPECT_EQ(PhysicalRect(50, 170, 100, 168), + const int width = + RuntimeEnabledFeatures::LayoutNGBlockInInlineEnabled() ? 400 : 100; + EXPECT_EQ(PhysicalRect(50, 170, width, 168), GetLayoutObjectByElementId("target6") ->AbsoluteBoundingBoxRectHandlingEmptyInline()); }
diff --git a/third_party/blink/renderer/core/layout/ng/inline/ng_inline_cursor_test.cc b/third_party/blink/renderer/core/layout/ng/inline/ng_inline_cursor_test.cc index 9cf2e031..3139ebf 100644 --- a/third_party/blink/renderer/core/layout/ng/inline/ng_inline_cursor_test.cc +++ b/third_party/blink/renderer/core/layout/ng/inline/ng_inline_cursor_test.cc
@@ -256,7 +256,12 @@ )HTML"); NGInlineCursor cursor; cursor.MoveToIncludingCulledInline(*GetLayoutObjectByElementId("culled")); - EXPECT_THAT(LayoutObjectToDebugStringList(cursor), ElementsAre("#culled")); + if (RuntimeEnabledFeatures::LayoutNGBlockInInlineEnabled()) { + EXPECT_THAT(LayoutObjectToDebugStringList(cursor), + ElementsAre("LayoutNGBlockFlow (anonymous)", "abc", "xyz")); + } else { + EXPECT_THAT(LayoutObjectToDebugStringList(cursor), ElementsAre("#culled")); + } } TEST_P(NGInlineCursorTest, CulledInlineWithRoot) {
diff --git a/third_party/blink/renderer/core/layout/ng/inline/ng_inline_node_test.cc b/third_party/blink/renderer/core/layout/ng/inline/ng_inline_node_test.cc index 5669ee16..08325d6 100644 --- a/third_party/blink/renderer/core/layout/ng/inline/ng_inline_node_test.cc +++ b/third_party/blink/renderer/core/layout/ng/inline/ng_inline_node_test.cc
@@ -1183,7 +1183,7 @@ // Test inline objects are initialized when |SplitFlow()| moves them. TEST_F(NGInlineNodeTest, ClearFirstInlineFragmentOnSplitFlow) { SetBodyInnerHTML(R"HTML( - <div> + <div id=container> <span id=outer_span> <span id=inner_span>1234</span> </span> @@ -1210,8 +1210,14 @@ // no longer has an inline formatting context, the NGPaintFragment subtree is // destroyed, and should not be accessible. GetDocument().UpdateStyleAndLayoutTree(); - EXPECT_FALSE(text->GetLayoutObject()->IsInLayoutNGInlineFormattingContext()); - EXPECT_FALSE(text->GetLayoutObject()->HasInlineFragments()); + const LayoutObject* layout_text = text->GetLayoutObject(); + if (RuntimeEnabledFeatures::LayoutNGBlockInInlineEnabled()) { + EXPECT_TRUE(layout_text->IsInLayoutNGInlineFormattingContext()); + EXPECT_TRUE(layout_text->HasInlineFragments()); + } else { + EXPECT_FALSE(layout_text->IsInLayoutNGInlineFormattingContext()); + EXPECT_FALSE(layout_text->HasInlineFragments()); + } // Update layout. There should be a different instance of the text fragment. UpdateAllLifecyclePhasesForTest(); @@ -1220,14 +1226,19 @@ EXPECT_TRUE(after_layout); // Check it is the one owned by the new root inline formatting context. - LayoutBlock* anonymous_block = - inner_span->GetLayoutObject()->ContainingBlock(); - EXPECT_TRUE(anonymous_block->IsAnonymous()); - NGInlineCursor anonymous_block_cursor(*To<LayoutBlockFlow>(anonymous_block)); - anonymous_block_cursor.MoveToFirstLine(); - anonymous_block_cursor.MoveToFirstChild(); - EXPECT_TRUE(anonymous_block_cursor); - EXPECT_EQ(anonymous_block_cursor.Current().GetLayoutObject(), + LayoutBlock* inner_span_cb = inner_span->GetLayoutObject()->ContainingBlock(); + LayoutObject* container = GetLayoutObjectByElementId("container"); + if (RuntimeEnabledFeatures::LayoutNGBlockInInlineEnabled()) { + EXPECT_EQ(inner_span_cb, container); + } else { + EXPECT_TRUE(inner_span_cb->IsAnonymous()); + EXPECT_EQ(inner_span_cb->Parent(), container); + } + NGInlineCursor inner_span_cb_cursor(*To<LayoutBlockFlow>(inner_span_cb)); + inner_span_cb_cursor.MoveToFirstLine(); + inner_span_cb_cursor.MoveToFirstChild(); + EXPECT_TRUE(inner_span_cb_cursor); + EXPECT_EQ(inner_span_cb_cursor.Current().GetLayoutObject(), text->GetLayoutObject()); }
diff --git a/third_party/blink/renderer/core/layout/web_font_rendering_win.cc b/third_party/blink/renderer/core/layout/web_font_rendering_win.cc index fad6a57..cd743f0 100644 --- a/third_party/blink/renderer/core/layout/web_font_rendering_win.cc +++ b/third_party/blink/renderer/core/layout/web_font_rendering_win.cc
@@ -19,6 +19,11 @@ } // static +WebFontPrewarmer* WebFontRendering::GetFontPrewarmer() { + return FontCache::GetFontPrewarmer(); +} + +// static void WebFontRendering::AddSideloadedFontForTesting(sk_sp<SkTypeface> typeface) { FontCache::AddSideloadedFontForTesting(std::move(typeface)); }
diff --git a/third_party/blink/renderer/core/paint/build.gni b/third_party/blink/renderer/core/paint/build.gni index a4869e7..85026b6 100644 --- a/third_party/blink/renderer/core/paint/build.gni +++ b/third_party/blink/renderer/core/paint/build.gni
@@ -38,16 +38,12 @@ "compositing/composited_layer_mapping.h", "compositing/compositing_inputs_root.cc", "compositing/compositing_inputs_root.h", - "compositing/compositing_inputs_updater.cc", - "compositing/compositing_inputs_updater.h", "compositing/compositing_layer_assigner.cc", "compositing/compositing_layer_assigner.h", "compositing/compositing_layer_property_updater.cc", "compositing/compositing_layer_property_updater.h", "compositing/compositing_reason_finder.cc", "compositing/compositing_reason_finder.h", - "compositing/compositing_requirements_updater.cc", - "compositing/compositing_requirements_updater.h", "compositing/compositing_state.h", "compositing/compositing_update_type.h", "compositing/graphics_layer_tree_builder.cc",
diff --git a/third_party/blink/renderer/core/paint/compositing/composited_layer_mapping.cc b/third_party/blink/renderer/core/paint/compositing/composited_layer_mapping.cc index c8fc2eee..982fb66 100644 --- a/third_party/blink/renderer/core/paint/compositing/composited_layer_mapping.cc +++ b/third_party/blink/renderer/core/paint/compositing/composited_layer_mapping.cc
@@ -407,10 +407,6 @@ GetLayoutObject().SetShouldCheckForPaintInvalidation(); } - // Otherwise discard the sub-pixel remainder because paint offset can't be - // transformed by a non-translation transform. - owning_layer_->SetSubpixelAccumulation(subpixel_accumulation); - absl::optional<gfx::Rect> mask_bounding_box = CSSMaskPainter::MaskBoundingBox(GetLayoutObject(), subpixel_accumulation); absl::optional<gfx::RectF> clip_path_bounding_box = @@ -526,16 +522,12 @@ gfx::Vector2d new_offset_from_layout_object = -ToRoundedVector2d(offset_from_squash_layer_origin); - PhysicalOffset subpixel_accumulation = - offset_from_squash_layer_origin + - PhysicalOffset(new_offset_from_layout_object); if (layer->offset_from_layout_object_set && layer->offset_from_layout_object != new_offset_from_layout_object) { layers_needing_paint_invalidation.push_back(layer->paint_layer); } layer->offset_from_layout_object = new_offset_from_layout_object; layer->offset_from_layout_object_set = true; - layer->paint_layer->SetSubpixelAccumulation(subpixel_accumulation); } non_scrolling_squashing_layer_->SetSize(squash_layer_bounds.size()); @@ -686,9 +678,6 @@ PhysicalOffset(scrolling_contents_layer_->OffsetFromLayoutObject()); gfx::Vector2d new_offset_from_layout_object = -ToRoundedVector2d(offset_from_scrolling_contents_layer); - PhysicalOffset subpixel_accumulation = - offset_from_scrolling_contents_layer + - PhysicalOffset(new_offset_from_layout_object); if (layer->offset_from_layout_object_set && layer->offset_from_layout_object != new_offset_from_layout_object) { @@ -696,7 +685,6 @@ } layer->offset_from_layout_object = new_offset_from_layout_object; layer->offset_from_layout_object_set = true; - layer->paint_layer->SetSubpixelAccumulation(subpixel_accumulation); } for (auto& layer : squashed_layers_in_scrolling_contents_) { UpdateLocalClipRectForSquashedLayer(
diff --git a/third_party/blink/renderer/core/paint/compositing/compositing_inputs_updater.cc b/third_party/blink/renderer/core/paint/compositing/compositing_inputs_updater.cc deleted file mode 100644 index bf0770d..0000000 --- a/third_party/blink/renderer/core/paint/compositing/compositing_inputs_updater.cc +++ /dev/null
@@ -1,272 +0,0 @@ -// Copyright 2014 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 "third_party/blink/renderer/core/paint/compositing/compositing_inputs_updater.h" - -#include "third_party/blink/renderer/core/display_lock/display_lock_utilities.h" -#include "third_party/blink/renderer/core/dom/document.h" -#include "third_party/blink/renderer/core/frame/local_frame_view.h" -#include "third_party/blink/renderer/core/layout/layout_block.h" -#include "third_party/blink/renderer/core/layout/layout_embedded_content.h" -#include "third_party/blink/renderer/core/layout/layout_view.h" -#include "third_party/blink/renderer/core/paint/compositing/composited_layer_mapping.h" -#include "third_party/blink/renderer/core/paint/compositing/paint_layer_compositor.h" -#include "third_party/blink/renderer/core/paint/paint_layer.h" -#include "third_party/blink/renderer/core/paint/paint_layer_scrollable_area.h" -#include "third_party/blink/renderer/platform/heap/handle.h" -#include "third_party/blink/renderer/platform/instrumentation/tracing/trace_event.h" -#include "third_party/blink/renderer/platform/instrumentation/use_counter.h" - -namespace blink { - -CompositingInputsUpdater::CompositingInputsUpdater( - PaintLayer* root_layer, - PaintLayer* compositing_inputs_root) - : root_layer_(root_layer), - compositing_inputs_root_(compositing_inputs_root) { -} - -CompositingInputsUpdater::~CompositingInputsUpdater() = default; - -bool CompositingInputsUpdater::LayerOrDescendantShouldBeComposited( - PaintLayer* layer) { - if (auto* layout_view = DynamicTo<LayoutView>(layer->GetLayoutObject())) { - if (layout_view->GetFrameView()->ShouldThrottleRendering()) { - if (auto* inner_compositor = layout_view->Compositor()) - return inner_compositor->StaleInCompositingMode(); - return false; - } - } - DCHECK(!layer->GetLayoutObject().GetFrameView()->ShouldThrottleRendering()); - return layer->DescendantHasDirectOrScrollingCompositingReason() || - layer->NeedsCompositedScrolling(); -} - -void CompositingInputsUpdater::Update() { - TRACE_EVENT0("blink", "CompositingInputsUpdater::update"); - - AncestorInfo info; - UpdateType update_type = kDoNotForceUpdate; - PaintLayer* layer = - compositing_inputs_root_ ? compositing_inputs_root_ : root_layer_; - - // We don't need to do anything if the layer is under a locked display lock - // that prevents updates. - if (DisplayLockUtilities::LockedAncestorPreventingPrePaint( - layer->GetLayoutObject())) { - return; - } - - ApplyAncestorInfoToSelfAndAncestorsRecursively(layer, update_type, info); - UpdateSelfAndDescendantsRecursively(layer, update_type, info); - - if (LayerOrDescendantShouldBeComposited(layer)) { - // Update all parent layers - PaintLayer* parent_layer = layer->Parent(); - while (parent_layer && - !parent_layer->DescendantHasDirectOrScrollingCompositingReason()) { - parent_layer->SetDescendantHasDirectOrScrollingCompositingReason(true); - parent_layer = parent_layer->Parent(); - } - } -} - -void CompositingInputsUpdater::ApplyAncestorInfoToSelfAndAncestorsRecursively( - PaintLayer* layer, - UpdateType& update_type, - AncestorInfo& info) { - if (!layer) - return; - - // We first recursively call ApplyAncestorInfoToSelfAndAncestorsRecursively() - // to ensure that we start to compute AncestorInfo from the root layer (as we - // need to do a top-down tree walk to incrementally update this information). - ApplyAncestorInfoToSelfAndAncestorsRecursively(layer->Parent(), update_type, - info); - UpdateAncestorInfo(layer, update_type, info); -} - -void CompositingInputsUpdater::UpdateSelfAndDescendantsRecursively( - PaintLayer* layer, - UpdateType update_type, - AncestorInfo info) { - // UpdateAncestorInfo has been already computed in ApplyAncestorInfo() for - // layers from root_layer_ down to compositing_inputs_root_ both included. - if (layer != root_layer_ && layer != compositing_inputs_root_) - UpdateAncestorInfo(layer, update_type, info); - - PaintLayerCompositor* compositor = - layer->GetLayoutObject().View()->Compositor(); - - // The sequence of updates to compositing triggers goes like this: - // 1. Apply all triggers from kComboAllDirectNonStyleDeterminedReasons for - // |layer|. This may depend on ancestor composited scrolling (i.e. step - // 2 for an ancestor PaintLayer). - // 2. Put |layer| in composited scrolling mode if needed. - // 3. Reset DescendantHasDirectCompositingReason to false for |layer|. - // 4. Recurse into child PaintLayers. - // 5. Set DescendantHasDirectCompositingReason to true if it was for any - // child. - // 6. If |layer| is the root, composite if - // DescendantHasDirectCompositingReason is true for |layer|. - - // Note that prepaint may use the compositing information, so only skip - // recursing it if we're skipping prepaint. - bool recursion_blocked_by_display_lock = - layer->GetLayoutObject().ChildPrePaintBlockedByDisplayLock(); - - bool should_recurse = update_type == kForceUpdate; - - layer->SetDescendantHasDirectOrScrollingCompositingReason(false); - bool descendant_has_direct_compositing_reason = false; - - auto* first_child = - recursion_blocked_by_display_lock ? nullptr : layer->FirstChild(); - for (PaintLayer* child = first_child; child; child = child->NextSibling()) { - if (should_recurse) - UpdateSelfAndDescendantsRecursively(child, update_type, info); - descendant_has_direct_compositing_reason |= - LayerOrDescendantShouldBeComposited(child); - } - if (!descendant_has_direct_compositing_reason && - layer->GetLayoutObject().IsLayoutEmbeddedContent()) { - if (LayoutView* embedded_layout_view = - To<LayoutEmbeddedContent>(layer->GetLayoutObject()) - .ChildLayoutView()) { - descendant_has_direct_compositing_reason |= - LayerOrDescendantShouldBeComposited(embedded_layout_view->Layer()); - } - } - layer->SetDescendantHasDirectOrScrollingCompositingReason( - descendant_has_direct_compositing_reason); - - if ((layer->IsRootLayer() || layer->NeedsReorderOverlayOverflowControls()) && - layer->ScrollsOverflow() && - layer->DescendantHasDirectOrScrollingCompositingReason() && - !layer->NeedsCompositedScrolling()) - layer->GetScrollableArea()->UpdateNeedsCompositedScrolling(true); - - compositor->ClearCompositingInputsRoot(); -} - -bool CompositingInputsUpdater::NeedsPaintOffsetTranslationForCompositing( - PaintLayer* layer) { - return false; -} - -void CompositingInputsUpdater::UpdateAncestorInfo(PaintLayer* const layer, - UpdateType& update_type, - AncestorInfo& info) { - LayoutBoxModelObject& layout_object = layer->GetLayoutObject(); - const ComputedStyle& style = layout_object.StyleRef(); - - PaintLayer* enclosing_stacking_composited_layer = - info.enclosing_stacking_composited_layer; - PaintLayer* enclosing_squashing_composited_layer = - info.enclosing_squashing_composited_layer; - - switch (layer->GetCompositingState()) { - case kNotComposited: - break; - case kPaintsIntoOwnBacking: - if (layout_object.IsStackingContext()) - enclosing_stacking_composited_layer = layer; - break; - case kPaintsIntoGroupedBacking: - enclosing_squashing_composited_layer = - &layer->GroupedMapping()->OwningLayer(); - break; - } - - if (style.GetPosition() == EPosition::kAbsolute) { - info.escape_clip_to = info.escape_clip_to_for_absolute; - info.scrolling_ancestor = info.scrolling_ancestor_for_absolute; - info.needs_reparent_scroll = info.needs_reparent_scroll_for_absolute; - } else if (style.GetPosition() == EPosition::kFixed) { - info.escape_clip_to = info.escape_clip_to_for_fixed; - info.scrolling_ancestor = info.scrolling_ancestor_for_fixed; - info.needs_reparent_scroll = info.needs_reparent_scroll_for_fixed; - } - - if (layout_object.ShouldApplyLayoutContainment()) - info.nearest_contained_layout_layer = layer; - - info.enclosing_stacking_composited_layer = - enclosing_stacking_composited_layer; - info.enclosing_squashing_composited_layer = - enclosing_squashing_composited_layer; - - // Handles sibling scroll problem, i.e. a non-stacking context scroller - // needs to propagate scroll to its descendants that are siblings in - // paint order. For example: - // <div style="overflow:scroll;"> - // <div style="position:relative;">Paint sibling.</div> - // </div> - if (layer->ScrollsOverflow()) { - info.scrolling_ancestor = layer; - info.needs_reparent_scroll = true; - } - if (layout_object.CanContainAbsolutePositionObjects()) { - info.clip_chain_parent_for_absolute = layer; - info.escape_clip_to_for_absolute = info.escape_clip_to; - info.scrolling_ancestor_for_absolute = info.scrolling_ancestor; - info.needs_reparent_scroll_for_absolute = info.needs_reparent_scroll; - } - - // LayoutView isn't really the containing block for fixed-pos descendants - // in the sense that they don't scroll along with its in-flow contents. - // However LayoutView does clip them. - if (layout_object.CanContainFixedPositionObjects() && - !IsA<LayoutView>(layout_object)) { - info.clip_chain_parent_for_fixed = layer; - info.escape_clip_to_for_fixed = info.escape_clip_to; - info.scrolling_ancestor_for_fixed = info.scrolling_ancestor; - info.needs_reparent_scroll_for_fixed = info.needs_reparent_scroll; - } - if (IsA<LayoutView>(layout_object)) - info.clip_chain_parent_for_fixed = layer; - - // CSS clip affects all descendants, not just containing-block descendants. - // We don't have to set clip_chain_parent_for_absolute here because CSS clip - // requires position:absolute, so the element must contain absolute-positioned - // descendants. - // However it is incorrect to let fixed-positioned descendants to inherit the - // clip state from this element either, because the overflow clip and the - // inherited clip of the current element shouldn't apply to them if the - // current element is not a fixed-pos container. This is a known bug but too - // difficult to fix in SPv1 compositing. - if (layout_object.HasClip()) - info.clip_chain_parent_for_fixed = layer; - - if (layout_object.IsStackingContext()) { - info.escape_clip_to = nullptr; - info.escape_clip_to_for_absolute = nullptr; - info.escape_clip_to_for_fixed = nullptr; - // Workaround crbug.com/817175 - // We can't escape clip to a layer that paints after us, because in SPv1 - // cc needs to reverse engineer clip tree from the layer tree, and we - // can't refer to a clip node that hasn't been built yet. - // This will result in wrong clip in some rare cases, for example: - // <div style="display:grid;"> - // <div style="z-index:-1; overflow:hidden;"> - // <div style="position:absolute;"></div> - // </div> - // </div> - if (info.escape_clip_to_for_absolute && style.EffectiveZIndex() < 0 && - !info.escape_clip_to_for_absolute->GetLayoutObject() - .IsStackingContext()) - info.escape_clip_to_for_absolute = nullptr; - if (info.escape_clip_to_for_fixed && style.EffectiveZIndex() < 0 && - !info.escape_clip_to_for_fixed->GetLayoutObject().IsStackingContext()) - info.escape_clip_to_for_fixed = nullptr; - - info.needs_reparent_scroll = info.needs_reparent_scroll_for_absolute = - info.needs_reparent_scroll_for_fixed = false; - } - - if (layout_object.IsStickyPositioned()) - info.is_under_position_sticky = true; -} - -} // namespace blink
diff --git a/third_party/blink/renderer/core/paint/compositing/compositing_inputs_updater.h b/third_party/blink/renderer/core/paint/compositing/compositing_inputs_updater.h deleted file mode 100644 index b71072e..0000000 --- a/third_party/blink/renderer/core/paint/compositing/compositing_inputs_updater.h +++ /dev/null
@@ -1,93 +0,0 @@ -// Copyright 2014 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 THIRD_PARTY_BLINK_RENDERER_CORE_PAINT_COMPOSITING_COMPOSITING_INPUTS_UPDATER_H_ -#define THIRD_PARTY_BLINK_RENDERER_CORE_PAINT_COMPOSITING_COMPOSITING_INPUTS_UPDATER_H_ - -#include "base/dcheck_is_on.h" -#include "third_party/blink/renderer/platform/wtf/allocator/allocator.h" - -namespace blink { - -class PaintLayer; - -class CompositingInputsUpdater { - STACK_ALLOCATED(); - - public: - explicit CompositingInputsUpdater(PaintLayer* root_layer, - PaintLayer* compositing_inputs_root); - ~CompositingInputsUpdater(); - - void Update(); - - // Combine all reasons for compositing a layer into a single boolean value - bool LayerOrDescendantShouldBeComposited(PaintLayer*); - - private: - enum UpdateType { - kDoNotForceUpdate, - kForceUpdate, - }; - - struct AncestorInfo { - STACK_ALLOCATED(); - - public: - // The ancestor composited PaintLayer which is also a stacking context. - PaintLayer* enclosing_stacking_composited_layer = nullptr; - // A "squashing composited layer" is a PaintLayer that owns a squashing - // layer. This variable stores the squashing composited layer for the - // nearest PaintLayer ancestor which is squashed. - PaintLayer* enclosing_squashing_composited_layer = nullptr; - - PaintLayer* clip_chain_parent_for_absolute = nullptr; - PaintLayer* clip_chain_parent_for_fixed = nullptr; - // These flags are set if we encountered a stacking context - // that will make descendants to inherit more clip than desired, - // so we have to setup an alternative clip parent instead. - PaintLayer* escape_clip_to = nullptr; - PaintLayer* escape_clip_to_for_absolute = nullptr; - PaintLayer* escape_clip_to_for_fixed = nullptr; - - PaintLayer* scrolling_ancestor = nullptr; - PaintLayer* scrolling_ancestor_for_absolute = nullptr; - PaintLayer* scrolling_ancestor_for_fixed = nullptr; - - // The nearest layer up in the ancestor chain that has layout containment - // applied to it, including the self layer. - PaintLayer* nearest_contained_layout_layer = nullptr; - - // These flags are set to true if a non-stacking context scroller - // is encountered, so that a descendant element won't inherit scroll - // translation from its compositing ancestor directly thus having to - // setup an alternative scroll parent instead. - bool needs_reparent_scroll = false; - bool needs_reparent_scroll_for_absolute = false; - bool needs_reparent_scroll_for_fixed = false; - - bool is_under_position_sticky = false; - }; - - void UpdateSelfAndDescendantsRecursively(PaintLayer*, - UpdateType, - AncestorInfo); - // This is a recursive method to update AncestorInfo - // starting from the root layer down to the compositing_inputs_root_. - void ApplyAncestorInfoToSelfAndAncestorsRecursively(PaintLayer*, - UpdateType&, - AncestorInfo&); - // This method takes care of updating AncestorInfo taking into account the - // current value of AncestorInfo. - void UpdateAncestorInfo(PaintLayer* const, UpdateType&, AncestorInfo&); - - bool NeedsPaintOffsetTranslationForCompositing(PaintLayer*); - - PaintLayer* root_layer_; - PaintLayer* compositing_inputs_root_; -}; - -} // namespace blink - -#endif // THIRD_PARTY_BLINK_RENDERER_CORE_PAINT_COMPOSITING_COMPOSITING_INPUTS_UPDATER_H_
diff --git a/third_party/blink/renderer/core/paint/compositing/compositing_requirements_updater.cc b/third_party/blink/renderer/core/paint/compositing/compositing_requirements_updater.cc deleted file mode 100644 index e8d646e..0000000 --- a/third_party/blink/renderer/core/paint/compositing/compositing_requirements_updater.cc +++ /dev/null
@@ -1,578 +0,0 @@ -/* - * Copyright (C) 2009, 2010 Apple Inc. All rights reserved. - * Copyright (C) 2014 Google Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY - * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "third_party/blink/renderer/core/paint/compositing/compositing_requirements_updater.h" - -#include "third_party/blink/renderer/core/html/media/html_media_element.h" -#include "third_party/blink/renderer/core/layout/layout_embedded_content.h" -#include "third_party/blink/renderer/core/layout/layout_view.h" -#include "third_party/blink/renderer/core/paint/compositing/paint_layer_compositor.h" -#include "third_party/blink/renderer/core/paint/paint_layer.h" -#include "third_party/blink/renderer/core/paint/paint_layer_paint_order_iterator.h" -#include "third_party/blink/renderer/core/paint/paint_layer_scrollable_area.h" -#include "third_party/blink/renderer/platform/heap/collection_support/clear_collection_scope.h" -#include "third_party/blink/renderer/platform/instrumentation/tracing/trace_event.h" - -namespace blink { - -class OverlapMapContainer { - public: - void Add(const gfx::Rect& bounds) { - layer_rects_.push_back(bounds); - bounding_box_.Union(bounds); - } - - bool OverlapsLayers(const gfx::Rect& bounds) const { - // Checking with the bounding box will quickly reject cases when - // layers are created for lists of items going in one direction and - // never overlap with each other. - if (!bounds.Intersects(bounding_box_)) - return false; - for (unsigned i = 0; i < layer_rects_.size(); i++) { - if (layer_rects_[i].Intersects(bounds)) - return true; - } - return false; - } - - void Unite(const OverlapMapContainer& other_container) { - layer_rects_.AppendVector(other_container.layer_rects_); - bounding_box_.Union(other_container.bounding_box_); - } - - private: - Vector<gfx::Rect, 64> layer_rects_; - gfx::Rect bounding_box_; -}; - -struct OverlapMapContainers { - OverlapMapContainer clipped; - OverlapMapContainer unclipped; -}; - -class CompositingRequirementsUpdater::OverlapMap { - public: - OverlapMap() { - // Begin by assuming the root layer will be composited so that there - // is something on the stack. The root layer should also never get a - // finishCurrentOverlapTestingContext() call. - BeginNewOverlapTestingContext(); - } - OverlapMap(const OverlapMap&) = delete; - OverlapMap& operator=(const OverlapMap&) = delete; - - // Each rect added is marked as clipped or unclipped. clipped rects may - // overlap only with other clipped rects, but unclipped rects may overlap - // with anything. - // - // This is used to model composited overflow scrolling, where PaintLayers - // within the scroller are not clipped for overlap testing, whereas - // PaintLayers not within it are. This is necessary because PaintLayerClipper - // is not smart enough to understand not to clip composited overflow clips, - // but still clip otherwise. - void Add(PaintLayer* layer, const gfx::Rect& bounds, bool is_clipped) { - DCHECK(!layer->IsRootLayer()); - if (bounds.IsEmpty()) - return; - - // Layers do not contribute to overlap immediately--instead, they will - // contribute to overlap as soon as they have been recursively processed - // and popped off the stack. - DCHECK_GE(overlap_stack_.size(), 2ul); - if (is_clipped) - overlap_stack_[overlap_stack_.size() - 2].clipped.Add(bounds); - else - overlap_stack_[overlap_stack_.size() - 2].unclipped.Add(bounds); - } - - bool OverlapsLayers(const gfx::Rect& bounds, bool is_clipped) const { - bool clipped_overlap = overlap_stack_.back().clipped.OverlapsLayers(bounds); - if (is_clipped) - return clipped_overlap; - // Unclipped is allowed to overlap clipped, but not vice-versa. - return clipped_overlap || - overlap_stack_.back().unclipped.OverlapsLayers(bounds); - } - - void BeginNewOverlapTestingContext() { - // This effectively creates a new "clean slate" for overlap state. - // This is used when we know that a subtree or remaining set of - // siblings does not need to check overlap with things behind it. - overlap_stack_.Grow(overlap_stack_.size() + 1); - } - - void FinishCurrentOverlapTestingContext() { - // The overlap information on the top of the stack is still necessary - // for checking overlap of any layers outside this context that may - // overlap things from inside this context. Therefore, we must merge - // the information from the top of the stack before popping the stack. - // - // FIXME: we may be able to avoid this deep copy by rearranging how - // overlapMap state is managed. - overlap_stack_[overlap_stack_.size() - 2].clipped.Unite( - overlap_stack_.back().clipped); - overlap_stack_[overlap_stack_.size() - 2].unclipped.Unite( - overlap_stack_.back().unclipped); - overlap_stack_.pop_back(); - } - - private: - Vector<OverlapMapContainers> overlap_stack_; -}; - -class CompositingRequirementsUpdater::RecursionData { - STACK_ALLOCATED(); - - public: - explicit RecursionData(PaintLayer* compositing_ancestor) - : compositing_ancestor_(compositing_ancestor), - subtree_is_compositing_(false), - has_unisolated_composited_blending_descendant_(false), - testing_overlap_(true) {} - - PaintLayer* compositing_ancestor_; - bool subtree_is_compositing_; - bool has_unisolated_composited_blending_descendant_; - bool testing_overlap_; -}; - -static bool RequiresCompositingOrSquashing(CompositingReasons reasons) { -#if DCHECK_IS_ON() - bool fast_answer = reasons != CompositingReason::kNone; - bool slow_answer = RequiresCompositing(reasons) || RequiresSquashing(reasons); - DCHECK_EQ(slow_answer, fast_answer); -#endif - return reasons != CompositingReason::kNone; -} - -static CompositingReasons SubtreeReasonsForCompositing( - PaintLayer* layer, - bool has_composited_descendants, - bool has3d_transformed_descendants) { - CompositingReasons subtree_reasons = CompositingReason::kNone; - if (!has_composited_descendants) - return subtree_reasons; - - if (layer->ShouldIsolateCompositedDescendants()) { - DCHECK(layer->GetLayoutObject().IsStackingContext()); - subtree_reasons |= CompositingReason::kIsolateCompositedDescendants; - } - - if (layer->GetLayoutObject().IsVideo() && - To<HTMLMediaElement>(layer->GetLayoutObject().GetNode()) - ->IsFullscreen()) { - subtree_reasons |= - CompositingReason::kFullscreenVideoWithCompositedDescendants; - } - - // A layer with preserve-3d or perspective only needs to be composited if - // there are descendant layers that will be affected by the preserve-3d or - // perspective. - if (has3d_transformed_descendants) { - const ComputedStyle& style = layer->GetLayoutObject().StyleRef(); - if (style.UsedTransformStyle3D() == ETransformStyle3D::kPreserve3d) - subtree_reasons |= CompositingReason::kPreserve3DWith3DDescendants; - - // Perspective (specified either by perspective or transform properties) - // with 3d descendants need a render surface for flattening purposes. - if (style.HasPerspective() || style.Transform().HasPerspective()) - subtree_reasons |= CompositingReason::kPerspectiveWith3DDescendants; - } - - return subtree_reasons; -} - -CompositingRequirementsUpdater::CompositingRequirementsUpdater( - LayoutView& layout_view) - : layout_view_(layout_view) {} - -void CompositingRequirementsUpdater::Update(PaintLayer* root) { - TRACE_EVENT0("blink", "CompositingRequirementsUpdater::updateRecursive"); - - // Go through the layers in presentation order, so that we can compute which - // Layers need compositing layers. - // FIXME: we could maybe do this and the hierarchy update in one pass, but the - // parenting logic would be more complex. - RecursionData recursion_data(root); - OverlapMap overlap_test_request_map; - bool saw3d_transform = false; - - // FIXME: Passing these unclippedDescendants down and keeping track - // of them dynamically, we are requiring a full tree walk. This - // should be removed as soon as proper overlap testing based on - // scrolling and animation bounds is implemented (crbug.com/252472). - HeapVector<Member<PaintLayer>> unclipped_descendants; - ClearCollectionScope<HeapVector<Member<PaintLayer>>> scope( - &unclipped_descendants); - gfx::Rect absolute_descendant_bounding_box; - UpdateRecursive(nullptr, root, overlap_test_request_map, recursion_data, - saw3d_transform, unclipped_descendants, - absolute_descendant_bounding_box); -} - -#if DCHECK_IS_ON() -static void CheckSubtreeHasNoCompositing(PaintLayer* layer) { - if (layer->GetLayoutObject().ChildPrePaintBlockedByDisplayLock()) - return; - - PaintLayerPaintOrderIterator iterator(layer, kAllChildren); - while (PaintLayer* cur_layer = iterator.Next()) { - DCHECK(cur_layer->GetCompositingState() == kNotComposited); - DCHECK(!cur_layer->CanBeComposited()); - CheckSubtreeHasNoCompositing(cur_layer); - } -} -#endif - -void CompositingRequirementsUpdater::UpdateRecursive( - PaintLayer* ancestor_layer, - PaintLayer* layer, - OverlapMap& overlap_map, - RecursionData& current_recursion_data, - bool& descendant_has3d_transform, - HeapVector<Member<PaintLayer>>& unclipped_descendants, - gfx::Rect& absolute_descendant_bounding_box) { - PaintLayerCompositor* compositor = layout_view_.Compositor(); - - CompositingReasons reasons_to_composite = CompositingReason::kNone; - CompositingReasons direct_reasons = CompositingReason::kNone; - - bool has_non_root_composited_scrolling_ancestor = false; - bool use_clipped_bounding_rect = !has_non_root_composited_scrolling_ancestor; - - const bool layer_can_be_composited = layer->CanBeComposited(); - - CompositingReasons direct_from_paint_layer = 0; - direct_reasons |= direct_from_paint_layer; - - if (layer->GetScrollableArea() && - layer->GetScrollableArea()->NeedsCompositedScrolling()) - direct_reasons |= CompositingReason::kOverflowScrolling; - - bool can_be_composited = layer->CanBeComposited(); - if (can_be_composited) - reasons_to_composite |= direct_reasons; - - const LayoutObject& layout_object = layer->GetLayoutObject(); - - // Next, accumulate reasons related to overlap. - // If overlap testing is used, this reason will be overridden. If overlap - // testing is not used, we must assume we overlap if there is anything - // composited behind us in paint-order. - CompositingReasons overlap_compositing_reason = - (layer_can_be_composited && - current_recursion_data.subtree_is_compositing_) - ? CompositingReason::kAssumedOverlap - : CompositingReason::kNone; - - if (has_non_root_composited_scrolling_ancestor) { - Vector<wtf_size_t> unclipped_descendants_to_remove; - for (wtf_size_t i = 0; i < unclipped_descendants.size(); i++) { - PaintLayer* unclipped_descendant = unclipped_descendants.at(i); - // If we've reached the containing block of one of the unclipped - // descendants, that element is no longer relevant to whether or not we - // should opt in. Unfortunately we can't easily remove from the list - // while we're iterating, so we have to store it for later removal. - if (unclipped_descendant->GetLayoutObject().ContainingBlock() == - &layout_object) { - unclipped_descendants_to_remove.push_back(i); - continue; - } - if (layer_can_be_composited && - layer->ScrollsWithRespectTo(unclipped_descendant)) - reasons_to_composite |= CompositingReason::kAssumedOverlap; - } - - // Remove irrelevant unclipped descendants in reverse order so our stored - // indices remain valid. - for (wtf_size_t i = 0; i < unclipped_descendants_to_remove.size(); i++) { - unclipped_descendants.EraseAt(unclipped_descendants_to_remove.at( - unclipped_descendants_to_remove.size() - i - 1)); - } - } - - if (reasons_to_composite & CompositingReason::kOutOfFlowClipping) { - // TODO(schenney): We only need to promote when the clipParent is not a - // descendant of the ancestor scroller, which we do not check for here. - // Hence we might be promoting needlessly. - unclipped_descendants.push_back(layer); - } - - gfx::Rect abs_bounds = layer->ExpandedBoundingBoxForCompositingOverlapTest( - use_clipped_bounding_rect); - - absolute_descendant_bounding_box = abs_bounds; - if (layer_can_be_composited && current_recursion_data.testing_overlap_ && - !RequiresCompositingOrSquashing(direct_reasons)) { - bool overlaps = - overlap_map.OverlapsLayers(abs_bounds, use_clipped_bounding_rect); - overlap_compositing_reason = - overlaps ? CompositingReason::kOverlap : CompositingReason::kNone; - } - - reasons_to_composite |= overlap_compositing_reason; - - // The children of this layer don't need to composite, unless there is - // a compositing layer among them, so start by inheriting the compositing - // ancestor with m_subtreeIsCompositing set to false. - RecursionData child_recursion_data = current_recursion_data; - child_recursion_data.subtree_is_compositing_ = false; - - // Embedded objects treat the embedded document as a child for the purposes - // of composited layer decisions. Look into the embedded document to determine - // if it is composited. - bool contains_composited_layer = - (layer->GetLayoutObject().IsLayoutEmbeddedContent() && - To<LayoutEmbeddedContent>(layer->GetLayoutObject()) - .ContentDocumentContainsGraphicsLayer()); - - bool will_be_composited_or_squashed = - can_be_composited && RequiresCompositingOrSquashing(reasons_to_composite); - - if (will_be_composited_or_squashed || contains_composited_layer) { - if (will_be_composited_or_squashed) { - // This layer now acts as the ancestor for child layers. - child_recursion_data.compositing_ancestor_ = layer; - } - - // Here we know that all children and the layer's own contents can blindly - // paint into this layer's backing, until a descendant is composited. So, we - // don't need to check for overlap with anything behind this layer. - overlap_map.BeginNewOverlapTestingContext(); - // This layer is going to be composited, so children can safely ignore the - // fact that there's an animation running behind this layer, meaning they - // can rely on the overlap map testing again. - child_recursion_data.testing_overlap_ = true; - } - -#if DCHECK_IS_ON() - PaintLayerListMutationDetector mutation_checker(layer); -#endif - - bool any_descendant_has3d_transform = false; - bool will_have_foreground_layer = false; - - bool needs_recursion_for_composited_scrolling_plus_fixed_or_sticky = - (layer->HasFixedPositionDescendant() || - layer->HasStickyPositionDescendant()) && - (has_non_root_composited_scrolling_ancestor || - (layer->GetScrollableArea() && - layer->GetScrollableArea()->NeedsCompositedScrolling())); - - bool needs_recursion_for_out_of_flow_descendant = - layer->HasNonContainedAbsolutePositionDescendant(); - - // Skip recursion if there are no descendants which: - // * may have their own reason for compositing, - // * have compositing already from the previous frame, or - // * may escape |layer|'s clip. - // * may need compositing requirements update for another reason ( - // e.g. change of stacking order) - bool recursion_blocked_by_display_lock = - layer->GetLayoutObject().ChildPrePaintBlockedByDisplayLock(); - bool skip_children_ignoring_display_lock = - (!layer->DescendantHasDirectOrScrollingCompositingReason() && - !needs_recursion_for_composited_scrolling_plus_fixed_or_sticky && - !needs_recursion_for_out_of_flow_descendant && - layer->GetLayoutObject().ShouldClipOverflowAlongEitherAxis()); - bool skip_children = - recursion_blocked_by_display_lock || skip_children_ignoring_display_lock; - - if (!skip_children) { - PaintLayerPaintOrderIterator iterator(layer, kNegativeZOrderChildren); - while (PaintLayer* child_layer = iterator.Next()) { - gfx::Rect absolute_child_descendant_bounding_box; - UpdateRecursive(layer, child_layer, overlap_map, child_recursion_data, - any_descendant_has3d_transform, unclipped_descendants, - absolute_child_descendant_bounding_box); - absolute_descendant_bounding_box.Union( - absolute_child_descendant_bounding_box); - - // If we have to make a layer for this child, make one now so we can have - // a contents layer (since we need to ensure that the -ve z-order child - // renders underneath our contents). - if (child_recursion_data.subtree_is_compositing_) { - reasons_to_composite |= CompositingReason::kNegativeZIndexChildren; - - if (!will_be_composited_or_squashed) { - // make layer compositing - child_recursion_data.compositing_ancestor_ = layer; - overlap_map.BeginNewOverlapTestingContext(); - will_be_composited_or_squashed = true; - will_have_foreground_layer = true; - - // FIXME: temporary solution for the first negative z-index composited - // child: re-compute the absBounds for the child so that we can add - // the negative z-index child's bounds to the new overlap context. - overlap_map.BeginNewOverlapTestingContext(); - overlap_map.Add(child_layer, - child_layer->ClippedAbsoluteBoundingBox(), true); - overlap_map.FinishCurrentOverlapTestingContext(); - } - } - } - } - - if (will_have_foreground_layer) { - DCHECK(will_be_composited_or_squashed); - // A foreground layer effectively is a new backing for all subsequent - // children, so we don't need to test for overlap with anything behind this. - // So, we can finish the previous context that was accumulating rects for - // the negative z-index children, and start with a fresh new empty context. - overlap_map.FinishCurrentOverlapTestingContext(); - overlap_map.BeginNewOverlapTestingContext(); - // This layer is going to be composited, so children can safely ignore the - // fact that there's an animation running behind this layer, meaning they - // can rely on the overlap map testing again. - child_recursion_data.testing_overlap_ = true; - } - - if (!skip_children) { - PaintLayerPaintOrderIterator iterator(layer, - kNormalFlowAndPositiveZOrderChildren); - while (PaintLayer* child_layer = iterator.Next()) { - gfx::Rect absolute_child_descendant_bounding_box; - UpdateRecursive(layer, child_layer, overlap_map, child_recursion_data, - any_descendant_has3d_transform, unclipped_descendants, - absolute_child_descendant_bounding_box); - absolute_descendant_bounding_box.Union( - absolute_child_descendant_bounding_box); - } - } - -#if DCHECK_IS_ON() - if (skip_children) - CheckSubtreeHasNoCompositing(layer); -#endif - - // Now that the subtree has been traversed, we can check for compositing - // reasons that depended on the state of the subtree. - - if (layer->GetLayoutObject().IsStackingContext()) { - layer->SetShouldIsolateCompositedDescendants( - child_recursion_data.has_unisolated_composited_blending_descendant_); - } else { - layer->SetShouldIsolateCompositedDescendants(false); - current_recursion_data.has_unisolated_composited_blending_descendant_ = - child_recursion_data.has_unisolated_composited_blending_descendant_; - } - - // Subsequent layers in the parent's stacking context may also need to - // composite. - if (child_recursion_data.subtree_is_compositing_ || contains_composited_layer) - current_recursion_data.subtree_is_compositing_ = true; - - if (layer->IsRootLayer()) { - // The root layer needs to be composited if anything else in the tree is - // composited. Otherwise, we can disable compositing entirely. - if (child_recursion_data.subtree_is_compositing_ || - RequiresCompositingOrSquashing(reasons_to_composite)) { -#if DCHECK_IS_ON() - if (layer->GetScrollableArea()) { - // The reason for compositing should not be due to composited scrolling. - // It should only be compositing in order to represent composited - // content within a composited subframe. - bool was = layer->NeedsCompositedScrolling(); - layer->GetScrollableArea()->UpdateNeedsCompositedScrolling(true); - DCHECK(was == layer->NeedsCompositedScrolling()); - } -#endif - - reasons_to_composite |= CompositingReason::kRoot; - } else { - compositor->SetCompositingModeEnabled(false); - reasons_to_composite = CompositingReason::kNone; - } - } else { - // All layers (even ones that aren't being composited) need to get added to - // the overlap map. Layers that are not separately composited will paint - // into their compositing ancestor's backing, and so are still considered - // for overlap. - if ((child_recursion_data.compositing_ancestor_ && - !child_recursion_data.compositing_ancestor_->IsRootLayer()) || - contains_composited_layer) { - overlap_map.Add(layer, abs_bounds, use_clipped_bounding_rect); - } - - // Now check for reasons to become composited that depend on the state of - // descendant layers. - CompositingReasons subtree_compositing_reasons = - SubtreeReasonsForCompositing( - layer, child_recursion_data.subtree_is_compositing_, - any_descendant_has3d_transform); - if (layer_can_be_composited) - reasons_to_composite |= subtree_compositing_reasons; - if (!will_be_composited_or_squashed && can_be_composited && - RequiresCompositingOrSquashing(subtree_compositing_reasons)) { - child_recursion_data.compositing_ancestor_ = layer; - // FIXME: this context push is effectively a no-op but needs to exist for - // now, because the code is designed to push overlap information to the - // second-from-top context of the stack. - overlap_map.BeginNewOverlapTestingContext(); - overlap_map.Add(layer, absolute_descendant_bounding_box, - use_clipped_bounding_rect); - will_be_composited_or_squashed = true; - } - - if (will_be_composited_or_squashed && - layer->GetLayoutObject().StyleRef().HasBlendMode()) { - current_recursion_data.has_unisolated_composited_blending_descendant_ = - true; - } - - // Tell the parent it has compositing descendants. - if (will_be_composited_or_squashed) - current_recursion_data.subtree_is_compositing_ = true; - - // Turn overlap testing off for later layers if it's already off, or if we - // have an animating transform. - if (!child_recursion_data.testing_overlap_ || - layer->GetLayoutObject().StyleRef().HasCurrentTransformAnimation()) { - current_recursion_data.testing_overlap_ = false; - } - - if (child_recursion_data.compositing_ancestor_ == layer || - contains_composited_layer) { - overlap_map.FinishCurrentOverlapTestingContext(); - } - - descendant_has3d_transform |= - any_descendant_has3d_transform || layer->Has3DTransform(); - } - - // Layer assignment is needed for allocating or removing composited - // layers related to this PaintLayer; hence the below conditions. - if (reasons_to_composite || layer->GetCompositingState() != kNotComposited) { - layer->SetNeedsCompositingLayerAssignment(); - } else if (contains_composited_layer) { - // If this is an iframe whose content document is composited, then we need - // CompositedLayerAssigner to process this layer, to ensure that we don't - // squash layers painted before the iframe with layers painted after it. - layer->PropagateDescendantNeedsCompositingLayerAssignment(); - } -} - -} // namespace blink
diff --git a/third_party/blink/renderer/core/paint/compositing/compositing_requirements_updater.h b/third_party/blink/renderer/core/paint/compositing/compositing_requirements_updater.h deleted file mode 100644 index ef665be..0000000 --- a/third_party/blink/renderer/core/paint/compositing/compositing_requirements_updater.h +++ /dev/null
@@ -1,77 +0,0 @@ -/* - * Copyright (C) 2009, 2010 Apple Inc. All rights reserved. - * Copyright (C) 2014 Google Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY - * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef THIRD_PARTY_BLINK_RENDERER_CORE_PAINT_COMPOSITING_COMPOSITING_REQUIREMENTS_UPDATER_H_ -#define THIRD_PARTY_BLINK_RENDERER_CORE_PAINT_COMPOSITING_COMPOSITING_REQUIREMENTS_UPDATER_H_ - -#include "third_party/blink/renderer/platform/graphics/compositing_reasons.h" -#include "third_party/blink/renderer/platform/heap/collection_support/heap_vector.h" -#include "third_party/blink/renderer/platform/wtf/allocator/allocator.h" -#include "third_party/blink/renderer/platform/wtf/vector.h" -#include "ui/gfx/geometry/rect.h" - -namespace blink { - -class PaintLayer; -class LayoutView; - -class CompositingRequirementsUpdater { - STACK_ALLOCATED(); - - public: - CompositingRequirementsUpdater(LayoutView&); - - // Recurse through the layers in z-index and overflow order (which is - // equivalent to painting order) - // For the z-order children of a compositing layer: - // If a child layers has a compositing layer, then all subsequent layers - // must be compositing in order to render above that layer. - // - // If a child in the negative z-order list is compositing, then the layer - // itself must be compositing so that its contents render over that - // child. This implies that its positive z-index children must also be - // compositing. - // - void Update(PaintLayer* root); - - private: - class OverlapMap; - class RecursionData; - - void UpdateRecursive(PaintLayer* ancestor_layer, - PaintLayer* current_layer, - OverlapMap&, - RecursionData&, - bool& descendant_has3d_transform, - HeapVector<Member<PaintLayer>>& unclipped_descendants, - gfx::Rect& absolute_descendant_bounding_box); - - LayoutView& layout_view_; -}; - -} // namespace blink - -#endif // THIRD_PARTY_BLINK_RENDERER_CORE_PAINT_COMPOSITING_COMPOSITING_REQUIREMENTS_UPDATER_H_
diff --git a/third_party/blink/renderer/core/paint/compositing/paint_layer_compositor.cc b/third_party/blink/renderer/core/paint/compositing/paint_layer_compositor.cc index 9b65607f..fcd49e7 100644 --- a/third_party/blink/renderer/core/paint/compositing/paint_layer_compositor.cc +++ b/third_party/blink/renderer/core/paint/compositing/paint_layer_compositor.cc
@@ -44,9 +44,7 @@ #include "third_party/blink/renderer/core/page/chrome_client.h" #include "third_party/blink/renderer/core/page/page.h" #include "third_party/blink/renderer/core/paint/compositing/composited_layer_mapping.h" -#include "third_party/blink/renderer/core/paint/compositing/compositing_inputs_updater.h" #include "third_party/blink/renderer/core/paint/compositing/compositing_layer_assigner.h" -#include "third_party/blink/renderer/core/paint/compositing/compositing_requirements_updater.h" #include "third_party/blink/renderer/core/paint/compositing/graphics_layer_tree_builder.h" #include "third_party/blink/renderer/core/paint/compositing/graphics_layer_updater.h" #include "third_party/blink/renderer/core/paint/object_paint_invalidator.h" @@ -77,7 +75,6 @@ bool PaintLayerCompositor::InCompositingMode() const { // FIXME: This should assert that lifecycle is >= CompositingClean since // the last step of updateIfNeeded can set this bit to false. - DCHECK(layout_view_->Layer()->IsAllowedToQueryCompositingState()); return compositing_; } @@ -146,17 +143,6 @@ layout_view_->CommitPendingSelection(); - if (pending_update_type_ >= kCompositingUpdateAfterCompositingInputChange) { - CompositingInputsUpdater updater(RootLayer(), GetCompositingInputsRoot()); - updater.Update(); - // TODO(chrishtr): we should only need to do this if compositing state - // changed, but - // compositing/iframe-graphics-tree-changes-parents-does-not.html - // breaks otherwise. - if (updater.LayerOrDescendantShouldBeComposited(RootLayer())) - SetOwnerNeedsCompositingInputsUpdate(); - } - Lifecycle().AdvanceTo(DocumentLifecycle::kCompositingInputsClean); } @@ -279,8 +265,6 @@ &layers_needing_paint_invalidation); if (update_type >= kCompositingUpdateAfterCompositingInputChange) { - CompositingRequirementsUpdater(*layout_view_).Update(update_root); - CompositingLayerAssigner layer_assigner(this); layer_assigner.Assign(update_root, layers_needing_paint_invalidation); // TODO(szager): Remove this after diagnosing crash.
diff --git a/third_party/blink/renderer/core/paint/paint_and_raster_invalidation_test.cc b/third_party/blink/renderer/core/paint/paint_and_raster_invalidation_test.cc index e2cb5f8..a9f8de0 100644 --- a/third_party/blink/renderer/core/paint/paint_and_raster_invalidation_test.cc +++ b/third_party/blink/renderer/core/paint/paint_and_raster_invalidation_test.cc
@@ -28,23 +28,9 @@ const RasterInvalidationTracking* GetRasterInvalidationTracking( const LocalFrameView& root_frame_view, wtf_size_t index) { - if (RuntimeEnabledFeatures::CompositeAfterPaintEnabled()) { - if (auto* client = GetContentLayerClient(root_frame_view, index)) - return client->GetRasterInvalidator().GetTracking(); - return nullptr; - } - const GraphicsLayer* graphics_layer = nullptr; - ForAllGraphicsLayers( - *root_frame_view.GetLayoutView()->Layer()->GraphicsLayerBacking(), - [&index, &graphics_layer](const GraphicsLayer& layer) { - if (index-- == 0) { - graphics_layer = &layer; - return false; - } - return true; - }, - [](const GraphicsLayer&, const cc::Layer&) {}); - return graphics_layer->GetRasterInvalidationTracking(); + if (auto* client = GetContentLayerClient(root_frame_view, index)) + return client->GetRasterInvalidator().GetTracking(); + return nullptr; } void SetUpHTML(PaintAndRasterInvalidationTest& test) { @@ -110,14 +96,11 @@ <div id="target"></div> )HTML"); auto* target = GetDocument().getElementById("target"); - auto& cc_layer = - RuntimeEnabledFeatures::CompositeAfterPaintEnabled() - ? *GetDocument() - .View() - ->GetPaintArtifactCompositor() - ->RootLayer() - ->children()[1] - : GetLayoutView().Layer()->GraphicsLayerBacking()->CcLayer(); + auto& cc_layer = *GetDocument() + .View() + ->GetPaintArtifactCompositor() + ->RootLayer() + ->children()[1]; { ScopedEnablePaintInvalidationTracing tracing; @@ -575,19 +558,11 @@ auto container_raster_invalidation_tracking = [&]() -> const RasterInvalidationTracking* { - if (RuntimeEnabledFeatures::CompositeAfterPaintEnabled()) - return GetRasterInvalidationTracking(1); - return target_obj->Layer() - ->GraphicsLayerBacking(target_obj) - ->GetRasterInvalidationTracking(); + return GetRasterInvalidationTracking(1); }; auto contents_raster_invalidation_tracking = [&]() -> const RasterInvalidationTracking* { - if (RuntimeEnabledFeatures::CompositeAfterPaintEnabled()) - return GetRasterInvalidationTracking(2); - return target_obj->Layer() - ->GraphicsLayerBacking() - ->GetRasterInvalidationTracking(); + return GetRasterInvalidationTracking(2); }; // Resize the content. @@ -635,19 +610,11 @@ auto* target_obj = To<LayoutBoxModelObject>(target->GetLayoutObject()); auto container_raster_invalidation_tracking = [&]() -> const RasterInvalidationTracking* { - if (RuntimeEnabledFeatures::CompositeAfterPaintEnabled()) - return GetRasterInvalidationTracking(1); - return target_obj->Layer() - ->GraphicsLayerBacking(target_obj) - ->GetRasterInvalidationTracking(); + return GetRasterInvalidationTracking(1); }; auto contents_raster_invalidation_tracking = [&]() -> const RasterInvalidationTracking* { - if (RuntimeEnabledFeatures::CompositeAfterPaintEnabled()) - return GetRasterInvalidationTracking(2); - return target_obj->Layer() - ->GraphicsLayerBacking() - ->GetRasterInvalidationTracking(); + return GetRasterInvalidationTracking(2); }; // Resize the content. @@ -744,11 +711,7 @@ target_object->GetBackgroundPaintLocation()); const auto* contents_raster_invalidation_tracking = - RuntimeEnabledFeatures::CompositeAfterPaintEnabled() - ? GetRasterInvalidationTracking(2) - : target_object->Layer() - ->GraphicsLayerBacking() - ->GetRasterInvalidationTracking(); + GetRasterInvalidationTracking(2); const auto& client = target_object->GetScrollableArea() ->GetScrollingBackgroundDisplayItemClient(); EXPECT_THAT(contents_raster_invalidation_tracking->Invalidations(), @@ -756,11 +719,7 @@ client.Id(), client.DebugName(), gfx::Rect(50, 0, 50, 500), PaintInvalidationReason::kIncremental})); const auto* container_raster_invalidation_tracking = - RuntimeEnabledFeatures::CompositeAfterPaintEnabled() - ? GetRasterInvalidationTracking(1) - : target_object->Layer() - ->GraphicsLayerBacking(target_object) - ->GetRasterInvalidationTracking(); + GetRasterInvalidationTracking(1); EXPECT_THAT( container_raster_invalidation_tracking->Invalidations(), UnorderedElementsAre(RasterInvalidationInfo{
diff --git a/third_party/blink/renderer/core/paint/paint_controller_paint_test.h b/third_party/blink/renderer/core/paint/paint_controller_paint_test.h index 060ef164..ce671821 100644 --- a/third_party/blink/renderer/core/paint/paint_controller_paint_test.h +++ b/third_party/blink/renderer/core/paint/paint_controller_paint_test.h
@@ -28,12 +28,7 @@ protected: LayoutView& GetLayoutView() const { return *GetDocument().GetLayoutView(); } PaintController& RootPaintController() const { - if (RuntimeEnabledFeatures::CompositeAfterPaintEnabled()) - return GetDocument().View()->GetPaintControllerForTesting(); - return GetLayoutView() - .Layer() - ->GraphicsLayerBacking() - ->GetPaintController(); + return GetDocument().View()->GetPaintControllerForTesting(); } void SetUp() override {
diff --git a/third_party/blink/renderer/core/paint/paint_layer.cc b/third_party/blink/renderer/core/paint/paint_layer.cc index 3a9292b..3613ba8 100644 --- a/third_party/blink/renderer/core/paint/paint_layer.cc +++ b/third_party/blink/renderer/core/paint/paint_layer.cc
@@ -109,9 +109,6 @@ namespace { -static CompositingQueryMode g_compositing_query_mode = - kCompositingQueriesAreOnlyAllowedInCertainDocumentLifecyclePhases; - #if defined(OS_LINUX) || defined(OS_CHROMEOS) struct SameSizeAsPaintLayer : GarbageCollected<PaintLayer>, DisplayItemClient { // The bit fields may fit into the machine word of DisplayItemClient which @@ -185,7 +182,6 @@ needs_position_update_(!IsRootLayer()), #endif has3d_transformed_descendant_(false), - should_isolate_composited_descendants_(false), self_needs_repaint_(false), descendant_needs_repaint_(false), needs_cull_rect_update_(false), @@ -203,14 +199,10 @@ backdrop_filter_on_effect_node_dirty_(false), has_filter_that_moves_pixels_(false), is_under_svg_hidden_container_(false), - descendant_has_direct_or_scrolling_compositing_reason_(false), - needs_compositing_layer_assignment_(false), - descendant_needs_compositing_layer_assignment_(false), has_self_painting_layer_descendant_(false), needs_reorder_overlay_overflow_controls_(false), static_inline_edge_(InlineEdge::kInlineStart), static_block_edge_(BlockEdge::kBlockStart), - needs_check_raster_invalidation_(false), #if DCHECK_IS_ON() layer_list_mutation_allowed_(true), #endif @@ -282,16 +274,6 @@ return true; } -PhysicalOffset PaintLayer::SubpixelAccumulation() const { - return rare_data_ ? rare_data_->subpixel_accumulation : PhysicalOffset(); -} - -void PaintLayer::SetSubpixelAccumulation(const PhysicalOffset& accumulation) { - DCHECK(!RuntimeEnabledFeatures::CompositeAfterPaintEnabled()); - if (rare_data_ || !accumulation.IsZero()) - EnsureRareData().subpixel_accumulation = accumulation; -} - void PaintLayer::UpdateLayerPositionsAfterLayout() { TRACE_EVENT0("blink,benchmark", "PaintLayer::updateLayerPositionsAfterLayout"); @@ -950,8 +932,6 @@ } PaintLayer* PaintLayer::EnclosingLayerForPaintInvalidation() const { - DCHECK(IsAllowedToQueryCompositingState()); - if (IsPaintInvalidationContainer()) return const_cast<PaintLayer*>(this); @@ -1020,16 +1000,6 @@ Compositor()->SetNeedsCompositingUpdate(kCompositingUpdateRebuildTree); } -void PaintLayer::SetNeedsCheckRasterInvalidation() { - DCHECK_EQ(GetLayoutObject().GetDocument().Lifecycle().GetState(), - DocumentLifecycle::kInPrePaint); - needs_check_raster_invalidation_ = true; - // We need to mark |this| as needing layer assignment also, because - // CompositingLayerAssigner is where we transfer the raster invalidation - // checking bit from PaintLayer to GraphicsLayer. - SetNeedsCompositingLayerAssignment(); -} - void PaintLayer::SetNeedsVisualOverflowRecalc() { DCHECK(IsSelfPaintingLayer()); #if DCHECK_IS_ON() @@ -1062,16 +1032,6 @@ return false; } -void PaintLayer::SetShouldIsolateCompositedDescendants( - bool should_isolate_composited_descendants) { - if (should_isolate_composited_descendants_ == - static_cast<unsigned>(should_isolate_composited_descendants)) - return; - - should_isolate_composited_descendants_ = - should_isolate_composited_descendants; -} - bool PaintLayer::HasAncestorWithFilterThatMovesPixels() const { for (const PaintLayer* curr = this; curr; curr = curr->Parent()) { if (curr->HasFilterThatMovesPixels()) @@ -2312,24 +2272,6 @@ return GetLayoutObject().IsSVGForeignObject(); } -void PaintLayer::SetNeedsCompositingLayerAssignment() { - needs_compositing_layer_assignment_ = true; - PropagateDescendantNeedsCompositingLayerAssignment(); -} - -void PaintLayer::PropagateDescendantNeedsCompositingLayerAssignment() { - for (PaintLayer* curr = CompositingContainer(); - curr && !curr->StackingDescendantNeedsCompositingLayerAssignment(); - curr = curr->CompositingContainer()) { - curr->descendant_needs_compositing_layer_assignment_ = true; - } -} - -void PaintLayer::ClearNeedsCompositingLayerAssignment() { - needs_compositing_layer_assignment_ = false; - descendant_needs_compositing_layer_assignment_ = false; -} - PaintLayer* PaintLayer::HitTestChildren( PaintLayerIteration children_to_visit, const PaintLayer& transform_container, @@ -2778,38 +2720,6 @@ return result; } -bool PaintLayer::IsAllowedToQueryCompositingState() const { - if (g_compositing_query_mode == kCompositingQueriesAreAllowed || - RuntimeEnabledFeatures::CompositeAfterPaintEnabled()) - return true; - if (!GetLayoutObject().GetFrameView()->IsUpdatingLifecycle()) - return true; - return GetLayoutObject().GetDocument().Lifecycle().GetState() >= - DocumentLifecycle::kInCompositingAssignmentsUpdate; -} - -bool PaintLayer::IsAllowedToQueryCompositingInputs() const { - if (g_compositing_query_mode == kCompositingQueriesAreAllowed || - RuntimeEnabledFeatures::CompositeAfterPaintEnabled()) - return true; - return GetLayoutObject().GetDocument().Lifecycle().GetState() >= - DocumentLifecycle::kCompositingInputsClean; -} - -GraphicsLayer* PaintLayer::GraphicsLayerBacking(const LayoutObject* obj) const { - switch (GetCompositingState()) { - case kNotComposited: - return nullptr; - case kPaintsIntoGroupedBacking: - return GroupedMapping()->SquashingLayer(*this); - default: - return (obj != &GetLayoutObject() && - GetCompositedLayerMapping()->ScrollingContentsLayer()) - ? GetCompositedLayerMapping()->ScrollingContentsLayer() - : GetCompositedLayerMapping()->MainGraphicsLayer(); - } -} - bool PaintLayer::NeedsCompositedScrolling() const { return scrollable_area_ && scrollable_area_->NeedsCompositedScrolling(); }
diff --git a/third_party/blink/renderer/core/paint/paint_layer.h b/third_party/blink/renderer/core/paint/paint_layer.h index 9100192e..4501490 100644 --- a/third_party/blink/renderer/core/paint/paint_layer.h +++ b/third_party/blink/renderer/core/paint/paint_layer.h
@@ -78,15 +78,8 @@ class ScrollingCoordinator; class TransformationMatrix; -using PaintLayerId = uint64_t; - enum IncludeSelfOrNot { kIncludeSelf, kExcludeSelf }; -enum CompositingQueryMode { - kCompositingQueriesAreAllowed, - kCompositingQueriesAreOnlyAllowedInCertainDocumentLifecyclePhases -}; - // Used in PaintLayerPaintOrderIterator. enum PaintLayerIteration { kNegativeZOrderChildren = 1, @@ -133,10 +126,6 @@ Member<PaintLayer> enclosing_pagination_layer; Member<PaintLayerResourceInfo> resource_info; - - // The accumulated subpixel offset of a composited layer's composited bounds - // compared to absolute coordinates. - PhysicalOffset subpixel_accumulation; }; // PaintLayer is an old object that handles lots of unrelated operations. @@ -481,8 +470,10 @@ return position; } - PhysicalOffset SubpixelAccumulation() const; - void SetSubpixelAccumulation(const PhysicalOffset&); + PhysicalOffset SubpixelAccumulation() const { + // TODO(pdr): Remove this. + return PhysicalOffset(); + } bool HasTransformRelatedProperty() const { return GetLayoutObject().HasTransformRelatedProperty(); @@ -524,26 +515,11 @@ return kNotComposited; } - // This returns true if our document is in a phase of its lifestyle during - // which compositing state may legally be read. - bool IsAllowedToQueryCompositingState() const; - - bool IsAllowedToQueryCompositingInputs() const; - CompositedLayerMapping* GetCompositedLayerMapping() const { // TODO(pdr): Remove this. return nullptr; } - // Returns the GraphicsLayer owned by this PaintLayer's - // CompositedLayerMapping (or groupedMapping()'s, if squashed), - // into which the given LayoutObject paints. If null, assumes the - // LayoutObject is *not* layoutObject(). - // Assumes that the given LayoutObject paints into one of the GraphicsLayers - // associated with this PaintLayer. - // Returns nullptr if this PaintLayer is not composited. - GraphicsLayer* GraphicsLayerBacking(const LayoutObject* = nullptr) const; - bool HasCompositedLayerMapping() const { // TODO(pdr): Remove this. return false; @@ -674,15 +650,6 @@ // layer tree. void SetNeedsGraphicsLayerRebuild(); - // Mark this PaintLayer as needing raster invalidation checking after the - // next compositing update step. - void SetNeedsCheckRasterInvalidation(); - bool NeedsCheckRasterInvalidation() const { - return needs_check_raster_invalidation_; - } - void ClearNeedsCheckRasterInvalidation() { - needs_check_raster_invalidation_ = false; - } void UpdateAncestorScrollContainerLayer( const PaintLayer* ancestor_scroll_container_layer) { ancestor_scroll_container_layer_ = ancestor_scroll_container_layer; @@ -750,12 +717,6 @@ return SquashingDisallowedReason::kNone; } - bool ShouldIsolateCompositedDescendants() const { - DCHECK(IsAllowedToQueryCompositingState()); - return should_isolate_composited_descendants_; - } - void SetShouldIsolateCompositedDescendants(bool); - void UpdateDescendantDependentFlags(); void UpdateSelfPaintingLayer(); @@ -849,13 +810,6 @@ needs_paint_phase_float_ = true; } - bool DescendantHasDirectOrScrollingCompositingReason() const { - return descendant_has_direct_or_scrolling_compositing_reason_; - } - void SetDescendantHasDirectOrScrollingCompositingReason(bool value) { - descendant_has_direct_or_scrolling_compositing_reason_ = value; - } - bool Has3DTransformedDescendant() const { DCHECK(!needs_descendant_dependent_flags_update_); return has3d_transformed_descendant_; @@ -883,13 +837,6 @@ void ClearNeedsCompositingLayerAssignment(); void PropagateDescendantNeedsCompositingLayerAssignment(); - bool NeedsCompositingLayerAssignment() const { - return needs_compositing_layer_assignment_; - } - bool StackingDescendantNeedsCompositingLayerAssignment() const { - return descendant_needs_compositing_layer_assignment_; - } - void DirtyStackingContextZOrderLists(); PhysicalOffset OffsetForInFlowRelPosition() const { @@ -1087,9 +1034,6 @@ // in a preserves3D hierarchy. Hint to do 3D-aware hit testing. unsigned has3d_transformed_descendant_ : 1; - // Should be for stacking contexts having unisolated blending descendants. - unsigned should_isolate_composited_descendants_ : 1; - unsigned self_needs_repaint_ : 1; unsigned descendant_needs_repaint_ : 1; @@ -1127,19 +1071,12 @@ // ancestor. unsigned is_under_svg_hidden_container_ : 1; - unsigned descendant_has_direct_or_scrolling_compositing_reason_ : 1; - - unsigned needs_compositing_layer_assignment_ : 1; - unsigned descendant_needs_compositing_layer_assignment_ : 1; - unsigned has_self_painting_layer_descendant_ : 1; unsigned needs_reorder_overlay_overflow_controls_ : 1; unsigned static_inline_edge_ : 2; unsigned static_block_edge_ : 2; - unsigned needs_check_raster_invalidation_ : 1; - #if DCHECK_IS_ON() mutable unsigned layer_list_mutation_allowed_ : 1; bool is_destroyed_ = false;
diff --git a/third_party/blink/renderer/core/paint/paint_layer_painter_test.cc b/third_party/blink/renderer/core/paint/paint_layer_painter_test.cc index f25e767..5947d5b 100644 --- a/third_party/blink/renderer/core/paint/paint_layer_painter_test.cc +++ b/third_party/blink/renderer/core/paint/paint_layer_painter_test.cc
@@ -23,13 +23,6 @@ USING_FAST_MALLOC(PaintLayerPainterTest); public: - PaintController& MainGraphicsLayerPaintController() { - return GetLayoutView() - .Layer() - ->GraphicsLayerBacking(&GetLayoutView()) - ->GetPaintController(); - } - CullRect GetCullRect(const PaintLayer& layer) { if (RuntimeEnabledFeatures::CullRectUpdateEnabled()) return layer.GetLayoutObject().FirstFragment().GetCullRect();
diff --git a/third_party/blink/renderer/core/paint/paint_layer_scrollable_area_test.cc b/third_party/blink/renderer/core/paint/paint_layer_scrollable_area_test.cc index 96c0297f..93125ee 100644 --- a/third_party/blink/renderer/core/paint/paint_layer_scrollable_area_test.cc +++ b/third_party/blink/renderer/core/paint/paint_layer_scrollable_area_test.cc
@@ -95,24 +95,9 @@ return false; } - if (!RuntimeEnabledFeatures::CompositeAfterPaintEnabled()) { - DCHECK_EQ(composited, layer->NeedsCompositedScrolling()); - DCHECK_EQ(composited, scrollable_area->NeedsCompositedScrolling()); - if (composited) - DCHECK(layer->GraphicsLayerBacking()); - } return composited; } - bool GraphicsLayerContentsOpaque(const LayoutObject* scroller) { - DCHECK(!RuntimeEnabledFeatures::CompositeAfterPaintEnabled()); - return To<LayoutBoxModelObject>(scroller) - ->Layer() - ->GraphicsLayerBacking() - ->CcLayer() - .contents_opaque(); - } - private: void SetUp() override { EnableCompositing(); @@ -137,8 +122,6 @@ auto* scroller = GetLayoutObjectByElementId("scroller"); EXPECT_TRUE(UsesCompositedScrolling(scroller)); - if (!RuntimeEnabledFeatures::CompositeAfterPaintEnabled()) - EXPECT_TRUE(GraphicsLayerContentsOpaque(scroller)); } TEST_P(PaintLayerScrollableAreaTest, NonStackingContextScrollerPromoted) { @@ -212,8 +195,6 @@ "background: white local content-box;"); UpdateAllLifecyclePhasesForTest(); EXPECT_TRUE(UsesCompositedScrolling(scroller->GetLayoutObject())); - if (!RuntimeEnabledFeatures::CompositeAfterPaintEnabled()) - EXPECT_TRUE(GraphicsLayerContentsOpaque(scroller->GetLayoutObject())); } // Tests that a transform on the scroller or an ancestor doesn't prevent @@ -234,8 +215,6 @@ Element* parent = GetDocument().getElementById("parent"); Element* scroller = GetDocument().getElementById("scroller"); EXPECT_TRUE(UsesCompositedScrolling(scroller->GetLayoutObject())); - if (!RuntimeEnabledFeatures::CompositeAfterPaintEnabled()) - EXPECT_TRUE(GraphicsLayerContentsOpaque(scroller->GetLayoutObject())); // Change the parent to have a transform. parent->setAttribute(html_names::kStyleAttr, "transform: translate(1px, 0);"); @@ -246,8 +225,6 @@ parent->removeAttribute(html_names::kStyleAttr); UpdateAllLifecyclePhasesForTest(); EXPECT_TRUE(UsesCompositedScrolling(scroller->GetLayoutObject())); - if (!RuntimeEnabledFeatures::CompositeAfterPaintEnabled()) - EXPECT_TRUE(GraphicsLayerContentsOpaque(scroller->GetLayoutObject())); // Apply a transform to the scroller directly. scroller->setAttribute(html_names::kStyleAttr, @@ -272,8 +249,6 @@ Element* parent = GetDocument().getElementById("parent"); Element* scroller = GetDocument().getElementById("scroller"); EXPECT_TRUE(UsesCompositedScrolling(scroller->GetLayoutObject())); - if (!RuntimeEnabledFeatures::CompositeAfterPaintEnabled()) - EXPECT_TRUE(GraphicsLayerContentsOpaque(scroller->GetLayoutObject())); // Change the parent to be partially translucent. parent->setAttribute(html_names::kStyleAttr, "opacity: 0.5;"); @@ -284,8 +259,6 @@ parent->setAttribute(html_names::kStyleAttr, "opacity: 1;"); UpdateAllLifecyclePhasesForTest(); EXPECT_TRUE(UsesCompositedScrolling(scroller->GetLayoutObject())); - if (!RuntimeEnabledFeatures::CompositeAfterPaintEnabled()) - EXPECT_TRUE(GraphicsLayerContentsOpaque(scroller->GetLayoutObject())); // Make the scroller translucent. scroller->setAttribute(html_names::kStyleAttr, "opacity: 0.5");
diff --git a/third_party/blink/renderer/platform/runtime_enabled_features.json5 b/third_party/blink/renderer/platform/runtime_enabled_features.json5 index a9d40c2..dc4fb019 100644 --- a/third_party/blink/renderer/platform/runtime_enabled_features.json5 +++ b/third_party/blink/renderer/platform/runtime_enabled_features.json5
@@ -1211,7 +1211,7 @@ }, { name: "HTMLInputElementShowPicker", - status: "experimental", + status: "stable", }, { name: "HTMLPopupElement",
diff --git a/third_party/blink/tools/blinkpy/web_tests/port/fuchsia.py b/third_party/blink/tools/blinkpy/web_tests/port/fuchsia.py index a31b0584..a6a5b59 100644 --- a/third_party/blink/tools/blinkpy/web_tests/port/fuchsia.py +++ b/third_party/blink/tools/blinkpy/web_tests/port/fuchsia.py
@@ -64,6 +64,8 @@ # pylint: disable=redefined-outer-name global aemu_target import aemu_target + global ConnectPortForwardingTask + from common import ConnectPortForwardingTask global _GetPathToBuiltinTarget, _LoadTargetClass from common_args import _GetPathToBuiltinTarget, _LoadTargetClass global device_target @@ -182,6 +184,9 @@ if self._target: self._target.Stop() + def setup_forwarded_port(self, port): + return ConnectPortForwardingTask(self._target, port) + class FuchsiaPort(base.Port): port_name = 'fuchsia' @@ -210,7 +215,6 @@ self._target_host = self.get_option('fuchsia_target') self._zircon_logger = None - self._host_ip = self.get_option('fuchsia_host_ip') _import_fuchsia_runner() def _driver_class(self): @@ -257,7 +261,8 @@ hardware_gpu=False, with_network=False, logs_dir=self.results_directory(), - custom_image=None) + custom_image=None, + system_image_dir=None) target = _LoadTargetClass( _GetPathToBuiltinTarget( self._target_device)).CreateFromArgs(target_args) @@ -339,8 +344,7 @@ server_name, cmd_line, environment, - more_logging=self._port.get_option('driver_logging'), - host_ip=self._port._host_ip) + more_logging=self._port.get_option('driver_logging')) def _base_cmd_line(self): cmd = [ @@ -379,12 +383,10 @@ cmd, env=None, treat_no_data_as_crash=False, - more_logging=False, - host_ip=None): + more_logging=False): super(FuchsiaServerProcess, self).__init__( port_obj, name, cmd, env, treat_no_data_as_crash, more_logging) self._symbolizer_proc = None - self._host_ip = host_ip or qemu_target.HOST_IP_ADDRESS def _start(self): if self._proc: @@ -393,18 +395,20 @@ # Fuchsia doesn't support stdin stream for packaged applications, so the # stdin stream for content_shell is routed through a separate TCP - # socket. Open a local socket and then pass the address with the port as - # --stdin-redirect parameter. content_shell will connect to this address - # and will use that connection as its stdin stream. + # socket. The socket is reverse-forwarded from the device to the script + # over SSH. listen_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) listen_socket.bind(('127.0.0.1', 0)) listen_socket.listen(1) - stdin_port = listen_socket.getsockname()[1] + stdin_port = int(listen_socket.getsockname()[1]) + forwarded_stdin_port = \ + self._port.get_target_host().setup_forwarded_port(stdin_port) command = ['%s=%s' % (k, v) for k, v in self._env.items()] + \ self._cmd + \ - ['--no-sandbox', '--stdin-redirect=%s:%s' % - (self._host_ip, stdin_port)] + ['--no-sandbox', '--stdin-redirect=127.0.0.1:%d' % + (forwarded_stdin_port)] + proc = self._port.get_target_host().run_command(command) # Wait for incoming connection from content_shell. fd = listen_socket.fileno()
diff --git a/third_party/blink/web_tests/TestExpectations b/third_party/blink/web_tests/TestExpectations index 4d7d4464..873e369 100644 --- a/third_party/blink/web_tests/TestExpectations +++ b/third_party/blink/web_tests/TestExpectations
@@ -104,9 +104,6 @@ # These tests either fail outright, or become flaky, when these two flags/parameters are enabled: # --enable-features=ForceSynchronousHTMLParsing,LoaderDataPipeTuning:allocation_size_bytes/2097152/loader_chunk_size/1048576 -# app-history tests - fail: -crbug.com/1254926 external/wpt/app-history/navigate/navigate-same-document-event-order.html [ Failure ] - # Extra line info appears in the output in some cases. crbug.com/1254932 http/tests/preload/meta-csp.html [ Failure ] @@ -2815,7 +2812,24 @@ crbug.com/626703 [ Fuchsia ] external/wpt/dom/historical.html [ Skip ] # ====== New tests from wpt-importer added here ====== -crbug.com/626703 [ Mac11-arm64 ] external/wpt/css/css-sizing/table-child-percentage-height-with-border-box.html [ Failure ] +crbug.com/626703 external/wpt/css/css-color/display-p3-001.html [ Failure ] +crbug.com/626703 external/wpt/css/css-color/display-p3-002.html [ Failure ] +crbug.com/626703 external/wpt/css/css-color/display-p3-003.html [ Failure ] +crbug.com/626703 external/wpt/css/css-color/display-p3-004.html [ Failure ] +crbug.com/626703 external/wpt/css/css-color/display-p3-005.html [ Failure ] +crbug.com/626703 external/wpt/css/css-color/display-p3-006.html [ Failure ] +crbug.com/626703 virtual/system-color-compute/external/wpt/css/css-color/display-p3-001.html [ Failure ] +crbug.com/626703 virtual/system-color-compute/external/wpt/css/css-color/display-p3-002.html [ Failure ] +crbug.com/626703 [ Linux ] virtual/system-color-compute/external/wpt/css/css-color/display-p3-003.html [ Failure ] +crbug.com/626703 [ Mac10.12 ] virtual/system-color-compute/external/wpt/css/css-color/display-p3-003.html [ Failure ] +crbug.com/626703 [ Mac10.13 ] virtual/system-color-compute/external/wpt/css/css-color/display-p3-003.html [ Failure ] +crbug.com/626703 [ Mac10.14 ] virtual/system-color-compute/external/wpt/css/css-color/display-p3-003.html [ Failure ] +crbug.com/626703 [ Mac10.15 ] virtual/system-color-compute/external/wpt/css/css-color/display-p3-003.html [ Failure ] +crbug.com/626703 [ Mac11 ] virtual/system-color-compute/external/wpt/css/css-color/display-p3-003.html [ Failure ] +crbug.com/626703 [ Win ] virtual/system-color-compute/external/wpt/css/css-color/display-p3-003.html [ Failure ] +crbug.com/626703 virtual/system-color-compute/external/wpt/css/css-color/display-p3-004.html [ Failure ] +crbug.com/626703 virtual/system-color-compute/external/wpt/css/css-color/display-p3-005.html [ Failure ] +crbug.com/626703 virtual/system-color-compute/external/wpt/css/css-color/display-p3-006.html [ Failure ] crbug.com/626703 [ Mac11-arm64 ] external/wpt/fetch/api/basic/status.h2.any.worker.html [ Timeout ] crbug.com/626703 [ Mac11-arm64 ] external/wpt/infrastructure/server/http2-websocket.sub.h2.any.worker.html [ Timeout ] crbug.com/626703 [ Mac11-arm64 ] external/wpt/websockets/Close-1000-reason.any.worker.html?wpt_flags=h2 [ Timeout ] @@ -2833,13 +2847,6 @@ crbug.com/626703 [ Mac11-arm64 ] external/wpt/css/css-color/color-contrast-001.html [ Failure ] crbug.com/626703 [ Mac11-arm64 ] external/wpt/css/css-color/xyz-d50-004.html [ Failure ] crbug.com/626703 [ Mac11-arm64 ] external/wpt/css/css-color/xyz-d65-004.html [ Failure ] -crbug.com/626703 [ Linux ] external/wpt/css/css-sizing/table-child-percentage-height-with-border-box.html [ Failure ] -crbug.com/626703 [ Mac10.12 ] external/wpt/css/css-sizing/table-child-percentage-height-with-border-box.html [ Failure ] -crbug.com/626703 [ Mac10.13 ] external/wpt/css/css-sizing/table-child-percentage-height-with-border-box.html [ Failure ] -crbug.com/626703 [ Mac10.14 ] external/wpt/css/css-sizing/table-child-percentage-height-with-border-box.html [ Failure ] -crbug.com/626703 [ Mac10.15 ] external/wpt/css/css-sizing/table-child-percentage-height-with-border-box.html [ Failure ] -crbug.com/626703 [ Mac11 ] external/wpt/css/css-sizing/table-child-percentage-height-with-border-box.html [ Failure ] -crbug.com/626703 [ Win ] external/wpt/css/css-sizing/table-child-percentage-height-with-border-box.html [ Failure ] crbug.com/626703 [ Mac11-arm64 ] external/wpt/css/css-text-decor/text-emphasis-color-property-001a.html [ Failure ] crbug.com/626703 [ Mac11-arm64 ] external/wpt/css/css-text-decor/text-emphasis-color-property-002.html [ Failure ] crbug.com/626703 [ Mac11-arm64 ] external/wpt/css/css-text-decor/text-emphasis-line-height-001b.html [ Failure ] @@ -3844,7 +3851,7 @@ crbug.com/626703 [ Mac10.15 ] virtual/web-bluetooth-new-permissions-backend/external/wpt/bluetooth/characteristic/writeValue/write-succeeds.https.window.html [ Timeout ] crbug.com/626703 [ Mac10.15 ] virtual/web-bluetooth-new-permissions-backend/external/wpt/bluetooth/requestDevice/canonicalizeFilter/empty-services-member.https.window.html [ Timeout ] crbug.com/626703 [ Mac11 ] virtual/web-bluetooth-new-permissions-backend/external/wpt/bluetooth/requestDevice/canonicalizeFilter/max-length-name-unicode.https.window.html [ Crash ] -crbug.com/626703 [ Mac10.15 ] virtual/web-bluetooth-new-permissions-backend/external/wpt/bluetooth/service/getCharacteristics/characteristics-found-with-uuid.https.html [ Timeout ] +crbug.com/626703 [ Mac10.15 ] virtual/web-bluetooth-new-permissions-backend/external/wpt/bluetooth/service/getCharacteristics/characteristics-found-with-uuid.https.window.html [ Timeout ] crbug.com/626703 [ Mac10.15 ] virtual/web-bluetooth-new-permissions-backend/external/wpt/bluetooth/service/getCharacteristics/gen-reconnect-during-with-uuid.https.window.html [ Timeout ] crbug.com/626703 [ Mac10.15 ] virtual/web-bluetooth-new-permissions-backend/wpt_internal/bluetooth/characteristic/getDescriptors/gen-descriptor-disconnect-called-during-error-with-uuid.https.html [ Timeout ] crbug.com/626703 [ Mac10.15 ] virtual/web-bluetooth-new-permissions-backend/wpt_internal/bluetooth/characteristic/getDescriptors/gen-descriptor-garbage-collection-ran-during-success.https.html [ Timeout ]
diff --git a/third_party/blink/web_tests/accessibility/accessibility-beforematch-marker-crash.html b/third_party/blink/web_tests/accessibility/accessibility-beforematch-marker-crash.html index d0234299..11498ec 100644 --- a/third_party/blink/web_tests/accessibility/accessibility-beforematch-marker-crash.html +++ b/third_party/blink/web_tests/accessibility/accessibility-beforematch-marker-crash.html
@@ -1,20 +1,16 @@ <!DOCTYPE html> <script src="../resources/testharness.js"></script> <script src="../resources/testharnessreport.js"></script> -<style> -.hidden-matchable { - content-visibility: hidden-matchable; -} -</style> -<li id=hiddenli class=hidden-matchable> +<li id=hiddenli hidden=until-found> <a id><a><div id=hiddentext>hiddentext</div> </li> <script> const testCase = async_test('Regression test for crbug.com/1250959 should not crash'); -hiddentext.addEventListener('beforematch', testCase.step_func(() => { +hiddenli.addEventListener('beforematch', testCase.step_func(() => { + hiddenli.setAttribute('hidden', 'until-found'); setTimeout(testCase.step_func_done(() => { - hiddenli.classList.remove('hidden-matchable'); + hiddenli.removeAttribute('hidden'); })); }));
diff --git a/third_party/blink/web_tests/android/ChromeWPTOverrideExpectations b/third_party/blink/web_tests/android/ChromeWPTOverrideExpectations index 843adcb0..fa5feb01 100644 --- a/third_party/blink/web_tests/android/ChromeWPTOverrideExpectations +++ b/third_party/blink/web_tests/android/ChromeWPTOverrideExpectations
@@ -487,9 +487,9 @@ crbug.com/1050754 external/wpt/bluetooth/server/getPrimaryServices/services-found-with-uuid.https.window.html [ Failure ] crbug.com/1050754 external/wpt/bluetooth/server/getPrimaryServices/services-found.https.window.html [ Failure ] crbug.com/1050754 external/wpt/bluetooth/server/getPrimaryServices/services-not-found.https.window.html [ Failure ] -crbug.com/1050754 external/wpt/bluetooth/service/device-same-from-2-services.https.html [ Failure ] -crbug.com/1050754 external/wpt/bluetooth/service/device-same-object.https.html [ Failure ] -crbug.com/1050754 external/wpt/bluetooth/service/getCharacteristic/characteristic-found.https.html [ Failure ] +crbug.com/1050754 external/wpt/bluetooth/service/device-same-from-2-services.https.window.html [ Failure ] +crbug.com/1050754 external/wpt/bluetooth/service/device-same-object.https.window.html [ Failure ] +crbug.com/1050754 external/wpt/bluetooth/service/getCharacteristic/characteristic-found.https.window.html [ Failure ] crbug.com/1050754 external/wpt/bluetooth/service/getCharacteristic/gen-blocklisted-characteristic.https.window.html [ Failure ] crbug.com/1050754 external/wpt/bluetooth/service/getCharacteristic/gen-characteristic-not-found.https.window.html [ Failure ] crbug.com/1050754 external/wpt/bluetooth/service/getCharacteristic/gen-garbage-collection-ran-during-error.https.window.html [ Failure ] @@ -497,10 +497,10 @@ crbug.com/1050754 external/wpt/bluetooth/service/getCharacteristic/gen-invalid-characteristic-name.https.window.html [ Failure ] crbug.com/1050754 external/wpt/bluetooth/service/getCharacteristic/gen-reconnect-during.https.window.html [ Failure ] crbug.com/1050754 external/wpt/bluetooth/service/getCharacteristic/gen-service-is-removed.https.window.html [ Failure ] -crbug.com/1050754 external/wpt/bluetooth/service/getCharacteristics/blocklisted-characteristics.https.html [ Failure ] -crbug.com/1050754 external/wpt/bluetooth/service/getCharacteristics/characteristics-found-with-uuid.https.html [ Failure ] -crbug.com/1050754 external/wpt/bluetooth/service/getCharacteristics/characteristics-found.https.html [ Failure ] -crbug.com/1050754 external/wpt/bluetooth/service/getCharacteristics/characteristics-not-found.https.html [ Failure ] +crbug.com/1050754 external/wpt/bluetooth/service/getCharacteristics/blocklisted-characteristics.https.window.html [ Failure ] +crbug.com/1050754 external/wpt/bluetooth/service/getCharacteristics/characteristics-found-with-uuid.https.window.html [ Failure ] +crbug.com/1050754 external/wpt/bluetooth/service/getCharacteristics/characteristics-found.https.window.html [ Failure ] +crbug.com/1050754 external/wpt/bluetooth/service/getCharacteristics/characteristics-not-found.https.window.html [ Failure ] crbug.com/1050754 external/wpt/bluetooth/service/getCharacteristics/gen-blocklisted-characteristic-with-uuid.https.window.html [ Failure ] crbug.com/1050754 external/wpt/bluetooth/service/getCharacteristics/gen-characteristic-not-found-with-uuid.https.window.html [ Failure ] crbug.com/1050754 external/wpt/bluetooth/service/getCharacteristics/gen-garbage-collection-ran-during-error-with-uuid.https.window.html [ Failure ]
diff --git a/third_party/blink/web_tests/android/WebLayerWPTOverrideExpectations b/third_party/blink/web_tests/android/WebLayerWPTOverrideExpectations index f624940..7e3e98dd 100644 --- a/third_party/blink/web_tests/android/WebLayerWPTOverrideExpectations +++ b/third_party/blink/web_tests/android/WebLayerWPTOverrideExpectations
@@ -556,9 +556,9 @@ crbug.com/1050754 external/wpt/bluetooth/server/getPrimaryServices/services-found-with-uuid.https.window.html [ Failure ] crbug.com/1050754 external/wpt/bluetooth/server/getPrimaryServices/services-found.https.window.html [ Failure ] crbug.com/1050754 external/wpt/bluetooth/server/getPrimaryServices/services-not-found.https.window.html [ Failure ] -crbug.com/1050754 external/wpt/bluetooth/service/device-same-from-2-services.https.html [ Failure ] -crbug.com/1050754 external/wpt/bluetooth/service/device-same-object.https.html [ Failure ] -crbug.com/1050754 external/wpt/bluetooth/service/getCharacteristic/characteristic-found.https.html [ Failure ] +crbug.com/1050754 external/wpt/bluetooth/service/device-same-from-2-services.https.window.html [ Failure ] +crbug.com/1050754 external/wpt/bluetooth/service/device-same-object.https.window.html [ Failure ] +crbug.com/1050754 external/wpt/bluetooth/service/getCharacteristic/characteristic-found.https.window.html [ Failure ] crbug.com/1050754 external/wpt/bluetooth/service/getCharacteristic/gen-blocklisted-characteristic.https.window.html [ Failure ] crbug.com/1050754 external/wpt/bluetooth/service/getCharacteristic/gen-characteristic-not-found.https.window.html [ Failure ] crbug.com/1050754 external/wpt/bluetooth/service/getCharacteristic/gen-garbage-collection-ran-during-error.https.window.html [ Failure ] @@ -566,10 +566,10 @@ crbug.com/1050754 external/wpt/bluetooth/service/getCharacteristic/gen-invalid-characteristic-name.https.window.html [ Failure ] crbug.com/1050754 external/wpt/bluetooth/service/getCharacteristic/gen-reconnect-during.https.window.html [ Failure ] crbug.com/1050754 external/wpt/bluetooth/service/getCharacteristic/gen-service-is-removed.https.window.html [ Failure ] -crbug.com/1050754 external/wpt/bluetooth/service/getCharacteristics/blocklisted-characteristics.https.html [ Failure ] -crbug.com/1050754 external/wpt/bluetooth/service/getCharacteristics/characteristics-found-with-uuid.https.html [ Failure ] -crbug.com/1050754 external/wpt/bluetooth/service/getCharacteristics/characteristics-found.https.html [ Failure ] -crbug.com/1050754 external/wpt/bluetooth/service/getCharacteristics/characteristics-not-found.https.html [ Failure ] +crbug.com/1050754 external/wpt/bluetooth/service/getCharacteristics/blocklisted-characteristics.https.window.html [ Failure ] +crbug.com/1050754 external/wpt/bluetooth/service/getCharacteristics/characteristics-found-with-uuid.https.window.html [ Failure ] +crbug.com/1050754 external/wpt/bluetooth/service/getCharacteristics/characteristics-found.https.window.html [ Failure ] +crbug.com/1050754 external/wpt/bluetooth/service/getCharacteristics/characteristics-not-found.https.window.html [ Failure ] crbug.com/1050754 external/wpt/bluetooth/service/getCharacteristics/gen-blocklisted-characteristic-with-uuid.https.window.html [ Failure ] crbug.com/1050754 external/wpt/bluetooth/service/getCharacteristics/gen-characteristic-not-found-with-uuid.https.window.html [ Failure ] crbug.com/1050754 external/wpt/bluetooth/service/getCharacteristics/gen-garbage-collection-ran-during-error-with-uuid.https.window.html [ Failure ]
diff --git a/third_party/blink/web_tests/android/WebviewWPTExpectations b/third_party/blink/web_tests/android/WebviewWPTExpectations index ee651a8..56fe9fa 100644 --- a/third_party/blink/web_tests/android/WebviewWPTExpectations +++ b/third_party/blink/web_tests/android/WebviewWPTExpectations
@@ -445,9 +445,9 @@ crbug.com/1050754 external/wpt/bluetooth/server/getPrimaryServices/services-found-with-uuid.https.window.html [ Failure ] crbug.com/1050754 external/wpt/bluetooth/server/getPrimaryServices/services-found.https.window.html [ Failure ] crbug.com/1050754 external/wpt/bluetooth/server/getPrimaryServices/services-not-found.https.window.html [ Failure ] -crbug.com/1050754 external/wpt/bluetooth/service/device-same-from-2-services.https.html [ Failure ] -crbug.com/1050754 external/wpt/bluetooth/service/device-same-object.https.html [ Failure ] -crbug.com/1050754 external/wpt/bluetooth/service/getCharacteristic/characteristic-found.https.html [ Failure ] +crbug.com/1050754 external/wpt/bluetooth/service/device-same-from-2-services.https.window.html [ Failure ] +crbug.com/1050754 external/wpt/bluetooth/service/device-same-object.https.window.html [ Failure ] +crbug.com/1050754 external/wpt/bluetooth/service/getCharacteristic/characteristic-found.https.window.html [ Failure ] crbug.com/1050754 external/wpt/bluetooth/service/getCharacteristic/gen-blocklisted-characteristic.https.window.html [ Failure ] crbug.com/1050754 external/wpt/bluetooth/service/getCharacteristic/gen-characteristic-not-found.https.window.html [ Failure ] crbug.com/1050754 external/wpt/bluetooth/service/getCharacteristic/gen-garbage-collection-ran-during-error.https.window.html [ Failure ] @@ -455,10 +455,10 @@ crbug.com/1050754 external/wpt/bluetooth/service/getCharacteristic/gen-invalid-characteristic-name.https.window.html [ Failure ] crbug.com/1050754 external/wpt/bluetooth/service/getCharacteristic/gen-reconnect-during.https.window.html [ Failure ] crbug.com/1050754 external/wpt/bluetooth/service/getCharacteristic/gen-service-is-removed.https.window.html [ Failure ] -crbug.com/1050754 external/wpt/bluetooth/service/getCharacteristics/blocklisted-characteristics.https.html [ Failure ] -crbug.com/1050754 external/wpt/bluetooth/service/getCharacteristics/characteristics-found-with-uuid.https.html [ Failure ] -crbug.com/1050754 external/wpt/bluetooth/service/getCharacteristics/characteristics-found.https.html [ Failure ] -crbug.com/1050754 external/wpt/bluetooth/service/getCharacteristics/characteristics-not-found.https.html [ Failure ] +crbug.com/1050754 external/wpt/bluetooth/service/getCharacteristics/blocklisted-characteristics.https.window.html [ Failure ] +crbug.com/1050754 external/wpt/bluetooth/service/getCharacteristics/characteristics-found-with-uuid.https.window.html [ Failure ] +crbug.com/1050754 external/wpt/bluetooth/service/getCharacteristics/characteristics-found.https.window.html [ Failure ] +crbug.com/1050754 external/wpt/bluetooth/service/getCharacteristics/characteristics-not-found.https.window.html [ Failure ] crbug.com/1050754 external/wpt/bluetooth/service/getCharacteristics/gen-blocklisted-characteristic-with-uuid.https.window.html [ Failure ] crbug.com/1050754 external/wpt/bluetooth/service/getCharacteristics/gen-characteristic-not-found-with-uuid.https.window.html [ Failure ] crbug.com/1050754 external/wpt/bluetooth/service/getCharacteristics/gen-garbage-collection-ran-during-error-with-uuid.https.window.html [ Failure ]
diff --git a/third_party/blink/web_tests/editing/text-iterator/beforematch-async.html b/third_party/blink/web_tests/editing/text-iterator/beforematch-async.html index cdcca87..99347f86 100644 --- a/third_party/blink/web_tests/editing/text-iterator/beforematch-async.html +++ b/third_party/blink/web_tests/editing/text-iterator/beforematch-async.html
@@ -6,24 +6,15 @@ .spacer { height: 2000px; } -.hidden-matchable { - content-visibility: hidden-matchable; -} </style> <div class="spacer"></div> -<div id=hiddendiv class="hidden-matchable"> +<div id=hiddendiv hidden=until-found> <div class="spacer"></div> <div id=hiddentext>hiddentext</div> </div> <script> -hiddentext.addEventListener('beforematch', () => { - setTimeout(() => { - hiddendiv.classList.remove('hidden-matchable'); - }, 0); -}); - async_test(t => { testRunner.findString('hiddentext', ['Async']);
diff --git a/third_party/blink/web_tests/editing/text-iterator/beforematch-bubbles.html b/third_party/blink/web_tests/editing/text-iterator/beforematch-bubbles.html index f613a30..6aeab93 100644 --- a/third_party/blink/web_tests/editing/text-iterator/beforematch-bubbles.html +++ b/third_party/blink/web_tests/editing/text-iterator/beforematch-bubbles.html
@@ -3,7 +3,7 @@ <script src="../../resources/testharnessreport.js"></script> <div id=parentid> - <div id=childid>hello</div> + <div id=childid hidden=until-found>hello</div> </div> <script>
diff --git a/third_party/blink/web_tests/editing/text-iterator/beforematch-layout-shift.html b/third_party/blink/web_tests/editing/text-iterator/beforematch-layout-shift.html index cfb6ba5..0703abd 100644 --- a/third_party/blink/web_tests/editing/text-iterator/beforematch-layout-shift.html +++ b/third_party/blink/web_tests/editing/text-iterator/beforematch-layout-shift.html
@@ -6,12 +6,10 @@ .spacer { height: 200px; } -.hidden-matchable { - content-visibility: hidden-matchable; -} </style> -<div id=hiddendiv class="hidden-matchable"> +<div id=futurespacer></div> +<div id=hiddendiv hidden=until-found> <div class="spacer"></div> <div id=hiddentext>hiddentext</div> </div> @@ -20,9 +18,7 @@ <script> hiddendiv.addEventListener('beforematch', () => { - requestAnimationFrame(() => { - hiddendiv.classList.remove('hidden-matchable'); - }); + futurespacer.classList.add('spacer'); }); async_test(t => {
diff --git a/third_party/blink/web_tests/editing/text-iterator/beforematch-multiple-hidden.html b/third_party/blink/web_tests/editing/text-iterator/beforematch-multiple-hidden.html deleted file mode 100644 index a882bf69..0000000 --- a/third_party/blink/web_tests/editing/text-iterator/beforematch-multiple-hidden.html +++ /dev/null
@@ -1,96 +0,0 @@ -<!DOCTYPE html> -<script src="../../resources/testharness.js"></script> -<script src="../../resources/testharnessreport.js"></script> - -<style> -.spacer { - height: 2000px; -} -.hidden-matchable { - content-visibility: hidden-matchable; -} -</style> - -<div class=hidden-matchable id=matchOne>match one</div> -<div class=spacer id=spacerOne>spacer one</div> -<div class=hidden-matchable id=matchTwo>match two</div> -<div class=spacer id=spacerTwo>spacer two</div> -<div class=hidden-matchable id=matchThree>match three</div> - -<script> -function selectElement(element) { - const range = document.createRange(); - range.selectNodeContents(element); - const selection = window.getSelection(); - selection.removeAllRanges(); - selection.addRange(range); -} - -function addListeners(matches) { - matchOne.addEventListener('beforematch', () => { - matches.push('matchOne'); - }); - matchTwo.addEventListener('beforematch', () => { - matches.push('matchTwo'); - }); - matchThree.addEventListener('beforematch', () => { - matches.push('matchThree'); - }); -} - -test(() => { - const matches = []; - addListeners(matches); - - window.getSelection().removeAllRanges(); - testRunner.findString('match', ['WrapAround']); - - assert_array_equals( - matches, - ['matchOne', - 'matchTwo', - 'matchThree']); -}, 'beforematch should fire on each match in order when they are all hidden. This case is searching forward from the beginning of the page.'); - -test(() => { - const matches = []; - addListeners(matches); - - selectElement(spacerOne); - testRunner.findString('match', ['WrapAround']); - - assert_array_equals( - matches, - ['matchTwo', - 'matchThree', - 'matchOne']); -}, 'beforematch should fire on each match in order when they are all hidden. This case is searching forward from the middle of the page.'); - -test(() => { - const matches = []; - addListeners(matches); - - window.getSelection().removeAllRanges(); - testRunner.findString('match', ['WrapAround', 'Backwards']); - - assert_array_equals( - matches, - ['matchThree', - 'matchTwo', - 'matchOne']); -}, 'beforematch should fire on each match in order when they are all hidden. This case is searching backward from the beginning of the page.'); - -test(() => { - const matches = []; - addListeners(matches); - - selectElement(spacerOne); - testRunner.findString('match', ['WrapAround', 'Backwards']); - - assert_array_equals( - matches, - ['matchOne', - 'matchThree', - 'matchTwo']); -}, 'beforematch should fire on each match in order when they are all hidden. This case is searching backward from the middle of the page.'); -</script>
diff --git a/third_party/blink/web_tests/editing/text-iterator/beforematch-remove-match.html b/third_party/blink/web_tests/editing/text-iterator/beforematch-remove-match.html index 0f523caa..f372ca95 100644 --- a/third_party/blink/web_tests/editing/text-iterator/beforematch-remove-match.html +++ b/third_party/blink/web_tests/editing/text-iterator/beforematch-remove-match.html
@@ -15,6 +15,7 @@ async_test(t => { const match = document.createElement('div'); match.textContent = 'match'; + match.setAttribute('hidden', 'until-found'); document.body.appendChild(match); match.addEventListener('beforematch', () => {
diff --git a/third_party/blink/web_tests/editing/text-iterator/beforematch-second-match.html b/third_party/blink/web_tests/editing/text-iterator/beforematch-second-match.html index 2a946c7..205aa51 100644 --- a/third_party/blink/web_tests/editing/text-iterator/beforematch-second-match.html +++ b/third_party/blink/web_tests/editing/text-iterator/beforematch-second-match.html
@@ -8,7 +8,7 @@ } </style> <div class="spacer"></div> -<div id=matchOne>match</div> +<div id=matchOne hidden=until-found>match</div> <div class="spacer"></div> <div id=matchTwo>match</div> @@ -22,20 +22,15 @@ testRunner.findString('match', ['Async']); requestAnimationFrame(t.step_func(() => { - requestAnimationFrame(t.step_func(() => { - // Schedule another double rAF for the second async step - requestAnimationFrame(t.step_func(() => { - requestAnimationFrame(t.step_func_done(() => { - // verify that matchTwo is scrolled into view - const offsetBeforeScroll = window.pageYOffset; - matchTwo.scrollIntoView(); - const offsetAfterScroll = window.pageYOffset; + requestAnimationFrame(t.step_func_done(() => { + // verify that matchTwo is scrolled into view + const offsetBeforeScroll = window.pageYOffset; + matchTwo.scrollIntoView(); + const offsetAfterScroll = window.pageYOffset; - assert_not_equals(window.pageYOffset, 0, 'find-in-page should scroll after two rAFs.'); - assert_equals(offsetAfterScroll, offsetBeforeScroll, - `scrollIntoView shouldn't affect the scroll offset because the element should already be scrolled into view.`); - })); - })); + assert_not_equals(window.pageYOffset, 0, 'find-in-page should scroll after two rAFs.'); + assert_equals(offsetAfterScroll, offsetBeforeScroll, + `scrollIntoView shouldn't affect the scroll offset because the element should already be scrolled into view.`); })); })); }, `Removing the target element in the beforematch handler should make find-in-page scroll to the next match in the page.`);
diff --git a/third_party/blink/web_tests/external/WPT_BASE_MANIFEST_8.json b/third_party/blink/web_tests/external/WPT_BASE_MANIFEST_8.json index e222dc8..267cb7c1 100644 --- a/third_party/blink/web_tests/external/WPT_BASE_MANIFEST_8.json +++ b/third_party/blink/web_tests/external/WPT_BASE_MANIFEST_8.json
@@ -52,6 +52,13 @@ {} ] ], + "computed-node-checked.html": [ + "a413d26a019c117a6b202d5be689cb13d0a92c1c", + [ + null, + {} + ] + ], "computed-node.html": [ "159b217a086c0a8bbe246a976c0ad8f6c8a57dc8", [ @@ -272,6 +279,13 @@ ] }, "css-break": { + "area-crash.html": [ + "d47327cde3f6a963b8c6e61280d3063b28a2d25c", + [ + null, + {} + ] + ], "break-before-with-no-fragmentation-crash.html": [ "fb80ec45bceec093481fa54513c606c5952628b1", [ @@ -82540,6 +82554,84 @@ {} ] ], + "display-p3-001.html": [ + "74fe34a7ca918c35d8d7453ef18f73c0e82b31c0", + [ + null, + [ + [ + "/css/css-color/greensquare-ref.html", + "==" + ] + ], + {} + ] + ], + "display-p3-002.html": [ + "6a930298d69fa284fa2d2fdc22f85ac1f9e80cf3", + [ + null, + [ + [ + "/css/css-color/blacksquare-ref.html", + "==" + ] + ], + {} + ] + ], + "display-p3-003.html": [ + "697d164a0b2663906808461095eafee4434ea5b4", + [ + null, + [ + [ + "/css/css-color/whitesquare-ref.html", + "==" + ] + ], + {} + ] + ], + "display-p3-004.html": [ + "8b0999adbe5415aae9015425242bf0e39c353cce", + [ + null, + [ + [ + "/css/css-color/display-p3-004-ref.html", + "==" + ] + ], + {} + ] + ], + "display-p3-005.html": [ + "db255dc60cdb199ec16f650674d59b4ab43e529e", + [ + null, + [ + [ + "/css/css-color/yellowsquare-ref.html", + "==" + ] + ], + {} + ] + ], + "display-p3-006.html": [ + "0285af8ba2aa478795d1bca862c1198a1667ce65", + [ + null, + [ + [ + "/css/css-color/mossgreensquare-ref.html", + "==" + ] + ], + {} + ] + ], "hex-001.html": [ "0c90f877874316689e55623a69b1776646bef12d", [ @@ -240597,6 +240689,10 @@ "73b420189ec8bc073e8b6a2e4bfd628653bd4a78", [] ], + "display-p3-004-ref.html": [ + "fd1c8a67c76b9ab8a1b551e11f92f775d48e2790", + [] + ], "greensquare-090-ref.html": [ "18bdcf55c47a0710011c58ff1613daba080ed129", [] @@ -240665,6 +240761,10 @@ "95a260e8f2f4ae9085a33734c28a7d16da73fa82", [] ], + "mossgreensquare-ref.html": [ + "06f866c02dd04724a35cf5032b1d40e6783c3389", + [] + ], "oklab-004-ref.html": [ "d947445321da29d5658fb957cb45c83e8cca2424", [] @@ -241014,6 +241114,10 @@ "xyz-d65-004-ref.html": [ "1664d362cfd810b47efd11a3af511e7d0926cb2d", [] + ], + "yellowsquare-ref.html": [ + "34463bc6ebb0d16d05897bb4f75343e975f43c22", + [] ] }, "css-color-adjust": { @@ -298867,10 +298971,6 @@ [] ], "server": { - "http2-websocket.sub.h2.any.worker-expected.txt": [ - "056997670dc8a8382ea596d66f3a22307d22577c", - [] - ], "resources": { "expect-global.js": [ "63d4944e61ffc7c85e2016f26d08087e7c972139", @@ -300410,7 +300510,7 @@ ] }, "lint.ignore": [ - "decc202343b5c47adb4dc8edfb6e9e60cd3f0224", + "cffb1f1e3fa1e7ae1616749eccdc996068012bf0", [] ], "loading": { @@ -316878,6 +316978,10 @@ ] }, "websockets": { + "Close-1000-reason.any.worker_wpt_flags=h2-expected.txt": [ + "dc3fa03f41a6dc06e8090b12530547a7a53df8c4", + [] + ], "Close-delayed.any.worker_wpt_flags=h2-expected.txt": [ "302107b06f56b36134f0c7ec17e061653ece344a", [] @@ -316886,6 +316990,10 @@ "302107b06f56b36134f0c7ec17e061653ece344a", [] ], + "Close-server-initiated-close.any.worker_wpt_flags=h2-expected.txt": [ + "1711963fad1a24be03c4fb528e4dd142be9bdbbe", + [] + ], "Create-Secure-url-with-space.any-expected.txt": [ "6e141336536a22be05d71b3764743f3ff6c65dce", [] @@ -316950,6 +317058,10 @@ "114fa7d07a2ffcefe166bf8e30e81b9bfa2e7225", [] ], + "Create-valid-url-array-protocols.any.worker_wpt_flags=h2-expected.txt": [ + "f7aa3bd5bccb2e3af5ef7021922abc56b8e7fe31", + [] + ], "DIR_METADATA": [ "64adb78363ab700eb76a5518e4af14c9d459cb00", [] @@ -316962,6 +317074,26 @@ "ea35c702ae7f42e72bbc751b4eff62d3b51fbdf3", [] ], + "Send-binary-arraybufferview-float64.any_wpt_flags=h2-expected.txt": [ + "51f63a3b3133d313edf5ef5506bd5f8bc80d1ad9", + [] + ], + "Send-binary-arraybufferview-int16-offset.any.worker_wpt_flags=h2-expected.txt": [ + "5cf6c4531f85ec1c36bba96d3c0ce797d7f3272e", + [] + ], + "Send-binary-arraybufferview-int16-offset.any_wpt_flags=h2-expected.txt": [ + "5cf6c4531f85ec1c36bba96d3c0ce797d7f3272e", + [] + ], + "Send-binary-arraybufferview-uint32-offset.any_wpt_flags=h2-expected.txt": [ + "29a3626c1391d8e3e9e250471c31aa278c012a6d", + [] + ], + "Send-unpaired-surrogates.any.worker_wpt_flags=h2-expected.txt": [ + "69f784da7be837dd93f4c3dae5236fd6a1960ad9", + [] + ], "basic-auth.any.serviceworker-expected.txt": [ "113672d9e7c9fe73cc041e1ec79e9c4cde70f014", [] @@ -317260,6 +317392,10 @@ "016_wpt_flags=h2-expected.txt": [ "d7808b6401aefe917b9faa0de2b3cc6c82f1cf36", [] + ], + "018_wpt_flags=h2-expected.txt": [ + "bb4458e51593c2e41410455577c1abd3da8fdda9", + [] ] }, "readyState": { @@ -467157,7 +467293,7 @@ ] ], "MediaStreamTrackGenerator-video.https.html": [ - "517a6934e868a57c4a3a34820d181f341bb73039", + "a6f73f009c6d754d5f355e6492eb1623ab12591f", [ null, {}
diff --git a/third_party/blink/web_tests/external/wpt/app-history/navigate/navigate-base-url.html b/third_party/blink/web_tests/external/wpt/app-history/navigate/navigate-base-url.html new file mode 100644 index 0000000..b11a71a9 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/app-history/navigate/navigate-base-url.html
@@ -0,0 +1,15 @@ +<!doctype html> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<iframe id="i" src="resources/page-with-base-url-common.html"></iframe> +<script> +async_test(t => { + window.onload = t.step_func(() => { + i.contentWindow.appHistory.navigate("blank.html"); + i.onload = t.step_func_done(() => { + const iframeURL = new URL(i.contentWindow.appHistory.current.url); + assert_equals(iframeURL.pathname, "/common/blank.html"); + }); + }); +}, "navigate() must resolve URLs relative to appHistory object's base URL"); +</script>
diff --git a/third_party/blink/web_tests/external/wpt/app-history/navigate/navigate-same-document-event-order.html b/third_party/blink/web_tests/external/wpt/app-history/navigate/navigate-same-document-event-order.html index 1ec2ffd..4be537f 100644 --- a/third_party/blink/web_tests/external/wpt/app-history/navigate/navigate-same-document-event-order.html +++ b/third_party/blink/web_tests/external/wpt/app-history/navigate/navigate-same-document-event-order.html
@@ -5,7 +5,14 @@ async_test(t => { let events = []; function finish() { - assert_array_equals(events, ["onnavigate", "onnavigatesuccess", "promisefulfilled", "onpopstate", "onhashchange"]); + // Until https://github.com/whatwg/html/issues/1792 (see also https://crbug.com/1254926) is + // resolved, ignore the ordering of hashchange and popstate (while still testing that they are + // the last two, in some order, and come in at most one task after "promisefulfilled"). + // TODO(domenic): fix the spec, write non-app history tests, then reenable these checks. + assert_array_equals( + events.slice(0, -2), + ["onnavigate", "onnavigatesuccess", "promisefulfilled"/*, "onpopstate", "onhashchange"*/] + ); t.done(); }
diff --git a/third_party/blink/web_tests/external/wpt/app-history/navigate/navigate-transitionWhile-reject-event-order.html b/third_party/blink/web_tests/external/wpt/app-history/navigate/navigate-transitionWhile-reject-event-order.html index ca730162..96e7427 100644 --- a/third_party/blink/web_tests/external/wpt/app-history/navigate/navigate-transitionWhile-reject-event-order.html +++ b/third_party/blink/web_tests/external/wpt/app-history/navigate/navigate-transitionWhile-reject-event-order.html
@@ -5,7 +5,14 @@ async_test(t => { let events = []; function finish() { - assert_array_equals(events, ["onnavigate", "committed promisefulfilled", "onnavigateerror", "finished promiserejected", "onhashchange", "onpopstate"]); + // Until https://github.com/whatwg/html/issues/1792 (see also https://crbug.com/1254926) is + // resolved, ignore the ordering of hashchange and popstate (while still testing that they are + // the last two, in some order, and come in at most one task after "finished promiserejected"). + // TODO(domenic): fix the spec, write non-app history tests, then reenable these checks. + assert_array_equals( + events.slice(0, -2), + ["onnavigate", "committed promisefulfilled", "onnavigateerror", "finished promiserejected"/*, "onhashchange", "onpopstate"*/] + ); t.done(); }
diff --git a/third_party/blink/web_tests/external/wpt/app-history/navigate/reload-base-url.html b/third_party/blink/web_tests/external/wpt/app-history/navigate/reload-base-url.html new file mode 100644 index 0000000..35b29b9 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/app-history/navigate/reload-base-url.html
@@ -0,0 +1,16 @@ +<!doctype html> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<iframe id="i" src="resources/page-with-base-url-common.html"></iframe> +<script> +async_test(t => { + window.onload = t.step_func(() => { + const startingURL = new URL(i.src); + i.contentWindow.appHistory.reload(); + i.onload = t.step_func_done(() => { + const iframeURL = new URL(i.contentWindow.appHistory.current.url); + assert_equals(iframeURL.pathname, startingURL.pathname); + }); + }); +}, "reload() must ignore the AppHistory object's base URL"); +</script>
diff --git a/third_party/blink/web_tests/external/wpt/app-history/navigate/resources/page-with-base-url-common.html b/third_party/blink/web_tests/external/wpt/app-history/navigate/resources/page-with-base-url-common.html new file mode 100644 index 0000000..8d9fedc --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/app-history/navigate/resources/page-with-base-url-common.html
@@ -0,0 +1,2 @@ +<!DOCTYPE html> +<base href="/common/">
diff --git a/third_party/blink/web_tests/external/wpt/bluetooth/service/device-same-from-2-services.https.html b/third_party/blink/web_tests/external/wpt/bluetooth/service/device-same-from-2-services.https.html deleted file mode 100644 index 4c479dd..0000000 --- a/third_party/blink/web_tests/external/wpt/bluetooth/service/device-same-from-2-services.https.html +++ /dev/null
@@ -1,22 +0,0 @@ -<!DOCTYPE html> -<script src="/resources/testharness.js"></script> -<script src="/resources/testharnessreport.js"></script> -<script src="/resources/testdriver.js"></script> -<script src="/resources/testdriver-vendor.js"></script> -<script src="/bluetooth/resources/bluetooth-test.js"></script> -<script src="/bluetooth/resources/bluetooth-fake-devices.js"></script> -<script> -'use strict'; -const test_desc = 'Same parent device returned from multiple services.'; - -bluetooth_test( - () => getTwoHealthThermometerServicesDevice( - {filters: [{services: ['health_thermometer']}]}) - .then( - ({device}) => - device.gatt.getPrimaryServices('health_thermometer')) - .then( - ([service1, service2]) => - assert_equals(service1.device, service2.device)), - test_desc); -</script>
diff --git a/third_party/blink/web_tests/external/wpt/bluetooth/service/device-same-from-2-services.https.window.js b/third_party/blink/web_tests/external/wpt/bluetooth/service/device-same-from-2-services.https.window.js new file mode 100644 index 0000000..4870105d --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/bluetooth/service/device-same-from-2-services.https.window.js
@@ -0,0 +1,16 @@ +// META: script=/resources/testharness.js +// META: script=/resources/testharnessreport.js +// META: script=/resources/testdriver.js +// META: script=/resources/testdriver-vendor.js +// META: script=/bluetooth/resources/bluetooth-test.js +// META: script=/bluetooth/resources/bluetooth-fake-devices.js +'use strict'; +const test_desc = 'Same parent device returned from multiple services.'; + +bluetooth_test(async () => { + let {device} = await getTwoHealthThermometerServicesDevice( + {filters: [{services: ['health_thermometer']}]}); + let [service1, service2] = + await device.gatt.getPrimaryServices('health_thermometer'); + assert_equals(service1.device, service2.device); +}, test_desc);
diff --git a/third_party/blink/web_tests/external/wpt/bluetooth/service/device-same-object.https.html b/third_party/blink/web_tests/external/wpt/bluetooth/service/device-same-object.https.html deleted file mode 100644 index d9590b17..0000000 --- a/third_party/blink/web_tests/external/wpt/bluetooth/service/device-same-object.https.html +++ /dev/null
@@ -1,20 +0,0 @@ -<!DOCTYPE html> -<script src="/resources/testharness.js"></script> -<script src="/resources/testharnessreport.js"></script> -<script src="/resources/testdriver.js"></script> -<script src="/resources/testdriver-vendor.js"></script> -<script src="/bluetooth/resources/bluetooth-test.js"></script> -<script src="/bluetooth/resources/bluetooth-fake-devices.js"></script> -<script> -'use strict'; -const test_desc = '[SameObject] test for BluetoothRemoteGATTService device.'; - -bluetooth_test( - () => getHealthThermometerDevice( - {filters: [{services: ['health_thermometer']}]}) - .then( - ({device}) => - device.gatt.getPrimaryService('health_thermometer')) - .then(service => assert_equals(service.device, service.device)), - test_desc); -</script>
diff --git a/third_party/blink/web_tests/external/wpt/bluetooth/service/device-same-object.https.window.js b/third_party/blink/web_tests/external/wpt/bluetooth/service/device-same-object.https.window.js new file mode 100644 index 0000000..cca0b344 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/bluetooth/service/device-same-object.https.window.js
@@ -0,0 +1,15 @@ +// META: script=/resources/testharness.js +// META: script=/resources/testharnessreport.js +// META: script=/resources/testdriver.js +// META: script=/resources/testdriver-vendor.js +// META: script=/bluetooth/resources/bluetooth-test.js +// META: script=/bluetooth/resources/bluetooth-fake-devices.js +'use strict'; +const test_desc = '[SameObject] test for BluetoothRemoteGATTService device.'; + +bluetooth_test(async () => { + let {device} = await getHealthThermometerDevice( + {filters: [{services: ['health_thermometer']}]}); + let service = await device.gatt.getPrimaryService('health_thermometer'); + assert_equals(service.device, device); +}, test_desc);
diff --git a/third_party/blink/web_tests/external/wpt/bluetooth/service/getCharacteristic/characteristic-found.https.html b/third_party/blink/web_tests/external/wpt/bluetooth/service/getCharacteristic/characteristic-found.https.html deleted file mode 100644 index 0fb2ff353..0000000 --- a/third_party/blink/web_tests/external/wpt/bluetooth/service/getCharacteristic/characteristic-found.https.html +++ /dev/null
@@ -1,30 +0,0 @@ -<!DOCTYPE html> -<script src="/resources/testharness.js"></script> -<script src="/resources/testharnessreport.js"></script> -<script src="/resources/testdriver.js"></script> -<script src="/resources/testdriver-vendor.js"></script> -<script src="/bluetooth/resources/bluetooth-test.js"></script> -<script src="/bluetooth/resources/bluetooth-fake-devices.js"></script> -<script> -'use strict'; -const test_desc = 'Request for characteristic. Should return right ' + - 'characteristic.'; -let device, service; - -bluetooth_test(() => getHealthThermometerDevice() - .then(_ => ({device} = _)) - .then(() => device.gatt.getPrimaryService('health_thermometer')) - .then(_ => service = _) - .then(() => Promise.all([ - service.getCharacteristic(measurement_interval.alias), - service.getCharacteristic(measurement_interval.name), - service.getCharacteristic(measurement_interval.uuid)])) - .then(characteristics => characteristics.forEach(characteristic => { - assert_equals( - characteristic.uuid, measurement_interval.uuid, - 'Characteristic UUID should be the same as requested UUID.'); - assert_equals( - characteristic.service, service, - 'Characteristic service should be the same as service.'); - })), test_desc); -</script>
diff --git a/third_party/blink/web_tests/external/wpt/bluetooth/service/getCharacteristic/characteristic-found.https.window.js b/third_party/blink/web_tests/external/wpt/bluetooth/service/getCharacteristic/characteristic-found.https.window.js new file mode 100644 index 0000000..699f993 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/bluetooth/service/getCharacteristic/characteristic-found.https.window.js
@@ -0,0 +1,27 @@ +// META: script=/resources/testharness.js +// META: script=/resources/testharnessreport.js +// META: script=/resources/testdriver.js +// META: script=/resources/testdriver-vendor.js +// META: script=/bluetooth/resources/bluetooth-test.js +// META: script=/bluetooth/resources/bluetooth-fake-devices.js +'use strict'; +const test_desc = 'Request for characteristic. Should return right ' + + 'characteristic.'; + +bluetooth_test(async () => { + let {device} = await getHealthThermometerDevice(); + let service = await device.gatt.getPrimaryService('health_thermometer'); + let characteristics = await Promise.all([ + service.getCharacteristic(measurement_interval.alias), + service.getCharacteristic(measurement_interval.name), + service.getCharacteristic(measurement_interval.uuid) + ]); + characteristics.forEach(characteristic => { + assert_equals( + characteristic.uuid, measurement_interval.uuid, + 'Characteristic UUID should be the same as requested UUID.'); + assert_equals( + characteristic.service, service, + 'Characteristic service should be the same as service.'); + }); +}, test_desc);
diff --git a/third_party/blink/web_tests/external/wpt/bluetooth/service/getCharacteristics/blocklisted-characteristics.https.html b/third_party/blink/web_tests/external/wpt/bluetooth/service/getCharacteristics/blocklisted-characteristics.https.html deleted file mode 100644 index 3298f5f..0000000 --- a/third_party/blink/web_tests/external/wpt/bluetooth/service/getCharacteristics/blocklisted-characteristics.https.html +++ /dev/null
@@ -1,25 +0,0 @@ -<!DOCTYPE html> -<script src="/resources/testharness.js"></script> -<script src="/resources/testharnessreport.js"></script> -<script src="/resources/testdriver.js"></script> -<script src="/resources/testdriver-vendor.js"></script> -<script src="/bluetooth/resources/bluetooth-test.js"></script> -<script src="/bluetooth/resources/bluetooth-fake-devices.js"></script> -<script> -'use strict'; -const test_desc = 'The Device Information service is composed of blocklisted ' + - 'characteristics so we shouldn\'t find any.'; -const expected = new DOMException('No Characteristics found in service.', - 'NotFoundError'); -let device; - -bluetooth_test(() => getHIDDevice({ - filters: [{services: ['device_information']}] - }) - .then(_ => ({device} = _)) - .then(() => device.gatt.getPrimaryService('device_information')) - .then(service => assert_promise_rejects_with_message( - service.getCharacteristics(), - expected)), - test_desc); -</script>
diff --git a/third_party/blink/web_tests/external/wpt/bluetooth/service/getCharacteristics/blocklisted-characteristics.https.window.js b/third_party/blink/web_tests/external/wpt/bluetooth/service/getCharacteristics/blocklisted-characteristics.https.window.js new file mode 100644 index 0000000..7458c56a --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/bluetooth/service/getCharacteristics/blocklisted-characteristics.https.window.js
@@ -0,0 +1,19 @@ +// META: script=/resources/testharness.js +// META: script=/resources/testharnessreport.js +// META: script=/resources/testdriver.js +// META: script=/resources/testdriver-vendor.js +// META: script=/bluetooth/resources/bluetooth-test.js +// META: script=/bluetooth/resources/bluetooth-fake-devices.js +'use strict'; +const test_desc = 'The Device Information service is composed of blocklisted ' + + 'characteristics so we shouldn\'t find any.'; +const expected = + new DOMException('No Characteristics found in service.', 'NotFoundError'); + +bluetooth_test(async () => { + let {device} = + await getHIDDevice({filters: [{services: ['device_information']}]}); + let service = await device.gatt.getPrimaryService('device_information'); + return assert_promise_rejects_with_message( + service.getCharacteristics(), expected); +}, test_desc);
diff --git a/third_party/blink/web_tests/external/wpt/bluetooth/service/getCharacteristics/characteristics-found-with-uuid.https.html b/third_party/blink/web_tests/external/wpt/bluetooth/service/getCharacteristics/characteristics-found-with-uuid.https.html deleted file mode 100644 index 6188adb..0000000 --- a/third_party/blink/web_tests/external/wpt/bluetooth/service/getCharacteristics/characteristics-found-with-uuid.https.html +++ /dev/null
@@ -1,45 +0,0 @@ -<!DOCTYPE html> -<script src="/resources/testharness.js"></script> -<script src="/resources/testharnessreport.js"></script> -<script src="/resources/testdriver.js"></script> -<script src="/resources/testdriver-vendor.js"></script> -<script src="/bluetooth/resources/bluetooth-test.js"></script> -<script src="/bluetooth/resources/bluetooth-fake-devices.js"></script> -<script> -'use strict'; -const test_desc = 'Find characteristics with UUID in service.'; -let device, fake_peripheral; - -bluetooth_test(() => getDiscoveredHealthThermometerDevice() - .then(_ => ({device, fake_peripheral} = _ )) - // Setup a device with two measurement intervals. - .then(() => - fake_peripheral.setNextGATTConnectionResponse({code: HCI_SUCCESS})) - .then(() => device.gatt.connect()) - .then(() => fake_peripheral.addFakeService({uuid: 'health_thermometer'})) - .then(fake_health_thermometer => Promise.all([ - fake_health_thermometer.addFakeCharacteristic({ - uuid: 'measurement_interval', - properties: ['read', 'write', 'indicate']}), - fake_health_thermometer.addFakeCharacteristic({ - uuid: 'measurement_interval', - properties: ['read', 'write', 'indicate']}), - fake_health_thermometer.addFakeCharacteristic({ - uuid: 'temperature_measurement', - properties: ['indicate']}) - ])) - .then(() => - fake_peripheral.setNextGATTDiscoveryResponse({code: HCI_SUCCESS})) - .then(() => device.gatt.getPrimaryService('health_thermometer')) - // Actual test starts. - .then(service => Promise.all([ - service.getCharacteristics(measurement_interval.alias), - service.getCharacteristics(measurement_interval.name), - service.getCharacteristics(measurement_interval.uuid)])) - .then(characteristics_arrays => characteristics_arrays.forEach( - characteristics => { - assert_equals(characteristics.length, 2); - assert_equals(characteristics[0].uuid, measurement_interval.uuid); - assert_equals(characteristics[1].uuid, measurement_interval.uuid); - })), test_desc); -</script>
diff --git a/third_party/blink/web_tests/external/wpt/bluetooth/service/getCharacteristics/characteristics-found-with-uuid.https.window.js b/third_party/blink/web_tests/external/wpt/bluetooth/service/getCharacteristics/characteristics-found-with-uuid.https.window.js new file mode 100644 index 0000000..8778807 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/bluetooth/service/getCharacteristics/characteristics-found-with-uuid.https.window.js
@@ -0,0 +1,42 @@ +// META: script=/resources/testharness.js +// META: script=/resources/testharnessreport.js +// META: script=/resources/testdriver.js +// META: script=/resources/testdriver-vendor.js +// META: script=/bluetooth/resources/bluetooth-test.js +// META: script=/bluetooth/resources/bluetooth-fake-devices.js +'use strict'; +const test_desc = 'Find characteristics with UUID in service.'; + +bluetooth_test(async () => { + let {device, fake_peripheral} = await getDiscoveredHealthThermometerDevice(); + // Setup a device with two measurement intervals. + await fake_peripheral.setNextGATTConnectionResponse({code: HCI_SUCCESS}); + await device.gatt.connect(); + let fake_health_thermometer = + await fake_peripheral.addFakeService({uuid: 'health_thermometer'}); + await Promise.all([ + fake_health_thermometer.addFakeCharacteristic({ + uuid: 'measurement_interval', + properties: ['read', 'write', 'indicate'] + }), + fake_health_thermometer.addFakeCharacteristic({ + uuid: 'measurement_interval', + properties: ['read', 'write', 'indicate'] + }), + fake_health_thermometer.addFakeCharacteristic( + {uuid: 'temperature_measurement', properties: ['indicate']}) + ]); + await fake_peripheral.setNextGATTDiscoveryResponse({code: HCI_SUCCESS}); + let service = await device.gatt.getPrimaryService('health_thermometer'); + // Actual test starts. + let characteristics_arrays = await Promise.all([ + service.getCharacteristics(measurement_interval.alias), + service.getCharacteristics(measurement_interval.name), + service.getCharacteristics(measurement_interval.uuid) + ]); + characteristics_arrays.forEach(characteristics => { + assert_equals(characteristics.length, 2); + assert_equals(characteristics[0].uuid, measurement_interval.uuid); + assert_equals(characteristics[1].uuid, measurement_interval.uuid); + }); +}, test_desc);
diff --git a/third_party/blink/web_tests/external/wpt/bluetooth/service/getCharacteristics/characteristics-found.https.html b/third_party/blink/web_tests/external/wpt/bluetooth/service/getCharacteristics/characteristics-found.https.html deleted file mode 100644 index 6812cd9..0000000 --- a/third_party/blink/web_tests/external/wpt/bluetooth/service/getCharacteristics/characteristics-found.https.html +++ /dev/null
@@ -1,49 +0,0 @@ -<!DOCTYPE html> -<script src="/resources/testharness.js"></script> -<script src="/resources/testharnessreport.js"></script> -<script src="/resources/testdriver.js"></script> -<script src="/resources/testdriver-vendor.js"></script> -<script src="/bluetooth/resources/bluetooth-test.js"></script> -<script src="/bluetooth/resources/bluetooth-fake-devices.js"></script> -<script> -'use strict'; -const test_desc = 'Find all characteristics in a service.'; -let device, fake_peripheral; - -bluetooth_test(() => getDiscoveredHealthThermometerDevice() - .then(_ => ({device, fake_peripheral} = _)) - // Setup a device with two measurement intervals. - .then(() => - fake_peripheral.setNextGATTConnectionResponse({code: HCI_SUCCESS})) - .then(() => device.gatt.connect()) - .then(() => fake_peripheral.addFakeService({uuid: 'health_thermometer'})) - .then(fake_health_thermometer => Promise.all([ - fake_health_thermometer.addFakeCharacteristic({ - uuid: 'measurement_interval', - properties: ['read', 'write', 'indicate']}), - fake_health_thermometer.addFakeCharacteristic({ - uuid: 'measurement_interval', - properties: ['read', 'write', 'indicate']}), - fake_health_thermometer.addFakeCharacteristic({ - uuid: 'temperature_measurement', - properties: ['indicate']}) - ])) - .then(() => - fake_peripheral.setNextGATTDiscoveryResponse({code: HCI_SUCCESS})) - .then(() => device.gatt.getPrimaryService('health_thermometer')) - // Actual test starts. - .then(service => service.getCharacteristics()) - .then(characteristics => { - // Expect three characteristic instances. - assert_equals(characteristics.length, 3); - - let uuid_set = new Set(characteristics.map(c => c.uuid)); - // Two of the expected characteristics are 'measurement_interval', - // so only 2 unique UUID. - assert_equals(uuid_set.size, 2); - assert_true(uuid_set.has(BluetoothUUID.getCharacteristic( - 'measurement_interval'))); - assert_true(uuid_set.has(BluetoothUUID.getCharacteristic( - 'temperature_measurement'))); - }), test_desc); -</script>
diff --git a/third_party/blink/web_tests/external/wpt/bluetooth/service/getCharacteristics/characteristics-found.https.window.js b/third_party/blink/web_tests/external/wpt/bluetooth/service/getCharacteristics/characteristics-found.https.window.js new file mode 100644 index 0000000..f1b9ecd --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/bluetooth/service/getCharacteristics/characteristics-found.https.window.js
@@ -0,0 +1,44 @@ +// META: script=/resources/testharness.js +// META: script=/resources/testharnessreport.js +// META: script=/resources/testdriver.js +// META: script=/resources/testdriver-vendor.js +// META: script=/bluetooth/resources/bluetooth-test.js +// META: script=/bluetooth/resources/bluetooth-fake-devices.js +'use strict'; +const test_desc = 'Find all characteristics in a service.'; + +bluetooth_test(async () => { + let {device, fake_peripheral} = await getDiscoveredHealthThermometerDevice(); + // Setup a device with two measurement intervals. + await fake_peripheral.setNextGATTConnectionResponse({code: HCI_SUCCESS}); + await device.gatt.connect(); + let fake_health_thermometer = + await fake_peripheral.addFakeService({uuid: 'health_thermometer'}); + await Promise.all([ + fake_health_thermometer.addFakeCharacteristic({ + uuid: 'measurement_interval', + properties: ['read', 'write', 'indicate'] + }), + fake_health_thermometer.addFakeCharacteristic({ + uuid: 'measurement_interval', + properties: ['read', 'write', 'indicate'] + }), + fake_health_thermometer.addFakeCharacteristic( + {uuid: 'temperature_measurement', properties: ['indicate']}) + ]); + await fake_peripheral.setNextGATTDiscoveryResponse({code: HCI_SUCCESS}); + let service = await device.gatt.getPrimaryService('health_thermometer'); + // Actual test starts. + let characteristics = await service.getCharacteristics(); + // Expect three characteristic instances. + assert_equals(characteristics.length, 3); + + let uuid_set = new Set(characteristics.map(c => c.uuid)); + // Two of the expected characteristics are + // 'measurement_interval', so only 2 unique UUID. + assert_equals(uuid_set.size, 2); + assert_true( + uuid_set.has(BluetoothUUID.getCharacteristic('measurement_interval'))); + assert_true( + uuid_set.has(BluetoothUUID.getCharacteristic('temperature_measurement'))); +}, test_desc);
diff --git a/third_party/blink/web_tests/external/wpt/bluetooth/service/getCharacteristics/characteristics-not-found.https.html b/third_party/blink/web_tests/external/wpt/bluetooth/service/getCharacteristics/characteristics-not-found.https.html deleted file mode 100644 index a629b5e..0000000 --- a/third_party/blink/web_tests/external/wpt/bluetooth/service/getCharacteristics/characteristics-not-found.https.html +++ /dev/null
@@ -1,21 +0,0 @@ -<!DOCTYPE html> -<script src="/resources/testharness.js"></script> -<script src="/resources/testharnessreport.js"></script> -<script src="/resources/testdriver.js"></script> -<script src="/resources/testdriver-vendor.js"></script> -<script src="/bluetooth/resources/bluetooth-test.js"></script> -<script src="/bluetooth/resources/bluetooth-fake-devices.js"></script> -<script> -'use strict'; -const test_desc = 'Request for absent characteristics. Reject with ' + - 'NotFoundError.'; -const expected = new DOMException('No Characteristics found in service.', - 'NotFoundError'); -let service; - -bluetooth_test(() => getEmptyHealthThermometerService() - .then(_ => ({service} = _)) - .then(() => assert_promise_rejects_with_message( - service.getCharacteristics(), expected)), - test_desc); -</script>
diff --git a/third_party/blink/web_tests/external/wpt/bluetooth/service/getCharacteristics/characteristics-not-found.https.window.js b/third_party/blink/web_tests/external/wpt/bluetooth/service/getCharacteristics/characteristics-not-found.https.window.js new file mode 100644 index 0000000..93048fc --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/bluetooth/service/getCharacteristics/characteristics-not-found.https.window.js
@@ -0,0 +1,17 @@ +// META: script=/resources/testharness.js +// META: script=/resources/testharnessreport.js +// META: script=/resources/testdriver.js +// META: script=/resources/testdriver-vendor.js +// META: script=/bluetooth/resources/bluetooth-test.js +// META: script=/bluetooth/resources/bluetooth-fake-devices.js +'use strict'; +const test_desc = 'Request for absent characteristics. Reject with ' + + 'NotFoundError.'; +const expected = + new DOMException('No Characteristics found in service.', 'NotFoundError'); + +bluetooth_test(async () => { + let {service} = await getEmptyHealthThermometerService(); + return assert_promise_rejects_with_message( + service.getCharacteristics(), expected); +}, test_desc);
diff --git a/third_party/blink/web_tests/external/wpt/css/css-color/display-p3-001.html b/third_party/blink/web_tests/external/wpt/css/css-color/display-p3-001.html new file mode 100644 index 0000000..74fe34a7 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/css/css-color/display-p3-001.html
@@ -0,0 +1,15 @@ +<!DOCTYPE html> +<meta charset="utf-8"> +<title>CSS Color 4: display-p3</title> +<link rel="author" title="Chris Lilley" href="mailto:chris@w3.org"> +<link rel="help" href="https://drafts.csswg.org/css-color-4/#valdef-color-display-p3"> +<link rel="match" href="greensquare-ref.html"> +<meta name="assert" content="display-p3 with no alpha"> +<style> + .test { background-color: red; width: 12em; height: 12em; } + .test { background-color: color(display-p3 0.21604 0.49418 0.13151); } /* green (sRGB #008000) converted to display-p3 */ +</style> +<body> + <p>Test passes if you see a green square, and no red.</p> + <div class="test"></div> +</body>
diff --git a/third_party/blink/web_tests/external/wpt/css/css-color/display-p3-002.html b/third_party/blink/web_tests/external/wpt/css/css-color/display-p3-002.html new file mode 100644 index 0000000..6a93029 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/css/css-color/display-p3-002.html
@@ -0,0 +1,16 @@ +<!DOCTYPE html> +<meta charset="utf-8"> +<title>CSS Color 4: display-p3</title> +<link rel="author" title="Chris Lilley" href="mailto:chris@w3.org"> +<link rel="help" href="https://drafts.csswg.org/css-color-4/#valdef-color-display-p3"> +<link rel="help" href="https://drafts.csswg.org/css-color-4/#predefined-to-predefined"> +<link rel="match" href="blacksquare-ref.html"> +<meta name="assert" content="display-p3 with no alpha"> +<style> + .test { background-color: red; width: 12em; height: 12em; } + .test { background-color: color(display-p3 0 0 0); } /* black (sRGB #000000) converted to display-p3 */ +</style> +<body> + <p>Test passes if you see a black square, and no red.</p> + <div class="test"></div> +</body>
diff --git a/third_party/blink/web_tests/external/wpt/css/css-color/display-p3-003.html b/third_party/blink/web_tests/external/wpt/css/css-color/display-p3-003.html new file mode 100644 index 0000000..697d164a --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/css/css-color/display-p3-003.html
@@ -0,0 +1,19 @@ +<!DOCTYPE html> +<meta charset="utf-8"> +<title>CSS Color 4: display-p3</title> +<link rel="author" title="Chris Lilley" href="mailto:chris@w3.org"> +<link rel="help" href="https://drafts.csswg.org/css-color-4/#valdef-color-display-p3"> +<link rel="help" href="https://drafts.csswg.org/css-color-4/#predefined-to-predefined"> +<link rel="match" href="./whitesquare-ref.html"> +<meta name="assert" content="display-p3 with no alpha"> +<style> + body { background-color: grey; } + .test { background-color: red; width: 12em; height: 6em; margin-top: 0; } + .ref { background-color: rgb(100% 100% 100%); width: 12em; height: 6em; margin-bottom: 0; } /* color(display-p3 1 1 1) converted to sRGB */ + .test { background-color: color(display-p3 1 1 1); } +</style> +<body> + <p>Test passes if you see a single square, and not two rectangles of different colors.</p> + <div class="ref"></div> + <div class="test"></div> +</body>
diff --git a/third_party/blink/web_tests/external/wpt/css/css-color/display-p3-004-ref.html b/third_party/blink/web_tests/external/wpt/css/css-color/display-p3-004-ref.html new file mode 100644 index 0000000..fd1c8a6 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/css/css-color/display-p3-004-ref.html
@@ -0,0 +1,10 @@ +<!DOCTYPE html> +<meta charset="utf-8"> +<title>CSS Color 4:display-p3</title> +<style> + .test { background-color: lab(86.61399% -106.539 102.871); width: 12em; height: 12em; } /* color(display-p3 0 1 0) converted to Lab */ +</style> +<body> + <p>Test passes if you see a single square, and not two rectangles of different colors.</p> + <div class="test"></div> +</body>
diff --git a/third_party/blink/web_tests/external/wpt/css/css-color/display-p3-004.html b/third_party/blink/web_tests/external/wpt/css/css-color/display-p3-004.html new file mode 100644 index 0000000..8b0999ad --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/css/css-color/display-p3-004.html
@@ -0,0 +1,19 @@ +<!DOCTYPE html> +<meta charset="utf-8"> +<title>CSS Color 4: display-p3</title> +<link rel="author" title="Chris Lilley" href="mailto:chris@w3.org"> +<link rel="help" href="https://drafts.csswg.org/css-color-4/#valdef-color-display-p3"> +<link rel="help" href="https://drafts.csswg.org/css-color-4/#specifying-lab-lch"> +<link rel="help" href="https://drafts.csswg.org/css-color-4/#predefined-to-lab-oklab"> +<link rel="match" href="display-p3-004-ref.html"> +<meta name="assert" content="display-p3 with no alpha"> +<style> + .test { background-color: red; width: 12em; height: 6em; margin-top: 0; } + .ref { background-color: lab(86.61399% -106.539 102.871); width: 12em; height: 6em; margin-bottom: 0; } /* color(display-p3 0 1 0) converted to Lab */ + .test { background-color: color(display-p3 0 1 0); } +</style> +<body> + <p>Test passes if you see a single square, and not two rectangles of different colors.</p> + <div class="ref"></div> + <div class="test"></div> +</body>
diff --git a/third_party/blink/web_tests/external/wpt/css/css-color/display-p3-005.html b/third_party/blink/web_tests/external/wpt/css/css-color/display-p3-005.html new file mode 100644 index 0000000..db255dc --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/css/css-color/display-p3-005.html
@@ -0,0 +1,19 @@ +<!DOCTYPE html> +<meta charset="utf-8"> +<title>CSS Color 4: display-p3</title> +<link rel="author" title="Chris Lilley" href="mailto:chris@w3.org"> +<link rel="help" href="https://drafts.csswg.org/css-color-4/#valdef-color-display-p3"> +<link rel="help" href="https://drafts.csswg.org/css-color-4/#predefined-to-predefined"> +<link rel="match" href="./yellowsquare-ref.html"> +<meta name="assert" content="display-p3 with no alpha"> +<style> + body { background-color: grey; } + .test { background-color: red; width: 12em; height: 6em; margin-top: 0; } + .ref { background-color: yellow; width: 12em; height: 6em; margin-bottom: 0; } /* sRGB yellow converted to display-p3 */ + .test { background-color: color(display-p3 1 1 0.330897); } +</style> +<body> + <p>Test passes if you see a yellow square, and no red.</p> + <div class="ref"></div> + <div class="test"></div> +</body>
diff --git a/third_party/blink/web_tests/external/wpt/css/css-color/display-p3-006.html b/third_party/blink/web_tests/external/wpt/css/css-color/display-p3-006.html new file mode 100644 index 0000000..0285af8 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/css/css-color/display-p3-006.html
@@ -0,0 +1,24 @@ +<!DOCTYPE html> +<meta charset="utf-8"> +<title>CSS Color 4: display-p3 and sRGB with medium chroma</title> +<link rel="author" title="Chris Lilley" href="mailto:chris@w3.org"> +<link rel="help" href="https://drafts.csswg.org/css-color-4/#valdef-color-display-p3"> +<link rel="help" href="https://drafts.csswg.org/css-color-4/#predefined-sRGB"> +<link rel="help" href="https://drafts.csswg.org/css-color-4/#oklab-lab-to-predefined"> +<link rel="match" href="mossgreensquare-ref.html"> +<meta name="assert" content="display-p3 with no alpha"> +<style> + .test, .test2 { background-color: red; width: 12em; height: 4em; } + .ref {background-color: rgb(44.8436% 53.537% 28.8112%); width: 12em; height: 4em; } + /* lch(54% 35 118) converted to legacy sRGB */ + .test { background-color: color(display-p3 0.465377 0.532768 0.317713); } + /* lch(54% 35 118) converted to display-p3 */ + .test2 {background-color: color(srgb 0.448436 0.53537 0.288113); } + /* lch(54% 35 118) converted to color(sRGB) */ +</style> +<body> + <p>Test passes if you see a moss green square, and no red.</p> + <div class="test"></div> + <div class="ref"></div> + <div class="test2"></div> +</body>
diff --git a/third_party/blink/web_tests/external/wpt/css/css-color/mossgreensquare-ref.html b/third_party/blink/web_tests/external/wpt/css/css-color/mossgreensquare-ref.html new file mode 100644 index 0000000..06f866c --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/css/css-color/mossgreensquare-ref.html
@@ -0,0 +1,10 @@ +<!DOCTYPE html> +<meta charset="utf-8"> +<title>Moss green (medium chroma) square reference</title> +<style> + .test { background-color: rgb(44.8436% 53.537% 28.8112%); width: 12em; height: 12em;} +</style> +<body> + <p>Test passes if you see a moss green square, and no red.</p> + <div class="test"></div> +</body>
diff --git a/third_party/blink/web_tests/external/wpt/css/css-color/yellowsquare-ref.html b/third_party/blink/web_tests/external/wpt/css/css-color/yellowsquare-ref.html new file mode 100644 index 0000000..34463bc --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/css/css-color/yellowsquare-ref.html
@@ -0,0 +1,11 @@ +<!DOCTYPE html> +<meta charset="utf-8"> +<title>sRGB yellow square reference</title> +<style> + body { background-color: grey; } + .test { background-color: #FFFF00; width: 12em; height: 12em; } +</style> +<body> + <p>Test passes if you see a yellow square, and no red.</p> + <div class="test"></div> +</body>
diff --git a/third_party/blink/web_tests/external/wpt/css/css-sizing/table-child-percentage-height-with-border-box-expected.html b/third_party/blink/web_tests/external/wpt/css/css-sizing/table-child-percentage-height-with-border-box-expected.html index 2b0a2f45..b9d2418 100644 --- a/third_party/blink/web_tests/external/wpt/css/css-sizing/table-child-percentage-height-with-border-box-expected.html +++ b/third_party/blink/web_tests/external/wpt/css/css-sizing/table-child-percentage-height-with-border-box-expected.html
@@ -9,20 +9,18 @@ } body { box-sizing: border-box; - display: table; margin: 0 auto; width: 100%; height: 100%; } .content { box-sizing: border-box; - display: table-row; width: 100%; height: 100%; background-color: red; } .wrapper { - box-sizing: content-box; + box-sizing: border-box; width: 100%; height: 100%; background-color: green;
diff --git a/third_party/blink/web_tests/external/wpt/infrastructure/server/http2-websocket.sub.h2.any.worker-expected.txt b/third_party/blink/web_tests/external/wpt/infrastructure/server/http2-websocket.sub.h2.any.worker-expected.txt deleted file mode 100644 index 05699767..0000000 --- a/third_party/blink/web_tests/external/wpt/infrastructure/server/http2-websocket.sub.h2.any.worker-expected.txt +++ /dev/null
@@ -1,4 +0,0 @@ -This is a testharness.js-based test. -Harness Error. harness_status.status = 1 , harness_status.message = Uncaught NetworkError: Failed to execute 'importScripts' on 'WorkerGlobalScope': The script at 'http://web-platform.test:8001/infrastructure/server/http2-websocket.sub.h2.any.js' failed to load. -Harness: the test ran to completion. -
diff --git a/third_party/blink/web_tests/external/wpt/websockets/Close-1000-reason.any.worker_wpt_flags=h2-expected.txt b/third_party/blink/web_tests/external/wpt/websockets/Close-1000-reason.any.worker_wpt_flags=h2-expected.txt new file mode 100644 index 0000000..dc3fa03 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/websockets/Close-1000-reason.any.worker_wpt_flags=h2-expected.txt
@@ -0,0 +1,4 @@ +This is a testharness.js-based test. +FAIL Create WebSocket - Close the Connection - close(1000, reason) - readyState should be in CLOSED state and wasClean is TRUE - Connection should be closed assert_true: WebSocket connection should be opened expected true got false +Harness: the test ran to completion. +
diff --git a/third_party/blink/web_tests/external/wpt/websockets/Close-server-initiated-close.any.worker_wpt_flags=h2-expected.txt b/third_party/blink/web_tests/external/wpt/websockets/Close-server-initiated-close.any.worker_wpt_flags=h2-expected.txt new file mode 100644 index 0000000..1711963 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/websockets/Close-server-initiated-close.any.worker_wpt_flags=h2-expected.txt
@@ -0,0 +1,4 @@ +This is a testharness.js-based test. +FAIL Create WebSocket - Server initiated Close - Client sends back a CLOSE - readyState should be in CLOSED state and wasClean is TRUE - Connection should be closed assert_true: WebSocket connection should be open expected true got false +Harness: the test ran to completion. +
diff --git a/third_party/blink/web_tests/external/wpt/websockets/Create-valid-url-array-protocols.any.worker_wpt_flags=h2-expected.txt b/third_party/blink/web_tests/external/wpt/websockets/Create-valid-url-array-protocols.any.worker_wpt_flags=h2-expected.txt new file mode 100644 index 0000000..f7aa3bd --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/websockets/Create-valid-url-array-protocols.any.worker_wpt_flags=h2-expected.txt
@@ -0,0 +1,4 @@ +This is a testharness.js-based test. +FAIL Create WebSocket - Pass a valid URL and array of protocol strings - Connection should be closed assert_true: WebSocket connection should be open expected true got false +Harness: the test ran to completion. +
diff --git a/third_party/blink/web_tests/external/wpt/websockets/Send-binary-arraybufferview-float64.any_wpt_flags=h2-expected.txt b/third_party/blink/web_tests/external/wpt/websockets/Send-binary-arraybufferview-float64.any_wpt_flags=h2-expected.txt new file mode 100644 index 0000000..51f63a3b --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/websockets/Send-binary-arraybufferview-float64.any_wpt_flags=h2-expected.txt
@@ -0,0 +1,4 @@ +This is a testharness.js-based test. +FAIL Send binary data on a WebSocket - ArrayBufferView - Float64Array - Connection should be closed assert_true: WebSocket connection should be open expected true got false +Harness: the test ran to completion. +
diff --git a/third_party/blink/web_tests/external/wpt/websockets/Send-binary-arraybufferview-int16-offset.any.worker_wpt_flags=h2-expected.txt b/third_party/blink/web_tests/external/wpt/websockets/Send-binary-arraybufferview-int16-offset.any.worker_wpt_flags=h2-expected.txt new file mode 100644 index 0000000..5cf6c45 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/websockets/Send-binary-arraybufferview-int16-offset.any.worker_wpt_flags=h2-expected.txt
@@ -0,0 +1,4 @@ +This is a testharness.js-based test. +FAIL Send binary data on a WebSocket - ArrayBufferView - Int16Array with offset - Connection should be closed assert_true: WebSocket connection should be open expected true got false +Harness: the test ran to completion. +
diff --git a/third_party/blink/web_tests/external/wpt/websockets/Send-binary-arraybufferview-int16-offset.any_wpt_flags=h2-expected.txt b/third_party/blink/web_tests/external/wpt/websockets/Send-binary-arraybufferview-int16-offset.any_wpt_flags=h2-expected.txt new file mode 100644 index 0000000..5cf6c45 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/websockets/Send-binary-arraybufferview-int16-offset.any_wpt_flags=h2-expected.txt
@@ -0,0 +1,4 @@ +This is a testharness.js-based test. +FAIL Send binary data on a WebSocket - ArrayBufferView - Int16Array with offset - Connection should be closed assert_true: WebSocket connection should be open expected true got false +Harness: the test ran to completion. +
diff --git a/third_party/blink/web_tests/external/wpt/websockets/Send-binary-arraybufferview-uint32-offset.any_wpt_flags=h2-expected.txt b/third_party/blink/web_tests/external/wpt/websockets/Send-binary-arraybufferview-uint32-offset.any_wpt_flags=h2-expected.txt new file mode 100644 index 0000000..29a3626c1 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/websockets/Send-binary-arraybufferview-uint32-offset.any_wpt_flags=h2-expected.txt
@@ -0,0 +1,4 @@ +This is a testharness.js-based test. +FAIL Send binary data on a WebSocket - ArrayBufferView - Uint32Array with offset - Connection should be closed assert_true: WebSocket connection should be open expected true got false +Harness: the test ran to completion. +
diff --git a/third_party/blink/web_tests/external/wpt/websockets/Send-unpaired-surrogates.any.worker_wpt_flags=h2-expected.txt b/third_party/blink/web_tests/external/wpt/websockets/Send-unpaired-surrogates.any.worker_wpt_flags=h2-expected.txt new file mode 100644 index 0000000..69f784d --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/websockets/Send-unpaired-surrogates.any.worker_wpt_flags=h2-expected.txt
@@ -0,0 +1,4 @@ +This is a testharness.js-based test. +FAIL Send unpaired surrogates on a WebSocket - Connection should be closed assert_true: WebSocket connection should be open expected true got false +Harness: the test ran to completion. +
diff --git a/third_party/blink/web_tests/external/wpt/websockets/interfaces/WebSocket/events/018_wpt_flags=h2-expected.txt b/third_party/blink/web_tests/external/wpt/websockets/interfaces/WebSocket/events/018_wpt_flags=h2-expected.txt new file mode 100644 index 0000000..bb4458e --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/websockets/interfaces/WebSocket/events/018_wpt_flags=h2-expected.txt
@@ -0,0 +1,4 @@ +This is a testharness.js-based test. +FAIL open, message, error and close events assert_true: open event should fire expected true got false +Harness: the test ran to completion. +
diff --git a/third_party/blink/web_tests/platform/mac-mac10.13/external/wpt/dom/abort/event.any-expected.txt b/third_party/blink/web_tests/platform/mac-mac10.13/external/wpt/dom/abort/event.any-expected.txt deleted file mode 100644 index e5730d03..0000000 --- a/third_party/blink/web_tests/platform/mac-mac10.13/external/wpt/dom/abort/event.any-expected.txt +++ /dev/null
@@ -1,19 +0,0 @@ -This is a testharness.js-based test. -PASS AbortController abort() should fire event synchronously -PASS controller.signal should always return the same object -PASS controller.abort() should do nothing the second time it is called -PASS event handler should not be called if added after controller.abort() -PASS the abort event should have the right properties -PASS AbortController abort(reason) should set signal.reason -PASS aborting AbortController without reason creates an "AbortError" DOMException -PASS AbortController abort(undefined) creates an "AbortError" DOMException -PASS AbortController abort(null) should set signal.reason -PASS static aborting signal should have right properties -PASS static aborting signal with reason should set signal.reason -FAIL throwIfAborted() should throw abort.reason if signal aborted assert_throws_exactly: function "() => signal.throwIfAborted()" threw object "TypeError: signal.throwIfAborted is not a function" but we expected it to throw object "Error: boom" -FAIL throwIfAborted() should throw primitive abort.reason if signal aborted assert_throws_exactly: function "() => signal.throwIfAborted()" threw object "TypeError: signal.throwIfAborted is not a function" but we expected it to throw "hello" -FAIL throwIfAborted() should not throw if signal not aborted controller.signal.throwIfAborted is not a function -PASS AbortSignal.reason returns the same DOMException -PASS AbortController.signal.reason returns the same DOMException -Harness: the test ran to completion. -
diff --git a/third_party/blink/web_tests/platform/mac-mac10.13/external/wpt/dom/abort/event.any.worker-expected.txt b/third_party/blink/web_tests/platform/mac-mac10.13/external/wpt/dom/abort/event.any.worker-expected.txt deleted file mode 100644 index e5730d03..0000000 --- a/third_party/blink/web_tests/platform/mac-mac10.13/external/wpt/dom/abort/event.any.worker-expected.txt +++ /dev/null
@@ -1,19 +0,0 @@ -This is a testharness.js-based test. -PASS AbortController abort() should fire event synchronously -PASS controller.signal should always return the same object -PASS controller.abort() should do nothing the second time it is called -PASS event handler should not be called if added after controller.abort() -PASS the abort event should have the right properties -PASS AbortController abort(reason) should set signal.reason -PASS aborting AbortController without reason creates an "AbortError" DOMException -PASS AbortController abort(undefined) creates an "AbortError" DOMException -PASS AbortController abort(null) should set signal.reason -PASS static aborting signal should have right properties -PASS static aborting signal with reason should set signal.reason -FAIL throwIfAborted() should throw abort.reason if signal aborted assert_throws_exactly: function "() => signal.throwIfAborted()" threw object "TypeError: signal.throwIfAborted is not a function" but we expected it to throw object "Error: boom" -FAIL throwIfAborted() should throw primitive abort.reason if signal aborted assert_throws_exactly: function "() => signal.throwIfAborted()" threw object "TypeError: signal.throwIfAborted is not a function" but we expected it to throw "hello" -FAIL throwIfAborted() should not throw if signal not aborted controller.signal.throwIfAborted is not a function -PASS AbortSignal.reason returns the same DOMException -PASS AbortController.signal.reason returns the same DOMException -Harness: the test ran to completion. -
diff --git a/third_party/blink/web_tests/platform/mac-mac10.13/external/wpt/referrer-policy/gen/srcdoc.meta/strict-origin/iframe-tag.http-expected.txt b/third_party/blink/web_tests/platform/mac-mac10.13/external/wpt/referrer-policy/gen/srcdoc.meta/strict-origin/iframe-tag.http-expected.txt deleted file mode 100644 index 04a9370..0000000 --- a/third_party/blink/web_tests/platform/mac-mac10.13/external/wpt/referrer-policy/gen/srcdoc.meta/strict-origin/iframe-tag.http-expected.txt +++ /dev/null
@@ -1,15 +0,0 @@ -This is a testharness.js-based test. -PASS Referrer Policy: Expects origin for iframe-tag to cross-http origin and keep-origin redirection from http context. -PASS Referrer Policy: Expects origin for iframe-tag to cross-http origin and no-redirect redirection from http context. -PASS Referrer Policy: Expects origin for iframe-tag to cross-http origin and swap-origin redirection from http context. -PASS Referrer Policy: Expects origin for iframe-tag to cross-https origin and keep-origin redirection from http context. -PASS Referrer Policy: Expects origin for iframe-tag to cross-https origin and no-redirect redirection from http context. -PASS Referrer Policy: Expects origin for iframe-tag to cross-https origin and swap-origin redirection from http context. -PASS Referrer Policy: Expects origin for iframe-tag to same-http origin and keep-origin redirection from http context. -PASS Referrer Policy: Expects origin for iframe-tag to same-http origin and no-redirect redirection from http context. -PASS Referrer Policy: Expects origin for iframe-tag to same-http origin and swap-origin redirection from http context. -PASS Referrer Policy: Expects origin for iframe-tag to same-https origin and keep-origin redirection from http context. -PASS Referrer Policy: Expects origin for iframe-tag to same-https origin and no-redirect redirection from http context. -FAIL Referrer Policy: Expects origin for iframe-tag to same-https origin and swap-origin redirection from http context. assert_in_array: document.referrer value "http://web-platform.test:8001/referrer-policy/gen/srcdoc.meta/strict-origin/iframe-tag.http.html" not in array ["http://web-platform.test:8001/", undefined] -Harness: the test ran to completion. -
diff --git a/third_party/blink/web_tests/platform/mac-mac10.14/external/wpt/dom/abort/event.any-expected.txt b/third_party/blink/web_tests/platform/mac-mac10.14/external/wpt/dom/abort/event.any-expected.txt deleted file mode 100644 index 4d7cd78..0000000 --- a/third_party/blink/web_tests/platform/mac-mac10.14/external/wpt/dom/abort/event.any-expected.txt +++ /dev/null
@@ -1,17 +0,0 @@ -This is a testharness.js-based test. -PASS AbortController abort() should fire event synchronously -PASS controller.signal should always return the same object -PASS controller.abort() should do nothing the second time it is called -PASS event handler should not be called if added after controller.abort() -PASS the abort event should have the right properties -PASS AbortController abort(reason) should set signal.reason -PASS aborting AbortController without reason creates an "AbortError" DOMException -PASS AbortController abort(undefined) creates an "AbortError" DOMException -PASS AbortController abort(null) should set signal.reason -PASS static aborting signal should have right properties -PASS static aborting signal with reason should set signal.reason -FAIL throwIfAborted() should throw abort.reason if signal aborted assert_throws_exactly: function "() => signal.throwIfAborted()" threw object "TypeError: signal.throwIfAborted is not a function" but we expected it to throw object "Error: boom" -FAIL throwIfAborted() should throw primitive abort.reason if signal aborted assert_throws_exactly: function "() => signal.throwIfAborted()" threw object "TypeError: signal.throwIfAborted is not a function" but we expected it to throw "hello" -FAIL throwIfAborted() should not throw if signal not aborted controller.signal.throwIfAborted is not a function -Harness: the test ran to completion. -
diff --git a/third_party/blink/web_tests/platform/mac-mac10.14/external/wpt/dom/abort/event.any.worker-expected.txt b/third_party/blink/web_tests/platform/mac-mac10.14/external/wpt/dom/abort/event.any.worker-expected.txt deleted file mode 100644 index 4d7cd78..0000000 --- a/third_party/blink/web_tests/platform/mac-mac10.14/external/wpt/dom/abort/event.any.worker-expected.txt +++ /dev/null
@@ -1,17 +0,0 @@ -This is a testharness.js-based test. -PASS AbortController abort() should fire event synchronously -PASS controller.signal should always return the same object -PASS controller.abort() should do nothing the second time it is called -PASS event handler should not be called if added after controller.abort() -PASS the abort event should have the right properties -PASS AbortController abort(reason) should set signal.reason -PASS aborting AbortController without reason creates an "AbortError" DOMException -PASS AbortController abort(undefined) creates an "AbortError" DOMException -PASS AbortController abort(null) should set signal.reason -PASS static aborting signal should have right properties -PASS static aborting signal with reason should set signal.reason -FAIL throwIfAborted() should throw abort.reason if signal aborted assert_throws_exactly: function "() => signal.throwIfAborted()" threw object "TypeError: signal.throwIfAborted is not a function" but we expected it to throw object "Error: boom" -FAIL throwIfAborted() should throw primitive abort.reason if signal aborted assert_throws_exactly: function "() => signal.throwIfAborted()" threw object "TypeError: signal.throwIfAborted is not a function" but we expected it to throw "hello" -FAIL throwIfAborted() should not throw if signal not aborted controller.signal.throwIfAborted is not a function -Harness: the test ran to completion. -
diff --git a/third_party/blink/web_tests/virtual/stable/webexposed/element-instance-property-listing-expected.txt b/third_party/blink/web_tests/virtual/stable/webexposed/element-instance-property-listing-expected.txt index bcfc977..bb64a4d1 100644 --- a/third_party/blink/web_tests/virtual/stable/webexposed/element-instance-property-listing-expected.txt +++ b/third_party/blink/web_tests/virtual/stable/webexposed/element-instance-property-listing-expected.txt
@@ -711,6 +711,7 @@ property setCustomValidity property setRangeText property setSelectionRange + property showPicker property size property src property step
diff --git a/third_party/blink/web_tests/virtual/stable/webexposed/global-interface-listing-expected.txt b/third_party/blink/web_tests/virtual/stable/webexposed/global-interface-listing-expected.txt index bfe7823..6d1cddc 100644 --- a/third_party/blink/web_tests/virtual/stable/webexposed/global-interface-listing-expected.txt +++ b/third_party/blink/web_tests/virtual/stable/webexposed/global-interface-listing-expected.txt
@@ -3179,6 +3179,7 @@ method setCustomValidity method setRangeText method setSelectionRange + method showPicker method stepDown method stepUp setter accept
diff --git a/third_party/blink/web_tests/wpt_internal/webcodecs/basic_video_encoding.https.any.js b/third_party/blink/web_tests/wpt_internal/webcodecs/basic_video_encoding.https.any.js index 756fe7a..17b271eb 100644 --- a/third_party/blink/web_tests/wpt_internal/webcodecs/basic_video_encoding.https.any.js +++ b/third_party/blink/web_tests/wpt_internal/webcodecs/basic_video_encoding.https.any.js
@@ -31,6 +31,7 @@ output(chunk, metadata) { let config = metadata.decoderConfig; if (config) { + config.hardwareAcceleration = acc; decoder.configure(config); } decoder.decode(chunk);
diff --git a/tools/accessibility/rebase_dump_accessibility_tree_test.py b/tools/accessibility/rebase_dump_accessibility_tree_test.py index 513b105..8cdab8b 100755 --- a/tools/accessibility/rebase_dump_accessibility_tree_test.py +++ b/tools/accessibility/rebase_dump_accessibility_tree_test.py
@@ -48,13 +48,13 @@ line = result.group(1) # For Android tests: if line[:2] == 'I ': - result = re.search('I \d+\.\d+s run_tests_on_device\([0-9a-f]+\) (.*)', + result = re.search('I \d+\.\d+s run_tests_on_device\([0-9a-f]+\)\s+(.*)', line) if result: - line = group(1) + line = result.group(1) # For Android content_shell_test_apk tests: elif line[:2] == 'C ': - result = re.search('C \d+\.\d+s Main ([T|E|A|W|\+](.*))', line) + result = re.search('C \d+\.\d+s Main\s+([T|E|A|W|\+](.*))', line) if result: line = result.group(1)
diff --git a/tools/mb/mb.py b/tools/mb/mb.py index 67391c7..0ed6164 100755 --- a/tools/mb/mb.py +++ b/tools/mb/mb.py
@@ -20,7 +20,6 @@ import os import pipes import platform -import pprint import re import shutil import sys @@ -1574,12 +1573,12 @@ return 1 self.WriteFile(isolate_path, - pprint.pformat({ + json.dumps({ 'variables': { 'command': command, 'files': files, } - }) + '\n') + }, sort_keys=True) + '\n') self.WriteJSON( {
diff --git a/tools/mb/mb_unittest.py b/tools/mb/mb_unittest.py index 935ba62..3af390fb 100755 --- a/tools/mb/mb_unittest.py +++ b/tools/mb/mb_unittest.py
@@ -293,6 +293,8 @@ class UnitTest(unittest.TestCase): + maxDiff = None + def fake_mbw(self, files=None, win32=False): mbw = FakeMBW(win32=win32) mbw.files.setdefault(mbw.default_config, TEST_CONFIG) @@ -750,8 +752,13 @@ '/fake_src/out/Default/base_unittests.runtime_deps': ("base_unittests\n"), } - self.check(['run', '-c', 'debug_goma', '//out/Default', - 'base_unittests'], files=files, ret=0) + mbw = self.check(['run', '-c', 'debug_goma', '//out/Default', + 'base_unittests'], files=files, ret=0) + # pylint: disable=line-too-long + self.assertEqual( + mbw.files['/fake_src/out/Default/base_unittests.isolate'], + '{"variables": {"command": ["vpython3", "../../testing/test_env.py", "./base_unittests", "--test-launcher-bot-mode", "--asan=0", "--lsan=0", "--msan=0", "--tsan=0", "--cfi-diag=0"], "files": ["../../.vpython3", "../../testing/test_env.py"]}}\n') + # pylint: enable=line-too-long def test_run_swarmed(self): files = {
diff --git a/tools/metrics/histograms/enums.xml b/tools/metrics/histograms/enums.xml index 69f10c5..7a24f1f4 100644 --- a/tools/metrics/histograms/enums.xml +++ b/tools/metrics/histograms/enums.xml
@@ -31451,12 +31451,14 @@ <enum name="FastPairEngagementFlowEvent"> <int value="1" label="Discovery UI Shown"/> - <int value="11" label="Discovery UI Dismissed"/> + <int value="11" label="Discovery UI Dismissed By OS"/> <int value="12" label="Discovery UI: Connect Button Pressed"/> + <int value="13" label="Discovery UI Dismissed By User"/> <int value="121" label="Pairing Failed"/> <int value="122" label="Pairing Succeeded"/> - <int value="1211" label="Pairing Failed: Error UI Dismissed"/> + <int value="1211" label="Pairing Failed: Error UI Dismissed By OS"/> <int value="1212" label="Pairing Failed: Error UI Settings Button Pressed"/> + <int value="1213" label="Pairing Failed: Error UI Dismissed By User"/> </enum> <enum name="FastPairPairingMethod"> @@ -35933,6 +35935,7 @@ <int value="4094" label="AllowPaymentRequestAttributeHasEffect"/> <int value="4095" label="V8PaymentResponse_Retry_Method"/> <int value="4096" label="WebAppManifestUserPreferences"/> + <int value="4097" label="V8HTMLInputElement_ShowPicker_Method"/> </enum> <enum name="FeaturePolicyAllowlistType"> @@ -48283,6 +48286,7 @@ <int value="60" label="SBOX_ERROR_CANNOT_UPDATE_JOB_PROCESS_LIMIT"/> <int value="61" label="SBOX_ERROR_CANNOT_CREATE_LOWBOX_IMPERSONATION_TOKEN"/> <int value="62" label="SBOX_ERROR_UNSANDBOXED_PROCESS"/> + <int value="63" label="SBOX_ERROR_CANNOT_LAUNCH_UNSANDBOXED_PROCESS"/> <int value="1002" label="LAUNCH_RESULT_SUCCESS"/> <int value="1003" label="LAUNCH_RESULT_FAILURE"/> </enum> @@ -50839,6 +50843,7 @@ <int value="-1372926635" label="AndroidManagedByMenuItem:disabled"/> <int value="-1371984027" label="CrostiniWebUIUpgrader:disabled"/> <int value="-1371239786" label="EnablePasswordsAccountStorage:enabled"/> + <int value="-1370883795" label="TerminalTmuxIntegration:disabled"/> <int value="-1370532920" label="AppServiceAsh:enabled"/> <int value="-1369613781" label="FileHandlingIcons:disabled"/> <int value="-1369089674" label="ArcTouchModeMouse:enabled"/> @@ -53452,6 +53457,7 @@ <int value="581118445" label="enable-eol-notification"/> <int value="581355159" label="ContentSuggestionsCategoryRanker:disabled"/> <int value="582187448" label="DontPrefetchLibraries:enabled"/> + <int value="584509342" label="TerminalTmuxIntegration:enabled"/> <int value="584541349" label="ContextualSearchSingleActions:disabled"/> <int value="584661108" label="OmniboxHistoryQuickProviderAllowButDoNotScoreMidwordTerms:disabled"/> @@ -87523,6 +87529,13 @@ <int value="16" label="Disabled by URL-keyed anonymized data collection"/> </enum> +<enum name="ULPInitiationStatus"> + <int value="0" label="Success"/> + <int value="1" label="Not supported"/> + <int value="2" label="Timed out"/> + <int value="3" label="Failure, exception"/> +</enum> + <enum name="ULPLanguageStatus"> <int value="0" label="Top ULP language"/> <int value="1" label="Non-top ULP language"/>
diff --git a/tools/metrics/histograms/metadata/file/histograms.xml b/tools/metrics/histograms/metadata/file/histograms.xml index c4e32ed..fece4e6 100644 --- a/tools/metrics/histograms/metadata/file/histograms.xml +++ b/tools/metrics/histograms/metadata/file/histograms.xml
@@ -705,6 +705,10 @@ <histogram name="FileBrowser.Share.FileType" enum="ViewFileType" expires_after="2022-04-24"> + <obsolete> + Removed in M99. File sharing is now done by Sharesheet, not Files.app. + Replaced with ChromeOS.Sharesheet.Invocation.Mimetype. + </obsolete> <owner>simmonsjosh@google.com</owner> <owner>src/ui/file_manager/OWNERS</owner> <summary>
diff --git a/tools/metrics/histograms/metadata/language/histograms.xml b/tools/metrics/histograms/metadata/language/histograms.xml index 7d170b3..4efd25c 100644 --- a/tools/metrics/histograms/metadata/language/histograms.xml +++ b/tools/metrics/histograms/metadata/language/histograms.xml
@@ -361,6 +361,22 @@ </summary> </histogram> +<histogram name="LanguageUsage.ULP.Initiation.Status{AccountType}" + enum="ULPInitiationStatus" expires_after="2022-06-30"> + <owner>jds@google.com</owner> + <owner>chrome-language@google.com</owner> + <summary> + The result of initializing ULP, including {AccountType}. + + Recorded once at startup when ULP is initialized. + </summary> + <token key="AccountType"> + <variant name="" summary="all account types"/> + <variant name=".DefaultAccount" summary="only signed-out users"/> + <variant name=".SignedIn" summary="only signed-in users"/> + </token> +</histogram> + <histogram name="LanguageUsage.ULP.Initiation.TopAcceptLanguageInULP" enum="ULPLanguageStatus" expires_after="2022-06-30"> <owner>jds@google.com</owner>
diff --git a/tools/metrics/histograms/metadata/others/histograms.xml b/tools/metrics/histograms/metadata/others/histograms.xml index 6a6b588..fbe2e85 100644 --- a/tools/metrics/histograms/metadata/others/histograms.xml +++ b/tools/metrics/histograms/metadata/others/histograms.xml
@@ -4807,7 +4807,7 @@ </histogram> <histogram name="DirectSockets.PermissionDeniedFailures" - enum="DirectSocketPermissionFailureType" expires_after="2022-1-20"> + enum="DirectSocketPermissionFailureType" expires_after="2022-06-07"> <owner>ericwilligers@chromium.org</owner> <owner>glenrob@chromium.org</owner> <summary>
diff --git a/tools/metrics/histograms/metadata/page/histograms.xml b/tools/metrics/histograms/metadata/page/histograms.xml index 94dbc8af..3f526036 100644 --- a/tools/metrics/histograms/metadata/page/histograms.xml +++ b/tools/metrics/histograms/metadata/page/histograms.xml
@@ -710,7 +710,7 @@ <histogram name="PageLoad.Clients.Prerender.InteractiveTiming.FirstInputDelay4{PrerenderTriggerType}" - units="ms" expires_after="2022-01-27"> + units="ms" expires_after="2022-06-27"> <owner>ksakamoto@chromium.org</owner> <owner>asamidoi@chromium.org</owner> <owner>src/content/browser/prerender/OWNERS</owner> @@ -728,7 +728,7 @@ <histogram name="PageLoad.Clients.Prerender.LayoutInstability.CumulativeShiftScore.MainFrame{PrerenderTriggerType}" - units="ms" expires_after="2022-01-27"> + units="ms" expires_after="2022-06-27"> <owner>ksakamoto@chromium.org</owner> <owner>asamidoi@chromium.org</owner> <owner>src/content/browser/prerender/OWNERS</owner> @@ -747,7 +747,7 @@ <histogram name="PageLoad.Clients.Prerender.LayoutInstability.CumulativeShiftScore{PrerenderTriggerType}" - units="ms" expires_after="2022-01-27"> + units="ms" expires_after="2022-06-27"> <owner>ksakamoto@chromium.org</owner> <owner>asamidoi@chromium.org</owner> <owner>src/content/browser/prerender/OWNERS</owner> @@ -765,7 +765,7 @@ <histogram name="PageLoad.Clients.Prerender.NavigationToActivation{PrerenderTriggerType}" - units="ms" expires_after="2022-01-27"> + units="ms" expires_after="2022-06-27"> <owner>ksakamoto@chromium.org</owner> <owner>asamidoi@chromium.org</owner> <owner>src/content/browser/prerender/OWNERS</owner> @@ -784,7 +784,7 @@ <histogram name="PageLoad.Clients.Prerender.PaintTiming.ActivationToFirstContentfulPaint{PrerenderTriggerType}" - units="ms" expires_after="2022-01-27"> + units="ms" expires_after="2022-06-27"> <owner>ksakamoto@chromium.org</owner> <owner>asamidoi@chromium.org</owner> <owner>src/content/browser/prerender/OWNERS</owner> @@ -804,7 +804,7 @@ <histogram name="PageLoad.Clients.Prerender.PaintTiming.ActivationToFirstPaint{PrerenderTriggerType}" - units="ms" expires_after="2022-01-27"> + units="ms" expires_after="2022-06-27"> <owner>ksakamoto@chromium.org</owner> <owner>asamidoi@chromium.org</owner> <owner>src/content/browser/prerender/OWNERS</owner> @@ -823,7 +823,7 @@ <histogram name="PageLoad.Clients.Prerender.PaintTiming.ActivationToLargestContentfulPaint2{PrerenderTriggerType}" - units="ms" expires_after="2022-01-27"> + units="ms" expires_after="2022-06-27"> <owner>ksakamoto@chromium.org</owner> <owner>asamidoi@chromium.org</owner> <owner>src/content/browser/prerender/OWNERS</owner>
diff --git a/tools/metrics/histograms/metadata/webapps/histograms.xml b/tools/metrics/histograms/metadata/webapps/histograms.xml index a069d29..c743ae7e 100644 --- a/tools/metrics/histograms/metadata/webapps/histograms.xml +++ b/tools/metrics/histograms/metadata/webapps/histograms.xml
@@ -431,6 +431,22 @@ </summary> </histogram> +<histogram name="WebApp.Preinstalled.AppToReplaceStillDefaultInstalledCount" + units="apps" expires_after="2022-04-17"> + <owner>alancutter@chromium.org</owner> + <owner>desktop-pwas-team@google.com</owner> + <summary> + Preinstalled web app configs can specify a set of apps to uninstall after + the preinstalled web app is installed. + + This records how many apps that are meant to be uninstalled are still + default installed; see https://crbug.com/1266234. + + This gets recorded at start up after preinstalled web apps configs have been + applied. + </summary> +</histogram> + <histogram name="WebApp.Preinstalled.AppToReplaceStillInstalledCount" units="apps" expires_after="2022-04-17"> <owner>alancutter@chromium.org</owner> @@ -464,22 +480,6 @@ </summary> </histogram> -<histogram name="WebApp.Preinstalled.AppToReplaceStillSyncInstalledCount" - units="apps" expires_after="2022-04-17"> - <owner>alancutter@chromium.org</owner> - <owner>desktop-pwas-team@google.com</owner> - <summary> - Preinstalled web app configs can specify a set of apps to uninstall after - the preinstalled web app is installed. - - This records how many apps that are meant to be uninstalled are still - installed due to Chrome app sync; see https://crbug.com/1266234. - - This gets recorded at start up after preinstalled web apps configs have been - applied. - </summary> -</histogram> - <histogram name="WebApp.Preinstalled.ConfigErrorCount" units="apps" expires_after="2022-06-05"> <owner>alancutter@chromium.org</owner>
diff --git a/tools/perf/core/perfetto_binary_roller/binary_deps.json b/tools/perf/core/perfetto_binary_roller/binary_deps.json index c04afacb..16a869a 100644 --- a/tools/perf/core/perfetto_binary_roller/binary_deps.json +++ b/tools/perf/core/perfetto_binary_roller/binary_deps.json
@@ -5,8 +5,8 @@ "remote_path": "perfetto_binaries/trace_processor_shell/linux_arm/49b4b5dcbc312d8d2c3751cf29238b8efeb4e494/trace_processor_shell" }, "win": { - "hash": "c4efce6c0cefe5e1c137bbbfe5ed1189b38b8da9", - "remote_path": "perfetto_binaries/trace_processor_shell/win/22467673a50f5599e7d8b1f49982faf7c1bc30d9/trace_processor_shell.exe" + "hash": "6cd3704685eb81ad27d4246180ee629c1c6d9488", + "remote_path": "perfetto_binaries/trace_processor_shell/win/15e3467297c3877d090e92940a04b085318ab933/trace_processor_shell.exe" }, "mac": { "hash": "11daea10c30ca26ac3695540f3b07b83665ed7e1", @@ -17,8 +17,8 @@ "remote_path": "perfetto_binaries/trace_processor_shell/linux_arm64/49b4b5dcbc312d8d2c3751cf29238b8efeb4e494/trace_processor_shell" }, "linux": { - "hash": "bedc0c16f454388d206b5b054fc36122bbeb4ba2", - "remote_path": "perfetto_binaries/trace_processor_shell/linux/22467673a50f5599e7d8b1f49982faf7c1bc30d9/trace_processor_shell" + "hash": "46bd1cb0b881714948a74f091500c22f241fea08", + "remote_path": "perfetto_binaries/trace_processor_shell/linux/15e3467297c3877d090e92940a04b085318ab933/trace_processor_shell" } }, "power_profile.sql": {
diff --git a/ui/android/java/src/org/chromium/ui/base/Clipboard.java b/ui/android/java/src/org/chromium/ui/base/Clipboard.java index 25d1fb85..ce4d8e3 100644 --- a/ui/android/java/src/org/chromium/ui/base/Clipboard.java +++ b/ui/android/java/src/org/chromium/ui/base/Clipboard.java
@@ -49,6 +49,7 @@ import org.chromium.ui.widget.Toast; import org.chromium.url.GURL; +import java.io.ByteArrayOutputStream; import java.io.FileInputStream; import java.io.IOException; import java.util.List; @@ -69,6 +70,9 @@ // This mime type annotates that clipboard contains a text. private static final String TEXT_MIME_TYPE = "text/*"; + // This mime type annotates that clipboard contains a PNG image. + private static final String PNG_MIME_TYPE = "image/png"; + @SuppressLint("StaticFieldLeak") private static Clipboard sInstance; @@ -406,8 +410,27 @@ ContentResolver cr = ContextUtils.getApplicationContext().getContentResolver(); String mimeType = cr.getType(uri); - if (!"image/png".equalsIgnoreCase(mimeType)) return null; + if (!PNG_MIME_TYPE.equalsIgnoreCase(mimeType)) { + if (!hasImage()) return null; + // Android system clipboard contains an image, but it is not a PNG. + // Try reading it as a bitmap and encoding to a PNG. + try { + // TODO(crbug.com/1280468): This uses the unsafe ImageDecoder class. + Bitmap bitmap = ApiCompatibilityUtils.getBitmapByUri(cr, uri); + ByteArrayOutputStream baos = new ByteArrayOutputStream(); + // |quality| is ignored since PNG encoding is lossless. See + // https://developer.android.com/reference/android/graphics/Bitmap.CompressFormat#PNG. + bitmap.compress(Bitmap.CompressFormat.PNG, /*quality=*/100, baos); + if (baos.size() > MAX_ALLOWED_PNG_SIZE_BYTES) return null; + + return baos.toByteArray(); + } catch (IOException | OutOfMemoryError e) { + return null; + } + } + + // The image is a PNG. Read and return the raw bytes. FileInputStream fileStream = null; try (AssetFileDescriptor afd = cr.openAssetFileDescriptor(uri, "r")) { if (afd == null || afd.getLength() > MAX_ALLOWED_PNG_SIZE_BYTES @@ -723,16 +746,6 @@ } /** - * Check if |bitmap| is support by native side. gfx::CreateSkBitmapFromJavaBitmap only support - * ARGB_8888 and ALPHA_8. - */ - private boolean bitmapSupportByGfx(Bitmap bitmap) { - return bitmap != null - && (bitmap.getConfig() == Bitmap.Config.ARGB_8888 - || bitmap.getConfig() == Bitmap.Config.ALPHA_8); - } - - /** * Allows the ClipboardManager Android Service to be replaced with a mock for tests, returning * the original so that it can be restored. */
diff --git a/ui/file_manager/file_manager/foreground/js/file_manager_commands.js b/ui/file_manager/file_manager/foreground/js/file_manager_commands.js index e1d4a27..6545d89 100644 --- a/ui/file_manager/file_manager/foreground/js/file_manager_commands.js +++ b/ui/file_manager/file_manager/foreground/js/file_manager_commands.js
@@ -1757,7 +1757,6 @@ CommandHandler.COMMANDS_['invoke-sharesheet'] = new class extends FilesCommand { execute(event, fileManager) { const entries = fileManager.selectionHandler.selection.entries; - FileTasks.recordSharingFileTypesUMA_(entries); const launchSource = CommandUtil.getSharesheetLaunchSource(event); chrome.fileManagerPrivate.invokeSharesheet(entries, launchSource, () => { if (chrome.runtime.lastError) {
diff --git a/ui/file_manager/file_manager/foreground/js/file_tasks.js b/ui/file_manager/file_manager/foreground/js/file_tasks.js index d0acb2f..f0a46e10 100644 --- a/ui/file_manager/file_manager/foreground/js/file_tasks.js +++ b/ui/file_manager/file_manager/foreground/js/file_tasks.js
@@ -229,18 +229,6 @@ } /** - * Records UMA statistics for file types being shared in Share action. - * @param {!Array<!FileEntry>} entries File entries to be shared. - */ - static recordSharingFileTypesUMA_(entries) { - for (const entry of entries) { - metrics.recordEnum( - 'Share.FileType', FileTasks.getViewFileType(entry), - FileTasks.UMA_INDEX_KNOWN_EXTENSIONS); - } - } - - /** * Records trial of opening file grouped by extensions. * * @param {!VolumeManager} volumeManager
diff --git a/ui/file_manager/file_manager/foreground/js/file_tasks_unittest.m.js b/ui/file_manager/file_manager/foreground/js/file_tasks_unittest.m.js index 3a8b389..f27b66bf 100644 --- a/ui/file_manager/file_manager/foreground/js/file_tasks_unittest.m.js +++ b/ui/file_manager/file_manager/foreground/js/file_tasks_unittest.m.js
@@ -617,22 +617,6 @@ } /** - * Checks that we are correctly recording UMA about Share action. - */ -export function testRecordSharingFileTypes() { - // Setup: create a fake metrics object that can be examined for content. - const mockFileSystem = new MockFileSystem('volumeId'); - - // Actual tests. - FileTasks.recordSharingFileTypesUMA_([ - MockFileEntry.create(mockFileSystem, '/test.log'), - MockFileEntry.create(mockFileSystem, '/test.doc'), - MockFileEntry.create(mockFileSystem, '/test.__no_such_extension__'), - ]); - assertArrayEquals(enumMap.get('Share.FileType'), ['.log', '.doc', 'other']); -} - -/** * Checks that the progress center is properly updated when mounting archives * successfully. * @suppress {visibility}
diff --git a/ui/webui/resources/cr_elements/cr_icon_button/cr_icon_button.m.d.ts b/ui/webui/resources/cr_elements/cr_icon_button/cr_icon_button.m.d.ts index 674e241..cc31c310 100644 --- a/ui/webui/resources/cr_elements/cr_icon_button/cr_icon_button.m.d.ts +++ b/ui/webui/resources/cr_elements/cr_icon_button/cr_icon_button.m.d.ts
@@ -5,7 +5,7 @@ import {LegacyElementMixin} from 'chrome://resources/polymer/v3_0/polymer/lib/legacy/legacy-element-mixin.js'; interface CrIconButtonElement extends LegacyElementMixin, HTMLElement { - disabled: boolean; + disabled: boolean|null|undefined; customTabIndex: number|null|undefined; ironIcon: string|null|undefined; hostAttributes: object|null;