diff --git a/DEPS b/DEPS index d46f960e..1c1e6f0a 100644 --- a/DEPS +++ b/DEPS
@@ -306,7 +306,7 @@ # Three lines of non-changing comments so that # the commit queue can handle CLs rolling Skia # and whatever else without interference from each other. - 'skia_revision': '926c36ffbd516df0878972c68245fc4c4836369e', + 'skia_revision': '9d56e506b4df8a75b559aa9d25ecdb7db88ca8a0', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling V8 # and whatever else without interference from each other. @@ -314,15 +314,15 @@ # 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': '7e7a47dffca034c50bfc96225e6c910bacc55c0f', + 'angle_revision': '386ef2eefe63af50162ef61ce2f5c00e6bde7b66', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling SwiftShader # and whatever else without interference from each other. - 'swiftshader_revision': 'dd35c62aef803501ca34453a48da76a298daaeee', + 'swiftshader_revision': '6a259c87ef52ffbcdca88c32a5e5f2798f70ad03', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling PDFium # and whatever else without interference from each other. - 'pdfium_revision': '9b25e9814e782ff55deaebd6da8b9ec549ef1590', + 'pdfium_revision': 'd5356204ae6c8a4f699a93387dd7ae1c3daff234', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling BoringSSL # and whatever else without interference from each other. @@ -421,7 +421,7 @@ # Three lines of non-changing comments so that # the commit queue can handle CLs rolling feed # and whatever else without interference from each other. - 'dawn_revision': '4d65fc91bb284269dd723fadb8ecead1eb28696c', + 'dawn_revision': '9f2829f4718e3b7742aa6795df78491e20f7ffab', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling feed # and whatever else without interference from each other. @@ -445,7 +445,7 @@ # Three lines of non-changing comments so that # the commit queue can handle CLs rolling nearby # and whatever else without interference from each other. - 'nearby_revision': 'e58dd0a5977fa551c8985f913b389940846130a9', + 'nearby_revision': '141f021140534d3b7c03afc759f43fcc2ece6c97', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling securemessage # and whatever else without interference from each other. @@ -816,7 +816,7 @@ 'src/clank': { 'url': 'https://chrome-internal.googlesource.com/clank/internal/apps.git' + '@' + - '54fe34ecc4bf86eae7866ded7ca9b7d9e575b909', + 'c07fc321ae7f5f3a285f568fb1f0b2d6a4db99ff', 'condition': 'checkout_android and checkout_src_internal and not checkout_clank_via_src_internal', }, @@ -1243,13 +1243,13 @@ }, 'src/third_party/depot_tools': - Var('chromium_git') + '/chromium/tools/depot_tools.git' + '@' + 'aad574d4464f1b26ff0fa8434caa73653f93da44', + Var('chromium_git') + '/chromium/tools/depot_tools.git' + '@' + '1f67d5573f9cc19bc7fd52b0295687164cc979d6', 'src/third_party/devtools-frontend/src': Var('chromium_git') + '/devtools/devtools-frontend' + '@' + Var('devtools_frontend_revision'), 'src/third_party/devtools-frontend-internal': { - 'url': 'https://chrome-internal.googlesource.com/devtools/devtools-internal.git' + '@' + '4aa2cc16ba72ae73f7a8594af4c38ce7c9f49daf', + 'url': 'https://chrome-internal.googlesource.com/devtools/devtools-internal.git' + '@' + '85429b8992a921c63c2bae4de22c81737d12ad3a', 'condition': 'checkout_src_internal', }, @@ -1664,7 +1664,7 @@ }, 'src/third_party/perfetto': - Var('android_git') + '/platform/external/perfetto.git' + '@' + '3c036ab6b21b9d9ddf91dc6b7fe7f50142f28758', + Var('android_git') + '/platform/external/perfetto.git' + '@' + '6f7678ba37a925e02df652a13c50be9daaeb484e', 'src/third_party/perl': { 'url': Var('chromium_git') + '/chromium/deps/perl.git' + '@' + '6f3e5028eb65d0b4c5fdd792106ac4c84eee1eb3', @@ -1846,7 +1846,7 @@ Var('chromium_git') + '/external/khronosgroup/webgl.git' + '@' + 'd1b65aa5a88f6efd900604dfcda840154e9f16e2', 'src/third_party/webgpu-cts/src': - Var('chromium_git') + '/external/github.com/gpuweb/cts.git' + '@' + '23c3bebbdb83fbe81892cee4cb82ec9c5f9bff4f', + Var('chromium_git') + '/external/github.com/gpuweb/cts.git' + '@' + 'fa3aad630e1a992808c28986bb6b24cadd6d1c15', 'src/third_party/webrtc': Var('webrtc_git') + '/src.git' + '@' + '408f0be5c23024a4b88f80b7707f570cd53ca6a6', @@ -1919,7 +1919,7 @@ Var('chromium_git') + '/v8/v8.git' + '@' + Var('v8_revision'), 'src-internal': { - 'url': 'https://chrome-internal.googlesource.com/chrome/src-internal.git@ff5edc7472abacea705e1b9d086ba9ab2e1c8d4e', + 'url': 'https://chrome-internal.googlesource.com/chrome/src-internal.git@a17c545b26c0974baa4603d45a63377f0530b53d', 'condition': 'checkout_src_internal', },
diff --git a/WATCHLISTS b/WATCHLISTS index 8fe73e9..fc73f39f1 100644 --- a/WATCHLISTS +++ b/WATCHLISTS
@@ -2784,7 +2784,7 @@ 'shihken@microsoft.com'], 'media_galleries': ['thestig@chromium.org', 'tommycli@chromium.org'], - 'media_gpu_cros': ['chromeos-gfx-video@google.com', + 'media_gpu_cros': ['chromeos-gfx-video-reviews@google.com', 'media-cros-reviews@chromium.org'], 'media_gpu_vaapi': ['vaapi-reviews@chromium.org'], 'media_gpu_win': ['media-win-reviews@chromium.org'],
diff --git a/android_webview/browser/aw_contents.cc b/android_webview/browser/aw_contents.cc index b0299823..b14ea62 100644 --- a/android_webview/browser/aw_contents.cc +++ b/android_webview/browser/aw_contents.cc
@@ -838,12 +838,9 @@ content::NavigationEntry* entry = web_contents_->GetController().GetLastCommittedEntry(); - - if (entry) { - entry->GetFavicon().valid = true; - entry->GetFavicon().url = icon_url; - entry->GetFavicon().image = gfx::Image::CreateFrom1xBitmap(bitmap); - } + entry->GetFavicon().valid = true; + entry->GetFavicon().url = icon_url; + entry->GetFavicon().image = gfx::Image::CreateFrom1xBitmap(bitmap); ScopedJavaLocalRef<jobject> java_bitmap = gfx::ConvertToJavaBitmap(bitmap, gfx::OomBehavior::kReturnNullOnOom); @@ -897,7 +894,7 @@ DCHECK_CURRENTLY_ON(BrowserThread::UI); content::NavigationEntry* entry = web_contents_->GetController().GetLastCommittedEntry(); - if (!entry || entry->IsInitialEntry() || !entry->GetSSL().certificate) { + if (entry->IsInitialEntry() || !entry->GetSSL().certificate) { return ScopedJavaLocalRef<jbyteArray>(); } @@ -1030,8 +1027,7 @@ DCHECK_CURRENTLY_ON(BrowserThread::UI); // Required optimization in WebViewClassic to not save any state if // there has been no navigations. - if (!web_contents_->GetController().GetLastCommittedEntry() || - web_contents_->GetController() + if (web_contents_->GetController() .GetLastCommittedEntry() ->IsInitialEntry()) { return ScopedJavaLocalRef<jbyteArray>();
diff --git a/ash/BUILD.gn b/ash/BUILD.gn index ef88a167..0c31cd78 100644 --- a/ash/BUILD.gn +++ b/ash/BUILD.gn
@@ -1895,6 +1895,8 @@ "system/usb_peripheral/usb_peripheral_notification_controller.h", "system/user/login_status.cc", "system/user/login_status.h", + "system/video_conference/fake_video_conference_tray_controller.cc", + "system/video_conference/fake_video_conference_tray_controller.h", "system/video_conference/video_conference_bubble.cc", "system/video_conference/video_conference_bubble.h", "system/video_conference/video_conference_tray.cc", @@ -3432,6 +3434,7 @@ "shelf/scrollable_shelf_view_pixeltest.cc", "system/accessibility/accessibility_detailed_view_pixeltest.cc", "system/bluetooth/bluetooth_detailed_view_legacy_pixeltest.cc", + "system/message_center/ash_notification_view_pixeltest.cc", "test/pixel/demo_ash_pixel_diff_test.cc", ]
diff --git a/ash/components/arc/arc_prefs.cc b/ash/components/arc/arc_prefs.cc index eb77214..4a214a05 100644 --- a/ash/components/arc/arc_prefs.cc +++ b/ash/components/arc/arc_prefs.cc
@@ -72,6 +72,8 @@ const char kArcLocationServiceEnabled[] = "arc.location_service.enabled"; // A preference to keep list of Android packages and their infomation. const char kArcPackages[] = "arc.packages"; +// A preference that indicates that arc.packages is up to date. +const char kArcPackagesIsUpToDate[] = "arc.packages_is_up_to_date"; // A preference that indicates that Play Auto Install flow was already started. const char kArcPaiStarted[] = "arc.pai.started"; // A preference that indicates that provisioning was initiated from OOBE. This
diff --git a/ash/components/arc/arc_prefs.h b/ash/components/arc/arc_prefs.h index dec70d4..c078854e3 100644 --- a/ash/components/arc/arc_prefs.h +++ b/ash/components/arc/arc_prefs.h
@@ -29,6 +29,7 @@ ARC_EXPORT extern const char kArcLocationServiceEnabled[]; ARC_EXPORT extern const char kArcManagementTransition[]; ARC_EXPORT extern const char kArcPackages[]; +ARC_EXPORT extern const char kArcPackagesIsUpToDate[]; ARC_EXPORT extern const char kArcPaiStarted[]; ARC_EXPORT extern const char kArcPolicyComplianceReported[]; ARC_EXPORT extern const char kArcProvisioningInitiatedFromOobe[];
diff --git a/ash/metrics/login_unlock_throughput_recorder.cc b/ash/metrics/login_unlock_throughput_recorder.cc index e244365..b9b1569 100644 --- a/ash/metrics/login_unlock_throughput_recorder.cc +++ b/ash/metrics/login_unlock_throughput_recorder.cc
@@ -6,7 +6,10 @@ #include "ash/public/cpp/metrics_util.h" #include "ash/public/cpp/shelf_model.h" +#include "ash/root_window_controller.h" #include "ash/session/session_controller_impl.h" +#include "ash/shelf/hotseat_widget.h" +#include "ash/shelf/scrollable_shelf_view.h" #include "ash/shelf/shelf_view.h" #include "ash/shell.h" #include "ash/wm/tablet_mode/tablet_mode_controller.h" @@ -24,7 +27,6 @@ #include "ui/compositor/layer.h" #include "ui/compositor/total_animation_throughput_reporter.h" #include "ui/views/animation/bounds_animator.h" -#include "ui/views/animation/bounds_animator_observer.h" namespace ash { namespace { @@ -317,17 +319,14 @@ ReportLogin(start, data); } -void LoginUnlockThroughputRecorder::SetShelfViewIfNotSet( - ShelfView* shelf_view) { - if (!shelf_view_) - shelf_view_ = shelf_view; -} - void LoginUnlockThroughputRecorder::ScheduleWaitForShelfAnimationEnd() { - DCHECK(shelf_view_); - if (!shelf_view_) - return; - + ShelfView* shelf_view = + RootWindowController::ForWindow( + Shell::Get()->window_tree_host_manager()->GetPrimaryRootWindow()) + ->shelf() + ->hotseat_widget() + ->scrollable_shelf_view() + ->shelf_view(); base::OnceCallback on_animation_end = base::BindOnce( [](base::TimeTicks primary_user_logged_in) { const base::TimeDelta duration_ms = @@ -338,7 +337,7 @@ }, primary_user_logged_in_); - (new AnimationObserver(shelf_view_, on_animation_end))->StartObserving(); + (new AnimationObserver(shelf_view, on_animation_end))->StartObserving(); } void LoginUnlockThroughputRecorder::OnAllExpectedShelfIconsLoaded() {
diff --git a/ash/metrics/login_unlock_throughput_recorder.h b/ash/metrics/login_unlock_throughput_recorder.h index eddfa5b..88cffa0 100644 --- a/ash/metrics/login_unlock_throughput_recorder.h +++ b/ash/metrics/login_unlock_throughput_recorder.h
@@ -26,7 +26,6 @@ namespace ash { class ShelfModel; -class ShelfView; class ASH_EXPORT LoginUnlockThroughputRecorder : public SessionObserver, @@ -72,9 +71,6 @@ // This is called when the list of shelf icons is updated. void UpdateShelfIconList(const ShelfModel* model); - // Remembers ShelfView pointer to watch for shelf animation finish. - void SetShelfViewIfNotSet(ShelfView* shelf_view); - void ResetScopedThroughputReporterBlockerForTesting(); const ui::TotalAnimationThroughputReporter* @@ -111,8 +107,6 @@ base::TimeTicks primary_user_logged_in_; - base::raw_ptr<ShelfView> shelf_view_ = nullptr; - bool shelf_initialized_ = false; bool shelf_icons_loaded_ = false;
diff --git a/ash/shelf/shelf.cc b/ash/shelf/shelf.cc index 5ddea72..6145e0b 100644 --- a/ash/shelf/shelf.cc +++ b/ash/shelf/shelf.cc
@@ -408,8 +408,6 @@ hotseat_transition_metrics_reporter_ = std::make_unique<HotseatWidgetAnimationMetricsReporter>( HotseatWidgetAnimationMetricsReporter::HotseatElementType::kWidget); - Shell::Get()->login_unlock_throughput_recorder()->SetShelfViewIfNotSet( - hotseat_widget_->scrollable_shelf_view()->shelf_view()); } void Shelf::CreateStatusAreaWidget(aura::Window* shelf_container) {
diff --git a/ash/shell.cc b/ash/shell.cc index cc0e7b9..d2f18227 100644 --- a/ash/shell.cc +++ b/ash/shell.cc
@@ -1430,7 +1430,7 @@ // themselves exist. if (features::IsVcControlsUiEnabled()) { video_conference_tray_controller_ = - std::make_unique<VideoConferenceTrayController>(); + shell_delegate_->CreateVideoConferenceTrayController(); } window_tree_host_manager_->InitHosts();
diff --git a/ash/shell_delegate.h b/ash/shell_delegate.h index f93f0d25..4f2940a9 100644 --- a/ash/shell_delegate.h +++ b/ash/shell_delegate.h
@@ -40,6 +40,7 @@ class GlanceablesDelegate; class NearbyShareController; class NearbyShareDelegate; +class VideoConferenceTrayController; // Delegate of the Shell. class ASH_EXPORT ShellDelegate { @@ -73,6 +74,9 @@ virtual std::unique_ptr<DesksTemplatesDelegate> CreateDesksTemplatesDelegate() const = 0; + virtual std::unique_ptr<VideoConferenceTrayController> + CreateVideoConferenceTrayController() const = 0; + // Returns the geolocation loader factory used to initialize geolocation // provider. virtual scoped_refptr<network::SharedURLLoaderFactory>
diff --git a/ash/system/message_center/ash_notification_view_pixeltest.cc b/ash/system/message_center/ash_notification_view_pixeltest.cc new file mode 100644 index 0000000..cdac2d4 --- /dev/null +++ b/ash/system/message_center/ash_notification_view_pixeltest.cc
@@ -0,0 +1,106 @@ +// Copyright 2022 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/shell.h" +#include "ash/system/notification_center/notification_center_test_api.h" +#include "ash/test/ash_test_base.h" +#include "ash/test/ash_test_util.h" +#include "ash/test/pixel/ash_pixel_differ.h" +#include "ash/test/pixel/ash_pixel_test_init_params.h" +#include "base/time/time.h" +#include "ui/base/models/image_model.h" + +namespace ash { + +namespace { + +constexpr char kShortTitleString[] = "Short Title"; +constexpr char kMediumTitleString[] = "Test Notification's Multiline Title"; +constexpr char kLongTitleString[] = + "Test Notification's Very Very Very Very Very Very Very Very Very Very " + "Very Very Very Very Very Very Very Very Very Very Very Very Very Very " + "Very Very Very Very Long Multiline Title"; + +constexpr char kShortTitleScreenshot[] = "ash_notification_short_title.rev_0"; +constexpr char kMediumTitleScreenshot[] = + "ash_notification_multiline_medium_title.rev_0"; +constexpr char kLongTitleScreenshot[] = + "ash_notification_multiline_long_title.rev_0"; + +} // namespace + +// Pixel tests for Chrome OS Notification views. +class AshNotificationViewTitlePixelTest + : public AshTestBase, + public testing::WithParamInterface< + std::pair<const char* /*notification title string*/, + const char* /*screenshot name*/>> { + public: + AshNotificationViewTitlePixelTest() + : AshTestBase(base::test::TaskEnvironment::TimeSource::MOCK_TIME) {} + AshNotificationViewTitlePixelTest(const AshNotificationViewTitlePixelTest&) = + delete; + AshNotificationViewTitlePixelTest& operator=( + const AshNotificationViewTitlePixelTest&) = delete; + ~AshNotificationViewTitlePixelTest() override = default; + + // AshTestBase: + absl::optional<pixel_test::InitParams> CreatePixelTestInitParams() + const override { + return pixel_test::InitParams(); + } + + // AshTestBase: + void SetUp() override { + AshTestBase::SetUp(); + + // The `NotificationCenterTray` does not exist until the `QsRevamp` feature + // is enabled. We're only using the `NotificationCenterTestApi` in this file + // to create notifications, do not use for any other purpose. + test_api_ = std::make_unique<NotificationCenterTestApi>( + /*notification_center_tray=*/nullptr); + } + + NotificationCenterTestApi* test_api() { return test_api_.get(); } + + private: + std::unique_ptr<NotificationCenterTestApi> test_api_; +}; + +INSTANTIATE_TEST_SUITE_P( + TitleTest, + AshNotificationViewTitlePixelTest, + testing::ValuesIn({ + std::make_pair(kShortTitleString, kShortTitleScreenshot), + std::make_pair(kMediumTitleString, kMediumTitleScreenshot), + std::make_pair(kLongTitleString, kLongTitleScreenshot), + })); + +// Regression test for b/251686063. Tests that a notification with a medium +// length multiline title and an icon is correctly displayed. This string would +// not be displayed properly without the workaround implemented for b/251686063. +TEST_P(AshNotificationViewTitlePixelTest, NotificationTitleTest) { + // Create a notification with a multiline title and an icon. + const std::string title = GetParam().first; + + const std::string id = test_api()->AddCustomNotification( + title, "Notification Content", + ui::ImageModel::FromImageSkia(CreateSolidColorTestImage( + gfx::Size(/*width=*/45, /*height=*/45), SK_ColorGREEN))); + + // Allow `MessagePopupCollection` animations to complete. + task_environment()->FastForwardBy(base::Seconds(1)); + + // Make sure the popup exists and is visible. + views::View* notification_popup = test_api()->GetPopupViewForId(id); + ASSERT_TRUE(notification_popup); + EXPECT_TRUE(notification_popup->GetVisible()); + + // Compare pixels. + const std::string screenshot = GetParam().second; + EXPECT_TRUE(GetPixelDiffer()->CompareUiComponentsOnPrimaryScreen( + screenshot, notification_popup)); +} + +} // namespace ash
diff --git a/ash/system/notification_center/notification_center_test_api.cc b/ash/system/notification_center/notification_center_test_api.cc index ad6bbed2..7200ad8 100644 --- a/ash/system/notification_center/notification_center_test_api.cc +++ b/ash/system/notification_center/notification_center_test_api.cc
@@ -4,13 +4,20 @@ #include "ash/system/notification_center/notification_center_test_api.h" +#include "ash/root_window_controller.h" +#include "ash/shelf/shelf.h" #include "ash/shell.h" +#include "ash/system/message_center/ash_message_popup_collection.h" #include "ash/system/notification_center/notification_center_bubble.h" #include "ash/system/notification_center/notification_center_tray.h" #include "ash/system/notification_center/notification_center_view.h" #include "ash/system/notification_center/stacked_notification_bar.h" +#include "ash/system/unified/unified_system_tray.h" +#include "base/strings/string_number_conversions.h" +#include "ui/base/models/image_model.h" #include "ui/events/test/event_generator.h" #include "ui/message_center/message_center.h" +#include "ui/message_center/views/message_popup_view.h" namespace ash { @@ -27,10 +34,19 @@ } std::string NotificationCenterTestApi::AddNotification() { - std::string id = base::NumberToString(notification_id_++); + return AddCustomNotification(/*title=*/"test_title", + /*message=*/"test_message", + /*icon=*/ui::ImageModel()); +} + +std::string NotificationCenterTestApi::AddCustomNotification( + const std::string& title, + const std::string& message, + const ui::ImageModel& icon) { + const std::string id = GenerateNotificationId(); message_center::MessageCenter::Get()->AddNotification( - CreateNotification(id, /*title=*/"test_title")); + CreateNotification(id, title, message, icon)); return id; } @@ -51,6 +67,19 @@ return notification_center_tray_->GetVisible(); } +views::View* NotificationCenterTestApi::GetPopupViewForId( + const std::string& id) { + // TODO(b/259459804): Move `MessagePopupCollection` to be owned by + // `NotificationCenterTray` instead of `UnifiedSystemTray`. + return Shell::Get() + ->GetPrimaryRootWindowController() + ->shelf() + ->GetStatusAreaWidget() + ->unified_system_tray() + ->GetMessagePopupCollection() + ->GetPopupViewForNotificationID(id); +} + NotificationCenterTray* NotificationCenterTestApi::GetTray() { return notification_center_tray_; } @@ -72,12 +101,18 @@ ->notification_bar_->clear_all_button_; } +std::string NotificationCenterTestApi::GenerateNotificationId() { + return base::NumberToString(notification_id_++); +} + std::unique_ptr<message_center::Notification> NotificationCenterTestApi::CreateNotification(const std::string& id, - const std::string& title) { + const std::string& title, + const std::string& message, + const ui::ImageModel& icon) { return std::make_unique<message_center::Notification>( message_center::NOTIFICATION_TYPE_SIMPLE, id, base::UTF8ToUTF16(title), - u"test message", ui::ImageModel(), + u"test message", icon, /*display_source=*/std::u16string(), GURL(), message_center::NotifierId(), message_center::RichNotificationData(), new message_center::NotificationDelegate());
diff --git a/ash/system/notification_center/notification_center_test_api.h b/ash/system/notification_center/notification_center_test_api.h index 0bb898f..cb22191 100644 --- a/ash/system/notification_center/notification_center_test_api.h +++ b/ash/system/notification_center/notification_center_test_api.h
@@ -12,6 +12,10 @@ class Notification; } // namespace message_center +namespace ui { +class ImageModel; +} // namespace ui + namespace views { class View; class Widget; @@ -38,6 +42,11 @@ // Adds a notification and returns the associated id. std::string AddNotification(); + // Adds a notification with custom parameters and returns the associated id. + std::string AddCustomNotification(const std::string& title, + const std::string& message, + const ui::ImageModel& icon); + // Removes the notification associated with the provided id. void RemoveNotification(const std::string& id); @@ -52,6 +61,10 @@ // otherwise. bool IsTrayShown(); + // Returns the popup view associated with the provided notification id, + // nullptr otherwise. + views::View* GetPopupViewForId(const std::string& id); + // Returns the `NotificationCenterTray` in the shelf. NotificationCenterTray* GetTray(); @@ -71,9 +84,13 @@ views::View* GetClearAllButton(); private: + std::string GenerateNotificationId(); + std::unique_ptr<message_center::Notification> CreateNotification( const std::string& id, - const std::string& title); + const std::string& title, + const std::string& message, + const ui::ImageModel& icon); int notification_id_ = 0; NotificationCenterTray* const notification_center_tray_;
diff --git a/ash/system/unified/notification_counter_view.cc b/ash/system/unified/notification_counter_view.cc index d1e0f856..75cc1ae 100644 --- a/ash/system/unified/notification_counter_view.cc +++ b/ash/system/unified/notification_counter_view.cc
@@ -44,17 +44,15 @@ constexpr auto kSeparatorPadding = gfx::Insets::VH(6, 4); -gfx::FontList GetNumberIconFontList() { - // |kNumberIconFontSize| is hard-coded as 11, which whould be updated when +const gfx::FontList& GetNumberIconFontList() { + // |kNumberIconFontSize| is hard-coded as 11, which should be updated when // the tray icon size is changed. DCHECK_EQ(18, kUnifiedTrayIconSize); - gfx::Font default_font; - int font_size_delta = kNumberIconFontSize - default_font.GetFontSize(); - gfx::Font font = default_font.Derive(font_size_delta, gfx::Font::NORMAL, - gfx::Font::Weight::BOLD); - DCHECK_EQ(kNumberIconFontSize, font.GetFontSize()); - return gfx::FontList(font); + static gfx::FontList font_list({"Roboto"}, gfx::Font::NORMAL, + kNumberIconFontSize, + gfx::Font::Weight::MEDIUM); + return font_list; } ui::ColorId SeparatorIconColorId(session_manager::SessionState state) {
diff --git a/ash/system/video_conference/fake_video_conference_tray_controller.cc b/ash/system/video_conference/fake_video_conference_tray_controller.cc new file mode 100644 index 0000000..9229a8f --- /dev/null +++ b/ash/system/video_conference/fake_video_conference_tray_controller.cc
@@ -0,0 +1,22 @@ +// Copyright 2022 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/system/video_conference/fake_video_conference_tray_controller.h" + +#include "media/capture/video/chromeos/mojom/cros_camera_service.mojom-shared.h" + +namespace ash { + +FakeVideoConferenceTrayController::FakeVideoConferenceTrayController() = + default; + +void FakeVideoConferenceTrayController::SetCameraSoftwareMuted( + bool mute_camera) { + camera_soft_muted_ = mute_camera; + OnCameraSWPrivacySwitchStateChanged( + camera_soft_muted_ ? cros::mojom::CameraPrivacySwitchState::ON + : cros::mojom::CameraPrivacySwitchState::OFF); +} + +} // namespace ash \ No newline at end of file
diff --git a/ash/system/video_conference/fake_video_conference_tray_controller.h b/ash/system/video_conference/fake_video_conference_tray_controller.h new file mode 100644 index 0000000..7ba9c7e --- /dev/null +++ b/ash/system/video_conference/fake_video_conference_tray_controller.h
@@ -0,0 +1,36 @@ +// Copyright 2022 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_SYSTEM_VIDEO_CONFERENCE_FAKE_VIDEO_CONFERENCE_TRAY_CONTROLLER_H_ +#define ASH_SYSTEM_VIDEO_CONFERENCE_FAKE_VIDEO_CONFERENCE_TRAY_CONTROLLER_H_ + +#include "ash/ash_export.h" +#include "ash/system/video_conference/video_conference_tray_controller.h" + +namespace ash { + +// A fake version of VideoConferenceTrayController that will be use in tests or +// mocking in the emulator. +class ASH_EXPORT FakeVideoConferenceTrayController + : public VideoConferenceTrayController { + public: + FakeVideoConferenceTrayController(); + FakeVideoConferenceTrayController(const FakeVideoConferenceTrayController&) = + delete; + FakeVideoConferenceTrayController& operator=( + const FakeVideoConferenceTrayController&) = delete; + ~FakeVideoConferenceTrayController() override = default; + + // VideoConferenceTrayController: + void SetCameraSoftwareMuted(bool mute_camera) override; + + bool camera_soft_muted() { return camera_soft_muted_; } + + private: + bool camera_soft_muted_ = false; +}; + +} // namespace ash + +#endif // ASH_SYSTEM_VIDEO_CONFERENCE_FAKE_VIDEO_CONFERENCE_TRAY_CONTROLLER_H_ \ No newline at end of file
diff --git a/ash/system/video_conference/video_conference_bubble.cc b/ash/system/video_conference/video_conference_bubble.cc index 76cec4410..e6657ca 100644 --- a/ash/system/video_conference/video_conference_bubble.cc +++ b/ash/system/video_conference/video_conference_bubble.cc
@@ -7,20 +7,142 @@ #include "ash/resources/vector_icons/vector_icons.h" #include "ash/style/ash_color_id.h" #include "ash/system/tray/tray_bubble_view.h" +#include "media/capture/video/chromeos/mojom/effects_pipeline.mojom.h" +#include "ui/base/l10n/l10n_util.h" #include "ui/base/models/image_model.h" +#include "ui/views/background.h" +#include "ui/views/controls/button/label_button.h" +#include "ui/views/controls/button/radio_button.h" +#include "ui/views/controls/button/toggle_button.h" #include "ui/views/controls/image_view.h" +#include "ui/views/layout/flex_layout.h" namespace ash { +namespace { + +// NOTE: The buttons/switches here are temporary, for testing purposes only. The +// real UI elements will be added when the underlying work to produce them is +// complete. See b/253273036 (styled radio switch) and b/253249205 (styled +// toggle button). +class VideoConferenceBackgroundBlurRadioSwitch : public views::View { + public: + VideoConferenceBackgroundBlurRadioSwitch() { + const int kBackgroundBlurRadioGroupId = 1; + + views::FlexLayout* layout = + SetLayoutManager(std::make_unique<views::FlexLayout>()); + layout->SetOrientation(views::LayoutOrientation::kHorizontal); + layout->SetMainAxisAlignment(views::LayoutAlignment::kCenter); + layout->SetCrossAxisAlignment(views::LayoutAlignment::kStretch); + + AddChildView(std::make_unique<views::Label>(u"Background Blur")); + + std::unique_ptr<views::RadioButton> off_button = + std::make_unique<views::RadioButton>(u"Off", + kBackgroundBlurRadioGroupId); + off_button->SetCallback(base::BindRepeating( + &VideoConferenceBackgroundBlurRadioSwitch::OnLevelSelected, + base::Unretained(this), -1)); + AddChildView(std::move(off_button)); + + std::unique_ptr<views::RadioButton> lowest_button = + std::make_unique<views::RadioButton>(u"Lowest", + kBackgroundBlurRadioGroupId); + lowest_button->SetCallback(base::BindRepeating( + &VideoConferenceBackgroundBlurRadioSwitch::OnLevelSelected, + base::Unretained(this), (int)cros::mojom::BlurLevel::kLowest)); + AddChildView(std::move(lowest_button)); + + std::unique_ptr<views::RadioButton> light_button = + std::make_unique<views::RadioButton>(u"Light", + kBackgroundBlurRadioGroupId); + light_button->SetCallback(base::BindRepeating( + &VideoConferenceBackgroundBlurRadioSwitch::OnLevelSelected, + base::Unretained(this), (int)cros::mojom::BlurLevel::kLight)); + AddChildView(std::move(light_button)); + + std::unique_ptr<views::RadioButton> medium_button = + std::make_unique<views::RadioButton>(u"Medium", + kBackgroundBlurRadioGroupId); + medium_button->SetCallback(base::BindRepeating( + &VideoConferenceBackgroundBlurRadioSwitch::OnLevelSelected, + base::Unretained(this), (int)cros::mojom::BlurLevel::kMedium)); + AddChildView(std::move(medium_button)); + + std::unique_ptr<views::RadioButton> heavy_button = + std::make_unique<views::RadioButton>(u"Heavy", + kBackgroundBlurRadioGroupId); + heavy_button->SetCallback(base::BindRepeating( + &VideoConferenceBackgroundBlurRadioSwitch::OnLevelSelected, + base::Unretained(this), (int)cros::mojom::BlurLevel::kHeavy)); + AddChildView(std::move(heavy_button)); + + std::unique_ptr<views::RadioButton> maximum_button = + std::make_unique<views::RadioButton>(u"Maximum", + kBackgroundBlurRadioGroupId); + maximum_button->SetCallback(base::BindRepeating( + &VideoConferenceBackgroundBlurRadioSwitch::OnLevelSelected, + base::Unretained(this), (int)cros::mojom::BlurLevel::kMaximum)); + AddChildView(std::move(maximum_button)); + } + + VideoConferenceBackgroundBlurRadioSwitch( + const VideoConferenceBackgroundBlurRadioSwitch&) = delete; + VideoConferenceBackgroundBlurRadioSwitch& operator=( + const VideoConferenceBackgroundBlurRadioSwitch&) = delete; + ~VideoConferenceBackgroundBlurRadioSwitch() override = default; + + // Callback that's invoked when the user selects (presses) one of the radio + // buttons. + void OnLevelSelected(int level) {} +}; + +} // namespace + +VideoConferenceBubbleView::LabeledToggleButton::LabeledToggleButton( + views::Button::PressedCallback callback, + const std::u16string& effect_name) { + views::FlexLayout* layout = + SetLayoutManager(std::make_unique<views::FlexLayout>()); + layout->SetOrientation(views::LayoutOrientation::kHorizontal); + layout->SetMainAxisAlignment(views::LayoutAlignment::kCenter); + layout->SetCrossAxisAlignment(views::LayoutAlignment::kStretch); + + AddChildView(std::make_unique<views::Label>(effect_name)); + + std::unique_ptr<views::ToggleButton> button = + std::make_unique<views::ToggleButton>(callback); + button->SetAccessibleName(effect_name); + button_ = AddChildView(std::move(button)); +} + +bool VideoConferenceBubbleView::LabeledToggleButton::GetIsOn() const { + return button_->GetIsOn(); +} + +// NOTE: The buttons/switches here are temporary, for testing purposes only. The +// real UI elements will be added when the underlying work to produce them is +// complete. See b/253273036 (styled radio switch) and b/253249205(styled toggle +// button). VideoConferenceBubbleView::VideoConferenceBubbleView( const InitParams& init_params) : TrayBubbleView(init_params) { - // TODO(b/253088232): Added an icon so that the bubble can show. Will remove - // this with the newly created class VideoConferenceBubbleView. - auto icon = std::make_unique<views::ImageView>(); - icon->SetImage(ui::ImageModel::FromVectorIcon( - kPrivacyIndicatorsMicrophoneIcon, kColorAshIconColorPrimary)); - AddChildView(std::move(icon)); + // Toggle button for camera "background replace" effect. + background_replace_button_ = AddChildView(std::make_unique< + LabeledToggleButton>( + base::BindRepeating( + &VideoConferenceBubbleView::OnBackgroundReplaceToggleButtonPressed, + base::Unretained(this)), + u"Background Replace")); + + // Radio switch for camera "background blur" effect. + AddChildView(std::make_unique<VideoConferenceBackgroundBlurRadioSwitch>()); +} + +void VideoConferenceBubbleView::OnBackgroundReplaceToggleButtonPressed() { + // TODO (b/259585295) Use `background_replace_button_->GetIsOn()` to get the + // toggle state of the button and enable/disable the actual effect. } } // namespace ash
diff --git a/ash/system/video_conference/video_conference_bubble.h b/ash/system/video_conference/video_conference_bubble.h index ec50930..2d8085a 100644 --- a/ash/system/video_conference/video_conference_bubble.h +++ b/ash/system/video_conference/video_conference_bubble.h
@@ -7,6 +7,10 @@ #include "ash/system/tray/tray_bubble_view.h" +namespace views { +class ToggleButton; +} // namespace views + namespace ash { // The bubble that contains controls for camera and microphone effects, @@ -19,8 +23,32 @@ VideoConferenceBubbleView& operator=(const VideoConferenceBubbleView&) = delete; ~VideoConferenceBubbleView() override = default; + + private: + // A view that combines a `views::Label` and a `views::ToggleButton`, + // for toggling a camera/mic effect from the VC bubble. + class LabeledToggleButton : public views::View { + public: + explicit LabeledToggleButton(views::Button::PressedCallback callback, + const std::u16string& effect_name); + + LabeledToggleButton(const LabeledToggleButton&) = delete; + LabeledToggleButton& operator=(const LabeledToggleButton&) = delete; + ~LabeledToggleButton() override = default; + + // Returns `true` if the `ToggleButton` is "on," `false` otherwise. + bool GetIsOn() const; + + private: + views::ToggleButton* button_; + }; + + // Invoked when the "background replace" toggle button is pressed. + void OnBackgroundReplaceToggleButtonPressed(); + + LabeledToggleButton* background_replace_button_; }; } // namespace ash -#endif // ASH_SYSTEM_VIDEO_CONFERENCE_VIDEO_CONFERENCE_BUBBLE_H_ \ No newline at end of file +#endif // ASH_SYSTEM_VIDEO_CONFERENCE_VIDEO_CONFERENCE_BUBBLE_H_
diff --git a/ash/system/video_conference/video_conference_tray.cc b/ash/system/video_conference/video_conference_tray.cc index 2d824e7..f96e86c 100644 --- a/ash/system/video_conference/video_conference_tray.cc +++ b/ash/system/video_conference/video_conference_tray.cc
@@ -21,6 +21,7 @@ #include "ash/system/tray/tray_container.h" #include "ash/system/tray/tray_utils.h" #include "ash/system/video_conference/video_conference_bubble.h" +#include "ash/system/video_conference/video_conference_tray_controller.h" #include "base/functional/bind.h" #include "ui/base/metadata/metadata_header_macros.h" #include "ui/base/metadata/metadata_impl_macros.h" @@ -33,14 +34,12 @@ // A toggle icon button in the VC tray, which is used for toggling camera, // microphone, and screen sharing. -// Note that it's safe to use `base::Unretained()` in IconButton since callback -// is destroyed with `this`. class VideoConferenceTrayButton : public IconButton { public: - VideoConferenceTrayButton(const gfx::VectorIcon* icon, + VideoConferenceTrayButton(PressedCallback callback, + const gfx::VectorIcon* icon, const int accessible_name_id) - : IconButton(base::BindRepeating(&VideoConferenceTrayButton::ToggleButton, - base::Unretained(this)), + : IconButton(std::move(callback), IconButton::Type::kMedium, icon, accessible_name_id, @@ -60,14 +59,20 @@ TrayBackgroundViewCatalogName::kVideoConferenceTray) { audio_icon_ = tray_container()->AddChildView( std::make_unique<VideoConferenceTrayButton>( + base::BindRepeating(&VideoConferenceTray::OnAudioButtonClicked, + weak_ptr_factory_.GetWeakPtr()), &kPrivacyIndicatorsMicrophoneIcon, IDS_PRIVACY_NOTIFICATION_TITLE_MIC)); camera_icon_ = tray_container()->AddChildView( std::make_unique<VideoConferenceTrayButton>( + base::BindRepeating(&VideoConferenceTray::OnCameraButtonClicked, + weak_ptr_factory_.GetWeakPtr()), &kPrivacyIndicatorsCameraIcon, IDS_PRIVACY_NOTIFICATION_TITLE_CAMERA)); screen_share_icon_ = tray_container()->AddChildView( std::make_unique<VideoConferenceTrayButton>( + base::BindRepeating(&VideoConferenceTray::OnScreenShareButtonClicked, + weak_ptr_factory_.GetWeakPtr()), &kPrivacyIndicatorsScreenShareIcon, IDS_ASH_STATUS_TRAY_SCREEN_SHARE_TITLE)); expand_indicator_ = @@ -179,6 +184,19 @@ gfx::ImageSkiaOperations::CreateRotatedImage(image, rotation)); } +void VideoConferenceTray::OnCameraButtonClicked(const ui::Event& event) { + Shell::Get()->video_conference_tray_controller()->SetCameraSoftwareMuted( + /*mute_camera=*/!camera_icon_->toggled()); +} + +void VideoConferenceTray::OnAudioButtonClicked(const ui::Event& event) { + // TODO(b/253275993): Implement the callback for `audio_icon_`. +} + +void VideoConferenceTray::OnScreenShareButtonClicked(const ui::Event& event) { + // TODO(b/253277644): Implement the callback for `screen_share_icon_`. +} + BEGIN_METADATA(VideoConferenceTray, TrayBackgroundView) END_METADATA
diff --git a/ash/system/video_conference/video_conference_tray.h b/ash/system/video_conference/video_conference_tray.h index 43960fd..67ac756 100644 --- a/ash/system/video_conference/video_conference_tray.h +++ b/ash/system/video_conference/video_conference_tray.h
@@ -9,8 +9,13 @@ #include "ash/ash_export.h" #include "ash/system/tray/tray_background_view.h" +#include "base/memory/weak_ptr.h" #include "ui/base/metadata/metadata_header_macros.h" +namespace ui { +class Event; +} // namespace ui + namespace views { class ImageView; class Widget; @@ -47,6 +52,8 @@ void OnThemeChanged() override; void UpdateAfterLoginStatusChange() override; + IconButton* camera_icon() { return camera_icon_; } + private: friend class VideoConferenceTrayTest; @@ -54,6 +61,11 @@ // and whether the bubble is opened. void UpdateExpandIndicator(); + // Callback functions for the icons when being clicked. + void OnCameraButtonClicked(const ui::Event& event); + void OnAudioButtonClicked(const ui::Event& event); + void OnScreenShareButtonClicked(const ui::Event& event); + // Owned by the views hierarchy. IconButton* audio_icon_ = nullptr; IconButton* camera_icon_ = nullptr; @@ -62,6 +74,8 @@ // The bubble that appears after clicking the tray button. std::unique_ptr<TrayBubbleWrapper> bubble_; + + base::WeakPtrFactory<VideoConferenceTray> weak_ptr_factory_{this}; }; } // namespace ash
diff --git a/ash/system/video_conference/video_conference_tray_controller.cc b/ash/system/video_conference/video_conference_tray_controller.cc index 93de9cfd..4573dac 100644 --- a/ash/system/video_conference/video_conference_tray_controller.cc +++ b/ash/system/video_conference/video_conference_tray_controller.cc
@@ -4,10 +4,44 @@ #include "ash/system/video_conference/video_conference_tray_controller.h" +#include "ash/root_window_controller.h" +#include "ash/shell.h" +#include "ash/style/icon_button.h" +#include "ash/system/status_area_widget.h" +#include "ash/system/video_conference/video_conference_tray.h" +#include "media/capture/video/chromeos/camera_hal_dispatcher_impl.h" +#include "media/capture/video/chromeos/mojom/cros_camera_service.mojom-shared.h" + namespace ash { -VideoConferenceTrayController::VideoConferenceTrayController() = default; +VideoConferenceTrayController::VideoConferenceTrayController() { + media::CameraHalDispatcherImpl::GetInstance()->AddCameraPrivacySwitchObserver( + this); +} -VideoConferenceTrayController::~VideoConferenceTrayController() = default; +VideoConferenceTrayController::~VideoConferenceTrayController() { + media::CameraHalDispatcherImpl::GetInstance() + ->RemoveCameraPrivacySwitchObserver(this); +} + +void VideoConferenceTrayController::SetCameraSoftwareMuted(bool mute_camera) { + media::CameraHalDispatcherImpl::GetInstance()->SetCameraSWPrivacySwitchState( + mute_camera ? cros::mojom::CameraPrivacySwitchState::ON + : cros::mojom::CameraPrivacySwitchState::OFF); +} + +void VideoConferenceTrayController::OnCameraSWPrivacySwitchStateChanged( + cros::mojom::CameraPrivacySwitchState state) { + for (auto* root_window_controller : + Shell::Get()->GetAllRootWindowControllers()) { + DCHECK(root_window_controller); + DCHECK(root_window_controller->GetStatusAreaWidget()); + + root_window_controller->GetStatusAreaWidget() + ->video_conference_tray() + ->camera_icon() + ->SetToggled(state == cros::mojom::CameraPrivacySwitchState::ON); + } +} } // namespace ash \ No newline at end of file
diff --git a/ash/system/video_conference/video_conference_tray_controller.h b/ash/system/video_conference/video_conference_tray_controller.h index 5d0ca2c..5312ab4 100644 --- a/ash/system/video_conference/video_conference_tray_controller.h +++ b/ash/system/video_conference/video_conference_tray_controller.h
@@ -5,6 +5,9 @@ #ifndef ASH_SYSTEM_VIDEO_CONFERENCE_VIDEO_CONFERENCE_TRAY_CONTROLLER_H_ #define ASH_SYSTEM_VIDEO_CONFERENCE_VIDEO_CONFERENCE_TRAY_CONTROLLER_H_ +#include "ash/ash_export.h" +#include "media/capture/video/chromeos/camera_hal_dispatcher_impl.h" + namespace ash { // Controller that will act as a "bridge" between VC apps management and the VC @@ -12,7 +15,8 @@ // destructed immediately after the UI, so any code that keeps a reference to // it must be prepared to accommodate this specific lifetime in order to prevent // any use-after-free bugs. -class VideoConferenceTrayController { +class ASH_EXPORT VideoConferenceTrayController + : public media::CameraPrivacySwitchObserver { public: VideoConferenceTrayController(); @@ -20,7 +24,14 @@ VideoConferenceTrayController& operator=( const VideoConferenceTrayController&) = delete; - ~VideoConferenceTrayController(); + ~VideoConferenceTrayController() override; + + // Set the state for camera software mute. Virtual for testing/mocking. + virtual void SetCameraSoftwareMuted(bool mute_camera); + + // media::CameraPrivacySwitchObserver: + void OnCameraSWPrivacySwitchStateChanged( + cros::mojom::CameraPrivacySwitchState state) override; }; } // namespace ash
diff --git a/ash/system/video_conference/video_conference_tray_unittest.cc b/ash/system/video_conference/video_conference_tray_unittest.cc index c3cf7c16..b5d30b5 100644 --- a/ash/system/video_conference/video_conference_tray_unittest.cc +++ b/ash/system/video_conference/video_conference_tray_unittest.cc
@@ -7,11 +7,15 @@ #include "ash/constants/ash_features.h" #include "ash/resources/vector_icons/vector_icons.h" #include "ash/shelf/shelf.h" +#include "ash/shell.h" #include "ash/style/ash_color_id.h" +#include "ash/style/icon_button.h" #include "ash/system/status_area_widget.h" #include "ash/system/status_area_widget_test_helper.h" #include "ash/system/unified/unified_system_tray.h" +#include "ash/system/video_conference/fake_video_conference_tray_controller.h" #include "ash/test/ash_test_base.h" +#include "ash/test_shell_delegate.h" #include "base/test/scoped_feature_list.h" #include "ui/events/test/event_generator.h" #include "ui/gfx/image/image_skia_operations.h" @@ -39,7 +43,7 @@ void SetUp() override { scoped_feature_list_.InitAndEnableFeature(features::kVcControlsUi); - AshTestBase::SetUp(); + AshTestBase::SetUp(std::make_unique<TestShellDelegate>()); } VideoConferenceTray* video_conference_tray() { @@ -51,6 +55,11 @@ return video_conference_tray()->expand_indicator_; } + FakeVideoConferenceTrayController* controller() { + return static_cast<FakeVideoConferenceTrayController*>( + Shell::Get()->video_conference_tray_controller()); + } + private: base::test::ScopedFeatureList scoped_feature_list_; }; @@ -134,4 +143,19 @@ expand_indicator()->GetImage())); } +TEST_F(VideoConferenceTrayTest, ToggleCameraButton) { + auto* camera_icon = video_conference_tray()->camera_icon(); + EXPECT_FALSE(camera_icon->toggled()); + + // Click the button should mute the camera. + LeftClickOn(camera_icon); + EXPECT_TRUE(controller()->camera_soft_muted()); + EXPECT_TRUE(camera_icon->toggled()); + + // Toggle again, should be unmuted. + LeftClickOn(camera_icon); + EXPECT_FALSE(controller()->camera_soft_muted()); + EXPECT_FALSE(camera_icon->toggled()); +} + } // namespace ash \ No newline at end of file
diff --git a/ash/test_shell_delegate.cc b/ash/test_shell_delegate.cc index 89b9692..8aeff93 100644 --- a/ash/test_shell_delegate.cc +++ b/ash/test_shell_delegate.cc
@@ -13,6 +13,7 @@ #include "ash/public/cpp/test/test_desks_templates_delegate.h" #include "ash/public/cpp/test/test_nearby_share_delegate.h" #include "ash/system/geolocation/test_geolocation_url_loader_factory.h" +#include "ash/system/video_conference/fake_video_conference_tray_controller.h" #include "ash/wm/gestures/back_gesture/test_back_gesture_contextual_nudge_delegate.h" #include "url/gurl.h" @@ -58,6 +59,11 @@ return std::make_unique<TestDesksTemplatesDelegate>(); } +std::unique_ptr<ash::VideoConferenceTrayController> +TestShellDelegate::CreateVideoConferenceTrayController() const { + return std::make_unique<FakeVideoConferenceTrayController>(); +} + scoped_refptr<network::SharedURLLoaderFactory> TestShellDelegate::GetGeolocationUrlLoaderFactory() const { return static_cast<scoped_refptr<network::SharedURLLoaderFactory>>(
diff --git a/ash/test_shell_delegate.h b/ash/test_shell_delegate.h index 91d2ec5..9f96bb51 100644 --- a/ash/test_shell_delegate.h +++ b/ash/test_shell_delegate.h
@@ -47,6 +47,8 @@ NearbyShareController* controller) const override; std::unique_ptr<DesksTemplatesDelegate> CreateDesksTemplatesDelegate() const override; + std::unique_ptr<ash::VideoConferenceTrayController> + CreateVideoConferenceTrayController() const override; scoped_refptr<network::SharedURLLoaderFactory> GetGeolocationUrlLoaderFactory() const override; bool CanGoBack(gfx::NativeWindow window) const override;
diff --git a/ash/webui/projector_app/trusted_projector_annotator_ui.cc b/ash/webui/projector_app/trusted_projector_annotator_ui.cc index 70881b8..5224962 100644 --- a/ash/webui/projector_app/trusted_projector_annotator_ui.cc +++ b/ash/webui/projector_app/trusted_projector_annotator_ui.cc
@@ -46,6 +46,11 @@ source->OverrideContentSecurityPolicy( network::mojom::CSPDirectiveName::FrameSrc, csp); + source->OverrideContentSecurityPolicy( + network::mojom::CSPDirectiveName::TrustedTypes, + "trusted-types polymer-html-literal " + "polymer-template-event-attribute-policy;"); + return source; }
diff --git a/ash/wm/splitview/split_view_controller.cc b/ash/wm/splitview/split_view_controller.cc index 9eb0a529..a9e1bbe 100644 --- a/ash/wm/splitview/split_view_controller.cc +++ b/ash/wm/splitview/split_view_controller.cc
@@ -590,6 +590,9 @@ base::flat_set<aura::Window*> observed_windows_; }; +// Helper class that prepares windows that are changing to snapped window state. +// This allows async window state type changes and handles calls to +// SplitViewController when necessary. class SplitViewController::ToBeSnappedWindowsObserver : public aura::WindowObserver, public WindowStateObserver { @@ -913,10 +916,15 @@ auto_snap_controller_ = std::make_unique<AutoSnapController>(this); - // If there is pre-set |divider_position_|, use it. It can happen during - // tablet <-> clamshell transition or multi-user transition. - divider_position_ = (divider_position_ < 0) ? GetDefaultDividerPosition() - : divider_position_; + // Get the divider position given by `snap_ratio`, or if there is pre-set + // |divider_position_|, use it. It can happen during tablet <-> clamshell + // transition or multi-user transition. + absl::optional<float> snap_ratio = WindowState::Get(window)->snap_ratio(); + divider_position_ = + (divider_position_ < 0) + ? GetDividerPosition(snap_position, + snap_ratio ? *snap_ratio : kDefaultSnapRatio) + : divider_position_; default_snap_position_ = snap_position; // There is no divider bar in clamshell splitview mode.
diff --git a/ash/wm/tablet_mode/tablet_mode_multitask_menu_event_handler_unittest.cc b/ash/wm/tablet_mode/tablet_mode_multitask_menu_event_handler_unittest.cc index 8459ae4..6295578 100644 --- a/ash/wm/tablet_mode/tablet_mode_multitask_menu_event_handler_unittest.cc +++ b/ash/wm/tablet_mode/tablet_mode_multitask_menu_event_handler_unittest.cc
@@ -407,7 +407,7 @@ } // Tests that the multitask menu gets updated after a button is pressed. -TEST_F(TabletModeMultitaskMenuEventHandlerTest, ButtonFunctionality) { +TEST_F(TabletModeMultitaskMenuEventHandlerTest, HalfButtonFunctionality) { auto window = CreateTestWindow(); ShowMultitaskMenu(*window); @@ -448,6 +448,45 @@ .x()); } +TEST_F(TabletModeMultitaskMenuEventHandlerTest, PartialButtonFunctionality) { + auto window = CreateTestWindow(); + + // Test that primary button snaps to 0.67f screen ratio. + ShowMultitaskMenu(*window); + GetEventGenerator()->GestureTapAt(GetMultitaskMenuView(GetMultitaskMenu()) + ->partial_button_for_testing() + ->GetBoundsInScreen() + .left_center()); + ASSERT_EQ(chromeos::WindowStateType::kPrimarySnapped, + WindowState::Get(window.get())->GetStateType()); + const gfx::Rect work_area_bounds_in_screen = + display::Screen::GetScreen()->GetPrimaryDisplay().work_area(); + auto* split_view_controller = + SplitViewController::Get(Shell::GetPrimaryRootWindow()); + const gfx::Rect divider_bounds = + split_view_controller->split_view_divider()->GetDividerBoundsInScreen( + /*is_dragging*/ false); + ASSERT_NEAR(work_area_bounds_in_screen.width() * 0.67, + window->bounds().width(), divider_bounds.width()); + + // Test that the multitask menu has been closed. + ASSERT_FALSE(GetMultitaskMenu()); + + // Test that secondary button snaps to 0.33f screen ratio. + ShowMultitaskMenu(*window); + gfx::Rect partial_bounds(GetMultitaskMenuView(GetMultitaskMenu()) + ->partial_button_for_testing() + ->GetBoundsInScreen()); + gfx::Point secondary_center( + gfx::Point(partial_bounds.x() + partial_bounds.width() * 0.67f, + partial_bounds.y() + partial_bounds.y() / 2)); + GetEventGenerator()->GestureTapAt(secondary_center); + ASSERT_EQ(chromeos::WindowStateType::kSecondarySnapped, + WindowState::Get(window.get())->GetStateType()); + ASSERT_NEAR(work_area_bounds_in_screen.width() * 0.33, + window->bounds().width(), divider_bounds.width()); +} + // Tests that tap outside the menu will close the menu. TEST_F(TabletModeMultitaskMenuEventHandlerTest, CloseMultitaskMenuOnTap) { // Create a display and window that is bigger than the menu.
diff --git a/ash/wm/tablet_mode/tablet_mode_window_state.cc b/ash/wm/tablet_mode/tablet_mode_window_state.cc index d7785cd..a130b03 100644 --- a/ash/wm/tablet_mode/tablet_mode_window_state.cc +++ b/ash/wm/tablet_mode/tablet_mode_window_state.cc
@@ -369,12 +369,9 @@ break; case WM_EVENT_SNAP_PRIMARY: case WM_EVENT_SNAP_SECONDARY: - DoTabletSnap( - window_state, event->type(), - WindowSnapWMEvent::GetFloatValueForSnapRatio( - event->IsSnapInfoAvailable() - ? static_cast<const WindowSnapWMEvent*>(event)->snap_ratio() - : WindowSnapWMEvent::SnapRatio::kDefaultSnapRatio)); + // TODO(b/259302867): Remove `window_state->snap_ratio()` since it can be + // gotten from `window_state`. + DoTabletSnap(window_state, event->type(), window_state->snap_ratio()); return; case WM_EVENT_CYCLE_SNAP_PRIMARY: CycleTabletSnap(window_state,
diff --git a/ash/wm/window_state.cc b/ash/wm/window_state.cc index add7e2c..3fece8dc 100644 --- a/ash/wm/window_state.cc +++ b/ash/wm/window_state.cc
@@ -451,13 +451,19 @@ if (event->IsSnapEvent()) { // Snap events should be created as WindowSnapWMEvent. DCHECK(event->IsSnapInfoAvailable()); + // Save the target snap ratio. + // TODO(b/259302867): Since the snap ratio is saved here, remove + // `new_snap_ratio` method parameter piping. + snap_ratio_ = + absl::make_optional(WindowSnapWMEvent::GetFloatValueForSnapRatio( + static_cast<const WindowSnapWMEvent*>(event)->snap_ratio())); } current_state_->OnWMEvent(this, event); - if (event->IsSnapEvent() || event->IsBoundsEvent()) { + // TODO(b/259585069): Move the snap ratio update to `OnWindowBoundsChanged`. + if (event->IsBoundsEvent()) UpdateSnapRatio(); - } PersistentDesksBarController* bar_controller = Shell::Get()->persistent_desks_bar_controller();
diff --git a/ash/wm/window_state.h b/ash/wm/window_state.h index a4c53c5f..75a2669b 100644 --- a/ash/wm/window_state.h +++ b/ash/wm/window_state.h
@@ -582,9 +582,13 @@ bool allow_set_bounds_direct_ = false; bool is_moving_to_another_display_ = false; - // A property to save the ratio between snapped window width (or height - // for vertical layout) and display workarea width (or height). The ratio - // should be preserved when the display or workspace size changes. + // Contains the window's target snap ratio if it's going to be snapped by a + // WindowSnapWMEvent, and the updated window snap ratio if the snapped + // window's bounds are changed while it remains snapped. It will be used to + // calculate the desired snapped window bounds for a WindowSnapWMEvent, or + // adjust the window's bounds when display or workarea changes, or decide what + // the window bounds should be if restoring the window back to a snapped + // window state, etc. absl::optional<float> snap_ratio_; // A property to remember the window position which was set before the
diff --git a/base/BUILD.gn b/base/BUILD.gn index e5af792..5adca36e 100644 --- a/base/BUILD.gn +++ b/base/BUILD.gn
@@ -362,6 +362,7 @@ "functional/callback_internal.cc", "functional/callback_internal.h", "functional/callback_tags.h", + "functional/disallow_unretained.h", "functional/function_ref.h", "functional/identity.h", "functional/invoke.h",
diff --git a/base/allocator/partition_alloc_features.cc b/base/allocator/partition_alloc_features.cc index 304b1ed..94a34107 100644 --- a/base/allocator/partition_alloc_features.cc +++ b/base/allocator/partition_alloc_features.cc
@@ -87,7 +87,9 @@ BASE_FEATURE(kPartitionAllocBackupRefPtr, "PartitionAllocBackupRefPtr", -#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_WIN) || \ +// TODO(keishi): Enabled on mac temporarily for debugging. Will be removed after +// one Canary release. +#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || \ (BUILDFLAG(USE_ASAN_BACKUP_REF_PTR) && BUILDFLAG(IS_LINUX)) FEATURE_ENABLED_BY_DEFAULT #else
diff --git a/base/functional/bind_internal.h b/base/functional/bind_internal.h index 288ab5d..f51ad22 100644 --- a/base/functional/bind_internal.h +++ b/base/functional/bind_internal.h
@@ -87,9 +87,32 @@ template <typename Functor, typename SFINAE = void> struct FunctorTraits; +// Helpers for detecting the tag created by the `DISALLOW_UNRETAINED()` macro +// from base/functional/disallow_unretained.h. Intentionally separate to avoid +// including <type_traits> in a header that otherwise doesn't need it. +template <typename T, typename SFINAE = void> +struct TypeSupportsUnretained { + static constexpr inline bool kValue = true; +}; + +template <typename T> +struct TypeSupportsUnretained<T, + std::void_t<typename T::DisallowBaseUnretained>> { + static constexpr inline bool kValue = false; +}; + +template <typename T> +static inline constexpr bool TypeSupportsUnretainedV = + TypeSupportsUnretained<T>::kValue; + template <typename T, typename RawPtrType = base::RawPtrBanDanglingIfSupported> class UnretainedWrapper { public: + static_assert(TypeSupportsUnretainedV<T>, + "Callback cannot capture an unprotected C++ pointer since this " + "Type is annotated with DISALLOW_UNRETAINED(). Please see " + "base/functional/disallow_unretained.h for alternatives."); + explicit UnretainedWrapper(T* o) : ptr_(o) {} // Trick to only instantiate these constructors if they are used. Otherwise, @@ -161,6 +184,12 @@ template <typename T, bool = raw_ptr_traits::IsSupportedType<T>::value> class UnretainedRefWrapper { public: + static_assert( + TypeSupportsUnretainedV<T>, + "Callback cannot capture an unprotected C++ reference since this " + "type is annotated with DISALLOW_UNRETAINED(). Please see " + "base/functional/disallow_unretained.h for alternatives."); + explicit UnretainedRefWrapper(T& o) : ref_(o) {} T& get() const { return ref_; } @@ -173,6 +202,11 @@ template <typename T> class UnretainedRefWrapper<T, true> { public: + static_assert(TypeSupportsUnretainedV<T>, + "Callback cannot capture an unprotected C++ pointer since this " + "type is annotated with DISALLOW_UNRETAINED(). Please see " + "base/functional/disallow_unretained.h for alternatives."); + explicit UnretainedRefWrapper(T& o) : ref_(o) {} T& get() const { // We can't use operator* here, we need to use raw_ptr's GetForExtraction @@ -191,6 +225,12 @@ template <typename T, typename I, bool b> class UnretainedRefWrapper<raw_ref<T, I>, b> { public: + static_assert( + TypeSupportsUnretainedV<T>, + "Callback cannot capture an unprotected C++ reference since this " + "Type is annotated with DISALLOW_UNRETAINED(). Please see " + "base/functional/disallow_unretained.h for alternatives."); + explicit UnretainedRefWrapper(const raw_ref<T, I>& ref) : ref_(ref) {} explicit UnretainedRefWrapper(raw_ref<T, I>&& ref) : ref_(std::move(ref)) {} T& get() const {
diff --git a/base/functional/bind_unittest.cc b/base/functional/bind_unittest.cc index 1ee5d023..112e8a5 100644 --- a/base/functional/bind_unittest.cc +++ b/base/functional/bind_unittest.cc
@@ -14,6 +14,7 @@ #include "base/allocator/partition_allocator/dangling_raw_ptr_checks.h" #include "base/allocator/partition_allocator/partition_alloc.h" #include "base/functional/callback.h" +#include "base/functional/disallow_unretained.h" #include "base/memory/ptr_util.h" #include "base/memory/raw_ptr.h" #include "base/memory/raw_ref.h" @@ -37,6 +38,24 @@ namespace base { namespace { +class AllowsUnretained {}; + +class BansUnretained { + public: + DISALLOW_UNRETAINED(); +}; + +class BansUnretainedInPrivate { + DISALLOW_UNRETAINED(); +}; + +class DerivedButBaseBansUnretained : public BansUnretained {}; + +static_assert(internal::TypeSupportsUnretainedV<AllowsUnretained>); +static_assert(!internal::TypeSupportsUnretainedV<BansUnretained>); +static_assert(!internal::TypeSupportsUnretainedV<BansUnretainedInPrivate>); +static_assert(!internal::TypeSupportsUnretainedV<DerivedButBaseBansUnretained>); + class IncompleteType; class NoRef {
diff --git a/base/functional/bind_unittest.nc b/base/functional/bind_unittest.nc index 789eef5..11019d3 100644 --- a/base/functional/bind_unittest.nc +++ b/base/functional/bind_unittest.nc
@@ -9,6 +9,7 @@ #include "base/functional/bind.h" #include "base/functional/callback.h" +#include "base/functional/disallow_unretained.h" #include "base/memory/ref_counted.h" #include "base/memory/raw_ptr.h" #include "base/memory/raw_ref.h" @@ -82,6 +83,18 @@ void operator()() const {} }; +class Dangerous { + public: + void Method() {} + + DISALLOW_UNRETAINED(); +}; + +void PassDangerousByPtr(Dangerous*) {} +void PassDangerousByConstRef(const Dangerous&) {} +void PassDangerousByMutableRef(Dangerous&) {} + + #if defined(NCTEST_METHOD_ON_CONST_OBJECT) // [r"static assertion failed.+?BindArgument<0>::ForwardedAs<.+?>::ToParamWithType<.+?>::kCanBeForwardedToBoundFunctor.+?Type mismatch between bound argument and bound functor's parameter\."] // Method bound to const-object. @@ -505,6 +518,34 @@ BindRepeating(&F, 1, 2, 3); } +#elif defined(NCTEST_UNRETAINED_WITH_DISALLOWED_TYPE) // [r"fatal error: static assertion failed due to requirement 'TypeSupportsUnretainedV"] + +void WontCompile() { + Dangerous dangerous; + BindOnce(&Dangerous::Method, base::Unretained(&dangerous)); +} + +#elif defined(NCTEST_RAW_POINTER_WITH_DISALLOWED_TYPE) // [r"fatal error: static assertion failed due to requirement 'TypeSupportsUnretainedV"] + +void WontCompile() { + Dangerous dangerous; + BindOnce(&PassDangerousByPtr, &dangerous); +} + +#elif defined(NCTEST_RAW_CONST_REFERENCE_WITH_DISALLOWED_TYPE) // [r"fatal error: static assertion failed due to requirement 'TypeSupportsUnretainedV"] + +void WontCompile() { + Dangerous dangerous; + BindOnce(&PassDangerousByConstRef, std::cref(dangerous)); +} + +#elif defined(NCTEST_RAW_MUTABLE_REFERENCE_WITH_DISALLOWED_TYPE) // [r"fatal error: static assertion failed due to requirement 'TypeSupportsUnretainedV"] + +void WontCompile() { + Dangerous dangerous; + BindOnce(&PassDangerousByMutableRef, std::ref(dangerous)); +} + #endif } // namespace base
diff --git a/base/functional/disallow_unretained.h b/base/functional/disallow_unretained.h new file mode 100644 index 0000000..9489ffc --- /dev/null +++ b/base/functional/disallow_unretained.h
@@ -0,0 +1,71 @@ +// Copyright 2022 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef BASE_FUNCTIONAL_DISALLOW_UNRETAINED_H_ +#define BASE_FUNCTIONAL_DISALLOW_UNRETAINED_H_ + +// IMPORTANT: this is currently experimental. Use with caution, as the +// interaction with various base APIs is still unstable and subject to change. +// +// Types can opt to forbid use of `Unretained()`, et cetera by using this macro +// to annotate their class definition: +// +// class Dangerous { +// DISALLOW_UNRETAINED(); +// public: +// +// ... +// +// void PostAsyncWork() { +// // Will not compile. +// task_runner_->PostTask( +// FROM_HERE, +// base::BindOnce(&Dangerous::OnAsyncWorkDone, base::Unretained(this))); +// } +// +// void OnAsyncWorkDone() { +// ... +// } +// }; +// +// A type that disallows use of base::Unretained() can still be used with +// callback: +// +// - If a type is only used on one sequence (e.g. `content::RenderFrameHostImpl` +// may only be used on the UI thread), embed a `base::WeakPtrFactory<T>` and +// either use: +// +// - `GetSafeRef()` to bind a `SafeRef<T>` if `this` must *always* still be +// alive when the callback is invoked, e.g. binding Mojo reply callbacks +// when making Mojo calls through a `mojo::Remote` owned by `this`. +// +// - `GetWeakPtr()` to bind a `WeakPtr<T>` if the lifetimes are unclear, e.g. +// a task posted to main UI task runner, and a strong lifetime assertion is +// not possible. +// +// - Note 1: use `WeakPtr<T>` only when appropriate. `WeakPtr<T>` makes it +// harder to reason about lifetimes; while it is necessary and appropriate +// in many places, using it unnecessarily makes it hard to understand when +// one object is guaranteed to outlive another. +// +// - Note 2: whether `GetSafeRef()` or `GetWeakPtr()` is used, include +// comments to explain the assumptions behind the selection. Though these +// comments may become inaccurate over time, they are still valuable +// to helping when reading unfamiliar code. +// +// - If a type is used on multiple sequences, make it refcounted and either bind +// a `scoped_refptr<t>` or use `base::RetainedRef()`. +// +// - Consider if callbacks are needed at all; using abstractions like +// `base::SequenceBound<T>` make it much easier to manage cross-sequence +// lifetimes and avoid the need to write `base::Unretained()` at all. +#define DISALLOW_UNRETAINED() \ + public: \ + using DisallowBaseUnretained = void; \ + \ + private: \ + /* No-op statement so use of this macro can be followed by `;`. */ \ + static_assert(true) + +#endif // BASE_FUNCTIONAL_DISALLOW_UNRETAINED_H_
diff --git a/build_overrides/partition_alloc.gni b/build_overrides/partition_alloc.gni index f621d80..2caed7a 100644 --- a/build_overrides/partition_alloc.gni +++ b/build_overrides/partition_alloc.gni
@@ -79,5 +79,5 @@ enable_mte_checked_ptr_support_default = false put_ref_count_in_previous_slot_default = true -enable_backup_ref_ptr_slow_checks_default = false +enable_backup_ref_ptr_slow_checks_default = is_mac enable_dangling_raw_ptr_checks_default = false
diff --git a/chrome/VERSION b/chrome/VERSION index 4fa8e80..946a6fb0 100644 --- a/chrome/VERSION +++ b/chrome/VERSION
@@ -1,4 +1,4 @@ MAJOR=110 MINOR=0 -BUILD=5425 +BUILD=5426 PATCH=0
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ui/system/StatusBarColorController.java b/chrome/android/java/src/org/chromium/chrome/browser/ui/system/StatusBarColorController.java index 1612a13..495a488 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/ui/system/StatusBarColorController.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/ui/system/StatusBarColorController.java
@@ -6,7 +6,6 @@ import android.content.Context; import android.graphics.Color; -import android.os.Build; import android.view.View; import android.view.Window; @@ -66,8 +65,7 @@ * If this returns a color other than {@link #UNDEFINED_STATUS_BAR_COLOR} and * {@link #DEFAULT_STATUS_BAR_COLOR}, the {@link StatusBarColorController} will * always use the color provided by this method to adjust the status bar color. - * This color may be used as-is or adjusted due to a scrim overlay or Android - * version. + * This color may be used as-is or adjusted due to a scrim overlay. */ @ColorInt int getBaseStatusBarColor(Tab tab); @@ -336,22 +334,15 @@ @VisibleForTesting public void updateStatusBarColor(@ColorInt int color) { mStatusBarColorWithoutStatusIndicator = color; - if (shouldDarkenStatusBarColor()) { - mStatusBarColorWithoutStatusIndicator = - ColorUtils.getDarkenedColorForStatusBar(mStatusBarColorWithoutStatusIndicator); - } int statusBarColor = applyStatusBarIndicatorColor(mStatusBarColorWithoutStatusIndicator); statusBarColor = applyCurrentScrimToColor(statusBarColor); setStatusBarColor(mWindow, statusBarColor); } - // TODO(sinansahin): Confirm pre-M expectations with UX and update as needed. /** * @return The status bar color without the status indicator's color taken into consideration. - * Color returned from this method includes darkening if the OS version doesn't support - * light status bar icons (pre-M). However, scrimming isn't included since it's managed - * completely by this class. + * However, scrimming isn't included since it's managed completely by this class. */ public @ColorInt int getStatusBarColorWithoutStatusIndicator() { return mStatusBarColorWithoutStatusIndicator; @@ -378,8 +369,6 @@ // Return status bar color in overview mode. if (mIsInOverviewMode) { - if (shouldDarkenStatusBarColor()) return Color.BLACK; - return (mIsIncognito && ToolbarColors.canUseIncognitoToolbarThemeColorInOverview( mWindow.getContext())) @@ -390,8 +379,6 @@ // Return status bar color in standard NewTabPage. If location bar is not shown in NTP, we // use the tab theme color regardless of the URL expansion percentage. if (isLocationBarShownInNTP()) { - if (shouldDarkenStatusBarColor()) return Color.BLACK; - return ColorUtils.getColorWithOverlay(mTopUiThemeColor.getBackgroundColor(mCurrentTab), mTopUiThemeColor.getThemeColor(), mToolbarUrlExpansionPercentage); } @@ -402,12 +389,9 @@ } /** - * Calculates the default status bar color based on the Android version and incognito state. + * Calculates the default status bar color based on the incognito state. */ private @ColorInt int calculateDefaultStatusBarColor() { - if (shouldDarkenStatusBarColor()) { - return Color.BLACK; - } if (mIsOmniboxFocused) { return mIsIncognito ? mIncognitoPrimaryBgColor : mActiveOmniboxDefaultColor; } @@ -439,9 +423,7 @@ private @ColorInt int applyStatusBarIndicatorColor(@ColorInt int darkenedBaseColor) { if (mStatusIndicatorColor == UNDEFINED_STATUS_BAR_COLOR) return darkenedBaseColor; - return shouldDarkenStatusBarColor() - ? ColorUtils.getDarkenedColorForStatusBar(mStatusIndicatorColor) - : mStatusIndicatorColor; + return mStatusIndicatorColor; } /** @@ -450,8 +432,6 @@ * @return The resulting color. */ private @ColorInt int applyCurrentScrimToColor(@ColorInt int color) { - if (shouldDarkenStatusBarColor()) return color; - if (mScrimColor == 0) { final View root = mWindow.getDecorView().getRootView(); final Context context = root.getContext(); @@ -465,14 +445,6 @@ } /** - * @return Whether to to darken the status bar color because the OS version does not support - * light status bar icons. - */ - private boolean shouldDarkenStatusBarColor() { - return (Build.VERSION.SDK_INT < Build.VERSION_CODES.M); - } - - /** * @return Whether or not the current tab is a new tab page in standard mode. */ private boolean isStandardNTP() {
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/ui/system/StatusBarColorControllerTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/ui/system/StatusBarColorControllerTest.java index 632ccc7..dc2e262 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/ui/system/StatusBarColorControllerTest.java +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/ui/system/StatusBarColorControllerTest.java
@@ -8,7 +8,6 @@ import android.app.Activity; import android.graphics.Color; -import android.os.Build; import androidx.annotation.ColorInt; import androidx.test.filters.LargeTest; @@ -100,10 +99,10 @@ @Restriction({UiRestriction.RESTRICTION_TYPE_PHONE}) // Status bar is always black on tablets public void testColorToggleIncognitoInOverview() throws Exception { ChromeTabbedActivity activity = sActivityTestRule.getActivity(); - final int expectedOverviewStandardColor = defaultColorFallbackToBlack( - ChromeColors.getPrimaryBackgroundColor(activity, false)); + final int expectedOverviewStandardColor = + ChromeColors.getPrimaryBackgroundColor(activity, false); final int expectedOverviewIncognitoColor = - defaultColorFallbackToBlack(ChromeColors.getPrimaryBackgroundColor(activity, true)); + ChromeColors.getPrimaryBackgroundColor(activity, true); sActivityTestRule.loadUrlInNewTab( "about:blank", true /* incognito */, TabLaunchType.FROM_CHROME_UI); @@ -129,8 +128,7 @@ @Restriction({UiRestriction.RESTRICTION_TYPE_PHONE}) // Status bar is always black on tablets public void testBrandColorIgnoredInOverview() throws Exception { ChromeTabbedActivity activity = sActivityTestRule.getActivity(); - final int expectedDefaultStandardColor = - defaultColorFallbackToBlack(ChromeColors.getDefaultThemeColor(activity, false)); + final int expectedDefaultStandardColor = ChromeColors.getDefaultThemeColor(activity, false); String pageWithBrandColorUrl = sActivityTestRule.getTestServer().getURL( "/chrome/test/data/android/theme_color_test.html"); @@ -170,14 +168,7 @@ TestThreadUtils.runOnUiThreadBlocking( () -> statusBarColorController.onStatusIndicatorColorChanged(Color.BLUE)); - if (Build.VERSION.SDK_INT < Build.VERSION_CODES.M) { - Assert.assertEquals("Wrong status bar color for Android L.", - ColorUtils.getDarkenedColorForStatusBar(Color.BLUE), - statusBarColor.get().intValue()); - } else { - Assert.assertEquals("Wrong status bar color for Android M+.", Color.BLUE, - statusBarColor.get().intValue()); - } + Assert.assertEquals("Wrong status bar color.", Color.BLUE, statusBarColor.get().intValue()); // StatusBarColorController#getStatusBarColorWithoutStatusIndicator should still return the // initial color. @@ -188,16 +179,9 @@ TestThreadUtils.runOnUiThreadBlocking( () -> statusBarColorController.setStatusBarScrimFraction(.5f)); - if (Build.VERSION.SDK_INT < Build.VERSION_CODES.M) { - // If we're already darkening the color for Android L, scrim shouldn't be applied. - Assert.assertEquals("Wrong status bar color w/ scrim for Android L.", - ColorUtils.getDarkenedColorForStatusBar(Color.BLUE), - statusBarColor.get().intValue()); - } else { - // Otherwise, the resulting color should be a scrimmed version of the status bar color. - Assert.assertEquals("Wrong status bar color w/ scrim for Android M+.", - getScrimmedColor(Color.BLUE, .5f), statusBarColor.get().intValue()); - } + // The resulting color should be a scrimmed version of the status bar color. + Assert.assertEquals("Wrong status bar color w/ scrim.", getScrimmedColor(Color.BLUE, .5f), + statusBarColor.get().intValue()); TestThreadUtils.runOnUiThreadBlocking(() -> { // Remove scrim. @@ -221,8 +205,7 @@ @Restriction({UiRestriction.RESTRICTION_TYPE_PHONE}) // Status bar is always black on tablets public void testBrandColorIgnoredWhenOmniboxIsFocused() throws Exception { ChromeTabbedActivity activity = sActivityTestRule.getActivity(); - final int expectedDefaultStandardColor = - defaultColorFallbackToBlack(ChromeColors.getDefaultThemeColor(activity, false)); + final int expectedDefaultStandardColor = ChromeColors.getDefaultThemeColor(activity, false); String pageWithBrandColorUrl = sActivityTestRule.getTestServer().getURL( "/chrome/test/data/android/theme_color_test.html"); @@ -248,8 +231,7 @@ public void testBrandColorIgnoredWhenOmniboxIsFocused_FeatureMatchToolbarColorEnabled() throws Exception { ChromeTabbedActivity activity = sActivityTestRule.getActivity(); - final int expectedDefaultStandardColor = - defaultColorFallbackToBlack(ChromeColors.getDefaultThemeColor(activity, false)); + final int expectedDefaultStandardColor = ChromeColors.getDefaultThemeColor(activity, false); String pageWithBrandColorUrl = sActivityTestRule.getTestServer().getURL( "/chrome/test/data/android/theme_color_test.html"); @@ -379,10 +361,6 @@ activity.getWindow().getStatusBarColor()); } - private int defaultColorFallbackToBlack(int color) { - return (Build.VERSION.SDK_INT < Build.VERSION_CODES.M) ? Color.BLACK : color; - } - private int getScrimmedColor(@ColorInt int color, float fraction) { final float scrimColorAlpha = (mScrimColor >>> 24) / 255f; final int scrimColorOpaque = mScrimColor & 0xFF000000; @@ -391,12 +369,9 @@ private void waitForStatusBarColor(Activity activity, int expectedColor) throws ExecutionException, TimeoutException { - final int actualExpectedColor = Build.VERSION.SDK_INT < Build.VERSION_CODES.M - ? ColorUtils.getDarkenedColorForStatusBar(expectedColor) - : expectedColor; CriteriaHelper.pollUiThread(() -> { Criteria.checkThat( - activity.getWindow().getStatusBarColor(), Matchers.is(actualExpectedColor)); + activity.getWindow().getStatusBarColor(), Matchers.is(expectedColor)); }, CriteriaHelper.DEFAULT_MAX_TIME_TO_POLL, CriteriaHelper.DEFAULT_POLLING_INTERVAL); }
diff --git a/chrome/app/os_settings_strings.grdp b/chrome/app/os_settings_strings.grdp index 1a387f9..8744a2f 100644 --- a/chrome/app/os_settings_strings.grdp +++ b/chrome/app/os_settings_strings.grdp
@@ -2800,6 +2800,12 @@ <message name="IDS_SETTINGS_INTERNET_VPN_DETAILS" desc="Name of the settings page which displays details about a VPN connection."> VPN details </message> + <message name="IDS_SETTINGS_INTERNET_HOTSPOT_DETAILS" desc="Name of the settings page which displays details about Hotspot."> + Hotspot details + </message> + <message name="IDS_SETTINGS_INTERNET_HOTSPOT_SUBTITLE_WITH_LEARN_MORE_LINK" desc="Subtitle of the hotspot subpage which explains how hotspot may affect your Chromebook."> + Uses your Chromebook’s mobile data and your carrier may charge additional fees. May increase battery usage. <ph name="BEGIN_LINK_LEARN_MORE"><a target="_blank" href="$1"></ph>Learn more<ph name="END_LINK_LEARN_MORE"></a></ph> + </message> <message name="IDS_SETTINGS_INTERNET_WIFI_NETWORKS" desc="Name of the settings page which displays a list of Wi-Fi networks which the user can choose to connect to."> Wi-Fi networks </message>
diff --git a/chrome/app/os_settings_strings_grdp/IDS_SETTINGS_INTERNET_HOTSPOT_DETAILS.png.sha1 b/chrome/app/os_settings_strings_grdp/IDS_SETTINGS_INTERNET_HOTSPOT_DETAILS.png.sha1 new file mode 100644 index 0000000..78ce09c --- /dev/null +++ b/chrome/app/os_settings_strings_grdp/IDS_SETTINGS_INTERNET_HOTSPOT_DETAILS.png.sha1
@@ -0,0 +1 @@ +1b9547e66f9c59d176c1f6f89b811a78850ca241 \ No newline at end of file
diff --git a/chrome/app/os_settings_strings_grdp/IDS_SETTINGS_INTERNET_HOTSPOT_SUBTITLE_WITH_LEARN_MORE_LINK.png.sha1 b/chrome/app/os_settings_strings_grdp/IDS_SETTINGS_INTERNET_HOTSPOT_SUBTITLE_WITH_LEARN_MORE_LINK.png.sha1 new file mode 100644 index 0000000..d9ef9f0 --- /dev/null +++ b/chrome/app/os_settings_strings_grdp/IDS_SETTINGS_INTERNET_HOTSPOT_SUBTITLE_WITH_LEARN_MORE_LINK.png.sha1
@@ -0,0 +1 @@ +387d4984bd173a7996ac7f9dd149657ceca446ad \ No newline at end of file
diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc index c3a23dd..6cc3f8d4 100644 --- a/chrome/browser/about_flags.cc +++ b/chrome/browser/about_flags.cc
@@ -1625,6 +1625,22 @@ kTabScrollingWithDraggingWithVariableSpeed, std::size(kTabScrollingWithDraggingWithVariableSpeed), nullptr}}; +const FeatureEntry::FeatureParam kScrollableTabStripOverflowDivider[] = { + {features::kScrollableTabStripOverflowModeName, "1"}}; +const FeatureEntry::FeatureParam kScrollableTabStripOverflowFade[] = { + {features::kScrollableTabStripOverflowModeName, "2"}}; +const FeatureEntry::FeatureParam kScrollableTabStripOverflowShadow[] = { + {features::kScrollableTabStripOverflowModeName, "3"}}; + +const FeatureEntry::FeatureVariation kScrollableTabStripOverflowVariations[] = { + {" - Divider", kScrollableTabStripOverflowDivider, + std::size(kScrollableTabStripOverflowDivider), nullptr}, // Divider + {" - Fade", kScrollableTabStripOverflowFade, + std::size(kScrollableTabStripOverflowFade), nullptr}, // Fade + {" - Shadow", kScrollableTabStripOverflowShadow, + std::size(kScrollableTabStripOverflowShadow), nullptr}, // Shadow +}; + const FeatureEntry::FeatureParam kTabSearchSearchThresholdSmall[] = { {features::kTabSearchSearchThresholdName, "0.3"}}; const FeatureEntry::FeatureParam kTabSearchSearchThresholdMedium[] = { @@ -4623,6 +4639,20 @@ kOsDesktop, FEATURE_VALUE_TYPE(features::kPreinstalledWebAppDuplicationFixer)}, + {"cast-streaming-hardware-h264", + flag_descriptions::kCastStreamingHardwareH264Name, + flag_descriptions::kCastStreamingHardwareH264Description, kOsDesktop, + ENABLE_DISABLE_VALUE_TYPE( + switches::kCastStreamingForceEnableHardwareH264, + switches::kCastStreamingForceDisableHardwareH264)}, + + {"cast-streaming-hardware-vp8", + flag_descriptions::kCastStreamingHardwareVp8Name, + flag_descriptions::kCastStreamingHardwareVp8Description, kOsDesktop, + ENABLE_DISABLE_VALUE_TYPE( + switches::kCastStreamingForceEnableHardwareVp8, + switches::kCastStreamingForceDisableHardwareVp8)}, + {"enable-openscreen-cast-streaming-session", flag_descriptions::kOpenscreenCastStreamingSessionName, flag_descriptions::kOpenscreenCastStreamingSessionDescription, kOsDesktop, @@ -4630,11 +4660,11 @@ {"enable-cast-streaming-av1", flag_descriptions::kCastStreamingAv1Name, flag_descriptions::kCastStreamingAv1Description, kOsDesktop, - FEATURE_VALUE_TYPE(mirroring::features::kCastStreamingAv1)}, + FEATURE_VALUE_TYPE(media::kCastStreamingAv1)}, {"enable-cast-streaming-vp9", flag_descriptions::kCastStreamingVp9Name, flag_descriptions::kCastStreamingVp9Description, kOsDesktop, - FEATURE_VALUE_TYPE(mirroring::features::kCastStreamingVp9)}, + FEATURE_VALUE_TYPE(media::kCastStreamingVp9)}, #endif // !BUILDFLAG(IS_ANDROID) @@ -5931,6 +5961,13 @@ kTabScrollingWithDraggingVariations, "TabScrollingWithDragging")}, + {flag_descriptions::kScrollableTabStripOverflowFlagId, + flag_descriptions::kScrollableTabStripOverflowName, + flag_descriptions::kScrollableTabStripOverflowDescription, kOsDesktop, + FEATURE_WITH_PARAMS_VALUE_TYPE(features::kScrollableTabStripOverflow, + kScrollableTabStripOverflowVariations, + "ScrollableTabStripOverflow")}, + {"split-tabstrip", flag_descriptions::kSplitTabStripName, flag_descriptions::kSplitTabStripDescription, kOsDesktop, FEATURE_VALUE_TYPE(features::kSplitTabStrip)},
diff --git a/chrome/browser/accessibility/accessibility_extension_api_chromeos.cc b/chrome/browser/accessibility/accessibility_extension_api_chromeos.cc index 7dcd470f..41fa021 100644 --- a/chrome/browser/accessibility/accessibility_extension_api_chromeos.cc +++ b/chrome/browser/accessibility/accessibility_extension_api_chromeos.cc
@@ -152,7 +152,7 @@ dlc, base::BindOnce( &AccessibilityPrivateGetDlcContentsFunction::OnDlcContentsRetrieved, - base::RetainedRef(this))); + this)); return RespondLater(); } @@ -229,7 +229,7 @@ AccessibilityManager::Get()->InstallPumpkinForDictation( base::BindOnce(&AccessibilityPrivateInstallPumpkinForDictationFunction:: OnPumpkinInstallFinished, - base::RetainedRef(this))); + this)); return RespondLater(); } @@ -775,13 +775,13 @@ title, description, base::BindOnce( &AccessibilityPrivateShowConfirmationDialogFunction::OnDialogResult, - base::RetainedRef(this), /* confirmed */ true), + this, /* confirmed */ true), base::BindOnce( &AccessibilityPrivateShowConfirmationDialogFunction::OnDialogResult, - base::RetainedRef(this), /* not confirmed */ false), + this, /* not confirmed */ false), base::BindOnce( &AccessibilityPrivateShowConfirmationDialogFunction::OnDialogResult, - base::RetainedRef(this), /* not confirmed */ false)); + this, /* not confirmed */ false)); return RespondLater(); }
diff --git a/chrome/browser/apps/app_preload_service/app_preload_server_connector.cc b/chrome/browser/apps/app_preload_service/app_preload_server_connector.cc index 4d726050..e90fe41b 100644 --- a/chrome/browser/apps/app_preload_service/app_preload_server_connector.cc +++ b/chrome/browser/apps/app_preload_service/app_preload_server_connector.cc
@@ -5,7 +5,6 @@ #include "chrome/browser/apps/app_preload_service/app_preload_server_connector.h" #include "base/callback.h" -#include "base/json/json_writer.h" #include "base/strings/strcat.h" #include "base/values.h" #include "chrome/browser/apps/app_preload_service/almanac_api_util.h" @@ -64,22 +63,20 @@ } std::string BuildGetAppsForFirstLoginRequestBody(const apps::DeviceInfo& info) { - base::Value::Dict request; - request.Set("board", info.board); - request.Set("model", info.model); - request.Set("language", info.locale); - request.Set("user_type", ConvertStringUserTypeToProto(info.user_type)); + apps::proto::AppProvisioningRequest request_proto; + request_proto.set_board(info.board); + request_proto.set_model(info.model); + request_proto.set_language(info.locale); + request_proto.set_user_type(ConvertStringUserTypeToProto(info.user_type)); // TODO(b/258566986): Load the device's real SKU ID. - request.Set("sku_id", "unknown"); + request_proto.set_sku_id("unknown"); - base::Value::Dict versions; - versions.Set("ash_chrome", info.version_info.ash_chrome); - versions.Set("platform", info.version_info.platform); - request.Set("chrome_os_version", std::move(versions)); + request_proto.mutable_chrome_os_version()->set_ash_chrome( + info.version_info.ash_chrome); + request_proto.mutable_chrome_os_version()->set_platform( + info.version_info.platform); - std::string request_body; - base::JSONWriter::Write(request, &request_body); - return request_body; + return request_proto.SerializeAsString(); } } // namespace @@ -110,7 +107,8 @@ loader_ = network::SimpleURLLoader::Create(std::move(resource_request), kTrafficAnnotation); loader_->AttachStringForUpload( - BuildGetAppsForFirstLoginRequestBody(device_info), "application/json"); + BuildGetAppsForFirstLoginRequestBody(device_info), + "application/x-protobuf"); loader_->DownloadToString( url_loader_factory.get(), base::BindOnce(&AppPreloadServerConnector::OnGetAppsForFirstLoginResponse,
diff --git a/chrome/browser/apps/app_preload_service/app_preload_server_connector_unittest.cc b/chrome/browser/apps/app_preload_service/app_preload_server_connector_unittest.cc index 5846cb7..e9dda23b 100644 --- a/chrome/browser/apps/app_preload_service/app_preload_server_connector_unittest.cc +++ b/chrome/browser/apps/app_preload_service/app_preload_server_connector_unittest.cc
@@ -6,7 +6,6 @@ #include "base/functional/bind.h" #include "base/functional/callback_forward.h" -#include "base/json/json_reader.h" #include "base/memory/scoped_refptr.h" #include "base/test/bind.h" #include "base/test/test_future.h" @@ -73,22 +72,18 @@ EXPECT_EQ(method, "POST"); EXPECT_EQ(method_override_header, "GET"); - EXPECT_EQ(content_type, "application/json"); + EXPECT_EQ(content_type, "application/x-protobuf"); - absl::optional<base::Value> request = base::JSONReader::Read(body); - ASSERT_TRUE(request.has_value() && request->is_dict()); + proto::AppProvisioningRequest request; + ASSERT_TRUE(request.ParseFromString(body)); - base::Value::Dict& request_dict = request->GetDict(); - EXPECT_EQ(*request_dict.FindString("board"), "brya"); - EXPECT_EQ(*request_dict.FindString("language"), "en-US"); - EXPECT_EQ(*request_dict.FindString("model"), "taniks"); - EXPECT_EQ(*request_dict.FindInt("user_type"), + EXPECT_EQ(request.board(), "brya"); + EXPECT_EQ(request.language(), "en-US"); + EXPECT_EQ(request.model(), "taniks"); + EXPECT_EQ(request.user_type(), apps::proto::AppProvisioningRequest::USERTYPE_UNMANAGED); - EXPECT_EQ( - *request_dict.FindDict("chrome_os_version")->FindString("ash_chrome"), - "10.10.10"); - EXPECT_EQ(*request_dict.FindDict("chrome_os_version")->FindString("platform"), - "12345.0.0"); + EXPECT_EQ(request.chrome_os_version().ash_chrome(), "10.10.10"); + EXPECT_EQ(request.chrome_os_version().platform(), "12345.0.0"); } TEST_F(AppPreloadServerConnectorTest, GetAppsForFirstLoginSuccessfulResponse) {
diff --git a/chrome/browser/apps/app_service/app_service_proxy_ash.cc b/chrome/browser/apps/app_service/app_service_proxy_ash.cc index 2a364aa9..5529ed8 100644 --- a/chrome/browser/apps/app_service/app_service_proxy_ash.cc +++ b/chrome/browser/apps/app_service/app_service_proxy_ash.cc
@@ -9,6 +9,7 @@ #include "base/bind.h" #include "base/callback_helpers.h" #include "base/threading/thread_task_runner_handle.h" +#include "chrome/browser/apps/app_service/app_icon/app_icon_factory.h" #include "chrome/browser/apps/app_service/app_icon/app_icon_util.h" #include "chrome/browser/apps/app_service/browser_app_instance_registry.h" #include "chrome/browser/apps/app_service/browser_app_instance_tracker.h" @@ -26,7 +27,6 @@ #include "chrome/browser/chromeos/policy/dlp/dlp_rules_manager_factory.h" #include "chrome/browser/profiles/profile.h" #include "chrome/browser/supervised_user/grit/supervised_user_unscaled_resources.h" -#include "chrome/browser/web_applications/app_service/web_apps.h" #include "chrome/browser/web_applications/web_app_utils.h" #include "components/account_id/account_id.h" #include "components/app_constants/constants.h"
diff --git a/chrome/browser/ash/BUILD.gn b/chrome/browser/ash/BUILD.gn index 7757704..c7361124 100644 --- a/chrome/browser/ash/BUILD.gn +++ b/chrome/browser/ash/BUILD.gn
@@ -3280,6 +3280,7 @@ "//components/autofill/core/browser", "//components/captive_portal/core", "//components/content_settings/core/browser", + "//components/desks_storage", "//components/download/content/public", "//components/download/public/background_service:public", "//components/drive",
diff --git a/chrome/browser/ash/accessibility/accessibility_manager_browsertest.cc b/chrome/browser/ash/accessibility/accessibility_manager_browsertest.cc index dd9c24e..7bc78ddd 100644 --- a/chrome/browser/ash/accessibility/accessibility_manager_browsertest.cc +++ b/chrome/browser/ash/accessibility/accessibility_manager_browsertest.cc
@@ -279,9 +279,9 @@ bool IsBrailleImeEnabled() { InputMethodManager* imm = InputMethodManager::Get(); - std::unique_ptr<InputMethodDescriptors> descriptors = + InputMethodDescriptors descriptors = imm->GetActiveIMEState()->GetEnabledInputMethods(); - for (const auto& descriptor : *descriptors) { + for (const auto& descriptor : descriptors) { if (descriptor.id() == extension_ime_util::kBrailleImeEngineId) return true; }
diff --git a/chrome/browser/ash/app_mode/web_app/web_kiosk_app_service_launcher_unittest.cc b/chrome/browser/ash/app_mode/web_app/web_kiosk_app_service_launcher_unittest.cc index 2b7317e..24653b8 100644 --- a/chrome/browser/ash/app_mode/web_app/web_kiosk_app_service_launcher_unittest.cc +++ b/chrome/browser/ash/app_mode/web_app/web_kiosk_app_service_launcher_unittest.cc
@@ -19,7 +19,6 @@ #include "chrome/browser/apps/app_service/app_service_test.h" #include "chrome/browser/ash/app_mode/web_app/web_kiosk_app_data.h" #include "chrome/browser/ash/app_mode/web_app/web_kiosk_app_manager.h" -#include "chrome/browser/ash/system_web_apps/system_web_app_manager.h" #include "chrome/browser/ui/web_applications/web_app_launch_manager.h" #include "chrome/browser/web_applications/external_install_options.h" #include "chrome/browser/web_applications/externally_managed_app_manager.h" @@ -37,6 +36,7 @@ #include "chrome/browser/web_applications/web_app_ui_manager.h" #include "chrome/test/base/browser_with_test_window_test.h" #include "chrome/test/base/testing_profile.h" +#include "chromeos/login/login_state/login_state.h" #include "components/services/app_service/public/cpp/app_types.h" #include "components/services/app_service/public/cpp/instance.h" #include "components/webapps/browser/install_result_code.h" @@ -91,6 +91,11 @@ public: void SetUp() override { BrowserWithTestWindowTest::SetUp(); + + chromeos::LoginState::Get()->SetLoggedInState( + chromeos::LoginState::LOGGED_IN_ACTIVE, + chromeos::LoginState::LOGGED_IN_USER_KIOSK); + app_service_test_.UninstallAllApps(profile()); app_service_test_.SetUp(profile()); app_service_ = apps::AppServiceProxyFactory::GetForProfile(profile()); @@ -241,10 +246,6 @@ return web_app_provider()->ui_manager(); } - SystemWebAppManager* system_web_app_manager() { - return SystemWebAppManager::GetForTest(profile()); - } - web_app::FakeExternallyManagedAppManager& externally_managed_app_manager() { return static_cast<web_app::FakeExternallyManagedAppManager&>( web_app_provider()->externally_managed_app_manager());
diff --git a/chrome/browser/ash/arc/session/arc_activation_necessity_checker.cc b/chrome/browser/ash/arc/session/arc_activation_necessity_checker.cc index 86ab554..7984a9d6 100644 --- a/chrome/browser/ash/arc/session/arc_activation_necessity_checker.cc +++ b/chrome/browser/ash/arc/session/arc_activation_necessity_checker.cc
@@ -7,11 +7,13 @@ #include <utility> #include "ash/components/arc/arc_features.h" +#include "ash/components/arc/arc_prefs.h" #include "ash/components/arc/arc_util.h" #include "ash/components/arc/session/adb_sideloading_availability_delegate.h" #include "chrome/browser/ash/arc/policy/arc_policy_util.h" #include "chrome/browser/profiles/profile.h" #include "chrome/browser/ui/app_list/arc/arc_app_list_prefs.h" +#include "components/prefs/pref_service.h" namespace arc { @@ -45,6 +47,12 @@ return; } + // Activate ARC if the package list held by ArcAppListPrefs is not up to date. + if (!profile_->GetPrefs()->GetBoolean(arc::prefs::kArcPackagesIsUpToDate)) { + std::move(callback).Run(true); + return; + } + // Activate ARC if there is an app which was not pre-installed. ArcAppListPrefs* app_list = ArcAppListPrefs::Get(profile_); DCHECK(app_list);
diff --git a/chrome/browser/ash/arc/session/arc_activation_necessity_checker_unittest.cc b/chrome/browser/ash/arc/session/arc_activation_necessity_checker_unittest.cc index ea56f37..044b7691 100644 --- a/chrome/browser/ash/arc/session/arc_activation_necessity_checker_unittest.cc +++ b/chrome/browser/ash/arc/session/arc_activation_necessity_checker_unittest.cc
@@ -71,6 +71,7 @@ profile_ = profile_builder.Build(); profile_->GetProfilePolicyConnector()->OverrideIsManagedForTesting(true); profile_->GetPrefs()->SetBoolean(prefs::kArcEnabled, true); + profile_->GetPrefs()->SetBoolean(prefs::kArcPackagesIsUpToDate, true); const AccountId account_id(AccountId::FromUserEmailGaiaId( profile_->GetProfileUserName(), "1234567890")); @@ -151,6 +152,14 @@ EXPECT_TRUE(future.Get()); } +TEST_F(ArcActivationNecessityCheckerTest, PacakgeListIsNotUpToDate) { + profile_->GetPrefs()->SetBoolean(prefs::kArcPackagesIsUpToDate, false); + + base::test::TestFuture<bool> future; + checker_->Check(future.GetCallback()); + EXPECT_TRUE(future.Get()); +} + TEST_F(ArcActivationNecessityCheckerTest, AppIsInstalled) { auto package_info = mojom::ArcPackageInfo::New(); package_info->package_name = "com.example.third_party_app";
diff --git a/chrome/browser/ash/arc/session/arc_session_manager_unittest.cc b/chrome/browser/ash/arc/session/arc_session_manager_unittest.cc index 64bde60..ecd4592 100644 --- a/chrome/browser/ash/arc/session/arc_session_manager_unittest.cc +++ b/chrome/browser/ash/arc/session/arc_session_manager_unittest.cc
@@ -473,6 +473,7 @@ PrefService* const prefs = profile()->GetPrefs(); prefs->SetBoolean(prefs::kArcTermsAccepted, true); prefs->SetBoolean(prefs::kArcSignedIn, true); + prefs->SetBoolean(prefs::kArcPackagesIsUpToDate, true); arc_session_manager()->SetProfile(profile()); arc_session_manager()->Initialize();
diff --git a/chrome/browser/ash/extensions/input_method_api.cc b/chrome/browser/ash/extensions/input_method_api.cc index 8963aff..208e79b6 100644 --- a/chrome/browser/ash/extensions/input_method_api.cc +++ b/chrome/browser/ash/extensions/input_method_api.cc
@@ -166,11 +166,11 @@ ash::input_method::InputMethodUtil* util = manager->GetInputMethodUtil(); scoped_refptr<ash::input_method::InputMethodManager::State> ime_state = manager->GetActiveIMEState(); - std::unique_ptr<ash::input_method::InputMethodDescriptors> input_methods = + ash::input_method::InputMethodDescriptors input_methods = ime_state->GetEnabledInputMethodsSortedByLocalizedDisplayNames(); - for (size_t i = 0; i < input_methods->size(); ++i) { + for (size_t i = 0; i < input_methods.size(); ++i) { const ash::input_method::InputMethodDescriptor& input_method = - (*input_methods)[i]; + input_methods[i]; base::Value::Dict val; val.Set("id", input_method.id()); val.Set("name", util->GetInputMethodLongName(input_method));
diff --git a/chrome/browser/ash/extensions/speech/speech_recognition_private_api.cc b/chrome/browser/ash/extensions/speech/speech_recognition_private_api.cc index a3886e7..496c8ff 100644 --- a/chrome/browser/ash/extensions/speech/speech_recognition_private_api.cc +++ b/chrome/browser/ash/extensions/speech/speech_recognition_private_api.cc
@@ -38,8 +38,7 @@ const std::string key = manager->CreateKey(extension_id(), client_id); manager->HandleStart( key, locale, interim_results, - base::BindOnce(&SpeechRecognitionPrivateStartFunction::OnStart, - base::RetainedRef(this))); + base::BindOnce(&SpeechRecognitionPrivateStartFunction::OnStart, this)); return RespondLater(); } @@ -72,8 +71,7 @@ SpeechRecognitionPrivateManager::Get(browser_context()); const std::string key = manager->CreateKey(extension_id(), client_id); manager->HandleStop( - key, base::BindOnce(&SpeechRecognitionPrivateStopFunction::OnStop, - base::RetainedRef(this))); + key, base::BindOnce(&SpeechRecognitionPrivateStopFunction::OnStop, this)); return RespondLater(); }
diff --git a/chrome/browser/ash/file_manager/file_tasks.cc b/chrome/browser/ash/file_manager/file_tasks.cc index ce76fbb..57b79e8 100644 --- a/chrome/browser/ash/file_manager/file_tasks.cc +++ b/chrome/browser/ash/file_manager/file_tasks.cc
@@ -478,8 +478,7 @@ // TODO(b/247038054) Add user preference to decide whether or not the // dialog should be shown. return ash::cloud_upload::UploadAndOpen( - profile, file_urls, - ash::cloud_upload::mojom::CloudProvider::kGoogleDrive, + profile, file_urls, ash::cloud_upload::CloudProvider::kGoogleDrive, /*show_dialog=*/false); } } else { @@ -576,8 +575,7 @@ // dialog should be shown. LOG(ERROR) << "File can be moved to ODFS"; return ash::cloud_upload::UploadAndOpen( - profile, file_urls, - ash::cloud_upload::mojom::CloudProvider::kOneDrive, + profile, file_urls, ash::cloud_upload::CloudProvider::kOneDrive, /*show_dialog=*/false); } } else { @@ -1217,4 +1215,42 @@ return false; } +namespace { + +std::string ToSwaActionId(const std::string& action_id) { + return std::string(ash::file_manager::kChromeUIFileManagerURL) + "?" + + action_id; +} + +} // namespace + +void SetWordFileHandler(Profile* profile, const std::string& action_id) { + TaskDescriptor task(kFileManagerSwaAppId, TaskType::TASK_TYPE_WEB_APP, + ToSwaActionId(action_id)); + UpdateDefaultTask( + profile, task, {".doc", ".docx"}, + {"application/msword", + "application/" + "vnd.openxmlformats-officedocument.wordprocessingml.document"}); +} + +void SetExcelFileHandler(Profile* profile, const std::string& action_id) { + TaskDescriptor task(kFileManagerSwaAppId, TaskType::TASK_TYPE_WEB_APP, + ToSwaActionId(action_id)); + UpdateDefaultTask( + profile, task, {".xls", ".xlsx"}, + {"application/vnd.ms-excel", + "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"}); +} + +void SetPowerPointFileHandler(Profile* profile, const std::string& action_id) { + TaskDescriptor task(kFileManagerSwaAppId, TaskType::TASK_TYPE_WEB_APP, + ToSwaActionId(action_id)); + UpdateDefaultTask( + profile, task, {".ppt", ".pptx"}, + {"application/vnd.ms-powerpoint", + "application/" + "vnd.openxmlformats-officedocument.presentationml.presentation"}); +} + } // namespace file_manager::file_tasks
diff --git a/chrome/browser/ash/file_manager/file_tasks.h b/chrome/browser/ash/file_manager/file_tasks.h index e29c3df..5774cda 100644 --- a/chrome/browser/ash/file_manager/file_tasks.h +++ b/chrome/browser/ash/file_manager/file_tasks.h
@@ -373,6 +373,13 @@ // Returns whether |path| is a MS Office file according to its extension. bool IsOfficeFile(const base::FilePath& path); +// TODO(petermarshall): Move these to a new file office_file_tasks.cc/h +// Updates the default task for each of the office file types. |action_id| must +// be a valid action registered with the Files app SWA. +void SetWordFileHandler(Profile* profile, const std::string& action_id); +void SetExcelFileHandler(Profile* profile, const std::string& action_id); +void SetPowerPointFileHandler(Profile* profile, const std::string& action_id); + } // namespace file_manager::file_tasks #endif // CHROME_BROWSER_ASH_FILE_MANAGER_FILE_TASKS_H_
diff --git a/chrome/browser/ash/first_run/first_run.cc b/chrome/browser/ash/first_run/first_run.cc index 061ec92..6398914 100644 --- a/chrome/browser/ash/first_run/first_run.cc +++ b/chrome/browser/ash/first_run/first_run.cc
@@ -82,6 +82,7 @@ // App launcher owns itself and will be deleted when the app is launched or // the profile is destroyed. static void LaunchHelpAfterSWALoad(Profile* profile) { + DCHECK(ShouldLaunchHelpApp(profile)); new AppLauncher(profile); } // ProfileObserver: @@ -133,6 +134,9 @@ if (WizardController::default_controller()) WizardController::default_controller()->PrepareFirstRunPrefs(); + if (!SystemWebAppManager::Get(profile)) + return false; + if (!IsRegularUserOrSupervisedChild(user_manager)) return false;
diff --git a/chrome/browser/ash/floating_workspace/floating_workspace_service.cc b/chrome/browser/ash/floating_workspace/floating_workspace_service.cc index c48128831..76fcfd5 100644 --- a/chrome/browser/ash/floating_workspace/floating_workspace_service.cc +++ b/chrome/browser/ash/floating_workspace/floating_workspace_service.cc
@@ -7,17 +7,23 @@ #include <cstddef> #include <vector> -#include "base/bind.h" +#include "ash/constants/ash_features.h" +#include "ash/public/cpp/desk_template.h" +#include "ash/wm/desks/templates/saved_desk_util.h" #include "base/check.h" +#include "base/check_is_test.h" #include "base/threading/thread_task_runner_handle.h" #include "base/time/time.h" #include "chrome/browser/ash/floating_workspace/floating_workspace_service_factory.h" +#include "chrome/browser/ash/floating_workspace/floating_workspace_util.h" #include "chrome/browser/ash/login/session/user_session_manager.h" #include "chrome/browser/profiles/profile.h" #include "chrome/browser/sessions/session_restore.h" +#include "chrome/browser/sync/desk_sync_service_factory.h" #include "chrome/browser/sync/session_sync_service_factory.h" #include "chrome/browser/sync/sync_service_factory.h" -#include "components/sync/driver/sync_service.h" +#include "chrome/browser/ui/ash/desks/desks_client.h" +#include "components/desks_storage/core/desk_sync_bridge.h" #include "components/sync_sessions/open_tabs_ui_delegate.h" #include "components/sync_sessions/session_sync_service.h" #include "components/sync_sessions/synced_session.h" @@ -26,11 +32,11 @@ // Max time floating workspace service can wait after user login. // After that even a more recent foreign session change is detected -// restore will not take place +// restore will not take place. constexpr base::TimeDelta kMaxTimeAvaliableForRestoreAfterLogin = base::Seconds(3); -// static +// Static FloatingWorkspaceService* FloatingWorkspaceService::GetForProfile( Profile* profile) { return static_cast<FloatingWorkspaceService*>( @@ -38,12 +44,42 @@ } FloatingWorkspaceService::FloatingWorkspaceService(Profile* profile) - : profile_(profile), - session_sync_service_( - SessionSyncServiceFactory::GetInstance()->GetForProfile(profile)), - initialized_timestamp_(base::Time::Now()) {} + : profile_(profile), initialization_timestamp_(base::TimeTicks::Now()) {} -FloatingWorkspaceService::~FloatingWorkspaceService() = default; +FloatingWorkspaceService::~FloatingWorkspaceService() { + if (floating_workspace_util::IsFloatingWorkspaceV2Enabled()) { + StopCaptureAndUploadActiveDesk(); + OnDeskModelDestroying(); + } +} + +void FloatingWorkspaceService::Init() { + if (floating_workspace_util::IsFloatingWorkspaceV1Enabled()) { + InitForV1(); + return; + } + + if (saved_desk_util::AreDesksTemplatesEnabled() && + chromeos::features::IsDeskTemplateSyncEnabled() && + floating_workspace_util::IsFloatingWorkspaceV2Enabled()) { + InitForV2(); + } +} + +void FloatingWorkspaceService::InitForTest( + TestFloatingWorkspaceVersion version) { + CHECK_IS_TEST(); + switch (version) { + case TestFloatingWorkspaceVersion::kNoVersionEnabled: + break; + case TestFloatingWorkspaceVersion::kFloatingWorkspaceV1Enabled: + InitForV1(); + break; + case TestFloatingWorkspaceVersion::kFloatingWorkspaceV2Enabled: + InitForV2(); + break; + } +} void FloatingWorkspaceService::SubscribeToForeignSessionUpdates() { syncer::SyncService* sync_service = @@ -64,8 +100,8 @@ RestoreBrowserWindowsFromMostRecentlyUsedDevice() { if (!should_run_restore_) return; - if (base::Time::Now() > - initialized_timestamp_ + kMaxTimeAvaliableForRestoreAfterLogin) { + if (base::TimeTicks::Now() > + initialization_timestamp_ + kMaxTimeAvaliableForRestoreAfterLogin) { // No need to restore any remote session 3 seconds (TBD) after login. should_run_restore_ = false; return; @@ -116,6 +152,25 @@ } } +void FloatingWorkspaceService::OnDeskModelDestroying() { + desk_sync_service_->GetDeskModel()->RemoveObserver(this); +} + +void FloatingWorkspaceService::InitForV1() { + session_sync_service_ = + SessionSyncServiceFactory::GetInstance()->GetForProfile(profile_); +} + +void FloatingWorkspaceService::InitForV2() { + desk_sync_service_ = DeskSyncServiceFactory::GetForProfile(profile_); + StartCaptureAndUploadActiveDesk(); + desk_sync_service_->GetDeskModel()->AddObserver(this); + syncer::SyncService* sync_service( + SyncServiceFactory::GetForProfile(profile_)); + if (sync_service) + sync_service->TriggerRefresh({syncer::WORKSPACE_DESK}); +} + const sync_sessions::SyncedSession* FloatingWorkspaceService::GetMostRecentlyUsedRemoteSession() { sync_sessions::OpenTabsUIDelegate* open_tabs = GetOpenTabsUIDelegate(); @@ -159,4 +214,99 @@ DCHECK(session_sync_service_); return session_sync_service_->GetOpenTabsUIDelegate(); } + +void FloatingWorkspaceService::StartCaptureAndUploadActiveDesk() { + timer_.Start(FROM_HERE, kPeriodicJobIntervalInSeconds, this, + &FloatingWorkspaceService::CaptureAndUploadActiveDesk); +} + +void FloatingWorkspaceService::StopCaptureAndUploadActiveDesk() { + timer_.Stop(); +} + +// TODO(b/258692868): Add a method in DesksClient to capture but not save +// current desk for floating workspace; we can attach our own callback with the +// prev/current comparison method to see if a upload/save is necessary. +void FloatingWorkspaceService::CaptureAndUploadActiveDesk() { + DesksClient::Get()->CaptureActiveDeskAndSaveTemplate( + base::BindOnce(&FloatingWorkspaceService::OnTemplateCaptured, + weak_pointer_factory_.GetWeakPtr()), + DeskTemplateType::kFloatingWorkspace); +} + +void FloatingWorkspaceService::OnTemplateCaptured( + std::string error, + std::unique_ptr<DeskTemplate> desk_template) { + // Desk capture was not successful, nothing to upload. + if (!desk_template) + return; + + // If successfully captured desk, remove old entry and record new uuid. + if (!FloatingWorkspaceService::IsCurrentDeskSameAsPrevious( + desk_template.get())) { + // Remove old entry. + DesksClient::Get()->DeleteDeskTemplate( + current_local_floating_workspace_uuid_, base::DoNothing()); + + // Record new entry. + current_local_floating_workspace_uuid_ = desk_template->uuid(); + } +} + +void FloatingWorkspaceService::EntriesAddedOrUpdatedRemotely( + const std::vector<const DeskTemplate*>& new_entries) { + for (const DeskTemplate* desk_template : new_entries) { + if (desk_template && + desk_template->type() == DeskTemplateType::kFloatingWorkspace) { + RestoreFloatingWorkspaceTemplate(desk_template); + } + } +} + +void FloatingWorkspaceService::RestoreFloatingWorkspaceTemplate( + const DeskTemplate* desk_template) { + // Desk templates have been downloaded. + if (!should_run_restore_) { + // Remove old entry if template should not be restored. + DesksClient::Get()->DeleteDeskTemplate(desk_template->uuid(), + base::DoNothing()); + return; + } + + // Check if template has been downloaded after 3 seconds. + if (base::TimeTicks::Now() > + initialization_timestamp_ + kMaxTimeAvaliableForRestoreAfterLogin) { + // No need to restore any remote session 3 seconds (TBD) after login. + should_run_restore_ = false; + // Delete the newly downloaded template to avoid the capture/upload on each + // device to result in multiple floating workspace templates in storage. + DesksClient::Get()->DeleteDeskTemplate(desk_template->uuid(), + base::DoNothing()); + return; + } + + DesksClient::Get()->LaunchDeskTemplate( + desk_template->uuid(), + base::BindOnce(&FloatingWorkspaceService::OnTemplateLaunched, + weak_pointer_factory_.GetWeakPtr()), + desk_template->template_name()); +} + +void FloatingWorkspaceService::OnTemplateLaunched(std::string error, + const base::GUID& desk_uuid) { + // Record launched desk UUID and disable future floating workspace restore. + if (error.empty()) + current_local_floating_workspace_uuid_ = desk_uuid; + should_run_restore_ = false; +} + +// TODO(b/256874545): Implement comparison where all apps/ browsers are checked. +// As of right now, a return of false indicates that both templates +// are different, thus periodic checks will happen every 30 seconds +// regardless of if no changes exist. +bool FloatingWorkspaceService::IsCurrentDeskSameAsPrevious( + DeskTemplate* current) const { + return false; +} + } // namespace ash
diff --git a/chrome/browser/ash/floating_workspace/floating_workspace_service.h b/chrome/browser/ash/floating_workspace/floating_workspace_service.h index 78d1c36..8b52863 100644 --- a/chrome/browser/ash/floating_workspace/floating_workspace_service.h +++ b/chrome/browser/ash/floating_workspace/floating_workspace_service.h
@@ -8,6 +8,10 @@ #include "base/callback_list.h" #include "base/memory/weak_ptr.h" #include "base/time/time.h" +#include "base/timer/timer.h" +#include "components/desks_storage/core/desk_model_observer.h" +#include "components/desks_storage/core/desk_sync_bridge.h" +#include "components/desks_storage/core/desk_sync_service.h" #include "components/keyed_service/core/keyed_service.h" class Profile; @@ -18,9 +22,29 @@ struct SyncedSession; } // namespace sync_sessions +namespace desks_storage { +class DeskModelObserver; +} // namespace desks_storage + namespace ash { -class FloatingWorkspaceService : public KeyedService { +// Testing enum to substitute for feature flag during testing. +enum TestFloatingWorkspaceVersion { + // Default value, indicates no version was enabled. + kNoVersionEnabled = 0, + + // Version 1. + kFloatingWorkspaceV1Enabled = 1, + + // Version 2. + kFloatingWorkspaceV2Enabled = 2, +}; + +// A keyed service to support floating workspace. Note that a periodical +// task `CaptureAndUploadActiveDesk` will be dispatched during service +// initialization. +class FloatingWorkspaceService : public KeyedService, + public desks_storage::DeskModelObserver { public: static FloatingWorkspaceService* GetForProfile(Profile* profile); @@ -28,6 +52,10 @@ ~FloatingWorkspaceService() override; + // Used in constructor for initializations + void Init(); + void InitForTest(TestFloatingWorkspaceVersion version); + // Add subscription to foreign session changes. void SubscribeToForeignSessionUpdates(); @@ -37,7 +65,17 @@ void TryRestoreMostRecentlyUsedSession(); + // desks_storage::DeskModelObserver overrides: + void DeskModelLoaded() override {} + void OnDeskModelDestroying() override; + void EntriesAddedOrUpdatedRemotely( + const std::vector<const DeskTemplate*>& new_entries) override; + void EntriesRemovedRemotely(const std::vector<base::GUID>& uuids) override {} + private: + void InitForV1(); + void InitForV2(); + const sync_sessions::SyncedSession* GetMostRecentlyUsedRemoteSession(); const sync_sessions::SyncedSession* GetLocalSession(); @@ -52,18 +90,57 @@ // Virtual for testing. virtual sync_sessions::OpenTabsUIDelegate* GetOpenTabsUIDelegate(); + // Start and Stop capturing and uploading the active desks. + void StartCaptureAndUploadActiveDesk(); + void StopCaptureAndUploadActiveDesk(); + + // Capture the current active desk task, running every ~30(TBD) seconds. + // Upload captured desk to chrome sync and record the randomly generated + // UUID key to `floating_workspace_template_uuid_`. + void CaptureAndUploadActiveDesk(); + + // Restore last saved floating workspace desk for current user with + // floating_workspace_template_uuid_. + void RestoreFloatingWorkspaceTemplate(const DeskTemplate* desk_template); + + // Compare currently captured and previous floating workspace desk. + // Called by CaptureAndUploadActiveDesk before upload. + // If no difference is recorded no upload job will be triggered. + bool IsCurrentDeskSameAsPrevious(DeskTemplate* current) const; + + // UUID assigned to the floating workspace desk template in desks_storage. + base::GUID current_local_floating_workspace_uuid_; + + const base::TimeDelta kPeriodicJobIntervalInSeconds = base::Seconds(30); + + // Callback function that is run after a floating workspace template + // is downloaded and launched. + void OnTemplateLaunched(std::string error, const base::GUID& desk_uuid); + + // Callback function that is run after a floating workspace template is + // captured by `desks_storage::DeskSyncBridge`. + void OnTemplateCaptured(std::string error, std::unique_ptr<DeskTemplate>); + Profile* const profile_; - sync_sessions::SessionSyncService* const session_sync_service_; + sync_sessions::SessionSyncService* session_sync_service_; base::CallbackListSubscription foreign_session_updated_subscription_; - // Flag determine if we should run the restore. + // Flag to determine if we should run the restore. bool should_run_restore_ = true; - // Time when the service is initialized during login. - const base::Time initialized_timestamp_; + // Time when the service is initialized. + base::TimeTicks initialization_timestamp_; + // Timer used for periodic capturing and uploading. + base::RepeatingTimer timer_; + + // Convenience pointer to desks_storage::DeskSyncService. Guaranteed to be not + // null for the duration of `this`. + raw_ptr<desks_storage::DeskSyncService> desk_sync_service_ = nullptr; + + // Weak pointer factory used to provide references to this service. base::WeakPtrFactory<FloatingWorkspaceService> weak_pointer_factory_{this}; };
diff --git a/chrome/browser/ash/floating_workspace/floating_workspace_service_factory.cc b/chrome/browser/ash/floating_workspace/floating_workspace_service_factory.cc index 2490489..349074b 100644 --- a/chrome/browser/ash/floating_workspace/floating_workspace_service_factory.cc +++ b/chrome/browser/ash/floating_workspace/floating_workspace_service_factory.cc
@@ -6,8 +6,8 @@ #include "base/no_destructor.h" #include "chrome/browser/ash/floating_workspace/floating_workspace_service.h" -#include "chrome/browser/ash/floating_workspace/floating_workspace_util.h" #include "chrome/browser/profiles/profile.h" +#include "chrome/browser/sync/desk_sync_service_factory.h" #include "chrome/browser/sync/session_sync_service_factory.h" #include "chrome/browser/sync/sync_service_factory.h" @@ -29,6 +29,7 @@ FloatingWorkspaceServiceFactory::FloatingWorkspaceServiceFactory() : ProfileKeyedServiceFactory("FloatingWorkspaceServiceFactory") { + DependsOn(DeskSyncServiceFactory::GetInstance()); DependsOn(SessionSyncServiceFactory::GetInstance()); DependsOn(SyncServiceFactory::GetInstance()); } @@ -37,7 +38,10 @@ KeyedService* FloatingWorkspaceServiceFactory::BuildServiceInstanceFor( content::BrowserContext* context) const { - return new FloatingWorkspaceService(Profile::FromBrowserContext(context)); + raw_ptr<FloatingWorkspaceService> service = + new FloatingWorkspaceService(Profile::FromBrowserContext(context)); + service->Init(); + return service; } } // namespace ash
diff --git a/chrome/browser/ash/floating_workspace/floating_workspace_service_unittest.cc b/chrome/browser/ash/floating_workspace/floating_workspace_service_unittest.cc index 4efe006..a09ff9b 100644 --- a/chrome/browser/ash/floating_workspace/floating_workspace_service_unittest.cc +++ b/chrome/browser/ash/floating_workspace/floating_workspace_service_unittest.cc
@@ -83,8 +83,10 @@ namespace ash { class TestFloatingWorkSpaceService : public ash::FloatingWorkspaceService { public: - explicit TestFloatingWorkSpaceService(TestingProfile* profile) + explicit TestFloatingWorkSpaceService(TestingProfile* profile, + TestFloatingWorkspaceVersion version) : ash::FloatingWorkspaceService(profile) { + InitForTest(version); mock_open_tabs_ = std::make_unique<MockOpenTabsUIDelegate>(); } @@ -145,7 +147,8 @@ }; TEST_F(FloatingWorkspaceServiceTest, RestoreRemoteSession) { - TestFloatingWorkSpaceService test_floating_workspace_service(profile()); + TestFloatingWorkSpaceService test_floating_workspace_service( + profile(), TestFloatingWorkspaceVersion::kFloatingWorkspaceV1Enabled); std::unique_ptr<sync_sessions::SyncedSession> local_session = CreateNewSession(local_session_name, more_recent_time); std::vector<const sync_sessions::SyncedSession*> foreign_sessions; @@ -175,7 +178,8 @@ } TEST_F(FloatingWorkspaceServiceTest, RestoreLocalSession) { - TestFloatingWorkSpaceService test_floating_workspace_service(profile()); + TestFloatingWorkSpaceService test_floating_workspace_service( + profile(), TestFloatingWorkspaceVersion::kFloatingWorkspaceV1Enabled); // Local session has most recent timestamp and should be restored. std::unique_ptr<sync_sessions::SyncedSession> local_session = CreateNewSession(local_session_name, most_recent_time); @@ -205,7 +209,8 @@ } TEST_F(FloatingWorkspaceServiceTest, RestoreRemoteSessionAfterUpdated) { - TestFloatingWorkSpaceService test_floating_workspace_service(profile()); + TestFloatingWorkSpaceService test_floating_workspace_service( + profile(), TestFloatingWorkspaceVersion::kFloatingWorkspaceV1Enabled); // Local session has most recent timestamp and should be restored. std::unique_ptr<sync_sessions::SyncedSession> local_session = CreateNewSession(local_session_name, most_recent_time); @@ -248,7 +253,8 @@ } TEST_F(FloatingWorkspaceServiceTest, NoLocalSession) { - TestFloatingWorkSpaceService test_floating_workspace_service(profile()); + TestFloatingWorkSpaceService test_floating_workspace_service( + profile(), TestFloatingWorkspaceVersion::kFloatingWorkspaceV1Enabled); std::vector<const sync_sessions::SyncedSession*> foreign_sessions; const std::unique_ptr<sync_sessions::SyncedSession> most_recent_remote_session = @@ -273,7 +279,8 @@ } TEST_F(FloatingWorkspaceServiceTest, NoRemoteSession) { - TestFloatingWorkSpaceService test_floating_workspace_service(profile()); + TestFloatingWorkSpaceService test_floating_workspace_service( + profile(), TestFloatingWorkspaceVersion::kFloatingWorkspaceV1Enabled); std::unique_ptr<sync_sessions::SyncedSession> local_session = CreateNewSession(local_session_name, least_recent_time); test_floating_workspace_service.SetLocalSessionForTesting( @@ -291,7 +298,8 @@ } TEST_F(FloatingWorkspaceServiceTest, NoSession) { - TestFloatingWorkSpaceService test_floating_workspace_service(profile()); + TestFloatingWorkSpaceService test_floating_workspace_service( + profile(), TestFloatingWorkspaceVersion::kFloatingWorkspaceV1Enabled); test_floating_workspace_service .RestoreBrowserWindowsFromMostRecentlyUsedDevice(); // Wait for 3 seconds which is kMaxTimeAvailableForRestoreAfterLogin.
diff --git a/chrome/browser/ash/floating_workspace/floating_workspace_util.cc b/chrome/browser/ash/floating_workspace/floating_workspace_util.cc index c4e3425..7767c32 100644 --- a/chrome/browser/ash/floating_workspace/floating_workspace_util.cc +++ b/chrome/browser/ash/floating_workspace/floating_workspace_util.cc
@@ -31,7 +31,7 @@ registry->RegisterBooleanPref(prefs::kFloatingWorkspaceEnabled, false); } -bool IsFloatingWorkspaceEnabled() { +bool IsFloatingWorkspaceV1Enabled() { PrefService* pref_service = GetPrimaryUserPrefService(); DCHECK(pref_service); @@ -48,5 +48,9 @@ return features::IsFloatingWorkspaceEnabled(); } +bool IsFloatingWorkspaceV2Enabled() { + return features::IsFloatingWorkspaceV2Enabled(); +} + } // namespace floating_workspace_util } // namespace ash
diff --git a/chrome/browser/ash/floating_workspace/floating_workspace_util.h b/chrome/browser/ash/floating_workspace/floating_workspace_util.h index 784b71fd..cd139244 100644 --- a/chrome/browser/ash/floating_workspace/floating_workspace_util.h +++ b/chrome/browser/ash/floating_workspace/floating_workspace_util.h
@@ -18,7 +18,8 @@ // Returns true if floating workspace is enabled. Note this should // only be called after primary user profile is loaded and policy // has initialized. -ASH_EXPORT bool IsFloatingWorkspaceEnabled(); +ASH_EXPORT bool IsFloatingWorkspaceV1Enabled(); +ASH_EXPORT bool IsFloatingWorkspaceV2Enabled(); } // namespace floating_workspace_util } // namespace ash
diff --git a/chrome/browser/ash/input_method/input_method_manager_impl.cc b/chrome/browser/ash/input_method/input_method_manager_impl.cc index 9da6d71..ee097be9 100644 --- a/chrome/browser/ash/input_method/input_method_manager_impl.cc +++ b/chrome/browser/ash/input_method/input_method_manager_impl.cc
@@ -174,37 +174,36 @@ return scoped_refptr<InputMethodManager::State>(new_state.get()); } -std::unique_ptr<InputMethodDescriptors> +InputMethodDescriptors InputMethodManagerImpl::StateImpl::GetEnabledInputMethods() const { - std::unique_ptr<InputMethodDescriptors> result(new InputMethodDescriptors); + InputMethodDescriptors result; // Build the enabled input method descriptors from the enabled input // methods cache |enabled_input_method_ids_|. for (const auto& input_method_id : enabled_input_method_ids_) { const InputMethodDescriptor* descriptor = manager_->util_.GetInputMethodDescriptorFromId(input_method_id); if (descriptor) { - result->push_back(*descriptor); + result.push_back(*descriptor); } else { const auto ix = available_input_methods_.find(input_method_id); if (ix != available_input_methods_.end()) - result->push_back(ix->second); + result.push_back(ix->second); else DVLOG(1) << "Descriptor is not found for: " << input_method_id; } } - if (result->empty()) { + if (result.empty()) { // Initially |enabled_input_method_ids_| is empty. browser_tests might take // this path. - result->push_back( - InputMethodUtil::GetFallbackInputMethodDescriptor()); + result.push_back(InputMethodUtil::GetFallbackInputMethodDescriptor()); } return result; } -std::unique_ptr<InputMethodDescriptors> InputMethodManagerImpl::StateImpl:: +InputMethodDescriptors InputMethodManagerImpl::StateImpl:: GetEnabledInputMethodsSortedByLocalizedDisplayNames() const { - std::unique_ptr<InputMethodDescriptors> result = GetEnabledInputMethods(); + InputMethodDescriptors result = GetEnabledInputMethods(); UErrorCode error_code = U_ZERO_ERROR; std::unique_ptr<icu::Collator> collator( @@ -213,7 +212,7 @@ const InputMethodUtil& util = manager_->util_; std::sort( - result->begin(), result->end(), + result.begin(), result.end(), [&collator, &util](const InputMethodDescriptor& a, const InputMethodDescriptor& b) { std::u16string a16 = base::UTF8ToUTF16(util.GetLocalizedDisplayName(a)); @@ -760,17 +759,17 @@ } const std::string& current_input_method_id = current_input_method_.id(); - std::unique_ptr<InputMethodDescriptors> sorted_enabled_input_methods = + InputMethodDescriptors sorted_enabled_input_methods = GetEnabledInputMethodsSortedByLocalizedDisplayNames(); auto iter = - base::ranges::find(*sorted_enabled_input_methods, current_input_method_id, + base::ranges::find(sorted_enabled_input_methods, current_input_method_id, &InputMethodDescriptor::id); - if (iter != sorted_enabled_input_methods->end()) + if (iter != sorted_enabled_input_methods.end()) ++iter; - if (iter == sorted_enabled_input_methods->end()) - iter = sorted_enabled_input_methods->begin(); + if (iter == sorted_enabled_input_methods.end()) + iter = sorted_enabled_input_methods.begin(); ChangeInputMethod(iter->id(), true); } @@ -879,10 +878,9 @@ // Sanity check if (!InputMethodIsEnabled(input_method_id)) { - std::unique_ptr<InputMethodDescriptors> input_methods( - GetEnabledInputMethods()); - DCHECK(!input_methods->empty()); - input_method_id_to_switch = input_methods->at(0).id(); + InputMethodDescriptors input_methods(GetEnabledInputMethods()); + DCHECK(!input_methods.empty()); + input_method_id_to_switch = input_methods.at(0).id(); if (!input_method_id.empty()) { DVLOG(1) << "Can't change the current input method to " << input_method_id << " since the engine is not enabled. "
diff --git a/chrome/browser/ash/input_method/input_method_manager_impl.h b/chrome/browser/ash/input_method/input_method_manager_impl.h index e930bcf2..cddd8f4 100644 --- a/chrome/browser/ash/input_method/input_method_manager_impl.h +++ b/chrome/browser/ash/input_method/input_method_manager_impl.h
@@ -88,10 +88,9 @@ const std::vector<std::string>& initial_layouts) override; void DisableNonLockScreenLayouts() override; void GetInputMethodExtensions(InputMethodDescriptors* result) override; - std::unique_ptr<InputMethodDescriptors> - GetEnabledInputMethodsSortedByLocalizedDisplayNames() const override; - std::unique_ptr<InputMethodDescriptors> GetEnabledInputMethods() + InputMethodDescriptors GetEnabledInputMethodsSortedByLocalizedDisplayNames() const override; + InputMethodDescriptors GetEnabledInputMethods() const override; const std::vector<std::string>& GetEnabledInputMethodIds() const override; const InputMethodDescriptor* GetInputMethodFromId( const std::string& input_method_id) const override;
diff --git a/chrome/browser/ash/input_method/input_method_manager_impl_unittest.cc b/chrome/browser/ash/input_method/input_method_manager_impl_unittest.cc index b010544..5207dced 100644 --- a/chrome/browser/ash/input_method/input_method_manager_impl_unittest.cc +++ b/chrome/browser/ash/input_method/input_method_manager_impl_unittest.cc
@@ -418,8 +418,7 @@ EXPECT_EQ(0, observer.input_method_extension_added_count_); EXPECT_EQ(0, observer.input_method_extension_removed_count_); manager_->GetActiveIMEState()->EnableLoginLayouts("en-US", keyboard_layouts); - EXPECT_EQ(8U, - manager_->GetActiveIMEState()->GetEnabledInputMethods()->size()); + EXPECT_EQ(8U, manager_->GetActiveIMEState()->GetEnabledInputMethods().size()); EXPECT_EQ(1, observer.input_method_changed_count_); // Menu change is triggered only if current input method was actually changed. EXPECT_EQ(0, observer.input_method_menu_item_changed_count_); @@ -562,17 +561,16 @@ manager_->GetActiveIMEState()->EnableLoginLayouts( "ja", keyboard_layouts); // Japanese EXPECT_EQ(2U, manager_->GetActiveIMEState()->GetNumEnabledInputMethods()); - std::unique_ptr<InputMethodDescriptors> methods( - manager_->GetActiveIMEState()->GetEnabledInputMethods()); - ASSERT_TRUE(methods.get()); - EXPECT_EQ(2U, methods->size()); + InputMethodDescriptors methods = + manager_->GetActiveIMEState()->GetEnabledInputMethods(); + EXPECT_EQ(2U, methods.size()); const InputMethodDescriptor* id_to_find = manager_->GetInputMethodUtil()->GetInputMethodDescriptorFromId( ImeIdFromEngineId("xkb:us::eng")); - EXPECT_TRUE(id_to_find && Contain(*methods.get(), *id_to_find)); + EXPECT_TRUE(id_to_find && Contain(methods, *id_to_find)); id_to_find = manager_->GetInputMethodUtil()->GetInputMethodDescriptorFromId( ImeIdFromEngineId("xkb:jp::jpn")); - EXPECT_TRUE(id_to_find && Contain(*methods.get(), *id_to_find)); + EXPECT_TRUE(id_to_find && Contain(methods, *id_to_find)); } TEST_F(InputMethodManagerImplTest, TestEnableTwoLayouts) { @@ -931,18 +929,18 @@ active_state->EnableInputMethod(ImeIdFromEngineId("xkb:de::ger")); base::i18n::SetICUDefaultLocale("en-US"); - std::unique_ptr<InputMethodDescriptors> result = + InputMethodDescriptors result = active_state->GetEnabledInputMethodsSortedByLocalizedDisplayNames(); - ASSERT_FALSE(result->empty()); + ASSERT_FALSE(result.empty()); InputMethodUtil* util = manager_->GetInputMethodUtil(); UErrorCode error_code = U_ZERO_ERROR; std::unique_ptr<icu::Collator> collator( icu::Collator::createInstance(error_code)); - for (size_t i = 1; i < result->size(); ++i) { - std::string prev_name = util->GetLocalizedDisplayName(result->at(i - 1)); - std::string name = util->GetLocalizedDisplayName(result->at(i)); + for (size_t i = 1; i < result.size(); ++i) { + std::string prev_name = util->GetLocalizedDisplayName(result.at(i - 1)); + std::string name = util->GetLocalizedDisplayName(result.at(i)); ASSERT_EQ(UCOL_LESS, base::i18n::CompareString16WithCollator( *collator, base::UTF8ToUTF16(prev_name), base::UTF8ToUTF16(name))); @@ -958,69 +956,60 @@ // For http://crbug.com/19655#c11 - (1) manager_->GetActiveIMEState()->EnableLoginLayouts("en-US", keyboard_layouts); EXPECT_EQ(8U, manager_->GetActiveIMEState()->GetNumEnabledInputMethods()); - std::unique_ptr<InputMethodDescriptors> sorted_enabled_input_methods = + InputMethodDescriptors sorted_enabled_input_methods = manager_->GetActiveIMEState() ->GetEnabledInputMethodsSortedByLocalizedDisplayNames(); InputMethodDescriptor current_input_method = manager_->GetActiveIMEState()->GetCurrentInputMethod(); - EXPECT_EQ(sorted_enabled_input_methods->at(0).id(), - current_input_method.id()); + EXPECT_EQ(sorted_enabled_input_methods.at(0).id(), current_input_method.id()); EXPECT_EQ(current_input_method.keyboard_layout(), keyboard_->last_layout_); manager_->GetActiveIMEState()->SwitchToNextInputMethod(); EXPECT_TRUE(observer.last_show_message_); current_input_method = manager_->GetActiveIMEState()->GetCurrentInputMethod(); - EXPECT_EQ(sorted_enabled_input_methods->at(1).id(), - current_input_method.id()); + EXPECT_EQ(sorted_enabled_input_methods.at(1).id(), current_input_method.id()); EXPECT_EQ(current_input_method.keyboard_layout(), keyboard_->last_layout_); manager_->GetActiveIMEState()->SwitchToNextInputMethod(); EXPECT_TRUE(observer.last_show_message_); current_input_method = manager_->GetActiveIMEState()->GetCurrentInputMethod(); - EXPECT_EQ(sorted_enabled_input_methods->at(2).id(), - current_input_method.id()); + EXPECT_EQ(sorted_enabled_input_methods.at(2).id(), current_input_method.id()); EXPECT_EQ(current_input_method.keyboard_layout(), keyboard_->last_layout_); manager_->GetActiveIMEState()->SwitchToNextInputMethod(); EXPECT_TRUE(observer.last_show_message_); current_input_method = manager_->GetActiveIMEState()->GetCurrentInputMethod(); - EXPECT_EQ(sorted_enabled_input_methods->at(3).id(), - current_input_method.id()); + EXPECT_EQ(sorted_enabled_input_methods.at(3).id(), current_input_method.id()); EXPECT_EQ(current_input_method.keyboard_layout(), keyboard_->last_layout_); manager_->GetActiveIMEState()->SwitchToNextInputMethod(); EXPECT_TRUE(observer.last_show_message_); current_input_method = manager_->GetActiveIMEState()->GetCurrentInputMethod(); - EXPECT_EQ(sorted_enabled_input_methods->at(4).id(), - current_input_method.id()); + EXPECT_EQ(sorted_enabled_input_methods.at(4).id(), current_input_method.id()); EXPECT_EQ(current_input_method.keyboard_layout(), keyboard_->last_layout_); manager_->GetActiveIMEState()->SwitchToNextInputMethod(); EXPECT_TRUE(observer.last_show_message_); current_input_method = manager_->GetActiveIMEState()->GetCurrentInputMethod(); - EXPECT_EQ(sorted_enabled_input_methods->at(5).id(), - current_input_method.id()); + EXPECT_EQ(sorted_enabled_input_methods.at(5).id(), current_input_method.id()); EXPECT_EQ(current_input_method.keyboard_layout(), keyboard_->last_layout_); manager_->GetActiveIMEState()->SwitchToNextInputMethod(); EXPECT_TRUE(observer.last_show_message_); current_input_method = manager_->GetActiveIMEState()->GetCurrentInputMethod(); - EXPECT_EQ(sorted_enabled_input_methods->at(6).id(), - current_input_method.id()); + EXPECT_EQ(sorted_enabled_input_methods.at(6).id(), current_input_method.id()); EXPECT_EQ(current_input_method.keyboard_layout(), keyboard_->last_layout_); manager_->GetActiveIMEState()->SwitchToNextInputMethod(); EXPECT_TRUE(observer.last_show_message_); current_input_method = manager_->GetActiveIMEState()->GetCurrentInputMethod(); - EXPECT_EQ(sorted_enabled_input_methods->at(7).id(), - current_input_method.id()); + EXPECT_EQ(sorted_enabled_input_methods.at(7).id(), current_input_method.id()); EXPECT_EQ(current_input_method.keyboard_layout(), keyboard_->last_layout_); manager_->GetActiveIMEState()->SwitchToNextInputMethod(); EXPECT_TRUE(observer.last_show_message_); current_input_method = manager_->GetActiveIMEState()->GetCurrentInputMethod(); - EXPECT_EQ(sorted_enabled_input_methods->at(0).id(), - current_input_method.id()); + EXPECT_EQ(sorted_enabled_input_methods.at(0).id(), current_input_method.id()); EXPECT_EQ(current_input_method.keyboard_layout(), keyboard_->last_layout_); manager_->RemoveObserver(&observer); @@ -1150,11 +1139,11 @@ EXPECT_EQ(2U, manager_->GetActiveIMEState()->GetNumEnabledInputMethods()); { - std::unique_ptr<InputMethodDescriptors> methods( + InputMethodDescriptors methods( manager_->GetActiveIMEState()->GetEnabledInputMethods()); - ASSERT_EQ(2U, methods->size()); + ASSERT_EQ(2U, methods.size()); // Ext IMEs should be at the end of the list. - EXPECT_EQ(ext1_id, methods->at(1).id()); + EXPECT_EQ(ext1_id, methods.at(1).id()); } const std::string ext2_id = @@ -1176,12 +1165,12 @@ manager_->GetActiveIMEState()->SetEnabledExtensionImes(&extension_ime_ids); EXPECT_EQ(3U, manager_->GetActiveIMEState()->GetNumEnabledInputMethods()); { - std::unique_ptr<InputMethodDescriptors> methods( + InputMethodDescriptors methods( manager_->GetActiveIMEState()->GetEnabledInputMethods()); - ASSERT_EQ(3U, methods->size()); + ASSERT_EQ(3U, methods.size()); // Ext IMEs should be at the end of the list. - EXPECT_EQ(ext1_id, methods->at(1).id()); - EXPECT_EQ(ext2_id, methods->at(2).id()); + EXPECT_EQ(ext1_id, methods.at(1).id()); + EXPECT_EQ(ext2_id, methods.at(2).id()); } // Remove them. @@ -1259,11 +1248,11 @@ EXPECT_EQ("us(dvorak)", keyboard_->last_layout_); { // This is for crosbug.com/27052. - std::unique_ptr<InputMethodDescriptors> methods( + InputMethodDescriptors methods( manager_->GetActiveIMEState()->GetEnabledInputMethods()); - ASSERT_EQ(2U, methods->size()); + ASSERT_EQ(2U, methods.size()); // Ext. IMEs should be at the end of the list. - EXPECT_EQ(ext_id, methods->at(1).id()); + EXPECT_EQ(ext_id, methods.at(1).id()); } manager_->RemoveObserver(&observer); } @@ -1683,10 +1672,10 @@ manager_->GetActiveIMEState()->SetEnabledExtensionImes(&extension_ime_ids); EXPECT_EQ(2u, manager_->GetActiveIMEState()->GetNumEnabledInputMethods()); { - std::unique_ptr<InputMethodDescriptors> methods = + InputMethodDescriptors methods = manager_->GetActiveIMEState()->GetEnabledInputMethods(); - EXPECT_EQ(2u, methods->size()); - EXPECT_EQ(ime_id, methods->at(1).id()); + EXPECT_EQ(2u, methods.size()); + EXPECT_EQ(ime_id, methods.at(1).id()); } // Change to it.
diff --git a/chrome/browser/ash/input_method/mock_input_method_manager_impl.cc b/chrome/browser/ash/input_method/mock_input_method_manager_impl.cc index 57751524..220a526 100644 --- a/chrome/browser/ash/input_method/mock_input_method_manager_impl.cc +++ b/chrome/browser/ash/input_method/mock_input_method_manager_impl.cc
@@ -23,17 +23,16 @@ return manager_->GetActiveIMEState(); } -std::unique_ptr<InputMethodDescriptors> MockInputMethodManagerImpl::State:: +InputMethodDescriptors MockInputMethodManagerImpl::State:: GetEnabledInputMethodsSortedByLocalizedDisplayNames() const { // GetEnabledInputMethods() returns a one-element list, so already "sorted". return GetEnabledInputMethods(); } -std::unique_ptr<InputMethodDescriptors> +InputMethodDescriptors MockInputMethodManagerImpl::State::GetEnabledInputMethods() const { - std::unique_ptr<InputMethodDescriptors> result = - std::make_unique<InputMethodDescriptors>(); - result->push_back(InputMethodUtil::GetFallbackInputMethodDescriptor()); + InputMethodDescriptors result; + result.push_back(InputMethodUtil::GetFallbackInputMethodDescriptor()); return result; }
diff --git a/chrome/browser/ash/input_method/mock_input_method_manager_impl.h b/chrome/browser/ash/input_method/mock_input_method_manager_impl.h index 365874a0..9217949 100644 --- a/chrome/browser/ash/input_method/mock_input_method_manager_impl.h +++ b/chrome/browser/ash/input_method/mock_input_method_manager_impl.h
@@ -28,10 +28,9 @@ // MockInputMethodManager::State: scoped_refptr<InputMethodManager::State> Clone() const override; - std::unique_ptr<InputMethodDescriptors> - GetEnabledInputMethodsSortedByLocalizedDisplayNames() const override; - std::unique_ptr<InputMethodDescriptors> GetEnabledInputMethods() + InputMethodDescriptors GetEnabledInputMethodsSortedByLocalizedDisplayNames() const override; + InputMethodDescriptors GetEnabledInputMethods() const override; const InputMethodDescriptor* GetInputMethodFromId( const std::string& input_method_id) const override; InputMethodDescriptor GetCurrentInputMethod() const override;
diff --git a/chrome/browser/ash/lock_screen_apps/lock_screen_profile_creator_impl_unittest.cc b/chrome/browser/ash/lock_screen_apps/lock_screen_profile_creator_impl_unittest.cc index 8960683b3..f4611d2 100644 --- a/chrome/browser/ash/lock_screen_apps/lock_screen_profile_creator_impl_unittest.cc +++ b/chrome/browser/ash/lock_screen_apps/lock_screen_profile_creator_impl_unittest.cc
@@ -4,44 +4,60 @@ #include "chrome/browser/ash/lock_screen_apps/lock_screen_profile_creator_impl.h" +#include <initializer_list> #include <memory> +#include <ostream> #include <string> +#include <type_traits> #include <utility> #include "ash/components/arc/session/arc_service_manager.h" #include "ash/components/arc/session/arc_session.h" -#include "base/bind.h" -#include "base/callback.h" +#include "ash/components/arc/session/arc_session_runner.h" +#include "base/check.h" #include "base/command_line.h" #include "base/files/file_path.h" #include "base/files/scoped_temp_dir.h" -#include "base/memory/ref_counted.h" +#include "base/functional/bind.h" +#include "base/functional/callback_forward.h" +#include "base/location.h" +#include "base/memory/scoped_refptr.h" +#include "base/numerics/clamped_math.h" +#include "base/numerics/safe_conversions.h" +#include "base/one_shot_event.h" #include "base/run_loop.h" #include "base/test/metrics/histogram_tester.h" #include "base/test/simple_test_tick_clock.h" +#include "base/time/time.h" +#include "base/traits_bag.h" +#include "base/values.h" +#include "chrome/browser/apps/app_service/app_service_proxy_factory.h" #include "chrome/browser/ash/arc/session/arc_session_manager.h" #include "chrome/browser/ash/arc/test/test_arc_session_manager.h" -#include "chrome/browser/ash/lock_screen_apps/lock_screen_apps.h" #include "chrome/browser/ash/login/users/fake_chrome_user_manager.h" -#include "chrome/browser/ash/login/users/scoped_test_user_manager.h" #include "chrome/browser/ash/note_taking_helper.h" #include "chrome/browser/ash/profiles/profile_helper.h" #include "chrome/browser/ash/settings/scoped_cros_settings_test_helper.h" +#include "chrome/browser/ash/system_web_apps/system_web_app_manager.h" #include "chrome/browser/extensions/extension_service.h" #include "chrome/browser/extensions/test_extension_system.h" +#include "chrome/browser/profiles/profile.h" #include "chrome/browser/profiles/profile_manager.h" +#include "chrome/browser/web_applications/web_app_provider.h" #include "chrome/common/pref_names.h" #include "chrome/test/base/fake_profile_manager.h" #include "chrome/test/base/scoped_testing_local_state.h" #include "chrome/test/base/testing_browser_process.h" #include "chrome/test/base/testing_profile.h" #include "chromeos/ash/components/dbus/concierge/concierge_client.h" +#include "components/account_id/account_id.h" #include "components/crx_file/id_util.h" #include "components/prefs/pref_service.h" #include "components/safe_browsing/core/common/safe_browsing_prefs.h" #include "components/user_manager/fake_user_manager.h" #include "components/user_manager/scoped_user_manager.h" #include "content/public/test/browser_task_environment.h" +#include "extensions/browser/extension_system.h" #include "extensions/common/extension.h" #include "extensions/common/extension_builder.h" #include "extensions/common/switches.h" @@ -431,7 +447,18 @@ prefs::kForceEphemeralProfiles)); EXPECT_FALSE(ProfileHelper::Get()->GetUserByProfile(lock_screen_profile)); - // Profile should not be recreated if lock screen note taking gets reenabled. + // `AppManagerImpl` uses the original non-OffTheRecord profile to install apps + // to the lock screen. Regular web apps and app service should be available, + // but not system web apps. + EXPECT_TRUE(lock_screen_profile->IsOffTheRecord()); + EXPECT_TRUE(web_app::WebAppProvider::GetForLocalAppsUnchecked( + lock_screen_profile->GetOriginalProfile())); + EXPECT_TRUE(apps::AppServiceProxyFactory::IsAppServiceAvailableForProfile( + lock_screen_profile->GetOriginalProfile())); + EXPECT_FALSE( + ash::SystemWebAppManager::Get(lock_screen_profile->GetOriginalProfile())); + + // Profile should not be recreated if lock screen note taking gets re-enabled. SetAppEnabledOnLockScreen(primary_profile(), test_app.get(), false); SetAppEnabledOnLockScreen(primary_profile(), test_app.get(), true);
diff --git a/chrome/browser/ash/login/demo_mode/demo_session.cc b/chrome/browser/ash/login/demo_mode/demo_session.cc index 24f7586..62ba7fa 100644 --- a/chrome/browser/ash/login/demo_mode/demo_session.cc +++ b/chrome/browser/ash/login/demo_mode/demo_session.cc
@@ -653,8 +653,10 @@ return; } Profile* profile = ProfileManager::GetActiveUserProfile(); - ash::SystemWebAppManager::Get(profile)->on_apps_synchronized().Post( - FROM_HERE, base::BindOnce(&LaunchDemoSystemWebApp)); + if (auto* swa_manager = ash::SystemWebAppManager::Get(profile)) { + swa_manager->on_apps_synchronized().Post( + FROM_HERE, base::BindOnce(&LaunchDemoSystemWebApp)); + } } base::FilePath GetSplashScreenImagePath(base::FilePath localized_image_path,
diff --git a/chrome/browser/ash/login/session/user_session_manager.cc b/chrome/browser/ash/login/session/user_session_manager.cc index bf1d82b0..cc450aa 100644 --- a/chrome/browser/ash/login/session/user_session_manager.cc +++ b/chrome/browser/ash/login/session/user_session_manager.cc
@@ -109,6 +109,7 @@ #include "chrome/browser/signin/identity_manager_factory.h" #include "chrome/browser/supervised_user/child_accounts/child_account_service.h" #include "chrome/browser/supervised_user/child_accounts/child_account_service_factory.h" +#include "chrome/browser/sync/desk_sync_service_factory.h" #include "chrome/browser/sync/sync_service_factory.h" #include "chrome/browser/ui/app_list/app_list_client_impl.h" #include "chrome/browser/ui/app_list/arc/arc_app_utils.h" @@ -2292,11 +2293,13 @@ VLOG(1) << "Launching browser..."; TRACE_EVENT0("login", "LaunchBrowser"); if (should_launch_browser_) { - if (floating_workspace_util::IsFloatingWorkspaceEnabled()) { + if (floating_workspace_util::IsFloatingWorkspaceV1Enabled() || + floating_workspace_util::IsFloatingWorkspaceV2Enabled()) { // If floating workspace is enabled, it will override full restore. FloatingWorkspaceService* floating_workspace_service = ash::FloatingWorkspaceService::GetForProfile(profile); - if (floating_workspace_service) { + if (floating_workspace_util::IsFloatingWorkspaceV1Enabled() && + floating_workspace_service) { floating_workspace_service->SubscribeToForeignSessionUpdates(); } } else if (!IsFullRestoreEnabled(profile)) {
diff --git a/chrome/browser/ash/policy/reporting/metrics_reporting/network/network_events_observer.cc b/chrome/browser/ash/policy/reporting/metrics_reporting/network/network_events_observer.cc index 4e886b6b..fbca29bc 100644 --- a/chrome/browser/ash/policy/reporting/metrics_reporting/network/network_events_observer.cc +++ b/chrome/browser/ash/policy/reporting/metrics_reporting/network/network_events_observer.cc
@@ -101,6 +101,9 @@ } } +void NetworkEventsObserver::OnNetworkListChanged( + std::vector<::chromeos::network_health::mojom::NetworkPtr> networks) {} + void NetworkEventsObserver::AddObserver() { ash::network_health::NetworkHealthManager::GetInstance()->AddObserver( BindNewPipeAndPassRemote());
diff --git a/chrome/browser/ash/policy/reporting/metrics_reporting/network/network_events_observer.h b/chrome/browser/ash/policy/reporting/metrics_reporting/network/network_events_observer.h index da870d6..3c6a02d 100644 --- a/chrome/browser/ash/policy/reporting/metrics_reporting/network/network_events_observer.h +++ b/chrome/browser/ash/policy/reporting/metrics_reporting/network/network_events_observer.h
@@ -34,6 +34,9 @@ void OnSignalStrengthChanged(const std::string& guid, ::chromeos::network_health::mojom::UInt32ValuePtr signal_strength) override; + void OnNetworkListChanged( + std::vector<::chromeos::network_health::mojom::NetworkPtr> networks) + override; // MojoServiceEventsObserverBase: void SetReportingEnabled(bool is_enabled) override;
diff --git a/chrome/browser/ash/system_web_apps/system_web_app_manager.cc b/chrome/browser/ash/system_web_apps/system_web_app_manager.cc index 452b76b..752d36de 100644 --- a/chrome/browser/ash/system_web_apps/system_web_app_manager.cc +++ b/chrome/browser/ash/system_web_apps/system_web_app_manager.cc
@@ -216,14 +216,8 @@ // Always create delegates because many System Web App WebUIs are disabled // when the delegate is not present and we need them in tests. Tests can // override the list of delegates with SetSystemAppsForTesting(). - // - // TODO(https://crbug.com/1353262): SWAM is not supported in Kiosk mode. Many - // components assume that SWAM always exists alongside WebAppProvider. We want - // to use WebAppProvider to install web apps in Kiosk without enabling SWAM. - if (!base::FeatureList::IsEnabled(::features::kKioskEnableAppService) || - !profiles::IsKioskSession()) { - system_app_delegates_ = CreateSystemWebApps(profile_); - } + // Tests can override the list of delegates with `SetSystemAppsForTesting`. + system_app_delegates_ = CreateSystemWebApps(profile_); #if defined(OFFICIAL_BUILD) const bool is_official = true;
diff --git a/chrome/browser/ash/system_web_apps/system_web_app_manager.h b/chrome/browser/ash/system_web_apps/system_web_app_manager.h index e225a576..0787f42f 100644 --- a/chrome/browser/ash/system_web_apps/system_web_app_manager.h +++ b/chrome/browser/ash/system_web_apps/system_web_app_manager.h
@@ -76,7 +76,7 @@ // lock-screen, system profile). static SystemWebAppManager* Get(Profile* profile); // Gets the associated WebAppProvider for system web apps. `WebAppProvider` is - // always presented in the `profile` if the `Get` above returns non-nullptr. + // always present in the `profile` if the `Get` above returns non-nullptr. static web_app::WebAppProvider* GetWebAppProvider(Profile* profile); // Returns the SystemWebAppManager for tests. Blocks if the web app registry
diff --git a/chrome/browser/ash/system_web_apps/system_web_app_manager_factory.cc b/chrome/browser/ash/system_web_apps/system_web_app_manager_factory.cc index d48732aa..a127a3e7 100644 --- a/chrome/browser/ash/system_web_apps/system_web_app_manager_factory.cc +++ b/chrome/browser/ash/system_web_apps/system_web_app_manager_factory.cc
@@ -6,11 +6,14 @@ #include "ash/constants/ash_pref_names.h" #include "build/chromeos_buildflags.h" +#include "chrome/browser/ash/profiles/profile_helper.h" #include "chrome/browser/ash/system_web_apps/system_web_app_manager.h" #include "chrome/browser/profiles/profile.h" +#include "chrome/browser/profiles/profiles_state.h" #include "chrome/browser/web_applications/web_app_provider.h" #include "chrome/browser/web_applications/web_app_provider_factory.h" #include "chrome/browser/web_applications/web_app_utils.h" +#include "chrome/common/chrome_features.h" #include "components/keyed_service/content/browser_context_dependency_manager.h" #include "components/pref_registry/pref_registry_syncable.h" @@ -61,6 +64,18 @@ content::BrowserContext* SystemWebAppManagerFactory::GetBrowserContextToUse( content::BrowserContext* context) const { + if (ash::ProfileHelper::IsLockScreenAppProfile( + Profile::FromBrowserContext(context))) { + return nullptr; + } + + // SWAM is not supported in Kiosk mode. We want to use WebAppProvider to + // install web apps in Kiosk without enabling SWAM. + if (base::FeatureList::IsEnabled(features::kKioskEnableAppService) && + profiles::IsKioskSession()) { + return nullptr; + } + return web_app::GetBrowserContextForWebApps(context); }
diff --git a/chrome/browser/ash/system_web_apps/system_web_app_manager_unittest.cc b/chrome/browser/ash/system_web_apps/system_web_app_manager_unittest.cc index 2b08310..984b1ad 100644 --- a/chrome/browser/ash/system_web_apps/system_web_app_manager_unittest.cc +++ b/chrome/browser/ash/system_web_apps/system_web_app_manager_unittest.cc
@@ -1486,12 +1486,9 @@ } }; -// Checks that SWA delegates are not created in Kiosk sessions. -TEST_F(SystemWebAppManagerInKioskTest, ShoudNotCreateDelegate) { - auto* manager = SystemWebAppManager::Get(profile()); - EXPECT_TRUE(manager); - EXPECT_EQ(manager->system_app_delegates().size(), 0u); - EXPECT_EQ(manager->GetSystemApp(SystemWebAppType::SETTINGS), nullptr); +// Checks that SWA manager is not created in Kiosk sessions. +TEST_F(SystemWebAppManagerInKioskTest, ShoudNotCreateManager) { + EXPECT_FALSE(SystemWebAppManager::Get(profile())); } } // namespace ash
diff --git a/chrome/browser/ash/web_applications/camera_app/chrome_camera_app_ui_delegate.cc b/chrome/browser/ash/web_applications/camera_app/chrome_camera_app_ui_delegate.cc index 580e41df2..b3cce9c 100644 --- a/chrome/browser/ash/web_applications/camera_app/chrome_camera_app_ui_delegate.cc +++ b/chrome/browser/ash/web_applications/camera_app/chrome_camera_app_ui_delegate.cc
@@ -278,9 +278,14 @@ auto my_files_folder_path = file_manager::util::GetMyFilesFolderForProfile(profile); + auto* swa_manager = ash::SystemWebAppManager::Get(profile); + if (!swa_manager) + return; + absl::optional<web_app::AppId> app_id = - ash::SystemWebAppManager::Get(profile)->GetAppIdForSystemApp( - ash::SystemWebAppType::CAMERA); + swa_manager->GetAppIdForSystemApp(ash::SystemWebAppType::CAMERA); + if (!app_id.has_value()) + return; // The launch directory is passed here rather than // `SystemWebAppDelegate::LaunchAndNavigateSystemWebApp()` to handle the case
diff --git a/chrome/browser/chrome_content_browser_client.cc b/chrome/browser/chrome_content_browser_client.cc index 5119a034..c5fd7a0 100644 --- a/chrome/browser/chrome_content_browser_client.cc +++ b/chrome/browser/chrome_content_browser_client.cc
@@ -1306,6 +1306,7 @@ throttles->push_back(std::move(maybe_throttle)); } +#if BUILDFLAG(SAFE_BROWSING_AVAILABLE) void MaybeAddCondition( std::unique_ptr<content::CommitDeferringCondition> maybe_condition, std::vector<std::unique_ptr<content::CommitDeferringCondition>>* @@ -1313,6 +1314,7 @@ if (maybe_condition) conditions->push_back(std::move(maybe_condition)); } +#endif void MaybeAddThrottles( std::vector<std::unique_ptr<content::NavigationThrottle>> additional,
diff --git a/chrome/browser/chrome_content_browser_client_receiver_bindings.cc b/chrome/browser/chrome_content_browser_client_receiver_bindings.cc index 30f8017..34fea44 100644 --- a/chrome/browser/chrome_content_browser_client_receiver_bindings.cc +++ b/chrome/browser/chrome_content_browser_client_receiver_bindings.cc
@@ -131,6 +131,7 @@ namespace { +#if BUILDFLAG(SAFE_BROWSING_AVAILABLE) // Helper method for ExposeInterfacesToRenderer() that checks the latest // SafeBrowsing pref value on the UI thread before hopping over to the IO // thread. @@ -172,6 +173,7 @@ allowlist_domains), std::move(receiver))); } +#endif // BadgeManager is not used for Android. #if !BUILDFLAG(IS_ANDROID)
diff --git a/chrome/browser/chrome_service_worker_browsertest.cc b/chrome/browser/chrome_service_worker_browsertest.cc index a9f5736..0505739 100644 --- a/chrome/browser/chrome_service_worker_browsertest.cc +++ b/chrome/browser/chrome_service_worker_browsertest.cc
@@ -981,23 +981,10 @@ IN_PROC_BROWSER_TEST_F(ChromeWebUIServiceWorkerTest, DisallowChromeScheme) { const GURL base_url("chrome://dummyurl"); - // Registration should fail. This is the desired behavior. At the time of this - // writing, there are a few reasons the registration fails: - // * OriginCanAccessServiceWorkers() returns false for the "chrome" scheme. - // * Even if that returned true, the URL loader factory bundle used to make - // the resource request in ServiceWorkerNewScriptLoader doesn't support - // the "chrome" scheme. This is because: - // * The call to RegisterNonNetworkSubresourceURLLoaderFactories() from - // CreateFactoryBundle() in embedded_worker_instance.cc doesn't register - // the "chrome" scheme, because there is no frame/web_contents. - // * Even if that registered a factory, CreateFactoryBundle() would - // skip it because GetServiceWorkerSchemes() doesn't include "chrome". - // - // It's difficult to change all these, so the test author hasn't actually - // changed Chrome in a way that makes this test fail, to prove that the test - // would be effective at catching a regression. + // Registration should fail without the flag being set. See the tests + // below, which set kEnableServiceWorkersForChromeScheme. auto result = CreateWebUIAndRegisterServiceWorker(base_url); - EXPECT_EQ(result, blink::ServiceWorkerStatusCode::kErrorInvalidArguments); + EXPECT_EQ(result, blink::ServiceWorkerStatusCode::kErrorNetwork); } // Tests that registering a service worker in JavaScript with a @@ -1028,6 +1015,58 @@ EXPECT_EQ(result, blink::ServiceWorkerStatusCode::kErrorNetwork); } +class ChromeWebUIServiceWorkerFlagTest : public ChromeWebUIServiceWorkerTest { + public: + ChromeWebUIServiceWorkerFlagTest() + : features_(features::kEnableServiceWorkersForChromeScheme) {} + + private: + base::test::ScopedFeatureList features_; +}; + +// Tests that registering a service worker in JavaScript with a +// chrome:// URL fails even if the flag is enabled. +IN_PROC_BROWSER_TEST_F(ChromeWebUIServiceWorkerFlagTest, + DisallowChromeSchemeInJavaScript) { + const GURL base_url("chrome://dummyurl"); + auto result = CreateWebUIAndRegisterServiceWorkerInJavaScript(base_url); + EXPECT_EQ( + "Failed to register a ServiceWorker: The document is in an invalid " + "state.", + result); +} + +// Tests that registering a service worker with a chrome-untrusted:// URL fails +// even if the flag is enabled. +IN_PROC_BROWSER_TEST_F(ChromeWebUIServiceWorkerFlagTest, + DisallowChromeUntrustedScheme) { + const GURL base_url("chrome-untrusted://dummyurl"); + auto result = CreateWebUIAndRegisterServiceWorker(base_url); + EXPECT_EQ(result, blink::ServiceWorkerStatusCode::kErrorNetwork); +} + +// Tests that registering a service worker with a chrome:// URL works +// if the flag is enabled. +IN_PROC_BROWSER_TEST_F(ChromeWebUIServiceWorkerFlagTest, AllowChromeScheme) { + const GURL base_url("chrome://dummyurl"); + auto result = CreateWebUIAndRegisterServiceWorker(base_url); + EXPECT_EQ(result, blink::ServiceWorkerStatusCode::kOk); +} + +// Tests that registering a service worker in JavaScript with a +// chrome-untrusted:// URL fails. +IN_PROC_BROWSER_TEST_F(ChromeWebUIServiceWorkerFlagTest, + DisallowChromeUntrustedSchemeInJavaScript) { + const GURL base_url("chrome-untrusted://dummyurl"); + auto result = CreateWebUIAndRegisterServiceWorkerInJavaScript(base_url); + // We expect all WebUI Service Worker registrations to happen from C++ + // so this should fail even when the flag is enabled. + EXPECT_EQ( + "Failed to register a ServiceWorker: The URL protocol of the current " + "origin ('chrome-untrusted://dummyurl') is not supported.", + result); +} + class ChromeWebUIServiceWorkerUntrustedFlagTest : public ChromeWebUIServiceWorkerTest { public: @@ -1045,8 +1084,8 @@ const GURL base_url("chrome://dummyurl"); auto result = CreateWebUIAndRegisterServiceWorkerInJavaScript(base_url); EXPECT_EQ( - "Failed to register a ServiceWorker: The URL protocol of the " - "current origin ('chrome://dummyurl') is not supported.", + "Failed to register a ServiceWorker: The URL protocol of the current " + "origin ('chrome://dummyurl') is not supported.", result); } @@ -1056,7 +1095,7 @@ DisallowChromeScheme) { const GURL base_url("chrome://dummyurl"); auto result = CreateWebUIAndRegisterServiceWorker(base_url); - EXPECT_EQ(result, blink::ServiceWorkerStatusCode::kErrorInvalidArguments); + EXPECT_EQ(result, blink::ServiceWorkerStatusCode::kErrorNetwork); } // Tests that registering a service worker with a chrome-untrusted:// URL works @@ -1071,7 +1110,7 @@ // Tests that registering a service worker in JavaScript with a // chrome-untrusted:// URL fails. IN_PROC_BROWSER_TEST_F(ChromeWebUIServiceWorkerUntrustedFlagTest, - AllowChromeUntrustedSchemeInJavaScript) { + DisallowChromeUntrustedSchemeInJavaScript) { const GURL base_url("chrome-untrusted://dummyurl"); auto result = CreateWebUIAndRegisterServiceWorkerInJavaScript(base_url); // We expect all WebUI Service Worker registrations to happen from C++
diff --git a/chrome/browser/commerce/price_tracking/android/java/src/org/chromium/chrome/browser/price_tracking/PriceTrackingNotificationBridge.java b/chrome/browser/commerce/price_tracking/android/java/src/org/chromium/chrome/browser/price_tracking/PriceTrackingNotificationBridge.java index e2b9157..fb5763f 100644 --- a/chrome/browser/commerce/price_tracking/android/java/src/org/chromium/chrome/browser/price_tracking/PriceTrackingNotificationBridge.java +++ b/chrome/browser/commerce/price_tracking/android/java/src/org/chromium/chrome/browser/price_tracking/PriceTrackingNotificationBridge.java
@@ -18,6 +18,7 @@ import org.chromium.base.ContextUtils; import org.chromium.base.Log; import org.chromium.base.annotations.CalledByNative; +import org.chromium.chrome.R; import org.chromium.chrome.browser.commerce.PriceUtils; import org.chromium.chrome.browser.price_tracking.PriceDropNotifier.ActionData; import org.chromium.chrome.browser.price_tracking.proto.Notifications; @@ -26,7 +27,6 @@ import org.chromium.chrome.browser.price_tracking.proto.Notifications.ChromeNotification.NotificationDataType; import org.chromium.chrome.browser.price_tracking.proto.Notifications.ExpandedView; import org.chromium.chrome.browser.price_tracking.proto.Notifications.PriceDropNotificationPayload; -import org.chromium.chrome.tab_ui.R; import org.chromium.components.commerce.PriceTracking.ProductPrice; import org.chromium.components.embedder_support.util.UrlUtilities; import org.chromium.components.optimization_guide.proto.CommonTypesProto.Any; @@ -99,7 +99,7 @@ } Context context = ContextUtils.getApplicationContext(); - String title = context.getString(R.string.price_drop_notification_content_title, priceDrop, + String title = context.getString(R.string.price_drop_popup_content_title, priceDrop, priceDropPayload.getProductName()); Uri productUrl = Uri.parse(priceDropPayload.getDestinationUrl()); @@ -107,7 +107,7 @@ Log.e(TAG, "Failed to parse destination URL host."); return; } - String text = context.getString(R.string.price_drop_notification_content_text, + String text = context.getString(R.string.price_drop_popup_content_text, buildDisplayPrice(priceDropPayload.getCurrentPrice()), productUrl.getHost()); // Use UnsignedLongs to convert OfferId to avoid overflow. @@ -217,9 +217,9 @@ if (TextUtils.isEmpty(actionId)) return null; Context context = ContextUtils.getApplicationContext(); if (PriceDropNotificationManagerImpl.ACTION_ID_VISIT_SITE.equals(actionId)) { - return context.getString(R.string.price_drop_notification_action_visit_site); + return context.getString(R.string.price_drop_popup_action_button); } else if (PriceDropNotificationManagerImpl.ACTION_ID_TURN_OFF_ALERT.equals(actionId)) { - return context.getString(R.string.price_drop_notification_action_turn_off_alert); + return context.getString(R.string.price_drop_popup_untrack_button); } return null; }
diff --git a/chrome/browser/commerce/price_tracking/android/javatests/src/org/chromium/chrome/browser/price_tracking/PriceTrackingNotificationBridgeUnitTest.java b/chrome/browser/commerce/price_tracking/android/javatests/src/org/chromium/chrome/browser/price_tracking/PriceTrackingNotificationBridgeUnitTest.java index c9e15af..ecfc5b3 100644 --- a/chrome/browser/commerce/price_tracking/android/javatests/src/org/chromium/chrome/browser/price_tracking/PriceTrackingNotificationBridgeUnitTest.java +++ b/chrome/browser/commerce/price_tracking/android/javatests/src/org/chromium/chrome/browser/price_tracking/PriceTrackingNotificationBridgeUnitTest.java
@@ -55,7 +55,7 @@ private static final String ACTION_ID_0 = "visit_site"; private static final String ACTION_ID_1 = "turn_off_alert"; private static final String ACTION_TEXT_0 = "Visit site"; - private static final String ACTION_TEXT_1 = "Stop tracking product"; + private static final String ACTION_TEXT_1 = "Untrack price"; private PriceTrackingNotificationBridge mPriceTrackingNotificationBridge;
diff --git a/chrome/browser/devtools/devtools_window.cc b/chrome/browser/devtools/devtools_window.cc index a48682b..9269e4f 100644 --- a/chrome/browser/devtools/devtools_window.cc +++ b/chrome/browser/devtools/devtools_window.cc
@@ -847,10 +847,9 @@ content::NavigationHandle* handle) { WebContents* web_contents = handle->GetWebContents(); if (!web_contents || !web_contents->HasLiveOriginalOpenerChain() || - (web_contents->GetController().GetLastCommittedEntry() && - !web_contents->GetController() - .GetLastCommittedEntry() - ->IsInitialEntry())) { + !web_contents->GetController() + .GetLastCommittedEntry() + ->IsInitialEntry()) { return nullptr; }
diff --git a/chrome/browser/download/download_danger_prompt.cc b/chrome/browser/download/download_danger_prompt.cc index b435573..58f7169d4 100644 --- a/chrome/browser/download/download_danger_prompt.cc +++ b/chrome/browser/download/download_danger_prompt.cc
@@ -7,6 +7,7 @@ #include "base/metrics/histogram_functions.h" #include "base/strings/stringprintf.h" #include "chrome/browser/browser_process.h" +#include "chrome/browser/download/download_item_warning_data.h" #include "chrome/browser/safe_browsing/download_protection/download_protection_service.h" #include "chrome/browser/safe_browsing/download_protection/download_protection_util.h" #include "chrome/browser/safe_browsing/safe_browsing_service.h" @@ -61,3 +62,22 @@ file_type_uma_value); } } + +void DownloadDangerPrompt::RecordDownloadWarningEvent( + Action action, + download::DownloadItem* download) { + DownloadItemWarningData::WarningAction warning_action; + switch (action) { + case Action::ACCEPT: + warning_action = DownloadItemWarningData::PROCEED; + break; + case Action::CANCEL: + warning_action = DownloadItemWarningData::CANCEL; + break; + case Action::DISMISS: + warning_action = DownloadItemWarningData::CLOSE; + break; + } + DownloadItemWarningData::AddWarningActionEvent( + download, DownloadItemWarningData::DOWNLOAD_PROMPT, warning_action); +}
diff --git a/chrome/browser/download/download_danger_prompt.h b/chrome/browser/download/download_danger_prompt.h index d307302..e6565a68 100644 --- a/chrome/browser/download/download_danger_prompt.h +++ b/chrome/browser/download/download_danger_prompt.h
@@ -70,6 +70,9 @@ bool did_proceed, const download::DownloadItem& download); + // Records warning action event consumed by Safe Browsing reports. + static void RecordDownloadWarningEvent(Action action, + download::DownloadItem* download); }; #endif // CHROME_BROWSER_DOWNLOAD_DOWNLOAD_DANGER_PROMPT_H_
diff --git a/chrome/browser/extensions/api/developer_private/developer_private_api.cc b/chrome/browser/extensions/api/developer_private/developer_private_api.cc index 11dee235..28bea4c6 100644 --- a/chrome/browser/extensions/api/developer_private/developer_private_api.cc +++ b/chrome/browser/extensions/api/developer_private/developer_private_api.cc
@@ -874,8 +874,7 @@ params.fetch_priority = DownloadFetchPriority::kForeground; params.install_immediately = true; params.callback = - base::BindOnce(&DeveloperPrivateAutoUpdateFunction::OnComplete, - base::RetainedRef(this)); + base::BindOnce(&DeveloperPrivateAutoUpdateFunction::OnComplete, this); updater->CheckNow(std::move(params)); } return RespondLater(); @@ -912,8 +911,7 @@ info_generator_->CreateExtensionsInfo( include_disabled, include_terminated, base::BindOnce( - &DeveloperPrivateGetExtensionsInfoFunction::OnInfosGenerated, - base::RetainedRef(this))); + &DeveloperPrivateGetExtensionsInfoFunction::OnInfosGenerated, this)); return RespondLater(); } @@ -941,8 +939,7 @@ info_generator_->CreateExtensionInfo( params->id, base::BindOnce( - &DeveloperPrivateGetExtensionInfoFunction::OnInfosGenerated, - base::RetainedRef(this))); + &DeveloperPrivateGetExtensionInfoFunction::OnInfosGenerated, this)); return RespondLater(); } @@ -973,8 +970,7 @@ extensions::path_util::CalculateAndFormatExtensionDirectorySize( extension->path(), IDS_APPLICATION_INFO_SIZE_SMALL_LABEL, base::BindOnce( - &DeveloperPrivateGetExtensionSizeFunction::OnSizeCalculated, - base::RetainedRef(this))); + &DeveloperPrivateGetExtensionSizeFunction::OnSizeCalculated, this)); return RespondLater(); } @@ -996,7 +992,7 @@ info_generator_->CreateExtensionsInfo( params->include_disabled, params->include_terminated, base::BindOnce(&DeveloperPrivateGetItemsInfoFunction::OnInfosGenerated, - base::RetainedRef(this))); + this)); return RespondLater(); } @@ -2211,7 +2207,7 @@ new_host_permissions.Clone()), base::BindOnce(&DeveloperPrivateAddHostPermissionFunction:: OnRuntimePermissionsGranted, - base::RetainedRef(this))); + this)); return did_respond() ? AlreadyResponded() : RespondLater(); } @@ -2260,7 +2256,7 @@ *extension, *permissions_to_remove, base::BindOnce(&DeveloperPrivateRemoveHostPermissionFunction:: OnRuntimePermissionsRevoked, - base::RetainedRef(this))); + this)); return did_respond() ? AlreadyResponded() : RespondLater(); }
diff --git a/chrome/browser/extensions/api/passwords_private/passwords_private_api.cc b/chrome/browser/extensions/api/passwords_private/passwords_private_api.cc index b5bbcfb0..4f7c4df 100644 --- a/chrome/browser/extensions/api/passwords_private/passwords_private_api.cc +++ b/chrome/browser/extensions/api/passwords_private/passwords_private_api.cc
@@ -364,7 +364,7 @@ GetDelegate(browser_context()) ->RefreshScriptsIfNecessary(base::BindOnce( &PasswordsPrivateRefreshScriptsIfNecessaryFunction::OnRefreshed, - base::RetainedRef(this))); + this)); // OnRefreshed() might respond before we reach this point. return did_respond() ? AlreadyResponded() : RespondLater(); @@ -430,7 +430,7 @@ parameters->credential, base::BindOnce(&PasswordsPrivateStartAutomatedPasswordChangeFunction:: OnResultReceived, - base::RetainedRef(this))); + this)); // `OnResultReceived()` might respond before we reach this point. return did_respond() ? AlreadyResponded() : RespondLater();
diff --git a/chrome/browser/extensions/api/permissions/permissions_api.cc b/chrome/browser/extensions/api/permissions/permissions_api.cc index 523e0e6..b1669bc 100644 --- a/chrome/browser/extensions/api/permissions/permissions_api.cc +++ b/chrome/browser/extensions/api/permissions/permissions_api.cc
@@ -169,7 +169,7 @@ .RevokeOptionalPermissions( *extension(), *permissions_to_revoke, PermissionsUpdater::REMOVE_SOFT, base::BindOnce( - &PermissionsRemoveFunction::Respond, base::RetainedRef(this), + &PermissionsRemoveFunction::Respond, this, ArgumentList(api::permissions::Remove::Results::Create(true)))); return did_respond() ? AlreadyResponded() : RespondLater(); } @@ -339,8 +339,7 @@ install_ui_ = std::make_unique<ExtensionInstallPrompt>( Profile::FromBrowserContext(browser_context()), native_window); install_ui_->ShowDialog( - base::BindOnce(&PermissionsRequestFunction::OnInstallPromptDone, - base::RetainedRef(this)), + base::BindOnce(&PermissionsRequestFunction::OnInstallPromptDone, this), extension(), nullptr, std::make_unique<ExtensionInstallPrompt::Prompt>( ExtensionInstallPrompt::PERMISSIONS_PROMPT), @@ -367,14 +366,13 @@ permissions_updater.GrantRuntimePermissions( *extension(), *requested_withheld_, base::BindOnce(&PermissionsRequestFunction::OnRuntimePermissionsGranted, - base::RetainedRef(this))); + this)); } if (requesting_optional_permissions_) { permissions_updater.GrantOptionalPermissions( *extension(), *requested_optional_, base::BindOnce( - &PermissionsRequestFunction::OnOptionalPermissionsGranted, - base::RetainedRef(this))); + &PermissionsRequestFunction::OnOptionalPermissionsGranted, this)); } // Grant{Runtime|Optional}Permissions calls above can finish synchronously.
diff --git a/chrome/browser/extensions/extension_action_runner.cc b/chrome/browser/extensions/extension_action_runner.cc index 7704787..d60b180 100644 --- a/chrome/browser/extensions/extension_action_runner.cc +++ b/chrome/browser/extensions/extension_action_runner.cc
@@ -426,10 +426,10 @@ content::NavigationEntry* visible_entry = web_contents()->GetController().GetVisibleEntry(); - // Refuse to run if there's no visible entry that is not the initial - // NavigationEntry, because we have no way of determining if it's the proper - // page. This should rarely, if ever, happen. - if (!visible_entry || visible_entry->IsInitialEntry()) + // Refuse to run if the visible entry is the initial NavigationEntry, because + // we have no way of determining if it's the proper page. This should rarely, + // if ever, happen. + if (visible_entry->IsInitialEntry()) return; // We add this to the list of permitted extensions and erase pending entries
diff --git a/chrome/browser/favicon/content_favicon_driver_browsertest.cc b/chrome/browser/favicon/content_favicon_driver_browsertest.cc index 0bc95da0..4439481 100644 --- a/chrome/browser/favicon/content_favicon_driver_browsertest.cc +++ b/chrome/browser/favicon/content_favicon_driver_browsertest.cc
@@ -365,7 +365,7 @@ auto* web_contents = content::WebContents::FromRenderFrameHost(rfh); content::NavigationEntry* current_entry = web_contents->GetController().GetLastCommittedEntry(); - if (!current_entry || current_entry->IsInitialEntry()) { + if (current_entry->IsInitialEntry()) { did_update_favicon_url_with_no_committed_navigation_ = true; } }
diff --git a/chrome/browser/feed/web_feed_page_information_fetcher.cc b/chrome/browser/feed/web_feed_page_information_fetcher.cc index 3d71f85..29171d8 100644 --- a/chrome/browser/feed/web_feed_page_information_fetcher.cc +++ b/chrome/browser/feed/web_feed_page_information_fetcher.cc
@@ -47,13 +47,13 @@ auto self = base::MakeRefCounted<WebFeedPageInformationFetcher>( page_info, std::move(callback)); - FetchRssLinks(page_info.url, page_info.web_contents, - base::BindOnce(&WebFeedPageInformationFetcher::OnRssFetched, - base::RetainedRef(self.get()))); + FetchRssLinks( + page_info.url, page_info.web_contents, + base::BindOnce(&WebFeedPageInformationFetcher::OnRssFetched, self)); FetchPageCanonicalUrl( page_info, base::BindOnce(&WebFeedPageInformationFetcher::OnCanonicalUrlFetched, - base::RetainedRef(self.get()))); + self)); } WebFeedPageInformationFetcher::WebFeedPageInformationFetcher(
diff --git a/chrome/browser/flag-metadata.json b/chrome/browser/flag-metadata.json index e9c9a630..2a1b35d 100644 --- a/chrome/browser/flag-metadata.json +++ b/chrome/browser/flag-metadata.json
@@ -821,6 +821,16 @@ "expiry_milestone": 110 }, { + "name": "cast-streaming-hardware-h264", + "owners": [ "jophba", "openscreen-eng" ], + "expiry_milestone": 121 + }, + { + "name": "cast-streaming-hardware-vp8", + "owners": [ "jophba", "openscreen-eng" ], + "expiry_milestone": 121 + }, + { "name": "cct-brand-transparency", "owners": [ "wenyufu" ], "expiry_milestone": 110 @@ -3696,7 +3706,7 @@ { "name": "files-inline-sync-status", "owners": [ "simmonsjosh@google.com", "benhartney@google.com", "msalomao" ], - "expiry_milestone": 110 + "expiry_milestone": 111 }, { "name": "files-search-v2", @@ -3750,11 +3760,6 @@ "expiry_milestone": 110 }, { - "name": "force-enable-cast-remoting-query", - "owners": [ "rwkeane@google.com", "openscreen-eng@google.com" ], - "expiry_milestone": 115 - }, - { "name": "force-enable-fast-checkout-capabilities", "owners": [ "vizcay@google.com", "bwolfgang@google.com", "jkeitel@google.com" ], "expiry_milestone": 115 @@ -6014,6 +6019,11 @@ "expiry_milestone": 115 }, { + "name": "scrollable-tabstrip-overflow", + "owners": [ "chrome-desktop-ui-sea@google.com", "dpenning" ], + "expiry_milestone": 115 + }, + { "name": "scrollable-tabstrip-with-dragging", "owners": [ "chrome-desktop-ui-sea@google.com", "shibalik" ], "expiry_milestone": 115
diff --git a/chrome/browser/flag_descriptions.cc b/chrome/browser/flag_descriptions.cc index 1403549..ec684c1 100644 --- a/chrome/browser/flag_descriptions.cc +++ b/chrome/browser/flag_descriptions.cc
@@ -1518,16 +1518,32 @@ "be used for negotiating and executing mirroring and remoting sessions."; const char kCastStreamingAv1Name[] = - "Enable AV1 codec video encoding in Cast mirroring sessions"; + "Enable AV1 video encoding for Cast Streaming"; const char kCastStreamingAv1Description[] = - "Enables the inclusion of AV1 codec video encoding in Cast mirroring " - "session negotiations."; + "Offers the AV1 video codec when negotiating Cast Streaming, and uses AV1 " + "if selected for the session."; + +const char kCastStreamingHardwareH264Name[] = + "Toggle hardware accelerated H.264 video encoding for Cast Streaming"; +const char kCastStreamingHardwareH264Description[] = + "The default is to allow hardware H.264 encoding when recommended for the " + "platform. If enabled, hardware H.264 encoding will always be allowed when " + "supported by the platform. If disabled, hardware H.264 encoding will " + "never be used."; + +const char kCastStreamingHardwareVp8Name[] = + "Toggle hardware accelerated VP8 video encoding for Cast Streaming"; +const char kCastStreamingHardwareVp8Description[] = + "The default is to allow hardware VP8 encoding when recommended for the " + "platform. If enabled, hardware VP8 encoding will always be allowed when " + "supported by the platform (regardless of recommendation). If disabled, " + "hardware VP8 encoding will never be used."; const char kCastStreamingVp9Name[] = - "Enable VP9 codec video encoding in Cast mirroring sessions"; + "Enable VP9 video encoding for Cast Streaming"; const char kCastStreamingVp9Description[] = - "Enables the inclusion of VP9 codec video encoding in Cast mirroring " - "session negotiations."; + "Offers the VP9 video codec when negotiating Cast Streaming, and uses VP9 " + "if selected for the session."; const char kGpuRasterizationName[] = "GPU rasterization"; const char kGpuRasterizationDescription[] = "Use GPU to rasterize web content."; @@ -2590,6 +2606,13 @@ "Scrolls the tabstrip while dragging tabs towards the end of the visible " "view."; +const char kScrollableTabStripOverflowFlagId[] = "scrollable-tabstrip-overflow"; +const char kScrollableTabStripOverflowName[] = + "Tab Scrolling Overflow Indicator"; +const char kScrollableTabStripOverflowDescription[] = + "Choices for overflow indicators shown when the tabstrip is in scrolling " + "mode."; + const char kSplitTabStripName[] = "Split TabStrip"; const char kSplitTabStripDescription[] = "Splits pinned and unpinned tabs into separate TabStrips under the hood. "
diff --git a/chrome/browser/flag_descriptions.h b/chrome/browser/flag_descriptions.h index 06daf85..0b6687f 100644 --- a/chrome/browser/flag_descriptions.h +++ b/chrome/browser/flag_descriptions.h
@@ -855,6 +855,12 @@ extern const char kCastStreamingAv1Name[]; extern const char kCastStreamingAv1Description[]; +extern const char kCastStreamingHardwareH264Name[]; +extern const char kCastStreamingHardwareH264Description[]; + +extern const char kCastStreamingHardwareVp8Name[]; +extern const char kCastStreamingHardwareVp8Description[]; + extern const char kCastStreamingVp9Name[]; extern const char kCastStreamingVp9Description[]; @@ -1456,6 +1462,10 @@ extern const char kScrollableTabStripWithDraggingName[]; extern const char kScrollableTabStripWithDraggingDescription[]; +extern const char kScrollableTabStripOverflowFlagId[]; +extern const char kScrollableTabStripOverflowName[]; +extern const char kScrollableTabStripOverflowDescription[]; + extern const char kSplitTabStripName[]; extern const char kSplitTabStripDescription[];
diff --git a/chrome/browser/media/cast_mirroring_service_host.cc b/chrome/browser/media/cast_mirroring_service_host.cc index 9e9a235..6f0229e 100644 --- a/chrome/browser/media/cast_mirroring_service_host.cc +++ b/chrome/browser/media/cast_mirroring_service_host.cc
@@ -10,6 +10,7 @@ #include "base/bind.h" #include "base/callback.h" #include "base/callback_helpers.h" +#include "base/command_line.h" #include "base/logging.h" #include "base/memory/read_only_shared_memory_region.h" #include "base/memory/ref_counted.h" @@ -38,6 +39,7 @@ #include "content/public/browser/video_capture_device_launcher.h" #include "content/public/browser/web_contents.h" #include "media/audio/audio_device_description.h" +#include "media/base/media_switches.h" #include "media/mojo/mojom/audio_data_pipe.mojom.h" #include "media/mojo/mojom/audio_input_stream.mojom.h" #include "media/mojo/mojom/audio_processing.mojom.h" @@ -64,6 +66,13 @@ // Default resolution constraint. constexpr gfx::Size kMaxResolution(1920, 1080); +// Command line arguments that should be passed to the mirroring service. +static const char* kPassthroughSwitches[]{ + switches::kCastStreamingForceEnableHardwareH264, + switches::kCastStreamingForceDisableHardwareH264, + switches::kCastStreamingForceEnableHardwareVp8, + switches::kCastStreamingForceDisableHardwareVp8}; + void CreateVideoCaptureHostOnIO( const std::string& device_id, blink::mojom::MediaStreamType type, @@ -192,12 +201,25 @@ return; } + // Although the base::Features get propagated to the mirroring service, the + // command line flags do not. + const base::CommandLine& command_line = + *base::CommandLine::ForCurrentProcess(); + std::vector<std::string> extra_switches; + + for (const char* passthrough_switch : kPassthroughSwitches) { + if (command_line.HasSwitch(passthrough_switch)) { + extra_switches.emplace_back(passthrough_switch); + } + } + // Launch and connect to the Mirroring Service. The process will run until // |mirroring_service_| is reset. content::ServiceProcessHost::Launch( mirroring_service_.BindNewPipeAndPassReceiver(), content::ServiceProcessHost::Options() .WithDisplayName("Mirroring Service") + .WithExtraCommandLineSwitches(extra_switches) .Pass()); mojo::PendingRemote<mojom::ResourceProvider> provider; resource_provider_receiver_.Bind(provider.InitWithNewPipeAndPassReceiver());
diff --git a/chrome/browser/media/history/media_history_keyed_service.cc b/chrome/browser/media/history/media_history_keyed_service.cc index c11cfb0..35779f7 100644 --- a/chrome/browser/media/history/media_history_keyed_service.cc +++ b/chrome/browser/media/history/media_history_keyed_service.cc
@@ -36,8 +36,8 @@ local_(new MediaHistoryStore(profile, db_task_runner)), db_task_runner_(db_task_runner) { local_->db_task_runner_->PostTask( - FROM_HERE, base::BindOnce(&MediaHistoryStore::Initialize, - base::RetainedRef(local_), should_reset)); + FROM_HERE, + base::BindOnce(&MediaHistoryStore::Initialize, local_, should_reset)); } explicit StoreHolder(Profile* profile, MediaHistoryKeyedService* remote)
diff --git a/chrome/browser/picture_in_picture/document_picture_in_picture_window_controller_browsertest.cc b/chrome/browser/picture_in_picture/document_picture_in_picture_window_controller_browsertest.cc index a3f321f..60dc22ee 100644 --- a/chrome/browser/picture_in_picture/document_picture_in_picture_window_controller_browsertest.cc +++ b/chrome/browser/picture_in_picture/document_picture_in_picture_window_controller_browsertest.cc
@@ -19,7 +19,10 @@ #include "chrome/browser/platform_util.h" #include "chrome/browser/ui/browser.h" #include "chrome/browser/ui/browser_commands.h" +#include "chrome/browser/ui/browser_window.h" #include "chrome/browser/ui/tabs/tab_strip_model.h" +#include "chrome/browser/ui/views/frame/browser_view.h" +#include "chrome/browser/ui/views/frame/picture_in_picture_browser_frame_view.h" #include "chrome/browser/ui/web_applications/app_browser_controller.h" #include "chrome/browser/ui/web_applications/test/web_app_browsertest_util.h" #include "chrome/browser/ui/web_applications/web_app_controller_browsertest.h" @@ -339,6 +342,47 @@ window_controller()->GetWindowBounds()); } +#if BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_WIN) +// Document PiP is not supported in Lacros yet. +// Back to tab button (PictureInPictureBrowserFrameView) is not available +// in Windows yet. +#define MAYBE_FocusInitiatorWhenBackToTab DISABLED_FocusInitiatorWhenBackToTab +#else +#define MAYBE_FocusInitiatorWhenBackToTab FocusInitiatorWhenBackToTab +#endif +IN_PROC_BROWSER_TEST_F(DocumentPictureInPictureWindowControllerBrowserTest, + MAYBE_FocusInitiatorWhenBackToTab) { + LoadTabAndEnterPictureInPicture(browser()); + auto* opener_web_contents = window_controller()->GetWebContents(); + + // Open a new tab. + GURL test_page_url = ui_test_utils::GetTestUrl( + base::FilePath(base::FilePath::kCurrentDirectory), + base::FilePath(kPictureInPictureDocumentPipPage)); + ASSERT_TRUE(ui_test_utils::NavigateToURLWithDisposition( + browser(), test_page_url, WindowOpenDisposition::NEW_FOREGROUND_TAB, + ui_test_utils::BROWSER_TEST_WAIT_FOR_LOAD_STOP)); + EXPECT_NE(browser()->tab_strip_model()->GetActiveWebContents(), + opener_web_contents); + + auto* web_contents = window_controller()->GetChildWebContents(); + ASSERT_TRUE(web_contents); + + auto* browser_view = static_cast<BrowserView*>( + BrowserWindow::FindBrowserWindowWithWebContents(web_contents)); + ASSERT_TRUE(browser_view); + + auto* pip_frame_view = static_cast<PictureInPictureBrowserFrameView*>( + browser_view->frame()->GetFrameView()); + ASSERT_TRUE(pip_frame_view); + + ClickButton( + views::Button::AsButton(pip_frame_view->GetBackToTabButtonForTesting())); + EXPECT_FALSE(window_controller()->GetChildWebContents()); + EXPECT_EQ(browser()->tab_strip_model()->GetActiveWebContents(), + opener_web_contents); +} + // Make sure that document PiP fails without a secure context. // Unlike other tests, this one does work on Lacros. // TODO(crbug.com/1328840): Consider replacing this with a web platform test.
diff --git a/chrome/browser/picture_in_picture/picture_in_picture_window_manager.cc b/chrome/browser/picture_in_picture/picture_in_picture_window_manager.cc index 84ddcd91d..6cafab8e 100644 --- a/chrome/browser/picture_in_picture/picture_in_picture_window_manager.cc +++ b/chrome/browser/picture_in_picture/picture_in_picture_window_manager.cc
@@ -117,6 +117,11 @@ CloseWindowInternal(); } +void PictureInPictureWindowManager::FocusInitiator() { + if (pip_window_controller_) + pip_window_controller_->FocusInitiator(); +} + content::WebContents* PictureInPictureWindowManager::GetWebContents() const { if (!pip_window_controller_) return nullptr;
diff --git a/chrome/browser/picture_in_picture/picture_in_picture_window_manager.h b/chrome/browser/picture_in_picture/picture_in_picture_window_manager.h index 5128d414..9551965 100644 --- a/chrome/browser/picture_in_picture/picture_in_picture_window_manager.h +++ b/chrome/browser/picture_in_picture/picture_in_picture_window_manager.h
@@ -56,6 +56,9 @@ void ExitPictureInPicture(); + // Called to notify that the initiator web contents should be focused. + void FocusInitiator(); + // Gets the web contents in the opener browser window. content::WebContents* GetWebContents() const;
diff --git a/chrome/browser/policy/login_policy_test_base_browsertest.cc b/chrome/browser/policy/login_policy_test_base_browsertest.cc index eef764d..58d7506 100644 --- a/chrome/browser/policy/login_policy_test_base_browsertest.cc +++ b/chrome/browser/policy/login_policy_test_base_browsertest.cc
@@ -120,7 +120,7 @@ // should be "xkb:fr::fra", enabling "xkb:us::eng" should not be possible, // enabling "xkb:de::ger" should be possible. EXPECT_EQ(2U, ime_state->GetAllowedInputMethodIds().size()); - EXPECT_EQ(2U, ime_state->GetEnabledInputMethods()->size()); + EXPECT_EQ(2U, ime_state->GetEnabledInputMethods().size()); EXPECT_EQ(input_methods[1], ime_state->GetCurrentInputMethod().id()); EXPECT_FALSE(ime_state->EnableInputMethod(input_methods[0])); EXPECT_TRUE(ime_state->EnableInputMethod(input_methods[2]));
diff --git a/chrome/browser/printing/print_job_worker.cc b/chrome/browser/printing/print_job_worker.cc index d6b338aa..ec5d3a5 100644 --- a/chrome/browser/printing/print_job_worker.cc +++ b/chrome/browser/printing/print_job_worker.cc
@@ -514,10 +514,9 @@ // Signal everyone that the page is printed. DCHECK(print_job_); - print_job_->PostTask( - FROM_HERE, - base::BindOnce(&PrintJob::OnPageDone, base::RetainedRef(print_job_.get()), - base::RetainedRef(page))); + print_job_->PostTask(FROM_HERE, + base::BindOnce(&PrintJob::OnPageDone, print_job_, + base::RetainedRef(page))); return true; } #endif // BUILDFLAG(IS_WIN)
diff --git a/chrome/browser/printing/print_job_worker_oop.cc b/chrome/browser/printing/print_job_worker_oop.cc index 10feb4f5..795044e 100644 --- a/chrome/browser/printing/print_job_worker_oop.cc +++ b/chrome/browser/printing/print_job_worker_oop.cc
@@ -190,10 +190,9 @@ << document_oop_->cookie() << " page " << page_index; // Signal everyone that the page is printed. - print_job()->PostTask( - FROM_HERE, - base::BindOnce(&PrintJob::OnPageDone, base::RetainedRef(print_job()), - base::RetainedRef(page))); + print_job()->PostTask(FROM_HERE, + base::BindOnce(&PrintJob::OnPageDone, print_job(), + base::RetainedRef(page))); ++pages_printed_count_; if (pages_printed_count_ == document_oop_->page_count()) {
diff --git a/chrome/browser/resource_coordinator/tab_load_tracker.cc b/chrome/browser/resource_coordinator/tab_load_tracker.cc index 541a1d63..d5d6e33fa 100644 --- a/chrome/browser/resource_coordinator/tab_load_tracker.cc +++ b/chrome/browser/resource_coordinator/tab_load_tracker.cc
@@ -236,8 +236,7 @@ // prerendering, when an already rendered WebContents is swapped in at the // moment of a navigation. content::NavigationController& controller = web_contents->GetController(); - if (controller.GetLastCommittedEntry() && - !controller.GetLastCommittedEntry()->IsInitialEntry() && + if (!controller.GetLastCommittedEntry()->IsInitialEntry() && !controller.IsInitialNavigation() && !controller.NeedsReload()) { loading_state = LOADED; }
diff --git a/chrome/browser/resources/accessibility/accessibility.css b/chrome/browser/resources/accessibility/accessibility.css index 361ff8fb..25532e8 100644 --- a/chrome/browser/resources/accessibility/accessibility.css +++ b/chrome/browser/resources/accessibility/accessibility.css
@@ -24,7 +24,7 @@ } .url { - color: rgb(128, 134, 139); + color: rgb(95, 99, 104); } p { @@ -104,4 +104,4 @@ height: 16px; width: 16px; } -} \ No newline at end of file +}
diff --git a/chrome/browser/resources/chromeos/accessibility/chromevox/BUILD.gn b/chrome/browser/resources/chromeos/accessibility/chromevox/BUILD.gn index 147bab14f..330522ebd 100644 --- a/chrome/browser/resources/chromeos/accessibility/chromevox/BUILD.gn +++ b/chrome/browser/resources/chromeos/accessibility/chromevox/BUILD.gn
@@ -114,6 +114,7 @@ "background/smart_sticky_mode.js", "background/tts_background.js", "background/user_action_monitor.js", + "common/abstract_earcons.js", "common/abstract_tts.js", "common/background_bridge.js", "common/braille/braille_command_data.js", @@ -127,7 +128,6 @@ "common/command_store.js", "common/composite_tts.js", "common/custom_automation_event.js", - "common/earcon_interface.js", "common/event_source_type.js", "common/extension_bridge.js", "common/gesture_command_data.js",
diff --git a/chrome/browser/resources/chromeos/accessibility/chromevox/background/background.js b/chrome/browser/resources/chromeos/accessibility/chromevox/background/background.js index 1cf4137..345722c 100644 --- a/chrome/browser/resources/chromeos/accessibility/chromevox/background/background.js +++ b/chrome/browser/resources/chromeos/accessibility/chromevox/background/background.js
@@ -7,9 +7,9 @@ import {constants} from '../../common/constants.js'; import {CursorRange} from '../../common/cursors/range.js'; import {InstanceChecker} from '../../common/instance_checker.js'; +import {AbstractEarcons} from '../common/abstract_earcons.js'; import {NavBraille} from '../common/braille/nav_braille.js'; import {CompositeTts} from '../common/composite_tts.js'; -import {EarconInterface} from '../common/earcon_interface.js'; import {ExtensionBridge} from '../common/extension_bridge.js'; import {LocaleOutputHelper} from '../common/locale_output_helper.js'; import {Msgs} from '../common/msgs.js'; @@ -64,7 +64,7 @@ /** @private {CursorRange} */ this.currentRange_ = null; - /** @private {!EarconInterface} */ + /** @private {!AbstractEarcons} */ this.earcons_ = new Earcons(); /** @private {boolean} */
diff --git a/chrome/browser/resources/chromeos/accessibility/chromevox/background/chromevox.js b/chrome/browser/resources/chromeos/accessibility/chromevox/background/chromevox.js index 10d06713..cfa11dbc 100644 --- a/chrome/browser/resources/chromeos/accessibility/chromevox/background/chromevox.js +++ b/chrome/browser/resources/chromeos/accessibility/chromevox/background/chromevox.js
@@ -6,14 +6,14 @@ * @fileoverview Defines a global object that holds references to the three * different output engines. */ +import {AbstractEarcons} from '../common/abstract_earcons.js'; import {BrailleInterface} from '../common/braille/braille_interface.js'; -import {EarconInterface} from '../common/earcon_interface.js'; import {TtsInterface} from '../common/tts_interface.js'; export const ChromeVox = { /** @type {BrailleInterface} */ braille: null, - /** @type {EarconInterface} */ + /** @type {AbstractEarcons} */ earcons: null, /** @type {TtsInterface} */ tts: null,
diff --git a/chrome/browser/resources/chromeos/accessibility/chromevox/background/command_handler.js b/chrome/browser/resources/chromeos/accessibility/chromevox/background/command_handler.js index e08ab7c..14c63229 100644 --- a/chrome/browser/resources/chromeos/accessibility/chromevox/background/command_handler.js +++ b/chrome/browser/resources/chromeos/accessibility/chromevox/background/command_handler.js
@@ -13,13 +13,13 @@ import {EventGenerator} from '../../common/event_generator.js'; import {KeyCode} from '../../common/key_code.js'; import {RectUtil} from '../../common/rect_util.js'; +import {Earcon} from '../common/abstract_earcons.js'; import {AbstractTts} from '../common/abstract_tts.js'; import {NavBraille} from '../common/braille/nav_braille.js'; import {BridgeConstants} from '../common/bridge_constants.js'; import {BridgeHelper} from '../common/bridge_helper.js'; import {Command, CommandStore} from '../common/command_store.js'; import {ChromeVoxEvent, CustomAutomationEvent} from '../common/custom_automation_event.js'; -import {Earcon} from '../common/earcon_interface.js'; import {EventSourceType} from '../common/event_source_type.js'; import {GestureGranularity} from '../common/gesture_command_data.js'; import {ChromeVoxKbHandler} from '../common/keyboard_handler.js';
diff --git a/chrome/browser/resources/chromeos/accessibility/chromevox/background/earcon_engine.js b/chrome/browser/resources/chromeos/accessibility/chromevox/background/earcon_engine.js index 8486b77..bdc8629 100644 --- a/chrome/browser/resources/chromeos/accessibility/chromevox/background/earcon_engine.js +++ b/chrome/browser/resources/chromeos/accessibility/chromevox/background/earcon_engine.js
@@ -8,7 +8,7 @@ * rest of the code. */ -import {Earcon} from '../common/earcon_interface.js'; +import {Earcon} from '../common/abstract_earcons.js'; /** EarconEngine generates ChromeVox's earcons using the web audio API. */ export class EarconEngine {
diff --git a/chrome/browser/resources/chromeos/accessibility/chromevox/background/earcons.js b/chrome/browser/resources/chromeos/accessibility/chromevox/background/earcons.js index 487d2ca..49dd7829 100644 --- a/chrome/browser/resources/chromeos/accessibility/chromevox/background/earcons.js +++ b/chrome/browser/resources/chromeos/accessibility/chromevox/background/earcons.js
@@ -7,14 +7,14 @@ * auditory cues. */ -import {Earcon, EarconInterface} from '../common/earcon_interface.js'; +import {AbstractEarcons, Earcon} from '../common/abstract_earcons.js'; import {LogType} from '../common/log_types.js'; import {ChromeVoxState} from './chromevox_state.js'; import {EarconEngine} from './earcon_engine.js'; import {LogStore} from './logging/log_store.js'; -export class Earcons extends EarconInterface { +export class Earcons extends AbstractEarcons { constructor() { super(); @@ -38,16 +38,6 @@ } } - /** @override */ - get enabled() { - return localStorage['earcons'] === 'true'; - } - - /** @override */ - set enabled(value) { - localStorage['earcons'] = value; - } - /** * @return {string} The human-readable name of the earcon set. */
diff --git a/chrome/browser/resources/chromeos/accessibility/chromevox/background/output/output_types.js b/chrome/browser/resources/chromeos/accessibility/chromevox/background/output/output_types.js index 2e2e284..2d474a70 100644 --- a/chrome/browser/resources/chromeos/accessibility/chromevox/background/output/output_types.js +++ b/chrome/browser/resources/chromeos/accessibility/chromevox/background/output/output_types.js
@@ -6,7 +6,7 @@ * @fileoverview Definitions of all types related to output. */ -import {Earcon} from '../../common/earcon_interface.js'; +import {Earcon} from '../../common/abstract_earcons.js'; import {Spannable} from '../../common/spannable.js'; import {ChromeVox} from '../chromevox.js';
diff --git a/chrome/browser/resources/chromeos/accessibility/chromevox/background/page_load_sound_handler.js b/chrome/browser/resources/chromeos/accessibility/chromevox/background/page_load_sound_handler.js index 1e6b45cf..2fcb21f 100644 --- a/chrome/browser/resources/chromeos/accessibility/chromevox/background/page_load_sound_handler.js +++ b/chrome/browser/resources/chromeos/accessibility/chromevox/background/page_load_sound_handler.js
@@ -7,8 +7,8 @@ */ import {AutomationUtil} from '../../common/automation_util.js'; import {constants} from '../../common/constants.js'; +import {Earcon} from '../common/abstract_earcons.js'; import {ChromeVoxEvent} from '../common/custom_automation_event.js'; -import {Earcon} from '../common/earcon_interface.js'; import {BaseAutomationHandler} from './base_automation_handler.js'; import {ChromeVox} from './chromevox.js';
diff --git a/chrome/browser/resources/chromeos/accessibility/chromevox/background/panel/panel_background.js b/chrome/browser/resources/chromeos/accessibility/chromevox/background/panel/panel_background.js index 9be8949..19a29d9 100644 --- a/chrome/browser/resources/chromeos/accessibility/chromevox/background/panel/panel_background.js +++ b/chrome/browser/resources/chromeos/accessibility/chromevox/background/panel/panel_background.js
@@ -8,9 +8,9 @@ */ import {constants} from '../../../common/constants.js'; import {CursorRange} from '../../../common/cursors/range.js'; +import {Earcon} from '../../common/abstract_earcons.js'; import {BridgeConstants} from '../../common/bridge_constants.js'; import {BridgeHelper} from '../../common/bridge_helper.js'; -import {Earcon} from '../../common/earcon_interface.js'; import {PanelBridge} from '../../common/panel_bridge.js'; import {ALL_PANEL_MENU_NODE_DATA} from '../../common/panel_menu_data.js'; import {QueueMode} from '../../common/tts_types.js';
diff --git a/chrome/browser/resources/chromeos/accessibility/chromevox/background/pointer_handler.js b/chrome/browser/resources/chromeos/accessibility/chromevox/background/pointer_handler.js index 43bcd82..ce6c252e 100644 --- a/chrome/browser/resources/chromeos/accessibility/chromevox/background/pointer_handler.js +++ b/chrome/browser/resources/chromeos/accessibility/chromevox/background/pointer_handler.js
@@ -8,8 +8,8 @@ */ import {AutomationPredicate} from '../../common/automation_predicate.js'; import {EventGenerator} from '../../common/event_generator.js'; +import {Earcon} from '../common/abstract_earcons.js'; import {CustomAutomationEvent} from '../common/custom_automation_event.js'; -import {Earcon} from '../common/earcon_interface.js'; import {QueueMode} from '../common/tts_types.js'; import {BaseAutomationHandler} from './base_automation_handler.js';
diff --git a/chrome/browser/resources/chromeos/accessibility/chromevox/background/smart_sticky_mode.js b/chrome/browser/resources/chromeos/accessibility/chromevox/background/smart_sticky_mode.js index fb9f94b..5172eba 100644 --- a/chrome/browser/resources/chromeos/accessibility/chromevox/background/smart_sticky_mode.js +++ b/chrome/browser/resources/chromeos/accessibility/chromevox/background/smart_sticky_mode.js
@@ -9,7 +9,7 @@ */ import {AutomationUtil} from '../../common/automation_util.js'; import {CursorRange} from '../../common/cursors/range.js'; -import {Earcon} from '../common/earcon_interface.js'; +import {Earcon} from '../common/abstract_earcons.js'; import {ChromeVox} from './chromevox.js'; import {ChromeVoxState, ChromeVoxStateObserver} from './chromevox_state.js';
diff --git a/chrome/browser/resources/chromeos/accessibility/chromevox/common/earcon_interface.js b/chrome/browser/resources/chromeos/accessibility/chromevox/common/abstract_earcons.js similarity index 89% rename from chrome/browser/resources/chromeos/accessibility/chromevox/common/earcon_interface.js rename to chrome/browser/resources/chromeos/accessibility/chromevox/common/abstract_earcons.js index 3bbc0bd..c2d2864 100644 --- a/chrome/browser/resources/chromeos/accessibility/chromevox/common/earcon_interface.js +++ b/chrome/browser/resources/chromeos/accessibility/chromevox/common/abstract_earcons.js
@@ -4,9 +4,15 @@ /** * @fileoverview Base class for implementing earcons. + * + * When adding earcons, please add them to getEarconName and getEarconId. + * */ -/** @enum {string} Earcon names. */ +/** + * Earcon names. + * @enum {string} + */ export const Earcon = { ALERT_MODAL: 'alert_modal', ALERT_NONMODAL: 'alert_nonmodal', @@ -65,7 +71,7 @@ }; -export class EarconInterface { +export class AbstractEarcons { /** * Plays the specified earcon sound. * @param {Earcon} earcon An earcon identifier. @@ -84,17 +90,23 @@ * Whether or not earcons are available. * @return {boolean} True if earcons are available. */ - earconsAvailable() {} + earconsAvailable() { + return true; + } /** * Whether or not earcons are enabled. * @return {boolean} True if earcons are enabled. */ - get enabled() {} + get enabled() { + return localStorage['earcons'] === 'true'; + } /** * Set whether or not earcons are enabled. * @param {boolean} value True turns on earcons, false turns off earcons. */ - set enabled(value) {} + set enabled(value) { + localStorage['earcons'] = value; + } }
diff --git a/chrome/browser/resources/chromeos/accessibility/chromevox/testing/chromevox_e2e_test_base.js b/chrome/browser/resources/chromeos/accessibility/chromevox/testing/chromevox_e2e_test_base.js index 0f01b19..70f348e 100644 --- a/chrome/browser/resources/chromeos/accessibility/chromevox/testing/chromevox_e2e_test_base.js +++ b/chrome/browser/resources/chromeos/accessibility/chromevox/testing/chromevox_e2e_test_base.js
@@ -55,7 +55,7 @@ await importModule( 'NavBraille', '/chromevox/common/braille/nav_braille.js'); await importModule( - ['Earcon', 'EarconInterface'], '/chromevox/common/earcon_interface.js'); + ['AbstractEarcons', 'Earcon'], '/chromevox/common/abstract_earcons.js'); await importModule('TtsInterface', '/chromevox/common/tts_interface.js'); await importModule('QueueMode', '/chromevox/common/tts_types.js');
diff --git a/chrome/browser/resources/chromeos/accessibility/chromevox/testing/mock_feedback.js b/chrome/browser/resources/chromeos/accessibility/chromevox/testing/mock_feedback.js index f8c64047..0e187a4 100644 --- a/chrome/browser/resources/chromeos/accessibility/chromevox/testing/mock_feedback.js +++ b/chrome/browser/resources/chromeos/accessibility/chromevox/testing/mock_feedback.js
@@ -129,7 +129,7 @@ const MockEarcons = function() {}; MockEarcons.prototype = { - __proto__: EarconInterface.prototype, + __proto__: AbstractEarcons.prototype, playEarcon: this.addEarcon_.bind(this), };
diff --git a/chrome/browser/resources/chromeos/accessibility/chromevox/testing/mock_feedback_test.js b/chrome/browser/resources/chromeos/accessibility/chromevox/testing/mock_feedback_test.js index d5c17d1..752edd93 100644 --- a/chrome/browser/resources/chromeos/accessibility/chromevox/testing/mock_feedback_test.js +++ b/chrome/browser/resources/chromeos/accessibility/chromevox/testing/mock_feedback_test.js
@@ -33,11 +33,11 @@ // Alphabetical based on file path. await importModule('ChromeVox', '/chromevox/background/chromevox.js'); await importModule( + ['AbstractEarcons', 'Earcon'], '/chromevox/common/abstract_earcons.js'); + await importModule( 'BrailleInterface', '/chromevox/common/braille/braille_interface.js'); await importModule( 'NavBraille', '/chromevox/common/braille/nav_braille.js'); - await importModule( - ['Earcon', 'EarconInterface'], '/chromevox/common/earcon_interface.js'); await importModule('Spannable', '/chromevox/common/spannable.js'); await importModule('QueueMode', '/chromevox/common/tts_types.js'); }
diff --git a/chrome/browser/resources/chromeos/cloud_upload/BUILD.gn b/chrome/browser/resources/chromeos/cloud_upload/BUILD.gn index a296ff9..66784fe 100644 --- a/chrome/browser/resources/chromeos/cloud_upload/BUILD.gn +++ b/chrome/browser/resources/chromeos/cloud_upload/BUILD.gn
@@ -15,6 +15,7 @@ web_component_files = [ "base_setup_page.ts", "drive_upload_page.ts", + "file_handler_page.ts", "office_pwa_install_page.ts", "one_drive_upload_page.ts", "welcome_page.ts",
diff --git a/chrome/browser/resources/chromeos/cloud_upload/drive_upload_page.ts b/chrome/browser/resources/chromeos/cloud_upload/drive_upload_page.ts index 8379e46..b6f8502b 100644 --- a/chrome/browser/resources/chromeos/cloud_upload/drive_upload_page.ts +++ b/chrome/browser/resources/chromeos/cloud_upload/drive_upload_page.ts
@@ -35,7 +35,7 @@ } private onContinueButtonClick(): void { - this.proxy.handler.respondAndClose(UserAction.kUpload); + this.proxy.handler.respondAndClose(UserAction.kUploadToGoogleDrive); } private onCancelButtonClick(): void {
diff --git a/chrome/browser/resources/chromeos/cloud_upload/file_handler_page.html b/chrome/browser/resources/chromeos/cloud_upload/file_handler_page.html new file mode 100644 index 0000000..e823e33 --- /dev/null +++ b/chrome/browser/resources/chromeos/cloud_upload/file_handler_page.html
@@ -0,0 +1,92 @@ +<style> + :host { + box-sizing: border-box; + display: flex; + flex-direction: column; + padding: 32px; + width: 512px; + } + + .title { + color: var(--cros-text-color-primary); + font: var(--cros-display-7-font); + margin-block-end: 6px; + } + + .normal-text { + color: var(--cros-text-color-primary); + font: var(--cros-body-1-font); + margin-block-end: 12px; + margin-block-start: 16px; + } + + #button-container { + display: flex; + justify-content: flex-end; + margin-top: 20px; + } + + input[type='radio'] { + opacity: 0; + position: absolute; + } + + .radio-label { + align-items: center; + background-color: var(--cros-ripple-color); + border-radius: 12px; + box-sizing: border-box; + color: var(--cros-text-color-primary); + cursor: pointer; + display: flex; + font: var(--cros-body-1-font); + height: 54px; + } + + .radio-label:has(> input[type='radio']) { + border: 2px solid transparent; + } + + .radio-label:has(> input[type='radio']:checked) { + border: 2px solid var(--cros-color-prominent); + } + + .icon-placeholder { + background-color: white; + border-radius: 50%; + height: 22px; + margin-inline-end: 12px; + margin-inline-start: 20px; + width: 22px; + } +</style> + +<!-- TODO(b:251046594): Use localized strings --> +<div class="title"> + Choose an application to open <span id="file-name"></span>. +</div> +<form> + <div class="normal-text"> + Apps installed on this device + </div> + + <label class="radio-label"> + <input type="radio" name="app-choice" id="drive" value="drive" checked + autofocus> + <div class="icon-placeholder"></div> + <span id="drive-app-name"></span> + </label> + <div class="normal-text"> + Apps available to install + </div> + + <label class="radio-label"> + <input type="radio" name="app-choice" id="onedrive" value="onedrive"> + <div class="icon-placeholder"></div> + Microsoft Office + </label> +</form> +<div id="button-container"> + <cr-button class="cancel-button">Cancel</cr-button> + <cr-button class="action-button">Open</cr-button> +</div> \ No newline at end of file
diff --git a/chrome/browser/resources/chromeos/cloud_upload/file_handler_page.ts b/chrome/browser/resources/chromeos/cloud_upload/file_handler_page.ts new file mode 100644 index 0000000..7953d8a1b --- /dev/null +++ b/chrome/browser/resources/chromeos/cloud_upload/file_handler_page.ts
@@ -0,0 +1,99 @@ +// Copyright 2022 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 {assert} from 'chrome://resources/js/assert_ts.js'; + +import {UserAction} from './cloud_upload.mojom-webui.js'; +import {CloudUploadBrowserProxy} from './cloud_upload_browser_proxy.js'; +import {getTemplate} from './file_handler_page.html.js'; + +/** + * The FileHandlerPageElement represents the setup page the user sees after + * choosing Docs/Sheets/Slides. + */ +export class FileHandlerPageElement extends HTMLElement { + private proxy: CloudUploadBrowserProxy = + CloudUploadBrowserProxy.getInstance(); + + constructor() { + super(); + const shadowRoot = this.attachShadow({mode: 'open'}); + + shadowRoot.innerHTML = getTemplate(); + const openButton = shadowRoot.querySelector<HTMLElement>('.action-button'); + const cancelButton = + shadowRoot.querySelector<HTMLElement>('.cancel-button'); + assert(openButton); + assert(cancelButton); + + openButton.addEventListener('click', () => this.onOpenButtonClick()); + cancelButton.addEventListener('click', () => this.onCancelButtonClick()); + + this.initDynamicContent(); + } + + // Sets the dynamic content of the page like the file name. + async initDynamicContent() { + try { + const dialogArgs = await this.proxy.handler.getDialogArgs(); + assert(dialogArgs.args); + + const fileNameElement = + this.shadowRoot!.querySelector<HTMLSpanElement>('#file-name'); + assert(fileNameElement); + fileNameElement.innerText = dialogArgs.args.fileNames[0] || ''; + + const driveAppNameElement = + this.shadowRoot!.querySelector<HTMLSpanElement>('#drive-app-name'); + assert(driveAppNameElement); + driveAppNameElement.innerText = + this.getDriveAppName(dialogArgs.args.fileNames); + } catch (e) { + // TODO(b:243095484) Define expected behavior. + console.error(`Unable to get dialog arguments . Error: ${e}.`); + } + } + + // Return the names of the specific Google app i.e. Docs/Sheets/Slides that + // will be used to open these files. When there are multiple files of + // different types, or any error finding the right app, we just default to + // Docs. + private getDriveAppName(fileNames: string[]) { + // TODO(b:254586358): i18n these names. + const fileName = fileNames[0] || ''; + if (/\.xlsx?$/.test(fileName)) { + return 'Google Sheets'; + } else if (/\.pptx?$/.test(fileName)) { + return 'Google Slides'; + } else { + return 'Google Docs'; + } + } + + private getUserChoice() { + if (this.shadowRoot!.querySelector<HTMLInputElement>('#drive')!.checked) { + return UserAction.kSetUpGoogleDrive; + } else { + return UserAction.kSetUpOneDrive; + } + } + + private onOpenButtonClick(): void { + this.proxy.handler.respondAndClose(this.getUserChoice()); + } + + private onCancelButtonClick(): void { + this.proxy.handler.respondAndClose(UserAction.kCancel); + } +} + +declare global { + interface HTMLElementTagNameMap { + 'file-handler-page': FileHandlerPageElement; + } +} + +customElements.define('file-handler-page', FileHandlerPageElement); \ No newline at end of file
diff --git a/chrome/browser/resources/chromeos/cloud_upload/main.ts b/chrome/browser/resources/chromeos/cloud_upload/main.ts index 2da0e158..6db2907 100644 --- a/chrome/browser/resources/chromeos/cloud_upload/main.ts +++ b/chrome/browser/resources/chromeos/cloud_upload/main.ts
@@ -4,6 +4,7 @@ import './cloud_upload_dialog.js'; import './drive_upload_page.js'; +import './file_handler_page.js'; import {assert} from 'chrome://resources/js/assert_ts.js'; @@ -16,7 +17,7 @@ switch (dialogArgs.args.dialogPage) { case DialogPage.kFileHandlerDialog: { - // Do nothing for now. + document.body.append(document.createElement('file-handler-page')); break; } case DialogPage.kOneDriveSetup: {
diff --git a/chrome/browser/resources/chromeos/cloud_upload/office_pwa_install_page.html b/chrome/browser/resources/chromeos/cloud_upload/office_pwa_install_page.html index d7bfac93..6dc45e5c 100644 --- a/chrome/browser/resources/chromeos/cloud_upload/office_pwa_install_page.html +++ b/chrome/browser/resources/chromeos/cloud_upload/office_pwa_install_page.html
@@ -37,6 +37,6 @@ </p> </div> <div slot="button-container"> - <cr-button class="cancel-button">i18n{cancel}</cr-button> + <cr-button class="cancel-button">$i18n{cancel}</cr-button> <cr-button class="action-button icon-button install">Install</cr-button> </div>
diff --git a/chrome/browser/resources/chromeos/cloud_upload/one_drive_upload_page.ts b/chrome/browser/resources/chromeos/cloud_upload/one_drive_upload_page.ts index 5e95d5f7..961c44de 100644 --- a/chrome/browser/resources/chromeos/cloud_upload/one_drive_upload_page.ts +++ b/chrome/browser/resources/chromeos/cloud_upload/one_drive_upload_page.ts
@@ -59,7 +59,7 @@ } private onUploadButtonClick(): void { - this.proxy.handler.respondAndClose(UserAction.kUpload); + this.proxy.handler.respondAndClose(UserAction.kUploadToOneDrive); } private onCancelButtonClick(): void {
diff --git a/chrome/browser/resources/new_tab_page/realbox/realbox_dropdown.ts b/chrome/browser/resources/new_tab_page/realbox/realbox_dropdown.ts index 75e8e2b..008d135a 100644 --- a/chrome/browser/resources/new_tab_page/realbox/realbox_dropdown.ts +++ b/chrome/browser/resources/new_tab_page/realbox/realbox_dropdown.ts
@@ -8,12 +8,11 @@ import 'chrome://resources/cr_elements/cr_icon_button/cr_icon_button.js'; import 'chrome://resources/cr_elements/cr_icons.css.js'; -import {Url} from 'chrome://resources/mojo/url/mojom/url.mojom-webui.js'; import {IronSelectorElement} from 'chrome://resources/polymer/v3_0/iron-selector/iron-selector.js'; import {DomRepeat, PolymerElement} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js'; import {loadTimeData} from '../i18n_setup.js'; -import {AutocompleteMatch, AutocompleteResult, PageCallbackRouter, PageHandlerInterface} from '../realbox.mojom-webui.js'; +import {AutocompleteMatch, AutocompleteResult, PageHandlerInterface} from '../realbox.mojom-webui.js'; import {decodeString16} from '../utils.js'; import {RealboxBrowserProxy} from './realbox_browser_proxy.js'; @@ -92,29 +91,13 @@ private hiddenGroupIds_: number[]; private selectableMatchElements_: Element[]; - private callbackRouter_: PageCallbackRouter; private pageHandler_: PageHandlerInterface; - private autocompleteMatchImageAvailableListenerId_: number|null = null; constructor() { super(); - this.callbackRouter_ = RealboxBrowserProxy.getInstance().callbackRouter; this.pageHandler_ = RealboxBrowserProxy.getInstance().handler; } - override connectedCallback() { - super.connectedCallback(); - this.autocompleteMatchImageAvailableListenerId_ = - this.callbackRouter_.autocompleteMatchImageAvailable.addListener( - this.onAutocompleteMatchImageAvailable_.bind(this)); - } - - override disconnectedCallback() { - super.disconnectedCallback(); - this.callbackRouter_.removeListener( - this.autocompleteMatchImageAvailableListenerId_!); - } - //============================================================================ // Public methods //============================================================================ @@ -171,29 +154,6 @@ // Callbacks //============================================================================ - /** - * @param matchIndex match index - * @param url match imageUrl - * @param dataUrl match image or favicon content in in base64 encoded Data URL - * format. - */ - private onAutocompleteMatchImageAvailable_( - matchIndex: number, url: Url, dataUrl: string) { - if (!this.result || !this.result.matches) { - return; - } - - const match = this.result.matches[matchIndex]; - if (!match) { - return; - } - - // Set image content of the match, if applicable. - if (match.imageUrl === url.url) { - this.set(`result.matches.${matchIndex}.imageDataUrl`, dataUrl); - } - } - private onResultRepaint_() { this.dispatchEvent(new CustomEvent('result-repaint', { bubbles: true,
diff --git a/chrome/browser/resources/new_tab_page/realbox/realbox_icon.html b/chrome/browser/resources/new_tab_page/realbox/realbox_icon.html index fdeea76..13ec9c0 100644 --- a/chrome/browser/resources/new_tab_page/realbox/realbox_icon.html +++ b/chrome/browser/resources/new_tab_page/realbox/realbox_icon.html
@@ -74,8 +74,8 @@ } </style> <div id="container" style="--container-bg-color: - [[containerBgColor_(imageSrc_, match.imageDominantColor)]];"> - <image id="image" src="[[imageSrc_]]"></image> + [[containerBgColor_(match.imageDominantColor, imageLoading_)]];"> + <img id="image" src="[[imageSrc_]]" on-load="onImageLoad_"></img> <!--Note: Do not remove the '$' in '$=' below, otherwise the 'style' attribute is erroneously removed by the HTML minifier. --> <div id="icon" style$="[[iconStyle_]]"></div>
diff --git a/chrome/browser/resources/new_tab_page/realbox/realbox_icon.ts b/chrome/browser/resources/new_tab_page/realbox/realbox_icon.ts index 14c9ffa..c87f1b7 100644 --- a/chrome/browser/resources/new_tab_page/realbox/realbox_icon.ts +++ b/chrome/browser/resources/new_tab_page/realbox/realbox_icon.ts
@@ -12,9 +12,6 @@ const DOCUMENT_MATCH_TYPE: string = 'document'; const HISTORY_CLUSTER_MATCH_TYPE: string = 'history-cluster'; -export type AutocompleteMatchWithImageData = - AutocompleteMatch&{imageDataUrl?: string}; - export interface RealboxIconElement { $: { container: HTMLElement, @@ -99,7 +96,17 @@ imageSrc_: { type: String, - computed: `computeImageSrc_(match.imageDataUrl, match)`, + computed: `computeImageSrc_(match.imageUrl, match)`, + observer: 'onImageSrcChanged_', + }, + + /** + * Flag indicating whether or not an image is loading. This is used to + * show a placeholder color while the image is loading. + */ + imageLoading_: { + type: Boolean, + value: false, }, }; } @@ -112,6 +119,7 @@ match: AutocompleteMatch; private iconStyle_: string; private imageSrc_: string; + private imageLoading_: boolean; //============================================================================ // Helpers @@ -164,29 +172,35 @@ } private computeImageSrc_(): string { - if (!this.match) { + if (!this.match || !this.match.imageUrl) { return ''; } - if ((this.match as AutocompleteMatchWithImageData).imageDataUrl) { - return (this.match as AutocompleteMatchWithImageData).imageDataUrl!; - } else if ( - this.match.imageUrl && this.match.imageUrl.startsWith('data:image/')) { - // zero-prefix matches come with the image content in |match.imageUrl|. + if (this.match.imageUrl.startsWith('data:image/')) { + // Zero-prefix matches come with the image content in |match.imageUrl|. return this.match.imageUrl; - } else { - return ''; } + + return `chrome://image?${this.match.imageUrl}`; } - private containerBgColor_(imageSrc: string, imageDominantColor: string): + private containerBgColor_(imageDominantColor: string, imageLoading: boolean): string { // If the match has an image dominant color, show that color in place of the // image until it loads. This helps the image appear to load more smoothly. - return (!imageSrc && imageDominantColor) ? + return (imageLoading && imageDominantColor) ? // .25 opacity matching c/b/u/views/omnibox/omnibox_match_cell_view.cc. `${imageDominantColor}40` : - ''; + 'transparent'; + } + + private onImageSrcChanged_() { + // If imageSrc_ changes to a new truthy value, a new image is being loaded. + this.imageLoading_ = !!this.imageSrc_; + } + + private onImageLoad_() { + this.imageLoading_ = false; } }
diff --git a/chrome/browser/resources/settings/chromeos/internet_page/BUILD.gn b/chrome/browser/resources/settings/chromeos/internet_page/BUILD.gn index 111f215..43d2f98a 100644 --- a/chrome/browser/resources/settings/chromeos/internet_page/BUILD.gn +++ b/chrome/browser/resources/settings/chromeos/internet_page/BUILD.gn
@@ -19,6 +19,7 @@ ":esim_install_error_dialog", ":esim_remove_profile_dialog", ":esim_rename_dialog", + ":hotspot_subpage", ":hotspot_summary_item", ":internet_config", ":internet_detail_menu", @@ -60,6 +61,7 @@ js_library("hotspot_summary_item") { deps = [ "//ash/webui/common/resources:i18n_behavior", + "//chrome/browser/resources/settings:router", "//third_party/polymer/v3_0/components-chromium/iron-flex-layout:iron-flex-layout-classes", "//third_party/polymer/v3_0/components-chromium/polymer:polymer_bundled", ] @@ -245,6 +247,13 @@ ] } +js_library("hotspot_subpage") { + deps = [ + "//third_party/polymer/v3_0/components-chromium/polymer:polymer_bundled", + ] + externs_list = [] +} + js_library("network_always_on_vpn") { deps = [ ":internet_shared_css", @@ -427,6 +436,7 @@ "esim_install_error_dialog.js", "esim_remove_profile_dialog.js", "esim_rename_dialog.js", + "hotspot_subpage.js", "hotspot_summary_item.js", "internet_config.js", "internet_detail_menu.js",
diff --git a/chrome/browser/resources/settings/chromeos/internet_page/hotspot_subpage.html b/chrome/browser/resources/settings/chromeos/internet_page/hotspot_subpage.html new file mode 100644 index 0000000..f2e6fd5d --- /dev/null +++ b/chrome/browser/resources/settings/chromeos/internet_page/hotspot_subpage.html
@@ -0,0 +1,5 @@ +<style include="settings-shared"> +</style> +<div id="container"> + <!-- TODO(b/239477916): add implementation --> +</div> \ No newline at end of file
diff --git a/chrome/browser/resources/settings/chromeos/internet_page/hotspot_subpage.js b/chrome/browser/resources/settings/chromeos/internet_page/hotspot_subpage.js new file mode 100644 index 0000000..973d495 --- /dev/null +++ b/chrome/browser/resources/settings/chromeos/internet_page/hotspot_subpage.js
@@ -0,0 +1,26 @@ +// Copyright 2022 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +/** + * @fileoverview + * Settings subpage for managing Hotspot. + */ + +import './internet_shared_css.js'; + +import {html, PolymerElement} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js'; + +/** @polymer */ +class SettingsHotspotSubpageElement extends PolymerElement { + static get is() { + return 'settings-hotspot-subpage'; + } + + static get template() { + return html`{__html_template__}`; + } +} + +customElements.define( + SettingsHotspotSubpageElement.is, SettingsHotspotSubpageElement); \ No newline at end of file
diff --git a/chrome/browser/resources/settings/chromeos/internet_page/hotspot_summary_item.html b/chrome/browser/resources/settings/chromeos/internet_page/hotspot_summary_item.html index ffa543f..7e9fe8b5 100644 --- a/chrome/browser/resources/settings/chromeos/internet_page/hotspot_summary_item.html +++ b/chrome/browser/resources/settings/chromeos/internet_page/hotspot_summary_item.html
@@ -10,7 +10,7 @@ <div class="settings-box two-line no-padding"> <div id="hotspotSummaryItemRow" - actionable on-click="onWrapperClick_" + actionable on-click="navigateToDetailPage_" class="flex layout horizontal center link-wrapper"> <iron-icon id="hotspotIcon"> </iron-icon> @@ -22,7 +22,7 @@ class="subpage-arrow layout end" aria-labelledby="hotspotPageTitle" aria-roledescription="$i18n{subpageArrowRoleDescription}" - on-click="onSubpageArrowClick_"> + on-click="navigateToDetailPage_"> </cr-icon-button> </div> </div>
diff --git a/chrome/browser/resources/settings/chromeos/internet_page/hotspot_summary_item.js b/chrome/browser/resources/settings/chromeos/internet_page/hotspot_summary_item.js index b9395ca..399f090 100644 --- a/chrome/browser/resources/settings/chromeos/internet_page/hotspot_summary_item.js +++ b/chrome/browser/resources/settings/chromeos/internet_page/hotspot_summary_item.js
@@ -15,6 +15,9 @@ import {loadTimeData} from 'chrome://resources/js/load_time_data.m.js'; import {html, mixinBehaviors, PolymerElement} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js'; +import {Router} from '../../router.js'; +import {routes} from '../os_route.js'; + /** * @constructor * @extends {PolymerElement} @@ -34,13 +37,8 @@ } /** @private */ - onSubpageArrowClick_() { - // TODO: implementation - } - - /** @private */ - onWrapperClick_() { - // TODO: implementation + navigateToDetailPage_() { + Router.getInstance().navigateTo(routes.HOTSPOT_DETAIL); } }
diff --git a/chrome/browser/resources/settings/chromeos/internet_page/internet_page.html b/chrome/browser/resources/settings/chromeos/internet_page/internet_page.html index a38c25d..c82e72c 100644 --- a/chrome/browser/resources/settings/chromeos/internet_page/internet_page.html +++ b/chrome/browser/resources/settings/chromeos/internet_page/internet_page.html
@@ -15,6 +15,14 @@ --iron-icon-fill-color: var(--text-color); margin-inline-end: 8px; } + #hotspotSubtitle { + color: var(--cr-secondary-text-color); + font-size: inherit; + padding-inline-end: 210px; + position: relative; + left: 56px; + top: -22px; + } </style> <settings-animated-pages id="pages" section="internet" focus-config="[[focusConfig_]]"> @@ -143,6 +151,17 @@ </settings-subpage> </template> + <template is="dom-if" route-path="/hotspotDetail" restamp> + <settings-subpage page-title="$i18n{hotspotPageTitle}"> + <div id="hotspotSubtitle"> + <localized-link + localized-string="[[i18nAdvanced('hotspotSubpageSubtitle')]]"> + </localized-link> + </div> + <settings-hotspot-subpage></settings-hotspot-subpage> + </settings-subpage> + </template> + </settings-animated-pages> <template is="dom-if" if="[[showInternetConfig_]]" restamp>
diff --git a/chrome/browser/resources/settings/chromeos/internet_page/internet_page.js b/chrome/browser/resources/settings/chromeos/internet_page/internet_page.js index d96f95d2..26f3e30 100644 --- a/chrome/browser/resources/settings/chromeos/internet_page/internet_page.js +++ b/chrome/browser/resources/settings/chromeos/internet_page/internet_page.js
@@ -297,6 +297,18 @@ type: String, value: '', }, + + /** + * Return true if hotspot feature flag is enabled. + * @private + */ + isHotspotFeatureEnabled_: { + type: Boolean, + value() { + return loadTimeData.valueExists('isHotspotEnabled') && + loadTimeData.getBoolean('isHotspotEnabled'); + }, + }, }; }
diff --git a/chrome/browser/resources/settings/chromeos/os_a11y_page/select_to_speak_subpage.html b/chrome/browser/resources/settings/chromeos/os_a11y_page/select_to_speak_subpage.html index fbfd77a..5e76876b 100644 --- a/chrome/browser/resources/settings/chromeos/os_a11y_page/select_to_speak_subpage.html +++ b/chrome/browser/resources/settings/chromeos/os_a11y_page/select_to_speak_subpage.html
@@ -31,8 +31,24 @@ <h2>$i18n{selectToSpeakOptionsHighlight}</h2> <settings-toggle-button - id="a11ySelectToSpeakOptionsHighlight" + id="wordHighlightToggle" pref="{{prefs.settings.a11y.select_to_speak_word_highlight}}" label="$i18n{selectToSpeakOptionsHighlightDescription}" deep-link-focus-id$="[[Setting.kSelectToSpeakWordHighlight]]"> </settings-toggle-button> + +<settings-toggle-button + id="backgroundShadingToggle" + pref="{{prefs.settings.a11y.select_to_speak_background_shading}}" + label="$i18n{selectToSpeakOptionsBackgroundShadingDescription}" + deep-link-focus-id$="[[Setting.kSelectToSpeakBackgroundShading]]"> +</settings-toggle-button> + +<settings-toggle-button + id="navigationControlsToggle" + pref="{{prefs.settings.a11y.select_to_speak_navigation_controls}}" + label="$i18n{selectToSpeakOptionsNavigationControlsDescription}" + sub-label="$i18n{selectToSpeakOptionsNavigationControlsSubtitle}" + deep-link-focus-id$="[[Setting.kSelectToSpeakNavigationControls]]"> +</settings-toggle-button> +
diff --git a/chrome/browser/resources/settings/chromeos/os_a11y_page/select_to_speak_subpage.ts b/chrome/browser/resources/settings/chromeos/os_a11y_page/select_to_speak_subpage.ts index a1a94e08..56c187e 100644 --- a/chrome/browser/resources/settings/chromeos/os_a11y_page/select_to_speak_subpage.ts +++ b/chrome/browser/resources/settings/chromeos/os_a11y_page/select_to_speak_subpage.ts
@@ -16,6 +16,8 @@ import {WebUiListenerMixin, WebUiListenerMixinInterface} from 'chrome://resources/cr_elements/web_ui_listener_mixin.js'; import {mixinBehaviors, PolymerElement} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js'; +import {Setting} from '../../mojom-webui/setting.mojom-webui.js'; +import {PrefsMixin, PrefsMixinInterface} from '../../prefs/prefs_mixin.js'; import {Route} from '../../router.js'; import {DeepLinkingBehavior, DeepLinkingBehaviorInterface} from '../deep_linking_behavior.js'; import {routes} from '../os_route.js'; @@ -29,10 +31,10 @@ DeepLinkingBehavior, RouteOriginBehavior, ], - WebUiListenerMixin(I18nMixin(PolymerElement))) as { + PrefsMixin(WebUiListenerMixin(I18nMixin(PolymerElement)))) as { new (): PolymerElement & I18nMixinInterface & - WebUiListenerMixinInterface & DeepLinkingBehaviorInterface & - RouteOriginBehaviorInterface, + WebUiListenerMixinInterface & PrefsMixinInterface & + DeepLinkingBehaviorInterface & RouteOriginBehaviorInterface, }; class SettingsSelectToSpeakSubpageElement extends @@ -47,14 +49,20 @@ static get properties() { return { - prefs: { + /** + * Used by DeepLinkingBehavior to focus this page's deep links. + */ + supportedSettingIds: { type: Object, - notify: true, + value: () => new Set([ + Setting.kSelectToSpeakWordHighlight, + Setting.kSelectToSpeakBackgroundShading, + Setting.kSelectToSpeakNavigationControls, + ]), }, }; } - prefs: {[key: string]: any}; private route_: Route; constructor() {
diff --git a/chrome/browser/resources/settings/chromeos/os_route.js b/chrome/browser/resources/settings/chromeos/os_route.js index 5c5d5bc98..f95ce9b 100644 --- a/chrome/browser/resources/settings/chromeos/os_route.js +++ b/chrome/browser/resources/settings/chromeos/os_route.js
@@ -63,6 +63,10 @@ r.KNOWN_NETWORKS = createSubpage( r.INTERNET, routesMojomWebui.KNOWN_NETWORKS_SUBPAGE_PATH, Subpage.kKnownNetworks); + if (loadTimeData.getBoolean('isHotspotEnabled')) { + r.HOTSPOT_DETAIL = + createSubpage(r.INTERNET, 'hotspotDetail', Subpage.kHotspotDetails); + } if (loadTimeData.getBoolean('isApnRevampEnabled')) { r.APN = createSubpage( r.INTERNET, routesMojomWebui.APN_SUBPAGE_PATH, Subpage.kApn);
diff --git a/chrome/browser/resources/settings/chromeos/os_settings.gni b/chrome/browser/resources/settings/chromeos/os_settings.gni index b67a76c..7be826b 100644 --- a/chrome/browser/resources/settings/chromeos/os_settings.gni +++ b/chrome/browser/resources/settings/chromeos/os_settings.gni
@@ -323,6 +323,7 @@ "chromeos/internet_page/esim_install_error_dialog.js", "chromeos/internet_page/esim_remove_profile_dialog.js", "chromeos/internet_page/esim_rename_dialog.js", + "chromeos/internet_page/hotspot_subpage.js", "chromeos/internet_page/hotspot_summary_item.js", "chromeos/internet_page/internet_config.js", "chromeos/internet_page/internet_detail_menu.js",
diff --git a/chrome/browser/resources/settings/chromeos/os_settings.js b/chrome/browser/resources/settings/chromeos/os_settings.js index 09072c37..5fd2086 100644 --- a/chrome/browser/resources/settings/chromeos/os_settings.js +++ b/chrome/browser/resources/settings/chromeos/os_settings.js
@@ -21,6 +21,7 @@ import './internet_page/cellular_roaming_toggle_button.js'; import './internet_page/cellular_setup_dialog.js'; import './internet_page/esim_remove_profile_dialog.js'; +import './internet_page/hotspot_subpage.js'; import './internet_page/hotspot_summary_item.js'; import './internet_page/internet_config.js'; import './internet_page/internet_detail_page.js';
diff --git a/chrome/browser/resources/settings/chromeos/os_settings_routes.js b/chrome/browser/resources/settings/chromeos/os_settings_routes.js index a4c7913..fea60424 100644 --- a/chrome/browser/resources/settings/chromeos/os_settings_routes.js +++ b/chrome/browser/resources/settings/chromeos/os_settings_routes.js
@@ -57,6 +57,7 @@ * FINGERPRINT: !Route, * FILES: !Route, * GOOGLE_ASSISTANT: !Route, + * HOTSPOT_DETAIL: !Route, * INTERNET: !Route, * INTERNET_NETWORKS: !Route, * KERBEROS: !Route,
diff --git a/chrome/browser/safe_browsing/chrome_cleaner/chrome_cleaner_runner_win.cc b/chrome/browser/safe_browsing/chrome_cleaner/chrome_cleaner_runner_win.cc index 3427f778..4c94d68f 100644 --- a/chrome/browser/safe_browsing/chrome_cleaner/chrome_cleaner_runner_win.cc +++ b/chrome/browser/safe_browsing/chrome_cleaner/chrome_cleaner_runner_win.cc
@@ -147,11 +147,10 @@ ChromeCleanerRunner::LaunchAndWaitForExitOnBackgroundThread() { TRACE_EVENT0("safe_browsing", "ChromeCleanerRunner::LaunchAndWaitForExitOnBackgroundThread"); - auto on_connection_closed = base::BindOnce( - &ChromeCleanerRunner::OnConnectionClosed, base::RetainedRef(this)); + auto on_connection_closed = + base::BindOnce(&ChromeCleanerRunner::OnConnectionClosed, this); auto actions = std::make_unique<ChromePromptActions>( - base::BindOnce(&ChromeCleanerRunner::OnPromptUser, - base::RetainedRef(this))); + base::BindOnce(&ChromeCleanerRunner::OnPromptUser, this)); // The channel will make blocking calls to ::WriteFile. scoped_refptr<base::SequencedTaskRunner> channel_task_runner =
diff --git a/chrome/browser/safe_browsing/chrome_safe_browsing_tab_observer_delegate.cc b/chrome/browser/safe_browsing/chrome_safe_browsing_tab_observer_delegate.cc index 62b9f5e..9c12b89 100644 --- a/chrome/browser/safe_browsing/chrome_safe_browsing_tab_observer_delegate.cc +++ b/chrome/browser/safe_browsing/chrome_safe_browsing_tab_observer_delegate.cc
@@ -46,7 +46,11 @@ std::unique_ptr<ClientSideDetectionHost> ChromeSafeBrowsingTabObserverDelegate::CreateClientSideDetectionHost( content::WebContents* web_contents) { +#if BUILDFLAG(SAFE_BROWSING_AVAILABLE) return ChromeClientSideDetectionHostDelegate::CreateHost(web_contents); +#else + return nullptr; +#endif } } // namespace safe_browsing
diff --git a/chrome/browser/tab/web_contents_state.cc b/chrome/browser/tab/web_contents_state.cc index 67b97342..608c1163 100644 --- a/chrome/browser/tab/web_contents_state.cc +++ b/chrome/browser/tab/web_contents_state.cc
@@ -359,7 +359,7 @@ // Don't try to persist initial NavigationEntry, as it is not actually // associated with any navigation and will just result in about:blank on // session restore. - if (entry_count == 0 || controller.GetLastCommittedEntry()->IsInitialEntry()) + if (controller.GetLastCommittedEntry()->IsInitialEntry()) return ScopedJavaLocalRef<jobject>(); std::vector<content::NavigationEntry*> navigations(entry_count);
diff --git a/chrome/browser/ui/app_list/arc/arc_app_list_prefs.cc b/chrome/browser/ui/app_list/arc/arc_app_list_prefs.cc index e515856..085b6ad 100644 --- a/chrome/browser/ui/app_list/arc/arc_app_list_prefs.cc +++ b/chrome/browser/ui/app_list/arc/arc_app_list_prefs.cc
@@ -391,6 +391,7 @@ user_prefs::PrefRegistrySyncable* registry) { registry->RegisterDictionaryPref(arc::prefs::kArcApps); registry->RegisterDictionaryPref(arc::prefs::kArcPackages); + registry->RegisterBooleanPref(arc::prefs::kArcPackagesIsUpToDate, false); registry->RegisterIntegerPref(arc::prefs::kArcFrameworkVersion, -1 /* default_value */); registry->RegisterDictionaryPref( @@ -1385,6 +1386,7 @@ VLOG(1) << "App instance connection is closed."; DisableAllApps(); installing_packages_count_ = 0; + packages_to_be_added_.clear(); apps_installations_.clear(); CancelDefaultAppLoadingTimeout(); ClearIconRequestRecord(); @@ -2159,6 +2161,10 @@ DCHECK(IsArcAndroidEnabledForProfile(profile_)); AddOrUpdatePackagePrefs(*package_info); + + packages_to_be_added_.erase(package_info->package_name); + UpdateArcPackagesIsUpToDatePref(); + for (auto& observer : observer_list_) observer.OnPackageInstalled(*package_info); } @@ -2195,6 +2201,8 @@ } } + UpdateArcPackagesIsUpToDatePref(); + package_list_initial_refreshed_ = true; for (auto& observer : observer_list_) observer.OnPackageListInitialRefreshed(); @@ -2281,6 +2289,7 @@ const absl::optional<std::string>& package_name) { ++installing_packages_count_; CancelDefaultAppLoadingTimeout(); + UpdateArcPackagesIsUpToDatePref(); if (!package_name.has_value()) return; @@ -2313,6 +2322,8 @@ reason = InstallationCounterReasonEnum::POLICY; } UMA_HISTOGRAM_ENUMERATION("Arc.AppInstalledReason", reason); + + packages_to_be_added_.insert(result->package_name); } } @@ -2322,6 +2333,7 @@ } --installing_packages_count_; MaybeSetDefaultAppLoadingTimeout(); + UpdateArcPackagesIsUpToDatePref(); } void ArcAppListPrefs::NotifyAppStatesChanged(const std::string& app_id) { @@ -2337,6 +2349,14 @@ ignore_compare_app_info_install_time = ignore; } +void ArcAppListPrefs::UpdateArcPackagesIsUpToDatePref() { + // Set kArcPackagesIsUpToDate to true if there is no active install and all + // installed packages are added to the prefs. + prefs_->SetBoolean( + arc::prefs::kArcPackagesIsUpToDate, + installing_packages_count_ == 0 && packages_to_be_added_.empty()); +} + ArcAppListPrefs::AppInfo::AppInfo( const std::string& name, const std::string& package_name,
diff --git a/chrome/browser/ui/app_list/arc/arc_app_list_prefs.h b/chrome/browser/ui/app_list/arc/arc_app_list_prefs.h index 0f25c9b..178bedc1 100644 --- a/chrome/browser/ui/app_list/arc/arc_app_list_prefs.h +++ b/chrome/browser/ui/app_list/arc/arc_app_list_prefs.h
@@ -642,6 +642,9 @@ // Records UMA metrics on app counts on ARC start. void RecordAppIdsUma(); + // Updates kArcPackagesIsUpToDate pref. + void UpdateArcPackagesIsUpToDatePref(); + Profile* const profile_; // Owned by the BrowserContext. @@ -689,6 +692,8 @@ base::OneShotTimer detect_default_app_availability_timeout_; // Set of currently installing apps_. std::unordered_set<std::string> apps_installations_; + // Set of package names which are installed but not yet added to the prefs. + std::unordered_set<std::string> packages_to_be_added_; // To execute file operations in sequence. scoped_refptr<base::SequencedTaskRunner> file_task_runner_;
diff --git a/chrome/browser/ui/app_list/arc/arc_app_unittest.cc b/chrome/browser/ui/app_list/arc/arc_app_unittest.cc index 82bd2e7..58116ba 100644 --- a/chrome/browser/ui/app_list/arc/arc_app_unittest.cc +++ b/chrome/browser/ui/app_list/arc/arc_app_unittest.cc
@@ -2184,6 +2184,36 @@ prefs->RemoveObserver(&observer); } +TEST_P(ArcAppModelBuilderTest, ArcPacakgesIsUpToDate) { + const std::string package_name = "com.fakepackage.name"; + const arc::mojom::ArcPackageInfoPtr package = CreatePackage(package_name); + + ArcAppListPrefs* prefs = ArcAppListPrefs::Get(profile_.get()); + ASSERT_NE(nullptr, prefs); + + // kArcPackagesIsUpToDate is set to true when the package list is refreshed. + std::vector<arc::mojom::ArcPackageInfoPtr> packages; + packages.push_back(package->Clone()); + app_instance()->SendRefreshPackageList(std::move(packages)); + EXPECT_TRUE(profile_.get()->GetTestingPrefService()->GetBoolean( + arc::prefs::kArcPackagesIsUpToDate)); + + // kArcPackagesIsUpToDate is set to false when installation starts. + app_instance()->SendInstallationStarted(package_name); + EXPECT_FALSE(profile_.get()->GetTestingPrefService()->GetBoolean( + arc::prefs::kArcPackagesIsUpToDate)); + + // kArcPackagesIsUpToDate is still false after installation finishes. + app_instance()->SendInstallationFinished(package_name, true /* success */); + EXPECT_FALSE(profile_.get()->GetTestingPrefService()->GetBoolean( + arc::prefs::kArcPackagesIsUpToDate)); + + // kArcPackagesIsUpToDate is set to true after the installed package is added. + AddPackage(CreatePackage(package_name)); + EXPECT_TRUE(profile_.get()->GetTestingPrefService()->GetBoolean( + arc::prefs::kArcPackagesIsUpToDate)); +} + // Validate that arc model contains expected elements on restart. // Flaky. https://crbug.com/1013813 TEST_P(ArcAppModelBuilderRecreate, DISABLED_AppModelRestart) {
diff --git a/chrome/browser/ui/ash/chrome_shell_delegate.cc b/chrome/browser/ui/ash/chrome_shell_delegate.cc index b74374c9..9ee57e9a 100644 --- a/chrome/browser/ui/ash/chrome_shell_delegate.cc +++ b/chrome/browser/ui/ash/chrome_shell_delegate.cc
@@ -12,6 +12,7 @@ #include "ash/constants/ash_switches.h" #include "ash/public/cpp/assistant/assistant_state.h" #include "ash/public/cpp/new_window_delegate.h" +#include "ash/system/video_conference/video_conference_tray_controller.h" #include "base/bind.h" #include "base/check.h" #include "base/command_line.h" @@ -144,6 +145,11 @@ return std::make_unique<ChromeDesksTemplatesDelegate>(); } +std::unique_ptr<ash::VideoConferenceTrayController> +ChromeShellDelegate::CreateVideoConferenceTrayController() const { + return std::make_unique<ash::VideoConferenceTrayController>(); +} + scoped_refptr<network::SharedURLLoaderFactory> ChromeShellDelegate::GetGeolocationUrlLoaderFactory() const { return g_browser_process->shared_url_loader_factory();
diff --git a/chrome/browser/ui/ash/chrome_shell_delegate.h b/chrome/browser/ui/ash/chrome_shell_delegate.h index 4884216a..c57c13e5 100644 --- a/chrome/browser/ui/ash/chrome_shell_delegate.h +++ b/chrome/browser/ui/ash/chrome_shell_delegate.h
@@ -35,6 +35,8 @@ ash::NearbyShareController* controller) const override; std::unique_ptr<ash::DesksTemplatesDelegate> CreateDesksTemplatesDelegate() const override; + std::unique_ptr<ash::VideoConferenceTrayController> + CreateVideoConferenceTrayController() const override; scoped_refptr<network::SharedURLLoaderFactory> GetGeolocationUrlLoaderFactory() const override; void OpenKeyboardShortcutHelpPage() const override;
diff --git a/chrome/browser/ui/ash/desks/desks_templates_app_launch_handler.cc b/chrome/browser/ui/ash/desks/desks_templates_app_launch_handler.cc index 04627d18..a2fb467 100644 --- a/chrome/browser/ui/ash/desks/desks_templates_app_launch_handler.cc +++ b/chrome/browser/ui/ash/desks/desks_templates_app_launch_handler.cc
@@ -120,8 +120,9 @@ absl::optional<ash::SystemWebAppType> swa_type = ash::GetSystemWebAppTypeForAppId(profile(), app_id); if (swa_type.has_value()) { - auto* system_app = - ash::SystemWebAppManager::Get(profile())->GetSystemApp(*swa_type); + auto* swa_manager = ash::SystemWebAppManager::Get(profile()); + DCHECK(swa_manager); + auto* system_app = swa_manager->GetSystemApp(*swa_type); DCHECK(system_app); is_multi_instance_window = system_app->ShouldShowNewWindowMenuOption(); }
diff --git a/chrome/browser/ui/ash/ime_controller_client_impl.cc b/chrome/browser/ui/ash/ime_controller_client_impl.cc index d52bf7e..0bf8457b9 100644 --- a/chrome/browser/ui/ash/ime_controller_client_impl.cc +++ b/chrome/browser/ui/ash/ime_controller_client_impl.cc
@@ -211,9 +211,9 @@ const std::string current_ime_id = state->GetCurrentInputMethod().id(); std::vector<ash::ImeInfo> available_imes; - std::unique_ptr<std::vector<InputMethodDescriptor>> enabled_ime_descriptors = + std::vector<InputMethodDescriptor> enabled_ime_descriptors = state->GetEnabledInputMethodsSortedByLocalizedDisplayNames(); - for (const InputMethodDescriptor& descriptor : *enabled_ime_descriptors) { + for (const InputMethodDescriptor& descriptor : enabled_ime_descriptors) { ash::ImeInfo info = GetAshImeInfo(descriptor); available_imes.push_back(std::move(info)); }
diff --git a/chrome/browser/ui/ash/ime_controller_client_impl_unittest.cc b/chrome/browser/ui/ash/ime_controller_client_impl_unittest.cc index 11c8daae..cf204593 100644 --- a/chrome/browser/ui/ash/ime_controller_client_impl_unittest.cc +++ b/chrome/browser/ui/ash/ime_controller_client_impl_unittest.cc
@@ -67,10 +67,9 @@ current_ime_id_ = input_method_id; last_show_message_ = show_message; } - std::unique_ptr<std::vector<InputMethodDescriptor>> + std::vector<InputMethodDescriptor> GetEnabledInputMethodsSortedByLocalizedDisplayNames() const override { - return std::make_unique<std::vector<InputMethodDescriptor>>( - input_methods_); + return input_methods_; } const InputMethodDescriptor* GetInputMethodFromId( const std::string& input_method_id) const override {
diff --git a/chrome/browser/ui/ash/shelf/browser_status_monitor.cc b/chrome/browser/ui/ash/shelf/browser_status_monitor.cc index bb857c2a..91a5022 100644 --- a/chrome/browser/ui/ash/shelf/browser_status_monitor.cc +++ b/chrome/browser/ui/ash/shelf/browser_status_monitor.cc
@@ -396,12 +396,10 @@ content::WebContents* contents) { if (!web_app::IsWebAppsCrosapiEnabled()) { UpdateAppItemState(contents, false /*remove*/); - // If the contents does not have a visible navigation entry that is not the - // initial entry, wait until a navigation status changes before setting the - // browser window Shelf ID (done by the web contents observer added by - // AddWebContentsObserver()). + // If the visible navigation entry is the initial entry, wait until a + // navigation status changes before setting the browser window Shelf ID + // (done by the web contents observer added by AddWebContentsObserver()). if (tab_strip_model->GetActiveWebContents() == contents && - contents->GetController().GetVisibleEntry() && !contents->GetController().GetVisibleEntry()->IsInitialEntry()) { Browser* browser = chrome::FindBrowserWithWebContents(contents); SetShelfIDForBrowserWindowContents(browser, contents);
diff --git a/chrome/browser/ui/bookmarks/bookmark_tab_helper.cc b/chrome/browser/ui/bookmarks/bookmark_tab_helper.cc index 6f3346c..721e518 100644 --- a/chrome/browser/ui/bookmarks/bookmark_tab_helper.cc +++ b/chrome/browser/ui/bookmarks/bookmark_tab_helper.cc
@@ -30,14 +30,13 @@ namespace { bool IsNTP(content::WebContents* web_contents) { - // Use the committed entry so the bookmarks bar disappears at the same time - // the page does. + // Use the committed entry (or the visible entry, if the committed entry is + // the initial NavigationEntry) so the bookmarks bar disappears at the same + // time the page does. content::NavigationEntry* entry = web_contents->GetController().GetLastCommittedEntry(); - if (!entry || entry->IsInitialEntry()) + if (entry->IsInitialEntry()) entry = web_contents->GetController().GetVisibleEntry(); - if (!entry) - return false; const GURL& url = entry->GetURL(); return NewTabUI::IsNewTab(url) || NewTabPageUI::IsNewTabPageOrigin(url) || NewTabPageThirdPartyUI::IsNewTabPageOrigin(url) ||
diff --git a/chrome/browser/ui/browser_commands.cc b/chrome/browser/ui/browser_commands.cc index 4389a51..0bee4ce 100644 --- a/chrome/browser/ui/browser_commands.cc +++ b/chrome/browser/ui/browser_commands.cc
@@ -442,8 +442,7 @@ content_restrictions = core_tab_helper->content_restrictions(); NavigationEntry* last_committed_entry = current_tab->GetController().GetLastCommittedEntry(); - if (!content::IsSavableURL( - last_committed_entry ? last_committed_entry->GetURL() : GURL())) + if (!content::IsSavableURL(last_committed_entry->GetURL())) content_restrictions |= CONTENT_RESTRICTION_SAVE; } return content_restrictions; @@ -965,7 +964,7 @@ bool CanDuplicateTabAt(const Browser* browser, int index) { WebContents* contents = browser->tab_strip_model()->GetWebContentsAt(index); - return contents && contents->GetController().GetLastCommittedEntry(); + return contents; } void MoveTabsToExistingWindow(Browser* source,
diff --git a/chrome/browser/ui/login/login_handler_browsertest.cc b/chrome/browser/ui/login/login_handler_browsertest.cc index b5c86a6b1..f3135438 100644 --- a/chrome/browser/ui/login/login_handler_browsertest.cc +++ b/chrome/browser/ui/login/login_handler_browsertest.cc
@@ -1979,8 +1979,7 @@ content::WebContents* opened_contents = browser()->tab_strip_model()->GetWebContentsAt(1); NavigationController* opened_controller = &opened_contents->GetController(); - ASSERT_TRUE(!opened_controller->GetVisibleEntry() || - opened_controller->GetVisibleEntry()->IsInitialEntry()); + ASSERT_TRUE(opened_controller->GetVisibleEntry()->IsInitialEntry()); LoginPromptBrowserTestObserver observer; observer.Register(content::Source<NavigationController>(opened_controller)); WindowedAuthNeededObserver auth_needed_waiter(opened_controller);
diff --git a/chrome/browser/ui/page_info/page_info_dialog.cc b/chrome/browser/ui/page_info/page_info_dialog.cc index 19ad4d9..2917183f 100644 --- a/chrome/browser/ui/page_info/page_info_dialog.cc +++ b/chrome/browser/ui/page_info/page_info_dialog.cc
@@ -23,7 +23,7 @@ content::NavigationEntry* entry = web_contents->GetController().GetVisibleEntry(); - if (!entry || entry->IsInitialEntry()) + if (entry->IsInitialEntry()) return false; auto initialized_callback =
diff --git a/chrome/browser/ui/quick_answers/ui/quick_answers_view.cc b/chrome/browser/ui/quick_answers/ui/quick_answers_view.cc index 6be17249..435bde8 100644 --- a/chrome/browser/ui/quick_answers/ui/quick_answers_view.cc +++ b/chrome/browser/ui/quick_answers/ui/quick_answers_view.cc
@@ -656,7 +656,12 @@ } gfx::Rect bounds = {{anchor_view_bounds_.x(), y}, {GetBoundsWidth(), height}}; +#if BUILDFLAG(IS_CHROMEOS_ASH) + // For Ash, convert the position relative to the screen. + // For Lacros, `bounds` is already relative to the toplevel window and the + // position will be calculated on server side. wm::ConvertRectFromScreen(GetWidget()->GetNativeWindow()->parent(), &bounds); +#endif GetWidget()->SetBounds(bounds); }
diff --git a/chrome/browser/ui/quick_answers/ui/quick_answers_view.h b/chrome/browser/ui/quick_answers/ui/quick_answers_view.h index dcbe5dcc..28aa694 100644 --- a/chrome/browser/ui/quick_answers/ui/quick_answers_view.h +++ b/chrome/browser/ui/quick_answers/ui/quick_answers_view.h
@@ -83,7 +83,10 @@ void OnPhoneticsAudioButtonPressed( const quick_answers::PhoneticsInfo& phonetics_info); + // The relative position to the screen for Ash and to the toplevel window for + // Lacros. gfx::Rect anchor_view_bounds_; + base::WeakPtr<QuickAnswersUiController> controller_; bool has_second_row_answer_ = false; std::string title_;
diff --git a/chrome/browser/ui/side_search/side_search_side_contents_helper_unittest.cc b/chrome/browser/ui/side_search/side_search_side_contents_helper_unittest.cc index 6a18ad15..422f4ca 100644 --- a/chrome/browser/ui/side_search/side_search_side_contents_helper_unittest.cc +++ b/chrome/browser/ui/side_search/side_search_side_contents_helper_unittest.cc
@@ -146,8 +146,7 @@ TEST_F(SideSearchSideContentsHelperTest, RedirectionConfigNavigatesTabContents) { LoadURL(kNonMatchUrl); - EXPECT_TRUE(!GetLastCommittedSideContentsEntry() || - GetLastCommittedSideContentsEntry()->IsInitialEntry()); + EXPECT_TRUE(GetLastCommittedSideContentsEntry()->IsInitialEntry()); EXPECT_TRUE(delegate().last_search_url().is_empty()); EXPECT_EQ(GURL(kNonMatchUrl), delegate().tab_contents_url()); histogram_tester_.ExpectUniqueSample( @@ -157,8 +156,7 @@ TEST_F(SideSearchSideContentsHelperTest, EmitsPerJourneyMetrics) { // Ensure redirected navigations correctly log navigations LoadURL(kNonMatchUrl); - EXPECT_TRUE(!GetLastCommittedSideContentsEntry() || - GetLastCommittedSideContentsEntry()->IsInitialEntry()); + EXPECT_TRUE(GetLastCommittedSideContentsEntry()->IsInitialEntry()); EXPECT_TRUE(delegate().last_search_url().is_empty()); EXPECT_EQ(GURL(kNonMatchUrl), delegate().tab_contents_url()); @@ -191,8 +189,7 @@ // Ensure redirected navigations correctly log navigations LoadURL(kNonMatchUrl); - EXPECT_TRUE(!GetLastCommittedSideContentsEntry() || - GetLastCommittedSideContentsEntry()->IsInitialEntry()); + EXPECT_TRUE(GetLastCommittedSideContentsEntry()->IsInitialEntry()); EXPECT_TRUE(delegate().last_search_url().is_empty()); EXPECT_EQ(GURL(kNonMatchUrl), delegate().tab_contents_url()); @@ -237,8 +234,7 @@ // Ensure redirected navigations correctly log navigations LoadURL(kNonMatchUrl); - EXPECT_TRUE(!GetLastCommittedSideContentsEntry() || - GetLastCommittedSideContentsEntry()->IsInitialEntry()); + EXPECT_TRUE(GetLastCommittedSideContentsEntry()->IsInitialEntry()); EXPECT_TRUE(delegate().last_search_url().is_empty()); EXPECT_EQ(GURL(kNonMatchUrl), delegate().tab_contents_url());
diff --git a/chrome/browser/ui/side_search/side_search_tab_contents_helper_unittest.cc b/chrome/browser/ui/side_search/side_search_tab_contents_helper_unittest.cc index afafcd5..092e7892 100644 --- a/chrome/browser/ui/side_search/side_search_tab_contents_helper_unittest.cc +++ b/chrome/browser/ui/side_search/side_search_tab_contents_helper_unittest.cc
@@ -118,8 +118,7 @@ TEST_F(SideSearchTabContentsHelperTest, LastSearchURLUpdatesCorrectly) { // When a tab is first opened there should be no last encountered search URL. EXPECT_FALSE(helper()->last_search_url().has_value()); - EXPECT_TRUE(!GetLastCommittedSideContentsEntry() || - GetLastCommittedSideContentsEntry()->IsInitialEntry()); + EXPECT_TRUE(GetLastCommittedSideContentsEntry()->IsInitialEntry()); // Navigating to a matching search URL should update the `last_search_url`. LoadURL(kSearchMatchUrl1);
diff --git a/chrome/browser/ui/sync/tab_contents_synced_tab_delegate.cc b/chrome/browser/ui/sync/tab_contents_synced_tab_delegate.cc index dfbac66..4f99883 100644 --- a/chrome/browser/ui/sync/tab_contents_synced_tab_delegate.cc +++ b/chrome/browser/ui/sync/tab_contents_synced_tab_delegate.cc
@@ -149,7 +149,7 @@ // associated with any navigation. content::NavigationEntry* last_committed_entry = web_contents_->GetController().GetLastCommittedEntry(); - if (last_committed_entry && last_committed_entry->IsInitialEntry()) { + if (last_committed_entry->IsInitialEntry()) { return false; }
diff --git a/chrome/browser/ui/ui_features.cc b/chrome/browser/ui/ui_features.cc index 06093671..119e55ab 100644 --- a/chrome/browser/ui/ui_features.cc +++ b/chrome/browser/ui/ui_features.cc
@@ -180,6 +180,13 @@ base::FEATURE_DISABLED_BY_DEFAULT); const char kTabScrollingWithDraggingModeName[] = "tabScrollWithDragMode"; +// Enables different methods of overflow when scrolling tabs in tabstrip +// https://crbug.com/951078 +BASE_FEATURE(kScrollableTabStripOverflow, + "kScrollableTabStripOverflow", + base::FEATURE_DISABLED_BY_DEFAULT); +const char kScrollableTabStripOverflowModeName[] = "tabScrollOverflow"; + // Splits pinned and unpinned tabs into separate TabStrips. // https://crbug.com/1346019 BASE_FEATURE(kSplitTabStrip,
diff --git a/chrome/browser/ui/ui_features.h b/chrome/browser/ui/ui_features.h index 46379cd..8eedf77 100644 --- a/chrome/browser/ui/ui_features.h +++ b/chrome/browser/ui/ui_features.h
@@ -72,6 +72,9 @@ BASE_DECLARE_FEATURE(kTabScrollingButtonPosition); extern const char kTabScrollingButtonPositionParameterName[]; +BASE_DECLARE_FEATURE(kScrollableTabStripOverflow); +extern const char kScrollableTabStripOverflowModeName[]; + // TODO(pbos): Once kReadLater is cleaned up on Desktop, move definition into // ui_features.cc. This is currently temporarily in reading_list_switches.h. BASE_DECLARE_FEATURE(kSidePanelImprovedClobbering);
diff --git a/chrome/browser/ui/views/apps/app_info_dialog/app_info_dialog_views.cc b/chrome/browser/ui/views/apps/app_info_dialog/app_info_dialog_views.cc index a5d81b4..3ded063 100644 --- a/chrome/browser/ui/views/apps/app_info_dialog/app_info_dialog_views.cc +++ b/chrome/browser/ui/views/apps/app_info_dialog/app_info_dialog_views.cc
@@ -68,9 +68,9 @@ bool CanShowAppInfoDialog(Profile* profile, const std::string& extension_id) { #if BUILDFLAG(IS_CHROMEOS_ASH) - bool is_system_web_app = - ash::SystemWebAppManager::Get(profile)->IsSystemWebApp(extension_id); - if (is_system_web_app) { + auto* system_web_app_manager = ash::SystemWebAppManager::Get(profile); + if (system_web_app_manager && + system_web_app_manager->IsSystemWebApp(extension_id)) { return false; }
diff --git a/chrome/browser/ui/views/bookmarks/saved_tab_groups/saved_tab_group_bar.cc b/chrome/browser/ui/views/bookmarks/saved_tab_groups/saved_tab_group_bar.cc index aaa2c65..6c91bc8 100644 --- a/chrome/browser/ui/views/bookmarks/saved_tab_groups/saved_tab_group_bar.cc +++ b/chrome/browser/ui/views/bookmarks/saved_tab_groups/saved_tab_group_bar.cc
@@ -59,7 +59,7 @@ animations_enabled) {} SavedTabGroupBar::~SavedTabGroupBar() { - // remove all buttons from the heirarchy + // Remove all buttons from the hierarchy RemoveAllButtons(); if (saved_tab_group_model_)
diff --git a/chrome/browser/ui/views/download/download_danger_prompt_views.cc b/chrome/browser/ui/views/download/download_danger_prompt_views.cc index dcbb5589..3ee5c91 100644 --- a/chrome/browser/ui/views/download/download_danger_prompt_views.cc +++ b/chrome/browser/ui/views/download/download_danger_prompt_views.cc
@@ -270,6 +270,7 @@ if (download_->IsDangerous() && !download_->IsDone()) { const bool accept = action == DownloadDangerPrompt::ACCEPT; RecordDownloadDangerPrompt(accept, *download_); + RecordDownloadWarningEvent(action, download_); if (!download_->GetURL().is_empty() && !content::DownloadItemUtils::GetBrowserContext(download_) ->IsOffTheRecord()) {
diff --git a/chrome/browser/ui/views/frame/picture_in_picture_browser_frame_view.cc b/chrome/browser/ui/views/frame/picture_in_picture_browser_frame_view.cc index a0713248..c7ff2b5 100644 --- a/chrome/browser/ui/views/frame/picture_in_picture_browser_frame_view.cc +++ b/chrome/browser/ui/views/frame/picture_in_picture_browser_frame_view.cc
@@ -146,7 +146,7 @@ back_to_tab_button_ = controls_container_view_->AddChildView( std::make_unique<BackToTabButton>(base::BindRepeating( [](PictureInPictureBrowserFrameView* frame_view) { - // TODO(https://crbug.com/1346734): Focus the original tab too. + PictureInPictureWindowManager::GetInstance()->FocusInitiator(); PictureInPictureWindowManager::GetInstance() ->ExitPictureInPicture(); }, @@ -640,5 +640,9 @@ } #endif +views::View* PictureInPictureBrowserFrameView::GetBackToTabButtonForTesting() { + return back_to_tab_button_; +} + BEGIN_METADATA(PictureInPictureBrowserFrameView, BrowserNonClientFrameView) END_METADATA
diff --git a/chrome/browser/ui/views/frame/picture_in_picture_browser_frame_view.h b/chrome/browser/ui/views/frame/picture_in_picture_browser_frame_view.h index 9dd02c5..6dcdc9c 100644 --- a/chrome/browser/ui/views/frame/picture_in_picture_browser_frame_view.h +++ b/chrome/browser/ui/views/frame/picture_in_picture_browser_frame_view.h
@@ -162,6 +162,8 @@ static gfx::ShadowValues GetShadowValues(); #endif + views::View* GetBackToTabButtonForTesting(); + private: // A model required to use LocationIconView. std::unique_ptr<LocationBarModel> location_bar_model_;
diff --git a/chrome/browser/ui/views/location_bar/custom_tab_bar_view.cc b/chrome/browser/ui/views/location_bar/custom_tab_bar_view.cc index 42093cf..02eaad4 100644 --- a/chrome/browser/ui/views/location_bar/custom_tab_bar_view.cc +++ b/chrome/browser/ui/views/location_bar/custom_tab_bar_view.cc
@@ -363,7 +363,7 @@ content::NavigationEntry* entry = contents->GetController().GetVisibleEntry(); std::u16string title, location; - if (entry && !entry->IsInitialEntry()) { + if (!entry->IsInitialEntry()) { title = Browser::FormatTitleForDisplay(entry->GetTitleForDisplay()); if (ShouldDisplayUrl(contents)) { location = web_app::AppBrowserController::FormatUrlOrigin(
diff --git a/chrome/browser/ui/views/location_bar/location_bar_view.cc b/chrome/browser/ui/views/location_bar/location_bar_view.cc index 9f50be9..3caff12 100644 --- a/chrome/browser/ui/views/location_bar/location_bar_view.cc +++ b/chrome/browser/ui/views/location_bar/location_bar_view.cc
@@ -1421,7 +1421,7 @@ return false; content::NavigationEntry* entry = contents->GetController().GetVisibleEntry(); - if (!entry || entry->IsInitialEntry()) + if (entry->IsInitialEntry()) return false; DCHECK(GetWidget());
diff --git a/chrome/browser/ui/views/omnibox/omnibox_view_views.cc b/chrome/browser/ui/views/omnibox/omnibox_view_views.cc index c2627baf..2cdce8e 100644 --- a/chrome/browser/ui/views/omnibox/omnibox_view_views.cc +++ b/chrome/browser/ui/views/omnibox/omnibox_view_views.cc
@@ -95,7 +95,6 @@ #include "ui/gfx/font_list.h" #include "ui/gfx/geometry/insets.h" #include "ui/gfx/image/image.h" -#include "ui/gfx/presentation_feedback.h" #include "ui/gfx/selection_model.h" #include "ui/gfx/text_elider.h" #include "ui/gfx/text_utils.h" @@ -483,19 +482,17 @@ UMA_HISTOGRAM_TIMES("Omnibox.CharTypedToRepaintLatency.ToPaint", now - insert_char_time_); latency_histogram_state_ = ON_PAINT_CALLED; - GetWidget()->GetCompositor()->RequestPresentationTimeForNextFrame( + GetWidget()->GetCompositor()->RequestSuccessfulPresentationTimeForNextFrame( base::BindOnce( [](base::TimeTicks insert_timestamp, base::TimeTicks paint_timestamp, - const gfx::PresentationFeedback& feedback) { - if (feedback.flags & gfx::PresentationFeedback::kFailure) - return; + base::TimeTicks presentation_timestamp) { UMA_HISTOGRAM_TIMES( "Omnibox.CharTypedToRepaintLatency.PaintToPresent", - feedback.timestamp - paint_timestamp); + presentation_timestamp - paint_timestamp); UMA_HISTOGRAM_TIMES( "Omnibox.CharTypedToRepaintLatency.InsertToPresent", - feedback.timestamp - insert_timestamp); + presentation_timestamp - insert_timestamp); }, insert_char_time_, now)); }
diff --git a/chrome/browser/ui/views/permissions/chip_controller.cc b/chrome/browser/ui/views/permissions/chip_controller.cc index 5d027582..d21602f 100644 --- a/chrome/browser/ui/views/permissions/chip_controller.cc +++ b/chrome/browser/ui/views/permissions/chip_controller.cc
@@ -315,7 +315,7 @@ return; content::NavigationEntry* entry = contents->GetController().GetVisibleEntry(); - if (!entry || entry->IsInitialEntry()) + if (entry->IsInitialEntry()) return; // prevent chip from collapsing while prompt bubble is open
diff --git a/chrome/browser/ui/views/tabs/tab_drag_controller.cc b/chrome/browser/ui/views/tabs/tab_drag_controller.cc index c17000d..2e2ae89d0 100644 --- a/chrome/browser/ui/views/tabs/tab_drag_controller.cc +++ b/chrome/browser/ui/views/tabs/tab_drag_controller.cc
@@ -2605,11 +2605,17 @@ // are no feet showing. const int tab_left_inset = TabStyle::GetTabOverlap() / 2; + const auto tab_bounds_in_drag_context_coords = [this](int model_index) { + const Tab* const tab = attached_context_->GetTabAt(model_index); + return ToEnclosingRect(views::View::ConvertRectToTarget( + tab, attached_context_, gfx::RectF(tab->GetLocalBounds()))); + }; + // Use the left edge for a reliable fallback, e.g. if this is the leftmost // tab or there is a group header to the immediate left. int left_edge = attached_model->ContainsIndex(left_tab_index) - ? attached_context_->GetTabAt(left_tab_index)->bounds().right() - + ? tab_bounds_in_drag_context_coords(left_tab_index).right() - tab_left_inset : tab_left_inset; @@ -2636,7 +2642,7 @@ // never leave it unless we add this check. See crbug.com/1134376. // TODO(crbug/1329344): Update this to work better with Tab Scrolling once // dragging near the end of the tabstrip is cleaner. - if (attached_context_->GetTabAt(selected.back())->bounds().right() >= + if (tab_bounds_in_drag_context_coords(selected.back()).right() >= attached_context_->TabDragAreaEndX()) { return absl::nullopt; }
diff --git a/chrome/browser/ui/views/tabs/tab_strip_scroll_container.cc b/chrome/browser/ui/views/tabs/tab_strip_scroll_container.cc index 859c543..97247ca 100644 --- a/chrome/browser/ui/views/tabs/tab_strip_scroll_container.cc +++ b/chrome/browser/ui/views/tabs/tab_strip_scroll_container.cc
@@ -107,8 +107,8 @@ scroll_view->SetContents(std::move(tab_strip)); overflow_indicator_strategy_ = - std::make_unique<ShadowOverflowIndicatorStrategy>(scroll_view_, - tab_strip_); + TabStripScrollingOverflowIndicatorStrategy::CreateFromFeatureFlag( + scroll_view_, tab_strip_); overflow_indicator_strategy_->Init(); // This base::Unretained is safe because the callback is called by the // layout manager, which is cleaned up before view children like
diff --git a/chrome/browser/ui/views/tabs/tab_strip_scrolling_overflow_indicator_strategy.cc b/chrome/browser/ui/views/tabs/tab_strip_scrolling_overflow_indicator_strategy.cc index 43ccdc75..d95c483 100644 --- a/chrome/browser/ui/views/tabs/tab_strip_scrolling_overflow_indicator_strategy.cc +++ b/chrome/browser/ui/views/tabs/tab_strip_scrolling_overflow_indicator_strategy.cc
@@ -4,6 +4,7 @@ #include "chrome/browser/ui/views/tabs/tab_strip_scrolling_overflow_indicator_strategy.h" +#include "base/notreached.h" #include "cc/paint/paint_shader.h" #include "chrome/browser/ui/views/frame/browser_non_client_frame_view.h" #include "chrome/browser/ui/views/tabs/tab_strip.h" @@ -18,7 +19,7 @@ // Must be kept the same as kTabScrollingButtonPositionVariations values enum OverflowFeatureFlag { - kNone = 0, + kDefault = 0, kDivider = 1, kFade = 2, kShadow = 3, @@ -31,6 +32,31 @@ TabStrip* tab_strip) : scroll_view_(scroll_view), tab_strip_(tab_strip) {} +// static +std::unique_ptr<TabStripScrollingOverflowIndicatorStrategy> +TabStripScrollingOverflowIndicatorStrategy::CreateFromFeatureFlag( + views::ScrollView* scroll_view, + TabStrip* tab_strip) { + int overview_feature_flag = base::GetFieldTrialParamByFeatureAsInt( + features::kScrollableTabStripOverflow, + features::kScrollableTabStripOverflowModeName, + OverflowFeatureFlag::kDefault); + + switch (overview_feature_flag) { + case OverflowFeatureFlag::kDivider: + case OverflowFeatureFlag::kFade: + return std::make_unique<FadeOverflowIndicatorStrategy>(scroll_view, + tab_strip); + case OverflowFeatureFlag::kShadow: + case OverflowFeatureFlag::kDefault: + return std::make_unique<ShadowOverflowIndicatorStrategy>(scroll_view, + tab_strip); + default: + NOTREACHED(); + return nullptr; + } +} + GradientIndicatorView::GradientIndicatorView( views::OverflowIndicatorAlignment side, int opaque_width, @@ -132,8 +158,6 @@ right_overflow_indicator_->GetTotalWidth(), false); } -// Sometimes the views need to be redrawn to get color updates. - ShadowOverflowIndicatorStrategy::ShadowOverflowIndicatorStrategy( views::ScrollView* scroll_view, TabStrip* tab_strip)
diff --git a/chrome/browser/ui/views/tabs/tab_strip_scrolling_overflow_indicator_strategy.h b/chrome/browser/ui/views/tabs/tab_strip_scrolling_overflow_indicator_strategy.h index 44d55f3fd..4c5d04b 100644 --- a/chrome/browser/ui/views/tabs/tab_strip_scrolling_overflow_indicator_strategy.h +++ b/chrome/browser/ui/views/tabs/tab_strip_scrolling_overflow_indicator_strategy.h
@@ -25,6 +25,10 @@ TabStrip* tab_strip); virtual ~TabStripScrollingOverflowIndicatorStrategy() = default; + // Function to get the Featured Overflow Indicator Strategy + static std::unique_ptr<TabStripScrollingOverflowIndicatorStrategy> + CreateFromFeatureFlag(views::ScrollView* scroll_view, TabStrip* tab_strip); + // Performs the setup for the Strategy. Initialize any views for overflow to // the scroll view here. virtual void Init() = 0;
diff --git a/chrome/browser/ui/views/translate/partial_translate_bubble_view.cc b/chrome/browser/ui/views/translate/partial_translate_bubble_view.cc index 4947509d..a4903380 100644 --- a/chrome/browser/ui/views/translate/partial_translate_bubble_view.cc +++ b/chrome/browser/ui/views/translate/partial_translate_bubble_view.cc
@@ -978,6 +978,12 @@ } SwitchTabForViewState(view_state); + // The initial partial translation uses "Detected Language" as the source by + // default, so |partial_text_label_| needs to be resized after receiving the + // actual source language string in the response. + UpdateLanguageTabNames(); + UpdateTextForViewState(view_state); + partial_text_label_->SizeToFit(tab_view_top_row_->GetPreferredSize().width()); UpdateTextForViewState(view_state); // In cases where we are switching from the waiting view, the spinner should @@ -991,7 +997,6 @@ } UpdateViewState(view_state); - UpdateLanguageTabNames(); if (view_state == PartialTranslateBubbleModel::VIEW_STATE_SOURCE_LANGUAGE || view_state == PartialTranslateBubbleModel::VIEW_STATE_TARGET_LANGUAGE) UpdateAdvancedView();
diff --git a/chrome/browser/ui/web_applications/web_app_launch_handler_browsertest.cc b/chrome/browser/ui/web_applications/web_app_launch_handler_browsertest.cc index 035ddfc..cc35e54 100644 --- a/chrome/browser/ui/web_applications/web_app_launch_handler_browsertest.cc +++ b/chrome/browser/ui/web_applications/web_app_launch_handler_browsertest.cc
@@ -18,6 +18,7 @@ #include "chrome/browser/web_applications/web_app.h" #include "chrome/browser/web_applications/web_app_provider.h" #include "chrome/browser/web_applications/web_app_registrar.h" +#include "chrome/browser/web_applications/web_app_registry_update.h" #include "chrome/test/base/in_process_browser_test.h" #include "components/embedder_support/switches.h" #include "components/page_load_metrics/browser/page_load_metrics_test_waiter.h" @@ -29,6 +30,13 @@ namespace web_app { +namespace { + +constexpr char kLaunchHandlerHistogram[] = + "Launch.WebAppLaunchHandlerClientMode"; + +} // namespace + using ClientMode = LaunchHandler::ClientMode; class WebAppLaunchHandlerBrowserTest : public InProcessBrowserTest { @@ -111,6 +119,7 @@ void ExpectNavigateExistingBehaviour(const AppId& app_id, const GURL& start_url) { + base::HistogramTester histogram_tester; EXPECT_EQ(GetLaunchHandler(app_id), (LaunchHandler{ClientMode::kNavigateExisting})); @@ -130,10 +139,14 @@ EXPECT_EQ(browser_1, browser_2); EXPECT_EQ(web_contents->GetLastCommittedURL(), start_url); EXPECT_EQ(AwaitNextLaunchParamsTargetUrl(browser_2), start_url.spec()); + + histogram_tester.ExpectUniqueSample(kLaunchHandlerHistogram, + ClientMode::kNavigateExisting, 2); } void ExpectFocusExistingBehaviour(const AppId& app_id, const GURL& start_url) { + base::HistogramTester histogram_tester; EXPECT_EQ(GetLaunchHandler(app_id), (LaunchHandler{ClientMode::kFocusExisting})); @@ -196,6 +209,9 @@ EXPECT_TRUE( EvalJs(web_contents, "window.thisIsTheSamePage").ExtractBool()); } + + histogram_tester.ExpectUniqueSample(kLaunchHandlerHistogram, + ClientMode::kFocusExisting, 4); } private: @@ -205,6 +221,7 @@ }; IN_PROC_BROWSER_TEST_F(WebAppLaunchHandlerBrowserTest, ClientModeEmpty) { + base::HistogramTester histogram_tester; AppId app_id = InstallTestWebApp("/web_apps/basic.html", /*await_metric=*/false); EXPECT_EQ(GetLaunchHandler(app_id), absl::nullopt); @@ -212,9 +229,13 @@ Browser* browser_1 = LaunchWebAppBrowser(profile(), app_id); Browser* browser_2 = LaunchWebAppBrowser(profile(), app_id); EXPECT_NE(browser_1, browser_2); + + histogram_tester.ExpectUniqueSample(kLaunchHandlerHistogram, + ClientMode::kAuto, 2); } IN_PROC_BROWSER_TEST_F(WebAppLaunchHandlerBrowserTest, ClientModeAuto) { + base::HistogramTester histogram_tester; AppId app_id = InstallTestWebApp( "/web_apps/get_manifest.html?launch_handler_client_mode_auto.json"); EXPECT_EQ(GetLaunchHandler(app_id), (LaunchHandler{ClientMode::kAuto})); @@ -228,9 +249,13 @@ EXPECT_EQ(AwaitNextLaunchParamsTargetUrl(browser_2), start_url); EXPECT_NE(browser_1, browser_2); + + histogram_tester.ExpectUniqueSample(kLaunchHandlerHistogram, + ClientMode::kAuto, 2); } IN_PROC_BROWSER_TEST_F(WebAppLaunchHandlerBrowserTest, ClientModeNavigateNew) { + base::HistogramTester histogram_tester; AppId app_id = InstallTestWebApp( "/web_apps/get_manifest.html?" "launch_handler_client_mode_navigate_new.json"); @@ -246,6 +271,9 @@ EXPECT_EQ(AwaitNextLaunchParamsTargetUrl(browser_2), start_url); EXPECT_NE(browser_1, browser_2); + + histogram_tester.ExpectUniqueSample(kLaunchHandlerHistogram, + ClientMode::kNavigateNew, 2); } IN_PROC_BROWSER_TEST_F(WebAppLaunchHandlerBrowserTest, @@ -271,6 +299,7 @@ IN_PROC_BROWSER_TEST_F(WebAppLaunchHandlerBrowserTest, ClientModeFocusExistingMultipleLaunches) { + base::HistogramTester histogram_tester; AppId app_id = InstallTestWebApp( "/web_apps/get_manifest.html?" "launch_handler_client_mode_focus_existing.json"); @@ -304,10 +333,14 @@ EXPECT_EQ(EvalJs(web_contents, script).ExtractString(), base::StrCat({start_url.spec(), "|", start_url.spec(), "|", start_url.spec()})); + + histogram_tester.ExpectUniqueSample(kLaunchHandlerHistogram, + ClientMode::kFocusExisting, 3); } IN_PROC_BROWSER_TEST_F(WebAppLaunchHandlerBrowserTest, ClientModeNavigateExistingMultipleLaunches) { + base::HistogramTester histogram_tester; AppId app_id = InstallTestWebApp( "/web_apps/get_manifest.html?" "launch_handler_client_mode_navigate_existing.json"); @@ -339,10 +372,14 @@ }); )"; EXPECT_EQ(EvalJs(web_contents, script).ExtractString(), start_url.spec()); + + histogram_tester.ExpectUniqueSample(kLaunchHandlerHistogram, + ClientMode::kNavigateExisting, 3); } IN_PROC_BROWSER_TEST_F(WebAppLaunchHandlerBrowserTest, LaunchNavigationInterruptedByOutOfScopeNavigation) { + base::HistogramTester histogram_tester; AppId app_id = InstallTestWebApp( "/web_apps/get_manifest.html?" "launch_handler_client_mode_navigate_new.json"); @@ -372,9 +409,13 @@ }); )"; EXPECT_EQ(EvalJs(web_contents, script).ExtractString(), ""); + + histogram_tester.ExpectUniqueSample(kLaunchHandlerHistogram, + ClientMode::kNavigateNew, 1); } IN_PROC_BROWSER_TEST_F(WebAppLaunchHandlerBrowserTest, GlobalLaunchQueue) { + base::HistogramTester histogram_tester; AppId app_id = InstallTestWebApp("/web_apps/basic.html", /*await_metric=*/false); @@ -385,6 +426,30 @@ EXPECT_TRUE(EvalJs(web_contents, "!!window.LaunchQueue").ExtractBool()); EXPECT_TRUE(EvalJs(web_contents, "!!window.launchQueue").ExtractBool()); EXPECT_TRUE(EvalJs(web_contents, "!!window.LaunchParams").ExtractBool()); + + histogram_tester.ExpectUniqueSample(kLaunchHandlerHistogram, + ClientMode::kAuto, 1); +} + +IN_PROC_BROWSER_TEST_F(WebAppLaunchHandlerBrowserTest, SelectActiveBrowser) { + AppId app_id = + InstallTestWebApp("/web_apps/basic.html", /*await_metric=*/false); + EXPECT_EQ(GetLaunchHandler(app_id), absl::nullopt); + + Browser* browser_1 = LaunchWebAppBrowser(profile(), app_id); + Browser* browser_2 = LaunchWebAppBrowser(profile(), app_id); + EXPECT_NE(browser_1, browser_2); + + { + ScopedRegistryUpdate update( + &WebAppProvider::GetForTest(profile())->sync_bridge()); + WebApp* web_app = update->UpdateApp(app_id); + web_app->SetLaunchHandler(LaunchHandler{ClientMode::kFocusExisting}); + } + + Browser* browser_3 = LaunchWebAppBrowser(profile(), app_id); + // Select the most recently opened app window. + EXPECT_EQ(browser_3, browser_2); } class WebAppLaunchHandlerDisabledBrowserTest : public InProcessBrowserTest { @@ -412,6 +477,7 @@ }; IN_PROC_BROWSER_TEST_F(WebAppLaunchHandlerDisabledBrowserTest, NoLaunchQueue) { + base::HistogramTester histogram_tester; AppId app_id = InstallWebAppFromPage( browser(), embedded_test_server()->GetURL("/web_apps/basic.html")); @@ -422,6 +488,8 @@ EXPECT_FALSE(EvalJs(web_contents, "!!window.LaunchQueue").ExtractBool()); EXPECT_FALSE(EvalJs(web_contents, "!!window.launchQueue").ExtractBool()); EXPECT_FALSE(EvalJs(web_contents, "!!window.LaunchParams").ExtractBool()); + + histogram_tester.ExpectTotalCount(kLaunchHandlerHistogram, 0); } class WebAppLaunchHandlerOriginTrialBrowserTest : public InProcessBrowserTest {
diff --git a/chrome/browser/ui/web_applications/web_app_launch_process.cc b/chrome/browser/ui/web_applications/web_app_launch_process.cc index 8158a70..db254c01 100644 --- a/chrome/browser/ui/web_applications/web_app_launch_process.cc +++ b/chrome/browser/ui/web_applications/web_app_launch_process.cc
@@ -277,7 +277,10 @@ return nullptr; } - for (Browser* browser : *BrowserList::GetInstance()) { + const BrowserList* browser_list = BrowserList::GetInstance(); + for (auto it = browser_list->begin_browsers_ordered_by_activation(); + it != browser_list->end_browsers_ordered_by_activation(); ++it) { + Browser* browser = *it; if (browser->profile() == &*profile_ && AppBrowserController::IsForWebApp(browser, params_->app_id)) { return browser;
diff --git a/chrome/browser/ui/web_applications/web_app_launch_utils.cc b/chrome/browser/ui/web_applications/web_app_launch_utils.cc index 634169ff..52e7a2e 100644 --- a/chrome/browser/ui/web_applications/web_app_launch_utils.cc +++ b/chrome/browser/ui/web_applications/web_app_launch_utils.cc
@@ -57,6 +57,7 @@ #include "content/public/browser/web_contents.h" #include "extensions/buildflags/buildflags.h" #include "extensions/common/constants.h" +#include "third_party/blink/public/common/features.h" #include "third_party/blink/public/common/renderer_preferences/renderer_preferences.h" #include "ui/base/page_transition_types.h" #include "ui/base/ui_base_types.h" @@ -492,19 +493,33 @@ return web_contents; } -void RecordAppWindowLaunchMetric(Profile* profile, const std::string& app_id) { +void RecordAppWindowLaunchMetric(Profile* profile, + const std::string& app_id, + extensions::AppLaunchSource launch_source) { WebAppProvider* provider = WebAppProvider::GetForLocalAppsUnchecked(profile); if (!provider) return; - DisplayMode display = - provider->registrar().GetEffectiveDisplayModeFromManifest(app_id); - if (display == DisplayMode::kUndefined) + const WebApp* web_app = provider->registrar().GetAppById(app_id); + if (!web_app) return; - DCHECK_LT(DisplayMode::kUndefined, display); - DCHECK_LE(display, DisplayMode::kMaxValue); - UMA_HISTOGRAM_ENUMERATION("Launch.WebAppDisplayMode", display); + DisplayMode display = + provider->registrar().GetEffectiveDisplayModeFromManifest(app_id); + if (display != DisplayMode::kUndefined) { + DCHECK_LT(DisplayMode::kUndefined, display); + DCHECK_LE(display, DisplayMode::kMaxValue); + UMA_HISTOGRAM_ENUMERATION("Launch.WebAppDisplayMode", display); + } + + // Reparenting launches don't respect the launch_handler setting. + if (launch_source != extensions::AppLaunchSource::kSourceReparenting && + base::FeatureList::IsEnabled( + blink::features::kWebAppEnableLaunchHandler)) { + UMA_HISTOGRAM_ENUMERATION( + "Launch.WebAppLaunchHandlerClientMode", + web_app->launch_handler().value_or(LaunchHandler()).client_mode); + } } void RecordLaunchMetrics(const AppId& app_id, @@ -524,7 +539,7 @@ #endif // BUILDFLAG(IS_CHROMEOS_ASH) if (container == apps::LaunchContainer::kLaunchContainerWindow) - RecordAppWindowLaunchMetric(profile, app_id); + RecordAppWindowLaunchMetric(profile, app_id, launch_source); // TODO(crbug.com/1014328): Populate WebApp metrics instead of Extensions. UMA_HISTOGRAM_ENUMERATION("Extensions.BookmarkAppLaunchSource",
diff --git a/chrome/browser/ui/webui/ash/cloud_upload/cloud_upload.mojom b/chrome/browser/ui/webui/ash/cloud_upload/cloud_upload.mojom index f2a0855..b264997 100644 --- a/chrome/browser/ui/webui/ash/cloud_upload/cloud_upload.mojom +++ b/chrome/browser/ui/webui/ash/cloud_upload/cloud_upload.mojom
@@ -4,16 +4,13 @@ module ash.cloud_upload.mojom; -// Possible cloud providers to open Office files with. -enum CloudProvider { - kGoogleDrive, - kOneDrive, -}; - // The selected action when the user closes the dialog. enum UserAction { kCancel, - kUpload, + kSetUpGoogleDrive, + kSetUpOneDrive, + kUploadToGoogleDrive, + kUploadToOneDrive, }; // Options for which sub-page/flow we want to show. @@ -28,9 +25,6 @@ // Contains the arguments used to set up the dialog. struct DialogArgs { - // The selected cloud provider to transfer Office files to. - CloudProvider cloud_provider; - // List of files that will be uploaded on dialog close if the user completes // the setup. May be empty if the dialog wasn't initiated from a file handler. array<string> file_names;
diff --git a/chrome/browser/ui/webui/ash/cloud_upload/cloud_upload_dialog.cc b/chrome/browser/ui/webui/ash/cloud_upload/cloud_upload_dialog.cc index 9dbb631..fe0d228e 100644 --- a/chrome/browser/ui/webui/ash/cloud_upload/cloud_upload_dialog.cc +++ b/chrome/browser/ui/webui/ash/cloud_upload/cloud_upload_dialog.cc
@@ -62,23 +62,49 @@ })); } -void OnCloudSetupComplete(Profile* profile, - const std::vector<storage::FileSystemURL>& file_urls, - const mojom::CloudProvider cloud_provider, - const std::string& action) { - if (action == kUserActionUpload) { +void StartUpload(Profile* profile, + const std::vector<storage::FileSystemURL>& file_urls, + const CloudProvider cloud_provider) { + if (cloud_provider == CloudProvider::kGoogleDrive) { for (const auto& file_url : file_urls) { - switch (cloud_provider) { - case mojom::CloudProvider::kOneDrive: - OneDriveUploadHandler::Upload(profile, file_url, - base::BindOnce(&OpenODFSUrl)); - break; - case mojom::CloudProvider::kGoogleDrive: - DriveUploadHandler::Upload(profile, file_url, - base::BindOnce(&OpenDriveUrl)); - break; - } + DriveUploadHandler::Upload(profile, file_url, + base::BindOnce(&OpenDriveUrl)); } + } else if (cloud_provider == CloudProvider::kOneDrive) { + for (const auto& file_url : file_urls) { + OneDriveUploadHandler::Upload(profile, file_url, + base::BindOnce(&OpenODFSUrl)); + } + } +} + +void OnDialogComplete(Profile* profile, + const std::vector<storage::FileSystemURL>& file_urls, + const std::string& action) { + using file_manager::file_tasks::kActionIdOpenInOffice; + using file_manager::file_tasks::SetExcelFileHandler; + using file_manager::file_tasks::SetPowerPointFileHandler; + using file_manager::file_tasks::SetWordFileHandler; + + if (action == kUserActionUploadToGoogleDrive) { + SetWordFileHandler(profile, + file_manager::file_tasks::kActionIdWebDriveOfficeWord); + SetExcelFileHandler(profile, + file_manager::file_tasks::kActionIdWebDriveOfficeExcel); + SetPowerPointFileHandler( + profile, file_manager::file_tasks::kActionIdWebDriveOfficePowerPoint); + StartUpload(profile, file_urls, CloudProvider::kGoogleDrive); + } else if (action == kUserActionUploadToOneDrive) { + SetWordFileHandler(profile, kActionIdOpenInOffice); + SetExcelFileHandler(profile, kActionIdOpenInOffice); + SetPowerPointFileHandler(profile, kActionIdOpenInOffice); + StartUpload(profile, file_urls, CloudProvider::kOneDrive); + } else if (action == kUserActionSetUpGoogleDrive) { + CloudUploadDialog::Show(profile, file_urls, + mojom::DialogPage::kGoogleDriveSetup); + } else if (action == kUserActionSetUpOneDrive) { + CloudUploadDialog::Show(profile, file_urls, + mojom::DialogPage::kOneDriveSetup); } else if (action == kUserActionCancel) { UMA_HISTOGRAM_ENUMERATION(kDriveTaskResultMetricName, OfficeTaskResult::CANCELLED); @@ -89,15 +115,11 @@ bool UploadAndOpen(Profile* profile, const std::vector<storage::FileSystemURL>& file_urls, - const mojom::CloudProvider cloud_provider, + const CloudProvider cloud_provider, bool show_dialog) { if (show_dialog) { - mojom::DialogPage dialog_page = - cloud_provider == mojom::CloudProvider::kGoogleDrive - ? mojom::DialogPage::kGoogleDriveSetup - : mojom::DialogPage::kOneDriveSetup; - return CloudUploadDialog::Show(profile, file_urls, cloud_provider, - dialog_page); + return CloudUploadDialog::Show(profile, file_urls, + mojom::DialogPage::kFileHandlerDialog); } bool empty_selection = file_urls.empty(); @@ -105,7 +127,7 @@ if (empty_selection) { return false; } - OnCloudSetupComplete(profile, file_urls, cloud_provider, kUserActionUpload); + StartUpload(profile, file_urls, cloud_provider); return true; } @@ -113,7 +135,6 @@ bool CloudUploadDialog::Show( Profile* profile, const std::vector<storage::FileSystemURL>& file_urls, - const mojom::CloudProvider cloud_provider, const mojom::DialogPage dialog_page) { // Allow no more than one upload dialog at a time. In the case of multiple // upload requests, they should either be handled simultaneously or queued. @@ -123,7 +144,6 @@ } mojom::DialogArgsPtr args = mojom::DialogArgs::New(); - args->cloud_provider = cloud_provider; for (const auto& file_url : file_urls) { args->file_names.push_back(file_url.path().BaseName().value()); } @@ -132,7 +152,7 @@ // The pointer is managed by an instance of `views::WebDialogView` and removed // in `SystemWebDialogDelegate::OnDialogClosed`. UploadRequestCallback uploadCallback = - base::BindOnce(&OnCloudSetupComplete, profile, file_urls, cloud_provider); + base::BindOnce(&OnDialogComplete, profile, file_urls); CloudUploadDialog* dialog = new CloudUploadDialog( std::move(args), std::move(uploadCallback), dialog_page); @@ -147,10 +167,14 @@ } void CloudUploadDialog::OnDialogClosed(const std::string& json_retval) { - if (callback_) { - std::move(callback_).Run(json_retval); - } + UploadRequestCallback callback = std::move(callback_); + // Deletes this, so we store the callback first. SystemWebDialogDelegate::OnDialogClosed(json_retval); + // The callback can create a new dialog. It must be called last because we can + // only have one of these dialogs at a time. + if (callback) { + std::move(callback).Run(json_retval); + } } CloudUploadDialog::CloudUploadDialog(mojom::DialogArgsPtr args,
diff --git a/chrome/browser/ui/webui/ash/cloud_upload/cloud_upload_dialog.h b/chrome/browser/ui/webui/ash/cloud_upload/cloud_upload_dialog.h index 28f0290..35e226c 100644 --- a/chrome/browser/ui/webui/ash/cloud_upload/cloud_upload_dialog.h +++ b/chrome/browser/ui/webui/ash/cloud_upload/cloud_upload_dialog.h
@@ -16,20 +16,23 @@ namespace ash::cloud_upload { -// Either OneDrive for the Office PWA or Drive for Web Drive editing. -enum class UploadType { - kOneDrive, - kDrive, -}; - // The string conversions of ash::cloud_upload::mojom::UserAction. const char kUserActionCancel[] = "cancel"; -const char kUserActionUpload[] = "upload"; +const char kUserActionSetUpGoogleDrive[] = "setup-drive"; +const char kUserActionSetUpOneDrive[] = "setup-onedrive"; +const char kUserActionUploadToGoogleDrive[] = "upload-drive"; +const char kUserActionUploadToOneDrive[] = "upload-onedrive"; + +// Either OneDrive for the Office PWA or Drive for Drive Web editing. +enum class CloudProvider { + kGoogleDrive, + kOneDrive, +}; // Initiates the upload workflow. bool UploadAndOpen(Profile* profile, const std::vector<storage::FileSystemURL>& file_urls, - const mojom::CloudProvider cloud_provider, + const CloudProvider cloud_provider, bool show_dialog); // Defines the web dialog used to help users upload Office files to the cloud. @@ -45,7 +48,6 @@ // if a new dialog has been effectively created. static bool Show(Profile* profile, const std::vector<storage::FileSystemURL>& file_urls, - const mojom::CloudProvider cloud_provider, const mojom::DialogPage dialog_page); void OnDialogShown(content::WebUI* webui) override;
diff --git a/chrome/browser/ui/webui/ash/cloud_upload/cloud_upload_ui.cc b/chrome/browser/ui/webui/ash/cloud_upload/cloud_upload_ui.cc index 39367ee..26d20db7 100644 --- a/chrome/browser/ui/webui/ash/cloud_upload/cloud_upload_ui.cc +++ b/chrome/browser/ui/webui/ash/cloud_upload/cloud_upload_ui.cc
@@ -67,8 +67,17 @@ case mojom::UserAction::kCancel: args.Append(kUserActionCancel); break; - case mojom::UserAction::kUpload: - args.Append(kUserActionUpload); + case mojom::UserAction::kSetUpGoogleDrive: + args.Append(kUserActionSetUpGoogleDrive); + break; + case mojom::UserAction::kSetUpOneDrive: + args.Append(kUserActionSetUpOneDrive); + break; + case mojom::UserAction::kUploadToGoogleDrive: + args.Append(kUserActionUploadToGoogleDrive); + break; + case mojom::UserAction::kUploadToOneDrive: + args.Append(kUserActionUploadToOneDrive); break; } ui::MojoWebDialogUI::CloseDialog(args);
diff --git a/chrome/browser/ui/webui/ash/login/l10n_util.cc b/chrome/browser/ui/webui/ash/login/l10n_util.cc index 632c26d..14fa3e1 100644 --- a/chrome/browser/ui/webui/ash/login/l10n_util.cc +++ b/chrome/browser/ui/webui/ash/login/l10n_util.cc
@@ -504,7 +504,7 @@ input_method_manager->GetActiveIMEState()->EnableLoginLayouts( locale, hardware_login_input_methods); - std::unique_ptr<input_method::InputMethodDescriptors> input_methods( + input_method::InputMethodDescriptors input_methods( input_method_manager->GetActiveIMEState()->GetEnabledInputMethods()); std::set<std::string> input_methods_added; @@ -521,9 +521,9 @@ } bool optgroup_added = false; - for (size_t i = 0; i < input_methods->size(); ++i) { + for (size_t i = 0; i < input_methods.size(); ++i) { // Makes sure the id is in legacy xkb id format. - const std::string& ime_id = (*input_methods)[i].id(); + const std::string& ime_id = input_methods[i].id(); if (!InsertString(ime_id, &input_methods_added)) continue; if (!optgroup_added) { @@ -531,7 +531,7 @@ AddOptgroupOtherLayouts(input_methods_list); } input_methods_list.Append( - CreateInputMethodsEntry((*input_methods)[i], selected, util)); + CreateInputMethodsEntry(input_methods[i], selected, util)); } // "xkb:us::eng" should always be in the list of available layouts.
diff --git a/chrome/browser/ui/webui/downloads/downloads_dom_handler.cc b/chrome/browser/ui/webui/downloads/downloads_dom_handler.cc index 95976bd..6a1cb2d 100644 --- a/chrome/browser/ui/webui/downloads/downloads_dom_handler.cc +++ b/chrome/browser/ui/webui/downloads/downloads_dom_handler.cc
@@ -26,6 +26,7 @@ #include "chrome/browser/download/download_danger_prompt.h" #include "chrome/browser/download/download_history.h" #include "chrome/browser/download/download_item_model.h" +#include "chrome/browser/download/download_item_warning_data.h" #include "chrome/browser/download/download_prefs.h" #include "chrome/browser/download/download_query.h" #include "chrome/browser/download/drag_download_item.h" @@ -176,14 +177,23 @@ CountDownloadsDOMEvents(DOWNLOADS_DOM_EVENT_SAVE_DANGEROUS); download::DownloadItem* file = GetDownloadByStringId(id); - if (file) + if (file) { + DownloadItemWarningData::AddWarningActionEvent( + file, DownloadItemWarningData::DOWNLOADS_PAGE, + DownloadItemWarningData::KEEP); ShowDangerPrompt(file); + } } void DownloadsDOMHandler::DiscardDangerous(const std::string& id) { CountDownloadsDOMEvents(DOWNLOADS_DOM_EVENT_DISCARD_DANGEROUS); download::DownloadItem* download = GetDownloadByStringId(id); if (download) { + // The warning action event needs to be added before Safe Browsing report is + // sent, because this event should be included in the report. + DownloadItemWarningData::AddWarningActionEvent( + download, DownloadItemWarningData::DOWNLOADS_PAGE, + DownloadItemWarningData::DISCARD); // If this download is no longer dangerous, is already canceled or // completed, don't send any report. // Only sends dangerous download discard report if :
diff --git a/chrome/browser/ui/webui/realbox/realbox.mojom b/chrome/browser/ui/webui/realbox/realbox.mojom index 51d9532..d20d3bc 100644 --- a/chrome/browser/ui/webui/realbox/realbox.mojom +++ b/chrome/browser/ui/webui/realbox/realbox.mojom
@@ -41,10 +41,6 @@ array<ACMatchClassification> contents_class; mojo_base.mojom.String16 description; array<ACMatchClassification> description_class; - // if a favicon is available for |destination_url| it is fetched in C++ and - // the resulting data URL is sent to JS via AutocompleteMatchImageAvailable - // along with the |destination_url| and the match index which are used to - // identify the appropriate match. url.mojom.Url destination_url; mojo_base.mojom.String16 inline_autocompletion; mojo_base.mojom.String16 fill_into_edit; @@ -55,10 +51,8 @@ // are valid for entity suggestions only. Entity suggestions have a |type| of // 'search-suggest-entity'. string image_dominant_color; - // The image url for entity suggestions. |image_url| is an external url and - // therefore is fetched in C++ and the resulting data URL is sent to JS via - // AutocompleteMatchImageAvailable along with the |image_url| and the match - // index which are used to identify the appropriate match. + // The image url for entity suggestions. |image_url| is an external url or + // a data URI. string image_url; // Used to determine if the match has an image, calculator answer or // suggestion answer. @@ -147,10 +141,4 @@ interface Page { // Updates the NTP realbox with the autocomplete results. AutocompleteResultChanged(AutocompleteResult result); - // Updates the NTP realbox popup with the image or favicon data URL for the - // given |match_index| and |url| where |url| is an AutocompleteMatch image_url - // or destination_url for an entity or a navigation suggestion respectively. - AutocompleteMatchImageAvailable(uint32 match_index, - url.mojom.Url url, - string data_url); };
diff --git a/chrome/browser/ui/webui/realbox/realbox_handler.cc b/chrome/browser/ui/webui/realbox/realbox_handler.cc index 6fd71f9..53dc183 100644 --- a/chrome/browser/ui/webui/realbox/realbox_handler.cc +++ b/chrome/browser/ui/webui/realbox/realbox_handler.cc
@@ -18,10 +18,7 @@ #include "build/chromeos_buildflags.h" #include "chrome/browser/autocomplete/chrome_autocomplete_provider_client.h" #include "chrome/browser/autocomplete/chrome_autocomplete_scheme_classifier.h" -#include "chrome/browser/bitmap_fetcher/bitmap_fetcher_service_factory.h" #include "chrome/browser/bookmarks/bookmark_model_factory.h" -#include "chrome/browser/favicon/favicon_service_factory.h" -#include "chrome/browser/history/history_service_factory.h" #include "chrome/browser/predictors/autocomplete_action_predictor.h" #include "chrome/browser/predictors/autocomplete_action_predictor_factory.h" #include "chrome/browser/preloading/prefetch/search_prefetch/search_prefetch_service.h" @@ -507,22 +504,9 @@ content::WebContents* web_contents) : profile_(profile), web_contents_(web_contents), - bitmap_fetcher_service_( - BitmapFetcherServiceFactory::GetForBrowserContext(profile)), - favicon_cache_(FaviconServiceFactory::GetForProfile( - profile, - ServiceAccessType::EXPLICIT_ACCESS), - HistoryServiceFactory::GetForProfile( - profile, - ServiceAccessType::EXPLICIT_ACCESS)), page_handler_(this, std::move(pending_page_handler)) {} -RealboxHandler::~RealboxHandler() { - // Clear pending bitmap requests. - for (auto bitmap_request_id : bitmap_request_ids_) { - bitmap_fetcher_service_->CancelRequest(bitmap_request_id); - } -} +RealboxHandler::~RealboxHandler() = default; void RealboxHandler::SetPage( mojo::PendingRemote<realbox::mojom::Page> pending_page) { @@ -822,34 +806,4 @@ web_contents_, autocomplete_controller_->result()); } } - - // Clear pending bitmap requests before requesting new ones. - for (auto bitmap_request_id : bitmap_request_ids_) { - bitmap_fetcher_service_->CancelRequest(bitmap_request_id); - } - bitmap_request_ids_.clear(); - - int match_index = -1; - for (const auto& match : autocomplete_controller_->result()) { - match_index++; - - // Request bitmaps for matche images. - if (!match.ImageUrl().is_empty()) { - bitmap_request_ids_.push_back(bitmap_fetcher_service_->RequestImage( - match.ImageUrl(), - base::BindOnce(&RealboxHandler::OnRealboxBitmapFetched, - weak_ptr_factory_.GetWeakPtr(), match_index, - match.ImageUrl()))); - } - } -} - -void RealboxHandler::OnRealboxBitmapFetched(int match_index, - const GURL& image_url, - const SkBitmap& bitmap) { - auto data = gfx::Image::CreateFrom1xBitmap(bitmap).As1xPNGBytes(); - std::string data_url = - webui::GetPngDataUrl(data->front_as<unsigned char>(), data->size()); - - page_->AutocompleteMatchImageAvailable(match_index, image_url, data_url); }
diff --git a/chrome/browser/ui/webui/realbox/realbox_handler.h b/chrome/browser/ui/webui/realbox/realbox_handler.h index 48236101..47cd05cb 100644 --- a/chrome/browser/ui/webui/realbox/realbox_handler.h +++ b/chrome/browser/ui/webui/realbox/realbox_handler.h
@@ -10,10 +10,8 @@ #include "base/memory/raw_ptr.h" #include "base/memory/weak_ptr.h" #include "base/time/time.h" -#include "chrome/browser/bitmap_fetcher/bitmap_fetcher_service.h" #include "chrome/browser/ui/webui/realbox/realbox.mojom.h" #include "components/omnibox/browser/autocomplete_controller.h" -#include "components/omnibox/browser/favicon_cache.h" #include "components/omnibox/browser/omnibox.mojom-shared.h" #include "components/url_formatter/spoof_checks/idna_metrics.h" #include "mojo/public/cpp/bindings/pending_receiver.h" @@ -93,10 +91,6 @@ void OnResultChanged(AutocompleteController* controller, bool default_match_changed) override; - void OnRealboxBitmapFetched(int match_index, - const GURL& image_url, - const SkBitmap& bitmap); - // OpenURL function used as a callback for execution of actions. void OpenURL(const GURL& destination_url, TemplateURLRef::PostContent* post_content, @@ -114,9 +108,6 @@ raw_ptr<Profile> profile_; raw_ptr<content::WebContents> web_contents_; std::unique_ptr<AutocompleteController> autocomplete_controller_; - raw_ptr<BitmapFetcherService> bitmap_fetcher_service_; - std::vector<BitmapFetcherService::RequestId> bitmap_request_ids_; - FaviconCache favicon_cache_; base::TimeTicks time_user_first_modified_realbox_; mojo::Remote<realbox::mojom::Page> page_;
diff --git a/chrome/browser/ui/webui/realbox/realbox_handler_browsertest.cc b/chrome/browser/ui/webui/realbox/realbox_handler_browsertest.cc index 37a1fde6..6b8c32a 100644 --- a/chrome/browser/ui/webui/realbox/realbox_handler_browsertest.cc +++ b/chrome/browser/ui/webui/realbox/realbox_handler_browsertest.cc
@@ -150,10 +150,6 @@ // realbox::mojom::Page void AutocompleteResultChanged( realbox::mojom::AutocompleteResultPtr result) override {} - void AutocompleteMatchImageAvailable(uint32_t match_index, - const GURL& url, - const std::string& data_url) override {} - mojo::PendingRemote<realbox::mojom::Page> GetRemotePage() { return receiver_.BindNewPipeAndPassRemote(); }
diff --git a/chrome/browser/ui/webui/settings/ash/accessibility_section.cc b/chrome/browser/ui/webui/settings/ash/accessibility_section.cc index 62293f6..33075187 100644 --- a/chrome/browser/ui/webui/settings/ash/accessibility_section.cc +++ b/chrome/browser/ui/webui/settings/ash/accessibility_section.cc
@@ -767,6 +767,12 @@ IDS_SETTINGS_ACCESSIBILITY_SELECT_TO_SPEAK_LINK_TITLE}, {"selectToSpeakOptionsHighlightDescription", IDS_SELECT_TO_SPEAK_OPTIONS_HIGHLIGHT_DESCRIPTION}, + {"selectToSpeakOptionsBackgroundShadingDescription", + IDS_SELECT_TO_SPEAK_OPTIONS_BACKGROUND_SHADING_DESCRIPTION}, + {"selectToSpeakOptionsNavigationControlsDescription", + IDS_SELECT_TO_SPEAK_OPTIONS_NAVIGATION_CONTROLS_DESCRIPTION}, + {"selectToSpeakOptionsNavigationControlsSubtitle", + IDS_SELECT_TO_SPEAK_OPTIONS_NAVIGATION_CONTROLS_SUBTITLE}, {"selectToSpeakOptionsHighlight", IDS_SELECT_TO_SPEAK_OPTIONS_HIGHLIGHT}, {"selectToSpeakOptionsLabel", IDS_SETTINGS_ACCESSIBILITY_SELECT_TO_SPEAK_OPTIONS_LABEL}, @@ -1037,6 +1043,13 @@ mojom::Subpage::kSelectToSpeak, mojom::SearchResultIcon::kA11y, mojom::SearchResultDefaultRank::kMedium, mojom::kSelectToSpeakSubpagePath); + static constexpr mojom::Setting kSelectToSpeakSettings[] = { + mojom::Setting::kSelectToSpeakWordHighlight, + mojom::Setting::kSelectToSpeakBackgroundShading, + mojom::Setting::kSelectToSpeakNavigationControls, + }; + RegisterNestedSettingBulk(mojom::Subpage::kSelectToSpeak, + kSelectToSpeakSettings, generator); } // Display and magnification page. generator->RegisterTopLevelSubpage(
diff --git a/chrome/browser/ui/webui/settings/ash/internet_section.cc b/chrome/browser/ui/webui/settings/ash/internet_section.cc index 983aa330..507d2099e 100644 --- a/chrome/browser/ui/webui/settings/ash/internet_section.cc +++ b/chrome/browser/ui/webui/settings/ash/internet_section.cc
@@ -44,6 +44,7 @@ using ::chromeos::settings::mojom::kCellularDetailsSubpagePath; using ::chromeos::settings::mojom::kCellularNetworksSubpagePath; using ::chromeos::settings::mojom::kEthernetDetailsSubpagePath; +using ::chromeos::settings::mojom::kHotspotSubpagePath; using ::chromeos::settings::mojom::kKnownNetworksSubpagePath; using ::chromeos::settings::mojom::kMobileDataNetworksSubpagePath; using ::chromeos::settings::mojom::kNetworkSectionPath; @@ -915,6 +916,13 @@ l10n_util::GetStringFUTF16( IDS_SETTINGS_INTERNET_TETHER_NOT_SETUP_WITH_LEARN_MORE_LINK, GetHelpUrlWithBoard(chrome::kInstantTetheringLearnMoreURL))); + // TODO(b/259623645): Replace learn more link with hotspot url once it is + // ready. + html_source->AddString( + "hotspotSubpageSubtitle", + l10n_util::GetStringFUTF16( + IDS_SETTINGS_INTERNET_HOTSPOT_SUBTITLE_WITH_LEARN_MORE_LINK, + GetHelpUrlWithBoard(chrome::kInstantTetheringLearnMoreURL))); } void InternetSection::AddHandlers(content::WebUI* web_ui) { @@ -1023,6 +1031,12 @@ RegisterNestedSettingBulk(mojom::Subpage::kCellularDetails, GetCellularDetailsSettings(), generator); + // Hotspot details. + generator->RegisterTopLevelSubpage( + IDS_SETTINGS_INTERNET_HOTSPOT_DETAILS, mojom::Subpage::kHotspotDetails, + mojom::SearchResultIcon::kCellular, + mojom::SearchResultDefaultRank::kMedium, mojom::kHotspotSubpagePath); + // APN. generator->RegisterNestedSubpage( IDS_SETTINGS_INTERNET_NETWORK_ACCESS_POINT, mojom::Subpage::kApn,
diff --git a/chrome/browser/ui/webui/settings/chromeos/constants/routes.mojom b/chrome/browser/ui/webui/settings/chromeos/constants/routes.mojom index d575abf..3388908 100644 --- a/chrome/browser/ui/webui/settings/chromeos/constants/routes.mojom +++ b/chrome/browser/ui/webui/settings/chromeos/constants/routes.mojom
@@ -44,6 +44,7 @@ kTetherDetails = 6, kVpnDetails = 7, kApn = 8, + kHotspotDetails = 9, // Bluetooth section. kBluetoothDevices = 100, @@ -177,6 +178,7 @@ const string kTetherDetailsSubpagePath = "networkDetail"; const string kVpnDetailsSubpagePath = "networkDetail"; const string kApnSubpagePath = "apn"; +const string kHotspotSubpagePath = "hotspotDetail"; // Bluetooth section. const string kBluetoothSectionPath = "bluetooth";
diff --git a/chrome/browser/ui/webui/settings/chromeos/constants/setting.mojom b/chrome/browser/ui/webui/settings/chromeos/constants/setting.mojom index d58d4df..91898de 100644 --- a/chrome/browser/ui/webui/settings/chromeos/constants/setting.mojom +++ b/chrome/browser/ui/webui/settings/chromeos/constants/setting.mojom
@@ -266,6 +266,9 @@ kEnableCursorColor = 1528, kFullscreenMagnifierFocusFollowing = 1529, kFullscreenMagnifierMouseFollowingMode = 1530, + kSelectToSpeakWordHighlight = 1531, + kSelectToSpeakBackgroundShading = 1532, + kSelectToSpeakNavigationControls = 1533, // Reset section. kPowerwash = 1600,
diff --git a/chrome/browser/web_applications/app_service/lacros_web_apps_controller.cc b/chrome/browser/web_applications/app_service/lacros_web_apps_controller.cc index 155cd937..97c78e8 100644 --- a/chrome/browser/web_applications/app_service/lacros_web_apps_controller.cc +++ b/chrome/browser/web_applications/app_service/lacros_web_apps_controller.cc
@@ -73,7 +73,6 @@ provider_(WebAppProvider::GetForWebApps(profile)), publisher_helper_(profile, provider_, - /*swa_manager=*/nullptr, this, /*observe_media_requests=*/true) { DCHECK(provider_);
diff --git a/chrome/browser/web_applications/app_service/web_app_publisher_helper.cc b/chrome/browser/web_applications/app_service/web_app_publisher_helper.cc index edb12e3..9aad374 100644 --- a/chrome/browser/web_applications/app_service/web_app_publisher_helper.cc +++ b/chrome/browser/web_applications/app_service/web_app_publisher_helper.cc
@@ -4,7 +4,9 @@ #include "chrome/browser/web_applications/app_service/web_app_publisher_helper.h" +#include <stddef.h> #include <atomic> +#include <iterator> #include <memory> #include <ostream> #include <set> @@ -13,28 +15,36 @@ #include <utility> #include "base/barrier_callback.h" -#include "base/bind.h" -#include "base/callback_helpers.h" #include "base/check.h" #include "base/check_op.h" +#include "base/containers/checked_iterators.h" #include "base/containers/contains.h" #include "base/containers/extend.h" #include "base/containers/flat_map.h" #include "base/containers/flat_set.h" #include "base/containers/flat_tree.h" +#include "base/containers/span.h" #include "base/feature_list.h" #include "base/files/file_path.h" +#include "base/functional/bind.h" +#include "base/functional/callback_helpers.h" +#include "base/functional/identity.h" +#include "base/location.h" #include "base/logging.h" #include "base/metrics/histogram_base.h" #include "base/metrics/histogram_macros.h" #include "base/notreached.h" +#include "base/one_shot_event.h" #include "base/ranges/algorithm.h" #include "base/strings/string_number_conversions.h" +#include "base/strings/string_piece.h" #include "base/strings/utf_string_conversions.h" #include "base/supports_user_data.h" #include "base/time/time.h" #include "build/build_config.h" +#include "build/buildflag.h" #include "build/chromeos_buildflags.h" +#include "chrome/browser/apps/app_service/app_icon/app_icon_factory.h" #include "chrome/browser/apps/app_service/app_launch_params.h" #include "chrome/browser/apps/app_service/app_service_proxy_forward.h" #include "chrome/browser/apps/app_service/intent_util.h" @@ -77,6 +87,7 @@ #include "components/services/app_service/public/cpp/run_on_os_login_types.h" #include "components/services/app_service/public/cpp/share_target.h" #include "components/services/app_service/public/cpp/shortcut.h" +#include "components/services/app_service/public/mojom/types.mojom-shared.h" #include "components/services/app_service/public/mojom/types.mojom.h" #include "components/webapps/browser/installable/installable_metrics.h" #include "content/public/browser/clear_site_data_utils.h" @@ -108,11 +119,14 @@ #if BUILDFLAG(IS_CHROMEOS_ASH) #include "ash/constants/ash_features.h" #include "ash/webui/projector_app/public/cpp/projector_app_constants.h" // nogncheck +#include "ash/webui/system_apps/public/system_web_app_type.h" #include "chrome/browser/apps/app_service/policy_util.h" +#include "chrome/browser/ash/crosapi/browser_util.h" #include "chrome/browser/ash/file_manager/app_id.h" #include "chrome/browser/ash/guest_os/guest_os_terminal.h" #include "chrome/browser/ash/login/demo_mode/demo_session.h" #include "chrome/browser/ash/system_web_apps/system_web_app_manager.h" +#include "chrome/browser/ash/system_web_apps/types/system_web_app_data.h" #include "chrome/browser/ash/system_web_apps/types/system_web_app_delegate.h" #include "chrome/browser/chromeos/arc/arc_web_contents_data.h" #include "components/app_restore/app_launch_info.h" @@ -134,8 +148,6 @@ namespace web_app { -class WebAppInstallManager; - namespace { // Only supporting important permissions for now. @@ -421,15 +433,12 @@ } #endif -WebAppPublisherHelper::WebAppPublisherHelper( - Profile* profile, - WebAppProvider* provider, - ash::SystemWebAppManager* swa_manager, - Delegate* delegate, - bool observe_media_requests) +WebAppPublisherHelper::WebAppPublisherHelper(Profile* profile, + WebAppProvider* provider, + Delegate* delegate, + bool observe_media_requests) : profile_(profile), provider_(provider), - swa_manager_(swa_manager), app_type_(GetWebAppType()), delegate_(delegate) { DCHECK(profile_); @@ -1129,7 +1138,8 @@ // Save all launch information for system web apps, because the browser // session restore can't restore system web apps. int session_id = apps::GetSessionIdForRestoreFromWebContents(web_contents); - if (SessionID::IsValidValue(session_id)) { + auto* swa_manager = ash::SystemWebAppManager::Get(profile()); + if (swa_manager && SessionID::IsValidValue(session_id)) { const WebApp* web_app = GetWebApp(params_for_restore.app_id); const bool is_system_web_app = web_app && web_app->IsSystemApp(); if (is_system_web_app) { @@ -1143,11 +1153,10 @@ // TODO(crbug.com/1368285): Determine whether override URL can be restored // for all SWAs. - DCHECK(swa_manager_); auto system_app_type = - swa_manager_->GetSystemAppTypeForAppId(params_for_restore.app_id); + swa_manager->GetSystemAppTypeForAppId(params_for_restore.app_id); if (system_app_type.has_value()) { - auto* system_app = swa_manager_->GetSystemApp(*system_app_type); + auto* system_app = swa_manager->GetSystemApp(*system_app_type); DCHECK(system_app); if (system_app->ShouldRestoreOverrideUrl()) launch_info->override_url = params_for_restore.override_url; @@ -1753,10 +1762,10 @@ std::vector<std::string> policy_ids; #if BUILDFLAG(IS_CHROMEOS_ASH) - // TODO(crbug.com/973324): Replace this check with - // if (swa_manager_ && swa_manager_->IsSystemWebApp(app_id)) - // after crrev.com/c/3954727 lands. - if (const auto& swa_data = web_app.client_data().system_web_app_data) { + auto* swa_manager = ash::SystemWebAppManager::Get(profile()); + if (swa_manager && swa_manager->IsSystemWebApp(app_id)) { + const auto& swa_data = web_app.client_data().system_web_app_data; + DCHECK(swa_data); const ash::SystemWebAppType swa_type = swa_data->system_app_type; const absl::optional<base::StringPiece> swa_policy_id = apps_util::GetPolicyIdForSystemWebAppType(swa_type); @@ -1806,10 +1815,12 @@ app.show_in_shelf = true; #if BUILDFLAG(IS_CHROMEOS_ASH) - DCHECK(swa_manager_); - auto system_app_type = swa_manager_->GetSystemAppTypeForAppId(app.app_id); + auto* swa_manager = ash::SystemWebAppManager::Get(profile()); + if (!swa_manager) + return; + auto system_app_type = swa_manager->GetSystemAppTypeForAppId(app.app_id); if (system_app_type.has_value()) { - auto* system_app = swa_manager_->GetSystemApp(*system_app_type); + auto* system_app = swa_manager->GetSystemApp(*system_app_type); DCHECK(system_app); app.show_in_launcher = system_app->ShouldShowInLauncher(); app.show_in_search = system_app->ShouldShowInSearch(); @@ -1830,10 +1841,12 @@ app->show_in_shelf = apps::mojom::OptionalBool::kTrue; #if BUILDFLAG(IS_CHROMEOS_ASH) - DCHECK(swa_manager_); - auto system_app_type = swa_manager_->GetSystemAppTypeForAppId(app->app_id); + auto* swa_manager = ash::SystemWebAppManager::Get(profile()); + if (!swa_manager) + return; + auto system_app_type = swa_manager->GetSystemAppTypeForAppId(app->app_id); if (system_app_type.has_value()) { - auto* system_app = swa_manager_->GetSystemApp(*system_app_type); + auto* system_app = swa_manager->GetSystemApp(*system_app_type); DCHECK(system_app); app->show_in_launcher = system_app->ShouldShowInLauncher() ? apps::mojom::OptionalBool::kTrue
diff --git a/chrome/browser/web_applications/app_service/web_app_publisher_helper.h b/chrome/browser/web_applications/app_service/web_app_publisher_helper.h index 04f7ca3..06f6b63 100644 --- a/chrome/browser/web_applications/app_service/web_app_publisher_helper.h +++ b/chrome/browser/web_applications/app_service/web_app_publisher_helper.h
@@ -11,7 +11,7 @@ #include <string> #include <vector> -#include "base/callback.h" +#include "base/functional/callback.h" #include "base/memory/raw_ptr.h" #include "base/memory/weak_ptr.h" #include "base/scoped_observation.h" @@ -19,7 +19,7 @@ #include "base/types/id_type.h" #include "build/build_config.h" #include "build/buildflag.h" -#include "chrome/browser/apps/app_service/app_icon/app_icon_factory.h" +#include "chrome/browser/apps/app_service/app_icon/app_icon_util.h" #include "chrome/browser/apps/app_service/app_icon/icon_key_util.h" #include "chrome/browser/apps/app_service/launch_result_type.h" #include "chrome/browser/apps/app_service/paused_apps.h" @@ -36,12 +36,12 @@ #include "components/content_settings/core/common/content_settings_types.h" #include "components/services/app_service/public/cpp/app_launch_util.h" #include "components/services/app_service/public/cpp/app_types.h" +#include "components/services/app_service/public/cpp/file_handler.h" #include "components/services/app_service/public/cpp/icon_types.h" #include "components/services/app_service/public/cpp/intent.h" +#include "components/services/app_service/public/cpp/intent_filter.h" #include "components/services/app_service/public/cpp/permission.h" -#include "components/services/app_service/public/mojom/app_service.mojom.h" #include "components/services/app_service/public/mojom/types.mojom-forward.h" -#include "components/services/app_service/public/mojom/types.mojom-shared.h" #include "components/webapps/browser/installable/installable_metrics.h" #include "third_party/abseil-cpp/absl/types/optional.h" #include "third_party/blink/public/mojom/manifest/display_mode.mojom-shared.h" @@ -51,30 +51,31 @@ #include "chrome/browser/apps/app_service/app_notifications.h" #include "chrome/browser/apps/app_service/app_web_contents_data.h" #include "chrome/browser/apps/app_service/media_requests.h" -#include "chrome/browser/badging/badge_manager.h" #include "chrome/browser/badging/badge_manager_delegate.h" #include "chrome/browser/media/webrtc/media_capture_devices_dispatcher.h" #include "chrome/browser/notifications/notification_common.h" #include "chrome/browser/notifications/notification_display_service.h" #include "content/public/browser/media_request_state.h" #include "third_party/blink/public/mojom/mediastream/media_stream.mojom-shared.h" -#include "ui/message_center/public/cpp/notification.h" #endif class ContentSettingsPattern; class ContentSettingsTypeSet; class Profile; - -namespace ash { -class SystemWebAppManager; -} +class GURL; namespace apps { +struct ShareTarget; struct AppLaunchParams; enum class RunOnOsLoginMode; } +namespace badging { +class BadgeManager; +} + namespace base { +class FilePath; class Time; } @@ -82,6 +83,10 @@ class WebContents; } +namespace message_center { +class Notification; +} + namespace web_app { class WebApp; @@ -129,7 +134,6 @@ WebAppPublisherHelper(Profile* profile, WebAppProvider* provider, - ash::SystemWebAppManager* swa_manager, Delegate* delegate, bool observe_media_requests); WebAppPublisherHelper(const WebAppPublisherHelper&) = delete; @@ -285,7 +289,7 @@ base::OnceCallback<void(const std::vector<content::WebContents*>&)> callback); - Profile* profile() { return profile_; } + Profile* profile() const { return profile_; } apps::AppType app_type() const { return app_type_; } @@ -428,8 +432,6 @@ const raw_ptr<Profile, DanglingUntriaged> profile_; const raw_ptr<WebAppProvider, DanglingUntriaged> provider_; - // nullptr for Lacros Chrome, valid pointer otherwise. - const raw_ptr<ash::SystemWebAppManager> swa_manager_; // The app type of the publisher. The app type is kSystemWeb if the web apps // are serving from Lacros, and the app type is kWeb for all other cases.
diff --git a/chrome/browser/web_applications/app_service/web_app_publisher_helper_unittest.cc b/chrome/browser/web_applications/app_service/web_app_publisher_helper_unittest.cc index 590fca21b..94723af 100644 --- a/chrome/browser/web_applications/app_service/web_app_publisher_helper_unittest.cc +++ b/chrome/browser/web_applications/app_service/web_app_publisher_helper_unittest.cc
@@ -9,14 +9,15 @@ #include <sstream> #include <utility> +#include "base/check.h" #include "base/strings/utf_string_conversions.h" #include "base/test/scoped_feature_list.h" #include "base/traits_bag.h" +#include "build/buildflag.h" #include "build/chromeos_buildflags.h" #include "chrome/browser/web_applications/test/web_app_install_test_utils.h" #include "chrome/browser/web_applications/test/web_app_test_utils.h" #include "chrome/browser/web_applications/web_app.h" -#include "chrome/browser/web_applications/web_app_chromeos_data.h" #include "chrome/browser/web_applications/web_app_install_info.h" #include "chrome/browser/web_applications/web_app_provider.h" #include "chrome/browser/web_applications/web_app_registrar.h" @@ -34,14 +35,6 @@ #include "testing/gtest/include/gtest/gtest.h" #include "url/gurl.h" -#if BUILDFLAG(IS_CHROMEOS_ASH) -#include "chrome/browser/ash/system_web_apps/test_support/test_system_web_app_manager.h" -#endif - -namespace ash { -class SystemWebAppManager; -} - namespace web_app { namespace { @@ -91,15 +84,8 @@ provider_ = WebAppProvider::GetForWebApps(profile()); - ash::SystemWebAppManager* swa_manager_ptr = nullptr; -#if BUILDFLAG(IS_CHROMEOS_ASH) - swa_manager_ = std::make_unique<ash::TestSystemWebAppManager>(profile()); - swa_manager_ptr = swa_manager_.get(); -#endif - publisher_ = std::make_unique<WebAppPublisherHelper>( - profile(), provider_, - /*swa_manager=*/swa_manager_ptr, &no_op_delegate_, + profile(), provider_, &no_op_delegate_, /*observe_media_requests=*/false); test::AwaitStartWebAppProviderAndSubsystems(profile()); @@ -112,9 +98,6 @@ NoOpWebAppPublisherDelegate no_op_delegate_; WebAppProvider* provider_; std::unique_ptr<WebAppPublisherHelper> publisher_; -#if BUILDFLAG(IS_CHROMEOS_ASH) - std::unique_ptr<ash::TestSystemWebAppManager> swa_manager_; -#endif }; TEST_F(WebAppPublisherHelperTest, CreateWebApp_Minimal) {
diff --git a/chrome/browser/web_applications/app_service/web_apps.cc b/chrome/browser/web_applications/app_service/web_apps.cc index 94cff400..75ae0ff 100644 --- a/chrome/browser/web_applications/app_service/web_apps.cc +++ b/chrome/browser/web_applications/app_service/web_apps.cc
@@ -6,29 +6,16 @@ #include <utility> -#include "base/callback.h" -#include "base/callback_helpers.h" #include "base/feature_list.h" -#include "base/functional/bind.h" -#include "base/functional/callback_helpers.h" +#include "chrome/browser/apps/app_service/app_icon/app_icon_factory.h" #include "chrome/browser/apps/app_service/app_launch_params.h" #include "chrome/browser/apps/app_service/app_service_proxy.h" -#include "chrome/browser/apps/app_service/intent_util.h" -#include "chrome/browser/apps/app_service/launch_utils.h" -#include "chrome/browser/content_settings/host_content_settings_map_factory.h" #include "chrome/browser/profiles/profile.h" #include "chrome/browser/web_applications/web_app.h" -#include "chrome/browser/web_applications/web_app_constants.h" -#include "chrome/browser/web_applications/web_app_helpers.h" -#include "chrome/browser/web_applications/web_app_install_finalizer.h" #include "chrome/browser/web_applications/web_app_provider.h" #include "chrome/browser/web_applications/web_app_registrar.h" #include "chrome/browser/web_applications/web_app_utils.h" -#include "components/content_settings/core/common/content_settings.h" -#include "components/content_settings/core/common/content_settings_pattern.h" -#include "components/content_settings/core/common/content_settings_types.h" #include "components/services/app_service/public/cpp/features.h" -#include "components/webapps/browser/installable/installable_metrics.h" #if BUILDFLAG(IS_CHROMEOS_ASH) #include "ash/public/cpp/app_menu_constants.h" @@ -65,19 +52,11 @@ provider_(WebAppProvider::GetForLocalAppsUnchecked(profile_)), #if BUILDFLAG(IS_CHROMEOS_ASH) instance_registry_(&proxy->InstanceRegistry()), - publisher_helper_(profile_, - provider_, - ash::SystemWebAppManager::Get(profile_), - this, - ShouldObserveMediaRequests()) -#else - publisher_helper_(profile_, - provider_, - /*swa_manager=*/nullptr, - this, - ShouldObserveMediaRequests()) #endif -{ + publisher_helper_(profile_, + provider_, + this, + ShouldObserveMediaRequests()) { Initialize(proxy->AppService()); } @@ -200,13 +179,13 @@ } apps::MenuItems menu_items; - if (web_app->IsSystemApp()) { + auto* swa_manager = ash::SystemWebAppManager::Get(profile()); + if (swa_manager && swa_manager->IsSystemWebApp(web_app->app_id())) { DCHECK(web_app->client_data().system_web_app_data.has_value()); ash::SystemWebAppType swa_type = web_app->client_data().system_web_app_data->system_app_type; - auto* system_app = - ash::SystemWebAppManager::Get(profile())->GetSystemApp(swa_type); + auto* system_app = swa_manager->GetSystemApp(swa_type); if (system_app && system_app->ShouldShowNewWindowMenuOption()) { apps::AddCommandItem(ash::LAUNCH_NEW, IDS_APP_LIST_CONTEXT_MENU_NEW_WINDOW, menu_items);
diff --git a/chrome/browser/web_applications/web_app_data_retriever.cc b/chrome/browser/web_applications/web_app_data_retriever.cc index 3c2bfc4c..784da89 100644 --- a/chrome/browser/web_applications/web_app_data_retriever.cc +++ b/chrome/browser/web_applications/web_app_data_retriever.cc
@@ -50,7 +50,7 @@ content::NavigationEntry* entry = web_contents->GetController().GetLastCommittedEntry(); - if (!entry || entry->IsInitialEntry()) { + if (entry->IsInitialEntry()) { base::ThreadTaskRunnerHandle::Get()->PostTask( FROM_HERE, base::BindOnce(&WebAppDataRetriever::CallCallbackOnError, weak_ptr_factory_.GetWeakPtr())); @@ -175,7 +175,7 @@ content::NavigationEntry* entry = contents->GetController().GetLastCommittedEntry(); - if (entry && !entry->IsInitialEntry()) { + if (!entry->IsInitialEntry()) { if (entry->GetUniqueID() == last_committed_nav_entry_unique_id) { info = std::make_unique<WebAppInstallInfo>(*web_page_metadata); if (info->start_url.is_empty())
diff --git a/chrome/browser/window_management/DIR_METADATA b/chrome/browser/window_management/DIR_METADATA index c8b762a..9125e16 100644 --- a/chrome/browser/window_management/DIR_METADATA +++ b/chrome/browser/window_management/DIR_METADATA
@@ -1,4 +1,4 @@ monorail: { - component: "UI>Browser>WebAppInstalls" + component: "Blink>Screen>MultiScreen" } team_email: "pwa-dev@chromium.org"
diff --git a/chrome/build/linux.pgo.txt b/chrome/build/linux.pgo.txt index 7676172..08ba915 100644 --- a/chrome/build/linux.pgo.txt +++ b/chrome/build/linux.pgo.txt
@@ -1 +1 @@ -chrome-linux-main-1668707896-feee6a0f31179142e5e9ad02536ca3decbac14a8.profdata +chrome-linux-main-1668729482-dae03be88903b96c0cb8dab14f08e8268d432145.profdata
diff --git a/chrome/build/mac-arm.pgo.txt b/chrome/build/mac-arm.pgo.txt index 50a7a91..f1088bc 100644 --- a/chrome/build/mac-arm.pgo.txt +++ b/chrome/build/mac-arm.pgo.txt
@@ -1 +1 @@ -chrome-mac-arm-main-1668707896-9936320b265257e55703a04d19394c1abb150e8a.profdata +chrome-mac-arm-main-1668729482-a579f9d50b0e3f0452bcbffb10fd12ec4b4d4420.profdata
diff --git a/chrome/build/mac.pgo.txt b/chrome/build/mac.pgo.txt index fcddae4c..dd3cfcf 100644 --- a/chrome/build/mac.pgo.txt +++ b/chrome/build/mac.pgo.txt
@@ -1 +1 @@ -chrome-mac-main-1668707896-4b121f80e782118ba3871df21ee31a2b387b662d.profdata +chrome-mac-main-1668729482-08450af1d482d5db59d38586aa4751ad5f2c5dba.profdata
diff --git a/chrome/build/win32.pgo.txt b/chrome/build/win32.pgo.txt index b5573d4c..2e452a5 100644 --- a/chrome/build/win32.pgo.txt +++ b/chrome/build/win32.pgo.txt
@@ -1 +1 @@ -chrome-win32-main-1668697173-0207b40b1d529c5464b54f6774df41b5e0365470.profdata +chrome-win32-main-1668729482-cda98716d89013ed34a00bfc4c3d23cdb303195d.profdata
diff --git a/chrome/build/win64.pgo.txt b/chrome/build/win64.pgo.txt index 0f6246d..f15a826 100644 --- a/chrome/build/win64.pgo.txt +++ b/chrome/build/win64.pgo.txt
@@ -1 +1 @@ -chrome-win64-main-1668707896-8a0a24799b42d3ec888f4e0edaa3661dbfe1e546.profdata +chrome-win64-main-1668729482-f0dc1ff845c24bd6650354d4915408b19fd85051.profdata
diff --git a/chrome/chrome_cleaner/engines/broker/engine_client.cc b/chrome/chrome_cleaner/engines/broker/engine_client.cc index d3c7dd9..881359c 100644 --- a/chrome/chrome_cleaner/engines/broker/engine_client.cc +++ b/chrome/chrome_cleaner/engines/broker/engine_client.cc
@@ -222,10 +222,10 @@ void EngineClient::PostBindEngineCommandsRemote( mojo::ScopedMessagePipeHandle pipe) { mojo_task_runner_->PostTask( - FROM_HERE, base::BindOnce(&EngineClient::BindEngineCommandsRemote, - base::RetainedRef(this), std::move(pipe), - base::BindOnce(connection_error_callback_, - SandboxType::kEngine))); + FROM_HERE, + base::BindOnce( + &EngineClient::BindEngineCommandsRemote, this, std::move(pipe), + base::BindOnce(connection_error_callback_, SandboxType::kEngine))); } void EngineClient::BindEngineCommandsRemote(mojo::ScopedMessagePipeHandle pipe,
diff --git a/chrome/chrome_cleaner/ipc/ipc_test_util.cc b/chrome/chrome_cleaner/ipc/ipc_test_util.cc index 9614991..d3934d5 100644 --- a/chrome/chrome_cleaner/ipc/ipc_test_util.cc +++ b/chrome/chrome_cleaner/ipc/ipc_test_util.cc
@@ -70,14 +70,13 @@ void ParentProcess::CreateImplOnIPCThread( mojo::ScopedMessagePipeHandle mojo_pipe) { mojo_task_runner_->PostTask( - FROM_HERE, base::BindOnce(&ParentProcess::CreateImpl, - base::RetainedRef(this), std::move(mojo_pipe))); + FROM_HERE, + base::BindOnce(&ParentProcess::CreateImpl, this, std::move(mojo_pipe))); } void ParentProcess::DestroyImplOnIPCThread() { mojo_task_runner_->PostTask( - FROM_HERE, - base::BindOnce(&ParentProcess::DestroyImpl, base::RetainedRef(this))); + FROM_HERE, base::BindOnce(&ParentProcess::DestroyImpl, this)); } void ParentProcess::AppendSwitch(const std::string& switch_string) {
diff --git a/chrome/common/chrome_content_client_unittest.cc b/chrome/common/chrome_content_client_unittest.cc index 63b6045d..accdd76 100644 --- a/chrome/common/chrome_content_client_unittest.cc +++ b/chrome/common/chrome_content_client_unittest.cc
@@ -69,7 +69,7 @@ GURL chrome_url(content::GetWebUIURL("dummyurl")); EXPECT_TRUE(network::IsUrlPotentiallyTrustworthy(chrome_url)); - EXPECT_FALSE(content::OriginCanAccessServiceWorkers(chrome_url)); + EXPECT_TRUE(content::OriginCanAccessServiceWorkers(chrome_url)); EXPECT_TRUE( network::IsOriginPotentiallyTrustworthy(url::Origin::Create(chrome_url))); }
diff --git a/chrome/test/data/webui/chromeos/cloud_upload/cloud_upload_app_test.ts b/chrome/test/data/webui/chromeos/cloud_upload/cloud_upload_app_test.ts index 541efa6..20caa889 100644 --- a/chrome/test/data/webui/chromeos/cloud_upload/cloud_upload_app_test.ts +++ b/chrome/test/data/webui/chromeos/cloud_upload/cloud_upload_app_test.ts
@@ -4,14 +4,13 @@ import 'chrome://cloud-upload/cloud_upload_dialog.js'; -import {CloudProvider, DialogArgs, DialogPage, PageHandlerRemote, UserAction} from 'chrome://cloud-upload/cloud_upload.mojom-webui.js'; +import {DialogArgs, DialogPage, PageHandlerRemote, UserAction} from 'chrome://cloud-upload/cloud_upload.mojom-webui.js'; import {CloudUploadBrowserProxy} from 'chrome://cloud-upload/cloud_upload_browser_proxy.js'; import {CloudUploadElement} from 'chrome://cloud-upload/cloud_upload_dialog.js'; import {assertDeepEquals, assertEquals, assertFalse, assertNotEquals, assertTrue} from 'chrome://webui-test/chai_assert.js'; import {TestBrowserProxy} from 'chrome://webui-test/test_browser_proxy.js'; interface ProxyOptions { - uploadType: CloudProvider; fileName?: string|null; officePWAInstalled: boolean; } @@ -26,7 +25,6 @@ constructor(options: ProxyOptions) { this.handler = TestBrowserProxy.fromClass(PageHandlerRemote); const args: DialogArgs = { - cloudProvider: options.uploadType, fileNames: [], dialogPage: DialogPage.kOneDriveSetup, }; @@ -52,7 +50,7 @@ called. */ let testProxy: CloudUploadTestBrowserProxy; - const setupForUploadType = async (options: ProxyOptions) => { + const setUp = async (options: ProxyOptions) => { testProxy = new CloudUploadTestBrowserProxy(options); CloudUploadBrowserProxy.setInstance(testProxy); @@ -104,8 +102,7 @@ * file. */ test('Set up OneDrive with file', async () => { - await setupForUploadType({ - uploadType: CloudProvider.kOneDrive, + await setUp({ fileName: 'file.docx', officePWAInstalled: false, }); @@ -124,8 +121,7 @@ * file. */ test('Set up OneDrive without file', async () => { - await setupForUploadType({ - uploadType: CloudProvider.kOneDrive, + await setUp({ officePWAInstalled: false, }); @@ -139,8 +135,7 @@ }); test('Set up OneDrive with Office PWA already installed', async () => { - await setupForUploadType({ - uploadType: CloudProvider.kOneDrive, + await setUp({ officePWAInstalled: true, }); @@ -159,8 +154,7 @@ * `respondAndClose` mojo request. */ test('Open file button', async () => { - await setupForUploadType({ - uploadType: CloudProvider.kGoogleDrive, + await setUp({ fileName: 'file.docx', officePWAInstalled: false, }); @@ -174,7 +168,8 @@ await testProxy.handler.whenCalled('respondAndClose'); assertEquals(1, testProxy.handler.getCallCount('respondAndClose')); assertDeepEquals( - [UserAction.kUpload], testProxy.handler.getArgs('respondAndClose')); + [UserAction.kUploadToOneDrive], + testProxy.handler.getArgs('respondAndClose')); }); /** @@ -182,8 +177,7 @@ * mojo request. */ test('Close button', async () => { - await setupForUploadType({ - uploadType: CloudProvider.kGoogleDrive, + await setUp({ fileName: 'file.docx', officePWAInstalled: false, });
diff --git a/chrome/test/data/webui/new_tab_page/realbox/realbox_test.ts b/chrome/test/data/webui/new_tab_page/realbox/realbox_test.ts index 8586ed7..1a6e525 100644 --- a/chrome/test/data/webui/new_tab_page/realbox/realbox_test.ts +++ b/chrome/test/data/webui/new_tab_page/realbox/realbox_test.ts
@@ -2056,8 +2056,6 @@ test( 'match icons are updated when entity images become available', async () => { - const imageData = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAC='; - realbox.$.input.value = 'hello'; realbox.$.input.dispatchEvent(new InputEvent('input')); @@ -2122,28 +2120,13 @@ containerEl, 'background-color', 'rgba(117, 117, 117, 0.25)'); assertIconMaskImageUrl(realbox.$.icon, 'search.svg'); // Default icon. - // URL of the loaded image must match image URL of the match. - testProxy.callbackRouterRemote.autocompleteMatchImageAvailable( - 1, {url: 'http://example.com/'}, imageData); - await testProxy.callbackRouterRemote.$.flushForTesting(); - assertStyle( - containerEl, 'background-color', 'rgba(117, 117, 117, 0.25)'); - assertIconMaskImageUrl(realbox.$.icon, 'search.svg'); // Default icon. - - // Index of the loaded image must match index of the match. - testProxy.callbackRouterRemote.autocompleteMatchImageAvailable( - 0, {url: 'https://gstatic.com/'}, imageData); - await testProxy.callbackRouterRemote.$.flushForTesting(); - assertStyle( - containerEl, 'background-color', 'rgba(117, 117, 117, 0.25)'); - assertIconMaskImageUrl(realbox.$.icon, 'search.svg'); // Default icon. - - // Once the image successfully loads it replaces the match icon. - testProxy.callbackRouterRemote.autocompleteMatchImageAvailable( - 1, {url: 'https://gstatic.com/'}, imageData); - await testProxy.callbackRouterRemote.$.flushForTesting(); assertEquals( - matchEls[1]!.$.icon.$.image.getAttribute('src'), imageData); + matchEls[1]!.$.icon.$.image.getAttribute('src'), + `chrome://image?${matches[1]!.imageUrl}`); + + // Mock image finishing loading, which should remove the temporary + // background color. + matchEls[1]!.$.icon.$.image.dispatchEvent(new Event('load')); assertStyle(containerEl, 'background-color', 'rgba(0, 0, 0, 0)'); // Realbox icon is not updated as the input does not feature images. assertIconMaskImageUrl(realbox.$.icon, 'search.svg'); // Default icon.
diff --git a/chrome/test/data/webui/print_preview/advanced_item_test.ts b/chrome/test/data/webui/print_preview/advanced_item_test.ts index 5a781840..7a14bfc 100644 --- a/chrome/test/data/webui/print_preview/advanced_item_test.ts +++ b/chrome/test/data/webui/print_preview/advanced_item_test.ts
@@ -5,7 +5,6 @@ import 'chrome://print/print_preview.js'; import {PrintPreviewAdvancedSettingsItemElement, PrintPreviewModelElement} from 'chrome://print/print_preview.js'; -import {assert} from 'chrome://resources/js/assert.js'; import {flush} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js'; import {assertEquals, assertFalse, assertTrue} from 'chrome://webui-test/chai_assert.js'; import {fakeDataBind} from 'chrome://webui-test/polymer_test_util.js'; @@ -52,7 +51,7 @@ }); // Test that a select capability is displayed correctly. - test(assert(advanced_item_test.TestNames.DisplaySelect), function() { + test(advanced_item_test.TestNames.DisplaySelect, function() { const label = item.shadowRoot!.querySelector('.label')!; assertEquals('Paper Type', label.textContent); @@ -70,7 +69,7 @@ item.shadowRoot!.querySelector('cr-checkbox')!.parentElement!.hidden); }); - test(assert(advanced_item_test.TestNames.DisplayInput), function() { + test(advanced_item_test.TestNames.DisplayInput, function() { // Create capability item.capability = getCddTemplateWithAdvancedSettings(3, 'FooDevice') .capabilities!.printer.vendor_capability![2]!; @@ -90,7 +89,7 @@ item.shadowRoot!.querySelector('cr-checkbox')!.parentElement!.hidden); }); - test(assert(advanced_item_test.TestNames.DisplayCheckbox), function() { + test(advanced_item_test.TestNames.DisplayCheckbox, function() { // Create capability item.capability = getCddTemplateWithAdvancedSettings(4, 'FooDevice') .capabilities!.printer.vendor_capability![3]!; @@ -112,7 +111,7 @@ // Test that a select capability updates correctly when the setting is // updated (e.g. when sticky settings are set). - test(assert(advanced_item_test.TestNames.UpdateSelect), function() { + test(advanced_item_test.TestNames.UpdateSelect, function() { // Check that the default option is selected. const select = item.shadowRoot!.querySelector('select')!; assertEquals(0, select.selectedIndex); @@ -124,7 +123,7 @@ // Test that an input capability updates correctly when the setting is // updated (e.g. when sticky settings are set). - test(assert(advanced_item_test.TestNames.UpdateInput), function() { + test(advanced_item_test.TestNames.UpdateInput, function() { // Create capability item.capability = getCddTemplateWithAdvancedSettings(3, 'FooDevice') .capabilities!.printer.vendor_capability![2]!; @@ -141,7 +140,7 @@ // Test that an checkbox capability updates correctly when the setting is // updated (e.g. when sticky settings are set). - test(assert(advanced_item_test.TestNames.UpdateCheckbox), function() { + test(advanced_item_test.TestNames.UpdateCheckbox, function() { // Create capability item.capability = getCddTemplateWithAdvancedSettings(4, 'FooDevice') .capabilities!.printer.vendor_capability![3]!; @@ -158,7 +157,7 @@ // Test that the setting is displayed correctly when the search query // matches its display name. - test(assert(advanced_item_test.TestNames.QueryName), function() { + test(advanced_item_test.TestNames.QueryName, function() { const query = /(Type)/ig; assertTrue(item.hasMatch(query)); item.updateHighlighting(query, new Map()); @@ -181,7 +180,7 @@ // Test that the setting is displayed correctly when the search query // matches one of the select options. - test(assert(advanced_item_test.TestNames.QueryOption), function() { + test(advanced_item_test.TestNames.QueryOption, function() { const query = /(cycle)/ig; assertTrue(item.hasMatch(query)); item.updateHighlighting(query, new Map());
diff --git a/chrome/test/data/webui/print_preview/button_strip_interactive_test.ts b/chrome/test/data/webui/print_preview/button_strip_interactive_test.ts index 335f05b4..e02b6f8 100644 --- a/chrome/test/data/webui/print_preview/button_strip_interactive_test.ts +++ b/chrome/test/data/webui/print_preview/button_strip_interactive_test.ts
@@ -3,7 +3,7 @@ // found in the LICENSE file. import {Destination, DestinationOrigin, PrintPreviewButtonStripElement, State} from 'chrome://print/print_preview.js'; -import {assert} from 'chrome://resources/js/assert.js'; +import {assert} from 'chrome://resources/js/assert_ts.js'; import {eventToPromise} from 'chrome://webui-test/test_util.js'; const button_strip_interactive_test = { @@ -35,15 +35,13 @@ // Tests that the print button is automatically focused when the destination // is ready. - test( - assert(button_strip_interactive_test.TestNames.FocusPrintOnReady), - function() { - const printButton = - assert(buttonStrip.shadowRoot!.querySelector('.action-button')); - const whenFocusDone = eventToPromise('focus', printButton!); + test(button_strip_interactive_test.TestNames.FocusPrintOnReady, function() { + const printButton = buttonStrip.shadowRoot!.querySelector('.action-button'); + assert(printButton); + const whenFocusDone = eventToPromise('focus', printButton); - // Simulate initialization finishing. - buttonStrip.state = State.READY; - return whenFocusDone; - }); + // Simulate initialization finishing. + buttonStrip.state = State.READY; + return whenFocusDone; + }); });
diff --git a/chrome/test/data/webui/print_preview/button_strip_test.ts b/chrome/test/data/webui/print_preview/button_strip_test.ts index e79cafc8..cd3f51bc 100644 --- a/chrome/test/data/webui/print_preview/button_strip_test.ts +++ b/chrome/test/data/webui/print_preview/button_strip_test.ts
@@ -3,7 +3,6 @@ // found in the LICENSE file. import {CrButtonElement, Destination, DestinationOrigin, PrintPreviewButtonStripElement, State} from 'chrome://print/print_preview.js'; -import {assert} from 'chrome://resources/js/assert.js'; import {assertEquals, assertFalse, assertTrue} from 'chrome://webui-test/chai_assert.js'; import {eventToPromise} from 'chrome://webui-test/test_util.js'; @@ -37,8 +36,7 @@ // Tests that the correct message is shown for non-READY states, and that // the print button is disabled appropriately. test( - assert(button_strip_test.TestNames.ButtonStripChangesForState), - function() { + button_strip_test.TestNames.ButtonStripChangesForState, function() { const printButton = buttonStrip.shadowRoot!.querySelector<CrButtonElement>( '.action-button')!; @@ -59,7 +57,7 @@ // Tests that the buttons are in the correct order for different platforms. // See https://crbug.com/880562. - test(assert(button_strip_test.TestNames.ButtonOrder), function() { + test(button_strip_test.TestNames.ButtonOrder, function() { // Verify that there are only 2 buttons. assertEquals( 2, buttonStrip.shadowRoot!.querySelectorAll('cr-button').length); @@ -86,7 +84,7 @@ // Tests that the button strip fires print-requested and cancel-requested // events. - test(assert(button_strip_test.TestNames.ButtonStripFiresEvents), function() { + test(button_strip_test.TestNames.ButtonStripFiresEvents, function() { const printButton = buttonStrip.shadowRoot!.querySelector<HTMLElement>( 'cr-button.action-button')!; const cancelButton = buttonStrip.shadowRoot!.querySelector<HTMLElement>(
diff --git a/chrome/test/data/webui/print_preview/custom_margins_test.ts b/chrome/test/data/webui/print_preview/custom_margins_test.ts index be989ded..c4195e1 100644 --- a/chrome/test/data/webui/print_preview/custom_margins_test.ts +++ b/chrome/test/data/webui/print_preview/custom_margins_test.ts
@@ -3,7 +3,7 @@ // found in the LICENSE file. import {CustomMarginsOrientation, Margins, MarginsSetting, MarginsType, MeasurementSystem, MeasurementSystemUnitType, PrintPreviewMarginControlContainerElement, PrintPreviewMarginControlElement, PrintPreviewModelElement, Size, State} from 'chrome://print/print_preview.js'; -import {assert, assertNotReached} from 'chrome://resources/js/assert.js'; +import {assertNotReached} from 'chrome://resources/js/assert_ts.js'; import {flush} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js'; import {assertEquals, assertFalse, assertTrue} from 'chrome://webui-test/chai_assert.js'; import {fakeDataBind} from 'chrome://webui-test/polymer_test_util.js'; @@ -266,7 +266,7 @@ // Test that controls correctly appear when custom margins are selected and // disappear when the preview is loading. - test(assert(custom_margins_test.TestNames.ControlsCheck), function() { + test(custom_margins_test.TestNames.ControlsCheck, function() { const getCustomMarginsValue = function(): MarginsSetting { return container.getSettingValue('customMargins') as MarginsSetting; }; @@ -325,7 +325,7 @@ // Tests that the margin controls can be correctly set from the sticky // settings. - test(assert(custom_margins_test.TestNames.SetFromStickySettings), function() { + test(custom_margins_test.TestNames.SetFromStickySettings, function() { return finishSetup().then(() => { const controls = getControls(); @@ -345,7 +345,7 @@ }); // Test that dragging margin controls updates the custom margins setting. - test(assert(custom_margins_test.TestNames.DragControls), function() { + test(custom_margins_test.TestNames.DragControls, function() { /** * Tests that the control can be moved from its current position (assumed * to be the default margins) to newPositionInPts by dragging it. @@ -428,7 +428,7 @@ // Test that setting the margin controls with their textbox inputs updates // the custom margins setting. test( - assert(custom_margins_test.TestNames.SetControlsWithTextbox), function() { + custom_margins_test.TestNames.SetControlsWithTextbox, function() { return finishSetup().then(() => { const controls = getControls(); // Set a shorter delay for testing so the test doesn't take too @@ -475,8 +475,7 @@ // as the decimal delimiter and '.' as the thousands delimiter. Regression // test for https://crbug.com/1005816. test( - assert(custom_margins_test.TestNames.SetControlsWithTextboxMetric), - function() { + custom_margins_test.TestNames.SetControlsWithTextboxMetric, function() { measurementSystem = new MeasurementSystem('.', ',', MeasurementSystemUnitType.METRIC); return finishSetup().then(() => { @@ -538,7 +537,7 @@ // Test that if there is a custom margins sticky setting, it is restored // when margin setting changes. test( - assert(custom_margins_test.TestNames.RestoreStickyMarginsAfterDefault), + custom_margins_test.TestNames.RestoreStickyMarginsAfterDefault, function() { const marginValues = setupCustomMargins(); return finishSetup().then(() => { @@ -567,8 +566,7 @@ // Test that if the media size changes, the custom margins are cleared. test( - assert(custom_margins_test.TestNames.MediaSizeClearsCustomMargins), - function() { + custom_margins_test.TestNames.MediaSizeClearsCustomMargins, function() { return validateMarginsClearedForSetting( 'mediaSize', {height_microns: 200000, width_microns: 200000}) .then(() => { @@ -588,8 +586,7 @@ // Test that if the orientation changes, the custom margins are cleared. test( - assert(custom_margins_test.TestNames.LayoutClearsCustomMargins), - function() { + custom_margins_test.TestNames.LayoutClearsCustomMargins, function() { return validateMarginsClearedForSetting('layout', true).then(() => { // Simulate setting custom margins again model.set('settings.margins.value', MarginsType.CUSTOM); @@ -609,8 +606,7 @@ // not updated based on the document margins - i.e. PDFs do not change the // custom margins state. test( - assert(custom_margins_test.TestNames.IgnoreDocumentMarginsFromPDF), - function() { + custom_margins_test.TestNames.IgnoreDocumentMarginsFromPDF, function() { model.set('settings.margins.available', false); return finishSetup().then(() => { assertEquals( @@ -621,7 +617,7 @@ // Test that if margins are not available but the user changes the media // size, the custom margins are cleared. test( - assert(custom_margins_test.TestNames.MediaSizeClearsCustomMarginsPDF), + custom_margins_test.TestNames.MediaSizeClearsCustomMarginsPDF, function() { model.set('settings.margins.available', false); return validateMarginsClearedForSetting( @@ -635,7 +631,7 @@ // Test that if the user focuses a textbox that is not visible, the // text-focus event is fired with the correct values to scroll by. test( - assert(custom_margins_test.TestNames.RequestScrollToOutOfBoundsTextbox), + custom_margins_test.TestNames.RequestScrollToOutOfBoundsTextbox, function() { return finishSetup() .then(() => { @@ -694,8 +690,7 @@ // Tests that the margin controls can be correctly set from the sticky // settings. test( - assert(custom_margins_test.TestNames.ControlsDisabledOnError), - function() { + custom_margins_test.TestNames.ControlsDisabledOnError, function() { return finishSetup().then(() => { // Simulate setting custom margins. model.set('settings.margins.value', MarginsType.CUSTOM);
diff --git a/chrome/test/data/webui/print_preview/destination_dialog_cros_interactive_test.ts b/chrome/test/data/webui/print_preview/destination_dialog_cros_interactive_test.ts index d644ed6..990a0a40 100644 --- a/chrome/test/data/webui/print_preview/destination_dialog_cros_interactive_test.ts +++ b/chrome/test/data/webui/print_preview/destination_dialog_cros_interactive_test.ts
@@ -3,7 +3,6 @@ // found in the LICENSE file. import {NativeLayerImpl, PrintPreviewDestinationDialogCrosElement, State} from 'chrome://print/print_preview.js'; -import {assert} from 'chrome://resources/js/assert.js'; import {keyDownOn} from 'chrome://resources/polymer/v3_0/iron-test-helpers/mock-interactions.js'; import {assertEquals, assertFalse, assertTrue} from 'chrome://webui-test/chai_assert.js'; import {fakeDataBind} from 'chrome://webui-test/polymer_test_util.js'; @@ -69,7 +68,7 @@ // Tests that the search input text field is automatically focused when the // dialog is shown. test( - assert(destination_dialog_cros_interactive_test.TestNames.FocusSearchBox), + destination_dialog_cros_interactive_test.TestNames.FocusSearchBox, function() { const searchInput = dialog.$.searchBox.getSearchInput(); assertTrue(!!searchInput); @@ -82,8 +81,7 @@ // Tests that pressing the escape key while the search box is focused // closes the dialog if and only if the query is empty. test( - assert( - destination_dialog_cros_interactive_test.TestNames.EscapeSearchBox), + destination_dialog_cros_interactive_test.TestNames.EscapeSearchBox, function() { const searchBox = dialog.$.searchBox; const searchInput = searchBox.getSearchInput();
diff --git a/chrome/test/data/webui/print_preview/destination_dialog_cros_test.ts b/chrome/test/data/webui/print_preview/destination_dialog_cros_test.ts index cabe54a..60c8f95 100644 --- a/chrome/test/data/webui/print_preview/destination_dialog_cros_test.ts +++ b/chrome/test/data/webui/print_preview/destination_dialog_cros_test.ts
@@ -3,7 +3,6 @@ // found in the LICENSE file. import {Destination, DestinationStore, LocalDestinationInfo, makeRecentDestination, NativeLayerImpl, PrintPreviewDestinationDialogCrosElement, RecentDestination} from 'chrome://print/print_preview.js'; -import {assert} from 'chrome://resources/js/assert.js'; import {webUIListenerCallback} from 'chrome://resources/js/cr.js'; import {keyEventOn} from 'chrome://resources/polymer/v3_0/iron-test-helpers/mock-interactions.js'; import {flush} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js'; @@ -83,7 +82,7 @@ // destinations dialog, and that the escape key closes only the provisional // dialog when it is open, not the destinations dialog. test( - assert(destination_dialog_cros_test.TestNames.ShowProvisionalDialog), + destination_dialog_cros_test.TestNames.ShowProvisionalDialog, async () => { const provisionalDestination = { extensionId: 'ABC123', @@ -132,8 +131,7 @@ // Test that checks that print server searchable input and its selections are // updated according to the PRINT_SERVERS_CHANGED event. test( - assert(destination_dialog_cros_test.TestNames.PrintServersChanged), - async () => { + destination_dialog_cros_test.TestNames.PrintServersChanged, async () => { await finishSetup(); const printServers = [ @@ -163,8 +161,7 @@ // Tests that choosePrintServers is called when the print server searchable // input value is changed. test( - assert(destination_dialog_cros_test.TestNames.PrintServerSelected), - async () => { + destination_dialog_cros_test.TestNames.PrintServerSelected, async () => { await finishSetup(); const printServers = [ {id: 'user-print-server-1', name: 'Print Server 1'},
diff --git a/chrome/test/data/webui/print_preview/destination_dialog_interactive_test.ts b/chrome/test/data/webui/print_preview/destination_dialog_interactive_test.ts index 68b4e24..5e15d60 100644 --- a/chrome/test/data/webui/print_preview/destination_dialog_interactive_test.ts +++ b/chrome/test/data/webui/print_preview/destination_dialog_interactive_test.ts
@@ -3,7 +3,6 @@ // found in the LICENSE file. import {NativeLayerImpl, PrintPreviewDestinationDialogElement, State} from 'chrome://print/print_preview.js'; -import {assert} from 'chrome://resources/js/assert.js'; import {keyDownOn} from 'chrome://resources/polymer/v3_0/iron-test-helpers/mock-interactions.js'; import {assertEquals, assertFalse, assertTrue} from 'chrome://webui-test/chai_assert.js'; import {fakeDataBind} from 'chrome://webui-test/polymer_test_util.js'; @@ -66,8 +65,7 @@ // Tests that the search input text field is automatically focused when the // dialog is shown. test( - assert(destination_dialog_interactive_test.TestNames.FocusSearchBox), - function() { + destination_dialog_interactive_test.TestNames.FocusSearchBox, function() { const searchInput = dialog.$.searchBox.getSearchInput(); assertTrue(!!searchInput); const whenFocusDone = eventToPromise('focus', searchInput); @@ -79,7 +77,7 @@ // Tests that pressing the escape key while the search box is focused // closes the dialog if and only if the query is empty. test( - assert(destination_dialog_interactive_test.TestNames.EscapeSearchBox), + destination_dialog_interactive_test.TestNames.EscapeSearchBox, function() { const searchBox = dialog.$.searchBox; const searchInput = searchBox.getSearchInput();
diff --git a/chrome/test/data/webui/print_preview/destination_dialog_test.ts b/chrome/test/data/webui/print_preview/destination_dialog_test.ts index 3011954..a695164 100644 --- a/chrome/test/data/webui/print_preview/destination_dialog_test.ts +++ b/chrome/test/data/webui/print_preview/destination_dialog_test.ts
@@ -10,7 +10,6 @@ PrintPreviewDestinationDialogElement, // </if> PrintPreviewDestinationListItemElement} from 'chrome://print/print_preview.js'; -import {assert} from 'chrome://resources/js/assert.js'; import {flush} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js'; import {assertEquals} from 'chrome://webui-test/chai_assert.js'; @@ -106,7 +105,7 @@ } // Test that destinations are correctly displayed in the lists. - test(assert(destination_dialog_test.TestNames.PrinterList), async () => { + test(destination_dialog_test.TestNames.PrinterList, async () => { // Native printers are fetched at startup, since the recent printer is set // as native. let whenPrinterListReady = nativeLayer.waitForGetPrinters(1); @@ -128,8 +127,7 @@ // printers have been preloaded before the dialog is opened. Regression test // for https://crbug.com/1330678. test( - assert(destination_dialog_test.TestNames.PrinterListPreloaded), - async () => { + destination_dialog_test.TestNames.PrinterListPreloaded, async () => { // All printers are fetched at startup since both native and extension // printers are recent. const whenAllPreloaded = nativeLayer.waitForGetPrinters(2);
diff --git a/chrome/test/data/webui/print_preview/destination_dropdown_cros_test.ts b/chrome/test/data/webui/print_preview/destination_dropdown_cros_test.ts index f1107a9..2cc70323 100644 --- a/chrome/test/data/webui/print_preview/destination_dropdown_cros_test.ts +++ b/chrome/test/data/webui/print_preview/destination_dropdown_cros_test.ts
@@ -94,8 +94,7 @@ }); test( - assert(destination_dropdown_cros_test.TestNames.CorrectListItems), - function() { + destination_dropdown_cros_test.TestNames.CorrectListItems, function() { setItemList([ createDestination('One', DestinationOrigin.CROS), createDestination('Two', DestinationOrigin.CROS), @@ -109,31 +108,29 @@ assertEquals('Three', itemList[2]!.textContent!.trim()); }); - test( - assert(destination_dropdown_cros_test.TestNames.ClickCloses), function() { - const destinationOne = createDestination('One', DestinationOrigin.CROS); - setItemList([destinationOne]); - dropdown.value = destinationOne; - const ironDropdown = - dropdown.shadowRoot!.querySelector('iron-dropdown')!; + test(destination_dropdown_cros_test.TestNames.ClickCloses, function() { + const destinationOne = createDestination('One', DestinationOrigin.CROS); + setItemList([destinationOne]); + dropdown.value = destinationOne; + const ironDropdown = dropdown.shadowRoot!.querySelector('iron-dropdown')!; - clickDropdownFocus(); - assertTrue(ironDropdown.opened); + clickDropdownFocus(); + assertTrue(ironDropdown.opened); - getList()[0]!.click(); - assertFalse(ironDropdown.opened); + getList()[0]!.click(); + assertFalse(ironDropdown.opened); - clickDropdownFocus(); - assertTrue(ironDropdown.opened); + clickDropdownFocus(); + assertTrue(ironDropdown.opened); - // Clicking outside the dropdown will cause it to lose focus and close. - // This will verify on-blur closes the dropdown. - clickOutsideDropdown(); - assertFalse(ironDropdown.opened); - }); + // Clicking outside the dropdown will cause it to lose focus and close. + // This will verify on-blur closes the dropdown. + clickOutsideDropdown(); + assertFalse(ironDropdown.opened); + }); test( - assert(destination_dropdown_cros_test.TestNames.HighlightedAfterUpDown), + destination_dropdown_cros_test.TestNames.HighlightedAfterUpDown, function() { const destinationOne = createDestination('One', DestinationOrigin.CROS); setItemList([destinationOne]); @@ -161,8 +158,7 @@ }); test( - assert(destination_dropdown_cros_test.TestNames - .DestinationChangeAfterUpDown), + destination_dropdown_cros_test.TestNames.DestinationChangeAfterUpDown, function() { const destinationOne = createDestination('One', DestinationOrigin.CROS); const pdfDestination = getSaveAsPdfDestination(); @@ -191,24 +187,20 @@ }); }); - test( - assert(destination_dropdown_cros_test.TestNames.EnterOpensCloses), - function() { - const destinationOne = createDestination('One', DestinationOrigin.CROS); - setItemList([destinationOne]); - dropdown.value = destinationOne; + test(destination_dropdown_cros_test.TestNames.EnterOpensCloses, function() { + const destinationOne = createDestination('One', DestinationOrigin.CROS); + setItemList([destinationOne]); + dropdown.value = destinationOne; - assertFalse( - dropdown.shadowRoot!.querySelector('iron-dropdown')!.opened); - enter(); - assertTrue(dropdown.shadowRoot!.querySelector('iron-dropdown')!.opened); - enter(); - assertFalse( - dropdown.shadowRoot!.querySelector('iron-dropdown')!.opened); - }); + assertFalse(dropdown.shadowRoot!.querySelector('iron-dropdown')!.opened); + enter(); + assertTrue(dropdown.shadowRoot!.querySelector('iron-dropdown')!.opened); + enter(); + assertFalse(dropdown.shadowRoot!.querySelector('iron-dropdown')!.opened); + }); test( - assert(destination_dropdown_cros_test.TestNames.HighlightedFollowsMouse), + destination_dropdown_cros_test.TestNames.HighlightedFollowsMouse, function() { const destinationOne = createDestination('One', DestinationOrigin.CROS); setItemList([ @@ -234,7 +226,7 @@ assertEquals('One', getHighlightedElementText()); }); - test(assert(destination_dropdown_cros_test.TestNames.Disabled), function() { + test(destination_dropdown_cros_test.TestNames.Disabled, function() { const destinationOne = createDestination('One', DestinationOrigin.CROS); setItemList([destinationOne]); dropdown.value = destinationOne; @@ -251,7 +243,7 @@ }); test( - assert(destination_dropdown_cros_test.TestNames.HighlightedWhenOpened), + destination_dropdown_cros_test.TestNames.HighlightedWhenOpened, function() { const destinationTwo = createDestination('Two', DestinationOrigin.CROS); const destinationThree =
diff --git a/chrome/test/data/webui/print_preview/destination_item_test.ts b/chrome/test/data/webui/print_preview/destination_item_test.ts index db32a020..2b51b5c 100644 --- a/chrome/test/data/webui/print_preview/destination_item_test.ts +++ b/chrome/test/data/webui/print_preview/destination_item_test.ts
@@ -3,8 +3,6 @@ // found in the LICENSE file. import {Destination, DestinationOrigin, PrintPreviewDestinationListItemElement} from 'chrome://print/print_preview.js'; -import {assert} from 'chrome://resources/js/assert.js'; - import {assertEquals, assertFalse, assertTrue} from 'chrome://webui-test/chai_assert.js'; @@ -40,7 +38,7 @@ // Test that the destination is displayed correctly for the basic case of a // destination with no search query. - test(assert(destination_item_test.TestNames.NoQuery), function() { + test(destination_item_test.TestNames.NoQuery, function() { const name = item.shadowRoot!.querySelector('.name')!; assertEquals(printerName, name.textContent); assertEquals('1', window.getComputedStyle(name).opacity); @@ -54,7 +52,7 @@ // Test that the destination is displayed correctly when the search query // matches its display name. - test(assert(destination_item_test.TestNames.QueryName), function() { + test(destination_item_test.TestNames.QueryName, function() { item.searchQuery = /(Foo)/ig; const name = item.shadowRoot!.querySelector('.name')!; @@ -73,7 +71,7 @@ // Test that the destination is displayed correctly when the search query // matches its description. - test(assert(destination_item_test.TestNames.QueryDescription), function() { + test(destination_item_test.TestNames.QueryDescription, function() { const params = { description: 'ABCPrinterBrand Model 123', location: 'Building 789 Floor 6',
diff --git a/chrome/test/data/webui/print_preview/destination_item_test_cros.ts b/chrome/test/data/webui/print_preview/destination_item_test_cros.ts index 10ed1dbb..6ef8592e 100644 --- a/chrome/test/data/webui/print_preview/destination_item_test_cros.ts +++ b/chrome/test/data/webui/print_preview/destination_item_test_cros.ts
@@ -3,7 +3,6 @@ // found in the LICENSE file. import {Destination, DestinationOrigin, NativeLayerCrosImpl, PrinterStatusReason, PrinterStatusSeverity, PrintPreviewDestinationListItemElement} from 'chrome://print/print_preview.js'; -import {assert} from 'chrome://resources/js/assert.js'; import {flush} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js'; import {assertEquals, assertFalse} from 'chrome://webui-test/chai_assert.js'; import {MockController} from 'chrome://webui-test/mock_controller.js'; @@ -92,8 +91,7 @@ }); test( - assert(destination_item_test_cros.TestNames.NewStatusUpdatesIcon), - function() { + destination_item_test_cros.TestNames.NewStatusUpdatesIcon, function() { const icon = listItem.shadowRoot!.querySelector('iron-icon')!; assertEquals('print-preview:printer-status-grey', icon.icon); @@ -103,8 +101,7 @@ }); test( - assert( - destination_item_test_cros.TestNames.ChangingDestinationUpdatesIcon), + destination_item_test_cros.TestNames.ChangingDestinationUpdatesIcon, function() { const icon = listItem.shadowRoot!.querySelector('iron-icon')!; assertEquals('print-preview:printer-status-grey', icon.icon); @@ -122,8 +119,7 @@ // destination key in the printer status response matches the current // destination. test( - assert( - destination_item_test_cros.TestNames.OnlyUpdateMatchingDestination), + destination_item_test_cros.TestNames.OnlyUpdateMatchingDestination, function() { const icon = listItem.shadowRoot!.querySelector('iron-icon')!; assertEquals('print-preview:printer-status-grey', icon.icon);
diff --git a/chrome/test/data/webui/print_preview/destination_list_test.ts b/chrome/test/data/webui/print_preview/destination_list_test.ts index 2206ac4..97aaa30c0 100644 --- a/chrome/test/data/webui/print_preview/destination_list_test.ts +++ b/chrome/test/data/webui/print_preview/destination_list_test.ts
@@ -3,10 +3,8 @@ // found in the LICENSE file. import {Destination, DestinationOrigin, PrintPreviewDestinationListElement} from 'chrome://print/print_preview.js'; -import {assert} from 'chrome://resources/js/assert.js'; import {keyEventOn} from 'chrome://resources/polymer/v3_0/iron-test-helpers/mock-interactions.js'; import {flush} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js'; - import {assertEquals, assertFalse, assertTrue} from 'chrome://webui-test/chai_assert.js'; import {eventToPromise} from 'chrome://webui-test/test_util.js'; @@ -56,7 +54,7 @@ // Tests that the list correctly shows and hides destinations based on the // value of the search query. - test(assert(destination_list_test.TestNames.FilterDestinations), function() { + test(destination_list_test.TestNames.FilterDestinations, function() { const items = list.shadowRoot!.querySelectorAll( 'print-preview-destination-list-item'); const noMatchHint = list.shadowRoot!.querySelector<HTMLElement>( @@ -132,8 +130,7 @@ // Tests that the list correctly fires the destination selected event when // the destination is clicked or the enter key is pressed. test( - assert(destination_list_test.TestNames.FireDestinationSelected), - function() { + destination_list_test.TestNames.FireDestinationSelected, function() { const items = list.shadowRoot!.querySelectorAll( 'print-preview-destination-list-item'); let whenDestinationSelected =
diff --git a/chrome/test/data/webui/print_preview/destination_search_test.ts b/chrome/test/data/webui/print_preview/destination_search_test.ts index df0ce10..7951c1f 100644 --- a/chrome/test/data/webui/print_preview/destination_search_test.ts +++ b/chrome/test/data/webui/print_preview/destination_search_test.ts
@@ -3,9 +3,7 @@ // found in the LICENSE file. import {Destination, DestinationOrigin, DestinationStore, DestinationStoreEventType, NativeLayerImpl, PrintPreviewDestinationDialogElement} from 'chrome://print/print_preview.js'; -import {assert} from 'chrome://resources/js/assert.js'; import {flush} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js'; - import {assertEquals, assertNotEquals} from 'chrome://webui-test/chai_assert.js'; import {eventToPromise} from 'chrome://webui-test/test_util.js'; @@ -86,7 +84,7 @@ // Tests that a destination is selected if the user clicks on it and // capabilities fetch succeeds. test( - assert(destination_search_test.TestNames.GetCapabilitiesSucceeds), + destination_search_test.TestNames.GetCapabilitiesSucceeds, async function() { const destId = '00112233DEADBEEF'; nativeLayer.setLocalDestinationCapabilities(getCddTemplate(destId)); @@ -107,8 +105,7 @@ // Tests what happens when capabilities cannot be retrieved for the chosen // destination. The destination will still be selected in this case. test( - assert(destination_search_test.TestNames.GetCapabilitiesFails), - async function() { + destination_search_test.TestNames.GetCapabilitiesFails, async function() { const destId = '001122DEADBEEF'; nativeLayer.setLocalDestinationCapabilities( getCddTemplate(destId), true);
diff --git a/chrome/test/data/webui/print_preview/destination_search_test_chromeos.ts b/chrome/test/data/webui/print_preview/destination_search_test_chromeos.ts index 67c68a2..1c9c119 100644 --- a/chrome/test/data/webui/print_preview/destination_search_test_chromeos.ts +++ b/chrome/test/data/webui/print_preview/destination_search_test_chromeos.ts
@@ -3,9 +3,7 @@ // found in the LICENSE file. import {Destination, DestinationOrigin, DestinationStore, DestinationStoreEventType, NativeLayerCrosImpl, NativeLayerImpl, PrintPreviewDestinationDialogCrosElement} from 'chrome://print/print_preview.js'; -import {assert} from 'chrome://resources/js/assert.js'; import {flush} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js'; - import {assertEquals, assertNotEquals} from 'chrome://webui-test/chai_assert.js'; import {eventToPromise} from 'chrome://webui-test/test_util.js'; @@ -95,7 +93,7 @@ // Tests that a destination is selected if the user clicks on it and setup // (for CrOS) or capabilities fetch (for non-Cros) succeeds. test( - assert(destination_search_test_chromeos.TestNames.ReceiveSuccessfulSetup), + destination_search_test_chromeos.TestNames.ReceiveSuccessfulSetup, async function() { const destId = '00112233DEADBEEF'; const response = { @@ -119,7 +117,7 @@ // Test what happens when the setupPrinter request is rejected. test( - assert(destination_search_test_chromeos.TestNames.ResolutionFails), + destination_search_test_chromeos.TestNames.ResolutionFails, async function() { const destId = '001122DEADBEEF'; const originalDestination = destinationStore.selectedDestination;
diff --git a/chrome/test/data/webui/print_preview/destination_select_test.ts b/chrome/test/data/webui/print_preview/destination_select_test.ts index 887be392..85cfc3b5 100644 --- a/chrome/test/data/webui/print_preview/destination_select_test.ts +++ b/chrome/test/data/webui/print_preview/destination_select_test.ts
@@ -3,7 +3,6 @@ // found in the LICENSE file. import {Destination, DestinationOrigin, getSelectDropdownBackground, IronMeta, PrintPreviewDestinationSelectElement} from 'chrome://print/print_preview.js'; -import {assert} from 'chrome://resources/js/assert.js'; import {assertEquals} from 'chrome://webui-test/chai_assert.js'; import {waitAfterNextRender} from 'chrome://webui-test/polymer_test_util.js'; @@ -57,7 +56,7 @@ assertEquals(expected, icon); } - test(assert(destination_select_test.TestNames.ChangeIcon), function() { + test(destination_select_test.TestNames.ChangeIcon, function() { populateRecentDestinationList(); destinationSelect.recentDestinationList = recentDestinationList;
diff --git a/chrome/test/data/webui/print_preview/destination_select_test_cros.ts b/chrome/test/data/webui/print_preview/destination_select_test_cros.ts index 6410d47..378fca6 100644 --- a/chrome/test/data/webui/print_preview/destination_select_test_cros.ts +++ b/chrome/test/data/webui/print_preview/destination_select_test_cros.ts
@@ -3,7 +3,6 @@ // found in the LICENSE file. import {Destination, DestinationOrigin, NativeLayerCrosImpl, NativeLayerImpl, PrinterStatusReason, PrinterStatusSeverity, PrintPreviewDestinationDropdownCrosElement, PrintPreviewDestinationSelectCrosElement} from 'chrome://print/print_preview.js'; -import {assert} from 'chrome://resources/js/assert.js'; import {assertEquals, assertFalse, assertTrue} from 'chrome://webui-test/chai_assert.js'; import {MockController} from 'chrome://webui-test/mock_controller.js'; import {waitBeforeNextRender} from 'chrome://webui-test/polymer_test_util.js'; @@ -177,8 +176,7 @@ }); test( - assert(printer_status_test_cros.TestNames.PrinterStatusUpdatesColor), - function() { + printer_status_test_cros.TestNames.PrinterStatusUpdatesColor, function() { const destination1 = createDestination('ID1', 'One', DestinationOrigin.CROS); const destination2 = @@ -273,8 +271,7 @@ }); test( - assert(printer_status_test_cros.TestNames.SendStatusRequestOnce), - function() { + printer_status_test_cros.TestNames.SendStatusRequestOnce, function() { return waitBeforeNextRender(destinationSelect).then(() => { const destination1 = createDestination('ID1', 'One', DestinationOrigin.CROS); @@ -303,7 +300,7 @@ }); }); - test(assert(printer_status_test_cros.TestNames.HiddenStatusText), function() { + test(printer_status_test_cros.TestNames.HiddenStatusText, function() { const destinationStatus = destinationSelect.shadowRoot!.querySelector<HTMLElement>( '.destination-additional-info')!; @@ -342,7 +339,7 @@ }); }); - test(assert(printer_status_test_cros.TestNames.ChangeIcon), function() { + test(printer_status_test_cros.TestNames.ChangeIcon, function() { return waitBeforeNextRender(destinationSelect).then(() => { const localCrosPrinter = createDestination('ID1', 'One', DestinationOrigin.CROS); @@ -386,8 +383,7 @@ }); test( - assert( - printer_status_test_cros.TestNames.SuccessfulPrinterStatusAfterRetry), + printer_status_test_cros.TestNames.SuccessfulPrinterStatusAfterRetry, function() { nativeLayerCros.simulateStatusRetrySuccesful();
diff --git a/chrome/test/data/webui/print_preview/destination_settings_test.ts b/chrome/test/data/webui/print_preview/destination_settings_test.ts index 5e32506..0c8c9d7 100644 --- a/chrome/test/data/webui/print_preview/destination_settings_test.ts +++ b/chrome/test/data/webui/print_preview/destination_settings_test.ts
@@ -112,8 +112,7 @@ // Tests that the dropdown is enabled or disabled correctly based on // the state. test( - assert(destination_settings_test.TestNames.ChangeDropdownState), - function() { + destination_settings_test.TestNames.ChangeDropdownState, function() { const dropdown = destinationSettings.$.destinationSelect; // Initial state: No destination store means that there is no // destination yet. @@ -238,8 +237,7 @@ // Tests that the dropdown contains the appropriate destinations when there // are no recent destinations. test( - assert(destination_settings_test.TestNames.NoRecentDestinations), - function() { + destination_settings_test.TestNames.NoRecentDestinations, function() { initialize(); return nativeLayer.whenCalled('getPrinterCapabilities').then(() => { // This will result in the destination store setting the Save as @@ -261,8 +259,7 @@ // Tests that the dropdown contains the appropriate destinations when there // are 5 recent destinations. test( - assert(destination_settings_test.TestNames.RecentDestinations), - function() { + destination_settings_test.TestNames.RecentDestinations, function() { recentDestinations = destinations.slice(0, 5).map( destination => makeRecentDestination(destination)); @@ -294,7 +291,7 @@ // Tests that the dropdown contains the appropriate destinations when one of // the destinations can no longer be found. test( - assert(destination_settings_test.TestNames.RecentDestinationsMissing), + destination_settings_test.TestNames.RecentDestinationsMissing, function() { recentDestinations = destinations.slice(0, 5).map( destination => makeRecentDestination(destination)); @@ -328,7 +325,7 @@ // Tests that the dropdown contains the appropriate destinations when Save // as PDF is one of the recent destinations. - test(assert(destination_settings_test.TestNames.SaveAsPdfRecent), function() { + test(destination_settings_test.TestNames.SaveAsPdfRecent, function() { recentDestinations = destinations.slice(0, 5).map( destination => makeRecentDestination(destination)); recentDestinations.splice( @@ -361,8 +358,7 @@ // Tests that the dropdown contains the appropriate destinations when // Google Drive is in the recent destinations. test( - assert(destination_settings_test.TestNames.GoogleDriveRecent), - function() { + destination_settings_test.TestNames.GoogleDriveRecent, function() { recentDestinations = destinations.slice(0, 5).map( destination => makeRecentDestination(destination)); const driveDestination = getGoogleDriveDestination(); @@ -397,8 +393,7 @@ // correctly when Google Drive is the most recent destination. Regression test // for https://crbug.com/1038645. test( - assert(destination_settings_test.TestNames.GoogleDriveAutoselect), - function() { + destination_settings_test.TestNames.GoogleDriveAutoselect, function() { recentDestinations = destinations.slice(0, 5).map( destination => makeRecentDestination(destination)); recentDestinations.splice( @@ -433,7 +428,7 @@ // Tests that selecting the Save as PDF destination results in the // DESTINATION_SELECT event firing, with Save as PDF set as the current // destination. - test(assert(destination_settings_test.TestNames.SelectSaveAsPdf), function() { + test(destination_settings_test.TestNames.SelectSaveAsPdf, function() { recentDestinations = destinations.slice(0, 5).map( destination => makeRecentDestination(destination)); recentDestinations.splice( @@ -487,8 +482,7 @@ // DESTINATION_SELECT event firing, with Google Drive set as the current // destination. test( - assert(destination_settings_test.TestNames.SelectGoogleDrive), - function() { + destination_settings_test.TestNames.SelectGoogleDrive, function() { recentDestinations = destinations.slice(0, 5).map( destination => makeRecentDestination(destination)); recentDestinations.splice( @@ -537,8 +531,7 @@ // DESTINATION_SELECT event firing, with the recent destination set as the // current destination. test( - assert(destination_settings_test.TestNames.SelectRecentDestination), - function() { + destination_settings_test.TestNames.SelectRecentDestination, function() { recentDestinations = destinations.slice(0, 5).map( destination => makeRecentDestination(destination)); const whenCapabilitiesDone = @@ -581,7 +574,7 @@ }); // Tests that selecting the 'see more' option opens the dialog. - test(assert(destination_settings_test.TestNames.OpenDialog), function() { + test(destination_settings_test.TestNames.OpenDialog, function() { recentDestinations = destinations.slice(0, 5).map( destination => makeRecentDestination(destination)); const whenCapabilitiesDone = @@ -644,8 +637,7 @@ * destinations array. */ test( - assert(destination_settings_test.TestNames.UpdateRecentDestinations), - function() { + destination_settings_test.TestNames.UpdateRecentDestinations, function() { // Recent destinations start out empty. assertRecentDestinations([]); assertEquals(0, nativeLayer.getCallCount('getPrinterCapabilities')); @@ -722,8 +714,7 @@ // Tests that disabling the Save as PDF destination hides the corresponding // dropdown item. test( - assert(destination_settings_test.TestNames.DisabledSaveAsPdf), - function() { + destination_settings_test.TestNames.DisabledSaveAsPdf, function() { // Initialize destination settings with the PDF printer disabled. pdfPrinterDisabled = true; initialize(); @@ -749,7 +740,7 @@ // Tests that disabling the 'Save as PDF' destination and exposing no // printers to the native layer results in a 'No destinations' option in the // dropdown. - test(assert(destination_settings_test.TestNames.NoDestinations), function() { + test(destination_settings_test.TestNames.NoDestinations, function() { nativeLayer.setLocalDestinations([]); // Initialize destination settings with the PDF printer disabled. @@ -775,7 +766,7 @@ * Tests that destinations with a EULA will fetch the EULA URL when * selected. */ - test(assert(destination_settings_test.TestNames.EulaIsRetrieved), function() { + test(destination_settings_test.TestNames.EulaIsRetrieved, function() { // Recent destinations start out empty. assertRecentDestinations([]); @@ -840,8 +831,7 @@ // Tests that disabling Google Drive on Chrome OS hides the Save to Drive // destination. test( - assert(destination_settings_test.TestNames.DriveIsNotMounted), - function() { + destination_settings_test.TestNames.DriveIsNotMounted, function() { isDriveMounted = false; initialize();
diff --git a/chrome/test/data/webui/print_preview/destination_store_test.ts b/chrome/test/data/webui/print_preview/destination_store_test.ts index c847e81..615ec6ee 100644 --- a/chrome/test/data/webui/print_preview/destination_store_test.ts +++ b/chrome/test/data/webui/print_preview/destination_store_test.ts
@@ -6,7 +6,6 @@ // <if expr="not is_chromeos"> import {RecentDestination} from 'chrome://print/print_preview.js'; // </if> -import {assert} from 'chrome://resources/js/assert.js'; // <if expr="not is_chromeos"> import {loadTimeData} from 'chrome://resources/js/load_time_data.m.js'; // </if> @@ -120,8 +119,7 @@ * destination is automatically reselected. */ test( - assert(destination_store_test.TestNames.SingleRecentDestination), - function() { + destination_store_test.TestNames.SingleRecentDestination, function() { const recentDestination = makeRecentDestination(destinations[0]!); initialSettings.serializedAppStateStr = JSON.stringify({ version: 2, @@ -141,8 +139,7 @@ * fetched. */ test( - assert(destination_store_test.TestNames.MultipleRecentDestinations), - function() { + destination_store_test.TestNames.MultipleRecentDestinations, function() { const recentDestinations = destinations.slice(0, 3).map( destination => makeRecentDestination(destination)); @@ -173,8 +170,7 @@ * PDF. */ test( - assert(destination_store_test.TestNames.RecentDestinationsFallback), - function() { + destination_store_test.TestNames.RecentDestinationsFallback, function() { initialSettings.serializedAppStateStr = JSON.stringify({ version: 2, recentDestinations: [], @@ -194,8 +190,7 @@ * For crbug.com/666595. */ test( - assert(destination_store_test.TestNames - .MultipleRecentDestinationsOneRequest), + destination_store_test.TestNames.MultipleRecentDestinationsOneRequest, function() { const recentDestinations = destinations.slice(0, 3).map( destination => makeRecentDestination(destination)); @@ -235,7 +230,7 @@ * respected and a matching destination is automatically selected. */ test( - assert(destination_store_test.TestNames.DefaultDestinationSelectionRules), + destination_store_test.TestNames.DefaultDestinationSelectionRules, function() { initialSettings.serializedDefaultDestinationSelectionRulesStr = JSON.stringify({namePattern: '.*Four.*'}); @@ -256,8 +251,7 @@ * destinations. */ test( - assert(destination_store_test.TestNames.SystemDefaultPrinterPolicy), - function() { + destination_store_test.TestNames.SystemDefaultPrinterPolicy, function() { // Set the policy in loadTimeData. loadTimeData.overrideValues({useSystemDefaultPrinter: true}); @@ -296,7 +290,7 @@ * from printer fetch is selected. */ test( - assert(destination_store_test.TestNames.KioskModeSelectsFirstPrinter), + destination_store_test.TestNames.KioskModeSelectsFirstPrinter, function() { initialSettings.serializedDefaultDestinationSelectionRulesStr = ''; initialSettings.serializedAppStateStr = ''; @@ -321,8 +315,7 @@ * destination is null. */ test( - assert(destination_store_test.TestNames.NoPrintersShowsError), - function() { + destination_store_test.TestNames.NoPrintersShowsError, function() { initialSettings.serializedDefaultDestinationSelectionRulesStr = ''; initialSettings.serializedAppStateStr = ''; initialSettings.pdfPrinterDisabled = true; @@ -348,7 +341,7 @@ * store (PDF printer), the DestinationStore does not try to select a * printer again later. Regression test for https://crbug.com/927162. */ - test(assert(destination_store_test.TestNames.RecentSaveAsPdf), function() { + test(destination_store_test.TestNames.RecentSaveAsPdf, function() { const pdfPrinter = getSaveAsPdfDestination(); const recentDestination = makeRecentDestination(pdfPrinter); initialSettings.serializedAppStateStr = JSON.stringify({ @@ -376,8 +369,7 @@ * destination is automatically reselected. */ test( - assert(destination_store_test.TestNames.LoadAndSelectDestination), - function() { + destination_store_test.TestNames.LoadAndSelectDestination, function() { destinations = getDestinations(localDestinations); initialSettings.printerName = ''; const id1 = 'ID1'; @@ -423,7 +415,7 @@ // <if expr="is_chromeos"> /** Tests that the SAVE_TO_DRIVE_CROS destination is loaded on Chrome OS. */ test( - assert(destination_store_test.TestNames.LoadSaveToDriveCros), function() { + destination_store_test.TestNames.LoadSaveToDriveCros, function() { return setInitialSettings(false).then(() => { assertTrue(!!destinationStore.destinations().find( destination => destination.id === @@ -433,7 +425,7 @@ // Tests that the SAVE_TO_DRIVE_CROS destination is not loaded on Chrome OS // when Google Drive is not mounted. - test(assert(destination_store_test.TestNames.DriveNotMounted), function() { + test(destination_store_test.TestNames.DriveNotMounted, function() { initialSettings.isDriveMounted = false; return setInitialSettings(false).then(() => { assertFalse(!!destinationStore.destinations().find(
diff --git a/chrome/test/data/webui/print_preview/header_test.ts b/chrome/test/data/webui/print_preview/header_test.ts index 684de22..3278b63 100644 --- a/chrome/test/data/webui/print_preview/header_test.ts +++ b/chrome/test/data/webui/print_preview/header_test.ts
@@ -3,7 +3,6 @@ // found in the LICENSE file. import {Destination, DestinationOrigin, GooglePromotedDestinationId, PrintPreviewHeaderElement, PrintPreviewPluralStringProxyImpl, State} from 'chrome://print/print_preview.js'; -import {assert} from 'chrome://resources/js/assert.js'; import {loadTimeData} from 'chrome://resources/js/load_time_data.m.js'; import {assertEquals, assertFalse, assertTrue} from 'chrome://webui-test/chai_assert.js'; import {fakeDataBind} from 'chrome://webui-test/polymer_test_util.js'; @@ -60,7 +59,7 @@ // Tests that the 4 different messages (non-virtual printer singular and // plural, virtual printer singular and plural) all show up as expected. - test(assert(header_test.TestNames.HeaderPrinterTypes), async function() { + test(header_test.TestNames.HeaderPrinterTypes, async function() { const summary = header.shadowRoot!.querySelector('.summary')!; { const {messageName, itemCount} = @@ -101,7 +100,7 @@ // Tests that the correct message is shown for non-READY states, and that // the print button is disabled appropriately. - test(assert(header_test.TestNames.HeaderChangesForState), async function() { + test(header_test.TestNames.HeaderChangesForState, async function() { const summary = header.shadowRoot!.querySelector('.summary')!; await pluralString.whenCalled('getPluralString'); assertEquals('1 sheet of paper', summary.textContent!.trim()); @@ -120,7 +119,7 @@ }); // Tests that enterprise badge shows up if any setting is managed. - test(assert(header_test.TestNames.EnterprisePolicy), function() { + test(header_test.TestNames.EnterprisePolicy, function() { assertTrue(header.shadowRoot!.querySelector('iron-icon')!.hidden); header.managed = true; assertFalse(header.shadowRoot!.querySelector('iron-icon')!.hidden);
diff --git a/chrome/test/data/webui/print_preview/key_event_test.ts b/chrome/test/data/webui/print_preview/key_event_test.ts index f53ed94..dee98254 100644 --- a/chrome/test/data/webui/print_preview/key_event_test.ts +++ b/chrome/test/data/webui/print_preview/key_event_test.ts
@@ -3,7 +3,6 @@ // found in the LICENSE file. import {NativeLayerImpl, PluginProxyImpl, PrintPreviewAppElement} from 'chrome://print/print_preview.js'; -import {assert} from 'chrome://resources/js/assert.js'; import {isChromeOS, isLacros, isMac, isWindows} from 'chrome://resources/js/platform.js'; import {keyEventOn} from 'chrome://resources/polymer/v3_0/iron-test-helpers/mock-interactions.js'; import {flush} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js'; @@ -73,14 +72,14 @@ }); // Tests that the enter key triggers a call to print. - test(assert(key_event_test.TestNames.EnterTriggersPrint), function() { + test(key_event_test.TestNames.EnterTriggersPrint, function() { const whenPrintCalled = nativeLayer.whenCalled('print'); keyEventOn(page, 'keydown', 0, [], 'Enter'); return whenPrintCalled; }); // Tests that the numpad enter key triggers a call to print. - test(assert(key_event_test.TestNames.NumpadEnterTriggersPrint), function() { + test(key_event_test.TestNames.NumpadEnterTriggersPrint, function() { const whenPrintCalled = nativeLayer.whenCalled('print'); keyEventOn(page, 'keydown', 0, [], 'Enter'); return whenPrintCalled; @@ -88,7 +87,7 @@ // Tests that the enter key triggers a call to print if an input is the // source of the event. - test(assert(key_event_test.TestNames.EnterOnInputTriggersPrint), function() { + test(key_event_test.TestNames.EnterOnInputTriggersPrint, function() { const whenPrintCalled = nativeLayer.whenCalled('print'); keyEventOn( page.shadowRoot!.querySelector('print-preview-sidebar')!.shadowRoot! @@ -102,7 +101,7 @@ // Tests that the enter key does not trigger a call to print if the event // comes from a dropdown. test( - assert(key_event_test.TestNames.EnterOnDropdownDoesNotPrint), function() { + key_event_test.TestNames.EnterOnDropdownDoesNotPrint, function() { const whenKeyEventFired = eventToPromise('keydown', page); keyEventOn( page.shadowRoot!.querySelector('print-preview-sidebar')!.shadowRoot! @@ -115,7 +114,7 @@ // Tests that the enter key does not trigger a call to print if the event // comes from a button. - test(assert(key_event_test.TestNames.EnterOnButtonDoesNotPrint), async () => { + test(key_event_test.TestNames.EnterOnButtonDoesNotPrint, async () => { const moreSettingsElement = page.shadowRoot!.querySelector('print-preview-sidebar')!.shadowRoot! .querySelector('print-preview-more-settings')!; @@ -134,7 +133,7 @@ // Tests that the enter key does not trigger a call to print if the event // comes from a checkbox. test( - assert(key_event_test.TestNames.EnterOnCheckboxDoesNotPrint), function() { + key_event_test.TestNames.EnterOnCheckboxDoesNotPrint, function() { const moreSettingsElement = page.shadowRoot!.querySelector('print-preview-sidebar')!.shadowRoot! .querySelector('print-preview-more-settings')!; @@ -151,7 +150,7 @@ // Tests that escape closes the dialog only on Mac. test( - assert(key_event_test.TestNames.EscapeClosesDialogOnMacOnly), function() { + key_event_test.TestNames.EscapeClosesDialogOnMacOnly, function() { const promise = isMac ? nativeLayer.whenCalled('dialogClose') : eventToPromise('keydown', page).then(() => { @@ -163,8 +162,7 @@ // Tests that Cmd + Period closes the dialog only on Mac test( - assert(key_event_test.TestNames.CmdPeriodClosesDialogOnMacOnly), - function() { + key_event_test.TestNames.CmdPeriodClosesDialogOnMacOnly, function() { const promise = isMac ? nativeLayer.whenCalled('dialogClose') : eventToPromise('keydown', page).then(() => { @@ -176,7 +174,7 @@ // Tests that Ctrl+Shift+P opens the system dialog. test( - assert(key_event_test.TestNames.CtrlShiftPOpensSystemDialog), function() { + key_event_test.TestNames.CtrlShiftPOpensSystemDialog, function() { let promise: Promise<void>; if (isChromeOS || isLacros) { // Chrome OS doesn't have a system dialog. Just make sure the key
diff --git a/chrome/test/data/webui/print_preview/link_container_test.ts b/chrome/test/data/webui/print_preview/link_container_test.ts index c33b629..425da64 100644 --- a/chrome/test/data/webui/print_preview/link_container_test.ts +++ b/chrome/test/data/webui/print_preview/link_container_test.ts
@@ -3,9 +3,10 @@ // found in the LICENSE file. import {Destination, DestinationOrigin, PrintPreviewLinkContainerElement} from 'chrome://print/print_preview.js'; -import {assert} from 'chrome://resources/js/assert.js'; +// <if expr="is_macosx"> +import {assert} from 'chrome://resources/js/assert_ts.js'; +// </if> import {isWindows} from 'chrome://resources/js/platform.js'; - import {assertEquals, assertFalse, assertTrue} from 'chrome://webui-test/chai_assert.js'; import {eventToPromise} from 'chrome://webui-test/test_util.js'; @@ -42,7 +43,7 @@ }); /** Tests that the system dialog link is hidden in App Kiosk mode. */ - test(assert(link_container_test.TestNames.HideInAppKioskMode), function() { + test(link_container_test.TestNames.HideInAppKioskMode, function() { const systemDialogLink = linkContainer.$.systemDialogLink; assertFalse(systemDialogLink.hidden); linkContainer.set('appKioskMode', true); @@ -53,7 +54,7 @@ * Test that clicking the system dialog link click results in an event * firing, and the throbber appears on non-Windows. */ - test(assert(link_container_test.TestNames.SystemDialogLinkClick), function() { + test(link_container_test.TestNames.SystemDialogLinkClick, function() { const promise = eventToPromise('print-with-system-dialog', linkContainer); const throbber = linkContainer.$.systemDialogThrobber; assertTrue(throbber.hidden); @@ -70,7 +71,7 @@ * (if it exists), and that the system dialog link is disabled on Windows * and enabled on other platforms. */ - test(assert(link_container_test.TestNames.InvalidState), function() { + test(link_container_test.TestNames.InvalidState, function() { const systemDialogLink = linkContainer.$.systemDialogLink; function validateLinkState(link: HTMLDivElement, disabled: boolean) { @@ -90,7 +91,8 @@ linkContainer.disabled = true; validateLinkState(systemDialogLink, isWindows); // <if expr="is_macosx"> - validateLinkState(assert(openInPreviewLink), true); + assert(openInPreviewLink); + validateLinkState(openInPreviewLink, true); // </if> }); @@ -100,7 +102,7 @@ * property change and that the throbber appears. Mac only. */ test( - assert(link_container_test.TestNames.OpenInPreviewLinkClick), function() { + link_container_test.TestNames.OpenInPreviewLinkClick, function() { const throbber = linkContainer.$.openPdfInPreviewThrobber; assertTrue(throbber.hidden); const promise = eventToPromise('open-pdf-in-preview', linkContainer);
diff --git a/chrome/test/data/webui/print_preview/model_test.ts b/chrome/test/data/webui/print_preview/model_test.ts index a1136ed3..93a83df 100644 --- a/chrome/test/data/webui/print_preview/model_test.ts +++ b/chrome/test/data/webui/print_preview/model_test.ts
@@ -6,7 +6,6 @@ // <if expr="is_chromeos"> import {GooglePromotedDestinationId} from 'chrome://print/print_preview.js'; // </if> -import {assert} from 'chrome://resources/js/assert.js'; // <if expr="is_chromeos"> import {loadTimeData} from 'chrome://resources/js/load_time_data.m.js'; // </if> @@ -46,7 +45,7 @@ * Tests state restoration with all boolean settings set to true, scaling = * 90, dpi = 100, custom square paper, and custom margins. */ - test(assert(model_test.TestNames.SetStickySettings), function() { + test(model_test.TestNames.SetStickySettings, function() { // Default state of the model. const stickySettingsDefault: {[key: string]: any} = { version: 2, @@ -168,7 +167,7 @@ * Tests that setSetting() won't change the value if there is already a * policy for that setting. */ - test(assert(model_test.TestNames.SetPolicySettings), function() { + test(model_test.TestNames.SetPolicySettings, function() { model.setSetting('headerFooter', false); assertFalse(model.settings.headerFooter.value as boolean); @@ -267,7 +266,7 @@ * Tests that toggling each setting results in the expected change to the * print ticket. */ - test(assert(model_test.TestNames.GetPrintTicket), function() { + test(model_test.TestNames.GetPrintTicket, function() { // <if expr="is_chromeos"> const origin = DestinationOrigin.CROS; // </if> @@ -375,7 +374,7 @@ * Tests that toggling each setting results in the expected change to the * cloud job print ticket. */ - test(assert(model_test.TestNames.GetCloudPrintTicket), function() { + test(model_test.TestNames.GetCloudPrintTicket, function() { initializeModel(); // Create a test extension destination. @@ -442,7 +441,7 @@ assertEquals(expectedNewTicket, newTicket); }); - test(assert(model_test.TestNames.RemoveUnsupportedDestinations), function() { + test(model_test.TestNames.RemoveUnsupportedDestinations, function() { const unsupportedPrivet = new Destination('PrivetDevice', DestinationOrigin.PRIVET, 'PrivetName'); const unsupportedCloud = @@ -480,7 +479,7 @@ assertEquals('FooDevice', recentDestinations[0]!.id); }); - test(assert(model_test.TestNames.ChangeDestination), function() { + test(model_test.TestNames.ChangeDestination, function() { const testDestination = new Destination('FooDevice', DestinationOrigin.LOCAL, 'FooName'); testDestination.capabilities = @@ -581,7 +580,7 @@ // <if expr="is_chromeos"> // Tests that printToGoogleDrive is set correctly on the print ticket for Save // to Drive CrOS. - test(assert(model_test.TestNames.PrintToGoogleDriveCros), function() { + test(model_test.TestNames.PrintToGoogleDriveCros, function() { const driveDestination = new Destination( GooglePromotedDestinationId.SAVE_TO_DRIVE_CROS, DestinationOrigin.LOCAL, 'Save to Google Drive'); @@ -601,7 +600,7 @@ * - if `reset_to_default`=false, the value of the setting will always be read * from the sticky settings. */ - test(assert(model_test.TestNames.CddResetToDefault), function() { + test(model_test.TestNames.CddResetToDefault, function() { const cddColorEnabled = true; const stickyColorEnabled = false; const cddDuplexEnabled = false;
diff --git a/chrome/test/data/webui/print_preview/number_settings_section_interactive_test.ts b/chrome/test/data/webui/print_preview/number_settings_section_interactive_test.ts index 9d378bb..683c89b 100644 --- a/chrome/test/data/webui/print_preview/number_settings_section_interactive_test.ts +++ b/chrome/test/data/webui/print_preview/number_settings_section_interactive_test.ts
@@ -3,8 +3,8 @@ // found in the LICENSE file. import 'chrome://print/print_preview.js'; + import {PrintPreviewNumberSettingsSectionElement} from 'chrome://print/print_preview.js'; -import {assert} from 'chrome://resources/js/assert.js'; import {assertEquals, assertFalse, assertTrue} from 'chrome://webui-test/chai_assert.js'; import {triggerInputEvent} from './print_preview_test_utils.js'; @@ -38,8 +38,7 @@ // Verifies that blurring the input will reset it to the default if it is // empty, but not if it contains an invalid value. test( - assert(number_settings_section_interactive_test.TestNames - .BlurResetsEmptyInput), + number_settings_section_interactive_test.TestNames.BlurResetsEmptyInput, async () => { // Initial value is 10. const crInput = numberSettings.getInput();
diff --git a/chrome/test/data/webui/print_preview/number_settings_section_test.ts b/chrome/test/data/webui/print_preview/number_settings_section_test.ts index ff2e5e7..e9552076 100644 --- a/chrome/test/data/webui/print_preview/number_settings_section_test.ts +++ b/chrome/test/data/webui/print_preview/number_settings_section_test.ts
@@ -5,7 +5,6 @@ import 'chrome://print/print_preview.js'; import {PrintPreviewNumberSettingsSectionElement} from 'chrome://print/print_preview.js'; -import {assert} from 'chrome://resources/js/assert.js'; import {keyEventOn} from 'chrome://resources/polymer/v3_0/iron-test-helpers/mock-interactions.js'; import {assertEquals, assertFalse, assertTrue} from 'chrome://webui-test/chai_assert.js'; import {eventToPromise} from 'chrome://webui-test/test_util.js'; @@ -42,8 +41,7 @@ // Test that key events that would result in invalid values are blocked. test( - assert(number_settings_section_test.TestNames.BlocksInvalidKeys), - function() { + number_settings_section_test.TestNames.BlocksInvalidKeys, function() { const input = numberSettings.$.userValue; /** * @param key Key name for the keyboard event that will be fired. @@ -85,8 +83,7 @@ }); test( - assert(number_settings_section_test.TestNames.UpdatesErrorMessage), - function() { + number_settings_section_test.TestNames.UpdatesErrorMessage, function() { const input = numberSettings.$.userValue; // The error message should be empty initially, since the input is
diff --git a/chrome/test/data/webui/print_preview/pages_settings_test.ts b/chrome/test/data/webui/print_preview/pages_settings_test.ts index ee415344..24d7565 100644 --- a/chrome/test/data/webui/print_preview/pages_settings_test.ts +++ b/chrome/test/data/webui/print_preview/pages_settings_test.ts
@@ -5,7 +5,6 @@ import 'chrome://print/print_preview.js'; import {PagesValue, PrintPreviewPagesSettingsElement, Range} from 'chrome://print/print_preview.js'; -import {assert} from 'chrome://resources/js/assert.js'; import {keyEventOn} from 'chrome://resources/polymer/v3_0/iron-test-helpers/mock-interactions.js'; import {flush} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js'; import {assertEquals, assertFalse, assertTrue} from 'chrome://webui-test/chai_assert.js'; @@ -91,7 +90,7 @@ // Verifies that the pages setting updates correctly when the dropdown // changes. - test(assert(pages_settings_test.TestNames.PagesDropdown), async () => { + test(pages_settings_test.TestNames.PagesDropdown, async () => { pagesSection.pageCount = 5; // Default value is all pages. @@ -141,7 +140,7 @@ // Tests that the odd-only and even-only options are hidden when the document // has only one page. - test(assert(pages_settings_test.TestNames.NoParityOptions), async () => { + test(pages_settings_test.TestNames.NoParityOptions, async () => { pagesSection.pageCount = 1; const oddOption = pagesSection.shadowRoot!.querySelector<HTMLOptionElement>( @@ -156,32 +155,29 @@ // Tests that the odd-only and even-only selections are preserved when the // page counts change. - test( - assert(pages_settings_test.TestNames.ParitySelectionMemorized), - async () => { - const select = pagesSection.shadowRoot!.querySelector('select')!; + test(pages_settings_test.TestNames.ParitySelectionMemorized, async () => { + const select = pagesSection.shadowRoot!.querySelector('select')!; - pagesSection.pageCount = 2; - assertEquals(PagesValue.ALL.toString(), select.value); + pagesSection.pageCount = 2; + assertEquals(PagesValue.ALL.toString(), select.value); - await selectOption(pagesSection, PagesValue.ODDS.toString()); - assertEquals(PagesValue.ODDS.toString(), select.value); + await selectOption(pagesSection, PagesValue.ODDS.toString()); + assertEquals(PagesValue.ODDS.toString(), select.value); - let whenValueChanged = - eventToPromise('process-select-change', pagesSection); - pagesSection.pageCount = 1; - await whenValueChanged; - assertEquals(PagesValue.ALL.toString(), select.value); + let whenValueChanged = + eventToPromise('process-select-change', pagesSection); + pagesSection.pageCount = 1; + await whenValueChanged; + assertEquals(PagesValue.ALL.toString(), select.value); - whenValueChanged = - eventToPromise('process-select-change', pagesSection); - pagesSection.pageCount = 2; - await whenValueChanged; - assertEquals(PagesValue.ODDS.toString(), select.value); - }); + whenValueChanged = eventToPromise('process-select-change', pagesSection); + pagesSection.pageCount = 2; + await whenValueChanged; + assertEquals(PagesValue.ODDS.toString(), select.value); + }); // Tests that the page ranges set are valid for different user inputs. - test(assert(pages_settings_test.TestNames.ValidPageRanges), async () => { + test(pages_settings_test.TestNames.ValidPageRanges, async () => { pagesSection.pageCount = 100; const tenToHundred = Array.from({length: 91}, (_x, i) => i + 10); @@ -229,7 +225,7 @@ // Tests that the correct error messages are shown for different user // inputs. - test(assert(pages_settings_test.TestNames.InvalidPageRanges), async () => { + test(pages_settings_test.TestNames.InvalidPageRanges, async () => { pagesSection.pageCount = 100; const syntaxError = 'Invalid page range, use e.g. 1-5, 8, 11-13'; @@ -265,7 +261,7 @@ // Tests that the pages are set correctly for different values of pages per // sheet, and that ranges remain fixed (since they are used for generating // the print preview ticket). - test(assert(pages_settings_test.TestNames.NupChangesPages), async () => { + test(pages_settings_test.TestNames.NupChangesPages, async () => { pagesSection.pageCount = 100; await selectOption(pagesSection, PagesValue.CUSTOM.toString()); await setCustomInput('1, 2, 3, 1, 56'); @@ -298,7 +294,7 @@ // input does not show an error message but does not reset the preview, and // changing focus from an empty input in either case fills in the dropdown // with the full page range. - test(assert(pages_settings_test.TestNames.ClearInput), async () => { + test(pages_settings_test.TestNames.ClearInput, async () => { pagesSection.pageCount = 3; const input = pagesSection.$.pageSettingsCustomInput.inputElement; const select = pagesSection.shadowRoot!.querySelector('select')!; @@ -384,7 +380,7 @@ // Verifies that the input is never disabled when the validity of the // setting changes. test( - assert(pages_settings_test.TestNames.InputNotDisabledOnValidityChange), + pages_settings_test.TestNames.InputNotDisabledOnValidityChange, async () => { pagesSection.pageCount = 3; // In the real UI, the print preview app listens for this event from @@ -426,8 +422,7 @@ // element, so that it will be bubbled to the print preview app to trigger a // print. test( - assert(pages_settings_test.TestNames.EnterOnInputTriggersPrint), - async () => { + pages_settings_test.TestNames.EnterOnInputTriggersPrint, async () => { pagesSection.pageCount = 3; const input = pagesSection.$.pageSettingsCustomInput.inputElement; const whenPrintReceived = eventToPromise('keydown', pagesSection);
diff --git a/chrome/test/data/webui/print_preview/pdf_zoom_toolbar_test.ts b/chrome/test/data/webui/print_preview/pdf_zoom_toolbar_test.ts index 08da817..a95e7a47 100644 --- a/chrome/test/data/webui/print_preview/pdf_zoom_toolbar_test.ts +++ b/chrome/test/data/webui/print_preview/pdf_zoom_toolbar_test.ts
@@ -8,7 +8,6 @@ import {ViewerZoomButtonElement} from 'chrome://print/pdf/elements/viewer-zoom-button.js'; import {ViewerZoomToolbarElement} from 'chrome://print/pdf/elements/viewer-zoom-toolbar.js'; import {CrIconButtonElement} from 'chrome://print/print_preview.js'; -import {assert} from 'chrome://resources/js/assert.js'; import {assertEquals, assertTrue} from 'chrome://webui-test/chai_assert.js'; import {eventToPromise} from 'chrome://webui-test/test_util.js'; @@ -46,7 +45,7 @@ * Test that the zoom toolbar toggles between showing the fit-to-page and * fit-to-width buttons. */ - test(assert(pdf_zoom_toolbar_test.TestNames.Toggle), async () => { + test(pdf_zoom_toolbar_test.TestNames.Toggle, async () => { // Initial: Show fit-to-page. assertTrue(button.ironIcon!.endsWith(fitPageIcon)); @@ -98,7 +97,7 @@ assertTrue(button.ironIcon!.endsWith(fitWidthIcon)); }); - test(assert(pdf_zoom_toolbar_test.TestNames.ForceFitToPage), async () => { + test(pdf_zoom_toolbar_test.TestNames.ForceFitToPage, async () => { // Initial: Show fit-to-page. assertTrue(button.ironIcon!.endsWith(fitPageIcon));
diff --git a/chrome/test/data/webui/print_preview/policy_test.ts b/chrome/test/data/webui/print_preview/policy_test.ts index 72ea3f89..acb71e8 100644 --- a/chrome/test/data/webui/print_preview/policy_test.ts +++ b/chrome/test/data/webui/print_preview/policy_test.ts
@@ -7,7 +7,6 @@ import {ColorModeRestriction, DuplexMode, DuplexModeRestriction, PinModeRestriction} from 'chrome://print/print_preview.js'; // </if> -import {assert} from 'chrome://resources/js/assert.js'; import {flush} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js'; import {assertEquals, assertFalse} from 'chrome://webui-test/chai_assert.js'; import {TestPluralStringProxy} from 'chrome://webui-test/test_plural_string_proxy.js'; @@ -165,7 +164,7 @@ } // Tests different scenarios of applying header/footer policy. - test(assert(policy_tests.TestNames.HeaderFooterPolicy), async () => { + test(policy_tests.TestNames.HeaderFooterPolicy, async () => { const tests = [ { // No policies. @@ -218,7 +217,7 @@ }); // Tests different scenarios of applying background graphics policy. - test(assert(policy_tests.TestNames.CssBackgroundPolicy), async () => { + test(policy_tests.TestNames.CssBackgroundPolicy, async () => { const tests = [ { // No policies. @@ -273,7 +272,7 @@ }); // Tests different scenarios of applying default paper policy. - test(assert(policy_tests.TestNames.MediaSizePolicy), async () => { + test(policy_tests.TestNames.MediaSizePolicy, async () => { const tests = [ { // No policies. @@ -310,7 +309,7 @@ } }); - test(assert(policy_tests.TestNames.SheetsPolicy), async () => { + test(policy_tests.TestNames.SheetsPolicy, async () => { const pluralString = new PolicyTestPluralStringProxy(); PrintPreviewPluralStringProxyImpl.setInstance(pluralString); pluralString.text = 'Exceeds limit of 1 sheet of paper'; @@ -384,7 +383,7 @@ // <if expr="is_chromeos"> // Tests different scenarios of color printing policy. - test(assert(policy_tests.TestNames.ColorPolicy), async () => { + test(policy_tests.TestNames.ColorPolicy, async () => { const tests = [ { // No policies. @@ -461,7 +460,7 @@ }); // Tests different scenarios of duplex printing policy. - test(assert(policy_tests.TestNames.DuplexPolicy), async () => { + test(policy_tests.TestNames.DuplexPolicy, async () => { const tests = [ { // No policies. @@ -597,7 +596,7 @@ }); // Tests different scenarios of pin printing policy. - test(assert(policy_tests.TestNames.PinPolicy), async () => { + test(policy_tests.TestNames.PinPolicy, async () => { const tests = [ { // No policies. @@ -715,7 +714,7 @@ // Tests different scenarios of PDF print as image option policy. // Should be available only for PDF when the policy explicitly allows print // as image, and hidden the rest of the cases. - test(assert(policy_tests.TestNames.PrintPdfAsImageAvailability), async () => { + test(policy_tests.TestNames.PrintPdfAsImageAvailability, async () => { const tests = [ { // No policies with modifiable content. @@ -777,7 +776,7 @@ // The policy controls if it defaults to set.Test behavior varies by platform // since the option's availability is policy controlled for Windows and macOS // but is always available for Linux and ChromeOS. - test(assert(policy_tests.TestNames.PrintPdfAsImageDefault), async () => { + test(policy_tests.TestNames.PrintPdfAsImageDefault, async () => { const tests = [ // <if expr="is_linux or chromeos_ash or chromeos_lacros"> {
diff --git a/chrome/test/data/webui/print_preview/preview_area_test.ts b/chrome/test/data/webui/print_preview/preview_area_test.ts index 5b66d9e1..97b2745e 100644 --- a/chrome/test/data/webui/print_preview/preview_area_test.ts +++ b/chrome/test/data/webui/print_preview/preview_area_test.ts
@@ -3,7 +3,6 @@ // found in the LICENSE file. import {Destination, DestinationOrigin, Error, Margins, MeasurementSystem, MeasurementSystemUnitType, NativeLayerImpl, PluginProxyImpl, PreviewAreaState, PrintPreviewPreviewAreaElement, Size, State} from 'chrome://print/print_preview.js'; -import {assert} from 'chrome://resources/js/assert.js'; import {assertEquals, assertFalse, assertTrue} from 'chrome://webui-test/chai_assert.js'; import {fakeDataBind} from 'chrome://webui-test/polymer_test_util.js'; @@ -58,7 +57,7 @@ }); /** Validate some preview area state transitions work as expected. */ - test(assert(preview_area_test.TestNames.StateChanges), function() { + test(preview_area_test.TestNames.StateChanges, function() { // Simulate starting the preview. const whenPreviewStarted = nativeLayer.whenCalled('getPreview'); previewArea.state = State.READY; @@ -99,7 +98,7 @@ }); /** Validate preview area sets tabindex correctly based on viewport size. */ - test(assert(preview_area_test.TestNames.ViewportSizeChanges), function() { + test(preview_area_test.TestNames.ViewportSizeChanges, function() { // Simulate starting the preview. const whenPreviewStarted = nativeLayer.whenCalled('getPreview'); previewArea.state = State.READY;
diff --git a/chrome/test/data/webui/print_preview/preview_generation_test.ts b/chrome/test/data/webui/print_preview/preview_generation_test.ts index ccaeb7b..b343ac4 100644 --- a/chrome/test/data/webui/print_preview/preview_generation_test.ts +++ b/chrome/test/data/webui/print_preview/preview_generation_test.ts
@@ -3,8 +3,6 @@ // found in the LICENSE file. import {ColorMode, Destination, DestinationOrigin, DestinationState, Margins, MarginsType, NativeInitialSettings, NativeLayerImpl, PluginProxyImpl, PreviewTicket, PrintPreviewAppElement, PrintPreviewDestinationSettingsElement, Range, ScalingType} from 'chrome://print/print_preview.js'; -import {assert} from 'chrome://resources/js/assert.js'; - import {assertEquals, assertFalse, assertTrue} from 'chrome://webui-test/chai_assert.js'; // <if expr="is_chromeos"> @@ -148,30 +146,30 @@ } /** Validate changing the color updates the preview. */ - test(assert(preview_generation_test.TestNames.Color), function() { + test(preview_generation_test.TestNames.Color, function() { return testSimpleSetting( 'color', true, false, 'color', ColorMode.COLOR, ColorMode.GRAY); }); /** Validate changing the background setting updates the preview. */ - test(assert(preview_generation_test.TestNames.CssBackground), function() { + test(preview_generation_test.TestNames.CssBackground, function() { return testSimpleSetting( 'cssBackground', false, true, 'shouldPrintBackgrounds', false, true); }); /** Validate changing the header/footer setting updates the preview. */ - test(assert(preview_generation_test.TestNames.HeaderFooter), function() { + test(preview_generation_test.TestNames.HeaderFooter, function() { return testSimpleSetting( 'headerFooter', true, false, 'headerFooterEnabled', true, false); }); /** Validate changing the orientation updates the preview. */ - test(assert(preview_generation_test.TestNames.Layout), function() { + test(preview_generation_test.TestNames.Layout, function() { return testSimpleSetting('layout', false, true, 'landscape', false, true); }); /** Validate changing the margins updates the preview. */ - test(assert(preview_generation_test.TestNames.Margins), function() { + test(preview_generation_test.TestNames.Margins, function() { return testSimpleSetting( 'margins', MarginsType.DEFAULT, MarginsType.MINIMUM, 'marginsType', MarginsType.DEFAULT, MarginsType.MINIMUM); @@ -181,7 +179,7 @@ * Validate changing the custom margins updates the preview, only after all * values have been set. */ - test(assert(preview_generation_test.TestNames.CustomMargins), function() { + test(preview_generation_test.TestNames.CustomMargins, function() { return initialize() .then(function(args) { const originalTicket: PreviewTicket = JSON.parse(args.printTicket); @@ -246,7 +244,7 @@ * margins to MarginsType.DEFAULT. */ test( - assert(preview_generation_test.TestNames.ChangeMarginsByPagesPerSheet), + preview_generation_test.TestNames.ChangeMarginsByPagesPerSheet, function() { return initialize() .then(function(args) { @@ -284,7 +282,7 @@ }); /** Validate changing the paper size updates the preview. */ - test(assert(preview_generation_test.TestNames.MediaSize), function() { + test(preview_generation_test.TestNames.MediaSize, function() { const mediaSizeCapability = getCddTemplate('FooDevice').capabilities!.printer!.media_size!; const letterOption = mediaSizeCapability.option[0]!; @@ -327,7 +325,7 @@ }); /** Validate changing the page range updates the preview. */ - test(assert(preview_generation_test.TestNames.PageRange), function() { + test(preview_generation_test.TestNames.PageRange, function() { return initialize() .then(function(args) { const originalTicket: PreviewTicket = JSON.parse(args.printTicket); @@ -351,7 +349,7 @@ }); /** Validate changing the selection only setting updates the preview. */ - test(assert(preview_generation_test.TestNames.SelectionOnly), function() { + test(preview_generation_test.TestNames.SelectionOnly, function() { // Set has selection to true so that the setting is available. initialSettings.documentHasSelection = true; return testSimpleSetting( @@ -359,12 +357,12 @@ }); /** Validate changing the pages per sheet updates the preview. */ - test(assert(preview_generation_test.TestNames.PagesPerSheet), function() { + test(preview_generation_test.TestNames.PagesPerSheet, function() { return testSimpleSetting('pagesPerSheet', 1, 2, 'pagesPerSheet', 1, 2); }); /** Validate changing the scaling updates the preview. */ - test(assert(preview_generation_test.TestNames.Scaling), function() { + test(preview_generation_test.TestNames.Scaling, function() { return initialize() .then(function(args) { validateScalingChange({ @@ -440,7 +438,7 @@ }); /** Validate changing the scalingTypePdf setting updates the preview. */ - test(assert(preview_generation_test.TestNames.ScalingPdf), function() { + test(preview_generation_test.TestNames.ScalingPdf, function() { // Set PDF document so setting is available. initialSettings.previewModifiable = false; return initialize() @@ -578,7 +576,7 @@ * always available on Linux and CrOS. Availability on Windows and macOS * depends upon policy (see policy_test.js). */ - test(assert(preview_generation_test.TestNames.Rasterize), function() { + test(preview_generation_test.TestNames.Rasterize, function() { // Set PDF document so setting is available. initialSettings.previewModifiable = false; return testSimpleSetting( @@ -589,7 +587,7 @@ * Validate changing the destination updates the preview, if it results * in a settings change. */ - test(assert(preview_generation_test.TestNames.Destination), function() { + test(preview_generation_test.TestNames.Destination, function() { let destinationSettings: PrintPreviewDestinationSettingsElement; return initialize() .then(function(args) { @@ -632,8 +630,7 @@ * header/footer setting is set to false. */ test( - assert(preview_generation_test.TestNames - .ZeroDefaultMarginsClearsHeaderFooter), + preview_generation_test.TestNames.ZeroDefaultMarginsClearsHeaderFooter, async () => { /** * @param ticket The parsed print ticket
diff --git a/chrome/test/data/webui/print_preview/print_button_test.ts b/chrome/test/data/webui/print_preview/print_button_test.ts index 8f79c45..7ba9d9d 100644 --- a/chrome/test/data/webui/print_preview/print_button_test.ts +++ b/chrome/test/data/webui/print_preview/print_button_test.ts
@@ -6,7 +6,6 @@ // <if expr="is_chromeos"> import {GooglePromotedDestinationId} from 'chrome://print/print_preview.js'; // </if> -import {assert} from 'chrome://resources/js/assert.js'; import {assertEquals, assertFalse, assertTrue} from 'chrome://webui-test/chai_assert.js'; // <if expr="is_chromeos"> @@ -91,7 +90,7 @@ // Tests that hidePreview() is called before print() if a local printer is // selected and the user clicks print while the preview is loading. - test(assert(print_button_test.TestNames.LocalPrintHidePreview), function() { + test(print_button_test.TestNames.LocalPrintHidePreview, function() { printBeforePreviewReady = true; return waitForInitialPreview() @@ -111,7 +110,7 @@ // Tests that hidePreview() is not called if Save as PDF is selected and // the user clicks print while the preview is loading. - test(assert(print_button_test.TestNames.PDFPrintVisiblePreview), function() { + test(print_button_test.TestNames.PDFPrintVisiblePreview, function() { printBeforePreviewReady = false; return waitForInitialPreview() @@ -152,8 +151,7 @@ // Chrome OS and the user clicks print while the preview is loading because // Save to Drive needs to be treated like Save as PDF. test( - assert(print_button_test.TestNames.SaveToDriveVisiblePreviewCros), - function() { + print_button_test.TestNames.SaveToDriveVisiblePreviewCros, function() { printBeforePreviewReady = false; return waitForInitialPreview()
diff --git a/chrome/test/data/webui/print_preview/print_preview_app_test.ts b/chrome/test/data/webui/print_preview/print_preview_app_test.ts index e2e5ce6..b297c98b 100644 --- a/chrome/test/data/webui/print_preview/print_preview_app_test.ts +++ b/chrome/test/data/webui/print_preview/print_preview_app_test.ts
@@ -3,9 +3,7 @@ // found in the LICENSE file. import {DuplexMode, NativeInitialSettings, NativeLayerImpl, PluginProxyImpl, PrintPreviewAppElement} from 'chrome://print/print_preview.js'; -import {assert} from 'chrome://resources/js/assert.js'; import {webUIListenerCallback} from 'chrome://resources/js/cr.js'; - import {assertEquals, assertFalse, assertTrue} from 'chrome://webui-test/chai_assert.js'; // <if expr="is_chromeos"> @@ -82,7 +80,7 @@ PluginProxyImpl.setInstance(pluginProxy); }); - test(assert(print_preview_app_test.TestNames.PrintPresets), async () => { + test(print_preview_app_test.TestNames.PrintPresets, async () => { await initialize(); assertEquals(1, page.settings.copies.value); assertFalse(page.settings.duplex.value); @@ -97,37 +95,28 @@ assertFalse(page.getSetting('copies').setFromUi); }); - test( - assert(print_preview_app_test.TestNames.DestinationsManaged), - async () => { - initialSettings.destinationsManaged = true; - await initialize(); - const sidebar = - page.shadowRoot!.querySelector('print-preview-sidebar')!; - assertTrue(sidebar.controlsManaged); - }); + test(print_preview_app_test.TestNames.DestinationsManaged, async () => { + initialSettings.destinationsManaged = true; + await initialize(); + const sidebar = page.shadowRoot!.querySelector('print-preview-sidebar')!; + assertTrue(sidebar.controlsManaged); + }); - test( - assert(print_preview_app_test.TestNames.HeaderFooterManaged), - async () => { - initialSettings.policies = {headerFooter: {allowedMode: true}}; - await initialize(); - const sidebar = - page.shadowRoot!.querySelector('print-preview-sidebar')!; - assertTrue(sidebar.controlsManaged); - }); + test(print_preview_app_test.TestNames.HeaderFooterManaged, async () => { + initialSettings.policies = {headerFooter: {allowedMode: true}}; + await initialize(); + const sidebar = page.shadowRoot!.querySelector('print-preview-sidebar')!; + assertTrue(sidebar.controlsManaged); + }); - test( - assert(print_preview_app_test.TestNames.CssBackgroundManaged), - async () => { - initialSettings.policies = {cssBackground: {allowedMode: 1}}; - await initialize(); - const sidebar = - page.shadowRoot!.querySelector('print-preview-sidebar')!; - assertTrue(sidebar.controlsManaged); - }); + test(print_preview_app_test.TestNames.CssBackgroundManaged, async () => { + initialSettings.policies = {cssBackground: {allowedMode: 1}}; + await initialize(); + const sidebar = page.shadowRoot!.querySelector('print-preview-sidebar')!; + assertTrue(sidebar.controlsManaged); + }); - test(assert(print_preview_app_test.TestNames.SheetsManaged), async () => { + test(print_preview_app_test.TestNames.SheetsManaged, async () => { initialSettings.policies = {sheets: {value: 2}}; await initialize(); const sidebar = page.shadowRoot!.querySelector('print-preview-sidebar')!;
diff --git a/chrome/test/data/webui/print_preview/print_preview_sidebar_test.ts b/chrome/test/data/webui/print_preview/print_preview_sidebar_test.ts index d6449af..31841bc 100644 --- a/chrome/test/data/webui/print_preview/print_preview_sidebar_test.ts +++ b/chrome/test/data/webui/print_preview/print_preview_sidebar_test.ts
@@ -3,7 +3,6 @@ // found in the LICENSE file. import {NativeLayerImpl, PrintPreviewModelElement, PrintPreviewSidebarElement} from 'chrome://print/print_preview.js'; -import {assert} from 'chrome://resources/js/assert.js'; import {assertEquals} from 'chrome://webui-test/chai_assert.js'; import {fakeDataBind} from 'chrome://webui-test/polymer_test_util.js'; @@ -58,8 +57,7 @@ }); test( - assert(print_preview_sidebar_test.TestNames - .SettingsSectionsVisibilityChange), + print_preview_sidebar_test.TestNames.SettingsSectionsVisibilityChange, function() { const moreSettingsElement = sidebar.shadowRoot!.querySelector('print-preview-more-settings')!; @@ -84,35 +82,29 @@ // Tests that number of sheets is correctly calculated if duplex setting is // enabled. - test( - assert(print_preview_sidebar_test.TestNames.SheetCountWithDuplex), - function() { - const header = - sidebar.shadowRoot!.querySelector('print-preview-header')!; - assertEquals(1, header.sheetCount); - sidebar.setSetting('pages', [1, 2, 3]); - assertEquals(3, header.sheetCount); - sidebar.setSetting('duplex', true); - assertEquals(2, header.sheetCount); - sidebar.setSetting('pages', [1, 2]); - assertEquals(1, header.sheetCount); - }); + test(print_preview_sidebar_test.TestNames.SheetCountWithDuplex, function() { + const header = sidebar.shadowRoot!.querySelector('print-preview-header')!; + assertEquals(1, header.sheetCount); + sidebar.setSetting('pages', [1, 2, 3]); + assertEquals(3, header.sheetCount); + sidebar.setSetting('duplex', true); + assertEquals(2, header.sheetCount); + sidebar.setSetting('pages', [1, 2]); + assertEquals(1, header.sheetCount); + }); // Tests that number of sheets is correctly calculated if multiple copies // setting is enabled. - test( - assert(print_preview_sidebar_test.TestNames.SheetCountWithCopies), - function() { - const header = - sidebar.shadowRoot!.querySelector('print-preview-header')!; - assertEquals(1, header.sheetCount); - sidebar.setSetting('copies', 4); - assertEquals(4, header.sheetCount); - sidebar.setSetting('duplex', true); - assertEquals(4, header.sheetCount); - sidebar.setSetting('pages', [1, 2]); - assertEquals(4, header.sheetCount); - sidebar.setSetting('duplex', false); - assertEquals(8, header.sheetCount); - }); + test(print_preview_sidebar_test.TestNames.SheetCountWithCopies, function() { + const header = sidebar.shadowRoot!.querySelector('print-preview-header')!; + assertEquals(1, header.sheetCount); + sidebar.setSetting('copies', 4); + assertEquals(4, header.sheetCount); + sidebar.setSetting('duplex', true); + assertEquals(4, header.sheetCount); + sidebar.setSetting('pages', [1, 2]); + assertEquals(4, header.sheetCount); + sidebar.setSetting('duplex', false); + assertEquals(8, header.sheetCount); + }); });
diff --git a/chrome/test/data/webui/print_preview/print_server_store_test.ts b/chrome/test/data/webui/print_preview/print_server_store_test.ts index 3a1704c..8cbe0ae 100644 --- a/chrome/test/data/webui/print_preview/print_server_store_test.ts +++ b/chrome/test/data/webui/print_preview/print_server_store_test.ts
@@ -3,9 +3,7 @@ // found in the LICENSE file. import {PrintServerStore, PrintServerStoreEventType} from 'chrome://print/print_preview.js'; -import {assert} from 'chrome://resources/js/assert.js'; import {addWebUiListener, removeWebUiListener, WebUiListener, webUIListenerCallback} from 'chrome://resources/js/cr.js'; - import {assertDeepEquals, assertTrue} from 'chrome://webui-test/chai_assert.js'; import {eventToPromise} from 'chrome://webui-test/test_util.js'; @@ -47,8 +45,7 @@ // Tests that print servers with the selected name are selected by ID is the // native layer choosePrintServers is called. test( - assert(print_server_store_test.TestNames.ChoosePrintServers), - async () => { + print_server_store_test.TestNames.ChoosePrintServers, async () => { const printServers = [ {id: 'user-server1', name: 'Print Server 1'}, {id: 'device-server2', name: 'Print Server 2'}, @@ -73,8 +70,7 @@ // Tests that print servers and fetching mode are updated when // PRINT_SERVERS_CHANGED occurs. test( - assert(print_server_store_test.TestNames.PrintServersChanged), - async () => { + print_server_store_test.TestNames.PrintServersChanged, async () => { const printServers = [ {id: 'server1', name: 'Print Server 1'}, {id: 'server2', name: 'Print Server 2'}, @@ -100,8 +96,7 @@ // getPrintServersConfig is called and an update to the print servers config // occurs. test( - assert(print_server_store_test.TestNames.GetPrintServersConfig), - async () => { + print_server_store_test.TestNames.GetPrintServersConfig, async () => { const printServers = [ {id: 'server1', name: 'Print Server 1'}, {id: 'server2', name: 'Print Server 2'}, @@ -125,16 +120,13 @@ // Tests that an event is dispatched are updated when SERVER_PRINTERS_LOADING // is called. - test( - assert(print_server_store_test.TestNames.ServerPrintersLoading), - async () => { - const whenServerPrintersLoadedEvent = eventToPromise( - PrintServerStoreEventType.SERVER_PRINTERS_LOADING, - printServerStore); + test(print_server_store_test.TestNames.ServerPrintersLoading, async () => { + const whenServerPrintersLoadedEvent = eventToPromise( + PrintServerStoreEventType.SERVER_PRINTERS_LOADING, printServerStore); - webUIListenerCallback('server-printers-loading', true); + webUIListenerCallback('server-printers-loading', true); - const serverPrintersLoadedEvent = await whenServerPrintersLoadedEvent; - assertTrue(serverPrintersLoadedEvent.detail); - }); + const serverPrintersLoadedEvent = await whenServerPrintersLoadedEvent; + assertTrue(serverPrintersLoadedEvent.detail); + }); });
diff --git a/chrome/test/data/webui/print_preview/restore_state_test.ts b/chrome/test/data/webui/print_preview/restore_state_test.ts index 1fa0bb3..e5bc3d7 100644 --- a/chrome/test/data/webui/print_preview/restore_state_test.ts +++ b/chrome/test/data/webui/print_preview/restore_state_test.ts
@@ -3,7 +3,6 @@ // found in the LICENSE file. import {getInstance, MarginsType, NativeInitialSettings, NativeLayerImpl, PluginProxyImpl, PrintPreviewAppElement, ScalingType, SerializedSettings, Settings, SettingsMixinInterface} from 'chrome://print/print_preview.js'; -import {assert} from 'chrome://resources/js/assert.js'; import {assertEquals} from 'chrome://webui-test/chai_assert.js'; // <if expr="is_chromeos"> @@ -113,7 +112,7 @@ * 90, dpi = 100, custom square paper, and custom margins. */ test( - assert(restore_state_test.TestNames.RestoreTrueValues), async function() { + restore_state_test.TestNames.RestoreTrueValues, async function() { const stickySettings: SerializedSettings = { version: 2, recentDestinations: [], @@ -158,8 +157,7 @@ * 120, dpi = 200, letter paper and default margins. */ test( - assert(restore_state_test.TestNames.RestoreFalseValues), - async function() { + restore_state_test.TestNames.RestoreFalseValues, async function() { const stickySettings: SerializedSettings = { version: 2, recentDestinations: [], @@ -198,7 +196,7 @@ * Tests that setting the settings values results in the correct serialized * values being sent to the native layer. */ - test(assert(restore_state_test.TestNames.SaveValues), async function() { + test(restore_state_test.TestNames.SaveValues, async function() { interface TestCase { section: string; settingName: string;
diff --git a/chrome/test/data/webui/print_preview/scaling_settings_interactive_test.ts b/chrome/test/data/webui/print_preview/scaling_settings_interactive_test.ts index c2f6462..b62797f 100644 --- a/chrome/test/data/webui/print_preview/scaling_settings_interactive_test.ts +++ b/chrome/test/data/webui/print_preview/scaling_settings_interactive_test.ts
@@ -3,7 +3,6 @@ // found in the LICENSE file. import {PrintPreviewModelElement, PrintPreviewScalingSettingsElement, ScalingType} from 'chrome://print/print_preview.js'; -import {assert} from 'chrome://resources/js/assert.js'; import {getDeepActiveElement} from 'chrome://resources/js/util.js'; import {assertEquals, assertFalse, assertNotEquals, assertTrue} from 'chrome://webui-test/chai_assert.js'; import {fakeDataBind} from 'chrome://webui-test/polymer_test_util.js'; @@ -42,8 +41,7 @@ }); test( - assert(scaling_settings_interactive_test.TestNames.AutoFocusInput), - async () => { + scaling_settings_interactive_test.TestNames.AutoFocusInput, async () => { const scalingInput = scalingSection.shadowRoot! .querySelector('print-preview-number-settings-section')!.$
diff --git a/chrome/test/data/webui/print_preview/scaling_settings_test.ts b/chrome/test/data/webui/print_preview/scaling_settings_test.ts index 7c18fa3..be204cf 100644 --- a/chrome/test/data/webui/print_preview/scaling_settings_test.ts +++ b/chrome/test/data/webui/print_preview/scaling_settings_test.ts
@@ -3,7 +3,6 @@ // found in the LICENSE file. import {PrintPreviewModelElement, PrintPreviewScalingSettingsElement, ScalingType} from 'chrome://print/print_preview.js'; -import {assert} from 'chrome://resources/js/assert.js'; import {assertEquals, assertFalse, assertTrue} from 'chrome://webui-test/chai_assert.js'; import {fakeDataBind} from 'chrome://webui-test/polymer_test_util.js'; @@ -39,8 +38,7 @@ }); test( - assert(scaling_settings_test.TestNames.ShowCorrectDropdownOptions), - function() { + scaling_settings_test.TestNames.ShowCorrectDropdownOptions, function() { // Not a PDF document -> No fit to page or fit to paper options. const fitToPageOption = scalingSection.shadowRoot!.querySelector<HTMLOptionElement>( @@ -111,7 +109,7 @@ // Verifies that setting the scaling value using the dropdown and/or the // custom input works correctly. - test(assert(scaling_settings_test.TestNames.SetScaling), async () => { + test(scaling_settings_test.TestNames.SetScaling, async () => { // Default is 100 const scalingInput = scalingSection.shadowRoot! @@ -188,7 +186,7 @@ // Verifies that the input is never disabled when the validity of the // setting changes. test( - assert(scaling_settings_test.TestNames.InputNotDisabledOnValidityChange), + scaling_settings_test.TestNames.InputNotDisabledOnValidityChange, async () => { const numberSection = scalingSection.shadowRoot!.querySelector( 'print-preview-number-settings-section')!;
diff --git a/chrome/test/data/webui/print_preview/select_mixin_test.ts b/chrome/test/data/webui/print_preview/select_mixin_test.ts index 9b3b960..e6cda8f2 100644 --- a/chrome/test/data/webui/print_preview/select_mixin_test.ts +++ b/chrome/test/data/webui/print_preview/select_mixin_test.ts
@@ -3,7 +3,6 @@ // found in the LICENSE file. import {SelectMixin, SelectMixinInterface} from 'chrome://print/print_preview.js'; -import {assert} from 'chrome://resources/js/assert.js'; import {html, PolymerElement} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js'; import {assertEquals} from 'chrome://webui-test/chai_assert.js'; import {eventToPromise} from 'chrome://webui-test/test_util.js'; @@ -61,7 +60,7 @@ // Tests that onProcessSelectChange() is called when the select value is // set programmatically or by changing the select element. - test(assert(select_mixin_test.TestNames.CallProcessSelectChange), function() { + test(select_mixin_test.TestNames.CallProcessSelectChange, function() { const select = testSelect.shadowRoot!.querySelector('select')!; assertEquals('0', testSelect.selectedValue); assertEquals('0', select.value);
diff --git a/chrome/test/data/webui/print_preview/system_dialog_browsertest.ts b/chrome/test/data/webui/print_preview/system_dialog_browsertest.ts index eb433ee..a76ec879 100644 --- a/chrome/test/data/webui/print_preview/system_dialog_browsertest.ts +++ b/chrome/test/data/webui/print_preview/system_dialog_browsertest.ts
@@ -3,7 +3,6 @@ // found in the LICENSE file. import {CrButtonElement, NativeLayerImpl, PluginProxyImpl, PrintPreviewLinkContainerElement, PrintPreviewSidebarElement, ScalingType, whenReady} from 'chrome://print/print_preview.js'; -import {assert} from 'chrome://resources/js/assert.js'; import {assertEquals, assertFalse, assertTrue} from 'chrome://webui-test/chai_assert.js'; import {waitBeforeNextRender} from 'chrome://webui-test/polymer_test_util.js'; import {eventToPromise} from 'chrome://webui-test/test_util.js'; @@ -81,8 +80,7 @@ }); test( - assert(system_dialog_browsertest.TestNames.LinkTriggersLocalPrint), - function() { + system_dialog_browsertest.TestNames.LinkTriggersLocalPrint, function() { assertFalse(linkContainer.disabled); assertFalse(link.hidden); link.click(); @@ -94,7 +92,7 @@ }); test( - assert(system_dialog_browsertest.TestNames.InvalidSettingsDisableLink), + system_dialog_browsertest.TestNames.InvalidSettingsDisableLink, function() { assertFalse(linkContainer.disabled); assertFalse(link.hidden);
diff --git a/chrome/test/data/webui/settings/chromeos/hotspot_subpage_tests.js b/chrome/test/data/webui/settings/chromeos/hotspot_subpage_tests.js new file mode 100644 index 0000000..e6d7067 --- /dev/null +++ b/chrome/test/data/webui/settings/chromeos/hotspot_subpage_tests.js
@@ -0,0 +1,35 @@ +// Copyright 2022 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +import {Router, routes} from 'chrome://os-settings/chromeos/os_settings.js'; +import {assertEquals, assertFalse, assertTrue} from 'chrome://webui-test/chai_assert.js'; +import {flushTasks} from 'chrome://webui-test/polymer_test_util.js'; + +suite('HotspotSubpageTest', function() { + /** @type {HotspotSubpageElement} */ + let hotspotSubpage = null; + + setup(function() { + // Disable animations so sub-pages open within one event loop. + testing.Test.disableAnimationsAndTransitions(); + PolymerTest.clearBody(); + hotspotSubpage = document.createElement('settings-hotspot-subpage'); + document.body.appendChild(hotspotSubpage); + Router.getInstance().navigateTo(routes.HOTSPOT_DETAIL); + + return flushTasks(); + }); + + teardown(function() { + return flushTasks().then(() => { + hotspotSubpage.remove(); + hotspotSubpage = null; + Router.getInstance().resetRouteForTesting(); + }); + }); + + test('Base Test', async function() { + assertTrue(!!hotspotSubpage); + }); +}); \ No newline at end of file
diff --git a/chrome/test/data/webui/settings/chromeos/hotspot_summary_item_tests.js b/chrome/test/data/webui/settings/chromeos/hotspot_summary_item_tests.js new file mode 100644 index 0000000..f65454d --- /dev/null +++ b/chrome/test/data/webui/settings/chromeos/hotspot_summary_item_tests.js
@@ -0,0 +1,44 @@ +// Copyright 2022 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +import {Router, routes} from 'chrome://os-settings/chromeos/os_settings.js'; +import {flush} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js'; +import {assertEquals, assertFalse, assertTrue} from 'chrome://webui-test/chai_assert.js'; + +suite('HotspotSummaryItemTest', function() { + /** @type {HotspotSummaryItemElement} */ + let hotspotSummaryItem = null; + + setup(function() { + PolymerTest.clearBody(); + hotspotSummaryItem = document.createElement('hotspot-summary-item'); + document.body.appendChild(hotspotSummaryItem); + flush(); + }); + + teardown(function() { + hotspotSummaryItem.remove(); + hotspotSummaryItem = null; + Router.getInstance().resetRouteForTesting(); + }); + + test('clicking on subpage arrow routes to hotspot subpage', async function() { + const subpageArrow = hotspotSummaryItem.shadowRoot.querySelector( + '#hotspotSummaryItemRowArrowIcon'); + assertTrue(!!subpageArrow); + subpageArrow.click(); + assertEquals(Router.getInstance().getCurrentRoute(), routes.HOTSPOT_DETAIL); + }); + + test( + 'clicking on hotspot summary row routes to hotspot subpage', + async function() { + const subpageArrow = hotspotSummaryItem.shadowRoot.querySelector( + '#hotspotSummaryItemRow'); + assertTrue(!!subpageArrow); + subpageArrow.click(); + assertEquals( + Router.getInstance().getCurrentRoute(), routes.HOTSPOT_DETAIL); + }); +}); \ No newline at end of file
diff --git a/chrome/test/data/webui/settings/chromeos/network_summary_test.js b/chrome/test/data/webui/settings/chromeos/network_summary_test.js index 9472d27..f3f7246 100644 --- a/chrome/test/data/webui/settings/chromeos/network_summary_test.js +++ b/chrome/test/data/webui/settings/chromeos/network_summary_test.js
@@ -23,9 +23,21 @@ assertEquals('WiFi', summaryItems[0].id); }); - test('Hotspot summary item', function() { - const hotspotSummaryItem = netSummary.$$('hotspot-summary-item'); - assertTrue(!!hotspotSummaryItem); + [false, true].forEach(isHotspotFeatureEnabled => { + test('Hotspot summary item', async () => { + loadTimeData.overrideValues( + {'isHotspotEnabled': isHotspotFeatureEnabled}); + netSummary = document.createElement('network-summary'); + document.body.appendChild(netSummary); + flush(); + const hotspotSummaryItem = netSummary.$$('hotspot-summary-item'); + + if (isHotspotFeatureEnabled) { + assertTrue(!!hotspotSummaryItem); + } else { + assertFalse(!!hotspotSummaryItem); + } + }); }); });
diff --git a/chrome/test/data/webui/settings/chromeos/os_settings_v3_browsertest.js b/chrome/test/data/webui/settings/chromeos/os_settings_v3_browsertest.js index c3f72506..65c238e 100644 --- a/chrome/test/data/webui/settings/chromeos/os_settings_v3_browsertest.js +++ b/chrome/test/data/webui/settings/chromeos/os_settings_v3_browsertest.js
@@ -280,6 +280,46 @@ mocha.run(); }); +// TODO(b/239477916) Move this test back into the list of tests below once +// hotspot is launched. +var OSSettingsHotspotSubpageV3Test = class extends OSSettingsV3BrowserTest { + /** @override */ + get browsePreload() { + return 'chrome://os-settings/test_loader.html?module=settings/chromeos/hotspot_subpage_tests.js&host=test'; + } + + /** @override */ + get featureList() { + return { + enabled: super.featureList.enabled.concat(['ash::features::kHotspot']) + }; + } +}; + +TEST_F('OSSettingsHotspotSubpageV3Test', 'AllJsTests', () => { + mocha.run(); +}); + +// TODO(b/239477916) Move this test back into the list of tests below once +// hotspot is launched. +var OSSettingsHotspotSummaryItemV3Test = class extends OSSettingsV3BrowserTest { + /** @override */ + get browsePreload() { + return 'chrome://os-settings/test_loader.html?module=settings/chromeos/hotspot_summary_item_tests.js&host=test'; + } + + /** @override */ + get featureList() { + return { + enabled: super.featureList.enabled.concat(['ash::features::kHotspot']) + }; + } +}; + +TEST_F('OSSettingsHotspotSummaryItemV3Test', 'AllJsTests', () => { + mocha.run(); +}); + function crostiniTestGenPreamble() { GEN('crostini::FakeCrostiniFeatures fake_crostini_features;'); GEN('fake_crostini_features.SetAll(true);'); @@ -443,11 +483,7 @@ ['NearbyShareReceiveDialog', 'nearby_share_receive_dialog_tests.js'], ['NetworkAlwaysOnVpn', 'network_always_on_vpn_test.js'], ['NetworkProxySection', 'network_proxy_section_test.js'], - [ - 'NetworkSummary', - 'network_summary_test.js', - {enabled: ['ash::features::kHotspot']}, - ], + ['NetworkSummary', 'network_summary_test.js'], ['NetworkSummaryItem', 'network_summary_item_test.js'], ['OncMojoTest', 'onc_mojo_test.js'], ['OsBluetoothPage', 'os_bluetooth_page_tests.js'],
diff --git a/chrome/test/data/webui/settings/chromeos/select_to_speak_subpage_tests.js b/chrome/test/data/webui/settings/chromeos/select_to_speak_subpage_tests.js index 432af0c..5081b36 100644 --- a/chrome/test/data/webui/settings/chromeos/select_to_speak_subpage_tests.js +++ b/chrome/test/data/webui/settings/chromeos/select_to_speak_subpage_tests.js
@@ -4,47 +4,65 @@ import 'chrome://os-settings/chromeos/lazy_load.js'; -import {Router, routes} from 'chrome://os-settings/chromeos/os_settings.js'; -import {flush} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js'; -import {assertEquals, assertFalse, assertTrue} from 'chrome://webui-test/chai_assert.js'; -import {waitAfterNextRender, waitBeforeNextRender} from 'chrome://webui-test/polymer_test_util.js'; -import {eventToPromise, isVisible} from 'chrome://webui-test/test_util.js'; +import {CrSettingsPrefs, Router, routes} from 'chrome://os-settings/chromeos/os_settings.js'; +import {assertFalse, assertTrue} from 'chrome://webui-test/chai_assert.js'; suite('SelectToSpeakSubpageTests', function() { + /** @type {SettingsSelectToSpeakSubpageElement} */ let page = null; - function initPage() { - page = document.createElement('settings-select-to-speak-subpage'); - document.body.appendChild(page); - } - - setup(function() { + setup(async function() { PolymerTest.clearBody(); - Router.getInstance().navigateTo(routes.A11Y_SELECT_TO_SPEAK); + + const prefElement = document.createElement('settings-prefs'); + document.body.appendChild(prefElement); + + await CrSettingsPrefs.initialized; + page = document.createElement('settings-select-to-speak-subpage'); + page.prefs = prefElement.prefs; + document.body.appendChild(page); }); teardown(function() { - if (page) { - page.remove(); - } - Router.getInstance().resetRouteForTesting(); + page.remove(); }); - test('word highlight pref and toggle synced', async function() { - initPage(); - - // Make sure word highlight toggle is off, matching default pref state. + test('word highlight pref and toggle synced', function() { + // Make sure word highlight toggle is on, matching default pref state. const wordHighlightToggle = - page.shadowRoot.querySelector('#a11ySelectToSpeakOptionsHighlight'); - assertFalse(wordHighlightToggle.checked); + page.shadowRoot.querySelector('#wordHighlightToggle'); + assertTrue(wordHighlightToggle.checked); - // Toggle word highlighting on, and verify word_highlight pref is enabled. + // Toggle word highlighting off, and verify word_highlight pref is enabled. wordHighlightToggle.click(); - const wordHighlightPref = await new Promise( - resolve => chrome.settingsPrivate.getPref( - 'settings.a11y.select_to_speak_word_highlight', pref => { - resolve(pref); - })); - assertTrue(wordHighlightPref.value); + const wordHighlightPref = + page.getPref('settings.a11y.select_to_speak_word_highlight'); + assertFalse(wordHighlightPref.value); + }); + + test('background shading pref and toggle synced', function() { + // Make sure background shading toggle is off, matching default pref state. + const backgroundShadingToggle = + page.shadowRoot.querySelector('#backgroundShadingToggle'); + assertFalse(backgroundShadingToggle.checked); + + // Toggle background shading on, and verify pref is enabled. + backgroundShadingToggle.click(); + const backgroundShadingPref = + page.getPref('settings.a11y.select_to_speak_background_shading'); + assertTrue(backgroundShadingPref.value); + }); + + test('navigation controls pref and toggle synced', function() { + // Make sure navigation controls toggle is on, matching default pref state. + const navigationControlsToggle = + page.shadowRoot.querySelector('#navigationControlsToggle'); + assertTrue(navigationControlsToggle.checked); + + // Toggle navigation controls off, and verify pref is enabled. + navigationControlsToggle.click(); + const navigationControlsPref = + page.getPref('settings.a11y.select_to_speak_navigation_controls'); + assertFalse(navigationControlsPref.value); }); });
diff --git a/chromecast/base/BUILD.gn b/chromecast/base/BUILD.gn index e0d286a..90aee0c 100644 --- a/chromecast/base/BUILD.gn +++ b/chromecast/base/BUILD.gn
@@ -313,20 +313,15 @@ android_library("base_java") { java_src_dir = "//chromecast/base/java/src" sources = [ - "$java_src_dir/org/chromium/chromecast/base/BiConsumer.java", - "$java_src_dir/org/chromium/chromecast/base/BiFunction.java", - "$java_src_dir/org/chromium/chromecast/base/BiPredicate.java", "$java_src_dir/org/chromium/chromecast/base/Both.java", "$java_src_dir/org/chromium/chromecast/base/Box.java", "$java_src_dir/org/chromium/chromecast/base/Cell.java", - "$java_src_dir/org/chromium/chromecast/base/Consumer.java", "$java_src_dir/org/chromium/chromecast/base/Controller.java", "$java_src_dir/org/chromium/chromecast/base/Itertools.java", "$java_src_dir/org/chromium/chromecast/base/Observable.java", "$java_src_dir/org/chromium/chromecast/base/Observer.java", "$java_src_dir/org/chromium/chromecast/base/Observers.java", "$java_src_dir/org/chromium/chromecast/base/OwnedScope.java", - "$java_src_dir/org/chromium/chromecast/base/Predicate.java", "$java_src_dir/org/chromium/chromecast/base/Scope.java", "$java_src_dir/org/chromium/chromecast/base/Scopes.java", "$java_src_dir/org/chromium/chromecast/base/Sequencer.java",
diff --git a/chromecast/base/java/src/org/chromium/chromecast/base/BiConsumer.java b/chromecast/base/java/src/org/chromium/chromecast/base/BiConsumer.java deleted file mode 100644 index 49035672..0000000 --- a/chromecast/base/java/src/org/chromium/chromecast/base/BiConsumer.java +++ /dev/null
@@ -1,15 +0,0 @@ -// Copyright 2018 The Chromium Authors -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -package org.chromium.chromecast.base; - -/** - * A function that takes two arguments and returns void. - * - * TODO(sanfin): replace with Java 8 library if we're ever able to use the Java 8 library. - * - * @param <A> The first argument type. - * @param <B> The second argument type. - */ -public interface BiConsumer<A, B> { public void accept(A first, B second); }
diff --git a/chromecast/base/java/src/org/chromium/chromecast/base/BiFunction.java b/chromecast/base/java/src/org/chromium/chromecast/base/BiFunction.java deleted file mode 100644 index 6379beb..0000000 --- a/chromecast/base/java/src/org/chromium/chromecast/base/BiFunction.java +++ /dev/null
@@ -1,16 +0,0 @@ -// Copyright 2018 The Chromium Authors -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -package org.chromium.chromecast.base; - -/** - * A function that takes two arguments and returns a value. - * - * TODO(sanfin): replace with Java 8 library if we're ever able to use the Java 8 library. - * - * @param <A> The first argument type. - * @param <B> The second argument type. - * @param <R> The return type. - */ -public interface BiFunction<A, B, R> { public R apply(A first, B second); }
diff --git a/chromecast/base/java/src/org/chromium/chromecast/base/BiPredicate.java b/chromecast/base/java/src/org/chromium/chromecast/base/BiPredicate.java deleted file mode 100644 index 16bf7563..0000000 --- a/chromecast/base/java/src/org/chromium/chromecast/base/BiPredicate.java +++ /dev/null
@@ -1,15 +0,0 @@ -// Copyright 2018 The Chromium Authors -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -package org.chromium.chromecast.base; - -/** - * A function that takes two arguments and returns a boolean. - * - * TODO(sanfin): replace with Java 8 library if we're ever able to use the Java 8 library. - * - * @param <A> The first argument type. - * @param <B> The second argument type. - */ -public interface BiPredicate<A, B> { public boolean test(A a, B b); }
diff --git a/chromecast/base/java/src/org/chromium/chromecast/base/Both.java b/chromecast/base/java/src/org/chromium/chromecast/base/Both.java index c30c0936..ca4f124 100644 --- a/chromecast/base/java/src/org/chromium/chromecast/base/Both.java +++ b/chromecast/base/java/src/org/chromium/chromecast/base/Both.java
@@ -5,7 +5,12 @@ package org.chromium.chromecast.base; import java.util.Objects; +import java.util.function.BiConsumer; +import java.util.function.BiFunction; +import java.util.function.BiPredicate; +import java.util.function.Consumer; import java.util.function.Function; +import java.util.function.Predicate; /** * Represents a structure containing an instance of both A and B.
diff --git a/chromecast/base/java/src/org/chromium/chromecast/base/Consumer.java b/chromecast/base/java/src/org/chromium/chromecast/base/Consumer.java deleted file mode 100644 index 01e19652..0000000 --- a/chromecast/base/java/src/org/chromium/chromecast/base/Consumer.java +++ /dev/null
@@ -1,23 +0,0 @@ -// Copyright 2019 The Chromium Authors -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -package org.chromium.chromecast.base; - -/** - * Based on Java 8's {@code java.util.function.Consumer}. - * - * <p>An operation that accepts a single input argument and returns no result. - * - * @param <T> The type of the input to the operation. - */ -public interface Consumer<T> { - // TODO(crbug.com/1034012): Remove once min Android API level reaches 24. - - /** - * Performs this operation on the given argument. - * - * @param t The input argument. - */ - void accept(T t); -}
diff --git a/chromecast/base/java/src/org/chromium/chromecast/base/Observable.java b/chromecast/base/java/src/org/chromium/chromecast/base/Observable.java index afc5b1c0b..efd79501 100644 --- a/chromecast/base/java/src/org/chromium/chromecast/base/Observable.java +++ b/chromecast/base/java/src/org/chromium/chromecast/base/Observable.java
@@ -4,7 +4,10 @@ package org.chromium.chromecast.base; +import java.util.function.BiFunction; +import java.util.function.Consumer; import java.util.function.Function; +import java.util.function.Predicate; /** * Interface for Observable state.
diff --git a/chromecast/base/java/src/org/chromium/chromecast/base/Observers.java b/chromecast/base/java/src/org/chromium/chromecast/base/Observers.java index 2172023..38da2d8 100644 --- a/chromecast/base/java/src/org/chromium/chromecast/base/Observers.java +++ b/chromecast/base/java/src/org/chromium/chromecast/base/Observers.java
@@ -4,6 +4,9 @@ package org.chromium.chromecast.base; +import java.util.function.BiFunction; +import java.util.function.Consumer; + /** * Helper functions for creating Observers, used by Observable.subscribe() to handle state changes. */
diff --git a/chromecast/base/java/src/org/chromium/chromecast/base/Predicate.java b/chromecast/base/java/src/org/chromium/chromecast/base/Predicate.java deleted file mode 100644 index 9a58dd9c..0000000 --- a/chromecast/base/java/src/org/chromium/chromecast/base/Predicate.java +++ /dev/null
@@ -1,14 +0,0 @@ -// Copyright 2018 The Chromium Authors -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -package org.chromium.chromecast.base; - -/** - * A function that takes a single argument and returns a boolean. - * - * TODO(sanfin): replace with Java 8 library if we're ever able to use the Java 8 library. - * - * @param <T> The argument type. - */ -public interface Predicate<T> { public boolean test(T value); }
diff --git a/chromecast/base/java/test/org/chromium/chromecast/base/BothTest.java b/chromecast/base/java/test/org/chromium/chromecast/base/BothTest.java index 1756a67..88efde4 100644 --- a/chromecast/base/java/test/org/chromium/chromecast/base/BothTest.java +++ b/chromecast/base/java/test/org/chromium/chromecast/base/BothTest.java
@@ -19,7 +19,9 @@ import java.util.ArrayList; import java.util.List; +import java.util.function.Consumer; import java.util.function.Function; +import java.util.function.Predicate; /** * Tests for Both.
diff --git a/chromecast/base/java/test/org/chromium/chromecast/base/ObservableDelayTest.java b/chromecast/base/java/test/org/chromium/chromecast/base/ObservableDelayTest.java index 37abc0c2..7aad5b4 100644 --- a/chromecast/base/java/test/org/chromium/chromecast/base/ObservableDelayTest.java +++ b/chromecast/base/java/test/org/chromium/chromecast/base/ObservableDelayTest.java
@@ -10,6 +10,7 @@ import java.util.Map; import java.util.TreeMap; +import java.util.function.BiFunction; /** * Tests for Observable#delay().
diff --git a/chromecast/base/java/test/org/chromium/chromecast/base/ObserversTest.java b/chromecast/base/java/test/org/chromium/chromecast/base/ObserversTest.java index 9758b39d..d387b7e 100644 --- a/chromecast/base/java/test/org/chromium/chromecast/base/ObserversTest.java +++ b/chromecast/base/java/test/org/chromium/chromecast/base/ObserversTest.java
@@ -17,6 +17,8 @@ import java.util.ArrayList; import java.util.List; +import java.util.function.BiFunction; +import java.util.function.Consumer; /** * Tests for Observers, a utility class to construct readable objects that can be passed to
diff --git a/chromecast/browser/android/apk/src/org/chromium/chromecast/shell/AsyncTaskRunner.java b/chromecast/browser/android/apk/src/org/chromium/chromecast/shell/AsyncTaskRunner.java index cda3238e..66b08ac 100644 --- a/chromecast/browser/android/apk/src/org/chromium/chromecast/shell/AsyncTaskRunner.java +++ b/chromecast/browser/android/apk/src/org/chromium/chromecast/shell/AsyncTaskRunner.java
@@ -6,10 +6,10 @@ import org.chromium.base.supplier.Supplier; import org.chromium.base.task.AsyncTask; -import org.chromium.chromecast.base.Consumer; import org.chromium.chromecast.base.Scope; import java.util.concurrent.Executor; +import java.util.function.Consumer; /** * Runs a task on a worker thread, then run the callback with the result on the UI thread.
diff --git a/chromecast/browser/android/apk/src/org/chromium/chromecast/shell/CastWebContentsSurfaceHelper.java b/chromecast/browser/android/apk/src/org/chromium/chromecast/shell/CastWebContentsSurfaceHelper.java index 4da45d8..dc74ca6 100644 --- a/chromecast/browser/android/apk/src/org/chromium/chromecast/shell/CastWebContentsSurfaceHelper.java +++ b/chromecast/browser/android/apk/src/org/chromium/chromecast/shell/CastWebContentsSurfaceHelper.java
@@ -12,7 +12,6 @@ import org.chromium.base.Log; import org.chromium.chromecast.base.Both; -import org.chromium.chromecast.base.Consumer; import org.chromium.chromecast.base.Controller; import org.chromium.chromecast.base.Observable; import org.chromium.chromecast.base.Observer; @@ -21,6 +20,8 @@ import org.chromium.content.browser.MediaSessionImpl; import org.chromium.content_public.browser.WebContents; +import java.util.function.Consumer; + /** * A util class for CastWebContentsActivity to show WebContents on its views. * <p>
diff --git a/chromecast/browser/android/junit/src/org/chromium/chromecast/shell/CastWebContentsSurfaceHelperTest.java b/chromecast/browser/android/junit/src/org/chromium/chromecast/shell/CastWebContentsSurfaceHelperTest.java index 19f6edc..b9448e2b 100644 --- a/chromecast/browser/android/junit/src/org/chromium/chromecast/shell/CastWebContentsSurfaceHelperTest.java +++ b/chromecast/browser/android/junit/src/org/chromium/chromecast/shell/CastWebContentsSurfaceHelperTest.java
@@ -27,7 +27,6 @@ import org.robolectric.shadows.ShadowLooper; import org.chromium.base.test.BaseRobolectricTestRunner; -import org.chromium.chromecast.base.Consumer; import org.chromium.chromecast.base.Observer; import org.chromium.chromecast.base.Scope; import org.chromium.chromecast.shell.CastWebContentsSurfaceHelper.MediaSessionGetter; @@ -35,6 +34,8 @@ import org.chromium.content.browser.MediaSessionImpl; import org.chromium.content_public.browser.WebContents; +import java.util.function.Consumer; + /** * Tests for CastWebContentsSurfaceHelper. */
diff --git a/chromecast/cast_core/runtime/browser/BUILD.gn b/chromecast/cast_core/runtime/browser/BUILD.gn index d3f8119..448244c 100644 --- a/chromecast/cast_core/runtime/browser/BUILD.gn +++ b/chromecast/cast_core/runtime/browser/BUILD.gn
@@ -113,7 +113,6 @@ sources = [ "runtime_application_base.cc", "runtime_application_base.h", - "runtime_application_dispatcher.h", "runtime_application_dispatcher_impl.h", "streaming_runtime_application.cc", "streaming_runtime_application.h", @@ -145,7 +144,6 @@ "//content/public/browser", "//mojo/public/cpp/bindings", "//third_party/blink/public/common:headers", - "//third_party/openscreen/src/cast/common:public", "//url", ] }
diff --git a/chromecast/cast_core/runtime/browser/runtime_application_base.cc b/chromecast/cast_core/runtime/browser/runtime_application_base.cc index 350ac0d..11e5d15 100644 --- a/chromecast/cast_core/runtime/browser/runtime_application_base.cc +++ b/chromecast/cast_core/runtime/browser/runtime_application_base.cc
@@ -16,8 +16,6 @@ namespace chromecast { -RuntimeApplicationBase::Delegate::~Delegate() = default; - RuntimeApplicationBase::RuntimeApplicationBase( std::string cast_session_id, cast_receiver::ApplicationConfig app_config, @@ -34,9 +32,10 @@ CHECK(!is_application_running_); } -void RuntimeApplicationBase::SetDelegate(Delegate& delegate) { - DCHECK(!delegate_); - delegate_ = &delegate; +void RuntimeApplicationBase::SetEmbedderApplication( + cast_receiver::EmbedderApplication& embedder_application) { + DCHECK(!embedder_application_); + embedder_application_ = &embedder_application; } const std::string& RuntimeApplicationBase::GetDisplayName() const { @@ -53,13 +52,13 @@ void RuntimeApplicationBase::Load(StatusCallback callback) { DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); - DCHECK(delegate_->GetWebContents()); + DCHECK(embedder_application().GetWebContents()); is_application_running_ = true; if (cached_mojom_rules_) { // Apply cached URL rewrite rules before anything is done with the page. - auto* cast_web_contents = - CastWebContents::FromWebContents(delegate_->GetWebContents()); + auto* cast_web_contents = CastWebContents::FromWebContents( + embedder_application().GetWebContents()); DCHECK(cast_web_contents); cast_web_contents->SetUrlRewriteRules(std::move(cached_mojom_rules_)); } @@ -70,25 +69,26 @@ void RuntimeApplicationBase::Stop(StatusCallback callback) { DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); - StopApplication(Delegate::ApplicationStopReason::kUserRequest, - /*net_error_code=*/0); + StopApplication( + cast_receiver::EmbedderApplication::ApplicationStopReason::kUserRequest, + /*net_error_code=*/0); std::move(callback).Run(cast_receiver::OkStatus()); } cast_receiver::ApplicationClient::ApplicationControls* RuntimeApplicationBase::GetApplicationControls() { - if (!delegate().GetWebContents()) { + if (!embedder_application().GetWebContents()) { return nullptr; } return &application_client_->GetApplicationControls( - *delegate().GetWebContents()); + *embedder_application().GetWebContents()); } void RuntimeApplicationBase::LoadPage(const GURL& url) { DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); - delegate().LoadPage(url); + embedder_application().LoadPage(url); SetWebVisibilityAndPaint(false); } @@ -117,7 +117,7 @@ DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); DLOG(INFO) << "Page loaded: " << *this; - auto* window_controls = delegate_->GetContentWindowControls(); + auto* window_controls = embedder_application().GetContentWindowControls(); DCHECK(window_controls); window_controls->AddVisibilityChangeObserver(*this); if (is_touch_input_enabled_) { @@ -135,18 +135,18 @@ window_controls->HideWindow(); } - delegate().NotifyApplicationStarted(); + embedder_application().NotifyApplicationStarted(); } void RuntimeApplicationBase::SetUrlRewriteRules( url_rewrite::mojom::UrlRequestRewriteRulesPtr mojom_rules) { - if (!delegate_->GetWebContents()) { + if (!embedder_application().GetWebContents()) { cached_mojom_rules_ = std::move(mojom_rules); return; } auto* cast_web_contents = - CastWebContents::FromWebContents(delegate_->GetWebContents()); + CastWebContents::FromWebContents(embedder_application().GetWebContents()); DCHECK(cast_web_contents); cast_web_contents->SetUrlRewriteRules(std::move(mojom_rules)); } @@ -160,7 +160,7 @@ LOG(INFO) << "Media state updated: is_load_blocked=" << load_blocked << ", is_start_blocked=" << start_blocked << ", " << *this; - if (!delegate_->GetWebContents()) { + if (!embedder_application().GetWebContents()) { return; } @@ -181,7 +181,7 @@ LOG(INFO) << "Visibility updated: is_visible_=" << is_visible_ << ", " << *this; - auto* window_controls = delegate_->GetContentWindowControls(); + auto* window_controls = embedder_application().GetContentWindowControls(); if (!window_controls) { return; } @@ -200,7 +200,7 @@ LOG(INFO) << "Touch input updated: is_touch_input_enabled_= " << is_touch_input_enabled_ << ", " << *this; - auto* window_controls = delegate_->GetContentWindowControls(); + auto* window_controls = embedder_application().GetContentWindowControls(); if (!window_controls) { return; } @@ -217,7 +217,7 @@ } void RuntimeApplicationBase::StopApplication( - Delegate::ApplicationStopReason stop_reason, + cast_receiver::EmbedderApplication::ApplicationStopReason stop_reason, int32_t net_error_code) { DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); @@ -226,26 +226,26 @@ } is_application_running_ = false; - auto* web_contents = delegate_->GetWebContents(); + auto* web_contents = embedder_application().GetWebContents(); if (web_contents) { web_contents->DispatchBeforeUnload(false /* auto_cancel */); web_contents->ClosePage(); // Check if window is still available as page might have been closed before. - auto* window_controls = delegate_->GetContentWindowControls(); + auto* window_controls = embedder_application().GetContentWindowControls(); if (window_controls) { window_controls->RemoveVisibilityChangeObserver(*this); } } - delegate().NotifyApplicationStopped(stop_reason, net_error_code); + embedder_application().NotifyApplicationStopped(stop_reason, net_error_code); LOG(INFO) << "Application is stopped: stop_reason=" << stop_reason << ", " << *this; } void RuntimeApplicationBase::SetWebVisibilityAndPaint(bool is_visible) { - auto* web_contents = delegate_->GetWebContents(); + auto* web_contents = embedder_application().GetWebContents(); if (!web_contents) { return; } @@ -271,24 +271,4 @@ SetWebVisibilityAndPaint(false); } -std::ostream& operator<<( - std::ostream& os, - RuntimeApplicationBase::Delegate::ApplicationStopReason reason) { - switch (reason) { - case RuntimeApplicationBase::Delegate::ApplicationStopReason::kUndefined: - return os << "Undefined"; - case RuntimeApplicationBase::Delegate::ApplicationStopReason:: - kApplicationRequest: - return os << "Application Request"; - case RuntimeApplicationBase::Delegate::ApplicationStopReason::kIdleTimeout: - return os << "Idle Timeout"; - case RuntimeApplicationBase::Delegate::ApplicationStopReason::kUserRequest: - return os << "Use Request"; - case RuntimeApplicationBase::Delegate::ApplicationStopReason::kHttpError: - return os << "HTTP Error"; - case RuntimeApplicationBase::Delegate::ApplicationStopReason::kRuntimeError: - return os << "Runtime Error"; - } -} - } // namespace chromecast
diff --git a/chromecast/cast_core/runtime/browser/runtime_application_base.h b/chromecast/cast_core/runtime/browser/runtime_application_base.h index efa25f3..7ea5f9a 100644 --- a/chromecast/cast_core/runtime/browser/runtime_application_base.h +++ b/chromecast/cast_core/runtime/browser/runtime_application_base.h
@@ -16,17 +16,12 @@ #include "components/cast_receiver/browser/public/application_client.h" #include "components/cast_receiver/browser/public/application_config.h" #include "components/cast_receiver/browser/public/content_window_controls.h" +#include "components/cast_receiver/browser/public/embedder_application.h" #include "components/cast_receiver/browser/public/runtime_application.h" #include "components/url_rewrite/mojom/url_request_rewrite.mojom.h" -namespace cast_receiver { -class MessagePortService; -class StreamingConfigManager; -} // namespace cast_receiver - namespace content { class WebContents; -class WebUIControllerFactory; } // namespace content namespace chromecast { @@ -39,99 +34,25 @@ : public cast_receiver::RuntimeApplication, public cast_receiver::ContentWindowControls::VisibilityChangeObserver { public: - // This class defines a wrapper around any platform-specific communication - // details required for functionality of a RuntimeApplicationBase instance. - class Delegate { - public: - enum class ApplicationStopReason { - kUndefined = 0, - kApplicationRequest, - kIdleTimeout, - kUserRequest, - kHttpError, - kRuntimeError - }; - - virtual ~Delegate(); - - // Notifies the Cast agent that application has started. - virtual void NotifyApplicationStarted() = 0; - - // Notifies the Cast agent that application has stopped. - virtual void NotifyApplicationStopped(ApplicationStopReason stop_reason, - int32_t net_error_code) = 0; - - // Notifies the Cast agent about media playback state changed. - virtual void NotifyMediaPlaybackChanged(bool playing) = 0; - - // Fetches all bindings asynchronously, calling |callback| with the results - // of this call once it returns. - using GetAllBindingsCallback = - base::OnceCallback<void(cast_receiver::Status, - std::vector<std::string>)>; - virtual void GetAllBindings(GetAllBindingsCallback callback) = 0; - - // Gets the platform-specific MessagePortService instance for this - // application, if such an instance exists. - virtual cast_receiver::MessagePortService* GetMessagePortService() = 0; - - // Creates a new platform-specific WebUIControllerFactory. - virtual std::unique_ptr<content::WebUIControllerFactory> - CreateWebUIControllerFactory(std::vector<std::string> hosts) = 0; - - // Returns the WebContents this application should use. - // - // TODO(crbug.com/1382907): Change to a callback-based API. - virtual content::WebContents* GetWebContents() = 0; - - // Returns the window controls for this instance. - // - // TODO(crbug.com/1382907): Change to a callback-based API. - virtual cast_receiver::ContentWindowControls* - GetContentWindowControls() = 0; - - virtual cast_receiver::StreamingConfigManager* - GetStreamingConfigManager() = 0; - - // Loads |url| in the associated WebContents. - // - // TODO(crbug.com/1383332): Remove this function. - virtual void LoadPage(const GURL& url) = 0; - }; - ~RuntimeApplicationBase() override; - void SetDelegate(Delegate& delegate); + // Sets the |embedder_application| to be used for making calls to platform- + // specific implementations of cast_receiver interfaces. + void SetEmbedderApplication( + cast_receiver::EmbedderApplication& embedder_application); - // Called before Launch() to perform any pre-launch loading that is - // necessary. The |callback| will be called indicating if the operation - // succeeded or not. If Load fails, |this| should be destroyed since it's not - // necessarily valid to retry Load with a new request. - void Load(StatusCallback callback); - - // Called to stop the application. The |callback| will be called indicating - // if the operation succeeded or not. - void Stop(StatusCallback callback); - - // Sets URL rewrite rules. + // RuntimeApplication implementation. + // + // To be implemented by descendants of this class: + // - Launch(StatusCallback callback) + // - IsStreamingApplication() + void Load(StatusCallback callback) override; + void Stop(StatusCallback callback) override; void SetUrlRewriteRules( - url_rewrite::mojom::UrlRequestRewriteRulesPtr mojom_rules); - - // Sets media playback state. - void SetMediaBlocking(bool load_blocked, bool start_blocked); - - // Sets visibility state. - void SetVisibility(bool is_visible); - - // Sets touch input. - void SetTouchInputEnabled(bool enabled); - - // Called to launch the application. The |callback| will be called indicating - // if the operation succeeded or not. - virtual void Launch(StatusCallback callback) = 0; - - // Partial RuntimeApplication implementation: - // IsStreamingApplication must be implemented in inherited classes. + url_rewrite::mojom::UrlRequestRewriteRulesPtr mojom_rules) override; + void SetMediaBlocking(bool load_blocked, bool start_blocked) override; + void SetVisibility(bool is_visible) override; + void SetTouchInputEnabled(bool enabled) override; const std::string& GetDisplayName() const override; const std::string& GetAppId() const override; const std::string& GetCastSessionId() const override; @@ -146,14 +67,18 @@ // Stops the running application. Must be called before destruction of any // instance of the implementing object. - virtual void StopApplication(Delegate::ApplicationStopReason stop_reason, - int32_t net_error_code); + virtual void StopApplication( + cast_receiver::EmbedderApplication::ApplicationStopReason stop_reason, + int32_t net_error_code); scoped_refptr<base::SequencedTaskRunner> task_runner() { return task_runner_; } - Delegate& delegate() { return *delegate_; } + cast_receiver::EmbedderApplication& embedder_application() { + DCHECK(embedder_application_); + return *embedder_application_; + } // NOTE: This field is empty until after Load() is called. const cast_receiver::ApplicationConfig& config() const { return app_config_; } @@ -188,7 +113,8 @@ base::raw_ref<cast_receiver::ApplicationClient> application_client_; - base::raw_ptr<Delegate> delegate_{nullptr}; + base::raw_ptr<cast_receiver::EmbedderApplication> embedder_application_{ + nullptr}; // Cached mojom rules that are set iff |cast_web_view_| is not created before // SetUrlRewriteRules is called. @@ -207,10 +133,6 @@ base::WeakPtrFactory<RuntimeApplicationBase> weak_factory_{this}; }; -std::ostream& operator<<( - std::ostream& os, - RuntimeApplicationBase::Delegate::ApplicationStopReason reason); - } // namespace chromecast #endif // CHROMECAST_CAST_CORE_RUNTIME_BROWSER_RUNTIME_APPLICATION_BASE_H_
diff --git a/chromecast/cast_core/runtime/browser/runtime_application_dispatcher.h b/chromecast/cast_core/runtime/browser/runtime_application_dispatcher.h deleted file mode 100644 index 8fd16b8b..0000000 --- a/chromecast/cast_core/runtime/browser/runtime_application_dispatcher.h +++ /dev/null
@@ -1,46 +0,0 @@ -// Copyright 2021 The Chromium Authors -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef CHROMECAST_CAST_CORE_RUNTIME_BROWSER_RUNTIME_APPLICATION_DISPATCHER_H_ -#define CHROMECAST_CAST_CORE_RUNTIME_BROWSER_RUNTIME_APPLICATION_DISPATCHER_H_ - -#include <memory> -#include <string> - -#include "base/functional/callback.h" -#include "components/cast_receiver/browser/public/application_config.h" - -namespace chromecast { - -class RuntimeApplicationBase; - -template <typename TRuntimeApplicationPlatform> -class RuntimeApplicationDispatcher { - public: - using RuntimeApplicationPlatformFactory = - base::OnceCallback<std::unique_ptr<TRuntimeApplicationPlatform>( - std::unique_ptr<RuntimeApplicationBase>)>; - - virtual ~RuntimeApplicationDispatcher() = default; - - // Creates an application of |TRuntimeApplicationPlatform| type and adds to - // the |loaded_apps_| list. - virtual TRuntimeApplicationPlatform* CreateApplication( - std::string session_id, - cast_receiver::ApplicationConfig app_config, - RuntimeApplicationPlatformFactory factory) = 0; - - // Returns an existing application or nullptr. - virtual TRuntimeApplicationPlatform* GetApplication( - const std::string& session_id) = 0; - - // Destroys an existing application and returns its pointer for possible - // post-processing. - virtual std::unique_ptr<TRuntimeApplicationPlatform> DestroyApplication( - const std::string& session_id) = 0; -}; - -} // namespace chromecast - -#endif // CHROMECAST_CAST_CORE_RUNTIME_BROWSER_RUNTIME_APPLICATION_DISPATCHER_H_
diff --git a/chromecast/cast_core/runtime/browser/runtime_application_dispatcher_impl.h b/chromecast/cast_core/runtime/browser/runtime_application_dispatcher_impl.h index 347f1b60..dc62fba 100644 --- a/chromecast/cast_core/runtime/browser/runtime_application_dispatcher_impl.h +++ b/chromecast/cast_core/runtime/browser/runtime_application_dispatcher_impl.h
@@ -13,18 +13,18 @@ #include "base/memory/raw_ref.h" #include "base/sequence_checker.h" #include "chromecast/cast_core/runtime/browser/runtime_application_base.h" -#include "chromecast/cast_core/runtime/browser/runtime_application_dispatcher.h" #include "chromecast/cast_core/runtime/browser/streaming_runtime_application.h" #include "chromecast/cast_core/runtime/browser/web_runtime_application.h" #include "components/cast_receiver/browser/public/application_client.h" #include "components/cast_receiver/browser/public/application_config.h" -#include "third_party/openscreen/src/cast/common/public/cast_streaming_app_ids.h" +#include "components/cast_receiver/browser/public/runtime_application_dispatcher.h" +#include "components/cast_streaming/public/app_ids.h" namespace chromecast { -template <typename TRuntimeApplicationPlatform> +template <typename TEmbedderApplication> class RuntimeApplicationDispatcherImpl - : public RuntimeApplicationDispatcher<TRuntimeApplicationPlatform> { + : public cast_receiver::RuntimeApplicationDispatcher<TEmbedderApplication> { public: // |application_client| is expected to persist for the lifetime of this // instance. @@ -33,42 +33,42 @@ ~RuntimeApplicationDispatcherImpl() override = default; private: - using RuntimeApplicationPlatformFactory = RuntimeApplicationDispatcher< - TRuntimeApplicationPlatform>::RuntimeApplicationPlatformFactory; + using EmbedderApplicationFactory = + cast_receiver::RuntimeApplicationDispatcher< + TEmbedderApplication>::EmbedderApplicationFactory; // RuntimeApplicationDispatcher implementation. - TRuntimeApplicationPlatform* CreateApplication( + TEmbedderApplication* CreateApplication( std::string session_id, cast_receiver::ApplicationConfig app_config, - RuntimeApplicationPlatformFactory factory) override; - TRuntimeApplicationPlatform* GetApplication( - const std::string& session_id) override; - std::unique_ptr<TRuntimeApplicationPlatform> DestroyApplication( + EmbedderApplicationFactory factory) override; + TEmbedderApplication* GetApplication(const std::string& session_id) override; + std::unique_ptr<TEmbedderApplication> DestroyApplication( const std::string& session_id) override; SEQUENCE_CHECKER(sequence_checker_); base::raw_ref<cast_receiver::ApplicationClient> const application_client_; - base::flat_map<std::string, std::unique_ptr<TRuntimeApplicationPlatform>> + base::flat_map<std::string, std::unique_ptr<TEmbedderApplication>> loaded_apps_; }; -template <typename TRuntimeApplicationPlatform> -RuntimeApplicationDispatcherImpl<TRuntimeApplicationPlatform>:: +template <typename TEmbedderApplication> +RuntimeApplicationDispatcherImpl<TEmbedderApplication>:: RuntimeApplicationDispatcherImpl( cast_receiver::ApplicationClient& application_client) : application_client_(application_client) {} -template <typename TRuntimeApplicationPlatform> -TRuntimeApplicationPlatform* -RuntimeApplicationDispatcherImpl<TRuntimeApplicationPlatform>:: - CreateApplication(std::string session_id, - cast_receiver::ApplicationConfig app_config, - RuntimeApplicationPlatformFactory factory) { +template <typename TEmbedderApplication> +TEmbedderApplication* +RuntimeApplicationDispatcherImpl<TEmbedderApplication>::CreateApplication( + std::string session_id, + cast_receiver::ApplicationConfig app_config, + EmbedderApplicationFactory factory) { DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); std::unique_ptr<RuntimeApplicationBase> app; - if (openscreen::cast::IsCastStreamingReceiverAppId(app_config.app_id)) { + if (cast_streaming::IsStreamingReceiverAppId(app_config.app_id)) { app = std::make_unique<StreamingRuntimeApplication>( session_id, std::move(app_config), *application_client_); } else { @@ -79,17 +79,20 @@ // TODO(b/232140331): Call this only when foreground app changes. application_client_->OnForegroundApplicationChanged(app.get()); - std::unique_ptr<TRuntimeApplicationPlatform> platform_app = + auto* app_ptr = app.get(); + std::unique_ptr<TEmbedderApplication> embedder_app = std::move(factory).Run(std::move(app)); + app_ptr->SetEmbedderApplication(*embedder_app); + auto [iter, success] = - loaded_apps_.emplace(std::move(session_id), std::move(platform_app)); + loaded_apps_.emplace(std::move(session_id), std::move(embedder_app)); DCHECK(success); return iter->second.get(); } -template <typename TRuntimeApplicationPlatform> -TRuntimeApplicationPlatform* -RuntimeApplicationDispatcherImpl<TRuntimeApplicationPlatform>::GetApplication( +template <typename TEmbedderApplication> +TEmbedderApplication* +RuntimeApplicationDispatcherImpl<TEmbedderApplication>::GetApplication( const std::string& session_id) { DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); @@ -97,10 +100,10 @@ return iter == loaded_apps_.end() ? nullptr : iter->second.get(); } -template <typename TRuntimeApplicationPlatform> -std::unique_ptr<TRuntimeApplicationPlatform> RuntimeApplicationDispatcherImpl< - TRuntimeApplicationPlatform>::DestroyApplication(const std::string& - session_id) { +template <typename TEmbedderApplication> +std::unique_ptr<TEmbedderApplication> +RuntimeApplicationDispatcherImpl<TEmbedderApplication>::DestroyApplication( + const std::string& session_id) { DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); auto iter = loaded_apps_.find(session_id);
diff --git a/chromecast/cast_core/runtime/browser/runtime_application_service_impl.cc b/chromecast/cast_core/runtime/browser/runtime_application_service_impl.cc index d9cc4c3b..ca765b2 100644 --- a/chromecast/cast_core/runtime/browser/runtime_application_service_impl.cc +++ b/chromecast/cast_core/runtime/browser/runtime_application_service_impl.cc
@@ -13,9 +13,9 @@ #include "chromecast/cast_core/runtime/browser/core_streaming_config_manager.h" #include "chromecast/cast_core/runtime/browser/grpc_webui_controller_factory.h" #include "chromecast/cast_core/runtime/browser/message_port_service_grpc.h" -#include "chromecast/cast_core/runtime/browser/runtime_application_base.h" #include "chromecast/cast_core/runtime/browser/url_rewrite/url_request_rewrite_type_converters.h" #include "chromecast/common/feature_constants.h" +#include "components/cast_receiver/browser/public/content_window_controls.h" namespace chromecast { namespace { @@ -85,20 +85,23 @@ }; cast::common::StopReason::Type ToProtoType( - RuntimeApplicationBase::Delegate::ApplicationStopReason reason) { + cast_receiver::EmbedderApplication::ApplicationStopReason reason) { switch (reason) { - case RuntimeApplicationBase::Delegate::ApplicationStopReason::kUndefined: + case cast_receiver::EmbedderApplication::ApplicationStopReason::kUndefined: return cast::common::StopReason::UNDEFINED; - case RuntimeApplicationBase::Delegate::ApplicationStopReason:: + case cast_receiver::EmbedderApplication::ApplicationStopReason:: kApplicationRequest: return cast::common::StopReason::APPLICATION_REQUEST; - case RuntimeApplicationBase::Delegate::ApplicationStopReason::kIdleTimeout: + case cast_receiver::EmbedderApplication::ApplicationStopReason:: + kIdleTimeout: return cast::common::StopReason::IDLE_TIMEOUT; - case RuntimeApplicationBase::Delegate::ApplicationStopReason::kUserRequest: + case cast_receiver::EmbedderApplication::ApplicationStopReason:: + kUserRequest: return cast::common::StopReason::USER_REQUEST; - case RuntimeApplicationBase::Delegate::ApplicationStopReason::kHttpError: + case cast_receiver::EmbedderApplication::ApplicationStopReason::kHttpError: return cast::common::StopReason::HTTP_ERROR; - case RuntimeApplicationBase::Delegate::ApplicationStopReason::kRuntimeError: + case cast_receiver::EmbedderApplication::ApplicationStopReason:: + kRuntimeError: return cast::common::StopReason::RUNTIME_ERROR; } } @@ -118,7 +121,7 @@ } // namespace RuntimeApplicationServiceImpl::RuntimeApplicationServiceImpl( - std::unique_ptr<RuntimeApplicationBase> runtime_application, + std::unique_ptr<cast_receiver::RuntimeApplication> runtime_application, cast::common::ApplicationConfig config, scoped_refptr<base::SequencedTaskRunner> task_runner, CastWebService& web_service) @@ -128,8 +131,6 @@ web_service_(web_service) { DCHECK(runtime_application_); DCHECK(task_runner_); - - runtime_application_->SetDelegate(*this); } RuntimeApplicationServiceImpl::~RuntimeApplicationServiceImpl() = default; @@ -465,7 +466,7 @@ DCHECK(core_app_stub_); DLOG(INFO) << "Media playback changed: playing=" << playing << ", " - << *runtime_application_; + << *runtime_application_; auto call = core_app_stub_->CreateCall< cast::v2::CoreApplicationServiceStub::MediaPlaybackChanged>();
diff --git a/chromecast/cast_core/runtime/browser/runtime_application_service_impl.h b/chromecast/cast_core/runtime/browser/runtime_application_service_impl.h index cfce31b..5106a29 100644 --- a/chromecast/cast_core/runtime/browser/runtime_application_service_impl.h +++ b/chromecast/cast_core/runtime/browser/runtime_application_service_impl.h
@@ -12,7 +12,7 @@ #include "chromecast/browser/cast_content_window.h" #include "chromecast/browser/cast_web_view.h" #include "chromecast/cast_core/grpc/grpc_server.h" -#include "chromecast/cast_core/runtime/browser/runtime_application_base.h" +#include "components/cast_receiver/browser/public/embedder_application.h" #include "components/cast_receiver/browser/public/runtime_application.h" #include "components/cast_receiver/common/public/status.h" #include "third_party/cast_core/public/src/proto/common/application_state.pb.h" @@ -38,15 +38,14 @@ class CastContentWindow; class MessagePortServiceGrpc; -class RuntimeApplicationBase; -class RuntimeApplicationServiceImpl : public RuntimeApplicationBase::Delegate, +class RuntimeApplicationServiceImpl : public cast_receiver::EmbedderApplication, public CastWebContents::Observer { public: using StatusCallback = cast_receiver::RuntimeApplication::StatusCallback; RuntimeApplicationServiceImpl( - std::unique_ptr<RuntimeApplicationBase> runtime_application, + std::unique_ptr<cast_receiver::RuntimeApplication> runtime_application, cast::common::ApplicationConfig config, scoped_refptr<base::SequencedTaskRunner> task_runner, CastWebService& web_service); @@ -61,7 +60,7 @@ const std::string& app_id() { return runtime_application_->GetAppId(); } - // RuntimeApplication::Delegate implementation: + // EmbedderApplication implementation: void NotifyApplicationStarted() override; void NotifyApplicationStopped(ApplicationStopReason stop_reason, int32_t net_error_code) override; @@ -137,7 +136,7 @@ void InnerContentsCreated(CastWebContents* inner_contents, CastWebContents* outer_contents) override; - std::unique_ptr<RuntimeApplicationBase> const runtime_application_; + std::unique_ptr<cast_receiver::RuntimeApplication> const runtime_application_; const cast::common::ApplicationConfig config_; scoped_refptr<base::SequencedTaskRunner> task_runner_;
diff --git a/chromecast/cast_core/runtime/browser/runtime_service_impl.cc b/chromecast/cast_core/runtime/browser/runtime_service_impl.cc index 1fa68f7..b6e517c 100644 --- a/chromecast/cast_core/runtime/browser/runtime_service_impl.cc +++ b/chromecast/cast_core/runtime/browser/runtime_service_impl.cc
@@ -18,6 +18,7 @@ #include "chromecast/cast_core/runtime/browser/runtime_application_service_impl.h" #include "chromecast/metrics/cast_event_builder_simple.h" #include "components/cast_receiver/browser/public/application_client.h" +#include "components/cast_receiver/browser/public/embedder_application.h" #include "third_party/cast_core/public/src/proto/common/application_config.pb.h" namespace chromecast { @@ -166,7 +167,8 @@ [](scoped_refptr<base::SequencedTaskRunner> task_runner, cast::common::ApplicationConfig config, CastWebService& web_service, - std::unique_ptr<RuntimeApplicationBase> runtime_application) { + std::unique_ptr<cast_receiver::RuntimeApplication> + runtime_application) { return std::make_unique<RuntimeApplicationServiceImpl>( std::move(runtime_application), std::move(config), std::move(task_runner), web_service);
diff --git a/chromecast/cast_core/runtime/browser/runtime_service_impl.h b/chromecast/cast_core/runtime/browser/runtime_service_impl.h index 8d71898..6f981d8 100644 --- a/chromecast/cast_core/runtime/browser/runtime_service_impl.h +++ b/chromecast/cast_core/runtime/browser/runtime_service_impl.h
@@ -14,9 +14,9 @@ #include "chromecast/cast_core/runtime/browser/cast_runtime_action_recorder.h" #include "chromecast/cast_core/runtime/browser/cast_runtime_metrics_recorder.h" #include "chromecast/cast_core/runtime/browser/cast_runtime_metrics_recorder_service.h" -#include "chromecast/cast_core/runtime/browser/runtime_application_dispatcher.h" #include "chromecast/cast_core/runtime/browser/runtime_application_service_impl.h" #include "components/cast_receiver/browser/public/application_client.h" +#include "components/cast_receiver/browser/public/runtime_application_dispatcher.h" #include "components/cast_receiver/common/public/status.h" #include "third_party/abseil-cpp/absl/types/optional.h" #include "third_party/cast_core/public/src/proto/metrics/metrics_recorder.castcore.pb.h" @@ -103,7 +103,8 @@ SEQUENCE_CHECKER(sequence_checker_); - std::unique_ptr<RuntimeApplicationDispatcher<RuntimeApplicationServiceImpl>> + std::unique_ptr<cast_receiver::RuntimeApplicationDispatcher< + RuntimeApplicationServiceImpl>> application_dispatcher_; scoped_refptr<base::SequencedTaskRunner> task_runner_;
diff --git a/chromecast/cast_core/runtime/browser/streaming_runtime_application.cc b/chromecast/cast_core/runtime/browser/streaming_runtime_application.cc index 2884b2dc..44fbf56 100644 --- a/chromecast/cast_core/runtime/browser/streaming_runtime_application.cc +++ b/chromecast/cast_core/runtime/browser/streaming_runtime_application.cc
@@ -6,13 +6,14 @@ #include "components/cast/message_port/platform_message_port.h" #include "components/cast_receiver/browser/public/application_client.h" +#include "components/cast_receiver/browser/public/embedder_application.h" #include "components/cast_receiver/browser/public/message_port_service.h" +#include "components/cast_streaming/public/app_ids.h" #include "components/cast_streaming/public/cast_streaming_url.h" #include "content/public/browser/navigation_handle.h" #include "content/public/browser/web_contents.h" #include "net/base/net_errors.h" #include "third_party/blink/public/common/associated_interfaces/associated_interface_provider.h" -#include "third_party/openscreen/src/cast/common/public/cast_streaming_app_ids.h" namespace chromecast { namespace { @@ -39,7 +40,7 @@ StreamingRuntimeApplication::~StreamingRuntimeApplication() { DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); StopApplication( - RuntimeApplicationBase::Delegate::ApplicationStopReason::kUserRequest, + cast_receiver::EmbedderApplication::ApplicationStopReason::kUserRequest, net::OK); } @@ -52,7 +53,7 @@ DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); LOG(WARNING) << "Streaming session for " << *this << " has hit an error!"; StopApplication( - RuntimeApplicationBase::Delegate::ApplicationStopReason::kRuntimeError, + cast_receiver::EmbedderApplication::ApplicationStopReason::kRuntimeError, net::ERR_FAILED); } @@ -66,10 +67,11 @@ void StreamingRuntimeApplication::Launch(StatusCallback callback) { DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); - SetContentPermissions(*delegate().GetWebContents()); + DCHECK(embedder_application().GetWebContents()); + SetContentPermissions(*embedder_application().GetWebContents()); // Bind Cast Transport. - auto* message_port_service = delegate().GetMessagePortService(); + auto* message_port_service = embedder_application().GetMessagePortService(); DCHECK(message_port_service); std::unique_ptr<cast_api_bindings::MessagePort> server_port; std::unique_ptr<cast_api_bindings::MessagePort> client_port; @@ -80,10 +82,10 @@ // Initialize the streaming receiver. receiver_session_client_ = std::make_unique<StreamingReceiverSessionClient>( task_runner(), application_client_->GetNetworkContextGetter(), - std::move(server_port), delegate().GetWebContents(), this, - delegate().GetStreamingConfigManager(), + std::move(server_port), embedder_application().GetWebContents(), this, + embedder_application().GetStreamingConfigManager(), /* supports_audio= */ GetAppId() != - openscreen::cast::GetIosAppStreamingAudioVideoAppId(), + cast_streaming::GetIosAppStreamingAudioVideoAppId(), /* supports_video= */ true); receiver_session_client_->LaunchStreamingReceiverAsync(); @@ -97,7 +99,7 @@ } void StreamingRuntimeApplication::StopApplication( - RuntimeApplicationBase::Delegate::ApplicationStopReason stop_reason, + cast_receiver::EmbedderApplication::ApplicationStopReason stop_reason, int32_t net_error_code) { DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); if (!receiver_session_client_) {
diff --git a/chromecast/cast_core/runtime/browser/streaming_runtime_application.h b/chromecast/cast_core/runtime/browser/streaming_runtime_application.h index 2a177b4..bc320ac 100644 --- a/chromecast/cast_core/runtime/browser/streaming_runtime_application.h +++ b/chromecast/cast_core/runtime/browser/streaming_runtime_application.h
@@ -33,7 +33,7 @@ // RuntimeApplicationBase implementation: void Launch(StatusCallback callback) override; void StopApplication( - RuntimeApplicationBase::Delegate::ApplicationStopReason stop_reason, + cast_receiver::EmbedderApplication::ApplicationStopReason stop_reason, int32_t net_error_code) override; bool IsStreamingApplication() const override;
diff --git a/chromecast/cast_core/runtime/browser/web_runtime_application.cc b/chromecast/cast_core/runtime/browser/web_runtime_application.cc index a4d625a..4aabd3fb 100644 --- a/chromecast/cast_core/runtime/browser/web_runtime_application.cc +++ b/chromecast/cast_core/runtime/browser/web_runtime_application.cc
@@ -7,6 +7,7 @@ #include "base/task/bind_post_task.h" #include "chromecast/browser/cast_web_service.h" #include "chromecast/common/feature_constants.h" +#include "components/cast_receiver/browser/public/embedder_application.h" #include "components/cast_receiver/browser/public/message_port_service.h" #include "components/url_rewrite/browser/url_request_rewrite_rules_manager.h" #include "content/public/browser/navigation_entry.h" @@ -30,7 +31,7 @@ WebRuntimeApplication::~WebRuntimeApplication() { DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); StopApplication( - RuntimeApplicationBase::Delegate::ApplicationStopReason::kUserRequest, + cast_receiver::EmbedderApplication::ApplicationStopReason::kUserRequest, net::OK); } @@ -39,15 +40,17 @@ LOG(INFO) << "Launching application: " << *this; - SetContentPermissions(*delegate().GetWebContents()); + SetContentPermissions(*embedder_application().GetWebContents()); // Register GrpcWebUI for handling Cast apps with URLs in the form // chrome*://* that use WebUIs. const std::vector<std::string> hosts = {"home", "error", "cast_resources"}; content::WebUIControllerFactory::RegisterFactory( - delegate().CreateWebUIControllerFactory(std::move(hosts)).release()); + embedder_application() + .CreateWebUIControllerFactory(std::move(hosts)) + .release()); - delegate().GetAllBindings(base::BindPostTask( + embedder_application().GetAllBindings(base::BindPostTask( task_runner(), base::BindOnce(&WebRuntimeApplication::OnAllBindingsReceived, weak_factory_.GetWeakPtr()))); @@ -69,7 +72,7 @@ DLOG(INFO) << "Inner web contents created"; CastWebContents* outer_cast_contents = - CastWebContents::FromWebContents(delegate().GetWebContents()); + CastWebContents::FromWebContents(embedder_application().GetWebContents()); DCHECK(outer_cast_contents); SetContentPermissions(*inner_web_contents); @@ -83,7 +86,7 @@ const MediaPlayerInfo& video_type, const content::MediaPlayerId& id) { DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); - delegate().NotifyMediaPlaybackChanged(true); + embedder_application().NotifyMediaPlaybackChanged(true); } void WebRuntimeApplication::MediaStoppedPlaying( @@ -91,7 +94,7 @@ const content::MediaPlayerId& id, content::WebContentsObserver::MediaStoppedReason reason) { DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); - delegate().NotifyMediaPlaybackChanged(false); + embedder_application().NotifyMediaPlaybackChanged(false); } void WebRuntimeApplication::OnAllBindingsReceived( @@ -100,22 +103,25 @@ DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); if (!status.ok()) { LOG(ERROR) << "Failed to get all bindings: " << status; - StopApplication( - RuntimeApplicationBase::Delegate::ApplicationStopReason::kRuntimeError, - net::ERR_FAILED); + StopApplication(cast_receiver::EmbedderApplication::ApplicationStopReason:: + kRuntimeError, + net::ERR_FAILED); return; } - content::WebContentsObserver::Observe(delegate().GetWebContents()); - cast_receiver::PageStateObserver::Observe(delegate().GetWebContents()); - auto* message_port_sevice = delegate().GetMessagePortService(); + content::WebContentsObserver::Observe( + embedder_application().GetWebContents()); + cast_receiver::PageStateObserver::Observe( + embedder_application().GetWebContents()); + auto* message_port_sevice = embedder_application().GetMessagePortService(); DCHECK(message_port_sevice); bindings_manager_ = std::make_unique<cast_receiver::BindingsManager>( *this, *message_port_sevice); for (auto& binding : bindings) { bindings_manager_->AddBinding(std::move(binding)); } - bindings_manager_->ConfigureWebContents(delegate().GetWebContents()); + bindings_manager_->ConfigureWebContents( + embedder_application().GetWebContents()); // Application is initialized now - we can load the URL. LoadPage(app_url()); @@ -129,7 +135,7 @@ void WebRuntimeApplication::OnError() { DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); StopApplication( - RuntimeApplicationBase::Delegate::ApplicationStopReason::kRuntimeError, + cast_receiver::EmbedderApplication::ApplicationStopReason::kRuntimeError, 0); } @@ -138,18 +144,18 @@ DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); switch (reason) { case cast_receiver::PageStateObserver::StopReason::kUnknown: - StopApplication(RuntimeApplicationBase::Delegate::ApplicationStopReason:: - kRuntimeError, + StopApplication(cast_receiver::EmbedderApplication:: + ApplicationStopReason::kRuntimeError, error_code); break; case cast_receiver::PageStateObserver::StopReason::kApplicationRequest: - StopApplication(RuntimeApplicationBase::Delegate::ApplicationStopReason:: - kApplicationRequest, + StopApplication(cast_receiver::EmbedderApplication:: + ApplicationStopReason::kApplicationRequest, error_code); break; case cast_receiver::PageStateObserver::StopReason::kHttpError: StopApplication( - RuntimeApplicationBase::Delegate::ApplicationStopReason::kHttpError, + cast_receiver::EmbedderApplication::ApplicationStopReason::kHttpError, error_code); break; }
diff --git a/chromeos/ash/components/string_matching/acronym_matcher.cc b/chromeos/ash/components/string_matching/acronym_matcher.cc index 30649c3..e352ef2 100644 --- a/chromeos/ash/components/string_matching/acronym_matcher.cc +++ b/chromeos/ash/components/string_matching/acronym_matcher.cc
@@ -47,6 +47,7 @@ for (auto token : text.tokens()) { text_acronym_.push_back(token[0]); } + text_mapping_ = text.mappings(); } AcronymMatcher::~AcronymMatcher() = default; @@ -60,6 +61,13 @@ if (found_index == 0) { relevance += kIsPrefixCharScore - kIsFrontOfTokenCharScore; } + + // update the |hits_| if there is a match. + for (size_t i = 0; i < query_.size(); i++) { + size_t start_pos = text_mapping_[i].start(); + hits_.emplace_back(start_pos, start_pos + 1); + } + return relevance; }
diff --git a/chromeos/ash/components/string_matching/acronym_matcher.h b/chromeos/ash/components/string_matching/acronym_matcher.h index ed54fef..317d27ef 100644 --- a/chromeos/ash/components/string_matching/acronym_matcher.h +++ b/chromeos/ash/components/string_matching/acronym_matcher.h
@@ -6,7 +6,9 @@ #define CHROMEOS_ASH_COMPONENTS_STRING_MATCHING_ACRONYM_MATCHER_H_ #include <string> + #include "chromeos/ash/components/string_matching/tokenized_string.h" +#include "ui/gfx/range/range.h" namespace ash::string_matching { @@ -28,6 +30,8 @@ // and "abdc" are not. class AcronymMatcher { public: + typedef std::vector<gfx::Range> Hits; + AcronymMatcher(const TokenizedString& query, const TokenizedString& text); ~AcronymMatcher(); @@ -38,9 +42,21 @@ // and returns true. Otherwise, returns false to indicate no match. double CalculateRelevance(); + // Return the hits match of the AcronymMatcher. E.g., + // For query: "coc" and text: "Crash Of Crowns". + // The hit would be {{0,1}, {6,7}, {9,10}} as the query is matched at position + // 0, 6 and 9, i.e., "[C]rash [O]f [C]rowns". + // + // N.B. This function is not expected to be called before the function + // `CalculateRelevance()`. + const Hits& hits() const { return hits_; } + private: std::u16string query_; std::u16string text_acronym_; + Hits text_mapping_; + + Hits hits_; }; } // namespace ash::string_matching
diff --git a/chromeos/ash/components/string_matching/acronym_matcher_unittest.cc b/chromeos/ash/components/string_matching/acronym_matcher_unittest.cc index 7a49953..34a8b5d 100644 --- a/chromeos/ash/components/string_matching/acronym_matcher_unittest.cc +++ b/chromeos/ash/components/string_matching/acronym_matcher_unittest.cc
@@ -4,6 +4,7 @@ #include "chromeos/ash/components/string_matching/acronym_matcher.h" +#include "base/containers/adapters.h" #include "chromeos/ash/components/string_matching/tokenized_string.h" #include "testing/gtest/include/gtest/gtest.h" @@ -17,6 +18,21 @@ constexpr double kAbsError = 1e-5; +// Returns a string of |text| marked with the hits in |match| using block +// bracket. e.g. text= "Text", match.hits = [{0,1}], returns "[T]ext". +std::u16string MatchHit(const std::u16string& text, + const AcronymMatcher& match) { + std::u16string marked = text; + + const AcronymMatcher::Hits& hits = match.hits(); + for (const gfx::Range& hit : base::Reversed(hits)) { + marked.insert(hit.end(), 1, u']'); + marked.insert(hit.start(), 1, u'['); + } + + return marked; +} + } // namespace class AcronymMatcherTest : public testing::Test {}; @@ -35,27 +51,27 @@ TokenizedString query(u"abc"); TokenizedString text(u"axx bxx cxx dxx exx"); - AcronymMatcher pm(query, text); + AcronymMatcher am(query, text); double expected_score = kIsPrefixCharScore + (kIsFrontOfTokenCharScore * 2); - EXPECT_NEAR(pm.CalculateRelevance(), expected_score, kAbsError); + EXPECT_NEAR(am.CalculateRelevance(), expected_score, kAbsError); } TEST_F(AcronymMatcherTest, ConsecutiveTokensWithNonFirstTokenMatch) { TokenizedString query(u"bcd"); TokenizedString text(u"axx bxx cxx dxx exx"); - AcronymMatcher pm(query, text); + AcronymMatcher am(query, text); double expected_score = kIsFrontOfTokenCharScore * 3; - EXPECT_NEAR(pm.CalculateRelevance(), expected_score, kAbsError); + EXPECT_NEAR(am.CalculateRelevance(), expected_score, kAbsError); } TEST_F(AcronymMatcherTest, CaseInsensitive) { TokenizedString query(u"bCd"); TokenizedString text(u"axx Bxx cxx Dxx exx"); - AcronymMatcher pm(query, text); + AcronymMatcher am(query, text); double expected_score = kIsFrontOfTokenCharScore * 3; - EXPECT_NEAR(pm.CalculateRelevance(), expected_score, kAbsError); + EXPECT_NEAR(am.CalculateRelevance(), expected_score, kAbsError); } // PrefixMatcher matches the chars of a given query as prefix of tokens in @@ -65,18 +81,39 @@ TokenizedString query(u"abc def"); TokenizedString text(u"abc def ghi"); - AcronymMatcher pm(query, text); + AcronymMatcher am(query, text); double expected_score = kNoMatchScore; - EXPECT_NEAR(pm.CalculateRelevance(), expected_score, kAbsError); + EXPECT_NEAR(am.CalculateRelevance(), expected_score, kAbsError); } TEST_F(AcronymMatcherTest, MixedAcronymAndPrefixMatchingNotAllowed) { TokenizedString query(u"adefg"); TokenizedString text(u"abc def ghi"); - AcronymMatcher pm(query, text); + AcronymMatcher am(query, text); double expected_score = kNoMatchScore; - EXPECT_NEAR(pm.CalculateRelevance(), expected_score, kAbsError); + EXPECT_NEAR(am.CalculateRelevance(), expected_score, kAbsError); +} + +TEST_F(AcronymMatcherTest, MatchHit) { + struct { + const std::u16string text; + const std::u16string query; + const std::u16string expect; + } kTestCases[] = { + {u"Crash of Crowns", u"coc", u"[C]rash [o]f [C]rowns"}, + {u"Crash of Crowns", u"cra", u"Crash of Crowns"}, + {u"abcxxx bxxx cxxx", u"abc", u"[a]bcxxx [b]xxx [c]xxx"}, + }; + + for (auto& test_case : kTestCases) { + const TokenizedString query(test_case.query); + const TokenizedString text(test_case.text); + + AcronymMatcher am(query, text); + am.CalculateRelevance(); + EXPECT_EQ(test_case.expect, MatchHit(test_case.text, am)); + } } } // namespace ash::string_matching
diff --git a/chromeos/ash/components/string_matching/fuzzy_tokenized_string_match.cc b/chromeos/ash/components/string_matching/fuzzy_tokenized_string_match.cc index 6ef6fb0..e4ea67e 100644 --- a/chromeos/ash/components/string_matching/fuzzy_tokenized_string_match.cc +++ b/chromeos/ash/components/string_matching/fuzzy_tokenized_string_match.cc
@@ -170,7 +170,8 @@ std::vector<double> weighted_ratios; weighted_ratios.emplace_back( - SequenceMatcher(query_normalized, text_normalized).Ratio()); + SequenceMatcher(query_normalized, text_normalized) + .Ratio(/*use_text_length_agnosticism=*/true)); const double length_ratio = static_cast<double>( @@ -274,11 +275,11 @@ } relevances.emplace_back(prefix_score); - relevances.emplace_back(use_weighted_ratio - ? WeightedRatio(query, text) - : SequenceMatcher(base::i18n::ToLower(query_text), - base::i18n::ToLower(text_text)) - .Ratio()); + relevances.emplace_back( + use_weighted_ratio ? WeightedRatio(query, text) + : SequenceMatcher(base::i18n::ToLower(query_text), + base::i18n::ToLower(text_text)) + .Ratio(/*use_text_length_agnosticism=*/true)); if (use_acronym_matcher) { relevances.emplace_back(AcronymMatcher(query, text)); }
diff --git a/chromeos/ash/components/string_matching/fuzzy_tokenized_string_match_unittest.cc b/chromeos/ash/components/string_matching/fuzzy_tokenized_string_match_unittest.cc index 30ffe4d..c2781f82 100644 --- a/chromeos/ash/components/string_matching/fuzzy_tokenized_string_match_unittest.cc +++ b/chromeos/ash/components/string_matching/fuzzy_tokenized_string_match_unittest.cc
@@ -262,7 +262,7 @@ TEST_F(FuzzyTokenizedStringMatchTest, BenchmarkVariedLengthUnmatchedTextSingleToken) { std::u16string full_text = u"abcdefghijklmnop"; - const size_t shortest_text_length = 6; + const size_t shortest_text_length = 9; const size_t longest_text_length = full_text.size(); std::vector<std::u16string> queries = {u"abc", u"bcd", u"cde", u"def"}; @@ -272,13 +272,15 @@ // text, the relevance score should not be influenced by the // amounts of any remaining unmatched portions of text ("text-length // agnosticism"). + std::vector<double> scores; for (size_t i = shortest_text_length; i < longest_text_length; ++i) { std::u16string text = full_text.substr(0, i); const double relevance = CalculateRelevance(query, text); + scores.push_back(relevance); VLOG(1) << FormatRelevanceResult(query, text, relevance, /*query_first*/ true); } - // TODO(crbug.com/1336160): Enforce/check text-length agnosticism. + ExpectAllNearlyEqual(scores); } } @@ -300,12 +302,14 @@ // text, the relevance score should not be influenced by the // amounts of any remaining unmatched portions of text ("text-length // agnosticism"). + std::vector<double> scores; for (const auto& text : texts) { const double relevance = CalculateRelevance(query, text); VLOG(1) << FormatRelevanceResult(query, text, relevance, /*query_first*/ true); + scores.push_back(relevance); } - // TODO(crbug.com/1336160): Enforce/check text-length agnosticism. + ExpectAllNearlyEqual(scores); } } @@ -422,11 +426,6 @@ } ExpectAllNearlyEqual(scores_query_two_tokens, /*abs_error*/ 0.1); - // TODO(crbug.com/1336160): Support text-length agnosticism, whereby - // non-matched text tokens have no (or less of) an adverse effect on scoring. - // Maybe add some score comparisons between `scores_query_single_token` and - // `scores_query_two_tokens`. - // TODO(crbug.com/1336160): [Later] Consider a score boost for when a matched // token is the first token of both text and query. } @@ -1162,16 +1161,19 @@ } } -// TODO(crbug.com/1327090): Reduce/remove penalties for unmatched text. TEST_F(FuzzyTokenizedStringMatchTest, BenchmarkKeyboardShortcutsEmojiPicker) { std::u16string text = u"Open Emoji picker"; std::vector<std::u16string> queries = {u"emoj", u"emoji", u"emoji ", u"emoji p", u"emoji pi"}; + std::vector<double> scores; for (const auto& query : queries) { const double relevance = CalculateRelevance(query, text); VLOG(1) << FormatRelevanceResult(query, text, relevance, /*query_first*/ false); + scores.push_back(relevance); } + ExpectMostlyIncreasing(scores, /*epsilon=*/0.001); + ExpectAllNearlyEqualTo(scores, 0.9, /*abs_error=*/0.1); } TEST_F(FuzzyTokenizedStringMatchTest, @@ -1189,17 +1191,19 @@ ExpectAllNearlyEqual(scores); } -// TODO(crbug.com/1336160): Introduce some kind of agnosticism to text length. TEST_F(FuzzyTokenizedStringMatchTest, BenchmarkSettingsPreferences) { std::u16string query = u"preferences"; std::vector<std::u16string> texts = { u"Android preferences", u"Caption preferences", u"System preferences", u"External storage preferences"}; + std::vector<double> scores; for (const auto& text : texts) { const double relevance = CalculateRelevance(query, text); + scores.push_back(relevance); VLOG(1) << FormatRelevanceResult(query, text, relevance, /*query_first*/ true); } + ExpectAllNearlyEqual(scores); } /********************************************************************** @@ -1325,7 +1329,7 @@ u"this sentence is much much much much much longer " u"than the text before"); EXPECT_NEAR( - match.WeightedRatio(TokenizedString(query), TokenizedString(text)), 0.5, + match.WeightedRatio(TokenizedString(query), TokenizedString(text)), 0.6, 0.1); } } @@ -1460,7 +1464,7 @@ std::u16string text(u"ClashOfTitan"); EXPECT_LT( match.Relevance(TokenizedString(query), TokenizedString(text), true), - 0.75); + 0.77); } }
diff --git a/chromeos/ash/components/string_matching/sequence_matcher.cc b/chromeos/ash/components/string_matching/sequence_matcher.cc index a1bc30bc..bff7baed 100644 --- a/chromeos/ash/components/string_matching/sequence_matcher.cc +++ b/chromeos/ash/components/string_matching/sequence_matcher.cc
@@ -17,6 +17,9 @@ using Match = SequenceMatcher::Match; using Matches = std::vector<Match>; +// The maximum recognized text size if text-length agnosticism is applied. +constexpr int kTextAgnosticismSize = 9; + bool CompareMatches(const Match& m1, const Match& m2) { return m1.pos_first_string < m2.pos_first_string; } @@ -220,7 +223,7 @@ return edit_distance_; } -double SequenceMatcher::Ratio() { +double SequenceMatcher::Ratio(bool use_text_length_agnosticism) { if (use_edit_distance_) { if (edit_distance_ratio_ < 0) { const int edit_distance = EditDistance(); @@ -234,7 +237,22 @@ // Uses block matching to calculate ratio. if (block_matching_ratio_ < 0) { int sum_match = 0; - const int sum_length = first_string_.size() + second_string_.size(); + const int query_size = first_string_.size(); + const int text_size = second_string_.size(); + + int sum_length = query_size; + // Text-length agnosticism is applied for long texts if + // `use_text_length_agnosticism` is true, but we still keep it not shorter + // than the query length. Text length agnosticism is ignored if we have a + // longer query than the text. + if (use_text_length_agnosticism && query_size < text_size) { + int max_recognized_text_length = + std::max(kTextAgnosticismSize, query_size); + sum_length += std::min(text_size, max_recognized_text_length); + } else { + sum_length += text_size; + } + DCHECK_NE(sum_length, 0); const int num_blocks = GetMatchingBlocks().size(); for (const auto& match : GetMatchingBlocks()) {
diff --git a/chromeos/ash/components/string_matching/sequence_matcher.h b/chromeos/ash/components/string_matching/sequence_matcher.h index 5de84139..43c8d493 100644 --- a/chromeos/ash/components/string_matching/sequence_matcher.h +++ b/chromeos/ash/components/string_matching/sequence_matcher.h
@@ -15,6 +15,7 @@ constexpr double kNumMatchingBlocksPenalty = 0.1; constexpr bool kUseEditDistance = false; +constexpr bool kUseTextLengthAgnosticism = false; } // namespace @@ -45,7 +46,7 @@ // blocks. For the same number of matching characters, we prefer fewer // matching blocks. Value equal to 0 means no penalty. Values greater than 0 // means heavier penalty will be applied to larger number of blocks. This is - // only appled if `use_edit_distance` is false. + // only applied if `use_edit_distance` is false. SequenceMatcher( const std::u16string& first_string, const std::u16string& second_string, @@ -58,7 +59,18 @@ ~SequenceMatcher(); // Calculates similarity ratio of `first_string_` and `second_string_`. - double Ratio(); + // + // In the actual string matching in launcher searches, we will input with the + // query as `first_string_` and the text as `second_string_`. As the query is + // likely to be shorter than the text in most cases, we would like to + // ignore/lower the influence of the amounts of any remaining unmatched + // portions of the `second_string_` onto the ratio (i.e., "text-length + // agnosticism"). + // + // Thus, We will trim the text length if it is too long and + // `use_text_length_agnosticism` is true, and it only works for the block + // matching algorithm. + double Ratio(bool use_text_length_agnosticism = kUseTextLengthAgnosticism); // Calculates the Damerau–Levenshtein restricted edit distance between // `first_string_` and `second_string_`. Also known as the "optimal string // alignment distance".
diff --git a/chromeos/ash/components/string_matching/sequence_matcher_unittest.cc b/chromeos/ash/components/string_matching/sequence_matcher_unittest.cc index b4a4be6..c6addc3 100644 --- a/chromeos/ash/components/string_matching/sequence_matcher_unittest.cc +++ b/chromeos/ash/components/string_matching/sequence_matcher_unittest.cc
@@ -143,6 +143,25 @@ 0.0, 0.001); } +TEST_F(SequenceMatcherTest, TestSequenceMatcherRatioWithTextLengthAgnosticism) { + // Two matching blocks, total matching blocks length is 4. + EXPECT_NEAR( + SequenceMatcher(u"word", u"hello world", 0.0, kDefaultUseEditDistance) + .Ratio(/*use_text_length_agnosticism=*/true), + 0.615, 0.001); + + // One matching block, length is 4. + EXPECT_NEAR( + SequenceMatcher(u"worl", u"hello world", 0.0, kDefaultUseEditDistance) + .Ratio(/*use_text_length_agnosticism=*/true), + 0.615, 0.001); + + // No matching block at all. + EXPECT_NEAR( + SequenceMatcher(u"abcd", u"xyz", 0.0, kDefaultUseEditDistance).Ratio(), + 0.0, 0.001); +} + TEST_F(SequenceMatcherTest, TestEditDistanceRatio) { ASSERT_EQ(SequenceMatcher(u"abcd", u"adbc", 0.0, true).Ratio(), 0.5); EXPECT_NEAR(SequenceMatcher(u"white cats", u"cats white", 0.0, true).Ratio(),
diff --git a/chromeos/services/network_health/BUILD.gn b/chromeos/services/network_health/BUILD.gn index a934c8f..a58eb34 100644 --- a/chromeos/services/network_health/BUILD.gn +++ b/chromeos/services/network_health/BUILD.gn
@@ -57,6 +57,7 @@ "//chromeos/services/network_config/public/cpp", "//chromeos/services/network_config/public/cpp:test_support", "//chromeos/services/network_config/public/mojom", + "//chromeos/services/network_health/public/cpp:unit_tests", "//chromeos/services/network_health/public/mojom", "//dbus", "//mojo/public/cpp/bindings",
diff --git a/chromeos/services/network_health/network_health_service.cc b/chromeos/services/network_health/network_health_service.cc index a6d0c9bd..44d0025 100644 --- a/chromeos/services/network_health/network_health_service.cc +++ b/chromeos/services/network_health/network_health_service.cc
@@ -93,6 +93,28 @@ return net; } +// Compares everything except strength properties which are observed only on +// a per-network basis. +bool NetworksMatch(const mojom::NetworkPtr& a, const mojom::NetworkPtr& b) { + return a->state == b->state && a->guid == b->guid && a->name == b->name && + a->mac_address == b->mac_address && + a->ipv4_address == b->ipv4_address && + a->ipv6_addresses == b->ipv6_addresses && + a->portal_state == b->portal_state && + a->portal_probe_url == b->portal_probe_url; +} + +bool NetworkListsMatch(const std::vector<mojom::NetworkPtr>& networks_a, + const std::vector<mojom::NetworkPtr>& networks_b) { + if (networks_a.size() != networks_b.size()) + return false; + for (std::size_t i = 0u; i < networks_a.size(); ++i) { + if (!NetworksMatch(networks_a[i], networks_b[i])) + return false; + } + return true; +} + } // namespace NetworkHealthService::NetworkHealthService() { @@ -207,6 +229,9 @@ if (device_properties_.empty()) return; + std::vector<mojom::NetworkPtr> prev_networks = + mojo::Clone(network_health_state_.networks); + network_health_state_.networks.clear(); std::map<network_config::mojom::NetworkType, @@ -248,6 +273,9 @@ } UpdateTrackedGuids(); + + if (!NetworkListsMatch(prev_networks, network_health_state_.networks)) + NotifyObserversNetworkListChanged(); } void NetworkHealthService::RefreshNetworkHealthState() { @@ -343,6 +371,12 @@ } } +void NetworkHealthService::NotifyObserversNetworkListChanged() { + for (auto& observer : observers_) { + observer->OnNetworkListChanged(mojo::Clone(network_health_state_.networks)); + } +} + bool NetworkHealthService::ConnectionStateChanged( const mojom::NetworkPtr& network, const network_config::mojom::NetworkStatePropertiesPtr& network_state) {
diff --git a/chromeos/services/network_health/network_health_service.h b/chromeos/services/network_health/network_health_service.h index 518a9ab..e8222a0 100644 --- a/chromeos/services/network_health/network_health_service.h +++ b/chromeos/services/network_health/network_health_service.h
@@ -101,13 +101,11 @@ void HandleNetworkEventsForInactiveNetworks( network_config::mojom::NetworkStatePropertiesPtr network); - // Notifies observers of connection state changes. void NotifyObserversConnectionStateChanged(const std::string& guid, mojom::NetworkState state); - - // Notifies observers of signal strength changes. void NotifyObserversSignalStrengthChanged(const std::string& guid, int signal_strength); + void NotifyObserversNetworkListChanged(); // Checks if a connection state changed has occurred. bool ConnectionStateChanged(
diff --git a/chromeos/services/network_health/network_health_service_unittest.cc b/chromeos/services/network_health/network_health_service_unittest.cc index a4200f1..61f4c9b 100644 --- a/chromeos/services/network_health/network_health_service_unittest.cc +++ b/chromeos/services/network_health/network_health_service_unittest.cc
@@ -37,20 +37,21 @@ constexpr char kWifiDevicePath[] = "/device/wifi1"; constexpr char kWifiName[] = "wifi_device1"; -class FakeNetworkEventsObserver - : public network_health::mojom::NetworkEventsObserver { +class FakeNetworkEventsObserver : public mojom::NetworkEventsObserver { public: // network_health::mojom::NetworkEventsObserver: - void OnConnectionStateChanged( - const std::string& guid, - network_health::mojom::NetworkState state) override { + void OnConnectionStateChanged(const std::string& guid, + mojom::NetworkState state) override { connection_state_changed_event_received_ = true; } - void OnSignalStrengthChanged( - const std::string& guid, - network_health::mojom::UInt32ValuePtr signal_strength) override { + void OnSignalStrengthChanged(const std::string& guid, + mojom::UInt32ValuePtr signal_strength) override { signal_strength_changed_event_received_ = true; } + void OnNetworkListChanged( + const std::vector<mojom::NetworkPtr> networks) override { + network_list_changed_event_received_ = true; + } mojo::PendingRemote<network_health::mojom::NetworkEventsObserver> pending_remote() { @@ -65,6 +66,10 @@ return signal_strength_changed_event_received_; } + bool network_list_changed_event_received() { + return network_list_changed_event_received_; + } + void reset_connection_state_changed_event_received() { connection_state_changed_event_received_ = false; } @@ -77,6 +82,7 @@ mojo::Receiver<network_health::mojom::NetworkEventsObserver> receiver_{this}; bool connection_state_changed_event_received_ = false; bool signal_strength_changed_event_received_ = false; + bool network_list_changed_event_received_ = false; }; } // namespace @@ -614,4 +620,24 @@ ASSERT_EQ(2u, network_health_.GetTrackedGuidsForTest().size()); } +TEST_F(NetworkHealthServiceTest, NetworkListChangeEvent) { + FakeNetworkEventsObserver fake_network_events_observer; + network_health_.AddObserver(fake_network_events_observer.pending_remote()); + + EXPECT_FALSE( + fake_network_events_observer.network_list_changed_event_received()); + + // Create a WiFi device and service. + CreateDefaultWifiDevice(); + cros_network_config_test_helper_.network_state_helper() + .service_test() + ->AddService(kWifiServicePath, kWifiGuid, kWifiServiceName, + shill::kTypeWifi, shill::kStateOnline, true); + task_environment_.RunUntilIdle(); + + // A network list changed event should have fired. + EXPECT_TRUE( + fake_network_events_observer.network_list_changed_event_received()); +} + } // namespace chromeos::network_health
diff --git a/chromeos/services/network_health/public/cpp/BUILD.gn b/chromeos/services/network_health/public/cpp/BUILD.gn new file mode 100644 index 0000000..c53b7c58 --- /dev/null +++ b/chromeos/services/network_health/public/cpp/BUILD.gn
@@ -0,0 +1,33 @@ +# Copyright 2022 The Chromium Authors +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +assert(is_chromeos, "Non-ChromeOS builds cannot depend on //chromeos") + +import("//build/config/chromeos/ui_mode.gni") + +source_set("cpp") { + sources = [ + "network_health_helper.cc", + "network_health_helper.h", + ] + + deps = [ + "//chromeos/services/network_health", + "//chromeos/services/network_health:in_process_instance", + "//chromeos/services/network_health/public/mojom", + ] +} + +source_set("unit_tests") { + testonly = true + sources = [ "network_health_helper_unittest.cc" ] + deps = [ + ":cpp", + "//base/test:test_support", + "//chromeos/services/network_config/public/cpp:test_support", + "//chromeos/services/network_health", + "//chromeos/services/network_health/public/mojom", + "//testing/gtest", + ] +}
diff --git a/chromeos/services/network_health/public/cpp/network_health_helper.cc b/chromeos/services/network_health/public/cpp/network_health_helper.cc new file mode 100644 index 0000000..f1745514 --- /dev/null +++ b/chromeos/services/network_health/public/cpp/network_health_helper.cc
@@ -0,0 +1,129 @@ +// Copyright 2022 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "chromeos/services/network_health/public/cpp/network_health_helper.h" + +#include <utility> + +#include "base/bind.h" +#include "base/callback.h" +#include "base/logging.h" +#include "base/memory/ptr_util.h" +#include "build/chromeos_buildflags.h" +#include "chromeos/services/network_health/in_process_instance.h" +#include "chromeos/services/network_health/network_health_service.h" +#include "url/gurl.h" + +namespace chromeos::network_health { + +// static +std::unique_ptr<NetworkHealthHelper> NetworkHealthHelper::CreateForTesting( + NetworkHealthService* network_health_service) { + // Use WrapUnique for private constructor. + return base::WrapUnique(new NetworkHealthHelper(network_health_service)); +} + +NetworkHealthHelper::NetworkHealthHelper( + NetworkHealthService* network_health_service) { + SetupRemote(network_health_service); + RequestNetworks(); +} + +NetworkHealthHelper::NetworkHealthHelper() { + RequestNetworks(); +} + +NetworkHealthHelper::~NetworkHealthHelper() = default; + +void NetworkHealthHelper::OnConnectionStateChanged(const std::string& guid, + mojom::NetworkState state) { + if (default_network_ && default_network_->guid == guid) + default_network_->state = state; +} + +void NetworkHealthHelper::OnSignalStrengthChanged( + const std::string& /*guid*/, + mojom::UInt32ValuePtr /*signal_strength*/) {} + +void NetworkHealthHelper::OnNetworkListChanged( + std::vector<mojom::NetworkPtr> networks) { + NetworkListReceived(std::move(networks)); +} + +mojom::NetworkHealthService* NetworkHealthHelper::GetNetworkHealthService() { + if (!remote_) { + SetupRemote(GetInProcessInstance()); + } + return remote_.get(); +} + +void NetworkHealthHelper::SetupRemote( + NetworkHealthService* network_health_service) { + auto receiver = remote_.BindNewPipeAndPassReceiver(); + network_health_service->BindReceiver(std::move(receiver)); + if (!observer_receiver_.is_bound()) { + remote_->AddObserver(observer_receiver_.BindNewPipeAndPassRemote()); + observer_receiver_.set_disconnect_handler(base::BindOnce( + &NetworkHealthHelper::OnMojoError, base::Unretained(this))); + } +} + +void NetworkHealthHelper::RequestNetworks() { + auto* remote = GetNetworkHealthService(); + if (!remote) { + NetworkListReceived({}); + return; + } + remote->GetNetworkList(base::BindOnce( + &NetworkHealthHelper::NetworkListReceived, base::Unretained(this))); +} + +void NetworkHealthHelper::RequestDefaultNetwork( + base::OnceCallback<void(mojom::NetworkPtr&)> callback) { + if (networks_received_) { + std::move(callback).Run(default_network_); + } else { + received_networks_callbacks_.push_back(std::move(callback)); + } +} + +void NetworkHealthHelper::RequestIsPortalState( + base::OnceCallback<void(bool)> callback) { + RequestDefaultNetwork(base::BindOnce( + [](base::OnceCallback<void(bool)> callback, + mojom::NetworkPtr& default_network) { + if (!default_network) { + std::move(callback).Run(false); + return; + } + using PortalState = chromeos::network_config::mojom::PortalState; + auto portal_state = default_network->portal_state; + bool is_portal_state = portal_state == PortalState::kPortal || + portal_state == PortalState::kPortalSuspected || + portal_state == PortalState::kProxyAuthRequired; + std::move(callback).Run(is_portal_state); + }, + std::move(callback))); +} + +void NetworkHealthHelper::NetworkListReceived( + std::vector<mojom::NetworkPtr> networks) { + if (networks.size()) { + default_network_ = networks[0].Clone(); + } else { + default_network_ = nullptr; + } + for (auto& cb : received_networks_callbacks_) { + std::move(cb).Run(default_network_); + } + received_networks_callbacks_.clear(); + networks_received_ = true; +} + +void NetworkHealthHelper::OnMojoError() { + remote_.reset(); + observer_receiver_.reset(); +} + +} // namespace chromeos::network_health
diff --git a/chromeos/services/network_health/public/cpp/network_health_helper.h b/chromeos/services/network_health/public/cpp/network_health_helper.h new file mode 100644 index 0000000..3826bf5 --- /dev/null +++ b/chromeos/services/network_health/public/cpp/network_health_helper.h
@@ -0,0 +1,69 @@ +// Copyright 2022 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef CHROMEOS_SERVICES_NETWORK_HEALTH_PUBLIC_CPP_NETWORK_HEALTH_HELPER_H_ +#define CHROMEOS_SERVICES_NETWORK_HEALTH_PUBLIC_CPP_NETWORK_HEALTH_HELPER_H_ + +#include <memory> +#include <string> +#include <vector> + +#include "base/callback.h" +#include "chromeos/services/network_health/public/mojom/network_health.mojom.h" +#include "mojo/public/cpp/bindings/receiver.h" +#include "mojo/public/cpp/bindings/remote.h" + +namespace chromeos::network_health { + +class NetworkHealthService; + +// Helper class intended to run in either the Ash or Lacros process for +// accessing properties from the chromeos.network_health API. +// TODO(b/247618374): Lacros implementation. +class NetworkHealthHelper : public mojom::NetworkEventsObserver { + public: + NetworkHealthHelper(); + NetworkHealthHelper(const NetworkHealthHelper&) = delete; + NetworkHealthHelper& operator=(const NetworkHealthHelper&) = delete; + ~NetworkHealthHelper() override; + + // Asynchronous getters. If a cached result is available, |callback| will be + // invoked immediately. Otherwise the properties will be requested and + // |callback| will be invoked when they are available. + void RequestDefaultNetwork( + base::OnceCallback<void(mojom::NetworkPtr&)> callback); + void RequestIsPortalState(base::OnceCallback<void(bool)> callback); + + // ash::network_health::mojom::NetworkEventsObserver: + void OnConnectionStateChanged(const std::string& guid, + mojom::NetworkState state) override; + void OnSignalStrengthChanged(const std::string& guid, + mojom::UInt32ValuePtr signal_strength) override; + void OnNetworkListChanged(std::vector<mojom::NetworkPtr> networks) override; + + static std::unique_ptr<NetworkHealthHelper> CreateForTesting( + NetworkHealthService* network_health_service); + + private: + // Private constructor for tests to override the NetworkHealthService. + explicit NetworkHealthHelper(NetworkHealthService* network_health_service); + + mojom::NetworkHealthService* GetNetworkHealthService(); + void SetupRemote(NetworkHealthService* network_health_service); + void RequestNetworks(); + void NetworkListReceived(std::vector<mojom::NetworkPtr> networks); + void OnMojoError(); + + mojo::Remote<mojom::NetworkHealthService> remote_; + mojo::Receiver<mojom::NetworkEventsObserver> observer_receiver_{this}; + + mojom::NetworkPtr default_network_; + bool networks_received_ = false; + std::vector<base::OnceCallback<void(mojom::NetworkPtr&)>> + received_networks_callbacks_; +}; + +} // namespace chromeos::network_health + +#endif // CHROMEOS_SERVICES_NETWORK_HEALTH_PUBLIC_CPP_NETWORK_HEALTH_HELPER_H_
diff --git a/chromeos/services/network_health/public/cpp/network_health_helper_unittest.cc b/chromeos/services/network_health/public/cpp/network_health_helper_unittest.cc new file mode 100644 index 0000000..3f9a9c2 --- /dev/null +++ b/chromeos/services/network_health/public/cpp/network_health_helper_unittest.cc
@@ -0,0 +1,120 @@ +// Copyright 2022 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "chromeos/services/network_health/public/cpp/network_health_helper.h" + +#include <memory> + +#include "base/bind.h" +#include "base/callback_helpers.h" +#include "base/run_loop.h" +#include "base/test/bind.h" +#include "base/test/task_environment.h" +#include "chromeos/services/network_config/public/cpp/cros_network_config_test_helper.h" +#include "chromeos/services/network_health/network_health_service.h" +#include "testing/gtest/include/gtest/gtest.h" +#include "third_party/cros_system_api/dbus/shill/dbus-constants.h" + +namespace chromeos::network_health { + +class NetworkHealthHelperTest : public ::testing::Test { + public: + NetworkHealthHelperTest() = default; + NetworkHealthHelperTest(const NetworkHealthHelperTest&) = delete; + NetworkHealthHelperTest& operator=(const NetworkHealthHelperTest&) = delete; + ~NetworkHealthHelperTest() override = default; + + void SetUp() override { + cros_network_config_test_helper_ = + std::make_unique<network_config::CrosNetworkConfigTestHelper>(); + cros_network_config_test_helper_->network_state_helper() + .ResetDevicesAndServices(); + + network_health_service_ = std::make_unique<NetworkHealthService>(); + helper_ = + NetworkHealthHelper::CreateForTesting(network_health_service_.get()); + } + + void TearDown() override { + helper_.reset(); + network_health_service_.reset(); + cros_network_config_test_helper_.reset(); + } + + NetworkHealthHelper* helper() { return helper_.get(); } + + std::string SetupWiFiService(const std::string& state) { + return cros_network_config_test_helper_->network_state_helper() + .ConfigureWiFi(state); + } + + void SetWiFiState(const std::string& path, const std::string& state) { + return cros_network_config_test_helper_->network_state_helper() + .SetServiceProperty(path, shill::kStateProperty, base::Value(state)); + } + + // private: + base::test::TaskEnvironment task_environment_; + std::unique_ptr<network_config::CrosNetworkConfigTestHelper> + cros_network_config_test_helper_; + std::unique_ptr<NetworkHealthService> network_health_service_; + std::unique_ptr<NetworkHealthHelper> helper_; +}; + +TEST_F(NetworkHealthHelperTest, RequestDefaultNetworkNone) { + mojom::NetworkPtr result_ptr; + base::RunLoop run_loop; + helper()->RequestDefaultNetwork( + base::BindLambdaForTesting([&](mojom::NetworkPtr& default_network) { + result_ptr = default_network.Clone(); + run_loop.Quit(); + })); + run_loop.Run(); + EXPECT_FALSE(result_ptr); +} + +TEST_F(NetworkHealthHelperTest, RequestDefaultNetworkOnline) { + SetupWiFiService(shill::kStateOnline); + + mojom::NetworkPtr result_ptr; + base::RunLoop run_loop; + helper()->RequestDefaultNetwork( + base::BindLambdaForTesting([&](mojom::NetworkPtr& default_network) { + result_ptr = default_network.Clone(); + run_loop.Quit(); + })); + run_loop.Run(); + ASSERT_TRUE(result_ptr); + EXPECT_EQ(result_ptr->state, mojom::NetworkState::kOnline); +} + +TEST_F(NetworkHealthHelperTest, RequestIsPortalState) { + std::string path = SetupWiFiService(shill::kStateOnline); + { + bool result; + base::RunLoop run_loop; + helper()->RequestIsPortalState( + base::BindLambdaForTesting([&](bool is_portal_state) { + result = is_portal_state; + run_loop.Quit(); + })); + run_loop.Run(); + EXPECT_FALSE(result); + } + + SetWiFiState(path, shill::kStateRedirectFound); + { + bool result; + base::RunLoop run_loop; + helper()->RequestIsPortalState( + base::BindLambdaForTesting([&](bool is_portal_state) { + result = is_portal_state; + run_loop.Quit(); + })); + run_loop.Run(); + EXPECT_TRUE(result); + } +} + +} // namespace chromeos::network_health
diff --git a/chromeos/services/network_health/public/mojom/network_health.mojom b/chromeos/services/network_health/public/mojom/network_health.mojom index 33dce77..51a4a4c 100644 --- a/chromeos/services/network_health/public/mojom/network_health.mojom +++ b/chromeos/services/network_health/public/mojom/network_health.mojom
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Next MinVersion: 4 +// Next MinVersion: 5 // API intended for retrieving a snapshot of the network health state. Returns // properties of any available network technologies and any connected or @@ -103,24 +103,32 @@ array<Network> networks; }; -// Implemented by clients who desire network notifications. An expected client -// is cros_healthd, which listens to the network events and in turn, sends them -// out to its clients. A network guid uniquely identifies a network. For more -// information, see the definition of "NetworkStateProperties" at +// Observer for events generated by the NetworkHealthService hosted by the +// Ash-Chrome browser process. Expected clients include the Ash-Chrome browser +// itself, the Lacros-Chrome browser, and the cros_healthd system service which +// provides telemetry data for additional clients (including Ash-Chrome). +// A network guid uniquely identifies a network. For more information, see the +// definition of "NetworkStateProperties" at // //chromeos/services/network_config/public/mojom/cros_network_config.mojom. -// Next Method ID: 2 +// Next Method ID: 3 [Stable] interface NetworkEventsObserver { // Fired when a network’s connection state changes. OnConnectionStateChanged@0(string guid, NetworkState state); + // Fired when a wireless network’s signal strength changes by ten or more // percent. See the definition of |signal_strength| under the "Network" // struct. OnSignalStrengthChanged@1(string guid, UInt32Value signal_strength); + + // Fired when the list of networks changes. + [MinVersion=4] + OnNetworkListChanged@2(array<Network> networks); }; // Interface for retrieving aggregated information about the current network -// state and health from the browser process. +// state and health. This services is implemented in the Ash-Chrome browser +// process. // Next Method ID: 4 [Stable] interface NetworkHealthService {
diff --git a/components/cast_receiver/browser/BUILD.gn b/components/cast_receiver/browser/BUILD.gn index 3c13366..b2cd320a 100644 --- a/components/cast_receiver/browser/BUILD.gn +++ b/components/cast_receiver/browser/BUILD.gn
@@ -10,6 +10,7 @@ "//components/cast_receiver/common", "//components/cast_streaming/browser", "//components/media_control/browser", + "//components/url_rewrite/mojom", "//content/public/browser", ] public = [ @@ -47,6 +48,7 @@ "//components/cast_receiver/common", "//components/media_control/browser", "//components/on_load_script_injector/browser", + "//components/url_rewrite/browser", "//content", "//ui/base", ] @@ -55,7 +57,10 @@ "bindings_manager.h", "bindings_message_port_connector.cc", "bindings_message_port_connector.h", + "embedder_application.cc", + "public/embedder_application.h", "public/message_port_service.h", + "public/runtime_application_dispatcher.h", ] } }
diff --git a/components/cast_receiver/browser/DEPS b/components/cast_receiver/browser/DEPS index 6fb5a660..74737a1 100644 --- a/components/cast_receiver/browser/DEPS +++ b/components/cast_receiver/browser/DEPS
@@ -2,6 +2,7 @@ "+components/cast_streaming/browser/public", "+components/media_control/browser", "+components/on_load_script_injector/browser", + "+components/url_rewrite/mojom", "+content/public/browser", "+media", "+net/base",
diff --git a/components/cast_receiver/browser/embedder_application.cc b/components/cast_receiver/browser/embedder_application.cc new file mode 100644 index 0000000..2b856e7e --- /dev/null +++ b/components/cast_receiver/browser/embedder_application.cc
@@ -0,0 +1,29 @@ +// Copyright 2022 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "components/cast_receiver/browser/public/embedder_application.h" + +namespace cast_receiver { + +EmbedderApplication::~EmbedderApplication() = default; + +std::ostream& operator<<(std::ostream& os, + EmbedderApplication::ApplicationStopReason reason) { + switch (reason) { + case EmbedderApplication::ApplicationStopReason::kUndefined: + return os << "Undefined"; + case EmbedderApplication::ApplicationStopReason::kApplicationRequest: + return os << "Application Request"; + case EmbedderApplication::ApplicationStopReason::kIdleTimeout: + return os << "Idle Timeout"; + case EmbedderApplication::ApplicationStopReason::kUserRequest: + return os << "Use Request"; + case EmbedderApplication::ApplicationStopReason::kHttpError: + return os << "HTTP Error"; + case EmbedderApplication::ApplicationStopReason::kRuntimeError: + return os << "Runtime Error"; + } +} + +} // namespace cast_receiver
diff --git a/components/cast_receiver/browser/public/embedder_application.h b/components/cast_receiver/browser/public/embedder_application.h new file mode 100644 index 0000000..260d9bd --- /dev/null +++ b/components/cast_receiver/browser/public/embedder_application.h
@@ -0,0 +1,89 @@ +// Copyright 2022 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef COMPONENTS_CAST_RECEIVER_BROWSER_PUBLIC_EMBEDDER_APPLICATION_H_ +#define COMPONENTS_CAST_RECEIVER_BROWSER_PUBLIC_EMBEDDER_APPLICATION_H_ + +#include <memory> +#include <ostream> +#include <string> +#include <vector> + +#include "base/callback.h" +#include "components/cast_receiver/browser/public/runtime_application.h" + +namespace content { +class WebContents; +class WebUIControllerFactory; +} // namespace content + +namespace cast_receiver { + +class ContentWindowControls; +class MessagePortService; +class StreamingConfigManager; + +// This class defines an interface to be implemented by embedders in order to +// allow a RuntimeApplication to interface with the embedder-specific details. +class EmbedderApplication { + public: + enum class ApplicationStopReason { + kUndefined = 0, + kApplicationRequest, + kIdleTimeout, + kUserRequest, + kHttpError, + kRuntimeError + }; + + virtual ~EmbedderApplication(); + + // Notifies the Cast agent that application has started. + virtual void NotifyApplicationStarted() = 0; + + // Notifies the Cast agent that application has stopped. + virtual void NotifyApplicationStopped(ApplicationStopReason stop_reason, + int32_t net_error_code) = 0; + + // Notifies the Cast agent about media playback state changed. + virtual void NotifyMediaPlaybackChanged(bool playing) = 0; + + // Fetches all bindings asynchronously, calling |callback| with the results + // of this call once it returns. + using GetAllBindingsCallback = + base::OnceCallback<void(cast_receiver::Status, std::vector<std::string>)>; + virtual void GetAllBindings(GetAllBindingsCallback callback) = 0; + + // Gets the platform-specific MessagePortService instance for this + // application, if such an instance exists. + virtual MessagePortService* GetMessagePortService() = 0; + + // Creates a new platform-specific WebUIControllerFactory. + virtual std::unique_ptr<content::WebUIControllerFactory> + CreateWebUIControllerFactory(std::vector<std::string> hosts) = 0; + + // Returns the WebContents this application should use. + // + // TODO(crbug.com/1382907): Change to a callback-based API. + virtual content::WebContents* GetWebContents() = 0; + + // Returns the window controls for this instance. + // + // TODO(crbug.com/1382907): Change to a callback-based API. + virtual ContentWindowControls* GetContentWindowControls() = 0; + + virtual StreamingConfigManager* GetStreamingConfigManager() = 0; + + // Loads |url| in the associated WebContents. + // + // TODO(crbug.com/1383332): Remove this function. + virtual void LoadPage(const GURL& url) = 0; +}; + +std::ostream& operator<<(std::ostream& os, + EmbedderApplication::ApplicationStopReason reason); + +} // namespace cast_receiver + +#endif // COMPONENTS_CAST_RECEIVER_BROWSER_PUBLIC_EMBEDDER_APPLICATION_H_
diff --git a/components/cast_receiver/browser/public/runtime_application.h b/components/cast_receiver/browser/public/runtime_application.h index 2f29b91..fb92a84d 100644 --- a/components/cast_receiver/browser/public/runtime_application.h +++ b/components/cast_receiver/browser/public/runtime_application.h
@@ -10,6 +10,7 @@ #include "base/callback.h" #include "components/cast_receiver/common/public/status.h" +#include "components/url_rewrite/mojom/url_request_rewrite.mojom.h" namespace cast_receiver { @@ -35,6 +36,33 @@ // Returns whether this application is currently running. virtual bool IsApplicationRunning() const = 0; + + // Called before Launch() to perform any pre-launch loading that is + // necessary. The |callback| will be called indicating if the operation + // succeeded or not. If Load fails, |this| should be destroyed since it's + // not necessarily valid to retry Load with a new request. + virtual void Load(StatusCallback callback) = 0; + + // Called to launch the application. The |callback| will be called + // indicating if the operation succeeded or not. + virtual void Launch(StatusCallback callback) = 0; + + // Called to stop the application. The |callback| will be called indicating + // if the operation succeeded or not. + virtual void Stop(StatusCallback callback) = 0; + + // Sets URL rewrite rules. + virtual void SetUrlRewriteRules( + url_rewrite::mojom::UrlRequestRewriteRulesPtr mojom_rules) = 0; + + // Sets media playback state. + virtual void SetMediaBlocking(bool load_blocked, bool start_blocked) = 0; + + // Sets visibility state. + virtual void SetVisibility(bool is_visible) = 0; + + // Sets touch input. + virtual void SetTouchInputEnabled(bool enabled) = 0; }; std::ostream& operator<<(std::ostream& os, const RuntimeApplication& app);
diff --git a/components/cast_receiver/browser/public/runtime_application_dispatcher.h b/components/cast_receiver/browser/public/runtime_application_dispatcher.h new file mode 100644 index 0000000..88aa369 --- /dev/null +++ b/components/cast_receiver/browser/public/runtime_application_dispatcher.h
@@ -0,0 +1,54 @@ +// Copyright 2021 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef COMPONENTS_CAST_RECEIVER_BROWSER_PUBLIC_RUNTIME_APPLICATION_DISPATCHER_H_ +#define COMPONENTS_CAST_RECEIVER_BROWSER_PUBLIC_RUNTIME_APPLICATION_DISPATCHER_H_ + +#include <memory> +#include <string> + +#include "base/functional/callback.h" +#include "components/cast_receiver/browser/public/application_config.h" + +namespace cast_receiver { + +class RuntimeApplication; + +// This class is responsible for creating new RuntimeApplication instances for +// and managing all existing instances. +// +// |TEmbedderApplication| must implement EmbedderApplication. +template <typename TEmbedderApplication> +class RuntimeApplicationDispatcher { + public: + // Creates a new instance of TEmbedderApplication. The provided instance + // of RuntimeApplication is expected to persist for the duration of the + // created types lifetime. + using EmbedderApplicationFactory = + base::OnceCallback<std::unique_ptr<TEmbedderApplication>( + std::unique_ptr<RuntimeApplication>)>; + + virtual ~RuntimeApplicationDispatcher() = default; + + // Creates an application of |TEmbedderApplication| type and adds to + // the |loaded_apps_| list. + virtual TEmbedderApplication* CreateApplication( + std::string session_id, + cast_receiver::ApplicationConfig app_config, + EmbedderApplicationFactory factory) = 0; + + // Returns an existing application with session id as specified or nullptr if + // no such application exists. + virtual TEmbedderApplication* GetApplication( + const std::string& session_id) = 0; + + // Destroys an existing application with session id as specified and returns + // the removed instance. + virtual std::unique_ptr<TEmbedderApplication> DestroyApplication( + const std::string& session_id) = 0; +}; + +} // namespace cast_receiver + +#endif // COMPONENTS_CAST_RECEIVER_BROWSER_PUBLIC_RUNTIME_APPLICATION_DISPATCHER_H_
diff --git a/components/cast_streaming/public/BUILD.gn b/components/cast_streaming/public/BUILD.gn index aa4fbb2b..19390122 100644 --- a/components/cast_streaming/public/BUILD.gn +++ b/components/cast_streaming/public/BUILD.gn
@@ -11,10 +11,12 @@ source_set("public") { visibility += [ "*" ] public = [ + "app_ids.h", "cast_streaming_url.h", "features.h", ] sources = [ + "app_ids.cc", "cast_streaming_url.cc", "features.cc", ] @@ -22,6 +24,7 @@ deps = [ "//base", "//components/cast_streaming:buildflags", + "//third_party/openscreen/src/cast/common:public", ] }
diff --git a/components/cast_streaming/public/DEPS b/components/cast_streaming/public/DEPS index 06c417b6..74809279 100644 --- a/components/cast_streaming/public/DEPS +++ b/components/cast_streaming/public/DEPS
@@ -1,5 +1,6 @@ include_rules = [ "+media/base", + "+third_party/openscreen/src/cast/common", "+third_party/openscreen/src/cast/streaming", "+ui/gfx/geometry", "+url",
diff --git a/components/cast_streaming/public/app_ids.cc b/components/cast_streaming/public/app_ids.cc new file mode 100644 index 0000000..59ad256 --- /dev/null +++ b/components/cast_streaming/public/app_ids.cc
@@ -0,0 +1,14 @@ +// Copyright 2022 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "components/cast_streaming/public/app_ids.h" + +namespace cast_streaming { + +bool IsStreamingReceiverAppId(base::StringPiece app_id) { + const std::string app_id_string(app_id.data(), app_id.length()); + return openscreen::cast::IsCastStreamingAppId(app_id_string); +} + +} // namespace cast_streaming
diff --git a/components/cast_streaming/public/app_ids.h b/components/cast_streaming/public/app_ids.h new file mode 100644 index 0000000..bc44a4d --- /dev/null +++ b/components/cast_streaming/public/app_ids.h
@@ -0,0 +1,25 @@ +// Copyright 2022 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef COMPONENTS_CAST_STREAMING_PUBLIC_APP_IDS_H_ +#define COMPONENTS_CAST_STREAMING_PUBLIC_APP_IDS_H_ + +#include "third_party/openscreen/src/cast/common/public/cast_streaming_app_ids.h" + +#include "base/strings/string_piece.h" + +namespace cast_streaming { + +// Returns true if |app_id| is associated with a streaming application. +bool IsStreamingReceiverAppId(base::StringPiece app_id); + +// Returns the app ID for the audio and video streaming receiver used by iOS +// apps. +constexpr const char* GetIosAppStreamingAudioVideoAppId() { + return openscreen::cast::GetIosAppStreamingAudioVideoAppId(); +} + +} // namespace cast_streaming + +#endif // COMPONENTS_CAST_STREAMING_PUBLIC_APP_IDS_H_
diff --git a/components/commerce_strings.grdp b/components/commerce_strings.grdp index edff876..a22f15e 100644 --- a/components/commerce_strings.grdp +++ b/components/commerce_strings.grdp
@@ -197,16 +197,16 @@ </if> <!-- For Price Tracking on all platforms --> - <message name="IDS_PRICE_DROP_POPUP_CONTENT_TITLE" desc="Text shown on the price drop popup notification. It tells users how much price drop on the corresponding product."> - <ph name="PRICE_DROP">$1<ex>$100</ex></ph> price drop on <ph name="PRODUCT_NAME">$2<ex>Chromebook</ex></ph> + <message name="IDS_PRICE_DROP_POPUP_CONTENT_TITLE" desc="Text shown on the price drop popup notification. It tells users how much price drop on the corresponding product." formatter_data="android_java"> + <ph name="PRICE_DROP">%1$s<ex>$100</ex></ph> price drop on <ph name="PRODUCT_NAME">%2$s<ex>Chromebook</ex></ph> </message> - <message name="IDS_PRICE_DROP_POPUP_CONTENT_TEXT" desc="Text shown on the price drop popup notification below the content title. It tells users the current price of the product and the source website."> - Now <ph name="CURRENT_PRICE">$1<ex>$799</ex></ph> on <ph name="SOURCE_WEBSITE">$2<ex>amazon.com</ex></ph> + <message name="IDS_PRICE_DROP_POPUP_CONTENT_TEXT" desc="Text shown on the price drop popup notification below the content title. It tells users the current price of the product and the source website." formatter_data="android_java"> + Now <ph name="CURRENT_PRICE">%1$s<ex>$799</ex></ph> on <ph name="SOURCE_WEBSITE">%2$s<ex>amazon.com</ex></ph> </message> - <message name="IDS_PRICE_DROP_POPUP_ACTION_BUTTON" desc="Text shown on the price drop popup notification below the content text. When users click this button, we send them to the source website."> + <message name="IDS_PRICE_DROP_POPUP_ACTION_BUTTON" desc="Text shown on the price drop popup notification below the content text. When users click this button, we send them to the source website." formatter_data="android_java"> Visit site </message> - <message name="IDS_PRICE_DROP_POPUP_UNTRACK_BUTTON" desc="Text shown on the price drop popup notification below the content text. When users click this button, we untrack this product and will no longer send its price drop to users."> + <message name="IDS_PRICE_DROP_POPUP_UNTRACK_BUTTON" desc="Text shown on the price drop popup notification below the content text. When users click this button, we untrack this product and will no longer send its price drop to users." formatter_data="android_java"> Untrack price </message> </grit-part>
diff --git a/components/desks_storage/DEPS b/components/desks_storage/DEPS index e27267f6..810a839 100644 --- a/components/desks_storage/DEPS +++ b/components/desks_storage/DEPS
@@ -1,4 +1,5 @@ include_rules = [ + "+ash/constants", "+ash/public", "+chromeos/crosapi/cpp/lacros_startup_state.h", "+chromeos/ui/base/window_state_type.h",
diff --git a/components/desks_storage/core/desk_model_wrapper.cc b/components/desks_storage/core/desk_model_wrapper.cc index e5c5c760..f8e2d64e 100644 --- a/components/desks_storage/core/desk_model_wrapper.cc +++ b/components/desks_storage/core/desk_model_wrapper.cc
@@ -68,7 +68,8 @@ void DeskModelWrapper::AddOrUpdateEntry( std::unique_ptr<ash::DeskTemplate> new_entry, DeskModel::AddOrUpdateEntryCallback callback) { - if (new_entry->type() == ash::DeskTemplateType::kTemplate) { + if (new_entry->type() == ash::DeskTemplateType::kTemplate || + new_entry->type() == ash::DeskTemplateType::kFloatingWorkspace) { GetDeskTemplateModel()->AddOrUpdateEntry(std::move(new_entry), std::move(callback)); } else { @@ -159,7 +160,8 @@ const std::u16string& name, ash::DeskTemplateType type, const base::GUID& uuid) const { - if (type == ash::DeskTemplateType::kTemplate) { + if (type == ash::DeskTemplateType::kTemplate || + type == ash::DeskTemplateType::kFloatingWorkspace) { return GetDeskTemplateModel()->FindOtherEntryWithName(name, type, uuid); } else { return save_and_recall_desks_model_->FindOtherEntryWithName(name, type,
diff --git a/components/desks_storage/core/desk_sync_bridge.cc b/components/desks_storage/core/desk_sync_bridge.cc index 784fc96c..0618359 100644 --- a/components/desks_storage/core/desk_sync_bridge.cc +++ b/components/desks_storage/core/desk_sync_bridge.cc
@@ -4,6 +4,7 @@ #include "components/desks_storage/core/desk_sync_bridge.h" +#include "ash/constants/ash_features.h" #include "ash/public/cpp/desk_template.h" #include "base/bind.h" #include "base/callback_helpers.h" @@ -438,7 +439,9 @@ } size_t DeskSyncBridge::GetMaxEntryCount() const { - return GetMaxSaveAndRecallDeskEntryCount() + GetMaxDeskTemplateEntryCount(); + return GetMaxSaveAndRecallDeskEntryCount() + + GetMaxFloatingWorkspaceDeskEntryCount() + + GetMaxDeskTemplateEntryCount(); } // Return 0 for now since chrome sync does not support save and recall desks. @@ -456,6 +459,10 @@ return 0u; } +size_t DeskSyncBridge::GetMaxFloatingWorkspaceDeskEntryCount() const { + return (ash::features::IsFloatingWorkspaceV2Enabled() ? 1u : 0u); +} + size_t DeskSyncBridge::GetMaxDeskTemplateEntryCount() const { return kMaxTemplateCount + policy_entries_.size(); }
diff --git a/components/desks_storage/core/desk_sync_bridge.h b/components/desks_storage/core/desk_sync_bridge.h index 0247d65..055e065e 100644 --- a/components/desks_storage/core/desk_sync_bridge.h +++ b/components/desks_storage/core/desk_sync_bridge.h
@@ -73,6 +73,7 @@ size_t GetSaveAndRecallDeskEntryCount() const override; size_t GetDeskTemplateEntryCount() const override; size_t GetMaxSaveAndRecallDeskEntryCount() const override; + size_t GetMaxFloatingWorkspaceDeskEntryCount() const; size_t GetMaxDeskTemplateEntryCount() const override; std::vector<base::GUID> GetAllEntryUuids() const override; bool IsReady() const override;
diff --git a/components/mirroring/service/BUILD.gn b/components/mirroring/service/BUILD.gn index 88d9b11..331fc88 100644 --- a/components/mirroring/service/BUILD.gn +++ b/components/mirroring/service/BUILD.gn
@@ -76,7 +76,6 @@ "//services/network/public/mojom", "//services/viz/public/cpp/gpu", "//third_party/jsoncpp", # Required by Open Screen API. - "//third_party/libaom:libaom_buildflags", "//third_party/openscreen/src/cast/streaming:common", "//third_party/openscreen/src/cast/streaming:sender", "//ui/base",
diff --git a/components/mirroring/service/mirroring_features.cc b/components/mirroring/service/mirroring_features.cc index 7a6dcf0..834ef91e 100644 --- a/components/mirroring/service/mirroring_features.cc +++ b/components/mirroring/service/mirroring_features.cc
@@ -3,25 +3,10 @@ // found in the LICENSE file. #include "components/mirroring/service/mirroring_features.h" -#include "third_party/libaom/libaom_buildflags.h" namespace mirroring { namespace features { -// Controls whether offers using the AV1 codec for video encoding are included -// in mirroring negotiations in addition to the VP8 codec, or offers only -// include VP8. -BASE_FEATURE(kCastStreamingAv1, - "CastStreamingAv1", - base::FEATURE_DISABLED_BY_DEFAULT); - -// Controls whether offers using the VP9 codec for video encoding are included -// in mirroring negotiations in addition to the VP8 codec, or offers only -// include VP8. -BASE_FEATURE(kCastStreamingVp9, - "CastStreamingVp9", - base::FEATURE_DISABLED_BY_DEFAULT); - // The mirroring sender has the ability to letterbox video frames to match the // aspect ratio of the reciever's display. However, receivers can handle // variable aspect ratio video so this is not needed any more. @@ -38,13 +23,5 @@ "CastDisableModelNameCheck", base::FEATURE_ENABLED_BY_DEFAULT); -bool IsCastStreamingAV1Enabled() { -#if BUILDFLAG(ENABLE_LIBAOM) - return base::FeatureList::IsEnabled(features::kCastStreamingAv1); -#else - return false; -#endif -} - } // namespace features } // namespace mirroring
diff --git a/components/mirroring/service/mirroring_features.h b/components/mirroring/service/mirroring_features.h index bf2bacd6..eaba032 100644 --- a/components/mirroring/service/mirroring_features.h +++ b/components/mirroring/service/mirroring_features.h
@@ -12,10 +12,6 @@ namespace mirroring { namespace features { -COMPONENT_EXPORT(MIRRORING_SERVICE) BASE_DECLARE_FEATURE(kCastStreamingAv1); - -COMPONENT_EXPORT(MIRRORING_SERVICE) BASE_DECLARE_FEATURE(kCastStreamingVp9); - // TODO(crbug.com/1363512): Remove support for sender side letterboxing. COMPONENT_EXPORT(MIRRORING_SERVICE) BASE_DECLARE_FEATURE(kCastDisableLetterboxing); @@ -25,8 +21,6 @@ COMPONENT_EXPORT(MIRRORING_SERVICE) BASE_DECLARE_FEATURE(kCastDisableModelNameCheck); -bool IsCastStreamingAV1Enabled(); - } // namespace features } // namespace mirroring
diff --git a/components/mirroring/service/openscreen_session_host.cc b/components/mirroring/service/openscreen_session_host.cc index aee47b96..03f37f0 100644 --- a/components/mirroring/service/openscreen_session_host.cc +++ b/components/mirroring/service/openscreen_session_host.cc
@@ -42,7 +42,7 @@ #include "media/base/audio_capturer_source.h" #include "media/base/bind_to_current_loop.h" #include "media/cast/common/openscreen_conversion_helpers.h" -#include "media/cast/encoding/external_video_encoder.h" +#include "media/cast/encoding/encoding_support.h" #include "media/cast/sender/audio_sender.h" #include "media/cast/sender/video_sender.h" #include "media/gpu/gpu_video_accelerator_util.h" @@ -490,7 +490,7 @@ ? base::NumberToString(static_cast<int>(video_config->codec)).c_str() : "none"), (video_config - ? (video_config->use_external_encoder ? "hardware" : "software") + ? (video_config->use_hardware_encoder ? "hardware" : "software") : "n/a"))); } @@ -915,43 +915,41 @@ if (session_params_.type != SessionType::AUDIO_ONLY) { // First, check if hardware VP8 and H264 are available. - const bool hardware_vp8_recommended = - media::cast::ExternalVideoEncoder::IsRecommended( - Codec::CODEC_VIDEO_VP8, session_params_.receiver_model_name, - supported_profiles_); + const bool should_offer_hardware_vp8 = + media::cast::encoding_support::IsHardwareEnabled(Codec::CODEC_VIDEO_VP8, + supported_profiles_); - if (hardware_vp8_recommended) { + if (should_offer_hardware_vp8) { FrameSenderConfig config = MirrorSettings::GetDefaultVideoConfig( RtpPayloadType::VIDEO_VP8, Codec::CODEC_VIDEO_VP8); UpdateConfigUsingSessionParameters(session_params_, config); - config.use_external_encoder = true; + config.use_hardware_encoder = true; last_offered_video_configs_.push_back(config); video_configs.push_back(ToOpenscreenVideoConfig(config)); } - if (media::cast::ExternalVideoEncoder::IsRecommended( - Codec::CODEC_VIDEO_H264, session_params_.receiver_model_name, - supported_profiles_)) { + if (media::cast::encoding_support::IsHardwareEnabled( + Codec::CODEC_VIDEO_H264, supported_profiles_)) { FrameSenderConfig config = MirrorSettings::GetDefaultVideoConfig( RtpPayloadType::VIDEO_H264, Codec::CODEC_VIDEO_H264); UpdateConfigUsingSessionParameters(session_params_, config); - config.use_external_encoder = true; + config.use_hardware_encoder = true; last_offered_video_configs_.push_back(config); video_configs.push_back(ToOpenscreenVideoConfig(config)); } // Then add software AV1 and VP9 if enabled. - // TODO(https://crbug.com/1311770): hardware VP9 encoding should be added. - if (mirroring::features::IsCastStreamingAV1Enabled()) { + if (media::cast::encoding_support::IsSoftwareEnabled( + Codec::CODEC_VIDEO_AV1)) { FrameSenderConfig config = MirrorSettings::GetDefaultVideoConfig( RtpPayloadType::VIDEO_AV1, Codec::CODEC_VIDEO_AV1); UpdateConfigUsingSessionParameters(session_params_, config); - config.use_external_encoder = false; last_offered_video_configs_.push_back(config); video_configs.push_back(ToOpenscreenVideoConfig(config)); } - if (base::FeatureList::IsEnabled(features::kCastStreamingVp9)) { + if (media::cast::encoding_support::IsSoftwareEnabled( + Codec::CODEC_VIDEO_VP9)) { FrameSenderConfig config = MirrorSettings::GetDefaultVideoConfig( RtpPayloadType::VIDEO_VP9, Codec::CODEC_VIDEO_VP9); UpdateConfigUsingSessionParameters(session_params_, config); @@ -959,7 +957,10 @@ video_configs.push_back(ToOpenscreenVideoConfig(config)); } - if (!hardware_vp8_recommended) { + // Finally, offer software VP8 if hardware VP8 was not offered. + if (!should_offer_hardware_vp8 && + media::cast::encoding_support::IsSoftwareEnabled( + Codec::CODEC_VIDEO_VP8)) { FrameSenderConfig config = MirrorSettings::GetDefaultVideoConfig( RtpPayloadType::VIDEO_VP8, Codec::CODEC_VIDEO_VP8); UpdateConfigUsingSessionParameters(session_params_, config);
diff --git a/components/mirroring/service/openscreen_session_host_unittest.cc b/components/mirroring/service/openscreen_session_host_unittest.cc index 96391484..a8053ff4 100644 --- a/components/mirroring/service/openscreen_session_host_unittest.cc +++ b/components/mirroring/service/openscreen_session_host_unittest.cc
@@ -637,7 +637,7 @@ } TEST_F(OpenscreenSessionHostTest, Vp9CodecEnabledInOffer) { - base::test::ScopedFeatureList feature_list(features::kCastStreamingVp9); + base::test::ScopedFeatureList feature_list(media::kCastStreamingVp9); CreateSession(SessionType::VIDEO_ONLY); const openscreen::cast::Offer& offer = @@ -654,7 +654,7 @@ TEST_F(OpenscreenSessionHostTest, Av1CodecEnabledInOffer) { // Cast streaming of AV1 is desktop only. #if !BUILDFLAG(IS_ANDROID) - base::test::ScopedFeatureList feature_list(features::kCastStreamingAv1); + base::test::ScopedFeatureList feature_list(media::kCastStreamingAv1); CreateSession(SessionType::VIDEO_ONLY); const openscreen::cast::Offer& offer = @@ -699,7 +699,7 @@ [](const media::cast::FrameSenderConfig& config) { return config.codec == media::cast::Codec::CODEC_VIDEO_VP8 && - config.use_external_encoder; + config.use_hardware_encoder; })); #endif } @@ -734,7 +734,7 @@ [](const media::cast::FrameSenderConfig& config) { return config.codec == media::cast::Codec::CODEC_VIDEO_H264 && - config.use_external_encoder; + config.use_hardware_encoder; })); #endif }
diff --git a/components/mirroring/service/session.cc b/components/mirroring/service/session.cc index e44ca15..66c60c7 100644 --- a/components/mirroring/service/session.cc +++ b/components/mirroring/service/session.cc
@@ -39,7 +39,7 @@ #include "media/audio/audio_input_device.h" #include "media/base/audio_capturer_source.h" #include "media/base/bind_to_current_loop.h" -#include "media/cast/encoding/external_video_encoder.h" +#include "media/cast/encoding/encoding_support.h" #include "media/cast/net/cast_transport.h" #include "media/cast/sender/audio_sender.h" #include "media/cast/sender/video_sender.h" @@ -845,26 +845,25 @@ const int32_t video_ssrc = base::RandInt(kVideoSsrcMin, kVideoSsrcMax); if (state_ == MIRRORING) { // First, check if hardware VP8 and H264 are available. - const bool hardware_vp8_recommended = - media::cast::ExternalVideoEncoder::IsRecommended( - Codec::CODEC_VIDEO_VP8, session_params_.receiver_model_name, - supported_profiles_); + const bool should_offer_hardware_vp8 = + media::cast::encoding_support::IsHardwareEnabled( + Codec::CODEC_VIDEO_VP8, supported_profiles_); - if (hardware_vp8_recommended) { + if (should_offer_hardware_vp8) { FrameSenderConfig config = MirrorSettings::GetDefaultVideoConfig( RtpPayloadType::VIDEO_VP8, Codec::CODEC_VIDEO_VP8); - config.use_external_encoder = true; + config.use_hardware_encoder = true; AddSenderConfig(video_ssrc, config, aes_key, aes_iv, session_params_, &video_configs); AddStreamObject(stream_index++, "VP8", video_configs.back(), mirror_settings_, stream_list); } - if (media::cast::ExternalVideoEncoder::IsRecommended( - Codec::CODEC_VIDEO_H264, session_params_.receiver_model_name, - supported_profiles_)) { + + if (media::cast::encoding_support::IsHardwareEnabled( + Codec::CODEC_VIDEO_H264, supported_profiles_)) { FrameSenderConfig config = MirrorSettings::GetDefaultVideoConfig( RtpPayloadType::VIDEO_H264, Codec::CODEC_VIDEO_H264); - config.use_external_encoder = true; + config.use_hardware_encoder = true; AddSenderConfig(video_ssrc, config, aes_key, aes_iv, session_params_, &video_configs); AddStreamObject(stream_index++, "H264", video_configs.back(), @@ -872,8 +871,8 @@ } // Then add software AV1 and VP9 if enabled. - // TODO(https://crbug.com/1311770): hardware VP9 encoding should be added. - if (mirroring::features::IsCastStreamingAV1Enabled()) { + if (media::cast::encoding_support::IsSoftwareEnabled( + Codec::CODEC_VIDEO_AV1)) { FrameSenderConfig config = MirrorSettings::GetDefaultVideoConfig( RtpPayloadType::VIDEO_AV1, Codec::CODEC_VIDEO_AV1); AddSenderConfig(video_ssrc, config, aes_key, aes_iv, session_params_, @@ -881,7 +880,9 @@ AddStreamObject(stream_index++, "AV1", video_configs.back(), mirror_settings_, stream_list); } - if (base::FeatureList::IsEnabled(features::kCastStreamingVp9)) { + + if (media::cast::encoding_support::IsSoftwareEnabled( + Codec::CODEC_VIDEO_VP9)) { FrameSenderConfig config = MirrorSettings::GetDefaultVideoConfig( RtpPayloadType::VIDEO_VP9, Codec::CODEC_VIDEO_VP9); AddSenderConfig(video_ssrc, config, aes_key, aes_iv, session_params_, @@ -891,7 +892,9 @@ } // Finally, offer software VP8 if hardware VP8 was not offered. - if (!hardware_vp8_recommended) { + if (!should_offer_hardware_vp8 && + media::cast::encoding_support::IsSoftwareEnabled( + Codec::CODEC_VIDEO_VP8)) { FrameSenderConfig config = MirrorSettings::GetDefaultVideoConfig( RtpPayloadType::VIDEO_VP8, Codec::CODEC_VIDEO_VP8); AddSenderConfig(video_ssrc, config, aes_key, aes_iv, session_params_,
diff --git a/components/page_info/android/connection_info_view_android.cc b/components/page_info/android/connection_info_view_android.cc index 82e6284..ccc8864 100644 --- a/components/page_info/android/connection_info_view_android.cc +++ b/components/page_info/android/connection_info_view_android.cc
@@ -53,7 +53,7 @@ // Important to use GetVisibleEntry to match what's showing in the omnibox. content::NavigationEntry* nav_entry = web_contents->GetController().GetVisibleEntry(); - if (!nav_entry || nav_entry->IsInitialEntry()) + if (nav_entry->IsInitialEntry()) return; popup_jobject_.Reset(env, java_page_info_pop);
diff --git a/components/page_info/android/page_info_controller_android.cc b/components/page_info/android/page_info_controller_android.cc index e4a9f43..63aca93e 100644 --- a/components/page_info/android/page_info_controller_android.cc +++ b/components/page_info/android/page_info_controller_android.cc
@@ -42,7 +42,7 @@ // Important to use GetVisibleEntry to match what's showing in the omnibox. content::NavigationEntry* nav_entry = web_contents->GetController().GetVisibleEntry(); - if (!nav_entry || nav_entry->IsInitialEntry()) + if (nav_entry->IsInitialEntry()) return 0; return reinterpret_cast<intptr_t>(
diff --git a/components/power_bookmarks/core/BUILD.gn b/components/power_bookmarks/core/BUILD.gn index 1b1f6b24..5ad5dfa8 100644 --- a/components/power_bookmarks/core/BUILD.gn +++ b/components/power_bookmarks/core/BUILD.gn
@@ -51,6 +51,7 @@ proto_library("proto") { proto_in_dir = "//" sources = [ + "proto/note_specifics.proto", "proto/power_bookmark_meta.proto", "proto/power_bookmark_specifics.proto", "proto/shopping_specifics.proto",
diff --git a/components/power_bookmarks/core/power_bookmark_service.cc b/components/power_bookmarks/core/power_bookmark_service.cc index 31ece6d..fa64ad69 100644 --- a/components/power_bookmarks/core/power_bookmark_service.cc +++ b/components/power_bookmarks/core/power_bookmark_service.cc
@@ -65,6 +65,14 @@ void PowerBookmarkService::CreatePower(std::unique_ptr<Power> power, SuccessCallback callback) { + // Accept existing guids if they're explicitly set. + if (!power->guid().is_valid()) + power->set_guid(base::GUID::GenerateRandomV4()); + base::Time now = base::Time::Now(); + if (power->time_added().is_null()) + power->set_time_added(now); + if (power->time_modified().is_null()) + power->set_time_modified(now); backend_.AsyncCall(&PowerBookmarkBackend::CreatePower) .WithArgs(std::move(power)) .Then(base::BindOnce(&PowerBookmarkService::NotifyPowersChanged, @@ -74,6 +82,7 @@ void PowerBookmarkService::UpdatePower(std::unique_ptr<Power> power, SuccessCallback callback) { + power->set_time_modified(base::Time::Now()); backend_.AsyncCall(&PowerBookmarkBackend::UpdatePower) .WithArgs(std::move(power)) .Then(base::BindOnce(&PowerBookmarkService::NotifyPowersChanged,
diff --git a/components/power_bookmarks/core/power_bookmark_service_unittest.cc b/components/power_bookmarks/core/power_bookmark_service_unittest.cc index f00dc13b..cc9da7d 100644 --- a/components/power_bookmarks/core/power_bookmark_service_unittest.cc +++ b/components/power_bookmarks/core/power_bookmark_service_unittest.cc
@@ -8,6 +8,7 @@ #include "base/guid.h" #include "base/task/sequenced_task_runner.h" #include "base/task/thread_pool.h" +#include "base/test/bind.h" #include "base/test/mock_callback.h" #include "base/test/task_environment.h" #include "base/threading/sequenced_task_runner_handle.h" @@ -26,6 +27,20 @@ using testing::IsTrue; using testing::SizeIs; +namespace { +std::unique_ptr<power_bookmarks::Power> MakePower( + GURL url, + power_bookmarks::PowerType power_type) { + std::unique_ptr<power_bookmarks::PowerSpecifics> power_specifics = + std::make_unique<power_bookmarks::PowerSpecifics>(); + std::unique_ptr<power_bookmarks::Power> power = + std::make_unique<power_bookmarks::Power>(std::move(power_specifics)); + power->set_url(url); + power->set_power_type(power_type); + return power; +} +} // namespace + namespace power_bookmarks { // Tests for the power bookmark service. @@ -43,6 +58,7 @@ service_ = std::make_unique<PowerBookmarkService>( model_.get(), temp_directory_.GetPath(), backend_task_runner_); RunUntilIdle(); + service_->InitPowerBookmarkDatabase(); } @@ -123,13 +139,9 @@ base::MockCallback<SuccessCallback> success_cb; EXPECT_CALL(success_cb, Run(IsTrue())); - std::unique_ptr<PowerSpecifics> power_specifics = - std::make_unique<PowerSpecifics>(); - std::unique_ptr<Power> power = - std::make_unique<Power>(std::move(power_specifics)); - power->set_url(GURL("https://google.com")); - power->set_power_type(PowerType::POWER_TYPE_MOCK); - service()->CreatePower(std::move(power), success_cb.Get()); + service()->CreatePower( + MakePower(GURL("https://google.com"), PowerType::POWER_TYPE_MOCK), + success_cb.Get()); RunUntilIdle(); base::MockCallback<PowersCallback> powers_cb; @@ -144,30 +156,21 @@ TEST_F(PowerBookmarkServiceTest, GetPowerOverviewsForType) { base::MockCallback<SuccessCallback> success_cb; EXPECT_CALL(success_cb, Run(IsTrue())); - - std::unique_ptr<PowerSpecifics> power_specifics = - std::make_unique<PowerSpecifics>(); - std::unique_ptr<Power> power = - std::make_unique<Power>(std::move(power_specifics)); - power->set_url(GURL("https://google.com")); - power->set_power_type(PowerType::POWER_TYPE_MOCK); - service()->CreatePower(std::move(power), success_cb.Get()); + service()->CreatePower( + MakePower(GURL("https://google.com"), PowerType::POWER_TYPE_MOCK), + success_cb.Get()); RunUntilIdle(); EXPECT_CALL(success_cb, Run(IsTrue())); - power_specifics = std::make_unique<PowerSpecifics>(); - power = std::make_unique<Power>(std::move(power_specifics)); - power->set_url(GURL("https://google.com")); - power->set_power_type(PowerType::POWER_TYPE_MOCK); - service()->CreatePower(std::move(power), success_cb.Get()); + service()->CreatePower( + MakePower(GURL("https://google.com"), PowerType::POWER_TYPE_MOCK), + success_cb.Get()); RunUntilIdle(); EXPECT_CALL(success_cb, Run(IsTrue())); - power_specifics = std::make_unique<PowerSpecifics>(); - power = std::make_unique<Power>(std::move(power_specifics)); - power->set_url(GURL("https://boogle.com")); - power->set_power_type(PowerType::POWER_TYPE_MOCK); - service()->CreatePower(std::move(power), success_cb.Get()); + service()->CreatePower( + MakePower(GURL("https://boogle.com"), PowerType::POWER_TYPE_MOCK), + success_cb.Get()); RunUntilIdle(); base::MockCallback<PowerOverviewsCallback> cb; @@ -181,27 +184,112 @@ base::MockCallback<SuccessCallback> cb; EXPECT_CALL(cb, Run(IsTrue())); - std::unique_ptr<PowerSpecifics> power_specifics = - std::make_unique<PowerSpecifics>(); - std::unique_ptr<Power> power = - std::make_unique<Power>(std::move(power_specifics)); - power->set_url(GURL("https://google.com")); - power->set_power_type(PowerType::POWER_TYPE_MOCK); - service()->CreatePower(std::move(power), cb.Get()); + service()->CreatePower( + MakePower(GURL("https://google.com"), PowerType::POWER_TYPE_MOCK), + cb.Get()); + RunUntilIdle(); + + PowersCallback powers_cb = base::BindLambdaForTesting( + [&](std::vector<std::unique_ptr<Power>> powers) { + ASSERT_EQ(1u, powers.size()); + ASSERT_FALSE(powers[0]->time_added().is_null()); + ASSERT_FALSE(powers[0]->time_modified().is_null()); + }); + service()->GetPowersForURL(GURL("https://google.com"), + PowerType::POWER_TYPE_UNSPECIFIED, + std::move(powers_cb)); + RunUntilIdle(); +} + +TEST_F(PowerBookmarkServiceTest, ShouldNotCreatePowerIfPresent) { + base::MockCallback<SuccessCallback> cb; + EXPECT_CALL(cb, Run(IsTrue())); + auto power1 = + MakePower(GURL("https://google.com"), PowerType::POWER_TYPE_MOCK); + power1->set_guid(base::GUID::GenerateRandomV4()); + auto power2 = power1->Clone(); + service()->CreatePower(std::move(power1), cb.Get()); + RunUntilIdle(); + + EXPECT_CALL(cb, Run(IsFalse())); + service()->CreatePower(std::move(power2), cb.Get()); + RunUntilIdle(); + + PowersCallback powers_cb = base::BindLambdaForTesting( + [&](std::vector<std::unique_ptr<Power>> powers) { + ASSERT_EQ(1u, powers.size()); + ASSERT_FALSE(powers[0]->time_added().is_null()); + ASSERT_FALSE(powers[0]->time_modified().is_null()); + }); + service()->GetPowersForURL(GURL("https://google.com"), + PowerType::POWER_TYPE_UNSPECIFIED, + std::move(powers_cb)); + RunUntilIdle(); +} + +TEST_F(PowerBookmarkServiceTest, CreatePowerShouldNotUpdateTimeIfPresent) { + base::MockCallback<SuccessCallback> cb; + EXPECT_CALL(cb, Run(IsTrue())); + auto power1 = + MakePower(GURL("https://google.com"), PowerType::POWER_TYPE_MOCK); + base::Time time = base::Time::FromDeltaSinceWindowsEpoch(base::Days(1)); + power1->set_time_added(time); + power1->set_time_modified(time); + service()->CreatePower(std::move(power1), cb.Get()); + RunUntilIdle(); + + PowersCallback powers_cb = base::BindLambdaForTesting( + [&](std::vector<std::unique_ptr<Power>> powers) { + ASSERT_EQ(1u, powers.size()); + ASSERT_EQ(time, powers[0]->time_added()); + ASSERT_EQ(time, powers[0]->time_modified()); + }); + service()->GetPowersForURL(GURL("https://google.com"), + PowerType::POWER_TYPE_UNSPECIFIED, + std::move(powers_cb)); RunUntilIdle(); } TEST_F(PowerBookmarkServiceTest, UpdatePower) { base::MockCallback<SuccessCallback> cb; EXPECT_CALL(cb, Run(IsTrue())); + auto power1 = + MakePower(GURL("https://google.com"), PowerType::POWER_TYPE_MOCK); + power1->set_guid(base::GUID::GenerateRandomV4()); + auto power2 = power1->Clone(); + service()->CreatePower(std::move(power1), cb.Get()); + RunUntilIdle(); - std::unique_ptr<PowerSpecifics> power_specifics = - std::make_unique<PowerSpecifics>(); - std::unique_ptr<Power> power = - std::make_unique<Power>(std::move(power_specifics)); - power->set_url(GURL("https://google.com")); - power->set_power_type(PowerType::POWER_TYPE_MOCK); - service()->UpdatePower(std::move(power), cb.Get()); + EXPECT_CALL(cb, Run(IsTrue())); + service()->UpdatePower(std::move(power2), cb.Get()); + RunUntilIdle(); + + PowersCallback powers_cb = base::BindLambdaForTesting( + [&](std::vector<std::unique_ptr<Power>> powers) { + ASSERT_EQ(1u, powers.size()); + ASSERT_FALSE(powers[0]->time_modified().is_null()); + }); + service()->GetPowersForURL(GURL("https://google.com"), + PowerType::POWER_TYPE_UNSPECIFIED, + std::move(powers_cb)); + RunUntilIdle(); +} + +TEST_F(PowerBookmarkServiceTest, ShouldNotUpdatePowerIfNotPresent) { + base::MockCallback<SuccessCallback> cb; + EXPECT_CALL(cb, Run(IsFalse())); + service()->UpdatePower( + MakePower(GURL("https://google.com"), PowerType::POWER_TYPE_MOCK), + cb.Get()); + RunUntilIdle(); + + PowersCallback powers_cb = base::BindLambdaForTesting( + [&](std::vector<std::unique_ptr<Power>> powers) { + ASSERT_EQ(0u, powers.size()); + }); + service()->GetPowersForURL(GURL("https://google.com"), + PowerType::POWER_TYPE_UNSPECIFIED, + std::move(powers_cb)); RunUntilIdle(); } @@ -210,13 +298,9 @@ EXPECT_CALL(success_cb, Run(IsTrue())); base::GUID guid = base::GUID::GenerateRandomV4(); - std::unique_ptr<PowerSpecifics> power_specifics = - std::make_unique<PowerSpecifics>(); - std::unique_ptr<Power> power = - std::make_unique<Power>(std::move(power_specifics)); + auto power = + MakePower(GURL("https://google.com"), PowerType::POWER_TYPE_MOCK); power->set_guid(guid); - power->set_url(GURL("https://google.com")); - power->set_power_type(PowerType::POWER_TYPE_MOCK); service()->CreatePower(std::move(power), success_cb.Get()); RunUntilIdle(); @@ -242,21 +326,15 @@ base::MockCallback<SuccessCallback> success_cb; EXPECT_CALL(success_cb, Run(IsTrue())); - std::unique_ptr<PowerSpecifics> power_specifics = - std::make_unique<PowerSpecifics>(); - std::unique_ptr<Power> power = - std::make_unique<Power>(std::move(power_specifics)); - power->set_url(GURL("https://google.com")); - power->set_power_type(PowerType::POWER_TYPE_MOCK); - service()->CreatePower(std::move(power), success_cb.Get()); + service()->CreatePower( + MakePower(GURL("https://google.com"), PowerType::POWER_TYPE_MOCK), + success_cb.Get()); RunUntilIdle(); EXPECT_CALL(success_cb, Run(IsTrue())); - power_specifics = std::make_unique<PowerSpecifics>(); - power = std::make_unique<Power>(std::move(power_specifics)); - power->set_url(GURL("https://google.com")); - power->set_power_type(PowerType::POWER_TYPE_MOCK); - service()->CreatePower(std::move(power), success_cb.Get()); + service()->CreatePower( + MakePower(GURL("https://google.com"), PowerType::POWER_TYPE_MOCK), + success_cb.Get()); RunUntilIdle(); base::MockCallback<PowersCallback> powers_cb; @@ -291,22 +369,17 @@ base::GUID guid = base::GUID::GenerateRandomV4(); std::unique_ptr<PowerSpecifics> power_specifics = std::make_unique<PowerSpecifics>(); - std::unique_ptr<Power> power = - std::make_unique<Power>(std::move(power_specifics)); + auto power = + MakePower(GURL("https://google.com"), PowerType::POWER_TYPE_MOCK); power->set_guid(guid); - power->set_url(GURL("https://google.com")); - power->set_power_type(PowerType::POWER_TYPE_MOCK); + auto power2 = power->Clone(); service()->CreatePower(std::move(power), success_cb.Get()); RunUntilIdle(); EXPECT_CALL(obs, OnPowersChanged()); EXPECT_CALL(success_cb, Run(IsTrue())); - power_specifics = std::make_unique<PowerSpecifics>(); - power = std::make_unique<Power>(std::move(power_specifics)); - power->set_url(GURL("https://google.com")); - power->set_power_type(PowerType::POWER_TYPE_MOCK); - service()->UpdatePower(std::move(power), success_cb.Get()); + service()->UpdatePower(std::move(power2), success_cb.Get()); RunUntilIdle(); EXPECT_CALL(obs, OnPowersChanged());
diff --git a/components/power_bookmarks/core/powers/power.cc b/components/power_bookmarks/core/powers/power.cc index 60532fd..5d6cd8b 100644 --- a/components/power_bookmarks/core/powers/power.cc +++ b/components/power_bookmarks/core/powers/power.cc
@@ -29,7 +29,7 @@ Power::~Power() = default; -void Power::ToPowerBookmarkSpecifics(PowerBookmarkSpecifics* specifics) { +void Power::ToPowerBookmarkSpecifics(PowerBookmarkSpecifics* specifics) const { specifics->set_guid(guid_.AsLowercaseString()); specifics->set_url(url_.spec()); specifics->set_power_type(power_type_); @@ -44,4 +44,22 @@ specifics->mutable_power_specifics()->CopyFrom(*power_specifics_.get()); } +void Power::Merge(const Power& other) { + // Assuming guid, url and power type are the same. + DCHECK(guid_ == other.guid_); + DCHECK(url_ == other.url_); + DCHECK(power_type_ == other.power_type_); + // Take the latest time modified. + if (time_modified_ < other.time_modified_) + time_modified_ = other.time_modified_; + // TODO(1382835): Powers should be able to customize the merge logic. + power_specifics_->CopyFrom(*other.power_specifics_); +} + +std::unique_ptr<Power> Power::Clone() const { + PowerBookmarkSpecifics power_specifics; + ToPowerBookmarkSpecifics(&power_specifics); + return std::make_unique<Power>(power_specifics); +} + } // namespace power_bookmarks \ No newline at end of file
diff --git a/components/power_bookmarks/core/powers/power.h b/components/power_bookmarks/core/powers/power.h index 0d69e10..c14b30a 100644 --- a/components/power_bookmarks/core/powers/power.h +++ b/components/power_bookmarks/core/powers/power.h
@@ -46,9 +46,23 @@ time_modified_ = time_modified; } + // Used to get fields from PowerSpecifics. + const PowerSpecifics* power_specifics() const { + return power_specifics_.get(); + } + // Write the properties held in this class to power_bookmark_specifics.proto. // `power_bookmark_specifics` will never be nullptr. - void ToPowerBookmarkSpecifics(PowerBookmarkSpecifics* save_specifics); + void ToPowerBookmarkSpecifics(PowerBookmarkSpecifics* save_specifics) const; + + // Merge the current power with the other one. + // guid, url and PowerType are not allowed to be different from the other + // power. + void Merge(const Power& other); + + // Clone a power. Every power should be independent to others. + // This should be call to duplicate a power instead of direct assign. + std::unique_ptr<Power> Clone() const; private: base::GUID guid_;
diff --git a/components/power_bookmarks/core/powers/power_unittest.cc b/components/power_bookmarks/core/powers/power_unittest.cc index a1282ad..b16a586c 100644 --- a/components/power_bookmarks/core/powers/power_unittest.cc +++ b/components/power_bookmarks/core/powers/power_unittest.cc
@@ -54,4 +54,30 @@ EXPECT_EQ(specifics.update_time_usec(), new_specifics.update_time_usec()); } +TEST(PowerTest, ClonePower) { + PowerBookmarkSpecifics specifics = CreatePowerBookmarkSpecifics(); + Power power(specifics); + std::unique_ptr<Power> clone = power.Clone(); + EXPECT_EQ(power.guid(), clone->guid()); + EXPECT_EQ(power.url(), clone->url()); + EXPECT_EQ(power.time_added(), clone->time_added()); + EXPECT_EQ(power.time_modified(), clone->time_modified()); + EXPECT_EQ(power.power_specifics()->SerializeAsString(), + clone->power_specifics()->SerializeAsString()); +} + +TEST(PowerTest, MergePower) { + PowerBookmarkSpecifics specifics = CreatePowerBookmarkSpecifics(); + Power power(specifics); + Power other(specifics); + base::Time now = base::Time::Now(); + power.set_time_added(now); + power.set_time_modified(now); + other.set_time_added(now + base::Seconds(1)); + other.set_time_modified(now + base::Seconds(1)); + power.Merge(other); + EXPECT_EQ(power.time_added(), now); + EXPECT_EQ(power.time_modified(), other.time_modified()); +} + } // namespace power_bookmarks
diff --git a/components/power_bookmarks/core/proto/note_specifics.proto b/components/power_bookmarks/core/proto/note_specifics.proto new file mode 100644 index 0000000..396d2a6 --- /dev/null +++ b/components/power_bookmarks/core/proto/note_specifics.proto
@@ -0,0 +1,36 @@ +// Copyright 2022 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +syntax = "proto2"; + +option java_multiple_files = true; +option java_package = "org.chromium.components.power_bookmarks"; + +option optimize_for = LITE_RUNTIME; + +package power_bookmarks; + +message NoteSpecifics { + enum TargetType { + TARGET_TYPE_UNSPECIFIED = 0; + + // Page target type makes the note global to the page. It does not associate + // with any user selection. + TARGET_TYPE_PAGE = 1; + } + + // Plain text of the note. + optional string plain_text = 1; + + // Rich text of the note. It will be used when plain_text is empty and the UI + // supports rich text. + optional string rich_text = 2; + + // The type of the note target. Currently only PAGE target type is supported. + /* required */ optional TargetType target_type = 3; + + // The current version of the note. If this version is newer than the note + // version of the browser the note won't be displayed. + /* required */ optional int32 current_note_version = 4; +}
diff --git a/components/power_bookmarks/core/proto/power_bookmark_specifics.proto b/components/power_bookmarks/core/proto/power_bookmark_specifics.proto index 62b3adc8..ff696776 100644 --- a/components/power_bookmarks/core/proto/power_bookmark_specifics.proto +++ b/components/power_bookmarks/core/proto/power_bookmark_specifics.proto
@@ -11,6 +11,8 @@ package power_bookmarks; +import "components/power_bookmarks/core/proto/note_specifics.proto"; + // PowerType is persisted to disk and therefore shouldn't be reoderered or // changed. enum PowerType { @@ -18,10 +20,18 @@ POWER_TYPE_UNSPECIFIED = 0; // Used for testing. POWER_TYPE_MOCK = 1; + // Used for notes. + POWER_TYPE_NOTE = 2; } +// Data structure dedicated to each power type. +// Should keep the field numbers of specifics in sync with the ones in PowerType +// above. message PowerSpecifics { - optional string placeholder = 1; + oneof specifics { + // Used for notes. + NoteSpecifics note_specifics = 2; + } } message PowerBookmarkSpecifics {
diff --git a/components/power_bookmarks/storage/power_bookmark_database_impl.cc b/components/power_bookmarks/storage/power_bookmark_database_impl.cc index 6ed90f6..fa95bd7 100644 --- a/components/power_bookmarks/storage/power_bookmark_database_impl.cc +++ b/components/power_bookmarks/storage/power_bookmark_database_impl.cc
@@ -31,10 +31,12 @@ switch (specifics.power_type()) { case PowerType::POWER_TYPE_UNSPECIFIED: case PowerType::POWER_TYPE_MOCK: + case PowerType::POWER_TYPE_NOTE: return std::make_unique<Power>(specifics); default: NOTREACHED(); } + return nullptr; } bool CheckIfPowerWithIdExists(sql::Database* db, const base::GUID& guid) { @@ -279,20 +281,16 @@ bool PowerBookmarkDatabaseImpl::CreatePower(std::unique_ptr<Power> power) { DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); - if (CheckIfPowerWithIdExists(&db_, power->guid())) - return UpdatePower(std::move(power)); + if (CheckIfPowerWithIdExists(&db_, power->guid())) { + DLOG(ERROR) + << "Failed to create power because the current power already exists."; + return false; + } sql::Transaction transaction(&db_); if (!transaction.Begin()) return false; - // Accept existing guids if they're explicitly set. - if (!power->guid().is_valid()) - power->set_guid(base::GUID::GenerateRandomV4()); - base::Time now = base::Time::Now(); - power->set_time_added(now); - power->set_time_modified(now); - static constexpr char kCreatePowerSaveSql[] = // clang-format off "INSERT INTO saves(" @@ -337,8 +335,11 @@ bool PowerBookmarkDatabaseImpl::UpdatePower(std::unique_ptr<Power> power) { DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); - if (!CheckIfPowerWithIdExists(&db_, power->guid())) - return CreatePower(std::move(power)); + if (!CheckIfPowerWithIdExists(&db_, power->guid())) { + DLOG(ERROR) + << "Failed to update power because the current power does not exist."; + return false; + } sql::Transaction transaction(&db_); if (!transaction.Begin())
diff --git a/components/power_bookmarks/storage/power_bookmark_database_impl_unittest.cc b/components/power_bookmarks/storage/power_bookmark_database_impl_unittest.cc index 3e42be7..cb1745c 100644 --- a/components/power_bookmarks/storage/power_bookmark_database_impl_unittest.cc +++ b/components/power_bookmarks/storage/power_bookmark_database_impl_unittest.cc
@@ -20,8 +20,21 @@ #include "sql/test/test_helpers.h" #include "testing/gtest/include/gtest/gtest.h" +namespace { +std::unique_ptr<power_bookmarks::Power> MakePower( + GURL url, + power_bookmarks::PowerType power_type) { + std::unique_ptr<power_bookmarks::PowerSpecifics> power_specifics = + std::make_unique<power_bookmarks::PowerSpecifics>(); + std::unique_ptr<power_bookmarks::Power> power = + std::make_unique<power_bookmarks::Power>(std::move(power_specifics)); + power->set_guid(base::GUID::GenerateRandomV4()); + power->set_url(url); + power->set_power_type(power_type); + return power; +} +} // namespace namespace power_bookmarks { - class PowerBookmarkDatabaseImplTest : public testing::Test { public: PowerBookmarkDatabaseImplTest() = default; @@ -186,50 +199,87 @@ } } -TEST_F(PowerBookmarkDatabaseImplTest, CreatePowerWhenUpdateCalled) { +TEST_F(PowerBookmarkDatabaseImplTest, UpdatePowerIfExist) { std::unique_ptr<PowerBookmarkDatabaseImpl> pbdb = std::make_unique<PowerBookmarkDatabaseImpl>(db_dir()); EXPECT_TRUE(pbdb->Init()); - std::unique_ptr<PowerSpecifics> power_specifics = - std::make_unique<PowerSpecifics>(); - std::unique_ptr<Power> power = - std::make_unique<Power>(std::move(power_specifics)); - power->set_url(GURL("https://google.com")); - power->set_power_type(PowerType::POWER_TYPE_MOCK); + auto power = + MakePower(GURL("https://google.com"), PowerType::POWER_TYPE_MOCK); + power->set_guid(base::GUID::GenerateRandomV4()); + auto power2 = power->Clone(); - // Update called when no Power can be found will result in a create. - EXPECT_TRUE(pbdb->UpdatePower(std::move(power))); - - std::vector<std::unique_ptr<Power>> stored_powers = pbdb->GetPowersForURL( - GURL("https://google.com"), PowerType::POWER_TYPE_MOCK); - EXPECT_EQ(1u, stored_powers.size()); - EXPECT_EQ(GURL("https://google.com"), stored_powers[0]->url()); - EXPECT_EQ(PowerType::POWER_TYPE_MOCK, stored_powers[0]->power_type()); -} - -TEST_F(PowerBookmarkDatabaseImplTest, UpdatePowerWhenCreateCalled) { - std::unique_ptr<PowerBookmarkDatabaseImpl> pbdb = - std::make_unique<PowerBookmarkDatabaseImpl>(db_dir()); - EXPECT_TRUE(pbdb->Init()); - - std::unique_ptr<PowerSpecifics> power_specifics = - std::make_unique<PowerSpecifics>(); - std::unique_ptr<Power> power = - std::make_unique<Power>(std::move(power_specifics)); - power->set_url(GURL("https://google.com")); - power->set_power_type(PowerType::POWER_TYPE_MOCK); EXPECT_TRUE(pbdb->CreatePower(std::move(power))); + EXPECT_TRUE(pbdb->UpdatePower(std::move(power2))); + std::vector<std::unique_ptr<Power>> stored_powers = pbdb->GetPowersForURL( GURL("https://google.com"), PowerType::POWER_TYPE_MOCK); EXPECT_EQ(1u, stored_powers.size()); EXPECT_EQ(GURL("https://google.com"), stored_powers[0]->url()); EXPECT_EQ(PowerType::POWER_TYPE_MOCK, stored_powers[0]->power_type()); - // Create called when there is already a Power will perform an update. + // Create called when there is already a Power will fail and return false. stored_powers[0]->set_url(GURL("https://boogle.com")); - EXPECT_TRUE(pbdb->CreatePower(std::move(stored_powers[0]))); + EXPECT_FALSE(pbdb->CreatePower(std::move(stored_powers[0]))); +} + +TEST_F(PowerBookmarkDatabaseImplTest, ShouldNotUpdatePowerIfNotExist) { + std::unique_ptr<PowerBookmarkDatabaseImpl> pbdb = + std::make_unique<PowerBookmarkDatabaseImpl>(db_dir()); + EXPECT_TRUE(pbdb->Init()); + + // Update called when no Power can be found will fail and return false. + EXPECT_FALSE(pbdb->UpdatePower( + MakePower(GURL("https://google.com"), PowerType::POWER_TYPE_MOCK))); + + std::vector<std::unique_ptr<Power>> stored_powers = pbdb->GetPowersForURL( + GURL("https://google.com"), PowerType::POWER_TYPE_MOCK); + EXPECT_EQ(0u, stored_powers.size()); +} + +TEST_F(PowerBookmarkDatabaseImplTest, CreatePowerIfNotExist) { + std::unique_ptr<PowerBookmarkDatabaseImpl> pbdb = + std::make_unique<PowerBookmarkDatabaseImpl>(db_dir()); + EXPECT_TRUE(pbdb->Init()); + + EXPECT_TRUE(pbdb->CreatePower( + MakePower(GURL("https://google.com"), PowerType::POWER_TYPE_MOCK))); + + std::vector<std::unique_ptr<Power>> stored_powers = pbdb->GetPowersForURL( + GURL("https://google.com"), PowerType::POWER_TYPE_MOCK); + EXPECT_EQ(1u, stored_powers.size()); + EXPECT_EQ(GURL("https://google.com"), stored_powers[0]->url()); + EXPECT_EQ(PowerType::POWER_TYPE_MOCK, stored_powers[0]->power_type()); + + // Create called when there is already a Power will fail and return false. + stored_powers[0]->set_url(GURL("https://boogle.com")); + EXPECT_FALSE(pbdb->CreatePower(std::move(stored_powers[0]))); +} + +TEST_F(PowerBookmarkDatabaseImplTest, ShouldNotCreatePowerIfExist) { + std::unique_ptr<PowerBookmarkDatabaseImpl> pbdb = + std::make_unique<PowerBookmarkDatabaseImpl>(db_dir()); + EXPECT_TRUE(pbdb->Init()); + + auto power = + MakePower(GURL("https://google.com"), PowerType::POWER_TYPE_MOCK); + power->set_guid(base::GUID::GenerateRandomV4()); + auto power2 = power->Clone(); + + EXPECT_TRUE(pbdb->CreatePower(std::move(power))); + + EXPECT_FALSE(pbdb->CreatePower(std::move(power2))); + + std::vector<std::unique_ptr<Power>> stored_powers = pbdb->GetPowersForURL( + GURL("https://google.com"), PowerType::POWER_TYPE_MOCK); + EXPECT_EQ(1u, stored_powers.size()); + EXPECT_EQ(GURL("https://google.com"), stored_powers[0]->url()); + EXPECT_EQ(PowerType::POWER_TYPE_MOCK, stored_powers[0]->power_type()); + + // Create called when there is already a Power will fail and return false. + stored_powers[0]->set_url(GURL("https://boogle.com")); + EXPECT_FALSE(pbdb->CreatePower(std::move(stored_powers[0]))); } TEST_F(PowerBookmarkDatabaseImplTest, GetPowersForURL) { @@ -237,13 +287,8 @@ std::make_unique<PowerBookmarkDatabaseImpl>(db_dir()); EXPECT_TRUE(pbdb->Init()); - std::unique_ptr<PowerSpecifics> power_specifics = - std::make_unique<PowerSpecifics>(); - std::unique_ptr<Power> power = - std::make_unique<Power>(std::move(power_specifics)); - power->set_url(GURL("https://google.com")); - power->set_power_type(PowerType::POWER_TYPE_MOCK); - EXPECT_TRUE(pbdb->CreatePower(std::move(power))); + EXPECT_TRUE(pbdb->CreatePower( + MakePower(GURL("https://google.com"), PowerType::POWER_TYPE_MOCK))); std::vector<std::unique_ptr<Power>> stored_powers = pbdb->GetPowersForURL( GURL("https://google.com"), PowerType::POWER_TYPE_MOCK); @@ -257,13 +302,8 @@ std::make_unique<PowerBookmarkDatabaseImpl>(db_dir()); EXPECT_TRUE(pbdb->Init()); - std::unique_ptr<PowerSpecifics> power_specifics = - std::make_unique<PowerSpecifics>(); - std::unique_ptr<Power> power = - std::make_unique<Power>(std::move(power_specifics)); - power->set_url(GURL("https://google.com")); - power->set_power_type(PowerType::POWER_TYPE_MOCK); - EXPECT_TRUE(pbdb->CreatePower(std::move(power))); + EXPECT_TRUE(pbdb->CreatePower( + MakePower(GURL("https://google.com"), PowerType::POWER_TYPE_MOCK))); std::vector<std::unique_ptr<Power>> stored_powers = pbdb->GetPowersForURL( GURL("https://google.com"), PowerType::POWER_TYPE_UNSPECIFIED); @@ -310,25 +350,14 @@ std::make_unique<PowerBookmarkDatabaseImpl>(db_dir()); EXPECT_TRUE(pbdb->Init()); - std::unique_ptr<PowerSpecifics> power_specifics = - std::make_unique<PowerSpecifics>(); - std::unique_ptr<Power> power = - std::make_unique<Power>(std::move(power_specifics)); - power->set_url(GURL("https://google.com")); - power->set_power_type(PowerType::POWER_TYPE_MOCK); - EXPECT_TRUE(pbdb->CreatePower(std::move(power))); + EXPECT_TRUE(pbdb->CreatePower( + MakePower(GURL("https://google.com"), PowerType::POWER_TYPE_MOCK))); - power_specifics = std::make_unique<PowerSpecifics>(); - power = std::make_unique<Power>(std::move(power_specifics)); - power->set_url(GURL("https://google.com")); - power->set_power_type(PowerType::POWER_TYPE_MOCK); - EXPECT_TRUE(pbdb->CreatePower(std::move(power))); + EXPECT_TRUE(pbdb->CreatePower( + MakePower(GURL("https://google.com"), PowerType::POWER_TYPE_MOCK))); - power_specifics = std::make_unique<PowerSpecifics>(); - power = std::make_unique<Power>(std::move(power_specifics)); - power->set_url(GURL("https://boogle.com")); - power->set_power_type(PowerType::POWER_TYPE_MOCK); - EXPECT_TRUE(pbdb->CreatePower(std::move(power))); + EXPECT_TRUE(pbdb->CreatePower( + MakePower(GURL("https://boogle.com"), PowerType::POWER_TYPE_MOCK))); std::vector<std::unique_ptr<PowerOverview>> power_overviews = pbdb->GetPowerOverviewsForType(PowerType::POWER_TYPE_MOCK); @@ -376,13 +405,8 @@ std::make_unique<PowerBookmarkDatabaseImpl>(db_dir()); EXPECT_TRUE(pbdb->Init()); - std::unique_ptr<PowerSpecifics> power_specifics = - std::make_unique<PowerSpecifics>(); - std::unique_ptr<Power> power = - std::make_unique<Power>(std::move(power_specifics)); - power->set_url(GURL("https://google.com")); - power->set_power_type(PowerType::POWER_TYPE_MOCK); - EXPECT_TRUE(pbdb->CreatePower(std::move(power))); + EXPECT_TRUE(pbdb->CreatePower( + MakePower(GURL("https://google.com"), PowerType::POWER_TYPE_MOCK))); std::vector<std::unique_ptr<Power>> stored_powers = pbdb->GetPowersForURL( GURL("https://google.com"), PowerType::POWER_TYPE_MOCK); @@ -401,13 +425,8 @@ std::make_unique<PowerBookmarkDatabaseImpl>(db_dir()); EXPECT_TRUE(pbdb->Init()); - std::unique_ptr<PowerSpecifics> power_specifics = - std::make_unique<PowerSpecifics>(); - std::unique_ptr<Power> power = - std::make_unique<Power>(std::move(power_specifics)); - power->set_url(GURL("https://google.com")); - power->set_power_type(PowerType::POWER_TYPE_MOCK); - EXPECT_TRUE(pbdb->CreatePower(std::move(power))); + EXPECT_TRUE(pbdb->CreatePower( + MakePower(GURL("https://google.com"), PowerType::POWER_TYPE_MOCK))); std::vector<std::unique_ptr<Power>> stored_powers = pbdb->GetPowersForURL( GURL("https://google.com"), PowerType::POWER_TYPE_MOCK); @@ -427,13 +446,8 @@ std::make_unique<PowerBookmarkDatabaseImpl>(db_dir()); EXPECT_TRUE(pbdb->Init()); - std::unique_ptr<PowerSpecifics> power_specifics = - std::make_unique<PowerSpecifics>(); - std::unique_ptr<Power> power = - std::make_unique<Power>(std::move(power_specifics)); - power->set_url(GURL("https://google.com")); - power->set_power_type(PowerType::POWER_TYPE_MOCK); - EXPECT_TRUE(pbdb->CreatePower(std::move(power))); + EXPECT_TRUE(pbdb->CreatePower( + MakePower(GURL("https://google.com"), PowerType::POWER_TYPE_MOCK))); std::vector<std::unique_ptr<Power>> stored_powers = pbdb->GetPowersForURL( GURL("https://google.com"), PowerType::POWER_TYPE_MOCK);
diff --git a/components/reporting/storage/storage.cc b/components/reporting/storage/storage.cc index 8acd2c3..abc10f75 100644 --- a/components/reporting/storage/storage.cc +++ b/components/reporting/storage/storage.cc
@@ -11,7 +11,6 @@ #include "base/barrier_closure.h" #include "base/bind.h" #include "base/callback.h" -#include "base/callback_list.h" #include "base/containers/adapters.h" #include "base/containers/flat_set.h" #include "base/files/file.h" @@ -121,19 +120,26 @@ class Storage::KeyDelivery { public: using RequestCallback = base::OnceCallback<void(Status)>; - explicit KeyDelivery( - UploaderInterface::AsyncStartUploaderCb async_start_upload_cb) - : async_start_upload_cb_(async_start_upload_cb), - sequenced_task_runner_(base::ThreadPool::CreateSequencedTaskRunner( - {base::TaskPriority::BEST_EFFORT, base::MayBlock()})) { - DETACH_FROM_SEQUENCE(sequence_checker_); + + // Factory method, returns smart pointer with deletion on sequence. + static std::unique_ptr<KeyDelivery, base::OnTaskRunnerDeleter> Create( + UploaderInterface::AsyncStartUploaderCb async_start_upload_cb) { + auto sequence_task_runner = base::ThreadPool::CreateSequencedTaskRunner( + {base::TaskPriority::BEST_EFFORT, base::MayBlock()}); + return std::unique_ptr<KeyDelivery, base::OnTaskRunnerDeleter>( + new KeyDelivery(async_start_upload_cb, sequence_task_runner), + base::OnTaskRunnerDeleter(sequence_task_runner)); } - ~KeyDelivery() = default; + ~KeyDelivery() { + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); + PostResponses( + Status(error::UNAVAILABLE, "Key not delivered - Storage shuts down")); + } void Request(RequestCallback callback) { sequenced_task_runner_->PostTask( - FROM_HERE, base::BindOnce(&KeyDelivery::EuqueueRequestAndStart, + FROM_HERE, base::BindOnce(&KeyDelivery::EuqueueRequestAndPossiblyStart, base::Unretained(this), std::move(callback))); } @@ -144,11 +150,20 @@ } private: - void EuqueueRequestAndStart(RequestCallback callback) { + // Constructor called by factory only. + explicit KeyDelivery( + UploaderInterface::AsyncStartUploaderCb async_start_upload_cb, + scoped_refptr<base::SequencedTaskRunner> sequenced_task_runner) + : sequenced_task_runner_(sequenced_task_runner), + async_start_upload_cb_(async_start_upload_cb) { + DETACH_FROM_SEQUENCE(sequence_checker_); + } + + void EuqueueRequestAndPossiblyStart(RequestCallback callback) { DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); + DCHECK(callback); const bool first_call = callbacks_.empty(); - callback_subscriptions_.emplace_back(callbacks_.Add(std::move(callback))); - DCHECK(callback_subscriptions_.back()); + callbacks_.push_back(std::move(callback)); if (!first_call) { // Already started. return; @@ -167,9 +182,10 @@ void PostResponses(Status status) { DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); - callbacks_.Notify(status); - DCHECK(callbacks_.empty()); - callback_subscriptions_.clear(); + for (auto& callback : callbacks_) { + std::move(callback).Run(status); + } + callbacks_.clear(); } static void WrapInstantiatedKeyUploader( @@ -194,18 +210,14 @@ uploader_result.ValueOrDie()->Completed(Status::StatusOK()); } + const scoped_refptr<base::SequencedTaskRunner> sequenced_task_runner_; + SEQUENCE_CHECKER(sequence_checker_); + // Upload provider callback. const UploaderInterface::AsyncStartUploaderCb async_start_upload_cb_; - // List of all request callbacks (protected by |sequenced_task_runner_|). - base::OnceCallbackList<void(Status)> callbacks_ - GUARDED_BY_CONTEXT(sequence_checker_); - std::vector<base::CallbackListSubscription> callback_subscriptions_ - GUARDED_BY_CONTEXT(sequence_checker_); - - const scoped_refptr<base::SequencedTaskRunner> sequenced_task_runner_; - - SEQUENCE_CHECKER(sequence_checker_); + // List of all request callbacks. + std::vector<RequestCallback> callbacks_ GUARDED_BY_CONTEXT(sequence_checker_); }; class Storage::KeyInStorage { @@ -348,7 +360,6 @@ static_cast<int64_t>( new_file_index)) { // Lower index file, will remove // it. - return true; } return false; @@ -628,7 +639,7 @@ UploaderInterface::AsyncStartUploaderCb async_start_upload_cb) : options_(options), encryption_module_(encryption_module), - key_delivery_(std::make_unique<KeyDelivery>(async_start_upload_cb)), + key_delivery_(KeyDelivery::Create(async_start_upload_cb)), compression_module_(compression_module), key_in_storage_(std::make_unique<KeyInStorage>( options.signature_verification_public_key(),
diff --git a/components/reporting/storage/storage.h b/components/reporting/storage/storage.h index 7bdccb4..59297f94 100644 --- a/components/reporting/storage/storage.h +++ b/components/reporting/storage/storage.h
@@ -133,7 +133,7 @@ const scoped_refptr<EncryptionModuleInterface> encryption_module_; // Internal module for initiail key delivery from server. - const std::unique_ptr<KeyDelivery> key_delivery_; + const std::unique_ptr<KeyDelivery, base::OnTaskRunnerDeleter> key_delivery_; // Compression module. const scoped_refptr<CompressionModule> compression_module_;
diff --git a/components/reporting/storage/storage_queue.cc b/components/reporting/storage/storage_queue.cc index bf10972..3efcf1e 100644 --- a/components/reporting/storage/storage_queue.cc +++ b/components/reporting/storage/storage_queue.cc
@@ -17,7 +17,6 @@ #include "base/bind.h" #include "base/callback.h" -#include "base/callback_list.h" #include "base/containers/adapters.h" #include "base/containers/flat_set.h" #include "base/files/file.h" @@ -210,8 +209,9 @@ StorageQueue::~StorageQueue() { DCHECK_CALLED_ON_VALID_SEQUENCE(storage_queue_sequence_checker_); - // Stop upload timer. + // Stop timers. upload_timer_.AbandonAndStop(); + check_back_timer_.AbandonAndStop(); // Make sure no pending writes is present. DCHECK(write_contexts_queue_.empty()); @@ -294,8 +294,9 @@ // if (!options_.upload_period().is_zero() && !options_.upload_period().is_max()) { - upload_timer_.Start(FROM_HERE, options_.upload_period(), this, - &StorageQueue::PeriodicUpload); + upload_timer_.Start(FROM_HERE, options_.upload_period(), + base::BindRepeating(&StorageQueue::PeriodicUpload, + weakptr_factory_.GetWeakPtr())); } // In case some events are found in the queue, initiate an upload. // This is especially imporant for non-periodic queues, but won't harm @@ -1072,10 +1073,14 @@ // retry the upload. if (storage_queue_ && !storage_queue_->options_.upload_retry_delay().is_zero()) { - ScheduleAfter(storage_queue_->options_.upload_retry_delay(), - base::BindOnce( - &StorageQueue::CheckBackUpload, storage_queue_, status, - /*next_sequencing_id=*/sequence_info_.sequencing_id())); + storage_queue_->check_back_timer_.Start( + FROM_HERE, storage_queue_->options_.upload_retry_delay(), + base::BindPostTask( + storage_queue_->sequenced_task_runner_, + base::BindRepeating( + &StorageQueue::CheckBackUpload, + storage_queue_->weakptr_factory_.GetWeakPtr(), status, + /*next_sequencing_id=*/sequence_info_.sequencing_id()))); } }
diff --git a/components/reporting/storage/storage_queue.h b/components/reporting/storage/storage_queue.h index 18b28913..d9085ce 100644 --- a/components/reporting/storage/storage_queue.h +++ b/components/reporting/storage/storage_queue.h
@@ -12,7 +12,6 @@ #include <vector> #include "base/callback.h" -#include "base/callback_list.h" #include "base/containers/flat_map.h" #include "base/containers/flat_set.h" #include "base/feature_list.h" @@ -466,9 +465,15 @@ // All accesses take place on sequenced_task_runner_. int32_t active_read_operations_ = 0; - // Upload timer (active only if options_.upload_period() is not 0). + // Upload timer (active only if options_.upload_period() is not 0 and not + // infinity). base::RepeatingTimer upload_timer_; + // Check back after upload timer (activated after upload has been started + // and options_.upload_retry_delay() is not 0). If already started, it will + // be reset to the new delay. + base::RetainingOneShotTimer check_back_timer_; + // Upload provider callback. const UploaderInterface::AsyncStartUploaderCb async_start_upload_cb_;
diff --git a/components/reporting/storage/storage_queue_unittest.cc b/components/reporting/storage/storage_queue_unittest.cc index f96732c..5b6792a9 100644 --- a/components/reporting/storage/storage_queue_unittest.cc +++ b/components/reporting/storage/storage_queue_unittest.cc
@@ -620,6 +620,8 @@ // TODO(b/254418902): The next line is not logically necessary, but for // unknown reason the tests becomes flaky without it, keeping it for now. task_environment_.RunUntilIdle(); + // All expected uploads should have happened. + EXPECT_THAT(expected_uploads_count_, Eq(0u)); // Make sure all memory is deallocated. EXPECT_THAT(options_.memory_resource()->GetUsed(), Eq(0u)); // Make sure all disk is not reserved (files remain, but Storage is not @@ -788,6 +790,21 @@ ResetTestStorageQueue(); + // Init resume upload upon non-empty queue restart. + test::TestCallbackAutoWaiter waiter; + EXPECT_CALL(set_mock_uploader_expectations_, + Call(Eq(UploaderInterface::UploadReason::INIT_RESUME))) + .WillOnce(Invoke([&waiter, this](UploaderInterface::UploadReason reason) { + return TestUploader::SetUp(&waiter, this) + .Required(0, kData[0]) + .Required(1, kData[1]) + .Required(2, kData[2]) + .Complete(); + })) + .RetiresOnSaturation(); + + // Reopening will cause INIT_RESUME + SetExpectedUploadsCount(); CreateTestStorageQueueOrDie(BuildStorageQueueOptionsPeriodic()); } @@ -799,7 +816,26 @@ ResetTestStorageQueue(); - CreateTestStorageQueueOrDie(BuildStorageQueueOptionsPeriodic()); + // Init resume upload upon non-empty queue restart. + { + test::TestCallbackAutoWaiter waiter; + EXPECT_CALL(set_mock_uploader_expectations_, + Call(Eq(UploaderInterface::UploadReason::INIT_RESUME))) + .WillOnce( + Invoke([&waiter, this](UploaderInterface::UploadReason reason) { + return TestUploader::SetUp(&waiter, this) + .Required(0, kData[0]) + .Required(1, kData[1]) + .Required(2, kData[2]) + .Complete(); + })) + .RetiresOnSaturation(); + + // Reopening will cause INIT_RESUME + SetExpectedUploadsCount(); + CreateTestStorageQueueOrDie(BuildStorageQueueOptionsPeriodic()); + } + WriteStringOrDie(kMoreData[0]); WriteStringOrDie(kMoreData[1]); WriteStringOrDie(kMoreData[2]); @@ -864,8 +900,26 @@ ResetTestStorageQueue(); - // Set uploader expectations. - CreateTestStorageQueueOrDie(BuildStorageQueueOptionsPeriodic()); + // Init resume upload upon non-empty queue restart. + { + test::TestCallbackAutoWaiter waiter; + EXPECT_CALL(set_mock_uploader_expectations_, + Call(Eq(UploaderInterface::UploadReason::INIT_RESUME))) + .WillOnce( + Invoke([&waiter, this](UploaderInterface::UploadReason reason) { + return TestUploader::SetUp(&waiter, this) + .Required(0, kData[0]) + .Required(1, kData[1]) + .Required(2, kData[2]) + .Complete(); + })) + .RetiresOnSaturation(); + + // Reopening will cause INIT_RESUME + SetExpectedUploadsCount(); + CreateTestStorageQueueOrDie(BuildStorageQueueOptionsPeriodic()); + } + WriteStringOrDie(kMoreData[0]); WriteStringOrDie(kMoreData[1]); WriteStringOrDie(kMoreData[2]); @@ -908,8 +962,23 @@ /*recursive=*/false, base::FileEnumerator::FILES, base::StrCat({METADATA_NAME, FILE_PATH_LITERAL(".*")})); - // Reopen, starting a new generation. - CreateTestStorageQueueOrDie(BuildStorageQueueOptionsPeriodic()); + // Avoid init resume upload upon non-empty queue restart. + { + test::TestCallbackAutoWaiter waiter; + EXPECT_CALL(set_mock_uploader_expectations_, + Call(Eq(UploaderInterface::UploadReason::INIT_RESUME))) + .WillOnce(Invoke([&waiter](UploaderInterface::UploadReason reason) { + waiter.Signal(); + return Status(error::UNAVAILABLE, "Skipped upload in test"); + })) + .RetiresOnSaturation(); + + // Reopening will cause INIT_RESUME + SetExpectedUploadsCount(); + // Reopen, starting a new generation. + CreateTestStorageQueueOrDie(BuildStorageQueueOptionsPeriodic()); + } + WriteStringOrDie(kMoreData[0]); WriteStringOrDie(kMoreData[1]); WriteStringOrDie(kMoreData[2]); @@ -966,8 +1035,23 @@ << "Failed to delete " << full_name; } - // Reopen, starting a new generation. - CreateTestStorageQueueOrDie(BuildStorageQueueOptionsPeriodic()); + // Avoid init resume upload upon non-empty queue restart. + { + test::TestCallbackAutoWaiter waiter; + EXPECT_CALL(set_mock_uploader_expectations_, + Call(Eq(UploaderInterface::UploadReason::INIT_RESUME))) + .WillOnce(Invoke([&waiter](UploaderInterface::UploadReason reason) { + waiter.Signal(); + return Status(error::UNAVAILABLE, "Skipped upload in test"); + })) + .RetiresOnSaturation(); + + // Reopening will cause INIT_RESUME + SetExpectedUploadsCount(); + // Reopen, starting a new generation. + CreateTestStorageQueueOrDie(BuildStorageQueueOptionsPeriodic()); + } + WriteStringOrDie(kMoreData[0]); WriteStringOrDie(kMoreData[1]); WriteStringOrDie(kMoreData[2]); @@ -1005,8 +1089,22 @@ ResetTestStorageQueue(); - // Reopen with the same generation and sequencing information. - CreateTestStorageQueueOrDie(BuildStorageQueueOptionsPeriodic()); + // Avoid init resume upload upon non-empty queue restart. + { + test::TestCallbackAutoWaiter waiter; + EXPECT_CALL(set_mock_uploader_expectations_, + Call(Eq(UploaderInterface::UploadReason::INIT_RESUME))) + .WillOnce(Invoke([&waiter](UploaderInterface::UploadReason reason) { + waiter.Signal(); + return Status(error::UNAVAILABLE, "Skipped upload in test"); + })) + .RetiresOnSaturation(); + + // Reopening will cause INIT_RESUME + SetExpectedUploadsCount(); + // Reopen with the same generation and sequencing information. + CreateTestStorageQueueOrDie(BuildStorageQueueOptionsPeriodic()); + } // Delete the data files *.generation.0 EnsureDeletingFiles( @@ -1113,7 +1211,22 @@ ResetTestStorageQueue(); - CreateTestStorageQueueOrDie(BuildStorageQueueOptionsOnlyManual()); + // Avoid init resume upload upon non-empty queue restart. + { + test::TestCallbackAutoWaiter waiter; + EXPECT_CALL(set_mock_uploader_expectations_, + Call(Eq(UploaderInterface::UploadReason::INIT_RESUME))) + .WillOnce(Invoke([&waiter](UploaderInterface::UploadReason reason) { + waiter.Signal(); + return Status(error::UNAVAILABLE, "Skipped upload in test"); + })) + .RetiresOnSaturation(); + + // Reopening will cause INIT_RESUME + SetExpectedUploadsCount(); + CreateTestStorageQueueOrDie(BuildStorageQueueOptionsOnlyManual()); + } + WriteStringOrDie(kMoreData[0]); WriteStringOrDie(kMoreData[1]); WriteStringOrDie(kMoreData[2]); @@ -1388,7 +1501,22 @@ } ResetTestStorageQueue(); - CreateTestStorageQueueOrDie(BuildStorageQueueOptionsPeriodic()); + + // Avoid init resume upload upon non-empty queue restart. + { + test::TestCallbackAutoWaiter waiter; + EXPECT_CALL(set_mock_uploader_expectations_, + Call(Eq(UploaderInterface::UploadReason::INIT_RESUME))) + .WillOnce(Invoke([&waiter](UploaderInterface::UploadReason reason) { + waiter.Signal(); + return Status(error::UNAVAILABLE, "Skipped upload in test"); + })) + .RetiresOnSaturation(); + + // Reopening will cause INIT_RESUME + SetExpectedUploadsCount(); + CreateTestStorageQueueOrDie(BuildStorageQueueOptionsPeriodic()); + } // Add more data and verify that #2 and new data are returned. WriteStringOrDie(kMoreData[0]); @@ -1508,7 +1636,22 @@ } ResetTestStorageQueue(); - CreateTestStorageQueueOrDie(BuildStorageQueueOptionsPeriodic()); + + // Avoid init resume upload upon non-empty queue restart. + { + test::TestCallbackAutoWaiter waiter; + EXPECT_CALL(set_mock_uploader_expectations_, + Call(Eq(UploaderInterface::UploadReason::INIT_RESUME))) + .WillOnce(Invoke([&waiter](UploaderInterface::UploadReason reason) { + waiter.Signal(); + return Status(error::UNAVAILABLE, "Skipped upload in test"); + })) + .RetiresOnSaturation(); + + // Reopening will cause INIT_RESUME + SetExpectedUploadsCount(); + CreateTestStorageQueueOrDie(BuildStorageQueueOptionsPeriodic()); + } // Add more data and verify that #2 and new data are returned. WriteStringOrDie(kMoreData[0]);
diff --git a/components/reporting/storage/storage_unittest.cc b/components/reporting/storage/storage_unittest.cc index 7f5f5b1..8257fe4 100644 --- a/components/reporting/storage/storage_unittest.cc +++ b/components/reporting/storage/storage_unittest.cc
@@ -800,7 +800,6 @@ })); } else { // No attempts to deliver key. - ResetExpectedUploadsCount(); EXPECT_CALL(set_mock_uploader_expectations_, Call(UploaderInterface::UploadReason::KEY_DELIVERY)) .Times(0); @@ -1094,6 +1093,21 @@ ResetTestStorage(); + // Init resume upload upon non-empty queue restart. + test::TestCallbackAutoWaiter waiter; + EXPECT_CALL(set_mock_uploader_expectations_, + Call(Eq(UploaderInterface::UploadReason::INIT_RESUME))) + .WillOnce(Invoke([&waiter, this](UploaderInterface::UploadReason reason) { + return TestUploader::SetUp(FAST_BATCH, &waiter, this) + .Required(0, kData[0]) + .Required(1, kData[1]) + .Required(2, kData[2]) + .Complete(); + })) + .RetiresOnSaturation(); + + // Reopening will cause INIT_RESUME + SetExpectedUploadsCount(); CreateTestStorageOrDie(BuildTestStorageOptions()); } @@ -1105,7 +1119,23 @@ ResetTestStorage(); + // Init resume upload upon non-empty queue restart. + test::TestCallbackAutoWaiter waiter; + EXPECT_CALL(set_mock_uploader_expectations_, + Call(Eq(UploaderInterface::UploadReason::INIT_RESUME))) + .WillOnce(Invoke([&waiter, this](UploaderInterface::UploadReason reason) { + return TestUploader::SetUp(FAST_BATCH, &waiter, this) + .Required(0, kData[0]) + .Required(1, kData[1]) + .Required(2, kData[2]) + .Complete(); + })) + .RetiresOnSaturation(); + + // Reopening will cause INIT_RESUME + SetExpectedUploadsCount(); CreateTestStorageOrDie(BuildTestStorageOptions()); + WriteStringOrDie(FAST_BATCH, kMoreData[0]); WriteStringOrDie(FAST_BATCH, kMoreData[1]); WriteStringOrDie(FAST_BATCH, kMoreData[2]); @@ -1207,7 +1237,26 @@ ResetTestStorage(); - CreateTestStorageOrDie(BuildTestStorageOptions()); + { + // Init resume upload upon non-empty queue restart. + test::TestCallbackAutoWaiter waiter; + EXPECT_CALL(set_mock_uploader_expectations_, + Call(Eq(UploaderInterface::UploadReason::INIT_RESUME))) + .WillOnce( + Invoke([&waiter, this](UploaderInterface::UploadReason reason) { + return TestUploader::SetUp(FAST_BATCH, &waiter, this) + .Required(0, kData[0]) + .Required(1, kData[1]) + .Required(2, kData[2]) + .Complete(); + })) + .RetiresOnSaturation(); + + // Reopening will cause INIT_RESUME + SetExpectedUploadsCount(); + CreateTestStorageOrDie(BuildTestStorageOptions()); + } + WriteStringOrDie(FAST_BATCH, kMoreData[0]); WriteStringOrDie(FAST_BATCH, kMoreData[1]); WriteStringOrDie(FAST_BATCH, kMoreData[2]); @@ -1265,7 +1314,26 @@ ResetTestStorage(); - CreateTestStorageOrDie(BuildTestStorageOptions()); + { + // Init resume upload upon non-empty queue restart. + test::TestCallbackAutoWaiter waiter; + EXPECT_CALL(set_mock_uploader_expectations_, + Call(Eq(UploaderInterface::UploadReason::INIT_RESUME))) + .WillOnce( + Invoke([&waiter, this](UploaderInterface::UploadReason reason) { + return TestUploader::SetUp(MANUAL_BATCH, &waiter, this) + .Required(0, kData[0]) + .Required(1, kData[1]) + .Required(2, kData[2]) + .Complete(); + })) + .RetiresOnSaturation(); + + // Reopening will cause INIT_RESUME + SetExpectedUploadsCount(); + CreateTestStorageOrDie(BuildTestStorageOptions()); + } + WriteStringOrDie(MANUAL_BATCH, kMoreData[0]); WriteStringOrDie(MANUAL_BATCH, kMoreData[1]); WriteStringOrDie(MANUAL_BATCH, kMoreData[2]); @@ -2003,8 +2071,23 @@ ResetTestStorage(); - // Reopen and write more data. - CreateTestStorageOrDie(BuildTestStorageOptions()); + { + // Avoid init resume upload upon non-empty queue restart. + test::TestCallbackAutoWaiter waiter; + EXPECT_CALL(set_mock_uploader_expectations_, + Call(Eq(UploaderInterface::UploadReason::INIT_RESUME))) + .WillOnce(Invoke([&waiter](UploaderInterface::UploadReason reason) { + waiter.Signal(); + return Status(error::UNAVAILABLE, "Skipped upload in test"); + })) + .RetiresOnSaturation(); + + // Reopening will cause INIT_RESUME + SetExpectedUploadsCount(); + CreateTestStorageOrDie(BuildTestStorageOptions()); + } + + // Write more data. WriteStringOrDie(MANUAL_BATCH, kMoreData[0]); WriteStringOrDie(MANUAL_BATCH, kMoreData[1]); WriteStringOrDie(MANUAL_BATCH, kMoreData[2]);
diff --git a/components/reporting/util/refcounted_closure_list.cc b/components/reporting/util/refcounted_closure_list.cc index 3c35d2d5..df60116 100644 --- a/components/reporting/util/refcounted_closure_list.cc +++ b/components/reporting/util/refcounted_closure_list.cc
@@ -7,7 +7,6 @@ #include <memory> #include "base/callback.h" -#include "base/callback_list.h" #include "base/memory/ref_counted.h" #include "base/memory/ref_counted_delete_on_sequence.h" #include "base/memory/scoped_refptr.h" @@ -28,16 +27,17 @@ DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); // Send notification to all registered closures. - callbacks_.Notify(); - DCHECK(callbacks_.empty()); - callback_subscriptions_.clear(); + for (auto& callback : callbacks_) { + std::move(callback).Run(); + } + callbacks_.clear(); } void RefCountedClosureList::RegisterCompletionCallback( base::OnceClosure callback) { DCHECK(callback); DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); - callback_subscriptions_.emplace_back(callbacks_.Add(std::move(callback))); + callbacks_.push_back(std::move(callback)); } } // namespace reporting
diff --git a/components/reporting/util/refcounted_closure_list.h b/components/reporting/util/refcounted_closure_list.h index 2a8f1ad..3834df9 100644 --- a/components/reporting/util/refcounted_closure_list.h +++ b/components/reporting/util/refcounted_closure_list.h
@@ -9,7 +9,6 @@ #include <vector> #include "base/callback.h" -#include "base/callback_list.h" #include "base/memory/ref_counted.h" #include "base/memory/ref_counted_delete_on_sequence.h" #include "base/memory/scoped_refptr.h" @@ -42,8 +41,7 @@ SEQUENCE_CHECKER(sequence_checker_); // List of all completion closures (protected by |sequenced_task_runner_|). - base::OnceClosureList callbacks_ GUARDED_BY_CONTEXT(sequence_checker_); - std::vector<base::CallbackListSubscription> callback_subscriptions_ + std::vector<base::OnceClosure> callbacks_ GUARDED_BY_CONTEXT(sequence_checker_); };
diff --git a/components/reporting/util/refcounted_closure_list_unittest.cc b/components/reporting/util/refcounted_closure_list_unittest.cc index c6113f8b..8de87309 100644 --- a/components/reporting/util/refcounted_closure_list_unittest.cc +++ b/components/reporting/util/refcounted_closure_list_unittest.cc
@@ -54,18 +54,23 @@ std::atomic<size_t> count{num_tasks}; { test::TestCallbackAutoWaiter waiter; - const auto closure_list = base::MakeRefCounted<RefCountedClosureList>( - base::SequencedTaskRunner::GetCurrentDefault()); - closure_list->RegisterCompletionCallback(base::BindOnce( - &test::TestCallbackAutoWaiter::Signal, base::Unretained(&waiter))); - for (size_t t = 0; t < num_tasks; ++t) { - auto worker = std::make_unique<Worker>(&count, closure_list); - base::ThreadPool::PostDelayedTask( - FROM_HERE, {base::TaskPriority::BEST_EFFORT, base::MayBlock()}, - base::BindOnce(&Worker::Run, std::move(worker)), - base::Seconds(1.0 + base::RandDouble())); + + { + const auto closure_list = base::MakeRefCounted<RefCountedClosureList>( + base::SequencedTaskRunnerHandle::Get()); + closure_list->RegisterCompletionCallback(base::BindOnce( + &test::TestCallbackAutoWaiter::Signal, base::Unretained(&waiter))); + for (size_t t = 0; t < num_tasks; ++t) { + auto worker = std::make_unique<Worker>(&count, closure_list); + base::ThreadPool::PostDelayedTask( + FROM_HERE, {base::TaskPriority::BEST_EFFORT, base::MayBlock()}, + base::BindOnce(&Worker::Run, std::move(worker)), + base::Seconds(1.0 + base::RandDouble())); + } + ASSERT_THAT(count.load(), Eq(num_tasks)); + // Drop the original reference to `closure_list`. + // After that only Workers will hold it. } - ASSERT_THAT(count.load(), Eq(num_tasks)); // Forward time to trigger workers to run. task_environment_.FastForwardBy(base::Seconds(2));
diff --git a/components/safe_browsing/content/browser/password_protection/password_protection_request_content.cc b/components/safe_browsing/content/browser/password_protection/password_protection_request_content.cc index e13e8cb..b315f6e 100644 --- a/components/safe_browsing/content/browser/password_protection/password_protection_request_content.cc +++ b/components/safe_browsing/content/browser/password_protection/password_protection_request_content.cc
@@ -36,7 +36,6 @@ #if BUILDFLAG(SAFE_BROWSING_AVAILABLE) // The maximum time to wait for DOM features to be collected, in milliseconds. const int kDomFeatureTimeoutMs = 3000; -#endif // BUILDFLAG(SAFE_BROWSING_AVAILABLE) void ExtractVisualFeaturesAndReplyOnUIThread( const SkBitmap& bitmap, @@ -48,6 +47,7 @@ FROM_HERE, base::BindOnce(std::move(ui_thread_callback), std::move(visual_features))); } +#endif // BUILDFLAG(SAFE_BROWSING_AVAILABLE) } // namespace @@ -256,7 +256,6 @@ SendRequest(); } } -#endif // BUILDFLAG(SAFE_BROWSING_AVAILABLE) void PasswordProtectionRequestContent::CollectVisualFeatures() { content::RenderWidgetHostView* view = @@ -300,6 +299,7 @@ SendRequest(); } +#endif // BUILDFLAG(SAFE_BROWSING_AVAILABLE) #if BUILDFLAG(IS_ANDROID) void PasswordProtectionRequestContent::SetReferringAppInfo() {
diff --git a/components/safe_browsing/content/browser/safe_browsing_navigation_observer.cc b/components/safe_browsing/content/browser/safe_browsing_navigation_observer.cc index 84d23d3..6549c39 100644 --- a/components/safe_browsing/content/browser/safe_browsing_navigation_observer.cc +++ b/components/safe_browsing/content/browser/safe_browsing_navigation_observer.cc
@@ -249,8 +249,7 @@ // activations. content::NavigationEntry* current_entry = web_contents()->GetController().GetLastCommittedEntry(); - if (web_contents()->IsPortal() && - (!current_entry || current_entry->IsInitialEntry())) { + if (web_contents()->IsPortal() && current_entry->IsInitialEntry()) { content::RenderFrameHost* initiator_frame_host = navigation_handle->GetInitiatorFrameToken().has_value() ? content::RenderFrameHost::FromFrameToken(
diff --git a/components/security_interstitials/content/security_interstitial_controller_client.cc b/components/security_interstitials/content/security_interstitial_controller_client.cc index b54db59d..dcf069d6 100644 --- a/components/security_interstitials/content/security_interstitial_controller_client.cc +++ b/components/security_interstitials/content/security_interstitial_controller_client.cc
@@ -115,12 +115,12 @@ bool SecurityInterstitialControllerClient::CanGoBackBeforeNavigation() { // If checking before navigating to the interstitial, back to safety is - // possible if there is already at least one prior entry that is not the - // initial entry. This preserves old behavior to when we return nullptr - // instead of the initial entry when no navigation has committed. - content::NavigationEntry* current_entry = - web_contents_->GetController().GetLastCommittedEntry(); - return current_entry && !current_entry->IsInitialEntry(); + // possible if the current entry is not the initial NavigationEtry. This + // preserves old behavior to when we return nullptr instead of the initial + // entry when no navigation has committed. + return !web_contents_->GetController() + .GetLastCommittedEntry() + ->IsInitialEntry(); } } // namespace security_interstitials
diff --git a/components/security_state/content/content_utils.cc b/components/security_state/content/content_utils.cc index 37d15905..8bfc58fd 100644 --- a/components/security_state/content/content_utils.cc +++ b/components/security_state/content/content_utils.cc
@@ -21,7 +21,7 @@ content::NavigationEntry* entry = web_contents->GetController().GetVisibleEntry(); - if (!entry || entry->IsInitialEntry()) + if (entry->IsInitialEntry()) return state; // Set fields that are not dependent on the connection info. state->is_error_page = entry->GetPageType() == content::PAGE_TYPE_ERROR;
diff --git a/components/segmentation_platform/internal/metadata/metadata_utils_unittest.cc b/components/segmentation_platform/internal/metadata/metadata_utils_unittest.cc index fa3846a..4f13574 100644 --- a/components/segmentation_platform/internal/metadata/metadata_utils_unittest.cc +++ b/components/segmentation_platform/internal/metadata/metadata_utils_unittest.cc
@@ -104,6 +104,20 @@ EXPECT_EQ(metadata_utils::ValidationResult::kValidationSuccess, metadata_utils::ValidateMetadata(metadata)); + // Verifying adding a single `output_label` in metadata. + auto* output_label1 = metadata.add_output_labels(); + output_label1->set_output_label("Share"); + EXPECT_EQ(metadata_utils::ValidationResult::kValidationSuccess, + metadata_utils::ValidateMetadata(metadata)); + EXPECT_EQ(1, metadata.output_labels_size()); + + // Verifying adding another `output_label` in metadata. + auto* output_label2 = metadata.add_output_labels(); + output_label2->set_output_label("Voice"); + EXPECT_EQ(metadata_utils::ValidationResult::kValidationSuccess, + metadata_utils::ValidateMetadata(metadata)); + EXPECT_EQ(2, metadata.output_labels_size()); + proto::VersionInfo* version_info = metadata.mutable_version_info(); version_info->set_metadata_min_version( proto::CurrentVersion::METADATA_VERSION + 1);
diff --git a/components/segmentation_platform/public/proto/model_metadata.proto b/components/segmentation_platform/public/proto/model_metadata.proto index dfbbd91..518ed46 100644 --- a/components/segmentation_platform/public/proto/model_metadata.proto +++ b/components/segmentation_platform/public/proto/model_metadata.proto
@@ -283,9 +283,16 @@ optional uint64 duration = 2; } +// Specified by client in the metadata on how to interpret the model results. +message OutputLabel { + // The label to which this output is associated with. Each OutputLabel + // corresponds to one output. + optional string output_label = 1; +} + // Metadata about a segmentation model for a given segment. Contains information // on how to use the model such as collecting signals, interpreting results etc. -// Next tag: 14 +// Next tag: 16 message SegmentationModelMetadata { // The version information needed to validate segmentation models. optional VersionInfo version_info = 9; @@ -368,5 +375,10 @@ // Model returns any integer value. RETURN_TYPE_INTEGER = 4; } + // TODO(ritikagup@): Move the field inside OutputLabel. optional OutputDescription return_type = 14; + + // List of output labels, each label is attached to one of the output result + // of the model, describing what that output signify. + repeated OutputLabel output_labels = 15; }
diff --git a/components/services/app_service/public/cpp/features.cc b/components/services/app_service/public/cpp/features.cc index 2ded2dd3..c7f2df2 100644 --- a/components/services/app_service/public/cpp/features.cc +++ b/components/services/app_service/public/cpp/features.cc
@@ -26,4 +26,8 @@ "UnifiedAppServiceIconLoading", base::FEATURE_DISABLED_BY_DEFAULT); +BASE_FEATURE(kAppServiceStorage, + "AppServiceStorage", + base::FEATURE_DISABLED_BY_DEFAULT); + } // namespace apps
diff --git a/components/services/app_service/public/cpp/features.h b/components/services/app_service/public/cpp/features.h index b6326a3..615540b 100644 --- a/components/services/app_service/public/cpp/features.h +++ b/components/services/app_service/public/cpp/features.h
@@ -17,6 +17,7 @@ BASE_DECLARE_FEATURE(kAppServiceCapabilityAccessWithoutMojom); COMPONENT_EXPORT(APP_TYPES) BASE_DECLARE_FEATURE(kStopMojomAppService); COMPONENT_EXPORT(APP_TYPES) BASE_DECLARE_FEATURE(kUnifiedAppServiceIconLoading); +COMPONENT_EXPORT(APP_TYPES) BASE_DECLARE_FEATURE(kAppServiceStorage); } // namespace apps
diff --git a/components/translate/content/browser/content_translate_driver.cc b/components/translate/content/browser/content_translate_driver.cc index 3bbc2d6..fb24526 100644 --- a/components/translate/content/browser/content_translate_driver.cc +++ b/components/translate/content/browser/content_translate_driver.cc
@@ -108,8 +108,7 @@ // TranslateDriver methods bool ContentTranslateDriver::IsLinkNavigation() { - return web_contents()->GetController().GetLastCommittedEntry() && - ui::PageTransitionCoreTypeIs(web_contents() + return ui::PageTransitionCoreTypeIs(web_contents() ->GetController() .GetLastCommittedEntry() ->GetTransitionType(), @@ -172,9 +171,10 @@ // TODO(https://crbug.com/524208): This function used to check the existence // of GetLastCommittedEntry(), which will always exist now. Consider removing // this function, making the callers assume HasCurrentPage() is always true. - content::NavigationEntry* current_entry = - web_contents()->GetController().GetLastCommittedEntry(); - return current_entry && !current_entry->IsInitialEntry(); + return !web_contents() + ->GetController() + .GetLastCommittedEntry() + ->IsInitialEntry(); } void ContentTranslateDriver::OpenUrlInNewTab(const GURL& url) { @@ -341,8 +341,7 @@ // associated, thus avoiding the potential for corner cases where the // detected language is attributed to the wrong page. auto* const entry = web_contents()->GetController().GetLastCommittedEntry(); - if (entry != nullptr) - SetPageLanguageInNavigation(details.adopted_language, entry); + SetPageLanguageInNavigation(details.adopted_language, entry); } for (auto& observer : language_detection_observers())
diff --git a/components/viz/common/resources/resource_format_utils.cc b/components/viz/common/resources/resource_format_utils.cc index 19e898b2..b3e0f750 100644 --- a/components/viz/common/resources/resource_format_utils.cc +++ b/components/viz/common/resources/resource_format_utils.cc
@@ -608,55 +608,4 @@ format.resource_format()); } -int BitsPerPixel(SharedImageFormat format) { - return BitsPerPixel(format.resource_format()); -} - -unsigned int GLDataType(SharedImageFormat format) { - return GLDataType(format.resource_format()); -} - -unsigned int GLDataFormat(SharedImageFormat format) { - return GLDataFormat(format.resource_format()); -} - -unsigned int GLInternalFormat(SharedImageFormat format) { - return GLInternalFormat(format.resource_format()); -} - -gfx::BufferFormat BufferFormat(SharedImageFormat format) { - return BufferFormat(format.resource_format()); -} - -unsigned int TextureStorageFormat(SharedImageFormat format, - bool use_angle_rgbx_format) { - return TextureStorageFormat(format.resource_format(), use_angle_rgbx_format); -} - -bool IsGpuMemoryBufferFormatSupported(SharedImageFormat format) { - return IsGpuMemoryBufferFormatSupported(format.resource_format()); -} - -bool GLSupportsFormat(SharedImageFormat format) { - return GLSupportsFormat(format.resource_format()); -} - -#if BUILDFLAG(ENABLE_VULKAN) -bool HasVkFormat(SharedImageFormat format) { - return HasVkFormat(format.resource_format()); -} - -VkFormat ToVkFormat(SharedImageFormat format) { - return ToVkFormat(format.resource_format()); -} -#endif - -wgpu::TextureFormat ToDawnFormat(SharedImageFormat format) { - return ToDawnFormat(format.resource_format()); -} - -WGPUTextureFormat ToWGPUFormat(SharedImageFormat format) { - return ToWGPUFormat(format.resource_format()); -} - } // namespace viz
diff --git a/components/viz/common/resources/resource_format_utils.h b/components/viz/common/resources/resource_format_utils.h index bddbfb5..fadc8e6 100644 --- a/components/viz/common/resources/resource_format_utils.h +++ b/components/viz/common/resources/resource_format_utils.h
@@ -82,50 +82,12 @@ VIZ_RESOURCE_FORMAT_EXPORT unsigned int ToMTLPixelFormat(ResourceFormat format); #endif -// Overload all above functions with SharedImageFormat in place of -// ResourceFormat. // WARNING: The `format` must be single planar. -// TODO(hitawala): Add multiplanar format support. Also, move util functions -// that are not needed by clients to SharedImageFormat. - +// TODO(hitawala): Add multiplanar format support. VIZ_RESOURCE_FORMAT_EXPORT SkColorType ResourceFormatToClosestSkColorType(bool gpu_compositing, SharedImageFormat format); -VIZ_RESOURCE_FORMAT_EXPORT int BitsPerPixel(SharedImageFormat format); - -VIZ_RESOURCE_FORMAT_EXPORT unsigned int GLDataType(SharedImageFormat format); -VIZ_RESOURCE_FORMAT_EXPORT unsigned int GLDataFormat(SharedImageFormat format); -VIZ_RESOURCE_FORMAT_EXPORT unsigned int GLInternalFormat( - SharedImageFormat format); - -VIZ_RESOURCE_FORMAT_EXPORT gfx::BufferFormat BufferFormat( - SharedImageFormat format); - -VIZ_RESOURCE_FORMAT_EXPORT unsigned int TextureStorageFormat( - SharedImageFormat format, - bool use_angle_rgbx_format); - -VIZ_RESOURCE_FORMAT_EXPORT bool IsGpuMemoryBufferFormatSupported( - SharedImageFormat format); - -VIZ_RESOURCE_FORMAT_EXPORT bool GLSupportsFormat(SharedImageFormat format); - -#if BUILDFLAG(ENABLE_VULKAN) -VIZ_RESOURCE_FORMAT_EXPORT bool HasVkFormat(SharedImageFormat format); -VIZ_RESOURCE_FORMAT_EXPORT VkFormat ToVkFormat(SharedImageFormat format); -#endif - -VIZ_RESOURCE_FORMAT_EXPORT wgpu::TextureFormat ToDawnFormat( - SharedImageFormat format); -VIZ_RESOURCE_FORMAT_EXPORT WGPUTextureFormat -ToWGPUFormat(SharedImageFormat format); - -#if BUILDFLAG(IS_APPLE) -VIZ_RESOURCE_FORMAT_EXPORT unsigned int ToMTLPixelFormat( - SharedImageFormat format); -#endif - } // namespace viz #endif // COMPONENTS_VIZ_COMMON_RESOURCES_RESOURCE_FORMAT_UTILS_H_
diff --git a/components/viz/common/resources/resource_format_utils_mac.mm b/components/viz/common/resources/resource_format_utils_mac.mm index 4b5503a..bac768e 100644 --- a/components/viz/common/resources/resource_format_utils_mac.mm +++ b/components/viz/common/resources/resource_format_utils_mac.mm
@@ -34,8 +34,4 @@ return static_cast<unsigned int>(mtl_pixel_format); } -unsigned int ToMTLPixelFormat(SharedImageFormat format) { - return ToMTLPixelFormat(format.resource_format()); -} - } // namespace viz
diff --git a/components/viz/test/DEPS b/components/viz/test/DEPS index 7087ae69..b4962fe8 100644 --- a/components/viz/test/DEPS +++ b/components/viz/test/DEPS
@@ -21,6 +21,7 @@ "+gpu/command_buffer/common/skia_utils.h", "+gpu/command_buffer/common/sync_token.h", "+gpu/command_buffer/service/image_factory.h", + "+gpu/command_buffer/service/shared_image/shared_image_format_utils.h", "+gpu/config/gpu_feature_info.h", "+gpu/config/skia_limits.h", "+gpu/GLES2",
diff --git a/components/viz/test/fake_skia_output_surface.cc b/components/viz/test/fake_skia_output_surface.cc index 05eb15c3..6418972 100644 --- a/components/viz/test/fake_skia_output_surface.cc +++ b/components/viz/test/fake_skia_output_surface.cc
@@ -21,6 +21,7 @@ #include "gpu/GLES2/gl2extchromium.h" #include "gpu/command_buffer/common/mailbox_holder.h" #include "gpu/command_buffer/common/shared_image_usage.h" +#include "gpu/command_buffer/service/shared_image/shared_image_format_utils.h" #include "third_party/khronos/GLES2/gl2ext.h" #include "third_party/skia/include/core/SkPixelRef.h" #include "third_party/skia/include/gpu/GrBackendSurface.h" @@ -351,7 +352,7 @@ image_context.mailbox_holder().sync_token.GetConstData()); auto texture_id = gl->CreateAndTexStorage2DSharedImageCHROMIUM( image_context.mailbox_holder().mailbox.name); - auto gl_format = TextureStorageFormat( + auto gl_format = gpu::TextureStorageFormat( image_context.format(), context_provider()->ContextCapabilities().angle_rgbx_internal_format); GrGLTextureInfo gl_texture_info = {
diff --git a/content/browser/child_process_launcher_browsertest.cc b/content/browser/child_process_launcher_browsertest.cc index a736572..2f6f5bd 100644 --- a/content/browser/child_process_launcher_browsertest.cc +++ b/content/browser/child_process_launcher_browsertest.cc
@@ -73,7 +73,7 @@ NavigationEntry* last_entry = shell()->web_contents()->GetController().GetLastCommittedEntry(); // Make sure we didn't commit any navigation. - EXPECT_TRUE(!last_entry || last_entry->IsInitialEntry()); + EXPECT_TRUE(last_entry->IsInitialEntry()); // Navigate again and let the process spawn correctly. TestNavigationObserver nav_observer2(window->web_contents(), 1);
diff --git a/content/browser/content_security_policy_browsertest.cc b/content/browser/content_security_policy_browsertest.cc index 778ac22..eda8730c 100644 --- a/content/browser/content_security_policy_browsertest.cc +++ b/content/browser/content_security_policy_browsertest.cc
@@ -12,7 +12,6 @@ #include "content/public/browser/content_browser_client.h" #include "content/public/common/content_client.h" #include "content/public/common/content_paths.h" -#include "content/public/common/content_switches.h" #include "content/public/test/browser_test.h" #include "content/public/test/content_browser_test.h" #include "content/public/test/content_browser_test_utils.h" @@ -290,21 +289,21 @@ EXPECT_FALSE(current_frame_host()->child_at(0)->csp_attribute()); } +namespace { +const char kAppHost[] = "app.com"; +const char kNonAppHost[] = "other.com"; +} // namespace + class IsolatedWebAppContentBrowserClient : public ContentBrowserClient { public: bool ShouldUrlUseApplicationIsolationLevel( BrowserContext* browser_context, const GURL& url, bool origin_matches_flag) override { - return origin_matches_flag; + return url.host() == kAppHost; } }; -namespace { -const char kAppHost[] = "app.com"; -const char kNonAppHost[] = "other.com"; -} // namespace - class ContentSecurityPolicyIsolatedAppBrowserTest : public ContentSecurityPolicyBrowserTest { public: @@ -314,30 +313,33 @@ void SetUpCommandLine(base::CommandLine* command_line) override { ContentSecurityPolicyBrowserTest::SetUpCommandLine(command_line); mock_cert_verifier_.SetUpCommandLine(command_line); - command_line->AppendSwitchASCII(switches::kIsolatedAppOrigins, - std::string("https://") + kAppHost); } void SetUpInProcessBrowserTestFixture() override { ContentSecurityPolicyBrowserTest::SetUpInProcessBrowserTestFixture(); mock_cert_verifier_.SetUpInProcessBrowserTestFixture(); - old_client_ = SetBrowserClientForTesting(&client_); } void TearDownInProcessBrowserTestFixture() override { - SetBrowserClientForTesting(old_client_); mock_cert_verifier_.TearDownInProcessBrowserTestFixture(); ContentSecurityPolicyBrowserTest::TearDownInProcessBrowserTestFixture(); } void SetUpOnMainThread() override { ContentSecurityPolicyBrowserTest::SetUpOnMainThread(); + old_client_ = SetBrowserClientForTesting(&client_); + host_resolver()->AddRule("*", "127.0.0.1"); mock_cert_verifier_.mock_cert_verifier()->set_default_result(net::OK); https_server()->ServeFilesFromSourceDirectory(GetTestDataFilePath()); ASSERT_TRUE(https_server()->Start()); } + void TearDownOnMainThread() override { + SetBrowserClientForTesting(old_client_); + ContentSecurityPolicyBrowserTest::TearDownOnMainThread(); + } + protected: net::EmbeddedTestServer* https_server() { return &https_server_; }
diff --git a/content/browser/isolated_origin_browsertest.cc b/content/browser/isolated_origin_browsertest.cc index da4a4511..4b7e8704 100644 --- a/content/browser/isolated_origin_browsertest.cc +++ b/content/browser/isolated_origin_browsertest.cc
@@ -2430,11 +2430,11 @@ ->GetIsolationContext(), isolated_origin, MakeOACIsolationState(false)) .requires_origin_keyed_process()); - // Verify that the tab2 child frame is on the initial NavigationEntry (or - // has no NavigationEntry if InitialNavigationEntry is disabled). - NavigationEntry* current_entry = - tab2_shell->web_contents()->GetController().GetLastCommittedEntry(); - EXPECT_TRUE(!current_entry || current_entry->IsInitialEntry()); + // Verify that the tab2 child frame is on the initial NavigationEntry. + EXPECT_TRUE(tab2_shell->web_contents() + ->GetController() + .GetLastCommittedEntry() + ->IsInitialEntry()); // Now, create a second frame in tab2 and navigate it to // `isolated_origin_url`. Even though isolation is requested, it should not
diff --git a/content/browser/portal/portal.cc b/content/browser/portal/portal.cc index 22be9232..9f5b143f 100644 --- a/content/browser/portal/portal.cc +++ b/content/browser/portal/portal.cc
@@ -524,8 +524,7 @@ // If no navigation has yet committed in the portal, it cannot be activated as // this would lead to an empty tab contents (without even an about:blank). - if (!portal_controller.GetLastCommittedEntry() || - portal_controller.GetLastCommittedEntry()->IsInitialEntry()) { + if (portal_controller.GetLastCommittedEntry()->IsInitialEntry()) { return std::make_pair( false, blink::mojom::PortalActivateResult::kRejectedDueToPortalNotReady);
diff --git a/content/browser/renderer_host/blocked_scheme_navigation_browsertest.cc b/content/browser/renderer_host/blocked_scheme_navigation_browsertest.cc index 6ab25e7..ee06c43 100644 --- a/content/browser/renderer_host/blocked_scheme_navigation_browsertest.cc +++ b/content/browser/renderer_host/blocked_scheme_navigation_browsertest.cc
@@ -454,9 +454,10 @@ EXPECT_TRUE( new_shell->web_contents()->GetLastCommittedURL().spec().empty()); // No navigation should commit. - NavigationEntry* current_entry = - new_shell->web_contents()->GetController().GetLastCommittedEntry(); - EXPECT_TRUE(!current_entry || current_entry->IsInitialEntry()); + EXPECT_TRUE(new_shell->web_contents() + ->GetController() + .GetLastCommittedEntry() + ->IsInitialEntry()); // Original page shouldn't navigate away. EXPECT_EQ(original_url, shell()->web_contents()->GetLastCommittedURL()); }
diff --git a/content/browser/renderer_host/isolated_web_app_throttle_browsertest.cc b/content/browser/renderer_host/isolated_web_app_throttle_browsertest.cc index 72cbd5de..71d41d90 100644 --- a/content/browser/renderer_host/isolated_web_app_throttle_browsertest.cc +++ b/content/browser/renderer_host/isolated_web_app_throttle_browsertest.cc
@@ -8,7 +8,6 @@ #include "content/public/browser/render_frame_host.h" #include "content/public/common/content_client.h" #include "content/public/common/content_features.h" -#include "content/public/common/content_switches.h" #include "content/public/test/browser_test.h" #include "content/public/test/browser_test_utils.h" #include "content/public/test/content_browser_test.h" @@ -46,7 +45,7 @@ BrowserContext* browser_context, const GURL& url, bool origin_matches_flag) override { - return origin_matches_flag; + return url.host() == kAppHost; } private: @@ -64,8 +63,6 @@ void SetUpCommandLine(base::CommandLine* command_line) override { ContentBrowserTest::SetUpCommandLine(command_line); mock_cert_verifier_.SetUpCommandLine(command_line); - command_line->AppendSwitchASCII(switches::kIsolatedAppOrigins, - std::string("https://") + kAppHost); } void SetUpInProcessBrowserTestFixture() override {
diff --git a/content/browser/renderer_host/navigation_controller_impl.cc b/content/browser/renderer_host/navigation_controller_impl.cc index e80a94e13..5e36c661 100644 --- a/content/browser/renderer_host/navigation_controller_impl.cc +++ b/content/browser/renderer_host/navigation_controller_impl.cc
@@ -184,7 +184,7 @@ if (should_replace_current_entry) return false; // Only convert to reload if at least one navigation committed. - if (!last_committed_entry || last_committed_entry->IsInitialEntry()) + if (last_committed_entry->IsInitialEntry()) return false; // Skip navigations initiated by external applications. @@ -1012,13 +1012,13 @@ int NavigationControllerImpl::GetLastCommittedEntryIndex() { // The last committed entry index must always be less than the number of - // entries. If there are no entries, it must be -1. + // entries. DCHECK_LT(last_committed_entry_index_, GetEntryCount()); - DCHECK(GetEntryCount() || last_committed_entry_index_ == -1); return last_committed_entry_index_; } int NavigationControllerImpl::GetEntryCount() { + DCHECK_GE(entries_.size(), 1u); DCHECK_LE(entries_.size(), max_entry_count()); return static_cast<int>(entries_.size()); } @@ -1317,69 +1317,42 @@ // Save the previous state before we clobber it. bool overriding_user_agent_changed = false; - if (GetLastCommittedEntry()) { - if (entry_replaced_by_post_commit_error_) { - // Same document navigation events with a post-commit error should already - // be blocked by RenderFrameHostImpl::ValidateDidCommitParams() before - // reaching here. - CHECK(!is_same_document_navigation); + if (entry_replaced_by_post_commit_error_) { + // Same document navigation events with a post-commit error should already + // be blocked by RenderFrameHostImpl::ValidateDidCommitParams() before + // reaching here. + CHECK(!is_same_document_navigation); - // Any commit while a post-commit error page is showing should put the - // original entry back, replacing the error page's entry. This includes - // reloads, where the original entry was used as the pending entry and - // should now be at the correct index at commit time. - entries_[last_committed_entry_index_] = - std::move(entry_replaced_by_post_commit_error_); - } - details->previous_main_frame_url = GetLastCommittedEntry()->GetURL(); - details->previous_entry_index = GetLastCommittedEntryIndex(); - if (PendingEntryMatchesRequest(navigation_request) && - pending_entry_->GetIsOverridingUserAgent() != - GetLastCommittedEntry()->GetIsOverridingUserAgent()) { - overriding_user_agent_changed = true; - } -#if BUILDFLAG(IS_ANDROID) - // TODO(crbug.com/1266277): Clean up the logic of setting - // |overriding_user_agent_changed| post-launch. - if (base::FeatureList::IsEnabled(features::kRequestDesktopSiteExceptions) || - base::FeatureList::IsEnabled(features::kRequestDesktopSiteAdditions)) { - // Must honor user agent overrides in the |navigation_request|, such as - // from things like RequestDesktopSiteWebContentsObserverAndroid. As a - // result, besides comparing |pending_entry_|'s user agent against - // LastCommittedEntry's, also need to compare |navigation_request|'s user - // agent against LastCommittedEntry's. - if (navigation_request->is_overriding_user_agent() != - GetLastCommittedEntry()->GetIsOverridingUserAgent()) { - overriding_user_agent_changed = true; - } - } -#endif // BUILDFLAG(IS_ANDROID) - } else { - // GetLastCommittedEntry() is null, so this is the first entry. - details->previous_main_frame_url = GURL(); - details->previous_entry_index = -1; - if (PendingEntryMatchesRequest(navigation_request) && - pending_entry_->GetIsOverridingUserAgent()) { - // Default setting is NOT override the user agent, so overriding the user - // agent in first entry should be considered as user agent changed as - // well. - overriding_user_agent_changed = true; - } -#if BUILDFLAG(IS_ANDROID) - // TODO(crbug.com/1266277): Clean up the logic of setting - // |overriding_user_agent_changed| post-launch. - if (base::FeatureList::IsEnabled(features::kRequestDesktopSiteExceptions) || - base::FeatureList::IsEnabled(features::kRequestDesktopSiteAdditions)) { - // Must honor user agent overrides in the |navigation_request|, such as - // from things like RequestDesktopSiteWebContentsObserverAndroid. As a - // result, besides checking |pending_entry_|'s user agent, also need to - // check |navigation_request|'s. - if (navigation_request->is_overriding_user_agent()) { - overriding_user_agent_changed = true; - } - } -#endif // BUILDFLAG(IS_ANDROID) + // Any commit while a post-commit error page is showing should put the + // original entry back, replacing the error page's entry. This includes + // reloads, where the original entry was used as the pending entry and + // should now be at the correct index at commit time. + entries_[last_committed_entry_index_] = + std::move(entry_replaced_by_post_commit_error_); } + details->previous_main_frame_url = GetLastCommittedEntry()->GetURL(); + details->previous_entry_index = GetLastCommittedEntryIndex(); + if (PendingEntryMatchesRequest(navigation_request) && + pending_entry_->GetIsOverridingUserAgent() != + GetLastCommittedEntry()->GetIsOverridingUserAgent()) { + overriding_user_agent_changed = true; + } +#if BUILDFLAG(IS_ANDROID) + // TODO(crbug.com/1266277): Clean up the logic of setting + // |overriding_user_agent_changed| post-launch. + if (base::FeatureList::IsEnabled(features::kRequestDesktopSiteExceptions) || + base::FeatureList::IsEnabled(features::kRequestDesktopSiteAdditions)) { + // Must honor user agent overrides in the |navigation_request|, such as + // from things like RequestDesktopSiteWebContentsObserverAndroid. As a + // result, besides comparing |pending_entry_|'s user agent against + // LastCommittedEntry's, also need to compare |navigation_request|'s user + // agent against LastCommittedEntry's. + if (navigation_request->is_overriding_user_agent() != + GetLastCommittedEntry()->GetIsOverridingUserAgent()) { + overriding_user_agent_changed = true; + } + } +#endif // BUILDFLAG(IS_ANDROID) bool is_main_frame_navigation = !rfh->GetParent(); @@ -1399,10 +1372,8 @@ } // Notify the last active entry that we have navigated away. if (is_main_frame_navigation && !is_same_document_navigation) { - if (NavigationEntryImpl* navigation_entry = GetLastCommittedEntry()) { - if (auto* metrics = navigation_entry->back_forward_cache_metrics()) { - metrics->MainFrameDidNavigateAwayFromDocument(); - } + if (auto* metrics = GetLastCommittedEntry()->back_forward_cache_metrics()) { + metrics->MainFrameDidNavigateAwayFromDocument(); } } @@ -1447,8 +1418,7 @@ // Do navigation-type specific actions. These will make and commit an entry. details->type = ClassifyNavigation(rfh, params, navigation_request); - if (ShouldMaintainTrivialSessionHistory(rfh->frame_tree_node()) && - GetLastCommittedEntry()) { + if (ShouldMaintainTrivialSessionHistory(rfh->frame_tree_node())) { // Ensure that this navigation does not add a navigation entry, since // ShouldMaintainTrivialSessionHistory() means we should not add an entry // beyond the last committed one. Therefore, `should_replace_current_entry` @@ -1464,7 +1434,7 @@ details->type == NAVIGATION_TYPE_AUTO_SUBFRAME); } - if (GetLastCommittedEntry() && GetLastCommittedEntry()->IsInitialEntry()) { + if (GetLastCommittedEntry()->IsInitialEntry()) { if (rfh->GetParent()) { // This is a subframe navigation on the initial empty document, which used // to not have a NavigationEntry to attach to. Now it can attach to the @@ -1731,8 +1701,7 @@ // inert, and thus set params.did_create_new_entry to false. In that case, // we must treat it as NEW rather than the converted reload case below, // since the new SiteInstance doesn't match the last committed entry. - if (!GetLastCommittedEntry() || - GetLastCommittedEntry()->site_instance() != rfh->GetSiteInstance()) { + if (GetLastCommittedEntry()->site_instance() != rfh->GetSiteInstance()) { trace_return.set_return_reason("new pending, new entry"); return NAVIGATION_TYPE_MAIN_FRAME_NEW_ENTRY; } @@ -1748,13 +1717,6 @@ } } - // Everything below here is assumed to be an existing entry, but if there is - // no last committed entry, we must consider it a new navigation instead. - if (!GetLastCommittedEntry()) { - trace_return.set_return_reason("no last committed, new entry"); - return NAVIGATION_TYPE_MAIN_FRAME_NEW_ENTRY; - } - if (navigation_request->commit_params().intended_as_new_entry) { // This was intended to be a navigation to a new entry but the pending entry // got cleared in the meanwhile. Classify as EXISTING_ENTRY because we may @@ -1933,7 +1895,7 @@ // First check if this is an in-page navigation. If so, clone the current // entry instead of looking at the pending entry, because the pending entry // does not have any subframe history items. - if (is_same_document && GetLastCommittedEntry()) { + if (is_same_document) { FrameNavigationEntry* previous_frame_entry = GetLastCommittedEntry()->GetFrameEntry(rfh->frame_tree_node()); auto frame_entry = base::MakeRefCounted<FrameNavigationEntry>( @@ -2041,7 +2003,7 @@ // history.pushState() is classified as a navigation to a new page, but sets // is_same_document to true. In this case, we already have the title and // favicon available, so set them immediately. - if (is_same_document && GetLastCommittedEntry()) { + if (is_same_document) { new_entry->SetTitle(GetLastCommittedEntry()->GetTitle()); new_entry->GetFavicon() = GetLastCommittedEntry()->GetFavicon(); } @@ -2094,7 +2056,6 @@ // We're guaranteed to have a last committed entry if intended_as_new_entry // is true. entry = GetLastCommittedEntry(); - DCHECK(entry); // If the NavigationRequest matches a new pending entry and is classified as // EXISTING_ENTRY, then it is a navigation to the same URL that was @@ -2343,8 +2304,6 @@ // This may be a "new auto" case where we add a new FrameNavigationEntry, or // it may be a "history auto" case where we update an existing one. - NavigationEntryImpl* last_committed = GetLastCommittedEntry(); - // We may want to update |last_committed|'s FrameNavigationEntry (if one // exists), or we may want to clobber it and create a new one. We update in // cases where the corresponding FrameNavigationEntry is conceptually similar @@ -2368,6 +2327,7 @@ // to a navigation in another frame), we want to make sure we overwrite the // initial empty document state everywhere this FrameNavigationEntry is used, // which is accompished by updating the existing FrameNavigationEntry. + NavigationEntryImpl* last_committed = GetLastCommittedEntry(); FrameNavigationEntry* last_committed_frame_entry = last_committed->GetFrameEntry(rfh->frame_tree_node()); NavigationEntryImpl::UpdatePolicy update_policy = @@ -2406,10 +2366,6 @@ DCHECK(!GetPendingEntry()); entries_.clear(); - if (source->GetEntryCount() == 0) { - return; - } - needs_reload_ = needs_reload; needs_reload_type_ = NeedsReloadType::kCopyStateFrom; InsertEntriesFrom(source, source->GetEntryCount()); @@ -2595,10 +2551,6 @@ // When a user activation occurs, ensure that all adjacent entries for the // same document clear their skippable bit, so that the history manipulation // intervention does not apply to them. - auto* last_committed_entry = GetLastCommittedEntry(); - if (!last_committed_entry) - return; - if (base::FeatureList::IsEnabled( features::kDebugHistoryInterventionNoUserActivation)) { return; @@ -2713,24 +2665,9 @@ std::unique_ptr<NavigationEntryImpl> entry; if (!render_frame_host->is_main_frame()) { // Subframe case: create FrameNavigationEntry. - if (GetLastCommittedEntry()) { - entry = GetLastCommittedEntry()->Clone(); - entry->set_extra_headers(extra_headers); - // TODO(arthursonzogni): What about |is_renderer_initiated|? - // Renderer-initiated navigation that target a remote frame are currently - // classified as browser-initiated when this one has already navigated. - // See https://crbug.com/722251. - } else { - // If there's no last committed entry, create an entry for about:blank - // with a subframe entry for our destination. - // TODO(creis): Ensure this case can't exist in https://crbug.com/524208. - entry = NavigationEntryImpl::FromNavigationEntry(CreateNavigationEntry( - GURL(url::kAboutBlankURL), referrer, initiator_origin, - source_site_instance, page_transition, is_renderer_initiated, - extra_headers, browser_context_, - nullptr /* blob_url_loader_factory */, - false /* rewrite_virtual_urls */)); - } + DCHECK(GetLastCommittedEntry()); + entry = GetLastCommittedEntry()->Clone(); + entry->set_extra_headers(extra_headers); // TODO(arthursonzogni): What about |is_renderer_initiated|? // Renderer-initiated navigation that target a remote frame are currently // classified as browser-initiated when this one has already navigated. @@ -2766,8 +2703,7 @@ } bool override_user_agent = false; - if (GetLastCommittedEntry() && - GetLastCommittedEntry()->GetIsOverridingUserAgent()) { + if (GetLastCommittedEntry()->GetIsOverridingUserAgent()) { entry->SetIsOverridingUserAgent(true); override_user_agent = true; } @@ -2868,9 +2804,7 @@ } bool NavigationControllerImpl::IsUnmodifiedBlankTab() { - return IsInitialNavigation() && - (!GetLastCommittedEntry() || - GetLastCommittedEntry()->IsInitialEntry()) && + return IsInitialNavigation() && GetLastCommittedEntry()->IsInitialEntry() && !frame_tree_->has_accessed_initial_main_document(); } @@ -2959,9 +2893,7 @@ int NavigationControllerImpl::GetPendingEntryIndex() { // The pending entry index must always be less than the number of entries. - // If there are no entries, it must be exactly -1. DCHECK_LT(pending_entry_index_, GetEntryCount()); - DCHECK(GetEntryCount() != 0 || pending_entry_index_ == -1); return pending_entry_index_; } @@ -2996,7 +2928,7 @@ DiscardNonCommittedEntriesWithCommitDetails(commit_details); // When replacing, don't prune the forward history. - if ((replace || was_post_commit_error) && entries_.size() > 0) { + if (replace || was_post_commit_error) { CopyReplacedNavigationEntryDataIfPreviouslyEmpty( entries_[last_committed_entry_index_].get(), entry.get()); // If the new entry is a post-commit error page, we store the current last @@ -3289,15 +3221,6 @@ } } - // If there's no last committed entry, there is no previous history entry to - // compare against, so fall back to a different-document load. Note that we - // should only reach this case for the root frame and not descend further - // into subframes. - if (!GetLastCommittedEntry()) { - DCHECK(frame->IsMainFrame()); - return HistoryNavigationAction::kDifferentDocument; - } - // Reloads should result in a different-document load. Note that reloads may // also happen via the |needs_reload_| mechanism where the reload_type is // NONE, so detect this by comparing whether we're going to the same @@ -3473,15 +3396,11 @@ bool override_user_agent = ShouldOverrideUserAgent(params.override_user_agent, GetLastCommittedEntry()); - // Don't allow an entry replacement if there is no entry to replace. - // http://crbug.com/457149 - // - // If there is an entry, an entry replacement must happen if the current - // browsing context should maintain a trivial session history. + // An entry replacement must happen if the current browsing context should + // maintain a trivial session history. bool should_replace_current_entry = (params.should_replace_current_entry || - ShouldMaintainTrivialSessionHistory(node)) && - entries_.size(); + ShouldMaintainTrivialSessionHistory(node)); // Javascript URLs should not create NavigationEntries. All other navigations // do, including navigations to chrome renderer debug URLs. @@ -3538,14 +3457,12 @@ // policy container for it, then we should copy it into the pending entry, // so that it is copied to the navigation request in // CreateNavigationRequestFromLoadParams later. - if (GetLastCommittedEntry()) { - FrameNavigationEntry* previous_frame_entry = - GetLastCommittedEntry()->GetFrameEntry(node); - if (previous_frame_entry && - previous_frame_entry->policy_container_policies()) { - pending_entry_->GetFrameEntry(node)->set_policy_container_policies( - previous_frame_entry->policy_container_policies()->ClonePtr()); - } + FrameNavigationEntry* previous_frame_entry = + GetLastCommittedEntry()->GetFrameEntry(node); + if (previous_frame_entry && + previous_frame_entry->policy_container_policies()) { + pending_entry_->GetFrameEntry(node)->set_policy_container_policies( + previous_frame_entry->policy_container_policies()->ClonePtr()); } } @@ -3556,8 +3473,7 @@ // and that PolicyContainerHost will be put in the final RenderFrameHost for // the navigation. This way, we ensure that we keep enforcing the right // policies on the initial empty document after the reload. - if ((!GetLastCommittedEntry() || GetLastCommittedEntry()->IsInitialEntry()) && - params.url.IsAboutBlank()) { + if (GetLastCommittedEntry()->IsInitialEntry() && params.url.IsAboutBlank()) { if (node->current_frame_host() && node->current_frame_host()->policy_container_host()) { pending_entry_->GetFrameEntry(node)->set_policy_container_policies( @@ -3674,18 +3590,7 @@ // For subframes, create a pending entry with a corresponding frame entry. if (!node->IsMainFrame()) { - if (GetLastCommittedEntry()) { - entry = GetLastCommittedEntry()->Clone(); - } else { - // If there's no last committed entry, create an entry for about:blank - // with a subframe entry for our destination. - // TODO(creis): Ensure this case can't exist in https://crbug.com/524208. - entry = NavigationEntryImpl::FromNavigationEntry(CreateNavigationEntry( - GURL(url::kAboutBlankURL), params.referrer, params.initiator_origin, - params.source_site_instance.get(), params.transition_type, - params.is_renderer_initiated, extra_headers_crlf, browser_context_, - blob_url_loader_factory, false /* rewrite_virtual_urls */)); - } + entry = GetLastCommittedEntry()->Clone(); entry->AddOrUpdateFrameEntry( node, NavigationEntryImpl::UpdatePolicy::kReplace, -1, -1, "", nullptr, static_cast<SiteInstanceImpl*>(params.source_site_instance.get()), @@ -4109,8 +4014,7 @@ /*initiator_rfh=*/nullptr, /*soft_navigation_heuristics_task_id=*/absl::nullopt, /*navigation_api_key=*/nullptr); - } else if (last_committed_entry_index_ != -1 && - !GetLastCommittedEntry() + } else if (!GetLastCommittedEntry() ->IsInitialEntryNotForSynchronousAboutBlank()) { pending_entry_ = entries_[last_committed_entry_index_].get(); pending_entry_index_ = last_committed_entry_index_; @@ -4258,6 +4162,7 @@ entries_.insert(entries_.begin() + i, source->entries_[i]->CloneWithoutSharing(context.get())); } + DCHECK_GE(entries_.size(), 1u); DCHECK(pending_entry_index_ == -1 || pending_entry_ == GetEntryAtIndex(pending_entry_index_)); } @@ -4362,11 +4267,7 @@ bool is_same_document, const GURL& url) { if (is_same_document) { - // TODO(https://crbug.com/524208): Remove this nullptr check when we can - // ensure we always have a FrameNavigationEntry here. - if (!GetLastCommittedEntry()) - return nullptr; - + DCHECK(GetLastCommittedEntry()); FrameNavigationEntry* previous_frame_entry = GetLastCommittedEntry()->GetFrameEntry(rfh->frame_tree_node()); @@ -4475,7 +4376,7 @@ int64_t pending_item_sequence_number, int64_t pending_document_sequence_number) { std::vector<blink::mojom::NavigationApiHistoryEntryPtr> entries; - if (GetLastCommittedEntry() && GetLastCommittedEntry()->IsInitialEntry()) { + if (GetLastCommittedEntry()->IsInitialEntry()) { // Don't process the initial entry. DCHECK_EQ(GetEntryCount(), 1); return entries;
diff --git a/content/browser/renderer_host/navigation_controller_impl_unittest.cc b/content/browser/renderer_host/navigation_controller_impl_unittest.cc index b61f9fe1..215aa7e 100644 --- a/content/browser/renderer_host/navigation_controller_impl_unittest.cc +++ b/content/browser/renderer_host/navigation_controller_impl_unittest.cc
@@ -1137,8 +1137,7 @@ EXPECT_EQ(-1, controller.GetPendingEntryIndex()); EXPECT_TRUE(controller.GetPendingEntry()); EXPECT_EQ(kNewURL, controller.GetPendingEntry()->GetURL()); - EXPECT_TRUE(!controller.GetLastCommittedEntry() || - controller.GetLastCommittedEntry()->IsInitialEntry()); + EXPECT_TRUE(controller.GetLastCommittedEntry()->IsInitialEntry()); EXPECT_EQ(1, delegate->navigation_state_change_count()); // It may abort before committing, if it's a download or due to a stop or @@ -1150,8 +1149,7 @@ EXPECT_EQ(-1, controller.GetPendingEntryIndex()); EXPECT_TRUE(controller.GetPendingEntry()); EXPECT_EQ(kNewURL, controller.GetPendingEntry()->GetURL()); - EXPECT_TRUE(!controller.GetLastCommittedEntry() || - controller.GetLastCommittedEntry()->IsInitialEntry()); + EXPECT_TRUE(controller.GetLastCommittedEntry()->IsInitialEntry()); EXPECT_EQ(2, delegate->navigation_state_change_count()); NavigationEntry* pending_entry = controller.GetPendingEntry(); @@ -1161,8 +1159,7 @@ EXPECT_TRUE(controller.GetPendingEntry()); EXPECT_EQ(kNewURL, controller.GetPendingEntry()->GetURL()); EXPECT_EQ(pending_entry, controller.GetPendingEntry()); - EXPECT_TRUE(!controller.GetLastCommittedEntry() || - controller.GetLastCommittedEntry()->IsInitialEntry()); + EXPECT_TRUE(controller.GetLastCommittedEntry()->IsInitialEntry()); contents()->SetDelegate(nullptr); } @@ -2302,8 +2299,7 @@ } TEST_F(NavigationControllerTest, PushStateWithOnlyInitialEntry) { - ASSERT_TRUE(!controller_impl().GetLastCommittedEntry() || - controller_impl().GetLastCommittedEntry()->IsInitialEntry()); + ASSERT_TRUE(controller_impl().GetLastCommittedEntry()->IsInitialEntry()); GURL url("http://foo"); auto params = mojom::DidCommitProvisionalLoadParams::New(); params->did_create_new_entry = true; @@ -2718,8 +2714,7 @@ // we must revert to showing about:blank to avoid a URL spoof. main_test_rfh()->DidAccessInitialMainDocument(); EXPECT_TRUE(contents()->HasAccessedInitialDocument()); - EXPECT_TRUE(!controller.GetVisibleEntry() || - controller.GetVisibleEntry()->IsInitialEntry()); + EXPECT_TRUE(controller.GetVisibleEntry()->IsInitialEntry()); EXPECT_EQ(url, controller.GetPendingEntry()->GetURL()); } @@ -2763,8 +2758,7 @@ // we must revert to showing about:blank to avoid a URL spoof. main_test_rfh()->DidAccessInitialMainDocument(); EXPECT_TRUE(contents()->HasAccessedInitialDocument()); - EXPECT_TRUE(!controller.GetVisibleEntry() || - controller.GetVisibleEntry()->IsInitialEntry()); + EXPECT_TRUE(controller.GetVisibleEntry()->IsInitialEntry()); EXPECT_FALSE(controller.GetPendingEntry()); } @@ -2802,8 +2796,7 @@ // we must revert to showing about:blank to avoid a URL spoof. main_test_rfh()->DidAccessInitialMainDocument(); EXPECT_TRUE(contents()->HasAccessedInitialDocument()); - EXPECT_TRUE(!controller.GetVisibleEntry() || - controller.GetVisibleEntry()->IsInitialEntry()); + EXPECT_TRUE(controller.GetVisibleEntry()->IsInitialEntry()); EXPECT_EQ(url, controller.GetPendingEntry()->GetURL()); } @@ -2843,8 +2836,7 @@ // show this page anymore. main_test_rfh()->DidAccessInitialMainDocument(); EXPECT_TRUE(contents()->HasAccessedInitialDocument()); - EXPECT_TRUE(!controller.GetVisibleEntry() || - controller.GetVisibleEntry()->IsInitialEntry()); + EXPECT_TRUE(controller.GetVisibleEntry()->IsInitialEntry()); EXPECT_FALSE(controller.GetPendingEntry()); } @@ -3015,8 +3007,7 @@ // entry. TEST_F(NavigationControllerTest, LazyReloadWithOnlyInitialEntry) { NavigationControllerImpl& controller = controller_impl(); - ASSERT_TRUE(!controller.GetLastCommittedEntry() || - controller.GetLastCommittedEntry()->IsInitialEntry()); + ASSERT_TRUE(controller.GetLastCommittedEntry()->IsInitialEntry()); EXPECT_FALSE(controller.NeedsReload()); controller.SetNeedsReload(); EXPECT_TRUE(controller.NeedsReload());
diff --git a/content/browser/renderer_host/render_frame_host_impl_browsertest.cc b/content/browser/renderer_host/render_frame_host_impl_browsertest.cc index b52f71d..eefea9c 100644 --- a/content/browser/renderer_host/render_frame_host_impl_browsertest.cc +++ b/content/browser/renderer_host/render_frame_host_impl_browsertest.cc
@@ -5369,7 +5369,7 @@ BrowserContext* browser_context, const GURL& url, bool origin_matches_flag) override { - return origin_matches_flag; + return url.host() == kAppHost; } }; @@ -5380,14 +5380,13 @@ RenderFrameHostImplBrowserTest::SetUpCommandLine(command_line); mock_cert_verifier_.SetUpCommandLine(command_line); - command_line->AppendSwitchASCII(switches::kIsolatedAppOrigins, - std::string("https://") + kAppHost); } void SetUpInProcessBrowserTestFixture() override { RenderFrameHostImplBrowserTest::SetUpInProcessBrowserTestFixture(); mock_cert_verifier_.SetUpInProcessBrowserTestFixture(); } + void TearDownInProcessBrowserTestFixture() override { RenderFrameHostImplBrowserTest::TearDownInProcessBrowserTestFixture(); mock_cert_verifier_.TearDownInProcessBrowserTestFixture(); @@ -5401,8 +5400,7 @@ net::test_server::RegisterDefaultHandlers(https_server()); ASSERT_TRUE(https_server()->Start()); - test_client_ = std::make_unique<IsolatedWebAppContentBrowserClient>(); - old_client_ = SetBrowserClientForTesting(test_client_.get()); + old_client_ = SetBrowserClientForTesting(&test_client_); } void TearDownOnMainThread() override { @@ -5411,7 +5409,7 @@ } private: - std::unique_ptr<IsolatedWebAppContentBrowserClient> test_client_; + IsolatedWebAppContentBrowserClient test_client_; raw_ptr<ContentBrowserClient> old_client_; ContentMockCertVerifier mock_cert_verifier_; };
diff --git a/content/browser/renderer_host/render_frame_host_manager.cc b/content/browser/renderer_host/render_frame_host_manager.cc index 9a772650..61c67e9 100644 --- a/content/browser/renderer_host/render_frame_host_manager.cc +++ b/content/browser/renderer_host/render_frame_host_manager.cc
@@ -1996,10 +1996,9 @@ // https://crbug.com/766630. NavigationEntry* current_entry = GetNavigationController().GetLastCommittedEntry(); - bool current_is_view_source_mode = - (current_entry && !current_entry->IsInitialEntry()) - ? current_entry->IsViewSourceMode() - : dest_is_view_source_mode; + bool current_is_view_source_mode = (!current_entry->IsInitialEntry()) + ? current_entry->IsViewSourceMode() + : dest_is_view_source_mode; SiteInstanceImpl* current_instance_impl = static_cast<SiteInstanceImpl*>(current_instance);
diff --git a/content/browser/renderer_host/render_process_host_unittest.cc b/content/browser/renderer_host/render_process_host_unittest.cc index 563f992..fa7e139 100644 --- a/content/browser/renderer_host/render_process_host_unittest.cc +++ b/content/browser/renderer_host/render_process_host_unittest.cc
@@ -21,11 +21,13 @@ #include "content/public/common/content_client.h" #include "content/public/common/content_constants.h" #include "content/public/common/content_switches.h" +#include "content/public/common/url_constants.h" #include "content/public/test/mock_render_process_host.h" #include "content/public/test/navigation_simulator.h" #include "content/public/test/scoped_web_ui_controller_factory_registration.h" #include "content/public/test/test_browser_context.h" #include "content/public/test/test_utils.h" +#include "content/public/test/web_ui_browsertest_util.h" #include "content/test/storage_partition_test_helpers.h" #include "content/test/test_render_frame_host.h" #include "content/test/test_render_view_host.h" @@ -435,6 +437,135 @@ sw_site_instance2->GetLastProcessAssignmentOutcome()); } +class RenderProcessHostWebUIUnitTest : public RenderProcessHostUnitTest { + public: + void SetUp() override { + RenderProcessHostUnitTest::SetUp(); + scoped_feature_list_.InitAndEnableFeature( + features::kEnableServiceWorkersForChromeScheme); + } + + private: + base::test::ScopedFeatureList scoped_feature_list_; +}; + +TEST_F(RenderProcessHostWebUIUnitTest, + DontReuseServiceWorkerProcessForDifferentWebUI) { + ScopedWebUIConfigRegistration config_registration1( + std::make_unique<TestWebUIConfig>("test-host")); + ScopedWebUIConfigRegistration config_registration2( + std::make_unique<TestWebUIConfig>("second-host")); + + const GURL kWebUI1("chrome://test-host/"); + const GURL kWebUI2("chrome://second-host/"); + + // Gets a RenderProcessHost for an unmatched service worker. + scoped_refptr<SiteInstanceImpl> sw_site_instance1 = + CreateForServiceWorker(kWebUI1); + RenderProcessHost* sw_host = sw_site_instance1->GetProcess(); + EXPECT_EQ(SiteInstanceProcessAssignment::CREATED_NEW_PROCESS, + sw_site_instance1->GetLastProcessAssignmentOutcome()); + + // Getting RenderProcessHost for a service worker for a different WebUI + // should return a new process because there is no reusable process. + scoped_refptr<SiteInstanceImpl> sw_site_instance2 = CreateForUrl(kWebUI2); + EXPECT_NE(sw_host, sw_site_instance2->GetProcess()); + EXPECT_EQ(SiteInstanceProcessAssignment::CREATED_NEW_PROCESS, + sw_site_instance2->GetLastProcessAssignmentOutcome()); +} + +TEST_F(RenderProcessHostWebUIUnitTest, DontReuseServiceWorkerProcessForWebUrl) { + ScopedWebUIConfigRegistration config_registration1( + std::make_unique<TestWebUIConfig>("test-host")); + + const GURL kWebUI1("chrome://test-host/"); + + // Gets a RenderProcessHost for an unmatched service worker. + scoped_refptr<SiteInstanceImpl> sw_site_instance1 = + CreateForServiceWorker(kWebUI1); + RenderProcessHost* sw_host = sw_site_instance1->GetProcess(); + EXPECT_EQ(SiteInstanceProcessAssignment::CREATED_NEW_PROCESS, + sw_site_instance1->GetLastProcessAssignmentOutcome()); + + const GURL kWebUrl("https://test.example/"); + + // Getting RenderProcessHost for a service worker for a regular site should + // return a new process because there is no reusable process. + scoped_refptr<SiteInstanceImpl> web_sw_site_instance = + CreateForServiceWorker(kWebUrl); + EXPECT_NE(sw_host, web_sw_site_instance->GetProcess()); + EXPECT_EQ(SiteInstanceProcessAssignment::CREATED_NEW_PROCESS, + web_sw_site_instance->GetLastProcessAssignmentOutcome()); + + // Getting RenderProcessHost for a navigation to a regular site should + // re-use the Web Service Worker process and not the WebUI one. + scoped_refptr<SiteInstanceImpl> web_site_instance = CreateForUrl(kWebUrl); + EXPECT_NE(sw_host, web_site_instance->GetProcess()); + EXPECT_EQ(SiteInstanceProcessAssignment::REUSED_EXISTING_PROCESS, + web_site_instance->GetLastProcessAssignmentOutcome()); +} + +// Tests that Service Worker processes for WebUIs are not re-used even +// for the same WebUI. Ideally we would re-use the process if it's for +// the same WebUI but we currently don't because of crbug.com/1158277. +TEST_F(RenderProcessHostWebUIUnitTest, + DontReuseServiceWorkerProcessForSameWebUI) { + ScopedWebUIConfigRegistration config_registration( + std::make_unique<TestWebUIConfig>("test-host")); + const GURL kUrl("chrome://test-host"); + + // Gets a RenderProcessHost for a service worker. + scoped_refptr<SiteInstanceImpl> sw_site_instance1 = + CreateForServiceWorker(kUrl, + /*can_reuse_process=*/true); + RenderProcessHost* sw_host1 = sw_site_instance1->GetProcess(); + EXPECT_EQ(SiteInstanceProcessAssignment::CREATED_NEW_PROCESS, + sw_site_instance1->GetLastProcessAssignmentOutcome()); + + // Getting a RenderProcessHost for a service worker with DEFAULT reuse policy + // should not reuse the existing service worker's process. This is because + // we use DEFAULT reuse policy for a service worker when we have failed to + // start the service worker and want to use a new process. We create this + // second service worker to test the "find the newest process" logic later. + scoped_refptr<SiteInstanceImpl> sw_site_instance2 = + CreateForServiceWorker(kUrl); + RenderProcessHost* sw_host2 = sw_site_instance2->GetProcess(); + EXPECT_NE(sw_host1, sw_host2); + EXPECT_EQ(SiteInstanceProcessAssignment::CREATED_NEW_PROCESS, + sw_site_instance2->GetLastProcessAssignmentOutcome()); + + // Getting a RenderProcessHost for a service worker of the same WebUI with + // the same WebUI and allow process reuse policy doesn't reuse any service + // worker processes. + scoped_refptr<SiteInstanceImpl> sw_site_instance3 = + CreateForServiceWorker(kUrl, + /*can_reuse_process=*/true); + RenderProcessHost* sw_host3 = sw_site_instance3->GetProcess(); + EXPECT_NE(sw_host1, sw_host3); + EXPECT_NE(sw_host2, sw_host3); + EXPECT_EQ(SiteInstanceProcessAssignment::CREATED_NEW_PROCESS, + sw_site_instance3->GetLastProcessAssignmentOutcome()); + + // Getting a RenderProcessHost for a navigation to the same WebUI doesn't + // reuse any service worker's processes. + scoped_refptr<SiteInstanceImpl> site_instance1 = CreateForUrl(kUrl); + EXPECT_NE(sw_host1, site_instance1->GetProcess()); + EXPECT_NE(sw_host2, site_instance1->GetProcess()); + EXPECT_NE(sw_host3, site_instance1->GetProcess()); + EXPECT_EQ(SiteInstanceProcessAssignment::CREATED_NEW_PROCESS, + site_instance1->GetLastProcessAssignmentOutcome()); + + // Getting a RenderProcessHost for a navigation to a web URL doesn't reuse any + // service worker's processes. + const GURL kWebUrl("https://test.example"); + scoped_refptr<SiteInstanceImpl> web_site_instance = CreateForUrl(kWebUrl); + EXPECT_NE(sw_host1, web_site_instance->GetProcess()); + EXPECT_NE(sw_host2, web_site_instance->GetProcess()); + EXPECT_NE(sw_host3, web_site_instance->GetProcess()); + EXPECT_EQ(SiteInstanceProcessAssignment::CREATED_NEW_PROCESS, + web_site_instance->GetLastProcessAssignmentOutcome()); +} + class RenderProcessHostUntrustedWebUIUnitTest : public RenderProcessHostUnitTest { public: @@ -465,9 +596,6 @@ EXPECT_EQ(SiteInstanceProcessAssignment::CREATED_NEW_PROCESS, sw_site_instance1->GetLastProcessAssignmentOutcome()); - // Discard the spare, so it cannot be considered by the GetProcess call below. - RenderProcessHostImpl::DiscardSpareRenderProcessHostForTesting(); - // Getting RenderProcessHost for a service worker for a different WebUI // should return a new process because there is no reusable process. scoped_refptr<SiteInstanceImpl> sw_site_instance2 = CreateForUrl(kWebUI2);
diff --git a/content/browser/screen_enumeration/DIR_METADATA b/content/browser/screen_enumeration/DIR_METADATA index 11597323..6e79119 100644 --- a/content/browser/screen_enumeration/DIR_METADATA +++ b/content/browser/screen_enumeration/DIR_METADATA
@@ -1,4 +1,4 @@ monorail { - component: "UI>Browser>WebAppInstalls" + component: "Blink>Screen>MultiScreen" } team_email: "pwa-dev@chromium.org"
diff --git a/content/browser/service_worker/embedded_worker_instance.cc b/content/browser/service_worker/embedded_worker_instance.cc index 52a4cc04..86943ce 100644 --- a/content/browser/service_worker/embedded_worker_instance.cc +++ b/content/browser/service_worker/embedded_worker_instance.cc
@@ -870,16 +870,25 @@ ContentBrowserClient::NonNetworkURLLoaderFactoryMap non_network_factories; non_network_factories[url::kDataScheme] = DataURLLoaderFactory::Create(); + // Allow service workers for chrome:// or chrome-untrusted:// based on flags. if (base::FeatureList::IsEnabled( - features::kEnableServiceWorkersForChromeUntrusted)) { - if (origin.scheme() == content::kChromeUIUntrustedScheme) { - non_network_factories.emplace( - content::kChromeUIUntrustedScheme, - CreateWebUIServiceWorkerLoaderFactory( - rph->GetBrowserContext(), content::kChromeUIUntrustedScheme, - base::flat_set<std::string>())); - } + features::kEnableServiceWorkersForChromeScheme) && + origin.scheme() == content::kChromeUIScheme) { + non_network_factories.emplace( + content::kChromeUIScheme, + CreateWebUIServiceWorkerLoaderFactory(rph->GetBrowserContext(), + content::kChromeUIScheme, + base::flat_set<std::string>())); + } else if (base::FeatureList::IsEnabled( + features::kEnableServiceWorkersForChromeUntrusted) && + origin.scheme() == content::kChromeUIUntrustedScheme) { + non_network_factories.emplace( + content::kChromeUIUntrustedScheme, + CreateWebUIServiceWorkerLoaderFactory(rph->GetBrowserContext(), + content::kChromeUIUntrustedScheme, + base::flat_set<std::string>())); } + GetContentClient() ->browser() ->RegisterNonNetworkSubresourceURLLoaderFactories(
diff --git a/content/browser/service_worker/service_worker_container_host_unittest.cc b/content/browser/service_worker/service_worker_container_host_unittest.cc index 020f5c01..3b884136 100644 --- a/content/browser/service_worker/service_worker_container_host_unittest.cc +++ b/content/browser/service_worker/service_worker_container_host_unittest.cc
@@ -930,6 +930,58 @@ EXPECT_EQ(3u, bad_messages_.size()); } +class WebUIUntrustedServiceWorkerContainerHostTest + : public ServiceWorkerContainerHostTest, + public testing::WithParamInterface<bool> { + public: + WebUIUntrustedServiceWorkerContainerHostTest() { + if (GetParam()) { + features_.InitAndEnableFeature( + features::kEnableServiceWorkersForChromeUntrusted); + } else { + features_.InitAndDisableFeature( + features::kEnableServiceWorkersForChromeUntrusted); + } + } + + private: + base::test::ScopedFeatureList features_; +}; + +// Test that chrome:// webuis can't register service workers even if the +// chrome-untrusted:// SW flag is on. +TEST_P(WebUIUntrustedServiceWorkerContainerHostTest, + Register_RegistrationShouldFail) { + ServiceWorkerRemoteContainerEndpoint remote_endpoint = + PrepareServiceWorkerContainerHost(GURL("chrome://testwebui/")); + + ASSERT_TRUE(bad_messages_.empty()); + Register(remote_endpoint.host_remote()->get(), GURL("chrome://testwebui/"), + GURL("chrome://testwebui/sw.js")); + EXPECT_EQ(1u, bad_messages_.size()); +} + +TEST_P(WebUIUntrustedServiceWorkerContainerHostTest, + Register_UntrustedRegistrationShouldFail) { + ServiceWorkerRemoteContainerEndpoint remote_endpoint = + PrepareServiceWorkerContainerHost(GURL("chrome-untrusted://testwebui/")); + + ASSERT_TRUE(bad_messages_.empty()); + Register(remote_endpoint.host_remote()->get(), + GURL("chrome-untrusted://testwebui/"), + GURL("chrome-untrusted://testwebui/sw.js")); + EXPECT_EQ(1u, bad_messages_.size()); +} + +INSTANTIATE_TEST_SUITE_P(All, + WebUIUntrustedServiceWorkerContainerHostTest, + testing::Bool(), + [](const ::testing::TestParamInfo<bool>& info) { + if (info.param) + return "ServiceWorkersForChromeUntrustedEnabled"; + return "ServiceWorkersForChromeUntrustedDisabled"; + }); + class WebUIServiceWorkerContainerHostTest : public ServiceWorkerContainerHostTest, public testing::WithParamInterface<bool> { @@ -937,10 +989,10 @@ WebUIServiceWorkerContainerHostTest() { if (GetParam()) { features_.InitAndEnableFeature( - features::kEnableServiceWorkersForChromeUntrusted); + features::kEnableServiceWorkersForChromeScheme); } else { features_.InitAndDisableFeature( - features::kEnableServiceWorkersForChromeUntrusted); + features::kEnableServiceWorkersForChromeScheme); } } @@ -958,6 +1010,8 @@ EXPECT_EQ(1u, bad_messages_.size()); } +// Test that chrome-untrusted:// service workers are disallowed with the +// chrome:// flag turned on. TEST_P(WebUIServiceWorkerContainerHostTest, Register_UntrustedRegistrationShouldFail) { ServiceWorkerRemoteContainerEndpoint remote_endpoint = @@ -975,8 +1029,8 @@ testing::Bool(), [](const ::testing::TestParamInfo<bool>& info) { if (info.param) - return "ServiceWorkersForChromeUntrustedEnabled"; - return "ServiceWorkersForChromeUntrustedDisabled"; + return "ServiceWorkersForChromeEnabled"; + return "ServiceWorkersForChromeDisabled"; }); TEST_F(ServiceWorkerContainerHostTest, EarlyContextDeletion) {
diff --git a/content/browser/service_worker/service_worker_context_wrapper.cc b/content/browser/service_worker/service_worker_context_wrapper.cc index 7cd1fbc..ebaf9405 100644 --- a/content/browser/service_worker/service_worker_context_wrapper.cc +++ b/content/browser/service_worker/service_worker_context_wrapper.cc
@@ -1690,26 +1690,35 @@ loader_factory_bundle_info = context()->loader_factory_bundle_for_update_check()->Clone(); - if (base::FeatureList::IsEnabled( - features::kEnableServiceWorkersForChromeUntrusted) && - scope.scheme_piece() == kChromeUIUntrustedScheme) { - // If this is a Service Worker for a WebUI, the WebUI's URLDataSource needs - // to be registered. Registering a URLDataSource allows the + if (auto* config = content::WebUIConfigMap::GetInstance().GetConfig( + browser_context(), scope_origin)) { + // If this is a Service Worker for a WebUI, the WebUI's URLDataSource + // needs to be registered. Registering a URLDataSource allows the // WebUIURLLoaderFactory below to serve the resources for the WebUI. We - // register the URLDataSource here because the WebUI's resources are needed - // for the Service Worker update check to be performed which fetches the - // service worker script. + // register the URLDataSource here because the WebUI's resources are + // needed for the Service Worker update check to be performed which + // fetches the service worker script. // // This is similar to how we create a `WebUI` object in // RenderFrameHostManager::GetFrameHostForNavigation(). Creating a `WebUI` - // also creates a `WebUIController` which register the URLDataSource for the - // WebUI which allows the navigation to be served correctly. We don't create - // a `WebUI` or a `WebUIController` for WebUI Service Workers so we + // also creates a `WebUIController` which register the URLDataSource for + // the WebUI which allows the navigation to be served correctly. We don't + // create a `WebUI` or a `WebUIController` for WebUI Service Workers so we // register the URLDataSource directly. - if (auto* config = content::WebUIConfigMap::GetInstance().GetConfig( - browser_context(), scope_origin)) { + if (base::FeatureList::IsEnabled( + features::kEnableServiceWorkersForChromeScheme) && + scope.scheme_piece() == kChromeUIScheme) { config->RegisterURLDataSource(browser_context()); - + static_cast<blink::PendingURLLoaderFactoryBundle*>( + loader_factory_bundle_info.get()) + ->pending_scheme_specific_factories() + .emplace(kChromeUIScheme, CreateWebUIServiceWorkerLoaderFactory( + browser_context(), kChromeUIScheme, + base::flat_set<std::string>())); + } else if (base::FeatureList::IsEnabled( + features::kEnableServiceWorkersForChromeUntrusted) && + scope.scheme_piece() == kChromeUIUntrustedScheme) { + config->RegisterURLDataSource(browser_context()); static_cast<blink::PendingURLLoaderFactoryBundle*>( loader_factory_bundle_info.get()) ->pending_scheme_specific_factories()
diff --git a/content/browser/service_worker/service_worker_security_utils.cc b/content/browser/service_worker/service_worker_security_utils.cc index a5512d8..e02c7538 100644 --- a/content/browser/service_worker/service_worker_security_utils.cc +++ b/content/browser/service_worker/service_worker_security_utils.cc
@@ -14,7 +14,7 @@ bool OriginCanRegisterServiceWorkerFromJavascript(const GURL& url) { // WebUI service workers are always registered in C++. - if (url.SchemeIs(kChromeUIUntrustedScheme)) + if (url.SchemeIs(kChromeUIUntrustedScheme) || url.SchemeIs(kChromeUIScheme)) return false; return OriginCanAccessServiceWorkers(url);
diff --git a/content/browser/web_contents/file_chooser_impl_browsertest.cc b/content/browser/web_contents/file_chooser_impl_browsertest.cc index f99137cb..dc07f3ce 100644 --- a/content/browser/web_contents/file_chooser_impl_browsertest.cc +++ b/content/browser/web_contents/file_chooser_impl_browsertest.cc
@@ -156,9 +156,7 @@ } // https://crbug.com/1345275 -// Disabled due to b/258505229. -IN_PROC_BROWSER_TEST_F(FileChooserImplBrowserTest, - DISABLED_UploadFolderWithSymlink) { +IN_PROC_BROWSER_TEST_F(FileChooserImplBrowserTest, UploadFolderWithSymlink) { EXPECT_TRUE(NavigateToURL( shell(), GetTestUrl(".", "file_input_webkitdirectory.html")));
diff --git a/content/common/url_schemes.cc b/content/common/url_schemes.cc index 4468b13a..f896d331 100644 --- a/content/common/url_schemes.cc +++ b/content/common/url_schemes.cc
@@ -108,11 +108,13 @@ url::AddPredefinedHandlerScheme(scheme.c_str(), handler.c_str()); // This should only be registered if the - // kEnableServiceWorkerForChromeUntrusted feature is enabled but checking - // it here causes a crash when --no-sandbox is enabled. See crbug.com/1313812 + // kEnableServiceWorkerForChrome or + // kEnableServiceWorkerForChromeUntrusted feature is enabled but checking it + // here causes a crash when --no-sandbox is enabled. See crbug.com/1313812 // There are other render side checks and browser side checks that ensure - // service workers don't work for chrome-untrusted:// when the flag is not + // service workers don't work for chrome[-untrusted]:// when the flag is not // enabled. + schemes.service_worker_schemes.push_back(kChromeUIScheme); schemes.service_worker_schemes.push_back(kChromeUIUntrustedScheme); // Prevent future modification of the scheme lists. This is to prevent
diff --git a/content/public/browser/navigation_controller.h b/content/public/browser/navigation_controller.h index a5737c50..d670516 100644 --- a/content/public/browser/navigation_controller.h +++ b/content/public/browser/navigation_controller.h
@@ -350,13 +350,12 @@ // See http://crbug.com/273710. // // Returns the active entry, which is the pending entry if a navigation is in - // progress or the last committed entry otherwise. NOTE: This can be nullptr!! + // progress or the last committed entry otherwise. virtual NavigationEntry* GetActiveEntry() = 0; // Returns the entry that should be displayed to the user in the address bar. // This is the pending entry if a navigation is in progress *and* is safe to // display to the user (see below), or the last committed entry otherwise. - // NOTE: This can be nullptr if no entry has been committed! // // A pending entry is safe to display if it started in the browser process or // if it's a renderer-initiated navigation in a new tab which hasn't been @@ -368,12 +367,13 @@ // it is the pending_entry_index_. virtual int GetCurrentEntryIndex() = 0; - // Returns the last committed entry, which may be null if there are no - // committed entries. + // Returns the last "committed" entry. Note that even when no navigation has + // actually committed, this will never return null as long as the FrameTree + // associated with the NavigationController is already initialized, as a + // FrameTree will always start with the initial NavigationEntry. virtual NavigationEntry* GetLastCommittedEntry() = 0; - // Returns the index of the last committed entry. It will be -1 if there are - // no entries. + // Returns the index of the last committed entry. virtual int GetLastCommittedEntryIndex() = 0; // Returns true if the source for the current entry can be viewed.
diff --git a/content/public/common/content_features.cc b/content/public/common/content_features.cc index b116a794..8aa38ed 100644 --- a/content/public/common/content_features.cc +++ b/content/public/common/content_features.cc
@@ -326,6 +326,11 @@ "EnableServiceWorkersForChromeUntrusted", base::FEATURE_DISABLED_BY_DEFAULT); +// Enables service workers on chrome:// urls. +BASE_FEATURE(kEnableServiceWorkersForChromeScheme, + "EnableServiceWorkersForChromeScheme", + base::FEATURE_DISABLED_BY_DEFAULT); + // If this feature is enabled and device permission is not granted by the user, // media-device enumeration will provide at most one device per type and the // device IDs will not be available.
diff --git a/content/public/common/content_features.h b/content/public/common/content_features.h index 171b491..d8d6ee8 100644 --- a/content/public/common/content_features.h +++ b/content/public/common/content_features.h
@@ -69,6 +69,7 @@ CONTENT_EXPORT BASE_DECLARE_FEATURE(kEnableCanvas2DLayers); CONTENT_EXPORT BASE_DECLARE_FEATURE( kEnableMachineLearningModelLoaderWebPlatformApi); +CONTENT_EXPORT BASE_DECLARE_FEATURE(kEnableServiceWorkersForChromeScheme); CONTENT_EXPORT BASE_DECLARE_FEATURE(kEnableServiceWorkersForChromeUntrusted); CONTENT_EXPORT BASE_DECLARE_FEATURE(kEnumerateDevicesHideDeviceIDs); CONTENT_EXPORT BASE_DECLARE_FEATURE(kExperimentalAccessibilityLabels);
diff --git a/content/public/test/web_ui_browsertest_util.cc b/content/public/test/web_ui_browsertest_util.cc index 85db879..1cd712f 100644 --- a/content/public/test/web_ui_browsertest_util.cc +++ b/content/public/test/web_ui_browsertest_util.cc
@@ -53,6 +53,8 @@ } struct WebUIControllerConfig { + WebUIControllerConfig(); + ~WebUIControllerConfig(); int bindings = BINDINGS_POLICY_WEB_UI; std::string child_src = "child-src 'self' chrome://web-ui-subframe/;"; bool disable_xfo = false; @@ -65,39 +67,98 @@ public: TestWebUIController(WebUI* web_ui, const GURL& base_url, - const WebUIControllerConfig& config) - : WebUIController(web_ui) { - web_ui->SetBindings(config.bindings); + const WebUIControllerConfig& config); - WebUIImpl* web_ui_impl = static_cast<WebUIImpl*>(web_ui); - for (const auto& scheme : config.requestable_schemes) { - web_ui_impl->AddRequestableScheme(scheme.c_str()); - } - - WebUIDataSource* data_source = WebUIDataSource::CreateAndAdd( - web_ui->GetWebContents()->GetBrowserContext(), base_url.host()); - data_source->SetRequestFilter( - base::BindRepeating([](const std::string& path) { return true; }), - base::BindRepeating(&GetResource)); - - data_source->OverrideContentSecurityPolicy( - network::mojom::CSPDirectiveName::ChildSrc, config.child_src); - if (config.frame_ancestors.has_value()) { - for (const auto& frame_ancestor : config.frame_ancestors.value()) { - data_source->AddFrameAncestor(GURL(frame_ancestor)); - } - } - if (config.disable_xfo) - data_source->DisableDenyXFrameOptions(); - if (config.disable_trusted_types) - data_source->DisableTrustedTypesCSP(); - } TestWebUIController(const TestWebUIController&) = delete; void operator=(const TestWebUIController&) = delete; }; +std::unique_ptr<WebUIController> CreateTestWebUIControllerForURL( + WebUI* web_ui, + const GURL& url, + bool disable_xfo) { + if (!url.SchemeIs(kChromeUIScheme)) + return nullptr; + + WebUIControllerConfig config; + config.disable_xfo = disable_xfo; + + if (url.has_query()) { + std::string value; + bool has_value = net::GetValueForKeyInQuery(url, "bindings", &value); + if (has_value) + CHECK(base::StringToInt(value, &(config.bindings))); + + has_value = net::GetValueForKeyInQuery(url, "noxfo", &value); + if (has_value && value == "true") + config.disable_xfo = true; + + has_value = net::GetValueForKeyInQuery(url, "notrustedtypes", &value); + if (has_value && value == "true") + config.disable_trusted_types = true; + + has_value = net::GetValueForKeyInQuery(url, "childsrc", &value); + if (has_value) + config.child_src = value; + + has_value = net::GetValueForKeyInQuery(url, "requestableschemes", &value); + if (has_value) { + DCHECK(!value.empty()); + std::vector<std::string> schemes = base::SplitString( + value, ",", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL); + + config.requestable_schemes.insert(config.requestable_schemes.end(), + schemes.begin(), schemes.end()); + } + + has_value = net::GetValueForKeyInQuery(url, "frameancestors", &value); + if (has_value) { + std::vector<std::string> frame_ancestors = base::SplitString( + value, ",", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL); + + config.frame_ancestors.emplace(frame_ancestors.begin(), + frame_ancestors.end()); + } + } + + return std::make_unique<TestWebUIController>(web_ui, url, config); +} + } // namespace +WebUIControllerConfig::WebUIControllerConfig() = default; +WebUIControllerConfig::~WebUIControllerConfig() = default; + +TestWebUIController::TestWebUIController(WebUI* web_ui, + const GURL& base_url, + const WebUIControllerConfig& config) + : WebUIController(web_ui) { + web_ui->SetBindings(config.bindings); + + WebUIImpl* web_ui_impl = static_cast<WebUIImpl*>(web_ui); + for (const auto& scheme : config.requestable_schemes) { + web_ui_impl->AddRequestableScheme(scheme.c_str()); + } + + WebUIDataSource* data_source = WebUIDataSource::CreateAndAdd( + web_ui->GetWebContents()->GetBrowserContext(), base_url.host()); + data_source->SetRequestFilter( + base::BindRepeating([](const std::string& path) { return true; }), + base::BindRepeating(&GetResource)); + + data_source->OverrideContentSecurityPolicy( + network::mojom::CSPDirectiveName::ChildSrc, config.child_src); + if (config.frame_ancestors.has_value()) { + for (const auto& frame_ancestor : config.frame_ancestors.value()) { + data_source->AddFrameAncestor(GURL(frame_ancestor)); + } + } + if (config.disable_xfo) + data_source->DisableDenyXFrameOptions(); + if (config.disable_trusted_types) + data_source->DisableTrustedTypesCSP(); +} + TestUntrustedDataSourceHeaders::TestUntrustedDataSourceHeaders() = default; TestUntrustedDataSourceHeaders::TestUntrustedDataSourceHeaders( const TestUntrustedDataSourceHeaders& other) = default; @@ -167,56 +228,20 @@ url::kStandardSchemeSeparator + host_and_path); } +TestWebUIConfig::TestWebUIConfig(base::StringPiece host) + : WebUIConfig(content::kChromeUIScheme, host) {} + +std::unique_ptr<WebUIController> TestWebUIConfig::CreateWebUIController( + content::WebUI* web_ui) { + return CreateTestWebUIControllerForURL(web_ui, GURL(host()), true); +} + TestWebUIControllerFactory::TestWebUIControllerFactory() = default; std::unique_ptr<WebUIController> TestWebUIControllerFactory::CreateWebUIControllerForURL(WebUI* web_ui, const GURL& url) { - if (!url.SchemeIs(kChromeUIScheme)) - return nullptr; - - WebUIControllerConfig config; - config.disable_xfo = disable_xfo_; - - if (url.has_query()) { - std::string value; - bool has_value = net::GetValueForKeyInQuery(url, "bindings", &value); - if (has_value) - CHECK(base::StringToInt(value, &(config.bindings))); - - has_value = net::GetValueForKeyInQuery(url, "noxfo", &value); - if (has_value && value == "true") - config.disable_xfo = true; - - has_value = net::GetValueForKeyInQuery(url, "notrustedtypes", &value); - if (has_value && value == "true") - config.disable_trusted_types = true; - - has_value = net::GetValueForKeyInQuery(url, "childsrc", &value); - if (has_value) - config.child_src = value; - - has_value = net::GetValueForKeyInQuery(url, "requestableschemes", &value); - if (has_value) { - DCHECK(!value.empty()); - std::vector<std::string> schemes = base::SplitString( - value, ",", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL); - - config.requestable_schemes.insert(config.requestable_schemes.end(), - schemes.begin(), schemes.end()); - } - - has_value = net::GetValueForKeyInQuery(url, "frameancestors", &value); - if (has_value) { - std::vector<std::string> frame_ancestors = base::SplitString( - value, ",", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL); - - config.frame_ancestors.emplace(frame_ancestors.begin(), - frame_ancestors.end()); - } - } - - return std::make_unique<TestWebUIController>(web_ui, url, config); + return CreateTestWebUIControllerForURL(web_ui, url, disable_xfo_); } WebUI::TypeID TestWebUIControllerFactory::GetWebUIType(
diff --git a/content/public/test/web_ui_browsertest_util.h b/content/public/test/web_ui_browsertest_util.h index 6c3c690..cf9bb8d 100644 --- a/content/public/test/web_ui_browsertest_util.h +++ b/content/public/test/web_ui_browsertest_util.h
@@ -9,7 +9,10 @@ #include <string> #include <utility> +#include "content/public/browser/web_ui_controller.h" #include "content/public/browser/web_ui_controller_factory.h" +#include "content/public/browser/webui_config.h" +#include "content/public/common/bindings_policy.h" #include "services/network/public/mojom/cross_origin_opener_policy.mojom.h" #include "third_party/abseil-cpp/absl/types/optional.h" @@ -41,6 +44,16 @@ // Returns chrome-untrusted://|host_and_path| as a GURL. GURL GetChromeUntrustedUIURL(const std::string& host_and_path); +class TestWebUIConfig : public content::WebUIConfig { + public: + explicit TestWebUIConfig(base::StringPiece host); + + ~TestWebUIConfig() override = default; + + std::unique_ptr<content::WebUIController> CreateWebUIController( + content::WebUI* web_ui) override; +}; + // Returns WebUIControllers whose CSPs and headers can be controlled through // query parameters. // - "bindings" controls the bindings e.g. Mojo, chrome.send() or both, with
diff --git a/content/renderer/render_thread_impl.cc b/content/renderer/render_thread_impl.cc index 365eb139..a284f4d 100644 --- a/content/renderer/render_thread_impl.cc +++ b/content/renderer/render_thread_impl.cc
@@ -941,6 +941,12 @@ chrome_scheme); WebSecurityPolicy::RegisterURLSchemeAsWebUI(chrome_scheme); + // Service workers for chrome:// + if (base::FeatureList::IsEnabled( + features::kEnableServiceWorkersForChromeScheme)) { + WebSecurityPolicy::RegisterURLSchemeAsAllowingServiceWorkers(chrome_scheme); + } + WebString chrome_untrusted_scheme( WebString::FromASCII(kChromeUIUntrustedScheme));
diff --git a/content/test/data/file_chooser/dir_with_dir_symlink/symlink b/content/test/data/file_chooser/dir_with_dir_symlink/symlink new file mode 120000 index 0000000..10f6d1a --- /dev/null +++ b/content/test/data/file_chooser/dir_with_dir_symlink/symlink
@@ -0,0 +1 @@ +../linked_dir/ \ No newline at end of file
diff --git a/extensions/browser/process_manager.cc b/extensions/browser/process_manager.cc index 40f1782b..3eaf855 100644 --- a/extensions/browser/process_manager.cc +++ b/extensions/browser/process_manager.cc
@@ -485,7 +485,7 @@ // entry. This can happen in cases where we query this before any entry is // fully committed, such as when attributing a WebContents for the // TaskManager. If there is a committed navigation, use that instead. - if (!entry || entry->IsInitialEntry()) + if (entry->IsInitialEntry()) entry = controller.GetPendingEntry(); if (!entry || extension_registry_->enabled_extensions().GetExtensionOrAppByURL(
diff --git a/fuchsia_web/webengine/browser/navigation_controller_impl.cc b/fuchsia_web/webengine/browser/navigation_controller_impl.cc index 837d4aa7..2c27256 100644 --- a/fuchsia_web/webengine/browser/navigation_controller_impl.cc +++ b/fuchsia_web/webengine/browser/navigation_controller_impl.cc
@@ -194,7 +194,7 @@ NavigationControllerImpl::GetVisibleNavigationState() const { content::NavigationEntry* const entry = web_contents_->GetController().GetVisibleEntry(); - if (!entry || entry->IsInitialEntry()) + if (entry->IsInitialEntry()) return fuchsia::web::NavigationState(); fuchsia::web::NavigationState state;
diff --git a/gpu/command_buffer/service/BUILD.gn b/gpu/command_buffer/service/BUILD.gn index 80454b02..b6c04ec 100644 --- a/gpu/command_buffer/service/BUILD.gn +++ b/gpu/command_buffer/service/BUILD.gn
@@ -257,6 +257,8 @@ "shared_image/shared_image_backing_factory.h", "shared_image/shared_image_factory.cc", "shared_image/shared_image_factory.h", + "shared_image/shared_image_format_utils.cc", + "shared_image/shared_image_format_utils.h", "shared_image/shared_image_manager.cc", "shared_image/shared_image_manager.h", "shared_image/shared_image_representation.cc", @@ -352,6 +354,7 @@ "//skia:buildflags", "//third_party/angle:angle_image_util", "//third_party/angle:angle_version_info", + "//third_party/dawn/include/dawn:cpp_headers", "//third_party/libyuv", "//third_party/protobuf:protobuf_lite", "//third_party/re2", @@ -462,6 +465,7 @@ "shared_image/iosurface_image_backing.mm", "shared_image/iosurface_image_backing_factory.h", "shared_image/iosurface_image_backing_factory.mm", + "shared_image/shared_image_format_utils_mac.mm", ] # Required by gles2_cmd_decoder.cc on Mac.
diff --git a/gpu/command_buffer/service/ahardwarebuffer_utils.cc b/gpu/command_buffer/service/ahardwarebuffer_utils.cc index e970b875..90c7786 100644 --- a/gpu/command_buffer/service/ahardwarebuffer_utils.cc +++ b/gpu/command_buffer/service/ahardwarebuffer_utils.cc
@@ -10,9 +10,9 @@ #include "base/check.h" #include "base/notreached.h" #include "components/viz/common/gpu/vulkan_context_provider.h" -#include "components/viz/common/resources/resource_format_utils.h" #include "gpu/command_buffer/service/gl_utils.h" #include "gpu/command_buffer/service/shared_context_state.h" +#include "gpu/command_buffer/service/shared_image/shared_image_format_utils.h" #include "gpu/command_buffer/service/texture_manager.h" #include "gpu/vulkan/vulkan_image.h" #include "ui/gfx/color_space.h"
diff --git a/gpu/command_buffer/service/gles2_cmd_decoder_passthrough_unittest_textures.cc b/gpu/command_buffer/service/gles2_cmd_decoder_passthrough_unittest_textures.cc index 362afa74..5e46814 100644 --- a/gpu/command_buffer/service/gles2_cmd_decoder_passthrough_unittest_textures.cc +++ b/gpu/command_buffer/service/gles2_cmd_decoder_passthrough_unittest_textures.cc
@@ -4,9 +4,9 @@ #include <stdint.h> -#include "components/viz/common/resources/resource_format_utils.h" #include "gpu/command_buffer/service/gles2_cmd_decoder.h" #include "gpu/command_buffer/service/gles2_cmd_decoder_unittest.h" +#include "gpu/command_buffer/service/shared_image/shared_image_format_utils.h" #include "gpu/command_buffer/service/shared_image/shared_image_representation.h" #include "gpu/command_buffer/service/shared_image/test_image_backing.h"
diff --git a/gpu/command_buffer/service/shared_image/DEPS b/gpu/command_buffer/service/shared_image/DEPS index e9ee9ee..f0d2442 100644 --- a/gpu/command_buffer/service/shared_image/DEPS +++ b/gpu/command_buffer/service/shared_image/DEPS
@@ -1,3 +1,7 @@ +include_rules = [ + "+third_party/dawn/include", +] + specific_include_rules = { "external_vk_image_backing_factory_unittest\.cc": [ "+components/viz/common/gpu/vulkan_in_process_context_provider.h",
diff --git a/gpu/command_buffer/service/shared_image/ahardwarebuffer_image_backing_factory.cc b/gpu/command_buffer/service/shared_image/ahardwarebuffer_image_backing_factory.cc index 5c42f3d..977e436 100644 --- a/gpu/command_buffer/service/shared_image/ahardwarebuffer_image_backing_factory.cc +++ b/gpu/command_buffer/service/shared_image/ahardwarebuffer_image_backing_factory.cc
@@ -36,6 +36,7 @@ #include "gpu/command_buffer/service/shared_image/gl_texture_android_image_representation.h" #include "gpu/command_buffer/service/shared_image/gl_texture_passthrough_android_image_representation.h" #include "gpu/command_buffer/service/shared_image/shared_image_backing.h" +#include "gpu/command_buffer/service/shared_image/shared_image_format_utils.h" #include "gpu/command_buffer/service/shared_image/shared_image_representation.h" #include "gpu/command_buffer/service/shared_image/skia_gl_image_representation.h" #include "gpu/command_buffer/service/shared_image/skia_vk_android_image_representation.h" @@ -415,7 +416,7 @@ // Only Vulkan is supported on Android currently DCHECK_EQ(backend_type, WGPUBackendType_Vulkan); - WGPUTextureFormat webgpu_format = viz::ToWGPUFormat(format()); + WGPUTextureFormat webgpu_format = ToWGPUFormat(format()); if (webgpu_format == WGPUTextureFormat_Undefined) { LOG(ERROR) << "Unable to fine a suitable WebGPU format."; return nullptr;
diff --git a/gpu/command_buffer/service/shared_image/ahardwarebuffer_image_backing_factory.h b/gpu/command_buffer/service/shared_image/ahardwarebuffer_image_backing_factory.h index b1e70fc..c4436b0 100644 --- a/gpu/command_buffer/service/shared_image/ahardwarebuffer_image_backing_factory.h +++ b/gpu/command_buffer/service/shared_image/ahardwarebuffer_image_backing_factory.h
@@ -7,7 +7,6 @@ #include <dawn/dawn_proc_table.h> -#include "components/viz/common/resources/resource_format.h" #include "gpu/command_buffer/service/shared_image/shared_image_backing_factory.h" #include "gpu/gpu_gles2_export.h" #include "ui/gl/gl_bindings.h"
diff --git a/gpu/command_buffer/service/shared_image/angle_vulkan_image_backing.cc b/gpu/command_buffer/service/shared_image/angle_vulkan_image_backing.cc index b6b0d73..d9dc5d8 100644 --- a/gpu/command_buffer/service/shared_image/angle_vulkan_image_backing.cc +++ b/gpu/command_buffer/service/shared_image/angle_vulkan_image_backing.cc
@@ -11,6 +11,7 @@ #include "gpu/command_buffer/common/shared_image_trace_utils.h" #include "gpu/command_buffer/common/shared_image_usage.h" #include "gpu/command_buffer/service/shared_image/gl_texture_image_backing_helper.h" +#include "gpu/command_buffer/service/shared_image/shared_image_format_utils.h" #include "gpu/command_buffer/service/shared_image/shared_image_representation.h" #include "gpu/command_buffer/service/skia_utils.h" #include "gpu/vulkan/vulkan_device_queue.h" @@ -464,7 +465,7 @@ auto egl_image = base::MakeRefCounted<gl::GLImageEGLAngleVulkan>(size()); if (!egl_image->Initialize(vulkan_image_->image(), &vulkan_image_->create_info(), - viz::GLInternalFormat(format()))) { + GLInternalFormat(format()))) { return false; }
diff --git a/gpu/command_buffer/service/shared_image/d3d_image_backing.cc b/gpu/command_buffer/service/shared_image/d3d_image_backing.cc index 5b02c45..374c5cc 100644 --- a/gpu/command_buffer/service/shared_image/d3d_image_backing.cc +++ b/gpu/command_buffer/service/shared_image/d3d_image_backing.cc
@@ -11,13 +11,13 @@ #include "base/memory/ptr_util.h" #include "base/memory/raw_ptr.h" #include "base/trace_event/memory_dump_manager.h" -#include "components/viz/common/resources/resource_format_utils.h" #include "components/viz/common/resources/resource_sizes.h" #include "gpu/command_buffer/common/constants.h" #include "gpu/command_buffer/common/shared_image_trace_utils.h" #include "gpu/command_buffer/common/shared_image_usage.h" #include "gpu/command_buffer/service/dxgi_shared_handle_manager.h" #include "gpu/command_buffer/service/shared_image/d3d_image_representation.h" +#include "gpu/command_buffer/service/shared_image/shared_image_format_utils.h" #include "gpu/command_buffer/service/shared_image/skia_gl_image_representation.h" #include "gpu/command_buffer/service/shared_memory_region_wrapper.h" #include "third_party/libyuv/include/libyuv/planar_functions.h" @@ -115,7 +115,7 @@ size_t dest_stride, viz::SharedImageFormat format, const gfx::Size& size) { - int row_bytes = size.width() * viz::BitsPerPixel(format) / 8; + int row_bytes = size.width() * BitsPerPixel(format) / 8; libyuv::CopyPlane(source_memory, source_stride, dest_memory, dest_stride, row_bytes, size.height()); } @@ -151,12 +151,12 @@ // The GL internal format can differ from the underlying swap chain or texture // format e.g. RGBA or RGB instead of BGRA or RED/RG for NV12 texture planes. // See EGL_ANGLE_d3d_texture_client_buffer spec for format restrictions. - const auto internal_format = viz::GLInternalFormat(format); - const auto data_type = viz::GLDataType(format); + const auto internal_format = GLInternalFormat(format); + const auto data_type = GLDataType(format); auto image = base::MakeRefCounted<gl::GLImageD3D>( size, internal_format, data_type, color_space, d3d11_texture, array_slice, plane_index, swap_chain); - DCHECK_EQ(image->GetDataFormat(), viz::GLDataFormat(format)); + DCHECK_EQ(image->GetDataFormat(), GLDataFormat(format)); if (!image->Initialize()) { LOG(ERROR) << "GLImageD3D::Initialize failed"; api->glDeleteTexturesFn(1, &service_id); @@ -362,7 +362,7 @@ usage, gl_texture ? gl_texture->estimated_size() - : gfx::BufferSizeForBufferFormat(size, viz::BufferFormat(format)), + : gfx::BufferSizeForBufferFormat(size, ToBufferFormat(format)), false /* is_thread_safe */), d3d11_texture_(std::move(d3d11_texture)), gl_texture_(std::move(gl_texture)), @@ -570,16 +570,15 @@ device); } #endif - const viz::SharedImageFormat viz_si_format = format(); - const WGPUTextureFormat wgpu_format = viz::ToWGPUFormat(viz_si_format); + const WGPUTextureFormat wgpu_format = ToWGPUFormat(format()); if (wgpu_format == WGPUTextureFormat_Undefined) { - LOG(ERROR) << "Unsupported viz format found: " << viz_si_format.ToString(); + LOG(ERROR) << "Unsupported viz format found: " << format().ToString(); return nullptr; } const WGPUTextureUsageFlags usage = GetAllowedDawnUsages(wgpu_format); if (usage == WGPUTextureUsage_None) { LOG(ERROR) << "WGPUTextureUsage is unknown for viz format: " - << viz_si_format.ToString(); + << format().ToString(); return nullptr; } @@ -945,8 +944,8 @@ // Lazily create a GL image if it wasn't provided on initialization. There's // no need to bind to a GL texture since the image is only used for overlay. if (!gl_image) { - const auto internal_format = viz::GLInternalFormat(format()); - const auto data_type = viz::GLDataType(format()); + const auto internal_format = GLInternalFormat(format()); + const auto data_type = GLDataType(format()); gl_image = base::MakeRefCounted<gl::GLImageD3D>( size(), internal_format, data_type, color_space(), d3d11_texture_, array_slice_, plane_index_, swap_chain_);
diff --git a/gpu/command_buffer/service/shared_image/d3d_image_backing_factory.cc b/gpu/command_buffer/service/shared_image/d3d_image_backing_factory.cc index 49ca9f8..c453922c 100644 --- a/gpu/command_buffer/service/shared_image/d3d_image_backing_factory.cc +++ b/gpu/command_buffer/service/shared_image/d3d_image_backing_factory.cc
@@ -13,6 +13,7 @@ #include "gpu/command_buffer/common/shared_image_usage.h" #include "gpu/command_buffer/service/dxgi_shared_handle_manager.h" #include "gpu/command_buffer/service/shared_image/d3d_image_backing.h" +#include "gpu/command_buffer/service/shared_image/shared_image_format_utils.h" #include "ui/gfx/buffer_format_util.h" #include "ui/gfx/buffer_types.h" #include "ui/gl/direct_composition_support.h" @@ -54,9 +55,8 @@ // Only RGBA formats supported by CreateSharedImage. absl::optional<DXGI_FORMAT> GetSupportedRGBAFormat( - viz::SharedImageFormat viz_si_format) { - auto viz_resource_format = viz_si_format.resource_format(); - switch (viz_resource_format) { + viz::SharedImageFormat si_format) { + switch (si_format.resource_format()) { case viz::RGBA_F16: return DXGI_FORMAT_R16G16B16A16_FLOAT; case viz::BGRA_8888: @@ -519,7 +519,7 @@ return false; } } else if (gmb_type == gfx::DXGI_SHARED_HANDLE) { - if (GetDXGIFormat(viz::BufferFormat(format)) == DXGI_FORMAT_UNKNOWN) + if (GetDXGIFormat(ToBufferFormat(format)) == DXGI_FORMAT_UNKNOWN) return false; } else { return false;
diff --git a/gpu/command_buffer/service/shared_image/d3d_image_representation.cc b/gpu/command_buffer/service/shared_image/d3d_image_representation.cc index 899759cb..d964812 100644 --- a/gpu/command_buffer/service/shared_image/d3d_image_representation.cc +++ b/gpu/command_buffer/service/shared_image/d3d_image_representation.cc
@@ -4,7 +4,6 @@ #include "gpu/command_buffer/service/shared_image/d3d_image_representation.h" -#include "components/viz/common/resources/resource_format_utils.h" #include "gpu/command_buffer/common/constants.h" #include "gpu/command_buffer/common/shared_image_usage.h" #include "gpu/command_buffer/service/shared_image/d3d_image_backing.h"
diff --git a/gpu/command_buffer/service/shared_image/dawn_egl_image_representation.cc b/gpu/command_buffer/service/shared_image/dawn_egl_image_representation.cc index 3d445b6..b890628 100644 --- a/gpu/command_buffer/service/shared_image/dawn_egl_image_representation.cc +++ b/gpu/command_buffer/service/shared_image/dawn_egl_image_representation.cc
@@ -5,7 +5,7 @@ #include "gpu/command_buffer/service/shared_image/dawn_egl_image_representation.h" #include "build/build_config.h" -#include "components/viz/common/resources/resource_format_utils.h" +#include "gpu/command_buffer/service/shared_image/shared_image_format_utils.h" #include "gpu/command_buffer/service/texture_manager.h" #include "ui/gl/gl_image.h" @@ -50,7 +50,7 @@ gl_representation_->BeginAccess(ToSharedImageAccessGLMode(usage)); WGPUTextureDescriptor texture_descriptor = {}; texture_descriptor.nextInChain = nullptr; - texture_descriptor.format = viz::ToWGPUFormat(format()); + texture_descriptor.format = ToWGPUFormat(format()); texture_descriptor.usage = WGPUTextureUsage_CopySrc | WGPUTextureUsage_CopyDst | WGPUTextureUsage_RenderAttachment;
diff --git a/gpu/command_buffer/service/shared_image/dcomp_image_backing_factory.cc b/gpu/command_buffer/service/shared_image/dcomp_image_backing_factory.cc index f643341..be47a1c 100644 --- a/gpu/command_buffer/service/shared_image/dcomp_image_backing_factory.cc +++ b/gpu/command_buffer/service/shared_image/dcomp_image_backing_factory.cc
@@ -6,7 +6,6 @@ #include <d3d11_1.h> -#include "components/viz/common/resources/resource_format_utils.h" #include "components/viz/common/resources/shared_image_format.h" #include "gpu/command_buffer/common/shared_image_usage.h" #include "gpu/command_buffer/service/shared_image/dcomp_surface_image_backing.h"
diff --git a/gpu/command_buffer/service/shared_image/dcomp_image_backing_factory.h b/gpu/command_buffer/service/shared_image/dcomp_image_backing_factory.h index 4e71d8ee..eab8be9 100644 --- a/gpu/command_buffer/service/shared_image/dcomp_image_backing_factory.h +++ b/gpu/command_buffer/service/shared_image/dcomp_image_backing_factory.h
@@ -7,7 +7,6 @@ #include <memory> -#include "components/viz/common/resources/resource_format.h" #include "gpu/command_buffer/service/shared_image/shared_image_backing_factory.h" #include "gpu/gpu_gles2_export.h"
diff --git a/gpu/command_buffer/service/shared_image/dcomp_surface_image_backing.cc b/gpu/command_buffer/service/shared_image/dcomp_surface_image_backing.cc index c8f8217..139a86ab 100644 --- a/gpu/command_buffer/service/shared_image/dcomp_surface_image_backing.cc +++ b/gpu/command_buffer/service/shared_image/dcomp_surface_image_backing.cc
@@ -9,6 +9,7 @@ #include "components/viz/common/resources/resource_format_utils.h" #include "gpu/command_buffer/common/shared_image_usage.h" #include "gpu/command_buffer/service/shared_context_state.h" +#include "gpu/command_buffer/service/shared_image/shared_image_format_utils.h" #include "third_party/angle/include/EGL/egl.h" #include "third_party/angle/include/EGL/eglext.h" #include "third_party/angle/include/EGL/eglext_angle.h" @@ -181,7 +182,7 @@ surface_origin, alpha_type, usage, - gfx::BufferSizeForBufferFormat(size, viz::BufferFormat(format)), + gfx::BufferSizeForBufferFormat(size, ToBufferFormat(format)), false /* is_thread_safe */), gl_surface_(scoped_refptr( new D3DTextureGLSurfaceEGL(gl::GLSurfaceEGL::GetGLDisplayEGL(),
diff --git a/gpu/command_buffer/service/shared_image/dcomp_surface_image_representation.cc b/gpu/command_buffer/service/shared_image/dcomp_surface_image_representation.cc index 7608fe1..a05804a 100644 --- a/gpu/command_buffer/service/shared_image/dcomp_surface_image_representation.cc +++ b/gpu/command_buffer/service/shared_image/dcomp_surface_image_representation.cc
@@ -5,7 +5,6 @@ #include "gpu/command_buffer/service/shared_image/dcomp_surface_image_representation.h" #include "base/win/windows_types.h" -#include "components/viz/common/resources/resource_format_utils.h" #include "gpu/command_buffer/service/memory_tracking.h" #include "gpu/command_buffer/service/shared_context_state.h" #include "gpu/command_buffer/service/shared_image/dcomp_surface_image_backing.h"
diff --git a/gpu/command_buffer/service/shared_image/dxgi_swap_chain_image_backing.cc b/gpu/command_buffer/service/shared_image/dxgi_swap_chain_image_backing.cc index 23a8780..af96f37 100644 --- a/gpu/command_buffer/service/shared_image/dxgi_swap_chain_image_backing.cc +++ b/gpu/command_buffer/service/shared_image/dxgi_swap_chain_image_backing.cc
@@ -12,8 +12,6 @@ #include "base/synchronization/waitable_event.h" #include "base/trace_event/trace_event.h" #include "base/win/windows_version.h" -#include "components/viz/common/resources/resource_format.h" -#include "components/viz/common/resources/resource_format_utils.h" #include "gpu/command_buffer/common/mailbox.h" #include "gpu/command_buffer/common/shared_image_usage.h" #include "gpu/command_buffer/service/memory_tracking.h" @@ -21,6 +19,7 @@ #include "gpu/command_buffer/service/shared_image/d3d_image_backing.h" #include "gpu/command_buffer/service/shared_image/dxgi_swap_chain_image_representation.h" #include "gpu/command_buffer/service/shared_image/shared_image_backing.h" +#include "gpu/command_buffer/service/shared_image/shared_image_format_utils.h" #include "gpu/command_buffer/service/shared_image/shared_image_manager.h" #include "gpu/command_buffer/service/shared_image/skia_gl_image_representation.h" #include "third_party/skia/include/core/SkAlphaType.h" @@ -157,7 +156,7 @@ surface_origin, alpha_type, usage, - gfx::BufferSizeForBufferFormat(size, viz::BufferFormat(format)), + gfx::BufferSizeForBufferFormat(size, ToBufferFormat(format)), false /* is_thread_safe */), d3d11_device_(std::move(d3d11_device)), dxgi_swap_chain_(std::move(dxgi_swap_chain)) {
diff --git a/gpu/command_buffer/service/shared_image/dxgi_swap_chain_image_backing.h b/gpu/command_buffer/service/shared_image/dxgi_swap_chain_image_backing.h index e0cb091..27747644 100644 --- a/gpu/command_buffer/service/shared_image/dxgi_swap_chain_image_backing.h +++ b/gpu/command_buffer/service/shared_image/dxgi_swap_chain_image_backing.h
@@ -11,7 +11,6 @@ #include <wrl/client.h> #include <utility> -#include "components/viz/common/resources/resource_format.h" #include "gpu/command_buffer/common/mailbox.h" #include "gpu/command_buffer/service/shared_image/shared_image_backing.h" #include "gpu/command_buffer/service/shared_image/shared_image_representation.h"
diff --git a/gpu/command_buffer/service/shared_image/egl_image_backing.h b/gpu/command_buffer/service/shared_image/egl_image_backing.h index 336e81d3..2b8ae7a 100644 --- a/gpu/command_buffer/service/shared_image/egl_image_backing.h +++ b/gpu/command_buffer/service/shared_image/egl_image_backing.h
@@ -7,7 +7,6 @@ #include "base/memory/raw_ptr.h" #include "base/memory/scoped_refptr.h" -#include "components/viz/common/resources/resource_format.h" #include "gpu/command_buffer/service/shared_image/gl_common_image_backing_factory.h" #include "gpu/command_buffer/service/shared_image/gl_texture_image_backing_helper.h" #include "gpu/command_buffer/service/shared_image/shared_image_backing.h"
diff --git a/gpu/command_buffer/service/shared_image/egl_image_backing_factory.cc b/gpu/command_buffer/service/shared_image/egl_image_backing_factory.cc index 4539d923..6eba565 100644 --- a/gpu/command_buffer/service/shared_image/egl_image_backing_factory.cc +++ b/gpu/command_buffer/service/shared_image/egl_image_backing_factory.cc
@@ -6,7 +6,6 @@ #include <algorithm> -#include "components/viz/common/resources/resource_format_utils.h" #include "components/viz/common/resources/resource_sizes.h" #include "gpu/command_buffer/common/mailbox.h" #include "gpu/command_buffer/common/shared_image_usage.h"
diff --git a/gpu/command_buffer/service/shared_image/egl_image_backing_factory.h b/gpu/command_buffer/service/shared_image/egl_image_backing_factory.h index 88b83f8..96e6c9bb 100644 --- a/gpu/command_buffer/service/shared_image/egl_image_backing_factory.h +++ b/gpu/command_buffer/service/shared_image/egl_image_backing_factory.h
@@ -8,7 +8,6 @@ #include <memory> #include "base/memory/raw_ptr.h" -#include "components/viz/common/resources/resource_format.h" #include "gpu/command_buffer/service/shared_image/gl_common_image_backing_factory.h" #include "gpu/command_buffer/service/shared_image/shared_image_backing_factory.h" #include "gpu/config/gpu_driver_bug_workarounds.h"
diff --git a/gpu/command_buffer/service/shared_image/egl_image_backing_factory_unittest.cc b/gpu/command_buffer/service/shared_image/egl_image_backing_factory_unittest.cc index c6a4fae..106e18b2 100644 --- a/gpu/command_buffer/service/shared_image/egl_image_backing_factory_unittest.cc +++ b/gpu/command_buffer/service/shared_image/egl_image_backing_factory_unittest.cc
@@ -9,7 +9,6 @@ #include "base/callback_helpers.h" #include "base/memory/raw_ptr.h" #include "base/strings/stringprintf.h" -#include "components/viz/common/resources/resource_format_utils.h" #include "components/viz/common/resources/resource_sizes.h" #include "gpu/command_buffer/common/gpu_memory_buffer_support.h" #include "gpu/command_buffer/common/mailbox.h" @@ -19,6 +18,7 @@ #include "gpu/command_buffer/service/shared_context_state.h" #include "gpu/command_buffer/service/shared_image/shared_image_backing.h" #include "gpu/command_buffer/service/shared_image/shared_image_factory.h" +#include "gpu/command_buffer/service/shared_image/shared_image_format_utils.h" #include "gpu/command_buffer/service/shared_image/shared_image_manager.h" #include "gpu/command_buffer/service/shared_image/shared_image_representation.h" #include "gpu/command_buffer/service/shared_image/test_utils.h" @@ -400,7 +400,7 @@ const viz::SharedImageFormat format = std::get<1>(param_info.param); return base::StringPrintf( "%s_%s", (allow_passthrough ? "AllowPassthrough" : "DisallowPassthrough"), - gfx::BufferFormatToString(viz::BufferFormat(format))); + format.ToString().c_str()); } INSTANTIATE_TEST_SUITE_P(Service,
diff --git a/gpu/command_buffer/service/shared_image/external_vk_image_backing.cc b/gpu/command_buffer/service/shared_image/external_vk_image_backing.cc index ec0a709..a563190 100644 --- a/gpu/command_buffer/service/shared_image/external_vk_image_backing.cc +++ b/gpu/command_buffer/service/shared_image/external_vk_image_backing.cc
@@ -14,6 +14,7 @@ #include "gpu/command_buffer/service/shared_image/external_vk_image_gl_representation.h" #include "gpu/command_buffer/service/shared_image/external_vk_image_overlay_representation.h" #include "gpu/command_buffer/service/shared_image/external_vk_image_skia_representation.h" +#include "gpu/command_buffer/service/shared_image/shared_image_format_utils.h" #include "gpu/command_buffer/service/skia_utils.h" #include "gpu/ipc/common/vulkan_ycbcr_info.h" #include "gpu/vulkan/vma_wrapper.h" @@ -573,7 +574,7 @@ WGPUDevice wgpuDevice, WGPUBackendType backend_type) { #if (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)) && BUILDFLAG(USE_DAWN) - auto wgpu_format = viz::ToWGPUFormat(format()); + auto wgpu_format = ToWGPUFormat(format()); if (wgpu_format == WGPUTextureFormat_Undefined) { DLOG(ERROR) << "Format not supported for Dawn"; @@ -650,7 +651,7 @@ ->feature_info() ->feature_flags() .angle_rgbx_internal_format; - GLuint internal_format = viz::TextureStorageFormat(format(), use_rgbx); + GLuint internal_format = TextureStorageFormat(format(), use_rgbx); api->glTexStorage2DEXTFn(GL_TEXTURE_2D, 1, internal_format, size().width(), size().height()); } else { @@ -675,7 +676,7 @@ ->feature_info() ->feature_flags() .angle_rgbx_internal_format; - GLuint internal_format = viz::TextureStorageFormat(format(), use_rgbx); + GLuint internal_format = TextureStorageFormat(format(), use_rgbx); if (UseMinimalUsageFlags(context_state())) { api->glTexStorageMemFlags2DANGLEFn( GL_TEXTURE_2D, 1, internal_format, size().width(), size().height(), @@ -707,9 +708,9 @@ ->feature_info() ->feature_flags() .angle_rgbx_internal_format; - GLuint internal_format = viz::TextureStorageFormat(format(), use_rgbx); - GLenum gl_format = viz::GLDataFormat(format()); - GLenum gl_type = viz::GLDataType(format()); + GLuint internal_format = TextureStorageFormat(format(), use_rgbx); + GLenum gl_format = GLDataFormat(format()); + GLenum gl_type = GLDataType(format()); texture_ = gles2::CreateGLES2TextureWithLightRef(texture_service_id, GL_TEXTURE_2D); @@ -745,9 +746,9 @@ ->feature_info() ->feature_flags() .angle_rgbx_internal_format; - GLuint internal_format = viz::TextureStorageFormat(format(), use_rgbx); - GLenum gl_format = viz::GLDataFormat(format()); - GLenum gl_type = viz::GLDataType(format()); + GLuint internal_format = TextureStorageFormat(format(), use_rgbx); + GLenum gl_format = GLDataFormat(format()); + GLenum gl_type = GLDataType(format()); texture_passthrough_ = base::MakeRefCounted<gpu::gles2::TexturePassthrough>( texture_service_id, GL_TEXTURE_2D, internal_format, size().width(),
diff --git a/gpu/command_buffer/service/shared_image/gl_common_image_backing_factory.cc b/gpu/command_buffer/service/shared_image/gl_common_image_backing_factory.cc index 37870ae..a5770d8 100644 --- a/gpu/command_buffer/service/shared_image/gl_common_image_backing_factory.cc +++ b/gpu/command_buffer/service/shared_image/gl_common_image_backing_factory.cc
@@ -7,7 +7,8 @@ #include <algorithm> #include <list> -#include "components/viz/common/resources/resource_sizes.h" +#include "components/viz/common/resources/resource_format.h" +#include "components/viz/common/resources/resource_format_utils.h" #include "gpu/command_buffer/common/mailbox.h" #include "gpu/command_buffer/service/service_utils.h" #include "gpu/config/gpu_preferences.h"
diff --git a/gpu/command_buffer/service/shared_image/gl_ozone_image_representation.cc b/gpu/command_buffer/service/shared_image/gl_ozone_image_representation.cc index 51cfecf..f5551ee 100644 --- a/gpu/command_buffer/service/shared_image/gl_ozone_image_representation.cc +++ b/gpu/command_buffer/service/shared_image/gl_ozone_image_representation.cc
@@ -7,12 +7,11 @@ #include "base/memory/ptr_util.h" #include "base/memory/scoped_refptr.h" -#include "components/viz/common/resources/resource_format.h" -#include "components/viz/common/resources/resource_format_utils.h" #include "gpu/command_buffer/service/gl_utils.h" #include "gpu/command_buffer/service/memory_tracking.h" #include "gpu/command_buffer/service/shared_image/ozone_image_backing.h" #include "gpu/command_buffer/service/shared_image/shared_image_backing.h" +#include "gpu/command_buffer/service/shared_image/shared_image_format_utils.h" #include "gpu/command_buffer/service/shared_image/shared_image_manager.h" #include "gpu/command_buffer/service/shared_image/shared_image_representation.h" #include "gpu/command_buffer/service/texture_manager.h" @@ -111,7 +110,7 @@ return nullptr; } - gfx::BufferFormat buffer_format = viz::BufferFormat(backing->format()); + gfx::BufferFormat buffer_format = ToBufferFormat(backing->format()); target = !NativeBufferNeedsPlatformSpecificTextureTarget(buffer_format, plane) ? GL_TEXTURE_2D : gpu::GetPlatformSpecificTextureTarget();
diff --git a/gpu/command_buffer/service/shared_image/gl_ozone_image_representation.h b/gpu/command_buffer/service/shared_image/gl_ozone_image_representation.h index a93ecb8..6a5f072 100644 --- a/gpu/command_buffer/service/shared_image/gl_ozone_image_representation.h +++ b/gpu/command_buffer/service/shared_image/gl_ozone_image_representation.h
@@ -8,7 +8,6 @@ #include <memory> #include "base/memory/raw_ptr.h" #include "base/memory/scoped_refptr.h" -#include "components/viz/common/resources/resource_format.h" #include "gpu/command_buffer/service/memory_tracking.h" #include "gpu/command_buffer/service/shared_image/shared_image_backing.h" #include "gpu/command_buffer/service/shared_image/shared_image_manager.h"
diff --git a/gpu/command_buffer/service/shared_image/gl_texture_image_backing.cc b/gpu/command_buffer/service/shared_image/gl_texture_image_backing.cc index 9a73262..700ea51 100644 --- a/gpu/command_buffer/service/shared_image/gl_texture_image_backing.cc +++ b/gpu/command_buffer/service/shared_image/gl_texture_image_backing.cc
@@ -14,7 +14,6 @@ #include "base/trace_event/trace_event.h" #include "build/build_config.h" #include "components/viz/common/resources/resource_format.h" -#include "components/viz/common/resources/resource_format_utils.h" #include "components/viz/common/resources/resource_sizes.h" #include "gpu/command_buffer/common/gles2_cmd_utils.h" #include "gpu/command_buffer/common/shared_image_trace_utils.h" @@ -28,6 +27,7 @@ #include "gpu/command_buffer/service/shared_image/gl_texture_common_representations.h" #include "gpu/command_buffer/service/shared_image/shared_image_backing.h" #include "gpu/command_buffer/service/shared_image/shared_image_factory.h" +#include "gpu/command_buffer/service/shared_image/shared_image_format_utils.h" #include "gpu/command_buffer/service/shared_image/shared_image_representation.h" #include "gpu/command_buffer/service/skia_utils.h" #include "gpu/config/gpu_finch_features.h" @@ -69,7 +69,7 @@ GLTextureImageBackingHelper::InitializeGLTextureParams; int BytesPerPixel(viz::SharedImageFormat format) { - int bits = viz::BitsPerPixel(format); + int bits = BitsPerPixel(format); DCHECK_GE(bits, 8); return bits / 8; } @@ -254,7 +254,7 @@ DCHECK(HasExpectedAlignment(pixmap_stride, resource_format)); size_t expected_stride = gfx::RowSizeForBufferFormat( - size().width(), viz::BufferFormat(format()), /*plane=*/0); + size().width(), ToBufferFormat(format()), /*plane=*/0); DCHECK(HasExpectedAlignment(expected_stride, resource_format)); DCHECK_GE(pixmap_stride, expected_stride); @@ -493,7 +493,7 @@ ui::ScopedMakeCurrent smc(shared_context_state->context(), shared_context_state->surface()); auto image_np = base::MakeRefCounted<gl::GLImageNativePixmap>( - size(), viz::BufferFormat(format())); + size(), ToBufferFormat(format())); image_np->InitializeFromTexture(GetGLServiceId()); image_egl_ = image_np; if (passthrough_texture_) {
diff --git a/gpu/command_buffer/service/shared_image/gl_texture_image_backing.h b/gpu/command_buffer/service/shared_image/gl_texture_image_backing.h index 39936695..00860c7 100644 --- a/gpu/command_buffer/service/shared_image/gl_texture_image_backing.h +++ b/gpu/command_buffer/service/shared_image/gl_texture_image_backing.h
@@ -5,7 +5,6 @@ #ifndef GPU_COMMAND_BUFFER_SERVICE_SHARED_IMAGE_GL_TEXTURE_IMAGE_BACKING_H_ #define GPU_COMMAND_BUFFER_SERVICE_SHARED_IMAGE_GL_TEXTURE_IMAGE_BACKING_H_ -#include "components/viz/common/resources/resource_format.h" #include "gpu/command_buffer/service/shared_image/gl_texture_image_backing_helper.h" namespace gl {
diff --git a/gpu/command_buffer/service/shared_image/gl_texture_image_backing_factory.cc b/gpu/command_buffer/service/shared_image/gl_texture_image_backing_factory.cc index 035c2fd..595a1521 100644 --- a/gpu/command_buffer/service/shared_image/gl_texture_image_backing_factory.cc +++ b/gpu/command_buffer/service/shared_image/gl_texture_image_backing_factory.cc
@@ -13,6 +13,7 @@ #include "gpu/command_buffer/common/shared_image_usage.h" #include "gpu/command_buffer/service/service_utils.h" #include "gpu/command_buffer/service/shared_image/gl_texture_image_backing.h" +#include "gpu/command_buffer/service/shared_image/shared_image_format_utils.h" #include "gpu/config/gpu_preferences.h" #include "ui/gl/gl_gl_api_implementation.h" #include "ui/gl/progress_reporter.h" @@ -108,9 +109,9 @@ kPremul_SkAlphaType, usage, false /* is_passthrough */); InitializeGLTextureParams params; params.target = target; - params.internal_format = viz::GLInternalFormat(format); - params.format = viz::GLDataFormat(format); - params.type = viz::GLDataType(format); + params.internal_format = GLInternalFormat(format); + params.format = GLDataFormat(format); + params.type = GLDataType(format); params.is_cleared = is_cleared; result->InitializeGLTexture(service_id, params); return std::move(result);
diff --git a/gpu/command_buffer/service/shared_image/gl_texture_image_backing_factory.h b/gpu/command_buffer/service/shared_image/gl_texture_image_backing_factory.h index 00c43ab..8b6ab1bf 100644 --- a/gpu/command_buffer/service/shared_image/gl_texture_image_backing_factory.h +++ b/gpu/command_buffer/service/shared_image/gl_texture_image_backing_factory.h
@@ -7,7 +7,6 @@ #include <memory> -#include "components/viz/common/resources/resource_format.h" #include "gpu/command_buffer/service/shared_image/gl_common_image_backing_factory.h" #include "gpu/command_buffer/service/shared_image/gl_texture_image_backing_helper.h"
diff --git a/gpu/command_buffer/service/shared_image/gl_texture_image_backing_factory_unittest.cc b/gpu/command_buffer/service/shared_image/gl_texture_image_backing_factory_unittest.cc index 547c481..8b88aacf 100644 --- a/gpu/command_buffer/service/shared_image/gl_texture_image_backing_factory_unittest.cc +++ b/gpu/command_buffer/service/shared_image/gl_texture_image_backing_factory_unittest.cc
@@ -20,6 +20,7 @@ #include "gpu/command_buffer/service/shared_context_state.h" #include "gpu/command_buffer/service/shared_image/shared_image_backing.h" #include "gpu/command_buffer/service/shared_image/shared_image_factory.h" +#include "gpu/command_buffer/service/shared_image/shared_image_format_utils.h" #include "gpu/command_buffer/service/shared_image/shared_image_manager.h" #include "gpu/command_buffer/service/shared_image/shared_image_representation.h" #include "gpu/command_buffer/service/shared_image/test_utils.h" @@ -251,17 +252,17 @@ for (int i = 0; i <= viz::RESOURCE_FORMAT_MAX; ++i) { auto format = viz::SharedImageFormat::SinglePlane( static_cast<viz::ResourceFormat>(i)); - if (!viz::GLSupportsFormat(format) || format.IsCompressed()) + if (!GLSupportsFormat(format) || format.IsCompressed()) continue; - int storage_format = viz::TextureStorageFormat( + int storage_format = TextureStorageFormat( format, feature_info->feature_flags().angle_rgbx_internal_format); - int image_gl_format = viz::GLDataFormat(format); + int image_gl_format = GLDataFormat(format); int storage_gl_format = gles2::TextureManager::ExtractFormatFromStorageFormat(storage_format); EXPECT_EQ(image_gl_format, storage_gl_format); - int image_gl_type = viz::GLDataType(format); + int image_gl_type = GLDataType(format); int storage_gl_type = gles2::TextureManager::ExtractTypeFromStorageFormat(storage_format); @@ -274,7 +275,7 @@ } // confirm that we support TexStorage2D only if we support TexImage2D: - int image_internal_format = viz::GLInternalFormat(format); + int image_internal_format = GLInternalFormat(format); bool supports_tex_image = validators->texture_internal_format.IsValid(image_internal_format) && validators->texture_format.IsValid(image_gl_format) &&
diff --git a/gpu/command_buffer/service/shared_image/gl_texture_image_backing_helper.cc b/gpu/command_buffer/service/shared_image/gl_texture_image_backing_helper.cc index e8dcffe..c08c70d 100644 --- a/gpu/command_buffer/service/shared_image/gl_texture_image_backing_helper.cc +++ b/gpu/command_buffer/service/shared_image/gl_texture_image_backing_helper.cc
@@ -4,7 +4,6 @@ #include "gpu/command_buffer/service/shared_image/gl_texture_image_backing_helper.h" -#include "components/viz/common/resources/resource_format_utils.h" #include "gpu/command_buffer/common/shared_image_usage.h" #include "gpu/command_buffer/service/context_state.h" #include "gpu/command_buffer/service/gl_utils.h"
diff --git a/gpu/command_buffer/service/shared_image/iosurface_image_backing_factory.mm b/gpu/command_buffer/service/shared_image/iosurface_image_backing_factory.mm index 4e77e9ab..4e872c1f 100644 --- a/gpu/command_buffer/service/shared_image/iosurface_image_backing_factory.mm +++ b/gpu/command_buffer/service/shared_image/iosurface_image_backing_factory.mm
@@ -18,6 +18,7 @@ #include "gpu/command_buffer/service/shared_image/iosurface_image_backing.h" #include "gpu/command_buffer/service/shared_image/shared_image_backing.h" #include "gpu/command_buffer/service/shared_image/shared_image_factory.h" +#include "gpu/command_buffer/service/shared_image/shared_image_format_utils.h" #include "gpu/command_buffer/service/shared_image/shared_image_representation.h" #include "gpu/command_buffer/service/skia_utils.h" #include "gpu/command_buffer/service/texture_manager.h" @@ -54,7 +55,7 @@ TRACE_EVENT0("gpu", "IOSurfaceImageBackingFactory::CreateMetalTexture"); base::scoped_nsprotocol<id<MTLTexture>> mtl_texture; MTLPixelFormat mtl_pixel_format = - static_cast<MTLPixelFormat>(viz::ToMTLPixelFormat(format)); + static_cast<MTLPixelFormat>(ToMTLPixelFormat(format)); if (mtl_pixel_format == MTLPixelFormatInvalid) return mtl_texture;
diff --git a/gpu/command_buffer/service/shared_image/iosurface_image_backing_factory_unittest.cc b/gpu/command_buffer/service/shared_image/iosurface_image_backing_factory_unittest.cc index b4163c44..3b3a671 100644 --- a/gpu/command_buffer/service/shared_image/iosurface_image_backing_factory_unittest.cc +++ b/gpu/command_buffer/service/shared_image/iosurface_image_backing_factory_unittest.cc
@@ -13,6 +13,7 @@ #include "gpu/command_buffer/common/shared_image_usage.h" #include "gpu/command_buffer/service/shared_context_state.h" #include "gpu/command_buffer/service/shared_image/shared_image_factory.h" +#include "gpu/command_buffer/service/shared_image/shared_image_format_utils.h" #include "gpu/command_buffer/service/shared_image/shared_image_manager.h" #include "gpu/command_buffer/service/shared_image/shared_image_representation.h" #include "gpu/command_buffer/tests/texture_image_factory.h" @@ -1029,17 +1030,17 @@ for (int i = 0; i <= viz::RESOURCE_FORMAT_MAX; ++i) { auto format = viz::SharedImageFormat::SinglePlane( static_cast<viz::ResourceFormat>(i)); - if (!viz::GLSupportsFormat(format) || format.IsCompressed()) + if (!GLSupportsFormat(format) || format.IsCompressed()) continue; - int storage_format = viz::TextureStorageFormat( + int storage_format = TextureStorageFormat( format, feature_info->feature_flags().angle_rgbx_internal_format); - int image_gl_format = viz::GLDataFormat(format); + int image_gl_format = GLDataFormat(format); int storage_gl_format = gles2::TextureManager::ExtractFormatFromStorageFormat(storage_format); EXPECT_EQ(image_gl_format, storage_gl_format); - int image_gl_type = viz::GLDataType(format); + int image_gl_type = GLDataType(format); int storage_gl_type = gles2::TextureManager::ExtractTypeFromStorageFormat(storage_format); @@ -1052,7 +1053,7 @@ } // confirm that we support TexStorage2D only if we support TexImage2D: - int image_internal_format = viz::GLInternalFormat(format); + int image_internal_format = GLInternalFormat(format); bool supports_tex_image = validators->texture_internal_format.IsValid(image_internal_format) && validators->texture_format.IsValid(image_gl_format) && @@ -1142,7 +1143,7 @@ TEST_P(IOSurfaceImageBackingFactoryWithGMBTest, GpuMemoryBufferImportEmpty) { auto mailbox = Mailbox::GenerateForSharedImage(); gfx::Size size(256, 256); - gfx::BufferFormat format = viz::BufferFormat(get_format()); + gfx::BufferFormat format = ToBufferFormat(get_format()); auto color_space = gfx::ColorSpace::CreateSRGB(); GrSurfaceOrigin surface_origin = kTopLeft_GrSurfaceOrigin; SkAlphaType alpha_type = kPremul_SkAlphaType; @@ -1165,7 +1166,7 @@ } auto mailbox = Mailbox::GenerateForSharedImage(); gfx::Size size(256, 256); - gfx::BufferFormat format = viz::BufferFormat(get_format()); + gfx::BufferFormat format = ToBufferFormat(get_format()); auto color_space = gfx::ColorSpace::CreateSRGB(); GrSurfaceOrigin surface_origin = kTopLeft_GrSurfaceOrigin; SkAlphaType alpha_type = kPremul_SkAlphaType; @@ -1217,8 +1218,7 @@ std::string TestParamToString( const testing::TestParamInfo<viz::SharedImageFormat>& param_info) { - return base::StringPrintf( - "%s", gfx::BufferFormatToString(viz::BufferFormat(param_info.param))); + return param_info.param.ToString(); } INSTANTIATE_TEST_SUITE_P(Service,
diff --git a/gpu/command_buffer/service/shared_image/ozone_image_backing.cc b/gpu/command_buffer/service/shared_image/ozone_image_backing.cc index e335e928..3b88593 100644 --- a/gpu/command_buffer/service/shared_image/ozone_image_backing.cc +++ b/gpu/command_buffer/service/shared_image/ozone_image_backing.cc
@@ -13,13 +13,12 @@ #include "base/memory/scoped_refptr.h" #include "build/build_config.h" #include "components/viz/common/gpu/vulkan_context_provider.h" -#include "components/viz/common/resources/resource_format.h" -#include "components/viz/common/resources/resource_format_utils.h" #include "gpu/command_buffer/common/mailbox.h" #include "gpu/command_buffer/common/shared_image_usage.h" #include "gpu/command_buffer/service/memory_tracking.h" #include "gpu/command_buffer/service/shared_context_state.h" #include "gpu/command_buffer/service/shared_image/gl_ozone_image_representation.h" +#include "gpu/command_buffer/service/shared_image/shared_image_format_utils.h" #include "gpu/command_buffer/service/shared_image/shared_image_manager.h" #include "gpu/command_buffer/service/shared_image/shared_image_representation.h" #include "gpu/command_buffer/service/shared_image/skia_gl_image_representation.h" @@ -134,7 +133,7 @@ WGPUBackendType backend_type) { #if BUILDFLAG(USE_DAWN) DCHECK(dawn_procs_); - WGPUTextureFormat webgpu_format = viz::ToWGPUFormat(format()); + WGPUTextureFormat webgpu_format = ToWGPUFormat(format()); if (webgpu_format == WGPUTextureFormat_Undefined) { return nullptr; }
diff --git a/gpu/command_buffer/service/shared_image/ozone_image_backing.h b/gpu/command_buffer/service/shared_image/ozone_image_backing.h index 0007b9a3..c5054771 100644 --- a/gpu/command_buffer/service/shared_image/ozone_image_backing.h +++ b/gpu/command_buffer/service/shared_image/ozone_image_backing.h
@@ -12,7 +12,6 @@ #include "base/containers/flat_map.h" #include "base/memory/ref_counted.h" #include "base/memory/scoped_refptr.h" -#include "components/viz/common/resources/resource_format.h" #include "gpu/command_buffer/common/mailbox.h" #include "gpu/command_buffer/service/memory_tracking.h" #include "gpu/command_buffer/service/shared_context_state.h"
diff --git a/gpu/command_buffer/service/shared_image/ozone_image_backing_factory.cc b/gpu/command_buffer/service/shared_image/ozone_image_backing_factory.cc index 03bac41..5eaa0360 100644 --- a/gpu/command_buffer/service/shared_image/ozone_image_backing_factory.cc +++ b/gpu/command_buffer/service/shared_image/ozone_image_backing_factory.cc
@@ -17,6 +17,7 @@ #include "gpu/command_buffer/common/shared_image_usage.h" #include "gpu/command_buffer/service/service_utils.h" #include "gpu/command_buffer/service/shared_image/ozone_image_backing.h" +#include "gpu/command_buffer/service/shared_image/shared_image_format_utils.h" #include "gpu/command_buffer/service/shared_memory_region_wrapper.h" #include "ui/gfx/gpu_memory_buffer.h" #include "ui/gfx/native_pixmap.h" @@ -73,7 +74,7 @@ GrSurfaceOrigin surface_origin, SkAlphaType alpha_type, uint32_t usage) { - gfx::BufferFormat buffer_format = viz::BufferFormat(format); + gfx::BufferFormat buffer_format = ToBufferFormat(format); VulkanDeviceQueue* device_queue = nullptr; #if BUILDFLAG(ENABLE_VULKAN) DCHECK(shared_context_state_); @@ -210,7 +211,7 @@ return false; } auto* factory = ui::OzonePlatform::GetInstance()->GetSurfaceFactoryOzone(); - if (!factory->CanCreateNativePixmapForFormat(viz::BufferFormat(format))) + if (!factory->CanCreateNativePixmapForFormat(ToBufferFormat(format))) return false; ui::GLOzone* gl_ozone = factory->GetCurrentGLOzone();
diff --git a/gpu/command_buffer/service/shared_image/shared_image_format_utils.cc b/gpu/command_buffer/service/shared_image/shared_image_format_utils.cc new file mode 100644 index 0000000..9ae0803 --- /dev/null +++ b/gpu/command_buffer/service/shared_image/shared_image_format_utils.cc
@@ -0,0 +1,57 @@ +// Copyright 2022 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "gpu/command_buffer/service/shared_image/shared_image_format_utils.h" + +#include "base/notreached.h" +#include "components/viz/common/resources/resource_format.h" +#include "components/viz/common/resources/resource_format_utils.h" + +namespace gpu { + +// TODO (hitawala): Add support for multiplanar formats. + +int BitsPerPixel(viz::SharedImageFormat format) { + return viz::BitsPerPixel(format.resource_format()); +} + +gfx::BufferFormat ToBufferFormat(viz::SharedImageFormat format) { + return viz::BufferFormat(format.resource_format()); +} + +bool GLSupportsFormat(viz::SharedImageFormat format) { + return viz::GLSupportsFormat(format.resource_format()); +} +unsigned int GLDataType(viz::SharedImageFormat format) { + return viz::GLDataType(format.resource_format()); +} +unsigned int GLDataFormat(viz::SharedImageFormat format) { + return viz::GLDataFormat(format.resource_format()); +} +unsigned int GLInternalFormat(viz::SharedImageFormat format) { + return viz::GLInternalFormat(format.resource_format()); +} +unsigned int TextureStorageFormat(viz::SharedImageFormat format, + bool use_angle_rgbx_format) { + return viz::TextureStorageFormat(format.resource_format(), + use_angle_rgbx_format); +} + +#if BUILDFLAG(ENABLE_VULKAN) +bool HasVkFormat(viz::SharedImageFormat format) { + return viz::HasVkFormat(format.resource_format()); +} +VkFormat ToVkFormat(viz::SharedImageFormat format) { + return viz::ToVkFormat(format.resource_format()); +} +#endif + +wgpu::TextureFormat ToDawnFormat(viz::SharedImageFormat format) { + return viz::ToDawnFormat(format.resource_format()); +} +WGPUTextureFormat ToWGPUFormat(viz::SharedImageFormat format) { + return viz::ToWGPUFormat(format.resource_format()); +} + +} // namespace gpu
diff --git a/gpu/command_buffer/service/shared_image/shared_image_format_utils.h b/gpu/command_buffer/service/shared_image/shared_image_format_utils.h new file mode 100644 index 0000000..de449b9d --- /dev/null +++ b/gpu/command_buffer/service/shared_image/shared_image_format_utils.h
@@ -0,0 +1,77 @@ +// Copyright 2022 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef GPU_COMMAND_BUFFER_SERVICE_SHARED_IMAGE_SHARED_IMAGE_FORMAT_UTILS_H_ +#define GPU_COMMAND_BUFFER_SERVICE_SHARED_IMAGE_SHARED_IMAGE_FORMAT_UTILS_H_ + +#include "build/build_config.h" +#include "components/viz/common/resources/shared_image_format.h" +#include "gpu/gpu_gles2_export.h" +#include "gpu/vulkan/buildflags.h" +#include "third_party/dawn/include/dawn/webgpu.h" +#include "third_party/dawn/include/dawn/webgpu_cpp.h" +#include "ui/gfx/buffer_types.h" + +#if BUILDFLAG(ENABLE_VULKAN) +#include <vulkan/vulkan_core.h> +#endif + +namespace gpu { + +// A set of utility functions to get the equivalent GPU API (GL, Vulkan, Dawn, +// Metal) type/format information for a given SharedImageFormat. These functions +// should ideally only be called from the GPU service and viz. +// WARNING: For all following functions, the `format` must be single planar. +// TODO(hitawala): Add multiplanar format support. + +// Returns the bits per pixel for given `format`. +GPU_GLES2_EXPORT int BitsPerPixel(viz::SharedImageFormat format); + +// Returns BufferFormat for given `format`. +GPU_GLES2_EXPORT gfx::BufferFormat ToBufferFormat( + viz::SharedImageFormat format); + +// Following functions return the appropriate GL type/format for a +// SharedImageFormat. +// Returns true if given `format` is supported by GL. +GPU_GLES2_EXPORT bool GLSupportsFormat(viz::SharedImageFormat format); +// Returns GL data type for given `format`. +GPU_GLES2_EXPORT unsigned int GLDataType(viz::SharedImageFormat format); +// Returns GL data format for given `format`. +GPU_GLES2_EXPORT unsigned int GLDataFormat(viz::SharedImageFormat format); +// Returns the GL format used internally for matching with the texture format +// for a given `format`. +GPU_GLES2_EXPORT unsigned int GLInternalFormat(viz::SharedImageFormat format); +// Returns texture storage format for given `format`. +GPU_GLES2_EXPORT unsigned int TextureStorageFormat( + viz::SharedImageFormat format, + bool use_angle_rgbx_format); + +// Following functions return the appropriate Vulkan format for a +// SharedImageFormat. +#if BUILDFLAG(ENABLE_VULKAN) +// Returns true if given `format` is supported by Vulkan. +GPU_GLES2_EXPORT bool HasVkFormat(viz::SharedImageFormat format); +// Returns vulkan format for given `format`. +GPU_GLES2_EXPORT VkFormat ToVkFormat(viz::SharedImageFormat format); +#endif + +// Following functions return the appropriate WebGPU/Dawn format for a +// SharedImageFormat. +// Returns wgpu::TextureFormat format for given `format`. +GPU_GLES2_EXPORT wgpu::TextureFormat ToDawnFormat( + viz::SharedImageFormat format); +// Returns WGPUTextureFormat format for given `format`. +GPU_GLES2_EXPORT WGPUTextureFormat ToWGPUFormat(viz::SharedImageFormat format); + +// Following function return the appropriate Metal format for a +// SharedImageFormat. +#if BUILDFLAG(IS_APPLE) +// Returns MtlPixelFormat format for given `format`. +GPU_GLES2_EXPORT unsigned int ToMTLPixelFormat(viz::SharedImageFormat format); +#endif + +} // namespace gpu + +#endif // GPU_COMMAND_BUFFER_SERVICE_SHARED_IMAGE_SHARED_IMAGE_FORMAT_UTILS_H_ \ No newline at end of file
diff --git a/gpu/command_buffer/service/shared_image/shared_image_format_utils_mac.mm b/gpu/command_buffer/service/shared_image/shared_image_format_utils_mac.mm new file mode 100644 index 0000000..7c4bcf06 --- /dev/null +++ b/gpu/command_buffer/service/shared_image/shared_image_format_utils_mac.mm
@@ -0,0 +1,16 @@ +// Copyright 2022 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "gpu/command_buffer/service/shared_image/shared_image_format_utils.h" + +#include "components/viz/common/resources/resource_format_utils.h" + +namespace gpu { + +// TODO (hitawala): Add support for multiplanar formats. +unsigned int ToMTLPixelFormat(viz::SharedImageFormat format) { + return viz::ToMTLPixelFormat(format.resource_format()); +} + +} // namespace gpu \ No newline at end of file
diff --git a/gpu/command_buffer/service/shared_image/shared_image_manager.cc b/gpu/command_buffer/service/shared_image/shared_image_manager.cc index 63c05ca..40162796 100644 --- a/gpu/command_buffer/service/shared_image/shared_image_manager.cc +++ b/gpu/command_buffer/service/shared_image/shared_image_manager.cc
@@ -17,7 +17,6 @@ #include "base/trace_event/process_memory_dump.h" #include "base/trace_event/trace_event.h" #include "build/build_config.h" -#include "components/viz/common/resources/resource_format_utils.h" #include "gpu/command_buffer/common/shared_image_trace_utils.h" #include "gpu/command_buffer/service/shared_context_state.h" #include "gpu/command_buffer/service/shared_image/shared_image_representation.h"
diff --git a/gpu/command_buffer/service/shared_image/shared_image_representation.h b/gpu/command_buffer/service/shared_image/shared_image_representation.h index 83641a0c..911cee7 100644 --- a/gpu/command_buffer/service/shared_image/shared_image_representation.h +++ b/gpu/command_buffer/service/shared_image/shared_image_representation.h
@@ -14,7 +14,6 @@ #include "base/memory/scoped_refptr.h" #include "base/types/pass_key.h" #include "build/build_config.h" -#include "components/viz/common/resources/resource_format.h" #include "gpu/command_buffer/service/shared_image/shared_image_backing.h" #include "gpu/command_buffer/service/shared_image/shared_image_manager.h" #include "gpu/gpu_gles2_export.h"
diff --git a/gpu/command_buffer/service/shared_image/shared_image_representation_unittest.cc b/gpu/command_buffer/service/shared_image/shared_image_representation_unittest.cc index c7a097ab4..2e76875 100644 --- a/gpu/command_buffer/service/shared_image/shared_image_representation_unittest.cc +++ b/gpu/command_buffer/service/shared_image/shared_image_representation_unittest.cc
@@ -4,7 +4,6 @@ #include "gpu/command_buffer/service/shared_image/shared_image_representation.h" -#include "components/viz/common/resources/resource_format_utils.h" #include "gpu/command_buffer/common/mailbox.h" #include "gpu/command_buffer/common/shared_image_usage.h" #include "gpu/command_buffer/service/shared_context_state.h"
diff --git a/gpu/command_buffer/service/shared_image/shared_memory_image_backing.cc b/gpu/command_buffer/service/shared_image/shared_memory_image_backing.cc index 2266d75..d05b532 100644 --- a/gpu/command_buffer/service/shared_image/shared_memory_image_backing.cc +++ b/gpu/command_buffer/service/shared_image/shared_memory_image_backing.cc
@@ -8,13 +8,12 @@ #include "base/memory/scoped_refptr.h" #include "base/notreached.h" #include "base/trace_event/process_memory_dump.h" -#include "components/viz/common/resources/resource_format.h" -#include "components/viz/common/resources/resource_format_utils.h" #include "components/viz/common/resources/resource_sizes.h" #include "gpu/command_buffer/common/mailbox.h" #include "gpu/command_buffer/common/shared_image_trace_utils.h" #include "gpu/command_buffer/service/memory_tracking.h" #include "gpu/command_buffer/service/shared_context_state.h" +#include "gpu/command_buffer/service/shared_image/shared_image_format_utils.h" #include "gpu/command_buffer/service/shared_image/shared_image_manager.h" #include "gpu/command_buffer/service/shared_image/shared_image_representation.h" #include "gpu/command_buffer/service/shared_memory_region_wrapper.h" @@ -142,7 +141,7 @@ auto gl_image = base::MakeRefCounted<gl::GLImageMemory>(size()); if (!gl_image->Initialize(shared_memory_wrapper_.GetMemory(), - viz::BufferFormat(format()), + ToBufferFormat(format()), shared_memory_wrapper_.GetStride(), /*disable_pbo_upload=*/true)) { DLOG(ERROR) << "Failed to initialize GLImageMemory";
diff --git a/gpu/command_buffer/service/shared_image/shared_memory_image_backing.h b/gpu/command_buffer/service/shared_image/shared_memory_image_backing.h index e26e357..263fb55 100644 --- a/gpu/command_buffer/service/shared_image/shared_memory_image_backing.h +++ b/gpu/command_buffer/service/shared_image/shared_memory_image_backing.h
@@ -6,7 +6,6 @@ #define GPU_COMMAND_BUFFER_SERVICE_SHARED_IMAGE_SHARED_MEMORY_IMAGE_BACKING_H_ #include "base/memory/scoped_refptr.h" -#include "components/viz/common/resources/resource_format.h" #include "gpu/command_buffer/common/mailbox.h" #include "gpu/command_buffer/service/memory_tracking.h" #include "gpu/command_buffer/service/shared_image/shared_image_backing.h"
diff --git a/gpu/command_buffer/service/shared_image/skia_vk_android_image_representation.cc b/gpu/command_buffer/service/shared_image/skia_vk_android_image_representation.cc index c7473f7..a3b9a63 100644 --- a/gpu/command_buffer/service/shared_image/skia_vk_android_image_representation.cc +++ b/gpu/command_buffer/service/shared_image/skia_vk_android_image_representation.cc
@@ -8,7 +8,6 @@ #include "components/viz/common/gpu/vulkan_context_provider.h" #include "components/viz/common/resources/resource_format_utils.h" -#include "components/viz/common/resources/resource_sizes.h" #include "gpu/command_buffer/common/shared_image_usage.h" #include "gpu/command_buffer/service/abstract_texture.h" #include "gpu/command_buffer/service/mailbox_manager.h"
diff --git a/gpu/command_buffer/service/shared_image/skia_vk_ozone_image_representation.cc b/gpu/command_buffer/service/shared_image/skia_vk_ozone_image_representation.cc index 5e4fb7d..482981ef4 100644 --- a/gpu/command_buffer/service/shared_image/skia_vk_ozone_image_representation.cc +++ b/gpu/command_buffer/service/shared_image/skia_vk_ozone_image_representation.cc
@@ -7,7 +7,7 @@ #include <utility> #include "components/viz/common/gpu/vulkan_context_provider.h" -#include "components/viz/common/resources/resource_sizes.h" +#include "components/viz/common/resources/resource_format_utils.h" #include "gpu/command_buffer/common/shared_image_usage.h" #include "gpu/command_buffer/service/external_semaphore_pool.h" #include "gpu/command_buffer/service/memory_tracking.h"
diff --git a/gpu/command_buffer/service/shared_image/test_image_backing.cc b/gpu/command_buffer/service/shared_image/test_image_backing.cc index 8506902..e645c38 100644 --- a/gpu/command_buffer/service/shared_image/test_image_backing.cc +++ b/gpu/command_buffer/service/shared_image/test_image_backing.cc
@@ -5,8 +5,8 @@ #include "gpu/command_buffer/service/shared_image/test_image_backing.h" #include "base/memory/raw_ptr.h" #include "build/build_config.h" -#include "components/viz/common/resources/resource_format_utils.h" #include "gpu/command_buffer/service/shared_context_state.h" +#include "gpu/command_buffer/service/shared_image/shared_image_format_utils.h" #include "skia/ext/legacy_display_globals.h" #include "third_party/skia/include/core/SkPromiseImageTexture.h" #include "third_party/skia/include/gpu/GrBackendSurface.h" @@ -120,7 +120,7 @@ size().width(), size().height(), GrMipMapped::kNo, GrGLTextureInfo{GL_TEXTURE_EXTERNAL_OES, static_cast<TestImageBacking*>(backing())->service_id(), - static_cast<GrGLenum>(viz::TextureStorageFormat( + static_cast<GrGLenum>(TextureStorageFormat( format(), /*use_angle_rgbx_format=*/false))}); } };
diff --git a/gpu/command_buffer/service/shared_image/video_image_reader_image_backing.cc b/gpu/command_buffer/service/shared_image/video_image_reader_image_backing.cc index 399db8e4..ec54658 100644 --- a/gpu/command_buffer/service/shared_image/video_image_reader_image_backing.cc +++ b/gpu/command_buffer/service/shared_image/video_image_reader_image_backing.cc
@@ -12,8 +12,6 @@ #include "base/task/bind_post_task.h" #include "base/threading/thread_task_runner_handle.h" #include "components/viz/common/gpu/vulkan_context_provider.h" -#include "components/viz/common/resources/resource_format_utils.h" -#include "components/viz/common/resources/resource_sizes.h" #include "gpu/command_buffer/common/shared_image_usage.h" #include "gpu/command_buffer/service/ahardwarebuffer_utils.h" #include "gpu/command_buffer/service/mailbox_manager.h"
diff --git a/gpu/command_buffer/service/shared_image/video_surface_texture_image_backing.cc b/gpu/command_buffer/service/shared_image/video_surface_texture_image_backing.cc index 9725195..6191437 100644 --- a/gpu/command_buffer/service/shared_image/video_surface_texture_image_backing.cc +++ b/gpu/command_buffer/service/shared_image/video_surface_texture_image_backing.cc
@@ -8,8 +8,6 @@ #include "base/feature_list.h" #include "base/threading/thread_task_runner_handle.h" -#include "components/viz/common/resources/resource_format_utils.h" -#include "components/viz/common/resources/resource_sizes.h" #include "gpu/command_buffer/common/shared_image_usage.h" #include "gpu/command_buffer/service/mailbox_manager.h" #include "gpu/command_buffer/service/memory_tracking.h"
diff --git a/gpu/command_buffer/service/shared_image/wrapped_sk_image_backing_factory.h b/gpu/command_buffer/service/shared_image/wrapped_sk_image_backing_factory.h index 852087b..c036291 100644 --- a/gpu/command_buffer/service/shared_image/wrapped_sk_image_backing_factory.h +++ b/gpu/command_buffer/service/shared_image/wrapped_sk_image_backing_factory.h
@@ -7,7 +7,6 @@ #include <memory> -#include "components/viz/common/resources/resource_format.h" #include "gpu/command_buffer/service/shared_image/shared_image_backing_factory.h" #include "gpu/command_buffer/service/texture_base.h" #include "gpu/gpu_gles2_export.h"
diff --git a/gpu/command_buffer/service/webgpu_decoder_impl.cc b/gpu/command_buffer/service/webgpu_decoder_impl.cc index 574114f..c0ca692 100644 --- a/gpu/command_buffer/service/webgpu_decoder_impl.cc +++ b/gpu/command_buffer/service/webgpu_decoder_impl.cc
@@ -36,6 +36,7 @@ #include "gpu/command_buffer/service/isolation_key_provider.h" #include "gpu/command_buffer/service/shared_context_state.h" #include "gpu/command_buffer/service/shared_image/shared_image_factory.h" +#include "gpu/command_buffer/service/shared_image/shared_image_format_utils.h" #include "gpu/command_buffer/service/shared_image/shared_image_manager.h" #include "gpu/command_buffer/service/shared_image/shared_image_representation.h" #include "gpu/command_buffer/service/skia_utils.h" @@ -574,7 +575,7 @@ .dimension = WGPUTextureDimension_2D, .size = {static_cast<uint32_t>(representation_->size().width()), static_cast<uint32_t>(representation_->size().height()), 1}, - .format = viz::ToWGPUFormat(representation_->format()), + .format = ToWGPUFormat(representation_->format()), .mipLevelCount = 1, .sampleCount = 1, }; @@ -592,7 +593,7 @@ DCHECK(buffer_size); base::CheckedNumeric<uint32_t> checked_bytes_per_row( - viz::BitsPerPixel(format) / 8); + BitsPerPixel(format) / 8); checked_bytes_per_row *= size.width(); uint32_t packed_bytes_per_row;
diff --git a/headless/BUILD.gn b/headless/BUILD.gn index 56f01a6..3d566ee 100644 --- a/headless/BUILD.gn +++ b/headless/BUILD.gn
@@ -904,6 +904,8 @@ sources = [ "app/headless_shell.cc", "app/headless_shell.h", + "app/headless_shell_command_line.cc", + "app/headless_shell_command_line.h", "app/headless_shell_switches.h", "lib/browser/headless_content_browser_client.cc", "lib/browser/headless_content_browser_client.h", @@ -940,6 +942,8 @@ sources = [ "app/headless_shell.cc", "app/headless_shell.h", + "app/headless_shell_command_line.cc", + "app/headless_shell_command_line.h", "app/headless_shell_switches.h", "public/headless_shell.h", ]
diff --git a/headless/app/headless_shell.cc b/headless/app/headless_shell.cc index 85eaac99..e48031d1 100644 --- a/headless/app/headless_shell.cc +++ b/headless/app/headless_shell.cc
@@ -3,7 +3,6 @@ // found in the LICENSE file. #include <cstdint> -#include <cstdio> #include <memory> #include <sstream> #include <utility> @@ -28,26 +27,22 @@ #include "base/task/thread_pool.h" #include "build/branding_buildflags.h" #include "build/build_config.h" -#include "cc/base/switches.h" -#include "components/viz/common/switches.h" #include "content/public/app/content_main.h" #include "content/public/browser/browser_task_traits.h" #include "content/public/browser/browser_thread.h" -#include "content/public/common/content_switches.h" #include "headless/app/headless_shell.h" +#include "headless/app/headless_shell_command_line.h" #include "headless/app/headless_shell_switches.h" #include "headless/lib/browser/headless_browser_impl.h" #include "headless/lib/browser/headless_web_contents_impl.h" #include "headless/lib/headless_content_main_delegate.h" #include "headless/public/headless_devtools_target.h" #include "net/base/filename_util.h" -#include "net/base/host_port_pair.h" -#include "net/base/ip_address.h" #include "net/http/http_util.h" -#include "net/proxy_resolution/proxy_config.h" -#include "third_party/blink/public/common/switches.h" -#include "ui/gfx/font_render_params.h" -#include "ui/gfx/geometry/size.h" + +#if BUILDFLAG(IS_MAC) +#include "components/os_crypt/os_crypt_switches.h" // nogncheck +#endif #if BUILDFLAG(IS_WIN) #include "components/crash/core/app/crash_switches.h" // nogncheck @@ -55,10 +50,6 @@ #include "sandbox/win/src/sandbox_types.h" #endif -#if BUILDFLAG(IS_MAC) -#include "components/os_crypt/os_crypt_switches.h" // nogncheck -#endif - #if defined(HEADLESS_USE_POLICY) #include "headless/lib/browser/policy/headless_mode_policy.h" #endif @@ -67,59 +58,11 @@ namespace { -// By default listen to incoming DevTools connections on localhost. -const char kUseLocalHostForDevToolsHttpServer[] = "localhost"; // Default file name for screenshot. Can be overriden by "--screenshot" switch. const char kDefaultScreenshotFileName[] = "screenshot.png"; // Default file name for pdf. Can be overriden by "--print-to-pdf" switch. const char kDefaultPDFFileName[] = "output.pdf"; -bool ParseWindowSize(const std::string& window_size, - gfx::Size* parsed_window_size) { - int width = 0; - int height = 0; - if (sscanf(window_size.c_str(), "%d%*[x,]%d", &width, &height) >= 2 && - width >= 0 && height >= 0) { - parsed_window_size->set_width(width); - parsed_window_size->set_height(height); - return true; - } - return false; -} - -bool ParseFontRenderHinting( - const std::string& font_render_hinting_string, - gfx::FontRenderParams::Hinting* font_render_hinting) { - if (font_render_hinting_string == "max") { - *font_render_hinting = gfx::FontRenderParams::Hinting::HINTING_MAX; - } else if (font_render_hinting_string == "full") { - *font_render_hinting = gfx::FontRenderParams::Hinting::HINTING_FULL; - } else if (font_render_hinting_string == "medium") { - *font_render_hinting = gfx::FontRenderParams::Hinting::HINTING_MEDIUM; - } else if (font_render_hinting_string == "slight") { - *font_render_hinting = gfx::FontRenderParams::Hinting::HINTING_SLIGHT; - } else if (font_render_hinting_string == "none") { - *font_render_hinting = gfx::FontRenderParams::Hinting::HINTING_NONE; - } else { - return false; - } - return true; -} - -base::Value::Dict GetColorDictFromHexColor(const std::string& color_hex) { - uint32_t color; - CHECK(base::HexStringToUInt(color_hex, &color)) - << "Expected a hex value for --default-background-color="; - - base::Value::Dict dict; - dict.Set("r", static_cast<int>((color & 0xff000000) >> 24)); - dict.Set("g", static_cast<int>((color & 0x00ff0000) >> 16)); - dict.Set("b", static_cast<int>((color & 0x0000ff00) >> 8)); - dict.Set("a", static_cast<int>((color & 0x000000ff))); - - return dict; -} - GURL ConvertArgumentToURL(const base::CommandLine::StringType& arg) { #if BUILDFLAG(IS_WIN) GURL url(base::WideToUTF8(arg)); @@ -133,83 +76,18 @@ base::MakeAbsoluteFilePath(base::FilePath(arg))); } -std::vector<GURL> ConvertArgumentsToURLs( - const base::CommandLine::StringVector& args) { - std::vector<GURL> urls; - urls.reserve(args.size()); - for (const auto& arg : base::Reversed(args)) - urls.push_back(ConvertArgumentToURL(arg)); - return urls; -} +base::Value::Dict GetColorDictFromHexColor(const std::string& color_hex) { + uint32_t color; + CHECK(base::HexStringToUInt(color_hex, &color)) + << "Expected a hex value for --default-background-color="; -int RunContentMain( - HeadlessBrowser::Options options, - base::OnceCallback<void(HeadlessBrowser*)> on_browser_start_callback) { - content::ContentMainParams params(nullptr); -#if BUILDFLAG(IS_WIN) - // Sandbox info has to be set and initialized. - CHECK(options.sandbox_info); - params.instance = options.instance; - params.sandbox_info = std::move(options.sandbox_info); -#elif !BUILDFLAG(IS_ANDROID) - params.argc = options.argc; - params.argv = options.argv; -#endif + base::Value::Dict dict; + dict.Set("r", static_cast<int>((color & 0xff000000) >> 24)); + dict.Set("g", static_cast<int>((color & 0x00ff0000) >> 16)); + dict.Set("b", static_cast<int>((color & 0x0000ff00) >> 8)); + dict.Set("a", static_cast<int>((color & 0x000000ff))); - // TODO(skyostil): Implement custom message pumps. - DCHECK(!options.message_pump); - - auto browser = std::make_unique<HeadlessBrowserImpl>( - std::move(on_browser_start_callback), std::move(options)); - HeadlessContentMainDelegate delegate(std::move(browser)); - params.delegate = &delegate; - return content::ContentMain(std::move(params)); -} - -bool ValidateCommandLine(const base::CommandLine& command_line) { - if (!command_line.HasSwitch(switches::kRemoteDebuggingPort) && - !command_line.HasSwitch(switches::kRemoteDebuggingPipe)) { - if (command_line.GetArgs().size() <= 1) - return true; - LOG(ERROR) << "Open multiple tabs is only supported when " - << "remote debugging is enabled."; - return false; - } - if (command_line.HasSwitch(switches::kDefaultBackgroundColor)) { - LOG(ERROR) << "Setting default background color is disabled " - << "when remote debugging is enabled."; - return false; - } - if (command_line.HasSwitch(switches::kDumpDom)) { - LOG(ERROR) << "Dump DOM is disabled when remote debugging is enabled."; - return false; - } - if (command_line.HasSwitch(switches::kPrintToPDF)) { - LOG(ERROR) << "Print to PDF is disabled " - << "when remote debugging is enabled."; - return false; - } - if (command_line.HasSwitch(switches::kRepl)) { - LOG(ERROR) << "Evaluate Javascript is disabled " - << "when remote debugging is enabled."; - return false; - } - if (command_line.HasSwitch(switches::kScreenshot)) { - LOG(ERROR) << "Capture screenshot is disabled " - << "when remote debugging is enabled."; - return false; - } - if (command_line.HasSwitch(switches::kTimeout)) { - LOG(ERROR) << "Navigation timeout is disabled " - << "when remote debugging is enabled."; - return false; - } - if (command_line.HasSwitch(switches::kVirtualTimeBudget)) { - LOG(ERROR) << "Virtual time budget is disabled " - << "when remote debugging is enabled."; - return false; - } - return true; + return dict; } bool DoWriteFile(const base::FilePath& file_path, std::string file_data) { @@ -227,7 +105,6 @@ } // namespace HeadlessShell::HeadlessShell() = default; - HeadlessShell::~HeadlessShell() = default; void HeadlessShell::OnBrowserStart(HeadlessBrowser* browser) { @@ -271,36 +148,37 @@ if (!args.empty()) { file_task_runner_->PostTaskAndReplyWithResult( - FROM_HERE, base::BindOnce(&ConvertArgumentsToURLs, args), - base::BindOnce(&HeadlessShell::OnGotURLs, weak_factory_.GetWeakPtr())); + FROM_HERE, base::BindOnce(&ConvertArgumentToURL, args.front()), + base::BindOnce(&HeadlessShell::OnCommandLineURL, + weak_factory_.GetWeakPtr())); } } -void HeadlessShell::OnGotURLs(const std::vector<GURL>& urls) { +void HeadlessShell::OnCommandLineURL(const GURL& url) { HeadlessWebContents::Builder builder( browser_context_->CreateWebContentsBuilder()); - for (const auto& url : urls) { - HeadlessWebContents* web_contents = builder.SetInitialURL(url).Build(); - if (!web_contents) { - LOG(ERROR) << "Navigation to " << url << " failed"; - browser_->Shutdown(); - return; - } - if (!web_contents_ && !RemoteDebuggingEnabled()) { - // TODO(jzfeng): Support observing multiple targets. - url_ = url; - web_contents_ = web_contents; - web_contents_->AddObserver(this); - } + HeadlessWebContents* web_contents = builder.SetInitialURL(url).Build(); + if (!web_contents) { + LOG(ERROR) << "Navigation to " << url << " failed"; + browser_->Shutdown(); + return; + } + + // Unless we're in remote debugging mode, associate target and + // start observing it so we can run commands. + if (!IsRemoteDebuggingEnabled()) { + url_ = url; + web_contents_ = web_contents; + web_contents_->AddObserver(this); } } void HeadlessShell::Detach() { - if (!RemoteDebuggingEnabled()) + if (web_contents_) { devtools_client_.DetachClient(); - - web_contents_->RemoveObserver(this); - web_contents_ = nullptr; + web_contents_->RemoveObserver(this); + web_contents_ = nullptr; + } } void HeadlessShell::ShutdownSoon() { @@ -638,13 +516,6 @@ ShutdownSoon(); } -bool HeadlessShell::RemoteDebuggingEnabled() const { - const base::CommandLine& command_line = - *base::CommandLine::ForCurrentProcess(); - return (command_line.HasSwitch(switches::kRemoteDebuggingPort) || - command_line.HasSwitch(switches::kRemoteDebuggingPipe)); -} - #if BUILDFLAG(IS_WIN) int HeadlessShellMain(HINSTANCE instance, sandbox::SandboxInterfaceInfo* sandbox_info) { @@ -669,145 +540,27 @@ RunChildProcessIfNeeded(argc, argv); HeadlessBrowser::Options::Builder builder(argc, argv); #endif // BUILDFLAG(IS_WIN) - HeadlessShell shell; - -#if BUILDFLAG(IS_FUCHSIA) - // TODO(fuchsia): Remove this when GPU accelerated compositing is ready. - base::CommandLine::ForCurrentProcess()->AppendSwitch(::switches::kDisableGpu); -#endif base::CommandLine& command_line(*base::CommandLine::ForCurrentProcess()); - if (!ValidateCommandLine(command_line)) - return EXIT_FAILURE; #if BUILDFLAG(IS_MAC) command_line.AppendSwitch(os_crypt::switches::kUseMockKeychain); #endif - if (command_line.HasSwitch(switches::kDeterministicMode)) { - command_line.AppendSwitch(switches::kEnableBeginFrameControl); +#if BUILDFLAG(IS_FUCHSIA) + // TODO(fuchsia): Remove this when GPU accelerated compositing is ready. + command_line.AppendSwitch(::switches::kDisableGpu); +#endif - // Compositor flags - command_line.AppendSwitch(::switches::kRunAllCompositorStagesBeforeDraw); - command_line.AppendSwitch(::switches::kDisableNewContentRenderingTimeout); - // Ensure that image animations don't resync their animation timestamps when - // looping back around. - command_line.AppendSwitch(blink::switches::kDisableImageAnimationResync); - - // Renderer flags - command_line.AppendSwitch(cc::switches::kDisableThreadedAnimation); - command_line.AppendSwitch(blink::switches::kDisableThreadedScrolling); - command_line.AppendSwitch(cc::switches::kDisableCheckerImaging); + if (command_line.GetArgs().size() > 1) { + LOG(ERROR) << "Multiple targets are not supported."; + return EXIT_FAILURE; } - if (command_line.HasSwitch(switches::kEnableBeginFrameControl)) - builder.SetEnableBeginFrameControl(true); + if (!HandleCommandLineSwitches(command_line, builder)) + return EXIT_FAILURE; - if (command_line.HasSwitch(switches::kEnableCrashReporter)) - builder.SetCrashReporterEnabled(true); - if (command_line.HasSwitch(switches::kDisableCrashReporter)) - builder.SetCrashReporterEnabled(false); - if (command_line.HasSwitch(switches::kCrashDumpsDir)) { - builder.SetCrashDumpsDir( - command_line.GetSwitchValuePath(switches::kCrashDumpsDir)); - } - - // Enable devtools if requested, by specifying a port (and optional address). - if (command_line.HasSwitch(::switches::kRemoteDebuggingPort)) { - std::string address = kUseLocalHostForDevToolsHttpServer; - if (command_line.HasSwitch(switches::kRemoteDebuggingAddress)) { - address = - command_line.GetSwitchValueASCII(switches::kRemoteDebuggingAddress); - net::IPAddress parsed_address; - if (!parsed_address.AssignFromIPLiteral(address)) { - LOG(ERROR) << "Invalid devtools server address"; - return EXIT_FAILURE; - } - } - int parsed_port; - std::string port_str = - command_line.GetSwitchValueASCII(::switches::kRemoteDebuggingPort); - if (!base::StringToInt(port_str, &parsed_port) || - !base::IsValueInRangeForNumericType<uint16_t>(parsed_port)) { - LOG(ERROR) << "Invalid devtools server port"; - return EXIT_FAILURE; - } - const net::HostPortPair endpoint(address, - base::checked_cast<uint16_t>(parsed_port)); - builder.EnableDevToolsServer(endpoint); - } - if (command_line.HasSwitch(::switches::kRemoteDebuggingPipe)) - builder.EnableDevToolsPipe(); - - if (command_line.HasSwitch(switches::kProxyServer)) { - std::string proxy_server = - command_line.GetSwitchValueASCII(switches::kProxyServer); - auto proxy_config = std::make_unique<net::ProxyConfig>(); - proxy_config->proxy_rules().ParseFromString(proxy_server); - if (command_line.HasSwitch(switches::kProxyBypassList)) { - std::string bypass_list = - command_line.GetSwitchValueASCII(switches::kProxyBypassList); - proxy_config->proxy_rules().bypass_rules.ParseFromString(bypass_list); - } - builder.SetProxyConfig(std::move(proxy_config)); - } - - if (command_line.HasSwitch(switches::kUseGL)) { - builder.SetGLImplementation( - command_line.GetSwitchValueASCII(switches::kUseGL)); - } - - if (command_line.HasSwitch(switches::kUseANGLE)) { - builder.SetANGLEImplementation( - command_line.GetSwitchValueASCII(switches::kUseANGLE)); - } - - if (command_line.HasSwitch(switches::kUserDataDir)) { - builder.SetUserDataDir( - command_line.GetSwitchValuePath(switches::kUserDataDir)); - if (!command_line.HasSwitch(switches::kIncognito)) - builder.SetIncognitoMode(false); - } - - if (command_line.HasSwitch(switches::kWindowSize)) { - std::string window_size = - command_line.GetSwitchValueASCII(switches::kWindowSize); - gfx::Size parsed_window_size; - if (!ParseWindowSize(window_size, &parsed_window_size)) { - LOG(ERROR) << "Malformed window size"; - return EXIT_FAILURE; - } - builder.SetWindowSize(parsed_window_size); - } - - if (command_line.HasSwitch(switches::kHideScrollbars)) { - builder.SetOverrideWebPreferencesCallback( - base::BindRepeating([](blink::web_pref::WebPreferences* preferences) { - preferences->hide_scrollbars = true; - })); - } - - if (command_line.HasSwitch(switches::kUserAgent)) { - std::string ua = command_line.GetSwitchValueASCII(switches::kUserAgent); - if (net::HttpUtil::IsValidHeaderValue(ua)) - builder.SetUserAgent(ua); - } - - if (command_line.HasSwitch(switches::kFontRenderHinting)) { - std::string font_render_hinting_string = - command_line.GetSwitchValueASCII(switches::kFontRenderHinting); - gfx::FontRenderParams::Hinting font_render_hinting; - if (ParseFontRenderHinting(font_render_hinting_string, - &font_render_hinting)) { - builder.SetFontRenderHinting(font_render_hinting); - } else { - LOG(ERROR) << "Unknown font-render-hinting parameter value"; - return EXIT_FAILURE; - } - } - - if (command_line.HasSwitch(switches::kBlockNewWebContents)) - builder.SetBlockNewWebContents(true); + HeadlessShell shell; return HeadlessBrowserMain( builder.Build(), @@ -822,6 +575,34 @@ #endif } +namespace { + +int RunContentMain( + HeadlessBrowser::Options options, + base::OnceCallback<void(HeadlessBrowser*)> on_browser_start_callback) { + content::ContentMainParams params(nullptr); +#if BUILDFLAG(IS_WIN) + // Sandbox info has to be set and initialized. + CHECK(options.sandbox_info); + params.instance = options.instance; + params.sandbox_info = std::move(options.sandbox_info); +#elif !BUILDFLAG(IS_ANDROID) + params.argc = options.argc; + params.argv = options.argv; +#endif + + // TODO(skyostil): Implement custom message pumps. + DCHECK(!options.message_pump); + + auto browser = std::make_unique<HeadlessBrowserImpl>( + std::move(on_browser_start_callback), std::move(options)); + HeadlessContentMainDelegate delegate(std::move(browser)); + params.delegate = &delegate; + return content::ContentMain(std::move(params)); +} + +} // namespace + #if BUILDFLAG(IS_WIN) void RunChildProcessIfNeeded(HINSTANCE instance, sandbox::SandboxInterfaceInfo* sandbox_info) { @@ -841,9 +622,10 @@ return; if (command_line.HasSwitch(switches::kUserAgent)) { - std::string ua = command_line.GetSwitchValueASCII(switches::kUserAgent); - if (net::HttpUtil::IsValidHeaderValue(ua)) - builder.SetUserAgent(ua); + std::string user_agent = + command_line.GetSwitchValueASCII(switches::kUserAgent); + if (net::HttpUtil::IsValidHeaderValue(user_agent)) + builder.SetUserAgent(user_agent); } int rc = RunContentMain(builder.Build(),
diff --git a/headless/app/headless_shell.h b/headless/app/headless_shell.h index 08ab7718..e58703c3 100644 --- a/headless/app/headless_shell.h +++ b/headless/app/headless_shell.h
@@ -49,7 +49,7 @@ void FetchTimeout(); - void OnGotURLs(const std::vector<GURL>& urls); + void OnCommandLineURL(const GURL& url); void PollReadyState(); @@ -74,8 +74,6 @@ std::string data); void OnWriteFileDone(bool success); - bool RemoteDebuggingEnabled() const; - GURL url_; raw_ptr<HeadlessBrowser> browser_ = nullptr; // Not owned. simple_devtools_protocol_client::SimpleDevToolsProtocolClient
diff --git a/headless/app/headless_shell_command_line.cc b/headless/app/headless_shell_command_line.cc new file mode 100644 index 0000000..a7d0b24 --- /dev/null +++ b/headless/app/headless_shell_command_line.cc
@@ -0,0 +1,250 @@ +// Copyright 2022 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "headless/app/headless_shell_command_line.h" + +#include <cstdio> + +#include "base/bind.h" +#include "base/logging.h" +#include "cc/base/switches.h" +#include "components/viz/common/switches.h" +#include "content/public/common/content_switches.h" +#include "headless/app/headless_shell_switches.h" +#include "net/base/host_port_pair.h" +#include "net/base/ip_address.h" +#include "net/http/http_util.h" +#include "net/proxy_resolution/proxy_config.h" +#include "third_party/blink/public/common/switches.h" +#include "ui/gfx/font_render_params.h" +#include "ui/gfx/geometry/size.h" + +namespace headless { + +namespace { +// By default listen to incoming DevTools connections on localhost. +const char kLocalHost[] = "localhost"; + +bool ValidateCommandLineSwitches(const base::CommandLine& command_line) { + if (command_line.HasSwitch(switches::kRemoteDebuggingPort) || + command_line.HasSwitch(switches::kRemoteDebuggingPipe)) { + static const char* kIncompatibleSwitches[] = { + switches::kDefaultBackgroundColor, + switches::kDumpDom, + switches::kPrintToPDF, + switches::kRepl, + switches::kScreenshot, + switches::kTimeout, + switches::kVirtualTimeBudget, + }; + + for (const char* incompatible_switch : kIncompatibleSwitches) { + if (command_line.HasSwitch(incompatible_switch)) { + LOG(ERROR) << "--" << incompatible_switch + << " is not supported with remote debugging."; + return false; + } + } + } + + return true; +} + +void HandleDeterministicModeSwitch(base::CommandLine& command_line) { + DCHECK(command_line.HasSwitch(switches::kDeterministicMode)); + + command_line.AppendSwitch(switches::kEnableBeginFrameControl); + + // Compositor flags + command_line.AppendSwitch(::switches::kRunAllCompositorStagesBeforeDraw); + command_line.AppendSwitch(::switches::kDisableNewContentRenderingTimeout); + // Ensure that image animations don't resync their animation timestamps when + // looping back around. + command_line.AppendSwitch(blink::switches::kDisableImageAnimationResync); + + // Renderer flags + command_line.AppendSwitch(cc::switches::kDisableThreadedAnimation); + command_line.AppendSwitch(blink::switches::kDisableThreadedScrolling); + command_line.AppendSwitch(cc::switches::kDisableCheckerImaging); +} + +bool HandleRemoteDebuggingPort(base::CommandLine& command_line, + HeadlessBrowser::Options::Builder& builder) { + DCHECK(command_line.HasSwitch(switches::kRemoteDebuggingPort)); + + net::IPAddress address; + std::string address_str = kLocalHost; + if (command_line.HasSwitch(switches::kRemoteDebuggingAddress)) { + address_str = + command_line.GetSwitchValueASCII(switches::kRemoteDebuggingAddress); + if (!address.AssignFromIPLiteral(address_str)) { + LOG(ERROR) << "Invalid devtools server address: " << address_str; + return false; + } + } + int port; + std::string port_str = + command_line.GetSwitchValueASCII(::switches::kRemoteDebuggingPort); + if (!base::StringToInt(port_str, &port) || + !base::IsValueInRangeForNumericType<uint16_t>(port)) { + LOG(ERROR) << "Invalid devtools server port: " << port_str; + return false; + } + const net::HostPortPair endpoint(address_str, + base::checked_cast<uint16_t>(port)); + builder.EnableDevToolsServer(endpoint); + return true; +} + +void HandleProxyServer(base::CommandLine& command_line, + HeadlessBrowser::Options::Builder& builder) { + DCHECK(command_line.HasSwitch(switches::kProxyServer)); + + std::string proxy_server = + command_line.GetSwitchValueASCII(switches::kProxyServer); + auto proxy_config = std::make_unique<net::ProxyConfig>(); + proxy_config->proxy_rules().ParseFromString(proxy_server); + if (command_line.HasSwitch(switches::kProxyBypassList)) { + std::string bypass_list = + command_line.GetSwitchValueASCII(switches::kProxyBypassList); + proxy_config->proxy_rules().bypass_rules.ParseFromString(bypass_list); + } + builder.SetProxyConfig(std::move(proxy_config)); +} + +bool HandleWindowSize(base::CommandLine& command_line, + HeadlessBrowser::Options::Builder& builder) { + DCHECK(command_line.HasSwitch(switches::kWindowSize)); + + const std::string switch_value = + command_line.GetSwitchValueASCII(switches::kWindowSize); + + int width = 0; + int height = 0; + int n = sscanf(switch_value.c_str(), "%d%*[x,]%d", &width, &height); + if (n != 2 || width < 0 || height < 0) { + LOG(ERROR) << "Malformed window size: " << switch_value; + return false; + } + + builder.SetWindowSize(gfx::Size(width, height)); + return true; +} + +bool HandleFontRenderHinting(base::CommandLine& command_line, + HeadlessBrowser::Options::Builder& builder) { + std::string switch_value = + command_line.GetSwitchValueASCII(switches::kFontRenderHinting); + + gfx::FontRenderParams::Hinting font_render_hinting; + static_assert(gfx::FontRenderParams::Hinting::HINTING_MAX == 3); + if (switch_value == "full") { + font_render_hinting = gfx::FontRenderParams::Hinting::HINTING_FULL; + } else if (switch_value == "medium") { + font_render_hinting = gfx::FontRenderParams::Hinting::HINTING_MEDIUM; + } else if (switch_value == "slight") { + font_render_hinting = gfx::FontRenderParams::Hinting::HINTING_SLIGHT; + } else if (switch_value == "none") { + font_render_hinting = gfx::FontRenderParams::Hinting::HINTING_NONE; + } else { + LOG(ERROR) << "Unknown font-render-hinting parameter value"; + return false; + } + + builder.SetFontRenderHinting(font_render_hinting); + return true; +} + +} // namespace + +bool HandleCommandLineSwitches(base::CommandLine& command_line, + HeadlessBrowser::Options::Builder& builder) { + if (!ValidateCommandLineSwitches(command_line)) + return false; + + if (command_line.HasSwitch(switches::kDeterministicMode)) + HandleDeterministicModeSwitch(command_line); + + if (command_line.HasSwitch(switches::kEnableBeginFrameControl)) + builder.SetEnableBeginFrameControl(true); + + if (command_line.HasSwitch(switches::kEnableCrashReporter)) + builder.SetCrashReporterEnabled(true); + if (command_line.HasSwitch(switches::kDisableCrashReporter)) + builder.SetCrashReporterEnabled(false); + if (command_line.HasSwitch(switches::kCrashDumpsDir)) { + builder.SetCrashDumpsDir( + command_line.GetSwitchValuePath(switches::kCrashDumpsDir)); + } + + if (command_line.HasSwitch(::switches::kRemoteDebuggingPort)) { + if (!HandleRemoteDebuggingPort(command_line, builder)) + return false; + } + + if (command_line.HasSwitch(::switches::kRemoteDebuggingPort)) { + if (!HandleRemoteDebuggingPort(command_line, builder)) + return false; + } + if (command_line.HasSwitch(::switches::kRemoteDebuggingPipe)) + builder.EnableDevToolsPipe(); + + if (command_line.HasSwitch(switches::kProxyServer)) + HandleProxyServer(command_line, builder); + + if (command_line.HasSwitch(switches::kUseGL)) { + builder.SetGLImplementation( + command_line.GetSwitchValueASCII(switches::kUseGL)); + } + + if (command_line.HasSwitch(switches::kUseANGLE)) { + builder.SetANGLEImplementation( + command_line.GetSwitchValueASCII(switches::kUseANGLE)); + } + + if (command_line.HasSwitch(switches::kUserDataDir)) { + builder.SetUserDataDir( + command_line.GetSwitchValuePath(switches::kUserDataDir)); + if (!command_line.HasSwitch(switches::kIncognito)) + builder.SetIncognitoMode(false); + } + + if (command_line.HasSwitch(switches::kWindowSize)) { + if (!HandleWindowSize(command_line, builder)) + return false; + } + + if (command_line.HasSwitch(switches::kHideScrollbars)) { + builder.SetOverrideWebPreferencesCallback( + base::BindRepeating([](blink::web_pref::WebPreferences* preferences) { + preferences->hide_scrollbars = true; + })); + } + + if (command_line.HasSwitch(switches::kUserAgent)) { + std::string user_agent = + command_line.GetSwitchValueASCII(switches::kUserAgent); + if (net::HttpUtil::IsValidHeaderValue(user_agent)) + builder.SetUserAgent(user_agent); + } + + if (command_line.HasSwitch(switches::kFontRenderHinting)) { + if (!HandleFontRenderHinting(command_line, builder)) + return false; + } + + if (command_line.HasSwitch(switches::kBlockNewWebContents)) + builder.SetBlockNewWebContents(true); + + return true; +} + +bool IsRemoteDebuggingEnabled() { + const base::CommandLine& command_line = + *base::CommandLine::ForCurrentProcess(); + return command_line.HasSwitch(switches::kRemoteDebuggingPort) || + command_line.HasSwitch(switches::kRemoteDebuggingPipe); +} + +} // namespace headless
diff --git a/headless/app/headless_shell_command_line.h b/headless/app/headless_shell_command_line.h new file mode 100644 index 0000000..f953752 --- /dev/null +++ b/headless/app/headless_shell_command_line.h
@@ -0,0 +1,20 @@ +// Copyright 2022 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef HEADLESS_APP_HEADLESS_SHELL_COMMAND_LINE_H_ +#define HEADLESS_APP_HEADLESS_SHELL_COMMAND_LINE_H_ + +#include "base/command_line.h" +#include "headless/public/headless_browser.h" + +namespace headless { + +bool HandleCommandLineSwitches(base::CommandLine& command_line, + HeadlessBrowser::Options::Builder& builder); + +bool IsRemoteDebuggingEnabled(); + +} // namespace headless + +#endif // HEADLESS_APP_HEADLESS_SHELL_COMMAND_LINE_H_
diff --git "a/infra/config/generated/builders/ci/Win 7 Tests x64 \0501\051/properties.json" "b/infra/config/generated/builders/ci/Win 7 Tests x64 \0501\051/properties.json" deleted file mode 100644 index 72cb0e0a..0000000 --- "a/infra/config/generated/builders/ci/Win 7 Tests x64 \0501\051/properties.json" +++ /dev/null
@@ -1,96 +0,0 @@ -{ - "$build/chromium_tests_builder_config": { - "builder_config": { - "builder_db": { - "entries": [ - { - "builder_id": { - "bucket": "ci", - "builder": "Win 7 Tests x64 (1)", - "project": "chromium" - }, - "builder_spec": { - "build_gs_bucket": "chromium-win-archive", - "builder_group": "chromium.win", - "execution_mode": "TEST", - "legacy_chromium_config": { - "apply_configs": [ - "mb" - ], - "build_config": "Release", - "config": "chromium", - "target_bits": 64, - "target_platform": "win" - }, - "legacy_gclient_config": { - "config": "chromium" - }, - "parent": { - "bucket": "ci", - "builder": "Win x64 Builder", - "project": "chromium" - } - } - }, - { - "builder_id": { - "bucket": "ci", - "builder": "Win x64 Builder", - "project": "chromium" - }, - "builder_spec": { - "build_gs_bucket": "chromium-win-archive", - "builder_group": "chromium.win", - "execution_mode": "COMPILE_AND_TEST", - "legacy_chromium_config": { - "apply_configs": [ - "mb" - ], - "build_config": "Release", - "config": "chromium", - "target_bits": 64, - "target_platform": "win" - }, - "legacy_gclient_config": { - "apply_configs": [ - "use_clang_coverage" - ], - "config": "chromium" - } - } - } - ] - }, - "builder_ids": [ - { - "bucket": "ci", - "builder": "Win 7 Tests x64 (1)", - "project": "chromium" - } - ], - "mirroring_builder_group_and_names": [ - { - "builder": "win_chromium_x64_rel_ng", - "group": "tryserver.chromium.win" - } - ] - } - }, - "$build/reclient": { - "instance": "rbe-chromium-trusted", - "jobs": 250, - "metrics_project": "chromium-reclient-metrics" - }, - "$recipe_engine/resultdb/test_presentation": { - "column_keys": [], - "grouping_keys": [ - "status", - "v.test_suite" - ] - }, - "builder_group": "chromium.win", - "recipe": "chromium", - "sheriff_rotations": [ - "chromium" - ] -} \ No newline at end of file
diff --git a/infra/config/generated/builders/ci/Win Builder/properties.json b/infra/config/generated/builders/ci/Win Builder/properties.json index 241677c..bea3ec3f 100644 --- a/infra/config/generated/builders/ci/Win Builder/properties.json +++ b/infra/config/generated/builders/ci/Win Builder/properties.json
@@ -55,64 +55,6 @@ "config": "chromium" } } - }, - { - "builder_id": { - "bucket": "ci", - "builder": "Win7 (32) Tests", - "project": "chromium" - }, - "builder_spec": { - "build_gs_bucket": "chromium-win-archive", - "builder_group": "chromium.win", - "execution_mode": "TEST", - "legacy_chromium_config": { - "apply_configs": [ - "goma_enable_global_file_stat_cache", - "mb" - ], - "build_config": "Release", - "config": "chromium", - "target_bits": 32 - }, - "legacy_gclient_config": { - "config": "chromium" - }, - "parent": { - "bucket": "ci", - "builder": "Win Builder", - "project": "chromium" - } - } - }, - { - "builder_id": { - "bucket": "ci", - "builder": "Win7 Tests (1)", - "project": "chromium" - }, - "builder_spec": { - "build_gs_bucket": "chromium-win-archive", - "builder_group": "chromium.win", - "execution_mode": "TEST", - "legacy_chromium_config": { - "apply_configs": [ - "goma_enable_global_file_stat_cache", - "mb" - ], - "build_config": "Release", - "config": "chromium", - "target_bits": 32 - }, - "legacy_gclient_config": { - "config": "chromium" - }, - "parent": { - "bucket": "ci", - "builder": "Win Builder", - "project": "chromium" - } - } } ] }, @@ -128,24 +70,10 @@ "bucket": "ci", "builder": "WebKit Win10", "project": "chromium" - }, - { - "bucket": "ci", - "builder": "Win7 (32) Tests", - "project": "chromium" - }, - { - "bucket": "ci", - "builder": "Win7 Tests (1)", - "project": "chromium" } ], "mirroring_builder_group_and_names": [ { - "builder": "win7-rel", - "group": "tryserver.chromium.win" - }, - { "builder": "win_chromium_compile_rel_ng", "group": "tryserver.chromium.win" }
diff --git a/infra/config/generated/builders/ci/Win x64 Builder/properties.json b/infra/config/generated/builders/ci/Win x64 Builder/properties.json index 7470540..827babe1 100644 --- a/infra/config/generated/builders/ci/Win x64 Builder/properties.json +++ b/infra/config/generated/builders/ci/Win x64 Builder/properties.json
@@ -6,35 +6,6 @@ { "builder_id": { "bucket": "ci", - "builder": "Win 7 Tests x64 (1)", - "project": "chromium" - }, - "builder_spec": { - "build_gs_bucket": "chromium-win-archive", - "builder_group": "chromium.win", - "execution_mode": "TEST", - "legacy_chromium_config": { - "apply_configs": [ - "mb" - ], - "build_config": "Release", - "config": "chromium", - "target_bits": 64, - "target_platform": "win" - }, - "legacy_gclient_config": { - "config": "chromium" - }, - "parent": { - "bucket": "ci", - "builder": "Win x64 Builder", - "project": "chromium" - } - } - }, - { - "builder_id": { - "bucket": "ci", "builder": "Win x64 Builder", "project": "chromium" }, @@ -135,11 +106,6 @@ "builder_ids_in_scope_for_testing": [ { "bucket": "ci", - "builder": "Win 7 Tests x64 (1)", - "project": "chromium" - }, - { - "bucket": "ci", "builder": "Win10 Tests x64", "project": "chromium" },
diff --git "a/infra/config/generated/builders/ci/Win7 \05032\051 Tests/properties.json" "b/infra/config/generated/builders/ci/Win7 \05032\051 Tests/properties.json" deleted file mode 100644 index c18bd13..0000000 --- "a/infra/config/generated/builders/ci/Win7 \05032\051 Tests/properties.json" +++ /dev/null
@@ -1,88 +0,0 @@ -{ - "$build/chromium_tests_builder_config": { - "builder_config": { - "builder_db": { - "entries": [ - { - "builder_id": { - "bucket": "ci", - "builder": "Win Builder", - "project": "chromium" - }, - "builder_spec": { - "build_gs_bucket": "chromium-win-archive", - "builder_group": "chromium.win", - "execution_mode": "COMPILE_AND_TEST", - "legacy_chromium_config": { - "apply_configs": [ - "goma_enable_global_file_stat_cache", - "mb" - ], - "build_config": "Release", - "config": "chromium", - "target_bits": 32 - }, - "legacy_gclient_config": { - "config": "chromium" - } - } - }, - { - "builder_id": { - "bucket": "ci", - "builder": "Win7 (32) Tests", - "project": "chromium" - }, - "builder_spec": { - "build_gs_bucket": "chromium-win-archive", - "builder_group": "chromium.win", - "execution_mode": "TEST", - "legacy_chromium_config": { - "apply_configs": [ - "goma_enable_global_file_stat_cache", - "mb" - ], - "build_config": "Release", - "config": "chromium", - "target_bits": 32 - }, - "legacy_gclient_config": { - "config": "chromium" - }, - "parent": { - "bucket": "ci", - "builder": "Win Builder", - "project": "chromium" - } - } - } - ] - }, - "builder_ids": [ - { - "bucket": "ci", - "builder": "Win7 (32) Tests", - "project": "chromium" - } - ], - "mirroring_builder_group_and_names": [ - { - "builder": "win_chromium_compile_rel_ng", - "group": "tryserver.chromium.win" - } - ] - } - }, - "$recipe_engine/resultdb/test_presentation": { - "column_keys": [], - "grouping_keys": [ - "status", - "v.test_suite" - ] - }, - "builder_group": "chromium.win", - "recipe": "chromium", - "sheriff_rotations": [ - "chromium" - ] -} \ No newline at end of file
diff --git "a/infra/config/generated/builders/ci/Win7 Tests \0501\051/properties.json" "b/infra/config/generated/builders/ci/Win7 Tests \0501\051/properties.json" deleted file mode 100644 index b4e8ac6e..0000000 --- "a/infra/config/generated/builders/ci/Win7 Tests \0501\051/properties.json" +++ /dev/null
@@ -1,97 +0,0 @@ -{ - "$build/chromium_tests_builder_config": { - "builder_config": { - "builder_db": { - "entries": [ - { - "builder_id": { - "bucket": "ci", - "builder": "Win Builder", - "project": "chromium" - }, - "builder_spec": { - "build_gs_bucket": "chromium-win-archive", - "builder_group": "chromium.win", - "execution_mode": "COMPILE_AND_TEST", - "legacy_chromium_config": { - "apply_configs": [ - "goma_enable_global_file_stat_cache", - "mb" - ], - "build_config": "Release", - "config": "chromium", - "target_bits": 32 - }, - "legacy_gclient_config": { - "config": "chromium" - } - } - }, - { - "builder_id": { - "bucket": "ci", - "builder": "Win7 Tests (1)", - "project": "chromium" - }, - "builder_spec": { - "build_gs_bucket": "chromium-win-archive", - "builder_group": "chromium.win", - "execution_mode": "TEST", - "legacy_chromium_config": { - "apply_configs": [ - "goma_enable_global_file_stat_cache", - "mb" - ], - "build_config": "Release", - "config": "chromium", - "target_bits": 32 - }, - "legacy_gclient_config": { - "config": "chromium" - }, - "parent": { - "bucket": "ci", - "builder": "Win Builder", - "project": "chromium" - } - } - } - ] - }, - "builder_ids": [ - { - "bucket": "ci", - "builder": "Win7 Tests (1)", - "project": "chromium" - } - ], - "mirroring_builder_group_and_names": [ - { - "builder": "win7-rel", - "group": "tryserver.chromium.win" - }, - { - "builder": "win_chromium_compile_rel_ng", - "group": "tryserver.chromium.win" - } - ] - } - }, - "$build/reclient": { - "instance": "rbe-chromium-trusted", - "jobs": 250, - "metrics_project": "chromium-reclient-metrics" - }, - "$recipe_engine/resultdb/test_presentation": { - "column_keys": [], - "grouping_keys": [ - "status", - "v.test_suite" - ] - }, - "builder_group": "chromium.win", - "recipe": "chromium", - "sheriff_rotations": [ - "chromium" - ] -} \ No newline at end of file
diff --git a/infra/config/generated/builders/ci/chromeos-kevin-rel/properties.json b/infra/config/generated/builders/ci/chromeos-kevin-rel/properties.json deleted file mode 100644 index 006eabf..0000000 --- a/infra/config/generated/builders/ci/chromeos-kevin-rel/properties.json +++ /dev/null
@@ -1,78 +0,0 @@ -{ - "$build/chromium_tests_builder_config": { - "builder_config": { - "builder_db": { - "entries": [ - { - "builder_id": { - "bucket": "ci", - "builder": "chromeos-kevin-rel", - "project": "chromium" - }, - "builder_spec": { - "build_gs_bucket": "chromium-chromiumos-archive", - "builder_group": "chromium.chromiumos", - "execution_mode": "COMPILE_AND_TEST", - "legacy_chromium_config": { - "apply_configs": [ - "mb" - ], - "build_config": "Release", - "config": "chromium", - "target_arch": "arm", - "target_bits": 32, - "target_cros_boards": [ - "kevin", - "arm-generic" - ], - "target_platform": "chromeos" - }, - "legacy_gclient_config": { - "apply_configs": [ - "arm", - "chromeos", - "checkout_lacros_sdk" - ], - "config": "chromium" - } - } - } - ] - }, - "builder_ids": [ - { - "bucket": "ci", - "builder": "chromeos-kevin-rel", - "project": "chromium" - } - ], - "mirroring_builder_group_and_names": [ - { - "builder": "chromeos-kevin-compile-rel", - "group": "tryserver.chromium.chromiumos" - }, - { - "builder": "chromeos-kevin-rel", - "group": "tryserver.chromium.chromiumos" - } - ] - } - }, - "$build/reclient": { - "instance": "rbe-chromium-trusted", - "jobs": 500, - "metrics_project": "chromium-reclient-metrics" - }, - "$recipe_engine/resultdb/test_presentation": { - "column_keys": [], - "grouping_keys": [ - "status", - "v.test_suite" - ] - }, - "builder_group": "chromium.chromiumos", - "recipe": "chromium", - "sheriff_rotations": [ - "chromium" - ] -} \ No newline at end of file
diff --git a/infra/config/generated/builders/try/chromeos-kevin-compile-rel/properties.json b/infra/config/generated/builders/try/chromeos-kevin-compile-rel/properties.json deleted file mode 100644 index 6c524f7..0000000 --- a/infra/config/generated/builders/try/chromeos-kevin-compile-rel/properties.json +++ /dev/null
@@ -1,66 +0,0 @@ -{ - "$build/chromium_tests_builder_config": { - "builder_config": { - "builder_db": { - "entries": [ - { - "builder_id": { - "bucket": "ci", - "builder": "chromeos-kevin-rel", - "project": "chromium" - }, - "builder_spec": { - "build_gs_bucket": "chromium-chromiumos-archive", - "builder_group": "chromium.chromiumos", - "execution_mode": "COMPILE_AND_TEST", - "legacy_chromium_config": { - "apply_configs": [ - "mb" - ], - "build_config": "Release", - "config": "chromium", - "target_arch": "arm", - "target_bits": 32, - "target_cros_boards": [ - "kevin", - "arm-generic" - ], - "target_platform": "chromeos" - }, - "legacy_gclient_config": { - "apply_configs": [ - "arm", - "chromeos", - "checkout_lacros_sdk" - ], - "config": "chromium" - } - } - } - ] - }, - "builder_ids": [ - { - "bucket": "ci", - "builder": "chromeos-kevin-rel", - "project": "chromium" - } - ], - "is_compile_only": true - } - }, - "$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": "tryserver.chromium.chromiumos", - "recipe": "chromium_trybot" -} \ No newline at end of file
diff --git a/infra/config/generated/builders/try/chromeos-kevin-rel/properties.json b/infra/config/generated/builders/try/chromeos-kevin-rel/properties.json deleted file mode 100644 index 60285f8..0000000 --- a/infra/config/generated/builders/try/chromeos-kevin-rel/properties.json +++ /dev/null
@@ -1,65 +0,0 @@ -{ - "$build/chromium_tests_builder_config": { - "builder_config": { - "builder_db": { - "entries": [ - { - "builder_id": { - "bucket": "ci", - "builder": "chromeos-kevin-rel", - "project": "chromium" - }, - "builder_spec": { - "build_gs_bucket": "chromium-chromiumos-archive", - "builder_group": "chromium.chromiumos", - "execution_mode": "COMPILE_AND_TEST", - "legacy_chromium_config": { - "apply_configs": [ - "mb" - ], - "build_config": "Release", - "config": "chromium", - "target_arch": "arm", - "target_bits": 32, - "target_cros_boards": [ - "kevin", - "arm-generic" - ], - "target_platform": "chromeos" - }, - "legacy_gclient_config": { - "apply_configs": [ - "arm", - "chromeos", - "checkout_lacros_sdk" - ], - "config": "chromium" - } - } - } - ] - }, - "builder_ids": [ - { - "bucket": "ci", - "builder": "chromeos-kevin-rel", - "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": "tryserver.chromium.chromiumos", - "recipe": "chromium_trybot" -} \ No newline at end of file
diff --git a/infra/config/generated/builders/try/win7-rel/properties.json b/infra/config/generated/builders/try/win7-rel/properties.json deleted file mode 100644 index c1cec07..0000000 --- a/infra/config/generated/builders/try/win7-rel/properties.json +++ /dev/null
@@ -1,97 +0,0 @@ -{ - "$build/chromium_tests_builder_config": { - "builder_config": { - "builder_db": { - "entries": [ - { - "builder_id": { - "bucket": "ci", - "builder": "Win Builder", - "project": "chromium" - }, - "builder_spec": { - "build_gs_bucket": "chromium-win-archive", - "builder_group": "chromium.win", - "execution_mode": "COMPILE_AND_TEST", - "legacy_chromium_config": { - "apply_configs": [ - "goma_enable_global_file_stat_cache", - "mb" - ], - "build_config": "Release", - "config": "chromium", - "target_bits": 32 - }, - "legacy_gclient_config": { - "config": "chromium" - } - } - }, - { - "builder_id": { - "bucket": "ci", - "builder": "Win7 Tests (1)", - "project": "chromium" - }, - "builder_spec": { - "build_gs_bucket": "chromium-win-archive", - "builder_group": "chromium.win", - "execution_mode": "TEST", - "legacy_chromium_config": { - "apply_configs": [ - "goma_enable_global_file_stat_cache", - "mb" - ], - "build_config": "Release", - "config": "chromium", - "target_bits": 32 - }, - "legacy_gclient_config": { - "config": "chromium" - }, - "parent": { - "bucket": "ci", - "builder": "Win Builder", - "project": "chromium" - } - } - } - ] - }, - "builder_ids": [ - { - "bucket": "ci", - "builder": "Win Builder", - "project": "chromium" - } - ], - "builder_ids_in_scope_for_testing": [ - { - "bucket": "ci", - "builder": "Win7 Tests (1)", - "project": "chromium" - } - ] - } - }, - "$build/goma": { - "enable_ats": false, - "jobs": 300, - "rpc_extra_params": "?prod", - "server_host": "goma.chromium.org" - }, - "$build/reclient": { - "instance": "rbe-chromium-untrusted", - "jobs": 150, - "metrics_project": "chromium-reclient-metrics" - }, - "$recipe_engine/resultdb/test_presentation": { - "column_keys": [], - "grouping_keys": [ - "status", - "v.test_suite" - ] - }, - "builder_group": "tryserver.chromium.win", - "recipe": "chromium_trybot" -} \ No newline at end of file
diff --git a/infra/config/generated/builders/try/win_chromium_compile_rel_ng/properties.json b/infra/config/generated/builders/try/win_chromium_compile_rel_ng/properties.json index 871c4c5..b938abd 100644 --- a/infra/config/generated/builders/try/win_chromium_compile_rel_ng/properties.json +++ b/infra/config/generated/builders/try/win_chromium_compile_rel_ng/properties.json
@@ -55,64 +55,6 @@ "config": "chromium" } } - }, - { - "builder_id": { - "bucket": "ci", - "builder": "Win7 (32) Tests", - "project": "chromium" - }, - "builder_spec": { - "build_gs_bucket": "chromium-win-archive", - "builder_group": "chromium.win", - "execution_mode": "TEST", - "legacy_chromium_config": { - "apply_configs": [ - "goma_enable_global_file_stat_cache", - "mb" - ], - "build_config": "Release", - "config": "chromium", - "target_bits": 32 - }, - "legacy_gclient_config": { - "config": "chromium" - }, - "parent": { - "bucket": "ci", - "builder": "Win Builder", - "project": "chromium" - } - } - }, - { - "builder_id": { - "bucket": "ci", - "builder": "Win7 Tests (1)", - "project": "chromium" - }, - "builder_spec": { - "build_gs_bucket": "chromium-win-archive", - "builder_group": "chromium.win", - "execution_mode": "TEST", - "legacy_chromium_config": { - "apply_configs": [ - "goma_enable_global_file_stat_cache", - "mb" - ], - "build_config": "Release", - "config": "chromium", - "target_bits": 32 - }, - "legacy_gclient_config": { - "config": "chromium" - }, - "parent": { - "bucket": "ci", - "builder": "Win Builder", - "project": "chromium" - } - } } ] }, @@ -128,16 +70,6 @@ "bucket": "ci", "builder": "WebKit Win10", "project": "chromium" - }, - { - "bucket": "ci", - "builder": "Win7 (32) Tests", - "project": "chromium" - }, - { - "bucket": "ci", - "builder": "Win7 Tests (1)", - "project": "chromium" } ], "is_compile_only": true
diff --git a/infra/config/generated/builders/try/win_chromium_x64_rel_ng/properties.json b/infra/config/generated/builders/try/win_chromium_x64_rel_ng/properties.json index d1faa2c..a628bea 100644 --- a/infra/config/generated/builders/try/win_chromium_x64_rel_ng/properties.json +++ b/infra/config/generated/builders/try/win_chromium_x64_rel_ng/properties.json
@@ -6,35 +6,6 @@ { "builder_id": { "bucket": "ci", - "builder": "Win 7 Tests x64 (1)", - "project": "chromium" - }, - "builder_spec": { - "build_gs_bucket": "chromium-win-archive", - "builder_group": "chromium.win", - "execution_mode": "TEST", - "legacy_chromium_config": { - "apply_configs": [ - "mb" - ], - "build_config": "Release", - "config": "chromium", - "target_bits": 64, - "target_platform": "win" - }, - "legacy_gclient_config": { - "config": "chromium" - }, - "parent": { - "bucket": "ci", - "builder": "Win x64 Builder", - "project": "chromium" - } - } - }, - { - "builder_id": { - "bucket": "ci", "builder": "Win x64 Builder", "project": "chromium" }, @@ -67,13 +38,6 @@ "builder": "Win x64 Builder", "project": "chromium" } - ], - "builder_ids_in_scope_for_testing": [ - { - "bucket": "ci", - "builder": "Win 7 Tests x64 (1)", - "project": "chromium" - } ] } },
diff --git a/infra/config/generated/luci/commit-queue.cfg b/infra/config/generated/luci/commit-queue.cfg index 3b792a5..e328105 100644 --- a/infra/config/generated/luci/commit-queue.cfg +++ b/infra/config/generated/luci/commit-queue.cfg
@@ -1229,14 +1229,6 @@ includable_only: true } builders { - name: "chromium/try/chromeos-kevin-compile-rel" - includable_only: true - } - builders { - name: "chromium/try/chromeos-kevin-rel" - includable_only: true - } - builders { name: "chromium/try/chromeos-octopus-rel" includable_only: true } @@ -3841,10 +3833,6 @@ includable_only: true } builders { - name: "chromium/try/win7-rel" - includable_only: true - } - builders { name: "chromium/try/win_archive" includable_only: true }
diff --git a/infra/config/generated/luci/cr-buildbucket.cfg b/infra/config/generated/luci/cr-buildbucket.cfg index b63736d..7013297 100644 --- a/infra/config/generated/luci/cr-buildbucket.cfg +++ b/infra/config/generated/luci/cr-buildbucket.cfg
@@ -22636,97 +22636,6 @@ } } builders { - name: "Win 7 Tests x64 (1)" - swarming_host: "chromium-swarm.appspot.com" - dimensions: "builderless:1" - dimensions: "cores:8" - dimensions: "cpu:x86-64" - dimensions: "free_space:standard" - dimensions: "os:Windows-10" - 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/ci/Win 7 Tests x64 (1)/properties.json",' - ' "top_level_project": {' - ' "ref": "refs/heads/main",' - ' "repo": {' - ' "host": "chromium.googlesource.com",' - ' "project": "chromium/src"' - ' }' - ' }' - ' },' - ' "builder_group": "chromium.win",' - ' "led_builder_is_bootstrapped": true,' - ' "recipe": "chromium",' - ' "sheriff_rotations": [' - ' "chromium"' - ' ]' - '}' - execution_timeout_secs: 10800 - build_numbers: YES - service_account: "chromium-ci-builder@chops-service-accounts.iam.gserviceaccount.com" - experiments { - key: "chromium_swarming.expose_merge_script_failures" - value: 100 - } - experiments { - key: "luci.buildbucket.omit_python2" - value: 100 - } - experiments { - key: "luci.recipes.use_python3" - value: 100 - } - resultdb { - enable: true - bq_exports { - project: "chrome-luci-data" - dataset: "chromium" - table: "ci_test_results" - test_results {} - } - bq_exports { - project: "chrome-luci-data" - dataset: "chromium" - table: "gpu_ci_test_results" - test_results { - predicate { - test_id_regexp: "ninja://chrome/test:telemetry_gpu_integration_test[^/]*/.+" - } - } - } - bq_exports { - project: "chrome-luci-data" - dataset: "chromium" - table: "blink_web_tests_ci_test_results" - test_results { - predicate { - test_id_regexp: "(ninja://[^/]*blink_web_tests/.+)|(ninja://[^/]*blink_wpt_tests/.+)" - } - } - } - history_options { - use_invocation_timestamp: true - } - } - } - builders { name: "Win ASan Release" swarming_host: "chromium-swarm.appspot.com" dimensions: "builder:Win ASan Release" @@ -24886,188 +24795,6 @@ } } builders { - name: "Win7 (32) Tests" - swarming_host: "chromium-swarm.appspot.com" - dimensions: "builderless:1" - dimensions: "cores:8" - dimensions: "cpu:x86-64" - dimensions: "free_space:standard" - dimensions: "os:Ubuntu-18.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/ci/Win7 (32) Tests/properties.json",' - ' "top_level_project": {' - ' "ref": "refs/heads/main",' - ' "repo": {' - ' "host": "chromium.googlesource.com",' - ' "project": "chromium/src"' - ' }' - ' }' - ' },' - ' "builder_group": "chromium.win",' - ' "led_builder_is_bootstrapped": true,' - ' "recipe": "chromium",' - ' "sheriff_rotations": [' - ' "chromium"' - ' ]' - '}' - execution_timeout_secs: 10800 - build_numbers: YES - service_account: "chromium-ci-builder@chops-service-accounts.iam.gserviceaccount.com" - experiments { - key: "chromium_swarming.expose_merge_script_failures" - value: 100 - } - experiments { - key: "luci.buildbucket.omit_python2" - value: 100 - } - experiments { - key: "luci.recipes.use_python3" - value: 100 - } - resultdb { - enable: true - bq_exports { - project: "chrome-luci-data" - dataset: "chromium" - table: "ci_test_results" - test_results {} - } - bq_exports { - project: "chrome-luci-data" - dataset: "chromium" - table: "gpu_ci_test_results" - test_results { - predicate { - test_id_regexp: "ninja://chrome/test:telemetry_gpu_integration_test[^/]*/.+" - } - } - } - bq_exports { - project: "chrome-luci-data" - dataset: "chromium" - table: "blink_web_tests_ci_test_results" - test_results { - predicate { - test_id_regexp: "(ninja://[^/]*blink_web_tests/.+)|(ninja://[^/]*blink_wpt_tests/.+)" - } - } - } - history_options { - use_invocation_timestamp: true - } - } - } - builders { - name: "Win7 Tests (1)" - swarming_host: "chromium-swarm.appspot.com" - dimensions: "builderless:1" - dimensions: "cores:8" - dimensions: "cpu:x86-64" - dimensions: "free_space:standard" - dimensions: "os:Windows-10" - 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/ci/Win7 Tests (1)/properties.json",' - ' "top_level_project": {' - ' "ref": "refs/heads/main",' - ' "repo": {' - ' "host": "chromium.googlesource.com",' - ' "project": "chromium/src"' - ' }' - ' }' - ' },' - ' "builder_group": "chromium.win",' - ' "led_builder_is_bootstrapped": true,' - ' "recipe": "chromium",' - ' "sheriff_rotations": [' - ' "chromium"' - ' ]' - '}' - execution_timeout_secs: 10800 - build_numbers: YES - service_account: "chromium-ci-builder@chops-service-accounts.iam.gserviceaccount.com" - experiments { - key: "chromium_swarming.expose_merge_script_failures" - value: 100 - } - experiments { - key: "luci.buildbucket.omit_python2" - value: 100 - } - experiments { - key: "luci.recipes.use_python3" - value: 100 - } - resultdb { - enable: true - bq_exports { - project: "chrome-luci-data" - dataset: "chromium" - table: "ci_test_results" - test_results {} - } - bq_exports { - project: "chrome-luci-data" - dataset: "chromium" - table: "gpu_ci_test_results" - test_results { - predicate { - test_id_regexp: "ninja://chrome/test:telemetry_gpu_integration_test[^/]*/.+" - } - } - } - bq_exports { - project: "chrome-luci-data" - dataset: "chromium" - table: "blink_web_tests_ci_test_results" - test_results { - predicate { - test_id_regexp: "(ninja://[^/]*blink_web_tests/.+)|(ninja://[^/]*blink_wpt_tests/.+)" - } - } - } - history_options { - use_invocation_timestamp: true - } - } - } - builders { name: "Windows deterministic" swarming_host: "chromium-swarm.appspot.com" dimensions: "builder:Windows deterministic" @@ -31844,97 +31571,6 @@ } } builders { - name: "chromeos-kevin-rel" - swarming_host: "chromium-swarm.appspot.com" - dimensions: "builderless:1" - dimensions: "cores:8" - dimensions: "cpu:x86-64" - dimensions: "free_space:standard" - dimensions: "os:Ubuntu-18.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/ci/chromeos-kevin-rel/properties.json",' - ' "top_level_project": {' - ' "ref": "refs/heads/main",' - ' "repo": {' - ' "host": "chromium.googlesource.com",' - ' "project": "chromium/src"' - ' }' - ' }' - ' },' - ' "builder_group": "chromium.chromiumos",' - ' "led_builder_is_bootstrapped": true,' - ' "recipe": "chromium",' - ' "sheriff_rotations": [' - ' "chromium"' - ' ]' - '}' - execution_timeout_secs: 10800 - build_numbers: YES - service_account: "chromium-ci-builder@chops-service-accounts.iam.gserviceaccount.com" - experiments { - key: "chromium_swarming.expose_merge_script_failures" - value: 100 - } - experiments { - key: "luci.buildbucket.omit_python2" - value: 100 - } - experiments { - key: "luci.recipes.use_python3" - value: 100 - } - resultdb { - enable: true - bq_exports { - project: "chrome-luci-data" - dataset: "chromium" - table: "ci_test_results" - test_results {} - } - bq_exports { - project: "chrome-luci-data" - dataset: "chromium" - table: "gpu_ci_test_results" - test_results { - predicate { - test_id_regexp: "ninja://chrome/test:telemetry_gpu_integration_test[^/]*/.+" - } - } - } - bq_exports { - project: "chrome-luci-data" - dataset: "chromium" - table: "blink_web_tests_ci_test_results" - test_results { - predicate { - test_id_regexp: "(ninja://[^/]*blink_web_tests/.+)|(ninja://[^/]*blink_wpt_tests/.+)" - } - } - } - history_options { - use_invocation_timestamp: true - } - } - } - builders { name: "chromeos-octopus-rel" swarming_host: "chromium-swarm.appspot.com" dimensions: "builderless:1" @@ -64040,226 +63676,6 @@ } } builders { - name: "chromeos-kevin-compile-rel" - swarming_host: "chromium-swarm.appspot.com" - dimensions: "builderless:1" - dimensions: "cores:8" - dimensions: "cpu:x86-64" - dimensions: "os:Ubuntu-18.04" - dimensions: "pool:luci.chromium.try" - 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/try/chromeos-kevin-compile-rel/properties.json",' - ' "top_level_project": {' - ' "ref": "refs/heads/main",' - ' "repo": {' - ' "host": "chromium.googlesource.com",' - ' "project": "chromium/src"' - ' }' - ' }' - ' },' - ' "builder_group": "tryserver.chromium.chromiumos",' - ' "led_builder_is_bootstrapped": true,' - ' "recipe": "chromium_trybot"' - '}' - execution_timeout_secs: 14400 - expiration_secs: 7200 - grace_period { - seconds: 120 - } - caches { - name: "win_toolchain" - path: "win_toolchain" - } - build_numbers: YES - service_account: "chromium-try-builder@chops-service-accounts.iam.gserviceaccount.com" - task_template_canary_percentage { - value: 5 - } - experiments { - key: "chromium_swarming.expose_merge_script_failures" - value: 100 - } - experiments { - key: "enable_weetbix_queries" - value: 100 - } - experiments { - key: "luci.buildbucket.omit_python2" - value: 100 - } - experiments { - key: "luci.recipes.use_python3" - value: 100 - } - experiments { - key: "weetbix.enable_weetbix_exonerations" - value: 100 - } - experiments { - key: "weetbix.retry_weak_exonerations" - value: 100 - } - resultdb { - enable: true - bq_exports { - project: "chrome-luci-data" - dataset: "chromium" - table: "try_test_results" - test_results {} - } - bq_exports { - project: "chrome-luci-data" - dataset: "chromium" - table: "gpu_try_test_results" - test_results { - predicate { - test_id_regexp: "ninja://chrome/test:telemetry_gpu_integration_test[^/]*/.+" - } - } - } - bq_exports { - project: "chrome-luci-data" - dataset: "chromium" - table: "blink_web_tests_try_test_results" - test_results { - predicate { - test_id_regexp: "(ninja://[^/]*blink_web_tests/.+)|(ninja://[^/]*blink_wpt_tests/.+)" - } - } - } - history_options { - use_invocation_timestamp: true - } - } - } - builders { - name: "chromeos-kevin-rel" - swarming_host: "chromium-swarm.appspot.com" - dimensions: "builderless:1" - dimensions: "cores:8" - dimensions: "cpu:x86-64" - dimensions: "os:Ubuntu-18.04" - dimensions: "pool:luci.chromium.try" - 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/try/chromeos-kevin-rel/properties.json",' - ' "top_level_project": {' - ' "ref": "refs/heads/main",' - ' "repo": {' - ' "host": "chromium.googlesource.com",' - ' "project": "chromium/src"' - ' }' - ' }' - ' },' - ' "builder_group": "tryserver.chromium.chromiumos",' - ' "led_builder_is_bootstrapped": true,' - ' "recipe": "chromium_trybot"' - '}' - execution_timeout_secs: 21600 - expiration_secs: 7200 - grace_period { - seconds: 120 - } - caches { - name: "win_toolchain" - path: "win_toolchain" - } - build_numbers: YES - service_account: "chromium-try-builder@chops-service-accounts.iam.gserviceaccount.com" - task_template_canary_percentage { - value: 5 - } - experiments { - key: "chromium_swarming.expose_merge_script_failures" - value: 100 - } - experiments { - key: "enable_weetbix_queries" - value: 100 - } - experiments { - key: "luci.buildbucket.omit_python2" - value: 100 - } - experiments { - key: "luci.recipes.use_python3" - value: 100 - } - experiments { - key: "weetbix.enable_weetbix_exonerations" - value: 100 - } - experiments { - key: "weetbix.retry_weak_exonerations" - value: 100 - } - resultdb { - enable: true - bq_exports { - project: "chrome-luci-data" - dataset: "chromium" - table: "try_test_results" - test_results {} - } - bq_exports { - project: "chrome-luci-data" - dataset: "chromium" - table: "gpu_try_test_results" - test_results { - predicate { - test_id_regexp: "ninja://chrome/test:telemetry_gpu_integration_test[^/]*/.+" - } - } - } - bq_exports { - project: "chrome-luci-data" - dataset: "chromium" - table: "blink_web_tests_try_test_results" - test_results { - predicate { - test_id_regexp: "(ninja://[^/]*blink_web_tests/.+)|(ninja://[^/]*blink_wpt_tests/.+)" - } - } - } - history_options { - use_invocation_timestamp: true - } - } - } - builders { name: "chromeos-octopus-rel" swarming_host: "chromium-swarm.appspot.com" dimensions: "builderless:1" @@ -94068,116 +93484,6 @@ } } builders { - name: "win7-rel" - swarming_host: "chromium-swarm.appspot.com" - dimensions: "builderless:1" - dimensions: "cores:16" - dimensions: "cpu:x86-64" - dimensions: "os:Windows-10" - dimensions: "pool:luci.chromium.try" - dimensions: "ssd:1" - 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/try/win7-rel/properties.json",' - ' "top_level_project": {' - ' "ref": "refs/heads/main",' - ' "repo": {' - ' "host": "chromium.googlesource.com",' - ' "project": "chromium/src"' - ' }' - ' }' - ' },' - ' "builder_group": "tryserver.chromium.win",' - ' "led_builder_is_bootstrapped": true,' - ' "recipe": "chromium_trybot"' - '}' - execution_timeout_secs: 16200 - expiration_secs: 7200 - grace_period { - seconds: 120 - } - caches { - name: "win_toolchain" - path: "win_toolchain" - } - build_numbers: YES - service_account: "chromium-try-builder@chops-service-accounts.iam.gserviceaccount.com" - task_template_canary_percentage { - value: 5 - } - experiments { - key: "chromium_swarming.expose_merge_script_failures" - value: 100 - } - experiments { - key: "enable_weetbix_queries" - value: 100 - } - experiments { - key: "luci.buildbucket.omit_python2" - value: 100 - } - experiments { - key: "luci.recipes.use_python3" - value: 100 - } - experiments { - key: "weetbix.enable_weetbix_exonerations" - value: 100 - } - experiments { - key: "weetbix.retry_weak_exonerations" - value: 100 - } - resultdb { - enable: true - bq_exports { - project: "chrome-luci-data" - dataset: "chromium" - table: "try_test_results" - test_results {} - } - bq_exports { - project: "chrome-luci-data" - dataset: "chromium" - table: "gpu_try_test_results" - test_results { - predicate { - test_id_regexp: "ninja://chrome/test:telemetry_gpu_integration_test[^/]*/.+" - } - } - } - bq_exports { - project: "chrome-luci-data" - dataset: "chromium" - table: "blink_web_tests_try_test_results" - test_results { - predicate { - test_id_regexp: "(ninja://[^/]*blink_web_tests/.+)|(ninja://[^/]*blink_wpt_tests/.+)" - } - } - } - history_options { - use_invocation_timestamp: true - } - } - } - builders { name: "win_archive" 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 753ba05..742841d8 100644 --- a/infra/config/generated/luci/luci-milo.cfg +++ b/infra/config/generated/luci/luci-milo.cfg
@@ -131,21 +131,6 @@ short_name: "64" } builders { - name: "buildbucket/luci.chromium.ci/Win7 (32) Tests" - category: "chromium.win|release|tester" - short_name: "32" - } - builders { - name: "buildbucket/luci.chromium.ci/Win7 Tests (1)" - category: "chromium.win|release|tester" - short_name: "32" - } - builders { - name: "buildbucket/luci.chromium.ci/Win 7 Tests x64 (1)" - category: "chromium.win|release|tester" - short_name: "64" - } - builders { name: "buildbucket/luci.chromium.ci/Win10 Tests x64" category: "chromium.win|release|tester" short_name: "w10" @@ -424,11 +409,6 @@ short_name: "jcz" } builders { - name: "buildbucket/luci.chromium.ci/chromeos-kevin-rel" - category: "chromium.chromiumos|simple|release" - short_name: "kvn" - } - builders { name: "buildbucket/luci.chromium.ci/chromeos-octopus-rel" category: "chromium.chromiumos|simple|release" short_name: "oct" @@ -973,11 +953,6 @@ short_name: "64" } builders { - name: "buildbucket/luci.chromium.ci/Win 7 Tests x64 (1)" - category: "chromium.win|release|tester" - short_name: "64" - } - builders { name: "buildbucket/luci.chromium.ci/Win10 Tests x64" category: "chromium.win|release|tester" short_name: "w10" @@ -2636,9 +2611,6 @@ name: "buildbucket/luci.chromium.try/chromeos-jacuzzi-rel" } builders { - name: "buildbucket/luci.chromium.try/chromeos-kevin-rel" - } - builders { name: "buildbucket/luci.chromium.try/chromeos-octopus-rel" } builders { @@ -2834,9 +2806,6 @@ name: "buildbucket/luci.chromium.try/win10_chromium_x64_rel_ng-compilator" } builders { - name: "buildbucket/luci.chromium.try/win7-rel" - } - builders { name: "buildbucket/luci.chromium.try/win_chromium_compile_dbg_ng" } builders { @@ -5715,11 +5684,6 @@ short_name: "jcz" } builders { - name: "buildbucket/luci.chromium.ci/chromeos-kevin-rel" - category: "simple|release" - short_name: "kvn" - } - builders { name: "buildbucket/luci.chromium.ci/chromeos-octopus-rel" category: "simple|release" short_name: "oct" @@ -15152,21 +15116,6 @@ short_name: "64" } builders { - name: "buildbucket/luci.chromium.ci/Win7 (32) Tests" - category: "release|tester" - short_name: "32" - } - builders { - name: "buildbucket/luci.chromium.ci/Win7 Tests (1)" - category: "release|tester" - short_name: "32" - } - builders { - name: "buildbucket/luci.chromium.ci/Win 7 Tests x64 (1)" - category: "release|tester" - short_name: "64" - } - builders { name: "buildbucket/luci.chromium.ci/Win10 Tests x64" category: "release|tester" short_name: "w10" @@ -16510,12 +16459,6 @@ name: "buildbucket/luci.chromium.try/chromeos-jacuzzi-rel" } builders { - name: "buildbucket/luci.chromium.try/chromeos-kevin-compile-rel" - } - builders { - name: "buildbucket/luci.chromium.try/chromeos-kevin-rel" - } - builders { name: "buildbucket/luci.chromium.try/chromeos-octopus-rel" } builders { @@ -17320,9 +17263,6 @@ name: "buildbucket/luci.chromium.try/win32-official" } builders { - name: "buildbucket/luci.chromium.try/win7-rel" - } - builders { name: "buildbucket/luci.chromium.try/win_archive" } builders { @@ -17695,12 +17635,6 @@ name: "buildbucket/luci.chromium.try/chromeos-jacuzzi-rel" } builders { - name: "buildbucket/luci.chromium.try/chromeos-kevin-compile-rel" - } - builders { - name: "buildbucket/luci.chromium.try/chromeos-kevin-rel" - } - builders { name: "buildbucket/luci.chromium.try/chromeos-octopus-rel" } builders { @@ -18506,9 +18440,6 @@ name: "buildbucket/luci.chromium.try/win11-x64-fyi-rel" } builders { - name: "buildbucket/luci.chromium.try/win7-rel" - } - builders { name: "buildbucket/luci.chromium.try/win_archive" } builders {
diff --git a/infra/config/generated/luci/luci-notify.cfg b/infra/config/generated/luci/luci-notify.cfg index abf7424..fc434696 100644 --- a/infra/config/generated/luci/luci-notify.cfg +++ b/infra/config/generated/luci/luci-notify.cfg
@@ -1825,24 +1825,6 @@ } notifiers { notifications { - on_occurrence: FAILURE - failed_step_regexp: "\\b(bot_update|compile|gclient runhooks|runhooks|update|\\w*nocompile_test)\\b" - email { - rotation_urls: "https://chrome-ops-rotation-proxy.appspot.com/current/oncallator:chrome-build-sheriff" - } - template: "tree_closure_email_template" - } - builders { - bucket: "ci" - name: "Win 7 Tests x64 (1)" - } - tree_closers { - tree_status_host: "chromium-status.appspot.com" - failed_step_regexp: "\\b(bot_update|compile|gclient runhooks|runhooks|update|\\w*nocompile_test)\\b" - } -} -notifiers { - notifications { on_change: true email { recipients: "chromesec-lkgr-failures@google.com" @@ -1998,42 +1980,6 @@ } builders { bucket: "ci" - name: "Win7 (32) Tests" - } - tree_closers { - tree_status_host: "chromium-status.appspot.com" - failed_step_regexp: "\\b(bot_update|compile|gclient runhooks|runhooks|update|\\w*nocompile_test)\\b" - } -} -notifiers { - notifications { - on_occurrence: FAILURE - failed_step_regexp: "\\b(bot_update|compile|gclient runhooks|runhooks|update|\\w*nocompile_test)\\b" - email { - rotation_urls: "https://chrome-ops-rotation-proxy.appspot.com/current/oncallator:chrome-build-sheriff" - } - template: "tree_closure_email_template" - } - builders { - bucket: "ci" - name: "Win7 Tests (1)" - } - tree_closers { - tree_status_host: "chromium-status.appspot.com" - failed_step_regexp: "\\b(bot_update|compile|gclient runhooks|runhooks|update|\\w*nocompile_test)\\b" - } -} -notifiers { - notifications { - on_occurrence: FAILURE - failed_step_regexp: "\\b(bot_update|compile|gclient runhooks|runhooks|update|\\w*nocompile_test)\\b" - email { - rotation_urls: "https://chrome-ops-rotation-proxy.appspot.com/current/oncallator:chrome-build-sheriff" - } - template: "tree_closure_email_template" - } - builders { - bucket: "ci" name: "Windows deterministic" repository: "https://chromium.googlesource.com/chromium/src" } @@ -2655,25 +2601,6 @@ } builders { bucket: "ci" - name: "chromeos-kevin-rel" - repository: "https://chromium.googlesource.com/chromium/src" - } - tree_closers { - tree_status_host: "chromium-status.appspot.com" - failed_step_regexp: "\\b(bot_update|compile|gclient runhooks|runhooks|update|\\w*nocompile_test)\\b" - } -} -notifiers { - notifications { - on_occurrence: FAILURE - failed_step_regexp: "\\b(bot_update|compile|gclient runhooks|runhooks|update|\\w*nocompile_test)\\b" - email { - rotation_urls: "https://chrome-ops-rotation-proxy.appspot.com/current/oncallator:chrome-build-sheriff" - } - template: "tree_closure_email_template" - } - builders { - bucket: "ci" name: "chromeos-octopus-rel" repository: "https://chromium.googlesource.com/chromium/src" }
diff --git a/infra/config/generated/luci/luci-scheduler.cfg b/infra/config/generated/luci/luci-scheduler.cfg index 85dfc81b..2c91e4b 100644 --- a/infra/config/generated/luci/luci-scheduler.cfg +++ b/infra/config/generated/luci/luci-scheduler.cfg
@@ -2981,15 +2981,6 @@ } } job { - id: "Win 7 Tests x64 (1)" - realm: "ci" - buildbucket { - server: "cr-buildbucket.appspot.com" - bucket: "ci" - builder: "Win 7 Tests x64 (1)" - } -} -job { id: "Win ASan Release" realm: "ci" triggering_policy { @@ -3331,24 +3322,6 @@ } } job { - id: "Win7 (32) Tests" - realm: "ci" - buildbucket { - server: "cr-buildbucket.appspot.com" - bucket: "ci" - builder: "Win7 (32) Tests" - } -} -job { - id: "Win7 Tests (1)" - realm: "ci" - buildbucket { - server: "cr-buildbucket.appspot.com" - bucket: "ci" - builder: "Win7 Tests (1)" - } -} -job { id: "Windows deterministic" realm: "ci" buildbucket { @@ -4066,15 +4039,6 @@ } } job { - id: "chromeos-kevin-rel" - realm: "ci" - buildbucket { - server: "cr-buildbucket.appspot.com" - bucket: "ci" - builder: "chromeos-kevin-rel" - } -} -job { id: "chromeos-octopus-rel" realm: "ci" buildbucket { @@ -6113,7 +6077,6 @@ triggers: "chromeos-arm-generic-rel" triggers: "chromeos-arm64-generic-rel" triggers: "chromeos-jacuzzi-rel" - triggers: "chromeos-kevin-rel" triggers: "chromeos-octopus-rel" triggers: "fuchsia-angle-builder" triggers: "fuchsia-arm64-cast-receiver-rel"
diff --git a/infra/config/generated/luci/realms.cfg b/infra/config/generated/luci/realms.cfg index 36c6a53..cc90fa36 100644 --- a/infra/config/generated/luci/realms.cfg +++ b/infra/config/generated/luci/realms.cfg
@@ -140,14 +140,11 @@ values: "Nougat Phone Tester" values: "Oreo Phone Tester" values: "WebKit Win10" - values: "Win 7 Tests x64 (1)" values: "Win10 Tests x64" values: "Win10 Tests x64 (dbg)" values: "Win10 x64 Debug (NVIDIA)" values: "Win10 x64 Release (NVIDIA)" values: "Win11 Tests x64" - values: "Win7 (32) Tests" - values: "Win7 Tests (1)" values: "android-12-x64-dbg-tests" values: "android-12-x64-fyi-rel" values: "android-12l-x64-dbg-tests"
diff --git a/infra/config/generated/sheriff-rotations/chromium.txt b/infra/config/generated/sheriff-rotations/chromium.txt index 80f31d0..5f8407a 100644 --- a/infra/config/generated/sheriff-rotations/chromium.txt +++ b/infra/config/generated/sheriff-rotations/chromium.txt
@@ -38,14 +38,11 @@ ci/WebKit Linux Leak ci/WebKit Linux MSAN ci/WebKit Win10 -ci/Win 7 Tests x64 (1) ci/Win Builder ci/Win Builder (dbg) ci/Win x64 Builder ci/Win x64 Builder (dbg) ci/Win10 Tests x64 -ci/Win7 (32) Tests -ci/Win7 Tests (1) ci/Windows deterministic ci/android-archive-dbg ci/android-archive-rel @@ -58,7 +55,6 @@ ci/chromeos-arm-generic-dbg ci/chromeos-arm-generic-rel ci/chromeos-arm64-generic-rel -ci/chromeos-kevin-rel ci/fuchsia-arm64-cast-receiver-rel ci/fuchsia-arm64-rel ci/fuchsia-x64-cast-receiver-rel
diff --git a/infra/config/subprojects/chromium/ci/chromium.chromiumos.star b/infra/config/subprojects/chromium/ci/chromium.chromiumos.star index 129e3d68..28824569 100644 --- a/infra/config/subprojects/chromium/ci/chromium.chromiumos.star +++ b/infra/config/subprojects/chromium/ci/chromium.chromiumos.star
@@ -399,42 +399,6 @@ ) ci.builder( - name = "chromeos-kevin-rel", - branch_selector = branches.CROS_LTS_MILESTONE, - builder_spec = builder_config.builder_spec( - gclient_config = builder_config.gclient_config( - config = "chromium", - apply_configs = [ - "arm", - "chromeos", - "checkout_lacros_sdk", - ], - ), - chromium_config = builder_config.chromium_config( - config = "chromium", - apply_configs = [ - "mb", - ], - build_config = builder_config.build_config.RELEASE, - target_arch = builder_config.target_arch.ARM, - target_bits = 32, - target_cros_boards = [ - "kevin", - "arm-generic", - ], - target_platform = builder_config.target_platform.CHROMEOS, - ), - build_gs_bucket = "chromium-chromiumos-archive", - ), - console_view_entry = consoles.console_view_entry( - category = "simple|release", - short_name = "kvn", - ), - main_console_view = "main", - reclient_jobs = reclient.jobs.HIGH_JOBS_FOR_CI, -) - -ci.builder( name = "chromeos-octopus-rel", branch_selector = branches.CROS_LTS_MILESTONE, builder_spec = builder_config.builder_spec(
diff --git a/infra/config/subprojects/chromium/ci/chromium.win.star b/infra/config/subprojects/chromium/ci/chromium.win.star index af36797..03e1df1 100644 --- a/infra/config/subprojects/chromium/ci/chromium.win.star +++ b/infra/config/subprojects/chromium/ci/chromium.win.star
@@ -141,88 +141,6 @@ tree_closing = False, ) -ci.thin_tester( - name = "Win7 (32) Tests", - builder_spec = builder_config.builder_spec( - execution_mode = builder_config.execution_mode.TEST, - gclient_config = builder_config.gclient_config( - config = "chromium", - ), - chromium_config = builder_config.chromium_config( - config = "chromium", - apply_configs = [ - "goma_enable_global_file_stat_cache", - "mb", - ], - build_config = builder_config.build_config.RELEASE, - target_bits = 32, - ), - build_gs_bucket = "chromium-win-archive", - ), - console_view_entry = consoles.console_view_entry( - category = "release|tester", - short_name = "32", - ), - triggered_by = ["Win Builder"], -) - -ci.builder( - name = "Win7 Tests (1)", - branch_selector = branches.DESKTOP_EXTENDED_STABLE_MILESTONE, - builder_spec = builder_config.builder_spec( - execution_mode = builder_config.execution_mode.TEST, - gclient_config = builder_config.gclient_config( - config = "chromium", - ), - chromium_config = builder_config.chromium_config( - config = "chromium", - apply_configs = [ - "goma_enable_global_file_stat_cache", - "mb", - ], - build_config = builder_config.build_config.RELEASE, - target_bits = 32, - ), - build_gs_bucket = "chromium-win-archive", - ), - builderless = True, - console_view_entry = consoles.console_view_entry( - category = "release|tester", - short_name = "32", - ), - os = os.WINDOWS_10, - triggered_by = ["Win Builder"], -) - -ci.builder( - name = "Win 7 Tests x64 (1)", - builderless = True, - branch_selector = branches.DESKTOP_EXTENDED_STABLE_MILESTONE, - builder_spec = builder_config.builder_spec( - execution_mode = builder_config.execution_mode.TEST, - gclient_config = builder_config.gclient_config( - config = "chromium", - ), - chromium_config = builder_config.chromium_config( - config = "chromium", - apply_configs = [ - "mb", - ], - build_config = builder_config.build_config.RELEASE, - target_bits = 64, - target_platform = builder_config.target_platform.WIN, - ), - build_gs_bucket = "chromium-win-archive", - ), - console_view_entry = consoles.console_view_entry( - category = "release|tester", - short_name = "64", - ), - cq_mirrors_console_view = "mirrors", - os = os.WINDOWS_10, - triggered_by = ["ci/Win x64 Builder"], -) - ci.builder( name = "Win Builder (dbg)", branch_selector = branches.DESKTOP_EXTENDED_STABLE_MILESTONE,
diff --git a/infra/config/subprojects/chromium/try/tryserver.chromium.chromiumos.star b/infra/config/subprojects/chromium/try/tryserver.chromium.chromiumos.star index 0a9f3f1..f6827ad29f 100644 --- a/infra/config/subprojects/chromium/try/tryserver.chromium.chromiumos.star +++ b/infra/config/subprojects/chromium/try/tryserver.chromium.chromiumos.star
@@ -203,17 +203,6 @@ ) try_.builder( - name = "chromeos-kevin-compile-rel", - mirrors = [ - "ci/chromeos-kevin-rel", - ], - try_settings = builder_config.try_settings( - include_all_triggered_testers = True, - is_compile_only = True, - ), -) - -try_.builder( name = "chromeos-jacuzzi-rel", branch_selector = branches.CROS_LTS_MILESTONE, mirrors = [ @@ -223,16 +212,6 @@ ) try_.builder( - name = "chromeos-kevin-rel", - branch_selector = branches.CROS_LTS_MILESTONE, - mirrors = [ - "ci/chromeos-kevin-rel", - ], - main_list_view = "try", - execution_timeout = 6 * time.hour, -) - -try_.builder( name = "chromeos-octopus-rel", branch_selector = branches.CROS_LTS_MILESTONE, mirrors = [
diff --git a/infra/config/subprojects/chromium/try/tryserver.chromium.win.star b/infra/config/subprojects/chromium/try/tryserver.chromium.win.star index ebd1a6a..05af224 100644 --- a/infra/config/subprojects/chromium/try/tryserver.chromium.win.star +++ b/infra/config/subprojects/chromium/try/tryserver.chromium.win.star
@@ -159,7 +159,6 @@ name = "win_chromium_x64_rel_ng", mirrors = [ "ci/Win x64 Builder", - "ci/Win 7 Tests x64 (1)", ], ) @@ -290,20 +289,6 @@ ) try_.builder( - name = "win7-rel", - branch_selector = branches.DESKTOP_EXTENDED_STABLE_MILESTONE, - mirrors = [ - "ci/Win Builder", - "ci/Win7 Tests (1)", - ], - cores = 16, - execution_timeout = 4 * time.hour + 30 * time.minute, - goma_jobs = goma.jobs.J300, - main_list_view = "try", - ssd = True, -) - -try_.builder( name = "win-fieldtrial-rel", os = os.WINDOWS_DEFAULT, mirrors = ["ci/win-fieldtrial-rel"],
diff --git a/media/base/media_switches.cc b/media/base/media_switches.cc index 4fc1aca2..e9c9c85d0 100644 --- a/media/base/media_switches.cc +++ b/media/base/media_switches.cc
@@ -264,6 +264,16 @@ // Out-of-Process video decoding. const char kMaxChromeOSDecoderThreads[] = "max-chromeos-decoder-threads"; #endif + +const char kCastStreamingForceDisableHardwareH264[] = + "cast-streaming-force-disable-hardware-h264"; +const char kCastStreamingForceDisableHardwareVp8[] = + "cast-streaming-force-disable-hardware-vp8"; +const char kCastStreamingForceEnableHardwareH264[] = + "cast-streaming-force-enable-hardware-h264"; +const char kCastStreamingForceEnableHardwareVp8[] = + "cast-streaming-force-enable-hardware-vp8"; + } // namespace switches namespace media { @@ -1212,6 +1222,24 @@ "BresenhamCadence", base::FEATURE_DISABLED_BY_DEFAULT); +// Controls whether mirroring negotiations will include the AV1 codec for video +// encoding. +// +// NOTE: currently only software AV1 encoding is supported. +// TODO(https://crbug.com/1383333): hardware AV1 encoding should be added. +BASE_FEATURE(kCastStreamingAv1, + "CastStreamingAv1", + base::FEATURE_DISABLED_BY_DEFAULT); + +// Controls whether mirroring negotiations will include the VP9 codec for video +// encoding. +// +// NOTE: currently only software VP9 encoding is supported. +// TODO(https://crbug.com/1311770): hardware VP9 encoding should be added. +BASE_FEATURE(kCastStreamingVp9, + "CastStreamingVp9", + base::FEATURE_DISABLED_BY_DEFAULT); + #if BUILDFLAG(IS_FUCHSIA) // Enables use of Fuchsia's Mediacodec service for encoding. BASE_FEATURE(kFuchsiaMediacodecVideoEncoder,
diff --git a/media/base/media_switches.h b/media/base/media_switches.h index 29a3ce1e..801e4f24 100644 --- a/media/base/media_switches.h +++ b/media/base/media_switches.h
@@ -112,6 +112,32 @@ MEDIA_EXPORT extern const char kMaxChromeOSDecoderThreads[]; #endif +// NOTE: callers should always use the free functions in +// /media/cast/encoding/encoding_support.h instead of accessing these features +// directly. +// +// If enabled, completely disables use of H264 hardware encoding for Cast +// Streaming sessions. Takes precedence over +// kCastStreamingForceEnableHardwareH264. +MEDIA_EXPORT extern const char kCastStreamingForceDisableHardwareH264[]; + +// If enabled, completely disables use of VP8 hardware encoding for Cast +// Streaming sessions. Takes precedence over +// kCastStreamingForceEnableHardwareVp8. +MEDIA_EXPORT extern const char kCastStreamingForceDisableHardwareVp8[]; + +// If enabled, allows use of H264 hardware encoding for Cast Streaming sessions, +// even on platforms where it is disabled due to performance and reliability +// issues. kCastStreamingForceDisableHardwareH264 must be disabled for this flag +// to take effect. +MEDIA_EXPORT extern const char kCastStreamingForceEnableHardwareH264[]; + +// If enabled, allows use of VP8 hardware encoding for Cast Streaming sessions, +// even on platforms where it is disabled due to performance and reliability +// issues. kCastStreamingForceDisableHardwareVp8 must be disabled for this flag +// to take effect. +MEDIA_EXPORT extern const char kCastStreamingForceEnableHardwareVp8[]; + } // namespace switches namespace media { @@ -124,6 +150,13 @@ MEDIA_EXPORT BASE_DECLARE_FEATURE(kAutoplayIgnoreWebAudio); MEDIA_EXPORT BASE_DECLARE_FEATURE(kAutoplayDisableSettings); MEDIA_EXPORT BASE_DECLARE_FEATURE(kBresenhamCadence); + +// NOTE: callers should always use the free functions in +// /media/cast/encoding/encoding_support.h instead of accessing these features +// directly. +MEDIA_EXPORT BASE_DECLARE_FEATURE(kCastStreamingAv1); +MEDIA_EXPORT BASE_DECLARE_FEATURE(kCastStreamingVp9); + MEDIA_EXPORT BASE_DECLARE_FEATURE(kCdmHostVerification); MEDIA_EXPORT BASE_DECLARE_FEATURE(kCdmProcessSiteIsolation); #if BUILDFLAG(CHROME_WIDE_ECHO_CANCELLATION)
diff --git a/media/capture/video/chromeos/OWNERS b/media/capture/video/chromeos/OWNERS index 218c945..0c3b8a2 100644 --- a/media/capture/video/chromeos/OWNERS +++ b/media/capture/video/chromeos/OWNERS
@@ -1,3 +1,5 @@ jcliang@chromium.org +kamesan@chromium.org +pihsun@chromium.org shik@chromium.org wtlee@chromium.org
diff --git a/media/cast/BUILD.gn b/media/cast/BUILD.gn index f28efc6..088b9dd 100644 --- a/media/cast/BUILD.gn +++ b/media/cast/BUILD.gn
@@ -133,6 +133,8 @@ sources = [ "encoding/audio_encoder.cc", "encoding/audio_encoder.h", + "encoding/encoding_support.cc", + "encoding/encoding_support.h", "encoding/external_video_encoder.cc", "encoding/external_video_encoder.h", "encoding/fake_software_video_encoder.cc", @@ -341,6 +343,7 @@ "common/expanded_value_base_unittest.cc", "common/openscreen_conversion_helpers_unittest.cc", "encoding/audio_encoder_unittest.cc", + "encoding/encoding_support_unittest.cc", "encoding/external_video_encoder_unittest.cc", "encoding/video_encoder_unittest.cc", "encoding/vpx_quantizer_parser_unittest.cc",
diff --git a/media/cast/cast_config.h b/media/cast/cast_config.h index c1fa0df3d..13b4533c9 100644 --- a/media/cast/cast_config.h +++ b/media/cast/cast_config.h
@@ -173,8 +173,9 @@ RtpPayloadType rtp_payload_type = RtpPayloadType::UNKNOWN; // If true, use an external HW encoder rather than the built-in - // software-based one. - bool use_external_encoder = false; + // software-based one. Note that this may be the ExternalVideoEncoder or + // the H264VideoToolboxEncoder as appropriate. + bool use_hardware_encoder = false; // RTP timebase: The number of RTP units advanced per one second. For audio, // this is the sampling rate. For video, by convention, this is 90 kHz.
diff --git a/media/cast/cast_sender_impl.cc b/media/cast/cast_sender_impl.cc index 4145339..f8a9c4bf 100644 --- a/media/cast/cast_sender_impl.cc +++ b/media/cast/cast_sender_impl.cc
@@ -108,7 +108,7 @@ const FrameSenderConfig& audio_config, StatusChangeOnceCallback status_change_cb) { DCHECK(cast_environment_->CurrentlyOn(CastEnvironment::MAIN)); - CHECK(audio_config.use_external_encoder || + CHECK(audio_config.use_hardware_encoder || cast_environment_->HasAudioThread()); VLOG(1) << "CastSenderImpl@" << this << "::InitializeAudio()";
diff --git a/media/cast/encoding/encoding_support.cc b/media/cast/encoding/encoding_support.cc new file mode 100644 index 0000000..b21f1239 --- /dev/null +++ b/media/cast/encoding/encoding_support.cc
@@ -0,0 +1,146 @@ +// Copyright 2022 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "media/cast/encoding/external_video_encoder.h" + +#if DCHECK_IS_ON() +#include <ios> +#endif + +#if BUILDFLAG(IS_CHROMEOS) +#include "base/cpu.h" // nogncheck +#include "base/no_destructor.h" // nogncheck +#endif + +#include "base/command_line.h" +#include "build/build_config.h" +#include "media/base/media_switches.h" +#include "third_party/libaom/libaom_buildflags.h" + +namespace media::cast::encoding_support { +namespace { + +bool IsCastStreamingAv1Enabled() { +#if BUILDFLAG(ENABLE_LIBAOM) + return base::FeatureList::IsEnabled(kCastStreamingAv1); +#else + return false; +#endif +} + +bool IsHardwareEncodingEnabled( + const std::vector<VideoEncodeAccelerator::SupportedProfile>& profiles, + VideoCodecProfile min_profile, + VideoCodecProfile max_profile, + bool is_enabled_on_platform, + bool is_force_enabled) { + // Check if it's enabled on this platform ("default" behavior) or if it is + // force enabled. + const bool should_query = is_enabled_on_platform || is_force_enabled; + if (should_query) { + for (const auto& vea_profile : profiles) { + if (vea_profile.profile >= min_profile && + vea_profile.profile <= max_profile) { + return true; + } + } + } + return false; +} + +// Scan profiles for hardware VP8 encoder support. +bool IsHardwareVP8EncodingEnabled( + const std::vector<VideoEncodeAccelerator::SupportedProfile>& profiles) { + const base::CommandLine& command_line = + *base::CommandLine::ForCurrentProcess(); + if (command_line.HasSwitch(switches::kCastStreamingForceDisableHardwareVp8)) { + return false; + } + + // The hardware encoder on ChromeOS has major issues when connecting to a + // variety of first and third party devices. See https://crbug.com/1382591. + const bool is_enabled_on_platform = !BUILDFLAG(IS_CHROMEOS); + const bool is_force_enabled = + command_line.HasSwitch(switches::kCastStreamingForceEnableHardwareVp8); + + return IsHardwareEncodingEnabled(profiles, VP8PROFILE_MIN, VP8PROFILE_MAX, + is_enabled_on_platform, is_force_enabled); +} + +// Scan profiles for hardware H.264 encoder support. +bool IsHardwareH264EncodingEnabled( + const std::vector<VideoEncodeAccelerator::SupportedProfile>& profiles) { + const base::CommandLine& command_line = + *base::CommandLine::ForCurrentProcess(); + if (command_line.HasSwitch( + switches::kCastStreamingForceDisableHardwareH264)) { + return false; + } + + // TODO(crbug.com/1015482): hardware encoder broken on Windows, Apple OSes. + bool is_enabled_on_platform = !BUILDFLAG(IS_APPLE) && !BUILDFLAG(IS_WIN); + +// TODO(b/169533953): hardware encoder broken on AMD chipsets on ChromeOS. +#if BUILDFLAG(IS_CHROMEOS) + static const base::NoDestructor<base::CPU> cpuid; + static const bool is_amd = cpuid->vendor_name() == "AuthenticAMD"; + if (is_amd) { + is_enabled_on_platform = false; + } +#endif // BUILDFLAG(IS_CHROMEOS) + + const bool is_force_enabled = + command_line.HasSwitch(switches::kCastStreamingForceEnableHardwareH264); + + return IsHardwareEncodingEnabled(profiles, H264PROFILE_MIN, H264PROFILE_MAX, + is_enabled_on_platform, is_force_enabled); +} + +} // namespace + +bool IsSoftwareEnabled(Codec codec) { +// As written, iOS only supports the VideoToolbox H264 encoder. +// +// TODO(https://crbug.com/1383572): media/cast should more clearly delineate +// intended behavior for iOS. +#if BUILDFLAG(IS_IOS) + return false; +#else + switch (codec) { + case CODEC_VIDEO_VP8: + return true; + + case CODEC_VIDEO_VP9: + return base::FeatureList::IsEnabled(kCastStreamingVp9); + + case CODEC_VIDEO_AV1: + return IsCastStreamingAv1Enabled(); + + // The test infrastructure is responsible for ensuring the fake codec is + // used properly. + case CODEC_VIDEO_FAKE: + return true; + + default: + return false; + } +#endif +} + +bool IsHardwareEnabled( + Codec codec, + const std::vector<VideoEncodeAccelerator::SupportedProfile>& profiles) { + switch (codec) { + case CODEC_VIDEO_VP8: + return IsHardwareVP8EncodingEnabled(profiles); + + case CODEC_VIDEO_H264: + return IsHardwareH264EncodingEnabled(profiles); + + default: + return false; + } +} + +} // namespace media::cast::encoding_support
diff --git a/media/cast/encoding/encoding_support.h b/media/cast/encoding/encoding_support.h new file mode 100644 index 0000000..e15aa28 --- /dev/null +++ b/media/cast/encoding/encoding_support.h
@@ -0,0 +1,33 @@ +// Copyright 2022 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef MEDIA_CAST_ENCODING_ENCODING_SUPPORT_H_ +#define MEDIA_CAST_ENCODING_ENCODING_SUPPORT_H_ + +#include <vector> + +#include "media/cast/cast_config.h" +#include "media/video/video_encode_accelerator.h" + +// This namespace includes free functions that determine if software and +// hardware encoding is available and should be used for different codecs. Note +// that these methods also check the current configuration of the +// kCastStreaming* feature flags in //media/base/media_switches.h. +namespace media::cast::encoding_support { + +// Returns true if software encoding is supported for this codec. +bool IsSoftwareEnabled(Codec codec); + +// Returns true if a hardware encoder should be used for a codec with a +// given receiver and set of VEA profiles. Some receivers have implementation +// bugs that keep the external encoder from being used even if it is supported +// by the sender. +bool IsHardwareEnabled( + Codec codec, + const std::vector<media::VideoEncodeAccelerator::SupportedProfile>& + profiles); + +} // namespace media::cast::encoding_support + +#endif // MEDIA_CAST_ENCODING_ENCODING_SUPPORT_H_
diff --git a/media/cast/encoding/encoding_support_unittest.cc b/media/cast/encoding/encoding_support_unittest.cc new file mode 100644 index 0000000..eb09826 --- /dev/null +++ b/media/cast/encoding/encoding_support_unittest.cc
@@ -0,0 +1,69 @@ +// Copyright 2022 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "media/cast/encoding/encoding_support.h" + +#include <stdint.h> + +#include "base/no_destructor.h" +#include "build/build_config.h" +#include "testing/gtest/include/gtest/gtest.h" + +#if BUILDFLAG(IS_CHROMEOS) +#include "base/cpu.h" // nogncheck +#endif + +namespace media::cast::encoding_support { +namespace { + +std::vector<media::VideoEncodeAccelerator::SupportedProfile> +GetValidProfiles() { + static const base::NoDestructor< + std::vector<media::VideoEncodeAccelerator::SupportedProfile>> + kValidProfiles({ + VideoEncodeAccelerator::SupportedProfile(media::VP8PROFILE_MIN, + gfx::Size(1920, 1080)), + VideoEncodeAccelerator::SupportedProfile(media::H264PROFILE_MIN, + gfx::Size(1920, 1080)), + }); + + return *kValidProfiles; +} + +} // namespace + +TEST(EncodingSupportTest, EnablesVp8HardwareEncoderProperly) { + constexpr bool is_enabled = +#if BUILDFLAG(IS_CHROMEOS) + false; +#else + true; +#endif + + EXPECT_EQ(is_enabled, IsHardwareEnabled(CODEC_VIDEO_VP8, GetValidProfiles())); +} + +TEST(EncodingSupportTest, EnablesH264HardwareEncoderProperly) { +#if BUILDFLAG(IS_CHROMEOS) + static const base::NoDestructor<base::CPU> cpuid; + static const bool is_amd = cpuid->vendor_name() == "AuthenticAMD"; +#endif + + static const bool is_enabled = +// On ChromeOS only, disable hardware encoder on AMD chipsets due to +// failure on Chromecast chipsets to decode. +#if BUILDFLAG(IS_CHROMEOS) + !is_amd; +// The hardware encoder also has major issues on Mac OSX and on Windows. +#elif BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_WIN) + false; +#else + true; +#endif + + EXPECT_EQ(is_enabled, + IsHardwareEnabled(CODEC_VIDEO_H264, GetValidProfiles())); +} + +} // namespace media::cast::encoding_support
diff --git a/media/cast/encoding/external_video_encoder.cc b/media/cast/encoding/external_video_encoder.cc index 0c6667ce..7994f36 100644 --- a/media/cast/encoding/external_video_encoder.cc +++ b/media/cast/encoding/external_video_encoder.cc
@@ -10,11 +10,6 @@ #include <sstream> #include <utility> -#if BUILDFLAG(IS_CHROMEOS) -#include "base/cpu.h" // nogncheck -#include "base/no_destructor.h" // nogncheck -#endif - #include "base/bind.h" #include "base/callback_helpers.h" #include "base/command_line.h" @@ -70,52 +65,6 @@ // histograms must encompass the range [-255, 255] (inclusive). constexpr int kQuantizationHistogramSize = 511; -// Scan profiles for hardware VP8 encoder support. -bool IsHardwareVP8EncodingSupported( - base::StringPiece receiver_model_name, - const std::vector<media::VideoEncodeAccelerator::SupportedProfile>& - profiles) { -// The hardware encoder on ChromeOS has major issues when connecting to a -// variety of first and third party devices. See https://crbug.com/1382591. -#if !BUILDFLAG(IS_CHROMEOS) - for (const auto& vea_profile : profiles) { - if (vea_profile.profile >= media::VP8PROFILE_MIN && - vea_profile.profile <= media::VP8PROFILE_MAX) { - return true; - } - } -#endif - - return false; -} // namespace - -// Scan profiles for hardware H.264 encoder support. -bool IsHardwareH264EncodingSupported( - const std::vector<media::VideoEncodeAccelerator::SupportedProfile>& - profiles) { -// TODO(b/169533953): Look into chromecast fails to decode bitstreams produced -// by the AMD HW encoder. -#if BUILDFLAG(IS_CHROMEOS) - static const base::NoDestructor<base::CPU> cpuid; - static const bool is_amd = cpuid->vendor_name() == "AuthenticAMD"; - if (is_amd) - return false; -#endif // BUILDFLAG(IS_CHROMEOS) - -// TODO(crbug.com/1015482): Look into why H.264 hardware encoder on MacOS is -// broken. -// TODO(crbug.com/1015482): Look into HW encoder initialization issues on Win. -#if !BUILDFLAG(IS_APPLE) && !BUILDFLAG(IS_WIN) - for (const auto& vea_profile : profiles) { - if (vea_profile.profile >= media::H264PROFILE_MIN && - vea_profile.profile <= media::H264PROFILE_MAX) { - return true; - } - } -#endif // !BUILDFLAG(IS_APPLE) && !BUILDFLAG(IS_WIN) - return false; -} - } // namespace namespace media::cast { @@ -674,31 +623,6 @@ bool allocate_input_buffer_in_progress_; }; -// static -bool ExternalVideoEncoder::IsSupported(const FrameSenderConfig& video_config) { - if (video_config.codec != CODEC_VIDEO_VP8 && - video_config.codec != CODEC_VIDEO_H264) - return false; - - // We assume that the system provides a hardware encoder at this point. - return video_config.use_external_encoder; -} - -// static -bool ExternalVideoEncoder::IsRecommended( - Codec codec, - base::StringPiece receiver_model_name, - const std::vector<media::VideoEncodeAccelerator::SupportedProfile>& - profiles) { - if (codec == CODEC_VIDEO_VP8) - return IsHardwareVP8EncodingSupported(receiver_model_name, profiles); - - if (codec == CODEC_VIDEO_H264) - return IsHardwareH264EncodingSupported(profiles); - - return false; -} - ExternalVideoEncoder::ExternalVideoEncoder( const scoped_refptr<CastEnvironment>& cast_environment, const FrameSenderConfig& video_config,
diff --git a/media/cast/encoding/external_video_encoder_unittest.cc b/media/cast/encoding/external_video_encoder_unittest.cc index 3f5070c..c209a92 100644 --- a/media/cast/encoding/external_video_encoder_unittest.cc +++ b/media/cast/encoding/external_video_encoder_unittest.cc
@@ -8,13 +8,8 @@ #include "build/build_config.h" #include "media/base/video_frame.h" -#include "media/base/video_types.h" #include "testing/gtest/include/gtest/gtest.h" -#if BUILDFLAG(IS_CHROMEOS) -#include "base/cpu.h" // nogncheck -#endif - namespace media::cast { namespace { @@ -31,17 +26,6 @@ return result; } -static const std::vector<media::VideoEncodeAccelerator::SupportedProfile> - kValidVeaProfiles{ - VideoEncodeAccelerator::SupportedProfile(media::VP8PROFILE_MIN, - gfx::Size(1920, 1080)), - VideoEncodeAccelerator::SupportedProfile(media::H264PROFILE_MIN, - gfx::Size(1920, 1080)), - }; - -constexpr std::array<const char*, 3> kFirstPartyModelNames{ - {"Chromecast", "Eureka Dongle", "Chromecast Ultra"}}; - } // namespace TEST(QuantizerEstimatorTest, EstimatesForTrivialFrames) { @@ -91,68 +75,4 @@ } } -// The decoder on Vizio TVs doesn't play well with Chrome OS hardware encoders. -// See https://crbug.com/1238774 for more context. -TEST(ExternalVideoEncoderTest, - DoesntRecommendExternalVp8EncoderForVizioOnChromeOS) { - constexpr std::array<const char*, 10> kVizioTvModelNames{ - {"e43u-d2", "e60-e3", "OLED55-H1", "M50-D1", "E65-F1", "E50-F2", "M55-D0", - "Vizio P-Series Quantum 4K", "M55-E0", "V435-H1"}}; - - for (const char* model_name : kVizioTvModelNames) { - constexpr bool should_recommend = -#if BUILDFLAG(IS_CHROMEOS) - false; -#else - true; -#endif - EXPECT_EQ(should_recommend, - ExternalVideoEncoder::IsRecommended( - CODEC_VIDEO_VP8, std::string(model_name), kValidVeaProfiles)) - << model_name; - } -} - -TEST(ExternalVideoEncoderTest, RecommendsExternalVp8EncoderForChromecast) { -#if BUILDFLAG(IS_CHROMEOS) - EXPECT_FALSE(ExternalVideoEncoder::IsRecommended( - CODEC_VIDEO_VP8, "Eureka Dongle", kValidVeaProfiles)); - EXPECT_FALSE(ExternalVideoEncoder::IsRecommended( - CODEC_VIDEO_VP8, "Chromecast", kValidVeaProfiles)); - EXPECT_FALSE(ExternalVideoEncoder::IsRecommended( - CODEC_VIDEO_VP8, "Chromecast Ultra", kValidVeaProfiles)); - EXPECT_FALSE(ExternalVideoEncoder::IsRecommended( - CODEC_VIDEO_VP8, "Google Home", kValidVeaProfiles)); -#else - for (const char* model_name : kFirstPartyModelNames) { - EXPECT_TRUE(ExternalVideoEncoder::IsRecommended( - CODEC_VIDEO_VP8, std::string(model_name), kValidVeaProfiles)); - } -#endif -} - -TEST(ExternalVideoEncoderTest, RecommendsH264HardwareEncoderProperly) { - for (const char* model_name : kFirstPartyModelNames) { -// On ChromeOS only, disable hardware encoder on AMD chipsets due to -// failure on Chromecast chipsets to decode. -#if BUILDFLAG(IS_CHROMEOS) - if (base::CPU().vendor_name() == "AuthenticAMD") { - EXPECT_FALSE(ExternalVideoEncoder::IsRecommended( - CODEC_VIDEO_H264, std::string(model_name), kValidVeaProfiles)); - break; - } -#endif - - constexpr bool should_recommend = -#if !BUILDFLAG(IS_APPLE) && !BUILDFLAG(IS_WIN) - true; -#else - false; -#endif - EXPECT_EQ(should_recommend, ExternalVideoEncoder::IsRecommended( - CODEC_VIDEO_H264, std::string(model_name), - kValidVeaProfiles)); - } -} - } // namespace media::cast
diff --git a/media/cast/encoding/video_encoder.cc b/media/cast/encoding/video_encoder.cc index 71d05fd..787d1d6 100644 --- a/media/cast/encoding/video_encoder.cc +++ b/media/cast/encoding/video_encoder.cc
@@ -6,6 +6,7 @@ #include "base/memory/ptr_util.h" #include "build/build_config.h" +#include "media/cast/encoding/encoding_support.h" #include "media/cast/encoding/external_video_encoder.h" #include "media/cast/encoding/video_encoder_impl.h" @@ -13,8 +14,7 @@ #include "media/cast/encoding/h264_vt_encoder.h" #endif -namespace media { -namespace cast { +namespace media::cast { // static std::unique_ptr<VideoEncoder> VideoEncoder::Create( @@ -22,32 +22,37 @@ const FrameSenderConfig& video_config, StatusChangeCallback status_change_cb, const CreateVideoEncodeAcceleratorCallback& create_vea_cb) { -// On MacOS or IOS, attempt to use the system VideoToolbox library to +// On MacOS and iOS: attempt to use the system VideoToolbox library to // perform optimized H.264 encoding. -#if BUILDFLAG(IS_MAC) - if (H264VideoToolboxEncoder::IsSupported(video_config)) { +// +// TODO(https://crbug.com/1015482): currently we don't check the toolbox encoder +// due to hardware encoding being disabled on Apple platforms. +#if BUILDFLAG(IS_APPLE) + if (video_config.use_hardware_encoder && + H264VideoToolboxEncoder::IsSupported(video_config)) { return base::WrapUnique<VideoEncoder>(new H264VideoToolboxEncoder( cast_environment, video_config, status_change_cb)); } -#endif // BUILDFLAG(IS_MAC) +#endif // BUILDFLAG(IS_APPLE) #if !BUILDFLAG(IS_IOS) // If the system provides a hardware-accelerated encoder, use it. - if (ExternalVideoEncoder::IsSupported(video_config)) { + if (video_config.use_hardware_encoder) { return base::WrapUnique<VideoEncoder>(new SizeAdaptableExternalVideoEncoder( cast_environment, video_config, std::move(status_change_cb), create_vea_cb)); } - // Attempt to use the software encoder implementation. - if (VideoEncoderImpl::IsSupported(video_config)) { - return base::WrapUnique<VideoEncoder>( - new VideoEncoderImpl(cast_environment, video_config, status_change_cb)); - } -#endif // !BUILDFLAG(IS_IOS) + // Otherwise we must have a software configuration. + DCHECK(encoding_support::IsSoftwareEnabled(video_config.codec)); + return base::WrapUnique<VideoEncoder>( + new VideoEncoderImpl(cast_environment, video_config, status_change_cb)); - // No encoder implementation will suffice. +#else + // We currently only support the VideoToolbox library on iOS, so no other + // encoder is available. return nullptr; +#endif } std::unique_ptr<VideoFrameFactory> VideoEncoder::CreateVideoFrameFactory() { @@ -56,5 +61,4 @@ void VideoEncoder::EmitFrames() {} -} // namespace cast -} // namespace media +} // namespace media::cast
diff --git a/media/cast/encoding/video_encoder_impl.cc b/media/cast/encoding/video_encoder_impl.cc index 5a4f685..f3662e3 100644 --- a/media/cast/encoding/video_encoder_impl.cc +++ b/media/cast/encoding/video_encoder_impl.cc
@@ -53,15 +53,6 @@ } } // namespace -// static -bool VideoEncoderImpl::IsSupported(const FrameSenderConfig& video_config) { - return video_config.codec == CODEC_VIDEO_VP8 || - video_config.codec == CODEC_VIDEO_VP9 || - video_config.codec == CODEC_VIDEO_AV1 || - (video_config.enable_fake_codec_for_tests && - video_config.codec == CODEC_VIDEO_FAKE); -} - VideoEncoderImpl::VideoEncoderImpl( scoped_refptr<CastEnvironment> cast_environment, const FrameSenderConfig& video_config,
diff --git a/media/cast/encoding/video_encoder_unittest.cc b/media/cast/encoding/video_encoder_unittest.cc index 3b5e983..1f4370a 100644 --- a/media/cast/encoding/video_encoder_unittest.cc +++ b/media/cast/encoding/video_encoder_unittest.cc
@@ -67,8 +67,9 @@ video_config_.enable_fake_codec_for_tests = true; video_config_.codec = codec; - video_config_.use_external_encoder = GetParam().second; - if (video_config_.use_external_encoder) { + video_config_.use_hardware_encoder = GetParam().second; + + if (is_testing_external_video_encoder()) { vea_factory_ = std::make_unique<FakeVideoEncodeAcceleratorFactory>(task_runner_); } @@ -98,25 +99,21 @@ bool is_testing_software_vp8_encoder() const { return video_config_.codec == CODEC_VIDEO_VP8 && - !video_config_.use_external_encoder; + !video_config_.use_hardware_encoder; } bool is_testing_video_toolbox_encoder() const { return #if BUILDFLAG(IS_MAC) - (!video_config_.use_external_encoder && + (video_config_.use_hardware_encoder && H264VideoToolboxEncoder::IsSupported(video_config_)) || #endif false; } - bool is_testing_platform_encoder() const { - return video_config_.use_external_encoder || - is_testing_video_toolbox_encoder(); - } - - bool encoder_has_resize_delay() const { - return is_testing_platform_encoder() && !is_testing_video_toolbox_encoder(); + bool is_testing_external_video_encoder() const { + return video_config_.use_hardware_encoder && + !is_testing_video_toolbox_encoder(); } VideoEncoder* video_encoder() const { return video_encoder_.get(); } @@ -271,7 +268,7 @@ if (accepted_request) { ++count_frames_accepted; } - if (!encoder_has_resize_delay()) { + if (!is_testing_external_video_encoder()) { EXPECT_TRUE(accepted_request); } RunTasksAndAdvanceClock(); @@ -351,18 +348,22 @@ std::vector<std::pair<Codec, bool>> DetermineEncodersToTest() { std::vector<std::pair<Codec, bool>> values; // Fake encoder. - values.push_back(std::make_pair(CODEC_VIDEO_FAKE, false)); + values.emplace_back(CODEC_VIDEO_FAKE, false); + // Software VP8 encoder. - values.push_back(std::make_pair(CODEC_VIDEO_VP8, false)); + values.emplace_back(CODEC_VIDEO_VP8, false); + // Hardware-accelerated encoder (faked). - values.push_back(std::make_pair(CODEC_VIDEO_VP8, true)); + values.emplace_back(CODEC_VIDEO_VP8, true); + #if BUILDFLAG(IS_MAC) // VideoToolbox encoder (when VideoToolbox is present). FrameSenderConfig video_config = GetDefaultVideoSenderConfig(); - video_config.use_external_encoder = false; + video_config.use_hardware_encoder = true; video_config.codec = CODEC_VIDEO_H264; - if (H264VideoToolboxEncoder::IsSupported(video_config)) - values.push_back(std::make_pair(CODEC_VIDEO_H264, false)); + if (H264VideoToolboxEncoder::IsSupported(video_config)) { + values.emplace_back(CODEC_VIDEO_H264, true); + } #endif return values; }
diff --git a/media/cast/encoding/vpx_quantizer_parser_unittest.cc b/media/cast/encoding/vpx_quantizer_parser_unittest.cc index e8accbb..4589765 100644 --- a/media/cast/encoding/vpx_quantizer_parser_unittest.cc +++ b/media/cast/encoding/vpx_quantizer_parser_unittest.cc
@@ -30,7 +30,7 @@ FrameSenderConfig GetVideoConfigForTest() { FrameSenderConfig config = GetDefaultVideoSenderConfig(); config.codec = CODEC_VIDEO_VP8; - config.use_external_encoder = false; + config.use_hardware_encoder = false; config.max_frame_rate = kFrameRate; config.video_codec_params.min_qp = kQp; config.video_codec_params.max_qp = kQp;
diff --git a/media/cast/sender/audio_sender.cc b/media/cast/sender/audio_sender.cc index 89ab257..e04b4b5 100644 --- a/media/cast/sender/audio_sender.cc +++ b/media/cast/sender/audio_sender.cc
@@ -54,7 +54,7 @@ : cast_environment_(cast_environment), rtp_timebase_(audio_config.rtp_timebase), frame_sender_(std::move(sender)) { - if (!audio_config.use_external_encoder) { + if (!audio_config.use_hardware_encoder) { audio_encoder_ = std::make_unique<AudioEncoder>( std::move(cast_environment), audio_config.channels, rtp_timebase_, audio_config.max_bitrate, audio_config.codec,
diff --git a/media/cast/sender/audio_sender_unittest.cc b/media/cast/sender/audio_sender_unittest.cc index f646bd51..551c0b1a 100644 --- a/media/cast/sender/audio_sender_unittest.cc +++ b/media/cast/sender/audio_sender_unittest.cc
@@ -101,7 +101,7 @@ cast_environment_ = new CastEnvironment(&testing_clock_, task_runner_, task_runner_, task_runner_); audio_config_.codec = CODEC_AUDIO_OPUS; - audio_config_.use_external_encoder = false; + audio_config_.use_hardware_encoder = false; audio_config_.rtp_timebase = kDefaultAudioSamplingRate; audio_config_.channels = 2; audio_config_.max_bitrate = kDefaultAudioEncoderBitrate;
diff --git a/media/cast/sender/frame_sender_impl.cc b/media/cast/sender/frame_sender_impl.cc index 93b2819..97c8518e 100644 --- a/media/cast/sender/frame_sender_impl.cc +++ b/media/cast/sender/frame_sender_impl.cc
@@ -86,7 +86,7 @@ is_audio_(config.rtp_payload_type <= RtpPayloadType::AUDIO_LAST), // We only use the adaptive control for software video encoding. congestion_control_( - (!config.use_external_encoder && !is_audio_) + (!config.use_hardware_encoder && !is_audio_) ? NewAdaptiveCongestionControl(cast_environment->Clock(), config.max_bitrate, config.min_bitrate,
diff --git a/media/cast/sender/video_sender_unittest.cc b/media/cast/sender/video_sender_unittest.cc index 991b0210..2c3c845 100644 --- a/media/cast/sender/video_sender_unittest.cc +++ b/media/cast/sender/video_sender_unittest.cc
@@ -193,7 +193,7 @@ // |expect_init_success| is true if initialization is expected to succeed. void InitEncoder(bool external, bool expect_init_success) { FrameSenderConfig video_config = GetDefaultVideoSenderConfig(); - video_config.use_external_encoder = external; + video_config.use_hardware_encoder = external; ASSERT_EQ(operational_status_, STATUS_UNINITIALIZED);
diff --git a/media/cast/test/end2end_unittest.cc b/media/cast/test/end2end_unittest.cc index 85625e5..7a84765ed 100644 --- a/media/cast/test/end2end_unittest.cc +++ b/media/cast/test/end2end_unittest.cc
@@ -424,7 +424,7 @@ audio_sender_config_.receiver_ssrc = 2; audio_sender_config_.max_playout_delay = kTargetPlayoutDelay; audio_sender_config_.rtp_payload_type = RtpPayloadType::AUDIO_OPUS; - audio_sender_config_.use_external_encoder = false; + audio_sender_config_.use_hardware_encoder = false; audio_sender_config_.rtp_timebase = kDefaultAudioSamplingRate; audio_sender_config_.channels = kAudioChannels; audio_sender_config_.max_bitrate = kDefaultAudioEncoderBitrate; @@ -457,7 +457,7 @@ video_sender_config_.receiver_ssrc = 4; video_sender_config_.max_playout_delay = kTargetPlayoutDelay; video_sender_config_.rtp_payload_type = RtpPayloadType::VIDEO_VP8; - video_sender_config_.use_external_encoder = false; + video_sender_config_.use_hardware_encoder = false; video_sender_config_.rtp_timebase = kVideoFrequency; video_sender_config_.max_bitrate = 50000; video_sender_config_.min_bitrate = 10000;
diff --git a/media/cast/test/utility/default_config.cc b/media/cast/test/utility/default_config.cc index 00edf4f8..ffb03ae1 100644 --- a/media/cast/test/utility/default_config.cc +++ b/media/cast/test/utility/default_config.cc
@@ -46,7 +46,7 @@ config.sender_ssrc = recv_config.sender_ssrc; config.receiver_ssrc = recv_config.receiver_ssrc; config.rtp_payload_type = recv_config.rtp_payload_type; - config.use_external_encoder = false; + config.use_hardware_encoder = false; config.rtp_timebase = recv_config.rtp_timebase; config.channels = recv_config.channels; config.max_bitrate = config.min_bitrate = config.start_bitrate = @@ -62,7 +62,7 @@ config.sender_ssrc = recv_config.sender_ssrc; config.receiver_ssrc = recv_config.receiver_ssrc; config.rtp_payload_type = recv_config.rtp_payload_type; - config.use_external_encoder = false; + config.use_hardware_encoder = false; config.rtp_timebase = recv_config.rtp_timebase; config.max_bitrate = kDefaultMaxVideoBitrate; config.min_bitrate = kDefaultMinVideoBitrate;
diff --git a/media/gpu/vaapi/vaapi_wrapper.cc b/media/gpu/vaapi/vaapi_wrapper.cc index 01751c0..83e0f6b 100644 --- a/media/gpu/vaapi/vaapi_wrapper.cc +++ b/media/gpu/vaapi/vaapi_wrapper.cc
@@ -626,24 +626,35 @@ &ProfileCodecMap::value_type::second); } -bool IsBlockedDriver(VaapiWrapper::CodecMode mode, VAProfile va_profile) { +bool IsBlockedDriver(VaapiWrapper::CodecMode mode, + VAProfile va_profile, + const std::string& va_vendor_string) { if (!IsModeEncoding(mode)) { return va_profile == VAProfileAV1Profile0 && !base::FeatureList::IsEnabled(kChromeOSHWAV1Decoder); } - // TODO(posciak): Remove once VP8 encoding is to be enabled by default. if (va_profile == VAProfileVP8Version0_3 && !base::FeatureList::IsEnabled(kVaapiVP8Encoder)) { return true; } - // TODO(crbug.com/811912): Remove once VP9 encoding is enabled by default. if (va_profile == VAProfileVP9Profile0 && !base::FeatureList::IsEnabled(kVaapiVP9Encoder)) { return true; } + if (mode == VaapiWrapper::CodecMode::kEncodeVariableBitrate) { + // The rate controller on grunt is not good enough to support VBR encoding, + // b/253988139. + const bool is_amd_stoney_ridge_driver = + va_vendor_string.find("STONEY") != std::string::npos; + if (!base::FeatureList::IsEnabled(kChromeOSHWVBREncoding) || + is_amd_stoney_ridge_driver) { + return true; + } + } + return false; } @@ -665,6 +676,7 @@ base::Lock* va_lock() { return &va_lock_; } VADisplay va_display() const { return va_display_; } VAImplementation implementation_type() const { return implementation_type_; } + const std::string& vendor_string() const { return va_vendor_string_; } void SetDrmFd(base::PlatformFile fd) { drm_fd_.reset(HANDLE_EINTR(dup(fd))); } @@ -698,6 +710,9 @@ // Enumerated version of vaQueryVendorString(). Valid after Initialize(). VAImplementation implementation_type_ = VAImplementation::kInvalid; + + // String representing a driver acquired by vaQueryVendorString(). + std::string va_vendor_string_; }; // static @@ -842,12 +857,12 @@ VLOGF(1) << "vaInitialize failed: " << vaErrorStr(va_res); return false; } - const std::string va_vendor_string = vaQueryVendorString(va_display_); - DLOG_IF(WARNING, va_vendor_string.empty()) + va_vendor_string_ = vaQueryVendorString(va_display_); + DLOG_IF(WARNING, va_vendor_string_.empty()) << "Vendor string empty or error reading."; DVLOG(1) << "VAAPI version: " << major_version << "." << minor_version << " " - << va_vendor_string; - implementation_type_ = VendorStringToImplementationType(va_vendor_string); + << va_vendor_string_; + implementation_type_ = VendorStringToImplementationType(va_vendor_string_); va_initialized_ = true; @@ -1131,7 +1146,9 @@ ~VASupportedProfiles() = default; // Fills in |supported_profiles_|. - void FillSupportedProfileInfos(base::Lock* va_lock, VADisplay va_display); + void FillSupportedProfileInfos(base::Lock* va_lock, + VADisplay va_display, + const std::string& va_vendor_string); // Fills |profile_info| for |va_profile| and |entrypoint| with // |required_attribs|. If the return value is true, the operation was @@ -1188,14 +1205,17 @@ va_lock = nullptr; } - FillSupportedProfileInfos(va_lock, va_display); + FillSupportedProfileInfos(va_lock, va_display, + display_state->vendor_string()); const VAStatus va_res = display_state->Deinitialize(); VA_LOG_ON_ERROR(va_res, VaapiFunctions::kVATerminate); } -void VASupportedProfiles::FillSupportedProfileInfos(base::Lock* va_lock, - VADisplay va_display) { +void VASupportedProfiles::FillSupportedProfileInfos( + base::Lock* va_lock, + VADisplay va_display, + const std::string& va_vendor_string) { base::AutoLockMaybe auto_lock(va_lock); const std::vector<VAProfile> va_profiles = @@ -1217,7 +1237,7 @@ std::vector<ProfileInfo> supported_profile_infos; for (const auto& va_profile : va_profiles) { - if (IsBlockedDriver(mode, va_profile)) + if (IsBlockedDriver(mode, va_profile, va_vendor_string)) continue; if ((mode != VaapiWrapper::kVideoProcess) && @@ -1582,9 +1602,6 @@ } bool IsVBREncodingSupported(VAProfile va_profile) { - if (!base::FeatureList::IsEnabled(kChromeOSHWVBREncoding)) - return false; - auto mode = VaapiWrapper::CodecMode::kCodecModeMax; switch (va_profile) { case VAProfileH264ConstrainedBaseline:
diff --git a/media/gpu/windows/media_foundation_video_encode_accelerator_win.cc b/media/gpu/windows/media_foundation_video_encode_accelerator_win.cc index facce31b9..8090c4d0 100644 --- a/media/gpu/windows/media_foundation_video_encode_accelerator_win.cc +++ b/media/gpu/windows/media_foundation_video_encode_accelerator_win.cc
@@ -210,7 +210,6 @@ if (!compatible_with_win7 && base::win::GetVersion() < base::win::Version::WIN8) { - DVLOG(ERROR) << "Windows versions earlier than 8 are not supported."; return 0; } @@ -220,13 +219,13 @@ && codec != VideoCodec::kHEVC #endif // BUILDFLAG(ENABLE_PLATFORM_HEVC) ) { - DVLOG(ERROR) << "Enumerating unsupported hardware encoders."; + DLOG(ERROR) << "Enumerating unsupported hardware encoders."; return 0; } for (const wchar_t* mfdll : kMediaFoundationVideoEncoderDLLs) { if (!::GetModuleHandle(mfdll)) { - DVLOG(ERROR) << mfdll << " is required for encoding"; + DLOG(ERROR) << mfdll << " is required for encoding"; return 0; } } @@ -245,10 +244,11 @@ uint32_t count = 0; HRESULT hr = MFTEnumEx(MFT_CATEGORY_VIDEO_ENCODER, flags, &input_info, &output_info, pp_activate, &count); - RETURN_ON_HR_FAILURE(hr, "Couldn't enumerate hardware encoder from MFTEnumEx", - 0); - RETURN_ON_FAILURE((count > 0), "No asynchronous MFT encoder found", 0); - DVLOG(3) << "Hardware encoder(s) available found from MFTEnumEx: " << count; + if (FAILED(hr)) { + DLOG(ERROR) << "Failed to enumerate hardware encoders for " + << GetCodecName(codec) + << ", hr=" << logging::SystemErrorCodeToString(hr); + } return count; } @@ -393,7 +393,8 @@ EnumerateHardwareEncoders(codec, &pp_activate, compatible_with_win7_); if (!encoder_count) { DVLOG(1) - << "Hardware encode acceleration is not available on this platform."; + << "Hardware encode acceleration is not available on this platform for " + << GetCodecName(codec); return profiles; }
diff --git a/services/network/OWNERS b/services/network/OWNERS index 03bf32b..641d203 100644 --- a/services/network/OWNERS +++ b/services/network/OWNERS
@@ -2,6 +2,7 @@ # in Network Service, please consider sharing the design idea/doc with # network-service-dev@chromium.org beforehand. +bashi@chromium.org cduvall@chromium.org ericorth@chromium.org jam@chromium.org
diff --git a/testing/buildbot/chromium.android.fyi.json b/testing/buildbot/chromium.android.fyi.json index f84ab193..8f7881f1 100644 --- a/testing/buildbot/chromium.android.fyi.json +++ b/testing/buildbot/chromium.android.fyi.json
@@ -31,10 +31,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "8", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "e2-standard-8|n2-standard-8", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -97,10 +97,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "8", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "e2-standard-8|n2-standard-8", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -172,10 +172,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "8", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "e2-standard-8|n2-standard-8", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -231,10 +231,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "4", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4|n2-standard-4", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -290,10 +290,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "4", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4|n2-standard-4", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -349,10 +349,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "4", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4|n2-standard-4", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -408,10 +408,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "4", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4|n2-standard-4", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -467,10 +467,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "4", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4|n2-standard-4", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -526,10 +526,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "4", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4|n2-standard-4", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -585,10 +585,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "4", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4|n2-standard-4", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -689,10 +689,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "8", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "e2-standard-8|n2-standard-8", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -748,10 +748,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "8", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "e2-standard-8|n2-standard-8", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -814,10 +814,10 @@ ], "dimension_sets": [ { + "cores": "8", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "e2-standard-8|n2-standard-8", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -883,10 +883,10 @@ ], "dimension_sets": [ { + "cores": "8", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "e2-standard-8|n2-standard-8", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -943,10 +943,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "8", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "e2-standard-8|n2-standard-8", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -1005,10 +1005,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "8", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "e2-standard-8|n2-standard-8", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -1065,10 +1065,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "8", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "e2-standard-8|n2-standard-8", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -1126,10 +1126,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "8", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "e2-standard-8|n2-standard-8", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -1191,10 +1191,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "8", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "e2-standard-8|n2-standard-8", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" }
diff --git a/testing/buildbot/chromium.android.json b/testing/buildbot/chromium.android.json index 970277ff..a2d795e 100644 --- a/testing/buildbot/chromium.android.json +++ b/testing/buildbot/chromium.android.json
@@ -8210,10 +8210,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "4", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4|n2-standard-4", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -8270,10 +8270,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "4", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4|n2-standard-4", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -8331,10 +8331,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "4", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4|n2-standard-4", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -8390,10 +8390,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "4", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4|n2-standard-4", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -8443,10 +8443,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "4", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4|n2-standard-4", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -8494,10 +8494,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "4", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4|n2-standard-4", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -8553,10 +8553,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "4", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4|n2-standard-4", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -8612,10 +8612,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "4", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4|n2-standard-4", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -8671,10 +8671,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "4", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4|n2-standard-4", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -8731,10 +8731,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "4", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4|n2-standard-4", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -8791,10 +8791,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "4", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4|n2-standard-4", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -8850,10 +8850,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "4", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4|n2-standard-4", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -8910,10 +8910,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "4", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4|n2-standard-4", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -8969,10 +8969,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "4", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4|n2-standard-4", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -9029,10 +9029,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "4", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4|n2-standard-4", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -9088,10 +9088,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "4", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4|n2-standard-4", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -9158,10 +9158,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "8", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "e2-standard-8|n2-standard-8", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -9227,10 +9227,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "4", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4|n2-standard-4", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -9292,10 +9292,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "4", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4|n2-standard-4", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -9352,10 +9352,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "4", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4|n2-standard-4", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -9413,10 +9413,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "4", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4|n2-standard-4", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -9475,10 +9475,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "8", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "e2-standard-8|n2-standard-8", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -9537,10 +9537,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "4", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4|n2-standard-4", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -9597,10 +9597,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "4", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4|n2-standard-4", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -9658,10 +9658,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "4", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4|n2-standard-4", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -9717,10 +9717,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "4", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4|n2-standard-4", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -9776,10 +9776,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "4", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4|n2-standard-4", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -9835,10 +9835,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "4", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4|n2-standard-4", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -9894,10 +9894,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "4", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4|n2-standard-4", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -9953,10 +9953,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "4", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4|n2-standard-4", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -10012,10 +10012,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "4", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4|n2-standard-4", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -10071,10 +10071,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "4", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4|n2-standard-4", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -10133,10 +10133,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "4", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4|n2-standard-4", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -10192,10 +10192,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "4", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4|n2-standard-4", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -10251,10 +10251,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "4", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4|n2-standard-4", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -10310,10 +10310,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "4", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4|n2-standard-4", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -10369,10 +10369,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "4", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4|n2-standard-4", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -10428,10 +10428,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "4", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4|n2-standard-4", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -10487,10 +10487,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "4", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4|n2-standard-4", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -10546,10 +10546,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "4", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4|n2-standard-4", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -10605,10 +10605,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "4", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4|n2-standard-4", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -10665,10 +10665,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "4", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4|n2-standard-4", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -10724,10 +10724,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "4", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4|n2-standard-4", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -10783,10 +10783,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "4", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4|n2-standard-4", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -10842,10 +10842,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "4", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4|n2-standard-4", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -10901,10 +10901,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "4", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4|n2-standard-4", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -10960,10 +10960,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "4", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4|n2-standard-4", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -11019,10 +11019,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "4", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4|n2-standard-4", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -11079,10 +11079,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "4", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4|n2-standard-4", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -11139,10 +11139,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "4", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4|n2-standard-4", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -11198,10 +11198,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "4", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4|n2-standard-4", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -11257,10 +11257,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "4", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4|n2-standard-4", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -11316,10 +11316,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "4", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4|n2-standard-4", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -11375,10 +11375,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "4", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4|n2-standard-4", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -11434,10 +11434,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "4", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4|n2-standard-4", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -11493,10 +11493,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "4", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4|n2-standard-4", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -11552,10 +11552,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "4", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4|n2-standard-4", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -11611,10 +11611,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "4", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4|n2-standard-4", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -11670,10 +11670,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "4", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4|n2-standard-4", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -11730,10 +11730,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "4", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4|n2-standard-4", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -11789,10 +11789,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "4", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4|n2-standard-4", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -11849,10 +11849,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "4", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4|n2-standard-4", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -11917,10 +11917,10 @@ ], "dimension_sets": [ { + "cores": "4", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4|n2-standard-4", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -11989,10 +11989,10 @@ ], "dimension_sets": [ { + "cores": "4", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4|n2-standard-4", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -12049,10 +12049,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "4", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4|n2-standard-4", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -12108,10 +12108,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "4", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4|n2-standard-4", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -12171,10 +12171,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "8", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "e2-standard-8|n2-standard-8", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -12231,10 +12231,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "8", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "e2-standard-8|n2-standard-8", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -12292,10 +12292,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "8", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "e2-standard-8|n2-standard-8", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -12352,10 +12352,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "8", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "e2-standard-8|n2-standard-8", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -12405,10 +12405,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "8", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "e2-standard-8|n2-standard-8", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -12457,10 +12457,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "8", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "e2-standard-8|n2-standard-8", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -12516,10 +12516,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "8", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "e2-standard-8|n2-standard-8", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -12575,10 +12575,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "8", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "e2-standard-8|n2-standard-8", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -12634,10 +12634,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "8", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "e2-standard-8|n2-standard-8", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -12694,10 +12694,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "8", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "e2-standard-8|n2-standard-8", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -12754,10 +12754,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "8", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "e2-standard-8|n2-standard-8", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -12813,10 +12813,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "8", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "e2-standard-8|n2-standard-8", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -12873,10 +12873,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "8", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "e2-standard-8|n2-standard-8", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -12932,10 +12932,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "8", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "e2-standard-8|n2-standard-8", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -12992,10 +12992,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "8", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "e2-standard-8|n2-standard-8", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -13051,10 +13051,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "8", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "e2-standard-8|n2-standard-8", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -13121,10 +13121,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "8", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "e2-standard-8|n2-standard-8", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -13190,10 +13190,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "8", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "e2-standard-8|n2-standard-8", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -13256,10 +13256,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "8", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "e2-standard-8|n2-standard-8", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -13316,10 +13316,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "8", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "e2-standard-8|n2-standard-8", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -13376,10 +13376,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "8", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "e2-standard-8|n2-standard-8", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -13437,10 +13437,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "8", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "e2-standard-8|n2-standard-8", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -13498,10 +13498,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "8", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "e2-standard-8|n2-standard-8", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -13558,10 +13558,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "8", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "e2-standard-8|n2-standard-8", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -13619,10 +13619,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "8", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "e2-standard-8|n2-standard-8", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -13678,10 +13678,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "8", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "e2-standard-8|n2-standard-8", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -13738,10 +13738,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "8", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "e2-standard-8|n2-standard-8", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -13797,10 +13797,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "8", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "e2-standard-8|n2-standard-8", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -13856,10 +13856,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "8", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "e2-standard-8|n2-standard-8", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -13915,10 +13915,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "8", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "e2-standard-8|n2-standard-8", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -13974,10 +13974,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "8", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "e2-standard-8|n2-standard-8", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -14033,10 +14033,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "8", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "e2-standard-8|n2-standard-8", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -14095,10 +14095,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "8", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "e2-standard-8|n2-standard-8", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -14155,10 +14155,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "8", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "e2-standard-8|n2-standard-8", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -14214,10 +14214,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "8", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "e2-standard-8|n2-standard-8", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -14273,10 +14273,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "8", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "e2-standard-8|n2-standard-8", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -14332,10 +14332,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "8", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "e2-standard-8|n2-standard-8", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -14391,10 +14391,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "8", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "e2-standard-8|n2-standard-8", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -14450,10 +14450,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "8", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "e2-standard-8|n2-standard-8", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -14509,10 +14509,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "8", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "e2-standard-8|n2-standard-8", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -14568,10 +14568,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "8", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "e2-standard-8|n2-standard-8", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -14628,10 +14628,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "8", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "e2-standard-8|n2-standard-8", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -14687,10 +14687,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "8", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "e2-standard-8|n2-standard-8", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -14746,10 +14746,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "8", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "e2-standard-8|n2-standard-8", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -14805,10 +14805,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "8", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "e2-standard-8|n2-standard-8", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -14864,10 +14864,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "8", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "e2-standard-8|n2-standard-8", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -14923,10 +14923,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "8", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "e2-standard-8|n2-standard-8", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -14982,10 +14982,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "8", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "e2-standard-8|n2-standard-8", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -15043,10 +15043,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "8", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "e2-standard-8|n2-standard-8", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -15103,10 +15103,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "8", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "e2-standard-8|n2-standard-8", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -15163,10 +15163,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "8", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "e2-standard-8|n2-standard-8", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -15222,10 +15222,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "8", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "e2-standard-8|n2-standard-8", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -15281,10 +15281,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "8", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "e2-standard-8|n2-standard-8", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -15340,10 +15340,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "8", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "e2-standard-8|n2-standard-8", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -15399,10 +15399,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "8", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "e2-standard-8|n2-standard-8", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -15458,10 +15458,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "8", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "e2-standard-8|n2-standard-8", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -15517,10 +15517,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "8", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "e2-standard-8|n2-standard-8", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -15576,10 +15576,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "8", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "e2-standard-8|n2-standard-8", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -15635,10 +15635,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "8", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "e2-standard-8|n2-standard-8", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -15694,10 +15694,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "8", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "e2-standard-8|n2-standard-8", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -15754,10 +15754,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "8", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "e2-standard-8|n2-standard-8", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -15813,10 +15813,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "8", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "e2-standard-8|n2-standard-8", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -15872,10 +15872,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "8", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "e2-standard-8|n2-standard-8", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -15940,10 +15940,10 @@ ], "dimension_sets": [ { + "cores": "8", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "e2-standard-8|n2-standard-8", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -16012,10 +16012,10 @@ ], "dimension_sets": [ { + "cores": "8", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "e2-standard-8|n2-standard-8", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -16072,10 +16072,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "8", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "e2-standard-8|n2-standard-8", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -16131,10 +16131,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "8", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "e2-standard-8|n2-standard-8", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -16190,10 +16190,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "8", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "e2-standard-8|n2-standard-8", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -16253,10 +16253,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "8", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "e2-standard-8|n2-standard-8", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -16312,10 +16312,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "8", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "e2-standard-8|n2-standard-8", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -16373,10 +16373,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "8", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "e2-standard-8|n2-standard-8", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -16432,10 +16432,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "8", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "e2-standard-8|n2-standard-8", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -16485,10 +16485,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "8", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "e2-standard-8|n2-standard-8", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -16535,10 +16535,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "8", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "e2-standard-8|n2-standard-8", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -16594,10 +16594,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "8", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "e2-standard-8|n2-standard-8", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -16653,10 +16653,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "8", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "e2-standard-8|n2-standard-8", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -16712,10 +16712,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "8", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "e2-standard-8|n2-standard-8", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -16772,10 +16772,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "8", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "e2-standard-8|n2-standard-8", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -16832,10 +16832,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "8", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "e2-standard-8|n2-standard-8", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -16891,10 +16891,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "8", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "e2-standard-8|n2-standard-8", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -16951,10 +16951,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "8", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "e2-standard-8|n2-standard-8", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -17010,10 +17010,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "8", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "e2-standard-8|n2-standard-8", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -17069,10 +17069,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "8", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "e2-standard-8|n2-standard-8", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -17128,10 +17128,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "8", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "e2-standard-8|n2-standard-8", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -17194,10 +17194,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "8", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "e2-standard-8|n2-standard-8", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -17262,10 +17262,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "8", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "e2-standard-8|n2-standard-8", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -17327,10 +17327,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "8", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "e2-standard-8|n2-standard-8", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -17387,10 +17387,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "8", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "e2-standard-8|n2-standard-8", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -17446,10 +17446,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "8", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "e2-standard-8|n2-standard-8", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -17506,10 +17506,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "8", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "e2-standard-8|n2-standard-8", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -17566,10 +17566,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "8", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "e2-standard-8|n2-standard-8", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -17626,10 +17626,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "8", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "e2-standard-8|n2-standard-8", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -17686,10 +17686,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "8", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "e2-standard-8|n2-standard-8", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -17745,10 +17745,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "8", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "e2-standard-8|n2-standard-8", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -17804,10 +17804,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "8", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "e2-standard-8|n2-standard-8", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -17863,10 +17863,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "8", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "e2-standard-8|n2-standard-8", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -17922,10 +17922,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "8", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "e2-standard-8|n2-standard-8", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -17981,10 +17981,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "8", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "e2-standard-8|n2-standard-8", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -18040,10 +18040,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "8", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "e2-standard-8|n2-standard-8", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -18099,10 +18099,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "8", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "e2-standard-8|n2-standard-8", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -18160,10 +18160,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "8", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "e2-standard-8|n2-standard-8", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -18219,10 +18219,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "8", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "e2-standard-8|n2-standard-8", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -18278,10 +18278,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "8", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "e2-standard-8|n2-standard-8", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -18337,10 +18337,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "8", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "e2-standard-8|n2-standard-8", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -18396,10 +18396,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "8", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "e2-standard-8|n2-standard-8", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -18455,10 +18455,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "8", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "e2-standard-8|n2-standard-8", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -18514,10 +18514,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "8", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "e2-standard-8|n2-standard-8", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -18573,10 +18573,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "8", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "e2-standard-8|n2-standard-8", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -18632,10 +18632,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "8", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "e2-standard-8|n2-standard-8", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -18691,10 +18691,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "8", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "e2-standard-8|n2-standard-8", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -18750,10 +18750,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "8", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "e2-standard-8|n2-standard-8", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -18809,10 +18809,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "8", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "e2-standard-8|n2-standard-8", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -18868,10 +18868,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "8", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "e2-standard-8|n2-standard-8", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -18927,10 +18927,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "8", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "e2-standard-8|n2-standard-8", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -18986,10 +18986,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "8", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "e2-standard-8|n2-standard-8", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -19045,10 +19045,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "8", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "e2-standard-8|n2-standard-8", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -19105,10 +19105,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "8", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "e2-standard-8|n2-standard-8", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -19164,10 +19164,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "8", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "e2-standard-8|n2-standard-8", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -19223,10 +19223,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "8", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "e2-standard-8|n2-standard-8", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -19282,10 +19282,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "8", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "e2-standard-8|n2-standard-8", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -19341,10 +19341,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "8", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "e2-standard-8|n2-standard-8", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -19400,10 +19400,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "8", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "e2-standard-8|n2-standard-8", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -19459,10 +19459,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "8", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "e2-standard-8|n2-standard-8", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -19518,10 +19518,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "8", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "e2-standard-8|n2-standard-8", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -19577,10 +19577,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "8", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "e2-standard-8|n2-standard-8", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -19636,10 +19636,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "8", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "e2-standard-8|n2-standard-8", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -19695,10 +19695,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "8", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "e2-standard-8|n2-standard-8", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -19754,10 +19754,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "8", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "e2-standard-8|n2-standard-8", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -19814,10 +19814,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "8", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "e2-standard-8|n2-standard-8", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -19873,10 +19873,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "8", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "e2-standard-8|n2-standard-8", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -19932,10 +19932,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "8", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "e2-standard-8|n2-standard-8", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -19992,10 +19992,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "8", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "e2-standard-8|n2-standard-8", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -20051,10 +20051,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "8", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "e2-standard-8|n2-standard-8", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -20110,10 +20110,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "8", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "e2-standard-8|n2-standard-8", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -23353,10 +23353,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "8", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "e2-standard-8|n2-standard-8", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -23422,10 +23422,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "8", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "e2-standard-8|n2-standard-8", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -23490,10 +23490,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "8", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "e2-standard-8|n2-standard-8", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -23552,10 +23552,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "8", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "e2-standard-8|n2-standard-8", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -23615,10 +23615,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "8", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "e2-standard-8|n2-standard-8", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -23676,10 +23676,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "8", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "e2-standard-8|n2-standard-8", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -23739,10 +23739,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "8", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "e2-standard-8|n2-standard-8", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -24339,10 +24339,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "4", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4|n2-standard-4", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -24398,10 +24398,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "4", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4|n2-standard-4", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -24457,10 +24457,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "4", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4|n2-standard-4", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -24516,10 +24516,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "4", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4|n2-standard-4", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -24575,10 +24575,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "4", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4|n2-standard-4", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -24634,10 +24634,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "4", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4|n2-standard-4", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -24694,10 +24694,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "4", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4|n2-standard-4", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -24758,10 +24758,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "4", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4|n2-standard-4", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -24817,10 +24817,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "4", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4|n2-standard-4", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -24876,10 +24876,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "4", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4|n2-standard-4", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -24935,10 +24935,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "4", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4|n2-standard-4", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -24994,10 +24994,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "4", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4|n2-standard-4", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -25053,10 +25053,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "4", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4|n2-standard-4", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -25112,10 +25112,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "4", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4|n2-standard-4", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -25176,10 +25176,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "4", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4|n2-standard-4", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -25235,10 +25235,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "4", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4|n2-standard-4", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -25294,10 +25294,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "4", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4|n2-standard-4", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -25353,10 +25353,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "4", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4|n2-standard-4", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -25412,10 +25412,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "4", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4|n2-standard-4", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -25471,10 +25471,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "4", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4|n2-standard-4", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -25531,10 +25531,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "4", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4|n2-standard-4", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -25595,10 +25595,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "4", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4|n2-standard-4", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -25654,10 +25654,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "4", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4|n2-standard-4", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -25713,10 +25713,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "4", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4|n2-standard-4", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -25772,10 +25772,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "4", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4|n2-standard-4", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -25831,10 +25831,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "4", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4|n2-standard-4", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -25890,10 +25890,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "4", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4|n2-standard-4", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -25949,10 +25949,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "4", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4|n2-standard-4", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -26013,10 +26013,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "4", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4|n2-standard-4", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -26072,10 +26072,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "4", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4|n2-standard-4", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -26131,10 +26131,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "4", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4|n2-standard-4", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -26190,10 +26190,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "4", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4|n2-standard-4", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -26249,10 +26249,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "4", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4|n2-standard-4", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -26308,10 +26308,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "4", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4|n2-standard-4", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -26368,10 +26368,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "4", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4|n2-standard-4", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -26432,10 +26432,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "4", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4|n2-standard-4", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -26491,10 +26491,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "4", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4|n2-standard-4", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -26550,10 +26550,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "4", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4|n2-standard-4", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -26609,10 +26609,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "4", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4|n2-standard-4", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -26668,10 +26668,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "4", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4|n2-standard-4", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -26727,10 +26727,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "4", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4|n2-standard-4", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -26787,10 +26787,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "4", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4|n2-standard-4", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -26911,10 +26911,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "4", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4|n2-standard-4", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -26970,10 +26970,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "4", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4|n2-standard-4", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -27029,10 +27029,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "4", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4|n2-standard-4", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -27088,10 +27088,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "4", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4|n2-standard-4", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -27147,10 +27147,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "4", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4|n2-standard-4", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -27206,10 +27206,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "4", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4|n2-standard-4", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -27266,10 +27266,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "4", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4|n2-standard-4", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -27335,10 +27335,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "4", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4|n2-standard-4", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -27395,10 +27395,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "4", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4|n2-standard-4", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -27457,10 +27457,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "4", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4|n2-standard-4", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -27518,10 +27518,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "4", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4|n2-standard-4", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -27572,10 +27572,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "4", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4|n2-standard-4", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -27623,10 +27623,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "4", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4|n2-standard-4", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -27683,10 +27683,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "4", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4|n2-standard-4", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -27743,10 +27743,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "4", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4|n2-standard-4", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -27804,10 +27804,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "4", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4|n2-standard-4", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -27865,10 +27865,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "4", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4|n2-standard-4", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -27926,10 +27926,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "4", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4|n2-standard-4", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -27986,10 +27986,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "4", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4|n2-standard-4", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -28047,10 +28047,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "4", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4|n2-standard-4", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -28107,10 +28107,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "4", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4|n2-standard-4", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -28167,10 +28167,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "4", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4|n2-standard-4", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -28233,10 +28233,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "4", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4|n2-standard-4", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -28293,10 +28293,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "4", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4|n2-standard-4", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -28361,10 +28361,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "8", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "e2-standard-8|n2-standard-8", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -28433,10 +28433,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "4", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4|n2-standard-4", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -28502,10 +28502,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "4", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4|n2-standard-4", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -28568,10 +28568,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "4", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4|n2-standard-4", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -28639,10 +28639,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "4", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4|n2-standard-4", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -28700,10 +28700,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "4", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4|n2-standard-4", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -28761,10 +28761,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "4", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4|n2-standard-4", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -28823,10 +28823,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "8", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "e2-standard-8|n2-standard-8", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -28889,10 +28889,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "8", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "e2-standard-8|n2-standard-8", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -28951,10 +28951,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "8", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "e2-standard-8|n2-standard-8", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -29012,10 +29012,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "4", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4|n2-standard-4", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -29073,10 +29073,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "4", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4|n2-standard-4", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -29133,10 +29133,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "4", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4|n2-standard-4", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -29193,10 +29193,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "4", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4|n2-standard-4", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -29253,10 +29253,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "4", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4|n2-standard-4", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -29313,10 +29313,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "4", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4|n2-standard-4", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -29373,10 +29373,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "4", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4|n2-standard-4", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -29433,10 +29433,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "4", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4|n2-standard-4", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -29493,10 +29493,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "4", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4|n2-standard-4", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -29556,10 +29556,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "4", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4|n2-standard-4", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -29616,10 +29616,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "4", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4|n2-standard-4", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -29676,10 +29676,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "4", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4|n2-standard-4", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -29736,10 +29736,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "4", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4|n2-standard-4", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -29796,10 +29796,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "4", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4|n2-standard-4", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -29856,10 +29856,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "4", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4|n2-standard-4", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -29916,10 +29916,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "4", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4|n2-standard-4", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -29976,10 +29976,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "4", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4|n2-standard-4", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -30036,10 +30036,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "4", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4|n2-standard-4", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -30096,10 +30096,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "4", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4|n2-standard-4", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -30156,10 +30156,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "4", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4|n2-standard-4", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -30216,10 +30216,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "4", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4|n2-standard-4", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -30276,10 +30276,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "4", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4|n2-standard-4", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -30336,10 +30336,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "4", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4|n2-standard-4", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -30396,10 +30396,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "4", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4|n2-standard-4", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -30456,10 +30456,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "4", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4|n2-standard-4", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -30518,10 +30518,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "4", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4|n2-standard-4", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -30579,10 +30579,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "4", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4|n2-standard-4", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -30640,10 +30640,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "4", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4|n2-standard-4", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -30701,10 +30701,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "4", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4|n2-standard-4", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -30761,10 +30761,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "4", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4|n2-standard-4", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -30821,10 +30821,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "4", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4|n2-standard-4", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -30881,10 +30881,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "4", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4|n2-standard-4", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -30941,10 +30941,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "4", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4|n2-standard-4", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -31001,10 +31001,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "4", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4|n2-standard-4", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -31061,10 +31061,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "4", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4|n2-standard-4", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -31121,10 +31121,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "4", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4|n2-standard-4", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -31181,10 +31181,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "4", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4|n2-standard-4", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -31242,10 +31242,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "4", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4|n2-standard-4", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -31302,10 +31302,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "4", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4|n2-standard-4", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -31370,10 +31370,10 @@ ], "dimension_sets": [ { + "cores": "4", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4|n2-standard-4", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -31432,10 +31432,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "4", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4|n2-standard-4", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -31493,10 +31493,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "4", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4|n2-standard-4", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -31553,10 +31553,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "4", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4|n2-standard-4", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -31613,10 +31613,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "4", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4|n2-standard-4", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -31673,10 +31673,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "4", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4|n2-standard-4", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -31717,12 +31717,12 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "4", "cpu": "x86-64", "device_os": null, "device_os_flavor": null, "device_playstore_version": null, "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4|n2-standard-4", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -31770,10 +31770,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "4", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4|n2-standard-4", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -31820,10 +31820,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "4", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4|n2-standard-4", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -31867,10 +31867,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "4", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4|n2-standard-4", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -36142,10 +36142,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "4", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4|n2-standard-4", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -36202,10 +36202,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "8", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "e2-standard-8|n2-standard-8", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -36263,10 +36263,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "4", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4|n2-standard-4", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -36322,10 +36322,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "4", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4|n2-standard-4", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -36375,10 +36375,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "4", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4|n2-standard-4", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -36425,10 +36425,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "4", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4|n2-standard-4", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -36484,10 +36484,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "4", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4|n2-standard-4", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -36543,10 +36543,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "4", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4|n2-standard-4", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -36602,10 +36602,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "4", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4|n2-standard-4", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -36662,10 +36662,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "4", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4|n2-standard-4", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -36722,10 +36722,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "4", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4|n2-standard-4", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -36781,10 +36781,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "4", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4|n2-standard-4", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -36841,10 +36841,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "4", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4|n2-standard-4", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -36900,10 +36900,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "4", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4|n2-standard-4", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -36960,10 +36960,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "4", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4|n2-standard-4", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -37019,10 +37019,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "4", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4|n2-standard-4", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -37078,10 +37078,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "4", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4|n2-standard-4", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -37145,10 +37145,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "8", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "e2-standard-8|n2-standard-8", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -37214,10 +37214,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "4", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4|n2-standard-4", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -37279,10 +37279,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "4", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4|n2-standard-4", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -37339,10 +37339,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "4", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4|n2-standard-4", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -37398,10 +37398,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "4", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4|n2-standard-4", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -37459,10 +37459,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "4", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4|n2-standard-4", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -37520,10 +37520,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "4", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4|n2-standard-4", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -37580,10 +37580,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "4", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4|n2-standard-4", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -37640,10 +37640,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "4", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4|n2-standard-4", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -37699,10 +37699,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "4", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4|n2-standard-4", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -37758,10 +37758,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "4", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4|n2-standard-4", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -37817,10 +37817,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "4", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4|n2-standard-4", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -37876,10 +37876,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "4", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4|n2-standard-4", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -37935,10 +37935,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "4", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4|n2-standard-4", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -37994,10 +37994,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "4", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4|n2-standard-4", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -38053,10 +38053,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "4", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4|n2-standard-4", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -38115,10 +38115,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "4", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4|n2-standard-4", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -38174,10 +38174,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "4", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4|n2-standard-4", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -38233,10 +38233,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "4", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4|n2-standard-4", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -38292,10 +38292,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "4", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4|n2-standard-4", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -38351,10 +38351,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "4", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4|n2-standard-4", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -38410,10 +38410,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "4", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4|n2-standard-4", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -38469,10 +38469,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "4", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4|n2-standard-4", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -38528,10 +38528,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "4", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4|n2-standard-4", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -38587,10 +38587,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "4", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4|n2-standard-4", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -38646,10 +38646,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "4", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4|n2-standard-4", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -38705,10 +38705,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "4", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4|n2-standard-4", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -38764,10 +38764,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "4", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4|n2-standard-4", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -38823,10 +38823,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "4", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4|n2-standard-4", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -38882,10 +38882,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "4", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4|n2-standard-4", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -38941,10 +38941,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "4", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4|n2-standard-4", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -39001,10 +39001,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "4", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4|n2-standard-4", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -39062,10 +39062,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "4", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4|n2-standard-4", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -39121,10 +39121,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "4", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4|n2-standard-4", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -39180,10 +39180,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "4", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4|n2-standard-4", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -39239,10 +39239,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "4", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4|n2-standard-4", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -39298,10 +39298,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "4", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4|n2-standard-4", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -39357,10 +39357,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "4", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4|n2-standard-4", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -39416,10 +39416,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "4", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4|n2-standard-4", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -39475,10 +39475,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "4", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4|n2-standard-4", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -39534,10 +39534,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "4", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4|n2-standard-4", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -39593,10 +39593,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "4", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4|n2-standard-4", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -39652,10 +39652,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "4", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4|n2-standard-4", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -39712,10 +39712,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "4", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4|n2-standard-4", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -39771,10 +39771,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "4", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4|n2-standard-4", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -39837,10 +39837,10 @@ ], "dimension_sets": [ { + "cores": "4", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4|n2-standard-4", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -39898,10 +39898,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "4", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4|n2-standard-4", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -39958,10 +39958,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "4", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4|n2-standard-4", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -40017,10 +40017,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "4", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4|n2-standard-4", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -40076,10 +40076,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "4", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4|n2-standard-4", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -40161,10 +40161,10 @@ ], "dimension_sets": [ { + "cores": "4", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4|n2-standard-4", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -40233,10 +40233,10 @@ ], "dimension_sets": [ { + "cores": "4", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "n1-standard-4|e2-standard-4|n2-standard-4", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" }
diff --git a/testing/buildbot/chromium.chromiumos.json b/testing/buildbot/chromium.chromiumos.json index b0c0d5c4..2f5742b 100644 --- a/testing/buildbot/chromium.chromiumos.json +++ b/testing/buildbot/chromium.chromiumos.json
@@ -1329,67 +1329,6 @@ } ] }, - "chromeos-kevin-rel": { - "additional_compile_targets": [ - "chromiumos_preflight" - ], - "gtest_tests": [ - { - "args": [ - "--test-launcher-filter-file=../../testing/buildbot/filters/chromeos.base_unittests.filter" - ], - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "device_type": "kevin", - "os": "ChromeOS", - "pool": "chromium.tests" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "base_unittests", - "test_id_prefix": "ninja://base:base_unittests/", - "trigger_script": { - "script": "//testing/trigger_scripts/chromeos_device_trigger.py" - } - }, - { - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "resultdb": { - "enable": true, - "has_native_resultdb_integration": true - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "device_type": "kevin", - "os": "ChromeOS", - "pool": "chromium.tests" - } - ], - "idempotent": false, - "io_timeout": 3600, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com", - "shards": 5 - }, - "test": "chrome_all_tast_tests", - "test_id_prefix": "ninja://chromeos:chrome_all_tast_tests/", - "trigger_script": { - "script": "//testing/trigger_scripts/chromeos_device_trigger.py" - } - } - ] - }, "chromeos-octopus-rel": { "additional_compile_targets": [ "chromiumos_preflight"
diff --git a/testing/buildbot/chromium.fyi.json b/testing/buildbot/chromium.fyi.json index d7f5fe14..aeeb737 100644 --- a/testing/buildbot/chromium.fyi.json +++ b/testing/buildbot/chromium.fyi.json
@@ -17542,10 +17542,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "8", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "e2-standard-8|n2-standard-8", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -17598,10 +17598,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "8", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "e2-standard-8|n2-standard-8", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -17653,10 +17653,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "8", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "e2-standard-8|n2-standard-8", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -17709,10 +17709,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "8", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "e2-standard-8|n2-standard-8", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" } @@ -17764,10 +17764,10 @@ "can_use_on_swarming_builders": true, "dimension_sets": [ { + "cores": "8", "cpu": "x86-64", "device_os": null, "device_type": null, - "machine_type": "e2-standard-8|n2-standard-8", "os": "Ubuntu-18.04", "pool": "chromium.tests.avd" }
diff --git a/testing/buildbot/chromium.win.json b/testing/buildbot/chromium.win.json index 9bb369f..1abfcd4 100644 --- a/testing/buildbot/chromium.win.json +++ b/testing/buildbot/chromium.win.json
@@ -77,1948 +77,6 @@ } ] }, - "Win 7 Tests x64 (1)": { - "gtest_tests": [ - { - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "os": "Windows-7-SP1" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "absl_hardening_tests", - "test_id_prefix": "ninja://third_party/abseil-cpp:absl_hardening_tests/" - }, - { - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "os": "Windows-7-SP1" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "accessibility_unittests", - "test_id_prefix": "ninja://ui/accessibility:accessibility_unittests/" - }, - { - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_isolated_script_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "os": "Windows-7-SP1" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "angle_unittests", - "test_id_prefix": "ninja://third_party/angle/src/tests:angle_unittests/", - "use_isolated_scripts_api": true - }, - { - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "os": "Windows-7-SP1" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "app_shell_unittests", - "test_id_prefix": "ninja://extensions/shell:app_shell_unittests/" - }, - { - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "os": "Windows-7-SP1" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "aura_unittests", - "test_id_prefix": "ninja://ui/aura:aura_unittests/" - }, - { - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "os": "Windows-7-SP1" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "base_unittests", - "test_id_prefix": "ninja://base:base_unittests/" - }, - { - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "os": "Windows-7-SP1" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "blink_common_unittests", - "test_id_prefix": "ninja://third_party/blink/common:blink_common_unittests/" - }, - { - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "os": "Windows-7-SP1" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "blink_fuzzer_unittests", - "test_id_prefix": "ninja://third_party/blink/renderer/platform:blink_fuzzer_unittests/" - }, - { - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "os": "Windows-7-SP1" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "blink_heap_unittests", - "test_id_prefix": "ninja://third_party/blink/renderer/platform/heap:blink_heap_unittests/" - }, - { - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "os": "Windows-7-SP1" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "blink_platform_unittests", - "test_id_prefix": "ninja://third_party/blink/renderer/platform:blink_platform_unittests/" - }, - { - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "os": "Windows-7-SP1" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "boringssl_crypto_tests", - "test_id_prefix": "ninja://third_party/boringssl:boringssl_crypto_tests/" - }, - { - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "os": "Windows-7-SP1" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "boringssl_ssl_tests", - "test_id_prefix": "ninja://third_party/boringssl:boringssl_ssl_tests/" - }, - { - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "os": "Windows-7-SP1" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com", - "shards": 10 - }, - "test": "browser_tests", - "test_id_prefix": "ninja://chrome/test:browser_tests/" - }, - { - "args": [ - "--gtest_filter=-*UsingRealWebcam*" - ], - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "os": "Windows-7-SP1" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "capture_unittests", - "test_id_prefix": "ninja://media/capture:capture_unittests/" - }, - { - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "os": "Windows-7-SP1" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "cast_unittests", - "test_id_prefix": "ninja://media/cast:cast_unittests/" - }, - { - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "os": "Windows-7-SP1" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "cc_unittests", - "test_id_prefix": "ninja://cc:cc_unittests/" - }, - { - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "os": "Windows-7-SP1" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "chrome_app_unittests", - "test_id_prefix": "ninja://chrome/test:chrome_app_unittests/" - }, - { - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "os": "Windows-7-SP1" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "chrome_cleaner_unittests", - "test_id_prefix": "ninja://chrome/chrome_cleaner:chrome_cleaner_unittests/" - }, - { - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "os": "Windows-7-SP1" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "chrome_elf_unittests", - "test_id_prefix": "ninja://chrome/chrome_elf:chrome_elf_unittests/" - }, - { - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "os": "Windows-7-SP1" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "chromedriver_unittests", - "test_id_prefix": "ninja://chrome/test/chromedriver:chromedriver_unittests/" - }, - { - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "os": "Windows-7-SP1" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "color_unittests", - "test_id_prefix": "ninja://ui/color:color_unittests/" - }, - { - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "os": "Windows-7-SP1" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "components_browsertests", - "test_id_prefix": "ninja://components:components_browsertests/" - }, - { - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "os": "Windows-7-SP1" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "components_unittests", - "test_id_prefix": "ninja://components:components_unittests/" - }, - { - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "os": "Windows-7-SP1" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "compositor_unittests", - "test_id_prefix": "ninja://ui/compositor:compositor_unittests/" - }, - { - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "os": "Windows-7-SP1" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com", - "shards": 8 - }, - "test": "content_browsertests", - "test_id_prefix": "ninja://content/test:content_browsertests/" - }, - { - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "os": "Windows-7-SP1" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "content_unittests", - "test_id_prefix": "ninja://content/test:content_unittests/" - }, - { - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "os": "Windows-7-SP1" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "courgette_unittests", - "test_id_prefix": "ninja://courgette:courgette_unittests/" - }, - { - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "os": "Windows-7-SP1" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "crashpad_tests", - "test_id_prefix": "ninja://third_party/crashpad/crashpad:crashpad_tests/" - }, - { - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "os": "Windows-7-SP1" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "cronet_tests", - "test_id_prefix": "ninja://components/cronet:cronet_tests/" - }, - { - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "os": "Windows-7-SP1" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "cronet_unittests", - "test_id_prefix": "ninja://components/cronet:cronet_unittests/" - }, - { - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "os": "Windows-7-SP1" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "crypto_unittests", - "test_id_prefix": "ninja://crypto:crypto_unittests/" - }, - { - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "os": "Windows-7-SP1" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "delayloads_unittests", - "test_id_prefix": "ninja://chrome/test:delayloads_unittests/" - }, - { - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "os": "Windows-7-SP1" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "device_unittests", - "test_id_prefix": "ninja://device:device_unittests/" - }, - { - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "os": "Windows-7-SP1" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "display_unittests", - "test_id_prefix": "ninja://ui/display:display_unittests/" - }, - { - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "os": "Windows-7-SP1" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "elevation_service_unittests", - "test_id_prefix": "ninja://chrome/elevation_service:elevation_service_unittests/" - }, - { - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "os": "Windows-7-SP1" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "events_unittests", - "test_id_prefix": "ninja://ui/events:events_unittests/" - }, - { - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "os": "Windows-7-SP1" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "extensions_browsertests", - "test_id_prefix": "ninja://extensions:extensions_browsertests/" - }, - { - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "os": "Windows-7-SP1" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "extensions_unittests", - "test_id_prefix": "ninja://extensions:extensions_unittests/" - }, - { - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "os": "Windows-7-SP1" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "filesystem_service_unittests", - "test_id_prefix": "ninja://components/services/filesystem:filesystem_service_unittests/" - }, - { - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "os": "Windows-7-SP1" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "gcm_unit_tests", - "test_id_prefix": "ninja://google_apis/gcm:gcm_unit_tests/" - }, - { - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "os": "Windows-7-SP1" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "gcp_unittests", - "test_id_prefix": "ninja://chrome/credential_provider/test:gcp_unittests/" - }, - { - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "os": "Windows-7-SP1" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "gfx_unittests", - "test_id_prefix": "ninja://ui/gfx:gfx_unittests/" - }, - { - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "os": "Windows-7-SP1" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "gin_unittests", - "test_id_prefix": "ninja://gin:gin_unittests/" - }, - { - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "os": "Windows-7-SP1" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "google_apis_unittests", - "test_id_prefix": "ninja://google_apis:google_apis_unittests/" - }, - { - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "os": "Windows-7-SP1" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "gpu_unittests", - "test_id_prefix": "ninja://gpu:gpu_unittests/" - }, - { - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "os": "Windows-7-SP1" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "gwp_asan_unittests", - "test_id_prefix": "ninja://components/gwp_asan:gwp_asan_unittests/" - }, - { - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "os": "Windows-7-SP1" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "headless_browsertests", - "test_id_prefix": "ninja://headless:headless_browsertests/" - }, - { - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "os": "Windows-7-SP1" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "headless_unittests", - "test_id_prefix": "ninja://headless:headless_unittests/" - }, - { - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "os": "Windows-7-SP1" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "install_static_unittests", - "test_id_prefix": "ninja://chrome/install_static:install_static_unittests/" - }, - { - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "integrity": "high", - "os": "Windows-7-SP1" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "installer_util_unittests", - "test_id_prefix": "ninja://chrome/installer/util:installer_util_unittests/" - }, - { - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "os": "Windows-7-SP1" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com", - "shards": 3 - }, - "test": "interactive_ui_tests", - "test_id_prefix": "ninja://chrome/test:interactive_ui_tests/" - }, - { - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "os": "Windows-7-SP1" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "ipc_tests", - "test_id_prefix": "ninja://ipc:ipc_tests/" - }, - { - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "os": "Windows-7-SP1" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "latency_unittests", - "test_id_prefix": "ninja://ui/latency:latency_unittests/" - }, - { - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "os": "Windows-7-SP1" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "libjingle_xmpp_unittests", - "test_id_prefix": "ninja://third_party/libjingle_xmpp:libjingle_xmpp_unittests/" - }, - { - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "os": "Windows-7-SP1" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "liburlpattern_unittests", - "test_id_prefix": "ninja://third_party/liburlpattern:liburlpattern_unittests/" - }, - { - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "os": "Windows-7-SP1" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "media_unittests", - "test_id_prefix": "ninja://media:media_unittests/" - }, - { - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "os": "Windows-7-SP1" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "message_center_unittests", - "test_id_prefix": "ninja://ui/message_center:message_center_unittests/" - }, - { - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "os": "Windows-7-SP1" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "midi_unittests", - "test_id_prefix": "ninja://media/midi:midi_unittests/" - }, - { - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "os": "Windows-7-SP1" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "mojo_core_unittests", - "test_id_prefix": "ninja://mojo/core:mojo_core_unittests/" - }, - { - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "os": "Windows-7-SP1" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "mojo_unittests", - "test_id_prefix": "ninja://mojo:mojo_unittests/" - }, - { - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "os": "Windows-7-SP1" - } - ], - "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": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "os": "Windows-7-SP1" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "native_theme_unittests", - "test_id_prefix": "ninja://ui/native_theme:native_theme_unittests/" - }, - { - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "os": "Windows-7-SP1" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "net_unittests", - "test_id_prefix": "ninja://net:net_unittests/" - }, - { - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "os": "Windows-7-SP1" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "pdf_unittests", - "test_id_prefix": "ninja://pdf:pdf_unittests/" - }, - { - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "os": "Windows-7-SP1" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "perfetto_unittests", - "test_id_prefix": "ninja://third_party/perfetto:perfetto_unittests/" - }, - { - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "os": "Windows-7-SP1" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "ppapi_unittests", - "test_id_prefix": "ninja://ppapi:ppapi_unittests/" - }, - { - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "os": "Windows-7-SP1" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "printing_unittests", - "test_id_prefix": "ninja://printing:printing_unittests/" - }, - { - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "os": "Windows-7-SP1" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "remoting_unittests", - "test_id_prefix": "ninja://remoting:remoting_unittests/" - }, - { - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "integrity": "high", - "os": "Windows-7-SP1" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "sbox_integration_tests", - "test_id_prefix": "ninja://sandbox/win:sbox_integration_tests/" - }, - { - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "os": "Windows-7-SP1" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "sbox_unittests", - "test_id_prefix": "ninja://sandbox/win:sbox_unittests/" - }, - { - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "os": "Windows-7-SP1" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "sbox_validation_tests", - "test_id_prefix": "ninja://sandbox/win:sbox_validation_tests/" - }, - { - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "os": "Windows-7-SP1" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "service_manager_unittests", - "test_id_prefix": "ninja://services/service_manager/tests:service_manager_unittests/" - }, - { - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "os": "Windows-7-SP1" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "services_unittests", - "test_id_prefix": "ninja://services:services_unittests/" - }, - { - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "integrity": "high", - "os": "Windows-7-SP1" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "setup_unittests", - "test_id_prefix": "ninja://chrome/installer/setup:setup_unittests/" - }, - { - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "os": "Windows-7-SP1" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "shell_dialogs_unittests", - "test_id_prefix": "ninja://ui/shell_dialogs:shell_dialogs_unittests/" - }, - { - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "os": "Windows-7-SP1" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "skia_unittests", - "test_id_prefix": "ninja://skia:skia_unittests/" - }, - { - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "os": "Windows-7-SP1" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "snapshot_unittests", - "test_id_prefix": "ninja://ui/snapshot:snapshot_unittests/" - }, - { - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "os": "Windows-7-SP1" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "sql_unittests", - "test_id_prefix": "ninja://sql:sql_unittests/" - }, - { - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "os": "Windows-7-SP1" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "storage_unittests", - "test_id_prefix": "ninja://storage:storage_unittests/" - }, - { - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "os": "Windows-7-SP1" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "sync_integration_tests", - "test_id_prefix": "ninja://chrome/test:sync_integration_tests/" - }, - { - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "os": "Windows-7-SP1" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "ui_base_unittests", - "test_id_prefix": "ninja://ui/base:ui_base_unittests/" - }, - { - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "os": "Windows-7-SP1" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "ui_touch_selection_unittests", - "test_id_prefix": "ninja://ui/touch_selection:ui_touch_selection_unittests/" - }, - { - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "os": "Windows-7-SP1" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "unit_tests", - "test_id_prefix": "ninja://chrome/test:unit_tests/" - }, - { - "args": [ - "--test-launcher-timeout=90000", - "--ui-test-action-max-timeout=45000", - "--ui-test-action-timeout=40000" - ], - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "os": "Windows-7-SP1" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "updater_tests", - "test_id_prefix": "ninja://chrome/updater:updater_tests/" - }, - { - "args": [ - "--test-launcher-print-test-stdio=always", - "--test-launcher-timeout=90000", - "--ui-test-action-max-timeout=45000", - "--ui-test-action-timeout=40000", - "--ui-test-action-timeout=40000" - ], - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "os": "Windows-7-SP1" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "updater_tests_system", - "test_id_prefix": "ninja://chrome/updater:updater_tests_system/" - }, - { - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "os": "Windows-7-SP1" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "url_unittests", - "test_id_prefix": "ninja://url:url_unittests/" - }, - { - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "os": "Windows-7-SP1" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "views_unittests", - "test_id_prefix": "ninja://ui/views:views_unittests/" - }, - { - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "os": "Windows-7-SP1" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "viz_unittests", - "test_id_prefix": "ninja://components/viz:viz_unittests/" - }, - { - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "os": "Windows-7-SP1" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "vr_common_unittests", - "test_id_prefix": "ninja://chrome/browser/vr:vr_common_unittests/" - }, - { - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "os": "Windows-7-SP1" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "vr_pixeltests", - "test_id_prefix": "ninja://chrome/browser/vr:vr_pixeltests/" - }, - { - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "os": "Windows-7-SP1" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "wm_unittests", - "test_id_prefix": "ninja://ui/wm:wm_unittests/" - }, - { - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "os": "Windows-7-SP1" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "wtf_unittests", - "test_id_prefix": "ninja://third_party/blink/renderer/platform/wtf:wtf_unittests/" - }, - { - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "os": "Windows-7-SP1" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "zlib_unittests", - "test_id_prefix": "ninja://third_party/zlib:zlib_unittests/" - }, - { - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "os": "Windows-7-SP1" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "zucchini_unittests", - "test_id_prefix": "ninja://components/zucchini:zucchini_unittests/" - } - ], - "isolated_scripts": [ - { - "isolate_name": "blink_python_tests", - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_isolated_script_merge.py" - }, - "name": "blink_python_tests", - "resultdb": { - "enable": true - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "os": "Windows-7-SP1" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test_id_prefix": "ninja://:blink_python_tests/" - }, - { - "args": [ - "--test-type=integration" - ], - "check_flakiness_for_new_tests": false, - "isolate_name": "chromedriver_py_tests", - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_isolated_script_merge.py" - }, - "name": "chromedriver_py_tests", - "resultdb": { - "enable": true - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "os": "Windows-7-SP1" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test_id_prefix": "ninja://chrome/test/chromedriver:chromedriver_py_tests/" - }, - { - "isolate_name": "chromedriver_replay_unittests", - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_isolated_script_merge.py" - }, - "name": "chromedriver_replay_unittests", - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "os": "Windows-7-SP1" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test_id_prefix": "ninja://chrome/test/chromedriver:chromedriver_replay_unittests/" - }, - { - "args": [ - "--gtest-benchmark-name=components_perftests" - ], - "isolate_name": "components_perftests", - "merge": { - "args": [ - "--smoke-test-mode" - ], - "script": "//tools/perf/process_perf_results.py" - }, - "name": "components_perftests", - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "os": "Windows-7-SP1" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test_id_prefix": "ninja://components:components_perftests/" - }, - { - "isolate_name": "content_shell_crash_test", - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_isolated_script_merge.py" - }, - "name": "content_shell_crash_test", - "resultdb": { - "enable": true, - "result_format": "single" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "os": "Windows-7-SP1" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test_id_prefix": "ninja://content/shell:content_shell_crash_test/" - }, - { - "isolate_name": "flatbuffers_unittests", - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_isolated_script_merge.py" - }, - "name": "flatbuffers_unittests", - "resultdb": { - "enable": true, - "result_format": "single" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "os": "Windows-7-SP1" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test_id_prefix": "ninja://third_party/flatbuffers:flatbuffers_unittests/" - }, - { - "isolate_name": "mini_installer_tests", - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_isolated_script_merge.py" - }, - "name": "mini_installer_tests", - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "integrity": "high", - "os": "Windows-7-SP1" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test_id_prefix": "ninja://chrome/test/mini_installer:mini_installer_tests/" - }, - { - "isolate_name": "mojo_python_unittests", - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_isolated_script_merge.py" - }, - "name": "mojo_python_unittests", - "resultdb": { - "enable": true - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "os": "Windows-7-SP1" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test_id_prefix": "ninja://mojo/public/tools:mojo_python_unittests/" - }, - { - "experiment_percentage": 0, - "isolate_name": "polymer_tools_python_unittests", - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_isolated_script_merge.py" - }, - "name": "polymer_tools_python_unittests", - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "os": "Windows-7-SP1" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test_id_prefix": "ninja://tools/polymer:polymer_tools_python_unittests/" - }, - { - "args": [ - "BrowserMinidumpTest", - "-v", - "--passthrough", - "--retry-limit=2" - ], - "check_flakiness_for_new_tests": false, - "isolate_name": "telemetry_perf_unittests", - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_isolated_script_merge.py" - }, - "name": "telemetry_desktop_minidump_unittests", - "resultdb": { - "enable": true - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "os": "Windows-7-SP1" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test_id_prefix": "ninja://chrome/test:telemetry_perf_unittests/" - }, - { - "isolate_name": "telemetry_gpu_unittests", - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_isolated_script_merge.py" - }, - "name": "telemetry_gpu_unittests", - "resultdb": { - "enable": true - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "os": "Windows-7-SP1" - } - ], - "idempotent": false, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test_id_prefix": "ninja://chrome/test:telemetry_gpu_unittests/" - }, - { - "args": [ - "--extra-browser-args=--enable-crashpad" - ], - "isolate_name": "telemetry_perf_unittests", - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_isolated_script_merge.py" - }, - "name": "telemetry_perf_unittests", - "resultdb": { - "enable": true - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "os": "Windows-7-SP1" - } - ], - "idempotent": false, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com", - "shards": 12 - }, - "test_id_prefix": "ninja://chrome/test:telemetry_perf_unittests/" - }, - { - "args": [ - "--jobs=1", - "--extra-browser-args=--disable-gpu" - ], - "isolate_name": "telemetry_unittests", - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_isolated_script_merge.py" - }, - "name": "telemetry_unittests", - "resultdb": { - "enable": true - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "os": "Windows-7-SP1" - } - ], - "idempotent": false, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com", - "shards": 8 - }, - "test_id_prefix": "ninja://chrome/test:telemetry_unittests/" - }, - { - "args": [ - "--gtest-benchmark-name=views_perftests" - ], - "isolate_name": "views_perftests", - "merge": { - "args": [ - "--smoke-test-mode" - ], - "script": "//tools/perf/process_perf_results.py" - }, - "name": "views_perftests", - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "os": "Windows-7-SP1" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test_id_prefix": "ninja://ui/views:views_perftests/" - } - ] - }, "Win Builder": { "additional_compile_targets": [ "pdf_fuzzers" @@ -8702,1519 +6760,5 @@ "test_id_prefix": "ninja://ui/views:views_perftests/" } ] - }, - "Win7 (32) Tests": { - "gtest_tests": [ - { - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "cpu": "x86-32", - "os": "Windows-7-SP1" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "base_unittests", - "test_id_prefix": "ninja://base:base_unittests/" - }, - { - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "cpu": "x86-32", - "os": "Windows-7-SP1" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com", - "shards": 10 - }, - "test": "browser_tests", - "test_id_prefix": "ninja://chrome/test:browser_tests/" - }, - { - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "cpu": "x86-32", - "integrity": "high", - "os": "Windows-7-SP1" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "sbox_integration_tests", - "test_id_prefix": "ninja://sandbox/win:sbox_integration_tests/" - }, - { - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "cpu": "x86-32", - "os": "Windows-7-SP1" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "sbox_unittests", - "test_id_prefix": "ninja://sandbox/win:sbox_unittests/" - }, - { - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "cpu": "x86-32", - "os": "Windows-7-SP1" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "sbox_validation_tests", - "test_id_prefix": "ninja://sandbox/win:sbox_validation_tests/" - } - ] - }, - "Win7 Tests (1)": { - "gtest_tests": [ - { - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "absl_hardening_tests", - "test_id_prefix": "ninja://third_party/abseil-cpp:absl_hardening_tests/" - }, - { - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "accessibility_unittests", - "test_id_prefix": "ninja://ui/accessibility:accessibility_unittests/" - }, - { - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_isolated_script_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "angle_unittests", - "test_id_prefix": "ninja://third_party/angle/src/tests:angle_unittests/", - "use_isolated_scripts_api": true - }, - { - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "app_shell_unittests", - "test_id_prefix": "ninja://extensions/shell:app_shell_unittests/" - }, - { - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "aura_unittests", - "test_id_prefix": "ninja://ui/aura:aura_unittests/" - }, - { - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "base_unittests", - "test_id_prefix": "ninja://base:base_unittests/" - }, - { - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "blink_common_unittests", - "test_id_prefix": "ninja://third_party/blink/common:blink_common_unittests/" - }, - { - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "blink_fuzzer_unittests", - "test_id_prefix": "ninja://third_party/blink/renderer/platform:blink_fuzzer_unittests/" - }, - { - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "blink_heap_unittests", - "test_id_prefix": "ninja://third_party/blink/renderer/platform/heap:blink_heap_unittests/" - }, - { - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "blink_platform_unittests", - "test_id_prefix": "ninja://third_party/blink/renderer/platform:blink_platform_unittests/" - }, - { - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "boringssl_crypto_tests", - "test_id_prefix": "ninja://third_party/boringssl:boringssl_crypto_tests/" - }, - { - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "boringssl_ssl_tests", - "test_id_prefix": "ninja://third_party/boringssl:boringssl_ssl_tests/" - }, - { - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com", - "shards": 15 - }, - "test": "browser_tests", - "test_id_prefix": "ninja://chrome/test:browser_tests/" - }, - { - "args": [ - "--gtest_filter=-*UsingRealWebcam*" - ], - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "capture_unittests", - "test_id_prefix": "ninja://media/capture:capture_unittests/" - }, - { - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "cast_unittests", - "test_id_prefix": "ninja://media/cast:cast_unittests/" - }, - { - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "cc_unittests", - "test_id_prefix": "ninja://cc:cc_unittests/" - }, - { - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "chrome_app_unittests", - "test_id_prefix": "ninja://chrome/test:chrome_app_unittests/" - }, - { - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "chrome_cleaner_unittests", - "test_id_prefix": "ninja://chrome/chrome_cleaner:chrome_cleaner_unittests/" - }, - { - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "chrome_elf_unittests", - "test_id_prefix": "ninja://chrome/chrome_elf:chrome_elf_unittests/" - }, - { - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "chromedriver_unittests", - "test_id_prefix": "ninja://chrome/test/chromedriver:chromedriver_unittests/" - }, - { - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "color_unittests", - "test_id_prefix": "ninja://ui/color:color_unittests/" - }, - { - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "components_browsertests", - "test_id_prefix": "ninja://components:components_browsertests/" - }, - { - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "components_unittests", - "test_id_prefix": "ninja://components:components_unittests/" - }, - { - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "compositor_unittests", - "test_id_prefix": "ninja://ui/compositor:compositor_unittests/" - }, - { - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com", - "shards": 8 - }, - "test": "content_browsertests", - "test_id_prefix": "ninja://content/test:content_browsertests/" - }, - { - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "content_unittests", - "test_id_prefix": "ninja://content/test:content_unittests/" - }, - { - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "courgette_unittests", - "test_id_prefix": "ninja://courgette:courgette_unittests/" - }, - { - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "crashpad_tests", - "test_id_prefix": "ninja://third_party/crashpad/crashpad:crashpad_tests/" - }, - { - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "cronet_tests", - "test_id_prefix": "ninja://components/cronet:cronet_tests/" - }, - { - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "cronet_unittests", - "test_id_prefix": "ninja://components/cronet:cronet_unittests/" - }, - { - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "crypto_unittests", - "test_id_prefix": "ninja://crypto:crypto_unittests/" - }, - { - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "delayloads_unittests", - "test_id_prefix": "ninja://chrome/test:delayloads_unittests/" - }, - { - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "device_unittests", - "test_id_prefix": "ninja://device:device_unittests/" - }, - { - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "display_unittests", - "test_id_prefix": "ninja://ui/display:display_unittests/" - }, - { - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "elevation_service_unittests", - "test_id_prefix": "ninja://chrome/elevation_service:elevation_service_unittests/" - }, - { - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "events_unittests", - "test_id_prefix": "ninja://ui/events:events_unittests/" - }, - { - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "extensions_browsertests", - "test_id_prefix": "ninja://extensions:extensions_browsertests/" - }, - { - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "extensions_unittests", - "test_id_prefix": "ninja://extensions:extensions_unittests/" - }, - { - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "filesystem_service_unittests", - "test_id_prefix": "ninja://components/services/filesystem:filesystem_service_unittests/" - }, - { - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "gcm_unit_tests", - "test_id_prefix": "ninja://google_apis/gcm:gcm_unit_tests/" - }, - { - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "gcp_unittests", - "test_id_prefix": "ninja://chrome/credential_provider/test:gcp_unittests/" - }, - { - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "gfx_unittests", - "test_id_prefix": "ninja://ui/gfx:gfx_unittests/" - }, - { - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "gin_unittests", - "test_id_prefix": "ninja://gin:gin_unittests/" - }, - { - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "google_apis_unittests", - "test_id_prefix": "ninja://google_apis:google_apis_unittests/" - }, - { - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "gpu_unittests", - "test_id_prefix": "ninja://gpu:gpu_unittests/" - }, - { - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "gwp_asan_unittests", - "test_id_prefix": "ninja://components/gwp_asan:gwp_asan_unittests/" - }, - { - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "headless_browsertests", - "test_id_prefix": "ninja://headless:headless_browsertests/" - }, - { - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "headless_unittests", - "test_id_prefix": "ninja://headless:headless_unittests/" - }, - { - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "install_static_unittests", - "test_id_prefix": "ninja://chrome/install_static:install_static_unittests/" - }, - { - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "integrity": "high" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "installer_util_unittests", - "test_id_prefix": "ninja://chrome/installer/util:installer_util_unittests/" - }, - { - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com", - "shards": 3 - }, - "test": "interactive_ui_tests", - "test_id_prefix": "ninja://chrome/test:interactive_ui_tests/" - }, - { - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "ipc_tests", - "test_id_prefix": "ninja://ipc:ipc_tests/" - }, - { - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "latency_unittests", - "test_id_prefix": "ninja://ui/latency:latency_unittests/" - }, - { - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "libjingle_xmpp_unittests", - "test_id_prefix": "ninja://third_party/libjingle_xmpp:libjingle_xmpp_unittests/" - }, - { - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "liburlpattern_unittests", - "test_id_prefix": "ninja://third_party/liburlpattern:liburlpattern_unittests/" - }, - { - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "media_unittests", - "test_id_prefix": "ninja://media:media_unittests/" - }, - { - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "message_center_unittests", - "test_id_prefix": "ninja://ui/message_center:message_center_unittests/" - }, - { - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "midi_unittests", - "test_id_prefix": "ninja://media/midi:midi_unittests/" - }, - { - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "mojo_core_unittests", - "test_id_prefix": "ninja://mojo/core:mojo_core_unittests/" - }, - { - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "mojo_unittests", - "test_id_prefix": "ninja://mojo:mojo_unittests/" - }, - { - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "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": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "native_theme_unittests", - "test_id_prefix": "ninja://ui/native_theme:native_theme_unittests/" - }, - { - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "net_unittests", - "test_id_prefix": "ninja://net:net_unittests/" - }, - { - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "pdf_unittests", - "test_id_prefix": "ninja://pdf:pdf_unittests/" - }, - { - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "perfetto_unittests", - "test_id_prefix": "ninja://third_party/perfetto:perfetto_unittests/" - }, - { - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "ppapi_unittests", - "test_id_prefix": "ninja://ppapi:ppapi_unittests/" - }, - { - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "printing_unittests", - "test_id_prefix": "ninja://printing:printing_unittests/" - }, - { - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "remoting_unittests", - "test_id_prefix": "ninja://remoting:remoting_unittests/" - }, - { - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "integrity": "high" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "sbox_integration_tests", - "test_id_prefix": "ninja://sandbox/win:sbox_integration_tests/" - }, - { - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "sbox_unittests", - "test_id_prefix": "ninja://sandbox/win:sbox_unittests/" - }, - { - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "sbox_validation_tests", - "test_id_prefix": "ninja://sandbox/win:sbox_validation_tests/" - }, - { - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "service_manager_unittests", - "test_id_prefix": "ninja://services/service_manager/tests:service_manager_unittests/" - }, - { - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "services_unittests", - "test_id_prefix": "ninja://services:services_unittests/" - }, - { - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "integrity": "high" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "setup_unittests", - "test_id_prefix": "ninja://chrome/installer/setup:setup_unittests/" - }, - { - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "shell_dialogs_unittests", - "test_id_prefix": "ninja://ui/shell_dialogs:shell_dialogs_unittests/" - }, - { - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "skia_unittests", - "test_id_prefix": "ninja://skia:skia_unittests/" - }, - { - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "snapshot_unittests", - "test_id_prefix": "ninja://ui/snapshot:snapshot_unittests/" - }, - { - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "sql_unittests", - "test_id_prefix": "ninja://sql:sql_unittests/" - }, - { - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "storage_unittests", - "test_id_prefix": "ninja://storage:storage_unittests/" - }, - { - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "sync_integration_tests", - "test_id_prefix": "ninja://chrome/test:sync_integration_tests/" - }, - { - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "ui_base_unittests", - "test_id_prefix": "ninja://ui/base:ui_base_unittests/" - }, - { - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "ui_touch_selection_unittests", - "test_id_prefix": "ninja://ui/touch_selection:ui_touch_selection_unittests/" - }, - { - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "unit_tests", - "test_id_prefix": "ninja://chrome/test:unit_tests/" - }, - { - "args": [ - "--test-launcher-timeout=90000", - "--ui-test-action-max-timeout=45000", - "--ui-test-action-timeout=40000" - ], - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "updater_tests", - "test_id_prefix": "ninja://chrome/updater:updater_tests/" - }, - { - "args": [ - "--test-launcher-print-test-stdio=always", - "--test-launcher-timeout=90000", - "--ui-test-action-max-timeout=45000", - "--ui-test-action-timeout=40000", - "--ui-test-action-timeout=40000" - ], - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "updater_tests_system", - "test_id_prefix": "ninja://chrome/updater:updater_tests_system/" - }, - { - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "url_unittests", - "test_id_prefix": "ninja://url:url_unittests/" - }, - { - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "views_unittests", - "test_id_prefix": "ninja://ui/views:views_unittests/" - }, - { - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "viz_unittests", - "test_id_prefix": "ninja://components/viz:viz_unittests/" - }, - { - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "vr_common_unittests", - "test_id_prefix": "ninja://chrome/browser/vr:vr_common_unittests/" - }, - { - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "vr_pixeltests", - "test_id_prefix": "ninja://chrome/browser/vr:vr_pixeltests/" - }, - { - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "wm_unittests", - "test_id_prefix": "ninja://ui/wm:wm_unittests/" - }, - { - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "wtf_unittests", - "test_id_prefix": "ninja://third_party/blink/renderer/platform/wtf:wtf_unittests/" - }, - { - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "zlib_unittests", - "test_id_prefix": "ninja://third_party/zlib:zlib_unittests/" - }, - { - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test": "zucchini_unittests", - "test_id_prefix": "ninja://components/zucchini:zucchini_unittests/" - } - ], - "isolated_scripts": [ - { - "isolate_name": "blink_python_tests", - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_isolated_script_merge.py" - }, - "name": "blink_python_tests", - "resultdb": { - "enable": true - }, - "swarming": { - "can_use_on_swarming_builders": true, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test_id_prefix": "ninja://:blink_python_tests/" - }, - { - "args": [ - "--test-type=integration" - ], - "check_flakiness_for_new_tests": false, - "isolate_name": "chromedriver_py_tests", - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_isolated_script_merge.py" - }, - "name": "chromedriver_py_tests", - "resultdb": { - "enable": true - }, - "swarming": { - "can_use_on_swarming_builders": true, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test_id_prefix": "ninja://chrome/test/chromedriver:chromedriver_py_tests/" - }, - { - "isolate_name": "chromedriver_replay_unittests", - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_isolated_script_merge.py" - }, - "name": "chromedriver_replay_unittests", - "swarming": { - "can_use_on_swarming_builders": true, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test_id_prefix": "ninja://chrome/test/chromedriver:chromedriver_replay_unittests/" - }, - { - "args": [ - "--gtest-benchmark-name=components_perftests" - ], - "isolate_name": "components_perftests", - "merge": { - "args": [ - "--smoke-test-mode" - ], - "script": "//tools/perf/process_perf_results.py" - }, - "name": "components_perftests", - "swarming": { - "can_use_on_swarming_builders": true, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test_id_prefix": "ninja://components:components_perftests/" - }, - { - "isolate_name": "content_shell_crash_test", - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_isolated_script_merge.py" - }, - "name": "content_shell_crash_test", - "resultdb": { - "enable": true, - "result_format": "single" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test_id_prefix": "ninja://content/shell:content_shell_crash_test/" - }, - { - "isolate_name": "flatbuffers_unittests", - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_isolated_script_merge.py" - }, - "name": "flatbuffers_unittests", - "resultdb": { - "enable": true, - "result_format": "single" - }, - "swarming": { - "can_use_on_swarming_builders": true, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test_id_prefix": "ninja://third_party/flatbuffers:flatbuffers_unittests/" - }, - { - "isolate_name": "mini_installer_tests", - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_isolated_script_merge.py" - }, - "name": "mini_installer_tests", - "swarming": { - "can_use_on_swarming_builders": true, - "dimension_sets": [ - { - "integrity": "high" - } - ], - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test_id_prefix": "ninja://chrome/test/mini_installer:mini_installer_tests/" - }, - { - "isolate_name": "mojo_python_unittests", - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_isolated_script_merge.py" - }, - "name": "mojo_python_unittests", - "resultdb": { - "enable": true - }, - "swarming": { - "can_use_on_swarming_builders": true, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test_id_prefix": "ninja://mojo/public/tools:mojo_python_unittests/" - }, - { - "experiment_percentage": 0, - "isolate_name": "polymer_tools_python_unittests", - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_isolated_script_merge.py" - }, - "name": "polymer_tools_python_unittests", - "swarming": { - "can_use_on_swarming_builders": true, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test_id_prefix": "ninja://tools/polymer:polymer_tools_python_unittests/" - }, - { - "args": [ - "BrowserMinidumpTest", - "-v", - "--passthrough", - "--retry-limit=2" - ], - "check_flakiness_for_new_tests": false, - "isolate_name": "telemetry_perf_unittests", - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_isolated_script_merge.py" - }, - "name": "telemetry_desktop_minidump_unittests", - "resultdb": { - "enable": true - }, - "swarming": { - "can_use_on_swarming_builders": true, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test_id_prefix": "ninja://chrome/test:telemetry_perf_unittests/" - }, - { - "isolate_name": "telemetry_gpu_unittests", - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_isolated_script_merge.py" - }, - "name": "telemetry_gpu_unittests", - "resultdb": { - "enable": true - }, - "swarming": { - "can_use_on_swarming_builders": true, - "idempotent": false, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test_id_prefix": "ninja://chrome/test:telemetry_gpu_unittests/" - }, - { - "args": [ - "--extra-browser-args=--enable-crashpad" - ], - "isolate_name": "telemetry_perf_unittests", - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_isolated_script_merge.py" - }, - "name": "telemetry_perf_unittests", - "resultdb": { - "enable": true - }, - "swarming": { - "can_use_on_swarming_builders": true, - "idempotent": false, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com", - "shards": 12 - }, - "test_id_prefix": "ninja://chrome/test:telemetry_perf_unittests/" - }, - { - "args": [ - "--jobs=1", - "--extra-browser-args=--disable-gpu" - ], - "isolate_name": "telemetry_unittests", - "merge": { - "args": [], - "script": "//testing/merge_scripts/standard_isolated_script_merge.py" - }, - "name": "telemetry_unittests", - "resultdb": { - "enable": true - }, - "swarming": { - "can_use_on_swarming_builders": true, - "idempotent": false, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com", - "shards": 8 - }, - "test_id_prefix": "ninja://chrome/test:telemetry_unittests/" - }, - { - "args": [ - "--gtest-benchmark-name=views_perftests" - ], - "isolate_name": "views_perftests", - "merge": { - "args": [ - "--smoke-test-mode" - ], - "script": "//tools/perf/process_perf_results.py" - }, - "name": "views_perftests", - "swarming": { - "can_use_on_swarming_builders": true, - "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" - }, - "test_id_prefix": "ninja://ui/views:views_perftests/" - } - ] } }
diff --git a/testing/buildbot/mixins.pyl b/testing/buildbot/mixins.pyl index 7ff4bdc..74bceff 100644 --- a/testing/buildbot/mixins.pyl +++ b/testing/buildbot/mixins.pyl
@@ -460,7 +460,7 @@ 'device_os': None, 'device_type': None, 'pool': 'chromium.tests.avd', - 'machine_type': 'n1-standard-4|e2-standard-4|n2-standard-4', + 'cores': '4', }, }, }, @@ -470,7 +470,7 @@ 'device_os': None, 'device_type': None, 'pool': 'chromium.tests.avd', - 'machine_type': 'e2-standard-8|n2-standard-8', + 'cores': '8', }, }, },
diff --git a/testing/buildbot/test_suite_exceptions.pyl b/testing/buildbot/test_suite_exceptions.pyl index 1f3695b..cc940c4 100644 --- a/testing/buildbot/test_suite_exceptions.pyl +++ b/testing/buildbot/test_suite_exceptions.pyl
@@ -77,7 +77,7 @@ 'shards': 2, 'dimension_sets': [ { - 'machine_type': 'e2-standard-8|n2-standard-8', # crbug/1292221 + 'cores': '8', # crbug.com/1292221 }, ], }, @@ -230,8 +230,6 @@ }, 'blink_web_tests': { 'remove_from': [ - 'Win 7 Tests x64 (1)', # 64-bit win is unsupported by the layout tests. - 'Win7 Tests (1)', 'Win10 Tests x64 (dbg)', 'mac-osxbeta-rel', ], @@ -553,8 +551,6 @@ }, 'blink_wpt_tests': { 'remove_from': [ - 'Win 7 Tests x64 (1)', # 64-bit win is unsupported by the layout tests. - 'Win7 Tests (1)', 'Win10 Tests x64 (dbg)', 'devtools_frontend_linux_blink_light_rel', 'devtools_frontend_linux_blink_light_rel_fastbuild', @@ -1052,13 +1048,6 @@ 'quickrun_shards': 30, } }, - 'Win7 Tests (1)': { - # This is for slow test execution that often becomes a critical path of - # swarming jobs. crbug.com/868114 - 'swarming': { - 'shards': 15, - }, - }, 'linux-chromeos-chrome': { # TODO(https://crbug.com/932269): Promote out of experiment when the # tests are green. @@ -1247,12 +1236,6 @@ 'shards': 5, } }, - 'chromeos-kevin-rel': { - 'swarming': { - # Reducing parallelism due to DUT shortage (b/238271231) - 'shards': 5, - } - }, }, # TODO(b/248270560): Restore if the DUT pool is ever stabilized. 'remove_from': [ @@ -1368,7 +1351,7 @@ 'dimension_sets': [ { # use 8-core to shorten runtime - 'machine_type': 'e2-standard-8|n2-standard-8', + 'cores': '8', }, ], }, @@ -1742,7 +1725,7 @@ 'dimension_sets': [ { # use 8-core to shorten runtime - 'machine_type': 'e2-standard-8|n2-standard-8', + 'cores': '8', }, ], }, @@ -1777,7 +1760,7 @@ 'dimension_sets': [ { # use 8-core to shorten runtime - 'machine_type': 'e2-standard-8|n2-standard-8', + 'cores': '8', }, ], }, @@ -1882,7 +1865,7 @@ 'dimension_sets': [ { # copying android-nougat-x86-rel - 'machine_type': 'e2-standard-8|n2-standard-8', + 'cores': '8', }, ], }, @@ -1926,7 +1909,7 @@ 'dimension_sets': [ { # use 8-core to shorten runtime - 'machine_type': 'e2-standard-8|n2-standard-8', + 'cores': '8', }, ], }, @@ -2059,8 +2042,6 @@ }, 'disk_usage_tast_test': { 'remove_from': [ - # TODO(crbug.com/1077659): Add the test back after it's fixed. - 'chromeos-kevin-rel', # TODO(crbug.com/1379748): Add the test back after it's fixed. 'chromeos-octopus-chrome', ], @@ -2354,10 +2335,6 @@ }, 'grit_python_unittests': { 'remove_from': [ - # These tests require node, which is not supported in Win7. - # (https://crbug.com/1218989) - 'Win 7 Tests x64 (1)', - 'Win7 Tests (1)', # TODO(https://crbug.com/1267125): Re-enable. 'mac11-arm64-rel-tests', # TODO(https://crbug.com/1267125): Re-enable. @@ -2954,10 +2931,6 @@ }, 'notification_helper_unittests': { 'remove_from': [ - # The test uses WinRT, which only exists in Windows 8 or above. - # (https://crbug.com/813553) - 'Win 7 Tests x64 (1)', - 'Win7 Tests (1)', # all these bots run Windows 7. 'ToTWin', 'ToTWin(dbg)', @@ -3492,7 +3465,6 @@ # TODO(crbug.com/1141234): Restore when there's more DUTs 'chromeos-eve-chrome', 'chromeos-kevin-chrome', - 'chromeos-kevin-rel', 'Win10 Tests x64', 'Win11 Tests x64', @@ -3996,11 +3968,6 @@ }, }, 'webkit_unit_tests': { - 'remove_from': [ - # Flakily fails on Win7. https://crbug.com/943372. - 'Win7 Tests (1)', - 'Win 7 Tests x64 (1)', - ], 'modifications': { 'Linux ASan LSan Tests (1)': { # These are very slow on the ASAN trybot for some reason.
diff --git a/testing/buildbot/test_suites.pyl b/testing/buildbot/test_suites.pyl index f4a22b3a..cbe9b05 100644 --- a/testing/buildbot/test_suites.pyl +++ b/testing/buildbot/test_suites.pyl
@@ -5220,26 +5220,6 @@ }, }, - 'win7_32_bit_gtests': { - 'base_unittests': {}, - 'browser_tests': { - 'swarming': { - 'shards': 10, - }, - }, - 'sbox_integration_tests': { - 'swarming': { - 'dimension_sets': [ - { - 'integrity': 'high', - } - ], - }, - }, - 'sbox_unittests': {}, - 'sbox_validation_tests': {}, - }, - 'win_specific_chromium_gtests': { 'chrome_cleaner_unittests': {}, 'chrome_elf_unittests': {},
diff --git a/testing/buildbot/waterfalls.pyl b/testing/buildbot/waterfalls.pyl index 11a7f89..fcef396e 100644 --- a/testing/buildbot/waterfalls.pyl +++ b/testing/buildbot/waterfalls.pyl
@@ -1379,18 +1379,6 @@ }, 'os_type': 'chromeos', }, - 'chromeos-kevin-rel': { - 'additional_compile_targets': [ - 'chromiumos_preflight', - ], - 'mixins': [ - 'chromeos-kevin', - ], - 'test_suites': { - 'gtest_tests': 'chromeos_device_gtests', - }, - 'os_type': 'chromeos', - }, 'chromeos-octopus-rel': { 'additional_compile_targets': [ 'chromiumos_preflight', @@ -6066,15 +6054,6 @@ 'isolated_scripts': 'chromium_webkit_isolated_scripts', }, }, - 'Win 7 Tests x64 (1)': { - 'mixins': [ - 'win7', - ], - 'test_suites': { - 'gtest_tests': 'chromium_win_gtests', - 'isolated_scripts': 'chromium_win_rel_isolated_scripts', - }, - }, # 'Win Builder' and 'Win x64 Builder' should have the same set of # additional_compile_targets and test_suites. 'Win Builder': { @@ -6098,9 +6077,6 @@ 'scripts': 'chromium_win_scripts', }, }, - # 'Win10 Tests x64' and 'Win7 Tests (1)' should have the same set of - # additional_compile_targets and test_suites. - # Added pixel tests on Win 10 only. 'Win10 Tests x64': { 'mixins': [ 'x86-64', @@ -6133,21 +6109,6 @@ 'isolated_scripts': 'chromium_win_rel_isolated_scripts', }, }, - 'Win7 (32) Tests': { - 'mixins': [ - 'x86-32', - 'win7', - ], - 'test_suites': { - 'gtest_tests': 'win7_32_bit_gtests', - } - }, - 'Win7 Tests (1)': { - 'test_suites': { - 'gtest_tests': 'chromium_win_gtests', - 'isolated_scripts': 'chromium_win_rel_isolated_scripts', - }, - }, }, }, {
diff --git a/third_party/blink/public/mojom/manifest/manifest_launch_handler.mojom b/third_party/blink/public/mojom/manifest/manifest_launch_handler.mojom index 471e5ba2..49efca5d 100644 --- a/third_party/blink/public/mojom/manifest/manifest_launch_handler.mojom +++ b/third_party/blink/public/mojom/manifest/manifest_launch_handler.mojom
@@ -5,19 +5,23 @@ // Spec: https://github.com/WICG/web-app-launch/blob/main/launch_handler.md struct ManifestLaunchHandler { // The client behavior to use for app launches. + // This enum is used by metrics, do not change the values. enum ClientMode { // Use whatever the platform would do by default. - kAuto, + kAuto = 0, + // Create a new client for each app launch and navigate it to the launch // URL. - kNavigateNew, + kNavigateNew = 1, + // Use an existing client if available, otherwise create a new one to use. // Navigate the existing client to the launch URL. - kNavigateExisting, + kNavigateExisting = 2, + // Use an existing client if available, otherwise create a new one to use. // Do not navigate the client and just enqueue a LaunchParams in the // document's LaunchQueue. - kFocusExisting, + kFocusExisting = 3, }; ClientMode client_mode; };
diff --git a/third_party/blink/renderer/core/css/css_computed_style_declaration.cc b/third_party/blink/renderer/core/css/css_computed_style_declaration.cc index fbcc6822..53cf305 100644 --- a/third_party/blink/renderer/core/css/css_computed_style_declaration.cc +++ b/third_party/blink/renderer/core/css/css_computed_style_declaration.cc
@@ -260,6 +260,16 @@ } } + // Transition pseudo-elements require data computed in pre-paint to generate + // the UA stylesheet for these pseudo-elements. + // TODO(khushalsagar): We can probably optimize this to run only when a + // property set by the UA stylesheet is queried. + if (IsTransitionPseudoElement(styled_node->GetPseudoId())) { + if (auto* view = document.View()) + view->UpdateLifecycleToPrePaintClean(DocumentUpdateReason::kJavaScript); + return; + } + document.UpdateStyleAndLayoutTreeForNode(styled_node); }
diff --git a/third_party/blink/renderer/core/dom/node.cc b/third_party/blink/renderer/core/dom/node.cc index 54eea42..f618822 100644 --- a/third_party/blink/renderer/core/dom/node.cc +++ b/third_party/blink/renderer/core/dom/node.cc
@@ -1044,6 +1044,11 @@ // We don't set computed style for text nodes. DCHECK(IsElementNode()); + if (auto* element = DynamicTo<Element>(this)) { + ViewTransitionSupplement::From(GetDocument()) + ->UpdateViewTransitionNames(*element, computed_style.get()); + } + NodeRenderingData* node_layout_data = HasRareData() ? DataAsNodeRareData()->GetNodeRenderingData() : DataAsNodeRenderingData();
diff --git a/third_party/blink/renderer/core/editing/commands/replace_selection_command_test.cc b/third_party/blink/renderer/core/editing/commands/replace_selection_command_test.cc index 7a149ad5..856a621b 100644 --- a/third_party/blink/renderer/core/editing/commands/replace_selection_command_test.cc +++ b/third_party/blink/renderer/core/editing/commands/replace_selection_command_test.cc
@@ -201,7 +201,7 @@ // Should not crash EXPECT_TRUE(command.Apply()); - EXPECT_EQ("<table> <tbody><img><img>|</tbody><br> </table>", + EXPECT_EQ("<table> <tbody><img><img>|</tbody> </table>", GetSelectionTextFromBody()); }
diff --git a/third_party/blink/renderer/core/editing/position_iterator.cc b/third_party/blink/renderer/core/editing/position_iterator.cc index 8cbcd29..1f8c4bbe 100644 --- a/third_party/blink/renderer/core/editing/position_iterator.cc +++ b/third_party/blink/renderer/core/editing/position_iterator.cc
@@ -338,11 +338,6 @@ } template <typename Strategy> -bool PositionIteratorAlgorithm<Strategy>::IsBeforeNode(const Node& node) const { - return anchor_node_ == &node && !offset_in_anchor_; -} - -template <typename Strategy> bool PositionIteratorAlgorithm<Strategy>::AtStart() const { DCHECK(IsValid()); if (!anchor_node_) @@ -371,8 +366,10 @@ DCHECK(IsValid()); if (!anchor_node_) return true; - if (!node_after_position_in_anchor_) - return !Strategy::HasChildren(*anchor_node_) && !offset_in_anchor_; + if (!node_after_position_in_anchor_) { + return !ShouldTraverseChildren<Strategy>(*anchor_node_) && + !offset_in_anchor_; + } return !Strategy::PreviousSibling(*node_after_position_in_anchor_); }
diff --git a/third_party/blink/renderer/core/editing/position_iterator.h b/third_party/blink/renderer/core/editing/position_iterator.h index 4afd7d4a..dd34915 100644 --- a/third_party/blink/renderer/core/editing/position_iterator.h +++ b/third_party/blink/renderer/core/editing/position_iterator.h
@@ -62,9 +62,6 @@ Node* GetNode() const { return anchor_node_; } - // Returns true if current position is before `node`. - bool IsBeforeNode(const Node& node) const; - int OffsetInTextNode() const { DCHECK(anchor_node_->IsTextNode()); return offset_in_anchor_;
diff --git a/third_party/blink/renderer/core/editing/position_iterator_test.cc b/third_party/blink/renderer/core/editing/position_iterator_test.cc index ae265ea..133380f 100644 --- a/third_party/blink/renderer/core/editing/position_iterator_test.cc +++ b/third_party/blink/renderer/core/editing/position_iterator_test.cc
@@ -71,7 +71,7 @@ os << "@" << it.OffsetInTextNode(); } else if (EditingIgnoresContent(*it.GetNode()) || IsUserSelectContain(*it.GetNode())) { - os << "@" << (it.IsBeforeNode(*it.GetNode()) ? "0" : "1"); + os << "@" << (it.AtStartOfNode() ? "0" : "1"); } os << " " << position1; if (position1 != position2) @@ -130,7 +130,7 @@ ElementsAre( "---E BODY BODY@afterChildren", "---E INPUT id=\"target\"@1 INPUT id=\"target\"@afterAnchor", - "---E INPUT id=\"target\"@0 INPUT id=\"target\"@beforeAnchor INPUT " + "-S-E INPUT id=\"target\"@0 INPUT id=\"target\"@beforeAnchor INPUT " "id=\"target\"@afterAnchor", "---- BODY BODY@offsetInAnchor[1]", "---E #text \"123\"@3 #text \"123\"@offsetInAnchor[3]", @@ -152,7 +152,7 @@ ElementsAre( "---E BODY BODY@afterChildren", "---E SELECT id=\"target\"@1 SELECT id=\"target\"@afterAnchor", - "---E SELECT id=\"target\"@0 SELECT id=\"target\"@beforeAnchor " + "-S-E SELECT id=\"target\"@0 SELECT id=\"target\"@beforeAnchor " "SELECT id=\"target\"@afterAnchor", "---- BODY BODY@offsetInAnchor[1]", "---E #text \"123\"@3 #text \"123\"@offsetInAnchor[3]", @@ -169,7 +169,7 @@ ElementsAre( "---E BODY BODY@afterChildren", "---E SELECT id=\"target\"@1 SELECT id=\"target\"@afterAnchor", - "---E SELECT id=\"target\"@0 SELECT id=\"target\"@beforeAnchor " + "-S-E SELECT id=\"target\"@0 SELECT id=\"target\"@beforeAnchor " "SELECT id=\"target\"@afterAnchor", "---- BODY BODY@offsetInAnchor[1]", "---E #text \"123\"@3 #text \"123\"@offsetInAnchor[3]", @@ -191,7 +191,7 @@ ElementsAre( "---E BODY BODY@afterChildren", "---E TEXTAREA id=\"target\"@1 TEXTAREA id=\"target\"@afterAnchor", - "---E TEXTAREA id=\"target\"@0 TEXTAREA id=\"target\"@beforeAnchor " + "-S-E TEXTAREA id=\"target\"@0 TEXTAREA id=\"target\"@beforeAnchor " "TEXTAREA id=\"target\"@afterAnchor", "---- BODY BODY@offsetInAnchor[1]", "---E #text \"123\"@3 #text \"123\"@offsetInAnchor[3]", @@ -208,7 +208,7 @@ ElementsAre( "---E BODY BODY@afterChildren", "---E TEXTAREA id=\"target\"@1 TEXTAREA id=\"target\"@afterAnchor", - "---E TEXTAREA id=\"target\"@0 TEXTAREA id=\"target\"@beforeAnchor " + "-S-E TEXTAREA id=\"target\"@0 TEXTAREA id=\"target\"@beforeAnchor " "TEXTAREA id=\"target\"@afterAnchor", "---- BODY BODY@offsetInAnchor[1]", "---E #text \"123\"@3 #text \"123\"@offsetInAnchor[3]", @@ -241,7 +241,7 @@ EXPECT_THAT( ScanForwardInFlatTree(selection_text), ElementsAre("-S-- BODY BODY@offsetInAnchor[0]", - "---E INPUT id=\"target\"@0 INPUT id=\"target\"@beforeAnchor " + "-S-E INPUT id=\"target\"@0 INPUT id=\"target\"@beforeAnchor " "INPUT id=\"target\"@afterAnchor", "---E INPUT id=\"target\"@1 INPUT id=\"target\"@afterAnchor", "---- BODY BODY@offsetInAnchor[1]", @@ -261,7 +261,7 @@ ScanForward(selection_text), ElementsAre( "-S-- BODY BODY@offsetInAnchor[0]", - "---E SELECT id=\"target\"@0 SELECT id=\"target\"@beforeAnchor " + "-S-E SELECT id=\"target\"@0 SELECT id=\"target\"@beforeAnchor " "SELECT id=\"target\"@afterAnchor", "---E SELECT id=\"target\"@1 SELECT id=\"target\"@afterAnchor", "---- BODY BODY@offsetInAnchor[1]", @@ -275,7 +275,7 @@ ScanForwardInFlatTree(selection_text), ElementsAre( "-S-- BODY BODY@offsetInAnchor[0]", - "---E SELECT id=\"target\"@0 SELECT id=\"target\"@beforeAnchor " + "-S-E SELECT id=\"target\"@0 SELECT id=\"target\"@beforeAnchor " "SELECT id=\"target\"@afterAnchor", "---E SELECT id=\"target\"@1 SELECT id=\"target\"@afterAnchor", "---- BODY BODY@offsetInAnchor[1]", @@ -294,7 +294,7 @@ ScanForward(selection_text), ElementsAre( "-S-- BODY BODY@offsetInAnchor[0]", - "---E TEXTAREA id=\"target\"@0 TEXTAREA id=\"target\"@beforeAnchor " + "-S-E TEXTAREA id=\"target\"@0 TEXTAREA id=\"target\"@beforeAnchor " "TEXTAREA id=\"target\"@afterAnchor", "---E TEXTAREA id=\"target\"@1 TEXTAREA id=\"target\"@afterAnchor", "---- BODY BODY@offsetInAnchor[1]", @@ -308,7 +308,7 @@ ScanForwardInFlatTree(selection_text), ElementsAre( "-S-- BODY BODY@offsetInAnchor[0]", - "---E TEXTAREA id=\"target\"@0 TEXTAREA id=\"target\"@beforeAnchor " + "-S-E TEXTAREA id=\"target\"@0 TEXTAREA id=\"target\"@beforeAnchor " "TEXTAREA id=\"target\"@afterAnchor", "---E TEXTAREA id=\"target\"@1 TEXTAREA id=\"target\"@afterAnchor", "---- BODY BODY@offsetInAnchor[1]",
diff --git a/third_party/blink/renderer/core/editing/visible_units.cc b/third_party/blink/renderer/core/editing/visible_units.cc index 7e1603ef..417b757c 100644 --- a/third_party/blink/renderer/core/editing/visible_units.cc +++ b/third_party/blink/renderer/core/editing/visible_units.cc
@@ -943,7 +943,7 @@ // ignored. if (EditingIgnoresContent(*current_node) || IsDisplayInsideTable(current_node)) { - if (current_pos.IsBeforeNode(*current_node)) + if (current_pos.AtStartOfNode()) return PositionTemplate<Strategy>::EditingPositionOf(current_node, 0); continue; }
diff --git a/third_party/blink/renderer/core/editing/visible_units_test.cc b/third_party/blink/renderer/core/editing/visible_units_test.cc index c4429c2..05184e2 100644 --- a/third_party/blink/renderer/core/editing/visible_units_test.cc +++ b/third_party/blink/renderer/core/editing/visible_units_test.cc
@@ -1039,8 +1039,7 @@ EXPECT_EQ(Position(table, 0), MostForwardCaretPosition(Position::FirstPositionInNode(table))); EXPECT_EQ(Position(table, 0), MostForwardCaretPosition(Position(table, 0))); - // The result should be `Position(table, 1)`. - EXPECT_EQ(Position(table, 0), MostForwardCaretPosition(Position(table, 1))); + EXPECT_EQ(Position(table, 1), MostForwardCaretPosition(Position(table, 1))); EXPECT_EQ(Position::BeforeNode(img1), MostForwardCaretPosition(Position::BeforeNode(tbody))); EXPECT_EQ(Position::BeforeNode(img1), @@ -1055,8 +1054,7 @@ MostForwardCaretPosition(Position::LastPositionInNode(tbody))); EXPECT_EQ(Position::LastPositionInNode(tbody), MostForwardCaretPosition(Position::AfterNode(tbody))); - // The result should be `Position(table, 2)`. - EXPECT_EQ(Position(table, 0), MostForwardCaretPosition(Position(table, 2))); + EXPECT_EQ(Position(table, 2), MostForwardCaretPosition(Position(table, 2))); EXPECT_EQ(Position::LastPositionInNode(table), MostForwardCaretPosition(Position(table, 3))); EXPECT_EQ(Position::LastPositionInNode(table),
diff --git a/third_party/blink/renderer/core/frame/local_frame_view.cc b/third_party/blink/renderer/core/frame/local_frame_view.cc index 0c97370..efcc10a3 100644 --- a/third_party/blink/renderer/core/frame/local_frame_view.cc +++ b/third_party/blink/renderer/core/frame/local_frame_view.cc
@@ -2419,7 +2419,7 @@ { // We need scoping braces here because this // DisallowLayoutInvalidationScope is meant to be in effect during - // pre-paint, but not during ResizeObserver. + // pre-paint, but not during ResizeObserver or ViewTransition. #if DCHECK_IS_ON() DisallowLayoutInvalidationScope disallow_layout_invalidation(this); #endif @@ -2439,11 +2439,20 @@ return; run_more_lifecycle_phases = RunPrePaintLifecyclePhase(target_state); + } + + if (!run_more_lifecycle_phases) { + // If we won't be proceeding to paint, update view transition stylesheet + // here. + bool needs_to_repeat_lifecycle = RunViewTransitionSteps(target_state); + if (needs_to_repeat_lifecycle) + continue; + } + DCHECK(ShouldThrottleRendering() || Lifecycle().GetState() >= DocumentLifecycle::kPrePaintClean); if (ShouldThrottleRendering() || !run_more_lifecycle_phases) return; - } // Some features may require several passes over style and layout // within the same lifecycle update. @@ -2539,23 +2548,29 @@ bool LocalFrameView::RunViewTransitionSteps( DocumentLifecycle::LifecycleState target_state) { DCHECK(frame_ && frame_->GetDocument()); - DCHECK(frame_->IsLocalRoot()); + DCHECK(frame_->IsLocalRoot() || !IsAttached()); - if (target_state != DocumentLifecycle::kPaintClean) + if (target_state < DocumentLifecycle::kPrePaintClean) return false; bool re_run_lifecycle = false; ForAllNonThrottledLocalFrameViews( - [&re_run_lifecycle](LocalFrameView& frame_view) { + [&re_run_lifecycle, target_state](LocalFrameView& frame_view) { const auto* document = frame_view.GetFrame().GetDocument(); if (!document) return; + DCHECK_GE(document->Lifecycle().GetState(), + DocumentLifecycle::kPrePaintClean); auto* transition = ViewTransitionUtils::GetActiveTransition(*document); if (!transition) return; - transition->RunViewTransitionStepsDuringMainFrame(); + if (target_state == DocumentLifecycle::kPaintClean) + transition->RunViewTransitionStepsDuringMainFrame(); + else + transition->RunViewTransitionStepsOutsideMainFrame(); + re_run_lifecycle |= document->Lifecycle().GetState() < DocumentLifecycle::kPrePaintClean; }); @@ -3129,15 +3144,6 @@ }); } -void LocalFrameView::VerifySharedElementsForViewTransition() { - DCHECK(frame_ && frame_->GetDocument()); - - if (auto* transition = - ViewTransitionUtils::GetActiveTransition(*frame_->GetDocument())) { - transition->VerifySharedElements(); - } -} - std::unique_ptr<JSONObject> LocalFrameView::CompositedLayersAsJSON( LayerTreeFlags flags) { auto* root_frame_view = GetFrame().LocalFrameRoot().View(); @@ -3207,14 +3213,6 @@ GetFrame().Selection().UpdateStyleAndLayoutIfNeeded(); GetFrame().GetPage()->GetDragCaret().UpdateStyleAndLayoutIfNeeded(); - - // If we're running the lifecycle with intent of painting, we need to - // verify the view transitions, since any requests will be - // propagated to the compositor. - if (GetFrame().LocalFrameRoot().View()->target_state_ == - DocumentLifecycle::kPaintClean) { - VerifySharedElementsForViewTransition(); - } } void LocalFrameView::UpdateStyleAndLayout() {
diff --git a/third_party/blink/renderer/core/frame/local_frame_view.h b/third_party/blink/renderer/core/frame/local_frame_view.h index 9d42bcd..4ef16aea 100644 --- a/third_party/blink/renderer/core/frame/local_frame_view.h +++ b/third_party/blink/renderer/core/frame/local_frame_view.h
@@ -772,6 +772,8 @@ bool RemovePendingOpacityUpdate(const LayoutObject& object); bool UpdateAllPendingOpacityUpdates(); + void ForAllChildLocalFrameViews(base::FunctionRef<void(LocalFrameView&)>); + protected: void FrameRectsChanged(const gfx::Rect&) override; void SelfVisibleChanged() override; @@ -946,7 +948,6 @@ void ForAllChildViewsAndPlugins( base::FunctionRef<void(EmbeddedContentView&)>); - void ForAllChildLocalFrameViews(base::FunctionRef<void(LocalFrameView&)>); enum TraversalOrder { kPreOrder, kPostOrder }; void ForAllNonThrottledLocalFrameViews(
diff --git a/third_party/blink/renderer/core/layout/ng/inline/ng_line_breaker.cc b/third_party/blink/renderer/core/layout/ng/inline/ng_line_breaker.cc index ba670f29..6765d0b 100644 --- a/third_party/blink/renderer/core/layout/ng/inline/ng_line_breaker.cc +++ b/third_party/blink/renderer/core/layout/ng/inline/ng_line_breaker.cc
@@ -9,6 +9,7 @@ #include "third_party/blink/renderer/core/layout/ng/inline/layout_ng_text_combine.h" #include "third_party/blink/renderer/core/layout/ng/inline/ng_bidi_paragraph.h" #include "third_party/blink/renderer/core/layout/ng/inline/ng_inline_break_token.h" +#include "third_party/blink/renderer/core/layout/ng/inline/ng_inline_item_segment.h" #include "third_party/blink/renderer/core/layout/ng/inline/ng_inline_node.h" #include "third_party/blink/renderer/core/layout/ng/inline/ng_line_info.h" #include "third_party/blink/renderer/core/layout/ng/inline/ng_ruby_utils.h" @@ -1436,7 +1437,7 @@ scoped_refptr<ShapeResult> shape_result; if (!items_data_.segments) { RunSegmenter::RunSegmenterRange segment_range = - item.CreateRunSegmenterRange(); + NGInlineItemSegment::UnpackSegmentData(start, end, item.SegmentData()); shape_result = shaper_.Shape(&item.Style()->GetFont(), item.Direction(), start, end, segment_range); } else {
diff --git a/third_party/blink/renderer/core/view_transition/view_transition.cc b/third_party/blink/renderer/core/view_transition/view_transition.cc index 8e0009a..1d0db2a 100644 --- a/third_party/blink/renderer/core/view_transition/view_transition.cc +++ b/third_party/blink/renderer/core/view_transition/view_transition.cc
@@ -13,11 +13,12 @@ #include "third_party/blink/renderer/bindings/core/v8/capture_source_location.h" #include "third_party/blink/renderer/bindings/core/v8/script_function.h" #include "third_party/blink/renderer/bindings/core/v8/script_promise.h" -#include "third_party/blink/renderer/bindings/core/v8/script_promise_resolver.h" +#include "third_party/blink/renderer/bindings/core/v8/script_promise_property.h" #include "third_party/blink/renderer/bindings/core/v8/script_value.h" #include "third_party/blink/renderer/bindings/core/v8/v8_throw_dom_exception.h" #include "third_party/blink/renderer/core/css/style_change_reason.h" #include "third_party/blink/renderer/core/dom/document.h" +#include "third_party/blink/renderer/core/dom/dom_exception.h" #include "third_party/blink/renderer/core/dom/dom_node_ids.h" #include "third_party/blink/renderer/core/dom/pseudo_element.h" #include "third_party/blink/renderer/core/events/error_event.h" @@ -47,36 +48,25 @@ namespace { const char kAbortedMessage[] = "Transition was skipped"; +const char kInvalidStateMessage[] = + "Transition was aborted because of invalid state"; +const char kTimeoutMessage[] = + "Transition was aborted because of timeout in DOM update"; uint32_t NextDocumentTag() { static uint32_t next_document_tag = 1u; return next_document_tag++; } -void RejectWithAbort(ScriptPromiseResolver* resolver) { - auto* script_state = resolver->GetScriptState(); - if (!script_state->ContextIsValid()) - return; - - ScriptState::Scope scope(script_state); - resolver->Reject(V8ThrowDOMException::CreateOrEmpty( - script_state->GetIsolate(), DOMExceptionCode::kAbortError, - kAbortedMessage)); -} - -void Resolve(ScriptPromiseResolver* resolver) { - resolver->Resolve(); -} - } // namespace // DOMChangeFinishedCallback implementation. ViewTransition::DOMChangeFinishedCallback::DOMChangeFinishedCallback( ViewTransition* transition, - ScriptPromiseResolver* dom_updated_promise_resolver, bool success) - : transition_(transition), - dom_updated_promise_resolver_(dom_updated_promise_resolver), - success_(success) {} + : transition_(transition), success_(success) { + DCHECK(transition_); + DCHECK(transition_->script_bound_state_); +} ViewTransition::DOMChangeFinishedCallback::~DOMChangeFinishedCallback() = default; @@ -84,40 +74,68 @@ ScriptValue ViewTransition::DOMChangeFinishedCallback::Call( ScriptState* script_state, ScriptValue value) { - if (transition_) - transition_->NotifyDOMCallbackFinished(success_); - - if (success_) - dom_updated_promise_resolver_->Resolve(); - else - dom_updated_promise_resolver_->Reject(value); + transition_->NotifyDOMCallbackFinished(success_, std::move(value)); return ScriptValue(); } void ViewTransition::DOMChangeFinishedCallback::Trace(Visitor* visitor) const { ScriptFunction::Callable::Trace(visitor); visitor->Trace(transition_); - visitor->Trace(dom_updated_promise_resolver_); } ViewTransition::ScriptBoundState::ScriptBoundState( + ExecutionContext* context, ScriptState* state, V8ViewTransitionCallback* callback) : script_state(state), update_dom_callback(callback), - dom_updated_promise_resolver( - MakeGarbageCollected<ScriptPromiseResolver>(script_state)), - ready_promise_resolver( - MakeGarbageCollected<ScriptPromiseResolver>(script_state)), - finished_promise_resolver( - MakeGarbageCollected<ScriptPromiseResolver>(script_state)) {} + dom_updated_promise_property( + MakeGarbageCollected<PromiseProperty>(context)), + ready_promise_property(MakeGarbageCollected<PromiseProperty>(context)), + finished_promise_property( + MakeGarbageCollected<PromiseProperty>(context)) {} void ViewTransition::ScriptBoundState::Trace(Visitor* visitor) const { visitor->Trace(script_state); visitor->Trace(update_dom_callback); - visitor->Trace(dom_updated_promise_resolver); - visitor->Trace(ready_promise_resolver); - visitor->Trace(finished_promise_resolver); + visitor->Trace(dom_updated_promise_property); + visitor->Trace(ready_promise_property); + visitor->Trace(finished_promise_property); +} + +void ViewTransition::ScriptBoundState::HandlePromise( + Response response, + PromiseProperty* property) { + DCHECK_EQ(property->GetState(), PromiseProperty::State::kPending); + if (!script_state->ContextIsValid()) + return; + + switch (response) { + case Response::kResolve: + property->ResolveWithUndefined(); + break; + case Response::kRejectAbort: { + ScriptState::Scope scope(script_state); + property->Reject(V8ThrowDOMException::CreateOrEmpty( + script_state->GetIsolate(), DOMExceptionCode::kAbortError, + kAbortedMessage)); + break; + } + case Response::kRejectInvalidState: { + ScriptState::Scope scope(script_state); + property->Reject(V8ThrowDOMException::CreateOrEmpty( + script_state->GetIsolate(), DOMExceptionCode::kInvalidStateError, + kInvalidStateMessage)); + break; + } + case Response::kRejectTimeout: { + ScriptState::Scope scope(script_state); + property->Reject(V8ThrowDOMException::CreateOrEmpty( + script_state->GetIsolate(), DOMExceptionCode::kTimeoutError, + kTimeoutMessage)); + break; + } + } } ViewTransition::ScopedPauseRendering::ScopedPauseRendering( @@ -194,7 +212,8 @@ delegate_(delegate), document_tag_(NextDocumentTag()), script_bound_state_( - MakeGarbageCollected<ScriptBoundState>(script_state, + MakeGarbageCollected<ScriptBoundState>(GetExecutionContext(), + script_state, update_dom_callback)), style_tracker_( MakeGarbageCollected<ViewTransitionStyleTracker>(*document_)) { @@ -256,26 +275,53 @@ } void ViewTransition::skipTransition() { + SkipTransitionInternal(ScriptBoundState::Response::kRejectAbort); +} + +void ViewTransition::SkipTransitionInternal( + ScriptBoundState::Response response) { + DCHECK_NE(response, ScriptBoundState::Response::kResolve); if (IsTerminalState(state_)) return; - // If we haven't run the dom change callback yet, schedule a task to do so. - if (creation_type_ == CreationType::kScript && - static_cast<int>(state_) < static_cast<int>(State::kDOMCallbackRunning)) { - document_->GetTaskRunner(TaskType::kMiscPlatformAPI) - ->PostTask(FROM_HERE, - WTF::BindOnce(base::IgnoreResult( - &ViewTransition::InvokeDOMChangeCallback), - WrapPersistent(this))); - } + // Cleanup logic which is tied to ViewTransition objects created using the + // script API. If |context_destroyed_| is false the Document is being torn + // down and the script specific callbacks don't need to be dispatched. + if (!context_destroyed_ && creation_type_ == CreationType::kScript) { + DCHECK(script_bound_state_); - // If the ready promise has not yet been resolved, reject it. Note that the if - // check here is an optimization to avoid creating the kAbort error if we've - // already resolved the promise. - if (creation_type_ == CreationType::kScript && - static_cast<int>(state_) < - static_cast<int>(State::kAnimateRequestPending)) { - AtMicrotask(&RejectWithAbort, script_bound_state_->ready_promise_resolver); + // If the ready promise has not yet been resolved, reject it. + if (script_bound_state_->ready_promise_property->GetState() == + PromiseProperty::State::kPending) { + AtMicrotask(response, script_bound_state_->ready_promise_property); + } + + // If we haven't run the dom change callback yet, schedule a task to do so. + // The finished promise will propagate the result of the domUpdated promise + // when this callback runs. + if (static_cast<int>(state_) < + static_cast<int>(State::kDOMCallbackRunning)) { + DCHECK(!dom_callback_succeeded_); + document_->GetTaskRunner(TaskType::kMiscPlatformAPI) + ->PostTask( + FROM_HERE, + WTF::BindOnce( + base::IgnoreResult(&ViewTransition::InvokeDOMChangeCallback), + WrapPersistent(this))); + } else if (static_cast<int>(state_) >= + static_cast<int>(State::kDOMCallbackFinished)) { + // If the DOM callback finished and there was a failure then the finished + // promise should have been rejected with domUpdated. + if (!dom_callback_succeeded_) { + DCHECK_EQ(script_bound_state_->finished_promise_property->GetState(), + PromiseProperty::State::kRejected); + } else { + // But if the callback was successful, we need to resolve the finished + // promise while skipping the transition. + AtMicrotask(ScriptBoundState::Response::kResolve, + script_bound_state_->finished_promise_property); + } + } } // If we already started processing the transition (i.e. we're beyond capture @@ -290,11 +336,6 @@ ResumeRendering(); style_tracker_->Abort(); - if (creation_type_ == CreationType::kScript) { - AtMicrotask(&RejectWithAbort, - script_bound_state_->finished_promise_resolver); - } - delegate_->OnTransitionFinished(this); // This should be the last call in this function to avoid erroneously checking @@ -304,17 +345,20 @@ ScriptPromise ViewTransition::finished() const { DCHECK(script_bound_state_); - return script_bound_state_->finished_promise_resolver->Promise(); + return script_bound_state_->finished_promise_property->Promise( + script_bound_state_->script_state->World()); } ScriptPromise ViewTransition::ready() const { DCHECK(script_bound_state_); - return script_bound_state_->ready_promise_resolver->Promise(); + return script_bound_state_->ready_promise_property->Promise( + script_bound_state_->script_state->World()); } ScriptPromise ViewTransition::domUpdated() const { DCHECK(script_bound_state_); - return script_bound_state_->dom_updated_promise_resolver->Promise(); + return script_bound_state_->dom_updated_promise_property->Promise( + script_bound_state_->script_state->World()); } bool ViewTransition::AdvanceTo(State state) { @@ -460,7 +504,8 @@ // Capture request pending -- create the request case State::kCaptureRequestPending: if (!style_tracker_->Capture()) { - skipTransition(); + SkipTransitionInternal( + ScriptBoundState::Response::kRejectInvalidState); break; } @@ -509,25 +554,23 @@ // created by the script API. DCHECK(script_bound_state_); - // TODO(vmpstr): Maybe fold this into InvokeDOMChangeCallback somehow. - if (!script_bound_state_->update_dom_callback) { - AtMicrotask(&Resolve, - script_bound_state_->dom_updated_promise_resolver); - - dom_callback_succeeded_ = true; - process_next_state = AdvanceTo(State::kDOMCallbackFinished); - DCHECK(process_next_state); - break; + switch (InvokeDOMChangeCallback()) { + case DOMCallbackResult::kFinished: + process_next_state = AdvanceTo(State::kDOMCallbackFinished); + DCHECK(process_next_state); + DCHECK(dom_callback_succeeded_); + break; + case DOMCallbackResult::kFailed: + process_next_state = AdvanceTo(State::kDOMCallbackFinished); + DCHECK(process_next_state); + DCHECK(!dom_callback_succeeded_); + SkipTransitionInternal(ScriptBoundState::Response::kRejectAbort); + break; + case DOMCallbackResult::kRunning: + process_next_state = AdvanceTo(State::kDOMCallbackRunning); + DCHECK(process_next_state); + break; } - - if (!InvokeDOMChangeCallback()) { - AtMicrotask(&RejectWithAbort, - script_bound_state_->dom_updated_promise_resolver); - skipTransition(); - break; - } - process_next_state = AdvanceTo(State::kDOMCallbackRunning); - DCHECK(process_next_state); break; } @@ -542,7 +585,7 @@ case State::kDOMCallbackFinished: ResumeRendering(); if (!dom_callback_succeeded_) { - skipTransition(); + SkipTransitionInternal(ScriptBoundState::Response::kRejectAbort); break; } process_next_state = AdvanceTo(State::kAnimateTagDiscovery); @@ -562,7 +605,8 @@ case State::kAnimateRequestPending: if (!style_tracker_->Start()) { - skipTransition(); + SkipTransitionInternal( + ScriptBoundState::Response::kRejectInvalidState); break; } @@ -573,8 +617,10 @@ DCHECK(!process_next_state); DCHECK(!in_main_lifecycle_update_); - if (creation_type_ == CreationType::kScript) - AtMicrotask(&Resolve, script_bound_state_->ready_promise_resolver); + if (creation_type_ == CreationType::kScript) { + AtMicrotask(ScriptBoundState::Response::kResolve, + script_bound_state_->ready_promise_property); + } break; case State::kAnimating: { @@ -588,8 +634,10 @@ style_tracker_->StartFinished(); - if (creation_type_ == CreationType::kScript) - AtMicrotask(&Resolve, script_bound_state_->finished_promise_resolver); + if (creation_type_ == CreationType::kScript) { + AtMicrotask(ScriptBoundState::Response::kResolve, + script_bound_state_->finished_promise_property); + } delegate_->AddPendingRequest( ViewTransitionRequest::CreateRelease(document_tag_)); @@ -619,37 +667,54 @@ ExecutionContextLifecycleObserver::Trace(visitor); } -bool ViewTransition::InvokeDOMChangeCallback() { +ViewTransition::DOMCallbackResult ViewTransition::InvokeDOMChangeCallback() { DCHECK(script_bound_state_); - if (!script_bound_state_->update_dom_callback) - return true; + if (!script_bound_state_->update_dom_callback) { + dom_callback_succeeded_ = true; + AtMicrotask(ScriptBoundState::Response::kResolve, + script_bound_state_->dom_updated_promise_property); + + // If we're already at the terminal state, the dom update callback was + // scheduled to run after the transition was skipped. + if (IsDone()) { + AtMicrotask(ScriptBoundState::Response::kResolve, + script_bound_state_->finished_promise_property); + } + return DOMCallbackResult::kFinished; + } v8::Maybe<ScriptPromise> result = script_bound_state_->update_dom_callback->Invoke(nullptr); + // TODO(vmpstr): Should this be a DCHECK? - if (result.IsNothing()) - return false; + if (result.IsNothing()) { + dom_callback_succeeded_ = false; + AtMicrotask(ScriptBoundState::Response::kRejectAbort, + script_bound_state_->dom_updated_promise_property); + AtMicrotask(ScriptBoundState::Response::kRejectAbort, + script_bound_state_->finished_promise_property); + return DOMCallbackResult::kFailed; + } ScriptState::Scope scope(script_bound_state_->script_state); result.ToChecked().Then( MakeGarbageCollected<ScriptFunction>( script_bound_state_->script_state, - MakeGarbageCollected<DOMChangeFinishedCallback>( - this, script_bound_state_->dom_updated_promise_resolver, true)), + MakeGarbageCollected<DOMChangeFinishedCallback>(this, true)), MakeGarbageCollected<ScriptFunction>( script_bound_state_->script_state, - MakeGarbageCollected<DOMChangeFinishedCallback>( - this, script_bound_state_->dom_updated_promise_resolver, false))); - return true; + MakeGarbageCollected<DOMChangeFinishedCallback>(this, false))); + return DOMCallbackResult::kRunning; } void ViewTransition::ContextDestroyed() { TRACE_EVENT0("blink", "ViewTransition::ContextDestroyed"); // TODO(khushalsagar): This needs to be called for pages entering BFCache. - skipTransition(); + context_destroyed_ = true; + SkipTransitionInternal(ScriptBoundState::Response::kRejectAbort); } bool ViewTransition::HasPendingActivity() const { @@ -666,7 +731,29 @@ ProcessCurrentState(); } -void ViewTransition::NotifyDOMCallbackFinished(bool success) { +void ViewTransition::NotifyDOMCallbackFinished(bool success, + ScriptValue value) { + // Handle all promises which depend on this callback. + if (success) { + script_bound_state_->dom_updated_promise_property->ResolveWithUndefined(); + + // If we're already at the terminal state, the transition was skipped before + // the callback finished. Also handle the finish promise. + if (IsDone()) + script_bound_state_->finished_promise_property->ResolveWithUndefined(); + } else { + script_bound_state_->dom_updated_promise_property->Reject(value.V8Value()); + + // The ready promise rejects with the value of domUpdated callback if it's + // skipped because of an error in the callback. + if (!IsDone()) + script_bound_state_->ready_promise_property->Reject(value.V8Value()); + + // If the domUpdate callback fails the transition is skipped. The finish + // promise should mirror the result of domUpdated. + script_bound_state_->finished_promise_property->Reject(value.V8Value()); + } + dom_callback_succeeded_ = success; if (IsTerminalState(state_)) return; @@ -751,18 +838,30 @@ return style_tracker_->GetEffect(element); } -void ViewTransition::VerifySharedElements() { - if (!IsTerminalState(state_)) - style_tracker_->VerifySharedElements(); +void ViewTransition::RunViewTransitionStepsOutsideMainFrame() { + DCHECK(document_->Lifecycle().GetState() >= + DocumentLifecycle::kPrePaintClean); + DCHECK(!in_main_lifecycle_update_); + + if (state_ == State::kAnimating && style_tracker_ && + !style_tracker_->RunPostPrePaintSteps()) { + SkipTransitionInternal(ScriptBoundState::Response::kRejectInvalidState); + } } void ViewTransition::RunViewTransitionStepsDuringMainFrame() { + DCHECK_GE(document_->Lifecycle().GetState(), + DocumentLifecycle::kPrePaintClean); + DCHECK(!in_main_lifecycle_update_); + base::AutoReset<bool> scope(&in_main_lifecycle_update_, true); if (StateRunsInViewTransitionStepsDuringMainFrame(state_)) ProcessCurrentState(); + if (style_tracker_ && - document_->Lifecycle().GetState() >= DocumentLifecycle::kPrePaintClean) { - style_tracker_->RunPostPrePaintSteps(); + document_->Lifecycle().GetState() >= DocumentLifecycle::kPrePaintClean && + !style_tracker_->RunPostPrePaintSteps()) { + SkipTransitionInternal(ScriptBoundState::Response::kRejectInvalidState); } } @@ -843,7 +942,7 @@ return; ResumeRendering(); - skipTransition(); + SkipTransitionInternal(ScriptBoundState::Response::kRejectTimeout); AdvanceTo(State::kTimedOut); } @@ -856,10 +955,12 @@ rendering_paused_scope_.reset(); } -void ViewTransition::AtMicrotask(void callback(ScriptPromiseResolver*), - ScriptPromiseResolver* resolver) { +void ViewTransition::AtMicrotask(ScriptBoundState::Response response, + PromiseProperty* property) { document_->GetAgent().event_loop()->EnqueueMicrotask( - WTF::BindOnce(callback, WrapPersistent(resolver))); + WTF::BindOnce(&ViewTransition::ScriptBoundState::HandlePromise, + WrapPersistent(script_bound_state_.Get()), response, + WrapPersistent(property))); } void ViewTransition::WillBeginMainFrame() {
diff --git a/third_party/blink/renderer/core/view_transition/view_transition.h b/third_party/blink/renderer/core/view_transition/view_transition.h index 0e4e6a3..29c1b88 100644 --- a/third_party/blink/renderer/core/view_transition/view_transition.h +++ b/third_party/blink/renderer/core/view_transition/view_transition.h
@@ -13,6 +13,7 @@ #include "third_party/blink/public/common/frame/view_transition_state.h" #include "third_party/blink/renderer/bindings/core/v8/active_script_wrappable.h" #include "third_party/blink/renderer/bindings/core/v8/script_function.h" +#include "third_party/blink/renderer/bindings/core/v8/script_promise_property.h" #include "third_party/blink/renderer/bindings/core/v8/script_value.h" #include "third_party/blink/renderer/bindings/core/v8/v8_view_transition_callback.h" #include "third_party/blink/renderer/core/core_export.h" @@ -38,7 +39,6 @@ class LayoutObject; class PseudoElement; class ScriptPromise; -class ScriptPromiseResolver; class ScriptState; class CORE_EXPORT ViewTransition : public ScriptWrappable, @@ -121,10 +121,10 @@ // Returns the effect. One needs to first call UpdateEffect(). EffectPaintPropertyNode* GetEffect(const LayoutObject& object) const; - // We require shared elements to be contained. This check verifies that and - // removes it from the shared list if it isn't. See - // https://github.com/vmpstr/view-transitions/issues/17 - void VerifySharedElements(); + // Dispatched during a lifecycle update after prepaint has finished its work. + // This is only done if the lifecycle update was triggered outside of a main + // frame. For example by a script API like getComputedStyle. + void RunViewTransitionStepsOutsideMainFrame(); // Dispatched during a lifecycle update after prepaint has finished its work. // This is only done if we're in the main lifecycle update that will produce @@ -189,6 +189,9 @@ friend class ViewTransitionTest; friend class AXViewTransitionTest; + using PromiseProperty = + ScriptPromiseProperty<ToV8UndefinedGenerator, v8::Local<v8::Value>>; + // Tracks how the ViewTransition object was created. enum class CreationType { // Created via the document.startViewTransition() script API. @@ -236,6 +239,30 @@ }; static const char* StateToString(State state); + // State which is created only when ViewTransition is accessed from + // script. + struct ScriptBoundState : public GarbageCollected<ScriptBoundState> { + ScriptBoundState(ExecutionContext* context, + ScriptState*, + V8ViewTransitionCallback*); + + // Indicates how the promise should be handled. + enum class Response { + kResolve, + kRejectAbort, + kRejectInvalidState, + kRejectTimeout + }; + void HandlePromise(Response response, PromiseProperty* property); + void Trace(Visitor* visitor) const; + + Member<ScriptState> script_state; + Member<V8ViewTransitionCallback> update_dom_callback; + Member<PromiseProperty> dom_updated_promise_property; + Member<PromiseProperty> ready_promise_property; + Member<PromiseProperty> finished_promise_property; + }; + // Advance to the new state. This returns true if the state should be // processed immediately. bool AdvanceTo(State state); @@ -256,20 +283,15 @@ // Invoked when ViewTransitionCallback finishes running. class DOMChangeFinishedCallback : public ScriptFunction::Callable { public: - explicit DOMChangeFinishedCallback( - ViewTransition* transition, - ScriptPromiseResolver* dom_updated_promise_resolver, - bool success); + explicit DOMChangeFinishedCallback(ViewTransition* transition, + bool success); ~DOMChangeFinishedCallback() override; ScriptValue Call(ScriptState*, ScriptValue) override; void Trace(Visitor* visitor) const override; - void Cancel(); - private: - WeakMember<ViewTransition> transition_; - Member<ScriptPromiseResolver> dom_updated_promise_resolver_; + Member<ViewTransition> transition_; const bool success_; }; @@ -277,7 +299,7 @@ // Dispatched when the ViewTransitionCallback has finished executing and // start phase of the animation can be initiated. - void NotifyDOMCallbackFinished(bool success); + void NotifyDOMCallbackFinished(bool success, ScriptValue value); // Used to defer visual updates between transition prepare dispatching and // transition start to allow the page to set up the final scene @@ -286,14 +308,20 @@ void OnRenderingPausedTimeout(); void ResumeRendering(); - // Returns true if we invoked the callback and the result was not nothing, - // and false otherwise. False would be returned if we failed to run the - // callback (the result was "Nothing"). Note that this returns true if there - // is no dom callback, since effectively we called "noop". - bool InvokeDOMChangeCallback(); + // Returns the result of invoking the callback. + // kFailed: Indicates that there was a failure in running the callback and the + // transition should be skipped. + // kFinished: Indicates that there was no callback to run so we can move to + // finished state synchronously. + // kRunning: Indicates that the callback is in running state. Note that even + // if the callback is synchronous, the notification that it has + // finished running is async. + enum class DOMCallbackResult { kFailed, kFinished, kRunning }; + DOMCallbackResult InvokeDOMChangeCallback(); - void AtMicrotask(void callback(ScriptPromiseResolver*), - ScriptPromiseResolver* resolver); + void AtMicrotask(ScriptBoundState::Response response, + PromiseProperty* resolver); + void SkipTransitionInternal(ScriptBoundState::Response response); State state_ = State::kInitial; const CreationType creation_type_; @@ -306,20 +334,6 @@ // belongs. It's unique among other local documents. uint32_t document_tag_ = 0u; - // State which is created only when ViewTransition is accessed from - // script. - struct ScriptBoundState : public GarbageCollected<ScriptBoundState> { - ScriptBoundState(ScriptState*, V8ViewTransitionCallback*); - - void Trace(Visitor* visitor) const; - - Member<ScriptState> script_state; - Member<V8ViewTransitionCallback> update_dom_callback; - Member<ScriptPromiseResolver> dom_updated_promise_resolver; - Member<ScriptPromiseResolver> ready_promise_resolver; - Member<ScriptPromiseResolver> finished_promise_resolver; - }; - Member<ScriptBoundState> script_bound_state_; Member<ViewTransitionStyleTracker> style_tracker_; @@ -348,6 +362,7 @@ bool in_main_lifecycle_update_ = false; bool dom_callback_succeeded_ = false; bool first_animating_frame_ = true; + bool context_destroyed_ = false; }; } // namespace blink
diff --git a/third_party/blink/renderer/core/view_transition/view_transition_style_tracker.cc b/third_party/blink/renderer/core/view_transition/view_transition_style_tracker.cc index 44d75c5..babd3f5 100644 --- a/third_party/blink/renderer/core/view_transition/view_transition_style_tracker.cc +++ b/third_party/blink/renderer/core/view_transition/view_transition_style_tracker.cc
@@ -15,6 +15,7 @@ #include "third_party/blink/renderer/core/css/style_engine.h" #include "third_party/blink/renderer/core/display_lock/display_lock_document_state.h" #include "third_party/blink/renderer/core/dom/node.h" +#include "third_party/blink/renderer/core/dom/node_computed_style.h" #include "third_party/blink/renderer/core/dom/pseudo_element.h" #include "third_party/blink/renderer/core/frame/browser_controls.h" #include "third_party/blink/renderer/core/frame/local_frame.h" @@ -43,11 +44,9 @@ namespace blink { namespace { -const char* kElementSetModificationError = - "The element set cannot be modified at this transition state."; const char* kContainmentNotSatisfied = - "Dropping element from transition. Shared element must contain paint or " - "layout"; + "Aborting transition. Element must contain paint or layout for " + "view-transition-name : "; const char* kDuplicateTagBaseError = "Unexpected duplicate view-transition-name: "; @@ -65,6 +64,11 @@ return kAnimationUAStyles; } +bool SatisfiesContainment(const LayoutObject& object) { + return object.ShouldApplyPaintContainment() || + object.ShouldApplyLayoutContainment(); +} + absl::optional<String> ComputeInsetDifference(PhysicalRect reference_rect, const LayoutRect& target_rect, float device_pixel_ratio) { @@ -259,11 +263,6 @@ void ViewTransitionStyleTracker::AddSharedElement(Element* element, const AtomicString& name) { DCHECK(element); - if (state_ == State::kCapturing || state_ == State::kStarted) { - AddConsoleError(kElementSetModificationError, - {DOMNodeIds::IdForNode(element)}); - return; - } // Insert an empty hash set for the element if it doesn't exist, or get it if // it does. @@ -279,16 +278,6 @@ ++set_element_sequence_id_; } -void ViewTransitionStyleTracker::RemoveSharedElement(Element* element) { - if (state_ == State::kCapturing || state_ == State::kStarted) { - AddConsoleError(kElementSetModificationError, - {DOMNodeIds::IdForNode(element)}); - return; - } - - pending_shared_element_names_.erase(element); -} - void ViewTransitionStyleTracker::AddSharedElementsFromCSS() { DCHECK(document_ && document_->View()); @@ -337,6 +326,25 @@ VectorOf<Element>& elements, VectorOf<AtomicString>& transition_names, absl::optional<RootData>& root_data) { + for (const auto& element : ViewTransitionSupplement::From(*document_) + ->ElementsWithViewTransitionName()) { + DCHECK(element->ComputedStyleRef().ViewTransitionName()); + + // Ignore elements which are not rendered. + if (!element->GetLayoutObject()) + continue; + + // Skip the transition if containment is not satisfied. + if (!element->IsDocumentElement() && + !SatisfiesContainment(*element->GetLayoutObject())) { + StringBuilder message; + message.Append(kContainmentNotSatisfied); + message.Append(element->ComputedStyleRef().ViewTransitionName()); + AddConsoleError(message.ReleaseString()); + return false; + } + } + // We need to flatten the data first, and sort it by ordering which reflects // the setElement ordering. struct FlatData : public GarbageCollected<FlatData> { @@ -352,7 +360,9 @@ // Flatten it. for (auto& [element, names] : pending_shared_element_names_) { - bool is_root = element->IsDocumentElement(); + DCHECK(element->GetLayoutObject()); + + const bool is_root = element->IsDocumentElement(); if (is_root && !root_data) root_data.emplace(); @@ -391,6 +401,7 @@ AddConsoleError(message.ReleaseString()); return false; } + transition_names.push_back(name); elements.push_back(element); } @@ -604,7 +615,9 @@ // We need to run post prepaint steps here to ensure that the style would be // correct if computed by either the main frame or by getComputedStyle call. // TODO(vmpstr): Rename to something like UpdatePseudoGeometry. - RunPostPrePaintSteps(); + const bool continue_transition = RunPostPrePaintSteps(); + DCHECK(continue_transition) + << "The transition should've been skipped by FlattenAndVerifyElements"; // We need a style invalidation to generate new content pseudo elements for // new elements in the DOM. @@ -756,7 +769,9 @@ return nullptr; } -void ViewTransitionStyleTracker::RunPostPrePaintSteps() { +bool ViewTransitionStyleTracker::RunPostPrePaintSteps() { + DCHECK_GE(document_->Lifecycle().GetState(), + DocumentLifecycle::kPrePaintClean); bool needs_style_invalidation = false; // Use the document element's effective zoom, since that's what the parent @@ -775,22 +790,14 @@ if (!element_data->target_element) continue; - // TODO(khushalsagar) : Switch paint containment and disallow fragmentation - // to implicit constraints. See crbug.com/1277121. + DCHECK_NE(element_data->target_element, document_->documentElement()); auto* layout_object = element_data->target_element->GetLayoutObject(); - if (!layout_object || (!layout_object->ShouldApplyPaintContainment() && - !layout_object->ShouldApplyLayoutContainment())) { - element_data->target_element = nullptr; - - // If we had a valid |target_element| there must be an associated snapshot - // ID. Remove it since there is no corresponding DOM element to produce - // its snapshot. - auto& live_snapshot_id = HasLiveNewContent() - ? element_data->new_snapshot_id - : element_data->old_snapshot_id; - DCHECK(live_snapshot_id.IsValid()); - live_snapshot_id = viz::ViewTransitionElementResourceId(); - continue; + if (!layout_object || !SatisfiesContainment(*layout_object)) { + StringBuilder message; + message.Append(kContainmentNotSatisfied); + message.Append(entry.key); + AddConsoleError(message.ReleaseString()); + return false; } gfx::Transform snapshot_matrix = layout_object->LocalToAbsoluteTransform(); @@ -887,6 +894,8 @@ if (needs_style_invalidation) InvalidateStyle(); + + return true; } bool ViewTransitionStyleTracker::HasActiveAnimations() const { @@ -964,39 +973,6 @@ return root_effect_node_.get(); } -void ViewTransitionStyleTracker::VerifySharedElements() { - for (auto& entry : element_data_map_) { - auto& element_data = entry.value; - if (!element_data->target_element) - continue; - auto& active_element = element_data->target_element; - - auto* object = active_element->GetLayoutObject(); - - // TODO(vmpstr): Should this work for replaced elements as well? - if (object) { - if (object->ShouldApplyPaintContainment() || - object->ShouldApplyLayoutContainment()) { - continue; - } - - AddConsoleError(kContainmentNotSatisfied, - {DOMNodeIds::IdForNode(active_element)}); - } - - // Clear the shared element. Note that we don't remove the element from the - // vector, since we need to preserve the order of the elements and we - // support nulls as a valid active element. - - // Invalidate the element since we should no longer be compositing it. - // TODO(vmpstr): Should we abort the transition instead?0 - auto* box = active_element->GetLayoutBox(); - if (box && box->HasSelfPaintingLayer()) - box->SetNeedsPaintPropertyUpdate(); - active_element = nullptr; - } -} - bool ViewTransitionStyleTracker::IsSharedElement(Element* element) const { // In stable states, we don't have shared elements. if (state_ == State::kIdle || state_ == State::kCaptured)
diff --git a/third_party/blink/renderer/core/view_transition/view_transition_style_tracker.h b/third_party/blink/renderer/core/view_transition/view_transition_style_tracker.h index fbdcfecc..a0f8465 100644 --- a/third_party/blink/renderer/core/view_transition/view_transition_style_tracker.h +++ b/third_party/blink/renderer/core/view_transition/view_transition_style_tracker.h
@@ -65,8 +65,6 @@ ViewTransitionStyleTracker(Document& document, ViewTransitionState); ~ViewTransitionStyleTracker(); - void AddSharedElement(Element*, const AtomicString&); - void RemoveSharedElement(Element*); void AddSharedElementsFromCSS(); // Indicate that capture was requested. This verifies that the combination of @@ -109,7 +107,9 @@ // Dispatched after the pre-paint lifecycle stage after each rendering // lifecycle update when a transition is in progress. - void RunPostPrePaintSteps(); + // Returns false if the transition constraints were broken and the transition + // should be skipped. + bool RunPostPrePaintSteps(); // Provides a UA stylesheet applied to ::transition* pseudo elements. const String& UAStyleSheet(); @@ -133,8 +133,6 @@ EffectPaintPropertyNode* GetEffect(Element* element) const; EffectPaintPropertyNode* GetRootEffect() const; - void VerifySharedElements(); - int CapturedTagCount() const { return captured_name_count_; } bool IsSharedElement(Element* element) const; @@ -233,6 +231,7 @@ void EndTransition(); void AddConsoleError(String message, Vector<DOMNodeId> related_nodes = {}); + void AddSharedElement(Element*, const AtomicString&); bool FlattenAndVerifyElements(VectorOf<Element>&, VectorOf<AtomicString>&, absl::optional<RootData>&);
diff --git a/third_party/blink/renderer/core/view_transition/view_transition_supplement.cc b/third_party/blink/renderer/core/view_transition/view_transition_supplement.cc index af36d31..f573191 100644 --- a/third_party/blink/renderer/core/view_transition/view_transition_supplement.cc +++ b/third_party/blink/renderer/core/view_transition/view_transition_supplement.cc
@@ -8,12 +8,57 @@ #include "cc/view_transition/view_transition_request.h" #include "third_party/blink/renderer/bindings/core/v8/v8_view_transition_callback.h" #include "third_party/blink/renderer/core/dom/document.h" +#include "third_party/blink/renderer/core/frame/local_frame.h" #include "third_party/blink/renderer/core/frame/local_frame_view.h" +#include "third_party/blink/renderer/core/style/computed_style.h" #include "third_party/blink/renderer/core/view_transition/view_transition.h" +#include "third_party/blink/renderer/core/view_transition/view_transition_utils.h" #include "third_party/blink/renderer/platform/bindings/exception_state.h" #include "third_party/blink/renderer/platform/graphics/compositing/paint_artifact_compositor.h" namespace blink { +namespace { + +bool HasActiveTransitionInAncestorFrame(LocalFrame* frame) { + auto* parent = frame ? frame->Parent() : nullptr; + + while (parent && parent->IsLocalFrame()) { + if (To<LocalFrame>(parent)->GetDocument() && + ViewTransitionUtils::GetActiveTransition( + *To<LocalFrame>(parent)->GetDocument())) { + return true; + } + + parent = parent->Parent(); + } + + return false; +} + +// Skips transitions in all local frames underneath |curr_frame|'s local root +// except |curr_frame| itself. +void SkipTransitionInAllLocalFrames(LocalFrame* curr_frame) { + auto* root_view = curr_frame ? curr_frame->LocalFrameRoot().View() : nullptr; + if (!root_view) + return; + + root_view->ForAllChildLocalFrameViews([curr_frame](LocalFrameView& child) { + if (child.GetFrame() == *curr_frame) + return; + + auto* document = child.GetFrame().GetDocument(); + auto* transition = document + ? ViewTransitionUtils::GetActiveTransition(*document) + : nullptr; + if (!transition) + return; + + transition->skipTransition(); + DCHECK(!ViewTransitionUtils::GetActiveTransition(*document)); + }); +} + +} // namespace // static const char ViewTransitionSupplement::kSupplementName[] = "ViewTransition"; @@ -63,6 +108,22 @@ transition_ = ViewTransition::CreateFromScript(&document, script_state, callback, this); + + // If there is a transition in a parent frame, give that precedence over a + // transition in a child frame. + if (HasActiveTransitionInAncestorFrame(document.GetFrame())) { + auto skipped_transition = transition_; + skipped_transition->skipTransition(); + + DCHECK(!transition_); + return skipped_transition; + } + + // Skip transitions in all frames associated with this widget. We can only + // have one transition per widget/CC. + SkipTransitionInAllLocalFrames(document.GetFrame()); + DCHECK(transition_); + return transition_; } @@ -119,6 +180,15 @@ return transition_; } +void ViewTransitionSupplement::UpdateViewTransitionNames( + const Element& element, + const ComputedStyle* style) { + if (style && style->ViewTransitionName()) + elements_with_view_transition_name_.insert(&element); + else + elements_with_view_transition_name_.erase(&element); +} + ViewTransitionSupplement::ViewTransitionSupplement(Document& document) : Supplement<Document>(document) {} @@ -126,6 +196,7 @@ void ViewTransitionSupplement::Trace(Visitor* visitor) const { visitor->Trace(transition_); + visitor->Trace(elements_with_view_transition_name_); Supplement<Document>::Trace(visitor); }
diff --git a/third_party/blink/renderer/core/view_transition/view_transition_supplement.h b/third_party/blink/renderer/core/view_transition/view_transition_supplement.h index db86ebd..ef6fe7d 100644 --- a/third_party/blink/renderer/core/view_transition/view_transition_supplement.h +++ b/third_party/blink/renderer/core/view_transition/view_transition_supplement.h
@@ -50,6 +50,14 @@ ViewTransition* GetActiveTransition(); + // Tracks the set of elements with a valid |view-transition-name|. + void UpdateViewTransitionNames(const Element& element, + const ComputedStyle* style); + const HeapHashSet<Member<const Element>>& ElementsWithViewTransitionName() + const { + return elements_with_view_transition_name_; + } + explicit ViewTransitionSupplement(Document&); ~ViewTransitionSupplement() override; @@ -74,6 +82,8 @@ Member<ViewTransition> transition_; VectorOf<std::unique_ptr<ViewTransitionRequest>> pending_requests_; + + HeapHashSet<Member<const Element>> elements_with_view_transition_name_; }; } // namespace blink
diff --git a/third_party/blink/renderer/core/view_transition/view_transition_test.cc b/third_party/blink/renderer/core/view_transition/view_transition_test.cc index 25cf2472..e43604ca 100644 --- a/third_party/blink/renderer/core/view_transition/view_transition_test.cc +++ b/third_party/blink/renderer/core/view_transition/view_transition_test.cc
@@ -366,57 +366,6 @@ test::RunPendingTasks(); } -TEST_P(ViewTransitionTest, UncontainedElementsAreCleared) { - SetHtmlInnerHTML(R"HTML( - <style> - /* TODO(crbug.com/1336462): html.css is parsed before runtime flags are enabled */ - html { view-transition-name: root; } - #e1 { width: 100px; height: 100px; contain: paint } - </style> - <div id=e1 style="view-transition-name: e1"></div> - <div id=e2 style="view-transition-name: e2"></div> - <div id=e3 style="view-transition-name: e3"></div> - )HTML"); - - auto* e1 = GetDocument().getElementById("e1"); - auto* e2 = GetDocument().getElementById("e2"); - auto* e3 = GetDocument().getElementById("e3"); - - V8TestingScope v8_scope; - ScriptState* script_state = v8_scope.GetScriptState(); - ExceptionState& exception_state = v8_scope.GetExceptionState(); - - MockFunctionScope funcs(script_state); - auto* view_transition_callback = - V8ViewTransitionCallback::Create(funcs.ExpectCall()); - - auto* transition = ViewTransitionSupplement::startViewTransition( - script_state, GetDocument(), view_transition_callback, exception_state); - - EXPECT_EQ(GetState(transition), State::kCaptureTagDiscovery); - EXPECT_FALSE(ShouldCompositeForViewTransition(e1)); - EXPECT_FALSE(ShouldCompositeForViewTransition(e2)); - EXPECT_FALSE(ShouldCompositeForViewTransition(e3)); - - // Update the lifecycle while keeping the transition active. - UpdateAllLifecyclePhasesForTest(); - - EXPECT_EQ(GetState(transition), State::kCapturing); - EXPECT_TRUE(ShouldCompositeForViewTransition(e1)); - EXPECT_FALSE(ShouldCompositeForViewTransition(e2)); - EXPECT_FALSE(ShouldCompositeForViewTransition(e3)); - - // Update the lifecycle while keeping the transition active. - UpdateAllLifecyclePhasesForTest(); - - EXPECT_TRUE(ElementIsComposited("e1")); - EXPECT_FALSE(ElementIsComposited("e2")); - EXPECT_FALSE(ElementIsComposited("e3")); - - FinishTransition(); - test::RunPendingTasks(); -} - TEST_P(ViewTransitionTest, StartSharedElementsWantToBeComposited) { SetHtmlInnerHTML(R"HTML( <style> @@ -530,7 +479,7 @@ promise_tester.WaitUntilSettled(); // There is no current way to successfully finish a transition from a // unittest. Web tests focus on successful completion tests. - EXPECT_TRUE(promise_tester.IsRejected()); + EXPECT_TRUE(promise_tester.IsFulfilled()); } TEST_P(ViewTransitionTest, RenderingPausedTest) { @@ -569,7 +518,7 @@ FinishTransition(); finished_tester.WaitUntilSettled(); - EXPECT_TRUE(finished_tester.IsRejected()); + EXPECT_TRUE(finished_tester.IsFulfilled()); } TEST_P(ViewTransitionTest, Abandon) { @@ -590,7 +539,7 @@ test::RunPendingTasks(); finished_tester.WaitUntilSettled(); - EXPECT_TRUE(finished_tester.IsRejected()); + EXPECT_TRUE(finished_tester.IsFulfilled()); } // Checks that the pseudo element tree is correctly build for ::transition*
diff --git a/third_party/blink/renderer/modules/payments/payment_request.cc b/third_party/blink/renderer/modules/payments/payment_request.cc index 08ec862..83c4056 100644 --- a/third_party/blink/renderer/modules/payments/payment_request.cc +++ b/third_party/blink/renderer/modules/payments/payment_request.cc
@@ -816,10 +816,10 @@ } if (!not_supported_for_invalid_origin_or_ssl_error_.empty()) { - return ScriptPromise::RejectWithDOMException( - script_state, MakeGarbageCollected<DOMException>( - DOMExceptionCode::kNotSupportedError, - not_supported_for_invalid_origin_or_ssl_error_)); + exception_state.ThrowDOMException( + DOMExceptionCode::kNotSupportedError, + not_supported_for_invalid_origin_or_ssl_error_); + return ScriptPromise(); } if (!payment_provider_.is_bound() || accept_resolver_) {
diff --git a/third_party/blink/renderer/modules/payments/payment_request_for_invalid_origin_or_ssl_test.cc b/third_party/blink/renderer/modules/payments/payment_request_for_invalid_origin_or_ssl_test.cc index 78c99b10..0470e92 100644 --- a/third_party/blink/renderer/modules/payments/payment_request_for_invalid_origin_or_ssl_test.cc +++ b/third_party/blink/renderer/modules/payments/payment_request_for_invalid_origin_or_ssl_test.cc
@@ -128,9 +128,10 @@ // The show() will be rejected before user activation is checked, so there is // no need to trigger user-activation here. ScriptPromise promise = - request->show(scope.GetScriptState(), ASSERT_NO_EXCEPTION); - EXPECT_EQ("NotSupportedError: mock error message", - GetRejectString(scope.GetScriptState(), promise)); + request->show(scope.GetScriptState(), scope.GetExceptionState()); + EXPECT_TRUE(scope.GetExceptionState().HadException()); + EXPECT_EQ(DOMExceptionCode::kNotSupportedError, + scope.GetExceptionState().CodeAs<DOMExceptionCode>()); } TEST_F(PaymentRequestForInvalidOriginOrSslTest, @@ -143,14 +144,18 @@ // The show()s will be rejected before user activation is checked, so there is // no need to trigger user-activation here. ScriptPromise promise1 = - request->show(scope.GetScriptState(), ASSERT_NO_EXCEPTION); - EXPECT_EQ("NotSupportedError: mock error message", - GetRejectString(scope.GetScriptState(), promise1)); + request->show(scope.GetScriptState(), scope.GetExceptionState()); + EXPECT_TRUE(scope.GetExceptionState().HadException()); + EXPECT_EQ(DOMExceptionCode::kNotSupportedError, + scope.GetExceptionState().CodeAs<DOMExceptionCode>()); + + scope.GetExceptionState().ClearException(); ScriptPromise promise2 = request->show(scope.GetScriptState(), scope.GetExceptionState()); - EXPECT_EQ("NotSupportedError: mock error message", - GetRejectString(scope.GetScriptState(), promise2)); + EXPECT_TRUE(scope.GetExceptionState().HadException()); + EXPECT_EQ(DOMExceptionCode::kNotSupportedError, + scope.GetExceptionState().CodeAs<DOMExceptionCode>()); } TEST_F(PaymentRequestForInvalidOriginOrSslTest,
diff --git a/third_party/blink/web_tests/TestExpectations b/third_party/blink/web_tests/TestExpectations index f39f2156..b92fbe5 100644 --- a/third_party/blink/web_tests/TestExpectations +++ b/third_party/blink/web_tests/TestExpectations
@@ -6015,6 +6015,7 @@ # Sheriff 2022-04-20 crbug.com/1253971 [ Mac ] external/wpt/html/semantics/forms/the-selectmenu-element/selectmenu-parts-structure.tentative.html [ Timeout ] +crbug.com/1385472 [ Win ] external/wpt/html/semantics/forms/the-selectmenu-element/selectmenu-parts-structure.tentative.html [ Timeout ] # Sheriff 2022-04-21 crbug.com/1318318 external/wpt/fetch/private-network-access/service-worker-background-fetch.https.window.html [ Failure Pass Timeout ] @@ -6422,6 +6423,8 @@ crbug.com/1378078 [ Debug Linux ] media/controls/slow-doubletap.html [ Failure ] crbug.com/1384671 [ Win ] virtual/prerender/external/wpt/speculation-rules/prerender/opt-out.html [ Failure Timeout ] crbug.com/1384671 [ Linux ] external/wpt/speculation-rules/prerender/opt-out.html [ Failure Timeout ] +crbug.com/1385491 [ Win ] external/wpt/selection/user-select-on-input-and-contenteditable.html [ Crash Failure Pass Timeout ] +crbug.com/1385538 [ Win ] http/tests/serviceworker/postmessage-cross-process.html [ Failure ] # Sheriff 2022-10-07 crbug.com/1372556 [ Linux ] external/wpt/css/css-text/text-transform/text-transform-capitalize-* [ Failure Pass ] @@ -6899,6 +6902,7 @@ # Sheriff 2022-11-31 crbug.com/1383527 [ Mac ] http/tests/devtools/indexeddb/resources-panel.js [ Failure ] +crbug.com/1385483 [ Linux ] http/tests/devtools/indexeddb/resources-panel.js [ Failure ] # Sheriff 2022-11-15 crbug.com/1383990 [ Mac ] external/wpt/html/dom/idlharness.worker.html [ Failure Skip ]
diff --git a/third_party/blink/web_tests/external/WPT_BASE_MANIFEST_8.json b/third_party/blink/web_tests/external/WPT_BASE_MANIFEST_8.json index b9fcccc..044d3bd 100644 --- a/third_party/blink/web_tests/external/WPT_BASE_MANIFEST_8.json +++ b/third_party/blink/web_tests/external/WPT_BASE_MANIFEST_8.json
@@ -2429,6 +2429,13 @@ {} ] ], + "spanner-after-parallel-flow.html": [ + "4ed0914fc73a0c212871efc88ffae2eb0fce68cb", + [ + null, + {} + ] + ], "spanner-in-inline-after-very-tall-content-001.html": [ "6f3cb5c553e9e5d9f197d7367ac21c1b8484739f", [ @@ -148691,6 +148698,58 @@ {} ] ], + "spanner-in-child-after-parallel-flow-001.html": [ + "124f0116583fb9d02b53526f8436bd1ae383eab8", + [ + null, + [ + [ + "/css/reference/ref-filled-green-100px-square.xht", + "==" + ] + ], + {} + ] + ], + "spanner-in-child-after-parallel-flow-002.html": [ + "3a8bac590b7cb2a0304d6641ba7583b7f67806aa", + [ + null, + [ + [ + "/css/reference/ref-filled-green-100px-square.xht", + "==" + ] + ], + {} + ] + ], + "spanner-in-child-after-parallel-flow-003.html": [ + "8016205bee2ca02fe3a046e76399c6f2c53b369c", + [ + null, + [ + [ + "/css/reference/ref-filled-green-100px-square.xht", + "==" + ] + ], + {} + ] + ], + "spanner-in-child-after-parallel-flow-004.html": [ + "00d4e0d2fb653d534c4969ccb25d4c518624d3b2", + [ + null, + [ + [ + "/css/reference/ref-filled-green-100px-square.xht", + "==" + ] + ], + {} + ] + ], "spanner-in-opacity.html": [ "78b1ac80e5f504eabb1a85c87d153260cc436d41", [ @@ -176531,7 +176590,7 @@ ] ], "text-align-end-001.html": [ - "14e666aca227849d7ea97d97122730168347afc7", + "4570b22708a8b9a82687ee8d7cbeeb9acf1cc565", [ null, [ @@ -176544,7 +176603,7 @@ ] ], "text-align-end-002.html": [ - "0d4f9ccc5d655861ddd22da90ce58083f74d6bc8", + "6144d4d511966fdb07821f94f0d9d469c4351728", [ null, [ @@ -176557,7 +176616,7 @@ ] ], "text-align-end-003.html": [ - "a91e7031981a837699a55e77760587635d55f14c", + "0539f6b79aa7ed17fcc71de6441da799a74aa0fb", [ null, [ @@ -176570,7 +176629,7 @@ ] ], "text-align-end-004.html": [ - "cb0180c40ea6292eba3ce5c27009ce5c1be3328e", + "7e5badd9456c0f5c77a50de2e0551e0cb3494b2b", [ null, [ @@ -176583,7 +176642,7 @@ ] ], "text-align-end-005.html": [ - "01acc95a8259f8022590f1514c80f66c0f363247", + "94a41b59e0b3c463463fe8e664594c8b6edd825c", [ null, [ @@ -176596,7 +176655,7 @@ ] ], "text-align-end-006.html": [ - "88df21753dde426b0de8af6fb454befec07d43f7", + "9e1006f7ab5b5743fde9f20b284c13604ae56576", [ null, [ @@ -176609,7 +176668,7 @@ ] ], "text-align-end-007.html": [ - "7330c104a26e6e618fe7ca0c0d631ad1603dd06e", + "2f4b5e4f50c41ab662622726c5a9941ebe2e5d99", [ null, [ @@ -176622,7 +176681,7 @@ ] ], "text-align-end-008.html": [ - "c7e2e77537bf2e71c49e819aa86ee732792ca190", + "88ced38fb591cbae9aeecce1ed045b2ad925ad8a", [ null, [ @@ -176635,7 +176694,7 @@ ] ], "text-align-end-009.html": [ - "d7915197be286e850d9aa146b364e87c029c4b1f", + "8fdeff7069100be0f6a3d9cd21ab9183540db419", [ null, [ @@ -176648,7 +176707,7 @@ ] ], "text-align-end-010.html": [ - "7b5d9ed0649305f222ca1a6234590d25e2a30ddf", + "fffe06ffe3f3865c8cf4cede90382af8ee912c17", [ null, [ @@ -176661,7 +176720,7 @@ ] ], "text-align-end-014.html": [ - "82db05a090951da4dbffd68d523523dfa1f77745", + "d51c7cd0e2fd150f64874c8fe53b673560220b73", [ null, [ @@ -176674,7 +176733,7 @@ ] ], "text-align-end-015.html": [ - "287ce68a4a1ccc4326fce6d8ee16bd14a6d1c463", + "0661c2bd9f12a6efbad8807d01a4118b283a24a6", [ null, [ @@ -305109,51 +305168,51 @@ "text-align": { "reference": { "text-align-end-ref-001.html": [ - "e05ae3d7e34b7243dd26d5e6a684abf5c141b8a2", + "480b5681710c9be671bb225ad8e1a9e70f3b8cc6", [] ], "text-align-end-ref-002.html": [ - "3581e9ef94f246edc243adf6e3776f3e6126b6a7", + "bab8bd715c352152bc2e7ea32c790f7e7a436882", [] ], "text-align-end-ref-003.html": [ - "38781c922e31cc958e5400fe004d0a468efa935e", + "c6710c64e0a65d4e769774832e06b4e0612e7672", [] ], "text-align-end-ref-004.html": [ - "6650e06e48edabf575b47fa632252c3a3be2b654", + "010c6658410cbefbf898407bfd60bfe2ebba855f", [] ], "text-align-end-ref-005.html": [ - "204243c9d169ddb10e689584b911e7c0b87097c2", + "3510f890f39db411e4eb1887a41b2a523c2010ea", [] ], "text-align-end-ref-006.html": [ - "bdc4b16d89c1638798ccb6e67fdc5d8876a271ad", + "365e21fe9ba0fcddb50f6edb4ed77f4955ee91a4", [] ], "text-align-end-ref-007.html": [ - "73c743058c275b39ab19ef9a617c0536ad7614d7", + "9b7d51c21084a9e9f93a9c739eeb492d21bb1fe0", [] ], "text-align-end-ref-008.html": [ - "0effded5a14d2aee2fdb1ef5ab8f1bdb035d3943", + "9196a4de3f2314bb60dc2ed6ca5db3dd2916d9b8", [] ], "text-align-end-ref-009.html": [ - "45a8c0b9e2dd156b2d817ef88f68efe000248cf0", + "563794c61c1aec29d2d6d667c177a0fea82ebebc", [] ], "text-align-end-ref-010.html": [ - "ea9cb27528bc787d449629ef2ff1e309781edbbf", + "d4797c93f3bf39958eb09e388b6a4dfa86c66858", [] ], "text-align-end-ref-014.html": [ - "bf9fe393593662ceed9f62954750031c8d0f8d42", + "65b431fc39214e8a3d8ceb246410ea647eccfbeb", [] ], "text-align-end-ref-015.html": [ - "fc2695d9d8bf8fa4052b69efa0e8e12caacc89fc", + "26a8ef62a4fc42a385a1a467c4566fbeb9c5d208", [] ], "text-align-end-ref-016.html": [ @@ -365979,7 +366038,7 @@ [] ], "soft-navigation-helper.js": [ - "1bef2c2fa0bcc907d235eef64bb26dc3dbdf363a", + "cefe915924debbb1a5eb863852c791ca6823ee06", [] ] }, @@ -578870,7 +578929,7 @@ ] ], "navigation-api-preventDefault.tentative.html": [ - "f9f8cdec76c7f52a8f4efe9060f9087adf4d6009", + "8fc159d28dc08ed9e203f2d6e0afa0fc51832384", [ null, { @@ -578879,7 +578938,7 @@ ] ], "navigation-api-rejected.tentative.html": [ - "7d3e9e35afc00cdc3220da3ab1fe5c78727cbd00", + "bcc0451d5bd80203092b6ed769d4ab2c9ccfff19", [ null, { @@ -578888,7 +578947,16 @@ ] ], "navigation-api.tentative.html": [ - "3ad16dd9e6b8195e49515c9713fac1597afe1989", + "c4f2786ccf35135b3f20b82e017a9114b6a07b01", + [ + null, + { + "testdriver": true + } + ] + ], + "popstate.tentative.html": [ + "60a5ff72292c15abd281b1264e747a8f3c0d0d2b", [ null, {
diff --git a/third_party/blink/web_tests/external/wpt/css/css-text/text-align/reference/text-align-end-ref-001.html b/third_party/blink/web_tests/external/wpt/css/css-text/text-align/reference/text-align-end-ref-001.html index e05ae3d..480b5681 100644 --- a/third_party/blink/web_tests/external/wpt/css/css-text/text-align/reference/text-align-end-ref-001.html +++ b/third_party/blink/web_tests/external/wpt/css/css-text/text-align/reference/text-align-end-ref-001.html
@@ -1,19 +1,17 @@ <!DOCTYPE html> -<html lang="en" > +<html lang="en"> <head> <meta charset="utf-8"> <title>text-align: end, direction: rtl</title> <link rel='author' title='Richard Ishida' href='mailto:ishida@w3.org'> -<link rel="stylesheet" type="text/css" href="/fonts/ahem.css" /> +<link rel="stylesheet" type="text/css" href="/fonts/ahem.css"> <style type='text/css'> -.test, .ref { border: 1px solid orange; margin: 20px; width: 300px; color: orange; font: 24px/24px Ahem; } -.ref { position: relative; height: 24px; } -#rb1 { position: absolute; top: 0; left: 0; background-color: orange; width: 120px; height: 24px; } +.ref { border: 1px solid orange; margin: 20px; width: 300px; color: orange; font: 25px/1 Ahem; text-align: left; } </style> </head> <body> <div id='instructions'>Test passes if the shading in both orange boxes looks the same.</div> -<div class="ref"><div id="rb1"></div></div> -<div class="ref"><div id="rb1"></div></div> +<div class="ref">REFER</div> +<div class="ref">REFER</div> </body> -</html> \ No newline at end of file +</html>
diff --git a/third_party/blink/web_tests/external/wpt/css/css-text/text-align/reference/text-align-end-ref-002.html b/third_party/blink/web_tests/external/wpt/css/css-text/text-align/reference/text-align-end-ref-002.html index 3581e9ef..bab8bd7 100644 --- a/third_party/blink/web_tests/external/wpt/css/css-text/text-align/reference/text-align-end-ref-002.html +++ b/third_party/blink/web_tests/external/wpt/css/css-text/text-align/reference/text-align-end-ref-002.html
@@ -1,21 +1,19 @@ <!DOCTYPE html> -<html lang="en" > +<html lang="en"> <head> <meta charset="utf-8"> <title>text-align: end, direction: ltr</title> <link rel='author' title='Richard Ishida' href='mailto:ishida@w3.org'> -<link rel="stylesheet" type="text/css" href="/fonts/ahem.css" /> +<link rel="stylesheet" type="text/css" href="/fonts/ahem.css"> <style type='text/css'> -.test, .ref { border: 1px solid orange; margin: 20px; width: 300px; color: orange; font: 24px/24px Ahem; } -.ref { position: relative; height: 24px; } -#rb1 { position: absolute; top: 0; right: 0; background-color: orange; width: 120px; height: 24px; } +.ref { border: 1px solid orange; margin: 20px; width: 300px; color: orange; font: 25px/1 Ahem; text-align: right; } </style> </head> <body> <div id='instructions'>Test passes if the shading in both orange boxes looks the same.</div> <div style="direction: rtl;"> -<div class="ref"><div id="rb1"></div></div> -<div class="ref"><div id="rb1"></div></div> +<div class="ref">REFER</div> +<div class="ref">REFER</div> </div> </body> -</html> \ No newline at end of file +</html>
diff --git a/third_party/blink/web_tests/external/wpt/css/css-text/text-align/reference/text-align-end-ref-003.html b/third_party/blink/web_tests/external/wpt/css/css-text/text-align/reference/text-align-end-ref-003.html index 38781c92..c6710c64 100644 --- a/third_party/blink/web_tests/external/wpt/css/css-text/text-align/reference/text-align-end-ref-003.html +++ b/third_party/blink/web_tests/external/wpt/css/css-text/text-align/reference/text-align-end-ref-003.html
@@ -1,19 +1,17 @@ <!DOCTYPE html> -<html lang="en" > +<html lang="en"> <head> <meta charset="utf-8"> <title>text-align: end, dir=rtl</title> <link rel='author' title='Richard Ishida' href='mailto:ishida@w3.org'> -<link rel="stylesheet" type="text/css" href="/fonts/ahem.css" /> +<link rel="stylesheet" type="text/css" href="/fonts/ahem.css"> <style type='text/css'> -.test, .ref { border: 1px solid orange; margin: 20px; width: 300px; color: orange; font: 24px/24px Ahem; } -.ref { position: relative; height: 24px; } -#rb1 { position: absolute; top: 0; left: 0; background-color: orange; width: 120px; height: 24px; } +.ref { border: 1px solid orange; margin: 20px; width: 300px; color: orange; font: 25px/1 Ahem; text-align: left; } </style> </head> <body> <div id='instructions'>Test passes if the shading in both orange boxes is identical.</div> -<div class="ref"><div id="rb1"></div></div> -<div class="ref"><div id="rb1"></div></div> +<div class="ref">REFER</div> +<div class="ref">REFER</div> </body> -</html> \ No newline at end of file +</html>
diff --git a/third_party/blink/web_tests/external/wpt/css/css-text/text-align/reference/text-align-end-ref-004.html b/third_party/blink/web_tests/external/wpt/css/css-text/text-align/reference/text-align-end-ref-004.html index 6650e06e..010c665 100644 --- a/third_party/blink/web_tests/external/wpt/css/css-text/text-align/reference/text-align-end-ref-004.html +++ b/third_party/blink/web_tests/external/wpt/css/css-text/text-align/reference/text-align-end-ref-004.html
@@ -1,21 +1,19 @@ <!DOCTYPE html> -<html lang="en" > +<html lang="en"> <head> <meta charset="utf-8"> <title>text-align: end, dir=ltr</title> <link rel='author' title='Richard Ishida' href='mailto:ishida@w3.org'> -<link rel="stylesheet" type="text/css" href="/fonts/ahem.css" /> +<link rel="stylesheet" type="text/css" href="/fonts/ahem.css"> <style type='text/css'> -.test, .ref { border: 1px solid orange; margin: 20px; width: 300px; color: orange; font: 24px/24px Ahem; } -.ref { position: relative; height: 24px; } -#rb1 { position: absolute; top: 0; right: 0; background-color: orange; width: 120px; height: 24px; } +.ref { border: 1px solid orange; margin: 20px; width: 300px; color: orange; font: 25px/1 Ahem; text-align: right; } </style> </head> <body> <div id='instructions'>Test passes if the shading in both orange boxes is identical.</div> <div dir="rtl"> -<div class="ref"><div id="rb1"></div></div> -<div class="ref"><div id="rb1"></div></div> +<div class="ref">REFER</div> +<div class="ref">REFER</div> </div> </body> -</html> \ No newline at end of file +</html>
diff --git a/third_party/blink/web_tests/external/wpt/css/css-text/text-align/reference/text-align-end-ref-005.html b/third_party/blink/web_tests/external/wpt/css/css-text/text-align/reference/text-align-end-ref-005.html index 204243c9..3510f89 100644 --- a/third_party/blink/web_tests/external/wpt/css/css-text/text-align/reference/text-align-end-ref-005.html +++ b/third_party/blink/web_tests/external/wpt/css/css-text/text-align/reference/text-align-end-ref-005.html
@@ -1,21 +1,17 @@ <!DOCTYPE html> -<html lang="en" > +<html lang="en"> <head> <meta charset="utf-8"> <title>text-align: end, direction: rtl</title> <link rel='author' title='Richard Ishida' href='mailto:ishida@w3.org'> -<link rel="stylesheet" type="text/css" href="/fonts/ahem.css" /> +<link rel="stylesheet" type="text/css" href="/fonts/ahem.css"> <style type='text/css'> -.test, .ref { border: 1px solid orange; margin: 20px; width: 290px; color: orange; font: 24px/24px Ahem; } -.ref { position: relative; height: 72px; } -.rb1 { position: absolute; top: 0; left: 0; background-color: orange; width: 72px; height: 72px; } -.rb2 { position: absolute; top: 0; left: 96px; background-color: orange; width: 72px; height: 72px; } -.rb3 { position: absolute; top: 0; left: 192px; background-color: orange; width: 72px; height: 48px; } +.ref { border: 1px solid orange; margin: 20px; width: 300px; color: orange; font: 25px/1 Ahem; text-align: left; } </style> </head> <body> <div id='instructions'>Test passes if the shading in both orange boxes looks the same.</div> -<div class="ref"><div class="rb1"></div><div class="rb2"></div><div class="rb3"></div></div> -<div class="ref"><div class="rb1"></div><div class="rb2"></div><div class="rb3"></div></div> +<div class="ref">REF REF REF REF REF REF REF REF</div> +<div class="ref">REF REF REF REF REF REF REF REF</div> </body> -</html> \ No newline at end of file +</html>
diff --git a/third_party/blink/web_tests/external/wpt/css/css-text/text-align/reference/text-align-end-ref-006.html b/third_party/blink/web_tests/external/wpt/css/css-text/text-align/reference/text-align-end-ref-006.html index bdc4b16d..365e21f 100644 --- a/third_party/blink/web_tests/external/wpt/css/css-text/text-align/reference/text-align-end-ref-006.html +++ b/third_party/blink/web_tests/external/wpt/css/css-text/text-align/reference/text-align-end-ref-006.html
@@ -1,23 +1,19 @@ <!DOCTYPE html> -<html lang="en" > +<html lang="en"> <head> <meta charset="utf-8"> <title>text-align: end, direction: ltr</title> <link rel='author' title='Richard Ishida' href='mailto:ishida@w3.org'> -<link rel="stylesheet" type="text/css" href="/fonts/ahem.css" /> +<link rel="stylesheet" type="text/css" href="/fonts/ahem.css"> <style type='text/css'> -.test, .ref { border: 1px solid orange; margin: 20px; width: 290px; color: orange; font: 24px/24px Ahem; } -.ref { position: relative; height: 72px; } -.rb1 { position: absolute; top: 0; right: 0; background-color: orange; width: 72px; height: 72px; } -.rb2 { position: absolute; top: 0; right: 96px; background-color: orange; width: 72px; height: 72px; } -.rb3 { position: absolute; top: 0; right: 192px; background-color: orange; width: 72px; height: 48px; } +.ref { border: 1px solid orange; margin: 20px; width: 300px; color: orange; font: 25px/1 Ahem; text-align: right; } </style> </head> <body> <div id='instructions'>Test passes if the shading in both orange boxes is identical.</div> <div style="direction: rtl;"> -<div class="ref"><div class="rb1"></div><div class="rb2"></div><div class="rb3"></div></div> -<div class="ref"><div class="rb1"></div><div class="rb2"></div><div class="rb3"></div></div> +<div class="ref">REF REF REF REF REF REF REF REF</div> +<div class="ref">REF REF REF REF REF REF REF REF</div> </div> </body> -</html> \ No newline at end of file +</html>
diff --git a/third_party/blink/web_tests/external/wpt/css/css-text/text-align/reference/text-align-end-ref-007.html b/third_party/blink/web_tests/external/wpt/css/css-text/text-align/reference/text-align-end-ref-007.html index 73c74305..9b7d51c2 100644 --- a/third_party/blink/web_tests/external/wpt/css/css-text/text-align/reference/text-align-end-ref-007.html +++ b/third_party/blink/web_tests/external/wpt/css/css-text/text-align/reference/text-align-end-ref-007.html
@@ -1,21 +1,17 @@ <!DOCTYPE html> -<html lang="en" > +<html lang="en"> <head> <meta charset="utf-8"> <title>text-align: end, dir=rtl</title> <link rel='author' title='Richard Ishida' href='mailto:ishida@w3.org'> -<link rel="stylesheet" type="text/css" href="/fonts/ahem.css" /> +<link rel="stylesheet" type="text/css" href="/fonts/ahem.css"> <style type='text/css'> -.test, .ref { border: 1px solid orange; margin: 20px; width: 290px; color: orange; font: 24px/24px Ahem; } -.ref { position: relative; height: 72px; } -.rb1 { position: absolute; top: 0; left: 0; background-color: orange; width: 72px; height: 72px; } -.rb2 { position: absolute; top: 0; left: 96px; background-color: orange; width: 72px; height: 72px; } -.rb3 { position: absolute; top: 0; left: 192px; background-color: orange; width: 72px; height: 48px; } +.ref { border: 1px solid orange; margin: 20px; width: 300px; color: orange; font: 25px/1 Ahem; text-align: left; } </style> </head> <body> <div id='instructions'>Test passes if the shading in both orange boxes looks the same.</div> -<div class="ref"><div class="rb1"></div><div class="rb2"></div><div class="rb3"></div></div> -<div class="ref"><div class="rb1"></div><div class="rb2"></div><div class="rb3"></div></div> +<div class="ref">REF REF REF REF REF REF REF REF</div> +<div class="ref">REF REF REF REF REF REF REF REF</div> </body> -</html> \ No newline at end of file +</html>
diff --git a/third_party/blink/web_tests/external/wpt/css/css-text/text-align/reference/text-align-end-ref-008.html b/third_party/blink/web_tests/external/wpt/css/css-text/text-align/reference/text-align-end-ref-008.html index 0effded5..9196a4de 100644 --- a/third_party/blink/web_tests/external/wpt/css/css-text/text-align/reference/text-align-end-ref-008.html +++ b/third_party/blink/web_tests/external/wpt/css/css-text/text-align/reference/text-align-end-ref-008.html
@@ -1,23 +1,19 @@ <!DOCTYPE html> -<html lang="en" > +<html lang="en"> <head> <meta charset="utf-8"> <title>text-align: end, dir=ltr</title> <link rel='author' title='Richard Ishida' href='mailto:ishida@w3.org'> -<link rel="stylesheet" type="text/css" href="/fonts/ahem.css" /> +<link rel="stylesheet" type="text/css" href="/fonts/ahem.css"> <style type='text/css'> -.test, .ref { border: 1px solid orange; margin: 20px; width: 290px; color: orange; font: 24px/24px Ahem; } -.ref { position: relative; height: 72px; } -.rb1 { position: absolute; top: 0; right: 0; background-color: orange; width: 72px; height: 72px; } -.rb2 { position: absolute; top: 0; right: 96px; background-color: orange; width: 72px; height: 72px; } -.rb3 { position: absolute; top: 0; right: 192px; background-color: orange; width: 72px; height: 48px; } +.ref { border: 1px solid orange; margin: 20px; width: 300px; color: orange; font: 25px/1 Ahem; text-align: right; } </style> </head> <body> <div id='instructions'>Test passes if shading in both orange boxes is identical.</div> <div dir="rtl"> -<div class="ref"><div class="rb1"></div><div class="rb2"></div><div class="rb3"></div></div> -<div class="ref"><div class="rb1"></div><div class="rb2"></div><div class="rb3"></div></div> +<div class="ref">REF REF REF REF REF REF REF REF</div> +<div class="ref">REF REF REF REF REF REF REF REF</div> </div> </body> -</html> \ No newline at end of file +</html>
diff --git a/third_party/blink/web_tests/external/wpt/css/css-text/text-align/reference/text-align-end-ref-009.html b/third_party/blink/web_tests/external/wpt/css/css-text/text-align/reference/text-align-end-ref-009.html index 45a8c0b..563794c 100644 --- a/third_party/blink/web_tests/external/wpt/css/css-text/text-align/reference/text-align-end-ref-009.html +++ b/third_party/blink/web_tests/external/wpt/css/css-text/text-align/reference/text-align-end-ref-009.html
@@ -1,21 +1,17 @@ <!DOCTYPE html> -<html lang="en" > +<html lang="en"> <head> <meta charset="utf-8"> <title>text-align: end, dir=auto, RTL first strong</title> <link rel='author' title='Richard Ishida' href='mailto:ishida@w3.org'> -<link rel="stylesheet" type="text/css" href="/fonts/ahem.css" /> +<link rel="stylesheet" type="text/css" href="/fonts/ahem.css"> <style type='text/css'> -.test, .ref { border: 1px solid orange; margin: 20px; width: 290px; color: orange; font: 24px/24px Ahem; } -.ref { position: relative; height: 72px; } -.rb1 { position: absolute; top: 0; left: 0; background-color: orange; width: 72px; height: 72px; } -.rb2 { position: absolute; top: 0; left: 96px; background-color: orange; width: 72px; height: 72px; } -.rb3 { position: absolute; top: 0; left: 192px; background-color: orange; width: 72px; height: 48px; } +.ref { border: 1px solid orange; margin: 20px; width: 300px; color: orange; font: 25px/1 Ahem; text-align: left; } </style> </head> <body> <div id='instructions'>Test passes if shading in both orange boxes is identical.</div> -<div class="ref"><div class="rb1"></div><div class="rb2"></div><div class="rb3"></div></div> -<div class="ref"><div class="rb1"></div><div class="rb2"></div><div class="rb3"></div></div> +<div class="ref">REF REF REF REF REF REF REF REF</div> +<div class="ref">REF REF REF REF REF REF REF REF</div> </body> -</html> \ No newline at end of file +</html>
diff --git a/third_party/blink/web_tests/external/wpt/css/css-text/text-align/reference/text-align-end-ref-010.html b/third_party/blink/web_tests/external/wpt/css/css-text/text-align/reference/text-align-end-ref-010.html index ea9cb27..d4797c9 100644 --- a/third_party/blink/web_tests/external/wpt/css/css-text/text-align/reference/text-align-end-ref-010.html +++ b/third_party/blink/web_tests/external/wpt/css/css-text/text-align/reference/text-align-end-ref-010.html
@@ -1,23 +1,19 @@ <!DOCTYPE html> -<html lang="en" > +<html lang="en"> <head> <meta charset="utf-8"> <title>text-align: end, dir=auto, LTR first strong</title> <link rel='author' title='Richard Ishida' href='mailto:ishida@w3.org'> -<link rel="stylesheet" type="text/css" href="/fonts/ahem.css" /> +<link rel="stylesheet" type="text/css" href="/fonts/ahem.css"> <style type='text/css'> -.test, .ref { border: 1px solid orange; margin: 20px; width: 290px; color: orange; font: 24px/24px Ahem; } -.ref { position: relative; height: 72px; } -.rb1 { position: absolute; top: 0; right: 0; background-color: orange; width: 72px; height: 72px; } -.rb2 { position: absolute; top: 0; right: 96px; background-color: orange; width: 72px; height: 72px; } -.rb3 { position: absolute; top: 0; right: 192px; background-color: orange; width: 72px; height: 48px; } +.ref { border: 1px solid orange; margin: 20px; width: 300px; color: orange; font: 25px/1 Ahem; text-align: right; } </style> </head> <body> <div id='instructions'>Test passes if shading in both orange boxes is identical.</div> <div dir="rtl"> -<div class="ref"><div class="rb1"></div><div class="rb2"></div><div class="rb3"></div></div> -<div class="ref"><div class="rb1"></div><div class="rb2"></div><div class="rb3"></div></div> +<div class="ref">REF REF REF REF REF REF REF REF</div> +<div class="ref">REF REF REF REF REF REF REF REF</div> </div> </body> -</html> \ No newline at end of file +</html>
diff --git a/third_party/blink/web_tests/external/wpt/css/css-text/text-align/reference/text-align-end-ref-014.html b/third_party/blink/web_tests/external/wpt/css/css-text/text-align/reference/text-align-end-ref-014.html index bf9fe39..65b431f 100644 --- a/third_party/blink/web_tests/external/wpt/css/css-text/text-align/reference/text-align-end-ref-014.html +++ b/third_party/blink/web_tests/external/wpt/css/css-text/text-align/reference/text-align-end-ref-014.html
@@ -1,21 +1,19 @@ <!DOCTYPE html> -<html lang="en" > +<html lang="en"> <head> <meta charset="utf-8"> <title>text-align: end, pre, dir=rtl inherited</title> <link rel='author' title='Richard Ishida' href='mailto:ishida@w3.org'> -<link rel="stylesheet" type="text/css" href="/fonts/ahem.css" /> +<link rel="stylesheet" type="text/css" href="/fonts/ahem.css"> <style type='text/css'> -.test, .ref { border: 1px solid orange; margin: 20px; width: 290px; color: orange; font: 24px/24px Ahem; } -.ref { position: relative; height: 48px; } -#rb1 { position: absolute; top: 0; left: 0; background-color: orange; width: 72px; height: 48px; } +.ref { border: 1px solid orange; margin: 20px; width: 300px; color: orange; font: 25px/1 Ahem; text-align: left; } </style> </head> <body> <div id='instructions'>Test passes if shading in both orange boxes is identical.</div> <div dir="rtl"> -<div class="ref"><div id="rb1"></div></div> -<div class="ref"><div id="rb1"></div></div> +<div class="ref">REF<br>ERE</div> +<div class="ref">REF<br>ERE</div> </div> </body> -</html> \ No newline at end of file +</html>
diff --git a/third_party/blink/web_tests/external/wpt/css/css-text/text-align/reference/text-align-end-ref-015.html b/third_party/blink/web_tests/external/wpt/css/css-text/text-align/reference/text-align-end-ref-015.html index fc2695d9..26a8ef6 100644 --- a/third_party/blink/web_tests/external/wpt/css/css-text/text-align/reference/text-align-end-ref-015.html +++ b/third_party/blink/web_tests/external/wpt/css/css-text/text-align/reference/text-align-end-ref-015.html
@@ -1,19 +1,17 @@ <!DOCTYPE html> -<html lang="en" > +<html lang="en"> <head> <meta charset="utf-8"> <title>text-align: end, pre, dir=ltr inherited</title> <link rel='author' title='Richard Ishida' href='mailto:ishida@w3.org'> -<link rel="stylesheet" type="text/css" href="/fonts/ahem.css" /> +<link rel="stylesheet" type="text/css" href="/fonts/ahem.css"> <style type='text/css'> -.test, .ref { border: 1px solid orange; margin: 20px; width: 290px; color: orange; font: 24px/24px Ahem; } -.ref { position: relative; height: 48px; } -#rb1 { position: absolute; top: 0; right: 0; background-color: orange; width: 72px; height: 48px; } +.ref { border: 1px solid orange; margin: 20px; width: 300px; color: orange; font: 25px/1 Ahem; text-align: right; } </style> </head> <body> <div id='instructions'>Test passes if shading in both orange boxes is identical.</div> -<div class="ref"><div id="rb1"></div></div> -<div class="ref"><div id="rb1"></div></div> +<div class="ref">REF<br>ERE</div> +<div class="ref">REF<br>ERE</div> </body> -</html> \ No newline at end of file +</html>
diff --git a/third_party/blink/web_tests/external/wpt/css/css-text/text-align/text-align-end-001.html b/third_party/blink/web_tests/external/wpt/css/css-text/text-align/text-align-end-001.html index 14e666a..4570b22 100644 --- a/third_party/blink/web_tests/external/wpt/css/css-text/text-align/text-align-end-001.html +++ b/third_party/blink/web_tests/external/wpt/css/css-text/text-align/text-align-end-001.html
@@ -1,5 +1,5 @@ <!DOCTYPE html> -<html lang="en" > +<html lang="en"> <head> <meta charset="utf-8"> <title>text-align: end, direction: rtl</title> @@ -7,18 +7,17 @@ <link rel='help' href='https://drafts.csswg.org/css-text-3/#text-align-property'> <link rel='match' href='reference/text-align-end-ref-001.html'> <meta name="assert" content="text-align:end aligns inline-level content to the end edge of the line box – ie. left when direction is horizontal, rtl."> -<link rel="stylesheet" type="text/css" href="/fonts/ahem.css" /> +<link rel="stylesheet" type="text/css" href="/fonts/ahem.css"> <style type='text/css'> .test { text-align: end; direction: rtl; } +.ref { text-align: left; } /* the CSS below is not part of the test */ -.test, .ref { border: 1px solid orange; margin: 20px; width: 300px; color: orange; font: 24px/24px Ahem; } -.ref { position: relative; height: 24px; } -#rb1 { position: absolute; top: 0; left: 0; background-color: orange; width: 120px; height: 24px; } +.test, .ref { border: 1px solid orange; margin: 20px; width: 300px; color: orange; font: 25px/1 Ahem; } </style> </head> <body> <div id='instructions'>Test passes if the shading in both orange boxes looks the same.</div> -<div class="test">XXXXX</div> -<div class="ref"><div id="rb1"></div></div> +<div class="test">TESTI</div> +<div class="ref">REFER</div> </body> -</html> \ No newline at end of file +</html>
diff --git a/third_party/blink/web_tests/external/wpt/css/css-text/text-align/text-align-end-002.html b/third_party/blink/web_tests/external/wpt/css/css-text/text-align/text-align-end-002.html index 0d4f9ccc..6144d4d 100644 --- a/third_party/blink/web_tests/external/wpt/css/css-text/text-align/text-align-end-002.html +++ b/third_party/blink/web_tests/external/wpt/css/css-text/text-align/text-align-end-002.html
@@ -1,5 +1,5 @@ <!DOCTYPE html> -<html lang="en" > +<html lang="en"> <head> <meta charset="utf-8"> <title>text-align: end, direction: ltr</title> @@ -7,20 +7,19 @@ <link rel='help' href='https://drafts.csswg.org/css-text-3/#text-align-property'> <link rel='match' href='reference/text-align-end-ref-002.html'> <meta name="assert" content="text-align:end aligns inline-level content to the end edge of the line box – ie. right when direction is horizontal, ltr."> -<link rel="stylesheet" type="text/css" href="/fonts/ahem.css" /> +<link rel="stylesheet" type="text/css" href="/fonts/ahem.css"> <style type='text/css'> .test { text-align: end; direction: ltr; } +.ref { text-align: right; } /* the CSS below is not part of the test */ -.test, .ref { border: 1px solid orange; margin: 20px; width: 300px; color: orange; font: 24px/24px Ahem; } -.ref { position: relative; height: 24px; } -#rb1 { position: absolute; top: 0; right: 0; background-color: orange; width: 120px; height: 24px; } +.test, .ref { border: 1px solid orange; margin: 20px; width: 300px; color: orange; font: 25px/1 Ahem; } </style> </head> <body> <div id='instructions'>Test passes if the shading in both orange boxes looks the same.</div> <div style="direction: rtl;"> -<div class="test">XXXXX</div> -<div class="ref"><div id="rb1"></div></div> +<div class="test">TESTI</div> +<div class="ref">REFER</div> </div> </body> -</html> \ No newline at end of file +</html>
diff --git a/third_party/blink/web_tests/external/wpt/css/css-text/text-align/text-align-end-003.html b/third_party/blink/web_tests/external/wpt/css/css-text/text-align/text-align-end-003.html index a91e703..0539f6b7 100644 --- a/third_party/blink/web_tests/external/wpt/css/css-text/text-align/text-align-end-003.html +++ b/third_party/blink/web_tests/external/wpt/css/css-text/text-align/text-align-end-003.html
@@ -1,5 +1,5 @@ <!DOCTYPE html> -<html lang="en" > +<html lang="en"> <head> <meta charset="utf-8"> <title>text-align: end, dir=rtl</title> @@ -7,18 +7,17 @@ <link rel='help' href='https://drafts.csswg.org/css-text-3/#text-align-property'> <link rel='match' href='reference/text-align-end-ref-003.html'> <meta name="assert" content="text-align:end aligns inline-level content to the end edge of the line box – ie. left when direction is horizontal, rtl."> -<link rel="stylesheet" type="text/css" href="/fonts/ahem.css" /> +<link rel="stylesheet" type="text/css" href="/fonts/ahem.css"> <style type='text/css'> .test { text-align: end; } +.ref { text-align: left; } /* the CSS below is not part of the test */ -.test, .ref { border: 1px solid orange; margin: 20px; width: 300px; color: orange; font: 24px/24px Ahem; } -.ref { position: relative; height: 24px; } -#rb1 { position: absolute; top: 0; left: 0; background-color: orange; width: 120px; height: 24px; } +.test, .ref { border: 1px solid orange; margin: 20px; width: 300px; color: orange; font: 25px/1 Ahem; } </style> </head> <body> <div id='instructions'>Test passes if the shading in both orange boxes is identical.</div> -<div class="test" dir="rtl">XXXXX</div> -<div class="ref"><div id="rb1"></div></div> +<div class="test" dir="rtl">TESTI</div> +<div class="ref">REFER</div> </body> -</html> \ No newline at end of file +</html>
diff --git a/third_party/blink/web_tests/external/wpt/css/css-text/text-align/text-align-end-004.html b/third_party/blink/web_tests/external/wpt/css/css-text/text-align/text-align-end-004.html index cb0180c..7e5badd 100644 --- a/third_party/blink/web_tests/external/wpt/css/css-text/text-align/text-align-end-004.html +++ b/third_party/blink/web_tests/external/wpt/css/css-text/text-align/text-align-end-004.html
@@ -1,5 +1,5 @@ <!DOCTYPE html> -<html lang="en" > +<html lang="en"> <head> <meta charset="utf-8"> <title>text-align: end, dir=ltr</title> @@ -7,20 +7,19 @@ <link rel='help' href='https://drafts.csswg.org/css-text-3/#text-align-property'> <link rel='match' href='reference/text-align-end-ref-004.html'> <meta name="assert" content="text-align:end aligns inline-level content to the end edge of the line box – ie. right when direction is horizontal, ltr."> -<link rel="stylesheet" type="text/css" href="/fonts/ahem.css" /> +<link rel="stylesheet" type="text/css" href="/fonts/ahem.css"> <style type='text/css'> .test { text-align: end; } +.ref { text-align: right; } /* the CSS below is not part of the test */ -.test, .ref { border: 1px solid orange; margin: 20px; width: 300px; color: orange; font: 24px/24px Ahem; } -.ref { position: relative; height: 24px; } -#rb1 { position: absolute; top: 0; right: 0; background-color: orange; width: 120px; height: 24px; } +.test, .ref { border: 1px solid orange; margin: 20px; width: 300px; color: orange; font: 25px/1 Ahem; } </style> </head> <body> <div id='instructions'>Test passes if the shading in both orange boxes is identical.</div> <div dir="rtl"> -<div class="test" dir="ltr">XXXXX</div> -<div class="ref"><div id="rb1"></div></div> +<div class="test" dir="ltr">TESTI</div> +<div class="ref">REFER</div> </div> </body> -</html> \ No newline at end of file +</html>
diff --git a/third_party/blink/web_tests/external/wpt/css/css-text/text-align/text-align-end-005.html b/third_party/blink/web_tests/external/wpt/css/css-text/text-align/text-align-end-005.html index 01acc95..94a41b59 100644 --- a/third_party/blink/web_tests/external/wpt/css/css-text/text-align/text-align-end-005.html +++ b/third_party/blink/web_tests/external/wpt/css/css-text/text-align/text-align-end-005.html
@@ -1,5 +1,5 @@ <!DOCTYPE html> -<html lang="en" > +<html lang="en"> <head> <meta charset="utf-8"> <title>text-align: end, direction: rtl</title> @@ -7,20 +7,17 @@ <link rel='help' href='https://drafts.csswg.org/css-text-3/#text-align-property'> <link rel='match' href='reference/text-align-end-ref-005.html'> <meta name="assert" content="text-align:end aligns inline-level content to the end edge of the line box – ie. left when direction is horizontal, rtl."> -<link rel="stylesheet" type="text/css" href="/fonts/ahem.css" /> +<link rel="stylesheet" type="text/css" href="/fonts/ahem.css"> <style type='text/css'> .test { text-align: end; direction: rtl; } +.ref { text-align: left; } /* the CSS below is not part of the test */ -.test, .ref { border: 1px solid orange; margin: 20px; width: 290px; color: orange; font: 24px/24px Ahem; } -.ref { position: relative; height: 72px; } -#rb1 { position: absolute; top: 0; left: 0; background-color: orange; width: 72px; height: 72px; } -#rb2 { position: absolute; top: 0; left: 96px; background-color: orange; width: 72px; height: 72px; } -#rb3 { position: absolute; top: 0; left: 192px; background-color: orange; width: 72px; height: 48px; } +.test, .ref { border: 1px solid orange; margin: 20px; width: 300px; color: orange; font: 25px/1 Ahem; } </style> </head> <body> <div id='instructions'>Test passes if the shading in both orange boxes looks the same.</div> -<div class="test">XXX XXX XXX XXX XXX XXX XXX XXX</div> -<div class="ref"><div id="rb1"></div><div id="rb2"></div><div id="rb3"></div></div> +<div class="test">TES TES TES TES TES TES TES TES</div> +<div class="ref">REF REF REF REF REF REF REF REF</div> </body> -</html> \ No newline at end of file +</html>
diff --git a/third_party/blink/web_tests/external/wpt/css/css-text/text-align/text-align-end-006.html b/third_party/blink/web_tests/external/wpt/css/css-text/text-align/text-align-end-006.html index 88df217..9e1006f 100644 --- a/third_party/blink/web_tests/external/wpt/css/css-text/text-align/text-align-end-006.html +++ b/third_party/blink/web_tests/external/wpt/css/css-text/text-align/text-align-end-006.html
@@ -1,5 +1,5 @@ <!DOCTYPE html> -<html lang="en" > +<html lang="en"> <head> <meta charset="utf-8"> <title>text-align: end, direction: ltr</title> @@ -7,22 +7,19 @@ <link rel='help' href='https://drafts.csswg.org/css-text-3/#text-align-property'> <link rel='match' href='reference/text-align-end-ref-006.html'> <meta name="assert" content="text-align:end aligns inline-level content to the end edge of the line box – ie. right when direction is horizontal, ltr."> -<link rel="stylesheet" type="text/css" href="/fonts/ahem.css" /> +<link rel="stylesheet" type="text/css" href="/fonts/ahem.css"> <style type='text/css'> .test { text-align: end; direction: ltr; } +.ref { text-align: right; } /* the CSS below is not part of the test */ -.test, .ref { border: 1px solid orange; margin: 20px; width: 290px; color: orange; font: 24px/24px Ahem; } -.ref { position: relative; height: 72px; } -#rb1 { position: absolute; top: 0; right: 0; background-color: orange; width: 72px; height: 72px; } -#rb2 { position: absolute; top: 0; right: 96px; background-color: orange; width: 72px; height: 72px; } -#rb3 { position: absolute; top: 0; right: 192px; background-color: orange; width: 72px; height: 48px; } +.test, .ref { border: 1px solid orange; margin: 20px; width: 300px; color: orange; font: 25px/1 Ahem; } </style> </head> <body> <div id='instructions'>Test passes if the shading in both orange boxes is identical.</div> <div style="direction: rtl;"> -<div class="test">XXX XXX XXX XXX XXX XXX XXX XXX</div> -<div class="ref"><div id="rb1"></div><div id="rb2"></div><div id="rb3"></div></div> +<div class="test">TES TES TES TES TES TES TES TES</div> +<div class="ref">REF REF REF REF REF REF REF REF</div> </div> </body> -</html> \ No newline at end of file +</html>
diff --git a/third_party/blink/web_tests/external/wpt/css/css-text/text-align/text-align-end-007.html b/third_party/blink/web_tests/external/wpt/css/css-text/text-align/text-align-end-007.html index 7330c104..2f4b5e4 100644 --- a/third_party/blink/web_tests/external/wpt/css/css-text/text-align/text-align-end-007.html +++ b/third_party/blink/web_tests/external/wpt/css/css-text/text-align/text-align-end-007.html
@@ -1,5 +1,5 @@ <!DOCTYPE html> -<html lang="en" > +<html lang="en"> <head> <meta charset="utf-8"> <title>text-align: end, dir=rtl</title> @@ -7,20 +7,17 @@ <link rel='help' href='https://drafts.csswg.org/css-text-3/#text-align-property'> <link rel='match' href='reference/text-align-end-ref-007.html'> <meta name="assert" content="text-align:end aligns inline-level content to the end edge of the line box – ie. left when direction is horizontal, rtl."> -<link rel="stylesheet" type="text/css" href="/fonts/ahem.css" /> +<link rel="stylesheet" type="text/css" href="/fonts/ahem.css"> <style type='text/css'> .test { text-align: end; } +.ref { text-align: left; } /* the CSS below is not part of the test */ -.test, .ref { border: 1px solid orange; margin: 20px; width: 290px; color: orange; font: 24px/24px Ahem; } -.ref { position: relative; height: 72px; } -#rb1 { position: absolute; top: 0; left: 0; background-color: orange; width: 72px; height: 72px; } -#rb2 { position: absolute; top: 0; left: 96px; background-color: orange; width: 72px; height: 72px; } -#rb3 { position: absolute; top: 0; left: 192px; background-color: orange; width: 72px; height: 48px; } +.test, .ref { border: 1px solid orange; margin: 20px; width: 300px; color: orange; font: 25px/1 Ahem; } </style> </head> <body> <div id='instructions'>Test passes if the shading in both orange boxes looks the same.</div> -<div class="test" dir="rtl">XXX XXX XXX XXX XXX XXX XXX XXX</div> -<div class="ref"><div id="rb1"></div><div id="rb2"></div><div id="rb3"></div></div> +<div class="test" dir="rtl">TES TES TES TES TES TES TES TES</div> +<div class="ref">REF REF REF REF REF REF REF REF</div> </body> -</html> \ No newline at end of file +</html>
diff --git a/third_party/blink/web_tests/external/wpt/css/css-text/text-align/text-align-end-008.html b/third_party/blink/web_tests/external/wpt/css/css-text/text-align/text-align-end-008.html index c7e2e77..88ced38 100644 --- a/third_party/blink/web_tests/external/wpt/css/css-text/text-align/text-align-end-008.html +++ b/third_party/blink/web_tests/external/wpt/css/css-text/text-align/text-align-end-008.html
@@ -1,5 +1,5 @@ <!DOCTYPE html> -<html lang="en" > +<html lang="en"> <head> <meta charset="utf-8"> <title>text-align: end, dir=ltr</title> @@ -7,22 +7,19 @@ <link rel='help' href='https://drafts.csswg.org/css-text-3/#text-align-property'> <link rel='match' href='reference/text-align-end-ref-008.html'> <meta name="assert" content="text-align:end aligns inline-level content to the end edge of the line box – ie. right when direction is horizontal, ltr."> -<link rel="stylesheet" type="text/css" href="/fonts/ahem.css" /> +<link rel="stylesheet" type="text/css" href="/fonts/ahem.css"> <style type='text/css'> .test { text-align: end; } +.ref { text-align: right; } /* the CSS below is not part of the test */ -.test, .ref { border: 1px solid orange; margin: 20px; width: 290px; color: orange; font: 24px/24px Ahem; } -.ref { position: relative; height: 72px; } -#rb1 { position: absolute; top: 0; right: 0; background-color: orange; width: 72px; height: 72px; } -#rb2 { position: absolute; top: 0; right: 96px; background-color: orange; width: 72px; height: 72px; } -#rb3 { position: absolute; top: 0; right: 192px; background-color: orange; width: 72px; height: 48px; } +.test, .ref { border: 1px solid orange; margin: 20px; width: 300px; color: orange; font: 25px/1 Ahem; } </style> </head> <body> <div id='instructions'>Test passes if shading in both orange boxes is identical.</div> <div dir="rtl"> -<div class="test" dir="ltr">XXX XXX XXX XXX XXX XXX XXX XXX</div> -<div class="ref"><div id="rb1"></div><div id="rb2"></div><div id="rb3"></div></div> +<div class="test" dir="ltr">TES TES TES TES TES TES TES TES</div> +<div class="ref">REF REF REF REF REF REF REF REF</div> </div> </body> -</html> \ No newline at end of file +</html>
diff --git a/third_party/blink/web_tests/external/wpt/css/css-text/text-align/text-align-end-009.html b/third_party/blink/web_tests/external/wpt/css/css-text/text-align/text-align-end-009.html index d791519..8fdeff7 100644 --- a/third_party/blink/web_tests/external/wpt/css/css-text/text-align/text-align-end-009.html +++ b/third_party/blink/web_tests/external/wpt/css/css-text/text-align/text-align-end-009.html
@@ -1,5 +1,5 @@ <!DOCTYPE html> -<html lang="en" > +<html lang="en"> <head> <meta charset="utf-8"> <title>text-align: end, dir=auto, RTL first strong</title> @@ -7,23 +7,20 @@ <link rel='help' href='https://drafts.csswg.org/css-text-3/#text-align-property'> <link rel='match' href='reference/text-align-end-ref-009.html'> <meta name="assert" content="text-align:end aligns inline-level content to the end edge of the line box – ie. left when direction is auto and first strong character is rtl."> -<link rel="stylesheet" type="text/css" href="/fonts/ahem.css" /> +<link rel="stylesheet" type="text/css" href="/fonts/ahem.css"> <style type='text/css'> .test { text-align: end; } +.ref { text-align: left; } /* the CSS below is not part of the test */ -.test, .ref { border: 1px solid orange; margin: 20px; width: 290px; color: orange; font: 24px/24px Ahem; } -.ref { position: relative; height: 72px; } -#rb1 { position: absolute; top: 0; left: 0; background-color: orange; width: 72px; height: 72px; } -#rb2 { position: absolute; top: 0; left: 96px; background-color: orange; width: 72px; height: 72px; } -#rb3 { position: absolute; top: 0; left: 192px; background-color: orange; width: 72px; height: 48px; } +.test, .ref { border: 1px solid orange; margin: 20px; width: 300px; color: orange; font: 25px/1 Ahem; } </style> </head> <body> <div id='instructions'>Test passes if shading in both orange boxes is identical.</div> -<div class="test" dir="auto">‏XXX XXX XXX XXX XXX XXX XXX XXX</div> -<div class="ref"><div id="rb1"></div><div id="rb2"></div><div id="rb3"></div></div> +<div class="test" dir="auto">‏TES TES TES TES TES TES TES TES</div> +<div class="ref">REF REF REF REF REF REF REF REF</div> <!-- Notes: The &rlm isn't in the Ahem font, so it may cause a spurious effect, such as a thin white line in the middle of a block in IE. This should be ignored. The test needs a RTL character in the Ahem font, so that the &RLM can be removed. --> </body> -</html> \ No newline at end of file +</html>
diff --git a/third_party/blink/web_tests/external/wpt/css/css-text/text-align/text-align-end-010.html b/third_party/blink/web_tests/external/wpt/css/css-text/text-align/text-align-end-010.html index 7b5d9ed..fffe06f 100644 --- a/third_party/blink/web_tests/external/wpt/css/css-text/text-align/text-align-end-010.html +++ b/third_party/blink/web_tests/external/wpt/css/css-text/text-align/text-align-end-010.html
@@ -1,5 +1,5 @@ <!DOCTYPE html> -<html lang="en" > +<html lang="en"> <head> <meta charset="utf-8"> <title>text-align: end, dir=auto, LTR first strong</title> @@ -7,22 +7,19 @@ <link rel='help' href='https://drafts.csswg.org/css-text-3/#text-align-property'> <link rel='match' href='reference/text-align-end-ref-010.html'> <meta name="assert" content="text-align:end aligns inline-level content to the end edge of the line box – ie. right when direction is auto and first strong character is ltr."> -<link rel="stylesheet" type="text/css" href="/fonts/ahem.css" /> +<link rel="stylesheet" type="text/css" href="/fonts/ahem.css"> <style type='text/css'> .test { text-align: end; } +.ref { text-align: right; } /* the CSS below is not part of the test */ -.test, .ref { border: 1px solid orange; margin: 20px; width: 290px; color: orange; font: 24px/24px Ahem; } -.ref { position: relative; height: 72px; } -#rb1 { position: absolute; top: 0; right: 0; background-color: orange; width: 72px; height: 72px; } -#rb2 { position: absolute; top: 0; right: 96px; background-color: orange; width: 72px; height: 72px; } -#rb3 { position: absolute; top: 0; right: 192px; background-color: orange; width: 72px; height: 48px; } +.test, .ref { border: 1px solid orange; margin: 20px; width: 300px; color: orange; font: 25px/1 Ahem; } </style> </head> <body> <div id='instructions'>Test passes if shading in both orange boxes is identical.</div> <div dir="rtl"> -<div class="test" dir="auto">XXX XXX XXX XXX XXX XXX XXX XXX</div> -<div class="ref"><div id="rb1"></div><div id="rb2"></div><div id="rb3"></div></div> +<div class="test" dir="auto">‎TES TES TES TES TES TES TES TES</div> +<div class="ref">REF REF REF REF REF REF REF REF</div> </div> </body> -</html> \ No newline at end of file +</html>
diff --git a/third_party/blink/web_tests/external/wpt/css/css-text/text-align/text-align-end-014.html b/third_party/blink/web_tests/external/wpt/css/css-text/text-align/text-align-end-014.html index 82db05a..d51c7cd 100644 --- a/third_party/blink/web_tests/external/wpt/css/css-text/text-align/text-align-end-014.html +++ b/third_party/blink/web_tests/external/wpt/css/css-text/text-align/text-align-end-014.html
@@ -1,5 +1,5 @@ <!DOCTYPE html> -<html lang="en" > +<html lang="en"> <head> <meta charset="utf-8"> <title>text-align: end, pre, dir=rtl inherited</title> @@ -7,24 +7,23 @@ <link rel='help' href='https://drafts.csswg.org/css-text-3/#text-align-property'> <link rel='match' href='reference/text-align-end-ref-014.html'> <meta name="assert" content="text-align:end aligns inline-level content to the end edge of the line box – ie. left when base direction is rtl."> -<link rel="stylesheet" type="text/css" href="/fonts/ahem.css" /> +<link rel="stylesheet" type="text/css" href="/fonts/ahem.css"> <style type='text/css'> .test { text-align: end; } +.ref { text-align: left; } /* the CSS below is not part of the test */ -.test, .ref { border: 1px solid orange; margin: 20px; width: 290px; color: orange; font: 24px/24px Ahem; } -.ref { position: relative; height: 48px; } -#rb1 { position: absolute; top: 0; left: 0; background-color: orange; width: 72px; height: 48px; } +.test, .ref { border: 1px solid orange; margin: 20px; width: 300px; color: orange; font: 25px/1 Ahem; } </style> </head> <body> <div id='instructions'>Test passes if shading in both orange boxes is identical.</div> <div dir="rtl"> -<pre class="test">XXX -‏XXX</pre> -<div class="ref"><div id="rb1"></div></div> +<pre class="test">TES +‏ING</pre> +<div class="ref">REF<br>ERE</div> </div> <!-- Notes: The &rlm isn't in the Ahem font, so it may cause a spurious effect, such as a thin white line in the middle of a block in IE. This should be ignored. The test needs a RTL character in the Ahem font, so that the &RLM can be removed. --> </body> -</html> \ No newline at end of file +</html>
diff --git a/third_party/blink/web_tests/external/wpt/css/css-text/text-align/text-align-end-015.html b/third_party/blink/web_tests/external/wpt/css/css-text/text-align/text-align-end-015.html index 287ce68..0661c2bd 100644 --- a/third_party/blink/web_tests/external/wpt/css/css-text/text-align/text-align-end-015.html +++ b/third_party/blink/web_tests/external/wpt/css/css-text/text-align/text-align-end-015.html
@@ -1,30 +1,29 @@ <!DOCTYPE html> -<html lang="en" > +<html lang="en"> <head> <meta charset="utf-8"> <title>text-align: end, pre, dir=ltr inherited</title> <link rel='author' title='Richard Ishida' href='mailto:ishida@w3.org'> <link rel='help' href='https://drafts.csswg.org/css-text-3/#text-align-property'> <link rel='match' href='reference/text-align-end-ref-015.html'> -<meta name="assert" content="text-align:end aligns inline-level content to the end edge of the line box – ie. right when base direction is ltr."> -<link rel="stylesheet" type="text/css" href="/fonts/ahem.css" /> +<meta name="assert" content="text-align:end aligns inline-level content to the end edge of the line box – ie. right when base direction is ltr."> +<link rel="stylesheet" type="text/css" href="/fonts/ahem.css"> <style type='text/css'> .test { text-align: end; } +.ref { text-align: right; } /* the CSS below is not part of the test */ -.test, .ref { border: 1px solid orange; margin: 20px; width: 290px; color: orange; font: 24px/24px Ahem; } -.ref { position: relative; height: 48px; } -#rb1 { position: absolute; top: 0; right: 0; background-color: orange; width: 72px; height: 48px; } +.test, .ref { border: 1px solid orange; margin: 20px; width: 300px; color: orange; font: 25px/1 Ahem; } </style> </head> <body> <div id='instructions'>Test passes if shading in both orange boxes is identical.</div> <div dir="ltr"> -<pre class="test">XXX -‏XXX</pre> +<pre class="test">TES +‏ING</pre> </div> -<div class="ref"><div id="rb1"></div></div> +<div class="ref">REF<br>ERE</div> <!-- Notes: The &rlm isn't in the Ahem font, so it may cause a spurious effect, such as a thin white line in the middle of a block in IE. This should be ignored. The test needs a RTL character in the Ahem font, so that the &RLM can be removed. --> </body> -</html> \ No newline at end of file +</html>
diff --git a/third_party/blink/web_tests/external/wpt/css/css-view-transitions/duplicate-tag-rejects-capture.html b/third_party/blink/web_tests/external/wpt/css/css-view-transitions/duplicate-tag-rejects-capture.html new file mode 100644 index 0000000..517502b6 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/css/css-view-transitions/duplicate-tag-rejects-capture.html
@@ -0,0 +1,47 @@ +<!DOCTYPE html> +<html class=reftest-wait> +<title>View transitions: duplicate tags in the old DOM skip the transition</title> +<link rel="help" href="https://www.w3.org/TR/css-view-transitions-1/"> +<link rel="author" href="mailto:khushalsagar@chromium.org"> + +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> + +<style> +div { + width: 100px; + height: 100px; + background: blue; + contain: paint; +} +</style> + +<div id=first></div> +<div id=second></div> + +<script> +promise_test(async t => { + return new Promise((resolve, reject) => { + first.style = "view-transition-name: target"; + second.style = "view-transition-name: target"; + let transition = document.startViewTransition(); + + // Ready rejected first since invoking the dom callback is an async task. + let readyRejected = false; + transition.ready.then(reject, () => {readyRejected = true;}); + + // The domUpdate promise resolves (since there is no callback). + let domUpdatedResolved = false; + transition.domUpdated.then(() => { + assert_true(readyRejected, "ready not rejected before domUpdated"); + domUpdatedResolved = true; + }, reject); + + // Finally finish resolves. + transition.finished.then(() => { + assert_true(domUpdatedResolved, "domUpdated not resolved before finish"); + resolve(); + }, reject); + }); +}, "Two different elements with the same name in the old DOM should skip the transition"); +</script>
diff --git a/third_party/blink/web_tests/external/wpt/css/css-view-transitions/duplicate-tag-rejects-start.html b/third_party/blink/web_tests/external/wpt/css/css-view-transitions/duplicate-tag-rejects-start.html new file mode 100644 index 0000000..2d99717 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/css/css-view-transitions/duplicate-tag-rejects-start.html
@@ -0,0 +1,49 @@ +<!DOCTYPE html> +<html class=reftest-wait> +<title>View transitions: duplicate tags in the new DOM skip the transition</title> +<link rel="help" href="https://www.w3.org/TR/css-view-transitions-1/"> +<link rel="author" href="mailto:khushalsagar@chromium.org"> + +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> + +<style> +div { + width: 100px; + height: 100px; + background: blue; + contain: paint; +} +</style> + +<div id=first></div> +<div id=second></div> + +<script> +promise_test(async t => { + return new Promise((resolve, reject) => { + first.style = "view-transition-name: target"; + let transition = document.startViewTransition(() => { + first.style = "view-transition-name: target"; + second.style = "view-transition-name: target"; + }); + + // First domUpdated resolves since the callback runs successfully. + let domUpdatedResolved = false; + transition.domUpdated.then(() => { domUpdatedResolved = true; }, reject); + + // Then finished resolves since domUpdated was already resolved. + let finishResolved = false; + transition.domUpdated.then(() => { + assert_true(domUpdatedResolved, "domUpdated not resolved before finish"); + finishResolved = true; + }, reject); + + // Finally ready rejects. + transition.ready.then(reject, () => { + assert_true(finishResolved, "finish not resolved before ready"); + resolve(); + }); + }); +}, "Two different elements with the same name in the new DOM should skip the transition"); +</script>
diff --git a/third_party/blink/web_tests/external/wpt/css/css-view-transitions/duplicate_tag_rejects.html b/third_party/blink/web_tests/external/wpt/css/css-view-transitions/duplicate_tag_rejects.html deleted file mode 100644 index c7aef2a..0000000 --- a/third_party/blink/web_tests/external/wpt/css/css-view-transitions/duplicate_tag_rejects.html +++ /dev/null
@@ -1,46 +0,0 @@ -<!DOCTYPE html> -<html class=reftest-wait> -<title>Shared transitions: root tag is reserved</title> -<link rel="help" href="https://github.com/WICG/view-transitions"> -<link rel="author" href="mailto:vmpstr@chromium.org"> - -<script src="/resources/testharness.js"></script> -<script src="/resources/testharnessreport.js"></script> - -<style> -div { - width: 100px; - height: 100px; - background: blue; - contain: paint; -} -</style> - -<div id=first></div> -<div id=second></div> - -<script> -promise_test(async t => { - return new Promise((resolve, reject) => { - first.style = "view-transition-name: target"; - second.style = "view-transition-name: target"; - let transition = document.startViewTransition(); - transition.ready.then(() => {}, () => {}); - transition.domUpdated.then(() => {}, () => {}); - transition.finished.then(reject, resolve); - }); -}, "Two different elements with the same tag rejects capture"); - -promise_test(async t => { - return new Promise((resolve, reject) => { - first.style = "view-transition-name: target"; - let transition = document.startViewTransition(() => { - first.style = "view-transition-name: target"; - second.style = "view-transition-name: target"; - }); - transition.ready.then(() => {}, () => {}); - transition.domUpdated.then(() => {}, () => {}); - transition.finished.then(reject, resolve); - }); -}, "Two different elements with the same tag rejects start"); -</script>
diff --git a/third_party/blink/web_tests/external/wpt/css/css-view-transitions/new-content-element-writing-modes.html b/third_party/blink/web_tests/external/wpt/css/css-view-transitions/new-content-element-writing-modes.html index 4c2268f..0c50e22 100644 --- a/third_party/blink/web_tests/external/wpt/css/css-view-transitions/new-content-element-writing-modes.html +++ b/third_party/blink/web_tests/external/wpt/css/css-view-transitions/new-content-element-writing-modes.html
@@ -27,6 +27,9 @@ contain: paint; border: 1px solid black; } +.source { + contain: layout; +} #target { background: red; position: absolute;
diff --git a/third_party/blink/web_tests/external/wpt/css/css-view-transitions/new-content-object-fit-fill.html b/third_party/blink/web_tests/external/wpt/css/css-view-transitions/new-content-object-fit-fill.html index 47c7f77..5b1941a 100644 --- a/third_party/blink/web_tests/external/wpt/css/css-view-transitions/new-content-object-fit-fill.html +++ b/third_party/blink/web_tests/external/wpt/css/css-view-transitions/new-content-object-fit-fill.html
@@ -29,6 +29,7 @@ width: 10px; height: 10px; view-transition-name: hidden; + contain: layout; } html::view-transition-group(target) {
diff --git a/third_party/blink/web_tests/external/wpt/css/css-view-transitions/new-content-object-fit-none.html b/third_party/blink/web_tests/external/wpt/css/css-view-transitions/new-content-object-fit-none.html index be47769..d3e4d2d 100644 --- a/third_party/blink/web_tests/external/wpt/css/css-view-transitions/new-content-object-fit-none.html +++ b/third_party/blink/web_tests/external/wpt/css/css-view-transitions/new-content-object-fit-none.html
@@ -21,6 +21,7 @@ width: 10px; height: 10px; view-transition-name: hidden; + contain: layout; } html::view-transition-group(target) {
diff --git a/third_party/blink/web_tests/external/wpt/css/css-view-transitions/no-containment-on-new-element-mid-transition.html b/third_party/blink/web_tests/external/wpt/css/css-view-transitions/no-containment-on-new-element-mid-transition.html new file mode 100644 index 0000000..869fd24f --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/css/css-view-transitions/no-containment-on-new-element-mid-transition.html
@@ -0,0 +1,37 @@ +<!DOCTYPE html> +<html class=reftest-wait> +<title>View transitions: transition skipped if no containment on new element after animation started</title> +<link rel="help" href="https://www.w3.org/TR/css-view-transitions-1/"> +<link rel="author" href="mailto:khushalsagar@chromium.org"> + +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> + +<style> +div { + width: 100px; + height: 100px; + background: blue; + view-transition-name: target; + contain: paint; +} + +html::view-transition-group(target) { + animation-duration: 300s; +} +</style> + +<div id=first></div> + +<script> +promise_test(async t => { + return new Promise(async (resolve, reject) => { + let transition = document.startViewTransition(); + await transition.domUpdated; + await transition.ready; + + transition.finished.then(resolve, reject); + first.style.contain = "none"; + }); +}, "new element becoming uncontained should skip the transition"); +</script>
diff --git a/third_party/blink/web_tests/external/wpt/css/css-view-transitions/no-containment-on-new-element.html b/third_party/blink/web_tests/external/wpt/css/css-view-transitions/no-containment-on-new-element.html new file mode 100644 index 0000000..ecb05373 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/css/css-view-transitions/no-containment-on-new-element.html
@@ -0,0 +1,46 @@ +<!DOCTYPE html> +<html class=reftest-wait> +<title>View transitions: transition skipped if no containment on new element</title> +<link rel="help" href="https://www.w3.org/TR/css-view-transitions-1/"> +<link rel="author" href="mailto:khushalsagar@chromium.org"> + +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> + +<style> +div { + width: 100px; + height: 100px; + background: blue; + view-transition-name: target; + contain: paint; +} +</style> + +<div id=first></div> + +<script> +promise_test(async t => { + return new Promise(async (resolve, reject) => { + let transition = document.startViewTransition(() => { + first.style.contain = "none"; + }); + + let readyRejected = false; + transition.ready.then(reject, () => { readyRejected = true; }); + + let domUpdated = false; + transition.domUpdated.then(() => { domUpdated = true; }, reject); + transition.finished.then(() => { + assert_true(readyRejected, "ready not rejected"); + assert_true(domUpdated, "dom not updated"); + + if (window.getComputedStyle(first).contain == "none") + resolve(); + else + reject("dom update callback did not run"); + + }, reject); + }); +}, "uncontained new element should skip the transition"); +</script>
diff --git a/third_party/blink/web_tests/external/wpt/css/css-view-transitions/no-containment-on-old-element.html b/third_party/blink/web_tests/external/wpt/css/css-view-transitions/no-containment-on-old-element.html new file mode 100644 index 0000000..22cad09 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/css/css-view-transitions/no-containment-on-old-element.html
@@ -0,0 +1,45 @@ +<!DOCTYPE html> +<html class=reftest-wait> +<title>View transitions: transition skipped if no containment on old element</title> +<link rel="help" href="https://www.w3.org/TR/css-view-transitions-1/"> +<link rel="author" href="mailto:khushalsagar@chromium.org"> + +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> + +<style> +div { + width: 100px; + height: 100px; + background: blue; + view-transition-name: target; +} +</style> + +<div id=first></div> + +<script> +promise_test(async t => { + return new Promise(async (resolve, reject) => { + let transition = document.startViewTransition(() => { + first.style.contain = "paint"; + }); + + let readyRejected = false; + transition.ready.then(reject, () => { readyRejected = true; }); + + let domUpdated = false; + transition.domUpdated.then(() => { domUpdated = true; }, reject); + transition.finished.then(() => { + assert_true(readyRejected, "ready not rejected"); + assert_true(domUpdated, "dom not updated"); + + if (window.getComputedStyle(first).contain == "paint") + resolve(); + else + reject("dom update callback did not run"); + + }, reject); + }); +}, "uncontained old element should skip the transition"); +</script>
diff --git a/third_party/blink/web_tests/external/wpt/css/css-view-transitions/old-content-object-fit-fill.html b/third_party/blink/web_tests/external/wpt/css/css-view-transitions/old-content-object-fit-fill.html index 587c05c..75dc628 100644 --- a/third_party/blink/web_tests/external/wpt/css/css-view-transitions/old-content-object-fit-fill.html +++ b/third_party/blink/web_tests/external/wpt/css/css-view-transitions/old-content-object-fit-fill.html
@@ -29,6 +29,7 @@ width: 10px; height: 10px; view-transition-name: hidden; + contain: layout; } html::view-transition-group(target) {
diff --git a/third_party/blink/web_tests/external/wpt/css/css-view-transitions/old-content-object-fit-none.html b/third_party/blink/web_tests/external/wpt/css/css-view-transitions/old-content-object-fit-none.html index 71f3f54..c40ad13 100644 --- a/third_party/blink/web_tests/external/wpt/css/css-view-transitions/old-content-object-fit-none.html +++ b/third_party/blink/web_tests/external/wpt/css/css-view-transitions/old-content-object-fit-none.html
@@ -21,6 +21,7 @@ width: 10px; height: 10px; view-transition-name: hidden; + contain: layout; } html::view-transition-group(target) {
diff --git a/third_party/blink/web_tests/external/wpt/css/css-view-transitions/pseudo-computed-style-stays-in-sync-with-new-element.html b/third_party/blink/web_tests/external/wpt/css/css-view-transitions/pseudo-computed-style-stays-in-sync-with-new-element.html new file mode 100644 index 0000000..b1ed783b --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/css/css-view-transitions/pseudo-computed-style-stays-in-sync-with-new-element.html
@@ -0,0 +1,41 @@ +<!DOCTYPE html> +<html class=reftest-wait> +<title>View transitions: computed style on pseudo-element stays in sync with the DOM element</title> +<link rel="help" href="https://www.w3.org/TR/css-view-transitions-1/"> +<link rel="author" href="mailto:khushalsagar@chromium.org"> + +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> + +<style> +div { + width: 100px; + height: 100px; + background: blue; + view-transition-name: target; + contain: paint; +} +</style> + +<div id=first></div> + +<script> +promise_test(async t => { + return new Promise(async (resolve, reject) => { + let transition = document.startViewTransition(); + await transition.domUpdated; + await transition.ready; + + let viewbox = window.getComputedStyle( + document.documentElement, "::view-transition-new(target)").objectViewBox; + assert_equals(viewbox, "none", "incorrect viewbox " + viewbox); + + first.style.filter = "blur(5px)"; + viewbox = window.getComputedStyle( + document.documentElement, "::view-transition-new(target)").objectViewBox; + assert_not_equals(viewbox, "none", "incorrect viewbox " + viewbox); + + transition.finished.then(resolve, reject); + }); +}, "computed style on pseudo-element stays in sync with the DOM element"); +</script>
diff --git a/third_party/blink/web_tests/external/wpt/css/css-view-transitions/synchronous-callback-skipped-before-run.html b/third_party/blink/web_tests/external/wpt/css/css-view-transitions/synchronous-callback-skipped-before-run.html new file mode 100644 index 0000000..1bda2434 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/css/css-view-transitions/synchronous-callback-skipped-before-run.html
@@ -0,0 +1,36 @@ +<!DOCTYPE html> +<html class=reftest-wait> +<title>View transitions: skipTransition() invoked before a synchronous updateDOM callback is invoked</title> +<link rel="help" href="https://www.w3.org/TR/css-view-transitions-1/"> +<link rel="author" href="mailto:khushalsagar@chromium.org"> + +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> + +<style> +div { + width: 100px; + height: 100px; + background: blue; + contain: paint; +} +</style> + +<div id=first></div> + +<script> +promise_test(async t => { + return new Promise(async (resolve, reject) => { + let transition = document.startViewTransition(() => { + first.style.viewTransitionName = "target"; + }); + transition.skipTransition(); + await transition.finished; + + if (window.getComputedStyle(first).viewTransitionName == "target") + resolve(); + else + reject(); + }); +}, "finished promise should be resolved if skipTransition() is invoked before a synchronous domUpdated callback is dispatched"); +</script>
diff --git a/third_party/blink/web_tests/external/wpt/css/css-view-transitions/transition-skipped-after-animation-started.html b/third_party/blink/web_tests/external/wpt/css/css-view-transitions/transition-skipped-after-animation-started.html new file mode 100644 index 0000000..78f32de --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/css/css-view-transitions/transition-skipped-after-animation-started.html
@@ -0,0 +1,36 @@ +<!DOCTYPE html> +<html class=reftest-wait> +<title>View transitions: skipTransition() after animations have started running should resolve finished promise</title> +<link rel="help" href="https://www.w3.org/TR/css-view-transitions-1/"> +<link rel="author" href="mailto:khushalsagar@chromium.org"> + +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> + +<style> +div { + width: 100px; + height: 100px; + background: blue; + contain: paint; + view-transition-name: target; +} + +::view-transition-group(target) { + animation-duration: 300s; +} +</style> + +<div id=first></div> + +<script> +promise_test(async t => { + return new Promise(async (resolve, reject) => { + let transition = document.startViewTransition(); + await transition.ready; + transition.skipTransition(); + await transition.finished; + resolve(); + }); +}, "skipTransition() after animations have started running should resolve finished promise"); +</script>
diff --git a/third_party/blink/web_tests/external/wpt/css/css-view-transitions/transition-skipped-from-invalid-callback.html b/third_party/blink/web_tests/external/wpt/css/css-view-transitions/transition-skipped-from-invalid-callback.html new file mode 100644 index 0000000..4a56f81 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/css/css-view-transitions/transition-skipped-from-invalid-callback.html
@@ -0,0 +1,45 @@ +<!DOCTYPE html> +<html class=reftest-wait> +<title>View transitions: transition skipped in animation phase</title> +<link rel="help" href="https://www.w3.org/TR/css-view-transitions-1/"> +<link rel="author" href="mailto:khushalsagar@chromium.org"> + +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> + +<style> +div { + width: 100px; + height: 100px; + background: blue; + contain: paint; + view-transition-name: target; +} + +::view-transition-group(target) { + animation-duration: 300s; +} +</style> + +<div id=first></div> + +<script> +promise_test(async t => { + return new Promise(async (resolve, reject) => { + let transition = document.startViewTransition(() => { + let foo = bar; + }); + + let readyRejected = false; + transition.ready.then(reject, () => { readyRejected = true; }); + + let domUpdateRejected = false; + transition.domUpdated.then(reject, () => { domUpdateRejected = true; }); + transition.finished.then(reject, () => { + assert_true(readyRejected, "ready not rejected"); + assert_true(domUpdateRejected, "dom update not rejected"); + resolve(); + }); + }); +}, "transition skipped because callback has invalid syntax"); +</script>
diff --git a/third_party/blink/web_tests/external/wpt/css/css-view-transitions/uncontained-transition-crash.html b/third_party/blink/web_tests/external/wpt/css/css-view-transitions/uncontained-transition-crash.html deleted file mode 100644 index 98632508..0000000 --- a/third_party/blink/web_tests/external/wpt/css/css-view-transitions/uncontained-transition-crash.html +++ /dev/null
@@ -1,57 +0,0 @@ -<!DOCTYPE html> -<html class=reftest-wait> -<title>When paint containment is not present we should still run animation.</title> -<link rel="help" href="https://github.com/vmpstr/view-transitions"> -<link rel="author" href="mailto:vmpstr@chromium.org"> - -<script src="/common/rendering-utils.js"></script> -<script src="/common/reftest-wait.js"></script> - -<style> -div { - width: 10px; - height: 10px; - top: 10px; - left: 10px; - position: relative; - background: blue; -} -.green { background: green; } -</style> - -<div id=first></div> -<div id=second></div> - -<script> -function rafAnimation() { - first.classList.toggle("green"); - requestAnimationFrame(rafAnimation); -} - -async function runTest() { - await waitForAtLeastOneFrame(); - // Prepare with a shared element - first.style.viewTransitionName = "shared"; - let t = document.startViewTransition(() => { - first.style.viewTransitionName = ""; - second.style.viewTransitionName = "shared"; - }); - - // The start() call above starts the capture. Force a hit test, which will - // determine compositing reasons. - document.elementFromPoint(0, 0); - - // Wait for the transition to finish. This will note that we don't have - // paint containment and should de-composite the element. - await t.finished; - - takeScreenshot(); -} - -onload = runTest; - -// Continually run raf animation which should paint every frame. -rafAnimation(); -</script> - -</html>
diff --git a/third_party/blink/web_tests/external/wpt/css/css-view-transitions/unset-and-initial-view-transition-name.html b/third_party/blink/web_tests/external/wpt/css/css-view-transitions/unset-and-initial-view-transition-name.html new file mode 100644 index 0000000..93c8eb6 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/css/css-view-transitions/unset-and-initial-view-transition-name.html
@@ -0,0 +1,49 @@ +<!DOCTYPE html> +<html class=reftest-wait> +<title>View transitions: validates that view-transition-name: unset or initial are ignored</title> +<link rel="help" href="https://www.w3.org/TR/css-view-transitions-1/"> +<link rel="author" href="mailto:khushalsagar@chromium.org"> + +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> + +<style> +#first { + width: 100px; + height: 100px; + background: blue; + contain: paint; + view-transition-name: target; +} +#second { + width: 100px; + height: 100px; + background: blue; + view-transition-name: unset; +} +#third { + width: 100px; + height: 100px; + background: blue; + view-transition-name: initial; +} +</style> + +<div id=first></div> +<div id=second></div> +<div id=third></div> + +<script> +promise_test(async t => { + return new Promise(async (resolve, reject) => { + let transition = document.startViewTransition(); + await transition.domUpdated; + + // Elements with view-transition-name: initial and unset don't have + // containment. Because they are ignored they don't cause the transition to + // be skipped. + await transition.ready; + transition.finished.then(resolve, reject); + }); +}, "validates that view-transition-name: unset or initial are ignored"); +</script>
diff --git a/third_party/blink/web_tests/external/wpt/css/css-view-transitions/view-transition-name-on-added-element.html b/third_party/blink/web_tests/external/wpt/css/css-view-transitions/view-transition-name-on-added-element.html new file mode 100644 index 0000000..cd95797 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/css/css-view-transitions/view-transition-name-on-added-element.html
@@ -0,0 +1,36 @@ +<!DOCTYPE html> +<html class=reftest-wait> +<title>View transitions: ensures view-transition-name is tracked on element added by script</title> +<link rel="help" href="https://www.w3.org/TR/css-view-transitions-1/"> +<link rel="author" href="mailto:khushalsagar@chromium.org"> + +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> + +<style> +#first { + width: 100px; + height: 100px; + background: blue; + view-transition-name: first; +} +</style> +<body> + <div> + <div id=first></div> + </div> +</body> +<script> +promise_test(async t => { + return new Promise((resolve, reject) => { + // Remove and add an uncontained element. Even though this element doesn't + // create a stacking context its verified during the transition. + const element = document.getElementById("first"); + element.remove(); + document.body.appendChild(element); + + let transition = document.startViewTransition(); + transition.ready.then(reject, resolve); + }); +}, "view-transition-name on an element added by script should be visited when discovering named elements"); +</script>
diff --git a/third_party/blink/web_tests/external/wpt/css/css-view-transitions/view-transition-name-on-removed-element.html b/third_party/blink/web_tests/external/wpt/css/css-view-transitions/view-transition-name-on-removed-element.html new file mode 100644 index 0000000..4a26a81 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/css/css-view-transitions/view-transition-name-on-removed-element.html
@@ -0,0 +1,35 @@ +<!DOCTYPE html> +<html class=reftest-wait> +<title>View transitions: ensures view-transition-name is not tracked on element removed by script</title> +<link rel="help" href="https://www.w3.org/TR/css-view-transitions-1/"> +<link rel="author" href="mailto:khushalsagar@chromium.org"> + +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> + +<style> +#first { + width: 100px; + height: 100px; + background: blue; + view-transition-name: first; +} +</style> +<body> + <div> + <div id=first></div> + </div> +</body> +<script> +promise_test(async t => { + return new Promise(async (resolve, reject) => { + // Remove an uncontained element. Because this element is not visited when + // discovering named elements, the transition is not skipped. + first.remove(); + + let transition = document.startViewTransition(); + await transition.ready; + transition.finished.then(resolve, reject); + }); +}, "view-transition-name on an element removed by script should not be visited when discovering named elements"); +</script>
diff --git a/third_party/blink/web_tests/view-transition/parent-transition-cancels-child-expected.html b/third_party/blink/web_tests/view-transition/parent-transition-cancels-child-expected.html new file mode 100644 index 0000000..2f513dc --- /dev/null +++ b/third_party/blink/web_tests/view-transition/parent-transition-cancels-child-expected.html
@@ -0,0 +1,48 @@ +<!DOCTYPE html> + +<html> +<head> + <style> + .old { + position: fixed; + top: 0; + left: 0; + width: 50vw; + height: 100vh; + background: lightblue; + } + + .new { + position: fixed; + top: 0; + left: 50vw; + width: 50vw; + height: 100vh; + background: lightgreen; + } + + .frame { + width: 50px; + height: 100px; + } + + .frame_hidden { + width: 5px; + height: 10px; + background: blue; + } + </style> +</head> +<body> + <div class="old"> + <div class="frame" style="background: white;"> + <div class="frame_hidden"></div> + </div> + </div> + <div class="new"> + <div class="frame" style="background: grey;"> + <div class="frame_hidden"></div> + </div> + </div> +</body> +</html>
diff --git a/third_party/blink/web_tests/view-transition/parent-transition-cancels-child.html b/third_party/blink/web_tests/view-transition/parent-transition-cancels-child.html new file mode 100644 index 0000000..72eb7d98 --- /dev/null +++ b/third_party/blink/web_tests/view-transition/parent-transition-cancels-child.html
@@ -0,0 +1,77 @@ +<!DOCTYPE html> + +<html> +<head> + <style> + iframe { + position: fixed; + top: 0; + left: 0; + width: 100px; + height: 100px; + border: unset; + } + + .hidden { + width: 10px; + height: 10px; + background: red; + view-transition-name: hidden; + contain: layout; + } + + ::view-transition-group(hidden) { + animation-duration: 300s; + visibility: hidden; + } + + ::view-transition-old(root) { + position: fixed; + top: 0; + left: 0; + width: 50vw; + height: 100vh; + animation: unset; + opacity: 1; + } + ::view-transition-new(root) { + position: fixed; + top: 0; + left: 50vw; + width: 50vw; + height: 100vh; + animation: unset; + opacity: 1; + } + </style> +</head> +<body> + <iframe id="frame" src="./resources/iframe.html"></iframe> + <div class="hidden"></div> + <script> + async function startTransitionInIframe() { + let nestedDocument = frame.contentWindow.document; + await nestedDocument.startViewTransition(() => { + nestedDocument.body.style.background = "grey"}).finished; + } + + async function runTest() { + document.body.style.background = "lightblue"; + await document.startViewTransition(() => { + document.body.style.background = "lightgreen"; + }).ready; + + await startTransitionInIframe(); + + if (window.testRunner) + window.testRunner.notifyDone(); + } + + window.onload = function() { + if (window.testRunner) + window.testRunner.waitUntilDone(); + requestAnimationFrame(runTest); + } + </script> +</body> +</html>
diff --git a/third_party/blink/web_tests/view-transition/resources/iframe.html b/third_party/blink/web_tests/view-transition/resources/iframe.html new file mode 100644 index 0000000..4ecbe36 --- /dev/null +++ b/third_party/blink/web_tests/view-transition/resources/iframe.html
@@ -0,0 +1,35 @@ +<!DOCTYPE html> + +<html> +<head> + <style> + body { + background: white; + } + + .hidden { + position: fixed; + top: 0; + left: 0; + width: 10px; + height: 10px; + background: blue; + + view-transition-name: hidden; + contain: layout; + } + + ::view-transition-group(*) { + animation-duration: 300s; + visibility: hidden; + } + + ::view-transition { + background: blue; + } + </style> +</head> +<body> + <div class="hidden"></div> +</body> +</html>
diff --git a/third_party/blink/web_tests/view-transition/sibling-transitions-cancel-each-other-expected.html b/third_party/blink/web_tests/view-transition/sibling-transitions-cancel-each-other-expected.html new file mode 100644 index 0000000..8c2e13d --- /dev/null +++ b/third_party/blink/web_tests/view-transition/sibling-transitions-cancel-each-other-expected.html
@@ -0,0 +1,20 @@ +<!DOCTYPE html> + +<html> +<head> + <style> + div { + position: fixed; + top: 0; + left: 0; + width: 100px; + height: 100px; + border: unset; + } + </style> +</head> +<body> + <div style="background: grey;"></div> + <div style="background: blue;"></div> +</body> +</html>
diff --git a/third_party/blink/web_tests/view-transition/sibling-transitions-cancel-each-other.html b/third_party/blink/web_tests/view-transition/sibling-transitions-cancel-each-other.html new file mode 100644 index 0000000..d3842ae0 --- /dev/null +++ b/third_party/blink/web_tests/view-transition/sibling-transitions-cancel-each-other.html
@@ -0,0 +1,41 @@ +<!DOCTYPE html> + +<html> +<head> + <style> + iframe { + position: fixed; + top: 0; + left: 0; + width: 100px; + height: 100px; + border: unset; + } + </style> +</head> +<body> + <iframe id="cancelled" src="./resources/iframe.html"></iframe> + <iframe id="active" src="./resources/iframe.html"></iframe> + <script> + async function startTransitionInIframe(frame) { + let nestedDocument = frame.contentWindow.document; + await nestedDocument.startViewTransition(() => { + nestedDocument.body.style.background = "grey"}).ready; + } + + async function runTest() { + await startTransitionInIframe(cancelled); + await startTransitionInIframe(active); + + if (window.testRunner) + window.testRunner.notifyDone(); + } + + window.onload = function() { + if (window.testRunner) + window.testRunner.waitUntilDone(); + requestAnimationFrame(runTest); + } + </script> +</body> +</html>
diff --git a/third_party/nearby/README.chromium b/third_party/nearby/README.chromium index 6254108..d92fc80 100644 --- a/third_party/nearby/README.chromium +++ b/third_party/nearby/README.chromium
@@ -1,7 +1,7 @@ Name: Nearby Connections Library Short Name: Nearby URL: https://github.com/google/nearby -Version: e58dd0a5977fa551c8985f913b389940846130a9 +Version: 141f021140534d3b7c03afc759f43fcc2ece6c97 License: Apache 2.0 License File: LICENSE Security Critical: yes
diff --git a/third_party/omnibox_proto/entity_info.proto b/third_party/omnibox_proto/entity_info.proto index bda28bb..45a7f7f 100644 --- a/third_party/omnibox_proto/entity_info.proto +++ b/third_party/omnibox_proto/entity_info.proto
@@ -13,31 +13,29 @@ // Entity Suggest rendering data. message EntityInfo { // The entity id. - optional string mid = 1; - - // The query to submit when clicking the suggestion. - optional string query_to_submit = 2; - - // Will replace the original suggestion as the text on the suggestion's 1st - // line (title). - optional string first_line = 3; + optional string entity_id = 1; // The suggestion second line (subtitle). // For some clients (e.g. desktop) this is used as the part which is to the // right of the emdash. - optional string second_line = 4; + optional string annotation = 2; - // Encoding of how search behavior should be modified when clicking the entity - // suggestion (gs_ssp). - // Controls for example - force triggering of KP@1 and twiddling the search - // results to boost results for the entity. - optional string search_parameters = 5; + // The query to submit when clicking the suggestion. + optional string query_to_submit = 3; // Image Url. // Will replace the suggestion icon optional string image_url = 6; + // Will replace the original suggestion as the text on the suggestion's 1st + // line (title). + optional string name = 7; + // Dominant color. // Affects how image is rendered. - optional string dominant_color = 7; + optional string dominant_color = 9; + + // Encoding of how search behavior should be modified when clicking the entity + // suggestion (gs_ssp). + optional string suggest_search_parameters = 10; }
diff --git a/tools/clang/plugins/CMakeLists.txt b/tools/clang/plugins/CMakeLists.txt index d07457f8..daf84e8 100644 --- a/tools/clang/plugins/CMakeLists.txt +++ b/tools/clang/plugins/CMakeLists.txt
@@ -6,6 +6,7 @@ FindBadRawPtrPatterns.cpp CheckIPCVisitor.cpp CheckLayoutObjectMethodsVisitor.cpp + RawPtrHelpers.cpp Util.cpp )
diff --git a/tools/clang/plugins/FindBadConstructsAction.cpp b/tools/clang/plugins/FindBadConstructsAction.cpp index c6ea3bc..a8094ee 100644 --- a/tools/clang/plugins/FindBadConstructsAction.cpp +++ b/tools/clang/plugins/FindBadConstructsAction.cpp
@@ -11,6 +11,26 @@ using namespace clang; +namespace { + +// Name of a cmdline parameter that can be used to specify a file listing fields +// that should not be rewritten to use raw_ptr<T>. +// +// See also: +// - OutputSectionHelper +// - FilterFile +const char kExcludeFieldsArgPrefix[] = "exclude-fields="; + +// Name of a cmdline parameter that can be used to specify a file listing +// regular expressions describing paths that should be excluded from the +// rewrite. +// +// See also: +// - PathFilterFile +const char kExcludePathsArgPrefix[] = "exclude-paths="; + +} // namespace + namespace chrome_checker { namespace { @@ -41,29 +61,35 @@ bool FindBadConstructsAction::ParseArgs(const CompilerInstance& instance, const std::vector<std::string>& args) { - bool parsed = true; - - for (size_t i = 0; i < args.size() && parsed; ++i) { - if (args[i] == "check-base-classes") { + for (llvm::StringRef arg : args) { + if (arg.startswith(kExcludeFieldsArgPrefix)) { + options_.exclude_fields_file = + arg.substr(strlen(kExcludeFieldsArgPrefix)).str(); + } else if (arg.startswith(kExcludePathsArgPrefix)) { + options_.exclude_paths_file = + arg.substr(strlen(kExcludePathsArgPrefix)).str(); + } else if (arg == "check-base-classes") { // TODO(rsleevi): Remove this once http://crbug.com/123295 is fixed. options_.check_base_classes = true; - } else if (args[i] == "check-blink-data-member-type") { + } else if (arg == "check-blink-data-member-type") { options_.check_blink_data_member_type = true; - } else if (args[i] == "check-ipc") { + } else if (arg == "check-ipc") { options_.check_ipc = true; - } else if (args[i] == "check-layout-object-methods") { + } else if (arg == "check-layout-object-methods") { options_.check_layout_object_methods = true; - } else if (args[i] == "raw-ref-template-as-trivial-member") { + } else if (arg == "raw-ref-template-as-trivial-member") { options_.raw_ref_template_as_trivial_member = true; - } else if (args[i] == "check-bad-raw-ptr-cast") { + } else if (arg == "check-bad-raw-ptr-cast") { options_.check_bad_raw_ptr_cast = true; + } else if (arg == "check-raw-ptr-fields") { + options_.check_raw_ptr_fields = true; } else { - parsed = false; - llvm::errs() << "Unknown clang plugin argument: " << args[i] << "\n"; + llvm::errs() << "Unknown clang plugin argument: " << arg << "\n"; + return false; } } - return parsed; + return true; } } // namespace chrome_checker
diff --git a/tools/clang/plugins/FindBadRawPtrPatterns.cpp b/tools/clang/plugins/FindBadRawPtrPatterns.cpp index 7cbf997..8a295cf 100644 --- a/tools/clang/plugins/FindBadRawPtrPatterns.cpp +++ b/tools/clang/plugins/FindBadRawPtrPatterns.cpp
@@ -1,9 +1,9 @@ // Copyright 2022 The Chromium Authors // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. - #include "FindBadRawPtrPatterns.h" +#include "RawPtrHelpers.h" #include "Util.h" #include "clang/AST/AST.h" #include "clang/AST/ASTConsumer.h" @@ -12,10 +12,8 @@ #include "clang/AST/TypeLoc.h" #include "clang/ASTMatchers/ASTMatchFinder.h" #include "clang/ASTMatchers/ASTMatchers.h" -#include "clang/ASTMatchers/ASTMatchersMacros.h" #include "clang/Basic/SourceLocation.h" #include "clang/Basic/SourceManager.h" -#include "llvm/Support/LineIterator.h" using namespace clang; using namespace clang::ast_matchers; @@ -89,15 +87,64 @@ unsigned error_bad_raw_ptr_cast_signature_; }; +const char kNeedRawPtrSignature[] = + "[chromium-rawptr] Use raw_ptr<T> instead of a raw pointer."; + +class RawPtrFieldMatcher : public MatchFinder::MatchCallback { + public: + explicit RawPtrFieldMatcher(clang::CompilerInstance& compiler, + const std::string& exclude_fields_file, + const std::string& exclude_paths_file) + : compiler_(compiler), + fields_to_exclude_(std::make_unique<FilterFile>(exclude_fields_file, + "exclude-fields")), + paths_to_exclude_( + std::make_unique<FilterFile>(exclude_paths_file, "exclude-paths")) { + error_need_raw_ptr_signature_ = compiler_.getDiagnostics().getCustomDiagID( + clang::DiagnosticsEngine::Error, kNeedRawPtrSignature); + } + + void Register(MatchFinder& match_finder) { + auto field_decl_matcher = + AffectedRawPtrFieldDecl(fields_to_exclude_.get(), paths_to_exclude_.get()); + match_finder.addMatcher(field_decl_matcher, this); + } + void run(const MatchFinder::MatchResult& result) override { + const clang::FieldDecl* field_decl = + result.Nodes.getNodeAs<clang::FieldDecl>("affectedFieldDecl"); + assert(field_decl && "matcher should bind 'fieldDecl'"); + + const clang::TypeSourceInfo* type_source_info = + field_decl->getTypeSourceInfo(); + assert(type_source_info && "assuming |type_source_info| is always present"); + + assert(type_source_info->getType()->isPointerType() && + "matcher should only match pointer types"); + + compiler_.getDiagnostics().Report(field_decl->getEndLoc(), + error_need_raw_ptr_signature_); + } + + private: + clang::CompilerInstance& compiler_; + unsigned error_need_raw_ptr_signature_; + std::unique_ptr<FilterFile> fields_to_exclude_; + std::unique_ptr<FilterFile> paths_to_exclude_; +}; + void FindBadRawPtrPatterns(Options options, clang::ASTContext& ast_context, clang::CompilerInstance& compiler) { - if (!options.check_bad_raw_ptr_cast) - return; MatchFinder match_finder; BadCastMatcher bad_cast_matcher(compiler); - bad_cast_matcher.Register(match_finder); + if (options.check_bad_raw_ptr_cast) + bad_cast_matcher.Register(match_finder); + + RawPtrFieldMatcher field_matcher(compiler, options.exclude_fields_file, + options.exclude_paths_file); + if (options.check_raw_ptr_fields) + field_matcher.Register(match_finder); match_finder.matchAST(ast_context); }
diff --git a/tools/clang/plugins/Options.h b/tools/clang/plugins/Options.h index e016193..4174138 100644 --- a/tools/clang/plugins/Options.h +++ b/tools/clang/plugins/Options.h
@@ -5,6 +5,8 @@ #ifndef TOOLS_CLANG_PLUGINS_OPTIONS_H_ #define TOOLS_CLANG_PLUGINS_OPTIONS_H_ +#include <string> + namespace chrome_checker { struct Options { @@ -14,6 +16,9 @@ bool check_layout_object_methods = false; bool raw_ref_template_as_trivial_member = false; bool check_bad_raw_ptr_cast = false; + bool check_raw_ptr_fields = false; + std::string exclude_fields_file; + std::string exclude_paths_file; }; } // namespace chrome_checker
diff --git a/tools/clang/plugins/RawPtrHelpers.cpp b/tools/clang/plugins/RawPtrHelpers.cpp new file mode 100644 index 0000000..3d83b785 --- /dev/null +++ b/tools/clang/plugins/RawPtrHelpers.cpp
@@ -0,0 +1,126 @@ +// Copyright 2022 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "RawPtrHelpers.h" + +#include "clang/ASTMatchers/ASTMatchers.h" +#include "llvm/Support/LineIterator.h" +#include "llvm/Support/MemoryBuffer.h" + +using namespace clang::ast_matchers; + +bool FilterFile::ContainsLine(llvm::StringRef line) const { + auto it = file_lines_.find(line); + return it != file_lines_.end(); +} + +bool FilterFile::ContainsSubstringOf(llvm::StringRef string_to_match) const { + if (!inclusion_substring_regex_.has_value()) { + std::vector<std::string> regex_escaped_inclusion_file_lines; + std::vector<std::string> regex_escaped_exclusion_file_lines; + regex_escaped_inclusion_file_lines.reserve(file_lines_.size()); + for (const llvm::StringRef& file_line : file_lines_.keys()) { + if (file_line.startswith("!")) { + regex_escaped_exclusion_file_lines.push_back( + llvm::Regex::escape(file_line.substr(1))); + } else { + regex_escaped_inclusion_file_lines.push_back( + llvm::Regex::escape(file_line)); + } + } + std::string inclusion_substring_regex_pattern = + llvm::join(regex_escaped_inclusion_file_lines.begin(), + regex_escaped_inclusion_file_lines.end(), "|"); + inclusion_substring_regex_.emplace(inclusion_substring_regex_pattern); + std::string exclusion_substring_regex_pattern = + llvm::join(regex_escaped_exclusion_file_lines.begin(), + regex_escaped_exclusion_file_lines.end(), "|"); + exclusion_substring_regex_.emplace(exclusion_substring_regex_pattern); + } + return inclusion_substring_regex_->match(string_to_match) && + !exclusion_substring_regex_->match(string_to_match); +} + +void FilterFile::ParseInputFile(const std::string& filepath, + const std::string& arg_name) { + if (filepath.empty()) + return; + + llvm::ErrorOr<std::unique_ptr<llvm::MemoryBuffer>> file_or_err = + llvm::MemoryBuffer::getFile(filepath); + if (std::error_code err = file_or_err.getError()) { + llvm::errs() << "ERROR: Cannot open the file specified in --" << arg_name + << " argument: " << filepath << ": " << err.message() << "\n"; + assert(false); + return; + } + + llvm::line_iterator it(**file_or_err, true /* SkipBlanks */, '#'); + for (; !it.is_at_eof(); ++it) { + llvm::StringRef line = *it; + + // Remove trailing comments. + size_t comment_start_pos = line.find('#'); + if (comment_start_pos != llvm::StringRef::npos) + line = line.substr(0, comment_start_pos); + line = line.trim(); + + if (line.empty()) + continue; + + file_lines_.insert(line); + } +} + +clang::ast_matchers::internal::Matcher<clang::FieldDecl> +ImplicitFieldDeclaration() { + auto implicit_class_specialization_matcher = + classTemplateSpecializationDecl(isImplicitClassTemplateSpecialization()); + auto implicit_function_specialization_matcher = + functionDecl(isImplicitFunctionTemplateSpecialization()); + auto implicit_field_decl_matcher = fieldDecl(hasParent(cxxRecordDecl(anyOf( + isLambda(), implicit_class_specialization_matcher, + hasAncestor(decl(anyOf(implicit_class_specialization_matcher, + implicit_function_specialization_matcher))))))); + + return implicit_field_decl_matcher; +} + +clang::ast_matchers::internal::Matcher<clang::Decl> AffectedRawPtrFieldDecl( + FilterFile* paths_to_exclude, + FilterFile* fields_to_exclude) { + // Supported pointer types ========= + // Given + // struct MyStrict { + // int* int_ptr; + // int i; + // int (*func_ptr)(); + // int (MyStruct::* member_func_ptr)(char); + // int (*ptr_to_array_of_ints)[123] + // }; + // matches |int*|, but not the other types. + auto supported_pointer_types_matcher = + pointerType(unless(pointee(hasUnqualifiedDesugaredType( + anyOf(functionType(), memberPointerType(), arrayType()))))); + + // TODO(crbug.com/1381955): Skipping const char pointers as it likely points + // to string literals where raw_ptr isn't necessary. Remove when we have + // implement const char support. + auto const_char_pointer_matcher = + fieldDecl(hasType(pointerType(pointee(qualType(allOf( + isConstQualified(), hasUnqualifiedDesugaredType(anyCharType()))))))); + + auto field_decl_matcher = + fieldDecl( + allOf(hasType(supported_pointer_types_matcher), + unless(anyOf(const_char_pointer_matcher, + isExpansionInSystemHeader(), isInExternCContext(), + isRawPtrExclusionAnnotated(), + isInThirdPartyLocation(), isInGeneratedLocation(), + isInLocationListedInFilterFile(paths_to_exclude), + isFieldDeclListedInFilterFile(fields_to_exclude), + ImplicitFieldDeclaration())))) + .bind("affectedFieldDecl"); + return field_decl_matcher; +}
diff --git a/tools/clang/plugins/RawPtrHelpers.h b/tools/clang/plugins/RawPtrHelpers.h new file mode 100644 index 0000000..9e885c5 --- /dev/null +++ b/tools/clang/plugins/RawPtrHelpers.h
@@ -0,0 +1,185 @@ +// Copyright 2022 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef TOOLS_CLANG_PLUGINS_RAWPTRHELPERS_H_ +#define TOOLS_CLANG_PLUGINS_RAWPTRHELPERS_H_ + +#include "Util.h" +#include "clang/ASTMatchers/ASTMatchers.h" +#include "clang/ASTMatchers/ASTMatchersMacros.h" +#include "llvm/ADT/StringSet.h" +#include "llvm/Support/CommandLine.h" + +// Represents a filter file specified via cmdline. +// +// Filter file format: +// - '#' character starts a comment (which gets ignored). +// - Blank or whitespace-only or comment-only lines are ignored. +// - Other lines are expected to contain a fully-qualified name of a field +// like: +// autofill::AddressField::address1_ # some comment +// - Templates are represented without template arguments, like: +// WTF::HashTable::table_ # some comment +class FilterFile { + public: + explicit FilterFile(const std::string& filepath, + const std::string& arg_name) { + ParseInputFile(filepath, arg_name); + } + + FilterFile(const FilterFile&) = delete; + FilterFile& operator=(const FilterFile&) = delete; + + // Returns true if any of the filter file lines is exactly equal to |line|. + bool ContainsLine(llvm::StringRef line) const; + + // Returns true if |string_to_match| matches based on the filter file lines. + // Filter file lines can contain both inclusions and exclusions in the filter. + // Only returns true if |string_to_match| both matches an inclusion filter and + // is *not* matched by an exclusion filter. + bool ContainsSubstringOf(llvm::StringRef string_to_match) const; + + private: + void ParseInputFile(const std::string& filepath, const std::string& arg_name); + + // Stores all file lines (after stripping comments and blank lines). + llvm::StringSet<> file_lines_; + + // |file_lines_| is partitioned based on whether the line starts with a ! + // (exclusion line) or not (inclusion line). Inclusion lines specify things to + // be matched by the filter. The exclusion lines specify what to force exclude + // from the filter. Lazily-constructed regex that matches strings that contain + // any of the inclusion lines in |file_lines_|. + mutable llvm::Optional<llvm::Regex> inclusion_substring_regex_; + + // Lazily-constructed regex that matches strings that contain any of the + // exclusion lines in |file_lines_|. + mutable llvm::Optional<llvm::Regex> exclusion_substring_regex_; +}; + +AST_MATCHER(clang::Type, anyCharType) { + return Node.isAnyCharacterType(); +} + +AST_MATCHER(clang::FieldDecl, isInThirdPartyLocation) { + std::string filename = GetFilename(Finder->getASTContext().getSourceManager(), + Node.getSourceRange().getBegin()); + + // Blink is part of the Chromium git repo, even though it contains + // "third_party" in its path. + if (filename.find("/third_party/blink/") != std::string::npos) + return false; + // Otherwise, just check if the paths contains the "third_party" substring. + // We don't want to rewrite content of such paths even if they are in the main + // Chromium git repository. + return filename.find("/third_party/") != std::string::npos; +} + +AST_MATCHER(clang::FieldDecl, isInGeneratedLocation) { + std::string filename = GetFilename(Finder->getASTContext().getSourceManager(), + Node.getSourceRange().getBegin()); + + return filename.find("/gen/") != std::string::npos; +} + +AST_MATCHER_P(clang::FieldDecl, + isFieldDeclListedInFilterFile, + const FilterFile*, + Filter) { + return Filter->ContainsLine(Node.getQualifiedNameAsString()); +} + +AST_MATCHER_P(clang::FieldDecl, + isInLocationListedInFilterFile, + const FilterFile*, + Filter) { + clang::SourceLocation loc = Node.getSourceRange().getBegin(); + if (loc.isInvalid() || !loc.isFileID()) + return false; + std::string file_path = + GetFilename(Finder->getASTContext().getSourceManager(), loc); + return Filter->ContainsSubstringOf(file_path); +} + +AST_MATCHER(clang::Decl, isInExternCContext) { + return Node.getLexicalDeclContext()->isExternCContext(); +} + +// Given: +// template <typename T, typename T2> class MyTemplate {}; // Node1 and Node4 +// template <typename T2> class MyTemplate<int, T2> {}; // Node2 +// template <> class MyTemplate<int, char> {}; // Node3 +// void foo() { +// // This creates implicit template specialization (Node4) out of the +// // explicit template definition (Node1). +// MyTemplate<bool, double> v; +// } +// with the following AST nodes: +// ClassTemplateDecl MyTemplate - Node1 +// | |-CXXRecordDecl class MyTemplate definition +// | `-ClassTemplateSpecializationDecl class MyTemplate definition - Node4 +// ClassTemplatePartialSpecializationDecl class MyTemplate definition - Node2 +// ClassTemplateSpecializationDecl class MyTemplate definition - Node3 +// +// Matches AST node 4, but not AST node2 nor node3. +AST_MATCHER(clang::ClassTemplateSpecializationDecl, + isImplicitClassTemplateSpecialization) { + return !Node.isExplicitSpecialization(); +} + +static bool IsAnnotated(const clang::Decl* decl, + const std::string& expected_annotation) { + clang::AnnotateAttr* attr = decl->getAttr<clang::AnnotateAttr>(); + return attr && (attr->getAnnotation() == expected_annotation); +} + +AST_MATCHER(clang::Decl, isRawPtrExclusionAnnotated) { + return IsAnnotated(&Node, "raw_ptr_exclusion"); +} + +// Given: +// template <typename T, typename T2> void foo(T t, T2 t2) {}; // N1 and N4 +// template <typename T2> void foo<int, T2>(int t, T2 t) {}; // N2 +// template <> void foo<int, char>(int t, char t2) {}; // N3 +// void foo() { +// // This creates implicit template specialization (N4) out of the +// // explicit template definition (N1). +// foo<bool, double>(true, 1.23); +// } +// with the following AST nodes: +// FunctionTemplateDecl foo +// |-FunctionDecl 0x191da68 foo 'void (T, T2)' // N1 +// `-FunctionDecl 0x194bf08 foo 'void (bool, double)' // N4 +// FunctionTemplateDecl foo +// `-FunctionDecl foo 'void (int, T2)' // N2 +// FunctionDecl foo 'void (int, char)' // N3 +// +// Matches AST node N4, but not AST nodes N1, N2 nor N3. +AST_MATCHER(clang::FunctionDecl, isImplicitFunctionTemplateSpecialization) { + switch (Node.getTemplateSpecializationKind()) { + case clang::TSK_ImplicitInstantiation: + return true; + case clang::TSK_Undeclared: + case clang::TSK_ExplicitSpecialization: + case clang::TSK_ExplicitInstantiationDeclaration: + case clang::TSK_ExplicitInstantiationDefinition: + return false; + } +} + +// Matches field declarations that do not explicitly appear in the source +// code: +// 1. fields of classes generated by the compiler to back capturing lambdas, +// 2. fields within an implicit class or function template specialization +// (e.g. when a template is instantiated by a bit of code and there's no +// explicit specialization for it). +clang::ast_matchers::internal::Matcher<clang::FieldDecl> +ImplicitFieldDeclaration(); + +// Matches raw pointer field declarations that is a candidate for raw_ptr<T> +// conversion. +clang::ast_matchers::internal::Matcher<clang::Decl> AffectedRawPtrFieldDecl( + FilterFile* paths_to_exclude, FilterFile* fields_to_exclude); + +#endif // TOOLS_CLANG_PLUGINS_RAWPTRHELPERS_H_
diff --git a/tools/clang/plugins/tests/base/memory/raw_ptr_exclusion.h b/tools/clang/plugins/tests/base/memory/raw_ptr_exclusion.h new file mode 100644 index 0000000..6c74744 --- /dev/null +++ b/tools/clang/plugins/tests/base/memory/raw_ptr_exclusion.h
@@ -0,0 +1,12 @@ +// Copyright 2022 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef TOOLS_CLANG_PLUGINS_TESTS_BASE_MEMORY_RAW_PTR_EXCLUSION_H_ +#define TOOLS_CLANG_PLUGINS_TESTS_BASE_MEMORY_RAW_PTR_EXCLUSION_H_ + +// Marks a field as excluded from the raw_ptr usage enforcement clang plugin. +// Example: RAW_PTR_EXCLUSION Foo* foo_; +#define RAW_PTR_EXCLUSION __attribute__((annotate("raw_ptr_exclusion"))) + +#endif // TOOLS_CLANG_PLUGINS_TESTS_BASE_MEMORY_RAW_PTR_EXCLUSION_H_
diff --git a/tools/clang/plugins/tests/raw_ptr_exclusion.cpp b/tools/clang/plugins/tests/raw_ptr_exclusion.cpp new file mode 100644 index 0000000..4f91f4e --- /dev/null +++ b/tools/clang/plugins/tests/raw_ptr_exclusion.cpp
@@ -0,0 +1,18 @@ +// Copyright 2022 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "base/memory/raw_ptr_exclusion.h" + +class SomeClass; + +class MyClass { + // Error expected. + SomeClass* raw_ptr_field1; + // No error expected. + RAW_PTR_EXCLUSION SomeClass* ignored_field1; + // Error expected. + SomeClass* raw_ptr_field2; + // No error expected. + RAW_PTR_EXCLUSION SomeClass* ignored_field2; +};
diff --git a/tools/clang/plugins/tests/raw_ptr_exclusion.flags b/tools/clang/plugins/tests/raw_ptr_exclusion.flags new file mode 100644 index 0000000..cb3c8b65 --- /dev/null +++ b/tools/clang/plugins/tests/raw_ptr_exclusion.flags
@@ -0,0 +1 @@ +-Xclang -plugin-arg-find-bad-constructs -Xclang check-raw-ptr-fields
diff --git a/tools/clang/plugins/tests/raw_ptr_exclusion.txt b/tools/clang/plugins/tests/raw_ptr_exclusion.txt new file mode 100644 index 0000000..0b2b8d5 --- /dev/null +++ b/tools/clang/plugins/tests/raw_ptr_exclusion.txt
@@ -0,0 +1,7 @@ +raw_ptr_exclusion.cpp:11:14: error: [chromium-rawptr] Use raw_ptr<T> instead of a raw pointer. + SomeClass* raw_ptr_field1; + ^ +raw_ptr_exclusion.cpp:15:14: error: [chromium-rawptr] Use raw_ptr<T> instead of a raw pointer. + SomeClass* raw_ptr_field2; + ^ +2 errors generated.
diff --git a/tools/clang/plugins/tests/raw_ptr_fields_basic.cpp b/tools/clang/plugins/tests/raw_ptr_fields_basic.cpp new file mode 100644 index 0000000..1534e9b7 --- /dev/null +++ b/tools/clang/plugins/tests/raw_ptr_fields_basic.cpp
@@ -0,0 +1,51 @@ +// Copyright 2022 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +class SomeClass; + +class MyClass { + // Error expected. + SomeClass* raw_ptr_field; + + // No error expected. + int int_field; +}; + +struct MyStruct { + // Error expected. + SomeClass* raw_ptr_field; + + // No error expected. + int int_field; + + // "*" next to the field name. This is non-standard formatting, so + // "clang-format off" is used to make sure |git cl format| won't change this + // testcase. + // + // Error expected. + // clang-format off + SomeClass *raw_ptr_field2; + // clang-format on +}; + +template <typename T> +class MyTemplate { + // Error expected. + T* raw_ptr_field; + + // No error expected. + int int_field; +}; + +// The field below won't compile without the |typename| keyword (because +// at this point we don't know if MaybeProvidesType<T>::Type is a type, +// value or something else). +template <typename T> +struct MaybeProvidesType; +template <typename T> +struct DependentNameTest { + // Error expected. Even though MaybeProvidesType<T>::Type is an unknown type, + // MaybeProvidesType<Type::Type* must be a pointer so an error is expected. + typename MaybeProvidesType<T>::Type* field; +};
diff --git a/tools/clang/plugins/tests/raw_ptr_fields_basic.flags b/tools/clang/plugins/tests/raw_ptr_fields_basic.flags new file mode 100644 index 0000000..cb3c8b65 --- /dev/null +++ b/tools/clang/plugins/tests/raw_ptr_fields_basic.flags
@@ -0,0 +1 @@ +-Xclang -plugin-arg-find-bad-constructs -Xclang check-raw-ptr-fields
diff --git a/tools/clang/plugins/tests/raw_ptr_fields_basic.txt b/tools/clang/plugins/tests/raw_ptr_fields_basic.txt new file mode 100644 index 0000000..3dc70baf --- /dev/null +++ b/tools/clang/plugins/tests/raw_ptr_fields_basic.txt
@@ -0,0 +1,16 @@ +raw_ptr_fields_basic.cpp:9:14: error: [chromium-rawptr] Use raw_ptr<T> instead of a raw pointer. + SomeClass* raw_ptr_field; + ^ +raw_ptr_fields_basic.cpp:17:14: error: [chromium-rawptr] Use raw_ptr<T> instead of a raw pointer. + SomeClass* raw_ptr_field; + ^ +raw_ptr_fields_basic.cpp:28:14: error: [chromium-rawptr] Use raw_ptr<T> instead of a raw pointer. + SomeClass *raw_ptr_field2; + ^ +raw_ptr_fields_basic.cpp:35:6: error: [chromium-rawptr] Use raw_ptr<T> instead of a raw pointer. + T* raw_ptr_field; + ^ +raw_ptr_fields_basic.cpp:50:40: error: [chromium-rawptr] Use raw_ptr<T> instead of a raw pointer. + typename MaybeProvidesType<T>::Type* field; + ^ +5 errors generated.
diff --git a/tools/clang/plugins/tests/raw_ptr_fields_various_types.cpp b/tools/clang/plugins/tests/raw_ptr_fields_various_types.cpp new file mode 100644 index 0000000..087f6a7 --- /dev/null +++ b/tools/clang/plugins/tests/raw_ptr_fields_various_types.cpp
@@ -0,0 +1,102 @@ +// Copyright 2022 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include <string> +#include <vector> + +namespace my_namespace { + +class SomeClass { + public: + void Method(char) {} + // No error expected. + int data_member; +}; + +template <typename T> +struct SomeTemplate { + // No error expected. + T t; +}; + +struct MyStruct { + // Error expected. + SomeClass** double_ptr; + + // Error expected. + void* void_ptr; + + // Error expected. + bool* bool_ptr; + const bool* const_bool_ptr; + + // Pointers to templates. + // Error expected. + std::string* string_ptr; + std::vector<char>* vector_ptr; + SomeTemplate<char>* template_ptr; + + // + // Various integer types. + // + // Error expected. + int* int_spelling1; + signed int* int_spelling2; + long int* int_spelling3; + unsigned* int_spelling4; + + // + // Various structs and classes. + // + // Error expected. + SomeClass* class_spelling1; + class SomeClass* class_spelling2; + my_namespace::SomeClass* class_spelling3; + + // Function pointers. + // No error expected. Because they won't ever be allocated by PartitionAlloc. + int (*func_ptr)(); + void (SomeClass::*member_func_ptr)(char); // ~ pointer to SomeClass::Method + int SomeClass::*member_data_ptr; // ~ pointer to SomeClass::data_member + typedef void (*func_ptr_typedef)(char); + func_ptr_typedef func_ptr_typedef_field; + + // Typedef-ed or type-aliased pointees. + typedef SomeClass SomeClassTypedef; + using SomeClassAlias = SomeClass; + typedef void (*func_ptr_typedef2)(char); + // Error expected. + SomeClassTypedef* typedef_ptr; + // Error expected. + SomeClassAlias* alias_ptr; + // Error expected. + func_ptr_typedef2* ptr_to_function_ptr; + + // Char pointer fields. + // + // Error expected. + char* char_ptr; + // No error expected. crbug.com/1381955 + const char* const_char_ptr; + // Error expected. + wchar_t* wide_char_ptr; + // No error expected. crbug.com/1381955 + const wchar_t* const_wide_char_ptr; + + // |array_of_ptrs| is an array 123 of pointer to SomeClass. + // No error expected. (this is not a pointer - this is an array). + SomeClass* ptr_array[123]; + + // |ptr_to_array| is a pointer to array 123 of const SomeClass. + // + // This test is based on EqualsFramesMatcher from + // //net/websockets/websocket_channel_test.cc + // + // No error expected. Because this rewrite was tricky and not supported by the + // rewriter. + // crbug.com/1381969 + const SomeClass (*ptr_to_array)[123]; +}; + +} // namespace my_namespace
diff --git a/tools/clang/plugins/tests/raw_ptr_fields_various_types.flags b/tools/clang/plugins/tests/raw_ptr_fields_various_types.flags new file mode 100644 index 0000000..cb3c8b65 --- /dev/null +++ b/tools/clang/plugins/tests/raw_ptr_fields_various_types.flags
@@ -0,0 +1 @@ +-Xclang -plugin-arg-find-bad-constructs -Xclang check-raw-ptr-fields
diff --git a/tools/clang/plugins/tests/raw_ptr_fields_various_types.txt b/tools/clang/plugins/tests/raw_ptr_fields_various_types.txt new file mode 100644 index 0000000..9105533 --- /dev/null +++ b/tools/clang/plugins/tests/raw_ptr_fields_various_types.txt
@@ -0,0 +1,58 @@ +raw_ptr_fields_various_types.cpp:25:15: error: [chromium-rawptr] Use raw_ptr<T> instead of a raw pointer. + SomeClass** double_ptr; + ^ +raw_ptr_fields_various_types.cpp:28:9: error: [chromium-rawptr] Use raw_ptr<T> instead of a raw pointer. + void* void_ptr; + ^ +raw_ptr_fields_various_types.cpp:31:9: error: [chromium-rawptr] Use raw_ptr<T> instead of a raw pointer. + bool* bool_ptr; + ^ +raw_ptr_fields_various_types.cpp:32:15: error: [chromium-rawptr] Use raw_ptr<T> instead of a raw pointer. + const bool* const_bool_ptr; + ^ +raw_ptr_fields_various_types.cpp:36:16: error: [chromium-rawptr] Use raw_ptr<T> instead of a raw pointer. + std::string* string_ptr; + ^ +raw_ptr_fields_various_types.cpp:37:22: error: [chromium-rawptr] Use raw_ptr<T> instead of a raw pointer. + std::vector<char>* vector_ptr; + ^ +raw_ptr_fields_various_types.cpp:38:23: error: [chromium-rawptr] Use raw_ptr<T> instead of a raw pointer. + SomeTemplate<char>* template_ptr; + ^ +raw_ptr_fields_various_types.cpp:44:8: error: [chromium-rawptr] Use raw_ptr<T> instead of a raw pointer. + int* int_spelling1; + ^ +raw_ptr_fields_various_types.cpp:45:15: error: [chromium-rawptr] Use raw_ptr<T> instead of a raw pointer. + signed int* int_spelling2; + ^ +raw_ptr_fields_various_types.cpp:46:13: error: [chromium-rawptr] Use raw_ptr<T> instead of a raw pointer. + long int* int_spelling3; + ^ +raw_ptr_fields_various_types.cpp:47:13: error: [chromium-rawptr] Use raw_ptr<T> instead of a raw pointer. + unsigned* int_spelling4; + ^ +raw_ptr_fields_various_types.cpp:53:14: error: [chromium-rawptr] Use raw_ptr<T> instead of a raw pointer. + SomeClass* class_spelling1; + ^ +raw_ptr_fields_various_types.cpp:54:20: error: [chromium-rawptr] Use raw_ptr<T> instead of a raw pointer. + class SomeClass* class_spelling2; + ^ +raw_ptr_fields_various_types.cpp:55:28: error: [chromium-rawptr] Use raw_ptr<T> instead of a raw pointer. + my_namespace::SomeClass* class_spelling3; + ^ +raw_ptr_fields_various_types.cpp:70:21: error: [chromium-rawptr] Use raw_ptr<T> instead of a raw pointer. + SomeClassTypedef* typedef_ptr; + ^ +raw_ptr_fields_various_types.cpp:72:19: error: [chromium-rawptr] Use raw_ptr<T> instead of a raw pointer. + SomeClassAlias* alias_ptr; + ^ +raw_ptr_fields_various_types.cpp:74:22: error: [chromium-rawptr] Use raw_ptr<T> instead of a raw pointer. + func_ptr_typedef2* ptr_to_function_ptr; + ^ +raw_ptr_fields_various_types.cpp:79:9: error: [chromium-rawptr] Use raw_ptr<T> instead of a raw pointer. + char* char_ptr; + ^ +raw_ptr_fields_various_types.cpp:83:12: error: [chromium-rawptr] Use raw_ptr<T> instead of a raw pointer. + wchar_t* wide_char_ptr; + ^ +19 errors generated.
diff --git a/tools/clang/rewrite_raw_ptr_fields/CMakeLists.txt b/tools/clang/rewrite_raw_ptr_fields/CMakeLists.txt index f70a48c..220043bd 100644 --- a/tools/clang/rewrite_raw_ptr_fields/CMakeLists.txt +++ b/tools/clang/rewrite_raw_ptr_fields/CMakeLists.txt
@@ -8,6 +8,8 @@ add_llvm_executable(rewrite_raw_ptr_fields RewriteRawPtrFields.cpp + ../plugins/Util.cpp + ../plugins/RawPtrHelpers.cpp ) target_link_libraries(rewrite_raw_ptr_fields @@ -26,3 +28,4 @@ ) cr_install(TARGETS rewrite_raw_ptr_fields RUNTIME DESTINATION bin) +target_include_directories(rewrite_raw_ptr_fields PUBLIC "../plugins")
diff --git a/tools/clang/rewrite_raw_ptr_fields/RewriteRawPtrFields.cpp b/tools/clang/rewrite_raw_ptr_fields/RewriteRawPtrFields.cpp index 94deb57..39d98434 100644 --- a/tools/clang/rewrite_raw_ptr_fields/RewriteRawPtrFields.cpp +++ b/tools/clang/rewrite_raw_ptr_fields/RewriteRawPtrFields.cpp
@@ -32,6 +32,7 @@ #include <string> #include <vector> +#include "RawPtrHelpers.h" #include "clang/AST/ASTContext.h" #include "clang/ASTMatchers/ASTMatchFinder.h" #include "clang/ASTMatchers/ASTMatchers.h" @@ -52,8 +53,6 @@ #include "llvm/Support/CommandLine.h" #include "llvm/Support/ErrorOr.h" #include "llvm/Support/FormatVariadic.h" -#include "llvm/Support/LineIterator.h" -#include "llvm/Support/MemoryBuffer.h" #include "llvm/Support/Path.h" #include "llvm/Support/TargetSelect.h" @@ -260,228 +259,12 @@ clang::Language current_language_ = clang::Language::Unknown; }; -llvm::StringRef GetFilePath(const clang::SourceManager& source_manager, - const clang::FieldDecl& field_decl) { - clang::SourceLocation loc = field_decl.getSourceRange().getBegin(); - if (loc.isInvalid() || !loc.isFileID()) - return llvm::StringRef(); - - clang::FileID file_id = source_manager.getDecomposedLoc(loc).first; - const clang::FileEntry* file_entry = - source_manager.getFileEntryForID(file_id); - if (!file_entry) - return llvm::StringRef(); - - return file_entry->getName(); -} - -AST_MATCHER(clang::FieldDecl, isInThirdPartyLocation) { - llvm::StringRef file_path = - GetFilePath(Finder->getASTContext().getSourceManager(), Node); - - // Blink is part of the Chromium git repo, even though it contains - // "third_party" in its path. - if (file_path.contains("third_party/blink/")) - return false; - - // Otherwise, just check if the paths contains the "third_party" substring. - // We don't want to rewrite content of such paths even if they are in the main - // Chromium git repository. - return file_path.contains("third_party"); -} - -AST_MATCHER(clang::FieldDecl, isInGeneratedLocation) { - llvm::StringRef file_path = - GetFilePath(Finder->getASTContext().getSourceManager(), Node); - - return file_path.startswith("gen/") || file_path.contains("/gen/"); -} - -// Represents a filter file specified via cmdline. -class FilterFile { - public: - explicit FilterFile(const llvm::cl::opt<std::string>& cmdline_param) { - ParseInputFile(cmdline_param); - } - - FilterFile(const FilterFile&) = delete; - FilterFile& operator=(const FilterFile&) = delete; - - // Returns true if any of the filter file lines is exactly equal to |line|. - bool ContainsLine(llvm::StringRef line) const { - auto it = file_lines_.find(line); - return it != file_lines_.end(); - } - - // Returns true if |string_to_match| matches based on the filter file lines. - // Filter file lines can contain both inclusions and exclusions in the filter. - // Only returns true if |string_to_match| both matches an inclusion filter and - // is *not* matched by an exclusion filter. - bool ContainsSubstringOf(llvm::StringRef string_to_match) const { - if (!inclusion_substring_regex_.has_value()) { - std::vector<std::string> regex_escaped_inclusion_file_lines; - std::vector<std::string> regex_escaped_exclusion_file_lines; - regex_escaped_inclusion_file_lines.reserve(file_lines_.size()); - for (const llvm::StringRef& file_line : file_lines_.keys()) { - if (file_line.startswith("!")) { - regex_escaped_exclusion_file_lines.push_back( - llvm::Regex::escape(file_line.substr(1))); - } else { - regex_escaped_inclusion_file_lines.push_back( - llvm::Regex::escape(file_line)); - } - } - std::string inclusion_substring_regex_pattern = - llvm::join(regex_escaped_inclusion_file_lines.begin(), - regex_escaped_inclusion_file_lines.end(), "|"); - inclusion_substring_regex_.emplace(inclusion_substring_regex_pattern); - std::string exclusion_substring_regex_pattern = - llvm::join(regex_escaped_exclusion_file_lines.begin(), - regex_escaped_exclusion_file_lines.end(), "|"); - exclusion_substring_regex_.emplace(exclusion_substring_regex_pattern); - } - return inclusion_substring_regex_->match(string_to_match) && - !exclusion_substring_regex_->match(string_to_match); - } - - private: - // Expected file format: - // - '#' character starts a comment (which gets ignored). - // - Blank or whitespace-only or comment-only lines are ignored. - // - Other lines are expected to contain a fully-qualified name of a field - // like: - // autofill::AddressField::address1_ # some comment - // - Templates are represented without template arguments, like: - // WTF::HashTable::table_ # some comment - void ParseInputFile(const llvm::cl::opt<std::string>& cmdline_param) { - std::string filepath = cmdline_param; - if (filepath.empty()) - return; - - llvm::ErrorOr<std::unique_ptr<llvm::MemoryBuffer>> file_or_err = - llvm::MemoryBuffer::getFile(filepath); - if (std::error_code err = file_or_err.getError()) { - llvm::errs() << "ERROR: Cannot open the file specified in --" - << cmdline_param.ArgStr << " argument: " << filepath << ": " - << err.message() << "\n"; - assert(false); - return; - } - - llvm::line_iterator it(**file_or_err, true /* SkipBlanks */, '#'); - for (; !it.is_at_eof(); ++it) { - llvm::StringRef line = *it; - - // Remove trailing comments. - size_t comment_start_pos = line.find('#'); - if (comment_start_pos != llvm::StringRef::npos) - line = line.substr(0, comment_start_pos); - line = line.trim(); - - if (line.empty()) - continue; - - file_lines_.insert(line); - } - } - - // Stores all file lines (after stripping comments and blank lines). - llvm::StringSet<> file_lines_; - - // |file_lines_| is partitioned based on whether the line starts with a ! - // (exclusion line) or not (inclusion line). Inclusion lines specify things to - // be matched by the filter. The exclusion lines specify what to force exclude - // from the filter. Lazily-constructed regex that matches strings that contain - // any of the inclusion lines in |file_lines_|. - mutable llvm::Optional<llvm::Regex> inclusion_substring_regex_; - - // Lazily-constructed regex that matches strings that contain any of the - // exclusion lines in |file_lines_|. - mutable llvm::Optional<llvm::Regex> exclusion_substring_regex_; -}; - -AST_MATCHER_P(clang::FieldDecl, - isFieldDeclListedInFilterFile, - const FilterFile*, - Filter) { - return Filter->ContainsLine(Node.getQualifiedNameAsString()); -} - -AST_MATCHER_P(clang::FieldDecl, - isInLocationListedInFilterFile, - const FilterFile*, - Filter) { - llvm::StringRef file_path = - GetFilePath(Finder->getASTContext().getSourceManager(), Node); - return Filter->ContainsSubstringOf(file_path); -} - -AST_MATCHER(clang::Decl, isInExternCContext) { - return Node.getLexicalDeclContext()->isExternCContext(); -} - -// Given: -// template <typename T, typename T2> class MyTemplate {}; // Node1 and Node4 -// template <typename T2> class MyTemplate<int, T2> {}; // Node2 -// template <> class MyTemplate<int, char> {}; // Node3 -// void foo() { -// // This creates implicit template specialization (Node4) out of the -// // explicit template definition (Node1). -// MyTemplate<bool, double> v; -// } -// with the following AST nodes: -// ClassTemplateDecl MyTemplate - Node1 -// | |-CXXRecordDecl class MyTemplate definition -// | `-ClassTemplateSpecializationDecl class MyTemplate definition - Node4 -// ClassTemplatePartialSpecializationDecl class MyTemplate definition - Node2 -// ClassTemplateSpecializationDecl class MyTemplate definition - Node3 -// -// Matches AST node 4, but not AST node2 nor node3. -AST_MATCHER(clang::ClassTemplateSpecializationDecl, - isImplicitClassTemplateSpecialization) { - return !Node.isExplicitSpecialization(); -} - // Matches CXXRecordDecls that are classified as trivial: // https://en.cppreference.com/w/cpp/named_req/TrivialType AST_MATCHER(clang::CXXRecordDecl, isTrivial) { return Node.isTrivial(); } -// Given: -// template <typename T, typename T2> void foo(T t, T2 t2) {}; // N1 and N4 -// template <typename T2> void foo<int, T2>(int t, T2 t) {}; // N2 -// template <> void foo<int, char>(int t, char t2) {}; // N3 -// void foo() { -// // This creates implicit template specialization (N4) out of the -// // explicit template definition (N1). -// foo<bool, double>(true, 1.23); -// } -// with the following AST nodes: -// FunctionTemplateDecl foo -// |-FunctionDecl 0x191da68 foo 'void (T, T2)' // N1 -// `-FunctionDecl 0x194bf08 foo 'void (bool, double)' // N4 -// FunctionTemplateDecl foo -// `-FunctionDecl foo 'void (int, T2)' // N2 -// FunctionDecl foo 'void (int, char)' // N3 -// -// Matches AST node N4, but not AST nodes N1, N2 nor N3. -AST_MATCHER(clang::FunctionDecl, isImplicitFunctionTemplateSpecialization) { - switch (Node.getTemplateSpecializationKind()) { - case clang::TSK_ImplicitInstantiation: - return true; - case clang::TSK_Undeclared: - case clang::TSK_ExplicitSpecialization: - case clang::TSK_ExplicitInstantiationDeclaration: - case clang::TSK_ExplicitInstantiationDefinition: - return false; - } -} - -AST_MATCHER(clang::Type, anyCharType) { - return Node.isAnyCharacterType(); -} - AST_POLYMORPHIC_MATCHER(isInMacroLocation, AST_POLYMORPHIC_SUPPORTED_TYPES(clang::Decl, clang::Stmt, @@ -489,16 +272,6 @@ return Node.getBeginLoc().isMacroID(); } -static bool IsAnnotated(const clang::Decl* decl, - const std::string& expected_annotation) { - clang::AnnotateAttr* attr = decl->getAttr<clang::AnnotateAttr>(); - return attr && (attr->getAnnotation() == expected_annotation); -} - -AST_MATCHER(clang::Decl, IsExclusionAnnotated) { - return IsAnnotated(&Node, "raw_ptr_exclusion"); -} - // If |field_decl| declares a field in an implicit template specialization, then // finds and returns the corresponding FieldDecl from the template definition. // Otherwise, just returns the original |field_decl| argument. @@ -1012,59 +785,8 @@ paths_to_exclude(paths_to_exclude) {} void addMatchers() { - // Supported pointer types ========= - // Given - // struct MyStrict { - // int* int_ptr; - // int i; - // int (*func_ptr)(); - // int (MyStruct::* member_func_ptr)(char); - // int (*ptr_to_array_of_ints)[123] - // }; - // matches |int*|, but not the other types. - auto supported_pointer_types_matcher = - pointerType(unless(pointee(hasUnqualifiedDesugaredType( - anyOf(functionType(), memberPointerType(), arrayType()))))); - - // Implicit field declarations ========= - // Matches field declarations that do not explicitly appear in the source - // code: - // 1. fields of classes generated by the compiler to back capturing lambdas, - // 2. fields within an implicit class or function template specialization - // (e.g. when a template is instantiated by a bit of code and there's no - // explicit specialization for it). - auto implicit_class_specialization_matcher = - classTemplateSpecializationDecl( - isImplicitClassTemplateSpecialization()); - auto implicit_function_specialization_matcher = - functionDecl(isImplicitFunctionTemplateSpecialization()); - auto implicit_field_decl_matcher = fieldDecl(hasParent(cxxRecordDecl(anyOf( - isLambda(), implicit_class_specialization_matcher, - hasAncestor(decl(anyOf(implicit_class_specialization_matcher, - implicit_function_specialization_matcher))))))); - - // Field declarations ========= - // Given - // struct S { - // int* y; - // }; - // matches |int* y|. Doesn't match: - // - non-pointer types - // - fields of lambda-supporting classes - // - fields listed in the --exclude-fields cmdline param or located in paths - // matched by --exclude-paths cmdline param - // - "implicit" fields (i.e. field decls that are not explicitly present in - // the source code) auto field_decl_matcher = - fieldDecl( - allOf(hasType(supported_pointer_types_matcher), - unless(anyOf( - isExpansionInSystemHeader(), isInExternCContext(), - isInThirdPartyLocation(), isInGeneratedLocation(), - isInLocationListedInFilterFile(&paths_to_exclude), - isFieldDeclListedInFilterFile(&fields_to_exclude), - IsExclusionAnnotated(), implicit_field_decl_matcher)))) - .bind("affectedFieldDecl"); + AffectedRawPtrFieldDecl(&paths_to_exclude, &fields_to_exclude); match_finder.addMatcher(field_decl_matcher, &field_decl_rewriter); @@ -1391,24 +1113,6 @@ paths_to_exclude(paths_to_exclude) {} void addMatchers() { - // Implicit field declarations ========= - // Matches field declarations that do not explicitly appear in the source - // code: - // 1. fields of classes generated by the compiler to back capturing lambdas, - // 2. fields within an implicit class or function template specialization - // (e.g. when a template is instantiated by a bit of code and there's no - // explicit specialization for it). - auto implicit_class_specialization_matcher = - classTemplateSpecializationDecl( - isImplicitClassTemplateSpecialization()); - auto implicit_function_specialization_matcher = - functionDecl(isImplicitFunctionTemplateSpecialization()); - auto implicit_field_decl_matcher = fieldDecl(hasParent(cxxRecordDecl(anyOf( - isLambda(), isAnonymousStructOrUnion(), - implicit_class_specialization_matcher, - hasAncestor(decl(anyOf(implicit_class_specialization_matcher, - implicit_function_specialization_matcher))))))); - // Field declarations ========= // Given // struct S { @@ -1429,7 +1133,7 @@ isInThirdPartyLocation(), isInGeneratedLocation(), isInLocationListedInFilterFile(&paths_to_exclude), isFieldDeclListedInFilterFile(&fields_to_exclude), - implicit_field_decl_matcher)))) + ImplicitFieldDeclaration())))) .bind("affectedFieldDecl"); match_finder.addMatcher(field_decl_matcher, &field_decl_rewriter); @@ -1714,8 +1418,10 @@ !enable_raw_ref_rewrite && !enable_raw_ptr_rewrite; MatchFinder match_finder; OutputHelper output_helper; - FilterFile fields_to_exclude(exclude_fields_param); - FilterFile paths_to_exclude(exclude_paths_param); + FilterFile fields_to_exclude(exclude_fields_param, + exclude_fields_param.ArgStr.str()); + FilterFile paths_to_exclude(exclude_paths_param, + exclude_paths_param.ArgStr.str()); RawPtrRewriter raw_ptr_rewriter(&output_helper, match_finder, fields_to_exclude, paths_to_exclude);
diff --git a/tools/mb/mb_config.pyl b/tools/mb/mb_config.pyl index c8645383..9bd4eb9 100644 --- a/tools/mb/mb_config.pyl +++ b/tools/mb/mb_config.pyl
@@ -37,8 +37,8 @@ 'linux-chrome': 'official_reclient', 'linux-chromeos-chrome': 'official_reclient_chromeos_include_unwind_tables', 'mac-chrome': 'official_reclient_mac', - 'win-chrome': 'official_reclient_x86', - 'win64-chrome': 'official_reclient_x64', + 'win-chrome': 'official_goma_x86', + 'win64-chrome': 'official_goma_x64', }, 'chrome.pgo': { 'android-arm32-pgo': 'official_reclient_android_arm32_pgo', @@ -154,7 +154,6 @@ 'chromeos-arm-generic-rel': 'chromeos_arm-generic_reclient', 'chromeos-arm64-generic-rel': 'chromeos_arm64-generic_dchecks_reclient', 'chromeos-jacuzzi-rel': 'chromeos_jacuzzi_dchecks_reclient', - 'chromeos-kevin-rel': 'chromeos_kevin_dchecks_reclient', 'chromeos-octopus-rel': 'chromeos_octopus_dchecks_reclient', 'lacros-amd64-generic-binary-size-rel': 'chromeos_amd64-generic_lacros_rel_reclient', 'lacros-amd64-generic-rel': 'chromeos_amd64-generic_lacros_rel_reclient', @@ -817,9 +816,9 @@ 'internal.chrome.fyi': { 'chromeos-arm-generic-cfi-thin-lto-chrome-reclient': 'chromeos_arm-generic_cfi_thin_lto_official_reclient', 'lacros-arm-generic-chrome-fyi-reclient': 'chromeos_arm-generic_lacros_official_skylab_reclient', - 'linux-autofill-captured-sites-rel': 'release_bot_reclient', + 'linux-autofill-captured-sites-rel': 'release_bot', 'linux-finch-smoke-chrome': 'official_reclient', - 'linux-password-manager-captured-sites-rel': 'release_bot_reclient', + 'linux-password-manager-captured-sites-rel': 'release_bot', 'lorenz-graph-dbg': 'android_debug_static_external_bot_reclient', 'mac-arm64-finch-smoke-chrome': 'official_reclient_mac_arm', # b/248132996: for siso experiments. @@ -1046,8 +1045,6 @@ 'chromeos-arm-generic-rel': 'chromeos_arm-generic_dcheck_always_on', 'chromeos-arm64-generic-rel': 'chromeos_arm64-generic_dchecks', 'chromeos-jacuzzi-rel': 'chromeos_jacuzzi_dchecks', - 'chromeos-kevin-compile-rel': 'chromeos_kevin_dchecks', - 'chromeos-kevin-rel': 'chromeos_kevin_dchecks', 'chromeos-octopus-rel': 'chromeos_octopus_dchecks', 'gpu-fyi-try-chromeos-amd64-generic': 'gpu_tests_chromeos_amd64_release_trybot_dcheck_off_no_symbols', 'gpu-fyi-try-chromeos-jacuzzi-exp': 'gpu_tests_chromeos_jacuzzi_release_trybot', @@ -1341,7 +1338,6 @@ 'win10_chromium_x64_rel_ng-inverse-fyi': 'gpu_tests_release_trybot_resource_allowlisting_code_coverage', 'win10_chromium_x64_rel_ng_exp': 'release_trybot', 'win11-x64-fyi-rel': 'gpu_tests_release_trybot_resource_allowlisting_code_coverage', - 'win7-rel': 'gpu_tests_release_trybot_x86_resource_allowlisting', 'win_archive': 'release_trybot_x86', 'win_chromium_compile_dbg_ng': 'gpu_tests_debug_bot_x86_no_symbols_reclient', 'win_chromium_compile_rel_ng': 'gpu_tests_release_trybot_x86_resource_allowlisting', @@ -2195,14 +2191,6 @@ 'also_build_lacros_chrome_for_architecture_arm', ], - 'chromeos_kevin_dchecks': [ - 'chromeos_kevin', 'dcheck_always_on', 'also_build_lacros_chrome_for_architecture_arm', - ], - - 'chromeos_kevin_dchecks_reclient': [ - 'chromeos_kevin_reclient', 'dcheck_always_on', 'also_build_lacros_chrome_for_architecture_arm', - ], - 'chromeos_kevin_include_unwind_tables_official': [ 'chromeos_kevin', 'include_unwind_tables', 'official', ], @@ -3417,17 +3405,10 @@ 'official', 'reclient', 'no_widevine_cdm_host_verification', 'disable_widevine_signing', 'no_symbols', 'pgo_phase_1', 'release' ], - 'official_reclient_x64': [ - 'official', 'reclient', 'x64', - ], - 'official_reclient_x64_pgo': [ 'official', 'reclient', 'x64', 'no_symbols', 'pgo_phase_1', 'release' ], - 'official_reclient_x86': [ - 'official', 'reclient', 'x86', - ], 'official_reclient_x86_pgo': [ 'official', 'reclient', 'x86', 'no_symbols', 'pgo_phase_1', 'release' ],
diff --git a/tools/mb/mb_config_expectations/chrome.json b/tools/mb/mb_config_expectations/chrome.json index 377c2b3..7717b97 100644 --- a/tools/mb/mb_config_expectations/chrome.json +++ b/tools/mb/mb_config_expectations/chrome.json
@@ -292,7 +292,7 @@ "is_chrome_branded": true, "is_official_build": true, "target_cpu": "x86", - "use_remoteexec": true + "use_goma": true } }, "win64-chrome": { @@ -300,7 +300,7 @@ "is_chrome_branded": true, "is_official_build": true, "target_cpu": "x64", - "use_remoteexec": true + "use_goma": true } } } \ No newline at end of file
diff --git a/tools/mb/mb_config_expectations/chromium.chromiumos.json b/tools/mb/mb_config_expectations/chromium.chromiumos.json index 01ecf2d..b74cd8a 100644 --- a/tools/mb/mb_config_expectations/chromium.chromiumos.json +++ b/tools/mb/mb_config_expectations/chromium.chromiumos.json
@@ -104,16 +104,6 @@ "use_remoteexec": true } }, - "chromeos-kevin-rel": { - "args_file": "//build/args/chromeos/kevin.gni", - "gn_args": { - "also_build_lacros_chrome_for_architecture": "arm", - "dcheck_always_on": true, - "is_chromeos_device": true, - "ozone_platform_headless": true, - "use_remoteexec": true - } - }, "chromeos-octopus-rel": { "args_file": "//build/args/chromeos/octopus.gni", "gn_args": {
diff --git a/tools/mb/mb_config_expectations/internal.chrome.fyi.json b/tools/mb/mb_config_expectations/internal.chrome.fyi.json index 040f21c..27afa51e 100644 --- a/tools/mb/mb_config_expectations/internal.chrome.fyi.json +++ b/tools/mb/mb_config_expectations/internal.chrome.fyi.json
@@ -36,7 +36,7 @@ "dcheck_always_on": false, "is_component_build": false, "is_debug": false, - "use_remoteexec": true + "use_goma": true } }, "linux-finch-smoke-chrome": { @@ -51,7 +51,7 @@ "dcheck_always_on": false, "is_component_build": false, "is_debug": false, - "use_remoteexec": true + "use_goma": true } }, "lorenz-graph-dbg": {
diff --git a/tools/mb/mb_config_expectations/tryserver.chromium.chromiumos.json b/tools/mb/mb_config_expectations/tryserver.chromium.chromiumos.json index 4c26f98..b87c018 100644 --- a/tools/mb/mb_config_expectations/tryserver.chromium.chromiumos.json +++ b/tools/mb/mb_config_expectations/tryserver.chromium.chromiumos.json
@@ -82,26 +82,6 @@ "use_goma": true } }, - "chromeos-kevin-compile-rel": { - "args_file": "//build/args/chromeos/kevin.gni", - "gn_args": { - "also_build_lacros_chrome_for_architecture": "arm", - "dcheck_always_on": true, - "is_chromeos_device": true, - "ozone_platform_headless": true, - "use_goma": true - } - }, - "chromeos-kevin-rel": { - "args_file": "//build/args/chromeos/kevin.gni", - "gn_args": { - "also_build_lacros_chrome_for_architecture": "arm", - "dcheck_always_on": true, - "is_chromeos_device": true, - "ozone_platform_headless": true, - "use_goma": true - } - }, "chromeos-octopus-rel": { "args_file": "//build/args/chromeos/octopus.gni", "gn_args": {
diff --git a/tools/mb/mb_config_expectations/tryserver.chromium.win.json b/tools/mb/mb_config_expectations/tryserver.chromium.win.json index 4a630b7..e1e55387 100644 --- a/tools/mb/mb_config_expectations/tryserver.chromium.win.json +++ b/tools/mb/mb_config_expectations/tryserver.chromium.win.json
@@ -271,19 +271,6 @@ "use_goma": true } }, - "win7-rel": { - "gn_args": { - "dcheck_always_on": true, - "enable_resource_allowlist_generation": true, - "ffmpeg_branding": "Chrome", - "is_component_build": false, - "is_debug": false, - "proprietary_codecs": true, - "symbol_level": 0, - "target_cpu": "x86", - "use_goma": true - } - }, "win_archive": { "gn_args": { "dcheck_always_on": true,
diff --git a/tools/metrics/histograms/enums.xml b/tools/metrics/histograms/enums.xml index 50fef681..7901c6c3 100644 --- a/tools/metrics/histograms/enums.xml +++ b/tools/metrics/histograms/enums.xml
@@ -57877,6 +57877,7 @@ <int value="-2098610409" label="disable-lcd-text"/> <int value="-2098294029" label="PageInfoStoreInfo:enabled"/> <int value="-2098243118" label="OmniboxTailSuggestions:disabled"/> + <int value="-2098234759" label="kScrollableTabStripOverflow:disabled"/> <int value="-2097906903" label="ArcNearbySharing:disabled"/> <int value="-2097895488" label="NotificationScrollBar:enabled"/> <int value="-2097515669" label="disable-cast"/> @@ -58639,6 +58640,7 @@ <int value="-1656179450" label="EnableOmniboxRichEntities:enabled"/> <int value="-1655535052" label="enable-pointer-events"/> <int value="-1655281250" label="DefaultCalculatorWebApp:enabled"/> + <int value="-1654476091" label="cast-streaming-force-enable-hardware-vp8"/> <int value="-1654344175" label="disable-extension-info-dialog"/> <int value="-1653991213" label="CrossOriginIsolated:disabled"/> <int value="-1653838003" label="PauseBackgroundTabs:enabled"/> @@ -60806,6 +60808,7 @@ <int value="-406475702" label="webview-disable-apps-package-names-allowlist-component"/> <int value="-405380243" label="enable-encryption-migration"/> + <int value="-405321262" label="cast-streaming-force-disable-hardware-vp8"/> <int value="-404496301" label="DownloadRange:disabled"/> <int value="-403701720" label="DirectActions:enabled"/> <int value="-403649153" label="WebViewBrotliSupport:disabled"/> @@ -61600,6 +61603,7 @@ <int value="61205887" label="enable-text-input-focus-manager"/> <int value="61466986" label="AsyncDns:disabled"/> <int value="63187126" label="DownloadsAutoResumptionNative:enabled"/> + <int value="63693157" label="cast-streaming-force-disable-hardware-h264"/> <int value="64016368" label="SafeBrowsingSeparateNetworkContexts:enabled"/> <int value="64942701" label="OfflinePagesSvelteConcurrentLoading:disabled"/> <int value="65245449" label="FilesBannerFramework:enabled"/> @@ -62258,6 +62262,7 @@ <int value="461523297" label="UsernameFirstFlowFallbackCrowdsourcing:enabled"/> <int value="461641589" label="WebAppWindowControlsOverlay:disabled"/> + <int value="462453078" label="cast-streaming-force-enable-hardware-h264"/> <int value="463582989" label="CompositorThreadedScrollbarScrolling:disabled"/> <int value="464226051" label="CrOSComponent:enabled"/> <int value="464773709" label="OmniboxExperimentalSuggestScoring:enabled"/> @@ -63521,6 +63526,7 @@ <int value="1220171692" label="SpeculativeLaunchServiceWorker:enabled"/> <int value="1220274247" label="AllowReaderForAccessibility:disabled"/> <int value="1220464509" label="enable-first-run-ui-transitions"/> + <int value="1220655015" label="kScrollableTabStripOverflow:enabled"/> <int value="1221394044" label="SharingUseDeviceInfo:enabled"/> <int value="1221559505" label="enable-spelling-feedback-field-trial"/> <int value="1222017136" label="WebRtcUseEchoCanceller3:disabled"/> @@ -76355,6 +76361,9 @@ <int value="1528" label="Cursor Colors: On/Off"/> <int value="1529" label="Fullscreen Magnifier Focus Following"/> <int value="1530" label="Fullscreen Magnifier Mouse Following Mode"/> + <int value="1531" label="Select-to-Speak: Word Highlight"/> + <int value="1532" label="Select-to-Speak: Background Shading"/> + <int value="1533" label="Select-to-Speak: Navigation Controls"/> <int value="1600" label="Powerwash"/> <int value="1700" label="Change Chrome Channel"/> <int value="1701" label="Copy Detailed Build Info"/> @@ -76439,6 +76448,7 @@ <int value="6" label="Tether Details"/> <int value="7" label="Vpn Details"/> <int value="8" label="APN"/> + <int value="9" label="Hotspot Details"/> <int value="100" label="Bluetooth Devices"/> <int value="101" label="Bluetooth Device Details"/> <int value="102" label="Bluetooth Saved Devices"/> @@ -105874,6 +105884,17 @@ <int value="2" label="Error">Launching the Chrome process failed.</int> </enum> +<enum name="WebAppLaunchHandlerClientMode"> + <summary> + The manifest launch_handler.client_mode of a web app as defined in: + https://wicg.github.io/web-app-launch/ + </summary> + <int value="0" label="Auto"/> + <int value="1" label="NavigateNew"/> + <int value="2" label="NavigateExisting"/> + <int value="3" label="FocusExisting"/> +</enum> + <enum name="WebAppManifestUpdateResult"> <int value="0" label="No app in scope"/> <int value="1" label="Updating throttled"/>
diff --git a/tools/metrics/histograms/metadata/omnibox/histograms.xml b/tools/metrics/histograms/metadata/omnibox/histograms.xml index 7e2122b..34588dd5 100644 --- a/tools/metrics/histograms/metadata/omnibox/histograms.xml +++ b/tools/metrics/histograms/metadata/omnibox/histograms.xml
@@ -378,6 +378,14 @@ it is expected to be more accurate: the baseline CharTypedToRepaintLatency uses now() from when the subsequent has-processed notification arrives back on the UI thread, which may overestimate user-visible latency. + + Note: Compositor-provided timestamps are taken using presentation time + callbacks. Before M110 the callbacks used for this histogram might be called + even if the next submitted frame fails to present which means that the + character is not really rendered on-screen yet. From M110 onward, this is + fixed by using callbacks that are only called after the first following + successful presentation, so a slight change might be noticed in the + histogram values. </summary> </histogram> @@ -390,6 +398,14 @@ Records the time between when OnPaint() is called to the time the compositor reports pixels were successfully drawn to the screen. This a subset of the time reported in Omnibox.CharTypedToRepaintLatency.InsertToPresent. + + Note: Compositor-provided timestamps are taken using presentation time + callbacks. Before M110 the callbacks used for this histogram might be called + even if the next submitted frame fails to present which means that the + character is not really rendered on-screen yet. From M110 onward, this is + fixed by using callbacks that are only called after the first following + successful presentation, so a slight change might be noticed in the + histogram values. </summary> </histogram>
diff --git a/tools/metrics/histograms/metadata/startup/histograms.xml b/tools/metrics/histograms/metadata/startup/histograms.xml index c9b5d08d..d219517 100644 --- a/tools/metrics/histograms/metadata/startup/histograms.xml +++ b/tools/metrics/histograms/metadata/startup/histograms.xml
@@ -748,8 +748,8 @@ </histogram> <histogram name="Startup.IncognitoForcedStart" enum="IncognitoForcedStart" - expires_after="M110"> - <owner>sideyilmaz@chromium.org</owner> + expires_after="M111"> + <owner>arabm@google.com</owner> <owner>chrome-incognito@google.com</owner> <summary> Records whether Incognito switch was present in commmand line switches and
diff --git a/tools/metrics/histograms/metadata/webapps/histograms.xml b/tools/metrics/histograms/metadata/webapps/histograms.xml index eee1437..432390f7 100644 --- a/tools/metrics/histograms/metadata/webapps/histograms.xml +++ b/tools/metrics/histograms/metadata/webapps/histograms.xml
@@ -156,6 +156,15 @@ </summary> </histogram> +<histogram name="Launch.WebAppLaunchHandlerClientMode" + enum="WebAppLaunchHandlerClientMode" expires_after="2023-05-01"> + <owner>alancutter@chromium.org</owner> + <owner>desktop-pwas-team@google.com</owner> + <summary> + Records the launch_handler.client_mode used when a web app is launched. + </summary> +</histogram> + <histogram name="Webapp.AddToHomescreenDialog.Timeout" units="ms" expires_after="2023-03-19"> <owner>dominickn@chromium.org</owner>
diff --git a/tools/perf/core/perfetto_binary_roller/binary_deps.json b/tools/perf/core/perfetto_binary_roller/binary_deps.json index 21818bd..f6fc2b6 100644 --- a/tools/perf/core/perfetto_binary_roller/binary_deps.json +++ b/tools/perf/core/perfetto_binary_roller/binary_deps.json
@@ -6,15 +6,15 @@ }, "win": { "hash": "bb2cc045bbee68ad3cd3daed827075285572fe49", - "full_remote_path": "chromium-telemetry/perfetto_binaries/trace_processor_shell/win/a379922c811554e5e779ab4609e63cbeff592974/trace_processor_shell.exe" + "full_remote_path": "chromium-telemetry/perfetto_binaries/trace_processor_shell/win/3c036ab6b21b9d9ddf91dc6b7fe7f50142f28758/trace_processor_shell.exe" }, "linux_arm": { "hash": "58893933be305d3bfe0a72ebebcacde2ac3ca893", "full_remote_path": "chromium-telemetry/perfetto_binaries/trace_processor_shell/linux_arm/49b4b5dcbc312d8d2c3751cf29238b8efeb4e494/trace_processor_shell" }, "mac": { - "hash": "d85de527c577d68968139c64a9185e6b00750c8d", - "full_remote_path": "chromium-telemetry/perfetto_binaries/trace_processor_shell/mac/9fcb4a22e876f62e6e197d03000ee955d26c4bf4/trace_processor_shell" + "hash": "8b044ed1e83e8ee19188d2ce95b0855506999ab5", + "full_remote_path": "chromium-telemetry/perfetto_binaries/trace_processor_shell/mac/6f7678ba37a925e02df652a13c50be9daaeb484e/trace_processor_shell" }, "mac_arm64": { "hash": "92318bea34f5c9beec69d2d826a9a92ec9d3cdcd", @@ -22,7 +22,7 @@ }, "linux": { "hash": "7e4cc10d0a4b47b170771988b6800e9438ad73cf", - "full_remote_path": "chromium-telemetry/perfetto_binaries/trace_processor_shell/linux/a379922c811554e5e779ab4609e63cbeff592974/trace_processor_shell" + "full_remote_path": "chromium-telemetry/perfetto_binaries/trace_processor_shell/linux/6f7678ba37a925e02df652a13c50be9daaeb484e/trace_processor_shell" } }, "power_profile.sql": {
diff --git a/ui/base/ime/ash/input_method_manager.h b/ui/base/ime/ash/input_method_manager.h index 3a38c1f..d34e4db 100644 --- a/ui/base/ime/ash/input_method_manager.h +++ b/ui/base/ime/ash/input_method_manager.h
@@ -182,14 +182,13 @@ // methods, sorted in ascending order of their localized full display names, // according to the lexicographical order defined by the current system // locale (aka. display language). - virtual std::unique_ptr<InputMethodDescriptors> + virtual InputMethodDescriptors GetEnabledInputMethodsSortedByLocalizedDisplayNames() const = 0; // Returns enabled input methods, including extension input methods. // Although presented as a list, the result is NOT sorted in any specific // order; the ordering is arbitrary and undefined. - virtual std::unique_ptr<InputMethodDescriptors> GetEnabledInputMethods() - const = 0; + virtual InputMethodDescriptors GetEnabledInputMethods() const = 0; // Returns IDs of enabled input methods, including extension input methods. // Although presented as a list, the result is NOT sorted in any specific
diff --git a/ui/base/ime/ash/mock_input_method_manager.cc b/ui/base/ime/ash/mock_input_method_manager.cc index ad526ed..5c82cfd 100644 --- a/ui/base/ime/ash/mock_input_method_manager.cc +++ b/ui/base/ime/ash/mock_input_method_manager.cc
@@ -48,14 +48,14 @@ void MockInputMethodManager::State::GetInputMethodExtensions( InputMethodDescriptors* result) {} -std::unique_ptr<InputMethodDescriptors> MockInputMethodManager::State:: +InputMethodDescriptors MockInputMethodManager::State:: GetEnabledInputMethodsSortedByLocalizedDisplayNames() const { - return nullptr; + return {}; } -std::unique_ptr<InputMethodDescriptors> -MockInputMethodManager::State::GetEnabledInputMethods() const { - return nullptr; +InputMethodDescriptors MockInputMethodManager::State::GetEnabledInputMethods() + const { + return {}; } const std::vector<std::string>&
diff --git a/ui/base/ime/ash/mock_input_method_manager.h b/ui/base/ime/ash/mock_input_method_manager.h index 55b411d8..315e791 100644 --- a/ui/base/ime/ash/mock_input_method_manager.h +++ b/ui/base/ime/ash/mock_input_method_manager.h
@@ -46,10 +46,9 @@ const std::vector<std::string>& initial_layouts) override; void DisableNonLockScreenLayouts() override; void GetInputMethodExtensions(InputMethodDescriptors* result) override; - std::unique_ptr<InputMethodDescriptors> - GetEnabledInputMethodsSortedByLocalizedDisplayNames() const override; - std::unique_ptr<InputMethodDescriptors> GetEnabledInputMethods() + InputMethodDescriptors GetEnabledInputMethodsSortedByLocalizedDisplayNames() const override; + InputMethodDescriptors GetEnabledInputMethods() const override; const std::vector<std::string>& GetEnabledInputMethodIds() const override; const InputMethodDescriptor* GetInputMethodFromId( const std::string& input_method_id) const override;
diff --git a/weblayer/browser/navigation_controller_impl.cc b/weblayer/browser/navigation_controller_impl.cc index 07013c79..e558b94 100644 --- a/weblayer/browser/navigation_controller_impl.cc +++ b/weblayer/browser/navigation_controller_impl.cc
@@ -362,9 +362,10 @@ } int NavigationControllerImpl::GetNavigationListSize() { - content::NavigationEntry* current_entry = - web_contents()->GetController().GetLastCommittedEntry(); - if (current_entry && current_entry->IsInitialEntry()) { + if (web_contents() + ->GetController() + .GetLastCommittedEntry() + ->IsInitialEntry()) { // If we're currently on the initial NavigationEntry, no navigation has // committed, so the initial NavigationEntry should not be part of the // "Navigation List", and we should return 0 as the navigation list size. @@ -377,9 +378,10 @@ } int NavigationControllerImpl::GetNavigationListCurrentIndex() { - content::NavigationEntry* current_entry = - web_contents()->GetController().GetLastCommittedEntry(); - if (current_entry && current_entry->IsInitialEntry()) { + if (web_contents() + ->GetController() + .GetLastCommittedEntry() + ->IsInitialEntry()) { // If we're currently on the initial NavigationEntry, no navigation has // committed, so the initial NavigationEntry should not be part of the // "Navigation List", and we should return -1 as the current index. This
diff --git a/weblayer/browser/persistence/browser_persister.cc b/weblayer/browser/persistence/browser_persister.cc index 149d25b..1e6bf29e 100644 --- a/weblayer/browser/persistence/browser_persister.cc +++ b/weblayer/browser/persistence/browser_persister.cc
@@ -299,12 +299,10 @@ // Ensure that we don't try to persist initial NavigationEntry, as it is // not actually associated with any navigation and will just result in // about:blank on session restore. - bool is_on_initial_entry = - (tab->web_contents()->GetController().GetLastCommittedEntry() && - tab->web_contents() - ->GetController() - .GetLastCommittedEntry() - ->IsInitialEntry()); + bool is_on_initial_entry = (tab->web_contents() + ->GetController() + .GetLastCommittedEntry() + ->IsInitialEntry()); const int current_index = is_on_initial_entry ? -1 : controller.GetCurrentEntryIndex(); const int min_index =