diff --git a/DEPS b/DEPS index 6e73a6b..f7ba0c1 100644 --- a/DEPS +++ b/DEPS
@@ -117,9 +117,9 @@ # output. 'checkout_js_coverage_modules': True, - # Check out and download nacl by default, unless on an arm mac. + # Check out and download nacl by default, unless on Windows or Mac. # This can be disabled e.g. with custom_vars. - 'checkout_nacl': 'not (host_os == "mac" and host_cpu == "arm64")', + 'checkout_nacl': 'not (host_os == "win" or host_os == "mac")', # By default, do not check out src-internal. This can be overridden e.g. with # custom_vars. @@ -313,11 +313,11 @@ # Three lines of non-changing comments so that # the commit queue can handle CLs rolling V8 # and whatever else without interference from each other. - 'src_internal_revision': '9c367def13a736fbfb43dcaf182aa1ee74c15f51', + 'src_internal_revision': '7056b58bd3f5af3896df93abd40a24e7fb713edc', # 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': 'ff3c2e3d45bdc793cddc65a3c9fce937b09d1dfd', + 'skia_revision': 'f1d1fd98c2c18690472a9ce61b74d68bf27e6153', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling V8 # and whatever else without interference from each other. @@ -408,7 +408,7 @@ # Three lines of non-changing comments so that # the commit queue can handle CLs rolling devtools-frontend # and whatever else without interference from each other. - 'devtools_frontend_revision': 'a4cc1be16a5fecf8333afbb0a8bbbd70e09bdd94', + 'devtools_frontend_revision': '6d7d7d68a5261f61ea22a032b43bca6ac18fbec6', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling libprotobuf-mutator # and whatever else without interference from each other. @@ -448,11 +448,11 @@ # Three lines of non-changing comments so that # the commit queue can handle CLs rolling feed # and whatever else without interference from each other. - 'dawn_revision': '48a4eabdad4985dff82e2dc897d8245a2df4a36f', + 'dawn_revision': '5784a4bd7a0ca25ff2ec57a2b9759a34621ba51c', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling feed # and whatever else without interference from each other. - 'quiche_revision': 'cc0614c8ab209e297f7b17ab3d04618fee327a4f', + 'quiche_revision': 'c780c704064c03692437fcf2093ba2fa58076584', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling ios_webkit # and whatever else without interference from each other. @@ -492,7 +492,7 @@ # Three lines of non-changing comments so that # the commit queue can handle CLs rolling feed # and whatever else without interference from each other. - 'cros_components_revision': '4c11996077fff68dffc03883264a4882ad092cd7', + 'cros_components_revision': 'bfe08a0f31085ed4fe7c336a5c033e43853249db', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling feed # and whatever else without interference from each other. @@ -848,12 +848,12 @@ 'src/clank': { 'url': Var('chrome_git') + '/clank/internal/apps.git' + '@' + - 'ca65bbdc942e24020527a15c1df39e5f86ff8d95', + 'c227544ad8d79001606dc7a120a52223c7aeddfd', 'condition': 'checkout_android and checkout_src_internal', }, 'src/docs/website': { - 'url': Var('chromium_git') + '/website.git' + '@' + '729b7e9744581b96bf9a8dfea8b4e34c19c3bb10', + 'url': Var('chromium_git') + '/website.git' + '@' + '6b457cc0681ddb8bbdd0f874e9fce8312a50a5c7', }, 'src/ios/third_party/earl_grey2/src': { @@ -1054,7 +1054,7 @@ 'packages': [ { 'package': 'chromium/third_party/androidx', - 'version': 'n-49vMsfeUdbL-4uiGFCKiXPdIOzcg6-aFmLL64c2foC', + 'version': 'rmHTIvq0ZcpO2SLGZ62OzCmZLi_-iLI0USquMgUITeoC', }, ], 'condition': 'checkout_android', @@ -1298,13 +1298,13 @@ }, 'src/third_party/depot_tools': - Var('chromium_git') + '/chromium/tools/depot_tools.git' + '@' + '69e597f8e5818ed093e01dfd6f3acc2a3142a0de', + Var('chromium_git') + '/chromium/tools/depot_tools.git' + '@' + '0b943400a45966122a123c27f4f290ab309d893a', 'src/third_party/devtools-frontend/src': Var('chromium_git') + '/devtools/devtools-frontend' + '@' + Var('devtools_frontend_revision'), 'src/third_party/devtools-frontend-internal': { - 'url': Var('chrome_git') + '/devtools/devtools-internal.git' + '@' + '0aedf7449030cb5c78945e42fca86eb6ca129e2b', + 'url': Var('chrome_git') + '/devtools/devtools-internal.git' + '@' + 'e975ac642af4ec9c085f82cbe97686a8daa0ac87', 'condition': 'checkout_src_internal', }, @@ -1793,7 +1793,7 @@ Var('pdfium_git') + '/pdfium.git' + '@' + Var('pdfium_revision'), 'src/third_party/perfetto': - Var('android_git') + '/platform/external/perfetto.git' + '@' + 'fdbd437367e592937b1c0afa5920a201956912c5', + Var('android_git') + '/platform/external/perfetto.git' + '@' + '747df2371b75facc2a0e8f830c6a7051d47fc07f', 'src/third_party/perl': { 'url': Var('chromium_git') + '/chromium/deps/perl.git' + '@' + '6f3e5028eb65d0b4c5fdd792106ac4c84eee1eb3', @@ -1938,7 +1938,7 @@ 'dep_type': 'cipd', }, - 'src/third_party/vulkan-deps': '{chromium_git}/vulkan-deps@1d5140e06b47428983225f692c2cb25a66a788d6', + 'src/third_party/vulkan-deps': '{chromium_git}/vulkan-deps@acfee4cc4f6ec5726ec546c4324bec66d600d213', 'src/third_party/vulkan_memory_allocator': Var('chromium_git') + '/external/github.com/GPUOpen-LibrariesAndSDKs/VulkanMemoryAllocator.git' + '@' + '56300b29fbfcc693ee6609ddad3fdd5b7a449a21', @@ -1978,7 +1978,7 @@ Var('chromium_git') + '/external/github.com/gpuweb/cts.git' + '@' + '4e91a54a0767cf596a407e9bc0933e4bbc66e8d3', 'src/third_party/webrtc': - Var('webrtc_git') + '/src.git' + '@' + 'f286c902a6be4e5d1fcb63f0c96c8efad340e20b', + Var('webrtc_git') + '/src.git' + '@' + 'f83da9dddddf0cfd421688cf68fa26bf3ecadd1d', # Wuffs' canonical repository is at github.com/google/wuffs, but we use # Skia's mirror of Wuffs, the same as in upstream Skia's DEPS file. @@ -2145,7 +2145,7 @@ 'packages': [ { 'package': 'chromeos_internal/apps/projector_app/app', - 'version': 'nHdDBkIOMbyNjgT2Xt9vqADrqqHtKA32_rGYc1eS-1gC', + 'version': 'tJ9hDHxo6ieniuFBiJZe_qUGVnTeZ5tvt3rR-5UVF3wC', }, ], 'condition': 'checkout_chromeos and checkout_src_internal', @@ -4146,7 +4146,7 @@ 'src/ios_internal': { 'url': Var('chrome_git') + '/chrome/ios_internal.git' + '@' + - '78b862d4d5a1ad7f924894d0ba701f2f78a9f099', + 'c4610539334011296a98d308231836aafae3208c', 'condition': 'checkout_ios and checkout_src_internal', },
diff --git a/PRESUBMIT.py b/PRESUBMIT.py index d75740d..8d5d547c 100644 --- a/PRESUBMIT.py +++ b/PRESUBMIT.py
@@ -1736,6 +1736,23 @@ '^ui/base/glib/scoped_gsignal.h', ), ), + BanRule( + pattern = r'features::kIsolatedWebApps', + explanation = ( + 'Do not use `features::kIsolatedWebApps` directly to guard Isolated ', + 'Web App code. ', + 'Use `content::IsolatedWebAppsPolicy::AreIsolatedWebAppsEnabled()` in ', + 'the browser process or check the `kEnableIsolatedWebAppsInRenderer` ', + 'command line flag in the renderer process.', + ), + treat_as_error = True, + excluded_paths = _TEST_CODE_EXCLUDED_PATHS + ( + '^chrome/browser/about_flags.cc', + '^chrome/browser/chrome_content_browser_client.cc', + '^chrome/browser/ui/startup/bad_flags_prompt.cc', + '^content/shell/browser/shell_content_browser_client.cc' + ) + ), ) _BANNED_MOJOM_PATTERNS : Sequence[BanRule] = (
diff --git a/ash/constants/ash_pref_names.h b/ash/constants/ash_pref_names.h index 430da441..5a81c6d5 100644 --- a/ash/constants/ash_pref_names.h +++ b/ash/constants/ash_pref_names.h
@@ -1198,6 +1198,11 @@ inline constexpr char kShowTouchpadScrollScreenEnabled[] = "ash.touchpad_scroll_screen_oobe_enabled"; +// Boolean value indicating that the human presence sesnsor screen should be +// shown to the user during oobe. +inline constexpr char kShowHumanPresenceSensorScreenEnabled[] = + "ash.human_presence_sensor_scren_oobe_enabled"; + // Boolean value indicating that the Display size screen should be // shown to the user during the first sign-in. inline constexpr char kShowDisplaySizeScreenEnabled[] =
diff --git a/ash/public/cpp/BUILD.gn b/ash/public/cpp/BUILD.gn index d6686a41..fe809885 100644 --- a/ash/public/cpp/BUILD.gn +++ b/ash/public/cpp/BUILD.gn
@@ -200,6 +200,8 @@ "locale_update_controller.h", "lock_screen_widget_factory.cc", "lock_screen_widget_factory.h", + "login/login_utils.cc", + "login/login_utils.h", "login_accelerators.cc", "login_accelerators.h", "login_screen.cc", @@ -479,6 +481,8 @@ "//components/version_info:channel", "//ui/base/ime/ash", "//ui/base/ime/ash:ime_types", + "//ui/chromeos/resources:resources", + "//ui/chromeos/resources:resources_grit", "//ui/gfx", ]
diff --git a/ash/public/cpp/DEPS b/ash/public/cpp/DEPS index d449406..2a86ee4 100644 --- a/ash/public/cpp/DEPS +++ b/ash/public/cpp/DEPS
@@ -9,6 +9,7 @@ "+components/language/core/browser", "+components/tab_groups", "+components/sync_device_info", + "+components/user_manager", "+services/data_decoder/public", "+services/device/public", "+skia/public/mojom",
diff --git a/ash/public/cpp/login/login_utils.cc b/ash/public/cpp/login/login_utils.cc new file mode 100644 index 0000000..699b4c1 --- /dev/null +++ b/ash/public/cpp/login/login_utils.cc
@@ -0,0 +1,54 @@ +// Copyright 2023 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "ash/public/cpp/login/login_utils.h" + +#include "ash/public/cpp/session/user_info.h" +#include "base/strings/string_piece.h" +#include "components/account_id/account_id.h" +#include "components/user_manager/user.h" +#include "components/user_manager/user_manager.h" +#include "ui/base/resource/resource_bundle.h" +#include "ui/chromeos/resources/grit/ui_chromeos_resources.h" + +namespace ash { + +UserAvatar BuildAshUserAvatarForUser(const user_manager::User& user) { + UserAvatar avatar; + avatar.image = user.GetImage(); + if (avatar.image.isNull()) { + avatar.image = *ui::ResourceBundle::GetSharedInstance().GetImageSkiaNamed( + IDR_LOGIN_DEFAULT_USER); + } + + // TODO(jdufault): Unify image handling between this code and + // user_image_source::GetUserImageInternal. + auto load_image_from_resource = [&avatar](int resource_id) { + auto& rb = ui::ResourceBundle::GetSharedInstance(); + base::StringPiece avatar_data = rb.GetRawDataResourceForScale( + resource_id, rb.GetMaxResourceScaleFactor()); + avatar.bytes.assign(avatar_data.begin(), avatar_data.end()); + }; + + if (user.has_image_bytes()) { + avatar.bytes.assign( + user.image_bytes()->front(), + user.image_bytes()->front() + user.image_bytes()->size()); + } else if (user.image_is_stub()) { + load_image_from_resource(IDR_LOGIN_DEFAULT_USER); + } + + return avatar; +} + +UserAvatar BuildAshUserAvatarForAccountId(const AccountId& account_id) { + const user_manager::UserManager* user_manager = + user_manager::UserManager::Get(); + CHECK(user_manager); + const user_manager::User* user = user_manager->FindUser(account_id); + CHECK(user); + return BuildAshUserAvatarForUser(*user); +} + +} // namespace ash
diff --git a/ash/public/cpp/login/login_utils.h b/ash/public/cpp/login/login_utils.h new file mode 100644 index 0000000..1058fcb --- /dev/null +++ b/ash/public/cpp/login/login_utils.h
@@ -0,0 +1,26 @@ +// Copyright 2023 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef ASH_PUBLIC_CPP_LOGIN_LOGIN_UTILS_H_ +#define ASH_PUBLIC_CPP_LOGIN_LOGIN_UTILS_H_ + +#include "ash/public/cpp/ash_public_export.h" +#include "ash/public/cpp/session/user_info.h" +#include "components/account_id/account_id.h" +#include "components/user_manager/user.h" + +namespace ash { + +// Builds a `UserAvatar` instance which contains the current image for `user`. +ASH_PUBLIC_EXPORT UserAvatar +BuildAshUserAvatarForUser(const user_manager::User& user); + +// Builds a `UserAvatar` instance which contains the current image +// for `account_id`. +ASH_PUBLIC_EXPORT UserAvatar +BuildAshUserAvatarForAccountId(const AccountId& account_id); + +} // namespace ash + +#endif // ASH_PUBLIC_CPP_LOGIN_LOGIN_UTILS_H_
diff --git a/ash/rounded_display/rounded_display_frame_factory.cc b/ash/rounded_display/rounded_display_frame_factory.cc index 384fee2..73536baf 100644 --- a/ash/rounded_display/rounded_display_frame_factory.cc +++ b/ash/rounded_display/rounded_display_frame_factory.cc
@@ -103,7 +103,7 @@ BASE_FEATURE(kUseMappableSIInRoundedDisplayFrameFactory, "UseMappableSIInRoundedDisplayFrameFactory", - base::FEATURE_DISABLED_BY_DEFAULT); + base::FEATURE_ENABLED_BY_DEFAULT); } // namespace
diff --git a/base/sampling_heap_profiler/sampling_heap_profiler.cc b/base/sampling_heap_profiler/sampling_heap_profiler.cc index 325cbaff..324378e 100644 --- a/base/sampling_heap_profiler/sampling_heap_profiler.cc +++ b/base/sampling_heap_profiler/sampling_heap_profiler.cc
@@ -8,6 +8,7 @@ #include <cmath> #include <utility> +#include "base/allocator/dispatcher/tls.h" #include "base/allocator/partition_allocator/src/partition_alloc/partition_alloc.h" #include "base/allocator/partition_allocator/src/partition_alloc/shim/allocator_shim.h" #include "base/compiler_specific.h" @@ -38,6 +39,22 @@ namespace { +struct ThreadLocalData { + const char* thread_name = nullptr; +}; + +ThreadLocalData* GetThreadLocalData() { +#if USE_LOCAL_TLS_EMULATION() + static base::NoDestructor< + base::allocator::dispatcher::ThreadLocalStorage<ThreadLocalData>> + thread_local_data("sampling_heap_profiler"); + return thread_local_data->GetThreadLocalData(); +#else + static thread_local ThreadLocalData thread_local_data; + return &thread_local_data; +#endif +} + #if BUILDFLAG(CAN_UNWIND_WITH_FRAME_POINTERS) BASE_FEATURE(kAvoidFramePointers, "AndroidHeapSamplerAvoidFramePointers", @@ -82,12 +99,13 @@ } const char* UpdateAndGetThreadName(const char* name) { - static thread_local const char* thread_name; + ThreadLocalData* const thread_local_data = GetThreadLocalData(); if (name) - thread_name = name; - if (!thread_name) - thread_name = GetAndLeakThreadName(); - return thread_name; + thread_local_data->thread_name = name; + if (!thread_local_data->thread_name) { + thread_local_data->thread_name = GetAndLeakThreadName(); + } + return thread_local_data->thread_name; } // Checks whether unwinding from this function works. @@ -304,6 +322,7 @@ // static void SamplingHeapProfiler::Init() { + GetThreadLocalData(); PoissonAllocationSampler::Init(); }
diff --git a/chrome/android/java/res/values-large/dimens.xml b/chrome/android/java/res/values-large/dimens.xml index e6f11e4..41d46bd6 100644 --- a/chrome/android/java/res/values-large/dimens.xml +++ b/chrome/android/java/res/values-large/dimens.xml
@@ -12,4 +12,8 @@ <item type="dimen" name="dialog_fixed_width_minor">90%</item> <item type="dimen" name="dialog_fixed_height_major">60%</item> <item type="dimen" name="dialog_fixed_height_minor">90%</item> + <item type="dimen" name="dialog_fixed_width_major_automotive">60%</item> + <item type="dimen" name="dialog_fixed_width_minor_automotive">80%</item> + <item type="dimen" name="dialog_fixed_height_major_automotive">80%</item> + <item type="dimen" name="dialog_fixed_height_minor_automotive">90%</item> </resources>
diff --git a/chrome/android/java/res/values-xlarge/dimens.xml b/chrome/android/java/res/values-xlarge/dimens.xml index 8a7b377..33c203fe 100644 --- a/chrome/android/java/res/values-xlarge/dimens.xml +++ b/chrome/android/java/res/values-xlarge/dimens.xml
@@ -12,4 +12,8 @@ <item type="dimen" name="dialog_fixed_width_minor">70%</item> <item type="dimen" name="dialog_fixed_height_major">60%</item> <item type="dimen" name="dialog_fixed_height_minor">90%</item> + <item type="dimen" name="dialog_fixed_width_major_automotive">50%</item> + <item type="dimen" name="dialog_fixed_width_minor_automotive">70%</item> + <item type="dimen" name="dialog_fixed_height_major_automotive">70%</item> + <item type="dimen" name="dialog_fixed_height_minor_automotive">90%</item> </resources>
diff --git a/chrome/android/java/res/values/dimens.xml b/chrome/android/java/res/values/dimens.xml index b65bb401..f3d195e 100644 --- a/chrome/android/java/res/values/dimens.xml +++ b/chrome/android/java/res/values/dimens.xml
@@ -349,6 +349,10 @@ <item type="dimen" name="dialog_fixed_width_minor">100%</item> <item type="dimen" name="dialog_fixed_height_major">100%</item> <item type="dimen" name="dialog_fixed_height_minor">100%</item> + <item type="dimen" name="dialog_fixed_width_major_automotive">100%</item> + <item type="dimen" name="dialog_fixed_width_minor_automotive">100%</item> + <item type="dimen" name="dialog_fixed_height_major_automotive">100%</item> + <item type="dimen" name="dialog_fixed_height_minor_automotive">100%</item> <!-- History Navigation UI Item --> <dimen name="navigation_bubble_size">44dp</dimen>
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/firstrun/TabbedModeFirstRunActivity.java b/chrome/android/java/src/org/chromium/chrome/browser/firstrun/TabbedModeFirstRunActivity.java index 25e5627..6c5bcc9 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/firstrun/TabbedModeFirstRunActivity.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/firstrun/TabbedModeFirstRunActivity.java
@@ -85,10 +85,19 @@ // system DialogWhenLarge theme. // Note that we don't care about the return values, because onMeasure() handles null // constraints (and they will be null when the device is not considered "large"). - safeGetResourceValue(R.dimen.dialog_fixed_width_minor, mFixedWidthMinor); - safeGetResourceValue(R.dimen.dialog_fixed_width_major, mFixedWidthMajor); - safeGetResourceValue(R.dimen.dialog_fixed_height_minor, mFixedHeightMinor); - safeGetResourceValue(R.dimen.dialog_fixed_height_major, mFixedHeightMajor); + if (BuildInfo.getInstance().isAutomotive) { + safeGetResourceValue(R.dimen.dialog_fixed_width_minor_automotive, mFixedWidthMinor); + safeGetResourceValue(R.dimen.dialog_fixed_width_major_automotive, mFixedWidthMajor); + safeGetResourceValue( + R.dimen.dialog_fixed_height_minor_automotive, mFixedHeightMinor); + safeGetResourceValue( + R.dimen.dialog_fixed_height_major_automotive, mFixedHeightMajor); + } else { + safeGetResourceValue(R.dimen.dialog_fixed_width_minor, mFixedWidthMinor); + safeGetResourceValue(R.dimen.dialog_fixed_width_major, mFixedWidthMajor); + safeGetResourceValue(R.dimen.dialog_fixed_height_minor, mFixedHeightMinor); + safeGetResourceValue(R.dimen.dialog_fixed_height_major, mFixedHeightMajor); + } } @Override
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/privacy_sandbox/TrackingProtectionNoticeController.java b/chrome/android/java/src/org/chromium/chrome/browser/privacy_sandbox/TrackingProtectionNoticeController.java index 1a51bc9d..b70bd8b6 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/privacy_sandbox/TrackingProtectionNoticeController.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/privacy_sandbox/TrackingProtectionNoticeController.java
@@ -7,17 +7,30 @@ import android.content.Context; import android.content.res.Resources; +import androidx.annotation.NonNull; + import org.chromium.base.Callback; import org.chromium.chrome.browser.ActivityTabProvider; import org.chromium.chrome.browser.ActivityTabProvider.ActivityTabTabObserver; import org.chromium.chrome.browser.flags.ChromeFeatureList; import org.chromium.chrome.browser.tab.Tab; +import org.chromium.components.browser_ui.settings.SettingsLauncher; +import org.chromium.components.browser_ui.widget.listmenu.BasicListMenu; +import org.chromium.components.browser_ui.widget.listmenu.BasicListMenu.ListMenuItemType; +import org.chromium.components.browser_ui.widget.listmenu.ListMenu; +import org.chromium.components.browser_ui.widget.listmenu.ListMenu.Delegate; +import org.chromium.components.browser_ui.widget.listmenu.ListMenuButtonDelegate; +import org.chromium.components.browser_ui.widget.listmenu.ListMenuItemProperties; +import org.chromium.components.messages.DismissReason; import org.chromium.components.messages.MessageBannerProperties; import org.chromium.components.messages.MessageDispatcher; import org.chromium.components.messages.MessageIdentifier; import org.chromium.components.messages.PrimaryActionClickBehavior; +import org.chromium.components.privacy_sandbox.TrackingProtectionSettings; import org.chromium.components.security_state.ConnectionSecurityLevel; import org.chromium.components.security_state.SecurityStateModel; +import org.chromium.ui.modelutil.MVCListAdapter; +import org.chromium.ui.modelutil.MVCListAdapter.ListItem; import org.chromium.ui.modelutil.PropertyModel; import org.chromium.url.GURL; @@ -27,10 +40,12 @@ private ActivityTabProvider mActivityTabProvider; private ActivityTabTabObserver mActivityTabTabObserver; private MessageDispatcher mMessageDispatcher; + private SettingsLauncher mSettingsLauncher; // Setting an indefinite message auto dismiss duration is not possible, // hence we provide a value high enough to maintain the message visible. private static final int AUTODISMISS_DURATION_ONE_DAY = 24 * 60 * 60 * 1000; + private PropertyModel mMessage; /** * Checks whether the Tracking Protection Notice should be shown. @@ -53,18 +68,21 @@ public static TrackingProtectionNoticeController create( Context context, ActivityTabProvider activityTabProvider, - MessageDispatcher messageDispatcher) { + MessageDispatcher messageDispatcher, + @NonNull SettingsLauncher settingsLauncher) { return new TrackingProtectionNoticeController( - context, activityTabProvider, messageDispatcher); + context, activityTabProvider, messageDispatcher, settingsLauncher); } private TrackingProtectionNoticeController( Context context, ActivityTabProvider activityTabProvider, - MessageDispatcher messageDispatcher) { + MessageDispatcher messageDispatcher, + SettingsLauncher settingsLauncher) { mContext = context; mActivityTabProvider = activityTabProvider; mMessageDispatcher = messageDispatcher; + mSettingsLauncher = settingsLauncher; createActivityTabTabObserver(tab -> showNotice()); } @@ -74,7 +92,7 @@ // TODO(b/295927778): Use final strings. Resources resources = mContext.getResources(); - PropertyModel message = + mMessage = new PropertyModel.Builder(MessageBannerProperties.ALL_KEYS) .with( MessageBannerProperties.MESSAGE_IDENTIFIER, @@ -86,7 +104,9 @@ + " cteturadip Scingeli Seddoeiusm, tempo incidi untut abor" + " etdol remag-aaliq autenim dm nimve iam ui nos rudexe.") .with(MessageBannerProperties.PRIMARY_BUTTON_TEXT, "Lor mi") - .with(MessageBannerProperties.SECONDARY_BUTTON_MENU_TEXT, "Loremips") + .with( + MessageBannerProperties.SECONDARY_MENU_BUTTON_DELEGATE, + new SecondaryMenuButtonDelegate()) .with(MessageBannerProperties.ICON_RESOURCE_ID, R.drawable.ic_eye_crossed) .with( MessageBannerProperties.SECONDARY_ICON_RESOURCE_ID, @@ -97,26 +117,35 @@ .with( MessageBannerProperties.ON_PRIMARY_ACTION, () -> { - // TODO(b/295927778): Report action to the bridge + TrackingProtectionBridge.noticeActionTaken(NoticeAction.GOT_IT); return PrimaryActionClickBehavior.DISMISS_IMMEDIATELY; }) - .with( - MessageBannerProperties.ON_SECONDARY_ACTION, - () -> { - // TODO(b/295927778): Launch settings and Report - // action to the bridge - }) - .with( - MessageBannerProperties.ON_DISMISSED, - (dismissReason) -> { - // TODO(b/295927778): Report actions to the bridge - }) + .with(MessageBannerProperties.ON_DISMISSED, onNoticeDismissed()) .build(); - mMessageDispatcher.enqueueWindowScopedMessage(message, /* highPriority= */ true); + mMessageDispatcher.enqueueWindowScopedMessage(mMessage, /* highPriority= */ true); destroy(); } + private static Callback<Integer> onNoticeDismissed() { + return (dismissReason) -> { + switch (dismissReason) { + case DismissReason.GESTURE: + TrackingProtectionBridge.noticeShown(); + TrackingProtectionBridge.noticeActionTaken(NoticeAction.CLOSED); + break; + case DismissReason.PRIMARY_ACTION: + case DismissReason.SECONDARY_ACTION: + // TODO(b/295927778): Move Shown action recording to the proper callback when + // implemented in crbug.com/1491318. + TrackingProtectionBridge.noticeShown(); + break; + default: + TrackingProtectionBridge.noticeActionTaken(NoticeAction.OTHER); + } + }; + } + private void createActivityTabTabObserver(Callback showNoticeCallback) { mActivityTabTabObserver = new ActivityTabTabObserver(mActivityTabProvider) { @@ -148,6 +177,56 @@ }; } + private final class SecondaryMenuButtonDelegate implements ListMenuButtonDelegate { + + private static final int SETTINGS_ITEM_ID = 1; + private static final int LEARN_MORE_ITEM_ID = 2; + + @Override + public ListMenu getListMenu() { + // TODO(b/295927778): Use final strings. + ListItem settingsItem = getMenuItem(SETTINGS_ITEM_ID, "Settings"); + ListItem learnMoreItem = getMenuItem(LEARN_MORE_ITEM_ID, "Learn more"); + + MVCListAdapter.ModelList menuItems = new MVCListAdapter.ModelList(); + menuItems.add(settingsItem); + menuItems.add(learnMoreItem); + + BasicListMenu listMenu = new BasicListMenu(mContext, menuItems, onClickDelegate()); + + return listMenu; + } + + private ListItem getMenuItem(int itemID, String title) { + PropertyModel.Builder settingsModel = + new PropertyModel.Builder(ListMenuItemProperties.ALL_KEYS) + .with(ListMenuItemProperties.ENABLED, true) + .with(ListMenuItemProperties.MENU_ITEM_ID, itemID) + .with(ListMenuItemProperties.TITLE, title); + ListItem settingsItem = new ListItem(ListMenuItemType.MENU_ITEM, settingsModel.build()); + return settingsItem; + } + + private Delegate onClickDelegate() { + return (clickedItem) -> { + int clickedItemID = clickedItem.get(ListMenuItemProperties.MENU_ITEM_ID); + + if (clickedItemID == SETTINGS_ITEM_ID) { + mSettingsLauncher.launchSettingsActivity( + mContext, TrackingProtectionSettings.class); + TrackingProtectionBridge.noticeActionTaken( + org.chromium.chrome.browser.privacy_sandbox.NoticeAction.SETTINGS); + } else if (clickedItemID == LEARN_MORE_ITEM_ID) { + // TODO(b/295927778): Open learn More link + TrackingProtectionBridge.noticeActionTaken( + org.chromium.chrome.browser.privacy_sandbox.NoticeAction.LEARN_MORE); + } + + mMessageDispatcher.dismissMessage(mMessage, DismissReason.SECONDARY_ACTION); + }; + } + } + public void destroy() { if (mActivityTabTabObserver != null) { mActivityTabTabObserver.destroy();
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/tabbed_mode/TabbedRootUiCoordinator.java b/chrome/android/java/src/org/chromium/chrome/browser/tabbed_mode/TabbedRootUiCoordinator.java index 6876cad..c0c0050 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/tabbed_mode/TabbedRootUiCoordinator.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/tabbed_mode/TabbedRootUiCoordinator.java
@@ -676,7 +676,10 @@ if (!didTriggerPromo && TrackingProtectionNoticeController.shouldShowNotice()) { TrackingProtectionNoticeController.create( - mActivity, mActivityTabProvider, mMessageDispatcher); + mActivity, + mActivityTabProvider, + mMessageDispatcher, + new SettingsLauncherImpl()); // Promo will be triggered eventually. We don't want for this promo to clash with other // promos in the same run. didTriggerPromo = true;
diff --git a/chrome/android/profiles/arm.newest.txt b/chrome/android/profiles/arm.newest.txt index e9c643f..f39c0577 100644 --- a/chrome/android/profiles/arm.newest.txt +++ b/chrome/android/profiles/arm.newest.txt
@@ -1 +1 @@ -chromeos-chrome-arm-120.0.6058.0_rc-r1-merged.afdo.bz2 +chromeos-chrome-arm-120.0.6061.0_rc-r1-merged.afdo.bz2
diff --git a/chrome/app/settings_strings.grdp b/chrome/app/settings_strings.grdp index fbb8ae0..ff38404 100644 --- a/chrome/app/settings_strings.grdp +++ b/chrome/app/settings_strings.grdp
@@ -3279,7 +3279,13 @@ Sites allowed to use third-party cookies </message> <message name="IDS_SETTINGS_TRACKING_PROTECTION_SITES_ALLOWED_COOKIES_DESCRIPTION" desc="Description of the section on the Tracking Protection settings page that lets users manage which sites are allowed to use third-party cookies. Explains that third-party cookies are also allowed for subdomains of the listed sites."> - Affects the sites listed here and their subdomains. For example, adding “google.com” means that third-party cookies can also be active for mail.google.com, because it’s part of google.com. + Affects the sites listed here and their subdomains. For example, adding “google.com” means that third-party cookies can also be active for mail.google.com, because it’s part of google.com. + </message> + <message name="IDS_SETTINGS_TRACKING_PROTECTION_ROLLBACK_NOTICE" desc="Notice text on the top of the 'Third-party cookies' settings page telling users that Tracking Protection is unavailable." translateable="false"> + Tracking Protection is temporarily unavailable. While Chrome is updating this feature, sites can temporarily use third-party cookies unless you block them. <ph name="BEGIN_LINK"><a target="_blank" href="$1" aria-label="$2"></ph>Learn more<ph name="END_LINK"></a><ex></a></ex></ph> + </message> + <message name="IDS_SETTINGS_TRACKING_PROTECTION_ROLLBACK_NOTICE_LEARN_MORE_ARIA_LABEL" desc="Screenreader text for the 'Learn more' link in the Tracking Protection rollback notice." translateable="false"> + Learn more about Tracking Protection availability </message> <message name="IDS_SETTINGS_SITE_SETTINGS_APP_PROTOCOL_HANDLERS" desc="Label for the app protocol handlers (e.g. mailto) in site settings."> Apps
diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc index fd8d4fd..1029eed 100644 --- a/chrome/browser/about_flags.cc +++ b/chrome/browser/about_flags.cc
@@ -31,6 +31,7 @@ #include "cc/base/features.h" #include "cc/base/switches.h" #include "chrome/browser/apps/app_discovery_service/app_discovery_service.h" +#include "chrome/browser/apps/link_capturing/link_capturing_features.h" #include "chrome/browser/browser_features.h" #include "chrome/browser/browser_process.h" #include "chrome/browser/companion/core/features.h" @@ -340,7 +341,6 @@ #endif #if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN) -#include "chrome/browser/apps/link_capturing/link_capturing_features.h" #include "chrome/browser/enterprise/profile_management/profile_management_features.h" #endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN) @@ -9807,14 +9807,6 @@ FEATURE_VALUE_TYPE(features::kNetworkServiceInProcess)}, #endif - {"broker-file-operations-on-disk-cache-in-network-service", - flag_descriptions::kBrokerFileOperationsOnDiskCacheInNetworkServiceName, - flag_descriptions:: - kBrokerFileOperationsOnDiskCacheInNetworkServiceDescription, - kOsAll, - FEATURE_VALUE_TYPE( - features::kBrokerFileOperationsOnDiskCacheInNetworkService)}, - #if BUILDFLAG(IS_ANDROID) {"enable-commerce-hint-android", flag_descriptions::kCommerceHintAndroidName, @@ -11041,6 +11033,17 @@ FEATURE_VALUE_TYPE(webapps::features::kWebAppSystemMediaControlsWin)}, #endif // BUILDFLAG(IS_WIN) +#if BUILDFLAG(IS_CHROMEOS) + {"app-to-app-link-capturing", flag_descriptions::kAppToAppLinkCapturingName, + flag_descriptions::kAppToAppLinkCapturingDescription, kOsCrOS, + FEATURE_VALUE_TYPE(apps::features::kAppToAppLinkCapturing)}, + + {"app-to-app-link-capturing-workspace-apps", + flag_descriptions::kAppToAppLinkCapturingWorkspaceAppsName, + flag_descriptions::kAppToAppLinkCapturingWorkspaceAppsDescription, kOsCrOS, + FEATURE_VALUE_TYPE(apps::features::kAppToAppLinkCapturingWorkspaceApps)}, +#endif // BUILDFLAG(IS_CHROMEOS) + // NOTE: Adding a new flag requires adding a corresponding entry to enum // "LoginCustomFlags" in tools/metrics/histograms/enums.xml. See "Flag // Histograms" in tools/metrics/histograms/README.md (run the
diff --git a/chrome/browser/apps/app_discovery_service/app_fetcher_manager.cc b/chrome/browser/apps/app_discovery_service/app_fetcher_manager.cc index 9d09959..e1c6b96 100644 --- a/chrome/browser/apps/app_discovery_service/app_fetcher_manager.cc +++ b/chrome/browser/apps/app_discovery_service/app_fetcher_manager.cc
@@ -8,6 +8,7 @@ #include "base/notreached.h" #include "chrome/browser/apps/app_discovery_service/almanac_fetcher.h" +#include "chrome/browser/apps/app_discovery_service/app_discovery_service.h" #include "chrome/browser/apps/app_discovery_service/game_fetcher.h" #include "chrome/browser/apps/app_discovery_service/recommended_arc_app_fetcher.h" #include "ui/gfx/image/image_skia.h" @@ -52,6 +53,11 @@ recommended_arc_app_fetcher_->GetApps(std::move(callback)); return; case ResultType::kGameSearchCatalog: + if (base::FeatureList::IsEnabled(kAlmanacGameMigration)) { + DCHECK(almanac_fetcher_); + almanac_fetcher_->GetApps(std::move(callback)); + return; + } DCHECK(game_fetcher_); game_fetcher_->GetApps(std::move(callback)); return; @@ -71,6 +77,10 @@ DCHECK(g_test_fetcher_); return g_test_fetcher_->RegisterForAppUpdates(std::move(callback)); case ResultType::kGameSearchCatalog: + if (base::FeatureList::IsEnabled(kAlmanacGameMigration)) { + DCHECK(almanac_fetcher_); + return almanac_fetcher_->RegisterForAppUpdates(std::move(callback)); + } DCHECK(game_fetcher_); return game_fetcher_->RegisterForAppUpdates(std::move(callback)); } @@ -92,6 +102,12 @@ DiscoveryError::kErrorRequestFailed); return; case ResultType::kGameSearchCatalog: + if (base::FeatureList::IsEnabled(kAlmanacGameMigration)) { + DCHECK(almanac_fetcher_); + almanac_fetcher_->GetIcon(app_id, size_hint_in_dip, + std::move(callback)); + return; + } DCHECK(game_fetcher_); game_fetcher_->GetIcon(app_id, size_hint_in_dip, std::move(callback)); return;
diff --git a/chrome/browser/apps/link_capturing/link_capturing_features.cc b/chrome/browser/apps/link_capturing/link_capturing_features.cc index fce68ce..0d80bac 100644 --- a/chrome/browser/apps/link_capturing/link_capturing_features.cc +++ b/chrome/browser/apps/link_capturing/link_capturing_features.cc
@@ -28,6 +28,16 @@ "DesktopPWAsLinkCapturing", base::FEATURE_DISABLED_BY_DEFAULT); +#if BUILDFLAG(IS_CHROMEOS) +BASE_FEATURE(kAppToAppLinkCapturing, + "AppToAppLinkCapturing", + base::FEATURE_DISABLED_BY_DEFAULT); + +BASE_FEATURE(kAppToAppLinkCapturingWorkspaceApps, + "AppToAppLinkCapturingWorkspaceApps", + base::FEATURE_DISABLED_BY_DEFAULT); +#endif + bool LinkCapturingUiUpdateEnabled() { return base::FeatureList::IsEnabled(kLinkCapturingUiUpdate); }
diff --git a/chrome/browser/apps/link_capturing/link_capturing_features.h b/chrome/browser/apps/link_capturing/link_capturing_features.h index 49798eb..abfbc51 100644 --- a/chrome/browser/apps/link_capturing/link_capturing_features.h +++ b/chrome/browser/apps/link_capturing/link_capturing_features.h
@@ -16,6 +16,16 @@ // Linux amd Fuchsia. BASE_DECLARE_FEATURE(kDesktopPWAsLinkCapturing); +#if BUILDFLAG(IS_CHROMEOS) +// Enables link capturing into apps when links are clicked from another app +// context, regardless of user setting. +BASE_DECLARE_FEATURE(kAppToAppLinkCapturing); + +// Enables link capturing into a specific set of Google Workspace apps when +// links are clicked from another app context, regardless of user setting. +BASE_DECLARE_FEATURE(kAppToAppLinkCapturingWorkspaceApps); +#endif + // Returns true if the overall link capturing UI update feature is enabled. bool LinkCapturingUiUpdateEnabled();
diff --git a/chrome/browser/ash/app_list/search/system_info/system_info_card_provider.cc b/chrome/browser/ash/app_list/search/system_info/system_info_card_provider.cc index d3db015..586ae49 100644 --- a/chrome/browser/ash/app_list/search/system_info/system_info_card_provider.cc +++ b/chrome/browser/ash/app_list/search/system_info/system_info_card_provider.cc
@@ -54,6 +54,7 @@ using ::chromeos::settings::mojom::kStorageSubpagePath; using AnswerCardInfo = ::ash::SystemInfoAnswerCardData; +constexpr double kMinimumRelevance = 0.0; constexpr double kRelevanceThreshold = 0.79; double ConvertKBtoBytes(uint32_t amount) { @@ -143,19 +144,14 @@ double SystemInfoCardProvider::CalculateRelevance(const std::u16string& query, const std::u16string& title) { const TokenizedString tokenized_title(title, TokenizedString::Mode::kWords); - const TokenizedString tokenized_query(query, - TokenizedString::Mode::kCamelCase); + const TokenizedString tokenized_query(query, TokenizedString::Mode::kWords); if (tokenized_query.text().empty() || tokenized_title.text().empty()) { - static constexpr double kDefaultRelevance = 0.0; - return kDefaultRelevance; + return kMinimumRelevance; } - FuzzyTokenizedStringMatch match; - return match.Relevance(tokenized_query, tokenized_title, - /*use_weighted_ratio=*/false, - /*strip_diacritics=*/true, - /*use_acronym_matcher=*/true); + return FuzzyTokenizedStringMatch::TokenSortRatio( + tokenized_query, tokenized_title, /*partial=*/false); } void SystemInfoCardProvider::BindCrosHealthdProbeServiceIfNecessary() {
diff --git a/chrome/browser/ash/file_manager/file_tasks.cc b/chrome/browser/ash/file_manager/file_tasks.cc index 3e0f4f8c..615f222c 100644 --- a/chrome/browser/ash/file_manager/file_tasks.cc +++ b/chrome/browser/ash/file_manager/file_tasks.cc
@@ -801,6 +801,8 @@ const std::string parsed_action_id(ParseFilesAppActionId(task.action_id)); if (IsWebDriveOfficeTask(task)) { + UMA_HISTOGRAM_ENUMERATION(ash::cloud_upload::kOpenCloudProviderMetric, + ash::cloud_upload::CloudProvider::kGoogleDrive); for (const FileSystemURL& file_url : file_urls) { RecordOfficeOpenExtensionDriveMetric(file_url); } @@ -818,8 +820,9 @@ } } return true; - } - if (IsOpenInOfficeTask(task)) { + } else if (IsOpenInOfficeTask(task)) { + UMA_HISTOGRAM_ENUMERATION(ash::cloud_upload::kOpenCloudProviderMetric, + ash::cloud_upload::CloudProvider::kOneDrive); for (const FileSystemURL& file_url : file_urls) { RecordOfficeOpenExtensionOneDriveMetric(file_url); } @@ -837,6 +840,9 @@ } } return true; + } else { + UMA_HISTOGRAM_ENUMERATION(ash::cloud_upload::kOpenCloudProviderMetric, + ash::cloud_upload::CloudProvider::kNone); } // TODO(b/284800493): Add a test that VirtualTasks get run. if (IsVirtualTask(task)) {
diff --git a/chrome/browser/ash/file_manager/file_tasks_browsertest.cc b/chrome/browser/ash/file_manager/file_tasks_browsertest.cc index 3acc977..850d1a9a 100644 --- a/chrome/browser/ash/file_manager/file_tasks_browsertest.cc +++ b/chrome/browser/ash/file_manager/file_tasks_browsertest.cc
@@ -1274,6 +1274,11 @@ histogram_.ExpectUniqueSample( ash::cloud_upload::kDriveOpenSourceVolumeMetric, ash::cloud_upload::OfficeFilesSourceVolume::kGoogleDrive, 1); + histogram_.ExpectUniqueSample(ash::cloud_upload::kOpenCloudProviderMetric, + ash::cloud_upload::CloudProvider::kGoogleDrive, + 1); + histogram_.ExpectUniqueSample(ash::cloud_upload::kDriveOpenSourceVolumeMetric, + VolumeType::VOLUME_TYPE_GOOGLE_DRIVE, 1); histogram_.ExpectUniqueSample( ash::cloud_upload::kDriveTransferRequiredMetric, ash::cloud_upload::OfficeFilesTransferRequired::kNotRequired, 1); @@ -1353,6 +1358,10 @@ // Wait for setup flow dialog to open. navigation_observer_dialog.Wait(); ASSERT_TRUE(navigation_observer_dialog.last_navigation_succeeded()); + + histogram_.ExpectUniqueSample(ash::cloud_upload::kOpenCloudProviderMetric, + ash::cloud_upload::CloudProvider::kGoogleDrive, + 1); } // Test that the setup flow for office files, that has never been run before, @@ -1389,6 +1398,10 @@ // Wait for setup flow dialog to open. navigation_observer_dialog.Wait(); ASSERT_TRUE(navigation_observer_dialog.last_navigation_succeeded()); + + histogram_.ExpectUniqueSample(ash::cloud_upload::kOpenCloudProviderMetric, + ash::cloud_upload::CloudProvider::kGoogleDrive, + 1); } // Fake app service web app publisher to test when an app is launched. @@ -1642,6 +1655,8 @@ CHECK_EQ(launches[0].app_id, web_app::kMicrosoft365AppId); CHECK_EQ(launches[0].intent_url, kODFSSampleUrl); + histogram_.ExpectUniqueSample(ash::cloud_upload::kOpenCloudProviderMetric, + ash::cloud_upload::CloudProvider::kOneDrive, 1); histogram_.ExpectUniqueSample( ash::cloud_upload::kOneDriveOpenSourceVolumeMetric, ash::cloud_upload::OfficeFilesSourceVolume::kMicrosoftOneDrive, 1); @@ -1702,6 +1717,8 @@ ASSERT_EQ(0u, web_app_publisher_->GetLaunches().size()); + histogram_.ExpectUniqueSample(ash::cloud_upload::kOpenCloudProviderMetric, + ash::cloud_upload::CloudProvider::kOneDrive, 1); histogram_.ExpectUniqueSample( ash::cloud_upload::kOneDriveTaskResultMetricName, ash::cloud_upload::OfficeTaskResult::kCancelledAtFallback, 1); @@ -2089,6 +2106,9 @@ // Wait for setup flow dialog to open. navigation_observer_dialog.Wait(); ASSERT_TRUE(navigation_observer_dialog.last_navigation_succeeded()); + + histogram_.ExpectUniqueSample(ash::cloud_upload::kOpenCloudProviderMetric, + ash::cloud_upload::CloudProvider::kOneDrive, 1); } // Test that the setup flow for office files, that has never been run before, @@ -2118,6 +2138,9 @@ // Wait for setup flow dialog to open. navigation_observer_dialog.Wait(); ASSERT_TRUE(navigation_observer_dialog.last_navigation_succeeded()); + + histogram_.ExpectUniqueSample(ash::cloud_upload::kOpenCloudProviderMetric, + ash::cloud_upload::CloudProvider::kOneDrive, 1); } INSTANTIATE_SYSTEM_WEB_APP_MANAGER_TEST_SUITE_ALL_PROFILE_TYPES_P(
diff --git a/chrome/browser/ash/login/quickstart_controller.cc b/chrome/browser/ash/login/quickstart_controller.cc index cf7b54b..7c1e19c 100644 --- a/chrome/browser/ash/login/quickstart_controller.cc +++ b/chrome/browser/ash/login/quickstart_controller.cc
@@ -194,6 +194,8 @@ } return; case Step::NONE: + // Indicates we've stopped advertising. No action required. + return; case Step::CONNECTED: controller_state_ = ControllerState::CONNECTED; return;
diff --git a/chrome/browser/ash/login/screens/user_selection_screen.cc b/chrome/browser/ash/login/screens/user_selection_screen.cc index 4577c26..5cf73725 100644 --- a/chrome/browser/ash/login/screens/user_selection_screen.cc +++ b/chrome/browser/ash/login/screens/user_selection_screen.cc
@@ -12,6 +12,7 @@ #include "ash/components/arc/arc_util.h" #include "ash/constants/ash_pref_names.h" #include "ash/constants/ash_switches.h" +#include "ash/public/cpp/login/login_utils.h" #include "ash/public/cpp/login_screen.h" #include "ash/public/cpp/login_screen_model.h" #include "base/command_line.h" @@ -73,8 +74,6 @@ #include "services/network/public/cpp/shared_url_loader_factory.h" #include "third_party/abseil-cpp/absl/types/optional.h" #include "ui/base/l10n/l10n_util.h" -#include "ui/base/resource/resource_bundle.h" -#include "ui/chromeos/resources/grit/ui_chromeos_resources.h" // Enable VLOG level 1. #undef ENABLED_VLOG_LEVEL @@ -517,36 +516,6 @@ } } -// static -UserAvatar UserSelectionScreen::BuildAshUserAvatarForUser( - const user_manager::User& user) { - UserAvatar avatar; - avatar.image = user.GetImage(); - if (avatar.image.isNull()) { - avatar.image = *ui::ResourceBundle::GetSharedInstance().GetImageSkiaNamed( - IDR_LOGIN_DEFAULT_USER); - } - - // TODO(jdufault): Unify image handling between this code and - // user_image_source::GetUserImageInternal. - auto load_image_from_resource = [&avatar](int resource_id) { - auto& rb = ui::ResourceBundle::GetSharedInstance(); - base::StringPiece avatar_data = rb.GetRawDataResourceForScale( - resource_id, rb.GetMaxResourceScaleFactor()); - avatar.bytes.assign(avatar_data.begin(), avatar_data.end()); - }; - - if (user.has_image_bytes()) { - avatar.bytes.assign( - user.image_bytes()->front(), - user.image_bytes()->front() + user.image_bytes()->size()); - } else if (user.image_is_stub()) { - load_image_from_resource(IDR_LOGIN_DEFAULT_USER); - } - - return avatar; -} - void UserSelectionScreen::SetView(UserBoardView* view) { view_ = view; } @@ -848,7 +817,7 @@ user_info.basic_user_info.display_name = base::UTF16ToUTF8(user->GetDisplayName()); user_info.basic_user_info.display_email = user->display_email(); - user_info.basic_user_info.avatar = BuildAshUserAvatarForUser(*user); + user_info.basic_user_info.avatar = ash::BuildAshUserAvatarForUser(*user); user_info.auth_type = initial_auth_type; user_info.is_signed_in = user->is_logged_in(); user_info.is_device_owner = is_owner;
diff --git a/chrome/browser/ash/login/screens/user_selection_screen.h b/chrome/browser/ash/login/screens/user_selection_screen.h index 20c7c64..02ef0c6 100644 --- a/chrome/browser/ash/login/screens/user_selection_screen.h +++ b/chrome/browser/ash/login/screens/user_selection_screen.h
@@ -9,7 +9,6 @@ #include <string> #include <vector> -#include "ash/public/cpp/session/user_info.h" #include "base/memory/raw_ptr.h" #include "base/scoped_observation.h" #include "base/time/time.h" @@ -99,9 +98,6 @@ // UserOnlineSigninNotifier::Observer void OnOnlineSigninEnforced(const AccountId& account_id) override; - // Builds a `UserAvatar` instance which contains the current image for `user`. - static UserAvatar BuildAshUserAvatarForUser(const user_manager::User& user); - std::vector<LoginUserInfo> UpdateAndReturnUserListForAsh(); void SetUsersLoaded(bool loaded);
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 8ebef3db..bf5e834 100644 --- a/chrome/browser/ash/login/ui/login_display_host_mojo.cc +++ b/chrome/browser/ash/login/ui/login_display_host_mojo.cc
@@ -10,6 +10,7 @@ #include "ash/constants/ash_pref_names.h" #include "ash/constants/ash_switches.h" #include "ash/public/cpp/input_device_settings_controller.h" +#include "ash/public/cpp/login/login_utils.h" #include "ash/public/cpp/login_screen.h" #include "ash/public/cpp/login_screen_model.h" #include "ash/public/cpp/shell_window_ids.h" @@ -157,8 +158,7 @@ user_info.basic_user_info.display_name = base::UTF16ToUTF8(device_owner->GetDisplayName()); user_info.basic_user_info.display_email = device_owner->display_email(); - user_info.basic_user_info.avatar = - UserSelectionScreen::BuildAshUserAvatarForUser(*device_owner); + user_info.basic_user_info.avatar = BuildAshUserAvatarForUser(*device_owner); user_info.auth_type = proximity_auth::mojom::AuthType::OFFLINE_PASSWORD; user_info.is_signed_in = device_owner->is_logged_in(); user_info.is_device_owner = true;
diff --git a/chrome/browser/ash/preferences.cc b/chrome/browser/ash/preferences.cc index a1cb268b..369dc56c 100644 --- a/chrome/browser/ash/preferences.cc +++ b/chrome/browser/ash/preferences.cc
@@ -603,6 +603,9 @@ false); registry->RegisterBooleanPref(::prefs::kHasEverRevokedMetricsConsent, true); + + registry->RegisterBooleanPref(prefs::kShowHumanPresenceSensorScreenEnabled, + true); } void Preferences::InitUserPrefs(sync_preferences::PrefServiceSyncable* prefs) {
diff --git a/chrome/browser/chromeos/cros_apps/BUILD.gn b/chrome/browser/chromeos/cros_apps/BUILD.gn new file mode 100644 index 0000000..6acf9d4 --- /dev/null +++ b/chrome/browser/chromeos/cros_apps/BUILD.gn
@@ -0,0 +1,51 @@ +# Copyright 2023 The Chromium Authors +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//build/config/chromeos/ui_mode.gni") + +assert(is_chromeos) + +source_set("cros_apps") { + sources = [ + "cros_apps_tab_helper.cc", + "cros_apps_tab_helper.h", + ] + + deps = [ + "//chromeos/constants:constants", + "//content/public/browser", + "//content/public/common", + ] +} + +source_set("test_support") { + testonly = true + sources = [ + "cros_apps_test_utils.cc", + "cros_apps_test_utils.h", + ] + + public_deps = [ "//content/test:test_support" ] +} + +source_set("browser_tests") { + testonly = true + defines = [ "HAS_OUT_OF_PROC_TEST_RUNNER" ] + + sources = [ "cros_apps_tab_helper_browsertest.cc" ] + + deps = [ + ":test_support", + "//chrome/test:test_support", + "//chromeos/constants", + ] +} + +group("all_browser_tests") { + testonly = true + deps = [ + "//chrome/browser/chromeos/cros_apps:browser_tests", + "//chrome/browser/chromeos/cros_apps/api:browser_tests", + ] +}
diff --git a/chrome/browser/chromeos/cros_apps/OWNERS b/chrome/browser/chromeos/cros_apps/OWNERS new file mode 100644 index 0000000..3ef627b6 --- /dev/null +++ b/chrome/browser/chromeos/cros_apps/OWNERS
@@ -0,0 +1,2 @@ +glenrob@chromium.org +ortuno@chromium.org
diff --git a/chrome/browser/chromeos/cros_apps/README.md b/chrome/browser/chromeos/cros_apps/README.md new file mode 100644 index 0000000..b3197aa --- /dev/null +++ b/chrome/browser/chromeos/cros_apps/README.md
@@ -0,0 +1,4 @@ +# ChromeOS Apps + +This folder holds a prototype for the ChromeOS Apps platform. For now, it +contains prototype API implementations and test support.
diff --git a/chrome/browser/chromeos/cros_apps/api/BUILD.gn b/chrome/browser/chromeos/cros_apps/api/BUILD.gn new file mode 100644 index 0000000..313c9fe --- /dev/null +++ b/chrome/browser/chromeos/cros_apps/api/BUILD.gn
@@ -0,0 +1,28 @@ +# Copyright 2023 The Chromium Authors +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//build/config/chromeos/ui_mode.gni") + +assert(is_chromeos) + +source_set("browser_tests") { + testonly = true + + sources = [ + "cros_apps_blink_runtime_feature_browsertest.cc", + "cros_apps_chromeos_apitest.cc", + ] + + defines = [ "HAS_OUT_OF_PROC_TEST_RUNNER" ] + + deps = [ + "//chrome/browser/chromeos/cros_apps:test_support", + "//chrome/browser/chromeos/cros_apps/api/test:apitest_support", + "//chrome/browser/ui", + "//chromeos/constants", + "//content/test:browsertest_support", + "//content/test:test_support", + "//testing/gtest", + ] +}
diff --git a/chrome/browser/lacros/cros_apps/api/cros_apps_blink_runtime_feature_browsertest.cc b/chrome/browser/chromeos/cros_apps/api/cros_apps_blink_runtime_feature_browsertest.cc similarity index 96% rename from chrome/browser/lacros/cros_apps/api/cros_apps_blink_runtime_feature_browsertest.cc rename to chrome/browser/chromeos/cros_apps/api/cros_apps_blink_runtime_feature_browsertest.cc index 0a696fd..2b8f5e77 100644 --- a/chrome/browser/lacros/cros_apps/api/cros_apps_blink_runtime_feature_browsertest.cc +++ b/chrome/browser/chromeos/cros_apps/api/cros_apps_blink_runtime_feature_browsertest.cc
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "chrome/browser/lacros/cros_apps/cros_apps_test_utils.h" +#include "chrome/browser/chromeos/cros_apps/cros_apps_test_utils.h" #include "chrome/browser/ui/browser.h" #include "chrome/test/base/in_process_browser_test.h" #include "content/public/browser/navigation_handle.h" @@ -13,8 +13,8 @@ // Tests for content and blink mechanism that controls API exposure. // // This test directly controls Blink RuntimeFeatureState thus doesn't use -// CrosAppsApiBrowserTestBase (which enables CrosApps flags to control feature -// exposure based on feature control rules). +// CrosAppsApiTest (which enables CrosApps flags to control feature exposure +// based on feature control rules). class CrosAppsBlinkRuntimeFeatureBrowserTest : public InProcessBrowserTest, private content::WebContentsObserver {
diff --git a/chrome/browser/lacros/cros_apps/api/cros_apps_chromeos_api_browsertest.cc b/chrome/browser/chromeos/cros_apps/api/cros_apps_chromeos_apitest.cc similarity index 71% rename from chrome/browser/lacros/cros_apps/api/cros_apps_chromeos_api_browsertest.cc rename to chrome/browser/chromeos/cros_apps/api/cros_apps_chromeos_apitest.cc index 5c98d4b9..72e24690 100644 --- a/chrome/browser/lacros/cros_apps/api/cros_apps_chromeos_api_browsertest.cc +++ b/chrome/browser/chromeos/cros_apps/api/cros_apps_chromeos_apitest.cc
@@ -2,16 +2,15 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "chrome/browser/lacros/cros_apps/api/cros_apps_api_browsertest_base.h" - +#include "chrome/browser/chromeos/cros_apps/api/test/cros_apps_apitest.h" #include "chrome/browser/ui/browser.h" #include "content/public/browser/web_contents.h" #include "content/public/test/browser_test.h" #include "testing/gtest/include/gtest/gtest.h" -using CrosAppsChromeosApiBrowserTest = CrosAppsApiBrowserTestBase; +using CrosAppsChromeosApiTest = CrosAppsApiTest; -IN_PROC_BROWSER_TEST_F(CrosAppsChromeosApiBrowserTest, ChromeosExists) { +IN_PROC_BROWSER_TEST_F(CrosAppsChromeosApiTest, ChromeosExists) { content::WebContents* web_contents = browser()->tab_strip_model()->GetActiveWebContents();
diff --git a/chrome/browser/chromeos/cros_apps/api/test/BUILD.gn b/chrome/browser/chromeos/cros_apps/api/test/BUILD.gn new file mode 100644 index 0000000..d5c3b11c --- /dev/null +++ b/chrome/browser/chromeos/cros_apps/api/test/BUILD.gn
@@ -0,0 +1,23 @@ +# Copyright 2023 The Chromium Authors +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//build/config/chromeos/ui_mode.gni") + +assert(is_chromeos) + +source_set("apitest_support") { + testonly = true + + sources = [ + "cros_apps_apitest.cc", + "cros_apps_apitest.h", + ] + + deps = [ "//chromeos/constants" ] + + public_deps = [ + "//chrome/test:test_support_ui", + "//testing/gtest", + ] +}
diff --git a/chrome/browser/chromeos/cros_apps/api/test/cros_apps_apitest.cc b/chrome/browser/chromeos/cros_apps/api/test/cros_apps_apitest.cc new file mode 100644 index 0000000..d6524ad1 --- /dev/null +++ b/chrome/browser/chromeos/cros_apps/api/test/cros_apps_apitest.cc
@@ -0,0 +1,14 @@ +// Copyright 2023 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "chrome/browser/chromeos/cros_apps/api/test/cros_apps_apitest.h" + +#include "chromeos/constants/chromeos_features.h" + +CrosAppsApiTest::CrosAppsApiTest() { + scoped_feature_list_.InitAndEnableFeature( + chromeos::features::kBlinkExtension); +} + +CrosAppsApiTest::~CrosAppsApiTest() = default;
diff --git a/chrome/browser/chromeos/cros_apps/api/test/cros_apps_apitest.h b/chrome/browser/chromeos/cros_apps/api/test/cros_apps_apitest.h new file mode 100644 index 0000000..8567f76 --- /dev/null +++ b/chrome/browser/chromeos/cros_apps/api/test/cros_apps_apitest.h
@@ -0,0 +1,27 @@ +// Copyright 2023 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef CHROME_BROWSER_CHROMEOS_CROS_APPS_API_TEST_CROS_APPS_APITEST_H_ +#define CHROME_BROWSER_CHROMEOS_CROS_APPS_API_TEST_CROS_APPS_APITEST_H_ + +#include "base/test/scoped_feature_list.h" +#include "chrome/test/base/in_process_browser_test.h" + +// Base test class used for writing ChromeOS App API tests. Supports running +// in both Ash and Lacros. +class CrosAppsApiTest : public InProcessBrowserTest { + public: + CrosAppsApiTest(); + + CrosAppsApiTest(const CrosAppsApiTest&) = delete; + CrosAppsApiTest& operator=(const CrosAppsApiTest&) = delete; + + // InProcessBrowserTest + ~CrosAppsApiTest() override; + + private: + base::test::ScopedFeatureList scoped_feature_list_; +}; + +#endif // CHROME_BROWSER_CHROMEOS_CROS_APPS_API_TEST_CROS_APPS_APITEST_H_
diff --git a/chrome/browser/lacros/cros_apps/cros_apps_tab_helper.cc b/chrome/browser/chromeos/cros_apps/cros_apps_tab_helper.cc similarity index 96% rename from chrome/browser/lacros/cros_apps/cros_apps_tab_helper.cc rename to chrome/browser/chromeos/cros_apps/cros_apps_tab_helper.cc index f2b080e..2210ccc 100644 --- a/chrome/browser/lacros/cros_apps/cros_apps_tab_helper.cc +++ b/chrome/browser/chromeos/cros_apps/cros_apps_tab_helper.cc
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "chrome/browser/lacros/cros_apps/cros_apps_tab_helper.h" +#include "chrome/browser/chromeos/cros_apps/cros_apps_tab_helper.h" #include <memory>
diff --git a/chrome/browser/lacros/cros_apps/cros_apps_tab_helper.h b/chrome/browser/chromeos/cros_apps/cros_apps_tab_helper.h similarity index 85% rename from chrome/browser/lacros/cros_apps/cros_apps_tab_helper.h rename to chrome/browser/chromeos/cros_apps/cros_apps_tab_helper.h index bf7d86f5..f3cdc96b 100644 --- a/chrome/browser/lacros/cros_apps/cros_apps_tab_helper.h +++ b/chrome/browser/chromeos/cros_apps/cros_apps_tab_helper.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 CHROME_BROWSER_LACROS_CROS_APPS_CROS_APPS_TAB_HELPER_H_ -#define CHROME_BROWSER_LACROS_CROS_APPS_CROS_APPS_TAB_HELPER_H_ +#ifndef CHROME_BROWSER_CHROMEOS_CROS_APPS_CROS_APPS_TAB_HELPER_H_ +#define CHROME_BROWSER_CHROMEOS_CROS_APPS_CROS_APPS_TAB_HELPER_H_ #include "base/types/pass_key.h" #include "content/public/browser/web_contents_observer.h" @@ -37,4 +37,4 @@ WEB_CONTENTS_USER_DATA_KEY_DECL(); }; -#endif // CHROME_BROWSER_LACROS_CROS_APPS_CROS_APPS_TAB_HELPER_H_ +#endif // CHROME_BROWSER_CHROMEOS_CROS_APPS_CROS_APPS_TAB_HELPER_H_
diff --git a/chrome/browser/lacros/cros_apps/cros_apps_tab_helper_browsertest.cc b/chrome/browser/chromeos/cros_apps/cros_apps_tab_helper_browsertest.cc similarity index 96% rename from chrome/browser/lacros/cros_apps/cros_apps_tab_helper_browsertest.cc rename to chrome/browser/chromeos/cros_apps/cros_apps_tab_helper_browsertest.cc index f1fe7ff..0a2284f 100644 --- a/chrome/browser/lacros/cros_apps/cros_apps_tab_helper_browsertest.cc +++ b/chrome/browser/chromeos/cros_apps/cros_apps_tab_helper_browsertest.cc
@@ -3,7 +3,7 @@ // found in the LICENSE file. #include "base/test/scoped_feature_list.h" -#include "chrome/browser/lacros/cros_apps/cros_apps_test_utils.h" +#include "chrome/browser/chromeos/cros_apps/cros_apps_test_utils.h" #include "chrome/browser/ui/browser.h" #include "chrome/browser/ui/tabs/tab_strip_model.h" #include "chrome/test/base/in_process_browser_test.h"
diff --git a/chrome/browser/lacros/cros_apps/cros_apps_test_utils.cc b/chrome/browser/chromeos/cros_apps/cros_apps_test_utils.cc similarity index 85% rename from chrome/browser/lacros/cros_apps/cros_apps_test_utils.cc rename to chrome/browser/chromeos/cros_apps/cros_apps_test_utils.cc index 5bbe9e3..74a045b0 100644 --- a/chrome/browser/lacros/cros_apps/cros_apps_test_utils.cc +++ b/chrome/browser/chromeos/cros_apps/cros_apps_test_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 "chrome/browser/lacros/cros_apps/cros_apps_test_utils.h" +#include "chrome/browser/chromeos/cros_apps/cros_apps_test_utils.h" #include "base/strings/stringprintf.h"
diff --git a/chrome/browser/lacros/cros_apps/cros_apps_test_utils.h b/chrome/browser/chromeos/cros_apps/cros_apps_test_utils.h similarity index 67% rename from chrome/browser/lacros/cros_apps/cros_apps_test_utils.h rename to chrome/browser/chromeos/cros_apps/cros_apps_test_utils.h index b3c59fa9..e3e7ddf 100644 --- a/chrome/browser/lacros/cros_apps/cros_apps_test_utils.h +++ b/chrome/browser/chromeos/cros_apps/cros_apps_test_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 CHROME_BROWSER_LACROS_CROS_APPS_CROS_APPS_TEST_UTILS_H_ -#define CHROME_BROWSER_LACROS_CROS_APPS_CROS_APPS_TEST_UTILS_H_ +#ifndef CHROME_BROWSER_CHROMEOS_CROS_APPS_CROS_APPS_TEST_UTILS_H_ +#define CHROME_BROWSER_CHROMEOS_CROS_APPS_CROS_APPS_TEST_UTILS_H_ #include "content/public/test/browser_test_utils.h" @@ -13,4 +13,4 @@ const content::ToRenderFrameHost& wc_or_rfh, const char* identifier); -#endif // CHROME_BROWSER_LACROS_CROS_APPS_CROS_APPS_TEST_UTILS_H_ +#endif // CHROME_BROWSER_CHROMEOS_CROS_APPS_CROS_APPS_TEST_UTILS_H_
diff --git a/chrome/browser/dips/dips_helper_browsertest.cc b/chrome/browser/dips/dips_helper_browsertest.cc index e044989..9da75b2 100644 --- a/chrome/browser/dips/dips_helper_browsertest.cc +++ b/chrome/browser/dips/dips_helper_browsertest.cc
@@ -796,8 +796,13 @@ .has_value()); } +#if BUILDFLAG(IS_LINUX) +#define MAYBE_SitesInDestroyedTabsAreNotExempt DISABLED_SitesInDestroyedTabsAreNotExempt +#else +#define MAYBE_SitesInDestroyedTabsAreNotExempt SitesInDestroyedTabsAreNotExempt +#endif IN_PROC_BROWSER_TEST_P(DIPSTabHelperBrowserTest, - SitesInDestroyedTabsAreNotExempt) { + MAYBE_SitesInDestroyedTabsAreNotExempt) { content::WebContents* web_contents = GetActiveWebContents(); DIPSService* dips_service = DIPSServiceFactory::GetForBrowserContext( web_contents->GetBrowserContext());
diff --git a/chrome/browser/extensions/api/tabs/tabs_apitest.cc b/chrome/browser/extensions/api/tabs/tabs_apitest.cc index 1aa7cb7..6495f4e 100644 --- a/chrome/browser/extensions/api/tabs/tabs_apitest.cc +++ b/chrome/browser/extensions/api/tabs/tabs_apitest.cc
@@ -162,7 +162,12 @@ ASSERT_TRUE(RunExtensionTest("tabs/basics/pinned")) << message_; } -IN_PROC_BROWSER_TEST_P(ExtensionApiTabTestWithContextType, Move) { +#if BUILDFLAG(IS_LINUX) && !defined(NDEBUG) +#define MAYBE_Move DISABLED_Move +#else +#define MAYBE_Move Move +#endif +IN_PROC_BROWSER_TEST_P(ExtensionApiTabTestWithContextType, MAYBE_Move) { ASSERT_TRUE(RunExtensionTest("tabs/basics/move")) << message_; }
diff --git a/chrome/browser/flag-metadata.json b/chrome/browser/flag-metadata.json index 6f71cbc9..50fd49a0 100644 --- a/chrome/browser/flag-metadata.json +++ b/chrome/browser/flag-metadata.json
@@ -247,6 +247,16 @@ "expiry_milestone": 120 }, { + "name": "app-to-app-link-capturing", + "owners": [ "tsergeant", "chromeos-apps-foundation-team@google.com" ], + "expiry_milestone": 125 + }, + { + "name": "app-to-app-link-capturing-workspace-apps", + "owners": [ "tsergeant", "chromeos-apps-foundation-team@google.com" ], + "expiry_milestone": 125 + }, + { "name": "arc-aaudio-mmap-low-latency", "owners": [ "pteerapong", "chromeos-audio@google.com" ], "expiry_milestone": 125 @@ -274,7 +284,7 @@ { "name": "arc-enable-virtio-blk-for-data", "owners": [ "niwa" ], - "expiry_milestone": 120 + "expiry_milestone": 130 }, { "name": "arc-external-storage-access", @@ -284,7 +294,7 @@ { "name": "arc-file-picker-experiment", "owners": [ "youkichihosoi", "niwa" ], - "expiry_milestone": 120 + "expiry_milestone": 130 }, { "name": "arc-game-mode", @@ -966,11 +976,6 @@ "expiry_milestone": 127 }, { - "name": "broker-file-operations-on-disk-cache-in-network-service", - "owners": [ "yhirano", "network-service-dev" ], - "expiry_milestone": 120 - }, - { "name": "bruschetta", "owners": [ "davidmunro@google.com", "nverne", "sidereal" ], "expiry_milestone": 120 @@ -3048,12 +3053,12 @@ { "name": "enable-lacros-in-chrome-kiosk", "owners": ["bfranz", "chromeos-kiosk-eng@google.com"], - "expiry_milestone": 120 + "expiry_milestone": 130 }, { "name": "enable-lacros-in-web-kiosk", "owners": ["bfranz", "chromeos-kiosk-eng@google.com"], - "expiry_milestone": 120 + "expiry_milestone": 130 }, { "name": "enable-lens-context-menu-alt-text", @@ -5667,11 +5672,6 @@ "expiry_milestone": 120 }, { - "name": "multiline-fade-truncating-label", - "owners": [ "christianxu", "stkhapugin", "bling-flags@google.com"], - "expiry_milestone": 120 - }, - { "name": "mutation-events", "owners": [ "masonf" ], "expiry_milestone": 127 @@ -6191,11 +6191,6 @@ "expiry_milestone": 130 }, { - "name": "omnibox-multiline-search-suggest", - "owners": [ "christianxu", "stkhapugin", "chrome-omnibox-team@google.com"], - "expiry_milestone": 120 - }, - { "name": "omnibox-new-textfield-implementation", "owners": ["stkhapugin", "rkgibson@google.com", "chrome-omnibox-team@google.com"], "expiry_milestone": 120 @@ -6592,7 +6587,7 @@ { "name": "password-generation-bottom-sheet", "owners": ["atsvirchkova@google.com", "ioanap"], - "expiry_milestone": 120 + "expiry_milestone": 123 }, { "name": "password-generation-experiment",
diff --git a/chrome/browser/flag_descriptions.cc b/chrome/browser/flag_descriptions.cc index 2869c13..43e9f6f 100644 --- a/chrome/browser/flag_descriptions.cc +++ b/chrome/browser/flag_descriptions.cc
@@ -7183,6 +7183,19 @@ #endif // BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_LINUX) #if BUILDFLAG(IS_CHROMEOS) + +const char kAppToAppLinkCapturingName[] = "App-to-app link capturing"; +const char kAppToAppLinkCapturingDescription[] = + "Enables link capturing from one app to another, even when the target app " + "does not have link capturing enabled in settings"; + +const char kAppToAppLinkCapturingWorkspaceAppsName[] = + "App-to-app link capturing for Workspace apps"; +const char kAppToAppLinkCapturingWorkspaceAppsDescription[] = + "Enables link capturing from one app to another, even when the target app " + "does not have link capturing enabled in settings. Only applies if the " + "target app is a Workspace app (Google Drive/Docs/Sheets/Slides)."; + const char kCrosWebAppInstallDialogName[] = "Web app install dialog"; const char kCrosWebAppInstallDialogDescription[] = "Enables a more detailed, OS-level dialog for web app installs";
diff --git a/chrome/browser/flag_descriptions.h b/chrome/browser/flag_descriptions.h index a9ec28d..9a9c444e 100644 --- a/chrome/browser/flag_descriptions.h +++ b/chrome/browser/flag_descriptions.h
@@ -4134,6 +4134,12 @@ #endif // BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_LINUX) #if BUILDFLAG(IS_CHROMEOS) +extern const char kAppToAppLinkCapturingName[]; +extern const char kAppToAppLinkCapturingDescription[]; + +extern const char kAppToAppLinkCapturingWorkspaceAppsName[]; +extern const char kAppToAppLinkCapturingWorkspaceAppsDescription[]; + extern const char kCrosWebAppInstallDialogName[]; extern const char kCrosWebAppInstallDialogDescription[];
diff --git a/chrome/browser/headless/headless_mode_protocol_browsertest.cc b/chrome/browser/headless/headless_mode_protocol_browsertest.cc index f0904b2..5bdb7e3c 100644 --- a/chrome/browser/headless/headless_mode_protocol_browsertest.cc +++ b/chrome/browser/headless/headless_mode_protocol_browsertest.cc
@@ -245,8 +245,8 @@ bool select_file_dialog_has_run_ = false; }; -// TODO(crbug.com/1459246): flaky on Mac builders. -#if BUILDFLAG(IS_MAC) +// TODO(crbug.com/1459246): flaky on Mac and Linux builders. +#if BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) #define MAYBE_InputSelectFileDialog DISABLED_InputSelectFileDialog #else #define MAYBE_InputSelectFileDialog InputSelectFileDialog
diff --git a/chrome/browser/lacros/cros_apps/BUILD.gn b/chrome/browser/lacros/cros_apps/BUILD.gn index a687dee..58071409 100644 --- a/chrome/browser/lacros/cros_apps/BUILD.gn +++ b/chrome/browser/lacros/cros_apps/BUILD.gn
@@ -6,46 +6,7 @@ assert(is_chromeos_lacros) -source_set("cros_apps") { - sources = [ - "cros_apps_tab_helper.cc", - "cros_apps_tab_helper.h", - ] - - deps = [ - "//chromeos/constants:constants", - "//content/public/browser", - "//content/public/common", - ] -} - -source_set("test_support") { - testonly = true - sources = [ - "cros_apps_test_utils.cc", - "cros_apps_test_utils.h", - ] - - public_deps = [ "//content/test:test_support" ] -} - -source_set("browser_tests") { - testonly = true - defines = [ "HAS_OUT_OF_PROC_TEST_RUNNER" ] - - sources = [ "cros_apps_tab_helper_browsertest.cc" ] - - deps = [ - ":test_support", - "//chrome/test:test_support", - "//chromeos/constants", - ] -} - group("all_browser_tests") { testonly = true - deps = [ - "//chrome/browser/lacros/cros_apps:browser_tests", - "//chrome/browser/lacros/cros_apps/api:browser_tests", - ] + deps = [ "//chrome/browser/lacros/cros_apps/api/diagnostics:browser_tests" ] }
diff --git a/chrome/browser/lacros/cros_apps/OWNERS b/chrome/browser/lacros/cros_apps/OWNERS index 3ef627b6..6765f84b 100644 --- a/chrome/browser/lacros/cros_apps/OWNERS +++ b/chrome/browser/lacros/cros_apps/OWNERS
@@ -1,2 +1 @@ -glenrob@chromium.org -ortuno@chromium.org +file://chrome/browser/chromeos/cros_apps/OWNERS
diff --git a/chrome/browser/lacros/cros_apps/api/BUILD.gn b/chrome/browser/lacros/cros_apps/api/BUILD.gn index d1e5f7e..e69de29 100644 --- a/chrome/browser/lacros/cros_apps/api/BUILD.gn +++ b/chrome/browser/lacros/cros_apps/api/BUILD.gn
@@ -1,42 +0,0 @@ -# Copyright 2023 The Chromium Authors -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -import("//build/config/chromeos/ui_mode.gni") - -assert(is_chromeos_lacros) - -source_set("test_support") { - testonly = true - - sources = [ - "cros_apps_api_browsertest_base.cc", - "cros_apps_api_browsertest_base.h", - ] - - public_deps = [ - "//chrome/browser/lacros/cros_apps:test_support", - "//chrome/test:test_support_ui", - "//chromeos/constants", - ] -} - -source_set("browser_tests") { - testonly = true - - sources = [ - "cros_apps_blink_runtime_feature_browsertest.cc", - "cros_apps_chromeos_api_browsertest.cc", - ] - - defines = [ "HAS_OUT_OF_PROC_TEST_RUNNER" ] - - deps = [ - ":test_support", - "diagnostics:browser_tests", - "//chrome/browser/ui", - "//content/test:browsertest_support", - "//content/test:test_support", - "//testing/gtest", - ] -}
diff --git a/chrome/browser/lacros/cros_apps/api/cros_apps_api_browsertest_base.cc b/chrome/browser/lacros/cros_apps/api/cros_apps_api_browsertest_base.cc deleted file mode 100644 index 891a0f7..0000000 --- a/chrome/browser/lacros/cros_apps/api/cros_apps_api_browsertest_base.cc +++ /dev/null
@@ -1,14 +0,0 @@ -// Copyright 2023 The Chromium Authors -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "chrome/browser/lacros/cros_apps/api/cros_apps_api_browsertest_base.h" - -#include "chromeos/constants/chromeos_features.h" - -CrosAppsApiBrowserTestBase::CrosAppsApiBrowserTestBase() { - scoped_feature_list_.InitAndEnableFeature( - chromeos::features::kBlinkExtension); -} - -CrosAppsApiBrowserTestBase::~CrosAppsApiBrowserTestBase() = default;
diff --git a/chrome/browser/lacros/cros_apps/api/cros_apps_api_browsertest_base.h b/chrome/browser/lacros/cros_apps/api/cros_apps_api_browsertest_base.h deleted file mode 100644 index 5350681d5..0000000 --- a/chrome/browser/lacros/cros_apps/api/cros_apps_api_browsertest_base.h +++ /dev/null
@@ -1,26 +0,0 @@ -// Copyright 2023 The Chromium Authors -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef CHROME_BROWSER_LACROS_CROS_APPS_API_CROS_APPS_API_BROWSERTEST_BASE_H_ -#define CHROME_BROWSER_LACROS_CROS_APPS_API_CROS_APPS_API_BROWSERTEST_BASE_H_ - -#include "base/test/scoped_feature_list.h" -#include "chrome/test/base/in_process_browser_test.h" - -class CrosAppsApiBrowserTestBase : public InProcessBrowserTest { - public: - CrosAppsApiBrowserTestBase(); - - CrosAppsApiBrowserTestBase(const CrosAppsApiBrowserTestBase&) = delete; - CrosAppsApiBrowserTestBase& operator=(const CrosAppsApiBrowserTestBase&) = - delete; - - // InProcessBrowserTest - ~CrosAppsApiBrowserTestBase() override; - - private: - base::test::ScopedFeatureList scoped_feature_list_; -}; - -#endif // CHROME_BROWSER_LACROS_CROS_APPS_API_CROS_APPS_API_BROWSERTEST_BASE_H_
diff --git a/chrome/browser/lacros/cros_apps/api/diagnostics/BUILD.gn b/chrome/browser/lacros/cros_apps/api/diagnostics/BUILD.gn index 65ebbacd..e485bce 100644 --- a/chrome/browser/lacros/cros_apps/api/diagnostics/BUILD.gn +++ b/chrome/browser/lacros/cros_apps/api/diagnostics/BUILD.gn
@@ -22,14 +22,15 @@ source_set("browser_tests") { testonly = true - sources = [ "cros_apps_diagnostics_api_browsertest.cc" ] + sources = [ "cros_apps_diagnostics_apitest.cc" ] defines = [ "HAS_OUT_OF_PROC_TEST_RUNNER" ] deps = [ + "//chrome/browser/chromeos/cros_apps/api/test:apitest_support", "//chrome/browser/chromeos/telemetry:test_support", - "//chrome/browser/lacros/cros_apps/api:test_support", "//chrome/browser/ui", + "//chromeos/constants", "//chromeos/lacros", "//content/test:test_support", "//testing/gtest",
diff --git a/chrome/browser/lacros/cros_apps/api/diagnostics/cros_apps_diagnostics_api_browsertest.cc b/chrome/browser/lacros/cros_apps/api/diagnostics/cros_apps_diagnostics_apitest.cc similarity index 95% rename from chrome/browser/lacros/cros_apps/api/diagnostics/cros_apps_diagnostics_api_browsertest.cc rename to chrome/browser/lacros/cros_apps/api/diagnostics/cros_apps_diagnostics_apitest.cc index 359fa43..181443b 100644 --- a/chrome/browser/lacros/cros_apps/api/diagnostics/cros_apps_diagnostics_api_browsertest.cc +++ b/chrome/browser/lacros/cros_apps/api/diagnostics/cros_apps_diagnostics_apitest.cc
@@ -7,8 +7,8 @@ #include "base/system/sys_info.h" #include "base/test/test_future.h" #include "base/threading/thread_restrictions.h" +#include "chrome/browser/chromeos/cros_apps/api/test/cros_apps_apitest.h" #include "chrome/browser/chromeos/telemetry/fake_probe_service.h" -#include "chrome/browser/lacros/cros_apps/api/cros_apps_api_browsertest_base.h" #include "chrome/browser/ui/browser.h" #include "chromeos/constants/chromeos_features.h" #include "chromeos/lacros/lacros_service.h" @@ -19,9 +19,9 @@ #include "services/network/public/mojom/network_service.mojom.h" #include "testing/gtest/include/gtest/gtest.h" -class CrosAppsDiagnosticsApiBrowserTest : public CrosAppsApiBrowserTestBase { +class CrosAppsDiagnosticsApiTest : public CrosAppsApiTest { public: - CrosAppsDiagnosticsApiBrowserTest() : CrosAppsApiBrowserTestBase() { + CrosAppsDiagnosticsApiTest() : CrosAppsApiTest() { scoped_feature_list_.InitAndEnableFeature( chromeos::features::kBlinkExtensionDiagnostics); } @@ -40,7 +40,7 @@ std::unique_ptr<chromeos::FakeProbeService> fake_probe_service_; }; -IN_PROC_BROWSER_TEST_F(CrosAppsDiagnosticsApiBrowserTest, DiagnosticsExists) { +IN_PROC_BROWSER_TEST_F(CrosAppsDiagnosticsApiTest, DiagnosticsExists) { content::WebContents* web_contents = browser()->tab_strip_model()->GetActiveWebContents(); @@ -49,7 +49,7 @@ "typeof window.chromeos.diagnostics !== 'undefined';")); } -IN_PROC_BROWSER_TEST_F(CrosAppsDiagnosticsApiBrowserTest, GetCpuInfo_Success) { +IN_PROC_BROWSER_TEST_F(CrosAppsDiagnosticsApiTest, GetCpuInfo_Success) { content::WebContents* web_contents = browser()->tab_strip_model()->GetActiveWebContents(); @@ -217,7 +217,7 @@ } } -IN_PROC_BROWSER_TEST_F(CrosAppsDiagnosticsApiBrowserTest, +IN_PROC_BROWSER_TEST_F(CrosAppsDiagnosticsApiTest, GetCpuInfo_Error_TelemetryProbeServiceUnavailable) { content::WebContents* web_contents = browser()->tab_strip_model()->GetActiveWebContents(); @@ -230,7 +230,7 @@ .error); } -IN_PROC_BROWSER_TEST_F(CrosAppsDiagnosticsApiBrowserTest, +IN_PROC_BROWSER_TEST_F(CrosAppsDiagnosticsApiTest, GetCpuInfo_Error_CpuTelemetryInfoUnavailable) { content::WebContents* web_contents = browser()->tab_strip_model()->GetActiveWebContents(); @@ -260,7 +260,7 @@ .error); } -IN_PROC_BROWSER_TEST_F(CrosAppsDiagnosticsApiBrowserTest, +IN_PROC_BROWSER_TEST_F(CrosAppsDiagnosticsApiTest, GetNetworkInterfaces) { content::WebContents* web_contents = browser()->tab_strip_model()->GetActiveWebContents();
diff --git a/chrome/browser/navigation_predictor/anchor_element_preloader_browsertest.cc b/chrome/browser/navigation_predictor/anchor_element_preloader_browsertest.cc index a7f9647..7430deb 100644 --- a/chrome/browser/navigation_predictor/anchor_element_preloader_browsertest.cc +++ b/chrome/browser/navigation_predictor/anchor_element_preloader_browsertest.cc
@@ -442,13 +442,8 @@ }; // TODO(crbug.com/1383953): Re-enable this test -#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) -#define MAYBE_LimitExceeded DISABLED_LimitExceeded -#else -#define MAYBE_LimitExceeded LimitExceeded -#endif IN_PROC_BROWSER_TEST_F(AnchorElementPreloaderLimitedBrowserTest, - MAYBE_LimitExceeded) { + DISABLED_LimitExceeded) { const GURL& url = GetTestURL("/many_anchors.html"); EXPECT_TRUE(ui_test_utils::NavigateToURL(browser(), url));
diff --git a/chrome/browser/policy/configuration_policy_handler_list_factory.cc b/chrome/browser/policy/configuration_policy_handler_list_factory.cc index 5e5afdc0..471f561 100644 --- a/chrome/browser/policy/configuration_policy_handler_list_factory.cc +++ b/chrome/browser/policy/configuration_policy_handler_list_factory.cc
@@ -1544,6 +1544,9 @@ { key::kDeviceExtendedFkeysModifier, ash::prefs::kExtendedFkeysModifier, base::Value::Type::INTEGER }, + { key::kShowHumanPresenceSensorScreenEnabled, + ash::prefs::kShowHumanPresenceSensorScreenEnabled, + base::Value::Type::BOOLEAN }, #endif // BUILDFLAG(IS_CHROMEOS_ASH) #if BUILDFLAG(IS_LINUX)
diff --git a/chrome/browser/privacy_sandbox/android/BUILD.gn b/chrome/browser/privacy_sandbox/android/BUILD.gn index 87f50f70..32664b3 100644 --- a/chrome/browser/privacy_sandbox/android/BUILD.gn +++ b/chrome/browser/privacy_sandbox/android/BUILD.gn
@@ -185,5 +185,8 @@ } java_cpp_enum("privacy_sandbox_enums") { - sources = [ "//chrome/browser/privacy_sandbox/privacy_sandbox_service.h" ] + sources = [ + "//chrome/browser/privacy_sandbox/privacy_sandbox_service.h", + "//components/privacy_sandbox/tracking_protection_onboarding.h", + ] }
diff --git a/chrome/browser/privacy_sandbox/android/java/src/org/chromium/chrome/browser/privacy_sandbox/TrackingProtectionBridge.java b/chrome/browser/privacy_sandbox/android/java/src/org/chromium/chrome/browser/privacy_sandbox/TrackingProtectionBridge.java index b710b603..7af5eb79 100644 --- a/chrome/browser/privacy_sandbox/android/java/src/org/chromium/chrome/browser/privacy_sandbox/TrackingProtectionBridge.java +++ b/chrome/browser/privacy_sandbox/android/java/src/org/chromium/chrome/browser/privacy_sandbox/TrackingProtectionBridge.java
@@ -12,8 +12,20 @@ return TrackingProtectionBridgeJni.get().shouldShowOnboardingNotice(); } + public static void noticeActionTaken(@NoticeAction int action) { + TrackingProtectionBridgeJni.get().noticeActionTaken(action); + } + + public static void noticeShown() { + TrackingProtectionBridgeJni.get().noticeShown(); + } + @NativeMethods public interface Natives { boolean shouldShowOnboardingNotice(); + + void noticeShown(); + + void noticeActionTaken(int action); } }
diff --git a/chrome/browser/privacy_sandbox/android/javatests/src/org/chromium/chrome/browser/privacy_sandbox/FakeTrackingProtectionBridge.java b/chrome/browser/privacy_sandbox/android/javatests/src/org/chromium/chrome/browser/privacy_sandbox/FakeTrackingProtectionBridge.java index 96b5b4a..f9a5bc1f 100644 --- a/chrome/browser/privacy_sandbox/android/javatests/src/org/chromium/chrome/browser/privacy_sandbox/FakeTrackingProtectionBridge.java +++ b/chrome/browser/privacy_sandbox/android/javatests/src/org/chromium/chrome/browser/privacy_sandbox/FakeTrackingProtectionBridge.java
@@ -6,15 +6,34 @@ /** Java implementation of TrackingProtectionBridge for testing. */ public class FakeTrackingProtectionBridge implements TrackingProtectionBridge.Natives { - private boolean mShouldShowOnboardingNotice; + private Integer mLastNoticeAction; + private boolean mNoticeShown; @Override public boolean shouldShowOnboardingNotice() { return mShouldShowOnboardingNotice; } + @Override + public void noticeShown() { + mNoticeShown = true; + } + + @Override + public void noticeActionTaken(@NoticeAction int action) { + mLastNoticeAction = action; + } + public void setShouldShowOnboardingNotice(boolean shouldShowOnboardingNotice) { mShouldShowOnboardingNotice = shouldShowOnboardingNotice; } + + public boolean wasNoticeShown() { + return mNoticeShown; + } + + public Integer getLastNoticeAction() { + return mLastNoticeAction; + } }
diff --git a/chrome/browser/privacy_sandbox/android/javatests/src/org/chromium/chrome/browser/privacy_sandbox/TrackingProtectionNoticeTest.java b/chrome/browser/privacy_sandbox/android/javatests/src/org/chromium/chrome/browser/privacy_sandbox/TrackingProtectionNoticeTest.java index edfeaad..cf6ab22 100644 --- a/chrome/browser/privacy_sandbox/android/javatests/src/org/chromium/chrome/browser/privacy_sandbox/TrackingProtectionNoticeTest.java +++ b/chrome/browser/privacy_sandbox/android/javatests/src/org/chromium/chrome/browser/privacy_sandbox/TrackingProtectionNoticeTest.java
@@ -5,16 +5,22 @@ package org.chromium.chrome.browser.privacy_sandbox; import static androidx.test.espresso.Espresso.onView; +import static androidx.test.espresso.action.ViewActions.click; +import static androidx.test.espresso.action.ViewActions.swipeUp; import static androidx.test.espresso.assertion.ViewAssertions.doesNotExist; import static androidx.test.espresso.assertion.ViewAssertions.matches; import static androidx.test.espresso.matcher.ViewMatchers.isDisplayed; import static androidx.test.espresso.matcher.ViewMatchers.withId; +import static androidx.test.espresso.matcher.ViewMatchers.withText; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; import static org.mockito.ArgumentMatchers.any; import static org.mockito.Mockito.when; import static org.chromium.ui.test.util.ViewUtils.onViewWaiting; +import androidx.test.espresso.Espresso; import androidx.test.filters.SmallTest; import org.junit.Before; @@ -126,6 +132,97 @@ onView(withId(R.id.message_banner)).check(matches(isDisplayed())); } + @Test + @SmallTest + public void testNoticeDismissedWhenPrimaryButtonClicked() { + mFakeTrackingProtectionBridge.setShouldShowOnboardingNotice(true); + setConnectionSecurityLevel(ConnectionSecurityLevel.SECURE); + + sActivityTestRule.startMainActivityWithURL(UrlConstants.GOOGLE_URL); + onView(withId(R.id.message_banner)).check(matches(isDisplayed())); + onView(withId(R.id.message_primary_button)).perform(click()); + assertNoticeShownActionIsRecorded(); + assertLastAction(NoticeAction.GOT_IT); + + onView(withId(R.id.message_banner)).check(doesNotExist()); + } + + @Test + @SmallTest + public void testNoticeDismissedWhenSettingsClicked() { + mFakeTrackingProtectionBridge.setShouldShowOnboardingNotice(true); + setConnectionSecurityLevel(ConnectionSecurityLevel.SECURE); + + // Show the notice. + sActivityTestRule.startMainActivityWithURL(UrlConstants.GOOGLE_URL); + onView(withId(R.id.message_banner)).check(matches(isDisplayed())); + + // Click on settings. + onView(withId(R.id.message_secondary_button)).perform(click()); + onView(withText("Settings")).perform(click()); + assertNoticeShownActionIsRecorded(); + assertLastAction(NoticeAction.SETTINGS); + + // Verify TP Settings page is shown and notice is dismissed. + onView(withText("Tracking Protections")).check(doesNotExist()); + Espresso.pressBack(); + onView(withId(R.id.message_banner)).check(doesNotExist()); + } + + @Test + @SmallTest + public void testNoticeDismissedWhenLearnMoreClicked() { + mFakeTrackingProtectionBridge.setShouldShowOnboardingNotice(true); + setConnectionSecurityLevel(ConnectionSecurityLevel.SECURE); + + // Show the notice. + sActivityTestRule.startMainActivityWithURL(UrlConstants.GOOGLE_URL); + onView(withId(R.id.message_banner)).check(matches(isDisplayed())); + + // Click on learn more. + onView(withId(R.id.message_secondary_button)).perform(click()); + onView(withText("Learn more")).perform(click()); + assertNoticeShownActionIsRecorded(); + assertLastAction(NoticeAction.LEARN_MORE); + + // Verify the notice is dismissed. + onView(withId(R.id.message_banner)).check(doesNotExist()); + } + + @Test + @SmallTest + public void testNoticeDismissedByUser() { + mFakeTrackingProtectionBridge.setShouldShowOnboardingNotice(true); + setConnectionSecurityLevel(ConnectionSecurityLevel.SECURE); + + // Show the notice. + sActivityTestRule.startMainActivityWithURL(UrlConstants.GOOGLE_URL); + onView(withId(R.id.message_banner)).check(matches(isDisplayed())); + + // Dismiss it. + onView(withId(R.id.message_banner)).perform(swipeUp()); + + // Verify the notice is dismissed. + assertNoticeShownActionIsRecorded(); + assertLastAction(NoticeAction.CLOSED); + onView(withId(R.id.message_banner)).check(doesNotExist()); + + // Verify notice won't be shown again. + sActivityTestRule.loadUrl(UrlConstants.MY_ACTIVITY_HOME_URL); + onView(withId(R.id.message_banner)).check(doesNotExist()); + } + + private void assertLastAction(int action) { + assertEquals( + "Last notice action", + action, + (int) mFakeTrackingProtectionBridge.getLastNoticeAction()); + } + + private void assertNoticeShownActionIsRecorded() { + assertTrue(mFakeTrackingProtectionBridge.wasNoticeShown()); + } + private void setConnectionSecurityLevel(int connectionSecurityLevel) { when(mSecurityStateModelNatives.getSecurityLevelForWebContents(any())) .thenAnswer((mock) -> connectionSecurityLevel);
diff --git a/chrome/browser/privacy_sandbox/android/tracking_protection_bridge.cc b/chrome/browser/privacy_sandbox/android/tracking_protection_bridge.cc index 75043fb0..36d99c9 100644 --- a/chrome/browser/privacy_sandbox/android/tracking_protection_bridge.cc +++ b/chrome/browser/privacy_sandbox/android/tracking_protection_bridge.cc
@@ -19,3 +19,14 @@ JNIEnv* env) { return GetTrackingProtectionOnboardingService()->ShouldShowOnboardingNotice(); } + +static void JNI_TrackingProtectionBridge_NoticeShown(JNIEnv* env) { + return GetTrackingProtectionOnboardingService()->NoticeShown(); +} + +static void JNI_TrackingProtectionBridge_NoticeActionTaken(JNIEnv* env, + jint action) { + return GetTrackingProtectionOnboardingService()->NoticeActionTaken( + static_cast<privacy_sandbox::TrackingProtectionOnboarding::NoticeAction>( + action)); +}
diff --git a/chrome/browser/resources/ash/settings/os_languages_page/languages.ts b/chrome/browser/resources/ash/settings/os_languages_page/languages.ts index 742853b..00ee6d69 100644 --- a/chrome/browser/resources/ash/settings/os_languages_page/languages.ts +++ b/chrome/browser/resources/ash/settings/os_languages_page/languages.ts
@@ -54,6 +54,9 @@ export const ACCESSIBILITY_COMMON_IME_ID = '_ext_ime_egfdjlfmgnehecnclamagfafdccgfndpdictation'; +// How often to poll language packs for pack updates. +const LANGUAGE_PACKS_POLLING_RATE_MS = 1000; + interface ModelArgs { // Unused. supportedLanguages: chrome.languageSettingsPrivate.Language[]; @@ -230,6 +233,7 @@ Map<string, chrome.languageSettingsPrivate.InputMethod[]>; private enabledInputMethodSet_: Set<string>; private originalProspectiveUILanguage_?: string; + private languagePackPollIntervalId?: number = undefined; // Bound methods. // Instances of SettingsLanguagesElement below should be replaced with @@ -325,6 +329,13 @@ this.languageSettingsPrivate_.getSpellcheckDictionaryStatuses().then( this.boundOnSpellcheckDictionariesChanged_); + // Poll language packs now to prevent test flakiness. + // Do so in the next microtask to prevent `connectedCallback()` from + // failing and stalling tests. + Promise.resolve().then(() => this.pollLanguagePacks_()); + this.languagePackPollIntervalId = setInterval( + () => this.pollLanguagePacks_(), LANGUAGE_PACKS_POLLING_RATE_MS); + this.resolver_.resolve(undefined); }); @@ -359,6 +370,10 @@ .removeListener(this.boundOnSpellcheckDictionariesChanged_); this.boundOnSpellcheckDictionariesChanged_ = null; } + + if (this.languagePackPollIntervalId !== undefined) { + clearInterval(this.languagePackPollIntervalId); + } } /** @@ -650,6 +665,7 @@ enabled: this.getEnabledInputMethods_(), // Safety: `ModelArgs.currentInputMethodId` is always defined on CrOS. currentId: args.currentInputMethodId!, + imeLanguagePackStatus: {}, }; // Initialize the Polymer languages model. @@ -1295,6 +1311,33 @@ } return inputMethod.displayName; } + + private pollLanguagePacks_(): void { + if (!this.languages) { + return; + } + // Safety: `LanguagesModel.inputMethods` is always defined on CrOS. + for (const inputMethod of this.languages.inputMethods!.enabled) { + void this.inputMethodPrivate_.getLanguagePackStatus(inputMethod.id) + .then((status) => { + this.set( + [ + 'languages', + 'inputMethods', + 'imeLanguagePackStatus', + inputMethod.id, + ], + status); + }); + } + } + + getImeLanguagePackStatus(id: string): + chrome.inputMethodPrivate.LanguagePackStatus { + // Safety: `LanguagesModel.inputMethods` is always defined on CrOS. + return this.languages?.inputMethods!.imeLanguagePackStatus[id] ?? + chrome.inputMethodPrivate.LanguagePackStatus.UNKNOWN; + } } customElements.define(SettingsLanguagesElement.is, SettingsLanguagesElement);
diff --git a/chrome/browser/resources/ash/settings/os_languages_page/languages_types.ts b/chrome/browser/resources/ash/settings/os_languages_page/languages_types.ts index 2eecaae9..7de2df8 100644 --- a/chrome/browser/resources/ash/settings/os_languages_page/languages_types.ts +++ b/chrome/browser/resources/ash/settings/os_languages_page/languages_types.ts
@@ -44,6 +44,14 @@ supported: chrome.languageSettingsPrivate.InputMethod[]; enabled: chrome.languageSettingsPrivate.InputMethod[]; currentId: string; + /** + * Mapping from input method ID to language packs status. + */ + // TODO: b/298884063 - Move this to + // `chrome.languageSettingsPrivate.InputMethod` if there is a synchronous + // "cache" of language pack statuses. + imeLanguagePackStatus: + Partial<Record<string, chrome.inputMethodPrivate.LanguagePackStatus>>; } /** @@ -225,4 +233,7 @@ * @param id Input method ID. */ getInputMethodDisplayName(id: string): string; + + getImeLanguagePackStatus(id: string): + chrome.inputMethodPrivate.LanguagePackStatus; }
diff --git a/chrome/browser/resources/chromeos/web_app_install/BUILD.gn b/chrome/browser/resources/chromeos/web_app_install/BUILD.gn index 200cb3c..e9504633 100644 --- a/chrome/browser/resources/chromeos/web_app_install/BUILD.gn +++ b/chrome/browser/resources/chromeos/web_app_install/BUILD.gn
@@ -12,6 +12,7 @@ html_to_wrapper_template = "native" + ts_definitions = [ "//tools/typescript/definitions/chrome_send.d.ts" ] ts_deps = [ "//ui/webui/resources/cr_elements:build_ts", "//ui/webui/resources/js:build_ts",
diff --git a/chrome/browser/resources/chromeos/web_app_install/web_app_install_dialog.html b/chrome/browser/resources/chromeos/web_app_install/web_app_install_dialog.html index b0801c9d..3aa98c4 100644 --- a/chrome/browser/resources/chromeos/web_app_install/web_app_install_dialog.html +++ b/chrome/browser/resources/chromeos/web_app_install/web_app_install_dialog.html
@@ -1,9 +1,53 @@ +<style> + div[slot=button-container] { + display: flex; + justify-content: flex-end; + padding-block-end: 24px; + padding-block-start: 32px; + padding-inline: 24px; + } + + .install-button::before { + -webkit-mask-position: center; + background-color: currentColor; + content: ' '; + display: inline-block; + height: 20px; + margin-inline-end: 8px; + width: 20px; + } + + .install::before { + /* TODO(crbug.com/1488697): Use the download icon instead of the plus. */ + -webkit-mask-image: url(chrome://resources/images/add.svg); + -webkit-mask-size: 100%; + } + + .installing::before { + -webkit-mask-image: url(chrome://resources/images/throbber_medium.svg); + -webkit-mask-size: 100%; + } + + .installed::before { + -webkit-mask-image: url(chrome://resources/images/open_in_new.svg); + -webkit-mask-size: 100%; + } +</style> + <cr-dialog id="dialog"> + <!-- TODO(crbug.com/1488697): Localisation of strings. --> <div slot="title">Install app</div> <div slot="body"> + <!-- TODO(crbug.com/1488697): Add app details (name, icon, url, description, + screenshots). --> Body </div> - <!-- TODO(crbug.com/1488697): Add app details (name, icon, url, description, - screenshots). --> - <!-- TODO(crbug.com/1488697): Add install and cancel buttons. --> + <div slot="button-container"> + <cr-button class="cancel-button"> + $i18n{cancel} + </cr-button> + <cr-button class="install-button action-button install"> + $i18n{install} + </cr-button> + </div> </cr-dialog> \ No newline at end of file
diff --git a/chrome/browser/resources/chromeos/web_app_install/web_app_install_dialog.ts b/chrome/browser/resources/chromeos/web_app_install/web_app_install_dialog.ts index 26a3de2..095bade 100644 --- a/chrome/browser/resources/chromeos/web_app_install/web_app_install_dialog.ts +++ b/chrome/browser/resources/chromeos/web_app_install/web_app_install_dialog.ts
@@ -2,6 +2,13 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +import 'chrome://resources/cr_elements/cr_button/cr_button.js'; +import './strings.m.js'; + +import {CrButtonElement} from 'chrome://resources/cr_elements/cr_button/cr_button.js'; +import {assert, assertInstanceof} from 'chrome://resources/js/assert_ts.js'; +import {loadTimeData} from 'chrome://resources/js/load_time_data.js'; + import {getTemplate} from './web_app_install_dialog.html.js'; /** @@ -26,6 +33,44 @@ const fragment = template.content.cloneNode(true); this.attachShadow({mode: 'open'}).appendChild(fragment); } + + $<T extends Element>(query: string): T { + return this.shadowRoot!.querySelector(query)!; + } + + connectedCallback(): void { + const cancelButton = this.$<CrButtonElement>('.cancel-button'); + assert(cancelButton); + cancelButton.addEventListener('click', this.onCancelButtonClick.bind(this)); + + const installButton = this.$<CrButtonElement>('.install-button')!; + assert(installButton); + installButton.addEventListener( + 'click', this.onInstallButtonClick.bind(this)); + } + + private onCancelButtonClick(): void { + chrome.send('dialogClose'); + } + + private async onInstallButtonClick(event: MouseEvent) { + assertInstanceof(event.target, CrButtonElement); + const installButton: CrButtonElement = event.target; + + installButton.textContent = loadTimeData.getString('installing'); + installButton.classList.replace('install', 'installing'); + installButton.disabled = true; + + // Keep the installing state shown for at least 2 seconds to give the + // impression that the PWA is being installed. + // TODO(crbug.com/1488697): Call out to actually install the PWA. + await new Promise(resolve => setTimeout(resolve, 2000)); + + // TODO(crbug.com/1488697): Show an "Open app" button instead of + // "Installed". + installButton.textContent = 'Installed'; + installButton.classList.replace('installing', 'installed'); + } } customElements.define(
diff --git a/chrome/browser/resources/search_engine_choice/app.html b/chrome/browser/resources/search_engine_choice/app.html index c2640ba..7891900 100644 --- a/chrome/browser/resources/search_engine_choice/app.html +++ b/chrome/browser/resources/search_engine_choice/app.html
@@ -128,6 +128,7 @@ .choice-icon { --choice-icon-height: 24px; + background-size: var(--choice-icon-height); border-radius: calc(var(--choice-icon-height) / 2); height: var(--choice-icon-height); width: var(--choice-icon-height);
diff --git a/chrome/browser/resources/settings/privacy_page/cookies_page.html b/chrome/browser/resources/settings/privacy_page/cookies_page.html index 6b42dbca..a040c15 100644 --- a/chrome/browser/resources/settings/privacy_page/cookies_page.html +++ b/chrome/browser/resources/settings/privacy_page/cookies_page.html
@@ -29,6 +29,15 @@ padding-left: var(--cr-section-padding); } + #rollbackNotice { + padding: 16px var(--cr-section-padding); + background: var(--cr-hover-background-color); + } + + #picture { + display: flex; + } + .radio-group-sub-heading { padding-bottom: 10px; } @@ -82,7 +91,7 @@ min-height: var(--cr-section-two-line-min-height); } </style> - <picture hidden="[[is3pcdRedesignEnabled_]]"> + <picture id="picture" hidden="[[is3pcdRedesignEnabled_]]"> <source srcset="chrome://settings/images/cookies_banner_dark.svg" media="(prefers-color-scheme: dark)"> @@ -140,6 +149,10 @@ <template is="dom-if" if="[[isPrivacySandboxSettings4CookieSettingsEnabled_( isPrivacySandboxSettings4_, is3pcdRedesignEnabled_)]]"> + <div id="rollbackNotice" + hidden="[[!showTrackingProtectionRollbackNotice_]]"> + $i18nRaw{trackingProtectionRollbackNotice} + </div> <div id="explanationText" class="secondary"> $i18n{thirdPartyCookiesPageDescription} </div>
diff --git a/chrome/browser/resources/settings/privacy_page/cookies_page.ts b/chrome/browser/resources/settings/privacy_page/cookies_page.ts index 44d5aac27..8a66b44c 100644 --- a/chrome/browser/resources/settings/privacy_page/cookies_page.ts +++ b/chrome/browser/resources/settings/privacy_page/cookies_page.ts
@@ -140,6 +140,12 @@ value: () => loadTimeData.getBoolean('is3pcdCookieSettingsRedesignEnabled'), }, + + showTrackingProtectionRollbackNotice_: { + type: Boolean, + value: () => loadTimeData.getBoolean( + 'showTrackingProtectionSettingsRollbackNotice'), + }, }; }
diff --git a/chrome/browser/ui/BUILD.gn b/chrome/browser/ui/BUILD.gn index 84ece21..b7cb701c 100644 --- a/chrome/browser/ui/BUILD.gn +++ b/chrome/browser/ui/BUILD.gn
@@ -3814,6 +3814,7 @@ deps += [ "//chrome/app:generated_resources", "//chrome/browser/chromeos", + "//chrome/browser/chromeos/cros_apps", "//chrome/browser/metrics/structured:features", "//chrome/browser/ui/views/editor_menu", "//chromeos/components/kiosk", @@ -3850,7 +3851,6 @@ "webui/signin/profile_picker_lacros_sign_in_provider.h", ] deps += [ - "//chrome/browser/lacros/cros_apps", "//chrome/browser/policy:onc", "//chromeos/crosapi/mojom", "//chromeos/lacros",
diff --git a/chrome/browser/ui/ash/login_screen_client_impl.cc b/chrome/browser/ui/ash/login_screen_client_impl.cc index 4d4ba664..3543788 100644 --- a/chrome/browser/ui/ash/login_screen_client_impl.cc +++ b/chrome/browser/ui/ash/login_screen_client_impl.cc
@@ -7,6 +7,7 @@ #include <utility> #include "ash/public/cpp/child_accounts/parent_access_controller.h" +#include "ash/public/cpp/login/login_utils.h" #include "ash/public/cpp/login_screen.h" #include "ash/public/cpp/login_screen_model.h" #include "ash/webui/settings/public/constants/routes.mojom.h" @@ -24,7 +25,6 @@ #include "chrome/browser/ash/login/login_auth_recorder.h" #include "chrome/browser/ash/login/login_pref_names.h" #include "chrome/browser/ash/login/reauth_stats.h" -#include "chrome/browser/ash/login/screens/user_selection_screen.h" #include "chrome/browser/ash/login/startup_utils.h" #include "chrome/browser/ash/login/ui/login_display_host.h" #include "chrome/browser/ash/login/ui/login_display_host_webui.h" @@ -387,8 +387,7 @@ void LoginScreenClientImpl::OnUserImageChanged(const user_manager::User& user) { ash::LoginScreen::Get()->GetModel()->SetAvatarForUser( - user.GetAccountId(), - ash::UserSelectionScreen::BuildAshUserAvatarForUser(user)); + user.GetAccountId(), ash::BuildAshUserAvatarForUser(user)); } void LoginScreenClientImpl::OnParentAccessValidation(
diff --git a/chrome/browser/ui/color/new_tab_page_color_mixer.cc b/chrome/browser/ui/color/new_tab_page_color_mixer.cc index e9957a4..471edb1 100644 --- a/chrome/browser/ui/color/new_tab_page_color_mixer.cc +++ b/chrome/browser/ui/color/new_tab_page_color_mixer.cc
@@ -442,7 +442,7 @@ if (base::FeatureList::IsEnabled(ntp_features::kNtpModulesRedesigned)) { if (dark_mode) { - mixer[kColorNewTabPageModuleBackground] = {kColorNewTabPageBackground}; + mixer[kColorNewTabPageModuleBackground] = {gfx::kGoogleGrey800}; } else { mixer[kColorNewTabPageModuleBackground] = {gfx::kGoogleGrey100}; }
diff --git a/chrome/browser/ui/tab_helpers.cc b/chrome/browser/ui/tab_helpers.cc index ed316a8..e70ef86 100644 --- a/chrome/browser/ui/tab_helpers.cc +++ b/chrome/browser/ui/tab_helpers.cc
@@ -215,11 +215,11 @@ #endif #if BUILDFLAG(IS_CHROMEOS_LACROS) -#include "chrome/browser/lacros/cros_apps/cros_apps_tab_helper.h" #include "chrome/browser/lacros/web_contents_can_go_back_observer.h" #endif #if BUILDFLAG(IS_CHROMEOS) +#include "chrome/browser/chromeos/cros_apps/cros_apps_tab_helper.h" #include "chrome/browser/chromeos/policy/dlp/dlp_content_tab_helper.h" #endif @@ -634,10 +634,10 @@ #if BUILDFLAG(IS_CHROMEOS_LACROS) WebContentsCanGoBackObserver::CreateForWebContents(web_contents); - CrosAppsTabHelper::MaybeCreateForWebContents(web_contents); #endif #if BUILDFLAG(IS_CHROMEOS) + CrosAppsTabHelper::MaybeCreateForWebContents(web_contents); policy::DlpContentTabHelper::MaybeCreateForWebContents(web_contents); #endif
diff --git a/chrome/browser/ui/views/bookmarks/bookmark_bar_view_browsertest.cc b/chrome/browser/ui/views/bookmarks/bookmark_bar_view_browsertest.cc index 4e4736fb..87ffe2f4 100644 --- a/chrome/browser/ui/views/bookmarks/bookmark_bar_view_browsertest.cc +++ b/chrome/browser/ui/views/bookmarks/bookmark_bar_view_browsertest.cc
@@ -622,8 +622,8 @@ ukm_entry_builder_; }; -// TODO(https://crbug.com/1491974): Times out on Mac and Linux. -#if BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) +// TODO(https://crbug.com/1491974): Times out on Win, Mac and Linux. +#if BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_WIN) #define MAYBE_PrerenderActivation DISABLED_PrerenderActivation #else #define MAYBE_PrerenderActivation PrerenderActivation @@ -687,8 +687,8 @@ // This test verifies prerender cancellation triggered by mouseExited, and // another prerender can trigger normally after that. -// TODO(https://crbug.com/1491974): Times out on Mac and Linux. -#if BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) +// TODO(https://crbug.com/1491974): Times out on Win, Mac and Linux. +#if BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_WIN) #define MAYBE_PrerenderMouseExitedCancellationAndPrerenderActivation \ DISABLED_PrerenderMouseExitedCancellationAndPrerenderActivation #else
diff --git a/chrome/browser/ui/webui/ash/cloud_upload/cloud_upload_util.h b/chrome/browser/ui/webui/ash/cloud_upload/cloud_upload_util.h index 3654d30..6e52830 100644 --- a/chrome/browser/ui/webui/ash/cloud_upload/cloud_upload_util.h +++ b/chrome/browser/ui/webui/ash/cloud_upload/cloud_upload_util.h
@@ -57,10 +57,15 @@ kMaxValue = kMove, }; -// Either OneDrive for the Office PWA or Drive for Drive Web editing. +// List of UMA enum values for the cloud provider used when opening a file. The +// enum values must be kept in sync with CloudProvider in +// tools/metrics/histograms/enums.xml. enum class CloudProvider { - kGoogleDrive, - kOneDrive, + kNone = 0, + kUnknown = 1, + kGoogleDrive = 2, + kOneDrive = 3, + kMaxValue = kOneDrive, }; // These values are persisted to logs. Entries should not be renumbered and @@ -208,6 +213,9 @@ constexpr char kOneDriveOpenSourceVolumeMetric[] = "FileBrowser.OfficeFiles.Open.SourceVolume.MicrosoftOneDrive"; +constexpr char kOpenCloudProviderMetric[] = + "FileBrowser.OfficeFiles.Open.CloudProvider"; + constexpr char kDriveTransferRequiredMetric[] = "FileBrowser.OfficeFiles.Open.TransferRequired.GoogleDrive"; constexpr char kOneDriveTransferRequiredMetric[] =
diff --git a/chrome/browser/ui/webui/ash/settings/pages/apps/apps_section.cc b/chrome/browser/ui/webui/ash/settings/pages/apps/apps_section.cc index 1d08d65..465ab57 100644 --- a/chrome/browser/ui/webui/ash/settings/pages/apps/apps_section.cc +++ b/chrome/browser/ui/webui/ash/settings/pages/apps/apps_section.cc
@@ -29,6 +29,7 @@ #include "chrome/grit/os_settings_resources.h" #include "components/prefs/pref_service.h" #include "components/strings/grit/components_strings.h" +#include "content/public/browser/isolated_web_apps_policy.h" #include "content/public/browser/web_ui_data_source.h" #include "content/public/common/content_features.h" #include "ui/base/l10n/l10n_util.h" @@ -508,7 +509,7 @@ // check. html_source->AddBoolean( "showManageIsolatedWebAppsRow", - base::FeatureList::IsEnabled(::features::kIsolatedWebApps)); + content::IsolatedWebAppsPolicy::AreIsolatedWebAppsEnabled(profile())); html_source->AddString( "isolatedWebAppsDescription", l10n_util::GetStringFUTF16(
diff --git a/chrome/browser/ui/webui/ash/web_app_install/web_app_install_ui.cc b/chrome/browser/ui/webui/ash/web_app_install/web_app_install_ui.cc index 0d3ee2af..c39ee7ab 100644 --- a/chrome/browser/ui/webui/ash/web_app_install/web_app_install_ui.cc +++ b/chrome/browser/ui/webui/ash/web_app_install/web_app_install_ui.cc
@@ -8,9 +8,11 @@ #include "chrome/browser/profiles/profile.h" #include "chrome/browser/ui/webui/webui_util.h" #include "chrome/common/webui_url_constants.h" +#include "chrome/grit/generated_resources.h" #include "chrome/grit/web_app_install_resources.h" #include "chrome/grit/web_app_install_resources_map.h" #include "chromeos/constants/chromeos_features.h" +#include "components/strings/grit/components_strings.h" #include "content/public/browser/web_ui.h" #include "content/public/browser/web_ui_data_source.h" #include "content/public/common/url_constants.h" @@ -21,6 +23,14 @@ : ui::WebDialogUI(web_ui) { content::WebUIDataSource* source = content::WebUIDataSource::CreateAndAdd( Profile::FromWebUI(web_ui), chrome::kChromeUIWebAppInstallDialogHost); + + static constexpr webui::LocalizedString kStrings[] = { + {"cancel", IDS_CANCEL}, + {"install", IDS_INSTALL}, + {"installing", IDS_OFFICE_INSTALL_PWA_INSTALLING_BUTTON}, + }; + + source->AddLocalizedStrings(kStrings); webui::SetupWebUIDataSource( source, base::make_span(kWebAppInstallResources, kWebAppInstallResourcesSize),
diff --git a/chrome/browser/ui/webui/settings/settings_localized_strings_provider.cc b/chrome/browser/ui/webui/settings/settings_localized_strings_provider.cc index fc224ce..cedc23dc 100644 --- a/chrome/browser/ui/webui/settings/settings_localized_strings_provider.cc +++ b/chrome/browser/ui/webui/settings/settings_localized_strings_provider.cc
@@ -3285,6 +3285,13 @@ base::ASCIIToUTF16(chrome::kUserBypassHelpCenterURL), l10n_util::GetStringUTF16( IDS_SETTINGS_TRACKING_PROTECTION_BULLET_TWO_LEARN_MORE_ARIA_LABEL))); + html_source->AddString( + "trackingProtectionRollbackNotice", + l10n_util::GetStringFUTF16( + IDS_SETTINGS_TRACKING_PROTECTION_ROLLBACK_NOTICE, + base::ASCIIToUTF16(chrome::kTrackingProtectionHelpCenterURL), + l10n_util::GetStringUTF16( + IDS_SETTINGS_TRACKING_PROTECTION_ROLLBACK_NOTICE_LEARN_MORE_ARIA_LABEL))); html_source->AddString("trackingProtectionThirdPartyCookiesLearnMoreUrl", chrome::kManage3pcHelpCenterURL);
diff --git a/chrome/browser/ui/webui/settings/settings_ui.cc b/chrome/browser/ui/webui/settings/settings_ui.cc index 3e775d4..b780289 100644 --- a/chrome/browser/ui/webui/settings/settings_ui.cc +++ b/chrome/browser/ui/webui/settings/settings_ui.cc
@@ -24,6 +24,7 @@ #include "chrome/browser/preloading/preloading_features.h" #include "chrome/browser/privacy_sandbox/privacy_sandbox_service.h" #include "chrome/browser/privacy_sandbox/privacy_sandbox_service_factory.h" +#include "chrome/browser/privacy_sandbox/tracking_protection_onboarding_factory.h" #include "chrome/browser/privacy_sandbox/tracking_protection_settings_factory.h" #include "chrome/browser/profiles/profile.h" #include "chrome/browser/signin/identity_manager_factory.h" @@ -488,6 +489,13 @@ "is3pcdCookieSettingsRedesignEnabled", TrackingProtectionSettingsFactory::GetForProfile(profile) ->IsTrackingProtection3pcdEnabled()); + auto* onboarding_service = + TrackingProtectionOnboardingFactory::GetForProfile(profile); + html_source->AddBoolean( + "showTrackingProtectionSettingsRollbackNotice", + onboarding_service && onboarding_service->IsOffboarded() && + base::FeatureList::IsEnabled( + privacy_sandbox::kTrackingProtectionSettingsPageRollbackNotice)); // Performance AddSettingsPageUIHandler(std::make_unique<PerformanceHandler>());
diff --git a/chrome/build/android-arm32.pgo.txt b/chrome/build/android-arm32.pgo.txt index d8622e2..25e837f 100644 --- a/chrome/build/android-arm32.pgo.txt +++ b/chrome/build/android-arm32.pgo.txt
@@ -1 +1 @@ -chrome-android32-main-1697068730-2018534c02e9ce6d1b8aa369ad5d91527c28e56c.profdata +chrome-android32-main-1697090218-727bf98db6ff3ed333d77115220adce5308396d9.profdata
diff --git a/chrome/build/android-arm64.pgo.txt b/chrome/build/android-arm64.pgo.txt index bbd863b..e0c9dd8f 100644 --- a/chrome/build/android-arm64.pgo.txt +++ b/chrome/build/android-arm64.pgo.txt
@@ -1 +1 @@ -chrome-android64-main-1697068730-75962f323588750d421e0caccbb31c39e497bd97.profdata +chrome-android64-main-1697090218-993b9577cb179d6ba79700f32664e2a300a5996c.profdata
diff --git a/chrome/build/linux.pgo.txt b/chrome/build/linux.pgo.txt index de58f1f..9ad7dca 100644 --- a/chrome/build/linux.pgo.txt +++ b/chrome/build/linux.pgo.txt
@@ -1 +1 @@ -chrome-linux-main-1697068730-aaf6d8c0348124f5d4c50e1988e2c47742dcb228.profdata +chrome-linux-main-1697090218-8f6504571e30efb59e70e3507e40428e536cf73a.profdata
diff --git a/chrome/build/mac-arm.pgo.txt b/chrome/build/mac-arm.pgo.txt index 87622f9..5d5b6c8c 100644 --- a/chrome/build/mac-arm.pgo.txt +++ b/chrome/build/mac-arm.pgo.txt
@@ -1 +1 @@ -chrome-mac-arm-main-1697075853-18ff2c93b1472d8e2de5d9c3bf6bb0424d1ec373.profdata +chrome-mac-arm-main-1697104656-654da61736ecb0e7c442d0ae7fbdfb803d177aca.profdata
diff --git a/chrome/build/mac.pgo.txt b/chrome/build/mac.pgo.txt index 3fd4f753..68872aa3 100644 --- a/chrome/build/mac.pgo.txt +++ b/chrome/build/mac.pgo.txt
@@ -1 +1 @@ -chrome-mac-main-1697068730-df3a524c3628a372f449a023648b23a21749cef0.profdata +chrome-mac-main-1697090218-a67c294c8ed1411a00bea8e07a6f976de44a9f94.profdata
diff --git a/chrome/build/win32.pgo.txt b/chrome/build/win32.pgo.txt index 8e7fd88..b72cef3 100644 --- a/chrome/build/win32.pgo.txt +++ b/chrome/build/win32.pgo.txt
@@ -1 +1 @@ -chrome-win32-main-1697057997-e0fd6c6220c77c13312ee264ef124d743f1cd869.profdata +chrome-win32-main-1697090218-000304eae742e686840a3130a618a3b0ff87b900.profdata
diff --git a/chrome/build/win64.pgo.txt b/chrome/build/win64.pgo.txt index 31d1360..15e92a8 100644 --- a/chrome/build/win64.pgo.txt +++ b/chrome/build/win64.pgo.txt
@@ -1 +1 @@ -chrome-win64-main-1697057997-950bea2c0afa537266bbe4feb10c07c559b4beb8.profdata +chrome-win64-main-1697090218-064501ca12bc033153d22aee1cfee8611ca87f0e.profdata
diff --git a/chrome/installer/mini_installer/chrome.release b/chrome/installer/mini_installer/chrome.release index 1bbc88f..948fc15 100644 --- a/chrome/installer/mini_installer/chrome.release +++ b/chrome/installer/mini_installer/chrome.release
@@ -30,9 +30,6 @@ libEGL.dll: %(VersionDir)s\ libGLESv2.dll: %(VersionDir)s\ mojo_core.dll: %(VersionDir)s\ -nacl64.exe: %(VersionDir)s\ -nacl_irt_x86_32.nexe: %(VersionDir)s\ -nacl_irt_x86_64.nexe: %(VersionDir)s\ notification_helper.exe: %(VersionDir)s\ optimization_guide_internal.dll: %(VersionDir)s\ resources.pak: %(VersionDir)s\
diff --git a/chrome/test/BUILD.gn b/chrome/test/BUILD.gn index 6a753da..139f3ffd 100644 --- a/chrome/test/BUILD.gn +++ b/chrome/test/BUILD.gn
@@ -2959,6 +2959,7 @@ deps += [ "//chrome/browser/chromeos", "//chrome/browser/chromeos:test_support", + "//chrome/browser/chromeos/cros_apps:all_browser_tests", "//chrome/browser/web_applications/app_service", "//chromeos/constants", "//chromeos/dbus/dlp:dlp",
diff --git a/chrome/test/data/webui/settings/chromeos/device_page/device_page_revamp_test.ts b/chrome/test/data/webui/settings/chromeos/device_page/device_page_revamp_test.ts index 3253d9f..788f2ab 100644 --- a/chrome/test/data/webui/settings/chromeos/device_page/device_page_revamp_test.ts +++ b/chrome/test/data/webui/settings/chromeos/device_page/device_page_revamp_test.ts
@@ -35,7 +35,12 @@ enabled: [], translateTarget: 'test', prospectiveUILanguage: undefined, - inputMethods: {supported: [], enabled: [], currentId: 'fakeID'}, + inputMethods: { + supported: [], + enabled: [], + currentId: 'fakeID', + imeLanguagePackStatus: {}, + }, alwaysTranslate: [], neverTranslate: [], spellCheckOnLanguages: [],
diff --git a/chrome/test/data/webui/settings/chromeos/fake_input_method_private.js b/chrome/test/data/webui/settings/chromeos/fake_input_method_private.js index 3301c71..31612ab 100644 --- a/chrome/test/data/webui/settings/chromeos/fake_input_method_private.js +++ b/chrome/test/data/webui/settings/chromeos/fake_input_method_private.js
@@ -19,6 +19,9 @@ setCurrentInputMethod: () => Promise.resolve(), + getLanguagePackStatus: () => + Promise.resolve(chrome.inputMethodPrivate.LanguagePackStatus.UNKNOWN), + get onChanged() { return { addListener: function() {
diff --git a/chrome/test/data/webui/settings/chromeos/os_languages_page/fake_language_helper.ts b/chrome/test/data/webui/settings/chromeos/os_languages_page/fake_language_helper.ts index 363cf23c..cbcbe14 100644 --- a/chrome/test/data/webui/settings/chromeos/os_languages_page/fake_language_helper.ts +++ b/chrome/test/data/webui/settings/chromeos/os_languages_page/fake_language_helper.ts
@@ -95,4 +95,7 @@ getCurrentInputMethod(): Promise<string> { return Promise.resolve(FIRST_PARTY_INPUT_METHOD_ID_PREFIX + 'xkb:us::eng'); } + getImeLanguagePackStatus(): chrome.inputMethodPrivate.LanguagePackStatus { + return chrome.inputMethodPrivate.LanguagePackStatus.UNKNOWN; + } }
diff --git a/chrome/test/data/webui/settings/cookies_page_test.ts b/chrome/test/data/webui/settings/cookies_page_test.ts index b9219babe6..1ff74b9 100644 --- a/chrome/test/data/webui/settings/cookies_page_test.ts +++ b/chrome/test/data/webui/settings/cookies_page_test.ts
@@ -74,6 +74,7 @@ assertFalse(isChildVisible(page, '#blockExceptionsList')); assertFalse(isChildVisible(page, '#clearOnExit')); + assertFalse(isChildVisible(page, '#rollbackNotice')); assertTrue(isChildVisible(page, '#doNotTrack')); // TODO(b/296212999): Remove after b/296212999 is launched. @@ -861,3 +862,28 @@ true); }); }); + +suite('TrackingProtectionSettingsRollbackNotice', function() { + let page: SettingsCookiesPageElement; + let settingsPrefs: SettingsPrefsElement; + + suiteSetup(function() { + loadTimeData.overrideValues({ + showTrackingProtectionSettingsRollbackNotice: true, + }); + settingsPrefs = document.createElement('settings-prefs'); + return CrSettingsPrefs.initialized; + }); + + setup(function() { + document.body.innerHTML = window.trustedTypes!.emptyHTML; + page = document.createElement('settings-cookies-page'); + page.prefs = settingsPrefs.prefs!; + document.body.appendChild(page); + flush(); + }); + + test('RollbackNoticeDisplayed', function() { + assertTrue(isChildVisible(page, '#rollbackNotice')); + }); +});
diff --git a/chrome/test/data/webui/settings/settings_browsertest.cc b/chrome/test/data/webui/settings/settings_browsertest.cc index d68ac94..be18e86 100644 --- a/chrome/test/data/webui/settings/settings_browsertest.cc +++ b/chrome/test/data/webui/settings/settings_browsertest.cc
@@ -587,6 +587,12 @@ "runMochaSuite('TrackingProtectionSettings')"); } +IN_PROC_BROWSER_TEST_F(SettingsCookiesPageTest, + TrackingProtectionSettingsRollbackNotice) { + RunTest("settings/cookies_page_test.js", + "runMochaSuite('TrackingProtectionSettingsRollbackNotice')"); +} + #if !BUILDFLAG(IS_CHROMEOS_ASH) using SettingsLanguagePageTest = SettingsBrowserTest;
diff --git a/chrome/test/interaction/webcontents_interaction_test_util_browsertest.cc b/chrome/test/interaction/webcontents_interaction_test_util_browsertest.cc index 7b24fd26..4c8d33e 100644 --- a/chrome/test/interaction/webcontents_interaction_test_util_browsertest.cc +++ b/chrome/test/interaction/webcontents_interaction_test_util_browsertest.cc
@@ -901,8 +901,17 @@ EXPECT_CALL_IN_SCOPE(completed, Run, sequence->RunSynchronouslyForTesting()); } +// TODO(crbug.com/1492005): Resolve flakiness on ChromeOS and re-enable the +// test. +#if BUILDFLAG(IS_CHROMEOS) +#define MAYBE_StateChangeExistsTimeoutSendsEvent \ + DISABLED_StateChangeExistsTimeoutSendsEvent +#else +#define MAYBE_StateChangeExistsTimeoutSendsEvent \ + StateChangeExistsTimeoutSendsEvent +#endif IN_PROC_BROWSER_TEST_F(WebContentsInteractionTestUtilTest, - StateChangeExistsTimeoutSendsEvent) { + MAYBE_StateChangeExistsTimeoutSendsEvent) { UNCALLED_MOCK_CALLBACK(ui::InteractionSequence::CompletedCallback, completed); UNCALLED_MOCK_CALLBACK(ui::InteractionSequence::AbortedCallback, aborted);
diff --git a/chrome/tools/build/win/FILES.cfg b/chrome/tools/build/win/FILES.cfg index 5c86eb7b..57b30b9 100644 --- a/chrome/tools/build/win/FILES.cfg +++ b/chrome/tools/build/win/FILES.cfg
@@ -53,12 +53,6 @@ 'filegroup': ['default', 'symsrc'], }, { - 'filename': 'nacl64.exe', - 'arch': ['32bit'], - 'buildtype': ['official'], - 'filegroup': ['default', 'symsrc'], - }, - { 'filename': 'chrome.dll', 'buildtype': ['official'], 'filegroup': ['default', 'symsrc'], @@ -332,12 +326,6 @@ 'filename': 'resources.pak', 'buildtype': ['official'], }, - # PNaCl translator (archive only, component updater used for shipping). - { - 'filename': 'pnacl', - 'buildtype': ['official'], - 'archive': 'pnacl.zip', - }, # Widevine CDM files: { 'filename': 'WidevineCdm/manifest.json', @@ -417,16 +405,6 @@ 'filename': 'vk_swiftshader_icd.json', 'buildtype': ['official'], }, - # Native Client plugin files: - { - 'filename': 'nacl_irt_x86_32.nexe', - 'arch': ['32bit'], - 'buildtype': ['official'], - }, - { - 'filename': 'nacl_irt_x86_64.nexe', - 'buildtype': ['official'], - }, # Remoting files: { 'filename': 'chromoting.msi', @@ -704,12 +682,6 @@ 'archive': 'chrome-win32-syms.zip', }, { - 'filename': 'nacl64.exe.pdb', - 'arch': ['32bit'], - 'buildtype': ['official'], - 'archive': 'chrome-win32-syms.zip', - }, - { 'filename': 'setup.exe.pdb', 'buildtype': ['official'], 'archive': 'chrome-win32-syms.zip', @@ -743,17 +715,6 @@ 'buildtype': ['official'], 'archive': 'chrome-win32-syms.zip', }, - { - 'filename': 'nacl_irt_x86_32.nexe.debug', - 'arch': ['32bit'], - 'buildtype': ['official'], - 'archive': 'chrome-win32-nacl-irt-syms.zip', - }, - { - 'filename': 'nacl_irt_x86_64.nexe.debug', - 'buildtype': ['official'], - 'archive': 'chrome-win32-nacl-irt-syms.zip', - }, # Metrics metadata files: { 'filename': 'actions.xml',
diff --git a/clank b/clank index ca65bbdc..c227544 160000 --- a/clank +++ b/clank
@@ -1 +1 @@ -Subproject commit ca65bbdc942e24020527a15c1df39e5f86ff8d95 +Subproject commit c227544ad8d79001606dc7a120a52223c7aeddfd
diff --git a/components/nacl/features.gni b/components/nacl/features.gni index 3d19156..4e0b670 100644 --- a/components/nacl/features.gni +++ b/components/nacl/features.gni
@@ -23,11 +23,9 @@ declare_args() { # Enables Native Client support. # - # Intentionally and permanently disable nacl on arm64 mac. - enable_nacl = - checkout_nacl && _cpu_is_supported && target_os != "ios" && !is_android && - !is_fuchsia && !is_castos && !(is_win && host_os != "win") && - !(is_mac && (host_os != "mac" || target_cpu != "x64")) + # Intentionally and permanently disable nacl on Windows and Mac. + enable_nacl = checkout_nacl && _cpu_is_supported && target_os != "ios" && + !is_android && !is_fuchsia && !is_castos && !is_win && !is_mac } assert(!(is_win && host_os != "win") || !enable_nacl,
diff --git a/components/password_manager/core/browser/features/password_features.cc b/components/password_manager/core/browser/features/password_features.cc index 58c8347..b67d80e6 100644 --- a/components/password_manager/core/browser/features/password_features.cc +++ b/components/password_manager/core/browser/features/password_features.cc
@@ -62,13 +62,6 @@ base::FEATURE_DISABLED_BY_DEFAULT); #endif // !BUILDFLAG(IS_ANDROID) && !BUILDFLAG(IS_IOS) -#if BUILDFLAG(IS_IOS) -// Enables migration to OSCrypt with a single query to the keychain. -BASE_FEATURE(kOneReadLoginDatabaseMigration, - "OneReadLoginDatabaseMigration", - base::FEATURE_ENABLED_BY_DEFAULT); -#endif // BUILDFLAG(IS_IOS) - // Enables the notification UI that is displayed to the user when visiting a // website for which a stored password has been shared by another user. BASE_FEATURE(kSharedPasswordNotificationUI,
diff --git a/components/password_manager/core/browser/features/password_features.h b/components/password_manager/core/browser/features/password_features.h index c68ab0d..c95864b 100644 --- a/components/password_manager/core/browser/features/password_features.h +++ b/components/password_manager/core/browser/features/password_features.h
@@ -32,10 +32,6 @@ BASE_DECLARE_FEATURE(kNewConfirmationBubbleForGeneratedPasswords); #endif // !BUILDFLAG(IS_ANDROID) && !BUILDFLAG(IS_IOS) -#if BUILDFLAG(IS_IOS) -BASE_DECLARE_FEATURE(kOneReadLoginDatabaseMigration); -#endif - BASE_DECLARE_FEATURE(kSharedPasswordNotificationUI); BASE_DECLARE_FEATURE(kPasswordManagerEnableReceiverService);
diff --git a/components/password_manager/core/browser/login_database.cc b/components/password_manager/core/browser/login_database.cc index a0ccc8a..e7812fa 100644 --- a/components/password_manager/core/browser/login_database.cc +++ b/components/password_manager/core/browser/login_database.cc
@@ -797,60 +797,6 @@ return MigrationToOSCrypt::kSuccess; } -MigrationToOSCrypt MigrateToOSCryptWithSingleQuery( - IsAccountStore is_account_store, - sql::Database* db) { - // Obtain all passwords from the keychain. - std::unordered_map<std::string, std::u16string> key_password_pairs; - OSStatus retrieval_status = GetAllPasswordsFromKeychain(&key_password_pairs); - if (retrieval_status != errSecSuccess) { - LogKeychainError(is_account_store, retrieval_status); - return MigrationToOSCrypt::kFailedToDecryptFromKeychain; - } - - sql::Statement get_passwords_statement( - db->GetUniqueStatement("SELECT id, password_value FROM logins")); - - int deleted_passwords = 0, migrated_passwords = 0; - // Update each password_value with the new BLOB. - while (get_passwords_statement.Step()) { - int id = get_passwords_statement.ColumnInt(0); - std::string keychain_identifier = get_passwords_statement.ColumnString(1); - // If keychain_identifier is empty it means blocked or federated form. - // Simply skip this entry. - if (keychain_identifier.empty()) { - continue; - } - - auto password_iterator = key_password_pairs.find(keychain_identifier); - // Password no longer exists in the keychain, meaning it's lost forever. - // In this case delete the entry from the database and continue with - // migration. - if (password_iterator == key_password_pairs.end()) { - if (!DeletePassword(db, id)) { - return MigrationToOSCrypt::kFailedToDelete; - } - deleted_passwords++; - continue; - } - - // Encrypt password using OSCrypt. - std::string encrypted_password; - if (LoginDatabase::EncryptedString(password_iterator->second, - &encrypted_password) != - LoginDatabase::ENCRYPTION_RESULT_SUCCESS) { - return MigrationToOSCrypt::kFailedToEncrypt; - } - // Updated password_value in the database. - if (!UpdatePassword(db, id, encrypted_password)) { - return MigrationToOSCrypt::kFailedToUpdate; - } - migrated_passwords++; - } - LogMigratedDeletedStats(is_account_store, deleted_passwords, - migrated_passwords); - return MigrationToOSCrypt::kSuccess; -} #endif // Call this after having called InitializeBuilders(), to migrate the database @@ -981,13 +927,7 @@ return false; } - MigrationToOSCrypt status; - if (base::FeatureList::IsEnabled( - features::kOneReadLoginDatabaseMigration)) { - status = MigrateToOSCryptWithSingleQuery(is_account_store, db); - } else { - status = MigrateToOSCryptTheOldWay(is_account_store, db); - } + MigrationToOSCrypt status = MigrateToOSCryptTheOldWay(is_account_store, db); std::move(record_completion_metrics).Run(status); if (status != MigrationToOSCrypt::kSuccess) {
diff --git a/components/password_manager/core/browser/login_database_ios_unittest.cc b/components/password_manager/core/browser/login_database_ios_unittest.cc index f8b6a60..014ac0d 100644 --- a/components/password_manager/core/browser/login_database_ios_unittest.cc +++ b/components/password_manager/core/browser/login_database_ios_unittest.cc
@@ -310,22 +310,11 @@ BucketsInclude(Bucket(errSecSuccess, 2), Bucket(errSecItemNotFound, 1))); } -class LoginDatabaseMigrationToOSCryptTest - : public LoginDatabaseIOSTest, - public testing::WithParamInterface<bool> { +class LoginDatabaseMigrationToOSCryptTest : public LoginDatabaseIOSTest { public: void SetUp() override { ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); database_path_ = temp_dir_.GetPath().AppendASCII("test.db"); - if (GetParam()) { - feature_list_.InitWithFeatures( - /*enabled_features=*/{features::kOneReadLoginDatabaseMigration}, - /*disabled_features=*/{}); - } else { - feature_list_.InitWithFeatures( - /*enabled_features=*/{}, - /*disabled_features=*/{features::kOneReadLoginDatabaseMigration}); - } } // Creates the database from |sql_file|. @@ -413,14 +402,13 @@ base::FilePath get_database_path() { return database_path_; } private: - base::test::ScopedFeatureList feature_list_; base::ScopedTempDir temp_dir_; base::FilePath database_path_; }; // Tests the migration of the login database from version() to // kCurrentVersionNumber. -TEST_P(LoginDatabaseMigrationToOSCryptTest, +TEST_F(LoginDatabaseMigrationToOSCryptTest, MigrationFromVersion38ProfileStore) { // Keychain identifier used in the test file. const std::string password_keychain_identifier = @@ -471,7 +459,7 @@ DeleteEncryptedPasswordFromKeychain(note_keychain_identifier); } -TEST_P(LoginDatabaseMigrationToOSCryptTest, +TEST_F(LoginDatabaseMigrationToOSCryptTest, MigrationFromVersion38SuccessMetricsAccountStore) { CreateDatabase("login_db_v38_with_keychain_id.sql"); @@ -516,12 +504,8 @@ DeleteEncryptedPasswordFromKeychain(note_keychain_identifier); } -TEST_P(LoginDatabaseMigrationToOSCryptTest, +TEST_F(LoginDatabaseMigrationToOSCryptTest, MigrationFromVersion38FailureMetricsProfileStore) { - // Error can't be easily simulated when reading all keychain at once. - if (GetParam()) { - return; - } base::HistogramTester histogram_tester; CreateDatabase("login_db_v38_with_keychain_id.sql"); @@ -554,12 +538,8 @@ "PasswordManager.MigrationToOSCrypt.ProfileStore.ErrorLatency", 1); } -TEST_P(LoginDatabaseMigrationToOSCryptTest, +TEST_F(LoginDatabaseMigrationToOSCryptTest, MigrationFromVersion38FailureMetricsAccountStore) { - // Error can't be easily simulated when reading all keychain at once. - if (GetParam()) { - return; - } base::HistogramTester histogram_tester; CreateDatabase("login_db_v38_with_keychain_id.sql"); @@ -592,12 +572,8 @@ "PasswordManager.MigrationToOSCrypt.AccountStore.ErrorLatency", 1); } -TEST_P(LoginDatabaseMigrationToOSCryptTest, +TEST_F(LoginDatabaseMigrationToOSCryptTest, MigrationFromVersion38WithMissingKeychainItems) { - // Error can't be easily simulated when reading all keychain at once. - if (GetParam()) { - return; - } CreateDatabase("login_db_v38_with_keychain_ids.sql"); // Even though testing file contains two passwords add only one item to the @@ -632,7 +608,7 @@ DeleteEncryptedPasswordFromKeychain(password_keychain_identifier); } -TEST_P(LoginDatabaseMigrationToOSCryptTest, +TEST_F(LoginDatabaseMigrationToOSCryptTest, MigrationFromVersion39ProfileStore) { // Keychain identifier used in the test file. const std::string note_keychain_identifier = @@ -680,7 +656,7 @@ } } -TEST_P(LoginDatabaseMigrationToOSCryptTest, +TEST_F(LoginDatabaseMigrationToOSCryptTest, MigrationFromVersion39AccountStore) { // The values set in the .sql file are already used by the previous test. // Since tests can run in parallel, the IDs nee to be different to avoid @@ -732,7 +708,7 @@ } } -TEST_P(LoginDatabaseMigrationToOSCryptTest, +TEST_F(LoginDatabaseMigrationToOSCryptTest, MigrationFromVersion39FailureMetricsProfileStore) { base::HistogramTester histogram_tester; @@ -765,7 +741,7 @@ static_cast<int>(errSecItemNotFound), 1); } -TEST_P(LoginDatabaseMigrationToOSCryptTest, +TEST_F(LoginDatabaseMigrationToOSCryptTest, MigrationFromVersion39FailureMetricsAccountStore) { base::HistogramTester histogram_tester; @@ -798,8 +774,4 @@ static_cast<int>(errSecItemNotFound), 1); } -INSTANTIATE_TEST_SUITE_P(, // Empty instantiation name. - LoginDatabaseMigrationToOSCryptTest, - testing::Bool()); - } // namespace password_manager
diff --git a/components/password_manager/core/browser/password_form_manager.cc b/components/password_manager/core/browser/password_form_manager.cc index 0f4c22e4..fd26f894 100644 --- a/components/password_manager/core/browser/password_form_manager.cc +++ b/components/password_manager/core/browser/password_form_manager.cc
@@ -10,6 +10,7 @@ #include <tuple> #include <utility> +#include "base/check.h" #include "base/containers/lru_cache.h" #include "base/feature_list.h" #include "base/memory/ptr_util.h" @@ -28,6 +29,7 @@ #include "components/password_manager/core/browser/browser_save_password_progress_logger.h" #include "components/password_manager/core/browser/field_info_manager.h" #include "components/password_manager/core/browser/form_fetcher_impl.h" +#include "components/password_manager/core/browser/form_parsing/form_data_parser.h" #include "components/password_manager/core/browser/password_change_success_tracker_impl.h" #include "components/password_manager/core/browser/password_feature_manager.h" #include "components/password_manager/core/browser/password_form.h" @@ -178,52 +180,36 @@ PasswordFormHadMatchingUsername(false)}; } -// Finds best username candidate that is outside of the form. Priority is given -// to the most recently updated fields. Right now, this function checks if there -// is an override among possible usernames. Otherwise, returns the most recently -// modified field not in password form. -// TODO: crbug.com/1470586 - Add search for the most recent field with -// `SINGLE_USERNAME` prediction. Add search for candidate that has the same -// value as username inside the form. Search for candidate with HTML attribute -// autocomplete="username". Skip OTP fields. +// Finds best username candidate that is outside of the form. This is done +// according to priorities listed in `UsernameFoundOutsideOfFormType`. +// If there are more than one field in the same category, pick the one that is +// more recently modified by the user. UsernameFoundOutsideOfForm FindBestPossibleUsernameCandidate( const base::LRUCache<PossibleUsernameFieldIdentifier, PossibleUsernameData>& possible_usernames, const PasswordForm& form) { - // Check priority of the most recent element modified by user. - auto [priority, password_form_had_matching_username] = - GivePriorityToUsernameFoundOutsideOfForm( - possible_usernames.begin()->second, form); - UsernameFoundOutsideOfForm result = {priority, - password_form_had_matching_username, - possible_usernames.begin()->second}; - - // Search for better candidate among less recently modified fields. + std::optional<UsernameFoundOutsideOfForm> result = std::nullopt; + // Search for a candidate among all recently user modified fields. // If `kUsernameFirstFlowWithIntermediateValues` feature is off, the last // user-typed is always picked. // If `kUsernameFirstFlowWithIntermediateValues` feature is on, look for // other field in cache that has a higher priority. - // TODO(crbug.com/1470586): Reuse - // `GivePriorityToUsernameFoundOutsideOfForm()`. for (auto [field_identifier, candidate_username] : possible_usernames) { - // The override has higher priority than server prediction. If password form - // has server prediction, only override found outside of the password form - // can be used instead of it. // Reassign the best candidate if new candidate has higher priority. // Priorities are numbered so that the lowest has priority 0. - if (candidate_username.HasSingleUsernameOverride() && - result.priority < - UsernameFoundOutsideOfFormType::kSingleUsernameOverride && - base::FeatureList::IsEnabled( - password_manager::features:: - kUsernameFirstFlowWithIntermediateValues)) { - result = {UsernameFoundOutsideOfFormType::kSingleUsernameOverride, - FormMatchesUsername(form, candidate_username.value), + auto [priority, password_form_had_matching_username] = + GivePriorityToUsernameFoundOutsideOfForm(candidate_username, form); + if (!result.has_value() || + (priority > result.value().priority && + (base::FeatureList::IsEnabled( + password_manager::features:: + kUsernameFirstFlowWithIntermediateValues)))) { + result = {priority, password_form_had_matching_username, candidate_username}; - return result; } } - return result; + CHECK(result.has_value()); + return result.value(); } void SetUsernameValueFromOutsideOfForm(const std::u16string& value, @@ -913,11 +899,18 @@ // username form. // 3) There is a username field outside of the password form that is a // server override. + // 4) Username field outside of the password form has a server prediction, + // while username in the password form was found using client-side + // heuristics. if (IsPasswordFormWithoutUsername( parsed_submitted_form_.get()) || // Case (1). possible_username.password_form_had_matching_username || // Case (2). possible_username.priority == // Case (3). - UsernameFoundOutsideOfFormType::kSingleUsernameOverride) { + UsernameFoundOutsideOfFormType::kSingleUsernameOverride || + (possible_username.priority == // Case (4). + UsernameFoundOutsideOfFormType::kSingleUsernamePrediction && + username_detection_method != + FormDataParser::UsernameDetectionMethod::kServerSidePrediction)) { HandleUsernameFirstFlow(possible_username); } } @@ -1312,10 +1305,11 @@ void PasswordFormManager::HandleUsernameFirstFlow( const UsernameFoundOutsideOfForm& possible_username) { if (IsPossibleSingleUsernameAvailable(possible_username.data)) { - // Suggest the possible username value in a prompt in two cases: - // (1) If the server confirmed it is a single username field (either server - // prediction or server override). - // (2) If the field has autocomplete = "username" attribute (used only if + // Suggest the possible username value in a prompt in three cases: + // (1) If single username field is a server override. + // (2) If the server prediction tells that it is a single username field and + // there is no `USERNAME` server prediction inside the password form. + // (3) If the field has autocomplete = "username" attribute (used only if // there are no server predictions, which lets us override the attribute). // Otherwise, |possible_username| is used only for voting. if (possible_username.priority ==
diff --git a/components/password_manager/core/browser/password_form_manager_unittest.cc b/components/password_manager/core/browser/password_form_manager_unittest.cc index 521b80e..7a2492af 100644 --- a/components/password_manager/core/browser/password_form_manager_unittest.cc +++ b/components/password_manager/core/browser/password_form_manager_unittest.cc
@@ -2791,6 +2791,97 @@ Mock::VerifyAndClearExpectations(&mock_autofill_download_manager_); } +// Tests that if prefilled username inside the password form has a matching +// value with a field found outside of the password form the vote will be sent +// correctly. In this test case, there is an intermediary field between them. +TEST_P(PasswordFormManagerTest, + UsernameFirstFlowWithIntermediaryFieldsAndPrefilledUsername) { + base::test::ScopedFeatureList feature_list; + feature_list.InitWithFeatures( + /*enabled_features=*/{features::kUsernameFirstFlowFallbackCrowdsourcing, + features::kUsernameFirstFlowWithIntermediateValues, + features::kUsernameFirstFlowStoreSeveralValues}, + /*disabled_features=*/{}); + + CreateFormManager(submitted_form_); + fetcher_->NotifyFetchCompleted(); + + // Create possible username data. + PossibleUsernameData possible_username_data( + saved_match_.signon_realm, kSingleUsernameFieldRendererId, + submitted_form_.fields[kUsernameFieldIndex].value, base::Time::Now(), + /*driver_id=*/0, + /*autocomplete_attribute_has_username=*/false, /*is_likely_otp=*/false); + + // Server has no predictions for the single username form. + // `possible_username_data.form_predictions` is required to be set correctly + // with field signature, form signature, and field renderer id to be able to + // send single username votes. + auto server_prediction = MakeSingleUsernamePredictions(); + server_prediction.fields[0].type = autofill::NO_SERVER_DATA; + possible_username_data.form_predictions = server_prediction; + + // Create more recent data. + const std::u16string possible_username_otp = u"not_username_value"; + PossibleUsernameData possible_username_data_otp( + saved_match_.signon_realm, autofill::FieldRendererId(103u), + possible_username_otp, base::Time::Now(), + /*driver_id=*/0, /*autocomplete_attribute_has_username=*/false, + /*is_likely_otp=*/false); + + base::LRUCache<PossibleUsernameFieldIdentifier, PossibleUsernameData> + possible_usernames = MakePossibleUsernamesCache( + {possible_username_data_otp, possible_username_data}); + + ASSERT_TRUE(form_manager_->ProvisionallySave(submitted_form_, &driver_, + &possible_usernames)); + + // Check that uploads for both single username and sign-up form happen. + testing::InSequence in_sequence; + + // Upload username first flow vote on the single username form. +#if !BUILDFLAG(IS_ANDROID) + EXPECT_CALL(mock_autofill_download_manager_, + StartUploadRequest(SignatureIs(kSingleUsernameFormSignature), + false, ServerFieldTypeSet{SINGLE_USERNAME}, _, + true, nullptr, /*observer=*/IsNull())); +#endif // !BUILDFLAG(IS_ANDROID) + + // Upload username first flow vote on the sign-up form. + autofill::AutofillUploadContents::SingleUsernameData + expected_single_username_data; + expected_single_username_data.set_username_form_signature( + kSingleUsernameFormSignature.value()); + expected_single_username_data.set_username_field_signature( + kSingleUsernameFieldSignature.value()); + expected_single_username_data.set_value_type( + autofill::AutofillUploadContents::VALUE_WITH_NO_WHITESPACE); + expected_single_username_data.set_prompt_edit( + autofill::AutofillUploadContents::NOT_EDITED_POSITIVE); + EXPECT_CALL( + mock_autofill_download_manager_, + StartUploadRequest( + AllOf(SignatureIs(CalculateFormSignature(submitted_form_)), + UploadedSingleUsernameDataIs({expected_single_username_data})), + _, _, _, _, _, /*observer=*/IsNull())); + + // Simulate showing the prompt and saving the suggested value. + form_manager_->SaveSuggestedUsernameValueToVotesUploader(); + + base::HistogramTester histogram_tester; + + form_manager_->Save(); + +#if !BUILDFLAG(IS_ANDROID) + histogram_tester.ExpectUniqueSample( + "PasswordManager.SingleUsername.PasswordFormHadUsernameField", 1, 1); +#else + histogram_tester.ExpectTotalCount( + "PasswordManager.SingleUsername.PasswordFormHadUsernameField", 0); +#endif + Mock::VerifyAndClearExpectations(&mock_autofill_download_manager_); +} + // Tests that a negative vote is sent when a single username candidate is // populated in a prompt, but then is removed by the user in the prompt. TEST_P(PasswordFormManagerTest, NegativeUsernameFirstFlowVotes) { @@ -2980,16 +3071,14 @@ } } -// Tests that the most recent possible username is used, even if there -// is a `SINGLE_USERNAME` server prediction for a less recent possible username -// in Username First Flow. -// TODO: crbug.com/1470586 - Update the test once server predictions are -// prioritized. -TEST_P(PasswordFormManagerTest, PossibleUsernamesPrioritizeMostRecent) { +// Tests that the possible username with server prediction is picked as a +// username in password save prompt, even if there is a field that was more +// recently typed by the user as a possible username in Username First Flow. +TEST_P(PasswordFormManagerTest, PossibleUsernamesPrioritizeServerPrediction) { const std::u16string possible_username_with_prediction = u"possible_username_with_prediction"; PossibleUsernameData possible_username_data_with_prediction( - saved_match_.signon_realm, autofill::FieldRendererId(102u), + saved_match_.signon_realm, kSingleUsernameFieldRendererId, possible_username_with_prediction, base::Time::Now(), /*driver_id=*/0, /*autocomplete_attribute_has_username=*/false, /*is_likely_otp=*/false); @@ -3009,16 +3098,17 @@ // The most recent username doesn't have a prediction, while the least recent // has. base::LRUCache<PossibleUsernameFieldIdentifier, PossibleUsernameData> - possible_usernames = MakePossibleUsernamesCache( - {possible_username_data_with_prediction, - possible_username_data_without_prediction}); + possible_usernames = + MakePossibleUsernamesCache({possible_username_data_without_prediction, + possible_username_data_with_prediction}); CreateFormManager(observed_form_only_password_fields_); fetcher_->NotifyFetchCompleted(); - ASSERT_TRUE(form_manager_->ProvisionallySave(submitted_form, &driver_, + EXPECT_TRUE(form_manager_->ProvisionallySave(submitted_form, &driver_, &possible_usernames)); - EXPECT_TRUE(form_manager_->GetPendingCredentials().username_value.empty()); + EXPECT_EQ(possible_username_with_prediction, + form_manager_->GetPendingCredentials().username_value); } // Tests that boolean representing autocomplete = "username" is taken into
diff --git a/components/password_manager/core/browser/password_manager_unittest.cc b/components/password_manager/core/browser/password_manager_unittest.cc index e08d0c038..610ca70 100644 --- a/components/password_manager/core/browser/password_manager_unittest.cc +++ b/components/password_manager/core/browser/password_manager_unittest.cc
@@ -657,6 +657,25 @@ return form; } + FormData MakeSearchBarFormData() { + FormData form_data; + form_data.name = u"search-bar-field"; + form_data.url = test_form_url_; + form_data.unique_renderer_id = FormRendererId(505); + + FormFieldData search_field; + search_field.name = u"search_bar"; + search_field.name_attribute = search_field.name; + search_field.id_attribute = search_field.name_attribute; + search_field.value = u"search_field_value"; + + search_field.form_control_type = autofill::FormControlType::kInputText; + search_field.unique_renderer_id = FieldRendererId(62); + form_data.fields.push_back(search_field); + + return form_data; + } + PasswordForm MakeSignUpFormWithoutUsername() { PasswordForm form; form.url = test_form_url_; @@ -3918,11 +3937,9 @@ } // Tests complex case of UFF on sign-up form that also has intermediary fields. -// This test asserts that turning on the flag that allows storing several -// possible usernames doesn't alter the current behavior of the username -// prediction. -// TODO: crbug.com/1470586 - Change this test after landing heuristics that -// check possible usernames both inside and outside of the password form. +// This test asserts that if there are server predictions for single username +// field and no username server prediction inside the password form, username is +// overwritten. TEST_F(PasswordManagerTest, UsernameFirstFlowSignUpFormWithIntermediaryFields) { feature_list_.InitWithFeatures( /*enabled_features=*/ @@ -3999,24 +4016,23 @@ form_manager->Save(); task_environment_.RunUntilIdle(); - // The value didn't change even though there are `SINGLE_USERNAME` - // predictions. - EXPECT_EQ(password_form.username_value, - password_form.form_data.fields[1].value); // Possible usernames are cleared after successful login. EXPECT_THAT(manager()->possible_usernames(), IsEmpty()); + + PasswordForm expected_form(password_form); + expected_form.username_value = single_username; + expected_form.username_element = u""; + expected_form.username_element_renderer_id = FieldRendererId(0); EXPECT_THAT( store_->stored_passwords(), ElementsAre(Pair(password_form.signon_realm, - UnorderedElementsAre(FormMatches(password_form))))); + UnorderedElementsAre(FormMatches(expected_form))))); } // Tests complex case of UFF on sign-in form that also has intermediary fields. -// This test asserts that turning on the flag that allows storing several -// possible usernames doesn't alter the current behavior of the username -// prediction. -// TODO: crbug.com/1470586 - Change this test after landing heuristics that -// check possible usernames outside of the password form. +// This test asserts that possible username with server prediction is +// prioritized, even if there is more recently user typed possible username +// candidate that is without server prediction. TEST_F(PasswordManagerTest, UsernameFirstFlowSignInFormWithIntermediaryFields) { feature_list_.InitWithFeatures( /*enabled_features=*/ @@ -4076,13 +4092,13 @@ task_environment_.RunUntilIdle(); // Possible usernames are cleared after successful login. EXPECT_THAT(manager()->possible_usernames(), IsEmpty()); - // The value didn't change even though there are `SINGLE_USERNAME` - // predictions. - EXPECT_EQ(password_form.username_value, u""); + + PasswordForm expected_form(password_form); + expected_form.username_value = single_username; EXPECT_THAT( store_->stored_passwords(), ElementsAre(Pair(password_form.signon_realm, - UnorderedElementsAre(FormMatches(password_form))))); + UnorderedElementsAre(FormMatches(expected_form))))); } // Checks that a server predicted single username outside of the form is @@ -4247,6 +4263,75 @@ UnorderedElementsAre(FormMatches(expected_form))))); } +// Tests complex case of UFF on sign-in form that also has intermediary fields. +// This test asserts that possible username with autocomplete="username" is +// prioritized, even if there is more recently user typed possible username +// candidate that is without server prediction. +TEST_F(PasswordManagerTest, + UsernameFirstFlowWithIntermediaryFieldsAndAutocomplete) { + feature_list_.InitWithFeatures( + /*enabled_features=*/ + {password_manager::features::kUsernameFirstFlowStoreSeveralValues, + password_manager::features::kUsernameFirstFlowWithIntermediateValues, + password_manager::features::kUsernameFirstFlowHonorAutocomplete}, + /*disabled_features_*/ {}); + // Simulate the user typed a previously not saved username in the username + // form. + PasswordForm username_form(MakeSimpleFormWithOnlyUsernameField()); + const std::u16string single_username = u"newusername@gmail.com"; + EXPECT_CALL(driver_, GetLastCommittedURL()) + .WillRepeatedly(ReturnRef(username_form.url)); + manager()->OnUserModifiedNonPasswordField( + &driver_, username_form.form_data.fields[0].unique_renderer_id, + /*value=*/single_username, + /*autocomplete_attribute_has_username=*/true, + /*is_likely_otp=*/false); + + // Form with text field and password field. + FormData search_bar(MakeSearchBarFormData()); + // User enters something to search bar. + manager()->OnUserModifiedNonPasswordField( + &driver_, search_bar.fields[0].unique_renderer_id, + /*value=*/search_bar.fields[0].value, + /*autocomplete_attribute_has_username=*/false, + /*is_likely_otp=*/false); + + // Simulate a password form which contains no username, but other text fields. + PasswordForm password_form(MakeSimpleFormWithOnlyPasswordField()); + manager()->OnPasswordFormsParsed(&driver_, {password_form.form_data}); + manager()->OnPasswordFormsRendered( + &driver_, /*visible_forms_data=*/{password_form.form_data}); + + EXPECT_CALL(client_, IsSavingAndFillingEnabled(password_form.url)) + .WillRepeatedly(Return(true)); + + // Simulate that the user typed a password and submitted the password form. + manager()->OnInformAboutUserInput(&driver_, password_form.form_data); + + // Simulate successful submission and expect a save prompt. + task_environment_.RunUntilIdle(); + OnPasswordFormSubmitted(password_form.form_data); + std::unique_ptr<PasswordFormManagerForUI> form_manager; + EXPECT_CALL(client_, PromptUserToSaveOrUpdatePassword) + .WillOnce(MoveArgAndReturn<0>(&form_manager, false)); + manager()->OnPasswordFormsRendered(&driver_, /*visible_forms_data=*/{}); + ASSERT_TRUE(form_manager); + + // Simulate accepting the prompt and expect saving the new credential. + form_manager->Save(); + task_environment_.RunUntilIdle(); + + // Possible usernames are cleared after successful login. + EXPECT_THAT(manager()->possible_usernames(), IsEmpty()); + + PasswordForm expected_form(password_form); + expected_form.username_value = single_username; + EXPECT_THAT( + store_->stored_passwords(), + ElementsAre(Pair(password_form.signon_realm, + UnorderedElementsAre(FormMatches(expected_form))))); +} + // Checks that possible single username value is not suggested in the save // prompt if SINGLE_USERNAME server prediction is not available. TEST_F(PasswordManagerTest, UsernameFirstFlowSavingWithoutServerPredictions) {
diff --git a/components/policy/resources/templates/policies.yaml b/components/policy/resources/templates/policies.yaml index 12ad7fd..a5f1e50c 100644 --- a/components/policy/resources/templates/policies.yaml +++ b/components/policy/resources/templates/policies.yaml
@@ -1167,6 +1167,7 @@ 1166: DeviceExtendedFkeysModifier 1167: UnaffiliatedDeviceArcAllowed 1168: RelatedWebsiteSetsOverrides + 1169: ShowHumanPresenceSensorScreenEnabled atomic_groups: 1: Homepage 2: RemoteAccess
diff --git a/components/policy/resources/templates/policy_definitions/Miscellaneous/ShowHumanPresenceSensorScreenEnabled.yaml b/components/policy/resources/templates/policy_definitions/Miscellaneous/ShowHumanPresenceSensorScreenEnabled.yaml new file mode 100644 index 0000000..dd67252e --- /dev/null +++ b/components/policy/resources/templates/policy_definitions/Miscellaneous/ShowHumanPresenceSensorScreenEnabled.yaml
@@ -0,0 +1,26 @@ +caption: Enable displaying human presence sensor screen during sign-in +desc: |- + This policy controls if the human presence sensor screen is shown to the user during the first sign-in. + If set to false, the human presence sensor screen will not be displayed. + If set to true, the human presence sensor screen will be displayed. + If the policy is left not set, the default value false applies for enterprise-managed users and true will be used for non-managed users. +default: true +default_for_enterprise_users: false +example_value: false +features: + dynamic_refresh: false + per_profile: true +items: +- caption: Display the human presence sensor screen during sign-in + value: true +- caption: Do not display the human presence sensor screen during sign-in + value: false +owners: +- bchikhaoui@google.com +- cros-oobe@google.com +schema: + type: boolean +future_on: +- chrome_os +tags: [] +type: main \ No newline at end of file
diff --git a/components/policy/test/data/policy_test_cases.json b/components/policy/test/data/policy_test_cases.json index fc36c772..f7a1a21 100644 --- a/components/policy/test/data/policy_test_cases.json +++ b/components/policy/test/data/policy_test_cases.json
@@ -4256,6 +4256,42 @@ } ] }, + "ShowHumanPresenceSensorScreenEnabled": { + "os": [ + "chromeos_ash" + ], + "policy_pref_mapping_tests": [ + { + "note": "The default is changed by default_for_enterprise_users", + "policies": {}, + "prefs": { + "ash.human_presence_sensor_scren_oobe_enabled": { + "value": false + } + } + }, + { + "policies": { + "ShowHumanPresenceSensorScreenEnabled": false + }, + "prefs": { + "ash.human_presence_sensor_scren_oobe_enabled": { + "value": false + } + } + }, + { + "policies": { + "ShowHumanPresenceSensorScreenEnabled": true + }, + "prefs": { + "ash.human_presence_sensor_scren_oobe_enabled": { + "value": true + } + } + } + ] + }, "DeveloperToolsDisabled": { "os": [ "win",
diff --git a/components/privacy_sandbox/privacy_sandbox_features.cc b/components/privacy_sandbox/privacy_sandbox_features.cc index 41529b73..0b7e856 100644 --- a/components/privacy_sandbox/privacy_sandbox_features.cc +++ b/components/privacy_sandbox/privacy_sandbox_features.cc
@@ -126,6 +126,10 @@ "TrackingProtectionOnboardingForceEligibility", base::FEATURE_DISABLED_BY_DEFAULT); +BASE_FEATURE(kTrackingProtectionSettingsPageRollbackNotice, + "TrackingProtectionSettingsPageRollbackNotice", + base::FEATURE_DISABLED_BY_DEFAULT); + #if BUILDFLAG(IS_ANDROID) BASE_FEATURE(kTrackingProtectionOnboardingSkipSecurePageCheck, "TrackingProtectionOnboardingSkipSecurePageCheck",
diff --git a/components/privacy_sandbox/privacy_sandbox_features.h b/components/privacy_sandbox/privacy_sandbox_features.h index 3784d6a..94e2c32 100644 --- a/components/privacy_sandbox/privacy_sandbox_features.h +++ b/components/privacy_sandbox/privacy_sandbox_features.h
@@ -169,6 +169,10 @@ COMPONENT_EXPORT(PRIVACY_SANDBOX_FEATURES) BASE_DECLARE_FEATURE(kTrackingProtectionOnboardingForceEligibility); +// Enables showing the rollback notice for Tracking Protection in settings. +COMPONENT_EXPORT(PRIVACY_SANDBOX_FEATURES) +BASE_DECLARE_FEATURE(kTrackingProtectionSettingsPageRollbackNotice); + #if BUILDFLAG(IS_ANDROID) // Forces Tracking Protection Onboarding notice to be shown on all kind of pages // (not only the ones with secure connection).
diff --git a/components/privacy_sandbox/tracking_protection_onboarding.h b/components/privacy_sandbox/tracking_protection_onboarding.h index ffe24d4..55a664d 100644 --- a/components/privacy_sandbox/tracking_protection_onboarding.h +++ b/components/privacy_sandbox/tracking_protection_onboarding.h
@@ -29,6 +29,7 @@ kMaxValue = kOffboarded, }; + // GENERATED_JAVA_ENUM_PACKAGE: org.chromium.chrome.browser.privacy_sandbox enum class NoticeAction { // Other action taken - notice dismissed due to other actions. kOther = 0,
diff --git a/components/resources/default_100_percent/search_engine_choice/baidu_com.png b/components/resources/default_100_percent/search_engine_choice/baidu_com.png index 1c6ba81..4a199fb 100644 --- a/components/resources/default_100_percent/search_engine_choice/baidu_com.png +++ b/components/resources/default_100_percent/search_engine_choice/baidu_com.png Binary files differ
diff --git a/components/resources/default_100_percent/search_engine_choice/bing_com.png b/components/resources/default_100_percent/search_engine_choice/bing_com.png index 29f022c..2bbc5ca 100644 --- a/components/resources/default_100_percent/search_engine_choice/bing_com.png +++ b/components/resources/default_100_percent/search_engine_choice/bing_com.png Binary files differ
diff --git a/components/resources/default_100_percent/search_engine_choice/coccoc_com.png b/components/resources/default_100_percent/search_engine_choice/coccoc_com.png index 0cf094b2..8d666a15f 100644 --- a/components/resources/default_100_percent/search_engine_choice/coccoc_com.png +++ b/components/resources/default_100_percent/search_engine_choice/coccoc_com.png Binary files differ
diff --git a/components/resources/default_100_percent/search_engine_choice/daum_net.png b/components/resources/default_100_percent/search_engine_choice/daum_net.png index 3464f8a4..cd0e196 100644 --- a/components/resources/default_100_percent/search_engine_choice/daum_net.png +++ b/components/resources/default_100_percent/search_engine_choice/daum_net.png Binary files differ
diff --git a/components/resources/default_100_percent/search_engine_choice/duckduckgo_com.png b/components/resources/default_100_percent/search_engine_choice/duckduckgo_com.png index a4af889..8684a92 100644 --- a/components/resources/default_100_percent/search_engine_choice/duckduckgo_com.png +++ b/components/resources/default_100_percent/search_engine_choice/duckduckgo_com.png Binary files differ
diff --git a/components/resources/default_100_percent/search_engine_choice/ecosia_org.png b/components/resources/default_100_percent/search_engine_choice/ecosia_org.png index 3e3f771..db6cc75 100644 --- a/components/resources/default_100_percent/search_engine_choice/ecosia_org.png +++ b/components/resources/default_100_percent/search_engine_choice/ecosia_org.png Binary files differ
diff --git a/components/resources/default_100_percent/search_engine_choice/info_com.png b/components/resources/default_100_percent/search_engine_choice/info_com.png index 791b656..698cbfd5 100644 --- a/components/resources/default_100_percent/search_engine_choice/info_com.png +++ b/components/resources/default_100_percent/search_engine_choice/info_com.png Binary files differ
diff --git a/components/resources/default_100_percent/search_engine_choice/karmasearch_org.png b/components/resources/default_100_percent/search_engine_choice/karmasearch_org.png index 4b9ae1f..111f19e 100644 --- a/components/resources/default_100_percent/search_engine_choice/karmasearch_org.png +++ b/components/resources/default_100_percent/search_engine_choice/karmasearch_org.png Binary files differ
diff --git a/components/resources/default_100_percent/search_engine_choice/lilo_org.png b/components/resources/default_100_percent/search_engine_choice/lilo_org.png index 91d53f8..00d81f3 100644 --- a/components/resources/default_100_percent/search_engine_choice/lilo_org.png +++ b/components/resources/default_100_percent/search_engine_choice/lilo_org.png Binary files differ
diff --git a/components/resources/default_100_percent/search_engine_choice/mail_ru.png b/components/resources/default_100_percent/search_engine_choice/mail_ru.png index 74808c9..dc92bd30 100644 --- a/components/resources/default_100_percent/search_engine_choice/mail_ru.png +++ b/components/resources/default_100_percent/search_engine_choice/mail_ru.png Binary files differ
diff --git a/components/resources/default_100_percent/search_engine_choice/metager_de.png b/components/resources/default_100_percent/search_engine_choice/metager_de.png index b5848219..6907262 100644 --- a/components/resources/default_100_percent/search_engine_choice/metager_de.png +++ b/components/resources/default_100_percent/search_engine_choice/metager_de.png Binary files differ
diff --git a/components/resources/default_100_percent/search_engine_choice/mojeek_com.png b/components/resources/default_100_percent/search_engine_choice/mojeek_com.png index d070320d..9daa4d6 100644 --- a/components/resources/default_100_percent/search_engine_choice/mojeek_com.png +++ b/components/resources/default_100_percent/search_engine_choice/mojeek_com.png Binary files differ
diff --git a/components/resources/default_100_percent/search_engine_choice/naver_com.png b/components/resources/default_100_percent/search_engine_choice/naver_com.png index 975931b..bc2535f4 100644 --- a/components/resources/default_100_percent/search_engine_choice/naver_com.png +++ b/components/resources/default_100_percent/search_engine_choice/naver_com.png Binary files differ
diff --git a/components/resources/default_100_percent/search_engine_choice/nona_de.png b/components/resources/default_100_percent/search_engine_choice/nona_de.png index ebbf352..32510ba 100644 --- a/components/resources/default_100_percent/search_engine_choice/nona_de.png +++ b/components/resources/default_100_percent/search_engine_choice/nona_de.png Binary files differ
diff --git a/components/resources/default_100_percent/search_engine_choice/oceanhero_today.png b/components/resources/default_100_percent/search_engine_choice/oceanhero_today.png index 9984421..9797e58 100644 --- a/components/resources/default_100_percent/search_engine_choice/oceanhero_today.png +++ b/components/resources/default_100_percent/search_engine_choice/oceanhero_today.png Binary files differ
diff --git a/components/resources/default_100_percent/search_engine_choice/panda_search_org.png b/components/resources/default_100_percent/search_engine_choice/panda_search_org.png index e4081f6..be8c47412 100644 --- a/components/resources/default_100_percent/search_engine_choice/panda_search_org.png +++ b/components/resources/default_100_percent/search_engine_choice/panda_search_org.png Binary files differ
diff --git a/components/resources/default_100_percent/search_engine_choice/privacywall_org.png b/components/resources/default_100_percent/search_engine_choice/privacywall_org.png index f5ddbc6..5a7d071 100644 --- a/components/resources/default_100_percent/search_engine_choice/privacywall_org.png +++ b/components/resources/default_100_percent/search_engine_choice/privacywall_org.png Binary files differ
diff --git a/components/resources/default_100_percent/search_engine_choice/quendu_com.png b/components/resources/default_100_percent/search_engine_choice/quendu_com.png index 6329b53..d5a9c4c6 100644 --- a/components/resources/default_100_percent/search_engine_choice/quendu_com.png +++ b/components/resources/default_100_percent/search_engine_choice/quendu_com.png Binary files differ
diff --git a/components/resources/default_100_percent/search_engine_choice/qwant_com.png b/components/resources/default_100_percent/search_engine_choice/qwant_com.png index 5db082e..6e410497 100644 --- a/components/resources/default_100_percent/search_engine_choice/qwant_com.png +++ b/components/resources/default_100_percent/search_engine_choice/qwant_com.png Binary files differ
diff --git a/components/resources/default_100_percent/search_engine_choice/search_brave_com.png b/components/resources/default_100_percent/search_engine_choice/search_brave_com.png index 7c4a8a744..49ff8b99 100644 --- a/components/resources/default_100_percent/search_engine_choice/search_brave_com.png +++ b/components/resources/default_100_percent/search_engine_choice/search_brave_com.png Binary files differ
diff --git a/components/resources/default_100_percent/search_engine_choice/seznam_cz.png b/components/resources/default_100_percent/search_engine_choice/seznam_cz.png index ac26d32..af7f2a2 100644 --- a/components/resources/default_100_percent/search_engine_choice/seznam_cz.png +++ b/components/resources/default_100_percent/search_engine_choice/seznam_cz.png Binary files differ
diff --git a/components/resources/default_100_percent/search_engine_choice/so_com.png b/components/resources/default_100_percent/search_engine_choice/so_com.png index 49701c5..b136fcb 100644 --- a/components/resources/default_100_percent/search_engine_choice/so_com.png +++ b/components/resources/default_100_percent/search_engine_choice/so_com.png Binary files differ
diff --git a/components/resources/default_100_percent/search_engine_choice/sogou_com.png b/components/resources/default_100_percent/search_engine_choice/sogou_com.png index 1264896..d4129f8 100644 --- a/components/resources/default_100_percent/search_engine_choice/sogou_com.png +++ b/components/resources/default_100_percent/search_engine_choice/sogou_com.png Binary files differ
diff --git a/components/resources/default_100_percent/search_engine_choice/yahoo_com.png b/components/resources/default_100_percent/search_engine_choice/yahoo_com.png index 838bb4f..82c1028f 100644 --- a/components/resources/default_100_percent/search_engine_choice/yahoo_com.png +++ b/components/resources/default_100_percent/search_engine_choice/yahoo_com.png Binary files differ
diff --git a/components/resources/default_100_percent/search_engine_choice/yandex_by.png b/components/resources/default_100_percent/search_engine_choice/yandex_by.png index 59f8731..ef1f094 100644 --- a/components/resources/default_100_percent/search_engine_choice/yandex_by.png +++ b/components/resources/default_100_percent/search_engine_choice/yandex_by.png Binary files differ
diff --git a/components/resources/default_100_percent/search_engine_choice/yandex_com.png b/components/resources/default_100_percent/search_engine_choice/yandex_com.png index 9f742c3..055c0d46 100644 --- a/components/resources/default_100_percent/search_engine_choice/yandex_com.png +++ b/components/resources/default_100_percent/search_engine_choice/yandex_com.png Binary files differ
diff --git a/components/resources/default_100_percent/search_engine_choice/yep_com.png b/components/resources/default_100_percent/search_engine_choice/yep_com.png index 1ac6c83..b752423 100644 --- a/components/resources/default_100_percent/search_engine_choice/yep_com.png +++ b/components/resources/default_100_percent/search_engine_choice/yep_com.png Binary files differ
diff --git a/components/resources/default_200_percent/search_engine_choice/DIR_METADATA b/components/resources/default_200_percent/search_engine_choice/DIR_METADATA deleted file mode 100644 index c8383f40..0000000 --- a/components/resources/default_200_percent/search_engine_choice/DIR_METADATA +++ /dev/null
@@ -1 +0,0 @@ -mixins: "//chrome/browser/search_engine_choice/COMMON_METADATA"
diff --git a/components/resources/default_200_percent/search_engine_choice/OWNERS b/components/resources/default_200_percent/search_engine_choice/OWNERS deleted file mode 100644 index 4b1c099..0000000 --- a/components/resources/default_200_percent/search_engine_choice/OWNERS +++ /dev/null
@@ -1 +0,0 @@ -file://chrome/browser/search_engine_choice/OWNERS
diff --git a/components/resources/default_200_percent/search_engine_choice/baidu_com.png b/components/resources/default_200_percent/search_engine_choice/baidu_com.png deleted file mode 100644 index 4a199fb..0000000 --- a/components/resources/default_200_percent/search_engine_choice/baidu_com.png +++ /dev/null Binary files differ
diff --git a/components/resources/default_200_percent/search_engine_choice/bing_com.png b/components/resources/default_200_percent/search_engine_choice/bing_com.png deleted file mode 100644 index 6f17f19..0000000 --- a/components/resources/default_200_percent/search_engine_choice/bing_com.png +++ /dev/null Binary files differ
diff --git a/components/resources/default_200_percent/search_engine_choice/daum_net.png b/components/resources/default_200_percent/search_engine_choice/daum_net.png deleted file mode 100644 index cd0e196..0000000 --- a/components/resources/default_200_percent/search_engine_choice/daum_net.png +++ /dev/null Binary files differ
diff --git a/components/resources/default_200_percent/search_engine_choice/default_favicon.png b/components/resources/default_200_percent/search_engine_choice/default_favicon.png deleted file mode 100644 index a682f08d..0000000 --- a/components/resources/default_200_percent/search_engine_choice/default_favicon.png +++ /dev/null Binary files differ
diff --git a/components/resources/default_200_percent/search_engine_choice/duckduckgo_com.png b/components/resources/default_200_percent/search_engine_choice/duckduckgo_com.png deleted file mode 100644 index 5e775487..0000000 --- a/components/resources/default_200_percent/search_engine_choice/duckduckgo_com.png +++ /dev/null Binary files differ
diff --git a/components/resources/default_200_percent/search_engine_choice/ecosia_org.png b/components/resources/default_200_percent/search_engine_choice/ecosia_org.png deleted file mode 100644 index db6cc75..0000000 --- a/components/resources/default_200_percent/search_engine_choice/ecosia_org.png +++ /dev/null Binary files differ
diff --git a/components/resources/default_200_percent/search_engine_choice/info_com.png b/components/resources/default_200_percent/search_engine_choice/info_com.png deleted file mode 100644 index a2148faf..0000000 --- a/components/resources/default_200_percent/search_engine_choice/info_com.png +++ /dev/null Binary files differ
diff --git a/components/resources/default_200_percent/search_engine_choice/karmasearch_org.png b/components/resources/default_200_percent/search_engine_choice/karmasearch_org.png deleted file mode 100644 index 111f19e..0000000 --- a/components/resources/default_200_percent/search_engine_choice/karmasearch_org.png +++ /dev/null Binary files differ
diff --git a/components/resources/default_200_percent/search_engine_choice/mail_ru.png b/components/resources/default_200_percent/search_engine_choice/mail_ru.png deleted file mode 100644 index b95d1a1..0000000 --- a/components/resources/default_200_percent/search_engine_choice/mail_ru.png +++ /dev/null Binary files differ
diff --git a/components/resources/default_200_percent/search_engine_choice/metager_de.png b/components/resources/default_200_percent/search_engine_choice/metager_de.png deleted file mode 100644 index 6907262..0000000 --- a/components/resources/default_200_percent/search_engine_choice/metager_de.png +++ /dev/null Binary files differ
diff --git a/components/resources/default_200_percent/search_engine_choice/mojeek_com.png b/components/resources/default_200_percent/search_engine_choice/mojeek_com.png deleted file mode 100644 index 134e5f0..0000000 --- a/components/resources/default_200_percent/search_engine_choice/mojeek_com.png +++ /dev/null Binary files differ
diff --git a/components/resources/default_200_percent/search_engine_choice/naver_com.png b/components/resources/default_200_percent/search_engine_choice/naver_com.png deleted file mode 100644 index 540f36e..0000000 --- a/components/resources/default_200_percent/search_engine_choice/naver_com.png +++ /dev/null Binary files differ
diff --git a/components/resources/default_200_percent/search_engine_choice/nona_de.png b/components/resources/default_200_percent/search_engine_choice/nona_de.png deleted file mode 100644 index 32510ba..0000000 --- a/components/resources/default_200_percent/search_engine_choice/nona_de.png +++ /dev/null Binary files differ
diff --git a/components/resources/default_200_percent/search_engine_choice/oceanhero_today.png b/components/resources/default_200_percent/search_engine_choice/oceanhero_today.png deleted file mode 100644 index c75fd9d..0000000 --- a/components/resources/default_200_percent/search_engine_choice/oceanhero_today.png +++ /dev/null Binary files differ
diff --git a/components/resources/default_200_percent/search_engine_choice/panda_search_org.png b/components/resources/default_200_percent/search_engine_choice/panda_search_org.png deleted file mode 100644 index be8c47412..0000000 --- a/components/resources/default_200_percent/search_engine_choice/panda_search_org.png +++ /dev/null Binary files differ
diff --git a/components/resources/default_200_percent/search_engine_choice/privacywall_org.png b/components/resources/default_200_percent/search_engine_choice/privacywall_org.png deleted file mode 100644 index 1d7a045e..0000000 --- a/components/resources/default_200_percent/search_engine_choice/privacywall_org.png +++ /dev/null Binary files differ
diff --git a/components/resources/default_200_percent/search_engine_choice/quendu_com.png b/components/resources/default_200_percent/search_engine_choice/quendu_com.png deleted file mode 100644 index d5a9c4c6..0000000 --- a/components/resources/default_200_percent/search_engine_choice/quendu_com.png +++ /dev/null Binary files differ
diff --git a/components/resources/default_200_percent/search_engine_choice/search_brave_com.png b/components/resources/default_200_percent/search_engine_choice/search_brave_com.png deleted file mode 100644 index 0a96f61..0000000 --- a/components/resources/default_200_percent/search_engine_choice/search_brave_com.png +++ /dev/null Binary files differ
diff --git a/components/resources/default_200_percent/search_engine_choice/seznam_cz.png b/components/resources/default_200_percent/search_engine_choice/seznam_cz.png deleted file mode 100644 index af7f2a2..0000000 --- a/components/resources/default_200_percent/search_engine_choice/seznam_cz.png +++ /dev/null Binary files differ
diff --git a/components/resources/default_200_percent/search_engine_choice/so_com.png b/components/resources/default_200_percent/search_engine_choice/so_com.png deleted file mode 100644 index 2339d8d..0000000 --- a/components/resources/default_200_percent/search_engine_choice/so_com.png +++ /dev/null Binary files differ
diff --git a/components/resources/default_200_percent/search_engine_choice/yahoo_com.png b/components/resources/default_200_percent/search_engine_choice/yahoo_com.png deleted file mode 100644 index cd597ca..0000000 --- a/components/resources/default_200_percent/search_engine_choice/yahoo_com.png +++ /dev/null Binary files differ
diff --git a/components/resources/default_200_percent/search_engine_choice/yep_com.png b/components/resources/default_200_percent/search_engine_choice/yep_com.png deleted file mode 100644 index b752423..0000000 --- a/components/resources/default_200_percent/search_engine_choice/yep_com.png +++ /dev/null Binary files differ
diff --git a/components/search_engines/prepopulated_engines.json b/components/search_engines/prepopulated_engines.json index 1bedf99..9f4e01c1 100644 --- a/components/search_engines/prepopulated_engines.json +++ b/components/search_engines/prepopulated_engines.json
@@ -29,7 +29,7 @@ // existing data should get a new version. Otherwise, existing data may // continue to be used and updates made here will not always appear. // Also then run tools/search_engine_choice/generate_search_engine_icons.py. - "kCurrentDataVersion": 144 + "kCurrentDataVersion": 145 }, // The following engines are included in country lists and are added to the @@ -127,7 +127,7 @@ "google": { "name": "Google", "keyword": "google.com", - "favicon_url": "https://www.google.com/images/branding/product/ico/googleg_lodp.ico", + "favicon_url": "https://www.google.com/images/branding/product/ico/googleg_alldp.ico", "search_url": "{google:baseURL}search?q={searchTerms}&{google:RLZ}{google:originalQueryForSuggestion}{google:assistedQueryStats}{google:searchFieldtrialParameter}{google:iOSSearchLanguage}{google:prefetchSource}{google:searchClient}{google:sourceId}{google:contextualSearchVersion}ie={inputEncoding}", "suggest_url": "{google:baseSuggestURL}search?{google:searchFieldtrialParameter}client={google:suggestClient}&gs_ri={google:suggestRid}&xssi=t&q={searchTerms}&{google:inputType}{google:omniboxFocusType}{google:cursorPosition}{google:currentPageUrl}{google:pageClassification}{google:clientCacheTimeToLive}{google:searchVersion}{google:sessionToken}{google:prefetchQuery}sugkey={google:suggestAPIKeyParameter}", "image_url": "{google:baseSearchByImageURL}upload",
diff --git a/content/browser/generic_sensor/web_contents_sensor_provider_proxy.cc b/content/browser/generic_sensor/web_contents_sensor_provider_proxy.cc index c8a86423..a38e2f2 100644 --- a/content/browser/generic_sensor/web_contents_sensor_provider_proxy.cc +++ b/content/browser/generic_sensor/web_contents_sensor_provider_proxy.cc
@@ -44,6 +44,38 @@ web_contents); } +void WebContentsSensorProviderProxy::CreateVirtualSensor( + SensorType type, + device::mojom::VirtualSensorMetadataPtr metadata, + device::mojom::SensorProvider::CreateVirtualSensorCallback callback) { + EnsureDeviceServiceConnection(); + sensor_provider_->CreateVirtualSensor(type, std::move(metadata), + std::move(callback)); +} + +void WebContentsSensorProviderProxy::UpdateVirtualSensor( + SensorType type, + const device::SensorReading& reading, + device::mojom::SensorProvider::UpdateVirtualSensorCallback callback) { + EnsureDeviceServiceConnection(); + sensor_provider_->UpdateVirtualSensor(type, reading, std::move(callback)); +} + +void WebContentsSensorProviderProxy::RemoveVirtualSensor( + SensorType type, + device::mojom::SensorProvider::RemoveVirtualSensorCallback callback) { + EnsureDeviceServiceConnection(); + sensor_provider_->RemoveVirtualSensor(type, std::move(callback)); +} + +void WebContentsSensorProviderProxy::GetVirtualSensorInformation( + SensorType type, + device::mojom::SensorProvider::GetVirtualSensorInformationCallback + callback) { + EnsureDeviceServiceConnection(); + sensor_provider_->GetVirtualSensorInformation(type, std::move(callback)); +} + // static void WebContentsSensorProviderProxy::OverrideSensorProviderBinderForTesting( SensorProviderBinder binder) {
diff --git a/content/browser/generic_sensor/web_contents_sensor_provider_proxy.h b/content/browser/generic_sensor/web_contents_sensor_provider_proxy.h index 39bf0be..279e36db 100644 --- a/content/browser/generic_sensor/web_contents_sensor_provider_proxy.h +++ b/content/browser/generic_sensor/web_contents_sensor_provider_proxy.h
@@ -9,6 +9,7 @@ #include "content/common/content_export.h" #include "content/public/browser/web_contents_user_data.h" #include "mojo/public/cpp/bindings/remote.h" +#include "services/device/public/cpp/generic_sensor/sensor_reading.h" #include "services/device/public/mojom/sensor_provider.mojom.h" namespace content { @@ -39,6 +40,22 @@ void GetSensor(device::mojom::SensorType type, device::mojom::SensorProvider::GetSensorCallback callback); + void CreateVirtualSensor( + device::mojom::SensorType type, + device::mojom::VirtualSensorMetadataPtr metadata, + device::mojom::SensorProvider::CreateVirtualSensorCallback callback); + void UpdateVirtualSensor( + device::mojom::SensorType type, + const device::SensorReading& reading, + device::mojom::SensorProvider::UpdateVirtualSensorCallback callback); + void RemoveVirtualSensor( + device::mojom::SensorType type, + device::mojom::SensorProvider::RemoveVirtualSensorCallback callback); + void GetVirtualSensorInformation( + device::mojom::SensorType type, + device::mojom::SensorProvider::GetVirtualSensorInformationCallback + callback); + // Allows tests to override how this class binds its backing SensorProvider // endpoint. using SensorProviderBinder = base::RepeatingCallback<void(
diff --git a/content/browser/loader/navigation_url_loader.cc b/content/browser/loader/navigation_url_loader.cc index 66ce7d86..66769358 100644 --- a/content/browser/loader/navigation_url_loader.cc +++ b/content/browser/loader/navigation_url_loader.cc
@@ -85,4 +85,26 @@ g_loader_factory = factory; } +// static +uint32_t NavigationURLLoader::GetURLLoaderOptions( + bool is_outermost_main_frame) { + uint32_t options = network::mojom::kURLLoadOptionNone; + + // Ensure that Mime sniffing works. + options |= network::mojom::kURLLoadOptionSniffMimeType; + + if (is_outermost_main_frame) { + // SSLInfo is not needed on subframe or fenced frame responses because users + // can inspect only the certificate for the main frame when using the info + // bubble. + options |= network::mojom::kURLLoadOptionSendSSLInfoWithResponse; + } + + // When there's a certificate error for a frame load (regardless of whether + // the error caused the connection to fail), SSLInfo is useful for adjusting + // security UI accordingly. + options |= network::mojom::kURLLoadOptionSendSSLInfoForCertificateError; + + return options; +} } // namespace content
diff --git a/content/browser/loader/navigation_url_loader.h b/content/browser/loader/navigation_url_loader.h index 12271fc1..9290fd5 100644 --- a/content/browser/loader/navigation_url_loader.h +++ b/content/browser/loader/navigation_url_loader.h
@@ -114,6 +114,8 @@ // timeout) and will return `false`. virtual bool SetNavigationTimeout(base::TimeDelta timeout) = 0; + static uint32_t GetURLLoaderOptions(bool is_outermost_main_frame); + protected: NavigationURLLoader() {} };
diff --git a/content/browser/loader/navigation_url_loader_impl.cc b/content/browser/loader/navigation_url_loader_impl.cc index 54bfe35..ba8b59a 100644 --- a/content/browser/loader/navigation_url_loader_impl.cc +++ b/content/browser/loader/navigation_url_loader_impl.cc
@@ -353,27 +353,6 @@ handled_externally ? net::ERR_ABORTED : net::ERR_UNKNOWN_URL_SCHEME)); } -uint32_t GetURLLoaderOptions(bool is_outermost_main_frame) { - uint32_t options = network::mojom::kURLLoadOptionNone; - - // Ensure that Mime sniffing works. - options |= network::mojom::kURLLoadOptionSniffMimeType; - - if (is_outermost_main_frame) { - // SSLInfo is not needed on subframe or fenced frame responses because users - // can inspect only the certificate for the main frame when using the info - // bubble. - options |= network::mojom::kURLLoadOptionSendSSLInfoWithResponse; - } - - // When there's a certificate error for a frame load (regardless of whether - // the error caused the connection to fail), SSLInfo is useful for adjusting - // security UI accordingly. - options |= network::mojom::kURLLoadOptionSendSSLInfoForCertificateError; - - return options; -} - void LogQueueTimeHistogram(base::StringPiece name, bool is_outermost_main_frame) { auto* task = base::TaskAnnotator::CurrentTaskForThread();
diff --git a/content/browser/preloading/preconnector_unittest.cc b/content/browser/preloading/preconnector_unittest.cc index 7de5a37f..047c7d12 100644 --- a/content/browser/preloading/preconnector_unittest.cc +++ b/content/browser/preloading/preconnector_unittest.cc
@@ -23,8 +23,13 @@ void MaybePreconnect(const GURL& target) override { target_ = target; } absl::optional<GURL>& Target() { return target_; } + base::WeakPtr<MockAnchorElementPreconnector> AsWeakPtr() { + return weak_ptr_factory_.GetWeakPtr(); + } + private: absl::optional<GURL> target_; + base::WeakPtrFactory<MockAnchorElementPreconnector> weak_ptr_factory_{this}; }; class MockContentBrowserClient : public TestContentBrowserClient { @@ -41,15 +46,17 @@ RenderFrameHost& render_frame_host) override { auto delegate = std::make_unique<MockAnchorElementPreconnector>(render_frame_host); - delegate_ = delegate.get(); + delegate_ = delegate->AsWeakPtr(); return delegate; } - MockAnchorElementPreconnector* GetDelegate() { return delegate_; } + base::WeakPtr<MockAnchorElementPreconnector> GetDelegate() { + return delegate_; + } private: raw_ptr<ContentBrowserClient> old_browser_client_; - raw_ptr<MockAnchorElementPreconnector, DanglingUntriaged> delegate_; + base::WeakPtr<MockAnchorElementPreconnector> delegate_; }; class PreconnectorTest : public RenderViewHostTestHarness { @@ -82,8 +89,9 @@ TEST_F(PreconnectorTest, MaybePreconnect) { MockContentBrowserClient browser_client; auto preconnector = Preconnector(GetPrimaryMainFrame()); - auto* delegate = browser_client.GetDelegate(); - EXPECT_TRUE(delegate != nullptr); + base::WeakPtr<MockAnchorElementPreconnector> delegate = + browser_client.GetDelegate(); + ASSERT_TRUE(delegate); const auto url = GURL("https://example.com/page1"); preconnector.MaybePreconnect(url);
diff --git a/content/browser/renderer_host/navigation_request.cc b/content/browser/renderer_host/navigation_request.cc index 8a6186c..ab00c68 100644 --- a/content/browser/renderer_host/navigation_request.cc +++ b/content/browser/renderer_host/navigation_request.cc
@@ -2717,6 +2717,9 @@ void NavigationRequest:: SelectFrameHostForCrossDocumentNavigationWithNoUrlLoader() { DCHECK(!NeedsUrlLoader()); + CHECK(!HasRenderFrameHost()) + << "`render_frame_host_` should not be set before the " + "`NavigationRequest` starts to select the RFH."; if (auto result = frame_tree_node_->render_manager()->GetFrameHostForNavigation( @@ -4283,6 +4286,9 @@ network::mojom::URLLoaderClientEndpointsPtr url_loader_client_endpoints, bool is_download, absl::optional<SubresourceLoaderParams> subresource_loader_params) { + CHECK(!HasRenderFrameHost()) + << "`render_frame_host_` should not be set before the " + "`NavigationRequest` starts to select the RFH."; ScopedCrashKeys crash_keys(*this); std::string rfh_selected_reason; @@ -4671,6 +4677,13 @@ // anymore from now while the error page is being loaded. loader_.reset(); + // Reset the RenderFrameHost R1 that had been computed for committing the + // failed navigation. This breaks the binding between the current + // NavigationRequest and R1, so that if we create another speculative + // RenderFrameHost R2 to commit an error page after this, deleting R1 won't + // try to delete this NavigationRequest along with it. + render_frame_host_ = absl::nullopt; + ssl_info_ = status.ssl_info; devtools_instrumentation::OnNavigationRequestFailed(*this, status); @@ -4722,6 +4735,10 @@ bool exists_in_cache, bool skip_throttles, const absl::optional<std::string>& error_page_content) { + CHECK(!HasRenderFrameHost()) + << "`render_frame_host_` should not be set before the " + "`NavigationRequest` starts to select the RFH."; + switch (ComputeErrorPageProcess()) { case ErrorPageProcess::kCurrentProcess: // There's no way to get here with a same-document navigation, it would @@ -4780,10 +4797,6 @@ } } - // Sanity check that we haven't changed the RenderFrameHost picked for the - // error page in OnRequestFailedInternal when running the WillFailRequest - // checks. - CHECK(!HasRenderFrameHost() || GetRenderFrameHost() == render_frame_host); render_frame_host_ = render_frame_host->GetSafeRef(); // Update the associated RenderFrameHost type. @@ -5426,21 +5439,15 @@ !response_should_be_rendered_) { MaybeAddResourceTimingEntryForCancelledNavigation(); - // Reset the RenderFrameHost that had been computed for the commit of the - // navigation. - // TODO(https://crbug.com/1416916): Reconsider if we really need to unset - // the `render_frame_host_` here, as the NavigationRequest might stay alive - // for a bit longer to commit an error page. - render_frame_host_ = absl::nullopt; - // TODO(clamy): distinguish between CANCEL and CANCEL_AND_IGNORE. if (!response_should_be_rendered_) { - // DO NOT ADD CODE after this. The previous call to OnRequestFailed has - // destroyed the NavigationRequest. OnRequestFailedInternal( network::URLLoaderCompletionStatus(net::ERR_ABORTED), true /* skip_throttles */, absl::nullopt /* error_page_content */, false /* collapse_frame */); + + // DO NOT ADD CODE after this. The previous call to + // OnRequestFailedInternal has destroyed the NavigationRequest. return; } @@ -5458,12 +5465,6 @@ if (result.action() == NavigationThrottle::BLOCK_RESPONSE) { DCHECK_EQ(net::ERR_BLOCKED_BY_RESPONSE, result.net_error_code()); - // Reset the RenderFrameHost that had been computed for the commit of the - // navigation. - // TODO(https://crbug.com/1416916): Reconsider if we really need to unset - // the `render_frame_host_` here, as the NavigationRequest might stay alive - // for a bit longer to commit an error page. - render_frame_host_ = absl::nullopt; OnRequestFailedInternal( network::URLLoaderCompletionStatus(result.net_error_code()), true /* skip_throttles */, result.error_page_content(),
diff --git a/content/browser/renderer_host/navigation_request_browsertest.cc b/content/browser/renderer_host/navigation_request_browsertest.cc index 77f190d..31b9039 100644 --- a/content/browser/renderer_host/navigation_request_browsertest.cc +++ b/content/browser/renderer_host/navigation_request_browsertest.cc
@@ -4894,4 +4894,54 @@ ~network::mojom::WebSandboxFlags::kAutomaticFeatures); } +// Tests the scenario when a navigation without URLLoader is cancelled and an +// error page is committed using the same NavigationRequest. +// See https://crbug.com/1487944. +IN_PROC_BROWSER_TEST_F( + NavigationRequestBrowserTest, + ThrottleDeferAndCancelCommitWithoutUrlLoaderWithErrorPage) { + GURL url(embedded_test_server()->GetURL("/title1.html")); + GURL about_blank_url(url::kAboutBlankURL); + + // Perform a new-document navigation (setup). + EXPECT_TRUE(NavigateToURL(shell(), url)); + + // Navigate to about:blank so the NavigationRequest is expected to commit + // without URL loader. + { + TestNavigationObserver navigation_observer(shell()->web_contents(), 1); + NavigationHandleObserver observer(shell()->web_contents(), about_blank_url); + TestNavigationThrottleInstaller installer( + shell()->web_contents(), NavigationThrottle::DEFER, + NavigationThrottle::DEFER, NavigationThrottle::DEFER, + NavigationThrottle::DEFER, NavigationThrottle::DEFER); + + shell()->LoadURL(about_blank_url); + + // Wait for WillCommitWithoutUrlLoader. + installer.WaitForThrottleWillCommitWithoutUrlLoader(); + EXPECT_EQ(0, installer.will_start_called()); + EXPECT_EQ(0, installer.will_redirect_called()); + EXPECT_EQ(0, installer.will_fail_called()); + EXPECT_EQ(0, installer.will_process_called()); + EXPECT_EQ(1, installer.will_commit_without_url_loader_called()); + + // Cancel the deferred navigation with `net::ERR_BLOCKED_BY_RESPONSE`, so + // the NavigationRequest will be used for an error page commit. + installer.navigation_throttle()->CancelNavigation( + {NavigationThrottle::CANCEL_AND_IGNORE, net::ERR_BLOCKED_BY_RESPONSE}); + + // Wait for the end of the navigation. + navigation_observer.Wait(); + + EXPECT_FALSE(observer.is_same_document()); + EXPECT_TRUE(observer.has_committed()); + EXPECT_FALSE(observer.was_redirected()); + EXPECT_TRUE(observer.is_error()); + + EXPECT_TRUE( + shell()->web_contents()->GetPrimaryMainFrame()->IsErrorDocument()); + } +} + } // namespace content
diff --git a/content/browser/renderer_host/render_frame_host_impl.cc b/content/browser/renderer_host/render_frame_host_impl.cc index b7ad13fd..abdf7ba 100644 --- a/content/browser/renderer_host/render_frame_host_impl.cc +++ b/content/browser/renderer_host/render_frame_host_impl.cc
@@ -1716,8 +1716,6 @@ } else if (navigation_request->state() >= NavigationRequest::WILL_PROCESS_RESPONSE && navigation_request->GetRenderFrameHost() == this) { - frame_tree_node_->ResetNavigationRequest( - NavigationDiscardReason::kRenderFrameHostDestruction); // As we are unable to come up with a case that will lead to this path, // we instead record the dumps for debugging the scenario. // TODO(crbug.com/1430653): if we verify that this path is impossible,
diff --git a/content/browser/service_worker/service_worker_browsertest.cc b/content/browser/service_worker/service_worker_browsertest.cc index 7e2f0fef..426a95e6 100644 --- a/content/browser/service_worker/service_worker_browsertest.cc +++ b/content/browser/service_worker/service_worker_browsertest.cc
@@ -5290,7 +5290,9 @@ class ServiceWorkerRaceNetworkRequestBrowserTest : public ServiceWorkerBrowserTest { public: - ServiceWorkerRaceNetworkRequestBrowserTest() { + ServiceWorkerRaceNetworkRequestBrowserTest() + : https_server_(std::make_unique<net::EmbeddedTestServer>( + net::EmbeddedTestServer::TYPE_HTTPS)) { feature_list_.InitWithFeaturesAndParameters( {{features::kServiceWorkerBypassFetchHandler, {{"strategy", "optin"}, @@ -5312,6 +5314,11 @@ return RegisterRaceNetowrkRequestServiceWorker(embedded_test_server()); } + scoped_refptr<ServiceWorkerVersion> + SetupAndRegisterServiceWorkerWithHTTPSServer() { + return RegisterRaceNetowrkRequestServiceWorker(https_server()); + } + EvalJsResult GetInnerText() { // This script asks the service worker what fetch events it saw. return EvalJs(GetPrimaryMainFrame(), "document.body.innerText;"); @@ -5325,11 +5332,16 @@ return it->second.size(); } + net::EmbeddedTestServer* https_server() { return https_server_.get(); } + protected: void SetUpOnMainThread() override { ServiceWorkerBrowserTest::SetUpOnMainThread(); + https_server()->ServeFilesFromSourceDirectory("content/test/data"); RegisterRequestMonitorForRequestCount(embedded_test_server()); + RegisterRequestMonitorForRequestCount(https_server()); RegisterRequestHandlerForSlowResponsePage(embedded_test_server()); + RegisterRequestHandlerForSlowResponsePage(https_server()); } private: @@ -5370,7 +5382,10 @@ return http_response; } - http_response->set_content_type("text/plain"); + if (!base::Contains(request.GetURL().query(), + "server_unknown_mime_type")) { + http_response->set_content_type("text/plain"); + } if (base::Contains(request.GetURL().query(), "server_large_data")) { // The data pipe buffer size created for the RaceNetworkRequest test @@ -5434,6 +5449,7 @@ std::map<std::string, std::vector<net::test_server::HttpRequest>> request_log_; base::test::ScopedFeatureList feature_list_; + std::unique_ptr<net::EmbeddedTestServer> https_server_; }; IN_PROC_BROWSER_TEST_F(ServiceWorkerRaceNetworkRequestBrowserTest, @@ -5460,6 +5476,63 @@ } IN_PROC_BROWSER_TEST_F(ServiceWorkerRaceNetworkRequestBrowserTest, + NetworkRequest_Wins_MarkedAsSecure) { + // Register the ServiceWorker and navigate to the in scope URL. + StartServerAndNavigateToSetup(); + ASSERT_TRUE(https_server()->Start()); + SetupAndRegisterServiceWorkerWithHTTPSServer(); + + // Capture the response head. + const GURL test_url = https_server()->GetURL( + "/service_worker/mock_response?sw_slow&sw_respond"); + + NavigationHandleObserver observer(web_contents(), test_url); + NavigateToURLBlockUntilNavigationsComplete(shell(), test_url, 1); + EXPECT_TRUE(observer.has_committed()); + + // ServiceWorker will respond after the delay, so we expect the response from + // the network request initiated by the RaceNetworkRequest mode comes first. + EXPECT_EQ("[ServiceWorkerRaceNetworkRequest] Response from the network", + GetInnerText()); + + // The page should be marked as secure. + CheckPageIsMarkedSecure(shell(), https_server()->GetCertificate()); +} + +IN_PROC_BROWSER_TEST_F(ServiceWorkerRaceNetworkRequestBrowserTest, + NetworkRequest_Wins_MimeTypeSniffed) { + // Register the ServiceWorker and navigate to the in scope URL. + StartServerAndNavigateToSetup(); + + { + const GURL test_url = embedded_test_server()->GetURL( + "/service_worker/mock_response?sw_slow&sw_respond"); + NavigationHandleObserver observer1(web_contents(), test_url); + NavigateToURLBlockUntilNavigationsComplete(shell(), test_url, 1); + EXPECT_TRUE(observer1.has_committed()); + // Check MIME type as axpected. + EXPECT_EQ(shell()->web_contents()->GetContentsMimeType(), "text/plain"); + } + { + // server_unknown_mime_type doesn't content-type from server. + const GURL test_url = embedded_test_server()->GetURL( + "/service_worker/" + "mock_response?sw_slow&sw_respond&server_unknown_mime_type"); + NavigationHandleObserver observer2(web_contents(), test_url); + NavigateToURLBlockUntilNavigationsComplete(shell(), test_url, 1); + EXPECT_TRUE(observer2.has_committed()); + // RaceNetworkRequset enables kURLLoadOptionSniffMimeType in URLLoader + // options, so the mime type is sniffed from the response body. + EXPECT_EQ(shell()->web_contents()->GetContentsMimeType(), "text/plain"); + } + + // ServiceWorker will respond after the delay, so we expect the response from + // the network request initiated by the RaceNetworkRequest mode comes first. + EXPECT_EQ("[ServiceWorkerRaceNetworkRequest] Response from the network", + GetInnerText()); +} + +IN_PROC_BROWSER_TEST_F(ServiceWorkerRaceNetworkRequestBrowserTest, NetworkRequest_Wins_Fetch_No_Respond) { // Register the ServiceWorker and navigate to the in scope URL. SetupAndRegisterServiceWorker(); @@ -5473,6 +5546,8 @@ EXPECT_EQ("[ServiceWorkerRaceNetworkRequest] Response from the network", GetInnerText()); } +// TODO(crbug.com/1491332) Add tests for +// kURLLoadOptionSendSSLInfoForCertificateError IN_PROC_BROWSER_TEST_F(ServiceWorkerRaceNetworkRequestBrowserTest, NetworkRequest_Wins_NotFound_FetchHandler_Respond) {
diff --git a/content/browser/service_worker/service_worker_main_resource_loader.cc b/content/browser/service_worker/service_worker_main_resource_loader.cc index 3b06133..cd31542 100644 --- a/content/browser/service_worker/service_worker_main_resource_loader.cc +++ b/content/browser/service_worker/service_worker_main_resource_loader.cc
@@ -20,6 +20,7 @@ #include "base/time/time.h" #include "base/trace_event/common/trace_event_common.h" #include "base/trace_event/trace_event.h" +#include "content/browser/loader/navigation_url_loader.h" #include "content/browser/service_worker/service_worker_container_host.h" #include "content/browser/service_worker/service_worker_context_core.h" #include "content/browser/service_worker/service_worker_context_wrapper.h" @@ -536,8 +537,12 @@ forwarded_race_network_request_url_loader_factory_ ->InitURLLoaderNewPipeAndPassReceiver(), GlobalRequestID::MakeBrowserInitiated().request_id, - network::mojom::kURLLoadOptionNone, resource_request_, - std::move(client_to_pass), + // Since RaceNetworkRequest may not involve the fetch handler for the + // navigation, requests SSLInfo here to be attached with the response. + // This is required to show the HTTPS padlock by the browser. + NavigationURLLoader::GetURLLoaderOptions( + resource_request_.is_outermost_main_frame), + resource_request_, std::move(client_to_pass), net::MutableNetworkTrafficAnnotationTag( ServiceWorkerRaceNetworkRequestURLLoaderClient:: NetworkTrafficAnnotationTag()));
diff --git a/content/child/runtime_features.cc b/content/child/runtime_features.cc index 1bb8795..47cad00 100644 --- a/content/child/runtime_features.cc +++ b/content/child/runtime_features.cc
@@ -218,7 +218,6 @@ {wf::EnableDevicePosture, raw_ref(features::kDevicePosture)}, {wf::EnableDigitalGoods, raw_ref(features::kDigitalGoodsApi), kSetOnlyIfOverridden}, - {wf::EnableDirectSockets, raw_ref(features::kIsolatedWebApps)}, {wf::EnableDocumentPolicy, raw_ref(features::kDocumentPolicy)}, {wf::EnableDocumentPolicyNegotiation, raw_ref(features::kDocumentPolicyNegotiation)},
diff --git a/content/common/service_worker/service_worker_router_evaluator_unittest.cc b/content/common/service_worker/service_worker_router_evaluator_unittest.cc index 719cd48..04cd09a 100644 --- a/content/common/service_worker/service_worker_router_evaluator_unittest.cc +++ b/content/common/service_worker/service_worker_router_evaluator_unittest.cc
@@ -7,6 +7,7 @@ #include "base/strings/string_piece.h" #include "testing/gtest/include/gtest/gtest.h" +#include "third_party/blink/public/common/service_worker/embedded_worker_status.h" #include "third_party/blink/public/common/service_worker/service_worker_router_rule.h" #include "third_party/liburlpattern/parse.h" #include "third_party/liburlpattern/pattern.h" @@ -1036,6 +1037,151 @@ } } +TEST(ServiceWorkerRouterEvaluator, EmptyOrConditionAlwaysUnMatch) { + blink::ServiceWorkerRouterRules rules; + { + blink::ServiceWorkerRouterRule rule; + { + blink::ServiceWorkerRouterCondition condition; + condition.type = blink::ServiceWorkerRouterCondition::Type::kOr; + condition.or_condition.emplace(); + rule.conditions.push_back(condition); + } + { + blink::ServiceWorkerRouterSource source; + source.type = blink::ServiceWorkerRouterSource::Type::kNetwork; + source.network_source.emplace(); + rule.sources.push_back(source); + } + rules.rules.push_back(rule); + } + ASSERT_EQ(1U, rules.rules.size()); + + ServiceWorkerRouterEvaluator evaluator(rules); + ASSERT_EQ(1U, evaluator.rules().rules.size()); + EXPECT_TRUE(evaluator.IsValid()); + EXPECT_FALSE(evaluator.need_running_status()); + + { + network::ResourceRequest request; + request.method = "GET"; + request.url = GURL("https://example.com/"); + const auto sources = evaluator.EvaluateWithoutRunningStatus(request); + EXPECT_EQ(0U, sources.size()); + } + { + network::ResourceRequest request; + request.method = "POST"; + request.url = GURL("https://example.com/"); + const auto sources = evaluator.EvaluateWithoutRunningStatus(request); + EXPECT_EQ(0U, sources.size()); + } + { + network::ResourceRequest request; + request.method = "GET"; + request.url = GURL("https://example.com/"); + const auto sources = + evaluator.Evaluate(request, blink::EmbeddedWorkerStatus::kRunning); + EXPECT_EQ(0U, sources.size()); + } +} + +TEST(ServiceWorkerRouterEvaluator, OrConditionMatch) { + blink::ServiceWorkerRouterRules rules; + { + blink::ServiceWorkerRouterRule rule; + { + blink::ServiceWorkerRouterCondition outer; + outer.type = blink::ServiceWorkerRouterCondition::Type::kOr; + outer.or_condition.emplace(); + { + blink::ServiceWorkerRouterCondition inner; + inner.type = blink::ServiceWorkerRouterCondition::Type::kOr; + { + blink::ServiceWorkerRouterCondition condition; + condition.type = + blink::ServiceWorkerRouterCondition::Type::kRunningStatus; + blink::ServiceWorkerRouterRunningStatusCondition running_status; + running_status.status = + blink::ServiceWorkerRouterRunningStatusCondition:: + RunningStatusEnum::kRunning; + condition.running_status = running_status; + + blink::ServiceWorkerRouterConditionObject inner_object; + inner_object.conditions.push_back(std::move(condition)); + + inner.or_condition.emplace(std::vector(1, std::move(inner_object))); + } + blink::ServiceWorkerRouterConditionObject outer_object{ + std::vector(1, std::move(inner))}; + outer.or_condition->objects.push_back(std::move(outer_object)); + } + { + blink::ServiceWorkerRouterCondition condition; + condition.type = blink::ServiceWorkerRouterCondition::Type::kUrlPattern; + blink::SafeUrlPattern url_pattern = DefaultURLPattern(); + auto parse_result = liburlpattern::Parse( + "/test/page.html", + [](base::StringPiece input) { return std::string(input); }); + ASSERT_TRUE(parse_result.ok()); + url_pattern.pathname = parse_result.value().PartList(); + condition.url_pattern = url_pattern; + blink::ServiceWorkerRouterConditionObject outer_object{ + std::vector(1, std::move(condition))}; + outer.or_condition->objects.push_back(std::move(outer_object)); + } + + rule.conditions.push_back(outer); + } + { + blink::ServiceWorkerRouterSource source; + source.type = blink::ServiceWorkerRouterSource::Type::kNetwork; + source.network_source.emplace(); + rule.sources.push_back(source); + } + rules.rules.push_back(rule); + } + ASSERT_EQ(1U, rules.rules.size()); + + ServiceWorkerRouterEvaluator evaluator(rules); + ASSERT_EQ(1U, evaluator.rules().rules.size()); + EXPECT_TRUE(evaluator.IsValid()); + EXPECT_TRUE(evaluator.need_running_status()); + + { + network::ResourceRequest request; + request.method = "GET"; + request.url = GURL("https://example.com/"); + const auto sources = + evaluator.Evaluate(request, blink::EmbeddedWorkerStatus::kRunning); + EXPECT_EQ(1U, sources.size()); + } + { + network::ResourceRequest request; + request.method = "GET"; + request.url = GURL("https://example.com/"); + const auto sources = + evaluator.Evaluate(request, blink::EmbeddedWorkerStatus::kStopped); + EXPECT_EQ(0U, sources.size()); + } + { + network::ResourceRequest request; + request.method = "GET"; + request.url = GURL("https://www.example.com/test/page.html"); + const auto sources = + evaluator.Evaluate(request, blink::EmbeddedWorkerStatus::kStopped); + EXPECT_EQ(1U, sources.size()); + } + { + network::ResourceRequest request; + request.method = "GET"; + request.url = GURL("https://www.example.com/test/page.html"); + const auto sources = + evaluator.Evaluate(request, blink::EmbeddedWorkerStatus::kRunning); + EXPECT_EQ(1U, sources.size()); + } +} + TEST(ServiceWorkerRouterEvaluator, ToValueEmptyRule) { blink::ServiceWorkerRouterRules rules; ServiceWorkerRouterEvaluator evaluator(rules);
diff --git a/content/public/common/content_features.h b/content/public/common/content_features.h index 8a37f93..270111aa 100644 --- a/content/public/common/content_features.h +++ b/content/public/common/content_features.h
@@ -114,7 +114,9 @@ CONTENT_EXPORT BASE_DECLARE_FEATURE(kIdleDetection); CONTENT_EXPORT BASE_DECLARE_FEATURE(kInstalledApp); CONTENT_EXPORT BASE_DECLARE_FEATURE(kInstalledAppProvider); +// LINT.IfChange CONTENT_EXPORT BASE_DECLARE_FEATURE(kIsolatedWebApps); +// LINT.ThenChange(//PRESUBMIT.py) CONTENT_EXPORT BASE_DECLARE_FEATURE(kIsolateFencedFrames); CONTENT_EXPORT BASE_DECLARE_FEATURE(kIsolateOrigins); CONTENT_EXPORT extern const char kIsolateOriginsFieldTrialParamName[];
diff --git a/content/shell/browser/shell_content_browser_client.cc b/content/shell/browser/shell_content_browser_client.cc index 47ae2a0..93e95cb9 100644 --- a/content/shell/browser/shell_content_browser_client.cc +++ b/content/shell/browser/shell_content_browser_client.cc
@@ -299,6 +299,10 @@ return pref_service_factory.Create(pref_registry); } +bool AreIsolatedWebAppsEnabled() { + return base::FeatureList::IsEnabled(features::kIsolatedWebApps); +} + } // namespace std::string GetShellLanguage() { @@ -397,6 +401,11 @@ return false; } +bool ShellContentBrowserClient::AreIsolatedWebAppsEnabled( + BrowserContext* browser_context) { + return ::content::AreIsolatedWebAppsEnabled(); +} + void ShellContentBrowserClient::AppendExtraCommandLineSwitches( base::CommandLine* command_line, int child_process_id) { @@ -429,6 +438,12 @@ } } #endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) + + if (command_line->GetSwitchValueASCII(switches::kProcessType) == + switches::kRendererProcess && + ::content::AreIsolatedWebAppsEnabled()) { + command_line->AppendSwitch(switches::kEnableIsolatedWebAppsInRenderer); + } } device::GeolocationManager* ShellContentBrowserClient::GetGeolocationManager() {
diff --git a/content/shell/browser/shell_content_browser_client.h b/content/shell/browser/shell_content_browser_client.h index b33300b..950e82c 100644 --- a/content/shell/browser/shell_content_browser_client.h +++ b/content/shell/browser/shell_content_browser_client.h
@@ -59,6 +59,7 @@ const base::RepeatingCallback<WebContents*()>& wc_getter, NavigationUIData* navigation_ui_data, int frame_tree_node_id) override; + bool AreIsolatedWebAppsEnabled(BrowserContext* browser_context) override; void AppendExtraCommandLineSwitches(base::CommandLine* command_line, int child_process_id) override; std::string GetAcceptLangs(BrowserContext* context) override;
diff --git a/device/vr/test/fake_sensor_provider.h b/device/vr/test/fake_sensor_provider.h index 1af283c..683dd46 100644 --- a/device/vr/test/fake_sensor_provider.h +++ b/device/vr/test/fake_sensor_provider.h
@@ -21,9 +21,26 @@ ~FakeXRSensorProvider() override; void Bind(mojo::PendingReceiver<mojom::SensorProvider> receiver); - void GetSensor(mojom::SensorType type, GetSensorCallback callback) override; void CallCallback(mojom::SensorInitParamsPtr param); + // device::mojom::SensorProvider overrides. + void GetSensor(mojom::SensorType type, GetSensorCallback callback) override; + void CreateVirtualSensor( + mojom::SensorType type, + mojom::VirtualSensorMetadataPtr metadata, + mojom::SensorProvider::CreateVirtualSensorCallback callback) override {} + void UpdateVirtualSensor( + mojom::SensorType type, + const SensorReading& reading, + mojom::SensorProvider::UpdateVirtualSensorCallback callback) override {} + void RemoveVirtualSensor( + mojom::SensorType type, + mojom::SensorProvider::RemoveVirtualSensorCallback callback) override {} + void GetVirtualSensorInformation( + mojom::SensorType type, + mojom::SensorProvider::GetVirtualSensorInformationCallback callback) + override {} + private: mojo::Receiver<mojom::SensorProvider> receiver_{this}; GetSensorCallback callback_;
diff --git a/docs/website b/docs/website index 729b7e9..6b457cc 160000 --- a/docs/website +++ b/docs/website
@@ -1 +1 @@ -Subproject commit 729b7e9744581b96bf9a8dfea8b4e34c19c3bb10 +Subproject commit 6b457cc0681ddb8bbdd0f874e9fce8312a50a5c7
diff --git a/infra/config/generated/builders/goma/Chromium Android ARM 32-bit Goma RBE Staging/properties.json b/infra/config/generated/builders/goma/Chromium Android ARM 32-bit Goma RBE Staging/properties.json deleted file mode 100644 index 258f6f3..0000000 --- a/infra/config/generated/builders/goma/Chromium Android ARM 32-bit Goma RBE Staging/properties.json +++ /dev/null
@@ -1,59 +0,0 @@ -{ - "$build/chromium_tests_builder_config": { - "builder_config": { - "builder_db": { - "entries": [ - { - "builder_id": { - "bucket": "goma", - "builder": "Chromium Android ARM 32-bit Goma RBE Staging", - "project": "chromium" - }, - "builder_spec": { - "builder_group": "chromium.goma", - "execution_mode": "COMPILE_AND_TEST", - "legacy_android_config": { - "config": "main_builder_mb" - }, - "legacy_chromium_config": { - "apply_configs": [ - "goma_failfast" - ], - "config": "chromium", - "target_bits": 32, - "target_platform": "android" - }, - "legacy_gclient_config": { - "apply_configs": [ - "android" - ], - "config": "chromium" - } - } - } - ] - }, - "builder_ids": [ - { - "bucket": "goma", - "builder": "Chromium Android ARM 32-bit Goma RBE Staging", - "project": "chromium" - } - ] - } - }, - "$build/goma": { - "enable_ats": true, - "rpc_extra_params": "?staging", - "server_host": "staging-goma.chromium.org" - }, - "$recipe_engine/resultdb/test_presentation": { - "column_keys": [], - "grouping_keys": [ - "status", - "v.test_suite" - ] - }, - "builder_group": "chromium.goma", - "recipe": "chromium" -} \ No newline at end of file
diff --git a/infra/config/generated/builders/goma/android-archive-dbg-goma-rbe-ats-canary/properties.json b/infra/config/generated/builders/goma/android-archive-dbg-goma-rbe-ats-canary/properties.json deleted file mode 100644 index 458c643..0000000 --- a/infra/config/generated/builders/goma/android-archive-dbg-goma-rbe-ats-canary/properties.json +++ /dev/null
@@ -1,63 +0,0 @@ -{ - "$build/chromium_tests_builder_config": { - "builder_config": { - "builder_db": { - "entries": [ - { - "builder_id": { - "bucket": "goma", - "builder": "android-archive-dbg-goma-rbe-ats-canary", - "project": "chromium" - }, - "builder_spec": { - "build_gs_bucket": "chromium-fyi-archive", - "builder_group": "chromium.goma.fyi", - "execution_mode": "COMPILE_AND_TEST", - "legacy_android_config": { - "config": "main_builder" - }, - "legacy_chromium_config": { - "apply_configs": [ - "mb", - "download_xr_test_apks", - "goma_canary" - ], - "build_config": "Debug", - "config": "android", - "target_bits": 32, - "target_platform": "android" - }, - "legacy_gclient_config": { - "apply_configs": [ - "android" - ], - "config": "chromium" - } - } - } - ] - }, - "builder_ids": [ - { - "bucket": "goma", - "builder": "android-archive-dbg-goma-rbe-ats-canary", - "project": "chromium" - } - ] - } - }, - "$build/goma": { - "enable_ats": true, - "rpc_extra_params": "?prod", - "server_host": "goma.chromium.org" - }, - "$recipe_engine/resultdb/test_presentation": { - "column_keys": [], - "grouping_keys": [ - "status", - "v.test_suite" - ] - }, - "builder_group": "chromium.goma.fyi", - "recipe": "chromium" -} \ No newline at end of file
diff --git a/infra/config/generated/builders/goma/android-archive-dbg-goma-rbe-canary/properties.json b/infra/config/generated/builders/goma/android-archive-dbg-goma-rbe-canary/properties.json deleted file mode 100644 index 0c047e0..0000000 --- a/infra/config/generated/builders/goma/android-archive-dbg-goma-rbe-canary/properties.json +++ /dev/null
@@ -1,63 +0,0 @@ -{ - "$build/chromium_tests_builder_config": { - "builder_config": { - "builder_db": { - "entries": [ - { - "builder_id": { - "bucket": "goma", - "builder": "android-archive-dbg-goma-rbe-canary", - "project": "chromium" - }, - "builder_spec": { - "build_gs_bucket": "chromium-fyi-archive", - "builder_group": "chromium.goma.fyi", - "execution_mode": "COMPILE_AND_TEST", - "legacy_android_config": { - "config": "main_builder" - }, - "legacy_chromium_config": { - "apply_configs": [ - "mb", - "download_xr_test_apks", - "goma_canary" - ], - "build_config": "Debug", - "config": "android", - "target_bits": 32, - "target_platform": "android" - }, - "legacy_gclient_config": { - "apply_configs": [ - "android" - ], - "config": "chromium" - } - } - } - ] - }, - "builder_ids": [ - { - "bucket": "goma", - "builder": "android-archive-dbg-goma-rbe-canary", - "project": "chromium" - } - ] - } - }, - "$build/goma": { - "enable_ats": true, - "rpc_extra_params": "?prod", - "server_host": "goma.chromium.org" - }, - "$recipe_engine/resultdb/test_presentation": { - "column_keys": [], - "grouping_keys": [ - "status", - "v.test_suite" - ] - }, - "builder_group": "chromium.goma.fyi", - "recipe": "chromium" -} \ No newline at end of file
diff --git a/infra/config/generated/luci/cr-buildbucket.cfg b/infra/config/generated/luci/cr-buildbucket.cfg index ca854ea..84b7d8a 100644 --- a/infra/config/generated/luci/cr-buildbucket.cfg +++ b/infra/config/generated/luci/cr-buildbucket.cfg
@@ -57591,55 +57591,6 @@ name: "goma" swarming { builders { - name: "Chromium Android ARM 32-bit Goma RBE Staging" - swarming_host: "chromium-swarm.appspot.com" - dimensions: "builder:Chromium Android ARM 32-bit Goma RBE Staging" - dimensions: "cores:8" - dimensions: "cpu:x86-64" - dimensions: "os:Ubuntu-22.04" - dimensions: "pool:luci.chromium.ci" - exe { - cipd_package: "infra/chromium/bootstrapper/${platform}" - cipd_version: "latest" - cmd: "bootstrapper" - } - properties: - '{' - ' "$bootstrap/exe": {' - ' "exe": {' - ' "cipd_package": "infra/recipe_bundles/chromium.googlesource.com/chromium/tools/build",' - ' "cipd_version": "refs/heads/main",' - ' "cmd": [' - ' "luciexe"' - ' ]' - ' }' - ' },' - ' "$bootstrap/properties": {' - ' "properties_file": "infra/config/generated/builders/goma/Chromium Android ARM 32-bit Goma RBE Staging/properties.json",' - ' "top_level_project": {' - ' "ref": "refs/heads/main",' - ' "repo": {' - ' "host": "chromium.googlesource.com",' - ' "project": "chromium/src"' - ' }' - ' }' - ' },' - ' "builder_group": "chromium.goma",' - ' "led_builder_is_bootstrapped": true,' - ' "recipe": "chromium"' - '}' - execution_timeout_secs: 18000 - build_numbers: YES - service_account: "goma-release-testing@chops-service-accounts.iam.gserviceaccount.com" - experiments { - key: "luci.recipes.use_python3" - value: 100 - } - resultdb { - enable: true - } - } - builders { name: "Chromium Linux Goma RBE Staging" swarming_host: "chromium-swarm.appspot.com" dimensions: "builder:Chromium Linux Goma RBE Staging" @@ -58275,108 +58226,6 @@ } } builders { - name: "android-archive-dbg-goma-rbe-ats-canary" - swarming_host: "chromium-swarm.appspot.com" - dimensions: "builderless:1" - dimensions: "cores:8" - dimensions: "cpu:x86-64" - dimensions: "free_space:standard" - dimensions: "os:Ubuntu-22.04" - dimensions: "pool:luci.chromium.ci" - dimensions: "ssd:0" - exe { - cipd_package: "infra/chromium/bootstrapper/${platform}" - cipd_version: "latest" - cmd: "bootstrapper" - } - properties: - '{' - ' "$bootstrap/exe": {' - ' "exe": {' - ' "cipd_package": "infra/recipe_bundles/chromium.googlesource.com/chromium/tools/build",' - ' "cipd_version": "refs/heads/main",' - ' "cmd": [' - ' "luciexe"' - ' ]' - ' }' - ' },' - ' "$bootstrap/properties": {' - ' "properties_file": "infra/config/generated/builders/goma/android-archive-dbg-goma-rbe-ats-canary/properties.json",' - ' "top_level_project": {' - ' "ref": "refs/heads/main",' - ' "repo": {' - ' "host": "chromium.googlesource.com",' - ' "project": "chromium/src"' - ' }' - ' }' - ' },' - ' "builder_group": "chromium.goma.fyi",' - ' "led_builder_is_bootstrapped": true,' - ' "recipe": "chromium"' - '}' - execution_timeout_secs: 36000 - build_numbers: YES - service_account: "goma-release-testing@chops-service-accounts.iam.gserviceaccount.com" - experiments { - key: "luci.recipes.use_python3" - value: 100 - } - resultdb { - enable: true - } - } - builders { - name: "android-archive-dbg-goma-rbe-canary" - swarming_host: "chromium-swarm.appspot.com" - dimensions: "builderless:1" - dimensions: "cores:8" - dimensions: "cpu:x86-64" - dimensions: "free_space:standard" - dimensions: "os:Ubuntu-22.04" - dimensions: "pool:luci.chromium.ci" - dimensions: "ssd:0" - exe { - cipd_package: "infra/chromium/bootstrapper/${platform}" - cipd_version: "latest" - cmd: "bootstrapper" - } - properties: - '{' - ' "$bootstrap/exe": {' - ' "exe": {' - ' "cipd_package": "infra/recipe_bundles/chromium.googlesource.com/chromium/tools/build",' - ' "cipd_version": "refs/heads/main",' - ' "cmd": [' - ' "luciexe"' - ' ]' - ' }' - ' },' - ' "$bootstrap/properties": {' - ' "properties_file": "infra/config/generated/builders/goma/android-archive-dbg-goma-rbe-canary/properties.json",' - ' "top_level_project": {' - ' "ref": "refs/heads/main",' - ' "repo": {' - ' "host": "chromium.googlesource.com",' - ' "project": "chromium/src"' - ' }' - ' }' - ' },' - ' "builder_group": "chromium.goma.fyi",' - ' "led_builder_is_bootstrapped": true,' - ' "recipe": "chromium"' - '}' - execution_timeout_secs: 36000 - build_numbers: YES - service_account: "goma-release-testing@chops-service-accounts.iam.gserviceaccount.com" - experiments { - key: "luci.recipes.use_python3" - value: 100 - } - resultdb { - enable: true - } - } - builders { name: "chromeos-amd64-generic-rel-goma-rbe-canary" swarming_host: "chromium-swarm.appspot.com" dimensions: "builderless:1"
diff --git a/infra/config/generated/luci/luci-milo.cfg b/infra/config/generated/luci/luci-milo.cfg index c02904c..afbaae6 100644 --- a/infra/config/generated/luci/luci-milo.cfg +++ b/infra/config/generated/luci/luci-milo.cfg
@@ -10041,10 +10041,6 @@ short_name: "ats" } builders { - name: "buildbucket/luci.chromium.goma/Chromium Android ARM 32-bit Goma RBE Staging" - category: "rbe|staging|android arm|rel" - } - builders { name: "buildbucket/luci.chromium.goma/chromeos-amd64-generic-rel-goma-rbe-staging" category: "rbe|staging|cros|rel" } @@ -10416,15 +10412,6 @@ category: "rbe|cros|rel" } builders { - name: "buildbucket/luci.chromium.goma/android-archive-dbg-goma-rbe-canary" - category: "rbe|android|dbg" - } - builders { - name: "buildbucket/luci.chromium.goma/android-archive-dbg-goma-rbe-ats-canary" - category: "rbe|android|dbg" - short_name: "ats" - } - builders { name: "buildbucket/luci.chromium.goma/mac-archive-rel-goma-rbe-canary" category: "rbe|mac|rel" short_name: "clb"
diff --git a/infra/config/generated/luci/luci-scheduler.cfg b/infra/config/generated/luci/luci-scheduler.cfg index e13b3d2..5676722 100644 --- a/infra/config/generated/luci/luci-scheduler.cfg +++ b/infra/config/generated/luci/luci-scheduler.cfg
@@ -351,15 +351,6 @@ } } job { - id: "Chromium Android ARM 32-bit Goma RBE Staging" - realm: "goma" - buildbucket { - server: "cr-buildbucket.appspot.com" - bucket: "goma" - builder: "Chromium Android ARM 32-bit Goma RBE Staging" - } -} -job { id: "Chromium Linux Goma RBE Staging" realm: "goma" buildbucket { @@ -3284,24 +3275,6 @@ } } job { - id: "android-archive-dbg-goma-rbe-ats-canary" - realm: "goma" - buildbucket { - server: "cr-buildbucket.appspot.com" - bucket: "goma" - builder: "android-archive-dbg-goma-rbe-ats-canary" - } -} -job { - id: "android-archive-dbg-goma-rbe-canary" - realm: "goma" - buildbucket { - server: "cr-buildbucket.appspot.com" - bucket: "goma" - builder: "android-archive-dbg-goma-rbe-canary" - } -} -job { id: "android-archive-rel" realm: "ci" buildbucket { @@ -6609,7 +6582,6 @@ triggers: "win32-official" triggers: "win32-updater-builder-dbg" triggers: "win32-updater-builder-rel" - triggers: "Chromium Android ARM 32-bit Goma RBE Staging" triggers: "Chromium Linux Goma RBE Staging" triggers: "Chromium Linux Goma RBE Staging (dbg)" triggers: "Chromium Mac Goma RBE Staging" @@ -6623,8 +6595,6 @@ triggers: "Win Builder (dbg) Goma RBE Canary" triggers: "Win Builder Goma RBE ATS Canary" triggers: "Win Builder Goma RBE Canary" - triggers: "android-archive-dbg-goma-rbe-ats-canary" - triggers: "android-archive-dbg-goma-rbe-canary" triggers: "chromeos-amd64-generic-rel-goma-rbe-canary" triggers: "chromeos-amd64-generic-rel-goma-rbe-staging" triggers: "ios-device-goma-rbe-canary-clobber"
diff --git a/infra/config/generated/testing/gn_isolate_map.pyl b/infra/config/generated/testing/gn_isolate_map.pyl index 8534d94..bce888e 100644 --- a/infra/config/generated/testing/gn_isolate_map.pyl +++ b/infra/config/generated/testing/gn_isolate_map.pyl
@@ -446,10 +446,6 @@ "--log-path=${ISOLATED_OUTDIR}/chromedriver.log", ], }, - "chromedriver_webview_shell_apk": { - "label": "//chrome/test/chromedriver/test/webview_shell:chromedriver_webview_shell_apk", - "type": "additional_compile_target", - }, "chromeos_integration_tests": { "label": "//chrome/test:chromeos_integration_tests", "type": "windowed_test_launcher",
diff --git a/infra/config/generated/testing/test_suites.pyl b/infra/config/generated/testing/test_suites.pyl index 5a94335..8d5a3cc 100644 --- a/infra/config/generated/testing/test_suites.pyl +++ b/infra/config/generated/testing/test_suites.pyl
@@ -5999,7 +5999,7 @@ 'chromium_gtests_for_linux_and_mac_only', 'mac_specific_chromium_gtests', 'non_android_and_cast_and_chromeos_chromium_gtests', - 'non_android_chromium_gtests', + 'non_android_chromium_gtests_no_nacl', ], 'chromium_mac_gtests_no_nacl': [ @@ -6060,7 +6060,7 @@ 'cr23_pixel_browser_tests_gtests', 'fieldtrial_browser_tests', 'non_android_and_cast_and_chromeos_chromium_gtests', - 'non_android_chromium_gtests', + 'non_android_chromium_gtests_no_nacl', 'non_android_chromium_gtests_skia_gold', 'pixel_browser_tests_gtests', 'vr_platform_specific_chromium_gtests', @@ -6076,7 +6076,7 @@ 'cr23_win_gtests', 'fieldtrial_browser_tests', 'non_android_and_cast_and_chromeos_chromium_gtests', - 'non_android_chromium_gtests', + 'non_android_chromium_gtests_no_nacl', 'non_android_chromium_gtests_skia_gold', 'pixel_browser_tests_gtests', 'vr_platform_specific_chromium_gtests', @@ -6097,7 +6097,7 @@ 'chromium_gtests_for_devices_with_graphical_output', 'chromium_gtests_for_win_and_linux_only', 'non_android_and_cast_and_chromeos_chromium_gtests', - 'non_android_chromium_gtests', + 'non_android_chromium_gtests_no_nacl', 'vr_platform_specific_chromium_gtests', 'win_specific_chromium_gtests', ],
diff --git a/infra/config/generated/testing/variants.pyl b/infra/config/generated/testing/variants.pyl index 5382e28..ac4b64e 100644 --- a/infra/config/generated/testing/variants.pyl +++ b/infra/config/generated/testing/variants.pyl
@@ -70,16 +70,16 @@ }, 'LACROS_VERSION_SKEW_CANARY': { 'identifier': 'Lacros version skew testing ash canary', - 'description': 'Run with ash-chrome version 120.0.6061.0', + 'description': 'Run with ash-chrome version 120.0.6062.0', 'args': [ - '--ash-chrome-path-override=../../lacros_version_skew_tests_v120.0.6061.0/test_ash_chrome', + '--ash-chrome-path-override=../../lacros_version_skew_tests_v120.0.6062.0/test_ash_chrome', ], 'swarming': { 'cipd_packages': [ { 'cipd_package': 'chromium/testing/linux-ash-chromium/x86_64/ash.zip', - 'location': 'lacros_version_skew_tests_v120.0.6061.0', - 'revision': 'version:120.0.6061.0', + 'location': 'lacros_version_skew_tests_v120.0.6062.0', + 'revision': 'version:120.0.6062.0', }, ], },
diff --git a/infra/config/lib/builder_health_indicators.star b/infra/config/lib/builder_health_indicators.star index c2cda75..7c24c77 100644 --- a/infra/config/lib/builder_health_indicators.star +++ b/infra/config/lib/builder_health_indicators.star
@@ -936,7 +936,6 @@ "runner", ], "goma": [ - "Chromium Android ARM 32-bit Goma RBE Staging", "Chromium Linux Goma RBE Staging (dbg)", "Chromium Linux Goma RBE Staging", "Chromium Mac Goma RBE Staging (dbg)", @@ -950,8 +949,6 @@ "Win Builder (dbg) Goma RBE Canary", "Win Builder Goma RBE ATS Canary", "Win Builder Goma RBE Canary", - "android-archive-dbg-goma-rbe-ats-canary", - "android-archive-dbg-goma-rbe-canary", "chromeos-amd64-generic-rel-goma-rbe-canary", "chromeos-amd64-generic-rel-goma-rbe-staging", "ios-device-goma-rbe-canary-clobber",
diff --git a/infra/config/subprojects/goma/consoles/chromium.goma.fyi.star b/infra/config/subprojects/goma/consoles/chromium.goma.fyi.star index 44e05c3..8503a2b 100644 --- a/infra/config/subprojects/goma/consoles/chromium.goma.fyi.star +++ b/infra/config/subprojects/goma/consoles/chromium.goma.fyi.star
@@ -28,15 +28,6 @@ category = "rbe|cros|rel", ), luci.console_view_entry( - builder = "goma/android-archive-dbg-goma-rbe-canary", - category = "rbe|android|dbg", - ), - luci.console_view_entry( - builder = "goma/android-archive-dbg-goma-rbe-ats-canary", - category = "rbe|android|dbg", - short_name = "ats", - ), - luci.console_view_entry( builder = "goma/mac-archive-rel-goma-rbe-canary", category = "rbe|mac|rel", short_name = "clb",
diff --git a/infra/config/subprojects/goma/consoles/chromium.goma.star b/infra/config/subprojects/goma/consoles/chromium.goma.star index df384591..d358fd9 100644 --- a/infra/config/subprojects/goma/consoles/chromium.goma.star +++ b/infra/config/subprojects/goma/consoles/chromium.goma.star
@@ -35,10 +35,6 @@ short_name = "ats", ), luci.console_view_entry( - builder = "goma/Chromium Android ARM 32-bit Goma RBE Staging", - category = "rbe|staging|android arm|rel", - ), - luci.console_view_entry( builder = "goma/chromeos-amd64-generic-rel-goma-rbe-staging", category = "rbe|staging|cros|rel", ),
diff --git a/infra/config/subprojects/goma/goma.star b/infra/config/subprojects/goma/goma.star index 97e08797..21ce97efc 100644 --- a/infra/config/subprojects/goma/goma.star +++ b/infra/config/subprojects/goma/goma.star
@@ -125,53 +125,6 @@ ) fyi_goma_rbe_canary_builder( - name = "android-archive-dbg-goma-rbe-ats-canary", - builder_spec = builder_config.builder_spec( - gclient_config = builder_config.gclient_config( - config = "chromium", - apply_configs = ["android"], - ), - chromium_config = builder_config.chromium_config( - config = "android", - apply_configs = [ - "mb", - "download_xr_test_apks", - "goma_canary", - ], - build_config = builder_config.build_config.DEBUG, - target_bits = 32, - target_platform = builder_config.target_platform.ANDROID, - ), - android_config = builder_config.android_config(config = "main_builder"), - build_gs_bucket = "chromium-fyi-archive", - ), - goma_enable_ats = True, -) - -fyi_goma_rbe_canary_builder( - name = "android-archive-dbg-goma-rbe-canary", - builder_spec = builder_config.builder_spec( - gclient_config = builder_config.gclient_config( - config = "chromium", - apply_configs = ["android"], - ), - chromium_config = builder_config.chromium_config( - config = "android", - apply_configs = [ - "mb", - "download_xr_test_apks", - "goma_canary", - ], - build_config = builder_config.build_config.DEBUG, - target_bits = 32, - target_platform = builder_config.target_platform.ANDROID, - ), - android_config = builder_config.android_config(config = "main_builder"), - build_gs_bucket = "chromium-fyi-archive", - ), -) - -fyi_goma_rbe_canary_builder( name = "chromeos-amd64-generic-rel-goma-rbe-canary", builder_spec = builder_config.copy_from( "ci/chromeos-amd64-generic-rel", @@ -356,25 +309,6 @@ ) goma_builder( - name = "Chromium Android ARM 32-bit Goma RBE Staging", - builder_spec = builder_config.builder_spec( - gclient_config = builder_config.gclient_config( - config = "chromium", - apply_configs = ["android"], - ), - chromium_config = builder_config.chromium_config( - config = "chromium", - apply_configs = ["goma_failfast"], - target_bits = 32, - target_platform = builder_config.target_platform.ANDROID, - ), - android_config = builder_config.android_config(config = "main_builder_mb"), - ), - execution_timeout = 5 * time.hour, - goma_backend = goma.backend.RBE_STAGING, -) - -goma_builder( name = "Chromium Linux Goma RBE Staging", builder_spec = builder_config.builder_spec( gclient_config = builder_config.gclient_config(config = "chromium"),
diff --git a/infra/config/targets/compound_suites.star b/infra/config/targets/compound_suites.star index 21f61ff..0ca0123 100644 --- a/infra/config/targets/compound_suites.star +++ b/infra/config/targets/compound_suites.star
@@ -392,12 +392,14 @@ "chromium_gtests_for_linux_and_mac_only", "mac_specific_chromium_gtests", "non_android_and_cast_and_chromeos_chromium_gtests", - "non_android_chromium_gtests", + "non_android_chromium_gtests_no_nacl", ], ) # When changing something here, change # chromium_mac_gtests_no_nacl_once in the same way. +# TODO(b/303417958): This no_nacl suite is identical to the normal suite, since +# NaCl has been disabled on Mac. Replace this by the normal suite. targets.legacy_compound_suite( name = "chromium_mac_gtests_no_nacl", basic_suites = [ @@ -494,7 +496,7 @@ "cr23_pixel_browser_tests_gtests", "fieldtrial_browser_tests", "non_android_and_cast_and_chromeos_chromium_gtests", - "non_android_chromium_gtests", + "non_android_chromium_gtests_no_nacl", "non_android_chromium_gtests_skia_gold", "pixel_browser_tests_gtests", "vr_platform_specific_chromium_gtests", @@ -519,7 +521,7 @@ "cr23_win_gtests", "fieldtrial_browser_tests", "non_android_and_cast_and_chromeos_chromium_gtests", - "non_android_chromium_gtests", + "non_android_chromium_gtests_no_nacl", "non_android_chromium_gtests_skia_gold", "pixel_browser_tests_gtests", "vr_platform_specific_chromium_gtests", @@ -546,7 +548,7 @@ "chromium_gtests_for_devices_with_graphical_output", "chromium_gtests_for_win_and_linux_only", "non_android_and_cast_and_chromeos_chromium_gtests", - "non_android_chromium_gtests", + "non_android_chromium_gtests_no_nacl", "vr_platform_specific_chromium_gtests", "win_specific_chromium_gtests", ],
diff --git a/infra/config/targets/lacros-version-skew-variants.json b/infra/config/targets/lacros-version-skew-variants.json index a871f60..3cd7dc8 100644 --- a/infra/config/targets/lacros-version-skew-variants.json +++ b/infra/config/targets/lacros-version-skew-variants.json
@@ -1,16 +1,16 @@ { "LACROS_VERSION_SKEW_CANARY": { "args": [ - "--ash-chrome-path-override=../../lacros_version_skew_tests_v120.0.6061.0/test_ash_chrome" + "--ash-chrome-path-override=../../lacros_version_skew_tests_v120.0.6062.0/test_ash_chrome" ], - "description": "Run with ash-chrome version 120.0.6061.0", + "description": "Run with ash-chrome version 120.0.6062.0", "identifier": "Lacros version skew testing ash canary", "swarming": { "cipd_packages": [ { "cipd_package": "chromium/testing/linux-ash-chromium/x86_64/ash.zip", - "location": "lacros_version_skew_tests_v120.0.6061.0", - "revision": "version:120.0.6061.0" + "location": "lacros_version_skew_tests_v120.0.6062.0", + "revision": "version:120.0.6062.0" } ] }
diff --git a/infra/config/targets/targets.star b/infra/config/targets/targets.star index ef44687..edb9b63 100644 --- a/infra/config/targets/targets.star +++ b/infra/config/targets/targets.star
@@ -560,11 +560,6 @@ ], ) -targets.compile_target( - name = "chromedriver_webview_shell_apk", - label = "//chrome/test/chromedriver/test/webview_shell:chromedriver_webview_shell_apk", -) - targets.windowed_test_launcher( name = "chromeos_integration_tests", label = "//chrome/test:chromeos_integration_tests",
diff --git a/internal b/internal index 9c367de..7056b58b 160000 --- a/internal +++ b/internal
@@ -1 +1 @@ -Subproject commit 9c367def13a736fbfb43dcaf182aa1ee74c15f51 +Subproject commit 7056b58bd3f5af3896df93abd40a24e7fb713edc
diff --git a/ios/chrome/browser/flags/about_flags.mm b/ios/chrome/browser/flags/about_flags.mm index 987442e..4624f25 100644 --- a/ios/chrome/browser/flags/about_flags.mm +++ b/ios/chrome/browser/flags/about_flags.mm
@@ -1188,10 +1188,6 @@ flags_ui::kOsIos, FEATURE_VALUE_TYPE( feature_engagement::kIPHPriceNotificationsWhileBrowsingFeature)}, - {"omnibox-multiline-search-suggest", - flag_descriptions::kOmniboxMultilineSearchSuggestName, - flag_descriptions::kOmniboxMultilineSearchSuggestDescription, - flags_ui::kOsIos, FEATURE_VALUE_TYPE(kOmniboxMultilineSearchSuggest)}, {"autofill-suggest-server-card-instead-of-local-card", flag_descriptions::kAutofillSuggestServerCardInsteadOfLocalCardName, flag_descriptions::kAutofillSuggestServerCardInsteadOfLocalCardDescription, @@ -1201,10 +1197,6 @@ {"ios-password-checkup", flag_descriptions::kIOSPasswordCheckupName, flag_descriptions::kIOSPasswordCheckupDescription, flags_ui::kOsIos, FEATURE_VALUE_TYPE(password_manager::features::kIOSPasswordCheckup)}, - {"multiline-fade-truncating-label", - flag_descriptions::kMultilineFadeTruncatingLabelName, - flag_descriptions::kMultilineFadeTruncatingLabelDescription, - flags_ui::kOsIos, FEATURE_VALUE_TYPE(kMultilineFadeTruncatingLabel)}, {"promos-manager-uses-fet", flag_descriptions::kPromosManagerUsesFETName, flag_descriptions::kPromosManagerUsesFETDescription, flags_ui::kOsIos, FEATURE_VALUE_TYPE(kPromosManagerUsesFET)},
diff --git a/ios/chrome/browser/flags/ios_chrome_flag_descriptions.cc b/ios/chrome/browser/flags/ios_chrome_flag_descriptions.cc index f540eaa..9b96a01 100644 --- a/ios/chrome/browser/flags/ios_chrome_flag_descriptions.cc +++ b/ios/chrome/browser/flags/ios_chrome_flag_descriptions.cc
@@ -673,12 +673,6 @@ const char kModernTabStripDescription[] = "When enabled, the newly implemented tabstrip can be tested."; -const char kMultilineFadeTruncatingLabelName[] = - "Multiline Fade Truncating Label"; -const char kMultilineFadeTruncatingLabelDescription[] = - "Enable gradient support on FadeTruncatingLabel with multiple lines, the " - "gradient only will be applied to the last line instead of all lines."; - const char kNativeFindInPageName[] = "Native Find in Page"; const char kNativeFindInPageDescription[] = "When enabled, the JavaScript implementation of the Find in Page feature " @@ -773,11 +767,6 @@ "Enables local history zero-prefix suggestions in every context in which " "the remote zero-prefix suggestions are enabled."; -const char kOmniboxMultilineSearchSuggestName[] = - "Omnibox Multiline Search Suggestion"; -const char kOmniboxMultilineSearchSuggestDescription[] = - "Change the maximum number of line displayed for a search suggestion"; - const char kOmniboxOnDeviceTailSuggestionsName[] = "Omnibox on device tail suggestions"; const char kOmniboxOnDeviceTailSuggestionsDescription[] =
diff --git a/ios/chrome/browser/flags/ios_chrome_flag_descriptions.h b/ios/chrome/browser/flags/ios_chrome_flag_descriptions.h index d3e13ea..d8fc285 100644 --- a/ios/chrome/browser/flags/ios_chrome_flag_descriptions.h +++ b/ios/chrome/browser/flags/ios_chrome_flag_descriptions.h
@@ -583,11 +583,6 @@ extern const char kModernTabStripName[]; extern const char kModernTabStripDescription[]; -// Title and description of the flag to enable multiline gradient support in -// FadeTruncatingLabel. -extern const char kMultilineFadeTruncatingLabelName[]; -extern const char kMultilineFadeTruncatingLabelDescription[]; - // Title and description of the flag to enable the native Find in Page API // for iOS 16 and later. extern const char kNativeFindInPageName[]; @@ -652,11 +647,6 @@ extern const char kOmniboxMaxZPSMatchesName[]; extern const char kOmniboxMaxZPSMatchesDescription[]; -// Title and description for the flag to inscrease the maximum number of lines -// for search suggestions. -extern const char kOmniboxMultilineSearchSuggestName[]; -extern const char kOmniboxMultilineSearchSuggestDescription[]; - // Title and description for the flag to swap Omnibox Textfield implementation // to a new experimental one. extern const char kOmniboxNewImplementationName[];
diff --git a/ios/chrome/browser/sessions/session_restoration_web_state_observer.h b/ios/chrome/browser/sessions/session_restoration_web_state_observer.h index 1587bd6..df25955 100644 --- a/ios/chrome/browser/sessions/session_restoration_web_state_observer.h +++ b/ios/chrome/browser/sessions/session_restoration_web_state_observer.h
@@ -37,6 +37,7 @@ void clear_dirty() { is_dirty_ = false; } // web::WebStateObserver implementation. + void WasShown(web::WebState* web_state) final; void DidFinishNavigation(web::WebState* web_state, web::NavigationContext* navigation_context) final; void WebStateRealized(web::WebState* web_state) final;
diff --git a/ios/chrome/browser/sessions/session_restoration_web_state_observer.mm b/ios/chrome/browser/sessions/session_restoration_web_state_observer.mm index 2ffcc1d17..ef36cd5 100644 --- a/ios/chrome/browser/sessions/session_restoration_web_state_observer.mm +++ b/ios/chrome/browser/sessions/session_restoration_web_state_observer.mm
@@ -27,6 +27,12 @@ #pragma mark - web::WebStateObserver +void SessionRestorationWebStateObserver::WasShown(web::WebState* web_state) { + // The last active time stamp is updated when a WebState is presented, so + // mark it as dirty so that the change is reflected in the session storage. + MarkDirty(); +} + void SessionRestorationWebStateObserver::DidFinishNavigation( web::WebState* web_state, web::NavigationContext* navigation_context) {
diff --git a/ios/chrome/browser/sessions/session_restoration_web_state_observer_unittest.mm b/ios/chrome/browser/sessions/session_restoration_web_state_observer_unittest.mm index e4208a4..bf1ccb8 100644 --- a/ios/chrome/browser/sessions/session_restoration_web_state_observer_unittest.mm +++ b/ios/chrome/browser/sessions/session_restoration_web_state_observer_unittest.mm
@@ -218,6 +218,23 @@ } // Tests that SessionRestorationWebStateObserver mark the WebState as +// dirty when the WebState is shown (which updates the last active time). +TEST_F(SessionRestorationWebStateObserverTest, WasShown) { + web_state()->SetIsRealized(true); + + size_t call_count = 0; + SessionRestorationWebStateObserver* observer = + CreateSessionRestorationWebStateObserver( + web_state(), base::BindRepeating(&IncrementCounter, &call_count)); + + web_state()->WasShown(); + web_state()->WasShown(); + + EXPECT_TRUE(observer->is_dirty()); + EXPECT_EQ(call_count, 1u); +} + +// Tests that SessionRestorationWebStateObserver mark the WebState as // dirty when a WebFrame becomes available. TEST_F(SessionRestorationWebStateObserverTest, WebFrameAvailable) { web_state()->SetIsRealized(true);
diff --git a/ios/chrome/browser/shared/public/features/features.h b/ios/chrome/browser/shared/public/features/features.h index 93257c7..90045726 100644 --- a/ios/chrome/browser/shared/public/features/features.h +++ b/ios/chrome/browser/shared/public/features/features.h
@@ -158,9 +158,6 @@ // Whether the new tab grid tabs transitions should be enabled. bool IsNewTabGridTransitionsEnabled(); -// Feature to enable multiline gradient support in fade truncating label. -BASE_DECLARE_FEATURE(kMultilineFadeTruncatingLabel); - // Feature flag to control the maximum amount of non-modal DB promo impressions // server-side. Enabled by default to always have a default impression limit // value.
diff --git a/ios/chrome/browser/shared/public/features/features.mm b/ios/chrome/browser/shared/public/features/features.mm index adba65c..e215fbc 100644 --- a/ios/chrome/browser/shared/public/features/features.mm +++ b/ios/chrome/browser/shared/public/features/features.mm
@@ -189,10 +189,6 @@ return base::FeatureList::IsEnabled(kTabGridNewTransitions); } -BASE_FEATURE(kMultilineFadeTruncatingLabel, - "MultilineFadeTruncatingLabel", - base::FEATURE_ENABLED_BY_DEFAULT); - BASE_FEATURE(kNonModalDefaultBrowserPromoImpressionLimit, "NonModalDefaultBrowserPromoImpressionLimit", base::FEATURE_ENABLED_BY_DEFAULT);
diff --git a/ios/chrome/browser/shared/ui/elements/fade_truncating_label.mm b/ios/chrome/browser/shared/ui/elements/fade_truncating_label.mm index 020838ac..3b527b5 100644 --- a/ios/chrome/browser/shared/ui/elements/fade_truncating_label.mm +++ b/ios/chrome/browser/shared/ui/elements/fade_truncating_label.mm
@@ -90,8 +90,6 @@ // Gradient used to create fade effect. Changes based on view.frame size. @property(nonatomic, strong) UIImage* gradient; -// /// Returns `YES` if multiline flag is enabled. -@property(nonatomic, assign) BOOL isMultilineEnabled; @end @@ -107,8 +105,6 @@ if (self) { self.lineBreakMode = NSLineBreakByClipping; self.lineSpacing = 0; - _isMultilineEnabled = - base::FeatureList::IsEnabled(kMultilineFadeTruncatingLabel); [self setup]; } return self; @@ -122,8 +118,6 @@ - (void)layoutSubviews { [super layoutSubviews]; - self.isMultilineEnabled = - base::FeatureList::IsEnabled(kMultilineFadeTruncatingLabel); // Cache the fade gradient when the bounds change. if (!CGRectIsEmpty(self.bounds) && (!self.gradient || @@ -156,99 +150,9 @@ #pragma mark - Text Drawing -/// Draws `attributedText` in `requestedRect` and apply gradient mask if the -/// text is wider than rect. +/// Draws `attributedText` with a maximum of `numberOfLines` lines in +/// `requestedRect`. - (void)drawTextInRect:(CGRect)requestedRect { - if (self.isMultilineEnabled) { - [self drawMultilineInRect:requestedRect]; - } else { - NSAttributedString* configuredString = - [self attributedString:self.attributedText - withLineBreakMode:self.lineBreakMode]; - - // Draw fade gradient mask if `attributedText` is wider than rect. - const BOOL shouldApplyGradient = - [self.attributedText size].width > requestedRect.size.width; - [self drawAttributedString:configuredString - inRect:requestedRect - applyGradient:shouldApplyGradient - alignmentOffset:0.0]; - } -} - -/// Computes the bounding rect necessary to draw text in `bounds` limited to -/// `numberOfLines`. -- (CGRect)textRectForBounds:(CGRect)bounds - limitedToNumberOfLines:(NSInteger)numberOfLines { - if (!self.isMultilineEnabled) { - return [super textRectForBounds:bounds - limitedToNumberOfLines:numberOfLines]; - } - NSInteger maxNumberOfLines = numberOfLines ? numberOfLines : INT_MAX; - // Force NSLineBreakByWordWrapping to be able to draw multiple lines. - NSAttributedString* wrappingString = - [self attributedString:self.attributedText - withLineBreakMode:NSLineBreakByWordWrapping]; - // Compute the number of lines needed to draw the string with limited width. - const CGSize wrappingStringSize = - [wrappingString boundingRectWithSize:CGSizeMake(bounds.size.width, 0) - options:NSStringDrawingUsesLineFragmentOrigin - context:nil] - .size; - - const CGSize singleLineStringSize = wrappingString.size; - const NSInteger wrappingStringNumberOfLines = - round(wrappingStringSize.height / singleLineStringSize.height); - const NSInteger numberOfLinesToDraw = - MIN(maxNumberOfLines, wrappingStringNumberOfLines); - const CGFloat totalLineSpacing = - MAX((numberOfLinesToDraw - 1), 0) * self.lineSpacing; - - const CGFloat boundingWidth = - MIN(ceil(singleLineStringSize.width), bounds.size.width); - CGFloat boundingHeight = ceil( - singleLineStringSize.height * numberOfLinesToDraw + totalLineSpacing); - boundingHeight = MIN(boundingHeight, bounds.size.height); - const CGRect boundingRect = CGRectMake(bounds.origin.x, bounds.origin.y, - boundingWidth, boundingHeight); - return boundingRect; -} - -#pragma mark Text Drawing Private - -/// Draws `attributedString` in `requestedRect`. -/// `applyGradient`: Whether gradient should be applied when drawing the text. -/// `alignmentOffset`: offset added to draw the text on the left of -/// `requestedRect`. Note: with NSLineBreakByClipping the text is always clipped -/// to the right even when the text is aligned to the right, with the offset the -/// text starts to draw on the left of `requestedRect`, this allow the text to -/// end inside of `requestedRect` clipping it on the left. -- (void)drawAttributedString:(NSAttributedString*)attributedString - inRect:(CGRect)requestedRect - applyGradient:(BOOL)applyGradient - alignmentOffset:(CGFloat)alignmentOffset { - CGContextRef context = UIGraphicsGetCurrentContext(); - CGContextSaveGState(context); - - if (applyGradient) { - CGContextClipToMask(context, requestedRect, [self.gradient CGImage]); - } - - CGRect drawingRect = requestedRect; - if (alignmentOffset != 0) { - drawingRect = CGRectMake( - requestedRect.origin.x - alignmentOffset, requestedRect.origin.y, - requestedRect.size.width + alignmentOffset, requestedRect.size.height); - } - [attributedString drawInRect:drawingRect]; - - CGContextRestoreGState(context); -} - -/// Draws a maximum of `numberOfLines` lines in `requestedRect`. -- (void)drawMultilineInRect:(CGRect)requestedRect { - DCHECK(self.isMultilineEnabled); - const CGFloat lineHeight = self.font.lineHeight; if (!lineHeight || !self.attributedText) { return; @@ -329,6 +233,71 @@ alignmentOffset:rtlOffset]; } +/// Computes the bounding rect necessary to draw text in `bounds` limited to +/// `numberOfLines`. +- (CGRect)textRectForBounds:(CGRect)bounds + limitedToNumberOfLines:(NSInteger)numberOfLines { + NSInteger maxNumberOfLines = numberOfLines ? numberOfLines : INT_MAX; + // Force NSLineBreakByWordWrapping to be able to draw multiple lines. + NSAttributedString* wrappingString = + [self attributedString:self.attributedText + withLineBreakMode:NSLineBreakByWordWrapping]; + // Compute the number of lines needed to draw the string with limited width. + const CGSize wrappingStringSize = + [wrappingString boundingRectWithSize:CGSizeMake(bounds.size.width, 0) + options:NSStringDrawingUsesLineFragmentOrigin + context:nil] + .size; + + const CGSize singleLineStringSize = wrappingString.size; + const NSInteger wrappingStringNumberOfLines = + round(wrappingStringSize.height / singleLineStringSize.height); + const NSInteger numberOfLinesToDraw = + MIN(maxNumberOfLines, wrappingStringNumberOfLines); + const CGFloat totalLineSpacing = + MAX((numberOfLinesToDraw - 1), 0) * self.lineSpacing; + + const CGFloat boundingWidth = + MIN(ceil(singleLineStringSize.width), bounds.size.width); + CGFloat boundingHeight = ceil( + singleLineStringSize.height * numberOfLinesToDraw + totalLineSpacing); + boundingHeight = MIN(boundingHeight, bounds.size.height); + const CGRect boundingRect = CGRectMake(bounds.origin.x, bounds.origin.y, + boundingWidth, boundingHeight); + return boundingRect; +} + +#pragma mark Text Drawing Private + +/// Draws `attributedString` in `requestedRect`. +/// `applyGradient`: Whether gradient should be applied when drawing the text. +/// `alignmentOffset`: offset added to draw the text on the left of +/// `requestedRect`. Note: with NSLineBreakByClipping the text is always clipped +/// to the right even when the text is aligned to the right, with the offset the +/// text starts to draw on the left of `requestedRect`, this allow the text to +/// end inside of `requestedRect` clipping it on the left. +- (void)drawAttributedString:(NSAttributedString*)attributedString + inRect:(CGRect)requestedRect + applyGradient:(BOOL)applyGradient + alignmentOffset:(CGFloat)alignmentOffset { + CGContextRef context = UIGraphicsGetCurrentContext(); + CGContextSaveGState(context); + + if (applyGradient) { + CGContextClipToMask(context, requestedRect, [self.gradient CGImage]); + } + + CGRect drawingRect = requestedRect; + if (alignmentOffset != 0) { + drawingRect = CGRectMake( + requestedRect.origin.x - alignmentOffset, requestedRect.origin.y, + requestedRect.size.width + alignmentOffset, requestedRect.size.height); + } + [attributedString drawInRect:drawingRect]; + + CGContextRestoreGState(context); +} + #pragma mark - Private methods /// Adds specified attributes to a copy of `attributedString` and sets line
diff --git a/ios/chrome/browser/shared/ui/elements/fade_truncating_label_unittest.mm b/ios/chrome/browser/shared/ui/elements/fade_truncating_label_unittest.mm index dd5babf..a8ac3f3 100644 --- a/ios/chrome/browser/shared/ui/elements/fade_truncating_label_unittest.mm +++ b/ios/chrome/browser/shared/ui/elements/fade_truncating_label_unittest.mm
@@ -50,10 +50,6 @@ protected: void SetUp() override { - PlatformTest::SetUp(); - base::test::ScopedFeatureList scoped_feature_list; - scoped_feature_list.InitAndEnableFeature(kMultilineFadeTruncatingLabel); - short_text_ = [[FadeTruncatingLabel alloc] init]; short_text_.text = [kShortText copy]; two_lines_text_ = [[FadeTruncatingLabel alloc] init]; @@ -179,9 +175,6 @@ // Tests that FadeTruncatinglabel returns valid bounding rect when calling // `textRectForBounds` TEST_F(FadeTruncatingLabelTest, ValidBoundingRect) { - base::test::ScopedFeatureList scoped_feature_list; - scoped_feature_list.InitAndEnableFeature(kMultilineFadeTruncatingLabel); - CGFloat max_bound = 200; CGFloat bound_increment = 20; NSInteger max_number_of_lines = 4; @@ -203,9 +196,6 @@ // Tests that FadeTruncatingLabel draws with valid rect when calling // `drawTextInRect`. TEST_F(FadeTruncatingLabelTest, ValidDrawingRect) { - base::test::ScopedFeatureList scoped_feature_list; - scoped_feature_list.InitAndEnableFeature(kMultilineFadeTruncatingLabel); - CGFloat max_bound = 200; CGFloat bound_increment = 20; NSInteger max_number_of_lines = 4; @@ -228,9 +218,6 @@ // Tests that the gradient is only applied on the last line. TEST_F(FadeTruncatingLabelTest, GradientOnLastLine) { - base::test::ScopedFeatureList scoped_feature_list; - scoped_feature_list.InitAndEnableFeature(kMultilineFadeTruncatingLabel); - CGRect bounds = CGRectMake(0, 0, kLimitedWidth, FLT_MAX); for (size_t label_index = 0; label_index < labels_.count; label_index++) { FadeTruncatingLabel* label = labels_[label_index];
diff --git a/ios/chrome/browser/snapshots/model/features.h b/ios/chrome/browser/snapshots/model/features.h index 6040a5f..5c073f3 100644 --- a/ios/chrome/browser/snapshots/model/features.h +++ b/ios/chrome/browser/snapshots/model/features.h
@@ -6,8 +6,21 @@ #define IOS_CHROME_BROWSER_SNAPSHOTS_MODEL_FEATURES_H_ #import "base/feature_list.h" +#import "base/metrics/field_trial_params.h" // Feature flag to enable the grey snapshot optimization. BASE_DECLARE_FEATURE(kGreySnapshotOptimization); +// Enum class to represent the optimization level, used for +// kGreySnapshotOptimization. +enum class GreySnapshotOptimizationLevel { + kDoNotStoreToDisk, + kDoNotStoreToDiskAndCache, +}; + +// Feature param under kGreySnapshotOptimization to select the optimization +// level. +extern const base::FeatureParam<GreySnapshotOptimizationLevel> + kGreySnapshotOptimizationLevelParam; + #endif // IOS_CHROME_BROWSER_SNAPSHOTS_MODEL_FEATURES_H_
diff --git a/ios/chrome/browser/snapshots/model/features.mm b/ios/chrome/browser/snapshots/model/features.mm index 62078b1..e057177 100644 --- a/ios/chrome/browser/snapshots/model/features.mm +++ b/ios/chrome/browser/snapshots/model/features.mm
@@ -7,3 +7,16 @@ BASE_FEATURE(kGreySnapshotOptimization, "GreySnapshotOptimization", base::FEATURE_DISABLED_BY_DEFAULT); + +constexpr base::FeatureParam<GreySnapshotOptimizationLevel>::Option + kGreySnapshotOptimizationLevelOptions[] = { + {GreySnapshotOptimizationLevel::kDoNotStoreToDisk, + "do-not-store-to-disk"}, + {GreySnapshotOptimizationLevel::kDoNotStoreToDiskAndCache, + "do-not-store-to-disk-and-cache"}}; + +constexpr base::FeatureParam<GreySnapshotOptimizationLevel> + kGreySnapshotOptimizationLevelParam{ + &kGreySnapshotOptimization, "level", + GreySnapshotOptimizationLevel::kDoNotStoreToDisk, + &kGreySnapshotOptimizationLevelOptions};
diff --git a/ios/chrome/browser/snapshots/model/snapshot_storage.mm b/ios/chrome/browser/snapshots/model/snapshot_storage.mm index 414f927..2846614 100644 --- a/ios/chrome/browser/snapshots/model/snapshot_storage.mm +++ b/ios/chrome/browser/snapshots/model/snapshot_storage.mm
@@ -411,6 +411,27 @@ return GreyImage(image); } +// Returns true if the flag for grey optimization is enabled. +bool IsGreySnapshotOptimizationEnabled() { + if (base::FeatureList::IsEnabled(kGreySnapshotOptimization)) { + return true; + } + return false; +} + +// Returns true if the flag for grey optimization is enabled and the +// optimization level is highest, no grey snapshot images in in-memory cache and +// disk. +bool IsGreySnapshotOptimizationNoCacheEnabled() { + if (IsGreySnapshotOptimizationEnabled()) { + if (kGreySnapshotOptimizationLevelParam.Get() == + GreySnapshotOptimizationLevel::kDoNotStoreToDiskAndCache) { + return true; + } + } + return false; +} + } // anonymous namespace @implementation SnapshotStorage { @@ -625,6 +646,7 @@ // Copy the grey scale version, if available. auto iterator = _greyImageDictionary.find(snapshotID); if (iterator != _greyImageDictionary.end()) { + DCHECK(!IsGreySnapshotOptimizationNoCacheEnabled()); destinationStorage->_greyImageDictionary.insert( std::make_pair(snapshotID, iterator->second)); } @@ -673,6 +695,7 @@ // `_mostRecentGreyBlock` if `_mostRecentGreySnapshotID` matches `snapshotID`. - (void)saveGreyImage:(UIImage*)greyImage forSnapshotID:(SnapshotID)snapshotID { DCHECK_CALLED_ON_VALID_SEQUENCE(_sequenceChecker); + CHECK(!IsGreySnapshotOptimizationNoCacheEnabled()); if (greyImage) { _greyImageDictionary.insert(std::make_pair(snapshotID, greyImage)); } @@ -685,6 +708,7 @@ // Load uncached snapshot image and convert image to grey. - (void)loadGreyImageAsync:(SnapshotID)snapshotID { DCHECK_CALLED_ON_VALID_SEQUENCE(_sequenceChecker); + CHECK(!IsGreySnapshotOptimizationNoCacheEnabled()); // Don't call -retrieveImageForSnapshotID here because it caches the colored // image, which we don't need for the grey image cache. But if the image is // already in the cache, use it. @@ -706,6 +730,12 @@ - (void)createGreyCache:(const std::vector<SnapshotID>&)snapshotIDs { DCHECK_CALLED_ON_VALID_SEQUENCE(_sequenceChecker); + if (IsGreySnapshotOptimizationNoCacheEnabled()) { + // Do not create cache for grey images. A grey image will be generated + // in-flight from a color image when it's retrieved. + return; + } + _greyImageDictionary.clear(); for (SnapshotID snapshotID : snapshotIDs) { [self loadGreyImageAsync:snapshotID]; @@ -733,6 +763,7 @@ auto iterator = _greyImageDictionary.find(snapshotID); if (iterator != _greyImageDictionary.end()) { + CHECK(!IsGreySnapshotOptimizationNoCacheEnabled()); callback(iterator->second); return; } @@ -742,7 +773,7 @@ return; } - if (base::FeatureList::IsEnabled(kGreySnapshotOptimization)) { + if (IsGreySnapshotOptimizationEnabled()) { // There are no grey images stored in disk, so use color snapshots instead. UIImage* colorImage = [_lruCache objectForKey:snapshotID]; _taskRunner->PostTaskAndReplyWithResult( @@ -793,7 +824,7 @@ return; } - if (base::FeatureList::IsEnabled(kGreySnapshotOptimization)) { + if (IsGreySnapshotOptimizationEnabled()) { // Do not save grey images into disk when the feature is enabled. return; }
diff --git a/ios/chrome/browser/snapshots/model/snapshot_storage_unittest.mm b/ios/chrome/browser/snapshots/model/snapshot_storage_unittest.mm index f0fc64f8..25ded07 100644 --- a/ios/chrome/browser/snapshots/model/snapshot_storage_unittest.mm +++ b/ios/chrome/browser/snapshots/model/snapshot_storage_unittest.mm
@@ -816,7 +816,9 @@ : public SnapshotStorageTest { public: SnapshotStorageWithoutStoringGreySnapshotsTest() { - scoped_feature_list_.InitAndEnableFeature(kGreySnapshotOptimization); + scoped_feature_list_.InitAndEnableFeatureWithParameters( + kGreySnapshotOptimization, + {{"level", "do-not-store-to-disk-and-cache"}}); } private:
diff --git a/ios/chrome/browser/ui/browser_container/browser_container_coordinator.mm b/ios/chrome/browser/ui/browser_container/browser_container_coordinator.mm index ede2cff5..c7c3a1a 100644 --- a/ios/chrome/browser/ui/browser_container/browser_container_coordinator.mm +++ b/ios/chrome/browser/ui/browser_container/browser_container_coordinator.mm
@@ -91,6 +91,7 @@ self.browserEditMenuHandler = [[BrowserEditMenuHandler alloc] init]; self.viewController.browserEditMenuHandler = self.browserEditMenuHandler; + self.browserEditMenuHandler.linkToTextDelegate = self.linkToTextMediator; self.viewController.linkToTextDelegate = self.linkToTextMediator; if (IsPartialTranslateEnabled()) {
diff --git a/ios/chrome/browser/ui/fullscreen/fullscreen_controller.h b/ios/chrome/browser/ui/fullscreen/fullscreen_controller.h index 871bd42..9913d64b 100644 --- a/ios/chrome/browser/ui/fullscreen/fullscreen_controller.h +++ b/ios/chrome/browser/ui/fullscreen/fullscreen_controller.h
@@ -79,13 +79,18 @@ // 1.0. virtual void ExitFullscreen() = 0; - // Force enters fullscreen mode, without animation, resetting the progress to - // 0.0. Calling this forces the progress to 0.0 even when fullscreen is - // disabled. - virtual void ForceEnterFullscreen() = 0; // Exits fullscreen without animation, resetting the progress to 1.0. virtual void ExitFullscreenWithoutAnimation() = 0; + // Force fullscreen mode is used when the bottom omnibox is collapsed above + // the keyboard. When the mode is active: + // - Fullscreen progress is forced to 0 and should stay at 0. + // - Updating browser insets through fullscreen are disabled. (crbug/1490601) + // When exiting the mode, fullscreen is reset. + virtual bool IsForceFullscreenMode() const = 0; + virtual void EnterForceFullscreenMode() = 0; + virtual void ExitForceFullscreenMode() = 0; + virtual void FreezeToolbarHeight(bool freeze_toolbar_height) = 0; // Force horizontal content resize, when content isn't tracking resize by
diff --git a/ios/chrome/browser/ui/fullscreen/fullscreen_controller_impl.h b/ios/chrome/browser/ui/fullscreen/fullscreen_controller_impl.h index 1b95408..9a970e5a 100644 --- a/ios/chrome/browser/ui/fullscreen/fullscreen_controller_impl.h +++ b/ios/chrome/browser/ui/fullscreen/fullscreen_controller_impl.h
@@ -44,8 +44,10 @@ UIEdgeInsets GetCurrentViewportInsets() const override; void EnterFullscreen() override; void ExitFullscreen() override; - void ForceEnterFullscreen() override; void ExitFullscreenWithoutAnimation() override; + bool IsForceFullscreenMode() const override; + void EnterForceFullscreenMode() override; + void ExitForceFullscreenMode() override; void ResizeHorizontalViewport() override; void FreezeToolbarHeight(bool freeze_toolbar_height) override;
diff --git a/ios/chrome/browser/ui/fullscreen/fullscreen_controller_impl.mm b/ios/chrome/browser/ui/fullscreen/fullscreen_controller_impl.mm index 5f103be..13a7a98 100644 --- a/ios/chrome/browser/ui/fullscreen/fullscreen_controller_impl.mm +++ b/ios/chrome/browser/ui/fullscreen/fullscreen_controller_impl.mm
@@ -158,11 +158,35 @@ mediator_.ExitFullscreen(); } -void FullscreenControllerImpl::ForceEnterFullscreen() { +void FullscreenControllerImpl::ExitFullscreenWithoutAnimation() { + mediator_.ExitFullscreenWithoutAnimation(); +} + +bool FullscreenControllerImpl::IsForceFullscreenMode() const { + return model_.IsForceFullscreenMode(); +} + +void FullscreenControllerImpl::EnterForceFullscreenMode() { + CHECK(IsBottomOmniboxSteadyStateEnabled()); + if (IsForceFullscreenMode()) { + return; + } + model_.SetForceFullscreenMode(true); + // Disable fullscreen because: + // - It interfers with the animation when moving the secondary toolbar above + // the keyboard. + // - Fullscreen should not resize the toolbar it's above the keyboard. + IncrementDisabledCounter(); mediator_.ForceEnterFullscreen(); } -void FullscreenControllerImpl::ExitFullscreenWithoutAnimation() { +void FullscreenControllerImpl::ExitForceFullscreenMode() { + CHECK(IsBottomOmniboxSteadyStateEnabled()); + if (!IsForceFullscreenMode()) { + return; + } + DecrementDisabledCounter(); + model_.SetForceFullscreenMode(false); mediator_.ExitFullscreenWithoutAnimation(); }
diff --git a/ios/chrome/browser/ui/fullscreen/fullscreen_mediator.mm b/ios/chrome/browser/ui/fullscreen/fullscreen_mediator.mm index 4affd0b..0b5a9103 100644 --- a/ios/chrome/browser/ui/fullscreen/fullscreen_mediator.mm +++ b/ios/chrome/browser/ui/fullscreen/fullscreen_mediator.mm
@@ -63,6 +63,9 @@ } void FullscreenMediator::ExitFullscreen() { + if (model_->IsForceFullscreenMode()) { + return; + } // Instruct the model to ignore the remainder of the current scroll when // starting this animator. This prevents the toolbar from immediately being // hidden if AnimateModelReset() is called while a scroll view is
diff --git a/ios/chrome/browser/ui/fullscreen/fullscreen_model.h b/ios/chrome/browser/ui/fullscreen/fullscreen_model.h index 1a95a63..050aacb 100644 --- a/ios/chrome/browser/ui/fullscreen/fullscreen_model.h +++ b/ios/chrome/browser/ui/fullscreen/fullscreen_model.h
@@ -181,6 +181,11 @@ void SetFreezeToolbarHeight(bool freeze_toolbar_height); bool GetFreezeToolbarHeight() const; + // Setter for whether force fullscreen mode is active. The mode is used when + // the bottom toolbar is collapsed above the keyboard. + void SetForceFullscreenMode(bool force_fullscreen_mode); + bool IsForceFullscreenMode() const; + private: // Returns how a scroll to the current `y_content_offset_` from `from_offset` // should be handled. @@ -244,6 +249,10 @@ CGFloat top_inset_ = 0.0; // How many currently-running features require the toolbar be visible. size_t disabled_counter_ = 0; + // Whether fullscreen is force enabled. Active when the bottom toolbar is + // collapsed above the keyboard. When active, prevents fullscreen exit. + // Fullscreen will be reset when exiting this mode. + bool is_force_fullscreen_mode_ = false; // Whether fullscreen is disabled for short content. bool disabled_for_short_content_ = false; // Whether the main content is being scrolled.
diff --git a/ios/chrome/browser/ui/fullscreen/fullscreen_model.mm b/ios/chrome/browser/ui/fullscreen/fullscreen_model.mm index d6dd6ad..9f120081 100644 --- a/ios/chrome/browser/ui/fullscreen/fullscreen_model.mm +++ b/ios/chrome/browser/ui/fullscreen/fullscreen_model.mm
@@ -64,6 +64,9 @@ } void FullscreenModel::ResetForNavigation() { + if (IsForceFullscreenMode()) { + return; + } progress_ = 1.0; scrolling_ = false; base_offset_ = NAN; @@ -292,6 +295,14 @@ return freeze_toolbar_height_; } +void FullscreenModel::SetForceFullscreenMode(bool force_fullscreen_mode) { + is_force_fullscreen_mode_ = force_fullscreen_mode; +} + +bool FullscreenModel::IsForceFullscreenMode() const { + return is_force_fullscreen_mode_; +} + FullscreenModel::ScrollAction FullscreenModel::ActionForScrollFromOffset( CGFloat from_offset) const { // Update the base offset but don't recalculate progress if:
diff --git a/ios/chrome/browser/ui/fullscreen/fullscreen_web_state_observer.mm b/ios/chrome/browser/ui/fullscreen/fullscreen_web_state_observer.mm index b65bb09..9799d4b 100644 --- a/ios/chrome/browser/ui/fullscreen/fullscreen_web_state_observer.mm +++ b/ios/chrome/browser/ui/fullscreen/fullscreen_web_state_observer.mm
@@ -84,8 +84,9 @@ // Only reset the model for document-changing navigations or same-document // navigations that update the visible URL. - if (!navigation_context->IsSameDocument() || url_changed) + if (!navigation_context->IsSameDocument() || url_changed) { model_->ResetForNavigation(); + } } void FullscreenWebStateObserver::DidStartLoading(web::WebState* web_state) {
diff --git a/ios/chrome/browser/ui/fullscreen/test/test_fullscreen_controller.h b/ios/chrome/browser/ui/fullscreen/test/test_fullscreen_controller.h index 7bbaf3a..34d50e1 100644 --- a/ios/chrome/browser/ui/fullscreen/test/test_fullscreen_controller.h +++ b/ios/chrome/browser/ui/fullscreen/test/test_fullscreen_controller.h
@@ -37,8 +37,10 @@ UIEdgeInsets GetCurrentViewportInsets() const override; void EnterFullscreen() override; void ExitFullscreen() override; - void ForceEnterFullscreen() override; void ExitFullscreenWithoutAnimation() override; + bool IsForceFullscreenMode() const override; + void EnterForceFullscreenMode() override; + void ExitForceFullscreenMode() override; void ResizeHorizontalViewport() override; void FreezeToolbarHeight(bool freeze_toolbar_height) override;
diff --git a/ios/chrome/browser/ui/fullscreen/test/test_fullscreen_controller.mm b/ios/chrome/browser/ui/fullscreen/test/test_fullscreen_controller.mm index 6304ac7..48c3d96c 100644 --- a/ios/chrome/browser/ui/fullscreen/test/test_fullscreen_controller.mm +++ b/ios/chrome/browser/ui/fullscreen/test/test_fullscreen_controller.mm
@@ -82,14 +82,28 @@ model_->ResetForNavigation(); } -void TestFullscreenController::ForceEnterFullscreen() { +void TestFullscreenController::ExitFullscreenWithoutAnimation() { if (model_) { + model_->ResetForNavigation(); + } +} + +bool TestFullscreenController::IsForceFullscreenMode() const { + return model_ ? model_->IsForceFullscreenMode() : false; +} + +void TestFullscreenController::EnterForceFullscreenMode() { + if (model_ && !model_->IsForceFullscreenMode()) { + model_->SetForceFullscreenMode(true); + model_->IncrementDisabledCounter(); model_->ForceEnterFullscreen(); } } -void TestFullscreenController::ExitFullscreenWithoutAnimation() { - if (model_) { +void TestFullscreenController::ExitForceFullscreenMode() { + if (model_ && model_->IsForceFullscreenMode()) { + model_->DecrementDisabledCounter(); + model_->SetForceFullscreenMode(false); model_->ResetForNavigation(); } }
diff --git a/ios/chrome/browser/ui/omnibox/omnibox_ui_features.cc b/ios/chrome/browser/ui/omnibox/omnibox_ui_features.cc index a218baa9..0ba64af 100644 --- a/ios/chrome/browser/ui/omnibox/omnibox_ui_features.cc +++ b/ios/chrome/browser/ui/omnibox/omnibox_ui_features.cc
@@ -20,10 +20,6 @@ "OmniboxKeyboardPasteButton", base::FEATURE_DISABLED_BY_DEFAULT); -BASE_FEATURE(kOmniboxMultilineSearchSuggest, - "OmniboxMultilineSearchSuggest", - base::FEATURE_ENABLED_BY_DEFAULT); - // Tail suggest is triggered server side. BASE_FEATURE(kOmniboxTailSuggest, "OmniboxTailSuggest",
diff --git a/ios/chrome/browser/ui/omnibox/omnibox_ui_features.h b/ios/chrome/browser/ui/omnibox/omnibox_ui_features.h index 4fcacdf..d7bbcb57 100644 --- a/ios/chrome/browser/ui/omnibox/omnibox_ui_features.h +++ b/ios/chrome/browser/ui/omnibox/omnibox_ui_features.h
@@ -17,9 +17,6 @@ // Feature flag to enable paste button on the omnibox keyboard accessories. BASE_DECLARE_FEATURE(kOmniboxKeyboardPasteButton); -// Feature flag to enable multiple lines for search suggestions in omnibox. -BASE_DECLARE_FEATURE(kOmniboxMultilineSearchSuggest); - // Feature flag to enable tail suggestions in the omnibox. BASE_DECLARE_FEATURE(kOmniboxTailSuggest);
diff --git a/ios/chrome/browser/ui/omnibox/popup/omnibox_popup_row_cell.mm b/ios/chrome/browser/ui/omnibox/popup/omnibox_popup_row_cell.mm index c504ad9..4d26d1bc 100644 --- a/ios/chrome/browser/ui/omnibox/popup/omnibox_popup_row_cell.mm +++ b/ios/chrome/browser/ui/omnibox/popup/omnibox_popup_row_cell.mm
@@ -45,19 +45,13 @@ /// omnibox image. If Variation 2 becomes default, probably we don't need the /// fancy layout guide setup and can get away with simple margins. const CGFloat kTrailingButtonPointSize = 17.0f; -/// Maximum number of lines displayed for search suggestion when -/// `kOmniboxMultilineSearchSuggest` is enabled. +/// Maximum number of lines displayed. const NSInteger kSearchSuggestNumberOfLines = 2; /// Name of the histogram recording the number of lines in search suggestions. const char kOmniboxSearchSuggestionNumberOfLines[] = "IOS.Omnibox.SearchSuggestionNumberOfLines"; -/// Returns `YES` if `kOmniboxMultilineSearchSuggest` is enabled. -BOOL IsMultilineSearchSuggestionEnabled() { - return base::FeatureList::IsEnabled(kOmniboxMultilineSearchSuggest); -} - } // namespace NSString* const OmniboxPopupRowCellReuseIdentifier = @"OmniboxPopupRowCell"; @@ -502,7 +496,6 @@ if (suggestion.isWrapping) { [self logNumberOfLinesSearchSuggestions:self.textTruncatingLabel .attributedText]; - if (base::FeatureList::IsEnabled(kOmniboxMultilineSearchSuggest)) { self.textTruncatingLabel.numberOfLines = kSearchSuggestNumberOfLines; base::i18n::TextDirection textDirection = base::i18n::GetStringDirection( base::SysNSStringToUTF16(self.textTruncatingLabel.text)); @@ -511,7 +504,6 @@ UISemanticContentAttributeForceRightToLeft; self.textTruncatingLabel.truncateMode = FadeTruncatingHead; } - } } else { // Default values for FadeTruncatingLabel. self.textTruncatingLabel.lineBreakMode = NSLineBreakByClipping; @@ -538,8 +530,7 @@ if (suggestion.isAppendable || suggestion.isTabMatch) { [self setupTrailingButton]; } - [self updateTextConstraints:IsMultilineSearchSuggestionEnabled() && - suggestion.isWrapping]; + [self updateTextConstraints:suggestion.isWrapping]; self.leadingIconView.highlighted = self.highlighted; self.trailingButton.tintColor =
diff --git a/ios/chrome/browser/ui/omnibox/popup/omnibox_popup_row_cell_experimental.mm b/ios/chrome/browser/ui/omnibox/popup/omnibox_popup_row_cell_experimental.mm index b69480d1a..a43d5c9 100644 --- a/ios/chrome/browser/ui/omnibox/popup/omnibox_popup_row_cell_experimental.mm +++ b/ios/chrome/browser/ui/omnibox/popup/omnibox_popup_row_cell_experimental.mm
@@ -49,19 +49,13 @@ /// omnibox image. If Variation 2 becomes default, probably we don't need the /// fancy layout guide setup and can get away with simple margins. const CGFloat kTrailingButtonPointSize = 17.0f; -/// Maximum number of lines displayed for search suggestion when -/// `kOmniboxMultilineSearchSuggest` is enabled. +/// Maximum number of lines displayed for search suggestion. const NSInteger kSearchSuggestNumberOfLines = 2; /// Name of the histogram recording the number of lines in search suggestions. const char kOmniboxSearchSuggestionNumberOfLines[] = "IOS.Omnibox.SearchSuggestionNumberOfLines"; -/// Returns `YES` if `kOmniboxMultilineSearchSuggest` is enabled. -BOOL IsMultilineSearchSuggestionEnabled() { - return base::FeatureList::IsEnabled(kOmniboxMultilineSearchSuggest); -} - } // namespace @interface OmniboxPopupRowCellExperimental () @@ -388,15 +382,13 @@ if (suggestion.isWrapping) { [self logNumberOfLinesSearchSuggestions:self.textTruncatingLabel .attributedText]; - if (base::FeatureList::IsEnabled(kOmniboxMultilineSearchSuggest)) { - self.textTruncatingLabel.numberOfLines = kSearchSuggestNumberOfLines; - base::i18n::TextDirection textDirection = base::i18n::GetStringDirection( - base::SysNSStringToUTF16(self.textTruncatingLabel.text)); - if (textDirection == base::i18n::RIGHT_TO_LEFT) { - self.textTruncatingLabel.semanticContentAttribute = - UISemanticContentAttributeForceRightToLeft; - self.textTruncatingLabel.truncateMode = FadeTruncatingHead; - } + self.textTruncatingLabel.numberOfLines = kSearchSuggestNumberOfLines; + base::i18n::TextDirection textDirection = base::i18n::GetStringDirection( + base::SysNSStringToUTF16(self.textTruncatingLabel.text)); + if (textDirection == base::i18n::RIGHT_TO_LEFT) { + self.textTruncatingLabel.semanticContentAttribute = + UISemanticContentAttributeForceRightToLeft; + self.textTruncatingLabel.truncateMode = FadeTruncatingHead; } } else { // Default values for FadeTruncatingLabel. @@ -424,8 +416,7 @@ if (suggestion.isAppendable || suggestion.isTabMatch) { [self setupTrailingButton]; } - [self updateTextConstraints:IsMultilineSearchSuggestionEnabled() && - suggestion.isWrapping]; + [self updateTextConstraints:suggestion.isWrapping]; self.leadingIconView.highlighted = self.highlighted; self.trailingButton.tintColor =
diff --git a/ios/chrome/browser/ui/toolbar/secondary_toolbar_view_controller.mm b/ios/chrome/browser/ui/toolbar/secondary_toolbar_view_controller.mm index ab8388e..be14132 100644 --- a/ios/chrome/browser/ui/toolbar/secondary_toolbar_view_controller.mm +++ b/ios/chrome/browser/ui/toolbar/secondary_toolbar_view_controller.mm
@@ -29,10 +29,7 @@ @end -@implementation SecondaryToolbarViewController { - /// The disabler created when the keyboard is visible. - std::unique_ptr<ScopedFullscreenDisabler> _keyboardDisabler; -} +@implementation SecondaryToolbarViewController @dynamic view; @@ -59,7 +56,6 @@ - (void)disconnect { _fullscreenController = nullptr; - _keyboardDisabler = nullptr; } #pragma mark - AdaptiveToolbarViewController @@ -119,14 +115,8 @@ /// Collapses secondary toolbar when it's moved above the keyboard. - (void)collapseForKeyboard { - // Disable fullscreen because: - // - It interfers with the animation when moving the secondary toolbar above - // the keyboard. - // - Fullscreen should not resize the toolbar it's above the keyboard. if (_fullscreenController) { - _keyboardDisabler = - std::make_unique<ScopedFullscreenDisabler>(_fullscreenController); - _fullscreenController->ForceEnterFullscreen(); + _fullscreenController->EnterForceFullscreenMode(); } self.view.locationBarTopConstraint.constant = 0; self.view.bottomSeparator.alpha = 1.0; @@ -136,8 +126,7 @@ /// Resets secondary toolbar when it's detached from the keyboard. - (void)removeFromKeyboard { if (_fullscreenController) { - _fullscreenController->ExitFullscreenWithoutAnimation(); - _keyboardDisabler = nullptr; + _fullscreenController->ExitForceFullscreenMode(); } self.view.bottomSeparator.alpha = 0.0; [self.toolbarHeightDelegate secondaryToolbarRemovedFromKeyboard];
diff --git a/ios/chrome/common/app_group/BUILD.gn b/ios/chrome/common/app_group/BUILD.gn index 6f118dd..3f23a64 100644 --- a/ios/chrome/common/app_group/BUILD.gn +++ b/ios/chrome/common/app_group/BUILD.gn
@@ -24,6 +24,18 @@ ] } +source_set("unit_tests") { + testonly = true + sources = [ "app_group_metrics_unittest.mm" ] + deps = [ + ":app_group", + ":main_app", + "//base", + "//base/test:test_support", + "//testing/gtest", + ] +} + # This target will be included into application extensions and the list # of its dependencies must be kept as short as possible. source_set("helper") {
diff --git a/ios/chrome/common/app_group/app_group_constants.h b/ios/chrome/common/app_group/app_group_constants.h index d8e4591..dc9b986 100644 --- a/ios/chrome/common/app_group/app_group_constants.h +++ b/ios/chrome/common/app_group/app_group_constants.h
@@ -20,6 +20,20 @@ APP_GROUP_TODAY_EXTENSION, }; +// The different types of outcome used for UMA and created by the open +// extension. +// The entries should not be removed or reordered. +// Also add the name of the enum and histogram. +enum class OpenExtensionOutcome : NSInteger { + kSuccess = 0, + kInvalid = 1, + kFailureInvalidURL = 2, + kFailureURLNotFound = 3, + kFailureOpenInNotFound = 4, + kFailureUnsupportedScheme = 5, + kMaxValue = kFailureUnsupportedScheme, +}; + // The different types of item that can be created by the share extension. enum ShareExtensionItemType { READING_LIST_ITEM = 0, @@ -159,6 +173,23 @@ // added to metrics logs. extern const char kBrandCode[]; +// The five keys of the outcomes by the open extension to Chrome (Success, +// FailureInvalidURL, FailureURLNotFound, FailureOpenInNotFound, +// FailureUnsupportedScheme). +extern NSString* const kOpenExtensionOutcomeSuccess; +extern NSString* const kOpenExtensionOutcomeFailureInvalidURL; +extern NSString* const kOpenExtensionOutcomeFailureURLNotFound; +extern NSString* const kOpenExtensionOutcomeFailureOpenInNotFound; +extern NSString* const kOpenExtensionOutcomeFailureUnsupportedScheme; + +// A key in the application group NSUserDefault that contains +// the outcomes of the Open Extension. +extern NSString* const kOpenExtensionOutcomes; + +// Conversion helpers between keys and OpenExtensionOutcome. +NSString* KeyForOpenExtensionOutcomeType(OpenExtensionOutcome); +OpenExtensionOutcome OutcomeTypeFromKey(NSString*); + // Gets the application group. NSString* ApplicationGroup();
diff --git a/ios/chrome/common/app_group/app_group_constants.mm b/ios/chrome/common/app_group/app_group_constants.mm index c88f97d..588a280a 100644 --- a/ios/chrome/common/app_group/app_group_constants.mm +++ b/ios/chrome/common/app_group/app_group_constants.mm
@@ -75,6 +75,18 @@ NSString* const kSuggestedItemsLastModificationDate = @"SuggestedItemsLastModificationDate"; +NSString* const kOpenExtensionOutcomes = @"ChromeOpenExtensionOutcomes"; + +NSString* const kOpenExtensionOutcomeSuccess = @"OpenExtensionOutcomeSuccess"; +NSString* const kOpenExtensionOutcomeFailureInvalidURL = + @"OpenExtensionOutcomeFailureInvalidURL"; +NSString* const kOpenExtensionOutcomeFailureURLNotFound = + @"OpenExtensionOutcomeFailureURLNotFound"; +NSString* const kOpenExtensionOutcomeFailureOpenInNotFound = + @"OpenExtensionOutcomeFailureOpenInNotFound"; +NSString* const kOpenExtensionOutcomeFailureUnsupportedScheme = + @"OpenExtensionOutcomeFailureUnsupportedScheme"; + NSString* ApplicationGroup() { return [AppGroupHelper applicationGroup]; } @@ -164,4 +176,40 @@ return crashpadURL; } +NSString* KeyForOpenExtensionOutcomeType(OpenExtensionOutcome type) { + switch (type) { + case OpenExtensionOutcome::kSuccess: + return kOpenExtensionOutcomeSuccess; + case OpenExtensionOutcome::kFailureInvalidURL: + return kOpenExtensionOutcomeFailureInvalidURL; + case OpenExtensionOutcome::kFailureURLNotFound: + return kOpenExtensionOutcomeFailureURLNotFound; + case OpenExtensionOutcome::kFailureOpenInNotFound: + return kOpenExtensionOutcomeFailureOpenInNotFound; + case OpenExtensionOutcome::kFailureUnsupportedScheme: + return kOpenExtensionOutcomeFailureUnsupportedScheme; + case OpenExtensionOutcome::kInvalid: + NOTREACHED_NORETURN(); + } +} + +OpenExtensionOutcome OutcomeTypeFromKey(NSString* key) { + if ([key isEqualToString:kOpenExtensionOutcomeSuccess]) { + return OpenExtensionOutcome::kSuccess; + } + if ([key isEqualToString:kOpenExtensionOutcomeFailureInvalidURL]) { + return OpenExtensionOutcome::kFailureInvalidURL; + } + if ([key isEqualToString:kOpenExtensionOutcomeFailureURLNotFound]) { + return OpenExtensionOutcome::kFailureURLNotFound; + } + if ([key isEqualToString:kOpenExtensionOutcomeFailureOpenInNotFound]) { + return OpenExtensionOutcome::kFailureOpenInNotFound; + } + if ([key isEqualToString:kOpenExtensionOutcomeFailureUnsupportedScheme]) { + return OpenExtensionOutcome::kFailureUnsupportedScheme; + } + return OpenExtensionOutcome::kInvalid; +} + } // namespace app_group
diff --git a/ios/chrome/common/app_group/app_group_metrics_mainapp.h b/ios/chrome/common/app_group/app_group_metrics_mainapp.h index b2dc759..c251cd13 100644 --- a/ios/chrome/common/app_group/app_group_metrics_mainapp.h +++ b/ios/chrome/common/app_group/app_group_metrics_mainapp.h
@@ -34,6 +34,9 @@ // TODO(crbug.com/782685): remove function. void DisableMetrics(); +// Report the metrics collected from the Open extension. +void LogOpenExtensionMetrics(); + } // namespace main_app } // namespace app_group
diff --git a/ios/chrome/common/app_group/app_group_metrics_mainapp.mm b/ios/chrome/common/app_group/app_group_metrics_mainapp.mm index ac3f2cc0..92b7af0 100644 --- a/ios/chrome/common/app_group/app_group_metrics_mainapp.mm +++ b/ios/chrome/common/app_group/app_group_metrics_mainapp.mm
@@ -11,6 +11,16 @@ #import "ios/chrome/common/app_group/app_group_constants.h" #import "ios/chrome/common/app_group/app_group_metrics.h" +namespace { +// Delay in seconds before reporting the metrics coming from Open extensions. +// This delay is needed to be sure the shared user default +// is correctly synchronized. +const int kDispatchTimeInSeconds = 2; + +// Maximum number of outcomes reported to UMA to avoid infinite loops. +const int kMaxNumberOfLogs = 10; + +} // namespace namespace app_group { namespace main_app { @@ -57,6 +67,20 @@ forKey:@(kInstallDate)]; [shared_defaults setObject:brand_code forKey:@(kBrandCode)]; + + // Reporting the Open extension should be done only once on each session. + // When the open extension actually launch Chrome, it stores an Outcome entry + // in the shared NSUserDefaults. Add a delay to let the synchronization happen + // and be sure this entry is reported. + static dispatch_once_t onceToken; + dispatch_once(&onceToken, ^{ + dispatch_after( + dispatch_time(DISPATCH_TIME_NOW, + (int64_t)(kDispatchTimeInSeconds * NSEC_PER_SEC)), + dispatch_get_main_queue(), ^{ + LogOpenExtensionMetrics(); + }); + }); } void DisableMetrics() { @@ -65,6 +89,30 @@ [shared_defaults removeObjectForKey:@(kChromeAppClientID)]; [shared_defaults removeObjectForKey:kContentExtensionDisplayCount]; [shared_defaults removeObjectForKey:kSearchExtensionDisplayCount]; + [shared_defaults removeObjectForKey:kOpenExtensionOutcomes]; +} + +void LogOpenExtensionMetrics() { + NSUserDefaults* shared_defaults = GetGroupUserDefaults(); + NSDictionary<NSString*, NSNumber*>* open_extension_dictionary = + [shared_defaults dictionaryForKey:app_group::kOpenExtensionOutcomes]; + // Clear the outcomes after reporting + [shared_defaults removeObjectForKey:kOpenExtensionOutcomes]; + + for (NSString* key in open_extension_dictionary) { + int event_count = [open_extension_dictionary valueForKey:key].intValue; + app_group::OpenExtensionOutcome bucket_for_histogram = + OutcomeTypeFromKey(key); + + if (event_count > kMaxNumberOfLogs) { + event_count = kMaxNumberOfLogs; + } + + for (int i = 0; i < event_count; i++) { + base::UmaHistogramEnumeration("IOSOpenExtensionOutcome", + bucket_for_histogram); + } + } } } // namespace main_app
diff --git a/ios/chrome/common/app_group/app_group_metrics_unittest.mm b/ios/chrome/common/app_group/app_group_metrics_unittest.mm new file mode 100644 index 0000000..a24ae028 --- /dev/null +++ b/ios/chrome/common/app_group/app_group_metrics_unittest.mm
@@ -0,0 +1,193 @@ +// Copyright 2023 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#import "base/strings/sys_string_conversions.h" +#import "base/test/metrics/histogram_tester.h" +#import "ios/chrome/common/app_group/app_group_constants.h" +#import "ios/chrome/common/app_group/app_group_metrics_mainapp.h" +#import "testing/gtest_mac.h" +#import "testing/platform_test.h" + +using app_group::KeyForOpenExtensionOutcomeType; +using app_group::kOpenExtensionOutcomeFailureInvalidURL; +using app_group::kOpenExtensionOutcomeFailureOpenInNotFound; +using app_group::kOpenExtensionOutcomeFailureUnsupportedScheme; +using app_group::kOpenExtensionOutcomeFailureURLNotFound; +using app_group::kOpenExtensionOutcomes; +using app_group::kOpenExtensionOutcomeSuccess; +using app_group::OpenExtensionOutcome; +using app_group::OutcomeTypeFromKey; +using app_group::main_app::LogOpenExtensionMetrics; + +class AppGroupMetricsTest : public PlatformTest { + protected: + void TearDown() override { PlatformTest::TearDown(); } +}; + +// Verify that the input key is converted correctly to OpenExtensionOutcome. +TEST_F(AppGroupMetricsTest, TestKeyForOpenExtensionOutcomeType) { + EXPECT_EQ(KeyForOpenExtensionOutcomeType(OpenExtensionOutcome::kSuccess), + kOpenExtensionOutcomeSuccess); + + EXPECT_EQ( + KeyForOpenExtensionOutcomeType(OpenExtensionOutcome::kFailureInvalidURL), + kOpenExtensionOutcomeFailureInvalidURL); + + EXPECT_EQ( + KeyForOpenExtensionOutcomeType(OpenExtensionOutcome::kFailureURLNotFound), + kOpenExtensionOutcomeFailureURLNotFound); + + EXPECT_EQ(KeyForOpenExtensionOutcomeType( + OpenExtensionOutcome::kFailureOpenInNotFound), + kOpenExtensionOutcomeFailureOpenInNotFound); + + EXPECT_EQ(KeyForOpenExtensionOutcomeType( + OpenExtensionOutcome::kFailureUnsupportedScheme), + kOpenExtensionOutcomeFailureUnsupportedScheme); +} + +// Verify that the OpenExtensionOutcome is converted correctly to +// OpenExtensionOutcome enum key. +TEST_F(AppGroupMetricsTest, TestOutcomeTypeFromKey) { + EXPECT_EQ(OutcomeTypeFromKey(kOpenExtensionOutcomeSuccess), + OpenExtensionOutcome::kSuccess); + + EXPECT_EQ(OutcomeTypeFromKey(kOpenExtensionOutcomeFailureInvalidURL), + OpenExtensionOutcome::kFailureInvalidURL); + + EXPECT_EQ(OutcomeTypeFromKey(kOpenExtensionOutcomeFailureURLNotFound), + OpenExtensionOutcome::kFailureURLNotFound); + + EXPECT_EQ(OutcomeTypeFromKey(kOpenExtensionOutcomeFailureOpenInNotFound), + OpenExtensionOutcome::kFailureOpenInNotFound); + + EXPECT_EQ(OutcomeTypeFromKey(kOpenExtensionOutcomeFailureUnsupportedScheme), + OpenExtensionOutcome::kFailureUnsupportedScheme); + + EXPECT_EQ(OutcomeTypeFromKey(@"OpenExtensionOutcomeURL"), + OpenExtensionOutcome::kInvalid); +} + +// Verify that the open extension metrics are logged correctly and +// cleaned from the UserDefaults. +TEST_F(AppGroupMetricsTest, TestLogOpenExtensionMetrics) { + base::HistogramTester histogram_tester; + + NSDictionary<NSString*, NSNumber*>* open_extension_test_dictionnary = @{ + kOpenExtensionOutcomeSuccess : @1, + kOpenExtensionOutcomeFailureInvalidURL : @2, + kOpenExtensionOutcomeFailureURLNotFound : @3, + kOpenExtensionOutcomeFailureOpenInNotFound : @4, + kOpenExtensionOutcomeFailureUnsupportedScheme : @5, + @"InvalidString" : @6 + }; + + NSUserDefaults* shared_defaults = app_group::GetGroupUserDefaults(); + + [shared_defaults setObject:open_extension_test_dictionnary + forKey:kOpenExtensionOutcomes]; + + LogOpenExtensionMetrics(); + + // Verify that the total of events is registered. + histogram_tester.ExpectTotalCount("IOSOpenExtensionOutcome", 21); + + // Verify that the total of each bucket contains the right number of events. + histogram_tester.ExpectBucketCount("IOSOpenExtensionOutcome", + OpenExtensionOutcome::kSuccess, 1); + histogram_tester.ExpectBucketCount( + "IOSOpenExtensionOutcome", OpenExtensionOutcome::kFailureInvalidURL, 2); + histogram_tester.ExpectBucketCount( + "IOSOpenExtensionOutcome", OpenExtensionOutcome::kFailureURLNotFound, 3); + histogram_tester.ExpectBucketCount( + "IOSOpenExtensionOutcome", OpenExtensionOutcome::kFailureOpenInNotFound, + 4); + histogram_tester.ExpectBucketCount( + "IOSOpenExtensionOutcome", + OpenExtensionOutcome::kFailureUnsupportedScheme, 5); + histogram_tester.ExpectBucketCount("IOSOpenExtensionOutcome", + OpenExtensionOutcome::kInvalid, 6); + + EXPECT_FALSE([shared_defaults objectForKey:kOpenExtensionOutcomes]); +} + +// Verify dictionary values cases for NSNumber and +// that the total of each bucket is less/equal 10. +TEST_F(AppGroupMetricsTest, TestValuesCasesForLogOpenExtensionMetrics) { + base::HistogramTester histogram_tester; + // NSNumber Test cases + // 1 bucket with value 100 + // 1 bucket with negative value + // 1 bucket with decimal value + // 1 bucket with [NSDecimalNumber notANumber] + // 1 bucket with something that is not a number (string)*/ + NSDictionary* open_extension_test_dictionnary = @{ + kOpenExtensionOutcomeSuccess : @100, + kOpenExtensionOutcomeFailureInvalidURL : @-6, + kOpenExtensionOutcomeFailureURLNotFound : @3.2, + kOpenExtensionOutcomeFailureOpenInNotFound : NSDecimalNumber.notANumber, + kOpenExtensionOutcomeFailureUnsupportedScheme : @"str", + @"InvalidString" : @10 + }; + + NSUserDefaults* shared_defaults = app_group::GetGroupUserDefaults(); + + [shared_defaults setObject:open_extension_test_dictionnary + forKey:kOpenExtensionOutcomes]; + + LogOpenExtensionMetrics(); + + // Verify that the total of events is registered. + histogram_tester.ExpectTotalCount("IOSOpenExtensionOutcome", 23); + + // Verify that the total of each bucket contains the right number of events. + histogram_tester.ExpectBucketCount("IOSOpenExtensionOutcome", + OpenExtensionOutcome::kSuccess, 10); + histogram_tester.ExpectBucketCount( + "IOSOpenExtensionOutcome", OpenExtensionOutcome::kFailureInvalidURL, 0); + histogram_tester.ExpectBucketCount( + "IOSOpenExtensionOutcome", OpenExtensionOutcome::kFailureURLNotFound, 3); + histogram_tester.ExpectBucketCount( + "IOSOpenExtensionOutcome", OpenExtensionOutcome::kFailureOpenInNotFound, + 0); + histogram_tester.ExpectBucketCount( + "IOSOpenExtensionOutcome", + OpenExtensionOutcome::kFailureUnsupportedScheme, 0); + histogram_tester.ExpectBucketCount("IOSOpenExtensionOutcome", + OpenExtensionOutcome::kInvalid, 10); + + EXPECT_FALSE([shared_defaults objectForKey:kOpenExtensionOutcomes]); +} + +// Verify the case of when there's no dictionary. +TEST_F(AppGroupMetricsTest, TestLogOpenExtensionMetricsMissingDictionary) { + base::HistogramTester histogram_tester; + + LogOpenExtensionMetrics(); + + histogram_tester.ExpectTotalCount("IOSOpenExtensionOutcome", 0); +} + +// Verify that the open extension metrics are logged correctly with +// missing buckets and cleaned from the UserDefaults. +TEST_F(AppGroupMetricsTest, TestLogOpenExtensionMetricsWithMissingBuckets) { + base::HistogramTester histogram_tester; + + NSDictionary<NSString*, NSNumber*>* open_extension_test_dictionnary = @{ + kOpenExtensionOutcomeSuccess : @5, + kOpenExtensionOutcomeFailureInvalidURL : @10, + kOpenExtensionOutcomeFailureURLNotFound : @3, + }; + + NSUserDefaults* shared_defaults = app_group::GetGroupUserDefaults(); + + [shared_defaults setObject:open_extension_test_dictionnary + forKey:kOpenExtensionOutcomes]; + + LogOpenExtensionMetrics(); + + histogram_tester.ExpectTotalCount("IOSOpenExtensionOutcome", 18); + + EXPECT_FALSE([shared_defaults objectForKey:kOpenExtensionOutcomes]); +}
diff --git a/ios/chrome/open_extension/open_view_controller.mm b/ios/chrome/open_extension/open_view_controller.mm index 070e25c..ab05111 100644 --- a/ios/chrome/open_extension/open_view_controller.mm +++ b/ios/chrome/open_extension/open_view_controller.mm
@@ -9,6 +9,7 @@ #import "base/apple/bundle_locations.h" #import "base/apple/foundation_util.h" #import "base/ios/block_types.h" +#import "base/notreached.h" #import "base/strings/sys_string_conversions.h" #import "ios/chrome/common/app_group/app_group_command.h" #import "ios/chrome/common/app_group/app_group_constants.h" @@ -17,6 +18,59 @@ // `idResponse` type depends on the element beeing fetched. using ItemBlock = void (^)(id idResponse, NSError* error); +namespace { + +// Logs the new outcome by incrementing the outcome dictionary's values. +void LogOutcome(app_group::OpenExtensionOutcome outcome_type) { + NSUserDefaults* shared_defaults = app_group::GetGroupUserDefaults(); + + NSMutableDictionary<NSString*, NSNumber*>* + open_extension_outcome_dictionnary = [[shared_defaults + dictionaryForKey:app_group::kOpenExtensionOutcomes] mutableCopy]; + + if (!open_extension_outcome_dictionnary) { + open_extension_outcome_dictionnary = [NSMutableDictionary dictionary]; + } + + NSString* key_for_outcome_type = KeyForOpenExtensionOutcomeType(outcome_type); + + NSInteger old_value_for_open_in_outcome = + open_extension_outcome_dictionnary[key_for_outcome_type].integerValue; + + [open_extension_outcome_dictionnary + setValue:@(old_value_for_open_in_outcome + 1) + forKey:key_for_outcome_type]; + + [shared_defaults setObject:open_extension_outcome_dictionnary + forKey:app_group::kOpenExtensionOutcomes]; + [shared_defaults synchronize]; +} + +// Convert outcome_type to an error type. +NSError* ErrorForOutcome(app_group::OpenExtensionOutcome outcome_type) { + NSInteger error_code = NSURLErrorUnknown; + switch (outcome_type) { + case app_group::OpenExtensionOutcome::kFailureInvalidURL: + error_code = NSURLErrorBadURL; + break; + case app_group::OpenExtensionOutcome::kFailureURLNotFound: + error_code = NSURLErrorBadURL; + break; + case app_group::OpenExtensionOutcome::kFailureOpenInNotFound: + error_code = NSURLErrorUnknown; + break; + case app_group::OpenExtensionOutcome::kFailureUnsupportedScheme: + error_code = NSURLErrorUnsupportedURL; + break; + default: + NOTREACHED_NORETURN(); + } + return [NSError errorWithDomain:NSURLErrorDomain + code:error_code + userInfo:nil]; +} +} // namespace + @implementation OpenViewController { NSURL* _openInURL; NSExtensionItem* _openInItem; @@ -40,7 +94,9 @@ ItemBlock URLCompletion = ^(id idURL, NSError* error) { NSURL* URL = base::apple::ObjCCast<NSURL>(idURL); if (!URL) { - [self displayErrorView]; + // Display the error view when the URL is invalid. + [self displayErrorViewForOutcome:app_group::OpenExtensionOutcome:: + kFailureInvalidURL]; return; } dispatch_async(dispatch_get_main_queue(), ^{ @@ -53,9 +109,10 @@ } } } - // Display the error view when no match have been found. + // Display the error view when no URL has been found. if (!foundMatch) { - [self displayErrorView]; + [self displayErrorViewForOutcome:app_group::OpenExtensionOutcome:: + kFailureURLNotFound]; } } @@ -66,7 +123,8 @@ [[_openInURL scheme] isEqualToString:@"https"]) { [self openInChrome]; } else { - [self displayErrorView]; + [self displayErrorViewForOutcome:app_group::OpenExtensionOutcome:: + kFailureUnsupportedScheme]; } } @@ -75,19 +133,19 @@ while ((responder = responder.nextResponder)) { if ([responder respondsToSelector:@selector(openURL:)]) { - [self prepareCommand:responder]; + LogOutcome(app_group::OpenExtensionOutcome::kSuccess); + [self openInURL:responder]; [self.extensionContext completeRequestReturningItems:@[ _openInItem ] completionHandler:nil]; return; } } - [self.extensionContext - cancelRequestWithError:[NSError errorWithDomain:NSURLErrorDomain - code:NSURLErrorUnknown - userInfo:nil]]; + // Display the error view when Open in is not found + [self displayErrorViewForOutcome:app_group::OpenExtensionOutcome:: + kFailureOpenInNotFound]; } -- (void)prepareCommand:(UIResponder*)responder { +- (void)openInURL:(UIResponder*)responder { AppGroupCommand* command = [[AppGroupCommand alloc] initWithSourceApp:app_group::kOpenCommandSourceOpenExtension URLOpenerBlock:^(NSURL* openURL) { @@ -97,14 +155,16 @@ [command executeInApp]; } -- (void)displayErrorView { +- (void)displayErrorViewForOutcome:(app_group::OpenExtensionOutcome)outcome { __weak OpenViewController* weakSelf = self; dispatch_async(dispatch_get_main_queue(), ^{ - [weakSelf displayErrorViewMainThread]; + [weakSelf displayErrorViewMainThreadForOutcome:outcome]; }); } -- (void)displayErrorViewMainThread { +- (void)displayErrorViewMainThreadForOutcome: + (app_group::OpenExtensionOutcome)outcome { + LogOutcome(outcome); NSString* errorMessage = NSLocalizedString(@"IDS_IOS_ERROR_MESSAGE_OPEN_IN_EXTENSION", @"The error message to display to the user."); @@ -115,18 +175,15 @@ [UIAlertController alertControllerWithTitle:errorMessage message:[_openInURL absoluteString] preferredStyle:UIAlertControllerStyleAlert]; + __weak __typeof(self) weakSelf = self; - UIAlertAction* defaultAction = - [UIAlertAction actionWithTitle:okButton - style:UIAlertActionStyleDefault - handler:^(UIAlertAction* action) { - NSError* unsupportedURLError = [NSError - errorWithDomain:NSURLErrorDomain - code:NSURLErrorUnsupportedURL - userInfo:nil]; - [weakSelf.extensionContext - cancelRequestWithError:unsupportedURLError]; - }]; + UIAlertAction* defaultAction = [UIAlertAction + actionWithTitle:okButton + style:UIAlertActionStyleDefault + handler:^(UIAlertAction* action) { + NSError* outcomeError = ErrorForOutcome(outcome); + [weakSelf.extensionContext cancelRequestWithError:outcomeError]; + }]; [alert addAction:defaultAction]; [self presentViewController:alert animated:YES completion:nil]; }
diff --git a/ios/chrome/test/BUILD.gn b/ios/chrome/test/BUILD.gn index 88c34f4..bb0dd676 100644 --- a/ios/chrome/test/BUILD.gn +++ b/ios/chrome/test/BUILD.gn
@@ -450,6 +450,7 @@ "//ios/chrome/browser/web_state_list/web_usage_enabler:unit_tests", "//ios/chrome/browser/webui/model:unit_tests", "//ios/chrome/common:unit_tests", + "//ios/chrome/common/app_group:unit_tests", "//ios/chrome/common/credential_provider:unit_tests", "//ios/chrome/common/ui/reauthentication:unit_tests", "//ios/chrome/common/ui/util:unit_tests",
diff --git a/ios_internal b/ios_internal index 78b862d..c461053 160000 --- a/ios_internal +++ b/ios_internal
@@ -1 +1 @@ -Subproject commit 78b862d4d5a1ad7f924894d0ba701f2f78a9f099 +Subproject commit c4610539334011296a98d308231836aafae3208c
diff --git a/media/renderers/paint_canvas_video_renderer.cc b/media/renderers/paint_canvas_video_renderer.cc index 3b7476e..4ca7085 100644 --- a/media/renderers/paint_canvas_video_renderer.cc +++ b/media/renderers/paint_canvas_video_renderer.cc
@@ -1653,14 +1653,19 @@ raster_context_provider, static_cast<GLenum>(internal_format), type); // Create a SharedImage to associate with `texture`. + uint32_t usage = + gpu::SHARED_IMAGE_USAGE_GLES2 | gpu::SHARED_IMAGE_USAGE_RASTER; + if (raster_context_provider->ContextCapabilities().supports_oop_raster) { + usage |= gpu::SHARED_IMAGE_USAGE_OOP_RASTERIZATION; + } + gpu::MailboxHolder destination_holder; destination_holder.texture_target = target; destination_holder.mailbox = sii->CreateSharedImage( shared_image_format, video_frame->visible_rect().size(), GetVideoFrameRGBColorSpacePreferringSRGB(video_frame.get()), - kTopLeft_GrSurfaceOrigin, kPremul_SkAlphaType, - gpu::SHARED_IMAGE_USAGE_GLES2, "PaintCanvasVideoRenderer_DirectUpload", - gpu::kNullSurfaceHandle); + kTopLeft_GrSurfaceOrigin, kPremul_SkAlphaType, usage, + "PaintCanvasVideoRenderer_DirectUpload", gpu::kNullSurfaceHandle); // Copy the VideoFrame's textures to the SI. destination_holder.sync_token = sii->GenUnverifiedSyncToken();
diff --git a/net/BUILD.gn b/net/BUILD.gn index 17f82c2..21f4526 100644 --- a/net/BUILD.gn +++ b/net/BUILD.gn
@@ -1675,7 +1675,6 @@ ":cronet_buildflags", ":isolation_info_proto", ":net_export_header", - ":net_resources", ":preload_decoder", "//base", "//base/third_party/dynamic_annotations", @@ -1685,6 +1684,10 @@ "//url:buildflags", ] + if (!disable_file_support) { + public_deps += [ ":net_resources" ] + } + public_configs = net_configs if (use_gio) {
diff --git a/net/base/features.cc b/net/base/features.cc index 4b7a07b..026d59d3 100644 --- a/net/base/features.cc +++ b/net/base/features.cc
@@ -75,20 +75,6 @@ "UseAlternativePortForGloballyReachableCheck", base::FEATURE_DISABLED_BY_DEFAULT); -const base::FeatureParam<IPv6ReachabilityOverride>::Option - ipv6_reachability_override_options[] = { - {IPv6ReachabilityOverride::kReachable, "reachable"}, - {IPv6ReachabilityOverride::kUniqueLocalAddressReachable, - "unique_local_address"}, - {IPv6ReachabilityOverride::kPubliclyRoutable, "publicly_routable"}, -}; - -const base::FeatureParam<IPv6ReachabilityOverride> - kIPv6ReachabilityOverrideParam{&kEnableIPv6ReachabilityOverride, - "IPv6ReachabilityOverride", - IPv6ReachabilityOverride::kReachable, - &ipv6_reachability_override_options}; - BASE_FEATURE(kEnableIPv6ReachabilityOverride, "EnableIPv6ReachabilityOverride", base::FEATURE_DISABLED_BY_DEFAULT);
diff --git a/net/base/features.h b/net/base/features.h index 3e16ef3f..72e65af5 100644 --- a/net/base/features.h +++ b/net/base/features.h
@@ -95,16 +95,6 @@ kAlternativePortForGloballyReachableCheck; NET_EXPORT BASE_DECLARE_FEATURE(kUseAlternativePortForGloballyReachableCheck); -enum class IPv6ReachabilityOverride { - // Reachable when the system has at least one valid address. - kReachable, - // Reachable when the system has a unique local address. - kUniqueLocalAddressReachable, - // Reachable when the system has a publicly routable address. - kPubliclyRoutable, -}; -NET_EXPORT extern const base::FeatureParam<IPv6ReachabilityOverride> - kIPv6ReachabilityOverrideParam; // If enabled, overrides IPv6 reachability probe results based on the system's // IP addresses. NET_EXPORT BASE_DECLARE_FEATURE(kEnableIPv6ReachabilityOverride);
diff --git a/net/dns/host_resolver_manager.cc b/net/dns/host_resolver_manager.cc index 171fd9e..3117496 100644 --- a/net/dns/host_resolver_manager.cc +++ b/net/dns/host_resolver_manager.cc
@@ -502,51 +502,6 @@ return features::kAlternativePortForGloballyReachableCheck.Get(); } -bool IsIPv6AddressReachable(const IPAddress& address) { - if (!address.IsIPv6()) { - return false; - } - if (address.IsLoopback()) { - return false; - } - if (address.IsIPv4MappedIPv6()) { - return false; - } - - switch (features::kIPv6ReachabilityOverrideParam.Get()) { - case features::IPv6ReachabilityOverride::kReachable: - return true; - case features::IPv6ReachabilityOverride::kUniqueLocalAddressReachable: - return address.IsUniqueLocalIPv6(); - case features::IPv6ReachabilityOverride::kPubliclyRoutable: - return address.IsPubliclyRoutable(); - } -} - -bool NetworkInterfaceListHasReachableIPv6Address( - const NetworkInterfaceList& interfaces) { - for (const auto& interface : interfaces) { - if (IsIPv6AddressReachable(interface.address)) { - return true; - } - } - return false; -} - -bool SystemHasReachableIPv6Address() { - CHECK( - base::FeatureList::IsEnabled(features::kEnableIPv6ReachabilityOverride)); - - NetworkInterfaceList interfaces; - GetNetworkList(&interfaces, EXCLUDE_HOST_SCOPE_VIRTUAL_INTERFACES); - return NetworkInterfaceListHasReachableIPv6Address(interfaces); -} - -absl::optional<NetworkInterfaceList>& NetworkInterfaceListForTesting() { - static base::NoDestructor<absl::optional<NetworkInterfaceList>> interfaces; - return *interfaces; -} - } // namespace //----------------------------------------------------------------------------- @@ -2999,6 +2954,8 @@ system_dns_config_notifier_(system_dns_config_notifier), target_network_(target_network), check_ipv6_on_wifi_(options.check_ipv6_on_wifi), + ipv6_reachability_override_(base::FeatureList::IsEnabled( + features::kEnableIPv6ReachabilityOverride)), tick_clock_(base::DefaultTickClock::GetInstance()), https_svcb_options_( options.https_svcb_options @@ -3025,7 +2982,6 @@ if (system_dns_config_notifier_) system_dns_config_notifier_->AddObserver(this); EnsureSystemHostResolverCallReady(); - MaybeCheckIPv6ReachabilityOverride(); auto connection_type = IsBoundToNetwork() @@ -3231,12 +3187,6 @@ max_queued_jobs_ = value; } -// static -void HostResolverManager::SetNetworkListForTesting( - NetworkInterfaceList interfaces) { - NetworkInterfaceListForTesting() = std::move(interfaces); // IN-TEST -} - void HostResolverManager::SetHaveOnlyLoopbackAddresses(bool result) { if (result) { additional_resolver_flags_ |= HOST_RESOLVER_LOOPBACK_ONLY; @@ -4058,39 +4008,6 @@ weak_ptr_factory_.GetWeakPtr())); } -void HostResolverManager::MaybeCheckIPv6ReachabilityOverride() { - if (!base::FeatureList::IsEnabled( - features::kEnableIPv6ReachabilityOverride)) { - return; - } - - // NetworkInterfaceListForTesting() can only be called from the main thread. - if (NetworkInterfaceListForTesting().has_value()) { - NetworkInterfaceList interfaces = - *NetworkInterfaceListForTesting(); // IN-TEST - base::SequencedTaskRunner::GetCurrentDefault()->PostTaskAndReplyWithResult( - FROM_HERE, - base::BindOnce(&NetworkInterfaceListHasReachableIPv6Address, - interfaces), - base::BindOnce(&HostResolverManager::SetIPv6ReachabilityOverride, - weak_ptr_factory_.GetWeakPtr())); - return; - } - - base::ThreadPool::PostTaskAndReplyWithResult( - FROM_HERE, - {base::MayBlock(), base::TaskShutdownBehavior::CONTINUE_ON_SHUTDOWN}, - base::BindOnce(&SystemHasReachableIPv6Address), - base::BindOnce(&HostResolverManager::SetIPv6ReachabilityOverride, - weak_ptr_factory_.GetWeakPtr())); -} - -void HostResolverManager::SetIPv6ReachabilityOverride(bool reachable) { - CHECK( - base::FeatureList::IsEnabled(features::kEnableIPv6ReachabilityOverride)); - ipv6_reachability_override_ = reachable; -} - void HostResolverManager::RemoveAllJobs(const ResolveContext* context) { for (auto it = jobs_.begin(); it != jobs_.end();) { const JobKey& key = it->first; @@ -4186,7 +4103,6 @@ BUILDFLAG(IS_FUCHSIA) RunLoopbackProbeJob(); #endif - MaybeCheckIPv6ReachabilityOverride(); AbortJobsWithoutTargetNetwork(true /* in_progress_only */); // `this` may be deleted inside AbortJobsWithoutTargetNetwork(). }
diff --git a/net/dns/host_resolver_manager.h b/net/dns/host_resolver_manager.h index 3d3048e2..655ab77 100644 --- a/net/dns/host_resolver_manager.h +++ b/net/dns/host_resolver_manager.h
@@ -267,8 +267,6 @@ handles::NetworkHandle target_network, NetLog* net_log); - static void SetNetworkListForTesting(NetworkInterfaceList interfaces); - protected: // Callback from HaveOnlyLoopbackAddresses probe. void SetHaveOnlyLoopbackAddresses(bool result); @@ -466,9 +464,6 @@ // Asynchronously checks if only loopback IPs are available. virtual void RunLoopbackProbeJob(); - void MaybeCheckIPv6ReachabilityOverride(); - void SetIPv6ReachabilityOverride(bool reachable); - // Records the result in cache if cache is present. void CacheResult(HostCache* cache, const HostCache::Key& key,
diff --git a/net/dns/host_resolver_manager_unittest.cc b/net/dns/host_resolver_manager_unittest.cc index 1172e401..d8ceb1ac 100644 --- a/net/dns/host_resolver_manager_unittest.cc +++ b/net/dns/host_resolver_manager_unittest.cc
@@ -547,12 +547,6 @@ return **it; } -NetworkInterface NetworkInterfaceFromIpLiteral(base::StringPiece ip_literal) { - NetworkInterface interface; - interface.address = *IPAddress::FromIPLiteral(ip_literal); - return interface; -} - } // namespace class HostResolverManagerTest : public TestWithTaskEnvironment { @@ -14312,43 +14306,30 @@ class HostResolverManagerIPv6ReachabilityOverrideTest : public HostResolverManagerDnsTest, - public testing::WithParamInterface<features::IPv6ReachabilityOverride> { + public testing::WithParamInterface<bool> { public: static constexpr const char kTargetHost[] = "host.test"; HostResolverManagerIPv6ReachabilityOverrideTest() { std::map<std::string, std::string> field_trial_params; - switch (GetParam()) { - case features::IPv6ReachabilityOverride::kReachable: - field_trial_params["IPv6ReachabilityOverride"] = "reachable"; - break; - case features::IPv6ReachabilityOverride::kUniqueLocalAddressReachable: - field_trial_params["IPv6ReachabilityOverride"] = "unique_local_address"; - break; - case features::IPv6ReachabilityOverride::kPubliclyRoutable: - field_trial_params["IPv6ReachabilityOverride"] = "publicly_routable"; - break; + if (GetParam()) { + feature_list_.InitAndEnableFeature( + features::kEnableIPv6ReachabilityOverride); + } else { + feature_list_.InitAndDisableFeature( + features::kEnableIPv6ReachabilityOverride); } - feature_list_.InitAndEnableFeatureWithParameters( - features::kEnableIPv6ReachabilityOverride, - std::move(field_trial_params)); } protected: void SetUp() override { HostResolverManagerDnsTest::SetUp(); - // Make the global reachiability probe failed. CreateResolverWithLimitsAndParams(kMaxJobs, DefaultParams(proc_), /*ipv6_reachable=*/false, /*check_ipv6_on_wifi=*/true); ChangeDnsConfig(CreateValidDnsConfig()); - - // At this point we have two tasks for the IPv6ReachabilityOverride check - // in the thread pool. One is created by HostResolverManagerDnsTest::Setup() - // and the other is created by ChangeDnsConfig(). Wait for these tasks to - // make sure that these tasks don't override the result after - // SetNetworkInterfaces() calls in test cases. + // Wait until ongoing probe tasks finish. RunUntilIdle(); // This rule is used when only A record is queried. @@ -14359,119 +14340,30 @@ "192.0.2.1,2001:db8::1"); } - void SetNetworkInterfaces(NetworkInterfaceList interfaces) { - HostResolverManager::SetNetworkListForTesting(std::move(interfaces)); - NetworkChangeNotifier::NotifyObserversOfIPAddressChangeForTests(); - RunUntilIdle(); - } - - ResolveHostResponseHelper CreateRequest() { - proc_->SignalMultiple(1u); - return ResolveHostResponseHelper(resolver_->CreateRequest( - url::SchemeHostPort(url::kHttpScheme, kTargetHost, 80), - NetworkAnonymizationKey(), NetLogWithSource(), absl::nullopt, - resolve_context_.get(), resolve_context_->host_cache())); - } - - void ExpectResponseHasIPv4AddressOnly(ResolveHostResponseHelper& response) { - EXPECT_THAT(response.result_error(), IsOk()); - EXPECT_THAT(response.request()->GetAddressResults()->endpoints(), - testing::UnorderedElementsAre(CreateExpected("192.0.2.1", 80))); - } - - void ExpectResponseHasIPv4AndIPv6Addresses( - ResolveHostResponseHelper& response) { - EXPECT_THAT(response.result_error(), IsOk()); - EXPECT_THAT( - response.request()->GetAddressResults()->endpoints(), - testing::UnorderedElementsAre(CreateExpected("192.0.2.1", 80), - CreateExpected("2001:db8::1", 80))); - } - private: base::test::ScopedFeatureList feature_list_; }; -INSTANTIATE_TEST_SUITE_P( - All, - HostResolverManagerIPv6ReachabilityOverrideTest, - ::testing::Values( - features::IPv6ReachabilityOverride::kReachable, - features::IPv6ReachabilityOverride::kUniqueLocalAddressReachable, - features::IPv6ReachabilityOverride::kPubliclyRoutable)); +INSTANTIATE_TEST_SUITE_P(All, + HostResolverManagerIPv6ReachabilityOverrideTest, + testing::Bool()); -TEST_P(HostResolverManagerIPv6ReachabilityOverrideTest, Loopback) { - SetNetworkInterfaces({NetworkInterfaceFromIpLiteral("192.168.1.42"), - NetworkInterfaceFromIpLiteral("::1")}); +TEST_P(HostResolverManagerIPv6ReachabilityOverrideTest, Request) { + proc_->SignalMultiple(1u); + ResolveHostResponseHelper response(resolver_->CreateRequest( + url::SchemeHostPort(url::kHttpScheme, kTargetHost, 80), + NetworkAnonymizationKey(), NetLogWithSource(), absl::nullopt, + resolve_context_.get(), resolve_context_->host_cache())); + EXPECT_THAT(response.result_error(), IsOk()); - ResolveHostResponseHelper response = CreateRequest(); - - ExpectResponseHasIPv4AddressOnly(response); -} - -TEST_P(HostResolverManagerIPv6ReachabilityOverrideTest, IPv4MappedIPv6) { - SetNetworkInterfaces({NetworkInterfaceFromIpLiteral("192.168.1.42"), - NetworkInterfaceFromIpLiteral("::ffff:192.0.2.2")}); - - ResolveHostResponseHelper response = CreateRequest(); - - ExpectResponseHasIPv4AddressOnly(response); -} - -TEST_P(HostResolverManagerIPv6ReachabilityOverrideTest, LinkLocal) { - SetNetworkInterfaces({NetworkInterfaceFromIpLiteral("192.168.1.42"), - NetworkInterfaceFromIpLiteral("fe80::5")}); - - ResolveHostResponseHelper response = CreateRequest(); - - switch (GetParam()) { - case features::IPv6ReachabilityOverride::kReachable: - ExpectResponseHasIPv4AndIPv6Addresses(response); - break; - case features::IPv6ReachabilityOverride::kUniqueLocalAddressReachable: - ExpectResponseHasIPv4AddressOnly(response); - break; - case features::IPv6ReachabilityOverride::kPubliclyRoutable: - ExpectResponseHasIPv4AddressOnly(response); - break; - } -} - -TEST_P(HostResolverManagerIPv6ReachabilityOverrideTest, UniqueLocal) { - SetNetworkInterfaces({NetworkInterfaceFromIpLiteral("192.168.1.42"), - NetworkInterfaceFromIpLiteral("fc00::5")}); - - ResolveHostResponseHelper response = CreateRequest(); - - switch (GetParam()) { - case features::IPv6ReachabilityOverride::kReachable: - ExpectResponseHasIPv4AndIPv6Addresses(response); - break; - case features::IPv6ReachabilityOverride::kUniqueLocalAddressReachable: - ExpectResponseHasIPv4AndIPv6Addresses(response); - break; - case features::IPv6ReachabilityOverride::kPubliclyRoutable: - ExpectResponseHasIPv4AddressOnly(response); - break; - } -} - -TEST_P(HostResolverManagerIPv6ReachabilityOverrideTest, PubliclyRoutable) { - SetNetworkInterfaces({NetworkInterfaceFromIpLiteral("192.168.1.42"), - NetworkInterfaceFromIpLiteral("2000::5")}); - - ResolveHostResponseHelper response = CreateRequest(); - - switch (GetParam()) { - case features::IPv6ReachabilityOverride::kReachable: - ExpectResponseHasIPv4AndIPv6Addresses(response); - break; - case features::IPv6ReachabilityOverride::kUniqueLocalAddressReachable: - ExpectResponseHasIPv4AddressOnly(response); - break; - case features::IPv6ReachabilityOverride::kPubliclyRoutable: - ExpectResponseHasIPv4AndIPv6Addresses(response); - break; + if (GetParam()) { + EXPECT_THAT( + response.request()->GetAddressResults()->endpoints(), + testing::UnorderedElementsAre(CreateExpected("192.0.2.1", 80), + CreateExpected("2001:db8::1", 80))); + } else { + EXPECT_THAT(response.request()->GetAddressResults()->endpoints(), + testing::UnorderedElementsAre(CreateExpected("192.0.2.1", 80))); } }
diff --git a/net/features.gni b/net/features.gni index a120775..8027cba 100644 --- a/net/features.gni +++ b/net/features.gni
@@ -7,7 +7,8 @@ declare_args() { # Disables support for file URLs. File URL support requires use of icu. - disable_file_support = false + # Cronet does not support file URLs. + disable_file_support = is_cronet_build # WebSockets and socket stream code are not used when blink is not used # and are optional in cronet.
diff --git a/net/quic/dedicated_web_transport_http3_client.cc b/net/quic/dedicated_web_transport_http3_client.cc index ed09ab8..d839f6f 100644 --- a/net/quic/dedicated_web_transport_http3_client.cc +++ b/net/quic/dedicated_web_transport_http3_client.cc
@@ -194,8 +194,7 @@ supported_versions, connection, server_id, - crypto_config, - /*push_promise_index=*/nullptr), + crypto_config), client_(client) {} bool OnSettingsFrame(const quic::SettingsFrame& frame) override {
diff --git a/net/quic/quic_chromium_client_session.cc b/net/quic/quic_chromium_client_session.cc index 643685c6..9ba1eea 100644 --- a/net/quic/quic_chromium_client_session.cc +++ b/net/quic/quic_chromium_client_session.cc
@@ -893,7 +893,6 @@ NetLog* net_log) : quic::QuicSpdyClientSessionBase(connection, /*visitor=*/nullptr, - /*push_promise_index=*/nullptr, config, connection->supported_versions()), session_key_(session_key),
diff --git a/net/quic/quic_chromium_client_stream_test.cc b/net/quic/quic_chromium_client_stream_test.cc index 6fb88aa..2348d9b5 100644 --- a/net/quic/quic_chromium_client_stream_test.cc +++ b/net/quic/quic_chromium_client_stream_test.cc
@@ -140,7 +140,6 @@ quic::QuicConnection* connection) : quic::QuicSpdyClientSessionBase(connection, /*visitor=*/nullptr, - /*push_promise_index=*/nullptr, quic::test::DefaultQuicConfig(), connection->supported_versions()) { crypto_stream_ = std::make_unique<quic::test::MockQuicCryptoStream>(this);
diff --git a/net/socket/udp_socket_posix.cc b/net/socket/udp_socket_posix.cc index 02000d88..ac4a3e58 100644 --- a/net/socket/udp_socket_posix.cc +++ b/net/socket/udp_socket_posix.cc
@@ -594,14 +594,25 @@ DCHECK_NE(socket_, kInvalidSocket); DCHECK_CALLED_ON_VALID_THREAD(thread_checker_); - int rv; unsigned int ecn = 1; if (addr_family_ == AF_INET6) { - rv = setsockopt(socket_, IPPROTO_IPV6, IPV6_RECVTCLASS, &ecn, sizeof(ecn)); - } else { - DCHECK_EQ(addr_family_, AF_INET); - rv = setsockopt(socket_, IPPROTO_IP, IP_RECVTOS, &ecn, sizeof(ecn)); + if (setsockopt(socket_, IPPROTO_IPV6, IPV6_RECVTCLASS, &ecn, sizeof(ecn)) != + 0) { + return MapSystemError(errno); + } + + int v6_only = false; + socklen_t v6_only_len = sizeof(v6_only); + if (getsockopt(socket_, IPPROTO_IPV6, IPV6_V6ONLY, &v6_only, + &v6_only_len) != 0) { + return MapSystemError(errno); + } + if (v6_only) { + return OK; + } } + + int rv = setsockopt(socket_, IPPROTO_IP, IP_RECVTOS, &ecn, sizeof(ecn)); return rv == 0 ? OK : MapSystemError(errno); }
diff --git a/net/third_party/quiche/src b/net/third_party/quiche/src index cc0614c..c780c70 160000 --- a/net/third_party/quiche/src +++ b/net/third_party/quiche/src
@@ -1 +1 @@ -Subproject commit cc0614c8ab209e297f7b17ab3d04618fee327a4f +Subproject commit c780c704064c03692437fcf2093ba2fa58076584
diff --git a/net/tools/quic/quic_simple_client.cc b/net/tools/quic/quic_simple_client.cc index b8ac2943..cdc7bf5e 100644 --- a/net/tools/quic/quic_simple_client.cc +++ b/net/tools/quic/quic_simple_client.cc
@@ -64,8 +64,7 @@ quic::QuicConnection* connection) { return std::make_unique<quic::QuicSimpleClientSession>( *config(), supported_versions, connection, network_helper(), server_id(), - crypto_config(), push_promise_index(), drop_response_body(), - /*enable_web_transport=*/false); + crypto_config(), drop_response_body(), /*enable_web_transport=*/false); } QuicChromiumConnectionHelper* QuicSimpleClient::CreateQuicConnectionHelper() {
diff --git a/services/device/device_service.cc b/services/device/device_service.cc index 6e08d3a5..c73e2a7 100644 --- a/services/device/device_service.cc +++ b/services/device/device_service.cc
@@ -157,10 +157,10 @@ receivers_.Add(this, std::move(receiver)); } -void DeviceService::SetPlatformSensorProviderForTesting( - std::unique_ptr<PlatformSensorProvider> provider) { - DCHECK(!sensor_provider_); - sensor_provider_ = std::make_unique<SensorProviderImpl>(std::move(provider)); +void DeviceService::SetSensorProviderImplForTesting( + std::unique_ptr<SensorProviderImpl> sensor_provider) { + CHECK(!sensor_provider_); + sensor_provider_ = std::move(sensor_provider); } // static
diff --git a/services/device/device_service.h b/services/device/device_service.h index 7c2dc7c..a860fc7 100644 --- a/services/device/device_service.h +++ b/services/device/device_service.h
@@ -81,7 +81,6 @@ class DeviceService; class GeolocationManager; -class PlatformSensorProvider; class PowerMonitorMessageBroadcaster; class PressureManagerImpl; class PublicIpAddressLocationNotifier; @@ -127,8 +126,8 @@ void AddReceiver(mojo::PendingReceiver<mojom::DeviceService> receiver); - void SetPlatformSensorProviderForTesting( - std::unique_ptr<PlatformSensorProvider> provider); + void SetSensorProviderImplForTesting( + std::unique_ptr<SensorProviderImpl> sensor_provider); // Supports global override of GeolocationContext binding within the service. using GeolocationContextBinder = base::RepeatingCallback<void(
diff --git a/services/device/generic_sensor/BUILD.gn b/services/device/generic_sensor/BUILD.gn index efe1366..b119008 100644 --- a/services/device/generic_sensor/BUILD.gn +++ b/services/device/generic_sensor/BUILD.gn
@@ -46,6 +46,10 @@ "sensor_impl.h", "sensor_provider_impl.cc", "sensor_provider_impl.h", + "virtual_platform_sensor.cc", + "virtual_platform_sensor.h", + "virtual_platform_sensor_provider.cc", + "virtual_platform_sensor_provider.h", ] deps = [
diff --git a/services/device/generic_sensor/fake_platform_sensor_and_provider.cc b/services/device/generic_sensor/fake_platform_sensor_and_provider.cc index 7d1df16..c382f97 100644 --- a/services/device/generic_sensor/fake_platform_sensor_and_provider.cc +++ b/services/device/generic_sensor/fake_platform_sensor_and_provider.cc
@@ -70,10 +70,6 @@ UpdateSharedBufferAndNotifyClients(reading); } -void FakePlatformSensor::TriggerError() { - NotifySensorError(); -} - FakePlatformSensorProvider::FakePlatformSensorProvider() { ON_CALL(*this, DoCreateSensorInternal(_, _, _)) .WillByDefault(
diff --git a/services/device/generic_sensor/fake_platform_sensor_and_provider.h b/services/device/generic_sensor/fake_platform_sensor_and_provider.h index 3e0e2f3..ca906bb 100644 --- a/services/device/generic_sensor/fake_platform_sensor_and_provider.h +++ b/services/device/generic_sensor/fake_platform_sensor_and_provider.h
@@ -33,9 +33,6 @@ // Public interface to UpdateSharedBufferAndNotifyClients(). void AddNewReading(const SensorReading& reading); - // Public interface to NotifySensorError(). - void TriggerError(); - protected: void StopSensor() override {}
diff --git a/services/device/generic_sensor/generic_sensor_service_unittest.cc b/services/device/generic_sensor/generic_sensor_service_unittest.cc index 2b866b5..bdcac77 100644 --- a/services/device/generic_sensor/generic_sensor_service_unittest.cc +++ b/services/device/generic_sensor/generic_sensor_service_unittest.cc
@@ -2,6 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include <algorithm> + #include "base/barrier_closure.h" #include "base/functional/bind.h" #include "base/functional/callback_forward.h" @@ -20,6 +22,9 @@ #include "services/device/generic_sensor/fake_platform_sensor_and_provider.h" #include "services/device/generic_sensor/platform_sensor.h" #include "services/device/generic_sensor/platform_sensor_provider.h" +#include "services/device/generic_sensor/sensor_provider_impl.h" +#include "services/device/generic_sensor/virtual_platform_sensor.h" +#include "services/device/generic_sensor/virtual_platform_sensor_provider.h" #include "services/device/public/cpp/device_features.h" #include "services/device/public/cpp/generic_sensor/platform_sensor_configuration.h" #include "services/device/public/cpp/generic_sensor/sensor_reading.h" @@ -35,6 +40,11 @@ namespace { +// These values match what FakePlatformSensor reports and are somewhat +// arbitrary. +constexpr double kMinimumPlatformFrequency = 1.0; +constexpr double kMaximumPlatformFrequency = 50.0; + class TestSensorClient : public mojom::SensorClient { public: TestSensorClient(SensorType type) : type_(type) {} @@ -42,6 +52,10 @@ TestSensorClient(const TestSensorClient&) = delete; TestSensorClient& operator=(const TestSensorClient&) = delete; + bool FetchSensorReading(SensorReading* out_reading) { + return shared_buffer_reader_->GetReading(out_reading); + } + // Implements mojom::SensorClient: void SensorReadingChanged() override { if (!shared_buffer_reader_->GetReading(&reading_data_)) { @@ -77,14 +91,17 @@ ASSERT_TRUE(params); EXPECT_EQ(mojom::SensorCreationResult::SUCCESS, result); EXPECT_TRUE(params->memory.IsValid()); + + const double expected_maximum_frequency = std::min( + kMaximumPlatformFrequency, GetSensorMaxAllowedFrequency(type_)); + EXPECT_DOUBLE_EQ(expected_maximum_frequency, params->maximum_frequency); + EXPECT_DOUBLE_EQ(kMinimumPlatformFrequency, params->minimum_frequency); + const double expected_default_frequency = - std::min(30.0, GetSensorMaxAllowedFrequency(type_)); + std::clamp(params->default_configuration.frequency(), + kMinimumPlatformFrequency, expected_maximum_frequency); EXPECT_DOUBLE_EQ(expected_default_frequency, params->default_configuration.frequency()); - const double expected_maximum_frequency = - std::min(50.0, GetSensorMaxAllowedFrequency(type_)); - EXPECT_DOUBLE_EQ(expected_maximum_frequency, params->maximum_frequency); - EXPECT_DOUBLE_EQ(1.0, params->minimum_frequency); shared_buffer_reader_ = device::SensorReadingSharedBufferReader::Create( std::move(params->memory), params->buffer_offset); @@ -139,21 +156,79 @@ DeviceServiceTestBase::SetUp(); fake_platform_sensor_provider_ = new FakePlatformSensorProvider(); - device_service_impl()->SetPlatformSensorProviderForTesting( + sensor_provider_impl_ = new SensorProviderImpl( base::WrapUnique(fake_platform_sensor_provider_.get())); + device_service_impl()->SetSensorProviderImplForTesting( + base::WrapUnique(sensor_provider_impl_.get())); device_service()->BindSensorProvider( sensor_provider_.BindNewPipeAndPassReceiver()); } + protected: + mojom::CreateVirtualSensorResult CreateVirtualSensorSync(SensorType type) { + auto metadata = mojom::VirtualSensorMetadata::New(); + metadata->maximum_frequency = + mojom::NullableDouble::New(kMaximumPlatformFrequency); + metadata->minimum_frequency = + mojom::NullableDouble::New(kMinimumPlatformFrequency); + + // Make all sensor types have the same reporting mode for the tests to work + // as expected here (i.e. TestSensorClient::SensorReadingChanged() works + // reliably). + metadata->reporting_mode = + mojom::NullableReportingMode::New(mojom::ReportingMode::ON_CHANGE); + + base::test::TestFuture<mojom::CreateVirtualSensorResult> future; + sensor_provider_->CreateVirtualSensor(type, std::move(metadata), + future.GetCallback()); + return future.Get(); + } + + mojom::VirtualSensorInformationPtr GetVirtualSensorInformationSync( + SensorType type) { + base::test::TestFuture<mojom::GetVirtualSensorInformationResultPtr> + info_future; + sensor_provider_->GetVirtualSensorInformation(type, + info_future.GetCallback()); + EXPECT_EQ(info_future.Get()->which(), + mojom::GetVirtualSensorInformationResult::Tag::kInfo); + return std::move(info_future.Take()->get_info()); + } + + mojom::UpdateVirtualSensorResult UpdateVirtualSensorSync( + SensorType type, + double single_value) { + // SensorReading is a union, so we can always use reading.als here + // regardless of |type|. + SensorReading reading; + reading.als.value = single_value; + + base::test::TestFuture<mojom::UpdateVirtualSensorResult> future; + sensor_provider_->UpdateVirtualSensor(type, reading, future.GetCallback()); + return future.Get(); + } + + void AddReadingWithFrequency(SensorType type) { + const auto sensor_info = GetVirtualSensorInformationSync(type); + ASSERT_TRUE(sensor_info); + EXPECT_EQ(UpdateVirtualSensorSync(type, sensor_info->sampling_frequency), + mojom::UpdateVirtualSensorResult::kSuccess); + } + mojo::Remote<mojom::SensorProvider> sensor_provider_; base::test::ScopedFeatureList scoped_feature_list_; - // This object is owned by the DeviceService instance. - raw_ptr<FakePlatformSensorProvider> fake_platform_sensor_provider_; + raw_ptr<FakePlatformSensorProvider> + fake_platform_sensor_provider_; // Owned by |sensor_provider_impl_|. + raw_ptr<SensorProviderImpl> + sensor_provider_impl_; // Owned by the DeviceService instance. }; // Requests the SensorProvider to create a sensor. TEST_F(GenericSensorServiceTest, GetSensorTest) { + EXPECT_EQ(CreateVirtualSensorSync(SensorType::PROXIMITY), + mojom::CreateVirtualSensorResult::kSuccess); + auto client = std::make_unique<TestSensorClient>(SensorType::PROXIMITY); base::RunLoop run_loop; sensor_provider_->GetSensor( @@ -165,6 +240,9 @@ // Tests GetDefaultConfiguration. TEST_F(GenericSensorServiceTest, GetDefaultConfigurationTest) { + EXPECT_EQ(CreateVirtualSensorSync(SensorType::ACCELEROMETER), + mojom::CreateVirtualSensorResult::kSuccess); + auto client = std::make_unique<TestSensorClient>(SensorType::ACCELEROMETER); { base::RunLoop run_loop; @@ -175,14 +253,21 @@ run_loop.Run(); } + // TODO(crbug.com/1458770): this test is not very meaningful. It could be + // better to check if the default configuration is always clamped between the + // minimum and maximum allowed frequencies (it currently is not), for example. base::test::TestFuture<const PlatformSensorConfiguration&> future; client->sensor()->GetDefaultConfiguration(future.GetCallback()); - EXPECT_DOUBLE_EQ(30.0, future.Get().frequency()); + EXPECT_DOUBLE_EQ(GetSensorDefaultFrequency(SensorType::ACCELEROMETER), + future.Get().frequency()); } // Tests adding a valid configuration. Client should be notified by // SensorClient::SensorReadingChanged(). TEST_F(GenericSensorServiceTest, ValidAddConfigurationTest) { + EXPECT_EQ(CreateVirtualSensorSync(SensorType::AMBIENT_LIGHT), + mojom::CreateVirtualSensorResult::kSuccess); + auto client = std::make_unique<TestSensorClient>(SensorType::AMBIENT_LIGHT); { base::RunLoop run_loop; @@ -194,12 +279,16 @@ } EXPECT_TRUE(client->AddConfigurationSync(PlatformSensorConfiguration(50.0))); + AddReadingWithFrequency(SensorType::AMBIENT_LIGHT); EXPECT_DOUBLE_EQ(client->WaitForReading(), 50.0); } // Tests adding an invalid configuation, the max allowed frequency is 50.0 in // the mocked SensorImpl, while we add one with 60.0. TEST_F(GenericSensorServiceTest, InvalidAddConfigurationTest) { + EXPECT_EQ(CreateVirtualSensorSync(SensorType::LINEAR_ACCELERATION), + mojom::CreateVirtualSensorResult::kSuccess); + auto client = std::make_unique<TestSensorClient>(SensorType::LINEAR_ACCELERATION); { @@ -218,6 +307,9 @@ // Tests adding more than one clients. Sensor should send notification to all // its clients. TEST_F(GenericSensorServiceTest, MultipleClientsTest) { + EXPECT_EQ(CreateVirtualSensorSync(SensorType::PRESSURE), + mojom::CreateVirtualSensorResult::kSuccess); + auto client_1 = std::make_unique<TestSensorClient>(SensorType::PRESSURE); auto client_2 = std::make_unique<TestSensorClient>(SensorType::PRESSURE); { @@ -238,6 +330,7 @@ client_1->AddConfigurationSync(PlatformSensorConfiguration(48.0))); // Expect the SensorReadingChanged() will be called for both clients. + AddReadingWithFrequency(SensorType::PRESSURE); EXPECT_DOUBLE_EQ(client_1->WaitForReading(), 48.0); EXPECT_DOUBLE_EQ(client_2->WaitForReading(), 48.0); } @@ -245,6 +338,9 @@ // Tests adding more than one clients. If mojo connection is broken on one // client, other clients should not be affected. TEST_F(GenericSensorServiceTest, ClientMojoConnectionBrokenTest) { + EXPECT_EQ(CreateVirtualSensorSync(SensorType::PRESSURE), + mojom::CreateVirtualSensorResult::kSuccess); + auto client_1 = std::make_unique<TestSensorClient>(SensorType::PRESSURE); auto client_2 = std::make_unique<TestSensorClient>(SensorType::PRESSURE); { @@ -264,15 +360,18 @@ // Breaks mojo connection of client_1. client_1->ResetSensor(); + // Expect the SensorReadingChanged() will be called on client_2. EXPECT_TRUE( client_2->AddConfigurationSync(PlatformSensorConfiguration(48.0))); - - // Expect the SensorReadingChanged() will be called on client_2. + AddReadingWithFrequency(SensorType::PRESSURE); EXPECT_DOUBLE_EQ(client_2->WaitForReading(), 48.0); } // Test add and remove configuration operations. TEST_F(GenericSensorServiceTest, AddAndRemoveConfigurationTest) { + EXPECT_EQ(CreateVirtualSensorSync(SensorType::PRESSURE), + mojom::CreateVirtualSensorResult::kSuccess); + auto client = std::make_unique<TestSensorClient>(SensorType::PRESSURE); { base::RunLoop run_loop; @@ -286,17 +385,20 @@ // Expect the SensorReadingChanged() will be called. The frequency value // should be 10.0. EXPECT_TRUE(client->AddConfigurationSync(PlatformSensorConfiguration(10.0))); + AddReadingWithFrequency(SensorType::PRESSURE); EXPECT_DOUBLE_EQ(client->WaitForReading(), 10.0); // Expect the SensorReadingChanged() will be called. The frequency value // should be 40.0. PlatformSensorConfiguration configuration_40(40.0); EXPECT_TRUE(client->AddConfigurationSync(PlatformSensorConfiguration(40.0))); + AddReadingWithFrequency(SensorType::PRESSURE); EXPECT_DOUBLE_EQ(client->WaitForReading(), 40.0); // After |configuration_40| is removed, expect the SensorReadingChanged() will // be called. The frequency value should be 10.0. client->sensor()->RemoveConfiguration(configuration_40); + AddReadingWithFrequency(SensorType::PRESSURE); EXPECT_DOUBLE_EQ(client->WaitForReading(), 10.0); } @@ -308,6 +410,9 @@ // early quit of main thread (when there is an unexpected notification by // SensorReadingChanged()). TEST_F(GenericSensorServiceTest, SuspendTest) { + EXPECT_EQ(CreateVirtualSensorSync(SensorType::AMBIENT_LIGHT), + mojom::CreateVirtualSensorResult::kSuccess); + auto client = std::make_unique<TestSensorClient>(SensorType::AMBIENT_LIGHT); { base::RunLoop run_loop; @@ -328,10 +433,18 @@ EXPECT_TRUE(client->AddConfigurationSync(PlatformSensorConfiguration(30.0))); EXPECT_TRUE(client->AddConfigurationSync(PlatformSensorConfiguration(31.0))); + + const auto sensor_info = + GetVirtualSensorInformationSync(SensorType::AMBIENT_LIGHT); + ASSERT_TRUE(sensor_info); + EXPECT_DOUBLE_EQ(sensor_info->sampling_frequency, 0.0); } // Tests that error notifications are delivered even if a sensor is suspended. TEST_F(GenericSensorServiceTest, ErrorWhileSuspendedTest) { + EXPECT_EQ(CreateVirtualSensorSync(SensorType::AMBIENT_LIGHT), + mojom::CreateVirtualSensorResult::kSuccess); + auto client = std::make_unique<TestSensorClient>(SensorType::AMBIENT_LIGHT); { base::RunLoop run_loop; @@ -347,25 +460,24 @@ // Expect that SensorReadingChanged() will not be called. client->SetOnReadingChangedCallback( base::BindOnce([](double) { ADD_FAILURE() << "Unexpected reading."; })); - EXPECT_TRUE(client->AddConfigurationSync(PlatformSensorConfiguration(30.0))); // Expect that RaiseError() will be called. base::test::TestFuture<void> error_future; client->SetOnErrorCallback(error_future.GetCallback()); - auto scoped_sensor = - fake_platform_sensor_provider_->GetSensor(SensorType::AMBIENT_LIGHT); - auto* fake_platform_sensor = - static_cast<FakePlatformSensor*>(scoped_sensor.get()); - fake_platform_sensor->TriggerError(); - + base::test::TestFuture<void> future; + sensor_provider_->RemoveVirtualSensor(SensorType::AMBIENT_LIGHT, + future.GetCallback()); EXPECT_TRUE(error_future.Wait()); } // Test suspend and resume. After resuming, client can add configuration and // be notified by SensorReadingChanged() as usual. TEST_F(GenericSensorServiceTest, SuspendThenResumeTest) { + EXPECT_EQ(CreateVirtualSensorSync(SensorType::PRESSURE), + mojom::CreateVirtualSensorResult::kSuccess); + auto client = std::make_unique<TestSensorClient>(SensorType::PRESSURE); { base::RunLoop run_loop; @@ -379,20 +491,37 @@ // Expect the SensorReadingChanged() will be called. The frequency should // be 10.0 after AddConfiguration. EXPECT_TRUE(client->AddConfigurationSync(PlatformSensorConfiguration(10.0))); + AddReadingWithFrequency(SensorType::PRESSURE); EXPECT_DOUBLE_EQ(client->WaitForReading(), 10.0); client->sensor()->Suspend(); + { + const auto sensor_info = + GetVirtualSensorInformationSync(SensorType::PRESSURE); + ASSERT_TRUE(sensor_info); + EXPECT_DOUBLE_EQ(sensor_info->sampling_frequency, 0.0); + } client->sensor()->Resume(); + { + const auto sensor_info = + GetVirtualSensorInformationSync(SensorType::PRESSURE); + ASSERT_TRUE(sensor_info); + EXPECT_DOUBLE_EQ(sensor_info->sampling_frequency, 10.0); + } // Expect the SensorReadingChanged() will be called. The frequency should // be 50.0 after new configuration is added. EXPECT_TRUE(client->AddConfigurationSync(PlatformSensorConfiguration(50.0))); + AddReadingWithFrequency(SensorType::PRESSURE); EXPECT_DOUBLE_EQ(client->WaitForReading(), 50.0); } // Test suspend when there are more than one client. The suspended client won't // receive SensorReadingChanged() notification. TEST_F(GenericSensorServiceTest, MultipleClientsSuspendAndResumeTest) { + EXPECT_EQ(CreateVirtualSensorSync(SensorType::PRESSURE), + mojom::CreateVirtualSensorResult::kSuccess); + auto client_1 = std::make_unique<TestSensorClient>(SensorType::PRESSURE); auto client_2 = std::make_unique<TestSensorClient>(SensorType::PRESSURE); { @@ -411,12 +540,225 @@ client_1->sensor()->Suspend(); - EXPECT_TRUE( - client_2->AddConfigurationSync(PlatformSensorConfiguration(46.0))); - // Expect the sensor_2 will receive SensorReadingChanged() notification while // sensor_1 won't. + EXPECT_TRUE( + client_2->AddConfigurationSync(PlatformSensorConfiguration(46.0))); + AddReadingWithFrequency(SensorType::PRESSURE); EXPECT_DOUBLE_EQ(client_2->WaitForReading(), 46.0); } +TEST_F(GenericSensorServiceTest, MojoReceiverDisconnectionTest) { + EXPECT_EQ(sensor_provider_impl_->GetVirtualProviderCountForTesting(), 0U); + EXPECT_EQ(CreateVirtualSensorSync(SensorType::PRESSURE), + mojom::CreateVirtualSensorResult::kSuccess); + EXPECT_EQ(sensor_provider_impl_->GetVirtualProviderCountForTesting(), 1U); + + auto client = std::make_unique<TestSensorClient>(SensorType::PRESSURE); + { + base::RunLoop run_loop; + sensor_provider_->GetSensor( + SensorType::PRESSURE, + base::BindOnce(&TestSensorClient::OnSensorCreated, + base::Unretained(client.get()), run_loop.QuitClosure())); + run_loop.Run(); + } + + EXPECT_TRUE(client->AddConfigurationSync(PlatformSensorConfiguration(50.0))); + EXPECT_EQ(UpdateVirtualSensorSync(SensorType::PRESSURE, 42.0), + mojom::UpdateVirtualSensorResult::kSuccess); + + // Break the Mojo connection to SensorProviderImpl. The corresponding + // VirtualPlatformSensorProvider still has a connected pressure sensor, so it + // is not deleted. + sensor_provider_.reset(); + task_environment_.RunUntilIdle(); + EXPECT_EQ(sensor_provider_impl_->GetVirtualProviderCountForTesting(), 1U); + { + SensorReading reading; + client->FetchSensorReading(&reading); + EXPECT_DOUBLE_EQ(reading.als.value, 42.0); + } + + // Now simulate a new connection to SensorProviderImpl (a new page, for + // example). + device_service()->BindSensorProvider( + sensor_provider_.BindNewPipeAndPassReceiver()); + + // Repeat the whole setup process. + EXPECT_EQ(CreateVirtualSensorSync(SensorType::PRESSURE), + mojom::CreateVirtualSensorResult::kSuccess); + EXPECT_EQ(sensor_provider_impl_->GetVirtualProviderCountForTesting(), 2U); + + auto new_client = std::make_unique<TestSensorClient>(SensorType::PRESSURE); + { + base::RunLoop run_loop; + sensor_provider_->GetSensor( + SensorType::PRESSURE, base::BindOnce(&TestSensorClient::OnSensorCreated, + base::Unretained(new_client.get()), + run_loop.QuitClosure())); + run_loop.Run(); + } + + EXPECT_TRUE( + new_client->AddConfigurationSync(PlatformSensorConfiguration(1.0))); + EXPECT_EQ(UpdateVirtualSensorSync(SensorType::PRESSURE, 2.0), + mojom::UpdateVirtualSensorResult::kSuccess); + + // Check that the existing VirtualPlatformSensorProvider and + // VirtualPlatformSensor instances do not interfere with one another. + // |client| and |new_client| are connected to different + // VirtualPlatformSensorProviders with different shared memory buffers. + { + SensorReading reading; + client->FetchSensorReading(&reading); + EXPECT_DOUBLE_EQ(reading.als.value, 42.0); + new_client->FetchSensorReading(&reading); + EXPECT_DOUBLE_EQ(reading.als.value, 2.0); + } + + // Now disconnect from the new pressure sensor and the new + // VirtualPlatformSensorProvider. This one should be deleted. + new_client->ResetSensor(); + sensor_provider_.reset(); + task_environment_.RunUntilIdle(); + EXPECT_EQ(sensor_provider_impl_->GetVirtualProviderCountForTesting(), 1U); + + // The newer Mojo connection to SensorProviderImpl was broken and the + // corresponding VirtualPlatformSensorProvider has been deleted. All readings + // have been zeroed. + { + SensorReading reading; + client->FetchSensorReading(&reading); + EXPECT_DOUBLE_EQ(reading.als.value, 42.0); + new_client->FetchSensorReading(&reading); + EXPECT_DOUBLE_EQ(reading.als.value, 0.0); + } +} + +TEST_F(GenericSensorServiceTest, + DifferentVirtualAndNonVirtualPlatformSensorsTest) { + EXPECT_EQ(sensor_provider_impl_->GetVirtualProviderCountForTesting(), 0U); + EXPECT_EQ(CreateVirtualSensorSync(SensorType::PRESSURE), + mojom::CreateVirtualSensorResult::kSuccess); + EXPECT_EQ(sensor_provider_impl_->GetVirtualProviderCountForTesting(), 1U); + + // Create a non-virtual sensor, make sure creation works as expected. + auto client = std::make_unique<TestSensorClient>(SensorType::AMBIENT_LIGHT); + EXPECT_CALL(*fake_platform_sensor_provider_, DoCreateSensorInternal(_, _, _)) + .Times(1); + { + base::RunLoop run_loop; + sensor_provider_->GetSensor( + SensorType::AMBIENT_LIGHT, + base::BindOnce(&TestSensorClient::OnSensorCreated, + base::Unretained(client.get()), run_loop.QuitClosure())); + run_loop.Run(); + } + + ASSERT_EQ(sensor_provider_impl_->GetVirtualProviderCountForTesting(), 1U); + // This only works and makes sense because of the assertion above. + auto* provider = + sensor_provider_impl_->GetLastVirtualSensorProviderForTesting(); + ASSERT_TRUE(provider); + EXPECT_TRUE(provider->IsOverridingSensor(SensorType::PRESSURE)); + EXPECT_FALSE(provider->IsOverridingSensor(SensorType::AMBIENT_LIGHT)); +} + +TEST_F(GenericSensorServiceTest, SameVirtualAndNonVirtualPlatformSensorsTest) { + EXPECT_EQ(sensor_provider_impl_->GetVirtualProviderCountForTesting(), 0U); + EXPECT_EQ(CreateVirtualSensorSync(SensorType::PRESSURE), + mojom::CreateVirtualSensorResult::kSuccess); + EXPECT_EQ(sensor_provider_impl_->GetVirtualProviderCountForTesting(), 1U); + + // Create a sensor. Its type is the one we created a virtual sensor for + // above, so the non-virtual code path (i.e. the FakePlatformSensorProvider + // in this case) should not be called. + auto client = std::make_unique<TestSensorClient>(SensorType::PRESSURE); + EXPECT_CALL(*fake_platform_sensor_provider_, DoCreateSensorInternal(_, _, _)) + .Times(0); + { + base::RunLoop run_loop; + sensor_provider_->GetSensor( + SensorType::PRESSURE, + base::BindOnce(&TestSensorClient::OnSensorCreated, + base::Unretained(client.get()), run_loop.QuitClosure())); + run_loop.Run(); + } + + ASSERT_EQ(sensor_provider_impl_->GetVirtualProviderCountForTesting(), 1U); + // This only works and makes sense because of the assertion above. + auto* provider = + sensor_provider_impl_->GetLastVirtualSensorProviderForTesting(); + ASSERT_TRUE(provider); + EXPECT_TRUE(provider->IsOverridingSensor(SensorType::PRESSURE)); +} + +TEST_F(GenericSensorServiceTest, VirtualPlatformOverridesNonVirtualTest) { + // Create a non-virtual sensor first. + EXPECT_CALL(*fake_platform_sensor_provider_, DoCreateSensorInternal(_, _, _)) + .Times(1); + auto client1 = std::make_unique<TestSensorClient>(SensorType::PRESSURE); + { + base::RunLoop run_loop; + sensor_provider_->GetSensor( + SensorType::PRESSURE, base::BindOnce(&TestSensorClient::OnSensorCreated, + base::Unretained(client1.get()), + run_loop.QuitClosure())); + run_loop.Run(); + } + + // Now start overriding sensors of this type. + EXPECT_EQ(CreateVirtualSensorSync(SensorType::PRESSURE), + mojom::CreateVirtualSensorResult::kSuccess); + EXPECT_EQ(sensor_provider_impl_->GetVirtualProviderCountForTesting(), 1U); + auto client2 = std::make_unique<TestSensorClient>(SensorType::PRESSURE); + { + base::RunLoop run_loop; + sensor_provider_->GetSensor( + SensorType::PRESSURE, base::BindOnce(&TestSensorClient::OnSensorCreated, + base::Unretained(client2.get()), + run_loop.QuitClosure())); + run_loop.Run(); + } + + // Existing non-virtual sensors must continue to work. + EXPECT_TRUE(client1->AddConfigurationSync(PlatformSensorConfiguration(46.0))); + EXPECT_DOUBLE_EQ(client1->WaitForReading(), 46.0); + + EXPECT_TRUE(client2->AddConfigurationSync(PlatformSensorConfiguration(23.0))); + + // Updating virtual sensor does not change the non-virtual one. + EXPECT_EQ(UpdateVirtualSensorSync(SensorType::PRESSURE, 1.0), + mojom::UpdateVirtualSensorResult::kSuccess); + EXPECT_DOUBLE_EQ(client2->WaitForReading(), 1.0); + SensorReading reading; + client1->FetchSensorReading(&reading); + EXPECT_DOUBLE_EQ(reading.als.value, 46.0); + client2->FetchSensorReading(&reading); + EXPECT_DOUBLE_EQ(reading.als.value, 1.0); +} + +TEST_F(GenericSensorServiceTest, DoubleVirtualPlatformSensorCreationTest) { + EXPECT_EQ(CreateVirtualSensorSync(SensorType::PRESSURE), + mojom::CreateVirtualSensorResult::kSuccess); + EXPECT_EQ(CreateVirtualSensorSync(SensorType::PRESSURE), + mojom::CreateVirtualSensorResult::kSensorTypeAlreadyOverridden); +} + +TEST_F(GenericSensorServiceTest, GetNonOverriddenSensorTest) { + base::test::TestFuture<mojom::GetVirtualSensorInformationResultPtr> future; + sensor_provider_->GetVirtualSensorInformation(SensorType::PRESSURE, + future.GetCallback()); + EXPECT_EQ(future.Get()->which(), + mojom::GetVirtualSensorInformationResult::Tag::kError); + EXPECT_EQ(future.Get()->get_error(), + mojom::GetVirtualSensorInformationError::kSensorTypeNotOverridden); +} + +TEST_F(GenericSensorServiceTest, UpdateNonOverriddenSensorTest) { + EXPECT_EQ(UpdateVirtualSensorSync(SensorType::PRESSURE, 42.0), + mojom::UpdateVirtualSensorResult::kSensorTypeNotOverridden); +} + } // namespace device
diff --git a/services/device/generic_sensor/platform_sensor_provider.h b/services/device/generic_sensor/platform_sensor_provider.h index f71ff71..f3fa775 100644 --- a/services/device/generic_sensor/platform_sensor_provider.h +++ b/services/device/generic_sensor/platform_sensor_provider.h
@@ -41,6 +41,9 @@ // Shared memory region getter. base::ReadOnlySharedMemoryRegion CloneSharedMemoryRegion(); + bool has_sensors() const { return !sensor_map_.empty(); } + bool has_pending_requests() const { return !requests_map_.empty(); } + protected: PlatformSensorProvider();
diff --git a/services/device/generic_sensor/sensor_provider_impl.cc b/services/device/generic_sensor/sensor_provider_impl.cc index 210bfef..299fa8e 100644 --- a/services/device/generic_sensor/sensor_provider_impl.cc +++ b/services/device/generic_sensor/sensor_provider_impl.cc
@@ -4,14 +4,19 @@ #include "services/device/generic_sensor/sensor_provider_impl.h" +#include <memory> #include <utility> +#include "base/check_op.h" +#include "base/containers/contains.h" #include "base/feature_list.h" #include "base/functional/bind.h" #include "base/memory/ptr_util.h" #include "mojo/public/cpp/bindings/pending_remote.h" #include "services/device/generic_sensor/platform_sensor_provider.h" #include "services/device/generic_sensor/sensor_impl.h" +#include "services/device/generic_sensor/virtual_platform_sensor.h" +#include "services/device/generic_sensor/virtual_platform_sensor_provider.h" #include "services/device/public/cpp/device_features.h" #include "services/device/public/cpp/generic_sensor/sensor_reading_shared_buffer.h" #include "services/device/public/cpp/generic_sensor/sensor_traits.h" @@ -42,6 +47,9 @@ std::unique_ptr<PlatformSensorProvider> provider) : provider_(std::move(provider)) { DCHECK(provider_); + + receivers_.set_disconnect_handler(base::BindRepeating( + &SensorProviderImpl::OnReceiverDisconnected, base::Unretained(this))); } SensorProviderImpl::~SensorProviderImpl() = default; @@ -51,6 +59,24 @@ receivers_.Add(this, std::move(receiver)); } +void SensorProviderImpl::OnReceiverDisconnected() { + // If the other side of the pipe has been disconnected, the corresponding + // VirtualPlatformSensorProvider can be destroyed if it has no connected + // sensors or pending requests, as it is never going to be referenced again. + // This is the case in most workflows, as the Blink connections to SensorImpl + // are shut down before WebContentsSensorProviderProxy in content terminates + // its Mojo connection, but if a VirtualPlatformSensorProvider cannot be + // removed it is not a big problem, as the data structure is not big. + const mojo::ReceiverId receiver_id = receivers_.current_receiver(); + auto it = virtual_providers_.find(receiver_id); + if (it != virtual_providers_.end()) { + const auto& provider = it->second; + if (!provider->has_pending_requests() && !provider->has_sensors()) { + virtual_providers_.erase(it); + } + } +} + void SensorProviderImpl::GetSensor(mojom::SensorType type, GetSensorCallback callback) { if (!base::FeatureList::IsEnabled(features::kGenericSensorExtraClasses) && @@ -59,16 +85,27 @@ nullptr); return; } - auto cloned_region = provider_->CloneSharedMemoryRegion(); + + PlatformSensorProvider* provider = provider_.get(); + auto it_virtual_provider = + virtual_providers_.find(receivers_.current_receiver()); + if (it_virtual_provider != virtual_providers_.end() && + it_virtual_provider->second->IsOverridingSensor(type)) { + provider = it_virtual_provider->second.get(); + } + + auto cloned_region = provider->CloneSharedMemoryRegion(); if (!cloned_region.IsValid()) { std::move(callback).Run(mojom::SensorCreationResult::ERROR_NOT_AVAILABLE, nullptr); return; } - scoped_refptr<PlatformSensor> sensor = provider_->GetSensor(type); + scoped_refptr<PlatformSensor> sensor = provider->GetSensor(type); if (!sensor) { - provider_->CreateSensor( + // If we are here, it means there is no virtual sensor of this type, + // otherwise the GetSensor() call above would have returned it. + provider->CreateSensor( type, base::BindOnce(&SensorProviderImpl::SensorCreated, weak_ptr_factory_.GetWeakPtr(), std::move(cloned_region), std::move(callback))); @@ -137,4 +174,113 @@ std::move(init_params)); } +void SensorProviderImpl::CreateVirtualSensor( + mojom::SensorType type, + mojom::VirtualSensorMetadataPtr metadata, + CreateVirtualSensorCallback callback) { + const mojo::ReceiverId receiver_id = receivers_.current_receiver(); + auto& virtual_provider = virtual_providers_[receiver_id]; + + if (!virtual_provider) { + virtual_provider = std::make_unique<VirtualPlatformSensorProvider>(); + } + + mojom::CreateVirtualSensorResult result = + virtual_provider->AddSensorOverride(type, std::move(metadata)) + ? mojom::CreateVirtualSensorResult::kSuccess + : mojom::CreateVirtualSensorResult::kSensorTypeAlreadyOverridden; + std::move(callback).Run(result); +} + +void SensorProviderImpl::UpdateVirtualSensor( + mojom::SensorType type, + const SensorReading& reading, + UpdateVirtualSensorCallback callback) { + const mojo::ReceiverId receiver_id = receivers_.current_receiver(); + + if (!base::Contains(virtual_providers_, receiver_id)) { + std::move(callback).Run( + mojom::UpdateVirtualSensorResult::kSensorTypeNotOverridden); + return; + } + + auto* virtual_provider = virtual_providers_[receiver_id].get(); + + if (!virtual_provider->IsOverridingSensor(type)) { + std::move(callback).Run( + mojom::UpdateVirtualSensorResult::kSensorTypeNotOverridden); + return; + } + + if (auto virtual_sensor = virtual_provider->GetSensor(type)) { + static_cast<VirtualPlatformSensor*>(virtual_sensor.get()) + ->AddReading(reading); + } + + std::move(callback).Run(mojom::UpdateVirtualSensorResult::kSuccess); +} + +void SensorProviderImpl::RemoveVirtualSensor( + mojom::SensorType type, + RemoveVirtualSensorCallback callback) { + const mojo::ReceiverId receiver_id = receivers_.current_receiver(); + + if (!base::Contains(virtual_providers_, receiver_id)) { + std::move(callback).Run(); + return; + } + + virtual_providers_[receiver_id]->RemoveSensorOverride(type); + std::move(callback).Run(); +} + +void SensorProviderImpl::GetVirtualSensorInformation( + mojom::SensorType type, + GetVirtualSensorInformationCallback callback) { + const mojo::ReceiverId receiver_id = receivers_.current_receiver(); + + if (!base::Contains(virtual_providers_, receiver_id)) { + std::move(callback).Run(mojom::GetVirtualSensorInformationResult::NewError( + mojom::GetVirtualSensorInformationError::kSensorTypeNotOverridden)); + return; + } + + auto* virtual_provider = virtual_providers_[receiver_id].get(); + + if (!virtual_provider->IsOverridingSensor(type)) { + std::move(callback).Run(mojom::GetVirtualSensorInformationResult::NewError( + mojom::GetVirtualSensorInformationError::kSensorTypeNotOverridden)); + return; + } + + auto platform_sensor = virtual_provider->GetSensor(type); + if (!platform_sensor) { + // The sensor has not been created yet. + std::move(callback).Run(mojom::GetVirtualSensorInformationResult::NewInfo( + mojom::VirtualSensorInformation::New(/*sampling_frequency=*/0.0))); + return; + } + + auto* virtual_sensor = + static_cast<VirtualPlatformSensor*>(platform_sensor.get()); + auto sensor_information = mojom::VirtualSensorInformation::New(); + sensor_information->sampling_frequency = + virtual_sensor->optimal_configuration().has_value() + ? virtual_sensor->optimal_configuration().value().frequency() + : 0.0; + + std::move(callback).Run(mojom::GetVirtualSensorInformationResult::NewInfo( + std::move(sensor_information))); +} + +size_t SensorProviderImpl::GetVirtualProviderCountForTesting() const { + return virtual_providers_.size(); +} + +const VirtualPlatformSensorProvider* +SensorProviderImpl::GetLastVirtualSensorProviderForTesting() const { + CHECK_EQ(virtual_providers_.size(), 1U); + return virtual_providers_.begin()->second.get(); +} + } // namespace device
diff --git a/services/device/generic_sensor/sensor_provider_impl.h b/services/device/generic_sensor/sensor_provider_impl.h index a9820ba..c9f700f 100644 --- a/services/device/generic_sensor/sensor_provider_impl.h +++ b/services/device/generic_sensor/sensor_provider_impl.h
@@ -5,16 +5,21 @@ #ifndef SERVICES_DEVICE_GENERIC_SENSOR_SENSOR_PROVIDER_IMPL_H_ #define SERVICES_DEVICE_GENERIC_SENSOR_SENSOR_PROVIDER_IMPL_H_ +#include <map> + +#include "base/gtest_prod_util.h" #include "base/memory/read_only_shared_memory_region.h" #include "mojo/public/cpp/bindings/pending_receiver.h" #include "mojo/public/cpp/bindings/receiver_set.h" #include "mojo/public/cpp/bindings/unique_receiver_set.h" +#include "services/device/public/cpp/generic_sensor/sensor_reading.h" #include "services/device/public/mojom/sensor_provider.mojom.h" namespace device { class PlatformSensorProvider; class PlatformSensor; +class VirtualPlatformSensorProvider; // Implementation of SensorProvider mojo interface. Owns an instance of // PlatformSensorProvider to create platform specific instances of @@ -31,17 +36,35 @@ void Bind(mojo::PendingReceiver<mojom::SensorProvider> receiver); + size_t GetVirtualProviderCountForTesting() const; + const VirtualPlatformSensorProvider* GetLastVirtualSensorProviderForTesting() + const; + private: - // SensorProvider implementation. - void GetSensor(mojom::SensorType type, - GetSensorCallback callback) override; + // mojom::SensorProvider implementation. + void GetSensor(mojom::SensorType type, GetSensorCallback callback) override; + void CreateVirtualSensor(mojom::SensorType type, + mojom::VirtualSensorMetadataPtr metadata, + CreateVirtualSensorCallback callback) override; + void UpdateVirtualSensor(mojom::SensorType type, + const SensorReading& reading, + UpdateVirtualSensorCallback callback) override; + void RemoveVirtualSensor(mojom::SensorType type, + RemoveVirtualSensorCallback callback) override; + void GetVirtualSensorInformation( + mojom::SensorType type, + GetVirtualSensorInformationCallback callback) override; // Helper callback method to return created sensors. void SensorCreated(base::ReadOnlySharedMemoryRegion cloned_region, GetSensorCallback callback, scoped_refptr<PlatformSensor> sensor); + void OnReceiverDisconnected(); + std::unique_ptr<PlatformSensorProvider> provider_; + std::map<mojo::ReceiverId, std::unique_ptr<VirtualPlatformSensorProvider>> + virtual_providers_; mojo::ReceiverSet<mojom::SensorProvider> receivers_; mojo::UniqueReceiverSet<mojom::Sensor> sensor_receivers_; base::WeakPtrFactory<SensorProviderImpl> weak_ptr_factory_{this};
diff --git a/services/device/generic_sensor/virtual_platform_sensor.cc b/services/device/generic_sensor/virtual_platform_sensor.cc new file mode 100644 index 0000000..dcc7a8d --- /dev/null +++ b/services/device/generic_sensor/virtual_platform_sensor.cc
@@ -0,0 +1,73 @@ +// Copyright 2023 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "services/device/generic_sensor/virtual_platform_sensor.h" + +#include "services/device/public/cpp/generic_sensor/platform_sensor_configuration.h" +#include "services/device/public/cpp/generic_sensor/sensor_traits.h" + +namespace device { + +VirtualPlatformSensor::VirtualPlatformSensor( + mojom::SensorType type, + SensorReadingSharedBuffer* reading_buffer, + PlatformSensorProvider* provider) + : PlatformSensor(type, reading_buffer, provider) {} + +VirtualPlatformSensor::~VirtualPlatformSensor() = default; + +void VirtualPlatformSensor::AddReading(const SensorReading& reading) { + UpdateSharedBufferAndNotifyClients(reading); +} + +void VirtualPlatformSensor::SimulateSensorRemoval() { + // We could also try to set is_active_ to false and/or call + // ResetReadingBuffer(). The current behavior matches the Linux and Win32 + // backends and just leaves it up to clients like Blink to ultimately call + // PlatformSensor::StopListening(). + NotifySensorError(); +} + +bool VirtualPlatformSensor::StartSensor( + const PlatformSensorConfiguration& optimal_configuration) { + optimal_configuration_ = optimal_configuration; + return true; +} + +void VirtualPlatformSensor::StopSensor() { + optimal_configuration_.reset(); +} + +mojom::ReportingMode VirtualPlatformSensor::GetReportingMode() { + // Ambient Light Sensors' ReportingMode is ON_CHANGE on all platforms we + // support; make it so here as well. + const mojom::ReportingMode default_mode = + GetType() == mojom::SensorType::AMBIENT_LIGHT + ? mojom::ReportingMode::ON_CHANGE + : mojom::ReportingMode::CONTINUOUS; + + return reporting_mode_.value_or(default_mode); +} + +PlatformSensorConfiguration VirtualPlatformSensor::GetDefaultConfiguration() { + return PlatformSensorConfiguration(GetSensorDefaultFrequency(GetType())); +} + +bool VirtualPlatformSensor::CheckSensorConfiguration( + const PlatformSensorConfiguration& configuration) { + return configuration.frequency() <= GetMaximumSupportedFrequency() && + configuration.frequency() >= GetMinimumSupportedFrequency(); +} + +double VirtualPlatformSensor::GetMinimumSupportedFrequency() { + return minimum_supported_frequency_.value_or( + PlatformSensor::GetMinimumSupportedFrequency()); +} + +double VirtualPlatformSensor::GetMaximumSupportedFrequency() { + return maximum_supported_frequency_.value_or( + GetSensorMaxAllowedFrequency(GetType())); +} + +} // namespace device
diff --git a/services/device/generic_sensor/virtual_platform_sensor.h b/services/device/generic_sensor/virtual_platform_sensor.h new file mode 100644 index 0000000..c92d7c5 --- /dev/null +++ b/services/device/generic_sensor/virtual_platform_sensor.h
@@ -0,0 +1,74 @@ +// Copyright 2023 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef SERVICES_DEVICE_GENERIC_SENSOR_VIRTUAL_PLATFORM_SENSOR_H_ +#define SERVICES_DEVICE_GENERIC_SENSOR_VIRTUAL_PLATFORM_SENSOR_H_ + +#include "services/device/generic_sensor/platform_sensor.h" +#include "services/device/public/cpp/generic_sensor/platform_sensor_configuration.h" +#include "services/device/public/cpp/generic_sensor/sensor_reading.h" +#include "services/device/public/mojom/sensor.mojom-shared.h" +#include "third_party/abseil-cpp/absl/types/optional.h" + +namespace device { + +// OS-agnostic PlatformSensor implementation used in (web) tests. New instances +// are created by VirtualPlatformSensorProvider via GetSensor() calls. +class VirtualPlatformSensor : public PlatformSensor { + public: + VirtualPlatformSensor(mojom::SensorType type, + SensorReadingSharedBuffer* reading_buffer, + PlatformSensorProvider* provider); + + // Simulates the reporting of a new reading by a platform sensor. The new + // reading still goes through the UpdateSharedBufferAndNotifyClients() + // machinery, which means it may not end up being stored (for example, if the + // sensor is not active or a threshold check fails). + void AddReading(const SensorReading&); + + // Simulates that a platform sensor has been removed and therefore stopped + // providing readings. + void SimulateSensorRemoval(); + + // Returns the current PlatformSensorConfiguration being used by the sensor + // if it is currently active, or a null absl::optional otherwise. + const absl::optional<PlatformSensorConfiguration>& optimal_configuration() + const { + return optimal_configuration_; + } + + void set_minimum_supported_frequency(double frequency) { + minimum_supported_frequency_ = frequency; + } + void set_maximum_supported_frequency(double frequency) { + maximum_supported_frequency_ = frequency; + } + + void set_reporting_mode(mojom::ReportingMode reporting_mode) { + reporting_mode_ = reporting_mode; + } + + protected: + ~VirtualPlatformSensor() override; + + private: + // PlatformSensor overrides. + bool StartSensor(const PlatformSensorConfiguration& configuration) override; + void StopSensor() override; + mojom::ReportingMode GetReportingMode() override; + PlatformSensorConfiguration GetDefaultConfiguration() override; + bool CheckSensorConfiguration( + const PlatformSensorConfiguration& configuration) override; + double GetMinimumSupportedFrequency() override; + double GetMaximumSupportedFrequency() override; + + absl::optional<double> minimum_supported_frequency_; + absl::optional<double> maximum_supported_frequency_; + absl::optional<PlatformSensorConfiguration> optimal_configuration_; + absl::optional<mojom::ReportingMode> reporting_mode_; +}; + +} // namespace device + +#endif // SERVICES_DEVICE_GENERIC_SENSOR_VIRTUAL_PLATFORM_SENSOR_H_
diff --git a/services/device/generic_sensor/virtual_platform_sensor_provider.cc b/services/device/generic_sensor/virtual_platform_sensor_provider.cc new file mode 100644 index 0000000..811f3c5 --- /dev/null +++ b/services/device/generic_sensor/virtual_platform_sensor_provider.cc
@@ -0,0 +1,74 @@ +// Copyright 2023 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "services/device/generic_sensor/virtual_platform_sensor_provider.h" + +#include <utility> + +#include "base/memory/scoped_refptr.h" +#include "base/notreached.h" +#include "services/device/generic_sensor/virtual_platform_sensor.h" +#include "services/device/public/mojom/sensor.mojom.h" +#include "services/device/public/mojom/sensor_provider.mojom.h" + +namespace device { + +VirtualPlatformSensorProvider::VirtualPlatformSensorProvider() = default; +VirtualPlatformSensorProvider::~VirtualPlatformSensorProvider() = default; + +bool VirtualPlatformSensorProvider::AddSensorOverride( + mojom::SensorType type, + mojom::VirtualSensorMetadataPtr metadata) { + return type_metadata_.try_emplace(type, std::move(metadata)).second; +} + +void VirtualPlatformSensorProvider::RemoveSensorOverride( + mojom::SensorType type) { + if (type_metadata_.erase(type) == 0U) { + return; + } + + if (auto sensor = GetSensor(type)) { + static_cast<VirtualPlatformSensor*>(sensor.get())->SimulateSensorRemoval(); + } +} + +bool VirtualPlatformSensorProvider::IsOverridingSensor( + mojom::SensorType type) const { + return type_metadata_.contains(type); +} + +void VirtualPlatformSensorProvider::CreateSensorInternal( + mojom::SensorType type, + SensorReadingSharedBuffer* reading_buffer, + CreateSensorCallback callback) { + if (!IsOverridingSensor(type)) { + NOTREACHED_NORETURN() + << "CreateSensorInternal() was called but " + "VirtualPlatformSensorProvider is not overriding sensor type " + << type; + } + + const auto& metadata = type_metadata_[type]; + + if (!metadata->available) { + std::move(callback).Run(nullptr); + return; + } + + auto sensor = + base::MakeRefCounted<VirtualPlatformSensor>(type, reading_buffer, this); + if (!metadata->minimum_frequency.is_null()) { + sensor->set_minimum_supported_frequency(metadata->minimum_frequency->value); + } + if (!metadata->maximum_frequency.is_null()) { + sensor->set_maximum_supported_frequency(metadata->maximum_frequency->value); + } + if (!metadata->reporting_mode.is_null()) { + sensor->set_reporting_mode(metadata->reporting_mode->value); + } + std::move(callback).Run(std::move(sensor)); +} + +} // namespace device
diff --git a/services/device/generic_sensor/virtual_platform_sensor_provider.h b/services/device/generic_sensor/virtual_platform_sensor_provider.h new file mode 100644 index 0000000..92723e1 --- /dev/null +++ b/services/device/generic_sensor/virtual_platform_sensor_provider.h
@@ -0,0 +1,54 @@ +// Copyright 2023 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef SERVICES_DEVICE_GENERIC_SENSOR_VIRTUAL_PLATFORM_SENSOR_PROVIDER_H_ +#define SERVICES_DEVICE_GENERIC_SENSOR_VIRTUAL_PLATFORM_SENSOR_PROVIDER_H_ + +#include "base/containers/flat_map.h" +#include "services/device/generic_sensor/platform_sensor_provider.h" +#include "services/device/public/mojom/sensor_provider.mojom-forward.h" + +namespace device { + +// OS-agnostic PlatformSensorProvider implementation used in (web) tests. Used +// together with SensorProviderImpl in order to override one or more sensor +// types. Calls to GetSensor() will, upon success, always create +// VirtualPlatformSensor instances. +class VirtualPlatformSensorProvider : public PlatformSensorProvider { + public: + VirtualPlatformSensorProvider(); + ~VirtualPlatformSensorProvider() override; + + // Starts causing GetSensor() calls with |type| to return + // VirtualPlatformSensor instances with the properties specified in + // |metadata|. + // + // Returns false if the given |type| is already being overridden (in which + // case RemoveSensorOverride() must be called first). + bool AddSensorOverride(mojom::SensorType type, + mojom::VirtualSensorMetadataPtr metadata); + + // Stops overriding sensors of type |type|, that is, GetSensor() calls with + // |type| will no longer a VirtualPlatformSensor instance. Existing instances + // will behave as if a hardware sensor had been removed (i.e. possibly notify + // clients of an error). + // + // Does nothing if |type| is not being overridden. + void RemoveSensorOverride(mojom::SensorType type); + + bool IsOverridingSensor(mojom::SensorType type) const; + + // PlatformSensorProvider overrides. + void CreateSensorInternal(mojom::SensorType type, + SensorReadingSharedBuffer* reading_buffer, + CreateSensorCallback callback) override; + + private: + base::flat_map<mojom::SensorType, mojom::VirtualSensorMetadataPtr> + type_metadata_; +}; + +} // namespace device + +#endif // SERVICES_DEVICE_GENERIC_SENSOR_VIRTUAL_PLATFORM_SENSOR_PROVIDER_H_
diff --git a/services/device/public/cpp/test/fake_sensor_and_provider.h b/services/device/public/cpp/test/fake_sensor_and_provider.h index 91e4d02..a1d8c0fd 100644 --- a/services/device/public/cpp/test/fake_sensor_and_provider.h +++ b/services/device/public/cpp/test/fake_sensor_and_provider.h
@@ -68,6 +68,21 @@ // mojom::sensorProvider: void GetSensor(mojom::SensorType type, GetSensorCallback callback) override; + void CreateVirtualSensor( + mojom::SensorType type, + mojom::VirtualSensorMetadataPtr metadata, + mojom::SensorProvider::CreateVirtualSensorCallback callback) override {} + void UpdateVirtualSensor( + mojom::SensorType type, + const SensorReading& reading, + mojom::SensorProvider::UpdateVirtualSensorCallback callback) override {} + void RemoveVirtualSensor( + mojom::SensorType type, + mojom::SensorProvider::RemoveVirtualSensorCallback callback) override {} + void GetVirtualSensorInformation( + mojom::SensorType type, + mojom::SensorProvider::GetVirtualSensorInformationCallback callback) + override {} void Bind(mojo::PendingReceiver<mojom::SensorProvider> receiver); bool is_bound() const;
diff --git a/services/device/public/mojom/sensor_provider.mojom b/services/device/public/mojom/sensor_provider.mojom index f20ae34..39ef2c5 100644 --- a/services/device/public/mojom/sensor_provider.mojom +++ b/services/device/public/mojom/sensor_provider.mojom
@@ -46,15 +46,87 @@ ERROR_NOT_ALLOWED, // The required permissions are not granted. }; +enum CreateVirtualSensorResult { + kSuccess, + kSensorTypeAlreadyOverridden, +}; + +enum UpdateVirtualSensorResult { + kSuccess, + kSensorTypeNotOverridden, +}; + +enum GetVirtualSensorInformationError { + kSensorTypeNotOverridden, +}; + +union GetVirtualSensorInformationResult { + VirtualSensorInformation info; + GetVirtualSensorInformationError error; +}; + +// TODO(crbug.com/657632): Mojo does not allow primitive types to be nullable, +// so we need to define a few wrapper structs. +// Optional double field. +struct NullableDouble { + // The value of the double. + double value; +}; + +// Optional ReportingMode field. +struct NullableReportingMode { + // The value of the enum. + ReportingMode value; +}; + +struct VirtualSensorMetadata { + bool available = true; + + NullableDouble? maximum_frequency; + NullableDouble? minimum_frequency; + + // Only used by unit tests. + NullableReportingMode? reporting_mode; +}; + +struct VirtualSensorInformation { + double sampling_frequency; +}; + +// Manages Sensor interfaces. This interface is responsible for creating or +// retrieving a Sensor via GetSensor() and for managing virtual sensors. interface SensorProvider { // Gets the sensor interface by the given type. // // |type| type of the sensor. // + // If a virtual sensor of given |type| has been created, it will be used + // instead of a real, hardware-based one. + // // |result| on success contains SUCCESS, otherwise contains the // SensorCreationResult describing the failure reason. // |init_params| on success will contain the SensorInitParams describing // the sensor, contains null on failure. GetSensor(SensorType type) => (SensorCreationResult result, SensorInitParams? init_params); + + // Creates a new virtual sensor of a given |type|, or fails if one already + // exists. + CreateVirtualSensor(SensorType type, VirtualSensorMetadata metadata) => + (CreateVirtualSensorResult result); + + // Updates readings for a virtual sensor of given |type|, or fails if one has + // not been created. + UpdateVirtualSensor(SensorType type, SensorReadingRaw reading) => + (UpdateVirtualSensorResult result); + + // Removes a virtual sensor of given |type|, or does nothing if one has not + // been created. + RemoveVirtualSensor(SensorType type) => (); + + // Retrieves information about a virtual sensor of given |type|. It fails if + // one has not been created. If the sensor is not active, all information + // will be null or zeroed out. + GetVirtualSensorInformation(SensorType type) => + (GetVirtualSensorInformationResult result); };
diff --git a/services/network/public/cpp/corb/corb_impl.cc b/services/network/public/cpp/corb/corb_impl.cc index 47f6947..0353a1d 100644 --- a/services/network/public/cpp/corb/corb_impl.cc +++ b/services/network/public/cpp/corb/corb_impl.cc
@@ -283,10 +283,6 @@ return kNeverSniffedMimeTypes; } -void LogAction(CrossOriginReadBlocking::Action action) { - UMA_HISTOGRAM_ENUMERATION("SiteIsolation.XSD.Browser.Action", action); -} - } // namespace // static @@ -597,8 +593,6 @@ http_response_code_ = response.headers ? response.headers->response_code() : 0; - LogAction(Action::kResponseStarted); - // CORB should look directly at the Content-Type header if one has been // received from the network. Ignoring |response.mime_type| helps avoid // breaking legitimate websites (which might happen more often when blocking @@ -643,16 +637,6 @@ corb_protection_logging_needs_sniffing_ && should_block_based_on_headers_ != Decision::kSniffMore; mime_type_bucket_ = GetMimeTypeBucket(response); - UMA_HISTOGRAM_BOOLEAN("SiteIsolation.CORBProtection.SensitiveResource", - true); - if (!corb_protection_logging_needs_sniffing_) { - // If we are not going to sniff, then we can and must log everything now. - LogSensitiveResponseProtection( - BlockingDecisionToProtectionDecision(would_protect_based_on_headers)); - } - } else { - UMA_HISTOGRAM_BOOLEAN("SiteIsolation.CORBProtection.SensitiveResource", - false); } if (needs_sniffing()) CreateSniffers(); @@ -662,16 +646,8 @@ CrossOriginReadBlocking::CorbResponseAnalyzer::CorbResponseAnalyzer() = default; -CrossOriginReadBlocking::CorbResponseAnalyzer::~CorbResponseAnalyzer() { - if (ShouldBlock()) { - LogBlockedResponse(); - } else { - // Allowing happens either 1) explicitly, or 2) when sniffing didn't reach a - // conclusion after sniffing 1024 (or all) bytes. - DCHECK(ShouldAllow() || needs_sniffing()); - LogAllowedResponse(); - } -} +CrossOriginReadBlocking::CorbResponseAnalyzer::~CorbResponseAnalyzer() = + default; // static Decision @@ -1044,51 +1020,6 @@ return Decision::kSniffMore; } -void CrossOriginReadBlocking::CorbResponseAnalyzer::LogAllowedResponse() { - DCHECK(!has_logged_final_decision_); - has_logged_final_decision_ = true; - - if (corb_protection_logging_needs_sniffing_) { - LogSensitiveResponseProtection( - SniffingDecisionToProtectionDecision(found_blockable_content_)); - } - // Note that if a response is allowed because of hitting EOF or - // kMaxBytesToSniff, then |sniffers_| are not emptied and consequently - // ShouldAllow doesn't start returning true. This means that we can't - // DCHECK(ShouldAllow()) or DCHECK(sniffers_.empty()) here - the decision to - // allow the response could have been made in the - // CrossSiteDocumentResourceHandler layer without CrossOriginReadBlocking - // realizing that it has hit EOF or kMaxBytesToSniff. - - // Note that the response might be allowed even if ShouldBlock() returns true - // - for example to allow responses to requests initiated by content scripts. - // This means that we cannot DCHECK(!ShouldBlock()) here. - - LogAction(needs_sniffing() ? Action::kAllowedAfterSniffing - : Action::kAllowedWithoutSniffing); -} - -void CrossOriginReadBlocking::CorbResponseAnalyzer::LogBlockedResponse() { - DCHECK(!has_logged_final_decision_); - has_logged_final_decision_ = true; - - DCHECK(!ShouldAllow()); - DCHECK(ShouldBlock()); - DCHECK(sniffers_.empty()); - - if (corb_protection_logging_needs_sniffing_) { - LogSensitiveResponseProtection( - SniffingDecisionToProtectionDecision(found_blockable_content_)); - } - - LogAction(needs_sniffing() ? Action::kBlockedAfterSniffing - : Action::kBlockedWithoutSniffing); - - UMA_HISTOGRAM_ENUMERATION( - "SiteIsolation.XSD.Browser.Blocked.CanonicalMimeType", - canonical_mime_type_); -} - // static bool CrossOriginReadBlocking::CorbResponseAnalyzer::HasNoSniff( const mojom::URLResponseHead& response) { @@ -1103,107 +1034,10 @@ // static CrossOriginReadBlocking::CorbResponseAnalyzer::CrossOriginProtectionDecision CrossOriginReadBlocking::CorbResponseAnalyzer:: - BlockingDecisionToProtectionDecision(Decision blocking_decision) { - switch (blocking_decision) { - case Decision::kAllow: - return CrossOriginProtectionDecision::kAllow; - case Decision::kBlock: - return CrossOriginProtectionDecision::kBlock; - case Decision::kSniffMore: - return CrossOriginProtectionDecision::kNeedToSniffMore; - } -} - -// static -CrossOriginReadBlocking::CorbResponseAnalyzer::CrossOriginProtectionDecision -CrossOriginReadBlocking::CorbResponseAnalyzer:: SniffingDecisionToProtectionDecision(bool found_blockable_content) { if (found_blockable_content) return CrossOriginProtectionDecision::kBlockedAfterSniffing; return CrossOriginProtectionDecision::kAllowedAfterSniffing; } -void CrossOriginReadBlocking::CorbResponseAnalyzer:: - LogSensitiveResponseProtection( - CrossOriginProtectionDecision protection_decision) const { - DCHECK(seems_sensitive_from_cors_heuristic_ || - seems_sensitive_from_cache_heuristic_); - if (seems_sensitive_from_cors_heuristic_) { - switch (mime_type_bucket_) { - case kProtected: - UMA_HISTOGRAM_ENUMERATION( - "SiteIsolation.CORBProtection.CORSHeuristic.ProtectedMimeType", - protection_decision); - // We report if a response with a protected MIME type supports range - // requests since we want to measure how often making a multipart range - // requests would have allowed bypassing CORB. - if (protection_decision == CrossOriginProtectionDecision::kBlock) { - UMA_HISTOGRAM_BOOLEAN( - "SiteIsolation.CORBProtection.CORSHeuristic.ProtectedMimeType." - "BlockedWithRangeSupport", - supports_range_requests_); - UMA_HISTOGRAM_BOOLEAN( - "SiteIsolation.CORBProtection.CORSHeuristic.ProtectedMimeType." - "BlockedWithoutSniffing.HasNoSniff", - has_nosniff_header_); - } else if (protection_decision == - CrossOriginProtectionDecision::kBlockedAfterSniffing) { - UMA_HISTOGRAM_BOOLEAN( - "SiteIsolation.CORBProtection.CORSHeuristic.ProtectedMimeType." - "BlockedAfterSniffingWithRangeSupport", - supports_range_requests_); - } - break; - case kPublic: - UMA_HISTOGRAM_ENUMERATION( - "SiteIsolation.CORBProtection.CORSHeuristic.PublicMimeType", - protection_decision); - break; - case kOther: - UMA_HISTOGRAM_ENUMERATION( - "SiteIsolation.CORBProtection.CORSHeuristic.OtherMimeType", - protection_decision); - } - } - if (seems_sensitive_from_cache_heuristic_) { - switch (mime_type_bucket_) { - case kProtected: - UMA_HISTOGRAM_ENUMERATION( - "SiteIsolation.CORBProtection.CacheHeuristic.ProtectedMimeType", - protection_decision); - if (protection_decision == CrossOriginProtectionDecision::kBlock) { - UMA_HISTOGRAM_BOOLEAN( - "SiteIsolation.CORBProtection.CacheHeuristic.ProtectedMimeType." - "BlockedWithRangeSupport", - supports_range_requests_); - UMA_HISTOGRAM_BOOLEAN( - "SiteIsolation.CORBProtection.CacheHeuristic.ProtectedMimeType." - "BlockedWithoutSniffing.HasNoSniff", - has_nosniff_header_); - } else if (protection_decision == - CrossOriginProtectionDecision::kBlockedAfterSniffing) { - UMA_HISTOGRAM_BOOLEAN( - "SiteIsolation.CORBProtection.CacheHeuristic.ProtectedMimeType." - "BlockedAfterSniffingWithRangeSupport", - supports_range_requests_); - } - break; - case kPublic: - UMA_HISTOGRAM_ENUMERATION( - "SiteIsolation.CORBProtection.CacheHeuristic.PublicMimeType", - protection_decision); - break; - case kOther: - UMA_HISTOGRAM_ENUMERATION( - "SiteIsolation.CORBProtection.CacheHeuristic.OtherMimeType", - protection_decision); - } - } - // Also log if the server supports range requests, since these may allow - // bypassing CORB. - UMA_HISTOGRAM_BOOLEAN( - "SiteIsolation.CORBProtection.SensitiveWithRangeSupport", - supports_range_requests_); -} - } // namespace network::corb
diff --git a/services/network/public/cpp/corb/corb_impl.h b/services/network/public/cpp/corb/corb_impl.h index be338b2..cf61ce8 100644 --- a/services/network/public/cpp/corb/corb_impl.h +++ b/services/network/public/cpp/corb/corb_impl.h
@@ -167,9 +167,6 @@ // into corb::Decision. Decision GetCorbDecision(); - void LogAllowedResponse(); - void LogBlockedResponse(); - // Static because this method is called both during the actual decision, and // for the CORB protection logging decision. static Decision ShouldBlockBasedOnHeaders( @@ -201,11 +198,6 @@ static MimeTypeBucket GetMimeTypeBucket( const network::mojom::URLResponseHead& response); - // Translates a blocking decision into a protection decision for use by - // LogSensitiveResponseProtection. - static CrossOriginProtectionDecision BlockingDecisionToProtectionDecision( - Decision would_protect_based_on_headers); - // Returns a protection decision (blocked after sniffing or allowed after // sniffing) depending on if the sniffers found blockable content. static CrossOriginProtectionDecision SniffingDecisionToProtectionDecision( @@ -215,17 +207,10 @@ // if ShouldBlockBasedOnHeaders returns kSniffMore void CreateSniffers(); - // Reports potentially sensitive responses and whether CORB would have - // protected them, were they made cross origin. Also reports if the server - // supports range requests. - void LogSensitiveResponseProtection( - CrossOriginProtectionDecision protection_decision) const; - // Outcome of ShouldBlockBasedOnHeaders recorded inside the Create method. Decision should_block_based_on_headers_ = Decision::kBlock; - // The following values store information about the response and are used by - // the CORB protection logging in LogSensitiveResponseProtection. + // The following values store information about the response. bool corb_protection_logging_needs_sniffing_ = false; // |mime_type_bucket_| is either kProtected (if it's a type we expect to // protect such as HTML), kPublic (for javascript etc.) or kOther. @@ -258,11 +243,6 @@ // Sniffing results. bool found_blockable_content_ = false; - - // Whether the final allow/block decision has been logged to UMA. - // (This is only used in DCHECKs that verify that such UMA is only logged - // once.) - bool has_logged_final_decision_ = false; }; // This enum backs a histogram, so do not change the order of entries or
diff --git a/services/network/public/cpp/corb/corb_impl_unittest.cc b/services/network/public/cpp/corb/corb_impl_unittest.cc index 0ede6f3..e1b7df5a 100644 --- a/services/network/public/cpp/corb/corb_impl_unittest.cc +++ b/services/network/public/cpp/corb/corb_impl_unittest.cc
@@ -13,7 +13,6 @@ #include <vector> #include "base/strings/string_piece.h" -#include "base/test/metrics/histogram_tester.h" #include "base/test/task_environment.h" #include "net/base/mime_sniffer.h" #include "net/http/http_util.h" @@ -2138,7 +2137,6 @@ const TestScenario scenario = GetParam(); SCOPED_TRACE(testing::Message() << "\nScenario at " << __FILE__ << ":" << scenario.source_line); - base::HistogramTester histograms; // Initialize |response| from the parameters. // // TODO(krstnmnlsn): The response is constructed outside of @@ -2153,201 +2151,6 @@ // Run the analyzer and confirm it allows/blocks correctly. RunAnalyzerOnScenario(scenario, *response, std::make_unique<CorbResponseAnalyzer>()); - - // Verify that histograms are correctly incremented. - base::HistogramTester::CountsMap expected_counts; - std::string histogram_base = "SiteIsolation.XSD.Browser"; - switch (scenario.canonical_mime_type) { - case MimeType::kHtml: - case MimeType::kXml: - case MimeType::kJson: - case MimeType::kPlain: - case MimeType::kOthers: - break; - case MimeType::kNeverSniffed: - DCHECK_EQ(Verdict::kBlock, scenario.verdict); - DCHECK_EQ(kVerdictPacketForHeadersBasedVerdict, scenario.verdict_packet); - break; - case MimeType::kInvalidMimeType: - DCHECK_EQ(Verdict::kAllow, scenario.verdict); - DCHECK_EQ(kVerdictPacketForHeadersBasedVerdict, scenario.verdict_packet); - break; - } - // We don't expect to see a start action because that is triggered in the - // URLLoader. - bool should_be_blocked = scenario.verdict == Verdict::kBlock; - bool expected_to_sniff = - scenario.verdict_packet != kVerdictPacketForHeadersBasedVerdict; - int end_action = -1; - if (should_be_blocked && expected_to_sniff) { - end_action = static_cast<int>( - CrossOriginReadBlocking::Action::kBlockedAfterSniffing); - } else if (should_be_blocked && !expected_to_sniff) { - end_action = static_cast<int>( - CrossOriginReadBlocking::Action::kBlockedWithoutSniffing); - } else if (!should_be_blocked && expected_to_sniff) { - end_action = static_cast<int>( - CrossOriginReadBlocking::Action::kAllowedAfterSniffing); - } else if (!should_be_blocked && !expected_to_sniff) { - end_action = static_cast<int>( - CrossOriginReadBlocking::Action::kAllowedWithoutSniffing); - } else { - NOTREACHED(); - } - - // Expecting two actions: - // 1. kResponseStarted - // 2. The action recording CORB's actual decision (`end_action`). - expected_counts[histogram_base + ".Action"] = 2; - const auto kResponseStarted = static_cast<base::HistogramBase::Sample>( - CrossOriginReadBlocking::Action::kResponseStarted); - EXPECT_THAT(histograms.GetAllSamples(histogram_base + ".Action"), - testing::ElementsAre(base::Bucket(kResponseStarted, 1), - base::Bucket(end_action, 1))) - << "Should have incremented the right actions."; - - if (should_be_blocked) - expected_counts[histogram_base + ".Blocked.CanonicalMimeType"] = 1; - - // Make sure that the expected metrics, and only those metrics, were - // incremented. - EXPECT_THAT(histograms.GetTotalCountsForPrefix("SiteIsolation.XSD.Browser"), - testing::ContainerEq(expected_counts)); -} - -// Runs a particular TestScenario (passed as the test's parameter) through the -// ResponseAnalyzer, verifying that the expected CORB Protection UMA Histogram -// values are reported. -TEST_P(ResponseAnalyzerTest, CORBProtectionLogging) { - const TestScenario scenario = GetParam(); - SCOPED_TRACE(testing::Message() - << "\nScenario at " << __FILE__ << ":" << scenario.source_line); - base::HistogramTester histograms; - // Initialize |response| from the parameters and record if it looks sensitive - // or supports range requests. These values are saved because the analyzer - // will clear the response headers in the event it decides to block. - auto response = - CreateResponse(scenario.response_content_type, scenario.response_headers, - scenario.initiator_origin); - const bool seems_sensitive_from_cors_heuristic = CrossOriginReadBlocking:: - CorbResponseAnalyzer::SeemsSensitiveFromCORSHeuristic(*response); - const bool seems_sensitive_from_cache_heuristic = CrossOriginReadBlocking:: - CorbResponseAnalyzer::SeemsSensitiveFromCacheHeuristic(*response); - const bool supports_range_requests = - CorbResponseAnalyzer::SupportsRangeRequests(*response); - const bool expect_nosniff = CorbResponseAnalyzer::HasNoSniff(*response); - - // Run the analyzer and confirm it allows/blocks correctly. - RunAnalyzerOnScenario(scenario, *response, - std::make_unique<CorbResponseAnalyzer>()); - - base::HistogramTester::CountsMap expected_counts; - expected_counts["SiteIsolation.CORBProtection.SensitiveResource"] = 1; - if (scenario.resource_is_sensitive) { - // Check that we reported correctly if the server supports range - // requests. - EXPECT_THAT(histograms.GetAllSamples( - "SiteIsolation.CORBProtection.SensitiveWithRangeSupport"), - testing::ElementsAre(base::Bucket(supports_range_requests, 1))); - expected_counts["SiteIsolation.CORBProtection.SensitiveWithRangeSupport"] = - 1; - - std::string mime_type_bucket; - switch (scenario.mime_type_bucket) { - case MimeTypeBucket::kProtected: - mime_type_bucket = ".ProtectedMimeType"; - break; - case MimeTypeBucket::kPublic: - mime_type_bucket = ".PublicMimeType"; - break; - case MimeTypeBucket::kOther: - mime_type_bucket = ".OtherMimeType"; - break; - } - std::string blocked_with_range_support; - switch (scenario.protection_decision) { - case CrossOriginProtectionDecision::kBlock: - blocked_with_range_support = ".BlockedWithRangeSupport"; - break; - case CrossOriginProtectionDecision::kBlockedAfterSniffing: - blocked_with_range_support = ".BlockedAfterSniffingWithRangeSupport"; - break; - default: - blocked_with_range_support = "This value should not be used."; - } - bool expect_range_support_histograms = - scenario.mime_type_bucket == MimeTypeBucket::kProtected && - (scenario.protection_decision == - CrossOriginProtectionDecision::kBlock || - scenario.protection_decision == - CrossOriginProtectionDecision::kBlockedAfterSniffing); - // In this scenario the file seemed sensitive so we expect a report. Note - // there may be two reports if the resource satisfied both the CORS - // heuristic and the Cache heuristic. - std::string cors_base = "SiteIsolation.CORBProtection.CORSHeuristic"; - std::string cache_base = "SiteIsolation.CORBProtection.CacheHeuristic"; - std::string cors_protected = cors_base + ".ProtectedMimeType"; - std::string cache_protected = cache_base + ".ProtectedMimeType"; - std::string blocked_nosniff = ".BlockedWithoutSniffing.HasNoSniff"; - if (seems_sensitive_from_cors_heuristic) { - expected_counts[cors_base + mime_type_bucket] = 1; - EXPECT_THAT(histograms.GetAllSamples(cors_base + mime_type_bucket), - testing::ElementsAre(base::Bucket( - static_cast<int>(scenario.protection_decision), 1))) - << "CORB should have reported the right protection decision."; - if (expect_range_support_histograms) { - EXPECT_THAT( - histograms.GetAllSamples(cors_protected + - blocked_with_range_support), - testing::ElementsAre(base::Bucket(supports_range_requests, 1))); - expected_counts[cors_protected + blocked_with_range_support] = 1; - } - if (scenario.mime_type_bucket == MimeTypeBucket::kProtected && - scenario.protection_decision == - CrossOriginProtectionDecision::kBlock) { - EXPECT_THAT(histograms.GetAllSamples(cors_protected + blocked_nosniff), - testing::ElementsAre(base::Bucket(expect_nosniff, 1))); - expected_counts[cors_protected + blocked_nosniff] = 1; - } - } - if (seems_sensitive_from_cache_heuristic) { - expected_counts[cache_base + mime_type_bucket] = 1; - EXPECT_THAT(histograms.GetAllSamples(cache_base + mime_type_bucket), - testing::ElementsAre(base::Bucket( - static_cast<int>(scenario.protection_decision), 1))) - << "CORB should have reported the right protection decision."; - if (expect_range_support_histograms) { - EXPECT_THAT( - histograms.GetAllSamples(cache_protected + - blocked_with_range_support), - testing::ElementsAre(base::Bucket(supports_range_requests, 1))); - expected_counts[cache_protected + blocked_with_range_support] = 1; - } - if (scenario.mime_type_bucket == MimeTypeBucket::kProtected && - scenario.protection_decision == - CrossOriginProtectionDecision::kBlock) { - EXPECT_THAT(histograms.GetAllSamples(cache_protected + blocked_nosniff), - testing::ElementsAre(base::Bucket(expect_nosniff, 1))); - expected_counts[cache_protected + blocked_nosniff] = 1; - } - } - - EXPECT_THAT( - histograms.GetTotalCountsForPrefix("SiteIsolation.CORBProtection"), - testing::ContainerEq(expected_counts)); - EXPECT_THAT(histograms.GetAllSamples( - "SiteIsolation.CORBProtection.SensitiveResource"), - testing::ElementsAre(base::Bucket(true, 1))); - } else { - // In this scenario the file should not have appeared sensitive, so only the - // SensitiveResource boolean should have been reported (as false). - EXPECT_THAT( - histograms.GetTotalCountsForPrefix("SiteIsolation.CORBProtection"), - testing::ContainerEq(expected_counts)); - EXPECT_THAT(histograms.GetAllSamples( - "SiteIsolation.CORBProtection.SensitiveResource"), - testing::ElementsAre(base::Bucket(false, 1))); - } } TEST_P(ResponseAnalyzerTest, OpaqueResponseBlocking) {
diff --git a/testing/buildbot/chromium.cft.json b/testing/buildbot/chromium.cft.json index 6ece7dc..81e01094 100644 --- a/testing/buildbot/chromium.cft.json +++ b/testing/buildbot/chromium.cft.json
@@ -6443,22 +6443,6 @@ "merge": { "script": "//testing/merge_scripts/standard_gtest_merge.py" }, - "name": "nacl_loader_unittests", - "swarming": { - "dimensions": { - "cpu": "x86-64", - "os": "Windows-10-19045" - }, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "nacl_loader_unittests", - "test_id_prefix": "ninja://components/nacl/loader:nacl_loader_unittests/" - }, - { - "isolate_profile_data": true, - "merge": { - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, "name": "native_theme_unittests", "swarming": { "dimensions": { @@ -6566,22 +6550,6 @@ "merge": { "script": "//testing/merge_scripts/standard_gtest_merge.py" }, - "name": "ppapi_unittests", - "swarming": { - "dimensions": { - "cpu": "x86-64", - "os": "Windows-10-19045" - }, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "ppapi_unittests", - "test_id_prefix": "ninja://ppapi:ppapi_unittests/" - }, - { - "isolate_profile_data": true, - "merge": { - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, "name": "printing_unittests", "swarming": { "dimensions": {
diff --git a/testing/buildbot/chromium.chromiumos.json b/testing/buildbot/chromium.chromiumos.json index 9cc6108..cd33b2f 100644 --- a/testing/buildbot/chromium.chromiumos.json +++ b/testing/buildbot/chromium.chromiumos.json
@@ -5069,9 +5069,9 @@ { "args": [ "--test-launcher-filter-file=../../testing/buildbot/filters/linux-lacros.interactive_ui_tests.skew.filter", - "--ash-chrome-path-override=../../lacros_version_skew_tests_v120.0.6061.0/test_ash_chrome" + "--ash-chrome-path-override=../../lacros_version_skew_tests_v120.0.6062.0/test_ash_chrome" ], - "description": "Run with ash-chrome version 120.0.6061.0", + "description": "Run with ash-chrome version 120.0.6062.0", "isolate_profile_data": true, "merge": { "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -5081,8 +5081,8 @@ "cipd_packages": [ { "cipd_package": "chromium/testing/linux-ash-chromium/x86_64/ash.zip", - "location": "lacros_version_skew_tests_v120.0.6061.0", - "revision": "version:120.0.6061.0" + "location": "lacros_version_skew_tests_v120.0.6062.0", + "revision": "version:120.0.6062.0" } ], "dimensions": { @@ -5219,9 +5219,9 @@ { "args": [ "--test-launcher-filter-file=../../testing/buildbot/filters/linux-lacros.lacros_chrome_browsertests.skew.filter", - "--ash-chrome-path-override=../../lacros_version_skew_tests_v120.0.6061.0/test_ash_chrome" + "--ash-chrome-path-override=../../lacros_version_skew_tests_v120.0.6062.0/test_ash_chrome" ], - "description": "Run with ash-chrome version 120.0.6061.0", + "description": "Run with ash-chrome version 120.0.6062.0", "isolate_profile_data": true, "merge": { "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -5231,8 +5231,8 @@ "cipd_packages": [ { "cipd_package": "chromium/testing/linux-ash-chromium/x86_64/ash.zip", - "location": "lacros_version_skew_tests_v120.0.6061.0", - "revision": "version:120.0.6061.0" + "location": "lacros_version_skew_tests_v120.0.6062.0", + "revision": "version:120.0.6062.0" } ], "dimensions": {
diff --git a/testing/buildbot/chromium.coverage.json b/testing/buildbot/chromium.coverage.json index 5c0919e5f..0a460656 100644 --- a/testing/buildbot/chromium.coverage.json +++ b/testing/buildbot/chromium.coverage.json
@@ -25449,9 +25449,9 @@ { "args": [ "--test-launcher-filter-file=../../testing/buildbot/filters/linux-lacros.interactive_ui_tests.skew.filter", - "--ash-chrome-path-override=../../lacros_version_skew_tests_v120.0.6061.0/test_ash_chrome" + "--ash-chrome-path-override=../../lacros_version_skew_tests_v120.0.6062.0/test_ash_chrome" ], - "description": "Run with ash-chrome version 120.0.6061.0", + "description": "Run with ash-chrome version 120.0.6062.0", "isolate_profile_data": true, "merge": { "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -25461,8 +25461,8 @@ "cipd_packages": [ { "cipd_package": "chromium/testing/linux-ash-chromium/x86_64/ash.zip", - "location": "lacros_version_skew_tests_v120.0.6061.0", - "revision": "version:120.0.6061.0" + "location": "lacros_version_skew_tests_v120.0.6062.0", + "revision": "version:120.0.6062.0" } ], "dimensions": { @@ -25599,9 +25599,9 @@ { "args": [ "--test-launcher-filter-file=../../testing/buildbot/filters/linux-lacros.lacros_chrome_browsertests.skew.filter", - "--ash-chrome-path-override=../../lacros_version_skew_tests_v120.0.6061.0/test_ash_chrome" + "--ash-chrome-path-override=../../lacros_version_skew_tests_v120.0.6062.0/test_ash_chrome" ], - "description": "Run with ash-chrome version 120.0.6061.0", + "description": "Run with ash-chrome version 120.0.6062.0", "isolate_profile_data": true, "merge": { "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -25611,8 +25611,8 @@ "cipd_packages": [ { "cipd_package": "chromium/testing/linux-ash-chromium/x86_64/ash.zip", - "location": "lacros_version_skew_tests_v120.0.6061.0", - "revision": "version:120.0.6061.0" + "location": "lacros_version_skew_tests_v120.0.6062.0", + "revision": "version:120.0.6062.0" } ], "dimensions": { @@ -27081,22 +27081,6 @@ "merge": { "script": "//testing/merge_scripts/standard_gtest_merge.py" }, - "name": "nacl_loader_unittests", - "swarming": { - "dimensions": { - "cpu": "x86-64", - "os": "Mac-13" - }, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "nacl_loader_unittests", - "test_id_prefix": "ninja://components/nacl/loader:nacl_loader_unittests/" - }, - { - "isolate_profile_data": true, - "merge": { - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, "name": "native_theme_unittests", "swarming": { "dimensions": { @@ -27193,22 +27177,6 @@ "merge": { "script": "//testing/merge_scripts/standard_gtest_merge.py" }, - "name": "ppapi_unittests", - "swarming": { - "dimensions": { - "cpu": "x86-64", - "os": "Mac-13" - }, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "ppapi_unittests", - "test_id_prefix": "ninja://ppapi:ppapi_unittests/" - }, - { - "isolate_profile_data": true, - "merge": { - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, "name": "printing_unittests", "swarming": { "dimensions": { @@ -28492,21 +28460,6 @@ "merge": { "script": "//testing/merge_scripts/standard_gtest_merge.py" }, - "name": "nacl_loader_unittests", - "swarming": { - "dimensions": { - "os": "Windows-10-19045" - }, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "nacl_loader_unittests", - "test_id_prefix": "ninja://components/nacl/loader:nacl_loader_unittests/" - }, - { - "isolate_profile_data": true, - "merge": { - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, "name": "native_theme_unittests", "swarming": { "dimensions": { @@ -28582,21 +28535,6 @@ "merge": { "script": "//testing/merge_scripts/standard_gtest_merge.py" }, - "name": "ppapi_unittests", - "swarming": { - "dimensions": { - "os": "Windows-10-19045" - }, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "ppapi_unittests", - "test_id_prefix": "ninja://ppapi:ppapi_unittests/" - }, - { - "isolate_profile_data": true, - "merge": { - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, "name": "printing_unittests", "swarming": { "dimensions": {
diff --git a/testing/buildbot/chromium.fyi.json b/testing/buildbot/chromium.fyi.json index 4ef71f9..efc9975 100644 --- a/testing/buildbot/chromium.fyi.json +++ b/testing/buildbot/chromium.fyi.json
@@ -2186,11 +2186,6 @@ "test_id_prefix": "ninja://mojo:mojo_unittests/" }, { - "name": "nacl_loader_unittests", - "test": "nacl_loader_unittests", - "test_id_prefix": "ninja://components/nacl/loader:nacl_loader_unittests/" - }, - { "name": "native_theme_unittests", "test": "native_theme_unittests", "test_id_prefix": "ninja://ui/native_theme:native_theme_unittests/" @@ -2216,11 +2211,6 @@ "test_id_prefix": "ninja://third_party/perfetto:perfetto_unittests/" }, { - "name": "ppapi_unittests", - "test": "ppapi_unittests", - "test_id_prefix": "ninja://ppapi:ppapi_unittests/" - }, - { "name": "printing_unittests", "test": "printing_unittests", "test_id_prefix": "ninja://printing:printing_unittests/" @@ -43527,9 +43517,9 @@ { "args": [ "--test-launcher-filter-file=../../testing/buildbot/filters/linux-lacros.interactive_ui_tests.skew.filter", - "--ash-chrome-path-override=../../lacros_version_skew_tests_v120.0.6061.0/test_ash_chrome" + "--ash-chrome-path-override=../../lacros_version_skew_tests_v120.0.6062.0/test_ash_chrome" ], - "description": "Run with ash-chrome version 120.0.6061.0", + "description": "Run with ash-chrome version 120.0.6062.0", "merge": { "script": "//testing/merge_scripts/standard_gtest_merge.py" }, @@ -43538,8 +43528,8 @@ "cipd_packages": [ { "cipd_package": "chromium/testing/linux-ash-chromium/x86_64/ash.zip", - "location": "lacros_version_skew_tests_v120.0.6061.0", - "revision": "version:120.0.6061.0" + "location": "lacros_version_skew_tests_v120.0.6062.0", + "revision": "version:120.0.6062.0" } ], "dimensions": { @@ -43677,9 +43667,9 @@ { "args": [ "--test-launcher-filter-file=../../testing/buildbot/filters/linux-lacros.lacros_chrome_browsertests.skew.filter", - "--ash-chrome-path-override=../../lacros_version_skew_tests_v120.0.6061.0/test_ash_chrome" + "--ash-chrome-path-override=../../lacros_version_skew_tests_v120.0.6062.0/test_ash_chrome" ], - "description": "Run with ash-chrome version 120.0.6061.0", + "description": "Run with ash-chrome version 120.0.6062.0", "merge": { "script": "//testing/merge_scripts/standard_gtest_merge.py" }, @@ -43688,8 +43678,8 @@ "cipd_packages": [ { "cipd_package": "chromium/testing/linux-ash-chromium/x86_64/ash.zip", - "location": "lacros_version_skew_tests_v120.0.6061.0", - "revision": "version:120.0.6061.0" + "location": "lacros_version_skew_tests_v120.0.6062.0", + "revision": "version:120.0.6062.0" } ], "dimensions": { @@ -45001,9 +44991,9 @@ { "args": [ "--test-launcher-filter-file=../../testing/buildbot/filters/linux-lacros.interactive_ui_tests.skew.filter", - "--ash-chrome-path-override=../../lacros_version_skew_tests_v120.0.6061.0/test_ash_chrome" + "--ash-chrome-path-override=../../lacros_version_skew_tests_v120.0.6062.0/test_ash_chrome" ], - "description": "Run with ash-chrome version 120.0.6061.0", + "description": "Run with ash-chrome version 120.0.6062.0", "merge": { "script": "//testing/merge_scripts/standard_gtest_merge.py" }, @@ -45012,8 +45002,8 @@ "cipd_packages": [ { "cipd_package": "chromium/testing/linux-ash-chromium/x86_64/ash.zip", - "location": "lacros_version_skew_tests_v120.0.6061.0", - "revision": "version:120.0.6061.0" + "location": "lacros_version_skew_tests_v120.0.6062.0", + "revision": "version:120.0.6062.0" } ], "dimensions": { @@ -45151,9 +45141,9 @@ { "args": [ "--test-launcher-filter-file=../../testing/buildbot/filters/linux-lacros.lacros_chrome_browsertests.skew.filter", - "--ash-chrome-path-override=../../lacros_version_skew_tests_v120.0.6061.0/test_ash_chrome" + "--ash-chrome-path-override=../../lacros_version_skew_tests_v120.0.6062.0/test_ash_chrome" ], - "description": "Run with ash-chrome version 120.0.6061.0", + "description": "Run with ash-chrome version 120.0.6062.0", "merge": { "script": "//testing/merge_scripts/standard_gtest_merge.py" }, @@ -45162,8 +45152,8 @@ "cipd_packages": [ { "cipd_package": "chromium/testing/linux-ash-chromium/x86_64/ash.zip", - "location": "lacros_version_skew_tests_v120.0.6061.0", - "revision": "version:120.0.6061.0" + "location": "lacros_version_skew_tests_v120.0.6062.0", + "revision": "version:120.0.6062.0" } ], "dimensions": { @@ -45861,9 +45851,9 @@ { "args": [ "--test-launcher-filter-file=../../testing/buildbot/filters/linux-lacros.interactive_ui_tests.skew.filter", - "--ash-chrome-path-override=../../lacros_version_skew_tests_v120.0.6061.0/test_ash_chrome" + "--ash-chrome-path-override=../../lacros_version_skew_tests_v120.0.6062.0/test_ash_chrome" ], - "description": "Run with ash-chrome version 120.0.6061.0", + "description": "Run with ash-chrome version 120.0.6062.0", "merge": { "script": "//testing/merge_scripts/standard_gtest_merge.py" }, @@ -45872,8 +45862,8 @@ "cipd_packages": [ { "cipd_package": "chromium/testing/linux-ash-chromium/x86_64/ash.zip", - "location": "lacros_version_skew_tests_v120.0.6061.0", - "revision": "version:120.0.6061.0" + "location": "lacros_version_skew_tests_v120.0.6062.0", + "revision": "version:120.0.6062.0" } ], "dimensions": { @@ -51892,24 +51882,6 @@ "merge": { "script": "//testing/merge_scripts/standard_gtest_merge.py" }, - "name": "nacl_loader_unittests", - "swarming": { - "dimensions": { - "cpu": "x86-64", - "os": "Windows-10-19045", - "pool": "chromium.tests.no-external-ip" - }, - "expiration": 43200, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "nacl_loader_unittests", - "test_id_prefix": "ninja://components/nacl/loader:nacl_loader_unittests/" - }, - { - "isolate_profile_data": true, - "merge": { - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, "name": "native_theme_unittests", "swarming": { "dimensions": { @@ -52060,24 +52032,6 @@ "merge": { "script": "//testing/merge_scripts/standard_gtest_merge.py" }, - "name": "ppapi_unittests", - "swarming": { - "dimensions": { - "cpu": "x86-64", - "os": "Windows-10-19045", - "pool": "chromium.tests.no-external-ip" - }, - "expiration": 43200, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "ppapi_unittests", - "test_id_prefix": "ninja://ppapi:ppapi_unittests/" - }, - { - "isolate_profile_data": true, - "merge": { - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, "name": "printing_unittests", "swarming": { "dimensions": {
diff --git a/testing/buildbot/chromium.goma.fyi.json b/testing/buildbot/chromium.goma.fyi.json index 865c734..857dad8 100644 --- a/testing/buildbot/chromium.goma.fyi.json +++ b/testing/buildbot/chromium.goma.fyi.json
@@ -75,16 +75,6 @@ } ] }, - "android-archive-dbg-goma-rbe-ats-canary": { - "additional_compile_targets": [ - "chromedriver_webview_shell_apk" - ] - }, - "android-archive-dbg-goma-rbe-canary": { - "additional_compile_targets": [ - "chromedriver_webview_shell_apk" - ] - }, "chromeos-amd64-generic-rel-goma-rbe-canary": { "additional_compile_targets": [ "chromiumos_preflight"
diff --git a/testing/buildbot/chromium.mac.json b/testing/buildbot/chromium.mac.json index 3abcf16..5ee53ea1 100644 --- a/testing/buildbot/chromium.mac.json +++ b/testing/buildbot/chromium.mac.json
@@ -7166,21 +7166,6 @@ "merge": { "script": "//testing/merge_scripts/standard_gtest_merge.py" }, - "name": "nacl_loader_unittests", - "swarming": { - "dimensions": { - "cpu": "x86-64", - "os": "Mac-13" - }, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "nacl_loader_unittests", - "test_id_prefix": "ninja://components/nacl/loader:nacl_loader_unittests/" - }, - { - "merge": { - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, "name": "native_theme_unittests", "swarming": { "dimensions": { @@ -7271,21 +7256,6 @@ "merge": { "script": "//testing/merge_scripts/standard_gtest_merge.py" }, - "name": "ppapi_unittests", - "swarming": { - "dimensions": { - "cpu": "x86-64", - "os": "Mac-13" - }, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "ppapi_unittests", - "test_id_prefix": "ninja://ppapi:ppapi_unittests/" - }, - { - "merge": { - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, "name": "printing_unittests", "swarming": { "dimensions": {
diff --git a/testing/buildbot/chromium.memory.json b/testing/buildbot/chromium.memory.json index bb4f592..850c415 100644 --- a/testing/buildbot/chromium.memory.json +++ b/testing/buildbot/chromium.memory.json
@@ -16364,12 +16364,12 @@ { "args": [ "--test-launcher-filter-file=../../testing/buildbot/filters/linux-lacros.interactive_ui_tests.skew.filter", - "--ash-chrome-path-override=../../lacros_version_skew_tests_v120.0.6061.0/test_ash_chrome", + "--ash-chrome-path-override=../../lacros_version_skew_tests_v120.0.6062.0/test_ash_chrome", "--test-launcher-print-test-stdio=always", "--combine-ash-logs-on-bots", "--asan-symbolize-output" ], - "description": "Run with ash-chrome version 120.0.6061.0", + "description": "Run with ash-chrome version 120.0.6062.0", "isolate_profile_data": true, "merge": { "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -16379,8 +16379,8 @@ "cipd_packages": [ { "cipd_package": "chromium/testing/linux-ash-chromium/x86_64/ash.zip", - "location": "lacros_version_skew_tests_v120.0.6061.0", - "revision": "version:120.0.6061.0" + "location": "lacros_version_skew_tests_v120.0.6062.0", + "revision": "version:120.0.6062.0" } ], "dimensions": { @@ -16534,12 +16534,12 @@ { "args": [ "--test-launcher-filter-file=../../testing/buildbot/filters/linux-lacros.lacros_chrome_browsertests.skew.filter", - "--ash-chrome-path-override=../../lacros_version_skew_tests_v120.0.6061.0/test_ash_chrome", + "--ash-chrome-path-override=../../lacros_version_skew_tests_v120.0.6062.0/test_ash_chrome", "--test-launcher-print-test-stdio=always", "--combine-ash-logs-on-bots", "--asan-symbolize-output" ], - "description": "Run with ash-chrome version 120.0.6061.0", + "description": "Run with ash-chrome version 120.0.6062.0", "isolate_profile_data": true, "merge": { "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -16549,8 +16549,8 @@ "cipd_packages": [ { "cipd_package": "chromium/testing/linux-ash-chromium/x86_64/ash.zip", - "location": "lacros_version_skew_tests_v120.0.6061.0", - "revision": "version:120.0.6061.0" + "location": "lacros_version_skew_tests_v120.0.6062.0", + "revision": "version:120.0.6062.0" } ], "dimensions": { @@ -19502,20 +19502,6 @@ "merge": { "script": "//testing/merge_scripts/standard_gtest_merge.py" }, - "name": "nacl_loader_unittests", - "swarming": { - "dimensions": { - "os": "Windows-10-19045" - }, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "nacl_loader_unittests", - "test_id_prefix": "ninja://components/nacl/loader:nacl_loader_unittests/" - }, - { - "merge": { - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, "name": "native_theme_unittests", "swarming": { "dimensions": { @@ -19587,20 +19573,6 @@ "merge": { "script": "//testing/merge_scripts/standard_gtest_merge.py" }, - "name": "ppapi_unittests", - "swarming": { - "dimensions": { - "os": "Windows-10-19045" - }, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "ppapi_unittests", - "test_id_prefix": "ninja://ppapi:ppapi_unittests/" - }, - { - "merge": { - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, "name": "printing_unittests", "swarming": { "dimensions": {
diff --git a/testing/buildbot/chromium.win.json b/testing/buildbot/chromium.win.json index 3c7e1ba..6bbab46 100644 --- a/testing/buildbot/chromium.win.json +++ b/testing/buildbot/chromium.win.json
@@ -1263,22 +1263,6 @@ "merge": { "script": "//testing/merge_scripts/standard_gtest_merge.py" }, - "name": "nacl_loader_unittests", - "swarming": { - "dimensions": { - "cpu": "x86-64", - "os": "Windows-10-19045" - }, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "nacl_loader_unittests", - "test_id_prefix": "ninja://components/nacl/loader:nacl_loader_unittests/" - }, - { - "isolate_profile_data": true, - "merge": { - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, "name": "native_theme_unittests", "swarming": { "dimensions": { @@ -1415,22 +1399,6 @@ "merge": { "script": "//testing/merge_scripts/standard_gtest_merge.py" }, - "name": "ppapi_unittests", - "swarming": { - "dimensions": { - "cpu": "x86-64", - "os": "Windows-10-19045" - }, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "ppapi_unittests", - "test_id_prefix": "ninja://ppapi:ppapi_unittests/" - }, - { - "isolate_profile_data": true, - "merge": { - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, "name": "printing_unittests", "swarming": { "dimensions": { @@ -3208,21 +3176,6 @@ "merge": { "script": "//testing/merge_scripts/standard_gtest_merge.py" }, - "name": "nacl_loader_unittests", - "swarming": { - "dimensions": { - "cpu": "x86-64", - "os": "Windows-10-19045" - }, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "nacl_loader_unittests", - "test_id_prefix": "ninja://components/nacl/loader:nacl_loader_unittests/" - }, - { - "merge": { - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, "name": "native_theme_unittests", "swarming": { "dimensions": { @@ -3298,21 +3251,6 @@ "merge": { "script": "//testing/merge_scripts/standard_gtest_merge.py" }, - "name": "ppapi_unittests", - "swarming": { - "dimensions": { - "cpu": "x86-64", - "os": "Windows-10-19045" - }, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "ppapi_unittests", - "test_id_prefix": "ninja://ppapi:ppapi_unittests/" - }, - { - "merge": { - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, "name": "printing_unittests", "swarming": { "dimensions": { @@ -4998,22 +4936,6 @@ "merge": { "script": "//testing/merge_scripts/standard_gtest_merge.py" }, - "name": "nacl_loader_unittests", - "swarming": { - "dimensions": { - "cpu": "x86-64", - "os": "Windows-11-22000" - }, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "nacl_loader_unittests", - "test_id_prefix": "ninja://components/nacl/loader:nacl_loader_unittests/" - }, - { - "isolate_profile_data": true, - "merge": { - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, "name": "native_theme_unittests", "swarming": { "dimensions": { @@ -5121,22 +5043,6 @@ "merge": { "script": "//testing/merge_scripts/standard_gtest_merge.py" }, - "name": "ppapi_unittests", - "swarming": { - "dimensions": { - "cpu": "x86-64", - "os": "Windows-11-22000" - }, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "ppapi_unittests", - "test_id_prefix": "ninja://ppapi:ppapi_unittests/" - }, - { - "isolate_profile_data": true, - "merge": { - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, "name": "printing_unittests", "swarming": { "dimensions": {
diff --git a/testing/buildbot/gn_isolate_map.pyl b/testing/buildbot/gn_isolate_map.pyl index 8534d94..bce888e 100644 --- a/testing/buildbot/gn_isolate_map.pyl +++ b/testing/buildbot/gn_isolate_map.pyl
@@ -446,10 +446,6 @@ "--log-path=${ISOLATED_OUTDIR}/chromedriver.log", ], }, - "chromedriver_webview_shell_apk": { - "label": "//chrome/test/chromedriver/test/webview_shell:chromedriver_webview_shell_apk", - "type": "additional_compile_target", - }, "chromeos_integration_tests": { "label": "//chrome/test:chromeos_integration_tests", "type": "windowed_test_launcher",
diff --git a/testing/buildbot/test_suites.pyl b/testing/buildbot/test_suites.pyl index 5a94335..8d5a3cc 100644 --- a/testing/buildbot/test_suites.pyl +++ b/testing/buildbot/test_suites.pyl
@@ -5999,7 +5999,7 @@ 'chromium_gtests_for_linux_and_mac_only', 'mac_specific_chromium_gtests', 'non_android_and_cast_and_chromeos_chromium_gtests', - 'non_android_chromium_gtests', + 'non_android_chromium_gtests_no_nacl', ], 'chromium_mac_gtests_no_nacl': [ @@ -6060,7 +6060,7 @@ 'cr23_pixel_browser_tests_gtests', 'fieldtrial_browser_tests', 'non_android_and_cast_and_chromeos_chromium_gtests', - 'non_android_chromium_gtests', + 'non_android_chromium_gtests_no_nacl', 'non_android_chromium_gtests_skia_gold', 'pixel_browser_tests_gtests', 'vr_platform_specific_chromium_gtests', @@ -6076,7 +6076,7 @@ 'cr23_win_gtests', 'fieldtrial_browser_tests', 'non_android_and_cast_and_chromeos_chromium_gtests', - 'non_android_chromium_gtests', + 'non_android_chromium_gtests_no_nacl', 'non_android_chromium_gtests_skia_gold', 'pixel_browser_tests_gtests', 'vr_platform_specific_chromium_gtests', @@ -6097,7 +6097,7 @@ 'chromium_gtests_for_devices_with_graphical_output', 'chromium_gtests_for_win_and_linux_only', 'non_android_and_cast_and_chromeos_chromium_gtests', - 'non_android_chromium_gtests', + 'non_android_chromium_gtests_no_nacl', 'vr_platform_specific_chromium_gtests', 'win_specific_chromium_gtests', ],
diff --git a/testing/buildbot/variants.pyl b/testing/buildbot/variants.pyl index 5382e28..ac4b64e 100644 --- a/testing/buildbot/variants.pyl +++ b/testing/buildbot/variants.pyl
@@ -70,16 +70,16 @@ }, 'LACROS_VERSION_SKEW_CANARY': { 'identifier': 'Lacros version skew testing ash canary', - 'description': 'Run with ash-chrome version 120.0.6061.0', + 'description': 'Run with ash-chrome version 120.0.6062.0', 'args': [ - '--ash-chrome-path-override=../../lacros_version_skew_tests_v120.0.6061.0/test_ash_chrome', + '--ash-chrome-path-override=../../lacros_version_skew_tests_v120.0.6062.0/test_ash_chrome', ], 'swarming': { 'cipd_packages': [ { 'cipd_package': 'chromium/testing/linux-ash-chromium/x86_64/ash.zip', - 'location': 'lacros_version_skew_tests_v120.0.6061.0', - 'revision': 'version:120.0.6061.0', + 'location': 'lacros_version_skew_tests_v120.0.6062.0', + 'revision': 'version:120.0.6062.0', }, ], },
diff --git a/testing/buildbot/waterfalls.pyl b/testing/buildbot/waterfalls.pyl index e0d169d..e935de0 100644 --- a/testing/buildbot/waterfalls.pyl +++ b/testing/buildbot/waterfalls.pyl
@@ -4085,16 +4085,6 @@ }, }, }, - 'android-archive-dbg-goma-rbe-ats-canary': { - 'additional_compile_targets': [ - 'chromedriver_webview_shell_apk', - ], - }, - 'android-archive-dbg-goma-rbe-canary': { - 'additional_compile_targets': [ - 'chromedriver_webview_shell_apk', - ], - }, # Note: # chromeos-amd64-generic-rel-goma-* builders mirror targets of # chromeos-amd64-generic-rel.
diff --git a/third_party/blink/public/mojom/use_counter/metrics/css_property_id.mojom b/third_party/blink/public/mojom/use_counter/metrics/css_property_id.mojom index 3c3b5d4..fae31a4 100644 --- a/third_party/blink/public/mojom/use_counter/metrics/css_property_id.mojom +++ b/third_party/blink/public/mojom/use_counter/metrics/css_property_id.mojom
@@ -829,6 +829,7 @@ kMaskClip = 773, kMaskSize = 774, kMaskOrigin = 775, + kTextSpacing = 776, // 1. Add new features above this line (don't change the assigned numbers of // the existing items).
diff --git a/third_party/blink/renderer/core/css/css_properties.json5 b/third_party/blink/renderer/core/css/css_properties.json5 index b5e27bb..afe4e03 100644 --- a/third_party/blink/renderer/core/css/css_properties.json5 +++ b/third_party/blink/renderer/core/css/css_properties.json5
@@ -5093,6 +5093,12 @@ typedom_types: ["Keyword", "Percentage"], }, { + name: "text-spacing", + longhands: ["text-autospace", "text-spacing-trim"], + property_methods: ["ParseShorthand", "CSSValueFromComputedStyleInternal"], + runtime_flag: "CSSTextSpacingTrim", + }, + { name: "text-spacing-trim", property_methods: ["CSSValueFromComputedStyleInternal"], inherited: true,
diff --git a/third_party/blink/renderer/core/css/css_property_equality.cc b/third_party/blink/renderer/core/css/css_property_equality.cc index 84e9c8e..ccd989cd 100644 --- a/third_party/blink/renderer/core/css/css_property_equality.cc +++ b/third_party/blink/renderer/core/css/css_property_equality.cc
@@ -1226,6 +1226,7 @@ case CSSPropertyID::kScrollTimeline: case CSSPropertyID::kTextDecoration: case CSSPropertyID::kTextEmphasis: + case CSSPropertyID::kTextSpacing: case CSSPropertyID::kToggle: case CSSPropertyID::kTransition: case CSSPropertyID::kViewTimeline:
diff --git a/third_party/blink/renderer/core/css/properties/css_parsing_utils.cc b/third_party/blink/renderer/core/css/properties/css_parsing_utils.cc index f68c4e8..35b0959 100644 --- a/third_party/blink/renderer/core/css/properties/css_parsing_utils.cc +++ b/third_party/blink/renderer/core/css/properties/css_parsing_utils.cc
@@ -6604,6 +6604,20 @@ return list; } +// Consume the `autospace` production. +// https://drafts.csswg.org/css-text-4/#typedef-autospace +CSSValue* ConsumeAutospace(CSSParserTokenRange& range) { + // Currently, only `no-autospace` is supported. + return ConsumeIdent<CSSValueID::kNoAutospace>(range); +} + +// Consume the `spacing-trim` production. +// https://drafts.csswg.org/css-text-4/#typedef-spacing-trim +CSSValue* ConsumeSpacingTrim(CSSParserTokenRange& range) { + // Currently, only `space-first` and `space-all` are supported. + return ConsumeIdent<CSSValueID::kSpaceFirst, CSSValueID::kSpaceAll>(range); +} + CSSValue* ConsumeToggleGroup(CSSParserTokenRange& range, const CSSParserContext& context) { if (range.Peek().Id() == CSSValueID::kNone) {
diff --git a/third_party/blink/renderer/core/css/properties/css_parsing_utils.h b/third_party/blink/renderer/core/css/properties/css_parsing_utils.h index ced3ce2..dc3f174b 100644 --- a/third_party/blink/renderer/core/css/properties/css_parsing_utils.h +++ b/third_party/blink/renderer/core/css/properties/css_parsing_utils.h
@@ -525,6 +525,13 @@ CSSValue* ConsumeTextDecorationLine(CSSParserTokenRange&); +// Consume the `autospace` production. +// https://drafts.csswg.org/css-text-4/#typedef-autospace +CSSValue* ConsumeAutospace(CSSParserTokenRange&); +// Consume the `spacing-trim` production. +// https://drafts.csswg.org/css-text-4/#typedef-spacing-trim +CSSValue* ConsumeSpacingTrim(CSSParserTokenRange&); + CSSValue* ConsumeToggleGroup(CSSParserTokenRange&, const CSSParserContext&); CSSValue* ConsumeToggleSpecifier(CSSParserTokenRange&, const CSSParserContext&); CSSValue* ConsumeToggleTrigger(CSSParserTokenRange&, const CSSParserContext&);
diff --git a/third_party/blink/renderer/core/css/properties/shorthands/shorthands_custom.cc b/third_party/blink/renderer/core/css/properties/shorthands/shorthands_custom.cc index 06ff05a..c4c105c 100644 --- a/third_party/blink/renderer/core/css/properties/shorthands/shorthands_custom.cc +++ b/third_party/blink/renderer/core/css/properties/shorthands/shorthands_custom.cc
@@ -3917,6 +3917,113 @@ textEmphasisShorthand(), style, layout_object, allow_visited_style); } +bool TextSpacing::ParseShorthand( + bool important, + CSSParserTokenRange& range, + const CSSParserContext& context, + const CSSParserLocalContext&, + HeapVector<CSSPropertyValue, 64>& properties) const { + const CSSParserTokenRange original_range = range; + CSSValue* autospace = nullptr; + CSSValue* spacing_trim = nullptr; + + // The `text-spacing` shorthand doesn't lean directly on the longhand's + // grammar, instead uses the `autospace` and `spacing-trim` productions. + // https://drafts.csswg.org/css-text-4/#text-spacing-property + // + // Try `normal | none` first. + if (const CSSIdentifierValue* ident = + css_parsing_utils::ConsumeIdent<CSSValueID::kNone, + CSSValueID::kNormal>(range); + ident && range.AtEnd()) { + switch (ident->GetValueID()) { + case CSSValueID::kNone: + autospace = CSSIdentifierValue::Create(CSSValueID::kNoAutospace); + spacing_trim = CSSIdentifierValue::Create(CSSValueID::kSpaceAll); + break; + case CSSValueID::kNormal: + autospace = CSSIdentifierValue::Create(CSSValueID::kNormal); + spacing_trim = CSSIdentifierValue::Create(CSSValueID::kSpaceFirst); + break; + default: + NOTREACHED_NORETURN(); + } + } + + // Try `<autospace> || <spacing-trim>`. + if (!autospace) { + range = original_range; + + while (!range.AtEnd()) { + if (!autospace && + (autospace = css_parsing_utils::ConsumeAutospace(range))) { + continue; + } + if (!spacing_trim && + (spacing_trim = css_parsing_utils::ConsumeSpacingTrim(range))) { + continue; + } + return false; + } + if (!autospace && !spacing_trim) { + return false; + } + if (!autospace) { + autospace = CSSIdentifierValue::Create(CSSValueID::kNormal); + } + if (!spacing_trim) { + spacing_trim = CSSIdentifierValue::Create(CSSValueID::kSpaceFirst); + } + } + + CHECK(autospace); + AddProperty(CSSPropertyID::kTextAutospace, CSSPropertyID::kTextSpacing, + *autospace, important, + css_parsing_utils::IsImplicitProperty::kNotImplicit, properties); + CHECK(spacing_trim); + AddProperty(CSSPropertyID::kTextSpacingTrim, CSSPropertyID::kTextSpacing, + *spacing_trim, important, + css_parsing_utils::IsImplicitProperty::kNotImplicit, properties); + return true; +} + +const CSSValue* TextSpacing::CSSValueFromComputedStyleInternal( + const ComputedStyle& style, + const LayoutObject* layout_object, + bool allow_visited_style) const { + const ETextAutospace autospace = style.TextAutospace(); + const TextSpacingTrim spacing_trim = + style.GetFontDescription().GetTextSpacingTrim(); + if (autospace == ComputedStyleInitialValues::InitialTextAutospace() && + spacing_trim == FontBuilder::InitialTextSpacingTrim()) { + return CSSIdentifierValue::Create(CSSValueID::kNormal); + } + if (autospace == ETextAutospace::kNoAutospace && + spacing_trim == TextSpacingTrim::kSpaceAll) { + return CSSIdentifierValue::Create(CSSValueID::kNone); + } + + const CSSValue* autospace_value = + autospace == ComputedStyleInitialValues::InitialTextAutospace() + ? nullptr + : CSSIdentifierValue::Create(autospace); + const CSSValue* spacing_trim_value = + spacing_trim == FontBuilder::InitialTextSpacingTrim() + ? nullptr + : CSSIdentifierValue::Create(spacing_trim); + if (!autospace_value) { + CHECK(spacing_trim_value); + return spacing_trim_value; + } + if (!spacing_trim_value) { + return autospace_value; + } + CSSValueList* list = CSSValueList::CreateSpaceSeparated(); + list->Append(*autospace_value); + list->Append(*spacing_trim_value); + return list; +} + bool WebkitTextStroke::ParseShorthand( bool important, CSSParserTokenRange& range,
diff --git a/third_party/blink/renderer/core/css/style_property_serializer.cc b/third_party/blink/renderer/core/css/style_property_serializer.cc index de2cdc0a..386b4845 100644 --- a/third_party/blink/renderer/core/css/style_property_serializer.cc +++ b/third_party/blink/renderer/core/css/style_property_serializer.cc
@@ -635,6 +635,8 @@ return GetLayeredShorthandValue(webkitAlternativeMaskShorthand()); case CSSPropertyID::kTextEmphasis: return GetShorthandValue(textEmphasisShorthand()); + case CSSPropertyID::kTextSpacing: + return TextSpacingValue(); case CSSPropertyID::kWebkitTextStroke: return GetShorthandValue(webkitTextStrokeShorthand()); case CSSPropertyID::kMarker: { @@ -2383,6 +2385,42 @@ return true; } +String StylePropertySerializer::TextSpacingValue() const { + const auto* autospace_value = DynamicTo<CSSIdentifierValue>( + property_set_.GetPropertyCSSValue(GetCSSPropertyTextAutospace())); + DCHECK(autospace_value); + const auto* spacing_trim_value = DynamicTo<CSSIdentifierValue>( + property_set_.GetPropertyCSSValue(GetCSSPropertyTextSpacingTrim())); + DCHECK(spacing_trim_value); + + // Check if longhands are one of pre-defined keywords. + const CSSValueID autospace_id = autospace_value->GetValueID(); + const CSSValueID spacing_trim_id = spacing_trim_value->GetValueID(); + if (autospace_id == CSSValueID::kNormal && + spacing_trim_id == CSSValueID::kSpaceFirst) { + return getValueName(CSSValueID::kNormal); + } + if (autospace_id == CSSValueID::kNoAutospace && + spacing_trim_id == CSSValueID::kSpaceAll) { + return getValueName(CSSValueID::kNone); + } + + // Otherwise build a multi-value list. + StringBuilder result; + if (autospace_id != CSSValueID::kNormal) { + result.Append(getValueName(autospace_id)); + } + if (spacing_trim_id != CSSValueID::kSpaceFirst) { + if (!result.empty()) { + result.Append(kSpaceCharacter); + } + result.Append(getValueName(spacing_trim_id)); + } + // When all longhands are initial values, it should be `normal`. + DCHECK(!result.empty()); + return result.ToString(); +} + String StylePropertySerializer::WhiteSpaceValue() const { const CSSValue* collapse_value = property_set_.GetPropertyCSSValue(GetCSSPropertyWhiteSpaceCollapse());
diff --git a/third_party/blink/renderer/core/css/style_property_serializer.h b/third_party/blink/renderer/core/css/style_property_serializer.h index 41c6fe98..92eea5d 100644 --- a/third_party/blink/renderer/core/css/style_property_serializer.h +++ b/third_party/blink/renderer/core/css/style_property_serializer.h
@@ -84,6 +84,7 @@ StringBuilder& result) const; String OffsetValue() const; String TextDecorationValue() const; + String TextSpacingValue() const; String BackgroundRepeatPropertyValue() const; String ContainIntrinsicSizeValue() const; String WhiteSpaceValue() const;
diff --git a/third_party/blink/renderer/core/editing/commands/insert_text_command_test.cc b/third_party/blink/renderer/core/editing/commands/insert_text_command_test.cc index dd47c81..33077e5 100644 --- a/third_party/blink/renderer/core/editing/commands/insert_text_command_test.cc +++ b/third_party/blink/renderer/core/editing/commands/insert_text_command_test.cc
@@ -4,6 +4,7 @@ #include "third_party/blink/renderer/core/editing/commands/insert_text_command.h" +#include "build/buildflag.h" #include "third_party/blink/renderer/core/editing/frame_selection.h" #include "third_party/blink/renderer/core/editing/selection_template.h" #include "third_party/blink/renderer/core/editing/testing/editing_test_base.h" @@ -213,6 +214,11 @@ TEST_F(InsertTextCommandTest, NoVisibleSelectionAfterDeletingSelection) { GetDocument().SetCompatibilityMode(Document::kQuirksMode); InsertStyleElement( +#if BUILDFLAG(IS_FUCHSIA) + // TODO(https://crbug.com/1463890): LineBreaker somehow fails if + // text-autospace is enabled. Tentatively opt out for now.. + "div {text-autospace: no-autospace;}" +#endif "ruby {display: inline-block; height: 100%}" "navi {float: left}"); Selection().SetSelection(
diff --git a/third_party/blink/renderer/core/exported/web_view_impl.cc b/third_party/blink/renderer/core/exported/web_view_impl.cc index 8fd06b6..2f757e6 100644 --- a/third_party/blink/renderer/core/exported/web_view_impl.cc +++ b/third_party/blink/renderer/core/exported/web_view_impl.cc
@@ -397,6 +397,8 @@ return ui::mojom::blink::WindowOpenDisposition::NEW_POPUP; case kNavigationPolicyPictureInPicture: return ui::mojom::blink::WindowOpenDisposition::NEW_PICTURE_IN_PICTURE; + case kNavigationPolicyLinkPreview: + NOTREACHED_NORETURN(); } NOTREACHED() << "Unexpected NavigationPolicy"; return ui::mojom::blink::WindowOpenDisposition::IGNORE_ACTION;
diff --git a/third_party/blink/renderer/core/html/forms/html_form_element.cc b/third_party/blink/renderer/core/html/forms/html_form_element.cc index 198ebba..2dd41eab 100644 --- a/third_party/blink/renderer/core/html/forms/html_form_element.cc +++ b/third_party/blink/renderer/core/html/forms/html_form_element.cc
@@ -475,6 +475,12 @@ FormSubmission* form_submission = FormSubmission::Create(this, attributes_, event, submit_button); + if (!form_submission) { + // Form submission is not allowed for some NavigationPolicies, e.g. Link + // Preview. If an user triggered such user event for form submission, just + // ignores it. + return; + } Frame* target_frame = form_submission->TargetFrame(); // 'formdata' event handlers might disconnect the form.
diff --git a/third_party/blink/renderer/core/html/forms/resources/input_alert.svg b/third_party/blink/renderer/core/html/forms/resources/input_alert.svg index b81e8d76..a192e9b9 100644 --- a/third_party/blink/renderer/core/html/forms/resources/input_alert.svg +++ b/third_party/blink/renderer/core/html/forms/resources/input_alert.svg
@@ -3,20 +3,20 @@ Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. --> <svg xmlns="http://www.w3.org/2000/svg" width="23" height="23" viewBox="0 0 47 47" id="icon"> -<rect x="0" y="0" width="47" height="47" rx="4" ry="4" fill="#ffa300"/> + <rect x="0" y="0" width="47" height="47" rx="4" ry="4" fill="#ff8c00"/> -<rect x="19" y="10" width="9" height="15" fill="#ffbc4f" /> -<rect x="20" y="10" width="7" height="15" fill="#ffffff" /> -<rect x="20" y="9" width="7" height="1" fill="#ffb53d" /> -<rect x="20" y="25" width="7" height="1" fill="#ffd6af" /> -<rect x="20" y="26" width="7" height="1" fill="#ff7e00" /> + <rect x="19" y="10" width="9" height="15" fill="#ffbc4f" /> + <rect x="20" y="10" width="7" height="15" fill="#ffffff" /> + <rect x="20" y="9" width="7" height="1" fill="#ffb53d" /> + <rect x="20" y="25" width="7" height="1" fill="#ffd6af" /> + <rect x="20" y="26" width="7" height="1" fill="#ff7e00" /> -<defs> -<linearGradient id="g1" x1="0" y1="0" x2="0" y2="1"> -<stop offset="0%" stop-color="#ffb53d" /> -<stop offset="100%" stop-color="#ff7e00" /> -</linearGradient> -</defs> -<circle cx="23.5" cy="33" r="4.5" fill="url(#g1)"/> -<circle cx="23.5" cy="33" r="3.5" fill="#ffffff"/> + <defs> + <linearGradient id="g1" x1="0" y1="0" x2="0" y2="1"> + <stop offset="0%" stop-color="#ffb53d" /> + <stop offset="100%" stop-color="#ff7e00" /> + </linearGradient> + </defs> + <circle cx="23.5" cy="33" r="4.5" fill="url(#g1)"/> + <circle cx="23.5" cy="33" r="3.5" fill="#ffffff"/> </svg>
diff --git a/third_party/blink/renderer/core/html/html_anchor_element.cc b/third_party/blink/renderer/core/html/html_anchor_element.cc index 85acd930..b5d10f3 100644 --- a/third_party/blink/renderer/core/html/html_anchor_element.cc +++ b/third_party/blink/renderer/core/html/html_anchor_element.cc
@@ -82,11 +82,6 @@ // unresponsive or crashing. const int kMaxDownloadAttrLength = 1000000; -// If feature flag kLinkPreview enabled and mouse keeps hovering anchor element, -// preview will be started. -// TODO(https://b.corp.google.com/issues/296992745): Make it configurable. -const base::TimeDelta kLinkPreviewHoverDwellThreshold = base::Milliseconds(300); - // Note: Here it covers download originated from clicking on <a download> link // that results in direct download. Features in this method can also be logged // from browser for download due to navigations to non-web-renderable content. @@ -129,10 +124,7 @@ : HTMLElement(tag_name, document), link_relations_(0), cached_visited_link_hash_(0), - rel_list_(MakeGarbageCollected<RelList>(this)), - hover_timer_(document.GetTaskRunner(TaskType::kIdleTask), - this, - &HTMLAnchorElement::InitiatePreview) {} + rel_list_(MakeGarbageCollected<RelList>(this)) {} HTMLAnchorElement::~HTMLAnchorElement() = default; @@ -466,6 +458,14 @@ return; } + if (navigation_policy == kNavigationPolicyLinkPreview) { + // Ensured by third_party/blink/renderer/core/loader/navigation_policy.cc. + CHECK(base::FeatureList::IsEnabled(features::kLinkPreview)); + + DocumentSpeculationRules::From(GetDocument()).InitiatePreview(Url()); + return; + } + request.SetRequestContext(mojom::blink::RequestContextType::HYPERLINK); FrameLoadRequest frame_request(window, request); frame_request.SetNavigationPolicy(navigation_policy); @@ -529,28 +529,8 @@ } } -void HTMLAnchorElement::InitiatePreview(TimerBase*) { - DocumentSpeculationRules::From(GetDocument()).InitiatePreview(Url()); -} - void HTMLAnchorElement::SetHovered(bool hovered) { HTMLElement::SetHovered(hovered); - - if (!base::FeatureList::IsEnabled(features::kLinkPreview)) { - return; - } - - if (!hovered) { - hover_timer_.Stop(); - } else { - // Note that this trigger is a tentative version to develop Link - // Preview. - // TODO(https://b.corp.google.com/issues/296992745): Discuss about - // it and fix it. - if (Url().IsValid()) { - hover_timer_.StartOneShot(kLinkPreviewHoverDwellThreshold, FROM_HERE); - } - } } void HTMLAnchorElement::HandleClick(Event& event) { @@ -596,10 +576,12 @@ LocalFrame* frame = window->GetFrame(); request.SetHasUserGesture(LocalFrame::HasTransientUserActivation(frame)); + NavigationPolicy navigation_policy = NavigationPolicyFromEvent(&event); + // Respect the download attribute only if we can read the content, and the // event is not an alt-click or similar. if (FastHasAttribute(html_names::kDownloadAttr) && - NavigationPolicyFromEvent(&event) != kNavigationPolicyDownload && + navigation_policy != kNavigationPolicyDownload && window->GetSecurityOrigin()->CanReadContent(completed_url)) { if (ShouldInterveneDownloadByFramePolicy(frame)) return; @@ -651,22 +633,20 @@ return; } - NavigationPolicy navigation_policy = NavigationPolicyFromEvent(&event); base::OnceClosure navigate_closure = WTF::BindOnce( &HTMLAnchorElement::NavigateToHyperlink, WrapWeakPersistent(this), std::move(request), navigation_policy, event.isTrusted(), event.PlatformTimeStamp(), std::move(completed_url)); - if (navigation_policy == kNavigationPolicyDownload) { - // If Alt is held down it will force a download, however, wait to see if - // this is an alt-double-click which should instead select the text of the - // link. - // See https://crbug.com/1428816 + if (navigation_policy == kNavigationPolicyDownload || + navigation_policy == kNavigationPolicyLinkPreview) { + // We distinguish single/double click with some modifiers. + // See the comment of `EventHandler.delayed_navigation_task_handle_`. auto task_handle = PostDelayedCancellableTask( *base::SingleThreadTaskRunner::GetCurrentDefault(), FROM_HERE, std::move(navigate_closure), base::Milliseconds(ui::kDoubleClickTimeMs)); - frame->GetEventHandler().SetDownloadModifierTaskHandle( + frame->GetEventHandler().SetDelayedNavigationTaskHandle( std::move(task_handle)); } else { std::move(navigate_closure).Run(); @@ -754,7 +734,6 @@ void HTMLAnchorElement::Trace(Visitor* visitor) const { visitor->Trace(rel_list_); - visitor->Trace(hover_timer_); HTMLElement::Trace(visitor); }
diff --git a/third_party/blink/renderer/core/html/html_anchor_element.h b/third_party/blink/renderer/core/html/html_anchor_element.h index 5fa8adaea..1e042d130 100644 --- a/third_party/blink/renderer/core/html/html_anchor_element.h +++ b/third_party/blink/renderer/core/html/html_anchor_element.h
@@ -100,8 +100,6 @@ void SendPings(const KURL& destination_url) const; - void InitiatePreview(TimerBase*); - // Element overrides: void SetHovered(bool hovered) override; @@ -137,9 +135,6 @@ unsigned link_relations_ : 31; mutable LinkHash cached_visited_link_hash_; Member<RelList> rel_list_; - // TODO(https://b.corp.google.com/issues/296992745): Use - // AnchorElementInteractionTracker instead. - HeapTaskRunnerTimer<HTMLAnchorElement> hover_timer_; }; inline LinkHash HTMLAnchorElement::VisitedLinkHash() const {
diff --git a/third_party/blink/renderer/core/input/event_handler.cc b/third_party/blink/renderer/core/input/event_handler.cc index 938877d..5343a1c 100644 --- a/third_party/blink/renderer/core/input/event_handler.cc +++ b/third_party/blink/renderer/core/input/event_handler.cc
@@ -1440,12 +1440,12 @@ return pointer_event_manager_->CurrentTouchDownElement(); } -void EventHandler::SetDownloadModifierTaskHandle(TaskHandle task_handle) { - download_modifier_task_handle_ = std::move(task_handle); +void EventHandler::SetDelayedNavigationTaskHandle(TaskHandle task_handle) { + delayed_navigation_task_handle_ = std::move(task_handle); } -TaskHandle& EventHandler::GetDownloadModifierTaskHandle() { - return download_modifier_task_handle_; +TaskHandle& EventHandler::GetDelayedNavigationTaskHandle() { + return delayed_navigation_task_handle_; } bool EventHandler::IsPointerIdActiveOnFrame(PointerId pointer_id,
diff --git a/third_party/blink/renderer/core/input/event_handler.h b/third_party/blink/renderer/core/input/event_handler.h index af669ebb..12e388d 100644 --- a/third_party/blink/renderer/core/input/event_handler.h +++ b/third_party/blink/renderer/core/input/event_handler.h
@@ -279,9 +279,9 @@ Element* CurrentTouchDownElement(); - void SetDownloadModifierTaskHandle(TaskHandle task_handle); + void SetDelayedNavigationTaskHandle(TaskHandle task_handle); - TaskHandle& GetDownloadModifierTaskHandle(); + TaskHandle& GetDelayedNavigationTaskHandle(); private: WebInputEventResult HandleMouseMoveOrLeaveEvent( @@ -325,11 +325,20 @@ Element* EffectiveMouseEventTargetElement(Element*); - // When a link is clicked with the alt-modifier it forces a download. However, - // a double-click with the alt-modifier should select the text of the link. - // The alt-click thus posts this task to perform the download, - // which can be canceled by a double-click being received. - TaskHandle download_modifier_task_handle_; + // Task handle used to distinguish single/double click with some modifiers. + // + // When single click with some modifiers occurred, this task handle is set. + // If double click follows, this is cancelled and renderer emit double click + // event. (By default, it is handled by renderer as text selection.) If not, + // the delayed navigation is emitted. + // + // Currently, the target navigations are the followings: + // + // - Download (Alt-click with/without some other modifiers.) + // - Link Preview (Alt-click) + // + // For more details, see https://crbug.com/1428816. + TaskHandle delayed_navigation_task_handle_; // Dispatches ME after corresponding PE provided the PE has not been // canceled. The |mouse_event_type| arg must be one of {mousedown,
diff --git a/third_party/blink/renderer/core/input/widget_event_handler.cc b/third_party/blink/renderer/core/input/widget_event_handler.cc index b834e494..40c1d15 100644 --- a/third_party/blink/renderer/core/input/widget_event_handler.cc +++ b/third_party/blink/renderer/core/input/widget_event_handler.cc
@@ -174,7 +174,7 @@ void WidgetEventHandler::HandleMouseDown(LocalFrame& local_root, const WebMouseEvent& event) { if (IsDoubleAltClick(event)) { - local_root.GetEventHandler().GetDownloadModifierTaskHandle().Cancel(); + local_root.GetEventHandler().GetDelayedNavigationTaskHandle().Cancel(); } WebMouseEvent transformed_event =
diff --git a/third_party/blink/renderer/core/inspector/devtools_agent.cc b/third_party/blink/renderer/core/inspector/devtools_agent.cc index e607a541..5bc79a2 100644 --- a/third_party/blink/renderer/core/inspector/devtools_agent.cc +++ b/third_party/blink/renderer/core/inspector/devtools_agent.cc
@@ -26,6 +26,7 @@ #include "third_party/blink/renderer/core/probe/core_probes.h" #include "third_party/blink/renderer/core/workers/worker_global_scope.h" #include "third_party/blink/renderer/core/workers/worker_thread.h" +#include "third_party/blink/renderer/platform/heap/cross_thread_handle.h" #include "third_party/blink/renderer/platform/heap/persistent.h" #include "third_party/blink/renderer/platform/wtf/cross_thread_copier_mojo.h" #include "third_party/blink/renderer/platform/wtf/text/wtf_string.h" @@ -76,7 +77,7 @@ public: IOAgent(scoped_refptr<base::SingleThreadTaskRunner> io_task_runner, scoped_refptr<InspectorTaskRunner> inspector_task_runner, - CrossThreadWeakPersistent<::blink::DevToolsAgent> agent, + CrossThreadWeakHandle<::blink::DevToolsAgent> agent, mojo::PendingReceiver<mojom::blink::DevToolsAgent> receiver) : io_task_runner_(io_task_runner), inspector_task_runner_(inspector_task_runner), @@ -120,8 +121,9 @@ DCHECK(io_task_runner_->RunsTasksInCurrentSequence()); DCHECK(receiver_.is_bound()); inspector_task_runner_->AppendTask(CrossThreadBindOnce( - &::blink::DevToolsAgent::AttachDevToolsSessionImpl, agent_, - std::move(host), std::move(main_session), std::move(io_session), + &::blink::DevToolsAgent::AttachDevToolsSessionImpl, + MakeUnwrappingCrossThreadWeakHandle(agent_), std::move(host), + std::move(main_session), std::move(io_session), std::move(reattach_session_state), client_expects_binary_responses, client_is_trusted, session_id, session_waits_for_debugger)); } @@ -142,8 +144,9 @@ auto split_callback = base::SplitOnceCallback(std::move(callback)); bool did_append_task = inspector_task_runner_->AppendTask(CrossThreadBindOnce( - &blink::DevToolsAgent::ReportChildTargetsPostCallbackToIO, agent_, - report, wait_for_debugger, + &blink::DevToolsAgent::ReportChildTargetsPostCallbackToIO, + MakeUnwrappingCrossThreadWeakHandle(agent_), report, + wait_for_debugger, CrossThreadBindOnce(std::move(split_callback.first)))); if (!did_append_task) { @@ -171,7 +174,7 @@ private: scoped_refptr<base::SingleThreadTaskRunner> io_task_runner_; scoped_refptr<InspectorTaskRunner> inspector_task_runner_; - CrossThreadWeakPersistent<::blink::DevToolsAgent> agent_; + CrossThreadWeakHandle<::blink::DevToolsAgent> agent_; mojo::Receiver<mojom::blink::DevToolsAgent> receiver_{this}; }; @@ -215,9 +218,8 @@ host_remote_.set_disconnect_handler(WTF::BindOnce( &DevToolsAgent::CleanupConnection, WrapWeakPersistent(this))); - io_agent_ = - new IOAgent(io_task_runner_, inspector_task_runner_, - WrapCrossThreadWeakPersistent(this), std::move(receiver)); + io_agent_ = new IOAgent(io_task_runner_, inspector_task_runner_, + MakeCrossThreadWeakHandle(this), std::move(receiver)); } void DevToolsAgent::BindReceiver(
diff --git a/third_party/blink/renderer/core/inspector/devtools_session.cc b/third_party/blink/renderer/core/inspector/devtools_session.cc index 01c2f36..b9a32cce 100644 --- a/third_party/blink/renderer/core/inspector/devtools_session.cc +++ b/third_party/blink/renderer/core/inspector/devtools_session.cc
@@ -20,7 +20,7 @@ #include "third_party/blink/renderer/core/inspector/protocol/protocol.h" #include "third_party/blink/renderer/core/inspector/v8_inspector_string.h" #include "third_party/blink/renderer/core/probe/core_probes.h" -#include "third_party/blink/renderer/platform/heap/cross_thread_persistent.h" +#include "third_party/blink/renderer/platform/heap/cross_thread_handle.h" #include "third_party/blink/renderer/platform/instrumentation/use_counter.h" #include "third_party/blink/renderer/platform/scheduler/public/post_cross_thread_task.h" #include "third_party/blink/renderer/platform/web_test_support.h" @@ -56,7 +56,7 @@ public: IOSession(scoped_refptr<base::SingleThreadTaskRunner> io_task_runner, scoped_refptr<InspectorTaskRunner> inspector_task_runner, - CrossThreadWeakPersistent<::blink::DevToolsSession> session, + CrossThreadWeakHandle<::blink::DevToolsSession> session, mojo::PendingReceiver<mojom::blink::DevToolsSession> receiver) : io_task_runner_(io_task_runner), inspector_task_runner_(inspector_task_runner), @@ -82,9 +82,10 @@ // an instrumentation pause. receiver_.set_disconnect_handler(WTF::BindOnce( [](scoped_refptr<InspectorTaskRunner> inspector_task_runner, - CrossThreadWeakPersistent<::blink::DevToolsSession> session) { + CrossThreadWeakHandle<::blink::DevToolsSession> session) { inspector_task_runner->AppendTask(CrossThreadBindOnce( - &::blink::DevToolsSession::DetachFromV8, session)); + &::blink::DevToolsSession::DetachFromV8, + MakeUnwrappingCrossThreadWeakHandle(session))); }, inspector_task_runner_, session_)); } @@ -109,19 +110,21 @@ base::checked_cast<wtf_size_t>(message.size())); if (ShouldInterruptForMethod(method)) { inspector_task_runner_->AppendTask(CrossThreadBindOnce( - &::blink::DevToolsSession::DispatchProtocolCommandImpl, session_, - call_id, method, std::move(message_copy))); + &::blink::DevToolsSession::DispatchProtocolCommandImpl, + MakeUnwrappingCrossThreadWeakHandle(session_), call_id, method, + std::move(message_copy))); } else { inspector_task_runner_->AppendTaskDontInterrupt(CrossThreadBindOnce( - &::blink::DevToolsSession::DispatchProtocolCommandImpl, session_, - call_id, method, std::move(message_copy))); + &::blink::DevToolsSession::DispatchProtocolCommandImpl, + MakeUnwrappingCrossThreadWeakHandle(session_), call_id, method, + std::move(message_copy))); } } private: scoped_refptr<base::SingleThreadTaskRunner> io_task_runner_; scoped_refptr<InspectorTaskRunner> inspector_task_runner_; - CrossThreadWeakPersistent<::blink::DevToolsSession> session_; + CrossThreadWeakHandle<::blink::DevToolsSession> session_; mojo::Receiver<mojom::blink::DevToolsSession> receiver_{this}; }; @@ -149,9 +152,9 @@ session_waits_for_debugger_(session_waits_for_debugger) { receiver_.Bind(std::move(main_receiver), mojo_task_runner); - io_session_ = new IOSession( - agent_->io_task_runner_, agent_->inspector_task_runner_, - WrapCrossThreadWeakPersistent(this), std::move(io_receiver)); + io_session_ = + new IOSession(agent_->io_task_runner_, agent_->inspector_task_runner_, + MakeCrossThreadWeakHandle(this), std::move(io_receiver)); host_remote_.Bind(std::move(host_remote), mojo_task_runner); host_remote_.set_disconnect_handler( @@ -243,7 +246,7 @@ // and get posted to main thread to this method. // // At the same time, Session may not be garbage collected yet - // (even though already detached), and CrossThreadWeakPersistent<Session> + // (even though already detached), and CrossThreadWeakHandle<Session> // will still be valid. // // Both these factors combined may lead to this method being called after
diff --git a/third_party/blink/renderer/core/inspector/inspector_page_agent.cc b/third_party/blink/renderer/core/inspector/inspector_page_agent.cc index 69dc84c..3954531e 100644 --- a/third_party/blink/renderer/core/inspector/inspector_page_agent.cc +++ b/third_party/blink/renderer/core/inspector/inspector_page_agent.cc
@@ -144,6 +144,8 @@ return DispositionEnum::NewWindow; case kNavigationPolicyPictureInPicture: return DispositionEnum::NewWindow; + case kNavigationPolicyLinkPreview: + NOTREACHED_NORETURN(); } return DispositionEnum::CurrentTab; } @@ -1121,6 +1123,11 @@ const KURL& url, ClientNavigationReason reason, NavigationPolicy policy) { + // TODO(b:303396822): Support Link Preview + if (policy == kNavigationPolicyLinkPreview) { + return; + } + GetFrontend()->frameRequestedNavigation( IdentifiersFactory::FrameId(target_frame), ClientNavigationReasonToProtocol(reason), url.GetString(),
diff --git a/third_party/blink/renderer/core/loader/form_submission.cc b/third_party/blink/renderer/core/loader/form_submission.cc index 1c6c5c8..193df03 100644 --- a/third_party/blink/renderer/core/loader/form_submission.cc +++ b/third_party/blink/renderer/core/loader/form_submission.cc
@@ -322,7 +322,11 @@ FrameLoadRequest frame_request(form->GetDocument().domWindow(), *resource_request); - frame_request.SetNavigationPolicy(NavigationPolicyFromEvent(event)); + NavigationPolicy navigation_policy = NavigationPolicyFromEvent(event); + if (navigation_policy == kNavigationPolicyLinkPreview) { + return nullptr; + } + frame_request.SetNavigationPolicy(navigation_policy); frame_request.SetClientRedirectReason(reason); if (submit_button) { frame_request.SetSourceElement(submit_button);
diff --git a/third_party/blink/renderer/core/loader/form_submission.h b/third_party/blink/renderer/core/loader/form_submission.h index bebb9f9..f5e9df8 100644 --- a/third_party/blink/renderer/core/loader/form_submission.h +++ b/third_party/blink/renderer/core/loader/form_submission.h
@@ -100,6 +100,11 @@ String accept_charset_; }; + // Create FormSubmission + // + // This returns nullptr if form submission is not allowed for the given + // arguments. For example, if navigation policy for the event is + // `kNavigationPolicyLinkPreview`. static FormSubmission* Create(HTMLFormElement*, const Attributes&, const Event*,
diff --git a/third_party/blink/renderer/core/loader/navigation_policy.cc b/third_party/blink/renderer/core/loader/navigation_policy.cc index 7248447..01e86be 100644 --- a/third_party/blink/renderer/core/loader/navigation_policy.cc +++ b/third_party/blink/renderer/core/loader/navigation_policy.cc
@@ -31,6 +31,7 @@ #include "third_party/blink/renderer/core/loader/navigation_policy.h" #include "build/build_config.h" +#include "third_party/blink/public/common/features.h" #include "third_party/blink/public/common/input/web_keyboard_event.h" #include "third_party/blink/public/common/input/web_mouse_event.h" #include "third_party/blink/public/web/web_navigation_policy.h" @@ -47,49 +48,56 @@ namespace { -NavigationPolicy NavigationPolicyFromEventModifiers(int16_t button, - bool ctrl, - bool shift, - bool alt, - bool meta) { +NavigationPolicy NavigationPolicyFromEventModifiers( + int16_t button, + bool ctrl, + bool shift, + bool alt, + bool meta, + bool is_link_preview_enabled) { #if BUILDFLAG(IS_MAC) const bool new_tab_modifier = (button == 1) || meta; #else const bool new_tab_modifier = (button == 1) || ctrl; #endif - if (!new_tab_modifier && !shift && !alt) + if (!new_tab_modifier && !shift && !alt) { return kNavigationPolicyCurrentTab; - - if (new_tab_modifier) { + } else if (is_link_preview_enabled && !new_tab_modifier && !shift && alt) { + return kNavigationPolicyLinkPreview; + } else if (new_tab_modifier) { return shift ? kNavigationPolicyNewForegroundTab : kNavigationPolicyNewBackgroundTab; } return shift ? kNavigationPolicyNewWindow : kNavigationPolicyDownload; } -NavigationPolicy NavigationPolicyFromEventInternal(const Event* event) { +NavigationPolicy NavigationPolicyFromEventInternal( + const Event* event, + bool is_link_preview_enabled) { if (!event) return kNavigationPolicyCurrentTab; if (const auto* mouse_event = DynamicTo<MouseEvent>(event)) { return NavigationPolicyFromEventModifiers( mouse_event->button(), mouse_event->ctrlKey(), mouse_event->shiftKey(), - mouse_event->altKey(), mouse_event->metaKey()); + mouse_event->altKey(), mouse_event->metaKey(), is_link_preview_enabled); } else if (const KeyboardEvent* key_event = DynamicTo<KeyboardEvent>(event)) { // The click is simulated when triggering the keypress event. return NavigationPolicyFromEventModifiers( 0, key_event->ctrlKey(), key_event->shiftKey(), key_event->altKey(), - key_event->metaKey()); + key_event->metaKey(), is_link_preview_enabled); } else if (const auto* gesture_event = DynamicTo<GestureEvent>(event)) { // The click is simulated when triggering the gesture-tap event return NavigationPolicyFromEventModifiers( 0, gesture_event->ctrlKey(), gesture_event->shiftKey(), - gesture_event->altKey(), gesture_event->metaKey()); + gesture_event->altKey(), gesture_event->metaKey(), + is_link_preview_enabled); } return kNavigationPolicyCurrentTab; } -NavigationPolicy NavigationPolicyFromCurrentEvent() { +NavigationPolicy NavigationPolicyFromCurrentEvent( + bool is_link_preview_enabled) { const WebInputEvent* event = CurrentInputEvent::Get(); if (!event) return kNavigationPolicyCurrentTab; @@ -125,14 +133,20 @@ button, event->GetModifiers() & WebInputEvent::kControlKey, event->GetModifiers() & WebInputEvent::kShiftKey, event->GetModifiers() & WebInputEvent::kAltKey, - event->GetModifiers() & WebInputEvent::kMetaKey); + event->GetModifiers() & WebInputEvent::kMetaKey, is_link_preview_enabled); } } // namespace NavigationPolicy NavigationPolicyFromEvent(const Event* event) { - NavigationPolicy event_policy = NavigationPolicyFromEventInternal(event); - NavigationPolicy input_policy = NavigationPolicyFromCurrentEvent(); + // TODO(b:298160400): Add a setting to disable Link Preview. + bool is_link_preview_enabled = + base::FeatureList::IsEnabled(features::kLinkPreview); + + NavigationPolicy event_policy = + NavigationPolicyFromEventInternal(event, is_link_preview_enabled); + NavigationPolicy input_policy = + NavigationPolicyFromCurrentEvent(is_link_preview_enabled); if (event_policy == kNavigationPolicyDownload && input_policy != kNavigationPolicyDownload) { @@ -140,6 +154,12 @@ return kNavigationPolicyCurrentTab; } + if (event_policy == kNavigationPolicyLinkPreview && + input_policy != kNavigationPolicyLinkPreview) { + // No Link Preview from synthesized events without user intention. + return kNavigationPolicyCurrentTab; + } + if (event_policy == kNavigationPolicyNewBackgroundTab && input_policy != kNavigationPolicyNewBackgroundTab && !UIEventWithKeyState::NewTabModifierSetFromIsolatedWorld()) { @@ -159,7 +179,8 @@ bool as_popup = features.is_popup || !features.resizable; NavigationPolicy app_policy = as_popup ? kNavigationPolicyNewPopup : kNavigationPolicyNewForegroundTab; - NavigationPolicy user_policy = NavigationPolicyFromCurrentEvent(); + NavigationPolicy user_policy = + NavigationPolicyFromCurrentEvent(/*is_link_preview_enabled=*/false); if (user_policy == kNavigationPolicyNewWindow && app_policy == kNavigationPolicyNewPopup) {
diff --git a/third_party/blink/renderer/core/loader/navigation_policy.h b/third_party/blink/renderer/core/loader/navigation_policy.h index 56dc9dbd..536db46 100644 --- a/third_party/blink/renderer/core/loader/navigation_policy.h +++ b/third_party/blink/renderer/core/loader/navigation_policy.h
@@ -46,6 +46,7 @@ kNavigationPolicyNewWindow, kNavigationPolicyNewPopup, kNavigationPolicyPictureInPicture, + kNavigationPolicyLinkPreview, }; // Returns a NavigationPolicy to use for starting a navigation
diff --git a/third_party/blink/renderer/core/loader/navigation_policy_test.cc b/third_party/blink/renderer/core/loader/navigation_policy_test.cc index 55589425..ffff6dbc 100644 --- a/third_party/blink/renderer/core/loader/navigation_policy_test.cc +++ b/third_party/blink/renderer/core/loader/navigation_policy_test.cc
@@ -31,8 +31,10 @@ #include "third_party/blink/renderer/core/loader/navigation_policy.h" #include "base/auto_reset.h" +#include "base/test/scoped_feature_list.h" #include "build/build_config.h" #include "testing/gtest/include/gtest/gtest.h" +#include "third_party/blink/public/common/features.h" #include "third_party/blink/public/common/input/web_input_event.h" #include "third_party/blink/public/common/input/web_mouse_event.h" #include "third_party/blink/public/web/web_window_features.h" @@ -45,6 +47,11 @@ class NavigationPolicyTest : public testing::Test { protected: + void SetUp() override { + // Default + scoped_feature_list_.InitAndDisableFeature(features::kLinkPreview); + } + NavigationPolicy GetPolicyForCreateWindow(int modifiers, WebMouseEvent::Button button, bool as_popup) { @@ -91,6 +98,14 @@ } WebWindowFeatures features; + base::test::ScopedFeatureList scoped_feature_list_; +}; + +class NavigationPolicyWithLinkPreviewEnabledTest : public NavigationPolicyTest { + protected: + void SetUp() override { + scoped_feature_list_.InitAndEnableFeature(features::kLinkPreview); + } }; TEST_F(NavigationPolicyTest, LeftClick) { @@ -421,4 +436,18 @@ GetPolicyFromEvent(modifiers, button, 0, button)); } +TEST_F(NavigationPolicyWithLinkPreviewEnabledTest, EventAltClick) { + int modifiers = WebInputEvent::kAltKey; + WebMouseEvent::Button button = WebMouseEvent::Button::kLeft; + EXPECT_EQ(kNavigationPolicyCurrentTab, + NavigationPolicyFromEvent(GetEvent(modifiers, button))); +} + +TEST_F(NavigationPolicyWithLinkPreviewEnabledTest, EventAltClickWithUserEvent) { + int modifiers = WebInputEvent::kAltKey; + WebMouseEvent::Button button = WebMouseEvent::Button::kLeft; + EXPECT_EQ(kNavigationPolicyLinkPreview, + GetPolicyFromEvent(modifiers, button, modifiers, button)); +} + } // namespace blink
diff --git a/third_party/blink/renderer/core/paint/ng/ng_highlight_painter.cc b/third_party/blink/renderer/core/paint/ng/ng_highlight_painter.cc index 0ed8ded..053cc22 100644 --- a/third_party/blink/renderer/core/paint/ng/ng_highlight_painter.cc +++ b/third_party/blink/renderer/core/paint/ng/ng_highlight_painter.cc
@@ -458,12 +458,11 @@ void NGHighlightPainter::SelectionPaintState::PaintSelectedText( NGTextPainter& text_painter, const NGTextFragmentPaintInfo& fragment_paint_info, - unsigned length, const TextPaintStyle& text_style, DOMNodeId node_id, const AutoDarkMode& auto_dark_mode) { text_painter.PaintSelectedText(fragment_paint_info, selection_status_.start, - selection_status_.end, length, text_style, + selection_status_.end, text_style, selection_style_, LineRelativeSelectionRect(), node_id, auto_dark_mode); } @@ -474,27 +473,26 @@ PaintSuppressingTextProperWhereSelected( NGTextPainter& text_painter, const NGTextFragmentPaintInfo& fragment_paint_info, - unsigned length, const TextPaintStyle& text_style, DOMNodeId node_id, const AutoDarkMode& auto_dark_mode) { // First paint the shadows for the whole range. if (text_style.shadow) { - text_painter.Paint(fragment_paint_info, length, text_style, node_id, - auto_dark_mode, NGTextPainter::kShadowsOnly); + text_painter.Paint(fragment_paint_info, text_style, node_id, auto_dark_mode, + NGTextPainter::kShadowsOnly); } // Then paint the text proper for any unselected parts in storage order, so // that they’re always on top of the shadows. if (fragment_paint_info.from < selection_status_.start) { text_painter.Paint( - fragment_paint_info.WithEndOffset(selection_status_.start), length, - text_style, node_id, auto_dark_mode, NGTextPainter::kTextProperOnly); + fragment_paint_info.WithEndOffset(selection_status_.start), text_style, + node_id, auto_dark_mode, NGTextPainter::kTextProperOnly); } if (selection_status_.end < fragment_paint_info.to) { text_painter.Paint( - fragment_paint_info.WithStartOffset(selection_status_.end), length, - text_style, node_id, auto_dark_mode, NGTextPainter::kTextProperOnly); + fragment_paint_info.WithStartOffset(selection_status_.end), text_style, + node_id, auto_dark_mode, NGTextPainter::kTextProperOnly); } } @@ -662,8 +660,7 @@ } text_painter_.Paint( fragment_paint_info_.Slice(paint_start_offset, paint_end_offset), - paint_end_offset - paint_start_offset, text_style, - kInvalidDOMNodeId, foreground_auto_dark_mode_); + text_style, kInvalidDOMNodeId, foreground_auto_dark_mode_); } break; case DocumentMarker::kComposition: @@ -903,9 +900,8 @@ // First paint the shadows for the whole range. if (text_style.shadow) { - text_painter_.Paint(fragment_paint_info_, - fragment_paint_info_.to - fragment_paint_info_.from, - text_style, node_id, foreground_auto_dark_mode_, + text_painter_.Paint(fragment_paint_info_, text_style, node_id, + foreground_auto_dark_mode_, NGTextPainter::kShadowsOnly); } @@ -917,9 +913,8 @@ PaintDecorationsExceptLineThrough(part); text_painter_.Paint( - fragment_paint_info_.Slice(part.range.from, part.range.to), - part.range.to - part.range.from, text_style, node_id, - foreground_auto_dark_mode_, NGTextPainter::kTextProperOnly); + fragment_paint_info_.Slice(part.range.from, part.range.to), text_style, + node_id, foreground_auto_dark_mode_, NGTextPainter::kTextProperOnly); PaintDecorationsOnlyLineThrough(part); PaintSpellingGrammarDecorations(part); } @@ -981,7 +976,7 @@ if (layer.text_style.shadow) { text_painter_.Paint( fragment_paint_info_.Slice(paint_start_offset, paint_end_offset), - length, layer.text_style, node_id, foreground_auto_dark_mode_, + layer.text_style, node_id, foreground_auto_dark_mode_, TextPainterBase::kShadowsOnly); } } @@ -1013,8 +1008,8 @@ PaintDecorationsExceptLineThrough(part); text_painter_.Paint( fragment_paint_info_.Slice(part.range.from, part.range.to), - part.range.to - part.range.from, layer.text_style, node_id, - foreground_auto_dark_mode_, TextPainterBase::kTextProperOnly); + layer.text_style, node_id, foreground_auto_dark_mode_, + TextPainterBase::kTextProperOnly); PaintDecorationsOnlyLineThrough(part); PaintSpellingGrammarDecorations(part); } @@ -1029,9 +1024,9 @@ PaintDecorationsExceptLineThrough(part); } - selection_->PaintSelectedText( - text_painter_, fragment_paint_info_, fragment_paint_info_.Length(), - originating_text_style, node_id, foreground_auto_dark_mode_); + selection_->PaintSelectedText(text_painter_, fragment_paint_info_, + originating_text_style, node_id, + foreground_auto_dark_mode_); for (const HighlightPart& part : parts_) { if (part.layer.type == HighlightLayerType::kSelection) { @@ -1350,8 +1345,7 @@ text_painter_.Paint( fragment_paint_info_.Slice(paint_start_offset, paint_end_offset), - paint_end_offset - paint_start_offset, text_style, kInvalidDOMNodeId, - foreground_auto_dark_mode_); + text_style, kInvalidDOMNodeId, foreground_auto_dark_mode_); decoration_painter.PaintOnlyLineThrough(); }
diff --git a/third_party/blink/renderer/core/paint/ng/ng_highlight_painter.h b/third_party/blink/renderer/core/paint/ng/ng_highlight_painter.h index 8b48199..54fa867 100644 --- a/third_party/blink/renderer/core/paint/ng/ng_highlight_painter.h +++ b/third_party/blink/renderer/core/paint/ng/ng_highlight_painter.h
@@ -91,7 +91,6 @@ void PaintSelectedText(NGTextPainter& text_painter, const NGTextFragmentPaintInfo&, - unsigned length, const TextPaintStyle& text_style, DOMNodeId node_id, const AutoDarkMode& auto_dark_mode); @@ -99,7 +98,6 @@ void PaintSuppressingTextProperWhereSelected( NGTextPainter& text_painter, const NGTextFragmentPaintInfo&, - unsigned length, const TextPaintStyle& text_style, DOMNodeId node_id, const AutoDarkMode& auto_dark_mode);
diff --git a/third_party/blink/renderer/core/paint/ng/ng_text_fragment_painter.cc b/third_party/blink/renderer/core/paint/ng/ng_text_fragment_painter.cc index 381b5f3..5d0fedd 100644 --- a/third_party/blink/renderer/core/paint/ng/ng_text_fragment_painter.cc +++ b/third_party/blink/renderer/core/paint/ng/ng_text_fragment_painter.cc
@@ -509,22 +509,22 @@ // Fast path: just paint the text, including its decorations. decoration_painter.Begin(NGTextDecorationPainter::kOriginating); decoration_painter.PaintExceptLineThrough(fragment_paint_info); - text_painter.Paint(fragment_paint_info, fragment_paint_info.Length(), - text_style, node_id, auto_dark_mode); + text_painter.Paint(fragment_paint_info, text_style, node_id, + auto_dark_mode); decoration_painter.PaintOnlyLineThrough(); break; case NGHighlightPainter::kFastSpellingGrammar: decoration_painter.Begin(NGTextDecorationPainter::kOriginating); decoration_painter.PaintExceptLineThrough(fragment_paint_info); - text_painter.Paint(fragment_paint_info, fragment_paint_info.Length(), - text_style, node_id, auto_dark_mode); + text_painter.Paint(fragment_paint_info, text_style, node_id, + auto_dark_mode); decoration_painter.PaintOnlyLineThrough(); highlight_painter.FastPaintSpellingGrammarDecorations(); break; case NGHighlightPainter::kFastSelection: highlight_painter.Selection()->PaintSuppressingTextProperWhereSelected( - text_painter, fragment_paint_info, fragment_paint_info.Length(), - text_style, node_id, auto_dark_mode); + text_painter, fragment_paint_info, text_style, node_id, + auto_dark_mode); break; case NGHighlightPainter::kOverlay: // Slow path: paint suppressing text proper where highlighted, then @@ -538,8 +538,8 @@ decoration_painter.Begin(NGTextDecorationPainter::kOriginating); decoration_painter.PaintExceptLineThrough(fragment_paint_info); highlight_painter.Selection()->PaintSuppressingTextProperWhereSelected( - text_painter, fragment_paint_info, fragment_paint_info.Length(), - text_style, node_id, auto_dark_mode); + text_painter, fragment_paint_info, text_style, node_id, + auto_dark_mode); decoration_painter.PaintOnlyLineThrough(); break; case NGHighlightPainter::kSelectionOnly: @@ -567,16 +567,16 @@ switch (highlight_case) { case NGHighlightPainter::kFastSelection: highlight_painter.Selection()->PaintSelectedText( - text_painter, fragment_paint_info, fragment_paint_info.Length(), - text_style, node_id, auto_dark_mode); + text_painter, fragment_paint_info, text_style, node_id, + auto_dark_mode); break; case NGHighlightPainter::kSelectionOnly: case NGHighlightPainter::kOldSelection: decoration_painter.Begin(NGTextDecorationPainter::kSelection); decoration_painter.PaintExceptLineThrough(fragment_paint_info); highlight_painter.Selection()->PaintSelectedText( - text_painter, fragment_paint_info, fragment_paint_info.Length(), - text_style, node_id, auto_dark_mode); + text_painter, fragment_paint_info, text_style, node_id, + auto_dark_mode); decoration_painter.PaintOnlyLineThrough(); break; case NGHighlightPainter::kOverlay:
diff --git a/third_party/blink/renderer/core/paint/ng/ng_text_painter.cc b/third_party/blink/renderer/core/paint/ng/ng_text_painter.cc index afe4540..5252c54 100644 --- a/third_party/blink/renderer/core/paint/ng/ng_text_painter.cc +++ b/third_party/blink/renderer/core/paint/ng/ng_text_painter.cc
@@ -175,23 +175,26 @@ } // namespace void NGTextPainter::Paint(const NGTextFragmentPaintInfo& fragment_paint_info, - unsigned length, const TextPaintStyle& text_style, DOMNodeId node_id, const AutoDarkMode& auto_dark_mode, ShadowMode shadow_mode) { + // TODO(layout-dev): We shouldn't be creating text fragments without text. + if (!fragment_paint_info.shape_result) { + return; + } GraphicsContextStateSaver state_saver(graphics_context_, false); UpdateGraphicsContext(graphics_context_, text_style, state_saver, shadow_mode); // TODO(layout-dev): Handle combine text here or elsewhere. - PaintInternal<kPaintText>(fragment_paint_info, length, node_id, - auto_dark_mode); + PaintInternalFragment<kPaintText>(fragment_paint_info, node_id, + auto_dark_mode); if (!emphasis_mark_.empty()) { if (text_style.emphasis_mark_color != text_style.fill_color) graphics_context_.SetFillColor(text_style.emphasis_mark_color); - PaintInternal<kPaintEmphasisMark>(fragment_paint_info, length, node_id, - auto_dark_mode); + PaintInternalFragment<kPaintEmphasisMark>(fragment_paint_info, node_id, + auto_dark_mode); } } @@ -203,7 +206,6 @@ const NGTextFragmentPaintInfo& fragment_paint_info, unsigned selection_start, unsigned selection_end, - unsigned length, const TextPaintStyle& text_style, const TextPaintStyle& selection_style, const LineRelativeRect& selection_rect, @@ -229,7 +231,7 @@ absl::optional<base::AutoReset<bool>> is_painting_selection_reset; if (NGTextPainter::SvgTextPaintState* state = GetSvgState()) is_painting_selection_reset.emplace(&state->is_painting_selection_, true); - Paint(fragment_paint_info.Slice(selection_start, selection_end), length, + Paint(fragment_paint_info.Slice(selection_start, selection_end), selection_style, node_id, auto_dark_mode); return; } @@ -247,8 +249,8 @@ { GraphicsContextStateSaver state_saver(graphics_context_); graphics_context_.ClipOut(float_selection_rect); - Paint(fragment_paint_info.Slice(selection_start, selection_end), length, - text_style, node_id, auto_dark_mode, kTextProperOnly); + Paint(fragment_paint_info.Slice(selection_start, selection_end), text_style, + node_id, auto_dark_mode, kTextProperOnly); } // Then draw the glyphs inside the selection area, with the selection style. { @@ -257,7 +259,7 @@ is_painting_selection_reset.emplace(&state->is_painting_selection_, true); GraphicsContextStateSaver state_saver(graphics_context_); graphics_context_.Clip(float_selection_rect); - Paint(fragment_paint_info.Slice(selection_start, selection_end), length, + Paint(fragment_paint_info.Slice(selection_start, selection_end), selection_style, node_id, auto_dark_mode); } } @@ -357,30 +359,6 @@ } } -template <NGTextPainter::PaintInternalStep Step> -void NGTextPainter::PaintInternal( - const NGTextFragmentPaintInfo& fragment_paint_info, - unsigned truncation_point, - DOMNodeId node_id, - const AutoDarkMode& auto_dark_mode) { - // TODO(layout-dev): We shouldn't be creating text fragments without text. - if (!fragment_paint_info.shape_result) - return; - - if (fragment_paint_info.from <= fragment_paint_info.to) { - PaintInternalFragment<Step>(fragment_paint_info, node_id, auto_dark_mode); - } else { - if (fragment_paint_info.to > 0) { - PaintInternalFragment<Step>(fragment_paint_info, node_id, auto_dark_mode); - } - if (fragment_paint_info.from < truncation_point) { - PaintInternalFragment<Step>( - fragment_paint_info.WithEndOffset(truncation_point), node_id, - auto_dark_mode); - } - } -} - void NGTextPainter::ClipDecorationsStripe( const NGTextFragmentPaintInfo& fragment_paint_info, float upper,
diff --git a/third_party/blink/renderer/core/paint/ng/ng_text_painter.h b/third_party/blink/renderer/core/paint/ng/ng_text_painter.h index f20927f..c7b066a 100644 --- a/third_party/blink/renderer/core/paint/ng/ng_text_painter.h +++ b/third_party/blink/renderer/core/paint/ng/ng_text_painter.h
@@ -84,7 +84,6 @@ ~NGTextPainter() = default; void Paint(const NGTextFragmentPaintInfo& fragment_paint_info, - unsigned truncation_point, const TextPaintStyle&, DOMNodeId, const AutoDarkMode& auto_dark_mode, @@ -93,7 +92,6 @@ void PaintSelectedText(const NGTextFragmentPaintInfo& fragment_paint_info, unsigned selection_start, unsigned selection_end, - unsigned truncation_point, const TextPaintStyle& text_style, const TextPaintStyle& selection_style, const LineRelativeRect& selection_rect, @@ -136,12 +134,6 @@ DOMNodeId node_id, const AutoDarkMode& auto_dark_mode); - template <PaintInternalStep step> - void PaintInternal(const NGTextFragmentPaintInfo&, - unsigned truncation_point, - DOMNodeId node_id, - const AutoDarkMode& auto_dark_mode); - void PaintSvgTextFragment(const NGTextFragmentPaintInfo&, DOMNodeId node_id, const AutoDarkMode& auto_dark_mode);
diff --git a/third_party/blink/renderer/core/streams/readable_stream_byob_reader.cc b/third_party/blink/renderer/core/streams/readable_stream_byob_reader.cc index 9f39f720..b64bb2b 100644 --- a/third_party/blink/renderer/core/streams/readable_stream_byob_reader.cc +++ b/third_party/blink/renderer/core/streams/readable_stream_byob_reader.cc
@@ -130,7 +130,8 @@ } // 5. Let promise be a new promise. - auto* promise = MakeGarbageCollected<StreamPromiseResolver>(script_state); + auto* promise = MakeGarbageCollected<StreamPromiseResolver>(script_state, + exception_state); // 6. Let readIntoRequest be a new read-into request with the following items: // chunk steps, given chunk
diff --git a/third_party/blink/renderer/core/streams/readable_stream_default_reader.cc b/third_party/blink/renderer/core/streams/readable_stream_default_reader.cc index b6678377..bfec8a79 100644 --- a/third_party/blink/renderer/core/streams/readable_stream_default_reader.cc +++ b/third_party/blink/renderer/core/streams/readable_stream_default_reader.cc
@@ -99,7 +99,8 @@ } // 2. Let promise be a new promise. - auto* promise = MakeGarbageCollected<StreamPromiseResolver>(script_state); + auto* promise = MakeGarbageCollected<StreamPromiseResolver>(script_state, + exception_state); // 3. Let readRequest be a new read request with the following items: // chunk steps, given chunk
diff --git a/third_party/blink/renderer/core/streams/stream_promise_resolver.cc b/third_party/blink/renderer/core/streams/stream_promise_resolver.cc index 61600556..3686680 100644 --- a/third_party/blink/renderer/core/streams/stream_promise_resolver.cc +++ b/third_party/blink/renderer/core/streams/stream_promise_resolver.cc
@@ -7,6 +7,8 @@ #include "third_party/blink/renderer/bindings/core/v8/script_promise.h" #include "third_party/blink/renderer/bindings/core/v8/script_value.h" #include "third_party/blink/renderer/bindings/core/v8/v8_binding_for_core.h" +#include "third_party/blink/renderer/core/core_probes_inl.h" +#include "third_party/blink/renderer/platform/bindings/exception_state.h" #include "third_party/blink/renderer/platform/heap/garbage_collected.h" namespace blink { @@ -50,6 +52,15 @@ } } +StreamPromiseResolver::StreamPromiseResolver( + ScriptState* script_state, + const ExceptionState& exception_state) + : StreamPromiseResolver(script_state) { + class_like_name_ = exception_state.GetContext().GetClassName(); + property_like_name_ = exception_state.GetContext().GetPropertyName(); + script_url_ = GetCurrentScriptUrl(script_state->GetIsolate()); +} + void StreamPromiseResolver::Resolve(ScriptState* script_state, v8::Local<v8::Value> value) { if (resolver_.IsEmpty()) { @@ -58,6 +69,13 @@ if (is_settled_) { return; } + + probe::WillHandlePromise( + ToExecutionContext(script_state), script_state, + /*resolving=*/true, class_like_name_, + property_like_name_.IsNull() ? String("resolve") : property_like_name_, + script_url_); + is_settled_ = true; v8::Isolate* isolate = script_state->GetIsolate(); v8::MicrotasksScope microtasks_scope( @@ -82,6 +100,14 @@ if (is_settled_) { return; } + + // TODO(crbug.com/1491706): this is speculative, unclear in which scenarios + // this would be invoked. + probe::WillHandlePromise( + ToExecutionContext(script_state), script_state, + /*resolving=*/false, class_like_name_, + property_like_name_.IsNull() ? String("reject") : property_like_name_, + script_url_); is_settled_ = true; v8::Isolate* isolate = script_state->GetIsolate(); v8::MicrotasksScope microtasks_scope(
diff --git a/third_party/blink/renderer/core/streams/stream_promise_resolver.h b/third_party/blink/renderer/core/streams/stream_promise_resolver.h index 5c42620..e825f4c3 100644 --- a/third_party/blink/renderer/core/streams/stream_promise_resolver.h +++ b/third_party/blink/renderer/core/streams/stream_promise_resolver.h
@@ -6,6 +6,7 @@ #define THIRD_PARTY_BLINK_RENDERER_CORE_STREAMS_STREAM_PROMISE_RESOLVER_H_ #include "third_party/blink/renderer/core/core_export.h" +#include "third_party/blink/renderer/platform/bindings/exception_state.h" #include "third_party/blink/renderer/platform/bindings/trace_wrapper_v8_reference.h" #include "third_party/blink/renderer/platform/heap/garbage_collected.h" #include "third_party/blink/renderer/platform/heap/visitor.h" @@ -54,6 +55,9 @@ // Creates an initialised promise. explicit StreamPromiseResolver(ScriptState*); + // Creates an initialised promise with exception state, for tracing. + StreamPromiseResolver(ScriptState*, const ExceptionState&); + // Resolves the promise with |value|. Does nothing if the promise is already // settled. void Resolve(ScriptState*, v8::Local<v8::Value> value); @@ -90,6 +94,9 @@ private: TraceWrapperV8Reference<v8::Promise::Resolver> resolver_; bool is_settled_ = false; + const char* class_like_name_ = "StreamPromise"; + String property_like_name_; + String script_url_; }; } // namespace blink
diff --git a/third_party/blink/renderer/core/streams/transform_stream.cc b/third_party/blink/renderer/core/streams/transform_stream.cc index 486d06c..542d793 100644 --- a/third_party/blink/renderer/core/streams/transform_stream.cc +++ b/third_party/blink/renderer/core/streams/transform_stream.cc
@@ -224,8 +224,8 @@ auto* stream = MakeGarbageCollected<TransformStream>(); // 8. Let startPromise be a new promise. - auto* start_promise = - MakeGarbageCollected<StreamPromiseResolver>(script_state); + auto* start_promise = MakeGarbageCollected<StreamPromiseResolver>( + script_state, exception_state); // 9. Perform ! InitializeTransformStream(stream, startPromise, // writableHighWaterMark, writableSizeAlgorithm, readableHighWaterMark, @@ -724,8 +724,8 @@ } // 15. Let startPromise be a new promise. - auto* start_promise = - MakeGarbageCollected<StreamPromiseResolver>(script_state); + auto* start_promise = MakeGarbageCollected<StreamPromiseResolver>( + script_state, exception_state); // 16. Perform ! InitializeTransformStream(this, startPromise, // writableHighWaterMark, writableSizeAlgorithm, readableHighWaterMark, @@ -824,7 +824,8 @@ DCHECK(stream->had_backpressure_); DCHECK(!stream->backpressure_change_promise_); stream->backpressure_change_promise_ = - MakeGarbageCollected<StreamPromiseResolver>(script_state); + MakeGarbageCollected<StreamPromiseResolver>(script_state, + exception_state); // 11. Set stream.[[transformStreamController]] to undefined. // (This is set by the constructor; just verify the value here).
diff --git a/third_party/blink/renderer/core/streams/writable_stream_default_writer.cc b/third_party/blink/renderer/core/streams/writable_stream_default_writer.cc index 9885695c..66a1d12 100644 --- a/third_party/blink/renderer/core/streams/writable_stream_default_writer.cc +++ b/third_party/blink/renderer/core/streams/writable_stream_default_writer.cc
@@ -74,8 +74,8 @@ // a new promise. if (!WritableStream::CloseQueuedOrInFlight(stream) && stream->HasBackpressure()) { - ready_promise_ = - MakeGarbageCollected<StreamPromiseResolver>(script_state); + ready_promise_ = MakeGarbageCollected<StreamPromiseResolver>( + script_state, exception_state); } else { // b. Otherwise, set this.[[readyPromise]] to a promise resolved // with undefined. @@ -83,8 +83,8 @@ StreamPromiseResolver::CreateResolvedWithUndefined(script_state); } // c. Set this.[[closedPromise]] to a new promise. - closed_promise_ = - MakeGarbageCollected<StreamPromiseResolver>(script_state); + closed_promise_ = MakeGarbageCollected<StreamPromiseResolver>( + script_state, exception_state); break; } @@ -99,8 +99,8 @@ ready_promise_->MarkAsHandled(isolate); // c. Set this.[[closedPromise]] to a new promise. - closed_promise_ = - MakeGarbageCollected<StreamPromiseResolver>(script_state); + closed_promise_ = MakeGarbageCollected<StreamPromiseResolver>( + script_state, exception_state); break; }
diff --git a/third_party/blink/renderer/core/svg/svg_a_element.cc b/third_party/blink/renderer/core/svg/svg_a_element.cc index 2ff155f..5e3637f5 100644 --- a/third_party/blink/renderer/core/svg/svg_a_element.cc +++ b/third_party/blink/renderer/core/svg/svg_a_element.cc
@@ -138,7 +138,12 @@ } event.SetDefaultHandled(); - frame_request.SetNavigationPolicy(NavigationPolicyFromEvent(&event)); + NavigationPolicy navigation_policy = NavigationPolicyFromEvent(&event); + if (navigation_policy == kNavigationPolicyLinkPreview) { + // TODO(b:302649777): Support LinkPreview for SVG <a> element. + return; + } + frame_request.SetNavigationPolicy(navigation_policy); frame_request.SetClientRedirectReason( ClientNavigationReason::kAnchorClick); frame_request.SetSourceElement(this);
diff --git a/third_party/blink/renderer/modules/ml/webnn/ml_graph_builder.cc b/third_party/blink/renderer/modules/ml/webnn/ml_graph_builder.cc index 1084f11..6948d56e 100644 --- a/third_party/blink/renderer/modules/ml/webnn/ml_graph_builder.cc +++ b/third_party/blink/renderer/modules/ml/webnn/ml_graph_builder.cc
@@ -1067,6 +1067,7 @@ BUILD_ELEMENTWISE_BINARY_OP(div, kDiv) BUILD_ELEMENTWISE_BINARY_OP(min, kMin) BUILD_ELEMENTWISE_BINARY_OP(max, kMax) +BUILD_ELEMENTWISE_BINARY_OP(pow, kPow) #define BUILD_ELEMENTWISE_UNARY_OP(op, op_kind) \ MLOperand* MLGraphBuilder::op(const MLOperand* input, \
diff --git a/third_party/blink/renderer/modules/ml/webnn/ml_graph_builder.h b/third_party/blink/renderer/modules/ml/webnn/ml_graph_builder.h index a1e425b..03ab7056 100644 --- a/third_party/blink/renderer/modules/ml/webnn/ml_graph_builder.h +++ b/third_party/blink/renderer/modules/ml/webnn/ml_graph_builder.h
@@ -142,6 +142,9 @@ MLOperand* min(const MLOperand* a, const MLOperand* b, ExceptionState& exception_state); + MLOperand* pow(const MLOperand* a, + const MLOperand* b, + ExceptionState& exception_state); // Element-wise unary operations MLOperand* abs(const MLOperand* input, ExceptionState& exception_state);
diff --git a/third_party/blink/renderer/modules/ml/webnn/ml_graph_builder.idl b/third_party/blink/renderer/modules/ml/webnn/ml_graph_builder.idl index 01716b2..7dec87c0 100644 --- a/third_party/blink/renderer/modules/ml/webnn/ml_graph_builder.idl +++ b/third_party/blink/renderer/modules/ml/webnn/ml_graph_builder.idl
@@ -136,6 +136,7 @@ [RaisesException] MLOperand div(MLOperand a, MLOperand b); [RaisesException] MLOperand max(MLOperand a, MLOperand b); [RaisesException] MLOperand min(MLOperand a, MLOperand b); + [RaisesException] MLOperand pow(MLOperand a, MLOperand b); // Element-wise unary operations [RaisesException] MLOperand abs(MLOperand x);
diff --git a/third_party/blink/renderer/modules/ml/webnn/ml_graph_builder_test.cc b/third_party/blink/renderer/modules/ml/webnn/ml_graph_builder_test.cc index ef36a56..b9e78bf 100644 --- a/third_party/blink/renderer/modules/ml/webnn/ml_graph_builder_test.cc +++ b/third_party/blink/renderer/modules/ml/webnn/ml_graph_builder_test.cc
@@ -2825,6 +2825,9 @@ case ElementWiseBinaryKind::kMax: output = builder->max(a, b, scope.GetExceptionState()); break; + case ElementWiseBinaryKind::kPow: + output = builder->pow(a, b, scope.GetExceptionState()); + break; } EXPECT_NE(output, nullptr); EXPECT_EQ(output->Kind(), MLOperand::OperandKind::kOutput); @@ -2850,6 +2853,9 @@ case ElementWiseBinaryKind::kMax: EXPECT_EQ(op->Kind(), MLOperator::OperatorKind::kMax); break; + case ElementWiseBinaryKind::kPow: + EXPECT_EQ(op->Kind(), MLOperator::OperatorKind::kPow); + break; } EXPECT_EQ(op->IsConnected(), true); return output;
diff --git a/third_party/blink/renderer/modules/ml/webnn/ml_graph_builder_test.h b/third_party/blink/renderer/modules/ml/webnn/ml_graph_builder_test.h index 7190aca..19f9bb1 100644 --- a/third_party/blink/renderer/modules/ml/webnn/ml_graph_builder_test.h +++ b/third_party/blink/renderer/modules/ml/webnn/ml_graph_builder_test.h
@@ -59,7 +59,7 @@ const MLOperand* input, const MLLeakyReluOptions* options = MLLeakyReluOptions::Create()); -enum class ElementWiseBinaryKind { kAdd, kSub, kMul, kDiv, kMin, kMax }; +enum class ElementWiseBinaryKind { kAdd, kSub, kMul, kDiv, kMin, kMax, kPow }; MLOperand* BuildElementWiseBinary(V8TestingScope& scope, MLGraphBuilder* builder,
diff --git a/third_party/blink/renderer/modules/ml/webnn/ml_graph_test.cc b/third_party/blink/renderer/modules/ml/webnn/ml_graph_test.cc index 362e531..bf5e360 100644 --- a/third_party/blink/renderer/modules/ml/webnn/ml_graph_test.cc +++ b/third_party/blink/renderer/modules/ml/webnn/ml_graph_test.cc
@@ -202,6 +202,64 @@ } template <typename T> +struct PowTester { + OperandInfo<T> lhs; + OperandInfo<T> rhs; + Vector<T> expected; + + void Test(MLGraphTest& helper, V8TestingScope& scope) { + // Build the graph. + auto* builder = CreateMLGraphBuilder(scope.GetExecutionContext()); + auto* lhs_operand = BuildInput(builder, "lhs", lhs.dimensions, lhs.type, + scope.GetExceptionState()); + auto* rhs_operand = BuildConstant(builder, rhs.dimensions, rhs.type, + rhs.values, scope.GetExceptionState()); + auto* output_operand = BuildElementWiseBinary( + scope, builder, ElementWiseBinaryKind::kPow, lhs_operand, rhs_operand); + auto [graph, build_exception] = + helper.BuildGraph(scope, builder, {{"output", output_operand}}); + EXPECT_NE(graph, nullptr); + + // Compute the graph. + MLNamedArrayBufferViews inputs( + {{"lhs", CreateArrayBufferViewForOperand(lhs_operand, lhs.values)}}); + MLNamedArrayBufferViews outputs( + {{"output", CreateArrayBufferViewForOperand(output_operand)}}); + auto* compute_exception = + helper.ComputeGraph(scope, graph, inputs, outputs); + EXPECT_EQ(compute_exception, nullptr); + auto results = GetArrayBufferViewValues<T>(outputs[0].second); + EXPECT_EQ(results, expected); + } +}; + +TEST_P(MLGraphTest, PowTest) { + V8TestingScope scope; + { + // Test element-wise pow operator with exponent = 2. + PowTester<float>{.lhs = {.type = V8MLOperandType::Enum::kFloat32, + .dimensions = {1, 2, 2, 1}, + .values = {1.0, 2.0, 3.0, 4.0}}, + .rhs = {.type = V8MLOperandType::Enum::kFloat32, + .dimensions = {1}, + .values = {2.0}}, + .expected = {1.0, 4.0, 9.0, 16.0}} + .Test(*this, scope); + } + { + // Test element-wise pow operator with exponent = 0.5. + PowTester<float>{.lhs = {.type = V8MLOperandType::Enum::kFloat32, + .dimensions = {1, 2, 2, 1}, + .values = {1.0, 4.0, 9.0, 16.0}}, + .rhs = {.type = V8MLOperandType::Enum::kFloat32, + .dimensions = {1}, + .values = {0.5}}, + .expected = {1.0, 2.0, 3.0, 4.0}} + .Test(*this, scope); + } +} + +template <typename T> struct ElementWiseUnaryTester { ElementWiseUnaryKind kind; OperandInfo<T> input;
diff --git a/third_party/blink/renderer/modules/ml/webnn/ml_graph_type_converter.cc b/third_party/blink/renderer/modules/ml/webnn/ml_graph_type_converter.cc index 7ac7aec..ea22fe5 100644 --- a/third_party/blink/renderer/modules/ml/webnn/ml_graph_type_converter.cc +++ b/third_party/blink/renderer/modules/ml/webnn/ml_graph_type_converter.cc
@@ -471,6 +471,7 @@ case MLOperator::OperatorKind::kDiv: case MLOperator::OperatorKind::kMin: case MLOperator::OperatorKind::kMax: + case MLOperator::OperatorKind::kPow: return CreateElementWiseBinaryOperator(operand_to_id_map, op); case MLOperator::OperatorKind::kAveragePool2d: case MLOperator::OperatorKind::kMaxPool2d:
diff --git a/third_party/blink/renderer/modules/ml/webnn/ml_graph_xnnpack.cc b/third_party/blink/renderer/modules/ml/webnn/ml_graph_xnnpack.cc index 674209e..caf55cb 100644 --- a/third_party/blink/renderer/modules/ml/webnn/ml_graph_xnnpack.cc +++ b/third_party/blink/renderer/modules/ml/webnn/ml_graph_xnnpack.cc
@@ -986,6 +986,57 @@ xnn_define_minimum2(subgraph, lhs_id, rhs_id, output_id, flags)); break; } + // Currently, XNNPACK doesn't support the generic pow operator. + // The implementation of pow only supports two special cases, + // square and square root, by xnn_define_square and xnn_define_square_root. + // TODO(crbug.com/1273291): Once the sqrt operator is supported by WebNN + // spec, we will map that to XNNPACK square root directly. And there is a + // proposal in WG to support dedicated square root operator - + // https://github.com/webmachinelearning/webnn/issues/438. + case MLOperator::OperatorKind::kPow: { + const auto* operand_a = binary->Inputs()[0].Get(); + CHECK(operand_a); + const auto* operand_b = binary->Inputs()[1].Get(); + CHECK(operand_b); + if (operand_b->Kind() != MLOperand::OperandKind::kConstant) { + error_message = "Operand b should be defined as a constant for pow."; + return xnn_status_unsupported_parameter; + } + // A scalar can be represented by empty dimensions which is still under WG + // discussion. An issue has been filed to track it - + // https://github.com/webmachinelearning/webnn/issues/390. + if (operand_b->Dimensions().size() != 1 || + operand_b->Dimensions()[0] != 1) { + error_message = "Pow only supports scalar operand b."; + return xnn_status_unsupported_parameter; + } + + // Currently, XNNPACK only supports fp32 input type for square and + // square_root operators. + if (operand_a->Type() != V8MLOperandType::Enum::kFloat32) { + error_message = "Pow only supports float32 operands."; + return xnn_status_unsupported_parameter; + } + CHECK_EQ(operand_b->Type(), V8MLOperandType::Enum::kFloat32); + + const auto* array_buffer_view = operand_b->ArrayBufferView(); + CHECK(array_buffer_view); + CHECK(!array_buffer_view->IsDetached()); + CHECK_EQ(array_buffer_view->byteLength(), 4U); + float exp = static_cast<float*>(array_buffer_view->BaseAddress())[0]; + if (fabs(exp - 2.0f) <= std::numeric_limits<float>::epsilon()) { + XNN_CHECK_STATUS_AND_SET_ERROR_MESSAGE( + xnn_define_square(subgraph, lhs_id, output_id, flags)); + } else if (fabs(exp - 0.5f) <= std::numeric_limits<float>::epsilon()) { + XNN_CHECK_STATUS_AND_SET_ERROR_MESSAGE( + xnn_define_square_root(subgraph, lhs_id, output_id, flags)); + } else { + error_message = + "The value of scalar operand b must be 2 or 0.5 for pow."; + return xnn_status_unsupported_parameter; + } + break; + } default: NOTREACHED(); } @@ -1731,7 +1782,8 @@ case MLOperator::OperatorKind::kMul: case MLOperator::OperatorKind::kDiv: case MLOperator::OperatorKind::kMax: - case MLOperator::OperatorKind::kMin: { + case MLOperator::OperatorKind::kMin: + case MLOperator::OperatorKind::kPow: { XNN_CHECK_STATUS(DefineXnnNodeForElementWiseBinary( subgraph, ml_operator, operand_value_id_map, error_message)); break;
diff --git a/third_party/blink/renderer/modules/ml/webnn/ml_graph_xnnpack_test.cc b/third_party/blink/renderer/modules/ml/webnn/ml_graph_xnnpack_test.cc index b9f90cb..b7dbc5b 100644 --- a/third_party/blink/renderer/modules/ml/webnn/ml_graph_xnnpack_test.cc +++ b/third_party/blink/renderer/modules/ml/webnn/ml_graph_xnnpack_test.cc
@@ -316,6 +316,23 @@ } } +// Add an unit test to validate the value of exponent for pow operator. +TEST_P(MLGraphXnnpackTest, PowTest) { + V8TestingScope scope; + auto* builder = CreateMLGraphBuilder(scope.GetExecutionContext()); + auto* input0 = + BuildInput(builder, "input0", {1, 2, 2, 1}, + V8MLOperandType::Enum::kFloat32, scope.GetExceptionState()); + auto* input1 = BuildConstant(builder, {1}, V8MLOperandType::Enum::kFloat32, + Vector<float>({3.0}), scope.GetExceptionState()); + auto* output = BuildElementWiseBinary( + scope, builder, ElementWiseBinaryKind::kPow, input0, input1); + auto [graph, exception] = BuildGraph(scope, builder, {{"output", output}}); + ASSERT_EQ(graph, nullptr); + EXPECT_EQ(exception->message(), + "The value of scalar operand b must be 2 or 0.5 for pow."); +} + TEST_P(MLGraphXnnpackTest, InvokeXnnpackRuntimeTest) { V8TestingScope scope; auto* builder = CreateMLGraphBuilder(scope.GetExecutionContext());
diff --git a/third_party/blink/renderer/modules/ml/webnn/ml_operator.cc b/third_party/blink/renderer/modules/ml/webnn/ml_operator.cc index a82e855..b0b03ef 100644 --- a/third_party/blink/renderer/modules/ml/webnn/ml_operator.cc +++ b/third_party/blink/renderer/modules/ml/webnn/ml_operator.cc
@@ -54,6 +54,8 @@ return "maxPool2d"; case MLOperator::OperatorKind::kPad: return "pad"; + case MLOperator::OperatorKind::kPow: + return "pow"; case MLOperator::OperatorKind::kPRelu: return "prelu"; case MLOperator::OperatorKind::kReduceMean:
diff --git a/third_party/blink/renderer/modules/ml/webnn/ml_operator.h b/third_party/blink/renderer/modules/ml/webnn/ml_operator.h index 053224a..82ae869 100644 --- a/third_party/blink/renderer/modules/ml/webnn/ml_operator.h +++ b/third_party/blink/renderer/modules/ml/webnn/ml_operator.h
@@ -42,6 +42,7 @@ kAveragePool2d, kMaxPool2d, kPad, + kPow, kPRelu, kReduceMean, kReduceSum,
diff --git a/third_party/blink/renderer/platform/fonts/shaping/font_features.h b/third_party/blink/renderer/platform/fonts/shaping/font_features.h index d8f04ecc..1356e22a 100644 --- a/third_party/blink/renderer/platform/fonts/shaping/font_features.h +++ b/third_party/blink/renderer/platform/fonts/shaping/font_features.h
@@ -43,8 +43,13 @@ } void Shrink(wtf_size_t size) { features_.Shrink(size); } + using FeatureArray = Vector<hb_feature_t, 6>; + using const_iterator = FeatureArray::const_iterator; + const_iterator begin() const { return features_.begin(); } + const_iterator end() const { return features_.end(); } + private: - Vector<hb_feature_t, 6> features_; + FeatureArray features_; }; } // namespace blink
diff --git a/third_party/blink/renderer/platform/fonts/shaping/han_kerning.cc b/third_party/blink/renderer/platform/fonts/shaping/han_kerning.cc index 430e5ae..254132b 100644 --- a/third_party/blink/renderer/platform/fonts/shaping/han_kerning.cc +++ b/third_party/blink/renderer/platform/fonts/shaping/han_kerning.cc
@@ -16,6 +16,23 @@ namespace { +HashSet<uint32_t> ExclusiveFeatures() { + // https://learn.microsoft.com/en-us/typography/opentype/spec/features_ae#chws + // https://learn.microsoft.com/en-us/typography/opentype/spec/features_uz#vchw + return HashSet<uint32_t>{ + HB_TAG('h', 'a', 'l', 't'), HB_TAG('h', 'w', 'i', 'd'), + HB_TAG('p', 'a', 'l', 't'), HB_TAG('p', 'w', 'i', 'd'), + HB_TAG('q', 'w', 'i', 'd'), HB_TAG('t', 'w', 'i', 'd'), + HB_TAG('v', 'a', 'l', 't'), HB_TAG('v', 'h', 'a', 'l'), + HB_TAG('v', 'p', 'a', 'l'), + }; +} + +bool IsExclusiveFeature(uint32_t tag) { + DEFINE_STATIC_LOCAL(HashSet<uint32_t>, tags, (ExclusiveFeatures())); + return tags.Contains(tag); +} + // Get `CharType` from the glyph bounding box. HanKerning::CharType GetType(const SkRect& bound, float em, @@ -149,16 +166,21 @@ Options options, FontFeatures* features) { DCHECK(!features_); - if (UNLIKELY(font_description.GetTextSpacingTrim() != - TextSpacingTrim::kSpaceFirst)) { - return; - } const LayoutLocale& locale = font_description.LocaleOrDefault(); const FontData& font_data = font.HanKerningData(locale, options.is_horizontal); if (!font_data.has_alternate_spacing) { return; } + if (UNLIKELY(font_description.GetTextSpacingTrim() != + TextSpacingTrim::kSpaceFirst)) { + return; + } + for (const hb_feature_t& feature : *features) { + if (feature.value && IsExclusiveFeature(feature.tag)) { + return; + } + } // Compute for the first character. Vector<wtf_size_t, 32> indices;
diff --git a/third_party/blink/renderer/platform/runtime_enabled_features.json5 b/third_party/blink/renderer/platform/runtime_enabled_features.json5 index 0a78c942..a836202 100644 --- a/third_party/blink/renderer/platform/runtime_enabled_features.json5 +++ b/third_party/blink/renderer/platform/runtime_enabled_features.json5
@@ -1160,7 +1160,7 @@ { // crbug.com/1463890: CSS `text-autospace` property name: "CSSTextAutoSpace", - // The status is not set yet, as this feature flag changes the default behavior, which affects some web tests. + status: "experimental", }, { // TODO(https://crbug.com/1411581): @@ -1236,7 +1236,7 @@ // Support for registered custom properties with <image> syntax. { name: "CSSVariables2ImageValues", - status: "experimental", + status: "stable", }, // Support for registered custom properties with <transform-list> and // <transform-function> syntax.
diff --git a/third_party/blink/renderer/platform/wtf/text/text_codec_cjk.cc b/third_party/blink/renderer/platform/wtf/text/text_codec_cjk.cc index 131cc4e..defbc8fea 100644 --- a/third_party/blink/renderer/platform/wtf/text/text_codec_cjk.cc +++ b/third_party/blink/renderer/platform/wtf/text/text_codec_cjk.cc
@@ -27,8 +27,10 @@ #include <utility> +#include "base/feature_list.h" #include "base/functional/function_ref.h" #include "base/memory/ptr_util.h" +#include "third_party/blink/public/common/features.h" #include "third_party/blink/renderer/platform/wtf/text/character_names.h" #include "third_party/blink/renderer/platform/wtf/text/encoding_tables.h" #include "third_party/blink/renderer/platform/wtf/text/string_concatenate.h" @@ -411,6 +413,98 @@ return pointer_offset + code_point - offset; } +// https://unicode-org.atlassian.net/browse/ICU-22357 +// TODO(yyanagisawa): rename function names in comment +// The 2-byte values are handled correctly by values from gb18030() +// but these need to be exceptions from gb18030Ranges(). +static std::optional<uint32_t> Gb18030_2022Encode(UChar32 codePoint) { + switch (codePoint) { + case 0xE81E: + return 0x82359037; + case 0xE826: + return 0x82359038; + case 0xE82B: + return 0x82359039; + case 0xE82C: + return 0x82359130; + case 0xE832: + return 0x82359131; + case 0xE843: + return 0x82359132; + case 0xE854: + return 0x82359133; + case 0xE864: + return 0x82359134; + case 0xE78D: + return 0x84318236; + case 0xE78F: + return 0x84318237; + case 0xE78E: + return 0x84318238; + case 0xE790: + return 0x84318239; + case 0xE791: + return 0x84318330; + case 0xE792: + return 0x84318331; + case 0xE793: + return 0x84318332; + case 0xE794: + return 0x84318333; + case 0xE795: + return 0x84318334; + case 0xE796: + return 0x84318335; + } + return std::nullopt; +} +static std::optional<UChar32> Gb18030_2022Decode(uint8_t first, + uint8_t second, + uint8_t third, + uint8_t fourth) { + switch (static_cast<uint32_t>(first) << 24 | + static_cast<uint32_t>(second) << 16 | + static_cast<uint32_t>(third) << 8 | fourth) { + case 0x82359037: + return 0xE81E; + case 0x82359038: + return 0xE826; + case 0x82359039: + return 0xE82B; + case 0x82359130: + return 0xE82C; + case 0x82359131: + return 0xE832; + case 0x82359132: + return 0xE843; + case 0x82359133: + return 0xE854; + case 0x82359134: + return 0xE864; + case 0x84318236: + return 0xE78D; + case 0x84318237: + return 0xE78F; + case 0x84318238: + return 0xE78E; + case 0x84318239: + return 0xE790; + case 0x84318330: + return 0xE791; + case 0x84318331: + return 0xE792; + case 0x84318332: + return 0xE793; + case 0x84318333: + return 0xE794; + case 0x84318334: + return 0xE795; + case 0x84318335: + return 0xE796; + } + return std::nullopt; +} + // https://encoding.spec.whatwg.org/#gb18030-encoder enum class IsGbk : bool { kNo, kYes }; Vector<uint8_t> EncodeGbShared(StringView string, @@ -418,6 +512,8 @@ IsGbk is_gbk) { Vector<uint8_t> result; result.ReserveInitialCapacity(string.length()); + const bool gb18030_2022_enabled = + base::FeatureList::IsEnabled(blink::features::kGb18030_2022Enabled); for (UChar32 code_point : string) { if (IsASCII(code_point)) { @@ -428,9 +524,19 @@ AppendUnencodableReplacement(code_point, handling, result); continue; } - if (is_gbk == IsGbk::kYes && code_point == 0x20AC) { - result.push_back(0x80); - continue; + if (is_gbk == IsGbk::kYes) { + if (code_point == 0x20AC) { + result.push_back(0x80); + continue; + } + } else if (gb18030_2022_enabled) { + if (auto encoded = Gb18030_2022Encode(code_point)) { + result.push_back(*encoded >> 24); + result.push_back(*encoded >> 16); + result.push_back(*encoded >> 8); + result.push_back(*encoded); + continue; + } } auto pointer_range = FindInSortedPairs(EnsureGb18030EncodeIndexForEncode(), code_point); @@ -821,7 +927,10 @@ // Note that the same decoder is used for GB18030 and GBK. class Gb18030Decoder : public TextCodecCJK::Decoder { public: - Gb18030Decoder() = default; + Gb18030Decoder() { + gb18030_2022_enabled_ = + base::FeatureList::IsEnabled(blink::features::kGb18030_2022Enabled); + } String Decode(const uint8_t* bytes, wtf_size_t length, @@ -858,6 +967,12 @@ uint8_t first = std::exchange(first_, 0x00); uint8_t second = std::exchange(second_, 0x00); uint8_t third = std::exchange(third_, 0x00); + if (gb18030_2022_enabled_) { + if (auto codePoint = Gb18030_2022Decode(first, second, third, byte)) { + result.Append(*codePoint); + return SawError::kNo; + } + } if (auto code_point = IndexGb18030RangesCodePoint( ((first - 0x81) * 10 * 126 * 10) + ((second - 0x30) * 10 * 126) + ((third - 0x81) * 10) + byte - 0x30)) { @@ -935,6 +1050,7 @@ // I do not think it is safe to keep the reference after // `TextCodecCJK::Decode` finishes. bool* saw_error_; + bool gb18030_2022_enabled_ = false; }; } // namespace
diff --git a/third_party/blink/web_tests/TestExpectations b/third_party/blink/web_tests/TestExpectations index 581a02e4..db21ee3c 100644 --- a/third_party/blink/web_tests/TestExpectations +++ b/third_party/blink/web_tests/TestExpectations
@@ -5665,9 +5665,6 @@ # Sheriff 2022-09-29 crbug.com/1369642 [ Mac ] external/wpt/encoding/unsupported-labels.window.html [ Failure Timeout ] -# Temporarily disable to land DevTools changes -crbug.com/1491359 http/tests/devtools/bindings/contentscripts-navigator-multiple-frames.js [ Failure Pass ] - # Temporarily expect timeouts related to post message blocking crbug.com/1159586 virtual/post-message-first-party-to-third-party-different-bucket-same-origin-blocked/external/wpt/html/browsers/windows/post-message/third-party-to-first-party-cross-partition-same-origin.sub.html [ Timeout ] crbug.com/1159586 virtual/post-message-third-party-to-first-party-different-bucket-same-origin-blocked/external/wpt/html/browsers/windows/post-message/first-party-to-third-party-cross-partition-same-origin.sub.html [ Timeout ] @@ -6745,7 +6742,7 @@ crbug.com/1485427 [ Win ] external/wpt/performance-timeline/not-restored-reasons/performance-navigation-timing-fetch.tentative.window.html [ Failure Pass ] crbug.com/1489489 [ Mac ] virtual/main-threaded-percent-based-scrolling/fast/scrolling/scrollbars/scrollbar-rtl-manipulation.html [ Failure ] -crbug.com/1489489 [ Mac ] virtual/compositor-threaded-percent-based-scrolling/fast/scrolling/scrollbars/scrollbar-rtl-manipulation.html [ Failure ] +crbug.com/1489489 [ Mac ] virtual/compositor-threaded-percent-based-scrolling/fast/scrolling/scrollbars/scrollbar-rtl-manipulation.html [ Failure Timeout ] # Gardener 2023-09-21 external/wpt/html/browsers/browsing-the-web/navigating-across-documents/initial-empty-document/window-open-204-fragment.html [ Failure ]
diff --git a/third_party/blink/web_tests/VirtualTestSuites b/third_party/blink/web_tests/VirtualTestSuites index 02f81cc..acd7e7c 100644 --- a/third_party/blink/web_tests/VirtualTestSuites +++ b/third_party/blink/web_tests/VirtualTestSuites
@@ -873,22 +873,7 @@ ], "platforms": ["Linux", "Mac", "Win"], "bases": [ - "fast/css/getComputedStyle/computed-style-listing.html", - "fast/css/getComputedStyle/computed-style-without-renderer-listing.html", - "svg/css/getComputedStyle-listing.xhtml", - "webexposed/css-properties-as-js-properties.html", - "webexposed/css-property-listing.html", - "external/wpt/css/css-highlight-api/highlight-pseudo-computed.html", - "external/wpt/css/css-text/parsing/text-autospace-computed.html", - "external/wpt/css/css-text/parsing/text-autospace-valid.html", - "external/wpt/css/css-text/text-autospace/", - "external/wpt/web-animations/animation-model/animation-types/accumulation-per-property-002.html", - "external/wpt/web-animations/animation-model/animation-types/addition-per-property-002.html", - "external/wpt/web-animations/animation-model/animation-types/interpolation-per-property-002.html", - "fast/dynamic/text-combine.html", - "fast/forms/month/month-appearance-l10n.html", - "fast/forms/select/select-text-autospace.html", - "virtual/text-antialias/justify-ideograph-leading-expansion.html" + "external/wpt/css/css-text/text-autospace/" ], "args": [ "--enable-blink-features=CSSTextAutoSpace", @@ -916,6 +901,9 @@ ], "platforms": ["Linux", "Mac", "Win"], "bases": [ + "external/wpt/css/css-text/parsing/text-spacing-computed.html", + "external/wpt/css/css-text/parsing/text-spacing-invalid.html", + "external/wpt/css/css-text/parsing/text-spacing-valid.html", "external/wpt/css/css-text/parsing/text-spacing-trim-computed.html", "external/wpt/css/css-text/parsing/text-spacing-trim-invalid.html", "external/wpt/css/css-text/parsing/text-spacing-trim-valid.html",
diff --git a/third_party/blink/web_tests/external/wpt/css/css-highlight-api/highlight-pseudo-computed-expected.txt b/third_party/blink/web_tests/external/wpt/css/css-highlight-api/highlight-pseudo-computed-expected.txt index 96594c5..f8092c1 100644 --- a/third_party/blink/web_tests/external/wpt/css/css-highlight-api/highlight-pseudo-computed-expected.txt +++ b/third_party/blink/web_tests/external/wpt/css/css-highlight-api/highlight-pseudo-computed-expected.txt
@@ -1,15 +1,15 @@ This is a testharness.js-based test. PASS getComputedStyle() for ::highlight(foo) PASS Different getComputedStyle() for ::highlight(bar) and same element -FAIL getComputedStyle() for ::highlight(foo): should not return a style. assert_equals: Invalid pseudo identifiers should not return a style. expected 0 but got 391 -FAIL getComputedStyle() for ::highlight(foo)) should not return a style. assert_equals: Invalid pseudo identifiers should not return a style. expected 0 but got 391 -FAIL getComputedStyle() for ::highlight(foo)( should not return a style. assert_equals: Invalid pseudo identifiers should not return a style. expected 0 but got 391 -FAIL getComputedStyle() for ::highlight should not return a style. assert_equals: Invalid pseudo identifiers should not return a style. expected 0 but got 391 -FAIL getComputedStyle() for ::highlight(foo)(foo) should not return a style. assert_equals: Invalid pseudo identifiers should not return a style. expected 0 but got 391 -FAIL getComputedStyle() for ::highlight(foo)() should not return a style. assert_equals: Invalid pseudo identifiers should not return a style. expected 0 but got 391 -FAIL getComputedStyle() for :::highlight(foo) should not return a style. assert_equals: Invalid pseudo identifiers should not return a style. expected 0 but got 391 -FAIL getComputedStyle() for ::highlight(foo). should not return a style. assert_equals: Invalid pseudo identifiers should not return a style. expected 0 but got 391 -FAIL getComputedStyle() for ::highlight(foo,bar) should not return a style. assert_equals: Invalid pseudo identifiers should not return a style. expected 0 but got 391 -FAIL getComputedStyle() for ::highlight(foo bar) should not return a style. assert_equals: Invalid pseudo identifiers should not return a style. expected 0 but got 391 +FAIL getComputedStyle() for ::highlight(foo): should not return a style. assert_equals: Invalid pseudo identifiers should not return a style. expected 0 but got 392 +FAIL getComputedStyle() for ::highlight(foo)) should not return a style. assert_equals: Invalid pseudo identifiers should not return a style. expected 0 but got 392 +FAIL getComputedStyle() for ::highlight(foo)( should not return a style. assert_equals: Invalid pseudo identifiers should not return a style. expected 0 but got 392 +FAIL getComputedStyle() for ::highlight should not return a style. assert_equals: Invalid pseudo identifiers should not return a style. expected 0 but got 392 +FAIL getComputedStyle() for ::highlight(foo)(foo) should not return a style. assert_equals: Invalid pseudo identifiers should not return a style. expected 0 but got 392 +FAIL getComputedStyle() for ::highlight(foo)() should not return a style. assert_equals: Invalid pseudo identifiers should not return a style. expected 0 but got 392 +FAIL getComputedStyle() for :::highlight(foo) should not return a style. assert_equals: Invalid pseudo identifiers should not return a style. expected 0 but got 392 +FAIL getComputedStyle() for ::highlight(foo). should not return a style. assert_equals: Invalid pseudo identifiers should not return a style. expected 0 but got 392 +FAIL getComputedStyle() for ::highlight(foo,bar) should not return a style. assert_equals: Invalid pseudo identifiers should not return a style. expected 0 but got 392 +FAIL getComputedStyle() for ::highlight(foo bar) should not return a style. assert_equals: Invalid pseudo identifiers should not return a style. expected 0 but got 392 Harness: the test ran to completion.
diff --git a/third_party/blink/web_tests/external/wpt/css/css-text/i18n/unknown-lang/css-text-line-break-cj-strict.html b/third_party/blink/web_tests/external/wpt/css/css-text/i18n/unknown-lang/css-text-line-break-cj-strict.html index 855d271a..aa8a8e2d 100644 --- a/third_party/blink/web_tests/external/wpt/css/css-text/i18n/unknown-lang/css-text-line-break-cj-strict.html +++ b/third_party/blink/web_tests/external/wpt/css/css-text/i18n/unknown-lang/css-text-line-break-cj-strict.html
@@ -15,7 +15,15 @@ } #wrapper { position: relative; } .test { color: red; } -.test, .ref { font-size: 30px; font-family: mplus-1p-regular, sans-serif; width: 185px; padding: 0; border: 1px solid orange; line-height: 1em; } +.test, .ref { + font-size: 30px; + font-family: mplus-1p-regular, sans-serif; + width: 185px; + padding: 0; + border: 1px solid orange; + line-height: 1em; + text-autospace: no-autospace; +} </style> <style> .test { line-break: strict; }
diff --git a/third_party/blink/web_tests/external/wpt/css/css-text/line-break/line-break-strict-012.xht b/third_party/blink/web_tests/external/wpt/css/css-text/line-break/line-break-strict-012.xht index d01b53f..c9f80dd 100644 --- a/third_party/blink/web_tests/external/wpt/css/css-text/line-break/line-break-strict-012.xht +++ b/third_party/blink/web_tests/external/wpt/css/css-text/line-break/line-break-strict-012.xht
@@ -37,6 +37,7 @@ border: 1px solid; margin: 10px; padding: 10px; + text-autospace: no-autospace; } </style> </head>
diff --git a/third_party/blink/web_tests/external/wpt/css/css-text/line-break/reference/line-break-strict-012-ref.xht b/third_party/blink/web_tests/external/wpt/css/css-text/line-break/reference/line-break-strict-012-ref.xht index fbe2222..c221b0e 100644 --- a/third_party/blink/web_tests/external/wpt/css/css-text/line-break/reference/line-break-strict-012-ref.xht +++ b/third_party/blink/web_tests/external/wpt/css/css-text/line-break/reference/line-break-strict-012-ref.xht
@@ -31,6 +31,7 @@ border: 1px solid; margin: 10px; padding: 10px; + text-autospace: no-autospace; } </style> </head>
diff --git a/third_party/blink/web_tests/external/wpt/css/css-text/parsing/text-autospace-computed-expected.txt b/third_party/blink/web_tests/external/wpt/css/css-text/parsing/text-autospace-computed-expected.txt index 25f258d..76f7a43 100644 --- a/third_party/blink/web_tests/external/wpt/css/css-text/parsing/text-autospace-computed-expected.txt +++ b/third_party/blink/web_tests/external/wpt/css/css-text/parsing/text-autospace-computed-expected.txt
@@ -1,8 +1,8 @@ This is a testharness.js-based test. -FAIL Property text-autospace value 'normal' assert_true: text-autospace doesn't seem to be supported in the computed style expected true got false -FAIL Property text-autospace value 'no-autospace' assert_true: text-autospace doesn't seem to be supported in the computed style expected true got false -FAIL Property text-autospace value 'auto' assert_true: text-autospace doesn't seem to be supported in the computed style expected true got false -FAIL Property text-autospace value 'ideograph-alpha' assert_true: text-autospace doesn't seem to be supported in the computed style expected true got false -FAIL Property text-autospace value 'ideograph-numeric' assert_true: text-autospace doesn't seem to be supported in the computed style expected true got false +PASS Property text-autospace value 'normal' +PASS Property text-autospace value 'no-autospace' +FAIL Property text-autospace value 'auto' assert_true: 'auto' is a supported value for text-autospace. expected true got false +FAIL Property text-autospace value 'ideograph-alpha' assert_true: 'ideograph-alpha' is a supported value for text-autospace. expected true got false +FAIL Property text-autospace value 'ideograph-numeric' assert_true: 'ideograph-numeric' is a supported value for text-autospace. expected true got false Harness: the test ran to completion.
diff --git a/third_party/blink/web_tests/external/wpt/css/css-text/parsing/text-autospace-valid-expected.txt b/third_party/blink/web_tests/external/wpt/css/css-text/parsing/text-autospace-valid-expected.txt index 4cb1beb..a956d5e 100644 --- a/third_party/blink/web_tests/external/wpt/css/css-text/parsing/text-autospace-valid-expected.txt +++ b/third_party/blink/web_tests/external/wpt/css/css-text/parsing/text-autospace-valid-expected.txt
@@ -1,6 +1,6 @@ This is a testharness.js-based test. -FAIL e.style['text-autospace'] = "normal" should set the property value assert_not_equals: property should be set got disallowed value "" -FAIL e.style['text-autospace'] = "no-autospace" should set the property value assert_not_equals: property should be set got disallowed value "" +PASS e.style['text-autospace'] = "normal" should set the property value +PASS e.style['text-autospace'] = "no-autospace" should set the property value FAIL e.style['text-autospace'] = "auto" should set the property value assert_not_equals: property should be set got disallowed value "" FAIL e.style['text-autospace'] = "ideograph-alpha" should set the property value assert_not_equals: property should be set got disallowed value "" FAIL e.style['text-autospace'] = "ideograph-numeric" should set the property value assert_not_equals: property should be set got disallowed value ""
diff --git a/third_party/blink/web_tests/external/wpt/css/css-text/parsing/text-spacing-computed-expected.txt b/third_party/blink/web_tests/external/wpt/css/css-text/parsing/text-spacing-computed-expected.txt new file mode 100644 index 0000000..2273e5a --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/css/css-text/parsing/text-spacing-computed-expected.txt
@@ -0,0 +1,15 @@ +This is a testharness.js-based test. +FAIL Property text-spacing value 'normal' assert_true: text-spacing doesn't seem to be supported in the computed style expected true got false +FAIL Property text-spacing value 'none' assert_true: text-spacing doesn't seem to be supported in the computed style expected true got false +FAIL Property text-spacing value 'auto' assert_true: text-spacing doesn't seem to be supported in the computed style expected true got false +FAIL Property text-spacing value 'no-autospace' assert_true: text-spacing doesn't seem to be supported in the computed style expected true got false +FAIL Property text-spacing value 'space-first' assert_true: text-spacing doesn't seem to be supported in the computed style expected true got false +FAIL Property text-spacing value 'space-all' assert_true: text-spacing doesn't seem to be supported in the computed style expected true got false +FAIL Property text-spacing value 'allow-end space-first' assert_true: text-spacing doesn't seem to be supported in the computed style expected true got false +FAIL Property text-spacing value 'space-first allow-end' assert_true: text-spacing doesn't seem to be supported in the computed style expected true got false +FAIL Property text-spacing value 'no-autospace space-first' assert_true: text-spacing doesn't seem to be supported in the computed style expected true got false +FAIL Property text-spacing value 'no-autospace space-all' assert_true: text-spacing doesn't seem to be supported in the computed style expected true got false +FAIL Property text-spacing value 'space-first no-autospace' assert_true: text-spacing doesn't seem to be supported in the computed style expected true got false +FAIL Property text-spacing value 'space-all no-autospace' assert_true: text-spacing doesn't seem to be supported in the computed style expected true got false +Harness: the test ran to completion. +
diff --git a/third_party/blink/web_tests/external/wpt/css/css-text/parsing/text-spacing-computed.html b/third_party/blink/web_tests/external/wpt/css/css-text/parsing/text-spacing-computed.html new file mode 100644 index 0000000..f2387919 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/css/css-text/parsing/text-spacing-computed.html
@@ -0,0 +1,36 @@ +<!DOCTYPE html> +<html> +<head> +<meta charset="utf-8"> +<title>CSS Text: getComputedStyle().textSpacing</title> +<link rel="help" href="https://drafts.csswg.org/css-text-4/#text-spacing-property"> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/css/support/computed-testcommon.js"></script> +</head> +<body> +<div id="target"></div> +<script> +test_computed_value("text-spacing", "normal"); +test_computed_value("text-spacing", "none"); +test_computed_value("text-spacing", "auto"); + +// `text-autospace`. +test_computed_value("text-spacing", "no-autospace"); + +// `text-spacing-trim`. +test_computed_value("text-spacing", "space-first", "normal"); +test_computed_value("text-spacing", "space-all"); +// Two values syntax. +test_computed_value("text-spacing", "allow-end space-first"); +test_computed_value("text-spacing", "space-first allow-end", "allow-end space-first"); + +// `text-autospace` and `text-spacing-trim`. +test_computed_value("text-spacing", "no-autospace space-first", "no-autospace"); +test_computed_value("text-spacing", "no-autospace space-all", "none"); +// Test the reversed order. +test_computed_value("text-spacing", "space-first no-autospace", "no-autospace"); +test_computed_value("text-spacing", "space-all no-autospace", "none"); +</script> +</body> +</html>
diff --git a/third_party/blink/web_tests/external/wpt/css/css-text/parsing/text-spacing-invalid.html b/third_party/blink/web_tests/external/wpt/css/css-text/parsing/text-spacing-invalid.html new file mode 100644 index 0000000..bd76a06 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/css/css-text/parsing/text-spacing-invalid.html
@@ -0,0 +1,23 @@ +<!DOCTYPE html> +<html> +<head> +<meta charset="utf-8"> +<title>CSS Text Module Test: parsing text-spacing with invalid values</title> +<link rel="help" href="https://drafts.csswg.org/css-text-4/#text-spacing-property"> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/css/support/parsing-testcommon.js"></script> +</head> +<body> +<script> +// These keywords must appear alone. +for (const keyword of ['normal', 'none', 'auto']) { + test_invalid_value("text-spacing", `${keyword} ${keyword}`); + for (const keyword2 of ['no-autospace', 'space-first']) { + test_invalid_value("text-spacing", `${keyword} ${keyword2}`); + test_invalid_value("text-spacing", `${keyword2} ${keyword}`); + } +} +</script> +</body> +</html>
diff --git a/third_party/blink/web_tests/external/wpt/css/css-text/parsing/text-spacing-valid-expected.txt b/third_party/blink/web_tests/external/wpt/css/css-text/parsing/text-spacing-valid-expected.txt new file mode 100644 index 0000000..5ccc7e7 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/css/css-text/parsing/text-spacing-valid-expected.txt
@@ -0,0 +1,15 @@ +This is a testharness.js-based test. +FAIL e.style['text-spacing'] = "normal" should set the property value assert_not_equals: property should be set got disallowed value "" +FAIL e.style['text-spacing'] = "none" should set the property value assert_not_equals: property should be set got disallowed value "" +FAIL e.style['text-spacing'] = "auto" should set the property value assert_not_equals: property should be set got disallowed value "" +FAIL e.style['text-spacing'] = "no-autospace" should set the property value assert_not_equals: property should be set got disallowed value "" +FAIL e.style['text-spacing'] = "space-first" should set the property value assert_not_equals: property should be set got disallowed value "" +FAIL e.style['text-spacing'] = "space-all" should set the property value assert_not_equals: property should be set got disallowed value "" +FAIL e.style['text-spacing'] = "allow-end space-first" should set the property value assert_not_equals: property should be set got disallowed value "" +FAIL e.style['text-spacing'] = "space-first allow-end" should set the property value assert_not_equals: property should be set got disallowed value "" +FAIL e.style['text-spacing'] = "no-autospace space-first" should set the property value assert_not_equals: property should be set got disallowed value "" +FAIL e.style['text-spacing'] = "no-autospace space-all" should set the property value assert_not_equals: property should be set got disallowed value "" +FAIL e.style['text-spacing'] = "space-first no-autospace" should set the property value assert_not_equals: property should be set got disallowed value "" +FAIL e.style['text-spacing'] = "space-all no-autospace" should set the property value assert_not_equals: property should be set got disallowed value "" +Harness: the test ran to completion. +
diff --git a/third_party/blink/web_tests/external/wpt/css/css-text/parsing/text-spacing-valid.html b/third_party/blink/web_tests/external/wpt/css/css-text/parsing/text-spacing-valid.html new file mode 100644 index 0000000..695fa8b --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/css/css-text/parsing/text-spacing-valid.html
@@ -0,0 +1,35 @@ +<!DOCTYPE html> +<html> +<head> +<meta charset="utf-8"> +<title>CSS Text Module Test: parsing text-spacing with valid values</title> +<link rel="help" href="https://drafts.csswg.org/css-text-4/#text-spacing-property"> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/css/support/parsing-testcommon.js"></script> +</head> +<body> +<script> +test_valid_value("text-spacing", "normal"); +test_valid_value("text-spacing", "none"); +test_valid_value("text-spacing", "auto"); + +// `text-autospace`. +test_valid_value("text-spacing", "no-autospace"); + +// `text-spacing-trim`. +test_valid_value("text-spacing", "space-first", "normal"); +test_valid_value("text-spacing", "space-all"); +// Two values syntax. +test_valid_value("text-spacing", "allow-end space-first"); +test_valid_value("text-spacing", "space-first allow-end", "allow-end space-first"); + +// `text-autospace` and `text-spacing-trim`. +test_valid_value("text-spacing", "no-autospace space-first", "no-autospace"); +test_valid_value("text-spacing", "no-autospace space-all", "none"); +// Test the reversed order. +test_valid_value("text-spacing", "space-first no-autospace", "no-autospace"); +test_valid_value("text-spacing", "space-all no-autospace", "none"); +</script> +</body> +</html>
diff --git a/third_party/blink/web_tests/external/wpt/css/css-text/text-autospace/text-autospace-001-expected.txt b/third_party/blink/web_tests/external/wpt/css/css-text/text-autospace/text-autospace-001-expected.txt deleted file mode 100644 index 674bab7..0000000 --- a/third_party/blink/web_tests/external/wpt/css/css-text/text-autospace/text-autospace-001-expected.txt +++ /dev/null
@@ -1,8 +0,0 @@ -This is a testharness.js-based test. -FAIL text-autospace-001 assert_array_equals: expected property 1 to be 45 but got 40 (expected array [40, 45, 40, 45, 40] got [40, 40, 40, 40, 40]) -FAIL text-autospace-001 1 assert_array_equals: expected property 3 to be 45 but got 40 (expected array [40, 40, 40, 45, 40] got [40, 40, 40, 40, 40]) -FAIL text-autospace-001 2 assert_array_equals: expected property 1 to be 45 but got 40 (expected array [40, 45, 40, 45, 40] got [40, 40, 40, 40, 40]) -FAIL text-autospace-001 3 assert_array_equals: expected property 3 to be 45 but got 40 (expected array [40, 40, 40, 45, 40] got [40, 40, 40, 40, 40]) -FAIL text-autospace-001 4 assert_array_equals: expected property 1 to be 45 but got 40 (expected array [40, 45, 40, 45, 40] got [40, 40, 40, 40, 40]) -Harness: the test ran to completion. -
diff --git a/third_party/blink/web_tests/external/wpt/css/css-text/text-autospace/text-autospace-first-line-001-expected.txt b/third_party/blink/web_tests/external/wpt/css/css-text/text-autospace/text-autospace-first-line-001-expected.txt deleted file mode 100644 index b188dc4..0000000 --- a/third_party/blink/web_tests/external/wpt/css/css-text/text-autospace/text-autospace-first-line-001-expected.txt +++ /dev/null
@@ -1,4 +0,0 @@ -This is a testharness.js-based test. -FAIL text-autospace-first-line-001 assert_array_equals: expected property 1 to be 90 but got 80 (expected array [80, 90, 80, 90, 80, 40, 45, 40, 45, 40] got [80, 80, 80, 80, 80, 40, 40, 40, 40, 40]) -Harness: the test ran to completion. -
diff --git a/third_party/blink/web_tests/external/wpt/css/css-text/text-autospace/text-autospace-ligature-001-expected.txt b/third_party/blink/web_tests/external/wpt/css/css-text/text-autospace/text-autospace-ligature-001-expected.txt deleted file mode 100644 index de40e944..0000000 --- a/third_party/blink/web_tests/external/wpt/css/css-text/text-autospace/text-autospace-ligature-001-expected.txt +++ /dev/null
@@ -1,4 +0,0 @@ -This is a testharness.js-based test. -FAIL text-autospace not implemented assert_true: expected true got false -Harness: the test ran to completion. -
diff --git a/third_party/blink/web_tests/external/wpt/css/css-text/text-spacing-trim/support/variant-feature.js b/third_party/blink/web_tests/external/wpt/css/css-text/text-spacing-trim/support/variant-feature.js new file mode 100644 index 0000000..4fee3e4 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/css/css-text/text-spacing-trim/support/variant-feature.js
@@ -0,0 +1,16 @@ +'use strict'; + +/** + * Add `style` and `feature` search params to the `style` attribute. + */ +if (window.location.search) { + const params = new URLSearchParams(window.location.search); + const styles = params.getAll('style'); + const features = params.getAll('feature'); + for (const feature of features) { + styles.push(`font-feature-settings: '${feature}'`); + } + if (styles.length) { + document.documentElement.style = styles.join(';'); + } +}
diff --git a/third_party/blink/web_tests/external/wpt/css/css-text/text-spacing-trim/text-spacing-trim-feature-001-ref.html b/third_party/blink/web_tests/external/wpt/css/css-text/text-spacing-trim/text-spacing-trim-feature-001-ref.html new file mode 100644 index 0000000..86b61e06 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/css/css-text/text-spacing-trim/text-spacing-trim-feature-001-ref.html
@@ -0,0 +1,21 @@ +<!DOCTYPE html> +<meta charset="utf-8"> +<script src="support/variant-class.js"></script> +<script src="support/variant-feature.js"></script> +<style> +@font-face { + font-family: halt-font; + src: url('/fonts/noto/cjk/NotoSansCJKjp-Regular-subset-halt.otf'); +} +#container { + font-family: halt-font; + font-size: 20px; + text-spacing-trim: space-all; +} +.vrl { + writing-mode: vertical-rl; +} +</style> +<div id="container"> + <div><span>国)(国国((国(国</span></div> +</div>
diff --git a/third_party/blink/web_tests/external/wpt/css/css-text/text-spacing-trim/text-spacing-trim-feature-001.html b/third_party/blink/web_tests/external/wpt/css/css-text/text-spacing-trim/text-spacing-trim-feature-001.html new file mode 100644 index 0000000..25ddad34 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/css/css-text/text-spacing-trim/text-spacing-trim-feature-001.html
@@ -0,0 +1,37 @@ +<!DOCTYPE html> +<meta charset="utf-8"> +<link rel="help" href="https://drafts.csswg.org/css-text-4/#text-spacing-trim-property"> +<link rel="match" href="text-spacing-trim-feature-001-ref.html"> +<meta name="variant" content="?class=htb&feature=halt"> +<meta name="variant" content="?class=htb&feature=hwid"> +<meta name="variant" content="?class=htb&feature=palt"> +<meta name="variant" content="?class=htb&feature=pwid"> +<meta name="variant" content="?class=htb&style=font-variant-east-asian:proportional-width"> +<meta name="variant" content="?class=vrl&feature=vhal"> +<meta name="variant" content="?class=vrl&feature=vpal"> +<meta name="variant" content="?class=vrl&style=font-variant-east-asian:proportional-width"> +<script src="support/variant-class.js"></script> +<script src="support/variant-feature.js"></script> +<style> +@font-face { + font-family: halt-font; + src: url('/fonts/noto/cjk/NotoSansCJKjp-Regular-subset-halt.otf'); +} +@font-face { + font-family: chws-font; + src: url('/fonts/noto/cjk/NotoSansCJKjp-Regular-subset-chws.otf'); +} +#container { + font-family: halt-font; + font-size: 20px; +} +.chws #container { + font-family: chws-font; +} +.vrl { + writing-mode: vertical-rl; +} +</style> +<div id="container"> + <div><span>国)(国国((国(国</span></div> +</div>
diff --git a/third_party/blink/web_tests/external/wpt/css/css-writing-modes/text-orientation-mixed-vlr-100-ref.html b/third_party/blink/web_tests/external/wpt/css/css-writing-modes/text-orientation-mixed-vlr-100-ref.html index 26e2cb7..d5f1d56 100644 --- a/third_party/blink/web_tests/external/wpt/css/css-writing-modes/text-orientation-mixed-vlr-100-ref.html +++ b/third_party/blink/web_tests/external/wpt/css/css-writing-modes/text-orientation-mixed-vlr-100-ref.html
@@ -14,6 +14,7 @@ font: 20px/1 "orientation"; height: 17em; text-orientation: mixed; + text-autospace: no-autospace; } .line { white-space: pre;
diff --git a/third_party/blink/web_tests/external/wpt/css/css-writing-modes/text-orientation-mixed-vlr-100.html b/third_party/blink/web_tests/external/wpt/css/css-writing-modes/text-orientation-mixed-vlr-100.html index 9e577f1..e2f2bedb1 100644 --- a/third_party/blink/web_tests/external/wpt/css/css-writing-modes/text-orientation-mixed-vlr-100.html +++ b/third_party/blink/web_tests/external/wpt/css/css-writing-modes/text-orientation-mixed-vlr-100.html
@@ -16,7 +16,8 @@ font: 20px/1 "orientation"; height: 17em; text-orientation: mixed; -} + text-autospace: no-autospace; + } .line { white-space: pre; }
diff --git a/third_party/blink/web_tests/external/wpt/css/css-writing-modes/text-orientation-mixed-vrl-100-ref.html b/third_party/blink/web_tests/external/wpt/css/css-writing-modes/text-orientation-mixed-vrl-100-ref.html index 77de672..15d74eb 100644 --- a/third_party/blink/web_tests/external/wpt/css/css-writing-modes/text-orientation-mixed-vrl-100-ref.html +++ b/third_party/blink/web_tests/external/wpt/css/css-writing-modes/text-orientation-mixed-vrl-100-ref.html
@@ -14,6 +14,7 @@ font: 20px/1 "orientation"; height: 17em; text-orientation: mixed; + text-autospace: no-autospace; } .line { white-space: pre;
diff --git a/third_party/blink/web_tests/external/wpt/css/css-writing-modes/text-orientation-mixed-vrl-100.html b/third_party/blink/web_tests/external/wpt/css/css-writing-modes/text-orientation-mixed-vrl-100.html index 183217dd..3558574 100644 --- a/third_party/blink/web_tests/external/wpt/css/css-writing-modes/text-orientation-mixed-vrl-100.html +++ b/third_party/blink/web_tests/external/wpt/css/css-writing-modes/text-orientation-mixed-vrl-100.html
@@ -16,6 +16,7 @@ font: 20px/1 "orientation"; height: 17em; text-orientation: mixed; + text-autospace: no-autospace; } .line { white-space: pre;
diff --git a/third_party/blink/web_tests/external/wpt/css/css-writing-modes/text-orientation-sideways-vlr-100.html b/third_party/blink/web_tests/external/wpt/css/css-writing-modes/text-orientation-sideways-vlr-100.html index a3b73bb2..2060c86 100644 --- a/third_party/blink/web_tests/external/wpt/css/css-writing-modes/text-orientation-sideways-vlr-100.html +++ b/third_party/blink/web_tests/external/wpt/css/css-writing-modes/text-orientation-sideways-vlr-100.html
@@ -16,6 +16,7 @@ font: 20px/1 "orientation"; height: 17em; text-orientation: sideways; + text-autospace: no-autospace; } .line { white-space: pre;
diff --git a/third_party/blink/web_tests/external/wpt/css/css-writing-modes/text-orientation-sideways-vrl-100.html b/third_party/blink/web_tests/external/wpt/css/css-writing-modes/text-orientation-sideways-vrl-100.html index 52355db1..ada168e 100644 --- a/third_party/blink/web_tests/external/wpt/css/css-writing-modes/text-orientation-sideways-vrl-100.html +++ b/third_party/blink/web_tests/external/wpt/css/css-writing-modes/text-orientation-sideways-vrl-100.html
@@ -16,6 +16,7 @@ font: 20px/1 "orientation"; height: 17em; text-orientation: sideways; + text-autospace: no-autospace; } .line { white-space: pre;
diff --git a/third_party/blink/web_tests/external/wpt/encoding/legacy-mb-schinese/gb18030/gb18030-decoder.any.js b/third_party/blink/web_tests/external/wpt/encoding/legacy-mb-schinese/gb18030/gb18030-decoder.any.js index 99a0253..fca68358 100644 --- a/third_party/blink/web_tests/external/wpt/encoding/legacy-mb-schinese/gb18030/gb18030-decoder.any.js +++ b/third_party/blink/web_tests/external/wpt/encoding/legacy-mb-schinese/gb18030/gb18030-decoder.any.js
@@ -47,6 +47,44 @@ decode([0xA1, 0xAD], "\u2026", "legacy ICU special case 2"); decode([0xA1, 0xAB], "\uFF5E", "legacy ICU special case 3"); +// GB18030-2022 +decode([0xA6, 0xD9], "\uFE10", "GB18030-2022 1"); +decode([0xA6, 0xDA], "\uFE12", "GB18030-2022 2"); +decode([0xA6, 0xDB], "\uFE11", "GB18030-2022 3"); +decode([0xA6, 0xDC], "\uFE13", "GB18030-2022 4"); +decode([0xA6, 0xDD], "\uFE14", "GB18030-2022 5"); +decode([0xA6, 0xDE], "\uFE15", "GB18030-2022 6"); +decode([0xA6, 0xDF], "\uFE16", "GB18030-2022 7"); +decode([0xA6, 0xEC], "\uFE17", "GB18030-2022 8"); +decode([0xA6, 0xED], "\uFE18", "GB18030-2022 9"); +decode([0xA6, 0xF3], "\uFE19", "GB18030-2022 10"); +decode([0xFE, 0x59], "\u9FB4", "GB18030-2022 11"); +decode([0xFE, 0x61], "\u9FB5", "GB18030-2022 12"); +decode([0xFE, 0x66], "\u9FB6", "GB18030-2022 13"); +decode([0xFE, 0x67], "\u9FB7", "GB18030-2022 14"); +decode([0xFE, 0x6D], "\u9FB8", "GB18030-2022 15"); +decode([0xFE, 0x7E], "\u9FB9", "GB18030-2022 16"); +decode([0xFE, 0x90], "\u9FBA", "GB18030-2022 17"); +decode([0xFE, 0xA0], "\u9FBB", "GB18030-2022 18"); +decode([0x82, 0x35, 0x90, 0x37], "\uE81E", "GB18030-2022 19"); +decode([0x82, 0x35, 0x90, 0x38], "\uE826", "GB18030-2022 20"); +decode([0x82, 0x35, 0x90, 0x39], "\uE82B", "GB18030-2022 21"); +decode([0x82, 0x35, 0x91, 0x30], "\uE82C", "GB18030-2022 22"); +decode([0x82, 0x35, 0x91, 0x31], "\uE832", "GB18030-2022 23"); +decode([0x82, 0x35, 0x91, 0x32], "\uE843", "GB18030-2022 24"); +decode([0x82, 0x35, 0x91, 0x33], "\uE854", "GB18030-2022 25"); +decode([0x82, 0x35, 0x91, 0x34], "\uE864", "GB18030-2022 26"); +decode([0x84, 0x31, 0x82, 0x36], "\uE78D", "GB18030-2022 27"); +decode([0x84, 0x31, 0x82, 0x37], "\uE78F", "GB18030-2022 28"); +decode([0x84, 0x31, 0x82, 0x38], "\uE78E", "GB18030-2022 29"); +decode([0x84, 0x31, 0x82, 0x39], "\uE790", "GB18030-2022 30"); +decode([0x84, 0x31, 0x83, 0x30], "\uE791", "GB18030-2022 31"); +decode([0x84, 0x31, 0x83, 0x31], "\uE792", "GB18030-2022 32"); +decode([0x84, 0x31, 0x83, 0x32], "\uE793", "GB18030-2022 33"); +decode([0x84, 0x31, 0x83, 0x33], "\uE794", "GB18030-2022 34"); +decode([0x84, 0x31, 0x83, 0x34], "\uE795", "GB18030-2022 35"); +decode([0x84, 0x31, 0x83, 0x35], "\uE796", "GB18030-2022 36"); + let i = 0; for (const range of ranges) { const pointer = range[0];
diff --git a/third_party/blink/web_tests/external/wpt/encoding/legacy-mb-schinese/gb18030/gb18030-encoder.html b/third_party/blink/web_tests/external/wpt/encoding/legacy-mb-schinese/gb18030/gb18030-encoder.html index a6570c8..531d260 100644 --- a/third_party/blink/web_tests/external/wpt/encoding/legacy-mb-schinese/gb18030/gb18030-encoder.html +++ b/third_party/blink/web_tests/external/wpt/encoding/legacy-mb-schinese/gb18030/gb18030-encoder.html
@@ -24,6 +24,44 @@ encode("\u2026", "%A1%AD", "legacy ICU special case 2"); encode("\uFF5E", "%A1%AB", "legacy ICU special case 3"); + // GB18030-2022 + encode("\uFE10", "%A6%D9", "GB18030-2022 1"); + encode("\uFE12", "%A6%DA", "GB18030-2022 2"); + encode("\uFE11", "%A6%DB", "GB18030-2022 3"); + encode("\uFE13", "%A6%DC", "GB18030-2022 4"); + encode("\uFE14", "%A6%DD", "GB18030-2022 5"); + encode("\uFE15", "%A6%DE", "GB18030-2022 6"); + encode("\uFE16", "%A6%DF", "GB18030-2022 7"); + encode("\uFE17", "%A6%EC", "GB18030-2022 8"); + encode("\uFE18", "%A6%ED", "GB18030-2022 9"); + encode("\uFE19", "%A6%F3", "GB18030-2022 10"); + encode("\u9FB4", "%FEY", "GB18030-2022 11"); + encode("\u9FB5", "%FEa", "GB18030-2022 12"); + encode("\u9FB6", "%FEf", "GB18030-2022 13"); + encode("\u9FB7", "%FEg", "GB18030-2022 14"); + encode("\u9FB8", "%FEm", "GB18030-2022 15"); + encode("\u9FB9", "%FE~", "GB18030-2022 16"); + encode("\u9FBA", "%FE%90", "GB18030-2022 17"); + encode("\u9FBB", "%FE%A0", "GB18030-2022 18"); + encode("\uE78D", "%841%826", "GB18030-2022 19"); + encode("\uE78E", "%841%828", "GB18030-2022 20"); + encode("\uE78F", "%841%827", "GB18030-2022 21"); + encode("\uE790", "%841%829", "GB18030-2022 22"); + encode("\uE791", "%841%830", "GB18030-2022 23"); + encode("\uE792", "%841%831", "GB18030-2022 24"); + encode("\uE793", "%841%832", "GB18030-2022 25"); + encode("\uE794", "%841%833", "GB18030-2022 26"); + encode("\uE795", "%841%834", "GB18030-2022 27"); + encode("\uE796", "%841%835", "GB18030-2022 28"); + encode("\uE81E", "%825%907", "GB18030-2022 29"); + encode("\uE826", "%825%908", "GB18030-2022 30"); + encode("\uE82B", "%825%909", "GB18030-2022 31"); + encode("\uE82C", "%825%910", "GB18030-2022 32"); + encode("\uE832", "%825%911", "GB18030-2022 33"); + encode("\uE843", "%825%912", "GB18030-2022 34"); + encode("\uE854", "%825%913", "GB18030-2022 35"); + encode("\uE864", "%825%914", "GB18030-2022 36"); + const upperCaseNibble = x => { return Math.floor(x).toString(16).toUpperCase(); }
diff --git a/third_party/blink/web_tests/external/wpt/fonts/noto/cjk/NotoSansCJKjp-Regular-subset-chws.otf b/third_party/blink/web_tests/external/wpt/fonts/noto/cjk/NotoSansCJKjp-Regular-subset-chws.otf index 18859d5e2..8aa4c66 100644 --- a/third_party/blink/web_tests/external/wpt/fonts/noto/cjk/NotoSansCJKjp-Regular-subset-chws.otf +++ b/third_party/blink/web_tests/external/wpt/fonts/noto/cjk/NotoSansCJKjp-Regular-subset-chws.otf Binary files differ
diff --git a/third_party/blink/web_tests/external/wpt/fonts/noto/cjk/NotoSansCJKjp-Regular-subset-halt.otf b/third_party/blink/web_tests/external/wpt/fonts/noto/cjk/NotoSansCJKjp-Regular-subset-halt.otf index 7732822..a87f898 100644 --- a/third_party/blink/web_tests/external/wpt/fonts/noto/cjk/NotoSansCJKjp-Regular-subset-halt.otf +++ b/third_party/blink/web_tests/external/wpt/fonts/noto/cjk/NotoSansCJKjp-Regular-subset-halt.otf Binary files differ
diff --git a/third_party/blink/web_tests/external/wpt/fonts/noto/cjk/README.md b/third_party/blink/web_tests/external/wpt/fonts/noto/cjk/README.md index 8ff42d0..a14fa64 100644 --- a/third_party/blink/web_tests/external/wpt/fonts/noto/cjk/README.md +++ b/third_party/blink/web_tests/external/wpt/fonts/noto/cjk/README.md
@@ -8,7 +8,7 @@ ``` pyftsubset NotoSansCJKjp-Regular.otf \ --unicodes=20-7E,2018-201F,56FD,6C34,3000-301F,30FB,FF01-FF1F,FF5B-FF65 \ - --layout-features+=halt,vhal \ + --layout-features+=halt,fwid,hwid,palt,pwid,vhal,vpal \ --output-file=NotoSansCJKjp-Regular-subset-halt.otf ``` where `pyftsubset` comes from https://github.com/fonttools/fonttools @@ -21,7 +21,7 @@ ``` pyftsubset NotoSansCJKjp-Regular.otf \ --unicodes=20-7E,2018-201F,56FD,6C34,3000-301F,30FB,FF01-FF1F,FF5B-FF65 \ - --layout-features+=halt,vhal,chws,vchw \ + --layout-features+=halt,fwid,hwid,palt,pwid,vhal,vpal,chws,vchw \ --output-file=NotoSansCJKjp-Regular-subset-chws.otf ``` Note there are two variants of Noto CJK; one with `chws` and one without.
diff --git a/third_party/blink/web_tests/external/wpt/long-animation-frame/tentative/loaf-stream.html b/third_party/blink/web_tests/external/wpt/long-animation-frame/tentative/loaf-stream.html new file mode 100644 index 0000000..e35bc2f --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/long-animation-frame/tentative/loaf-stream.html
@@ -0,0 +1,39 @@ +<!DOCTYPE HTML> +<meta charset=utf-8> +<title>Long Animation Frame Timing: stream promise resolvers</title> +<meta name="timeout" content="long"> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/common/get-host-info.sub.js"></script> +<script src="resources/utils.js"></script> + +<body> +<h1>Long Animation Frame: stream promise resolvers</h1> +<div id="log"></div> +<script> + +test_promise_script(async t => { + const response = await fetch("/common/dummy.xml"); + await response.body.getReader().read(); + busy_wait(very_long_frame_duration); +}, "resolve", "ReadableStreamDefaultReader.read.then"); + +test_promise_script(async t => { + const response = await fetch("/common/dummy.xml"); + await response.body.getReader({ mode: "byob" }).read(new Int32Array(1000)); + busy_wait(very_long_frame_duration); +}, "resolve", "ReadableStreamBYOBReader.read.then"); + +test_promise_script(async t => { + const response = await fetch("/common/dummy.xml"); + const {readable, writable} = new TransformStream({ + start() {}, + transform() { + busy_wait(very_long_frame_duration); + } + }); + response.body.pipeTo(writable); + await readable.getReader().read(); +}, "resolve", "StreamPromise.resolve"); +</script> +</body>
diff --git a/third_party/blink/web_tests/external/wpt/service-workers/service-worker/tentative/static-router/resources/or-test/direct1.text b/third_party/blink/web_tests/external/wpt/service-workers/service-worker/tentative/static-router/resources/or-test/direct1.text new file mode 100644 index 0000000..f3d9861 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/service-workers/service-worker/tentative/static-router/resources/or-test/direct1.text
@@ -0,0 +1 @@ +Network
diff --git a/third_party/blink/web_tests/external/wpt/service-workers/service-worker/tentative/static-router/resources/or-test/direct1.text.headers b/third_party/blink/web_tests/external/wpt/service-workers/service-worker/tentative/static-router/resources/or-test/direct1.text.headers new file mode 100644 index 0000000..156209f9 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/service-workers/service-worker/tentative/static-router/resources/or-test/direct1.text.headers
@@ -0,0 +1 @@ +Content-Type: text/html
diff --git a/third_party/blink/web_tests/external/wpt/service-workers/service-worker/tentative/static-router/resources/or-test/direct2.text b/third_party/blink/web_tests/external/wpt/service-workers/service-worker/tentative/static-router/resources/or-test/direct2.text new file mode 100644 index 0000000..f3d9861 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/service-workers/service-worker/tentative/static-router/resources/or-test/direct2.text
@@ -0,0 +1 @@ +Network
diff --git a/third_party/blink/web_tests/external/wpt/service-workers/service-worker/tentative/static-router/resources/or-test/direct2.text.headers b/third_party/blink/web_tests/external/wpt/service-workers/service-worker/tentative/static-router/resources/or-test/direct2.text.headers new file mode 100644 index 0000000..156209f9 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/service-workers/service-worker/tentative/static-router/resources/or-test/direct2.text.headers
@@ -0,0 +1 @@ +Content-Type: text/html
diff --git a/third_party/blink/web_tests/external/wpt/service-workers/service-worker/tentative/static-router/resources/static-router-sw.js b/third_party/blink/web_tests/external/wpt/service-workers/service-worker/tentative/static-router/resources/static-router-sw.js index e95bdad..0cde920 100644 --- a/third_party/blink/web_tests/external/wpt/service-workers/service-worker/tentative/static-router/resources/static-router-sw.js +++ b/third_party/blink/web_tests/external/wpt/service-workers/service-worker/tentative/static-router/resources/static-router-sw.js
@@ -4,21 +4,30 @@ self.addEventListener('install', e => { e.registerRouter([ - { - condition: { requestMode: 'no-cors' }, - source: 'network' - }, - { - condition: { urlPattern: '/**/*.txt??*' }, + {condition: {requestMode: 'no-cors'}, source: 'network'}, { + condition: {urlPattern: '/**/*.txt??*'}, // Note: "??*" is for allowing arbitrary query strings. // Upon my experiment, the URLPattern needs two '?'s for specifying // a coming string as a query. source: 'network' - }, { - condition: { - urlPattern: '/**/simple-test-for-condition-main-resource.html'}, + }, + { + condition: + {urlPattern: '/**/simple-test-for-condition-main-resource.html'}, source: 'network' - }]); + }, + { + condition: { + or: [ + { + or: [{urlPattern: '/**/or-test/direct1.*??*'}], + }, + {urlPattern: '/**/or-test/direct2.*??*'} + ] + }, + source: 'network' + } + ]); self.skipWaiting(); });
diff --git a/third_party/blink/web_tests/external/wpt/service-workers/service-worker/tentative/static-router/static-router-subresource.https.html b/third_party/blink/web_tests/external/wpt/service-workers/service-worker/tentative/static-router/static-router-subresource.https.html index 7d956363..42e4da8 100644 --- a/third_party/blink/web_tests/external/wpt/service-workers/service-worker/tentative/static-router/static-router-subresource.https.html +++ b/third_party/blink/web_tests/external/wpt/service-workers/service-worker/tentative/static-router/static-router-subresource.https.html
@@ -11,6 +11,13 @@ const HTML_FILE = 'resources/simple.html'; const TXT_FILE = 'resources/direct.txt'; const CSV_FILE = 'resources/simple.csv'; +// Warning: please prepare the corresponding `*.text.headers` files, otherwise +// iframeTest() fails to load the following files due to MIME mismatches. +const OR_TEST_FILES = [ + 'resources/or-test/direct1.text', + 'resources/or-test/direct2.text', + 'resources/or-test/does-not-exist.text', +]; // Register a service worker, then create an iframe at url. function iframeTest(url, callback, name) { @@ -51,5 +58,23 @@ assert_equals(await response.text(), "matched,with,non-url,conditions\n"); }, 'Subresource load matched with RequestMode condition'); +iframeTest(OR_TEST_FILES[0], async (t, iwin) => { + const rnd = randomString(); + const response = await iwin.fetch('?nonce=' + rnd); + assert_equals(await response.text(), "Network\n"); +}, 'Subresource load matched with the nested `or` condition'); + +iframeTest(OR_TEST_FILES[1], async (t, iwin) => { + const rnd = randomString(); + const response = await iwin.fetch('?nonce=' + rnd); + assert_equals(await response.text(), "Network\n"); +}, 'Subresource load matched with the next `or` condition'); + +iframeTest(OR_TEST_FILES[2], async (t, iwin) => { + const rnd = randomString(); + const response = await iwin.fetch('?nonce=' + rnd); + assert_equals(await response.text(), rnd); +}, 'Subresource load not matched with `or` condition'); + </script> </body>
diff --git a/third_party/blink/web_tests/external/wpt/web-animations/animation-model/animation-types/accumulation-per-property-002-expected.txt b/third_party/blink/web_tests/external/wpt/web-animations/animation-model/animation-types/accumulation-per-property-002-expected.txt index 4a5af9b..040921d 100644 --- a/third_party/blink/web_tests/external/wpt/web-animations/animation-model/animation-types/accumulation-per-property-002-expected.txt +++ b/third_party/blink/web_tests/external/wpt/web-animations/animation-model/animation-types/accumulation-per-property-002-expected.txt
@@ -1,5 +1,5 @@ This is a testharness.js-based test. -Found 314 tests; 297 PASS, 17 FAIL, 0 TIMEOUT, 0 NOTRUN. +Found 317 tests; 300 PASS, 17 FAIL, 0 TIMEOUT, 0 NOTRUN. PASS Setup PASS isolation (type: discrete) has testAccumulation function PASS isolation: "isolate" onto "auto" @@ -208,6 +208,9 @@ PASS text-anchor (type: discrete) has testAccumulation function PASS text-anchor: "end" onto "middle" PASS text-anchor: "middle" onto "end" +PASS text-autospace (type: discrete) has testAccumulation function +PASS text-autospace: "no-autospace" onto "normal" +PASS text-autospace: "normal" onto "no-autospace" PASS text-decoration-color (type: color) has testAccumulation function PASS text-decoration-color supports animating as color of rgb() with overflowed from and to values PASS text-decoration-color supports animating as color of #RGB
diff --git a/third_party/blink/web_tests/external/wpt/web-animations/animation-model/animation-types/addition-per-property-002-expected.txt b/third_party/blink/web_tests/external/wpt/web-animations/animation-model/animation-types/addition-per-property-002-expected.txt index ef9c998..0f91f5c6 100644 --- a/third_party/blink/web_tests/external/wpt/web-animations/animation-model/animation-types/addition-per-property-002-expected.txt +++ b/third_party/blink/web_tests/external/wpt/web-animations/animation-model/animation-types/addition-per-property-002-expected.txt
@@ -1,5 +1,5 @@ This is a testharness.js-based test. -Found 310 tests; 296 PASS, 14 FAIL, 0 TIMEOUT, 0 NOTRUN. +Found 313 tests; 299 PASS, 14 FAIL, 0 TIMEOUT, 0 NOTRUN. PASS Setup PASS isolation (type: discrete) has testAddition function PASS isolation: "isolate" onto "auto" @@ -208,6 +208,9 @@ PASS text-anchor (type: discrete) has testAddition function PASS text-anchor: "end" onto "middle" PASS text-anchor: "middle" onto "end" +PASS text-autospace (type: discrete) has testAddition function +PASS text-autospace: "no-autospace" onto "normal" +PASS text-autospace: "normal" onto "no-autospace" PASS text-decoration-color (type: color) has testAddition function PASS text-decoration-color supports animating as color of rgb() with overflowed from and to values PASS text-decoration-color supports animating as color of #RGB
diff --git a/third_party/blink/web_tests/external/wpt/web-animations/animation-model/animation-types/interpolation-per-property-002-expected.txt b/third_party/blink/web_tests/external/wpt/web-animations/animation-model/animation-types/interpolation-per-property-002-expected.txt index afa793c7..ed17ed8 100644 --- a/third_party/blink/web_tests/external/wpt/web-animations/animation-model/animation-types/interpolation-per-property-002-expected.txt +++ b/third_party/blink/web_tests/external/wpt/web-animations/animation-model/animation-types/interpolation-per-property-002-expected.txt
@@ -1,5 +1,5 @@ This is a testharness.js-based test. -Found 383 tests; 369 PASS, 14 FAIL, 0 TIMEOUT, 0 NOTRUN. +Found 387 tests; 373 PASS, 14 FAIL, 0 TIMEOUT, 0 NOTRUN. PASS Setup PASS isolation (type: discrete) has testInterpolation function PASS isolation uses discrete animation when animating between "auto" and "isolate" with linear easing @@ -254,6 +254,10 @@ PASS text-anchor uses discrete animation when animating between "middle" and "end" with linear easing PASS text-anchor uses discrete animation when animating between "middle" and "end" with effect easing PASS text-anchor uses discrete animation when animating between "middle" and "end" with keyframe easing +PASS text-autospace (type: discrete) has testInterpolation function +PASS text-autospace uses discrete animation when animating between "normal" and "no-autospace" with linear easing +PASS text-autospace uses discrete animation when animating between "normal" and "no-autospace" with effect easing +PASS text-autospace uses discrete animation when animating between "normal" and "no-autospace" with keyframe easing PASS text-decoration-color (type: color) has testInterpolation function PASS text-decoration-color supports animating as color of rgb() PASS text-decoration-color supports animating as color of #RGB
diff --git a/third_party/blink/web_tests/external/wpt/x-frame-options/support/helper.sub.js b/third_party/blink/web_tests/external/wpt/x-frame-options/support/helper.sub.js index 23663dd..fa519e4c 100644 --- a/third_party/blink/web_tests/external/wpt/x-frame-options/support/helper.sub.js +++ b/third_party/blink/web_tests/external/wpt/x-frame-options/support/helper.sub.js
@@ -89,7 +89,6 @@ } document.body.append(i); - t.add_cleanup(() => i.remove()); }, message); }
diff --git a/third_party/blink/web_tests/external/wpt/x-frame-options/support/nested.py b/third_party/blink/web_tests/external/wpt/x-frame-options/support/nested.py index 78c8c184..c973254 100644 --- a/third_party/blink/web_tests/external/wpt/x-frame-options/support/nested.py +++ b/third_party/blink/web_tests/external/wpt/x-frame-options/support/nested.py
@@ -17,21 +17,20 @@ var i = document.createElement("iframe"); i.src = "%s/x-frame-options/support/xfo.py?value=%s"; i.onload = _ => { - // Why two rAFs? Because that seems to be enough to stop the - // load event from racing with the onmessage event. - requestAnimationFrame(_ => { - requestAnimationFrame(_ => { - // The race condition problem we have is it is possible - // that the sub iframe is loaded before the postMessage is - // dispatched, as a result, the "Failed" message is sent - // out. So the way we fixed is we simply let the timeout - // to happen if we expect the "Loaded" postMessage to be - // sent - if (!gotMessage && %s != true) { - window.parent.postMessage("Failed", "*"); - } - }); - }); + // Why 100ms timeout? Because that seems to be enough to stop the + // load event from racing with the onmessage event, and it's at least + // as long as the two renderAnimationFrame calls that used to be here. + setTimeout(_ => { + // The race condition problem we have is it is possible + // that the sub iframe is loaded before the postMessage is + // dispatched, as a result, the "Failed" message is sent + // out. So the way we fixed is we simply let the timeout + // to happen if we expect the "Loaded" postMessage to be + // sent + if (!gotMessage && %s != true) { + window.parent.postMessage("Failed", "*"); + } + }, 100); }; document.body.appendChild(i); </script>
diff --git a/third_party/blink/web_tests/fast/css/getComputedStyle/computed-style-listing-expected.txt b/third_party/blink/web_tests/fast/css/getComputedStyle/computed-style-listing-expected.txt index 06e19ca9..01cb91e 100644 --- a/third_party/blink/web_tests/fast/css/getComputedStyle/computed-style-listing-expected.txt +++ b/third_party/blink/web_tests/fast/css/getComputedStyle/computed-style-listing-expected.txt
@@ -344,6 +344,7 @@ text-align: start text-align-last: auto text-anchor: start +text-autospace: normal text-box-trim: none text-decoration: none solid rgb(0, 0, 0) text-decoration-color: rgb(0, 0, 0)
diff --git a/third_party/blink/web_tests/fast/css/getComputedStyle/computed-style-without-renderer-listing-expected.txt b/third_party/blink/web_tests/fast/css/getComputedStyle/computed-style-without-renderer-listing-expected.txt index e9e2762..1b85016 100644 --- a/third_party/blink/web_tests/fast/css/getComputedStyle/computed-style-without-renderer-listing-expected.txt +++ b/third_party/blink/web_tests/fast/css/getComputedStyle/computed-style-without-renderer-listing-expected.txt
@@ -344,6 +344,7 @@ text-align: start text-align-last: auto text-anchor: start +text-autospace: normal text-box-trim: none text-decoration: none solid rgb(0, 0, 0) text-decoration-color: rgb(0, 0, 0)
diff --git a/third_party/blink/web_tests/flag-specific/disable-site-isolation-trials/virtual/scalefactor150/fast/hidpi/static/validation-bubble-appearance-hidpi-expected.png b/third_party/blink/web_tests/flag-specific/disable-site-isolation-trials/virtual/scalefactor150/fast/hidpi/static/validation-bubble-appearance-hidpi-expected.png index 46d18c04..866c3af9 100644 --- a/third_party/blink/web_tests/flag-specific/disable-site-isolation-trials/virtual/scalefactor150/fast/hidpi/static/validation-bubble-appearance-hidpi-expected.png +++ b/third_party/blink/web_tests/flag-specific/disable-site-isolation-trials/virtual/scalefactor150/fast/hidpi/static/validation-bubble-appearance-hidpi-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/disable-site-isolation-trials/virtual/scalefactor200/fast/hidpi/static/validation-bubble-appearance-hidpi-expected.png b/third_party/blink/web_tests/flag-specific/disable-site-isolation-trials/virtual/scalefactor200/fast/hidpi/static/validation-bubble-appearance-hidpi-expected.png index 30627d6..caf265b 100644 --- a/third_party/blink/web_tests/flag-specific/disable-site-isolation-trials/virtual/scalefactor200/fast/hidpi/static/validation-bubble-appearance-hidpi-expected.png +++ b/third_party/blink/web_tests/flag-specific/disable-site-isolation-trials/virtual/scalefactor200/fast/hidpi/static/validation-bubble-appearance-hidpi-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/http/tests/devtools/application-panel/resources-panel-idb-clear-for-storage-key.js b/third_party/blink/web_tests/http/tests/devtools/application-panel/resources-panel-idb-clear-for-storage-key.js index 1afc0897..ca8462c 100644 --- a/third_party/blink/web_tests/http/tests/devtools/application-panel/resources-panel-idb-clear-for-storage-key.js +++ b/third_party/blink/web_tests/http/tests/devtools/application-panel/resources-panel-idb-clear-for-storage-key.js
@@ -11,11 +11,9 @@ (async function() { TestRunner.addResult(`Validate IndexeddbModel clearForStorageKey\n`); - await TestRunner.loadLegacyModule('console'); // Note: every test that uses a storage API must manually clean-up state from previous tests. await ApplicationTestRunner.resetState(); - await TestRunner.loadLegacyModule('console'); await TestRunner.showPanel('resources'); const model = TestRunner.mainTarget.model(Resources.IndexedDBModel);
diff --git a/third_party/blink/web_tests/http/tests/devtools/application-panel/resources-panel-iframe-idb.js b/third_party/blink/web_tests/http/tests/devtools/application-panel/resources-panel-iframe-idb.js index dd7f2e6..9ed72921 100644 --- a/third_party/blink/web_tests/http/tests/devtools/application-panel/resources-panel-iframe-idb.js +++ b/third_party/blink/web_tests/http/tests/devtools/application-panel/resources-panel-iframe-idb.js
@@ -11,11 +11,9 @@ (async function() { TestRunner.addResult(`Tests Application Panel's handling of storages in iframes.\n`); - await TestRunner.loadLegacyModule('console'); // Note: every test that uses a storage API must manually clean-up state from previous tests. await ApplicationTestRunner.resetState(); - await TestRunner.loadLegacyModule('console'); await TestRunner.showPanel('resources'); function createIndexedDBInMainFrame(callback) {
diff --git a/third_party/blink/web_tests/http/tests/devtools/application-panel/resources-panel-on-navigation.js b/third_party/blink/web_tests/http/tests/devtools/application-panel/resources-panel-on-navigation.js index 57ede82..20cf4c41 100644 --- a/third_party/blink/web_tests/http/tests/devtools/application-panel/resources-panel-on-navigation.js +++ b/third_party/blink/web_tests/http/tests/devtools/application-panel/resources-panel-on-navigation.js
@@ -12,11 +12,9 @@ (async function() { TestRunner.addResult(`Tests Application Panel response to a main frame navigation.\n`); - await TestRunner.loadLegacyModule('console'); // Note: every test that uses a storage API must manually clean-up state from previous tests. await ApplicationTestRunner.resetState(); - await TestRunner.loadLegacyModule('console'); await TestRunner.showPanel('resources'); function createIndexedDB(callback) {
diff --git a/third_party/blink/web_tests/http/tests/devtools/application-panel/resources-panel-resource-preview.js b/third_party/blink/web_tests/http/tests/devtools/application-panel/resources-panel-resource-preview.js index b52dd4cb..474aec6 100644 --- a/third_party/blink/web_tests/http/tests/devtools/application-panel/resources-panel-resource-preview.js +++ b/third_party/blink/web_tests/http/tests/devtools/application-panel/resources-panel-resource-preview.js
@@ -13,11 +13,9 @@ (async function() { TestRunner.addResult(`Tests Application Panel preview for resources of different types.\n`); - await TestRunner.loadLegacyModule('console'); // Note: every test that uses a storage API must manually clean-up state from previous tests. await ApplicationTestRunner.resetState(); - await TestRunner.loadLegacyModule('console'); await TestRunner.loadLegacyModule('source_frame'); await TestRunner.showPanel('resources'); await TestRunner.loadHTML(`
diff --git a/third_party/blink/web_tests/http/tests/devtools/application-panel/resources-panel-selection-on-reload.js b/third_party/blink/web_tests/http/tests/devtools/application-panel/resources-panel-selection-on-reload.js index ddfc0b0..e0fa61c 100644 --- a/third_party/blink/web_tests/http/tests/devtools/application-panel/resources-panel-selection-on-reload.js +++ b/third_party/blink/web_tests/http/tests/devtools/application-panel/resources-panel-selection-on-reload.js
@@ -12,11 +12,9 @@ (async function() { TestRunner.addResult(`Tests Application Panel response to a main frame navigation.\n`); - await TestRunner.loadLegacyModule('console'); // Note: every test that uses a storage API must manually clean-up state from previous tests. await ApplicationTestRunner.resetState(); - await TestRunner.loadLegacyModule('console'); await TestRunner.showPanel('resources'); function createIndexedDB(callback) {
diff --git a/third_party/blink/web_tests/http/tests/devtools/bindings/contentscripts-navigator-multiple-frames-expected.txt b/third_party/blink/web_tests/http/tests/devtools/bindings/contentscripts-navigator-multiple-frames-expected.txt index 03ee3d3..1c3f91e 100644 --- a/third_party/blink/web_tests/http/tests/devtools/bindings/contentscripts-navigator-multiple-frames-expected.txt +++ b/third_party/blink/web_tests/http/tests/devtools/bindings/contentscripts-navigator-multiple-frames-expected.txt
@@ -29,5 +29,4 @@ content-script-42.js Running: detachFrame2 -top
diff --git a/third_party/blink/web_tests/http/tests/devtools/bindings/ignore-listed-sourcemap-detach.js b/third_party/blink/web_tests/http/tests/devtools/bindings/ignore-listed-sourcemap-detach.js index 1fc8c88..bfa229b9 100644 --- a/third_party/blink/web_tests/http/tests/devtools/bindings/ignore-listed-sourcemap-detach.js +++ b/third_party/blink/web_tests/http/tests/devtools/bindings/ignore-listed-sourcemap-detach.js
@@ -10,7 +10,6 @@ import * as BindingsModule from 'devtools/models/bindings/bindings.js'; (async function() { - await TestRunner.loadLegacyModule('console'); TestRunner.addResult(`Tests that ignore-listed sourcemaps properly detach on reload crbug.com/888688`); var content = `console.log(1);
diff --git a/third_party/blink/web_tests/http/tests/devtools/cache-storage/cache-data.js b/third_party/blink/web_tests/http/tests/devtools/cache-storage/cache-data.js index 13b9470..7005b19 100644 --- a/third_party/blink/web_tests/http/tests/devtools/cache-storage/cache-data.js +++ b/third_party/blink/web_tests/http/tests/devtools/cache-storage/cache-data.js
@@ -9,7 +9,6 @@ (async function() { TestRunner.addResult(`Tests that cache data is correctly populated in the Inspector.\n`); - await TestRunner.loadLegacyModule('console'); // Note: every test that uses a storage API must manually clean-up state from previous tests. await ApplicationTestRunner.resetState();
diff --git a/third_party/blink/web_tests/http/tests/devtools/cache-storage/cache-deletion.js b/third_party/blink/web_tests/http/tests/devtools/cache-storage/cache-deletion.js index 591e786..4ad7aed 100644 --- a/third_party/blink/web_tests/http/tests/devtools/cache-storage/cache-deletion.js +++ b/third_party/blink/web_tests/http/tests/devtools/cache-storage/cache-deletion.js
@@ -9,7 +9,6 @@ (async function() { TestRunner.addResult(`Tests that cache data is correctly deleted by the inspector.\n`); - await TestRunner.loadLegacyModule('console'); // Note: every test that uses a storage API must manually clean-up state from previous tests. await ApplicationTestRunner.resetState();
diff --git a/third_party/blink/web_tests/http/tests/devtools/cache-storage/cache-entry-deletion.js b/third_party/blink/web_tests/http/tests/devtools/cache-storage/cache-entry-deletion.js index 9204e3d..29b0e12 100644 --- a/third_party/blink/web_tests/http/tests/devtools/cache-storage/cache-entry-deletion.js +++ b/third_party/blink/web_tests/http/tests/devtools/cache-storage/cache-entry-deletion.js
@@ -9,7 +9,6 @@ (async function() { TestRunner.addResult(`Tests that cache entry data is correctly deleted by the inspector.\n`); - await TestRunner.loadLegacyModule('console'); // Note: every test that uses a storage API must manually clean-up state from previous tests. await ApplicationTestRunner.resetState();
diff --git a/third_party/blink/web_tests/http/tests/devtools/cache-storage/cache-live-update-cache-content.js b/third_party/blink/web_tests/http/tests/devtools/cache-storage/cache-live-update-cache-content.js index 407a0c7..d055dcc 100644 --- a/third_party/blink/web_tests/http/tests/devtools/cache-storage/cache-live-update-cache-content.js +++ b/third_party/blink/web_tests/http/tests/devtools/cache-storage/cache-live-update-cache-content.js
@@ -9,7 +9,6 @@ (async function() { TestRunner.addResult(`Tests that cache view updates when the cache is changed.\n`); - await TestRunner.loadLegacyModule('console'); // Note: every test that uses a storage API must manually clean-up state from previous tests. await ApplicationTestRunner.resetState();
diff --git a/third_party/blink/web_tests/http/tests/devtools/cache-storage/cache-live-update-list.js b/third_party/blink/web_tests/http/tests/devtools/cache-storage/cache-live-update-list.js index 5194712..6af2c98 100644 --- a/third_party/blink/web_tests/http/tests/devtools/cache-storage/cache-live-update-list.js +++ b/third_party/blink/web_tests/http/tests/devtools/cache-storage/cache-live-update-list.js
@@ -9,7 +9,6 @@ (async function() { TestRunner.addResult(`Tests that the cache storage list live updates.\n`); - await TestRunner.loadLegacyModule('console'); // Note: every test that uses a storage API must manually clean-up state from previous tests. await ApplicationTestRunner.resetState();
diff --git a/third_party/blink/web_tests/http/tests/devtools/cache-storage/cache-names.js b/third_party/blink/web_tests/http/tests/devtools/cache-storage/cache-names.js index 9fe47138..19b5b0e 100644 --- a/third_party/blink/web_tests/http/tests/devtools/cache-storage/cache-names.js +++ b/third_party/blink/web_tests/http/tests/devtools/cache-storage/cache-names.js
@@ -9,7 +9,6 @@ (async function() { TestRunner.addResult(`Tests that cache names are correctly loaded and displayed in the inspector.\n`); - await TestRunner.loadLegacyModule('console'); // Note: every test that uses a storage API must manually clean-up state from previous tests. await ApplicationTestRunner.resetState();
diff --git a/third_party/blink/web_tests/http/tests/devtools/change-iframe-src.js b/third_party/blink/web_tests/http/tests/devtools/change-iframe-src.js index 4d1655c..cb69c53 100644 --- a/third_party/blink/web_tests/http/tests/devtools/change-iframe-src.js +++ b/third_party/blink/web_tests/http/tests/devtools/change-iframe-src.js
@@ -9,7 +9,6 @@ (async function() { TestRunner.addResult( `Tests that Elements panel allows to change src attribute on iframes inside inspected page. See bug 41350.\n`); - await TestRunner.loadLegacyModule('console'); var messagePromise = new Promise(x => ConsoleTestRunner.addConsoleSniffer(x)); await TestRunner.loadHTML(`
diff --git a/third_party/blink/web_tests/http/tests/devtools/command-line-api-inspect.js b/third_party/blink/web_tests/http/tests/devtools/command-line-api-inspect.js index 188c9b8..f4b5971f 100644 --- a/third_party/blink/web_tests/http/tests/devtools/command-line-api-inspect.js +++ b/third_party/blink/web_tests/http/tests/devtools/command-line-api-inspect.js
@@ -11,7 +11,6 @@ (async function() { TestRunner.addResult(`Tests that inspect() command line api works.\n`); - await TestRunner.loadLegacyModule('console'); await TestRunner.loadHTML(` <p id="p1"> </p>
diff --git a/third_party/blink/web_tests/http/tests/devtools/compiler-source-mapping-debug-expected.txt b/third_party/blink/web_tests/http/tests/devtools/compiler-source-mapping-debug-expected.txt index bb9d8c1..dde4c90c 100644 --- a/third_party/blink/web_tests/http/tests/devtools/compiler-source-mapping-debug-expected.txt +++ b/third_party/blink/web_tests/http/tests/devtools/compiler-source-mapping-debug-expected.txt
@@ -6,6 +6,6 @@ Script execution paused. Call stack: 0) handleClick (add-elements.js:15) - 1) clickButton (compiler-source-mapping-debug.js:21) + 1) clickButton (compiler-source-mapping-debug.js:20) Script execution resumed.
diff --git a/third_party/blink/web_tests/http/tests/devtools/compiler-source-mapping-debug.js b/third_party/blink/web_tests/http/tests/devtools/compiler-source-mapping-debug.js index 12eaab09..cb6e529a 100644 --- a/third_party/blink/web_tests/http/tests/devtools/compiler-source-mapping-debug.js +++ b/third_party/blink/web_tests/http/tests/devtools/compiler-source-mapping-debug.js
@@ -9,7 +9,6 @@ (async function() { TestRunner.addResult(`Tests installing compiler source map in scripts panel.\n`); - await TestRunner.loadLegacyModule('console'); await TestRunner.showPanel('sources'); await TestRunner.addScriptTag('resources/compiled-2.js');
diff --git a/third_party/blink/web_tests/http/tests/devtools/console-cd.js b/third_party/blink/web_tests/http/tests/devtools/console-cd.js index 750fe0e..0385fe7 100644 --- a/third_party/blink/web_tests/http/tests/devtools/console-cd.js +++ b/third_party/blink/web_tests/http/tests/devtools/console-cd.js
@@ -7,7 +7,6 @@ (async function() { TestRunner.addResult(`Tests that console evaluation can be performed in an iframe context.Bug 19872.\n`); - await TestRunner.loadLegacyModule('console'); await TestRunner.addIframe("http://localhost:8000/devtools/resources/console-cd-iframe.html", { name: "myIFrame" });
diff --git a/third_party/blink/web_tests/http/tests/devtools/console-document-write-from-external-script-logging.js b/third_party/blink/web_tests/http/tests/devtools/console-document-write-from-external-script-logging.js index 764c344..4b7c64f 100644 --- a/third_party/blink/web_tests/http/tests/devtools/console-document-write-from-external-script-logging.js +++ b/third_party/blink/web_tests/http/tests/devtools/console-document-write-from-external-script-logging.js
@@ -8,7 +8,6 @@ (async function() { TestRunner.addResult( `Tests that ignored document.write() called from an external asynchronously loaded script is reported to console as a warning\n`); - await TestRunner.loadLegacyModule('console'); await TestRunner.evaluateInPagePromise(` function loadExternalScript() {
diff --git a/third_party/blink/web_tests/http/tests/devtools/console-show-all-messages.js b/third_party/blink/web_tests/http/tests/devtools/console-show-all-messages.js index 96a8925..c64de2d 100644 --- a/third_party/blink/web_tests/http/tests/devtools/console-show-all-messages.js +++ b/third_party/blink/web_tests/http/tests/devtools/console-show-all-messages.js
@@ -5,10 +5,11 @@ import {TestRunner} from 'test_runner'; import {ConsoleTestRunner} from 'console_test_runner'; +import * as Console from 'devtools/panels/console/console.js'; + (async function() { TestRunner.addResult( `Tests that console shows messages only from specific context when show target checkbox is checked.\n`); - await TestRunner.loadLegacyModule('console'); await TestRunner.showPanel('console'); await TestRunner.evaluateInPagePromise(` console.log("message from page!"); @@ -17,12 +18,12 @@ name: 'myIFrame' }); - var filterByExecutionContextSetting = Console.ConsoleView.instance().filter.filterByExecutionContextSetting; - Console.ConsoleView.instance().setImmediatelyFilterMessagesForTest(); + var filterByExecutionContextSetting = Console.ConsoleView.ConsoleView.instance().filter.filterByExecutionContextSetting; + Console.ConsoleView.ConsoleView.instance().setImmediatelyFilterMessagesForTest(); //we can't use usual ConsoleTestRunner.dumpConsoleMessages(), because it dumps url of message and it flakes in case of iframe function dumpVisibleConsoleMessageText() { - var messageViews = Console.ConsoleView.instance().visibleViewMessages; + var messageViews = Console.ConsoleView.ConsoleView.instance().visibleViewMessages; for (var i = 0; i < messageViews.length; ++i) { TestRunner.addResult(messageViews[i].consoleMessage().messageText); }
diff --git a/third_party/blink/web_tests/http/tests/devtools/console-sidebar/console-filter-sidebar-expected.txt b/third_party/blink/web_tests/http/tests/devtools/console-sidebar/console-filter-sidebar-expected.txt index d9e2016..9889a050a 100644 --- a/third_party/blink/web_tests/http/tests/devtools/console-sidebar/console-filter-sidebar-expected.txt +++ b/third_party/blink/web_tests/http/tests/devtools/console-sidebar/console-filter-sidebar-expected.txt
@@ -45,9 +45,9 @@ Running: selectingErrorGroup Selecting item: 1 error MESSAGES: -console-filter-sidebar.js:22 Error from test -error1 @ console-filter-sidebar.js:22 -(anonymous) @ console-filter-sidebar.js:58 +console-filter-sidebar.js:23 Error from test +error1 @ console-filter-sidebar.js:23 +(anonymous) @ console-filter-sidebar.js:59 SIDEBAR: > 4 messages @@ -71,7 +71,7 @@ log-source.js:3 Log from log-source log-source.js:8 Warning from log-source warn2 @ log-source.js:8 -(anonymous) @ console-filter-sidebar.js:54 +(anonymous) @ console-filter-sidebar.js:55 Running: clearConsole SIDEBAR:
diff --git a/third_party/blink/web_tests/http/tests/devtools/console-sidebar/console-filter-sidebar.js b/third_party/blink/web_tests/http/tests/devtools/console-sidebar/console-filter-sidebar.js index daf354d..6a0f7f4 100644 --- a/third_party/blink/web_tests/http/tests/devtools/console-sidebar/console-filter-sidebar.js +++ b/third_party/blink/web_tests/http/tests/devtools/console-sidebar/console-filter-sidebar.js
@@ -5,10 +5,11 @@ import {TestRunner} from 'test_runner'; import {ConsoleTestRunner} from 'console_test_runner'; +import * as Console from 'devtools/panels/console/console.js'; + (async function() { TestRunner.addResult(`Tests that console sidebar behaves properly.\n`); - await TestRunner.loadLegacyModule('console'); await TestRunner.showPanel('console'); await TestRunner.addScriptTag('resources/log-source.js'); await TestRunner.evaluateInPagePromise(` @@ -23,9 +24,9 @@ } `); - var consoleView = Console.ConsoleView.instance(); + var consoleView = Console.ConsoleView.ConsoleView.instance(); var sidebar = consoleView.sidebar; - var messages = Console.ConsoleView.instance().visibleViewMessages; + var messages = Console.ConsoleView.ConsoleView.instance().visibleViewMessages; consoleView.setImmediatelyFilterMessagesForTest(); if (!consoleView.isSidebarOpen) consoleView.splitWidget.showHideSidebarButton.element.click(); @@ -78,7 +79,7 @@ next(); }, async function clearConsole(next) { - Console.ConsoleView.clearConsole(); + Console.ConsoleView.ConsoleView.clearConsole(); dumpSidebar(); next(); }
diff --git a/third_party/blink/web_tests/http/tests/devtools/console-xhr-logging-async.js b/third_party/blink/web_tests/http/tests/devtools/console-xhr-logging-async.js index fdbd0d28..77e7aa1 100644 --- a/third_party/blink/web_tests/http/tests/devtools/console-xhr-logging-async.js +++ b/third_party/blink/web_tests/http/tests/devtools/console-xhr-logging-async.js
@@ -7,11 +7,11 @@ import {NetworkTestRunner} from 'network_test_runner'; import * as Common from 'devtools/core/common/common.js'; +import * as Console from 'devtools/panels/console/console.js'; (async function() { TestRunner.addResult( `Tests that XMLHttpRequest Logging works when Enabled and doesn't show logs when Disabled for asynchronous XHRs.\n`); - await TestRunner.loadLegacyModule('console'); step1(); @@ -27,7 +27,7 @@ // Sorting console messages to prevent flakiness. await ConsoleTestRunner.waitForPendingViewportUpdates(); TestRunner.addResults((await ConsoleTestRunner.dumpConsoleMessagesIntoArray()).sort()); - Console.ConsoleView.clearConsole(); + Console.ConsoleView.ConsoleView.clearConsole(); step2(); }); });
diff --git a/third_party/blink/web_tests/http/tests/devtools/console-xhr-logging.js b/third_party/blink/web_tests/http/tests/devtools/console-xhr-logging.js index ae0604e..b6b49d1 100644 --- a/third_party/blink/web_tests/http/tests/devtools/console-xhr-logging.js +++ b/third_party/blink/web_tests/http/tests/devtools/console-xhr-logging.js
@@ -9,8 +9,8 @@ import * as Common from 'devtools/core/common/common.js'; (async function() { - TestRunner.addResult(`Tests that XMLHttpRequest Logging works when Enabled and doesn't show logs when Disabled.\n`); - await TestRunner.loadLegacyModule('console'); + // This await is necessary for evaluateInPagePromise to produce accurate line numbers. + await TestRunner.addResult(`Tests that XMLHttpRequest Logging works when Enabled and doesn't show logs when Disabled.\n`); await TestRunner.evaluateInPagePromise(` function requestHelper(method, url) {
diff --git a/third_party/blink/web_tests/http/tests/devtools/console/command-line-api.js b/third_party/blink/web_tests/http/tests/devtools/console/command-line-api.js index 515980d8..df52389 100644 --- a/third_party/blink/web_tests/http/tests/devtools/console/command-line-api.js +++ b/third_party/blink/web_tests/http/tests/devtools/console/command-line-api.js
@@ -11,7 +11,6 @@ (async function() { TestRunner.addResult('Tests that command line api works.\n'); - await TestRunner.loadLegacyModule('console'); await TestRunner.showPanel('console'); await TestRunner.loadHTML(` <p id='foo'>
diff --git a/third_party/blink/web_tests/http/tests/devtools/console/console-Object-overwritten.js b/third_party/blink/web_tests/http/tests/devtools/console/console-Object-overwritten.js index d22de1c6..8e83f18 100644 --- a/third_party/blink/web_tests/http/tests/devtools/console/console-Object-overwritten.js +++ b/third_party/blink/web_tests/http/tests/devtools/console/console-Object-overwritten.js
@@ -9,7 +9,6 @@ TestRunner.addResult( `Tests that Web Inspector's console is not broken if Object is overwritten in the inspected page. Test passes if the expression is evaluated in the console and no errors printed. Bug 101320.\n`); - await TestRunner.loadLegacyModule('console'); await TestRunner.showPanel('console'); await TestRunner.evaluateInPagePromise(`
diff --git a/third_party/blink/web_tests/http/tests/devtools/console/console-api-on-call-frame.js b/third_party/blink/web_tests/http/tests/devtools/console/console-api-on-call-frame.js index 1552628..2e59491 100644 --- a/third_party/blink/web_tests/http/tests/devtools/console/console-api-on-call-frame.js +++ b/third_party/blink/web_tests/http/tests/devtools/console/console-api-on-call-frame.js
@@ -10,7 +10,6 @@ TestRunner.addResult( `Test that command line api does not mask values of scope variables while evaluating on a call frame.\n`); - await TestRunner.loadLegacyModule('console'); await TestRunner.showPanel('console'); await TestRunner.evaluateInPagePromise(`
diff --git a/third_party/blink/web_tests/http/tests/devtools/console/console-assert-expected.txt b/third_party/blink/web_tests/http/tests/devtools/console/console-assert-expected.txt index 4d61861..e0424ff 100644 --- a/third_party/blink/web_tests/http/tests/devtools/console/console-assert-expected.txt +++ b/third_party/blink/web_tests/http/tests/devtools/console/console-assert-expected.txt
@@ -1,13 +1,13 @@ Tests that console.assert() will dump a message and stack trace with source URLs and line numbers. -console-assert.js:17 Assertion failed: 1 +console-assert.js:16 Assertion failed: 1 +b @ console-assert.js:16 +a @ console-assert.js:22 +setTimeout (async) +(anonymous) @ console-assert.js:39 +console-assert.js:17 Assertion failed: a b b @ console-assert.js:17 -a @ console-assert.js:23 +a @ console-assert.js:22 setTimeout (async) -(anonymous) @ console-assert.js:40 -console-assert.js:18 Assertion failed: a b -b @ console-assert.js:18 -a @ console-assert.js:23 -setTimeout (async) -(anonymous) @ console-assert.js:40 +(anonymous) @ console-assert.js:39
diff --git a/third_party/blink/web_tests/http/tests/devtools/console/console-assert.js b/third_party/blink/web_tests/http/tests/devtools/console/console-assert.js index bb015fad..6f78efc 100644 --- a/third_party/blink/web_tests/http/tests/devtools/console/console-assert.js +++ b/third_party/blink/web_tests/http/tests/devtools/console/console-assert.js
@@ -8,7 +8,6 @@ (async function() { TestRunner.addResult('Tests that console.assert() will dump a message and stack trace with source URLs and line numbers.\n'); - await TestRunner.loadLegacyModule('console'); await TestRunner.showPanel('console'); await TestRunner.evaluateInPagePromise(`
diff --git a/third_party/blink/web_tests/http/tests/devtools/console/console-bad-stacktrace.js b/third_party/blink/web_tests/http/tests/devtools/console/console-bad-stacktrace.js index 2e0259ec..8590de5 100644 --- a/third_party/blink/web_tests/http/tests/devtools/console/console-bad-stacktrace.js +++ b/third_party/blink/web_tests/http/tests/devtools/console/console-bad-stacktrace.js
@@ -6,14 +6,14 @@ import {ConsoleTestRunner} from 'console_test_runner'; import * as SDK from 'devtools/core/sdk/sdk.js'; +import * as Console from 'devtools/panels/console/console.js'; (async function() { TestRunner.addResult('Tests that console messages with invalid stacktraces will still be rendered, crbug.com/826210\n'); - await TestRunner.loadLegacyModule('console'); await TestRunner.showPanel('console'); - var consoleView = Console.ConsoleView.instance(); + var consoleView = Console.ConsoleView.ConsoleView.instance(); consoleView.setImmediatelyFilterMessagesForTest(); // Add invalid message.
diff --git a/third_party/blink/web_tests/http/tests/devtools/console/console-big-array.js b/third_party/blink/web_tests/http/tests/devtools/console/console-big-array.js index 92bdaf9da..1138dfe 100644 --- a/third_party/blink/web_tests/http/tests/devtools/console/console-big-array.js +++ b/third_party/blink/web_tests/http/tests/devtools/console/console-big-array.js
@@ -5,10 +5,11 @@ import {TestRunner} from 'test_runner'; import {ConsoleTestRunner} from 'console_test_runner'; +import * as Console from 'devtools/panels/console/console.js'; + (async function() { TestRunner.addResult('Tests that console logging dumps large arrays properly.\n'); - await TestRunner.loadLegacyModule('console'); await TestRunner.showPanel('console'); await TestRunner.evaluateInPagePromise(` @@ -66,7 +67,7 @@ `); ObjectUI.ArrayGroupingTreeElement.bucketThreshold = 20; - var messages = Console.ConsoleView.instance().visibleViewMessages; + var messages = Console.ConsoleView.ConsoleView.instance().visibleViewMessages; var sections = []; for (var i = 0; i < messages.length; ++i) {
diff --git a/third_party/blink/web_tests/http/tests/devtools/console/console-bind-fake.js b/third_party/blink/web_tests/http/tests/devtools/console/console-bind-fake.js index ff04b50..a317e97 100644 --- a/third_party/blink/web_tests/http/tests/devtools/console/console-bind-fake.js +++ b/third_party/blink/web_tests/http/tests/devtools/console/console-bind-fake.js
@@ -8,7 +8,6 @@ (async function() { TestRunner.addResult(`Tests that overriding Function.prototype.bind does not break inspector.\n`); - await TestRunner.loadLegacyModule('console'); await TestRunner.showPanel('console'); await TestRunner.evaluateInPagePromise(`
diff --git a/third_party/blink/web_tests/http/tests/devtools/console/console-call-getter-on-proto-expected.txt b/third_party/blink/web_tests/http/tests/devtools/console/console-call-getter-on-proto-expected.txt index 99480f5..1cda37e 100644 --- a/third_party/blink/web_tests/http/tests/devtools/console/console-call-getter-on-proto-expected.txt +++ b/third_party/blink/web_tests/http/tests/devtools/console/console-call-getter-on-proto-expected.txt
@@ -1,6 +1,6 @@ Tests that calling getter on prototype will call it on the object. -console-call-getter-on-proto.js:30 B {value: 239} +console-call-getter-on-proto.js:29 B {value: 239} value: 239 foo: 239 [[Prototype]]: A
diff --git a/third_party/blink/web_tests/http/tests/devtools/console/console-call-getter-on-proto.js b/third_party/blink/web_tests/http/tests/devtools/console/console-call-getter-on-proto.js index 7319122..f5ace7c 100644 --- a/third_party/blink/web_tests/http/tests/devtools/console/console-call-getter-on-proto.js +++ b/third_party/blink/web_tests/http/tests/devtools/console/console-call-getter-on-proto.js
@@ -8,7 +8,6 @@ (async function() { TestRunner.addResult(`Tests that calling getter on prototype will call it on the object.\n`); - await TestRunner.loadLegacyModule('console'); await TestRunner.showPanel('console'); await TestRunner.evaluateInPagePromise(`
diff --git a/third_party/blink/web_tests/http/tests/devtools/console/console-clear-expected.txt b/third_party/blink/web_tests/http/tests/devtools/console/console-clear-expected.txt index 5570faf6..b5b7394 100644 --- a/third_party/blink/web_tests/http/tests/devtools/console/console-clear-expected.txt +++ b/third_party/blink/web_tests/http/tests/devtools/console/console-clear-expected.txt
@@ -1,8 +1,8 @@ Tests that console is cleared upon requestClearMessages call. === Before clear === -console-clear.js:14 one -console-clear.js:15 two -console-clear.js:16 three +console-clear.js:16 one +console-clear.js:17 two +console-clear.js:18 three === After clear ===
diff --git a/third_party/blink/web_tests/http/tests/devtools/console/console-clear-function-expected.txt b/third_party/blink/web_tests/http/tests/devtools/console/console-clear-function-expected.txt index bae1b018b..45d9d9db 100644 --- a/third_party/blink/web_tests/http/tests/devtools/console/console-clear-function-expected.txt +++ b/third_party/blink/web_tests/http/tests/devtools/console/console-clear-function-expected.txt
@@ -3,22 +3,22 @@ Running: clearFromConsoleAPI === Before clear === -console-clear-function.js:19 one -console-clear-function.js:20 two -console-clear-function.js:21 three +console-clear-function.js:18 one +console-clear-function.js:19 two +console-clear-function.js:20 three === After clear === -console-clear-function.js:26 Console was cleared +console-clear-function.js:25 Console was cleared Running: shouldNotClearWithPreserveLog === Before clear === -console-clear-function.js:26 Console was cleared -console-clear-function.js:19 one -console-clear-function.js:20 two -console-clear-function.js:21 three +console-clear-function.js:25 Console was cleared +console-clear-function.js:18 one +console-clear-function.js:19 two +console-clear-function.js:20 three === After clear === -console-clear-function.js:26 Console was cleared -console-clear-function.js:19 one -console-clear-function.js:20 two -console-clear-function.js:21 three -console-clear-function.js:26 console.clear() was prevented due to 'Preserve log' +console-clear-function.js:25 Console was cleared +console-clear-function.js:18 one +console-clear-function.js:19 two +console-clear-function.js:20 three +console-clear-function.js:25 console.clear() was prevented due to 'Preserve log'
diff --git a/third_party/blink/web_tests/http/tests/devtools/console/console-clear-function.js b/third_party/blink/web_tests/http/tests/devtools/console/console-clear-function.js index e3b1f97..ff36c6e 100644 --- a/third_party/blink/web_tests/http/tests/devtools/console/console-clear-function.js +++ b/third_party/blink/web_tests/http/tests/devtools/console/console-clear-function.js
@@ -10,7 +10,6 @@ (async function() { TestRunner.addResult(`Tests that console is cleared via console.clear() method\n`); - await TestRunner.loadLegacyModule('console'); await TestRunner.showPanel('console'); await TestRunner.evaluateInPagePromise(` function log()
diff --git a/third_party/blink/web_tests/http/tests/devtools/console/console-clear.js b/third_party/blink/web_tests/http/tests/devtools/console/console-clear.js index 01ef081..316c198cd 100644 --- a/third_party/blink/web_tests/http/tests/devtools/console/console-clear.js +++ b/third_party/blink/web_tests/http/tests/devtools/console/console-clear.js
@@ -5,6 +5,8 @@ import {TestRunner} from 'test_runner'; import {ConsoleTestRunner} from 'console_test_runner'; +import * as Console from 'devtools/panels/console/console.js'; + (async function() { TestRunner.addResult("Tests that console is cleared upon requestClearMessages call.\n"); @@ -18,7 +20,7 @@ TestRunner.addResult("=== Before clear ==="); await ConsoleTestRunner.dumpConsoleMessages(); - Console.ConsoleView.clearConsole(); + Console.ConsoleView.ConsoleView.clearConsole(); TestRunner.deprecatedRunAfterPendingDispatches(callback); async function callback() { TestRunner.addResult("=== After clear ===");
diff --git a/third_party/blink/web_tests/http/tests/devtools/console/console-command-clear-expected.txt b/third_party/blink/web_tests/http/tests/devtools/console/console-command-clear-expected.txt index fd35872e..64e892b 100644 --- a/third_party/blink/web_tests/http/tests/devtools/console/console-command-clear-expected.txt +++ b/third_party/blink/web_tests/http/tests/devtools/console/console-command-clear-expected.txt
@@ -1,9 +1,9 @@ Tests that console is cleared upon clear() eval in console. === Before clear === -console-command-clear.js:17 one -console-command-clear.js:18 two -console-command-clear.js:19 three +console-command-clear.js:16 one +console-command-clear.js:17 two +console-command-clear.js:18 three === After clear === VM:1 Console was cleared
diff --git a/third_party/blink/web_tests/http/tests/devtools/console/console-command-clear.js b/third_party/blink/web_tests/http/tests/devtools/console/console-command-clear.js index f01ea17..dcf980a9 100644 --- a/third_party/blink/web_tests/http/tests/devtools/console/console-command-clear.js +++ b/third_party/blink/web_tests/http/tests/devtools/console/console-command-clear.js
@@ -8,7 +8,6 @@ (async function() { TestRunner.addResult(`Tests that console is cleared upon clear() eval in console.\n`); - await TestRunner.loadLegacyModule('console'); await TestRunner.showPanel('console'); await TestRunner.evaluateInPagePromise(`
diff --git a/third_party/blink/web_tests/http/tests/devtools/console/console-command-copy.js b/third_party/blink/web_tests/http/tests/devtools/console/console-command-copy.js index 1cf5ab9..17ed59c3 100644 --- a/third_party/blink/web_tests/http/tests/devtools/console/console-command-copy.js +++ b/third_party/blink/web_tests/http/tests/devtools/console/console-command-copy.js
@@ -8,7 +8,6 @@ (async function() { TestRunner.addResult(`Tests that console's copy command is copying into front-end buffer.\n`); - await TestRunner.loadLegacyModule('console'); await TestRunner.showPanel('console'); var results = [];
diff --git a/third_party/blink/web_tests/http/tests/devtools/console/console-control-characters.js b/third_party/blink/web_tests/http/tests/devtools/console/console-control-characters.js index 9eb9dd9..53cde6a 100644 --- a/third_party/blink/web_tests/http/tests/devtools/console/console-control-characters.js +++ b/third_party/blink/web_tests/http/tests/devtools/console/console-control-characters.js
@@ -8,7 +8,6 @@ (async function() { TestRunner.addResult(`Verify that control characters are substituted with printable characters.\n`); - await TestRunner.loadLegacyModule('console'); await TestRunner.showPanel('console'); ConsoleTestRunner.evaluateInConsole('var\u001d i = 0;', onEvaluated);
diff --git a/third_party/blink/web_tests/http/tests/devtools/console/console-copy-treeoutline-expected.txt b/third_party/blink/web_tests/http/tests/devtools/console/console-copy-treeoutline-expected.txt index 3be39d2..d6e7a1a 100644 --- a/third_party/blink/web_tests/http/tests/devtools/console/console-copy-treeoutline-expected.txt +++ b/third_party/blink/web_tests/http/tests/devtools/console/console-copy-treeoutline-expected.txt
@@ -2,5 +2,5 @@ Running: testSelectAll -Selected text: console-copy-treeoutline.js:19 {foo: 1, bar: 'string'} +Selected text: console-copy-treeoutline.js:20 {foo: 1, bar: 'string'}
diff --git a/third_party/blink/web_tests/http/tests/devtools/console/console-copy-treeoutline.js b/third_party/blink/web_tests/http/tests/devtools/console/console-copy-treeoutline.js index 57f361d..71e3e10 100644 --- a/third_party/blink/web_tests/http/tests/devtools/console/console-copy-treeoutline.js +++ b/third_party/blink/web_tests/http/tests/devtools/console/console-copy-treeoutline.js
@@ -5,10 +5,11 @@ import {TestRunner} from 'test_runner'; import {ConsoleTestRunner} from 'console_test_runner'; +import * as Console from 'devtools/panels/console/console.js'; + (async function() { TestRunner.addResult(`Tests that console copies tree outline messages properly.\n`); - await TestRunner.loadLegacyModule('console'); await TestRunner.showPanel('console'); await TestRunner.evaluateInPagePromise(` @@ -20,7 +21,7 @@ `); ConsoleTestRunner.fixConsoleViewportDimensions(600, 200); - var consoleView = Console.ConsoleView.instance(); + var consoleView = Console.ConsoleView.ConsoleView.instance(); var viewport = consoleView.viewport; TestRunner.runTestSuite([async function testSelectAll(next) {
diff --git a/third_party/blink/web_tests/http/tests/devtools/console/console-copy-truncated-text.js b/third_party/blink/web_tests/http/tests/devtools/console/console-copy-truncated-text.js index 43e21d8..5c4ed19 100644 --- a/third_party/blink/web_tests/http/tests/devtools/console/console-copy-truncated-text.js +++ b/third_party/blink/web_tests/http/tests/devtools/console/console-copy-truncated-text.js
@@ -5,10 +5,11 @@ import {TestRunner} from 'test_runner'; import {ConsoleTestRunner} from 'console_test_runner'; +import * as Console from 'devtools/panels/console/console.js'; + (async function() { TestRunner.addResult(`Tests that console copies truncated text in messages properly.\n`); - await TestRunner.loadLegacyModule('console'); await TestRunner.showPanel('console'); var longUrl = 'www.' + 'z123456789'.repeat(15) + '.com'; @@ -30,8 +31,8 @@ `; var expectedMessageCount = 8; - var consoleView = Console.ConsoleView.instance(); - var viewport = Console.ConsoleView.instance().viewport; + var consoleView = Console.ConsoleView.ConsoleView.instance(); + var viewport = Console.ConsoleView.ConsoleView.instance().viewport; var maxLength; var halfMaxLength; var secondLongUrlIndexInMixedUrl;
diff --git a/third_party/blink/web_tests/http/tests/devtools/console/console-correct-suggestions.js b/third_party/blink/web_tests/http/tests/devtools/console/console-correct-suggestions.js index b14dc35..9c0cfc3e 100644 --- a/third_party/blink/web_tests/http/tests/devtools/console/console-correct-suggestions.js +++ b/third_party/blink/web_tests/http/tests/devtools/console/console-correct-suggestions.js
@@ -10,7 +10,6 @@ (async function() { TestRunner.addResult(`Tests that console correctly finds suggestions in complicated cases.\n`); - await TestRunner.loadLegacyModule('console'); await TestRunner.showPanel('console'); await TestRunner.evaluateInPagePromise(`
diff --git a/third_party/blink/web_tests/http/tests/devtools/console/console-custom-formatters-expected.txt b/third_party/blink/web_tests/http/tests/devtools/console/console-custom-formatters-expected.txt index bec02d6..5d95982 100644 --- a/third_party/blink/web_tests/http/tests/devtools/console/console-custom-formatters-expected.txt +++ b/third_party/blink/web_tests/http/tests/devtools/console/console-custom-formatters-expected.txt
@@ -1,9 +1,9 @@ Tests that console logging dumps properly when there are multiple custom formatters on the page -console-custom-formatters.js:123 Header formatted by 1 aBody formatted by 1 a -console-custom-formatters.js:124 Header formatted by 2 bBody formatted by 2 b -console-custom-formatters.js:125 Header formatted by 1 cBody formatted by 1 c -console-custom-formatters.js:126 Formatter with config Header info: additional infobodyinfo: additional info -console-custom-formatters.js:127 Formatter with config Formatter with config Formatter with config Formatter with config Formatter with config Formatter with config Formatter with config Formatter with config Formatter with config Formatter with config Object +console-custom-formatters.js:124 Header formatted by 1 aBody formatted by 1 a +console-custom-formatters.js:125 Header formatted by 2 bBody formatted by 2 b +console-custom-formatters.js:126 Header formatted by 1 cBody formatted by 1 c +console-custom-formatters.js:127 Formatter with config Header info: additional infobodyinfo: additional info +console-custom-formatters.js:128 Formatter with config Formatter with config Formatter with config Formatter with config Formatter with config Formatter with config Formatter with config Formatter with config Formatter with config Formatter with config Object Custom Formatter Failed: Uncaught Too deep hierarchy of inlined custom previews
diff --git a/third_party/blink/web_tests/http/tests/devtools/console/console-custom-formatters.js b/third_party/blink/web_tests/http/tests/devtools/console/console-custom-formatters.js index cb10045..638e371 100644 --- a/third_party/blink/web_tests/http/tests/devtools/console/console-custom-formatters.js +++ b/third_party/blink/web_tests/http/tests/devtools/console/console-custom-formatters.js
@@ -5,10 +5,11 @@ import {TestRunner} from 'test_runner'; import {ConsoleTestRunner} from 'console_test_runner'; +import * as Console from 'devtools/panels/console/console.js'; + (async function() { TestRunner.addResult('Tests that console logging dumps properly when there are multiple custom formatters on the page\n'); - await TestRunner.loadLegacyModule('console'); await TestRunner.showPanel('console'); await TestRunner.evaluateInPagePromise(` @@ -134,7 +135,7 @@ TestRunner.evaluateInPage('logVars()', expandVariablesInConsole); function expandVariablesInConsole() { - var consoleView = Console.ConsoleView.instance(); + var consoleView = Console.ConsoleView.ConsoleView.instance(); if (consoleView.needsFullUpdate) consoleView.updateMessageList();
diff --git a/third_party/blink/web_tests/http/tests/devtools/console/console-dir-deprecated-expected.txt b/third_party/blink/web_tests/http/tests/devtools/console/console-dir-deprecated-expected.txt index 665cab4b..cc73554 100644 --- a/third_party/blink/web_tests/http/tests/devtools/console/console-dir-deprecated-expected.txt +++ b/third_party/blink/web_tests/http/tests/devtools/console/console-dir-deprecated-expected.txt
@@ -1,5 +1,5 @@ Tests that console does not log deprecated warning messages while dir-dumping objects. -console-dir-deprecated.js:20 Window -console-dir-deprecated.js:21 undefined +console-dir-deprecated.js:19 Window +console-dir-deprecated.js:20 undefined
diff --git a/third_party/blink/web_tests/http/tests/devtools/console/console-dir-deprecated.js b/third_party/blink/web_tests/http/tests/devtools/console/console-dir-deprecated.js index 3de5ce8..d9d7f4f 100644 --- a/third_party/blink/web_tests/http/tests/devtools/console/console-dir-deprecated.js +++ b/third_party/blink/web_tests/http/tests/devtools/console/console-dir-deprecated.js
@@ -8,7 +8,6 @@ (async function() { TestRunner.addResult(`Tests that console does not log deprecated warning messages while dir-dumping objects.\n`); - await TestRunner.loadLegacyModule('console'); await TestRunner.showPanel('console'); await TestRunner.loadHTML(`
diff --git a/third_party/blink/web_tests/http/tests/devtools/console/console-dir-es6-expected.txt b/third_party/blink/web_tests/http/tests/devtools/console/console-dir-es6-expected.txt index df75e0f..6b4b1af 100644 --- a/third_party/blink/web_tests/http/tests/devtools/console/console-dir-es6-expected.txt +++ b/third_party/blink/web_tests/http/tests/devtools/console/console-dir-es6-expected.txt
@@ -1,61 +1,68 @@ Tests that console logging dumps proper messages. -console-dir-es6.js:23 Object +console-dir-es6.js:22 Object a: 1 Symbol(): 2 Symbol(Symbol.iterator): Symbol(foo) Symbol(a): 3 Symbol(a): Symbol(Symbol.iterator) [[Prototype]]: Object -console-dir-es6.js:26 Symbol() -console-dir-es6.js:30 Map(1) +console-dir-es6.js:25 Symbol() +console-dir-es6.js:29 Map(1) [[Entries]] 0: {Object => Object} size: 1 [[Prototype]]: Map -console-dir-es6.js:30 WeakMap +console-dir-es6.js:29 WeakMap [[Entries]] 0: {Object => Object} [[Prototype]]: WeakMap -console-dir-es6.js:34 Set(1) +console-dir-es6.js:33 Set(1) [[Entries]] 0: Object size: 1 [[Prototype]]: Set -console-dir-es6.js:34 WeakSet +console-dir-es6.js:33 WeakSet [[Entries]] 0: Object [[Prototype]]: WeakSet -console-dir-es6.js:42 Set(1) +console-dir-es6.js:41 Set(1) [[Entries]] 0: Set(1) size: 1 [[Prototype]]: Set -console-dir-es6.js:45 WeakMap +console-dir-es6.js:44 WeakMap [[Entries]] No properties [[Prototype]]: WeakMap -console-dir-es6.js:53 MapIterator +console-dir-es6.js:52 MapIterator [[Entries]] 0: Object [[Prototype]]: Map Iterator [[IteratorHasMore]]: true [[IteratorIndex]]: 0 [[IteratorKind]]: "keys" -console-dir-es6.js:54 MapIterator +console-dir-es6.js:53 MapIterator [[Entries]] 0: Object [[Prototype]]: Map Iterator [[IteratorHasMore]]: true [[IteratorIndex]]: 0 [[IteratorKind]]: "values" -console-dir-es6.js:55 MapIterator +console-dir-es6.js:54 MapIterator [[Entries]] 0: {Object => Object} [[Prototype]]: Map Iterator [[IteratorHasMore]]: true [[IteratorIndex]]: 0 [[IteratorKind]]: "entries" +console-dir-es6.js:52 SetIterator + [[Entries]] + 0: Object + [[Prototype]]: Set Iterator + [[IteratorHasMore]]: true + [[IteratorIndex]]: 0 + [[IteratorKind]]: "values" console-dir-es6.js:53 SetIterator [[Entries]] 0: Object @@ -65,19 +72,12 @@ [[IteratorKind]]: "values" console-dir-es6.js:54 SetIterator [[Entries]] - 0: Object - [[Prototype]]: Set Iterator - [[IteratorHasMore]]: true - [[IteratorIndex]]: 0 - [[IteratorKind]]: "values" -console-dir-es6.js:55 SetIterator - [[Entries]] 0: {Object => Object} [[Prototype]]: Set Iterator [[IteratorHasMore]]: true [[IteratorIndex]]: 0 [[IteratorKind]]: "entries" -console-dir-es6.js:93 Array(27) +console-dir-es6.js:92 Array(27) 0: class 1: class classWithWhitespace 2: class FooClass @@ -107,7 +107,7 @@ 26: ƒ (c = ")", {a: b}) length: 27 [[Prototype]]: Array(0) -console-dir-es6.js:101 Array(4) +console-dir-es6.js:100 Array(4) 0: badArrow(x = a => {…} 1: ƒ (a = ") 2: ƒ (a = function()
diff --git a/third_party/blink/web_tests/http/tests/devtools/console/console-dir-es6.js b/third_party/blink/web_tests/http/tests/devtools/console/console-dir-es6.js index 2adab26..b4024832 100644 --- a/third_party/blink/web_tests/http/tests/devtools/console/console-dir-es6.js +++ b/third_party/blink/web_tests/http/tests/devtools/console/console-dir-es6.js
@@ -8,7 +8,6 @@ (async function() { TestRunner.addResult('Tests that console logging dumps proper messages.\n'); - await TestRunner.loadLegacyModule('console'); await TestRunner.showPanel('console'); await TestRunner.evaluateInPagePromise(`
diff --git a/third_party/blink/web_tests/http/tests/devtools/console/console-dir-global.js b/third_party/blink/web_tests/http/tests/devtools/console/console-dir-global.js index 05e4e37c..07c857c0 100644 --- a/third_party/blink/web_tests/http/tests/devtools/console/console-dir-global.js +++ b/third_party/blink/web_tests/http/tests/devtools/console/console-dir-global.js
@@ -8,7 +8,6 @@ (async function() { TestRunner.addResult(`Tests that console dumps global object with properties.\n`); - await TestRunner.loadLegacyModule('console'); await TestRunner.showPanel('console'); await TestRunner.evaluateInPagePromise(`
diff --git a/third_party/blink/web_tests/http/tests/devtools/console/console-dir-primitives-expected.txt b/third_party/blink/web_tests/http/tests/devtools/console/console-dir-primitives-expected.txt index 8b8e5f0..992718d 100644 --- a/third_party/blink/web_tests/http/tests/devtools/console/console-dir-primitives-expected.txt +++ b/third_party/blink/web_tests/http/tests/devtools/console/console-dir-primitives-expected.txt
@@ -1,15 +1,15 @@ Tests that console dir makes messages expandable only when necessary. -Message text: console-dir-primitives.js:16 true +Message text: console-dir-primitives.js:17 true Message is not expandable -Message text: console-dir-primitives.js:17 Boolean +Message text: console-dir-primitives.js:18 Boolean Message is expandable -Message text: console-dir-primitives.js:19 foo +Message text: console-dir-primitives.js:20 foo Message is not expandable -Message text: console-dir-primitives.js:20 String +Message text: console-dir-primitives.js:21 String Message is expandable
diff --git a/third_party/blink/web_tests/http/tests/devtools/console/console-dir-primitives.js b/third_party/blink/web_tests/http/tests/devtools/console/console-dir-primitives.js index 7e1e326..2925337 100644 --- a/third_party/blink/web_tests/http/tests/devtools/console/console-dir-primitives.js +++ b/third_party/blink/web_tests/http/tests/devtools/console/console-dir-primitives.js
@@ -5,10 +5,11 @@ import {TestRunner} from 'test_runner'; import {ConsoleTestRunner} from 'console_test_runner'; +import * as Console from 'devtools/panels/console/console.js'; + (async function() { TestRunner.addResult(`Tests that console dir makes messages expandable only when necessary.\n`); - await TestRunner.loadLegacyModule('console'); await TestRunner.showPanel('console'); await TestRunner.evaluateInPagePromise(` @@ -22,7 +23,7 @@ //# sourceURL=console-dir-primitives.js `); - var consoleView = Console.ConsoleView.instance(); + var consoleView = Console.ConsoleView.ConsoleView.instance(); var viewMessages = consoleView.visibleViewMessages; for (var i = 0; i < viewMessages.length; ++i) { var messageElement = viewMessages[i].element();
diff --git a/third_party/blink/web_tests/http/tests/devtools/console/console-dir.js b/third_party/blink/web_tests/http/tests/devtools/console/console-dir.js index 9f748729..9ad41c9 100644 --- a/third_party/blink/web_tests/http/tests/devtools/console/console-dir.js +++ b/third_party/blink/web_tests/http/tests/devtools/console/console-dir.js
@@ -8,7 +8,6 @@ (async function() { TestRunner.addResult(`Tests that console logging dumps proper messages.\n`); - await TestRunner.loadLegacyModule('console'); await TestRunner.showPanel('console'); await TestRunner.evaluateInPagePromise(`
diff --git a/third_party/blink/web_tests/http/tests/devtools/console/console-dirxml-expected.txt b/third_party/blink/web_tests/http/tests/devtools/console/console-dirxml-expected.txt index fc43014e..89ef2fbb 100644 --- a/third_party/blink/web_tests/http/tests/devtools/console/console-dirxml-expected.txt +++ b/third_party/blink/web_tests/http/tests/devtools/console/console-dirxml-expected.txt
@@ -1,8 +1,8 @@ Tests that console logging dumps proper messages. -console-dirxml.js:20 #document -console-dirxml.js:21 #document-fragment -console-dirxml.js:22 <p></p> -console-dirxml.js:23 [p] -console-dirxml.js:24 (3) [document, document-fragment, span] +console-dirxml.js:19 #document +console-dirxml.js:20 #document-fragment +console-dirxml.js:21 <p></p> +console-dirxml.js:22 [p] +console-dirxml.js:23 (3) [document, document-fragment, span]
diff --git a/third_party/blink/web_tests/http/tests/devtools/console/console-dirxml.js b/third_party/blink/web_tests/http/tests/devtools/console/console-dirxml.js index dcfa511..efb26a24 100644 --- a/third_party/blink/web_tests/http/tests/devtools/console/console-dirxml.js +++ b/third_party/blink/web_tests/http/tests/devtools/console/console-dirxml.js
@@ -8,7 +8,6 @@ (async function() { TestRunner.addResult('Tests that console logging dumps proper messages.\n'); - await TestRunner.loadLegacyModule('console'); await TestRunner.showPanel('console'); await TestRunner.evaluateInPagePromise(`
diff --git a/third_party/blink/web_tests/http/tests/devtools/console/console-edit-expanded-tree.js b/third_party/blink/web_tests/http/tests/devtools/console/console-edit-expanded-tree.js index 8adac82..055e80f9 100644 --- a/third_party/blink/web_tests/http/tests/devtools/console/console-edit-expanded-tree.js +++ b/third_party/blink/web_tests/http/tests/devtools/console/console-edit-expanded-tree.js
@@ -6,11 +6,11 @@ import {ConsoleTestRunner} from 'console_test_runner'; import * as UIModule from 'devtools/ui/legacy/legacy.js'; +import * as Console from 'devtools/panels/console/console.js'; (async function() { TestRunner.addResult('Tests that expanded tree element is editable in console.\n'); - await TestRunner.loadLegacyModule('console'); await TestRunner.showPanel('console'); await TestRunner.evaluateInPagePromise(` @@ -27,7 +27,7 @@ ConsoleTestRunner.expandConsoleMessages(onConsoleMessageExpanded); function onConsoleMessageExpanded() { - var messages = Console.ConsoleView.instance().visibleViewMessages; + var messages = Console.ConsoleView.ConsoleView.instance().visibleViewMessages; for (var i = 0; i < messages.length; ++i) { var message = messages[i]; @@ -45,7 +45,7 @@ function onTreeElement(treeElement) { treeElement.startEditing(); - Console.ConsoleView.instance().viewport.refresh(); + Console.ConsoleView.ConsoleView.instance().viewport.refresh(); TestRunner.addResult('After viewport refresh tree element remains in editing mode: ' + !!treeElement.prompt); TestRunner.completeTest(); }
diff --git a/third_party/blink/web_tests/http/tests/devtools/console/console-edit-property-value-expected.txt b/third_party/blink/web_tests/http/tests/devtools/console/console-edit-property-value-expected.txt index 755d022..78fe683 100644 --- a/third_party/blink/web_tests/http/tests/devtools/console/console-edit-property-value-expected.txt +++ b/third_party/blink/web_tests/http/tests/devtools/console/console-edit-property-value-expected.txt
@@ -5,7 +5,7 @@ Node was hidden after dblclick: true Node was hidden after dblclick: true logToConsole() -console-edit-property-value.js:18 {a: 1, b: 'foo', c: null, d: 2} +console-edit-property-value.js:19 {a: 1, b: 'foo', c: null, d: 2} a: 3 b: "foo" c: (3) [1, 2, 3]
diff --git a/third_party/blink/web_tests/http/tests/devtools/console/console-edit-property-value.js b/third_party/blink/web_tests/http/tests/devtools/console/console-edit-property-value.js index fb3e549b..b77e86e 100644 --- a/third_party/blink/web_tests/http/tests/devtools/console/console-edit-property-value.js +++ b/third_party/blink/web_tests/http/tests/devtools/console/console-edit-property-value.js
@@ -5,10 +5,11 @@ import {TestRunner} from 'test_runner'; import {ConsoleTestRunner} from 'console_test_runner'; +import * as Console from 'devtools/panels/console/console.js'; + (async function() { TestRunner.addResult(`Tests that property values can be edited inline in the console via double click.\n`); - await TestRunner.loadLegacyModule('console'); await TestRunner.showPanel('console'); await TestRunner.evaluateInPagePromise(` @@ -55,7 +56,7 @@ } function getValueElements() { - var messageElement = Console.ConsoleView.instance().visibleViewMessages[1].element(); + var messageElement = Console.ConsoleView.ConsoleView.instance().visibleViewMessages[1].element(); return messageElement.querySelector('.console-message-text *').shadowRoot.querySelectorAll('.value'); } @@ -64,7 +65,7 @@ event.initMouseEvent('dblclick', true, true, null, 2); node.dispatchEvent(event); TestRunner.addResult('Node was hidden after dblclick: ' + node.classList.contains('hidden')); - var messageElement = Console.ConsoleView.instance().visibleViewMessages[1].element(); + var messageElement = Console.ConsoleView.ConsoleView.instance().visibleViewMessages[1].element(); var editPrompt = messageElement.querySelector('.console-message-text *').shadowRoot.querySelector('.text-prompt'); editPrompt.textContent = text; editPrompt.dispatchEvent(TestRunner.createKeyEvent('Enter'));
diff --git a/third_party/blink/web_tests/http/tests/devtools/console/console-error-on-call-frame-expected.txt b/third_party/blink/web_tests/http/tests/devtools/console/console-error-on-call-frame-expected.txt index c1f7c34..c64d4d21 100644 --- a/third_party/blink/web_tests/http/tests/devtools/console/console-error-on-call-frame-expected.txt +++ b/third_party/blink/web_tests/http/tests/devtools/console/console-error-on-call-frame-expected.txt
@@ -6,7 +6,7 @@ console.error(42) VM:1 42 eval @ VM:1 -testFunction @ console-error-on-call-frame.js:18 +testFunction @ console-error-on-call-frame.js:17 setTimeout (async) scheduleTestFunction @ VM:3 (anonymous) @ VM:1
diff --git a/third_party/blink/web_tests/http/tests/devtools/console/console-error-on-call-frame.js b/third_party/blink/web_tests/http/tests/devtools/console/console-error-on-call-frame.js index 23a7cb1..50a858e4 100644 --- a/third_party/blink/web_tests/http/tests/devtools/console/console-error-on-call-frame.js +++ b/third_party/blink/web_tests/http/tests/devtools/console/console-error-on-call-frame.js
@@ -9,7 +9,6 @@ (async function() { TestRunner.addResult(`Tests that console.error does not throw exception when executed in console on call frame.\n`); - await TestRunner.loadLegacyModule('console'); await TestRunner.showPanel('console'); await TestRunner.evaluateInPagePromise(` function testFunction()
diff --git a/third_party/blink/web_tests/http/tests/devtools/console/console-eval-blocked.js b/third_party/blink/web_tests/http/tests/devtools/console/console-eval-blocked.js index 955d6abd..e0c30df 100644 --- a/third_party/blink/web_tests/http/tests/devtools/console/console-eval-blocked.js +++ b/third_party/blink/web_tests/http/tests/devtools/console/console-eval-blocked.js
@@ -9,7 +9,6 @@ TestRunner.addResult( `Tests that evaluation in console still works even if script evals are prohibited by Content-Security-Policy. Bug 60800.\n`); - await TestRunner.loadLegacyModule('console'); await TestRunner.showPanel('console'); ConsoleTestRunner.evaluateInConsole('1+2', step1);
diff --git a/third_party/blink/web_tests/http/tests/devtools/console/console-eval-exception-report.js b/third_party/blink/web_tests/http/tests/devtools/console/console-eval-exception-report.js index 73e81ec..5dcd34f 100644 --- a/third_party/blink/web_tests/http/tests/devtools/console/console-eval-exception-report.js +++ b/third_party/blink/web_tests/http/tests/devtools/console/console-eval-exception-report.js
@@ -5,11 +5,12 @@ import {TestRunner} from 'test_runner'; import {ConsoleTestRunner} from 'console_test_runner'; +import * as Console from 'devtools/panels/console/console.js'; + (async function() { TestRunner.addResult( `Tests that evaluating an expression with an exception in the console provide correct exception information.\n`); - await TestRunner.loadLegacyModule('console'); await TestRunner.showPanel('console'); ConsoleTestRunner.evaluateInConsole('\ @@ -25,7 +26,7 @@ async function afterEvaluate() { await ConsoleTestRunner.dumpConsoleMessages(); - var viewMessages = Console.ConsoleView.instance().visibleViewMessages; + var viewMessages = Console.ConsoleView.ConsoleView.instance().visibleViewMessages; var uiMessage = viewMessages[viewMessages.length - 1]; var message = uiMessage.consoleMessage(); var stackTrace = message.stackTrace;
diff --git a/third_party/blink/web_tests/http/tests/devtools/console/console-eval-fake.js b/third_party/blink/web_tests/http/tests/devtools/console/console-eval-fake.js index 0f587e15..a9082bc 100644 --- a/third_party/blink/web_tests/http/tests/devtools/console/console-eval-fake.js +++ b/third_party/blink/web_tests/http/tests/devtools/console/console-eval-fake.js
@@ -8,7 +8,6 @@ (async function() { TestRunner.addResult(`Tests that overriding window.eval does not break inspector.\n`); - await TestRunner.loadLegacyModule('console'); await TestRunner.showPanel('console'); await TestRunner.evaluateInPagePromise(`
diff --git a/third_party/blink/web_tests/http/tests/devtools/console/console-eval-global.js b/third_party/blink/web_tests/http/tests/devtools/console/console-eval-global.js index c8e0bac..b17eced 100644 --- a/third_party/blink/web_tests/http/tests/devtools/console/console-eval-global.js +++ b/third_party/blink/web_tests/http/tests/devtools/console/console-eval-global.js
@@ -8,7 +8,6 @@ (async function() { TestRunner.addResult(`Tests that simple evaluations may be performed in the console on global object.\n`); - await TestRunner.loadLegacyModule('console'); await TestRunner.showPanel('console'); await TestRunner.evaluateInPagePromise(`
diff --git a/third_party/blink/web_tests/http/tests/devtools/console/console-eval-scoped-expected.txt b/third_party/blink/web_tests/http/tests/devtools/console/console-eval-scoped-expected.txt index 6c39d7b..26309fb 100644 --- a/third_party/blink/web_tests/http/tests/devtools/console/console-eval-scoped-expected.txt +++ b/third_party/blink/web_tests/http/tests/devtools/console/console-eval-scoped-expected.txt
@@ -2,7 +2,7 @@ Running: testSnippet1 -console-eval-scoped.js:72 with: Object property value +console-eval-scoped.js:73 with: Object property value VM:1 eval in with: Object property value Running: testSnippet2
diff --git a/third_party/blink/web_tests/http/tests/devtools/console/console-eval-scoped.js b/third_party/blink/web_tests/http/tests/devtools/console/console-eval-scoped.js index 5d1bdbb..49fdc7b 100644 --- a/third_party/blink/web_tests/http/tests/devtools/console/console-eval-scoped.js +++ b/third_party/blink/web_tests/http/tests/devtools/console/console-eval-scoped.js
@@ -5,13 +5,14 @@ import {TestRunner} from 'test_runner'; import {ConsoleTestRunner} from 'console_test_runner'; +import * as Console from 'devtools/panels/console/console.js'; + (async function() { 'use strict'; TestRunner.addResult( `Tests that evaluating 'console.log()' in the console will have access to its outer scope variables. Bug 60547.\n` ); - await TestRunner.loadLegacyModule('console'); await TestRunner.showPanel('console'); await TestRunner.evaluateInPagePromise(` @@ -60,7 +61,7 @@ function dumpAndClearConsoleMessages(next) { TestRunner.deprecatedRunAfterPendingDispatches(async function() { await ConsoleTestRunner.dumpConsoleMessages(); - Console.ConsoleView.clearConsole(); + Console.ConsoleView.ConsoleView.clearConsole(); TestRunner.deprecatedRunAfterPendingDispatches(next); }); }
diff --git a/third_party/blink/web_tests/http/tests/devtools/console/console-eval-syntax-error.js b/third_party/blink/web_tests/http/tests/devtools/console/console-eval-syntax-error.js index 4a14a21..4689673 100644 --- a/third_party/blink/web_tests/http/tests/devtools/console/console-eval-syntax-error.js +++ b/third_party/blink/web_tests/http/tests/devtools/console/console-eval-syntax-error.js
@@ -9,7 +9,6 @@ TestRunner.addResult( `Tests that evaluating an expression with a syntax error in the console won't crash the browser. Bug 61194.\n`); - await TestRunner.loadLegacyModule('console'); await TestRunner.showPanel('console'); ConsoleTestRunner.evaluateInConsole('foo().', step1);
diff --git a/third_party/blink/web_tests/http/tests/devtools/console/console-eval-throw.js b/third_party/blink/web_tests/http/tests/devtools/console/console-eval-throw.js index f9b384d..c2d0d41 100644 --- a/third_party/blink/web_tests/http/tests/devtools/console/console-eval-throw.js +++ b/third_party/blink/web_tests/http/tests/devtools/console/console-eval-throw.js
@@ -6,19 +6,19 @@ import {ConsoleTestRunner} from 'console_test_runner'; import * as SDK from 'devtools/core/sdk/sdk.js'; +import * as Console from 'devtools/panels/console/console.js'; (async function() { TestRunner.addResult( `Tests that evaluating 'throw undefined|1|string|object|Error' in the console won't crash the browser and correctly reported. Bug 59611.\n`); - await TestRunner.loadLegacyModule('console'); await TestRunner.showPanel('console'); async function dumpMessages(next, message) { await ConsoleTestRunner.dumpConsoleMessagesIgnoreErrorStackFrames(); const consoleModel = SDK.TargetManager.TargetManager.instance().primaryPageTarget().model(SDK.ConsoleModel.ConsoleModel); consoleModel.addEventListener(SDK.ConsoleModel.Events.ConsoleCleared, afterCleared); - Console.ConsoleView.clearConsole(); + Console.ConsoleView.ConsoleView.clearConsole(); function afterCleared() { consoleModel.removeEventListener(SDK.ConsoleModel.Events.ConsoleCleared, afterCleared);
diff --git a/third_party/blink/web_tests/http/tests/devtools/console/console-eval-undefined-override.js b/third_party/blink/web_tests/http/tests/devtools/console/console-eval-undefined-override.js index adcccc1..f7b2e17 100644 --- a/third_party/blink/web_tests/http/tests/devtools/console/console-eval-undefined-override.js +++ b/third_party/blink/web_tests/http/tests/devtools/console/console-eval-undefined-override.js
@@ -9,7 +9,6 @@ TestRunner.addResult( `Tests that evaluating something in console won't crash the browser if undefined value is overriden. The test passes if it doesn't crash. Bug 64155.\n`); - await TestRunner.loadLegacyModule('console'); await TestRunner.showPanel('console'); ConsoleTestRunner.evaluateInConsole('var x = {a:1}; x.self = x; undefined = x;', step1);
diff --git a/third_party/blink/web_tests/http/tests/devtools/console/console-eval.js b/third_party/blink/web_tests/http/tests/devtools/console/console-eval.js index 06d56d5c..f176101b 100644 --- a/third_party/blink/web_tests/http/tests/devtools/console/console-eval.js +++ b/third_party/blink/web_tests/http/tests/devtools/console/console-eval.js
@@ -8,7 +8,6 @@ (async function() { TestRunner.addResult(`Tests that simple evaluations may be performed in the console.\n`); - await TestRunner.loadLegacyModule('console'); await TestRunner.showPanel('console'); ConsoleTestRunner.evaluateInConsole('1+2', step2);
diff --git a/third_party/blink/web_tests/http/tests/devtools/console/console-expand-removed-node-expected.txt b/third_party/blink/web_tests/http/tests/devtools/console/console-expand-removed-node-expected.txt index aec12ee3..94ffb90 100644 --- a/third_party/blink/web_tests/http/tests/devtools/console/console-expand-removed-node-expected.txt +++ b/third_party/blink/web_tests/http/tests/devtools/console/console-expand-removed-node-expected.txt
@@ -1,8 +1,8 @@ Tests that removed Elements logged in the Console are properly formatted. Adding element -console-expand-removed-node.js:22 <div>…</div> +console-expand-removed-node.js:23 <div>…</div> Removing element Expanding element in Console -console-expand-removed-node.js:22 <div></div> +console-expand-removed-node.js:23 <div></div>
diff --git a/third_party/blink/web_tests/http/tests/devtools/console/console-expand-removed-node.js b/third_party/blink/web_tests/http/tests/devtools/console/console-expand-removed-node.js index 8cfa3385..f19a59a4 100644 --- a/third_party/blink/web_tests/http/tests/devtools/console/console-expand-removed-node.js +++ b/third_party/blink/web_tests/http/tests/devtools/console/console-expand-removed-node.js
@@ -5,9 +5,10 @@ import {TestRunner} from 'test_runner'; import {ConsoleTestRunner} from 'console_test_runner'; +import * as Console from 'devtools/panels/console/console.js'; + (async function() { TestRunner.addResult(`Tests that removed Elements logged in the Console are properly formatted.\n`); - await TestRunner.loadLegacyModule('console'); await TestRunner.showPanel('console'); TestRunner.addResult(`Adding element`); @@ -18,7 +19,7 @@ document.body.appendChild(el); undefined; `); - const nodePromise = TestRunner.addSnifferPromise(Console.ConsoleViewMessage.prototype, 'formattedParameterAsNodeForTest'); + const nodePromise = TestRunner.addSnifferPromise(Console.ConsoleViewMessage.ConsoleViewMessage.prototype, 'formattedParameterAsNodeForTest'); TestRunner.evaluateInPagePromise(`console.log(el)`); await nodePromise; await ConsoleTestRunner.waitForPendingViewportUpdates();
diff --git a/third_party/blink/web_tests/http/tests/devtools/console/console-export-expected.txt b/third_party/blink/web_tests/http/tests/devtools/console/console-export-expected.txt index 8828b3f..e82aaab 100644 --- a/third_party/blink/web_tests/http/tests/devtools/console/console-export-expected.txt +++ b/third_party/blink/web_tests/http/tests/devtools/console/console-export-expected.txt
@@ -2,28 +2,28 @@ Dumping messages -console-export.js:20 foo -console-export.js:21 www.chromium.org -console-export.js:22 baaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaar -console-export.js:23 www.loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo…ooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooongurl.com -console-export.js:24 www.chromium.org www.loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo…ooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooongurl.com foo baaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaar www.chromium.org www.loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo…ooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooongurl.com -console-export.js:25 My important trace -log @ console-export.js:25 -(anonymous) @ console-export.js:28 -console-export.js:26 My error +console-export.js:21 foo +console-export.js:22 www.chromium.org +console-export.js:23 baaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaar +console-export.js:24 www.loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo…ooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooongurl.com +console-export.js:25 www.chromium.org www.loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo…ooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooongurl.com foo baaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaar www.chromium.org www.loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo…ooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooongurl.com +console-export.js:26 My important trace log @ console-export.js:26 -(anonymous) @ console-export.js:28 +(anonymous) @ console-export.js:29 +console-export.js:27 My error +log @ console-export.js:27 +(anonymous) @ console-export.js:29 Dumping export strings -console-export.js:20 foo -console-export.js:21 www.chromium.org -console-export.js:22 baaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaar -console-export.js:23 www.loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooongurl.com -console-export.js:24 www.chromium.org www.loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooongurl.com foo baaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaar www.chromium.org www.loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooongurl.com -console-export.js:25 My important trace -log @ console-export.js:25 -(anonymous) @ console-export.js:28 -console-export.js:26 My error +console-export.js:21 foo +console-export.js:22 www.chromium.org +console-export.js:23 baaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaar +console-export.js:24 www.loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooongurl.com +console-export.js:25 www.chromium.org www.loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooongurl.com foo baaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaar www.chromium.org www.loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooongurl.com +console-export.js:26 My important trace log @ console-export.js:26 -(anonymous) @ console-export.js:28 +(anonymous) @ console-export.js:29 +console-export.js:27 My error +log @ console-export.js:27 +(anonymous) @ console-export.js:29
diff --git a/third_party/blink/web_tests/http/tests/devtools/console/console-export.js b/third_party/blink/web_tests/http/tests/devtools/console/console-export.js index 261a751..30a223b 100644 --- a/third_party/blink/web_tests/http/tests/devtools/console/console-export.js +++ b/third_party/blink/web_tests/http/tests/devtools/console/console-export.js
@@ -5,10 +5,11 @@ import {TestRunner} from 'test_runner'; import {ConsoleTestRunner} from 'console_test_runner'; +import * as Console from 'devtools/panels/console/console.js'; + (async function() { TestRunner.addResult(`Tests that exporting console messages produces proper output.\n`); - await TestRunner.loadLegacyModule('console'); await TestRunner.showPanel('console'); await TestRunner.evaluateInPagePromise(` @@ -31,7 +32,7 @@ TestRunner.addResult('\nDumping messages'); await ConsoleTestRunner.dumpConsoleMessages(); TestRunner.addResult('\nDumping export strings'); - var consoleView = Console.ConsoleView.instance(); + var consoleView = Console.ConsoleView.ConsoleView.instance(); consoleView.visibleViewMessages.forEach(message => TestRunner.addResult(message.toExportString())); TestRunner.completeTest(); })();
diff --git a/third_party/blink/web_tests/http/tests/devtools/console/console-external-array-expected.txt b/third_party/blink/web_tests/http/tests/devtools/console/console-external-array-expected.txt index b280d6ca..2a02e082 100644 --- a/third_party/blink/web_tests/http/tests/devtools/console/console-external-array-expected.txt +++ b/third_party/blink/web_tests/http/tests/devtools/console/console-external-array-expected.txt
@@ -1,19 +1,19 @@ Tests that console logging detects external arrays as arrays. -console-external-array.js:17 Int8Array(10) [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, buffer: ArrayBuffer(10), byteLength: 10, byteOffset: 0, length: 10, Symbol(Symbol.toStringTag): 'Int8Array'] -console-external-array.js:18 Int16Array(10) [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, buffer: ArrayBuffer(20), byteLength: 20, byteOffset: 0, length: 10, Symbol(Symbol.toStringTag): 'Int16Array'] -console-external-array.js:19 Int32Array(10) [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, buffer: ArrayBuffer(40), byteLength: 40, byteOffset: 0, length: 10, Symbol(Symbol.toStringTag): 'Int32Array'] -console-external-array.js:20 Uint8Array(10) [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, buffer: ArrayBuffer(10), byteLength: 10, byteOffset: 0, length: 10, Symbol(Symbol.toStringTag): 'Uint8Array'] -console-external-array.js:21 Uint16Array(10) [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, buffer: ArrayBuffer(20), byteLength: 20, byteOffset: 0, length: 10, Symbol(Symbol.toStringTag): 'Uint16Array'] -console-external-array.js:22 Uint32Array(10) [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, buffer: ArrayBuffer(40), byteLength: 40, byteOffset: 0, length: 10, Symbol(Symbol.toStringTag): 'Uint32Array'] -console-external-array.js:23 Float32Array(10) [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, buffer: ArrayBuffer(40), byteLength: 40, byteOffset: 0, length: 10, Symbol(Symbol.toStringTag): 'Float32Array'] -console-external-array.js:24 Float64Array(10) [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, buffer: ArrayBuffer(80), byteLength: 80, byteOffset: 0, length: 10, Symbol(Symbol.toStringTag): 'Float64Array'] -console-external-array.js:26 Int8Array(10) -console-external-array.js:27 Int16Array(10) -console-external-array.js:28 Int32Array(10) -console-external-array.js:29 Uint8Array(10) -console-external-array.js:30 Uint16Array(10) -console-external-array.js:31 Uint32Array(10) -console-external-array.js:32 Float32Array(10) -console-external-array.js:33 Float64Array(10) +console-external-array.js:16 Int8Array(10) [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, buffer: ArrayBuffer(10), byteLength: 10, byteOffset: 0, length: 10, Symbol(Symbol.toStringTag): 'Int8Array'] +console-external-array.js:17 Int16Array(10) [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, buffer: ArrayBuffer(20), byteLength: 20, byteOffset: 0, length: 10, Symbol(Symbol.toStringTag): 'Int16Array'] +console-external-array.js:18 Int32Array(10) [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, buffer: ArrayBuffer(40), byteLength: 40, byteOffset: 0, length: 10, Symbol(Symbol.toStringTag): 'Int32Array'] +console-external-array.js:19 Uint8Array(10) [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, buffer: ArrayBuffer(10), byteLength: 10, byteOffset: 0, length: 10, Symbol(Symbol.toStringTag): 'Uint8Array'] +console-external-array.js:20 Uint16Array(10) [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, buffer: ArrayBuffer(20), byteLength: 20, byteOffset: 0, length: 10, Symbol(Symbol.toStringTag): 'Uint16Array'] +console-external-array.js:21 Uint32Array(10) [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, buffer: ArrayBuffer(40), byteLength: 40, byteOffset: 0, length: 10, Symbol(Symbol.toStringTag): 'Uint32Array'] +console-external-array.js:22 Float32Array(10) [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, buffer: ArrayBuffer(40), byteLength: 40, byteOffset: 0, length: 10, Symbol(Symbol.toStringTag): 'Float32Array'] +console-external-array.js:23 Float64Array(10) [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, buffer: ArrayBuffer(80), byteLength: 80, byteOffset: 0, length: 10, Symbol(Symbol.toStringTag): 'Float64Array'] +console-external-array.js:25 Int8Array(10) +console-external-array.js:26 Int16Array(10) +console-external-array.js:27 Int32Array(10) +console-external-array.js:28 Uint8Array(10) +console-external-array.js:29 Uint16Array(10) +console-external-array.js:30 Uint32Array(10) +console-external-array.js:31 Float32Array(10) +console-external-array.js:32 Float64Array(10)
diff --git a/third_party/blink/web_tests/http/tests/devtools/console/console-external-array.js b/third_party/blink/web_tests/http/tests/devtools/console/console-external-array.js index e2ea840..66ea294 100644 --- a/third_party/blink/web_tests/http/tests/devtools/console/console-external-array.js +++ b/third_party/blink/web_tests/http/tests/devtools/console/console-external-array.js
@@ -8,7 +8,6 @@ (async function() { TestRunner.addResult('Tests that console logging detects external arrays as arrays.\n'); - await TestRunner.loadLegacyModule('console'); await TestRunner.showPanel('console'); await TestRunner.evaluateInPagePromise(`
diff --git a/third_party/blink/web_tests/http/tests/devtools/console/console-filter-level-test-expected.txt b/third_party/blink/web_tests/http/tests/devtools/console/console-filter-level-test-expected.txt index c2c36bb..2b04d3e 100644 --- a/third_party/blink/web_tests/http/tests/devtools/console/console-filter-level-test-expected.txt +++ b/third_party/blink/web_tests/http/tests/devtools/console/console-filter-level-test-expected.txt
@@ -20,81 +20,81 @@ Running: beforeFilter beforeFilter Level menu: Default levels ->console-filter-level-test.js:15 sample info ->console-filter-level-test.js:16 sample log ->console-filter-level-test.js:17 sample warning -(anonymous) @ console-filter-level-test.js:17 ->console-filter-level-test.js:19 sample error -(anonymous) @ console-filter-level-test.js:19 ->console-filter-level-test.js:21 abc info ->console-filter-level-test.js:22 def info ->console-filter-level-test.js:24 abc warn -(anonymous) @ console-filter-level-test.js:24 ->console-filter-level-test.js:25 def warn +>console-filter-level-test.js:16 sample info +>console-filter-level-test.js:17 sample log +>console-filter-level-test.js:18 sample warning +(anonymous) @ console-filter-level-test.js:18 +>console-filter-level-test.js:20 sample error +(anonymous) @ console-filter-level-test.js:20 +>console-filter-level-test.js:22 abc info +>console-filter-level-test.js:23 def info +>console-filter-level-test.js:25 abc warn (anonymous) @ console-filter-level-test.js:25 +>console-filter-level-test.js:26 def warn +(anonymous) @ console-filter-level-test.js:26 >'Should be always visible' >'Should be always visible' Running: allLevels Level menu: All levels ->console-filter-level-test.js:15 sample info ->console-filter-level-test.js:16 sample log ->console-filter-level-test.js:17 sample warning -(anonymous) @ console-filter-level-test.js:17 ->console-filter-level-test.js:18 sample debug ->console-filter-level-test.js:19 sample error -(anonymous) @ console-filter-level-test.js:19 ->console-filter-level-test.js:21 abc info ->console-filter-level-test.js:22 def info ->console-filter-level-test.js:24 abc warn -(anonymous) @ console-filter-level-test.js:24 ->console-filter-level-test.js:25 def warn +>console-filter-level-test.js:16 sample info +>console-filter-level-test.js:17 sample log +>console-filter-level-test.js:18 sample warning +(anonymous) @ console-filter-level-test.js:18 +>console-filter-level-test.js:19 sample debug +>console-filter-level-test.js:20 sample error +(anonymous) @ console-filter-level-test.js:20 +>console-filter-level-test.js:22 abc info +>console-filter-level-test.js:23 def info +>console-filter-level-test.js:25 abc warn (anonymous) @ console-filter-level-test.js:25 +>console-filter-level-test.js:26 def warn +(anonymous) @ console-filter-level-test.js:26 >'Should be always visible' >'Should be always visible' Running: defaultLevels Level menu: Default levels ->console-filter-level-test.js:15 sample info ->console-filter-level-test.js:16 sample log ->console-filter-level-test.js:17 sample warning -(anonymous) @ console-filter-level-test.js:17 ->console-filter-level-test.js:19 sample error -(anonymous) @ console-filter-level-test.js:19 ->console-filter-level-test.js:21 abc info ->console-filter-level-test.js:22 def info ->console-filter-level-test.js:24 abc warn -(anonymous) @ console-filter-level-test.js:24 ->console-filter-level-test.js:25 def warn +>console-filter-level-test.js:16 sample info +>console-filter-level-test.js:17 sample log +>console-filter-level-test.js:18 sample warning +(anonymous) @ console-filter-level-test.js:18 +>console-filter-level-test.js:20 sample error +(anonymous) @ console-filter-level-test.js:20 +>console-filter-level-test.js:22 abc info +>console-filter-level-test.js:23 def info +>console-filter-level-test.js:25 abc warn (anonymous) @ console-filter-level-test.js:25 +>console-filter-level-test.js:26 def warn +(anonymous) @ console-filter-level-test.js:26 >'Should be always visible' >'Should be always visible' Running: verbose Level menu: Verbose only ->console-filter-level-test.js:18 sample debug +>console-filter-level-test.js:19 sample debug >'Should be always visible' >'Should be always visible' Running: info Level menu: Info only ->console-filter-level-test.js:15 sample info ->console-filter-level-test.js:16 sample log ->console-filter-level-test.js:21 abc info ->console-filter-level-test.js:22 def info +>console-filter-level-test.js:16 sample info +>console-filter-level-test.js:17 sample log +>console-filter-level-test.js:22 abc info +>console-filter-level-test.js:23 def info >'Should be always visible' >'Should be always visible' Running: warningsAndErrors Level menu: Custom levels ->console-filter-level-test.js:17 sample warning -(anonymous) @ console-filter-level-test.js:17 ->console-filter-level-test.js:19 sample error -(anonymous) @ console-filter-level-test.js:19 ->console-filter-level-test.js:24 abc warn -(anonymous) @ console-filter-level-test.js:24 ->console-filter-level-test.js:25 def warn +>console-filter-level-test.js:18 sample warning +(anonymous) @ console-filter-level-test.js:18 +>console-filter-level-test.js:20 sample error +(anonymous) @ console-filter-level-test.js:20 +>console-filter-level-test.js:25 abc warn (anonymous) @ console-filter-level-test.js:25 +>console-filter-level-test.js:26 def warn +(anonymous) @ console-filter-level-test.js:26 >'Should be always visible' >'Should be always visible' @@ -110,8 +110,8 @@ Running: abcMessageRegexWarning Level menu: Warnings only ->console-filter-level-test.js:24 abc warn -(anonymous) @ console-filter-level-test.js:24 +>console-filter-level-test.js:25 abc warn +(anonymous) @ console-filter-level-test.js:25 >'Should be always visible' >'Should be always visible'
diff --git a/third_party/blink/web_tests/http/tests/devtools/console/console-filter-level-test.js b/third_party/blink/web_tests/http/tests/devtools/console/console-filter-level-test.js index e5a4a7d..d33cea3 100644 --- a/third_party/blink/web_tests/http/tests/devtools/console/console-filter-level-test.js +++ b/third_party/blink/web_tests/http/tests/devtools/console/console-filter-level-test.js
@@ -5,10 +5,11 @@ import {TestRunner} from 'test_runner'; import {ConsoleTestRunner} from 'console_test_runner'; +import * as Console from 'devtools/panels/console/console.js'; + (async function() { TestRunner.addResult(`Tests that console can filter messages by source.\n`); - await TestRunner.loadLegacyModule('console'); await TestRunner.showPanel('console'); await TestRunner.addScriptTag('resources/log-source.js'); await TestRunner.evaluateInPagePromise(` @@ -24,16 +25,16 @@ console.warn("abc warn"); console.warn("def warn"); `); - var consoleView = Console.ConsoleView.instance(); + var consoleView = Console.ConsoleView.ConsoleView.instance(); consoleView.setImmediatelyFilterMessagesForTest(); if (consoleView.isSidebarOpen) consoleView.splitWidget.showHideSidebarButton.element.click(); async function dumpVisibleMessages() { - var menuText = Console.ConsoleView.instance().filter.levelMenuButton.text; + var menuText = Console.ConsoleView.ConsoleView.instance().filter.levelMenuButton.text; TestRunner.addResult('Level menu: ' + menuText); - var messages = Console.ConsoleView.instance().visibleViewMessages; + var messages = Console.ConsoleView.ConsoleView.instance().visibleViewMessages; for (var i = 0; i < messages.length; i++) { // Ordering is important here, as accessing the element the first time around // triggers live location creation and updates which we need to await properly. @@ -46,9 +47,9 @@ var testSuite = [ function dumpLevels(next) { TestRunner.addResult('All levels'); - TestRunner.addObject(Console.ConsoleFilter.allLevelsFilterValue()); + TestRunner.addObject(Console.ConsoleFilter.ConsoleFilter.allLevelsFilterValue()); TestRunner.addResult('Default levels'); - TestRunner.addObject(Console.ConsoleFilter.defaultLevelsFilterValue()); + TestRunner.addObject(Console.ConsoleFilter.ConsoleFilter.defaultLevelsFilterValue()); next(); }, @@ -58,45 +59,45 @@ }, function allLevels(next) { - Console.ConsoleViewFilter.levelFilterSetting().set(Console.ConsoleFilter.allLevelsFilterValue()); + Console.ConsoleView.ConsoleViewFilter.levelFilterSetting().set(Console.ConsoleFilter.ConsoleFilter.allLevelsFilterValue()); dumpVisibleMessages().then(next); }, function defaultLevels(next) { - Console.ConsoleViewFilter.levelFilterSetting().set(Console.ConsoleFilter.defaultLevelsFilterValue()); + Console.ConsoleView.ConsoleViewFilter.levelFilterSetting().set(Console.ConsoleFilter.ConsoleFilter.defaultLevelsFilterValue()); dumpVisibleMessages().then(next); }, function verbose(next) { - Console.ConsoleViewFilter.levelFilterSetting().set({ verbose: true }); + Console.ConsoleView.ConsoleViewFilter.levelFilterSetting().set({ verbose: true }); dumpVisibleMessages().then(next); }, function info(next) { - Console.ConsoleViewFilter.levelFilterSetting().set({ info: true }); + Console.ConsoleView.ConsoleViewFilter.levelFilterSetting().set({ info: true }); dumpVisibleMessages().then(next); }, function warningsAndErrors(next) { - Console.ConsoleViewFilter.levelFilterSetting().set({ warning: true, error: true }); + Console.ConsoleView.ConsoleViewFilter.levelFilterSetting().set({ warning: true, error: true }); dumpVisibleMessages().then(next); }, function abcMessagePlain(next) { - Console.ConsoleViewFilter.levelFilterSetting().set({ verbose: true }); - Console.ConsoleView.instance().filter.textFilterUI.setValue('abc'); - Console.ConsoleView.instance().filter.onFilterChanged(); + Console.ConsoleView.ConsoleViewFilter.levelFilterSetting().set({ verbose: true }); + Console.ConsoleView.ConsoleView.instance().filter.textFilterUI.setValue('abc'); + Console.ConsoleView.ConsoleView.instance().filter.onFilterChanged(); dumpVisibleMessages().then(next); }, function abcMessageRegex(next) { - Console.ConsoleView.instance().filter.textFilterUI.setValue('/ab[a-z]/'); - Console.ConsoleView.instance().filter.onFilterChanged(); + Console.ConsoleView.ConsoleView.instance().filter.textFilterUI.setValue('/ab[a-z]/'); + Console.ConsoleView.ConsoleView.instance().filter.onFilterChanged(); dumpVisibleMessages().then(next); }, function abcMessageRegexWarning(next) { - Console.ConsoleViewFilter.levelFilterSetting().set({ warning: true }); + Console.ConsoleView.ConsoleViewFilter.levelFilterSetting().set({ warning: true }); dumpVisibleMessages().then(next); } ];
diff --git a/third_party/blink/web_tests/http/tests/devtools/console/console-format-array-prototype-expected.txt b/third_party/blink/web_tests/http/tests/devtools/console/console-format-array-prototype-expected.txt index cd92b17..df3690c2 100644 --- a/third_party/blink/web_tests/http/tests/devtools/console/console-format-array-prototype-expected.txt +++ b/third_party/blink/web_tests/http/tests/devtools/console/console-format-array-prototype-expected.txt
@@ -2,35 +2,35 @@ a0 [] -console-format-array-prototype.js:17 [] +console-format-array-prototype.js:16 [] a1 [empty] -console-format-array-prototype.js:17 [empty] +console-format-array-prototype.js:16 [empty] a2 (5) [empty × 5] -console-format-array-prototype.js:17 (5) [empty × 5] +console-format-array-prototype.js:16 (5) [empty × 5] a3 (3) [empty, 2, 3] -console-format-array-prototype.js:17 (3) [empty, 2, 3] +console-format-array-prototype.js:16 (3) [empty, 2, 3] a4 (15) [empty × 15] -console-format-array-prototype.js:17 (15) [empty × 15] +console-format-array-prototype.js:16 (15) [empty × 15] a5 (15) [empty × 8, 8, empty × 6] -console-format-array-prototype.js:17 (15) [empty × 8, 8, empty × 6] +console-format-array-prototype.js:16 (15) [empty × 8, 8, empty × 6] a6 (15) [0, empty × 9, 10, empty × 4] -console-format-array-prototype.js:17 (15) [0, empty × 9, 10, empty × 4] +console-format-array-prototype.js:16 (15) [0, empty × 9, 10, empty × 4] a7 (15) [3: 4, index0: 0, index1: 1, index2: 2, index3: 3, index4: 4, …] -console-format-array-prototype.js:17 (15) [3: 4, index0: 0, index1: 1, index2: 2, index3: 3, index4: 4, …] +console-format-array-prototype.js:16 (15) [3: 4, index0: 0, index1: 1, index2: 2, index3: 3, index4: 4, …] a8 (10) [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] -console-format-array-prototype.js:17 (10) [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] +console-format-array-prototype.js:16 (10) [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] a9 (11) [empty, 1, 2, 3, 4, empty, 6, 7, 8, 9, empty, foo: 'bar'] -console-format-array-prototype.js:17 (11) [empty, 1, 2, 3, 4, empty, 6, 7, 8, 9, empty, foo: 'bar'] +console-format-array-prototype.js:16 (11) [empty, 1, 2, 3, 4, empty, 6, 7, 8, 9, empty, foo: 'bar'] a10 Array {} -console-format-array-prototype.js:17 Array {} +console-format-array-prototype.js:16 Array {}
diff --git a/third_party/blink/web_tests/http/tests/devtools/console/console-format-array-prototype.js b/third_party/blink/web_tests/http/tests/devtools/console/console-format-array-prototype.js index f462055..b77174ff 100644 --- a/third_party/blink/web_tests/http/tests/devtools/console/console-format-array-prototype.js +++ b/third_party/blink/web_tests/http/tests/devtools/console/console-format-array-prototype.js
@@ -8,7 +8,6 @@ (async function() { TestRunner.addResult('Tests that console logging dumps array values defined on Array.prototype[].\n'); - await TestRunner.loadLegacyModule('console'); await TestRunner.showPanel('console'); await TestRunner.evaluateInPagePromise(`
diff --git a/third_party/blink/web_tests/http/tests/devtools/console/console-format-broken-unicode.js b/third_party/blink/web_tests/http/tests/devtools/console/console-format-broken-unicode.js index 34f9179..5039754 100644 --- a/third_party/blink/web_tests/http/tests/devtools/console/console-format-broken-unicode.js +++ b/third_party/blink/web_tests/http/tests/devtools/console/console-format-broken-unicode.js
@@ -5,10 +5,11 @@ import {TestRunner} from 'test_runner'; import {ConsoleTestRunner} from 'console_test_runner'; +import * as Console from 'devtools/panels/console/console.js'; + (async function() { TestRunner.addResult(`Tests that console logging dumps proper messages with broken Unicode.\n`); - await TestRunner.loadLegacyModule('console'); await TestRunner.showPanel('console'); await TestRunner.evaluateInPagePromise(` @@ -62,7 +63,7 @@ function countTextNodes(textContent) { ConsoleTestRunner.disableConsoleViewport(); var count = 0; - var viewMessages = Console.ConsoleView.instance().visibleViewMessages; + var viewMessages = Console.ConsoleView.ConsoleView.instance().visibleViewMessages; for (var i = 0; i < viewMessages.length; ++i) { var node = viewMessages[i].contentElement();
diff --git a/third_party/blink/web_tests/http/tests/devtools/console/console-format-classes-expected.txt b/third_party/blink/web_tests/http/tests/devtools/console/console-format-classes-expected.txt index c693896..358d0c7 100644 --- a/third_party/blink/web_tests/http/tests/devtools/console/console-format-classes-expected.txt +++ b/third_party/blink/web_tests/http/tests/devtools/console/console-format-classes-expected.txt
@@ -1,7 +1,7 @@ Tests that console produces instant previews for arrays and objects. -console-format-classes.js:33 Error: custom error with link www.chromium.org - at console-format-classes.js:23:9 +console-format-classes.js:32 Error: custom error with link www.chromium.org + at console-format-classes.js:22:9 console-message source-code console-message-anchor @@ -10,7 +10,7 @@ object-value-error source-code devtools-link devtools-link -console-format-classes.js:33 (6) [1, empty × 2, 2, (...), empty] +console-format-classes.js:32 (6) [1, empty × 2, 2, (...), empty] console-message source-code console-message-anchor @@ -31,7 +31,7 @@ object-value-undefined object-state-note info-note children -console-format-classes.js:33 {a: 1} +console-format-classes.js:32 {a: 1} console-message source-code console-message-anchor @@ -48,7 +48,7 @@ object-value-number object-state-note info-note children -console-format-classes.js:33 {str: '', nan: NaN, posInf: Infinity, negInf: -Infinity, negZero: -0} +console-format-classes.js:32 {str: '', nan: NaN, posInf: Infinity, negInf: -Infinity, negZero: -0} console-message source-code console-message-anchor @@ -73,7 +73,7 @@ object-value-number object-state-note info-note children -console-format-classes.js:33 {null: null, undef: undefined, re: /^[regexp]$/g, constructedRe: /foo\/bar/, bool: false} +console-format-classes.js:32 {null: null, undef: undefined, re: /^[regexp]$/g, constructedRe: /foo\/bar/, bool: false} console-message source-code console-message-anchor @@ -98,7 +98,7 @@ object-value-boolean object-state-note info-note children -console-format-classes.js:33 Proxy(Object) {a: 1} +console-format-classes.js:32 Proxy(Object) {a: 1} console-message source-code console-message-anchor @@ -116,7 +116,7 @@ object-value-number object-state-note info-note children -console-format-classes.js:33 HTMLAllCollection(4) [html, head, base, body] +console-format-classes.js:32 HTMLAllCollection(4) [html, head, base, body] console-message source-code console-message-anchor @@ -140,7 +140,7 @@ webkit-html-tag-name object-state-note info-note children -console-format-classes.js:37 (7) [Error: custom error with link www.chromium.org +console-format-classes.js:36 (7) [Error: custom error with link www.chromium.org at test://evaluations/0/console-format-classes.j…, Array(6), {…}, {…}, {…}, Proxy(Object), HTMLAllCollection(4)] console-message source-code
diff --git a/third_party/blink/web_tests/http/tests/devtools/console/console-format-classes.js b/third_party/blink/web_tests/http/tests/devtools/console/console-format-classes.js index 6ca2b58..69b38ce 100644 --- a/third_party/blink/web_tests/http/tests/devtools/console/console-format-classes.js +++ b/third_party/blink/web_tests/http/tests/devtools/console/console-format-classes.js
@@ -7,7 +7,6 @@ (async function() { TestRunner.addResult(`Tests that console produces instant previews for arrays and objects.\n`); - await TestRunner.loadLegacyModule('console'); await TestRunner.showPanel('console'); await TestRunner.evaluateInPagePromise(` const objWithGetter = {a: 1, __proto__: 2};
diff --git a/third_party/blink/web_tests/http/tests/devtools/console/console-format-collections-expected.txt b/third_party/blink/web_tests/http/tests/devtools/console/console-format-collections-expected.txt index 2ade5ca..94ffd2d 100644 --- a/third_party/blink/web_tests/http/tests/devtools/console/console-format-collections-expected.txt +++ b/third_party/blink/web_tests/http/tests/devtools/console/console-format-collections-expected.txt
@@ -1,39 +1,39 @@ Tests that console nicely formats HTML Collections, NodeLists and DOMTokenLists. -console-format-collections.js:36 HTMLCollection [select#sel, sel: select#sel] -console-format-collections.js:40 HTMLCollection [base] -console-format-collections.js:44 HTMLOptionsCollection(2) [option, option, selectedIndex: 0] -console-format-collections.js:48 HTMLAllCollection(11) [html, head, base, body, div.c1.c2.c3, form#f, select#sel, option, option, input, input, f: form#f, sel: select#sel, x: HTMLCollection(2)] -console-format-collections.js:52 HTMLFormControlsCollection(3) [select#sel, input, input, sel: select#sel, x: RadioNodeList(2)] -console-format-collections.js:56 RadioNodeList(2) [input, input, value: ''] -console-format-collections.js:62 (2) [1, Array(2)] -console-format-collections.js:65 NonArrayWithLength {keys: Array(0)} -console-format-collections.js:72 Arguments(2) [1, '2', callee: ƒ, Symbol(Symbol.iterator): ƒ] -console-format-collections.js:76 DOMTokenList(3) ['c1', 'c2', 'c3', value: 'c1 c2 c3'] -console-format-collections.js:79 ArrayLike {length: 5} -console-format-collections.js:80 ArrayLike {length: 4294967295} -console-format-collections.js:82 ArrayLike {length: -5} -console-format-collections.js:83 ArrayLike {length: 5.6} -console-format-collections.js:84 ArrayLike {length: NaN} -console-format-collections.js:85 ArrayLike {length: Infinity} -console-format-collections.js:86 ArrayLike {length: -0} -console-format-collections.js:87 ArrayLike {length: 4294967296} -console-format-collections.js:36 HTMLCollection [select#sel, sel: select#sel] -console-format-collections.js:40 HTMLCollection [base] -console-format-collections.js:44 HTMLOptionsCollection(2) [option, option, selectedIndex: 0] -console-format-collections.js:48 HTMLAllCollection(11) [html, head, base, body, div.c1.c2.c3, form#f, select#sel, option, option, input, input, f: form#f, sel: select#sel, x: HTMLCollection(2)] -console-format-collections.js:52 HTMLFormControlsCollection(3) [select#sel, input, input, sel: select#sel, x: RadioNodeList(2)] -console-format-collections.js:56 RadioNodeList(2) [input, input, value: ''] -console-format-collections.js:62 (2) [1, Array(2)] -console-format-collections.js:65 NonArrayWithLength {keys: Array(0)} -console-format-collections.js:72 Arguments(2) [1, '2', callee: ƒ, Symbol(Symbol.iterator): ƒ] -console-format-collections.js:76 DOMTokenList(3) ['c1', 'c2', 'c3', value: 'c1 c2 c3'] -console-format-collections.js:79 ArrayLike(5) [empty × 5] -console-format-collections.js:80 ArrayLike(4294967295) [empty × 4294967295] -console-format-collections.js:82 ArrayLike {length: -5} -console-format-collections.js:83 ArrayLike {length: 5.6} -console-format-collections.js:84 ArrayLike {length: NaN} -console-format-collections.js:85 ArrayLike {length: Infinity} -console-format-collections.js:86 ArrayLike {length: -0} -console-format-collections.js:87 ArrayLike {length: 4294967296} +console-format-collections.js:35 HTMLCollection [select#sel, sel: select#sel] +console-format-collections.js:39 HTMLCollection [base] +console-format-collections.js:43 HTMLOptionsCollection(2) [option, option, selectedIndex: 0] +console-format-collections.js:47 HTMLAllCollection(11) [html, head, base, body, div.c1.c2.c3, form#f, select#sel, option, option, input, input, f: form#f, sel: select#sel, x: HTMLCollection(2)] +console-format-collections.js:51 HTMLFormControlsCollection(3) [select#sel, input, input, sel: select#sel, x: RadioNodeList(2)] +console-format-collections.js:55 RadioNodeList(2) [input, input, value: ''] +console-format-collections.js:61 (2) [1, Array(2)] +console-format-collections.js:64 NonArrayWithLength {keys: Array(0)} +console-format-collections.js:71 Arguments(2) [1, '2', callee: ƒ, Symbol(Symbol.iterator): ƒ] +console-format-collections.js:75 DOMTokenList(3) ['c1', 'c2', 'c3', value: 'c1 c2 c3'] +console-format-collections.js:78 ArrayLike {length: 5} +console-format-collections.js:79 ArrayLike {length: 4294967295} +console-format-collections.js:81 ArrayLike {length: -5} +console-format-collections.js:82 ArrayLike {length: 5.6} +console-format-collections.js:83 ArrayLike {length: NaN} +console-format-collections.js:84 ArrayLike {length: Infinity} +console-format-collections.js:85 ArrayLike {length: -0} +console-format-collections.js:86 ArrayLike {length: 4294967296} +console-format-collections.js:35 HTMLCollection [select#sel, sel: select#sel] +console-format-collections.js:39 HTMLCollection [base] +console-format-collections.js:43 HTMLOptionsCollection(2) [option, option, selectedIndex: 0] +console-format-collections.js:47 HTMLAllCollection(11) [html, head, base, body, div.c1.c2.c3, form#f, select#sel, option, option, input, input, f: form#f, sel: select#sel, x: HTMLCollection(2)] +console-format-collections.js:51 HTMLFormControlsCollection(3) [select#sel, input, input, sel: select#sel, x: RadioNodeList(2)] +console-format-collections.js:55 RadioNodeList(2) [input, input, value: ''] +console-format-collections.js:61 (2) [1, Array(2)] +console-format-collections.js:64 NonArrayWithLength {keys: Array(0)} +console-format-collections.js:71 Arguments(2) [1, '2', callee: ƒ, Symbol(Symbol.iterator): ƒ] +console-format-collections.js:75 DOMTokenList(3) ['c1', 'c2', 'c3', value: 'c1 c2 c3'] +console-format-collections.js:78 ArrayLike(5) [empty × 5] +console-format-collections.js:79 ArrayLike(4294967295) [empty × 4294967295] +console-format-collections.js:81 ArrayLike {length: -5} +console-format-collections.js:82 ArrayLike {length: 5.6} +console-format-collections.js:83 ArrayLike {length: NaN} +console-format-collections.js:84 ArrayLike {length: Infinity} +console-format-collections.js:85 ArrayLike {length: -0} +console-format-collections.js:86 ArrayLike {length: 4294967296}
diff --git a/third_party/blink/web_tests/http/tests/devtools/console/console-format-collections.js b/third_party/blink/web_tests/http/tests/devtools/console/console-format-collections.js index f385ac2..162121e3 100644 --- a/third_party/blink/web_tests/http/tests/devtools/console/console-format-collections.js +++ b/third_party/blink/web_tests/http/tests/devtools/console/console-format-collections.js
@@ -8,7 +8,6 @@ (async function() { TestRunner.addResult(`Tests that console nicely formats HTML Collections, NodeLists and DOMTokenLists.\n`); - await TestRunner.loadLegacyModule('console'); await TestRunner.showPanel('console'); await TestRunner.loadHTML(`
diff --git a/third_party/blink/web_tests/http/tests/devtools/console/console-format-es6-2-expected.txt b/third_party/blink/web_tests/http/tests/devtools/console/console-format-es6-2-expected.txt index 89f40e76..ff4e501 100644 --- a/third_party/blink/web_tests/http/tests/devtools/console/console-format-es6-2-expected.txt +++ b/third_party/blink/web_tests/http/tests/devtools/console/console-format-es6-2-expected.txt
@@ -1,39 +1,39 @@ Tests that console properly displays information about ES6 features. -console-format-es6-2.js:18 MapIterator {41, {…}} -console-format-es6-2.js:19 [MapIterator] +console-format-es6-2.js:17 MapIterator {41, {…}} +console-format-es6-2.js:18 [MapIterator] globals[0] MapIterator {41, {…}} -console-format-es6-2.js:18 MapIterator {42, {…}} -console-format-es6-2.js:19 [MapIterator] +console-format-es6-2.js:17 MapIterator {42, {…}} +console-format-es6-2.js:18 [MapIterator] globals[1] MapIterator {42, {…}} -console-format-es6-2.js:18 MapIterator {41 => 42, {…} => {…}} -console-format-es6-2.js:19 [MapIterator] +console-format-es6-2.js:17 MapIterator {41 => 42, {…} => {…}} +console-format-es6-2.js:18 [MapIterator] globals[2] MapIterator {41 => 42, {…} => {…}} -console-format-es6-2.js:18 SetIterator {41, {…}} -console-format-es6-2.js:19 [SetIterator] +console-format-es6-2.js:17 SetIterator {41, {…}} +console-format-es6-2.js:18 [SetIterator] globals[3] SetIterator {41, {…}} -console-format-es6-2.js:18 SetIterator {41, {…}} -console-format-es6-2.js:19 [SetIterator] +console-format-es6-2.js:17 SetIterator {41, {…}} +console-format-es6-2.js:18 [SetIterator] globals[4] SetIterator {41, {…}} -console-format-es6-2.js:18 SetIterator {41 => 41, {…} => {…}} -console-format-es6-2.js:19 [SetIterator] +console-format-es6-2.js:17 SetIterator {41 => 41, {…} => {…}} +console-format-es6-2.js:18 [SetIterator] globals[5] SetIterator {41 => 41, {…} => {…}} -console-format-es6-2.js:18 MapIterator {{…}} -console-format-es6-2.js:19 [MapIterator] +console-format-es6-2.js:17 MapIterator {{…}} +console-format-es6-2.js:18 [MapIterator] globals[6] MapIterator {{…}} -console-format-es6-2.js:18 SetIterator {{…}} -console-format-es6-2.js:19 [SetIterator] +console-format-es6-2.js:17 SetIterator {{…}} +console-format-es6-2.js:18 [SetIterator] globals[7] SetIterator {{…}} Expanded all messages -console-format-es6-2.js:18 MapIterator {41, {…}} +console-format-es6-2.js:17 MapIterator {41, {…}} [[Entries]] 0: 41 1: Object @@ -41,7 +41,7 @@ [[IteratorHasMore]]: true [[IteratorIndex]]: 0 [[IteratorKind]]: "keys" -console-format-es6-2.js:19 [MapIterator] +console-format-es6-2.js:18 [MapIterator] 0: MapIterator {41, {…}} length: 1 [[Prototype]]: Array(0) @@ -54,7 +54,7 @@ [[IteratorHasMore]]: true [[IteratorIndex]]: 0 [[IteratorKind]]: "keys" -console-format-es6-2.js:18 MapIterator {42, {…}} +console-format-es6-2.js:17 MapIterator {42, {…}} [[Entries]] 0: 42 1: Object @@ -62,7 +62,7 @@ [[IteratorHasMore]]: true [[IteratorIndex]]: 0 [[IteratorKind]]: "values" -console-format-es6-2.js:19 [MapIterator] +console-format-es6-2.js:18 [MapIterator] 0: MapIterator {42, {…}} length: 1 [[Prototype]]: Array(0) @@ -75,7 +75,7 @@ [[IteratorHasMore]]: true [[IteratorIndex]]: 0 [[IteratorKind]]: "values" -console-format-es6-2.js:18 MapIterator {41 => 42, {…} => {…}} +console-format-es6-2.js:17 MapIterator {41 => 42, {…} => {…}} [[Entries]] 0: {41 => 42} 1: {Object => Object} @@ -83,7 +83,7 @@ [[IteratorHasMore]]: true [[IteratorIndex]]: 0 [[IteratorKind]]: "entries" -console-format-es6-2.js:19 [MapIterator] +console-format-es6-2.js:18 [MapIterator] 0: MapIterator {41 => 42, {…} => {…}} length: 1 [[Prototype]]: Array(0) @@ -96,7 +96,7 @@ [[IteratorHasMore]]: true [[IteratorIndex]]: 0 [[IteratorKind]]: "entries" -console-format-es6-2.js:18 SetIterator {41, {…}} +console-format-es6-2.js:17 SetIterator {41, {…}} [[Entries]] 0: 41 1: Object @@ -104,7 +104,7 @@ [[IteratorHasMore]]: true [[IteratorIndex]]: 0 [[IteratorKind]]: "values" -console-format-es6-2.js:19 [SetIterator] +console-format-es6-2.js:18 [SetIterator] 0: SetIterator {41, {…}} length: 1 [[Prototype]]: Array(0) @@ -117,7 +117,7 @@ [[IteratorHasMore]]: true [[IteratorIndex]]: 0 [[IteratorKind]]: "values" -console-format-es6-2.js:18 SetIterator {41, {…}} +console-format-es6-2.js:17 SetIterator {41, {…}} [[Entries]] 0: 41 1: Object @@ -125,7 +125,7 @@ [[IteratorHasMore]]: true [[IteratorIndex]]: 0 [[IteratorKind]]: "values" -console-format-es6-2.js:19 [SetIterator] +console-format-es6-2.js:18 [SetIterator] 0: SetIterator {41, {…}} length: 1 [[Prototype]]: Array(0) @@ -138,7 +138,7 @@ [[IteratorHasMore]]: true [[IteratorIndex]]: 0 [[IteratorKind]]: "values" -console-format-es6-2.js:18 SetIterator {41 => 41, {…} => {…}} +console-format-es6-2.js:17 SetIterator {41 => 41, {…} => {…}} [[Entries]] 0: {41 => 41} 1: {Object => Object} @@ -146,7 +146,7 @@ [[IteratorHasMore]]: true [[IteratorIndex]]: 0 [[IteratorKind]]: "entries" -console-format-es6-2.js:19 [SetIterator] +console-format-es6-2.js:18 [SetIterator] 0: SetIterator {41 => 41, {…} => {…}} length: 1 [[Prototype]]: Array(0) @@ -159,14 +159,14 @@ [[IteratorHasMore]]: true [[IteratorIndex]]: 0 [[IteratorKind]]: "entries" -console-format-es6-2.js:18 MapIterator {{…}} +console-format-es6-2.js:17 MapIterator {{…}} [[Entries]] 0: Object [[Prototype]]: Map Iterator [[IteratorHasMore]]: true [[IteratorIndex]]: 1 [[IteratorKind]]: "values" -console-format-es6-2.js:19 [MapIterator] +console-format-es6-2.js:18 [MapIterator] 0: MapIterator {{…}} length: 1 [[Prototype]]: Array(0) @@ -178,14 +178,14 @@ [[IteratorHasMore]]: true [[IteratorIndex]]: 1 [[IteratorKind]]: "values" -console-format-es6-2.js:18 SetIterator {{…}} +console-format-es6-2.js:17 SetIterator {{…}} [[Entries]] 0: Object [[Prototype]]: Set Iterator [[IteratorHasMore]]: true [[IteratorIndex]]: 1 [[IteratorKind]]: "values" -console-format-es6-2.js:19 [SetIterator] +console-format-es6-2.js:18 [SetIterator] 0: SetIterator {{…}} length: 1 [[Prototype]]: Array(0)
diff --git a/third_party/blink/web_tests/http/tests/devtools/console/console-format-es6-2.js b/third_party/blink/web_tests/http/tests/devtools/console/console-format-es6-2.js index ed6b06a..7a014e2 100644 --- a/third_party/blink/web_tests/http/tests/devtools/console/console-format-es6-2.js +++ b/third_party/blink/web_tests/http/tests/devtools/console/console-format-es6-2.js
@@ -8,7 +8,6 @@ (async function() { TestRunner.addResult('Tests that console properly displays information about ES6 features.\n'); - await TestRunner.loadLegacyModule('console'); await TestRunner.showPanel('console'); await TestRunner.evaluateInPagePromise(`
diff --git a/third_party/blink/web_tests/http/tests/devtools/console/console-format-es6-symbols-error-expected.txt b/third_party/blink/web_tests/http/tests/devtools/console/console-format-es6-symbols-error-expected.txt index 52bf760..c4c4122 100644 --- a/third_party/blink/web_tests/http/tests/devtools/console/console-format-es6-symbols-error-expected.txt +++ b/third_party/blink/web_tests/http/tests/devtools/console/console-format-es6-symbols-error-expected.txt
@@ -1,4 +1,4 @@ Tests that console properly displays information about ES6 Symbols. -console-format-es6-symbols-error.js:19 Symbol() +console-format-es6-symbols-error.js:18 Symbol()
diff --git a/third_party/blink/web_tests/http/tests/devtools/console/console-format-es6-symbols-error.js b/third_party/blink/web_tests/http/tests/devtools/console/console-format-es6-symbols-error.js index 71c080b..597ea2a 100644 --- a/third_party/blink/web_tests/http/tests/devtools/console/console-format-es6-symbols-error.js +++ b/third_party/blink/web_tests/http/tests/devtools/console/console-format-es6-symbols-error.js
@@ -8,7 +8,6 @@ (async function() { TestRunner.addResult('Tests that console properly displays information about ES6 Symbols.\n'); - await TestRunner.loadLegacyModule('console'); await TestRunner.showPanel('console'); await TestRunner.evaluateInPagePromise(`
diff --git a/third_party/blink/web_tests/http/tests/devtools/console/console-format-es6.js b/third_party/blink/web_tests/http/tests/devtools/console/console-format-es6.js index cdb0e8c..81eee33 100644 --- a/third_party/blink/web_tests/http/tests/devtools/console/console-format-es6.js +++ b/third_party/blink/web_tests/http/tests/devtools/console/console-format-es6.js
@@ -8,7 +8,6 @@ (async function() { TestRunner.addResult('Tests that console properly displays information about ES6 features.\n'); - await TestRunner.loadLegacyModule('console'); await TestRunner.showPanel('console'); await TestRunner.evaluateInPagePromise(`
diff --git a/third_party/blink/web_tests/http/tests/devtools/console/console-format-performance-expected.txt b/third_party/blink/web_tests/http/tests/devtools/console/console-format-performance-expected.txt index d59644e..a9a6626 100644 --- a/third_party/blink/web_tests/http/tests/devtools/console/console-format-performance-expected.txt +++ b/third_party/blink/web_tests/http/tests/devtools/console/console-format-performance-expected.txt
@@ -1,7 +1,7 @@ Tests that console nicely formats performance getters. -console-format-performance.js:17 PerformanceTiming {navigationStart: <number>, unloadEventStart: <number>, unloadEventEnd: <number>, redirectStart: <number>, redirectEnd: <number>, …} -console-format-performance.js:18 MemoryInfo {totalJSHeapSize: <number>, usedJSHeapSize: <number>, jsHeapSizeLimit: <number>} -console-format-performance.js:17 PerformanceTiming {navigationStart: <number>, unloadEventStart: <number>, unloadEventEnd: <number>, redirectStart: <number>, redirectEnd: <number>, …} -console-format-performance.js:18 MemoryInfo {totalJSHeapSize: <number>, usedJSHeapSize: <number>, jsHeapSizeLimit: <number>} +console-format-performance.js:16 PerformanceTiming {navigationStart: <number>, unloadEventStart: <number>, unloadEventEnd: <number>, redirectStart: <number>, redirectEnd: <number>, …} +console-format-performance.js:17 MemoryInfo {totalJSHeapSize: <number>, usedJSHeapSize: <number>, jsHeapSizeLimit: <number>} +console-format-performance.js:16 PerformanceTiming {navigationStart: <number>, unloadEventStart: <number>, unloadEventEnd: <number>, redirectStart: <number>, redirectEnd: <number>, …} +console-format-performance.js:17 MemoryInfo {totalJSHeapSize: <number>, usedJSHeapSize: <number>, jsHeapSizeLimit: <number>}
diff --git a/third_party/blink/web_tests/http/tests/devtools/console/console-format-performance.js b/third_party/blink/web_tests/http/tests/devtools/console/console-format-performance.js index a7e7b8ba2..d799eae 100644 --- a/third_party/blink/web_tests/http/tests/devtools/console/console-format-performance.js +++ b/third_party/blink/web_tests/http/tests/devtools/console/console-format-performance.js
@@ -8,7 +8,6 @@ (async function() { TestRunner.addResult(`Tests that console nicely formats performance getters.\n`); - await TestRunner.loadLegacyModule('console'); await TestRunner.showPanel('console'); await TestRunner.evaluateInPagePromise(`
diff --git a/third_party/blink/web_tests/http/tests/devtools/console/console-format-style-allowed-expected.txt b/third_party/blink/web_tests/http/tests/devtools/console/console-format-style-allowed-expected.txt index f7016079..d274c2d3 100644 --- a/third_party/blink/web_tests/http/tests/devtools/console/console-format-style-allowed-expected.txt +++ b/third_party/blink/web_tests/http/tests/devtools/console/console-format-style-allowed-expected.txt
@@ -1,13 +1,13 @@ Tests that console logging dumps properly styled messages, and that the whole message gets the same style, regardless of multiple %c settings. -console-format-style-allowed.js:16 Colors are awesome. +console-format-style-allowed.js:15 Colors are awesome. Styled text #0: contain: paint; display: inline-block; max-width: 100%; color: blue; -console-format-style-allowed.js:17 So are fonts! +console-format-style-allowed.js:16 So are fonts! Styled text #0: contain: paint; display: inline-block; max-width: 100%; font: 1em Helvetica; -console-format-style-allowed.js:18 And borders and margins and paddings! +console-format-style-allowed.js:17 And borders and margins and paddings! Styled text #0: contain: paint; display: inline-block; max-width: 100%; border: 1px solid red; margin: 20px; padding: 10px; -console-format-style-allowed.js:19 text-* is fine by us! +console-format-style-allowed.js:18 text-* is fine by us! Styled text #0: contain: paint; display: inline-block; max-width: 100%; text-decoration: none; -console-format-style-allowed.js:21 Display, on the other hand, is bad news. -console-format-style-allowed.js:22 And position too. +console-format-style-allowed.js:20 Display, on the other hand, is bad news. +console-format-style-allowed.js:21 And position too.
diff --git a/third_party/blink/web_tests/http/tests/devtools/console/console-format-style-allowed.js b/third_party/blink/web_tests/http/tests/devtools/console/console-format-style-allowed.js index a89e32b..053925a 100644 --- a/third_party/blink/web_tests/http/tests/devtools/console/console-format-style-allowed.js +++ b/third_party/blink/web_tests/http/tests/devtools/console/console-format-style-allowed.js
@@ -10,7 +10,6 @@ `Tests that console logging dumps properly styled messages, and that the whole message gets the same style, regardless of multiple %c settings.\n` ); - await TestRunner.loadLegacyModule('console'); await TestRunner.showPanel('console'); await TestRunner.evaluateInPagePromise(` console.log('%cColors are awesome.', 'color: blue;');
diff --git a/third_party/blink/web_tests/http/tests/devtools/console/console-format-style-expected.txt b/third_party/blink/web_tests/http/tests/devtools/console/console-format-style-expected.txt index 34eb67f7..25a12666 100644 --- a/third_party/blink/web_tests/http/tests/devtools/console/console-format-style-expected.txt +++ b/third_party/blink/web_tests/http/tests/devtools/console/console-format-style-expected.txt
@@ -1,29 +1,29 @@ Tests that console logging dumps properly styled messages. -console-format-style.js:17 Blue!. +console-format-style.js:16 Blue!. Styled text #0: contain: paint; display: inline-block; max-width: 100%; color: blue; -console-format-style.js:18 Blue! Red! +console-format-style.js:17 Blue! Red! Styled text #0: contain: paint; display: inline-block; max-width: 100%; color: blue; Styled text #1: contain: paint; display: inline-block; max-width: 100%; color: red; -console-format-style.js:19 Blue!Red! +console-format-style.js:18 Blue!Red! Styled text #0: contain: paint; display: inline-block; max-width: 100%; color: blue; Styled text #1: NO STYLES DEFINED Styled text #2: contain: paint; display: inline-block; max-width: 100%; color: blue; Styled text #3: contain: paint; display: inline-block; max-width: 100%; color: red; -console-format-style.js:20 www.google.com +console-format-style.js:19 www.google.com Styled text #0: contain: paint; display: inline-block; max-width: 100%; color: blue; Styled text #1: NO STYLES DEFINED +console-format-style.js:20 www.google.com +onload @ console-format-style.js:20 +(anonymous) @ console-format-style.js:24 +Styled text #0: contain: paint; display: inline-block; max-width: 100%; color: blue; background: blue; +Styled text #1: NO STYLES DEFINED console-format-style.js:21 www.google.com onload @ console-format-style.js:21 -(anonymous) @ console-format-style.js:25 +(anonymous) @ console-format-style.js:24 Styled text #0: contain: paint; display: inline-block; max-width: 100%; color: blue; background: blue; Styled text #1: NO STYLES DEFINED -console-format-style.js:22 www.google.com -onload @ console-format-style.js:22 -(anonymous) @ console-format-style.js:25 -Styled text #0: contain: paint; display: inline-block; max-width: 100%; color: blue; background: blue; -Styled text #1: NO STYLES DEFINED -console-format-style.js:23 12345678 +console-format-style.js:22 12345678 Styled text #0: contain: paint; display: inline-block; max-width: 100%; color: var(--console-color-black); Styled text #1: contain: paint; display: inline-block; max-width: 100%; color: var(--console-color-red); Styled text #2: contain: paint; display: inline-block; max-width: 100%; color: var(--console-color-darkgray); @@ -32,7 +32,7 @@ Styled text #5: contain: paint; display: inline-block; max-width: 100%; color: var(--console-color-lightred); background-color: var(--console-color-red); Styled text #6: contain: paint; display: inline-block; max-width: 100%; color: var(--console-color-lightred); background-color: var(--console-color-darkgray); Styled text #7: contain: paint; display: inline-block; max-width: 100%; color: var(--console-color-lightred); background-color: var(--console-color-lightred); -console-format-style.js:24 11.1a22.2b33.3 +console-format-style.js:23 11.1a22.2b33.3 Styled text #0: contain: paint; display: inline-block; max-width: 100%; color: var(--console-color-black); Styled text #1: contain: paint; display: inline-block; max-width: 100%; color: var(--console-color-red); Styled text #2: contain: paint; display: inline-block; max-width: 100%; color: var(--console-color-darkgray);
diff --git a/third_party/blink/web_tests/http/tests/devtools/console/console-format-style.js b/third_party/blink/web_tests/http/tests/devtools/console/console-format-style.js index 2e49425..358d239 100644 --- a/third_party/blink/web_tests/http/tests/devtools/console/console-format-style.js +++ b/third_party/blink/web_tests/http/tests/devtools/console/console-format-style.js
@@ -8,7 +8,6 @@ (async function() { TestRunner.addResult('Tests that console logging dumps properly styled messages.\n'); - await TestRunner.loadLegacyModule('console'); await TestRunner.showPanel('console'); await TestRunner.evaluateInPagePromise(`
diff --git a/third_party/blink/web_tests/http/tests/devtools/console/console-format-table-expected.txt b/third_party/blink/web_tests/http/tests/devtools/console/console-format-table-expected.txt index 1f78d299..2b658ebe 100644 --- a/third_party/blink/web_tests/http/tests/devtools/console/console-format-table-expected.txt +++ b/third_party/blink/web_tests/http/tests/devtools/console/console-format-table-expected.txt
@@ -1,11 +1,11 @@ Tests console.table. -console-format-table.js:14 null -console-format-table.js:16 Array of arrays +console-format-table.js:13 null +console-format-table.js:15 Array of arrays HEADER (index) | 0 | 1 | 2 | ROW 1 | 2 | 3 | ROW 4 | 5 | 6 | -console-format-table.js:19 Large array of arrays +console-format-table.js:18 Large array of arrays HEADER (index) | 0 | 1 | 2 | ROW 1 | 2 | 3 | ROW 4 | 5 | 6 | @@ -15,56 +15,56 @@ ROW 4 | 5 | 6 | ROW 1 | 2 | 3 | ROW 4 | 5 | 6 | -console-format-table.js:22 Array or array and object +console-format-table.js:21 Array or array and object HEADER (index) | 0 | 1 | 2 | a | b | c | ROW 1 | 2 | 3 | ROW 1 | 2 | 3 | -console-format-table.js:25 Object table +console-format-table.js:24 Object table HEADER (index) | a | b | ROW 1 | 2 | ROW 3 | 4 | -console-format-table.js:28 Null as columns +console-format-table.js:27 Null as columns HEADER (index) | 0 | 1 | 2 | ROW 1 | 2 | 3 | ROW 4 | 5 | 6 | -console-format-table.js:31 Digit as columns +console-format-table.js:30 Digit as columns HEADER (index) | 0 | 1 | 2 | ROW 1 | 2 | 3 | ROW 4 | 5 | 6 | -console-format-table.js:34 String as columns +console-format-table.js:33 String as columns HEADER (index) | 0 | ROW 1 | ROW 4 | -console-format-table.js:37 Random string as columns +console-format-table.js:36 Random string as columns HEADER (index) | Value | ROW Array(3) | ROW Array(3) | -console-format-table.js:40 Array of strings as columns +console-format-table.js:39 Array of strings as columns HEADER (index) | a | b | ROW 1 | 2 | ROW 'foo' | 'bar' | -console-format-table.js:43 Good and bad column names +console-format-table.js:42 Good and bad column names HEADER (index) | a | b | ROW 1 | 2 | ROW 'foo' | -console-format-table.js:46 Missing column name +console-format-table.js:45 Missing column name HEADER (index) | Value | ROW {…} | ROW {…} | -console-format-table.js:49 Shallow array +console-format-table.js:48 Shallow array HEADER (index) | Value | ROW 1 | ROW 'foo' | ROW null | -console-format-table.js:52 Shallow array with 'Value' column +console-format-table.js:51 Shallow array with 'Value' column HEADER (index) | Value | Value | ROW 1 | ROW 2 | -console-format-table.js:55 Deep and shallow array +console-format-table.js:54 Deep and shallow array HEADER (index) | Value | 0 | ROW 1 | ROW 'foo' | ROW 2 | -console-format-table.js:58 Non-standard call should use fallback -console-format-table.js:59 foo (3) [1, 2, 3] +console-format-table.js:57 Non-standard call should use fallback +console-format-table.js:58 foo (3) [1, 2, 3]
diff --git a/third_party/blink/web_tests/http/tests/devtools/console/console-format-table.js b/third_party/blink/web_tests/http/tests/devtools/console/console-format-table.js index 010c32f..617079c9 100644 --- a/third_party/blink/web_tests/http/tests/devtools/console/console-format-table.js +++ b/third_party/blink/web_tests/http/tests/devtools/console/console-format-table.js
@@ -7,7 +7,6 @@ (async function() { TestRunner.addResult(`Tests console.table.\n`); - await TestRunner.loadLegacyModule('console'); await TestRunner.showPanel('console'); await TestRunner.evaluateInPagePromise(` console.table();
diff --git a/third_party/blink/web_tests/http/tests/devtools/console/console-functions-expected.txt b/third_party/blink/web_tests/http/tests/devtools/console/console-functions-expected.txt index 2989729..a26b67e 100644 --- a/third_party/blink/web_tests/http/tests/devtools/console/console-functions-expected.txt +++ b/third_party/blink/web_tests/http/tests/devtools/console/console-functions-expected.txt
@@ -1,106 +1,106 @@ Tests that console logging different types of functions correctly. -console-functions.js:30 ƒ simple() {} -console-functions.js:31 ƒ simple() +console-functions.js:29 ƒ simple() {} +console-functions.js:30 ƒ simple() arguments: null caller: null length: 0 name: "simple" prototype: {constructor: ƒ} - [[FunctionLocation]]: console-functions.js:16 + [[FunctionLocation]]: console-functions.js:15 [[Prototype]]: ƒ () [[Scopes]]: Scopes[1] -console-functions.js:30 async ƒ asyncSimple() {} -console-functions.js:31 async ƒ asyncSimple() +console-functions.js:29 async ƒ asyncSimple() {} +console-functions.js:30 async ƒ asyncSimple() length: 0 name: "asyncSimple" arguments: (...) caller: (...) - [[FunctionLocation]]: console-functions.js:17 + [[FunctionLocation]]: console-functions.js:16 [[Prototype]]: AsyncFunction [[Scopes]]: Scopes[1] -console-functions.js:30 ƒ* genSimple() {} -console-functions.js:31 ƒ* genSimple() +console-functions.js:29 ƒ* genSimple() {} +console-functions.js:30 ƒ* genSimple() length: 0 name: "genSimple" prototype: Generator {} arguments: (...) caller: (...) - [[FunctionLocation]]: console-functions.js:18 + [[FunctionLocation]]: console-functions.js:17 [[IsGenerator]]: true [[Prototype]]: GeneratorFunction [[Scopes]]: Scopes[1] -console-functions.js:30 ƒ (){} -console-functions.js:31 ƒ anonymous() +console-functions.js:29 ƒ (){} +console-functions.js:30 ƒ anonymous() arguments: null caller: null length: 0 name: "" prototype: {constructor: ƒ} - [[FunctionLocation]]: console-functions.js:19 + [[FunctionLocation]]: console-functions.js:18 [[Prototype]]: ƒ () [[Scopes]]: Scopes[1] -console-functions.js:30 ƒ (x, y){} -console-functions.js:31 ƒ anonymous(x, y) +console-functions.js:29 ƒ (x, y){} +console-functions.js:30 ƒ anonymous(x, y) arguments: null caller: null length: 2 name: "" prototype: {constructor: ƒ} - [[FunctionLocation]]: console-functions.js:20 + [[FunctionLocation]]: console-functions.js:19 [[Prototype]]: ƒ () [[Scopes]]: Scopes[1] -console-functions.js:30 ƒ namedArgs(x) {} -console-functions.js:31 ƒ namedArgs(x) +console-functions.js:29 ƒ namedArgs(x) {} +console-functions.js:30 ƒ namedArgs(x) arguments: null caller: null length: 1 name: "namedArgs" prototype: {constructor: ƒ} - [[FunctionLocation]]: console-functions.js:21 + [[FunctionLocation]]: console-functions.js:20 [[Prototype]]: ƒ () [[Scopes]]: Scopes[1] -console-functions.js:30 ƒ namedArgs2(x, y) {} -console-functions.js:31 ƒ namedArgs2(x, y) +console-functions.js:29 ƒ namedArgs2(x, y) {} +console-functions.js:30 ƒ namedArgs2(x, y) arguments: null caller: null length: 2 name: "namedArgs2" prototype: {constructor: ƒ} - [[FunctionLocation]]: console-functions.js:22 + [[FunctionLocation]]: console-functions.js:21 [[Prototype]]: ƒ () [[Scopes]]: Scopes[1] -console-functions.js:30 ƒ ({}) {} -console-functions.js:31 ƒ anonymous({}) +console-functions.js:29 ƒ ({}) {} +console-functions.js:30 ƒ anonymous({}) arguments: null caller: null length: 1 name: "" prototype: {constructor: ƒ} - [[FunctionLocation]]: console-functions.js:23 + [[FunctionLocation]]: console-functions.js:22 [[Prototype]]: ƒ () [[Scopes]]: Scopes[1] -console-functions.js:30 ƒ * whitespace ( x ) { } -console-functions.js:31 ƒ * whitespace( x ) +console-functions.js:29 ƒ * whitespace ( x ) { } +console-functions.js:30 ƒ * whitespace( x ) length: 1 name: "whitespace" prototype: Generator {} arguments: (...) caller: (...) - [[FunctionLocation]]: console-functions.js:24 + [[FunctionLocation]]: console-functions.js:23 [[IsGenerator]]: true [[Prototype]]: GeneratorFunction [[Scopes]]: Scopes[1] -console-functions.js:30 async ƒ whitespace2 ( x , y , z ) { } -console-functions.js:31 async ƒ whitespace2( x , y , z ) +console-functions.js:29 async ƒ whitespace2 ( x , y , z ) { } +console-functions.js:30 async ƒ whitespace2( x , y , z ) length: 3 name: "whitespace2" arguments: (...) caller: (...) - [[FunctionLocation]]: console-functions.js:25 + [[FunctionLocation]]: console-functions.js:24 [[Prototype]]: AsyncFunction [[Scopes]]: Scopes[1] -console-functions.js:34 {func0: ƒ, func1: ƒ, func2: ƒ, func3: ƒ, func4: ƒ, …} +console-functions.js:33 {func0: ƒ, func1: ƒ, func2: ƒ, func3: ƒ, func4: ƒ, …} func0: ƒ simple() func1: async ƒ asyncSimple() func2: ƒ* genSimple() @@ -112,7 +112,7 @@ func8: ƒ * whitespace( x ) func9: async ƒ whitespace2( x , y , z ) [[Prototype]]: Object -console-functions.js:35 Object +console-functions.js:34 Object func0: ƒ simple() func1: async ƒ asyncSimple() func2: ƒ* genSimple()
diff --git a/third_party/blink/web_tests/http/tests/devtools/console/console-functions.js b/third_party/blink/web_tests/http/tests/devtools/console/console-functions.js index 4bda8ed7..ca7c7917 100644 --- a/third_party/blink/web_tests/http/tests/devtools/console/console-functions.js +++ b/third_party/blink/web_tests/http/tests/devtools/console/console-functions.js
@@ -8,7 +8,6 @@ (async function() { TestRunner.addResult(`Tests that console logging different types of functions correctly.\n`); - await TestRunner.loadLegacyModule('console'); await TestRunner.showPanel('console'); await TestRunner.evaluateInPagePromise(`
diff --git a/third_party/blink/web_tests/http/tests/devtools/console/console-group-click-expected.txt b/third_party/blink/web_tests/http/tests/devtools/console/console-group-click-expected.txt index 36bd234..d90114fd 100644 --- a/third_party/blink/web_tests/http/tests/devtools/console/console-group-click-expected.txt +++ b/third_party/blink/web_tests/http/tests/devtools/console/console-group-click-expected.txt
@@ -2,13 +2,13 @@ Before -console-group-click.js:15 group with object {x: 1} +console-group-click.js:16 group with object {x: 1} Click on the group -console-group-click.js:15 group with object {x: 1} -console-group-click.js:16 Message inside group +console-group-click.js:16 group with object {x: 1} +console-group-click.js:17 Message inside group Click on the object -console-group-click.js:15 group with object {x: 1}x: 1[[Prototype]]: Object -console-group-click.js:16 Message inside group +console-group-click.js:16 group with object {x: 1}x: 1[[Prototype]]: Object +console-group-click.js:17 Message inside group
diff --git a/third_party/blink/web_tests/http/tests/devtools/console/console-group-click.js b/third_party/blink/web_tests/http/tests/devtools/console/console-group-click.js index 5e67f5be..ad04592 100644 --- a/third_party/blink/web_tests/http/tests/devtools/console/console-group-click.js +++ b/third_party/blink/web_tests/http/tests/devtools/console/console-group-click.js
@@ -5,10 +5,11 @@ import {TestRunner} from 'test_runner'; import {ConsoleTestRunner} from 'console_test_runner'; +import * as Console from 'devtools/panels/console/console.js'; + (async function() { TestRunner.addResult(`Tests that clicks on console.group target the appropriate element.\n`); - await TestRunner.loadLegacyModule('console'); await TestRunner.showPanel('console'); await TestRunner.evaluateInPagePromise(` @@ -16,7 +17,7 @@ console.log("Message inside group"); console.groupEnd(); `); - const messagesElement = Console.ConsoleView.instance().messagesElement; + const messagesElement = Console.ConsoleView.ConsoleView.instance().messagesElement; TestRunner.addResult(`\nBefore`); await ConsoleTestRunner.dumpConsoleMessages();
diff --git a/third_party/blink/web_tests/http/tests/devtools/console/console-group-similar.js b/third_party/blink/web_tests/http/tests/devtools/console/console-group-similar.js index dcfb9ca..3d9a2506 100644 --- a/third_party/blink/web_tests/http/tests/devtools/console/console-group-similar.js +++ b/third_party/blink/web_tests/http/tests/devtools/console/console-group-similar.js
@@ -6,17 +6,17 @@ import {ConsoleTestRunner} from 'console_test_runner'; import * as SDK from 'devtools/core/sdk/sdk.js'; +import * as Console from 'devtools/panels/console/console.js'; (async function() { TestRunner.addResult(`Tests that console correctly groups similar messages.\n`); - await TestRunner.loadLegacyModule('console'); await TestRunner.showPanel('console'); // Show all messages, including verbose. - Console.ConsoleView.instance().setImmediatelyFilterMessagesForTest(); - Console.ConsoleView.instance().filter.textFilterUI.setValue("url:script"); - Console.ConsoleView.instance().filter.messageLevelFiltersSetting.set(Console.ConsoleFilter.allLevelsFilterValue()); + Console.ConsoleView.ConsoleView.instance().setImmediatelyFilterMessagesForTest(); + Console.ConsoleView.ConsoleView.instance().filter.textFilterUI.setValue("url:script"); + Console.ConsoleView.ConsoleView.instance().filter.messageLevelFiltersSetting.set(Console.ConsoleFilter.ConsoleFilter.allLevelsFilterValue()); for (var i = 0; i < 5; i++) { // Groupable messages. @@ -39,7 +39,7 @@ await ConsoleTestRunner.dumpConsoleMessages(); TestRunner.addResult('\n\nStop grouping messages:\n'); - Console.ConsoleView.instance().groupSimilarSetting.set(false); + Console.ConsoleView.ConsoleView.instance().groupSimilarSetting.set(false); await ConsoleTestRunner.dumpConsoleMessages(); TestRunner.completeTest();
diff --git a/third_party/blink/web_tests/http/tests/devtools/console/console-history-contains-requested-text.js b/third_party/blink/web_tests/http/tests/devtools/console/console-history-contains-requested-text.js index 1620ee4..887684e6 100644 --- a/third_party/blink/web_tests/http/tests/devtools/console/console-history-contains-requested-text.js +++ b/third_party/blink/web_tests/http/tests/devtools/console/console-history-contains-requested-text.js
@@ -5,17 +5,18 @@ import {TestRunner} from 'test_runner'; import {ConsoleTestRunner} from 'console_test_runner'; +import * as Console from 'devtools/panels/console/console.js'; + (async function() { TestRunner.addResult( `Tests that expression which is evaluated as Object Literal, is correctly stored in console history. (crbug.com/584881)\n`); - await TestRunner.loadLegacyModule('console'); await TestRunner.showPanel('console'); ConsoleTestRunner.evaluateInConsole('{a:1, b:2}', step2); function step2() { - var consoleView = Console.ConsoleView.instance(); + var consoleView = Console.ConsoleView.ConsoleView.instance(); TestRunner.addResult(consoleView.prompt.history().previous()); TestRunner.completeTest(); }
diff --git a/third_party/blink/web_tests/http/tests/devtools/console/console-last-result.js b/third_party/blink/web_tests/http/tests/devtools/console/console-last-result.js index 2f5f6552..f6971323 100644 --- a/third_party/blink/web_tests/http/tests/devtools/console/console-last-result.js +++ b/third_party/blink/web_tests/http/tests/devtools/console/console-last-result.js
@@ -5,10 +5,11 @@ import {TestRunner} from 'test_runner'; import {ConsoleTestRunner} from 'console_test_runner'; +import * as Console from 'devtools/panels/console/console.js'; + (async function() { TestRunner.addResult(`Tests that console exposes last evaluation result as $_.\n`); - await TestRunner.loadLegacyModule('console'); await TestRunner.showPanel('console'); @@ -24,7 +25,7 @@ ConsoleTestRunner.evaluateInConsole('1+1', step1); function step1() { - Console.ConsoleView.clearConsole(); + Console.ConsoleView.ConsoleView.clearConsole(); TestRunner.deprecatedRunAfterPendingDispatches(step2); }
diff --git a/third_party/blink/web_tests/http/tests/devtools/console/console-link-to-snippet.js b/third_party/blink/web_tests/http/tests/devtools/console/console-link-to-snippet.js index 0f1eca6..1c6942b 100644 --- a/third_party/blink/web_tests/http/tests/devtools/console/console-link-to-snippet.js +++ b/third_party/blink/web_tests/http/tests/devtools/console/console-link-to-snippet.js
@@ -9,11 +9,11 @@ import * as Common from 'devtools/core/common/common.js'; import * as SourcesModule from 'devtools/panels/sources/sources.js'; import * as Persistence from 'devtools/models/persistence/persistence.js'; +import * as Console from 'devtools/panels/console/console.js'; (async function() { TestRunner.addResult(`Test that link to snippet works.\n`); - await TestRunner.loadLegacyModule('console'); await TestRunner.showPanel('console'); TestRunner.addSniffer( @@ -23,7 +23,7 @@ function testConsoleLogAndReturnMessageLocation(next) { ConsoleTestRunner.waitUntilNthMessageReceivedPromise(2) .then(() => ConsoleTestRunner.dumpConsoleMessages()) - .then(() => Console.ConsoleView.clearConsole()) + .then(() => Console.ConsoleView.ConsoleView.clearConsole()) .then(() => next()); createSnippetPromise('console.log(239);42') @@ -35,7 +35,7 @@ function testSnippetSyntaxError(next) { ConsoleTestRunner.waitUntilNthMessageReceivedPromise(1) .then(() => ConsoleTestRunner.dumpConsoleMessages()) - .then(() => Console.ConsoleView.clearConsole()) + .then(() => Console.ConsoleView.ConsoleView.clearConsole()) .then(() => next()); createSnippetPromise('\n }') @@ -47,7 +47,7 @@ function testConsoleErrorHighlight(next) { ConsoleTestRunner.waitUntilNthMessageReceivedPromise(4) .then(() => ConsoleTestRunner.dumpConsoleMessages()) - .then(() => Console.ConsoleView.clearConsole()) + .then(() => Console.ConsoleView.ConsoleView.clearConsole()) .then(() => next()); createSnippetPromise(`
diff --git a/third_party/blink/web_tests/http/tests/devtools/console/console-linkify-message-location.js b/third_party/blink/web_tests/http/tests/devtools/console/console-linkify-message-location.js index e7ce22f..9839474 100644 --- a/third_party/blink/web_tests/http/tests/devtools/console/console-linkify-message-location.js +++ b/third_party/blink/web_tests/http/tests/devtools/console/console-linkify-message-location.js
@@ -7,11 +7,11 @@ import * as Common from 'devtools/core/common/common.js'; import * as BindingsModule from 'devtools/models/bindings/bindings.js'; +import * as Console from 'devtools/panels/console/console.js'; (async function() { TestRunner.addResult(`Test that console.log() would linkify its location in respect with ignore-listing.\n`); - await TestRunner.loadLegacyModule('console'); await TestRunner.showPanel('console'); await TestRunner.evaluateInPagePromise(` function foo() @@ -58,7 +58,7 @@ } async function dumpConsoleMessageURLs() { - var messages = Console.ConsoleView.instance().visibleViewMessages; + var messages = Console.ConsoleView.ConsoleView.instance().visibleViewMessages; for (var i = 0; i < messages.length; ++i) { // Ordering is important here. Retrieveing the message element the first time triggers // live location creation and updates, which we need to await for correct locations.
diff --git a/third_party/blink/web_tests/http/tests/devtools/console/console-linkify-relative-links-expected.txt b/third_party/blink/web_tests/http/tests/devtools/console/console-linkify-relative-links-expected.txt index 1a5856f..683e760 100644 --- a/third_party/blink/web_tests/http/tests/devtools/console/console-linkify-relative-links-expected.txt +++ b/third_party/blink/web_tests/http/tests/devtools/console/console-linkify-relative-links-expected.txt
@@ -1,6 +1,6 @@ Test that logging an error in console would linkify relative URLs -console-linkify-relative-links.js:13 Error with relative links +console-linkify-relative-links.js:14 Error with relative links at (foo1.js:10:50) at (foo2.js:10:50) at (:8000/foo3.js:10:50)
diff --git a/third_party/blink/web_tests/http/tests/devtools/console/console-linkify-relative-links.js b/third_party/blink/web_tests/http/tests/devtools/console/console-linkify-relative-links.js index 8dfc8a9..00b09c0 100644 --- a/third_party/blink/web_tests/http/tests/devtools/console/console-linkify-relative-links.js +++ b/third_party/blink/web_tests/http/tests/devtools/console/console-linkify-relative-links.js
@@ -5,9 +5,10 @@ import {TestRunner} from 'test_runner'; import {ConsoleTestRunner} from 'console_test_runner'; +import * as Console from 'devtools/panels/console/console.js'; + (async function() { TestRunner.addResult(`Test that logging an error in console would linkify relative URLs\n`); - await TestRunner.loadLegacyModule('console'); await TestRunner.showPanel('console'); await TestRunner.evaluateInPagePromise(` console.log(\`Error with relative links @@ -21,7 +22,7 @@ `); await ConsoleTestRunner.dumpConsoleMessages(); - var consoleView = Console.ConsoleView.instance(); + var consoleView = Console.ConsoleView.ConsoleView.instance(); var links = consoleView.visibleViewMessages[0].element().querySelectorAll('.console-message-text .devtools-link'); for (var link of links) TestRunner.addResult(`Link: ${link.textContent}, href: ${link.href}`);
diff --git a/third_party/blink/web_tests/http/tests/devtools/console/console-links-on-messages-before-inspection.js b/third_party/blink/web_tests/http/tests/devtools/console/console-links-on-messages-before-inspection.js index 6a1863a..0077e47 100644 --- a/third_party/blink/web_tests/http/tests/devtools/console/console-links-on-messages-before-inspection.js +++ b/third_party/blink/web_tests/http/tests/devtools/console/console-links-on-messages-before-inspection.js
@@ -7,12 +7,12 @@ import * as SDK from 'devtools/core/sdk/sdk.js'; import * as UI from 'devtools/ui/legacy/legacy.js'; +import * as Console from 'devtools/panels/console/console.js'; (async function() { TestRunner.addResult( `Tests a handling of a click on the link in a message, which had been shown before its originating script was added.\n`); - await TestRunner.loadLegacyModule('console'); await TestRunner.showPanel('console'); await TestRunner.evaluateInPagePromise(` @@ -42,7 +42,7 @@ return; TestRunner.addResult('script was added'); - var message = Console.ConsoleView.instance().visibleViewMessages[0]; + var message = Console.ConsoleView.ConsoleView.instance().visibleViewMessages[0]; var anchorElement = message.element().querySelector('.devtools-link'); anchorElement.click(); }
diff --git a/third_party/blink/web_tests/http/tests/devtools/console/console-log-before-inspector-open-expected.txt b/third_party/blink/web_tests/http/tests/devtools/console/console-log-before-inspector-open-expected.txt index 4596adc..0b6f861 100644 --- a/third_party/blink/web_tests/http/tests/devtools/console/console-log-before-inspector-open-expected.txt +++ b/third_party/blink/web_tests/http/tests/devtools/console/console-log-before-inspector-open-expected.txt
@@ -1,9 +1,9 @@ Tests that Web Inspector won't crash if some console have been logged by the time it's opening. -console-log-before-inspector-open.js:16 log -console-log-before-inspector-open.js:17 info -console-log-before-inspector-open.js:18 warn +console-log-before-inspector-open.js:15 log +console-log-before-inspector-open.js:16 info +console-log-before-inspector-open.js:17 warn +(anonymous) @ console-log-before-inspector-open.js:17 +console-log-before-inspector-open.js:18 error (anonymous) @ console-log-before-inspector-open.js:18 -console-log-before-inspector-open.js:19 error -(anonymous) @ console-log-before-inspector-open.js:19
diff --git a/third_party/blink/web_tests/http/tests/devtools/console/console-log-before-inspector-open.js b/third_party/blink/web_tests/http/tests/devtools/console/console-log-before-inspector-open.js index d441740..87899276a 100644 --- a/third_party/blink/web_tests/http/tests/devtools/console/console-log-before-inspector-open.js +++ b/third_party/blink/web_tests/http/tests/devtools/console/console-log-before-inspector-open.js
@@ -9,7 +9,6 @@ TestRunner.addResult( `Tests that Web Inspector won't crash if some console have been logged by the time it's opening.\n`); - await TestRunner.loadLegacyModule('console'); await TestRunner.showPanel('console'); await TestRunner.evaluateInPagePromise(`
diff --git a/third_party/blink/web_tests/http/tests/devtools/console/console-log-custom-elements-expected.txt b/third_party/blink/web_tests/http/tests/devtools/console/console-log-custom-elements-expected.txt index f4baf46..444a119 100644 --- a/third_party/blink/web_tests/http/tests/devtools/console/console-log-custom-elements-expected.txt +++ b/third_party/blink/web_tests/http/tests/devtools/console/console-log-custom-elements-expected.txt
@@ -1,4 +1,4 @@ Tests that logging custom elements uses proper formatting. -console-log-custom-elements.js:22 foo-bar +console-log-custom-elements.js:21 foo-bar
diff --git a/third_party/blink/web_tests/http/tests/devtools/console/console-log-custom-elements.js b/third_party/blink/web_tests/http/tests/devtools/console/console-log-custom-elements.js index eb1680c..3db04db 100644 --- a/third_party/blink/web_tests/http/tests/devtools/console/console-log-custom-elements.js +++ b/third_party/blink/web_tests/http/tests/devtools/console/console-log-custom-elements.js
@@ -8,7 +8,6 @@ (async function() { TestRunner.addResult(`Tests that logging custom elements uses proper formatting.\n`); - await TestRunner.loadLegacyModule('console'); await TestRunner.showPanel('console'); await TestRunner.loadHTML(` <foo-bar></foo-bar>
diff --git a/third_party/blink/web_tests/http/tests/devtools/console/console-log-document-proto-expected.txt b/third_party/blink/web_tests/http/tests/devtools/console/console-log-document-proto-expected.txt index 393c672..3264ad6 100644 --- a/third_party/blink/web_tests/http/tests/devtools/console/console-log-document-proto-expected.txt +++ b/third_party/blink/web_tests/http/tests/devtools/console/console-log-document-proto-expected.txt
@@ -1,4 +1,4 @@ Test that console.dir(document.__proto__) won't result in an exception when the message is formatted in the inspector.Bug 27169. -console-log-document-proto.js:17 HTMLDocument +console-log-document-proto.js:16 HTMLDocument
diff --git a/third_party/blink/web_tests/http/tests/devtools/console/console-log-document-proto.js b/third_party/blink/web_tests/http/tests/devtools/console/console-log-document-proto.js index f4a1b61..e38d3ad 100644 --- a/third_party/blink/web_tests/http/tests/devtools/console/console-log-document-proto.js +++ b/third_party/blink/web_tests/http/tests/devtools/console/console-log-document-proto.js
@@ -10,7 +10,6 @@ `Test that console.dir(document.__proto__) won't result in an exception when the message is formatted in the inspector.Bug 27169.\n` ); - await TestRunner.loadLegacyModule('console'); await TestRunner.showPanel('console'); await TestRunner.evaluateInPagePromise(`
diff --git a/third_party/blink/web_tests/http/tests/devtools/console/console-log-eval-syntax-error-expected.txt b/third_party/blink/web_tests/http/tests/devtools/console/console-log-eval-syntax-error-expected.txt index 2ce9f4a..b79395e 100644 --- a/third_party/blink/web_tests/http/tests/devtools/console/console-log-eval-syntax-error-expected.txt +++ b/third_party/blink/web_tests/http/tests/devtools/console/console-log-eval-syntax-error-expected.txt
@@ -1,13 +1,13 @@ Tests that syntax errors in eval are logged into console, contains correct link and doesn't cause browser crash. VM:1 Uncaught SyntaxError: Unexpected token '}' - at foo (<anonymous>:16:11) -foo @ VM:16 + at foo (<anonymous>:15:11) +foo @ VM:15 setTimeout (async) -(anonymous) @ console-log-eval-syntax-error.js:24 +(anonymous) @ console-log-eval-syntax-error.js:23 boo.js:2 Uncaught SyntaxError: Unexpected token '}' (at boo.js:2:1) - at boo (<anonymous>:20:11) -boo @ VM:20 + at boo (<anonymous>:19:11) +boo @ VM:19 setTimeout (async) -(anonymous) @ console-log-eval-syntax-error.js:27 +(anonymous) @ console-log-eval-syntax-error.js:26
diff --git a/third_party/blink/web_tests/http/tests/devtools/console/console-log-eval-syntax-error.js b/third_party/blink/web_tests/http/tests/devtools/console/console-log-eval-syntax-error.js index a986c20..dc6ef19 100644 --- a/third_party/blink/web_tests/http/tests/devtools/console/console-log-eval-syntax-error.js +++ b/third_party/blink/web_tests/http/tests/devtools/console/console-log-eval-syntax-error.js
@@ -8,7 +8,6 @@ (async function() { TestRunner.addResult( `Tests that syntax errors in eval are logged into console, contains correct link and doesn't cause browser crash.\n`); - await TestRunner.loadLegacyModule('console'); await TestRunner.showPanel('console'); await TestRunner.evaluateInPagePromise(` function foo()
diff --git a/third_party/blink/web_tests/http/tests/devtools/console/console-log-in-xhtml.js b/third_party/blink/web_tests/http/tests/devtools/console/console-log-in-xhtml.js index 666ddcf..854dd2e0 100644 --- a/third_party/blink/web_tests/http/tests/devtools/console/console-log-in-xhtml.js +++ b/third_party/blink/web_tests/http/tests/devtools/console/console-log-in-xhtml.js
@@ -8,7 +8,6 @@ (async function() { TestRunner.addResult( `Tests that console message from inline script in xhtml document contains correct script position information.\n`); - await TestRunner.loadLegacyModule('console'); await TestRunner.showPanel('console'); await TestRunner.navigatePromise('resources/console-log-in-xhtml.xhtml');
diff --git a/third_party/blink/web_tests/http/tests/devtools/console/console-log-linkify-links.js b/third_party/blink/web_tests/http/tests/devtools/console/console-log-linkify-links.js index ee39ee3..4ce1ff2d 100644 --- a/third_party/blink/web_tests/http/tests/devtools/console/console-log-linkify-links.js +++ b/third_party/blink/web_tests/http/tests/devtools/console/console-log-linkify-links.js
@@ -5,10 +5,11 @@ import {TestRunner} from 'test_runner'; import {ConsoleTestRunner} from 'console_test_runner'; +import * as Console from 'devtools/panels/console/console.js'; + (async function() { TestRunner.addResult(`Test that console.log() would linkify the links. Bug 231074.\n`); - await TestRunner.loadLegacyModule('console'); await TestRunner.loadLegacyModule('components'); await TestRunner.showPanel('console'); await TestRunner.evaluateInPagePromise(` @@ -42,7 +43,7 @@ `); TestRunner.addResult('Dump urls in messages'); - var consoleView = Console.ConsoleView.instance(); + var consoleView = Console.ConsoleView.ConsoleView.instance(); var viewMessages = consoleView.visibleViewMessages; for (var i = 0; i < viewMessages.length; ++i) { var uiMessage = viewMessages[i]; @@ -61,8 +62,8 @@ // Ensures urls with lots of slashes does not bog down the regex. const dummyMessage = viewMessages[0]; - Console.ConsoleViewMessage.prototype.linkifyStringAsFragment.call(dummyMessage, '/'.repeat(1000)); - Console.ConsoleViewMessage.prototype.linkifyStringAsFragment.call(dummyMessage, '/a/'.repeat(1000)); + Console.ConsoleViewMessage.ConsoleViewMessage.prototype.linkifyStringAsFragment.call(dummyMessage, '/'.repeat(1000)); + Console.ConsoleViewMessage.ConsoleViewMessage.prototype.linkifyStringAsFragment.call(dummyMessage, '/a/'.repeat(1000)); TestRunner.completeTest(); })();
diff --git a/third_party/blink/web_tests/http/tests/devtools/console/console-log-linkify-stack-in-errors-expected.txt b/third_party/blink/web_tests/http/tests/devtools/console/console-log-linkify-stack-in-errors-expected.txt index 6264e21..2d3d8869 100644 --- a/third_party/blink/web_tests/http/tests/devtools/console/console-log-linkify-stack-in-errors-expected.txt +++ b/third_party/blink/web_tests/http/tests/devtools/console/console-log-linkify-stack-in-errors-expected.txt
@@ -3,62 +3,62 @@ foob.js:5 Error: Some test at namedFunction (foob.js:5:17) at foob.js:8:1 -console-log-linkify-…ack-in-errors.js:18 Error: line +console-log-linkify-…ack-in-errors.js:17 Error: line break - at forStack (console-log-linkify-…-in-errors.js:18:23) - at console-log-linkify-…k-in-errors.js:21:7 -console-log-linkify-…ack-in-errors.js:37 Error: Failed to execute 'removeChild' on 'Node': The node to be removed is not a child of this node. - at domError (console-log-linkify-…-in-errors.js:35:29) - at console-log-linkify-…k-in-errors.js:41:7 -console-log-linkify-…ack-in-errors.js:48 Error: some error - at logError (console-log-linkify-…-in-errors.js:46:21) - at console-log-linkify-…k-in-errors.js:52:7 -console-log-linkify-…ack-in-errors.js:54 Error message without stacks http://www.chromium.org/ -console-log-linkify-…ack-in-errors.js:56 Error valid stack #2 + at forStack (console-log-linkify-…-in-errors.js:17:23) + at console-log-linkify-…k-in-errors.js:20:7 +console-log-linkify-…ack-in-errors.js:36 Error: Failed to execute 'removeChild' on 'Node': The node to be removed is not a child of this node. + at domError (console-log-linkify-…-in-errors.js:34:29) + at console-log-linkify-…k-in-errors.js:40:7 +console-log-linkify-…ack-in-errors.js:47 Error: some error + at logError (console-log-linkify-…-in-errors.js:45:21) + at console-log-linkify-…k-in-errors.js:51:7 +console-log-linkify-…ack-in-errors.js:53 Error message without stacks http://www.chromium.org/ +console-log-linkify-…ack-in-errors.js:55 Error valid stack #2 at www.chromium.org/boo.js:40:70 at foo(www.chromium.org/foo.js:10:50) -console-log-linkify-…ack-in-errors.js:57 Error valid stack #3 +console-log-linkify-…ack-in-errors.js:56 Error valid stack #3 at www.chromium.org/foo.js:40 -console-log-linkify-…ack-in-errors.js:58 Error: MyError +console-log-linkify-…ack-in-errors.js:57 Error: MyError at throwError (www.chromium.org/foo.js:40) at eval (eval at <anonymous> (www.chromium.org/foo.js:42:1), <anonymous>:1:1) at www.chromium.org/foo.js:239 -console-log-linkify-…ack-in-errors.js:27 ReferenceError: valid stack - at stack2 (console-log-linkify-…-in-errors.js:27:27) - at stack1 (console-log-linkify-…-in-errors.js:29:11) +console-log-linkify-…ack-in-errors.js:26 ReferenceError: valid stack + at stack2 (console-log-linkify-…-in-errors.js:26:27) + at stack1 (console-log-linkify-…-in-errors.js:28:11) + at console-log-linkify-…k-in-errors.js:59:7 +console-log-linkify-…ack-in-errors.js:26 EvalError: valid stack + at stack2 (console-log-linkify-…-in-errors.js:26:27) + at stack1 (console-log-linkify-…-in-errors.js:28:11) at console-log-linkify-…k-in-errors.js:60:7 -console-log-linkify-…ack-in-errors.js:27 EvalError: valid stack - at stack2 (console-log-linkify-…-in-errors.js:27:27) - at stack1 (console-log-linkify-…-in-errors.js:29:11) +console-log-linkify-…ack-in-errors.js:26 SyntaxError: valid stack + at stack2 (console-log-linkify-…-in-errors.js:26:27) + at stack1 (console-log-linkify-…-in-errors.js:28:11) at console-log-linkify-…k-in-errors.js:61:7 -console-log-linkify-…ack-in-errors.js:27 SyntaxError: valid stack - at stack2 (console-log-linkify-…-in-errors.js:27:27) - at stack1 (console-log-linkify-…-in-errors.js:29:11) +console-log-linkify-…ack-in-errors.js:26 RangeError: valid stack + at stack2 (console-log-linkify-…-in-errors.js:26:27) + at stack1 (console-log-linkify-…-in-errors.js:28:11) at console-log-linkify-…k-in-errors.js:62:7 -console-log-linkify-…ack-in-errors.js:27 RangeError: valid stack - at stack2 (console-log-linkify-…-in-errors.js:27:27) - at stack1 (console-log-linkify-…-in-errors.js:29:11) +console-log-linkify-…ack-in-errors.js:26 TypeError: valid stack + at stack2 (console-log-linkify-…-in-errors.js:26:27) + at stack1 (console-log-linkify-…-in-errors.js:28:11) at console-log-linkify-…k-in-errors.js:63:7 -console-log-linkify-…ack-in-errors.js:27 TypeError: valid stack - at stack2 (console-log-linkify-…-in-errors.js:27:27) - at stack1 (console-log-linkify-…-in-errors.js:29:11) +console-log-linkify-…ack-in-errors.js:26 URIError: valid stack + at stack2 (console-log-linkify-…-in-errors.js:26:27) + at stack1 (console-log-linkify-…-in-errors.js:28:11) at console-log-linkify-…k-in-errors.js:64:7 -console-log-linkify-…ack-in-errors.js:27 URIError: valid stack - at stack2 (console-log-linkify-…-in-errors.js:27:27) - at stack1 (console-log-linkify-…-in-errors.js:29:11) - at console-log-linkify-…k-in-errors.js:65:7 -console-log-linkify-…ack-in-errors.js:67 Error broken stack +console-log-linkify-…ack-in-errors.js:66 Error broken stack at function_name(foob.js foob.js:30:1) at foob.js:40:70 -console-log-linkify-…ack-in-errors.js:68 Error broken stack #2 +console-log-linkify-…ack-in-errors.js:67 Error broken stack #2 at function_name(foob.js:20:30 -console-log-linkify-…ack-in-errors.js:69 Error broken stack #3 +console-log-linkify-…ack-in-errors.js:68 Error broken stack #3 at function_name(foob:20.js:30 bla -console-log-linkify-…ack-in-errors.js:70 Error broken stack #4 +console-log-linkify-…ack-in-errors.js:69 Error broken stack #4 at function_name)foob.js:20:30( -console-log-linkify-…ack-in-errors.js:71 Error broken stack #5 +console-log-linkify-…ack-in-errors.js:70 Error broken stack #5 at function_name foob.js:20:30) -console-log-linkify-…ack-in-errors.js:72 Error broken stack #6 +console-log-linkify-…ack-in-errors.js:71 Error broken stack #6 at foob.js foob.js:40:70 stack-with-sourceMap.coffee:2 Error at window.letsFailWithStack (stack-with-sourceMap.coffee:2:18)
diff --git a/third_party/blink/web_tests/http/tests/devtools/console/console-log-linkify-stack-in-errors.js b/third_party/blink/web_tests/http/tests/devtools/console/console-log-linkify-stack-in-errors.js index 342d265..c150524 100644 --- a/third_party/blink/web_tests/http/tests/devtools/console/console-log-linkify-stack-in-errors.js +++ b/third_party/blink/web_tests/http/tests/devtools/console/console-log-linkify-stack-in-errors.js
@@ -8,7 +8,6 @@ (async function() { TestRunner.addResult( `Test that console.log(new Error().stack) would linkify links in stacks for sourceUrls and sourceMaps Bug 424001.\n`); - await TestRunner.loadLegacyModule('console'); await TestRunner.showPanel('console'); await TestRunner.addScriptTag('resources/stack-with-sourceUrl.js'); await TestRunner.addScriptTag('resources/stack-with-sourceMap.js');
diff --git a/third_party/blink/web_tests/http/tests/devtools/console/console-log-object-with-getter-expected.txt b/third_party/blink/web_tests/http/tests/devtools/console/console-log-object-with-getter-expected.txt index 11c222c..4701054 100644 --- a/third_party/blink/web_tests/http/tests/devtools/console/console-log-object-with-getter-expected.txt +++ b/third_party/blink/web_tests/http/tests/devtools/console/console-log-object-with-getter-expected.txt
@@ -1,9 +1,9 @@ Tests that console logging dumps object values defined by getters and allows to expand it. -console-log-object-with-getter.js:33 {} -console-log-object-with-getter.js:34 (2) [(...), empty] -console-log-object-with-getter.js:35 {} -console-log-object-with-getter.js:33 {}foo: Objectget foo: ƒ ()set bar: ƒ (x)[[Prototype]]: Object -console-log-object-with-getter.js:34 (2) [(...), empty]0: 1length: 2get 0: ƒ ()set 1: ƒ (x)[[Prototype]]: Array(0) -console-log-object-with-getter.js:35 {}error: [Exception: custom stack]function: [Exception: ƒ ()]number: [Exception: 123]string: [Exception: "myString"]get error: ƒ error()get function: ƒ ()get number: ƒ number()get string: ƒ string()[[Prototype]]: Object +console-log-object-with-getter.js:32 {} +console-log-object-with-getter.js:33 (2) [(...), empty] +console-log-object-with-getter.js:34 {} +console-log-object-with-getter.js:32 {}foo: Objectget foo: ƒ ()set bar: ƒ (x)[[Prototype]]: Object +console-log-object-with-getter.js:33 (2) [(...), empty]0: 1length: 2get 0: ƒ ()set 1: ƒ (x)[[Prototype]]: Array(0) +console-log-object-with-getter.js:34 {}error: [Exception: custom stack]function: [Exception: ƒ ()]number: [Exception: 123]string: [Exception: "myString"]get error: ƒ error()get function: ƒ ()get number: ƒ number()get string: ƒ string()[[Prototype]]: Object
diff --git a/third_party/blink/web_tests/http/tests/devtools/console/console-log-object-with-getter.js b/third_party/blink/web_tests/http/tests/devtools/console/console-log-object-with-getter.js index bfbe656..075c87ac 100644 --- a/third_party/blink/web_tests/http/tests/devtools/console/console-log-object-with-getter.js +++ b/third_party/blink/web_tests/http/tests/devtools/console/console-log-object-with-getter.js
@@ -8,7 +8,6 @@ (async function() { TestRunner.addResult(`Tests that console logging dumps object values defined by getters and allows to expand it.\n`); - await TestRunner.loadLegacyModule('console'); await TestRunner.showPanel('console'); await TestRunner.evaluateInPagePromise(` var obj = {}
diff --git a/third_party/blink/web_tests/http/tests/devtools/console/console-log-short-hand-method-expected.txt b/third_party/blink/web_tests/http/tests/devtools/console/console-log-short-hand-method-expected.txt index ab3c29af..1fd183f4 100644 --- a/third_party/blink/web_tests/http/tests/devtools/console/console-log-short-hand-method-expected.txt +++ b/third_party/blink/web_tests/http/tests/devtools/console/console-log-short-hand-method-expected.txt
@@ -1,6 +1,6 @@ Tests that Web Inspector won't crash if some console have been logged by the time it's opening. -console-log-short-hand-method.js:27 {foo: ƒ, boo: ƒ, gen: ƒ} +console-log-short-hand-method.js:26 {foo: ƒ, boo: ƒ, gen: ƒ} baz: (...) boo: ƒ (c,d) foo: ƒ foo(a,b)
diff --git a/third_party/blink/web_tests/http/tests/devtools/console/console-log-short-hand-method.js b/third_party/blink/web_tests/http/tests/devtools/console/console-log-short-hand-method.js index f960ef1..420c956c 100644 --- a/third_party/blink/web_tests/http/tests/devtools/console/console-log-short-hand-method.js +++ b/third_party/blink/web_tests/http/tests/devtools/console/console-log-short-hand-method.js
@@ -9,7 +9,6 @@ TestRunner.addResult( `Tests that Web Inspector won't crash if some console have been logged by the time it's opening.\n`); - await TestRunner.loadLegacyModule('console'); await TestRunner.showPanel('console'); await TestRunner.evaluateInPagePromise(`
diff --git a/third_party/blink/web_tests/http/tests/devtools/console/console-log-side-effects-expected.txt b/third_party/blink/web_tests/http/tests/devtools/console/console-log-side-effects-expected.txt index f8ca493..3e5130e 100644 --- a/third_party/blink/web_tests/http/tests/devtools/console/console-log-side-effects-expected.txt +++ b/third_party/blink/web_tests/http/tests/devtools/console/console-log-side-effects-expected.txt
@@ -1,35 +1,35 @@ Tests various extreme usages of console.log() -console-log-side-effects.js:27 string -console-log-side-effects.js:28 42 -console-log-side-effects.js:29 false -console-log-side-effects.js:30 undefined -console-log-side-effects.js:31 null -console-log-side-effects.js:32 NaN -console-log-side-effects.js:33 -Infinity -console-log-side-effects.js:34 -0 -console-log-side-effects.js:35 Number {42} -console-log-side-effects.js:36 Number {-4.242e-11} -console-log-side-effects.js:37 Boolean {true} -console-log-side-effects.js:38 String {'foo'} -console-log-side-effects.js:39 {} -console-log-side-effects.js:40 Window {window: Window, self: Window, document: document, name: '', location: Location, …} -console-log-side-effects.js:46 -console-log-side-effects.js:50 {foo: 1, bar: 2} -console-log-side-effects.js:51 (3) [1, 2, 3] -console-log-side-effects.js:53 Uint32Array(3) [1, 2, 3, buffer: ArrayBuffer(12), byteLength: 12, byteOffset: 0, length: 3, Symbol(Symbol.toStringTag): 'Uint32Array'] -console-log-side-effects.js:56 (4) [1, 2, 3, {…}] -console-log-side-effects.js:59 {toString: ƒ} -console-log-side-effects.js:62 (5) [1, 2, 3, {…}, {…}] -console-log-side-effects.js:73 (3) [Array(1), Array(1), Array(3)] -console-log-side-effects.js:82 {toString: ƒ} -console-log-side-effects.js:85 (6) [1, 2, 3, {…}, {…}, {…}] -console-log-side-effects.js:91 (100001) [1, 2, 3, {…}, {…}, {…}, empty × 99994, 100000] -console-log-side-effects.js:91 (1000001) [1, 2, 3, {…}, {…}, {…}, empty × 99994, 100000, empty × 899999, 1000000] -console-log-side-effects.js:91 (10000001) [1, 2, 3, {…}, {…}, {…}, empty × 99994, 100000, empty × 899999, 1000000, empty × 8999999, 10000000] -console-log-side-effects.js:91 (100000001) [1, 2, 3, {…}, {…}, {…}, empty × 99994, 100000, empty × 899999, 1000000, empty × 8999999, 10000000, empty × 89999999, 100000000] -console-log-side-effects.js:91 (1000000001) [1, 2, 3, {…}, {…}, {…}, empty × 99994, 100000, empty × 899999, 1000000, empty × 8999999, 10000000, empty × 89999999, 100000000, empty × 899999999, 1000000000] -console-log-side-effects.js:94 (4294967295) [1, 2, 3, {…}, {…}, {…}, empty × 99994, 100000, empty × 899999, 1000000, empty × 8999999, 10000000, empty × 89999999, 100000000, empty × 899999999, 1000000000, empty × 3294967293, Array(3)] -console-log-side-effects.js:101 (10001) [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, …] -console-log-side-effects.js:107 [Array(1)] +console-log-side-effects.js:26 string +console-log-side-effects.js:27 42 +console-log-side-effects.js:28 false +console-log-side-effects.js:29 undefined +console-log-side-effects.js:30 null +console-log-side-effects.js:31 NaN +console-log-side-effects.js:32 -Infinity +console-log-side-effects.js:33 -0 +console-log-side-effects.js:34 Number {42} +console-log-side-effects.js:35 Number {-4.242e-11} +console-log-side-effects.js:36 Boolean {true} +console-log-side-effects.js:37 String {'foo'} +console-log-side-effects.js:38 {} +console-log-side-effects.js:39 Window {window: Window, self: Window, document: document, name: '', location: Location, …} +console-log-side-effects.js:45 +console-log-side-effects.js:49 {foo: 1, bar: 2} +console-log-side-effects.js:50 (3) [1, 2, 3] +console-log-side-effects.js:52 Uint32Array(3) [1, 2, 3, buffer: ArrayBuffer(12), byteLength: 12, byteOffset: 0, length: 3, Symbol(Symbol.toStringTag): 'Uint32Array'] +console-log-side-effects.js:55 (4) [1, 2, 3, {…}] +console-log-side-effects.js:58 {toString: ƒ} +console-log-side-effects.js:61 (5) [1, 2, 3, {…}, {…}] +console-log-side-effects.js:72 (3) [Array(1), Array(1), Array(3)] +console-log-side-effects.js:81 {toString: ƒ} +console-log-side-effects.js:84 (6) [1, 2, 3, {…}, {…}, {…}] +console-log-side-effects.js:90 (100001) [1, 2, 3, {…}, {…}, {…}, empty × 99994, 100000] +console-log-side-effects.js:90 (1000001) [1, 2, 3, {…}, {…}, {…}, empty × 99994, 100000, empty × 899999, 1000000] +console-log-side-effects.js:90 (10000001) [1, 2, 3, {…}, {…}, {…}, empty × 99994, 100000, empty × 899999, 1000000, empty × 8999999, 10000000] +console-log-side-effects.js:90 (100000001) [1, 2, 3, {…}, {…}, {…}, empty × 99994, 100000, empty × 899999, 1000000, empty × 8999999, 10000000, empty × 89999999, 100000000] +console-log-side-effects.js:90 (1000000001) [1, 2, 3, {…}, {…}, {…}, empty × 99994, 100000, empty × 899999, 1000000, empty × 8999999, 10000000, empty × 89999999, 100000000, empty × 899999999, 1000000000] +console-log-side-effects.js:93 (4294967295) [1, 2, 3, {…}, {…}, {…}, empty × 99994, 100000, empty × 899999, 1000000, empty × 8999999, 10000000, empty × 89999999, 100000000, empty × 899999999, 1000000000, empty × 3294967293, Array(3)] +console-log-side-effects.js:100 (10001) [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, …] +console-log-side-effects.js:106 [Array(1)]
diff --git a/third_party/blink/web_tests/http/tests/devtools/console/console-log-side-effects.js b/third_party/blink/web_tests/http/tests/devtools/console/console-log-side-effects.js index 30913b9..0afffcd 100644 --- a/third_party/blink/web_tests/http/tests/devtools/console/console-log-side-effects.js +++ b/third_party/blink/web_tests/http/tests/devtools/console/console-log-side-effects.js
@@ -7,7 +7,6 @@ (async function() { TestRunner.addResult(`Tests various extreme usages of console.log()\n`); - await TestRunner.loadLegacyModule('console'); await TestRunner.showPanel('console'); await TestRunner.loadHTML(` <p id="node">
diff --git a/third_party/blink/web_tests/http/tests/devtools/console/console-log-syntax-error.js b/third_party/blink/web_tests/http/tests/devtools/console/console-log-syntax-error.js index 3705eb8..5c826e9 100644 --- a/third_party/blink/web_tests/http/tests/devtools/console/console-log-syntax-error.js +++ b/third_party/blink/web_tests/http/tests/devtools/console/console-log-syntax-error.js
@@ -7,7 +7,6 @@ (async function() { TestRunner.addResult(`Tests that syntax errors are logged into console and doesn't cause browser crash.\n`); - await TestRunner.loadLegacyModule('console'); await TestRunner.showPanel('console'); await TestRunner.addScriptTag('resources/syntax-error.js');
diff --git a/third_party/blink/web_tests/http/tests/devtools/console/console-log-toString-object.js b/third_party/blink/web_tests/http/tests/devtools/console/console-log-toString-object.js index f976c56..8483e8d 100644 --- a/third_party/blink/web_tests/http/tests/devtools/console/console-log-toString-object.js +++ b/third_party/blink/web_tests/http/tests/devtools/console/console-log-toString-object.js
@@ -8,7 +8,6 @@ (async function() { TestRunner.addResult( `Tests that passing an object which throws on string conversion into console.log won't crash inspected Page. The test passes if it doesn't crash. Bug 57557\n`); - await TestRunner.loadLegacyModule('console'); await TestRunner.showPanel('console'); await TestRunner.navigatePromise('resources/console-log-toString-object.html'); await TestRunner.reloadPagePromise();
diff --git a/third_party/blink/web_tests/http/tests/devtools/console/console-log-without-console-expected.txt b/third_party/blink/web_tests/http/tests/devtools/console/console-log-without-console-expected.txt index 62bd363..83dca9e 100644 --- a/third_party/blink/web_tests/http/tests/devtools/console/console-log-without-console-expected.txt +++ b/third_party/blink/web_tests/http/tests/devtools/console/console-log-without-console-expected.txt
@@ -1,9 +1,9 @@ Test that console.log can be called without console receiver. -console-log-without-console.js:15 1 -console-log-without-console.js:17 2 -console-log-without-console.js:19 3 -(anonymous) @ console-log-without-console.js:19 -console-log-without-console.js:21 4 -(anonymous) @ console-log-without-console.js:21 +console-log-without-console.js:14 1 +console-log-without-console.js:16 2 +console-log-without-console.js:18 3 +(anonymous) @ console-log-without-console.js:18 +console-log-without-console.js:20 4 +(anonymous) @ console-log-without-console.js:20
diff --git a/third_party/blink/web_tests/http/tests/devtools/console/console-log-without-console.js b/third_party/blink/web_tests/http/tests/devtools/console/console-log-without-console.js index 565bfdc9..9765aa14 100644 --- a/third_party/blink/web_tests/http/tests/devtools/console/console-log-without-console.js +++ b/third_party/blink/web_tests/http/tests/devtools/console/console-log-without-console.js
@@ -8,7 +8,6 @@ (async function() { TestRunner.addResult(`Test that console.log can be called without console receiver.\n`); - await TestRunner.loadLegacyModule('console'); await TestRunner.showPanel('console'); await TestRunner.evaluateInPagePromise(` var log = console.log;
diff --git a/third_party/blink/web_tests/http/tests/devtools/console/console-log-wrapped-in-framework-expected.txt b/third_party/blink/web_tests/http/tests/devtools/console/console-log-wrapped-in-framework-expected.txt index 5e5201d1..4366488 100644 --- a/third_party/blink/web_tests/http/tests/devtools/console/console-log-wrapped-in-framework-expected.txt +++ b/third_party/blink/web_tests/http/tests/devtools/console/console-log-wrapped-in-framework-expected.txt
@@ -1,5 +1,5 @@ Tests console.log() anchor location when the skip-stack-frames feature is enabled. -console-log-wrapped-in-framework.js:18 direct console.log() -console-log-wrapped-in-framework.js:19 framework log +console-log-wrapped-in-framework.js:17 direct console.log() +console-log-wrapped-in-framework.js:18 framework log
diff --git a/third_party/blink/web_tests/http/tests/devtools/console/console-log-wrapped-in-framework.js b/third_party/blink/web_tests/http/tests/devtools/console/console-log-wrapped-in-framework.js index 30b10d19..f1db810 100644 --- a/third_party/blink/web_tests/http/tests/devtools/console/console-log-wrapped-in-framework.js +++ b/third_party/blink/web_tests/http/tests/devtools/console/console-log-wrapped-in-framework.js
@@ -9,7 +9,6 @@ (async function() { TestRunner.addResult(`Tests console.log() anchor location when the skip-stack-frames feature is enabled.\n`); - await TestRunner.loadLegacyModule('console'); await TestRunner.showPanel('console'); await TestRunner.addScriptTag('resources/framework.js'); await TestRunner.evaluateInPagePromise(`
diff --git a/third_party/blink/web_tests/http/tests/devtools/console/console-memory-equals-console-memory.js b/third_party/blink/web_tests/http/tests/devtools/console/console-memory-equals-console-memory.js index 817c770..37be067 100644 --- a/third_party/blink/web_tests/http/tests/devtools/console/console-memory-equals-console-memory.js +++ b/third_party/blink/web_tests/http/tests/devtools/console/console-memory-equals-console-memory.js
@@ -7,7 +7,6 @@ (async function() { TestRunner.addResult(`Tests that console.memory returns fresh instance/samples.\n`); - await TestRunner.loadLegacyModule('console'); await TestRunner.showPanel('console'); ConsoleTestRunner.evaluateInConsole('console.memory === console.memory', step1);
diff --git a/third_party/blink/web_tests/http/tests/devtools/console/console-message-contains-async-stack-expected.txt b/third_party/blink/web_tests/http/tests/devtools/console/console-message-contains-async-stack-expected.txt index 3ef4345..7706e0f 100644 --- a/third_party/blink/web_tests/http/tests/devtools/console/console-message-contains-async-stack-expected.txt +++ b/third_party/blink/web_tests/http/tests/devtools/console/console-message-contains-async-stack-expected.txt
@@ -2,5 +2,5 @@ VM:1 Uncaught SyntaxError: Unexpected end of input setTimeout (async) -(anonymous) @ console-message-cont…s-async-stack.js:17 +(anonymous) @ console-message-cont…s-async-stack.js:16
diff --git a/third_party/blink/web_tests/http/tests/devtools/console/console-message-contains-async-stack.js b/third_party/blink/web_tests/http/tests/devtools/console/console-message-contains-async-stack.js index 19ab690..188b20c2 100644 --- a/third_party/blink/web_tests/http/tests/devtools/console/console-message-contains-async-stack.js +++ b/third_party/blink/web_tests/http/tests/devtools/console/console-message-contains-async-stack.js
@@ -8,7 +8,6 @@ (async function() { TestRunner.addResult(`Tests exception message with empty stack in console contains async stack trace.\n`); - await TestRunner.loadLegacyModule('console'); await TestRunner.showPanel('console'); await TestRunner.DebuggerAgent.setAsyncCallStackDepth(200);
diff --git a/third_party/blink/web_tests/http/tests/devtools/console/console-message-format-expected.txt b/third_party/blink/web_tests/http/tests/devtools/console/console-message-format-expected.txt index 81f5533..ce6fda3e 100644 --- a/third_party/blink/web_tests/http/tests/devtools/console/console-message-format-expected.txt +++ b/third_party/blink/web_tests/http/tests/devtools/console/console-message-format-expected.txt
@@ -1,14 +1,14 @@ Tests that console logging uses proper message formatting. -console-message-format.js:14 Message format number 1, 2 and 3.5 -console-message-format.js:15 Message format for string -console-message-format.js:16 Object {foo: 'bar'} -console-message-format.js:17 Array (2) ['foo', 'bar'] -console-message-format.js:18 Object as object: Object -console-message-format.js:19 Array as object: Array(2) -console-message-format.js:20 Floating as integers: 42 42 -console-message-format.js:21 Floating as is: 42.5 -console-message-format.js:22 Non-numbers as numbers: NaN NaN NaN -console-message-format.js:23 String as is: string -console-message-format.js:24 Object as string: [object HTMLDocument] +console-message-format.js:13 Message format number 1, 2 and 3.5 +console-message-format.js:14 Message format for string +console-message-format.js:15 Object {foo: 'bar'} +console-message-format.js:16 Array (2) ['foo', 'bar'] +console-message-format.js:17 Object as object: Object +console-message-format.js:18 Array as object: Array(2) +console-message-format.js:19 Floating as integers: 42 42 +console-message-format.js:20 Floating as is: 42.5 +console-message-format.js:21 Non-numbers as numbers: NaN NaN NaN +console-message-format.js:22 String as is: string +console-message-format.js:23 Object as string: [object HTMLDocument]
diff --git a/third_party/blink/web_tests/http/tests/devtools/console/console-message-format.js b/third_party/blink/web_tests/http/tests/devtools/console/console-message-format.js index 05c69d5..a60adf4a 100644 --- a/third_party/blink/web_tests/http/tests/devtools/console/console-message-format.js +++ b/third_party/blink/web_tests/http/tests/devtools/console/console-message-format.js
@@ -8,7 +8,6 @@ (async function() { TestRunner.addResult(`Tests that console logging uses proper message formatting.\n`); - await TestRunner.loadLegacyModule('console'); await TestRunner.showPanel('console'); await TestRunner.evaluateInPagePromise(` console.log('Message format number %i, %d and %f', 1, 2, 3.5);
diff --git a/third_party/blink/web_tests/http/tests/devtools/console/console-message-from-inline-with-url-expected.txt b/third_party/blink/web_tests/http/tests/devtools/console/console-message-from-inline-with-url-expected.txt index dc4b27c56b..675ac0c 100644 --- a/third_party/blink/web_tests/http/tests/devtools/console/console-message-from-inline-with-url-expected.txt +++ b/third_party/blink/web_tests/http/tests/devtools/console/console-message-from-inline-with-url-expected.txt
@@ -1,9 +1,9 @@ Tests that log message and syntax errors from inline scripts with sourceURL are logged into console, contains correct link and doesn't cause browser crash. -foo.js:16 foo +foo.js:15 foo boo.js:1 Uncaught SyntaxError: Unexpected token '}' (at boo.js:1:1) - at addInlineWithSyntaxError (foo.js:24:30) -addInlineWithSyntaxError @ foo.js:24 + at addInlineWithSyntaxError (foo.js:23:30) +addInlineWithSyntaxError @ foo.js:23 setTimeout (async) -(anonymous) @ console-message-from…line-with-url.js:32 +(anonymous) @ console-message-from…line-with-url.js:31
diff --git a/third_party/blink/web_tests/http/tests/devtools/console/console-message-from-inline-with-url.js b/third_party/blink/web_tests/http/tests/devtools/console/console-message-from-inline-with-url.js index e0cbd3cc..b5f6dc21 100644 --- a/third_party/blink/web_tests/http/tests/devtools/console/console-message-from-inline-with-url.js +++ b/third_party/blink/web_tests/http/tests/devtools/console/console-message-from-inline-with-url.js
@@ -8,7 +8,6 @@ (async function() { TestRunner.addResult( `Tests that log message and syntax errors from inline scripts with sourceURL are logged into console, contains correct link and doesn't cause browser crash.\n`); - await TestRunner.loadLegacyModule('console'); await TestRunner.showPanel('console'); await TestRunner.evaluateInPagePromise(` function foo()
diff --git a/third_party/blink/web_tests/http/tests/devtools/console/console-message-from-script-inside-svg.js b/third_party/blink/web_tests/http/tests/devtools/console/console-message-from-script-inside-svg.js index b6fa7053..7e759795 100644 --- a/third_party/blink/web_tests/http/tests/devtools/console/console-message-from-script-inside-svg.js +++ b/third_party/blink/web_tests/http/tests/devtools/console/console-message-from-script-inside-svg.js
@@ -8,7 +8,6 @@ (async function() { TestRunner.addResult( `Tests that message from script inside svg has correct source location.\n`); - await TestRunner.loadLegacyModule('console'); await TestRunner.showPanel('console'); await TestRunner.navigatePromise('resources/svg.html'); await ConsoleTestRunner.dumpConsoleMessages();
diff --git a/third_party/blink/web_tests/http/tests/devtools/console/console-native-function.js b/third_party/blink/web_tests/http/tests/devtools/console/console-native-function.js index 8b9ff11..16ed65b 100644 --- a/third_party/blink/web_tests/http/tests/devtools/console/console-native-function.js +++ b/third_party/blink/web_tests/http/tests/devtools/console/console-native-function.js
@@ -7,7 +7,6 @@ (async function() { TestRunner.addResult(`Tests that console dumps native function without exception.\n`); - await TestRunner.loadLegacyModule('console'); await TestRunner.showPanel('console'); ConsoleTestRunner.evaluateInConsole('Math.random', step1);
diff --git a/third_party/blink/web_tests/http/tests/devtools/console/console-nested-group-expected.txt b/third_party/blink/web_tests/http/tests/devtools/console/console-nested-group-expected.txt index 2b1913e..610ba54e 100644 --- a/third_party/blink/web_tests/http/tests/devtools/console/console-nested-group-expected.txt +++ b/third_party/blink/web_tests/http/tests/devtools/console/console-nested-group-expected.txt
@@ -1,11 +1,11 @@ Tests that console.group/groupEnd messages won't be coalesced. Bug 56114. Bug 63521. -console-nested-group.js:15 outer group console-message-wrapper console-group-title console-from-api console-info-level > console-message -console-nested-group.js:16 inner group console-message-wrapper console-group-title console-from-api console-info-level > console-message -console-nested-group.js:17 Message inside inner group console-message-wrapper console-from-api console-info-level > console-message -console-nested-group.js:20 Message that must not be in any group console-message-wrapper console-from-api console-info-level > console-message -console-nested-group.js:25 One of several groups which shouldn't be coalesced. console-message-wrapper console-group-title console-from-api console-info-level > console-message -console-nested-group.js:25 One of several groups which shouldn't be coalesced. console-message-wrapper console-group-title console-from-api console-info-level > console-message -console-nested-group.js:25 One of several groups which shouldn't be coalesced. console-message-wrapper console-group-title console-from-api console-info-level > console-message -console-nested-group.js:27 Message inside third group console-message-wrapper console-from-api console-info-level > console-message +console-nested-group.js:14 outer group console-message-wrapper console-group-title console-from-api console-info-level > console-message +console-nested-group.js:15 inner group console-message-wrapper console-group-title console-from-api console-info-level > console-message +console-nested-group.js:16 Message inside inner group console-message-wrapper console-from-api console-info-level > console-message +console-nested-group.js:19 Message that must not be in any group console-message-wrapper console-from-api console-info-level > console-message +console-nested-group.js:24 One of several groups which shouldn't be coalesced. console-message-wrapper console-group-title console-from-api console-info-level > console-message +console-nested-group.js:24 One of several groups which shouldn't be coalesced. console-message-wrapper console-group-title console-from-api console-info-level > console-message +console-nested-group.js:24 One of several groups which shouldn't be coalesced. console-message-wrapper console-group-title console-from-api console-info-level > console-message +console-nested-group.js:26 Message inside third group console-message-wrapper console-from-api console-info-level > console-message
diff --git a/third_party/blink/web_tests/http/tests/devtools/console/console-nested-group.js b/third_party/blink/web_tests/http/tests/devtools/console/console-nested-group.js index ff10b8d1..3fe43f3 100644 --- a/third_party/blink/web_tests/http/tests/devtools/console/console-nested-group.js +++ b/third_party/blink/web_tests/http/tests/devtools/console/console-nested-group.js
@@ -8,7 +8,6 @@ (async function() { TestRunner.addResult(`Tests that console.group/groupEnd messages won't be coalesced. Bug 56114. Bug 63521.\n`); - await TestRunner.loadLegacyModule('console'); await TestRunner.showPanel('console'); await TestRunner.evaluateInPagePromise(`
diff --git a/third_party/blink/web_tests/http/tests/devtools/console/console-object-constructor-name-expected.txt b/third_party/blink/web_tests/http/tests/devtools/console/console-object-constructor-name-expected.txt index 6183c79..a3ae1eb8 100644 --- a/third_party/blink/web_tests/http/tests/devtools/console/console-object-constructor-name-expected.txt +++ b/third_party/blink/web_tests/http/tests/devtools/console/console-object-constructor-name-expected.txt
@@ -1,6 +1,6 @@ Tests that the name of the function invoked as object constructor will be displayed as its type in the front-end. Bug 50063. -console-object-constructor-name.js:20 Parent {} -console-object-constructor-name.js:21 Child {} -console-object-constructor-name.js:22 inner {} +console-object-constructor-name.js:19 Parent {} +console-object-constructor-name.js:20 Child {} +console-object-constructor-name.js:21 inner {}
diff --git a/third_party/blink/web_tests/http/tests/devtools/console/console-object-constructor-name.js b/third_party/blink/web_tests/http/tests/devtools/console/console-object-constructor-name.js index 75e2ea4..9bb4afe 100644 --- a/third_party/blink/web_tests/http/tests/devtools/console/console-object-constructor-name.js +++ b/third_party/blink/web_tests/http/tests/devtools/console/console-object-constructor-name.js
@@ -8,7 +8,6 @@ (async function() { TestRunner.addResult( `Tests that the name of the function invoked as object constructor will be displayed as its type in the front-end. Bug 50063.\n`); - await TestRunner.loadLegacyModule('console'); await TestRunner.showPanel('console'); await TestRunner.evaluateInPagePromise(`
diff --git a/third_party/blink/web_tests/http/tests/devtools/console/console-object-preview.js b/third_party/blink/web_tests/http/tests/devtools/console/console-object-preview.js index 22b3e1d8..e2791e1 100644 --- a/third_party/blink/web_tests/http/tests/devtools/console/console-object-preview.js +++ b/third_party/blink/web_tests/http/tests/devtools/console/console-object-preview.js
@@ -7,7 +7,6 @@ (async function() { TestRunner.addResult(`Tests that console produces instant previews for arrays and objects.\n`); - await TestRunner.loadLegacyModule('console'); await TestRunner.showPanel('console'); await TestRunner.evaluateInPagePromise(` console.log("Mutating object in a loop");
diff --git a/third_party/blink/web_tests/http/tests/devtools/console/console-on-animation-worklet.js b/third_party/blink/web_tests/http/tests/devtools/console/console-on-animation-worklet.js index 93af8396..ec34ed1c 100644 --- a/third_party/blink/web_tests/http/tests/devtools/console/console-on-animation-worklet.js +++ b/third_party/blink/web_tests/http/tests/devtools/console/console-on-animation-worklet.js
@@ -7,7 +7,6 @@ (async function() { TestRunner.addResult(`Tests console output from AnimationWorklet.\n`); - await TestRunner.loadLegacyModule('console'); await TestRunner.showPanel('console'); await TestRunner.evaluateInPagePromise(` function importWorklet()
diff --git a/third_party/blink/web_tests/http/tests/devtools/console/console-on-paint-worklet.js b/third_party/blink/web_tests/http/tests/devtools/console/console-on-paint-worklet.js index 9467ce4..414368f 100644 --- a/third_party/blink/web_tests/http/tests/devtools/console/console-on-paint-worklet.js +++ b/third_party/blink/web_tests/http/tests/devtools/console/console-on-paint-worklet.js
@@ -7,7 +7,6 @@ (async function() { TestRunner.addResult(`Tests console output from PaintWorklet.\n`); - await TestRunner.loadLegacyModule('console'); await TestRunner.showPanel('console'); await TestRunner.evaluateInPagePromise(` function importWorklet() {
diff --git a/third_party/blink/web_tests/http/tests/devtools/console/console-originating-command.js b/third_party/blink/web_tests/http/tests/devtools/console/console-originating-command.js index 19c7df8e7..b134793 100644 --- a/third_party/blink/web_tests/http/tests/devtools/console/console-originating-command.js +++ b/third_party/blink/web_tests/http/tests/devtools/console/console-originating-command.js
@@ -7,7 +7,6 @@ (async function() { TestRunner.addResult(`Tests that console result has originating command associated with it.\n`); - await TestRunner.loadLegacyModule('console'); await TestRunner.showPanel('console'); ConsoleTestRunner.evaluateInConsole('1 + 1', step1);
diff --git a/third_party/blink/web_tests/http/tests/devtools/console/console-preserve-log-x-process-navigation.js b/third_party/blink/web_tests/http/tests/devtools/console/console-preserve-log-x-process-navigation.js index d0acb4f..e2ad473 100644 --- a/third_party/blink/web_tests/http/tests/devtools/console/console-preserve-log-x-process-navigation.js +++ b/third_party/blink/web_tests/http/tests/devtools/console/console-preserve-log-x-process-navigation.js
@@ -9,7 +9,6 @@ (async function() { TestRunner.addResult(`Tests that the console can preserve log messages across cross-process navigations.`); - await TestRunner.loadLegacyModule('console'); await TestRunner.showPanel('console'); await TestRunner.navigatePromise('http://devtools.oopif.test:8000/devtools/console/resources/log-message.html') Common.Settings.settingForTest('preserveConsoleLog').set(true);
diff --git a/third_party/blink/web_tests/http/tests/devtools/console/console-preserve-log.js b/third_party/blink/web_tests/http/tests/devtools/console/console-preserve-log.js index fe5f3b17..f485423 100644 --- a/third_party/blink/web_tests/http/tests/devtools/console/console-preserve-log.js +++ b/third_party/blink/web_tests/http/tests/devtools/console/console-preserve-log.js
@@ -10,7 +10,6 @@ (async function() { TestRunner.addResult(`Tests that the console can preserve log messages across navigations. Bug 53359\n`); - await TestRunner.loadLegacyModule('console'); await TestRunner.showPanel('console'); const consoleModel = SDK.TargetManager.TargetManager.instance().primaryPageTarget().model(SDK.ConsoleModel.ConsoleModel);
diff --git a/third_party/blink/web_tests/http/tests/devtools/console/console-preserve-scroll.js b/third_party/blink/web_tests/http/tests/devtools/console/console-preserve-scroll.js index 8ec283c..9d4e6523 100644 --- a/third_party/blink/web_tests/http/tests/devtools/console/console-preserve-scroll.js +++ b/third_party/blink/web_tests/http/tests/devtools/console/console-preserve-scroll.js
@@ -6,10 +6,10 @@ import {ConsoleTestRunner} from 'console_test_runner'; import * as UI from 'devtools/ui/legacy/legacy.js'; +import * as Console from 'devtools/panels/console/console.js'; (async function() { TestRunner.addResult(`Tests that console preserves scroll position when switching away.\n`); - await TestRunner.loadLegacyModule('console'); await TestRunner.showPanel('console'); // Do not use ConsoleTestRunner.fixConsoleViewportDimensions because fixing the height will affect // tests that may cause scrolling while the console moves into/out of the drawer. @@ -21,7 +21,7 @@ `); await ConsoleTestRunner.waitForConsoleMessagesPromise(100); - var consoleView = Console.ConsoleView.instance(); + var consoleView = Console.ConsoleView.ConsoleView.instance(); var viewport = consoleView.viewport; viewport.setStickToBottom(false); // Avoid flakiness by ensuring that messages in visibleViewMessages are in DOM.
diff --git a/third_party/blink/web_tests/http/tests/devtools/console/console-proxy-expected.txt b/third_party/blink/web_tests/http/tests/devtools/console/console-proxy-expected.txt index 2247317..4f2fc72 100644 --- a/third_party/blink/web_tests/http/tests/devtools/console/console-proxy-expected.txt +++ b/third_party/blink/web_tests/http/tests/devtools/console/console-proxy-expected.txt
@@ -1,10 +1,10 @@ Tests that console logging dumps proxy properly. -console-proxy.js:28 Proxy(Object) {boo: 42, foo: 43} -console-proxy.js:30 Proxy(Object) {boo: 42, foo: 43} +console-proxy.js:29 Proxy(Object) {boo: 42, foo: 43} +console-proxy.js:31 Proxy(Object) {boo: 42, foo: 43} window.accessedGet = false info-note display: inline-block -console-proxy.js:28 Proxy(Object) {boo: 42, foo: 43}[[Handler]]: Object[[Target]]: Object[[IsRevoked]]: false -console-proxy.js:30 Proxy(Object) {boo: 42, foo: 43}[[Handler]]: Object[[Target]]: Proxy(Object)[[IsRevoked]]: false +console-proxy.js:29 Proxy(Object) {boo: 42, foo: 43}[[Handler]]: Object[[Target]]: Object[[IsRevoked]]: false +console-proxy.js:31 Proxy(Object) {boo: 42, foo: 43}[[Handler]]: Object[[Target]]: Proxy(Object)[[IsRevoked]]: false window.accessedGet = false
diff --git a/third_party/blink/web_tests/http/tests/devtools/console/console-proxy.js b/third_party/blink/web_tests/http/tests/devtools/console/console-proxy.js index a71c613..501c38f 100644 --- a/third_party/blink/web_tests/http/tests/devtools/console/console-proxy.js +++ b/third_party/blink/web_tests/http/tests/devtools/console/console-proxy.js
@@ -5,10 +5,11 @@ import {TestRunner} from 'test_runner'; import {ConsoleTestRunner} from 'console_test_runner'; +import * as Console from 'devtools/panels/console/console.js'; + (async function() { TestRunner.addResult(`Tests that console logging dumps proxy properly.\n`); - await TestRunner.loadLegacyModule('console'); await TestRunner.showPanel('console'); await TestRunner.evaluateInPagePromise(` window.accessedGet = false; @@ -35,7 +36,7 @@ TestRunner.evaluateInPage('testFunction()'); async function dumpMessages() { - var consoleView = Console.ConsoleView.instance(); + var consoleView = Console.ConsoleView.ConsoleView.instance(); consoleView.viewport.invalidate(); var element = consoleView.visibleViewMessages[0].contentElement(); @@ -49,7 +50,7 @@ } async function dumpExpandedConsoleMessages() { - var element = Console.ConsoleView.instance().visibleViewMessages[0].contentElement(); + var element = Console.ConsoleView.ConsoleView.instance().visibleViewMessages[0].contentElement(); dumpNoteVisible(element, 'info-note'); await ConsoleTestRunner.dumpConsoleMessages();
diff --git a/third_party/blink/web_tests/http/tests/devtools/console/console-repeat-count-expected.txt b/third_party/blink/web_tests/http/tests/devtools/console/console-repeat-count-expected.txt index fea6b1f..8e7e765 100644 --- a/third_party/blink/web_tests/http/tests/devtools/console/console-repeat-count-expected.txt +++ b/third_party/blink/web_tests/http/tests/devtools/console/console-repeat-count-expected.txt
@@ -7,29 +7,29 @@ await delayedPromise undefined undefined -2console-repeat-count.js:18 Message -2console-repeat-count.js:21 Error: Message with error - at dumpMessages (console-repeat-count.js:21:21) - at console-repeat-count.js:52:1 -console-repeat-count.js:24 {a: 1} -dumpMessages @ console-repeat-count.js:24 -(anonymous) @ console-repeat-count.js:52 -console-repeat-count.js:24 {a: 1} -dumpMessages @ console-repeat-count.js:24 -(anonymous) @ console-repeat-count.js:52 -2console-repeat-count.js:34 Uncaught Primitive value -(anonymous) @ console-repeat-count.js:34 +2console-repeat-count.js:17 Message +2console-repeat-count.js:20 Error: Message with error + at dumpMessages (console-repeat-count.js:20:21) + at console-repeat-count.js:51:1 +console-repeat-count.js:23 {a: 1} +dumpMessages @ console-repeat-count.js:23 +(anonymous) @ console-repeat-count.js:51 +console-repeat-count.js:23 {a: 1} +dumpMessages @ console-repeat-count.js:23 +(anonymous) @ console-repeat-count.js:51 +2console-repeat-count.js:33 Uncaught Primitive value +(anonymous) @ console-repeat-count.js:33 setTimeout (async) -throwPrimitiveValues @ console-repeat-count.js:34 +throwPrimitiveValues @ console-repeat-count.js:33 +(anonymous) @ console-repeat-count.js:52 +console-repeat-count.js:28 Uncaught {a: 1} +(anonymous) @ console-repeat-count.js:28 +setTimeout (async) +throwObjects @ console-repeat-count.js:28 (anonymous) @ console-repeat-count.js:53 -console-repeat-count.js:29 Uncaught {a: 1} -(anonymous) @ console-repeat-count.js:29 +console-repeat-count.js:28 Uncaught {a: 1} +(anonymous) @ console-repeat-count.js:28 setTimeout (async) -throwObjects @ console-repeat-count.js:29 -(anonymous) @ console-repeat-count.js:54 -console-repeat-count.js:29 Uncaught {a: 1} -(anonymous) @ console-repeat-count.js:29 -setTimeout (async) -throwObjects @ console-repeat-count.js:29 -(anonymous) @ console-repeat-count.js:54 +throwObjects @ console-repeat-count.js:28 +(anonymous) @ console-repeat-count.js:53
diff --git a/third_party/blink/web_tests/http/tests/devtools/console/console-repeat-count.js b/third_party/blink/web_tests/http/tests/devtools/console/console-repeat-count.js index 5a50d740..03fec435 100644 --- a/third_party/blink/web_tests/http/tests/devtools/console/console-repeat-count.js +++ b/third_party/blink/web_tests/http/tests/devtools/console/console-repeat-count.js
@@ -8,7 +8,6 @@ (async function() { TestRunner.addResult(`Tests that repeat count is properly updated.\n`); - await TestRunner.loadLegacyModule('console'); await TestRunner.showPanel('console'); await TestRunner.evaluateInPagePromise(`
diff --git a/third_party/blink/web_tests/http/tests/devtools/console/console-revoke-error-in-worker.js b/third_party/blink/web_tests/http/tests/devtools/console/console-revoke-error-in-worker.js index 8ed006e0..93462d8 100644 --- a/third_party/blink/web_tests/http/tests/devtools/console/console-revoke-error-in-worker.js +++ b/third_party/blink/web_tests/http/tests/devtools/console/console-revoke-error-in-worker.js
@@ -6,10 +6,10 @@ import {ConsoleTestRunner} from 'console_test_runner'; import * as SDK from 'devtools/core/sdk/sdk.js'; +import * as Console from 'devtools/panels/console/console.js'; (async function() { TestRunner.addResult(`Tests that console revokes lazily handled promise rejections.\n`); - await TestRunner.loadLegacyModule('console'); await TestRunner.showPanel('console'); await TestRunner.evaluateInPagePromise(` var worker; @@ -28,7 +28,7 @@ SDK.TargetManager.TargetManager.instance().addModelListener(SDK.ConsoleModel.ConsoleModel, SDK.ConsoleModel.Events.MessageAdded, messageAdded); SDK.TargetManager.TargetManager.instance().addModelListener(SDK.ConsoleModel.ConsoleModel, SDK.ConsoleModel.Events.MessageUpdated, messageUpdated); - Console.ConsoleView.instance().setImmediatelyFilterMessagesForTest(); + Console.ConsoleView.ConsoleView.instance().setImmediatelyFilterMessagesForTest(); TestRunner.addResult('Creating worker with promise'); TestRunner.evaluateInPageWithTimeout('createPromise()'); @@ -49,7 +49,7 @@ // Turn on verbose filter. TestRunner.addResult(`\nEnable verbose filter`); - Console.ConsoleViewFilter.levelFilterSetting().set(Console.ConsoleFilter.allLevelsFilterValue()); + Console.ConsoleView.ConsoleViewFilter.levelFilterSetting().set(Console.ConsoleFilter.ConsoleFilter.allLevelsFilterValue()); await ConsoleTestRunner.dumpConsoleCounters(); TestRunner.completeTest();
diff --git a/third_party/blink/web_tests/http/tests/devtools/console/console-revoke-error.js b/third_party/blink/web_tests/http/tests/devtools/console/console-revoke-error.js index 5cf49e4f..cf6ca4c 100644 --- a/third_party/blink/web_tests/http/tests/devtools/console/console-revoke-error.js +++ b/third_party/blink/web_tests/http/tests/devtools/console/console-revoke-error.js
@@ -7,10 +7,10 @@ import * as SDK from 'devtools/core/sdk/sdk.js'; import * as Common from 'devtools/core/common/common.js'; +import * as Console from 'devtools/panels/console/console.js'; (async function() { TestRunner.addResult(`Tests that console revokes lazily handled promise rejections.\n`); - await TestRunner.loadLegacyModule('console'); await TestRunner.showPanel('console'); await TestRunner.evaluateInPagePromise(` var p = []; @@ -31,7 +31,7 @@ var messageAddedListener = ConsoleTestRunner.wrapListener(messageAdded); const consoleModel = SDK.TargetManager.TargetManager.instance().primaryPageTarget().model(SDK.ConsoleModel.ConsoleModel); consoleModel.addEventListener(SDK.ConsoleModel.Events.MessageAdded, messageAddedListener); - Console.ConsoleView.instance().setImmediatelyFilterMessagesForTest(); + Console.ConsoleView.ConsoleView.instance().setImmediatelyFilterMessagesForTest(); Common.Settings.moduleSetting('consoleGroupSimilar').set(false); TestRunner.addResult('Creating promise'); TestRunner.evaluateInPageWithTimeout('createPromises()'); @@ -62,7 +62,7 @@ // Turn on verbose filter. TestRunner.addResult(`\nEnable verbose filter`); - Console.ConsoleViewFilter.levelFilterSetting().set(Console.ConsoleFilter.allLevelsFilterValue()); + Console.ConsoleView.ConsoleViewFilter.levelFilterSetting().set(Console.ConsoleFilter.ConsoleFilter.allLevelsFilterValue()); await ConsoleTestRunner.dumpConsoleCounters(); TestRunner.completeTest();
diff --git a/third_party/blink/web_tests/http/tests/devtools/console/console-save-to-temp-var.js b/third_party/blink/web_tests/http/tests/devtools/console/console-save-to-temp-var.js index ba891e9..b0442cb8 100644 --- a/third_party/blink/web_tests/http/tests/devtools/console/console-save-to-temp-var.js +++ b/third_party/blink/web_tests/http/tests/devtools/console/console-save-to-temp-var.js
@@ -11,7 +11,6 @@ (async function() { TestRunner.addResult(`Tests saving objects to temporary variables.\n`); - await TestRunner.loadLegacyModule('console'); await TestRunner.showPanel('sources'); await TestRunner.showPanel('console'); await TestRunner.evaluateInPagePromise(`
diff --git a/third_party/blink/web_tests/http/tests/devtools/console/console-script-with-same-url.js b/third_party/blink/web_tests/http/tests/devtools/console/console-script-with-same-url.js index 010cf6b..7d2a7b7 100644 --- a/third_party/blink/web_tests/http/tests/devtools/console/console-script-with-same-url.js +++ b/third_party/blink/web_tests/http/tests/devtools/console/console-script-with-same-url.js
@@ -8,7 +8,6 @@ (async function() { TestRunner.addResult( 'Checks that we show correct location for script evaluated twice.\n'); - await TestRunner.loadLegacyModule('console'); await TestRunner.showPanel('console'); await TestRunner.evaluateInPageAnonymously('console.log(1);//# sourceURL=a.js'); await TestRunner.evaluateInPageAnonymously('console.log(2);//# sourceURL=a.js');
diff --git a/third_party/blink/web_tests/http/tests/devtools/console/console-search-reveals-messages.js b/third_party/blink/web_tests/http/tests/devtools/console/console-search-reveals-messages.js index b88e5e5..cbaa984b 100644 --- a/third_party/blink/web_tests/http/tests/devtools/console/console-search-reveals-messages.js +++ b/third_party/blink/web_tests/http/tests/devtools/console/console-search-reveals-messages.js
@@ -5,10 +5,11 @@ import {TestRunner} from 'test_runner'; import {ConsoleTestRunner} from 'console_test_runner'; +import * as Console from 'devtools/panels/console/console.js'; + (async function() { TestRunner.addResult(`Tests that console viewport reveals messages on searching.\n`); - await TestRunner.loadLegacyModule('console'); await TestRunner.showPanel('console'); await TestRunner.evaluateInPagePromise(` for (var i = 0; i < 200; ++i) @@ -16,7 +17,7 @@ console.log("LAST MESSAGE"); `); - var consoleView = Console.ConsoleView.instance(); + var consoleView = Console.ConsoleView.ConsoleView.instance(); var viewport = consoleView.viewport; const maximumViewportMessagesCount = 150; TestRunner.runTestSuite([
diff --git a/third_party/blink/web_tests/http/tests/devtools/console/console-search.js b/third_party/blink/web_tests/http/tests/devtools/console/console-search.js index 10cd37f..4c699c5 100644 --- a/third_party/blink/web_tests/http/tests/devtools/console/console-search.js +++ b/third_party/blink/web_tests/http/tests/devtools/console/console-search.js
@@ -5,10 +5,11 @@ import {TestRunner} from 'test_runner'; import {ConsoleTestRunner} from 'console_test_runner'; +import * as Console from 'devtools/panels/console/console.js'; + (async function() { TestRunner.addResult(`Tests console search.\n`); - await TestRunner.loadLegacyModule('console'); await TestRunner.showPanel('console'); await TestRunner.evaluateInPagePromise(` console.log("FIRST MATCH, SECOND MATCH"); @@ -48,7 +49,7 @@ addResult(''); } - var consoleView = Console.ConsoleView.instance(); + var consoleView = Console.ConsoleView.ConsoleView.instance(); var viewport = consoleView.viewport; const maximumViewportMessagesCount = 150; TestRunner.runTestSuite([
diff --git a/third_party/blink/web_tests/http/tests/devtools/console/console-stack-overflow-expected.txt b/third_party/blink/web_tests/http/tests/devtools/console/console-stack-overflow-expected.txt index adc3b6e..f6247e3 100644 --- a/third_party/blink/web_tests/http/tests/devtools/console/console-stack-overflow-expected.txt +++ b/third_party/blink/web_tests/http/tests/devtools/console/console-stack-overflow-expected.txt
@@ -1,26 +1,26 @@ Tests that when stack overflow exception happens when inspector is open the stack trace is correctly shown in console. -console-stack-overflow.js:18 Uncaught RangeError: Maximum call stack size exceeded - at overflow (console-stack-overflow.js:18:27) - at overflow (console-stack-overflow.js:18:27) - at overflow (console-stack-overflow.js:18:27) - at overflow (console-stack-overflow.js:18:27) - at overflow (console-stack-overflow.js:18:27) - at overflow (console-stack-overflow.js:18:27) - at overflow (console-stack-overflow.js:18:27) - at overflow (console-stack-overflow.js:18:27) - at overflow (console-stack-overflow.js:18:27) - at overflow (console-stack-overflow.js:18:27) -overflow @ console-stack-overflow.js:18 -overflow @ console-stack-overflow.js:18 -overflow @ console-stack-overflow.js:18 -overflow @ console-stack-overflow.js:18 -overflow @ console-stack-overflow.js:18 -overflow @ console-stack-overflow.js:18 -overflow @ console-stack-overflow.js:18 -overflow @ console-stack-overflow.js:18 -overflow @ console-stack-overflow.js:18 -overflow @ console-stack-overflow.js:18 -overflow @ console-stack-overflow.js:18 +console-stack-overflow.js:19 Uncaught RangeError: Maximum call stack size exceeded + at overflow (console-stack-overflow.js:19:27) + at overflow (console-stack-overflow.js:19:27) + at overflow (console-stack-overflow.js:19:27) + at overflow (console-stack-overflow.js:19:27) + at overflow (console-stack-overflow.js:19:27) + at overflow (console-stack-overflow.js:19:27) + at overflow (console-stack-overflow.js:19:27) + at overflow (console-stack-overflow.js:19:27) + at overflow (console-stack-overflow.js:19:27) + at overflow (console-stack-overflow.js:19:27) +overflow @ console-stack-overflow.js:19 +overflow @ console-stack-overflow.js:19 +overflow @ console-stack-overflow.js:19 +overflow @ console-stack-overflow.js:19 +overflow @ console-stack-overflow.js:19 +overflow @ console-stack-overflow.js:19 +overflow @ console-stack-overflow.js:19 +overflow @ console-stack-overflow.js:19 +overflow @ console-stack-overflow.js:19 +overflow @ console-stack-overflow.js:19 +overflow @ console-stack-overflow.js:19 o
diff --git a/third_party/blink/web_tests/http/tests/devtools/console/console-stack-overflow.js b/third_party/blink/web_tests/http/tests/devtools/console/console-stack-overflow.js index b88f9d68..46bdb751 100644 --- a/third_party/blink/web_tests/http/tests/devtools/console/console-stack-overflow.js +++ b/third_party/blink/web_tests/http/tests/devtools/console/console-stack-overflow.js
@@ -5,12 +5,13 @@ import {TestRunner} from 'test_runner'; import {ConsoleTestRunner} from 'console_test_runner'; +import * as Console from 'devtools/panels/console/console.js'; + (async function() { TestRunner.addResult( `Tests that when stack overflow exception happens when inspector is open the stack trace is correctly shown in console.\n` ); - await TestRunner.loadLegacyModule('console'); await TestRunner.showPanel('console'); await TestRunner.evaluateInPagePromise(` // Both the call and the function entry may trigger stack overflow. @@ -26,7 +27,7 @@ TestRunner.evaluateInPage('doOverflow()', step2.bind(this)); function step2() { - if (Console.ConsoleView.instance().visibleViewMessages.length < 1) ConsoleTestRunner.addConsoleSniffer(step2); + if (Console.ConsoleView.ConsoleView.instance().visibleViewMessages.length < 1) ConsoleTestRunner.addConsoleSniffer(step2); else step3(); }
diff --git a/third_party/blink/web_tests/http/tests/devtools/console/console-string-format.js b/third_party/blink/web_tests/http/tests/devtools/console/console-string-format.js index 3738143..a96c513 100644 --- a/third_party/blink/web_tests/http/tests/devtools/console/console-string-format.js +++ b/third_party/blink/web_tests/http/tests/devtools/console/console-string-format.js
@@ -7,7 +7,6 @@ (async function() { TestRunner.addResult(`Tests that formatting processes '%' properly in case of missing formatters.\n`); - await TestRunner.loadLegacyModule('console'); await TestRunner.showPanel('console'); var params = [
diff --git a/third_party/blink/web_tests/http/tests/devtools/console/console-substituted.js b/third_party/blink/web_tests/http/tests/devtools/console/console-substituted.js index 3576d36..1fe78a2 100644 --- a/third_party/blink/web_tests/http/tests/devtools/console/console-substituted.js +++ b/third_party/blink/web_tests/http/tests/devtools/console/console-substituted.js
@@ -8,7 +8,6 @@ (async function() { TestRunner.addResult( `Tests that evaluate in console works even if window.console is substituted or deleted. Bug 53072\n`); - await TestRunner.loadLegacyModule('console'); await TestRunner.showPanel('console'); await TestRunner.evaluateInPagePromise(`
diff --git a/third_party/blink/web_tests/http/tests/devtools/console/console-table.js b/third_party/blink/web_tests/http/tests/devtools/console/console-table.js index bd727f4..6bbd3801 100644 --- a/third_party/blink/web_tests/http/tests/devtools/console/console-table.js +++ b/third_party/blink/web_tests/http/tests/devtools/console/console-table.js
@@ -10,7 +10,6 @@ `Tests that console.table is properly rendered on tables with more than 20 columns(maxColumnsToRender).\n` ); - await TestRunner.loadLegacyModule('console'); await TestRunner.showPanel('console'); await TestRunner.evaluateInPagePromise(` a = {};
diff --git a/third_party/blink/web_tests/http/tests/devtools/console/console-tainted-globals.js b/third_party/blink/web_tests/http/tests/devtools/console/console-tainted-globals.js index 30efbf09..6f5f308 100644 --- a/third_party/blink/web_tests/http/tests/devtools/console/console-tainted-globals.js +++ b/third_party/blink/web_tests/http/tests/devtools/console/console-tainted-globals.js
@@ -8,7 +8,6 @@ (async function() { TestRunner.addResult( `Tests that overriding global methods (like Array.prototype.push, Math.max) will not break the inspector.\n`); - await TestRunner.loadLegacyModule('console'); await TestRunner.showPanel('console'); await TestRunner.evaluateInPagePromise(` var originalError = window.Error;
diff --git a/third_party/blink/web_tests/http/tests/devtools/console/console-tests-expected.txt b/third_party/blink/web_tests/http/tests/devtools/console/console-tests-expected.txt index 9a5d5cd0..a706d5a 100644 --- a/third_party/blink/web_tests/http/tests/devtools/console/console-tests-expected.txt +++ b/third_party/blink/web_tests/http/tests/devtools/console/console-tests-expected.txt
@@ -1,22 +1,22 @@ Tests that console logging dumps proper messages. -console-tests.js:14 log console-message-wrapper console-from-api console-info-level > console-message -console-tests.js:15 debug console-message-wrapper console-from-api console-verbose-level > console-message -console-tests.js:16 info console-message-wrapper console-from-api console-info-level > console-message -console-tests.js:17 warn -(anonymous) @ console-tests.js:17 console-message-wrapper console-from-api console-warning-level > console-message -console-tests.js:18 error -(anonymous) @ console-tests.js:18 console-message-wrapper console-from-api console-error-level > console-message -5console-tests.js:20 repeated console-message-wrapper console-from-api console-info-level > console-message repeated-message -console-tests.js:22 count: 1 console-message-wrapper console-from-api console-info-level > console-message -console-tests.js:22 count: 2 console-message-wrapper console-from-api console-info-level > console-message -console-tests.js:23 group console-message-wrapper console-group-title console-from-api console-info-level > console-message -console-tests.js:25 1 2 3 console-message-wrapper console-from-api console-info-level > console-message -console-tests.js:26 groupCollapsed console-message-wrapper console-group-title console-from-api console-info-level > console-message -console-tests.js:38 default: 1 console-message-wrapper console-from-api console-info-level > console-message -console-tests.js:39 default: 2 console-message-wrapper console-from-api console-info-level > console-message -console-tests.js:40 default: 3 console-message-wrapper console-from-api console-info-level > console-message -console-tests.js:41 title: 1 console-message-wrapper console-from-api console-info-level > console-message -console-tests.js:42 title: 2 console-message-wrapper console-from-api console-info-level > console-message -console-tests.js:43 title: 3 console-message-wrapper console-from-api console-info-level > console-message +console-tests.js:15 log console-message-wrapper console-from-api console-info-level > console-message +console-tests.js:16 debug console-message-wrapper console-from-api console-verbose-level > console-message +console-tests.js:17 info console-message-wrapper console-from-api console-info-level > console-message +console-tests.js:18 warn +(anonymous) @ console-tests.js:18 console-message-wrapper console-from-api console-warning-level > console-message +console-tests.js:19 error +(anonymous) @ console-tests.js:19 console-message-wrapper console-from-api console-error-level > console-message +5console-tests.js:21 repeated console-message-wrapper console-from-api console-info-level > console-message repeated-message +console-tests.js:23 count: 1 console-message-wrapper console-from-api console-info-level > console-message +console-tests.js:23 count: 2 console-message-wrapper console-from-api console-info-level > console-message +console-tests.js:24 group console-message-wrapper console-group-title console-from-api console-info-level > console-message +console-tests.js:26 1 2 3 console-message-wrapper console-from-api console-info-level > console-message +console-tests.js:27 groupCollapsed console-message-wrapper console-group-title console-from-api console-info-level > console-message +console-tests.js:39 default: 1 console-message-wrapper console-from-api console-info-level > console-message +console-tests.js:40 default: 2 console-message-wrapper console-from-api console-info-level > console-message +console-tests.js:41 default: 3 console-message-wrapper console-from-api console-info-level > console-message +console-tests.js:42 title: 1 console-message-wrapper console-from-api console-info-level > console-message +console-tests.js:43 title: 2 console-message-wrapper console-from-api console-info-level > console-message +console-tests.js:44 title: 3 console-message-wrapper console-from-api console-info-level > console-message
diff --git a/third_party/blink/web_tests/http/tests/devtools/console/console-tests.js b/third_party/blink/web_tests/http/tests/devtools/console/console-tests.js index 00fa291e..59e028e 100644 --- a/third_party/blink/web_tests/http/tests/devtools/console/console-tests.js +++ b/third_party/blink/web_tests/http/tests/devtools/console/console-tests.js
@@ -5,10 +5,11 @@ import {TestRunner} from 'test_runner'; import {ConsoleTestRunner} from 'console_test_runner'; +import * as Console from 'devtools/panels/console/console.js'; + (async function() { TestRunner.addResult(`Tests that console logging dumps proper messages.\n`); - await TestRunner.loadLegacyModule('console'); await TestRunner.showPanel('console'); await TestRunner.evaluateInPagePromise(` console.log('log'); @@ -43,8 +44,8 @@ console.count("title"); `); - Console.ConsoleView.instance().setImmediatelyFilterMessagesForTest(); - Console.ConsoleViewFilter.levelFilterSetting().set(Console.ConsoleFilter.allLevelsFilterValue()); + Console.ConsoleView.ConsoleView.instance().setImmediatelyFilterMessagesForTest(); + Console.ConsoleView.ConsoleViewFilter.levelFilterSetting().set(Console.ConsoleFilter.ConsoleFilter.allLevelsFilterValue()); await ConsoleTestRunner.dumpConsoleMessagesWithClasses(); TestRunner.completeTest(); })();
diff --git a/third_party/blink/web_tests/http/tests/devtools/console/console-time-expected.txt b/third_party/blink/web_tests/http/tests/devtools/console/console-time-expected.txt index e0b1e1e..bf580720 100644 --- a/third_party/blink/web_tests/http/tests/devtools/console/console-time-expected.txt +++ b/third_party/blink/web_tests/http/tests/devtools/console/console-time-expected.txt
@@ -1,7 +1,7 @@ console.time / console.timeEnd tests. -console-time.js:17 default: <time> -console-time.js:19 42: <time> -console-time.js:21 239: <time> -console-time.js:23 [object Object]: <time> +console-time.js:16 default: <time> +console-time.js:18 42: <time> +console-time.js:20 239: <time> +console-time.js:22 [object Object]: <time>
diff --git a/third_party/blink/web_tests/http/tests/devtools/console/console-time.js b/third_party/blink/web_tests/http/tests/devtools/console/console-time.js index bcff8693..b18a3a60 100644 --- a/third_party/blink/web_tests/http/tests/devtools/console/console-time.js +++ b/third_party/blink/web_tests/http/tests/devtools/console/console-time.js
@@ -8,7 +8,6 @@ (async function() { TestRunner.addResult(`console.time / console.timeEnd tests.\n`); - await TestRunner.loadLegacyModule('console'); await TestRunner.showPanel('console'); await TestRunner.evaluateInPagePromise(` function testFunction()
diff --git a/third_party/blink/web_tests/http/tests/devtools/console/console-timestamp.js b/third_party/blink/web_tests/http/tests/devtools/console/console-timestamp.js index 095c32f..35f3aeb 100644 --- a/third_party/blink/web_tests/http/tests/devtools/console/console-timestamp.js +++ b/third_party/blink/web_tests/http/tests/devtools/console/console-timestamp.js
@@ -10,7 +10,6 @@ (async function() { TestRunner.addResult(`Tests the console timestamp setting.\n`); - await TestRunner.loadLegacyModule('console'); await TestRunner.showPanel('console'); // It is essential that we calculate timezone for this particular moment of time
diff --git a/third_party/blink/web_tests/http/tests/devtools/console/console-top-level-await.js b/third_party/blink/web_tests/http/tests/devtools/console/console-top-level-await.js index 5e95caa..0ff6995b 100644 --- a/third_party/blink/web_tests/http/tests/devtools/console/console-top-level-await.js +++ b/third_party/blink/web_tests/http/tests/devtools/console/console-top-level-await.js
@@ -8,7 +8,6 @@ (async function() { TestRunner.addResult('Tests that evaluation with top-level await may be performed in console.'); - await TestRunner.loadLegacyModule('console'); await TestRunner.showPanel('console'); await TestRunner.evaluateInPagePromise(`
diff --git a/third_party/blink/web_tests/http/tests/devtools/console/console-trace-arguments-expected.txt b/third_party/blink/web_tests/http/tests/devtools/console/console-trace-arguments-expected.txt index c6aa347f..79f79a2 100644 --- a/third_party/blink/web_tests/http/tests/devtools/console/console-trace-arguments-expected.txt +++ b/third_party/blink/web_tests/http/tests/devtools/console/console-trace-arguments-expected.txt
@@ -1,7 +1,7 @@ Tests that console.trace dumps arguments alongside the stack trace. -console-trace-arguments.js:16 1 2 3 -a @ console-trace-arguments.js:16 +console-trace-arguments.js:15 1 2 3 +a @ console-trace-arguments.js:15 setTimeout (async) -(anonymous) @ console-trace-arguments.js:24 +(anonymous) @ console-trace-arguments.js:23
diff --git a/third_party/blink/web_tests/http/tests/devtools/console/console-trace-arguments.js b/third_party/blink/web_tests/http/tests/devtools/console/console-trace-arguments.js index b37601d..3007063b 100644 --- a/third_party/blink/web_tests/http/tests/devtools/console/console-trace-arguments.js +++ b/third_party/blink/web_tests/http/tests/devtools/console/console-trace-arguments.js
@@ -8,7 +8,6 @@ (async function() { TestRunner.addResult(`Tests that console.trace dumps arguments alongside the stack trace.\n`); - await TestRunner.loadLegacyModule('console'); await TestRunner.showPanel('console'); await TestRunner.evaluateInPagePromise(` function a()
diff --git a/third_party/blink/web_tests/http/tests/devtools/console/console-trace-expected.txt b/third_party/blink/web_tests/http/tests/devtools/console/console-trace-expected.txt index 3be4cbe..6b67fb0a 100644 --- a/third_party/blink/web_tests/http/tests/devtools/console/console-trace-expected.txt +++ b/third_party/blink/web_tests/http/tests/devtools/console/console-trace-expected.txt
@@ -1,8 +1,8 @@ Tests that console.trace dumps stack trace with source URLs and line numbers. -console-trace.js:16 console.trace -b @ console-trace.js:16 -a @ console-trace.js:21 +console-trace.js:15 console.trace +b @ console-trace.js:15 +a @ console-trace.js:20 setTimeout (async) -(anonymous) @ console-trace.js:29 +(anonymous) @ console-trace.js:28
diff --git a/third_party/blink/web_tests/http/tests/devtools/console/console-trace-in-eval-expected.txt b/third_party/blink/web_tests/http/tests/devtools/console/console-trace-in-eval-expected.txt index c5de412a..adcc8261 100644 --- a/third_party/blink/web_tests/http/tests/devtools/console/console-trace-in-eval-expected.txt +++ b/third_party/blink/web_tests/http/tests/devtools/console/console-trace-in-eval-expected.txt
@@ -5,8 +5,8 @@ a @ evalURL.js:10 evalSource @ evalURL.js:13 eval @ evalURL.js:14 -(anonymous) @ console-trace-in-eval.js:32 +(anonymous) @ console-trace-in-eval.js:31 setTimeout (async) -doEvalSource @ console-trace-in-eval.js:31 -(anonymous) @ console-trace-in-eval.js:42 +doEvalSource @ console-trace-in-eval.js:30 +(anonymous) @ console-trace-in-eval.js:41
diff --git a/third_party/blink/web_tests/http/tests/devtools/console/console-trace-in-eval.js b/third_party/blink/web_tests/http/tests/devtools/console/console-trace-in-eval.js index 10280cef..9df20e45 100644 --- a/third_party/blink/web_tests/http/tests/devtools/console/console-trace-in-eval.js +++ b/third_party/blink/web_tests/http/tests/devtools/console/console-trace-in-eval.js
@@ -8,7 +8,6 @@ (async function() { TestRunner.addResult( `Tests that when console.trace is called in eval'ed script ending with //# sourceURL=url it will dump a stack trace that will have the url as the script source. Bug 47252.\n`); - await TestRunner.loadLegacyModule('console'); await TestRunner.showPanel('console'); await TestRunner.evaluateInPagePromise(` function evalSource()
diff --git a/third_party/blink/web_tests/http/tests/devtools/console/console-trace.js b/third_party/blink/web_tests/http/tests/devtools/console/console-trace.js index 3582065..19304fe 100644 --- a/third_party/blink/web_tests/http/tests/devtools/console/console-trace.js +++ b/third_party/blink/web_tests/http/tests/devtools/console/console-trace.js
@@ -8,7 +8,6 @@ (async function() { TestRunner.addResult(`Tests that console.trace dumps stack trace with source URLs and line numbers.\n`); - await TestRunner.loadLegacyModule('console'); await TestRunner.showPanel('console'); await TestRunner.evaluateInPagePromise(` function b()
diff --git a/third_party/blink/web_tests/http/tests/devtools/console/console-trim-long-urls-expected.txt b/third_party/blink/web_tests/http/tests/devtools/console/console-trim-long-urls-expected.txt index 5ece6da..8d0546f 100644 --- a/third_party/blink/web_tests/http/tests/devtools/console/console-trim-long-urls-expected.txt +++ b/third_party/blink/web_tests/http/tests/devtools/console/console-trim-long-urls-expected.txt
@@ -1,5 +1,5 @@ Tests that a URL logged to the console is trimmed down to 150 characters. -console-trim-long-urls.js:17 The URL is: http://example.com/2---------3---------4---------5---------6---------7-----…---3---------4---------5---------6---------7---------8---------9---------0 -console-trim-long-urls.js:18 http://example.com/2---------3---------4---------5---------6---------7-----…---3---------4---------5---------6---------7---------8---------9---------0 +console-trim-long-urls.js:16 The URL is: http://example.com/2---------3---------4---------5---------6---------7-----…---3---------4---------5---------6---------7---------8---------9---------0 +console-trim-long-urls.js:17 http://example.com/2---------3---------4---------5---------6---------7-----…---3---------4---------5---------6---------7---------8---------9---------0
diff --git a/third_party/blink/web_tests/http/tests/devtools/console/console-trim-long-urls.js b/third_party/blink/web_tests/http/tests/devtools/console/console-trim-long-urls.js index 696e917..6713d5af 100644 --- a/third_party/blink/web_tests/http/tests/devtools/console/console-trim-long-urls.js +++ b/third_party/blink/web_tests/http/tests/devtools/console/console-trim-long-urls.js
@@ -8,7 +8,6 @@ (async function() { TestRunner.addResult(`Tests that a URL logged to the console is trimmed down to 150 characters.\n`); - await TestRunner.loadLegacyModule('console'); await TestRunner.showPanel('console'); await TestRunner.evaluateInPagePromise(` // 0---------1---------2---------3---------4---------5---------6---------7---------8---------9---------0---------1---------2---------3---------4---------5---------6---------7---------8---------9---------0
diff --git a/third_party/blink/web_tests/http/tests/devtools/console/console-uncaught-exception-in-eval-expected.txt b/third_party/blink/web_tests/http/tests/devtools/console/console-uncaught-exception-in-eval-expected.txt index 81b8f2ea..4eeef24 100644 --- a/third_party/blink/web_tests/http/tests/devtools/console/console-uncaught-exception-in-eval-expected.txt +++ b/third_party/blink/web_tests/http/tests/devtools/console/console-uncaught-exception-in-eval-expected.txt
@@ -11,8 +11,8 @@ evalSource @ evalURL.js:13 eval @ evalURL.js:14 setTimeout (async) -doEvalWithSourceURL @ VM:33 -(anonymous) @ console-uncaught-exception-in-eval.js:43 +doEvalWithSourceURL @ VM:34 +(anonymous) @ console-uncaught-exception-in-eval.js:44 VM:5 Uncaught Error: Exception in eval:anonymous at b (eval at <anonymous> (unknown source), <anonymous>:5:21) at a (eval at <anonymous> (unknown source), <anonymous>:10:15) @@ -24,6 +24,6 @@ evalSource @ VM:13 eval @ VM:14 setTimeout (async) -doAnonymousEvalWith @ VM:39 -(anonymous) @ console-uncaught-exception-in-eval.js:46 +doAnonymousEvalWith @ VM:40 +(anonymous) @ console-uncaught-exception-in-eval.js:47
diff --git a/third_party/blink/web_tests/http/tests/devtools/console/console-uncaught-exception-in-eval.js b/third_party/blink/web_tests/http/tests/devtools/console/console-uncaught-exception-in-eval.js index 93f2c944..51e93c7 100644 --- a/third_party/blink/web_tests/http/tests/devtools/console/console-uncaught-exception-in-eval.js +++ b/third_party/blink/web_tests/http/tests/devtools/console/console-uncaught-exception-in-eval.js
@@ -5,10 +5,11 @@ import {TestRunner} from 'test_runner'; import {ConsoleTestRunner} from 'console_test_runner'; +import * as Console from 'devtools/panels/console/console.js'; + (async function() { TestRunner.addResult( `Tests that when uncaught exception in eval'ed script ending with //# sourceURL=url is logged into console, its stack trace will have the url as the script source. Bug 47252.\n`); - await TestRunner.loadLegacyModule('console'); await TestRunner.showPanel('console'); await TestRunner.evaluateInPagePromise(` @@ -47,7 +48,7 @@ } function step3() { - if (Console.ConsoleView.instance().visibleViewMessages.length < 2) + if (Console.ConsoleView.ConsoleView.instance().visibleViewMessages.length < 2) ConsoleTestRunner.addConsoleSniffer(step3); else step4();
diff --git a/third_party/blink/web_tests/http/tests/devtools/console/console-uncaught-exception.js b/third_party/blink/web_tests/http/tests/devtools/console/console-uncaught-exception.js index 7afb3e1..35be386e 100644 --- a/third_party/blink/web_tests/http/tests/devtools/console/console-uncaught-exception.js +++ b/third_party/blink/web_tests/http/tests/devtools/console/console-uncaught-exception.js
@@ -7,7 +7,6 @@ (async function() { TestRunner.addResult(`Tests that uncaught exceptions are logged into console.Bug 47250.\n`); - await TestRunner.loadLegacyModule('console'); await TestRunner.showPanel('console'); await TestRunner.evaluateInPagePromise(`
diff --git a/third_party/blink/web_tests/http/tests/devtools/console/console-uncaught-promise-in-worker.js b/third_party/blink/web_tests/http/tests/devtools/console/console-uncaught-promise-in-worker.js index b0f84a8..a508cc1 100644 --- a/third_party/blink/web_tests/http/tests/devtools/console/console-uncaught-promise-in-worker.js +++ b/third_party/blink/web_tests/http/tests/devtools/console/console-uncaught-promise-in-worker.js
@@ -9,7 +9,6 @@ (async function() { TestRunner.addResult(`Tests that uncaught promise rejections happenned in workers are logged into console.\n`); - await TestRunner.loadLegacyModule('console'); await TestRunner.showPanel('console'); await TestRunner.evaluateInPagePromise(` var worker;
diff --git a/third_party/blink/web_tests/http/tests/devtools/console/console-viewport-control.js b/third_party/blink/web_tests/http/tests/devtools/console/console-viewport-control.js index a4a546f6..aa36fa7 100644 --- a/third_party/blink/web_tests/http/tests/devtools/console/console-viewport-control.js +++ b/third_party/blink/web_tests/http/tests/devtools/console/console-viewport-control.js
@@ -5,9 +5,10 @@ import {TestRunner} from 'test_runner'; import {ConsoleTestRunner} from 'console_test_runner'; +import * as Console from 'devtools/panels/console/console.js'; + (async function() { TestRunner.addResult(`Verifies viewport correctly shows and hides messages while logging and scrolling.\n`); - await TestRunner.loadLegacyModule('console'); await TestRunner.showPanel('console'); await TestRunner.evaluateInPagePromise(` function addMessages(count) @@ -26,7 +27,7 @@ `); ConsoleTestRunner.fixConsoleViewportDimensions(600, 200); - var consoleView = Console.ConsoleView.instance(); + var consoleView = Console.ConsoleView.ConsoleView.instance(); var viewport = consoleView.viewport; const smallCount = 3; @@ -50,8 +51,8 @@ function onWillHide() { wasRemovedFromDOM.add(this); } - TestRunner.addSniffer(Console.ConsoleViewMessage.prototype, 'wasShown', onWasShown, true); - TestRunner.addSniffer(Console.ConsoleViewMessage.prototype, 'willHide', onWillHide, true); + TestRunner.addSniffer(Console.ConsoleViewMessage.ConsoleViewMessage.prototype, 'wasShown', onWasShown, true); + TestRunner.addSniffer(Console.ConsoleViewMessage.ConsoleViewMessage.prototype, 'willHide', onWillHide, true); function resetShowHideCounts() { wasAddedToDOM.clear(); @@ -79,7 +80,7 @@ } function reset() { - Console.ConsoleView.clearConsole(); + Console.ConsoleView.ConsoleView.clearConsole(); resetShowHideCounts(); }
diff --git a/third_party/blink/web_tests/http/tests/devtools/console/console-viewport-indices.js b/third_party/blink/web_tests/http/tests/devtools/console/console-viewport-indices.js index ec9b44e..8228aece 100644 --- a/third_party/blink/web_tests/http/tests/devtools/console/console-viewport-indices.js +++ b/third_party/blink/web_tests/http/tests/devtools/console/console-viewport-indices.js
@@ -5,9 +5,10 @@ import {TestRunner} from 'test_runner'; import {ConsoleTestRunner} from 'console_test_runner'; +import * as Console from 'devtools/panels/console/console.js'; + (async function() { TestRunner.addResult(`Verifies viewport's visible and active message ranges.\n`); - await TestRunner.loadLegacyModule('console'); await TestRunner.showPanel('console'); await TestRunner.evaluateInPagePromise(` function addNormalMessages(count) @@ -32,7 +33,7 @@ `); ConsoleTestRunner.fixConsoleViewportDimensions(600, 200); - var consoleView = Console.ConsoleView.instance(); + var consoleView = Console.ConsoleView.ConsoleView.instance(); var viewport = consoleView.viewport; function logMessages(count, type) { @@ -79,13 +80,13 @@ TestRunner.runTestSuite([ async function testEmptyViewport(next) { - Console.ConsoleView.clearConsole(); + Console.ConsoleView.ConsoleView.clearConsole(); dumpVisibleIndices(); next(); }, async function testFirstLastVisibleIndices(next) { - Console.ConsoleView.clearConsole(); + Console.ConsoleView.ConsoleView.clearConsole(); await logMessages(100, 'Normal'); forceItemAndDump(0, true); @@ -103,7 +104,7 @@ }, async function testMultilineMessages(next) { - Console.ConsoleView.clearConsole(); + Console.ConsoleView.ConsoleView.clearConsole(); await logMessages(100, 'Multiline'); forceItemAndDump(0, true); @@ -121,7 +122,7 @@ }, async function testSlightlyBiggerMessages(next) { - Console.ConsoleView.clearConsole(); + Console.ConsoleView.ConsoleView.clearConsole(); await logMessages(100, 'SlightlyBigger'); forceItemAndDump(0, true);
diff --git a/third_party/blink/web_tests/http/tests/devtools/console/console-viewport-selection-expected.txt b/third_party/blink/web_tests/http/tests/devtools/console/console-viewport-selection-expected.txt index b6c4ae8..46e4ce8 100644 --- a/third_party/blink/web_tests/http/tests/devtools/console/console-viewport-selection-expected.txt +++ b/third_party/blink/web_tests/http/tests/devtools/console/console-viewport-selection-expected.txt
@@ -13,8 +13,8 @@ Running: testSelectionMultiLineText Selected text:<<<EOL -ole-viewport-selection.js:16 Message #74 -console-viewport-selection.js:16 Message #75 +ole-viewport-selection.js:17 Message #74 +console-viewport-selection.js:17 Message #75 console EOL @@ -58,10 +58,10 @@ Selected all 150 messages. Running: testSelectWithNonTextNodeContainer -Selected text: console-viewport-selection.js:16 Message #1 +Selected text: console-viewport-selection.js:17 Message #1 -Selected text: console-viewport-selection.js:16 Message #1 +Selected text: console-viewport-selection.js:17 Message #1 -Selected text: console-viewport-selection.js:16 Message #1 +Selected text: console-viewport-selection.js:17 Message #1
diff --git a/third_party/blink/web_tests/http/tests/devtools/console/console-viewport-selection.js b/third_party/blink/web_tests/http/tests/devtools/console/console-viewport-selection.js index 37d6982..476f3ab4 100644 --- a/third_party/blink/web_tests/http/tests/devtools/console/console-viewport-selection.js +++ b/third_party/blink/web_tests/http/tests/devtools/console/console-viewport-selection.js
@@ -5,9 +5,10 @@ import {TestRunner} from 'test_runner'; import {ConsoleTestRunner} from 'console_test_runner'; +import * as Console from 'devtools/panels/console/console.js'; + (async function() { TestRunner.addResult(`Tests that console viewport handles selection properly.\n`); - await TestRunner.loadLegacyModule('console'); await TestRunner.showPanel('console'); await TestRunner.evaluateInPagePromise(` function populateConsoleWithMessages(count) @@ -20,7 +21,7 @@ `); ConsoleTestRunner.fixConsoleViewportDimensions(600, 200); - var consoleView = Console.ConsoleView.instance(); + var consoleView = Console.ConsoleView.ConsoleView.instance(); var viewport = consoleView.viewport; const minimumViewportMessagesCount = 10; const messagesCount = 150;
diff --git a/third_party/blink/web_tests/http/tests/devtools/console/console-viewport-stick-to-bottom-onload.js b/third_party/blink/web_tests/http/tests/devtools/console/console-viewport-stick-to-bottom-onload.js index 5028f18..625711f 100644 --- a/third_party/blink/web_tests/http/tests/devtools/console/console-viewport-stick-to-bottom-onload.js +++ b/third_party/blink/web_tests/http/tests/devtools/console/console-viewport-stick-to-bottom-onload.js
@@ -5,6 +5,8 @@ import {TestRunner} from 'test_runner'; import {ConsoleTestRunner} from 'console_test_runner'; +import * as Console from 'devtools/panels/console/console.js'; + (async function() { TestRunner.addResult(`Verifies viewport stick-to-bottom behavior when Console is opened.\n`); @@ -15,11 +17,10 @@ //# sourceURL=console-viewport-stick-to-bottom-onload.js `); - await TestRunner.loadLegacyModule('console'); await TestRunner.showPanel('console'); await ConsoleTestRunner.waitUntilConsoleEditorLoaded(); - var viewport = Console.ConsoleView.instance().viewport; + var viewport = Console.ConsoleView.ConsoleView.instance().viewport; ConsoleTestRunner.waitForConsoleMessagesPromise(150); await ConsoleTestRunner.waitForPendingViewportUpdates();
diff --git a/third_party/blink/web_tests/http/tests/devtools/console/console-worker-nested-imports-syntax-error.js b/third_party/blink/web_tests/http/tests/devtools/console/console-worker-nested-imports-syntax-error.js index 5766c350..e4ed5c4 100644 --- a/third_party/blink/web_tests/http/tests/devtools/console/console-worker-nested-imports-syntax-error.js +++ b/third_party/blink/web_tests/http/tests/devtools/console/console-worker-nested-imports-syntax-error.js
@@ -7,7 +7,6 @@ (async function() { TestRunner.addResult(`Tests that nested import scripts in worker show correct stack on syntax error.\n`); - await TestRunner.loadLegacyModule('console'); await TestRunner.showPanel('console'); await TestRunner.evaluateInPagePromise(` function startWorker()
diff --git a/third_party/blink/web_tests/http/tests/devtools/console/console-xml-document-expected.txt b/third_party/blink/web_tests/http/tests/devtools/console/console-xml-document-expected.txt index 670c9cc..e3e2918c 100644 --- a/third_party/blink/web_tests/http/tests/devtools/console/console-xml-document-expected.txt +++ b/third_party/blink/web_tests/http/tests/devtools/console/console-xml-document-expected.txt
@@ -1,5 +1,5 @@ Tests that XML document contents are logged using the correct case in the console. -console-xml-document.js:14 #document<MixedCase> Test </MixedCase> -console-xml-document.js:16 <Book></Book> +console-xml-document.js:13 #document<MixedCase> Test </MixedCase> +console-xml-document.js:15 <Book></Book>
diff --git a/third_party/blink/web_tests/http/tests/devtools/console/console-xml-document.js b/third_party/blink/web_tests/http/tests/devtools/console/console-xml-document.js index 4690708..75376562 100644 --- a/third_party/blink/web_tests/http/tests/devtools/console/console-xml-document.js +++ b/third_party/blink/web_tests/http/tests/devtools/console/console-xml-document.js
@@ -8,7 +8,6 @@ (async function() { TestRunner.addResult(`Tests that XML document contents are logged using the correct case in the console.\n`); - await TestRunner.loadLegacyModule('console'); await TestRunner.showPanel('console'); await TestRunner.evaluateInPagePromise(` console.dirxml((new DOMParser()).parseFromString("<MixedCase> Test </MixedCase>", "text/xml"));
diff --git a/third_party/blink/web_tests/http/tests/devtools/console/console-xpath-expected.txt b/third_party/blink/web_tests/http/tests/devtools/console/console-xpath-expected.txt index 43d99d0..efdca94 100644 --- a/third_party/blink/web_tests/http/tests/devtools/console/console-xpath-expected.txt +++ b/third_party/blink/web_tests/http/tests/devtools/console/console-xpath-expected.txt
@@ -16,5 +16,5 @@ VM:1 Uncaught DOMException: Failed to execute '$x' on 'CommandLineAPI': The string './a@href' is not a valid XPath expression. at <anonymous>:1:1 (anonymous) @ VM:1 -console-xpath.js:28 complete +console-xpath.js:29 complete
diff --git a/third_party/blink/web_tests/http/tests/devtools/console/console-xpath.js b/third_party/blink/web_tests/http/tests/devtools/console/console-xpath.js index 89f22e6..ccbf714 100644 --- a/third_party/blink/web_tests/http/tests/devtools/console/console-xpath.js +++ b/third_party/blink/web_tests/http/tests/devtools/console/console-xpath.js
@@ -5,9 +5,10 @@ import {TestRunner} from 'test_runner'; import {ConsoleTestRunner} from 'console_test_runner'; +import * as Console from 'devtools/panels/console/console.js'; + (async function() { TestRunner.addResult(`Tests $x for iterator and non-iterator types.\n`); - await TestRunner.loadLegacyModule('console'); await TestRunner.showPanel('console'); await TestRunner.loadHTML(` <a href="http://chromium.org"></a> @@ -15,7 +16,7 @@ `); TestRunner.addSniffer( - Console.ConsoleViewMessage.prototype, 'formattedParameterAsNodeForTest', formattedParameter, true); + Console.ConsoleViewMessage.ConsoleViewMessage.prototype, 'formattedParameterAsNodeForTest', formattedParameter, true); ConsoleTestRunner.addConsoleViewSniffer(messageSniffer, true); await ConsoleTestRunner.evaluateInConsolePromise('$x(\'42\')'); // number
diff --git a/third_party/blink/web_tests/http/tests/devtools/console/exception-objects-expected.txt b/third_party/blink/web_tests/http/tests/devtools/console/exception-objects-expected.txt index 1e2114d..a8276f40 100644 --- a/third_party/blink/web_tests/http/tests/devtools/console/exception-objects-expected.txt +++ b/third_party/blink/web_tests/http/tests/devtools/console/exception-objects-expected.txt
@@ -2,60 +2,60 @@ setTimeout(throwError, 0); undefined undefined -foo.js:15 Uncaught Error: error_text - at throwError (foo.js:15:17) -throwError @ foo.js:15 +foo.js:14 Uncaught Error: error_text + at throwError (foo.js:14:17) +throwError @ foo.js:14 setTimeout (async) (anonymous) @ VM:1 throwError(); -foo.js:15 Uncaught Error: error_text - at throwError (foo.js:15:17) +foo.js:14 Uncaught Error: error_text + at throwError (foo.js:14:17) at <anonymous>:1:1 -throwError @ foo.js:15 +throwError @ foo.js:14 (anonymous) @ VM:1 setTimeout(throwObject, 0); undefined undefined -foo.js:20 Uncaught {a: 42} -throwObject @ foo.js:20 +foo.js:19 Uncaught {a: 42} +throwObject @ foo.js:19 setTimeout (async) (anonymous) @ VM:1 throwObject(); -foo.js:20 Uncaught {a: 42} -throwObject @ foo.js:20 +foo.js:19 Uncaught {a: 42} +throwObject @ foo.js:19 (anonymous) @ VM:1 setTimeout(throwNumber, 0); undefined undefined -foo.js:25 Uncaught 42 -throwNumber @ foo.js:25 +foo.js:24 Uncaught 42 +throwNumber @ foo.js:24 setTimeout (async) (anonymous) @ VM:1 throwNumber(); -foo.js:25 Uncaught 42 -throwNumber @ foo.js:25 +foo.js:24 Uncaught 42 +throwNumber @ foo.js:24 (anonymous) @ VM:1 setTimeout(rejectWithError, 0); undefined undefined -foo.js:30 Uncaught (in promise) Error: promise_error - at rejectWithError (foo.js:30:26) -rejectWithError @ foo.js:30 +foo.js:29 Uncaught (in promise) Error: promise_error + at rejectWithError (foo.js:29:26) +rejectWithError @ foo.js:29 setTimeout (async) (anonymous) @ VM:1 rejectWithError(); undefined -foo.js:30 Uncaught (in promise) Error: promise_error - at rejectWithError (foo.js:30:26) +foo.js:29 Uncaught (in promise) Error: promise_error + at rejectWithError (foo.js:29:26) at <anonymous>:1:1 -rejectWithError @ foo.js:30 +rejectWithError @ foo.js:29 (anonymous) @ VM:1 setTimeout(rejectWithObject, 0); undefined undefined -foo.js:35 Uncaught (in promise) {b: 42} -rejectWithObject @ foo.js:35 +foo.js:34 Uncaught (in promise) {b: 42} +rejectWithObject @ foo.js:34 setTimeout (async) (anonymous) @ VM:1 rejectWithObject(); undefined -foo.js:35 Uncaught (in promise) {b: 42} -rejectWithObject @ foo.js:35 +foo.js:34 Uncaught (in promise) {b: 42} +rejectWithObject @ foo.js:34 (anonymous) @ VM:1
diff --git a/third_party/blink/web_tests/http/tests/devtools/console/exception-objects.js b/third_party/blink/web_tests/http/tests/devtools/console/exception-objects.js index 5643c0ff6..759d7506 100644 --- a/third_party/blink/web_tests/http/tests/devtools/console/exception-objects.js +++ b/third_party/blink/web_tests/http/tests/devtools/console/exception-objects.js
@@ -7,7 +7,6 @@ (async function() { TestRunner.addResult(`Tests that expressions have thrown objects.\n`); - await TestRunner.loadLegacyModule('console'); await TestRunner.showPanel('console'); await TestRunner.evaluateInPagePromise(` function throwError()
diff --git a/third_party/blink/web_tests/http/tests/devtools/console/function-name-in-console-message-stack-expected.txt b/third_party/blink/web_tests/http/tests/devtools/console/function-name-in-console-message-stack-expected.txt index c16cb5c..f336a29 100644 --- a/third_party/blink/web_tests/http/tests/devtools/console/function-name-in-console-message-stack-expected.txt +++ b/third_party/blink/web_tests/http/tests/devtools/console/function-name-in-console-message-stack-expected.txt
@@ -1,9 +1,9 @@ Tests exception message contains stack with correct function name. -function-name-in-con…message-stack.js:16 Uncaught Error -foo.function.name @ function-name-in-con…message-stack.js:16 -bar @ function-name-in-con…message-stack.js:24 -baz.function.name @ function-name-in-con…message-stack.js:31 +function-name-in-con…message-stack.js:15 Uncaught Error +foo.function.name @ function-name-in-con…message-stack.js:15 +bar @ function-name-in-con…message-stack.js:23 +baz.function.name @ function-name-in-con…message-stack.js:30 setTimeout (async) -(anonymous) @ function-name-in-con…message-stack.js:38 +(anonymous) @ function-name-in-con…message-stack.js:37
diff --git a/third_party/blink/web_tests/http/tests/devtools/console/function-name-in-console-message-stack.js b/third_party/blink/web_tests/http/tests/devtools/console/function-name-in-console-message-stack.js index 90100fa..b4c6a753 100644 --- a/third_party/blink/web_tests/http/tests/devtools/console/function-name-in-console-message-stack.js +++ b/third_party/blink/web_tests/http/tests/devtools/console/function-name-in-console-message-stack.js
@@ -8,7 +8,6 @@ (async function() { TestRunner.addResult(`Tests exception message contains stack with correct function name.\n`); - await TestRunner.loadLegacyModule('console'); await TestRunner.showPanel('console'); await TestRunner.evaluateInPagePromise(` var foo = function ()
diff --git a/third_party/blink/web_tests/http/tests/devtools/console/nested-worker-eval-contains-stack.js b/third_party/blink/web_tests/http/tests/devtools/console/nested-worker-eval-contains-stack.js index 5c654ae..7788e50 100644 --- a/third_party/blink/web_tests/http/tests/devtools/console/nested-worker-eval-contains-stack.js +++ b/third_party/blink/web_tests/http/tests/devtools/console/nested-worker-eval-contains-stack.js
@@ -5,7 +5,6 @@ import * as SDK from 'devtools/core/sdk/sdk.js'; (async function() { TestRunner.addResult(`Tests exception message from eval on nested worker context in console contains stack trace.\n`); - await TestRunner.loadLegacyModule('console'); await TestRunner.showPanel('console'); await TestRunner.evaluateInPagePromise(` function startWorker()
diff --git a/third_party/blink/web_tests/http/tests/devtools/console/only-one-deprecation-warning.js b/third_party/blink/web_tests/http/tests/devtools/console/only-one-deprecation-warning.js index 3bda194..d8404da 100644 --- a/third_party/blink/web_tests/http/tests/devtools/console/only-one-deprecation-warning.js +++ b/third_party/blink/web_tests/http/tests/devtools/console/only-one-deprecation-warning.js
@@ -8,7 +8,6 @@ (async function() { TestRunner.addResult(`This test passes if only one deprecation warning is presented in the console.\n`); await TestRunner.showPanel('console'); - await TestRunner.loadLegacyModule('console'); await TestRunner.evaluateInPagePromise(` var x = window.webkitStorageInfo; var y = window.webkitStorageInfo;
diff --git a/third_party/blink/web_tests/http/tests/devtools/console/paintworklet-console-selector.js b/third_party/blink/web_tests/http/tests/devtools/console/paintworklet-console-selector.js index 3c84016..c65637f 100644 --- a/third_party/blink/web_tests/http/tests/devtools/console/paintworklet-console-selector.js +++ b/third_party/blink/web_tests/http/tests/devtools/console/paintworklet-console-selector.js
@@ -8,10 +8,10 @@ import * as SDK from 'devtools/core/sdk/sdk.js'; import * as UIModule from 'devtools/ui/legacy/legacy.js'; +import * as Console from 'devtools/panels/console/console.js'; (async function() { TestRunner.addResult(`Tests console execution context selector for paintworklet.\n`); - await TestRunner.loadLegacyModule('console'); await TestRunner.showPanel('console'); await TestRunner.loadHTML(` <script id="code" type="text/worklet"> @@ -28,7 +28,7 @@ await new Promise(f => SourcesTestRunner.startDebuggerTest(f, true)); await TestRunner.evaluateInPageAsync('setup()'); - var consoleView = Console.ConsoleView.instance(); + var consoleView = Console.ConsoleView.ConsoleView.instance(); var selector = consoleView.consoleContextSelector; TestRunner.addResult('Console context selector:'); for (var executionContext of selector._items) {
diff --git a/third_party/blink/web_tests/http/tests/devtools/console/shadow-element.js b/third_party/blink/web_tests/http/tests/devtools/console/shadow-element.js index 3eb81cd1..61adb2f2 100644 --- a/third_party/blink/web_tests/http/tests/devtools/console/shadow-element.js +++ b/third_party/blink/web_tests/http/tests/devtools/console/shadow-element.js
@@ -11,7 +11,6 @@ (async function() { TestRunner.addResult(`Tests that $0 works with shadow dom.\n`); - await TestRunner.loadLegacyModule('console'); await TestRunner.showPanel('console'); await TestRunner.loadHTML(` <div><div><div id="host"></div></div></div>
diff --git a/third_party/blink/web_tests/http/tests/devtools/console/viewport-testing/console-clicking-messages.js b/third_party/blink/web_tests/http/tests/devtools/console/viewport-testing/console-clicking-messages.js index f204864..428b8f5 100644 --- a/third_party/blink/web_tests/http/tests/devtools/console/viewport-testing/console-clicking-messages.js +++ b/third_party/blink/web_tests/http/tests/devtools/console/viewport-testing/console-clicking-messages.js
@@ -5,14 +5,15 @@ import {TestRunner} from 'test_runner'; import {ConsoleTestRunner} from 'console_test_runner'; +import * as Console from 'devtools/panels/console/console.js'; + (async function() { TestRunner.addResult(`Tests that console messages are navigable with the keyboard.\n`); - await TestRunner.loadLegacyModule('console'); await TestRunner.showPanel('console'); ConsoleTestRunner.fixConsoleViewportDimensions(600, 200); await ConsoleTestRunner.waitUntilConsoleEditorLoaded(); - const consoleView = Console.ConsoleView.instance(); + const consoleView = Console.ConsoleView.ConsoleView.instance(); const viewport = consoleView.viewport; TestRunner.runTestSuite([ @@ -124,7 +125,7 @@ if (hasTrace) { TestRunner.addResult(`Is trace expanded: ${!hasHiddenStackTrace ? 'YES' : 'NO'}`); } - if (firstMessage instanceof Console.ConsoleGroupViewMessage) { + if (firstMessage instanceof Console.ConsoleViewMessage.ConsoleGroupViewMessage) { const expanded = !firstMessage.collapsed(); TestRunner.addResult(`Is group expanded: ${expanded ? 'YES' : 'NO'}`); }
diff --git a/third_party/blink/web_tests/http/tests/devtools/console/viewport-testing/console-key-links-expected.txt b/third_party/blink/web_tests/http/tests/devtools/console/viewport-testing/console-key-links-expected.txt index 3770897..0722db6 100644 --- a/third_party/blink/web_tests/http/tests/devtools/console/viewport-testing/console-key-links-expected.txt +++ b/third_party/blink/web_tests/http/tests/devtools/console/viewport-testing/console-key-links-expected.txt
@@ -9,7 +9,7 @@ Shift+Tab: Viewport virtual selection: 2 activeElement: SPAN.devtools-link -active text: console-key-links.js:29 +active text: console-key-links.js:30 ArrowUp: Viewport virtual selection: 2 @@ -19,12 +19,12 @@ ArrowUp: Viewport virtual selection: 2 activeElement: DIV.console-message-wrapper.console-from-api.console-info-level.console-selected -active text: console-key-links.js:29 www.chromium.org/2 +active text: console-key-links.js:30 www.chromium.org/2 ArrowUp: Viewport virtual selection: 1 activeElement: SPAN.devtools-link -active text: console-key-links.js:29 +active text: console-key-links.js:30 ArrowUp: Viewport virtual selection: 1 @@ -39,7 +39,7 @@ ArrowUp: Viewport virtual selection: 1 activeElement: DIV.console-message-wrapper.console-from-api.console-info-level.console-selected -active text: console-key-links.js:29 Text around www.chromium.org/1a multiple links, www.chromium.org/1b +active text: console-key-links.js:30 Text around www.chromium.org/1a multiple links, www.chromium.org/1b ArrowDown: Viewport virtual selection: 1 @@ -54,12 +54,12 @@ ArrowDown: Viewport virtual selection: 1 activeElement: SPAN.devtools-link -active text: console-key-links.js:29 +active text: console-key-links.js:30 ArrowDown: Viewport virtual selection: 2 activeElement: DIV.console-message-wrapper.console-from-api.console-info-level.console-selected -active text: console-key-links.js:29 www.chromium.org/2 +active text: console-key-links.js:30 www.chromium.org/2 ArrowDown: Viewport virtual selection: 2 @@ -69,7 +69,7 @@ ArrowDown: Viewport virtual selection: 2 activeElement: SPAN.devtools-link -active text: console-key-links.js:29 +active text: console-key-links.js:30 Running: testNavigatingLinksInStackTrace Evaluating: fn1() @@ -96,17 +96,17 @@ Viewport virtual selection: 0 Is trace expanded: NO activeElement: DIV.console-message-wrapper.console-from-api.console-error-level.console-selected -active text: foo.js:21 Custom error with link www.chromium.org/linkInErrMsg -fn1 @ foo.js:21 -(anonymous) @ console-key-links.js:74 +active text: foo.js:22 Custom error with link www.chromium.org/linkInErrMsg +fn1 @ foo.js:22 +(anonymous) @ console-key-links.js:75 ArrowRight: Viewport virtual selection: 0 Is trace expanded: YES activeElement: DIV.console-message-wrapper.console-from-api.console-error-level.console-selected -active text: foo.js:21 Custom error with link www.chromium.org/linkInErrMsg -fn1 @ foo.js:21 -(anonymous) @ console-key-links.js:74 +active text: foo.js:22 Custom error with link www.chromium.org/linkInErrMsg +fn1 @ foo.js:22 +(anonymous) @ console-key-links.js:75 ArrowDown: Viewport virtual selection: 0 @@ -118,39 +118,39 @@ Viewport virtual selection: 0 Is trace expanded: YES activeElement: SPAN.devtools-link -active text: foo.js:21 +active text: foo.js:22 ArrowDown: Viewport virtual selection: 0 Is trace expanded: YES activeElement: SPAN.devtools-link -active text: foo.js:21 +active text: foo.js:22 ArrowDown: Viewport virtual selection: 0 Is trace expanded: YES activeElement: SPAN.devtools-link -active text: console-key-links.js:74 +active text: console-key-links.js:75 ArrowDown: Viewport virtual selection: 0 Is trace expanded: YES activeElement: SPAN.devtools-link -active text: console-key-links.js:74 +active text: console-key-links.js:75 ArrowLeft: Viewport virtual selection: 0 Is trace expanded: YES activeElement: DIV.console-message-wrapper.console-from-api.console-error-level.console-selected -active text: foo.js:21 Custom error with link www.chromium.org/linkInErrMsg -fn1 @ foo.js:21 -(anonymous) @ console-key-links.js:74 +active text: foo.js:22 Custom error with link www.chromium.org/linkInErrMsg +fn1 @ foo.js:22 +(anonymous) @ console-key-links.js:75 ArrowLeft: Viewport virtual selection: 0 Is trace expanded: NO activeElement: DIV.console-message-wrapper.console-from-api.console-error-level.console-selected -active text: foo.js:21 Custom error with link www.chromium.org/linkInErrMsg -fn1 @ foo.js:21 -(anonymous) @ console-key-links.js:74 +active text: foo.js:22 Custom error with link www.chromium.org/linkInErrMsg +fn1 @ foo.js:22 +(anonymous) @ console-key-links.js:75
diff --git a/third_party/blink/web_tests/http/tests/devtools/console/viewport-testing/console-key-links.js b/third_party/blink/web_tests/http/tests/devtools/console/viewport-testing/console-key-links.js index 31291bd..3b37aa0 100644 --- a/third_party/blink/web_tests/http/tests/devtools/console/viewport-testing/console-key-links.js +++ b/third_party/blink/web_tests/http/tests/devtools/console/viewport-testing/console-key-links.js
@@ -5,14 +5,15 @@ import {TestRunner} from 'test_runner'; import {ConsoleTestRunner} from 'console_test_runner'; +import * as Console from 'devtools/panels/console/console.js'; + (async function() { TestRunner.addResult(`Tests that console links are keyboard navigable.\n`); - await TestRunner.loadLegacyModule('console'); await TestRunner.showPanel('console'); ConsoleTestRunner.fixConsoleViewportDimensions(600, 200); await ConsoleTestRunner.waitUntilConsoleEditorLoaded(); - const consoleView = Console.ConsoleView.instance(); + const consoleView = Console.ConsoleView.ConsoleView.instance(); const viewport = consoleView.viewport; const prompt = consoleView.prompt; @@ -160,7 +161,7 @@ if (hasTrace) { TestRunner.addResult(`Is trace expanded: ${!hasHiddenStackTrace ? 'YES' : 'NO'}`); } - if (firstMessage instanceof Console.ConsoleGroupViewMessage) { + if (firstMessage instanceof Console.ConsoleViewMessage.ConsoleGroupViewMessage) { const expanded = !firstMessage.collapsed(); TestRunner.addResult(`Is group expanded: ${expanded ? 'YES' : 'NO'}`); }
diff --git a/third_party/blink/web_tests/http/tests/devtools/console/viewport-testing/console-stick-to-bottom-expand-object.js b/third_party/blink/web_tests/http/tests/devtools/console/viewport-testing/console-stick-to-bottom-expand-object.js index 28a34c1..ec55b939 100644 --- a/third_party/blink/web_tests/http/tests/devtools/console/viewport-testing/console-stick-to-bottom-expand-object.js +++ b/third_party/blink/web_tests/http/tests/devtools/console/viewport-testing/console-stick-to-bottom-expand-object.js
@@ -5,9 +5,10 @@ import {TestRunner} from 'test_runner'; import {ConsoleTestRunner} from 'console_test_runner'; +import * as Console from 'devtools/panels/console/console.js'; + (async function() { TestRunner.addResult(`Verifies viewport stick-to-bottom behavior when prompt has space below editable area.\n`); - await TestRunner.loadLegacyModule('console'); await TestRunner.showPanel('console'); await ConsoleTestRunner.waitUntilConsoleEditorLoaded(); ConsoleTestRunner.fixConsoleViewportDimensions(600, 200); @@ -20,7 +21,7 @@ await ConsoleTestRunner.waitForConsoleMessagesPromise(150); await ConsoleTestRunner.waitForPendingViewportUpdates(); - const consoleView = Console.ConsoleView.instance(); + const consoleView = Console.ConsoleView.ConsoleView.instance(); const viewport = consoleView.viewport; TestRunner.runTestSuite([
diff --git a/third_party/blink/web_tests/http/tests/devtools/console/worker-eval-contains-stack.js b/third_party/blink/web_tests/http/tests/devtools/console/worker-eval-contains-stack.js index a463804..a1a4312 100644 --- a/third_party/blink/web_tests/http/tests/devtools/console/worker-eval-contains-stack.js +++ b/third_party/blink/web_tests/http/tests/devtools/console/worker-eval-contains-stack.js
@@ -9,7 +9,6 @@ (async function() { TestRunner.addResult(`Tests exception message from eval on worker context in console contains stack trace.\n`); - await TestRunner.loadLegacyModule('console'); await TestRunner.showPanel('console'); await TestRunner.evaluateInPagePromise(` function startWorker()
diff --git a/third_party/blink/web_tests/http/tests/devtools/csp/csp-inline-warning-contains-stacktrace-expected.txt b/third_party/blink/web_tests/http/tests/devtools/csp/csp-inline-warning-contains-stacktrace-expected.txt index 702e1660..1ddcd4c 100644 --- a/third_party/blink/web_tests/http/tests/devtools/csp/csp-inline-warning-contains-stacktrace-expected.txt +++ b/third_party/blink/web_tests/http/tests/devtools/csp/csp-inline-warning-contains-stacktrace-expected.txt
@@ -1,10 +1,10 @@ This test injects an inline script from JavaScript. The resulting console error should contain a stack trace. -Message[0]: csp-inline-warning-contains-stacktrace.js:21 Refused to execute inline script because it violates the following Content Security Policy directive: "script-src 'self'". Either the 'unsafe-inline' keyword, a hash ('sha256-CihokcEcBW4atb/CW/XWsvWwbTjqwQlE9nj9ii5ww5M='), or a nonce ('nonce-...') is required to enable inline execution. +Message[0]: csp-inline-warning-contains-stacktrace.js:20 Refused to execute inline script because it violates the following Content Security Policy directive: "script-src 'self'". Either the 'unsafe-inline' keyword, a hash ('sha256-CihokcEcBW4atb/CW/XWsvWwbTjqwQlE9nj9ii5ww5M='), or a nonce ('nonce-...') is required to enable inline execution. Stack Trace: url: test://evaluations/0/csp-inline-warning-contains-stacktrace.js function: thisTest - line: 21 + line: 20
diff --git a/third_party/blink/web_tests/http/tests/devtools/csp/csp-inline-warning-contains-stacktrace.js b/third_party/blink/web_tests/http/tests/devtools/csp/csp-inline-warning-contains-stacktrace.js index 00d5991..5ca12b11 100644 --- a/third_party/blink/web_tests/http/tests/devtools/csp/csp-inline-warning-contains-stacktrace.js +++ b/third_party/blink/web_tests/http/tests/devtools/csp/csp-inline-warning-contains-stacktrace.js
@@ -8,7 +8,6 @@ (async function() { TestRunner.addResult( `This test injects an inline script from JavaScript. The resulting console error should contain a stack trace.\n`); - await TestRunner.loadLegacyModule('console'); await TestRunner.loadHTML(` <!DOCTYPE html>
diff --git a/third_party/blink/web_tests/http/tests/devtools/csp/csp-setInterval-warning-contains-stacktrace-expected.txt b/third_party/blink/web_tests/http/tests/devtools/csp/csp-setInterval-warning-contains-stacktrace-expected.txt index b50fe28..dbcb586 100644 --- a/third_party/blink/web_tests/http/tests/devtools/csp/csp-setInterval-warning-contains-stacktrace-expected.txt +++ b/third_party/blink/web_tests/http/tests/devtools/csp/csp-setInterval-warning-contains-stacktrace-expected.txt
@@ -1,10 +1,10 @@ This test should trigger a CSP violation by attempting to evaluate a string with setInterval. -Message[0]: csp-setInterval-warning-contains-stacktrace.js:19 Refused to evaluate a string as JavaScript because 'unsafe-eval' is not an allowed source of script in the following Content Security Policy directive: "script-src 'self' 'unsafe-inline'". +Message[0]: csp-setInterval-warning-contains-stacktrace.js:18 Refused to evaluate a string as JavaScript because 'unsafe-eval' is not an allowed source of script in the following Content Security Policy directive: "script-src 'self' 'unsafe-inline'". Stack Trace: url: test://evaluations/0/csp-setInterval-warning-contains-stacktrace.js function: thisTest - line: 19 + line: 18
diff --git a/third_party/blink/web_tests/http/tests/devtools/csp/csp-setInterval-warning-contains-stacktrace.js b/third_party/blink/web_tests/http/tests/devtools/csp/csp-setInterval-warning-contains-stacktrace.js index 65170654..5132e37 100644 --- a/third_party/blink/web_tests/http/tests/devtools/csp/csp-setInterval-warning-contains-stacktrace.js +++ b/third_party/blink/web_tests/http/tests/devtools/csp/csp-setInterval-warning-contains-stacktrace.js
@@ -8,7 +8,6 @@ (async function() { TestRunner.addResult( `This test should trigger a CSP violation by attempting to evaluate a string with setInterval.\n`); - await TestRunner.loadLegacyModule('console'); await TestRunner.loadHTML(` <!DOCTYPE html>
diff --git a/third_party/blink/web_tests/http/tests/devtools/csp/csp-setTimeout-warning-contains-stacktrace-expected.txt b/third_party/blink/web_tests/http/tests/devtools/csp/csp-setTimeout-warning-contains-stacktrace-expected.txt index 15d20dd..93d04a9 100644 --- a/third_party/blink/web_tests/http/tests/devtools/csp/csp-setTimeout-warning-contains-stacktrace-expected.txt +++ b/third_party/blink/web_tests/http/tests/devtools/csp/csp-setTimeout-warning-contains-stacktrace-expected.txt
@@ -1,10 +1,10 @@ This test should trigger a CSP violation by attempting to evaluate a string with setTimeout. -Message[0]: csp-setTimeout-warning-contains-stacktrace.js:19 Refused to evaluate a string as JavaScript because 'unsafe-eval' is not an allowed source of script in the following Content Security Policy directive: "script-src 'self' 'unsafe-inline'". +Message[0]: csp-setTimeout-warning-contains-stacktrace.js:18 Refused to evaluate a string as JavaScript because 'unsafe-eval' is not an allowed source of script in the following Content Security Policy directive: "script-src 'self' 'unsafe-inline'". Stack Trace: url: test://evaluations/0/csp-setTimeout-warning-contains-stacktrace.js function: thisTest - line: 19 + line: 18
diff --git a/third_party/blink/web_tests/http/tests/devtools/csp/csp-setTimeout-warning-contains-stacktrace.js b/third_party/blink/web_tests/http/tests/devtools/csp/csp-setTimeout-warning-contains-stacktrace.js index 878df7e1..f3300256 100644 --- a/third_party/blink/web_tests/http/tests/devtools/csp/csp-setTimeout-warning-contains-stacktrace.js +++ b/third_party/blink/web_tests/http/tests/devtools/csp/csp-setTimeout-warning-contains-stacktrace.js
@@ -8,7 +8,6 @@ (async function() { TestRunner.addResult( `This test should trigger a CSP violation by attempting to evaluate a string with setTimeout.\n`); - await TestRunner.loadLegacyModule('console'); await TestRunner.loadHTML(` <!DOCTYPE html>
diff --git a/third_party/blink/web_tests/http/tests/devtools/database-table-name-excaping.js b/third_party/blink/web_tests/http/tests/devtools/database-table-name-excaping.js index bd85587..86a1ddf 100644 --- a/third_party/blink/web_tests/http/tests/devtools/database-table-name-excaping.js +++ b/third_party/blink/web_tests/http/tests/devtools/database-table-name-excaping.js
@@ -7,7 +7,6 @@ (async function() { TestRunner.addResult(`Tests how table names are escaped in database table view.\n`); - await TestRunner.loadLegacyModule('console'); var tableName = 'table-name-with-dashes-and-"quotes"'; var escapedTableName = Resources.DatabaseTableView.prototype.escapeTableName(tableName, '', true);
diff --git a/third_party/blink/web_tests/http/tests/devtools/device-orientation-success-expected.txt b/third_party/blink/web_tests/http/tests/devtools/device-orientation-success-expected.txt index 57219bbe..99e2615 100644 --- a/third_party/blink/web_tests/http/tests/devtools/device-orientation-success-expected.txt +++ b/third_party/blink/web_tests/http/tests/devtools/device-orientation-success-expected.txt
@@ -10,12 +10,12 @@ Running: secondOrientationOverride Running: clearOverride -device-orientation-success.js:33 alpha: 1.1 beta: 2.2 gamma: 3.3 -device-orientation-success.js:33 alpha: 20 beta: 30 gamma: 40 +device-orientation-success.js:32 alpha: 1.1 beta: 2.2 gamma: 3.3 +device-orientation-success.js:32 alpha: 20 beta: 30 gamma: 40 inspected-page.html:1 A reload is required so that the existing AbsoluteOrientationSensor and RelativeOrientationSensor objects on this page use the overridden values that have been provided. Close the inspector and reload again to return to the normal behavior. -device-orientation-success.js:33 alpha: 90 beta: 0 gamma: 0 -device-orientation-success.js:40 quaternion: 0.000000,0.000000,0.707107,0.707107 -device-orientation-success.js:33 alpha: 1.1 beta: 2.2 gamma: 3.3 +device-orientation-success.js:32 alpha: 90 beta: 0 gamma: 0 +device-orientation-success.js:39 quaternion: 0.000000,0.000000,0.707107,0.707107 +device-orientation-success.js:32 alpha: 1.1 beta: 2.2 gamma: 3.3 Running: reloadPageAndOverride Page reloaded.
diff --git a/third_party/blink/web_tests/http/tests/devtools/device-orientation-success.js b/third_party/blink/web_tests/http/tests/devtools/device-orientation-success.js index b343eae0..0d85620 100644 --- a/third_party/blink/web_tests/http/tests/devtools/device-orientation-success.js +++ b/third_party/blink/web_tests/http/tests/devtools/device-orientation-success.js
@@ -7,7 +7,6 @@ (async function() { TestRunner.addResult(`Test device orientation\n`); - await TestRunner.loadLegacyModule('console'); await TestRunner.addScriptTag('/resources/testharness.js'); await TestRunner.evaluateInPagePromise(` var sensorProvider = null;
diff --git a/third_party/blink/web_tests/http/tests/devtools/elements/elements-inspect-iframe-from-different-domain.js b/third_party/blink/web_tests/http/tests/devtools/elements/elements-inspect-iframe-from-different-domain.js index da486e1..879da58 100644 --- a/third_party/blink/web_tests/http/tests/devtools/elements/elements-inspect-iframe-from-different-domain.js +++ b/third_party/blink/web_tests/http/tests/devtools/elements/elements-inspect-iframe-from-different-domain.js
@@ -9,7 +9,6 @@ (async function() { TestRunner.addResult( `Test that web inspector can select element in an iframe even if the element was created via createElement of document other than iframe's document. Bug 60031\n`); - await TestRunner.loadLegacyModule('console'); await TestRunner.showPanel('elements'); await TestRunner.loadHTML(` <iframe style="width:400px"></iframe>
diff --git a/third_party/blink/web_tests/http/tests/devtools/elements/elements-save-to-temp-var.js b/third_party/blink/web_tests/http/tests/devtools/elements/elements-save-to-temp-var.js index 8dad5c6..9e240650 100644 --- a/third_party/blink/web_tests/http/tests/devtools/elements/elements-save-to-temp-var.js +++ b/third_party/blink/web_tests/http/tests/devtools/elements/elements-save-to-temp-var.js
@@ -6,17 +6,18 @@ import {ConsoleTestRunner} from 'console_test_runner'; import {ElementsTestRunner} from 'elements_test_runner'; +import * as Console from 'devtools/panels/console/console.js'; + (async function() { TestRunner.addResult(`Tests saving nodes to temporary variables.\n`); - await TestRunner.loadLegacyModule('console'); await TestRunner.showPanel('elements'); await TestRunner.loadHTML(`<div id="node"></div>`); const node = await ElementsTestRunner.nodeWithIdPromise('node'); ElementsTestRunner.firstElementsTreeOutline().saveNodeToTempVariable(node); - const promise = TestRunner.addSnifferPromise(Console.ConsoleViewMessage.prototype, 'formattedParameterAsNodeForTest'); + const promise = TestRunner.addSnifferPromise(Console.ConsoleViewMessage.ConsoleViewMessage.prototype, 'formattedParameterAsNodeForTest'); await ConsoleTestRunner.waitForConsoleMessagesPromise(2); - const secondMessage = Console.ConsoleView.instance().visibleViewMessages[1]; + const secondMessage = Console.ConsoleView.ConsoleView.instance().visibleViewMessages[1]; await promise; await ConsoleTestRunner.dumpConsoleMessages();
diff --git a/third_party/blink/web_tests/http/tests/devtools/elements/event-listener-sidebar-custom-framework-expected.txt b/third_party/blink/web_tests/http/tests/devtools/elements/event-listener-sidebar-custom-framework-expected.txt index 6c71324..9d429d2 100644 --- a/third_party/blink/web_tests/http/tests/devtools/elements/event-listener-sidebar-custom-framework-expected.txt +++ b/third_party/blink/web_tests/http/tests/devtools/elements/event-listener-sidebar-custom-framework-expected.txt
@@ -4,7 +4,7 @@ ======== click ======== == Framework -[expanded] button#inspectedNodeRemoveevent-listener-sidebar-custom-framework.js:35 +[expanded] button#inspectedNodeRemoveevent-listener-sidebar-custom-framework.js:34 useCapture: false passive: false once: false @@ -19,7 +19,7 @@ ======== customFirst ======== == FrameworkUser -[expanded] button#inspectedNodeevent-listener-sidebar-custom-framework.js:25 +[expanded] button#inspectedNodeevent-listener-sidebar-custom-framework.js:24 useCapture: true passive: false once: false @@ -30,7 +30,7 @@ ======== customSecond ======== == FrameworkUser -[expanded] button#inspectedNodeevent-listener-sidebar-custom-framework.js:30 +[expanded] button#inspectedNodeevent-listener-sidebar-custom-framework.js:29 useCapture: false passive: false once: false @@ -42,7 +42,7 @@ ======== click ======== == Raw -[expanded] button#inspectedNodeRemoveevent-listener-sidebar-custom-framework.js:35 +[expanded] button#inspectedNodeRemoveevent-listener-sidebar-custom-framework.js:34 useCapture: false passive: false once: false
diff --git a/third_party/blink/web_tests/http/tests/devtools/elements/event-listener-sidebar-custom-framework.js b/third_party/blink/web_tests/http/tests/devtools/elements/event-listener-sidebar-custom-framework.js index dc3008aac..59dae21 100644 --- a/third_party/blink/web_tests/http/tests/devtools/elements/event-listener-sidebar-custom-framework.js +++ b/third_party/blink/web_tests/http/tests/devtools/elements/event-listener-sidebar-custom-framework.js
@@ -10,7 +10,6 @@ (async function() { TestRunner.addResult(`Tests framework event listeners output in the Elements sidebar panel.\n`); - await TestRunner.loadLegacyModule('console'); await TestRunner.showPanel('elements'); await TestRunner.loadHTML(` <button id="inspectedNode">Inspect Me</button>
diff --git a/third_party/blink/web_tests/http/tests/devtools/elements/event-listeners-framework-with-service-worker.js b/third_party/blink/web_tests/http/tests/devtools/elements/event-listeners-framework-with-service-worker.js index 31817df..41db2ae 100644 --- a/third_party/blink/web_tests/http/tests/devtools/elements/event-listeners-framework-with-service-worker.js +++ b/third_party/blink/web_tests/http/tests/devtools/elements/event-listeners-framework-with-service-worker.js
@@ -14,8 +14,6 @@ (async function() { TestRunner.addResult(`Tests framework event listeners output in Sources panel when service worker is present.\n`); - await TestRunner.loadLegacyModule('console'); - await TestRunner.loadLegacyModule('console'); await TestRunner.showPanel('elements'); await TestRunner.evaluateInPage(`
diff --git a/third_party/blink/web_tests/http/tests/devtools/elements/highlight/highlight-display-locked-grid.js b/third_party/blink/web_tests/http/tests/devtools/elements/highlight/highlight-display-locked-grid.js index f02c06e..8121093 100644 --- a/third_party/blink/web_tests/http/tests/devtools/elements/highlight/highlight-display-locked-grid.js +++ b/third_party/blink/web_tests/http/tests/devtools/elements/highlight/highlight-display-locked-grid.js
@@ -8,7 +8,6 @@ (async function() { TestRunner.addResult(`Tests highlights for display locking.\n`); - await TestRunner.loadLegacyModule('console'); await TestRunner.showPanel('elements'); await TestRunner.loadHTML(` <style>
diff --git a/third_party/blink/web_tests/http/tests/devtools/elements/highlight/highlight-display-locked-in-frame.js b/third_party/blink/web_tests/http/tests/devtools/elements/highlight/highlight-display-locked-in-frame.js index 498473d..200aa09 100644 --- a/third_party/blink/web_tests/http/tests/devtools/elements/highlight/highlight-display-locked-in-frame.js +++ b/third_party/blink/web_tests/http/tests/devtools/elements/highlight/highlight-display-locked-in-frame.js
@@ -8,7 +8,6 @@ (async function() { TestRunner.addResult(`Tests highlights for display locking in a frame.\n`); - await TestRunner.loadLegacyModule('console'); await TestRunner.showPanel('elements'); await TestRunner.loadHTML(` <iframe id="container" style="content-visibility: hidden; contain-intrinsic-size: 10px;"
diff --git a/third_party/blink/web_tests/http/tests/devtools/elements/highlight/highlight-display-locked.js b/third_party/blink/web_tests/http/tests/devtools/elements/highlight/highlight-display-locked.js index c94a3dff..52a35a2 100644 --- a/third_party/blink/web_tests/http/tests/devtools/elements/highlight/highlight-display-locked.js +++ b/third_party/blink/web_tests/http/tests/devtools/elements/highlight/highlight-display-locked.js
@@ -8,7 +8,6 @@ (async function() { TestRunner.addResult(`Tests highlights for display locking.\n`); - await TestRunner.loadLegacyModule('console'); await TestRunner.showPanel('elements'); await TestRunner.loadHTML(` <div id="container" style="content-visibility: hidden; contain-intrinsic-size: 10px;">
diff --git a/third_party/blink/web_tests/http/tests/devtools/elements/highlight/highlight-dom-updates.js b/third_party/blink/web_tests/http/tests/devtools/elements/highlight/highlight-dom-updates.js index 2b7d828..98f8ba7 100644 --- a/third_party/blink/web_tests/http/tests/devtools/elements/highlight/highlight-dom-updates.js +++ b/third_party/blink/web_tests/http/tests/devtools/elements/highlight/highlight-dom-updates.js
@@ -9,7 +9,6 @@ (async function() { TestRunner.addResult(`Tests DOM update highlights in the DOM tree.\n`); - await TestRunner.loadLegacyModule('console'); await TestRunner.showPanel('elements'); await TestRunner.loadHTML(` <div id="container">
diff --git a/third_party/blink/web_tests/http/tests/devtools/elements/highlight/highlight-node-scaled-and-scrolled.js b/third_party/blink/web_tests/http/tests/devtools/elements/highlight/highlight-node-scaled-and-scrolled.js index eb4db7d..f435480 100644 --- a/third_party/blink/web_tests/http/tests/devtools/elements/highlight/highlight-node-scaled-and-scrolled.js +++ b/third_party/blink/web_tests/http/tests/devtools/elements/highlight/highlight-node-scaled-and-scrolled.js
@@ -8,7 +8,6 @@ (async function() { TestRunner.addResult(`\n`); - await TestRunner.loadLegacyModule('console'); await TestRunner.showPanel('elements'); await TestRunner.loadHTML(` <style>
diff --git a/third_party/blink/web_tests/http/tests/devtools/elements/highlight/highlight-node-scaled.js b/third_party/blink/web_tests/http/tests/devtools/elements/highlight/highlight-node-scaled.js index fdcb753..9e7d2fc 100644 --- a/third_party/blink/web_tests/http/tests/devtools/elements/highlight/highlight-node-scaled.js +++ b/third_party/blink/web_tests/http/tests/devtools/elements/highlight/highlight-node-scaled.js
@@ -8,7 +8,6 @@ (async function() { TestRunner.addResult(`\n`); - await TestRunner.loadLegacyModule('console'); await TestRunner.showPanel('elements'); await TestRunner.loadHTML(` <style>
diff --git a/third_party/blink/web_tests/http/tests/devtools/elements/highlight/highlight-node-transformed.js b/third_party/blink/web_tests/http/tests/devtools/elements/highlight/highlight-node-transformed.js index 80bca31d7..d15e2d25 100644 --- a/third_party/blink/web_tests/http/tests/devtools/elements/highlight/highlight-node-transformed.js +++ b/third_party/blink/web_tests/http/tests/devtools/elements/highlight/highlight-node-transformed.js
@@ -8,7 +8,6 @@ (async function() { TestRunner.addResult(`\n`); - await TestRunner.loadLegacyModule('console'); await TestRunner.showPanel('elements'); await TestRunner.loadHTML(` <style>
diff --git a/third_party/blink/web_tests/http/tests/devtools/elements/highlight/highlight-node-vertical-rl.js b/third_party/blink/web_tests/http/tests/devtools/elements/highlight/highlight-node-vertical-rl.js index 39a084e..7fbd618 100644 --- a/third_party/blink/web_tests/http/tests/devtools/elements/highlight/highlight-node-vertical-rl.js +++ b/third_party/blink/web_tests/http/tests/devtools/elements/highlight/highlight-node-vertical-rl.js
@@ -8,7 +8,6 @@ (async function() { TestRunner.addResult(`\n`); - await TestRunner.loadLegacyModule('console'); await TestRunner.showPanel('elements'); await TestRunner.loadHTML(` <script src="/js-test-resources/ahem.js"></script>
diff --git a/third_party/blink/web_tests/http/tests/devtools/elements/shadow/inspect-deep-shadow-element.js b/third_party/blink/web_tests/http/tests/devtools/elements/shadow/inspect-deep-shadow-element.js index de1c297..43f1819 100644 --- a/third_party/blink/web_tests/http/tests/devtools/elements/shadow/inspect-deep-shadow-element.js +++ b/third_party/blink/web_tests/http/tests/devtools/elements/shadow/inspect-deep-shadow-element.js
@@ -10,7 +10,6 @@ (async function() { TestRunner.addResult(`Tests that inspect element action works for deep shadow elements.\n`); - await TestRunner.loadLegacyModule('console'); await TestRunner.showPanel('elements'); await TestRunner.loadHTML(` <div>
diff --git a/third_party/blink/web_tests/http/tests/devtools/elements/shadow/inspect-slot-not-in-shadow-tree.js b/third_party/blink/web_tests/http/tests/devtools/elements/shadow/inspect-slot-not-in-shadow-tree.js index 42d220d..a7c7510 100644 --- a/third_party/blink/web_tests/http/tests/devtools/elements/shadow/inspect-slot-not-in-shadow-tree.js +++ b/third_party/blink/web_tests/http/tests/devtools/elements/shadow/inspect-slot-not-in-shadow-tree.js
@@ -8,7 +8,6 @@ (async function() { TestRunner.addResult(`Tests that slots that are not in a shadow tree can be inspected.\n`); - await TestRunner.loadLegacyModule('console'); await TestRunner.showPanel('elements'); await TestRunner.loadHTML(` <p id="description"></p>
diff --git a/third_party/blink/web_tests/http/tests/devtools/elements/styles-4/styles-iframe.js b/third_party/blink/web_tests/http/tests/devtools/elements/styles-4/styles-iframe.js index 52e689b..3042ba8c 100644 --- a/third_party/blink/web_tests/http/tests/devtools/elements/styles-4/styles-iframe.js +++ b/third_party/blink/web_tests/http/tests/devtools/elements/styles-4/styles-iframe.js
@@ -9,7 +9,6 @@ (async function() { TestRunner.addResult( `Tests that proper (and different) styles are returned for body elements of main document and iframe.\n`); - await TestRunner.loadLegacyModule('console'); await TestRunner.showPanel('elements'); await TestRunner.loadHTML(` <style>
diff --git a/third_party/blink/web_tests/http/tests/devtools/extensions/extensions-reload.js b/third_party/blink/web_tests/http/tests/devtools/extensions/extensions-reload.js index f2a65f42..8d7d581 100644 --- a/third_party/blink/web_tests/http/tests/devtools/extensions/extensions-reload.js +++ b/third_party/blink/web_tests/http/tests/devtools/extensions/extensions-reload.js
@@ -7,14 +7,15 @@ import {ExtensionsTestRunner} from 'extensions_test_runner'; import {ConsoleTestRunner} from 'console_test_runner'; +import * as Console from 'devtools/panels/console/console.js'; + (async function() { TestRunner.addResult( `Tests that webInspector.inspectedWindow.reload() successfully injects and preprocesses user's code upon reload\n`); - await TestRunner.loadLegacyModule('console'); await TestRunner.navigatePromise(TestRunner.url('resources/reload.html')); TestRunner.lastMessageScriptId = function(callback) { - var consoleView = Console.ConsoleView.instance(); + var consoleView = Console.ConsoleView.ConsoleView.instance(); if (consoleView.needsFullUpdate) consoleView.updateMessageList(); var viewMessages = consoleView.visibleViewMessages;
diff --git a/third_party/blink/web_tests/http/tests/devtools/extensions/extensions-resources.js b/third_party/blink/web_tests/http/tests/devtools/extensions/extensions-resources.js index bbd475c..8b976da 100644 --- a/third_party/blink/web_tests/http/tests/devtools/extensions/extensions-resources.js +++ b/third_party/blink/web_tests/http/tests/devtools/extensions/extensions-resources.js
@@ -9,22 +9,22 @@ import * as SDK from 'devtools/core/sdk/sdk.js'; import * as UI from 'devtools/ui/legacy/legacy.js'; +import * as Console from 'devtools/panels/console/console.js'; (async function() { TestRunner.addResult(`Tests resource-related methods of WebInspector extension API\n`); - await TestRunner.loadLegacyModule('console'); await TestRunner.loadLegacyModule('components'); TestRunner.clickOnURL = async function() { await UI.ViewManager.ViewManager.instance().showView("console").then(() => { - Console.ConsoleView.instance().updateMessageList(); + Console.ConsoleView.ConsoleView.instance().updateMessageList(); // Trigger link creation so we can properly await pending live location updates. Needed so we can // click the link in the first place. - for (const messageView of Console.ConsoleView.instance().visibleViewMessages) messageView.element(); + for (const messageView of Console.ConsoleView.ConsoleView.instance().visibleViewMessages) messageView.element(); TestRunner.waitForPendingLiveLocationUpdates().then(() => { var xpathResult = document.evaluate("//span[@class='devtools-link' and starts-with(., 'test-script.js')]", - Console.ConsoleView.instance().element, null, XPathResult.ANY_UNORDERED_NODE_TYPE, null); + Console.ConsoleView.ConsoleView.instance().element, null, XPathResult.ANY_UNORDERED_NODE_TYPE, null); var click = document.createEvent("MouseEvent"); click.initMouseEvent("click", true, true);
diff --git a/third_party/blink/web_tests/http/tests/devtools/file-reader-with-network-panel.js b/third_party/blink/web_tests/http/tests/devtools/file-reader-with-network-panel.js index a39542b..567bf63 100644 --- a/third_party/blink/web_tests/http/tests/devtools/file-reader-with-network-panel.js +++ b/third_party/blink/web_tests/http/tests/devtools/file-reader-with-network-panel.js
@@ -7,8 +7,8 @@ import {ConsoleTestRunner} from 'console_test_runner'; (async function() { - TestRunner.addResult(`Tests that FileReader's Blob request isn't shown in network panel.\n`); - await TestRunner.loadLegacyModule('console'); + // This await is necessary for evaluateInPagePromise to produce accurate line numbers. + await TestRunner.addResult(`Tests that FileReader's Blob request isn't shown in network panel.\n`); await TestRunner.evaluateInPagePromise(` function readBlob() {
diff --git a/third_party/blink/web_tests/http/tests/devtools/fragment.js b/third_party/blink/web_tests/http/tests/devtools/fragment.js index 1f57b9ca..3e552301 100644 --- a/third_party/blink/web_tests/http/tests/devtools/fragment.js +++ b/third_party/blink/web_tests/http/tests/devtools/fragment.js
@@ -8,7 +8,6 @@ (async function() { TestRunner.addResult(`Tests fragment is stripped from url by resource and page agents.\n`); - await TestRunner.loadLegacyModule('console'); await TestRunner.showPanel('network'); await TestRunner.evaluateInPagePromise(` function loadIFrame()
diff --git a/third_party/blink/web_tests/http/tests/devtools/geolocation-emulation-tests.js b/third_party/blink/web_tests/http/tests/devtools/geolocation-emulation-tests.js index ea0d5ab..8c6b13f 100644 --- a/third_party/blink/web_tests/http/tests/devtools/geolocation-emulation-tests.js +++ b/third_party/blink/web_tests/http/tests/devtools/geolocation-emulation-tests.js
@@ -8,7 +8,6 @@ (async function() { TestRunner.addResult(`Tests that geolocation emulation with latitude and longitude works as expected.\n`); - await TestRunner.loadLegacyModule('console'); await TestRunner.navigatePromise('https://devtools.test:8443/devtools/network/resources/empty.html'); await TestRunner.BrowserAgent.invoke_grantPermissions({ origin: 'https://devtools.test:8443',
diff --git a/third_party/blink/web_tests/http/tests/devtools/har-importer.js b/third_party/blink/web_tests/http/tests/devtools/har-importer.js index bcec6eb..9d8b238 100644 --- a/third_party/blink/web_tests/http/tests/devtools/har-importer.js +++ b/third_party/blink/web_tests/http/tests/devtools/har-importer.js
@@ -9,7 +9,6 @@ (async function() { TestRunner.addResult( 'Verifies that imported HAR files create matching NetworkRequests'); - await TestRunner.loadLegacyModule('console'); const harRoot = new HARImporter.HARRoot(harJson); const requests = HARImporter.Importer.requestsFromHARLog(harRoot.log); const formattedRequests = await Promise.all(requests.map(async request => {
diff --git a/third_party/blink/web_tests/http/tests/devtools/indexeddb/database-data.js b/third_party/blink/web_tests/http/tests/devtools/indexeddb/database-data.js index 439d0fbc..7b5d42c 100644 --- a/third_party/blink/web_tests/http/tests/devtools/indexeddb/database-data.js +++ b/third_party/blink/web_tests/http/tests/devtools/indexeddb/database-data.js
@@ -9,7 +9,6 @@ (async function() { TestRunner.addResult( `Tests that data is correctly loaded by IndexedDBModel from IndexedDB object store and index.\n`); - await TestRunner.loadLegacyModule('console'); // Note: every test that uses a storage API must manually clean-up state from previous tests. await ApplicationTestRunner.resetState();
diff --git a/third_party/blink/web_tests/http/tests/devtools/indexeddb/database-names.js b/third_party/blink/web_tests/http/tests/devtools/indexeddb/database-names.js index 280ba75..8e16456 100644 --- a/third_party/blink/web_tests/http/tests/devtools/indexeddb/database-names.js +++ b/third_party/blink/web_tests/http/tests/devtools/indexeddb/database-names.js
@@ -7,7 +7,6 @@ (async function() { TestRunner.addResult(`Tests that database names are correctly loaded and saved in IndexedDBModel.\n`); - await TestRunner.loadLegacyModule('console'); //Note: every test that uses a storage API must manually clean-up state from previous tests. await ApplicationTestRunner.resetState();
diff --git a/third_party/blink/web_tests/http/tests/devtools/indexeddb/database-refresh-view.js b/third_party/blink/web_tests/http/tests/devtools/indexeddb/database-refresh-view.js index a838a356..ef7b7688 100644 --- a/third_party/blink/web_tests/http/tests/devtools/indexeddb/database-refresh-view.js +++ b/third_party/blink/web_tests/http/tests/devtools/indexeddb/database-refresh-view.js
@@ -11,7 +11,6 @@ (async function() { TestRunner.addResult(`Tests refreshing the database information and data views.\n`); - await TestRunner.loadLegacyModule('console'); await TestRunner.navigatePromise('http://127.0.0.1:8000/devtools/indexeddb/resources/without-indexed-db.html'); await ApplicationTestRunner.setupIndexedDBHelpers(); @@ -19,7 +18,6 @@ // previous tests. await ApplicationTestRunner.resetState(); - await TestRunner.loadLegacyModule('console'); await TestRunner.showPanel('resources'); var databaseName = 'testDatabase';
diff --git a/third_party/blink/web_tests/http/tests/devtools/indexeddb/database-structure.js b/third_party/blink/web_tests/http/tests/devtools/indexeddb/database-structure.js index 0eba2d7..8fe2b7f 100644 --- a/third_party/blink/web_tests/http/tests/devtools/indexeddb/database-structure.js +++ b/third_party/blink/web_tests/http/tests/devtools/indexeddb/database-structure.js
@@ -8,7 +8,6 @@ (async function() { TestRunner.addResult(`Tests that database names are correctly loaded and saved in IndexedDBModel.\n`); - await TestRunner.loadLegacyModule('console'); // Note: every test that uses a storage API must manually clean-up state from previous tests. await ApplicationTestRunner.resetState();
diff --git a/third_party/blink/web_tests/http/tests/devtools/indexeddb/database-version-number.js b/third_party/blink/web_tests/http/tests/devtools/indexeddb/database-version-number.js index 8342367..2ecb92a8 100644 --- a/third_party/blink/web_tests/http/tests/devtools/indexeddb/database-version-number.js +++ b/third_party/blink/web_tests/http/tests/devtools/indexeddb/database-version-number.js
@@ -8,7 +8,6 @@ (async function() { TestRunner.addResult(`Tests that database names are correctly loaded and saved in IndexedDBModel.\n`); - await TestRunner.loadLegacyModule('console'); // Note: every test that uses a storage API must manually clean-up state from previous tests. await ApplicationTestRunner.resetState();
diff --git a/third_party/blink/web_tests/http/tests/devtools/indexeddb/delete-entry.js b/third_party/blink/web_tests/http/tests/devtools/indexeddb/delete-entry.js index 253b463..18914114 100644 --- a/third_party/blink/web_tests/http/tests/devtools/indexeddb/delete-entry.js +++ b/third_party/blink/web_tests/http/tests/devtools/indexeddb/delete-entry.js
@@ -9,7 +9,6 @@ (async function() { TestRunner.addResult(`Tests object store and index entry deletion.\n`); - await TestRunner.loadLegacyModule('console'); await TestRunner.navigatePromise('http://127.0.0.1:8000/devtools/indexeddb/resources/without-indexed-db.html'); await ApplicationTestRunner.setupIndexedDBHelpers(); // Note: every test that uses a storage API must manually clean-up state from previous tests.
diff --git a/third_party/blink/web_tests/http/tests/devtools/indexeddb/live-update-indexeddb-content.js b/third_party/blink/web_tests/http/tests/devtools/indexeddb/live-update-indexeddb-content.js index e752926..273bed72 100644 --- a/third_party/blink/web_tests/http/tests/devtools/indexeddb/live-update-indexeddb-content.js +++ b/third_party/blink/web_tests/http/tests/devtools/indexeddb/live-update-indexeddb-content.js
@@ -9,7 +9,6 @@ (async function() { TestRunner.addResult(`Tests that the IndexedDB database content live updates.\n`); - await TestRunner.loadLegacyModule('console'); await TestRunner.navigatePromise('http://127.0.0.1:8000/devtools/indexeddb/resources/without-indexed-db.html'); await ApplicationTestRunner.setupIndexedDBHelpers(); // Note: every test that uses a storage API must manually clean-up state from previous tests.
diff --git a/third_party/blink/web_tests/http/tests/devtools/indexeddb/live-update-indexeddb-list.js b/third_party/blink/web_tests/http/tests/devtools/indexeddb/live-update-indexeddb-list.js index 1c4fae3..eb47291 100644 --- a/third_party/blink/web_tests/http/tests/devtools/indexeddb/live-update-indexeddb-list.js +++ b/third_party/blink/web_tests/http/tests/devtools/indexeddb/live-update-indexeddb-list.js
@@ -7,7 +7,6 @@ (async function() { TestRunner.addResult(`Tests that the IndexedDB database list live updates.\n`); - await TestRunner.loadLegacyModule('console'); await TestRunner.navigatePromise('http://127.0.0.1:8000/devtools/indexeddb/resources/without-indexed-db.html'); await ApplicationTestRunner.setupIndexedDBHelpers(); // Note: every test that uses a storage API must manually clean-up state from previous tests.
diff --git a/third_party/blink/web_tests/http/tests/devtools/indexeddb/resources-panel.js b/third_party/blink/web_tests/http/tests/devtools/indexeddb/resources-panel.js index ce26d78..9ed82df 100644 --- a/third_party/blink/web_tests/http/tests/devtools/indexeddb/resources-panel.js +++ b/third_party/blink/web_tests/http/tests/devtools/indexeddb/resources-panel.js
@@ -10,11 +10,9 @@ (async function() { TestRunner.addResult(`Tests IndexedDB tree element on resources panel.\n`); - await TestRunner.loadLegacyModule('console'); // Note: every test that uses a storage API must manually clean-up state from previous tests. await ApplicationTestRunner.resetState(); - await TestRunner.loadLegacyModule('console'); var mainFrameId; var indexedDBModel;
diff --git a/third_party/blink/web_tests/http/tests/devtools/indexeddb/transaction-promise-console.js b/third_party/blink/web_tests/http/tests/devtools/indexeddb/transaction-promise-console.js index f0f07f6..4d67abb 100644 --- a/third_party/blink/web_tests/http/tests/devtools/indexeddb/transaction-promise-console.js +++ b/third_party/blink/web_tests/http/tests/devtools/indexeddb/transaction-promise-console.js
@@ -10,8 +10,6 @@ 'use strict'; TestRunner.addResult( `Ensure transactions created within Promise callbacks are not deactivated due to console activity\n`); - await TestRunner.loadLegacyModule('console'); - await TestRunner.loadLegacyModule('console'); // Note: every test that uses a storage API must manually clean-up state from // previous tests. await ApplicationTestRunner.resetState();
diff --git a/third_party/blink/web_tests/http/tests/devtools/indexeddb/upgrade-events.js b/third_party/blink/web_tests/http/tests/devtools/indexeddb/upgrade-events.js index 8e7bb60..f1b135e 100644 --- a/third_party/blink/web_tests/http/tests/devtools/indexeddb/upgrade-events.js +++ b/third_party/blink/web_tests/http/tests/devtools/indexeddb/upgrade-events.js
@@ -7,7 +7,6 @@ (async function() { TestRunner.addResult(`Tests that deleted databases do not get recreated.\n`); - await TestRunner.loadLegacyModule('console'); // Note: every test that uses a storage API must manually clean-up state from previous tests. await ApplicationTestRunner.resetState();
diff --git a/third_party/blink/web_tests/http/tests/devtools/inspect-element.js b/third_party/blink/web_tests/http/tests/devtools/inspect-element.js index 43798321..77d82b9 100644 --- a/third_party/blink/web_tests/http/tests/devtools/inspect-element.js +++ b/third_party/blink/web_tests/http/tests/devtools/inspect-element.js
@@ -11,7 +11,6 @@ (async function() { TestRunner.addResult( `Tests that inspect element action works for iframe children (https://bugs.webkit.org/show_bug.cgi?id=76808).\n`); - await TestRunner.loadLegacyModule('console'); await TestRunner.showPanel('elements'); await TestRunner.addIframe('resources/inspect-element-iframe.html');
diff --git a/third_party/blink/web_tests/http/tests/devtools/network/async-xhr-json-mime-type.js b/third_party/blink/web_tests/http/tests/devtools/network/async-xhr-json-mime-type.js index b0d53fb..9a2c4ea 100644 --- a/third_party/blink/web_tests/http/tests/devtools/network/async-xhr-json-mime-type.js +++ b/third_party/blink/web_tests/http/tests/devtools/network/async-xhr-json-mime-type.js
@@ -10,7 +10,6 @@ TestRunner.addResult(`Tests that the content of resources with JSON MIME types can be accessed.`); TestRunner.addResult('When loaded by asynchronous XHR requests (Bug 80684) or within iframes/documents.\n'); - await TestRunner.loadLegacyModule('console'); await TestRunner.showPanel('network'); NetworkTestRunner.recordNetwork();
diff --git a/third_party/blink/web_tests/http/tests/devtools/network/cached-resource-destroyed-moved-to-storage.js b/third_party/blink/web_tests/http/tests/devtools/network/cached-resource-destroyed-moved-to-storage.js index df961f4..7db5d5c 100644 --- a/third_party/blink/web_tests/http/tests/devtools/network/cached-resource-destroyed-moved-to-storage.js +++ b/third_party/blink/web_tests/http/tests/devtools/network/cached-resource-destroyed-moved-to-storage.js
@@ -11,7 +11,6 @@ `Tests content is moved from cached resource to resource agent's data storage when cached resource is destroyed.\n` ); - await TestRunner.loadLegacyModule('console'); await TestRunner.showPanel('network'); await TestRunner.evaluateInPagePromise(`
diff --git a/third_party/blink/web_tests/http/tests/devtools/network/failed-request-preview.js b/third_party/blink/web_tests/http/tests/devtools/network/failed-request-preview.js index da2a45bd..165eca11 100644 --- a/third_party/blink/web_tests/http/tests/devtools/network/failed-request-preview.js +++ b/third_party/blink/web_tests/http/tests/devtools/network/failed-request-preview.js
@@ -8,7 +8,6 @@ (async function() { TestRunner.addResult(`Verifies that network request previews don't have src set when the request fails`); - await TestRunner.loadLegacyModule('console'); await TestRunner.showPanel('network'); SDK.multitargetNetworkManager.setBlockingEnabled(true);
diff --git a/third_party/blink/web_tests/http/tests/devtools/network/failed-request-response-mimetype.js b/third_party/blink/web_tests/http/tests/devtools/network/failed-request-response-mimetype.js index 874bf1d0..7784e38 100644 --- a/third_party/blink/web_tests/http/tests/devtools/network/failed-request-response-mimetype.js +++ b/third_party/blink/web_tests/http/tests/devtools/network/failed-request-response-mimetype.js
@@ -10,7 +10,6 @@ (async function() { TestRunner.addResult(`Verifies that network request response view generates a view if no mime type is set.`); - await TestRunner.loadLegacyModule('console'); await TestRunner.showPanel('network'); SDK.multitargetNetworkManager.setBlockingEnabled(true);
diff --git a/third_party/blink/web_tests/http/tests/devtools/network/from-disk-cache-timing.js b/third_party/blink/web_tests/http/tests/devtools/network/from-disk-cache-timing.js index c36ec2f..90140fb1 100644 --- a/third_party/blink/web_tests/http/tests/devtools/network/from-disk-cache-timing.js +++ b/third_party/blink/web_tests/http/tests/devtools/network/from-disk-cache-timing.js
@@ -8,7 +8,6 @@ (async function() { TestRunner.addResult(`Tests requests loaded from disk cache have correct timing\n`); - await TestRunner.loadLegacyModule('console'); await TestRunner.showPanel('network'); await TestRunner.addScriptTag('resources/gc.js'); await TestRunner.evaluateInPagePromise(`
diff --git a/third_party/blink/web_tests/http/tests/devtools/network/long-script-content.js b/third_party/blink/web_tests/http/tests/devtools/network/long-script-content.js index 5dba3a6..a1023790 100644 --- a/third_party/blink/web_tests/http/tests/devtools/network/long-script-content.js +++ b/third_party/blink/web_tests/http/tests/devtools/network/long-script-content.js
@@ -9,7 +9,6 @@ (async function() { TestRunner.addResult(`Tests long script content is correctly shown in source panel after page reload.\n`); - await TestRunner.loadLegacyModule('console'); await TestRunner.showPanel('sources'); await TestRunner.showPanel('network'); await TestRunner.navigatePromise('resources/long-script-page.html');
diff --git a/third_party/blink/web_tests/http/tests/devtools/network/network-cachedresources-with-same-urls.js b/third_party/blink/web_tests/http/tests/devtools/network/network-cachedresources-with-same-urls.js index a35fc1d..abdc63a 100644 --- a/third_party/blink/web_tests/http/tests/devtools/network/network-cachedresources-with-same-urls.js +++ b/third_party/blink/web_tests/http/tests/devtools/network/network-cachedresources-with-same-urls.js
@@ -9,7 +9,6 @@ (async function() { TestRunner.addResult( `Tests that when we load two different images from the same url (e.g. counters), their content is different in network panel as well.\n`); - await TestRunner.loadLegacyModule('console'); await TestRunner.showPanel('network'); await TestRunner.evaluateInPagePromise(` function loadImages()
diff --git a/third_party/blink/web_tests/http/tests/devtools/network/network-disable-cache-memory.js b/third_party/blink/web_tests/http/tests/devtools/network/network-disable-cache-memory.js index 712af8a..74226fad 100644 --- a/third_party/blink/web_tests/http/tests/devtools/network/network-disable-cache-memory.js +++ b/third_party/blink/web_tests/http/tests/devtools/network/network-disable-cache-memory.js
@@ -8,7 +8,6 @@ (async function() { TestRunner.addResult(`Tests disabling cache from inspector.\n`); - await TestRunner.loadLegacyModule('console'); await TestRunner.showPanel('network'); await TestRunner.navigatePromise('resources/random-script-page.html');
diff --git a/third_party/blink/web_tests/http/tests/devtools/network/network-disable-cache-preloads-twice.js b/third_party/blink/web_tests/http/tests/devtools/network/network-disable-cache-preloads-twice.js index 4d15e681..d8eed35 100644 --- a/third_party/blink/web_tests/http/tests/devtools/network/network-disable-cache-preloads-twice.js +++ b/third_party/blink/web_tests/http/tests/devtools/network/network-disable-cache-preloads-twice.js
@@ -8,7 +8,6 @@ (async function() { TestRunner.addResult(`Tests disabling cache from inspector and seeing that preloads are not evicted from memory cache.\n`); - await TestRunner.loadLegacyModule('console'); await TestRunner.showPanel('network'); await TestRunner.navigatePromise('resources/network-disable-cache-preloads.php');
diff --git a/third_party/blink/web_tests/http/tests/devtools/network/network-disable-cache-preloads.js b/third_party/blink/web_tests/http/tests/devtools/network/network-disable-cache-preloads.js index 06b69d9..a76a9e7 100644 --- a/third_party/blink/web_tests/http/tests/devtools/network/network-disable-cache-preloads.js +++ b/third_party/blink/web_tests/http/tests/devtools/network/network-disable-cache-preloads.js
@@ -8,7 +8,6 @@ (async function() { TestRunner.addResult(`Tests disabling cache from inspector and seeing that preloads are not evicted from memory cache.\n`); - await TestRunner.loadLegacyModule('console'); await TestRunner.showPanel('network'); await TestRunner.navigatePromise('resources/network-disable-cache-preloads.php');
diff --git a/third_party/blink/web_tests/http/tests/devtools/network/network-iframe-load-and-delete.js b/third_party/blink/web_tests/http/tests/devtools/network/network-iframe-load-and-delete.js index 1c0695c..8192086 100644 --- a/third_party/blink/web_tests/http/tests/devtools/network/network-iframe-load-and-delete.js +++ b/third_party/blink/web_tests/http/tests/devtools/network/network-iframe-load-and-delete.js
@@ -11,7 +11,6 @@ (async function() { TestRunner.addResult( `Tests that if iframe is loaded and then deleted, inspector could still show its content. Note that if iframe.src is changed to "javascript:'...some html...'" after loading, then we have different codepath, hence two tests;\n`); - await TestRunner.loadLegacyModule('console'); await TestRunner.showPanel('network'); await TestRunner.evaluateInPagePromise(` var iframe;
diff --git a/third_party/blink/web_tests/http/tests/devtools/network/network-image-404.js b/third_party/blink/web_tests/http/tests/devtools/network/network-image-404.js index 6175d09..ec13c6b 100644 --- a/third_party/blink/web_tests/http/tests/devtools/network/network-image-404.js +++ b/third_party/blink/web_tests/http/tests/devtools/network/network-image-404.js
@@ -9,7 +9,6 @@ (async function() { 'use strict'; TestRunner.addResult(`Tests content is available for failed image request.\n`); - await TestRunner.loadLegacyModule('console'); await TestRunner.showPanel('network'); await TestRunner.evaluateInPagePromise(` function loadData()
diff --git a/third_party/blink/web_tests/http/tests/devtools/network/network-initiator-chain.js b/third_party/blink/web_tests/http/tests/devtools/network/network-initiator-chain.js index d3c5b21..1e0a5c20 100644 --- a/third_party/blink/web_tests/http/tests/devtools/network/network-initiator-chain.js +++ b/third_party/blink/web_tests/http/tests/devtools/network/network-initiator-chain.js
@@ -8,7 +8,6 @@ (async function() { TestRunner.addResult(`Test that computing the initiator graph works for service worker request.\n`); - await TestRunner.loadLegacyModule('console'); await TestRunner.showPanel('network'); NetworkTestRunner.recordNetwork();
diff --git a/third_party/blink/web_tests/http/tests/devtools/network/network-initiator.js b/third_party/blink/web_tests/http/tests/devtools/network/network-initiator.js index 7062bf4..66a0024 100644 --- a/third_party/blink/web_tests/http/tests/devtools/network/network-initiator.js +++ b/third_party/blink/web_tests/http/tests/devtools/network/network-initiator.js
@@ -9,7 +9,6 @@ (async function() { TestRunner.addResult( `Tests resources initiator for images initiated by IMG tag, static CSS, CSS class added from JavaScript and XHR.\n`); - await TestRunner.loadLegacyModule('console'); await TestRunner.showPanel('network'); await TestRunner.evaluateInPagePromise(` function loadData()
diff --git a/third_party/blink/web_tests/http/tests/devtools/network/network-log-service-worker-navigate.js b/third_party/blink/web_tests/http/tests/devtools/network/network-log-service-worker-navigate.js index 371fbbf..d884e4b 100644 --- a/third_party/blink/web_tests/http/tests/devtools/network/network-log-service-worker-navigate.js +++ b/third_party/blink/web_tests/http/tests/devtools/network/network-log-service-worker-navigate.js
@@ -7,7 +7,6 @@ (async function() { TestRunner.addResult( `Verifies that the main page request repeated by a service worker appears in the network log.`); - await TestRunner.loadLegacyModule('console'); await ApplicationTestRunner.resetState(); await TestRunner.showPanel('network');
diff --git a/third_party/blink/web_tests/http/tests/devtools/network/network-not-modified-images-mime-type.js b/third_party/blink/web_tests/http/tests/devtools/network/network-not-modified-images-mime-type.js index c25c86f1..7bac426a 100644 --- a/third_party/blink/web_tests/http/tests/devtools/network/network-not-modified-images-mime-type.js +++ b/third_party/blink/web_tests/http/tests/devtools/network/network-not-modified-images-mime-type.js
@@ -8,7 +8,6 @@ (async function() { TestRunner.addResult(`Tests that if an image is cached and the server responds with 304, the image MIME type is shown correctly.\n`); - await TestRunner.loadLegacyModule('console'); await TestRunner.showPanel('network'); NetworkTestRunner.recordNetwork(); await TestRunner.navigatePromise('resources/cached-image.html');
diff --git a/third_party/blink/web_tests/http/tests/devtools/network/network-search.js b/third_party/blink/web_tests/http/tests/devtools/network/network-search.js index afb3f27..a4522039 100644 --- a/third_party/blink/web_tests/http/tests/devtools/network/network-search.js +++ b/third_party/blink/web_tests/http/tests/devtools/network/network-search.js
@@ -10,7 +10,6 @@ (async function() { TestRunner.addResult(`Tests search in network requests\n`); - await TestRunner.loadLegacyModule('console'); await TestRunner.showPanel('network'); function initArgs(method, url, async, payload) {
diff --git a/third_party/blink/web_tests/http/tests/devtools/network/network-serviceworker-timing-view.js b/third_party/blink/web_tests/http/tests/devtools/network/network-serviceworker-timing-view.js index 041f8b1..062e9766 100644 --- a/third_party/blink/web_tests/http/tests/devtools/network/network-serviceworker-timing-view.js +++ b/third_party/blink/web_tests/http/tests/devtools/network/network-serviceworker-timing-view.js
@@ -12,7 +12,6 @@ (async function() { 'use strict'; TestRunner.addResult(`Tests that serviceworker timings are displayed correctly.\n`); - await TestRunner.loadLegacyModule('console'); await TestRunner.showPanel('network'); await TestRunner.reloadPagePromise();
diff --git a/third_party/blink/web_tests/http/tests/devtools/network/network-timing.js b/third_party/blink/web_tests/http/tests/devtools/network/network-timing.js index 0d4d712..b51637e 100644 --- a/third_party/blink/web_tests/http/tests/devtools/network/network-timing.js +++ b/third_party/blink/web_tests/http/tests/devtools/network/network-timing.js
@@ -8,7 +8,6 @@ (async function() { TestRunner.addResult(`Tests network panel timing.\n`); - await TestRunner.loadLegacyModule('console'); await TestRunner.showPanel('network'); await TestRunner.evaluateInPagePromise(` function loadScripts()
diff --git a/third_party/blink/web_tests/http/tests/devtools/network/network-xhr-async-double.js b/third_party/blink/web_tests/http/tests/devtools/network/network-xhr-async-double.js index cda22e5..ed50a23 100644 --- a/third_party/blink/web_tests/http/tests/devtools/network/network-xhr-async-double.js +++ b/third_party/blink/web_tests/http/tests/devtools/network/network-xhr-async-double.js
@@ -8,7 +8,6 @@ (async function() { TestRunner.addResult(`Tests responses in network tab for two XHRs sent without any delay between them. Bug 91630\n`); - await TestRunner.loadLegacyModule('console'); await TestRunner.showPanel('network'); function initArgs(method, url, async, payload) {
diff --git a/third_party/blink/web_tests/http/tests/devtools/network/network-xhr-async.js b/third_party/blink/web_tests/http/tests/devtools/network/network-xhr-async.js index d6149c6d..cc03f60 100644 --- a/third_party/blink/web_tests/http/tests/devtools/network/network-xhr-async.js +++ b/third_party/blink/web_tests/http/tests/devtools/network/network-xhr-async.js
@@ -8,7 +8,6 @@ (async function() { TestRunner.addResult(`Tests XHR network resource type and content for asynchronous requests. Bug 61205\n`); - await TestRunner.loadLegacyModule('console'); await TestRunner.showPanel('network'); NetworkTestRunner.recordNetwork();
diff --git a/third_party/blink/web_tests/http/tests/devtools/network/ping-response-expected.txt b/third_party/blink/web_tests/http/tests/devtools/network/ping-response-expected.txt index c0ea96c..9dcee1413 100644 --- a/third_party/blink/web_tests/http/tests/devtools/network/ping-response-expected.txt +++ b/third_party/blink/web_tests/http/tests/devtools/network/ping-response-expected.txt
@@ -7,5 +7,5 @@ Status: 200 OK Has raw request headers: true Has raw response headers: true -ping-response.js:16 Beacon sent: true +ping-response.js:15 Beacon sent: true
diff --git a/third_party/blink/web_tests/http/tests/devtools/network/ping-response.js b/third_party/blink/web_tests/http/tests/devtools/network/ping-response.js index 5f31b12..98f86b3 100644 --- a/third_party/blink/web_tests/http/tests/devtools/network/ping-response.js +++ b/third_party/blink/web_tests/http/tests/devtools/network/ping-response.js
@@ -8,7 +8,6 @@ (async function() { TestRunner.addResult(`Test that ping request response is recorded.\n`); - await TestRunner.loadLegacyModule('console'); await TestRunner.showPanel('network'); await TestRunner.evaluateInPagePromise(` function sendBeacon()
diff --git a/third_party/blink/web_tests/http/tests/devtools/network/script-as-text-loading-long-url-expected.txt b/third_party/blink/web_tests/http/tests/devtools/network/script-as-text-loading-long-url-expected.txt index 6accb84..b8ac219 100644 --- a/third_party/blink/web_tests/http/tests/devtools/network/script-as-text-loading-long-url-expected.txt +++ b/third_party/blink/web_tests/http/tests/devtools/network/script-as-text-loading-long-url-expected.txt
@@ -1,7 +1,7 @@ Tests that long URLs are correctly trimmed in anchor links. Message count: 1 -script-as-text-loading-long-url.js:17 GET http://127.0.0.1:8000/inspector/network/resources/script-as-text-with-a-ver…y-very-very-very-very-very-very-very-very-very-very-very-very-long-url.php net::ERR_ABORTED 404 (Not Found) -loadScript @ script-as-text-loading-long-url.js:17 -(anonymous) @ script-as-text-loading-long-url.js:21 +script-as-text-loading-long-url.js:16 GET http://127.0.0.1:8000/inspector/network/resources/script-as-text-with-a-ver…y-very-very-very-very-very-very-very-very-very-very-very-very-long-url.php net::ERR_ABORTED 404 (Not Found) +loadScript @ script-as-text-loading-long-url.js:16 +(anonymous) @ script-as-text-loading-long-url.js:20
diff --git a/third_party/blink/web_tests/http/tests/devtools/network/script-as-text-loading-long-url.js b/third_party/blink/web_tests/http/tests/devtools/network/script-as-text-loading-long-url.js index 2cbeaa02..f659819b 100644 --- a/third_party/blink/web_tests/http/tests/devtools/network/script-as-text-loading-long-url.js +++ b/third_party/blink/web_tests/http/tests/devtools/network/script-as-text-loading-long-url.js
@@ -7,7 +7,6 @@ (async function() { TestRunner.addResult(`Tests that long URLs are correctly trimmed in anchor links.\n`); - await TestRunner.loadLegacyModule('console'); await TestRunner.showPanel('network'); await TestRunner.evaluateInPagePromise(` function loadScript()
diff --git a/third_party/blink/web_tests/http/tests/devtools/network/script-as-text-loading-with-caret-expected.txt b/third_party/blink/web_tests/http/tests/devtools/network/script-as-text-loading-with-caret-expected.txt index 9f856999..e67a62b5 100644 --- a/third_party/blink/web_tests/http/tests/devtools/network/script-as-text-loading-with-caret-expected.txt +++ b/third_party/blink/web_tests/http/tests/devtools/network/script-as-text-loading-with-caret-expected.txt
@@ -1,7 +1,7 @@ Tests console message when script is loaded with incorrect text/html mime type and the URL contains the '^' character. Message count: 1 -script-as-text-loading-with-caret.js:18 GET http://127.0.0.1:8000/devtools/network/resources/this-is-a-weird?querystring=with^carats^like^these^because^who^doesnt^love^strange^characters^in^urls net::ERR_ABORTED 404 (Not Found) -loadScript @ script-as-text-loading-with-caret.js:18 -(anonymous) @ script-as-text-loading-with-caret.js:22 +script-as-text-loading-with-caret.js:17 GET http://127.0.0.1:8000/devtools/network/resources/this-is-a-weird?querystring=with^carats^like^these^because^who^doesnt^love^strange^characters^in^urls net::ERR_ABORTED 404 (Not Found) +loadScript @ script-as-text-loading-with-caret.js:17 +(anonymous) @ script-as-text-loading-with-caret.js:21
diff --git a/third_party/blink/web_tests/http/tests/devtools/network/script-as-text-loading-with-caret.js b/third_party/blink/web_tests/http/tests/devtools/network/script-as-text-loading-with-caret.js index ebf1054..ae20b87 100644 --- a/third_party/blink/web_tests/http/tests/devtools/network/script-as-text-loading-with-caret.js +++ b/third_party/blink/web_tests/http/tests/devtools/network/script-as-text-loading-with-caret.js
@@ -8,7 +8,6 @@ (async function() { TestRunner.addResult( `Tests console message when script is loaded with incorrect text/html mime type and the URL contains the '^' character.\n`); - await TestRunner.loadLegacyModule('console'); await TestRunner.showPanel('network'); await TestRunner.evaluateInPagePromise(` function loadScript()
diff --git a/third_party/blink/web_tests/http/tests/devtools/network/subresource-integrity-number-of-requests-for-script.js b/third_party/blink/web_tests/http/tests/devtools/network/subresource-integrity-number-of-requests-for-script.js index 5c7e4de..abeb717 100644 --- a/third_party/blink/web_tests/http/tests/devtools/network/subresource-integrity-number-of-requests-for-script.js +++ b/third_party/blink/web_tests/http/tests/devtools/network/subresource-integrity-number-of-requests-for-script.js
@@ -8,7 +8,6 @@ (async function() { TestRunner.addResult(`Verify that only one request is made for basic script requests with integrity attribute.\n`); - await TestRunner.loadLegacyModule('console'); await TestRunner.showPanel('network'); await TestRunner.evaluateInPagePromise(`
diff --git a/third_party/blink/web_tests/http/tests/devtools/network/subresource-integrity-number-of-requests-for-stylesheet.js b/third_party/blink/web_tests/http/tests/devtools/network/subresource-integrity-number-of-requests-for-stylesheet.js index d3705a73..b21d709 100644 --- a/third_party/blink/web_tests/http/tests/devtools/network/subresource-integrity-number-of-requests-for-stylesheet.js +++ b/third_party/blink/web_tests/http/tests/devtools/network/subresource-integrity-number-of-requests-for-stylesheet.js
@@ -9,7 +9,6 @@ (async function() { TestRunner.addResult( `Verify that only one request is made for basic stylesheet requests with integrity attribute.\n`); - await TestRunner.loadLegacyModule('console'); await TestRunner.showPanel('network'); await TestRunner.evaluateInPagePromise(`
diff --git a/third_party/blink/web_tests/http/tests/devtools/network/warning-for-long-cookie.js b/third_party/blink/web_tests/http/tests/devtools/network/warning-for-long-cookie.js index f3e8f223..ef10699 100644 --- a/third_party/blink/web_tests/http/tests/devtools/network/warning-for-long-cookie.js +++ b/third_party/blink/web_tests/http/tests/devtools/network/warning-for-long-cookie.js
@@ -8,7 +8,6 @@ (async function() { TestRunner.addResult(`Checks that we show warning message for long cookie.\n`); - await TestRunner.loadLegacyModule('console'); await TestRunner.showPanel('network'); NetworkTestRunner.makeFetch(
diff --git a/third_party/blink/web_tests/http/tests/devtools/oopif/oopif-console-preserves-log-on-frame-navigation-expected.txt b/third_party/blink/web_tests/http/tests/devtools/oopif/oopif-console-preserves-log-on-frame-navigation-expected.txt index 95f4f01f..eb0ca3e 100644 --- a/third_party/blink/web_tests/http/tests/devtools/oopif/oopif-console-preserves-log-on-frame-navigation-expected.txt +++ b/third_party/blink/web_tests/http/tests/devtools/oopif/oopif-console-preserves-log-on-frame-navigation-expected.txt
@@ -1,4 +1,4 @@ Tests that console preserves log on oopif navigation -oopif-console-preser…me-navigation.js:17 Before navigation -oopif-console-preser…me-navigation.js:19 After navigation +oopif-console-preser…me-navigation.js:16 Before navigation +oopif-console-preser…me-navigation.js:18 After navigation
diff --git a/third_party/blink/web_tests/http/tests/devtools/oopif/oopif-console-preserves-log-on-frame-navigation.js b/third_party/blink/web_tests/http/tests/devtools/oopif/oopif-console-preserves-log-on-frame-navigation.js index 52ca510..62d2e3a 100644 --- a/third_party/blink/web_tests/http/tests/devtools/oopif/oopif-console-preserves-log-on-frame-navigation.js +++ b/third_party/blink/web_tests/http/tests/devtools/oopif/oopif-console-preserves-log-on-frame-navigation.js
@@ -9,7 +9,6 @@ (async function() { TestRunner.addResult(`Tests that console preserves log on oopif navigation`); - await TestRunner.loadLegacyModule('console'); await TestRunner.showPanel('console'); Common.Settings.settingForTest('preserveConsoleLog').set(false);
diff --git a/third_party/blink/web_tests/http/tests/devtools/oopif/oopif-cookies-refresh.js b/third_party/blink/web_tests/http/tests/devtools/oopif/oopif-cookies-refresh.js index 38742e6..45e43e7 100644 --- a/third_party/blink/web_tests/http/tests/devtools/oopif/oopif-cookies-refresh.js +++ b/third_party/blink/web_tests/http/tests/devtools/oopif/oopif-cookies-refresh.js
@@ -11,11 +11,9 @@ (async function() { TestRunner.addResult(`Tests that cookies are properly shown after oopif refresh`); - await TestRunner.loadLegacyModule('console'); // Note: every test that uses a storage API must manually clean-up state from previous tests. await ApplicationTestRunner.resetState(); - await TestRunner.loadLegacyModule('console'); await TestRunner.loadModule('cookie_table'); await TestRunner.showPanel('console'); await TestRunner.showPanel('resources');
diff --git a/third_party/blink/web_tests/http/tests/devtools/oopif/oopif-presentation-console-messages.js b/third_party/blink/web_tests/http/tests/devtools/oopif/oopif-presentation-console-messages.js index 5521089..06b7d0e8 100644 --- a/third_party/blink/web_tests/http/tests/devtools/oopif/oopif-presentation-console-messages.js +++ b/third_party/blink/web_tests/http/tests/devtools/oopif/oopif-presentation-console-messages.js
@@ -12,7 +12,6 @@ (async function() { TestRunner.addResult(`Test that links to UISourceCode work correctly when navigating OOPIF`); - await TestRunner.loadLegacyModule('console'); await TestRunner.showPanel('console'); const messages = new Map();
diff --git a/third_party/blink/web_tests/http/tests/devtools/oopif/oopif-storage.js b/third_party/blink/web_tests/http/tests/devtools/oopif/oopif-storage.js index 15efc4c..69c4d6de 100644 --- a/third_party/blink/web_tests/http/tests/devtools/oopif/oopif-storage.js +++ b/third_party/blink/web_tests/http/tests/devtools/oopif/oopif-storage.js
@@ -7,7 +7,6 @@ (async function() { TestRunner.addResult(`Verify DOM storage with OOPIFs`); - await TestRunner.loadLegacyModule('console'); // Note: every test that uses a storage API must manually clean-up state from previous tests. await ApplicationTestRunner.resetState(); await TestRunner.navigatePromise('resources/page.html');
diff --git a/third_party/blink/web_tests/http/tests/devtools/portals/portals-console.js b/third_party/blink/web_tests/http/tests/devtools/portals/portals-console.js index 2e662b9..9cadec6 100644 --- a/third_party/blink/web_tests/http/tests/devtools/portals/portals-console.js +++ b/third_party/blink/web_tests/http/tests/devtools/portals/portals-console.js
@@ -6,10 +6,10 @@ import {ConsoleTestRunner} from 'console_test_runner'; import * as SDK from 'devtools/core/sdk/sdk.js'; +import * as Console from 'devtools/panels/console/console.js'; (async function() { TestRunner.addResult(`Tests that the console works correctly with portals`); - await TestRunner.loadLegacyModule('console'); await TestRunner.showPanel('console'); await TestRunner.navigatePromise('resources/append-predecessor-host.html'); @@ -34,7 +34,7 @@ }, async function testContextSelector(next) { - const selector = Console.ConsoleView.instance().consoleContextSelector; + const selector = Console.ConsoleView.ConsoleView.instance().consoleContextSelector; TestRunner.assertEquals(selector.items.length, 2); const executionContext = selector.items.at(1); TestRunner.assertEquals(selector.titleFor(executionContext), 'append-predecessor.html');
diff --git a/third_party/blink/web_tests/http/tests/devtools/resource-har-conversion.js b/third_party/blink/web_tests/http/tests/devtools/resource-har-conversion.js index da7ff68..18add10 100644 --- a/third_party/blink/web_tests/http/tests/devtools/resource-har-conversion.js +++ b/third_party/blink/web_tests/http/tests/devtools/resource-har-conversion.js
@@ -10,7 +10,6 @@ (async function() { TestRunner.addResult(`Tests conversion of Inspector's resource representation into HAR format.\n`); - await TestRunner.loadLegacyModule('console'); await TestRunner.NetworkAgent.setCacheDisabled(true); await TestRunner.reloadPagePromise();
diff --git a/third_party/blink/web_tests/http/tests/devtools/resource-har-headers.js b/third_party/blink/web_tests/http/tests/devtools/resource-har-headers.js index 22a044d..d6fa710 100644 --- a/third_party/blink/web_tests/http/tests/devtools/resource-har-headers.js +++ b/third_party/blink/web_tests/http/tests/devtools/resource-har-headers.js
@@ -12,7 +12,6 @@ (async function() { 'use strict'; TestRunner.addResult(`Tests the nondeterministic bits of HAR conversion via the magic of hard-coded values.\n`); - await TestRunner.loadLegacyModule('console'); function visibleNewlines(s) { return s.replace(/\r/, '\\r').replace(/\n/, '\\n');
diff --git a/third_party/blink/web_tests/http/tests/devtools/resource-tree/iframe-main-resource.js b/third_party/blink/web_tests/http/tests/devtools/resource-tree/iframe-main-resource.js index 74c70a8..938f7f12 100644 --- a/third_party/blink/web_tests/http/tests/devtools/resource-tree/iframe-main-resource.js +++ b/third_party/blink/web_tests/http/tests/devtools/resource-tree/iframe-main-resource.js
@@ -9,7 +9,6 @@ (async function() { TestRunner.addResult(`Verify that iframe's main resource is reported only once.\n`); - await TestRunner.loadLegacyModule('console'); await TestRunner.showPanel('resources'); await TestRunner.evaluateInPageAsync(` (function createIframe() {
diff --git a/third_party/blink/web_tests/http/tests/devtools/resource-tree/resource-request-content-after-loading-and-clearing-cache.js b/third_party/blink/web_tests/http/tests/devtools/resource-tree/resource-request-content-after-loading-and-clearing-cache.js index 4de8d83a..de2550f5 100644 --- a/third_party/blink/web_tests/http/tests/devtools/resource-tree/resource-request-content-after-loading-and-clearing-cache.js +++ b/third_party/blink/web_tests/http/tests/devtools/resource-tree/resource-request-content-after-loading-and-clearing-cache.js
@@ -8,7 +8,6 @@ (async function() { TestRunner.addResult( `Tests resource content is correctly loaded if Resource.requestContent was called before network request was finished. https://bugs.webkit.org/show_bug.cgi?id=90153\n`); - await TestRunner.loadLegacyModule('console'); await TestRunner.showPanel('resources'); await TestRunner.addStylesheetTag('resources/styles-initial.css'); TestRunner.addResult('Adding dynamic script: ');
diff --git a/third_party/blink/web_tests/http/tests/devtools/resource-tree/resource-request-content-while-loading.js b/third_party/blink/web_tests/http/tests/devtools/resource-tree/resource-request-content-while-loading.js index 877ba84..09b2101 100644 --- a/third_party/blink/web_tests/http/tests/devtools/resource-tree/resource-request-content-while-loading.js +++ b/third_party/blink/web_tests/http/tests/devtools/resource-tree/resource-request-content-while-loading.js
@@ -10,7 +10,6 @@ (async function() { TestRunner.addResult( `Tests resource content is correctly loaded if Resource.requestContent was called before network request was finished. https://bugs.webkit.org/show_bug.cgi?id=90153\n`); - await TestRunner.loadLegacyModule('console'); await TestRunner.showPanel('resources'); TestRunner.addSniffer(SDK.ResourceTreeModel.ResourceTreeFrame.prototype, 'addRequest', requestAdded, true);
diff --git a/third_party/blink/web_tests/http/tests/devtools/resource-tree/resource-tree-crafted-frame-add.js b/third_party/blink/web_tests/http/tests/devtools/resource-tree/resource-tree-crafted-frame-add.js index 3bcac8b..abb5fb9f 100644 --- a/third_party/blink/web_tests/http/tests/devtools/resource-tree/resource-tree-crafted-frame-add.js +++ b/third_party/blink/web_tests/http/tests/devtools/resource-tree/resource-tree-crafted-frame-add.js
@@ -7,7 +7,6 @@ (async function() { TestRunner.addResult(`Tests resource tree model on crafted iframe addition (will time out on failure).\n`); - await TestRunner.loadLegacyModule('console'); await TestRunner.showPanel('resources'); TestRunner.addSniffer(TestRunner.resourceTreeModel, 'frameAttached', TestRunner.completeTest); TestRunner.evaluateInPage(`
diff --git a/third_party/blink/web_tests/http/tests/devtools/resource-tree/resource-tree-document-url.js b/third_party/blink/web_tests/http/tests/devtools/resource-tree/resource-tree-document-url.js index 21cdfd7..17d6c5f 100644 --- a/third_party/blink/web_tests/http/tests/devtools/resource-tree/resource-tree-document-url.js +++ b/third_party/blink/web_tests/http/tests/devtools/resource-tree/resource-tree-document-url.js
@@ -7,7 +7,6 @@ (async function() { TestRunner.addResult(`Tests that resources have proper documentURL set in the tree model.\n`); - await TestRunner.loadLegacyModule('console'); await TestRunner.showPanel('resources'); TestRunner.resourceTreeModel.addEventListener(SDK.ResourceTreeModel.Events.FrameNavigated, waitForResources);
diff --git a/third_party/blink/web_tests/http/tests/devtools/resource-tree/resource-tree-events.js b/third_party/blink/web_tests/http/tests/devtools/resource-tree/resource-tree-events.js index 5bc7251..467294b 100644 --- a/third_party/blink/web_tests/http/tests/devtools/resource-tree/resource-tree-events.js +++ b/third_party/blink/web_tests/http/tests/devtools/resource-tree/resource-tree-events.js
@@ -7,7 +7,6 @@ (async function() { TestRunner.addResult(`Tests top frame navigation events.\n`); - await TestRunner.loadLegacyModule('console'); await TestRunner.showPanel('resources'); // Reset resourceTreeModel.
diff --git a/third_party/blink/web_tests/http/tests/devtools/resource-tree/resource-tree-frame-add.js b/third_party/blink/web_tests/http/tests/devtools/resource-tree/resource-tree-frame-add.js index 97a3d53..98dd9f1f 100644 --- a/third_party/blink/web_tests/http/tests/devtools/resource-tree/resource-tree-frame-add.js +++ b/third_party/blink/web_tests/http/tests/devtools/resource-tree/resource-tree-frame-add.js
@@ -9,7 +9,6 @@ (async function() { TestRunner.addResult( `Tests resource tree model on iframe addition, compares resource tree against golden. Every line is important.\n`); - await TestRunner.loadLegacyModule('console'); await TestRunner.showPanel('resources'); await TestRunner.addStylesheetTag('resources/styles-initial.css');
diff --git a/third_party/blink/web_tests/http/tests/devtools/resource-tree/resource-tree-frame-in-crafted-frame.js b/third_party/blink/web_tests/http/tests/devtools/resource-tree/resource-tree-frame-in-crafted-frame.js index c20543d..9462145 100644 --- a/third_party/blink/web_tests/http/tests/devtools/resource-tree/resource-tree-frame-in-crafted-frame.js +++ b/third_party/blink/web_tests/http/tests/devtools/resource-tree/resource-tree-frame-in-crafted-frame.js
@@ -8,7 +8,6 @@ (async function() { TestRunner.addResult( `Tests that frame inside crafted frame doesn't cause 'MainFrameNavigated' event and correctly attaches to frame tree. crbug/259036\n`); - await TestRunner.loadLegacyModule('console'); await TestRunner.showPanel('resources'); var frameId = Symbol('frameId');
diff --git a/third_party/blink/web_tests/http/tests/devtools/resource-tree/resource-tree-frame-navigate.js b/third_party/blink/web_tests/http/tests/devtools/resource-tree/resource-tree-frame-navigate.js index 0ef00060..31fb589 100644 --- a/third_party/blink/web_tests/http/tests/devtools/resource-tree/resource-tree-frame-navigate.js +++ b/third_party/blink/web_tests/http/tests/devtools/resource-tree/resource-tree-frame-navigate.js
@@ -9,7 +9,6 @@ (async function() { TestRunner.addResult( `Tests resource tree model on iframe navigation, compares resource tree against golden. Every line is important.\n`); - await TestRunner.loadLegacyModule('console'); await TestRunner.showPanel('resources'); await TestRunner.loadHTML(` <iframe id="iframe"></iframe>
diff --git a/third_party/blink/web_tests/http/tests/devtools/resource-tree/resource-tree-invalid-mime-type-css-content.js b/third_party/blink/web_tests/http/tests/devtools/resource-tree/resource-tree-invalid-mime-type-css-content.js index 9b764ba..0bb08d89 100644 --- a/third_party/blink/web_tests/http/tests/devtools/resource-tree/resource-tree-invalid-mime-type-css-content.js +++ b/third_party/blink/web_tests/http/tests/devtools/resource-tree/resource-tree-invalid-mime-type-css-content.js
@@ -10,7 +10,6 @@ (async function() { TestRunner.addResult( `Tests that content is correctly shown for css loaded with invalid mime type in quirks mode. https://bugs.webkit.org/show_bug.cgi?id=80528\n`); - await TestRunner.loadLegacyModule('console'); await TestRunner.showPanel('resources'); await TestRunner.addStylesheetTag('resources/stylesheet-text-plain.php'); await TestRunner.waitForUISourceCode('stylesheet-text-plain.php');
diff --git a/third_party/blink/web_tests/http/tests/devtools/resource-tree/resource-tree-non-unique-url.js b/third_party/blink/web_tests/http/tests/devtools/resource-tree/resource-tree-non-unique-url.js index 666ae327..6884507 100644 --- a/third_party/blink/web_tests/http/tests/devtools/resource-tree/resource-tree-non-unique-url.js +++ b/third_party/blink/web_tests/http/tests/devtools/resource-tree/resource-tree-non-unique-url.js
@@ -9,7 +9,6 @@ (async function() { TestRunner.addResult( `Tests resources panel shows several resources with the same url if they were loaded with inspector already opened.\n`); - await TestRunner.loadLegacyModule('console'); await TestRunner.showPanel('resources'); TestRunner.addSniffer(Resources.FrameTreeElement.prototype, 'appendResource', onResource, true); TestRunner.evaluateInPageAnonymously(`
diff --git a/third_party/blink/web_tests/http/tests/devtools/resource-tree/resource-tree-reload.js b/third_party/blink/web_tests/http/tests/devtools/resource-tree/resource-tree-reload.js index de707d4..d669aca4 100644 --- a/third_party/blink/web_tests/http/tests/devtools/resource-tree/resource-tree-reload.js +++ b/third_party/blink/web_tests/http/tests/devtools/resource-tree/resource-tree-reload.js
@@ -8,7 +8,6 @@ (async function() { TestRunner.addResult( `Tests resource tree model on page reload, compares resource tree against golden. Every line is important.\n`); - await TestRunner.loadLegacyModule('console'); await TestRunner.showPanel('resources'); await TestRunner.navigatePromise(TestRunner.url('resources/resource-tree-reload.html')); await TestRunner.reloadPagePromise();
diff --git a/third_party/blink/web_tests/http/tests/devtools/runtime/runtime-es6-setSymbolPropertyValue-expected.txt b/third_party/blink/web_tests/http/tests/devtools/runtime/runtime-es6-setSymbolPropertyValue-expected.txt index 8fac52b..3fc96f8a 100644 --- a/third_party/blink/web_tests/http/tests/devtools/runtime/runtime-es6-setSymbolPropertyValue-expected.txt +++ b/third_party/blink/web_tests/http/tests/devtools/runtime/runtime-es6-setSymbolPropertyValue-expected.txt
@@ -2,17 +2,17 @@ Running: testSetUp -runtime-es6-setSymbolPropertyValue.js:18 ===== Initial ===== -runtime-es6-setSymbolPropertyValue.js:19 2 -runtime-es6-setSymbolPropertyValue.js:20 +runtime-es6-setSymbolPropertyValue.js:20 ===== Initial ===== +runtime-es6-setSymbolPropertyValue.js:21 2 +runtime-es6-setSymbolPropertyValue.js:22 Running: testSetSymbolPropertyValue -runtime-es6-setSymbolPropertyValue.js:18 ===== Set property ===== -runtime-es6-setSymbolPropertyValue.js:19 3 -runtime-es6-setSymbolPropertyValue.js:20 +runtime-es6-setSymbolPropertyValue.js:20 ===== Set property ===== +runtime-es6-setSymbolPropertyValue.js:21 3 +runtime-es6-setSymbolPropertyValue.js:22 Running: testDeleteSymbolProperty -runtime-es6-setSymbolPropertyValue.js:18 ===== Delete property ===== -runtime-es6-setSymbolPropertyValue.js:19 undefined -runtime-es6-setSymbolPropertyValue.js:20 +runtime-es6-setSymbolPropertyValue.js:20 ===== Delete property ===== +runtime-es6-setSymbolPropertyValue.js:21 undefined +runtime-es6-setSymbolPropertyValue.js:22
diff --git a/third_party/blink/web_tests/http/tests/devtools/runtime/runtime-es6-setSymbolPropertyValue.js b/third_party/blink/web_tests/http/tests/devtools/runtime/runtime-es6-setSymbolPropertyValue.js index 48a0657..ef505b3e 100644 --- a/third_party/blink/web_tests/http/tests/devtools/runtime/runtime-es6-setSymbolPropertyValue.js +++ b/third_party/blink/web_tests/http/tests/devtools/runtime/runtime-es6-setSymbolPropertyValue.js
@@ -5,9 +5,11 @@ import {TestRunner} from 'test_runner'; import {ConsoleTestRunner} from 'console_test_runner'; +import * as Console from 'devtools/panels/console/console.js'; + (async function() { - TestRunner.addResult(`Tests editing Symbol properties.\n`); - await TestRunner.loadLegacyModule('console'); + // This await is necessary for evaluateInPagePromise to produce accurate line numbers. + await TestRunner.addResult(`Tests editing Symbol properties.\n`); await TestRunner.evaluateInPagePromise(` var object1 = { foo: 1 }; var symbol1 = Symbol("a"); @@ -25,7 +27,7 @@ async function dumpAndClearConsoleMessages() { await ConsoleTestRunner.dumpConsoleMessages(); - Console.ConsoleView.clearConsole(); + Console.ConsoleView.ConsoleView.clearConsole(); } TestRunner.runTestSuite([
diff --git a/third_party/blink/web_tests/http/tests/devtools/runtime/runtime-setPropertyValue.js b/third_party/blink/web_tests/http/tests/devtools/runtime/runtime-setPropertyValue.js index 2e88972..2acf43e 100644 --- a/third_party/blink/web_tests/http/tests/devtools/runtime/runtime-setPropertyValue.js +++ b/third_party/blink/web_tests/http/tests/devtools/runtime/runtime-setPropertyValue.js
@@ -6,8 +6,8 @@ import {ConsoleTestRunner} from 'console_test_runner'; (async function() { - TestRunner.addResult(`Tests WebInspector.RemoveObject.setPropertyValue implementation.\n`); - await TestRunner.loadLegacyModule('console'); + // This await is necessary for evaluateInPagePromise to produce accurate line numbers. + await TestRunner.addResult(`Tests WebInspector.RemoveObject.setPropertyValue implementation.\n`); await TestRunner.evaluateInPagePromise(` var object1 = { foo: 1 }; var object2 = { bar: 2 };
diff --git a/third_party/blink/web_tests/http/tests/devtools/screen-orientation-override.js b/third_party/blink/web_tests/http/tests/devtools/screen-orientation-override.js index 4706706f..2627ae1 100644 --- a/third_party/blink/web_tests/http/tests/devtools/screen-orientation-override.js +++ b/third_party/blink/web_tests/http/tests/devtools/screen-orientation-override.js
@@ -9,7 +9,6 @@ (async function() { TestRunner.addResult(`Test screen orientation override.\n`); - await TestRunner.loadLegacyModule('console'); await TestRunner.navigatePromise('resources/screen-orientation-resource.html');
diff --git a/third_party/blink/web_tests/http/tests/devtools/search/search-in-non-existing-resource.js b/third_party/blink/web_tests/http/tests/devtools/search/search-in-non-existing-resource.js index 602a306..251cb36c 100644 --- a/third_party/blink/web_tests/http/tests/devtools/search/search-in-non-existing-resource.js +++ b/third_party/blink/web_tests/http/tests/devtools/search/search-in-non-existing-resource.js
@@ -11,7 +11,6 @@ (async function() { TestRunner.addResult( `Tests single resource search in inspector page agent with non existing resource url does not cause a crash.\n`); - await TestRunner.loadLegacyModule('console'); await TestRunner.showPanel('sources'); await TestRunner.addIframe('resources/search.html'); await TestRunner
diff --git a/third_party/blink/web_tests/http/tests/devtools/search/search-in-resource.js b/third_party/blink/web_tests/http/tests/devtools/search/search-in-resource.js index 5814797..82515ab 100644 --- a/third_party/blink/web_tests/http/tests/devtools/search/search-in-resource.js +++ b/third_party/blink/web_tests/http/tests/devtools/search/search-in-resource.js
@@ -10,7 +10,6 @@ (async function() { TestRunner.addResult(`Tests single resource search in inspector page agent.\n`); - await TestRunner.loadLegacyModule('console'); await TestRunner.showPanel('sources'); await TestRunner.addIframe('resources/search.html');
diff --git a/third_party/blink/web_tests/http/tests/devtools/search/search-in-script.js b/third_party/blink/web_tests/http/tests/devtools/search/search-in-script.js index 3ad983f7..155ff249 100644 --- a/third_party/blink/web_tests/http/tests/devtools/search/search-in-script.js +++ b/third_party/blink/web_tests/http/tests/devtools/search/search-in-script.js
@@ -8,7 +8,6 @@ (async function() { TestRunner.addResult(`Tests script search in inspector debugger agent.\n`); - await TestRunner.loadLegacyModule('console'); await TestRunner.showPanel('sources'); await TestRunner.addIframe('resources/search.html');
diff --git a/third_party/blink/web_tests/http/tests/devtools/search/search-in-sourcemap.js b/third_party/blink/web_tests/http/tests/devtools/search/search-in-sourcemap.js index 581c5601..23643bde 100644 --- a/third_party/blink/web_tests/http/tests/devtools/search/search-in-sourcemap.js +++ b/third_party/blink/web_tests/http/tests/devtools/search/search-in-sourcemap.js
@@ -10,7 +10,6 @@ (async function() { TestRunner.addResult(`Tests single resource search in inspector page agent.\n`); - await TestRunner.loadLegacyModule('console'); await TestRunner.loadLegacyModule('search'); await TestRunner.showPanel('sources'); await TestRunner.navigate('resources/sourcemap-page.html');
diff --git a/third_party/blink/web_tests/http/tests/devtools/search/search-in-static.js b/third_party/blink/web_tests/http/tests/devtools/search/search-in-static.js index a98cd68..bbbb2287 100644 --- a/third_party/blink/web_tests/http/tests/devtools/search/search-in-static.js +++ b/third_party/blink/web_tests/http/tests/devtools/search/search-in-static.js
@@ -12,7 +12,6 @@ (async function() { TestRunner.addResult(`Tests static content provider search.\n`); - await TestRunner.loadLegacyModule('console'); await TestRunner.showPanel('sources'); await TestRunner.addIframe('resources/search.html');
diff --git a/third_party/blink/web_tests/http/tests/devtools/service-workers/add-empty-fetch-handler.js b/third_party/blink/web_tests/http/tests/devtools/service-workers/add-empty-fetch-handler.js index 4fe33ef..687dd3c9 100644 --- a/third_party/blink/web_tests/http/tests/devtools/service-workers/add-empty-fetch-handler.js +++ b/third_party/blink/web_tests/http/tests/devtools/service-workers/add-empty-fetch-handler.js
@@ -17,7 +17,6 @@ (async function() { TestRunner.addResult( `Tests that a warning is shown in the console if addEventListener adds an empty fetch handler.\n`); - await TestRunner.loadLegacyModule('console'); // Note: every test that uses a storage API must manually clean-up state from previous tests. await ApplicationTestRunner.resetState(); await TestRunner.showPanel('resources');
diff --git a/third_party/blink/web_tests/http/tests/devtools/service-workers/lazy-addeventlisteners.js b/third_party/blink/web_tests/http/tests/devtools/service-workers/lazy-addeventlisteners.js index 8c828f2..e8655b8 100644 --- a/third_party/blink/web_tests/http/tests/devtools/service-workers/lazy-addeventlisteners.js +++ b/third_party/blink/web_tests/http/tests/devtools/service-workers/lazy-addeventlisteners.js
@@ -17,8 +17,6 @@ (async function() { TestRunner.addResult( `Tests that a warning is shown in the console if addEventListener is called after initial evaluation of the service worker script.\n`); - await TestRunner.loadLegacyModule('console'); - await TestRunner.loadLegacyModule('console'); // Note: every test that uses a storage API must manually clean-up state from previous tests. await ApplicationTestRunner.resetState(); await TestRunner.showPanel('resources');
diff --git a/third_party/blink/web_tests/http/tests/devtools/service-workers/offline.js b/third_party/blink/web_tests/http/tests/devtools/service-workers/offline.js index 28af3b2..614e7940 100644 --- a/third_party/blink/web_tests/http/tests/devtools/service-workers/offline.js +++ b/third_party/blink/web_tests/http/tests/devtools/service-workers/offline.js
@@ -7,7 +7,6 @@ (async function() { TestRunner.addResult(`Tests "Offline" checkbox does not crash. crbug.com/746220\n`); - await TestRunner.loadLegacyModule('console'); // Note: every test that uses a storage API must manually clean-up state from previous tests. await ApplicationTestRunner.resetState();
diff --git a/third_party/blink/web_tests/http/tests/devtools/service-workers/service-worker-agents.js b/third_party/blink/web_tests/http/tests/devtools/service-workers/service-worker-agents.js index 4dfbe97..62b04146 100644 --- a/third_party/blink/web_tests/http/tests/devtools/service-workers/service-worker-agents.js +++ b/third_party/blink/web_tests/http/tests/devtools/service-workers/service-worker-agents.js
@@ -9,7 +9,6 @@ (async function() { TestRunner.addResult(`Tests the way service workers don't enable DOM agent and does enable Debugger agent.\n`); - await TestRunner.loadLegacyModule('console'); // Note: every test that uses a storage API must manually clean-up state from previous tests. await ApplicationTestRunner.resetState();
diff --git a/third_party/blink/web_tests/http/tests/devtools/service-workers/service-worker-manager.js b/third_party/blink/web_tests/http/tests/devtools/service-workers/service-worker-manager.js index 6b361cb..89055016 100644 --- a/third_party/blink/web_tests/http/tests/devtools/service-workers/service-worker-manager.js +++ b/third_party/blink/web_tests/http/tests/devtools/service-workers/service-worker-manager.js
@@ -9,7 +9,6 @@ (async function() { TestRunner.addResult(`Tests the way service worker manager manages targets.\n`); - await TestRunner.loadLegacyModule('console'); // Note: every test that uses a storage API must manually clean-up state from previous tests. await ApplicationTestRunner.resetState();
diff --git a/third_party/blink/web_tests/http/tests/devtools/service-workers/service-worker-network-fetch-blocked.js b/third_party/blink/web_tests/http/tests/devtools/service-workers/service-worker-network-fetch-blocked.js index 6280538..4f13ca9d 100644 --- a/third_party/blink/web_tests/http/tests/devtools/service-workers/service-worker-network-fetch-blocked.js +++ b/third_party/blink/web_tests/http/tests/devtools/service-workers/service-worker-network-fetch-blocked.js
@@ -9,11 +9,9 @@ (async function() { TestRunner.addResult(`Tests blocking fetch in Service Workers.\n`); - await TestRunner.loadLegacyModule('console'); // Note: every test that uses a storage API must manually clean-up state from previous tests. await ApplicationTestRunner.resetState(); - await TestRunner.loadLegacyModule('console'); await TestRunner.showPanel('resources'); await TestRunner.showPanel('network');
diff --git a/third_party/blink/web_tests/http/tests/devtools/service-workers/service-worker-network-fetch.js b/third_party/blink/web_tests/http/tests/devtools/service-workers/service-worker-network-fetch.js index e3fa4c9..fc0ea3e 100644 --- a/third_party/blink/web_tests/http/tests/devtools/service-workers/service-worker-network-fetch.js +++ b/third_party/blink/web_tests/http/tests/devtools/service-workers/service-worker-network-fetch.js
@@ -9,11 +9,9 @@ (async function() { TestRunner.addResult(`Tests fetch in Service Workers.\n`); - await TestRunner.loadLegacyModule('console'); // Note: every test that uses a storage API must manually clean-up state from previous tests. await ApplicationTestRunner.resetState(); - await TestRunner.loadLegacyModule('console'); await TestRunner.showPanel('resources'); await TestRunner.showPanel('network');
diff --git a/third_party/blink/web_tests/http/tests/devtools/service-workers/service-worker-pause.js b/third_party/blink/web_tests/http/tests/devtools/service-workers/service-worker-pause.js index b8edf6c..baf42c6 100644 --- a/third_party/blink/web_tests/http/tests/devtools/service-workers/service-worker-pause.js +++ b/third_party/blink/web_tests/http/tests/devtools/service-workers/service-worker-pause.js
@@ -9,7 +9,6 @@ (async function() { TestRunner.addResult(`Tests that we can pause in service worker.\n`); await TestRunner.showPanel('sources'); - await TestRunner.loadLegacyModule('console'); // Note: every test that uses a storage API must manually clean-up state from previous tests. await ApplicationTestRunner.resetState();
diff --git a/third_party/blink/web_tests/http/tests/devtools/service-workers/service-worker-v8-cache.js b/third_party/blink/web_tests/http/tests/devtools/service-workers/service-worker-v8-cache.js index 73682c8..570bbb9e 100644 --- a/third_party/blink/web_tests/http/tests/devtools/service-workers/service-worker-v8-cache.js +++ b/third_party/blink/web_tests/http/tests/devtools/service-workers/service-worker-v8-cache.js
@@ -10,7 +10,6 @@ (async function() { TestRunner.addResult(`Tests V8 cache information of Service Worker Cache Storage in timeline\n`); - await TestRunner.loadLegacyModule('console'); // Note: every test that uses a storage API must manually clean-up state from previous tests. await ApplicationTestRunner.resetState();
diff --git a/third_party/blink/web_tests/http/tests/devtools/service-workers/service-workers-bypass-for-network-cors.js b/third_party/blink/web_tests/http/tests/devtools/service-workers/service-workers-bypass-for-network-cors.js index 882de1b..eecf6c6 100644 --- a/third_party/blink/web_tests/http/tests/devtools/service-workers/service-workers-bypass-for-network-cors.js +++ b/third_party/blink/web_tests/http/tests/devtools/service-workers/service-workers-bypass-for-network-cors.js
@@ -9,7 +9,6 @@ (async function() { TestRunner.addResult(`Tests "Bypass for network" checkbox works with CORS requests. crbug.com/771742\n`); - await TestRunner.loadLegacyModule('console'); // Note: every test that uses a storage API must manually clean-up state from previous tests. await ApplicationTestRunner.resetState();
diff --git a/third_party/blink/web_tests/http/tests/devtools/service-workers/service-workers-bypass-for-network-navigation.js b/third_party/blink/web_tests/http/tests/devtools/service-workers/service-workers-bypass-for-network-navigation.js index 3ebd73dd..206534b 100644 --- a/third_party/blink/web_tests/http/tests/devtools/service-workers/service-workers-bypass-for-network-navigation.js +++ b/third_party/blink/web_tests/http/tests/devtools/service-workers/service-workers-bypass-for-network-navigation.js
@@ -9,7 +9,6 @@ (async function() { TestRunner.addResult(`Tests "Bypass for network" checkbox works with navigations. crbug.com/746220\n`); - await TestRunner.loadLegacyModule('console'); // Note: every test that uses a storage API must manually clean-up state from previous tests. await ApplicationTestRunner.resetState();
diff --git a/third_party/blink/web_tests/http/tests/devtools/service-workers/service-workers-bypass-for-network-redirect.js b/third_party/blink/web_tests/http/tests/devtools/service-workers/service-workers-bypass-for-network-redirect.js index e84c8ed..b81b0d82 100644 --- a/third_party/blink/web_tests/http/tests/devtools/service-workers/service-workers-bypass-for-network-redirect.js +++ b/third_party/blink/web_tests/http/tests/devtools/service-workers/service-workers-bypass-for-network-redirect.js
@@ -11,11 +11,9 @@ (async function() { TestRunner.addResult(`Tests "Bypass for network" checkbox with redirection doesn't cause crash.\n`); - await TestRunner.loadLegacyModule('console'); // Note: every test that uses a storage API must manually clean-up state from previous tests. await ApplicationTestRunner.resetState(); - await TestRunner.loadLegacyModule('console'); await TestRunner.showPanel('resources'); const url = 'http://localhost:8000/devtools/service-workers/resources/' +
diff --git a/third_party/blink/web_tests/http/tests/devtools/service-workers/service-workers-navigation-preload.js b/third_party/blink/web_tests/http/tests/devtools/service-workers/service-workers-navigation-preload.js index 1c36681..7c9ce81 100644 --- a/third_party/blink/web_tests/http/tests/devtools/service-workers/service-workers-navigation-preload.js +++ b/third_party/blink/web_tests/http/tests/devtools/service-workers/service-workers-navigation-preload.js
@@ -9,7 +9,6 @@ (async function() { TestRunner.addResult(`Tests the navigation request related events are available in the DevTools\n`); - await TestRunner.loadLegacyModule('console'); // Note: every test that uses a storage API must manually clean-up state from previous tests. await ApplicationTestRunner.resetState();
diff --git a/third_party/blink/web_tests/http/tests/devtools/service-workers/service-workers-redundant.js b/third_party/blink/web_tests/http/tests/devtools/service-workers/service-workers-redundant.js index de80dd2..8fbe7ee 100644 --- a/third_party/blink/web_tests/http/tests/devtools/service-workers/service-workers-redundant.js +++ b/third_party/blink/web_tests/http/tests/devtools/service-workers/service-workers-redundant.js
@@ -10,11 +10,9 @@ (async function() { TestRunner.addResult(`ServiceWorkers must be shown correctly even if there is a redundant worker.\n`); - await TestRunner.loadLegacyModule('console'); // Note: every test that uses a storage API must manually clean-up state from previous tests. await ApplicationTestRunner.resetState(); - await TestRunner.loadLegacyModule('console'); await TestRunner.showPanel('resources'); const scriptURL = 'http://127.0.0.1:8000/devtools/service-workers/resources/changing-worker.php';
diff --git a/third_party/blink/web_tests/http/tests/devtools/service-workers/service-workers-view.js b/third_party/blink/web_tests/http/tests/devtools/service-workers/service-workers-view.js index 79972f5f..8193996 100644 --- a/third_party/blink/web_tests/http/tests/devtools/service-workers/service-workers-view.js +++ b/third_party/blink/web_tests/http/tests/devtools/service-workers/service-workers-view.js
@@ -10,11 +10,9 @@ (async function() { TestRunner.addResult(`Tests ServiceWorkersView on resources panel.\n`); - await TestRunner.loadLegacyModule('console'); // Note: every test that uses a storage API must manually clean-up state from previous tests. await ApplicationTestRunner.resetState(); - await TestRunner.loadLegacyModule('console'); await TestRunner.showPanel('resources'); var scriptURL = 'http://127.0.0.1:8000/devtools/service-workers/resources/service-worker-empty.js';
diff --git a/third_party/blink/web_tests/http/tests/devtools/service-workers/service-workers-wasm-test.js b/third_party/blink/web_tests/http/tests/devtools/service-workers/service-workers-wasm-test.js index b908fcf..5337d1f 100644 --- a/third_party/blink/web_tests/http/tests/devtools/service-workers/service-workers-wasm-test.js +++ b/third_party/blink/web_tests/http/tests/devtools/service-workers/service-workers-wasm-test.js
@@ -10,7 +10,6 @@ (async function() { TestRunner.addResult(`Tests V8 code cache for WebAssembly resources using Service Workers.\n`); - await TestRunner.loadLegacyModule('console'); await ApplicationTestRunner.resetState(); SDK.multitargetNetworkManager.clearBrowserCache();
diff --git a/third_party/blink/web_tests/http/tests/devtools/service-workers/sw-navigate-useragent.js b/third_party/blink/web_tests/http/tests/devtools/service-workers/sw-navigate-useragent.js index 413bd198..da8a3d2 100644 --- a/third_party/blink/web_tests/http/tests/devtools/service-workers/sw-navigate-useragent.js +++ b/third_party/blink/web_tests/http/tests/devtools/service-workers/sw-navigate-useragent.js
@@ -4,7 +4,6 @@ (async function() { TestRunner.addResult( `Tests that User-Agent override works for requests from Service Workers.\n`); - await TestRunner.loadLegacyModule('console'); await ApplicationTestRunner.resetState(); await TestRunner.showPanel('resources');
diff --git a/third_party/blink/web_tests/http/tests/devtools/service-workers/user-agent-override.js b/third_party/blink/web_tests/http/tests/devtools/service-workers/user-agent-override.js index 9c487e44..5b223970 100644 --- a/third_party/blink/web_tests/http/tests/devtools/service-workers/user-agent-override.js +++ b/third_party/blink/web_tests/http/tests/devtools/service-workers/user-agent-override.js
@@ -8,11 +8,9 @@ (async function() { TestRunner.addResult(`Tests that User-Agent override works for requests from Service Workers.\n`); - await TestRunner.loadLegacyModule('console'); // Note: every test that uses a storage API must manually clean-up state from previous tests. await ApplicationTestRunner.resetState(); - await TestRunner.loadLegacyModule('console'); await TestRunner.showPanel('resources'); function waitForTarget() {
diff --git a/third_party/blink/web_tests/http/tests/devtools/sourcemap-section-warning.js b/third_party/blink/web_tests/http/tests/devtools/sourcemap-section-warning.js index e1e9cfa..03e26b2 100644 --- a/third_party/blink/web_tests/http/tests/devtools/sourcemap-section-warning.js +++ b/third_party/blink/web_tests/http/tests/devtools/sourcemap-section-warning.js
@@ -7,7 +7,6 @@ (async function() { TestRunner.addResult(`Verify that sourcemap emits warning if there's a section with "url" field.`); - await TestRunner.loadLegacyModule('console'); await TestRunner.showPanel('console'); const url = 'http://127.0.0.1:8000/devtools/resources/source-map-warning.html'; await TestRunner.navigatePromise(url);
diff --git a/third_party/blink/web_tests/http/tests/devtools/sources/debugger-async/async-callstack-in-console-expected.txt b/third_party/blink/web_tests/http/tests/devtools/sources/debugger-async/async-callstack-in-console-expected.txt index 14bb73a..c2a6a79 100644 --- a/third_party/blink/web_tests/http/tests/devtools/sources/debugger-async/async-callstack-in-console-expected.txt +++ b/third_party/blink/web_tests/http/tests/devtools/sources/debugger-async/async-callstack-in-console-expected.txt
@@ -1,56 +1,56 @@ Tests asynchronous call stacks printed in console. Set timer for test function. -async-callstack-in-console.js:21 Console was cleared -async-callstack-in-console.js:27 console.trace +async-callstack-in-console.js:20 Console was cleared +async-callstack-in-console.js:26 console.trace + +timeout1 @ async-callstack-in-console.js:26 + +setTimeout (async) + +testFunction @ async-callstack-in-console.js:21 +async-callstack-in-console.js:33 Uncaught Error: foo + at timeout2 (async-callstack-in-console.js:33:17) + +timeout2 @ async-callstack-in-console.js:33 + +setTimeout (async) timeout1 @ async-callstack-in-console.js:27 setTimeout (async) -testFunction @ async-callstack-in-console.js:22 -async-callstack-in-console.js:34 Uncaught Error: foo - at timeout2 (async-callstack-in-console.js:34:17) +testFunction @ async-callstack-in-console.js:21 +async-callstack-in-console.js:38 console.trace -timeout2 @ async-callstack-in-console.js:34 +timeout3 @ async-callstack-in-console.js:38 setTimeout (async) -timeout1 @ async-callstack-in-console.js:28 +timeout2 @ async-callstack-in-console.js:32 setTimeout (async) -testFunction @ async-callstack-in-console.js:22 -async-callstack-in-console.js:39 console.trace - -timeout3 @ async-callstack-in-console.js:39 +timeout1 @ async-callstack-in-console.js:27 setTimeout (async) -timeout2 @ async-callstack-in-console.js:33 +testFunction @ async-callstack-in-console.js:21 +async-callstack-in-console.js:46 Failed to execute 'postMessage' on 'DOMWindow': The target origin provided ('http://www.example.com') does not match the recipient window's origin ('http://127.0.0.1:8000'). + +tryPostMessage @ async-callstack-in-console.js:46 + +timeout3 @ async-callstack-in-console.js:40 setTimeout (async) -timeout1 @ async-callstack-in-console.js:28 +timeout2 @ async-callstack-in-console.js:32 setTimeout (async) -testFunction @ async-callstack-in-console.js:22 -async-callstack-in-console.js:47 Failed to execute 'postMessage' on 'DOMWindow': The target origin provided ('http://www.example.com') does not match the recipient window's origin ('http://127.0.0.1:8000'). - -tryPostMessage @ async-callstack-in-console.js:47 - -timeout3 @ async-callstack-in-console.js:41 +timeout1 @ async-callstack-in-console.js:27 setTimeout (async) -timeout2 @ async-callstack-in-console.js:33 - -setTimeout (async) - -timeout1 @ async-callstack-in-console.js:28 - -setTimeout (async) - -testFunction @ async-callstack-in-console.js:22 +testFunction @ async-callstack-in-console.js:21
diff --git a/third_party/blink/web_tests/http/tests/devtools/sources/debugger-async/async-callstack-in-console.js b/third_party/blink/web_tests/http/tests/devtools/sources/debugger-async/async-callstack-in-console.js index 8afd8271..15242822 100644 --- a/third_party/blink/web_tests/http/tests/devtools/sources/debugger-async/async-callstack-in-console.js +++ b/third_party/blink/web_tests/http/tests/devtools/sources/debugger-async/async-callstack-in-console.js
@@ -8,7 +8,6 @@ (async function() { TestRunner.addResult(`Tests asynchronous call stacks printed in console.\n`); - await TestRunner.loadLegacyModule('console'); await TestRunner.showPanel('sources'); await TestRunner.loadHTML(` <div><iframe src="../debugger/resources/post-message-listener.html" id="iframe" width="800" height="100" style="border: 1px solid black;">
diff --git a/third_party/blink/web_tests/http/tests/devtools/sources/debugger-console/debug-console-command-expected.txt b/third_party/blink/web_tests/http/tests/devtools/sources/debugger-console/debug-console-command-expected.txt index 02ab7cb..e2fae31d 100644 --- a/third_party/blink/web_tests/http/tests/devtools/sources/debugger-console/debug-console-command-expected.txt +++ b/third_party/blink/web_tests/http/tests/devtools/sources/debugger-console/debug-console-command-expected.txt
@@ -6,7 +6,7 @@ Set timer for test function. Script execution paused. Call stack: - 0) simpleTestFunction (debug-console-command.js:16) + 0) simpleTestFunction (debug-console-command.js:15) 1) (:1) Breakpoint removed. Script execution resumed. @@ -16,7 +16,7 @@ Set timer for test function. Script execution paused. Call stack: - 0) simpleTestFunction1 (debug-console-command.js:20) + 0) simpleTestFunction1 (debug-console-command.js:19) 1) (:1) Breakpoint removed. Script execution resumed. @@ -26,7 +26,7 @@ Set timer for test function. Script execution paused. Call stack: - 0) simpleTestFunction2 (debug-console-command.js:20) + 0) simpleTestFunction2 (debug-console-command.js:19) 1) (:1) Breakpoint removed. Script execution resumed.
diff --git a/third_party/blink/web_tests/http/tests/devtools/sources/debugger-console/debug-console-command.js b/third_party/blink/web_tests/http/tests/devtools/sources/debugger-console/debug-console-command.js index 4d2ca0f4..d7b0b11 100644 --- a/third_party/blink/web_tests/http/tests/devtools/sources/debugger-console/debug-console-command.js +++ b/third_party/blink/web_tests/http/tests/devtools/sources/debugger-console/debug-console-command.js
@@ -8,7 +8,6 @@ (async function() { TestRunner.addResult(`Tests debug(fn) console command.\n`); - await TestRunner.loadLegacyModule('console'); await TestRunner.showPanel('sources'); await TestRunner.evaluateInPagePromise(` function simpleTestFunction()
diff --git a/third_party/blink/web_tests/http/tests/devtools/sources/debugger-console/debugger-command-line-api.js b/third_party/blink/web_tests/http/tests/devtools/sources/debugger-console/debugger-command-line-api.js index b9805e9..5d8a42f 100644 --- a/third_party/blink/web_tests/http/tests/devtools/sources/debugger-console/debugger-command-line-api.js +++ b/third_party/blink/web_tests/http/tests/devtools/sources/debugger-console/debugger-command-line-api.js
@@ -12,7 +12,6 @@ (async function() { TestRunner.addResult(`Tests that inspect() command line api works while on breakpoint.\n`); - await TestRunner.loadLegacyModule('console'); await TestRunner.showPanel('sources'); await TestRunner.showPanel('elements'); await TestRunner.loadHTML(`
diff --git a/third_party/blink/web_tests/http/tests/devtools/sources/debugger-console/step-into-async-fetch.js b/third_party/blink/web_tests/http/tests/devtools/sources/debugger-console/step-into-async-fetch.js index 74001ca..a14775d 100644 --- a/third_party/blink/web_tests/http/tests/devtools/sources/debugger-console/step-into-async-fetch.js +++ b/third_party/blink/web_tests/http/tests/devtools/sources/debugger-console/step-into-async-fetch.js
@@ -8,7 +8,6 @@ (async function test() { TestRunner.addResult('Checks stepInto fetch'); - await TestRunner.loadLegacyModule('console'); await TestRunner.showPanel('sources'); await SourcesTestRunner.startDebuggerTestPromise();
diff --git a/third_party/blink/web_tests/http/tests/devtools/sources/debugger-pause/debugger-change-variable.js b/third_party/blink/web_tests/http/tests/devtools/sources/debugger-pause/debugger-change-variable.js index 67b3e43..0cec235 100644 --- a/third_party/blink/web_tests/http/tests/devtools/sources/debugger-pause/debugger-change-variable.js +++ b/third_party/blink/web_tests/http/tests/devtools/sources/debugger-pause/debugger-change-variable.js
@@ -10,7 +10,6 @@ (async function() { TestRunner.addResult(`Tests that modifying local variables works fine.\n`); - await TestRunner.loadLegacyModule('console'); await TestRunner.showPanel('sources'); await TestRunner.evaluateInPagePromise(` function slave(x)
diff --git a/third_party/blink/web_tests/http/tests/devtools/sources/debugger-pause/debugger-eval-on-call-frame-inside-iframe-expected.txt b/third_party/blink/web_tests/http/tests/devtools/sources/debugger-pause/debugger-eval-on-call-frame-inside-iframe-expected.txt index 3f45f2e0..7fe84cf 100644 --- a/third_party/blink/web_tests/http/tests/devtools/sources/debugger-pause/debugger-eval-on-call-frame-inside-iframe-expected.txt +++ b/third_party/blink/web_tests/http/tests/devtools/sources/debugger-pause/debugger-eval-on-call-frame-inside-iframe-expected.txt
@@ -3,7 +3,7 @@ Set timer for test function. Call stack: 0) pauseInsideIframe (:6) - 1) testFunction (debugger-eval-on-call-frame-inside-iframe.js:40) + 1) testFunction (debugger-eval-on-call-frame-inside-iframe.js:39) === Evaluating on iframe === dir() = 'overridden dir() in iframe' @@ -12,9 +12,9 @@ clear = x: = VM:1 Uncaught SyntaxError: Unexpected end of input at Object.pauseInsideIframe (<anonymous>:6:5) - at testFunction (debugger-eval-on-cal…ide-iframe.js:40:50) + at testFunction (debugger-eval-on-cal…ide-iframe.js:39:50) pauseInsideIframe @ VM:6 -testFunction @ debugger-eval-on-cal…inside-iframe.js:40 +testFunction @ debugger-eval-on-cal…inside-iframe.js:39 setTimeout (async) scheduleTestFunction @ VM:3 (anonymous) @ VM:1 @@ -26,9 +26,9 @@ clear = 'local in top frame' x: = VM:1 Uncaught SyntaxError: Unexpected end of input at Object.pauseInsideIframe (<anonymous>:6:5) - at testFunction (debugger-eval-on-cal…ide-iframe.js:40:50) + at testFunction (debugger-eval-on-cal…ide-iframe.js:39:50) pauseInsideIframe @ VM:6 -testFunction @ debugger-eval-on-cal…inside-iframe.js:40 +testFunction @ debugger-eval-on-cal…inside-iframe.js:39 setTimeout (async) scheduleTestFunction @ VM:3 (anonymous) @ VM:1
diff --git a/third_party/blink/web_tests/http/tests/devtools/sources/debugger-pause/debugger-eval-on-call-frame-inside-iframe.js b/third_party/blink/web_tests/http/tests/devtools/sources/debugger-pause/debugger-eval-on-call-frame-inside-iframe.js index ba9fc24..8d192471 100644 --- a/third_party/blink/web_tests/http/tests/devtools/sources/debugger-pause/debugger-eval-on-call-frame-inside-iframe.js +++ b/third_party/blink/web_tests/http/tests/devtools/sources/debugger-pause/debugger-eval-on-call-frame-inside-iframe.js
@@ -10,7 +10,6 @@ (async function() { TestRunner.addResult(`Test that evaluation on call frame works across all inspected windows in the call stack.\n`); - await TestRunner.loadLegacyModule('console'); await TestRunner.showPanel('sources'); await TestRunner.loadHTML(` <iframe id="iframe"></iframe>
diff --git a/third_party/blink/web_tests/http/tests/devtools/sources/debugger-pause/debugger-eval-on-call-frame.js b/third_party/blink/web_tests/http/tests/devtools/sources/debugger-pause/debugger-eval-on-call-frame.js index 3a9634b..a67b9df 100644 --- a/third_party/blink/web_tests/http/tests/devtools/sources/debugger-pause/debugger-eval-on-call-frame.js +++ b/third_party/blink/web_tests/http/tests/devtools/sources/debugger-pause/debugger-eval-on-call-frame.js
@@ -9,7 +9,6 @@ (async function() { TestRunner.addResult( `Test that evaluation in the context of top frame will see values of its local variables, even if there are global variables with same names. On success the test will print a = 2(value of the local variable a). Bug 47358.\n`); - await TestRunner.loadLegacyModule('console'); await TestRunner.showPanel('sources'); await TestRunner.evaluateInPagePromise(` var a = 1;
diff --git a/third_party/blink/web_tests/http/tests/devtools/sources/debugger-pause/debugger-eval-while-paused-throws-expected.txt b/third_party/blink/web_tests/http/tests/devtools/sources/debugger-pause/debugger-eval-while-paused-throws-expected.txt index 288c5de..869be8f 100644 --- a/third_party/blink/web_tests/http/tests/devtools/sources/debugger-pause/debugger-eval-while-paused-throws-expected.txt +++ b/third_party/blink/web_tests/http/tests/devtools/sources/debugger-pause/debugger-eval-while-paused-throws-expected.txt
@@ -4,37 +4,37 @@ Dumping console messages: injectedFunction() -debugger-eval-while-paused-throws.js:54 Uncaught Error: injectedObj.func - at Object.func (debugger-eval-while-…sed-throws.js:54:15) - at injectedFunction (debugger-eval-while-…sed-throws.js:57:24) - at eval (eval at testFunction (inspected-page.html:30:11), <anonymous>:1:1) - at testFunction (test.js:30:11) -func @ debugger-eval-while-paused-throws.js:54 -injectedFunction @ debugger-eval-while-paused-throws.js:57 +debugger-eval-while-paused-throws.js:53 Uncaught Error: injectedObj.func + at Object.func (debugger-eval-while-…sed-throws.js:53:15) + at injectedFunction (debugger-eval-while-…sed-throws.js:56:24) + at eval (eval at testFunction (inspected-page.html:29:11), <anonymous>:1:1) + at testFunction (test.js:29:11) +func @ debugger-eval-while-paused-throws.js:53 +injectedFunction @ debugger-eval-while-paused-throws.js:56 eval @ VM:1 -testFunction @ test.js:30 +testFunction @ test.js:29 setTimeout (async) scheduleTestFunction @ VM:3 (anonymous) @ VM:1 localObj.func() -test.js:27 Uncaught Error: localObj.func - at Object.func (test.js:27:25) - at eval (eval at testFunction (inspected-page.html:30:11), <anonymous>:1:10) - at testFunction (test.js:30:11) -func @ test.js:27 +test.js:26 Uncaught Error: localObj.func + at Object.func (test.js:26:25) + at eval (eval at testFunction (inspected-page.html:29:11), <anonymous>:1:10) + at testFunction (test.js:29:11) +func @ test.js:26 eval @ VM:1 -testFunction @ test.js:30 +testFunction @ test.js:29 setTimeout (async) scheduleTestFunction @ VM:3 (anonymous) @ VM:1 globalObj.func() -test.js:18 Uncaught Error: globalObj.func - at Object.func (test.js:18:21) - at eval (eval at testFunction (inspected-page.html:30:11), <anonymous>:1:11) - at testFunction (test.js:30:11) -func @ test.js:18 +test.js:17 Uncaught Error: globalObj.func + at Object.func (test.js:17:21) + at eval (eval at testFunction (inspected-page.html:29:11), <anonymous>:1:11) + at testFunction (test.js:29:11) +func @ test.js:17 eval @ VM:1 -testFunction @ test.js:30 +testFunction @ test.js:29 setTimeout (async) scheduleTestFunction @ VM:3 (anonymous) @ VM:1
diff --git a/third_party/blink/web_tests/http/tests/devtools/sources/debugger-pause/debugger-eval-while-paused-throws.js b/third_party/blink/web_tests/http/tests/devtools/sources/debugger-pause/debugger-eval-while-paused-throws.js index 334ce83..33a4dc1 100644 --- a/third_party/blink/web_tests/http/tests/devtools/sources/debugger-pause/debugger-eval-while-paused-throws.js +++ b/third_party/blink/web_tests/http/tests/devtools/sources/debugger-pause/debugger-eval-while-paused-throws.js
@@ -9,7 +9,6 @@ (async function() { TestRunner.addResult( `Tests that evaluation in console that throws works fine when script is paused.\n`); - await TestRunner.loadLegacyModule('console'); await TestRunner.showPanel('sources'); await TestRunner.evaluateInPagePromise(` var globalObj = {
diff --git a/third_party/blink/web_tests/http/tests/devtools/sources/debugger-pause/debugger-eval-while-paused.js b/third_party/blink/web_tests/http/tests/devtools/sources/debugger-pause/debugger-eval-while-paused.js index f8ea2de2..5e72b80 100644 --- a/third_party/blink/web_tests/http/tests/devtools/sources/debugger-pause/debugger-eval-while-paused.js +++ b/third_party/blink/web_tests/http/tests/devtools/sources/debugger-pause/debugger-eval-while-paused.js
@@ -11,7 +11,6 @@ (async function() { TestRunner.addResult( `Tests that evaluation in console works fine when script is paused. It also checks that stack and global variables are accessible from the console.\n`); - await TestRunner.loadLegacyModule('console'); await TestRunner.showPanel('sources'); await TestRunner.evaluateInPagePromise(` var globalVar = { b: 1 };
diff --git a/third_party/blink/web_tests/http/tests/devtools/sources/debugger-pause/debugger-no-nested-pause.js b/third_party/blink/web_tests/http/tests/devtools/sources/debugger-pause/debugger-no-nested-pause.js index 315d0743..9388d9b 100644 --- a/third_party/blink/web_tests/http/tests/devtools/sources/debugger-pause/debugger-no-nested-pause.js +++ b/third_party/blink/web_tests/http/tests/devtools/sources/debugger-pause/debugger-no-nested-pause.js
@@ -9,7 +9,6 @@ (async function() { TestRunner.addResult( `Tests that debugger will skip breakpoint hit when script execution is already paused. See bug\n`); - await TestRunner.loadLegacyModule('console'); await TestRunner.showPanel('sources'); await TestRunner.evaluateInPagePromise(` function testFunction()
diff --git a/third_party/blink/web_tests/http/tests/devtools/sources/debugger-pause/debugger-pause-in-eval-script.js b/third_party/blink/web_tests/http/tests/devtools/sources/debugger-pause/debugger-pause-in-eval-script.js index acf889e..0c8a94f 100644 --- a/third_party/blink/web_tests/http/tests/devtools/sources/debugger-pause/debugger-pause-in-eval-script.js +++ b/third_party/blink/web_tests/http/tests/devtools/sources/debugger-pause/debugger-pause-in-eval-script.js
@@ -9,7 +9,6 @@ (async function() { TestRunner.addResult( `Tests that debugger will stop on "debugger" statement in a function that was added to the inspected page via evaluation in Web Inspector console.`); - await TestRunner.loadLegacyModule('console'); await TestRunner.showPanel('sources'); var scriptToEvaluate = 'function testFunction() {\n' + ' debugger;\n' +
diff --git a/third_party/blink/web_tests/http/tests/devtools/sources/debugger-pause/debugger-resume-button-in-overlay.js b/third_party/blink/web_tests/http/tests/devtools/sources/debugger-pause/debugger-resume-button-in-overlay.js index 2db66ad..84731bc 100644 --- a/third_party/blink/web_tests/http/tests/devtools/sources/debugger-pause/debugger-resume-button-in-overlay.js +++ b/third_party/blink/web_tests/http/tests/devtools/sources/debugger-pause/debugger-resume-button-in-overlay.js
@@ -8,7 +8,6 @@ (async function() { TestRunner.addResult(`Tests that resume button in overlay works\n`); - await TestRunner.loadLegacyModule('console'); await TestRunner.showPanel('sources'); await TestRunner.evaluateInPagePromise(` function testFunction()
diff --git a/third_party/blink/web_tests/http/tests/devtools/sources/debugger-pause/eval-on-pause-blocked.js b/third_party/blink/web_tests/http/tests/devtools/sources/debugger-pause/eval-on-pause-blocked.js index 85db46e..8f05115d 100644 --- a/third_party/blink/web_tests/http/tests/devtools/sources/debugger-pause/eval-on-pause-blocked.js +++ b/third_party/blink/web_tests/http/tests/devtools/sources/debugger-pause/eval-on-pause-blocked.js
@@ -9,7 +9,6 @@ (async function() { TestRunner.addResult( `Test that evaluation in the context of top frame will not be blocked by Content-Security-Policy. Bug 77203.\n`); - await TestRunner.loadLegacyModule('console'); await TestRunner.showPanel('sources'); await TestRunner.evaluateInPagePromise(` function testFunction()
diff --git a/third_party/blink/web_tests/http/tests/devtools/sources/debugger-pause/set-return-value.js b/third_party/blink/web_tests/http/tests/devtools/sources/debugger-pause/set-return-value.js index 7a35ef58..d2d96092 100644 --- a/third_party/blink/web_tests/http/tests/devtools/sources/debugger-pause/set-return-value.js +++ b/third_party/blink/web_tests/http/tests/devtools/sources/debugger-pause/set-return-value.js
@@ -10,7 +10,6 @@ (async function() { TestRunner.addResult('Check that return value can be changed.'); - await TestRunner.loadLegacyModule('console'); await TestRunner.showPanel('sources'); await TestRunner.evaluateInPagePromise(` function testFunction() { @@ -19,7 +18,7 @@ //# sourceURL=test.js `); await SourcesTestRunner.startDebuggerTestPromise(); - await TestRunner.DebuggerAgent.invoke_setBreakpointByUrl({lineNumber: 16, url: 'test.js', columnNumber: 37}); + await TestRunner.DebuggerAgent.invoke_setBreakpointByUrl({lineNumber: 15, url: 'test.js', columnNumber: 37}); let sidebarUpdated = TestRunner.addSnifferPromise( SourcesModule.ScopeChainSidebarPane.ScopeChainSidebarPane.prototype, 'sidebarPaneUpdatedForTest'); await Promise.all([SourcesTestRunner.runTestFunctionAndWaitUntilPausedPromise(), sidebarUpdated]);
diff --git a/third_party/blink/web_tests/http/tests/devtools/sources/debugger-pause/skip-pauses-until-reload.js b/third_party/blink/web_tests/http/tests/devtools/sources/debugger-pause/skip-pauses-until-reload.js index ba8c0a80..1927cf1 100644 --- a/third_party/blink/web_tests/http/tests/devtools/sources/debugger-pause/skip-pauses-until-reload.js +++ b/third_party/blink/web_tests/http/tests/devtools/sources/debugger-pause/skip-pauses-until-reload.js
@@ -11,7 +11,6 @@ TestRunner.addResult( `Tests that 'skip all pauses' mode blocks breakpoint and gets cancelled right at page reload.`); await TestRunner.loadLegacyModule('panels/browser_debugger'); - await TestRunner.loadLegacyModule('console'); await TestRunner.showPanel('sources'); await TestRunner.navigatePromise('resources/skip-pauses-until-reload.html')
diff --git a/third_party/blink/web_tests/http/tests/devtools/sources/debugger-ui/break-on-set-timeout-with-syntax-error-expected.txt b/third_party/blink/web_tests/http/tests/devtools/sources/debugger-ui/break-on-set-timeout-with-syntax-error-expected.txt index d3788fbc..28213f9 100644 --- a/third_party/blink/web_tests/http/tests/devtools/sources/debugger-ui/break-on-set-timeout-with-syntax-error-expected.txt +++ b/third_party/blink/web_tests/http/tests/devtools/sources/debugger-ui/break-on-set-timeout-with-syntax-error-expected.txt
@@ -1,7 +1,7 @@ Tests that scheduled pause is cleared after processing event with empty handler. Call stack: - 0) executeSomeCode (break-on-set-timeout-with-syntax-error.js:22) - 1) (break-on-set-timeout-with-syntax-error.js:37) + 0) executeSomeCode (break-on-set-timeout-with-syntax-error.js:21) + 1) (break-on-set-timeout-with-syntax-error.js:36)
diff --git a/third_party/blink/web_tests/http/tests/devtools/sources/debugger-ui/break-on-set-timeout-with-syntax-error.js b/third_party/blink/web_tests/http/tests/devtools/sources/debugger-ui/break-on-set-timeout-with-syntax-error.js index 0949386..173febd6 100644 --- a/third_party/blink/web_tests/http/tests/devtools/sources/debugger-ui/break-on-set-timeout-with-syntax-error.js +++ b/third_party/blink/web_tests/http/tests/devtools/sources/debugger-ui/break-on-set-timeout-with-syntax-error.js
@@ -9,7 +9,6 @@ (async function() { TestRunner.addResult(`Tests that scheduled pause is cleared after processing event with empty handler.\n`); await TestRunner.loadLegacyModule('panels/browser_debugger'); - await TestRunner.loadLegacyModule('console'); await TestRunner.showPanel('sources'); await TestRunner.evaluateInPagePromise(` function runSetTimeoutWithSyntaxError()
diff --git a/third_party/blink/web_tests/http/tests/devtools/sources/debugger-ui/custom-element-lifecycle-events.js b/third_party/blink/web_tests/http/tests/devtools/sources/debugger-ui/custom-element-lifecycle-events.js index 13a9944..090bfab 100644 --- a/third_party/blink/web_tests/http/tests/devtools/sources/debugger-ui/custom-element-lifecycle-events.js +++ b/third_party/blink/web_tests/http/tests/devtools/sources/debugger-ui/custom-element-lifecycle-events.js
@@ -9,7 +9,6 @@ (async function() { TestRunner.addResult(`Tests that custom element lifecycle events fire while debugger is paused.\n`); - await TestRunner.loadLegacyModule('console'); await TestRunner.showPanel('sources'); await TestRunner.evaluateInPagePromise(`
diff --git a/third_party/blink/web_tests/http/tests/devtools/sources/debugger-ui/debugger-save-to-temp-var.js b/third_party/blink/web_tests/http/tests/devtools/sources/debugger-ui/debugger-save-to-temp-var.js index 22f886e..6f232a0 100644 --- a/third_party/blink/web_tests/http/tests/devtools/sources/debugger-ui/debugger-save-to-temp-var.js +++ b/third_party/blink/web_tests/http/tests/devtools/sources/debugger-ui/debugger-save-to-temp-var.js
@@ -11,7 +11,6 @@ (async function() { TestRunner.addResult(`Tests saving objects to temporary variables while paused.\n`); - await TestRunner.loadLegacyModule('console'); await TestRunner.showPanel('sources'); await TestRunner.evaluateInPagePromise(` var thisObj;
diff --git a/third_party/blink/web_tests/http/tests/devtools/sources/debugger-ui/monitor-console-command.js b/third_party/blink/web_tests/http/tests/devtools/sources/debugger-ui/monitor-console-command.js index fd2f3ef..68dd293 100644 --- a/third_party/blink/web_tests/http/tests/devtools/sources/debugger-ui/monitor-console-command.js +++ b/third_party/blink/web_tests/http/tests/devtools/sources/debugger-ui/monitor-console-command.js
@@ -10,7 +10,6 @@ (async function() { TestRunner.addResult(`Tests traceCalls(fn) console command.\n`); - await TestRunner.loadLegacyModule('console'); await TestRunner.showPanel('sources'); await TestRunner.evaluateInPagePromise(` function simpleTestFunction()
diff --git a/third_party/blink/web_tests/http/tests/devtools/sources/debugger-ui/script-snippet-model.js b/third_party/blink/web_tests/http/tests/devtools/sources/debugger-ui/script-snippet-model.js index 87f37d6..1b06578 100644 --- a/third_party/blink/web_tests/http/tests/devtools/sources/debugger-ui/script-snippet-model.js +++ b/third_party/blink/web_tests/http/tests/devtools/sources/debugger-ui/script-snippet-model.js
@@ -7,10 +7,10 @@ import {SourcesTestRunner} from 'sources_test_runner'; import * as UIModule from 'devtools/ui/legacy/legacy.js'; +import * as Console from 'devtools/panels/console/console.js'; (async function() { TestRunner.addResult(`Tests script snippet model.\n`); - await TestRunner.loadLegacyModule('console'); await TestRunner.loadLegacyModule('snippets'); await TestRunner.showPanel('sources'); @@ -122,7 +122,7 @@ await ConsoleTestRunner.dumpConsoleMessages(); const functionPromise = TestRunner.addSnifferPromise( - Console.ConsoleViewMessage.prototype, + Console.ConsoleViewMessage.ConsoleViewMessage.prototype, 'formattedParameterAsFunctionForTest'); TestRunner.addResult('Run Snippet2..'); Snippets.evaluateScriptSnippet(uiSourceCode2);
diff --git a/third_party/blink/web_tests/http/tests/devtools/sources/debugger-ui/show-function-definition.js b/third_party/blink/web_tests/http/tests/devtools/sources/debugger-ui/show-function-definition.js index 7417a78..ffe2d8c 100644 --- a/third_party/blink/web_tests/http/tests/devtools/sources/debugger-ui/show-function-definition.js +++ b/third_party/blink/web_tests/http/tests/devtools/sources/debugger-ui/show-function-definition.js
@@ -7,10 +7,10 @@ import * as UI from 'devtools/ui/legacy/legacy.js'; import * as Sources from 'devtools/panels/sources/sources.js'; +import * as Console from 'devtools/panels/console/console.js'; (async function() { TestRunner.addResult(`Tests that "Show Function Definition" jumps to the correct location.\n`); - await TestRunner.loadLegacyModule('console'); await TestRunner.showPanel('sources'); await TestRunner.evaluateInPagePromise(` function jumpToMe() @@ -44,14 +44,14 @@ function testDumpFunctionDefinition(next) { TestRunner.addSniffer(ObjectUI.ObjectPropertiesSection, 'formatObjectAsFunction', onConsoleMessagesReceived); - var consoleView = Console.ConsoleView.instance(); + var consoleView = Console.ConsoleView.ConsoleView.instance(); consoleView.prompt.appendCommand('jumpToMe', true); function onConsoleMessagesReceived() { TestRunner.deprecatedRunAfterPendingDispatches(function() { var messages = []; ConsoleTestRunner.disableConsoleViewport(); - var viewMessages = Console.ConsoleView.instance().visibleViewMessages; + var viewMessages = Console.ConsoleView.ConsoleView.instance().visibleViewMessages; for (var i = 0; i < viewMessages.length; ++i) { var uiMessage = viewMessages[i]; var element = uiMessage.contentElement();
diff --git a/third_party/blink/web_tests/http/tests/devtools/sources/debugger-ui/show-generator-location-expected.txt b/third_party/blink/web_tests/http/tests/devtools/sources/debugger-ui/show-generator-location-expected.txt index 5856247..43554ba 100644 --- a/third_party/blink/web_tests/http/tests/devtools/sources/debugger-ui/show-generator-location-expected.txt +++ b/third_party/blink/web_tests/http/tests/devtools/sources/debugger-ui/show-generator-location-expected.txt
@@ -2,17 +2,17 @@ Running: testiterNotStarted -Generator location revealed: [23:20] +Generator location revealed: [22:20] Running: testiterSuspended1 -Generator location revealed: [25:11] +Generator location revealed: [24:11] Running: testiterSuspended2 -Generator location revealed: [26:11] +Generator location revealed: [25:11] Running: testiterSuspended3 -Generator location revealed: [27:11] +Generator location revealed: [26:11] Running: testiterClosed -Generator location revealed: [23:20] +Generator location revealed: [22:20]
diff --git a/third_party/blink/web_tests/http/tests/devtools/sources/debugger-ui/show-generator-location.js b/third_party/blink/web_tests/http/tests/devtools/sources/debugger-ui/show-generator-location.js index 03867f5..b33ddcd 100644 --- a/third_party/blink/web_tests/http/tests/devtools/sources/debugger-ui/show-generator-location.js +++ b/third_party/blink/web_tests/http/tests/devtools/sources/debugger-ui/show-generator-location.js
@@ -10,7 +10,6 @@ (async function() { TestRunner.addResult(`Tests that "Show Generator Location" jumps to the correct location.\n`); - await TestRunner.loadLegacyModule('console'); await TestRunner.showPanel('sources'); await TestRunner.evaluateInPagePromise(` function forward(iter, step)
diff --git a/third_party/blink/web_tests/http/tests/devtools/sources/debugger-ui/sourcemap-src-not-loaded.js b/third_party/blink/web_tests/http/tests/devtools/sources/debugger-ui/sourcemap-src-not-loaded.js index d2557ff..19b1c24 100644 --- a/third_party/blink/web_tests/http/tests/devtools/sources/debugger-ui/sourcemap-src-not-loaded.js +++ b/third_party/blink/web_tests/http/tests/devtools/sources/debugger-ui/sourcemap-src-not-loaded.js
@@ -9,7 +9,6 @@ (async function() { TestRunner.addResult( `Tests that an error loading a source-map-referred file will display an error message in the source panel.\n`); - await TestRunner.loadLegacyModule('console'); await TestRunner.showPanel('sources'); await TestRunner.addScriptTag('./resources/sourcemap-src-not-loaded.js');
diff --git a/third_party/blink/web_tests/http/tests/devtools/sources/debugger/async-callstack-network-initiator-expected.txt b/third_party/blink/web_tests/http/tests/devtools/sources/debugger/async-callstack-network-initiator-expected.txt index 66be298..39fdab8 100644 --- a/third_party/blink/web_tests/http/tests/devtools/sources/debugger/async-callstack-network-initiator-expected.txt +++ b/third_party/blink/web_tests/http/tests/devtools/sources/debugger/async-callstack-network-initiator-expected.txt
@@ -1,18 +1,18 @@ Tests asynchronous call stacks printed in console for a Network.Initiator. Set timer for test function. -async-callstack-network-initiator.js:17 Console was cleared -async-callstack-network-initiator.js:35 POST http://127.0.0.1:8000/failure/foo 404 (Not Found) +async-callstack-network-initiator.js:16 Console was cleared +async-callstack-network-initiator.js:34 POST http://127.0.0.1:8000/failure/foo 404 (Not Found) -sendXHR @ async-callstack-network-initiator.js:35 +sendXHR @ async-callstack-network-initiator.js:34 -timeout2 @ async-callstack-network-initiator.js:28 +timeout2 @ async-callstack-network-initiator.js:27 setTimeout (async) -timeout1 @ async-callstack-network-initiator.js:23 +timeout1 @ async-callstack-network-initiator.js:22 setTimeout (async) -testFunction @ async-callstack-network-initiator.js:18 +testFunction @ async-callstack-network-initiator.js:17
diff --git a/third_party/blink/web_tests/http/tests/devtools/sources/debugger/async-callstack-network-initiator-image-expected.txt b/third_party/blink/web_tests/http/tests/devtools/sources/debugger/async-callstack-network-initiator-image-expected.txt index 8867e88b..fbe1531 100644 --- a/third_party/blink/web_tests/http/tests/devtools/sources/debugger/async-callstack-network-initiator-image-expected.txt +++ b/third_party/blink/web_tests/http/tests/devtools/sources/debugger/async-callstack-network-initiator-image-expected.txt
@@ -1,4 +1,4 @@ Tests asynchronous network initiator for image loaded from JS. -async-callstack-network-initiator-image.js:19 +async-callstack-network-initiator-image.js:18
diff --git a/third_party/blink/web_tests/http/tests/devtools/sources/debugger/async-callstack-network-initiator-image.js b/third_party/blink/web_tests/http/tests/devtools/sources/debugger/async-callstack-network-initiator-image.js index 6904b72..044ec9e 100644 --- a/third_party/blink/web_tests/http/tests/devtools/sources/debugger/async-callstack-network-initiator-image.js +++ b/third_party/blink/web_tests/http/tests/devtools/sources/debugger/async-callstack-network-initiator-image.js
@@ -9,7 +9,6 @@ (async function() { TestRunner.addResult(`Tests asynchronous network initiator for image loaded from JS.\n`); - await TestRunner.loadLegacyModule('console'); await TestRunner.loadLegacyModule('components'); await TestRunner.showPanel('sources'); await TestRunner.evaluateInPagePromise(`
diff --git a/third_party/blink/web_tests/http/tests/devtools/sources/debugger/async-callstack-network-initiator.js b/third_party/blink/web_tests/http/tests/devtools/sources/debugger/async-callstack-network-initiator.js index 5f03909..d094db9 100644 --- a/third_party/blink/web_tests/http/tests/devtools/sources/debugger/async-callstack-network-initiator.js +++ b/third_party/blink/web_tests/http/tests/devtools/sources/debugger/async-callstack-network-initiator.js
@@ -8,7 +8,6 @@ (async function() { TestRunner.addResult(`Tests asynchronous call stacks printed in console for a Network.Initiator.\n`); - await TestRunner.loadLegacyModule('console'); await TestRunner.showPanel('sources'); await TestRunner.evaluateInPagePromise(` function testFunction()
diff --git a/third_party/blink/web_tests/http/tests/devtools/sources/debugger/debugger-autocontinue-on-syntax-error.js b/third_party/blink/web_tests/http/tests/devtools/sources/debugger/debugger-autocontinue-on-syntax-error.js index a1bace2..a501645 100644 --- a/third_party/blink/web_tests/http/tests/devtools/sources/debugger/debugger-autocontinue-on-syntax-error.js +++ b/third_party/blink/web_tests/http/tests/devtools/sources/debugger/debugger-autocontinue-on-syntax-error.js
@@ -9,7 +9,6 @@ (async function() { TestRunner.addResult( `Tests that debugger won't stop on syntax errors even if "pause on uncaught exceptions" is on.\n`); - await TestRunner.loadLegacyModule('console'); await TestRunner.showPanel('sources'); SourcesTestRunner.startDebuggerTest(step1);
diff --git a/third_party/blink/web_tests/http/tests/devtools/sources/debugger/dont-report-injected-script.js b/third_party/blink/web_tests/http/tests/devtools/sources/debugger/dont-report-injected-script.js index 2305b16..509ea3a 100644 --- a/third_party/blink/web_tests/http/tests/devtools/sources/debugger/dont-report-injected-script.js +++ b/third_party/blink/web_tests/http/tests/devtools/sources/debugger/dont-report-injected-script.js
@@ -7,7 +7,6 @@ (async function() { TestRunner.addResult(`Tests that injected script isn't reported to frontend.\n`); - await TestRunner.loadLegacyModule('console'); await TestRunner.showPanel('sources'); await TestRunner.evaluateInPagePromise(` function newWorld()
diff --git a/third_party/blink/web_tests/http/tests/devtools/sources/debugger/dynamic-script-tag.js b/third_party/blink/web_tests/http/tests/devtools/sources/debugger/dynamic-script-tag.js index d1d8807..8b231e7f 100644 --- a/third_party/blink/web_tests/http/tests/devtools/sources/debugger/dynamic-script-tag.js +++ b/third_party/blink/web_tests/http/tests/devtools/sources/debugger/dynamic-script-tag.js
@@ -11,7 +11,6 @@ (async function() { TestRunner.addResult( `Tests that inline scripts and document.write scripts get different uiSourceCodes with different URLs.`); - await TestRunner.loadLegacyModule('console'); await TestRunner.showPanel('sources'); await TestRunner.navigatePromise('resources/dynamic-script-tag.html');
diff --git a/third_party/blink/web_tests/http/tests/devtools/sources/debugger/dynamic-scripts.js b/third_party/blink/web_tests/http/tests/devtools/sources/debugger/dynamic-scripts.js index 048f819..b9543214 100644 --- a/third_party/blink/web_tests/http/tests/devtools/sources/debugger/dynamic-scripts.js +++ b/third_party/blink/web_tests/http/tests/devtools/sources/debugger/dynamic-scripts.js
@@ -11,7 +11,6 @@ (async function() { TestRunner.addResult( `Tests that scripts for dynamically added script elements are shown in sources panel if loaded with inspector open.\n`); - await TestRunner.loadLegacyModule('console'); await TestRunner.showPanel('sources'); await TestRunner.evaluateInPagePromise(` function appendDynamicScriptElement(src, content)
diff --git a/third_party/blink/web_tests/http/tests/devtools/sources/debugger/mutation-observer-suspend-while-paused.js b/third_party/blink/web_tests/http/tests/devtools/sources/debugger/mutation-observer-suspend-while-paused.js index f4c2cd7..f40c8df 100644 --- a/third_party/blink/web_tests/http/tests/devtools/sources/debugger/mutation-observer-suspend-while-paused.js +++ b/third_party/blink/web_tests/http/tests/devtools/sources/debugger/mutation-observer-suspend-while-paused.js
@@ -9,7 +9,6 @@ (async function() { TestRunner.addResult( `Tests that DOM Mutation Observers do not attempt to deliver mutation records while the debugger is paused.Bug 105810\n`); - await TestRunner.loadLegacyModule('console'); await TestRunner.showPanel('sources'); var setup = 'window.testDiv = document.createElement(\'div\');\n' +
diff --git a/third_party/blink/web_tests/http/tests/devtools/sources/debugger/properties-special-expected.txt b/third_party/blink/web_tests/http/tests/devtools/sources/debugger/properties-special-expected.txt index 03816c2..df3bf47 100644 --- a/third_party/blink/web_tests/http/tests/devtools/sources/debugger/properties-special-expected.txt +++ b/third_party/blink/web_tests/http/tests/devtools/sources/debugger/properties-special-expected.txt
@@ -1,17 +1,17 @@ Tests how debugger presents special properties of closures, bound functions and object wrappers. -properties-special.js:14 Boolean +properties-special.js:13 Boolean [[Prototype]]: Boolean [[PrimitiveValue]]: true -properties-special.js:15 ƒ anonymous(a,b) +properties-special.js:14 ƒ anonymous(a,b) arguments: null caller: null length: 2 name: "" prototype: {constructor: ƒ} - [[FunctionLocation]]: properties-special.js:15 + [[FunctionLocation]]: properties-special.js:14 [[Prototype]]: ƒ () [[Scopes]]: Scopes[1] -properties-special.js:16 ƒ bound () +properties-special.js:15 ƒ bound () length: 1 name: "bound " arguments: (...) @@ -20,13 +20,13 @@ [[TargetFunction]]: ƒ (a,b) [[BoundThis]]: Object [[BoundArgs]]: Array(1) -properties-special.js:17 ƒ* anonymous() +properties-special.js:16 ƒ* anonymous() length: 0 name: "" prototype: Generator {} arguments: (...) caller: (...) - [[FunctionLocation]]: properties-special.js:17 + [[FunctionLocation]]: properties-special.js:16 [[IsGenerator]]: true [[Prototype]]: GeneratorFunction [[Scopes]]: Scopes[1]
diff --git a/third_party/blink/web_tests/http/tests/devtools/sources/debugger/properties-special.js b/third_party/blink/web_tests/http/tests/devtools/sources/debugger/properties-special.js index dbcb584f..2458a51 100644 --- a/third_party/blink/web_tests/http/tests/devtools/sources/debugger/properties-special.js +++ b/third_party/blink/web_tests/http/tests/devtools/sources/debugger/properties-special.js
@@ -8,7 +8,6 @@ (async function() { TestRunner.addResult( `Tests how debugger presents special properties of closures, bound functions and object wrappers.`); - await TestRunner.loadLegacyModule('console'); await TestRunner.showPanel('sources'); await TestRunner.evaluateInPagePromise(` console.dir(Object(true));
diff --git a/third_party/blink/web_tests/http/tests/devtools/sources/debugger/rethrow-error-from-bindings-crash-expected.txt b/third_party/blink/web_tests/http/tests/devtools/sources/debugger/rethrow-error-from-bindings-crash-expected.txt index c490730..ed1302c1 100644 --- a/third_party/blink/web_tests/http/tests/devtools/sources/debugger/rethrow-error-from-bindings-crash-expected.txt +++ b/third_party/blink/web_tests/http/tests/devtools/sources/debugger/rethrow-error-from-bindings-crash-expected.txt
@@ -1,117 +1,117 @@ Tests that pausing on uncaught exceptions thrown from C++ bindings will not crash. Set timer for test function. -rethrow-error-from-bindings-crash.js:18 Console was cleared -rethrow-error-from-bindings-crash.js:32 Uncaught TypeError: Failed to execute 'compareBoundaryPoints' on 'Range': parameter 2 is not of type 'Range'. - at f2 (rethrow-error-from-b…ings-crash.js:32:23) - at testFunction (rethrow-error-from-b…ings-crash.js:22:28) -f2 @ rethrow-error-from-bindings-crash.js:32 -testFunction @ rethrow-error-from-bindings-crash.js:22 +rethrow-error-from-bindings-crash.js:17 Console was cleared +rethrow-error-from-bindings-crash.js:31 Uncaught TypeError: Failed to execute 'compareBoundaryPoints' on 'Range': parameter 2 is not of type 'Range'. + at f2 (rethrow-error-from-b…ings-crash.js:31:23) + at testFunction (rethrow-error-from-b…ings-crash.js:21:28) +f2 @ rethrow-error-from-bindings-crash.js:31 +testFunction @ rethrow-error-from-bindings-crash.js:21 setTimeout (async) scheduleTestFunction @ VM:3 (anonymous) @ VM:1 -rethrow-error-from-bindings-crash.js:27 Uncaught TypeError: Failed to execute 'appendChild' on 'Node': parameter 1 is not of type 'Node'. - at f1 (rethrow-error-from-b…ings-crash.js:27:25) -f1 @ rethrow-error-from-bindings-crash.js:27 +rethrow-error-from-bindings-crash.js:26 Uncaught TypeError: Failed to execute 'appendChild' on 'Node': parameter 1 is not of type 'Node'. + at f1 (rethrow-error-from-b…ings-crash.js:26:25) +f1 @ rethrow-error-from-bindings-crash.js:26 setTimeout (async) -f2 @ rethrow-error-from-bindings-crash.js:31 -testFunction @ rethrow-error-from-bindings-crash.js:22 +f2 @ rethrow-error-from-bindings-crash.js:30 +testFunction @ rethrow-error-from-bindings-crash.js:21 setTimeout (async) scheduleTestFunction @ VM:3 (anonymous) @ VM:1 -rethrow-error-from-bindings-crash.js:32 Uncaught TypeError: Failed to execute 'compareBoundaryPoints' on 'Range': parameter 2 is not of type 'Range'. - at f2 (rethrow-error-from-b…ings-crash.js:32:23) -f2 @ rethrow-error-from-bindings-crash.js:32 -setTimeout (async) -f1 @ rethrow-error-from-bindings-crash.js:26 -setTimeout (async) +rethrow-error-from-bindings-crash.js:31 Uncaught TypeError: Failed to execute 'compareBoundaryPoints' on 'Range': parameter 2 is not of type 'Range'. + at f2 (rethrow-error-from-b…ings-crash.js:31:23) f2 @ rethrow-error-from-bindings-crash.js:31 -testFunction @ rethrow-error-from-bindings-crash.js:22 +setTimeout (async) +f1 @ rethrow-error-from-bindings-crash.js:25 +setTimeout (async) +f2 @ rethrow-error-from-bindings-crash.js:30 +testFunction @ rethrow-error-from-bindings-crash.js:21 setTimeout (async) scheduleTestFunction @ VM:3 (anonymous) @ VM:1 -rethrow-error-from-bindings-crash.js:27 Uncaught TypeError: Failed to execute 'appendChild' on 'Node': parameter 1 is not of type 'Node'. - at f1 (rethrow-error-from-b…ings-crash.js:27:25) -f1 @ rethrow-error-from-bindings-crash.js:27 -setTimeout (async) -f2 @ rethrow-error-from-bindings-crash.js:31 -setTimeout (async) +rethrow-error-from-bindings-crash.js:26 Uncaught TypeError: Failed to execute 'appendChild' on 'Node': parameter 1 is not of type 'Node'. + at f1 (rethrow-error-from-b…ings-crash.js:26:25) f1 @ rethrow-error-from-bindings-crash.js:26 setTimeout (async) -f2 @ rethrow-error-from-bindings-crash.js:31 -testFunction @ rethrow-error-from-bindings-crash.js:22 +f2 @ rethrow-error-from-bindings-crash.js:30 +setTimeout (async) +f1 @ rethrow-error-from-bindings-crash.js:25 +setTimeout (async) +f2 @ rethrow-error-from-bindings-crash.js:30 +testFunction @ rethrow-error-from-bindings-crash.js:21 setTimeout (async) scheduleTestFunction @ VM:3 (anonymous) @ VM:1 -rethrow-error-from-bindings-crash.js:32 Uncaught TypeError: Failed to execute 'compareBoundaryPoints' on 'Range': parameter 2 is not of type 'Range'. - at f2 (rethrow-error-from-b…ings-crash.js:32:23) -f2 @ rethrow-error-from-bindings-crash.js:32 -setTimeout (async) -f1 @ rethrow-error-from-bindings-crash.js:26 -setTimeout (async) +rethrow-error-from-bindings-crash.js:31 Uncaught TypeError: Failed to execute 'compareBoundaryPoints' on 'Range': parameter 2 is not of type 'Range'. + at f2 (rethrow-error-from-b…ings-crash.js:31:23) f2 @ rethrow-error-from-bindings-crash.js:31 setTimeout (async) -f1 @ rethrow-error-from-bindings-crash.js:26 +f1 @ rethrow-error-from-bindings-crash.js:25 setTimeout (async) -f2 @ rethrow-error-from-bindings-crash.js:31 -testFunction @ rethrow-error-from-bindings-crash.js:22 +f2 @ rethrow-error-from-bindings-crash.js:30 +setTimeout (async) +f1 @ rethrow-error-from-bindings-crash.js:25 +setTimeout (async) +f2 @ rethrow-error-from-bindings-crash.js:30 +testFunction @ rethrow-error-from-bindings-crash.js:21 setTimeout (async) scheduleTestFunction @ VM:3 (anonymous) @ VM:1 -rethrow-error-from-bindings-crash.js:27 Uncaught TypeError: Failed to execute 'appendChild' on 'Node': parameter 1 is not of type 'Node'. - at f1 (rethrow-error-from-b…ings-crash.js:27:25) -f1 @ rethrow-error-from-bindings-crash.js:27 -setTimeout (async) -f2 @ rethrow-error-from-bindings-crash.js:31 -setTimeout (async) +rethrow-error-from-bindings-crash.js:26 Uncaught TypeError: Failed to execute 'appendChild' on 'Node': parameter 1 is not of type 'Node'. + at f1 (rethrow-error-from-b…ings-crash.js:26:25) f1 @ rethrow-error-from-bindings-crash.js:26 setTimeout (async) -f2 @ rethrow-error-from-bindings-crash.js:31 +f2 @ rethrow-error-from-bindings-crash.js:30 setTimeout (async) -f1 @ rethrow-error-from-bindings-crash.js:26 +f1 @ rethrow-error-from-bindings-crash.js:25 setTimeout (async) -f2 @ rethrow-error-from-bindings-crash.js:31 -testFunction @ rethrow-error-from-bindings-crash.js:22 +f2 @ rethrow-error-from-bindings-crash.js:30 +setTimeout (async) +f1 @ rethrow-error-from-bindings-crash.js:25 +setTimeout (async) +f2 @ rethrow-error-from-bindings-crash.js:30 +testFunction @ rethrow-error-from-bindings-crash.js:21 setTimeout (async) scheduleTestFunction @ VM:3 (anonymous) @ VM:1 -rethrow-error-from-bindings-crash.js:32 Uncaught TypeError: Failed to execute 'compareBoundaryPoints' on 'Range': parameter 2 is not of type 'Range'. - at f2 (rethrow-error-from-b…ings-crash.js:32:23) -f2 @ rethrow-error-from-bindings-crash.js:32 -setTimeout (async) -f1 @ rethrow-error-from-bindings-crash.js:26 -setTimeout (async) +rethrow-error-from-bindings-crash.js:31 Uncaught TypeError: Failed to execute 'compareBoundaryPoints' on 'Range': parameter 2 is not of type 'Range'. + at f2 (rethrow-error-from-b…ings-crash.js:31:23) f2 @ rethrow-error-from-bindings-crash.js:31 setTimeout (async) -f1 @ rethrow-error-from-bindings-crash.js:26 +f1 @ rethrow-error-from-bindings-crash.js:25 setTimeout (async) -f2 @ rethrow-error-from-bindings-crash.js:31 +f2 @ rethrow-error-from-bindings-crash.js:30 setTimeout (async) -f1 @ rethrow-error-from-bindings-crash.js:26 +f1 @ rethrow-error-from-bindings-crash.js:25 setTimeout (async) -f2 @ rethrow-error-from-bindings-crash.js:31 -testFunction @ rethrow-error-from-bindings-crash.js:22 +f2 @ rethrow-error-from-bindings-crash.js:30 +setTimeout (async) +f1 @ rethrow-error-from-bindings-crash.js:25 +setTimeout (async) +f2 @ rethrow-error-from-bindings-crash.js:30 +testFunction @ rethrow-error-from-bindings-crash.js:21 setTimeout (async) scheduleTestFunction @ VM:3 (anonymous) @ VM:1 -rethrow-error-from-bindings-crash.js:27 Uncaught TypeError: Failed to execute 'appendChild' on 'Node': parameter 1 is not of type 'Node'. - at f1 (rethrow-error-from-b…ings-crash.js:27:25) -f1 @ rethrow-error-from-bindings-crash.js:27 -setTimeout (async) -f2 @ rethrow-error-from-bindings-crash.js:31 -setTimeout (async) +rethrow-error-from-bindings-crash.js:26 Uncaught TypeError: Failed to execute 'appendChild' on 'Node': parameter 1 is not of type 'Node'. + at f1 (rethrow-error-from-b…ings-crash.js:26:25) f1 @ rethrow-error-from-bindings-crash.js:26 setTimeout (async) -f2 @ rethrow-error-from-bindings-crash.js:31 +f2 @ rethrow-error-from-bindings-crash.js:30 setTimeout (async) -f1 @ rethrow-error-from-bindings-crash.js:26 +f1 @ rethrow-error-from-bindings-crash.js:25 setTimeout (async) -f2 @ rethrow-error-from-bindings-crash.js:31 +f2 @ rethrow-error-from-bindings-crash.js:30 setTimeout (async) -f1 @ rethrow-error-from-bindings-crash.js:26 +f1 @ rethrow-error-from-bindings-crash.js:25 setTimeout (async) -f2 @ rethrow-error-from-bindings-crash.js:31 -testFunction @ rethrow-error-from-bindings-crash.js:22 +f2 @ rethrow-error-from-bindings-crash.js:30 +setTimeout (async) +f1 @ rethrow-error-from-bindings-crash.js:25 +setTimeout (async) +f2 @ rethrow-error-from-bindings-crash.js:30 +testFunction @ rethrow-error-from-bindings-crash.js:21 setTimeout (async) scheduleTestFunction @ VM:3 (anonymous) @ VM:1
diff --git a/third_party/blink/web_tests/http/tests/devtools/sources/debugger/rethrow-error-from-bindings-crash.js b/third_party/blink/web_tests/http/tests/devtools/sources/debugger/rethrow-error-from-bindings-crash.js index fe8e5ee..a76baef 100644 --- a/third_party/blink/web_tests/http/tests/devtools/sources/debugger/rethrow-error-from-bindings-crash.js +++ b/third_party/blink/web_tests/http/tests/devtools/sources/debugger/rethrow-error-from-bindings-crash.js
@@ -8,7 +8,6 @@ (async function() { TestRunner.addResult(`Tests that pausing on uncaught exceptions thrown from C++ bindings will not crash.\n`); - await TestRunner.loadLegacyModule('console'); await TestRunner.showPanel('sources'); await TestRunner.evaluateInPagePromise(` var functions;
diff --git a/third_party/blink/web_tests/http/tests/devtools/sources/debugger/skip-pause-during-navigation.js b/third_party/blink/web_tests/http/tests/devtools/sources/debugger/skip-pause-during-navigation.js index e612cb11..7bf997f 100644 --- a/third_party/blink/web_tests/http/tests/devtools/sources/debugger/skip-pause-during-navigation.js +++ b/third_party/blink/web_tests/http/tests/devtools/sources/debugger/skip-pause-during-navigation.js
@@ -9,7 +9,6 @@ (async function() { TestRunner.addResult( `Tests that we skip all pauses during navigation`); - await TestRunner.loadLegacyModule('console'); await TestRunner.showPanel('sources'); await SourcesTestRunner.startDebuggerTestPromise(); await TestRunner.navigatePromise('resources/page-with-unload.html');
diff --git a/third_party/blink/web_tests/http/tests/devtools/sources/debugger/source-map-http-header.js b/third_party/blink/web_tests/http/tests/devtools/sources/debugger/source-map-http-header.js index 3f878be9..2caf7a3 100644 --- a/third_party/blink/web_tests/http/tests/devtools/sources/debugger/source-map-http-header.js +++ b/third_party/blink/web_tests/http/tests/devtools/sources/debugger/source-map-http-header.js
@@ -9,7 +9,6 @@ (async function() { TestRunner.addResult( `Tests that SourceMap and X-SourceMap http headers are propagated to scripts in the front-end.\n`); - await TestRunner.loadLegacyModule('console'); await TestRunner.showPanel('sources'); await SourcesTestRunner.startDebuggerTestPromise(); var debuggerModel = TestRunner.debuggerModel;
diff --git a/third_party/blink/web_tests/http/tests/devtools/sources/debugger/worker-debugging-script-mapping.js b/third_party/blink/web_tests/http/tests/devtools/sources/debugger/worker-debugging-script-mapping.js index 7a5bacc..a2b3151 100644 --- a/third_party/blink/web_tests/http/tests/devtools/sources/debugger/worker-debugging-script-mapping.js +++ b/third_party/blink/web_tests/http/tests/devtools/sources/debugger/worker-debugging-script-mapping.js
@@ -10,7 +10,6 @@ (async function() { TestRunner.addResult(`Tests stopping in debugger in the worker with source mapping.\n`); - await TestRunner.loadLegacyModule('console'); await TestRunner.showPanel('sources'); await TestRunner.evaluateInPagePromise(` function installWorker()
diff --git a/third_party/blink/web_tests/http/tests/devtools/sources/debugger/worker-debugging.js b/third_party/blink/web_tests/http/tests/devtools/sources/debugger/worker-debugging.js index 928da3f..6ee3184 100644 --- a/third_party/blink/web_tests/http/tests/devtools/sources/debugger/worker-debugging.js +++ b/third_party/blink/web_tests/http/tests/devtools/sources/debugger/worker-debugging.js
@@ -8,7 +8,6 @@ (async function() { TestRunner.addResult(`Tests stopping in debugger in the worker.\n`); - await TestRunner.loadLegacyModule('console'); await TestRunner.showPanel('sources'); await TestRunner.evaluateInPagePromise(` function installWorker()
diff --git a/third_party/blink/web_tests/http/tests/devtools/sources/snippet-module.js b/third_party/blink/web_tests/http/tests/devtools/sources/snippet-module.js index a7403dc..648fdca2 100644 --- a/third_party/blink/web_tests/http/tests/devtools/sources/snippet-module.js +++ b/third_party/blink/web_tests/http/tests/devtools/sources/snippet-module.js
@@ -9,11 +9,11 @@ import * as Common from 'devtools/core/common/common.js'; import * as SourcesModule from 'devtools/panels/sources/sources.js'; import * as Persistence from 'devtools/models/persistence/persistence.js'; +import * as Console from 'devtools/panels/console/console.js'; (async function() { TestRunner.addResult( 'Verifies that modules can be loaded via import() in snippets\n'); - await TestRunner.loadLegacyModule('console'); await TestRunner.showPanel('sources'); const sourceCode = ` @@ -37,6 +37,6 @@ await ConsoleTestRunner.waitUntilNthMessageReceivedPromise(2); await ConsoleTestRunner.dumpConsoleMessages(); - Console.ConsoleView.clearConsole(); + Console.ConsoleView.ConsoleView.clearConsole(); TestRunner.completeTest(); })();
diff --git a/third_party/blink/web_tests/http/tests/devtools/storage-panel-dom-storage-update.js b/third_party/blink/web_tests/http/tests/devtools/storage-panel-dom-storage-update.js index c9d1754..65adc81 100644 --- a/third_party/blink/web_tests/http/tests/devtools/storage-panel-dom-storage-update.js +++ b/third_party/blink/web_tests/http/tests/devtools/storage-panel-dom-storage-update.js
@@ -10,7 +10,6 @@ (async function() { TestRunner.addResult( `Test that storage panel is present and that it contains correct data whenever localStorage is updated.\n`); - await TestRunner.loadLegacyModule('console'); // Note: every test that uses a storage API must manually clean-up state from previous tests. await ApplicationTestRunner.resetState();
diff --git a/third_party/blink/web_tests/http/tests/devtools/storage-panel-dom-storage.js b/third_party/blink/web_tests/http/tests/devtools/storage-panel-dom-storage.js index cf125de..42ea43d 100644 --- a/third_party/blink/web_tests/http/tests/devtools/storage-panel-dom-storage.js +++ b/third_party/blink/web_tests/http/tests/devtools/storage-panel-dom-storage.js
@@ -10,7 +10,6 @@ (async function() { TestRunner.addResult( `Test that storage panel is present and that it contains correct data for local and session DOM storages.\n`); - await TestRunner.loadLegacyModule('console'); // Note: every test that uses a storage API must manually clean-up state from previous tests. await ApplicationTestRunner.resetState();
diff --git a/third_party/blink/web_tests/http/tests/devtools/sxg/sxg-cert-not-found.js b/third_party/blink/web_tests/http/tests/devtools/sxg/sxg-cert-not-found.js index a89bcedf..093540b 100644 --- a/third_party/blink/web_tests/http/tests/devtools/sxg/sxg-cert-not-found.js +++ b/third_party/blink/web_tests/http/tests/devtools/sxg/sxg-cert-not-found.js
@@ -7,7 +7,6 @@ import {ConsoleTestRunner} from 'console_test_runner'; (async function() { TestRunner.addResult('Tests the signed exchange information are available when the certificate file is not available.\n'); - await TestRunner.loadLegacyModule('console'); await TestRunner.showPanel('network'); NetworkTestRunner.networkLog().reset(); await TestRunner.addIframe('/loading/sxg/resources/sxg-cert-not-found.sxg');
diff --git a/third_party/blink/web_tests/http/tests/devtools/sxg/sxg-navigation-fail.js b/third_party/blink/web_tests/http/tests/devtools/sxg/sxg-navigation-fail.js index 366a522..ca497526 100644 --- a/third_party/blink/web_tests/http/tests/devtools/sxg/sxg-navigation-fail.js +++ b/third_party/blink/web_tests/http/tests/devtools/sxg/sxg-navigation-fail.js
@@ -7,7 +7,6 @@ import {ConsoleTestRunner} from 'console_test_runner'; (async function() { TestRunner.addResult('Tests the signed exchange information are available when the navigation failed.\n'); - await TestRunner.loadLegacyModule('console'); await TestRunner.showPanel('network'); NetworkTestRunner.networkLog().reset(); await TestRunner.addIframe('/loading/sxg/resources/sxg-invalid-validity-url.sxg');
diff --git a/third_party/blink/web_tests/http/tests/devtools/sxg/sxg-navigation-redirect.js b/third_party/blink/web_tests/http/tests/devtools/sxg/sxg-navigation-redirect.js index 3021f64..0fad311 100644 --- a/third_party/blink/web_tests/http/tests/devtools/sxg/sxg-navigation-redirect.js +++ b/third_party/blink/web_tests/http/tests/devtools/sxg/sxg-navigation-redirect.js
@@ -7,7 +7,6 @@ import {ConsoleTestRunner} from 'console_test_runner'; (async function() { TestRunner.addResult('Tests the signed exchange information are available when the navigation succeeded after redirect.\n'); - await TestRunner.loadLegacyModule('console'); await TestRunner.showPanel('network'); NetworkTestRunner.networkLog().reset(); const url =
diff --git a/third_party/blink/web_tests/http/tests/devtools/sxg/sxg-navigation.js b/third_party/blink/web_tests/http/tests/devtools/sxg/sxg-navigation.js index 8976780b..e42a9d0 100644 --- a/third_party/blink/web_tests/http/tests/devtools/sxg/sxg-navigation.js +++ b/third_party/blink/web_tests/http/tests/devtools/sxg/sxg-navigation.js
@@ -7,7 +7,6 @@ import {ConsoleTestRunner} from 'console_test_runner'; (async function() { TestRunner.addResult('Tests the signed exchange information are available when the navigation succeeded.\n'); - await TestRunner.loadLegacyModule('console'); await TestRunner.showPanel('network'); NetworkTestRunner.networkLog().reset(); await TestRunner.addIframe('/loading/sxg/resources/sxg-location.sxg');
diff --git a/third_party/blink/web_tests/http/tests/devtools/sxg/sxg-prefetch-fail.js b/third_party/blink/web_tests/http/tests/devtools/sxg/sxg-prefetch-fail.js index 4507ce1..dc985d0 100644 --- a/third_party/blink/web_tests/http/tests/devtools/sxg/sxg-prefetch-fail.js +++ b/third_party/blink/web_tests/http/tests/devtools/sxg/sxg-prefetch-fail.js
@@ -9,7 +9,6 @@ import * as SDK from 'devtools/core/sdk/sdk.js'; (async function() { TestRunner.addResult('Tests the signed exchange information are available when the prefetch failed.\n'); - await TestRunner.loadLegacyModule('console'); await TestRunner.showPanel('network'); NetworkTestRunner.networkLog().reset();
diff --git a/third_party/blink/web_tests/http/tests/devtools/sxg/sxg-prefetch.js b/third_party/blink/web_tests/http/tests/devtools/sxg/sxg-prefetch.js index 0a967b4c..bfd9bd3 100644 --- a/third_party/blink/web_tests/http/tests/devtools/sxg/sxg-prefetch.js +++ b/third_party/blink/web_tests/http/tests/devtools/sxg/sxg-prefetch.js
@@ -9,7 +9,6 @@ import * as SDK from 'devtools/core/sdk/sdk.js'; (async function() { TestRunner.addResult('Tests the signed exchange information are available when the prefetch succeeded.\n'); - await TestRunner.loadLegacyModule('console'); await TestRunner.showPanel('network'); NetworkTestRunner.networkLog().reset();
diff --git a/third_party/blink/web_tests/http/tests/devtools/sxg/sxg-transfer-size.js b/third_party/blink/web_tests/http/tests/devtools/sxg/sxg-transfer-size.js index c431fdc..e6c1b875 100644 --- a/third_party/blink/web_tests/http/tests/devtools/sxg/sxg-transfer-size.js +++ b/third_party/blink/web_tests/http/tests/devtools/sxg/sxg-transfer-size.js
@@ -7,7 +7,6 @@ import {ConsoleTestRunner} from 'console_test_runner'; (async function() { TestRunner.addResult('Tests the transfer size of signed exchange is set correctly.\n'); - await TestRunner.loadLegacyModule('console'); await TestRunner.showPanel('network'); NetworkTestRunner.networkLog().reset(); await TestRunner.addIframe('/loading/sxg/resources/sxg-larger-than-10k.sxg');
diff --git a/third_party/blink/web_tests/http/tests/devtools/template-content-inspect-crash.js b/third_party/blink/web_tests/http/tests/devtools/template-content-inspect-crash.js index 7a9c536..835c490d 100644 --- a/third_party/blink/web_tests/http/tests/devtools/template-content-inspect-crash.js +++ b/third_party/blink/web_tests/http/tests/devtools/template-content-inspect-crash.js
@@ -10,7 +10,6 @@ (async function() { TestRunner.addResult(`This test verifies that template's content DocumentFragment is accessible from DevTools.\n`); - await TestRunner.loadLegacyModule('console'); await TestRunner.showPanel('elements'); await TestRunner.loadHTML(` <p id="description"></p>
diff --git a/third_party/blink/web_tests/platform/linux/custom-elements/form-validation-bubble-appearance-expected.png b/third_party/blink/web_tests/platform/linux/custom-elements/form-validation-bubble-appearance-expected.png index f0e3c908..51931b21 100644 --- a/third_party/blink/web_tests/platform/linux/custom-elements/form-validation-bubble-appearance-expected.png +++ b/third_party/blink/web_tests/platform/linux/custom-elements/form-validation-bubble-appearance-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/fast/dynamic/text-combine-expected.png b/third_party/blink/web_tests/platform/linux/fast/dynamic/text-combine-expected.png index f1eb77bcb..eaec414b 100644 --- a/third_party/blink/web_tests/platform/linux/fast/dynamic/text-combine-expected.png +++ b/third_party/blink/web_tests/platform/linux/fast/dynamic/text-combine-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/fast/forms/placeholder-position-expected.png b/third_party/blink/web_tests/platform/linux/fast/forms/placeholder-position-expected.png index 010f9a9..8f012fdd3 100644 --- a/third_party/blink/web_tests/platform/linux/fast/forms/placeholder-position-expected.png +++ b/third_party/blink/web_tests/platform/linux/fast/forms/placeholder-position-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/fast/forms/validation-bubble-appearance-edge-expected.png b/third_party/blink/web_tests/platform/linux/fast/forms/validation-bubble-appearance-edge-expected.png index a6a998ef..ecc4396c 100644 --- a/third_party/blink/web_tests/platform/linux/fast/forms/validation-bubble-appearance-edge-expected.png +++ b/third_party/blink/web_tests/platform/linux/fast/forms/validation-bubble-appearance-edge-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/fast/forms/validation-bubble-appearance-escape-expected.png b/third_party/blink/web_tests/platform/linux/fast/forms/validation-bubble-appearance-escape-expected.png index 22cf1ef..a33c5286 100644 --- a/third_party/blink/web_tests/platform/linux/fast/forms/validation-bubble-appearance-escape-expected.png +++ b/third_party/blink/web_tests/platform/linux/fast/forms/validation-bubble-appearance-escape-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/fast/forms/validation-bubble-appearance-iframe-expected.png b/third_party/blink/web_tests/platform/linux/fast/forms/validation-bubble-appearance-iframe-expected.png index 86f93e12..b580c35 100644 --- a/third_party/blink/web_tests/platform/linux/fast/forms/validation-bubble-appearance-iframe-expected.png +++ b/third_party/blink/web_tests/platform/linux/fast/forms/validation-bubble-appearance-iframe-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/fast/forms/validation-bubble-appearance-newline-expected.png b/third_party/blink/web_tests/platform/linux/fast/forms/validation-bubble-appearance-newline-expected.png index 0d0e849..ac0c74a 100644 --- a/third_party/blink/web_tests/platform/linux/fast/forms/validation-bubble-appearance-newline-expected.png +++ b/third_party/blink/web_tests/platform/linux/fast/forms/validation-bubble-appearance-newline-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/fast/forms/validation-bubble-appearance-rtl-ui-expected.png b/third_party/blink/web_tests/platform/linux/fast/forms/validation-bubble-appearance-rtl-ui-expected.png index 53f73f9..9b5de06 100644 --- a/third_party/blink/web_tests/platform/linux/fast/forms/validation-bubble-appearance-rtl-ui-expected.png +++ b/third_party/blink/web_tests/platform/linux/fast/forms/validation-bubble-appearance-rtl-ui-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/fast/forms/validation-bubble-appearance-wrap-expected.png b/third_party/blink/web_tests/platform/linux/fast/forms/validation-bubble-appearance-wrap-expected.png index 5e2d5a1b..62d0e92f 100644 --- a/third_party/blink/web_tests/platform/linux/fast/forms/validation-bubble-appearance-wrap-expected.png +++ b/third_party/blink/web_tests/platform/linux/fast/forms/validation-bubble-appearance-wrap-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/fast/forms/validation-bubble-device-emulation-change-expected.png b/third_party/blink/web_tests/platform/linux/fast/forms/validation-bubble-device-emulation-change-expected.png index a00ae22..98e71229 100644 --- a/third_party/blink/web_tests/platform/linux/fast/forms/validation-bubble-device-emulation-change-expected.png +++ b/third_party/blink/web_tests/platform/linux/fast/forms/validation-bubble-device-emulation-change-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/fast/forms/validation-bubble-device-emulation-expected.png b/third_party/blink/web_tests/platform/linux/fast/forms/validation-bubble-device-emulation-expected.png index 1450194..0993e72a 100644 --- a/third_party/blink/web_tests/platform/linux/fast/forms/validation-bubble-device-emulation-expected.png +++ b/third_party/blink/web_tests/platform/linux/fast/forms/validation-bubble-device-emulation-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/fast/inline/vertical-align-with-fallback-fonts-expected.png b/third_party/blink/web_tests/platform/linux/fast/inline/vertical-align-with-fallback-fonts-expected.png index 252d601..7d9f1de2 100644 --- a/third_party/blink/web_tests/platform/linux/fast/inline/vertical-align-with-fallback-fonts-expected.png +++ b/third_party/blink/web_tests/platform/linux/fast/inline/vertical-align-with-fallback-fonts-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/svg/W3C-SVG-1.1/text-align-08-b-expected.png b/third_party/blink/web_tests/platform/linux/svg/W3C-SVG-1.1/text-align-08-b-expected.png index 48712c1..edfd6a7 100644 --- a/third_party/blink/web_tests/platform/linux/svg/W3C-SVG-1.1/text-align-08-b-expected.png +++ b/third_party/blink/web_tests/platform/linux/svg/W3C-SVG-1.1/text-align-08-b-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/svg/batik/text/verticalText-expected.png b/third_party/blink/web_tests/platform/linux/svg/batik/text/verticalText-expected.png index c2b486a9..0c126d7 100644 --- a/third_party/blink/web_tests/platform/linux/svg/batik/text/verticalText-expected.png +++ b/third_party/blink/web_tests/platform/linux/svg/batik/text/verticalText-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/svg/text/textLength-spacingAndGlyphs-decoration-expected.png b/third_party/blink/web_tests/platform/linux/svg/text/textLength-spacingAndGlyphs-decoration-expected.png index 5f0ba3f..308d885 100644 --- a/third_party/blink/web_tests/platform/linux/svg/text/textLength-spacingAndGlyphs-decoration-expected.png +++ b/third_party/blink/web_tests/platform/linux/svg/text/textLength-spacingAndGlyphs-decoration-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/virtual/dark-color-scheme/fast/forms/validation-bubble-appearance-edge-expected.png b/third_party/blink/web_tests/platform/linux/virtual/dark-color-scheme/fast/forms/validation-bubble-appearance-edge-expected.png index d54b71b..23da7c32 100644 --- a/third_party/blink/web_tests/platform/linux/virtual/dark-color-scheme/fast/forms/validation-bubble-appearance-edge-expected.png +++ b/third_party/blink/web_tests/platform/linux/virtual/dark-color-scheme/fast/forms/validation-bubble-appearance-edge-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/virtual/dark-color-scheme/fast/forms/validation-bubble-appearance-wrap-expected.png b/third_party/blink/web_tests/platform/linux/virtual/dark-color-scheme/fast/forms/validation-bubble-appearance-wrap-expected.png index 2833350..da0e776 100644 --- a/third_party/blink/web_tests/platform/linux/virtual/dark-color-scheme/fast/forms/validation-bubble-appearance-wrap-expected.png +++ b/third_party/blink/web_tests/platform/linux/virtual/dark-color-scheme/fast/forms/validation-bubble-appearance-wrap-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/virtual/scalefactor150/fast/hidpi/static/validation-bubble-appearance-hidpi-expected.png b/third_party/blink/web_tests/platform/linux/virtual/scalefactor150/fast/hidpi/static/validation-bubble-appearance-hidpi-expected.png index 46d18c04..866c3af9 100644 --- a/third_party/blink/web_tests/platform/linux/virtual/scalefactor150/fast/hidpi/static/validation-bubble-appearance-hidpi-expected.png +++ b/third_party/blink/web_tests/platform/linux/virtual/scalefactor150/fast/hidpi/static/validation-bubble-appearance-hidpi-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/virtual/scalefactor200/fast/hidpi/static/validation-bubble-appearance-hidpi-expected.png b/third_party/blink/web_tests/platform/linux/virtual/scalefactor200/fast/hidpi/static/validation-bubble-appearance-hidpi-expected.png index 30627d6..caf265b 100644 --- a/third_party/blink/web_tests/platform/linux/virtual/scalefactor200/fast/hidpi/static/validation-bubble-appearance-hidpi-expected.png +++ b/third_party/blink/web_tests/platform/linux/virtual/scalefactor200/fast/hidpi/static/validation-bubble-appearance-hidpi-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/virtual/text-antialias/international/text-combine-image-test-expected.png b/third_party/blink/web_tests/platform/linux/virtual/text-antialias/international/text-combine-image-test-expected.png index d837a18..cabfefa1 100644 --- a/third_party/blink/web_tests/platform/linux/virtual/text-antialias/international/text-combine-image-test-expected.png +++ b/third_party/blink/web_tests/platform/linux/virtual/text-antialias/international/text-combine-image-test-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/virtual/text-antialias/international/wrap-CJK-001-expected.png b/third_party/blink/web_tests/platform/linux/virtual/text-antialias/international/wrap-CJK-001-expected.png index 8f7480d..dbf5f8a 100644 --- a/third_party/blink/web_tests/platform/linux/virtual/text-antialias/international/wrap-CJK-001-expected.png +++ b/third_party/blink/web_tests/platform/linux/virtual/text-antialias/international/wrap-CJK-001-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/virtual/text-antialias/justify-ideograph-leading-expansion-expected.png b/third_party/blink/web_tests/platform/linux/virtual/text-antialias/justify-ideograph-leading-expansion-expected.png index 9b16b5e..1e7bb99 100644 --- a/third_party/blink/web_tests/platform/linux/virtual/text-antialias/justify-ideograph-leading-expansion-expected.png +++ b/third_party/blink/web_tests/platform/linux/virtual/text-antialias/justify-ideograph-leading-expansion-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac-mac10.15/custom-elements/form-validation-bubble-appearance-expected.png b/third_party/blink/web_tests/platform/mac-mac10.15/custom-elements/form-validation-bubble-appearance-expected.png index f898489..c1a74e65 100644 --- a/third_party/blink/web_tests/platform/mac-mac10.15/custom-elements/form-validation-bubble-appearance-expected.png +++ b/third_party/blink/web_tests/platform/mac-mac10.15/custom-elements/form-validation-bubble-appearance-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac-mac10.15/fast/forms/validation-bubble-appearance-edge-expected.png b/third_party/blink/web_tests/platform/mac-mac10.15/fast/forms/validation-bubble-appearance-edge-expected.png index bf0670d3..9a761f5 100644 --- a/third_party/blink/web_tests/platform/mac-mac10.15/fast/forms/validation-bubble-appearance-edge-expected.png +++ b/third_party/blink/web_tests/platform/mac-mac10.15/fast/forms/validation-bubble-appearance-edge-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac-mac10.15/fast/forms/validation-bubble-appearance-escape-expected.png b/third_party/blink/web_tests/platform/mac-mac10.15/fast/forms/validation-bubble-appearance-escape-expected.png index 0b12aff..bcb29a3 100644 --- a/third_party/blink/web_tests/platform/mac-mac10.15/fast/forms/validation-bubble-appearance-escape-expected.png +++ b/third_party/blink/web_tests/platform/mac-mac10.15/fast/forms/validation-bubble-appearance-escape-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac-mac10.15/fast/forms/validation-bubble-appearance-iframe-expected.png b/third_party/blink/web_tests/platform/mac-mac10.15/fast/forms/validation-bubble-appearance-iframe-expected.png index 8dcbd476..e649605 100644 --- a/third_party/blink/web_tests/platform/mac-mac10.15/fast/forms/validation-bubble-appearance-iframe-expected.png +++ b/third_party/blink/web_tests/platform/mac-mac10.15/fast/forms/validation-bubble-appearance-iframe-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac-mac10.15/fast/forms/validation-bubble-appearance-newline-expected.png b/third_party/blink/web_tests/platform/mac-mac10.15/fast/forms/validation-bubble-appearance-newline-expected.png index 5cf5139..83e7d954 100644 --- a/third_party/blink/web_tests/platform/mac-mac10.15/fast/forms/validation-bubble-appearance-newline-expected.png +++ b/third_party/blink/web_tests/platform/mac-mac10.15/fast/forms/validation-bubble-appearance-newline-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac-mac10.15/fast/forms/validation-bubble-appearance-rtl-ui-expected.png b/third_party/blink/web_tests/platform/mac-mac10.15/fast/forms/validation-bubble-appearance-rtl-ui-expected.png index 3291a9b..ad84fc02 100644 --- a/third_party/blink/web_tests/platform/mac-mac10.15/fast/forms/validation-bubble-appearance-rtl-ui-expected.png +++ b/third_party/blink/web_tests/platform/mac-mac10.15/fast/forms/validation-bubble-appearance-rtl-ui-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac-mac10.15/fast/forms/validation-bubble-appearance-wrap-expected.png b/third_party/blink/web_tests/platform/mac-mac10.15/fast/forms/validation-bubble-appearance-wrap-expected.png index c926b76..9ca0755 100644 --- a/third_party/blink/web_tests/platform/mac-mac10.15/fast/forms/validation-bubble-appearance-wrap-expected.png +++ b/third_party/blink/web_tests/platform/mac-mac10.15/fast/forms/validation-bubble-appearance-wrap-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac-mac10.15/fast/forms/validation-bubble-device-emulation-change-expected.png b/third_party/blink/web_tests/platform/mac-mac10.15/fast/forms/validation-bubble-device-emulation-change-expected.png index 7018618..92c89211 100644 --- a/third_party/blink/web_tests/platform/mac-mac10.15/fast/forms/validation-bubble-device-emulation-change-expected.png +++ b/third_party/blink/web_tests/platform/mac-mac10.15/fast/forms/validation-bubble-device-emulation-change-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac-mac10.15/fast/forms/validation-bubble-device-emulation-expected.png b/third_party/blink/web_tests/platform/mac-mac10.15/fast/forms/validation-bubble-device-emulation-expected.png index bfa9e2b..f666121 100644 --- a/third_party/blink/web_tests/platform/mac-mac10.15/fast/forms/validation-bubble-device-emulation-expected.png +++ b/third_party/blink/web_tests/platform/mac-mac10.15/fast/forms/validation-bubble-device-emulation-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac-mac10.15/virtual/dark-color-scheme/fast/forms/validation-bubble-appearance-edge-expected.png b/third_party/blink/web_tests/platform/mac-mac10.15/virtual/dark-color-scheme/fast/forms/validation-bubble-appearance-edge-expected.png index df0d17a6..fcacabd 100644 --- a/third_party/blink/web_tests/platform/mac-mac10.15/virtual/dark-color-scheme/fast/forms/validation-bubble-appearance-edge-expected.png +++ b/third_party/blink/web_tests/platform/mac-mac10.15/virtual/dark-color-scheme/fast/forms/validation-bubble-appearance-edge-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac-mac10.15/virtual/dark-color-scheme/fast/forms/validation-bubble-appearance-wrap-expected.png b/third_party/blink/web_tests/platform/mac-mac10.15/virtual/dark-color-scheme/fast/forms/validation-bubble-appearance-wrap-expected.png index 41bfd789..cfa059a 100644 --- a/third_party/blink/web_tests/platform/mac-mac10.15/virtual/dark-color-scheme/fast/forms/validation-bubble-appearance-wrap-expected.png +++ b/third_party/blink/web_tests/platform/mac-mac10.15/virtual/dark-color-scheme/fast/forms/validation-bubble-appearance-wrap-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac-mac10.15/virtual/scalefactor200/fast/hidpi/static/validation-bubble-appearance-hidpi-expected.png b/third_party/blink/web_tests/platform/mac-mac10.15/virtual/scalefactor200/fast/hidpi/static/validation-bubble-appearance-hidpi-expected.png index b00f861c..e66139a2 100644 --- a/third_party/blink/web_tests/platform/mac-mac10.15/virtual/scalefactor200/fast/hidpi/static/validation-bubble-appearance-hidpi-expected.png +++ b/third_party/blink/web_tests/platform/mac-mac10.15/virtual/scalefactor200/fast/hidpi/static/validation-bubble-appearance-hidpi-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac-mac11-arm64/svg/text/textLength-spacingAndGlyphs-decoration-expected.png b/third_party/blink/web_tests/platform/mac-mac11-arm64/svg/text/textLength-spacingAndGlyphs-decoration-expected.png index e0216a4a9..f7eb032 100644 --- a/third_party/blink/web_tests/platform/mac-mac11-arm64/svg/text/textLength-spacingAndGlyphs-decoration-expected.png +++ b/third_party/blink/web_tests/platform/mac-mac11-arm64/svg/text/textLength-spacingAndGlyphs-decoration-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac-mac11-arm64/virtual/scalefactor200/fast/hidpi/static/validation-bubble-appearance-hidpi-expected.png b/third_party/blink/web_tests/platform/mac-mac11-arm64/virtual/scalefactor200/fast/hidpi/static/validation-bubble-appearance-hidpi-expected.png index 75b5a4b..6b1299d 100644 --- a/third_party/blink/web_tests/platform/mac-mac11-arm64/virtual/scalefactor200/fast/hidpi/static/validation-bubble-appearance-hidpi-expected.png +++ b/third_party/blink/web_tests/platform/mac-mac11-arm64/virtual/scalefactor200/fast/hidpi/static/validation-bubble-appearance-hidpi-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac-mac11/virtual/scalefactor200/fast/hidpi/static/validation-bubble-appearance-hidpi-expected.png b/third_party/blink/web_tests/platform/mac-mac11/virtual/scalefactor200/fast/hidpi/static/validation-bubble-appearance-hidpi-expected.png index 75b5a4b..6b1299d 100644 --- a/third_party/blink/web_tests/platform/mac-mac11/virtual/scalefactor200/fast/hidpi/static/validation-bubble-appearance-hidpi-expected.png +++ b/third_party/blink/web_tests/platform/mac-mac11/virtual/scalefactor200/fast/hidpi/static/validation-bubble-appearance-hidpi-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac-mac12-arm64/svg/text/textLength-spacingAndGlyphs-decoration-expected.png b/third_party/blink/web_tests/platform/mac-mac12-arm64/svg/text/textLength-spacingAndGlyphs-decoration-expected.png index e0216a4a9..f7eb032 100644 --- a/third_party/blink/web_tests/platform/mac-mac12-arm64/svg/text/textLength-spacingAndGlyphs-decoration-expected.png +++ b/third_party/blink/web_tests/platform/mac-mac12-arm64/svg/text/textLength-spacingAndGlyphs-decoration-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac-mac12-arm64/virtual/scalefactor200/fast/hidpi/static/validation-bubble-appearance-hidpi-expected.png b/third_party/blink/web_tests/platform/mac-mac12-arm64/virtual/scalefactor200/fast/hidpi/static/validation-bubble-appearance-hidpi-expected.png index 75b5a4b..6b1299d 100644 --- a/third_party/blink/web_tests/platform/mac-mac12-arm64/virtual/scalefactor200/fast/hidpi/static/validation-bubble-appearance-hidpi-expected.png +++ b/third_party/blink/web_tests/platform/mac-mac12-arm64/virtual/scalefactor200/fast/hidpi/static/validation-bubble-appearance-hidpi-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac-mac12/virtual/scalefactor200/fast/hidpi/static/validation-bubble-appearance-hidpi-expected.png b/third_party/blink/web_tests/platform/mac-mac12/virtual/scalefactor200/fast/hidpi/static/validation-bubble-appearance-hidpi-expected.png index 75b5a4b..6b1299d 100644 --- a/third_party/blink/web_tests/platform/mac-mac12/virtual/scalefactor200/fast/hidpi/static/validation-bubble-appearance-hidpi-expected.png +++ b/third_party/blink/web_tests/platform/mac-mac12/virtual/scalefactor200/fast/hidpi/static/validation-bubble-appearance-hidpi-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac-mac12/virtual/text-antialias/international/text-combine-image-test-expected.png b/third_party/blink/web_tests/platform/mac-mac12/virtual/text-antialias/international/text-combine-image-test-expected.png index 6c7db6d..3be8ef4 100644 --- a/third_party/blink/web_tests/platform/mac-mac12/virtual/text-antialias/international/text-combine-image-test-expected.png +++ b/third_party/blink/web_tests/platform/mac-mac12/virtual/text-antialias/international/text-combine-image-test-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac-mac12/virtual/text-antialias/justify-ideograph-leading-expansion-expected.png b/third_party/blink/web_tests/platform/mac-mac12/virtual/text-antialias/justify-ideograph-leading-expansion-expected.png index 1be021ae..7abfaf6 100644 --- a/third_party/blink/web_tests/platform/mac-mac12/virtual/text-antialias/justify-ideograph-leading-expansion-expected.png +++ b/third_party/blink/web_tests/platform/mac-mac12/virtual/text-antialias/justify-ideograph-leading-expansion-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac-mac13-arm64/svg/text/textLength-spacingAndGlyphs-decoration-expected.png b/third_party/blink/web_tests/platform/mac-mac13-arm64/svg/text/textLength-spacingAndGlyphs-decoration-expected.png index e0216a4a9..f7eb032 100644 --- a/third_party/blink/web_tests/platform/mac-mac13-arm64/svg/text/textLength-spacingAndGlyphs-decoration-expected.png +++ b/third_party/blink/web_tests/platform/mac-mac13-arm64/svg/text/textLength-spacingAndGlyphs-decoration-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac-mac13-arm64/virtual/scalefactor200/fast/hidpi/static/validation-bubble-appearance-hidpi-expected.png b/third_party/blink/web_tests/platform/mac-mac13-arm64/virtual/scalefactor200/fast/hidpi/static/validation-bubble-appearance-hidpi-expected.png index 75b5a4b..6b1299d 100644 --- a/third_party/blink/web_tests/platform/mac-mac13-arm64/virtual/scalefactor200/fast/hidpi/static/validation-bubble-appearance-hidpi-expected.png +++ b/third_party/blink/web_tests/platform/mac-mac13-arm64/virtual/scalefactor200/fast/hidpi/static/validation-bubble-appearance-hidpi-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac-mac13-arm64/virtual/text-antialias/justify-ideograph-leading-expansion-expected.png b/third_party/blink/web_tests/platform/mac-mac13-arm64/virtual/text-antialias/justify-ideograph-leading-expansion-expected.png new file mode 100644 index 0000000..fad9bca --- /dev/null +++ b/third_party/blink/web_tests/platform/mac-mac13-arm64/virtual/text-antialias/justify-ideograph-leading-expansion-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac/custom-elements/form-validation-bubble-appearance-expected.png b/third_party/blink/web_tests/platform/mac/custom-elements/form-validation-bubble-appearance-expected.png index eef7d07..40623a00 100644 --- a/third_party/blink/web_tests/platform/mac/custom-elements/form-validation-bubble-appearance-expected.png +++ b/third_party/blink/web_tests/platform/mac/custom-elements/form-validation-bubble-appearance-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac/external/wpt/webnn/elementwise_binary.https.any-expected.txt b/third_party/blink/web_tests/platform/mac/external/wpt/webnn/elementwise_binary.https.any-expected.txt index 486c09e..563206ab3 100644 --- a/third_party/blink/web_tests/platform/mac/external/wpt/webnn/elementwise_binary.https.any-expected.txt +++ b/third_party/blink/web_tests/platform/mac/external/wpt/webnn/elementwise_binary.https.any-expected.txt
@@ -54,14 +54,14 @@ FAIL min float32 broadcast 2D to 4D / async promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented" FAIL min float32 broadcast 3D to 4D / async promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented" FAIL min float32 broadcast 4D to 4D / async promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented" -FAIL pow float32 1D base tensor and 1D integer exponent tensor / async promise_test: Unhandled rejection with value: object "TypeError: builder[operationName] is not a function" -FAIL pow float32 2D base tensor and 2D integer exponent tensor / async promise_test: Unhandled rejection with value: object "TypeError: builder[operationName] is not a function" -FAIL pow float32 3D base tensor and 3D integer exponent tensor / async promise_test: Unhandled rejection with value: object "TypeError: builder[operationName] is not a function" -FAIL pow float32 4D base tensor and 4D integer exponent tensor / async promise_test: Unhandled rejection with value: object "TypeError: builder[operationName] is not a function" -FAIL pow float32 5D base tensor and 5D integer exponent tensor / async promise_test: Unhandled rejection with value: object "TypeError: builder[operationName] is not a function" -FAIL pow (square) float32 4D base tensor and broadcastable 1D integer exponent tensor / async promise_test: Unhandled rejection with value: object "TypeError: builder[operationName] is not a function" -FAIL pow (sqrt) float32 4D positive base tensor and broadcastable 1D integer exponent tensor / async promise_test: Unhandled rejection with value: object "TypeError: builder[operationName] is not a function" -FAIL pow float32 4D base tensor and broadcastable 2D integer exponent tensor / async promise_test: Unhandled rejection with value: object "TypeError: builder[operationName] is not a function" -FAIL pow float32 4D base tensor and broadcastable 3D integer exponent tensor / async promise_test: Unhandled rejection with value: object "TypeError: builder[operationName] is not a function" +FAIL pow float32 1D base tensor and 1D integer exponent tensor / async promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented" +FAIL pow float32 2D base tensor and 2D integer exponent tensor / async promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented" +FAIL pow float32 3D base tensor and 3D integer exponent tensor / async promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented" +FAIL pow float32 4D base tensor and 4D integer exponent tensor / async promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented" +FAIL pow float32 5D base tensor and 5D integer exponent tensor / async promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented" +FAIL pow (square) float32 4D base tensor and broadcastable 1D integer exponent tensor / async promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented" +FAIL pow (sqrt) float32 4D positive base tensor and broadcastable 1D integer exponent tensor / async promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented" +FAIL pow float32 4D base tensor and broadcastable 2D integer exponent tensor / async promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented" +FAIL pow float32 4D base tensor and broadcastable 3D integer exponent tensor / async promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented" Harness: the test ran to completion.
diff --git a/third_party/blink/web_tests/platform/mac/external/wpt/webnn/elementwise_binary.https.any.worker-expected.txt b/third_party/blink/web_tests/platform/mac/external/wpt/webnn/elementwise_binary.https.any.worker-expected.txt index b55a900..c7e0d5a 100644 --- a/third_party/blink/web_tests/platform/mac/external/wpt/webnn/elementwise_binary.https.any.worker-expected.txt +++ b/third_party/blink/web_tests/platform/mac/external/wpt/webnn/elementwise_binary.https.any.worker-expected.txt
@@ -54,15 +54,15 @@ FAIL min float32 broadcast 2D to 4D / sync Failed to execute 'buildSync' on 'MLGraphBuilder': Not implemented FAIL min float32 broadcast 3D to 4D / sync Failed to execute 'buildSync' on 'MLGraphBuilder': Not implemented FAIL min float32 broadcast 4D to 4D / sync Failed to execute 'buildSync' on 'MLGraphBuilder': Not implemented -FAIL pow float32 1D base tensor and 1D integer exponent tensor / sync builder[operationName] is not a function -FAIL pow float32 2D base tensor and 2D integer exponent tensor / sync builder[operationName] is not a function -FAIL pow float32 3D base tensor and 3D integer exponent tensor / sync builder[operationName] is not a function -FAIL pow float32 4D base tensor and 4D integer exponent tensor / sync builder[operationName] is not a function -FAIL pow float32 5D base tensor and 5D integer exponent tensor / sync builder[operationName] is not a function -FAIL pow (square) float32 4D base tensor and broadcastable 1D integer exponent tensor / sync builder[operationName] is not a function -FAIL pow (sqrt) float32 4D positive base tensor and broadcastable 1D integer exponent tensor / sync builder[operationName] is not a function -FAIL pow float32 4D base tensor and broadcastable 2D integer exponent tensor / sync builder[operationName] is not a function -FAIL pow float32 4D base tensor and broadcastable 3D integer exponent tensor / sync builder[operationName] is not a function +FAIL pow float32 1D base tensor and 1D integer exponent tensor / sync Failed to execute 'buildSync' on 'MLGraphBuilder': Not implemented +FAIL pow float32 2D base tensor and 2D integer exponent tensor / sync Failed to execute 'buildSync' on 'MLGraphBuilder': Not implemented +FAIL pow float32 3D base tensor and 3D integer exponent tensor / sync Failed to execute 'buildSync' on 'MLGraphBuilder': Not implemented +FAIL pow float32 4D base tensor and 4D integer exponent tensor / sync Failed to execute 'buildSync' on 'MLGraphBuilder': Not implemented +FAIL pow float32 5D base tensor and 5D integer exponent tensor / sync Failed to execute 'buildSync' on 'MLGraphBuilder': Not implemented +FAIL pow (square) float32 4D base tensor and broadcastable 1D integer exponent tensor / sync Failed to execute 'buildSync' on 'MLGraphBuilder': Not implemented +FAIL pow (sqrt) float32 4D positive base tensor and broadcastable 1D integer exponent tensor / sync Failed to execute 'buildSync' on 'MLGraphBuilder': Not implemented +FAIL pow float32 4D base tensor and broadcastable 2D integer exponent tensor / sync Failed to execute 'buildSync' on 'MLGraphBuilder': Not implemented +FAIL pow float32 4D base tensor and broadcastable 3D integer exponent tensor / sync Failed to execute 'buildSync' on 'MLGraphBuilder': Not implemented FAIL add float32 1D tensors / async promise_test: Unhandled rejection with value: object "TypeError: builder.build is not a function" FAIL add float32 2D tensors / async promise_test: Unhandled rejection with value: object "TypeError: builder.build is not a function" FAIL add float32 3D tensors / async promise_test: Unhandled rejection with value: object "TypeError: builder.build is not a function" @@ -117,14 +117,14 @@ FAIL min float32 broadcast 2D to 4D / async promise_test: Unhandled rejection with value: object "TypeError: builder.build is not a function" FAIL min float32 broadcast 3D to 4D / async promise_test: Unhandled rejection with value: object "TypeError: builder.build is not a function" FAIL min float32 broadcast 4D to 4D / async promise_test: Unhandled rejection with value: object "TypeError: builder.build is not a function" -FAIL pow float32 1D base tensor and 1D integer exponent tensor / async promise_test: Unhandled rejection with value: object "TypeError: builder[operationName] is not a function" -FAIL pow float32 2D base tensor and 2D integer exponent tensor / async promise_test: Unhandled rejection with value: object "TypeError: builder[operationName] is not a function" -FAIL pow float32 3D base tensor and 3D integer exponent tensor / async promise_test: Unhandled rejection with value: object "TypeError: builder[operationName] is not a function" -FAIL pow float32 4D base tensor and 4D integer exponent tensor / async promise_test: Unhandled rejection with value: object "TypeError: builder[operationName] is not a function" -FAIL pow float32 5D base tensor and 5D integer exponent tensor / async promise_test: Unhandled rejection with value: object "TypeError: builder[operationName] is not a function" -FAIL pow (square) float32 4D base tensor and broadcastable 1D integer exponent tensor / async promise_test: Unhandled rejection with value: object "TypeError: builder[operationName] is not a function" -FAIL pow (sqrt) float32 4D positive base tensor and broadcastable 1D integer exponent tensor / async promise_test: Unhandled rejection with value: object "TypeError: builder[operationName] is not a function" -FAIL pow float32 4D base tensor and broadcastable 2D integer exponent tensor / async promise_test: Unhandled rejection with value: object "TypeError: builder[operationName] is not a function" -FAIL pow float32 4D base tensor and broadcastable 3D integer exponent tensor / async promise_test: Unhandled rejection with value: object "TypeError: builder[operationName] is not a function" +FAIL pow float32 1D base tensor and 1D integer exponent tensor / async promise_test: Unhandled rejection with value: object "TypeError: builder.build is not a function" +FAIL pow float32 2D base tensor and 2D integer exponent tensor / async promise_test: Unhandled rejection with value: object "TypeError: builder.build is not a function" +FAIL pow float32 3D base tensor and 3D integer exponent tensor / async promise_test: Unhandled rejection with value: object "TypeError: builder.build is not a function" +FAIL pow float32 4D base tensor and 4D integer exponent tensor / async promise_test: Unhandled rejection with value: object "TypeError: builder.build is not a function" +FAIL pow float32 5D base tensor and 5D integer exponent tensor / async promise_test: Unhandled rejection with value: object "TypeError: builder.build is not a function" +FAIL pow (square) float32 4D base tensor and broadcastable 1D integer exponent tensor / async promise_test: Unhandled rejection with value: object "TypeError: builder.build is not a function" +FAIL pow (sqrt) float32 4D positive base tensor and broadcastable 1D integer exponent tensor / async promise_test: Unhandled rejection with value: object "TypeError: builder.build is not a function" +FAIL pow float32 4D base tensor and broadcastable 2D integer exponent tensor / async promise_test: Unhandled rejection with value: object "TypeError: builder.build is not a function" +FAIL pow float32 4D base tensor and broadcastable 3D integer exponent tensor / async promise_test: Unhandled rejection with value: object "TypeError: builder.build is not a function" Harness: the test ran to completion.
diff --git a/third_party/blink/web_tests/platform/mac/external/wpt/webnn/idlharness.https.any-expected.txt b/third_party/blink/web_tests/platform/mac/external/wpt/webnn/idlharness.https.any-expected.txt index 4d4115e..c0bf858 100644 --- a/third_party/blink/web_tests/platform/mac/external/wpt/webnn/idlharness.https.any-expected.txt +++ b/third_party/blink/web_tests/platform/mac/external/wpt/webnn/idlharness.https.any-expected.txt
@@ -1,5 +1,5 @@ This is a testharness.js-based test. -Found 408 tests; 296 PASS, 112 FAIL, 0 TIMEOUT, 0 NOTRUN. +Found 408 tests; 299 PASS, 109 FAIL, 0 TIMEOUT, 0 NOTRUN. FAIL idl_test setup promise_test: Unhandled rejection with value: object "NotSupportedError: Not implemented" PASS idl_test validation PASS Partial interface MLContext: original interface defined @@ -197,7 +197,7 @@ PASS MLGraphBuilder interface: operation div(MLOperand, MLOperand) PASS MLGraphBuilder interface: operation max(MLOperand, MLOperand) PASS MLGraphBuilder interface: operation min(MLOperand, MLOperand) -FAIL MLGraphBuilder interface: operation pow(MLOperand, MLOperand) assert_own_property: interface prototype object missing non-static operation expected property "pow" missing +PASS MLGraphBuilder interface: operation pow(MLOperand, MLOperand) PASS MLGraphBuilder interface: operation abs(MLOperand) PASS MLGraphBuilder interface: operation ceil(MLOperand) FAIL MLGraphBuilder interface: operation cos(MLOperand) assert_own_property: interface prototype object missing non-static operation expected property "cos" missing @@ -292,8 +292,8 @@ PASS MLGraphBuilder interface: calling max(MLOperand, MLOperand) on builder with too few arguments must throw TypeError PASS MLGraphBuilder interface: builder must inherit property "min(MLOperand, MLOperand)" with the proper type PASS MLGraphBuilder interface: calling min(MLOperand, MLOperand) on builder with too few arguments must throw TypeError -FAIL MLGraphBuilder interface: builder must inherit property "pow(MLOperand, MLOperand)" with the proper type assert_inherits: property "pow" not found in prototype chain -FAIL MLGraphBuilder interface: calling pow(MLOperand, MLOperand) on builder with too few arguments must throw TypeError assert_inherits: property "pow" not found in prototype chain +PASS MLGraphBuilder interface: builder must inherit property "pow(MLOperand, MLOperand)" with the proper type +PASS MLGraphBuilder interface: calling pow(MLOperand, MLOperand) on builder with too few arguments must throw TypeError PASS MLGraphBuilder interface: builder must inherit property "abs(MLOperand)" with the proper type PASS MLGraphBuilder interface: calling abs(MLOperand) on builder with too few arguments must throw TypeError PASS MLGraphBuilder interface: builder must inherit property "ceil(MLOperand)" with the proper type
diff --git a/third_party/blink/web_tests/platform/mac/external/wpt/webnn/idlharness.https.any.worker-expected.txt b/third_party/blink/web_tests/platform/mac/external/wpt/webnn/idlharness.https.any.worker-expected.txt index c55aa19..881b9d20 100644 --- a/third_party/blink/web_tests/platform/mac/external/wpt/webnn/idlharness.https.any.worker-expected.txt +++ b/third_party/blink/web_tests/platform/mac/external/wpt/webnn/idlharness.https.any.worker-expected.txt
@@ -1,5 +1,5 @@ This is a testharness.js-based test. -Found 414 tests; 295 PASS, 119 FAIL, 0 TIMEOUT, 0 NOTRUN. +Found 414 tests; 298 PASS, 116 FAIL, 0 TIMEOUT, 0 NOTRUN. FAIL idl_test setup promise_test: Unhandled rejection with value: object "NotSupportedError: Failed to execute 'buildSync' on 'MLGraphBuilder': Not implemented" PASS idl_test validation PASS Partial interface MLContext: original interface defined @@ -202,7 +202,7 @@ PASS MLGraphBuilder interface: operation div(MLOperand, MLOperand) PASS MLGraphBuilder interface: operation max(MLOperand, MLOperand) PASS MLGraphBuilder interface: operation min(MLOperand, MLOperand) -FAIL MLGraphBuilder interface: operation pow(MLOperand, MLOperand) assert_own_property: interface prototype object missing non-static operation expected property "pow" missing +PASS MLGraphBuilder interface: operation pow(MLOperand, MLOperand) PASS MLGraphBuilder interface: operation abs(MLOperand) PASS MLGraphBuilder interface: operation ceil(MLOperand) FAIL MLGraphBuilder interface: operation cos(MLOperand) assert_own_property: interface prototype object missing non-static operation expected property "cos" missing @@ -298,8 +298,8 @@ PASS MLGraphBuilder interface: calling max(MLOperand, MLOperand) on builder with too few arguments must throw TypeError PASS MLGraphBuilder interface: builder must inherit property "min(MLOperand, MLOperand)" with the proper type PASS MLGraphBuilder interface: calling min(MLOperand, MLOperand) on builder with too few arguments must throw TypeError -FAIL MLGraphBuilder interface: builder must inherit property "pow(MLOperand, MLOperand)" with the proper type assert_inherits: property "pow" not found in prototype chain -FAIL MLGraphBuilder interface: calling pow(MLOperand, MLOperand) on builder with too few arguments must throw TypeError assert_inherits: property "pow" not found in prototype chain +PASS MLGraphBuilder interface: builder must inherit property "pow(MLOperand, MLOperand)" with the proper type +PASS MLGraphBuilder interface: calling pow(MLOperand, MLOperand) on builder with too few arguments must throw TypeError PASS MLGraphBuilder interface: builder must inherit property "abs(MLOperand)" with the proper type PASS MLGraphBuilder interface: calling abs(MLOperand) on builder with too few arguments must throw TypeError PASS MLGraphBuilder interface: builder must inherit property "ceil(MLOperand)" with the proper type
diff --git a/third_party/blink/web_tests/platform/mac/fast/css3-text/css3-text-decoration/text-underline-position/text-underline-position-cjk-expected.png b/third_party/blink/web_tests/platform/mac/fast/css3-text/css3-text-decoration/text-underline-position/text-underline-position-cjk-expected.png index e24ae55..3e5f907 100644 --- a/third_party/blink/web_tests/platform/mac/fast/css3-text/css3-text-decoration/text-underline-position/text-underline-position-cjk-expected.png +++ b/third_party/blink/web_tests/platform/mac/fast/css3-text/css3-text-decoration/text-underline-position/text-underline-position-cjk-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac/fast/dynamic/text-combine-expected.png b/third_party/blink/web_tests/platform/mac/fast/dynamic/text-combine-expected.png index 47ac168..a5914181 100644 --- a/third_party/blink/web_tests/platform/mac/fast/dynamic/text-combine-expected.png +++ b/third_party/blink/web_tests/platform/mac/fast/dynamic/text-combine-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac/fast/forms/placeholder-position-expected.png b/third_party/blink/web_tests/platform/mac/fast/forms/placeholder-position-expected.png index 10b10b5..ee3a97c 100644 --- a/third_party/blink/web_tests/platform/mac/fast/forms/placeholder-position-expected.png +++ b/third_party/blink/web_tests/platform/mac/fast/forms/placeholder-position-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac/fast/forms/validation-bubble-appearance-edge-expected.png b/third_party/blink/web_tests/platform/mac/fast/forms/validation-bubble-appearance-edge-expected.png index 47c42d2..6e93c87 100644 --- a/third_party/blink/web_tests/platform/mac/fast/forms/validation-bubble-appearance-edge-expected.png +++ b/third_party/blink/web_tests/platform/mac/fast/forms/validation-bubble-appearance-edge-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac/fast/forms/validation-bubble-appearance-escape-expected.png b/third_party/blink/web_tests/platform/mac/fast/forms/validation-bubble-appearance-escape-expected.png index ab7ddd5..1e78d1be 100644 --- a/third_party/blink/web_tests/platform/mac/fast/forms/validation-bubble-appearance-escape-expected.png +++ b/third_party/blink/web_tests/platform/mac/fast/forms/validation-bubble-appearance-escape-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac/fast/forms/validation-bubble-appearance-iframe-expected.png b/third_party/blink/web_tests/platform/mac/fast/forms/validation-bubble-appearance-iframe-expected.png index c018290..2e0cd57 100644 --- a/third_party/blink/web_tests/platform/mac/fast/forms/validation-bubble-appearance-iframe-expected.png +++ b/third_party/blink/web_tests/platform/mac/fast/forms/validation-bubble-appearance-iframe-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac/fast/forms/validation-bubble-appearance-newline-expected.png b/third_party/blink/web_tests/platform/mac/fast/forms/validation-bubble-appearance-newline-expected.png index b3297c91..96be44d 100644 --- a/third_party/blink/web_tests/platform/mac/fast/forms/validation-bubble-appearance-newline-expected.png +++ b/third_party/blink/web_tests/platform/mac/fast/forms/validation-bubble-appearance-newline-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac/fast/forms/validation-bubble-appearance-rtl-ui-expected.png b/third_party/blink/web_tests/platform/mac/fast/forms/validation-bubble-appearance-rtl-ui-expected.png index 35e859f..937a44159 100644 --- a/third_party/blink/web_tests/platform/mac/fast/forms/validation-bubble-appearance-rtl-ui-expected.png +++ b/third_party/blink/web_tests/platform/mac/fast/forms/validation-bubble-appearance-rtl-ui-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac/fast/forms/validation-bubble-appearance-wrap-expected.png b/third_party/blink/web_tests/platform/mac/fast/forms/validation-bubble-appearance-wrap-expected.png index c430a58..ac38a5f 100644 --- a/third_party/blink/web_tests/platform/mac/fast/forms/validation-bubble-appearance-wrap-expected.png +++ b/third_party/blink/web_tests/platform/mac/fast/forms/validation-bubble-appearance-wrap-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac/fast/forms/validation-bubble-device-emulation-change-expected.png b/third_party/blink/web_tests/platform/mac/fast/forms/validation-bubble-device-emulation-change-expected.png index 69c17ad..adc77e9 100644 --- a/third_party/blink/web_tests/platform/mac/fast/forms/validation-bubble-device-emulation-change-expected.png +++ b/third_party/blink/web_tests/platform/mac/fast/forms/validation-bubble-device-emulation-change-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac/fast/forms/validation-bubble-device-emulation-expected.png b/third_party/blink/web_tests/platform/mac/fast/forms/validation-bubble-device-emulation-expected.png index b321bc6..a1a0dff 100644 --- a/third_party/blink/web_tests/platform/mac/fast/forms/validation-bubble-device-emulation-expected.png +++ b/third_party/blink/web_tests/platform/mac/fast/forms/validation-bubble-device-emulation-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac/fast/inline/vertical-align-with-fallback-fonts-expected.png b/third_party/blink/web_tests/platform/mac/fast/inline/vertical-align-with-fallback-fonts-expected.png index bd5a764..22f49481 100644 --- a/third_party/blink/web_tests/platform/mac/fast/inline/vertical-align-with-fallback-fonts-expected.png +++ b/third_party/blink/web_tests/platform/mac/fast/inline/vertical-align-with-fallback-fonts-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac/svg/W3C-SVG-1.1/text-align-08-b-expected.png b/third_party/blink/web_tests/platform/mac/svg/W3C-SVG-1.1/text-align-08-b-expected.png index 07b9dac9..5cced84 100644 --- a/third_party/blink/web_tests/platform/mac/svg/W3C-SVG-1.1/text-align-08-b-expected.png +++ b/third_party/blink/web_tests/platform/mac/svg/W3C-SVG-1.1/text-align-08-b-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac/svg/batik/text/verticalText-expected.png b/third_party/blink/web_tests/platform/mac/svg/batik/text/verticalText-expected.png index 1ff3ee39..8a4d5c19 100644 --- a/third_party/blink/web_tests/platform/mac/svg/batik/text/verticalText-expected.png +++ b/third_party/blink/web_tests/platform/mac/svg/batik/text/verticalText-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac/svg/text/textLength-spacingAndGlyphs-decoration-expected.png b/third_party/blink/web_tests/platform/mac/svg/text/textLength-spacingAndGlyphs-decoration-expected.png index fe2fa26f..7ee4961 100644 --- a/third_party/blink/web_tests/platform/mac/svg/text/textLength-spacingAndGlyphs-decoration-expected.png +++ b/third_party/blink/web_tests/platform/mac/svg/text/textLength-spacingAndGlyphs-decoration-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac/virtual/dark-color-scheme/fast/forms/validation-bubble-appearance-edge-expected.png b/third_party/blink/web_tests/platform/mac/virtual/dark-color-scheme/fast/forms/validation-bubble-appearance-edge-expected.png index c7a343e3..ce0127b 100644 --- a/third_party/blink/web_tests/platform/mac/virtual/dark-color-scheme/fast/forms/validation-bubble-appearance-edge-expected.png +++ b/third_party/blink/web_tests/platform/mac/virtual/dark-color-scheme/fast/forms/validation-bubble-appearance-edge-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac/virtual/dark-color-scheme/fast/forms/validation-bubble-appearance-wrap-expected.png b/third_party/blink/web_tests/platform/mac/virtual/dark-color-scheme/fast/forms/validation-bubble-appearance-wrap-expected.png index 446c627..e24429b 100644 --- a/third_party/blink/web_tests/platform/mac/virtual/dark-color-scheme/fast/forms/validation-bubble-appearance-wrap-expected.png +++ b/third_party/blink/web_tests/platform/mac/virtual/dark-color-scheme/fast/forms/validation-bubble-appearance-wrap-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac/virtual/scalefactor200/fast/hidpi/static/validation-bubble-appearance-hidpi-expected.png b/third_party/blink/web_tests/platform/mac/virtual/scalefactor200/fast/hidpi/static/validation-bubble-appearance-hidpi-expected.png index 75b5a4b..6b1299d 100644 --- a/third_party/blink/web_tests/platform/mac/virtual/scalefactor200/fast/hidpi/static/validation-bubble-appearance-hidpi-expected.png +++ b/third_party/blink/web_tests/platform/mac/virtual/scalefactor200/fast/hidpi/static/validation-bubble-appearance-hidpi-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac/virtual/text-antialias/international/text-combine-image-test-expected.png b/third_party/blink/web_tests/platform/mac/virtual/text-antialias/international/text-combine-image-test-expected.png index c47b383..23446d8 100644 --- a/third_party/blink/web_tests/platform/mac/virtual/text-antialias/international/text-combine-image-test-expected.png +++ b/third_party/blink/web_tests/platform/mac/virtual/text-antialias/international/text-combine-image-test-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac/virtual/text-antialias/international/wrap-CJK-001-expected.png b/third_party/blink/web_tests/platform/mac/virtual/text-antialias/international/wrap-CJK-001-expected.png index a3300427..a9b823a9 100644 --- a/third_party/blink/web_tests/platform/mac/virtual/text-antialias/international/wrap-CJK-001-expected.png +++ b/third_party/blink/web_tests/platform/mac/virtual/text-antialias/international/wrap-CJK-001-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac/virtual/text-antialias/justify-ideograph-leading-expansion-expected.png b/third_party/blink/web_tests/platform/mac/virtual/text-antialias/justify-ideograph-leading-expansion-expected.png index fad9bca..e2cfd712 100644 --- a/third_party/blink/web_tests/platform/mac/virtual/text-antialias/justify-ideograph-leading-expansion-expected.png +++ b/third_party/blink/web_tests/platform/mac/virtual/text-antialias/justify-ideograph-leading-expansion-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/custom-elements/form-validation-bubble-appearance-expected.png b/third_party/blink/web_tests/platform/win/custom-elements/form-validation-bubble-appearance-expected.png index 983d60c..0847017 100644 --- a/third_party/blink/web_tests/platform/win/custom-elements/form-validation-bubble-appearance-expected.png +++ b/third_party/blink/web_tests/platform/win/custom-elements/form-validation-bubble-appearance-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/external/wpt/webnn/elementwise_binary.https.any-expected.txt b/third_party/blink/web_tests/platform/win/external/wpt/webnn/elementwise_binary.https.any-expected.txt index ae47da3..e110605 100644 --- a/third_party/blink/web_tests/platform/win/external/wpt/webnn/elementwise_binary.https.any-expected.txt +++ b/third_party/blink/web_tests/platform/win/external/wpt/webnn/elementwise_binary.https.any-expected.txt
@@ -1,5 +1,5 @@ This is a testharness.js-based test. -Found 63 tests; 54 PASS, 9 FAIL, 0 TIMEOUT, 0 NOTRUN. +Found 63 tests; 56 PASS, 7 FAIL, 0 TIMEOUT, 0 NOTRUN. PASS add float32 1D tensors / async PASS add float32 2D tensors / async PASS add float32 3D tensors / async @@ -54,14 +54,14 @@ PASS min float32 broadcast 2D to 4D / async PASS min float32 broadcast 3D to 4D / async PASS min float32 broadcast 4D to 4D / async -FAIL pow float32 1D base tensor and 1D integer exponent tensor / async promise_test: Unhandled rejection with value: object "TypeError: builder[operationName] is not a function" -FAIL pow float32 2D base tensor and 2D integer exponent tensor / async promise_test: Unhandled rejection with value: object "TypeError: builder[operationName] is not a function" -FAIL pow float32 3D base tensor and 3D integer exponent tensor / async promise_test: Unhandled rejection with value: object "TypeError: builder[operationName] is not a function" -FAIL pow float32 4D base tensor and 4D integer exponent tensor / async promise_test: Unhandled rejection with value: object "TypeError: builder[operationName] is not a function" -FAIL pow float32 5D base tensor and 5D integer exponent tensor / async promise_test: Unhandled rejection with value: object "TypeError: builder[operationName] is not a function" -FAIL pow (square) float32 4D base tensor and broadcastable 1D integer exponent tensor / async promise_test: Unhandled rejection with value: object "TypeError: builder[operationName] is not a function" -FAIL pow (sqrt) float32 4D positive base tensor and broadcastable 1D integer exponent tensor / async promise_test: Unhandled rejection with value: object "TypeError: builder[operationName] is not a function" -FAIL pow float32 4D base tensor and broadcastable 2D integer exponent tensor / async promise_test: Unhandled rejection with value: object "TypeError: builder[operationName] is not a function" -FAIL pow float32 4D base tensor and broadcastable 3D integer exponent tensor / async promise_test: Unhandled rejection with value: object "TypeError: builder[operationName] is not a function" +FAIL pow float32 1D base tensor and 1D integer exponent tensor / async promise_test: Unhandled rejection with value: object "NotSupportedError: Operand b should be defined as a constant for pow." +FAIL pow float32 2D base tensor and 2D integer exponent tensor / async promise_test: Unhandled rejection with value: object "NotSupportedError: Operand b should be defined as a constant for pow." +FAIL pow float32 3D base tensor and 3D integer exponent tensor / async promise_test: Unhandled rejection with value: object "NotSupportedError: Operand b should be defined as a constant for pow." +FAIL pow float32 4D base tensor and 4D integer exponent tensor / async promise_test: Unhandled rejection with value: object "NotSupportedError: Operand b should be defined as a constant for pow." +FAIL pow float32 5D base tensor and 5D integer exponent tensor / async promise_test: Unhandled rejection with value: object "NotSupportedError: Operand b should be defined as a constant for pow." +PASS pow (square) float32 4D base tensor and broadcastable 1D integer exponent tensor / async +PASS pow (sqrt) float32 4D positive base tensor and broadcastable 1D integer exponent tensor / async +FAIL pow float32 4D base tensor and broadcastable 2D integer exponent tensor / async promise_test: Unhandled rejection with value: object "NotSupportedError: Operand b should be defined as a constant for pow." +FAIL pow float32 4D base tensor and broadcastable 3D integer exponent tensor / async promise_test: Unhandled rejection with value: object "NotSupportedError: Operand b should be defined as a constant for pow." Harness: the test ran to completion.
diff --git a/third_party/blink/web_tests/platform/win/external/wpt/webnn/elementwise_binary.https.any.worker-expected.txt b/third_party/blink/web_tests/platform/win/external/wpt/webnn/elementwise_binary.https.any.worker-expected.txt index b6069b4..ebb65af 100644 --- a/third_party/blink/web_tests/platform/win/external/wpt/webnn/elementwise_binary.https.any.worker-expected.txt +++ b/third_party/blink/web_tests/platform/win/external/wpt/webnn/elementwise_binary.https.any.worker-expected.txt
@@ -1,5 +1,5 @@ This is a testharness.js-based test. -Found 126 tests; 54 PASS, 72 FAIL, 0 TIMEOUT, 0 NOTRUN. +Found 126 tests; 56 PASS, 70 FAIL, 0 TIMEOUT, 0 NOTRUN. PASS add float32 1D tensors / sync PASS add float32 2D tensors / sync PASS add float32 3D tensors / sync @@ -54,15 +54,15 @@ PASS min float32 broadcast 2D to 4D / sync PASS min float32 broadcast 3D to 4D / sync PASS min float32 broadcast 4D to 4D / sync -FAIL pow float32 1D base tensor and 1D integer exponent tensor / sync builder[operationName] is not a function -FAIL pow float32 2D base tensor and 2D integer exponent tensor / sync builder[operationName] is not a function -FAIL pow float32 3D base tensor and 3D integer exponent tensor / sync builder[operationName] is not a function -FAIL pow float32 4D base tensor and 4D integer exponent tensor / sync builder[operationName] is not a function -FAIL pow float32 5D base tensor and 5D integer exponent tensor / sync builder[operationName] is not a function -FAIL pow (square) float32 4D base tensor and broadcastable 1D integer exponent tensor / sync builder[operationName] is not a function -FAIL pow (sqrt) float32 4D positive base tensor and broadcastable 1D integer exponent tensor / sync builder[operationName] is not a function -FAIL pow float32 4D base tensor and broadcastable 2D integer exponent tensor / sync builder[operationName] is not a function -FAIL pow float32 4D base tensor and broadcastable 3D integer exponent tensor / sync builder[operationName] is not a function +FAIL pow float32 1D base tensor and 1D integer exponent tensor / sync Failed to execute 'buildSync' on 'MLGraphBuilder': Operand b should be defined as a constant for pow. +FAIL pow float32 2D base tensor and 2D integer exponent tensor / sync Failed to execute 'buildSync' on 'MLGraphBuilder': Operand b should be defined as a constant for pow. +FAIL pow float32 3D base tensor and 3D integer exponent tensor / sync Failed to execute 'buildSync' on 'MLGraphBuilder': Operand b should be defined as a constant for pow. +FAIL pow float32 4D base tensor and 4D integer exponent tensor / sync Failed to execute 'buildSync' on 'MLGraphBuilder': Operand b should be defined as a constant for pow. +FAIL pow float32 5D base tensor and 5D integer exponent tensor / sync Failed to execute 'buildSync' on 'MLGraphBuilder': Operand b should be defined as a constant for pow. +PASS pow (square) float32 4D base tensor and broadcastable 1D integer exponent tensor / sync +PASS pow (sqrt) float32 4D positive base tensor and broadcastable 1D integer exponent tensor / sync +FAIL pow float32 4D base tensor and broadcastable 2D integer exponent tensor / sync Failed to execute 'buildSync' on 'MLGraphBuilder': Operand b should be defined as a constant for pow. +FAIL pow float32 4D base tensor and broadcastable 3D integer exponent tensor / sync Failed to execute 'buildSync' on 'MLGraphBuilder': Operand b should be defined as a constant for pow. FAIL add float32 1D tensors / async promise_test: Unhandled rejection with value: object "TypeError: builder.build is not a function" FAIL add float32 2D tensors / async promise_test: Unhandled rejection with value: object "TypeError: builder.build is not a function" FAIL add float32 3D tensors / async promise_test: Unhandled rejection with value: object "TypeError: builder.build is not a function" @@ -117,14 +117,14 @@ FAIL min float32 broadcast 2D to 4D / async promise_test: Unhandled rejection with value: object "TypeError: builder.build is not a function" FAIL min float32 broadcast 3D to 4D / async promise_test: Unhandled rejection with value: object "TypeError: builder.build is not a function" FAIL min float32 broadcast 4D to 4D / async promise_test: Unhandled rejection with value: object "TypeError: builder.build is not a function" -FAIL pow float32 1D base tensor and 1D integer exponent tensor / async promise_test: Unhandled rejection with value: object "TypeError: builder[operationName] is not a function" -FAIL pow float32 2D base tensor and 2D integer exponent tensor / async promise_test: Unhandled rejection with value: object "TypeError: builder[operationName] is not a function" -FAIL pow float32 3D base tensor and 3D integer exponent tensor / async promise_test: Unhandled rejection with value: object "TypeError: builder[operationName] is not a function" -FAIL pow float32 4D base tensor and 4D integer exponent tensor / async promise_test: Unhandled rejection with value: object "TypeError: builder[operationName] is not a function" -FAIL pow float32 5D base tensor and 5D integer exponent tensor / async promise_test: Unhandled rejection with value: object "TypeError: builder[operationName] is not a function" -FAIL pow (square) float32 4D base tensor and broadcastable 1D integer exponent tensor / async promise_test: Unhandled rejection with value: object "TypeError: builder[operationName] is not a function" -FAIL pow (sqrt) float32 4D positive base tensor and broadcastable 1D integer exponent tensor / async promise_test: Unhandled rejection with value: object "TypeError: builder[operationName] is not a function" -FAIL pow float32 4D base tensor and broadcastable 2D integer exponent tensor / async promise_test: Unhandled rejection with value: object "TypeError: builder[operationName] is not a function" -FAIL pow float32 4D base tensor and broadcastable 3D integer exponent tensor / async promise_test: Unhandled rejection with value: object "TypeError: builder[operationName] is not a function" +FAIL pow float32 1D base tensor and 1D integer exponent tensor / async promise_test: Unhandled rejection with value: object "TypeError: builder.build is not a function" +FAIL pow float32 2D base tensor and 2D integer exponent tensor / async promise_test: Unhandled rejection with value: object "TypeError: builder.build is not a function" +FAIL pow float32 3D base tensor and 3D integer exponent tensor / async promise_test: Unhandled rejection with value: object "TypeError: builder.build is not a function" +FAIL pow float32 4D base tensor and 4D integer exponent tensor / async promise_test: Unhandled rejection with value: object "TypeError: builder.build is not a function" +FAIL pow float32 5D base tensor and 5D integer exponent tensor / async promise_test: Unhandled rejection with value: object "TypeError: builder.build is not a function" +FAIL pow (square) float32 4D base tensor and broadcastable 1D integer exponent tensor / async promise_test: Unhandled rejection with value: object "TypeError: builder.build is not a function" +FAIL pow (sqrt) float32 4D positive base tensor and broadcastable 1D integer exponent tensor / async promise_test: Unhandled rejection with value: object "TypeError: builder.build is not a function" +FAIL pow float32 4D base tensor and broadcastable 2D integer exponent tensor / async promise_test: Unhandled rejection with value: object "TypeError: builder.build is not a function" +FAIL pow float32 4D base tensor and broadcastable 3D integer exponent tensor / async promise_test: Unhandled rejection with value: object "TypeError: builder.build is not a function" Harness: the test ran to completion.
diff --git a/third_party/blink/web_tests/platform/win/external/wpt/webnn/idlharness.https.any-expected.txt b/third_party/blink/web_tests/platform/win/external/wpt/webnn/idlharness.https.any-expected.txt index 80ff5fd..5913346 100644 --- a/third_party/blink/web_tests/platform/win/external/wpt/webnn/idlharness.https.any-expected.txt +++ b/third_party/blink/web_tests/platform/win/external/wpt/webnn/idlharness.https.any-expected.txt
@@ -1,5 +1,5 @@ This is a testharness.js-based test. -Found 408 tests; 296 PASS, 112 FAIL, 0 TIMEOUT, 0 NOTRUN. +Found 408 tests; 299 PASS, 109 FAIL, 0 TIMEOUT, 0 NOTRUN. FAIL idl_test setup promise_test: Unhandled rejection with value: object "NotSupportedError: The input layout nchw is not supported." PASS idl_test validation PASS Partial interface MLContext: original interface defined @@ -197,7 +197,7 @@ PASS MLGraphBuilder interface: operation div(MLOperand, MLOperand) PASS MLGraphBuilder interface: operation max(MLOperand, MLOperand) PASS MLGraphBuilder interface: operation min(MLOperand, MLOperand) -FAIL MLGraphBuilder interface: operation pow(MLOperand, MLOperand) assert_own_property: interface prototype object missing non-static operation expected property "pow" missing +PASS MLGraphBuilder interface: operation pow(MLOperand, MLOperand) PASS MLGraphBuilder interface: operation abs(MLOperand) PASS MLGraphBuilder interface: operation ceil(MLOperand) FAIL MLGraphBuilder interface: operation cos(MLOperand) assert_own_property: interface prototype object missing non-static operation expected property "cos" missing @@ -292,8 +292,8 @@ PASS MLGraphBuilder interface: calling max(MLOperand, MLOperand) on builder with too few arguments must throw TypeError PASS MLGraphBuilder interface: builder must inherit property "min(MLOperand, MLOperand)" with the proper type PASS MLGraphBuilder interface: calling min(MLOperand, MLOperand) on builder with too few arguments must throw TypeError -FAIL MLGraphBuilder interface: builder must inherit property "pow(MLOperand, MLOperand)" with the proper type assert_inherits: property "pow" not found in prototype chain -FAIL MLGraphBuilder interface: calling pow(MLOperand, MLOperand) on builder with too few arguments must throw TypeError assert_inherits: property "pow" not found in prototype chain +PASS MLGraphBuilder interface: builder must inherit property "pow(MLOperand, MLOperand)" with the proper type +PASS MLGraphBuilder interface: calling pow(MLOperand, MLOperand) on builder with too few arguments must throw TypeError PASS MLGraphBuilder interface: builder must inherit property "abs(MLOperand)" with the proper type PASS MLGraphBuilder interface: calling abs(MLOperand) on builder with too few arguments must throw TypeError PASS MLGraphBuilder interface: builder must inherit property "ceil(MLOperand)" with the proper type
diff --git a/third_party/blink/web_tests/platform/win/external/wpt/webnn/idlharness.https.any.worker-expected.txt b/third_party/blink/web_tests/platform/win/external/wpt/webnn/idlharness.https.any.worker-expected.txt index 369cdfc..adf79a1 100644 --- a/third_party/blink/web_tests/platform/win/external/wpt/webnn/idlharness.https.any.worker-expected.txt +++ b/third_party/blink/web_tests/platform/win/external/wpt/webnn/idlharness.https.any.worker-expected.txt
@@ -1,5 +1,5 @@ This is a testharness.js-based test. -Found 414 tests; 295 PASS, 119 FAIL, 0 TIMEOUT, 0 NOTRUN. +Found 414 tests; 298 PASS, 116 FAIL, 0 TIMEOUT, 0 NOTRUN. FAIL idl_test setup promise_test: Unhandled rejection with value: object "NotSupportedError: Failed to execute 'buildSync' on 'MLGraphBuilder': The input layout nchw is not supported." PASS idl_test validation PASS Partial interface MLContext: original interface defined @@ -202,7 +202,7 @@ PASS MLGraphBuilder interface: operation div(MLOperand, MLOperand) PASS MLGraphBuilder interface: operation max(MLOperand, MLOperand) PASS MLGraphBuilder interface: operation min(MLOperand, MLOperand) -FAIL MLGraphBuilder interface: operation pow(MLOperand, MLOperand) assert_own_property: interface prototype object missing non-static operation expected property "pow" missing +PASS MLGraphBuilder interface: operation pow(MLOperand, MLOperand) PASS MLGraphBuilder interface: operation abs(MLOperand) PASS MLGraphBuilder interface: operation ceil(MLOperand) FAIL MLGraphBuilder interface: operation cos(MLOperand) assert_own_property: interface prototype object missing non-static operation expected property "cos" missing @@ -298,8 +298,8 @@ PASS MLGraphBuilder interface: calling max(MLOperand, MLOperand) on builder with too few arguments must throw TypeError PASS MLGraphBuilder interface: builder must inherit property "min(MLOperand, MLOperand)" with the proper type PASS MLGraphBuilder interface: calling min(MLOperand, MLOperand) on builder with too few arguments must throw TypeError -FAIL MLGraphBuilder interface: builder must inherit property "pow(MLOperand, MLOperand)" with the proper type assert_inherits: property "pow" not found in prototype chain -FAIL MLGraphBuilder interface: calling pow(MLOperand, MLOperand) on builder with too few arguments must throw TypeError assert_inherits: property "pow" not found in prototype chain +PASS MLGraphBuilder interface: builder must inherit property "pow(MLOperand, MLOperand)" with the proper type +PASS MLGraphBuilder interface: calling pow(MLOperand, MLOperand) on builder with too few arguments must throw TypeError PASS MLGraphBuilder interface: builder must inherit property "abs(MLOperand)" with the proper type PASS MLGraphBuilder interface: calling abs(MLOperand) on builder with too few arguments must throw TypeError PASS MLGraphBuilder interface: builder must inherit property "ceil(MLOperand)" with the proper type
diff --git a/third_party/blink/web_tests/platform/win/fast/css3-text/css3-text-decoration/text-underline-position/text-underline-position-cjk-expected.png b/third_party/blink/web_tests/platform/win/fast/css3-text/css3-text-decoration/text-underline-position/text-underline-position-cjk-expected.png index 7eb002af..8416254 100644 --- a/third_party/blink/web_tests/platform/win/fast/css3-text/css3-text-decoration/text-underline-position/text-underline-position-cjk-expected.png +++ b/third_party/blink/web_tests/platform/win/fast/css3-text/css3-text-decoration/text-underline-position/text-underline-position-cjk-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/fast/dynamic/text-combine-expected.png b/third_party/blink/web_tests/platform/win/fast/dynamic/text-combine-expected.png index 71ec28d..64968f5 100644 --- a/third_party/blink/web_tests/platform/win/fast/dynamic/text-combine-expected.png +++ b/third_party/blink/web_tests/platform/win/fast/dynamic/text-combine-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/fast/forms/placeholder-position-expected.png b/third_party/blink/web_tests/platform/win/fast/forms/placeholder-position-expected.png index c5201e2..d40bcdc 100644 --- a/third_party/blink/web_tests/platform/win/fast/forms/placeholder-position-expected.png +++ b/third_party/blink/web_tests/platform/win/fast/forms/placeholder-position-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/fast/forms/validation-bubble-appearance-edge-expected.png b/third_party/blink/web_tests/platform/win/fast/forms/validation-bubble-appearance-edge-expected.png index 4c70526..0680711 100644 --- a/third_party/blink/web_tests/platform/win/fast/forms/validation-bubble-appearance-edge-expected.png +++ b/third_party/blink/web_tests/platform/win/fast/forms/validation-bubble-appearance-edge-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/fast/forms/validation-bubble-appearance-escape-expected.png b/third_party/blink/web_tests/platform/win/fast/forms/validation-bubble-appearance-escape-expected.png index 9493caeb..7783036 100644 --- a/third_party/blink/web_tests/platform/win/fast/forms/validation-bubble-appearance-escape-expected.png +++ b/third_party/blink/web_tests/platform/win/fast/forms/validation-bubble-appearance-escape-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/fast/forms/validation-bubble-appearance-iframe-expected.png b/third_party/blink/web_tests/platform/win/fast/forms/validation-bubble-appearance-iframe-expected.png index bd985ad..0872bd9 100644 --- a/third_party/blink/web_tests/platform/win/fast/forms/validation-bubble-appearance-iframe-expected.png +++ b/third_party/blink/web_tests/platform/win/fast/forms/validation-bubble-appearance-iframe-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/fast/forms/validation-bubble-appearance-newline-expected.png b/third_party/blink/web_tests/platform/win/fast/forms/validation-bubble-appearance-newline-expected.png index ae88d1a..8c86ae0e 100644 --- a/third_party/blink/web_tests/platform/win/fast/forms/validation-bubble-appearance-newline-expected.png +++ b/third_party/blink/web_tests/platform/win/fast/forms/validation-bubble-appearance-newline-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/fast/forms/validation-bubble-appearance-rtl-ui-expected.png b/third_party/blink/web_tests/platform/win/fast/forms/validation-bubble-appearance-rtl-ui-expected.png index 59cce9d..8510549 100644 --- a/third_party/blink/web_tests/platform/win/fast/forms/validation-bubble-appearance-rtl-ui-expected.png +++ b/third_party/blink/web_tests/platform/win/fast/forms/validation-bubble-appearance-rtl-ui-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/fast/forms/validation-bubble-appearance-wrap-expected.png b/third_party/blink/web_tests/platform/win/fast/forms/validation-bubble-appearance-wrap-expected.png index c8e4612..4b58a1e 100644 --- a/third_party/blink/web_tests/platform/win/fast/forms/validation-bubble-appearance-wrap-expected.png +++ b/third_party/blink/web_tests/platform/win/fast/forms/validation-bubble-appearance-wrap-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/fast/forms/validation-bubble-device-emulation-change-expected.png b/third_party/blink/web_tests/platform/win/fast/forms/validation-bubble-device-emulation-change-expected.png index 2ca5873..d857de0 100644 --- a/third_party/blink/web_tests/platform/win/fast/forms/validation-bubble-device-emulation-change-expected.png +++ b/third_party/blink/web_tests/platform/win/fast/forms/validation-bubble-device-emulation-change-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/fast/forms/validation-bubble-device-emulation-expected.png b/third_party/blink/web_tests/platform/win/fast/forms/validation-bubble-device-emulation-expected.png index 569e50050..5c67d3190 100644 --- a/third_party/blink/web_tests/platform/win/fast/forms/validation-bubble-device-emulation-expected.png +++ b/third_party/blink/web_tests/platform/win/fast/forms/validation-bubble-device-emulation-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/fast/inline/vertical-align-with-fallback-fonts-expected.png b/third_party/blink/web_tests/platform/win/fast/inline/vertical-align-with-fallback-fonts-expected.png index 05ea149..4391524d 100644 --- a/third_party/blink/web_tests/platform/win/fast/inline/vertical-align-with-fallback-fonts-expected.png +++ b/third_party/blink/web_tests/platform/win/fast/inline/vertical-align-with-fallback-fonts-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/svg/W3C-SVG-1.1/text-align-08-b-expected.png b/third_party/blink/web_tests/platform/win/svg/W3C-SVG-1.1/text-align-08-b-expected.png index a8226eb..5ce31b5 100644 --- a/third_party/blink/web_tests/platform/win/svg/W3C-SVG-1.1/text-align-08-b-expected.png +++ b/third_party/blink/web_tests/platform/win/svg/W3C-SVG-1.1/text-align-08-b-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/svg/batik/text/verticalText-expected.png b/third_party/blink/web_tests/platform/win/svg/batik/text/verticalText-expected.png index 2c9ddf423..450f8a1 100644 --- a/third_party/blink/web_tests/platform/win/svg/batik/text/verticalText-expected.png +++ b/third_party/blink/web_tests/platform/win/svg/batik/text/verticalText-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/svg/text/textLength-spacingAndGlyphs-decoration-expected.png b/third_party/blink/web_tests/platform/win/svg/text/textLength-spacingAndGlyphs-decoration-expected.png index 6782082..74ef386f 100644 --- a/third_party/blink/web_tests/platform/win/svg/text/textLength-spacingAndGlyphs-decoration-expected.png +++ b/third_party/blink/web_tests/platform/win/svg/text/textLength-spacingAndGlyphs-decoration-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/virtual/dark-color-scheme/fast/forms/validation-bubble-appearance-edge-expected.png b/third_party/blink/web_tests/platform/win/virtual/dark-color-scheme/fast/forms/validation-bubble-appearance-edge-expected.png index c472fbc..31f9303f 100644 --- a/third_party/blink/web_tests/platform/win/virtual/dark-color-scheme/fast/forms/validation-bubble-appearance-edge-expected.png +++ b/third_party/blink/web_tests/platform/win/virtual/dark-color-scheme/fast/forms/validation-bubble-appearance-edge-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/virtual/dark-color-scheme/fast/forms/validation-bubble-appearance-wrap-expected.png b/third_party/blink/web_tests/platform/win/virtual/dark-color-scheme/fast/forms/validation-bubble-appearance-wrap-expected.png index 1a1584e..193f234 100644 --- a/third_party/blink/web_tests/platform/win/virtual/dark-color-scheme/fast/forms/validation-bubble-appearance-wrap-expected.png +++ b/third_party/blink/web_tests/platform/win/virtual/dark-color-scheme/fast/forms/validation-bubble-appearance-wrap-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/virtual/scalefactor150/fast/hidpi/static/validation-bubble-appearance-hidpi-expected.png b/third_party/blink/web_tests/platform/win/virtual/scalefactor150/fast/hidpi/static/validation-bubble-appearance-hidpi-expected.png index d59d3c1..1ead4e4 100644 --- a/third_party/blink/web_tests/platform/win/virtual/scalefactor150/fast/hidpi/static/validation-bubble-appearance-hidpi-expected.png +++ b/third_party/blink/web_tests/platform/win/virtual/scalefactor150/fast/hidpi/static/validation-bubble-appearance-hidpi-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/virtual/scalefactor200/fast/hidpi/static/validation-bubble-appearance-hidpi-expected.png b/third_party/blink/web_tests/platform/win/virtual/scalefactor200/fast/hidpi/static/validation-bubble-appearance-hidpi-expected.png index d4f8c27..a7d3eb1 100644 --- a/third_party/blink/web_tests/platform/win/virtual/scalefactor200/fast/hidpi/static/validation-bubble-appearance-hidpi-expected.png +++ b/third_party/blink/web_tests/platform/win/virtual/scalefactor200/fast/hidpi/static/validation-bubble-appearance-hidpi-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/virtual/text-antialias/international/text-combine-image-test-expected.png b/third_party/blink/web_tests/platform/win/virtual/text-antialias/international/text-combine-image-test-expected.png index c1366b21..3bed54d 100644 --- a/third_party/blink/web_tests/platform/win/virtual/text-antialias/international/text-combine-image-test-expected.png +++ b/third_party/blink/web_tests/platform/win/virtual/text-antialias/international/text-combine-image-test-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/virtual/text-antialias/international/wrap-CJK-001-expected.png b/third_party/blink/web_tests/platform/win/virtual/text-antialias/international/wrap-CJK-001-expected.png index 3a50b6d..b7643b6c 100644 --- a/third_party/blink/web_tests/platform/win/virtual/text-antialias/international/wrap-CJK-001-expected.png +++ b/third_party/blink/web_tests/platform/win/virtual/text-antialias/international/wrap-CJK-001-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/virtual/text-antialias/justify-ideograph-leading-expansion-expected.png b/third_party/blink/web_tests/platform/win/virtual/text-antialias/justify-ideograph-leading-expansion-expected.png index 951d4ee..bc0a064 100644 --- a/third_party/blink/web_tests/platform/win/virtual/text-antialias/justify-ideograph-leading-expansion-expected.png +++ b/third_party/blink/web_tests/platform/win/virtual/text-antialias/justify-ideograph-leading-expansion-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win10/virtual/scalefactor150/fast/hidpi/static/validation-bubble-appearance-hidpi-expected.png b/third_party/blink/web_tests/platform/win10/virtual/scalefactor150/fast/hidpi/static/validation-bubble-appearance-hidpi-expected.png index d59d3c1..1ead4e4 100644 --- a/third_party/blink/web_tests/platform/win10/virtual/scalefactor150/fast/hidpi/static/validation-bubble-appearance-hidpi-expected.png +++ b/third_party/blink/web_tests/platform/win10/virtual/scalefactor150/fast/hidpi/static/validation-bubble-appearance-hidpi-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win10/virtual/scalefactor200/fast/hidpi/static/validation-bubble-appearance-hidpi-expected.png b/third_party/blink/web_tests/platform/win10/virtual/scalefactor200/fast/hidpi/static/validation-bubble-appearance-hidpi-expected.png index d4f8c27..a7d3eb1 100644 --- a/third_party/blink/web_tests/platform/win10/virtual/scalefactor200/fast/hidpi/static/validation-bubble-appearance-hidpi-expected.png +++ b/third_party/blink/web_tests/platform/win10/virtual/scalefactor200/fast/hidpi/static/validation-bubble-appearance-hidpi-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win10/virtual/text-antialias/international/wrap-CJK-001-expected.png b/third_party/blink/web_tests/platform/win10/virtual/text-antialias/international/wrap-CJK-001-expected.png index a8b9107..45b7c439 100644 --- a/third_party/blink/web_tests/platform/win10/virtual/text-antialias/international/wrap-CJK-001-expected.png +++ b/third_party/blink/web_tests/platform/win10/virtual/text-antialias/international/wrap-CJK-001-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win11-arm64/custom-elements/form-validation-bubble-appearance-expected.png b/third_party/blink/web_tests/platform/win11-arm64/custom-elements/form-validation-bubble-appearance-expected.png index 9bd37ab0..0847017 100644 --- a/third_party/blink/web_tests/platform/win11-arm64/custom-elements/form-validation-bubble-appearance-expected.png +++ b/third_party/blink/web_tests/platform/win11-arm64/custom-elements/form-validation-bubble-appearance-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/svg/css/getComputedStyle-listing-expected.txt b/third_party/blink/web_tests/svg/css/getComputedStyle-listing-expected.txt index a771990..5de31de 100644 --- a/third_party/blink/web_tests/svg/css/getComputedStyle-listing-expected.txt +++ b/third_party/blink/web_tests/svg/css/getComputedStyle-listing-expected.txt
@@ -344,6 +344,7 @@ text-align: start text-align-last: auto text-anchor: start +text-autospace: normal text-box-trim: none text-decoration: none solid rgb(0, 0, 0) text-decoration-color: rgb(0, 0, 0)
diff --git a/third_party/blink/web_tests/virtual/css-text-autospace/external/wpt/css/css-text/text-autospace/text-autospace-001-expected.txt b/third_party/blink/web_tests/virtual/css-text-autospace/external/wpt/css/css-text/text-autospace/text-autospace-001-expected.txt deleted file mode 100644 index fd8541d..0000000 --- a/third_party/blink/web_tests/virtual/css-text-autospace/external/wpt/css/css-text/text-autospace/text-autospace-001-expected.txt +++ /dev/null
@@ -1,8 +0,0 @@ -This is a testharness.js-based test. -PASS text-autospace-001 -PASS text-autospace-001 1 -PASS text-autospace-001 2 -PASS text-autospace-001 3 -PASS text-autospace-001 4 -Harness: the test ran to completion. -
diff --git a/third_party/blink/web_tests/virtual/css-text-autospace/external/wpt/css/css-text/text-autospace/text-autospace-first-line-001-expected.txt b/third_party/blink/web_tests/virtual/css-text-autospace/external/wpt/css/css-text/text-autospace/text-autospace-first-line-001-expected.txt deleted file mode 100644 index 5074313..0000000 --- a/third_party/blink/web_tests/virtual/css-text-autospace/external/wpt/css/css-text/text-autospace/text-autospace-first-line-001-expected.txt +++ /dev/null
@@ -1,4 +0,0 @@ -This is a testharness.js-based test. -PASS text-autospace-first-line-001 -Harness: the test ran to completion. -
diff --git a/third_party/blink/web_tests/virtual/css-text-autospace/external/wpt/css/css-text/text-autospace/text-autospace-ligature-001-expected.txt b/third_party/blink/web_tests/virtual/css-text-autospace/external/wpt/css/css-text/text-autospace/text-autospace-ligature-001-expected.txt deleted file mode 100644 index 4d1bb363..0000000 --- a/third_party/blink/web_tests/virtual/css-text-autospace/external/wpt/css/css-text/text-autospace/text-autospace-ligature-001-expected.txt +++ /dev/null
@@ -1,10 +0,0 @@ -This is a testharness.js-based test. -PASS test1.assert(0, 1, spacing) -PASS test1.assert(1, 3, 0) -PASS test2.assert(0, 2, spacing) -PASS test2.assert(2, 3, 0) -PASS test3.assert(0, 1, spacing) -PASS test3.assert(1, 3, spacing) -PASS test3.assert(3, 4, 0) -Harness: the test ran to completion. -
diff --git a/third_party/blink/web_tests/virtual/css-text-spacing-trim/external/wpt/css/css-text/parsing/text-spacing-computed-expected.txt b/third_party/blink/web_tests/virtual/css-text-spacing-trim/external/wpt/css/css-text/parsing/text-spacing-computed-expected.txt new file mode 100644 index 0000000..d2b79a7 --- /dev/null +++ b/third_party/blink/web_tests/virtual/css-text-spacing-trim/external/wpt/css/css-text/parsing/text-spacing-computed-expected.txt
@@ -0,0 +1,15 @@ +This is a testharness.js-based test. +PASS Property text-spacing value 'normal' +PASS Property text-spacing value 'none' +FAIL Property text-spacing value 'auto' assert_true: 'auto' is a supported value for text-spacing. expected true got false +PASS Property text-spacing value 'no-autospace' +PASS Property text-spacing value 'space-first' +PASS Property text-spacing value 'space-all' +FAIL Property text-spacing value 'allow-end space-first' assert_true: 'allow-end space-first' is a supported value for text-spacing. expected true got false +FAIL Property text-spacing value 'space-first allow-end' assert_true: 'space-first allow-end' is a supported value for text-spacing. expected true got false +PASS Property text-spacing value 'no-autospace space-first' +PASS Property text-spacing value 'no-autospace space-all' +PASS Property text-spacing value 'space-first no-autospace' +PASS Property text-spacing value 'space-all no-autospace' +Harness: the test ran to completion. +
diff --git a/third_party/blink/web_tests/virtual/css-text-spacing-trim/external/wpt/css/css-text/parsing/text-spacing-valid-expected.txt b/third_party/blink/web_tests/virtual/css-text-spacing-trim/external/wpt/css/css-text/parsing/text-spacing-valid-expected.txt new file mode 100644 index 0000000..7841eee --- /dev/null +++ b/third_party/blink/web_tests/virtual/css-text-spacing-trim/external/wpt/css/css-text/parsing/text-spacing-valid-expected.txt
@@ -0,0 +1,15 @@ +This is a testharness.js-based test. +PASS e.style['text-spacing'] = "normal" should set the property value +PASS e.style['text-spacing'] = "none" should set the property value +FAIL e.style['text-spacing'] = "auto" should set the property value assert_not_equals: property should be set got disallowed value "" +PASS e.style['text-spacing'] = "no-autospace" should set the property value +PASS e.style['text-spacing'] = "space-first" should set the property value +PASS e.style['text-spacing'] = "space-all" should set the property value +FAIL e.style['text-spacing'] = "allow-end space-first" should set the property value assert_not_equals: property should be set got disallowed value "" +FAIL e.style['text-spacing'] = "space-first allow-end" should set the property value assert_not_equals: property should be set got disallowed value "" +PASS e.style['text-spacing'] = "no-autospace space-first" should set the property value +PASS e.style['text-spacing'] = "no-autospace space-all" should set the property value +PASS e.style['text-spacing'] = "space-first no-autospace" should set the property value +PASS e.style['text-spacing'] = "space-all no-autospace" should set the property value +Harness: the test ran to completion. +
diff --git a/third_party/blink/web_tests/virtual/stable/fast/css/stable/css-registered-custom-property-syntax.html b/third_party/blink/web_tests/virtual/stable/fast/css/stable/css-registered-custom-property-syntax.html index f77692c0..6083167f 100644 --- a/third_party/blink/web_tests/virtual/stable/fast/css/stable/css-registered-custom-property-syntax.html +++ b/third_party/blink/web_tests/virtual/stable/fast/css/stable/css-registered-custom-property-syntax.html
@@ -40,15 +40,4 @@ }); }, 'Custom properties with <transform-list> syntax should not be exposed to stable'); -test(function() { - assert_registration_failed(() => { - CSS.registerProperty({ - name: '--image', - syntax: '<image>', - initialValue: 'url("a")', - inherits: false - }); - }); -}, 'Custom properties with <image> syntax should not be exposed to stable'); - </script>
diff --git a/third_party/blink/web_tests/virtual/text-antialias/justify-vertical.html b/third_party/blink/web_tests/virtual/text-antialias/justify-vertical.html index 15e7380a..d036a099 100644 --- a/third_party/blink/web_tests/virtual/text-antialias/justify-vertical.html +++ b/third_party/blink/web_tests/virtual/text-antialias/justify-vertical.html
@@ -12,6 +12,7 @@ border:black solid thin; font-family:Ahem, cssot; text-align:justify; + text-autospace: no-autospace; } </style> <dl>
diff --git a/third_party/blink/web_tests/virtual/text-antialias/line-break-8bit-after-16bit-expected.html b/third_party/blink/web_tests/virtual/text-antialias/line-break-8bit-after-16bit-expected.html index 6915d4e..c4b1900 100644 --- a/third_party/blink/web_tests/virtual/text-antialias/line-break-8bit-after-16bit-expected.html +++ b/third_party/blink/web_tests/virtual/text-antialias/line-break-8bit-after-16bit-expected.html
@@ -9,6 +9,7 @@ font-family: Ahem, AhemU; font-size: 20px; width: 3ch; + text-autospace: no-autospace; } </style> <body>
diff --git a/third_party/blink/web_tests/virtual/text-antialias/line-break-8bit-after-16bit.html b/third_party/blink/web_tests/virtual/text-antialias/line-break-8bit-after-16bit.html index 1dd90eb42..ebd20de 100644 --- a/third_party/blink/web_tests/virtual/text-antialias/line-break-8bit-after-16bit.html +++ b/third_party/blink/web_tests/virtual/text-antialias/line-break-8bit-after-16bit.html
@@ -9,6 +9,7 @@ font-family: Ahem, AhemU; font-size: 20px; width: 3ch; + text-autospace: no-autospace; } </style> <body>
diff --git a/third_party/blink/web_tests/webexposed/css-properties-as-js-properties-expected.txt b/third_party/blink/web_tests/webexposed/css-properties-as-js-properties-expected.txt index 229e5f3..b2a25777 100644 --- a/third_party/blink/web_tests/webexposed/css-properties-as-js-properties-expected.txt +++ b/third_party/blink/web_tests/webexposed/css-properties-as-js-properties-expected.txt
@@ -438,6 +438,7 @@ textAlign textAlignLast textAnchor +textAutospace textBoxTrim textCombineUpright textDecoration
diff --git a/third_party/blink/web_tests/webexposed/css-property-listing-expected.txt b/third_party/blink/web_tests/webexposed/css-property-listing-expected.txt index 2168ee8..67b72911 100644 --- a/third_party/blink/web_tests/webexposed/css-property-listing-expected.txt +++ b/third_party/blink/web_tests/webexposed/css-property-listing-expected.txt
@@ -377,6 +377,7 @@ text-align text-align-last text-anchor + text-autospace text-box-trim text-combine-upright text-decoration-color
diff --git a/third_party/blink/web_tests/webexposed/global-interface-listing-dedicated-worker-expected.txt b/third_party/blink/web_tests/webexposed/global-interface-listing-dedicated-worker-expected.txt index 65b50a2..ce7db469 100644 --- a/third_party/blink/web_tests/webexposed/global-interface-listing-dedicated-worker-expected.txt +++ b/third_party/blink/web_tests/webexposed/global-interface-listing-dedicated-worker-expected.txt
@@ -1197,6 +1197,7 @@ [Worker] method mul [Worker] method neg [Worker] method pad +[Worker] method pow [Worker] method prelu [Worker] method reduceMean [Worker] method reduceSum
diff --git a/third_party/blink/web_tests/webexposed/global-interface-listing-expected.txt b/third_party/blink/web_tests/webexposed/global-interface-listing-expected.txt index a2943fc..6400beb 100644 --- a/third_party/blink/web_tests/webexposed/global-interface-listing-expected.txt +++ b/third_party/blink/web_tests/webexposed/global-interface-listing-expected.txt
@@ -5628,6 +5628,7 @@ method mul method neg method pad + method pow method prelu method reduceMean method reduceSum
diff --git a/third_party/cardboard/BUILD.gn b/third_party/cardboard/BUILD.gn index 6d1a2db5..6ed084b 100644 --- a/third_party/cardboard/BUILD.gn +++ b/third_party/cardboard/BUILD.gn
@@ -69,6 +69,7 @@ static_library("cardboard") { sources = [ + "config/opengl_es2_custom_bindings.h", "src/sdk/device_params/android/device_params.cc", "src/sdk/device_params/android/device_params.h", "src/sdk/distortion_mesh.cc", @@ -129,9 +130,15 @@ "src/sdk/util/vector.h", "src/sdk/util/vectorutils.cc", "src/sdk/util/vectorutils.h", + + # TODO(b/299595377): Remove override once changes have been upstreamed. "src_overrides/sdk/cardboard.cc", "src_overrides/sdk/jni_utils/android/jni_utils.cc", + + # TODO(b/299595377): Remove override once changes have been upstreamed. "src_overrides/sdk/qrcode/android/qr_code.cc", + + # TODO(b/299595377): Remove override once changes have been upstreamed. "src_overrides/sdk/rendering/opengl_es2_distortion_renderer.cc", ] @@ -143,7 +150,10 @@ defines = [ "CARDBOARD_USE_CUSTOM_GL_BINDINGS" ] - include_dirs = [ "src/sdk" ] + include_dirs = [ + "config", + "src/sdk", + ] libs = [ "android",
diff --git a/third_party/cardboard/README.chromium b/third_party/cardboard/README.chromium index c5a0f71..6ab0062f 100644 --- a/third_party/cardboard/README.chromium +++ b/third_party/cardboard/README.chromium
@@ -17,5 +17,5 @@ * Created local override for LoadJClass in jni_utils to leaverage //base JNI loading due to splits. * Created local override for LoadJNIResources in qr_code.cc to register native method used by the QR code scanner activity. * Created local override for CardboardQrCode_getSavedDeviceParams function in cardboard.cc to prevent undefined behavior. -* Created local fork of GL ES2 renderer to override GLES2 headers with chromium bindings. - No other code changes except marked by CARDBOARD_USE_CUSTOM_GL_BINDINGS ifdefs. \ No newline at end of file +* Created local override for OpenGL ES 2.0 renderer to include Chromium header with custom bindings. +* Created local configuration header file with the OpenGL ES 2.0 binding customization required by setting the CARDBOARD_USE_CUSTOM_GL_BINDINGS buildflag.
diff --git a/third_party/cardboard/config/DEPS b/third_party/cardboard/config/DEPS new file mode 100644 index 0000000..dbd797ac --- /dev/null +++ b/third_party/cardboard/config/DEPS
@@ -0,0 +1,3 @@ +include_rules = [ + "+ui/gl/gl_bindings.h", +]
diff --git a/third_party/cardboard/config/opengl_es2_custom_bindings.h b/third_party/cardboard/config/opengl_es2_custom_bindings.h new file mode 100644 index 0000000..a9edf29 --- /dev/null +++ b/third_party/cardboard/config/opengl_es2_custom_bindings.h
@@ -0,0 +1,14 @@ +// Copyright 2023 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef THIRD_PARTY_CARDBOARD_CONFIG_OPENGL_ES2_CUSTOM_BINDINGS_H_ +#define THIRD_PARTY_CARDBOARD_CONFIG_OPENGL_ES2_CUSTOM_BINDINGS_H_ + +#include "ui/gl/gl_bindings.h" + +#define glBindFramebuffer glBindFramebufferEXT +#define glDeleteBuffers glDeleteBuffersARB +#define glGenBuffers glGenBuffersARB + +#endif // THIRD_PARTY_CARDBOARD_CONFIG_OPENGL_ES2_CUSTOM_BINDINGS_H_
diff --git a/third_party/cardboard/src_overrides/DEPS b/third_party/cardboard/src_overrides/DEPS index b0eded2..735d8895 100644 --- a/third_party/cardboard/src_overrides/DEPS +++ b/third_party/cardboard/src_overrides/DEPS
@@ -2,5 +2,4 @@ "+base/android/jni_android.h", "+base/android/jni_generator/jni_generator_helper.h", "+third_party/jni_zero/jni_int_wrapper.h", - "+ui/gl/gl_bindings.h", ]
diff --git a/third_party/cardboard/src_overrides/sdk/rendering/opengl_es2_distortion_renderer.cc b/third_party/cardboard/src_overrides/sdk/rendering/opengl_es2_distortion_renderer.cc index 3dd66b6..a2ec4e85 100644 --- a/third_party/cardboard/src_overrides/sdk/rendering/opengl_es2_distortion_renderer.cc +++ b/third_party/cardboard/src_overrides/sdk/rendering/opengl_es2_distortion_renderer.cc
@@ -17,34 +17,24 @@ #include <vector> #ifdef CARDBOARD_USE_CUSTOM_GL_BINDINGS - -#include "ui/gl/gl_bindings.h" - +#include "opengl_es2_custom_bindings.h" #else - #ifdef __ANDROID__ #include <GLES2/gl2.h> -#include <GLES2/gl2ext.h> -#endif // __ANDROID__ - -#endif // CARDBOARD_USE_CUSTOM_GL_BINDINGS - +#endif #ifdef __APPLE__ #include <OpenGLES/ES2/gl.h> #endif +#ifdef __ANDROID__ +#include <GLES2/gl2ext.h> +#endif +#endif // CARDBOARD_USE_CUSTOM_GL_BINDINGS #include "distortion_renderer.h" #include "third_party/cardboard/src/sdk/include/cardboard.h" #include "third_party/cardboard/src/sdk/util/is_arg_null.h" #include "third_party/cardboard/src/sdk/util/is_initialized.h" #include "third_party/cardboard/src/sdk/util/logging.h" - -#ifdef CARDBOARD_USE_CUSTOM_GL_BINDINGS -#define glBindFramebuffer glBindFramebufferEXT -#define glDeleteBuffers glDeleteBuffersARB -#define glGenBuffers glGenBuffersARB -#endif // CARDBOARD_USE_CUSTOM_GL_BINDINGS - namespace { constexpr const char* kDistortionVertexShader =
diff --git a/third_party/cros-components/src b/third_party/cros-components/src index 4c11996..bfe08a0 160000 --- a/third_party/cros-components/src +++ b/third_party/cros-components/src
@@ -1 +1 @@ -Subproject commit 4c11996077fff68dffc03883264a4882ad092cd7 +Subproject commit bfe08a0f31085ed4fe7c336a5c033e43853249db
diff --git a/third_party/dawn b/third_party/dawn index 48a4eab..5784a4b 160000 --- a/third_party/dawn +++ b/third_party/dawn
@@ -1 +1 @@ -Subproject commit 48a4eabdad4985dff82e2dc897d8245a2df4a36f +Subproject commit 5784a4bd7a0ca25ff2ec57a2b9759a34621ba51c
diff --git a/third_party/depot_tools b/third_party/depot_tools index 69e597f..0b94340 160000 --- a/third_party/depot_tools +++ b/third_party/depot_tools
@@ -1 +1 @@ -Subproject commit 69e597f8e5818ed093e01dfd6f3acc2a3142a0de +Subproject commit 0b943400a45966122a123c27f4f290ab309d893a
diff --git a/third_party/devtools-frontend-internal b/third_party/devtools-frontend-internal index 0aedf74..e975ac6 160000 --- a/third_party/devtools-frontend-internal +++ b/third_party/devtools-frontend-internal
@@ -1 +1 @@ -Subproject commit 0aedf7449030cb5c78945e42fca86eb6ca129e2b +Subproject commit e975ac642af4ec9c085f82cbe97686a8daa0ac87
diff --git a/third_party/devtools-frontend/src b/third_party/devtools-frontend/src index a4cc1be..6d7d7d6 160000 --- a/third_party/devtools-frontend/src +++ b/third_party/devtools-frontend/src
@@ -1 +1 @@ -Subproject commit a4cc1be16a5fecf8333afbb0a8bbbd70e09bdd94 +Subproject commit 6d7d7d68a5261f61ea22a032b43bca6ac18fbec6
diff --git a/third_party/perfetto b/third_party/perfetto index fdbd437..747df23 160000 --- a/third_party/perfetto +++ b/third_party/perfetto
@@ -1 +1 @@ -Subproject commit fdbd437367e592937b1c0afa5920a201956912c5 +Subproject commit 747df2371b75facc2a0e8f830c6a7051d47fc07f
diff --git a/third_party/skia b/third_party/skia index ff3c2e3..f1d1fd9 160000 --- a/third_party/skia +++ b/third_party/skia
@@ -1 +1 @@ -Subproject commit ff3c2e3d45bdc793cddc65a3c9fce937b09d1dfd +Subproject commit f1d1fd98c2c18690472a9ce61b74d68bf27e6153
diff --git a/third_party/vulkan-deps b/third_party/vulkan-deps index 1d5140e..acfee4c 160000 --- a/third_party/vulkan-deps +++ b/third_party/vulkan-deps
@@ -1 +1 @@ -Subproject commit 1d5140e06b47428983225f692c2cb25a66a788d6 +Subproject commit acfee4cc4f6ec5726ec546c4324bec66d600d213
diff --git a/third_party/webrtc b/third_party/webrtc index f286c90..f83da9d 160000 --- a/third_party/webrtc +++ b/third_party/webrtc
@@ -1 +1 @@ -Subproject commit f286c902a6be4e5d1fcb63f0c96c8efad340e20b +Subproject commit f83da9dddddf0cfd421688cf68fa26bf3ecadd1d
diff --git a/tools/mb/mb_config.pyl b/tools/mb/mb_config.pyl index 05b31d0e..0b5a10f 100644 --- a/tools/mb/mb_config.pyl +++ b/tools/mb/mb_config.pyl
@@ -547,9 +547,6 @@ }, 'chromium.goma': { - 'Chromium Android ARM 32-bit Goma RBE Staging': 'android_release_bot_minimal_symbols', - # TODO(b/167942918): re-enable java goma? - 'Chromium Linux Goma RBE Staging': 'release_bot', 'Chromium Linux Goma RBE Staging (dbg)': 'debug_bot', @@ -573,9 +570,6 @@ 'Win Builder Goma RBE ATS Canary': 'gpu_tests_release_bot_x86_minimal_symbols', 'Win Builder Goma RBE Canary': 'gpu_tests_release_bot_x86_minimal_symbols', - 'android-archive-dbg-goma-rbe-ats-canary': 'android_without_codecs_debug_bot', - 'android-archive-dbg-goma-rbe-canary': 'android_without_codecs_debug_bot', - 'chromeos-amd64-generic-rel-goma-rbe-canary': 'chromeos_amd64-generic_use_fake_dbus_clients_vm_optimized_goma', 'ios-device-goma-rbe-canary-clobber': 'ios_device_release_compile_only', @@ -1807,10 +1801,6 @@ 'official_optimize_reclient_trybot', 'android_without_codecs', 'full_symbols', ], - 'android_release_bot_minimal_symbols': [ - 'android', 'release_bot', 'minimal_symbols', 'strip_debug_info', - ], - 'android_release_bot_minimal_symbols_arm64_fastbuild_webview_trichrome_reclient': [ 'android', 'release_bot_reclient', 'minimal_symbols', 'arm64', 'strip_debug_info', 'android_fastbuild', 'webview_trichrome', @@ -1963,10 +1953,6 @@ 'android', 'debug_static_bot_reclient', 'arm64', 'webview_google', ], - 'android_without_codecs_debug_bot': [ - 'android_without_codecs', 'debug_bot', - ], - 'android_without_codecs_debug_bot_reclient': [ 'android_without_codecs', 'debug_bot_reclient', ],
diff --git a/tools/mb/mb_config_expectations/chromium.goma.fyi.json b/tools/mb/mb_config_expectations/chromium.goma.fyi.json index ce9f924..0877b7b 100644 --- a/tools/mb/mb_config_expectations/chromium.goma.fyi.json +++ b/tools/mb/mb_config_expectations/chromium.goma.fyi.json
@@ -76,26 +76,6 @@ "use_goma": true } }, - "android-archive-dbg-goma-rbe-ats-canary": { - "gn_args": { - "debuggable_apks": false, - "is_component_build": true, - "is_debug": true, - "symbol_level": 1, - "target_os": "android", - "use_goma": true - } - }, - "android-archive-dbg-goma-rbe-canary": { - "gn_args": { - "debuggable_apks": false, - "is_component_build": true, - "is_debug": true, - "symbol_level": 1, - "target_os": "android", - "use_goma": true - } - }, "chromeos-amd64-generic-rel-goma-rbe-canary": { "args_file": "//build/args/chromeos/amd64-generic-vm.gni", "gn_args": {
diff --git a/tools/mb/mb_config_expectations/chromium.goma.json b/tools/mb/mb_config_expectations/chromium.goma.json index a61015b..75c8b4b 100644 --- a/tools/mb/mb_config_expectations/chromium.goma.json +++ b/tools/mb/mb_config_expectations/chromium.goma.json
@@ -1,18 +1,4 @@ { - "Chromium Android ARM 32-bit Goma RBE Staging": { - "gn_args": { - "dcheck_always_on": false, - "debuggable_apks": false, - "ffmpeg_branding": "Chrome", - "is_component_build": false, - "is_debug": false, - "proprietary_codecs": true, - "strip_debug_info": true, - "symbol_level": 1, - "target_os": "android", - "use_goma": true - } - }, "Chromium Linux Goma RBE Staging": { "gn_args": { "dcheck_always_on": false,
diff --git a/tools/metrics/histograms/enums.xml b/tools/metrics/histograms/enums.xml index 5db3eb68..5e54140 100644 --- a/tools/metrics/histograms/enums.xml +++ b/tools/metrics/histograms/enums.xml
@@ -17818,6 +17818,13 @@ <int value="8" label="REQUEST_JOB_FETCH"/> </enum> +<enum name="CloudProvider"> + <int value="0" label="None"/> + <int value="1" label="Unknown"/> + <int value="2" label="Google Drive"/> + <int value="3" label="OneDrive"/> +</enum> + <enum name="ClusterFilterReason"> <int value="0" label="Not filtered"/> <int value="1" label="Not enough visits with images"/> @@ -20451,29 +20458,12 @@ <int value="2" label="Cache miss"/> </enum> -<enum name="CorbCanonicalMimeType"> - <summary>Coarse MIME type classification for CORB decisions.</summary> - <int value="0" label="Html"> - https://mimesniff.spec.whatwg.org/#html-mime-type. - </int> - <int value="1" label="Xml"> - https://mimesniff.spec.whatwg.org/#xml-mime-type, except `image/svg+xml` and - `application/dash+xml`. - </int> - <int value="2" label="Json"> - https://mimesniff.spec.whatwg.org/#json-mime-type. - </int> - <int value="3" label="Plain">text/plain</int> - <int value="4" label="Others"> - Other, unrecognized MIME type. Blocked if sniffing finds a JSON security - prefix. - </int> - <int value="5" label="NeverSniffed"> - Used for content types that are unlikely to be incorrectly applied to - images, scripts and other legacy no-cors resources (which consequently don't - need any confimation sniffing). For example: `application/pdf`, - `application/zip`, etc. - </int> +<enum name="CopyStackEvent"> + <int value="0" label="Started"/> + <int value="1" label="Succeeded"/> + <int value="2" label="Sigaction failed"/> + <int value="3" label="Tgkill failed"/> + <int value="4" label="Wait failed"/> </enum> <enum name="CorbResultVsInitiatorLockCompatibility"> @@ -23309,14 +23299,6 @@ label="Ad Creative Origin Differs from Main Frame and Ad Not Throttled"/> </enum> -<enum name="CrossOriginProtectionDecision"> - <int value="0" label="kAllow"/> - <int value="1" label="kBlock"/> - <int value="2" label="kNeedToSniffMore"/> - <int value="3" label="kAllowedAfterSniffing"/> - <int value="4" label="kBlockedAfterSniffing"/> -</enum> - <enum name="CrossProcessTimeDelta"> <int value="0" label="Normal time delta measured"/> <int value="1" label="Unexpectedly negative time delta measured"/> @@ -33911,6 +33893,7 @@ <int value="1166" label="DeviceExtendedFkeysModifier"/> <int value="1167" label="UnaffiliatedDeviceArcAllowed"/> <int value="1168" label="RelatedWebsiteSetsOverrides"/> + <int value="1169" label="ShowHumanPresenceSensorScreenEnabled"/> </enum> <enum name="EnterprisePoliciesSources"> @@ -56230,6 +56213,15 @@ <int value="2" label="Close Tab"/> </enum> +<enum name="IOSOpenExtensionOutcome"> + <int value="0" label="Open Extension Success"/> + <int value="1" label="Open Extension Invalid outcome"/> + <int value="2" label="Open Extension Invalid URL"/> + <int value="3" label="Open Extension URL not found"/> + <int value="4" label="Open Extension Method not found"/> + <int value="5" label="Open Extension Unsupported scheme"/> +</enum> + <enum name="IOSOpenInDownloadResult"> <int value="0" label="Download Succeeded"/> <int value="1" label="Download Canceled"> @@ -67359,6 +67351,7 @@ <int value="1096477444" label="AssistantVoiceMatch:enabled"/> <int value="1097935876" label="CrostiniShowMicSetting:enabled"/> <int value="1097981222" label="OneGoogleBarModalOverlays:disabled"/> + <int value="1098461149" label="AppToAppLinkCapturing:disabled"/> <int value="1098610349" label="UseHDRTransferFunction:disabled"/> <int value="1098823967" label="ash-enable-window-cycle-ui"/> <int value="1100048827" label="BluetoothWbsDogfood:enabled"/> @@ -68888,6 +68881,7 @@ <int value="1831777433" label="query-tiles-rank-tiles"/> <int value="1831835753" label="MaterialDesignIncognitoNTP:enabled"/> <int value="1832552562" label="EnableVirtualKeyboardUkm:enabled"/> + <int value="1832889721" label="AppToAppLinkCapturing:enabled"/> <int value="1833124619" label="PhoneHubNudge:enabled"/> <int value="1833340282" label="SmartSuggestionForLargeDownloads:enabled"/> <int value="1833845461" label="OverviewDeskNavigation:disabled"/> @@ -69058,6 +69052,7 @@ <int value="1910240042" label="enable-experimental-fullscreen-exit-ui"/> <int value="1910562940" label="SharedHighlightingRefinedBlocklist:disabled"/> <int value="1911002680" label="TFLiteLanguageDetectionEnabled:enabled"/> + <int value="1911558169" label="AppToAppLinkCapturingWorkspaceApps:enabled"/> <int value="1911623289" label="OmniboxFocusTriggersSRPZeroSuggest:disabled"/> <int value="1913263516" label="OculusVR:enabled"/> <int value="1913298816" label="OverlayScrollbar:enabled"/> @@ -69336,6 +69331,7 @@ <int value="2043141918" label="DnsOverHttps:enabled"/> <int value="2043321329" label="OfflinePagesPrefetchingUI:disabled"/> <int value="2043794900" label="CommercePriceTracking:enabled"/> + <int value="2043970520" label="AppToAppLinkCapturingWorkspaceApps:disabled"/> <int value="2044243615" label="AccessibilitySelectToSpeakContextMenuOption:disabled"/> <int value="2044623453" label="DeferredShaping:disabled"/> @@ -71239,6 +71235,7 @@ <int value="773" label="mask-clip"/> <int value="774" label="mask-size"/> <int value="775" label="mask-origin"/> + <int value="776" label="text-spacing"/> </enum> <enum name="MappedEditingCommands"> @@ -77979,6 +77976,9 @@ <int value="171" label="Multi Capture On Login"/> <int value="172" label="Floating Workspace"/> <int value="173" label="Scalable IPH"/> + <int value="174" label="After Update Notification"/> + <int value="175" label="Sub Apps Uninstall"/> + <int value="176" label="Network Carrier Unlock"/> </enum> <enum name="NotificationDatabaseStatus"> @@ -100864,14 +100864,6 @@ <int value="5" label="NeverSniffed"/> </enum> -<enum name="SiteIsolationResponseAction"> - <int value="0" label="Response started"/> - <int value="1" label="Response blocked without sniffing"/> - <int value="2" label="Response blocked after sniffing"/> - <int value="3" label="Response allowed without sniffing"/> - <int value="4" label="Response allowed after sniffing"/> -</enum> - <enum name="SiteLayout"> <summary>See Android.RequestDesktopSite.Changed</summary> <int value="0" label="Mobile"/>
diff --git a/tools/metrics/histograms/metadata/file/histograms.xml b/tools/metrics/histograms/metadata/file/histograms.xml index bdeeff99..962b6f5 100644 --- a/tools/metrics/histograms/metadata/file/histograms.xml +++ b/tools/metrics/histograms/metadata/file/histograms.xml
@@ -1162,6 +1162,18 @@ </summary> </histogram> +<histogram name="FileBrowser.OfficeFiles.Open.CloudProvider" + enum="CloudProvider" expires_after="M124"> + <owner>simmonsjosh@google.com</owner> + <owner>src/ui/file_manager/OWNERS</owner> + <summary> + Chrome OS File Browser: Records the cloud provider used when opening a file. + Record Google Drive or OneDrive cloud provider if a file is being opened + with Drive web or Microsoft 365, respectively. Record Unknown if an unknown + cloud provider is used and record None if no cloud provider used. + </summary> +</histogram> + <histogram name="FileBrowser.OfficeFiles.Open.FileType.{CloudProvider}" enum="OfficeOpenExtensions" expires_after="M124"> <owner>simmonsjosh@google.com</owner>
diff --git a/tools/metrics/histograms/metadata/histogram_suffixes_list.xml b/tools/metrics/histograms/metadata/histogram_suffixes_list.xml index 406f938..f65be21 100644 --- a/tools/metrics/histograms/metadata/histogram_suffixes_list.xml +++ b/tools/metrics/histograms/metadata/histogram_suffixes_list.xml
@@ -1095,17 +1095,6 @@ <affected-histogram name="Search.ContextualSearchQuickActions.ResultsSeen"/> </histogram_suffixes> -<histogram_suffixes name="CORBProtectionDecision" separator="."> - <suffix name="BlockedAfterSniffingWithRangeSupport" - label="Here the CORB protection decision was kBlockedAfterSniffing."/> - <suffix name="BlockedWithRangeSupport" - label="Here the CORB protection decision was kBlock."/> - <affected-histogram - name="SiteIsolation.CORBProtection.CacheHeuristic.ProtectedMimeType"/> - <affected-histogram - name="SiteIsolation.CORBProtection.CORSHeuristic.ProtectedMimeType"/> -</histogram_suffixes> - <histogram_suffixes name="Cras_ClientType" separator="."> <suffix name="ARC" label="A client created by ARC++."/> <suffix name="ARCVM" label="A client created by ARCVM."/> @@ -1917,15 +1906,6 @@ <affected-histogram name="ChromeOS.HardwareVerifier.Report"/> </histogram_suffixes> -<histogram_suffixes name="HeuristicType" separator="." ordering="prefix,2"> - <suffix name="CacheHeuristic" - label="In this case the response satisfies the Cache heuristic."/> - <suffix name="CORSHeuristic" - label="In this case the response satisfies the CORS heuristic."/> - <affected-histogram - name="SiteIsolation.CORBProtection.ProtectedMimeType.BlockedWithoutSniffing.HasNoSniff"/> -</histogram_suffixes> - <histogram_suffixes name="HiddenWhileFlushing" separator="."> <suffix name="HiddenWhileFlushing" label="Tab hidden while flushing FCP value."/> @@ -2355,19 +2335,6 @@ name="Memory.Experimental.Renderer.HighestPrivateMemoryFootprint"/> </histogram_suffixes> -<histogram_suffixes name="MimeTypeBucket" separator="."> - <suffix name="OtherMimeType" - label="A MIME type that doesn't fall into either of the other two - categories."/> - <suffix name="ProtectedMimeType" - label="A MIME type we expect CORB to protect (i.e. JSON, HTML or XML)."/> - <suffix name="PublicMimeType" - label="A MIME type we consider public (i.e. javascript or an image - type)."/> - <affected-histogram name="SiteIsolation.CORBProtection.CacheHeuristic"/> - <affected-histogram name="SiteIsolation.CORBProtection.CORSHeuristic"/> -</histogram_suffixes> - <histogram_suffixes name="MixedContentDownloadDownloadSecurity" separator="."> <suffix name="DownloadInsecure" label=""/> <suffix name="DownloadSecure" label=""/>
diff --git a/tools/metrics/histograms/metadata/ios/histograms.xml b/tools/metrics/histograms/metadata/ios/histograms.xml index 35fe234..b58919a 100644 --- a/tools/metrics/histograms/metadata/ios/histograms.xml +++ b/tools/metrics/histograms/metadata/ios/histograms.xml
@@ -1790,6 +1790,17 @@ </summary> </histogram> +<histogram name="IOS.OpenInExtensionOutcome" enum="IOSOpenExtensionOutcome" + expires_after="2024-09-29"> + <owner>aliaaborhamy@google.com</owner> + <owner>olivierrobin@chromium.org</owner> + <owner>bling-team@google.com</owner> + <summary> + The outcome of the Open Extension. Logged on the next Chrome startup. May be + undercounted if Open Extension is often used without opening Chrome. + </summary> +</histogram> + <histogram name="IOS.OverflowMenu.ActionType" enum="IOSOverflowMenuActionType" expires_after="2024-02-11"> <owner>rkgibson@google.com</owner>
diff --git a/tools/metrics/histograms/metadata/security/histograms.xml b/tools/metrics/histograms/metadata/security/histograms.xml index dda1790..260e0f4 100644 --- a/tools/metrics/histograms/metadata/security/histograms.xml +++ b/tools/metrics/histograms/metadata/security/histograms.xml
@@ -725,95 +725,6 @@ </summary> </histogram> -<histogram base="true" name="SiteIsolation.CORBProtection.CacheHeuristic" - enum="CrossOriginProtectionDecision" expires_after="M83"> - <owner>krstnmnlsn@chromium.org</owner> - <owner>creis@chromium.org</owner> - <summary> - The blocking decision CORB would have made on the response, if the request - was cross-origin. Reported if the response looked sensitive under the cache - heuristic (i.e. had Cache-Control: Private and Vary: Origin response - headers). - </summary> -</histogram> - -<histogram base="true" - name="SiteIsolation.CORBProtection.CacheHeuristic.ProtectedMimeType" - enum="BooleanSupported" expires_after="M83"> -<!-- suffixed with Block*WithRangeSupport --> - - <owner>krstnmnlsn@chromium.org</owner> - <owner>creis@chromium.org</owner> - <summary> - True if the response has an Accept-Ranges header, which indicates the server - supports range requests on the resource and could be used to bypass CORB. - Only reported if the resource looked sensitive under the Cache heuristic and - was a protected MIME type. - </summary> -</histogram> - -<histogram base="true" name="SiteIsolation.CORBProtection.CORSHeuristic" - enum="CrossOriginProtectionDecision" expires_after="M83"> - <owner>krstnmnlsn@chromium.org</owner> - <owner>creis@chromium.org</owner> - <summary> - The blocking decision CORB would have made on the response, if the request - was cross-origin. Reported if the response looked sensitive under the CORS - heuristic (i.e. had the Access-Control-Allow-Origin header with a value - other than * or null). - </summary> -</histogram> - -<histogram base="true" - name="SiteIsolation.CORBProtection.CORSHeuristic.ProtectedMimeType" - enum="BooleanSupported" expires_after="M83"> -<!-- suffixed with Block*WithRangeSupport --> - - <owner>krstnmnlsn@chromium.org</owner> - <owner>creis@chromium.org</owner> - <summary> - True if the response has an Accept-Ranges header, which indicates the server - supports range requests on the resource and could be used to bypass CORB. - Only reported if the resource looked sensitive under the CORS heuristic and - was a protected MIME type. - </summary> -</histogram> - -<histogram base="true" - name="SiteIsolation.CORBProtection.ProtectedMimeType.BlockedWithoutSniffing.HasNoSniff" - enum="BooleanHasNoSniff" expires_after="M83"> - <owner>krstnmnlsn@chromium.org</owner> - <owner>creis@chromium.org</owner> - <summary> - True if the response has a nosniff header. If the nosniff header is not - present, then CORB must have decided to block without sniffing due to a - partial response, or because the MIME type was a never sniff type. Only - reported on resources CORB would have blocked/protected without sniffing - that have a protected MIME type. - </summary> -</histogram> - -<histogram name="SiteIsolation.CORBProtection.SensitiveResource" - enum="BooleanSensitive" expires_after="M83"> - <owner>krstnmnlsn@chromium.org</owner> - <owner>creis@chromium.org</owner> - <summary> - True if the resource was found to be sensitive by either the CORS or Cache - heuristics. Recorded for every resource CORB sees. - </summary> -</histogram> - -<histogram name="SiteIsolation.CORBProtection.SensitiveWithRangeSupport" - enum="BooleanSupported" expires_after="M83"> - <owner>krstnmnlsn@chromium.org</owner> - <owner>creis@chromium.org</owner> - <summary> - True if the response has an Accept-Ranges header, which indicates the server - supports range requests on the resource. Only reported if the response - looked sensitive under the cache or CORS heuristics. - </summary> -</histogram> - <histogram name="SiteIsolation.IsolatableSandboxedIframes" units="processes" expires_after="2024-03-17"> <owner>wjmaclean@chromium.org</owner> @@ -1100,28 +1011,6 @@ </summary> </histogram> -<histogram name="SiteIsolation.XSD.Browser.Action" - enum="SiteIsolationResponseAction" expires_after="2020-06-01"> - <owner>creis@chromium.org</owner> - <owner>lukasza@chromium.org</owner> - <summary> - Various actions related to cross-site document blocking in the browser - process, indicating whether the response was blocked from the renderer. - Recorded as the response is processed in the network stack. - </summary> -</histogram> - -<histogram name="SiteIsolation.XSD.Browser.Blocked.CanonicalMimeType" - enum="CorbCanonicalMimeType" expires_after="M81"> - <owner>creis@chromium.org</owner> - <owner>lukasza@chromium.org</owner> - <summary> - The total count of responses that were blocked by the cross-site document - blocking logic in the browser process. Recorded with a canonical MIME type - when the response is blocked. - </summary> -</histogram> - </histograms> </histogram-configuration>
diff --git a/tools/perf/core/perfetto_binary_roller/binary_deps.json b/tools/perf/core/perfetto_binary_roller/binary_deps.json index 1150195..cc2024c 100644 --- a/tools/perf/core/perfetto_binary_roller/binary_deps.json +++ b/tools/perf/core/perfetto_binary_roller/binary_deps.json
@@ -21,8 +21,8 @@ "full_remote_path": "perfetto-luci-artifacts/v35.0/mac-arm64/trace_processor_shell" }, "linux": { - "hash": "7ac2139118b6351f19f78e60c9811235e5533afc", - "full_remote_path": "chromium-telemetry/perfetto_binaries/trace_processor_shell/linux/fdbd437367e592937b1c0afa5920a201956912c5/trace_processor_shell" + "hash": "943f110d980630f5f6c90ea949d91f5fb91af126", + "full_remote_path": "chromium-telemetry/perfetto_binaries/trace_processor_shell/linux/5b9a46ce4f61f691de75495b02fbf20a3e8e9fc5/trace_processor_shell" } }, "power_profile.sql": {
diff --git a/tools/search_engine_choice/generate_search_engine_icons.py b/tools/search_engine_choice/generate_search_engine_icons.py index b6f8929..d3e181db 100644 --- a/tools/search_engine_choice/generate_search_engine_icons.py +++ b/tools/search_engine_choice/generate_search_engine_icons.py
@@ -102,7 +102,7 @@ print('Error occurred while deleting files in ' + directory_path) -def get_largest_icon_index_and_size(icon_path): +def get_largest_icon_index_and_size(icon_path, name): """Fetches the index and size of largest icon in the .ico file. Some .ico files contain more than 1 icon. The function finds the largest icon @@ -127,7 +127,7 @@ # The image size is the integer before the 'x' character. sizes = image_dimensions.split('x') if sizes[0] != sizes[1]: - print('Warning: Icon %s is not square' % icon_path) + print('Warning: Icon for %s is not square' % name) image_size = int(sizes[0]) if image_size > max_image_size: max_image_size = image_size @@ -141,9 +141,9 @@ Reads the json file and downloads the icons that are referenced in the "favicon_url" section of the search_engine. - Scales those icons to 24x24 and 48x48 formats and converts them to PNG - format. After finishing the previous step, the function moves the icons to - their corresponding directories. + Scales those icons down to 48x48 size and converts them to PNG format. After + finishing the previous step, the function moves the icons to the destination + directory and runs png optimization. The function filters the search engines based on the search engines that are used in `template_url_prepopulate_data.cc` so that icons that are never used don't get downloaded. @@ -156,14 +156,12 @@ """ print('Creating icons from json file...') prepopulated_engines_file_path = '../search_engines/prepopulated_engines.json' - default_100_path = './default_100_percent/search_engine_choice/' - default_200_path = './default_200_percent/search_engine_choice/' - icon_sizes = [24, 48] + image_destination_path = './default_100_percent/search_engine_choice/' + icon_sizes = [48] favicon_hash_to_icon_name = {} # Delete the previously added search engine icons - delete_files_in_directory(default_100_path) - delete_files_in_directory(default_200_path) + delete_files_in_directory(image_destination_path) with open(prepopulated_engines_file_path, 'r', encoding='utf-8') as engines_json: @@ -205,23 +203,21 @@ os.remove('original.ico') continue - (largest_index, - largest_size) = get_largest_icon_index_and_size('original.ico') + (largest_index, largest_size) = get_largest_icon_index_and_size( + 'original.ico', icon_name) # Using ImageMagick command line interface, scale the icons, convert # them to PNG format and move them to their corresponding folders. last_size = 0 - for icon_size in icon_sizes: + for desired_size in icon_sizes: if largest_size >= last_size: + last_size = desired_size + desired_size = min(desired_size, largest_size) os.system('convert original.ico[' + str(largest_index) + - '] -thumbnail ' + str(icon_size) + 'x' + str(icon_size) + - ' ' + icon_name + '.png') - icon_destination = default_100_path - if icon_size == 48: - icon_destination = default_200_path + '] -thumbnail ' + str(desired_size) + 'x' + + str(desired_size) + ' ' + icon_name + '.png') - shutil.move(icon_name + '.png', icon_destination) - last_size = icon_size + shutil.move(icon_name + '.png', image_destination_path) engine_keyword_to_icon_name[search_engine_keyword] = icon_name favicon_hash_to_icon_name[icon_hash] = icon_name @@ -236,8 +232,8 @@ # default icon in that case. engine_keyword_to_icon_name[search_engine_keyword] = '' continue - os.system('../../tools/resources/optimize-png-files.sh ' + default_100_path) - os.system('../../tools/resources/optimize-png-files.sh ' + default_200_path) + os.system('../../tools/resources/optimize-png-files.sh ' + + image_destination_path) def generate_icon_resource_code():
diff --git a/ui/file_manager/BUILD.gn b/ui/file_manager/BUILD.gn index ab26ceb..74c0bf0e 100644 --- a/ui/file_manager/BUILD.gn +++ b/ui/file_manager/BUILD.gn
@@ -180,6 +180,7 @@ composite = true path_mappings = [ + "chrome-extension://pmfjbimdmchhbnneeidfognadeopoehp/*|preprocessed/image_loader/*", "tslib|" + rebase_path( "//third_party/material_web_components/components-chromium/node_modules/tslib/tslib.d.ts", target_gen_dir),
diff --git a/ui/file_manager/file_manager/background/js/BUILD.gn b/ui/file_manager/file_manager/background/js/BUILD.gn index b23a797..5b3ddd2 100644 --- a/ui/file_manager/file_manager/background/js/BUILD.gn +++ b/ui/file_manager/file_manager/background/js/BUILD.gn
@@ -70,16 +70,16 @@ ":runtime_loaded_test_util", "//ui/file_manager:js_from_ts", ] - closure_flags = - strict_error_checking_closure_args + [ - "language_in=ECMASCRIPT_2020", - "js_module_root=./gen/ui/file_manager/tsc", - "js_module_root=./gen/ui", - "js_module_root=" + rebase_path("//ui", root_build_dir), - "browser_resolver_prefix_replacements=\"chrome://webui-test/=./\"", - "hide_warnings_for=third_party/", - "hide_warnings_for=gen/ui/file_manager/tsc/", - ] + closure_flags = strict_error_checking_closure_args + [ + "language_in=ECMASCRIPT_2020", + "js_module_root=./gen/ui/file_manager/tsc", + "js_module_root=./gen/ui", + "js_module_root=" + rebase_path("//ui", root_build_dir), + "browser_resolver_prefix_replacements=\"chrome://webui-test/=./\"", + "hide_warnings_for=third_party/", + "hide_warnings_for=gen/ui/file_manager/tsc/", + "browser_resolver_prefix_replacements=\"chrome-extension://pmfjbimdmchhbnneeidfognadeopoehp/=./image_loader/\"", + ] } js_library("file_manager_base") {
diff --git a/ui/file_manager/file_manager/common/js/BUILD.gn b/ui/file_manager/file_manager/common/js/BUILD.gn index 9cf7fce9..5033a8d9 100644 --- a/ui/file_manager/file_manager/common/js/BUILD.gn +++ b/ui/file_manager/file_manager/common/js/BUILD.gn
@@ -327,15 +327,16 @@ ":volume_manager_types_unittest", ] - closure_flags = - strict_error_checking_closure_args + [ - "language_in=ECMASCRIPT_2020", - "js_module_root=./gen/ui/file_manager/tsc/", - "js_module_root=./gen/ui/file_manager/", - "js_module_root=" + rebase_path("//ui/file_manager", root_build_dir), - "browser_resolver_prefix_replacements=\"chrome://webui-test/=./\"", - "hide_warnings_for=third_party/", - "hide_warnings_for=gen/ui/file_manager/tsc/", - ] + closure_flags = strict_error_checking_closure_args + [ + "language_in=ECMASCRIPT_2020", + "js_module_root=./gen/ui/file_manager/tsc/", + "js_module_root=./gen/ui/file_manager/", + "js_module_root=" + + rebase_path("//ui/file_manager", root_build_dir), + "browser_resolver_prefix_replacements=\"chrome://webui-test/=./\"", + "hide_warnings_for=third_party/", + "hide_warnings_for=gen/ui/file_manager/tsc/", + "browser_resolver_prefix_replacements=\"chrome-extension://pmfjbimdmchhbnneeidfognadeopoehp/=./image_loader/\"", + ] extra_deps = [ "//ui/file_manager:js_from_ts" ] }
diff --git a/ui/file_manager/file_manager/common/js/metrics.ts b/ui/file_manager/file_manager/common/js/metrics.ts index 91d14c4..78ea7ff 100644 --- a/ui/file_manager/file_manager/common/js/metrics.ts +++ b/ui/file_manager/file_manager/common/js/metrics.ts
@@ -155,7 +155,8 @@ * @param validValues Array of valid values or a boundary number * (one-past-the-end) value. */ -export function recordEnum(name: string, value: any, validValues: any[]) { +export function recordEnum( + name: string, value: any, validValues: readonly any[]) { console.assert(validValues !== undefined); let index = validValues.indexOf(value);
diff --git a/ui/file_manager/file_manager/common/js/util.js b/ui/file_manager/file_manager/common/js/util.js index ea52a61b..9fdb100 100644 --- a/ui/file_manager/file_manager/common/js/util.js +++ b/ui/file_manager/file_manager/common/js/util.js
@@ -436,9 +436,9 @@ /** * Compares two entries. - * @param {Entry|FilesAppEntry} entry1 The entry to be compared. Can + * @param {Entry|FilesAppEntry|undefined} entry1 The entry to be compared. Can * be a fake. - * @param {Entry|FilesAppEntry} entry2 The entry to be compared. Can + * @param {Entry|FilesAppEntry|undefined} entry2 The entry to be compared. Can * be a fake. * @return {boolean} True if the both entry represents a same file or * directory. Returns true if both entries are null. @@ -921,7 +921,7 @@ /** * Returns the localized/i18n name of the entry. * - * @param {EntryLocation} locationInfo + * @param {?EntryLocation} locationInfo * @param {!Entry|!FilesAppEntry} entry The entry to be retrieve the name of. * @return {string} The localized name. */
diff --git a/ui/file_manager/file_manager/foreground/elements/BUILD.gn b/ui/file_manager/file_manager/foreground/elements/BUILD.gn index 80a3c18..247d8e5 100644 --- a/ui/file_manager/file_manager/foreground/elements/BUILD.gn +++ b/ui/file_manager/file_manager/foreground/elements/BUILD.gn
@@ -27,18 +27,15 @@ js_type_check("closure_compile_jsmodules") { is_polymer3 = true - closure_flags = - default_closure_args + [ - "language_in=ECMASCRIPT_2020", - "js_module_root=gen/ui/file_manager/", - "js_module_root=" + rebase_path("//ui/file_manager/", root_build_dir), - ] + closure_flags = default_closure_args + [ + "language_in=ECMASCRIPT_2020", + "js_module_root=gen/ui/file_manager/", + "js_module_root=" + + rebase_path("//ui/file_manager/", root_build_dir), + "browser_resolver_prefix_replacements=\"chrome-extension://pmfjbimdmchhbnneeidfognadeopoehp/=./image_loader/\"", + ] deps = [ ":files_format_dialog", - ":files_metadata_box", - ":files_metadata_entry", - ":files_quick_view", - ":files_safe_media", ":files_spinner", ":xf_button", ":xf_circular_progress", @@ -51,10 +48,6 @@ visibility += [ "//ui/file_manager/*" ] js_files = [ "files_format_dialog.js", - "files_metadata_box.js", - "files_metadata_entry.js", - "files_quick_view.js", - "files_safe_media.js", "files_spinner.js", "icons.js", "xf_button.js", @@ -82,47 +75,18 @@ ] } -js_library("files_metadata_box") { - deps = [ - "//third_party/polymer/v3_0/components-chromium/polymer:polymer_bundled", - ] -} - -js_library("files_metadata_entry") { - deps = [ - "//third_party/polymer/v3_0/components-chromium/polymer:polymer_bundled", - ] -} - -js_library("files_quick_view") { - deps = [ - ":files_metadata_box", - ":files_safe_media", - "//ash/webui/common/resources:assert", - "//third_party/polymer/v3_0/components-chromium/polymer:polymer_bundled", - ] - externs_list = [ - "$externs_path/chrome_extensions.js", - "//ui/file_manager/file_manager/externs/polymer_elements/files_tooltip.js", - ] -} - -js_library("files_safe_media") { - deps = [ - "//ash/webui/common/resources:assert", - "//third_party/polymer/v3_0/components-chromium/polymer:polymer_bundled", - ] - externs_list = [ "//ui/file_manager/file_manager/externs/quick_view.js" ] -} - js_library("files_spinner") { } html_to_wrapper("polymer_elements") { visibility += [ "//ui/file_manager/*" ] in_files = [ + "files_metadata_box.html", "files_toast.html", "files_tooltip.html", + "files_safe_media.html", + "files_quick_view.html", + "files_metadata_entry.html", ] scheme = "relative" minify = true
diff --git a/ui/file_manager/file_manager/foreground/elements/files_metadata_box.html b/ui/file_manager/file_manager/foreground/elements/files_metadata_box.html index 6822017..ce43934 100644 --- a/ui/file_manager/file_manager/foreground/elements/files_metadata_box.html +++ b/ui/file_manager/file_manager/foreground/elements/files_metadata_box.html
@@ -80,19 +80,19 @@ <div hidden="[[!hasFileSpecificMetadata_]]"> <hr> - <div class="category" hidden="[[!isImage_(type)]]">$i18n{METADATA_BOX_IMAGE_INFO}</div> - <div class="category" hidden="[[!isAudio_(type)]]">$i18n{METADATA_BOX_AUDIO_INFO}</div> - <div class="category" hidden="[[!isVideo_(type)]]">$i18n{METADATA_BOX_VIDEO_INFO}</div> - <files-metadata-entry key="$i18n{METADATA_BOX_DIMENSION}" value="[[dimension_(imageWidth, imageHeight)]]"></files-metadata-entry> + <div class="category" hidden="[[!isImage(type)]]">$i18n{METADATA_BOX_IMAGE_INFO}</div> + <div class="category" hidden="[[!isAudio(type)]]">$i18n{METADATA_BOX_AUDIO_INFO}</div> + <div class="category" hidden="[[!isVideo(type)]]">$i18n{METADATA_BOX_VIDEO_INFO}</div> + <files-metadata-entry key="$i18n{METADATA_BOX_DIMENSION}" value="[[dimension(imageWidth, imageHeight)]]"></files-metadata-entry> <files-metadata-entry key="$i18n{METADATA_BOX_ALBUM_TITLE}" value="[[mediaAlbum]]"></files-metadata-entry> <files-metadata-entry key="$i18n{METADATA_BOX_MEDIA_TITLE}" value="[[mediaTitle]]"></files-metadata-entry> <files-metadata-entry key="$i18n{METADATA_BOX_MEDIA_ARTIST}" value="[[mediaArtist]]"></files-metadata-entry> - <files-metadata-entry key="$i18n{METADATA_BOX_DURATION}" value="[[time2string_(mediaDuration)]]"></files-metadata-entry> + <files-metadata-entry key="$i18n{METADATA_BOX_DURATION}" value="[[time2string(mediaDuration)]]"></files-metadata-entry> <files-metadata-entry key="$i18n{METADATA_BOX_GENRE}" value="[[mediaGenre]]"></files-metadata-entry> <files-metadata-entry key="$i18n{METADATA_BOX_TRACK}" value="[[mediaTrack]]"></files-metadata-entry> - <files-metadata-entry key="$i18n{METADATA_BOX_EXIF_DEVICE_MODEL}" value="[[deviceModel_(ifd)]]"></files-metadata-entry> - <files-metadata-entry key="$i18n{METADATA_BOX_EXIF_DEVICE_SETTINGS}" value="[[deviceSettings_(ifd)]]"></files-metadata-entry> - <files-metadata-entry key="$i18n{METADATA_BOX_EXIF_GEOGRAPHY}" value="[[geography_(ifd)]]"></files-metadata-entry> + <files-metadata-entry key="$i18n{METADATA_BOX_EXIF_DEVICE_MODEL}" value="[[deviceModel(ifd)]]"></files-metadata-entry> + <files-metadata-entry key="$i18n{METADATA_BOX_EXIF_DEVICE_SETTINGS}" value="[[deviceSettings(ifd)]]"></files-metadata-entry> + <files-metadata-entry key="$i18n{METADATA_BOX_EXIF_GEOGRAPHY}" value="[[geography(ifd)]]"></files-metadata-entry> <files-metadata-entry key="$i18n{METADATA_BOX_YEAR_RECORDED}" value="[[mediaYearRecorded]]"></files-metadata-entry> </div> </div>
diff --git a/ui/file_manager/file_manager/foreground/elements/files_metadata_box.js b/ui/file_manager/file_manager/foreground/elements/files_metadata_box.js deleted file mode 100644 index 403df01..0000000 --- a/ui/file_manager/file_manager/foreground/elements/files_metadata_box.js +++ /dev/null
@@ -1,382 +0,0 @@ -// Copyright 2016 The Chromium Authors -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -import './files_metadata_entry.js'; - -import {html, Polymer} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js'; - -Polymer({ - _template: html`{__html_template__}`, - - is: 'files-metadata-box', - - properties: { - // File path and type, e.g. image, video. - filePath: String, - type: String, - - // File size, modification time, mimeType, location. - size: String, - modificationTime: String, - mediaMimeType: String, - fileLocation: String, - - // True if the size field is loading. - isSizeLoading: Boolean, - - // File-specific metadata. - /** @type {?Object} */ - ifd: Object, - imageWidth: Number, - imageHeight: Number, - mediaAlbum: String, - mediaArtist: String, - mediaDuration: Number, - mediaGenre: String, - mediaTitle: String, - mediaTrack: String, - mediaYearRecorded: String, - originalLocation: String, - - /** - * True if the file has file-specific metadata. - * @private - */ - hasFileSpecificMetadata_: Boolean, - - /** - * FilesMetadataBox [metadata] attribute. Used to indicate the metadata box - * field rendering phases. - * @private - */ - metadata: { - type: String, - reflectToAttribute: true, - }, - }, - - /** - * Clears fields. - * @param {boolean} keepSizeFields do not clear size and isSizeLoading fields. - */ - clear: function(keepSizeFields) { - const reset = { - type: '', - filePath: '', - modificationTime: '', - hasFileSpecificMetadata_: false, - mediaMimeType: '', - fileLocation: '', - ifd: null, - imageWidth: 0, - imageHeight: 0, - mediaTitle: '', - mediaArtist: '', - mediaAlbum: '', - mediaDuration: 0, - mediaGenre: '', - mediaTrack: '', - mediaYearRecorded: '', - metadata: '', - originalLocation: '', - }; - - if (!keepSizeFields) { - reset.isSizeLoading = false; - reset.size = ''; - } - - this.setProperties(reset); - }, - - /** - * @param {string} type - * @return {boolean} - * - * @private - */ - isImage_: function(type) { - return type === 'image'; - }, - - /** - * @param {string} type - * @return {boolean} - * - * @private - */ - isVideo_: function(type) { - return type === 'video'; - }, - - /** - * @param {string} type - * @return {boolean} - * - * @private - */ - isAudio_: function(type) { - return type === 'audio'; - }, - - /** - * If the originalLocation is set, the preview is for a trashed item. - * @returns {boolean} - */ - isTrashEntry: function(originalLocation) { - return !(originalLocation && originalLocation.length > 0); - }, - - /** - * Sets this.hasFileSpecificMetadata_ if there is file-specific metadata. - * @return {boolean} - * - * @private - */ - setFileSpecificMetadata_: function() { - this.hasFileSpecificMetadata_ = - !!(this.imageWidth && this.imageHeight || this.mediaTitle || - this.mediaArtist || this.mediaAlbum || this.mediaDuration || - this.mediaGenre || this.mediaTrack || this.mediaYearRecorded || - this.ifd); - return this.hasFileSpecificMetadata_; - }, - - /** - * Sets the file |type| field based on setFileSpecificMetadata_(). - * @public - */ - setFileTypeInfo: function(type) { - this.type = this.setFileSpecificMetadata_() ? type : ''; - }, - - /** - * Update the metadata attribute with the rendered metadata |type|. - * @param {?string} type - * @public - */ - metadataRendered: function(type) { - if (!type) { - this.metadata = ''; - } else if (!this.metadata) { - this.metadata = type; - } else { - this.metadata += ' ' + type; - } - }, - - /** - * Converts the duration into human friendly string. - * @param {number} time the duration in seconds. - * @return {string} String representation of the given duration. - */ - time2string_: function(time) { - if (!time) { - return ''; - } - - time = parseInt(time, 10); - const seconds = time % 60; - const minutes = Math.floor(time / 60) % 60; - const hours = Math.floor(time / 60 / 60); - - if (hours === 0) { - return minutes + ':' + ('0' + seconds).slice(-2); - } - return hours + ':' + ('0' + minutes).slice(-2) + ('0' + seconds).slice(-2); - }, - - /** - * @param {number} imageWidth - * @param {number} imageHeight - * @return {string} - * - * @private - */ - dimension_: function(imageWidth, imageHeight) { - if (imageWidth && imageHeight) { - return imageWidth + ' x ' + imageHeight; - } - return ''; - }, - - /** - * @param {?Object} ifd - * @return {string} - * - * @private - */ - deviceModel_: function(ifd) { - if (!ifd) { - return ''; - } - - if (ifd['raw']) { - return ifd['raw']['cameraModel'] || ''; - } - - const id = 272; - const model = (ifd.image && ifd.image[id] && ifd.image[id].value) || ''; - return model.replace(/\0+$/, '').trim(); - }, - - /** - * @param {Array<String>} r array of two strings representing the numerator - * and the denominator. - * @return {number} - * @private - */ - parseRational_: function(r) { - const num = parseInt(r[0], 10); - const den = parseInt(r[1], 10); - return num / den; - }, - - /** - * Returns geolocation as a string in the form of 'latitude, longitude', - * where the values have 3 decimal precision. Negative latitude indicates - * south latitude and negative longitude indicates west longitude. - * @param {?Object} ifd - * @return {string} - * - * @private - */ - geography_: function(ifd) { - const gps = ifd && ifd.gps; - if (!gps || !gps[1] || !gps[2] || !gps[3] || !gps[4]) { - return ''; - } - - const computeCoordinate = value => { - return this.parseRational_(value[0]) + - this.parseRational_(value[1]) / 60 + - this.parseRational_(value[2]) / 3600; - }; - - const latitude = - computeCoordinate(gps[2].value) * (gps[1].value === 'N\0' ? 1 : -1); - const longitude = - computeCoordinate(gps[4].value) * (gps[3].value === 'E\0' ? 1 : -1); - - return Number(latitude).toFixed(3) + ', ' + Number(longitude).toFixed(3); - }, - - /** - * Returns device settings as a string containing the fNumber, exposureTime, - * focalLength, and isoSpeed. Example: 'f/2.8 0.008 23mm ISO4000'. - * @param {?Object} ifd - * @return {string} - * - * @private - */ - deviceSettings_: function(ifd) { - let result = ''; - - if (ifd && ifd['raw']) { - result = this.rawDeviceSettings_(ifd['raw']); - } else if (ifd) { - result = this.ifdDeviceSettings_(ifd); - } - - return result; - }, - - /** - * @param {!Object} raw - * @return {string} - * - * @private - */ - rawDeviceSettings_: function(raw) { - let result = ''; - - const aperture = raw['aperture'] || 0; - if (aperture) { - result += 'f/' + aperture + ' '; - } - - const exposureTime = raw['exposureTime'] || 0; - if (exposureTime) { - result += exposureTime + ' '; - } - - const focalLength = raw['focalLength'] || 0; - if (focalLength) { - result += focalLength + 'mm '; - } - - const isoSpeed = raw['isoSpeed'] || 0; - if (isoSpeed) { - result += 'ISO' + isoSpeed + ' '; - } - - return result.trimEnd(); - }, - - /** - * @param {!Object} ifd - * @return {string} - * - * @private - */ - ifdDeviceSettings_: function(ifd) { - const exif = ifd['exif']; - if (!exif) { - return ''; - } - - /** - * @param {Object} field Exif field to be parsed as a number. - * @return {number} - */ - function parseExifNumber(field) { - let number = 0; - - if (field && field.value) { - if (Array.isArray(field.value)) { - const denominator = parseInt(field.value[1], 10); - if (denominator) { - number = parseInt(field.value[0], 10) / denominator; - } - } else { - number = parseInt(field.value, 10); - } - - if (Number.isNaN(number)) { - number = 0; - } else if (!Number.isInteger(number)) { - number = Number(number.toFixed(3).replace(/0+$/, '')); - } - } - - return number; - } - - let result = ''; - - const aperture = parseExifNumber(exif[33437]); - if (aperture) { - result += 'f/' + aperture + ' '; - } - - const exposureTime = parseExifNumber(exif[33434]); - if (exposureTime) { - result += exposureTime + ' '; - } - - const focalLength = parseExifNumber(exif[37386]); - if (focalLength) { - result += focalLength + 'mm '; - } - - const isoSpeed = parseExifNumber(exif[34855]); - if (isoSpeed) { - result += 'ISO' + isoSpeed + ' '; - } - - return result.trimEnd(); - }, -}); - -//# sourceURL=//ui/file_manager/file_manager/foreground/elements/files_metadata_box.js
diff --git a/ui/file_manager/file_manager/foreground/elements/files_metadata_box.ts b/ui/file_manager/file_manager/foreground/elements/files_metadata_box.ts new file mode 100644 index 0000000..336d984b --- /dev/null +++ b/ui/file_manager/file_manager/foreground/elements/files_metadata_box.ts
@@ -0,0 +1,407 @@ +// Copyright 2016 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +import './files_metadata_entry.js'; + +import {PolymerElement} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js'; + +import {Exif} from '../js/metadata/exif_constants.js'; + +import {getTemplate} from './files_metadata_box.html.js'; + +export interface FilesMetadataBox { + // File path and type, e.g. image, video. + filePath: string; + type: string; + + // File size, modification time, mimeType, location. + size?: string; + modificationTime: string; + mediaMimeType: string; + fileLocation: string; + + // True if the size field is loading. + isSizeLoading?: boolean; + + // File-specific metadata. + ifd?: Ifd; + imageWidth: number; + imageHeight: number; + mediaAlbum: string; + mediaArtist: string; + mediaDuration: number; + mediaGenre: string; + mediaTitle: string; + mediaTrack: string; + mediaYearRecorded: string; + originalLocation: string; + + hasFileSpecificMetadata_: boolean; + metadata: string; +} + +type LatLongArray = [[number, number], [number, number], [number, number]]; + +// GPS Data as per https://exiv2.org/tags.html. +interface ExifData<T> { + id: number; + format: number; + componentCount: number; + value: T; +} + +type ExifRationalData = ExifData<[number, number]>; + +export interface RawIfd { + cameraMaker: string; + cameraModel: string; + aperture: number; + focalLength: number; + exposureTime: number; + isoSpeed: number; + width: number; + height: number; + orientation: number; + colorSpace: string; + date: string; +} + +interface Ifd { + raw?: RawIfd; + image?: {[K in Exif.Tag]: {value: string}}; + gps?: [ + ExifData<[number, number, number, number]>, // GPS Version number. + ExifData<string>, // Latitude reference (i.e. N or S). + ExifData<LatLongArray>, // Latitude in degrees, minutes, and + // seconds. + ExifData<string>, // Longtitude reference (i.e. E or W). + ExifData<LatLongArray>, // Longtitude in degrees, minutes, and + // seconds. + ]; + exif?: { + 33437: ExifRationalData, // Aperture. + 33434: ExifRationalData, // Exposure time. + 37386: ExifRationalData, // Focal length. + 34855: ExifRationalData, // ISO Speed. + }; +} + +export class FilesMetadataBox extends PolymerElement { + static get is() { + return 'files-metadata-box'; + } + + static get template() { + return getTemplate(); + } + + static get properties() { + return { + // File path and type, e.g. image, video. + filePath: String, + type: String, + + // File size, modification time, mimeType, location. + size: String, + modificationTime: String, + mediaMimeType: String, + fileLocation: String, + + // True if the size field is loading. + isSizeLoading: Boolean, + + // File-specific metadata. + ifd: Object, + imageWidth: Number, + imageHeight: Number, + mediaAlbum: String, + mediaArtist: String, + mediaDuration: Number, + mediaGenre: String, + mediaTitle: String, + mediaTrack: String, + mediaYearRecorded: String, + originalLocation: String, + + /** + * True if the file has file-specific metadata. + */ + hasFileSpecificMetadata_: Boolean, + + /** + * FilesMetadataBox [metadata] attribute. Used to indicate the + * metadata box field rendering phases. + */ + metadata: { + type: String, + reflectToAttribute: true, + }, + }; + } + + + /** + * Clears fields. + * + * @param keepSizeFields Do not clear size and isSizeLoading fields. + */ + clear(keepSizeFields: boolean) { + const reset: Partial<FilesMetadataBox> = { + type: '', + filePath: '', + modificationTime: '', + hasFileSpecificMetadata_: false, + mediaMimeType: '', + fileLocation: '', + imageWidth: 0, + imageHeight: 0, + mediaTitle: '', + mediaArtist: '', + mediaAlbum: '', + mediaDuration: 0, + mediaGenre: '', + mediaTrack: '', + mediaYearRecorded: '', + metadata: '', + originalLocation: '', + }; + + if (!keepSizeFields) { + reset.isSizeLoading = false; + reset.size = ''; + } + + this.setProperties(reset); + } + + isImage(type: string) { + return type === 'image'; + } + + isVideo(type: string) { + return type === 'video'; + } + + isAudio(type: string) { + return type === 'audio'; + } + + /** + * If the originalLocation is set, the preview is for a trashed item. + */ + isTrashEntry(originalLocation: string|undefined) { + return !(originalLocation && originalLocation.length > 0); + } + + /** + * Sets this.hasFileSpecificMetadata_ if there is file-specific metadata. + */ + private setFileSpecificMetadata_() { + this.hasFileSpecificMetadata_ = + !!(this.imageWidth && this.imageHeight || this.mediaTitle || + this.mediaArtist || this.mediaAlbum || this.mediaDuration || + this.mediaGenre || this.mediaTrack || this.mediaYearRecorded || + this.ifd); + return this.hasFileSpecificMetadata_; + } + + /** + * Sets the file |type| field based on setFileSpecificMetadata_(). + */ + setFileTypeInfo(type: string) { + this.type = this.setFileSpecificMetadata_() ? type : ''; + } + + /** + * Update the metadata attribute with the rendered metadata |type|. + */ + metadataRendered(type?: string) { + if (!type) { + this.metadata = ''; + } else if (!this.metadata) { + this.metadata = type; + } else { + this.metadata += ' ' + type; + } + } + + /** + * Converts the duration into human friendly string. + */ + time2string(time: string) { + if (!time) { + return ''; + } + + const parsedTime = parseInt(time, 10); + const seconds = parsedTime % 60; + const minutes = Math.floor(parsedTime / 60) % 60; + const hours = Math.floor(parsedTime / 60 / 60); + + if (hours === 0) { + return minutes + ':' + ('0' + seconds).slice(-2); + } + return hours + ':' + ('0' + minutes).slice(-2) + ('0' + seconds).slice(-2); + } + + dimension(imageWidth: number, imageHeight: number) { + if (imageWidth && imageHeight) { + return imageWidth + ' x ' + imageHeight; + } + return ''; + } + + deviceModel(ifd: Ifd) { + if (!ifd) { + return ''; + } + + if (ifd.raw) { + return ifd.raw.cameraModel || ''; + } + + const id = 272; + const model = (ifd.image && ifd.image[id] && ifd.image[id].value) || ''; + return model.replace(/\0+$/, '').trim(); + } + + /** + * @param r An array of two strings representing the numerator and the + * denominator. + */ + private parseRational_(r: [number, number]) { + const num = parseInt(r[0].toString(), 10); + const den = parseInt(r[1].toString(), 10); + return num / den; + } + + /** + * Returns geolocation as a string in the form of 'latitude, longitude', + * where the values have 3 decimal precision. Negative latitude indicates + * south latitude and negative longitude indicates west longitude. + */ + geography(ifd: Ifd) { + const gps = ifd && ifd.gps; + if (!gps || !gps[1] || !gps[2] || !gps[3] || !gps[4]) { + return ''; + } + + const computeCoordinate = (value: LatLongArray) => { + return this.parseRational_(value[0]) + + this.parseRational_(value[1]) / 60 + + this.parseRational_(value[2]) / 3600; + }; + + const latitude = + computeCoordinate(gps[2].value) * (gps[1].value === 'N\0' ? 1 : -1); + const longitude = + computeCoordinate(gps[4].value) * (gps[3].value === 'E\0' ? 1 : -1); + + return Number(latitude).toFixed(3) + ', ' + Number(longitude).toFixed(3); + } + + /** + * Returns device settings as a string containing the fNumber, exposureTime, + * focalLength, and isoSpeed. Example: 'f/2.8 0.008 23mm ISO4000'. + */ + deviceSettings(ifd: Ifd) { + let result = ''; + + if (ifd && ifd.raw) { + result = this.rawDeviceSettings_(ifd.raw); + } else if (ifd) { + result = this.ifdDeviceSettings_(ifd); + } + + return result; + } + + private rawDeviceSettings_(raw: Ifd['raw']) { + let result = ''; + + const aperture = raw?.aperture || 0; + if (aperture) { + result += 'f/' + aperture + ' '; + } + + const exposureTime = raw?.exposureTime || 0; + if (exposureTime) { + result += exposureTime + ' '; + } + + const focalLength = raw?.focalLength || 0; + if (focalLength) { + result += focalLength + 'mm '; + } + + const isoSpeed = raw?.isoSpeed || 0; + if (isoSpeed) { + result += 'ISO' + isoSpeed + ' '; + } + + return result.trimEnd(); + } + + private ifdDeviceSettings_(ifd: Ifd) { + const exif = ifd.exif; + if (!exif) { + return ''; + } + + function parseExifNumber(field: ExifRationalData) { + let number = 0; + + if (field && field.value) { + if (Array.isArray(field.value)) { + const denominator = parseInt(field.value[1].toString(), 10); + if (denominator) { + number = parseInt(field.value[0].toString(), 10) / denominator; + } + } else { + number = parseInt(field.value, 10); + } + + if (Number.isNaN(number)) { + number = 0; + } else if (!Number.isInteger(number)) { + number = Number(number.toFixed(3).replace(/0+$/, '')); + } + } + + return number; + } + + let result = ''; + + const aperture = parseExifNumber(exif[33437]); + if (aperture) { + result += 'f/' + aperture + ' '; + } + + const exposureTime = parseExifNumber(exif[33434]); + if (exposureTime) { + result += exposureTime + ' '; + } + + const focalLength = parseExifNumber(exif[37386]); + if (focalLength) { + result += focalLength + 'mm '; + } + + const isoSpeed = parseExifNumber(exif[34855]); + if (isoSpeed) { + result += 'ISO' + isoSpeed + ' '; + } + + return result.trimEnd(); + } +} + +declare global { + interface HTMLElementTagNameMap { + 'files-metadata-box': FilesMetadataBox; + } +} + +customElements.define(FilesMetadataBox.is, FilesMetadataBox);
diff --git a/ui/file_manager/file_manager/foreground/elements/files_metadata_entry.js b/ui/file_manager/file_manager/foreground/elements/files_metadata_entry.js deleted file mode 100644 index 3c21e16..0000000 --- a/ui/file_manager/file_manager/foreground/elements/files_metadata_entry.js +++ /dev/null
@@ -1,73 +0,0 @@ -// Copyright 2016 The Chromium Authors -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -import {html, Polymer} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js'; - -Polymer({ - _template: html`{__html_template__}`, - - is: 'files-metadata-entry', - - properties: { - key: { - type: String, - reflectToAttribute: true, - }, - - // If |value| is empty, the entire entry will be hidden. - value: { - type: String, - reflectToAttribute: true, - observer: 'valueChanged_', - }, - - loading: { - type: Boolean, - reflectToAttribute: true, - value: false, - }, - - isPath: { - type: Boolean, - value: false, - }, - }, - - /** - * When value is changed, it is displayed in the #valueContainer element. - * How the value is represented depends on [[isPath]] value. - * @param {string} newValue - */ - valueChanged_: function(newValue) { - const container = this.$.valueContainer; - if (!newValue) { - container.textContent = ''; - return; - } - if (this.isPath) { - // Divide path 'foo/bar/baz.png' to ['foo', 'bar', 'baz.png'] and - // append corresponding span elements (<span>foo/</span> etc...) in the - // container. - // - // Note that, if the container's children are - // <span>foo/</span><span>bar/</span><span>baz.png</span>, - // container.textContent evaluates to 'foo/bar/baz.png'. That's why the - // container.textContent is still equal to [[value]] regardless of - // [[isPath]] and integration tests verifying element's textContent won't - // be affected. - container.textContent = ''; - const components = newValue.split('/'); - for (let i = 0; i < components.length; i++) { - const span = document.createElement('span'); - span.textContent = - i < components.length - 1 ? (components[i] + '/') : components[i]; - container.appendChild(span); - } - } else { - container.textContent = newValue; - } - }, -}); - -//# sourceURL=//ui/file_manager/file_manager/foreground/elements/files_metadata_entry.js
diff --git a/ui/file_manager/file_manager/foreground/elements/files_metadata_entry.ts b/ui/file_manager/file_manager/foreground/elements/files_metadata_entry.ts new file mode 100644 index 0000000..b5b83a5 --- /dev/null +++ b/ui/file_manager/file_manager/foreground/elements/files_metadata_entry.ts
@@ -0,0 +1,96 @@ +// Copyright 2016 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +import {PolymerElement} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js'; + +import {getTemplate} from './files_metadata_entry.html.js'; + +export interface FilesMetadataEntry { + $: { + valueContainer: HTMLDivElement, + }; + isPath: boolean; + loading: boolean; + value: string; + key: string; +} + +export class FilesMetadataEntry extends PolymerElement { + static get is() { + return 'files-metadata-entry'; + } + + static get template() { + return getTemplate(); + } + + static get properties() { + return { + key: { + type: String, + reflectToAttribute: true, + }, + + // If |value| is empty, the entire entry will be hidden. + value: { + type: String, + reflectToAttribute: true, + observer: 'valueChanged', + }, + + loading: { + type: Boolean, + reflectToAttribute: true, + value: false, + }, + + isPath: { + type: Boolean, + value: false, + }, + }; + } + + /** + * When value is changed, it is displayed in the #valueContainer element. + * How the value is represented depends on [[isPath]] value. + */ + valueChanged(newValue: string) { + const container = this.$.valueContainer; + if (!newValue) { + container.textContent = ''; + return; + } + if (this.isPath) { + // Divide path 'foo/bar/baz.png' to ['foo', 'bar', 'baz.png'] and + // append corresponding span elements (<span>foo/</span> etc...) in the + // container. + // + // Note that, if the container's children are + // <span>foo/</span><span>bar/</span><span>baz.png</span>, + // container.textContent evaluates to 'foo/bar/baz.png'. That's why the + // container.textContent is still equal to [[value]] regardless of + // [[isPath]] and integration tests verifying element's textContent won't + // be affected. + container.textContent = ''; + const components = newValue.split('/'); + for (let i = 0; i < components.length; i++) { + const span = document.createElement('span'); + span.textContent = + i < components.length - 1 ? (components[i] + '/') : components[i]!; + container.appendChild(span); + } + } else { + container.textContent = newValue; + } + } +} + +declare global { + interface HTMLElementTagNameMap { + 'files-metadata-entry': FilesMetadataEntry; + } +} + +customElements.define(FilesMetadataEntry.is, FilesMetadataEntry);
diff --git a/ui/file_manager/file_manager/foreground/elements/files_quick_view.html b/ui/file_manager/file_manager/foreground/elements/files_quick_view.html index 3ea6b7c..2627c3ab 100644 --- a/ui/file_manager/file_manager/foreground/elements/files_quick_view.html +++ b/ui/file_manager/file_manager/foreground/elements/files_quick_view.html
@@ -8,7 +8,7 @@ <link rel="stylesheet" href="foreground/css/common.css"> <link rel="stylesheet" href="foreground/elements/files_quick_view.css"> -<dialog id="dialog" on-close="onDialogClose_"> +<dialog id="dialog" on-close="onDialogClose"> <div id="toolbar"> <div class="buttons-group"> <cr-button id="back-button" on-click="close" aria-label="$i18n{QUICK_VIEW_CLOSE_BUTTON_LABEL}" has-tooltip invert-tooltip> @@ -18,28 +18,28 @@ </div> <div id="file-path">[[filePath]]</div> <div class="buttons-group"> - <cr-button id="open-button" on-click="onOpenInNewButtonTap" hidden$="[[!shouldShowOpenButton_(hasTask, isModal)]]" aria-label="$i18n{QUICK_VIEW_OPEN_IN_NEW_BUTTON_LABEL}" has-tooltip invert-tooltip> + <cr-button id="open-button" on-click="onOpenInNewButtonClick" hidden$="[[!shouldShowOpenButton(hasTask, isModal)]]" aria-label="$i18n{QUICK_VIEW_OPEN_IN_NEW_BUTTON_LABEL}" has-tooltip invert-tooltip> <span class="icon">$i18n{QUICK_VIEW_OPEN_IN_NEW_BUTTON_LABEL}</span> </cr-button> - <cr-button id="delete-button" on-click="onDeleteButtonTap" hidden$="[[!shouldShowDeleteButton_(canDelete, isModal)]]" aria-label="$i18n{QUICK_VIEW_DELETE_BUTTON_LABEL}" has-tooltip invert-tooltip> + <cr-button id="delete-button" on-click="onDeleteButtonClick" hidden$="[[!shouldShowDeleteButton(canDelete, isModal)]]" aria-label="$i18n{QUICK_VIEW_DELETE_BUTTON_LABEL}" has-tooltip invert-tooltip> <span class="icon"></span> </cr-button> - <cr-button id="info-button" on-click="onMetadataButtonTap_" aria-pressed="{{metadataBoxActive}}" aria-label="$i18n{QUICK_VIEW_TOGGLE_METADATA_BOX_BUTTON_LABEL}" has-tooltip invert-tooltip> + <cr-button id="info-button" on-click="onMetadataButtonClick" aria-pressed="{{metadataBoxActive}}" aria-label="$i18n{QUICK_VIEW_TOGGLE_METADATA_BOX_BUTTON_LABEL}" has-tooltip invert-tooltip> <span class="icon"></span> </cr-button> </div> </div> <div id="mainPanel"> - <div id="contentPanel" metadata-box-active$="[[metadataBoxActive]]" on-tap="onContentPanelTap_"> + <div id="contentPanel" metadata-box-active$="[[metadataBoxActive]]" on-tap="onContentPanelClick"> <div id="innerContentPanel" type$="[[type]]"> <!-- PDF, Text --> <template is="dom-if" if="[[browsable]]"> - <iframe id="untrusted" style="color: transparent; background: transparent; width: 100%; height: 100%; border: 0px;" on-load="refreshUntrustedIframe_" class="content text-content" src="chrome-untrusted://file-manager/untrusted_resources/files_browsable_content.html"></iframe> + <iframe id="untrusted" style="color: transparent; background: transparent; width: 100%; height: 100%; border: 0px;" on-load="refreshUntrustedIframe" class="content text-content" src="chrome-untrusted://file-manager/untrusted_resources/files_browsable_content.html"></iframe> </template> <!-- document/HTML --> - <template is="dom-if" if="[[isHtml_(type, subtype)]]"> - <files-safe-media hidden="[[!hasContent_(sourceContent)]]" type="html" class="content text-content" src="[[sourceContent]]"></files-safe-media> - <template is="dom-if" if="[[!hasContent_(sourceContent)]]"> + <template is="dom-if" if="[[isHtml(type, subtype)]]"> + <files-safe-media hidden="[[!hasContent(sourceContent)]]" type="html" class="content text-content" src="[[sourceContent]]"></files-safe-media> + <template is="dom-if" if="[[!hasContent(sourceContent)]]"> <div class="no-preview-container"> <div generic-thumbnail="[[type]]"></div> <div class="no-preview">[[noPreviewText]]</div> @@ -47,9 +47,9 @@ </template> </template> <!-- Image --> - <template is="dom-if" if="[[isImage_(type)]]"> - <files-safe-media hidden="[[!hasContent_(sourceContent)]]" type="image" class="content no-close-on-click" src="[[sourceContent]]"></files-safe-media> - <template is="dom-if" if="[[!hasContent_(sourceContent)]]"> + <template is="dom-if" if="[[isImage(type)]]"> + <files-safe-media hidden="[[!hasContent(sourceContent)]]" type="image" class="content no-close-on-click" src="[[sourceContent]]"></files-safe-media> + <template is="dom-if" if="[[!hasContent(sourceContent)]]"> <div class="no-preview-container"> <div generic-thumbnail="image"></div> <div class="no-preview">[[noPreviewText]]</div> @@ -57,8 +57,8 @@ </template> </template> <!-- Video --> - <template is="dom-if" if="[[isVideo_(type)]]"> - <template is="dom-if" if="[[!hasContent_(sourceContent)]]"> + <template is="dom-if" if="[[isVideo(type)]]"> + <template is="dom-if" if="[[!hasContent(sourceContent)]]"> <div class="thumbnail" hidden="[[!videoPoster]]"> <files-safe-media type="image" id="video-poster" src="[[videoPoster]]"></files-safe-media> </div> @@ -67,28 +67,28 @@ <div class="no-preview">[[noPlaybackText]]</div> </div> </template> - <template is="dom-if" if="[[hasContent_(sourceContent)]]"> + <template is="dom-if" if="[[hasContent(sourceContent)]]"> <files-safe-media id="videoSafeMedia" tabindex="0" type="video" class="content no-close-on-click" controls autoplay="[[autoplay]]" src="[[sourceContent]]" poster="[[videoPoster]]"></files-safe-media> </template> </template> <!-- Audio --> - <template is="dom-if" if="[[isAudio_(type)]]"> - <template is="dom-if" if="[[hasContent_(audioArtwork)]]"> + <template is="dom-if" if="[[isAudio(type)]]"> + <template is="dom-if" if="[[hasContent(audioArtwork)]]"> <files-safe-media type="image" id="audio-artwork" class="no-close-on-click" src="[[audioArtwork]]"></files-safe-media> </template> </template> <div> - <files-safe-media tabindex="0" type="audio" class="no-close-on-click" controls autoplay="[[autoplay]]" src="[[audioContent_(sourceContent, type)]]" hidden="[[!isAudio_(type)]]"></files-safe-media> + <files-safe-media tabindex="0" type="audio" class="no-close-on-click" controls autoplay="[[autoplay]]" src="[[audioContent(sourceContent, type)]]" hidden="[[!isAudio(type)]]"></files-safe-media> </div> - <template is="dom-if" if="[[isAudio_(type)]]"> - <template is="dom-if" if="[[!hasContent_(sourceContent)]]"> + <template is="dom-if" if="[[isAudio(type)]]"> + <template is="dom-if" if="[[!hasContent(sourceContent)]]"> <div class="no-preview-container"> <div generic-thumbnail="audio"></div> <div class="no-preview">[[noPlaybackText]]</div> </div> </template> </template> - <div class="no-preview-container" hidden="[[!isUnsupported_(type, subtype, browsable)]]"> + <div class="no-preview-container" hidden="[[!isUnsupported(type, subtype, browsable)]]"> <div generic-thumbnail$="[[type]]"></div> <div class="no-preview">[[noPreviewText]]</div> </div>
diff --git a/ui/file_manager/file_manager/foreground/elements/files_quick_view.js b/ui/file_manager/file_manager/foreground/elements/files_quick_view.js deleted file mode 100644 index 299580c..0000000 --- a/ui/file_manager/file_manager/foreground/elements/files_quick_view.js +++ /dev/null
@@ -1,349 +0,0 @@ -// Copyright 2016 The Chromium Authors -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -import 'chrome://resources/cr_elements/cr_button/cr_button.js'; -import 'chrome://resources/polymer/v3_0/iron-icon/iron-icon.js'; -import './files_metadata_box.js'; -import './files_safe_media.js'; -import './icons.js'; - -import {assert} from 'chrome://resources/ash/common/assert.js'; -import {html, Polymer} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js'; - -import {toSandboxedURL} from '../../common/js/url_constants.js'; - -import {FilesSafeMedia} from './files_safe_media.js'; - -export const FilesQuickView = Polymer({ - _template: html`{__html_template__}`, - - is: 'files-quick-view', - - properties: { - // File media type, e.g. image, video. - type: String, - subtype: String, - filePath: String, - - // True if there is a file task that can open the file type. - hasTask: Boolean, - - /** - * True if the entry shown in Quick View can be deleted. - * @type {boolean} - */ - canDelete: Boolean, - - /** - * Preview content to be sent rendered in a sandboxed environment. - * @type {!FilePreviewContent} - */ - sourceContent: { - type: Object, - observer: 'refreshUntrustedIframe_', - }, - - videoPoster: String, - audioArtwork: String, - - // Autoplay property for audio, video. - autoplay: Boolean, - - // True if this file is not image, audio, video or HTML, but is supported - // by Chrome - content that is directly preview-able in Chrome by setting - // the untrusted <iframe> src attribute. Examples: pdf, text. - browsable: Boolean, - - // The metadata-box-active-changed event is fired on attribute change. - metadataBoxActive: { - value: true, - type: Boolean, - notify: true, - }, - - // Text shown when there is no playback/preview available. - noPlaybackText: String, - noPreviewText: String, - - /** - * True if the Files app window is a dialog, e.g. save-as or open-with. - * @type {boolean} - */ - isModal: Boolean, - }, - - listeners: { - 'files-safe-media-tap-inside': 'tapInside', - 'files-safe-media-tap-outside': 'close', - 'files-safe-media-load-error': 'loaderror', - }, - - /** - * Send browsable preview content (i.e. content that can be displayed by the - * browser directly e.g. PDF/text) to the chrome-untrusted:// <iframe>. - */ - refreshUntrustedIframe_: function() { - if (!this.browsable) { - return; - } - - const iframe = this.shadowRoot.querySelector('#untrusted'); - if (!iframe) { - return; - } - - const data = { - browsable: this.browsable, - subtype: this.subtype, - sourceContent: this.sourceContent, - }; - - iframe.contentWindow.postMessage(data, toSandboxedURL().origin); - }, - - // Clears fields. - clear: function() { - this.setProperties({ - type: '', - subtype: '', - filePath: '', - hasTask: false, - canDelete: false, - sourceContent: { - data: null, - dataType: '', - }, - videoPoster: '', - audioArtwork: '', - autoplay: false, - browsable: false, - }); - - // Remove the video's untrusted <iframe> child. The <iframe> contains the - // <video> element. Removing the <iframe> removes the <video>: that stops - // the video and its audio track playing: crbug.com/970192 - const video = /** @type {?FilesSafeMedia} */ - (this.$.contentPanel.querySelector('#videoSafeMedia')); - if (video) { - video.src = /** @type {!FilePreviewContent} */ ({ - data: null, - dataType: '', - }); - } - - this.removeAttribute('load-error'); - }, - - // Handle load error from the files-safe-media container. - loaderror: function() { - this.setAttribute('load-error', ''); - this.sourceContent = /** @type {!FilePreviewContent} */ ({ - data: null, - dataType: '', - }); - }, - - /** @return {boolean} */ - isOpened: function() { - return this.$.dialog.open; - }, - - // Opens the dialog. - open: function() { - if (!this.isOpened()) { - this.$.dialog.showModal(); - // Make dialog focusable and set focus to a dialog. This is how we can - // prevent default behaviour of a dialog which by default sets focus to - // the first input inside itself. When a dialog gains focus we remove - // focusability to prevent selecting dialog when moving with a keyboard. - this.$.dialog.setAttribute('tabindex', '0'); - this.$.dialog.focus(); - this.$.dialog.setAttribute('tabindex', '-1'); - } - }, - - // Closes the dialog. - close: function() { - if (this.isOpened()) { - this.$.dialog.close(); - } - }, - - tapInside: function(e) { - if (this.type === 'image') { - const dialog = this.shadowRoot.querySelector('#dialog'); - dialog.focus(); - } - }, - - /** - * @return {!FilesMetadataBoxElement} - */ - getFilesMetadataBox: function() { - return /** @type {!FilesMetadataBoxElement} */ (this.$['metadata-box']); - }, - - /** - * Client should assign the function to open the file. - * - * @param {!Event} event - */ - onOpenInNewButtonTap: function(event) {}, - - /** - * @param {boolean} hasTask - * @param {boolean} isModal - * @return {boolean} - * - * @private - */ - shouldShowOpenButton_: function(hasTask, isModal) { - return hasTask && !isModal; - }, - - /** - * Client should assign the function to delete the file. - * - * @param {!Event} event - */ - onDeleteButtonTap: function(event) {}, - - /** - * @param {boolean} canDelete - * @param {boolean} isModal - * @return {boolean} - * - * @private - */ - shouldShowDeleteButton_: function(canDelete, isModal) { - return canDelete && !isModal; - }, - - /** - * See the changes on crbug.com/641587, but crbug.com/779044#c11 later undid - * that work. So the focus remains on the metadata button when clicked after - * the crbug.com/779044 "ghost focus" fix. - * - * crbug.com/641587 mentions a different UI behavior, that was wanted to fix - * that bug. TODO(files-ng): UX to resolve the correct behavior needed here. - * - * @param {!Event} event tap event. - * - * @private - */ - onMetadataButtonTap_: function(event) { - this.metadataBoxActive = !this.metadataBoxActive; - }, - - /** - * Close Quick View unless the clicked target or its ancestor contains - * 'no-close-on-click' class. - * - * @param {!Event} event tap event. - * - * @private - */ - onContentPanelTap_: function(event) { - let target = event.detail.sourceEvent.target; - while (target) { - if (target.classList.contains('no-close-on-click')) { - return; - } - target = target.parentElement; - } - this.close(); - }, - - /** - * @param {!FilePreviewContent} sourceContent - * @return {boolean} - * - * @private - */ - hasContent_: function(sourceContent) { - return sourceContent.dataType !== ''; - }, - - /** - * @param {string} type - * @param {string} subtype - * @return {boolean} - * - * @private - */ - isHtml_: function(type, subtype) { - return type === 'document' && subtype === 'HTML'; - }, - - /** - * @param {string} type - * @return {boolean} - * - * @private - */ - isImage_: function(type) { - return type === 'image'; - }, - - /** - * @param {string} type - * @return {boolean} - * - * @private - */ - isVideo_: function(type) { - return type === 'video'; - }, - - /** - * @param {string} type - * @return {boolean} - * - * @private - */ - isAudio_: function(type) { - return type === 'audio'; - }, - - /** - * @param {!FilePreviewContent} sourceContent - * @param {string} type - * @return {!FilePreviewContent} - * - * @private - */ - audioContent_: function(sourceContent, type) { - if (this.isAudio_(type)) { - return sourceContent; - } - return /** @type {!FilePreviewContent} */ ({ - data: null, - dataType: '', - }); - }, - - /** - * @param {string} type - * @return {boolean} - * - * @private - */ - isUnsupported_: function(type, subtype, browsable) { - return !this.isImage_(type) && !this.isVideo_(type) && - !this.isAudio_(type) && !this.isHtml_(type, subtype) && !browsable; - }, - - /** @private */ - onDialogClose_: function(e) { - assert(e.target === this.$.dialog); - - this.clear(); - - // Catch and re-fire the 'close' event such that it bubbles across Shadow - // DOM v1. - this.fire('close'); - }, -}); - -//# sourceURL=//ui/file_manager/file_manager/foreground/elements/files_quick_view.js
diff --git a/ui/file_manager/file_manager/foreground/elements/files_quick_view.ts b/ui/file_manager/file_manager/foreground/elements/files_quick_view.ts new file mode 100644 index 0000000..f7462aa --- /dev/null +++ b/ui/file_manager/file_manager/foreground/elements/files_quick_view.ts
@@ -0,0 +1,313 @@ +// Copyright 2016 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +import 'chrome://resources/cr_elements/cr_button/cr_button.js'; +import 'chrome://resources/polymer/v3_0/iron-icon/iron-icon.js'; +import './files_metadata_box.js'; +import './files_safe_media.js'; +import './icons.js'; + +import type {CrDialogElement} from 'chrome://resources/cr_elements/cr_dialog/cr_dialog.js'; +import {PolymerElement} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js'; + +import {toSandboxedURL} from '../../common/js/url_constants.js'; + +import type {FilesMetadataBox} from './files_metadata_box.js'; +import {getTemplate} from './files_quick_view.html.js'; +import type {FilesSafeMedia} from './files_safe_media.js'; + +export interface FilesQuickView { + $: { + contentPanel: HTMLDivElement, + dialog: CrDialogElement, + 'metadata-box': FilesMetadataBox, + }; + $$: <T extends HTMLElement>(selector: string) => T; + isModal: boolean; + browsable: boolean; + type: string; + subtype: string; + sourceContent: FilePreviewContent; + metadataBoxActive: boolean; + fire: (eventName: string) => void; +} + +export class FilesQuickView extends PolymerElement { + static get is() { + return 'files-quick-view'; + } + + static get template() { + return getTemplate(); + } + + static get properties() { + return { + // File media type, e.g. image, video. + type: String, + subtype: String, + filePath: String, + + // True if there is a file task that can open the file type. + hasTask: Boolean, + + /** + * True if the entry shown in Quick View can be deleted. + */ + canDelete: Boolean, + + /** + * Preview content to be sent rendered in a sandboxed environment. + */ + sourceContent: { + type: Object, + observer: 'refreshUntrustedIframe', + }, + + videoPoster: String, + audioArtwork: String, + + // Autoplay property for audio, video. + autoplay: Boolean, + + // True if this file is not image, audio, video or HTML, but is + // supported by Chrome - content that is directly preview-able in + // Chrome by setting the untrusted <iframe> src attribute. Examples: + // pdf, text. + browsable: Boolean, + + // The metadata-box-active-changed event is fired on attribute change. + metadataBoxActive: { + value: true, + type: Boolean, + notify: true, + }, + + // Text shown when there is no playback/preview available. + noPlaybackText: String, + noPreviewText: String, + + /** + * True if the Files app window is a dialog, e.g. save-as or + * open-with. + */ + isModal: Boolean, + }; + } + + override ready() { + super.ready(); + this.$.dialog.addEventListener( + 'files-safe-media-tap-inside', this.clickInside.bind(this)); + this.$.dialog.addEventListener( + 'files-safe-media-tap-outside', this.close.bind(this)); + this.$.dialog.addEventListener( + 'files-safe-media-load-error', this.loaderror.bind(this)); + this.$.contentPanel.addEventListener( + 'click', this.onContentPanelClick.bind(this)); + } + + /** + * Send browsable preview content (i.e. content that can be displayed by the + * browser directly e.g. PDF/text) to the chrome-untrusted:// <iframe>. + */ + refreshUntrustedIframe() { + if (!this.browsable) { + return; + } + + const iframe = + this.shadowRoot!.querySelector<HTMLIFrameElement>('#untrusted'); + if (!iframe) { + return; + } + + const data = { + browsable: this.browsable, + subtype: this.subtype, + sourceContent: this.sourceContent, + }; + + iframe.contentWindow?.postMessage(data, toSandboxedURL().origin); + } + + // Clears fields. + clear() { + this.setProperties({ + type: '', + subtype: '', + filePath: '', + hasTask: false, + canDelete: false, + sourceContent: { + data: null, + dataType: '', + }, + videoPoster: '', + audioArtwork: '', + autoplay: false, + browsable: false, + }); + + // Remove the video's untrusted <iframe> child. The <iframe> contains the + // <video> element. Removing the <iframe> removes the <video>: that stops + // the video and its audio track playing: crbug.com/970192 + const video = + this.$.contentPanel.querySelector<FilesSafeMedia>('#videoSafeMedia'); + if (video) { + video.src = { + data: null, + dataType: '', + }; + } + + this.removeAttribute('load-error'); + } + + // Handle load error from the files-safe-media container. + loaderror() { + this.setAttribute('load-error', ''); + this.sourceContent = { + data: null, + dataType: '', + }; + } + + isOpened() { + return this.$.dialog?.open; + } + + // Opens the dialog. + open() { + if (!this.isOpened()) { + this.$.dialog.showModal(); + // Make dialog focusable and set focus to a dialog. This is how we can + // prevent default behaviour of a dialog which by default sets focus to + // the first input inside itself. When a dialog gains focus we remove + // focusability to prevent selecting dialog when moving with a keyboard. + this.$.dialog.setAttribute('tabindex', '0'); + this.$.dialog.focus(); + this.$.dialog.setAttribute('tabindex', '-1'); + } + } + + // Closes the dialog. + close() { + if (this.isOpened()) { + this.$.dialog.close(); + } + } + + clickInside() { + if (this.type === 'image') { + const dialog = this.shadowRoot!.querySelector<CrDialogElement>('#dialog'); + dialog?.focus(); + } + } + + getFilesMetadataBox() { + return this.$['metadata-box']; + } + + /** + * Client should assign the function to open the file. + */ + onOpenInNewButtonClick(_: Event) {} + + shouldShowOpenButton(hasTask: boolean, isModal: boolean) { + return hasTask && !isModal; + } + + /** + * Client should assign the function to delete the file. + */ + onDeleteButtonClick(_: Event) {} + + shouldShowDeleteButton(canDelete: boolean, isModal: boolean) { + return canDelete && !isModal; + } + + /** + * See the changes on crbug.com/641587, but crbug.com/779044#c11 later undid + * that work. So the focus remains on the metadata button when clicked after + * the crbug.com/779044 "ghost focus" fix. + * + * crbug.com/641587 mentions a different UI behavior, that was wanted to fix + * that bug. TODO(files-ng): UX to resolve the correct behavior needed here. + */ + onMetadataButtonClick(_: Event) { + this.metadataBoxActive = !this.metadataBoxActive; + } + + /** + * Close Quick View unless the clicked target or its ancestor contains + * 'no-close-on-click' class. + */ + onContentPanelClick(event: Event) { + let target: HTMLElement|null = event.target as HTMLElement; + while (target) { + if (target.classList.contains('no-close-on-click')) { + return; + } + target = target.parentElement; + } + this.close(); + } + + hasContent(sourceContent: FilePreviewContent) { + return sourceContent.dataType !== ''; + } + + isHtml(type: string, subtype: string) { + return type === 'document' && subtype === 'HTML'; + } + + isImage(type: string) { + return type === 'image'; + } + + isVideo(type: string) { + return type === 'video'; + } + + isAudio(type: string) { + return type === 'audio'; + } + + audioContent(sourceContent: FilePreviewContent, type: string): + FilePreviewContent { + if (this.isAudio(type)) { + return sourceContent; + } + return { + data: null, + dataType: '', + }; + } + + isUnsupported(type: string, subtype: string, browsable: boolean) { + return !this.isImage(type) && !this.isVideo(type) && !this.isAudio(type) && + !this.isHtml(type, subtype) && !browsable; + } + + onDialogClose(e: Event) { + if (e.target !== this.$.dialog) { + return; + } + this.clear(); + + // Catch and re-fire the 'close' event such that it bubbles across Shadow + // DOM v1. + this.dispatchEvent( + new CustomEvent('close', {bubbles: true, composed: true})); + } +} + +declare global { + interface HTMLElementTagNameMap { + 'files-quick-view': FilesQuickView; + } +} + +customElements.define(FilesQuickView.is, FilesQuickView);
diff --git a/ui/file_manager/file_manager/foreground/elements/files_safe_media.js b/ui/file_manager/file_manager/foreground/elements/files_safe_media.ts similarity index 62% rename from ui/file_manager/file_manager/foreground/elements/files_safe_media.js rename to ui/file_manager/file_manager/foreground/elements/files_safe_media.ts index f1dfc75..6622d0e8 100644 --- a/ui/file_manager/file_manager/foreground/elements/files_safe_media.js +++ b/ui/file_manager/file_manager/foreground/elements/files_safe_media.ts
@@ -2,9 +2,21 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -import {html, Polymer} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js'; +import {PolymerElement} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js'; + import {toSandboxedURL} from '../../common/js/url_constants.js'; +import {getTemplate} from './files_safe_media.html.js'; + +export interface FilesSafeMedia { + $: {content: HTMLDivElement}; + type: string; + src: FilePreviewContent; + fire: (eventName: string) => void; +} + +type ContentsIframeNode = HTMLIFrameElement&{isVideoMedia_: boolean}; + /** * Polymer element to render media securely in a chrome-untrusted:// <iframe> * element. @@ -12,40 +24,39 @@ * When tapped, 'files-safe-media-tap-inside', 'files-safe-media-tap-outside' * events are fired depending on the position of the tap. */ -export const FilesSafeMedia = Polymer({ - _template: html`{__html_template__}`, +export class FilesSafeMedia extends PolymerElement { + static get is() { + return 'files-safe-media'; + } - is: 'files-safe-media', + static get template() { + return getTemplate(); + } - properties: { - /** - * Source content accessible from the sandboxed environment. - * @type {!FilePreviewContent} - */ - src: { - type: Object, - observer: 'onSrcChange_', - reflectToAttribute: true, - }, + static get properties() { + return { + /** + * Source content accessible from the sandboxed environment. + */ + src: { + type: Object, + observer: 'onSrcChange_', + reflectToAttribute: true, + }, - /** - * <files-safe-media> media type: e.g. audio, image, video, html. - * @const {string} - */ - type: { - type: String, - readonly: true, - }, - }, + /** + * <files-safe-media> media type: e.g. audio, image, video, html. + */ + type: { + type: String, + readonly: true, + }, + }; + } - listeners: { - 'src-changed': 'onSrcChange_', - }, + private contentsNode_: ContentsIframeNode|null = null; - /** - * @return {string} - */ - sourceFile_: function() { + private sourceFile_() { switch (this.type) { case 'image': return toSandboxedURL('untrusted_resources/files_img_content.html') @@ -63,9 +74,9 @@ console.warn('Unsupported type: ' + this.type); return ''; } - }, + } - onSrcChange_: function() { + private onSrcChange_() { const hasContent = this.src.dataType !== ''; if (!hasContent) { @@ -90,10 +101,10 @@ return; } - const data = /** @type {!UntrustedPreviewData} */ ({ + const data: UntrustedPreviewData = { type: this.type, - sourceContent: /** @type {!FilePreviewContent} */ (this.src), - }); + sourceContent: this.src, + }; if (this.contentsNode_.contentWindow) { this.contentsNode_.isVideoMedia_ = (this.type === 'video'); @@ -101,11 +112,10 @@ this.contentsNode_.contentWindow.postMessage( data, toSandboxedURL().origin); } - }, + } - createUntrustedContents_: function() { - const node = - /** @type {!HTMLIFrameElement} */ (document.createElement('iframe')); + private createUntrustedContents_() { + const node = document.createElement('iframe') as ContentsIframeNode; this.contentsNode_ = node; // Allow autoplay for audio files. if (this.type === 'audio') { @@ -114,18 +124,19 @@ this.$.content.appendChild(node); node.addEventListener('load', () => this.onSrcChange_()); node.src = this.sourceFile_(); - }, + } - created: function() { + created() { /** - * @private {?HTMLIFrameElement} Holds the untrusted iframe when a source - * to preview is set. Set to null otherwise. + * Holds the untrusted iframe when a source to preview is set. Set to null + * otherwise. */ this.contentsNode_ = null; - }, + } - ready: function() { - this.addEventListener('focus', (event) => { + override ready() { + super.ready(); + this.addEventListener('focus', () => { if (this.type === 'audio' || this.type === 'video') { // Avoid setting the focus on the files-safe-media itself, rather sends // it down to its untrusted iframe element. @@ -141,9 +152,11 @@ return; } if (event.data === 'tap-inside') { - this.fire('files-safe-media-tap-inside'); + this.dispatchEvent(new CustomEvent( + 'files-safe-media-tap-inside', {bubbles: true, composed: true})); } else if (event.data === 'tap-outside') { - this.fire('files-safe-media-tap-outside'); + this.dispatchEvent(new CustomEvent( + 'files-safe-media-tap-outside', {bubbles: true, composed: true})); } else if (event.data === 'webview-loaded') { if (this.contentsNode_) { this.contentsNode_.setAttribute('loaded', ''); @@ -153,10 +166,17 @@ this.contentsNode_.removeAttribute('loaded'); } } else if (event.data === 'content-decode-failed') { - this.fire('files-safe-media-load-error'); + this.dispatchEvent(new CustomEvent( + 'files-safe-media-load-error', {bubbles: true, composed: true})); } }); - }, -}); + } +} -//# sourceURL=//ui/file_manager/file_manager/foreground/elements/files_safe_media.js +declare global { + interface HTMLElementTagNameMap { + 'files-safe-media': FilesSafeMedia; + } +} + +customElements.define(FilesSafeMedia.is, FilesSafeMedia);
diff --git a/ui/file_manager/file_manager/foreground/js/BUILD.gn b/ui/file_manager/file_manager/foreground/js/BUILD.gn index a4e706b..62cdb5d 100644 --- a/ui/file_manager/file_manager/foreground/js/BUILD.gn +++ b/ui/file_manager/file_manager/foreground/js/BUILD.gn
@@ -54,7 +54,6 @@ ":list_thumbnail_loader", ":main", ":main_window_component", - ":metadata_box_controller", ":metadata_update_controller", ":mock_actions_model", ":mock_directory_model", @@ -66,9 +65,6 @@ ":navigation_uma", ":path_component", ":providers_model", - ":quick_view_controller", - ":quick_view_model", - ":quick_view_uma", ":scan_controller", ":search_controller", ":selection_menu_controller", @@ -124,7 +120,6 @@ ":list_thumbnail_loader", ":main", ":main_window_component", - ":metadata_box_controller", ":metadata_update_controller", ":mock_directory_model", ":mock_folder_shortcut_data_model", @@ -135,9 +130,6 @@ ":navigation_uma", ":path_component", ":providers_model", - ":quick_view_controller", - ":quick_view_model", - ":quick_view_uma", ":scan_controller", ":search_controller", ":selection_menu_controller", @@ -496,15 +488,11 @@ ":launch_param", ":list_thumbnail_loader", ":main_window_component", - ":metadata_box_controller", ":metadata_update_controller", ":naming_controller", ":navigation_list_model", ":navigation_uma", ":providers_model", - ":quick_view_controller", - ":quick_view_model", - ":quick_view_uma", ":scan_controller", ":search_controller", ":selection_menu_controller", @@ -765,22 +753,6 @@ ] } -js_library("metadata_box_controller") { - deps = [ - ":path_component", - ":quick_view_model", - "metadata:metadata_item", - "metadata:metadata_model", - "ui:file_metadata_formatter", - "//ash/webui/common/resources:assert", - "//ui/file_manager/file_manager/common/js:file_type", - "//ui/file_manager/file_manager/common/js:util", - "//ui/file_manager/file_manager/externs:volume_manager", - "//ui/file_manager/file_manager/foreground/elements:files_metadata_box", - "//ui/file_manager/file_manager/foreground/elements:files_quick_view", - ] -} - js_library("metadata_update_controller") { deps = [ ":directory_model", @@ -882,52 +854,6 @@ ] } -js_library("quick_view_controller") { - deps = [ - ":constants", - ":file_manager_commands", - ":file_selection", - ":metadata_box_controller", - ":quick_view_model", - ":quick_view_uma", - ":thumbnail_loader", - "metadata:metadata_item", - "metadata:metadata_model", - "ui:file_list_selection_model", - "ui:files_confirm_dialog", - "ui:list_container", - "ui:multi_menu_button", - "//ash/webui/common/resources:assert", - "//ui/file_manager/file_manager/common/js:dialog_type", - "//ui/file_manager/file_manager/common/js:file_type", - "//ui/file_manager/file_manager/common/js:util", - "//ui/file_manager/file_manager/common/js:volume_manager_types", - "//ui/file_manager/file_manager/externs:command_handler_deps", - "//ui/file_manager/file_manager/externs:volume_manager", - "//ui/file_manager/file_manager/foreground/elements:files_quick_view", - "//ui/file_manager/image_loader:image_loader_client", - "//ui/file_manager/image_loader:load_image_request", - ] - externs_list = [ "//ui/file_manager/file_manager/externs/quick_view.js" ] -} - -js_library("quick_view_model") { - deps = [ - "//ash/webui/common/resources:cr_deprecated", - "//ash/webui/common/resources:event_target", - ] -} - -js_library("quick_view_uma") { - deps = [ - "//ash/webui/common/resources:assert", - "//ui/file_manager/file_manager/common/js:dialog_type", - "//ui/file_manager/file_manager/common/js:file_type", - "//ui/file_manager/file_manager/common/js:volume_manager_types", - "//ui/file_manager/file_manager/externs:volume_manager", - ] -} - js_library("scan_controller") { deps = [ ":directory_model",
diff --git a/ui/file_manager/file_manager/foreground/js/metadata_box_controller.js b/ui/file_manager/file_manager/foreground/js/metadata_box_controller.js deleted file mode 100644 index de5e0b8..0000000 --- a/ui/file_manager/file_manager/foreground/js/metadata_box_controller.js +++ /dev/null
@@ -1,359 +0,0 @@ -// Copyright 2016 The Chromium Authors -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -import {assert} from 'chrome://resources/ash/common/assert.js'; - -import {FileType} from '../../common/js/file_type.js'; -import {TrashEntry} from '../../common/js/trash.js'; -import {util} from '../../common/js/util.js'; -import {VolumeManager} from '../../externs/volume_manager.js'; -import {FilesQuickView} from '../elements/files_quick_view.js'; - -import {MetadataItem} from './metadata/metadata_item.js'; -import {MetadataModel} from './metadata/metadata_model.js'; -import {PathComponent} from './path_component.js'; -import {QuickViewModel} from './quick_view_model.js'; -import {FileMetadataFormatter} from './ui/file_metadata_formatter.js'; - -/** - * Controller of metadata box. - * This should be initialized with |init| method. - */ -export class MetadataBoxController { - /** - * @param {!MetadataModel} metadataModel - * @param {!QuickViewModel} quickViewModel - * @param {!FileMetadataFormatter} fileMetadataFormatter - * @param {!VolumeManager} volumeManager - */ - constructor( - metadataModel, quickViewModel, fileMetadataFormatter, volumeManager) { - /** - * @type {!MetadataModel} - * @private - */ - this.metadataModel_ = metadataModel; - - /** - * @type {!QuickViewModel} - * @private - */ - this.quickViewModel_ = quickViewModel; - - /** - * @type {FilesMetadataBoxElement} metadataBox - * @private - */ - this.metadataBox_ = null; - - /** - * @type {FilesQuickView} quickView - * @private - */ - this.quickView_ = null; - - /** - * @type {!FileMetadataFormatter} - * @private - */ - this.fileMetadataFormatter_ = fileMetadataFormatter; - - /** - * @type {!VolumeManager} - * @private - */ - this.volumeManager_ = volumeManager; - - /** - * @type {Entry} - * @private - */ - this.previousEntry_ = null; - - /** - * @type {boolean} - * @private - */ - this.isDirectorySizeLoading_ = false; - - /** - * @type {?function(!DirectoryEntry)} - * @private - */ - this.onDirectorySizeLoaded_ = null; - } - - /** - * Initialize the controller with quick view which will be lazily loaded. - * - * @param{!FilesQuickView} quickView - */ - init(quickView) { - this.quickView_ = quickView; - - this.fileMetadataFormatter_.addEventListener( - 'date-time-format-changed', this.updateView_.bind(this)); - - this.quickView_.addEventListener( - 'metadata-box-active-changed', this.updateView_.bind(this)); - - this.quickViewModel_.addEventListener( - 'selected-entry-changed', this.updateView_.bind(this)); - - this.metadataBox_ = this.quickView_.getFilesMetadataBox(); - this.metadataBox_.clear(false); - - this.metadataBox_.setAttribute('files-ng', ''); - } - - /** - * Update the view of metadata box. - * @param {!Event} event - * - * @private - */ - updateView_(event) { - if (!this.quickView_.metadataBoxActive) { - return; - } - - const entry = this.quickViewModel_.getSelectedEntry(); - const isSameEntry = util.isSameEntry(entry, this.previousEntry_); - this.previousEntry_ = entry; - - if (!entry) { - this.metadataBox_.clear(false); - return; - } - - if (event.type === 'date-time-format-changed') { - // Update the displayed entry modificationTime format only, and return. - this.metadataModel_.get([entry], ['modificationTime']) - .then(this.updateModificationTime_.bind(this, entry)); - return; - } - - // Do not clear isSizeLoading and size fields when the entry is not changed. - this.metadataBox_.clear(isSameEntry); - - const metadata = MetadataBoxController.GENERAL_METADATA_NAMES.concat( - ['alternateUrl', 'externalFileUrl', 'hosted']); - this.metadataModel_.get([entry], metadata) - .then(this.onGeneralMetadataLoaded_.bind(this, entry, isSameEntry)); - } - - /** - * Updates the metadata box with general and file-specific metadata. - * - * @param {!Entry} entry - * @param {boolean} isSameEntry if the entry is not changed from the last - * time. - * @param {!Array<!MetadataItem>} items - * - * @private - */ - onGeneralMetadataLoaded_(entry, isSameEntry, items) { - const type = FileType.getType(entry).type; - const item = items[0]; - - if (entry.isDirectory) { - const directory = /** @type {!DirectoryEntry} */ (entry); - this.setDirectorySize_(directory, isSameEntry); - } else if (item.size) { - this.metadataBox_.size = - this.fileMetadataFormatter_.formatSize(item.size, item.hosted, true); - this.metadataBox_.metadataRendered('size'); - } - - if (entry.restoreEntry) { - this.metadataBox_.originalLocation = - this.getFileLocationLabel_(entry.restoreEntry); - this.metadataBox_.metadataRendered('originalLocation'); - } - - this.updateModificationTime_(entry, items); - - if (!entry.isDirectory) { - let media = []; // Extra metadata types for local video media. - - let sniffMimeType = 'mediaMimeType'; - if (item.externalFileUrl || item.alternateUrl) { - sniffMimeType = 'contentMimeType'; - } else if (type === 'video') { - media = MetadataBoxController.EXTRA_METADATA_NAMES; - } - - this.metadataModel_.get([entry], [sniffMimeType].concat(media)) - .then(items => { - let mimeType = items[0][sniffMimeType] || ''; - const newType = FileType.getType(entry, mimeType); - if (newType.encrypted) { - mimeType = - util.strf('METADATA_BOX_ENCRYPTED', newType.originalMimeType); - } - this.metadataBox_.mediaMimeType = mimeType; - this.metadataBox_.metadataRendered('mime'); - this.metadataBox_.fileLocation = this.getFileLocationLabel_(entry); - this.metadataBox_.metadataRendered('location'); - }); - } - - if (['image', 'video', 'audio'].includes(type)) { - if (item.externalFileUrl || item.alternateUrl) { - const data = ['imageHeight', 'imageWidth']; - this.metadataModel_.get([entry], data).then(items => { - this.metadataBox_.imageWidth = items[0].imageWidth || 0; - this.metadataBox_.imageHeight = items[0].imageHeight || 0; - this.metadataBox_.setFileTypeInfo(type); - this.metadataBox_.metadataRendered('meta'); - }); - } else { - const data = MetadataBoxController.EXTRA_METADATA_NAMES; - this.metadataModel_.get([entry], data).then(items => { - const item = items[0]; - this.metadataBox_.setProperties({ - ifd: item.ifd || null, - imageHeight: item.imageHeight || 0, - imageWidth: item.imageWidth || 0, - mediaAlbum: item.mediaAlbum || '', - mediaArtist: item.mediaArtist || '', - mediaDuration: item.mediaDuration || 0, - mediaGenre: item.mediaGenre || '', - mediaTitle: item.mediaTitle || '', - mediaTrack: item.mediaTrack || '', - mediaYearRecorded: item.mediaYearRecorded || '', - }); - this.metadataBox_.setFileTypeInfo(type); - this.metadataBox_.metadataRendered('meta'); - }); - } - } else if (type === 'raw') { - const data = ['ifd']; - this.metadataModel_.get([entry], data).then(items => { - const raw = items[0].ifd ? items[0].ifd : {}; - this.metadataBox_.ifd = items[0].ifd ? {raw} : null; - this.metadataBox_.imageWidth = raw.width || 0; - this.metadataBox_.imageHeight = raw.height || 0; - this.metadataBox_.setFileTypeInfo('image'); - this.metadataBox_.metadataRendered('meta'); - }); - } - } - - /** - * Updates the metadata box modificationTime. - * - * @param {!Entry} entry - * @param {!Array<!MetadataItem>} items - * - * @private - */ - updateModificationTime_(entry, items) { - const item = items[0]; - - this.metadataBox_.modificationTime = - this.fileMetadataFormatter_.formatModDate(item.modificationTime); - } - - /** - * Set a current directory's size in metadata box. - * - * A loading animation is shown while fetching the directory size. However, it - * won't show if there is no size value. Use a dummy value ' ' in that case. - * - * To avoid flooding the OS system with chrome.getDirectorySize requests, if a - * previous request is active, store the new request and return. Only the most - * recent new request is stored. When the active request returns, it calls the - * stored request instead of updating the size field. - * - * @param {!DirectoryEntry} entry - * @param {boolean} isSameEntry True if the entry is not changed from the last - * time. False enables the loading animation. - * - * @private - */ - setDirectorySize_(entry, isSameEntry) { - assert(entry.isDirectory); - entry = /** @type {!DirectoryEntry} */ (util.unwrapEntry(entry)); - - if (this.metadataBox_.size === '') { - this.metadataBox_.size = ' '; // Provide a dummy size value. - } - - if (this.isDirectorySizeLoading_) { - if (!isSameEntry) { - this.metadataBox_.isSizeLoading = true; - } - - // Store the new setDirectorySize_ request and return. - this.onDirectorySizeLoaded_ = lastEntry => { - this.setDirectorySize_(entry, util.isSameEntry(entry, lastEntry)); - }; - return; - } - - this.metadataBox_.isSizeLoading = !isSameEntry; - - this.isDirectorySizeLoading_ = true; - chrome.fileManagerPrivate.getDirectorySize(entry, size => { - this.isDirectorySizeLoading_ = false; - - if (this.onDirectorySizeLoaded_) { - setTimeout(this.onDirectorySizeLoaded_.bind(null, entry)); - this.onDirectorySizeLoaded_ = null; - return; - } - - if (this.quickViewModel_.getSelectedEntry() != entry) { - return; - } - - if (chrome.runtime.lastError) { - console.warn(chrome.runtime.lastError); - size = undefined; - } - - this.metadataBox_.size = - this.fileMetadataFormatter_.formatSize(size, true, true); - this.metadataBox_.isSizeLoading = false; - this.metadataBox_.metadataRendered('size'); - }); - } - - /** - * Returns a label to display the file's location. - * @param {!Entry} entry - * @return {string} - * @private - */ - getFileLocationLabel_(entry) { - const components = - PathComponent.computeComponentsFromEntry(entry, this.volumeManager_); - return components.map(c => c.name).join('/'); - } -} - -/** - * @const {!Array<string>} - */ -MetadataBoxController.GENERAL_METADATA_NAMES = [ - 'size', - 'modificationTime', -]; - -/** - * @const {!Array<string>} - */ -MetadataBoxController.EXTRA_METADATA_NAMES = [ - 'ifd', - 'imageHeight', - 'imageWidth', - 'mediaAlbum', - 'mediaArtist', - 'mediaDuration', - 'mediaGenre', - 'mediaTitle', - 'mediaTrack', - 'mediaYearRecorded', -];
diff --git a/ui/file_manager/file_manager/foreground/js/metadata_box_controller.ts b/ui/file_manager/file_manager/foreground/js/metadata_box_controller.ts new file mode 100644 index 0000000..cb5e98f --- /dev/null +++ b/ui/file_manager/file_manager/foreground/js/metadata_box_controller.ts
@@ -0,0 +1,307 @@ +// Copyright 2016 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +/** + * @fileoverview + * This file is checked via TS, so we suppress Closure checks. + * @suppress {checkTypes} + */ + +import {isFileSystemDirectoryEntry} from '../../common/js/entry_utils.js'; +import {FileType} from '../../common/js/file_type.js'; +import {TrashEntry} from '../../common/js/trash.js'; +import {util} from '../../common/js/util.js'; +import {VolumeManager} from '../../externs/volume_manager.js'; +import {FilesMetadataBox, RawIfd} from '../elements/files_metadata_box.js'; +import {FilesQuickView} from '../elements/files_quick_view.js'; + +import {MetadataItem} from './metadata/metadata_item.js'; +import {MetadataModel} from './metadata/metadata_model.js'; +import {PathComponent} from './path_component.js'; +import {QuickViewModel} from './quick_view_model.js'; +import {FileMetadataFormatter} from './ui/file_metadata_formatter.js'; + +function isTrashEntry(entry: Entry): entry is TrashEntry { + return 'restoreEntry' in entry; +} + +/** + * Controller of metadata box. + * This should be initialized with |init| method. + */ +export class MetadataBoxController { + private metadataBox_: FilesMetadataBox|null = null; + + private quickView_: FilesQuickView|null = null; + + private previousEntry_?: Entry; + + private isDirectorySizeLoading_ = false; + + private onDirectorySizeLoaded_: ((entry: DirectoryEntry) => void)|null = null; + + constructor( + private metadataModel_: MetadataModel, + private quickViewModel_: QuickViewModel, + private fileMetadataFormatter_: FileMetadataFormatter, + private volumeManager_: VolumeManager) {} + + /** + * Initialize the controller with quick view which will be lazily loaded. + */ + init(quickView: FilesQuickView) { + this.quickView_ = quickView; + + this.fileMetadataFormatter_.addEventListener( + 'date-time-format-changed', this.updateView_.bind(this)); + + this.quickView_.addEventListener( + 'metadata-box-active-changed', this.updateView_.bind(this)); + + this.quickViewModel_.addEventListener( + 'selected-entry-changed', this.updateView_.bind(this)); + + this.metadataBox_ = this.quickView_.getFilesMetadataBox(); + this.metadataBox_.clear(false); + + this.metadataBox_.setAttribute('files-ng', ''); + } + + /** + * Update the view of metadata box. + */ + private updateView_(event: Event) { + if (!this.quickView_?.metadataBoxActive) { + return; + } + + const entry = this.quickViewModel_.getSelectedEntry()!; + const isSameEntry = util.isSameEntry(entry, this.previousEntry_); + this.previousEntry_ = entry; + + if (!entry) { + this.metadataBox?.clear(false); + return; + } + + if (event.type === 'date-time-format-changed') { + // Update the displayed entry modificationTime format only, and return. + this.metadataModel_.get([entry], ['modificationTime']) + .then(this.updateModificationTime_.bind(this, entry)); + return; + } + + // Do not clear isSizeLoading and size fields when the entry is not changed. + this.metadataBox.clear(isSameEntry); + + const metadata = GENERAL_METADATA_NAMES.concat( + ['alternateUrl', 'externalFileUrl', 'hosted']); + this.metadataModel_.get([entry], metadata) + .then(this.onGeneralMetadataLoaded_.bind(this, entry, isSameEntry)); + } + + /** + * Accessor to get a guaranteed `FilesMetadataBox`. + */ + private get metadataBox(): FilesMetadataBox { + return this.metadataBox_!; + } + + /** + * Updates the metadata box with general and file-specific metadata. + * + * @param isSameEntry if the entry is not changed from the last time. + */ + private onGeneralMetadataLoaded_( + entry: Entry, isSameEntry: boolean, items: MetadataItem[]) { + const type = FileType.getType(entry).type; + const item = items[0]; + + if (isFileSystemDirectoryEntry(entry)) { + this.setDirectorySize_(entry, isSameEntry); + } else if (item?.size) { + this.metadataBox.size = + this.fileMetadataFormatter_.formatSize(item.size, item.hosted, true); + this.metadataBox.metadataRendered('size'); + } + + if (isTrashEntry(entry)) { + this.metadataBox.originalLocation = + this.getFileLocationLabel_(entry.restoreEntry); + this.metadataBox.metadataRendered('originalLocation'); + } + + this.updateModificationTime_(entry, items); + + if (!entry.isDirectory) { + let media: string[] = []; // Extra metadata types for local video media. + + let sniffMimeType = 'mediaMimeType'; + if (item?.externalFileUrl || item?.alternateUrl) { + sniffMimeType = 'contentMimeType'; + } else if (type === 'video') { + media = EXTRA_METADATA_NAMES; + } + + this.metadataModel_.get([entry], [sniffMimeType].concat(media)) + .then(items => { + let mimeType = items[0] && + items[0][sniffMimeType as keyof MetadataItem] as string || + ''; + const newType = FileType.getType(entry, mimeType); + if (newType.encrypted) { + mimeType = + util.strf('METADATA_BOX_ENCRYPTED', newType.originalMimeType); + } + this.metadataBox.mediaMimeType = mimeType; + this.metadataBox.metadataRendered('mime'); + this.metadataBox.fileLocation = this.getFileLocationLabel_(entry); + this.metadataBox.metadataRendered('location'); + }); + } + + if (['image', 'video', 'audio'].includes(type)) { + if (item?.externalFileUrl || item?.alternateUrl) { + const data = ['imageHeight', 'imageWidth']; + this.metadataModel_.get([entry], data).then(items => { + this.metadataBox.imageWidth = items[0]?.imageWidth || 0; + this.metadataBox.imageHeight = items[0]?.imageHeight || 0; + this.metadataBox.setFileTypeInfo(type); + this.metadataBox.metadataRendered('meta'); + }); + } else { + const data = EXTRA_METADATA_NAMES; + this.metadataModel_.get([entry], data).then(items => { + const item = items[0]!; + this.metadataBox.setProperties({ + ifd: item.ifd || null, + imageHeight: item.imageHeight || 0, + imageWidth: item.imageWidth || 0, + mediaAlbum: item.mediaAlbum || '', + mediaArtist: item.mediaArtist || '', + mediaDuration: item.mediaDuration || 0, + mediaGenre: item.mediaGenre || '', + mediaTitle: item.mediaTitle || '', + mediaTrack: item.mediaTrack || '', + mediaYearRecorded: item.mediaYearRecorded || '', + }); + this.metadataBox.setFileTypeInfo(type); + this.metadataBox.metadataRendered('meta'); + }); + } + } else if (type === 'raw') { + const data = ['ifd']; + this.metadataModel_.get([entry], data).then(items => { + const raw: RawIfd|null = items[0]?.ifd ? items[0].ifd as RawIfd : null; + this.metadataBox.ifd = raw ? {raw} : undefined; + this.metadataBox.imageWidth = raw?.width || 0; + this.metadataBox.imageHeight = raw?.height || 0; + this.metadataBox.setFileTypeInfo('image'); + this.metadataBox.metadataRendered('meta'); + }); + } + } + + /** + * Updates the metadata box modificationTime. + */ + private updateModificationTime_(_: Entry, items: MetadataItem[]) { + const item = items[0]; + + this.metadataBox.modificationTime = + this.fileMetadataFormatter_.formatModDate(item?.modificationTime); + } + + /** + * Set a current directory's size in metadata box. + * + * A loading animation is shown while fetching the directory size. However, it + * won't show if there is no size value. Use a dummy value ' ' in that case. + * + * To avoid flooding the OS system with chrome.getDirectorySize requests, if a + * previous request is active, store the new request and return. Only the most + * recent new request is stored. When the active request returns, it calls the + * stored request instead of updating the size field. + * + * `isSameEntry` is True if the entry is not changed from the last time. False + * enables the loading animation. + */ + private setDirectorySize_(entry: DirectoryEntry, isSameEntry: boolean) { + if (!isFileSystemDirectoryEntry(entry)) { + return; + } + const directoryEntry = util.unwrapEntry(entry) as DirectoryEntry; + + if (this.metadataBox.size === '') { + this.metadataBox.size = ' '; // Provide a dummy size value. + } + + if (this.isDirectorySizeLoading_) { + if (!isSameEntry) { + this.metadataBox.isSizeLoading = true; + } + + // Store the new setDirectorySize_ request and return. + this.onDirectorySizeLoaded_ = lastEntry => { + this.setDirectorySize_(entry, util.isSameEntry(entry, lastEntry)); + }; + return; + } + + this.metadataBox.isSizeLoading = !isSameEntry; + + this.isDirectorySizeLoading_ = true; + chrome.fileManagerPrivate.getDirectorySize( + directoryEntry, (size: number|undefined) => { + this.isDirectorySizeLoading_ = false; + + if (this.onDirectorySizeLoaded_) { + setTimeout(this.onDirectorySizeLoaded_.bind(null, entry)); + this.onDirectorySizeLoaded_ = null; + return; + } + + if (this.quickViewModel_.getSelectedEntry() != entry) { + return; + } + + if (chrome.runtime.lastError) { + console.warn(chrome.runtime.lastError); + size = undefined; + } + + this.metadataBox.size = + this.fileMetadataFormatter_.formatSize(size, true, true); + this.metadataBox.isSizeLoading = false; + this.metadataBox.metadataRendered('size'); + }); + } + + /** + * Returns a label to display the file's location. + */ + private getFileLocationLabel_(entry: Entry) { + const components = + PathComponent.computeComponentsFromEntry(entry, this.volumeManager_); + return components.map(c => c.name).join('/'); + } +} + +export const GENERAL_METADATA_NAMES = [ + 'size', + 'modificationTime', +]; + +export const EXTRA_METADATA_NAMES = [ + 'ifd', + 'imageHeight', + 'imageWidth', + 'mediaAlbum', + 'mediaArtist', + 'mediaDuration', + 'mediaGenre', + 'mediaTitle', + 'mediaTrack', + 'mediaYearRecorded', +];
diff --git a/ui/file_manager/file_manager/foreground/js/quick_view_controller.js b/ui/file_manager/file_manager/foreground/js/quick_view_controller.ts similarity index 67% rename from ui/file_manager/file_manager/foreground/js/quick_view_controller.js rename to ui/file_manager/file_manager/foreground/js/quick_view_controller.ts index 75916a7..059bb5a8 100644 --- a/ui/file_manager/file_manager/foreground/js/quick_view_controller.js +++ b/ui/file_manager/file_manager/foreground/js/quick_view_controller.ts
@@ -2,9 +2,15 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +/** + * @fileoverview + * This file is checked via TS, so we suppress Closure checks. + * @suppress {checkTypes|moduleLoad|lintChecks} + */ + import {ImageLoaderClient} from 'chrome-extension://pmfjbimdmchhbnneeidfognadeopoehp/image_loader_client.js'; import {LoadImageRequest, LoadImageResponse, LoadImageResponseStatus} from 'chrome-extension://pmfjbimdmchhbnneeidfognadeopoehp/load_image_request.js'; -import {assert} from 'chrome://resources/ash/common/assert.js'; +import {assert} from 'chrome://resources/js/assert_ts.js'; import {DialogType, isModal} from '../../common/js/dialog_type.js'; import {parseActionId} from '../../common/js/file_tasks.js'; @@ -14,6 +20,7 @@ import {CommandHandlerDeps} from '../../externs/command_handler_deps.js'; import {VolumeManager} from '../../externs/volume_manager.js'; import {FilesQuickView} from '../elements/files_quick_view.js'; +import type {FilesTooltip} from '../elements/files_tooltip.js'; import {CommandHandler} from './file_manager_commands.js'; import {FileSelectionHandler} from './file_selection.js'; @@ -22,139 +29,98 @@ import {MetadataModel} from './metadata/metadata_model.js'; import {MetadataBoxController} from './metadata_box_controller.js'; import {QuickViewModel} from './quick_view_model.js'; -import {QuickViewUma} from './quick_view_uma.js'; +import {QuickViewUma, WayToOpen} from './quick_view_uma.js'; import {TaskController} from './task_controller.js'; import {ThumbnailLoader} from './thumbnail_loader.js'; +import {Command} from './ui/command.js'; import {FileListSelectionModel} from './ui/file_list_selection_model.js'; import {FilesConfirmDialog} from './ui/files_confirm_dialog.js'; import {ListContainer} from './ui/list_container.js'; import {MultiMenuButton} from './ui/multi_menu_button.js'; +type CommandEvent = Event&{ + command: Command, +}; + /** * Controller for QuickView. */ export class QuickViewController { + private quickView_: FilesQuickView|null = null; + /** - * This should be initialized with |init_| method. - * - * @param {!CommandHandlerDeps} fileManager - * @param {!MetadataModel} metadataModel - * @param {!FileSelectionHandler} selectionHandler - * @param {!ListContainer} listContainer - * @param {!MultiMenuButton} selectionMenuButton - * @param {!QuickViewModel} quickViewModel - * @param {!TaskController} taskController - * @param {!FileListSelectionModel} fileListSelectionModel - * @param {!QuickViewUma} quickViewUma - * @param {!MetadataBoxController} metadataBoxController - * @param {DialogType} dialogType - * @param {!VolumeManager} volumeManager - * @param {!HTMLElement} dialogDom + * Delete confirm dialog. */ + private deleteConfirmDialog_: FilesConfirmDialog|null = null; + + /** + * Current selection of selectionHandler. + */ + private entries_: Array<Entry|FileEntry> = []; + + /** + * The tasks for the current entry shown in quick view. + */ + private tasks_: FileTasks|null = null; + + /** + * The current selection index of this.entries_. + */ + private currentSelection_ = 0; + + /** + * Stores whether we are in check-select mode or not. + */ + private checkSelectMode_ = false; + constructor( - fileManager, metadataModel, selectionHandler, listContainer, - selectionMenuButton, quickViewModel, taskController, - fileListSelectionModel, quickViewUma, metadataBoxController, dialogType, - volumeManager, dialogDom) { - /** @private {!CommandHandlerDeps} */ - this.fileManager_ = fileManager; - - /** @private {?FilesQuickView} */ - this.quickView_ = null; - - /** @private @const {!FileSelectionHandler} */ - this.selectionHandler_ = selectionHandler; - - /** @private @const {!ListContainer} */ - this.listContainer_ = listContainer; - - /** @private @const{!QuickViewModel} */ - this.quickViewModel_ = quickViewModel; - - /** @private @const {!QuickViewUma} */ - this.quickViewUma_ = quickViewUma; - - /** @private @const {!MetadataModel} */ - this.metadataModel_ = metadataModel; - - /** @private @const {!TaskController} */ - this.taskController_ = taskController; - - /** @private @const {!FileListSelectionModel} */ - this.fileListSelectionModel_ = fileListSelectionModel; - - /** @private @const {!MetadataBoxController} */ - this.metadataBoxController_ = metadataBoxController; - - /** @private @const {DialogType} */ - this.dialogType_ = dialogType; - - /** @private @const {!VolumeManager} */ - this.volumeManager_ = volumeManager; - - /** - * Delete confirm dialog. - * @private {?FilesConfirmDialog} - */ - this.deleteConfirmDialog_ = null; - - /** - * Current selection of selectionHandler. - * @private {!Array<!FileEntry>} - */ - this.entries_ = []; - - /** - * The tasks for the current entry shown in quick view. - * @private {?FileTasks} - */ - this.tasks_ = null; - - /** - * The current selection index of this.entries_. - * @private {number} - */ - this.currentSelection_ = 0; - - /** - * Stores whether we are in check-select mode or not. - * @private {boolean} - */ - this.checkSelectMode_ = false; - + private fileManager_: CommandHandlerDeps, + private metadataModel_: MetadataModel, + private selectionHandler_: FileSelectionHandler, + private listContainer_: ListContainer, + selectionMenuButton: MultiMenuButton, + private quickViewModel_: QuickViewModel, + private taskController_: TaskController, + private fileListSelectionModel_: FileListSelectionModel, + private quickViewUma_: QuickViewUma, + private metadataBoxController_: MetadataBoxController, + private dialogType_: DialogType, private volumeManager_: VolumeManager, + dialogDom: HTMLElement) { this.selectionHandler_.addEventListener( FileSelectionHandler.EventType.CHANGE, - this.onFileSelectionChanged_.bind(this)); + this.onFileSelectionChanged_.bind(this) as EventListener); this.listContainer_.element.addEventListener( 'keydown', this.onKeyDownToOpen_.bind(this)); - dialogDom.addEventListener('command', event => { - // Selection menu command can be triggered with focus outside of file list - // or button e.g.: from the directory tree. - if (event.command.id === 'get-info') { - event.stopPropagation(); - this.display_(QuickViewUma.WayToOpen.SELECTION_MENU); - } - }); - this.listContainer_.element.addEventListener('command', event => { - if (event.command.id === 'get-info') { - event.stopPropagation(); - this.display_(QuickViewUma.WayToOpen.CONTEXT_MENU); - } - }); - selectionMenuButton.addEventListener('command', event => { - if (event.command.id === 'get-info') { - event.stopPropagation(); - this.display_(QuickViewUma.WayToOpen.SELECTION_MENU); - } - }); + dialogDom.addEventListener( + 'command', ((event: CommandEvent) => { + // Selection menu command can be triggered with focus + // outside of file list or button e.g.: from the directory + // tree. + if (event.command.id === 'get-info') { + event.stopPropagation(); + this.display_(WayToOpen.SELECTION_MENU); + } + }) as EventListener); + this.listContainer_.element.addEventListener( + 'command', ((event: CommandEvent) => { + if (event.command.id === 'get-info') { + event.stopPropagation(); + this.display_(WayToOpen.CONTEXT_MENU); + } + }) as EventListener); + selectionMenuButton.addEventListener( + 'command', ((event: CommandEvent) => { + if (event.command.id === 'get-info') { + event.stopPropagation(); + this.display_(WayToOpen.SELECTION_MENU); + } + }) as EventListener); } /** * Initialize the controller with quick view which will be lazily loaded. - * @param {!FilesQuickView} quickView - * @private */ - init_(quickView) { + private init_(quickView: FilesQuickView) { this.quickView_ = quickView; this.quickView_.isModal = isModal(this.dialogType_); @@ -168,7 +134,7 @@ // Prevent selected file from being copied when quick view is open and // instead allow any selected "General info" text to be copied. document.body.addEventListener('copy', event => { - if (this.quickView_.isOpened()) { + if (this.quickView_!.isOpened()) { // Stop 'copy' event propagation to FileTransferController and allow // default copy event behaviour. event.stopPropagation(); @@ -179,71 +145,58 @@ this.listContainer_.focus(); }); - this.quickView_.onOpenInNewButtonTap = - this.onOpenInNewButtonTap_.bind(this); + this.quickView_.onOpenInNewButtonClick = + this.onOpenInNewButtonClick_.bind(this); - this.quickView_.onDeleteButtonTap = this.onDeleteButtonTap_.bind(this); + this.quickView_.onDeleteButtonClick = this.onDeleteButtonClick_.bind(this); const toolTipElements = - this.quickView_.$$('#toolbar').querySelectorAll('[has-tooltip]'); - this.quickView_.$$('files-tooltip').addTargets(toolTipElements); + this.quickView_.shadowRoot!.querySelector<HTMLDivElement>('#toolbar')! + .querySelectorAll('[has-tooltip]'); + this.quickView_.shadowRoot!.querySelector<FilesTooltip>('files-tooltip')! + .addTargets(toolTipElements); } /** * Create quick view element. - * @return {!FilesQuickView} - * @private */ - createQuickView_() { - return /** @type {!FilesQuickView} */ ( - document.querySelector('#quick-view')); + private createQuickView_() { + return document.querySelector<FilesQuickView>('#quick-view')!; } /** * Handles open-in-new button tap. - * - * @param {!Event} event A button click event. - * @private */ - onOpenInNewButtonTap_(event) { + private onOpenInNewButtonClick_() { this.tasks_ && this.tasks_.executeDefault(); - this.quickView_.close(); + this.quickView_!.close(); } /** * Handles delete button tap. - * - * @param {!Event} event A button click event. - * @private */ - onDeleteButtonTap_(event) { + private onDeleteButtonClick_() { this.deleteSelectedEntry_(); } /** * Handles key event on listContainer if it's relevant to quick view. - * - * @param {!Event} event A keyboard event. - * @private */ - onKeyDownToOpen_(event) { + private onKeyDownToOpen_(event: KeyboardEvent) { if (event.key === ' ') { event.preventDefault(); event.stopImmediatePropagation(); if (this.entries_.length > 0) { - this.display_(QuickViewUma.WayToOpen.SPACE_KEY); + this.display_(WayToOpen.SPACE_KEY); } } } /** * Handles key event on quick view. - * - * @param {!Event} event A keyboard event. - * @private */ - onQuickViewKeyDown_(event) { - if (this.quickView_.isOpened()) { + private onQuickViewKeyDown_(event: KeyboardEvent) { + if (this.quickView_ && this.quickView_.isOpened()) { switch (event.key) { case ' ': case 'Escape': @@ -279,11 +232,8 @@ * Changes the currently selected entry when in single-select mode. Sets * the models |selectedIndex| to indirectly trigger onFileSelectionChanged_ * and populate |this.entries_|. - * - * @param {boolean} down True if user pressed down arrow, false if up. - * @private */ - changeSingleSelectModeSelection_(down = false) { + private changeSingleSelectModeSelection_(down = false) { let index; if (down) { @@ -304,11 +254,8 @@ /** * Changes the currently selected entry when in multi-select mode (file * list calls this "check-select" mode). - * - * @param {boolean} down True if user pressed down arrow, false if up. - * @private */ - changeCheckSelectModeSelection_(down = false) { + private changeCheckSelectModeSelection_(down = false) { if (down) { this.currentSelection_ = this.currentSelection_ + 1; if (this.currentSelection_ >= @@ -323,21 +270,19 @@ } } - this.onFileSelectionChanged_(null); + this.onFileSelectionChanged_(); } /** * Delete the currently selected entry in quick view. - * - * @private */ - deleteSelectedEntry_() { + private deleteSelectedEntry_() { const entry = this.entries_[this.currentSelection_]; // Create a delete confirm dialog if needed. if (!this.deleteConfirmDialog_) { const dialogElement = document.createElement('dialog'); - this.quickView_.shadowRoot.appendChild(dialogElement); + this.quickView_!.shadowRoot!.appendChild(dialogElement); dialogElement.id = 'delete-confirm-dialog'; this.deleteConfirmDialog_ = new FilesConfirmDialog(dialogElement); @@ -367,44 +312,37 @@ /** * Returns true if the entry can be deleted. - * @param {Entry} entry - * @return {!Promise<boolean>} - * @private */ - canDeleteEntry_(entry) { + private async canDeleteEntry_(entry: Entry) { const deleteCommand = CommandHandler.getCommand('delete'); - return Promise.resolve( - deleteCommand.canDeleteEntries([entry], this.fileManager_)); + return deleteCommand.canDeleteEntries([entry], this.fileManager_); } /** * Display quick view. - * - * @param {QuickViewUma.WayToOpen} wayToOpen The open quick view trigger. - * @private */ - async display_(wayToOpen) { + private async display_(wayToOpen: WayToOpen) { // On opening Quick View, always reset the current selection index. this.currentSelection_ = 0; this.checkSelectMode_ = this.fileListSelectionModel_.getCheckSelectMode(); await this.updateQuickView_(); - if (!this.quickView_.isOpened()) { - this.quickView_.open(); - this.quickViewUma_.onOpened(this.entries_[0], wayToOpen); + if (!this.quickView_!.isOpened()) { + this.quickView_!.open(); + if (this.entries_[0]) { + this.quickViewUma_.onOpened(this.entries_[0], wayToOpen); + } } } /** * Update quick view on file selection change. - * - * @param {?Event} event an Event whose target is FileSelectionHandler. - * @private */ - onFileSelectionChanged_(event) { + private onFileSelectionChanged_(event?: Event& + {target: FileSelectionHandler}) { if (event) { - this.entries_ = event.target.selection.entries; + this.entries_ = event.target?.selection.entries; if (!this.entries_ || !this.entries_.length) { if (this.quickView_ && this.quickView_.isOpened()) { @@ -429,11 +367,10 @@ } } - if (this.quickView_ && this.quickView_.isOpened()) { - assert(this.entries_.length > 0); - const entry = this.entries_[this.currentSelection_]; - - if (!util.isSameEntry(entry, this.quickViewModel_.getSelectedEntry())) { + if (this.quickView_ && this.quickView_.isOpened() && + this.entries_[this.currentSelection_]) { + const entry = this.entries_[this.currentSelection_]!; + if (!util.isSameEntry(entry, this.quickViewModel_.getSelectedEntry()!)) { this.updateQuickView_(); } } @@ -441,11 +378,8 @@ /** * Update quick view using current entries. - * - * @return {!Promise} Promise fulfilled after quick view is updated. - * @private */ - async updateQuickView_() { + private async updateQuickView_(): Promise<void> { if (!this.quickView_) { try { const quickView = this.createQuickView_(); @@ -457,8 +391,8 @@ } } - assert(this.entries_.length > 0); - const entry = this.entries_[this.currentSelection_]; + assert(this.entries_.length >= this.currentSelection_); + const entry = this.entries_[this.currentSelection_]!; this.quickViewModel_.setSelectedEntry(entry); this.tasks_ = null; @@ -474,11 +408,11 @@ this.canDeleteEntry_(entry), ]); - const items = /**@type{Array<MetadataItem>}*/ (values[0]); - const tasks = /**@type{!FileTasks}*/ (values[1]); + const items = values[0]; + const tasks = values[1]; const canDelete = values[2]; return this.onMetadataLoaded_(entry, items, tasks, canDelete); - } catch (error) { + } catch (error: any) { if (error) { console.warn(error.stack || error); } @@ -490,15 +424,10 @@ * * Note: fast-typing users can change the active selection while the |entry| * metadata and tasks were being async fetched. Bail out in that case. - * - * @param {!FileEntry} entry - * @param {Array<MetadataItem>} items - * @param {!FileTasks} fileTasks - * @param {boolean} canDelete - * @return {!Promise} - * @private */ - async onMetadataLoaded_(entry, items, fileTasks, canDelete) { + private async onMetadataLoaded_( + entry: Entry, items: MetadataItem[], fileTasks: FileTasks, + canDelete: boolean) { const tasks = fileTasks.getAnnotatedTasks(); const params = @@ -512,7 +441,7 @@ dataType: '', }; - this.quickView_.setProperties({ + this.quickView_!.setProperties({ type: params.type || '', subtype: params.subtype || '', filePath: params.filePath || '', @@ -530,27 +459,20 @@ } } - /** - * @param {!FileEntry} entry - * @param {Array<MetadataItem>} items - * @param {!Array<!chrome.fileManagerPrivate.FileTask>} tasks - * @param {boolean} canDelete - * @return {!Promise<!QuickViewParams>} - * - * @private - */ - async getQuickViewParameters_(entry, items, tasks, canDelete) { - const typeInfo = FileType.getType(entry, items[0].contentMimeType); + private async getQuickViewParameters_( + entry: FileEntry|Entry, items: MetadataItem[], + tasks: chrome.fileManagerPrivate.FileTask[], + canDelete: boolean): Promise<Partial<QuickViewParams>> { + const firstItem = items[0]; + const typeInfo = FileType.getType(entry, firstItem?.contentMimeType); const type = typeInfo.type; const locationInfo = this.volumeManager_.getLocationInfo(entry); const label = util.getEntryLabel(locationInfo, entry); const entryIsOnDrive = locationInfo && locationInfo.isDriveBased; - const thumbnailUrl = items.length ? items[0].thumbnailUrl : undefined; - const modificationTime = - items.length ? items[0].modificationTime : undefined; + const thumbnailUrl = firstItem ? firstItem.thumbnailUrl : undefined; + const modificationTime = firstItem ? firstItem.modificationTime : undefined; - /** @type {!QuickViewParams} */ - const params = { + const params: Partial<QuickViewParams> = { type: type, subtype: typeInfo.subtype, filePath: label, @@ -559,9 +481,8 @@ }; const volumeInfo = this.volumeManager_.getVolumeInfo(entry); - let localFile = volumeInfo && - QuickViewController.LOCAL_VOLUME_TYPES_.indexOf( - assert(volumeInfo.volumeType)) >= 0; + let localFile = + volumeInfo && LOCAL_VOLUME_TYPES_.indexOf(volumeInfo.volumeType) >= 0; // Treat certain types on Drive as if they were local (try auto-play etc). if (entryIsOnDrive && (type === 'audio' || type === 'video') && @@ -607,7 +528,8 @@ if (type === 'raw') { // RAW files: fetch their ImageLoader thumbnail. try { - const result = await this.loadRawFileThumbnailFromImageLoader_(entry); + const result = + await this.loadRawFileThumbnailFromImageLoader_(entry as FileEntry); if (result.status === LoadImageResponseStatus.SUCCESS) { params.type = 'image'; params.sourceContent = { @@ -629,14 +551,18 @@ } try { - const file = await new Promise((resolve, reject) => { - entry.file(resolve, reject); - }); + const file = + await new Promise((resolve: (file: File) => void, reject) => { + if ('file' in entry) { + entry.file(resolve, reject); + return; + } + reject(new Error('entry not a file type')); + }); switch (type) { case 'image': - if (QuickViewController.UNSUPPORTED_IMAGE_SUBTYPES_.indexOf( - typeInfo.subtype) === -1) { + if (UNSUPPORTED_IMAGE_SUBTYPES_.indexOf(typeInfo.subtype) === -1) { params.sourceContent = { data: file, dataType: 'blob', @@ -665,7 +591,7 @@ const itemsContentThumnbnail = await this.metadataModel_.get([entry], ['contentThumbnailUrl']); const item = itemsContentThumnbnail[0]; - if (item.contentThumbnailUrl) { + if (item?.contentThumbnailUrl) { params.audioArtwork = { data: item.contentThumbnailUrl, dataType: 'url', @@ -719,13 +645,9 @@ /** * Loads a thumbnail from Drive. - * - * @param {string} url Thumbnail url - * @param {Date|undefined} modificationTime File's modification time. - * @return {!Promise<!LoadImageResponse>} - * @private */ - async loadThumbnailFromDrive_(url, modificationTime) { + private async loadThumbnailFromDrive_(url: string, modificationTime?: Date): + Promise<LoadImageResponse> { const client = ImageLoaderClient.getInstance(); const request = LoadImageRequest.createForUrl(url); request.cache = true; @@ -739,12 +661,9 @@ * to get its |lastModified| time. ImageLoaderClient uses that to work out if * its cached data for |entry| is up-to-date or otherwise call ImageLoader to * refresh the cached |entry| data with the most recent data. - * - * @param {!Entry} entry The RAW file entry. - * @return {!Promise<!LoadImageResponse>} - * @private */ - loadRawFileThumbnailFromImageLoader_(entry) { + private async loadRawFileThumbnailFromImageLoader_(entry: FileEntry): + Promise<LoadImageResponse> { return new Promise((resolve, reject) => { entry.file(function requestFileThumbnail(file) { const request = LoadImageRequest.createForUrl(entry.toURL()); @@ -770,10 +689,8 @@ * Due to access control of WebView, non-local files can not be previewed * with Quick View unless thumbnails are provided (which is the case with * Drive). - * - * @private @const {!Array<!VolumeManagerCommon.VolumeType>} */ -QuickViewController.LOCAL_VOLUME_TYPES_ = [ +const LOCAL_VOLUME_TYPES_ = [ VolumeManagerCommon.VolumeType.ARCHIVE, VolumeManagerCommon.VolumeType.DOWNLOADS, VolumeManagerCommon.VolumeType.REMOVABLE, @@ -788,8 +705,7 @@ /** * List of unsupported image subtypes excluded from being displayed in * QuickView. An "unsupported type" message is shown instead. - * @private @const {!Array<string>} */ -QuickViewController.UNSUPPORTED_IMAGE_SUBTYPES_ = [ +const UNSUPPORTED_IMAGE_SUBTYPES_ = [ 'TIFF', // crbug.com/624109 ];
diff --git a/ui/file_manager/file_manager/foreground/js/quick_view_model.js b/ui/file_manager/file_manager/foreground/js/quick_view_model.ts similarity index 80% rename from ui/file_manager/file_manager/foreground/js/quick_view_model.js rename to ui/file_manager/file_manager/foreground/js/quick_view_model.ts index d58af9f..342b1273 100644 --- a/ui/file_manager/file_manager/foreground/js/quick_view_model.js +++ b/ui/file_manager/file_manager/foreground/js/quick_view_model.ts
@@ -6,23 +6,23 @@ import {NativeEventTarget as EventTarget} from 'chrome://resources/ash/common/event_target.js'; /** + * @fileoverview + * This file is checked via TS, so we suppress Closure checks. + * @suppress {checkTypes} + */ + +/** * Quick view model that doesn't fit into properties of quick view element. */ export class QuickViewModel extends EventTarget { + private selectedEntry_?: FileEntry|Entry; + constructor() { super(); - - /** - * Current selected file entry. - * @type {FileEntry} - * @private - */ - this.selectedEntry_ = null; } /** * Returns the selected file entry. - * @return {FileEntry} */ getSelectedEntry() { return this.selectedEntry_; @@ -31,9 +31,8 @@ /** * Sets the selected file entry. Emits a synchronous selected-entry-changed * event to immediately call MetadataBoxController.updateView_(). - * @param {!FileEntry} entry */ - setSelectedEntry(entry) { + setSelectedEntry(entry: Entry) { this.selectedEntry_ = entry; dispatchSimpleEvent(this, 'selected-entry-changed'); }
diff --git a/ui/file_manager/file_manager/foreground/js/quick_view_uma.js b/ui/file_manager/file_manager/foreground/js/quick_view_uma.ts similarity index 65% rename from ui/file_manager/file_manager/foreground/js/quick_view_uma.js rename to ui/file_manager/file_manager/foreground/js/quick_view_uma.ts index 9835a66..b760f98 100644 --- a/ui/file_manager/file_manager/foreground/js/quick_view_uma.js +++ b/ui/file_manager/file_manager/foreground/js/quick_view_uma.ts
@@ -2,8 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -import {assert} from 'chrome://resources/ash/common/assert.js'; - import {DialogType} from '../../common/js/dialog_type.js'; import {FileType} from '../../common/js/file_type.js'; import {recordEnum} from '../../common/js/metrics.js'; @@ -16,32 +14,13 @@ * UMA exporter for Quick View. */ export class QuickViewUma { - /** - * @param {!VolumeManager} volumeManager - * @param {!DialogType} dialogType - */ - constructor(volumeManager, dialogType) { - /** - * @type {!VolumeManager} - * @private - */ - this.volumeManager_ = volumeManager; - /** - * @type {DialogType} - * @private - */ - this.dialogType_ = dialogType; - } + constructor( + private volumeManager_: VolumeManager, private dialogType_: DialogType) {} /** - * Exports file type metric with the given |name|. - * - * @param {!FileEntry} entry - * @param {string} name The histogram name. - * - * @private + * Exports file type metric with the given histogram `name`. */ - exportFileType_(entry, name) { + private exportFileType_(entry: Entry, name: string) { let extension = FileType.getExtension(entry).toLowerCase(); if (entry.isDirectory) { extension = 'directory'; @@ -55,28 +34,23 @@ /** * Exports UMA based on the entry shown in Quick View. - * - * @param {!FileEntry} entry */ - onEntryChanged(entry) { + onEntryChanged(entry: FileEntry|Entry) { this.exportFileType_(entry, 'QuickView.FileType'); } /** * Exports UMA based on the entry selected when Quick View is opened. - * - * @param {!FileEntry} entry - * @param {QuickViewUma.WayToOpen} wayToOpen */ - onOpened(entry, wayToOpen) { + onOpened(entry: FileEntry|Entry, wayToOpen: WayToOpen) { this.exportFileType_(entry, 'QuickView.FileTypeOnLaunch'); - recordEnum('QuickView.WayToOpen', wayToOpen, QuickViewUma.WayToOpenValues_); + recordEnum('QuickView.WayToOpen', wayToOpen, WAY_TO_OPEN_ENUM_TO_INDEX); const volumeInfo = this.volumeManager_.getVolumeInfo(entry); const volumeType = volumeInfo && volumeInfo.volumeType; if (volumeType) { - if (QuickViewUma.VolumeType.includes(volumeType)) { - recordEnum('QuickView.VolumeType', volumeType, QuickViewUma.VolumeType); + if (QUICK_VIEW_VOLUME_TYPES.includes(volumeType)) { + recordEnum('QuickView.VolumeType', volumeType, QUICK_VIEW_VOLUME_TYPES); } else { console.warn('Unknown volume type: ' + volumeType); } @@ -98,35 +72,27 @@ /** * In which way quick view was opened. - * @enum {string} - * @const */ -QuickViewUma.WayToOpen = { - CONTEXT_MENU: 'contextMenu', - SPACE_KEY: 'spaceKey', - SELECTION_MENU: 'selectionMenu', -}; +export const enum WayToOpen { + CONTEXT_MENU = 'contextMenu', + SPACE_KEY = 'spaceKey', + SELECTION_MENU = 'selectionMenu', +} /** * The order should be consistent with the definition in histograms.xml. - * - * @const {!Array<QuickViewUma.WayToOpen>} - * @private */ -QuickViewUma.WayToOpenValues_ = [ - QuickViewUma.WayToOpen.CONTEXT_MENU, - QuickViewUma.WayToOpen.SPACE_KEY, - QuickViewUma.WayToOpen.SELECTION_MENU, +const WAY_TO_OPEN_ENUM_TO_INDEX = [ + WayToOpen.CONTEXT_MENU, + WayToOpen.SPACE_KEY, + WayToOpen.SELECTION_MENU, ]; /** * Keep the order of this in sync with FileManagerVolumeType in * tools/metrics/histograms/enums.xml. - * - * @type {!Array<VolumeManagerCommon.VolumeType>} - * @const */ -QuickViewUma.VolumeType = [ +const QUICK_VIEW_VOLUME_TYPES = [ VolumeManagerCommon.VolumeType.DRIVE, VolumeManagerCommon.VolumeType.DOWNLOADS, VolumeManagerCommon.VolumeType.REMOVABLE,
diff --git a/ui/file_manager/file_manager/foreground/js/task_controller.ts b/ui/file_manager/file_manager/foreground/js/task_controller.ts index d2d00d0b..804673b 100644 --- a/ui/file_manager/file_manager/foreground/js/task_controller.ts +++ b/ui/file_manager/file_manager/foreground/js/task_controller.ts
@@ -544,7 +544,7 @@ * Return the tasks for the FileEntry |entry|. * @param entry */ - async getEntryFileTasks(entry: FileEntry): Promise<FileTasks> { + async getEntryFileTasks(entry: Entry): Promise<FileTasks> { return FileTasks.create( this.volumeManager_, this.metadataModel_, this.directoryModel_, this.ui_, this.fileTransferController_!, [entry], this.taskHistory_,
diff --git a/ui/file_manager/file_names.gni b/ui/file_manager/file_names.gni index 8e875ca..abc5e50 100644 --- a/ui/file_manager/file_names.gni +++ b/ui/file_manager/file_names.gni
@@ -108,7 +108,6 @@ "file_manager/foreground/js/list_thumbnail_loader.js", "file_manager/foreground/js/main.js", "file_manager/foreground/js/main_window_component.js", - "file_manager/foreground/js/metadata_box_controller.js", "file_manager/foreground/js/metadata_update_controller.js", "file_manager/foreground/js/metrics_start.js", "file_manager/foreground/js/mock_actions_model.js", @@ -122,9 +121,6 @@ "file_manager/foreground/js/navigation_uma.js", "file_manager/foreground/js/path_component.js", "file_manager/foreground/js/providers_model.js", - "file_manager/foreground/js/quick_view_controller.js", - "file_manager/foreground/js/quick_view_model.js", - "file_manager/foreground/js/quick_view_uma.js", "file_manager/foreground/js/scan_controller.js", "file_manager/foreground/js/search_controller.js", "file_manager/foreground/js/selection_menu_controller.js", @@ -315,6 +311,10 @@ "file_manager/foreground/js/banner_controller.ts", "file_manager/foreground/js/file_tasks.ts", "file_manager/foreground/js/last_modified_controller.ts", + "file_manager/foreground/js/metadata_box_controller.ts", + "file_manager/foreground/js/quick_view_controller.ts", + "file_manager/foreground/js/quick_view_model.ts", + "file_manager/foreground/js/quick_view_uma.ts", "file_manager/foreground/js/task_controller.ts", "file_manager/foreground/js/uma_enums.gen.ts", @@ -329,6 +329,10 @@ # Closure is failing to recognize the generated JS from the TS. # JS targets should rely on externs to type check the Polymer elements from TS. ts_polymer = [ + "file_manager/foreground/elements/files_quick_view.ts", + "file_manager/foreground/elements/files_metadata_box.ts", + "file_manager/foreground/elements/files_safe_media.ts", + "file_manager/foreground/elements/files_metadata_entry.ts", "file_manager/foreground/elements/files_toast.ts", "file_manager/foreground/elements/files_tooltip.ts", ] @@ -438,6 +442,10 @@ # Generated in foregorund/elements folder. ts_generated_templates += [ + "file_manager/foreground/elements/files_metadata_box.html.ts", + "file_manager/foreground/elements/files_metadata_entry.html.ts", + "file_manager/foreground/elements/files_quick_view.html.ts", + "file_manager/foreground/elements/files_safe_media.html.ts", "file_manager/foreground/elements/files_toast.html.ts", "file_manager/foreground/elements/files_tooltip.html.ts", ] @@ -449,6 +457,7 @@ "file_manager/externs/volume_info.js", "file_manager/externs/volume_info_list.js", "file_manager/externs/search_item.js", + "file_manager/externs/quick_view.js", ] # d.ts. files that are manually created and checked-in in the repo. @@ -470,10 +479,6 @@ # Elements: "file_manager/foreground/elements/files_format_dialog.js", - "file_manager/foreground/elements/files_metadata_box.js", - "file_manager/foreground/elements/files_metadata_entry.js", - "file_manager/foreground/elements/files_quick_view.js", - "file_manager/foreground/elements/files_safe_media.js", "file_manager/foreground/elements/files_spinner.js", "file_manager/foreground/elements/icons.js", "file_manager/foreground/elements/xf_button.js",
diff --git a/ui/file_manager/image_loader/BUILD.gn b/ui/file_manager/image_loader/BUILD.gn index b70da04..b1b500e 100644 --- a/ui/file_manager/image_loader/BUILD.gn +++ b/ui/file_manager/image_loader/BUILD.gn
@@ -18,6 +18,7 @@ rebase_path("//ui/file_manager/", root_build_dir), "browser_resolver_prefix_replacements=\"chrome://file-manager/=./file_manager/\"", "hide_warnings_for=gen/ui/file_manager/tsc/", + "browser_resolver_prefix_replacements=\"chrome-extension://pmfjbimdmchhbnneeidfognadeopoehp/=./image_loader/\"", ] deps = [ ":background", @@ -158,6 +159,7 @@ "browser_resolver_prefix_replacements=\"chrome://webui-test/=./\"", "browser_resolver_prefix_replacements=\"chrome://file-manager/=./file_manager/\"", "hide_warnings_for=gen/ui/file_manager/tsc/", + "browser_resolver_prefix_replacements=\"chrome-extension://pmfjbimdmchhbnneeidfognadeopoehp/=./image_loader/\"", ] extra_deps = [ "//ui/file_manager:js_from_ts" ] }
diff --git a/ui/file_manager/image_loader/cache.js b/ui/file_manager/image_loader/cache.js index ecccf65..a10d3bb 100644 --- a/ui/file_manager/image_loader/cache.js +++ b/ui/file_manager/image_loader/cache.js
@@ -4,15 +4,380 @@ /** * Persistent cache storing images in an indexed database on the hard disk. - * @constructor */ -export function ImageCache() { +export class ImageCache { + constructor() { + /** + * IndexedDB database handle. + * @type {IDBDatabase} + * @private + */ + this.db_ = null; + } + /** - * IndexedDB database handle. - * @type {IDBDatabase} + * Initializes the cache database. + * @param {function()} callback Completion callback. + */ + initialize(callback) { + // Establish a connection to the database or (re)create it if not available + // or not up to date. After changing the database's schema, increment + // DB_VERSION to force database recreating. + const openRequest = window.indexedDB.open(DB_NAME, DB_VERSION); + + openRequest.onsuccess = (e) => { + this.db_ = e.target.result; + callback(); + }; + + openRequest.onerror = callback; + + openRequest.onupgradeneeded = (e) => { + console.info('Cache database creating or upgrading.'); + const db = e.target.result; + if (db.objectStoreNames.contains('metadata')) { + db.deleteObjectStore('metadata'); + } + if (db.objectStoreNames.contains('data')) { + db.deleteObjectStore('data'); + } + if (db.objectStoreNames.contains('settings')) { + db.deleteObjectStore('settings'); + } + db.createObjectStore('metadata', {keyPath: 'key'}); + db.createObjectStore('data', {keyPath: 'key'}); + db.createObjectStore('settings', {keyPath: 'key'}); + }; + } + + /** + * Sets size of the cache. + * + * @param {number} size Size in bytes. + * @param {IDBTransaction=} opt_transaction Transaction to be reused. If not + * provided, then a new one is created. * @private */ - this.db_ = null; + setCacheSize_(size, opt_transaction) { + const transaction = + opt_transaction || this.db_.transaction(['settings'], 'readwrite'); + const settingsStore = transaction.objectStore('settings'); + + settingsStore.put({key: 'size', value: size}); // Update asynchronously. + } + + /** + * Fetches current size of the cache. + * + * @param {function(number)} onSuccess Callback to return the size. + * @param {function()} onFailure Failure callback. + * @param {IDBTransaction=} opt_transaction Transaction to be reused. If not + * provided, then a new one is created. + * @private + */ + fetchCacheSize_(onSuccess, onFailure, opt_transaction) { + const transaction = opt_transaction || + this.db_.transaction(['settings', 'metadata', 'data'], 'readwrite'); + const settingsStore = transaction.objectStore('settings'); + const sizeRequest = settingsStore.get('size'); + + sizeRequest.onsuccess = (e) => { + if (e.target.result) { + onSuccess(e.target.result.value); + } else { + onSuccess(0); + } + }; + + sizeRequest.onerror = () => { + console.warn('Failed to fetch size from the database.'); + onFailure(); + }; + } + + /** + * Evicts the least used elements in cache to make space for a new image and + * updates size of the cache taking into account the upcoming item. + * + * @param {number} size Requested size. + * @param {function()} onSuccess Success callback. + * @param {function()} onFailure Failure callback. + * @param {IDBTransaction=} opt_transaction Transaction to be reused. If not + * provided, then a new one is created. + * @private + */ + evictCache_(size, onSuccess, onFailure, opt_transaction) { + const transaction = opt_transaction || + this.db_.transaction(['settings', 'metadata', 'data'], 'readwrite'); + + // Check if the requested size is smaller than the cache size. + if (size > MEMORY_LIMIT) { + onFailure(); + return; + } + + const onCacheSize = (cacheSize) => { + if (size < MEMORY_LIMIT - cacheSize) { + // Enough space, no need to evict. + this.setCacheSize_(cacheSize + size, transaction); + onSuccess(); + return; + } + + let bytesToEvict = Math.max(size, EVICTION_CHUNK_SIZE); + + // Fetch all metadata. + const metadataEntries = []; + const metadataStore = transaction.objectStore('metadata'); + const dataStore = transaction.objectStore('data'); + + const onEntriesFetched = () => { + metadataEntries.sort((a, b) => { + return b.lastLoadTimestamp - a.lastLoadTimestamp; + }); + + let totalEvicted = 0; + while (bytesToEvict > 0) { + const entry = metadataEntries.pop(); + totalEvicted += entry.size; + bytesToEvict -= entry.size; + metadataStore.delete(entry.key); // Remove asynchronously. + dataStore.delete(entry.key); // Remove asynchronously. + } + + this.setCacheSize_(cacheSize - totalEvicted + size, transaction); + }; + + metadataStore.openCursor().onsuccess = (e) => { + const cursor = e.target.result; + if (cursor) { + metadataEntries.push(cursor.value); + cursor.continue(); + } else { + onEntriesFetched(); + } + }; + }; + + this.fetchCacheSize_(onCacheSize, onFailure, transaction); + } + + /** + * Saves an image in the cache. + * + * @param {string} key Cache key. + * @param {number} timestamp Last modification timestamp. Used to detect + * if the image cache entry is out of date. + * @param {number} width Image width. + * @param {number} height Image height. + * @param {?string} ifd Image ifd, null if none. + * @param {string} data Image data. + */ + saveImage(key, timestamp, width, height, ifd, data) { + if (!this.db_) { + console.warn('Cache database not available.'); + return; + } + + const onNotFoundInCache = () => { + const metadataEntry = { + key: key, + timestamp: timestamp, + width: width, + height: height, + ifd: ifd, + size: data.length, + lastLoadTimestamp: Date.now(), + }; + + const dataEntry = {key: key, data: data}; + + const transaction = + this.db_.transaction(['settings', 'metadata', 'data'], 'readwrite'); + const metadataStore = transaction.objectStore('metadata'); + const dataStore = transaction.objectStore('data'); + + const onCacheEvicted = () => { + metadataStore.put(metadataEntry); // Add asynchronously. + dataStore.put(dataEntry); // Add asynchronously. + }; + + // Make sure there is enough space in the cache. + this.evictCache_(data.length, onCacheEvicted, () => {}, transaction); + }; + + // Check if the image is already in cache. If not, then save it to cache. + this.loadImage(key, timestamp, () => {}, onNotFoundInCache); + } + + /** + * Loads an image from the cache. + * + * @param {string} key Cache key. + * @param {number} timestamp Last modification timestamp. If different + * than the one in cache, then the entry will be invalidated. + * @param {function(number, number, ?string, string)} onSuccess Success + * callback with the image width, height, ?ifd, and data. + * @param {function()} onFailure Failure callback. + */ + loadImage(key, timestamp, onSuccess, onFailure) { + if (!this.db_) { + console.warn('Cache database not available.'); + onFailure(); + return; + } + + const transaction = + this.db_.transaction(['settings', 'metadata', 'data'], 'readwrite'); + const metadataStore = transaction.objectStore('metadata'); + const dataStore = transaction.objectStore('data'); + const metadataRequest = metadataStore.get(key); + const dataRequest = dataStore.get(key); + + let metadataEntry = null; + let metadataReceived = false; + let dataEntry = null; + let dataReceived = false; + + const onPartialSuccess = () => { + // Check if all sub-requests have finished. + if (!metadataReceived || !dataReceived) { + return; + } + + // Check if both entries are available or both unavailable. + if (!!metadataEntry != !!dataEntry) { + console.warn('Inconsistent cache database.'); + onFailure(); + return; + } + + // Process the responses. + if (!metadataEntry) { + // The image not found. + onFailure(); + } else if (metadataEntry.timestamp != timestamp) { + // The image is not up to date, so remove it. + this.removeImage(key, () => {}, () => {}, transaction); + onFailure(); + } else { + // The image is available. Update the last load time and return the + // image data. + metadataEntry.lastLoadTimestamp = Date.now(); + metadataStore.put(metadataEntry); // Added asynchronously. + onSuccess( + metadataEntry.width, metadataEntry.height, metadataEntry.ifd, + dataEntry.data); + } + }; + + metadataRequest.onsuccess = (e) => { + if (e.target.result) { + metadataEntry = e.target.result; + } + metadataReceived = true; + onPartialSuccess(); + }; + + dataRequest.onsuccess = (e) => { + if (e.target.result) { + dataEntry = e.target.result; + } + dataReceived = true; + onPartialSuccess(); + }; + + metadataRequest.onerror = () => { + console.warn('Failed to fetch metadata from the database.'); + metadataReceived = true; + onPartialSuccess(); + }; + + dataRequest.onerror = () => { + console.warn('Failed to fetch image data from the database.'); + dataReceived = true; + onPartialSuccess(); + }; + } + + /** + * Removes the image from the cache. + * + * @param {string} key Cache key. + * @param {function()=} opt_onSuccess Success callback. + * @param {function()=} opt_onFailure Failure callback. + * @param {IDBTransaction=} opt_transaction Transaction to be reused. If not + * provided, then a new one is created. + */ + removeImage(key, opt_onSuccess, opt_onFailure, opt_transaction) { + if (!this.db_) { + console.warn('Cache database not available.'); + return; + } + + const transaction = opt_transaction || + this.db_.transaction(['settings', 'metadata', 'data'], 'readwrite'); + const metadataStore = transaction.objectStore('metadata'); + const dataStore = transaction.objectStore('data'); + + let cacheSize = null; + let cacheSizeReceived = false; + let metadataEntry = null; + let metadataReceived = false; + + const onPartialSuccess = () => { + if (!cacheSizeReceived || !metadataReceived) { + return; + } + + // If either cache size or metadata entry is not available, then it is + // an error. + if (cacheSize === null || !metadataEntry) { + if (opt_onFailure) { + opt_onFailure(); + } + return; + } + + if (opt_onSuccess) { + opt_onSuccess(); + } + + this.setCacheSize_(cacheSize - metadataEntry.size, transaction); + metadataStore.delete(key); // Delete asynchronously. + dataStore.delete(key); // Delete asynchronously. + }; + + const onCacheSizeFailure = () => { + cacheSizeReceived = true; + }; + + const onCacheSizeSuccess = (result) => { + cacheSize = result; + cacheSizeReceived = true; + onPartialSuccess(); + }; + + // Fetch the current cache size. + this.fetchCacheSize_(onCacheSizeSuccess, onCacheSizeFailure, transaction); + + // Receive image's metadata. + const metadataRequest = metadataStore.get(key); + + metadataRequest.onsuccess = (e) => { + if (e.target.result) { + metadataEntry = e.target.result; + } + metadataReceived = true; + onPartialSuccess(); + }; + + metadataRequest.onerror = () => { + console.warn('Failed to remove an image.'); + metadataReceived = true; + onPartialSuccess(); + }; + } } /** @@ -20,14 +385,14 @@ * @type {string} * @const */ -ImageCache.DB_NAME = 'image-loader'; +const DB_NAME = 'image-loader'; /** * Cache database version. * @type {number} * @const */ -ImageCache.DB_VERSION = 16; +const DB_VERSION = 16; /** * Memory limit for images data in bytes. @@ -35,7 +400,7 @@ * @const * @type {number} */ -ImageCache.MEMORY_LIMIT = 250 * 1024 * 1024; // 250 MB. +const MEMORY_LIMIT = 250 * 1024 * 1024; // 250 MB. /** * Minimal amount of memory freed per eviction. Used to limit number of @@ -44,374 +409,4 @@ * @const * @type {number} */ -ImageCache.EVICTION_CHUNK_SIZE = 50 * 1024 * 1024; // 50 MB. - -/** - * Initializes the cache database. - * @param {function()} callback Completion callback. - */ -ImageCache.prototype.initialize = function(callback) { - // Establish a connection to the database or (re)create it if not available - // or not up to date. After changing the database's schema, increment - // ImageCache.DB_VERSION to force database recreating. - const openRequest = - window.indexedDB.open(ImageCache.DB_NAME, ImageCache.DB_VERSION); - - openRequest.onsuccess = function(e) { - this.db_ = e.target.result; - callback(); - }.bind(this); - - openRequest.onerror = callback; - - openRequest.onupgradeneeded = function(e) { - console.info('Cache database creating or upgrading.'); - const db = e.target.result; - if (db.objectStoreNames.contains('metadata')) { - db.deleteObjectStore('metadata'); - } - if (db.objectStoreNames.contains('data')) { - db.deleteObjectStore('data'); - } - if (db.objectStoreNames.contains('settings')) { - db.deleteObjectStore('settings'); - } - db.createObjectStore('metadata', {keyPath: 'key'}); - db.createObjectStore('data', {keyPath: 'key'}); - db.createObjectStore('settings', {keyPath: 'key'}); - }; -}; - -/** - * Sets size of the cache. - * - * @param {number} size Size in bytes. - * @param {IDBTransaction=} opt_transaction Transaction to be reused. If not - * provided, then a new one is created. - * @private - */ -ImageCache.prototype.setCacheSize_ = function(size, opt_transaction) { - const transaction = - opt_transaction || this.db_.transaction(['settings'], 'readwrite'); - const settingsStore = transaction.objectStore('settings'); - - settingsStore.put({key: 'size', value: size}); // Update asynchronously. -}; - -/** - * Fetches current size of the cache. - * - * @param {function(number)} onSuccess Callback to return the size. - * @param {function()} onFailure Failure callback. - * @param {IDBTransaction=} opt_transaction Transaction to be reused. If not - * provided, then a new one is created. - * @private - */ -ImageCache.prototype.fetchCacheSize_ = function( - onSuccess, onFailure, opt_transaction) { - const transaction = opt_transaction || - this.db_.transaction(['settings', 'metadata', 'data'], 'readwrite'); - const settingsStore = transaction.objectStore('settings'); - const sizeRequest = settingsStore.get('size'); - - sizeRequest.onsuccess = function(e) { - if (e.target.result) { - onSuccess(e.target.result.value); - } else { - onSuccess(0); - } - }; - - sizeRequest.onerror = function() { - console.warn('Failed to fetch size from the database.'); - onFailure(); - }; -}; - -/** - * Evicts the least used elements in cache to make space for a new image and - * updates size of the cache taking into account the upcoming item. - * - * @param {number} size Requested size. - * @param {function()} onSuccess Success callback. - * @param {function()} onFailure Failure callback. - * @param {IDBTransaction=} opt_transaction Transaction to be reused. If not - * provided, then a new one is created. - * @private - */ -ImageCache.prototype.evictCache_ = function( - size, onSuccess, onFailure, opt_transaction) { - const transaction = opt_transaction || - this.db_.transaction(['settings', 'metadata', 'data'], 'readwrite'); - - // Check if the requested size is smaller than the cache size. - if (size > ImageCache.MEMORY_LIMIT) { - onFailure(); - return; - } - - const onCacheSize = function(cacheSize) { - if (size < ImageCache.MEMORY_LIMIT - cacheSize) { - // Enough space, no need to evict. - this.setCacheSize_(cacheSize + size, transaction); - onSuccess(); - return; - } - - let bytesToEvict = Math.max(size, ImageCache.EVICTION_CHUNK_SIZE); - - // Fetch all metadata. - const metadataEntries = []; - const metadataStore = transaction.objectStore('metadata'); - const dataStore = transaction.objectStore('data'); - - const onEntriesFetched = function() { - metadataEntries.sort(function(a, b) { - return b.lastLoadTimestamp - a.lastLoadTimestamp; - }); - - let totalEvicted = 0; - while (bytesToEvict > 0) { - const entry = metadataEntries.pop(); - totalEvicted += entry.size; - bytesToEvict -= entry.size; - metadataStore.delete(entry.key); // Remove asynchronously. - dataStore.delete(entry.key); // Remove asynchronously. - } - - this.setCacheSize_(cacheSize - totalEvicted + size, transaction); - }.bind(this); - - metadataStore.openCursor().onsuccess = function(e) { - const cursor = e.target.result; - if (cursor) { - metadataEntries.push(cursor.value); - cursor.continue(); - } else { - onEntriesFetched(); - } - }; - }.bind(this); - - this.fetchCacheSize_(onCacheSize, onFailure, transaction); -}; - -/** - * Saves an image in the cache. - * - * @param {string} key Cache key. - * @param {number} timestamp Last modification timestamp. Used to detect - * if the image cache entry is out of date. - * @param {number} width Image width. - * @param {number} height Image height. - * @param {?string} ifd Image ifd, null if none. - * @param {string} data Image data. - */ -ImageCache.prototype.saveImage = function( - key, timestamp, width, height, ifd, data) { - if (!this.db_) { - console.warn('Cache database not available.'); - return; - } - - const onNotFoundInCache = function() { - const metadataEntry = { - key: key, - timestamp: timestamp, - width: width, - height: height, - ifd: ifd, - size: data.length, - lastLoadTimestamp: Date.now(), - }; - - const dataEntry = {key: key, data: data}; - - const transaction = - this.db_.transaction(['settings', 'metadata', 'data'], 'readwrite'); - const metadataStore = transaction.objectStore('metadata'); - const dataStore = transaction.objectStore('data'); - - const onCacheEvicted = function() { - metadataStore.put(metadataEntry); // Add asynchronously. - dataStore.put(dataEntry); // Add asynchronously. - }; - - // Make sure there is enough space in the cache. - this.evictCache_(data.length, onCacheEvicted, function() {}, transaction); - }.bind(this); - - // Check if the image is already in cache. If not, then save it to cache. - this.loadImage(key, timestamp, function() {}, onNotFoundInCache); -}; - -/** - * Loads an image from the cache. - * - * @param {string} key Cache key. - * @param {number} timestamp Last modification timestamp. If different - * than the one in cache, then the entry will be invalidated. - * @param {function(number, number, ?string, string)} onSuccess Success - * callback with the image width, height, ?ifd, and data. - * @param {function()} onFailure Failure callback. - */ -ImageCache.prototype.loadImage = function( - key, timestamp, onSuccess, onFailure) { - if (!this.db_) { - console.warn('Cache database not available.'); - onFailure(); - return; - } - - const transaction = - this.db_.transaction(['settings', 'metadata', 'data'], 'readwrite'); - const metadataStore = transaction.objectStore('metadata'); - const dataStore = transaction.objectStore('data'); - const metadataRequest = metadataStore.get(key); - const dataRequest = dataStore.get(key); - - let metadataEntry = null; - let metadataReceived = false; - let dataEntry = null; - let dataReceived = false; - - const onPartialSuccess = function() { - // Check if all sub-requests have finished. - if (!metadataReceived || !dataReceived) { - return; - } - - // Check if both entries are available or both unavailable. - if (!!metadataEntry != !!dataEntry) { - console.warn('Inconsistent cache database.'); - onFailure(); - return; - } - - // Process the responses. - if (!metadataEntry) { - // The image not found. - onFailure(); - } else if (metadataEntry.timestamp != timestamp) { - // The image is not up to date, so remove it. - this.removeImage(key, function() {}, function() {}, transaction); - onFailure(); - } else { - // The image is available. Update the last load time and return the - // image data. - metadataEntry.lastLoadTimestamp = Date.now(); - metadataStore.put(metadataEntry); // Added asynchronously. - onSuccess( - metadataEntry.width, metadataEntry.height, metadataEntry.ifd, - dataEntry.data); - } - }.bind(this); - - metadataRequest.onsuccess = function(e) { - if (e.target.result) { - metadataEntry = e.target.result; - } - metadataReceived = true; - onPartialSuccess(); - }; - - dataRequest.onsuccess = function(e) { - if (e.target.result) { - dataEntry = e.target.result; - } - dataReceived = true; - onPartialSuccess(); - }; - - metadataRequest.onerror = function() { - console.warn('Failed to fetch metadata from the database.'); - metadataReceived = true; - onPartialSuccess(); - }; - - dataRequest.onerror = function() { - console.warn('Failed to fetch image data from the database.'); - dataReceived = true; - onPartialSuccess(); - }; -}; - -/** - * Removes the image from the cache. - * - * @param {string} key Cache key. - * @param {function()=} opt_onSuccess Success callback. - * @param {function()=} opt_onFailure Failure callback. - * @param {IDBTransaction=} opt_transaction Transaction to be reused. If not - * provided, then a new one is created. - */ -ImageCache.prototype.removeImage = function( - key, opt_onSuccess, opt_onFailure, opt_transaction) { - if (!this.db_) { - console.warn('Cache database not available.'); - return; - } - - const transaction = opt_transaction || - this.db_.transaction(['settings', 'metadata', 'data'], 'readwrite'); - const metadataStore = transaction.objectStore('metadata'); - const dataStore = transaction.objectStore('data'); - - let cacheSize = null; - let cacheSizeReceived = false; - let metadataEntry = null; - let metadataReceived = false; - - const onPartialSuccess = function() { - if (!cacheSizeReceived || !metadataReceived) { - return; - } - - // If either cache size or metadata entry is not available, then it is - // an error. - if (cacheSize === null || !metadataEntry) { - if (opt_onFailure) { - opt_onFailure(); - } - return; - } - - if (opt_onSuccess) { - opt_onSuccess(); - } - - this.setCacheSize_(cacheSize - metadataEntry.size, transaction); - metadataStore.delete(key); // Delete asynchronously. - dataStore.delete(key); // Delete asynchronously. - }.bind(this); - - const onCacheSizeFailure = function() { - cacheSizeReceived = true; - }; - - const onCacheSizeSuccess = function(result) { - cacheSize = result; - cacheSizeReceived = true; - onPartialSuccess(); - }; - - // Fetch the current cache size. - this.fetchCacheSize_(onCacheSizeSuccess, onCacheSizeFailure, transaction); - - // Receive image's metadata. - const metadataRequest = metadataStore.get(key); - - metadataRequest.onsuccess = function(e) { - if (e.target.result) { - metadataEntry = e.target.result; - } - metadataReceived = true; - onPartialSuccess(); - }; - - metadataRequest.onerror = function() { - console.warn('Failed to remove an image.'); - metadataReceived = true; - onPartialSuccess(); - }; -}; +const EVICTION_CHUNK_SIZE = 50 * 1024 * 1024; // 50 MB.
diff --git a/ui/file_manager/image_loader/image_loader.js b/ui/file_manager/image_loader/image_loader.js index 758e0eb..feabf6c 100644 --- a/ui/file_manager/image_loader/image_loader.js +++ b/ui/file_manager/image_loader/image_loader.js
@@ -12,58 +12,130 @@ /** * Loads and resizes an image. - * @constructor */ -export function ImageLoader() { - /** - * Persistent cache object. - * @type {ImageCache} - * @private - */ - this.cache_ = new ImageCache(); +export class ImageLoader { + constructor() { + /** + * Persistent cache object. + * @type {ImageCache} + * @private + */ + this.cache_ = new ImageCache(); - /** - * Manages pending requests and runs them in order of priorities. - * @type {Scheduler} - * @private - */ - this.scheduler_ = new Scheduler(); + /** + * Manages pending requests and runs them in order of priorities. + * @type {Scheduler} + * @private + */ + this.scheduler_ = new Scheduler(); - // Initialize the cache and then start the scheduler. - this.cache_.initialize(() => this.scheduler_.start()); + // Initialize the cache and then start the scheduler. + this.cache_.initialize(() => this.scheduler_.start()); - // Listen for incoming requests. - chrome.runtime.onMessageExternal.addListener((msg, sender, sendResponse) => { - if (!sender.origin || !msg) { - return; - } + // Listen for incoming requests. + chrome.runtime.onMessageExternal.addListener( + (msg, sender, sendResponse) => { + if (!sender.origin || !msg) { + return; + } - if (ImageLoader.ALLOWED_CLIENT_ORIGINS.indexOf(sender.origin) === -1) { - return; - } + if (ALLOWED_CLIENT_ORIGINS.indexOf(sender.origin) === -1) { + return; + } - this.onIncomingRequest_(msg, sender.origin, sendResponse); - }); + this.onIncomingRequest_(msg, sender.origin, sendResponse); + }); - chrome.runtime['onConnectNative'].addListener((port) => { - if (port.sender.nativeApplication != 'com.google.ash_thumbnail_loader') { - port.disconnect(); - return; - } - - port.onMessage.addListener((msg) => { - // Each connection is expected to handle a single request only. - const started = this.onIncomingRequest_( - msg, port.sender.nativeApplication, response => { - port.postMessage(response); - port.disconnect(); - }); - - if (!started) { + chrome.runtime['onConnectNative'].addListener((port) => { + if (port.sender.nativeApplication != 'com.google.ash_thumbnail_loader') { port.disconnect(); + return; } + + port.onMessage.addListener((msg) => { + // Each connection is expected to handle a single request only. + const started = this.onIncomingRequest_( + msg, port.sender.nativeApplication, response => { + port.postMessage(response); + port.disconnect(); + }); + + if (!started) { + port.disconnect(); + } + }); }); - }); + } + + /** + * Handler for incoming requests. + * + * @param {*} request_data A LoadImageRequest (received untyped). + * @param {!string} senderOrigin + * @param {function(*): void} sendResponse + */ + onIncomingRequest_(request_data, senderOrigin, sendResponse) { + const request = /** @type {!LoadImageRequest} */ (request_data); + + // Sending a response may fail if the receiver already went offline. + // This is not an error, but a normal and quite common situation. + const failSafeSendResponse = function(response) { + try { + sendResponse(response); + } catch (e) { + // Ignore the error. + } + }; + // Incoming requests won't have the full type. + assert(!(request.orientation instanceof ImageOrientation)); + assert(!(typeof request.orientation === 'number')); + + if (request.orientation) { + request.orientation = + ImageOrientation.fromRotationAndScale(request.orientation); + } else { + request.orientation = new ImageOrientation(1, 0, 0, 1); + } + return this.onMessage_(senderOrigin, request, failSafeSendResponse); + } + + /** + * Handles a request. Depending on type of the request, starts or stops + * an image task. + * + * @param {string} senderOrigin Sender's origin. + * @param {!LoadImageRequest} request Pre-processed request. + * @param {function(!LoadImageResponse)} callback Callback to be called to + * return response. + * @return {boolean} True if the message channel should stay alive until the + * callback is called. + * @private + */ + onMessage_(senderOrigin, request, callback) { + const requestId = senderOrigin + ':' + request.taskId; + if (request.cancel) { + // Cancel a task. + this.scheduler_.remove(requestId); + return false; // No callback calls. + } else { + // Create a request task and add it to the scheduler (queue). + const requestTask = + new ImageRequestTask(requestId, this.cache_, request, callback); + this.scheduler_.add(requestTask); + return true; // Request will call the callback. + } + } + + /** + * Returns the singleton instance. + * @return {ImageLoader} ImageLoader object. + */ + static getInstance() { + if (!ImageLoader.instance_) { + ImageLoader.instance_ = new ImageLoader(); + } + return ImageLoader.instance_; + } } /** @@ -72,77 +144,6 @@ * @const * @type {Array<string>} */ -ImageLoader.ALLOWED_CLIENT_ORIGINS = [ +const ALLOWED_CLIENT_ORIGINS = [ 'chrome://file-manager', // File Manager SWA ]; - -/** - * Handler for incoming requests. - * - * @param {*} request_data A LoadImageRequest (received untyped). - * @param {!string} senderOrigin - * @param {function(*): void} sendResponse - */ -ImageLoader.prototype.onIncomingRequest_ = function( - request_data, senderOrigin, sendResponse) { - const request = /** @type {!LoadImageRequest} */ (request_data); - - // Sending a response may fail if the receiver already went offline. - // This is not an error, but a normal and quite common situation. - const failSafeSendResponse = function(response) { - try { - sendResponse(response); - } catch (e) { - // Ignore the error. - } - }; - // Incoming requests won't have the full type. - assert(!(request.orientation instanceof ImageOrientation)); - assert(!(typeof request.orientation === 'number')); - - if (request.orientation) { - request.orientation = - ImageOrientation.fromRotationAndScale(request.orientation); - } else { - request.orientation = new ImageOrientation(1, 0, 0, 1); - } - return this.onMessage_(senderOrigin, request, failSafeSendResponse); -}; - -/** - * Handles a request. Depending on type of the request, starts or stops - * an image task. - * - * @param {string} senderOrigin Sender's origin. - * @param {!LoadImageRequest} request Pre-processed request. - * @param {function(!LoadImageResponse)} callback Callback to be called to - * return response. - * @return {boolean} True if the message channel should stay alive until the - * callback is called. - * @private - */ -ImageLoader.prototype.onMessage_ = function(senderOrigin, request, callback) { - const requestId = senderOrigin + ':' + request.taskId; - if (request.cancel) { - // Cancel a task. - this.scheduler_.remove(requestId); - return false; // No callback calls. - } else { - // Create a request task and add it to the scheduler (queue). - const requestTask = - new ImageRequestTask(requestId, this.cache_, request, callback); - this.scheduler_.add(requestTask); - return true; // Request will call the callback. - } -}; - -/** - * Returns the singleton instance. - * @return {ImageLoader} ImageLoader object. - */ -ImageLoader.getInstance = function() { - if (!ImageLoader.instance_) { - ImageLoader.instance_ = new ImageLoader(); - } - return ImageLoader.instance_; -};
diff --git a/ui/file_manager/image_loader/image_loader_client.js b/ui/file_manager/image_loader/image_loader_client.js index 43efc228..8dd18b8 100644 --- a/ui/file_manager/image_loader/image_loader_client.js +++ b/ui/file_manager/image_loader/image_loader_client.js
@@ -13,28 +13,189 @@ * its responses. * * Implements cache, which is stored in the calling extension. - * - * @constructor */ -export function ImageLoaderClient() { - /** - * @type {number} - * @private - */ - this.lastTaskId_ = 0; +export class ImageLoaderClient { + constructor() { + /** + * @type {number} + * @private + */ + this.lastTaskId_ = 0; + + /** + * LRU cache for images. + * @type {!LruCache.<{ + * timestamp: ?number, + * width: number, + * height: number, + * ifd: ?string, + * data: string + * }>} + * @private + */ + this.cache_ = new LruCache(CACHE_MEMORY_LIMIT); + } /** - * LRU cache for images. - * @type {!LruCache.<{ - * timestamp: ?number, - * width: number, - * height: number, - * ifd: ?string, - * data: string - * }>} + * Returns a singleton instance. + * @return {ImageLoaderClient} Client instance. + */ + static getInstance() { + if (!ImageLoaderClient.instance_) { + ImageLoaderClient.instance_ = new ImageLoaderClient(); + } + return ImageLoaderClient.instance_; + } + + /** + * Records binary metrics. Counts for true and false are stored as a + * histogram. + * @param {string} name Histogram's name. + * @param {boolean} value True or false. + */ + static recordBinary(name, value) { + chrome.metricsPrivate.recordValue( + { + metricName: 'ImageLoader.Client.' + name, + type: chrome.metricsPrivate.MetricTypeType.HISTOGRAM_LINEAR, + min: 1, // According to histogram.h, this should be 1 for enums. + max: 2, // Maximum should be exclusive. + buckets: 3, + }, // Number of buckets: 0, 1 and overflowing 2. + value ? 1 : 0); + } + + /** + * Records percent metrics, stored as a histogram. + * @param {string} name Histogram's name. + * @param {number} value Value (0..100). + */ + static recordPercentage(name, value) { + chrome.metricsPrivate.recordPercentage( + 'ImageLoader.Client.' + name, Math.round(value)); + } + + /** + * Sends a message to the Image Loader extension. + * @param {!LoadImageRequest} request The image request. + * @param {!function(!LoadImageResponse)=} callback Response handling + * callback. The response is passed as a hash array. * @private */ - this.cache_ = new LruCache(ImageLoaderClient.CACHE_MEMORY_LIMIT); + static sendMessage_(request, callback) { + chrome.runtime.sendMessage(EXTENSION_ID, request, callback); + } + + /** + * Loads and resizes and image. + * + * @param {!LoadImageRequest} request + * @param {!function(!LoadImageResponse)=} callback Response handling + * callback. + * @return {?number} Remote task id or null if loaded from cache. + */ + load(request, callback) { + // Record cache usage. + ImageLoaderClient.recordPercentage( + 'Cache.Usage', this.cache_.size() / CACHE_MEMORY_LIMIT * 100.0); + + // Replace the client origin with the image loader extension origin. + request.url = request.url.replace(CLIENT_URL_REGEX, IMAGE_LOADER_URL); + request.url = request.url.replace(CLIENT_SWA_REGEX, IMAGE_LOADER_URL); + + // Try to load from cache, if available. + const cacheKey = LoadImageRequest.cacheKey(request); + if (cacheKey) { + if (request.cache) { + // Load from cache. + ImageLoaderClient.recordBinary('Cached', true); + let cachedValue = this.cache_.get(cacheKey); + // Check if the image in cache is up to date. If not, then remove it. + if (cachedValue && cachedValue.timestamp != request.timestamp) { + this.cache_.remove(cacheKey); + cachedValue = null; + } + if (cachedValue && cachedValue.data && cachedValue.width && + cachedValue.height) { + ImageLoaderClient.recordBinary('Cache.HitMiss', true); + callback( + new LoadImageResponse(LoadImageResponseStatus.SUCCESS, null, { + width: cachedValue.width, + height: cachedValue.height, + ifd: cachedValue.ifd, + data: cachedValue.data, + })); + return null; + } else { + ImageLoaderClient.recordBinary('Cache.HitMiss', false); + } + } else { + // Remove from cache. + ImageLoaderClient.recordBinary('Cached', false); + this.cache_.remove(cacheKey); + } + } + + // Not available in cache, performing a request to a remote extension. + this.lastTaskId_++; + request.taskId = this.lastTaskId_; + + ImageLoaderClient.sendMessage_(request, (result_data) => { + if (chrome.runtime.lastError) { + console.warn(chrome.runtime.lastError.message); + callback(new LoadImageResponse( + LoadImageResponseStatus.ERROR, + /** @type {number} */ (request.taskId))); + return; + } + // TODO(tapted): Move to a prototype for better type checking. + const result = /** @type {!LoadImageResponse} */ (result_data); + // Save to cache. + if (cacheKey && request.cache) { + const value = LoadImageResponse.cacheValue(result, request.timestamp); + if (value) { + this.cache_.put(cacheKey, value, value.data.length); + } + } + callback(result); + }); + return request.taskId; + } + + /** + * Cancels the request. Note the original callback may still be invoked if + * this message doesn't reach the ImageLoader before it starts processing. + * @param {number} taskId Task id returned by ImageLoaderClient.load(). + */ + cancel(taskId) { + ImageLoaderClient.sendMessage_( + LoadImageRequest.createCancel(taskId), (result) => {}); + } + + // Helper functions. + + /** + * Loads and resizes and image. + * + * @param {!LoadImageRequest} request + * @param {HTMLImageElement} image Image node to load the requested picture + * into. + * @param {function()} onSuccess Callback for success. + * @param {function()} onError Callback for failure. + * @return {?number} Remote task id or null if loaded from cache. + */ + static loadToImage(request, image, onSuccess, onError) { + const callback = (result) => { + if (!result || result.status == LoadImageResponseStatus.ERROR) { + onError(); + return; + } + image.src = result.data; + onSuccess(); + }; + + return ImageLoaderClient.getInstance().load(request, callback); + } } /** @@ -42,161 +203,27 @@ * @const * @type {string} */ -ImageLoaderClient.EXTENSION_ID = 'pmfjbimdmchhbnneeidfognadeopoehp'; - -/** - * Returns a singleton instance. - * @return {ImageLoaderClient} Client instance. - */ -ImageLoaderClient.getInstance = function() { - if (!ImageLoaderClient.instance_) { - ImageLoaderClient.instance_ = new ImageLoaderClient(); - } - return ImageLoaderClient.instance_; -}; - -/** - * Records binary metrics. Counts for true and false are stored as a histogram. - * @param {string} name Histogram's name. - * @param {boolean} value True or false. - */ -ImageLoaderClient.recordBinary = function(name, value) { - chrome.metricsPrivate.recordValue( - { metricName: 'ImageLoader.Client.' + name, - type: chrome.metricsPrivate.MetricTypeType.HISTOGRAM_LINEAR, - min: 1, // According to histogram.h, this should be 1 for enums. - max: 2, // Maximum should be exclusive. - buckets: 3 }, // Number of buckets: 0, 1 and overflowing 2. - value ? 1 : 0); -}; - -/** - * Records percent metrics, stored as a histogram. - * @param {string} name Histogram's name. - * @param {number} value Value (0..100). - */ -ImageLoaderClient.recordPercentage = function(name, value) { - chrome.metricsPrivate.recordPercentage('ImageLoader.Client.' + name, - Math.round(value)); -}; - -/** - * Sends a message to the Image Loader extension. - * @param {!LoadImageRequest} request The image request. - * @param {!function(!LoadImageResponse)=} callback Response handling callback. - * The response is passed as a hash array. - * @private - */ -ImageLoaderClient.sendMessage_ = function(request, callback) { - chrome.runtime.sendMessage(ImageLoaderClient.EXTENSION_ID, request, callback); -}; +const EXTENSION_ID = 'pmfjbimdmchhbnneeidfognadeopoehp'; /** * Image loader client extension request URL matcher. * @const {!RegExp} */ -ImageLoaderClient.CLIENT_URL_REGEX = /filesystem:chrome-extension:\/\/[a-z]+/; +const CLIENT_URL_REGEX = /filesystem:chrome-extension:\/\/[a-z]+/; /** * Image loader client chrome://file-manager request URL matcher. * @const {!RegExp} */ -ImageLoaderClient.CLIENT_SWA_REGEX = /filesystem:chrome:\/\/file-manager/; +const CLIENT_SWA_REGEX = /filesystem:chrome:\/\/file-manager/; /** - * All client request URL match ImageLoaderClient.CLIENT_URL_REGEX and all are + * All client request URL match CLIENT_URL_REGEX and all are * rewritten: the client extension id part of the request URL is replaced with * the image loader extension id. * @const {string} */ -ImageLoaderClient.IMAGE_LOADER_URL = - 'filesystem:chrome-extension://' + ImageLoaderClient.EXTENSION_ID; - -/** - * Loads and resizes and image. - * - * @param {!LoadImageRequest} request - * @param {!function(!LoadImageResponse)=} callback Response handling callback. - * @return {?number} Remote task id or null if loaded from cache. - */ -ImageLoaderClient.prototype.load = function(request, callback) { - // Record cache usage. - ImageLoaderClient.recordPercentage('Cache.Usage', - this.cache_.size() / ImageLoaderClient.CACHE_MEMORY_LIMIT * 100.0); - - // Replace the client origin with the image loader extension origin. - request.url = request.url.replace( - ImageLoaderClient.CLIENT_URL_REGEX, ImageLoaderClient.IMAGE_LOADER_URL); - request.url = request.url.replace( - ImageLoaderClient.CLIENT_SWA_REGEX, ImageLoaderClient.IMAGE_LOADER_URL); - - // Try to load from cache, if available. - const cacheKey = LoadImageRequest.cacheKey(request); - if (cacheKey) { - if (request.cache) { - // Load from cache. - ImageLoaderClient.recordBinary('Cached', true); - let cachedValue = this.cache_.get(cacheKey); - // Check if the image in cache is up to date. If not, then remove it. - if (cachedValue && cachedValue.timestamp != request.timestamp) { - this.cache_.remove(cacheKey); - cachedValue = null; - } - if (cachedValue && cachedValue.data && - cachedValue.width && cachedValue.height) { - ImageLoaderClient.recordBinary('Cache.HitMiss', true); - callback(new LoadImageResponse(LoadImageResponseStatus.SUCCESS, null, { - width: cachedValue.width, - height: cachedValue.height, - ifd: cachedValue.ifd, - data: cachedValue.data, - })); - return null; - } else { - ImageLoaderClient.recordBinary('Cache.HitMiss', false); - } - } else { - // Remove from cache. - ImageLoaderClient.recordBinary('Cached', false); - this.cache_.remove(cacheKey); - } - } - - // Not available in cache, performing a request to a remote extension. - this.lastTaskId_++; - request.taskId = this.lastTaskId_; - - ImageLoaderClient.sendMessage_(request, function(result_data) { - if (chrome.runtime.lastError) { - console.warn(chrome.runtime.lastError.message); - callback(new LoadImageResponse( - LoadImageResponseStatus.ERROR, - /** @type {number} */ (request.taskId))); - return; - } - // TODO(tapted): Move to a prototype for better type checking. - const result = /** @type {!LoadImageResponse} */ (result_data); - // Save to cache. - if (cacheKey && request.cache) { - const value = LoadImageResponse.cacheValue(result, request.timestamp); - if (value) { - this.cache_.put(cacheKey, value, value.data.length); - } - } - callback(result); - }.bind(this)); - return request.taskId; -}; - -/** - * Cancels the request. Note the original callback may still be invoked if this - * message doesn't reach the ImageLoader before it starts processing. - * @param {number} taskId Task id returned by ImageLoaderClient.load(). - */ -ImageLoaderClient.prototype.cancel = function(taskId) { - ImageLoaderClient.sendMessage_( - LoadImageRequest.createCancel(taskId), function(result) {}); -}; +const IMAGE_LOADER_URL = 'filesystem:chrome-extension://' + EXTENSION_ID; /** * Memory limit for images data in bytes. @@ -204,29 +231,4 @@ * @const * @type {number} */ -ImageLoaderClient.CACHE_MEMORY_LIMIT = 20 * 1024 * 1024; // 20 MB. - -// Helper functions. - -/** - * Loads and resizes and image. - * - * @param {!LoadImageRequest} request - * @param {HTMLImageElement} image Image node to load the requested picture - * into. - * @param {function()} onSuccess Callback for success. - * @param {function()} onError Callback for failure. - * @return {?number} Remote task id or null if loaded from cache. - */ -ImageLoaderClient.loadToImage = function(request, image, onSuccess, onError) { - const callback = function(result) { - if (!result || result.status == LoadImageResponseStatus.ERROR) { - onError(); - return; - } - image.src = result.data; - onSuccess(); - }; - - return ImageLoaderClient.getInstance().load(request, callback); -}; +const CACHE_MEMORY_LIMIT = 20 * 1024 * 1024; // 20 MB.
diff --git a/ui/file_manager/image_loader/image_request_task.js b/ui/file_manager/image_loader/image_request_task.js index 0e694d37..3a8f3ea9 100644 --- a/ui/file_manager/image_loader/image_request_task.js +++ b/ui/file_manager/image_loader/image_request_task.js
@@ -14,100 +14,629 @@ /** * Creates and starts downloading and then resizing of the image. Finally, * returns the image using the callback. - * - * @param {string} id Request ID. - * @param {ImageCache} cache Cache object. - * @param {!LoadImageRequest} request Request message as a hash array. - * @param {function(!LoadImageResponse)} callback Response handler. - * @constructor */ -export function ImageRequestTask(id, cache, request, callback) { +export class ImageRequestTask { /** - * Global ID (concatenated client ID and client request ID). - * @type {string} - * @private + * @param {string} id Request ID. + * @param {ImageCache} cache Cache object. + * @param {!LoadImageRequest} request Request message as a hash array. + * @param {function(!LoadImageResponse)} callback Response handler. */ - this.id_ = id; + constructor(id, cache, request, callback) { + /** + * Global ID (concatenated client ID and client request ID). + * @type {string} + * @private + */ + this.id_ = id; + + /** + * @type {ImageCache} + * @private + */ + this.cache_ = cache; + + /** + * @type {!LoadImageRequest} + * @private + */ + this.request_ = request; + + /** + * @type {function(!LoadImageResponse)} + * @private + */ + this.sendResponse_ = callback; + + /** + * Temporary image used to download images. + * @type {Image} + * @private + */ + this.image_ = new Image(); + + /** + * MIME type of the fetched image. + * @type {?string} + * @private + */ + this.contentType_ = null; + + /** + * IFD data of the fetched image. Only RAW images provide a non-null + * ifd at this time. Drive images might provide an ifd in future. + * @type {?string} + * @private + */ + this.ifd_ = null; + + /** + * Used to download remote images using http:// or https:// protocols. + * @type {XMLHttpRequest} + * @private + */ + this.xhr_ = null; + + /** + * Temporary canvas used to resize and compress the image. + * @type {HTMLCanvasElement} + * @private + */ + this.canvas_ = + /** @type {HTMLCanvasElement} */ (document.createElement('canvas')); + + /** + * @type {CanvasRenderingContext2D} + * @private + */ + this.context_ = + /** @type {CanvasRenderingContext2D} */ (this.canvas_.getContext('2d')); + + /** + * @type {ImageOrientation|null} + */ + this.renderOrientation_ = null; + + /** + * Callback to be called once downloading is finished. + * @type {?function()} + * @private + */ + this.downloadCallback_ = null; + + /** + * @type {boolean} + * @private + */ + this.aborted_ = false; + } /** - * @type {ImageCache} - * @private + * Extracts MIME type of a data URL. + * @param {string|undefined} dataUrl Data URL. + * @return {?string} MIME type string, or null if the URL is invalid. */ - this.cache_ = cache; + static getDataUrlMimeType(dataUrl) { + const dataUrlMatches = (dataUrl || '').match(/^data:([^,;]*)[,;]/); + return dataUrlMatches ? dataUrlMatches[1] : null; + } /** - * @type {!LoadImageRequest} - * @private + * Returns ID of the request. + * @return {string} Request ID. */ - this.request_ = request; + getId() { + return this.id_; + } /** - * @type {function(!LoadImageResponse)} - * @private + * Returns the client's task ID for the request. + * @return {number} */ - this.sendResponse_ = callback; + getClientTaskId() { + // Every incoming request should have been given a taskId. + assert(this.request_.taskId); + return this.request_.taskId; + } /** - * Temporary image used to download images. - * @type {Image} - * @private + * Returns priority of the request. The higher priority, the faster it will + * be handled. The highest priority is 0. The default one is 2. + * + * @return {number} Priority. */ - this.image_ = new Image(); + getPriority() { + return (this.request_.priority !== undefined) ? this.request_.priority : 2; + } /** - * MIME type of the fetched image. - * @type {?string} - * @private + * Tries to load the image from cache, if it exists in the cache, and sends + * the response. Fails if the image is not found in the cache. + * + * @param {function()} onSuccess Success callback. + * @param {function()} onFailure Failure callback. */ - this.contentType_ = null; + loadFromCacheAndProcess(onSuccess, onFailure) { + this.loadFromCache_( + (width, height, ifd, data) => { // Found in cache. + this.ifd_ = ifd; + this.sendImageData_(width, height, data); + onSuccess(); + }, + onFailure); // Not found in cache. + } /** - * IFD data of the fetched image. Only RAW images provide a non-null - * ifd at this time. Drive images might provide an ifd in future. - * @type {?string} - * @private + * Tries to download the image, resizes and sends the response. + * + * @param {function()} callback Completion callback. */ - this.ifd_ = null; + downloadAndProcess(callback) { + if (this.downloadCallback_) { + throw new Error('Downloading already started.'); + } + + this.downloadCallback_ = callback; + this.downloadThumbnail_( + this.onImageLoad_.bind(this), this.onImageError_.bind(this)); + } /** - * Used to download remote images using http:// or https:// protocols. - * @type {XMLHttpRequest} + * Fetches the image from the persistent cache. + * + * @param {function(number, number, ?string, string)} onSuccess + * Success callback with the image width, height, ?ifd, and data. + * @param {function()} onFailure Failure callback. * @private */ - this.xhr_ = null; + loadFromCache_(onSuccess, onFailure) { + const cacheKey = LoadImageRequest.cacheKey(this.request_); + + if (!cacheKey) { + // Cache key is not provided for the request. + onFailure(); + return; + } + + if (!this.request_.cache) { + // Cache is disabled for this request; therefore, remove it from cache + // if existed. + this.cache_.removeImage(cacheKey); + onFailure(); + return; + } + + const timestamp = this.request_.timestamp; + if (!timestamp) { + // Persistent cache is available only when a timestamp is provided. + onFailure(); + return; + } + + this.cache_.loadImage(cacheKey, timestamp, onSuccess, onFailure); + } /** - * Temporary canvas used to resize and compress the image. - * @type {HTMLCanvasElement} + * Saves the image to the persistent cache. + * + * @param {number} width Image width. + * @param {number} height Image height. + * @param {string} data Image data. * @private */ - this.canvas_ = - /** @type {HTMLCanvasElement} */ (document.createElement('canvas')); + saveToCache_(width, height, data) { + const timestamp = this.request_.timestamp; + + if (!this.request_.cache || !timestamp) { + // Persistent cache is available only when a timestamp is provided. + return; + } + + const cacheKey = LoadImageRequest.cacheKey(this.request_); + if (!cacheKey) { + // Cache key is not provided for the request. + return; + } + + this.cache_.saveImage(cacheKey, timestamp, width, height, this.ifd_, data); + } /** - * @type {CanvasRenderingContext2D} + * Gets the target image size for external thumbnails, where supported. + The defaults replicate drivefs thumbnailer behavior. + * @return {{width: !number, height: !number}} + */ + targetThumbnailSize_() { + const crop = !!this.request_.crop; + const defaultWidth = crop ? ImageRequestTask.DEFAULT_THUMBNAIL_SQUARE_SIZE : + ImageRequestTask.DEFAULT_THUMBNAIL_WIDTH; + const defaultHeight = crop ? + ImageRequestTask.DEFAULT_THUMBNAIL_SQUARE_SIZE : + ImageRequestTask.DEFAULT_THUMBNAIL_HEIGHT; + return { + width: this.request_.width || defaultWidth, + height: this.request_.height || defaultHeight, + }; + } + + /** + * Loads |this.image_| with the |this.request_.url| source or the thumbnail + * image of the source. + * + * @param {function()} onSuccess Success callback. + * @param {function()} onFailure Failure callback. * @private */ - this.context_ = - /** @type {CanvasRenderingContext2D} */ (this.canvas_.getContext('2d')); + downloadThumbnail_(onSuccess, onFailure) { + // Load methods below set |this.image_.src|. Call revokeObjectURL(src) to + // release resources if the image src was created with createObjectURL(). + this.image_.onload = () => { + URL.revokeObjectURL(this.image_.src); + onSuccess(); + }; + this.image_.onerror = () => { + URL.revokeObjectURL(this.image_.src); + onFailure(); + }; + + // Load dataURL sources directly. + const dataUrlMimeType = + ImageRequestTask.getDataUrlMimeType(this.request_.url); + if (dataUrlMimeType) { + this.image_.src = this.request_.url; + this.contentType_ = dataUrlMimeType; + return; + } + + const onExternalThumbnail = (dataUrl) => { + if (chrome.runtime.lastError) { + console.warn(chrome.runtime.lastError.message); + onFailure(); + } else if (dataUrl) { + this.image_.src = dataUrl; + this.contentType_ = ImageRequestTask.getDataUrlMimeType(dataUrl); + } else { + onFailure(); + } + }; + + // Load Drive source thumbnail. + const drivefsUrlMatches = this.request_.url.match(/^drivefs:(.*)/); + if (drivefsUrlMatches) { + const url = drivefsUrlMatches[1]; + const cropToSquare = !!this.request_.crop; + chrome.imageLoaderPrivate.getDriveThumbnail( + url, cropToSquare, onExternalThumbnail); + return; + } + + // Load PDF source thumbnail. + if (this.request_.url.endsWith('.pdf')) { + const {width, height} = this.targetThumbnailSize_(); + chrome.imageLoaderPrivate.getPdfThumbnail( + this.request_.url, width, height, onExternalThumbnail); + return; + } + + // Load DocumentsProvider thumbnail, if supported. + const isDocumentsProviderRequest = !!this.request_.url.match(RegExp( + 'filesystem:chrome-extension://[a-z]+/external/arc-documents-provider/.*')); + if (isDocumentsProviderRequest) { + const {width, height} = this.targetThumbnailSize_(); + chrome.imageLoaderPrivate.getArcDocumentsProviderThumbnail( + this.request_.url, width, height, onExternalThumbnail); + return; + } + + const fileType = getFileTypeForName(this.request_.url); + + // Load video source thumbnail. + if (fileType.type === 'video') { + this.createVideoThumbnailUrl_(this.request_.url) + .then((url) => { + this.image_.src = url; + }) + .catch((error) => { + console.warn('Video thumbnail error: ', error); + onFailure(); + }); + return; + } + + // Load the source directly. + this.load(this.request_.url, (contentType, blob) => { + // Load RAW image source thumbnail. + if (fileType.type === 'raw') { + blob.arrayBuffer() + .then(buffer => PiexLoader.load(buffer, chrome.runtime.reload)) + .then(data => { + this.renderOrientation_ = + ImageOrientation.fromExifOrientation(data.orientation); + this.ifd_ = data.ifd; + this.contentType_ = data.mimeType; + const blob = new Blob([data.thumbnail], {type: data.mimeType}); + this.image_.src = URL.createObjectURL(blob); + }) + .catch(onFailure); + return; + } + + this.image_.src = blob ? URL.createObjectURL(blob) : '!'; + this.contentType_ = contentType || null; + if (this.contentType_ === 'image/jpeg') { + this.renderOrientation_ = ImageOrientation.fromExifOrientation(1); + } + }, onFailure); + } /** - * @type {ImageOrientation|null} - */ - this.renderOrientation_ = null; - - /** - * Callback to be called once downloading is finished. - * @type {?function()} + * Creates a video thumbnail data url from video file. + * + * @param {string} url Video URL. + * @return {!Promise<Blob>} Promise that resolves with the data url of video + * thumbnail. * @private */ - this.downloadCallback_ = null; + createVideoThumbnailUrl_(url) { + const video = + assertInstanceof(document.createElement('video'), HTMLVideoElement); + return Promise + .race([ + new Promise((resolve, reject) => { + video.addEventListener('canplay', resolve); + video.addEventListener('error', reject); + video.currentTime = ImageRequestTask.VIDEO_THUMBNAIL_POSITION; + video.preload = 'auto'; + video.src = url; + video.load(); + }), + new Promise((resolve) => { + setTimeout( + resolve, ImageRequestTask.MAX_MILLISECONDS_TO_LOAD_VIDEO); + }).then(() => { + // If we don't receive 'canplay' event after 3 seconds have passed + // for some reason (e.g. unseekable video), we give up generating + // thumbnail. + video.src = + ''; // Make sure to stop loading remaining part of the video. + throw new Error('Seeking video failed.'); + }), + ]) + .then(() => { + const canvas = assertInstanceof( + document.createElement('canvas'), HTMLCanvasElement); + canvas.width = video.videoWidth; + canvas.height = video.videoHeight; + assertInstanceof(canvas.getContext('2d'), CanvasRenderingContext2D) + .drawImage(video, 0, 0); + return canvas.toDataURL(); + }); + } /** - * @type {boolean} + * Loads an image. + * + * @param {string} url URL to the resource to be fetched. + * @param {function(string, Blob)} onSuccess Success callback with the content + * type and the fetched data. + * @param {function()} onFailure Failure callback. + */ + load(url, onSuccess, onFailure) { + this.aborted_ = false; + + // Do not call any callbacks when aborting. + const onMaybeSuccess = + /** @type {function(string, Blob)} */ ((contentType, response) => { + // When content type is not available, try to estimate it from url. + if (!contentType) { + contentType = + ImageRequestTask + .ExtensionContentTypeMap[this.extractExtension_(url)]; + } + + if (!this.aborted_) { + onSuccess(contentType, response); + } + }); + + const onMaybeFailure = + /** @type {function(number=)} */ ((opt_code) => { + if (!this.aborted_) { + onFailure(); + } + }); + + // The query parameter is workaround for crbug.com/379678, which forces the + // browser to obtain the latest contents of the image. + const noCacheUrl = url + '?nocache=' + Date.now(); + this.xhr_ = + ImageRequestTask.load_(noCacheUrl, onMaybeSuccess, onMaybeFailure); + } + + /** + * Extracts extension from url. + * @param {string} url Url. + * @return {string} Extracted extension, e.g. png. + */ + extractExtension_(url) { + const result = (/\.([a-zA-Z]+)$/i).exec(url); + return result ? result[1] : ''; + } + + /** + * Fetches data using XmlHttpRequest. + * + * @param {string} url URL to the resource to be fetched. + * @param {function(string, Blob)} onSuccess Success callback with the content + * type and the fetched data. + * @param {function(number=)} onFailure Failure callback with the error code + * if available. + * @return {XMLHttpRequest} XHR instance. * @private */ - this.aborted_ = false; + static load_(url, onSuccess, onFailure) { + const xhr = new XMLHttpRequest(); + xhr.responseType = 'blob'; + + xhr.onreadystatechange = () => { + if (xhr.readyState != 4) { + return; + } + if (xhr.status != 200) { + onFailure(xhr.status); + return; + } + const response = /** @type {Blob} */ (xhr.response); + const contentType = + xhr.getResponseHeader('Content-Type') || response.type; + onSuccess(contentType, response); + }; + + // Perform a xhr request. + try { + xhr.open('GET', url, true); + xhr.send(); + } catch (e) { + onFailure(); + } + + return xhr; + } + + /** + * Sends the resized image via the callback. If the image has been changed, + * then packs the canvas contents, otherwise sends the raw image data. + * + * @param {boolean} imageChanged Whether the image has been changed. + * @private + */ + sendImage_(imageChanged) { + let width; + let height; + let data; + + if (!imageChanged) { + // The image hasn't been processed, so the raw data can be directly + // forwarded for speed (no need to encode the image again). + width = this.image_.width; + height = this.image_.height; + data = this.image_.src; + } else { + // The image has been resized or rotated, therefore the canvas has to be + // encoded to get the correct compressed image data. + width = this.canvas_.width; + height = this.canvas_.height; + + switch (this.contentType_) { + case 'image/jpeg': + data = this.canvas_.toDataURL('image/jpeg', 0.9); + break; + default: + data = this.canvas_.toDataURL('image/png'); + break; + } + } + + // Send the image data and also save it in the persistent cache. + this.sendImageData_(width, height, data); + this.saveToCache_(width, height, data); + } + + /** + * Sends the resized image via the callback. + * + * @param {number} width Image width. + * @param {number} height Image height. + * @param {string} data Image data. + * @private + */ + sendImageData_(width, height, data) { + const result = {width, height, ifd: this.ifd_, data}; + this.sendResponse_(new LoadImageResponse( + LoadImageResponseStatus.SUCCESS, this.getClientTaskId(), result)); + } + + /** + * Handler, when contents are loaded into the image element. Performs image + * processing operations if needed, and finalizes the request process. + * @private + */ + onImageLoad_() { + const requestOrientation = this.request_.orientation; + + // Override the request orientation before processing if needed. + if (this.renderOrientation_) { + this.request_.orientation = this.renderOrientation_; + } + + // Perform processing if the url is not a data url, or if there are some + // operations requested. + let imageChanged = false; + if (!(this.request_.url.match(/^data/) || + this.request_.url.match(/^drivefs:/)) || + ImageLoaderUtil.shouldProcess( + this.image_.width, this.image_.height, this.request_)) { + ImageLoaderUtil.resizeAndCrop(this.image_, this.canvas_, this.request_); + imageChanged = true; // The image is now on the <canvas>. + } + + // Restore the request orientation after processing. + if (this.renderOrientation_) { + this.request_.orientation = requestOrientation; + } + + // Finalize the request. + this.sendImage_(imageChanged); + this.cleanup_(); + this.downloadCallback_(); + } + + /** + * Handler, when loading of the image fails. Sends a failure response and + * finalizes the request process. + * @private + */ + onImageError_() { + this.sendResponse_(new LoadImageResponse( + LoadImageResponseStatus.ERROR, this.getClientTaskId())); + this.cleanup_(); + this.downloadCallback_(); + } + + /** + * Cancels the request. + */ + cancel() { + this.cleanup_(); + + // If downloading has started, then call the callback. + if (this.downloadCallback_) { + this.downloadCallback_(); + } + } + + /** + * Cleans up memory used by this request. + * @private + */ + cleanup_() { + this.image_.onerror = () => {}; + this.image_.onload = () => {}; + + // Transparent 1x1 pixel gif, to force garbage collecting. + this.image_.src = + 'data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAA' + + 'ABAAEAAAICTAEAOw=='; + + this.aborted_ = true; + if (this.xhr_) { + this.xhr_.abort(); + } + + // Dispose memory allocated by Canvas. + this.canvas_.width = 0; + this.canvas_.height = 0; + } } /** @@ -167,526 +696,3 @@ jpg: 'image/jpeg', jpeg: 'image/jpeg', }; - -/** - * Extracts MIME type of a data URL. - * @param {string|undefined} dataUrl Data URL. - * @return {?string} MIME type string, or null if the URL is invalid. - */ -ImageRequestTask.getDataUrlMimeType = function(dataUrl) { - const dataUrlMatches = (dataUrl || '').match(/^data:([^,;]*)[,;]/); - return dataUrlMatches ? dataUrlMatches[1] : null; -}; - -/** - * Returns ID of the request. - * @return {string} Request ID. - */ -ImageRequestTask.prototype.getId = function() { - return this.id_; -}; - -/** - * Returns the client's task ID for the request. - * @return {number} - */ -ImageRequestTask.prototype.getClientTaskId = function() { - // Every incoming request should have been given a taskId. - assert(this.request_.taskId); - return this.request_.taskId; -}; - -/** - * Returns priority of the request. The higher priority, the faster it will - * be handled. The highest priority is 0. The default one is 2. - * - * @return {number} Priority. - */ -ImageRequestTask.prototype.getPriority = function() { - return (this.request_.priority !== undefined) ? this.request_.priority : 2; -}; - -/** - * Tries to load the image from cache, if it exists in the cache, and sends - * the response. Fails if the image is not found in the cache. - * - * @param {function()} onSuccess Success callback. - * @param {function()} onFailure Failure callback. - */ -ImageRequestTask.prototype.loadFromCacheAndProcess = function( - onSuccess, onFailure) { - this.loadFromCache_( - function(width, height, ifd, data) { // Found in cache. - this.ifd_ = ifd; - this.sendImageData_(width, height, data); - onSuccess(); - }.bind(this), - onFailure); // Not found in cache. -}; - -/** - * Tries to download the image, resizes and sends the response. - * - * @param {function()} callback Completion callback. - */ -ImageRequestTask.prototype.downloadAndProcess = function(callback) { - if (this.downloadCallback_) { - throw new Error('Downloading already started.'); - } - - this.downloadCallback_ = callback; - this.downloadThumbnail_( - this.onImageLoad_.bind(this), this.onImageError_.bind(this)); -}; - -/** - * Fetches the image from the persistent cache. - * - * @param {function(number, number, ?string, string)} onSuccess - * Success callback with the image width, height, ?ifd, and data. - * @param {function()} onFailure Failure callback. - * @private - */ -ImageRequestTask.prototype.loadFromCache_ = function(onSuccess, onFailure) { - const cacheKey = LoadImageRequest.cacheKey(this.request_); - - if (!cacheKey) { - // Cache key is not provided for the request. - onFailure(); - return; - } - - if (!this.request_.cache) { - // Cache is disabled for this request; therefore, remove it from cache - // if existed. - this.cache_.removeImage(cacheKey); - onFailure(); - return; - } - - const timestamp = this.request_.timestamp; - if (!timestamp) { - // Persistent cache is available only when a timestamp is provided. - onFailure(); - return; - } - - this.cache_.loadImage(cacheKey, timestamp, onSuccess, onFailure); -}; - -/** - * Saves the image to the persistent cache. - * - * @param {number} width Image width. - * @param {number} height Image height. - * @param {string} data Image data. - * @private - */ -ImageRequestTask.prototype.saveToCache_ = function(width, height, data) { - const timestamp = this.request_.timestamp; - - if (!this.request_.cache || !timestamp) { - // Persistent cache is available only when a timestamp is provided. - return; - } - - const cacheKey = LoadImageRequest.cacheKey(this.request_); - if (!cacheKey) { - // Cache key is not provided for the request. - return; - } - - this.cache_.saveImage(cacheKey, timestamp, width, height, this.ifd_, data); -}; - -/** - * Gets the target image size for external thumbnails, where supported. - The defaults replicate drivefs thumbnailer behavior. - * @return {{width: !number, height: !number}} - */ -ImageRequestTask.prototype.targetThumbnailSize_ = function() { - const crop = !!this.request_.crop; - const defaultWidth = crop ? ImageRequestTask.DEFAULT_THUMBNAIL_SQUARE_SIZE : - ImageRequestTask.DEFAULT_THUMBNAIL_WIDTH; - const defaultHeight = crop ? ImageRequestTask.DEFAULT_THUMBNAIL_SQUARE_SIZE : - ImageRequestTask.DEFAULT_THUMBNAIL_HEIGHT; - return { - width: this.request_.width || defaultWidth, - height: this.request_.height || defaultHeight, - }; -}; - -/** - * Loads |this.image_| with the |this.request_.url| source or the thumbnail - * image of the source. - * - * @param {function()} onSuccess Success callback. - * @param {function()} onFailure Failure callback. - * @private - */ -ImageRequestTask.prototype.downloadThumbnail_ = function(onSuccess, onFailure) { - // Load methods below set |this.image_.src|. Call revokeObjectURL(src) to - // release resources if the image src was created with createObjectURL(). - this.image_.onload = function() { - URL.revokeObjectURL(this.image_.src); - onSuccess(); - }.bind(this); - this.image_.onerror = function() { - URL.revokeObjectURL(this.image_.src); - onFailure(); - }.bind(this); - - // Load dataURL sources directly. - const dataUrlMimeType = - ImageRequestTask.getDataUrlMimeType(this.request_.url); - if (dataUrlMimeType) { - this.image_.src = this.request_.url; - this.contentType_ = dataUrlMimeType; - return; - } - - const onExternalThumbnail = (dataUrl) => { - if (chrome.runtime.lastError) { - console.warn(chrome.runtime.lastError.message); - onFailure(); - } else if (dataUrl) { - this.image_.src = dataUrl; - this.contentType_ = ImageRequestTask.getDataUrlMimeType(dataUrl); - } else { - onFailure(); - } - }; - - // Load Drive source thumbnail. - const drivefsUrlMatches = this.request_.url.match(/^drivefs:(.*)/); - if (drivefsUrlMatches) { - const url = drivefsUrlMatches[1]; - const cropToSquare = !!this.request_.crop; - chrome.imageLoaderPrivate.getDriveThumbnail( - url, cropToSquare, onExternalThumbnail); - return; - } - - // Load PDF source thumbnail. - if (this.request_.url.endsWith('.pdf')) { - const {width, height} = this.targetThumbnailSize_(); - chrome.imageLoaderPrivate.getPdfThumbnail( - this.request_.url, width, height, onExternalThumbnail); - return; - } - - // Load DocumentsProvider thumbnail, if supported. - const isDocumentsProviderRequest = !!this.request_.url.match(RegExp( - 'filesystem:chrome-extension://[a-z]+/external/arc-documents-provider/.*')); - if (isDocumentsProviderRequest) { - const {width, height} = this.targetThumbnailSize_(); - chrome.imageLoaderPrivate.getArcDocumentsProviderThumbnail( - this.request_.url, width, height, onExternalThumbnail); - return; - } - - const fileType = getFileTypeForName(this.request_.url); - - // Load video source thumbnail. - if (fileType.type === 'video') { - this.createVideoThumbnailUrl_(this.request_.url) - .then(function(url) { - this.image_.src = url; - }.bind(this)) - .catch(function(error) { - console.warn('Video thumbnail error: ', error); - onFailure(); - }); - return; - } - - // Load the source directly. - this.load(this.request_.url, (contentType, blob) => { - // Load RAW image source thumbnail. - if (fileType.type === 'raw') { - blob.arrayBuffer() - .then(buffer => PiexLoader.load(buffer, chrome.runtime.reload)) - .then(data => { - this.renderOrientation_ = - ImageOrientation.fromExifOrientation(data.orientation); - this.ifd_ = data.ifd; - this.contentType_ = data.mimeType; - const blob = new Blob([data.thumbnail], {type: data.mimeType}); - this.image_.src = URL.createObjectURL(blob); - }) - .catch(onFailure); - return; - } - - this.image_.src = blob ? URL.createObjectURL(blob) : '!'; - this.contentType_ = contentType || null; - if (this.contentType_ === 'image/jpeg') { - this.renderOrientation_ = ImageOrientation.fromExifOrientation(1); - } - }, onFailure); -}; - -/** - * Creates a video thumbnail data url from video file. - * - * @param {string} url Video URL. - * @return {!Promise<Blob>} Promise that resolves with the data url of video - * thumbnail. - * @private - */ -ImageRequestTask.prototype.createVideoThumbnailUrl_ = function(url) { - const video = - assertInstanceof(document.createElement('video'), HTMLVideoElement); - return Promise - .race([ - new Promise((resolve, reject) => { - video.addEventListener('canplay', resolve); - video.addEventListener('error', reject); - video.currentTime = ImageRequestTask.VIDEO_THUMBNAIL_POSITION; - video.preload = 'auto'; - video.src = url; - video.load(); - }), - new Promise((resolve) => { - setTimeout(resolve, ImageRequestTask.MAX_MILLISECONDS_TO_LOAD_VIDEO); - }).then(() => { - // If we don't receive 'canplay' event after 3 seconds have passed for - // some reason (e.g. unseekable video), we give up generating - // thumbnail. - video.src = - ''; // Make sure to stop loading remaining part of the video. - throw new Error('Seeking video failed.'); - }), - ]) - .then(() => { - const canvas = assertInstanceof( - document.createElement('canvas'), HTMLCanvasElement); - canvas.width = video.videoWidth; - canvas.height = video.videoHeight; - assertInstanceof(canvas.getContext('2d'), CanvasRenderingContext2D) - .drawImage(video, 0, 0); - return canvas.toDataURL(); - }); -}; - -/** - * Loads an image. - * - * @param {string} url URL to the resource to be fetched. - * @param {function(string, Blob)} onSuccess Success callback with the content - * type and the fetched data. - * @param {function()} onFailure Failure callback. - */ -ImageRequestTask.prototype.load = function(url, onSuccess, onFailure) { - this.aborted_ = false; - - // Do not call any callbacks when aborting. - const onMaybeSuccess = - /** @type {function(string, Blob)} */ (function(contentType, response) { - // When content type is not available, try to estimate it from url. - if (!contentType) { - contentType = - ImageRequestTask - .ExtensionContentTypeMap[this.extractExtension_(url)]; - } - - if (!this.aborted_) { - onSuccess(contentType, response); - } - }.bind(this)); - - const onMaybeFailure = /** @type {function(number=)} */ (function(opt_code) { - if (!this.aborted_) { - onFailure(); - } - }.bind(this)); - - // The query parameter is workaround for crbug.com/379678, which forces the - // browser to obtain the latest contents of the image. - const noCacheUrl = url + '?nocache=' + Date.now(); - this.xhr_ = - ImageRequestTask.load_(noCacheUrl, onMaybeSuccess, onMaybeFailure); -}; - -/** - * Extracts extension from url. - * @param {string} url Url. - * @return {string} Extracted extension, e.g. png. - */ -ImageRequestTask.prototype.extractExtension_ = function(url) { - const result = (/\.([a-zA-Z]+)$/i).exec(url); - return result ? result[1] : ''; -}; - -/** - * Fetches data using XmlHttpRequest. - * - * @param {string} url URL to the resource to be fetched. - * @param {function(string, Blob)} onSuccess Success callback with the content - * type and the fetched data. - * @param {function(number=)} onFailure Failure callback with the error code - * if available. - * @return {XMLHttpRequest} XHR instance. - * @private - */ -ImageRequestTask.load_ = function(url, onSuccess, onFailure) { - const xhr = new XMLHttpRequest(); - xhr.responseType = 'blob'; - - xhr.onreadystatechange = function() { - if (xhr.readyState != 4) { - return; - } - if (xhr.status != 200) { - onFailure(xhr.status); - return; - } - const response = /** @type {Blob} */ (xhr.response); - const contentType = xhr.getResponseHeader('Content-Type') || response.type; - onSuccess(contentType, response); - }.bind(this); - - // Perform a xhr request. - try { - xhr.open('GET', url, true); - xhr.send(); - } catch (e) { - onFailure(); - } - - return xhr; -}; - -/** - * Sends the resized image via the callback. If the image has been changed, - * then packs the canvas contents, otherwise sends the raw image data. - * - * @param {boolean} imageChanged Whether the image has been changed. - * @private - */ -ImageRequestTask.prototype.sendImage_ = function(imageChanged) { - let width; - let height; - let data; - - if (!imageChanged) { - // The image hasn't been processed, so the raw data can be directly - // forwarded for speed (no need to encode the image again). - width = this.image_.width; - height = this.image_.height; - data = this.image_.src; - } else { - // The image has been resized or rotated, therefore the canvas has to be - // encoded to get the correct compressed image data. - width = this.canvas_.width; - height = this.canvas_.height; - - switch (this.contentType_) { - case 'image/jpeg': - data = this.canvas_.toDataURL('image/jpeg', 0.9); - break; - default: - data = this.canvas_.toDataURL('image/png'); - break; - } - } - - // Send the image data and also save it in the persistent cache. - this.sendImageData_(width, height, data); - this.saveToCache_(width, height, data); -}; - -/** - * Sends the resized image via the callback. - * - * @param {number} width Image width. - * @param {number} height Image height. - * @param {string} data Image data. - * @private - */ -ImageRequestTask.prototype.sendImageData_ = function(width, height, data) { - const result = {width, height, ifd: this.ifd_, data}; - this.sendResponse_(new LoadImageResponse( - LoadImageResponseStatus.SUCCESS, this.getClientTaskId(), result)); -}; - -/** - * Handler, when contents are loaded into the image element. Performs image - * processing operations if needed, and finalizes the request process. - * @private - */ -ImageRequestTask.prototype.onImageLoad_ = function() { - const requestOrientation = this.request_.orientation; - - // Override the request orientation before processing if needed. - if (this.renderOrientation_) { - this.request_.orientation = this.renderOrientation_; - } - - // Perform processing if the url is not a data url, or if there are some - // operations requested. - let imageChanged = false; - if (!(this.request_.url.match(/^data/) || - this.request_.url.match(/^drivefs:/)) || - ImageLoaderUtil.shouldProcess( - this.image_.width, this.image_.height, this.request_)) { - ImageLoaderUtil.resizeAndCrop(this.image_, this.canvas_, this.request_); - imageChanged = true; // The image is now on the <canvas>. - } - - // Restore the request orientation after processing. - if (this.renderOrientation_) { - this.request_.orientation = requestOrientation; - } - - // Finalize the request. - this.sendImage_(imageChanged); - this.cleanup_(); - this.downloadCallback_(); -}; - -/** - * Handler, when loading of the image fails. Sends a failure response and - * finalizes the request process. - * @private - */ -ImageRequestTask.prototype.onImageError_ = function() { - this.sendResponse_(new LoadImageResponse( - LoadImageResponseStatus.ERROR, this.getClientTaskId())); - this.cleanup_(); - this.downloadCallback_(); -}; - -/** - * Cancels the request. - */ -ImageRequestTask.prototype.cancel = function() { - this.cleanup_(); - - // If downloading has started, then call the callback. - if (this.downloadCallback_) { - this.downloadCallback_(); - } -}; - -/** - * Cleans up memory used by this request. - * @private - */ -ImageRequestTask.prototype.cleanup_ = function() { - this.image_.onerror = function() {}; - this.image_.onload = function() {}; - - // Transparent 1x1 pixel gif, to force garbage collecting. - this.image_.src = 'data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAA' + - 'ABAAEAAAICTAEAOw=='; - - this.aborted_ = true; - if (this.xhr_) { - this.xhr_.abort(); - } - - // Dispose memory allocated by Canvas. - this.canvas_.width = 0; - this.canvas_.height = 0; -};
diff --git a/ui/file_manager/image_loader/piex_loader.js b/ui/file_manager/image_loader/piex_loader.js index dc2d06a..41fb9fc0 100644 --- a/ui/file_manager/image_loader/piex_loader.js +++ b/ui/file_manager/image_loader/piex_loader.js
@@ -112,43 +112,46 @@ let PiexPreviewImageData; /** - * @param {!PiexPreviewImageData} data The extracted preview image data. - * @constructor * @struct */ -function PiexLoaderResponse(data) { +class PiexLoaderResponse { /** - * @public {!ArrayBuffer} - * @const + * @param {!PiexPreviewImageData} data The extracted preview image data. */ - this.thumbnail = data.thumbnail; + constructor(data) { + /** + * @type {!ArrayBuffer} + * @const + */ + this.thumbnail = data.thumbnail; - /** - * @public {string} - * @const - */ - this.mimeType = data.mimeType || 'image/jpeg'; + /** + * @type {string} + * @const + */ + this.mimeType = data.mimeType || 'image/jpeg'; - /** - * JEITA EXIF image orientation being an integer in [1..8]. - * @public {number} - * @const - */ - this.orientation = data.orientation; + /** + * JEITA EXIF image orientation being an integer in [1..8]. + * @type {number} + * @const + */ + this.orientation = data.orientation; - /** - * JEITA EXIF image color space: 'sRgb' or 'adobeRgb'. - * @public {string} - * @const - */ - this.colorSpace = data.colorSpace; + /** + * JEITA EXIF image color space: 'sRgb' or 'adobeRgb'. + * @type {string} + * @const + */ + this.colorSpace = data.colorSpace; - /** - * JSON encoded RAW image photographic details. - * @public {?string} - * @const - */ - this.ifd = data.ifd || null; + /** + * JSON encoded RAW image photographic details. + * @type {?string} + * @const + */ + this.ifd = data.ifd || null; + } } /**
diff --git a/ui/file_manager/image_loader/scheduler.js b/ui/file_manager/image_loader/scheduler.js index 0eb75d8..2c126d4 100644 --- a/ui/file_manager/image_loader/scheduler.js +++ b/ui/file_manager/image_loader/scheduler.js
@@ -8,48 +8,162 @@ * Scheduler for ImageRequestTask objects. Fetches tasks from a queue and * processes them synchronously, taking into account priorities. The highest * priority is 0. - * @constructor */ -export function Scheduler() { +export class Scheduler { + constructor() { + /** + * List of tasks waiting to be checked. If these items are available in + * cache, then they are processed immediately after starting the scheduler. + * However, if they have to be downloaded, then these tasks are moved + * to pendingTasks_. + * + * @type {Array<ImageRequestTask>} + * @private + */ + this.newTasks_ = []; + + /** + * List of pending tasks for images to be downloaded. + * @type {Array<ImageRequestTask>} + * @private + */ + this.pendingTasks_ = []; + + /** + * List of tasks being processed. + * @type {Array<ImageRequestTask>} + * @private + */ + this.activeTasks_ = []; + + /** + * Map of tasks being added to the queue, but not finalized yet. Keyed by + * the ImageRequestTask id. + * @type {Object<string, ImageRequestTask>}> + * @private + */ + this.tasks_ = {}; + + /** + * If the scheduler has been started. + * @type {boolean} + * @private + */ + this.started_ = false; + } + /** - * List of tasks waiting to be checked. If these items are available in - * cache, then they are processed immediately after starting the scheduler. - * However, if they have to be downloaded, then these tasks are moved - * to pendingTasks_. + * Adds a task to the internal priority queue and executes it when tasks + * with higher priorities are finished. If the result is cached, then it is + * processed immediately once the scheduler is started. * - * @type {Array<ImageRequestTask>} - * @private + * @param {ImageRequestTask} task A task to be run */ - this.newTasks_ = []; + add(task) { + if (!this.started_) { + this.newTasks_.push(task); + this.tasks_[task.getId()] = task; + return; + } + + // Enqueue the tasks, since already started. + this.pendingTasks_.push(task); + this.sortPendingTasks_(); + + this.continue_(); + } /** - * List of pending tasks for images to be downloaded. - * @type {Array<ImageRequestTask>} - * @private + * Removes a task from the scheduler (if exists). + * @param {string} taskId Unique ID of the task. */ - this.pendingTasks_ = []; + remove(taskId) { + const task = this.tasks_[taskId]; + if (!task) { + return; + } + + // Remove from the internal queues with pending tasks. + const newIndex = this.newTasks_.indexOf(task); + if (newIndex != -1) { + this.newTasks_.splice(newIndex, 1); + } + const pendingIndex = this.pendingTasks_.indexOf(task); + if (pendingIndex != -1) { + this.pendingTasks_.splice(pendingIndex, 1); + } + + // Cancel the task. + task.cancel(); + delete this.tasks_[taskId]; + } /** - * List of tasks being processed. - * @type {Array<ImageRequestTask>} - * @private + * Starts handling tasks. */ - this.activeTasks_ = []; + start() { + this.started_ = true; + + // Process tasks added before scheduler has been started. + this.pendingTasks_ = this.newTasks_; + this.sortPendingTasks_(); + this.newTasks_ = []; + + // Start serving enqueued tasks. + this.continue_(); + } /** - * Map of tasks being added to the queue, but not finalized yet. Keyed by - * the ImageRequestTask id. - * @type {Object<string, ImageRequestTask>}> + * Sorts pending tasks by priorities. * @private */ - this.tasks_ = {}; + sortPendingTasks_() { + this.pendingTasks_.sort((a, b) => { + return a.getPriority() - b.getPriority(); + }); + } /** - * If the scheduler has been started. - * @type {boolean} + * Processes pending tasks from the queue. There is no guarantee that + * all of the tasks will be processed at once. + * * @private */ - this.started_ = false; + continue_() { + // Run only up to MAXIMUM_IN_PARALLEL in the same time. + while (this.pendingTasks_.length && + this.activeTasks_.length < MAXIMUM_IN_PARALLEL) { + const task = this.pendingTasks_.shift(); + this.activeTasks_.push(task); + + // Try to load from cache. If doesn't exist, then download. + task.loadFromCacheAndProcess( + this.finish_.bind(this, task), function(currentTask) { + currentTask.downloadAndProcess( + this.finish_.bind(this, currentTask)); + }.bind(this, task)); + } + } + + /** + * Handles finished tasks. + * + * @param {ImageRequestTask} task Finished task. + * @private + */ + finish_(task) { + const index = this.activeTasks_.indexOf(task); + if (index < 0) { + console.warn('ImageRequestTask not found.'); + } + this.activeTasks_.splice(index, 1); + delete this.tasks_[task.getId()]; + + // Continue handling the most important tasks (if started). + if (this.started_) { + this.continue_(); + } + } } /** @@ -57,116 +171,4 @@ * @type {number} * @const */ -Scheduler.MAXIMUM_IN_PARALLEL = 5; - -/** - * Adds a task to the internal priority queue and executes it when tasks - * with higher priorities are finished. If the result is cached, then it is - * processed immediately once the scheduler is started. - * - * @param {ImageRequestTask} task A task to be run - */ -Scheduler.prototype.add = function(task) { - if (!this.started_) { - this.newTasks_.push(task); - this.tasks_[task.getId()] = task; - return; - } - - // Enqueue the tasks, since already started. - this.pendingTasks_.push(task); - this.sortPendingTasks_(); - - this.continue_(); -}; - -/** - * Removes a task from the scheduler (if exists). - * @param {string} taskId Unique ID of the task. - */ -Scheduler.prototype.remove = function(taskId) { - const task = this.tasks_[taskId]; - if (!task) { - return; - } - - // Remove from the internal queues with pending tasks. - const newIndex = this.newTasks_.indexOf(task); - if (newIndex != -1) { - this.newTasks_.splice(newIndex, 1); - } - const pendingIndex = this.pendingTasks_.indexOf(task); - if (pendingIndex != -1) { - this.pendingTasks_.splice(pendingIndex, 1); - } - - // Cancel the task. - task.cancel(); - delete this.tasks_[taskId]; -}; - -/** - * Starts handling tasks. - */ -Scheduler.prototype.start = function() { - this.started_ = true; - - // Process tasks added before scheduler has been started. - this.pendingTasks_ = this.newTasks_; - this.sortPendingTasks_(); - this.newTasks_ = []; - - // Start serving enqueued tasks. - this.continue_(); -}; - -/** - * Sorts pending tasks by priorities. - * @private - */ -Scheduler.prototype.sortPendingTasks_ = function() { - this.pendingTasks_.sort(function(a, b) { - return a.getPriority() - b.getPriority(); - }); -}; - -/** - * Processes pending tasks from the queue. There is no guarantee that - * all of the tasks will be processed at once. - * - * @private - */ -Scheduler.prototype.continue_ = function() { - // Run only up to MAXIMUM_IN_PARALLEL in the same time. - while (this.pendingTasks_.length && - this.activeTasks_.length < Scheduler.MAXIMUM_IN_PARALLEL) { - const task = this.pendingTasks_.shift(); - this.activeTasks_.push(task); - - // Try to load from cache. If doesn't exist, then download. - task.loadFromCacheAndProcess( - this.finish_.bind(this, task), function(currentTask) { - currentTask.downloadAndProcess(this.finish_.bind(this, currentTask)); - }.bind(this, task)); - } -}; - -/** - * Handles finished tasks. - * - * @param {ImageRequestTask} task Finished task. - * @private - */ -Scheduler.prototype.finish_ = function(task) { - const index = this.activeTasks_.indexOf(task); - if (index < 0) { - console.warn('ImageRequestTask not found.'); - } - this.activeTasks_.splice(index, 1); - delete this.tasks_[task.getId()]; - - // Continue handling the most important tasks (if started). - if (this.started_) { - this.continue_(); - } -}; +export const MAXIMUM_IN_PARALLEL = 5;
diff --git a/ui/file_manager/image_loader/scheduler_unittest.js b/ui/file_manager/image_loader/scheduler_unittest.js index 2d56598..7361eee 100644 --- a/ui/file_manager/image_loader/scheduler_unittest.js +++ b/ui/file_manager/image_loader/scheduler_unittest.js
@@ -5,7 +5,7 @@ import {assertEquals} from 'chrome://webui-test/chromeos/chai_assert.js'; import {ImageRequestTask} from './image_request_task.js'; -import {Scheduler} from './scheduler.js'; +import {MAXIMUM_IN_PARALLEL, Scheduler} from './scheduler.js'; /** @@ -94,13 +94,13 @@ export function testParallelTasks() { const scheduler = new Scheduler(); const taskList = []; - for (let i = 0; i <= Scheduler.MAXIMUM_IN_PARALLEL; ++i) { + for (let i = 0; i <= MAXIMUM_IN_PARALLEL; ++i) { taskList.push(newTask(`task-${i}`, 0)); scheduler.add(/** @type {!ImageRequestTask} */ (taskList[i])); } scheduler.start(); - for (let i = 0; i < Scheduler.MAXIMUM_IN_PARALLEL; ++i) { + for (let i = 0; i < MAXIMUM_IN_PARALLEL; ++i) { assertEquals(i + 1, taskList[i].runTime, `task ${i} did not run`); } - assertEquals(0, taskList[Scheduler.MAXIMUM_IN_PARALLEL].runTime); + assertEquals(0, taskList[MAXIMUM_IN_PARALLEL].runTime); }