Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pull] main from chromium:main #123

Merged
merged 99 commits into from
Dec 16, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
99 commits
Select commit Hold shift + click to select a range
873781f
Finalize context menu options for app sorting
Dec 16, 2021
84b7514
Add UMA metrics for overlay checking times/counts
Dec 16, 2021
372c800
[iOS] Update passwords settings header
adangla Dec 16, 2021
1a95c8c
Roll Help App from 27KUeowb-... to 5GaoHsS9S...
Dec 16, 2021
e10b96f
Roll src/third_party/flatbuffers.
Dec 16, 2021
ef860de
Ensure chip list 'selected' property is set initially
iotitan Dec 16, 2021
a796ba5
[remoting] Remove redundant GN conditions
ddorwin Dec 16, 2021
06aeb16
Import wpt@276fb2639c028fb021db191efb5da2cf6391ac64
Dec 16, 2021
6cc372d
desk_templates: Remove quotes for chromevox for template names in dia…
Dec 16, 2021
1dbfdb7
[Scroll Capture] allow-list gnews url scheme to trigger AMP capture
Dec 16, 2021
85e8be2
[Passwords] Switch CompromisedCredentials to patterned histograms
mohamedamir Dec 16, 2021
e138f70
VulkanImage: remove tracking of the current VkImageLayout
Kangz Dec 16, 2021
8bb17ef
[benchmarking] remove the trailing \n in luci-auth token
Dec 16, 2021
1af175a
🛃 Align WebLayer ExternalNavigationDelegate behavior with Custom Tabs.
Dec 16, 2021
c3a276c
Assistant: Fix possible timing issue when detecting audio device
Dec 16, 2021
6a8b32f
[Third-Party Client Hint Delegation] (8) Add 'name' support for third…
arichiv Dec 16, 2021
d4f447d
FLEDGE: Refactor how BidderWorklet keeps track of JS load state
Dec 16, 2021
cffa208
fingerprint: Switch FakeBiodClient to FingerprintMessage
duda-patryk Dec 16, 2021
6fc8c8f
Create an experiment to send Protego sampled reports.
Dec 16, 2021
45dc15e
breadcrumbs: enable only with UMA consent
jessemckenna Dec 16, 2021
e7a3a7e
[SmartLock] Clarify description of "Tap to enter" string for translat…
Dec 16, 2021
8b4be21
Replace the old ToV8 with new ToV8Traits interface in the file system…
Dec 16, 2021
784d0c0
desk_templates: Add styling for dialog text.
Dec 16, 2021
16fdb84
[GMNext] Update ThemeColorProvider to use OmniboxTheme
fsinan Dec 16, 2021
8e2116b
[Histograms] Extend Extensions.*.DispatchWithServiceWorkerBackground …
Dec 16, 2021
a56919b
capture_mode_settings: Show/hide capture label correctly
Dec 16, 2021
86ebe84
AngleVulkan: call skia submit() to make sure work is submitted to GPU
phuang Dec 16, 2021
fcc9d1a
Privacy Review: animate transitions between cards.
Dec 16, 2021
2d1ec53
dlp: Check DLP print restriction in LaCros.
Dec 16, 2021
8f6179e
fingerprint_chromeos_unittest: Add FingerprintErrorConvertTest
duda-patryk Dec 16, 2021
502607a
Roll Perfetto Trace Processor Win from 15e3467297c3 to 9c674c8ed684
Dec 16, 2021
49436d5
Replace the old ToV8 with new ToV8Traits interface in the Fetch module.
Dec 16, 2021
a56ebd3
Attempt to fix flaky test.
pkasting Dec 16, 2021
e6f2cca
CDP: restore showWebVitals state on navigations
OrKoN Dec 16, 2021
e6a2091
desk_templates: Disable templates grid's event handling on fade out
Dec 16, 2021
b4fc2de
[CameraRoll] Add Camera Roll disabled state to settings toggle
Dec 16, 2021
1c1afa0
Roll Catapult from 1a164a8ef025 to 8f3d60691b27 (1 revision)
Dec 16, 2021
4230c55
In EnhancedNetworkTts, use the DataDecoder C++ API
rsesek Dec 16, 2021
efef6e3
[Messages] Migrate ARCore upgrade infobar to a message
Dec 16, 2021
4d57e68
scanning: Remove kmoed@ from flag owner
kyvmo Dec 16, 2021
673bac2
haptics: Add unit test to drag-to-drop haptic feedback
Dec 16, 2021
b62f68b
[iOS][ForcedSignIn]🏢 Make sure the policy doesn't persist across tests
vincb2 Dec 16, 2021
02cdc31
Update the kotlin lib in third_party/android_deps.
Dec 16, 2021
366e49d
[CrOS Settings] Check in Polymer3 version of os_languages_page
Dec 16, 2021
64b1c82
Roll Chromite from 1cad40c1e720 to 3fc099b1f0bb (9 revisions)
Dec 16, 2021
e1ab9d7
[Fast Pair] Log result of key pair generation.
julietlevesque Dec 16, 2021
e4f201b
Add README.md for implementing page load metrics observers.
anniesullie Dec 16, 2021
4b13c17
Disable failing WebContentsAccessibilityTreeTest tests.
mrdewitt Dec 16, 2021
8ce430f
Migrate PaymentSheetViewControllerNoShippingTest
Dec 16, 2021
39e2356
Roll Perfetto Trace Processor Linux from 15e3467297c3 to 9c674c8ed684
Dec 16, 2021
13713e0
Roll ANGLE from e7413adff5a3 to 543f5750f70e (5 revisions)
Dec 16, 2021
6256f5b
Move WebUI resource loading to a worker thread.
bergeret Dec 16, 2021
85d241e
Roll Chrome Linux PGO Profile
Dec 16, 2021
8a554ab
Correct inconsistency in iterating RenderFrameHosts in web_tests.
dtapuska Dec 16, 2021
00344b1
webview: second workaround for resource problem.
tornewuff Dec 16, 2021
e34ffc9
scanning: Remove kmoed@ from TODO
kyvmo Dec 16, 2021
51937a8
[Widget] Make Dino widget proportional to cell area size
tomasz-wiszkowski Dec 16, 2021
13a9df5
EditContext: return correct bounds for the 1st character on Mac
alexkeng Dec 16, 2021
20e77d0
personalization: download correct resolution for wallpaper variants
Dec 16, 2021
8162063
Roll Chrome Win64 PGO Profile
Dec 16, 2021
9428eed
Updater: Change DVLOG into VLOG.
Dec 16, 2021
4b4abd9
#LensChrome extend Lens in-experiment flags
Dec 16, 2021
9dccc2f
[CrOSSharingHub] Add test for triggering the sharesheet
Dec 16, 2021
1a929c0
Roll Perfetto Trace Processor Mac from 15e3467297c3 to 9c674c8ed684
Dec 16, 2021
465010c
Update V8 to version 9.9.5.
Dec 16, 2021
a465e42
[Autofill] Allow only one EditAddressDialogview
mohamedamir Dec 16, 2021
57711f3
Don't break before a nested multicol twice (or indefinitely).
mstensho Dec 16, 2021
47767a7
Improve description of NeverEnabled histogram variant and related cod…
Dec 16, 2021
510b9b2
Roll Chrome Mac PGO Profile
Dec 16, 2021
511d814
Consolidate XR OWNERS into a single file
alcooper91 Dec 16, 2021
88e5649
Blink: Delete remaining navigator.id tests
pkotwicz Dec 16, 2021
b8e74de
Give Widget a couple extra months to expire.
tomasz-wiszkowski Dec 16, 2021
49d2589
[ios, ksingleNTP] Deconstruct ntpCoordinator if there are no active NTPs
Dec 16, 2021
0a81e0c
Roll WebRTC from 9754a43403e0 to 03cb7e5a6124 (1 revision)
Dec 16, 2021
47771d5
Update Crashpad to 5cc0d543d0e5dadba03a6bf7dd8161fb78ab07b5
Dec 16, 2021
480c9cf
Clean up LensIntentParams
Dec 16, 2021
9ef43df
Stop running variations_smoke_tests on bots for now
nico Dec 16, 2021
ea24448
Reset the nominal app list sort order when user reorders app list items
Dec 16, 2021
17b0623
Implement native ui for password collection
Dec 16, 2021
607a900
Roll gn from 2e56c317bd8e to 18df6af86191
Dec 16, 2021
f6af9ef
dlp: Check screenshare restriction for tab share in LaCros.
Dec 16, 2021
5cf6164
Roll Catapult from 8f3d60691b27 to 2c2d76537b02 (1 revision)
Dec 16, 2021
11f0a48
Fix typos in comments in chromium/src/services/network/public/cpp/sim…
dsanders11 Dec 16, 2021
14603d0
fwupd: Clear bound receiver in FirmwareUpdateManager
Dec 16, 2021
4a507c4
Rename the label for IDS_FINGERPRINT_LABEL_NOT_AUTHENTICATED for clarity
Dec 16, 2021
5604fdb
content: changes navigation start time to include IPC cost
Dec 16, 2021
47b31e5
Roll Chrome Win32 PGO Profile
Dec 16, 2021
5805860
WebXR: add const qualifiers to XRSpace methods
klausw Dec 16, 2021
663810b
[AppMenu] App menu dividers should not been enabled
Dec 16, 2021
86ee07c
[Segmentation] Adding more segment information on internal page
Dec 16, 2021
ab36d8c
Roll Dawn from a2241d402e05 to 3649af2486cd (1 revision)
Dec 16, 2021
ddd1d55
[ZPS] Records HTTP cache validity metric for zero-suggest responses
Dec 16, 2021
48c7bd8
Roll the new version of kotlin in third_party/android_deps
Dec 16, 2021
9c189a8
Skip WebglExtension_WEBGL_compressed_texture_s3tc_srgb for swiftshader
shrekshao Dec 16, 2021
0e5925c
[Frameworks roll] Roll to 416863896 piper revision
Dec 16, 2021
3bdfc4e
Add arm64 goldctl
Dec 16, 2021
66a3524
Update WebLayer skew test expectations for avoiding disambiguation di…
Dec 16, 2021
6aa525b
Create interface for VRDeviceProvider::Initialize
alcooper91 Dec 16, 2021
f22ef6b
Properly end ScopedCommitTrace during BeginMainFrame
szager-chromium Dec 16, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
46 changes: 35 additions & 11 deletions DEPS
Original file line number Diff line number Diff line change
Expand Up @@ -249,11 +249,11 @@ vars = {
# Three lines of non-changing comments so that
# the commit queue can handle CLs rolling V8
# and whatever else without interference from each other.
'v8_revision': 'ceb9223e1ab1df795d5f3e69f9fae92bb8328e92',
'v8_revision': 'f5e412a1cd82fb606b79a587f1c4bda7f9445701',
# Three lines of non-changing comments so that
# the commit queue can handle CLs rolling ANGLE
# and whatever else without interference from each other.
'angle_revision': 'e7413adff5a3f91d34bbf3f2bb0b3be848091cd7',
'angle_revision': '543f5750f70e014dc9c2217fb2fcf1c6b63badd5',
# Three lines of non-changing comments so that
# the commit queue can handle CLs rolling SwiftShader
# and whatever else without interference from each other.
Expand Down Expand Up @@ -312,7 +312,7 @@ vars = {
# Three lines of non-changing comments so that
# the commit queue can handle CLs rolling catapult
# and whatever else without interference from each other.
'catapult_revision': '1a164a8ef025f3f2c0735e936f802a352956b627',
'catapult_revision': '2c2d76537b02cca4c0df364f14ee6e9b28afaf8b',
# Three lines of non-changing comments so that
# the commit queue can handle CLs rolling libFuzzer
# and whatever else without interference from each other.
Expand Down Expand Up @@ -360,7 +360,7 @@ vars = {
# 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': 'a2241d402e05dac272c0b3b7d26fd8a2cbd90ae7',
'dawn_revision': '3649af2486cd1c805f364a54cdf127179330024a',
# Three lines of non-changing comments so that
# the commit queue can handle CLs rolling feed
# and whatever else without interference from each other.
Expand Down Expand Up @@ -427,7 +427,7 @@ vars = {
'libcxx_revision': '79a2e924d96e2fc1e4b937c42efd08898fa472d7',

# GN CIPD package version.
'gn_version': 'git_revision:2e56c317bd8e2bf152cfa2ead6ac5fa476fe28b4',
'gn_version': 'git_revision:18df6af86191edab1e47c84d56e608da414d446b',
}

# Only these hosts are allowed for dependencies in this DEPS file.
Expand Down Expand Up @@ -1024,7 +1024,7 @@ deps = {
# Tools used when building Chrome for Chrome OS. This affects both the Simple
# Chrome workflow, as well as the chromeos-chrome ebuild.
'src/third_party/chromite': {
'url': Var('chromium_git') + '/chromiumos/chromite.git' + '@' + '1cad40c1e7201ae3c1273066c335771590bdce2b',
'url': Var('chromium_git') + '/chromiumos/chromite.git' + '@' + '3fc099b1f0bbdcdc4a0785b50b38a8267a000263',
'condition': 'checkout_chromeos',
},

Expand Down Expand Up @@ -1081,7 +1081,7 @@ deps = {
Var('chromium_git') + '/chromium/deps/flac.git' + '@' + 'af862024c8c8fa0ae07ced05e89013d881b00596',

'src/third_party/flatbuffers/src':
Var('chromium_git') + '/external/github.com/google/flatbuffers.git' + '@' + '4f7f6dc301f5ffb9765b055d48324dc7629abd5a',
Var('chromium_git') + '/external/github.com/google/flatbuffers.git' + '@' + 'b8aaccee8248059b2af032cca0eb1d2ddbdb6cdc',

# Used for embedded builds. CrOS & Linux use the system version.
'src/third_party/fontconfig/src': {
Expand Down Expand Up @@ -1648,7 +1648,7 @@ deps = {
Var('chromium_git') + '/external/github.com/gpuweb/cts.git' + '@' + 'c843f8d63c8c17acfbb7d48e09059a581ba779b9',

'src/third_party/webrtc':
Var('webrtc_git') + '/src.git' + '@' + '9754a43403e0b955546aff0e7d07d6f70def4043',
Var('webrtc_git') + '/src.git' + '@' + '03cb7e5a6124d7475bba4da6e5f093f1c0306c9e',

'src/third_party/libgifcodec':
Var('skia_git') + '/libgifcodec' + '@'+ Var('libgifcodec_revision'),
Expand Down Expand Up @@ -1691,6 +1691,8 @@ deps = {
'dep_type': 'cipd',
'condition': 'checkout_win',
},
# TODO(crbug.com/1280002): Remove this entry once the autoroller has been
# updated to roll the mac_amd64 version.
'src/tools/skia_goldctl/mac': {
'packages': [
{
Expand All @@ -1702,6 +1704,28 @@ deps = {
'condition': 'checkout_mac',
},

'src/tools/skia_goldctl/mac_amd64': {
'packages': [
{
'package': 'skia/tools/goldctl/mac-amd64',
'version': 'zLP4FDegN-yg3uvzWUdf4zNRVHDwHd0VLm86FkZCP_MC',
},
],
'dep_type': 'cipd',
'condition': 'checkout_mac',
},

'src/tools/skia_goldctl/mac_arm64': {
'packages': [
{
'package': 'skia/tools/goldctl/mac-arm64',
'version': 'FOo-HR3_OFTL0pn9TIm0H93TmtXgEfjSazYb3xAtx68C',
},
],
'dep_type': 'cipd',
'condition': 'checkout_mac',
},

'src/v8':
Var('chromium_git') + '/v8/v8.git' + '@' + Var('v8_revision'),

Expand All @@ -1725,7 +1749,7 @@ deps = {
'packages': [
{
'package': 'chromeos_internal/apps/help_app/app',
'version': '27KUeowb-avScJevs9PyckybR1s34lIOg_CMEaolREQC',
'version': '5GaoHsS9Sb6U1WEQwNSowrgNf8r6rvc0he_rf8kNgSQC',
},
],
'condition': 'checkout_chromeos and checkout_src_internal',
Expand Down Expand Up @@ -3396,7 +3420,7 @@ deps = {
'packages': [
{
'package': 'chromium/third_party/android_deps/libs/org_jetbrains_kotlin_kotlin_stdlib',
'version': 'version:2@1.6.0.cr0',
'version': 'version:2@1.6.10.cr0',
},
],
'condition': 'checkout_android',
Expand All @@ -3407,7 +3431,7 @@ deps = {
'packages': [
{
'package': 'chromium/third_party/android_deps/libs/org_jetbrains_kotlin_kotlin_stdlib_common',
'version': 'version:2@1.6.0.cr0',
'version': 'version:2@1.6.10.cr0',
},
],
'condition': 'checkout_android',
Expand Down
2 changes: 1 addition & 1 deletion android_webview/browser/gfx/overlay_processor_webview.cc
Original file line number Diff line number Diff line change
Expand Up @@ -667,7 +667,7 @@ OverlayProcessorWebView::TakeSurfaceTransactionOnRT() {
return manager_->TakeHWUITransaction();
}

void OverlayProcessorWebView::CheckOverlaySupport(
void OverlayProcessorWebView::CheckOverlaySupportImpl(
const viz::OverlayProcessorInterface::OutputSurfaceOverlayPlane*
primary_plane,
viz::OverlayCandidateList* candidates) {
Expand Down
2 changes: 1 addition & 1 deletion android_webview/browser/gfx/overlay_processor_webview.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ class OverlayProcessorWebView : public viz::OverlayProcessorSurfaceControl,
viz::DisplayResourceProvider* resource_provider) override;
void AdjustOutputSurfaceOverlay(absl::optional<OutputSurfaceOverlayPlane>*
output_surface_plane) override {}
void CheckOverlaySupport(
void CheckOverlaySupportImpl(
const viz::OverlayProcessorInterface::OutputSurfaceOverlayPlane*
primary_plane,
viz::OverlayCandidateList* candidates) override;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import android.Manifest;
import android.content.Context;
import android.content.pm.PackageManager;
import android.content.res.Resources;
import android.os.Build;
import android.os.Looper;
import android.os.Process;
Expand Down Expand Up @@ -54,6 +55,7 @@
import org.chromium.build.BuildConfig;
import org.chromium.content_public.browser.UiThreadTaskTraits;
import org.chromium.net.NetworkChangeNotifier;
import org.chromium.ui.base.DeviceFormFactor;
import org.chromium.ui.base.ResourceBundle;

/**
Expand Down Expand Up @@ -194,6 +196,28 @@ protected void startChromiumLocked() {

// NOTE: Finished writing Java resources. From this point on, it's safe to use them.

if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S && mIsPostedFromBackgroundThread) {
// Try to work around the problem we're seeing with resources on Android 12. When
// WebView is being initialized from a background thread, it's possible that the
// asset path updated by WebViewFactory is no longer present by the time we get
// here due to something on the UI thread having caused a resource update in the
// app in the meantime, because WebViewFactory does not add the path persistently.
// So, we can try to add them again using the "better" method in WebViewDelegate.

// However, we only want to try this if the resources are actually missing, because
// in the past we've seen this cause apps that were working to *start* crashing.
// The first resource that gets accessed in startup happens during the
// AwBrowserProcess.start() call when trying to determine if the device is a tablet,
// and that's the most common place for us to crash. So, try calling that same
// method and see if it throws - if so then we're unlikely to make the situation
// any worse by trying to fix the path.
try {
DeviceFormFactor.isTablet();
} catch (Resources.NotFoundException e) {
mFactory.addWebViewAssetPath(context);
}
}

AwBrowserProcess.configureChildProcessLauncher();

// finishVariationsInitLocked() must precede native initialization so the seed is
Expand Down
3 changes: 3 additions & 0 deletions ash/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -541,6 +541,8 @@ component("ash") {
"ime/mode_indicator_observer.h",
"in_session_auth/auth_dialog_contents_view.cc",
"in_session_auth/auth_dialog_contents_view.h",
"in_session_auth/authentication_dialog.cc",
"in_session_auth/authentication_dialog.h",
"in_session_auth/in_session_auth_dialog.cc",
"in_session_auth/in_session_auth_dialog.h",
"in_session_auth/in_session_auth_dialog_controller_impl.cc",
Expand Down Expand Up @@ -2354,6 +2356,7 @@ test("ash_unittests") {
"highlighter/highlighter_gesture_util_unittest.cc",
"host/ash_window_tree_host_platform_unittest.cc",
"ime/ime_controller_impl_unittest.cc",
"in_session_auth/authentication_dialog_unittest.cc",
"in_session_auth/in_session_auth_dialog_controller_impl_unittest.cc",
"in_session_auth/mock_in_session_auth_dialog_client.cc",
"in_session_auth/mock_in_session_auth_dialog_client.h",
Expand Down
26 changes: 7 additions & 19 deletions ash/app_list/views/apps_grid_context_menu.cc
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,6 @@ void AppsGridContextMenu::ExecuteCommand(int command_id, int event_flags) {
AppListModelProvider::Get()->model()->delegate()->RequestAppListSort(
AppListSortOrder::kNameAlphabetical);
break;
case AppsGridCommandId::kReorderByNameReverseAlphabetical:
AppListModelProvider::Get()->model()->delegate()->RequestAppListSort(
AppListSortOrder::kNameReverseAlphabetical);
break;
case AppsGridCommandId::kReorderByColor:
AppListModelProvider::Get()->model()->delegate()->RequestAppListSort(
AppListSortOrder::kColor);
Expand Down Expand Up @@ -71,31 +67,23 @@ void AppsGridContextMenu::ShowContextMenuForViewImpl(

void AppsGridContextMenu::BuildMenuModel() {
context_menu_model_ = std::make_unique<ui::SimpleMenuModel>(this);
reorder_name_submenu_ = std::make_unique<ui::SimpleMenuModel>(this);

// As both of the submenu items are not planned to be launched, the option
// strings are directly written as the parameters.
// TODO(https://crbug.com/1269386): Add i18n strings for each menu item.
reorder_name_submenu_->AddItem(kReorderByNameAlphabetical, u"Alphabetical");
reorder_name_submenu_->AddItem(kReorderByNameReverseAlphabetical,
u"Reverse alphabetical");

context_menu_model_->AddTitle(l10n_util::GetStringUTF16(
IDS_ASH_LAUNCHER_APPS_GRID_CONTEXT_MENU_REORDER_TITLE));
context_menu_model_->AddSubMenuWithIcon(
AppsGridCommandId::kReorderByName,
context_menu_model_->AddItemWithIcon(
AppsGridCommandId::kReorderByNameAlphabetical,
l10n_util::GetStringUTF16(
IDS_ASH_LAUNCHER_APPS_GRID_CONTEXT_MENU_REORDER_BY_NAME),
reorder_name_submenu_.get(),
ui::ImageModel::FromVectorIcon(kSortAlphabeticalIcon));
// TODO(crbug.com/1276230): Add vector icon to reorder by color option.
// TODO(https://crbug.com/1269386): Add i18n strings for color menu item.
context_menu_model_->AddItem(kReorderByColor, u"Color");
context_menu_model_->AddItemWithIcon(
AppsGridCommandId::kReorderByColor,
l10n_util::GetStringUTF16(
IDS_ASH_LAUNCHER_APPS_GRID_CONTEXT_MENU_REORDER_BY_COLOR),
ui::ImageModel::FromVectorIcon(kSortColorIcon));
}

void AppsGridContextMenu::OnMenuClosed() {
menu_runner_.reset();
reorder_name_submenu_.reset();
context_menu_model_.reset();
root_menu_item_view_ = nullptr;
menu_model_adapter_.reset();
Expand Down
4 changes: 0 additions & 4 deletions ash/app_list/views/apps_grid_context_menu.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,6 @@ class ASH_EXPORT AppsGridContextMenu : public ui::SimpleMenuModel::Delegate,

// The root menu item view of `context_menu_model_`. Cached for testing.
views::MenuItemView* root_menu_item_view_ = nullptr;

// The submenu model that contains name reorder options used in
// `context_menu_model_`.
std::unique_ptr<ui::SimpleMenuModel> reorder_name_submenu_;
};

} // namespace ash
Expand Down
64 changes: 0 additions & 64 deletions ash/app_list/views/apps_grid_view_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4404,41 +4404,10 @@ TEST_P(AppsGridViewAppSortTest, ContextMenuInTopLevelAppListSortAllApps) {
const gfx::Point reorder_option_point =
reorder_option->GetBoundsInScreen().CenterPoint();
SimulateLeftClickOrTapAt(reorder_option_point);
ASSERT_TRUE(reorder_option->SubmenuIsShowing());

// Sort the apps by their name in alphabetical order.
const gfx::Point alphabetical_option = reorder_option->GetSubmenu()
->GetMenuItemAt(0)
->GetBoundsInScreen()
.CenterPoint();
SimulateLeftClickOrTapAt(alphabetical_option);
EXPECT_EQ(AppListSortOrder::kNameAlphabetical,
model_->requested_sort_order());
EXPECT_FALSE(context_menu->IsMenuShowing());

// Open the menu again to test the reverse alphabetical sort option.
SimulateRightClickOrLongPressAt(empty_space);
EXPECT_TRUE(context_menu->IsMenuShowing());

// Cache the current context menu view.
reorder_option =
context_menu->root_menu_item_view()->GetSubmenu()->GetMenuItemAt(1);
ASSERT_TRUE(reorder_option->title() == u"Name");

// Open the Reorder by Name submenu.
SimulateLeftClickOrTapAt(reorder_option_point);
ASSERT_TRUE(reorder_option->SubmenuIsShowing());

// Sort the apps by their name in reverse alphabetical order.
const gfx::Point reverse_option = reorder_option->GetSubmenu()
->GetMenuItemAt(1)
->GetBoundsInScreen()
.CenterPoint();
SimulateLeftClickOrTapAt(reverse_option);
EXPECT_EQ(AppListSortOrder::kNameReverseAlphabetical,
model_->requested_sort_order());
EXPECT_FALSE(context_menu->IsMenuShowing());

// Open the menu again to test the color sort option.
SimulateRightClickOrLongPressAt(empty_space);
EXPECT_TRUE(context_menu->IsMenuShowing());
Expand Down Expand Up @@ -4489,43 +4458,10 @@ TEST_P(AppsGridViewAppSortTest, ContextMenuOnFolderItemSortAllApps) {
gfx::Point reorder_option_point =
reorder_option->GetBoundsInScreen().CenterPoint();
SimulateLeftClickOrTapAt(reorder_option_point);
ASSERT_TRUE(reorder_option->SubmenuIsShowing());

// Sort the apps by their name in alphabetical order.
const gfx::Point alphabetical_option = reorder_option->GetSubmenu()
->GetMenuItemAt(0)
->GetBoundsInScreen()
.CenterPoint();
SimulateLeftClickOrTapAt(alphabetical_option);
EXPECT_EQ(AppListSortOrder::kNameAlphabetical,
model_->requested_sort_order());
EXPECT_FALSE(context_menu->IsMenuShowing());

// Open the menu again to test the reverse alphabetical sort option.
folder_item_point = folder_item->GetBoundsInScreen().CenterPoint();
SimulateRightClickOrLongPressAt(folder_item_point);
EXPECT_TRUE(context_menu->IsMenuShowing());

// Cache the current context menu view.
reorder_option =
context_menu->root_menu_item_view()->GetSubmenu()->GetMenuItemAt(1);
ASSERT_TRUE(reorder_option->title() == u"Name");

// Open the Reorder by Name submenu.
reorder_option_point = reorder_option->GetBoundsInScreen().CenterPoint();
SimulateLeftClickOrTapAt(reorder_option_point);
ASSERT_TRUE(reorder_option->SubmenuIsShowing());

// Sort the apps by their name in reverse alphabetical order.
const gfx::Point reverse_option = reorder_option->GetSubmenu()
->GetMenuItemAt(1)
->GetBoundsInScreen()
.CenterPoint();
SimulateLeftClickOrTapAt(reverse_option);
EXPECT_EQ(AppListSortOrder::kNameReverseAlphabetical,
model_->requested_sort_order());
EXPECT_FALSE(context_menu->IsMenuShowing());

// Open the menu again to test the color sort option.
SimulateRightClickOrLongPressAt(folder_item_point);
EXPECT_TRUE(context_menu->IsMenuShowing());
Expand Down
Loading