diff --git a/DEPS b/DEPS index 9a9c50d..1ed3ed2 100644 --- a/DEPS +++ b/DEPS
@@ -175,11 +175,11 @@ # 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': 'e8d2080a34ed3edfee6b979c8b07ad6e96b240d8', + 'skia_revision': '6c51bf61e283a3daee085249570d187456c61d9f', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling V8 # and whatever else without interference from each other. - 'v8_revision': '05530618c6b37f9d517e1f3ee5c90a7e40edcdfa', + 'v8_revision': 'c54a65155d141301ee4ce71d9bb303748b4692c6', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling swarming_client # and whatever else without interference from each other. @@ -187,15 +187,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': 'afd2cfa6c14d207489efe6ee7357c7ad564748be', + 'angle_revision': '4db77367da4d4845f588fbee438f315a8b0814a1', # 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': 'c66dad9552ef9cab3a4dfb66c22d756fc5c4b06c', + 'swiftshader_revision': 'cb58662302c8e73845116fc5f14acaa08c037cb2', # 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': '0058260afa11281d48303e6720b2566e42083cbf', + 'pdfium_revision': '094f8e6f0c43b8eda25a5a3dddaa9856da1edc1b', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling BoringSSL # and whatever else without interference from each other. @@ -230,7 +230,7 @@ # Three lines of non-changing comments so that # the commit queue can handle CLs rolling HarfBuzz # and whatever else without interference from each other. - 'harfbuzz_revision': '558f922788ccceaa80c31bf0e379be4c96598d13', + 'harfbuzz_revision': '014e038b2c2fd55e0bffbe5c5adc893c07df187a', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling Emoji Segmenter # and whatever else without interference from each other. @@ -246,7 +246,7 @@ # Three lines of non-changing comments so that # the commit queue can handle CLs rolling devtools-frontend # and whatever else without interference from each other. - 'devtools_frontend_revision': '0a34c98ea0b04d94fee9669c7715c721fdbd14bb', + 'devtools_frontend_revision': '4d123409dc1a1bf42337c9435d0a0aa5af3bfe73', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling libprotobuf-mutator # and whatever else without interference from each other. @@ -286,7 +286,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. - 'spv_tools_revision': 'c37c94929bf575f44256469855eaa5aab411f14f', + 'spv_tools_revision': 'f20c0d7971c6705a99b91d7a0278eabbc5d91195', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling feed # and whatever else without interference from each other. @@ -294,15 +294,15 @@ # Three lines of non-changing comments so that # the commit queue can handle CLs rolling feed # and whatever else without interference from each other. - 'spirv_cross_revision': '172e39f0398b920cfc221b7826c92105d44ad647', + 'spirv_cross_revision': 'e58e8d5dbe03ea2cc755dbaf43ffefa1b8d77bef', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling feed # and whatever else without interference from each other. - 'shaderc_revision': '1db568ebb1f0efbf72cc94795d13c9bf8e126406', + 'shaderc_revision': '486655782f8b8a4f04420d8452c2138da373956f', # 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': 'a0afd3158504f5ae0cd4aeced0b21a5f66635729', + 'dawn_revision': '5b29904d76bc6543d2592568929bb548925982f7', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling feed # and whatever else without interference from each other. @@ -877,7 +877,7 @@ }, 'src/third_party/depot_tools': - Var('chromium_git') + '/chromium/tools/depot_tools.git' + '@' + '4f30cf0179653b3b84b50a13e741322e91190864', + Var('chromium_git') + '/chromium/tools/depot_tools.git' + '@' + '9db428f4f78ea6eebea783850f889a55d8f6a948', 'src/third_party/devtools-frontend/src': Var('chromium_git') + '/devtools/devtools-frontend' + '@' + Var('devtools_frontend_revision'), @@ -930,7 +930,7 @@ Var('chromium_git') + '/external/github.com/google/emoji-segmenter.git' + '@' + Var('emoji_segmenter_revision'), 'src/third_party/libgav1/src': - Var('chromium_git') + '/codecs/libgav1.git' + '@' + 'fa1c3c4e673cf12ffa22b8fbe4a7c79314571f1b', + Var('chromium_git') + '/codecs/libgav1.git' + '@' + '638ef84819f8b3cd614dcf63378fe4814aa4cb2a', 'src/third_party/glslang/src': Var('chromium_git') + '/external/github.com/KhronosGroup/glslang.git' + '@' + '1fff3623550471d20d2a4d0afeeb0bedf28edc54', @@ -1013,7 +1013,7 @@ Var('chromium_git') + '/chromium/deps/hunspell_dictionaries.git' + '@' + '6fdad5388130757e1efb58a14b8e7f9494625691', 'src/third_party/icu': - Var('chromium_git') + '/chromium/deps/icu.git' + '@' + 'd7aff76cf6bb0fbef3afa6c07718f78a80a70f8f', + Var('chromium_git') + '/chromium/deps/icu.git' + '@' + '13cfcd5874f6c39c34ec57fa5295e7910ae90b8d', 'src/third_party/icu4j': { 'packages': [ @@ -1128,7 +1128,7 @@ }, 'src/third_party/libvpx/source/libvpx': - Var('chromium_git') + '/webm/libvpx.git' + '@' + '5532775efe808cb0942e7b99bf2f232c6ce99fee', + Var('chromium_git') + '/webm/libvpx.git' + '@' + '667138e1f0581772de2b990e144bcd6c49a6adb8', 'src/third_party/libwebm/source': Var('chromium_git') + '/webm/libwebm.git' + '@' + '51ca718c3adf0ddedacd7df25fe45f67dc5a9ce1', @@ -1211,7 +1211,7 @@ Var('chromium_git') + '/external/github.com/cisco/openh264' + '@' + '6f26bce0b1c4e8ce0e13332f7c0083788def5fdf', 'src/third_party/openscreen/src': - Var('chromium_git') + '/openscreen' + '@' + 'e5b4b11496a0bbf88317e4c58099dfd7a01cf4ca', + Var('chromium_git') + '/openscreen' + '@' + '07dc402b054571865da9c85d13172c8a51437c1b', 'src/third_party/openxr/src': { 'url': Var('chromium_git') + '/external/github.com/KhronosGroup/OpenXR-SDK' + '@' + '9e97b73e7dd2bfc07745489d728f6a36665c648f', @@ -1228,7 +1228,7 @@ }, 'src/third_party/perfetto': - Var('android_git') + '/platform/external/perfetto.git' + '@' + 'b6fd42ad9ae2592258cfd4da6f7cfb8c6682cb53', + Var('android_git') + '/platform/external/perfetto.git' + '@' + '4e0750ed757476ebccf2f27911951f628ec24c8e', 'src/third_party/perl': { 'url': Var('chromium_git') + '/chromium/deps/perl.git' + '@' + '6f3e5028eb65d0b4c5fdd792106ac4c84eee1eb3', @@ -1458,7 +1458,7 @@ }, 'src/third_party/webrtc': - Var('webrtc_git') + '/src.git' + '@' + 'e283d1ca64c61cb5fa7fce1bcb2cb5fdc067f103', + Var('webrtc_git') + '/src.git' + '@' + '6f402f991ec31140ec1014c6201c1fbf839aaaa3', 'src/third_party/libgifcodec': Var('skia_git') + '/libgifcodec' + '@'+ Var('libgifcodec_revision'), @@ -1533,7 +1533,7 @@ Var('chromium_git') + '/v8/v8.git' + '@' + Var('v8_revision'), 'src-internal': { - 'url': 'https://chrome-internal.googlesource.com/chrome/src-internal.git@85b8bc1b0e14ff47c14cffb73572c1d0011c2525', + 'url': 'https://chrome-internal.googlesource.com/chrome/src-internal.git@0916f4887515434a7d418f4908776199a35910c8', 'condition': 'checkout_src_internal', },
diff --git a/android_webview/java/src/org/chromium/android_webview/AwContents.java b/android_webview/java/src/org/chromium/android_webview/AwContents.java index 9cf1ddb..3ea9a07 100644 --- a/android_webview/java/src/org/chromium/android_webview/AwContents.java +++ b/android_webview/java/src/org/chromium/android_webview/AwContents.java
@@ -3656,7 +3656,7 @@ // Tint everything one color, to make WebViews easier to spot. if (CommandLine.getInstance().hasSwitch(AwSwitches.HIGHLIGHT_ALL_WEBVIEWS)) { - int semiTransparentYellow = Color.argb(127, 255, 255, 0); + int semiTransparentYellow = Color.argb(80, 252, 252, 109); canvas.drawColor(semiTransparentYellow); } }
diff --git a/ash/BUILD.gn b/ash/BUILD.gn index 2bb39c0..b34877a 100644 --- a/ash/BUILD.gn +++ b/ash/BUILD.gn
@@ -742,6 +742,10 @@ "system/audio/audio_detailed_view.h", "system/audio/display_speaker_controller.cc", "system/audio/display_speaker_controller.h", + "system/audio/mic_gain_slider_controller.cc", + "system/audio/mic_gain_slider_controller.h", + "system/audio/mic_gain_slider_view.cc", + "system/audio/mic_gain_slider_view.h", "system/audio/unified_audio_detailed_view_controller.cc", "system/audio/unified_audio_detailed_view_controller.h", "system/audio/unified_volume_slider_controller.cc",
diff --git a/ash/app_list/app_list_controller_impl.cc b/ash/app_list/app_list_controller_impl.cc index edd4438..a49bfce 100644 --- a/ash/app_list/app_list_controller_impl.cc +++ b/ash/app_list/app_list_controller_impl.cc
@@ -1054,13 +1054,13 @@ home_launcher_animation_callback_ = std::move(callback); } -void AppListControllerImpl::RecordShelfAppLaunched( - base::Optional<AppListViewState> recorded_app_list_view_state, - base::Optional<bool> recorded_home_launcher_shown) { +void AppListControllerImpl::RecordShelfAppLaunched() { RecordAppListAppLaunched( AppListLaunchedFrom::kLaunchedFromShelf, - recorded_app_list_view_state.value_or(GetAppListViewState()), - IsTabletMode(), recorded_home_launcher_shown.value_or(last_visible_)); + recorded_app_list_view_state_.value_or(GetAppListViewState()), + IsTabletMode(), recorded_app_list_visibility_.value_or(last_visible_)); + recorded_app_list_view_state_ = base::nullopt; + recorded_app_list_visibility_ = base::nullopt; } //////////////////////////////////////////////////////////////////////////////// @@ -1766,4 +1766,9 @@ tracked_app_window_->AddObserver(this); } +void AppListControllerImpl::RecordAppListState() { + recorded_app_list_view_state_ = GetAppListViewState(); + recorded_app_list_visibility_ = last_visible_; +} + } // namespace ash
diff --git a/ash/app_list/app_list_controller_impl.h b/ash/app_list/app_list_controller_impl.h index 267dc9a..278246d 100644 --- a/ash/app_list/app_list_controller_impl.h +++ b/ash/app_list/app_list_controller_impl.h
@@ -333,9 +333,7 @@ void SetHomeLauncherAnimationCallbackForTesting( HomeLauncherAnimationCallback callback); - void RecordShelfAppLaunched( - base::Optional<AppListViewState> recorded_app_list_view_state, - base::Optional<bool> home_launcher_shown); + void RecordShelfAppLaunched(); // Updates which container the launcher window should be in. void UpdateLauncherContainer( @@ -351,6 +349,10 @@ aura::Window* GetContainerForDisplayId( base::Optional<int64_t> display_id = base::nullopt); + // Methods for recording the state of the app list before it changes in order + // to record metrics. + void RecordAppListState(); + private: // HomeScreenDelegate: void OnHomeLauncherDragStart() override; @@ -444,6 +446,16 @@ // visibility animation to finish. Should only be used in tablet mode. HomeLauncherAnimationCallback home_launcher_animation_callback_; + // The AppListViewState at the moment it was recorded, used to record app + // launching metrics. This allows an accurate AppListViewState to be recorded + // before AppListViewState changes. + base::Optional<AppListViewState> recorded_app_list_view_state_; + + // Whether the applist was shown at the moment it was recorded, used to record + // app launching metrics. This is recorded because AppList visibility can + // change before the metric is recorded. + base::Optional<bool> recorded_app_list_visibility_; + // ScopedClosureRunner which while in scope keeps background blur in home // screen (in particular, apps container suggestion chips background) // disabled. Set while home screen transitions are in progress.
diff --git a/ash/app_list/app_list_presenter_delegate_impl.cc b/ash/app_list/app_list_presenter_delegate_impl.cc index 510306e..1e63186 100644 --- a/ash/app_list/app_list_presenter_delegate_impl.cc +++ b/ash/app_list/app_list_presenter_delegate_impl.cc
@@ -250,18 +250,20 @@ !switches::ShouldNotDismissOnBlur() && !IsTabletMode()) { const aura::Window* status_window = shelf->shelf_widget()->status_area_widget()->GetNativeWindow(); - // Don't dismiss the auto-hide shelf if event happened in status area. Then - // the event can still be propagated to the status area tray to open the - // corresponding tray bubble. - base::Optional<Shelf::ScopedAutoHideLock> auto_hide_lock; - if (status_window && status_window->Contains(target)) - auto_hide_lock.emplace(shelf); - - // Keep the app list open if the event happened in the shelf area. const aura::Window* hotseat_window = shelf->hotseat_widget()->GetNativeWindow(); - if (!hotseat_window || !hotseat_window->Contains(target)) - presenter_->Dismiss(event->time_stamp()); + // Don't dismiss the auto-hide shelf if event happened in status area or the + // hotseat. Then the event can still be propagated. + base::Optional<Shelf::ScopedAutoHideLock> auto_hide_lock; + if ((status_window && status_window->Contains(target)) || + (hotseat_window && hotseat_window->Contains(target))) { + auto_hide_lock.emplace(shelf); + } + // Record the current AppListViewState to be used later for metrics. The + // AppListViewState will change on app launch, so this will record the + // AppListViewState before the app was launched. + controller_->RecordAppListState(); + presenter_->Dismiss(event->time_stamp()); } }
diff --git a/ash/app_list/app_list_presenter_delegate_unittest.cc b/ash/app_list/app_list_presenter_delegate_unittest.cc index 787145d4..8ff4b25 100644 --- a/ash/app_list/app_list_presenter_delegate_unittest.cc +++ b/ash/app_list/app_list_presenter_delegate_unittest.cc
@@ -2202,11 +2202,11 @@ GetAppListTestHelper()->CheckVisibility(true); EXPECT_EQ(SHELF_AUTO_HIDE_SHOWN, shelf->GetAutoHideState()); - // Test that tapping the auto-hidden shelf keeps the app list and shelf - // visible. + // Test that tapping the auto-hidden shelf keeps shelf visible but dismiss the + // app list. generator->GestureTapAt( shelf->GetShelfViewForTesting()->GetBoundsInScreen().CenterPoint()); - GetAppListTestHelper()->CheckVisibility(true); + GetAppListTestHelper()->CheckVisibility(false); EXPECT_EQ(SHELF_AUTO_HIDE_SHOWN, shelf->GetAutoHideState()); }
diff --git a/ash/ash_strings.grd b/ash/ash_strings.grd index 09839a05..5702d1e 100644 --- a/ash/ash_strings.grd +++ b/ash/ash_strings.grd
@@ -478,6 +478,16 @@ Your screen will go blank for longer than usual (up to a minute) during this update. Please don't press the power button while the update is in progress. </message> + <message name="IDS_ASH_STATUS_TRAY_MIC_GAIN" desc="The accessible text for the toggle mic muted button in the tray audio settings"> + Toggle Mic. <ph name="STATE_TEXT">$1<ex>Mic is muted</ex></ph> + </message> + <message name="IDS_ASH_STATUS_TRAY_MIC_STATE_ON" desc="The accessible text used when the mic gain button is in the on state."> + Mic is on, toggling will mute input. + </message> + <message name="IDS_ASH_STATUS_TRAY_MIC_STATE_MUTED" desc="The accessible text used when the mic gain button is in the muted state."> + Mic is muted. + </message> + <message name="IDS_ASH_STATUS_TRAY_VOLUME" desc="The accessible text for the toggle volume muted button in the tray."> Toggle Volume. <ph name="STATE_TEXT">$1<ex>Volume is muted</ex></ph> </message> @@ -2256,6 +2266,9 @@ </message> <!-- Assistant Quick Answers --> + <message name="IDS_ASH_QUICK_ANSWERS_DOGFOOD_BUTTON_TOOLTIP_TEXT" desc="Tooltip text for the dogfood-button within Quick-Answers related views to help users file bugs easily."> + File feedback + </message> <message name="IDS_ASH_QUICK_ANSWERS_USER_CONSENT_VIEW_TITLE_TEXT" desc="Title text of the dialog that opens up to seek user-consent for the Quick Answers feature."> Get info related to your selection </message>
diff --git a/ash/ash_strings_grd/IDS_ASH_QUICK_ANSWERS_DOGFOOD_BUTTON_TOOLTIP_TEXT.png.sha1 b/ash/ash_strings_grd/IDS_ASH_QUICK_ANSWERS_DOGFOOD_BUTTON_TOOLTIP_TEXT.png.sha1 new file mode 100644 index 0000000..b7b945c4 --- /dev/null +++ b/ash/ash_strings_grd/IDS_ASH_QUICK_ANSWERS_DOGFOOD_BUTTON_TOOLTIP_TEXT.png.sha1
@@ -0,0 +1 @@ +548c3ed05e021df7ae0af78f9deafe4e5d92584e \ No newline at end of file
diff --git a/ash/ash_strings_grd/IDS_ASH_STATUS_TRAY_MIC_GAIN.png.sha1 b/ash/ash_strings_grd/IDS_ASH_STATUS_TRAY_MIC_GAIN.png.sha1 new file mode 100644 index 0000000..f74ad07 --- /dev/null +++ b/ash/ash_strings_grd/IDS_ASH_STATUS_TRAY_MIC_GAIN.png.sha1
@@ -0,0 +1 @@ +47b10ec7985ca56244795803be5c41f23142df41 \ No newline at end of file
diff --git a/ash/ash_strings_grd/IDS_ASH_STATUS_TRAY_MIC_STATE_MUTED.png.sha1 b/ash/ash_strings_grd/IDS_ASH_STATUS_TRAY_MIC_STATE_MUTED.png.sha1 new file mode 100644 index 0000000..f74ad07 --- /dev/null +++ b/ash/ash_strings_grd/IDS_ASH_STATUS_TRAY_MIC_STATE_MUTED.png.sha1
@@ -0,0 +1 @@ +47b10ec7985ca56244795803be5c41f23142df41 \ No newline at end of file
diff --git a/ash/ash_strings_grd/IDS_ASH_STATUS_TRAY_MIC_STATE_ON.png.sha1 b/ash/ash_strings_grd/IDS_ASH_STATUS_TRAY_MIC_STATE_ON.png.sha1 new file mode 100644 index 0000000..4ab0e4535f --- /dev/null +++ b/ash/ash_strings_grd/IDS_ASH_STATUS_TRAY_MIC_STATE_ON.png.sha1
@@ -0,0 +1 @@ +0e00a09d6bdfd82937f9e9f458897d336539841e \ No newline at end of file
diff --git a/ash/assistant/assistant_screen_context_controller.cc b/ash/assistant/assistant_screen_context_controller.cc index 9a6d00d..cc5fa11 100644 --- a/ash/assistant/assistant_screen_context_controller.cc +++ b/ash/assistant/assistant_screen_context_controller.cc
@@ -222,9 +222,9 @@ ui::GrabLayerSnapshotAsync( root_layer, source_rect, - base::BindRepeating(&EncodeScreenshotAndRunCallback, - base::Passed(std::move(callback)), - base::Passed(std::move(layer_owner)))); + base::BindOnce(&EncodeScreenshotAndRunCallback, + base::Passed(std::move(callback)), + base::Passed(std::move(layer_owner)))); } void AssistantScreenContextController::OnAssistantControllerConstructed() {
diff --git a/ash/dbus/display_service_provider.cc b/ash/dbus/display_service_provider.cc index 0831a520..1602626d 100644 --- a/ash/dbus/display_service_provider.cc +++ b/ash/dbus/display_service_provider.cc
@@ -84,32 +84,32 @@ chromeos::kDisplayServiceSetPowerMethod, base::BindRepeating(&DisplayServiceProvider::SetDisplayPower, weak_ptr_factory_.GetWeakPtr()), - base::BindRepeating(&DisplayServiceProvider::OnExported, - weak_ptr_factory_.GetWeakPtr())); + base::BindOnce(&DisplayServiceProvider::OnExported, + weak_ptr_factory_.GetWeakPtr())); exported_object->ExportMethod( chromeos::kDisplayServiceInterface, chromeos::kDisplayServiceSetSoftwareDimmingMethod, base::BindRepeating(&DisplayServiceProvider::SetDisplaySoftwareDimming, weak_ptr_factory_.GetWeakPtr()), - base::BindRepeating(&DisplayServiceProvider::OnExported, - weak_ptr_factory_.GetWeakPtr())); + base::BindOnce(&DisplayServiceProvider::OnExported, + weak_ptr_factory_.GetWeakPtr())); exported_object->ExportMethod( chromeos::kDisplayServiceInterface, chromeos::kDisplayServiceTakeOwnershipMethod, base::BindRepeating(&DisplayServiceProvider::TakeDisplayOwnership, weak_ptr_factory_.GetWeakPtr()), - base::BindRepeating(&DisplayServiceProvider::OnExported, - weak_ptr_factory_.GetWeakPtr())); + base::BindOnce(&DisplayServiceProvider::OnExported, + weak_ptr_factory_.GetWeakPtr())); exported_object->ExportMethod( chromeos::kDisplayServiceInterface, chromeos::kDisplayServiceReleaseOwnershipMethod, base::BindRepeating(&DisplayServiceProvider::ReleaseDisplayOwnership, weak_ptr_factory_.GetWeakPtr()), - base::BindRepeating(&DisplayServiceProvider::OnExported, - weak_ptr_factory_.GetWeakPtr())); + base::BindOnce(&DisplayServiceProvider::OnExported, + weak_ptr_factory_.GetWeakPtr())); } void DisplayServiceProvider::SetDisplayPower(
diff --git a/ash/dbus/url_handler_service_provider.cc b/ash/dbus/url_handler_service_provider.cc index 94034ed..488d4f8 100644 --- a/ash/dbus/url_handler_service_provider.cc +++ b/ash/dbus/url_handler_service_provider.cc
@@ -45,7 +45,7 @@ chromeos::kUrlHandlerServiceOpenUrlMethod, base::BindRepeating(&UrlHandlerServiceProvider::OpenUrl, weak_ptr_factory_.GetWeakPtr()), - base::BindRepeating(&OnExported)); + base::BindOnce(&OnExported)); } bool UrlHandlerServiceProvider::UrlAllowed(const GURL& gurl) const {
diff --git a/ash/focus_cycler.cc b/ash/focus_cycler.cc index 73f97dac..58ffb57b 100644 --- a/ash/focus_cycler.cc +++ b/ash/focus_cycler.cc
@@ -47,11 +47,10 @@ views::Widget* widget = views::Widget::GetWidgetForNativeView(window); // First try to rotate focus within the active widget. If that succeeds, // we're done. - if (widget && - widget->GetFocusManager()->RotatePaneFocus( - direction == BACKWARD ? views::FocusManager::kBackward - : views::FocusManager::kForward, - views::FocusManager::kNoWrap)) { + if (widget && widget->GetFocusManager()->RotatePaneFocus( + direction == BACKWARD ? views::FocusManager::kBackward + : views::FocusManager::kForward, + views::FocusManager::FocusCycleWrapping::kDisabled)) { return; } } @@ -94,10 +93,10 @@ break; views::FocusManager* focus_manager = widget->GetFocusManager(); focus_manager->ClearFocus(); - focus_manager->RotatePaneFocus(direction == BACKWARD - ? views::FocusManager::kBackward - : views::FocusManager::kForward, - views::FocusManager::kWrap); + focus_manager->RotatePaneFocus( + direction == BACKWARD ? views::FocusManager::kBackward + : views::FocusManager::kForward, + views::FocusManager::FocusCycleWrapping::kEnabled); break; } else { if (FocusWidget(widgets_[index]))
diff --git a/ash/login/login_screen_test_api.cc b/ash/login/login_screen_test_api.cc index f58a02e..6d3a49a 100644 --- a/ash/login/login_screen_test_api.cc +++ b/ash/login/login_screen_test_api.cc
@@ -173,6 +173,14 @@ } // static +bool LoginScreenTestApi::IsWarningBubbleShown() { + LockScreen::TestApi lock_screen_test(LockScreen::Get()); + LockContentsView::TestApi lock_contents_test( + lock_screen_test.contents_view()); + return lock_contents_test.warning_banner_bubble()->GetVisible(); +} + +// static void LoginScreenTestApi::SubmitPassword(const AccountId& account_id, const std::string& password, bool check_if_submittable) {
diff --git a/ash/login/parent_access_controller_unittest.cc b/ash/login/parent_access_controller_unittest.cc index 85fe3e307..7d7dd3e 100644 --- a/ash/login/parent_access_controller_unittest.cc +++ b/ash/login/parent_access_controller_unittest.cc
@@ -60,8 +60,8 @@ validation_time_ = base::Time::Now(); controller_->ShowWidget( account_id_, - base::BindRepeating(&ParentAccessControllerTest::OnFinished, - base::Unretained(this)), + base::BindOnce(&ParentAccessControllerTest::OnFinished, + base::Unretained(this)), reason, false, validation_time_); view_ = PinRequestWidget::TestApi(PinRequestWidget::Get()).pin_request_view();
diff --git a/ash/login/ui/animated_rounded_image_view.cc b/ash/login/ui/animated_rounded_image_view.cc index d574efb..1354083 100644 --- a/ash/login/ui/animated_rounded_image_view.cc +++ b/ash/login/ui/animated_rounded_image_view.cc
@@ -128,8 +128,8 @@ // Schedule next frame update. update_frame_timer_.Start( FROM_HERE, frames_[active_frame_].duration, - base::BindRepeating(&AnimatedRoundedImageView::UpdateAnimationFrame, - base::Unretained(this))); + base::BindOnce(&AnimatedRoundedImageView::UpdateAnimationFrame, + base::Unretained(this))); } }
diff --git a/ash/login/ui/lock_contents_view.cc b/ash/login/ui/lock_contents_view.cc index e92ee138..2a63f46 100644 --- a/ash/login/ui/lock_contents_view.cc +++ b/ash/login/ui/lock_contents_view.cc
@@ -676,8 +676,8 @@ Shell::Get()->parent_access_controller()->ShowWidget( account_id, - base::BindRepeating(&LockContentsView::OnParentAccessValidationFinished, - weak_ptr_factory_.GetWeakPtr(), account_id), + base::BindOnce(&LockContentsView::OnParentAccessValidationFinished, + weak_ptr_factory_.GetWeakPtr(), account_id), ParentAccessRequestReason::kUnlockTimeLimits, false, base::Time::Now()); Shell::Get()->login_screen_controller()->ShowParentAccessButton(false); }
diff --git a/ash/login/ui/login_auth_user_view.cc b/ash/login/ui/login_auth_user_view.cc index 64bf8a179..77f36a9 100644 --- a/ash/login/ui/login_auth_user_view.cc +++ b/ash/login/ui/login_auth_user_view.cc
@@ -421,8 +421,8 @@ reset_state_.Start( FROM_HERE, base::TimeDelta::FromMilliseconds(kResetToDefaultIconDelayMs), - base::BindRepeating(&FingerprintView::DisplayCurrentState, - base::Unretained(this))); + base::BindOnce(&FingerprintView::DisplayCurrentState, + base::Unretained(this))); FireAlert(); }
diff --git a/ash/login/ui/login_pin_view.cc b/ash/login/ui/login_pin_view.cc index e3e17ae..675dbbd5 100644 --- a/ash/login/ui/login_pin_view.cc +++ b/ash/login/ui/login_pin_view.cc
@@ -298,8 +298,8 @@ delay_timer_->Start( FROM_HERE, base::TimeDelta::FromMilliseconds(kInitialBackspaceDelayMs), - base::BindRepeating(&BackspacePinButton::DispatchPress, - base::Unretained(this), nullptr)); + base::BindOnce(&BackspacePinButton::DispatchPress, + base::Unretained(this), nullptr)); if (event) event->SetHandled();
diff --git a/ash/media/media_controller_impl.cc b/ash/media/media_controller_impl.cc index 2931611..51de24b4c 100644 --- a/ash/media/media_controller_impl.cc +++ b/ash/media/media_controller_impl.cc
@@ -368,8 +368,8 @@ media_session_controller_remote_.BindNewPipeAndPassReceiver()); media_session_controller_remote_.set_disconnect_handler( - base::BindRepeating(&MediaControllerImpl::OnMediaSessionControllerError, - base::Unretained(this))); + base::BindOnce(&MediaControllerImpl::OnMediaSessionControllerError, + base::Unretained(this))); BindMediaControllerObserver();
diff --git a/ash/policy/policy_recommendation_restorer.cc b/ash/policy/policy_recommendation_restorer.cc index 92b8bda..634a3fc 100644 --- a/ash/policy/policy_recommendation_restorer.cc +++ b/ash/policy/policy_recommendation_restorer.cc
@@ -119,10 +119,9 @@ // case of a recommended value changing, a single timer is a close // approximation of the behavior that would be obtained by resetting the timer // for the affected pref only. - restore_timer_.Start( - FROM_HERE, kRestoreDelayInMinutes, - base::BindRepeating(&PolicyRecommendationRestorer::RestoreAll, - base::Unretained(this))); + restore_timer_.Start(FROM_HERE, kRestoreDelayInMinutes, + base::BindOnce(&PolicyRecommendationRestorer::RestoreAll, + base::Unretained(this))); } void PolicyRecommendationRestorer::StopTimer() {
diff --git a/ash/power/gatt_battery_percentage_fetcher.cc b/ash/power/gatt_battery_percentage_fetcher.cc index aef900d..5a7cba94 100644 --- a/ash/power/gatt_battery_percentage_fetcher.cc +++ b/ash/power/gatt_battery_percentage_fetcher.cc
@@ -145,10 +145,10 @@ DCHECK(!connection_); // TODO(crbug/1007780): This function should take OnceCallbacks. device->CreateGattConnection( - base::BindRepeating(&GattBatteryPercentageFetcher::OnGattConnected, - weak_ptr_factory_.GetWeakPtr()), - base::BindRepeating(&GattBatteryPercentageFetcher::OnGattConnectError, - weak_ptr_factory_.GetWeakPtr())); + base::BindOnce(&GattBatteryPercentageFetcher::OnGattConnected, + weak_ptr_factory_.GetWeakPtr()), + base::BindOnce(&GattBatteryPercentageFetcher::OnGattConnectError, + weak_ptr_factory_.GetWeakPtr())); } void GattBatteryPercentageFetcher::OnGattConnected(
diff --git a/ash/public/cpp/login_screen_test_api.h b/ash/public/cpp/login_screen_test_api.h index 9865ddc..41112044 100644 --- a/ash/public/cpp/login_screen_test_api.h +++ b/ash/public/cpp/login_screen_test_api.h
@@ -26,6 +26,7 @@ static bool IsAddUserButtonShown(); static bool IsCancelButtonShown(); static bool IsParentAccessButtonShown(); + static bool IsWarningBubbleShown(); static void SubmitPassword(const AccountId& account_id, const std::string& password, bool check_if_submittable);
diff --git a/ash/public/cpp/quick_answers_controller.h b/ash/public/cpp/quick_answers_controller.h index f5dc71c9..cabd95fe 100644 --- a/ash/public/cpp/quick_answers_controller.h +++ b/ash/public/cpp/quick_answers_controller.h
@@ -42,6 +42,10 @@ // user-consent view) currently shown. virtual void DismissQuickAnswers() = 0; + // Update the bounds of the anchor view. + virtual void UpdateQuickAnswersAnchorBounds( + const gfx::Rect& anchor_bounds) = 0; + virtual chromeos::quick_answers::QuickAnswersDelegate* GetQuickAnswersDelegate() = 0; };
diff --git a/ash/public/cpp/shelf_config.h b/ash/public/cpp/shelf_config.h index 60d795cf..111e186 100644 --- a/ash/public/cpp/shelf_config.h +++ b/ash/public/cpp/shelf_config.h
@@ -59,6 +59,10 @@ // AppListControllerObserver: void OnAppListVisibilityWillChange(bool shown, int64_t display_id) override; + // Whether the shelf control buttons must be shown for accessibility + // reasons. + bool ShelfControlsForcedShownForAccessibility() const; + // Size of the shelf when visible (height when the shelf is horizontal and // width when the shelf is vertical). int shelf_size() const;
diff --git a/ash/public/cpp/wallpaper_info.h b/ash/public/cpp/wallpaper_info.h index c88ddf4..f8ae958 100644 --- a/ash/public/cpp/wallpaper_info.h +++ b/ash/public/cpp/wallpaper_info.h
@@ -7,6 +7,7 @@ #include "ash/public/cpp/wallpaper_types.h" #include "base/time/time.h" +#include "ui/gfx/image/image_skia.h" namespace ash { @@ -36,6 +37,11 @@ WallpaperLayout layout; WallpaperType type; base::Time date; + + // Not empty if type == WallpaperType::ONE_SHOT. + // This field is filled in by ShowWallpaperImage when image is already + // decoded. + gfx::ImageSkia one_shot_wallpaper; }; } // namespace ash
diff --git a/ash/quick_answers/quick_answers_controller_impl.cc b/ash/quick_answers/quick_answers_controller_impl.cc index 2cca30a..c944706 100644 --- a/ash/quick_answers/quick_answers_controller_impl.cc +++ b/ash/quick_answers/quick_answers_controller_impl.cc
@@ -22,6 +22,7 @@ constexpr char kAssistantRelatedInfoUrl[] = "chrome://os-settings/googleAssistant"; +constexpr char kDogfoodUrl[] = "https://go/quick-answers-dogfood-bugs"; // TODO:(yanxiao) move the string to grd source file. constexpr char kNoResult[] = "See result in Assistant"; @@ -130,6 +131,7 @@ void QuickAnswersControllerImpl::UpdateQuickAnswersAnchorBounds( const gfx::Rect& anchor_bounds) { + anchor_bounds_ = anchor_bounds; quick_answers_ui_controller_->UpdateQuickAnswersBounds(anchor_bounds); } @@ -156,4 +158,9 @@ quick_answers_ui_controller_->CloseUserConsentView(); } +void QuickAnswersControllerImpl::OpenQuickAnswersDogfoodLink() { + NewWindowDelegate::GetInstance()->NewTabWithUrl( + GURL(kDogfoodUrl), /*from_user_interaction=*/true); +} + } // namespace ash
diff --git a/ash/quick_answers/quick_answers_controller_impl.h b/ash/quick_answers/quick_answers_controller_impl.h index 40c3737..1e824d1 100644 --- a/ash/quick_answers/quick_answers_controller_impl.h +++ b/ash/quick_answers/quick_answers_controller_impl.h
@@ -46,6 +46,9 @@ void DismissQuickAnswers() override; + // Update the bounds of the anchor view. + void UpdateQuickAnswersAnchorBounds(const gfx::Rect& anchor_bounds) override; + chromeos::quick_answers::QuickAnswersDelegate* GetQuickAnswersDelegate() override; @@ -61,9 +64,6 @@ // User clicks on the quick answer result. void OnQuickAnswerClick(); - // Update the bounds of the anchor view. - void UpdateQuickAnswersAnchorBounds(const gfx::Rect& anchor_bounds); - // Called by the UI Controller when user grants consent for the Quick Answers // feature. void OnUserConsentGranted(); @@ -72,6 +72,9 @@ // consent for the Quick Answers feature. void OnConsentSettingsRequestedByUser(); + // Open Quick-Answers dogfood URL. + void OpenQuickAnswersDogfoodLink(); + private: void SendAssistantQuery(const std::string& query); void MaybeDismissQuickAnswersConsent();
diff --git a/ash/quick_answers/quick_answers_ui_controller.cc b/ash/quick_answers/quick_answers_ui_controller.cc index 9d89d282..2ddfd47 100644 --- a/ash/quick_answers/quick_answers_ui_controller.cc +++ b/ash/quick_answers/quick_answers_ui_controller.cc
@@ -89,10 +89,11 @@ void QuickAnswersUiController::UpdateQuickAnswersBounds( const gfx::Rect& anchor_bounds) { - if (!quick_answers_view_) - return; + if (quick_answers_view_) + quick_answers_view_->UpdateAnchorViewBounds(anchor_bounds); - quick_answers_view_->UpdateAnchorViewBounds(anchor_bounds); + if (user_consent_view_) + user_consent_view_->UpdateAnchorViewBounds(anchor_bounds); } void QuickAnswersUiController::CreateUserConsentView( @@ -118,4 +119,8 @@ controller_->OnConsentSettingsRequestedByUser(); } +void QuickAnswersUiController::OnDogfoodButtonPressed() { + controller_->OpenQuickAnswersDogfoodLink(); +} + } // namespace ash
diff --git a/ash/quick_answers/quick_answers_ui_controller.h b/ash/quick_answers/quick_answers_ui_controller.h index 6ba6dcd..e1afa41 100644 --- a/ash/quick_answers/quick_answers_ui_controller.h +++ b/ash/quick_answers/quick_answers_ui_controller.h
@@ -76,6 +76,9 @@ return user_consent_view_ != nullptr; } + // Invoked when user clicks the Dogfood button on Quick-Answers related views. + void OnDogfoodButtonPressed(); + private: QuickAnswersControllerImpl* controller_ = nullptr;
diff --git a/ash/quick_answers/ui/quick_answers_view.cc b/ash/quick_answers/ui/quick_answers_view.cc index 6fcac168..f22f3a3 100644 --- a/ash/quick_answers/ui/quick_answers_view.cc +++ b/ash/quick_answers/ui/quick_answers_view.cc
@@ -8,12 +8,22 @@ #include "ash/quick_answers/quick_answers_ui_controller.h" #include "ash/resources/vector_icons/vector_icons.h" #include "ash/shell.h" +#include "ash/strings/grit/ash_strings.h" +#include "chromeos/components/quick_answers/quick_answers_model.h" +#include "chromeos/constants/chromeos_features.h" +#include "ui/base/l10n/l10n_util.h" #include "ui/gfx/paint_vector_icon.h" #include "ui/views/background.h" +#include "ui/views/controls/button/image_button.h" +#include "ui/views/controls/button/label_button.h" #include "ui/views/controls/image_view.h" #include "ui/views/controls/label.h" +#include "ui/views/controls/menu/menu_config.h" #include "ui/views/event_monitor.h" #include "ui/views/layout/box_layout.h" +#include "ui/views/layout/fill_layout.h" +#include "ui/views/painter.h" +#include "ui/views/widget/tooltip_manager.h" #include "ui/views/widget/widget.h" namespace ash { @@ -23,16 +33,20 @@ using chromeos::quick_answers::QuickAnswerText; using chromeos::quick_answers::QuickAnswerUiElement; using chromeos::quick_answers::QuickAnswerUiElementType; +using views::Button; using views::Label; using views::View; // Spacing between this view and the anchor view. constexpr int kMarginDip = 10; -constexpr gfx::Insets kMainViewInsets(16, 0, 16, 18); +constexpr gfx::Insets kMainViewInsets(4, 0); +constexpr gfx::Insets kContentViewInsets(8, 0, 8, 26); +constexpr float kHoverStateAlpha = 0.06f; +// Assistant icon. constexpr int kAssistantIconSizeDip = 16; -constexpr gfx::Insets kAssistantIconInsets(2, 10, 0, 8); +constexpr gfx::Insets kAssistantIconInsets(10, 10, 0, 8); // Spacing between lines in the main view. constexpr int kLineSpacingDip = 4; @@ -41,10 +55,16 @@ // Spacing between labels in the horizontal elements view. constexpr int kLabelSpacingDip = 2; +// TODO(llin): Move to grd after confirming specs (b/149758492). constexpr char kDefaultLoadingStr[] = "Loading..."; constexpr char kDefaultRetryStr[] = "Retry"; constexpr char kNetworkErrorStr[] = "Cannot connect to internet."; +// Dogfood button. +constexpr int kDogfoodButtonMarginDip = 4; +constexpr int kDogfoodButtonSizeDip = 20; +constexpr SkColor kDogfoodButtonColor = gfx::kGoogleGrey500; + // Adds |text_element| as label to the container. Label* AddTextElement(const QuickAnswerText& text_element, View* container) { auto* label = @@ -84,6 +104,8 @@ } // namespace +// QuickAnswersViewHandler ---------------------------------------------------- + // This class handles mouse events, and update background color or // dismiss quick answers view. class QuickAnswersViewHandler : public ui::EventHandler { @@ -100,58 +122,74 @@ Shell::Get()->RemovePreTargetHandler(this); } + // Disallow copy and assign. QuickAnswersViewHandler(const QuickAnswersViewHandler&) = delete; QuickAnswersViewHandler& operator=(const QuickAnswersViewHandler&) = delete; // ui::EventHandler: - void OnMouseEvent(ui::MouseEvent* event) override { - gfx::Point cursor_point = - display::Screen::GetScreen()->GetCursorScreenPoint(); - gfx::Rect bounds = - quick_answers_view_->GetWidget()->GetWindowBoundsInScreen(); - switch (event->type()) { - case ui::ET_MOUSE_MOVED: { - if (quick_answers_view_->HasRetryLabel()) - return; - if (bounds.Contains(cursor_point)) { - quick_answers_view_->SetBackgroundColor(SK_ColorLTGRAY); - } else { - quick_answers_view_->SetBackgroundColor(SK_ColorWHITE); - } - break; - } - case ui::ET_MOUSE_PRESSED: { - if (event->IsOnlyLeftMouseButton() && bounds.Contains(cursor_point)) { - if (quick_answers_view_->HasRetryLabel()) { - if (quick_answers_view_->WithinRetryLabelBounds(cursor_point)) { - quick_answers_view_->OnRetryLabelPressed(); - } - event->StopPropagation(); - } else { - quick_answers_view_->SendQuickAnswersQuery(); - } - } - break; - } - default: - break; - } + void OnEvent(ui::Event* event) override { + if (!event->IsLocatedEvent()) + return; + + // Clone event and forward down the event-hierarchy. + ui::LocatedEvent* clone = + ui::Event::Clone(*event).release()->AsLocatedEvent(); + ui::Event::DispatcherApi(clone).set_target(event->target()); + DoDispatchEvent(quick_answers_view_, clone); + + // Show tooltips. + auto* tooltip_manager = + quick_answers_view_->GetWidget()->GetTooltipManager(); + if (tooltip_manager) + tooltip_manager->UpdateTooltip(); + + // Do not dismiss context menu for clicks inside the view. + auto location = clone->target()->GetScreenLocation(*clone); + if (quick_answers_view_->GetBoundsInScreen().Contains(location)) + event->StopPropagation(); } private: + bool DoDispatchEvent(views::View* view, ui::LocatedEvent* event) { + if (event->handled()) + return true; + + // Convert |event| to local coordinates of |view|. + gfx::Point location = event->target()->GetScreenLocation(*event); + views::View::ConvertPointFromScreen(view, &location); + event->set_location(location); + ui::Event::DispatcherApi(event).set_target(view); + + // Process event and dispatch on children recursively. + view->OnEvent(event); + for (auto* child : view->children()) { + if (DoDispatchEvent(child, event)) + return true; + } + return false; + } + QuickAnswersView* const quick_answers_view_; }; +// QuickAnswersView ----------------------------------------------------------- + QuickAnswersView::QuickAnswersView(const gfx::Rect& anchor_view_bounds, const std::string& title, QuickAnswersUiController* controller) - : anchor_view_bounds_(anchor_view_bounds), + : Button(this), + anchor_view_bounds_(anchor_view_bounds), controller_(controller), title_(title), quick_answers_view_handler_( std::make_unique<QuickAnswersViewHandler>(this)) { InitLayout(); InitWidget(); + + // Allow tooltips to be shown despite menu-controller owning capture. + GetWidget()->SetNativeWindowProperty( + views::TooltipManager::kGroupingPropertyKey, + reinterpret_cast<void*>(views::MenuConfig::kMenuControllerGroupingId)); } QuickAnswersView::~QuickAnswersView() { @@ -162,31 +200,45 @@ return "QuickAnswersView"; } -bool QuickAnswersView::HasRetryLabel() const { - return retry_label_; +void QuickAnswersView::StateChanged(views::Button::ButtonState old_state) { + switch (state()) { + case Button::ButtonState::STATE_NORMAL: { + main_view_->SetBackground(views::CreateSolidBackground(SK_ColorWHITE)); + break; + } + case Button::ButtonState::STATE_HOVERED: { + if (!retry_label_) + main_view_->SetBackground(views::CreateBackgroundFromPainter( + views::Painter::CreateSolidRoundRectPainter( + SkColorSetA(SK_ColorBLACK, kHoverStateAlpha * 0xFF), + /*radius=*/0, kMainViewInsets))); + break; + } + default: + break; + } } -void QuickAnswersView::OnRetryLabelPressed() { - controller_->OnRetryLabelPressed(); +void QuickAnswersView::ButtonPressed(views::Button* sender, + const ui::Event& event) { + if (sender == dogfood_button_) { + controller_->OnDogfoodButtonPressed(); + return; + } + if (sender == retry_label_) { + controller_->OnRetryLabelPressed(); + return; + } + if (sender == this) { + SendQuickAnswersQuery(); + return; + } } void QuickAnswersView::SendQuickAnswersQuery() { controller_->OnQuickAnswersViewPressed(); } -void QuickAnswersView::SetBackgroundColor(SkColor color) { - if (background_color_ == color) - return; - background_color_ = color; - SetBackground(views::CreateSolidBackground(background_color_)); -} - -bool QuickAnswersView::WithinRetryLabelBounds( - const gfx::Point& point_in_screen) const { - return retry_label_ && - retry_label_->GetBoundsInScreen().Contains(point_in_screen); -} - void QuickAnswersView::UpdateAnchorViewBounds( const gfx::Rect& anchor_view_bounds) { anchor_view_bounds_ = anchor_view_bounds; @@ -208,6 +260,7 @@ return; content_view_->RemoveAllChildViews(true); + main_view_->SetBackground(views::CreateSolidBackground(SK_ColorTRANSPARENT)); // Add title. AddTextElement({title_}, content_view_); @@ -220,45 +273,71 @@ AddHorizontalUiElements(description_labels, content_view_); // Add retry label. - retry_label_ = AddTextElement({kDefaultRetryStr, gfx::kGoogleBlue600}, - description_container); + retry_label_ = + description_container->AddChildView(std::make_unique<views::LabelButton>( + /*listener=*/this, base::UTF8ToUTF16(kDefaultRetryStr))); + retry_label_->SetEnabledTextColors(gfx::kGoogleBlue600); } void QuickAnswersView::AddAssistantIcon() { // Add Assistant icon. - auto* assistant_icon = AddChildView(std::make_unique<views::ImageView>()); + auto* assistant_icon = + main_view_->AddChildView(std::make_unique<views::ImageView>()); assistant_icon->SetBorder(views::CreateEmptyBorder(kAssistantIconInsets)); assistant_icon->SetImage(gfx::CreateVectorIcon( kAssistantIcon, kAssistantIconSizeDip, gfx::kPlaceholderColor)); } +void QuickAnswersView::AddDogfoodButton() { + auto* dogfood_view = AddChildView(std::make_unique<View>()); + auto* layout = + dogfood_view->SetLayoutManager(std::make_unique<views::BoxLayout>( + views::BoxLayout::Orientation::kVertical, + gfx::Insets(kDogfoodButtonMarginDip))); + layout->set_cross_axis_alignment(views::BoxLayout::CrossAxisAlignment::kEnd); + auto dogfood_button = std::make_unique<views::ImageButton>(/*listener=*/this); + dogfood_button->SetImage( + views::Button::ButtonState::STATE_NORMAL, + gfx::CreateVectorIcon(kDogfoodIcon, kDogfoodButtonSizeDip, + kDogfoodButtonColor)); + dogfood_button->SetTooltipText(l10n_util::GetStringUTF16( + IDS_ASH_QUICK_ANSWERS_DOGFOOD_BUTTON_TOOLTIP_TEXT)); + dogfood_button_ = dogfood_view->AddChildView(std::move(dogfood_button)); +} + void QuickAnswersView::InitLayout() { + SetLayoutManager(std::make_unique<views::FillLayout>()); SetBackground(views::CreateSolidBackground(SK_ColorWHITE)); - auto* layout = SetLayoutManager(std::make_unique<views::BoxLayout>( - views::BoxLayout::Orientation::kHorizontal, kMainViewInsets)); + main_view_ = AddChildView(std::make_unique<View>()); + auto* layout = + main_view_->SetLayoutManager(std::make_unique<views::BoxLayout>( + views::BoxLayout::Orientation::kHorizontal, kMainViewInsets)); layout->set_cross_axis_alignment( views::BoxLayout::CrossAxisAlignment::kStart); + // Add Assistant icon. AddAssistantIcon(); // Add content view. - content_view_ = AddChildView(std::make_unique<views::View>()); + content_view_ = main_view_->AddChildView(std::make_unique<View>()); content_view_->SetLayoutManager(std::make_unique<views::BoxLayout>( - views::BoxLayout::Orientation::kVertical, gfx::Insets(), + views::BoxLayout::Orientation::kVertical, kContentViewInsets, kLineSpacingDip)); - - // Add title. AddTextElement({title_}, content_view_); - - // Add loading place holder. AddTextElement({kDefaultLoadingStr, gfx::kGoogleGrey700}, content_view_); + + // Add dogfood button, if in dogfood. + if (chromeos::features::IsQuickAnswersDogfood()) + AddDogfoodButton(); } void QuickAnswersView::InitWidget() { views::Widget::InitParams params; params.activatable = views::Widget::InitParams::Activatable::ACTIVATABLE_NO; - params.type = views::Widget::InitParams::TYPE_TOOLTIP; + params.shadow_elevation = 2; + params.shadow_type = views::Widget::InitParams::ShadowType::kDrop; + params.type = views::Widget::InitParams::TYPE_POPUP; params.context = Shell::Get()->GetRootWindowForNewWindows(); params.z_order = ui::ZOrderLevel::kFloatingUIElement;
diff --git a/ash/quick_answers/ui/quick_answers_view.h b/ash/quick_answers/ui/quick_answers_view.h index 36b9728..e17fa65 100644 --- a/ash/quick_answers/ui/quick_answers_view.h +++ b/ash/quick_answers/ui/quick_answers_view.h
@@ -8,21 +8,28 @@ #include <vector> #include "ash/ash_export.h" -#include "chromeos/components/quick_answers/quick_answers_model.h" -#include "third_party/skia/include/core/SkColor.h" #include "ui/events/event_handler.h" #include "ui/views/controls/button/button.h" +namespace chromeos { +namespace quick_answers { +struct QuickAnswer; +} // namespace quick_answers +} // namespace chromeos + namespace views { -class Label; -} +class ImageButton; +class LabelButton; +} // namespace views namespace ash { + class QuickAnswersUiController; class QuickAnswersViewHandler; // A bubble style view to show QuickAnswer. -class ASH_EXPORT QuickAnswersView : public views::View { +class ASH_EXPORT QuickAnswersView : public views::Button, + public views::ButtonListener { public: QuickAnswersView(const gfx::Rect& anchor_view_bounds, const std::string& title, @@ -35,22 +42,15 @@ // views::View: const char* GetClassName() const override; - // Methods to be called by QuickAnswersViewHandler. - // Whether a retry label is visible. - bool HasRetryLabel() const; + // views::Button: + void StateChanged(views::Button::ButtonState old_state) override; - // Called when a click happens within bounds of the retry label. - void OnRetryLabelPressed(); + // views::ButtonListener: + void ButtonPressed(views::Button* sender, const ui::Event& event) override; // Called when a click happens to trigger Assistant Query. void SendQuickAnswersQuery(); - // Called during mouse move event. - void SetBackgroundColor(SkColor color); - - // Whether |point_in_screen| is in retry label's bounds. - bool WithinRetryLabelBounds(const gfx::Point& point_in_screen) const; - void UpdateAnchorViewBounds(const gfx::Rect& anchor_view_bounds); // Update the quick answers view with quick answers result. @@ -62,6 +62,7 @@ private: void InitLayout(); void InitWidget(); + void AddDogfoodButton(); void AddAssistantIcon(); void UpdateBounds(); void UpdateQuickAnswerResult( @@ -71,9 +72,10 @@ QuickAnswersUiController* const controller_; bool has_second_row_answer_ = false; std::string title_; - SkColor background_color_ = SK_ColorWHITE; + views::View* main_view_ = nullptr; views::View* content_view_ = nullptr; - views::Label* retry_label_ = nullptr; + views::LabelButton* retry_label_ = nullptr; + views::ImageButton* dogfood_button_ = nullptr; std::unique_ptr<QuickAnswersViewHandler> quick_answers_view_handler_; base::WeakPtrFactory<QuickAnswersView> weak_factory_{this}; };
diff --git a/ash/quick_answers/ui/user_consent_view.cc b/ash/quick_answers/ui/user_consent_view.cc index d32fd7fe..c57dbe0 100644 --- a/ash/quick_answers/ui/user_consent_view.cc +++ b/ash/quick_answers/ui/user_consent_view.cc
@@ -8,16 +8,20 @@ #include "ash/resources/vector_icons/vector_icons.h" #include "ash/shell.h" #include "ash/strings/grit/ash_strings.h" +#include "chromeos/constants/chromeos_features.h" #include "ui/base/l10n/l10n_util.h" #include "ui/events/event_handler.h" #include "ui/gfx/paint_vector_icon.h" #include "ui/views/background.h" #include "ui/views/border.h" +#include "ui/views/controls/button/image_button.h" #include "ui/views/controls/button/label_button.h" #include "ui/views/controls/image_view.h" #include "ui/views/controls/label.h" +#include "ui/views/controls/menu/menu_config.h" #include "ui/views/layout/box_layout.h" #include "ui/views/layout/fill_layout.h" +#include "ui/views/widget/tooltip_manager.h" #include "ui/views/widget/widget.h" namespace ash { @@ -38,11 +42,11 @@ // Title text. constexpr SkColor kTitleTextColor = gfx::kGoogleGrey900; -constexpr char kTitleTextFont[] = "Roboto, Normal 14px"; +constexpr int kTitleFontSizeDelta = 2; // Description text. constexpr SkColor kDescTextColor = gfx::kGoogleGrey700; -constexpr char kDescTextFont[] = "Roboto, Normal 13px"; +constexpr int kDescFontSizeDelta = 1; // Buttons common. constexpr int kButtonSpacingDip = 8; @@ -50,7 +54,7 @@ constexpr int kButtonBorderThicknessDip = 1; constexpr gfx::Insets kButtonBarInsets = {8, 0, 0, 0}; constexpr gfx::Insets kButtonInsets = {6, 16, 6, 16}; -constexpr char kButtonFont[] = "Roboto, Medium 13px"; +constexpr int kButtonFontSizeDelta = 1; // Manage-Settings button. constexpr SkColor kSettingsButtonBorderColor = gfx::kGoogleGrey300; @@ -60,16 +64,22 @@ constexpr SkColor kConsentButtonBgColor = gfx::kGoogleBlue600; constexpr SkColor kConsentButtonTextColor = gfx::kGoogleGrey200; +// Dogfood button. +constexpr int kDogfoodButtonMarginDip = 4; +constexpr int kDogfoodButtonSizeDip = 20; +constexpr SkColor kDogfoodButtonColor = gfx::kGoogleGrey500; + // Create and return a simple label with provided specs. std::unique_ptr<views::Label> CreateLabel(const base::string16& text, const SkColor color, - const gfx::FontList& font_list) { + int font_size_delta) { auto label = std::make_unique<views::Label>(text); label->SetAutoColorReadabilityEnabled(false); label->SetEnabledColor(color); - label->SetFontList(font_list); label->SetLineHeight(kLineHeightDip); label->SetHorizontalAlignment(gfx::HorizontalAlignment::ALIGN_LEFT); + label->SetFontList( + views::Label::GetDefaultFontList().DeriveWithSizeDelta(font_size_delta)); return label; } @@ -79,12 +89,13 @@ public: CustomizedLabelButton(views::ButtonListener* listener, const base::string16& text, - const SkColor color, - const gfx::FontList& font_list) + const SkColor color) : LabelButton(listener, text) { SetEnabledTextColors(color); - label()->SetFontList(font_list); label()->SetLineHeight(kLineHeightDip); + label()->SetFontList(views::Label::GetDefaultFontList() + .DeriveWithSizeDelta(kButtonFontSizeDelta) + .DeriveWithWeight(gfx::Font::Weight::MEDIUM)); } // Disallow copy and assign. @@ -127,6 +138,9 @@ if (view_->GetBoundsInScreen().Contains(location)) { DoDispatchEvent(view_, located_event); event->StopPropagation(); + auto* tooltip_manager = view_->GetWidget()->GetTooltipManager(); + if (tooltip_manager) + tooltip_manager->UpdateTooltip(); } } @@ -164,6 +178,11 @@ ui_controller_(ui_controller) { InitLayout(); InitWidget(); + + // Allow tooltips to be shown despite menu-controller owning capture. + GetWidget()->SetNativeWindowProperty( + views::TooltipManager::kGroupingPropertyKey, + reinterpret_cast<void*>(views::MenuConfig::kMenuControllerGroupingId)); } UserConsentView::~UserConsentView() = default; @@ -188,20 +207,33 @@ ui_controller_->OnManageSettingsButtonPressed(); return; } + if (sender == dogfood_button_) { + ui_controller_->OnDogfoodButtonPressed(); + return; + } +} + +void UserConsentView::UpdateAnchorViewBounds( + const gfx::Rect& anchor_view_bounds) { + anchor_view_bounds_ = anchor_view_bounds; + UpdateWidgetBounds(); } void UserConsentView::InitLayout() { - // Background. + SetLayoutManager(std::make_unique<views::FillLayout>()); SetBackground(views::CreateSolidBackground(kMainViewBgColor)); - // Layout. - auto* layout = SetLayoutManager(std::make_unique<views::BoxLayout>( - views::BoxLayout::Orientation::kHorizontal, kMainViewInsets)); + // Main-view Layout. + main_view_ = AddChildView(std::make_unique<views::View>()); + auto* layout = + main_view_->SetLayoutManager(std::make_unique<views::BoxLayout>( + views::BoxLayout::Orientation::kHorizontal, kMainViewInsets)); layout->set_cross_axis_alignment( views::BoxLayout::CrossAxisAlignment::kStart); // Assistant icon. - auto* assistant_icon = AddChildView(std::make_unique<views::ImageView>()); + auto* assistant_icon = + main_view_->AddChildView(std::make_unique<views::ImageView>()); assistant_icon->SetBorder(views::CreateEmptyBorder( (kLineHeightDip - kAssistantIconSizeDip) / 2, 0, 0, 0)); assistant_icon->SetImage(gfx::CreateVectorIcon( @@ -209,11 +241,15 @@ // Content. InitContent(); + + // Add dogfood icon, if in dogfood. + if (chromeos::features::IsQuickAnswersDogfood()) + AddDogfoodButton(); } void UserConsentView::InitContent() { // Layout. - content_ = AddChildView(std::make_unique<views::View>()); + content_ = main_view_->AddChildView(std::make_unique<views::View>()); content_->SetLayoutManager(std::make_unique<views::BoxLayout>( views::BoxLayout::Orientation::kVertical, kContentInsets, kContentSpacingDip)); @@ -222,13 +258,13 @@ content_->AddChildView( CreateLabel(l10n_util::GetStringUTF16( IDS_ASH_QUICK_ANSWERS_USER_CONSENT_VIEW_TITLE_TEXT), - kTitleTextColor, gfx::FontList(kTitleTextFont))); + kTitleTextColor, kTitleFontSizeDelta)); // Description. auto* desc = content_->AddChildView( CreateLabel(l10n_util::GetStringUTF16( IDS_ASH_QUICK_ANSWERS_USER_CONSENT_VIEW_DESC_TEXT), - kDescTextColor, gfx::FontList(kDescTextFont))); + kDescTextColor, kDescFontSizeDelta)); desc->SetMultiLine(true); // BoxLayout does not necessarily size the height of multi-line labels // properly (crbug/682266). The label is thus explicitly sized to the width @@ -257,7 +293,7 @@ this, l10n_util::GetStringUTF16( IDS_ASH_QUICK_ANSWERS_USER_CONSENT_VIEW_MANAGE_SETTINGS_BUTTON), - kSettingsButtonTextColor, gfx::FontList(kButtonFont)); + kSettingsButtonTextColor); settings_button->SetBorder(views::CreatePaddedBorder( views::CreateRoundedRectBorder(kButtonBorderThicknessDip, kButtonBorderRadiusDip, @@ -270,7 +306,7 @@ this, l10n_util::GetStringUTF16( IDS_ASH_QUICK_ANSWERS_USER_CONSENT_VIEW_GRANT_CONSENT_BUTTON), - kConsentButtonTextColor, gfx::FontList(kButtonFont)); + kConsentButtonTextColor); consent_button->SetBackground(views::CreateRoundedRectBackground( kConsentButtonBgColor, kButtonBorderRadiusDip)); consent_button->SetBorder(views::CreateEmptyBorder(kButtonInsets)); @@ -281,7 +317,9 @@ views::Widget::InitParams params; params.activatable = views::Widget::InitParams::Activatable::ACTIVATABLE_NO; params.context = Shell::Get()->GetRootWindowForNewWindows(); - params.type = views::Widget::InitParams::TYPE_TOOLTIP; + params.shadow_elevation = 2; + params.shadow_type = views::Widget::InitParams::ShadowType::kDrop; + params.type = views::Widget::InitParams::TYPE_POPUP; params.z_order = ui::ZOrderLevel::kFloatingUIElement; views::Widget* widget = new views::Widget(); @@ -290,6 +328,23 @@ UpdateWidgetBounds(); } +void UserConsentView::AddDogfoodButton() { + auto* dogfood_view = AddChildView(std::make_unique<views::View>()); + auto* layout = + dogfood_view->SetLayoutManager(std::make_unique<views::BoxLayout>( + views::BoxLayout::Orientation::kVertical, + gfx::Insets(kDogfoodButtonMarginDip))); + layout->set_cross_axis_alignment(views::BoxLayout::CrossAxisAlignment::kEnd); + auto dogfood_button = std::make_unique<views::ImageButton>(/*listener=*/this); + dogfood_button->SetImage( + views::Button::ButtonState::STATE_NORMAL, + gfx::CreateVectorIcon(kDogfoodIcon, kDogfoodButtonSizeDip, + kDogfoodButtonColor)); + dogfood_button->SetTooltipText(l10n_util::GetStringUTF16( + IDS_ASH_QUICK_ANSWERS_DOGFOOD_BUTTON_TOOLTIP_TEXT)); + dogfood_button_ = dogfood_view->AddChildView(std::move(dogfood_button)); +} + void UserConsentView::UpdateWidgetBounds() { const gfx::Size size = GetPreferredSize(); int x = anchor_view_bounds_.x();
diff --git a/ash/quick_answers/ui/user_consent_view.h b/ash/quick_answers/ui/user_consent_view.h index d154bd0..c55b13d 100644 --- a/ash/quick_answers/ui/user_consent_view.h +++ b/ash/quick_answers/ui/user_consent_view.h
@@ -11,6 +11,7 @@ #include "ui/views/view.h" namespace views { +class ImageButton; class LabelButton; } // namespace views @@ -40,11 +41,14 @@ // views::ButtonListener: void ButtonPressed(views::Button* sender, const ui::Event& event) override; + void UpdateAnchorViewBounds(const gfx::Rect& anchor_view_bounds); + private: void InitLayout(); void InitContent(); void InitButtonBar(); void InitWidget(); + void AddDogfoodButton(); void UpdateWidgetBounds(); // Cached bounds of the anchor this view is tied to. @@ -54,7 +58,9 @@ QuickAnswersUiController* const ui_controller_; // Owned by view hierarchy. + views::View* main_view_ = nullptr; views::View* content_ = nullptr; + views::ImageButton* dogfood_button_ = nullptr; views::LabelButton* settings_button_ = nullptr; views::LabelButton* consent_button_ = nullptr; };
diff --git a/ash/resources/vector_icons/BUILD.gn b/ash/resources/vector_icons/BUILD.gn index 04df7f8..67243b37 100644 --- a/ash/resources/vector_icons/BUILD.gn +++ b/ash/resources/vector_icons/BUILD.gn
@@ -37,6 +37,7 @@ "dictation_off_newui.icon", "dictation_on.icon", "dictation_on_newui.icon", + "dogfood.icon", "hollow_check_circle.icon", "ime_menu_emoticon.icon", "ime_menu_microphone.icon", @@ -62,6 +63,7 @@ "login_screen_menu_dropdown.icon", "login_screen_enterprise.icon", "mic.icon", + "muted_microphone.icon", "network_badge_captive_portal.icon", "network_badge_off.icon", "network_badge_roaming.icon",
diff --git a/ash/resources/vector_icons/dogfood.icon b/ash/resources/vector_icons/dogfood.icon new file mode 100644 index 0000000..41050a9 --- /dev/null +++ b/ash/resources/vector_icons/dogfood.icon
@@ -0,0 +1,50 @@ +// Copyright 2020 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +CANVAS_DIMENSIONS, 24, +MOVE_TO, 9.75f, 9.25f, +CUBIC_TO, 10.72f, 9.25f, 11.5f, 8.47f, 11.5f, 7.5f, +CUBIC_TO, 11.5f, 6.53f, 10.72f, 5.75f, 9.75f, 5.75f, +CUBIC_TO, 8.78f, 5.75f, 8, 6.53f, 8, 7.5f, +CUBIC_TO, 8, 8.47f, 8.78f, 9.25f, 9.75f, 9.25f, +CLOSE, +MOVE_TO, 6.88f, 12.25f, +CUBIC_TO, 7.85f, 12.25f, 8.63f, 11.47f, 8.63f, 10.5f, +CUBIC_TO, 8.63f, 9.53f, 7.85f, 8.75f, 6.88f, 8.75f, +CUBIC_TO, 5.91f, 8.75f, 5.13f, 9.53f, 5.13f, 10.5f, +CUBIC_TO, 5.13f, 11.47f, 5.91f, 12.25f, 6.88f, 12.25f, +CLOSE, +MOVE_TO, 15.75f, 7.5f, +CUBIC_TO, 15.75f, 8.47f, 14.97f, 9.25f, 14, 9.25f, +CUBIC_TO, 13.03f, 9.25f, 12.25f, 8.47f, 12.25f, 7.5f, +CUBIC_TO, 12.25f, 6.53f, 13.03f, 5.75f, 14, 5.75f, +CUBIC_TO, 14.97f, 5.75f, 15.75f, 6.53f, 15.75f, 7.5f, +CLOSE, +MOVE_TO, 17.12f, 12.25f, +CUBIC_TO, 18.09f, 12.25f, 18.87f, 11.47f, 18.87f, 10.5f, +CUBIC_TO, 18.87f, 9.53f, 18.09f, 8.75f, 17.12f, 8.75f, +CUBIC_TO, 16.15f, 8.75f, 15.37f, 9.53f, 15.37f, 10.5f, +CUBIC_TO, 15.37f, 11.47f, 16.15f, 12.25f, 17.12f, 12.25f, +CLOSE, +MOVE_TO, 12.63f, 10.36f, +CUBIC_TO, 13.17f, 10.54f, 13.54f, 10.9f, 13.89f, 11.3f, +CUBIC_TO, 14.07f, 11.51f, 14.24f, 11.72f, 14.42f, 11.93f, +CUBIC_TO, 14.79f, 12.38f, 15.16f, 12.83f, 15.58f, 13.25f, +CUBIC_TO, 15.67f, 13.34f, 15.76f, 13.43f, 15.85f, 13.52f, +CUBIC_TO, 16.7f, 14.38f, 17.59f, 15.27f, 17.34f, 16.54f, +CUBIC_TO, 17.18f, 17.34f, 16.65f, 17.96f, 15.81f, 18.22f, +CUBIC_TO, 15.58f, 18.29f, 15.05f, 18.22f, 14.35f, 18.13f, +CUBIC_TO, 13.62f, 18.04f, 12.72f, 17.92f, 11.81f, 17.92f, +CUBIC_TO, 10.88f, 17.92f, 10, 18.04f, 9.31f, 18.13f, +CUBIC_TO, 8.68f, 18.22f, 8.19f, 18.29f, 7.97f, 18.22f, +CUBIC_TO, 7.13f, 17.96f, 6.59f, 17.34f, 6.43f, 16.54f, +CUBIC_TO, 6.18f, 15.26f, 7.07f, 14.37f, 7.92f, 13.51f, +CUBIC_TO, 8.01f, 13.42f, 8.09f, 13.34f, 8.18f, 13.25f, +CUBIC_TO, 8.56f, 12.86f, 8.91f, 12.44f, 9.25f, 12.01f, +CUBIC_TO, 9.45f, 11.77f, 9.64f, 11.53f, 9.84f, 11.3f, +CUBIC_TO, 10.19f, 10.9f, 10.52f, 10.54f, 11.06f, 10.36f, +CUBIC_TO, 11.3f, 10.29f, 11.55f, 10.25f, 11.8f, 10.25f, +CUBIC_TO, 11.8f, 10.25f, 12.39f, 10.28f, 12.63f, 10.36f, +CLOSE +
diff --git a/ash/resources/vector_icons/muted_microphone.icon b/ash/resources/vector_icons/muted_microphone.icon new file mode 100644 index 0000000..73d29cf --- /dev/null +++ b/ash/resources/vector_icons/muted_microphone.icon
@@ -0,0 +1,36 @@ +CANVAS_DIMENSIONS, 20, +MOVE_TO, 12.57f, 4.5f, +LINE_TO, 12.56f, 9.5f, +CUBIC_TO, 12.56f, 9.96f, 12.44f, 10.38f, 12.22f, 10.75f, +LINE_TO, 11.01f, 9.53f, +CUBIC_TO, 11.01f, 9.52f, 11.01f, 9.52f, 11.01f, 9.51f, +LINE_TO, 11.05f, 4.51f, +CUBIC_TO, 11.05f, 3.95f, 10.6f, 3.5f, 10.05f, 3.5f, +CUBIC_TO, 9.5f, 3.5f, 9.05f, 3.94f, 9.05f, 4.49f, +LINE_TO, 9.02f, 7.55f, +LINE_TO, 7.43f, 5.95f, +V_LINE_TO, 4.5f, +CUBIC_TO, 7.43f, 3.12f, 8.58f, 2, 10, 2, +CUBIC_TO, 11.42f, 2, 12.57f, 3.12f, 12.57f, 4.5f, +CLOSE, +MOVE_TO, 2.24f, 3.24f, +LINE_TO, 1, 4.47f, +LINE_TO, 10.38f, 13.86f, +CUBIC_TO, 10.26f, 13.87f, 10.13f, 13.87f, 10, 13.87f, +CUBIC_TO, 7.63f, 13.87f, 5.46f, 12.11f, 5.46f, 9.58f, +H_LINE_TO, 4, +CUBIC_TO, 4, 12.46f, 6.33f, 14.83f, 9.14f, 15.24f, +V_LINE_TO, 18, +H_LINE_TO, 10.86f, +V_LINE_TO, 15.24f, +CUBIC_TO, 11.11f, 15.2f, 11.36f, 15.15f, 11.61f, 15.08f, +LINE_TO, 15.53f, 19, +LINE_TO, 16.76f, 17.76f, +LINE_TO, 2.24f, 3.24f, +CLOSE, +MOVE_TO, 13.64f, 12.16f, +LINE_TO, 14.64f, 13.16f, +CUBIC_TO, 15.48f, 12.18f, 16, 10.94f, 16, 9.58f, +H_LINE_TO, 14.54f, +CUBIC_TO, 14.54f, 10.58f, 14.2f, 11.46f, 13.64f, 12.16f, +CLOSE \ No newline at end of file
diff --git a/ash/shelf/contextual_tooltip.cc b/ash/shelf/contextual_tooltip.cc index bcc60f0..db551f04 100644 --- a/ash/shelf/contextual_tooltip.cc +++ b/ash/shelf/contextual_tooltip.cc
@@ -7,6 +7,7 @@ #include "ash/public/cpp/ash_features.h" #include "ash/public/cpp/ash_pref_names.h" #include "ash/public/cpp/ash_switches.h" +#include "ash/public/cpp/shelf_config.h" #include "ash/session/session_controller_impl.h" #include "ash/shell.h" #include "base/strings/strcat.h" @@ -103,7 +104,8 @@ *recheck_delay = delay; }; - if (!features::AreContextualNudgesEnabled()) { + if (!features::AreContextualNudgesEnabled() || + ShelfConfig::Get()->ShelfControlsForcedShownForAccessibility()) { set_recheck_delay(base::TimeDelta()); return false; }
diff --git a/ash/shelf/contextual_tooltip_unittest.cc b/ash/shelf/contextual_tooltip_unittest.cc index a6219c9..3c4b3305 100644 --- a/ash/shelf/contextual_tooltip_unittest.cc +++ b/ash/shelf/contextual_tooltip_unittest.cc
@@ -66,6 +66,32 @@ testing::Values(false)); INSTANTIATE_TEST_SUITE_P(All, ContextualTooltipTest, testing::Values(true)); +TEST_P(ContextualTooltipTest, DisableNudgesForAccessibilityTabletMode) { + GetPrefService()->SetBoolean( + prefs::kAccessibilityTabletModeShelfNavigationButtonsEnabled, true); + EXPECT_FALSE(contextual_tooltip::ShouldShowNudge( + GetPrefService(), TooltipType::kInAppToHome, nullptr)); +} + +TEST_P(ContextualTooltipTest, DisableNudgesForAccessibilitySpokenFeedback) { + GetPrefService()->SetBoolean(prefs::kAccessibilitySpokenFeedbackEnabled, + true); + EXPECT_FALSE(contextual_tooltip::ShouldShowNudge( + GetPrefService(), TooltipType::kInAppToHome, nullptr)); +} + +TEST_P(ContextualTooltipTest, DisableNudgesForAccessibilityAutoclick) { + GetPrefService()->SetBoolean(prefs::kAccessibilityAutoclickEnabled, true); + EXPECT_FALSE(contextual_tooltip::ShouldShowNudge( + GetPrefService(), TooltipType::kInAppToHome, nullptr)); +} + +TEST_P(ContextualTooltipTest, DisableNudgesForAccessibilitySwitchAccess) { + GetPrefService()->SetBoolean(prefs::kAccessibilitySwitchAccessEnabled, true); + EXPECT_FALSE(contextual_tooltip::ShouldShowNudge( + GetPrefService(), TooltipType::kInAppToHome, nullptr)); +} + // Checks that nudges are not shown when the feature flag is disabled. TEST_P(ContextualTooltipDisabledTest, FeatureFlagDisabled) { EXPECT_FALSE(contextual_tooltip::ShouldShowNudge(
diff --git a/ash/shelf/scrollable_shelf_view.cc b/ash/shelf/scrollable_shelf_view.cc index 6e9b88f..74081ed 100644 --- a/ash/shelf/scrollable_shelf_view.cc +++ b/ash/shelf/scrollable_shelf_view.cc
@@ -866,6 +866,15 @@ // Layout |shelf_container_view_|. shelf_container_view_->SetBoundsRect(shelf_container_bounds); + + // |visible_space_| is in local coordinates. It should be transformed into + // |shelf_container_view_|'s coordinates for layer clip. + gfx::RectF visible_space_in_shelf_container_coordinates(visible_space_); + views::View::ConvertRectToTarget( + this, shelf_container_view_, + &visible_space_in_shelf_container_coordinates); + shelf_container_view_->layer()->SetClipRect( + gfx::ToEnclosedRect(visible_space_in_shelf_container_coordinates)); } void ScrollableShelfView::ChildPreferredSizeChanged(views::View* child) { @@ -2221,15 +2230,7 @@ InvalidateLayout(); } - // |visible_space_| is in local coordinates. It should be transformed into - // |shelf_container_view_|'s coordinates for layer clip. visible_space_ = CalculateVisibleSpace(layout_strategy_); - gfx::RectF visible_space_in_shelf_container_coordinates(visible_space_); - views::View::ConvertRectToTarget( - this, shelf_container_view_, - &visible_space_in_shelf_container_coordinates); - shelf_container_view_->layer()->SetClipRect( - gfx::ToEnclosedRect(visible_space_in_shelf_container_coordinates)); if (scroll_status_ != kAlongMainAxisScroll) UpdateTappableIconIndices();
diff --git a/ash/shelf/shelf_app_button.cc b/ash/shelf/shelf_app_button.cc index 3503eb1..d89cd2a 100644 --- a/ash/shelf/shelf_app_button.cc +++ b/ash/shelf/shelf_app_button.cc
@@ -722,13 +722,13 @@ AddState(STATE_HOVERED); drag_timer_.Start( FROM_HERE, base::TimeDelta::FromMilliseconds(kDragTimeThresholdMs), - base::BindRepeating(&ShelfAppButton::OnTouchDragTimer, - base::Unretained(this))); + base::BindOnce(&ShelfAppButton::OnTouchDragTimer, + base::Unretained(this))); ripple_activation_timer_.Start( FROM_HERE, base::TimeDelta::FromMilliseconds(kInkDropRippleActivationTimeMs), - base::BindRepeating(&ShelfAppButton::OnRippleTimer, - base::Unretained(this))); + base::BindOnce(&ShelfAppButton::OnRippleTimer, + base::Unretained(this))); GetInkDrop()->AnimateToState(views::InkDropState::ACTION_PENDING); event->SetHandled(); }
diff --git a/ash/shelf/shelf_application_menu_model.cc b/ash/shelf/shelf_application_menu_model.cc index 91902d7a4..c06c51ef 100644 --- a/ash/shelf/shelf_application_menu_model.cc +++ b/ash/shelf/shelf_application_menu_model.cc
@@ -41,9 +41,7 @@ if (delegate_) { // Record app launch when selecting window to open from disambiguation // menu. - Shell::Get()->app_list_controller()->RecordShelfAppLaunched( - base::nullopt /* recorded_app_list_view_state */, - base::nullopt /* recorded_home_launcher_shown */); + Shell::Get()->app_list_controller()->RecordShelfAppLaunched(); // The display hosting the menu is irrelevant, windows activate in-place. delegate_->ExecuteCommand(false /*from_context_menu*/, command_id,
diff --git a/ash/shelf/shelf_config.cc b/ash/shelf/shelf_config.cc index a20adb2..2ff3680 100644 --- a/ash/shelf/shelf_config.cc +++ b/ash/shelf/shelf_config.cc
@@ -38,18 +38,6 @@ // dense shelf will be active. const int kDenseShelfScreenSizeThreshold = 600; -// Whether the the shelf control buttons must be shown for accessibility -// reasons. -bool ShelfControlsForcedShownForAccessibility() { - AccessibilityControllerImpl* accessibility_controller = - Shell::Get()->accessibility_controller(); - return accessibility_controller->spoken_feedback_enabled() || - accessibility_controller->autoclick_enabled() || - accessibility_controller->switch_access_enabled() || - accessibility_controller - ->tablet_mode_shelf_navigation_buttons_enabled(); -} - // Records the histogram value tracking the reason shelf control buttons are // shown in tablet mode. void RecordReasonForShowingShelfControls() { @@ -214,6 +202,15 @@ UpdateConfig(shown /*app_list_visible*/); } +bool ShelfConfig::ShelfControlsForcedShownForAccessibility() const { + auto* accessibility_controller = Shell::Get()->accessibility_controller(); + return accessibility_controller->spoken_feedback_enabled() || + accessibility_controller->autoclick_enabled() || + accessibility_controller->switch_access_enabled() || + accessibility_controller + ->tablet_mode_shelf_navigation_buttons_enabled(); +} + int ShelfConfig::shelf_size() const { return GetShelfSize(false /*ignore_in_app_state*/); }
diff --git a/ash/shelf/shelf_context_menu_model.cc b/ash/shelf/shelf_context_menu_model.cc index ca4d4b9..57a6280 100644 --- a/ash/shelf/shelf_context_menu_model.cc +++ b/ash/shelf/shelf_context_menu_model.cc
@@ -117,9 +117,7 @@ default: if (delegate_) { if (IsCommandIdAnAppLaunch(command_id)) { - shell->app_list_controller()->RecordShelfAppLaunched( - base::nullopt /* recorded_app_list_view_state */, - base::nullopt /* recorded_home_launcher_shown */); + shell->app_list_controller()->RecordShelfAppLaunched(); } delegate_->ExecuteCommand(true, command_id, event_flags, display_id_);
diff --git a/ash/shelf/shelf_view.cc b/ash/shelf/shelf_view.cc index db67345..9335143 100644 --- a/ash/shelf/shelf_view.cc +++ b/ash/shelf/shelf_view.cc
@@ -589,7 +589,6 @@ void ShelfView::ButtonPressed(views::Button* sender, const ui::Event& event, views::InkDrop* ink_drop) { - if (!ShouldEventActivateButton(sender, event)) { ink_drop->SnapToHidden(); return; @@ -640,14 +639,6 @@ break; } - // Record the current AppListViewState to be used later for metrics. The - // AppListViewState will change on app launch, so this will record the - // AppListViewState before the app was launched. - recorded_app_list_view_state_ = - Shell::Get()->app_list_controller()->GetAppListViewState(); - app_list_visibility_before_app_launch_ = - Shell::Get()->app_list_controller()->IsVisible(GetDisplayIdForView(this)); - // Run AfterItemSelected directly if the item has no delegate (ie. in tests). const ShelfItem& item = model_->items()[last_pressed_index_]; if (!model_->GetShelfItemDelegate(item.id)) { @@ -1547,8 +1538,7 @@ StartFadeInLastVisibleItem(); } -void ShelfView::StartFadeInLastVisibleItem() { -} +void ShelfView::StartFadeInLastVisibleItem() {} gfx::Rect ShelfView::GetMenuAnchorRect(const views::View& source, const gfx::Point& location, @@ -1914,8 +1904,7 @@ // Record AppList metric for any action considered an app launch. if (action == SHELF_ACTION_NEW_WINDOW_CREATED || action == SHELF_ACTION_WINDOW_ACTIVATED) { - Shell::Get()->app_list_controller()->RecordShelfAppLaunched( - recorded_app_list_view_state_, app_list_visibility_before_app_launch_); + Shell::Get()->app_list_controller()->RecordShelfAppLaunched(); } // The app list handles its own ink drop effect state changes.
diff --git a/ash/shelf/shelf_view.h b/ash/shelf/shelf_view.h index 2b3d17d..456657d 100644 --- a/ash/shelf/shelf_view.h +++ b/ash/shelf/shelf_view.h
@@ -611,16 +611,6 @@ // Used to call SpeedUpDragScrolling. base::OneShotTimer speed_up_drag_scrolling_; - // The AppListViewState recorded before a button press, used to record app - // launching metrics. This allows an accurate AppListViewState to be recorded - // before AppListViewState changes. - AppListViewState recorded_app_list_view_state_; - - // Whether the applist was shown before a button press, used to record app - // launching metrics. This is recorded because AppList visibility can change - // before the metric is recorded. - bool app_list_visibility_before_app_launch_ = false; - // Whether this view should focus its last focusable child (instead of its // first) when focused. bool default_last_focusable_child_ = false;
diff --git a/ash/shell/content/client/shell_browser_main_parts.cc b/ash/shell/content/client/shell_browser_main_parts.cc index 055063b..1105bf84 100644 --- a/ash/shell/content/client/shell_browser_main_parts.cc +++ b/ash/shell/content/client/shell_browser_main_parts.cc
@@ -33,8 +33,6 @@ #include "content/public/common/content_switches.h" #include "content/shell/browser/shell_browser_context.h" #include "net/base/net_module.h" -#include "ui/aura/window.h" -#include "ui/aura/window_tree_host.h" #include "ui/base/ui_base_features.h" #include "ui/chromeos/events/event_rewriter_chromeos.h" #include "ui/views/examples/examples_window_with_content.h" @@ -97,8 +95,6 @@ window_watcher_ = std::make_unique<WindowWatcher>(); - Shell::GetPrimaryRootWindow()->GetHost()->Show(); - Shell::Get()->InitWaylandServer(nullptr); if (!parameters_.ui_task) {
diff --git a/ash/system/audio/audio_detailed_view.cc b/ash/system/audio/audio_detailed_view.cc index c876f92..5ad8d3c 100644 --- a/ash/system/audio/audio_detailed_view.cc +++ b/ash/system/audio/audio_detailed_view.cc
@@ -4,8 +4,11 @@ #include "ash/system/audio/audio_detailed_view.h" +#include "ash/public/cpp/ash_features.h" #include "ash/resources/vector_icons/vector_icons.h" #include "ash/strings/grit/ash_strings.h" +#include "ash/system/audio/mic_gain_slider_controller.h" +#include "ash/system/audio/mic_gain_slider_view.h" #include "ash/system/tray/hover_highlight_view.h" #include "ash/system/tray/tray_popup_utils.h" #include "ash/system/tray/tri_view.h" @@ -84,6 +87,7 @@ void AudioDetailedView::CreateItems() { CreateScrollableList(); CreateTitleRow(IDS_ASH_STATUS_TRAY_AUDIO); + mic_gain_controller_ = std::make_unique<MicGainSliderController>(); } void AudioDetailedView::UpdateAudioDevices() { @@ -158,6 +162,9 @@ HoverHighlightView* container = AddScrollListCheckableItem(GetAudioDeviceName(device), device.active); device_map_[container] = device; + + if (features::IsSystemTrayMicGainSettingEnabled()) + AddScrollListChild(mic_gain_controller_->CreateMicGainSlider(device.id)); } scroll_content()->SizeToPreferredSize();
diff --git a/ash/system/audio/audio_detailed_view.h b/ash/system/audio/audio_detailed_view.h index e9203327..b5197f3 100644 --- a/ash/system/audio/audio_detailed_view.h +++ b/ash/system/audio/audio_detailed_view.h
@@ -16,6 +16,8 @@ } namespace ash { +class MicGainSliderController; + namespace tray { class AudioDetailedView : public TrayDetailedView { @@ -44,6 +46,7 @@ typedef std::map<views::View*, chromeos::AudioDevice> AudioDeviceMap; + std::unique_ptr<MicGainSliderController> mic_gain_controller_; chromeos::AudioDeviceList output_devices_; chromeos::AudioDeviceList input_devices_; AudioDeviceMap device_map_;
diff --git a/ash/system/audio/mic_gain_slider_controller.cc b/ash/system/audio/mic_gain_slider_controller.cc new file mode 100644 index 0000000..015cacb --- /dev/null +++ b/ash/system/audio/mic_gain_slider_controller.cc
@@ -0,0 +1,46 @@ +// Copyright 2020 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "ash/system/audio/mic_gain_slider_controller.h" + +#include "ash/shell.h" +#include "ash/system/audio/mic_gain_slider_view.h" + +using chromeos::CrasAudioHandler; + +namespace ash { + +MicGainSliderController::MicGainSliderController() = default; + +std::unique_ptr<MicGainSliderView> MicGainSliderController::CreateMicGainSlider( + uint64_t device_id) { + return std::make_unique<MicGainSliderView>(this, device_id); +} + +views::View* MicGainSliderController::CreateView() { + return nullptr; +} + +void MicGainSliderController::ButtonPressed(views::Button* sender, + const ui::Event& event) { + bool is_muted = !CrasAudioHandler::Get()->IsInputMuted(); + + // TODO(amehfooz): Add metrics and logging. + + CrasAudioHandler::Get()->SetMuteForDevice( + CrasAudioHandler::Get()->GetPrimaryActiveInputNode(), is_muted); +} + +void MicGainSliderController::SliderValueChanged( + views::Slider* sender, + float value, + float old_value, + views::SliderChangeReason reason) { + if (reason != views::SliderChangeReason::kByUser) + return; + + CrasAudioHandler::Get()->SetInputGainPercent(value * 100); +} + +} // namespace ash
diff --git a/ash/system/audio/mic_gain_slider_controller.h b/ash/system/audio/mic_gain_slider_controller.h new file mode 100644 index 0000000..8352d580 --- /dev/null +++ b/ash/system/audio/mic_gain_slider_controller.h
@@ -0,0 +1,34 @@ +// Copyright 2020 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef ASH_SYSTEM_AUDIO_MIC_GAIN_SLIDER_CONTROLLER_H_ +#define ASH_SYSTEM_AUDIO_MIC_GAIN_SLIDER_CONTROLLER_H_ + +#include "ash/system/unified/unified_slider_view.h" + +namespace ash { + +class MicGainSliderView; + +// Controller for mic gain sliders situated in audio detailed +// view in the system tray. +class MicGainSliderController : public UnifiedSliderListener { + public: + MicGainSliderController(); + + // Create a slider view for a specific input device. + std::unique_ptr<MicGainSliderView> CreateMicGainSlider(uint64_t device_id); + + // UnifiedSliderListener: + views::View* CreateView() override; + void ButtonPressed(views::Button* sender, const ui::Event& event) override; + void SliderValueChanged(views::Slider* sender, + float value, + float old_value, + views::SliderChangeReason reason) override; +}; + +} // namespace ash + +#endif // ASH_SYSTEM_AUDIO_MIC_GAIN_SLIDER_CONTROLLER_H_
diff --git a/ash/system/audio/mic_gain_slider_view.cc b/ash/system/audio/mic_gain_slider_view.cc new file mode 100644 index 0000000..23ba96a --- /dev/null +++ b/ash/system/audio/mic_gain_slider_view.cc
@@ -0,0 +1,89 @@ +// Copyright 2020 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "ash/system/audio/mic_gain_slider_view.h" + +#include "ash/resources/vector_icons/vector_icons.h" +#include "ash/strings/grit/ash_strings.h" +#include "ash/style/ash_color_provider.h" +#include "ash/style/default_color_constants.h" +#include "ash/system/audio/mic_gain_slider_controller.h" +#include "ash/system/tray/tray_constants.h" +#include "components/vector_icons/vector_icons.h" +#include "ui/base/l10n/l10n_util.h" + +using chromeos::CrasAudioHandler; + +namespace ash { + +MicGainSliderView::MicGainSliderView(MicGainSliderController* controller, + uint64_t device_id) + : UnifiedSliderView(controller, + kImeMenuMicrophoneIcon, + IDS_ASH_STATUS_TRAY_VOLUME_SLIDER_LABEL), + device_id_(device_id) { + CrasAudioHandler::Get()->AddAudioObserver(this); + + Update(false /* by_user */); +} + +MicGainSliderView::~MicGainSliderView() { + CrasAudioHandler::Get()->RemoveAudioObserver(this); +} + +void MicGainSliderView::Update(bool by_user) { + if (CrasAudioHandler::Get()->GetPrimaryActiveInputNode() != device_id_) { + SetVisible(false); + return; + } + + SetVisible(true); + bool is_muted = CrasAudioHandler::Get()->IsInputMuted(); + float level = CrasAudioHandler::Get()->GetInputGainPercent() / 100.f; + // To indicate that the volume is muted, set the volume slider to the minimal + // visual style. + slider()->SetRenderingStyle( + is_muted ? views::Slider::RenderingStyle::kMinimalStyle + : views::Slider::RenderingStyle::kDefaultStyle); + + // The button should be gray when muted and colored otherwise. + button()->SetToggled(!is_muted); + button()->SetVectorIcon(is_muted ? kMutedMicrophoneIcon + : kImeMenuMicrophoneIcon); + base::string16 state_tooltip_text = + l10n_util::GetStringUTF16(is_muted ? IDS_ASH_STATUS_TRAY_MIC_STATE_MUTED + : IDS_ASH_STATUS_TRAY_MIC_STATE_ON); + button()->SetTooltipText(l10n_util::GetStringFUTF16( + IDS_ASH_STATUS_TRAY_MIC_GAIN, state_tooltip_text)); + + // Slider's value is in finer granularity than audio volume level(0.01), + // there will be a small discrepancy between slider's value and volume level + // on audio side. To avoid the jittering in slider UI, use the slider's + // current value. + if (std::abs(level - slider()->GetValue()) < + kAudioSliderIgnoreUpdateThreshold) { + level = slider()->GetValue(); + } + // Note: even if the value does not change, we still need to call this + // function to enable accessibility events (crbug.com/1013251). + SetSliderValue(level, by_user); +} + +void MicGainSliderView::OnInputNodeGainChanged(uint64_t node_id, int gain) { + Update(false /* by_user */); +} + +void MicGainSliderView::OnInputMuteChanged(bool mute_on) { + Update(false /* by_user */); +} + +void MicGainSliderView::OnActiveInputNodeChanged() { + Update(false /* by_user */); +} + +const char* MicGainSliderView::GetClassName() const { + return "MicGainSliderView"; +} + +} // namespace ash
diff --git a/ash/system/audio/mic_gain_slider_view.h b/ash/system/audio/mic_gain_slider_view.h new file mode 100644 index 0000000..147f0bb5 --- /dev/null +++ b/ash/system/audio/mic_gain_slider_view.h
@@ -0,0 +1,40 @@ +// Copyright 2020 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef ASH_SYSTEM_AUDIO_MIC_GAIN_SLIDER_VIEW_H_ +#define ASH_SYSTEM_AUDIO_MIC_GAIN_SLIDER_VIEW_H_ + +#include "ash/system/unified/unified_slider_view.h" +#include "chromeos/audio/cras_audio_handler.h" + +namespace ash { + +class MicGainSliderController; + +class MicGainSliderView : public UnifiedSliderView, + public chromeos::CrasAudioHandler::AudioObserver { + public: + MicGainSliderView(MicGainSliderController* controller, uint64_t device_id); + ~MicGainSliderView() override; + + uint64_t device_id() const { return device_id_; } + + // CrasAudioHandler::AudioObserver: + void OnInputNodeGainChanged(uint64_t node_id, int gain) override; + void OnInputMuteChanged(bool mute_on) override; + void OnActiveInputNodeChanged() override; + + // views::View: + const char* GetClassName() const override; + + private: + void Update(bool by_user); + + // device id for the input device tied to this slider. + const uint64_t device_id_; +}; + +} // namespace ash + +#endif // ASH_SYSTEM_AUDIO_MIC_GAIN_SLIDER_VIEW_H_
diff --git a/ash/system/audio/unified_volume_view.cc b/ash/system/audio/unified_volume_view.cc index e143b58b..e8748f1 100644 --- a/ash/system/audio/unified_volume_view.cc +++ b/ash/system/audio/unified_volume_view.cc
@@ -33,9 +33,6 @@ namespace { -// Threshold to ignore update on the slider value. -const float kSliderIgnoreUpdateThreshold = 0.01; - // References to the icons that correspond to different volume levels. const gfx::VectorIcon* const kVolumeLevelIcons[] = { &kUnifiedMenuVolumeLowIcon, // Low volume. @@ -183,9 +180,10 @@ // there will be a small discrepancy between slider's value and volume level // on audio side. To avoid the jittering in slider UI, use the slider's // current value. - if (std::abs(level - slider()->GetValue()) < kSliderIgnoreUpdateThreshold) + if (std::abs(level - slider()->GetValue()) < + kAudioSliderIgnoreUpdateThreshold) { level = slider()->GetValue(); - + } // Note: even if the value does not change, we still need to call this // function to enable accessibility events (crbug.com/1013251). SetSliderValue(level, by_user);
diff --git a/ash/system/network/auto_connect_notifier_unittest.cc b/ash/system/network/auto_connect_notifier_unittest.cc index 736efd5..ccd005e 100644 --- a/ash/system/network/auto_connect_notifier_unittest.cc +++ b/ash/system/network/auto_connect_notifier_unittest.cc
@@ -80,7 +80,7 @@ void SuccessfullyJoinWifiNetwork() { chromeos::ShillServiceClient::Get()->Connect( - dbus::ObjectPath(kTestServicePath), base::BindRepeating([]() {}), + dbus::ObjectPath(kTestServicePath), base::BindOnce([]() {}), chromeos::ShillServiceClient::ErrorCallback()); base::RunLoop().RunUntilIdle(); }
diff --git a/ash/system/network/tray_network_state_model.cc b/ash/system/network/tray_network_state_model.cc index 28b3fd1..66d97d97 100644 --- a/ash/system/network/tray_network_state_model.cc +++ b/ash/system/network/tray_network_state_model.cc
@@ -254,10 +254,9 @@ void TrayNetworkStateModel::NotifyNetworkListChanged() { if (timer_.IsRunning()) return; - timer_.Start( - FROM_HERE, base::TimeDelta::FromMilliseconds(update_frequency_), - base::BindRepeating(&TrayNetworkStateModel::SendNetworkListChanged, - base::Unretained(this))); + timer_.Start(FROM_HERE, base::TimeDelta::FromMilliseconds(update_frequency_), + base::BindOnce(&TrayNetworkStateModel::SendNetworkListChanged, + base::Unretained(this))); } void TrayNetworkStateModel::NotifyVpnProvidersChanged() {
diff --git a/ash/system/tray/tray_constants.h b/ash/system/tray/tray_constants.h index 58d1d4d3..dd8cc60 100644 --- a/ash/system/tray/tray_constants.h +++ b/ash/system/tray/tray_constants.h
@@ -94,10 +94,13 @@ constexpr float kUnifiedMenuBackgroundBlur = 30.f; +// Threshold to ignore update on the slider value. +constexpr float kAudioSliderIgnoreUpdateThreshold = 0.01; + constexpr gfx::Insets kUnifiedMenuItemPadding(0, 16, 16, 16); constexpr gfx::Insets kUnifiedSystemInfoViewPadding(0, 16, 16, 16); constexpr gfx::Insets kUnifiedManagedDeviceViewPadding(4, 19, 4, 16); -constexpr gfx::Insets kUnifiedSliderRowPadding(0, 12, 8, 16); +constexpr gfx::Insets kUnifiedSliderRowPadding(0, 16, 8, 16); constexpr gfx::Insets kUnifiedSliderBubblePadding(12, 0, 4, 0); constexpr gfx::Insets kUnifiedSliderPadding(0, 16); @@ -105,7 +108,7 @@ constexpr int kStackedNotificationBarHeight = 32; constexpr int kStackedNotificationBarCollapsedHeight = 40; constexpr int kNotificationIconStackThreshold = 28; -constexpr int kUnifiedSliderViewSpacing = 12; +constexpr int kUnifiedSliderViewSpacing = 16; constexpr int kUnifiedMenuPadding = 8; constexpr int kUnifiedMessageCenterBubbleSpacing = 8; constexpr int kUnifiedNotificationCenterSpacing = 16;
diff --git a/ash/system/tray/tray_detailed_view.cc b/ash/system/tray/tray_detailed_view.cc index 1ed4ee4..911b03e 100644 --- a/ash/system/tray/tray_detailed_view.cc +++ b/ash/system/tray/tray_detailed_view.cc
@@ -318,6 +318,10 @@ box_layout_->SetFlexForView(scroller_, 1); } +void TrayDetailedView::AddScrollListChild(std::unique_ptr<views::View> child) { + scroll_content_->AddChildView(std::move(child)); +} + HoverHighlightView* TrayDetailedView::AddScrollListItem( const gfx::VectorIcon& icon, const base::string16& text) {
diff --git a/ash/system/tray/tray_detailed_view.h b/ash/system/tray/tray_detailed_view.h index 265f132..7c2014b 100644 --- a/ash/system/tray/tray_detailed_view.h +++ b/ash/system/tray/tray_detailed_view.h
@@ -70,6 +70,9 @@ HoverHighlightView* AddScrollListItem(const gfx::VectorIcon& icon, const base::string16& text); + // Add a child view to the scroll list. + void AddScrollListChild(std::unique_ptr<views::View> child); + // Adds a targetable row to |scroll_content_| containing |icon|, |text|, and a // checkbox. |checked| determines whether the checkbox is checked or not. // |enterprise_managed| determines whether or not there will be an enterprise
diff --git a/ash/test/ash_test_base.cc b/ash/test/ash_test_base.cc index ffc9b33..5171853 100644 --- a/ash/test/ash_test_base.cc +++ b/ash/test/ash_test_base.cc
@@ -24,7 +24,6 @@ #include "ash/session/session_controller_impl.h" #include "ash/shelf/shelf.h" #include "ash/shell.h" -#include "ash/shell/toplevel_window.h" #include "ash/system/status_area_widget.h" #include "ash/test/ash_test_helper.h" #include "ash/test_screenshot_delegate.h" @@ -57,11 +56,11 @@ #include "ui/display/types/display_constants.h" #include "ui/events/devices/device_data_manager_test_api.h" #include "ui/events/devices/touchscreen_device.h" -#include "ui/events/gesture_detection/gesture_configuration.h" #include "ui/gfx/geometry/point.h" #include "ui/gfx/geometry/rect.h" #include "ui/views/view.h" #include "ui/views/widget/widget.h" +#include "ui/views/widget/widget_delegate.h" #include "ui/wm/core/coordinate_conversion.h" using session_manager::SessionState; @@ -142,32 +141,12 @@ setup_called_ = true; - // Clears the saved state so that test doesn't use on the wrong - // default state. - shell::ToplevelWindow::ClearSavedStateForTest(); - AshTestHelper::InitParams params; params.start_session = start_session_; params.delegate = std::move(delegate); params.local_state = local_state(); ash_test_helper_ = std::make_unique<AshTestHelper>(); ash_test_helper_->SetUp(std::move(params)); - - Shell::GetPrimaryRootWindow()->Show(); - Shell::GetPrimaryRootWindow()->GetHost()->Show(); - // Move the mouse cursor to far away so that native events doesn't - // interfere test expectations. - Shell::GetPrimaryRootWindow()->MoveCursorTo(gfx::Point(-1000, -1000)); - Shell::Get()->cursor_manager()->EnableMouseEvents(); - - // Changing GestureConfiguration shouldn't make tests fail. These values - // prevent unexpected events from being generated during tests. Such as - // delayed events which create race conditions on slower tests. - ui::GestureConfiguration* gesture_config = - ui::GestureConfiguration::GetInstance(); - gesture_config->set_max_touch_down_duration_for_click_in_ms(800); - gesture_config->set_long_press_time_in_ms(1000); - gesture_config->set_max_touch_move_in_pixels_for_click(5); } void AshTestBase::TearDown() {
diff --git a/ash/test/ash_test_helper.cc b/ash/test/ash_test_helper.cc index 27a951d..00be9456 100644 --- a/ash/test/ash_test_helper.cc +++ b/ash/test/ash_test_helper.cc
@@ -19,6 +19,7 @@ #include "ash/public/cpp/test/test_new_window_delegate.h" #include "ash/session/test_session_controller_client.h" #include "ash/shell.h" +#include "ash/shell/toplevel_window.h" #include "ash/shell_init_params.h" #include "ash/system/model/system_tray_model.h" #include "ash/system/screen_layout_observer.h" @@ -27,7 +28,6 @@ #include "ash/wallpaper/wallpaper_controller_impl.h" #include "ash/wm/overview/overview_controller.h" #include "ash/wm/tablet_mode/tablet_mode_controller.h" -#include "base/bind_helpers.h" #include "base/run_loop.h" #include "base/system/sys_info.h" #include "chromeos/audio/cras_audio_handler.h" @@ -37,10 +37,13 @@ #include "device/bluetooth/dbus/bluez_dbus_manager.h" #include "ui/aura/test/test_windows.h" #include "ui/aura/window.h" +#include "ui/aura/window_tree_host.h" #include "ui/display/display.h" #include "ui/display/display_switches.h" #include "ui/display/manager/display_manager.h" #include "ui/display/test/display_manager_test_api.h" +#include "ui/events/gesture_detection/gesture_configuration.h" +#include "ui/gfx/geometry/point.h" #include "ui/platform_window/common/platform_window_defaults.h" #include "ui/views/test/views_test_helper_aura.h" #include "ui/wm/core/capture_controller.h" @@ -50,7 +53,7 @@ namespace ash { namespace { -std::unique_ptr<views::TestViewsDelegate> MakeDelegate() { +std::unique_ptr<views::TestViewsDelegate> MakeTestViewsDelegate() { return std::make_unique<AshTestViewsDelegate>(); } } // namespace @@ -84,7 +87,7 @@ : AuraTestHelper(context_factory, config_type == kUnitTest), config_type_(config_type) { views::ViewsTestHelperAura::SetFallbackTestViewsDelegateFactory( - base::BindOnce(&MakeDelegate)); + &MakeTestViewsDelegate); // TODO(jamescook): Can we do this without changing command line? // Use the origin (1,1) so that it doesn't overlap with the native mouse @@ -111,6 +114,10 @@ // Reset the global state for the cursor manager. This includes the // last cursor visibility state, etc. wm::CursorManager::ResetCursorVisibilityStateForTest(); + + // Clears the saved state so that test doesn't use on the wrong + // default state. + shell::ToplevelWindow::ClearSavedStateForTest(); } AshTestHelper::~AshTestHelper() { @@ -125,8 +132,7 @@ // This should never have a meaningful effect, since either there is no // ViewsTestHelperAura instance or the instance is currently in its // destructor. - views::ViewsTestHelperAura::SetFallbackTestViewsDelegateFactory( - base::NullCallback()); + views::ViewsTestHelperAura::SetFallbackTestViewsDelegateFactory(nullptr); } void AshTestHelper::SetUp() { @@ -217,7 +223,7 @@ if (!NewWindowDelegate::GetInstance()) new_window_delegate_ = std::make_unique<TestNewWindowDelegate>(); if (!views::ViewsDelegate::GetInstance()) - test_views_delegate_ = MakeDelegate(); + test_views_delegate_ = MakeTestViewsDelegate(); ShellInitParams shell_init_params; shell_init_params.delegate = std::move(init_params.delegate); @@ -247,6 +253,9 @@ // Requires the AppListController the Shell creates. app_list_test_helper_ = std::make_unique<AppListTestHelper>(); + Shell::GetPrimaryRootWindow()->Show(); + Shell::GetPrimaryRootWindow()->GetHost()->Show(); + if (config_type_ == kShell) { shell->wallpaper_controller()->ShowDefaultWallpaperForTesting(); return; @@ -280,6 +289,20 @@ // Tests expect empty wallpaper. shell->wallpaper_controller()->CreateEmptyWallpaperForTesting(); + + // Move the mouse cursor to far away so that native events don't interfere + // with test expectations. + Shell::GetPrimaryRootWindow()->MoveCursorTo(gfx::Point(-1000, -1000)); + Shell::Get()->cursor_manager()->EnableMouseEvents(); + + // Changing GestureConfiguration shouldn't make tests fail. These values + // prevent unexpected events from being generated during tests. Such as + // delayed events which create race conditions on slower tests. + ui::GestureConfiguration* gesture_config = + ui::GestureConfiguration::GetInstance(); + gesture_config->set_max_touch_down_duration_for_click_in_ms(800); + gesture_config->set_long_press_time_in_ms(1000); + gesture_config->set_max_touch_move_in_pixels_for_click(5); } display::Display AshTestHelper::GetSecondaryDisplay() const {
diff --git a/ash/wallpaper/wallpaper_controller_impl.cc b/ash/wallpaper/wallpaper_controller_impl.cc index 68f6249b..d530c63 100644 --- a/ash/wallpaper/wallpaper_controller_impl.cc +++ b/ash/wallpaper/wallpaper_controller_impl.cc
@@ -646,6 +646,9 @@ if (image.width() == 1 && image.height() == 1) info.layout = WALLPAPER_LAYOUT_STRETCH; + if (info.type == WallpaperType::ONE_SHOT) + info.one_shot_wallpaper = image.DeepCopy(); + VLOG(1) << "SetWallpaper: image_id=" << WallpaperResizer::GetImageId(image) << " layout=" << info.layout; @@ -1223,6 +1226,8 @@ is_always_on_top_wallpaper_ = false; reload_always_on_top_wallpaper_callback_.Reset(); ReparentWallpaper(GetWallpaperContainerId(locked_)); + // Forget current wallpaper data. + current_wallpaper_.reset(); ReloadWallpaper(/*clear_cache=*/false); } @@ -1347,8 +1352,8 @@ GetInternalDisplayCompositorLock(); timer_.Start( FROM_HERE, wallpaper_reload_delay_, - base::BindRepeating(&WallpaperControllerImpl::ReloadWallpaper, - weak_factory_.GetWeakPtr(), /*clear_cache=*/false)); + base::BindOnce(&WallpaperControllerImpl::ReloadWallpaper, + weak_factory_.GetWeakPtr(), /*clear_cache=*/false)); } } @@ -1442,6 +1447,10 @@ UpdateWallpaperForAllRootWindows(/*lock_state_changed=*/false); } +void WallpaperControllerImpl::ReloadWallpaperForTesting(bool clear_cache) { + ReloadWallpaper(clear_cache); +} + void WallpaperControllerImpl::UpdateWallpaperForRootWindow( aura::Window* root_window, bool lock_state_changed) { @@ -1887,6 +1896,11 @@ } void WallpaperControllerImpl::ReloadWallpaper(bool clear_cache) { + const bool was_one_shot_wallpaper = IsOneShotWallpaper(); + const gfx::ImageSkia one_shot_wallpaper = + was_one_shot_wallpaper + ? current_wallpaper_->wallpaper_info().one_shot_wallpaper + : gfx::ImageSkia(); current_wallpaper_.reset(); if (clear_cache) wallpaper_cache_map_.clear(); @@ -1897,6 +1911,8 @@ reload_preview_wallpaper_callback_.Run(); else if (current_user_.is_valid()) ShowUserWallpaper(current_user_); + else if (was_one_shot_wallpaper) + ShowOneShotWallpaper(one_shot_wallpaper); else ShowSigninWallpaper(); } @@ -2034,9 +2050,8 @@ void WallpaperControllerImpl::SetDevicePolicyWallpaper() { DCHECK(ShouldSetDevicePolicyWallpaper()); ReadAndDecodeWallpaper( - base::BindRepeating( - &WallpaperControllerImpl::OnDevicePolicyWallpaperDecoded, - weak_factory_.GetWeakPtr()), + base::BindOnce(&WallpaperControllerImpl::OnDevicePolicyWallpaperDecoded, + weak_factory_.GetWeakPtr()), sequenced_task_runner_.get(), device_policy_wallpaper_path_); }
diff --git a/ash/wallpaper/wallpaper_controller_impl.h b/ash/wallpaper/wallpaper_controller_impl.h index c69093e..5ad4995c 100644 --- a/ash/wallpaper/wallpaper_controller_impl.h +++ b/ash/wallpaper/wallpaper_controller_impl.h
@@ -308,6 +308,9 @@ wallpaper_reload_delay_ = base::TimeDelta::FromMilliseconds(0); } + // Proxy to private ReloadWallpaper(). + void ReloadWallpaperForTesting(bool clear_cache); + private: FRIEND_TEST_ALL_PREFIXES(WallpaperControllerTest, BasicReparenting); FRIEND_TEST_ALL_PREFIXES(WallpaperControllerTest,
diff --git a/ash/wallpaper/wallpaper_controller_unittest.cc b/ash/wallpaper/wallpaper_controller_unittest.cc index fcbbe16..2c7150f35 100644 --- a/ash/wallpaper/wallpaper_controller_unittest.cc +++ b/ash/wallpaper/wallpaper_controller_unittest.cc
@@ -2489,6 +2489,16 @@ EXPECT_FALSE(controller_->IsBlurAllowedForLockState()); EXPECT_FALSE(controller_->ShouldApplyDimming()); + // Verify that we can reload wallpaer without losing it. + // This is important for screen rotation. + controller_->ReloadWallpaperForTesting(/*clear_cache=*/false); + RunAllTasksUntilIdle(); + EXPECT_EQ(2, GetWallpaperCount()); // Reload increments count. + EXPECT_EQ(kOneShotWallpaperColor, GetWallpaperColor()); + EXPECT_EQ(WallpaperType::ONE_SHOT, controller_->GetWallpaperType()); + EXPECT_FALSE(controller_->IsBlurAllowedForLockState()); + EXPECT_FALSE(controller_->ShouldApplyDimming()); + // Verify the user wallpaper info is unaffected, and the one-shot wallpaper // can be replaced by the user wallpaper. EXPECT_TRUE(controller_->GetUserWallpaperInfo(account_id_1, &wallpaper_info));
diff --git a/ash/wm/gestures/back_gesture/back_gesture_affordance.cc b/ash/wm/gestures/back_gesture/back_gesture_affordance.cc index 54cd0cb..f730e25 100644 --- a/ash/wm/gestures/back_gesture/back_gesture_affordance.cc +++ b/ash/wm/gestures/back_gesture/back_gesture_affordance.cc
@@ -41,10 +41,13 @@ constexpr int kBackgroundRadius = 20; const SkColor kBackgroundColorBeforeActivated = SK_ColorWHITE; const SkColor kBackgroundColorAfterActivated = gfx::kGoogleBlue600; -// Y offset of the background shadow. -const int kBgShadowOffsetY = 2; -const int kBgShadowBlurRadius = 8; -const SkColor kBgShadowColor = SkColorSetA(SK_ColorBLACK, 0x4D); +// The background shadow for the circle. +constexpr int kBackNudgeShadowOffsetY1 = 1; +constexpr int kBackNudgeShadowBlurRadius1 = 2; +constexpr SkColor kBackNudgeShadowColor1 = SkColorSetA(SK_ColorBLACK, 0x4D); +constexpr int kBackNudgeShadowOffsetY2 = 2; +constexpr int kBackNudgeShadowBlurRadius2 = 6; +constexpr SkColor kBackNudgeShadowColor2 = SkColorSetA(SK_ColorBLACK, 0x26); // Radius of the ripple while x-axis movement of the affordance achieves // |kDistanceForFullRadius|. @@ -149,10 +152,14 @@ cc::PaintFlags bg_flags; bg_flags.setAntiAlias(true); bg_flags.setStyle(cc::PaintFlags::kFill_Style); - gfx::ShadowValues shadow; - shadow.emplace_back(gfx::Vector2d(0, kBgShadowOffsetY), kBgShadowBlurRadius, - kBgShadowColor); - bg_flags.setLooper(gfx::CreateShadowDrawLooper(shadow)); + gfx::ShadowValues shadows; + shadows.push_back( + gfx::ShadowValue(gfx::Vector2d(0, kBackNudgeShadowOffsetY1), + kBackNudgeShadowBlurRadius1, kBackNudgeShadowColor1)); + shadows.push_back( + gfx::ShadowValue(gfx::Vector2d(0, kBackNudgeShadowOffsetY2), + kBackNudgeShadowBlurRadius2, kBackNudgeShadowColor2)); + bg_flags.setLooper(gfx::CreateShadowDrawLooper(shadows)); bg_flags.setColor(is_activated ? kBackgroundColorAfterActivated : kBackgroundColorBeforeActivated); canvas->DrawCircle(center_point, kBackgroundRadius, bg_flags);
diff --git a/ash/wm/gestures/back_gesture/back_gesture_contextual_nudge.cc b/ash/wm/gestures/back_gesture/back_gesture_contextual_nudge.cc index b9ec737..aaf9c65 100644 --- a/ash/wm/gestures/back_gesture/back_gesture_contextual_nudge.cc +++ b/ash/wm/gestures/back_gesture/back_gesture_contextual_nudge.cc
@@ -26,11 +26,6 @@ // Width of the contextual nudge. constexpr int kBackgroundWidth = 320; -// Colors of the contextual nudge background gradient. -constexpr SkColor kBackgroundStartColor = - SkColorSetA(SK_ColorBLACK, 153); // 60% -constexpr SkColor kBackgroundEndColor = SkColorSetARGB(0, 168, 168, 168); - // Radius of the circle in the middle of the contextual nudge. constexpr int kCircleRadius = 20; @@ -46,13 +41,25 @@ // Color of the label. constexpr SkColor kLabelColor = gfx::kGoogleGrey200; -// Shadow color and blur for the label. -constexpr SkColor kLabelShadowColor = SkColorSetARGB(0x66, 0x00, 0x00, 0x00); -constexpr int kLabelShadowBlur = 1; +// Color of the label background. +constexpr SkColor kLabelBackgroundColor = SkColorSetA(SK_ColorBLACK, 0xDE); -// Width and height of the label. -constexpr int kLabelWidth = 70; -constexpr int kLabelHeight = 80; +// Line height of the label. +constexpr int kLabelLineHeight = 18; + +// Corner radius for the label's background. +constexpr int kLabelCornerRadius = 16; + +// Top and bottom inset of the label. +constexpr int kLabelTopBottomInset = 6; + +// Shadow values for the back nudge circle. +constexpr int kBackNudgeShadowOffsetY1 = 1; +constexpr int kBackNudgeShadowBlurRadius1 = 2; +constexpr SkColor kBackNudgeShadowColor1 = SkColorSetA(SK_ColorBLACK, 0x4D); +constexpr int kBackNudgeShadowOffsetY2 = 2; +constexpr int kBackNudgeShadowBlurRadius2 = 6; +constexpr SkColor kBackNudgeShadowColor2 = SkColorSetA(SK_ColorBLACK, 0x26); // Duration of the pause before sliding in to show the nudge. constexpr base::TimeDelta kPauseBeforeShowAnimationDuration = @@ -71,11 +78,6 @@ constexpr base::TimeDelta kSuggestionDismissDuration = base::TimeDelta::FromMilliseconds(100); -// Duration for the animation to fade out the gradient layer when the back nudge -// showing animation is interrupted and should be dismissed. -constexpr base::TimeDelta kDarkGradientDismissDuration = - base::TimeDelta::FromMilliseconds(200); - // Duration for the animation of the suggestion part of the nudge. constexpr base::TimeDelta kSuggestionBounceAnimationDuration = base::TimeDelta::FromMilliseconds(600); @@ -119,9 +121,7 @@ SetPaintToLayer(); layer()->SetFillsBoundsOpaquely(false); - gradient_view_ = AddChildView(std::make_unique<GradientView>(this)); suggestion_view_ = AddChildView(std::make_unique<SuggestionView>(this)); - show_timer_.Start( FROM_HERE, kPauseBeforeShowAnimationDuration, this, &ContextualNudgeView::ScheduleOffScreenToStartPositionAnimation); @@ -152,7 +152,6 @@ suggestion_view_->layer()->GetAnimator()->AbortAllAnimations(); animation_stage_ = AnimationStage::kFadingOut; - gradient_view_->FadeOutForDismiss(); suggestion_view_->FadeOutForDismiss(); } } @@ -176,22 +175,19 @@ public ui::ImplicitAnimationObserver { public: explicit SuggestionView(ContextualNudgeView* nudge_view) - : label_(new views::Label), nudge_view_(nudge_view) { + : nudge_view_(nudge_view) { SetPaintToLayer(); layer()->SetFillsBoundsOpaquely(false); + label_ = AddChildView(std::make_unique<views::Label>()); label_->SetBackgroundColor(SK_ColorTRANSPARENT); label_->SetEnabledColor(kLabelColor); label_->SetText( l10n_util::GetStringUTF16(IDS_ASH_BACK_GESTURE_CONTEXTUAL_NUDGE)); - label_->SetMultiLine(true); label_->SetHorizontalAlignment(gfx::HorizontalAlignment::ALIGN_LEFT); + label_->SetLineHeight(kLabelLineHeight); label_->SetFontList( gfx::FontList().DeriveWithWeight(gfx::Font::Weight::MEDIUM)); - label_->SetShadows(gfx::ShadowValues( - 1, gfx::ShadowValue(gfx::Vector2d(), kLabelShadowBlur, - kLabelShadowColor))); - AddChildView(label_); } SuggestionView(const SuggestionView&) = delete; SuggestionView& operator=(const SuggestionView&) = delete; @@ -225,6 +221,7 @@ animation.SetTweenType(gfx::Tween::LINEAR); animation.SetPreemptionStrategy( ui::LayerAnimator::IMMEDIATELY_ANIMATE_TO_NEW_TARGET); + animation.AddObserver(nudge_view_); layer()->SetOpacity(0.f); } @@ -233,23 +230,41 @@ void Layout() override { const gfx::Rect bounds = GetLocalBounds(); gfx::Rect label_rect(bounds); - label_rect.ClampToCenteredSize(gfx::Size(kLabelWidth, kLabelHeight)); + label_rect.ClampToCenteredSize(label_->GetPreferredSize()); label_rect.set_x(bounds.left_center().x() + 2 * kCircleRadius + - kPaddingBetweenCircleAndLabel); + kPaddingBetweenCircleAndLabel + kLabelCornerRadius); label_->SetBoundsRect(label_rect); } // views::View: void OnPaint(gfx::Canvas* canvas) override { // Draw the circle. - cc::PaintFlags flags; - flags.setAntiAlias(true); - flags.setStyle(cc::PaintFlags::kFill_Style); - flags.setColor(kCircleColor); + cc::PaintFlags circle_flags; + circle_flags.setAntiAlias(true); + circle_flags.setStyle(cc::PaintFlags::kFill_Style); + circle_flags.setColor(kCircleColor); + gfx::ShadowValues shadows; + shadows.push_back(gfx::ShadowValue( + gfx::Vector2d(0, kBackNudgeShadowOffsetY1), + kBackNudgeShadowBlurRadius1, kBackNudgeShadowColor1)); + shadows.push_back(gfx::ShadowValue( + gfx::Vector2d(0, kBackNudgeShadowOffsetY2), + kBackNudgeShadowBlurRadius2, kBackNudgeShadowColor2)); + circle_flags.setLooper(gfx::CreateShadowDrawLooper(shadows)); const gfx::Point left_center = GetLocalBounds().left_center(); canvas->DrawCircle( gfx::Point(left_center.x() + kCircleRadius, left_center.y()), - kCircleRadius, flags); + kCircleRadius, circle_flags); + + // Draw the black round rectangle around the text. + cc::PaintFlags round_rect_flags; + round_rect_flags.setStyle(cc::PaintFlags::kFill_Style); + round_rect_flags.setAntiAlias(true); + round_rect_flags.setColor(kLabelBackgroundColor); + gfx::Rect label_bounds(label_->bounds()); + label_bounds.Inset(/*horizontal=*/-kLabelCornerRadius, + /*vertical=*/-kLabelTopBottomInset); + canvas->DrawRoundRect(label_bounds, kLabelCornerRadius, round_rect_flags); } // ui::ImplicitAnimationObserver: @@ -271,48 +286,6 @@ ContextualNudgeView* nudge_view_ = nullptr; // Not owned. }; - // Used to show the gradient layer of the back gesture contextual nudge. - class GradientView : public views::View { - public: - explicit GradientView(ContextualNudgeView* nudge_view) - : nudge_view_(nudge_view) { - SetPaintToLayer(); - layer()->SetFillsBoundsOpaquely(false); - } - GradientView(const GradientView&) = delete; - GradientView& operator=(const GradientView&) = delete; - ~GradientView() override = default; - - // This is called when the nudge animation is cancelled. The gradient - // view will fade out. - void FadeOutForDismiss() { - ui::ScopedLayerAnimationSettings animation(layer()->GetAnimator()); - animation.SetTransitionDuration(kDarkGradientDismissDuration); - animation.SetTweenType(gfx::Tween::LINEAR); - animation.SetPreemptionStrategy( - ui::LayerAnimator::IMMEDIATELY_ANIMATE_TO_NEW_TARGET); - animation.AddObserver(nudge_view_); - layer()->SetOpacity(0.f); - } - - // views::View: - void OnPaint(gfx::Canvas* canvas) override { - views::View::OnPaint(canvas); - - // Draw the gradient background. - cc::PaintFlags flags; - flags.setAntiAlias(true); - flags.setStyle(cc::PaintFlags::kFill_Style); - flags.setShader(gfx::CreateGradientShader( - gfx::Point(), gfx::Point(width(), 0), kBackgroundStartColor, - kBackgroundEndColor)); - canvas->DrawRect(gfx::Rect(size()), flags); - } - - private: - ContextualNudgeView* nudge_view_ = nullptr; // Not owned - }; - // Showing contextual nudge from off screen to its start position. void ScheduleOffScreenToStartPositionAnimation() { animation_stage_ = AnimationStage::kSlidingIn; @@ -340,8 +313,6 @@ // views::View: void Layout() override { gfx::Rect rect = GetLocalBounds(); - gradient_view_->SetBoundsRect(rect); - rect.ClampToCenteredSize(gfx::Size(kBackgroundWidth, kBackgroundWidth)); rect.set_x(-kCircleRadius); suggestion_view_->SetBoundsRect(rect); @@ -365,9 +336,6 @@ } } - // Owned by views hierarchy. - GradientView* gradient_view_ = nullptr; - // Created by ContextualNudgeView. Owned by views hierarchy. SuggestionView* suggestion_view_ = nullptr;
diff --git a/base/BUILD.gn b/base/BUILD.gn index cb07891..cf364b49 100644 --- a/base/BUILD.gn +++ b/base/BUILD.gn
@@ -3600,6 +3600,7 @@ "android/junit/src/org/chromium/base/AnimationFrameTimeHistogramTest.java", "android/junit/src/org/chromium/base/ApplicationStatusTest.java", "android/junit/src/org/chromium/base/DiscardableReferencePoolTest.java", + "android/junit/src/org/chromium/base/FileUtilsTest.java", "android/junit/src/org/chromium/base/LifetimeAssertTest.java", "android/junit/src/org/chromium/base/LogTest.java", "android/junit/src/org/chromium/base/NonThreadSafeTest.java",
diff --git a/base/android/java/src/org/chromium/base/FileUtils.java b/base/android/java/src/org/chromium/base/FileUtils.java index 3bb8d9a..0527e52 100644 --- a/base/android/java/src/org/chromium/base/FileUtils.java +++ b/base/android/java/src/org/chromium/base/FileUtils.java
@@ -37,6 +37,8 @@ * @param canDelete the {@link Function} function used to check if the file can be deleted. * @return True if the files are deleted, or files reserved by |canDelete|, false if failed to * delete files. + * @note Caveat: Return values from recursive deletes are ignored. + * @note Caveat: |canDelete| is not robust; see https://crbug.com/1066733. */ public static boolean recursivelyDeleteFile( File currentFile, Function<String, Boolean> canDelete) {
diff --git a/base/android/junit/src/org/chromium/base/FileUtilsTest.java b/base/android/junit/src/org/chromium/base/FileUtilsTest.java new file mode 100644 index 0000000..85a30af --- /dev/null +++ b/base/android/junit/src/org/chromium/base/FileUtilsTest.java
@@ -0,0 +1,217 @@ +// Copyright 2020 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +package org.chromium.base; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; + +import org.junit.Ignore; +import org.junit.Rule; +import org.junit.Test; +import org.junit.rules.TemporaryFolder; +import org.junit.runner.RunWith; +import org.robolectric.annotation.Config; + +import org.chromium.base.test.BaseRobolectricTestRunner; + +import java.io.File; +import java.io.IOException; +import java.nio.file.FileVisitResult; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.SimpleFileVisitor; +import java.nio.file.attribute.BasicFileAttributes; +import java.util.ArrayList; +import java.util.Collections; + +/** Unit tests for {@link Log}. */ +@RunWith(BaseRobolectricTestRunner.class) +@Config(manifest = Config.NONE) +public class FileUtilsTest { + @Rule + public final TemporaryFolder temporaryFolder = new TemporaryFolder(); + + /** + * Recursively lists all paths under a directory as relative paths, rendered as a string. + * + * @param rootDir The directory {@link Path}. + * @return A "; "-deliminated string of relative paths of all files stirctly under |rootDir|, + * lexicographically by path segments. Directories have "/" as suffix. + */ + private String listAllPaths(Path rootDir) { + ArrayList<String> pathList = new ArrayList<String>(); + try { + Files.walkFileTree(rootDir, new SimpleFileVisitor<Path>() { + @Override + public FileVisitResult preVisitDirectory(Path path, BasicFileAttributes attrs) + throws IOException { + String relPathString = rootDir.relativize(path).toString(); + if (!relPathString.isEmpty()) { // Exclude |rootDir|. + pathList.add(relPathString + "/"); + } + return FileVisitResult.CONTINUE; + } + @Override + public FileVisitResult visitFile(Path path, BasicFileAttributes attrs) + throws IOException { + pathList.add(rootDir.relativize(path).toString()); + return FileVisitResult.CONTINUE; + } + }); + } catch (IOException e) { + } + + // Sort paths lexicographically by path segments. For example, "foo.bar/file" and "foo/sub" + // are treated as ["foo.bar", "file"] and ["foo", "sub"], then compared lexicographically + // element-by-element. Since "foo.bar" < "foo" (String comparison), so the order is + // "foo/sub" < "foo.bar/file". Instead of actually splitting the strings into lists, we + // simply replace '/' with |kSep| as ASCII character 1 for sorting... + final char kSep = (char) 1; + for (int i = 0; i < pathList.size(); ++i) { + pathList.set(i, pathList.get(i).replace('/', kSep)); + } + Collections.sort(pathList); + // Then restore '/'. + for (int i = 0; i < pathList.size(); ++i) { + pathList.set(i, pathList.get(i).replace(kSep, '/')); + } + return String.join("; ", pathList); + } + + /** + * Helper to check the current list of temp files and directories matches expectation. + * + * @param expectedFileList A string representation of the expected list of temp files and + * directories. See listAllPaths() for format. + */ + private void assertFileList(String expectedFileList) { + Path rootDir = temporaryFolder.getRoot().toPath(); + assertEquals(expectedFileList, listAllPaths(rootDir)); + } + + /** + * Helper to get the {@link File} object of a temp file created for testing. + * + * @param relPathname The relative name of the temp file or directory. + */ + private File getFile(String relPathName) { + Path rootDir = temporaryFolder.getRoot().toPath(); + return rootDir.resolve(relPathName).toFile(); + } + + /** + * Helper to create a mix of test files and directories. Can be called multiple times per test, + * but requires the temp file to be empty. + */ + private void prepareMixedFilesTestCase() throws IOException { + assertFileList(""); + temporaryFolder.newFolder("a1"); + temporaryFolder.newFolder("a1", "b1"); + temporaryFolder.newFile("a1/b1/c"); + temporaryFolder.newFile("a1/b1/c2"); + temporaryFolder.newFolder("a1", "b2"); + temporaryFolder.newFolder("a1", "b2", "c"); + temporaryFolder.newFile("a1/b3"); + temporaryFolder.newFolder("a2"); + temporaryFolder.newFile("c"); + } + + @Test + public void testRecursivelyDeleteFileBasic() throws IOException { + // Test file deletion. + temporaryFolder.newFile("some_File"); + temporaryFolder.newFile("some"); + temporaryFolder.newFile(".dot-config1"); + temporaryFolder.newFile("some_File.txt"); + assertFileList(".dot-config1; some; some_File; some_File.txt"); + assertTrue(FileUtils.recursivelyDeleteFile(getFile("some_File"), null)); + assertFileList(".dot-config1; some; some_File.txt"); + assertTrue(FileUtils.recursivelyDeleteFile(getFile("some"), null)); + assertFileList(".dot-config1; some_File.txt"); + assertTrue(FileUtils.recursivelyDeleteFile(getFile("ok_to_delete_nonexistent"), null)); + assertFileList(".dot-config1; some_File.txt"); + assertTrue(FileUtils.recursivelyDeleteFile(getFile(".dot-config1"), null)); + assertFileList("some_File.txt"); + assertTrue(FileUtils.recursivelyDeleteFile(getFile("some_File.txt"), null)); + assertFileList(""); + + // Test directory deletion. + temporaryFolder.newFolder("some_Dir"); + temporaryFolder.newFolder("some"); + temporaryFolder.newFolder(".dot-dir2"); + temporaryFolder.newFolder("some_Dir.ext"); + assertFileList(".dot-dir2/; some/; some_Dir/; some_Dir.ext/"); + assertTrue(FileUtils.recursivelyDeleteFile(getFile("some_Dir"), null)); + assertFileList(".dot-dir2/; some/; some_Dir.ext/"); + assertTrue(FileUtils.recursivelyDeleteFile(getFile("some"), null)); + assertFileList(".dot-dir2/; some_Dir.ext/"); + assertTrue(FileUtils.recursivelyDeleteFile(getFile("ok/to/delete/nonexistent"), null)); + assertFileList(".dot-dir2/; some_Dir.ext/"); + assertTrue(FileUtils.recursivelyDeleteFile(getFile(".dot-dir2"), null)); + assertFileList("some_Dir.ext/"); + assertTrue(FileUtils.recursivelyDeleteFile(getFile("some_Dir.ext"), null)); + assertFileList(""); + + // Test recursive deletion of mixed files and directories. + for (int i = 0; i < 2; ++i) { + Function<String, Boolean> canDelete = (i == 0) ? null : FileUtils.DELETE_ALL; + prepareMixedFilesTestCase(); + assertFileList("a1/; a1/b1/; a1/b1/c; a1/b1/c2; a1/b2/; a1/b2/c/; a1/b3; a2/; c"); + assertTrue(FileUtils.recursivelyDeleteFile(getFile("c"), canDelete)); + assertFileList("a1/; a1/b1/; a1/b1/c; a1/b1/c2; a1/b2/; a1/b2/c/; a1/b3; a2/"); + assertTrue(FileUtils.recursivelyDeleteFile(getFile("a1/b1"), canDelete)); + assertFileList("a1/; a1/b2/; a1/b2/c/; a1/b3; a2/"); + assertTrue(FileUtils.recursivelyDeleteFile(getFile("a1"), canDelete)); + assertFileList("a2/"); + assertTrue(FileUtils.recursivelyDeleteFile(getFile("a2"), canDelete)); + assertFileList(""); + } + } + + // Enable or delete once https://crbug.com/1066733 is fixed. + @Ignore + @Test + public void testRecursivelyDeleteFileWithCanDelete() throws IOException { + Function<String, Boolean> canDeleteIfEndsWith1 = (String filepath) -> { + return filepath.endsWith("1"); + }; + Function<String, Boolean> canDeleteIfEndsWith2 = (String filepath) -> { + return filepath.endsWith("2"); + }; + + prepareMixedFilesTestCase(); + assertFileList("a1/; a1/b1/; a1/b1/c; a1/b1/c2; a1/b2/; a1/b2/c/; a1/b3; a2/; c"); + assertTrue(FileUtils.recursivelyDeleteFile(getFile("a1"), canDeleteIfEndsWith1)); + assertFileList("a2/; c"); + assertTrue(FileUtils.recursivelyDeleteFile(getFile("a2"), canDeleteIfEndsWith1)); + assertFileList("a2/; c"); + assertTrue(FileUtils.recursivelyDeleteFile(getFile("a2"), canDeleteIfEndsWith2)); + assertFileList("c"); + assertTrue(FileUtils.recursivelyDeleteFile(getFile("a1"), null)); + assertFileList(""); + + prepareMixedFilesTestCase(); + assertFileList("a1/; a1/b1/; a1/b1/c; a1/b1/c2; a1/b2/; a1/b2/c/; a1/b3; a2/; c"); + assertTrue(FileUtils.recursivelyDeleteFile(getFile("a1"), canDeleteIfEndsWith2)); + assertFileList("a1/; a1/b1/; a1/b1/c; a1/b1/c2; a1/b3; a2/; c"); + assertTrue(FileUtils.recursivelyDeleteFile(getFile("c"), canDeleteIfEndsWith2)); + assertFileList("a1/; a1/b1/; a1/b1/c; a1/b1/c2; a1/b3; a2/; c"); + assertTrue(FileUtils.recursivelyDeleteFile(getFile("c"), null)); + assertFileList("a1/; a1/b1/; a1/b1/c; a1/b1/c2; a1/b3; a2/"); + assertTrue(FileUtils.recursivelyDeleteFile(getFile("a2"), canDeleteIfEndsWith2)); + assertFileList("a1/; a1/b1/; a1/b1/c; a1/b1/c2; a1/b3"); + assertTrue(FileUtils.recursivelyDeleteFile(getFile("a1"), null)); + assertFileList(""); + } + + // TOOD(huangs): Implement testBatchDeleteFiles(). + // TOOD(huangs): Implement testExtractAsset(). + // TOOD(huangs): Implement testCopyStream(). + // TOOD(huangs): Implement testCopyStreamToFile(). + // TOOD(huangs): Implement testReadStream(). + // TOOD(huangs): Implement testGetUriForFile(). + // TOOD(huangs): Implement testGetExtension(). + // TOOD(huangs): Implement testQueryBitmapFromContentProvider(). +}
diff --git a/base/containers/unique_ptr_adapters_unittest.cc b/base/containers/unique_ptr_adapters_unittest.cc index 5b8f1fc02..8a107f32 100644 --- a/base/containers/unique_ptr_adapters_unittest.cc +++ b/base/containers/unique_ptr_adapters_unittest.cc
@@ -4,6 +4,7 @@ #include "base/containers/unique_ptr_adapters.h" +#include <algorithm> #include <memory> #include <vector>
diff --git a/base/files/important_file_writer.cc b/base/files/important_file_writer.cc index c27d5ef..33a3927 100644 --- a/base/files/important_file_writer.cc +++ b/base/files/important_file_writer.cc
@@ -114,6 +114,15 @@ bool ImportantFileWriter::WriteFileAtomically(const FilePath& path, StringPiece data, StringPiece histogram_suffix) { +#if defined(OS_WIN) && DCHECK_IS_ON() + // In https://crbug.com/920174, we have cases where CreateTemporaryFileInDir + // hits a DCHECK because creation fails with no indication why. Pull the path + // onto the stack so that we can see if it is malformed in some odd way. + wchar_t path_copy[MAX_PATH]; + base::wcslcpy(path_copy, path.value().c_str(), base::size(path_copy)); + base::debug::Alias(path_copy); +#endif // defined(OS_WIN) && DCHECK_IS_ON() + #if defined(OS_CHROMEOS) // On Chrome OS, chrome gets killed when it cannot finish shutdown quickly, // and this function seems to be one of the slowest shutdown steps. @@ -134,9 +143,10 @@ // is securely created. FilePath tmp_file_path; if (!CreateTemporaryFileInDir(path.DirName(), &tmp_file_path)) { - UmaHistogramExactLinearWithSuffix( - "ImportantFile.FileCreateError", histogram_suffix, - -base::File::GetLastFileError(), -base::File::FILE_ERROR_MAX); + const auto last_file_error = base::File::GetLastFileError(); + UmaHistogramExactLinearWithSuffix("ImportantFile.FileCreateError", + histogram_suffix, -last_file_error, + -base::File::FILE_ERROR_MAX); LogFailure(path, histogram_suffix, FAILED_CREATING, "could not create temporary file"); return false;
diff --git a/base/i18n/icu_util.cc b/base/i18n/icu_util.cc index 425a0b2..82022d5 100644 --- a/base/i18n/icu_util.cc +++ b/base/i18n/icu_util.cc
@@ -350,32 +350,134 @@ } const char kICUDataFile[] = "ICU.DataFile"; +const char kICUCreateInstance[] = "ICU.CreateInstance"; -// Callback function to report the opening of ICU Data File to UMA. -// This help us to understand what built-in ICU data files are rarely used -// in the user's machines. -static void U_CALLCONV TraceICUDataFile(const void* context, - int32_t fn_number, - int32_t level, - const char* fmt, - va_list args) { - if (fn_number == UTRACE_UDATA_DATA_FILE) { - std::string icu_data_file_name(va_arg(args, const char*)); - va_end(args); - // Skip icu version specified prefix if exist. - // path is prefixed with icu version prefix such as "icudt65l-". - // Histogram only the part after the -. - if (icu_data_file_name.find("icudt") == 0) { - size_t dash = icu_data_file_name.find("-"); - if (dash != std::string::npos) { - icu_data_file_name = icu_data_file_name.substr(dash + 1); +enum class ICUCreateInstance { + kCharacterBreakIterator = 0, + kWordBreakIterator = 1, + kLineBreakIterator = 2, + kLineBreakIteratorTypeLoose = 3, + kLineBreakIteratorTypeNormal = 4, + kLineBreakIteratorTypeStrict = 5, + kSentenceBreakIterator = 6, + kTitleBreakIterator = 7, + kThaiBreakEngine = 8, + kLaoBreakEngine = 9, + kBurmeseBreakEngine = 10, + kKhmerBreakEngine = 11, + kChineseJapaneseBreakEngine = 12, + + kMaxValue = kChineseJapaneseBreakEngine +}; + +// Callback functions to report the opening of ICU Data File, and creation of +// key objects to UMA. This help us to understand what built-in ICU data files +// are rarely used in the user's machines and the distribution of ICU usage. +static void U_CALLCONV TraceICUEntry(const void*, int32_t fn_number) { + switch (fn_number) { + case UTRACE_UBRK_CREATE_CHARACTER: + base::UmaHistogramEnumeration(kICUCreateInstance, + ICUCreateInstance::kCharacterBreakIterator); + break; + case UTRACE_UBRK_CREATE_SENTENCE: + base::UmaHistogramEnumeration(kICUCreateInstance, + ICUCreateInstance::kSentenceBreakIterator); + break; + case UTRACE_UBRK_CREATE_TITLE: + base::UmaHistogramEnumeration(kICUCreateInstance, + ICUCreateInstance::kTitleBreakIterator); + break; + case UTRACE_UBRK_CREATE_WORD: + base::UmaHistogramEnumeration(kICUCreateInstance, + ICUCreateInstance::kWordBreakIterator); + break; + default: + return; + } +} + +static void U_CALLCONV TraceICUData(const void* context, + int32_t fn_number, + int32_t level, + const char* fmt, + va_list args) { + switch (fn_number) { + case UTRACE_UDATA_DATA_FILE: { + std::string icu_data_file_name(va_arg(args, const char*)); + va_end(args); + // Skip icu version specified prefix if exist. + // path is prefixed with icu version prefix such as "icudt65l-". + // Histogram only the part after the -. + if (icu_data_file_name.find("icudt") == 0) { + size_t dash = icu_data_file_name.find("-"); + if (dash != std::string::npos) { + icu_data_file_name = icu_data_file_name.substr(dash + 1); + } } + // UmaHistogramSparse should track less than 100 values. + // We currently have about total 55 built-in data files inside ICU + // so it fit the UmaHistogramSparse usage. + int hash = base::HashMetricName(icu_data_file_name); + base::UmaHistogramSparse(kICUDataFile, hash); + return; } - // UmaHistogramSparse should track less than 100 values. - // We currently have about total 55 built-in data files inside ICU - // so it fit the UmaHistogramSparse usage. - int hash = base::HashMetricName(icu_data_file_name); - base::UmaHistogramSparse(kICUDataFile, hash); + case UTRACE_UBRK_CREATE_LINE: { + const char* lb_type = va_arg(args, const char*); + va_end(args); + ICUCreateInstance value; + switch (lb_type[0]) { + case '\0': + value = ICUCreateInstance::kLineBreakIterator; + break; + case 'l': + DCHECK(strcmp(lb_type, "loose") == 0); + value = ICUCreateInstance::kLineBreakIteratorTypeLoose; + break; + case 'n': + DCHECK(strcmp(lb_type, "normal") == 0); + value = ICUCreateInstance::kLineBreakIteratorTypeNormal; + break; + case 's': + DCHECK(strcmp(lb_type, "strict") == 0); + value = ICUCreateInstance::kLineBreakIteratorTypeStrict; + break; + default: + return; + } + base::UmaHistogramEnumeration(kICUCreateInstance, value); + return; + } + case UTRACE_UBRK_CREATE_BREAK_ENGINE: { + const char* script = va_arg(args, const char*); + va_end(args); + ICUCreateInstance value; + switch (script[0]) { + case 'H': + DCHECK(strcmp(script, "Hani") == 0); + value = ICUCreateInstance::kChineseJapaneseBreakEngine; + break; + case 'K': + DCHECK(strcmp(script, "Khmr") == 0); + value = ICUCreateInstance::kKhmerBreakEngine; + break; + case 'L': + DCHECK(strcmp(script, "Laoo") == 0); + value = ICUCreateInstance::kLaoBreakEngine; + break; + case 'M': + DCHECK(strcmp(script, "Mymr") == 0); + value = ICUCreateInstance::kBurmeseBreakEngine; + break; + case 'T': + DCHECK(strcmp(script, "Thai") == 0); + value = ICUCreateInstance::kThaiBreakEngine; + break; + default: + return; + } + base::UmaHistogramEnumeration(kICUCreateInstance, value); + return; + } } } @@ -389,7 +491,7 @@ InitializeIcuTimeZone(); const void* context = nullptr; - utrace_setFunctions(context, nullptr, nullptr, TraceICUDataFile); + utrace_setFunctions(context, TraceICUEntry, nullptr, TraceICUData); utrace_setLevel(UTRACE_VERBOSE); return true; }
diff --git a/base/threading/thread_restrictions.h b/base/threading/thread_restrictions.h index 110a007..5c1ee35 100644 --- a/base/threading/thread_restrictions.h +++ b/base/threading/thread_restrictions.h
@@ -225,6 +225,7 @@ } namespace weblayer { class BrowserContextImpl; +class BrowserProcess; class ProfileImpl; class WebLayerPathProvider; } @@ -375,6 +376,7 @@ friend class resource_coordinator::TabManagerDelegate; // crbug.com/778703 friend class web::WebSubThread; friend class weblayer::BrowserContextImpl; + friend class weblayer::BrowserProcess; friend class weblayer::ProfileImpl; friend class weblayer::WebLayerPathProvider;
diff --git a/base/win/registry_unittest.cc b/base/win/registry_unittest.cc index e992421..dbb45636 100644 --- a/base/win/registry_unittest.cc +++ b/base/win/registry_unittest.cc
@@ -371,7 +371,7 @@ key.Create(HKEY_CURRENT_USER, foo_key.c_str(), KEY_READ)); ASSERT_TRUE(key.StartWatching( - BindRepeating(&TestChangeDelegate::OnKeyChanged, Unretained(&delegate)))); + BindOnce(&TestChangeDelegate::OnKeyChanged, Unretained(&delegate)))); EXPECT_FALSE(delegate.WasCalled()); // Make some change. @@ -389,7 +389,7 @@ EXPECT_FALSE(delegate.WasCalled()); ASSERT_TRUE(key.StartWatching( - BindRepeating(&TestChangeDelegate::OnKeyChanged, Unretained(&delegate)))); + BindOnce(&TestChangeDelegate::OnKeyChanged, Unretained(&delegate)))); // Change something else. EXPECT_EQ(ERROR_SUCCESS, key2.WriteValue(L"name2", L"data2")); @@ -397,7 +397,7 @@ ASSERT_TRUE(delegate.WasCalled()); ASSERT_TRUE(key.StartWatching( - BindRepeating(&TestChangeDelegate::OnKeyChanged, Unretained(&delegate)))); + BindOnce(&TestChangeDelegate::OnKeyChanged, Unretained(&delegate)))); RunLoop().RunUntilIdle(); EXPECT_FALSE(delegate.WasCalled()); }
diff --git a/build/android/gyp/compile_resources.py b/build/android/gyp/compile_resources.py index c18180d..6ed38475 100755 --- a/build/android/gyp/compile_resources.py +++ b/build/android/gyp/compile_resources.py
@@ -32,6 +32,7 @@ from util import build_utils from util import diff_utils from util import manifest_utils +from util import md5_check from util import resource_utils # `Resources_pb2` module imports `descriptor`, which imports `six`. @@ -1099,11 +1100,7 @@ shutil.move(temp, final) -def main(args): - build_utils.InitLogging('RESOURCE_DEBUG') - args = build_utils.ExpandFileArgs(args) - options = _ParseArgs(args) - +def _OnStaleMd5(options): path = options.arsc_path or options.proto_path debug_temp_resources_dir = os.environ.get('TEMP_RESOURCES_DIR') if debug_temp_resources_dir: @@ -1180,12 +1177,82 @@ logging.debug('Copying outputs') _WriteOutputs(options, build) - if options.depfile: - build_utils.WriteDepfile( - options.depfile, - options.srcjar_out, - inputs=options.dependencies_res_zips + options.extra_r_text_files, - add_pydeps=False) + +def main(args): + build_utils.InitLogging('RESOURCE_DEBUG') + args = build_utils.ExpandFileArgs(args) + options = _ParseArgs(args) + + depfile_deps = ( + options.dependencies_res_zips + options.extra_main_r_text_files + + options.extra_r_text_files + options.include_resources) + + possible_input_paths = depfile_deps + [ + options.aapt2_path, + options.android_manifest, + options.android_manifest_expected, + options.resources_config_path, + options.shared_resources_allowlist, + options.use_resource_ids_path, + options.webp_binary, + ] + input_paths = [p for p in possible_input_paths if p] + input_strings = [ + options.android_manifest_expectations_failure_file, + options.app_as_shared_lib, + options.arsc_package_name, + options.debuggable, + options.extra_res_packages, + options.include_resources, + options.locale_allowlist, + options.manifest_package, + options.max_sdk_version, + options.min_sdk_version, + options.no_xml_namespaces, + options.package_id, + options.package_name, + options.png_to_webp, + options.rename_manifest_package, + options.resource_exclusion_exceptions, + options.resource_exclusion_regex, + options.r_java_root_package_name, + options.shared_resources, + options.shared_resources_allowlist_locales, + options.short_resource_paths, + options.strip_resource_names, + options.support_zh_hk, + options.target_sdk_version, + options.version_code, + options.version_name, + options.webp_cache_dir, + ] + output_paths = [options.srcjar_out] + possible_output_paths = [ + options.android_manifest_normalized, + options.arsc_path, + options.emit_ids_out, + options.info_path, + options.optimized_arsc_path, + options.optimized_proto_path, + options.proguard_file, + options.proguard_file_main_dex, + options.proto_path, + options.resources_path_map_out_path, + options.r_text_out, + ] + output_paths += [p for p in possible_output_paths if p] + + # Since we overspecify deps, this target depends on java deps that are not + # going to change its output. This target is also slow (6-12 seconds) and + # blocking the critical path. We want changes to java_library targets to not + # trigger re-compilation of resources, thus we need to use md5_check. + md5_check.CallAndWriteDepfileIfStale( + lambda: _OnStaleMd5(options), + options, + input_paths=input_paths, + input_strings=input_strings, + output_paths=output_paths, + depfile_deps=depfile_deps) if __name__ == '__main__':
diff --git a/build/android/gyp/compile_resources.pydeps b/build/android/gyp/compile_resources.pydeps index 60f6edb..53282f7 100644 --- a/build/android/gyp/compile_resources.pydeps +++ b/build/android/gyp/compile_resources.pydeps
@@ -54,4 +54,5 @@ util/build_utils.py util/diff_utils.py util/manifest_utils.py +util/md5_check.py util/resource_utils.py
diff --git a/build/config/android/internal_rules.gni b/build/config/android/internal_rules.gni index af17c801..69c6907e 100644 --- a/build/config/android/internal_rules.gni +++ b/build/config/android/internal_rules.gni
@@ -2414,12 +2414,12 @@ rebase_path(_normalized_output, root_build_dir), ] if (check_android_configuration) { - _manfiest_expectations_failure_filepath = + _manifest_expectations_failure_filepath = "$android_configuration_failure_dir/" + "${invoker.failed_manifest_expectation_file}" args += [ "--android-manifest-expectations-failure-file", - rebase_path(_manfiest_expectations_failure_filepath, + rebase_path(_manifest_expectations_failure_filepath, root_build_dir), ] } @@ -2912,7 +2912,7 @@ _target_label = get_label_info(_dep, "label_no_toolchain") if (filter_exclude([ _target_label ], _java_lib_patterns) == [] && filter_exclude([ _target_label ], _java_lib_exceptions) != []) { - # This is a java dep, so replace it with its header. + # This is a java dep, so replace it. deps += [ "${_target_label}__header" ] } else { deps += [ _dep ] @@ -2922,6 +2922,25 @@ } } + template("java_impl_group") { + forward_variables_from(invoker, [ "testonly" ]) + group(target_name) { + if (defined(invoker.deps)) { + deps = [] + foreach(_dep, invoker.deps) { + _target_label = get_label_info(_dep, "label_no_toolchain") + if (filter_exclude([ _target_label ], _java_lib_patterns) == [] && + filter_exclude([ _target_label ], _java_lib_exceptions) != []) { + # This is a java dep, so replace it. + deps += [ "${_target_label}__impl" ] + } else { + deps += [ _dep ] + } + } + } + } + } + # Create an interface jar from a normal jar. # # Variables @@ -3193,6 +3212,7 @@ _public_deps = [] _accumulated_deps = [] _java_header_deps = [] + _java_impl_deps = [] _java_full_deps = [] if (defined(invoker.deps)) { foreach(_dep, invoker.deps) { @@ -3201,6 +3221,7 @@ filter_exclude([ _target_label ], _java_lib_exceptions) != []) { # This is a java dep, so replace it with its header. _java_header_deps += [ "${_target_label}__header" ] + _java_impl_deps += [ "${_target_label}__impl" ] _java_full_deps += [ _dep ] } else { # Not a java header dep, so no need to replace it with its header. @@ -3220,6 +3241,8 @@ [ "//build/android/buildhooks:build_hooks_android_java" ] _java_header_deps += [ "//build/android/buildhooks:build_hooks_android_java__header" ] + _java_impl_deps += + [ "//build/android/buildhooks:build_hooks_android_java__impl" ] } if (_supports_android && @@ -3228,6 +3251,8 @@ _java_full_deps += [ "//third_party/bazel/desugar:desugar_runtime_java" ] _java_header_deps += [ "//third_party/bazel/desugar:desugar_runtime_java__header" ] + _java_impl_deps += + [ "//third_party/bazel/desugar:desugar_runtime_java__impl" ] } # Don't enable coverage or lint unless the target has some non-generated @@ -3256,8 +3281,9 @@ !invoker.jacoco_never_instrument && _jacoco_instrument } if (_jacoco_instrument) { - _java_header_deps += [ "//third_party/jacoco:jacocoagent_java__header" ] _java_full_deps += [ "//third_party/jacoco:jacocoagent_java" ] + _java_header_deps += [ "//third_party/jacoco:jacocoagent_java__header" ] + _java_impl_deps += [ "//third_party/jacoco:jacocoagent_java__impl" ] } } @@ -3386,8 +3412,10 @@ # Don't need to depend on the apk-under-test to be packaged. if (defined(invoker.apk_under_test)) { - _java_full_deps += [ "${invoker.apk_under_test}__java" ] + # No need to add to _java_full_deps since that is only used for + # write_build_config. _java_header_deps += [ "${invoker.apk_under_test}__java__header" ] + _java_impl_deps += [ "${invoker.apk_under_test}__java__impl" ] } if (defined(invoker.android_manifest_dep)) { _accumulated_deps += [ invoker.android_manifest_dep ] @@ -3542,6 +3570,9 @@ if (defined(_final_jar_path)) { if (_is_system_library) { + # These deps are only needed for the process_java_prebuilt template. + not_needed([ "_java_impl_deps" ]) + _copy_system_library_target_name = "${target_name}__copy_system_library" # Use copy_ex rather than copy to ensure that we copy symlink targets @@ -3576,7 +3607,7 @@ java_sources_file = _java_sources_file } output_jar_path = _final_jar_path - deps = _java_full_deps + _accumulated_deps + + deps = _java_impl_deps + _accumulated_deps + [ ":$_build_config_target_name" ] if (_has_sources) { deps += [ ":$_compile_java_target" ] @@ -3644,16 +3675,24 @@ _public_deps += [ ":${target_name}__java_binary_script" ] } + # The __impl target contains all non-analysis steps for this template. + # Having this separated out from the main target (which contains analysis + # steps) allows analysis steps for this target to be run concurrently with + # the non-analysis steps of other targets that depend on this one. + group("${target_name}__impl") { + public_deps = _public_deps + } + group(target_name) { forward_variables_from(invoker, [ "assert_no_deps", "data", - "deps", "data_deps", + "deps", "visibility", ]) - public_deps = _public_deps + public_deps = [ ":${target_name}__impl" ] if (defined(_analysis_public_deps)) { if (!defined(data_deps)) { data_deps = []
diff --git a/build/config/android/rules.gni b/build/config/android/rules.gni index 18348c8f..5a594e5 100644 --- a/build/config/android/rules.gni +++ b/build/config/android/rules.gni
@@ -1133,6 +1133,9 @@ java_header_group("${target_name}__header") { forward_variables_from(invoker, [ "deps" ]) } + java_impl_group("${target_name}__impl") { + forward_variables_from(invoker, [ "deps" ]) + } group(target_name) { forward_variables_from(invoker, "*") if (!defined(deps)) {
diff --git a/build/fuchsia/linux.sdk.sha1 b/build/fuchsia/linux.sdk.sha1 index 2d07d2d..bef17d5d 100644 --- a/build/fuchsia/linux.sdk.sha1 +++ b/build/fuchsia/linux.sdk.sha1
@@ -1 +1 @@ -0.20200401.2.1 \ No newline at end of file +0.20200402.0.1 \ No newline at end of file
diff --git a/build/fuchsia/mac.sdk.sha1 b/build/fuchsia/mac.sdk.sha1 index 00f98f4..bef17d5d 100644 --- a/build/fuchsia/mac.sdk.sha1 +++ b/build/fuchsia/mac.sdk.sha1
@@ -1 +1 @@ -0.20200401.2.2 \ No newline at end of file +0.20200402.0.1 \ No newline at end of file
diff --git a/build/toolchain/win/setup_toolchain.py b/build/toolchain/win/setup_toolchain.py index 238dd80..2ab240da 100644 --- a/build/toolchain/win/setup_toolchain.py +++ b/build/toolchain/win/setup_toolchain.py
@@ -158,11 +158,6 @@ if (target_store): args.append(['store']) variables = _LoadEnvFromBat(args) - # Check for faulty 14.25 version of system headers (see crbug.com/1058860). - if "14.25" in _ExtractImportantEnvironment(variables)["LIB"]: - # If detected, switch back to 14.24. - args.append(["-vcvars_ver=14.24"]) - variables = _LoadEnvFromBat(args) return _ExtractImportantEnvironment(variables) @@ -232,21 +227,30 @@ if os.path.exists(os.path.join(path, 'cl.exe')): vc_bin_dir = os.path.realpath(path) break + assert vc_bin_dir, "cl.exe is not found, check if it is installed." for path in env['LIB'].split(';'): if os.path.exists(os.path.join(path, 'msvcrt.lib')): vc_lib_path = os.path.realpath(path) break + assert vc_lib_path, "msvcrt.lib is not found, check if it is installed." for path in env['LIB'].split(';'): if os.path.exists(os.path.join(path, 'atls.lib')): vc_lib_atlmfc_path = os.path.realpath(path) break + if (target_store != True): + # Path is assumed to exist for desktop applications. + assert vc_lib_atlmfc_path, ( + "Microsoft.VisualStudio.Component.VC.ATLMFC " + + "is not found, check if it is installed.") for path in env['LIB'].split(';'): if os.path.exists(os.path.join(path, 'User32.Lib')): vc_lib_um_path = os.path.realpath(path) break + assert vc_lib_um_path, ( + "User32.lib is not found, check if it is installed.") # The separator for INCLUDE here must match the one used in # _LoadToolchainEnv() above. @@ -276,23 +280,16 @@ with open(environment_block_name, 'w') as f: f.write(env_block) - assert vc_bin_dir print('vc_bin_dir = ' + gn_helpers.ToGNString(vc_bin_dir)) assert include_I print('include_flags_I = ' + gn_helpers.ToGNString(include_I)) assert include_imsvc print('include_flags_imsvc = ' + gn_helpers.ToGNString(include_imsvc)) - assert vc_lib_path print('vc_lib_path = ' + gn_helpers.ToGNString(vc_lib_path)) - if (target_store != True): - # Path is assumed to exist for desktop applications. - assert vc_lib_atlmfc_path, ("Microsoft.VisualStudio.Component.VC.ATLMFC " + - "is not found, check if it's installed.") # Possible atlmfc library path gets introduced in the future for store thus # output result if a result exists. if (vc_lib_atlmfc_path != ''): print('vc_lib_atlmfc_path = ' + gn_helpers.ToGNString(vc_lib_atlmfc_path)) - assert vc_lib_um_path print('vc_lib_um_path = ' + gn_helpers.ToGNString(vc_lib_um_path)) print('paths = ' + gn_helpers.ToGNString(env['PATH'])) assert libpath_flags
diff --git a/build/vs_toolchain.py b/build/vs_toolchain.py index c2ad5c0..97600e7 100755 --- a/build/vs_toolchain.py +++ b/build/vs_toolchain.py
@@ -320,21 +320,11 @@ vc_component_msvc_contents = os.listdir(vc_component_msvc_root) # Select the most recent toolchain if there are several. _SortByHighestVersionNumberFirst(vc_component_msvc_contents) - acceptable_msvc_version_found = False for directory in vc_component_msvc_contents: - if directory.startswith('14.25'): - print( - "Warning: known issue affecting the headers distributed with VC version {}." - .format(directory)) - print("See https://crbug.com/1063424 for details.") - continue - acceptable_msvc_version_found = True if not os.path.isdir(os.path.join(vc_component_msvc_root, directory)): continue if re.match(r'14\.\d+\.\d+', directory): return os.path.join(vc_component_msvc_root, directory) - if not acceptable_msvc_version_found: - raise Exception("Unable to find a suitable VC version.") raise Exception('Unable to find the VC %s directory.' % component)
diff --git a/cc/metrics/compositor_frame_reporter.cc b/cc/metrics/compositor_frame_reporter.cc index 6d23483..6859250 100644 --- a/cc/metrics/compositor_frame_reporter.cc +++ b/cc/metrics/compositor_frame_reporter.cc
@@ -202,8 +202,10 @@ const base::flat_set<FrameSequenceTrackerType>* active_trackers, const viz::BeginFrameId& id, const base::TimeTicks frame_deadline, - LatencyUkmReporter* latency_ukm_reporter) + LatencyUkmReporter* latency_ukm_reporter, + bool should_report_metrics) : frame_id_(id), + should_report_metrics_(should_report_metrics), active_trackers_(active_trackers), latency_ukm_reporter_(latency_ukm_reporter), frame_deadline_(frame_deadline) {} @@ -216,7 +218,8 @@ !did_finish_impl_frame()) return nullptr; auto new_reporter = std::make_unique<CompositorFrameReporter>( - active_trackers_, frame_id_, frame_deadline_, latency_ukm_reporter_); + active_trackers_, frame_id_, frame_deadline_, latency_ukm_reporter_, + should_report_metrics_); new_reporter->did_finish_impl_frame_ = did_finish_impl_frame_; new_reporter->impl_frame_finish_time_ = impl_frame_finish_time_; new_reporter->current_stage_.stage_type = @@ -284,6 +287,10 @@ // stage } +void CompositorFrameReporter::OnDidNotProduceFrame() { + did_not_produce_frame_ = true; +} + void CompositorFrameReporter::SetBlinkBreakdown( std::unique_ptr<BeginMainFrameMetrics> blink_breakdown, base::TimeTicks begin_main_start) { @@ -354,7 +361,7 @@ ReportAllTraceEvents(termination_status_str); // Only report compositor latency histograms if the frame was produced. - if (report_compositor_latency) { + if (should_report_metrics_ && report_compositor_latency) { DCHECK(stage_history_.size()); DCHECK_EQ(SumOfStageHistory(), stage_history_.back().end_time - stage_history_.front().start_time);
diff --git a/cc/metrics/compositor_frame_reporter.h b/cc/metrics/compositor_frame_reporter.h index 3666a6a7..ebeb2cd 100644 --- a/cc/metrics/compositor_frame_reporter.h +++ b/cc/metrics/compositor_frame_reporter.h
@@ -123,7 +123,8 @@ const base::flat_set<FrameSequenceTrackerType>* active_trackers, const viz::BeginFrameId& id, const base::TimeTicks frame_deadline, - LatencyUkmReporter* latency_ukm_reporter); + LatencyUkmReporter* latency_ukm_reporter, + bool should_report_metrics); ~CompositorFrameReporter(); CompositorFrameReporter(const CompositorFrameReporter& reporter) = delete; @@ -148,8 +149,10 @@ void OnFinishImplFrame(base::TimeTicks timestamp); void OnAbortBeginMainFrame(base::TimeTicks timestamp); + void OnDidNotProduceFrame(); bool did_finish_impl_frame() const { return did_finish_impl_frame_; } bool did_abort_main_frame() const { return did_abort_main_frame_; } + bool did_not_produce_frame() const { return did_not_produce_frame_; } base::TimeTicks impl_frame_finish_time() const { return impl_frame_finish_time_; } @@ -197,6 +200,8 @@ void ReportAllTraceEvents(const char* termination_status_str) const; + const bool should_report_metrics_; + StageData current_stage_; BeginMainFrameMetrics blink_breakdown_; viz::FrameTimingDetails viz_breakdown_; @@ -226,6 +231,8 @@ bool did_finish_impl_frame_ = false; // Indicates if main frame is aborted after begin. bool did_abort_main_frame_ = false; + // Flag indicating if DidNotProduceFrame is called for this reporter + bool did_not_produce_frame_ = false; // The time that work on Impl frame is finished. It's only valid if the // reporter is in a stage other than begin impl frame. base::TimeTicks impl_frame_finish_time_;
diff --git a/cc/metrics/compositor_frame_reporter_unittest.cc b/cc/metrics/compositor_frame_reporter_unittest.cc index d302919..1f4ffee 100644 --- a/cc/metrics/compositor_frame_reporter_unittest.cc +++ b/cc/metrics/compositor_frame_reporter_unittest.cc
@@ -33,7 +33,8 @@ &active_trackers, viz::BeginFrameId(), base::TimeTicks() + base::TimeDelta::FromMilliseconds(16), - nullptr)) { + nullptr, + /*should_report_metrics=*/true)) { AdvanceNowByMs(1); }
diff --git a/cc/metrics/compositor_frame_reporting_controller.cc b/cc/metrics/compositor_frame_reporting_controller.cc index b06f3a3..a563bc6 100644 --- a/cc/metrics/compositor_frame_reporting_controller.cc +++ b/cc/metrics/compositor_frame_reporting_controller.cc
@@ -17,8 +17,10 @@ using FrameTerminationStatus = CompositorFrameReporter::FrameTerminationStatus; } // namespace -CompositorFrameReportingController::CompositorFrameReportingController() - : latency_ukm_reporter_(std::make_unique<LatencyUkmReporter>()) {} +CompositorFrameReportingController::CompositorFrameReportingController( + bool should_report_metrics) + : should_report_metrics_(should_report_metrics), + latency_ukm_reporter_(std::make_unique<LatencyUkmReporter>()) {} CompositorFrameReportingController::~CompositorFrameReportingController() { base::TimeTicks now = Now(); @@ -62,7 +64,8 @@ std::unique_ptr<CompositorFrameReporter> reporter = std::make_unique<CompositorFrameReporter>( &active_trackers_, args.frame_id, - args.frame_time + (args.interval * 1.5), latency_ukm_reporter_.get()); + args.frame_time + (args.interval * 1.5), latency_ukm_reporter_.get(), + should_report_metrics_); reporter->StartStage(StageType::kBeginImplFrameToSendBeginMainFrame, begin_time); reporters_[PipelineStage::kBeginImplFrame] = std::move(reporter); @@ -89,7 +92,7 @@ std::make_unique<CompositorFrameReporter>( &active_trackers_, args.frame_id, args.frame_time + (args.interval * 1.5), - latency_ukm_reporter_.get()); + latency_ukm_reporter_.get(), should_report_metrics_); reporter->StartStage(StageType::kSendBeginMainFrameToCommit, Now()); reporters_[PipelineStage::kBeginMainFrame] = std::move(reporter); } @@ -143,7 +146,7 @@ uint32_t frame_token, const viz::BeginFrameId& current_frame_id, const viz::BeginFrameId& last_activated_frame_id, - std::vector<EventMetrics> events_metrics) { + EventMetricsSet events_metrics) { // If the last_activated_frame_id from scheduler is the same as // last_submitted_frame_id_ in reporting controller, this means that we are // submitting the Impl frame. In this case the frame will be submitted if @@ -191,7 +194,21 @@ std::move(reporters_[PipelineStage::kActivate]); submitted_reporter->StartStage( StageType::kSubmitCompositorFrameToPresentationCompositorFrame, Now()); - submitted_reporter->SetEventsMetrics(std::move(events_metrics)); + + // TODO(mjzhang): The main and impl vectors are combined to preserve the + // current behavior. In a subsequent CL, an impl reporter will also be added + // for submission and the two vectors will be kept separate and moved into + // their corresponding reporter. + std::vector<EventMetrics> combined_event_metrics = + std::move(events_metrics.main_event_metrics); + + combined_event_metrics.reserve(combined_event_metrics.size() + + events_metrics.impl_event_metrics.size()); + combined_event_metrics.insert(combined_event_metrics.end(), + events_metrics.impl_event_metrics.begin(), + events_metrics.impl_event_metrics.end()); + + submitted_reporter->SetEventsMetrics(std::move(combined_event_metrics)); submitted_compositor_frames_.emplace_back(frame_token, std::move(submitted_reporter)); } @@ -200,8 +217,14 @@ const viz::BeginFrameId& id) { for (auto& stage_reporter : reporters_) { if (stage_reporter && stage_reporter->frame_id_ == id) { - stage_reporter->TerminateFrame( - FrameTerminationStatus::kDidNotProduceFrame, Now()); + // The reporter will be flagged and terminated when replaced by another + // reporter. The reporter is not terminated immediately here because it + // can still end up producing a frame afterwards. For example, if the + // compositor does not have any updates, and the main-thread takes too + // long, then DidNotProduceFrame() is called for the reporter in the + // BeginMain stage, but the main-thread can make updates, which can be + // submitted with the next frame. + stage_reporter->OnDidNotProduceFrame(); return; } } @@ -259,8 +282,12 @@ PipelineStage start, PipelineStage target) { if (reporters_[target]) { - reporters_[target]->TerminateFrame( - FrameTerminationStatus::kReplacedByNewReporter, Now()); + if (reporters_[target]->did_not_produce_frame()) + reporters_[target]->TerminateFrame( + FrameTerminationStatus::kDidNotProduceFrame, Now()); + else + reporters_[target]->TerminateFrame( + FrameTerminationStatus::kReplacedByNewReporter, Now()); } reporters_[target] = std::move(reporters_[start]); }
diff --git a/cc/metrics/compositor_frame_reporting_controller.h b/cc/metrics/compositor_frame_reporting_controller.h index 544145f7..8eb99e0 100644 --- a/cc/metrics/compositor_frame_reporting_controller.h +++ b/cc/metrics/compositor_frame_reporting_controller.h
@@ -38,7 +38,7 @@ kNumPipelineStages }; - CompositorFrameReportingController(); + explicit CompositorFrameReportingController(bool should_report_metrics); virtual ~CompositorFrameReportingController(); CompositorFrameReportingController( @@ -59,7 +59,7 @@ uint32_t frame_token, const viz::BeginFrameId& current_frame_id, const viz::BeginFrameId& last_activated_frame_id, - std::vector<EventMetrics> events_metrics); + EventMetricsSet events_metrics); virtual void DidNotProduceFrame(const viz::BeginFrameId& id); virtual void OnFinishImplFrame(const viz::BeginFrameId& id); virtual void DidPresentCompositorFrame( @@ -97,6 +97,7 @@ std::unique_ptr<CompositorFrameReporter> RestoreReporterAtBeginImpl( const viz::BeginFrameId& id); + const bool should_report_metrics_; viz::BeginFrameId last_submitted_frame_id_; bool next_activate_has_invalidation_ = false;
diff --git a/cc/metrics/compositor_frame_reporting_controller_unittest.cc b/cc/metrics/compositor_frame_reporting_controller_unittest.cc index ccf63eb..79495d9 100644 --- a/cc/metrics/compositor_frame_reporting_controller_unittest.cc +++ b/cc/metrics/compositor_frame_reporting_controller_unittest.cc
@@ -28,7 +28,8 @@ class TestCompositorFrameReportingController : public CompositorFrameReportingController { public: - TestCompositorFrameReportingController() = default; + TestCompositorFrameReportingController() + : CompositorFrameReportingController(/*should_report_metrics=*/true) {} TestCompositorFrameReportingController( const TestCompositorFrameReportingController& controller) = delete; @@ -98,19 +99,20 @@ } void SimulateSubmitCompositorFrame(uint32_t frame_token, - std::vector<EventMetrics> events_metrics) { + EventMetricsSet events_metrics) { if (!reporting_controller_.reporters() [CompositorFrameReportingController::PipelineStage::kActivate]) SimulateActivate(); CHECK(reporting_controller_.reporters() [CompositorFrameReportingController::PipelineStage::kActivate]); - reporting_controller_.DidSubmitCompositorFrame( - frame_token, current_id_, last_activated_id_, events_metrics); + reporting_controller_.DidSubmitCompositorFrame(frame_token, current_id_, + last_activated_id_, + std::move(events_metrics)); } void SimulatePresentCompositorFrame() { ++next_token_; - SimulateSubmitCompositorFrame(*next_token_, std::vector<EventMetrics>()); + SimulateSubmitCompositorFrame(*next_token_, {}); viz::FrameTimingDetails details = {}; details.presentation_feedback.timestamp = base::TimeTicks::Now(); reporting_controller_.DidPresentCompositorFrame(*next_token_, details); @@ -201,8 +203,8 @@ EXPECT_EQ(1, reporting_controller_.ActiveReporters()); last_activated_id_ = current_id_3; - reporting_controller_.DidSubmitCompositorFrame( - 0, current_id_3, last_activated_id_, std::vector<EventMetrics>()); + reporting_controller_.DidSubmitCompositorFrame(0, current_id_3, + last_activated_id_, {}); EXPECT_EQ(0, reporting_controller_.ActiveReporters()); // 4 simultaneous reporters active. @@ -323,6 +325,50 @@ "CompositorLatency.DroppedFrame.SendBeginMainFrameToCommit", 0); } +TEST_F(CompositorFrameReportingControllerTest, DidNotProduceFrame) { + base::HistogramTester histogram_tester; + + viz::BeginFrameId current_id_1(1, 1); + viz::BeginFrameArgs args_1 = SimulateBeginFrameArgs(current_id_1); + + viz::BeginFrameId current_id_2(1, 2); + viz::BeginFrameArgs args_2 = SimulateBeginFrameArgs(current_id_2); + + reporting_controller_.WillBeginImplFrame(args_1); + reporting_controller_.WillBeginMainFrame(args_1); + reporting_controller_.OnFinishImplFrame(current_id_1); + reporting_controller_.DidNotProduceFrame(current_id_1); + + reporting_controller_.WillBeginImplFrame(args_2); + reporting_controller_.OnFinishImplFrame(current_id_2); + reporting_controller_.WillCommit(); + reporting_controller_.DidCommit(); + reporting_controller_.WillActivate(); + reporting_controller_.DidActivate(); + reporting_controller_.DidSubmitCompositorFrame(1, current_id_2, current_id_1, + {}); + viz::FrameTimingDetails details = {}; + reporting_controller_.DidPresentCompositorFrame(1, details); + + histogram_tester.ExpectTotalCount( + "CompositorLatency.DroppedFrame.BeginImplFrameToSendBeginMainFrame", 0); + histogram_tester.ExpectTotalCount( + "CompositorLatency.DroppedFrame.SendBeginMainFrameToCommit", 0); + histogram_tester.ExpectTotalCount( + "CompositorLatency.BeginImplFrameToSendBeginMainFrame", 1); + histogram_tester.ExpectTotalCount( + "CompositorLatency.SendBeginMainFrameToCommit", 1); + histogram_tester.ExpectTotalCount("CompositorLatency.Commit", 1); + histogram_tester.ExpectTotalCount("CompositorLatency.EndCommitToActivation", + 1); + histogram_tester.ExpectTotalCount("CompositorLatency.Activation", 1); + histogram_tester.ExpectTotalCount( + "CompositorLatency.EndActivateToSubmitCompositorFrame", 1); + histogram_tester.ExpectTotalCount( + "CompositorLatency.SubmitCompositorFrameToPresentationCompositorFrame", + 1); +} + TEST_F(CompositorFrameReportingControllerTest, MainFrameAborted) { base::HistogramTester histogram_tester; @@ -330,8 +376,8 @@ reporting_controller_.WillBeginMainFrame(args_); reporting_controller_.BeginMainFrameAborted(current_id_); reporting_controller_.OnFinishImplFrame(current_id_); - reporting_controller_.DidSubmitCompositorFrame( - 1, current_id_, last_activated_id_, std::vector<EventMetrics>()); + reporting_controller_.DidSubmitCompositorFrame(1, current_id_, + last_activated_id_, {}); viz::FrameTimingDetails details = {}; reporting_controller_.DidPresentCompositorFrame(1, details); @@ -370,7 +416,7 @@ reporting_controller_.OnFinishImplFrame(current_id_2); reporting_controller_.BeginMainFrameAborted(current_id_2); reporting_controller_.DidSubmitCompositorFrame(1, current_id_2, current_id_1, - std::vector<EventMetrics>()); + {}); viz::FrameTimingDetails details = {}; reporting_controller_.DidPresentCompositorFrame(1, details); histogram_tester.ExpectTotalCount( @@ -389,7 +435,7 @@ "CompositorLatency.SubmitCompositorFrameToPresentationCompositorFrame", 1); reporting_controller_.DidSubmitCompositorFrame(2, current_id_2, current_id_1, - std::vector<EventMetrics>()); + {}); reporting_controller_.DidPresentCompositorFrame(2, details); histogram_tester.ExpectTotalCount( "CompositorLatency.DroppedFrame.BeginImplFrameToSendBeginMainFrame", 0); @@ -409,7 +455,7 @@ reporting_controller_.WillBeginImplFrame(args_3); reporting_controller_.OnFinishImplFrame(current_id_3); reporting_controller_.DidSubmitCompositorFrame(3, current_id_3, current_id_1, - std::vector<EventMetrics>()); + {}); reporting_controller_.DidPresentCompositorFrame(3, details); histogram_tester.ExpectTotalCount( "CompositorLatency.DroppedFrame.BeginImplFrameToSendBeginMainFrame", 0); @@ -445,7 +491,7 @@ reporting_controller_.WillActivate(); reporting_controller_.DidActivate(); reporting_controller_.DidSubmitCompositorFrame(1, current_id_1, current_id_1, - std::vector<EventMetrics>()); + {}); reporting_controller_.DidPresentCompositorFrame(1, details); histogram_tester.ExpectTotalCount( @@ -468,7 +514,7 @@ reporting_controller_.WillBeginMainFrame(args_2); reporting_controller_.OnFinishImplFrame(current_id_2); reporting_controller_.DidSubmitCompositorFrame(2, current_id_2, current_id_1, - std::vector<EventMetrics>()); + {}); reporting_controller_.DidPresentCompositorFrame(2, details); histogram_tester.ExpectTotalCount( @@ -554,7 +600,7 @@ reporting_controller_.WillActivate(); reporting_controller_.DidActivate(); reporting_controller_.DidSubmitCompositorFrame(1, current_id_, current_id_, - std::vector<EventMetrics>()); + {}); viz::FrameTimingDetails details = {}; details.presentation_feedback.timestamp = args_.frame_time + args_.interval * 1.5 - @@ -591,7 +637,7 @@ reporting_controller_.WillActivate(); reporting_controller_.DidActivate(); reporting_controller_.DidSubmitCompositorFrame(1, current_id_, current_id_, - std::vector<EventMetrics>()); + {}); viz::FrameTimingDetails details = {}; details.presentation_feedback.timestamp = args_.frame_time + args_.interval * 1.5 + @@ -633,7 +679,7 @@ // Submit a compositor frame and notify CompositorFrameReporter of the events // affecting the frame. ++next_token_; - SimulateSubmitCompositorFrame(*next_token_, events_metrics); + SimulateSubmitCompositorFrame(*next_token_, {std::move(events_metrics), {}}); // Present the submitted compositor frame to the user. const base::TimeTicks presentation_time = base::TimeTicks::Now(); @@ -669,7 +715,7 @@ // Submit a compositor frame and notify CompositorFrameReporter of the events // affecting the frame. ++next_token_; - SimulateSubmitCompositorFrame(*next_token_, events_metrics); + SimulateSubmitCompositorFrame(*next_token_, {std::move(events_metrics), {}}); // Present the submitted compositor frame to the user. const base::TimeTicks presentation_time = base::TimeTicks::Now(); @@ -706,12 +752,12 @@ // Submit a compositor frame and notify CompositorFrameReporter of the events // affecting the frame. ++next_token_; - SimulateSubmitCompositorFrame(*next_token_, events_metrics); + SimulateSubmitCompositorFrame(*next_token_, {std::move(events_metrics), {}}); // Submit another compositor frame. ++next_token_; IncrementCurrentId(); - SimulateSubmitCompositorFrame(*next_token_, std::vector<EventMetrics>()); + SimulateSubmitCompositorFrame(*next_token_, {}); // Present the second compositor frame to the uesr, dropping the first one. viz::FrameTimingDetails details;
diff --git a/cc/metrics/compositor_timing_history.cc b/cc/metrics/compositor_timing_history.cc index e218dd10..db50742 100644 --- a/cc/metrics/compositor_timing_history.cc +++ b/cc/metrics/compositor_timing_history.cc
@@ -943,7 +943,7 @@ uint32_t frame_token, const viz::BeginFrameId& current_frame_id, const viz::BeginFrameId& last_activated_frame_id, - std::vector<EventMetrics> events_metrics) { + EventMetricsSet events_metrics) { DCHECK_EQ(base::TimeTicks(), submit_start_time_); compositor_frame_reporting_controller_->DidSubmitCompositorFrame( frame_token, current_frame_id, last_activated_frame_id,
diff --git a/cc/metrics/compositor_timing_history.h b/cc/metrics/compositor_timing_history.h index 55c5525b..9ec86a2 100644 --- a/cc/metrics/compositor_timing_history.h +++ b/cc/metrics/compositor_timing_history.h
@@ -99,7 +99,7 @@ uint32_t frame_token, const viz::BeginFrameId& current_frame_id, const viz::BeginFrameId& last_activated_frame_id, - std::vector<EventMetrics> events_metrics); + EventMetricsSet events_metrics); void DidNotProduceFrame(const viz::BeginFrameId& id); void DidReceiveCompositorFrameAck(); void DidPresentCompositorFrame(uint32_t frame_token,
diff --git a/cc/metrics/event_metrics.cc b/cc/metrics/event_metrics.cc index 8b7466a..f7f03b9 100644 --- a/cc/metrics/event_metrics.cc +++ b/cc/metrics/event_metrics.cc
@@ -94,4 +94,15 @@ std::tie(other.type_, other.time_stamp_, other.scroll_input_type_); } +// EventMetricsSet +EventMetricsSet::EventMetricsSet() = default; +EventMetricsSet::~EventMetricsSet() = default; +EventMetricsSet::EventMetricsSet( + std::vector<EventMetrics> main_thread_event_metrics, + std::vector<EventMetrics> impl_thread_event_metrics) + : main_event_metrics(std::move(main_thread_event_metrics)), + impl_event_metrics(std::move(impl_thread_event_metrics)) {} +EventMetricsSet::EventMetricsSet(EventMetricsSet&& other) = default; +EventMetricsSet& EventMetricsSet::operator=(EventMetricsSet&& other) = default; + } // namespace cc
diff --git a/cc/metrics/event_metrics.h b/cc/metrics/event_metrics.h index 422cd94..3f6b9d3 100644 --- a/cc/metrics/event_metrics.h +++ b/cc/metrics/event_metrics.h
@@ -56,6 +56,22 @@ base::Optional<ScrollInputType> scroll_input_type_; }; +// Struct storing event metrics from both main and impl threads. +struct CC_EXPORT EventMetricsSet { + EventMetricsSet(); + ~EventMetricsSet(); + EventMetricsSet(std::vector<EventMetrics> main_thread_event_metrics, + std::vector<EventMetrics> impl_thread_event_metrics); + EventMetricsSet(EventMetricsSet&&); + EventMetricsSet& operator=(EventMetricsSet&&); + + EventMetricsSet(const EventMetricsSet&) = delete; + EventMetricsSet& operator=(const EventMetricsSet&) = delete; + + std::vector<EventMetrics> main_event_metrics; + std::vector<EventMetrics> impl_event_metrics; +}; + } // namespace cc #endif // CC_METRICS_EVENT_METRICS_H_
diff --git a/cc/metrics/events_metrics_manager.cc b/cc/metrics/events_metrics_manager.cc index bd8df7d1..cd008372 100644 --- a/cc/metrics/events_metrics_manager.cc +++ b/cc/metrics/events_metrics_manager.cc
@@ -54,11 +54,4 @@ return result; } -void EventsMetricsManager::AppendToSavedEventsMetrics( - std::vector<EventMetrics> events_metrics) { - saved_events_.reserve(saved_events_.size() + events_metrics.size()); - saved_events_.insert(saved_events_.end(), events_metrics.begin(), - events_metrics.end()); -} - } // namespace cc
diff --git a/cc/metrics/events_metrics_manager.h b/cc/metrics/events_metrics_manager.h index 5f6dc3fc..8dd3bbfb 100644 --- a/cc/metrics/events_metrics_manager.h +++ b/cc/metrics/events_metrics_manager.h
@@ -52,8 +52,6 @@ // caller. std::vector<EventMetrics> TakeSavedEventsMetrics(); - void AppendToSavedEventsMetrics(std::vector<EventMetrics> events_metrics); - private: // Current active EventMetrics, if any. base::Optional<EventMetrics> active_event_;
diff --git a/cc/metrics/frame_sequence_tracker_unittest.cc b/cc/metrics/frame_sequence_tracker_unittest.cc index 51c8666..604924b 100644 --- a/cc/metrics/frame_sequence_tracker_unittest.cc +++ b/cc/metrics/frame_sequence_tracker_unittest.cc
@@ -37,8 +37,9 @@ FrameSequenceTrackerTest() : compositor_frame_reporting_controller_( - std::make_unique<CompositorFrameReportingController>()), - collection_(/* is_single_threaded=*/false, + std::make_unique<CompositorFrameReportingController>( + /*should_report_metrics=*/true)), + collection_(/*is_single_threaded=*/false, compositor_frame_reporting_controller_.get()) { collection_.StartSequence(FrameSequenceTrackerType::kTouchScroll); tracker_ = collection_.GetTrackerForTesting(
diff --git a/cc/metrics/throughput_ukm_reporter.cc b/cc/metrics/throughput_ukm_reporter.cc index 176f5461..08369a64 100644 --- a/cc/metrics/throughput_ukm_reporter.cc +++ b/cc/metrics/throughput_ukm_reporter.cc
@@ -16,19 +16,26 @@ ThroughputUkmReporter::ThroughputUkmReporter(UkmManager* ukm_manager) : ukm_manager_(ukm_manager) { DCHECK(ukm_manager_); + // TODO(crbug.com/1040634): Setting it to 1 such that the first sample is + // ignored. TThis is because the universal tracker is active during the page + // load and the first sample is heavily biased by loading as a result. + samples_to_next_event_[static_cast<int>( + FrameSequenceTrackerType::kUniversal)] = 1; } +ThroughputUkmReporter::~ThroughputUkmReporter() = default; + void ThroughputUkmReporter::ReportThroughputUkm( const base::Optional<int>& slower_throughput_percent, const base::Optional<int>& impl_throughput_percent, const base::Optional<int>& main_throughput_percent, FrameSequenceTrackerType type) { - if (samples_to_next_event_ == 0) { - // Sample every 2000 events. Using the Universal tracker as an example + if (samples_to_next_event_[static_cast<int>(type)] == 0) { + // Sample every 100 events. Using the Universal tracker as an example // which reports UMA every 5s, then the system collects UKM once per - // 2000*5 = 10000 seconds, which is about 3 hours. This number may need to - // be tuned to not throttle the UKM system. - samples_to_next_event_ = kNumberOfSamplesToReport; + // 100*5 = 500 seconds. This number may need to be tuned to not throttle + // the UKM system. + samples_to_next_event_[static_cast<int>(type)] = kNumberOfSamplesToReport; if (impl_throughput_percent) { ukm_manager_->RecordThroughputUKM( type, FrameSequenceMetrics::ThreadType::kCompositor, @@ -43,8 +50,8 @@ FrameSequenceMetrics::ThreadType::kSlower, slower_throughput_percent.value()); } - DCHECK_GT(samples_to_next_event_, 0u); - samples_to_next_event_--; + DCHECK_GT(samples_to_next_event_[static_cast<int>(type)], 0u); + samples_to_next_event_[static_cast<int>(type)]--; } void ThroughputUkmReporter::ReportAggregateThroughput(
diff --git a/cc/metrics/throughput_ukm_reporter.h b/cc/metrics/throughput_ukm_reporter.h index 6f254202..b544946 100644 --- a/cc/metrics/throughput_ukm_reporter.h +++ b/cc/metrics/throughput_ukm_reporter.h
@@ -23,7 +23,7 @@ class CC_EXPORT ThroughputUkmReporter { public: explicit ThroughputUkmReporter(UkmManager* ukm_manager); - ~ThroughputUkmReporter() = default; + ~ThroughputUkmReporter(); ThroughputUkmReporter(const ThroughputUkmReporter&) = delete; ThroughputUkmReporter& operator=(const ThroughputUkmReporter&) = delete; @@ -40,7 +40,8 @@ // Sampling control. We sample the event here to not throttle the UKM system. // Currently, the same sampling rate is applied to all existing trackers. We // might want to iterate on this based on the collected data. - uint32_t samples_to_next_event_ = 0; + uint32_t samples_to_next_event_[static_cast<int>( + FrameSequenceTrackerType::kMaxType)] = {0}; uint32_t samples_for_aggregated_report_ = 0; // This is pointing to the LayerTreeHostImpl::ukm_manager_, which is
diff --git a/cc/scheduler/scheduler.cc b/cc/scheduler/scheduler.cc index 5dd2d88..8ec008c 100644 --- a/cc/scheduler/scheduler.cc +++ b/cc/scheduler/scheduler.cc
@@ -146,9 +146,8 @@ ProcessScheduledActions(); } -void Scheduler::DidSubmitCompositorFrame( - uint32_t frame_token, - std::vector<EventMetrics> events_metrics) { +void Scheduler::DidSubmitCompositorFrame(uint32_t frame_token, + EventMetricsSet events_metrics) { compositor_timing_history_->DidSubmitCompositorFrame( frame_token, begin_main_frame_args_.frame_id, last_activate_origin_frame_args_.frame_id, std::move(events_metrics));
diff --git a/cc/scheduler/scheduler.h b/cc/scheduler/scheduler.h index 77c63e6..750e44b 100644 --- a/cc/scheduler/scheduler.h +++ b/cc/scheduler/scheduler.h
@@ -173,7 +173,7 @@ // Drawing should result in submitting a CompositorFrame to the // LayerTreeFrameSink and then calling this. void DidSubmitCompositorFrame(uint32_t frame_token, - std::vector<EventMetrics> events_metrics); + EventMetricsSet events_metrics); // The LayerTreeFrameSink acks when it is ready for a new frame which // should result in this getting called to unblock the next draw. void DidReceiveCompositorFrameAck();
diff --git a/cc/scheduler/scheduler_unittest.cc b/cc/scheduler/scheduler_unittest.cc index 5da0a78..6f324622 100644 --- a/cc/scheduler/scheduler_unittest.cc +++ b/cc/scheduler/scheduler_unittest.cc
@@ -164,7 +164,7 @@ draw_will_happen_ && swap_will_happen_if_draw_happens_; if (swap_will_happen) { last_begin_frame_ack_ = scheduler_->CurrentBeginFrameAckForActiveTree(); - scheduler_->DidSubmitCompositorFrame(0, std::vector<EventMetrics>()); + scheduler_->DidSubmitCompositorFrame(0, EventMetricsSet()); if (automatic_ack_) scheduler_->DidReceiveCompositorFrameAck();
diff --git a/cc/test/fake_compositor_frame_reporting_controller.cc b/cc/test/fake_compositor_frame_reporting_controller.cc index e0dcb2b88..739158d 100644 --- a/cc/test/fake_compositor_frame_reporting_controller.cc +++ b/cc/test/fake_compositor_frame_reporting_controller.cc
@@ -12,8 +12,8 @@ namespace cc { base::TimeDelta INTERVAL = base::TimeDelta::FromMilliseconds(16); -FakeCompositorFrameReportingController:: - FakeCompositorFrameReportingController() = default; +FakeCompositorFrameReportingController::FakeCompositorFrameReportingController() + : CompositorFrameReportingController(/*should_report_metrics=*/true) {} void FakeCompositorFrameReportingController::WillBeginMainFrame( const viz::BeginFrameArgs& args) { @@ -67,7 +67,7 @@ uint32_t frame_token, const viz::BeginFrameId& current_frame_id, const viz::BeginFrameId& last_activated_frame_id, - std::vector<EventMetrics> events_metrics) { + EventMetricsSet events_metrics) { CompositorFrameReportingController::DidSubmitCompositorFrame( frame_token, current_frame_id, last_activated_frame_id, std::move(events_metrics));
diff --git a/cc/test/fake_compositor_frame_reporting_controller.h b/cc/test/fake_compositor_frame_reporting_controller.h index 6799672..27c74f8 100644 --- a/cc/test/fake_compositor_frame_reporting_controller.h +++ b/cc/test/fake_compositor_frame_reporting_controller.h
@@ -38,7 +38,7 @@ uint32_t frame_token, const viz::BeginFrameId& current_frame_id, const viz::BeginFrameId& last_activated_frame_id, - std::vector<EventMetrics> events_metrics) override; + EventMetricsSet events_metrics) override; void DidPresentCompositorFrame( uint32_t frame_token, const viz::FrameTimingDetails& details) override;
diff --git a/cc/trees/layer_tree_host.cc b/cc/trees/layer_tree_host.cc index 4dc709ed..c59754c7 100644 --- a/cc/trees/layer_tree_host.cc +++ b/cc/trees/layer_tree_host.cc
@@ -361,7 +361,7 @@ PushLayerTreeHostPropertiesTo(host_impl); sync_tree->PassSwapPromises(swap_promise_manager_.TakeSwapPromises()); - host_impl->AppendEventsMetrics( + host_impl->AppendEventsMetricsFromMainThread( events_metrics_manager_.TakeSavedEventsMetrics()); sync_tree->set_ui_resource_request_queue(
diff --git a/cc/trees/layer_tree_host_impl.cc b/cc/trees/layer_tree_host_impl.cc index a3c68f8..ecf8a22 100644 --- a/cc/trees/layer_tree_host_impl.cc +++ b/cc/trees/layer_tree_host_impl.cc
@@ -288,7 +288,9 @@ task_runner_provider_(task_runner_provider), current_begin_frame_tracker_(FROM_HERE), compositor_frame_reporting_controller_( - std::make_unique<CompositorFrameReportingController>()), + std::make_unique<CompositorFrameReportingController>( + /*should_report_metrics=*/!settings + .single_thread_proxy_scheduler)), settings_(settings), is_synchronous_single_threaded_(!task_runner_provider->HasImplThread() && !settings_.single_thread_proxy_scheduler), @@ -6164,13 +6166,20 @@ client_->NeedsImplSideInvalidation(needs_first_draw_on_activation); } -std::vector<EventMetrics> LayerTreeHostImpl::TakeEventsMetrics() { - return events_metrics_manager_.TakeSavedEventsMetrics(); +EventMetricsSet LayerTreeHostImpl::TakeEventsMetrics() { + std::vector<EventMetrics> main_event_metrics_result; + main_event_metrics_result.swap(events_metrics_from_main_thread_); + return EventMetricsSet(std::move(main_event_metrics_result), + events_metrics_manager_.TakeSavedEventsMetrics()); } -void LayerTreeHostImpl::AppendEventsMetrics( +void LayerTreeHostImpl::AppendEventsMetricsFromMainThread( std::vector<EventMetrics> events_metrics) { - events_metrics_manager_.AppendToSavedEventsMetrics(std::move(events_metrics)); + events_metrics_from_main_thread_.reserve( + events_metrics_from_main_thread_.size() + events_metrics.size()); + events_metrics_from_main_thread_.insert( + events_metrics_from_main_thread_.end(), events_metrics.begin(), + events_metrics.end()); } base::WeakPtr<LayerTreeHostImpl> LayerTreeHostImpl::AsWeakPtr() {
diff --git a/cc/trees/layer_tree_host_impl.h b/cc/trees/layer_tree_host_impl.h index a203207..810aac7 100644 --- a/cc/trees/layer_tree_host_impl.h +++ b/cc/trees/layer_tree_host_impl.h
@@ -335,8 +335,9 @@ void RequestBeginFrameForAnimatedImages() override; void RequestInvalidationForAnimatedImages() override; - std::vector<EventMetrics> TakeEventsMetrics(); - void AppendEventsMetrics(std::vector<EventMetrics> events_metrics); + EventMetricsSet TakeEventsMetrics(); + void AppendEventsMetricsFromMainThread( + std::vector<EventMetrics> events_metrics); base::WeakPtr<LayerTreeHostImpl> AsWeakPtr(); @@ -1358,6 +1359,9 @@ EventsMetricsManager events_metrics_manager_; + // Event metrics that are reported back from the main thread. + std::vector<EventMetrics> events_metrics_from_main_thread_; + // Must be the last member to ensure this is destroyed first in the // destruction order and invalidates all weak pointers. base::WeakPtrFactory<LayerTreeHostImpl> weak_factory_{this};
diff --git a/chrome/BUILD.gn b/chrome/BUILD.gn index 23eb5fc..d113eed 100644 --- a/chrome/BUILD.gn +++ b/chrome/BUILD.gn
@@ -1557,6 +1557,10 @@ sources = [ "browser/supervised_user/supervised_user_url_filter.h" ] } + java_cpp_enum("context_menu_image_format_enum_javagen") { + sources = [ "browser/ui/android/context_menu_helper.h" ] + } + source_set("chrome_android_core") { sources = [ "app/android/chrome_android_initializer.cc",
diff --git a/chrome/VERSION b/chrome/VERSION index a408070a..012d275 100644 --- a/chrome/VERSION +++ b/chrome/VERSION
@@ -1,4 +1,4 @@ MAJOR=83 MINOR=0 -BUILD=4102 +BUILD=4103 PATCH=0
diff --git a/chrome/android/BUILD.gn b/chrome/android/BUILD.gn index b7da7c3..8f98c95 100644 --- a/chrome/android/BUILD.gn +++ b/chrome/android/BUILD.gn
@@ -317,6 +317,7 @@ "//components/bookmarks/common/android:bookmarks_java", "//components/browser_ui/modaldialog/android:java", "//components/browser_ui/settings/android:java", + "//components/browser_ui/site_settings/android:java", "//components/browser_ui/styles/android:java", "//components/browser_ui/util/android:java", "//components/browser_ui/widget/android:java", @@ -457,6 +458,7 @@ ":vr_build_config", "//chrome:assist_ranker_prediction_enum_javagen", "//chrome:content_setting_javagen", + "//chrome:context_menu_image_format_enum_javagen", "//chrome:cookie_controls_mode_javagen", "//chrome:download_enum_javagen", "//chrome:instant_apps_reasons_enum_javagen",
diff --git a/chrome/android/DEPS b/chrome/android/DEPS index 05bdbcb..f597e55 100644 --- a/chrome/android/DEPS +++ b/chrome/android/DEPS
@@ -9,6 +9,7 @@ "+chrome/browser/util/android/java", "+chrome/browser/xsurface/android", "+components/browser_ui/modaldialog/android", + "+components/browser_ui/site_settings/android", "+components/browser_ui/util/android", "+components/browser_ui/widget/android", "+components/content_capture",
diff --git a/chrome/android/chrome_junit_test_java_sources.gni b/chrome/android/chrome_junit_test_java_sources.gni index f72f943..9e0ebb9 100644 --- a/chrome/android/chrome_junit_test_java_sources.gni +++ b/chrome/android/chrome_junit_test_java_sources.gni
@@ -180,6 +180,7 @@ "junit/src/org/chromium/chrome/browser/password_manager/settings/TimedCallbackDelayerTest.java", "junit/src/org/chromium/chrome/browser/payments/AutofillContactTest.java", "junit/src/org/chromium/chrome/browser/payments/AutofillContactUnitTest.java", + "junit/src/org/chromium/chrome/browser/photo_picker/PickerBitmapViewTest.java", "junit/src/org/chromium/chrome/browser/preferences/PrefServiceBridgeTest.java", "junit/src/org/chromium/chrome/browser/privacy/settings/PrivacyPreferencesManagerTest.java", "junit/src/org/chromium/chrome/browser/search_engines/SearchEngineChoiceMetricsTest.java",
diff --git a/chrome/android/features/cablev2_authenticator/internal/java/src/org/chromium/chrome/browser/webauth/authenticator/BLEHandler.java b/chrome/android/features/cablev2_authenticator/internal/java/src/org/chromium/chrome/browser/webauth/authenticator/BLEHandler.java index 3c42bad..f2d15d9d 100644 --- a/chrome/android/features/cablev2_authenticator/internal/java/src/org/chromium/chrome/browser/webauth/authenticator/BLEHandler.java +++ b/chrome/android/features/cablev2_authenticator/internal/java/src/org/chromium/chrome/browser/webauth/authenticator/BLEHandler.java
@@ -500,6 +500,15 @@ } /** + * Called by native code to notify of a client completing a handshake. + */ + @CalledByNative + public void onHandshake(long client) { + maybeStopAdvertising(); + mAuthenticator.onHandshake(client); + } + + /** * Called by native code to store a new state blob. */ @CalledByNative
diff --git a/chrome/android/features/cablev2_authenticator/internal/java/src/org/chromium/chrome/browser/webauth/authenticator/CableAuthenticator.java b/chrome/android/features/cablev2_authenticator/internal/java/src/org/chromium/chrome/browser/webauth/authenticator/CableAuthenticator.java index 648f00b..a297462 100644 --- a/chrome/android/features/cablev2_authenticator/internal/java/src/org/chromium/chrome/browser/webauth/authenticator/CableAuthenticator.java +++ b/chrome/android/features/cablev2_authenticator/internal/java/src/org/chromium/chrome/browser/webauth/authenticator/CableAuthenticator.java
@@ -57,19 +57,43 @@ private final Context mContext; private final CableAuthenticatorUI mUi; + private final Callback mCallback; private final BLEHandler mBleHandler; private long mClientAddress; + public enum Result { + REGISTER_OK, + REGISTER_ERROR, + SIGN_OK, + SIGN_ERROR, + OTHER, + } + + // Callbacks notifying the UI of certain CableAuthenticator state changes. These may run on any + // thread. + public interface Callback { + // Invoked when the authenticator has completed a handshake with a client device. + void onAuthenticatorConnected(); + // Invoked when the authenticator has finished. The UI should be dismissed at this point. + void onAuthenticatorResult(Result result); + } + public CableAuthenticator(Context context, CableAuthenticatorUI ui) { mContext = context; mUi = ui; + mCallback = ui; mBleHandler = new BLEHandler(this); if (!mBleHandler.start()) { // TODO: handle the case where exporting the GATT server fails. } } + public void onHandshake(long client) { + // TODO: Ensure only a single client may complete a handshake. + mCallback.onAuthenticatorConnected(); + } + public void makeCredential(long clientAddress, String origin, String rpId, byte[] challenge, byte[] userId, int[] algorithms, byte[][] excludedCredentialIds, boolean residentKeyRequired) { @@ -194,25 +218,35 @@ public void onActivityResult(int requestCode, int resultCode, Intent data) { Log.i(TAG, "onActivityResult " + requestCode + " " + resultCode); + Result result = Result.OTHER; switch (requestCode) { case REGISTER_REQUEST_CODE: - onRegisterResponse(resultCode, data); + if (onRegisterResponse(resultCode, data)) { + result = Result.REGISTER_OK; + } else { + result = Result.REGISTER_ERROR; + } break; case SIGN_REQUEST_CODE: - onSignResponse(resultCode, data); + if (onSignResponse(resultCode, data)) { + result = Result.SIGN_OK; + } else { + result = Result.SIGN_ERROR; + } break; default: Log.i(TAG, "invalid requestCode: " + requestCode); assert (false); } + mCallback.onAuthenticatorResult(result); } - public void onRegisterResponse(int resultCode, Intent data) { + public boolean onRegisterResponse(int resultCode, Intent data) { if (resultCode != Activity.RESULT_OK || data == null) { Log.e(TAG, "Failed with result code" + resultCode); mBleHandler.onAuthenticatorAssertionResponse( mClientAddress, CTAP2_ERR_OPERATION_DENIED, null, null, null, null); - return; + return false; } Log.e(TAG, "OK."); @@ -237,7 +271,7 @@ } mBleHandler.onAuthenticatorAttestationResponse( mClientAddress, CTAP2_ERR_OTHER, null, null); - return; + return false; } if (!data.hasExtra(Fido.FIDO2_KEY_RESPONSE_EXTRA) @@ -245,7 +279,7 @@ Log.e(TAG, "Missing FIDO2_KEY_RESPONSE_EXTRA or FIDO2_KEY_CREDENTIAL_EXTRA"); mBleHandler.onAuthenticatorAttestationResponse( mClientAddress, CTAP2_ERR_OTHER, null, null); - return; + return false; } Log.e(TAG, "cred extra"); @@ -256,14 +290,15 @@ data.getByteArrayExtra(Fido.FIDO2_KEY_RESPONSE_EXTRA)); mBleHandler.onAuthenticatorAttestationResponse(mClientAddress, CTAP2_OK, response.getClientDataJSON(), response.getAttestationObject()); + return true; } - public void onSignResponse(int resultCode, Intent data) { + public boolean onSignResponse(int resultCode, Intent data) { if (resultCode != Activity.RESULT_OK || data == null) { Log.e(TAG, "Failed with result code" + resultCode); mBleHandler.onAuthenticatorAssertionResponse( mClientAddress, CTAP2_ERR_OPERATION_DENIED, null, null, null, null); - return; + return false; } Log.e(TAG, "OK."); @@ -288,7 +323,7 @@ } mBleHandler.onAuthenticatorAssertionResponse( mClientAddress, ctap_status, null, null, null, null); - return; + return false; } if (!data.hasExtra(Fido.FIDO2_KEY_RESPONSE_EXTRA) @@ -296,7 +331,7 @@ Log.e(TAG, "Missing FIDO2_KEY_RESPONSE_EXTRA or FIDO2_KEY_CREDENTIAL_EXTRA"); mBleHandler.onAuthenticatorAssertionResponse( mClientAddress, CTAP2_ERR_OTHER, null, null, null, null); - return; + return false; } Log.e(TAG, "cred extra"); @@ -308,6 +343,7 @@ mBleHandler.onAuthenticatorAssertionResponse(mClientAddress, CTAP2_OK, response.getClientDataJSON(), response.getKeyHandle(), response.getAuthenticatorData(), response.getSignature()); + return true; } public void onQRCode(String value) {
diff --git a/chrome/android/features/cablev2_authenticator/internal/java/src/org/chromium/chrome/browser/webauth/authenticator/CableAuthenticatorUI.java b/chrome/android/features/cablev2_authenticator/internal/java/src/org/chromium/chrome/browser/webauth/authenticator/CableAuthenticatorUI.java index a3b1d369..298744a0 100644 --- a/chrome/android/features/cablev2_authenticator/internal/java/src/org/chromium/chrome/browser/webauth/authenticator/CableAuthenticatorUI.java +++ b/chrome/android/features/cablev2_authenticator/internal/java/src/org/chromium/chrome/browser/webauth/authenticator/CableAuthenticatorUI.java
@@ -11,29 +11,37 @@ import android.content.Intent; import android.content.pm.PackageManager; import android.os.Bundle; +import android.view.Gravity; import android.view.LayoutInflater; import android.view.View; import android.view.View.OnClickListener; import android.view.ViewGroup; -import android.widget.Button; import android.widget.LinearLayout; import android.widget.ProgressBar; +import android.widget.TextView; import androidx.fragment.app.Fragment; +import org.chromium.chrome.R; import org.chromium.ui.base.ActivityAndroidPermissionDelegate; import org.chromium.ui.base.AndroidPermissionDelegate; +import org.chromium.ui.widget.ButtonCompat; +import org.chromium.ui.widget.Toast; import java.lang.ref.WeakReference; /** * A fragment that provides a UI for scanning caBLE v2 QR codes. */ -public class CableAuthenticatorUI - extends Fragment implements OnClickListener, QRScanDialog.Callback { +public class CableAuthenticatorUI extends Fragment + implements OnClickListener, QRScanDialog.Callback, CableAuthenticator.Callback { private AndroidPermissionDelegate mPermissionDelegate; private CableAuthenticator mAuthenticator; + private ButtonCompat mQRButton; + private ProgressBar mSpinner; + private TextView mStatus; + @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); @@ -47,26 +55,40 @@ @SuppressLint("SetTextI18n") public View onCreateView( LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { - // Shows a placeholder UI that provides a button for scanning QR codes - // and a very basic animation for the rest of the screen. + // Shows a placeholder UI that provides a very basic animation and status text informing of + // progress, as well as a button to scan QR codes. // TODO: should check FEATURE_BLUETOOTH with // https://developer.android.com/reference/android/content/pm/PackageManager.html#hasSystemFeature(java.lang.String) - final Context context = getContext(); - Button button = new Button(context); // TODO: strings should be translated but this will be replaced during // the UI process. - button.setText("Scan QR code"); - button.setOnClickListener(this); + getActivity().setTitle("Security Key"); + + final Context context = getContext(); + + ProgressBar mSpinner = new ProgressBar(context); + mSpinner.setIndeterminate(true); + mSpinner.setPadding(0, 60, 0, 60); + + mStatus = new TextView(context); + mStatus.setText("Looking for known devices nearby"); + mStatus.setPadding(0, 60, 0, 60); + + mQRButton = new ButtonCompat(context, R.style.TextButtonThemeOverlay); + mQRButton.setText("Connect a new device"); + mQRButton.setOnClickListener(this); LinearLayout layout = new LinearLayout(context); layout.setOrientation(LinearLayout.VERTICAL); - layout.addView(button); - // A ProgressBar is included for now. This is in lieu of a future, - // real UI. - ProgressBar spinner = new ProgressBar(context); - spinner.setIndeterminate(true); - layout.addView(spinner); + layout.setGravity(Gravity.CENTER_HORIZONTAL); + layout.addView(mSpinner); + layout.addView(mStatus, + new LinearLayout.LayoutParams(LinearLayout.LayoutParams.WRAP_CONTENT, + LinearLayout.LayoutParams.WRAP_CONTENT)); + layout.addView(mQRButton, + new LinearLayout.LayoutParams(LinearLayout.LayoutParams.WRAP_CONTENT, + LinearLayout.LayoutParams.WRAP_CONTENT)); + return layout; } @@ -102,7 +124,9 @@ * Called when the camera has scanned a FIDO QR code. */ @Override + @SuppressLint("SetTextI18n") public void onQRCode(String value) { + mStatus.setText("Looking for your new device nearby"); mAuthenticator.onQRCode(value); } @@ -131,4 +155,39 @@ super.onActivityResult(requestCode, resultCode, data); mAuthenticator.onActivityResult(requestCode, resultCode, data); } + + @Override + @SuppressLint("SetTextI18n") + public void onAuthenticatorConnected() { + getActivity().runOnUiThread(() -> { + mStatus.setText("Connected. Verifying it's you."); + mQRButton.setEnabled(false); + }); + } + + @Override + public void onAuthenticatorResult(CableAuthenticator.Result result) { + getActivity().runOnUiThread(() -> { + // TODO: Temporary UI, needs i18n. + String toast = "An error occured. Please try again."; + switch (result) { + case REGISTER_OK: + toast = "Registration succeeded"; + break; + case REGISTER_ERROR: + toast = "Registration failed"; + break; + case SIGN_OK: + toast = "Sign-in succeeded"; + break; + case SIGN_ERROR: + toast = "Sign-in failed"; + break; + case OTHER: + break; + } + Toast.makeText(getActivity(), toast, Toast.LENGTH_SHORT).show(); + getActivity().finish(); + }); + } }
diff --git a/chrome/android/features/cablev2_authenticator/internal/native/cablev2_authenticator_android.cc b/chrome/android/features/cablev2_authenticator/internal/native/cablev2_authenticator_android.cc index 3b88fc9..e4808aa 100644 --- a/chrome/android/features/cablev2_authenticator/internal/native/cablev2_authenticator_android.cc +++ b/chrome/android/features/cablev2_authenticator/internal/native/cablev2_authenticator_android.cc
@@ -284,8 +284,9 @@ class Delegate { public: virtual ~Delegate() = default; + virtual void OnHandshake(Client* client) = 0; virtual void MakeCredential( - uint64_t client_addr, + Client* client, const std::string& origin, const std::string& rp_id, base::span<const uint8_t> challenge, @@ -294,7 +295,7 @@ base::span<std::vector<uint8_t>> excluded_credential_ids, bool resident_key_required) = 0; virtual void GetAssertion( - uint64_t client_addr, + Client* client, const std::string& origin, const std::string& rp_id, base::span<const uint8_t> challenge, @@ -335,6 +336,8 @@ return fragments; } + uint64_t addr() { return addr_; } + private: enum State { kHandshake, @@ -409,6 +412,7 @@ } crypter_ = std::move(handshake_result.value()); state_ = State::kConnected; + delegate_->OnHandshake(this); break; } @@ -536,7 +540,7 @@ // TODO: plumb the rk flag through once GmsCore supports resident // keys. This will require support for optional maps in |Extract|. delegate_->MakeCredential( - addr_, *make_cred_request.origin, *make_cred_request.rp_id, + this, *make_cred_request.origin, *make_cred_request.rp_id, *make_cred_request.challenge, *make_cred_request.user_id, algorithms, excluded_credential_ids, /*resident_key=*/false); @@ -575,7 +579,7 @@ return false; } - delegate_->GetAssertion(addr_, *get_assertion_request.origin, + delegate_->GetAssertion(this, *get_assertion_request.origin, *get_assertion_request.rp_id, *get_assertion_request.challenge, allowed_credential_ids); @@ -778,7 +782,12 @@ env_, response_fragments ? *response_fragments : kEmptyFragments); } - void MakeCredential(uint64_t client_addr, + void OnHandshake(Client* client) override { + // TODO: ignore other clients and disconnect them + Java_BLEHandler_onHandshake(env_, ble_handler_, client->addr()); + } + + void MakeCredential(Client* client, const std::string& origin, const std::string& rp_id, base::span<const uint8_t> challenge, @@ -787,7 +796,8 @@ base::span<std::vector<uint8_t>> excluded_credential_ids, bool resident_key_required) override { Java_BLEHandler_makeCredential( - env_, ble_handler_, client_addr, ConvertUTF8ToJavaString(env_, origin), + env_, ble_handler_, client->addr(), + ConvertUTF8ToJavaString(env_, origin), ConvertUTF8ToJavaString(env_, rp_id), ToJavaByteArray(env_, challenge), // TODO: Pass full user entity once resident key support is added. ToJavaByteArray(env_, user_id), ToJavaIntArray(env_, algorithms), @@ -796,13 +806,14 @@ } void GetAssertion( - uint64_t client_addr, + Client* client, const std::string& origin, const std::string& rp_id, base::span<const uint8_t> challenge, base::span<std::vector<uint8_t>> allowed_credential_ids) override { Java_BLEHandler_getAssertion( - env_, ble_handler_, client_addr, ConvertUTF8ToJavaString(env_, origin), + env_, ble_handler_, client->addr(), + ConvertUTF8ToJavaString(env_, origin), ConvertUTF8ToJavaString(env_, rp_id), ToJavaByteArray(env_, challenge), ToJavaArrayOfByteArray(env_, allowed_credential_ids)); }
diff --git a/chrome/android/features/keyboard_accessory/javatests/src/org/chromium/chrome/browser/keyboard_accessory/PasswordGenerationIntegrationTest.java b/chrome/android/features/keyboard_accessory/javatests/src/org/chromium/chrome/browser/keyboard_accessory/PasswordGenerationIntegrationTest.java index c95c6eb..fadcec5e 100644 --- a/chrome/android/features/keyboard_accessory/javatests/src/org/chromium/chrome/browser/keyboard_accessory/PasswordGenerationIntegrationTest.java +++ b/chrome/android/features/keyboard_accessory/javatests/src/org/chromium/chrome/browser/keyboard_accessory/PasswordGenerationIntegrationTest.java
@@ -110,6 +110,7 @@ @Test @IntegrationTest + @DisabledTest(message = "crbug.com/1067171") public void testAutomaticGenerationUsePassword() throws InterruptedException, TimeoutException { waitForGenerationLabel(); focusField(PASSWORD_NODE_ID);
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/contextmenu/ContextMenuHelper.java b/chrome/android/java/src/org/chromium/chrome/browser/contextmenu/ContextMenuHelper.java index d9c818d..6142eef 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/contextmenu/ContextMenuHelper.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/contextmenu/ContextMenuHelper.java
@@ -63,6 +63,7 @@ * See function for details. */ private static byte[] sHardcodedImageBytesForTesting; + private static String sHardcodedImageExtensionForTesting; /** * The tests trigger the context menu via JS rather than via a true native call which means @@ -70,9 +71,13 @@ * test cases to hardcode the test image bytes that will be shared. * @param hardcodedImageBytes The hard coded image bytes to fake or null if image should not be * faked. + * @param hardcodedImageExtension The hard coded image extension. */ - public static void setHardcodedImageBytesForTesting(byte[] hardcodedImageBytes) { + @VisibleForTesting + public static void setHardcodedImageBytesForTesting( + byte[] hardcodedImageBytes, String hardcodedImageExtension) { sHardcodedImageBytesForTesting = hardcodedImageBytes; + sHardcodedImageExtensionForTesting = hardcodedImageExtension; } private ContextMenuHelper(long nativeContextMenuHelper, WebContents webContents) { @@ -220,7 +225,7 @@ * @param isIncognito Whether the image to search came from an incognito context. */ public void searchWithGoogleLens(boolean isIncognito) { - retrieveImage((Uri imageUri) -> { + retrieveImage(ContextMenuImageFormat.PNG, (Uri imageUri) -> { ShareHelper.shareImageWithGoogleLens(mWindow, imageUri, isIncognito); }); } @@ -239,7 +244,8 @@ * it will use the right activity set when the menu was displayed. */ void shareImage() { - retrieveImage((Uri imageUri) -> { ShareHelper.shareImage(mWindow, null, imageUri); }); + retrieveImage(ContextMenuImageFormat.ORIGINAL, + (Uri imageUri) -> { ShareHelper.shareImage(mWindow, null, imageUri); }); } /** @@ -248,14 +254,15 @@ * the clipboard. */ void copyImageToClipboard(ContextMenuItemDelegate delegate) { - retrieveImage((Uri imageUri) -> { delegate.onSaveImageToClipboard(imageUri); }); + retrieveImage(ContextMenuImageFormat.ORIGINAL, + (Uri imageUri) -> { delegate.onSaveImageToClipboard(imageUri); }); } /** * Share the image that triggered the current context menu with the last app used to share. */ private void shareImageWithLastShareComponent() { - retrieveImage((Uri imageUri) -> { + retrieveImage(ContextMenuImageFormat.ORIGINAL, (Uri imageUri) -> { ShareHelper.shareImage( mWindow, ShareHelper.getLastShareByChromeComponentName(), imageUri); }); @@ -264,25 +271,28 @@ /** * Retrieves a URI for the selected image for sharing with external apps. If the function fails * to retrieve the image bytes or generate a URI the callback will *not* be called. - * @param callback Called once the the image is generated and ready to be shared. + * @param imageFormat The image format will be requested. + * @param callback Called once the image is generated and ready to be shared. */ - private void retrieveImage(Callback<Uri> callback) { + private void retrieveImage(@ContextMenuImageFormat int imageFormat, Callback<Uri> callback) { if (mNativeContextMenuHelper == 0) return; - Callback<byte[]> imageRetrievalCallback = new Callback<byte[]>() { + Callback<ImageCallbackResult> imageRetrievalCallback = new Callback<ImageCallbackResult>() { @Override - public void onResult(byte[] result) { + public void onResult(ImageCallbackResult result) { if (mActivity == null) return; - ShareImageFileUtils.generateTemporaryUriFromData(mActivity, result, callback); + ShareImageFileUtils.generateTemporaryUriFromData( + mActivity, result.imageData, result.extension, callback); } }; if (sHardcodedImageBytesForTesting != null) { - imageRetrievalCallback.onResult(sHardcodedImageBytesForTesting); + imageRetrievalCallback.onResult(createImageCallbackResult( + sHardcodedImageBytesForTesting, sHardcodedImageExtensionForTesting)); } else { ContextMenuHelperJni.get().retrieveImageForShare(mNativeContextMenuHelper, ContextMenuHelper.this, imageRetrievalCallback, MAX_SHARE_DIMEN_PX, - MAX_SHARE_DIMEN_PX); + MAX_SHARE_DIMEN_PX, imageFormat); } } @@ -341,13 +351,33 @@ return mPopulator; } + /** + * The class hold the |retrieveImageForShare| callback result. + */ + public static class ImageCallbackResult { + public byte[] imageData; + public String extension; + + public ImageCallbackResult(byte[] imageData, String extension) { + this.imageData = imageData; + this.extension = extension; + } + } + + @CalledByNative + private static ImageCallbackResult createImageCallbackResult( + byte[] imageData, String extension) { + return new ContextMenuHelper.ImageCallbackResult(imageData, extension); + } + @NativeMethods interface Natives { void onStartDownload(long nativeContextMenuHelper, ContextMenuHelper caller, boolean isLink, boolean isDataReductionProxyEnabled); void searchForImage(long nativeContextMenuHelper, ContextMenuHelper caller); void retrieveImageForShare(long nativeContextMenuHelper, ContextMenuHelper caller, - Callback<byte[]> callback, int maxWidthPx, int maxHeightPx); + Callback<ImageCallbackResult> callback, int maxWidthPx, int maxHeightPx, + @ContextMenuImageFormat int imageFormat); void retrieveImageForContextMenu(long nativeContextMenuHelper, ContextMenuHelper caller, Callback<Bitmap> callback, int maxWidthPx, int maxHeightPx); void onContextMenuClosed(long nativeContextMenuHelper, ContextMenuHelper caller);
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/device_dialog/BluetoothChooserDialog.java b/chrome/android/java/src/org/chromium/chrome/browser/device_dialog/BluetoothChooserDialog.java index 4a90000..3f777dc 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/device_dialog/BluetoothChooserDialog.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/device_dialog/BluetoothChooserDialog.java
@@ -188,7 +188,10 @@ @VisibleForTesting void show() { // Emphasize the origin. - Profile profile = Profile.getLastUsedProfile(); + // TODO (https://crbug.com/1048632): Use the current profile (i.e., regular profile or + // incognito profile) instead of always using regular profile. It works correctly now, but + // it is not safe. + Profile profile = Profile.getLastUsedRegularProfile(); SpannableString origin = new SpannableString(mOrigin); assert mActivity instanceof ChromeBaseAppCompatActivity;
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/device_dialog/BluetoothScanningPermissionDialog.java b/chrome/android/java/src/org/chromium/chrome/browser/device_dialog/BluetoothScanningPermissionDialog.java index 850dcc4..585f204 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/device_dialog/BluetoothScanningPermissionDialog.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/device_dialog/BluetoothScanningPermissionDialog.java
@@ -97,7 +97,10 @@ mNativeBluetoothScanningPermissionDialogPtr = nativeBluetoothScanningPermissionDialogPtr; // Emphasize the origin. - Profile profile = Profile.getLastUsedProfile(); + // TODO (https://crbug.com/1048632): Use the current profile (i.e., regular profile or + // incognito profile) instead of always using regular profile. It works correctly now, but + // it is not safe. + Profile profile = Profile.getLastUsedRegularProfile(); SpannableString originSpannableString = new SpannableString(origin); assert mActivity instanceof ChromeBaseAppCompatActivity;
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/device_dialog/UsbChooserDialog.java b/chrome/android/java/src/org/chromium/chrome/browser/device_dialog/UsbChooserDialog.java index 94ab16f4..ba698ee 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/device_dialog/UsbChooserDialog.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/device_dialog/UsbChooserDialog.java
@@ -56,7 +56,10 @@ @VisibleForTesting void show(Activity activity, String origin, int securityLevel) { // Emphasize the origin. - Profile profile = Profile.getLastUsedProfile(); + // TODO (https://crbug.com/1048632): Use the current profile (i.e., regular profile or + // incognito profile) instead of always using regular profile. It works correctly now, but + // it is not safe. + Profile profile = Profile.getLastUsedRegularProfile(); SpannableString originSpannableString = new SpannableString(origin); assert activity instanceof ChromeBaseAppCompatActivity;
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/native_page/NativePageFactory.java b/chrome/android/java/src/org/chromium/chrome/browser/native_page/NativePageFactory.java index 0c7ff63..39436d7 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/native_page/NativePageFactory.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/native_page/NativePageFactory.java
@@ -20,6 +20,7 @@ import org.chromium.chrome.browser.feed.FeedNewTabPage; import org.chromium.chrome.browser.flags.ChromeFeatureList; import org.chromium.chrome.browser.fullscreen.ChromeFullscreenManager; +import org.chromium.chrome.browser.history.HistoryManagerUtils; import org.chromium.chrome.browser.history.HistoryPage; import org.chromium.chrome.browser.lifecycle.ActivityLifecycleDispatcher; import org.chromium.chrome.browser.ntp.IncognitoNewTabPage; @@ -85,8 +86,9 @@ } protected NativePage buildRecentTabsPage(ChromeActivity activity, Tab tab) { - RecentTabsManager recentTabsManager = new RecentTabsManager( - tab, Profile.fromWebContents(tab.getWebContents()), activity); + RecentTabsManager recentTabsManager = + new RecentTabsManager(tab, Profile.fromWebContents(tab.getWebContents()), + activity, () -> HistoryManagerUtils.showHistoryManager(activity, tab)); return new RecentTabsPage( activity, recentTabsManager, new TabShim(tab, activity.getFullscreenManager())); }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ntp/RecentTabsManager.java b/chrome/android/java/src/org/chromium/chrome/browser/ntp/RecentTabsManager.java index 758885d..248bf5e2 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/ntp/RecentTabsManager.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/ntp/RecentTabsManager.java
@@ -13,7 +13,6 @@ import org.chromium.base.metrics.RecordUserAction; import org.chromium.base.task.PostTask; import org.chromium.chrome.R; -import org.chromium.chrome.browser.history.HistoryManagerUtils; import org.chromium.chrome.browser.invalidation.SessionsInvalidationManager; import org.chromium.chrome.browser.ntp.ForeignSessionHelper.ForeignSession; import org.chromium.chrome.browser.ntp.ForeignSessionHelper.ForeignSessionTab; @@ -26,7 +25,6 @@ import org.chromium.chrome.browser.signin.SigninPromoController; import org.chromium.chrome.browser.signin.SigninPromoUtil; import org.chromium.chrome.browser.tab.Tab; -import org.chromium.chrome.browser.tab.TabImpl; import org.chromium.chrome.browser.ui.favicon.FaviconHelper; import org.chromium.chrome.browser.ui.favicon.FaviconHelper.FaviconImageCallback; import org.chromium.components.signin.AccountManagerFacadeProvider; @@ -69,6 +67,7 @@ private final Profile mProfile; private final Tab mTab; + private final Runnable mShowHistoryManager; private FaviconHelper mFaviconHelper; private ForeignSessionHelper mForeignSessionHelper; @@ -89,10 +88,13 @@ * @param tab The Tab that is showing this recent tabs page. * @param profile Profile that is associated with the current session. * @param context the Android context this manager will work in. + * @param showHistoryManager Runnable showing history manager UI. */ - public RecentTabsManager(Tab tab, Profile profile, Context context) { + public RecentTabsManager( + Tab tab, Profile profile, Context context, Runnable showHistoryManager) { mProfile = profile; mTab = tab; + mShowHistoryManager = showHistoryManager; mForeignSessionHelper = new ForeignSessionHelper(profile); mPrefs = new RecentTabsPagePrefs(profile); mFaviconHelper = new FaviconHelper(); @@ -223,7 +225,7 @@ */ public void openHistoryPage() { if (mIsDestroyed) return; - HistoryManagerUtils.showHistoryManager(((TabImpl) mTab).getActivity(), mTab); + mShowHistoryManager.run(); } /**
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ntp/RecentTabsPage.java b/chrome/android/java/src/org/chromium/chrome/browser/ntp/RecentTabsPage.java index ea85b2a..ba4c67d 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/ntp/RecentTabsPage.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/ntp/RecentTabsPage.java
@@ -8,7 +8,6 @@ import android.content.res.Resources; import android.graphics.Canvas; import android.graphics.Color; -import android.os.SystemClock; import android.view.ContextMenu; import android.view.ContextMenu.ContextMenuInfo; import android.view.LayoutInflater; @@ -20,7 +19,6 @@ import org.chromium.base.ActivityState; import org.chromium.base.ApplicationStatus; -import org.chromium.base.metrics.RecordHistogram; import org.chromium.chrome.R; import org.chromium.chrome.browser.ChromeActivity; import org.chromium.chrome.browser.compositor.layouts.content.InvalidationAwareThumbnailProvider; @@ -69,13 +67,6 @@ private boolean mIsAttachedToWindow; /** - * The time, whichever is most recent, that the page: - * - Moved to the foreground - * - Became visible - */ - private long mForegroundTimeMs; - - /** * Constructor returns an instance of RecentTabsPage. * * @param activity The activity this view belongs to. @@ -132,11 +123,7 @@ mInForeground = inForeground; if (mInForeground) { - mForegroundTimeMs = SystemClock.elapsedRealtime(); mRecentTabsManager.recordRecentTabMetrics(); - } else { - RecordHistogram.recordLongTimesHistogram("NewTabPage.RecentTabsPage.TimeVisibleAndroid", - SystemClock.elapsedRealtime() - mForegroundTimeMs); } }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/offlinepages/OfflinePageTabObserver.java b/chrome/android/java/src/org/chromium/chrome/browser/offlinepages/OfflinePageTabObserver.java index f0744e30..411f922 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/offlinepages/OfflinePageTabObserver.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/offlinepages/OfflinePageTabObserver.java
@@ -17,7 +17,6 @@ import org.chromium.chrome.browser.tab.EmptyTabObserver; import org.chromium.chrome.browser.tab.Tab; import org.chromium.chrome.browser.tab.TabHidingType; -import org.chromium.chrome.browser.tab.TabImpl; import org.chromium.chrome.browser.tab.TabSelectionType; import org.chromium.chrome.browser.tabmodel.TabModelObserver; import org.chromium.chrome.browser.tabmodel.TabModelSelector; @@ -112,7 +111,8 @@ * @param tab The tab we are adding an observer for. */ public static void addObserverForTab(Tab tab) { - OfflinePageTabObserver observer = getObserverForActivity(((TabImpl) tab).getActivity()); + OfflinePageTabObserver observer = + getObserverForActivity((ChromeActivity) tab.getWindowAndroid().getActivity().get()); observer.startObservingTab(tab); observer.maybeShowReloadSnackbar(tab, false); } @@ -295,7 +295,7 @@ @VisibleForTesting void showReloadSnackbar(Tab tab) { OfflinePageUtils.showReloadSnackbar( - ((TabImpl) tab).getActivity(), mSnackbarManager, mSnackbarController, tab.getId()); + tab.getContext(), mSnackbarManager, mSnackbarController, tab.getId()); } @VisibleForTesting
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/page_info/PermissionParamsListBuilder.java b/chrome/android/java/src/org/chromium/chrome/browser/page_info/PermissionParamsListBuilder.java index d471aff6..6da3f633 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/page_info/PermissionParamsListBuilder.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/page_info/PermissionParamsListBuilder.java
@@ -18,10 +18,10 @@ import org.chromium.base.Callback; import org.chromium.chrome.R; import org.chromium.chrome.browser.browserservices.permissiondelegation.TrustedWebActivityPermissionManager; -import org.chromium.chrome.browser.flags.ChromeFeatureList; import org.chromium.chrome.browser.site_settings.ContentSettingValues; import org.chromium.chrome.browser.site_settings.ContentSettingsResources; import org.chromium.chrome.browser.site_settings.WebsitePreferenceBridge; +import org.chromium.components.browser_ui.site_settings.SiteSettingsFeatureList; import org.chromium.components.content_settings.ContentSettingsType; import org.chromium.components.embedder_support.util.Origin; import org.chromium.components.location.LocationUtils; @@ -183,7 +183,8 @@ private boolean shouldShowNotificationsDisabledWarning(PageInfoPermissionEntry permission) { return permission.type == ContentSettingsType.NOTIFICATIONS && !NotificationManagerCompat.from(mContext).areNotificationsEnabled() - && ChromeFeatureList.isEnabled(ChromeFeatureList.APP_NOTIFICATION_STATUS_MESSAGING); + && SiteSettingsFeatureList.isEnabled( + SiteSettingsFeatureList.APP_NOTIFICATION_STATUS_MESSAGING); } private boolean hasAndroidPermission(int contentSettingType) {
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/payments/PaymentRequestImpl.java b/chrome/android/java/src/org/chromium/chrome/browser/payments/PaymentRequestImpl.java index 9d354ad..b84a18b 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/payments/PaymentRequestImpl.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/payments/PaymentRequestImpl.java
@@ -899,6 +899,7 @@ SecurityStateModel.getSecurityLevelForWebContents( mWebContents, ChromeSecurityStateModelDelegate.getInstance()), new ShippingStrings(mShippingType), mPaymentUisShowStateReconciler); + activity.getLifecycleDispatcher().register(mUI); // TODO(https://crbug.com/1048632): Use the current profile (i.e., regular profile or // incognito profile) instead of always using regular profile. It works correctly now, but @@ -2991,6 +2992,10 @@ mClient.onComplete(); } closeClient(); + ChromeActivity activity = ChromeActivity.fromWebContents(mWebContents); + if (activity != null) { + activity.getLifecycleDispatcher().unregister(mUI); + } mUI = null; mPaymentUisShowStateReconciler.onPaymentRequestUiClosed(); }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/payments/ui/DimmingDialog.java b/chrome/android/java/src/org/chromium/chrome/browser/payments/ui/DimmingDialog.java index 14d6402e..9c8830e0 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/payments/ui/DimmingDialog.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/payments/ui/DimmingDialog.java
@@ -257,4 +257,11 @@ public Dialog getDialogForTest() { return mDialog; } + + /** + * Force the Dialog window to refresh its visual state. + */ + /* package */ void refresh() { + mDialog.getWindow().setAttributes(mDialog.getWindow().getAttributes()); + } }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/payments/ui/PaymentRequestUI.java b/chrome/android/java/src/org/chromium/chrome/browser/payments/ui/PaymentRequestUI.java index 60f1383b..bc5a548 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/payments/ui/PaymentRequestUI.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/payments/ui/PaymentRequestUI.java
@@ -41,6 +41,7 @@ import org.chromium.chrome.browser.autofill.prefeditor.EditorDialog; import org.chromium.chrome.browser.autofill.prefeditor.EditorObserverForTest; import org.chromium.chrome.browser.flags.ChromeFeatureList; +import org.chromium.chrome.browser.lifecycle.PauseResumeWithNativeObserver; import org.chromium.chrome.browser.payments.PaymentApp; import org.chromium.chrome.browser.payments.PaymentRequestImpl.PaymentUisShowStateReconciler; import org.chromium.chrome.browser.payments.ShippingStrings; @@ -66,7 +67,8 @@ * The PaymentRequest UI. */ public class PaymentRequestUI implements DimmingDialog.OnDismissListener, View.OnClickListener, - PaymentRequestSection.SectionDelegate { + PaymentRequestSection.SectionDelegate, + PauseResumeWithNativeObserver { @IntDef({DataType.SHIPPING_ADDRESSES, DataType.SHIPPING_OPTIONS, DataType.CONTACT_DETAILS, DataType.PAYMENT_METHODS}) @Retention(RetentionPolicy.SOURCE) @@ -1440,4 +1442,18 @@ mDialog.hide(); } } + + // Implement PauseResumeWithNativeObserver: + @Override + public void onResumeWithNative() { + // When users come back from an external activity (e.g., app-picker/webauthn), the PR UI + // somehow shows up even though it's set to GONE (crbug.com/1030416 and + // crbug.com/1051786). Here we use a workaround to fix it - refresh the dialog window + // from time to time to force the visual state to respect its visibility attribute. + mDialog.refresh(); + } + + // Implement PauseResumeWithNativeObserver: + @Override + public void onPauseWithNative() {} }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/site_settings/NotificationCategory.java b/chrome/android/java/src/org/chromium/chrome/browser/site_settings/NotificationCategory.java index 442527c..9d6b70a6 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/site_settings/NotificationCategory.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/site_settings/NotificationCategory.java
@@ -8,7 +8,7 @@ import androidx.core.app.NotificationManagerCompat; -import org.chromium.chrome.browser.flags.ChromeFeatureList; +import org.chromium.components.browser_ui.site_settings.SiteSettingsFeatureList; /** * Enables custom implementation for the notification site settings category, similar to @@ -24,7 +24,8 @@ @Override protected boolean enabledForChrome(Context context) { - if (!ChromeFeatureList.isEnabled(ChromeFeatureList.APP_NOTIFICATION_STATUS_MESSAGING)) { + if (!SiteSettingsFeatureList.isEnabled( + SiteSettingsFeatureList.APP_NOTIFICATION_STATUS_MESSAGING)) { return super.enabledForChrome(context); } NotificationManagerCompat manager = NotificationManagerCompat.from(context);
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/TabsTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/TabsTest.java index cb632db..5df557a 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/TabsTest.java +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/TabsTest.java
@@ -1457,13 +1457,8 @@ @MediumTest @Feature({"Android-TabSwitcher"}) @Restriction(RESTRICTION_TYPE_NON_LOW_END_DEVICE) - @RetryOnFailure - @DisabledTest(message = "https://crbug.com/947694") public void testToolbarSwipeOnlyTab() throws TimeoutException { - final TabModel tabModel = - mActivityTestRule.getActivity().getTabModelSelector().getModel(false); - - Assert.assertEquals("Incorrect starting index", 0, tabModel.index()); + initToolbarSwipeTest(false, 0, false); runToolbarSideSwipeTestOnCurrentModel(ScrollDirection.RIGHT, 0, false); runToolbarSideSwipeTestOnCurrentModel(ScrollDirection.LEFT, 0, false); } @@ -1472,16 +1467,8 @@ @MediumTest @Feature({"Android-TabSwitcher"}) @Restriction(RESTRICTION_TYPE_NON_LOW_END_DEVICE) - public void testToolbarSwipePrevTab() throws InterruptedException, TimeoutException { - mActivityTestRule.loadUrl(generateSolidColorUrl("#00ff00")); - mActivityTestRule.loadUrlInNewTab(generateSolidColorUrl("#0000ff")); - UiUtils.settleDownUI(InstrumentationRegistry.getInstrumentation()); - - final TabModel tabModel = - mActivityTestRule.getActivity().getTabModelSelector().getModel(false); - - Assert.assertEquals("Incorrect starting index", 1, tabModel.index()); - Assert.assertEquals("Incorrect tab count.", 2, tabModel.getCount()); + public void testToolbarSwipePrevTab() throws TimeoutException { + initToolbarSwipeTest(true, 1, false); runToolbarSideSwipeTestOnCurrentModel(ScrollDirection.RIGHT, 0, true); } @@ -1489,17 +1476,8 @@ @MediumTest @Feature({"Android-TabSwitcher"}) @Restriction(RESTRICTION_TYPE_NON_LOW_END_DEVICE) - public void testToolbarSwipeNextTab() throws InterruptedException, TimeoutException { - mActivityTestRule.loadUrl(generateSolidColorUrl("#00ff00")); - mActivityTestRule.loadUrlInNewTab(generateSolidColorUrl("#0000ff")); - ChromeTabUtils.switchTabInCurrentTabModel(mActivityTestRule.getActivity(), 0); - UiUtils.settleDownUI(InstrumentationRegistry.getInstrumentation()); - - final TabModel tabModel = - mActivityTestRule.getActivity().getTabModelSelector().getModel(false); - - Assert.assertEquals("Incorrect starting index.", 0, tabModel.index()); - Assert.assertEquals("Incorrect tab count.", 2, tabModel.getCount()); + public void testToolbarSwipeNextTab() throws TimeoutException { + initToolbarSwipeTest(true, 0, false); runToolbarSideSwipeTestOnCurrentModel(ScrollDirection.LEFT, 1, true); } @@ -1507,17 +1485,8 @@ @MediumTest @Feature({"Android-TabSwitcher"}) @Restriction(RESTRICTION_TYPE_NON_LOW_END_DEVICE) - @RetryOnFailure - public void testToolbarSwipePrevTabNone() throws InterruptedException, TimeoutException { - ChromeTabUtils.newTabFromMenu( - InstrumentationRegistry.getInstrumentation(), mActivityTestRule.getActivity()); - ChromeTabUtils.switchTabInCurrentTabModel(mActivityTestRule.getActivity(), 0); - UiUtils.settleDownUI(InstrumentationRegistry.getInstrumentation()); - - final TabModel tabModel = - mActivityTestRule.getActivity().getTabModelSelector().getModel(false); - - Assert.assertEquals("Incorrect starting index", 0, tabModel.index()); + public void testToolbarSwipePrevTabNone() throws TimeoutException { + initToolbarSwipeTest(true, 0, false); runToolbarSideSwipeTestOnCurrentModel(ScrollDirection.RIGHT, 0, false); } @@ -1525,17 +1494,8 @@ @MediumTest @Feature({"Android-TabSwitcher"}) @Restriction(RESTRICTION_TYPE_NON_LOW_END_DEVICE) - @RetryOnFailure - @DisabledTest(message = "https://crbug.com/947694") - public void testToolbarSwipeNextTabNone() throws InterruptedException, TimeoutException { - ChromeTabUtils.newTabFromMenu( - InstrumentationRegistry.getInstrumentation(), mActivityTestRule.getActivity()); - UiUtils.settleDownUI(InstrumentationRegistry.getInstrumentation()); - - final TabModel tabModel = - mActivityTestRule.getActivity().getTabModelSelector().getModel(false); - - Assert.assertEquals("Incorrect starting index", 1, tabModel.index()); + public void testToolbarSwipeNextTabNone() throws TimeoutException { + initToolbarSwipeTest(true, 1, false); runToolbarSideSwipeTestOnCurrentModel(ScrollDirection.LEFT, 1, false); } @@ -1543,21 +1503,15 @@ @MediumTest @Feature({"Android-TabSwitcher"}) @Restriction(RESTRICTION_TYPE_NON_LOW_END_DEVICE) - @RetryOnFailure - @DisabledTest(message = "crbug.com/882003") - public void testToolbarSwipeNextThenPrevTab() throws InterruptedException, TimeoutException { - ChromeTabUtils.fullyLoadUrlInNewTab(InstrumentationRegistry.getInstrumentation(), - mActivityTestRule.getActivity(), UrlConstants.CHROME_BLANK_URL, false); - ChromeTabUtils.switchTabInCurrentTabModel(mActivityTestRule.getActivity(), 0); - UiUtils.settleDownUI(InstrumentationRegistry.getInstrumentation()); + public void testToolbarSwipeNextThenPrevTab() throws TimeoutException { + initToolbarSwipeTest(true, 0, false); + + runToolbarSideSwipeTestOnCurrentModel(ScrollDirection.LEFT, 1, true); final TabModel tabModel = mActivityTestRule.getActivity().getTabModelSelector().getModel(false); + Assert.assertEquals("Incorrect tab index after first swipe.", 1, tabModel.index()); - Assert.assertEquals("Incorrect starting index", 0, tabModel.index()); - runToolbarSideSwipeTestOnCurrentModel(ScrollDirection.LEFT, 1, true); - - Assert.assertEquals("Incorrect starting index", 1, tabModel.index()); runToolbarSideSwipeTestOnCurrentModel(ScrollDirection.RIGHT, 0, true); } @@ -1565,28 +1519,52 @@ @MediumTest @Feature({"Android-TabSwitcher"}) @Restriction(RESTRICTION_TYPE_NON_LOW_END_DEVICE) - @RetryOnFailure - @DisabledTest(message = "crbug.com/882003") - public void testToolbarSwipeNextThenPrevTabIncognito() - throws InterruptedException, TimeoutException { - ChromeTabUtils.fullyLoadUrlInNewTab(InstrumentationRegistry.getInstrumentation(), - mActivityTestRule.getActivity(), UrlConstants.CHROME_BLANK_URL, true); - ChromeTabUtils.fullyLoadUrlInNewTab(InstrumentationRegistry.getInstrumentation(), - mActivityTestRule.getActivity(), UrlConstants.CHROME_BLANK_URL, true); - mActivityTestRule.getActivity().getTabModelSelector().selectModel(true); - ChromeTabUtils.switchTabInCurrentTabModel(mActivityTestRule.getActivity(), 0); - UiUtils.settleDownUI(InstrumentationRegistry.getInstrumentation()); + public void testToolbarSwipeNextThenPrevTabIncognito() throws TimeoutException { + initToolbarSwipeTest(true, 0, true); + + runToolbarSideSwipeTestOnCurrentModel(ScrollDirection.LEFT, 1, true); final TabModel tabModel = mActivityTestRule.getActivity().getTabModelSelector().getModel(true); + Assert.assertEquals("Incorrect tab index after first swipe.", 1, tabModel.index()); - Assert.assertEquals("Incorrect starting index", 0, tabModel.index()); - runToolbarSideSwipeTestOnCurrentModel(ScrollDirection.LEFT, 1, true); - - Assert.assertEquals("Incorrect starting index", 1, tabModel.index()); runToolbarSideSwipeTestOnCurrentModel(ScrollDirection.RIGHT, 0, true); } + /** + * Initialize a test for the toolbar swipe behavior. + * @param useTwoTabs Whether the test should use two tabs. One tab is used if {@code false}. + * @param selectedTab The tab index in the current model to have selected after the tabs are + * loaded. + * @param incognito Whether the test should run on incognito tabs. + */ + private void initToolbarSwipeTest(boolean useTwoTabs, int selectedTab, boolean incognito) { + if (incognito) { + // If incognito, there is no default tab, so open a new one and switch to it. + mActivityTestRule.loadUrlInNewTab(generateSolidColorUrl("#00ff00"), true); + mActivityTestRule.getActivity().getTabModelSelector().selectModel(true); + } else { + // If not incognito, use the tab the test started on. + mActivityTestRule.loadUrl(generateSolidColorUrl("#00ff00")); + } + + if (useTwoTabs) { + mActivityTestRule.loadUrlInNewTab(generateSolidColorUrl("#0000ff"), incognito); + } + + ChromeTabUtils.switchTabInCurrentTabModel(mActivityTestRule.getActivity(), selectedTab); + InstrumentationRegistry.getInstrumentation().waitForIdleSync(); + + final TabModelSelector tabModelSelector = + mActivityTestRule.getActivity().getTabModelSelector(); + final TabModel tabModel = tabModelSelector.getModel(incognito); + + Assert.assertEquals("Incorrect model selected.", incognito, + tabModelSelector.getCurrentModel().isIncognito()); + Assert.assertEquals("Incorrect starting index.", selectedTab, tabModel.index()); + Assert.assertEquals("Incorrect tab count.", useTwoTabs ? 2 : 1, tabModel.getCount()); + } + private void runToolbarSideSwipeTestOnCurrentModel(@ScrollDirection int direction, int finalIndex, boolean expectsSelection) throws TimeoutException { final CallbackHelper selectCallback = new CallbackHelper(); @@ -1617,9 +1595,9 @@ } }); - int callLayouChangeCount = staticLayoutCallbackHelper.getCallCount(); + int callLayoutChangeCount = staticLayoutCallbackHelper.getCallCount(); performToolbarSideSwipe(direction); - staticLayoutCallbackHelper.waitForCallback(callLayouChangeCount, 1); + staticLayoutCallbackHelper.waitForCallback(callLayoutChangeCount, 1); if (expectsSelection) selectCallback.waitForCallback(tabSelectedCallCount, 1); TestThreadUtils.runOnUiThreadBlocking(() -> observer.destroy()); @@ -1631,7 +1609,7 @@ private void performToolbarSideSwipe(@ScrollDirection int direction) { Assert.assertTrue("Unexpected direction for side swipe " + direction, direction == ScrollDirection.LEFT || direction == ScrollDirection.RIGHT); - final View toolbar = mActivityTestRule.getActivity().findViewById(R.id.toolbar); + final View toolbar = mActivityTestRule.getActivity().getToolbarManager().getToolbarView(); int[] toolbarPos = new int[2]; toolbar.getLocationOnScreen(toolbarPos); final int width = toolbar.getWidth(); @@ -1640,12 +1618,16 @@ final int fromX = toolbarPos[0] + width / 2; final int toX = toolbarPos[0] + (direction == ScrollDirection.LEFT ? 0 : width); final int y = toolbarPos[1] + height / 2; - final int stepCount = 10; + final int stepCount = 25; + View toolbarRoot = mActivityTestRule.getActivity() + .getFullscreenManager() + .getControlContainer() + .getView(); long downTime = SystemClock.uptimeMillis(); - TouchCommon.dragStart(mActivityTestRule.getActivity(), fromX, y, downTime); - TouchCommon.dragTo(mActivityTestRule.getActivity(), fromX, toX, y, y, stepCount, downTime); - TouchCommon.dragEnd(mActivityTestRule.getActivity(), toX, y, downTime); + TouchCommon.dragStart(toolbarRoot, fromX, y, downTime); + TouchCommon.dragTo(toolbarRoot, fromX, toX, y, y, stepCount, downTime); + TouchCommon.dragEnd(toolbarRoot, toX, y, downTime); } /**
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/contextmenu/ContextMenuTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/contextmenu/ContextMenuTest.java index bd4d70e..8a0a3fe 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/contextmenu/ContextMenuTest.java +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/contextmenu/ContextMenuTest.java
@@ -7,6 +7,7 @@ import android.content.ClipData; import android.content.ClipboardManager; import android.content.Context; +import android.net.Uri; import android.support.test.InstrumentationRegistry; import android.support.test.filters.LargeTest; import android.support.test.filters.MediumTest; @@ -83,6 +84,8 @@ private static final String FILENAME_GIF = "download.gif"; private static final String FILENAME_PNG = "test_image.png"; private static final String FILENAME_WEBM = "test.webm"; + private static final String TEST_GIF_IMAGE_FILE_EXTENSION = ".gif"; + private static final String TEST_JPG_IMAGE_FILE_EXTENSION = ".jpg"; private static final String[] TEST_FILES = new String[] { FILENAME_GIF, FILENAME_PNG, FILENAME_WEBM @@ -98,7 +101,7 @@ mTestServer.stopAndDestroyServer(); TestThreadUtils.runOnUiThreadBlocking(() -> FirstRunStatus.setFirstRunFlowComplete(false)); deleteTestFiles(); - ContextMenuHelper.setHardcodedImageBytesForTesting(null); + ContextMenuHelper.setHardcodedImageBytesForTesting(null, null); LensUtils.setFakePassableLensEnvironmentForTesting(false); } @@ -107,7 +110,7 @@ mTestServer = EmbeddedTestServer.createAndStartServer(InstrumentationRegistry.getContext()); mTestUrl = mTestServer.getURL(TEST_PATH); deleteTestFiles(); - ContextMenuHelper.setHardcodedImageBytesForTesting(null); + ContextMenuHelper.setHardcodedImageBytesForTesting(null, null); LensUtils.setFakePassableLensEnvironmentForTesting(false); mDownloadTestRule.startMainActivityWithURL(mTestUrl); mDownloadTestRule.assertWaitForPageScaleFactorMatch(0.5f); @@ -155,7 +158,7 @@ LensUtils.setFakePassableLensEnvironmentForTesting(true); ShareHelper.setIgnoreActivityNotFoundExceptionForTesting(true); - hardcodeTestImageForSharing(); + hardcodeTestImageForSharing(TEST_JPG_IMAGE_FILE_EXTENSION); ContextMenuUtils.selectContextMenuItemWithExpectedIntent( InstrumentationRegistry.getInstrumentation(), mDownloadTestRule.getActivity(), tab, @@ -176,7 +179,7 @@ LensUtils.setFakePassableLensEnvironmentForTesting(true); ShareHelper.setIgnoreActivityNotFoundExceptionForTesting(true); - hardcodeTestImageForSharing(); + hardcodeTestImageForSharing(TEST_JPG_IMAGE_FILE_EXTENSION); ContextMenuUtils.selectContextMenuItemWithExpectedIntent( InstrumentationRegistry.getInstrumentation(), mDownloadTestRule.getActivity(), tab, @@ -618,6 +621,31 @@ assertMenuItemsAreEqual(menu, expectedItems); } + @Test + @SmallTest + @Feature({"Browser", "ContextMenu"}) + @EnableFeatures({ChromeFeatureList.CONTEXT_MENU_COPY_IMAGE}) + public void testCopyImage() throws Throwable { + hardcodeTestImageForSharing(TEST_GIF_IMAGE_FILE_EXTENSION); + Tab tab = mDownloadTestRule.getActivity().getActivityTab(); + // Allow all thread policies temporarily in main thread to avoid + // DiskWrite and UnBufferedIo violations during copying under + // emulator environment. + try (CloseableOnMainThread ignored = + CloseableOnMainThread.StrictMode.allowAllThreadPolicies()) { + ContextMenuUtils.selectContextMenuItem(InstrumentationRegistry.getInstrumentation(), + mDownloadTestRule.getActivity(), tab, "dataUrlIcon", + R.id.contextmenu_copy_image); + } + + String imageUriString = getClipboardUri().toString(); + Assert.assertTrue("Image content prefix is not correct", + imageUriString.startsWith( + "content://org.chromium.chrome.tests.FileProvider/images/screenshot/")); + Assert.assertTrue("Image extension is not correct", + imageUriString.endsWith(TEST_GIF_IMAGE_FILE_EXTENSION)); + } + /** * Takes all the visible items on the menu and compares them to a the list of expected items. * @param menu A context menu that is displaying visible items. @@ -693,17 +721,35 @@ return clipboardTextRef.get(); } + private Uri getClipboardUri() throws Throwable { + final AtomicReference<Uri> clipboardUriRef = new AtomicReference<>(); + mDownloadTestRule.runOnUiThread(new Runnable() { + @Override + public void run() { + ClipboardManager clipMgr = + (ClipboardManager) mDownloadTestRule.getActivity().getSystemService( + Context.CLIPBOARD_SERVICE); + ClipData clipData = clipMgr.getPrimaryClip(); + Assert.assertNotNull("Primary clip is null", clipData); + Assert.assertTrue("Primary clip contains no items.", clipData.getItemCount() > 0); + clipboardUriRef.set(clipData.getItemAt(0).getUri()); + } + }); + return clipboardUriRef.get(); + } + /** * Hardcode image bytes to non-null arbitrary data. + * @param extension Image file extension. */ - private void hardcodeTestImageForSharing() { + private void hardcodeTestImageForSharing(String extension) { // This string just needs to be not empty in order for the code to accept it as valid // image data and generate the temp file for sharing. In the future we could explore // transcoding the actual test image from png to jpeg to make the test more realistic. String mockImageData = "randomdata"; byte[] mockImageByteArray = mockImageData.getBytes(); // See function javadoc for more context. - ContextMenuHelper.setHardcodedImageBytesForTesting(mockImageByteArray); + ContextMenuHelper.setHardcodedImageBytesForTesting(mockImageByteArray, extension); } private void assertStringContains(String subString, String superString) {
diff --git a/chrome/android/junit/src/org/chromium/chrome/browser/offlinepages/OfflinePageTabObserverTest.java b/chrome/android/junit/src/org/chromium/chrome/browser/offlinepages/OfflinePageTabObserverTest.java index 7abae8f..bea829c 100644 --- a/chrome/android/junit/src/org/chromium/chrome/browser/offlinepages/OfflinePageTabObserverTest.java +++ b/chrome/android/junit/src/org/chromium/chrome/browser/offlinepages/OfflinePageTabObserverTest.java
@@ -17,6 +17,7 @@ import static org.chromium.chrome.browser.tab.TabSelectionType.FROM_NEW; +import android.app.Activity; import android.content.Context; import org.junit.Before; @@ -32,11 +33,13 @@ import org.chromium.chrome.browser.ChromeActivity; import org.chromium.chrome.browser.tab.Tab; import org.chromium.chrome.browser.tab.TabHidingType; -import org.chromium.chrome.browser.tab.TabImpl; import org.chromium.chrome.browser.tab.TabSelectionType; import org.chromium.chrome.browser.tabmodel.TabModelSelector; import org.chromium.chrome.browser.ui.messages.snackbar.SnackbarManager; import org.chromium.chrome.browser.ui.messages.snackbar.SnackbarManager.SnackbarController; +import org.chromium.ui.base.WindowAndroid; + +import java.lang.ref.WeakReference; /** * Unit tests for OfflinePageUtils. @@ -55,9 +58,12 @@ @Mock private SnackbarManager mSnackbarManager; @Mock private SnackbarController mSnackbarController; @Mock - private TabImpl mTab; + private Tab mTab; @Mock private OfflinePageUtils.Internal mOfflinePageUtils; + @Mock + private WindowAndroid mWindowAndroid; + private WeakReference<Activity> mActivityRef; private OfflinePageTabObserver createObserver() { OfflinePageTabObserver observer = spy(new OfflinePageTabObserver( @@ -76,13 +82,16 @@ public void setUp() { MockitoAnnotations.initMocks(this); + mActivityRef = new WeakReference<>(mActivity); + // Setting up a mock tab. These are the values common to most tests, but individual // tests might easily overwrite them. doReturn(TAB_ID).when(mTab).getId(); doReturn(TAB_URL).when(mTab).getUrlString(); doReturn(false).when(mTab).isFrozen(); doReturn(false).when(mTab).isHidden(); - doReturn(mActivity).when(mTab).getActivity(); + doReturn(mWindowAndroid).when(mTab).getWindowAndroid(); + doReturn(mActivityRef).when(mWindowAndroid).getActivity(); // Setting up mock snackbar manager. doNothing().when(mSnackbarManager).dismissSnackbars(eq(mSnackbarController));
diff --git a/chrome/android/junit/src/org/chromium/chrome/browser/page_info/PermissionParamsListBuilderUnitTest.java b/chrome/android/junit/src/org/chromium/chrome/browser/page_info/PermissionParamsListBuilderUnitTest.java index 1c06daa..47cd9cc 100644 --- a/chrome/android/junit/src/org/chromium/chrome/browser/page_info/PermissionParamsListBuilderUnitTest.java +++ b/chrome/android/junit/src/org/chromium/chrome/browser/page_info/PermissionParamsListBuilderUnitTest.java
@@ -35,12 +35,12 @@ import org.chromium.base.test.BaseRobolectricTestRunner; import org.chromium.base.test.util.JniMocker; import org.chromium.chrome.R; -import org.chromium.chrome.browser.flags.ChromeFeatureList; import org.chromium.chrome.browser.site_settings.ContentSettingValues; import org.chromium.chrome.browser.site_settings.WebsitePreferenceBridge; import org.chromium.chrome.browser.site_settings.WebsitePreferenceBridgeJni; import org.chromium.chrome.test.util.browser.Features; import org.chromium.chrome.test.util.browser.LocationSettingsTestUtil; +import org.chromium.components.browser_ui.site_settings.SiteSettingsFeatureList; import org.chromium.components.content_settings.ContentSettingsType; import org.chromium.components.page_info.PageInfoView; import org.chromium.components.page_info.SystemSettingsActivityRequiredListener; @@ -128,7 +128,7 @@ } @Test - @Features.EnableFeatures(ChromeFeatureList.APP_NOTIFICATION_STATUS_MESSAGING) + @Features.EnableFeatures(SiteSettingsFeatureList.APP_NOTIFICATION_STATUS_MESSAGING) public void appNotificationStatusMessagingWhenNotificationsDisabled() { getMutableNotificationManager().setNotificationsEnabled(false); @@ -144,7 +144,7 @@ } @Test - @Features.EnableFeatures(ChromeFeatureList.APP_NOTIFICATION_STATUS_MESSAGING) + @Features.EnableFeatures(SiteSettingsFeatureList.APP_NOTIFICATION_STATUS_MESSAGING) public void appNotificationStatusMessagingWhenNotificationsEnabled() { getMutableNotificationManager().setNotificationsEnabled(true); @@ -159,7 +159,7 @@ } @Test - @Features.DisableFeatures(ChromeFeatureList.APP_NOTIFICATION_STATUS_MESSAGING) + @Features.DisableFeatures(SiteSettingsFeatureList.APP_NOTIFICATION_STATUS_MESSAGING) public void appNotificationStatusMessagingFlagDisabled() { getMutableNotificationManager().setNotificationsEnabled(false);
diff --git a/chrome/android/junit/src/org/chromium/chrome/browser/photo_picker/PickerBitmapViewTest.java b/chrome/android/junit/src/org/chromium/chrome/browser/photo_picker/PickerBitmapViewTest.java new file mode 100644 index 0000000..eb9bc8e --- /dev/null +++ b/chrome/android/junit/src/org/chromium/chrome/browser/photo_picker/PickerBitmapViewTest.java
@@ -0,0 +1,30 @@ +// Copyright 2020 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +package org.chromium.chrome.browser.photo_picker; + +import org.junit.Test; +import org.junit.runner.RunWith; +import org.robolectric.RuntimeEnvironment; +import org.robolectric.annotation.Config; + +import org.chromium.base.test.BaseRobolectricTestRunner; + +import java.util.Collections; + +/** + * junit tests for the {@link PickerBitmapView} class. + */ +@RunWith(BaseRobolectricTestRunner.class) +@Config(manifest = Config.NONE) +public class PickerBitmapViewTest { + @Test + public void testPrematureOnSelectionStateChanged() { + PickerBitmapView view = + new PickerBitmapView(RuntimeEnvironment.application.getApplicationContext(), null); + // Simulate crash scenario in crbug.com/1006823, where an event occurred before + // PickerBitmapView has been initialized. + view.onSelectionStateChange(Collections.emptyList()); + } +}
diff --git a/chrome/app/chromeos_strings.grdp b/chrome/app/chromeos_strings.grdp index 05abdd23..7de8764 100644 --- a/chrome/app/chromeos_strings.grdp +++ b/chrome/app/chromeos_strings.grdp
@@ -890,8 +890,8 @@ <message name="IDS_LOGIN_MARKETING_OPT_IN_SCREEN_SWIPE_FROM_SHELF_LABEL" desc="The label shown in Chrome OS system shelf above a drag handle UI on the last dialog in the set of screens displayed to the user on the first login to the Chrome OS device. The label informs the user that swiping up from the shelf will start the session."> Swipe up to get started </message> - <message name="IDS_MARKETING_OPT_IN_ACCESSIBILITY_SETTINGS_LINK" desc="The label of the accessibility settings link which appears at the bottom of the last OOBE dialog shown to the user on the first login. Clicking the link will show a screen that allows the user to change certain accessibility settings."> - Accessibility settings for navigation + <message name="IDS_MARKETING_OPT_IN_ACCESSIBILITY_BUTTON_LABEL" desc="The label of the button which appears at the bottom left of the last OOBE dialog shown to the user on the first login. Clicking the button will show a screen that allows the user to change certain accessibility settings."> + Accessibility </message> <message name="IDS_MARKETING_OPT_IN_ACCESSIBILITY_TITLE" desc="The title of the accessibility page that is part of the the marketing opt in dialog screen, the last OOBE screen shown to the user on their first login to the Chrome OS device. The accessibility page will allow the user to change certain accessibility settings."> Accessibility settings
diff --git a/chrome/app/chromeos_strings_grdp/IDS_MARKETING_OPT_IN_ACCESSIBILITY_BUTTON_LABEL.png.sha1 b/chrome/app/chromeos_strings_grdp/IDS_MARKETING_OPT_IN_ACCESSIBILITY_BUTTON_LABEL.png.sha1 new file mode 100644 index 0000000..f14b707 --- /dev/null +++ b/chrome/app/chromeos_strings_grdp/IDS_MARKETING_OPT_IN_ACCESSIBILITY_BUTTON_LABEL.png.sha1
@@ -0,0 +1 @@ +da9ff67c6303cf9beaa41a986673e9ebb1b3752f \ No newline at end of file
diff --git a/chrome/app/os_settings_strings.grdp b/chrome/app/os_settings_strings.grdp index ba24139..e3d8e8b 100644 --- a/chrome/app/os_settings_strings.grdp +++ b/chrome/app/os_settings_strings.grdp
@@ -193,19 +193,6 @@ <message name="IDS_OS_SETTINGS_LANGUAGES_AND_INPUT_PAGE_TITLE" desc="Name of the OS settings page which displays language method preferences."> Languages and input </message> - <!-- TODO(https://crbug.com/1063412): Move scroll strings to a more appropriate location. --> - <message name="IDS_SETTINGS_MOUSE_SCROLL_SPEED_LABEL" desc="In Device Settings, the text next to the slider that sets the speed (sensitivity) of mouse scrolling."> - Mouse scroll speed - </message> - <message name="IDS_SETTINGS_TOUCHPAD_SCROLL_SPEED_LABEL" desc="In Device Settings, the text next to the slider that sets the speed (sensitivity) of touchpad scrolling."> - Touchpad scroll speed - </message> - <message name="IDS_SETTINGS_MOUSE_SCROLL_ACCELERATION_LABEL" desc="In Device Settings, the text next to the toggle for mouse scroll acceleration."> - Enable mouse scroll acceleration - </message> - <message name="IDS_SETTINGS_TOUCHPAD_SCROLL_ACCELERATION_LABEL" desc="In Device Settings, the text next to the toggle for touchpad scroll acceleration."> - Enable touchpad scroll acceleration - </message> <message name="IDS_OS_SETTINGS_LANGUAGES_LIST_TITLE" desc="Title for the list of the user's preferred written languages."> Languages </message> @@ -1241,6 +1228,9 @@ <message name="IDS_SETTINGS_TOUCHPAD_SPEED_LABEL" desc="In Device Settings, the text next to the slider that sets the speed (sensitivity) of the touchpad."> Touchpad speed </message> + <message name="IDS_SETTINGS_TOUCHPAD_SCROLL_SPEED_LABEL" desc="In Device Settings, the text next to the slider that sets the speed (sensitivity) of touchpad scrolling."> + Touchpad scroll speed + </message> <message name="IDS_SETTINGS_POINTER_SPEED_SLOW_LABEL" desc="In Device Settings, the text under the left (less sensitive) side of the slider for the pointer (mouse/touch) speed (sensitivity)."> Slow </message> @@ -1250,6 +1240,9 @@ <message name="IDS_SETTINGS_MOUSE_SPEED_LABEL" desc="In Device Settings, the text next to the slider that sets the speed (sensitivity) of the mouse."> Mouse speed </message> + <message name="IDS_SETTINGS_MOUSE_SCROLL_SPEED_LABEL" desc="In Device Settings, the text next to the slider that sets the speed (sensitivity) of mouse scrolling."> + Mouse scroll speed + </message> <message name="IDS_SETTINGS_MOUSE_SWAP_BUTTONS_LABEL" desc="In Device Settings, the text next to the checkbox to set the primary mouse button to the right button instead of the left button."> Swap primary mouse button </message> @@ -1259,9 +1252,15 @@ <message name="IDS_SETTINGS_MOUSE_ACCELERATION_LABEL" desc="In Device Settings, the text next to the checkbox to disable mouse acceleration."> Enable mouse acceleration </message> + <message name="IDS_SETTINGS_MOUSE_SCROLL_ACCELERATION_LABEL" desc="In Device Settings, the text next to the toggle for mouse scroll acceleration."> + Enable mouse scroll acceleration + </message> <message name="IDS_SETTINGS_TOUCHPAD_ACCELERATION_LABEL" desc="In Device Settings, the text next to the checkbox to disable touchpad acceleration."> Enable touchpad acceleration </message> + <message name="IDS_SETTINGS_TOUCHPAD_SCROLL_ACCELERATION_LABEL" desc="In Device Settings, the text next to the toggle for touchpad scroll acceleration."> + Enable touchpad scroll acceleration + </message> <message name="IDS_SETTINGS_MOUSE_AND_TOUCHPAD_TITLE" desc="In Device Settings, the title of the mouse and touchpad settings subpage (when the user has both types of devices)."> Mouse and touchpad </message>
diff --git a/chrome/app/resources/locale_settings.grd b/chrome/app/resources/locale_settings.grd index 6ca7085..efc0b5f 100644 --- a/chrome/app/resources/locale_settings.grd +++ b/chrome/app/resources/locale_settings.grd
@@ -172,19 +172,6 @@ https://chrome.google.com/webstore?hl=[GRITLANGCODE] </message> - <!-- The URLs for Adobe Flash settings. We cannot rely on --> - <!-- the automatic expansion of GRITLANGCODE here because Adobe does --> - <!-- not use the language/locale code. --> - <message name="IDS_FLASH_STORAGE_URL" use_name_for_id="true"> - http://www.adobe.com/go/settmgr_storage_en - </message> - <message name="IDS_FLASH_GLOBAL_PRIVACY_URL" use_name_for_id="true"> - http://www.macromedia.com/support/documentation/en/flashplayer/help/settings_manager02.html - </message> - <message name="IDS_FLASH_WEBSITE_PRIVACY_URL" use_name_for_id="true"> - http://www.macromedia.com/support/documentation/en/flashplayer/help/settings_manager06.html - </message> - <!-- The width for the "create application shortcuts" dialog in characters. --> <message name="IDS_CREATE_SHORTCUTS_DIALOG_WIDTH_CHARS" use_name_for_id="true"> 65
diff --git a/chrome/app/resources/locale_settings_cs.xtb b/chrome/app/resources/locale_settings_cs.xtb index 18d011e3..990fe24a 100644 --- a/chrome/app/resources/locale_settings_cs.xtb +++ b/chrome/app/resources/locale_settings_cs.xtb
@@ -49,9 +49,6 @@ <translation id="IDS_BOOKMARK_MANAGER_DIALOG_HEIGHT_LINES">40</translation> <translation id="IDS_SELECT_PROFILE_DIALOG_WIDTH_CHARS">60</translation> <translation id="IDS_SELECT_PROFILE_DIALOG_HEIGHT_LINES">5</translation> -<translation id="IDS_FLASH_STORAGE_URL">http://www.adobe.com/go/settmgr_storage_cz</translation> -<translation id="IDS_FLASH_GLOBAL_PRIVACY_URL">http://www.macromedia.com/support/documentation/cz/flashplayer/help/settings_manager02.html</translation> -<translation id="IDS_FLASH_WEBSITE_PRIVACY_URL">http://www.macromedia.com/support/documentation/cz/flashplayer/help/settings_manager06.html</translation> <translation id="IDS_NEW_PROFILE_DIALOG_WIDTH_CHARS">60</translation> <translation id="IDS_SYNC_SETUP_WIZARD_WIDTH_CHARS">46</translation> <translation id="IDS_SYNC_SETUP_WIZARD_HEIGHT_LINES">16</translation>
diff --git a/chrome/app/resources/locale_settings_de.xtb b/chrome/app/resources/locale_settings_de.xtb index 0ff6506..91968e99 100644 --- a/chrome/app/resources/locale_settings_de.xtb +++ b/chrome/app/resources/locale_settings_de.xtb
@@ -49,9 +49,6 @@ <translation id="IDS_BOOKMARK_MANAGER_DIALOG_HEIGHT_LINES">40</translation> <translation id="IDS_SELECT_PROFILE_DIALOG_WIDTH_CHARS">60</translation> <translation id="IDS_SELECT_PROFILE_DIALOG_HEIGHT_LINES">5</translation> -<translation id="IDS_FLASH_STORAGE_URL">http://www.adobe.com/go/settmgr_storage_de</translation> -<translation id="IDS_FLASH_GLOBAL_PRIVACY_URL">http://www.macromedia.com/support/documentation/de/flashplayer/help/settings_manager02.html</translation> -<translation id="IDS_FLASH_WEBSITE_PRIVACY_URL">http://www.macromedia.com/support/documentation/de/flashplayer/help/settings_manager06.html</translation> <translation id="IDS_NEW_PROFILE_DIALOG_WIDTH_CHARS">60</translation> <translation id="IDS_SYNC_SETUP_WIZARD_WIDTH_CHARS">46</translation> <translation id="IDS_SYNC_SETUP_WIZARD_HEIGHT_LINES">18</translation>
diff --git a/chrome/app/resources/locale_settings_es-419.xtb b/chrome/app/resources/locale_settings_es-419.xtb index b0f07a44..183ebeb6 100644 --- a/chrome/app/resources/locale_settings_es-419.xtb +++ b/chrome/app/resources/locale_settings_es-419.xtb
@@ -49,9 +49,6 @@ <translation id="IDS_BOOKMARK_MANAGER_DIALOG_HEIGHT_LINES">40</translation> <translation id="IDS_SELECT_PROFILE_DIALOG_WIDTH_CHARS">60</translation> <translation id="IDS_SELECT_PROFILE_DIALOG_HEIGHT_LINES">5</translation> -<translation id="IDS_FLASH_STORAGE_URL">http://www.adobe.com/go/settmgr_storage_es</translation> -<translation id="IDS_FLASH_GLOBAL_PRIVACY_URL">http://www.macromedia.com/support/documentation/es/flashplayer/help/settings_manager02.html</translation> -<translation id="IDS_FLASH_WEBSITE_PRIVACY_URL">http://www.macromedia.com/support/documentation/es/flashplayer/help/settings_manager06.html</translation> <translation id="IDS_NEW_PROFILE_DIALOG_WIDTH_CHARS">60</translation> <translation id="IDS_SYNC_SETUP_WIZARD_WIDTH_CHARS">46</translation> <translation id="IDS_SYNC_SETUP_WIZARD_HEIGHT_LINES">16</translation>
diff --git a/chrome/app/resources/locale_settings_es.xtb b/chrome/app/resources/locale_settings_es.xtb index 8478379a..e255e1b 100644 --- a/chrome/app/resources/locale_settings_es.xtb +++ b/chrome/app/resources/locale_settings_es.xtb
@@ -51,9 +51,6 @@ <translation id="IDS_SELECT_PROFILE_DIALOG_WIDTH_CHARS">60</translation> <translation id="IDS_SELECT_PROFILE_DIALOG_HEIGHT_LINES">5</translation> <translation id="IDS_NEW_PROFILE_DIALOG_WIDTH_CHARS">60</translation> -<translation id="IDS_FLASH_STORAGE_URL">http://www.adobe.com/go/settmgr_storage_es</translation> -<translation id="IDS_FLASH_GLOBAL_PRIVACY_URL">http://www.macromedia.com/support/documentation/es/flashplayer/help/settings_manager02.html</translation> -<translation id="IDS_FLASH_WEBSITE_PRIVACY_URL">http://www.macromedia.com/support/documentation/es/flashplayer/help/settings_manager06.html</translation> <translation id="IDS_SYNC_SETUP_WIZARD_WIDTH_CHARS">46</translation> <translation id="IDS_SYNC_SETUP_WIZARD_HEIGHT_LINES">16</translation> <translation id="IDS_CONFIRM_MESSAGE_BOX_DEFAULT_WIDTH_CHARS">50</translation>
diff --git a/chrome/app/resources/locale_settings_fr.xtb b/chrome/app/resources/locale_settings_fr.xtb index 3129ad2..814552e 100644 --- a/chrome/app/resources/locale_settings_fr.xtb +++ b/chrome/app/resources/locale_settings_fr.xtb
@@ -51,9 +51,6 @@ <translation id="IDS_SELECT_PROFILE_DIALOG_WIDTH_CHARS">60</translation> <translation id="IDS_SELECT_PROFILE_DIALOG_HEIGHT_LINES">5</translation> <translation id="IDS_NEW_PROFILE_DIALOG_WIDTH_CHARS">60</translation> -<translation id="IDS_FLASH_STORAGE_URL">http://www.adobe.com/go/settmgr_storage_fr</translation> -<translation id="IDS_FLASH_GLOBAL_PRIVACY_URL">http://www.macromedia.com/support/documentation/fr/flashplayer/help/settings_manager02.html</translation> -<translation id="IDS_FLASH_WEBSITE_PRIVACY_URL">http://www.macromedia.com/support/documentation/fr/flashplayer/help/settings_manager06.html</translation> <translation id="IDS_SYNC_SETUP_WIZARD_WIDTH_CHARS">46</translation> <translation id="IDS_SYNC_SETUP_WIZARD_HEIGHT_LINES">16</translation> <translation id="IDS_CONFIRM_MESSAGE_BOX_DEFAULT_WIDTH_CHARS">50</translation>
diff --git a/chrome/app/resources/locale_settings_it.xtb b/chrome/app/resources/locale_settings_it.xtb index 92f51e3..c2e49900 100644 --- a/chrome/app/resources/locale_settings_it.xtb +++ b/chrome/app/resources/locale_settings_it.xtb
@@ -48,9 +48,6 @@ <translation id="IDS_BOOKMARK_MANAGER_DIALOG_HEIGHT_LINES">40</translation> <translation id="IDS_SELECT_PROFILE_DIALOG_WIDTH_CHARS">60</translation> <translation id="IDS_SELECT_PROFILE_DIALOG_HEIGHT_LINES">5</translation> -<translation id="IDS_FLASH_STORAGE_URL">http://www.adobe.com/go/settmgr_storage_it</translation> -<translation id="IDS_FLASH_GLOBAL_PRIVACY_URL">http://www.macromedia.com/support/documentation/it/flashplayer/help/settings_manager02.html</translation> -<translation id="IDS_FLASH_WEBSITE_PRIVACY_URL">http://www.macromedia.com/support/documentation/it/flashplayer/help/settings_manager06.html</translation> <translation id="IDS_NEW_PROFILE_DIALOG_WIDTH_CHARS">60</translation> <translation id="IDS_SYNC_SETUP_WIZARD_WIDTH_CHARS">46</translation> <translation id="IDS_SYNC_SETUP_WIZARD_HEIGHT_LINES">16</translation>
diff --git a/chrome/app/resources/locale_settings_ja.xtb b/chrome/app/resources/locale_settings_ja.xtb index 9fd3bf5..34da22c 100644 --- a/chrome/app/resources/locale_settings_ja.xtb +++ b/chrome/app/resources/locale_settings_ja.xtb
@@ -48,9 +48,6 @@ <translation id="IDS_BOOKMARK_MANAGER_DIALOG_HEIGHT_LINES">40</translation> <translation id="IDS_SELECT_PROFILE_DIALOG_WIDTH_CHARS">60</translation> <translation id="IDS_SELECT_PROFILE_DIALOG_HEIGHT_LINES">5</translation> -<translation id="IDS_FLASH_STORAGE_URL">http://www.adobe.com/go/settmgr_storage_jp</translation> -<translation id="IDS_FLASH_GLOBAL_PRIVACY_URL">http://www.macromedia.com/support/documentation/jp/flashplayer/help/settings_manager02.html</translation> -<translation id="IDS_FLASH_WEBSITE_PRIVACY_URL">http://www.macromedia.com/support/documentation/jp/flashplayer/help/settings_manager06.html</translation> <translation id="IDS_NEW_PROFILE_DIALOG_WIDTH_CHARS">60</translation> <translation id="IDS_SYNC_SETUP_WIZARD_WIDTH_CHARS">46</translation> <translation id="IDS_SYNC_SETUP_WIZARD_HEIGHT_LINES">17</translation>
diff --git a/chrome/app/resources/locale_settings_ko.xtb b/chrome/app/resources/locale_settings_ko.xtb index 78800fa..3c6ada6 100644 --- a/chrome/app/resources/locale_settings_ko.xtb +++ b/chrome/app/resources/locale_settings_ko.xtb
@@ -50,9 +50,6 @@ <translation id="IDS_BOOKMARK_MANAGER_DIALOG_HEIGHT_LINES">40</translation> <translation id="IDS_SELECT_PROFILE_DIALOG_WIDTH_CHARS">60</translation> <translation id="IDS_SELECT_PROFILE_DIALOG_HEIGHT_LINES">5</translation> -<translation id="IDS_FLASH_STORAGE_URL">http://www.macromedia.com/support/documentation/kr/flashplayer/help/settings_manager07.html</translation> -<translation id="IDS_FLASH_GLOBAL_PRIVACY_URL">http://www.macromedia.com/support/documentation/kr/flashplayer/help/settings_manager02.html</translation> -<translation id="IDS_FLASH_WEBSITE_PRIVACY_URL">http://www.macromedia.com/support/documentation/kr/flashplayer/help/settings_manager06.html</translation> <translation id="IDS_NEW_PROFILE_DIALOG_WIDTH_CHARS">60</translation> <translation id="IDS_SYNC_SETUP_WIZARD_WIDTH_CHARS">46</translation> <translation id="IDS_SYNC_SETUP_WIZARD_HEIGHT_LINES">17</translation>
diff --git a/chrome/app/resources/locale_settings_nl.xtb b/chrome/app/resources/locale_settings_nl.xtb index a3a9c1f..42668707 100644 --- a/chrome/app/resources/locale_settings_nl.xtb +++ b/chrome/app/resources/locale_settings_nl.xtb
@@ -48,9 +48,6 @@ <translation id="IDS_BOOKMARK_MANAGER_DIALOG_HEIGHT_LINES">40</translation> <translation id="IDS_SELECT_PROFILE_DIALOG_WIDTH_CHARS">60</translation> <translation id="IDS_SELECT_PROFILE_DIALOG_HEIGHT_LINES">5</translation> -<translation id="IDS_FLASH_STORAGE_URL">http://www.adobe.com/go/settmgr_storage_nl</translation> -<translation id="IDS_FLASH_GLOBAL_PRIVACY_URL">http://www.macromedia.com/support/documentation/nl/flashplayer/help/settings_manager02.html</translation> -<translation id="IDS_FLASH_WEBSITE_PRIVACY_URL">http://www.macromedia.com/support/documentation/nl/flashplayer/help/settings_manager06.html</translation> <translation id="IDS_NEW_PROFILE_DIALOG_WIDTH_CHARS">60</translation> <translation id="IDS_SYNC_SETUP_WIZARD_WIDTH_CHARS">46</translation> <translation id="IDS_SYNC_SETUP_WIZARD_HEIGHT_LINES">16</translation>
diff --git a/chrome/app/resources/locale_settings_pl.xtb b/chrome/app/resources/locale_settings_pl.xtb index cdad453..c1f5b84 100644 --- a/chrome/app/resources/locale_settings_pl.xtb +++ b/chrome/app/resources/locale_settings_pl.xtb
@@ -48,9 +48,6 @@ <translation id="IDS_BOOKMARK_MANAGER_DIALOG_HEIGHT_LINES">40</translation> <translation id="IDS_SELECT_PROFILE_DIALOG_WIDTH_CHARS">60</translation> <translation id="IDS_SELECT_PROFILE_DIALOG_HEIGHT_LINES">5</translation> -<translation id="IDS_FLASH_STORAGE_URL">http://www.adobe.com/go/settmgr_storage_pl</translation> -<translation id="IDS_FLASH_GLOBAL_PRIVACY_URL">http://www.macromedia.com/support/documentation/pl/flashplayer/help/settings_manager02.html</translation> -<translation id="IDS_FLASH_WEBSITE_PRIVACY_URL">http://www.macromedia.com/support/documentation/pl/flashplayer/help/settings_manager06.html</translation> <translation id="IDS_NEW_PROFILE_DIALOG_WIDTH_CHARS">60</translation> <translation id="IDS_SYNC_SETUP_WIZARD_WIDTH_CHARS">46</translation> <translation id="IDS_SYNC_SETUP_WIZARD_HEIGHT_LINES">16</translation>
diff --git a/chrome/app/resources/locale_settings_pt-BR.xtb b/chrome/app/resources/locale_settings_pt-BR.xtb index d6e2a65..159296bc 100644 --- a/chrome/app/resources/locale_settings_pt-BR.xtb +++ b/chrome/app/resources/locale_settings_pt-BR.xtb
@@ -46,9 +46,6 @@ <translation id="IDS_STATIC_ENCODING_LIST">windows-1252</translation> <translation id="IDS_BOOKMARK_MANAGER_DIALOG_WIDTH_CHARS">150</translation> <translation id="IDS_BOOKMARK_MANAGER_DIALOG_HEIGHT_LINES">40</translation> -<translation id="IDS_FLASH_STORAGE_URL">http://www.adobe.com/go/settmgr_storage_br</translation> -<translation id="IDS_FLASH_GLOBAL_PRIVACY_URL">http://www.macromedia.com/support/documentation/br/flashplayer/help/settings_manager02.html</translation> -<translation id="IDS_FLASH_WEBSITE_PRIVACY_URL">http://www.macromedia.com/support/documentation/br/flashplayer/help/settings_manager06.html</translation> <translation id="IDS_SELECT_PROFILE_DIALOG_WIDTH_CHARS">60</translation> <translation id="IDS_SELECT_PROFILE_DIALOG_HEIGHT_LINES">5</translation> <translation id="IDS_NEW_PROFILE_DIALOG_WIDTH_CHARS">60</translation>
diff --git a/chrome/app/resources/locale_settings_pt-PT.xtb b/chrome/app/resources/locale_settings_pt-PT.xtb index 1b3c1e6..fd1fd09 100644 --- a/chrome/app/resources/locale_settings_pt-PT.xtb +++ b/chrome/app/resources/locale_settings_pt-PT.xtb
@@ -49,9 +49,6 @@ <translation id="IDS_SELECT_PROFILE_DIALOG_WIDTH_CHARS">60</translation> <translation id="IDS_SELECT_PROFILE_DIALOG_HEIGHT_LINES">5</translation> <translation id="IDS_NEW_PROFILE_DIALOG_WIDTH_CHARS">60</translation> -<translation id="IDS_FLASH_STORAGE_URL">http://www.adobe.com/go/settmgr_storage_br</translation> -<translation id="IDS_FLASH_GLOBAL_PRIVACY_URL">http://www.macromedia.com/support/documentation/br/flashplayer/help/settings_manager02.html</translation> -<translation id="IDS_FLASH_WEBSITE_PRIVACY_URL">http://www.macromedia.com/support/documentation/br/flashplayer/help/settings_manager06.html</translation> <translation id="IDS_SYNC_SETUP_WIZARD_WIDTH_CHARS">46</translation> <translation id="IDS_SYNC_SETUP_WIZARD_HEIGHT_LINES">16</translation> <translation id="IDS_CONFIRM_MESSAGE_BOX_DEFAULT_WIDTH_CHARS">50</translation>
diff --git a/chrome/app/resources/locale_settings_ru.xtb b/chrome/app/resources/locale_settings_ru.xtb index 1d4fd0c..e3f13f7 100644 --- a/chrome/app/resources/locale_settings_ru.xtb +++ b/chrome/app/resources/locale_settings_ru.xtb
@@ -48,9 +48,6 @@ <translation id="IDS_BOOKMARK_MANAGER_DIALOG_HEIGHT_LINES">40</translation> <translation id="IDS_SELECT_PROFILE_DIALOG_WIDTH_CHARS">60</translation> <translation id="IDS_SELECT_PROFILE_DIALOG_HEIGHT_LINES">5</translation> -<translation id="IDS_FLASH_STORAGE_URL">http://www.adobe.com/go/settmgr_storage_ru</translation> -<translation id="IDS_FLASH_GLOBAL_PRIVACY_URL">http://www.macromedia.com/support/documentation/ru/flashplayer/help/settings_manager02.html</translation> -<translation id="IDS_FLASH_WEBSITE_PRIVACY_URL">http://www.macromedia.com/support/documentation/ru/flashplayer/help/settings_manager06.html</translation> <translation id="IDS_NEW_PROFILE_DIALOG_WIDTH_CHARS">60</translation> <translation id="IDS_SYNC_SETUP_WIZARD_WIDTH_CHARS">46</translation> <translation id="IDS_SYNC_SETUP_WIZARD_HEIGHT_LINES">16</translation>
diff --git a/chrome/app/resources/locale_settings_sv.xtb b/chrome/app/resources/locale_settings_sv.xtb index d64c8428a..98e04c94 100644 --- a/chrome/app/resources/locale_settings_sv.xtb +++ b/chrome/app/resources/locale_settings_sv.xtb
@@ -48,9 +48,6 @@ <translation id="IDS_BOOKMARK_MANAGER_DIALOG_HEIGHT_LINES">40</translation> <translation id="IDS_SELECT_PROFILE_DIALOG_WIDTH_CHARS">60</translation> <translation id="IDS_SELECT_PROFILE_DIALOG_HEIGHT_LINES">5</translation> -<translation id="IDS_FLASH_STORAGE_URL">http://www.adobe.com/go/settmgr_storage_se</translation> -<translation id="IDS_FLASH_GLOBAL_PRIVACY_URL">http://www.macromedia.com/support/documentation/se/flashplayer/help/settings_manager02.html</translation> -<translation id="IDS_FLASH_WEBSITE_PRIVACY_URL">http://www.macromedia.com/support/documentation/se/flashplayer/help/settings_manager06.html</translation> <translation id="IDS_NEW_PROFILE_DIALOG_WIDTH_CHARS">60</translation> <translation id="IDS_SYNC_SETUP_WIZARD_WIDTH_CHARS">46</translation> <translation id="IDS_SYNC_SETUP_WIZARD_HEIGHT_LINES">16</translation>
diff --git a/chrome/app/resources/locale_settings_tr.xtb b/chrome/app/resources/locale_settings_tr.xtb index b7b22f3..4acc3c5 100644 --- a/chrome/app/resources/locale_settings_tr.xtb +++ b/chrome/app/resources/locale_settings_tr.xtb
@@ -48,9 +48,6 @@ <translation id="IDS_BOOKMARK_MANAGER_DIALOG_HEIGHT_LINES">40</translation> <translation id="IDS_SELECT_PROFILE_DIALOG_WIDTH_CHARS">60</translation> <translation id="IDS_SELECT_PROFILE_DIALOG_HEIGHT_LINES">5</translation> -<translation id="IDS_FLASH_STORAGE_URL">http://www.adobe.com/go/settmgr_storage_tr</translation> -<translation id="IDS_FLASH_GLOBAL_PRIVACY_URL">http://www.macromedia.com/support/documentation/tr/flashplayer/help/settings_manager02.html</translation> -<translation id="IDS_FLASH_WEBSITE_PRIVACY_URL">http://www.macromedia.com/support/documentation/tr/flashplayer/help/settings_manager06.html</translation> <translation id="IDS_NEW_PROFILE_DIALOG_WIDTH_CHARS">60</translation> <translation id="IDS_SYNC_SETUP_WIZARD_WIDTH_CHARS">46</translation> <translation id="IDS_SYNC_SETUP_WIZARD_HEIGHT_LINES">16</translation>
diff --git a/chrome/app/resources/locale_settings_zh-CN.xtb b/chrome/app/resources/locale_settings_zh-CN.xtb index 3372624..3984c7a 100644 --- a/chrome/app/resources/locale_settings_zh-CN.xtb +++ b/chrome/app/resources/locale_settings_zh-CN.xtb
@@ -48,9 +48,6 @@ <translation id="IDS_BOOKMARK_MANAGER_DIALOG_HEIGHT_LINES">40</translation> <translation id="IDS_SELECT_PROFILE_DIALOG_WIDTH_CHARS">60</translation> <translation id="IDS_SELECT_PROFILE_DIALOG_HEIGHT_LINES">5</translation> -<translation id="IDS_FLASH_STORAGE_URL">http://www.adobe.com/go/settmgr_storage_cn</translation> -<translation id="IDS_FLASH_GLOBAL_PRIVACY_URL">http://www.macromedia.com/support/documentation/cn/flashplayer/help/settings_manager02.html</translation> -<translation id="IDS_FLASH_WEBSITE_PRIVACY_URL">http://www.macromedia.com/support/documentation/cn/flashplayer/help/settings_manager06.html</translation> <translation id="IDS_NEW_PROFILE_DIALOG_WIDTH_CHARS">60</translation> <translation id="IDS_SYNC_SETUP_WIZARD_WIDTH_CHARS">46</translation> <translation id="IDS_SYNC_SETUP_WIZARD_HEIGHT_LINES">17</translation>
diff --git a/chrome/app/resources/locale_settings_zh-TW.xtb b/chrome/app/resources/locale_settings_zh-TW.xtb index 485dd46..c154b02 100644 --- a/chrome/app/resources/locale_settings_zh-TW.xtb +++ b/chrome/app/resources/locale_settings_zh-TW.xtb
@@ -48,9 +48,6 @@ <translation id="IDS_BOOKMARK_MANAGER_DIALOG_HEIGHT_LINES">40</translation> <translation id="IDS_SELECT_PROFILE_DIALOG_WIDTH_CHARS">60</translation> <translation id="IDS_SELECT_PROFILE_DIALOG_HEIGHT_LINES">5</translation> -<translation id="IDS_FLASH_STORAGE_URL">http://www.adobe.com/go/settmgr_storage_tw</translation> -<translation id="IDS_FLASH_GLOBAL_PRIVACY_URL">http://www.macromedia.com/support/documentation/tw/flashplayer/help/settings_manager02.html</translation> -<translation id="IDS_FLASH_WEBSITE_PRIVACY_URL">http://www.macromedia.com/support/documentation/tw/flashplayer/help/settings_manager06.html</translation> <translation id="IDS_NEW_PROFILE_DIALOG_WIDTH_CHARS">60</translation> <translation id="IDS_SYNC_SETUP_WIZARD_WIDTH_CHARS">46</translation> <translation id="IDS_SYNC_SETUP_WIZARD_HEIGHT_LINES">15</translation>
diff --git a/chrome/app/settings_chromium_strings.grdp b/chrome/app/settings_chromium_strings.grdp index c65e65e..fdf2f2b6 100644 --- a/chrome/app/settings_chromium_strings.grdp +++ b/chrome/app/settings_chromium_strings.grdp
@@ -110,6 +110,9 @@ <message name="IDS_SETTINGS_SAFETY_CHECK_PASSWORDS_ERROR" desc="This text points out that the password check encountered an unknown error."> Chromium can't check your passwords. Try again later. </message> + <message name="IDS_SETTINGS_SAFETY_CHECK_SAFE_BROWSING_DISABLED" desc="This text points out that Safe Browsing is disabled and that the user is not protected."> + Safe Browsing is off. Chromium recommends turning it on. + </message> <message name="IDS_SETTINGS_SAFETY_CHECK_EXTENSIONS_ERROR" desc="This text describes that safety check could not check extensions for an unkown reason."> Chromium can't check your extensions. Try again later. </message>
diff --git a/chrome/app/settings_google_chrome_strings.grdp b/chrome/app/settings_google_chrome_strings.grdp index 935d92b4..5b25f5c 100644 --- a/chrome/app/settings_google_chrome_strings.grdp +++ b/chrome/app/settings_google_chrome_strings.grdp
@@ -110,6 +110,9 @@ <message name="IDS_SETTINGS_SAFETY_CHECK_PASSWORDS_ERROR" desc="This text points out that the password check encountered an unknown error."> Chrome can't check your passwords. Try again later. </message> + <message name="IDS_SETTINGS_SAFETY_CHECK_SAFE_BROWSING_DISABLED" desc="This text points out that Safe Browsing is disabled and that the user is not protected."> + Safe Browsing is off. Chrome recommends turning it on. + </message> <message name="IDS_SETTINGS_SAFETY_CHECK_EXTENSIONS_ERROR" desc="This text describes that safety check could not check extensions for an unkown reason."> Chrome can't check your extensions. Try again later. </message>
diff --git a/chrome/app/settings_strings.grdp b/chrome/app/settings_strings.grdp index 4e249f30..9b602bcdf 100644 --- a/chrome/app/settings_strings.grdp +++ b/chrome/app/settings_strings.grdp
@@ -1705,9 +1705,6 @@ <message name="IDS_SETTINGS_SAFETY_CHECK_SAFE_BROWSING_ENABLED" desc="This text points out that Safe Browsing is enabled and that the user is protected."> Safe Browsing is up to date and protecting you from harmful sites and downloads </message> - <message name="IDS_SETTINGS_SAFETY_CHECK_SAFE_BROWSING_DISABLED" desc="This text points out that Safe Browsing is disabled and that the user is not protected."> - Safe Browsing is off. To stay safe on the web, turn it on. - </message> <message name="IDS_SETTINGS_SAFETY_CHECK_SAFE_BROWSING_DISABLED_BY_ADMIN" desc="This text points out that Safe Browsing is disabled by an administrator."> <ph name="BEGIN_LINK"><a target="_blank" href="$1"></ph>Your administrator<ph name="END_LINK"></a></ph> has turned off Safe Browsing </message>
diff --git a/chrome/browser/BUILD.gn b/chrome/browser/BUILD.gn index 9ce664b7..9b9aebf 100644 --- a/chrome/browser/BUILD.gn +++ b/chrome/browser/BUILD.gn
@@ -2133,6 +2133,7 @@ "//components/renderer_context_menu", "//components/resources", "//components/safe_browsing/core:public", + "//components/safe_browsing/core/common:safe_browsing_policy_handler", "//components/safe_search_api", "//components/safe_search_api:safe_search_client", "//components/schema_org:extractor", @@ -3011,6 +3012,7 @@ "//chrome/common:non_code_constants", "//chrome/services/media_gallery_util/public/cpp", "//components/autofill_assistant/browser", + "//components/browser_ui/site_settings/android", "//components/browser_ui/util/android", "//components/cbor", "//components/cdm/browser", @@ -3191,6 +3193,8 @@ "download/download_shelf_context_menu.h", "download/download_shelf_controller.cc", "download/download_shelf_controller.h", + "enterprise/connectors/connectors_manager.cc", + "enterprise/connectors/connectors_manager.h", "enterprise/connectors/enterprise_connectors_policy_handler.cc", "enterprise/connectors/enterprise_connectors_policy_handler.h", "enterprise/reporting/browser_report_generator.cc",
diff --git a/chrome/browser/DEPS b/chrome/browser/DEPS index 99d8bab..8d2022f 100644 --- a/chrome/browser/DEPS +++ b/chrome/browser/DEPS
@@ -42,6 +42,7 @@ "+components/bookmarks/test", "+components/browser_ui/settings", "+components/browser_sync", + "+components/browser_ui/site_settings", "+components/browser_watcher", "+components/browsing_data/content", "+components/browsing_data/core",
diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc index 383138d3..5dc6f97b 100644 --- a/chrome/browser/about_flags.cc +++ b/chrome/browser/about_flags.cc
@@ -178,6 +178,7 @@ #if defined(OS_ANDROID) #include "chrome/browser/android/explore_sites/explore_sites_feature.h" #include "chrome/browser/flags/android/chrome_feature_list.h" +#include "components/browser_ui/site_settings/android/features.h" #include "components/external_intents/android/external_intents_feature_list.h" #else // OS_ANDROID #include "chrome/browser/media/router/media_router_feature.h" @@ -1969,7 +1970,7 @@ {"enable-app-notification-status-messaging", flag_descriptions::kAppNotificationStatusMessagingName, flag_descriptions::kAppNotificationStatusMessagingDescription, kOsAndroid, - FEATURE_VALUE_TYPE(features::kAppNotificationStatusMessaging)}, + FEATURE_VALUE_TYPE(browser_ui::kAppNotificationStatusMessaging)}, #endif // OS_ANDROID {"silent-debugger-extension-api", flag_descriptions::kSilentDebuggerExtensionApiName, @@ -4364,7 +4365,7 @@ {"allow-scroll-settings", flag_descriptions::kAllowScrollSettingsName, flag_descriptions::kAllowScrollSettingsDescription, kOsCrOS, - FEATURE_VALUE_TYPE(features::kAllowScrollSettings)}, + FEATURE_VALUE_TYPE(chromeos::features::kAllowScrollSettings)}, {"enable-streamlined-usb-printer-setup", flag_descriptions::kStreamlinedUsbPrinterSetupName,
diff --git a/chrome/browser/apps/app_service/app_service_metrics.cc b/chrome/browser/apps/app_service/app_service_metrics.cc index 81fb99fa..7cfc0273 100644 --- a/chrome/browser/apps/app_service/app_service_metrics.cc +++ b/chrome/browser/apps/app_service/app_service_metrics.cc
@@ -64,6 +64,7 @@ switch (launch_source) { case apps::mojom::LaunchSource::kUnknown: case apps::mojom::LaunchSource::kFromParentalControls: + case apps::mojom::LaunchSource::kFromTest: return; case apps::mojom::LaunchSource::kFromAppListGrid: base::UmaHistogramEnumeration("Apps.DefaultAppLaunch.FromAppListGrid", @@ -118,6 +119,10 @@ base::UmaHistogramEnumeration("Apps.DefaultAppLaunch.FromMenu", default_app_name); break; + case apps::mojom::LaunchSource::kFromInstalledNotification: + base::UmaHistogramEnumeration( + "Apps.DefaultAppLaunch.FromInstalledNotification", default_app_name); + break; } } @@ -146,6 +151,8 @@ case apps::mojom::LaunchSource::kFromKeyboard: case apps::mojom::LaunchSource::kFromOtherApp: case apps::mojom::LaunchSource::kFromMenu: + case apps::mojom::LaunchSource::kFromInstalledNotification: + case apps::mojom::LaunchSource::kFromTest: break; } }
diff --git a/chrome/browser/apps/app_service/extension_apps.cc b/chrome/browser/apps/app_service/extension_apps.cc index f152ceb..85b0f69 100644 --- a/chrome/browser/apps/app_service/extension_apps.cc +++ b/chrome/browser/apps/app_service/extension_apps.cc
@@ -73,6 +73,7 @@ #include "extensions/browser/app_window/app_window.h" #include "extensions/browser/extension_system.h" #include "extensions/browser/management_policy.h" +#include "extensions/browser/ui_util.h" #include "extensions/common/constants.h" #include "extensions/common/extension_urls.h" #include "extensions/common/manifest_handlers/options_page_info.h" @@ -133,6 +134,8 @@ case apps::mojom::LaunchSource::kFromKeyboard: case apps::mojom::LaunchSource::kFromOtherApp: case apps::mojom::LaunchSource::kFromMenu: + case apps::mojom::LaunchSource::kFromInstalledNotification: + case apps::mojom::LaunchSource::kFromTest: return ash::LAUNCH_FROM_UNKNOWN; } } @@ -433,13 +436,15 @@ case apps::mojom::LaunchSource::kFromKeyboard: case apps::mojom::LaunchSource::kFromOtherApp: case apps::mojom::LaunchSource::kFromMenu: + case apps::mojom::LaunchSource::kFromInstalledNotification: + case apps::mojom::LaunchSource::kFromTest: break; } // The app will be created for the currently active profile. AppLaunchParams params = CreateAppLaunchParamsWithEventFlags( - profile_, extension, event_flags, - apps::mojom::AppLaunchSource::kSourceAppLauncher, display_id); + profile_, extension, event_flags, GetAppLaunchSource(launch_source), + display_id); ash::ShelfLaunchSource source = ConvertLaunchSource(launch_source); if ((source == ash::LAUNCH_FROM_APP_LIST || source == ash::LAUNCH_FROM_APP_LIST_SEARCH) && @@ -756,7 +761,8 @@ chrome::ShowSiteSettings( profile_, extensions::AppLaunchInfo::GetFullLaunchURL(extension)); - } else if (extension->ShouldDisplayInExtensionSettings()) { + } else if (extensions::ui_util::ShouldDisplayInExtensionSettings( + *extension)) { Browser* browser = chrome::FindTabbedBrowser(profile_, false); if (!browser) { browser = new Browser(Browser::CreateParams(profile_, true));
diff --git a/chrome/browser/apps/app_service/launch_utils.cc b/chrome/browser/apps/app_service/launch_utils.cc index 138de5a..7cfa5202 100644 --- a/chrome/browser/apps/app_service/launch_utils.cc +++ b/chrome/browser/apps/app_service/launch_utils.cc
@@ -153,14 +153,19 @@ case apps::mojom::LaunchSource::kFromShelf: case apps::mojom::LaunchSource::kFromLink: case apps::mojom::LaunchSource::kFromOmnibox: - case apps::mojom::LaunchSource::kFromKeyboard: case apps::mojom::LaunchSource::kFromOtherApp: case apps::mojom::LaunchSource::kFromMenu: return apps::mojom::AppLaunchSource::kSourceAppLauncher; + case apps::mojom::LaunchSource::kFromKeyboard: + return apps::mojom::AppLaunchSource::kSourceKeyboard; case apps::mojom::LaunchSource::kFromFileManager: return apps::mojom::AppLaunchSource::kSourceFileHandler; case apps::mojom::LaunchSource::kFromChromeInternal: return apps::mojom::AppLaunchSource::kSourceChromeInternal; + case apps::mojom::LaunchSource::kFromInstalledNotification: + return apps::mojom::AppLaunchSource::kSourceInstalledNotification; + case apps::mojom::LaunchSource::kFromTest: + return apps::mojom::AppLaunchSource::kSourceTest; } }
diff --git a/chrome/browser/apps/app_service/launch_utils.h b/chrome/browser/apps/app_service/launch_utils.h index 50aca5f..37c4882 100644 --- a/chrome/browser/apps/app_service/launch_utils.h +++ b/chrome/browser/apps/app_service/launch_utils.h
@@ -10,6 +10,7 @@ #include "chrome/browser/apps/app_service/app_launch_params.h" #include "chrome/services/app_service/public/mojom/types.mojom.h" +#include "components/services/app_service/public/mojom/types.mojom.h" #include "ui/base/window_open_disposition.h" class Browser;
diff --git a/chrome/browser/apps/app_service/web_apps.cc b/chrome/browser/apps/app_service/web_apps.cc index 83aa374..a1e796b 100644 --- a/chrome/browser/apps/app_service/web_apps.cc +++ b/chrome/browser/apps/app_service/web_apps.cc
@@ -218,8 +218,8 @@ GetRegistrar().GetAppEffectiveDisplayMode(app_id); AppLaunchParams params = apps::CreateAppIdLaunchParamsWithEventFlags( - web_app->app_id(), event_flags, - apps::mojom::AppLaunchSource::kSourceAppLauncher, display_id, + web_app->app_id(), event_flags, GetAppLaunchSource(launch_source), + display_id, /*fallback_container=*/ web_app::ConvertDisplayModeToAppLaunchContainer(display_mode));
diff --git a/chrome/browser/browser_resources.grd b/chrome/browser/browser_resources.grd index ac1ff4c..5544091 100644 --- a/chrome/browser/browser_resources.grd +++ b/chrome/browser/browser_resources.grd
@@ -60,6 +60,7 @@ <include name="IDR_DISCARDS_LIFECYCLE_UNIT_STATE_MOJOM_LITE_JS" file="${root_gen_dir}\chrome\browser\resource_coordinator\lifecycle_unit_state.mojom-lite.js" compress="gzip" use_base_dir="false" type="BINDATA" /> <include name="IDR_DISCARDS_MOJOM_LITE_JS" file="${root_gen_dir}\chrome\browser\ui\webui\discards\discards.mojom-lite.js" compress="gzip" use_base_dir="false" type="BINDATA" /> <include name="IDR_DISCARDS_MOJO_PUBLIC_BASE_PROCESS_ID_MOJOM_LITE_JS" file="${root_gen_dir}\mojo\public\mojom\base\process_id.mojom-lite.js" compress="gzip" use_base_dir="false" type="BINDATA" /> + <include name="IDR_DISCARDS_SITE_DATA_MOJOM_LITE_JS" file="${root_gen_dir}\chrome\browser\ui\webui\discards\site_data.mojom-lite.js" compress="gzip" use_base_dir="false" type="BINDATA" /> <include name="IDR_DISCARDS_SORTED_TABLE_BEHAVIOR_JS" file="resources\discards\sorted_table_behavior.js" compress="gzip" type="BINDATA" /> </if> <if expr="is_win or is_macosx or (is_linux and not chromeos)"> @@ -190,8 +191,10 @@ <if expr="is_win or is_macosx or desktop_linux"> <include name="IDR_SIGNIN_EMAIL_CONFIRMATION_HTML" file="resources\signin\signin_email_confirmation\signin_email_confirmation.html" flattenhtml="true" allowexternalscript="true" type="BINDATA" /> <include name="IDR_SIGNIN_EMAIL_CONFIRMATION_APP_JS" file="${root_gen_dir}\chrome\browser\resources\signin\signin_email_confirmation\signin_email_confirmation_app.js" use_base_dir="false" preprocess="true" type="BINDATA" /> - <include name="IDR_SIGNIN_ERROR_HTML" file="resources\signin\signin_error\signin_error.html" flattenhtml="true" allowexternalscript="true" type="BINDATA" /> + <include name="IDR_SIGNIN_ERROR_HTML" file="resources\signin\signin_error\signin_error.html" type="BINDATA" /> <include name="IDR_SIGNIN_ERROR_JS" file="resources\signin\signin_error\signin_error.js" type="BINDATA" /> + <include name="IDR_SIGNIN_ERROR_APP_HTML" file="resources\signin\signin_error\signin_error_app.html" preprocess="true" type="BINDATA" /> + <include name="IDR_SIGNIN_ERROR_APP_JS" file="resources\signin\signin_error\signin_error_app.js" type="BINDATA" /> </if> <include name="IDR_USB_ENUMERATION_OPTIONS_MOJOM_LITE_JS" file="${root_gen_dir}\services\device\public\mojom\usb_enumeration_options.mojom-lite.js" use_base_dir="false" flattenhtml="true" allowexternalscript="true" type="BINDATA" compress="gzip" /> <include name="IDR_USB_DEVICE_MANAGER_CLIENT_MOJOM_LITE_JS" file="${root_gen_dir}\services\device\public\mojom\usb_manager_client.mojom-lite.js" use_base_dir="false" flattenhtml="true" allowexternalscript="true" type="BINDATA" compress="gzip" />
diff --git a/chrome/browser/chrome_browser_interface_binders.cc b/chrome/browser/chrome_browser_interface_binders.cc index 8bd27a7..8b133418 100644 --- a/chrome/browser/chrome_browser_interface_binders.cc +++ b/chrome/browser/chrome_browser_interface_binders.cc
@@ -113,6 +113,7 @@ defined(OS_CHROMEOS) #include "chrome/browser/ui/webui/discards/discards.mojom.h" #include "chrome/browser/ui/webui/discards/discards_ui.h" +#include "chrome/browser/ui/webui/discards/site_data.mojom.h" #endif #if defined(OS_CHROMEOS) @@ -538,6 +539,9 @@ RegisterWebUIControllerInterfaceBinder<discards::mojom::GraphDump, DiscardsUI>(map); + + RegisterWebUIControllerInterfaceBinder<discards::mojom::SiteDataProvider, + DiscardsUI>(map); #endif #if BUILDFLAG(ENABLE_FEED_IN_CHROME)
diff --git a/chrome/browser/chromeos/BUILD.gn b/chrome/browser/chromeos/BUILD.gn index 94f384d..ded1f71e 100644 --- a/chrome/browser/chromeos/BUILD.gn +++ b/chrome/browser/chromeos/BUILD.gn
@@ -172,6 +172,7 @@ "//chromeos/services/multidevice_setup/public/cpp:auth_token_validator", "//chromeos/services/multidevice_setup/public/cpp:oobe_completion_tracker", "//chromeos/services/multidevice_setup/public/cpp:prefs", + "//chromeos/services/network_config:in_process_instance", "//chromeos/services/secure_channel", "//chromeos/services/secure_channel/public/cpp/client", "//chromeos/settings", @@ -1700,6 +1701,8 @@ "net/delay_network_call.h", "net/dhcp_wpad_url_client.cc", "net/dhcp_wpad_url_client.h", + "net/network_health.cc", + "net/network_health.h", "net/network_portal_detector_impl.cc", "net/network_portal_detector_impl.h", "net/network_portal_detector_test_impl.cc", @@ -2973,6 +2976,7 @@ "login/version_updater/version_updater_unittest.cc", "mobile/mobile_activator_unittest.cc", "net/client_cert_store_chromeos_unittest.cc", + "net/network_health_unittest.cc", "net/network_portal_detector_impl_unittest.cc", "net/network_pref_state_observer_unittest.cc", "net/network_throttling_observer_unittest.cc",
diff --git a/chrome/browser/chromeos/android_sms/android_sms_app_manager_impl.cc b/chrome/browser/chromeos/android_sms/android_sms_app_manager_impl.cc index 4ba8434..118b1dae 100644 --- a/chrome/browser/chromeos/android_sms/android_sms_app_manager_impl.cc +++ b/chrome/browser/chromeos/android_sms/android_sms_app_manager_impl.cc
@@ -9,7 +9,9 @@ #include "base/bind.h" #include "base/bind_helpers.h" #include "base/callback.h" -#include "chrome/browser/apps/launch_service/launch_service.h" +#include "chrome/browser/apps/app_service/app_service_proxy.h" +#include "chrome/browser/apps/app_service/app_service_proxy_factory.h" +#include "chrome/browser/apps/app_service/launch_utils.h" #include "chrome/browser/chromeos/android_sms/android_sms_app_setup_controller.h" #include "chrome/browser/chromeos/android_sms/android_sms_urls.h" #include "chrome/browser/profiles/profile.h" @@ -17,6 +19,7 @@ #include "chromeos/components/multidevice/logging/logging.h" #include "components/prefs/pref_registry_simple.h" #include "components/prefs/pref_service.h" +#include "ui/display/types/display_constants.h" namespace chromeos { @@ -41,10 +44,18 @@ AndroidSmsAppManagerImpl::PwaDelegate::~PwaDelegate() = default; -content::WebContents* AndroidSmsAppManagerImpl::PwaDelegate::OpenApp( - Profile* profile, - const apps::AppLaunchParams& params) { - return apps::LaunchService::Get(profile)->OpenApplication(params); +void AndroidSmsAppManagerImpl::PwaDelegate::OpenApp(Profile* profile, + const std::string& app_id) { + apps::AppServiceProxy* proxy = + apps::AppServiceProxyFactory::GetForProfile(profile); + DCHECK(proxy); + proxy->Launch( + app_id, + apps::GetEventFlags(apps::mojom::LaunchContainer::kLaunchContainerWindow, + WindowOpenDisposition::NEW_WINDOW, + false /* preferred_containner */), + apps::mojom::LaunchSource::kFromChromeInternal, + display::kInvalidDisplayId); } bool AndroidSmsAppManagerImpl::PwaDelegate::TransferItemAttributes( @@ -250,13 +261,9 @@ // Otherwise, launch the app. PA_LOG(VERBOSE) << "AndroidSmsAppManagerImpl::HandleAppSetupFinished(): " << "Launching Messages PWA."; - pwa_delegate_->OpenApp( - profile_, apps::AppLaunchParams( - *setup_controller_->GetPwa(GetAndroidMessagesURL( - true /* use_install_url */, *domain)), - apps::mojom::LaunchContainer::kLaunchContainerWindow, - WindowOpenDisposition::NEW_WINDOW, - apps::mojom::AppLaunchSource::kSourceChromeInternal)); + pwa_delegate_->OpenApp(profile_, + *setup_controller_->GetPwa(GetAndroidMessagesURL( + true /* use_install_url */, *domain))); } void AndroidSmsAppManagerImpl::SetPwaDelegateForTesting(
diff --git a/chrome/browser/chromeos/android_sms/android_sms_app_manager_impl.h b/chrome/browser/chromeos/android_sms/android_sms_app_manager_impl.h index d76f880a..5d2e85b 100644 --- a/chrome/browser/chromeos/android_sms/android_sms_app_manager_impl.h +++ b/chrome/browser/chromeos/android_sms/android_sms_app_manager_impl.h
@@ -26,10 +26,6 @@ class AppListSyncableService; } // namespace app_list -namespace content { -class WebContents; -} // namespace content - namespace chromeos { namespace android_sms { @@ -57,8 +53,7 @@ public: PwaDelegate(); virtual ~PwaDelegate(); - virtual content::WebContents* OpenApp(Profile* profile, - const apps::AppLaunchParams& params); + virtual void OpenApp(Profile* profile, const std::string& app_id); virtual bool TransferItemAttributes( const std::string& from_app_id, const std::string& to_app_id,
diff --git a/chrome/browser/chromeos/android_sms/android_sms_app_manager_impl_unittest.cc b/chrome/browser/chromeos/android_sms/android_sms_app_manager_impl_unittest.cc index d302e3d..69c82dd 100644 --- a/chrome/browser/chromeos/android_sms/android_sms_app_manager_impl_unittest.cc +++ b/chrome/browser/chromeos/android_sms/android_sms_app_manager_impl_unittest.cc
@@ -71,10 +71,8 @@ } // AndroidSmsAppManagerImpl::PwaDelegate: - content::WebContents* OpenApp(Profile*, const apps::AppLaunchParams& params) - override { - opened_app_ids_.push_back(params.app_id); - return nullptr; + void OpenApp(Profile*, const std::string& app_id) override { + opened_app_ids_.push_back(app_id); } bool TransferItemAttributes(
diff --git a/chrome/browser/chromeos/arc/accessibility/ax_tree_source_arc.cc b/chrome/browser/chromeos/arc/accessibility/ax_tree_source_arc.cc index 8fac50c..eafe90c 100644 --- a/chrome/browser/chromeos/arc/accessibility/ax_tree_source_arc.cc +++ b/chrome/browser/chromeos/arc/accessibility/ax_tree_source_arc.cc
@@ -200,6 +200,11 @@ event_data->event_type, focused_node ? focused_node->GetNode() : nullptr); event.id = event_data->source_id; + if (HasProperty(event_data->int_properties, + arc::mojom::AccessibilityEventIntProperty::ACTION)) { + event.event_from = ax::mojom::EventFrom::kAction; + } + if ((event_data->event_type == AXEventType::WINDOW_CONTENT_CHANGED || event_data->event_type == AXEventType::VIEW_SCROLLED) && chrome_focused_id_ && chrome_focused_bounds_) {
diff --git a/chrome/browser/chromeos/arc/arc_util_unittest.cc b/chrome/browser/chromeos/arc/arc_util_unittest.cc index 16bb25b..9250307 100644 --- a/chrome/browser/chromeos/arc/arc_util_unittest.cc +++ b/chrome/browser/chromeos/arc/arc_util_unittest.cc
@@ -700,13 +700,13 @@ ScopedLogIn login(GetFakeUserManager(), AccountId::FromUserEmail("public_user@gmail.com"), user_manager::USER_TYPE_PUBLIC_ACCOUNT); - EXPECT_FALSE(IsPlayStoreAvailable()); + EXPECT_TRUE(IsPlayStoreAvailable()); } -TEST_F(ChromeArcUtilTest, ArcStartModeDefaultDemoModeWithPlayStore) { +TEST_F(ChromeArcUtilTest, ArcStartModeDefaultDemoModeWithoutPlayStore) { base::test::ScopedFeatureList feature_list; feature_list.InitWithFeatureState(chromeos::features::kShowPlayInDemoMode, - true /* enabled */); + false /* disabled */); auto* command_line = base::CommandLine::ForCurrentProcess(); command_line->InitFromArgv({"", "--arc-availability=installed"}); chromeos::DemoSession::SetDemoConfigForTesting( @@ -714,7 +714,7 @@ ScopedLogIn login(GetFakeUserManager(), AccountId::FromUserEmail("public_user@gmail.com"), user_manager::USER_TYPE_PUBLIC_ACCOUNT); - EXPECT_TRUE(IsPlayStoreAvailable()); + EXPECT_FALSE(IsPlayStoreAvailable()); } TEST_F(ChromeArcUtilTest, ArcStartModeWithoutPlayStore) {
diff --git a/chrome/browser/chromeos/child_accounts/time_limits/app_activity_registry.cc b/chrome/browser/chromeos/child_accounts/time_limits/app_activity_registry.cc index 1c60ca0..cc042280 100644 --- a/chrome/browser/chromeos/child_accounts/time_limits/app_activity_registry.cc +++ b/chrome/browser/chromeos/child_accounts/time_limits/app_activity_registry.cc
@@ -15,7 +15,6 @@ #include "chrome/browser/chromeos/child_accounts/time_limits/app_time_notification_delegate.h" #include "chrome/browser/chromeos/child_accounts/time_limits/app_time_policy_helpers.h" #include "chrome/browser/chromeos/child_accounts/time_limits/persisted_app_info.h" -#include "chrome/browser/profiles/profile.h" #include "chrome/browser/ui/browser.h" #include "chrome/browser/ui/browser_list.h" #include "chrome/browser/ui/browser_window.h" @@ -164,14 +163,14 @@ AppActivityRegistry::AppActivityRegistry( AppServiceWrapper* app_service_wrapper, AppTimeNotificationDelegate* notification_delegate, - Profile* profile) - : profile_(profile), + PrefService* pref_service) + : pref_service_(pref_service), app_service_wrapper_(app_service_wrapper), notification_delegate_(notification_delegate), save_data_to_pref_service_(base::DefaultTickClock::GetInstance()) { DCHECK(app_service_wrapper_); DCHECK(notification_delegate_); - DCHECK(profile_); + DCHECK(pref_service_); if (ShouldCleanUpStoredPref()) CleanRegistry(base::Time::Now() - base::TimeDelta::FromDays(30)); @@ -410,9 +409,8 @@ return AppActivityReportInterface::ReportParams{timestamp, false}; } - PrefService* pref_service = profile_->GetPrefs(); const base::Value* value = - pref_service->GetList(prefs::kPerAppTimeLimitsAppActivities); + pref_service_->GetList(prefs::kPerAppTimeLimitsAppActivities); DCHECK(value); const std::vector<PersistedAppInfo> applications_info = @@ -461,7 +459,7 @@ CleanRegistry(timestamp); // Update last successful report time. - profile_->GetPrefs()->SetInt64( + pref_service_->SetInt64( prefs::kPerAppTimeLimitsLastSuccessfulReportTime, timestamp.ToDeltaSinceWindowsEpoch().InMicroseconds()); } @@ -472,17 +470,19 @@ bool policy_updated = false; for (auto& entry : activity_registry_) { const AppId& app_id = entry.first; - base::Optional<AppLimit> new_limit; + + // Web time limits are updated when chrome's time limit is updated. Return. + if (app_id.app_type() == apps::mojom::AppType::kWeb) + continue; + + base::Optional<AppLimit> new_limit = base::nullopt; if (base::Contains(app_limits, app_id)) new_limit = app_limits.at(app_id); - bool is_web = ContributesToWebTimeLimit(app_id, GetAppState(app_id)); - if (is_web && base::Contains(app_limits, GetChromeAppId())) - new_limit = app_limits.at(GetChromeAppId()); - + // If chrome is installed, update chrome's and web apps' time limit. // In Family Link app Chrome on Chrome OS is combined together with Android // Chrome. Therefore, use Android Chrome's time limit. - if (is_web && !base::Contains(app_limits, GetChromeAppId()) && + if (app_id == GetChromeAppId() && base::Contains(app_limits, GetAndroidChromeAppId())) { new_limit = app_limits.at(GetAndroidChromeAppId()); } @@ -496,7 +496,7 @@ latest_app_limit_update_ = latest_update; // Update the latest app limit update. - profile_->GetPrefs()->SetInt64( + pref_service_->SetInt64( prefs::kPerAppTimeLimitsLatestLimitUpdateTime, latest_app_limit_update_.ToDeltaSinceWindowsEpoch().InMicroseconds()); @@ -514,7 +514,6 @@ return false; AppDetails& details = activity_registry_.at(app_id); - // Limit 'data' are considered equal if only the |last_updated_| is different. // Update the limit to store new |last_updated_| value. bool did_change = !details.IsLimitEqual(app_limit); @@ -536,31 +535,23 @@ return false; } - // Limit for the active app changed - adjust the timers. - // Handling of active app is different, because ongoing activity needs to be - // taken into account. - if (IsAppActive(app_id)) { - details.ResetTimeCheck(); - ScheduleTimeLimitCheckForApp(app_id); + if (app_id != GetChromeAppId() && + app_id.app_type() != apps::mojom::AppType::kWeb) { + AppLimitUpdated(app_id); return updated; } - // Inactive available app reached the limit - update the state. - // If app is in any other state than |kAvailable| the limit does not take - // effect. - if (IsAppAvailable(app_id) && details.IsLimitReached()) { - SetAppInactive(app_id, base::Time::Now()); - SetAppState(app_id, AppState::kLimitReached); - return updated; + for (auto& entry : activity_registry_) { + const AppId& app_id = entry.first; + AppDetails& details = entry.second; + if (ContributesToWebTimeLimit(app_id, GetAppState(app_id))) + details.limit = app_limit; } - // Paused inactive app is below the limit again - update the state. - // This can happen if the limit was removed or new limit is greater the the - // previous one. We know that the state should be available, because app can - // only reach the limit if it is available. - if (IsAppTimeLimitReached(app_id) && !details.IsLimitReached()) { - SetAppState(app_id, AppState::kAvailable); - return updated; + for (auto& entry : activity_registry_) { + const AppId& app_id = entry.first; + if (ContributesToWebTimeLimit(app_id, GetAppState(app_id))) + AppLimitUpdated(app_id); } return updated; @@ -621,8 +612,7 @@ void AppActivityRegistry::SaveAppActivity() { { - ListPrefUpdate update(profile_->GetPrefs(), - prefs::kPerAppTimeLimitsAppActivities); + ListPrefUpdate update(pref_service_, prefs::kPerAppTimeLimitsAppActivities); base::ListValue* list_value = update.Get(); const base::Time now = base::Time::Now(); @@ -654,7 +644,7 @@ } // Ensure that the app activity is persisted. - profile_->GetPrefs()->CommitPendingWrite(); + pref_service_->CommitPendingWrite(); } std::vector<AppId> AppActivityRegistry::GetAppsWithAppRestriction( @@ -693,8 +683,7 @@ } void AppActivityRegistry::CleanRegistry(base::Time timestamp) { - ListPrefUpdate update(profile_->GetPrefs(), - prefs::kPerAppTimeLimitsAppActivities); + ListPrefUpdate update(pref_service_, prefs::kPerAppTimeLimitsAppActivities); base::ListValue* list_value = update.Get(); @@ -743,6 +732,14 @@ void AppActivityRegistry::Add(const AppId& app_id) { activity_registry_[app_id].activity = AppActivity(AppState::kAvailable); activity_registry_[app_id].received_app_installed_ = true; + + if (app_id.app_type() == apps::mojom::AppType::kWeb && + base::Contains(activity_registry_, GetChromeAppId())) { + activity_registry_[app_id].limit = GetWebTimeLimit(); + activity_registry_[app_id].activity.SetAppState( + GetAppState(GetChromeAppId())); + } + newly_installed_apps_.push_back(app_id); for (auto& observer : app_state_observers_) observer.OnAppInstalled(app_id); @@ -1027,11 +1024,10 @@ } void AppActivityRegistry::InitializeRegistryFromPref() { - PrefService* pref_service = profile_->GetPrefs(); - DCHECK(pref_service); + DCHECK(pref_service_); int64_t last_limits_updates = - pref_service->GetInt64(prefs::kPerAppTimeLimitsLatestLimitUpdateTime); + pref_service_->GetInt64(prefs::kPerAppTimeLimitsLatestLimitUpdateTime); latest_app_limit_update_ = base::Time::FromDeltaSinceWindowsEpoch( base::TimeDelta::FromMicroseconds(last_limits_updates)); @@ -1040,9 +1036,8 @@ } void AppActivityRegistry::InitializeAppActivities() { - PrefService* pref_service = profile_->GetPrefs(); const base::Value* value = - pref_service->GetList(prefs::kPerAppTimeLimitsAppActivities); + pref_service_->GetList(prefs::kPerAppTimeLimitsAppActivities); DCHECK(value); const std::vector<PersistedAppInfo> applications_info = @@ -1090,8 +1085,8 @@ } bool AppActivityRegistry::ShouldCleanUpStoredPref() { - int64_t last_time = profile_->GetPrefs()->GetInt64( - prefs::kPerAppTimeLimitsLastSuccessfulReportTime); + int64_t last_time = + pref_service_->GetInt64(prefs::kPerAppTimeLimitsLastSuccessfulReportTime); if (last_time == 0) return false; @@ -1138,5 +1133,35 @@ app_id, notification.time_limit, notification.notification); } +void AppActivityRegistry::AppLimitUpdated(const AppId& app_id) { + DCHECK(base::Contains(activity_registry_, app_id)); + AppDetails& details = activity_registry_.at(app_id); + + // Limit for the active app changed - adjust the timers. + // Handling of active app is different, because ongoing activity needs to be + // taken into account. + if (IsAppActive(app_id)) { + details.ResetTimeCheck(); + ScheduleTimeLimitCheckForApp(app_id); + return; + } + + // Inactive available app reached the limit - update the state. + // If app is in any other state than |kAvailable| the limit does not take + // effect. + if (IsAppAvailable(app_id) && details.IsLimitReached()) { + SetAppInactive(app_id, base::Time::Now()); + SetAppState(app_id, AppState::kLimitReached); + return; + } + + // Paused inactive app is below the limit again - update the state. + // This can happen if the limit was removed or new limit is greater the the + // previous one. We know that the state should be available, because app can + // only reach the limit if it is available. + if (IsAppTimeLimitReached(app_id) && !details.IsLimitReached()) + SetAppState(app_id, AppState::kAvailable); +} + } // namespace app_time } // namespace chromeos
diff --git a/chrome/browser/chromeos/child_accounts/time_limits/app_activity_registry.h b/chrome/browser/chromeos/child_accounts/time_limits/app_activity_registry.h index 498c1977..943144f8 100644 --- a/chrome/browser/chromeos/child_accounts/time_limits/app_activity_registry.h +++ b/chrome/browser/chromeos/child_accounts/time_limits/app_activity_registry.h
@@ -27,7 +27,7 @@ } // namespace enterprise_management class PrefRegistrySimple; -class Profile; +class PrefService; namespace chromeos { namespace app_time { @@ -82,7 +82,7 @@ AppActivityRegistry(AppServiceWrapper* app_service_wrapper, AppTimeNotificationDelegate* notification_delegate, - Profile* profile); + PrefService* pref_service); AppActivityRegistry(const AppActivityRegistry&) = delete; AppActivityRegistry& operator=(const AppActivityRegistry&) = delete; ~AppActivityRegistry() override; @@ -297,7 +297,11 @@ void MaybeShowSystemNotification(const AppId& app_id, const SystemNotification& notification); - Profile* const profile_; + // Called by AppActivityRegistry::SetAppLimit after the application's limit + // has been updated. + void AppLimitUpdated(const AppId& app_id); + + PrefService* const pref_service_; // Owned by AppTimeController. AppServiceWrapper* const app_service_wrapper_;
diff --git a/chrome/browser/chromeos/child_accounts/time_limits/app_activity_registry_unittest.cc b/chrome/browser/chromeos/child_accounts/time_limits/app_activity_registry_unittest.cc index ece28be9..fadebbb5 100644 --- a/chrome/browser/chromeos/child_accounts/time_limits/app_activity_registry_unittest.cc +++ b/chrome/browser/chromeos/child_accounts/time_limits/app_activity_registry_unittest.cc
@@ -99,7 +99,7 @@ AppTimeNotificationDelegateMock& notification_delegate_mock() { return notification_delegate_mock_; } - Profile& profile() { return profile_; } + PrefService* prefs() { return profile_.GetPrefs(); } void CreateAppActivityForApp(const AppId& app_id, base::TimeDelta activity_length); @@ -154,7 +154,7 @@ void AppActivityRegistryTest::ReInitializeRegistry() { registry_ = std::make_unique<AppActivityRegistry>( - &wrapper_, ¬ification_delegate_mock_, &profile_); + &wrapper_, ¬ification_delegate_mock_, prefs()); registry_test_ = std::make_unique<AppActivityRegistry::TestApi>(registry_.get()); @@ -663,7 +663,7 @@ // Now let's test that the app activity are stored appropriately. const base::Value* value = - profile().GetPrefs()->GetList(prefs::kPerAppTimeLimitsAppActivities); + prefs()->GetList(prefs::kPerAppTimeLimitsAppActivities); const std::vector<PersistedAppInfo> app_infos = PersistedAppInfo::PersistedAppInfosFromList( @@ -705,7 +705,7 @@ // Now let's test that the app activity are stored appropriately. const base::Value* value = - profile().GetPrefs()->GetList(prefs::kPerAppTimeLimitsAppActivities); + prefs()->GetList(prefs::kPerAppTimeLimitsAppActivities); const std::vector<PersistedAppInfo> app_infos = PersistedAppInfo::PersistedAppInfosFromList( @@ -722,7 +722,7 @@ registry().OnSuccessfullyReported(base::Time::Now()); const base::Value* new_value = - profile().GetPrefs()->GetList(prefs::kPerAppTimeLimitsAppActivities); + prefs()->GetList(prefs::kPerAppTimeLimitsAppActivities); const std::vector<PersistedAppInfo> final_app_infos = PersistedAppInfo::PersistedAppInfosFromList( @@ -742,18 +742,18 @@ CreateAppActivityForApp(kApp1, base::TimeDelta::FromHours(1)); CreateAppActivityForApp(kApp2, base::TimeDelta::FromHours(1)); - profile().GetPrefs()->SetInt64( - prefs::kPerAppTimeLimitsLastSuccessfulReportTime, - start_time.ToDeltaSinceWindowsEpoch().InMicroseconds()); + prefs()->SetInt64(prefs::kPerAppTimeLimitsLastSuccessfulReportTime, + start_time.ToDeltaSinceWindowsEpoch().InMicroseconds()); - task_environment()->FastForwardBy(base::TimeDelta::FromDays(30)); + task_environment()->AdvanceClock(base::TimeDelta::FromDays(30)); + task_environment()->RunUntilIdle(); // Now let's recreate AppActivityRegistry. Its state should be restored. ReInitializeRegistry(); // Now let's test that the app activity are stored appropriately. const base::Value* value = - profile().GetPrefs()->GetList(prefs::kPerAppTimeLimitsAppActivities); + prefs()->GetList(prefs::kPerAppTimeLimitsAppActivities); const std::vector<PersistedAppInfo> app_infos = PersistedAppInfo::PersistedAppInfosFromList( @@ -1035,5 +1035,69 @@ registry().OnAppAvailable(kApp1); } +TEST_F(AppActivityRegistryTest, LimitSetAfterActivity) { + AppStateObserverMock state_observer_mock; + registry().AddAppStateObserver(&state_observer_mock); + + const AppId kApp3(apps::mojom::AppType::kWeb, "l"); + registry().OnAppInstalled(kApp3); + registry().OnAppAvailable(kApp3); + + CreateAppActivityForApp(kApp3, base::TimeDelta::FromHours(1)); + + registry().OnAppActive(kApp3, CreateWindowForApp(kApp3), base::Time::Now()); + + const AppLimit web_limit(AppRestriction::kTimeLimit, + base::TimeDelta::FromMinutes(20), base::Time::Now()); + EXPECT_CALL( + state_observer_mock, + OnAppLimitReached(GetChromeAppId(), web_limit.daily_limit().value(), + /* was_active */ false)) + .Times(1); + EXPECT_CALL(state_observer_mock, + OnAppLimitReached(kApp2, web_limit.daily_limit().value(), + /* was_active */ false)) + .Times(1); + EXPECT_CALL(state_observer_mock, + OnAppLimitReached(kApp3, web_limit.daily_limit().value(), + /* was_active */ true)) + .Times(1); + const std::map<AppId, AppLimit> limits{{GetChromeAppId(), web_limit}}; + registry().UpdateAppLimits(limits); +} + +TEST_F(AppActivityRegistryTest, WebAppInstalled) { + AppStateObserverMock state_observer_mock; + registry().AddAppStateObserver(&state_observer_mock); + const AppLimit web_limit(AppRestriction::kTimeLimit, + base::TimeDelta::FromHours(2), base::Time::Now()); + const std::map<AppId, AppLimit> limits{{GetChromeAppId(), web_limit}}; + registry().UpdateAppLimits(limits); + + registry().OnAppActive(kApp2, CreateWindowForApp(kApp2), base::Time::Now()); + task_environment()->FastForwardBy(base::TimeDelta::FromHours(1)); + + // Now a new application is installed. + const AppId kApp3(apps::mojom::AppType::kWeb, "l"); + + registry().OnAppInstalled(kApp3); + registry().OnAppAvailable(kApp3); + + EXPECT_CALL( + state_observer_mock, + OnAppLimitReached(GetChromeAppId(), web_limit.daily_limit().value(), + /* was_active */ false)) + .Times(1); + EXPECT_CALL(state_observer_mock, + OnAppLimitReached(kApp2, web_limit.daily_limit().value(), + /* was_active */ true)) + .Times(1); + EXPECT_CALL(state_observer_mock, + OnAppLimitReached(kApp3, web_limit.daily_limit().value(), + /* was_active */ false)) + .Times(1); + task_environment()->FastForwardBy(base::TimeDelta::FromHours(1)); +} + } // namespace app_time } // namespace chromeos
diff --git a/chrome/browser/chromeos/child_accounts/time_limits/app_time_controller.cc b/chrome/browser/chromeos/child_accounts/time_limits/app_time_controller.cc index 35214fe..99b927f 100644 --- a/chrome/browser/chromeos/child_accounts/time_limits/app_time_controller.cc +++ b/chrome/browser/chromeos/child_accounts/time_limits/app_time_controller.cc
@@ -234,7 +234,7 @@ app_registry_( std::make_unique<AppActivityRegistry>(app_service_wrapper_.get(), this, - profile)), + profile->GetPrefs())), web_time_activity_provider_(std::make_unique<WebTimeActivityProvider>( this, app_service_wrapper_.get())) {
diff --git a/chrome/browser/chromeos/chrome_browser_main_chromeos.cc b/chrome/browser/chromeos/chrome_browser_main_chromeos.cc index 7daf3ab7..0e5f6f7 100644 --- a/chrome/browser/chromeos/chrome_browser_main_chromeos.cc +++ b/chrome/browser/chromeos/chrome_browser_main_chromeos.cc
@@ -85,6 +85,7 @@ #include "chrome/browser/chromeos/login/startup_utils.h" #include "chrome/browser/chromeos/login/users/chrome_user_manager.h" #include "chrome/browser/chromeos/login/wizard_controller.h" +#include "chrome/browser/chromeos/net/network_health.h" #include "chrome/browser/chromeos/net/network_portal_detector_impl.h" #include "chrome/browser/chromeos/net/network_pref_state_observer.h" #include "chrome/browser/chromeos/net/network_throttling_observer.h" @@ -864,6 +865,9 @@ // Initialize an observer to update NetworkHandler's pref based services. network_pref_state_observer_ = std::make_unique<NetworkPrefStateObserver>(); + // Initialize the NetworkHealth aggregator. + network_health_ = std::make_unique<NetworkHealth>(); + // Initialize input methods. input_method::InputMethodManager* manager = input_method::InputMethodManager::Get(); @@ -1039,6 +1043,7 @@ // We should remove observers attached to D-Bus clients before // DBusThreadManager is shut down. network_pref_state_observer_.reset(); + network_health_.reset(); power_metrics_reporter_.reset(); renderer_freezer_.reset(); wake_on_wifi_manager_.reset();
diff --git a/chrome/browser/chromeos/chrome_browser_main_chromeos.h b/chrome/browser/chromeos/chrome_browser_main_chromeos.h index 29e7d71..5d93530 100644 --- a/chrome/browser/chromeos/chrome_browser_main_chromeos.h +++ b/chrome/browser/chromeos/chrome_browser_main_chromeos.h
@@ -51,6 +51,7 @@ class LoginScreenExtensionsStorageCleaner; class LowDiskNotification; class NetworkChangeManagerClient; +class NetworkHealth; class NetworkPrefStateObserver; class NetworkThrottlingObserver; class PowerMetricsReporter; @@ -112,6 +113,7 @@ private: std::unique_ptr<default_app_order::ExternalLoader> app_order_loader_; + std::unique_ptr<NetworkHealth> network_health_; std::unique_ptr<NetworkPrefStateObserver> network_pref_state_observer_; std::unique_ptr<IdleActionWarningObserver> idle_action_warning_observer_; std::unique_ptr<RendererFreezer> renderer_freezer_;
diff --git a/chrome/browser/chromeos/dbus/chrome_features_service_provider.cc b/chrome/browser/chromeos/dbus/chrome_features_service_provider.cc index 0bdff016..d98de00 100644 --- a/chrome/browser/chromeos/dbus/chrome_features_service_provider.cc +++ b/chrome/browser/chromeos/dbus/chrome_features_service_provider.cc
@@ -191,20 +191,13 @@ void ChromeFeaturesServiceProvider::IsVmManagementCliAllowed( dbus::MethodCall* method_call, dbus::ExportedObject::ResponseSender response_sender) { - bool is_allowed = true; - // The policy is experimental; check that the corresponding feature flag - // is enabled. - if (base::FeatureList::IsEnabled( - ::features::kCrostiniAdvancedAccessControls)) { - Profile* profile = GetSenderProfile(method_call, &response_sender); - if (!profile) - return; + Profile* profile = GetSenderProfile(method_call, &response_sender); + if (!profile) + return; - is_allowed = profile->GetPrefs()->GetBoolean( - crostini::prefs::kVmManagementCliAllowedByPolicy); - } - - SendResponse(method_call, std::move(response_sender), is_allowed); + SendResponse(method_call, std::move(response_sender), + profile->GetPrefs()->GetBoolean( + crostini::prefs::kVmManagementCliAllowedByPolicy)); } } // namespace chromeos
diff --git a/chrome/browser/chromeos/file_manager/file_tasks_browsertest.cc b/chrome/browser/chromeos/file_manager/file_tasks_browsertest.cc index 53b36de..b0a83aa 100644 --- a/chrome/browser/chromeos/file_manager/file_tasks_browsertest.cc +++ b/chrome/browser/chromeos/file_manager/file_tasks_browsertest.cc
@@ -20,6 +20,7 @@ namespace file_manager { namespace file_tasks { +namespace { // A list of file extensions (`/` delimited) representing a selection of files // and the app expected to be the default to open these files. @@ -28,6 +29,35 @@ const char* app_id; }; +// Verifies that a single default task expectation (i.e. the expected +// default app to open a given set of file extensions) matches the default +// task in a vector of task descriptors. Decrements the provided |remaining| +// integer to provide additional verification that this function is invoked +// an expected number of times (i.e. even if the callback could be invoked +// asynchronously). +void VerifyTasks(int* remaining, + Expectation expectation, + std::unique_ptr<std::vector<FullTaskDescriptor>> result) { + ASSERT_TRUE(result) << expectation.file_extensions; + + auto default_task = + std::find_if(result->begin(), result->end(), + [](const auto& task) { return task.is_default(); }); + + ASSERT_TRUE(default_task != result->end()) << expectation.file_extensions; + + EXPECT_EQ(expectation.app_id, default_task->task_descriptor().app_id) + << " for extension: " << expectation.file_extensions; + + // Verify no other task is set as default. + EXPECT_EQ(1u, + std::count_if(result->begin(), result->end(), + [](const auto& task) { return task.is_default(); })) + << expectation.file_extensions; + + --*remaining; +} + class FileTasksBrowserTest : public InProcessBrowserTest { public: void SetUpOnMainThread() override { @@ -37,36 +67,11 @@ .InstallSystemAppsForTesting(); } + // Tests that each of the passed expectations open by default in the expected + // app. void TestExpectationsAgainstDefaultTasks( const std::vector<Expectation>& expectations) { - base::RunLoop run_loop; int remaining = expectations.size(); - auto callback = base::BindRepeating( - [](base::RepeatingClosure quit, int* remaining, - const char* file_extensions, const char* expected_app_id, - std::unique_ptr<std::vector<FullTaskDescriptor>> result) { - ASSERT_TRUE(result) << file_extensions; - - auto default_task = - std::find_if(result->begin(), result->end(), - [](const auto& task) { return task.is_default(); }); - - ASSERT_TRUE(default_task != result->end()) << file_extensions; - - EXPECT_EQ(expected_app_id, default_task->task_descriptor().app_id) - << " for extension: " << file_extensions; - - // Verify no other task is set as default. - EXPECT_EQ(1u, std::count_if( - result->begin(), result->end(), - [](const auto& task) { return task.is_default(); })) - << file_extensions; - - if (--*remaining == 0) - quit.Run(); - }, - run_loop.QuitClosure(), &remaining); - const base::FilePath prefix = base::FilePath().AppendASCII("file"); for (const Expectation& test : expectations) { @@ -83,11 +88,12 @@ entries.push_back({path, mime_type, false}); } std::vector<GURL> file_urls{entries.size(), GURL()}; - FindAllTypesOfTasks( - browser()->profile(), entries, file_urls, - base::BindRepeating(callback, test.file_extensions, test.app_id)); + + // task_verifier callback is invoked synchronously from + // FindAllTypesOfTasks. + FindAllTypesOfTasks(browser()->profile(), entries, file_urls, + base::BindRepeating(&VerifyTasks, &remaining, test)); } - run_loop.Run(); EXPECT_EQ(0, remaining); } }; @@ -145,6 +151,8 @@ {"wav", kAudioPlayerAppId}, }; +} // namespace + // Test file extensions correspond to mime types where expected. IN_PROC_BROWSER_TEST_F(FileTasksBrowserTest, ExtensionToMimeMapping) { constexpr struct {
diff --git a/chrome/browser/chromeos/input_method/assistive_suggester.cc b/chrome/browser/chromeos/input_method/assistive_suggester.cc index 9740b9e56..e87411c 100644 --- a/chrome/browser/chromeos/input_method/assistive_suggester.cc +++ b/chrome/browser/chromeos/input_method/assistive_suggester.cc
@@ -37,16 +37,16 @@ AssistiveSuggester::AssistiveSuggester(InputMethodEngine* engine, Profile* profile) - : personal_info_suggester_(new PersonalInfoSuggester(engine, profile)) {} + : personal_info_suggester_(engine, profile) {} void AssistiveSuggester::OnFocus(int context_id) { context_id_ = context_id; - personal_info_suggester_->OnFocus(context_id_); + personal_info_suggester_.OnFocus(context_id_); } void AssistiveSuggester::OnBlur() { context_id_ = -1; - personal_info_suggester_->OnBlur(); + personal_info_suggester_.OnBlur(); } bool AssistiveSuggester::OnKeyEvent( @@ -69,7 +69,6 @@ return true; case SuggestionStatus::kDismiss: current_suggester_ = nullptr; - suggestion_dismissed_ = true; return false; default: break; @@ -97,11 +96,6 @@ bool AssistiveSuggester::OnSurroundingTextChanged(const base::string16& text, int cursor_pos, int anchor_pos) { - if (suggestion_dismissed_) { - suggestion_dismissed_ = false; - return false; - } - if (context_id_ == -1) return false; @@ -126,8 +120,8 @@ base::string16 text_before_cursor = text.substr(start_pos, cursor_pos - start_pos); if (IsAssistPersonalInfoEnabled() && - personal_info_suggester_->Suggest(text_before_cursor)) { - current_suggester_ = personal_info_suggester_; + personal_info_suggester_.Suggest(text_before_cursor)) { + current_suggester_ = &personal_info_suggester_; } else { current_suggester_ = nullptr; }
diff --git a/chrome/browser/chromeos/input_method/assistive_suggester.h b/chrome/browser/chromeos/input_method/assistive_suggester.h index 3ed42d28..e310ee0 100644 --- a/chrome/browser/chromeos/input_method/assistive_suggester.h +++ b/chrome/browser/chromeos/input_method/assistive_suggester.h
@@ -58,15 +58,11 @@ // Check if suggestion is being shown. bool IsSuggestionShown(); - PersonalInfoSuggester* const personal_info_suggester_; + PersonalInfoSuggester personal_info_suggester_; // ID of the focused text field, 0 if none is focused. int context_id_ = -1; - // If the suggestion is dismissed by the user, this is necessary so that we - // will not reshow the suggestion immediately after the user dismisses it. - bool suggestion_dismissed_ = false; - // The current suggester in use, nullptr means no suggestion is shown. Suggester* current_suggester_ = nullptr; };
diff --git a/chrome/browser/chromeos/input_method/native_input_method_engine.cc b/chrome/browser/chromeos/input_method/native_input_method_engine.cc index 3f1d801..33c09c5 100644 --- a/chrome/browser/chromeos/input_method/native_input_method_engine.cc +++ b/chrome/browser/chromeos/input_method/native_input_method_engine.cc
@@ -94,18 +94,6 @@ : base_observer_(std::move(base_observer)), receiver_from_engine_(this), assistive_suggester_(std::move(assistive_suggester)) { - auto* ime_manager = input_method::InputMethodManager::Get(); - - const auto start = base::Time::Now(); - ime_manager->ConnectInputEngineManager( - remote_manager_.BindNewPipeAndPassReceiver()); - LogLatency("InputMethod.Mojo.Extension.ServiceInitLatency", - base::Time::Now() - start); - - remote_manager_.set_disconnect_handler(base::BindOnce( - &ImeObserver::OnError, base::Unretained(this), base::Time::Now())); - - LogEvent(ImeServiceEvent::kInitSuccess); } NativeInputMethodEngine::ImeObserver::~ImeObserver() = default; @@ -113,6 +101,18 @@ void NativeInputMethodEngine::ImeObserver::OnActivate( const std::string& engine_id) { if (ShouldEngineUseMojo(engine_id)) { + if (!remote_manager_.is_bound()) { + auto* ime_manager = input_method::InputMethodManager::Get(); + const auto start = base::Time::Now(); + ime_manager->ConnectInputEngineManager( + remote_manager_.BindNewPipeAndPassReceiver()); + LogLatency("InputMethod.Mojo.Extension.ServiceInitLatency", + base::Time::Now() - start); + remote_manager_.set_disconnect_handler(base::BindOnce( + &ImeObserver::OnError, base::Unretained(this), base::Time::Now())); + LogEvent(ImeServiceEvent::kInitSuccess); + } + // For legacy reasons, |engine_id| starts with "vkd_" in the input method // manifest, but the InputEngineManager expects the prefix "m17n:". // TODO(https://crbug.com/1012490): Migrate to m17n prefix and remove this. @@ -127,6 +127,10 @@ receiver_from_engine_.BindNewPipeAndPassRemote(), {}, base::BindOnce(&ImeObserver::OnConnected, base::Unretained(this), base::Time::Now())); + } else { + // Release the IME service. + // TODO(b/147709499): A better way to cleanup all. + remote_manager_.reset(); } base_observer_->OnActivate(engine_id); }
diff --git a/chrome/browser/chromeos/input_method/personal_info_suggester.cc b/chrome/browser/chromeos/input_method/personal_info_suggester.cc index eab2c98a..eaf6d29 100644 --- a/chrome/browser/chromeos/input_method/personal_info_suggester.cc +++ b/chrome/browser/chromeos/input_method/personal_info_suggester.cc
@@ -66,8 +66,7 @@ if (suggestion_shown_) { suggestion_shown_ = false; if (event.key == "Tab" || event.key == "Right") { - std::string error; - engine_->AcceptSuggestion(context_id_, &error); + AcceptSuggestion(); return SuggestionStatus::kAccept; } DismissSuggestion(); @@ -77,50 +76,45 @@ } bool PersonalInfoSuggester::Suggest(const base::string16& text) { - base::string16 suggestion_text = GetPersonalInfoSuggestion(text); - if (!suggestion_text.empty()) { - ShowSuggestion(suggestion_text); - suggestion_shown_ = true; - } - return suggestion_shown_; -} + proposed_action_type_ = ProposeAssistiveAction(text); -base::string16 PersonalInfoSuggester::GetPersonalInfoSuggestion( - const base::string16& text) { - AssistiveType action = ProposeAssistiveAction(text); - proposed_action_type_ = action; + if (proposed_action_type_ == AssistiveType::kGenericAction) + return false; - if (action == AssistiveType::kGenericAction) - return base::EmptyString16(); - - if (action == AssistiveType::kPersonalEmail) - return base::UTF8ToUTF16(profile_->GetProfileUserName()); - - auto autofill_profiles = personal_data_manager_->GetProfilesToSuggest(); - if (autofill_profiles.empty()) - return base::EmptyString16(); - - // Currently, we are just picking the first candidate, will improve the - // strategy in the future. - auto* data = autofill_profiles[0]; base::string16 suggestion; - switch (action) { - case AssistiveType::kPersonalName: - suggestion = data->GetRawInfo(autofill::ServerFieldType::NAME_FULL); - break; - case AssistiveType::kPersonalAddress: - suggestion = data->GetRawInfo( - autofill::ServerFieldType::ADDRESS_HOME_STREET_ADDRESS); - break; - case AssistiveType::kPersonalPhoneNumber: - suggestion = - data->GetRawInfo(autofill::ServerFieldType::PHONE_HOME_WHOLE_NUMBER); - break; - default: - NOTREACHED(); - break; + if (proposed_action_type_ == AssistiveType::kPersonalEmail) { + suggestion = base::UTF8ToUTF16(profile_->GetProfileUserName()); + } else { + auto autofill_profiles = personal_data_manager_->GetProfilesToSuggest(); + if (autofill_profiles.empty()) + return false; + + // Currently, we are just picking the first candidate, will improve the + // strategy in the future. + auto* profile = autofill_profiles[0]; + switch (proposed_action_type_) { + case AssistiveType::kPersonalName: + suggestion = profile->GetRawInfo(autofill::ServerFieldType::NAME_FULL); + break; + case AssistiveType::kPersonalAddress: + suggestion = profile->GetRawInfo( + autofill::ServerFieldType::ADDRESS_HOME_STREET_ADDRESS); + break; + case AssistiveType::kPersonalPhoneNumber: + suggestion = profile->GetRawInfo( + autofill::ServerFieldType::PHONE_HOME_WHOLE_NUMBER); + break; + default: + NOTREACHED(); + break; + } } - return suggestion; + + if (suggestion.empty()) + return false; + ShowSuggestion(suggestion); + suggestion_shown_ = true; + return true; } void PersonalInfoSuggester::ShowSuggestion(const base::string16& text) { @@ -135,9 +129,16 @@ return proposed_action_type_; } +void PersonalInfoSuggester::AcceptSuggestion() { + std::string error; + engine_->AcceptSuggestion(context_id_, &error); + if (!error.empty()) { + LOG(ERROR) << "Failed to accept suggestion. " << error; + } +} + void PersonalInfoSuggester::DismissSuggestion() { std::string error; - suggestion_shown_ = false; engine_->DismissSuggestion(context_id_, &error); if (!error.empty()) { LOG(ERROR) << "Failed to dismiss suggestion. " << error;
diff --git a/chrome/browser/chromeos/input_method/personal_info_suggester.h b/chrome/browser/chromeos/input_method/personal_info_suggester.h index 8f3d261..877bca6 100644 --- a/chrome/browser/chromeos/input_method/personal_info_suggester.h +++ b/chrome/browser/chromeos/input_method/personal_info_suggester.h
@@ -46,6 +46,8 @@ void ShowSuggestion(const base::string16& text); + void AcceptSuggestion(); + InputMethodEngine* const engine_; // ID of the focused text field, 0 if none is focused.
diff --git a/chrome/browser/chromeos/login/easy_unlock/OWNERS b/chrome/browser/chromeos/login/easy_unlock/OWNERS index 8947f4e..4843dad 100644 --- a/chrome/browser/chromeos/login/easy_unlock/OWNERS +++ b/chrome/browser/chromeos/login/easy_unlock/OWNERS
@@ -1,4 +1,4 @@ hansberry@chromium.org -jhawkins@chromium.org +file://chromeos/components/multidevice/OWNERS # COMPONENT: OS>Systems>Multidevice>SmartLock
diff --git a/chrome/browser/chromeos/login/screens/marketing_opt_in_screen.cc b/chrome/browser/chromeos/login/screens/marketing_opt_in_screen.cc index 14bc36a..8051eaa51 100644 --- a/chrome/browser/chromeos/login/screens/marketing_opt_in_screen.cc +++ b/chrome/browser/chromeos/login/screens/marketing_opt_in_screen.cc
@@ -26,12 +26,10 @@ MarketingOptInScreen::MarketingOptInScreen( MarketingOptInScreenView* view, - bool is_fullscreen, const base::RepeatingClosure& exit_callback) : BaseScreen(MarketingOptInScreenView::kScreenId, OobeScreenPriority::DEFAULT), view_(view), - is_fullscreen_(is_fullscreen), exit_callback_(exit_callback) { DCHECK(view_); view_->Bind(this); @@ -39,40 +37,6 @@ MarketingOptInScreen::~MarketingOptInScreen() { view_->Bind(nullptr); - - ClearLoginShelfGestureHandler(); -} - -void MarketingOptInScreen::OnShelfConfigUpdated() { - UpdateShelfGestureHandlingState(); -} - -void MarketingOptInScreen::UpdateShelfGestureHandlingState() { - const bool allow_shelf_gestures = - is_fullscreen_ && !ash::ShelfConfig::Get()->shelf_controls_shown() && - !accessibility_page_shown_; - if (allow_shelf_gestures == handling_shelf_gestures_) - return; - - if (!allow_shelf_gestures) { - // handling_shelf_gestures_ will be reset in - // OnShelfGestureDetectionStopped(), which is called when the handler is - // cleared. - ash::LoginScreen::Get()->ClearLoginShelfGestureHandler(); - return; - } - - handling_shelf_gestures_ = - ash::LoginScreen::Get()->SetLoginShelfGestureHandler( - l10n_util::GetStringUTF16( - IDS_LOGIN_MARKETING_OPT_IN_SCREEN_SWIPE_FROM_SHELF_LABEL), - base::BindRepeating(&MarketingOptInScreen::HandleFlingFromShelf, - weak_factory_.GetWeakPtr()), - base::BindOnce(&MarketingOptInScreen::OnShelfGestureDetectionStopped, - weak_factory_.GetWeakPtr())); - - if (handling_shelf_gestures_) - view_->UpdateAllSetButtonVisibility(false /*visible*/); } void MarketingOptInScreen::ShowImpl() { @@ -104,23 +68,10 @@ } active_ = true; - accessibility_page_shown_ = false; view_->Show(); prefs->SetBoolean(prefs::kOobeMarketingOptInScreenFinished, true); - shelf_config_observer_.Add(ash::ShelfConfig::Get()); - UpdateShelfGestureHandlingState(); - - // Make sure the screen next button visibility is properly initialized. - view_->UpdateAllSetButtonVisibility(!handling_shelf_gestures_ /*visible*/); - - // Only show the link for accessibility settings if the gesture navigation - // screen was shown. This button gets shown when the login shelf gesture - // gets enabled. - view_->UpdateA11ySettingsButtonVisibility( - !did_skip_gesture_navigation_screen || handling_shelf_gestures_); - view_->UpdateA11yShelfNavigationButtonToggle(prefs->GetBoolean( ash::prefs::kAccessibilityTabletModeShelfNavigationButtonsEnabled)); @@ -140,11 +91,8 @@ return; active_ = false; - shelf_config_observer_.RemoveAll(); active_user_pref_change_registrar_.reset(); view_->Hide(); - - ClearLoginShelfGestureHandler(); } void MarketingOptInScreen::OnAllSet(bool play_communications_opt_in, @@ -153,44 +101,15 @@ ExitScreen(); } -void MarketingOptInScreen::OnAccessibilityPageVisibilityChanged(bool shown) { - accessibility_page_shown_ = shown; - UpdateShelfGestureHandlingState(); -} - -void MarketingOptInScreen::HandleFlingFromShelf() { - ExitScreen(); -} - -void MarketingOptInScreen::OnShelfGestureDetectionStopped() { - // This is called whenever the shelf gesture handler is cleared - ignore the - // callback if |handling_shelf_gestures_| was reset before clearing the - // gesture handler. - if (!handling_shelf_gestures_) - return; - - handling_shelf_gestures_ = false; - view_->UpdateAllSetButtonVisibility(true /*visible*/); -} - void MarketingOptInScreen::ExitScreen() { if (!active_) return; active_ = false; - ClearLoginShelfGestureHandler(); exit_callback_.Run(); } -void MarketingOptInScreen::ClearLoginShelfGestureHandler() { - if (!handling_shelf_gestures_) - return; - - handling_shelf_gestures_ = false; - ash::LoginScreen::Get()->ClearLoginShelfGestureHandler(); -} - void MarketingOptInScreen::OnA11yShelfNavigationButtonPrefChanged() { view_->UpdateA11yShelfNavigationButtonToggle( ProfileManager::GetActiveUserProfile()->GetPrefs()->GetBoolean(
diff --git a/chrome/browser/chromeos/login/screens/marketing_opt_in_screen.h b/chrome/browser/chromeos/login/screens/marketing_opt_in_screen.h index 8e4124a..891f23d 100644 --- a/chrome/browser/chromeos/login/screens/marketing_opt_in_screen.h +++ b/chrome/browser/chromeos/login/screens/marketing_opt_in_screen.h
@@ -5,11 +5,9 @@ #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_SCREENS_MARKETING_OPT_IN_SCREEN_H_ #define CHROME_BROWSER_CHROMEOS_LOGIN_SCREENS_MARKETING_OPT_IN_SCREEN_H_ -#include "ash/public/cpp/shelf_config.h" #include "base/callback.h" #include "base/macros.h" #include "base/memory/weak_ptr.h" -#include "base/scoped_observer.h" #include "chrome/browser/chromeos/login/screens/base_screen.h" #include "components/prefs/pref_change_registrar.h" @@ -19,11 +17,9 @@ // This is Sync settings screen that is displayed as a part of user first // sign-in flow. -class MarketingOptInScreen : public BaseScreen, - public ash::ShelfConfig::Observer { +class MarketingOptInScreen : public BaseScreen { public: MarketingOptInScreen(MarketingOptInScreenView* view, - bool is_fullscreen, const base::RepeatingClosure& exit_callback); ~MarketingOptInScreen() override; @@ -31,13 +27,6 @@ void OnAllSet(bool play_communications_opt_in, bool tips_communications_opt_in); - // Called when the visibility of the accessibility page within the screen - // changes. - void OnAccessibilityPageVisibilityChanged(bool shown); - - // ash::ShelfCondif::Observer: - void OnShelfConfigUpdated() override; - void set_exit_callback_for_testing( const base::RepeatingClosure& exit_callback) { exit_callback_ = exit_callback; @@ -49,56 +38,18 @@ void HideImpl() override; private: - // Enables or disables shelf gesture handling depending on the current state. - // Gesture handling should be disabled if shelf navigation buttons should be - // shown in this context, or if the screen is on the accessibility settings - // page. - // Gesture handling is only supported if the screen is shown in fullscreen - // OOBE. - void UpdateShelfGestureHandlingState(); - - // Called when a fling from the shelf is detected - it exits the screen. - // This is the fling callback passed to - // LoginScreen::SetLoginShelfGestureHandler(). - void HandleFlingFromShelf(); - - // Called when the login shelf gesture detection stops. - // This is the exit callback passed to - // LoginScreen::SetLoginShelfGestureHandler(). - void OnShelfGestureDetectionStopped(); - - // Exits the screen - it clears the login shelf gesture handler, and runs the - // exit callback as needed. + // Exits the screen. void ExitScreen(); - // Clears login shelf gesture handler if the screen is handling shelf - // gestures. - void ClearLoginShelfGestureHandler(); - void OnA11yShelfNavigationButtonPrefChanged(); MarketingOptInScreenView* const view_; - // Whether the screen is shown as part the first run with OOBE display type, - // i.e. if the screen UI is shown fullscreen. Note that the shelf swipe - // gesture will only be enabled in fullscreen mode. - const bool is_fullscreen_; - // Whether the screen is shown and exit callback has not been run. bool active_ = false; - // Whether the screen has set a login shelf gesture handler. - bool handling_shelf_gestures_ = false; - - // Whether the accessibility page (that contains an option to make the shelf - // navigation buttons show in tablet mode) is currently shown. - bool accessibility_page_shown_ = false; - base::RepeatingClosure exit_callback_; - ScopedObserver<ash::ShelfConfig, ash::ShelfConfig::Observer> - shelf_config_observer_{this}; - std::unique_ptr<PrefChangeRegistrar> active_user_pref_change_registrar_; base::WeakPtrFactory<MarketingOptInScreen> weak_factory_{this};
diff --git a/chrome/browser/chromeos/login/screens/marketing_opt_in_screen_browsertest.cc b/chrome/browser/chromeos/login/screens/marketing_opt_in_screen_browsertest.cc index 354e559..28ec9c0c 100644 --- a/chrome/browser/chromeos/login/screens/marketing_opt_in_screen_browsertest.cc +++ b/chrome/browser/chromeos/login/screens/marketing_opt_in_screen_browsertest.cc
@@ -73,28 +73,6 @@ run_loop.Run(); } - void SimulateFlingFromShelf() { - aura::Window* oobe_window = LoginDisplayHost::default_host() - ->GetOobeWebContents() - ->GetTopLevelNativeWindow(); - display::Screen* const screen = display::Screen::GetScreen(); - const display::Display display = - screen->GetDisplayNearestWindow(oobe_window); - - // Start at the center of the expected shelf bounds. - const int shelf_size = ash::ShelfConfig::Get()->shelf_size(); - const gfx::Point start = - gfx::Point(display.bounds().x() + display.bounds().width() / 2, - display.bounds().bottom() - shelf_size / 2); - // Swipe upwards. - const gfx::Point end = start + gfx::Vector2d(0, -shelf_size); - const base::TimeDelta kTimeDelta = base::TimeDelta::FromMilliseconds(10); - const int kNumScrollSteps = 4; - ui::test::EventGenerator event_generator(oobe_window->GetRootWindow()); - event_generator.GestureScrollSequence(start, end, kTimeDelta, - kNumScrollSteps); - } - private: void HandleScreenExit() { ASSERT_FALSE(screen_exited_); @@ -137,116 +115,25 @@ {"marketing-opt-in", "marketing-opt-in-toggle-2"}); } -// Tests that fling from shelf exits the screen in tablet mode. -IN_PROC_BROWSER_TEST_F(MarketingOptInScreenTest, FlingFromShelfInTabletMode) { - ShowMarketingOptInScreen(); - OobeScreenWaiter(MarketingOptInScreenView::kScreenId).Wait(); - - ASSERT_TRUE(ash::ShelfTestApi().HasLoginShelfGestureHandler()); - SimulateFlingFromShelf(); - - WaitForScreenExit(); - EXPECT_FALSE(ash::ShelfTestApi().HasLoginShelfGestureHandler()); -} - -// Tests that fling from shelf is not enabled in tablet mode if shelf -// navigation buttons are forced by the accessibility setting to show the -// buttons. -IN_PROC_BROWSER_TEST_F(MarketingOptInScreenTest, - ShelfButtonsEnabledInTabletMode) { - ShowMarketingOptInScreen(); - OobeScreenWaiter(MarketingOptInScreenView::kScreenId).Wait(); - - ASSERT_TRUE(ash::ShelfTestApi().HasLoginShelfGestureHandler()); - - // If the setting to always show shelf navigation buttons is enabled, the - // shelf gesture detection should be disabled on the screen, and the user - // should be able to use "next" button to exit the screen. - ProfileManager::GetActiveUserProfile()->GetPrefs()->SetBoolean( - ash::prefs::kAccessibilityTabletModeShelfNavigationButtonsEnabled, true); - EXPECT_FALSE(ash::ShelfTestApi().HasLoginShelfGestureHandler()); - - test::OobeJS() - .CreateVisibilityWaiter( - true, {"marketing-opt-in", "marketing-opt-in-next-button"}) - ->Wait(); - test::OobeJS().TapOnPath( - {"marketing-opt-in", "marketing-opt-in-next-button"}); - - WaitForScreenExit(); - EXPECT_FALSE(ash::ShelfTestApi().HasLoginShelfGestureHandler()); -} - -// Tests that login shelf does not have fling handler in clamshell, and that -// the user can exit the screen using a button in the OOBE screen to exit the -// screen. -IN_PROC_BROWSER_TEST_F(MarketingOptInScreenTest, - ExitScreenUsingButtonInClamshell) { - ShowMarketingOptInScreen(); - OobeScreenWaiter(MarketingOptInScreenView::kScreenId).Wait(); - ash::ShellTestApi().SetTabletModeEnabledForTest(false); - - // When not in tablet mode, the shelf gesture detection should be disabled, - // and the user should be able to exit the screen using "next" button in the - // screen. - EXPECT_FALSE(ash::ShelfTestApi().HasLoginShelfGestureHandler()); - test::OobeJS() - .CreateVisibilityWaiter( - true, {"marketing-opt-in", "marketing-opt-in-next-button"}) - ->Wait(); - test::OobeJS().TapOnPath( - {"marketing-opt-in", "marketing-opt-in-next-button"}); - - WaitForScreenExit(); - EXPECT_FALSE(ash::ShelfTestApi().HasLoginShelfGestureHandler()); -} - -// Tests that enabling tablet mode while on the screen will enable login shelf -// gestures as well. -IN_PROC_BROWSER_TEST_F(MarketingOptInScreenTest, - FlingFromGestureEnabledOnTabletModeEnter) { - ShowMarketingOptInScreen(); - OobeScreenWaiter(MarketingOptInScreenView::kScreenId).Wait(); - ash::ShellTestApi().SetTabletModeEnabledForTest(false); - - EXPECT_FALSE(ash::ShelfTestApi().HasLoginShelfGestureHandler()); - test::OobeJS() - .CreateVisibilityWaiter( - true, {"marketing-opt-in", "marketing-opt-in-next-button"}) - ->Wait(); - - // Enter tablet mode and verify shelf gesture detection gets re-enabled. - ash::ShellTestApi().SetTabletModeEnabledForTest(true); - ASSERT_TRUE(ash::ShelfTestApi().HasLoginShelfGestureHandler()); - - SimulateFlingFromShelf(); - WaitForScreenExit(); - EXPECT_FALSE(ash::ShelfTestApi().HasLoginShelfGestureHandler()); -} - // Tests that the user can enable shelf navigation buttons in tablet mode from // the screen. IN_PROC_BROWSER_TEST_F(MarketingOptInScreenTest, EnableShelfNavigationButtons) { ShowMarketingOptInScreen(); OobeScreenWaiter(MarketingOptInScreenView::kScreenId).Wait(); - EXPECT_TRUE(ash::ShelfTestApi().HasLoginShelfGestureHandler()); - // Tap on accessibility settings link, and wait for the accessibility settings // UI to show up. test::OobeJS() - .CreateVisibilityWaiter(true, - {"marketing-opt-in", "finalAccessibilityLink"}) + .CreateVisibilityWaiter( + true, {"marketing-opt-in", "marketing-opt-in-accessibility-button"}) ->Wait(); - test::OobeJS().TapLinkOnPath({"marketing-opt-in", "finalAccessibilityLink"}); + test::OobeJS().ClickOnPath( + {"marketing-opt-in", "marketing-opt-in-accessibility-button"}); test::OobeJS() .CreateVisibilityWaiter(true, {"marketing-opt-in", "finalAccessibilityPage"}) ->Wait(); - // Swipe from shelf should be disabled on this page. - EXPECT_FALSE(ash::ShelfTestApi().HasLoginShelfGestureHandler()); - // Tap the shelf navigation buttons in tablet mode toggle. test::OobeJS() .CreateVisibilityWaiter(true, {"marketing-opt-in", "a11yNavButtonToggle"}) @@ -254,7 +141,7 @@ test::OobeJS().ClickOnPath( {"marketing-opt-in", "a11yNavButtonToggle", "button"}); - // Go back to the first screen, and verify the 'all set button' is shown now. + // Go back to the first screen. test::OobeJS().TapOnPath( {"marketing-opt-in", "final-accessibility-back-button"}); @@ -263,9 +150,6 @@ true, {"marketing-opt-in", "marketingOptInOverviewDialog"}) ->Wait(); - // Verify that swipe gesture is still disabled. - EXPECT_FALSE(ash::ShelfTestApi().HasLoginShelfGestureHandler()); - // Tapping the next button exits the screen. test::OobeJS().ExpectVisiblePath( {"marketing-opt-in", "marketing-opt-in-next-button"}); @@ -283,66 +167,23 @@ ShowMarketingOptInScreen(); OobeScreenWaiter(MarketingOptInScreenView::kScreenId).Wait(); - EXPECT_TRUE(ash::ShelfTestApi().HasLoginShelfGestureHandler()); - // Tap on accessibility settings link, and wait for the accessibility settings // UI to show up. test::OobeJS() - .CreateVisibilityWaiter(true, - {"marketing-opt-in", "finalAccessibilityLink"}) + .CreateVisibilityWaiter( + true, {"marketing-opt-in", "marketing-opt-in-accessibility-button"}) ->Wait(); - test::OobeJS().TapLinkOnPath({"marketing-opt-in", "finalAccessibilityLink"}); + test::OobeJS().ClickOnPath( + {"marketing-opt-in", "marketing-opt-in-accessibility-button"}); test::OobeJS() .CreateVisibilityWaiter(true, {"marketing-opt-in", "finalAccessibilityPage"}) ->Wait(); - EXPECT_FALSE(ash::ShelfTestApi().HasLoginShelfGestureHandler()); // Tapping the next button exits the screen. test::OobeJS().TapOnPath( {"marketing-opt-in", "final-accessibility-next-button"}); WaitForScreenExit(); - EXPECT_FALSE(ash::ShelfTestApi().HasLoginShelfGestureHandler()); -} - -// Tests that the swipe from shelf gets re-enabled when coming back from -// accessibility settings page (if the shelf navigation toggle was not toggled). -IN_PROC_BROWSER_TEST_F(MarketingOptInScreenTest, - SwipeFromShelfAfterReturnFromA11yPage) { - ShowMarketingOptInScreen(); - OobeScreenWaiter(MarketingOptInScreenView::kScreenId).Wait(); - - EXPECT_TRUE(ash::ShelfTestApi().HasLoginShelfGestureHandler()); - - // Tap on accessibility settings link, and wait for the accessibility settings - // UI to show up. - test::OobeJS() - .CreateVisibilityWaiter(true, - {"marketing-opt-in", "finalAccessibilityLink"}) - ->Wait(); - test::OobeJS().TapLinkOnPath({"marketing-opt-in", "finalAccessibilityLink"}); - test::OobeJS() - .CreateVisibilityWaiter(true, - {"marketing-opt-in", "finalAccessibilityPage"}) - ->Wait(); - EXPECT_FALSE(ash::ShelfTestApi().HasLoginShelfGestureHandler()); - - // Tapping back button to go back to the initial page. - test::OobeJS().TapOnPath( - {"marketing-opt-in", "final-accessibility-back-button"}); - - test::OobeJS() - .CreateVisibilityWaiter( - true, {"marketing-opt-in", "marketingOptInOverviewDialog"}) - ->Wait(); - - // Verify that swipe gesture is enabled. - EXPECT_TRUE(ash::ShelfTestApi().HasLoginShelfGestureHandler()); - - // Swipe from shelf to exit the screen. - SimulateFlingFromShelf(); - WaitForScreenExit(); - EXPECT_FALSE(ash::ShelfTestApi().HasLoginShelfGestureHandler()); } } // namespace chromeos
diff --git a/chrome/browser/chromeos/login/screens/user_selection_screen.cc b/chrome/browser/chromeos/login/screens/user_selection_screen.cc index 2b053af..53acd44 100644 --- a/chrome/browser/chromeos/login/screens/user_selection_screen.cc +++ b/chrome/browser/chromeos/login/screens/user_selection_screen.cc
@@ -15,6 +15,7 @@ #include "base/command_line.h" #include "base/location.h" #include "base/logging.h" +#include "base/metrics/histogram_macros.h" #include "base/optional.h" #include "base/strings/utf_string_conversions.h" #include "base/values.h" @@ -337,6 +338,8 @@ UpdateUI(account_id, false); return; } + UMA_HISTOGRAM_BOOLEAN("Ash.Login.Login.MigrationBanner", + needs_migration.value()); needs_dircrypto_migration_cache_[account_id] = needs_migration.value(); UpdateUI(account_id, needs_migration.value());
diff --git a/chrome/browser/chromeos/login/screens/user_selection_screen_browsertest.cc b/chrome/browser/chromeos/login/screens/user_selection_screen_browsertest.cc index 93f8f7f9a..381333d 100644 --- a/chrome/browser/chromeos/login/screens/user_selection_screen_browsertest.cc +++ b/chrome/browser/chromeos/login/screens/user_selection_screen_browsertest.cc
@@ -5,32 +5,20 @@ #include <memory> #include <utility> +#include "ash/public/cpp/login_screen_test_api.h" #include "base/command_line.h" #include "base/run_loop.h" -#include "base/strings/stringprintf.h" +#include "base/test/metrics/histogram_tester.h" #include "chrome/browser/chromeos/login/login_manager_test.h" -#include "chrome/browser/chromeos/login/startup_utils.h" -#include "chrome/browser/chromeos/login/test/js_checker.h" -#include "chrome/browser/chromeos/login/test/oobe_screen_waiter.h" -#include "chrome/browser/ui/webui/chromeos/login/signin_screen_handler.h" +#include "chrome/browser/chromeos/login/test/login_manager_mixin.h" +#include "chrome/browser/chromeos/login/test/test_predicate_waiter.h" #include "chromeos/constants/chromeos_switches.h" #include "chromeos/dbus/cryptohome/fake_cryptohome_client.h" -#include "chromeos/dbus/dbus_thread_manager.h" namespace chromeos { namespace { -// Consumer user according to BrowserPolicyConnector::IsNonEnterpriseUser -// (@gmail.com). -constexpr char kTestUser1[] = "test-user1@gmail.com"; -constexpr char kTestUser1GaiaId[] = "1111111111"; - -// Consumer user according to BrowserPolicyConnector::IsNonEnterpriseUser -// (@gmail.com). -constexpr char kTestUser2[] = "test-user2@gmail.com"; -constexpr char kTestUser2GaiaId[] = "2222222222"; - // No consumer user according to BrowserPolicyConnector::IsNonEnterpriseUser. constexpr char kManagedTestUser[] = "manager@example.com"; constexpr char kManagedTestUserGaiaId[] = "3333333333"; @@ -41,57 +29,85 @@ public: UserSelectionScreenTest() : LoginManagerTest(false /* should_launch_browser */, - true /* should_initialize_webui */) {} + false /* should_initialize_webui */) { + set_force_webui_login(false); + } ~UserSelectionScreenTest() override = default; - void FocusUserPod(int pod_id) { - test::ExecuteOobeJS(base::StringPrintf( - "$('pod-row').focusPod($('pod-row').pods[%d])", pod_id)); + void SetUpCommandLine(base::CommandLine* command_line) override { + LoginManagerTest::SetUpCommandLine(command_line); + // Enable ARC. Otherwise, the banner would not show. + command_line->AppendSwitchASCII(switches::kArcAvailability, + "officially-supported"); } + protected: + std::vector<LoginManagerMixin::TestUserInfo> test_users_{CreateUsers()}; + LoginManagerMixin login_manager_mixin_{&mixin_host_, test_users_}; + private: + static std::vector<LoginManagerMixin::TestUserInfo> CreateUsers() { + auto users = LoginManagerMixin::CreateRegularUsers(3); + users.push_back( + LoginManagerMixin::TestUserInfo(AccountId::FromUserEmailGaiaId( + kManagedTestUser, kManagedTestUserGaiaId))); + return users; + } DISALLOW_COPY_AND_ASSIGN(UserSelectionScreenTest); }; -IN_PROC_BROWSER_TEST_F(UserSelectionScreenTest, - PRE_ShowDircryptoMigrationBanner) { - RegisterUser(AccountId::FromUserEmailGaiaId(kTestUser1, kTestUser1GaiaId)); - RegisterUser(AccountId::FromUserEmailGaiaId(kTestUser2, kTestUser2GaiaId)); - RegisterUser( - AccountId::FromUserEmailGaiaId(kManagedTestUser, kManagedTestUserGaiaId)); - StartupUtils::MarkOobeCompleted(); -} - // Test that a banner shows up for known-unmanaged users that need dircrypto // migration. Also test that no banner shows up for users that may be managed. IN_PROC_BROWSER_TEST_F(UserSelectionScreenTest, ShowDircryptoMigrationBanner) { - // Enable ARC. Otherwise, the banner would not show. - base::CommandLine::ForCurrentProcess()->AppendSwitchASCII( - switches::kArcAvailability, "officially-supported"); - // No banner for the first user since default is no migration. - test::OobeJS().ExpectHasNoClass("message-set", {"signin-banner"}); + EXPECT_FALSE(ash::LoginScreenTestApi::IsWarningBubbleShown()); + std::unique_ptr<base::HistogramTester> histogram_tester = + std::make_unique<base::HistogramTester>(); // Change the needs dircrypto migration response. FakeCryptohomeClient::Get()->set_needs_dircrypto_migration(true); // Focus the 2nd user pod (consumer). - FocusUserPod(1); + ASSERT_TRUE(ash::LoginScreenTestApi::FocusUser(test_users_[1].account_id)); // Wait for FakeCryptohomeClient to send back the check result. - base::RunLoop().RunUntilIdle(); + test::TestPredicateWaiter(base::BindRepeating([]() { + // Banner should be shown for the 2nd user (consumer). + return ash::LoginScreenTestApi::IsWarningBubbleShown(); + })).Wait(); + histogram_tester->ExpectBucketCount("Ash.Login.Login.MigrationBanner", true, + 1); - // Banner should be shown for the 2nd user (consumer). - test::OobeJS().ExpectHasClass("message-set", {"signin-banner"}); - - // Focus to the 3rd user pod (enterprise). - FocusUserPod(2); + // Change the needs dircrypto migration response. + FakeCryptohomeClient::Get()->set_needs_dircrypto_migration(false); + histogram_tester = std::make_unique<base::HistogramTester>(); + // Focus the 3rd user pod (consumer). + ASSERT_TRUE(ash::LoginScreenTestApi::FocusUser(test_users_[2].account_id)); // Wait for FakeCryptohomeClient to send back the check result. - base::RunLoop().RunUntilIdle(); + test::TestPredicateWaiter(base::BindRepeating([]() { + // Banner should be shown for the 3rd user (consumer). + return !ash::LoginScreenTestApi::IsWarningBubbleShown(); + })).Wait(); + histogram_tester->ExpectBucketCount("Ash.Login.Login.MigrationBanner", false, + 1); - // Banner should not be shown for the enterprise user. - test::OobeJS().ExpectHasNoClass("message-set", {"signin-banner"}); + // Change the needs dircrypto migration response. + FakeCryptohomeClient::Get()->set_needs_dircrypto_migration(true); + histogram_tester = std::make_unique<base::HistogramTester>(); + + // Focus to the 4th user pod (enterprise). + ASSERT_TRUE(ash::LoginScreenTestApi::FocusUser(test_users_[3].account_id)); + + // Wait for FakeCryptohomeClient to send back the check result. + test::TestPredicateWaiter(base::BindRepeating([]() { + // Banner should not be shown for the enterprise user. + return !ash::LoginScreenTestApi::IsWarningBubbleShown(); + })).Wait(); + + // Not recorded for enterprise. + histogram_tester->ExpectUniqueSample("Ash.Login.Login.MigrationBanner", false, + 0); } } // namespace chromeos
diff --git a/chrome/browser/chromeos/login/wizard_controller.cc b/chrome/browser/chromeos/login/wizard_controller.cc index 3a051d47..64313c12 100644 --- a/chrome/browser/chromeos/login/wizard_controller.cc +++ b/chrome/browser/chromeos/login/wizard_controller.cc
@@ -598,7 +598,6 @@ weak_factory_.GetWeakPtr()))); append(std::make_unique<MarketingOptInScreen>( oobe_ui->GetView<MarketingOptInScreenHandler>(), - oobe_ui->display_type() == OobeUI::kOobeDisplay /*is_fullscreen*/, base::BindRepeating(&WizardController::OnMarketingOptInScreenExit, weak_factory_.GetWeakPtr()))); append(std::make_unique<PackagedLicenseScreen>(
diff --git a/chrome/browser/chromeos/net/network_health.cc b/chrome/browser/chromeos/net/network_health.cc new file mode 100644 index 0000000..271e543 --- /dev/null +++ b/chrome/browser/chromeos/net/network_health.cc
@@ -0,0 +1,78 @@ +// Copyright 2020 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "chrome/browser/chromeos/net/network_health.h" + +#include <vector> + +#include "chromeos/network/network_event_log.h" +#include "chromeos/services/network_config/in_process_instance.h" +#include "chromeos/services/network_config/public/mojom/cros_network_config.mojom.h" + +using chromeos::network_config::mojom::FilterType; +using chromeos::network_config::mojom::NetworkFilter; +using chromeos::network_config::mojom::NetworkStatePropertiesPtr; +using chromeos::network_config::mojom::NetworkType; + +namespace chromeos { + +NetworkHealth::NetworkHealthState::NetworkHealthState() {} + +NetworkHealth::NetworkHealthState::~NetworkHealthState() {} + +NetworkHealth::NetworkHealthState::NetworkHealthState( + const NetworkHealth::NetworkHealthState&) = default; + +NetworkHealth::NetworkState::NetworkState() {} + +NetworkHealth::NetworkState::~NetworkState() {} + +NetworkHealth::NetworkHealth() { + chromeos::network_config::BindToInProcessInstance( + remote_cros_network_config_.BindNewPipeAndPassReceiver()); + remote_cros_network_config_->AddObserver( + cros_network_config_observer_receiver_.BindNewPipeAndPassRemote()); + RefreshNetworkHealthState(); +} + +NetworkHealth::~NetworkHealth() {} + +NetworkHealth::NetworkHealthState NetworkHealth::GetNetworkHealthState() { + NET_LOG(EVENT) << "Network Health State Requested"; + return network_health_state_; +} + +void NetworkHealth::RefreshNetworkHealthState() { + RequestActiveNetworks(); +} + +void NetworkHealth::OnActiveNetworksReceived( + std::vector<NetworkStatePropertiesPtr> network_props) { + std::vector<NetworkState> active_networks; + for (const auto& prop : network_props) { + DCHECK(prop); + NetworkState state; + state.name = prop->name; + state.type = prop->type; + state.connection_state = prop->connection_state; + active_networks.push_back(std::move(state)); + } + + network_health_state_.active_networks.swap(active_networks); +} + +void NetworkHealth::OnActiveNetworksChanged( + std::vector<NetworkStatePropertiesPtr> network_props) { + OnActiveNetworksReceived(std::move(network_props)); +} + +void NetworkHealth::RequestActiveNetworks() { + remote_cros_network_config_->GetNetworkStateList( + NetworkFilter::New(FilterType::kActive, NetworkType::kAll, + network_config::mojom::kNoLimit), + base::BindOnce(&NetworkHealth::OnActiveNetworksReceived, + base::Unretained(this))); +} + +} // namespace chromeos
diff --git a/chrome/browser/chromeos/net/network_health.h b/chrome/browser/chromeos/net/network_health.h new file mode 100644 index 0000000..331b4d62 --- /dev/null +++ b/chrome/browser/chromeos/net/network_health.h
@@ -0,0 +1,77 @@ +// Copyright 2020 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef CHROME_BROWSER_CHROMEOS_NET_NETWORK_HEALTH_H_ +#define CHROME_BROWSER_CHROMEOS_NET_NETWORK_HEALTH_H_ + +#include <string> +#include <vector> + +#include "chromeos/services/network_config/public/mojom/cros_network_config.mojom.h" +#include "mojo/public/cpp/bindings/remote.h" + +namespace chromeos { + +class NetworkHealth + : public chromeos::network_config::mojom::CrosNetworkConfigObserver { + public: + // Structure for a single network's status. + struct NetworkState { + NetworkState(); + ~NetworkState(); + + std::string name; + chromeos::network_config::mojom::NetworkType type; + chromeos::network_config::mojom::ConnectionStateType connection_state; + }; + + // Structure containing the current snapshot of the state of Network Health. + struct NetworkHealthState { + NetworkHealthState(); + NetworkHealthState(const NetworkHealthState&); + ~NetworkHealthState(); + + std::vector<NetworkState> active_networks; + }; + + NetworkHealth(); + + ~NetworkHealth() override; + + // Returns the current NetworkHealthState. + NetworkHealthState GetNetworkHealthState(); + + // Handler for receiving new active networks. + void OnActiveNetworksReceived( + std::vector<chromeos::network_config::mojom::NetworkStatePropertiesPtr>); + + // CrosNetworkConfigObserver implementation + void OnActiveNetworksChanged( + std::vector<chromeos::network_config::mojom::NetworkStatePropertiesPtr>) + override; + + // CrosNetworkConfigObserver unimplemented callbacks + void OnNetworkStateListChanged() override {} + void OnNetworkStateChanged( + chromeos::network_config::mojom::NetworkStatePropertiesPtr) override {} + void OnDeviceStateListChanged() override {} + void OnVpnProvidersChanged() override {} + void OnNetworkCertificatesChanged() override {} + + private: + // Asynchronous call that refreshes the current Network Health State. + void RefreshNetworkHealthState(); + void RequestActiveNetworks(); + + mojo::Remote<chromeos::network_config::mojom::CrosNetworkConfig> + remote_cros_network_config_; + mojo::Receiver<chromeos::network_config::mojom::CrosNetworkConfigObserver> + cros_network_config_observer_receiver_{this}; + + NetworkHealthState network_health_state_; +}; + +} // namespace chromeos + +#endif // CHROME_BROWSER_CHROMEOS_NET_NETWORK_HEALTH_H_
diff --git a/chrome/browser/chromeos/net/network_health_unittest.cc b/chrome/browser/chromeos/net/network_health_unittest.cc new file mode 100644 index 0000000..e3ac319 --- /dev/null +++ b/chrome/browser/chromeos/net/network_health_unittest.cc
@@ -0,0 +1,60 @@ +// Copyright 2020 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "chrome/browser/chromeos/net/network_health.h" + +#include "chromeos/services/network_config/public/cpp/cros_network_config_test_helper.h" +#include "chromeos/services/network_config/public/mojom/cros_network_config.mojom.h" +#include "content/public/test/browser_task_environment.h" +#include "testing/gtest/include/gtest/gtest.h" +#include "third_party/cros_system_api/dbus/shill/dbus-constants.h" + +namespace { + +// Constant values for fake device and service. +constexpr char kServicePath[] = "/service/0"; +constexpr char kServiceName[] = "service_name"; +constexpr char kServiceGUID[] = "wifi_guid"; +constexpr char kDevicePath[] = "/device/wifi"; +constexpr char kDeviceName[] = "device_name"; +constexpr char kDefaultProfle[] = "/profile/default"; + +} // namespace + +namespace chromeos { + +class NetworkHealthTest : public ::testing::Test { + public: + NetworkHealthTest() {} + + protected: + content::BrowserTaskEnvironment task_environment_; + network_config::CrosNetworkConfigTestHelper cros_network_config_test_helper_; + NetworkHealth network_health_; +}; + +TEST_F(NetworkHealthTest, GetNetworkHealthSucceeds) { + // Create an active network. + cros_network_config_test_helper_.network_state_helper().AddDevice( + kDevicePath, shill::kTypeWifi, kDeviceName); + + cros_network_config_test_helper_.network_state_helper() + .service_test() + ->AddService(kServicePath, kServiceGUID, kServiceName, shill::kTypeWifi, + shill::kStateOnline, true); + + cros_network_config_test_helper_.network_state_helper() + .profile_test() + ->AddService(kDefaultProfle, kServicePath); + + // Wait until the network and service have been created and configured. + task_environment_.RunUntilIdle(); + + auto network_health_state = network_health_.GetNetworkHealthState(); + + EXPECT_EQ(network_health_state.active_networks.size(), std::size_t(1)); + EXPECT_EQ(network_health_state.active_networks[0].name, kServiceName); +} + +} // namespace chromeos
diff --git a/chrome/browser/chromeos/policy/device_local_account_browsertest.cc b/chrome/browser/chromeos/policy/device_local_account_browsertest.cc index d2771c9..1f9b470 100644 --- a/chrome/browser/chromeos/policy/device_local_account_browsertest.cc +++ b/chrome/browser/chromeos/policy/device_local_account_browsertest.cc
@@ -40,7 +40,9 @@ #include "base/threading/thread_task_runner_handle.h" #include "base/values.h" #include "chrome/browser/apps/app_service/app_launch_params.h" -#include "chrome/browser/apps/launch_service/launch_service.h" +#include "chrome/browser/apps/app_service/app_service_proxy.h" +#include "chrome/browser/apps/app_service/app_service_proxy_factory.h" +#include "chrome/browser/apps/app_service/launch_utils.h" #include "chrome/browser/browser_process.h" #include "chrome/browser/browser_process_platform_part.h" #include "chrome/browser/chrome_notification_types.h" @@ -167,6 +169,8 @@ #include "ui/base/ime/chromeos/input_method_util.h" #include "ui/base/l10n/l10n_util.h" #include "ui/base/window_open_disposition.h" +#include "ui/display/display.h" +#include "ui/display/screen.h" #include "ui/gfx/image/image_skia.h" #include "ui/views/widget/widget.h" #include "url/gurl.h" @@ -1699,10 +1703,17 @@ // Start the platform app, causing it to open a window. run_loop_.reset(new base::RunLoop); - apps::LaunchService::Get(profile)->OpenApplication(apps::AppLaunchParams( - app->id(), apps::mojom::LaunchContainer::kLaunchContainerNone, - WindowOpenDisposition::NEW_WINDOW, - apps::mojom::AppLaunchSource::kSourceTest)); + apps::AppServiceProxy* proxy = + apps::AppServiceProxyFactory::GetForProfile(profile); + proxy->FlushMojoCallsForTesting(); + proxy->Launch( + app->id(), + apps::GetEventFlags(apps::mojom::LaunchContainer::kLaunchContainerWindow, + WindowOpenDisposition::NEW_WINDOW, + false /* preferred_containner */), + apps::mojom::LaunchSource::kFromChromeInternal, + display::Screen::GetScreen()->GetPrimaryDisplay().id()); + proxy->FlushMojoCallsForTesting(); run_loop_->Run(); EXPECT_EQ(1U, app_window_registry->app_windows().size());
diff --git a/chrome/browser/chromeos/preferences.cc b/chrome/browser/chromeos/preferences.cc index 7672031..b2aee66 100644 --- a/chrome/browser/chromeos/preferences.cc +++ b/chrome/browser/chromeos/preferences.cc
@@ -14,6 +14,7 @@ #include "ash/public/mojom/cros_display_config.mojom.h" #include "base/bind.h" #include "base/command_line.h" +#include "base/feature_list.h" #include "base/i18n/time_formatting.h" #include "base/metrics/histogram_functions.h" #include "base/metrics/histogram_macros.h" @@ -41,6 +42,7 @@ #include "chrome/browser/ui/ash/system_tray_client.h" #include "chrome/common/chrome_features.h" #include "chrome/common/pref_names.h" +#include "chromeos/constants/chromeos_features.h" #include "chromeos/constants/chromeos_switches.h" #include "chromeos/settings/cros_settings_names.h" #include "chromeos/system/devicemode.h" @@ -115,6 +117,10 @@ static_cast<int>(method)); } +bool AreScrollSettingsAllowed() { + return base::FeatureList::IsEnabled(features::kAllowScrollSettings); +} + } // namespace Preferences::Preferences() @@ -684,60 +690,79 @@ } if (reason != REASON_PREF_CHANGED || pref_name == prefs::kMouseSensitivity) { - const int sensitivity = mouse_sensitivity_.GetValue(); - if (user_is_active) - mouse_settings.SetSensitivity(sensitivity); + const int sensitivity_int = mouse_sensitivity_.GetValue(); + if (user_is_active) { + mouse_settings.SetSensitivity(sensitivity_int); + + // With the flag off, also set scroll sensitivity (legacy fallback). + // TODO(https://crbug.com/836258): Remove check when flag is removed. + if (!AreScrollSettingsAllowed()) + mouse_settings.SetScrollSensitivity(sensitivity_int); + } + system::PointerSensitivity sensitivity = + static_cast<system::PointerSensitivity>(sensitivity_int); if (reason == REASON_PREF_CHANGED) { UMA_HISTOGRAM_ENUMERATION("Mouse.PointerSensitivity.Changed", - sensitivity, - system::kMaxPointerSensitivity + 1); + sensitivity); } else if (reason == REASON_INITIALIZATION) { UMA_HISTOGRAM_ENUMERATION("Mouse.PointerSensitivity.Started", - sensitivity, - system::kMaxPointerSensitivity + 1); + sensitivity); } } if (reason != REASON_PREF_CHANGED || pref_name == prefs::kMouseScrollSensitivity) { - const int sensitivity = mouse_scroll_sensitivity_.GetValue(); + // With the flag off, use to normal sensitivity (legacy fallback). + // TODO(https://crbug.com/836258): Remove check when flag is removed. + const int sensitivity_int = AreScrollSettingsAllowed() + ? mouse_scroll_sensitivity_.GetValue() + : mouse_sensitivity_.GetValue(); if (user_is_active) - mouse_settings.SetScrollSensitivity(sensitivity); - if (reason == REASON_PREF_CHANGED) { - UMA_HISTOGRAM_ENUMERATION("Mouse.ScrollSensitivity.Changed", sensitivity, - system::kMaxPointerSensitivity + 1); - } else if (reason == REASON_INITIALIZATION) { - UMA_HISTOGRAM_ENUMERATION("Mouse.ScrollSensitivity.Started", sensitivity, - system::kMaxPointerSensitivity + 1); - } + mouse_settings.SetScrollSensitivity(sensitivity_int); + system::PointerSensitivity sensitivity = + static_cast<system::PointerSensitivity>(sensitivity_int); + if (reason == REASON_PREF_CHANGED) + UMA_HISTOGRAM_ENUMERATION("Mouse.ScrollSensitivity.Changed", sensitivity); + else if (reason == REASON_INITIALIZATION) + UMA_HISTOGRAM_ENUMERATION("Mouse.ScrollSensitivity.Started", sensitivity); } if (reason != REASON_PREF_CHANGED || pref_name == prefs::kTouchpadSensitivity) { - const int sensitivity = touchpad_sensitivity_.GetValue(); - if (user_is_active) - touchpad_settings.SetSensitivity(sensitivity); + const int sensitivity_int = touchpad_sensitivity_.GetValue(); + if (user_is_active) { + touchpad_settings.SetSensitivity(sensitivity_int); + + // With the flag off, also set scroll sensitivity (legacy fallback). + // TODO(https://crbug.com/836258): Remove check when flag is removed. + if (!AreScrollSettingsAllowed()) + touchpad_settings.SetScrollSensitivity(sensitivity_int); + } + system::PointerSensitivity sensitivity = + static_cast<system::PointerSensitivity>(sensitivity_int); if (reason == REASON_PREF_CHANGED) { UMA_HISTOGRAM_ENUMERATION("Touchpad.PointerSensitivity.Changed", - sensitivity, - system::kMaxPointerSensitivity + 1); + sensitivity); } else if (reason == REASON_INITIALIZATION) { UMA_HISTOGRAM_ENUMERATION("Touchpad.PointerSensitivity.Started", - sensitivity, - system::kMaxPointerSensitivity + 1); + sensitivity); } } if (reason != REASON_PREF_CHANGED || pref_name == prefs::kTouchpadScrollSensitivity) { - const int sensitivity = touchpad_scroll_sensitivity_.GetValue(); + // With the flag off, use normal sensitivity (legacy fallback). + // TODO(https://crbug.com/836258): Remove check when flag is removed. + const int sensitivity_int = AreScrollSettingsAllowed() + ? touchpad_scroll_sensitivity_.GetValue() + : touchpad_sensitivity_.GetValue(); if (user_is_active) - touchpad_settings.SetScrollSensitivity(sensitivity); + touchpad_settings.SetScrollSensitivity(sensitivity_int); + system::PointerSensitivity sensitivity = + static_cast<system::PointerSensitivity>(sensitivity_int); if (reason == REASON_PREF_CHANGED) { UMA_HISTOGRAM_ENUMERATION("Touchpad.ScrollSensitivity.Changed", - sensitivity, - system::kMaxPointerSensitivity + 1); + sensitivity); } else if (reason == REASON_INITIALIZATION) { UMA_HISTOGRAM_ENUMERATION("Touchpad.ScrollSensitivity.Started", - sensitivity, - system::kMaxPointerSensitivity + 1); + sensitivity); } } if (reason != REASON_PREF_CHANGED ||
diff --git a/chrome/browser/chromeos/preferences_chromeos_browsertest.cc b/chrome/browser/chromeos/preferences_chromeos_browsertest.cc index 8db2a86..8a7b4cfe 100644 --- a/chrome/browser/chromeos/preferences_chromeos_browsertest.cc +++ b/chrome/browser/chromeos/preferences_chromeos_browsertest.cc
@@ -8,6 +8,7 @@ #include "ash/public/cpp/ash_pref_names.h" #include "base/command_line.h" #include "base/stl_util.h" +#include "base/test/scoped_feature_list.h" #include "chrome/browser/browser_process.h" #include "chrome/browser/chromeos/input_method/input_method_manager_impl.h" #include "chrome/browser/chromeos/login/login_manager_test.h" @@ -19,6 +20,7 @@ #include "chrome/browser/chromeos/settings/stub_cros_settings_provider.h" #include "chrome/browser/chromeos/system/fake_input_device_settings.h" #include "chrome/common/pref_names.h" +#include "chromeos/constants/chromeos_features.h" #include "components/feedback/tracing_manager.h" #include "components/prefs/pref_service.h" #include "components/user_manager/user_manager.h" @@ -47,6 +49,8 @@ scoped_testing_cros_settings_.device_settings()->Set( kDeviceOwner, base::Value(test_users_[0].GetUserEmail())); + + feature_list_.InitAndEnableFeature(features::kAllowScrollSettings); } void SetUpOnMainThread() override { @@ -140,6 +144,7 @@ ScopedTestingCrosSettings scoped_testing_cros_settings_; private: + base::test::ScopedFeatureList feature_list_; system::InputDeviceSettings::FakeInterface* input_settings_; input_method::FakeImeKeyboard* keyboard_;
diff --git a/chrome/browser/chromeos/system/input_device_settings.cc b/chrome/browser/chromeos/system/input_device_settings.cc index 2284a33..ac464df9 100644 --- a/chrome/browser/chromeos/system/input_device_settings.cc +++ b/chrome/browser/chromeos/system/input_device_settings.cc
@@ -37,14 +37,14 @@ TouchpadSettings& TouchpadSettings::operator=(const TouchpadSettings& other) { if (&other != this) { - sensitivity_ = other.sensitivity_; + acceleration_ = other.acceleration_; + natural_scroll_ = other.natural_scroll_; + scroll_acceleration_ = other.scroll_acceleration_; scroll_sensitivity_ = other.scroll_sensitivity_; + sensitivity_ = other.sensitivity_; + tap_dragging_ = other.tap_dragging_; tap_to_click_ = other.tap_to_click_; three_finger_click_ = other.three_finger_click_; - tap_dragging_ = other.tap_dragging_; - natural_scroll_ = other.natural_scroll_; - acceleration_ = other.acceleration_; - scroll_acceleration_ = other.scroll_acceleration_; } return *this; } @@ -61,18 +61,6 @@ return sensitivity_.has_value(); } -void TouchpadSettings::SetScrollSensitivity(int value) { - scroll_sensitivity_ = value; -} - -int TouchpadSettings::GetScrollSensitivity() const { - return *scroll_sensitivity_; -} - -bool TouchpadSettings::IsScrollSensitivitySet() const { - return scroll_sensitivity_.has_value(); -} - void TouchpadSettings::SetTapToClick(bool enabled) { tap_to_click_ = enabled; } @@ -85,18 +73,6 @@ return tap_to_click_.has_value(); } -void TouchpadSettings::SetNaturalScroll(bool enabled) { - natural_scroll_ = enabled; -} - -bool TouchpadSettings::GetNaturalScroll() const { - return *natural_scroll_; -} - -bool TouchpadSettings::IsNaturalScrollSet() const { - return natural_scroll_.has_value(); -} - void TouchpadSettings::SetThreeFingerClick(bool enabled) { three_finger_click_ = enabled; } @@ -133,6 +109,30 @@ return acceleration_.has_value(); } +void TouchpadSettings::SetNaturalScroll(bool enabled) { + natural_scroll_ = enabled; +} + +bool TouchpadSettings::GetNaturalScroll() const { + return *natural_scroll_; +} + +bool TouchpadSettings::IsNaturalScrollSet() const { + return natural_scroll_.has_value(); +} + +void TouchpadSettings::SetScrollSensitivity(int value) { + scroll_sensitivity_ = value; +} + +int TouchpadSettings::GetScrollSensitivity() const { + return *scroll_sensitivity_; +} + +bool TouchpadSettings::IsScrollSensitivitySet() const { + return scroll_sensitivity_.has_value(); +} + void TouchpadSettings::SetScrollAcceleration(bool enabled) { scroll_acceleration_ = enabled; } @@ -214,12 +214,12 @@ MouseSettings& MouseSettings::operator=(const MouseSettings& other) { if (&other != this) { - sensitivity_ = other.sensitivity_; - scroll_sensitivity_ = other.scroll_sensitivity_; - primary_button_right_ = other.primary_button_right_; - reverse_scroll_ = other.reverse_scroll_; acceleration_ = other.acceleration_; + primary_button_right_ = other.primary_button_right_; + scroll_sensitivity_ = other.scroll_sensitivity_; + reverse_scroll_ = other.reverse_scroll_; scroll_acceleration_ = other.scroll_acceleration_; + sensitivity_ = other.sensitivity_; } return *this; } @@ -236,18 +236,6 @@ return sensitivity_.has_value(); } -void MouseSettings::SetScrollSensitivity(int value) { - scroll_sensitivity_ = value; -} - -int MouseSettings::GetScrollSensitivity() const { - return *scroll_sensitivity_; -} - -bool MouseSettings::IsScrollSensitivitySet() const { - return scroll_sensitivity_.has_value(); -} - void MouseSettings::SetPrimaryButtonRight(bool right) { primary_button_right_ = right; } @@ -260,6 +248,18 @@ return primary_button_right_.has_value(); } +void MouseSettings::SetAcceleration(bool enabled) { + acceleration_ = enabled; +} + +bool MouseSettings::GetAcceleration() const { + return *acceleration_; +} + +bool MouseSettings::IsAccelerationSet() const { + return acceleration_.has_value(); +} + void MouseSettings::SetReverseScroll(bool enabled) { reverse_scroll_ = enabled; } @@ -272,16 +272,16 @@ return reverse_scroll_.has_value(); } -void MouseSettings::SetAcceleration(bool enabled) { - acceleration_ = enabled; +void MouseSettings::SetScrollSensitivity(int value) { + scroll_sensitivity_ = value; } -bool MouseSettings::GetAcceleration() const { - return *acceleration_; +int MouseSettings::GetScrollSensitivity() const { + return *scroll_sensitivity_; } -bool MouseSettings::IsAccelerationSet() const { - return acceleration_.has_value(); +bool MouseSettings::IsScrollSensitivitySet() const { + return scroll_sensitivity_.has_value(); } void MouseSettings::SetScrollAcceleration(bool enabled) { @@ -306,12 +306,10 @@ &primary_button_right_)) { updated = true; } - if (UpdateIfHasValue(settings.reverse_scroll_, &reverse_scroll_)) { + if (UpdateIfHasValue(settings.reverse_scroll_, &reverse_scroll_)) updated = true; - } - if (UpdateIfHasValue(settings.acceleration_, &acceleration_)) { + if (UpdateIfHasValue(settings.acceleration_, &acceleration_)) updated = true; - } if (UpdateIfHasValue(settings.scroll_acceleration_, &scroll_acceleration_)) updated = true; return updated;
diff --git a/chrome/browser/chromeos/system/input_device_settings.h b/chrome/browser/chromeos/system/input_device_settings.h index e5415a1..dcb59ff 100644 --- a/chrome/browser/chromeos/system/input_device_settings.h +++ b/chrome/browser/chromeos/system/input_device_settings.h
@@ -13,10 +13,16 @@ class InputDeviceSettings; -// Min/max possible sensitivity values; used for both cursor sensitivity and -// scroll sensitivity. -const int kMinPointerSensitivity = 1; -const int kMaxPointerSensitivity = 5; +// Sensitivity values; used for both cursor sensitivity and scroll sensitivity. +// Do not change/reuse numbers (used for IPC calls and metrics). +enum class PointerSensitivity { + kLowest = 1, + kLow = 2, + kMedium = 3, + kHigh = 4, + kHighest = 5, + kMaxValue = kHighest, +}; // Auxiliary class used to update several touchpad settings at a time. User // should set any number of settings and pass object to UpdateTouchpadSettings @@ -34,10 +40,6 @@ int GetSensitivity() const; bool IsSensitivitySet() const; - void SetScrollSensitivity(int value); - int GetScrollSensitivity() const; - bool IsScrollSensitivitySet() const; - void SetTapToClick(bool enabled); bool GetTapToClick() const; bool IsTapToClickSet() const; @@ -50,13 +52,17 @@ bool GetTapDragging() const; bool IsTapDraggingSet() const; + void SetAcceleration(bool enabled); + bool GetAcceleration() const; + bool IsAccelerationSet() const; + void SetNaturalScroll(bool enabled); bool GetNaturalScroll() const; bool IsNaturalScrollSet() const; - void SetAcceleration(bool enabled); - bool GetAcceleration() const; - bool IsAccelerationSet() const; + void SetScrollSensitivity(int value); + int GetScrollSensitivity() const; + bool IsScrollSensitivitySet() const; void SetScrollAcceleration(bool enabled); bool GetScrollAcceleration() const; @@ -71,14 +77,14 @@ InputDeviceSettings* input_device_settings); private: + base::Optional<bool> acceleration_; + base::Optional<bool> natural_scroll_; base::Optional<int> sensitivity_; + base::Optional<bool> scroll_acceleration_; base::Optional<int> scroll_sensitivity_; + base::Optional<bool> tap_dragging_; base::Optional<bool> tap_to_click_; base::Optional<bool> three_finger_click_; - base::Optional<bool> tap_dragging_; - base::Optional<bool> natural_scroll_; - base::Optional<bool> acceleration_; - base::Optional<bool> scroll_acceleration_; }; // Auxiliary class used to update several mouse settings at a time. User @@ -97,21 +103,21 @@ int GetSensitivity() const; bool IsSensitivitySet() const; - void SetScrollSensitivity(int value); - int GetScrollSensitivity() const; - bool IsScrollSensitivitySet() const; - void SetPrimaryButtonRight(bool right); bool GetPrimaryButtonRight() const; bool IsPrimaryButtonRightSet() const; + void SetAcceleration(bool enabled); + bool GetAcceleration() const; + bool IsAccelerationSet() const; + void SetReverseScroll(bool enabled); bool GetReverseScroll() const; bool IsReverseScrollSet() const; - void SetAcceleration(bool enabled); - bool GetAcceleration() const; - bool IsAccelerationSet() const; + void SetScrollSensitivity(int value); + int GetScrollSensitivity() const; + bool IsScrollSensitivitySet() const; void SetScrollAcceleration(bool enabled); bool GetScrollAcceleration() const; @@ -126,12 +132,12 @@ InputDeviceSettings* input_device_settings); private: - base::Optional<int> sensitivity_; - base::Optional<int> scroll_sensitivity_; + base::Optional<bool> acceleration_; base::Optional<bool> primary_button_right_; base::Optional<bool> reverse_scroll_; - base::Optional<bool> acceleration_; base::Optional<bool> scroll_acceleration_; + base::Optional<int> scroll_sensitivity_; + base::Optional<int> sensitivity_; }; // Interface for configuring input device settings.
diff --git a/chrome/browser/chromeos/system/input_device_settings_impl_ozone.cc b/chrome/browser/chromeos/system/input_device_settings_impl_ozone.cc index 10286e50..9b6d3751 100644 --- a/chrome/browser/chromeos/system/input_device_settings_impl_ozone.cc +++ b/chrome/browser/chromeos/system/input_device_settings_impl_ozone.cc
@@ -80,14 +80,15 @@ } void InputDeviceSettingsImplOzone::SetTouchpadSensitivity(int value) { - DCHECK(value >= kMinPointerSensitivity && value <= kMaxPointerSensitivity); + DCHECK_GE(value, static_cast<int>(PointerSensitivity::kLowest)); + DCHECK_LE(value, static_cast<int>(PointerSensitivity::kHighest)); current_touchpad_settings_.SetSensitivity(value); input_controller()->SetTouchpadSensitivity(value); } void InputDeviceSettingsImplOzone::SetTouchpadScrollSensitivity(int value) { - DCHECK_GE(value, kMinPointerSensitivity); - DCHECK_LE(value, kMaxPointerSensitivity); + DCHECK_GE(value, static_cast<int>(PointerSensitivity::kLowest)); + DCHECK_LE(value, static_cast<int>(PointerSensitivity::kHighest)); current_touchpad_settings_.SetScrollSensitivity(value); input_controller()->SetTouchpadScrollSensitivity(value); } @@ -125,14 +126,15 @@ } void InputDeviceSettingsImplOzone::SetMouseSensitivity(int value) { - DCHECK(value >= kMinPointerSensitivity && value <= kMaxPointerSensitivity); + DCHECK_GE(value, static_cast<int>(PointerSensitivity::kLowest)); + DCHECK_LE(value, static_cast<int>(PointerSensitivity::kHighest)); current_mouse_settings_.SetSensitivity(value); input_controller()->SetMouseSensitivity(value); } void InputDeviceSettingsImplOzone::SetMouseScrollSensitivity(int value) { - DCHECK_GE(value, kMinPointerSensitivity); - DCHECK_LE(value, kMaxPointerSensitivity); + DCHECK_GE(value, static_cast<int>(PointerSensitivity::kLowest)); + DCHECK_LE(value, static_cast<int>(PointerSensitivity::kHighest)); current_mouse_settings_.SetScrollSensitivity(value); input_controller()->SetMouseScrollSensitivity(value); }
diff --git a/chrome/browser/download/notification/download_item_notification_unittest.cc b/chrome/browser/download/notification/download_item_notification_unittest.cc index d8400ef..dbe2e0c6 100644 --- a/chrome/browser/download/notification/download_item_notification_unittest.cc +++ b/chrome/browser/download/notification/download_item_notification_unittest.cc
@@ -12,6 +12,7 @@ #include "base/run_loop.h" #include "base/test/test_simple_task_runner.h" #include "base/threading/thread_task_runner_handle.h" +#include "chrome/browser/download/chrome_download_manager_delegate.h" #include "chrome/browser/download/notification/download_notification_manager.h" #include "chrome/browser/download/offline_item_utils.h" #include "chrome/browser/notifications/notification_display_service.h" @@ -261,4 +262,58 @@ EXPECT_GT(LookUpNotification()->priority(), message_center::LOW_PRIORITY); } +TEST_F(DownloadItemNotificationTest, DeepScanning) { + // Setup deep scanning in progress. + EXPECT_CALL(*download_item_, GetDangerType()) + .WillRepeatedly(Return(download::DOWNLOAD_DANGER_TYPE_ASYNC_SCANNING)); + auto state = + std::make_unique<ChromeDownloadManagerDelegate::SafeBrowsingState>(); + download_item_->SetUserData(&ChromeDownloadManagerDelegate:: + SafeBrowsingState::kSafeBrowsingUserDataKey, + std::move(state)); + CreateDownloadItemNotification(); + + // Can't open while scanning. + profile_manager_->local_state()->Get()->SetManagedPref( + prefs::kDelayDeliveryUntilVerdict, + std::make_unique<base::Value>(safe_browsing::DELAY_DOWNLOADS)); + EXPECT_CALL(*download_item_, OpenDownload()).Times(0); + EXPECT_CALL(*download_item_, SetOpenWhenComplete(true)).Times(1); + download_item_notification_->Click(base::nullopt, base::nullopt); + + // Can be opened while scanning. + profile_manager_->local_state()->Get()->SetManagedPref( + prefs::kDelayDeliveryUntilVerdict, + std::make_unique<base::Value>(safe_browsing::DELAY_NONE)); + EXPECT_CALL(*download_item_, OpenDownload()).Times(1); + download_item_notification_->Click(base::nullopt, base::nullopt); + + // Scanning finished, warning. + EXPECT_CALL(*download_item_, IsDangerous()).WillRepeatedly(Return(true)); + EXPECT_CALL(*download_item_, GetDangerType()) + .WillRepeatedly( + Return(download::DOWNLOAD_DANGER_TYPE_SENSITIVE_CONTENT_WARNING)); + EXPECT_CALL(*download_item_, OpenDownload()).Times(0); + EXPECT_CALL(*download_item_, SetOpenWhenComplete(true)).Times(0); + download_item_notification_->Click(base::nullopt, base::nullopt); + + // Scanning finished, blocked. + EXPECT_CALL(*download_item_, IsDangerous()).WillRepeatedly(Return(true)); + EXPECT_CALL(*download_item_, GetDangerType()) + .WillRepeatedly( + Return(download::DOWNLOAD_DANGER_TYPE_SENSITIVE_CONTENT_BLOCK)); + EXPECT_CALL(*download_item_, OpenDownload()).Times(0); + EXPECT_CALL(*download_item_, SetOpenWhenComplete(true)).Times(0); + download_item_notification_->Click(base::nullopt, base::nullopt); + + // Scanning finished, safe. + EXPECT_CALL(*download_item_, IsDangerous()).WillRepeatedly(Return(false)); + EXPECT_CALL(*download_item_, GetDangerType()) + .WillRepeatedly(Return(download::DOWNLOAD_DANGER_TYPE_DEEP_SCANNED_SAFE)); + EXPECT_CALL(*download_item_, GetState()) + .WillRepeatedly(Return(download::DownloadItem::COMPLETE)); + EXPECT_CALL(*download_item_, OpenDownload()).Times(1); + download_item_notification_->Click(base::nullopt, base::nullopt); +} + } // namespace test
diff --git a/chrome/browser/enterprise/connectors/connectors_manager.cc b/chrome/browser/enterprise/connectors/connectors_manager.cc new file mode 100644 index 0000000..c35531af --- /dev/null +++ b/chrome/browser/enterprise/connectors/connectors_manager.cc
@@ -0,0 +1,210 @@ +// Copyright 2020 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "chrome/browser/enterprise/connectors/connectors_manager.h" +#include <memory> + +#include "base/feature_list.h" +#include "base/values.h" +#include "chrome/browser/browser_process.h" +#include "components/policy/core/browser/url_util.h" +#include "components/prefs/pref_service.h" +#include "components/safe_browsing/core/common/safe_browsing_prefs.h" +#include "components/safe_browsing/core/features.h" +#include "components/url_matcher/url_matcher.h" + +namespace enterprise_connectors { + +namespace { + +base::ListValue AllPatterns() { + auto v = std::vector<base::Value>(); + v.emplace_back("*"); + return base::ListValue(std::move(v)); +} + +bool MatchURLAgainstPatterns(const GURL& url, + const base::ListValue* patterns_to_scan, + const base::ListValue* patterns_to_exempt) { + url_matcher::URLMatcher matcher; + url_matcher::URLMatcherConditionSet::ID id(0); + + policy::url_util::AddFilters(&matcher, true, &id, patterns_to_scan); + + url_matcher::URLMatcherConditionSet::ID last_allowed_id = id; + + policy::url_util::AddFilters(&matcher, false, &id, patterns_to_exempt); + + auto matches = matcher.MatchURL(url); + bool has_scan_match = false; + for (const auto& match_id : matches) { + if (match_id <= last_allowed_id) + has_scan_match = true; + else + return false; + } + return has_scan_match; +} + +} // namespace + +// ConnectorsManager implementation--------------------------------------------- +ConnectorsManager::~ConnectorsManager() = default; + +ConnectorsManager::ConnectorsManager() = default; + +void ConnectorsManager::GetAnalysisSettings(const GURL& url, + AnalysisConnector connector, + AnalysisSettingsCallback callback) { + std::move(callback).Run( + GetAnalysisSettingsFromLegacyPolicies(url, connector)); +} + +base::Optional<ConnectorsManager::AnalysisSettings> +ConnectorsManager::GetAnalysisSettingsFromLegacyPolicies( + const GURL& url, + AnalysisConnector connector) const { + // Legacy policies map to upload/download instead of individual hooks. + bool upload = connector != AnalysisConnector::FILE_DOWNLOADED; + + std::set<std::string> tags = MatchURLAgainstLegacyPolicies(url, upload); + + // No tags implies the legacy patterns policies didn't match the URL, so no + // settings are returned. + if (tags.empty()) + return base::nullopt; + + auto settings = AnalysisSettings(); + settings.block_until_verdict = LegacyBlockUntilVerdict(upload); + settings.block_password_protected_files = + LegacyBlockPasswordProtectedFiles(upload); + settings.block_large_files = LegacyBlockLargeFiles(upload); + settings.block_unsupported_file_types = + LegacyBlockUnsupportedFileTypes(upload); + settings.tags = std::move(tags); + + return settings; +} + +BlockUntilVerdict ConnectorsManager::LegacyBlockUntilVerdict( + bool upload) const { + int pref = g_browser_process->local_state()->GetInteger( + prefs::kDelayDeliveryUntilVerdict); + if (pref == safe_browsing::DELAY_NONE) + return BlockUntilVerdict::NO_BLOCK; + if (pref == safe_browsing::DELAY_UPLOADS_AND_DOWNLOADS) + return BlockUntilVerdict::BLOCK; + return ((upload && pref == safe_browsing::DELAY_UPLOADS) || + (!upload && pref == safe_browsing::DELAY_DOWNLOADS)) + ? BlockUntilVerdict::BLOCK + : BlockUntilVerdict::NO_BLOCK; +} + +bool ConnectorsManager::LegacyBlockPasswordProtectedFiles(bool upload) const { + int pref = g_browser_process->local_state()->GetInteger( + prefs::kAllowPasswordProtectedFiles); + if (pref == safe_browsing::ALLOW_NONE) + return true; + if (pref == safe_browsing::ALLOW_UPLOADS_AND_DOWNLOADS) + return false; + return upload ? pref != safe_browsing::ALLOW_UPLOADS + : pref != safe_browsing::ALLOW_DOWNLOADS; +} + +bool ConnectorsManager::LegacyBlockLargeFiles(bool upload) const { + int pref = g_browser_process->local_state()->GetInteger( + prefs::kBlockLargeFileTransfer); + if (pref == safe_browsing::BLOCK_NONE) + return false; + if (pref == safe_browsing::BLOCK_LARGE_UPLOADS_AND_DOWNLOADS) + return true; + return upload ? pref == safe_browsing::BLOCK_LARGE_UPLOADS + : pref == safe_browsing::BLOCK_LARGE_DOWNLOADS; +} + +bool ConnectorsManager::LegacyBlockUnsupportedFileTypes(bool upload) const { + int pref = g_browser_process->local_state()->GetInteger( + prefs::kBlockUnsupportedFiletypes); + if (pref == safe_browsing::BLOCK_UNSUPPORTED_FILETYPES_NONE) + return false; + if (pref == safe_browsing::BLOCK_UNSUPPORTED_FILETYPES_UPLOADS_AND_DOWNLOADS) + return true; + return upload ? pref == safe_browsing::BLOCK_UNSUPPORTED_FILETYPES_UPLOADS + : pref == safe_browsing::BLOCK_UNSUPPORTED_FILETYPES_DOWNLOADS; +} + +bool ConnectorsManager::MatchURLAgainstLegacyDlpPolicies(const GURL& url, + bool upload) const { + const base::ListValue all_patterns = AllPatterns(); + const base::ListValue no_patterns = base::ListValue(); + + const base::ListValue* patterns_to_scan; + const base::ListValue* patterns_to_exempt; + if (upload) { + patterns_to_scan = &all_patterns; + patterns_to_exempt = g_browser_process->local_state()->GetList( + prefs::kURLsToNotCheckComplianceOfUploadedContent); + } else { + patterns_to_scan = g_browser_process->local_state()->GetList( + prefs::kURLsToCheckComplianceOfDownloadedContent); + patterns_to_exempt = &no_patterns; + } + + return MatchURLAgainstPatterns(url, patterns_to_scan, patterns_to_exempt); +} + +bool ConnectorsManager::MatchURLAgainstLegacyMalwarePolicies( + const GURL& url, + bool upload) const { + const base::ListValue all_patterns = AllPatterns(); + const base::ListValue no_patterns = base::ListValue(); + + const base::ListValue* patterns_to_scan; + const base::ListValue* patterns_to_exempt; + if (upload) { + patterns_to_scan = g_browser_process->local_state()->GetList( + prefs::kURLsToCheckForMalwareOfUploadedContent); + patterns_to_exempt = &no_patterns; + } else { + patterns_to_scan = &all_patterns; + patterns_to_exempt = g_browser_process->local_state()->GetList( + prefs::kURLsToNotCheckForMalwareOfDownloadedContent); + } + + return MatchURLAgainstPatterns(url, patterns_to_scan, patterns_to_exempt); +} + +std::set<std::string> ConnectorsManager::MatchURLAgainstLegacyPolicies( + const GURL& url, + bool upload) const { + std::set<std::string> tags; + + if (MatchURLAgainstLegacyDlpPolicies(url, upload)) + tags.emplace("dlp"); + + if (MatchURLAgainstLegacyMalwarePolicies(url, upload)) + tags.emplace("malware"); + + return tags; +} + +// ConnectorsManager structs implementation------------------------------------- + +ConnectorsManager::AnalysisSettings::AnalysisSettings() = default; +ConnectorsManager::AnalysisSettings::AnalysisSettings( + ConnectorsManager::AnalysisSettings&&) = default; +ConnectorsManager::AnalysisSettings& +ConnectorsManager::AnalysisSettings::operator=( + ConnectorsManager::AnalysisSettings&&) = default; +ConnectorsManager::AnalysisSettings::~AnalysisSettings() = default; + +ConnectorsManager::ReportingSettings::ReportingSettings() = default; +ConnectorsManager::ReportingSettings::ReportingSettings( + ConnectorsManager::ReportingSettings&&) = default; +ConnectorsManager::ReportingSettings& +ConnectorsManager::ReportingSettings::operator=( + ConnectorsManager::ReportingSettings&&) = default; +ConnectorsManager::ReportingSettings::~ReportingSettings() = default; + +} // namespace enterprise_connectors
diff --git a/chrome/browser/enterprise/connectors/connectors_manager.h b/chrome/browser/enterprise/connectors/connectors_manager.h new file mode 100644 index 0000000..ee06a40 --- /dev/null +++ b/chrome/browser/enterprise/connectors/connectors_manager.h
@@ -0,0 +1,101 @@ +// Copyright 2020 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef CHROME_BROWSER_ENTERPRISE_CONNECTORS_CONNECTORS_MANAGER_H_ +#define CHROME_BROWSER_ENTERPRISE_CONNECTORS_CONNECTORS_MANAGER_H_ + +#include "base/callback_forward.h" +#include "base/optional.h" +#include "url/gurl.h" + +namespace enterprise_connectors { + +// Enums representing each connector to be used as arguments so the manager can +// read the appropriate policies/settings. +enum class AnalysisConnector { + FILE_DOWNLOADED, + FILE_ATTACHED, + BULK_DATA_ENTRY, +}; + +enum class ReportingConnector { + SECURITY_EVENT, +}; + +// Enum representing if an analysis should block further interactions with the +// browser until its verdict is obtained. +enum class BlockUntilVerdict { + NO_BLOCK = 0, + BLOCK = 1, +}; + +// Manages access to Connector policies. This class is responsible for caching +// the Connector policies, validate them against approved service providers and +// provide a simple interface to them. +class ConnectorsManager { + public: + // Structs representing settings to be used for an analysis or a report. These + // settings should only be kept and considered valid for the specific + // analysis/report they were obtained for. + struct AnalysisSettings { + AnalysisSettings(); + AnalysisSettings(AnalysisSettings&&); + AnalysisSettings& operator=(AnalysisSettings&&); + ~AnalysisSettings(); + + GURL analysis_url; + std::set<std::string> tags; + BlockUntilVerdict block_until_verdict; + bool block_password_protected_files; + bool block_large_files; + bool block_unsupported_file_types; + }; + + struct ReportingSettings { + ReportingSettings(); + ReportingSettings(ReportingSettings&&); + ReportingSettings& operator=(ReportingSettings&&); + ~ReportingSettings(); + + std::vector<GURL> reporting_urls; + }; + + // Callback used to retrieve AnalysisSettings objects from the manager + // asynchronously. base::nullopt means no analysis should take place. + using AnalysisSettingsCallback = + base::OnceCallback<void(base::Optional<AnalysisSettings>)>; + + ConnectorsManager(); + ~ConnectorsManager(); + + // Validates which settings should be applied to an analysis connector event + // against cached policies. + void GetAnalysisSettings(const GURL& url, + AnalysisConnector connector, + AnalysisSettingsCallback callback); + + private: + // Legacy functions. + // These functions are used to interact with legacy policies and should stay + // private. They should be removed once legacy policies are deprecated. + + // Returns analysis settings based on legacy policies. + base::Optional<AnalysisSettings> GetAnalysisSettingsFromLegacyPolicies( + const GURL& url, + AnalysisConnector connector) const; + + BlockUntilVerdict LegacyBlockUntilVerdict(bool upload) const; + bool LegacyBlockPasswordProtectedFiles(bool upload) const; + bool LegacyBlockLargeFiles(bool upload) const; + bool LegacyBlockUnsupportedFileTypes(bool upload) const; + + bool MatchURLAgainstLegacyDlpPolicies(const GURL& url, bool upload) const; + bool MatchURLAgainstLegacyMalwarePolicies(const GURL& url, bool upload) const; + std::set<std::string> MatchURLAgainstLegacyPolicies(const GURL& url, + bool upload) const; +}; + +} // namespace enterprise_connectors + +#endif // CHROME_BROWSER_ENTERPRISE_CONNECTORS_CONNECTORS_MANAGER_H_
diff --git a/chrome/browser/enterprise/connectors/connectors_manager_unittest.cc b/chrome/browser/enterprise/connectors/connectors_manager_unittest.cc new file mode 100644 index 0000000..e5a4497 --- /dev/null +++ b/chrome/browser/enterprise/connectors/connectors_manager_unittest.cc
@@ -0,0 +1,356 @@ +// Copyright 2020 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "chrome/browser/enterprise/connectors/connectors_manager.h" + +#include "base/optional.h" +#include "base/test/bind_test_util.h" +#include "base/test/scoped_feature_list.h" +#include "base/test/task_environment.h" +#include "chrome/browser/browser_process.h" +#include "chrome/test/base/testing_browser_process.h" +#include "chrome/test/base/testing_profile.h" +#include "chrome/test/base/testing_profile_manager.h" +#include "components/prefs/pref_service.h" +#include "components/prefs/scoped_user_pref_update.h" +#include "components/safe_browsing/core/common/safe_browsing_prefs.h" +#include "components/safe_browsing/core/features.h" +#include "content/public/test/browser_task_environment.h" +#include "testing/gtest/include/gtest/gtest.h" + +namespace enterprise_connectors { + +namespace { + +constexpr char kTestUrlMatchingPattern[] = "google.com"; + +constexpr char kTestUrlNotMatchingPattern[] = "chromium.org"; + +constexpr AnalysisConnector kAllAnalysisConnectors[] = { + AnalysisConnector::FILE_DOWNLOADED, AnalysisConnector::FILE_ATTACHED, + AnalysisConnector::BULK_DATA_ENTRY}; + +constexpr safe_browsing::BlockLargeFileTransferValues + kAllBlockLargeFilesPolicyValues[] = { + safe_browsing::BlockLargeFileTransferValues::BLOCK_NONE, + safe_browsing::BlockLargeFileTransferValues::BLOCK_LARGE_DOWNLOADS, + safe_browsing::BlockLargeFileTransferValues::BLOCK_LARGE_UPLOADS, + safe_browsing::BlockLargeFileTransferValues:: + BLOCK_LARGE_UPLOADS_AND_DOWNLOADS}; + +constexpr safe_browsing::BlockUnsupportedFiletypesValues + kAllBlockUnsupportedFileTypesValues[] = { + safe_browsing::BlockUnsupportedFiletypesValues:: + BLOCK_UNSUPPORTED_FILETYPES_NONE, + safe_browsing::BlockUnsupportedFiletypesValues:: + BLOCK_UNSUPPORTED_FILETYPES_DOWNLOADS, + safe_browsing::BlockUnsupportedFiletypesValues:: + BLOCK_UNSUPPORTED_FILETYPES_UPLOADS, + safe_browsing::BlockUnsupportedFiletypesValues:: + BLOCK_UNSUPPORTED_FILETYPES_UPLOADS_AND_DOWNLOADS, +}; + +constexpr safe_browsing::AllowPasswordProtectedFilesValues + kAllAllowEncryptedPolicyValues[] = { + safe_browsing::AllowPasswordProtectedFilesValues::ALLOW_NONE, + safe_browsing::AllowPasswordProtectedFilesValues::ALLOW_DOWNLOADS, + safe_browsing::AllowPasswordProtectedFilesValues::ALLOW_UPLOADS, + safe_browsing::AllowPasswordProtectedFilesValues:: + ALLOW_UPLOADS_AND_DOWNLOADS}; + +constexpr safe_browsing::DelayDeliveryUntilVerdictValues + kAllDelayDeliveryUntilVerdictValues[] = { + safe_browsing::DelayDeliveryUntilVerdictValues::DELAY_NONE, + safe_browsing::DelayDeliveryUntilVerdictValues::DELAY_DOWNLOADS, + safe_browsing::DelayDeliveryUntilVerdictValues::DELAY_UPLOADS, + safe_browsing::DelayDeliveryUntilVerdictValues:: + DELAY_UPLOADS_AND_DOWNLOADS, +}; + +} // namespace + +// Tests that permutations of legacy policies produce expected settings from a +// ConnectorsManager instance. T is a type used to iterate over policies with a +// {NONE, DOWNLOADS, UPLOADS, UPLOADS_AND_DOWNLOADS} pattern without testing +// every single permutation since these settings are independent. +template <typename T> +class ConnectorsManagerLegacyPoliciesTest + : public testing::TestWithParam<std::tuple<AnalysisConnector, T>> { + public: + ConnectorsManagerLegacyPoliciesTest<T>() + : profile_manager_(TestingBrowserProcess::GetGlobal()) { + scoped_feature_list_.InitWithFeatures( + {safe_browsing::kContentComplianceEnabled, + safe_browsing::kMalwareScanEnabled}, + {}); + + EXPECT_TRUE(profile_manager_.SetUp()); + profile_ = profile_manager_.CreateTestingProfile("test-user"); + } + + AnalysisConnector connector() const { return std::get<0>(this->GetParam()); } + T tested_policy() const { return std::get<1>(this->GetParam()); } + + bool upload_scan() const { + return connector() != AnalysisConnector::FILE_DOWNLOADED; + } + + void ValidateSettings(const ConnectorsManager::AnalysisSettings& settings) { + ASSERT_EQ(settings.block_until_verdict, expected_block_until_verdict_); + ASSERT_EQ(settings.block_password_protected_files, + expected_block_password_protected_files_); + ASSERT_EQ(settings.block_large_files, expected_block_large_files_); + ASSERT_EQ(settings.block_unsupported_file_types, + expected_block_unsupported_file_types_); + ASSERT_EQ(settings.tags, expected_tags_); + } + + base::Optional<ConnectorsManager::AnalysisSettings> GetAnalysisSettingsSync( + const GURL& url, + AnalysisConnector connector) { + // This helper only works when the result is known to be available + // synchronously. Do not use it for async tests. + base::Optional<ConnectorsManager::AnalysisSettings> settings(base::nullopt); + auto callback = base::BindLambdaForTesting( + [&settings]( + base::Optional<ConnectorsManager::AnalysisSettings> tmp_settings) { + settings = std::move(tmp_settings); + }); + connectors_manager_.GetAnalysisSettings(url, connector, callback); + return settings; + } + + void TestPolicy() { + upload_scan() ? TestPolicyOnUpload() : TestPolicyOnDownload(); + } + + void TestPolicyOnDownload() { + // DLP only checks uploads by default and malware only checks downloads by + // default. Overriding the appropriate policies subsequently will change the + // tags matching the pattern. + auto default_settings = GetAnalysisSettingsSync(url_, connector()); + ASSERT_TRUE(default_settings.has_value()); + expected_tags_ = {"malware"}; + ValidateSettings(default_settings.value()); + + // The DLP tag is still absent if the patterns don't match it. + ListPrefUpdate(TestingBrowserProcess::GetGlobal()->local_state(), + prefs::kURLsToCheckComplianceOfDownloadedContent) + ->Append(kTestUrlNotMatchingPattern); + auto exempt_pattern_dlp_settings = + GetAnalysisSettingsSync(url_, connector()); + ASSERT_TRUE(exempt_pattern_dlp_settings.has_value()); + ValidateSettings(exempt_pattern_dlp_settings.value()); + + // The DLP tag is added once the patterns do match it. + ListPrefUpdate(TestingBrowserProcess::GetGlobal()->local_state(), + prefs::kURLsToCheckComplianceOfDownloadedContent) + ->Append(kTestUrlMatchingPattern); + auto scan_pattern_dlp_settings = GetAnalysisSettingsSync(url_, connector()); + ASSERT_TRUE(scan_pattern_dlp_settings.has_value()); + expected_tags_ = {"dlp", "malware"}; + ValidateSettings(scan_pattern_dlp_settings.value()); + + // The malware tag is removed once exempt patterns match it. + ListPrefUpdate(TestingBrowserProcess::GetGlobal()->local_state(), + prefs::kURLsToNotCheckForMalwareOfDownloadedContent) + ->Append(kTestUrlMatchingPattern); + auto exempt_pattern_malware_settings = + GetAnalysisSettingsSync(url_, connector()); + ASSERT_TRUE(exempt_pattern_malware_settings.has_value()); + expected_tags_ = {"dlp"}; + ValidateSettings(exempt_pattern_malware_settings.value()); + + // Both tags are removed once the patterns don't match them, resulting in no + // settings. + ListPrefUpdate(TestingBrowserProcess::GetGlobal()->local_state(), + prefs::kURLsToCheckComplianceOfDownloadedContent) + ->Remove(1, nullptr); + auto no_settings = GetAnalysisSettingsSync(url_, connector()); + ASSERT_FALSE(no_settings.has_value()); + } + + void TestPolicyOnUpload() { + // DLP only checks uploads by default and malware only checks downloads by + // default. Overriding the appropriate policies subsequently will change the + // tags matching the pattern. + auto default_settings = GetAnalysisSettingsSync(url_, connector()); + ASSERT_TRUE(default_settings.has_value()); + expected_tags_ = {"dlp"}; + ValidateSettings(default_settings.value()); + + // The malware tag is still absent if the patterns don't match it. + ListPrefUpdate(TestingBrowserProcess::GetGlobal()->local_state(), + prefs::kURLsToCheckForMalwareOfUploadedContent) + ->Append(kTestUrlNotMatchingPattern); + auto exempt_pattern_malware_settings = + GetAnalysisSettingsSync(url_, connector()); + ASSERT_TRUE(exempt_pattern_malware_settings.has_value()); + ValidateSettings(exempt_pattern_malware_settings.value()); + + // The malware tag is added once the patterns do match it. + ListPrefUpdate(TestingBrowserProcess::GetGlobal()->local_state(), + prefs::kURLsToCheckForMalwareOfUploadedContent) + ->Append(kTestUrlMatchingPattern); + auto scan_pattern_malware_settings = + GetAnalysisSettingsSync(url_, connector()); + ASSERT_TRUE(scan_pattern_malware_settings.has_value()); + expected_tags_ = {"dlp", "malware"}; + ValidateSettings(scan_pattern_malware_settings.value()); + + // The DLP tag is removed once exempt patterns match it. + ListPrefUpdate(TestingBrowserProcess::GetGlobal()->local_state(), + prefs::kURLsToNotCheckComplianceOfUploadedContent) + ->Append(kTestUrlMatchingPattern); + auto exempt_pattern_dlp_settings = + GetAnalysisSettingsSync(url_, connector()); + ASSERT_TRUE(exempt_pattern_dlp_settings.has_value()); + expected_tags_ = {"malware"}; + ValidateSettings(exempt_pattern_dlp_settings.value()); + + // Both tags are removed once the patterns don't match them, resulting in no + // settings. + ListPrefUpdate(TestingBrowserProcess::GetGlobal()->local_state(), + prefs::kURLsToCheckForMalwareOfUploadedContent) + ->Remove(1, nullptr); + auto no_settings = GetAnalysisSettingsSync(url_, connector()); + ASSERT_FALSE(no_settings.has_value()); + } + + protected: + content::BrowserTaskEnvironment task_environment_; + base::test::ScopedFeatureList scoped_feature_list_; + TestingProfileManager profile_manager_; + TestingProfile* profile_; + ConnectorsManager connectors_manager_; + GURL url_ = GURL("https://google.com"); + + // Set to the default value of their legacy policy. + std::set<std::string> expected_tags_ = {}; + BlockUntilVerdict expected_block_until_verdict_ = BlockUntilVerdict::NO_BLOCK; + bool expected_block_password_protected_files_ = false; + bool expected_block_large_files_ = false; + bool expected_block_unsupported_file_types_ = false; +}; + +class ConnectorsManagerBlockLargeFileTest + : public ConnectorsManagerLegacyPoliciesTest< + safe_browsing::BlockLargeFileTransferValues> { + public: + ConnectorsManagerBlockLargeFileTest() { + TestingBrowserProcess::GetGlobal()->local_state()->SetInteger( + prefs::kBlockLargeFileTransfer, tested_policy()); + expected_block_large_files_ = [this]() { + if (tested_policy() == safe_browsing::BLOCK_LARGE_UPLOADS_AND_DOWNLOADS) + return true; + if (tested_policy() == safe_browsing::BLOCK_NONE) + return false; + return upload_scan() + ? tested_policy() == safe_browsing::BLOCK_LARGE_UPLOADS + : tested_policy() == safe_browsing::BLOCK_LARGE_DOWNLOADS; + }(); + } +}; + +TEST_P(ConnectorsManagerBlockLargeFileTest, Test) { + TestPolicy(); +} + +INSTANTIATE_TEST_SUITE_P( + ConnectorsManagerBlockLargeFileTest, + ConnectorsManagerBlockLargeFileTest, + testing::Combine(testing::ValuesIn(kAllAnalysisConnectors), + testing::ValuesIn(kAllBlockLargeFilesPolicyValues))); + +class ConnectorsManagerBlockUnsupportedFileTypesTest + : public ConnectorsManagerLegacyPoliciesTest< + safe_browsing::BlockUnsupportedFiletypesValues> { + public: + ConnectorsManagerBlockUnsupportedFileTypesTest() { + TestingBrowserProcess::GetGlobal()->local_state()->SetInteger( + prefs::kBlockUnsupportedFiletypes, tested_policy()); + expected_block_unsupported_file_types_ = [this]() { + if (tested_policy() == + safe_browsing::BLOCK_UNSUPPORTED_FILETYPES_UPLOADS_AND_DOWNLOADS) + return true; + if (tested_policy() == safe_browsing::BLOCK_UNSUPPORTED_FILETYPES_NONE) + return false; + return upload_scan() + ? tested_policy() == + safe_browsing::BLOCK_UNSUPPORTED_FILETYPES_UPLOADS + : tested_policy() == + safe_browsing::BLOCK_UNSUPPORTED_FILETYPES_DOWNLOADS; + }(); + } +}; + +TEST_P(ConnectorsManagerBlockUnsupportedFileTypesTest, Test) { + TestPolicy(); +} + +INSTANTIATE_TEST_SUITE_P( + ConnectorsManagerBlockUnsupportedFileTypesTest, + ConnectorsManagerBlockUnsupportedFileTypesTest, + testing::Combine(testing::ValuesIn(kAllAnalysisConnectors), + testing::ValuesIn(kAllBlockUnsupportedFileTypesValues))); + +class ConnectorsManagerAllowPasswordProtectedFilesTest + : public ConnectorsManagerLegacyPoliciesTest< + safe_browsing::AllowPasswordProtectedFilesValues> { + public: + ConnectorsManagerAllowPasswordProtectedFilesTest() { + TestingBrowserProcess::GetGlobal()->local_state()->SetInteger( + prefs::kAllowPasswordProtectedFiles, tested_policy()); + expected_block_password_protected_files_ = [this]() { + if (tested_policy() == safe_browsing::ALLOW_UPLOADS_AND_DOWNLOADS) + return false; + if (tested_policy() == safe_browsing::ALLOW_NONE) + return true; + return upload_scan() ? tested_policy() != safe_browsing::ALLOW_UPLOADS + : tested_policy() != safe_browsing::ALLOW_DOWNLOADS; + }(); + } +}; + +TEST_P(ConnectorsManagerAllowPasswordProtectedFilesTest, Test) { + TestPolicy(); +} + +INSTANTIATE_TEST_SUITE_P( + ConnectorsManagerAllowPasswordProtectedFilesTest, + ConnectorsManagerAllowPasswordProtectedFilesTest, + testing::Combine(testing::ValuesIn(kAllAnalysisConnectors), + testing::ValuesIn(kAllAllowEncryptedPolicyValues))); + +class ConnectorsManagerDelayDeliveryUntilVerdictTest + : public ConnectorsManagerLegacyPoliciesTest< + safe_browsing::DelayDeliveryUntilVerdictValues> { + public: + ConnectorsManagerDelayDeliveryUntilVerdictTest() { + TestingBrowserProcess::GetGlobal()->local_state()->SetInteger( + prefs::kDelayDeliveryUntilVerdict, tested_policy()); + expected_block_until_verdict_ = [this]() { + if (tested_policy() == safe_browsing::DELAY_UPLOADS_AND_DOWNLOADS) + return BlockUntilVerdict::BLOCK; + if (tested_policy() == safe_browsing::DELAY_NONE) + return BlockUntilVerdict::NO_BLOCK; + bool delay = + (upload_scan() && tested_policy() == safe_browsing::DELAY_UPLOADS) || + (!upload_scan() && tested_policy() == safe_browsing::DELAY_DOWNLOADS); + return delay ? BlockUntilVerdict::BLOCK : BlockUntilVerdict::NO_BLOCK; + }(); + } +}; + +TEST_P(ConnectorsManagerDelayDeliveryUntilVerdictTest, Test) { + TestPolicy(); +} + +INSTANTIATE_TEST_SUITE_P( + ConnectorsManagerDelayDeliveryUntilVerdictTest, + ConnectorsManagerDelayDeliveryUntilVerdictTest, + testing::Combine(testing::ValuesIn(kAllAnalysisConnectors), + testing::ValuesIn(kAllDelayDeliveryUntilVerdictValues))); + +} // namespace enterprise_connectors
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 adc7301..331cb00c 100644 --- a/chrome/browser/extensions/api/developer_private/developer_private_api.cc +++ b/chrome/browser/extensions/api/developer_private/developer_private_api.cc
@@ -34,7 +34,6 @@ #include "chrome/browser/extensions/extension_commands_global_registry.h" #include "chrome/browser/extensions/extension_service.h" #include "chrome/browser/extensions/extension_tab_util.h" -#include "chrome/browser/extensions/extension_ui_util.h" #include "chrome/browser/extensions/extension_util.h" #include "chrome/browser/extensions/install_verifier.h" #include "chrome/browser/extensions/permissions_updater.h" @@ -81,6 +80,7 @@ #include "extensions/browser/notification_types.h" #include "extensions/browser/path_util.h" #include "extensions/browser/process_manager_factory.h" +#include "extensions/browser/ui_util.h" #include "extensions/browser/warning_service.h" #include "extensions/browser/warning_service_factory.h" #include "extensions/browser/zipfile_installer.h" @@ -211,7 +211,7 @@ ExtensionPrefs* prefs = ExtensionPrefs::Get(context); bool should_do_verification_check = false; for (const scoped_refptr<const Extension>& extension : *extensions) { - if (ui_util::ShouldDisplayInExtensionSettings(extension.get(), context) && + if (ui_util::ShouldDisplayInExtensionSettings(*extension) && prefs->HasDisableReason(extension->id(), disable_reason::DISABLE_NOT_VERIFIED)) { should_do_verification_check = true;
diff --git a/chrome/browser/extensions/api/developer_private/developer_private_api_unittest.cc b/chrome/browser/extensions/api/developer_private/developer_private_api_unittest.cc index b8a8d6de..d6f2776 100644 --- a/chrome/browser/extensions/api/developer_private/developer_private_api_unittest.cc +++ b/chrome/browser/extensions/api/developer_private/developer_private_api_unittest.cc
@@ -1055,8 +1055,6 @@ // Test developerPrivate.deleteExtensionErrors. TEST_F(DeveloperPrivateApiUnitTest, DeveloperPrivateDeleteExtensionErrors) { - FeatureSwitch::ScopedOverride error_console_override( - FeatureSwitch::error_console(), true); profile()->GetPrefs()->SetBoolean(prefs::kExtensionsUIDeveloperMode, true); const Extension* extension = LoadSimpleExtension();
diff --git a/chrome/browser/extensions/api/developer_private/extension_info_generator.cc b/chrome/browser/extensions/api/developer_private/extension_info_generator.cc index ae5cfba..59866f9 100644 --- a/chrome/browser/extensions/api/developer_private/extension_info_generator.cc +++ b/chrome/browser/extensions/api/developer_private/extension_info_generator.cc
@@ -22,7 +22,6 @@ #include "chrome/browser/extensions/api/extension_action/extension_action_api.h" #include "chrome/browser/extensions/error_console/error_console.h" #include "chrome/browser/extensions/extension_service.h" -#include "chrome/browser/extensions/extension_ui_util.h" #include "chrome/browser/extensions/extension_util.h" #include "chrome/browser/extensions/scripting_permissions_modifier.h" #include "chrome/browser/extensions/shared_module_service.h" @@ -41,6 +40,7 @@ #include "extensions/browser/extension_util.h" #include "extensions/browser/image_loader.h" #include "extensions/browser/path_util.h" +#include "extensions/browser/ui_util.h" #include "extensions/browser/warning_service.h" #include "extensions/common/extension_set.h" #include "extensions/common/install_warning.h" @@ -425,7 +425,7 @@ else if ((ext = registry->terminated_extensions().GetByID(id)) != nullptr) state = developer::EXTENSION_STATE_TERMINATED; - if (ext && ui_util::ShouldDisplayInExtensionSettings(ext, browser_context_)) + if (ext && ui_util::ShouldDisplayInExtensionSettings(*ext)) CreateExtensionInfoHelper(*ext, state); if (pending_image_loads_ == 0) { @@ -445,8 +445,7 @@ auto add_to_list = [this](const ExtensionSet& extensions, developer::ExtensionState state) { for (const scoped_refptr<const Extension>& extension : extensions) { - if (ui_util::ShouldDisplayInExtensionSettings(extension.get(), - browser_context_)) { + if (ui_util::ShouldDisplayInExtensionSettings(*extension)) { CreateExtensionInfoHelper(*extension, state); } }
diff --git a/chrome/browser/extensions/api/developer_private/extension_info_generator_unittest.cc b/chrome/browser/extensions/api/developer_private/extension_info_generator_unittest.cc index 85c32a7..c80a16f 100644 --- a/chrome/browser/extensions/api/developer_private/extension_info_generator_unittest.cc +++ b/chrome/browser/extensions/api/developer_private/extension_info_generator_unittest.cc
@@ -35,7 +35,6 @@ #include "extensions/common/constants.h" #include "extensions/common/extension.h" #include "extensions/common/extension_builder.h" -#include "extensions/common/feature_switch.h" #include "extensions/common/permissions/permission_message.h" #include "extensions/common/permissions/permission_set.h" #include "extensions/common/permissions/permissions_data.h" @@ -230,9 +229,6 @@ // Test some of the basic fields. TEST_F(ExtensionInfoGeneratorUnitTest, BasicInfoTest) { - // Enable error console for testing. - FeatureSwitch::ScopedOverride error_console_override( - FeatureSwitch::error_console(), true); profile()->GetPrefs()->SetBoolean(prefs::kExtensionsUIDeveloperMode, true); const char kName[] = "extension name";
diff --git a/chrome/browser/extensions/api/extension_action/browser_action_interactive_test.cc b/chrome/browser/extensions/api/extension_action/browser_action_interactive_test.cc index bb98c6e..fb0db7a 100644 --- a/chrome/browser/extensions/api/extension_action/browser_action_interactive_test.cc +++ b/chrome/browser/extensions/api/extension_action/browser_action_interactive_test.cc
@@ -886,19 +886,13 @@ // Tests that an extension pop-up cannot be navigated to a page // in another extension. -// -// TODO(lukasza): https://crbug.com/1066287: Enable the two tests below after -// fixing ExtensionHost to ensure that NOTIFICATION_EXTENSION_HOST_CREATED fires -// at most once - otherwise the test assertion below would fail in -// TearDownOnMainThread: -// EXPECT_EQ(host_watcher_->created(), host_watcher_->destroyed()); IN_PROC_BROWSER_TEST_F(NavigatingExtensionPopupInteractiveTest, - DISABLED_PageInOtherExtension_Get) { + PageInOtherExtension_Get) { GURL other_extension_url = other_extension().GetResourceURL("other.html"); TestPopupNavigationViaGet(other_extension_url, EXPECTING_NAVIGATION_FAILURE); } IN_PROC_BROWSER_TEST_F(NavigatingExtensionPopupInteractiveTest, - DISABLED_PageInOtherExtension_Post) { + PageInOtherExtension_Post) { GURL other_extension_url = other_extension().GetResourceURL("other.html"); TestPopupNavigationViaPost(other_extension_url, EXPECTING_NAVIGATION_FAILURE); }
diff --git a/chrome/browser/extensions/api/extension_action/extension_action_api_unittest.cc b/chrome/browser/extensions/api/extension_action/extension_action_api_unittest.cc index 2b73a6d..1b8c900b 100644 --- a/chrome/browser/extensions/api/extension_action/extension_action_api_unittest.cc +++ b/chrome/browser/extensions/api/extension_action/extension_action_api_unittest.cc
@@ -13,24 +13,21 @@ namespace extensions { namespace { -enum class TestActionType { - kBrowser, - kPage, -}; - class ExtensionActionAPIUnitTest : public ExtensionServiceTestWithInstall, - public ::testing::WithParamInterface<TestActionType> { + public ::testing::WithParamInterface<ActionInfo::Type> { public: ExtensionActionAPIUnitTest() {} ~ExtensionActionAPIUnitTest() override {} const char* GetManifestKey() { switch (GetParam()) { - case TestActionType::kBrowser: + case ActionInfo::TYPE_BROWSER: return manifest_keys::kBrowserAction; - case TestActionType::kPage: + case ActionInfo::TYPE_PAGE: return manifest_keys::kPageAction; + case ActionInfo::TYPE_ACTION: + return manifest_keys::kAction; } NOTREACHED(); return nullptr; @@ -38,10 +35,12 @@ const ActionInfo* GetActionInfo(const Extension& extension) { switch (GetParam()) { - case TestActionType::kBrowser: + case ActionInfo::TYPE_BROWSER: return ActionInfo::GetBrowserActionInfo(&extension); - case TestActionType::kPage: + case ActionInfo::TYPE_PAGE: return ActionInfo::GetPageActionInfo(&extension); + case ActionInfo::TYPE_ACTION: + return ActionInfo::GetExtensionActionInfo(&extension); } NOTREACHED(); return nullptr; @@ -103,8 +102,9 @@ INSTANTIATE_TEST_SUITE_P(All, ExtensionActionAPIUnitTest, - testing::Values(TestActionType::kBrowser, - TestActionType::kPage)); + testing::Values(ActionInfo::TYPE_BROWSER, + ActionInfo::TYPE_PAGE, + ActionInfo::TYPE_ACTION)); } // namespace } // namespace extensions
diff --git a/chrome/browser/extensions/api/identity/identity_get_auth_token_function.cc b/chrome/browser/extensions/api/identity/identity_get_auth_token_function.cc index 9abf080..8274400 100644 --- a/chrome/browser/extensions/api/identity/identity_get_auth_token_function.cc +++ b/chrome/browser/extensions/api/identity/identity_get_auth_token_function.cc
@@ -573,14 +573,6 @@ void IdentityGetAuthTokenFunction::OnRemoteConsentSuccess( const RemoteConsentResolutionData& resolution_data) { - if (!base::FeatureList::IsEnabled(switches::kOAuthRemoteConsent)) { - // Fallback to the issue advice flow. - // TODO(https://crbug.com/1026237): Remove the fallback after making sure - // that the new flow works correctly. - OnIssueAdviceSuccess(IssueAdviceInfo()); - return; - } - TRACE_EVENT_NESTABLE_ASYNC_INSTANT0("identity", "OnRemoteConsentSuccess", this);
diff --git a/chrome/browser/extensions/api/tabs/tabs_constants.cc b/chrome/browser/extensions/api/tabs/tabs_constants.cc index 04248cab..a2d7cd80 100644 --- a/chrome/browser/extensions/api/tabs/tabs_constants.cc +++ b/chrome/browser/extensions/api/tabs/tabs_constants.cc
@@ -63,9 +63,6 @@ const char kShowStateValueMaximized[] = "maximized"; const char kShowStateValueFullscreen[] = "fullscreen"; const char kShowStateValueLockedFullscreen[] = "locked-fullscreen"; -const char kStatusValueComplete[] = "complete"; -const char kStatusValueLoading[] = "loading"; -const char kStatusValueUnloaded[] = "unloaded"; const char kWindowTypeValueNormal[] = "normal"; const char kWindowTypeValuePopup[] = "popup";
diff --git a/chrome/browser/extensions/api/tabs/tabs_constants.h b/chrome/browser/extensions/api/tabs/tabs_constants.h index cda8bd2..12261d10 100644 --- a/chrome/browser/extensions/api/tabs/tabs_constants.h +++ b/chrome/browser/extensions/api/tabs/tabs_constants.h
@@ -70,9 +70,6 @@ extern const char kShowStateValueMaximized[]; extern const char kShowStateValueFullscreen[]; extern const char kShowStateValueLockedFullscreen[]; -extern const char kStatusValueComplete[]; -extern const char kStatusValueLoading[]; -extern const char kStatusValueUnloaded[]; extern const char kWindowTypeValueNormal[]; extern const char kWindowTypeValuePopup[]; extern const char kWindowTypeValueApp[];
diff --git a/chrome/browser/extensions/error_console/error_console_browsertest.cc b/chrome/browser/extensions/error_console/error_console_browsertest.cc index 6739cce..334b262c 100644 --- a/chrome/browser/extensions/error_console/error_console_browsertest.cc +++ b/chrome/browser/extensions/error_console/error_console_browsertest.cc
@@ -6,7 +6,6 @@ #include <stddef.h> -#include "base/feature_list.h" #include "base/files/file_path.h" #include "base/macros.h" #include "base/run_loop.h" @@ -27,7 +26,6 @@ #include "extensions/common/error_utils.h" #include "extensions/common/extension.h" #include "extensions/common/extension_urls.h" -#include "extensions/common/feature_switch.h" #include "extensions/common/manifest_constants.h" #include "net/test/embedded_test_server/embedded_test_server.h" #include "testing/gtest/include/gtest/gtest.h" @@ -204,16 +202,6 @@ ACTION_NONE }; - void SetUpInProcessBrowserTestFixture() override { - ExtensionBrowserTest::SetUpInProcessBrowserTestFixture(); - - // We need to enable the ErrorConsole FeatureSwitch in order to collect - // errors. This should be enabled on any channel <= Dev, but let's make - // sure (in case a test is running on, e.g., a beta channel). - FeatureSwitch::error_console()->SetOverrideValue( - FeatureSwitch::OVERRIDE_ENABLED); - } - void SetUpOnMainThread() override { ExtensionBrowserTest::SetUpOnMainThread();
diff --git a/chrome/browser/extensions/error_console/error_console_unittest.cc b/chrome/browser/extensions/error_console/error_console_unittest.cc index 05c0de1..577b012e 100644 --- a/chrome/browser/extensions/error_console/error_console_unittest.cc +++ b/chrome/browser/extensions/error_console/error_console_unittest.cc
@@ -24,7 +24,6 @@ #include "extensions/browser/unloaded_extension_reason.h" #include "extensions/common/constants.h" #include "extensions/common/extension_builder.h" -#include "extensions/common/feature_switch.h" #include "extensions/common/features/feature_channel.h" #include "extensions/common/value_builder.h" #include "testing/gtest/include/gtest/gtest.h" @@ -41,10 +40,6 @@ void SetUp() override { testing::Test::SetUp(); - // Errors are only kept if we have the FeatureSwitch and have Developer Mode - // enabled. - FeatureSwitch::error_console()->SetOverrideValue( - FeatureSwitch::OVERRIDE_ENABLED); profile_.reset(new TestingProfile); profile_->GetPrefs()->SetBoolean(prefs::kExtensionsUIDeveloperMode, true); error_console_ = ErrorConsole::Get(profile_.get());
diff --git a/chrome/browser/extensions/extension_tab_util.cc b/chrome/browser/extensions/extension_tab_util.cc index 805b1f3..87986bd 100644 --- a/chrome/browser/extensions/extension_tab_util.cc +++ b/chrome/browser/extensions/extension_tab_util.cc
@@ -389,20 +389,6 @@ return sessions::SessionTabHelper::IdForTab(web_contents).id(); } -std::string ExtensionTabUtil::GetTabStatusText(WebContents* web_contents) { - switch (GetLoadingStatus(web_contents)) { - case api::tabs::TAB_STATUS_UNLOADED: - return tabs_constants::kStatusValueUnloaded; - case api::tabs::TAB_STATUS_LOADING: - return tabs_constants::kStatusValueLoading; - case api::tabs::TAB_STATUS_COMPLETE: - return tabs_constants::kStatusValueComplete; - case api::tabs::TAB_STATUS_NONE: - NOTREACHED(); - } - return std::string(); -} - int ExtensionTabUtil::GetWindowIdOfTab(const WebContents* web_contents) { return sessions::SessionTabHelper::IdForWindowContainingTab(web_contents) .id(); @@ -434,8 +420,7 @@ tab_object->id = std::make_unique<int>(GetTabIdForExtensions(contents)); tab_object->index = tab_index; tab_object->window_id = GetWindowIdOfTab(contents); - tab_object->status = - std::make_unique<std::string>(GetTabStatusText(contents)); + tab_object->status = GetLoadingStatus(contents); tab_object->active = tab_strip && tab_index == tab_strip->active_index(); tab_object->selected = tab_strip && tab_index == tab_strip->active_index(); tab_object->highlighted = tab_strip && tab_strip->IsTabSelected(tab_index); @@ -461,7 +446,7 @@ tab_object->discarded = tab_lifecycle_unit_external && tab_lifecycle_unit_external->IsDiscarded(); DCHECK(!tab_object->discarded || - *tab_object->status == tabs_constants::kStatusValueUnloaded); + tab_object->status == api::tabs::TAB_STATUS_UNLOADED); tab_object->auto_discardable = !tab_lifecycle_unit_external || tab_lifecycle_unit_external->IsAutoDiscardable();
diff --git a/chrome/browser/extensions/extension_ui_util.cc b/chrome/browser/extensions/extension_ui_util.cc index 19c2581..ca0da5b 100644 --- a/chrome/browser/extensions/extension_ui_util.cc +++ b/chrome/browser/extensions/extension_ui_util.cc
@@ -53,11 +53,6 @@ !IsBlockedByPolicy(extension, context); } -bool ShouldDisplayInExtensionSettings(const Extension* extension, - content::BrowserContext* context) { - return extension->ShouldDisplayInExtensionSettings(); -} - base::string16 GetEnabledExtensionNameForUrl(const GURL& url, content::BrowserContext* context) { if (!url.SchemeIs(extensions::kExtensionScheme))
diff --git a/chrome/browser/extensions/extension_ui_util.h b/chrome/browser/extensions/extension_ui_util.h index 1b30f82..1484b8d 100644 --- a/chrome/browser/extensions/extension_ui_util.h +++ b/chrome/browser/extensions/extension_ui_util.h
@@ -37,12 +37,6 @@ bool ShouldDisplayInNewTabPage(const Extension* extension, content::BrowserContext* context); -// Returns true if the extension should be displayed in the extension -// settings page (i.e. chrome://extensions). Checks whether the extension is -// an ephemeral app. -bool ShouldDisplayInExtensionSettings(const Extension* extension, - content::BrowserContext* context); - // If |url| is an extension URL, returns the name of the associated extension, // with whitespace collapsed. Otherwise, returns empty string. |context| is used // to get at the extension registry.
diff --git a/chrome/browser/extensions/installed_loader.cc b/chrome/browser/extensions/installed_loader.cc index 3c2d5f4..276e7fd 100644 --- a/chrome/browser/extensions/installed_loader.cc +++ b/chrome/browser/extensions/installed_loader.cc
@@ -34,6 +34,7 @@ #include "extensions/browser/extension_system.h" #include "extensions/browser/extension_util.h" #include "extensions/browser/management_policy.h" +#include "extensions/browser/ui_util.h" #include "extensions/common/extension.h" #include "extensions/common/extension_l10n_util.h" #include "extensions/common/extension_set.h" @@ -543,7 +544,7 @@ // For incognito and file access, skip anything that doesn't appear in // settings. Also, policy-installed (and unpacked of course, checked above) // extensions are boring. - if (extension->ShouldDisplayInExtensionSettings() && + if (ui_util::ShouldDisplayInExtensionSettings(*extension) && !Manifest::IsPolicyLocation(extension->location())) { if (util::CanBeIncognitoEnabled(extension)) { if (util::IsIncognitoEnabled(extension->id(), profile))
diff --git a/chrome/browser/flag-metadata.json b/chrome/browser/flag-metadata.json index de493fd1..ab26fb4 100644 --- a/chrome/browser/flag-metadata.json +++ b/chrome/browser/flag-metadata.json
@@ -2342,7 +2342,7 @@ { "name": "files-ng", "owners": [ "adanilo", "noel" ], - "expiry_milestone": 86 + "expiry_milestone": 88 }, { "name": "files-unified-media-view",
diff --git a/chrome/browser/flags/android/chrome_feature_list.cc b/chrome/browser/flags/android/chrome_feature_list.cc index ad61373..6bd928f 100644 --- a/chrome/browser/flags/android/chrome_feature_list.cc +++ b/chrome/browser/flags/android/chrome_feature_list.cc
@@ -76,7 +76,6 @@ &device::kWebAuthPhoneSupport, &download::features::kDownloadAutoResumptionNative, &download::features::kUseDownloadOfflineContentProvider, - &features::kAppNotificationStatusMessaging, &features::kClearOldBrowsingData, &features::kDownloadsLocationChange, &features::kGenericSensorExtraClasses,
diff --git a/chrome/browser/flags/android/java/src/org/chromium/chrome/browser/flags/ChromeFeatureList.java b/chrome/browser/flags/android/java/src/org/chromium/chrome/browser/flags/ChromeFeatureList.java index bf6c270..28a836d 100644 --- a/chrome/browser/flags/android/java/src/org/chromium/chrome/browser/flags/ChromeFeatureList.java +++ b/chrome/browser/flags/android/java/src/org/chromium/chrome/browser/flags/ChromeFeatureList.java
@@ -223,7 +223,6 @@ public static final String ANDROID_PAY_INTEGRATION_V2 = "AndroidPayIntegrationV2"; public static final String ANDROID_SEARCH_ENGINE_CHOICE_NOTIFICATION = "AndroidSearchEngineChoiceNotification"; - public static final String APP_NOTIFICATION_STATUS_MESSAGING = "AppNotificationStatusMessaging"; public static final String AUTOFILL_ASSISTANT = "AutofillAssistant"; public static final String AUTOFILL_ASSISTANT_CHROME_ENTRY = "AutofillAssistantChromeEntry"; public static final String AUTOFILL_ASSISTANT_DIRECT_ACTIONS = "AutofillAssistantDirectActions";
diff --git a/chrome/browser/media/feeds/media_feeds.proto b/chrome/browser/media/feeds/media_feeds.proto index 600ce19..7c5d59c7 100644 --- a/chrome/browser/media/feeds/media_feeds.proto +++ b/chrome/browser/media/feeds/media_feeds.proto
@@ -27,6 +27,10 @@ repeated ContentRating rating = 1; }; +message GenreSet { + repeated string genre = 1; +} + // A counter for a type of interaction e.g. how many likes or dislikes. // https://schema.org/InteractionCounter message InteractionCounter {
diff --git a/chrome/browser/media/feeds/media_feeds_fetcher.cc b/chrome/browser/media/feeds/media_feeds_fetcher.cc index 8e1985f..fba813f7 100644 --- a/chrome/browser/media/feeds/media_feeds_fetcher.cc +++ b/chrome/browser/media/feeds/media_feeds_fetcher.cc
@@ -6,6 +6,7 @@ #include "components/schema_org/common/metadata.mojom.h" #include "components/schema_org/extractor.h" +#include "components/schema_org/schema_org_entity_names.h" #include "net/base/net_errors.h" #include "net/http/http_request_headers.h" #include "net/http/http_status_code.h" @@ -16,7 +17,8 @@ MediaFeedsFetcher::MediaFeedsFetcher( scoped_refptr<::network::SharedURLLoaderFactory> url_loader_factory) - : url_loader_factory_(url_loader_factory) {} + : url_loader_factory_(url_loader_factory), + extractor_({schema_org::entity::kCompleteDataFeed}) {} MediaFeedsFetcher::~MediaFeedsFetcher() = default; @@ -107,7 +109,7 @@ // Parse the received data. schema_org::improved::mojom::EntityPtr parsed_entity = - schema_org::Extractor::Extract(*feed_data); + extractor_.Extract(*feed_data); if (!parsed_entity) { std::move(callback).Run(nullptr, Status::kInvalidFeedData);
diff --git a/chrome/browser/media/feeds/media_feeds_fetcher.h b/chrome/browser/media/feeds/media_feeds_fetcher.h index 336d302..5f2618f 100644 --- a/chrome/browser/media/feeds/media_feeds_fetcher.h +++ b/chrome/browser/media/feeds/media_feeds_fetcher.h
@@ -7,6 +7,7 @@ #include "base/threading/thread_checker.h" #include "components/schema_org/common/improved_metadata.mojom.h" +#include "components/schema_org/extractor.h" #include "url/gurl.h" namespace network { @@ -51,6 +52,8 @@ // is pending, and will be reset by |OnURLFetchComplete| or if cancelled. std::unique_ptr<::network::SimpleURLLoader> pending_request_; + schema_org::Extractor extractor_; + base::ThreadChecker thread_checker_; };
diff --git a/chrome/browser/media/feeds/media_feeds_fetcher_unittest.cc b/chrome/browser/media/feeds/media_feeds_fetcher_unittest.cc index b2ae550..fc75eeff 100644 --- a/chrome/browser/media/feeds/media_feeds_fetcher_unittest.cc +++ b/chrome/browser/media/feeds/media_feeds_fetcher_unittest.cc
@@ -12,6 +12,7 @@ #include "base/test/task_environment.h" #include "chrome/test/base/chrome_render_view_host_test_harness.h" #include "components/schema_org/common/metadata.mojom.h" +#include "components/schema_org/schema_org_entity_names.h" #include "content/public/browser/storage_partition.h" #include "services/network/public/cpp/weak_wrapper_shared_url_loader_factory.h" #include "services/network/test/test_url_loader_factory.h" @@ -123,10 +124,7 @@ schema_org::improved::mojom::EntityPtr expected = schema_org::improved::mojom::Entity::New(); - // TODO(sgbowen): Update this to CompleteDataFeed when this new type is added - // to the checked in schema.org file in - // //third_party/schema_org/schema.jsonld. - expected->type = "DataFeed"; + expected->type = schema_org::entity::kCompleteDataFeed; schema_org::improved::mojom::PropertyPtr property = schema_org::improved::mojom::Property::New(); property->name = "name"; @@ -146,8 +144,8 @@ })); WaitForRequest(); - ASSERT_TRUE( - RespondToFetch("{\"@type\":\"DataFeed\",\"name\":\"Media Site\"}")); + ASSERT_TRUE(RespondToFetch( + "{\"@type\":\"CompleteDataFeed\",\"name\":\"Media Site\"}")); EXPECT_EQ(out, expected); } @@ -214,7 +212,7 @@ WaitForRequest(); ASSERT_TRUE(RespondToFetch( - "{\"@type\":\"DataFeed\"\"name\":\"Bad json missing a comma\"}")); + "{\"@type\":\"CompleteDataFeed\"\"name\":\"Bad json missing a comma\"}")); } } // namespace media_feeds
diff --git a/chrome/browser/media/feeds/media_feeds_store.mojom b/chrome/browser/media/feeds/media_feeds_store.mojom index c1021136..9d24cfd 100644 --- a/chrome/browser/media/feeds/media_feeds_store.mojom +++ b/chrome/browser/media/feeds/media_feeds_store.mojom
@@ -201,6 +201,18 @@ mojo_base.mojom.Time? end_time; }; +// The result of checking an item against the Safe Search API. +enum SafeSearchResult { + // We haven't checked this item against the API. + kUnknown, + + // We checked this item and it was classified as safe. + kSafe, + + // We checked this item and it was classified as unsafe (e.g. adult). + kUnsafe, +}; + // The Media Feed Item is an individual item stored in a Media Feed. It // represents a single recommendation such as a video or TV show. // https://wicg.github.io/media-feeds/index.html#media-feed-item @@ -233,7 +245,7 @@ array<ContentRating> content_ratings; // The genre of this feed item. - mojo_base.mojom.String16? genre; + array<string> genre; // The duration of this feed item. mojo_base.mojom.TimeDelta? duration; @@ -258,6 +270,9 @@ // The images for the feed item. array<media_session.mojom.MediaImage> images; + + // The result of safe search checking this media item. + SafeSearchResult safe_search_result; }; // MediaFeedStore allows the Media Feeds WebUI to access data from the Media
diff --git a/chrome/browser/media/history/media_history_feed_items_table.cc b/chrome/browser/media/history/media_history_feed_items_table.cc index ee36cb9..c8241cd9 100644 --- a/chrome/browser/media/history/media_history_feed_items_table.cc +++ b/chrome/browser/media/history/media_history_feed_items_table.cc
@@ -5,6 +5,7 @@ #include "chrome/browser/media/history/media_history_feed_items_table.h" #include "base/metrics/histogram_functions.h" +#include "base/strings/utf_string_conversions.h" #include "base/updateable_sequenced_task_runner.h" #include "chrome/browser/media/feeds/media_feeds.pb.h" #include "chrome/browser/media/feeds/media_feeds_utils.h" @@ -17,7 +18,9 @@ namespace { // The maximum number of images to allow. -const int kMaxImageCount = 5; +constexpr int kMaxImageCount = 5; +// The maximum number of genres to allow. +constexpr int kMaxGenres = 3; media_feeds::InteractionCounter_Type Convert( const media_feeds::mojom::InteractionCounterType& type) { @@ -106,7 +109,9 @@ void FillAction(const media_feeds::mojom::ActionPtr& action, media_feeds::Action* proto) { proto->set_url(action->url.spec()); - proto->set_start_time_secs(action->start_time->InSeconds()); + + if (action->start_time.has_value()) + proto->set_start_time_secs(action->start_time->InSeconds()); } } // namespace @@ -139,7 +144,7 @@ "action BLOB, " "interaction_counters BLOB, " "content_rating BLOB, " - "genre TEXT," + "genre BLOB," "duration_s INTEGER," "is_live INTEGER," "live_start_time_s INTEGER," @@ -150,6 +155,7 @@ "shown_count INTEGER," "clicked INTEGER, " "images BLOB, " + "safe_search_result INTEGER DEFAULT 0, " "CONSTRAINT fk_feed " "FOREIGN KEY (feed_id) " "REFERENCES mediaFeed(id) " @@ -162,6 +168,12 @@ "mediaFeedItem (feed_id)"); } + if (success) { + success = DB()->Execute( + "CREATE INDEX IF NOT EXISTS mediaFeedItem_safe_search_result_index ON " + "mediaFeedItem (safe_search_result)"); + } + if (!success) { ResetDB(); LOG(ERROR) << "Failed to create media history feed items table."; @@ -185,8 +197,8 @@ "action_status, genre, duration_s, is_live, live_start_time_s, " "live_end_time_s, shown_count, clicked, author, action, " "interaction_counters, content_rating, identifiers, tv_episode, " - "play_next_candidate, images) VALUES " - "(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)")); + "play_next_candidate, images, safe_search_result) VALUES " + "(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)")); statement.BindInt64(0, feed_id); statement.BindInt64(1, static_cast<int>(item->type)); @@ -196,8 +208,16 @@ statement.BindBool(4, item->is_family_friendly); statement.BindInt64(5, static_cast<int>(item->action_status)); - if (item->genre.has_value()) { - statement.BindString16(6, *item->genre); + if (!item->genre.empty()) { + media_feeds::GenreSet genres; + + for (auto& entry : item->genre) { + genres.add_genre(entry); + + if (genres.genre_size() >= kMaxGenres) + break; + } + BindProto(statement, 6, genres); } else { statement.BindNull(6); } @@ -329,6 +349,8 @@ statement.BindNull(20); } + statement.BindInt64(21, static_cast<int>(item->safe_search_result)); + return statement.Run(); } @@ -355,7 +377,7 @@ "action_status, genre, duration_s, is_live, live_start_time_s, " "live_end_time_s, shown_count, clicked, author, action, " "interaction_counters, content_rating, identifiers, tv_episode, " - "play_next_candidate, images FROM " + "play_next_candidate, images, safe_search_result FROM " "mediaFeedItem WHERE feed_id = ?")); statement.BindInt64(0, feed_id); @@ -370,6 +392,9 @@ item->action_status = static_cast<media_feeds::mojom::MediaFeedItemActionStatus>( statement.ColumnInt64(4)); + item->safe_search_result = + static_cast<media_feeds::mojom::SafeSearchResult>( + statement.ColumnInt64(20)); if (!IsKnownEnumValue(item->type)) { base::UmaHistogramEnumeration(kFeedItemReadResultHistogramName, @@ -383,6 +408,12 @@ continue; } + if (!IsKnownEnumValue(item->safe_search_result)) { + base::UmaHistogramEnumeration(kFeedItemReadResultHistogramName, + FeedItemReadResult::kBadSafeSearchResult); + continue; + } + if (statement.GetColumnType(12) == sql::ColumnType::kBlob) { media_feeds::Author author; if (!GetProto(statement, 12, author)) { @@ -523,8 +554,23 @@ base::TimeDelta::FromSeconds(statement.ColumnInt64(2))); item->is_family_friendly = statement.ColumnBool(3); - if (statement.GetColumnType(5) == sql::ColumnType::kText) - item->genre = statement.ColumnString16(5); + if (statement.GetColumnType(5) == sql::ColumnType::kBlob) { + media_feeds::GenreSet genre_set; + if (!GetProto(statement, 5, genre_set)) { + base::UmaHistogramEnumeration( + MediaHistoryFeedItemsTable::kFeedItemReadResultHistogramName, + FeedItemReadResult::kBadGenres); + + continue; + } + + for (auto& genre : genre_set.genre()) { + item->genre.push_back(genre); + + if (item->genre.size() >= kMaxGenres) + break; + } + } if (statement.GetColumnType(6) == sql::ColumnType::kInteger) item->duration = base::TimeDelta::FromSeconds(statement.ColumnInt64(6)); @@ -553,4 +599,63 @@ return items; } +MediaHistoryKeyedService::PendingSafeSearchCheckList +MediaHistoryFeedItemsTable::GetPendingSafeSearchCheckItems() { + MediaHistoryKeyedService::PendingSafeSearchCheckList items; + + if (!CanAccessDatabase()) + return items; + + sql::Statement statement( + DB()->GetUniqueStatement("SELECT id, action, play_next_candidate FROM " + "mediaFeedItem WHERE safe_search_result = ?")); + + statement.BindInt64( + 0, static_cast<int>(media_feeds::mojom::SafeSearchResult::kUnknown)); + + DCHECK(statement.is_valid()); + + while (statement.Step()) { + auto check = + std::make_unique<MediaHistoryKeyedService::PendingSafeSearchCheck>( + statement.ColumnInt64(0)); + + if (statement.GetColumnType(1) == sql::ColumnType::kBlob) { + media_feeds::Action action; + if (!GetProto(statement, 1, action)) + continue; + + GURL url(action.url()); + if (url.is_valid()) + check->urls.insert(url); + } + + if (statement.GetColumnType(2) == sql::ColumnType::kBlob) { + media_feeds::PlayNextCandidate play_next_candidate; + if (!GetProto(statement, 2, play_next_candidate)) + continue; + + GURL url(play_next_candidate.action().url()); + if (url.is_valid()) + check->urls.insert(url); + } + + if (!check->urls.empty()) + items.push_back(std::move(check)); + } + + return items; +} + +bool MediaHistoryFeedItemsTable::StoreSafeSearchResult( + int64_t feed_item_id, + media_feeds::mojom::SafeSearchResult result) { + sql::Statement statement(DB()->GetCachedStatement( + SQL_FROM_HERE, + "UPDATE mediaFeedItem SET safe_search_result = ? WHERE id = ?")); + statement.BindInt64(0, static_cast<int>(result)); + statement.BindInt64(1, feed_item_id); + return statement.Run() && DB()->GetLastChangeCount() == 1; +} + } // namespace media_history
diff --git a/chrome/browser/media/history/media_history_feed_items_table.h b/chrome/browser/media/history/media_history_feed_items_table.h index e322c78..f08764a 100644 --- a/chrome/browser/media/history/media_history_feed_items_table.h +++ b/chrome/browser/media/history/media_history_feed_items_table.h
@@ -8,6 +8,7 @@ #include <vector> #include "chrome/browser/media/feeds/media_feeds_store.mojom.h" +#include "chrome/browser/media/history/media_history_keyed_service.h" #include "chrome/browser/media/history/media_history_table_base.h" #include "sql/init_status.h" #include "url/gurl.h" @@ -39,7 +40,9 @@ kBadTVEpisode = 8, kBadPlayNextCandidate = 9, kBadImages = 10, - kMaxValue = kBadImages, + kBadSafeSearchResult = 11, + kBadGenres = 12, + kMaxValue = kBadGenres, }; MediaHistoryFeedItemsTable(const MediaHistoryFeedItemsTable&) = delete; @@ -66,6 +69,15 @@ // Gets all the items associated with |feed_id|. std::vector<media_feeds::mojom::MediaFeedItemPtr> GetItemsForFeed( const int64_t feed_id); + + // Returns all the Media Feed Items that have an unknown safe search result. + MediaHistoryKeyedService::PendingSafeSearchCheckList + GetPendingSafeSearchCheckItems(); + + // Stores the safe search result for |feed_item_id| and returns true if + // successful. + bool StoreSafeSearchResult(int64_t feed_item_id, + media_feeds::mojom::SafeSearchResult result); }; } // namespace media_history
diff --git a/chrome/browser/media/history/media_history_keyed_service.cc b/chrome/browser/media/history/media_history_keyed_service.cc index 54bff3e..6caa266a 100644 --- a/chrome/browser/media/history/media_history_keyed_service.cc +++ b/chrome/browser/media/history/media_history_keyed_service.cc
@@ -9,6 +9,7 @@ #include "base/task/thread_pool.h" #include "chrome/browser/history/history_service_factory.h" #include "chrome/browser/media/history/media_history_keyed_service_factory.h" +#include "chrome/browser/media/history/media_history_store.h" #include "chrome/browser/profiles/profile.h" #include "components/history/core/browser/history_service.h" #include "components/history/core/common/pref_names.h" @@ -230,6 +231,25 @@ store->DiscoverMediaFeed(url); } +MediaHistoryKeyedService::PendingSafeSearchCheck::PendingSafeSearchCheck( + int64_t id) + : id(id) {} + +MediaHistoryKeyedService::PendingSafeSearchCheck::~PendingSafeSearchCheck() = + default; + +void MediaHistoryKeyedService::GetPendingSafeSearchCheckMediaFeedItems( + base::OnceCallback<void(PendingSafeSearchCheckList)> callback) { + store_->GetForRead()->GetPendingSafeSearchCheckMediaFeedItems( + std::move(callback)); +} + +void MediaHistoryKeyedService::StoreMediaFeedItemSafeSearchResults( + std::map<int64_t, media_feeds::mojom::SafeSearchResult> results) { + if (auto* store = store_->GetForWrite()) + store->StoreMediaFeedItemSafeSearchResults(results); +} + void MediaHistoryKeyedService::PostTaskToDBForTest(base::OnceClosure callback) { store_->GetForRead()->PostTaskToDBForTest(std::move(callback)); }
diff --git a/chrome/browser/media/history/media_history_keyed_service.h b/chrome/browser/media/history/media_history_keyed_service.h index 3517b18a..81e525a9 100644 --- a/chrome/browser/media/history/media_history_keyed_service.h +++ b/chrome/browser/media/history/media_history_keyed_service.h
@@ -6,9 +6,12 @@ #define CHROME_BROWSER_MEDIA_HISTORY_MEDIA_HISTORY_KEYED_SERVICE_H_ #include "base/macros.h" -#include "chrome/browser/media/history/media_history_store.h" +#include "chrome/browser/media/feeds/media_feeds_store.mojom.h" +#include "chrome/browser/media/history/media_history_store.mojom.h" #include "components/history/core/browser/history_service_observer.h" #include "components/keyed_service/core/keyed_service.h" +#include "content/public/browser/media_player_watch_time.h" +#include "services/media_session/public/cpp/media_metadata.h" class Profile; @@ -103,6 +106,27 @@ void GetURLsInTableForTest(const std::string& table, base::OnceCallback<void(std::set<GURL>)> callback); + // Represents a Media Feed Item that needs to be checked against Safe Search. + // Contains the ID of the feed item and a set of URLs that should be checked. + struct PendingSafeSearchCheck { + explicit PendingSafeSearchCheck(int64_t id); + ~PendingSafeSearchCheck(); + PendingSafeSearchCheck(const PendingSafeSearchCheck&) = delete; + PendingSafeSearchCheck& operator=(const PendingSafeSearchCheck&) = delete; + + int64_t const id; + std::set<GURL> urls; + }; + using PendingSafeSearchCheckList = + std::vector<std::unique_ptr<PendingSafeSearchCheck>>; + void GetPendingSafeSearchCheckMediaFeedItems( + base::OnceCallback<void(PendingSafeSearchCheckList)> callback); + + // Store the Safe Search check results for multiple Media Feed Items. The + // map key is the ID of the feed item. + void StoreMediaFeedItemSafeSearchResults( + std::map<int64_t, media_feeds::mojom::SafeSearchResult> results); + // Posts an empty task to the database thread. The callback will be called // on the calling thread when the empty task is completed. This can be used // for waiting for database operations in tests.
diff --git a/chrome/browser/media/history/media_history_store.cc b/chrome/browser/media/history/media_history_store.cc index 1b1fa91..5dab686 100644 --- a/chrome/browser/media/history/media_history_store.cc +++ b/chrome/browser/media/history/media_history_store.cc
@@ -106,6 +106,12 @@ std::vector<media_feeds::mojom::MediaFeedItemPtr> GetItemsForMediaFeedForDebug(const int64_t feed_id); + MediaHistoryKeyedService::PendingSafeSearchCheckList + GetPendingSafeSearchCheckMediaFeedItems(); + + void StoreMediaFeedItemSafeSearchResults( + std::map<int64_t, media_feeds::mojom::SafeSearchResult> results); + scoped_refptr<base::UpdateableSequencedTaskRunner> db_task_runner_; const base::FilePath db_path_; std::unique_ptr<sql::Database> db_; @@ -675,6 +681,40 @@ return feed_items_table_->GetItemsForFeed(feed_id); } +MediaHistoryKeyedService::PendingSafeSearchCheckList +MediaHistoryStoreInternal::GetPendingSafeSearchCheckMediaFeedItems() { + DCHECK(db_task_runner_->RunsTasksInCurrentSequence()); + + if (!initialization_successful_ || !feed_items_table_) + return MediaHistoryKeyedService::PendingSafeSearchCheckList(); + + return feed_items_table_->GetPendingSafeSearchCheckItems(); +} + +void MediaHistoryStoreInternal::StoreMediaFeedItemSafeSearchResults( + std::map<int64_t, media_feeds::mojom::SafeSearchResult> results) { + DCHECK(db_task_runner_->RunsTasksInCurrentSequence()); + if (!initialization_successful_) + return; + + if (!DB()->BeginTransaction()) { + LOG(ERROR) << "Failed to begin the transaction."; + return; + } + + if (!feed_items_table_) + return; + + for (auto& entry : results) { + if (!feed_items_table_->StoreSafeSearchResult(entry.first, entry.second)) { + DB()->RollbackTransaction(); + return; + } + } + + DB()->CommitTransaction(); +} + const char MediaHistoryStore::kInitResultHistogramName[] = "Media.History.Init.Result"; @@ -705,6 +745,34 @@ watch_time)); } +void MediaHistoryStore::GetPendingSafeSearchCheckMediaFeedItems( + base::OnceCallback< + void(MediaHistoryKeyedService::PendingSafeSearchCheckList)> callback) { + if (!db_->initialization_successful_) { + return std::move(callback).Run( + MediaHistoryKeyedService::PendingSafeSearchCheckList()); + } + + base::PostTaskAndReplyWithResult( + db_->db_task_runner_.get(), FROM_HERE, + base::BindOnce( + &MediaHistoryStoreInternal::GetPendingSafeSearchCheckMediaFeedItems, + db_), + std::move(callback)); +} + +void MediaHistoryStore::StoreMediaFeedItemSafeSearchResults( + std::map<int64_t, media_feeds::mojom::SafeSearchResult> results) { + if (!db_->initialization_successful_) + return; + + db_->db_task_runner_->PostTask( + FROM_HERE, + base::BindOnce( + &MediaHistoryStoreInternal::StoreMediaFeedItemSafeSearchResults, db_, + results)); +} + scoped_refptr<base::UpdateableSequencedTaskRunner> MediaHistoryStore::GetDBTaskRunnerForTest() { return db_->db_task_runner_;
diff --git a/chrome/browser/media/history/media_history_store.h b/chrome/browser/media/history/media_history_store.h index f2b16af..d46545c 100644 --- a/chrome/browser/media/history/media_history_store.h +++ b/chrome/browser/media/history/media_history_store.h
@@ -15,6 +15,7 @@ #include "base/optional.h" #include "base/updateable_sequenced_task_runner.h" #include "chrome/browser/media/feeds/media_feeds_store.mojom.h" +#include "chrome/browser/media/history/media_history_keyed_service.h" #include "chrome/browser/media/history/media_history_origin_table.h" #include "chrome/browser/media/history/media_history_playback_table.h" #include "chrome/browser/media/history/media_history_store.mojom.h" @@ -156,6 +157,13 @@ base::OnceCallback< void(std::vector<media_feeds::mojom::MediaFeedItemPtr>)> callback); + void GetPendingSafeSearchCheckMediaFeedItems( + base::OnceCallback< + void(MediaHistoryKeyedService::PendingSafeSearchCheckList)> callback); + + void StoreMediaFeedItemSafeSearchResults( + std::map<int64_t, media_feeds::mojom::SafeSearchResult> results); + scoped_refptr<base::UpdateableSequencedTaskRunner> GetDBTaskRunnerForTest(); void GetURLsInTableForTest(const std::string& table,
diff --git a/chrome/browser/media/history/media_history_store_unittest.cc b/chrome/browser/media/history/media_history_store_unittest.cc index 6fd5c8f..75f8bfa 100644 --- a/chrome/browser/media/history/media_history_store_unittest.cc +++ b/chrome/browser/media/history/media_history_store_unittest.cc
@@ -599,6 +599,22 @@ return out; } + MediaHistoryKeyedService::PendingSafeSearchCheckList + GetPendingSafeSearchCheckMediaFeedItemsSync( + MediaHistoryKeyedService* service) { + base::RunLoop run_loop; + MediaHistoryKeyedService::PendingSafeSearchCheckList out; + + service->GetPendingSafeSearchCheckMediaFeedItems(base::BindLambdaForTesting( + [&](MediaHistoryKeyedService::PendingSafeSearchCheckList rows) { + out = std::move(rows); + run_loop.Quit(); + })); + + run_loop.Run(); + return out; + } + static media_feeds::mojom::ContentRatingPtr CreateRating( const std::string& agency, const std::string& value) { @@ -629,7 +645,7 @@ item->is_family_friendly = true; item->action_status = media_feeds::mojom::MediaFeedItemActionStatus::kPotential; - item->genre = base::ASCIIToUTF16("test"); + item->genre.push_back("test"); item->duration = base::TimeDelta::FromSeconds(30); item->live = media_feeds::mojom::LiveDetails::New(); item->live->start_time = base::Time::FromDeltaSinceWindowsEpoch( @@ -640,10 +656,10 @@ item->clicked = true; item->author = media_feeds::mojom::Author::New(); item->author->name = "Media Site"; - item->author->url = GURL("https://www.example.com"); + item->author->url = GURL("https://www.example.com/author"); item->action = media_feeds::mojom::Action::New(); item->action->start_time = base::TimeDelta::FromSeconds(3); - item->action->url = GURL("https://www.example.com"); + item->action->url = GURL("https://www.example.com/action"); item->interaction_counters.emplace( media_feeds::mojom::InteractionCounterType::kLike, 10000); item->interaction_counters.emplace( @@ -670,9 +686,11 @@ item->play_next_candidate->action = media_feeds::mojom::Action::New(); item->play_next_candidate->action->start_time = base::TimeDelta::FromSeconds(3); - item->play_next_candidate->action->url = GURL("https://www.example.com"); + item->play_next_candidate->action->url = + GURL("https://www.example.com/next"); item->play_next_candidate->identifiers.push_back(CreateIdentifier( media_feeds::mojom::Identifier::Type::kTMSId, "TEST4")); + item->safe_search_result = media_feeds::mojom::SafeSearchResult::kUnknown; { media_session::MediaImage image; @@ -696,8 +714,11 @@ item->name = base::ASCIIToUTF16("The TV Series"); item->action_status = media_feeds::mojom::MediaFeedItemActionStatus::kActive; + item->action = media_feeds::mojom::Action::New(); + item->action->url = GURL("https://www.example.com/action2"); item->author = media_feeds::mojom::Author::New(); item->author->name = "Media Site"; + item->safe_search_result = media_feeds::mojom::SafeSearchResult::kSafe; items.push_back(std::move(item)); } @@ -708,6 +729,7 @@ item->action_status = media_feeds::mojom::MediaFeedItemActionStatus::kPotential; item->live = media_feeds::mojom::LiveDetails::New(); + item->safe_search_result = media_feeds::mojom::SafeSearchResult::kUnsafe; items.push_back(std::move(item)); } @@ -727,6 +749,9 @@ item->is_family_friendly = false; item->action_status = media_feeds::mojom::MediaFeedItemActionStatus::kActive; + item->action = media_feeds::mojom::Action::New(); + item->action->url = GURL("https://www.example.com/action-alt"); + item->safe_search_result = media_feeds::mojom::SafeSearchResult::kUnknown; items.push_back(std::move(item)); } @@ -1329,6 +1354,7 @@ auto item = media_feeds::mojom::MediaFeedItem::New(); item->name = base::ASCIIToUTF16("The Movie"); item->type = media_feeds::mojom::MediaFeedItemType::kMovie; + item->safe_search_result = media_feeds::mojom::SafeSearchResult::kUnknown; { media_session::MediaImage image; @@ -1389,4 +1415,104 @@ } } +TEST_P(MediaHistoryStoreFeedsTest, + StoreMediaFeedFetchResult_DefaultSafeSearchResult) { + service()->DiscoverMediaFeed(GURL("https://www.google.com/feed")); + WaitForDB(); + + // If we are read only we should use -1 as a placeholder feed id because the + // feed will not have been stored. This is so we can run the rest of the test + // to ensure a no-op. + const int feed_id = IsReadOnly() ? -1 : GetMediaFeedsSync(service())[0]->id; + + auto item = media_feeds::mojom::MediaFeedItem::New(); + item->name = base::ASCIIToUTF16("The Movie"); + item->type = media_feeds::mojom::MediaFeedItemType::kMovie; + + std::vector<media_feeds::mojom::MediaFeedItemPtr> items; + items.push_back(std::move(item)); + + service()->StoreMediaFeedFetchResult( + feed_id, std::move(items), media_feeds::mojom::FetchResult::kSuccess, + base::Time::Now(), GetExpectedLogos(), kExpectedDisplayName); + WaitForDB(); + + { + // The item should set a default safe search result. + auto items = GetItemsForMediaFeedSync(service(), feed_id); + + if (IsReadOnly()) { + EXPECT_TRUE(items.empty()); + } else { + EXPECT_EQ(media_feeds::mojom::SafeSearchResult::kUnknown, + items[0]->safe_search_result); + } + + // The OTR service should have the same data. + EXPECT_EQ(items, GetItemsForMediaFeedSync(otr_service(), feed_id)); + } +} + +TEST_P(MediaHistoryStoreFeedsTest, SafeSearchCheck) { + service()->DiscoverMediaFeed(GURL("https://www.google.com/feed")); + service()->DiscoverMediaFeed(GURL("https://www.google.co.uk/feed")); + WaitForDB(); + + // If we are read only we should use -1 as a placeholder feed id because the + // feed will not have been stored. This is so we can run the rest of the test + // to ensure a no-op. + const int feed_id_a = IsReadOnly() ? -1 : GetMediaFeedsSync(service())[0]->id; + const int feed_id_b = IsReadOnly() ? -1 : GetMediaFeedsSync(service())[1]->id; + + service()->StoreMediaFeedFetchResult( + feed_id_a, GetExpectedItems(), media_feeds::mojom::FetchResult::kSuccess, + base::Time::Now(), std::vector<media_session::MediaImage>(), + std::string()); + WaitForDB(); + + service()->StoreMediaFeedFetchResult( + feed_id_b, GetAltExpectedItems(), + media_feeds::mojom::FetchResult::kSuccess, base::Time::Now(), + std::vector<media_session::MediaImage>(), std::string()); + WaitForDB(); + + std::map<int64_t, media_feeds::mojom::SafeSearchResult> found_ids; + + { + // Media items from all feeds should be in the pending items list. + auto pending_items = GetPendingSafeSearchCheckMediaFeedItemsSync(service()); + + if (IsReadOnly()) { + EXPECT_TRUE(pending_items.empty()); + } else { + EXPECT_EQ(2u, pending_items.size()); + + std::set<GURL> found_urls; + for (auto& item : pending_items) { + EXPECT_NE(0, item->id); + found_ids.emplace(item->id, + media_feeds::mojom::SafeSearchResult::kSafe); + + for (auto& url : item->urls) { + found_urls.insert(url); + } + } + + std::set<GURL> expected_urls; + expected_urls.insert(GURL("https://www.example.com/action")); + expected_urls.insert(GURL("https://www.example.com/next")); + expected_urls.insert(GURL("https://www.example.com/action-alt")); + EXPECT_EQ(expected_urls, found_urls); + } + } + + service()->StoreMediaFeedItemSafeSearchResults(found_ids); + WaitForDB(); + + { + // The pending item list should be empty. + EXPECT_TRUE(GetPendingSafeSearchCheckMediaFeedItemsSync(service()).empty()); + } +} + } // namespace media_history
diff --git a/chrome/browser/password_manager/chrome_password_manager_client.cc b/chrome/browser/password_manager/chrome_password_manager_client.cc index a60602d..14a6e10 100644 --- a/chrome/browser/password_manager/chrome_password_manager_client.cc +++ b/chrome/browser/password_manager/chrome_password_manager_client.cc
@@ -633,7 +633,8 @@ void ChromePasswordManagerClient::CheckProtectedPasswordEntry( PasswordType password_type, const std::string& username, - const std::vector<std::string>& matching_domains, + const std::vector<password_manager::MatchingReusedCredential>& + matching_reused_credentials, bool password_field_exists) { safe_browsing::PasswordProtectionService* pps = GetPasswordProtectionService(); @@ -642,7 +643,7 @@ pps->MaybeStartProtectedPasswordEntryRequest( web_contents(), web_contents()->GetLastCommittedURL(), username, - password_type, matching_domains, password_field_exists); + password_type, matching_reused_credentials, password_field_exists); } #endif // defined(SYNC_PASSWORD_REUSE_DETECTION_ENABLED)
diff --git a/chrome/browser/password_manager/chrome_password_manager_client.h b/chrome/browser/password_manager/chrome_password_manager_client.h index 85cf7e8..5281640 100644 --- a/chrome/browser/password_manager/chrome_password_manager_client.h +++ b/chrome/browser/password_manager/chrome_password_manager_client.h
@@ -30,6 +30,7 @@ #include "components/password_manager/core/browser/password_manager_metrics_util.h" #include "components/password_manager/core/browser/password_manager_onboarding.h" #include "components/password_manager/core/browser/password_reuse_detection_manager.h" +#include "components/password_manager/core/browser/password_reuse_detector.h" #include "components/password_manager/core/browser/sync_credentials_filter.h" #include "components/prefs/pref_member.h" #include "components/safe_browsing/buildflags.h" @@ -210,7 +211,8 @@ void CheckProtectedPasswordEntry( password_manager::metrics_util::PasswordType reused_password_type, const std::string& username, - const std::vector<std::string>& matching_domains, + const std::vector<password_manager::MatchingReusedCredential>& + matching_reused_credentials, bool password_field_exists) override; #endif
diff --git a/chrome/browser/password_manager/chrome_password_manager_client_unittest.cc b/chrome/browser/password_manager/chrome_password_manager_client_unittest.cc index 67397ab..6ae6808f 100644 --- a/chrome/browser/password_manager/chrome_password_manager_client_unittest.cc +++ b/chrome/browser/password_manager/chrome_password_manager_client_unittest.cc
@@ -727,18 +727,21 @@ *client->password_protection_service(), MaybeStartProtectedPasswordEntryRequest(_, _, "username", _, _, true)) .Times(4); + std::vector<password_manager::MatchingReusedCredential> credentials = { + {"saved_domain.com", base::ASCIIToUTF16("username")}}; + client->CheckProtectedPasswordEntry( password_manager::metrics_util::PasswordType::SAVED_PASSWORD, "username", - std::vector<std::string>({"saved_domain.com"}), true); + credentials, true); client->CheckProtectedPasswordEntry( password_manager::metrics_util::PasswordType::PRIMARY_ACCOUNT_PASSWORD, - "username", std::vector<std::string>({"saved_domain.com"}), true); + "username", credentials, true); client->CheckProtectedPasswordEntry( password_manager::metrics_util::PasswordType::OTHER_GAIA_PASSWORD, - "username", std::vector<std::string>({"saved_domain.com"}), true); + "username", credentials, true); client->CheckProtectedPasswordEntry( password_manager::metrics_util::PasswordType::ENTERPRISE_PASSWORD, - "username", std::vector<std::string>({"saved_domain.com"}), true); + "username", credentials, true); } TEST_F(ChromePasswordManagerClientTest, VerifyLogPasswordReuseDetectedEvent) {
diff --git a/chrome/browser/permissions/permission_request_manager_browsertest.cc b/chrome/browser/permissions/permission_request_manager_browsertest.cc index 91fe557..65b26c8 100644 --- a/chrome/browser/permissions/permission_request_manager_browsertest.cc +++ b/chrome/browser/permissions/permission_request_manager_browsertest.cc
@@ -218,8 +218,8 @@ auto cleanup = [] {}; // Leave cleanup to test harness destructor. owned_requests_.push_back( std::make_unique<permissions::PermissionRequestImpl>( - GetUrl(), permission, user_gesture, base::Bind(decided), - base::Bind(cleanup))); + GetUrl(), GetUrl(), permission, user_gesture, base::BindOnce(decided), + base::BindOnce(cleanup))); return owned_requests_.back().get(); }
diff --git a/chrome/browser/policy/configuration_policy_handler_list_factory.cc b/chrome/browser/policy/configuration_policy_handler_list_factory.cc index 8dd8e61..b3fb8cf 100644 --- a/chrome/browser/policy/configuration_policy_handler_list_factory.cc +++ b/chrome/browser/policy/configuration_policy_handler_list_factory.cc
@@ -70,6 +70,7 @@ #include "components/policy/core/common/policy_pref_names.h" #include "components/policy/core/common/schema.h" #include "components/policy/policy_constants.h" +#include "components/safe_browsing/core/common/safe_browsing_policy_handler.h" #include "components/safe_browsing/core/common/safe_browsing_prefs.h" #include "components/search_engines/default_search_policy_handler.h" #include "components/security_state/core/security_state_pref_names.h" @@ -176,9 +177,6 @@ { key::kSafeBrowsingEnabled, prefs::kSafeBrowsingEnabled, base::Value::Type::BOOLEAN }, - { key::kSafeBrowsingEnhancedProtection, - prefs::kSafeBrowsingEnhanced, - base::Value::Type::BOOLEAN }, { key::kSafeBrowsingForTrustedSourcesEnabled, prefs::kSafeBrowsingForTrustedSourcesEnabled, base::Value::Type::BOOLEAN }, @@ -1360,6 +1358,8 @@ handlers->AddHandler(std::make_unique<JavascriptPolicyHandler>()); handlers->AddHandler(std::make_unique<NetworkPredictionPolicyHandler>()); handlers->AddHandler(std::make_unique<RestoreOnStartupPolicyHandler>()); + handlers->AddHandler( + std::make_unique<safe_browsing::SafeBrowsingPolicyHandler>()); handlers->AddHandler(std::make_unique<syncer::SyncPolicyHandler>()); handlers->AddHandler(std::make_unique<StringMappingListPolicyHandler>( key::kEnableDeprecatedWebPlatformFeatures,
diff --git a/chrome/browser/profiles/gaia_info_update_service.cc b/chrome/browser/profiles/gaia_info_update_service.cc index 4616e03..95a38fc3 100644 --- a/chrome/browser/profiles/gaia_info_update_service.cc +++ b/chrome/browser/profiles/gaia_info_update_service.cc
@@ -22,6 +22,7 @@ #include "components/signin/public/base/avatar_icon_util.h" #include "components/signin/public/base/signin_pref_names.h" #include "components/signin/public/identity_manager/account_info.h" +#include "components/signin/public/identity_manager/accounts_in_cookie_jar_info.h" #include "components/signin/public/identity_manager/consent_level.h" #include "content/public/browser/notification_details.h" #include "content/public/browser/storage_partition.h" @@ -43,7 +44,7 @@ profile_prefs_(profile_prefs) { identity_manager_->AddObserver(this); - if (!ShouldUpdate()) { + if (!ShouldUpdatePrimaryAccount()) { ClearProfileEntry(); return; } @@ -58,8 +59,8 @@ GAIAInfoUpdateService::~GAIAInfoUpdateService() = default; -void GAIAInfoUpdateService::Update() { - if (!ShouldUpdate()) +void GAIAInfoUpdateService::UpdatePrimaryAccount() { + if (!ShouldUpdatePrimaryAccount()) return; auto unconsented_primary_account_info = @@ -77,10 +78,10 @@ ->FindExtendedAccountInfoForAccountWithRefreshTokenByAccountId( unconsented_primary_account_info.account_id); if (maybe_account_info.has_value()) - Update(maybe_account_info.value()); + UpdatePrimaryAccount(maybe_account_info.value()); } -void GAIAInfoUpdateService::Update(const AccountInfo& info) { +void GAIAInfoUpdateService::UpdatePrimaryAccount(const AccountInfo& info) { if (!info.IsValid()) return; @@ -93,6 +94,7 @@ entry->SetGAIAGivenName(base::UTF8ToUTF16(info.given_name)); entry->SetGAIAName(base::UTF8ToUTF16(info.full_name)); + entry->SetHostedDomain(info.hosted_domain); const base::string16 hosted_domain = base::UTF8ToUTF16(info.hosted_domain); profile_prefs_->SetString(prefs::kGoogleServicesHostedDomain, base::UTF16ToUTF8(hosted_domain)); @@ -115,6 +117,24 @@ return true; } +void GAIAInfoUpdateService::UpdateAnyAccount(const AccountInfo& info) { + if (!info.IsValid()) + return; + + ProfileAttributesEntry* entry; + if (!profile_attributes_storage_->GetProfileAttributesWithPath(profile_path_, + &entry)) { + return; + } + + // These are idempotent, i.e. the second and any further call for the same + // account info has no further impact. + entry->AddAccountName(info.full_name); + entry->AddAccountCategory(info.hosted_domain == kNoHostedDomainFound + ? AccountCategory::kConsumer + : AccountCategory::kEnterprise); +} + void GAIAInfoUpdateService::ClearProfileEntry() { ProfileAttributesEntry* entry; if (!profile_attributes_storage_->GetProfileAttributesWithPath(profile_path_, @@ -125,6 +145,7 @@ entry->SetGAIAName(base::string16()); entry->SetGAIAGivenName(base::string16()); entry->SetGAIAPicture(std::string(), gfx::Image()); + entry->SetHostedDomain(std::string()); // Unset the cached URL. profile_prefs_->ClearPref(prefs::kGoogleServicesHostedDomain); } @@ -138,13 +159,15 @@ if (unconsented_primary_account_info.gaia.empty()) { ClearProfileEntry(); } else { - Update(); + UpdatePrimaryAccount(); } } void GAIAInfoUpdateService::OnExtendedAccountInfoUpdated( const AccountInfo& info) { - if (!ShouldUpdate()) + UpdateAnyAccount(info); + + if (!ShouldUpdatePrimaryAccount()) return; CoreAccountInfo account_info = identity_manager_->GetPrimaryAccountInfo( @@ -153,10 +176,41 @@ if (info.account_id != account_info.account_id) return; - Update(info); + UpdatePrimaryAccount(info); } -bool GAIAInfoUpdateService::ShouldUpdate() { +void GAIAInfoUpdateService::OnAccountsInCookieUpdated( + const signin::AccountsInCookieJarInfo& accounts_in_cookie_jar_info, + const GoogleServiceAuthError& error) { + ProfileAttributesEntry* entry; + if (!profile_attributes_storage_->GetProfileAttributesWithPath(profile_path_, + &entry)) { + return; + } + + // We can fully regenerate the info about all accounts only when there are no + // signed-out accounts. This means that for instance clearing cookies will + // reset the info. + if (accounts_in_cookie_jar_info.signed_out_accounts.empty()) { + entry->ClearAccountNames(); + entry->ClearAccountCategories(); + + // Regenerate based on the info from signed-in accounts (if not available + // now, it will be regenerated soon via OnExtendedAccountInfoUpdated() once + // downloaded). + for (gaia::ListedAccount account : + accounts_in_cookie_jar_info.signed_in_accounts) { + auto maybe_account_info = + identity_manager_ + ->FindExtendedAccountInfoForAccountWithRefreshTokenByAccountId( + account.id); + if (maybe_account_info.has_value()) + UpdateAnyAccount(*maybe_account_info); + } + } +} + +bool GAIAInfoUpdateService::ShouldUpdatePrimaryAccount() { return identity_manager_->HasPrimaryAccount( signin::ConsentLevel::kNotRequired); }
diff --git a/chrome/browser/profiles/gaia_info_update_service.h b/chrome/browser/profiles/gaia_info_update_service.h index 3b632be3..089bfb38f 100644 --- a/chrome/browser/profiles/gaia_info_update_service.h +++ b/chrome/browser/profiles/gaia_info_update_service.h
@@ -32,7 +32,7 @@ ~GAIAInfoUpdateService() override; // Updates the GAIA info for the profile associated with this instance. - virtual void Update(); + virtual void UpdatePrimaryAccount(); // Checks if downloading GAIA info for the given profile is allowed. static bool ShouldUseGAIAProfileInfo(Profile* profile); @@ -41,16 +41,19 @@ void Shutdown() override; private: - FRIEND_TEST_ALL_PREFIXES(GAIAInfoUpdateServiceTest, ScheduleUpdate); - void ClearProfileEntry(); - bool ShouldUpdate(); - void Update(const AccountInfo& info); + bool ShouldUpdatePrimaryAccount(); + void UpdatePrimaryAccount(const AccountInfo& info); + + void UpdateAnyAccount(const AccountInfo& info); // Overridden from signin::IdentityManager::Observer: void OnUnconsentedPrimaryAccountChanged( const CoreAccountInfo& unconsented_primary_account_info) override; void OnExtendedAccountInfoUpdated(const AccountInfo& info) override; + void OnAccountsInCookieUpdated( + const signin::AccountsInCookieJarInfo& accounts_in_cookie_jar_info, + const GoogleServiceAuthError& error) override; signin::IdentityManager* identity_manager_; ProfileAttributesStorage* profile_attributes_storage_;
diff --git a/chrome/browser/profiles/profile_activity_metrics_recorder.cc b/chrome/browser/profiles/profile_activity_metrics_recorder.cc index cb11903..a0c8111 100644 --- a/chrome/browser/profiles/profile_activity_metrics_recorder.cc +++ b/chrome/browser/profiles/profile_activity_metrics_recorder.cc
@@ -87,6 +87,20 @@ .RecordProfilesState(); } +void RecordAccountMetrics(Profile* profile) { + DCHECK(profile); + + ProfileAttributesEntry* entry; + if (!g_browser_process->profile_manager() + ->GetProfileAttributesStorage() + .GetProfileAttributesWithPath(profile->GetPath(), &entry)) { + // This can happen if the profile is deleted. + return; + } + + entry->RecordAccountMetrics(); +} + } // namespace // static @@ -106,6 +120,7 @@ Profile* active_profile = browser->profile()->GetOriginalProfile(); RecordBrowserActivation(active_profile); + RecordAccountMetrics(active_profile); if (last_active_profile_ != active_profile) { // No-op, if starting a new session (|last_active_profile_| is nullptr).
diff --git a/chrome/browser/profiles/profile_attributes_entry.cc b/chrome/browser/profiles/profile_attributes_entry.cc index ce5d221..467a32df 100644 --- a/chrome/browser/profiles/profile_attributes_entry.cc +++ b/chrome/browser/profiles/profile_attributes_entry.cc
@@ -4,6 +4,8 @@ #include <utility> +#include "base/hash/hash.h" +#include "base/optional.h" #include "base/strings/utf_string_conversions.h" #include "build/build_config.h" #include "chrome/browser/browser_process.h" @@ -13,9 +15,12 @@ #include "chrome/browser/signin/signin_util.h" #include "chrome/browser/ui/ui_features.h" #include "chrome/common/pref_names.h" +#include "components/policy/core/browser/browser_policy_connector.h" #include "components/prefs/pref_registry_simple.h" #include "components/prefs/pref_service.h" #include "components/prefs/scoped_user_pref_update.h" +#include "components/profile_metrics/state.h" +#include "components/signin/public/identity_manager/account_info.h" #include "ui/base/resource/resource_bundle.h" #if BUILDFLAG(ENABLE_SUPERVISED_USERS) @@ -33,10 +38,27 @@ const char kIsAuthErrorKey[] = "is_auth_error"; const char kMetricsBucketIndex[] = "metrics_bucket_index"; const char kSigninRequiredKey[] = "signin_required"; +const char kHostedDomain[] = "hosted_domain"; + +// Low-entropy accounts info, for metrics only. +const char kFirstAccountNameHash[] = "first_account_name_hash"; +const char kHasMultipleAccountNames[] = "has_multiple_account_names"; +const char kAccountCategories[] = "account_categories"; // Local state pref to keep track of the next available profile bucket. const char kNextMetricsBucketIndex[] = "profile.metrics.next_bucket_index"; +constexpr int kIntegerNotSet = -1; + +// Persisted in prefs. +constexpr int kAccountCategoriesConsumerOnly = 0; +constexpr int kAccountCategoriesEnterpriseOnly = 1; +constexpr int kAccountCategoriesBoth = 2; + +// Number of distinct low-entropy hash values. Changing this value invalidates +// existing persisted hashes. +constexpr int kNumberOfLowEntropyHashValues = 1024; + // Returns the next available metrics bucket index and increases the index // counter. I.e. two consecutive calls will return two consecutive numbers. int NextAvailableMetricsBucketIndex() { @@ -49,6 +71,10 @@ return next_index; } +int GetLowEntropyHashValue(const std::string& value) { + return base::PersistentHash(value) % kNumberOfLowEntropyHashValues; +} + } // namespace const char ProfileAttributesEntry::kSupervisedUserId[] = "managed_user_id"; @@ -361,13 +387,17 @@ size_t ProfileAttributesEntry::GetMetricsBucketIndex() { int bucket_index = GetInteger(kMetricsBucketIndex); - if (bucket_index == -1) { + if (bucket_index == kIntegerNotSet) { bucket_index = NextAvailableMetricsBucketIndex(); SetInteger(kMetricsBucketIndex, bucket_index); } return bucket_index; } +std::string ProfileAttributesEntry::GetHostedDomain() const { + return GetString(kHostedDomain); +} + void ProfileAttributesEntry::SetLocalProfileName(const base::string16& name) { if (SetString16(kNameKey, name)) profile_info_cache_->NotifyIfProfileNamesHaveChanged(); @@ -447,6 +477,11 @@ profile_info_cache_->NotifyIsSigninRequiredChanged(GetPath()); } +void ProfileAttributesEntry::RecordAccountMetrics() const { + RecordAccountCategoriesMetric(); + RecordAccountNamesMetric(); +} + void ProfileAttributesEntry::SetIsEphemeral(bool value) { SetBool(kProfileIsEphemeral, value); } @@ -493,6 +528,10 @@ profile_info_cache_->NotifyOnProfileAvatarChanged(profile_path); } +void ProfileAttributesEntry::SetHostedDomain(std::string hosted_domain) { + SetString(kHostedDomain, hosted_domain); +} + void ProfileAttributesEntry::SetAuthInfo(const std::string& gaia_id, const base::string16& user_name, bool is_consented_primary_account) { @@ -515,6 +554,43 @@ profile_info_cache_->NotifyProfileAuthInfoChanged(profile_path_); } +void ProfileAttributesEntry::AddAccountName(const std::string& name) { + int hash = GetLowEntropyHashValue(name); + int first_hash = GetInteger(kFirstAccountNameHash); + if (first_hash == kIntegerNotSet) { + SetInteger(kFirstAccountNameHash, hash); + return; + } + + if (first_hash != hash) { + SetBool(kHasMultipleAccountNames, true); + } +} + +void ProfileAttributesEntry::AddAccountCategory(AccountCategory category) { + int current_categories = GetInteger(kAccountCategories); + if (current_categories == kAccountCategoriesBoth) + return; + + int new_category = category == AccountCategory::kConsumer + ? kAccountCategoriesConsumerOnly + : kAccountCategoriesEnterpriseOnly; + if (current_categories == kIntegerNotSet) { + SetInteger(kAccountCategories, new_category); + } else if (current_categories != new_category) { + SetInteger(kAccountCategories, kAccountCategoriesBoth); + } +} + +void ProfileAttributesEntry::ClearAccountNames() { + ClearValue(kFirstAccountNameHash); + ClearValue(kHasMultipleAccountNames); +} + +void ProfileAttributesEntry::ClearAccountCategories() { + ClearValue(kAccountCategories); +} + size_t ProfileAttributesEntry::profile_index() const { size_t index = profile_info_cache_->GetIndexOfProfileWithPath(profile_path_); DCHECK(index < profile_info_cache_->GetNumberOfProfiles()); @@ -539,6 +615,49 @@ image_path); } +bool ProfileAttributesEntry::HasMultipleAccountNames() const { + // If the value is not set, GetBool() returns false. + return GetBool(kHasMultipleAccountNames); +} + +bool ProfileAttributesEntry::HasBothAccountCategories() const { + // If the value is not set, GetInteger returns kIntegerNotSet which does not + // equal kAccountTypeBoth. + return GetInteger(kAccountCategories) == kAccountCategoriesBoth; +} + +void ProfileAttributesEntry::RecordAccountCategoriesMetric() const { + if (HasBothAccountCategories()) { + if (IsAuthenticated()) { + bool consumer_syncing = GetHostedDomain() == kNoHostedDomainFound; + profile_metrics::LogProfileAllAccountsCategories( + consumer_syncing ? profile_metrics::AllAccountsCategories:: + kBothConsumerAndEnterpriseSyncingConsumer + : profile_metrics::AllAccountsCategories:: + kBothConsumerAndEnterpriseSyncingEnterprise); + } else { + profile_metrics::LogProfileAllAccountsCategories( + profile_metrics::AllAccountsCategories:: + kBothConsumerAndEnterpriseNoSync); + } + } else { + profile_metrics::LogProfileAllAccountsCategories( + profile_metrics::AllAccountsCategories::kSingleCategory); + } +} + +void ProfileAttributesEntry::RecordAccountNamesMetric() const { + if (HasMultipleAccountNames()) { + profile_metrics::LogProfileAllAccountsNames( + IsAuthenticated() + ? profile_metrics::AllAccountsNames::kMultipleNamesWithSync + : profile_metrics::AllAccountsNames::kMultipleNamesWithoutSync); + } else { + profile_metrics::LogProfileAllAccountsNames( + profile_metrics::AllAccountsNames::kLikelySingleName); + } +} + const base::Value* ProfileAttributesEntry::GetEntryData() const { const base::DictionaryValue* cache = prefs_->GetDictionary(prefs::kProfileInfoCache); @@ -587,7 +706,7 @@ int ProfileAttributesEntry::GetInteger(const char* key) const { const base::Value* value = GetValue(key); if (!value || !value->is_int()) - return -1; + return kIntegerNotSet; return value->GetInt(); } @@ -675,3 +794,14 @@ SetEntryData(std::move(new_data)); return true; } + +bool ProfileAttributesEntry::ClearValue(const char* key) { + const base::Value* old_data = GetEntryData(); + if (!old_data || !old_data->FindKey(key)) + return false; + + base::Value new_data = GetEntryData()->Clone(); + new_data.RemoveKey(key); + SetEntryData(std::move(new_data)); + return true; +}
diff --git a/chrome/browser/profiles/profile_attributes_entry.h b/chrome/browser/profiles/profile_attributes_entry.h index 02105ec..2fd1423 100644 --- a/chrome/browser/profiles/profile_attributes_entry.h +++ b/chrome/browser/profiles/profile_attributes_entry.h
@@ -38,6 +38,8 @@ kGaiaAndLocalName, }; +enum class AccountCategory { kConsumer, kEnterprise }; + class ProfileAttributesEntry { public: static void RegisterLocalStatePrefs(PrefRegistrySimple* registry); @@ -130,6 +132,12 @@ // Note: The bucket index is assigned once and remains the same all time. 0 is // reserved for the guest profile. size_t GetMetricsBucketIndex(); + // Returns the hosted domain for the current signed-in account. Returns empty + // string if there is no signed-in account and returns |kNoHostedDomainFound| + // if the signed-in account has no hosted domain (such as when it is a + // standard gmail.com account). Unlike for other string getters, the returned + // value is UTF8 encoded. + std::string GetHostedDomain() const; void SetLocalProfileName(const base::string16& name); void SetShortcutName(const base::string16& name); @@ -150,13 +158,31 @@ void SetIsAuthError(bool value); void SetAvatarIconIndex(size_t icon_index); + // Unlike for other string setters, the argument is expected to be UTF8 + // encoded. + void SetHostedDomain(std::string hosted_domain); + void SetAuthInfo(const std::string& gaia_id, const base::string16& user_name, bool is_consented_primary_account); + // Update info about accounts. These functions are idempotent, only the first + // call for a given input matters. + void AddAccountName(const std::string& name); + void AddAccountCategory(AccountCategory category); + + // Clears info about all accounts that have been added in the past via + // AddAccountName() and AddAccountCategory(). + void ClearAccountNames(); + void ClearAccountCategories(); + // Lock/Unlock the profile, should be called only if force-sign-in is enabled. void LockForceSigninProfile(bool is_lock); + // Records aggregate metrics about all accounts used in this profile (added + // via AddAccount* functions). + void RecordAccountMetrics() const; + static const char kSupervisedUserId[]; static const char kIsOmittedFromProfileListKey[]; static const char kAvatarIconKey[]; @@ -195,6 +221,18 @@ // profile avatar. const gfx::Image* GetHighResAvatar() const; + // Returns if this profile has accounts (signed-in or signed-out) with + // different account names. This is approximate as only a short hash of an + // account name is stored so there can be false negatives. + bool HasMultipleAccountNames() const; + // Returns if this profile has both consumer and enterprise accounts + // (regarding both signed-in and signed-out accounts). + bool HasBothAccountCategories() const; + + // Records aggregate metrics about all accounts used in this profile. + void RecordAccountCategoriesMetric() const; + void RecordAccountNamesMetric() const; + // Loads and saves the data to the local state. const base::Value* GetEntryData() const; void SetEntryData(base::Value data); @@ -225,6 +263,10 @@ bool SetBool(const char* key, bool value); bool SetInteger(const char* key, int value); + // Clears value stored for |key|. Returns if the original data is different + // from the new data, i.e. whether actual update is done. + bool ClearValue(const char* key); + // These members are an implementation detail meant to smooth the migration // of the ProfileInfoCache to the ProfileAttributesStorage interface. They can // be safely removed once the ProfileInfoCache stops using indices
diff --git a/chrome/browser/profiles/profile_attributes_storage.cc b/chrome/browser/profiles/profile_attributes_storage.cc index d3c9ca3..107a7a3 100644 --- a/chrome/browser/profiles/profile_attributes_storage.cc +++ b/chrome/browser/profiles/profile_attributes_storage.cc
@@ -198,6 +198,9 @@ return profile_metrics::UnconsentedPrimaryAccountType::kSignedOut; if (entry->IsChild()) return profile_metrics::UnconsentedPrimaryAccountType::kChild; + // TODO(crbug.com/1060113): Replace this check by + // !entry->GetHostedDomain().has_value() in M84 (once the cache gets + // reasonably well populated). if (policy::BrowserPolicyConnector::IsNonEnterpriseUser( base::UTF16ToUTF8(entry->GetUserName()))) { return profile_metrics::UnconsentedPrimaryAccountType::kConsumer;
diff --git a/chrome/browser/profiles/profiles_state.cc b/chrome/browser/profiles/profiles_state.cc index 7d515d7..465d48c 100644 --- a/chrome/browser/profiles/profiles_state.cc +++ b/chrome/browser/profiles/profiles_state.cc
@@ -186,7 +186,7 @@ GAIAInfoUpdateServiceFactory::GetInstance()->GetForProfile(profile); // The service may be null, for example during unit tests. if (service) - service->Update(); + service->UpdatePrimaryAccount(); } bool SetActiveProfileToGuestIfLocked() {
diff --git a/chrome/browser/renderer_context_menu/quick_answers_menu_observer.cc b/chrome/browser/renderer_context_menu/quick_answers_menu_observer.cc index 6114cfc..a12acf6 100644 --- a/chrome/browser/renderer_context_menu/quick_answers_menu_observer.cc +++ b/chrome/browser/renderer_context_menu/quick_answers_menu_observer.cc
@@ -124,7 +124,7 @@ void QuickAnswersMenuObserver::OnContextMenuShown( const content::ContextMenuParams& params, - gfx::Rect bounds) { + const gfx::Rect& bounds_in_screen) { if (!IsRichUiEnabled()) return; @@ -139,7 +139,13 @@ if (selected_text.empty()) return; - quick_answers_controller_->MaybeShowQuickAnswers(bounds, selected_text); + quick_answers_controller_->MaybeShowQuickAnswers(bounds_in_screen, + selected_text); +} + +void QuickAnswersMenuObserver::OnContextMenuViewBoundsChanged( + const gfx::Rect& bounds_in_screen) { + quick_answers_controller_->UpdateQuickAnswersAnchorBounds(bounds_in_screen); } void QuickAnswersMenuObserver::OnMenuClosed() {
diff --git a/chrome/browser/renderer_context_menu/quick_answers_menu_observer.h b/chrome/browser/renderer_context_menu/quick_answers_menu_observer.h index 24d926b..44b5667 100644 --- a/chrome/browser/renderer_context_menu/quick_answers_menu_observer.h +++ b/chrome/browser/renderer_context_menu/quick_answers_menu_observer.h
@@ -36,7 +36,9 @@ bool IsCommandIdEnabled(int command_id) override; void ExecuteCommand(int command_id) override; void OnContextMenuShown(const content::ContextMenuParams& params, - gfx::Rect bounds) override; + const gfx::Rect& bounds_in_screen) override; + void OnContextMenuViewBoundsChanged( + const gfx::Rect& bounds_in_screen) override; void OnMenuClosed() override; // QuickAnswersDelegate implementation.
diff --git a/chrome/browser/renderer_context_menu/render_view_context_menu_browsertest.cc b/chrome/browser/renderer_context_menu/render_view_context_menu_browsertest.cc index c679054..6ae5a73 100644 --- a/chrome/browser/renderer_context_menu/render_view_context_menu_browsertest.cc +++ b/chrome/browser/renderer_context_menu/render_view_context_menu_browsertest.cc
@@ -80,8 +80,11 @@ #include "third_party/blink/public/common/context_menu_data/media_type.h" #include "third_party/blink/public/common/input/web_input_event.h" #include "third_party/blink/public/mojom/loader/resource_load_info.mojom.h" +#include "third_party/skia/include/core/SkBitmap.h" #include "ui/base/emoji/emoji_panel_helper.h" #include "ui/base/models/menu_model.h" +#include "ui/gfx/codec/jpeg_codec.h" +#include "ui/gfx/codec/png_codec.h" #if defined(OS_CHROMEOS) #include "ash/public/cpp/window_pin_type.h" @@ -192,6 +195,78 @@ Browser* OpenTestWebApp(const AppId& app_id) { return web_app::LaunchWebAppBrowser(browser()->profile(), app_id); } + + void OpenImagePageAndContextMenu(std::string image_path) { + ASSERT_TRUE(embedded_test_server()->Start()); + GURL image_url(embedded_test_server()->GetURL(image_path)); + GURL page("data:text/html,<img src='" + image_url.spec() + "'>"); + ui_test_utils::NavigateToURL(browser(), page); + + // Open and close a context menu. + ContextMenuWaiter waiter; + content::WebContents* tab = + browser()->tab_strip_model()->GetActiveWebContents(); + content::SimulateMouseClickAt(tab, 0, blink::WebMouseEvent::Button::kRight, + gfx::Point(15, 15)); + waiter.WaitForMenuOpenAndClose(); + } + + void RequestImageAndVerifyResponse( + gfx::Size request_size, + chrome::mojom::ImageFormat request_image_format, + gfx::Size expected_original_size, + gfx::Size expected_size, + std::string expected_extension) { + mojo::AssociatedRemote<chrome::mojom::ChromeRenderFrame> + chrome_render_frame; + browser() + ->tab_strip_model() + ->GetActiveWebContents() + ->GetMainFrame() + ->GetRemoteAssociatedInterfaces() + ->GetInterface(&chrome_render_frame); + + auto callback = + [](std::vector<uint8_t>* response_image_data, + gfx::Size* response_original_size, + std::string* response_file_extension, const base::Closure& quit, + const std::vector<uint8_t>& image_data, + const gfx::Size& original_size, const std::string& file_extension) { + *response_image_data = image_data; + *response_original_size = original_size; + *response_file_extension = file_extension; + quit.Run(); + }; + + base::RunLoop run_loop; + std::vector<uint8_t> response_image_data; + gfx::Size response_original_size; + std::string response_file_extension; + chrome_render_frame->RequestImageForContextNode( + 0, request_size, request_image_format, + base::Bind(callback, &response_image_data, &response_original_size, + &response_file_extension, run_loop.QuitClosure())); + run_loop.Run(); + + ASSERT_EQ(expected_original_size.width(), response_original_size.width()); + ASSERT_EQ(expected_original_size.height(), response_original_size.height()); + ASSERT_EQ(expected_extension, response_file_extension); + + SkBitmap decoded_bitmap; + if (response_file_extension == ".png") { + EXPECT_TRUE(gfx::PNGCodec::Decode(&response_image_data.front(), + response_image_data.size(), + &decoded_bitmap)); + ASSERT_EQ(expected_size.width(), decoded_bitmap.width()); + ASSERT_EQ(expected_size.height(), decoded_bitmap.height()); + } else if (response_file_extension == ".jpg") { + decoded_bitmap = *gfx::JPEGCodec::Decode(&response_image_data.front(), + response_image_data.size()) + .get(); + ASSERT_EQ(expected_size.width(), decoded_bitmap.width()); + ASSERT_EQ(expected_size.height(), decoded_bitmap.height()); + } + } }; class PdfPluginContextMenuBrowserTest : public InProcessBrowserTest { @@ -1077,14 +1152,15 @@ auto callback = [](bool* response_received, const base::Closure& quit, const std::vector<uint8_t>& thumbnail_data, - const gfx::Size& original_size) { + const gfx::Size& original_size, + const std::string& file_extension) { *response_received = true; quit.Run(); }; base::RunLoop run_loop; bool response_received = false; - chrome_render_frame->RequestThumbnailForContextNode( + chrome_render_frame->RequestImageForContextNode( 0, gfx::Size(2048, 2048), chrome::mojom::ImageFormat::JPEG, base::Bind(callback, &response_received, run_loop.QuitClosure())); run_loop.Run(); @@ -1267,4 +1343,46 @@ blink::ContextMenuDataMediaType::kNone, ui::MENU_SOURCE_MOUSE); } +IN_PROC_BROWSER_TEST_F(ContextMenuBrowserTest, GifImageShare) { + OpenImagePageAndContextMenu("/google/logo.gif"); + RequestImageAndVerifyResponse( + gfx::Size(2048, 2048), chrome::mojom::ImageFormat::ORIGINAL, + gfx::Size(276, 110), gfx::Size(276, 110), ".gif"); +} + +IN_PROC_BROWSER_TEST_F(ContextMenuBrowserTest, GifImageDownscaleToJpeg) { + OpenImagePageAndContextMenu("/google/logo.gif"); + RequestImageAndVerifyResponse( + gfx::Size(100, 100), chrome::mojom::ImageFormat::ORIGINAL, + gfx::Size(276, 110), gfx::Size(100, /* 100 / 480 * 320 = */ 39), ".jpg"); +} + +IN_PROC_BROWSER_TEST_F(ContextMenuBrowserTest, RequestPngForGifImage) { + OpenImagePageAndContextMenu("/google/logo.gif"); + RequestImageAndVerifyResponse( + gfx::Size(2048, 2048), chrome::mojom::ImageFormat::PNG, + gfx::Size(276, 110), gfx::Size(276, 110), ".png"); +} + +IN_PROC_BROWSER_TEST_F(ContextMenuBrowserTest, PngImageDownscaleToPng) { + OpenImagePageAndContextMenu("/image_search/valid.png"); + RequestImageAndVerifyResponse( + gfx::Size(100, 100), chrome::mojom::ImageFormat::PNG, gfx::Size(200, 100), + gfx::Size(100, 50), ".png"); +} + +IN_PROC_BROWSER_TEST_F(ContextMenuBrowserTest, PngImageOriginalDownscaleToPng) { + OpenImagePageAndContextMenu("/image_search/valid.png"); + RequestImageAndVerifyResponse( + gfx::Size(100, 100), chrome::mojom::ImageFormat::ORIGINAL, + gfx::Size(200, 100), gfx::Size(100, 50), ".png"); +} + +IN_PROC_BROWSER_TEST_F(ContextMenuBrowserTest, JpgImageDownscaleToJpg) { + OpenImagePageAndContextMenu("/android/watch.jpg"); + RequestImageAndVerifyResponse( + gfx::Size(100, 100), chrome::mojom::ImageFormat::ORIGINAL, + gfx::Size(480, 320), gfx::Size(100, /* 100 / 480 * 320 = */ 66), ".jpg"); +} + } // namespace
diff --git a/chrome/browser/resources/chromeos/BUILD.gn b/chrome/browser/resources/chromeos/BUILD.gn index 4f76248..d4f57c7 100644 --- a/chrome/browser/resources/chromeos/BUILD.gn +++ b/chrome/browser/resources/chromeos/BUILD.gn
@@ -71,6 +71,7 @@ "internet_config_dialog:closure_compile", "internet_detail_dialog:closure_compile", "login:closure_compile", + "login/components:closure_compile", "machine_learning:closure_compile", "multidevice_setup:closure_compile", "network_ui:closure_compile",
diff --git a/chrome/browser/resources/chromeos/assistant_optin/assistant_optin_flow.js b/chrome/browser/resources/chromeos/assistant_optin/assistant_optin_flow.js index 31e2d84..8f8b0d1 100644 --- a/chrome/browser/resources/chromeos/assistant_optin/assistant_optin_flow.js +++ b/chrome/browser/resources/chromeos/assistant_optin/assistant_optin_flow.js
@@ -68,6 +68,7 @@ case this.FlowType.SPEAKER_ID_ENROLLMENT: case this.FlowType.SPEAKER_ID_RETRAIN: this.$['value-prop'].hidden = true; + this.$['voice-match'].isFirstScreen = true; this.showScreen(this.$['voice-match']); break; default:
diff --git a/chrome/browser/resources/chromeos/assistant_optin/assistant_voice_match.js b/chrome/browser/resources/chromeos/assistant_optin/assistant_voice_match.js index 20f63723..0af473a 100644 --- a/chrome/browser/resources/chromeos/assistant_optin/assistant_voice_match.js +++ b/chrome/browser/resources/chromeos/assistant_optin/assistant_voice_match.js
@@ -17,6 +17,12 @@ behaviors: [OobeI18nBehavior, OobeDialogHostBehavior], /** + * Whether voice match is the first screen of the flow. + * @type {boolean} + */ + isFirstScreen: false, + + /** * Current recording index. * @type {number} * @private @@ -158,6 +164,15 @@ * Signal from host to show the screen. */ onShow() { + if (this.isFirstScreen) { + // If voice match is the first screen, slightly delay showing the content + // for the lottie animations to load. + this.fire('loading'); + window.setTimeout(function() { + this.fire('loaded'); + }.bind(this), 100); + } + chrome.send('login.AssistantOptInFlowScreen.VoiceMatchScreen.screenShown'); this.$['voice-match-lottie'].setPlay(true); this.$['already-setup-lottie'].setPlay(true);
diff --git a/chrome/browser/resources/chromeos/login/components/BUILD.gn b/chrome/browser/resources/chromeos/login/components/BUILD.gn new file mode 100644 index 0000000..96ebbf27 --- /dev/null +++ b/chrome/browser/resources/chromeos/login/components/BUILD.gn
@@ -0,0 +1,17 @@ +# Copyright 2020 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//chrome/test/base/js2gtest.gni") +import("//third_party/closure_compiler/compile_js.gni") + +js_type_check("closure_compile") { + deps = [ ":progress_list_item" ] +} + +############################### +# Closure compiler libraries below + +js_library("progress_list_item") { + deps = [ "../:oobe_i18n_behavior" ] +}
diff --git a/chrome/browser/resources/chromeos/login/components/progress_list_item.css b/chrome/browser/resources/chromeos/login/components/progress_list_item.css new file mode 100644 index 0000000..5e8a09f --- /dev/null +++ b/chrome/browser/resources/chromeos/login/components/progress_list_item.css
@@ -0,0 +1,40 @@ +/* Copyright 2020 The Chromium Authors. All rights reserved. + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. */ + +#container { + align-items: center; + height: 56px; +} + +#icon { + min-width: 48px; +} + +#icon-pending { + background-color: var(--google-grey-500); + border-radius: 50%; + height: 8px; + margin-start: 8px; + width: 8px; +} + +#icon-active { + height: 24px; + width: 24px; +} + +#icon-completed { + color: var(--google-blue-600); +} + +#text { + color: var(--oobe-text-color); + font-family: var(--oobe-default-font-family); + font-size: 15px; + line-height: 16px; +} + +#text-active { + color: black; +}
diff --git a/chrome/browser/resources/chromeos/login/components/progress_list_item.html b/chrome/browser/resources/chromeos/login/components/progress_list_item.html new file mode 100644 index 0000000..67290f1 --- /dev/null +++ b/chrome/browser/resources/chromeos/login/components/progress_list_item.html
@@ -0,0 +1,54 @@ +<!-- Copyright 2020 The Chromium Authors. All rights reserved. + Use of this source code is governed by a BSD-style license that can be + found in the LICENSE file. --> +<link rel="import" href="chrome://resources/html/polymer.html"> + +<link rel="import" href="chrome://resources/polymer/v1_0/iron-icon/iron-icon.html"> +<link rel="import" href="chrome://resources/cr_elements/icons.html"> + +<!-- + Element for list of tasks with tri-state icon (pending, active, completed) + + Example: + <progress-list-item text-key="thirdItemKey" + active="[[equal_(step, 3)]]" + completed="[[greater_(step, 3)]]"> + </progress-list-item> + + Attributes and properties: + 'textKey' - localization key for the item text + 'activeKey' - if specified, overrides textKey for active state + 'completedKey' - if specified, overrides textKey for completed state + 'active' - if set, the item is considered to be in active state. + 'completed' - if active is not set, and completed is set, the item is + considered to be in completed state. +--> +<dom-module id="progress-list-item"> + <template> + <template> + <link rel="stylesheet" href="progress_list_item.css"> + <div class="flex layout horizontal center" id="container"> + <div id="icon"> + <div id="icon-pending" class="dot" + hidden="[[hidePending(active, completed)]]"></div> + <paper-spinner-lite id="icon-active" hidden="[[!active]]"> + </paper-spinner-lite> + <iron-icon id="icon-completed" icon="cr:check" + hidden="[[hideCompleted(active, completed)]]"></iron-icon> + </div> + <div id="text" class="content"> + <div id="text-pending" hidden="[[hidePending(active, completed)]]"> + [[i18nDynamic(locale, textKey)]] + </div> + <div id="text-active" hidden="[[!active]]"> + [[fallbackText(locale, activeKey, textKey)]] + </div> + <div id="text-completed" + hidden="[[hideCompleted(active, completed)]]"> + [[fallbackText(locale, completedKey, textKey)]] + </div> + </div> + </div> + </template> + </template> +</dom-module>
diff --git a/chrome/browser/resources/chromeos/login/components/progress_list_item.js b/chrome/browser/resources/chromeos/login/components/progress_list_item.js new file mode 100644 index 0000000..6a78d05f --- /dev/null +++ b/chrome/browser/resources/chromeos/login/components/progress_list_item.js
@@ -0,0 +1,66 @@ +// Copyright 2020 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +Polymer({ + is: 'progress-list-element', + + behaviors: [OobeI18nBehavior], + + properties: { + /* The ID of the localized string to be used as button text. + */ + textKey: { + type: String, + }, + + /* The ID of the localized string to be displayed when item is in + * the 'active' state. If not specified, the textKey is used instead. + */ + activeKey: { + type: String, + value: '', + }, + + /* The ID of the localized string to be displayed when item is in the + * 'completed' state. If not specified, the textKey is used instead. + */ + completedKey: { + type: String, + value: '', + }, + + /* Indicates if item is in "active" state. Has higher priority than + * "completed" below. + */ + active: { + type: Boolean, + value: false, + }, + + /* Indicates if item is in "completed" state. Has lower priority than + * "active" state above. + */ + completed: { + type: Boolean, + value: false, + }, + }, + + /** @private */ + hidePending_(active, completed) { + return active || completed; + }, + + /** @private */ + hideCompleted_(active, completed) { + return active || !completed; + }, + + /** @private */ + fallbackText(locale, key, fallbackKey) { + if (key === null || key === '') + return this.i18n(fallbackKey); + return this.i18n(key); + }, +});
diff --git a/chrome/browser/resources/chromeos/login/marketing_opt_in.css b/chrome/browser/resources/chromeos/login/marketing_opt_in.css index 51f0371..342c82e 100644 --- a/chrome/browser/resources/chromeos/login/marketing_opt_in.css +++ b/chrome/browser/resources/chromeos/login/marketing_opt_in.css
@@ -41,18 +41,6 @@ padding-inline-end: 16px; } -#finalAccessibilityLink { - color: var(--google-blue-600); -} - -#finalAccessibilityLinkContainer { - left: 0; - padding: 10px; - position: absolute; - right: 0; - text-align: center; -} - #finalAccessibilityPage oobe-a11y-option { border-top: var(--oobe-a11y-dialog-list-item-border); min-height: 64px; @@ -60,8 +48,4 @@ #finalAccessibilityPage oobe-a11y-option:last-of-type { border-bottom: var(--oobe-a11y-dialog-list-item-border); -} - -#marketing-bottom-buttons { - position: relative; } \ No newline at end of file
diff --git a/chrome/browser/resources/chromeos/login/marketing_opt_in.html b/chrome/browser/resources/chromeos/login/marketing_opt_in.html index 943d126..f5b9f5e 100644 --- a/chrome/browser/resources/chromeos/login/marketing_opt_in.html +++ b/chrome/browser/resources/chromeos/login/marketing_opt_in.html
@@ -77,18 +77,16 @@ </cr-lottie> </div> </div> - <div slot="bottom-buttons" class="layout horizontal end-justified" - id="marketing-bottom-buttons"> - <div hidden="[[!isA11ySettingsButtonVisible_]]" - id="finalAccessibilityLinkContainer"> - <a class="oobe-local-link" - id="finalAccessibilityLink" on-tap="onToggleAccessibilityPage_"> - [[i18nDynamic(locale, 'marketingOptInA11yLinkLabel')]] - </a> - </div> + <div slot="bottom-buttons" class="layout horizontal justified"> + <oobe-welcome-secondary-button + id="marketing-opt-in-accessibility-button" + on-tap="onToggleAccessibilityPage_" + icon1x="marketing-opt-in-32:accessibility" + icon2x="marketing-opt-in-64:accessibility" + text-key="marketingOptInA11yButtonLabel"> + </oobe-welcome-secondary-button> <oobe-text-button on-tap="onAllSet_" class="focus-on-show" inverse text-key="marketingOptInScreenAllSet" - hidden="[[!allSetButtonVisible_]]" id="marketing-opt-in-next-button"> </oobe-text-button> </div>
diff --git a/chrome/browser/resources/chromeos/login/marketing_opt_in.js b/chrome/browser/resources/chromeos/login/marketing_opt_in.js index 389f69c7..550268f 100644 --- a/chrome/browser/resources/chromeos/login/marketing_opt_in.js +++ b/chrome/browser/resources/chromeos/login/marketing_opt_in.js
@@ -11,21 +11,11 @@ is: 'marketing-opt-in', properties: { - allSetButtonVisible_: { - type: Boolean, - value: true, - }, - isAccessibilitySettingsShown_: { type: Boolean, value: false, }, - isA11ySettingsButtonVisible_: { - type: Boolean, - value: false, - }, - /** * Whether the marketing opt in toggles should be shown, which will be the * case only if marketing opt in feature is enabled. @@ -45,8 +35,6 @@ /** Overridden from LoginScreenBehavior. */ EXTERNAL_API: [ - 'updateAllSetButtonVisibility', - 'updateA11ySettingsButtonVisibility', 'updateA11yNavigationButtonToggle', ], @@ -82,25 +70,6 @@ }, /** - * @param {boolean} visible Whether the all set button should be shown. - */ - updateAllSetButtonVisibility(visible) { - this.allSetButtonVisible_ = visible; - - // When showing the all set button, give the user a way to disable shelf - // gestures, and enabled "all set" button. - if(visible) - this.isA11ySettingsButtonVisible_ = true; - }, - - /** - * @param {boolean} shown Whether the A11y Settings button should be shown. - */ - updateA11ySettingsButtonVisibility(shown) { - this.isA11ySettingsButtonVisible_ = shown; - }, - - /** * @param {boolean} enabled Whether the a11y setting for shownig shelf * navigation buttons is enabled. */ @@ -118,11 +87,6 @@ this.$['marketingOptInOverviewDialog'] .querySelector('.marketing-animation') .setPlay(!this.isAccessibilitySettingsShown_); - - chrome.send( - 'login.MarketingOptInScreen.accessibilityPageVisibilityChanged', [ - this.isAccessibilitySettingsShown_ - ]); }, /**
diff --git a/chrome/browser/resources/chromeos/login/oobe_screen_eula.js b/chrome/browser/resources/chromeos/login/oobe_screen_eula.js index 6f4a33eb..ac61122 100644 --- a/chrome/browser/resources/chromeos/login/oobe_screen_eula.js +++ b/chrome/browser/resources/chromeos/login/oobe_screen_eula.js
@@ -19,6 +19,16 @@ '}' }; + const EULA_FONTS_CSS = { + code: `body * { + font-family: Roboto, sans-serif !important; + font-size: 13px !important; + line-height: 20px !important;} + body h2 { + font-size: 15px !important; + line-height: 22px !important;}` + }; + /** * Timeout to load online Eula. * @type {number} @@ -74,6 +84,9 @@ webview.executeScript(CLEAR_ANCHORS_CONTENT_SCRIPT); }); } + webview.addEventListener('contentload', () => { + webview.insertCSS(EULA_FONTS_CSS); + }); // Monitor webRequests API events this.webview_.request.onCompleted.addListener(
diff --git a/chrome/browser/resources/discards/database_tab.js b/chrome/browser/resources/discards/database_tab.js index 3b5ad5db..93367e2 100644 --- a/chrome/browser/resources/discards/database_tab.js +++ b/chrome/browser/resources/discards/database_tab.js
@@ -10,7 +10,7 @@ import {assertNotReached} from 'chrome://resources/js/assert.m.js'; import {html, Polymer} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js'; -import {boolToString, durationToString, getOrCreateDetailsProvider, secondsToString} from './discards.js'; +import {boolToString, durationToString, getOrCreateSiteDataProvider, secondsToString} from './discards.js'; import {SortedTableBehavior} from './sorted_table_behavior.js'; /** @@ -229,14 +229,14 @@ /** @private {!Object} */ requestedOrigins_: {}, - /** @private {?discards.mojom.DetailsProviderRemote} */ - discardsDetailsProvider_: null, + /** @private {?discards.mojom.SiteDataProviderRemote} */ + siteDataProvider_: null, /** @override */ ready() { this.setSortKey('origin'); this.requestedOrigins_ = {}; - this.discardsDetailsProvider_ = getOrCreateDetailsProvider(); + this.siteDataProvider_ = getOrCreateSiteDataProvider(); // Specifies the update interval of the table, in ms. const UPDATE_INTERVAL_MS = 1000; @@ -269,7 +269,7 @@ * @private */ updateDbRows_() { - this.discardsDetailsProvider_ + this.siteDataProvider_ .getSiteCharacteristicsDatabase(Object.keys(this.requestedOrigins_)) .then(response => { // Bail if the SiteCharacteristicsDatabase is turned off. @@ -325,7 +325,7 @@ * @private */ updateDbSizes_() { - this.discardsDetailsProvider_.getSiteCharacteristicsDatabaseSize().then( + this.siteDataProvider_.getSiteCharacteristicsDatabaseSize().then( response => { // Bail if the SiteCharacteristicsDatabase is turned off. if (!response.dbSize) {
diff --git a/chrome/browser/resources/discards/discards.js b/chrome/browser/resources/discards/discards.js index 9d8a957..b93201c 100644 --- a/chrome/browser/resources/discards/discards.js +++ b/chrome/browser/resources/discards/discards.js
@@ -16,6 +16,18 @@ return discardsDetailsProvider; } + let siteDataProvider; + + /** + * @return {!discards.mojom.SiteDataProviderRemote} Provides site data info. + */ + export function getOrCreateSiteDataProvider() { + if (!siteDataProvider) { + siteDataProvider = discards.mojom.SiteDataProvider.getRemote(); + } + return siteDataProvider; + } + /** * Pluralizes a string according to the given count. Assumes that appending an * 's' is sufficient to make a string plural.
diff --git a/chrome/browser/resources/discards/mojo_api.js b/chrome/browser/resources/discards/mojo_api.js index 35f80987..31283930 100644 --- a/chrome/browser/resources/discards/mojo_api.js +++ b/chrome/browser/resources/discards/mojo_api.js
@@ -8,3 +8,4 @@ import './mojo/public/mojom/base/process_id.mojom-lite.js'; import './chrome/browser/resource_coordinator/lifecycle_unit_state.mojom-lite.js'; import './chrome/browser/ui/webui/discards/discards.mojom-lite.js'; +import './chrome/browser/ui/webui/discards/site_data.mojom-lite.js';
diff --git a/chrome/browser/resources/extensions/runtime_hosts_dialog.js b/chrome/browser/resources/extensions/runtime_hosts_dialog.js index d17cba8..35fa8ad 100644 --- a/chrome/browser/resources/extensions/runtime_hosts_dialog.js +++ b/chrome/browser/resources/extensions/runtime_hosts_dialog.js
@@ -29,8 +29,8 @@ '((http|https|\\*)://)?' + // Include subdomains specifier; optional. '(\\*\\.)?' + - // Hostname, required. - '([a-z0-9\\.-]+\\.[a-z0-9]+)' + + // Hostname or localhost, required. + '([a-z0-9\\.-]+\\.[a-z0-9]+|localhost)' + // Port, optional. '(:[0-9]+)?' + // Path, optional but if present must be '/' or '/*'.
diff --git a/chrome/browser/resources/local_ntp/icons.grdp b/chrome/browser/resources/local_ntp/icons.grdp index d0028fb..23d21d00 100644 --- a/chrome/browser/resources/local_ntp/icons.grdp +++ b/chrome/browser/resources/local_ntp/icons.grdp
@@ -1,7 +1,31 @@ <?xml version="1.0" encoding="utf-8"?> <grit-part> - <include name="IDR_LOCAL_NTP_ICONS_CLOCK" + <include name="IDR_LOCAL_NTP_ICONS_BOOKMARK" + file="resources/local_ntp/icons/bookmark.svg" type="BINDATA" compress="gzip" /> + <include name="IDR_LOCAL_NTP_ICONS_CALCULATOR" + file="resources/local_ntp/icons/calculator.svg" type="BINDATA" compress="gzip" /> + <include name="IDR_LOCAL_NTP_ICONS_CLOCK" file="resources/local_ntp/icons/clock.svg" type="BINDATA" compress="gzip" /> - <include name="IDR_LOCAL_NTP_ICONS_PAGE" + <include name="IDR_LOCAL_NTP_ICONS_DRIVE_DOCS" + file="resources/local_ntp/icons/drive_docs.svg" type="BINDATA" compress="gzip" /> + <include name="IDR_LOCAL_NTP_ICONS_DRIVE_FOLDER" + file="resources/local_ntp/icons/drive_folder.svg" type="BINDATA" compress="gzip" /> + <include name="IDR_LOCAL_NTP_ICONS_DRIVE_FORM" + file="resources/local_ntp/icons/drive_form.svg" type="BINDATA" compress="gzip" /> + <include name="IDR_LOCAL_NTP_ICONS_DRIVE_IMAGE" + file="resources/local_ntp/icons/drive_image.svg" type="BINDATA" compress="gzip" /> + <include name="IDR_LOCAL_NTP_ICONS_DRIVE_LOGO" + file="resources/local_ntp/icons/drive_logo.svg" type="BINDATA" compress="gzip" /> + <include name="IDR_LOCAL_NTP_ICONS_DRIVE_PDF" + file="resources/local_ntp/icons/drive_pdf.svg" type="BINDATA" compress="gzip" /> + <include name="IDR_LOCAL_NTP_ICONS_DRIVE_SHEETS" + file="resources/local_ntp/icons/drive_sheets.svg" type="BINDATA" compress="gzip" /> + <include name="IDR_LOCAL_NTP_ICONS_DRIVE_SLIDES" + file="resources/local_ntp/icons/drive_slides.svg" type="BINDATA" compress="gzip" /> + <include name="IDR_LOCAL_NTP_ICONS_DRIVE_VIDEO" + file="resources/local_ntp/icons/drive_video.svg" type="BINDATA" compress="gzip" /> + <include name="IDR_LOCAL_NTP_ICONS_EXTENSION_APP" + file="resources/local_ntp/icons/extension_app.svg" type="BINDATA" compress="gzip" /> + <include name="IDR_LOCAL_NTP_ICONS_PAGE" file="resources/local_ntp/icons/page.svg" type="BINDATA" compress="gzip" /> </grit-part>
diff --git a/chrome/browser/resources/local_ntp/icons/bookmark.svg b/chrome/browser/resources/local_ntp/icons/bookmark.svg new file mode 100644 index 0000000..87ecd1b --- /dev/null +++ b/chrome/browser/resources/local_ntp/icons/bookmark.svg
@@ -0,0 +1 @@ +<svg width="32" height="32" viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><defs><path id="a" d="M16 23.027L24.24 28l-2.187-9.373 7.28-6.307-9.586-.813L16 2.667l-3.747 8.84-9.586.813 7.28 6.307L7.76 28z"/></defs><use xlink:href="#a"/></svg> \ No newline at end of file
diff --git a/chrome/browser/resources/local_ntp/icons/calculator.svg b/chrome/browser/resources/local_ntp/icons/calculator.svg new file mode 100644 index 0000000..4fb2f8b6 --- /dev/null +++ b/chrome/browser/resources/local_ntp/icons/calculator.svg
@@ -0,0 +1 @@ +<svg width="32" height="32" viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><defs><path d="M8 12h16v3H8v-3zm0 5h16v3H8v-3z" id="a"/></defs><use xlink:href="#a"/></svg> \ No newline at end of file
diff --git a/chrome/browser/resources/local_ntp/icons/clock.svg b/chrome/browser/resources/local_ntp/icons/clock.svg index d4420ae..ad93660 100644 --- a/chrome/browser/resources/local_ntp/icons/clock.svg +++ b/chrome/browser/resources/local_ntp/icons/clock.svg
@@ -1 +1 @@ -<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24"><path d="M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"/><path d="M0 0h24v24H0z" fill="none"/><path d="M12.5 7H11v6l5.25 3.15.75-1.23-4.5-2.67z"/></svg> \ No newline at end of file +<svg width="32" height="32" viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><defs><path d="M15.993 2.667C8.627 2.667 2.667 8.633 2.667 16s5.96 13.333 13.326 13.333c7.367 0 13.34-5.966 13.34-13.333S23.36 2.667 15.993 2.667zM16 5.333c5.893 0 10.667 4.774 10.667 10.667S21.893 26.667 16 26.667 5.333 21.893 5.333 16 10.107 5.333 16 5.333zm.667 4h-2v8l6.993 4.2 1.007-1.64-6-3.56v-7z" id="a"/></defs><use xlink:href="#a"/></svg> \ No newline at end of file
diff --git a/chrome/browser/resources/local_ntp/icons/drive_docs.svg b/chrome/browser/resources/local_ntp/icons/drive_docs.svg new file mode 100644 index 0000000..563cdebf --- /dev/null +++ b/chrome/browser/resources/local_ntp/icons/drive_docs.svg
@@ -0,0 +1 @@ +<svg width="16" height="16" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg"><path d="M14.222 0H1.778C.8 0 0 .8 0 1.778v12.444C0 15.2.8 16 1.778 16h12.444C15.2 16 16 15.2 16 14.222V1.778C16 .8 15.2 0 14.222 0zm-1.769 5.333H3.556V3.556h8.897v1.777zm0 3.556H3.556V7.11h8.897v1.78zm-2.666 3.555H3.556v-1.777h6.23v1.777z" fill="#4285F4"/></svg> \ No newline at end of file
diff --git a/chrome/browser/resources/local_ntp/icons/drive_folder.svg b/chrome/browser/resources/local_ntp/icons/drive_folder.svg new file mode 100644 index 0000000..d7d3519e --- /dev/null +++ b/chrome/browser/resources/local_ntp/icons/drive_folder.svg
@@ -0,0 +1 @@ +<svg width="16" height="16" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg"><path d="M14.4 3.6H8L6.4 2H1.6C.72 2 .008 2.72.008 3.6L0 13.2c0 .88.72 1.6 1.6 1.6h12.8c.88 0 1.6-.72 1.6-1.6v-8c0-.88-.72-1.6-1.6-1.6zm0 9.6H1.6v-8h12.8v8z" fill="#5F6368"/></svg> \ No newline at end of file
diff --git a/chrome/browser/resources/local_ntp/icons/drive_form.svg b/chrome/browser/resources/local_ntp/icons/drive_form.svg new file mode 100644 index 0000000..7702b0a6 --- /dev/null +++ b/chrome/browser/resources/local_ntp/icons/drive_form.svg
@@ -0,0 +1 @@ +<svg width="16" height="16" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg"><path d="M14.222 0H1.778C.8 0 0 .8 0 1.778v12.444C0 15.2.8 16 1.778 16h12.444C15.2 16 16 15.2 16 14.222V1.778C16 .8 15.2 0 14.222 0zM5.333 12.444H3.556v-1.777h1.777v1.777zm0-3.555H3.556V7.11h1.777v1.78zm0-3.556H3.556V3.556h1.777v1.777zm7.111 7.111H6.222v-1.777h6.222v1.777zm0-3.555H6.222V7.11h6.222v1.78zm0-3.556H6.222V3.556h6.222v1.777z" fill="#673AB7"/></svg> \ No newline at end of file
diff --git a/chrome/browser/resources/local_ntp/icons/drive_image.svg b/chrome/browser/resources/local_ntp/icons/drive_image.svg new file mode 100644 index 0000000..3e150ebf --- /dev/null +++ b/chrome/browser/resources/local_ntp/icons/drive_image.svg
@@ -0,0 +1 @@ +<svg width="16" height="16" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg"><path d="M16 14.222V1.778C16 .8 15.2 0 14.222 0H1.778C.8 0 0 .8 0 1.778v12.444C0 15.2.8 16 1.778 16h12.444C15.2 16 16 15.2 16 14.222zM4.889 9.333L7.11 12.01 10.222 8l4 5.333H1.778l3.11-4z" fill="#E94335"/></svg> \ No newline at end of file
diff --git a/chrome/browser/resources/local_ntp/icons/drive_logo.svg b/chrome/browser/resources/local_ntp/icons/drive_logo.svg new file mode 100644 index 0000000..87f6737 --- /dev/null +++ b/chrome/browser/resources/local_ntp/icons/drive_logo.svg
@@ -0,0 +1 @@ +<svg width="16" height="16" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg"><g fill="none"><path fill="#4285F4" d="M16 10.391l-2.548 4.522H2.548l2.62-4.522z"/><path fill="#FFCD40" d="M10.61 1H5.39l5.442 9.391H16z"/><path fill="#0F9D58" d="M5.39 1L8 5.504l-5.452 9.409L0 10.391z"/></g></svg> \ No newline at end of file
diff --git a/chrome/browser/resources/local_ntp/icons/drive_pdf.svg b/chrome/browser/resources/local_ntp/icons/drive_pdf.svg new file mode 100644 index 0000000..494b713 --- /dev/null +++ b/chrome/browser/resources/local_ntp/icons/drive_pdf.svg
@@ -0,0 +1 @@ +<svg width="16" height="16" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg"><path d="M3.556 7.556h.888v-.89h-.888v.89zM14.222 0H1.778C.8 0 0 .8 0 1.778v12.444C0 15.2.8 16 1.778 16h12.444C15.2 16 16 15.2 16 14.222V1.778C16 .8 15.2 0 14.222 0zM5.778 7.556c0 .737-.596 1.333-1.334 1.333h-.888v1.778H2.222V5.333h2.222c.738 0 1.334.596 1.334 1.334v.889zm8.889-.89h-2.223v.89h1.334v1.333h-1.334v1.778h-1.333V5.333h3.556v1.334zm-4.445 2.667c0 .738-.595 1.334-1.333 1.334H6.667V5.333h2.222c.738 0 1.333.596 1.333 1.334v2.666zM8 9.333h.889V6.667H8v2.666z" fill="#DB4537"/></svg> \ No newline at end of file
diff --git a/chrome/browser/resources/local_ntp/icons/drive_sheets.svg b/chrome/browser/resources/local_ntp/icons/drive_sheets.svg new file mode 100644 index 0000000..d45b865 --- /dev/null +++ b/chrome/browser/resources/local_ntp/icons/drive_sheets.svg
@@ -0,0 +1 @@ +<svg width="16" height="16" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg"><path d="M14.222 0H1.778C.8 0 .008.8.008 1.778L0 4.444v9.778C0 15.2.8 16 1.778 16h12.444C15.2 16 16 15.2 16 14.222V1.778C16 .8 15.2 0 14.222 0zm0 7.111h-7.11v7.111h-1.78v-7.11H1.778v-1.78h3.555V1.778h1.778v3.555h7.111v1.778z" fill="#0E9D58"/></svg> \ No newline at end of file
diff --git a/chrome/browser/resources/local_ntp/icons/drive_slides.svg b/chrome/browser/resources/local_ntp/icons/drive_slides.svg new file mode 100644 index 0000000..d3c1148 --- /dev/null +++ b/chrome/browser/resources/local_ntp/icons/drive_slides.svg
@@ -0,0 +1 @@ +<svg width="16" height="16" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg"><path d="M14.221 0H1.77C.792 0 0 .8 0 1.778v12.444C0 15.2.792 16 1.77 16h12.45c.98 0 1.78-.8 1.78-1.778V1.778C16 .8 15.2 0 14.221 0zM14 12H2V4h12v8z" fill="#FDB700"/></svg> \ No newline at end of file
diff --git a/chrome/browser/resources/local_ntp/icons/drive_video.svg b/chrome/browser/resources/local_ntp/icons/drive_video.svg new file mode 100644 index 0000000..28309f1 --- /dev/null +++ b/chrome/browser/resources/local_ntp/icons/drive_video.svg
@@ -0,0 +1 @@ +<svg width="16" height="16" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg"><path d="M12.8 2l1.6 3.2H12L10.4 2H8.8l1.6 3.2H8L6.4 2H4.8l1.6 3.2H4L2.4 2h-.8C.72 2 .008 2.72.008 3.6L0 13.2c0 .88.72 1.6 1.6 1.6h12.8c.88 0 1.6-.72 1.6-1.6V2h-3.2z" fill="#EA4335"/></svg> \ No newline at end of file
diff --git a/chrome/browser/resources/local_ntp/icons/extension_app.svg b/chrome/browser/resources/local_ntp/icons/extension_app.svg new file mode 100644 index 0000000..f730feb --- /dev/null +++ b/chrome/browser/resources/local_ntp/icons/extension_app.svg
@@ -0,0 +1 @@ +<svg width="32" height="32" viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><defs><path d="M24.5 15H23v-4c0-1.1-.9-2-2-2h-4V7.5a2.5 2.5 0 0 0-5 0V9H8c-1.1 0-1.99.9-1.99 2v3.8H7.5c1.49 0 2.7 1.21 2.7 2.7 0 1.49-1.21 2.7-2.7 2.7H6V24c0 1.1.9 2 2 2h3.8v-1.5c0-1.49 1.21-2.7 2.7-2.7 1.49 0 2.7 1.21 2.7 2.7V26H21c1.1 0 2-.9 2-2v-4h1.5a2.5 2.5 0 0 0 0-5z" id="a"/></defs><use xlink:href="#a" fill-rule="evenodd"/></svg> \ No newline at end of file
diff --git a/chrome/browser/resources/local_ntp/icons/page.svg b/chrome/browser/resources/local_ntp/icons/page.svg index 90b2f95..0de9884 100644 --- a/chrome/browser/resources/local_ntp/icons/page.svg +++ b/chrome/browser/resources/local_ntp/icons/page.svg
@@ -1 +1 @@ -<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24"><path fill="gray" d="M12 2c5.52 0 10 4.48 10 10s-4.48 10-10 10S2 17.52 2 12 6.48 2 12 2zM4 12h4.4c3.41.02 4.92 1.73 4.54 5.13H9.49v2.47a8 8 0 0 0 10.5-8.08C19.33 12.5 18.33 13 17 13c-2.14 0-3.21-.92-3.21-2.75h-3.75c-.27-2.73.68-4.09 2.87-4.09 0-.97.33-1.6.81-1.97A8 8 0 0 0 4 12z"/></svg> \ No newline at end of file +<svg width="32" height="32" viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><defs><path d="M16 2c7.728 0 14 6.272 14 14s-6.272 14-14 14S2 23.728 2 16 8.272 2 16 2zm0 3.333c-5.887 0-10.667 4.78-10.667 10.667H11.2c4.543.029 6.562 2.308 6.058 6.836H12.65v3.293c1.054.349 2.18.538 3.35.538 5.887 0 10.667-4.78 10.667-10.667 0-.217-.007-.433-.02-.647-.876 1.32-2.203 1.98-3.98 1.98-2.85 0-4.275-1.222-4.275-3.665h-4.998c-.365-3.638.91-5.457 3.827-5.457 0-1.3.436-2.13 1.082-2.628A10.69 10.69 0 0 0 16 5.333z" id="a"/></defs><use xlink:href="#a"/></svg> \ No newline at end of file
diff --git a/chrome/browser/resources/local_ntp/local_ntp.js b/chrome/browser/resources/local_ntp/local_ntp.js index fefc4c73..9ab299d 100644 --- a/chrome/browser/resources/local_ntp/local_ntp.js +++ b/chrome/browser/resources/local_ntp/local_ntp.js
@@ -106,6 +106,8 @@ USE_NOTIFIER: 'use-notifier', }; +const DOCUMENT_MATCH_TYPE = 'document'; + /** * The period of time (ms) before transitions can be applied to a toast * notification after modifying the "display" property. @@ -1721,6 +1723,9 @@ if (faviconOrImageUrlToDataUrlCache[match.destinationUrl]) { setBackgroundImageByUrl( iconEl, faviconOrImageUrlToDataUrlCache[match.destinationUrl]); + } else if (match.type == DOCUMENT_MATCH_TYPE) { + // Document matches use colored SVG icons. + setBackgroundImageByUrl(iconEl, match.iconUrl); } else { setWebkitMaskImageByUrl(iconEl, match.iconUrl); } @@ -2157,6 +2162,10 @@ realboxIcon.dataset.icon = ''; setBackgroundImageByUrl( realboxIcon, faviconOrImageUrlToDataUrlCache[match.destinationUrl]); + } else if (match.type == DOCUMENT_MATCH_TYPE) { + realboxIcon.dataset.icon = match.iconUrl; + // Document matches use colored SVG icons. + setBackgroundImageByUrl(realboxIcon, realboxIcon.dataset.icon); } else { realboxIcon.dataset.icon = match.iconUrl; setWebkitMaskImageByUrl(realboxIcon, realboxIcon.dataset.icon);
diff --git a/chrome/browser/resources/media/media_feeds.html b/chrome/browser/resources/media/media_feeds.html index 1083adcf..b7e3edf 100644 --- a/chrome/browser/resources/media/media_feeds.html +++ b/chrome/browser/resources/media/media_feeds.html
@@ -193,6 +193,9 @@ <th sort-key="images"> Images </th> + <th sort-key="safeSearchResult"> + Safe Search Result + </th> </tr> </thead> <tbody>
diff --git a/chrome/browser/resources/media/media_feeds.js b/chrome/browser/resources/media/media_feeds.js index cb517fb..9f0e173 100644 --- a/chrome/browser/resources/media/media_feeds.js +++ b/chrome/browser/resources/media/media_feeds.js
@@ -142,6 +142,19 @@ td.textContent = 'Completed'; break; } + } else if (key == 'safeSearchResult') { + // Format a SafeSearchResult. + switch (parseInt(data, 10)) { + case mediaFeeds.mojom.SafeSearchResult.kUnknown: + td.textContent = 'Unknown'; + break; + case mediaFeeds.mojom.SafeSearchResult.kSafe: + td.textContent = 'Safe'; + break; + case mediaFeeds.mojom.SafeSearchResult.kUnsafe: + td.textContent = 'Unsafe'; + break; + } } else if (key == 'startTime') { // Format a start time. td.textContent = @@ -185,10 +198,13 @@ a.textContent = data.name; a.target = '_blank'; td.appendChild(a); - } else if (key == 'name' || key == 'genre') { + } else if (key == 'name') { // Format a mojo string16. td.textContent = decodeString16(/** @type {mojoBase.mojom.String16} */ (data)); + } else if (key == 'genre') { + // Format an array of strings. + td.textContent = data.join(', '); } else if (key == 'live') { // Format LiveDetails. td.textContent = 'Live'; @@ -257,7 +273,7 @@ sortKey === 'userStatus' || sortKey === 'lastFetchResult' || sortKey === 'fetchFailedCount' || sortKey === 'lastFetchItemCount' || sortKey === 'lastFetchPlayNextCount' || - sortKey === 'lastFetchContentTypes') { + sortKey === 'lastFetchContentTypes' || sortKey === 'safeSearchResult') { return val1 > val2 ? 1 : -1; } else if ( sortKey === 'lastDiscoveryTime' || sortKey === 'lastFetchTime' ||
diff --git a/chrome/browser/resources/print_preview/ui/header.js b/chrome/browser/resources/print_preview/ui/header.js index dcb52ab..3848934 100644 --- a/chrome/browser/resources/print_preview/ui/header.js +++ b/chrome/browser/resources/print_preview/ui/header.js
@@ -37,16 +37,12 @@ managed: Boolean, /** @private {number} */ - sheetCount_: { - type: Number, - computed: 'computeSheetCount_(' + - 'settings.pages.*, settings.duplex.*, settings.copies.*)', - }, + sheetCount: Number, /** @private {?string} */ summary_: { type: String, - computed: 'computeSummary_(sheetCount_, state, destination.id)', + computed: 'computeSummary_(sheetCount, state, destination.id)', }, }, @@ -94,32 +90,20 @@ }, /** - * @return {number} The number of sheets that will be printed. - * @private - */ - computeSheetCount_() { - let sheets = this.getSettingValue('pages').length; - if (this.getSettingValue('duplex')) { - sheets = Math.ceil(sheets / 2); - } - return sheets * /** @type {number} */ (this.getSettingValue('copies')); - }, - - /** * @return {string} * @private */ getSheetsSummary_() { - if (this.sheetCount_ === 0) { + if (this.sheetCount === 0) { return ''; } const pageOrSheets = this.isPdfOrDrive_() ? 'Page' : 'Sheets'; - const singularOrPlural = this.sheetCount_ > 1 ? 'Plural' : 'Singular'; + const singularOrPlural = this.sheetCount > 1 ? 'Plural' : 'Singular'; const label = loadTimeData.getString( `printPreview${pageOrSheets}Label${singularOrPlural}`); return loadTimeData.getStringF( - 'printPreviewSummaryFormatShort', this.sheetCount_.toLocaleString(), + 'printPreviewSummaryFormatShort', this.sheetCount.toLocaleString(), label); }, });
diff --git a/chrome/browser/resources/print_preview/ui/sidebar.html b/chrome/browser/resources/print_preview/ui/sidebar.html index 8ff8459..81f744fc 100644 --- a/chrome/browser/resources/print_preview/ui/sidebar.html +++ b/chrome/browser/resources/print_preview/ui/sidebar.html
@@ -37,7 +37,7 @@ </style> <print-preview-header id="header" destination="[[destination]]" cloud-print-error-message="[[cloudPrintErrorMessage]]" - error="[[error]]" state="[[state]]" + error="[[error]]" sheet-count="[[sheetCount_]]" state="[[state]]" settings="[[settings]]" managed="[[controlsManaged]]"> </print-preview-header> <div id="container" show-bottom-shadow>
diff --git a/chrome/browser/resources/print_preview/ui/sidebar.js b/chrome/browser/resources/print_preview/ui/sidebar.js index 070f1fa..53ae52d6 100644 --- a/chrome/browser/resources/print_preview/ui/sidebar.js +++ b/chrome/browser/resources/print_preview/ui/sidebar.js
@@ -104,6 +104,13 @@ computed: 'computeControlsDisabled_(state)', }, + /** @private {number} */ + sheetCount_: { + type: Number, + computed: 'computeSheetCount_(' + + 'settings.pages.*, settings.duplex.*, settings.copies.*)', + }, + /** @private {boolean} */ firstLoad_: { type: Boolean, @@ -163,6 +170,18 @@ }, /** + * @return {number} The number of sheets that will be printed. + * @private + */ + computeSheetCount_() { + let sheets = this.getSettingValue('pages').length; + if (this.getSettingValue('duplex')) { + sheets = Math.ceil(sheets / 2); + } + return sheets * /** @type {number} */ (this.getSettingValue('copies')); + }, + + /** * @return {boolean} Whether to show the "More settings" link. * @private */
diff --git a/chrome/browser/resources/quota_internals/event_handler.js b/chrome/browser/resources/quota_internals/event_handler.js index e4594b73..512ecd4 100644 --- a/chrome/browser/resources/quota_internals/event_handler.js +++ b/chrome/browser/resources/quota_internals/event_handler.js
@@ -491,6 +491,10 @@ $('refresh-button').addEventListener('click', cr.quota.requestInfo, false); $('dump-button').addEventListener('click', dump, false); + $('trigger-notification').addEventListener('click', () => { + const origin = $('storage-pressure-origin').value; + cr.quota.triggerStoragePressure(origin); + }, false); } document.addEventListener('DOMContentLoaded', onLoad, false);
diff --git a/chrome/browser/resources/quota_internals/main.css b/chrome/browser/resources/quota_internals/main.css index ab3de652..1122a70 100644 --- a/chrome/browser/resources/quota_internals/main.css +++ b/chrome/browser/resources/quota_internals/main.css
@@ -22,3 +22,10 @@ .tree-item:not([may-have-children]) > .tree-row > .tree-label-icon { background-image: url(../../../../ui/webui/resources/images/icon_file.png); } + +.pressure { + margin: 10px 0; +} +#storage-pressure-origin { + min-width: 20em; +}
diff --git a/chrome/browser/resources/quota_internals/main.html b/chrome/browser/resources/quota_internals/main.html index 51eb50ca..c8af062 100644 --- a/chrome/browser/resources/quota_internals/main.html +++ b/chrome/browser/resources/quota_internals/main.html
@@ -48,6 +48,17 @@ <table> <tbody id="stat-entries" class="entries"></tbody> </table> + <h2>Test Storage Pressure Behavior</h2> + <div class="pressure"> + Origin to test: + <input id="storage-pressure-origin" + value="https://www.example.com"> + </div> + <div class="pressure"> + <button id="trigger-notification"> + Trigger Storage Pressure Notification + </button> + </div> </tabpanel> <tabpanel>
diff --git a/chrome/browser/resources/quota_internals/message_dispatcher.js b/chrome/browser/resources/quota_internals/message_dispatcher.js index a387094..473ce67 100644 --- a/chrome/browser/resources/quota_internals/message_dispatcher.js +++ b/chrome/browser/resources/quota_internals/message_dispatcher.js
@@ -25,6 +25,13 @@ } /** + * Post triggerStoragePressure message to Browser. + */ + function triggerStoragePressure(origin) { + chrome.send('triggerStoragePressure', [origin]); + } + + /** * Callback entry point from Browser. * Messages are Dispatched as Event to: * * onAvailableSpaceUpdated, @@ -77,6 +84,7 @@ onStatisticsUpdated: new cr.EventTarget(), requestInfo: requestInfo, + triggerStoragePressure: triggerStoragePressure, messageHandler: messageHandler }; });
diff --git a/chrome/browser/resources/settings/autofill_page/password_check.html b/chrome/browser/resources/settings/autofill_page/password_check.html index 0323d45..d03a5525 100644 --- a/chrome/browser/resources/settings/autofill_page/password_check.html +++ b/chrome/browser/resources/settings/autofill_page/password_check.html
@@ -41,9 +41,10 @@ background: radial-gradient(circle 12px at 12px, #FCE8E6 100%, transparent 100%); + margin-inline-end: 16px; margin-inline-start: -4px; padding-bottom: 4px; - padding-inline-end: 20px; + padding-inline-end: 4px; padding-inline-start: 4px; padding-top: 4px; } @@ -66,6 +67,10 @@ display: none; } + #leakCheckHeader { + border-bottom: var(--cr-separator-line); + } + </style> <!-- The banner is visible if no compromised password was found (yet). --> <template is="dom-if" if="[[shouldShowBanner_(status, leakedPasswords)]]"> @@ -86,7 +91,7 @@ </template> <!-- Show a loader instead of an icon if passwords are still checked. --> - <template is="dom-if"if="[[isCheckInProgress_(status)]]"> + <template is="dom-if" if="[[isCheckInProgress_(status)]]"> <paper-spinner-lite id="progressSpinner" active> </paper-spinner-lite> </template> @@ -113,13 +118,13 @@ </div> <div id="noCompromisedCredentials" hidden$="[[!showNoCompromisedPasswordsLabel_]]"> - <div class="settings-box secondary"> + <div class="settings-box first secondary"> $i18n{noCompromisedCredentials} </div> </div> <div id="passwordCheckBody" hidden$="[[!hasLeakedCredentials_(leakedPasswords)]]"> - <div class="settings-box"> + <div class="settings-box first"> <h2 class="start">$i18n{compromisedPasswords}</h2> </div> <div class="list-frame vertical-list">
diff --git a/chrome/browser/resources/settings/autofill_page/password_check_behavior.js b/chrome/browser/resources/settings/autofill_page/password_check_behavior.js index 017beba..47e29390 100644 --- a/chrome/browser/resources/settings/autofill_page/password_check_behavior.js +++ b/chrome/browser/resources/settings/autofill_page/password_check_behavior.js
@@ -114,13 +114,22 @@ const addedResults = Array.from(map.values()); addedResults.sort((lhs, rhs) => { // Phished passwords are always shown above leaked passwords. - if (lhs.compromiseType !== rhs.compromiseType) { - return lhs.compromiseType === - chrome.passwordsPrivate.CompromiseType.PHISHED ? - -1 : - 1; + const isPhished = cred => + cred.compromiseType !== chrome.passwordsPrivate.CompromiseType.LEAKED; + if (isPhished(lhs) != isPhished(rhs)) { + return isPhished(lhs) ? -1 : 1; } - return rhs.compromiseTime - lhs.compromiseTime; + + // Sort by time only if the displayed elapsed time since compromise is + // different. + if (lhs.elapsedTimeSinceCompromise != rhs.elapsedTimeSinceCompromise) { + return rhs.compromiseTime - lhs.compromiseTime; + } + + // Otherwise sort by origin, or by username in case the origin is the + // same. + return lhs.formattedOrigin.localeCompare(rhs.formattedOrigin) || + lhs.username.localeCompare(rhs.username); }); resultList.push(...addedResults); this.leakedPasswords = resultList;
diff --git a/chrome/browser/resources/settings/autofill_page/password_check_list_item.html b/chrome/browser/resources/settings/autofill_page/password_check_list_item.html index 5ecf82d9..31a5841 100644 --- a/chrome/browser/resources/settings/autofill_page/password_check_list_item.html +++ b/chrome/browser/resources/settings/autofill_page/password_check_list_item.html
@@ -25,6 +25,7 @@ #leakedPassword { background-color: transparent; border: none; + font-size: inherit; margin-inline-start: 4px; } @@ -40,7 +41,7 @@ } #leakUsername { - align-items: center; + align-items: baseline; display: flex; flex: 1; } @@ -69,6 +70,10 @@ display: flex; justify-content: flex-end; } + + :host-context([dir='rtl']) #leakOrigin { + justify-content: flex-start; + } </style> <div class="list-item" id="leaked-item" focus-row-container> <site-favicon url="[[item.changePasswordUrl]]"></site-favicon>
diff --git a/chrome/browser/resources/settings/autofill_page/passwords_section.html b/chrome/browser/resources/settings/autofill_page/passwords_section.html index 05f50d5..e308f8e 100644 --- a/chrome/browser/resources/settings/autofill_page/passwords_section.html +++ b/chrome/browser/resources/settings/autofill_page/passwords_section.html
@@ -77,9 +77,10 @@ background: radial-gradient(circle 12px at 12px, rgb(252, 232, 230) 100%, transparent 100%); height: 16px; + margin-inline-end: 16px; margin-inline-start: -4px; padding-bottom: 4px; - padding-inline-end: 20px; + padding-inline-end: 4px; padding-inline-start: 4px; padding-top: 4px; width: 16px;
diff --git a/chrome/browser/resources/settings/autofill_page/passwords_shared_css.html b/chrome/browser/resources/settings/autofill_page/passwords_shared_css.html index 6c00e59b..a92b61fb 100644 --- a/chrome/browser/resources/settings/autofill_page/passwords_shared_css.html +++ b/chrome/browser/resources/settings/autofill_page/passwords_shared_css.html
@@ -65,7 +65,8 @@ } input.password-input, - cr-input.password-input::part(input) { + cr-input.password-input::part(input), + #leakedPassword { /* Since passwords are displayed with an input element, this is * necessary to prevent Chrome from using the operating system's font * instead of the Material Design font.
diff --git a/chrome/browser/resources/settings/chromeos/bluetooth_page/bluetooth_subpage.js b/chrome/browser/resources/settings/chromeos/bluetooth_page/bluetooth_subpage.js index cbc701f..8ec01be 100644 --- a/chrome/browser/resources/settings/chromeos/bluetooth_page/bluetooth_subpage.js +++ b/chrome/browser/resources/settings/chromeos/bluetooth_page/bluetooth_subpage.js
@@ -390,7 +390,8 @@ const address = device.address; this.bluetoothPrivate.connect(address, result => { if (isPaired) { - this.recordUserInitiatedReconnectionAttemptResult_(result); + const connectResult = chrome.runtime.lastError ? undefined : result; + chrome.bluetoothPrivate.recordReconnection(connectResult); } // If |pairingDevice_| has changed, ignore the connect result. @@ -514,36 +515,6 @@ }, /** - * Record metrics for user-initiated attempts to reconnect to an already - * paired device. - * @param {!chrome.bluetoothPrivate.ConnectResultType} result The connection - * result. - * @private - */ - recordUserInitiatedReconnectionAttemptResult_(result) { - let success; - if (chrome.runtime.lastError) { - success = false; - } else { - switch (result) { - case chrome.bluetoothPrivate.ConnectResultType.SUCCESS: - success = true; - break; - case chrome.bluetoothPrivate.ConnectResultType.AUTH_CANCELED: - case chrome.bluetoothPrivate.ConnectResultType.IN_PROGRESS: - // Don't record metrics until connection has ended, and don't record - // cancellations. - return; - default: - success = false; - break; - } - } - - chrome.bluetoothPrivate.recordReconnection(success); - }, - - /** * Record metrics for how long it took between when discovery started on the * Settings page, and the user selected the device they wanted to connect to. * @param {!boolean} wasPaired If the selected device was already
diff --git a/chrome/browser/resources/settings/chromeos/os_people_page/account_manager.html b/chrome/browser/resources/settings/chromeos/os_people_page/account_manager.html index a0e4c79..7596313 100644 --- a/chrome/browser/resources/settings/chromeos/os_people_page/account_manager.html +++ b/chrome/browser/resources/settings/chromeos/os_people_page/account_manager.html
@@ -101,6 +101,10 @@ color: var(--cr-secondary-text-color); } + .edu-account-label { + margin-inline-start: 12px; + } + .tooltip-primary-account { margin-inline-end: 12px; margin-inline-start: 12px; @@ -195,7 +199,8 @@ <!-- Display EDU account labels on secondary accounts for Child users --> <template is="dom-if" if="[[isChildUser_]]" restamp> - <span class="management-status" id="edu-account-label" + <span class="management-status edu-account-label" + id="edu-account-label-[[index]]" aria-hidden="true"> $i18n{accountManagerEducationAccountLabel} </span> @@ -203,7 +208,8 @@ <cr-icon-button class="icon-more-vert" title="[[getMoreActionsTitle_(item)]]" aria-label="[[getMoreActionsTitle_(item)]]" - aria-describedby$="fullName-[[index]] edu-account-label" + aria-describedby$="fullName-[[index]] + edu-account-label-[[index]]" on-click="onAccountActionsMenuButtonTap_"> </cr-icon-button> </template>
diff --git a/chrome/browser/resources/settings/chromeos/os_route.js b/chrome/browser/resources/settings/chromeos/os_route.js index b8ea4ae..0919191 100644 --- a/chrome/browser/resources/settings/chromeos/os_route.js +++ b/chrome/browser/resources/settings/chromeos/os_route.js
@@ -107,7 +107,7 @@ r.PRINTING = r.ADVANCED.createSection('/printing', 'printing'); - r.ACCESSIBILITY = r.ADVANCED.createSection('/accessibility', 'a11y'); + r.OS_ACCESSIBILITY = r.ADVANCED.createSection('/osAccessibility', 'a11y'); if (!loadTimeData.getBoolean('isGuest')) { if (loadTimeData.getBoolean('splitSettingsSyncEnabled')) { @@ -127,7 +127,7 @@ // Reset if (loadTimeData.valueExists('allowPowerwash') && loadTimeData.getBoolean('allowPowerwash')) { - r.RESET = r.ADVANCED.createSection('/reset', 'reset'); + r.OS_RESET = r.ADVANCED.createSection('/osReset', 'osReset'); } const showAppManagement = loadTimeData.valueExists('showAppManagement') && @@ -153,7 +153,7 @@ r.CUPS_PRINTERS = r.PRINTING.createChild('/cupsPrinters'); r.MANAGE_ACCESSIBILITY = - r.ACCESSIBILITY.createChild('/manageAccessibility'); + r.OS_ACCESSIBILITY.createChild('/manageAccessibility'); if (loadTimeData.getBoolean('showExperimentalAccessibilitySwitchAccess')) { r.MANAGE_SWITCH_ACCESS_SETTINGS = r.MANAGE_ACCESSIBILITY.createChild( '/manageAccessibility/switchAccess');
diff --git a/chrome/browser/resources/settings/chromeos/os_settings_menu/os_settings_menu.html b/chrome/browser/resources/settings/chromeos/os_settings_menu/os_settings_menu.html index 1c4e830..3ddae1e 100644 --- a/chrome/browser/resources/settings/chromeos/os_settings_menu/os_settings_menu.html +++ b/chrome/browser/resources/settings/chromeos/os_settings_menu/os_settings_menu.html
@@ -262,13 +262,13 @@ $i18n{printingPageTitle} </div> </a> - <a href="/accessibility"> + <a href="/osAccessibility"> <div class="item"> <iron-icon icon="settings:accessibility"></iron-icon> $i18n{a11yPageTitle} </div> </a> - <a id="reset" href="/reset" hidden="[[!showReset]]"> + <a id="osReset" href="/osReset" hidden="[[!showReset]]"> <div class="item"> <iron-icon icon="settings:restore"></iron-icon> $i18n{resetPageTitle}
diff --git a/chrome/browser/resources/settings/chromeos/os_settings_page/os_settings_page.html b/chrome/browser/resources/settings/chromeos/os_settings_page/os_settings_page.html index e8a8866..76dd95ba 100644 --- a/chrome/browser/resources/settings/chromeos/os_settings_page/os_settings_page.html +++ b/chrome/browser/resources/settings/chromeos/os_settings_page/os_settings_page.html
@@ -250,7 +250,7 @@ </settings-section> <template is="dom-if" if="[[showReset]]"> <settings-section page-title="$i18n{resetPageTitle}" - section="reset"> + section="osReset"> <os-settings-reset-page></os-settings-reset-page> </settings-section> </template>
diff --git a/chrome/browser/resources/settings/chromeos/os_settings_routes.js b/chrome/browser/resources/settings/chromeos/os_settings_routes.js index c1a4d621..1f29882 100644 --- a/chrome/browser/resources/settings/chromeos/os_settings_routes.js +++ b/chrome/browser/resources/settings/chromeos/os_settings_routes.js
@@ -8,7 +8,6 @@ * @typedef {{ * ABOUT: !settings.Route, * ABOUT_ABOUT: !settings.Route, - * ACCESSIBILITY: !settings.Route, * ACCOUNTS: !settings.Route, * ACCOUNT_MANAGER: !settings.Route, * ADVANCED: !settings.Route, @@ -53,6 +52,8 @@ * MULTIDEVICE: !settings.Route, * MULTIDEVICE_FEATURES: !settings.Route, * NETWORK_DETAIL: !settings.Route, + * OS_ACCESSIBILITY: !settings.Route, + * OS_RESET: !settings.Route, * OS_SYNC: !settings.Route, * PEOPLE: !settings.Route, * PERSONALIZATION: !settings.Route, @@ -63,7 +64,6 @@ * POWER: !settings.Route, * PRINTING: !settings.Route, * PRIVACY: !settings.Route, - * RESET: !settings.Route, * SEARCH: !settings.Route, * SIGN_OUT: !settings.Route, * SMART_LOCK: !settings.Route,
diff --git a/chrome/browser/resources/settings/privacy_page/cookies_page.html b/chrome/browser/resources/settings/privacy_page/cookies_page.html index c0c0dc38..e88c82e 100644 --- a/chrome/browser/resources/settings/privacy_page/cookies_page.html +++ b/chrome/browser/resources/settings/privacy_page/cookies_page.html
@@ -8,6 +8,7 @@ <link rel="import" href="chrome://resources/html/cr/ui/focus_without_ink.html"> <link rel="import" href="chrome://resources/html/web_ui_listener_behavior.html"> <link rel="import" href="../controls/settings_toggle_button.html"> +<link rel="import" href="../i18n_setup.html"> <link rel="import" href="../icons.html"> <link rel="import" href="../metrics_browser_proxy.html"> <link rel="import" href="../prefs/prefs.html"> @@ -72,29 +73,32 @@ </div> </div> </settings-collapse-radio-button> - <settings-collapse-radio-button id="blockThirdPartyIncognito" - name="[[cookiesControlEnum_.BLOCK_THIRD_PARTY_INCOGNITO]]" - label="$i18n{cookiePageBlockThirdIncognito}" - disabled="[[ - cookieControlsManagedState_.blockThirdPartyIncognito.disabled]]" - policy-indicator-type="[[ - cookieControlsManagedState_.blockThirdPartyIncognito.indicator - ]]"> - <div slot="collapse"> - <div class="bullet-line"> - <iron-icon icon="settings:cookie"></iron-icon> - <div class="secondary"> - $i18n{cookiePageBlockThirdIncognitoBulOne} + <template is="dom-if" if="[[improvedCookieControlsEnabled_]]"> + <settings-collapse-radio-button id="blockThirdPartyIncognito" + name="[[cookiesControlEnum_.BLOCK_THIRD_PARTY_INCOGNITO]]" + label="$i18n{cookiePageBlockThirdIncognito}" + disabled="[[ + cookieControlsManagedState_.blockThirdPartyIncognito.disabled + ]]" + policy-indicator-type="[[ + cookieControlsManagedState_.blockThirdPartyIncognito.indicator + ]]"> + <div slot="collapse"> + <div class="bullet-line"> + <iron-icon icon="settings:cookie"></iron-icon> + <div class="secondary"> + $i18n{cookiePageBlockThirdIncognitoBulOne} + </div> + </div> + <div class="bullet-line"> + <iron-icon icon="settings:block"></iron-icon> + <div class="secondary"> + $i18n{cookiePageBlockThirdIncognitoBulTwo} + </div> </div> </div> - <div class="bullet-line"> - <iron-icon icon="settings:block"></iron-icon> - <div class="secondary"> - $i18n{cookiePageBlockThirdIncognitoBulTwo} - </div> - </div> - </div> - </settings-collapse-radio-button> + </settings-collapse-radio-button> + </template> <settings-collapse-radio-button id="blockThirdParty" name="[[cookiesControlEnum_.BLOCK_THIRD_PARTY]]" label="$i18n{cookiePageBlockThird}"
diff --git a/chrome/browser/resources/settings/privacy_page/cookies_page.js b/chrome/browser/resources/settings/privacy_page/cookies_page.js index 76fa9d9..8d735d8 100644 --- a/chrome/browser/resources/settings/privacy_page/cookies_page.js +++ b/chrome/browser/resources/settings/privacy_page/cookies_page.js
@@ -124,6 +124,14 @@ notify: true, }, + /** @private */ + improvedCookieControlsEnabled_: { + type: Boolean, + value() { + return loadTimeData.getBoolean('improvedCookieControlsEnabled'); + } + }, + /** @type {!Map<string, (string|Function)>} */ focusConfig: { type: Object, @@ -197,7 +205,7 @@ } else if (blockThirdParty.value) { this.cookiesControlRadioSelected_ = this.cookiesControlEnum_.BLOCK_THIRD_PARTY; - } else if ( + } else if (this.improvedCookieControlsEnabled_ && controlMode.value === settings.CookieControlsMode.INCOGNITO_ONLY) { this.cookiesControlRadioSelected_ = this.cookiesControlEnum_.BLOCK_THIRD_PARTY_INCOGNITO;
diff --git a/chrome/browser/resources/settings/safety_check_page/BUILD.gn b/chrome/browser/resources/settings/safety_check_page/BUILD.gn index d96c1548..e0b26ce3 100644 --- a/chrome/browser/resources/settings/safety_check_page/BUILD.gn +++ b/chrome/browser/resources/settings/safety_check_page/BUILD.gn
@@ -94,6 +94,7 @@ "chrome/browser/resources/settings/open_window_proxy.html|OpenWindowProxyImpl", "chrome/browser/resources/settings/safety_check_page/safety_check_browser_proxy.html|SafetyCheckBrowserProxy,SafetyCheckBrowserProxyImpl,SafetyCheckExtensionsStatus,SafetyCheckPasswordsStatus,SafetyCheckUpdatesStatus,SafetyCheckSafeBrowsingStatus,SafetyCheckCallbackConstants", "ui/webui/resources/html/assert.html|assertNotReached", + "ui/webui/resources/html/polymer.html|Polymer,html,flush", ] namespace_rewrites = settings_namespace_rewrites }
diff --git a/chrome/browser/resources/settings/safety_check_page/safety_check_page.html b/chrome/browser/resources/settings/safety_check_page/safety_check_page.html index 618d156c..7ef30fd 100644 --- a/chrome/browser/resources/settings/safety_check_page/safety_check_page.html +++ b/chrome/browser/resources/settings/safety_check_page/safety_check_page.html
@@ -29,10 +29,6 @@ min-height: var(--settings-row-two-line-min-height); } - .focus-invisible { - outline: none; - } - iron-icon { display: flex; flex-shrink: 0; @@ -59,8 +55,7 @@ } } </style> - <div id="safetyCheckParent" tabindex="-1" - class="settings-box first two-line focus-invisible"> + <div id="safetyCheckParent" class="settings-box first two-line"> <iron-icon icon="settings20:safety-check" aria-hidden="true"> </iron-icon> <div class="start settings-box-text" no-search>
diff --git a/chrome/browser/resources/settings/safety_check_page/safety_check_page.js b/chrome/browser/resources/settings/safety_check_page/safety_check_page.js index a87b5fda..a779075 100644 --- a/chrome/browser/resources/settings/safety_check_page/safety_check_page.js +++ b/chrome/browser/resources/settings/safety_check_page/safety_check_page.js
@@ -306,7 +306,7 @@ * @return {boolean} */ shouldShowParentIconButton_: function() { - return this.parentStatus_ === ParentStatus.AFTER; + return this.parentStatus_ !== ParentStatus.BEFORE; }, /** @private */ @@ -314,14 +314,15 @@ settings.HatsBrowserProxyImpl.getInstance().tryShowSurvey(); this.runSafetyCheck_(); + Polymer.dom.flush(); this.focusParent_(); }, /** @private */ focusParent_() { - const parent = - /** @type {!Element} */ (this.$$('#safetyCheckParent')); - parent.focus(); + const element = + /** @type {!Element} */ (this.$$('#safetyCheckParentIconButton')); + element.focus(); }, /**
diff --git a/chrome/browser/resources/signin/signin_error/BUILD.gn b/chrome/browser/resources/signin/signin_error/BUILD.gn index a2e1707..14ad99a3 100644 --- a/chrome/browser/resources/signin/signin_error/BUILD.gn +++ b/chrome/browser/resources/signin/signin_error/BUILD.gn
@@ -5,13 +5,19 @@ import("//third_party/closure_compiler/compile_js.gni") js_type_check("closure_compile") { - deps = [ ":signin_error" ] + deps = [ + ":signin_error", + ":signin_error_app", + ] } js_library("signin_error") { + deps = [ "//ui/webui/resources/js:cr" ] +} + +js_library("signin_error_app") { deps = [ - "//ui/webui/resources/js:cr", "//ui/webui/resources/js:load_time_data", - "//ui/webui/resources/js:util", + "//ui/webui/resources/js:web_ui_listener_behavior", ] }
diff --git a/chrome/browser/resources/signin/signin_error/signin_error.html b/chrome/browser/resources/signin/signin_error/signin_error.html index 6c9d1c1..a17d628 100644 --- a/chrome/browser/resources/signin/signin_error/signin_error.html +++ b/chrome/browser/resources/signin/signin_error/signin_error.html
@@ -2,107 +2,26 @@ <html dir="$i18n{textdirection}" lang="$i18n{language}"> <head> <meta charset="utf-8"> - <link rel="import" href="chrome://resources/cr_elements/cr_button/cr_button.html"> - <link rel="import" href="chrome://resources/html/polymer.html"> - <link rel="import" href="chrome://resources/polymer/v1_0/paper-styles/color.html"> - <link rel="import" href="signin_shared_old_css.html"> <link rel="stylesheet" href="chrome://resources/css/md_colors.css"> - <link rel="stylesheet" href="chrome://resources/css/text_defaults_md.css"> - <link rel="import" href="chrome://resources/html/cr.html"> <link rel="import" href="chrome://resources/html/load_time_data.html"> - <link rel="import" href="chrome://resources/html/util.html"> - <custom-style> - <style include="signin-dialog-shared"> - @media (prefers-color-scheme: dark) { - html { - background: var(--md-background-color); - } - } + <script src="strings.js"></script> + <link rel="import" href="signin_error_app.html"> + <style> + body { + margin: 0; + } - .details { - line-height: 20px; - margin-bottom: 8px; - margin-top: 16px; - padding: 0 24px; + @media (prefers-color-scheme: dark) { + html { + background: var(--md-background-color); } - - .details p { - margin-bottom: 0; - } - - #closeButton { - margin-inline-start: 8px; - } - - #normal-error-message p:empty, - #normal-error-message a:empty { - display: none; - } - - #profile-blocking-error-message { - margin-top: 30px; - } - - #profile-blocking-error-message p { - background-position: 0 3px; - background-repeat: no-repeat; - background-size: 20px; - line-height: 18px; - padding-inline-start: 35px; - } - - html[dir=rtl] #profile-blocking-error-message p { - background-position: right 3px; - } - - #profile-blocking-error-message p:empty { - display: none; - } - - #profile-blocking-error-message p:nth-child(1) { - background-image: - url(../../../../../ui/webui/resources/images/business.svg); - } - - #profile-blocking-error-message p:nth-child(2) { - background-image: - url(../../../../../ui/webui/resources/images/info.svg); - } - -<if expr="is_macosx or is_linux"> - #closeButton { - margin-inline-end: 8px; - margin-inline-start: 0; - } -</if> - </style> - </custom-style> + } + </style> </head> <body> - <div class="container"> - <div class="top-title-bar">$i18n{signinErrorTitle}</div> - <div id="normal-error-message" class="details"> - <p>$i18nRaw{signinErrorMessage}</p> - <a id="learnMoreLink" href="#">$i18nRaw{signinErrorLearnMore}</a> - </div> - <div id="profile-blocking-error-message" class="details"> - <p>$i18n{profileBlockedMessage}</p> - <p>$i18n{profileBlockedAddPersonSuggestion}</p> - <p>$i18n{profileBlockedRemoveProfileSuggestion}</p> - </div> - <div class="action-container"> - <cr-button class="action-button" id="switchButton"> - $i18n{signinErrorSwitchLabel} - </cr-button> - <cr-button id="closeButton"> - $i18n{signinErrorCloseLabel} - </cr-button> - <cr-button id="confirmButton" hidden> - $i18n{signinErrorOkLabel} - </cr-button> - </div> - </div> + <signin-error-app></signin-error-app> </body> + <link rel="stylesheet" href="chrome://resources/css/text_defaults_md.css"> + <link rel="import" href="chrome://resources/html/cr.html"> <script src="signin_error.js"></script> - <script src="chrome://signin-error/strings.js"></script> </html>
diff --git a/chrome/browser/resources/signin/signin_error/signin_error.js b/chrome/browser/resources/signin/signin_error/signin_error.js index 7985b78..f264d64 100644 --- a/chrome/browser/resources/signin/signin_error/signin_error.js +++ b/chrome/browser/resources/signin/signin_error/signin_error.js
@@ -4,17 +4,7 @@ (function() { function initialize() { - document.addEventListener('keydown', onKeyDown); - $('confirmButton').addEventListener('click', onConfirm); - $('closeButton').addEventListener('click', onConfirm); - $('switchButton').addEventListener('click', onSwitchToExistingProfile); - $('learnMoreLink').addEventListener('click', onLearnMore); - if (loadTimeData.getBoolean('isSystemProfile')) { - $('learnMoreLink').hidden = true; - } - cr.addWebUIListener('clear-focus', clearFocus); - cr.addWebUIListener('switch-button-unavailable', removeSwitchButton); // Prefer using |document.body.offsetHeight| instead of // |document.body.scrollHeight| as it returns the correct height of the @@ -22,38 +12,9 @@ chrome.send('initializedWithSize', [document.body.offsetHeight]); } -function onKeyDown(e) { - // If the currently focused element isn't something that performs an action - // on "enter" being pressed and the user hits "enter", perform the default - // action of the dialog, which is "OK". - if (e.key == 'Enter' && - !/^(A|CR-BUTTON)$/.test(document.activeElement.tagName)) { - $('confirmButton').click(); - e.preventDefault(); - } -} - -function onConfirm(e) { - chrome.send('confirm'); -} - -function onSwitchToExistingProfile(e) { - chrome.send('switchToExistingProfile'); -} - -function onLearnMore(e) { - chrome.send('learnMore'); -} - function clearFocus() { document.activeElement.blur(); } -function removeSwitchButton() { - $('switchButton').hidden = true; - $('closeButton').hidden = true; - $('confirmButton').hidden = false; -} - document.addEventListener('DOMContentLoaded', initialize); })();
diff --git a/chrome/browser/resources/signin/signin_error/signin_error_app.html b/chrome/browser/resources/signin/signin_error/signin_error_app.html new file mode 100644 index 0000000..1178a94 --- /dev/null +++ b/chrome/browser/resources/signin/signin_error/signin_error_app.html
@@ -0,0 +1,98 @@ +<link rel="import" href="chrome://resources/html/polymer.html"> + +<link rel="import" href="chrome://resources/cr_elements/cr_button/cr_button.html"> +<link rel="import" href="chrome://resources/cr_elements/icons.html"> +<link rel="import" href="chrome://resources/cr_elements/shared_vars_css.html"> +<link rel="import" href="chrome://resources/html/load_time_data.html"> +<link rel="import" href="chrome://resources/html/web_ui_listener_behavior.html"> +<link rel="import" href="chrome://resources/polymer/v1_0/iron-icon/iron-icon.html"> +<link rel="import" href="signin_shared_old_css.html"> + +<dom-module id="signin-error-app"> + <template> + <style include="signin-dialog-shared"> + .details { + line-height: 20px; + margin-bottom: 8px; + margin-top: 16px; + padding: 0 24px; + } + + #normal-error-message > p { + margin-bottom: 0; + } + + #closeButton { + margin-inline-start: 8px; + } + + #profile-blocking-error-message { + margin-top: 30px; + } + + #profile-blocking-error-message > div { + align-items: center; + display: flex; + margin-top: 1em; + } + + iron-icon { + color: var(--cr-secondary-text-color); + flex-shrink: 0; + height: var(--cr-icon-size); + margin-inline-end: 16px; + width: var(--cr-icon-size); + } + +<if expr="is_macosx or is_linux"> + #closeButton { + margin-inline-end: 8px; + margin-inline-start: 0; + } +</if> + </style> + <div class="container"> + <div class="top-title-bar">$i18n{signinErrorTitle}</div> + <div id="normal-error-message" class="details" + hidden="[[hideNormalError_]]"> + <p>$i18nRaw{signinErrorMessage}</p> + <a id="learnMoreLink" href="#" on-click="onLearnMore_" + hidden="[[isSystemProfile_]]"> + $i18nRaw{signinErrorLearnMore} + </a> + </div> + <div id="profile-blocking-error-message" class="details" + hidden="[[hideProfileBlockingErrors_.0]]"> + <div hidden="[[hideProfileBlockingErrors_.1]]"> + <iron-icon icon="cr:domain"></iron-icon> + <span>$i18n{profileBlockedMessage}</span> + </div> + <div hidden="[[hideProfileBlockingErrors_.2]]"> + <iron-icon icon="cr:info"></iron-icon> + <span>$i18n{profileBlockedAddPersonSuggestion}</span> + </div> + <div hidden="[[hideProfileBlockingErrors_.3]]"> + <iron-icon icon="cr:info"></iron-icon> + <span>$i18n{profileBlockedRemoveProfileSuggestion}</span> + </div> + </div> + <div class="action-container"> + <cr-button class="action-button" id="switchButton" + hidden="[[switchButtonUnavailable_]]" + on-click="onSwitchToExistingProfile_"> + $i18n{signinErrorSwitchLabel} + </cr-button> + <cr-button id="closeButton" + hidden="[[switchButtonUnavailable_]]" + on-click="onConfirm_"> + $i18n{signinErrorCloseLabel} + </cr-button> + <cr-button id="confirmButton" hidden="[[!switchButtonUnavailable_]]" + on-click="onConfirm_"> + $i18n{signinErrorOkLabel} + </cr-button> + </div> + </div> + </template> + <script src="signin_error_app.js"></script> +</dom-module>
diff --git a/chrome/browser/resources/signin/signin_error/signin_error_app.js b/chrome/browser/resources/signin/signin_error/signin_error_app.js new file mode 100644 index 0000000..a5782fd --- /dev/null +++ b/chrome/browser/resources/signin/signin_error/signin_error_app.js
@@ -0,0 +1,100 @@ +// Copyright 2020 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +Polymer({ + is: 'signin-error-app', + + behaviors: [ + WebUIListenerBehavior, + ], + + properties: { + /** @private {boolean} */ + isSystemProfile_: { + type: Boolean, + value: () => loadTimeData.getBoolean('isSystemProfile'), + }, + + /** @private {boolean} */ + switchButtonUnavailable_: { + type: Boolean, + value: false, + }, + + /** @private */ + hideNormalError_: { + type: Boolean, + value: () => loadTimeData.getString('signinErrorMessage').length === 0, + }, + + /** + * An array of booleans indicating whether profile blocking messages should + * be hidden. Position 0 corresponds to the #profile-blocking-error-message + * container, and subsequent positions correspond to each of the 3 related + * messages respectively. + * @private {!Array<boolean>} + */ + hideProfileBlockingErrors_: { + type: Array, + value: function() { + const hide = [ + 'profileBlockedMessage', + 'profileBlockedAddPersonSuggestion', + 'profileBlockedRemoveProfileSuggestion', + ].map(id => loadTimeData.getString(id).length === 0); + + // Hide the container itself if all of each children are also hidden. + hide.unshift(hide.every(hideEntry => hideEntry)); + + return hide; + }, + }, + }, + + /** @private {?function(!Event)} */ + boundKeyDownHandler_: null, + + /** @override */ + attached() { + this.boundKeyDownHandler_ = this.onKeyDown_.bind(this); + document.addEventListener('keydown', this.boundKeyDownHandler_); + + this.addWebUIListener('switch-button-unavailable', () => { + this.switchButtonUnavailable_ = true; + }); + }, + + /** @override */ + detached() { + document.removeEventListener('keydown', this.boundKeyDownHandler_); + this.boundKeyDownHandler_ = null; + }, + + /** @private */ + onConfirm_() { + chrome.send('confirm'); + }, + + /** @private */ + onSwitchToExistingProfile_() { + chrome.send('switchToExistingProfile'); + }, + + /** @private */ + onLearnMore_() { + chrome.send('learnMore'); + }, + + /** + * @param {!Event} e + * @private + */ + onKeyDown_(e) { + if (e.key == 'Enter' && + !/^(A|CR-BUTTON)$/.test(e.composedPath()[0].tagName)) { + this.onConfirm_(); + e.preventDefault(); + } + }, +});
diff --git a/chrome/browser/safe_browsing/chrome_password_protection_service.cc b/chrome/browser/safe_browsing/chrome_password_protection_service.cc index d7dbf1c9..514654d 100644 --- a/chrome/browser/safe_browsing/chrome_password_protection_service.cc +++ b/chrome/browser/safe_browsing/chrome_password_protection_service.cc
@@ -12,7 +12,6 @@ #include "base/stl_util.h" #include "base/strings/string_number_conversions.h" #include "base/strings/stringprintf.h" -#include "base/strings/utf_string_conversions.h" #include "chrome/browser/browser_process.h" #include "chrome/browser/content_settings/host_content_settings_map_factory.h" #include "chrome/browser/extensions/api/safe_browsing_private/safe_browsing_private_event_router.h" @@ -1652,8 +1651,8 @@ } void ChromePasswordProtectionService::PersistPhishedSavedPasswordCredential( - const std::string& username, - const std::vector<std::string>& matching_domains) { + const std::vector<password_manager::MatchingReusedCredential>& + matching_reused_credentials) { if (!profile_) return; scoped_refptr<password_manager::PasswordStore> password_store = @@ -1663,10 +1662,9 @@ if (!password_store) { return; } - for (const std::string& domain : matching_domains) { + for (const auto& credential : matching_reused_credentials) { password_store->AddCompromisedCredentials( - {password_manager::GetSignonRealm(GURL(domain)), - base::ASCIIToUTF16(username), base::Time::Now(), + {credential.signon_realm, credential.username, base::Time::Now(), password_manager::CompromiseType::kPhished}); } }
diff --git a/chrome/browser/safe_browsing/chrome_password_protection_service.h b/chrome/browser/safe_browsing/chrome_password_protection_service.h index c9ab238..9b43b148 100644 --- a/chrome/browser/safe_browsing/chrome_password_protection_service.h +++ b/chrome/browser/safe_browsing/chrome_password_protection_service.h
@@ -17,6 +17,7 @@ #include "chrome/browser/security_events/security_event_recorder_factory.h" #include "components/password_manager/core/browser/hash_password_manager.h" #include "components/password_manager/core/browser/password_manager_metrics_util.h" +#include "components/password_manager/core/browser/password_reuse_detector.h" #include "components/password_manager/core/browser/password_store.h" #include "components/password_manager/core/common/password_manager_pref_names.h" #include "components/safe_browsing/buildflags.h" @@ -229,11 +230,11 @@ RequestOutcome* reason) const override; // Persist the phished saved password credential in the "compromised - // credentials" table. Calls the password store to add a row for each domain - // where the phished saved password is used on. + // credentials" table. Calls the password store to add a row for each + // MatchingReusedCredential where the phished saved password is used on. void PersistPhishedSavedPasswordCredential( - const std::string& username, - const std::vector<std::string>& matching_domains) override; + const std::vector<password_manager::MatchingReusedCredential>& + matching_reused_credentials) override; // Returns the profile PasswordStore associated with this instance. password_manager::PasswordStore* GetProfilePasswordStore() const;
diff --git a/chrome/browser/safe_browsing/chrome_password_protection_service_unittest.cc b/chrome/browser/safe_browsing/chrome_password_protection_service_unittest.cc index 64c71cb..258fd95 100644 --- a/chrome/browser/safe_browsing/chrome_password_protection_service_unittest.cc +++ b/chrome/browser/safe_browsing/chrome_password_protection_service_unittest.cc
@@ -309,19 +309,19 @@ void InitializeRequest(LoginReputationClientRequest::TriggerType trigger_type, PasswordType reused_password_type) { + std::vector<password_manager::MatchingReusedCredential> credentials = { + {"somedomain.com"}}; if (trigger_type == LoginReputationClientRequest::UNFAMILIAR_LOGIN_PAGE) { request_ = new PasswordProtectionRequest( web_contents(), GURL(kPhishingURL), GURL(), GURL(), kUserName, - PasswordType::PASSWORD_TYPE_UNKNOWN, - std::vector<std::string>({"somedomain.com"}), trigger_type, true, + PasswordType::PASSWORD_TYPE_UNKNOWN, credentials, trigger_type, true, service_.get(), 0); } else { ASSERT_EQ(LoginReputationClientRequest::PASSWORD_REUSE_EVENT, trigger_type); request_ = new PasswordProtectionRequest( web_contents(), GURL(kPhishingURL), GURL(), GURL(), kUserName, - reused_password_type, std::vector<std::string>({"somedomain.com"}), - trigger_type, + reused_password_type, credentials, trigger_type, /* password_field_exists*/ true, service_.get(), /*request_timeout_in_ms=*/0); } @@ -603,11 +603,11 @@ VerifyPersistPhishedSavedPasswordCredential) { service_->ConfigService(/*is_incognito=*/false, /*is_extended_reporting=*/true); + std::vector<password_manager::MatchingReusedCredential> credentials = { + {"http://example.com"}, {"http://2.example.com"}}; - std::vector<std::string> domains{"http://example.com", - "https://2.example.com"}; EXPECT_CALL(*password_store_, AddCompromisedCredentialsImpl(_)).Times(2); - service_->PersistPhishedSavedPasswordCredential("username", domains); + service_->PersistPhishedSavedPasswordCredential(credentials); } TEST_F(ChromePasswordProtectionServiceTest, VerifyCanSendSamplePing) {
diff --git a/chrome/browser/search/local_ntp_source.cc b/chrome/browser/search/local_ntp_source.cc index d239bb47..636c886 100644 --- a/chrome/browser/search/local_ntp_source.cc +++ b/chrome/browser/search/local_ntp_source.cc
@@ -84,10 +84,22 @@ using search_provider_logos::LogoMetadata; using search_provider_logos::LogoService; -const char kClockIconResourceName[] = "clock"; const char kGoogleGIconResourceName[] = "google_g"; -const char kSearchIconResourceName[] = "search"; +const char kBookmarkIconResourceName[] = "bookmark"; +const char kCalculatorIconResourceName[] = "calculator"; +const char kClockIconResourceName[] = "clock"; +const char kDriveDocsIconResourceName[] = "drive_docs"; +const char kDriveFolderIconResourceName[] = "drive_folder"; +const char kDriveFormIconResourceName[] = "drive_form"; +const char kDriveImageIconResourceName[] = "drive_image"; +const char kDriveLogoIconResourceName[] = "drive_logo"; +const char kDrivePdfIconResourceName[] = "drive_pdf"; +const char kDriveSheetsIconResourceName[] = "drive_sheets"; +const char kDriveSlidesIconResourceName[] = "drive_slides"; +const char kDriveVideoIconResourceName[] = "drive_video"; +const char kExtensionAppIconResourceName[] = "extension_app"; const char kPageIconResourceName[] = "page"; +const char kSearchIconResourceName[] = "search"; namespace { @@ -143,8 +155,30 @@ // added complexity. {chrome::kChromeSearchLocalNtpBackgroundFilename, kLocalResource, "image/jpg"}, - {kClockIconResourceName, IDR_LOCAL_NTP_ICONS_CLOCK, "image/svg+xml"}, {kGoogleGIconResourceName, IDR_WEBUI_IMAGES_200_LOGO_GOOGLE_G, "image/png"}, + {kBookmarkIconResourceName, IDR_LOCAL_NTP_ICONS_BOOKMARK, "image/svg+xml"}, + {kCalculatorIconResourceName, IDR_LOCAL_NTP_ICONS_CALCULATOR, + "image/svg+xml"}, + {kClockIconResourceName, IDR_LOCAL_NTP_ICONS_CLOCK, "image/svg+xml"}, + {kDriveDocsIconResourceName, IDR_LOCAL_NTP_ICONS_DRIVE_DOCS, + "image/svg+xml"}, + {kDriveFolderIconResourceName, IDR_LOCAL_NTP_ICONS_DRIVE_FOLDER, + "image/svg+xml"}, + {kDriveFormIconResourceName, IDR_LOCAL_NTP_ICONS_DRIVE_FORM, + "image/svg+xml"}, + {kDriveImageIconResourceName, IDR_LOCAL_NTP_ICONS_DRIVE_IMAGE, + "image/svg+xml"}, + {kDriveLogoIconResourceName, IDR_LOCAL_NTP_ICONS_DRIVE_LOGO, + "image/svg+xml"}, + {kDrivePdfIconResourceName, IDR_LOCAL_NTP_ICONS_DRIVE_PDF, "image/svg+xml"}, + {kDriveSheetsIconResourceName, IDR_LOCAL_NTP_ICONS_DRIVE_SHEETS, + "image/svg+xml"}, + {kDriveSlidesIconResourceName, IDR_LOCAL_NTP_ICONS_DRIVE_SLIDES, + "image/svg+xml"}, + {kDriveVideoIconResourceName, IDR_LOCAL_NTP_ICONS_DRIVE_VIDEO, + "image/svg+xml"}, + {kExtensionAppIconResourceName, IDR_LOCAL_NTP_ICONS_EXTENSION_APP, + "image/svg+xml"}, {kPageIconResourceName, IDR_LOCAL_NTP_ICONS_PAGE, "image/svg+xml"}, {kSearchIconResourceName, IDR_WEBUI_IMAGES_ICON_SEARCH, "image/svg+xml"}, };
diff --git a/chrome/browser/search/local_ntp_source.h b/chrome/browser/search/local_ntp_source.h index 0cf8ea0..ab61e1b4 100644 --- a/chrome/browser/search/local_ntp_source.h +++ b/chrome/browser/search/local_ntp_source.h
@@ -38,10 +38,22 @@ class LogoService; } // namespace search_provider_logos -extern const char kClockIconResourceName[]; extern const char kGoogleGIconResourceName[]; -extern const char kSearchIconResourceName[]; +extern const char kBookmarkIconResourceName[]; +extern const char kCalculatorIconResourceName[]; +extern const char kClockIconResourceName[]; +extern const char kDriveDocsIconResourceName[]; +extern const char kDriveFolderIconResourceName[]; +extern const char kDriveFormIconResourceName[]; +extern const char kDriveImageIconResourceName[]; +extern const char kDriveLogoIconResourceName[]; +extern const char kDrivePdfIconResourceName[]; +extern const char kDriveSheetsIconResourceName[]; +extern const char kDriveSlidesIconResourceName[]; +extern const char kDriveVideoIconResourceName[]; +extern const char kExtensionAppIconResourceName[]; extern const char kPageIconResourceName[]; +extern const char kSearchIconResourceName[]; // Serves HTML and resources for the local New Tab page, i.e. // chrome-search://local-ntp/local-ntp.html.
diff --git a/chrome/browser/settings/BUILD.gn b/chrome/browser/settings/BUILD.gn index 2adae39..b49326c 100644 --- a/chrome/browser/settings/BUILD.gn +++ b/chrome/browser/settings/BUILD.gn
@@ -17,6 +17,7 @@ sources = [ "android/java/src/org/chromium/chrome/browser/settings/ChromeBasePreferenceTest.java", + "android/java/src/org/chromium/chrome/browser/settings/ChromeImageViewPreferenceTest.java", "android/java/src/org/chromium/chrome/browser/settings/DummySettingsForTest.java", "android/java/src/org/chromium/chrome/browser/settings/ManagedPreferencesUtilsTest.java", ]
diff --git a/chrome/browser/settings/android/java/src/org/chromium/chrome/browser/settings/ChromeImageViewPreferenceTest.java b/chrome/browser/settings/android/java/src/org/chromium/chrome/browser/settings/ChromeImageViewPreferenceTest.java new file mode 100644 index 0000000..d84f0f09 --- /dev/null +++ b/chrome/browser/settings/android/java/src/org/chromium/chrome/browser/settings/ChromeImageViewPreferenceTest.java
@@ -0,0 +1,112 @@ +// Copyright 2020 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +package org.chromium.chrome.browser.settings; + +import static android.support.test.espresso.Espresso.onView; +import static android.support.test.espresso.assertion.ViewAssertions.matches; +import static android.support.test.espresso.matcher.ViewMatchers.isDisplayed; +import static android.support.test.espresso.matcher.ViewMatchers.withId; +import static android.support.test.espresso.matcher.ViewMatchers.withText; + +import static org.hamcrest.Matchers.allOf; + +import android.content.Context; +import android.content.Intent; +import android.support.test.InstrumentationRegistry; +import android.support.test.espresso.ViewInteraction; +import android.support.test.rule.ActivityTestRule; + +import androidx.preference.PreferenceFragmentCompat; +import androidx.preference.PreferenceScreen; +import androidx.test.filters.SmallTest; + +import org.junit.Assert; +import org.junit.Before; +import org.junit.Rule; +import org.junit.Test; +import org.junit.runner.RunWith; + +import org.chromium.chrome.test.ChromeJUnit4ClassRunner; +import org.chromium.components.browser_ui.settings.ChromeImageViewPreference; +import org.chromium.components.browser_ui.settings.R; + +/** + * Tests of {@link ChromeImageViewPreference}. + * + * TODO(chouinard): Once SettingsLauncher and SettingsActivity have compontentized interfaces, these + * tests should be moved to //components/browser_ui/settings/. + */ +@RunWith(ChromeJUnit4ClassRunner.class) +public class ChromeImageViewPreferenceTest { + @Rule + public ActivityTestRule<SettingsActivity> mRule = + new ActivityTestRule<>(SettingsActivity.class); + + private PreferenceScreen mPreferenceScreen; + private Context mContext; + + private static final String TITLE = "Preference Title"; + private static final String SUMMARY = "This is a summary."; + private static final int DRAWABLE_RES = R.drawable.ic_folder_blue_24dp; + private static final int CONTENT_DESCRIPTION_RES = R.string.ok; + + @Before + public void setUp() { + Intent intent = SettingsLauncher.getInstance().createIntentForSettingsPage( + InstrumentationRegistry.getInstrumentation().getContext(), + DummySettingsForTest.class.getName()); + mRule.launchActivity(intent); + + PreferenceFragmentCompat fragment = + (PreferenceFragmentCompat) mRule.getActivity().getMainFragment(); + mPreferenceScreen = fragment.getPreferenceScreen(); + mContext = fragment.getPreferenceManager().getContext(); + } + + @Test + @SmallTest + public void testChromeImageViewPreference() { + ChromeImageViewPreference preference = new ChromeImageViewPreference(mContext); + preference.setTitle(TITLE); + preference.setSummary(SUMMARY); + preference.setImageView(DRAWABLE_RES, CONTENT_DESCRIPTION_RES, null); + mPreferenceScreen.addPreference(preference); + + Assert.assertTrue(preference.isEnabled()); + + getTitleView().check(matches(allOf(withText(TITLE), isDisplayed()))); + getSummaryView().check(matches(allOf(withText(SUMMARY), isDisplayed()))); + getImageViewWidget().check(matches(isDisplayed())); + } + + @Test + @SmallTest + public void testChromeImageViewPreferenceManaged() { + ChromeImageViewPreference preference = new ChromeImageViewPreference(mContext); + preference.setTitle(TITLE); + preference.setImageView(DRAWABLE_RES, CONTENT_DESCRIPTION_RES, null); + preference.setManagedPreferenceDelegate(ManagedPreferencesUtilsTest.POLICY_DELEGATE); + mPreferenceScreen.addPreference(preference); + + Assert.assertFalse(preference.isEnabled()); + + getTitleView().check(matches(allOf(withText(TITLE), isDisplayed()))); + getSummaryView().check( + matches(allOf(withText(R.string.managed_by_your_organization), isDisplayed()))); + getImageViewWidget().check(matches(isDisplayed())); + } + + private ViewInteraction getTitleView() { + return onView(withId(android.R.id.title)); + } + + private ViewInteraction getSummaryView() { + return onView(withId(android.R.id.summary)); + } + + private ViewInteraction getImageViewWidget() { + return onView(withId(R.id.image_view_widget)); + } +}
diff --git a/chrome/browser/settings/android/java/src/org/chromium/chrome/browser/settings/ManagedPreferencesUtilsTest.java b/chrome/browser/settings/android/java/src/org/chromium/chrome/browser/settings/ManagedPreferencesUtilsTest.java index 78c03aad..d4e03d1 100644 --- a/chrome/browser/settings/android/java/src/org/chromium/chrome/browser/settings/ManagedPreferencesUtilsTest.java +++ b/chrome/browser/settings/android/java/src/org/chromium/chrome/browser/settings/ManagedPreferencesUtilsTest.java
@@ -18,8 +18,10 @@ import android.support.test.rule.ActivityTestRule; import androidx.preference.Preference; +import androidx.preference.PreferenceFragmentCompat; import androidx.test.filters.SmallTest; +import org.junit.Assert; import org.junit.Before; import org.junit.Rule; import org.junit.Test; @@ -44,6 +46,8 @@ public ActivityTestRule<SettingsActivity> mRule = new ActivityTestRule<>(SettingsActivity.class); + private Context mContext; + public static final ManagedPreferenceDelegate UNMANAGED_DELEGATE = new ManagedPreferenceDelegate() { @Override @@ -118,10 +122,14 @@ @Before public void setUp() { - Context context = InstrumentationRegistry.getInstrumentation().getContext(); Intent intent = SettingsLauncher.getInstance().createIntentForSettingsPage( - context, DummySettingsForTest.class.getName()); + InstrumentationRegistry.getInstrumentation().getContext(), + DummySettingsForTest.class.getName()); mRule.launchActivity(intent); + + PreferenceFragmentCompat fragment = + (PreferenceFragmentCompat) mRule.getActivity().getMainFragment(); + mContext = fragment.getPreferenceScreen().getContext(); } @Test @@ -185,4 +193,30 @@ .inRoot(withDecorView(not(mRule.getActivity().getWindow().getDecorView()))) .check(matches(isDisplayed())); } + + @Test + @SmallTest + public void testGetManagedIconIdNull() { + Preference pref = new Preference(mContext); + int actual = ManagedPreferencesUtils.getManagedIconResId(null, pref); + Assert.assertEquals(0, actual); + } + + @Test + @SmallTest + public void testGetManagedIconIdPolicy() { + Preference pref = new Preference(mContext); + int expected = ManagedPreferencesUtils.getManagedByEnterpriseIconId(); + int actual = ManagedPreferencesUtils.getManagedIconResId(POLICY_DELEGATE, pref); + Assert.assertEquals(expected, actual); + } + + @Test + @SmallTest + public void testGetManagedIconIdCustodian() { + Preference pref = new Preference(mContext); + int expected = ManagedPreferencesUtils.getManagedByCustodianIconId(); + int actual = ManagedPreferencesUtils.getManagedIconResId(SINGLE_CUSTODIAN_DELEGATE, pref); + Assert.assertEquals(expected, actual); + } }
diff --git a/chrome/browser/share/android/java/src/org/chromium/chrome/browser/share/ShareImageFileUtils.java b/chrome/browser/share/android/java/src/org/chromium/chrome/browser/share/ShareImageFileUtils.java index 9491202..a2a6d8a3 100644 --- a/chrome/browser/share/android/java/src/org/chromium/chrome/browser/share/ShareImageFileUtils.java +++ b/chrome/browser/share/android/java/src/org/chromium/chrome/browser/share/ShareImageFileUtils.java
@@ -118,16 +118,17 @@ } /** - * Temporarily saves the given set of JPEG bytes and provides that URI to a callback for + * Temporarily saves the given set of image bytes and provides that URI to a callback for * sharing. * * @param context The context used to trigger the share action. - * @param jpegImageData The image data to be shared in jpeg format. + * @param imageData The image data to be shared in |fileExtension| format. + * @param fileExtension File extension which |imageData| encoded to. * @param callback A provided callback function which will act on the generated URI. */ - public static void generateTemporaryUriFromData( - final Context context, final byte[] jpegImageData, Callback<Uri> callback) { - if (jpegImageData.length == 0) { + public static void generateTemporaryUriFromData(final Context context, final byte[] imageData, + String fileExtension, Callback<Uri> callback) { + if (imageData.length == 0) { Log.w(TAG, "Share failed -- Received image contains no data."); return; } @@ -146,7 +147,7 @@ saveImage(fileName, () -> { return ""; }, - listener, (fos) -> { writeImageData(fos, jpegImageData); }, true); + listener, (fos) -> { writeImageData(fos, imageData); }, true, fileExtension); } /** @@ -166,7 +167,7 @@ -> { return context.getExternalFilesDir(Environment.DIRECTORY_DOWNLOADS).getPath(); }, - listener, (fos) -> { writeBitmap(fos, bitmap); }, false); + listener, (fos) -> { writeBitmap(fos, bitmap); }, false, JPEG_EXTENSION); } /** @@ -199,16 +200,19 @@ * @param listener The OnImageSaveListener to notify the download results. * @param writer The FileOutputStreamWriter that writes to given stream. * @param isTemporary Indicates whether image should be save to a temporary file. + * @param fileExtension The file's extension. */ private static void saveImage(String fileName, FilePathProvider filePathProvider, - OnImageSaveListener listener, FileOutputStreamWriter writer, boolean isTemporary) { + OnImageSaveListener listener, FileOutputStreamWriter writer, boolean isTemporary, + String fileExtension) { new AsyncTask<Uri>() { @Override protected Uri doInBackground() { FileOutputStream fOut = null; File destFile = null; try { - destFile = createFile(fileName, filePathProvider.getPath(), isTemporary); + destFile = createFile( + fileName, filePathProvider.getPath(), isTemporary, fileExtension); if (destFile != null && destFile.exists()) { fOut = new FileOutputStream(destFile); writer.write(fOut); @@ -267,11 +271,12 @@ * @param filePath The file path a destination file. * @param fileName The file name a destination file. * @param isTemporary Indicates whether image should be save to a temporary file. + * @param fileExtension The file's extension. * * @return The new File object. */ - private static File createFile(String fileName, String filePath, boolean isTemporary) - throws IOException { + private static File createFile(String fileName, String filePath, boolean isTemporary, + String fileExtension) throws IOException { File path; if (filePath.isEmpty()) { path = getSharedFilesDirectory(); @@ -282,9 +287,9 @@ File newFile = null; if (path.exists() || path.mkdir()) { if (isTemporary) { - newFile = File.createTempFile(fileName, JPEG_EXTENSION, path); + newFile = File.createTempFile(fileName, fileExtension, path); } else { - newFile = getNextAvailableFile(filePath, fileName, JPEG_EXTENSION); + newFile = getNextAvailableFile(filePath, fileName, fileExtension); } }
diff --git a/chrome/browser/share/android/javatests/src/org/chromium/chrome/browser/share/ShareImageFileUtilsTest.java b/chrome/browser/share/android/javatests/src/org/chromium/chrome/browser/share/ShareImageFileUtilsTest.java index 47b5262..ae88a69 100644 --- a/chrome/browser/share/android/javatests/src/org/chromium/chrome/browser/share/ShareImageFileUtilsTest.java +++ b/chrome/browser/share/android/javatests/src/org/chromium/chrome/browser/share/ShareImageFileUtilsTest.java
@@ -60,7 +60,9 @@ private static final long WAIT_TIMEOUT_SECONDS = 30L; private static final byte[] TEST_IMAGE_DATA = new byte[] {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}; private static final String TEST_IMAGE_FILE_NAME = "chrome-test-bitmap"; - private static final String TEST_IMAGE_FILE_EXTENSION = ".jpg"; + private static final String TEST_GIF_IMAGE_FILE_EXTENSION = ".gif"; + private static final String TEST_JPG_IMAGE_FILE_EXTENSION = ".jpg"; + private static final String TEST_PNG_IMAGE_FILE_EXTENSION = ".png"; private class FileProviderHelper implements ContentUriUtils.FileProviderUtil { private static final String API_AUTHORITY_SUFFIX = ".FileProvider"; @@ -132,15 +134,19 @@ return false; } - private Uri generateAnImageToClipboard() throws TimeoutException { + private Uri generateAnImageToClipboard(String fileExtension) throws TimeoutException { GenerateUriCallback imageCallback = new GenerateUriCallback(); ShareImageFileUtils.generateTemporaryUriFromData( - mActivityTestRule.getActivity(), TEST_IMAGE_DATA, imageCallback); + mActivityTestRule.getActivity(), TEST_IMAGE_DATA, fileExtension, imageCallback); imageCallback.waitForCallback(0, 1, WAIT_TIMEOUT_SECONDS, TimeUnit.SECONDS); Clipboard.getInstance().setImageUri(imageCallback.getImageUri()); return imageCallback.getImageUri(); } + private Uri generateAnImageToClipboard() throws TimeoutException { + return generateAnImageToClipboard(TEST_JPG_IMAGE_FILE_EXTENSION); + } + private void clearSharedImages() throws TimeoutException { ShareImageFileUtils.clearSharedImages(); @@ -212,9 +218,12 @@ @Test @SmallTest public void clipboardUriDoNotClearTest() throws TimeoutException, IOException { - generateAnImageToClipboard(); - generateAnImageToClipboard(); - Uri clipboardUri = generateAnImageToClipboard(); + Uri clipboardUri = generateAnImageToClipboard(TEST_GIF_IMAGE_FILE_EXTENSION); + Assert.assertTrue(clipboardUri.getPath().endsWith(TEST_GIF_IMAGE_FILE_EXTENSION)); + clipboardUri = generateAnImageToClipboard(TEST_JPG_IMAGE_FILE_EXTENSION); + Assert.assertTrue(clipboardUri.getPath().endsWith(TEST_JPG_IMAGE_FILE_EXTENSION)); + clipboardUri = generateAnImageToClipboard(TEST_PNG_IMAGE_FILE_EXTENSION); + Assert.assertTrue(clipboardUri.getPath().endsWith(TEST_PNG_IMAGE_FILE_EXTENSION)); Assert.assertEquals(3, fileCountInShareDirectory()); clearSharedImages(); @@ -286,7 +295,7 @@ uri, null, null, null, null); Assert.assertNotNull(cursor); Assert.assertTrue(cursor.moveToFirst()); - Assert.assertEquals(fileName + TEST_IMAGE_FILE_EXTENSION, + Assert.assertEquals(fileName + TEST_JPG_IMAGE_FILE_EXTENSION, cursor.getString(cursor.getColumnIndex( MediaStore.MediaColumns.DISPLAY_NAME))); }); @@ -315,11 +324,11 @@ File externalStorageDir = mActivityTestRule.getActivity().getExternalFilesDir( Environment.DIRECTORY_DOWNLOADS); File imageFile = ShareImageFileUtils.getNextAvailableFile( - externalStorageDir.getPath(), fileName, TEST_IMAGE_FILE_EXTENSION); + externalStorageDir.getPath(), fileName, TEST_JPG_IMAGE_FILE_EXTENSION); Assert.assertTrue(imageFile.exists()); File imageFile2 = ShareImageFileUtils.getNextAvailableFile( - externalStorageDir.getPath(), fileName, TEST_IMAGE_FILE_EXTENSION); + externalStorageDir.getPath(), fileName, TEST_JPG_IMAGE_FILE_EXTENSION); Assert.assertTrue(imageFile2.exists()); Assert.assertNotEquals(imageFile.getPath(), imageFile2.getPath()); } @@ -329,7 +338,7 @@ @DisableIf.Build(sdk_is_greater_than = 28) public void testAddCompletedDownload() throws IOException { String filename = - TEST_IMAGE_FILE_NAME + "_add_completed_download" + TEST_IMAGE_FILE_EXTENSION; + TEST_IMAGE_FILE_NAME + "_add_completed_download" + TEST_JPG_IMAGE_FILE_EXTENSION; File externalStorageDir = mActivityTestRule.getActivity().getExternalFilesDir( Environment.DIRECTORY_DOWNLOADS); File qrcodeFile = new File(externalStorageDir, filename);
diff --git a/chrome/browser/storage/storage_notification_service_impl.cc b/chrome/browser/storage/storage_notification_service_impl.cc index 91c2b5e..c5255b25 100644 --- a/chrome/browser/storage/storage_notification_service_impl.cc +++ b/chrome/browser/storage/storage_notification_service_impl.cc
@@ -4,23 +4,44 @@ #include "chrome/browser/storage/storage_notification_service_impl.h" +#include "base/command_line.h" +#include "base/strings/string_number_conversions.h" #include "base/time/time.h" #include "build/build_config.h" #include "chrome/browser/profiles/profile.h" +#include "chrome/common/chrome_switches.h" #if !defined(OS_ANDROID) #include "chrome/browser/ui/storage_pressure_bubble.h" #endif +namespace { + // Minimum interval between consecutive storage pressure notifications. const base::TimeDelta kDiskPressureNotificationInterval = base::TimeDelta::FromDays(1); +const base::TimeDelta GetThrottlingInterval() { + base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); + int int_value; + if (command_line->HasSwitch(switches::kStoragePressureNotificationInterval)) { + const std::string string_value = command_line->GetSwitchValueASCII( + switches::kStoragePressureNotificationInterval); + if (base::StringToInt(string_value, &int_value) && int_value >= 0) { + return base::TimeDelta::FromMinutes(int_value); + } + } + return kDiskPressureNotificationInterval; +} + +} // namespace + void StorageNotificationServiceImpl::MaybeShowStoragePressureNotification( const url::Origin origin) { if (base::TimeTicks::Now() - disk_pressure_notification_last_sent_at_ < - kDiskPressureNotificationInterval) + GetThrottlingInterval()) { return; + } chrome::ShowStoragePressureBubble(origin); disk_pressure_notification_last_sent_at_ = base::TimeTicks::Now();
diff --git a/chrome/browser/storage_access_api/storage_access_grant_permission_context_unittest.cc b/chrome/browser/storage_access_api/storage_access_grant_permission_context_unittest.cc index 4fdafbf..0bd4f5c 100644 --- a/chrome/browser/storage_access_api/storage_access_grant_permission_context_unittest.cc +++ b/chrome/browser/storage_access_api/storage_access_grant_permission_context_unittest.cc
@@ -17,6 +17,7 @@ constexpr char kInsecureURL[] = "http://www.example.com"; constexpr char kSecureURL[] = "https://www.example.com"; +constexpr char kAlternateURL[] = "https://embedder_example.test"; void SaveResult(ContentSetting* content_setting_result, ContentSetting content_setting) { @@ -91,9 +92,12 @@ permissions::PermissionRequestID fake_id( /*render_process_id=*/0, /*render_frame_id=*/0, /*request_id=*/0); + const GURL requesting_origin(kAlternateURL); + const GURL embedding_origin(kSecureURL); + ContentSetting result = CONTENT_SETTING_DEFAULT; permission_context.DecidePermission( - web_contents(), fake_id, GURL(kSecureURL), GURL(kSecureURL), + web_contents(), fake_id, requesting_origin, embedding_origin, /*user_gesture=*/true, base::BindOnce(&SaveResult, &result)); base::RunLoop().RunUntilIdle(); @@ -103,6 +107,18 @@ DCHECK(manager); EXPECT_TRUE(manager->IsRequestInProgress()); + // Verify the prompt is showing text that includes both of the origins we + // expect. + permissions::PermissionRequest* request = manager->Requests().front(); + ASSERT_TRUE(request); + ASSERT_EQ(1u, manager->Requests().size()); + EXPECT_NE(request->GetMessageTextFragment().find( + base::UTF8ToUTF16(requesting_origin.host())), + base::string16::npos); + EXPECT_NE(request->GetMessageTextFragment().find( + base::UTF8ToUTF16(embedding_origin.host())), + base::string16::npos); + // Close the prompt and validate we get the expected setting back in our // callback. manager->Closing();
diff --git a/chrome/browser/ui/BUILD.gn b/chrome/browser/ui/BUILD.gn index 6aed9717..7aba2d7 100644 --- a/chrome/browser/ui/BUILD.gn +++ b/chrome/browser/ui/BUILD.gn
@@ -1085,6 +1085,8 @@ "passwords/bubble_controllers/items_bubble_controller.h", "passwords/bubble_controllers/password_bubble_controller_base.cc", "passwords/bubble_controllers/password_bubble_controller_base.h", + "passwords/bubble_controllers/save_unsynced_credentials_locally_bubble_controller.cc", + "passwords/bubble_controllers/save_unsynced_credentials_locally_bubble_controller.h", "passwords/bubble_controllers/save_update_bubble_controller.cc", "passwords/bubble_controllers/save_update_bubble_controller.h", "passwords/bubble_controllers/save_update_with_account_store_bubble_controller.cc", @@ -2215,6 +2217,8 @@ "webui/discards/discards_ui.h", "webui/discards/graph_dump_impl.cc", "webui/discards/graph_dump_impl.h", + "webui/discards/site_data_provider_impl.cc", + "webui/discards/site_data_provider_impl.h", "webui/signin/inline_login_handler.cc", "webui/signin/inline_login_handler.h", "webui/signin/inline_login_ui.cc", @@ -3210,6 +3214,8 @@ "views/passwords/password_generation_popup_view_views.h", "views/passwords/password_items_view.cc", "views/passwords/password_items_view.h", + "views/passwords/password_save_unsynced_credentials_locally_view.cc", + "views/passwords/password_save_unsynced_credentials_locally_view.h", "views/passwords/password_save_update_view.cc", "views/passwords/password_save_update_view.h", "views/passwords/password_save_update_with_account_store_view.cc",
diff --git a/chrome/browser/ui/android/context_menu_helper.cc b/chrome/browser/ui/android/context_menu_helper.cc index 5fad1b44..fb018a93 100644 --- a/chrome/browser/ui/android/context_menu_helper.cc +++ b/chrome/browser/ui/android/context_menu_helper.cc
@@ -9,10 +9,12 @@ #include <map> #include "base/android/callback_android.h" +#include "base/android/jni_array.h" #include "base/android/jni_string.h" #include "base/bind.h" #include "base/bind_helpers.h" #include "base/callback.h" +#include "base/strings/string_util.h" #include "chrome/android/chrome_jni_headers/ContextMenuHelper_jni.h" #include "chrome/browser/download/android/download_controller_base.h" #include "chrome/browser/image_decoder/image_decoder.h" @@ -39,6 +41,22 @@ namespace { +chrome::mojom::ImageFormat ToChromeMojomImageFormat(int image_format) { + ContextMenuImageFormat format = + static_cast<ContextMenuImageFormat>(image_format); + switch (format) { + case ContextMenuImageFormat::JPEG: + return chrome::mojom::ImageFormat::JPEG; + case ContextMenuImageFormat::PNG: + return chrome::mojom::ImageFormat::PNG; + case ContextMenuImageFormat::ORIGINAL: + return chrome::mojom::ImageFormat::ORIGINAL; + } + + NOTREACHED(); + return chrome::mojom::ImageFormat::JPEG; +} + class ContextMenuHelperImageRequest : public ImageDecoder::ImageRequest { public: static void Start(const base::android::JavaRef<jobject>& jcallback, @@ -76,8 +94,16 @@ chrome_render_frame, const base::android::JavaRef<jobject>& jcallback, const std::vector<uint8_t>& thumbnail_data, - const gfx::Size& original_size) { - base::android::RunByteArrayCallbackAndroid(jcallback, thumbnail_data); + const gfx::Size& original_size, + const std::string& image_extension) { + JNIEnv* env = base::android::AttachCurrentThread(); + base::android::ScopedJavaLocalRef<jbyteArray> j_data = + base::android::ToJavaByteArray(env, thumbnail_data); + base::android::ScopedJavaLocalRef<jstring> j_extension = + base::android::ConvertUTF8ToJavaString(env, image_extension); + base::android::RunObjectCallbackAndroid( + jcallback, Java_ContextMenuHelper_createImageCallbackResult(env, j_data, + j_extension)); } void OnRetrieveImageForContextMenu( @@ -85,7 +111,8 @@ chrome_render_frame, const base::android::JavaRef<jobject>& jcallback, const std::vector<uint8_t>& thumbnail_data, - const gfx::Size& original_size) { + const gfx::Size& original_size, + const std::string& filename_extension) { ContextMenuHelperImageRequest::Start(jcallback, thumbnail_data); } @@ -178,9 +205,11 @@ const JavaParamRef<jobject>& obj, const JavaParamRef<jobject>& jcallback, jint max_width_px, - jint max_height_px) { + jint max_height_px, + jint j_image_format) { RetrieveImageInternal(env, base::Bind(&OnRetrieveImageForShare), jcallback, - max_width_px, max_height_px); + max_width_px, max_height_px, + ToChromeMojomImageFormat(j_image_format)); } void ContextMenuHelper::RetrieveImageForContextMenu( @@ -189,8 +218,10 @@ const JavaParamRef<jobject>& jcallback, jint max_width_px, jint max_height_px) { + // For context menu, Image needs to be PNG for receiving transparency pixels. RetrieveImageInternal(env, base::Bind(&OnRetrieveImageForContextMenu), - jcallback, max_width_px, max_height_px); + jcallback, max_width_px, max_height_px, + chrome::mojom::ImageFormat::PNG); } void ContextMenuHelper::RetrieveImageInternal( @@ -198,23 +229,25 @@ const ImageRetrieveCallback& retrieve_callback, const JavaParamRef<jobject>& jcallback, jint max_width_px, - jint max_height_px) { + jint max_height_px, + chrome::mojom::ImageFormat image_format) { content::RenderFrameHost* render_frame_host = content::RenderFrameHost::FromID(render_process_id_, render_frame_id_); if (!render_frame_host) return; - mojo::AssociatedRemote<chrome::mojom::ChromeRenderFrame> chrome_render_frame; render_frame_host->GetRemoteAssociatedInterfaces()->GetInterface( &chrome_render_frame); + // Bind the InterfacePtr into the callback so that it's kept alive // until there's either a connection error or a response. auto* thumbnail_capturer_proxy = chrome_render_frame.get(); - thumbnail_capturer_proxy->RequestThumbnailForContextNode( - 0, gfx::Size(max_width_px, max_height_px), - chrome::mojom::ImageFormat::PNG, - base::Bind(retrieve_callback, base::Passed(&chrome_render_frame), - base::android::ScopedJavaGlobalRef<jobject>(env, jcallback))); + thumbnail_capturer_proxy->RequestImageForContextNode( + max_width_px * max_height_px, gfx::Size(max_width_px, max_height_px), + image_format, + base::BindOnce( + retrieve_callback, base::Passed(&chrome_render_frame), + base::android::ScopedJavaGlobalRef<jobject>(env, jcallback))); } WEB_CONTENTS_USER_DATA_KEY_IMPL(ContextMenuHelper)
diff --git a/chrome/browser/ui/android/context_menu_helper.h b/chrome/browser/ui/android/context_menu_helper.h index 71d645b..a9c86d52 100644 --- a/chrome/browser/ui/android/context_menu_helper.h +++ b/chrome/browser/ui/android/context_menu_helper.h
@@ -24,6 +24,13 @@ class WebContents; } +// GENERATED_JAVA_ENUM_PACKAGE: org.chromium.chrome.browser.contextmenu +enum ContextMenuImageFormat { + JPEG = 0, + PNG = 1, + ORIGINAL = 2, +}; + class ContextMenuHelper : public content::WebContentsUserData<ContextMenuHelper> { protected: @@ -32,7 +39,8 @@ chrome_render_frame_ptr, const base::android::JavaRef<jobject>& jcallback, const std::vector<uint8_t>& thumbnail_data, - const gfx::Size& max_dimen_px)>; + const gfx::Size& max_dimen_px, + const std::string& image_extension)>; public: ~ContextMenuHelper() override; @@ -53,30 +61,36 @@ const base::android::JavaParamRef<jobject>& obj, jboolean jis_link, jboolean jis_data_reduction_proxy_enabled); + void SearchForImage(JNIEnv* env, + const base::android::JavaParamRef<jobject>& obj); void RetrieveImageForShare( JNIEnv* env, const base::android::JavaParamRef<jobject>& obj, const base::android::JavaParamRef<jobject>& jcallback, jint max_width_px, - jint max_height_px); + jint max_height_px, + jint j_image_type); void RetrieveImageForContextMenu( JNIEnv* env, const base::android::JavaParamRef<jobject>& obj, const base::android::JavaParamRef<jobject>& jcallback, jint max_width_px, jint max_height_px); + + private: + explicit ContextMenuHelper(content::WebContents* web_contents); + friend class content::WebContentsUserData<ContextMenuHelper>; + void RetrieveImageInternal( JNIEnv* env, const ImageRetrieveCallback& retrieve_callback, const base::android::JavaParamRef<jobject>& jcallback, jint max_width_px, - jint max_height_px); - void SearchForImage(JNIEnv* env, - const base::android::JavaParamRef<jobject>& obj); + jint max_height_px, + chrome::mojom::ImageFormat image_format); - private: - explicit ContextMenuHelper(content::WebContents* web_contents); - friend class content::WebContentsUserData<ContextMenuHelper>; + mojo::AssociatedRemote<chrome::mojom::ChromeRenderFrame> + GetChromeRenderFrame() const; base::android::ScopedJavaGlobalRef<jobject> java_obj_; content::WebContents* web_contents_;
diff --git a/chrome/browser/ui/app_list/app_list_client_impl_browsertest.cc b/chrome/browser/ui/app_list/app_list_client_impl_browsertest.cc index 7bad64a..6848f92 100644 --- a/chrome/browser/ui/app_list/app_list_client_impl_browsertest.cc +++ b/chrome/browser/ui/app_list/app_list_client_impl_browsertest.cc
@@ -22,7 +22,7 @@ #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/app_service_proxy_factory.h" -#include "chrome/browser/apps/launch_service/launch_service.h" +#include "chrome/browser/apps/app_service/launch_utils.h" #include "chrome/browser/apps/platform_apps/app_browsertest_util.h" #include "chrome/browser/browser_process.h" #include "chrome/browser/chromeos/login/demo_mode/demo_session.h" @@ -56,6 +56,8 @@ #include "extensions/common/constants.h" #include "ui/aura/window.h" #include "ui/base/models/simple_menu_model.h" +#include "ui/display/display.h" +#include "ui/display/screen.h" #include "ui/wm/core/window_util.h" // Browser Test for AppListClientImpl. @@ -74,11 +76,15 @@ content::WindowedNotificationObserver app_loaded_observer( content::NOTIFICATION_LOAD_COMPLETED_MAIN_FRAME, content::NotificationService::AllSources()); - apps::LaunchService::Get(profile())->OpenApplication(apps::AppLaunchParams( - extension_app->id(), - apps::mojom::LaunchContainer::kLaunchContainerWindow, - WindowOpenDisposition::NEW_WINDOW, - apps::mojom::AppLaunchSource::kSourceTest)); + apps::AppServiceProxy* proxy = + apps::AppServiceProxyFactory::GetForProfile(profile()); + proxy->Launch(extension_app->id(), + apps::GetEventFlags( + apps::mojom::LaunchContainer::kLaunchContainerWindow, + WindowOpenDisposition::NEW_WINDOW, + false /* preferred_containner */), + apps::mojom::LaunchSource::kFromTest, + display::Screen::GetScreen()->GetPrimaryDisplay().id()); app_loaded_observer.Wait(); } EXPECT_TRUE(delegate->IsAppOpen(extension_app->id()));
diff --git a/chrome/browser/ui/app_list/app_list_controller_delegate.cc b/chrome/browser/ui/app_list/app_list_controller_delegate.cc index 781f9bee..3822e47 100644 --- a/chrome/browser/ui/app_list/app_list_controller_delegate.cc +++ b/chrome/browser/ui/app_list/app_list_controller_delegate.cc
@@ -22,6 +22,7 @@ #include "chrome/browser/ui/ash/tablet_mode_page_behavior.h" #include "chrome/browser/ui/chrome_pages.h" #include "chrome/browser/ui/webui/settings/chromeos/app_management/app_management_uma.h" +#include "chrome/browser/web_applications/components/app_registrar.h" #include "chrome/browser/web_applications/components/web_app_utils.h" #include "chrome/browser/web_applications/web_app_provider.h" #include "chrome/common/chrome_features.h" @@ -104,9 +105,9 @@ chrome::ShowAppManagementPage(profile, app_id); - web_app::AppRegistrar& registrar = - web_app::WebAppProvider::Get(profile)->registrar(); - if (registrar.IsInstalled(app_id)) { + web_app::WebAppProvider* web_app_provider = + web_app::WebAppProvider::Get(profile); + if (web_app_provider && web_app_provider->registrar().IsInstalled(app_id)) { base::UmaHistogramEnumeration( kAppManagementEntryPointsHistogramName, AppManagementEntryPoint::kAppListContextMenuAppInfoWebApp);
diff --git a/chrome/browser/ui/app_list/search/drive_quick_access_provider.cc b/chrome/browser/ui/app_list/search/drive_quick_access_provider.cc index ae2c476a..83e47bb 100644 --- a/chrome/browser/ui/app_list/search/drive_quick_access_provider.cc +++ b/chrome/browser/ui/app_list/search/drive_quick_access_provider.cc
@@ -19,12 +19,16 @@ #include "chrome/browser/chromeos/drive/drive_integration_service.h" #include "chrome/browser/ui/app_list/search/drive_quick_access_chip_result.h" #include "chrome/browser/ui/app_list/search/drive_quick_access_result.h" +#include "content/public/browser/browser_task_traits.h" +#include "content/public/browser/browser_thread.h" namespace app_list { namespace { constexpr int kMaxItems = 5; +constexpr base::TimeDelta kInitialFetchDelay = base::TimeDelta::FromSeconds(10); + // Error codes returned by the Drive QuickAccess API call. These values persist // to logs. Entries should not be renumbered and numeric values should never be // reused. @@ -100,6 +104,21 @@ task_runner_ = base::ThreadPool::CreateSequencedTaskRunner( {base::TaskPriority::BEST_EFFORT, base::MayBlock(), base::TaskShutdownBehavior::SKIP_ON_SHUTDOWN}); + + // Do an initial fetch of results from the Drive QuickAccess API. We cannot do + // this immediately, because the fetch requires that DriveFS is mounted, which + // takes a few seconds after login. So delay for |kInitialFetchDelay| seconds. + // + // TODO(crbug.com/1034842): Using a delay is not as robust as waiting on a + // signal that the Drive API is ready to use. We should change this once that + // signal available. + base::PostDelayedTask( + FROM_HERE, + {content::BrowserThread::UI, base::TaskPriority::BEST_EFFORT, + base::TaskShutdownBehavior::SKIP_ON_SHUTDOWN}, + base::BindOnce(&DriveQuickAccessProvider::GetQuickAccessItems, + weak_factory_.GetWeakPtr()), + kInitialFetchDelay); } DriveQuickAccessProvider::~DriveQuickAccessProvider() = default;
diff --git a/chrome/browser/ui/app_list/search/search_result_ranker/chip_ranker.cc b/chrome/browser/ui/app_list/search/search_result_ranker/chip_ranker.cc index 42185b2..1f3b78d 100644 --- a/chrome/browser/ui/app_list/search/search_result_ranker/chip_ranker.cc +++ b/chrome/browser/ui/app_list/search/search_result_ranker/chip_ranker.cc
@@ -114,10 +114,7 @@ // If this is the first initialization of the ranker, warm it up with some // default scores for apps and files. - // TODO(crbug.com/921444): Getting the ranks here just to check if they're - // empty is inefficient. We should add a size() method to RecurrenceRanker and - // update this. - if (type_ranker_->Rank().empty()) { + if (type_ranker_->empty()) { InitializeRanker(type_ranker_.get()); }
diff --git a/chrome/browser/ui/app_list/search/search_result_ranker/chip_ranker_unittest.cc b/chrome/browser/ui/app_list/search/search_result_ranker/chip_ranker_unittest.cc index 9364f3a..d9234dae 100644 --- a/chrome/browser/ui/app_list/search/search_result_ranker/chip_ranker_unittest.cc +++ b/chrome/browser/ui/app_list/search/search_result_ranker/chip_ranker_unittest.cc
@@ -199,4 +199,50 @@ HasScore(0.8), HasScore(0.7)))); } +// With no training, we expect the results list to be: app, app, file, app, +// file. Note this might be different from what is actually seen on devices, +// depending on whether apps initially have identical scores. +TEST_F(ChipRankerTest, DefaultInitialization) { + Mixer::SortedResults results = MakeSearchResults( + {"app1", "app2", "app3", "file1", "file2"}, + {ResultType::kInstalledApp, ResultType::kInstalledApp, + ResultType::kInstalledApp, ResultType::kFileChip, ResultType::kFileChip}, + {8.9, 8.7, 8.5, 0.8, 0.7}); + ranker_->Rank(&results); + + EXPECT_THAT(results, WhenSorted(ElementsAre(HasId("app1"), HasId("app2"), + HasId("file1"), HasId("app3"), + HasId("file2")))); +} + +// When files have been trained much more than apps, two files should appear +// before two apps. +TEST_F(ChipRankerTest, FilesAboveApps) { + Mixer::SortedResults results = + MakeSearchResults({"app1", "app2", "file1", "file2"}, + {ResultType::kInstalledApp, ResultType::kInstalledApp, + ResultType::kFileChip, ResultType::kFileChip}, + {8.9, 8.7, 0.8, 0.7}); + TrainRanker({"app", "file", "file", "file", "file"}); + + ranker_->Rank(&results); + EXPECT_THAT(results, WhenSorted(ElementsAre(HasId("file1"), HasId("file2"), + HasId("app1"), HasId("app2")))); +} + +// When apps have been trained much more than files, two apps should appear +// before two files. +TEST_F(ChipRankerTest, AppsAboveFiles) { + Mixer::SortedResults results = + MakeSearchResults({"app1", "app2", "file1", "file2"}, + {ResultType::kInstalledApp, ResultType::kInstalledApp, + ResultType::kFileChip, ResultType::kFileChip}, + {8.9, 8.7, 0.8, 0.7}); + TrainRanker({"file", "app", "app", "app", "app"}); + + ranker_->Rank(&results); + EXPECT_THAT(results, WhenSorted(ElementsAre(HasId("app1"), HasId("app2"), + HasId("file1"), HasId("file2")))); +} + } // namespace app_list
diff --git a/chrome/browser/ui/app_list/search/search_result_ranker/frecency_store.h b/chrome/browser/ui/app_list/search/search_result_ranker/frecency_store.h index 543bd1f..0315af4 100644 --- a/chrome/browser/ui/app_list/search/search_result_ranker/frecency_store.h +++ b/chrome/browser/ui/app_list/search/search_result_ranker/frecency_store.h
@@ -50,10 +50,13 @@ // Returns the ID for the given value. If the value is not in the store, // return base::nullopt. base::Optional<unsigned int> GetId(const std::string& value); - // Return all stored value data. This ensures all scores have been correctly + // Returns all stored value data. This ensures all scores have been correctly // updated, and none of the scores are below the |min_score_| threshold. const ScoreTable& GetAll(); + // Returns the number of values in the store. + int size() { return values_.size(); } + // Returns the underlying storage data structure. This does not ensure scores // are correct, and should not be used for scoring items. However it is // useful, for example, for implementing custom cleanup logic.
diff --git a/chrome/browser/ui/app_list/search/search_result_ranker/recurrence_ranker.h b/chrome/browser/ui/app_list/search/search_result_ranker/recurrence_ranker.h index 50d4e18..c38fbb9 100644 --- a/chrome/browser/ui/app_list/search/search_result_ranker/recurrence_ranker.h +++ b/chrome/browser/ui/app_list/search/search_result_ranker/recurrence_ranker.h
@@ -74,6 +74,9 @@ int n, const std::string& condition = std::string()); + // Returns whether this ranker contains no targets. + bool empty() { return targets_->size() == 0; } + // Force saving all model state to disk. If the user is an ephemeral user, // this does nothing. This is not necessary in normal operation, as the ranker // automatically saves at regular intervals. Example use: syncing to disk
diff --git a/chrome/browser/ui/app_list/search/search_result_ranker/recurrence_ranker_unittest.cc b/chrome/browser/ui/app_list/search/search_result_ranker/recurrence_ranker_unittest.cc index b611e5ab..7b28fae0 100644 --- a/chrome/browser/ui/app_list/search/search_result_ranker/recurrence_ranker_unittest.cc +++ b/chrome/browser/ui/app_list/search/search_result_ranker/recurrence_ranker_unittest.cc
@@ -267,6 +267,14 @@ /* using_fake_predictor = */ true); } +TEST_F(RecurrenceRankerTest, Empty) { + auto ranker = MakeSimpleRanker(); + + EXPECT_TRUE(ranker->empty()); + ranker->Record("A"); + EXPECT_FALSE(ranker->empty()); +} + TEST_F(RecurrenceRankerTest, LoadFromDisk) { // Serialise a testing proto. RecurrenceRankerProto proto = MakeTestingProto();
diff --git a/chrome/browser/ui/ash/chrome_new_window_client.cc b/chrome/browser/ui/ash/chrome_new_window_client.cc index 20c0bd2..e52540b 100644 --- a/chrome/browser/ui/ash/chrome_new_window_client.cc +++ b/chrome/browser/ui/ash/chrome_new_window_client.cc
@@ -14,6 +14,9 @@ #include "ash/public/cpp/shelf_model.h" #include "ash/public/cpp/shelf_types.h" #include "base/macros.h" +#include "chrome/browser/apps/app_service/app_service_proxy.h" +#include "chrome/browser/apps/app_service/app_service_proxy_factory.h" +#include "chrome/browser/apps/app_service/launch_utils.h" #include "chrome/browser/apps/launch_service/launch_service.h" #include "chrome/browser/chromeos/apps/metrics/intent_handling_metrics.h" #include "chrome/browser/chromeos/arc/arc_util.h" @@ -67,6 +70,7 @@ #include "ui/base/base_window.h" #include "ui/base/page_transition_types.h" #include "ui/base/window_open_disposition.h" +#include "ui/display/types/display_constants.h" #include "url/url_constants.h" using arc::mojom::ChromePage; @@ -74,8 +78,7 @@ namespace { constexpr std::pair<arc::mojom::ChromePage, const char*> kOSSettingsMapping[] = - {{ChromePage::ACCESSIBILITY, chrome::kAccessibilitySubPage}, - {ChromePage::ACCOUNTS, chrome::kAccountSubPage}, + {{ChromePage::ACCOUNTS, chrome::kAccountSubPage}, {ChromePage::ACCOUNTMANAGER, chrome::kAccountManagerSubPage}, {ChromePage::AMBIENTMODE, chrome::kAmbientModeSubPage}, {ChromePage::ANDROIDAPPSDETAILS, chrome::kAndroidAppsDetailsSubPage}, @@ -114,9 +117,10 @@ {ChromePage::NETWORKSTYPEVPN, chrome::kVPNSettingsSubPage}, {ChromePage::PLUGINVMDETAILS, chrome::kPluginVmDetailsSubPage}, {ChromePage::PLUGINVMSHAREDPATHS, chrome::kPluginVmSharedPathsSubPage}, + {ChromePage::OSACCESSIBILITY, chrome::kOsAccessibilitySubPage}, + {ChromePage::OSRESET, chrome::kOsResetSubPage}, {ChromePage::POINTEROVERLAY, chrome::kPointerOverlaySubPage}, {ChromePage::POWER, chrome::kPowerSubPage}, - {ChromePage::RESET, chrome::kResetSubPage}, {ChromePage::SMARTLOCKSETTINGS, chrome::kSmartLockSettingsSubPage}, {ChromePage::STORAGE, chrome::kStorageSubPage}, {ChromePage::STYLUS, chrome::kStylusSubPage}, @@ -126,6 +130,7 @@ constexpr std::pair<arc::mojom::ChromePage, const char*> kBrowserSettingsMapping[] = { + {ChromePage::ACCESSIBILITY, chrome::kAccessibilitySubPage}, {ChromePage::APPEARANCE, chrome::kAppearanceSubPage}, {ChromePage::AUTOFILL, chrome::kAutofillSubPage}, {ChromePage::CLEARBROWSERDATA, chrome::kClearBrowserDataSubPage}, @@ -134,6 +139,7 @@ {ChromePage::ONSTARTUP, chrome::kOnStartupSubPage}, {ChromePage::PASSWORDS, chrome::kPasswordManagerSubPage}, {ChromePage::PRIVACY, chrome::kPrivacySubPage}, + {ChromePage::RESET, chrome::kResetSubPage}, {ChromePage::SEARCH, chrome::kSearchSubPage}, {ChromePage::SYNCSETUP, chrome::kSyncSetupSubPage}}; @@ -289,21 +295,23 @@ } void ChromeNewWindowClient::OpenFileManager() { - using file_manager::kFileManagerAppId; Profile* const profile = ProfileManager::GetActiveUserProfile(); - const extensions::ExtensionRegistry* const registry = - extensions::ExtensionRegistry::Get(profile); - if (!extensions::util::IsAppLaunchableWithoutEnabling(kFileManagerAppId, - profile)) { - return; - } - - const extensions::Extension* const extension = - registry->GetInstalledExtension(kFileManagerAppId); - apps::LaunchService::Get(profile)->OpenApplication( - CreateAppLaunchParamsUserContainer( - profile, extension, WindowOpenDisposition::NEW_FOREGROUND_TAB, - apps::mojom::AppLaunchSource::kSourceKeyboard)); + apps::AppServiceProxy* proxy = + apps::AppServiceProxyFactory::GetForProfile(profile); + DCHECK(proxy); + proxy->AppRegistryCache().ForOneApp( + extension_misc::kWallpaperManagerId, + [proxy](const apps::AppUpdate& update) { + if (update.Readiness() == apps::mojom::Readiness::kReady) { + proxy->Launch(update.AppId(), + apps::GetEventFlags( + apps::mojom::LaunchContainer::kLaunchContainerNone, + WindowOpenDisposition::NEW_FOREGROUND_TAB, + true /* preferred_containner */), + apps::mojom::LaunchSource::kFromKeyboard, + display::kInvalidDisplayId); + } + }); } void ChromeNewWindowClient::OpenCrosh() {
diff --git a/chrome/browser/ui/ash/chrome_new_window_client_browsertest.cc b/chrome/browser/ui/ash/chrome_new_window_client_browsertest.cc index 8be2d7f..b77266ed 100644 --- a/chrome/browser/ui/ash/chrome_new_window_client_browsertest.cc +++ b/chrome/browser/ui/ash/chrome_new_window_client_browsertest.cc
@@ -278,12 +278,12 @@ base_url.Resolve(chrome::kVPNSettingsSubPage)); TestOpenChromePage(ChromePage::POINTEROVERLAY, base_url.Resolve(chrome::kPointerOverlaySubPage)); - TestOpenChromePage(ChromePage::RESET, - base_url.Resolve(chrome::kResetSubPage)); + TestOpenChromePage(ChromePage::OSRESET, + base_url.Resolve(chrome::kOsResetSubPage)); TestOpenChromePage(ChromePage::STORAGE, base_url.Resolve(chrome::kStorageSubPage)); - TestOpenChromePage(ChromePage::ACCESSIBILITY, - base_url.Resolve(chrome::kAccessibilitySubPage)); + TestOpenChromePage(ChromePage::OSACCESSIBILITY, + base_url.Resolve(chrome::kOsAccessibilitySubPage)); TestOpenChromePage(ChromePage::ACCOUNTMANAGER, base_url.Resolve(chrome::kAccountManagerSubPage)); TestOpenChromePage(ChromePage::AMBIENTMODE, @@ -337,6 +337,8 @@ } void TestAllBrowserSettingPages(const GURL& base_url) { + TestOpenChromePage(ChromePage::ACCESSIBILITY, + base_url.Resolve(chrome::kAccessibilitySubPage)); TestOpenChromePage(ChromePage::PRIVACY, base_url.Resolve(chrome::kPrivacySubPage)); TestOpenChromePage(ChromePage::APPEARANCE, @@ -353,6 +355,8 @@ base_url.Resolve(chrome::kOnStartupSubPage)); TestOpenChromePage(ChromePage::PASSWORDS, base_url.Resolve(chrome::kPasswordManagerSubPage)); + TestOpenChromePage(ChromePage::RESET, + base_url.Resolve(chrome::kResetSubPage)); TestOpenChromePage(ChromePage::SEARCH, base_url.Resolve(chrome::kSearchSubPage)); TestOpenChromePage(ChromePage::SYNCSETUP,
diff --git a/chrome/browser/ui/ash/launcher/chrome_launcher_controller.cc b/chrome/browser/ui/ash/launcher/chrome_launcher_controller.cc index 022ef4e..85bed54 100644 --- a/chrome/browser/ui/ash/launcher/chrome_launcher_controller.cc +++ b/chrome/browser/ui/ash/launcher/chrome_launcher_controller.cc
@@ -69,8 +69,10 @@ #include "chrome/browser/ui/chrome_pages.h" #include "chrome/browser/ui/tabs/tab_strip_model.h" #include "chrome/browser/ui/webui/settings/chromeos/app_management/app_management_uma.h" +#include "chrome/browser/web_applications/components/app_registrar.h" #include "chrome/browser/web_applications/components/web_app_helpers.h" #include "chrome/browser/web_applications/system_web_app_manager.h" +#include "chrome/browser/web_applications/web_app_provider.h" #include "chrome/common/chrome_features.h" #include "chrome/common/extensions/manifest_handlers/app_launch_info.h" #include "chrome/common/pref_names.h" @@ -903,19 +905,23 @@ return CanShowAppInfoDialog(profile, extension_id); } -void ChromeLauncherController::DoShowAppInfoFlow( - Profile* profile, - const std::string& extension_id) { +void ChromeLauncherController::DoShowAppInfoFlow(Profile* profile, + const std::string& app_id) { DCHECK(CanPlatformShowAppInfoDialog()); - const extensions::Extension* extension = GetExtension(profile, extension_id); - if (!extension) - return; - if (base::FeatureList::IsEnabled(features::kAppManagement)) { - chrome::ShowAppManagementPage(profile, extension_id); + apps::AppServiceProxy* proxy = + apps::AppServiceProxyFactory::GetForProfile(profile); + if (proxy && proxy->AppRegistryCache().GetAppType(app_id) == + apps::mojom::AppType::kUnknown) { + return; + } - if (extension->is_hosted_app() && extension->from_bookmark()) { + chrome::ShowAppManagementPage(profile, app_id); + + web_app::WebAppProvider* web_app_provider = + web_app::WebAppProvider::Get(profile); + if (web_app_provider && web_app_provider->registrar().IsInstalled(app_id)) { base::UmaHistogramEnumeration( kAppManagementEntryPointsHistogramName, AppManagementEntryPoint::kShelfContextMenuAppInfoWebApp); @@ -927,6 +933,11 @@ return; } + // TODO(crbug.com/1065766): Remove below code. + const extensions::Extension* extension = GetExtension(profile, app_id); + if (!extension) + return; + if (extension->is_hosted_app() && extension->from_bookmark()) { chrome::ShowSiteSettings( profile, extensions::AppLaunchInfo::GetFullLaunchURL(extension));
diff --git a/chrome/browser/ui/ash/launcher/chrome_launcher_controller.h b/chrome/browser/ui/ash/launcher/chrome_launcher_controller.h index f7e5120..4ffe1eac 100644 --- a/chrome/browser/ui/ash/launcher/chrome_launcher_controller.h +++ b/chrome/browser/ui/ash/launcher/chrome_launcher_controller.h
@@ -277,7 +277,7 @@ // Show the dialog with the application's information. Call only if // CanDoShowAppInfoFlow() returns true. - void DoShowAppInfoFlow(Profile* profile, const std::string& extension_id); + void DoShowAppInfoFlow(Profile* profile, const std::string& app_id); // LauncherAppUpdater::Delegate: void OnAppInstalled(content::BrowserContext* browser_context,
diff --git a/chrome/browser/ui/ash/launcher/chrome_launcher_controller_browsertest.cc b/chrome/browser/ui/ash/launcher/chrome_launcher_controller_browsertest.cc index c8404f81..bc29f2f6 100644 --- a/chrome/browser/ui/ash/launcher/chrome_launcher_controller_browsertest.cc +++ b/chrome/browser/ui/ash/launcher/chrome_launcher_controller_browsertest.cc
@@ -37,6 +37,7 @@ #include "chrome/app/chrome_command_ids.h" #include "chrome/browser/apps/app_service/app_service_proxy.h" #include "chrome/browser/apps/app_service/app_service_proxy_factory.h" +#include "chrome/browser/apps/app_service/launch_utils.h" #include "chrome/browser/apps/launch_service/launch_service.h" #include "chrome/browser/apps/platform_apps/app_browsertest_util.h" #include "chrome/browser/chromeos/accessibility/accessibility_manager.h" @@ -106,7 +107,6 @@ #include "ui/display/screen.h" #include "ui/display/test/display_manager_test_api.h" #include "ui/events/event.h" -#include "ui/events/event_constants.h" #include "ui/events/test/event_generator.h" #include "ui/events/types/event_type.h" @@ -247,17 +247,20 @@ } const Extension* LoadAndLaunchExtension(const char* name, - extensions::LaunchContainer container, - WindowOpenDisposition disposition) { + int32_t event_flags) { EXPECT_TRUE(LoadExtension(test_data_dir_.AppendASCII(name))); const Extension* extension = extension_registry()->GetExtensionById( last_loaded_extension_id(), extensions::ExtensionRegistry::ENABLED); EXPECT_TRUE(extension); - apps::LaunchService::Get(profile())->OpenApplication( - apps::AppLaunchParams(extension->id(), container, disposition, - apps::mojom::AppLaunchSource::kSourceTest)); + apps::AppServiceProxy* proxy = + apps::AppServiceProxyFactory::GetForProfile(profile()); + proxy->FlushMojoCallsForTesting(); + proxy->Launch(extension->id(), event_flags, + apps::mojom::LaunchSource::kFromTest, + display::Screen::GetScreen()->GetPrimaryDisplay().id()); + proxy->FlushMojoCallsForTesting(); return extension; } @@ -1043,9 +1046,11 @@ IN_PROC_BROWSER_TEST_F(ShelfAppBrowserTest, LaunchUnpinned) { TabStripModel* tab_strip = browser()->tab_strip_model(); int tab_count = tab_strip->count(); - LoadAndLaunchExtension("app1", - extensions::LaunchContainer::kLaunchContainerTab, - WindowOpenDisposition::NEW_FOREGROUND_TAB); + LoadAndLaunchExtension( + "app1", + apps::GetEventFlags(apps::mojom::LaunchContainer::kLaunchContainerTab, + WindowOpenDisposition::NEW_FOREGROUND_TAB, + true /* prefer_containner */)); EXPECT_EQ(++tab_count, tab_strip->count()); ash::ShelfID shortcut_id = CreateShortcut("app1"); EXPECT_EQ(ash::STATUS_RUNNING, shelf_model()->ItemByID(shortcut_id)->status); @@ -1061,8 +1066,10 @@ // an unpinned hosted app web contents. IN_PROC_BROWSER_TEST_F(ShelfAppBrowserTest, AppIDForUnpinnedHostedApp) { const extensions::Extension* extension = LoadAndLaunchExtension( - "app1", extensions::LaunchContainer::kLaunchContainerTab, - WindowOpenDisposition::NEW_FOREGROUND_TAB); + "app1", + apps::GetEventFlags(apps::mojom::LaunchContainer::kLaunchContainerTab, + WindowOpenDisposition::NEW_FOREGROUND_TAB, + true /* prefer_containner */)); int browser_index = GetIndexOfShelfItemType(ash::TYPE_BROWSER_SHORTCUT); ash::ShelfID browser_id = shelf_model()->items()[browser_index].id; @@ -1195,9 +1202,11 @@ IN_PROC_BROWSER_TEST_F(ShelfAppBrowserTest, LaunchInBackground) { TabStripModel* tab_strip = browser()->tab_strip_model(); int tab_count = tab_strip->count(); - LoadAndLaunchExtension("app1", - extensions::LaunchContainer::kLaunchContainerTab, - WindowOpenDisposition::NEW_BACKGROUND_TAB); + LoadAndLaunchExtension( + "app1", + apps::GetEventFlags(apps::mojom::LaunchContainer::kLaunchContainerTab, + WindowOpenDisposition::NEW_BACKGROUND_TAB, + true /* prefer_containner */)); EXPECT_EQ(++tab_count, tab_strip->count()); controller_->LaunchApp(ash::ShelfID(last_loaded_extension_id()), ash::LAUNCH_FROM_UNKNOWN, 0, @@ -1421,8 +1430,10 @@ IN_PROC_BROWSER_TEST_F(ShelfAppBrowserTest, AppWindowRestoreBehaviorTest) { // Open an App, maximized its window, and close it. const Extension* extension = LoadAndLaunchExtension( - "app1", extensions::LaunchContainer::kLaunchContainerWindow, - WindowOpenDisposition::NEW_WINDOW); + "app1", + apps::GetEventFlags(apps::mojom::LaunchContainer::kLaunchContainerWindow, + WindowOpenDisposition::NEW_WINDOW, + false /* prefer_containner */)); Browser* app_browser = FindBrowserForApp(extension->id()); ASSERT_TRUE(app_browser); BrowserWindow* window = app_browser->window(); @@ -1433,8 +1444,10 @@ // Reopen the App. It should start maximized. Un-maximize it and close it. extension = LoadAndLaunchExtension( - "app1", extensions::LaunchContainer::kLaunchContainerWindow, - WindowOpenDisposition::NEW_WINDOW); + "app1", + apps::GetEventFlags(apps::mojom::LaunchContainer::kLaunchContainerWindow, + WindowOpenDisposition::NEW_WINDOW, + false /* prefer_containner */)); app_browser = FindBrowserForApp(extension->id()); ASSERT_TRUE(app_browser); window = app_browser->window(); @@ -1447,8 +1460,10 @@ // Reopen the App. It should start un-maximized. extension = LoadAndLaunchExtension( - "app1", extensions::LaunchContainer::kLaunchContainerWindow, - WindowOpenDisposition::NEW_WINDOW); + "app1", + apps::GetEventFlags(apps::mojom::LaunchContainer::kLaunchContainerWindow, + WindowOpenDisposition::NEW_WINDOW, + false /* prefer_containner */)); app_browser = FindBrowserForApp(extension->id()); ASSERT_TRUE(app_browser); window = app_browser->window(); @@ -1465,18 +1480,26 @@ EXPECT_EQ(0u, running_browser); const Extension* extension = LoadAndLaunchExtension( - "app1", extensions::LaunchContainer::kLaunchContainerWindow, - WindowOpenDisposition::NEW_WINDOW); + "app1", + apps::GetEventFlags(apps::mojom::LaunchContainer::kLaunchContainerWindow, + WindowOpenDisposition::NEW_WINDOW, + false /* prefer_containner */)); ASSERT_TRUE(extension); // No new browser should get detected, even though one more is running. EXPECT_EQ(0u, NumberOfDetectedLauncherBrowsers(false)); EXPECT_EQ(++running_browser, chrome::GetTotalBrowserCount()); - apps::LaunchService::Get(profile())->OpenApplication(apps::AppLaunchParams( - extension->id(), apps::mojom::LaunchContainer::kLaunchContainerTab, - WindowOpenDisposition::NEW_WINDOW, - apps::mojom::AppLaunchSource::kSourceTest)); + apps::AppServiceProxy* proxy = + apps::AppServiceProxyFactory::GetForProfile(profile()); + proxy->Launch( + extension->id(), + apps::GetEventFlags(apps::mojom::LaunchContainer::kLaunchContainerTab, + WindowOpenDisposition::NEW_FOREGROUND_TAB, + true /* prefer_containner */), + apps::mojom::LaunchSource::kFromTest, + display::Screen::GetScreen()->GetPrimaryDisplay().id()); + proxy->FlushMojoCallsForTesting(); // A new browser should get detected and one more should be running. EXPECT_EQ(NumberOfDetectedLauncherBrowsers(false), 1u); @@ -1487,24 +1510,35 @@ IN_PROC_BROWSER_TEST_F(ShelfAppBrowserTestNoDefaultBrowser, EnumerateAllBrowsersAndTabs) { // Create at least one browser. - LoadAndLaunchExtension("app1", - extensions::LaunchContainer::kLaunchContainerTab, - WindowOpenDisposition::NEW_WINDOW); + LoadAndLaunchExtension( + "app1", + apps::GetEventFlags(apps::mojom::LaunchContainer::kLaunchContainerTab, + WindowOpenDisposition::NEW_FOREGROUND_TAB, + true /* prefer_containner */)); size_t browsers = NumberOfDetectedLauncherBrowsers(false); size_t tabs = NumberOfDetectedLauncherBrowsers(true); // Create a second browser. - LoadAndLaunchExtension("app1", - extensions::LaunchContainer::kLaunchContainerTab, - WindowOpenDisposition::NEW_WINDOW); + // + // TODO(crbug.com/1061843): Replace OpenApplication with AppService's launch + // interfaces. + const Extension* extension = extension_registry()->GetExtensionById( + last_loaded_extension_id(), extensions::ExtensionRegistry::ENABLED); + EXPECT_TRUE(extension); + apps::LaunchService::Get(profile())->OpenApplication(apps::AppLaunchParams( + extension->id(), extensions::LaunchContainer::kLaunchContainerTab, + WindowOpenDisposition::NEW_WINDOW, + apps::mojom::AppLaunchSource::kSourceTest)); EXPECT_EQ(++browsers, NumberOfDetectedLauncherBrowsers(false)); EXPECT_EQ(++tabs, NumberOfDetectedLauncherBrowsers(true)); // Create only a tab. - LoadAndLaunchExtension("app1", - extensions::LaunchContainer::kLaunchContainerTab, - WindowOpenDisposition::NEW_FOREGROUND_TAB); + LoadAndLaunchExtension( + "app1", + apps::GetEventFlags(apps::mojom::LaunchContainer::kLaunchContainerTab, + WindowOpenDisposition::NEW_FOREGROUND_TAB, + true /* prefer_containner */)); EXPECT_EQ(browsers, NumberOfDetectedLauncherBrowsers(false)); EXPECT_EQ(++tabs, NumberOfDetectedLauncherBrowsers(true)); @@ -1815,9 +1849,11 @@ EXPECT_TRUE(browser1->window()->IsActive()); // Create another app and make sure that none of our browsers is active. - LoadAndLaunchExtension("app1", - extensions::LaunchContainer::kLaunchContainerTab, - WindowOpenDisposition::NEW_WINDOW); + LoadAndLaunchExtension( + "app1", + apps::GetEventFlags(apps::mojom::LaunchContainer::kLaunchContainerWindow, + WindowOpenDisposition::NEW_WINDOW, + false /* prefer_containner */)); EXPECT_FALSE(browser1->window()->IsActive()); EXPECT_FALSE(browser2->window()->IsActive()); @@ -2005,12 +2041,15 @@ EXPECT_EQ(ash::STATUS_CLOSED, shelf_model()->ItemByID(id)->status); // Create a windowed application. - apps::AppLaunchParams params = CreateAppLaunchParamsUserContainer( - profile(), GetExtensionForAppID(extensions::kWebStoreAppId, profile()), - WindowOpenDisposition::NEW_FOREGROUND_TAB, - apps::mojom::AppLaunchSource::kSourceTest); - params.container = apps::mojom::LaunchContainer::kLaunchContainerWindow; - apps::LaunchService::Get(profile())->OpenApplication(params); + apps::AppServiceProxy* proxy = + apps::AppServiceProxyFactory::GetForProfile(profile()); + proxy->Launch( + extensions::kWebStoreAppId, + apps::GetEventFlags(apps::mojom::LaunchContainer::kLaunchContainerTab, + WindowOpenDisposition::NEW_FOREGROUND_TAB, + true /* prefer_containner */), + apps::mojom::LaunchSource::kFromTest, + display::Screen::GetScreen()->GetPrimaryDisplay().id()); EXPECT_EQ(ash::STATUS_RUNNING, shelf_model()->ItemByID(id)->status); // Find the browser which holds our app.
diff --git a/chrome/browser/ui/ash/wallpaper_controller_client.cc b/chrome/browser/ui/ash/wallpaper_controller_client.cc index ef10ad64..a03a5e2a 100644 --- a/chrome/browser/ui/ash/wallpaper_controller_client.cc +++ b/chrome/browser/ui/ash/wallpaper_controller_client.cc
@@ -9,7 +9,9 @@ #include "base/path_service.h" #include "base/strings/string_number_conversions.h" #include "chrome/browser/apps/app_service/app_launch_params.h" -#include "chrome/browser/apps/launch_service/launch_service.h" +#include "chrome/browser/apps/app_service/app_service_proxy.h" +#include "chrome/browser/apps/app_service/app_service_proxy_factory.h" +#include "chrome/browser/apps/app_service/launch_utils.h" #include "chrome/browser/browser_process.h" #include "chrome/browser/chromeos/customization/customization_wallpaper_util.h" #include "chrome/browser/chromeos/login/wizard_controller.h" @@ -29,6 +31,7 @@ #include "extensions/browser/extension_registry.h" #include "extensions/common/constants.h" #include "services/service_manager/public/cpp/connector.h" +#include "ui/display/types/display_constants.h" namespace { @@ -482,19 +485,21 @@ void WallpaperControllerClient::OpenWallpaperPicker() { Profile* profile = ProfileManager::GetActiveUserProfile(); DCHECK(profile); - extensions::ExtensionRegistry* registry = - extensions::ExtensionRegistry::Get(profile); - - const extensions::Extension* extension = - registry->GetExtensionById(extension_misc::kWallpaperManagerId, - extensions::ExtensionRegistry::ENABLED); - if (!extension) + apps::AppServiceProxy* proxy = + apps::AppServiceProxyFactory::GetForProfile(profile); + DCHECK(proxy); + if (proxy->AppRegistryCache().GetAppType( + extension_misc::kWallpaperManagerId) == + apps::mojom::AppType::kUnknown) { return; - - apps::LaunchService::Get(profile)->OpenApplication(apps::AppLaunchParams( - extension->id(), apps::mojom::LaunchContainer::kLaunchContainerWindow, - WindowOpenDisposition::NEW_WINDOW, - apps::mojom::AppLaunchSource::kSourceChromeInternal)); + } + proxy->Launch( + extension_misc::kWallpaperManagerId, + apps::GetEventFlags(apps::mojom::LaunchContainer::kLaunchContainerWindow, + WindowOpenDisposition::NEW_WINDOW, + false /* preferred_containner */), + apps::mojom::LaunchSource::kFromChromeInternal, + display::kInvalidDisplayId); } bool WallpaperControllerClient::ShouldShowUserNamesOnLogin() const {
diff --git a/chrome/browser/ui/extensions/extension_installed_notification.cc b/chrome/browser/ui/extensions/extension_installed_notification.cc index 642fa1b..5d75c58 100644 --- a/chrome/browser/ui/extensions/extension_installed_notification.cc +++ b/chrome/browser/ui/extensions/extension_installed_notification.cc
@@ -7,7 +7,9 @@ #include "ash/public/cpp/notification_utils.h" #include "base/strings/utf_string_conversions.h" #include "chrome/app/vector_icons/vector_icons.h" -#include "chrome/browser/apps/launch_service/launch_service.h" +#include "chrome/browser/apps/app_service/app_service_proxy.h" +#include "chrome/browser/apps/app_service/app_service_proxy_factory.h" +#include "chrome/browser/apps/app_service/launch_utils.h" #include "chrome/browser/browser_process.h" #include "chrome/browser/extensions/extension_util.h" #include "chrome/browser/notifications/notification_common.h" @@ -20,6 +22,7 @@ #include "extensions/common/extension.h" #include "extensions/common/extension_urls.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/display/types/display_constants.h" #include "ui/gfx/color_palette.h" #include "ui/message_center/public/cpp/notification.h" @@ -66,14 +69,19 @@ if (!extensions::util::IsAppLaunchable(extension_id_, profile_)) return; - const extensions::Extension* extension = - extensions::ExtensionRegistry::Get(profile_)->GetExtensionById( - extension_id_, extensions::ExtensionRegistry::EVERYTHING); - if (!extension) + apps::AppServiceProxy* proxy = + apps::AppServiceProxyFactory::GetForProfile(profile_); + DCHECK(proxy); + if (proxy->AppRegistryCache().GetAppType(extension_id_) == + apps::mojom::AppType::kUnknown) { return; + } - apps::AppLaunchParams params = CreateAppLaunchParamsUserContainer( - profile_, extension, WindowOpenDisposition::NEW_FOREGROUND_TAB, - apps::mojom::AppLaunchSource::kSourceInstalledNotification); - apps::LaunchService::Get(profile_)->OpenApplication(params); + proxy->Launch( + extension_id_, + apps::GetEventFlags(apps::mojom::LaunchContainer::kLaunchContainerNone, + WindowOpenDisposition::NEW_FOREGROUND_TAB, + true /* preferred_containner */), + apps::mojom::LaunchSource::kFromInstalledNotification, + display::kInvalidDisplayId); }
diff --git a/chrome/browser/ui/gtk/BUILD.gn b/chrome/browser/ui/gtk/BUILD.gn index 0f878d0..d3005dd 100644 --- a/chrome/browser/ui/gtk/BUILD.gn +++ b/chrome/browser/ui/gtk/BUILD.gn
@@ -83,11 +83,8 @@ public_deps = [ "//chrome/browser:theme_properties" ] if (use_x11 || ozone_platform_x11) { + # select_file_dialog_impl_kde.cc still refers to XID configs += [ "//build/config/linux:x11" ] - deps += [ - "//ui/events/platform/x11", - "//ui/gfx/x", - ] } if (use_ozone) {
diff --git a/chrome/browser/ui/gtk/gtk_util.cc b/chrome/browser/ui/gtk/gtk_util.cc index 27db8b2..6754c7f 100644 --- a/chrome/browser/ui/gtk/gtk_util.cc +++ b/chrome/browser/ui/gtk/gtk_util.cc
@@ -32,13 +32,6 @@ #include "ui/ozone/public/ozone_platform.h" #include "ui/views/linux_ui/linux_ui.h" -#if defined(USE_X11) -#include <gdk/gdkx.h> - -#include "ui/events/keycodes/keyboard_code_conversion_x.h" // nogncheck -#include "ui/gfx/x/x11_types.h" // nogncheck -#endif - WEAK_GTK_FN(gtk_widget_path_iter_set_object_name); WEAK_GTK_FN(gtk_widget_path_iter_set_state);
diff --git a/chrome/browser/ui/gtk/print_dialog_gtk.cc b/chrome/browser/ui/gtk/print_dialog_gtk.cc index 287ac1f..f35e4764 100644 --- a/chrome/browser/ui/gtk/print_dialog_gtk.cc +++ b/chrome/browser/ui/gtk/print_dialog_gtk.cc
@@ -24,16 +24,14 @@ #include "base/task/thread_pool.h" #include "base/threading/sequenced_task_runner_handle.h" #include "base/values.h" +#include "chrome/browser/ui/gtk/gtk_ui.h" #include "chrome/browser/ui/gtk/gtk_util.h" #include "chrome/browser/ui/gtk/printing_gtk_util.h" #include "printing/metafile.h" #include "printing/print_job_constants.h" #include "printing/print_settings.h" #include "ui/aura/window.h" - -#if defined(USE_X11) -#include "ui/events/platform/x11/x11_event_source.h" // nogncheck -#endif +#include "ui/gtk/gtk_ui_delegate.h" using printing::PageRanges; using printing::PrintSettings; @@ -354,14 +352,7 @@ g_signal_connect(dialog_, "response", G_CALLBACK(OnResponseThunk), this); gtk_widget_show(dialog_); - // We need to call gtk_window_present after making the widgets visible to make - // sure window gets correctly raised and gets focus. -#if defined(USE_X11) - gtk_window_present_with_time( - GTK_WINDOW(dialog_), ui::X11EventSource::GetInstance()->GetTimestamp()); -#else - gtk_window_present(GTK_WINDOW(dialog_)); -#endif + gtk::GtkUi::GetDelegate()->ShowGtkWindow(GTK_WINDOW(dialog_)); } void PrintDialogGtk::PrintDocument(const printing::MetafilePlayer& metafile,
diff --git a/chrome/browser/ui/gtk/select_file_dialog_impl_gtk.cc b/chrome/browser/ui/gtk/select_file_dialog_impl_gtk.cc index f9f4077..c1d31066 100644 --- a/chrome/browser/ui/gtk/select_file_dialog_impl_gtk.cc +++ b/chrome/browser/ui/gtk/select_file_dialog_impl_gtk.cc
@@ -4,7 +4,6 @@ #include "chrome/browser/ui/gtk/select_file_dialog_impl_gtk.h" -#include <gdk/gdkx.h> #include <gtk/gtk.h> #include <stddef.h> #include <sys/stat.h> @@ -23,18 +22,16 @@ #include "base/strings/utf_string_conversions.h" #include "base/threading/thread.h" #include "base/threading/thread_restrictions.h" +#include "chrome/browser/ui/gtk/gtk_ui.h" #include "chrome/browser/ui/gtk/gtk_util.h" #include "chrome/browser/ui/gtk/select_file_dialog_impl.h" #include "ui/aura/window_observer.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/gtk/gtk_ui_delegate.h" #include "ui/shell_dialogs/select_file_dialog.h" #include "ui/strings/grit/ui_strings.h" #include "ui/views/widget/desktop_aura/desktop_window_tree_host_linux.h" -#if defined(USE_X11) -#include "ui/events/platform/x11/x11_event_source.h" // nogncheck -#endif - namespace { #if GTK_CHECK_VERSION(3, 90, 0) @@ -212,15 +209,7 @@ #if !GTK_CHECK_VERSION(3, 90, 0) gtk_widget_show_all(dialog); #endif - - // We need to call gtk_window_present after making the widgets visible to make - // sure window gets correctly raised and gets focus. -#if defined(USE_X11) - gtk_window_present_with_time( - GTK_WINDOW(dialog), ui::X11EventSource::GetInstance()->GetTimestamp()); -#else - gtk_window_present(GTK_WINDOW(dialog)); -#endif + gtk::GtkUi::GetDelegate()->ShowGtkWindow(GTK_WINDOW(dialog)); } void SelectFileDialogImplGTK::AddFilters(GtkFileChooser* chooser) {
diff --git a/chrome/browser/ui/passwords/bubble_controllers/save_unsynced_credentials_locally_bubble_controller.cc b/chrome/browser/ui/passwords/bubble_controllers/save_unsynced_credentials_locally_bubble_controller.cc new file mode 100644 index 0000000..bdb42ff --- /dev/null +++ b/chrome/browser/ui/passwords/bubble_controllers/save_unsynced_credentials_locally_bubble_controller.cc
@@ -0,0 +1,54 @@ +// Copyright 2020 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "chrome/browser/ui/passwords/bubble_controllers/save_unsynced_credentials_locally_bubble_controller.h" + +#include <utility> + +#include "base/strings/utf_string_conversions.h" +#include "chrome/browser/ui/passwords/passwords_model_delegate.h" +#include "components/password_manager/core/browser/password_form_metrics_recorder.h" + +namespace metrics_util = password_manager::metrics_util; + +SaveUnsyncedCredentialsLocallyBubbleController:: + SaveUnsyncedCredentialsLocallyBubbleController( + base::WeakPtr<PasswordsModelDelegate> delegate) + : PasswordBubbleControllerBase( + std::move(delegate), + /*display_disposition=*/metrics_util:: + AUTOMATIC_SAVE_UNSYNCED_CREDENTIALS_LOCALLY), + unsynced_credentials_(delegate_->GetUnsyncedCredentials()), + dismissal_reason_(metrics_util::NO_DIRECT_INTERACTION) { + DCHECK(!unsynced_credentials_.empty()); +} + +SaveUnsyncedCredentialsLocallyBubbleController:: + ~SaveUnsyncedCredentialsLocallyBubbleController() { + if (!interaction_reported_) + OnBubbleClosing(); +} + +void SaveUnsyncedCredentialsLocallyBubbleController::OnSaveClicked() { + NOTIMPLEMENTED(); +} + +void SaveUnsyncedCredentialsLocallyBubbleController::OnCancelClicked() { + // TODO(crbug.com/1060132): This method should clear the unsynced credentials + // wherever they are being stored. + NOTIMPLEMENTED(); +} + +void SaveUnsyncedCredentialsLocallyBubbleController::ReportInteractions() { + metrics_util::LogGeneralUIDismissalReason(dismissal_reason_); + // Record UKM statistics on dismissal reason. + if (metrics_recorder_) + metrics_recorder_->RecordUIDismissalReason(dismissal_reason_); +} + +base::string16 SaveUnsyncedCredentialsLocallyBubbleController::GetTitle() + const { + // TODO(crbug.com/1062344): Add proper (translated) string. + return base::ASCIIToUTF16("These passwords were not commited:"); +}
diff --git a/chrome/browser/ui/passwords/bubble_controllers/save_unsynced_credentials_locally_bubble_controller.h b/chrome/browser/ui/passwords/bubble_controllers/save_unsynced_credentials_locally_bubble_controller.h new file mode 100644 index 0000000..39ce9a89 --- /dev/null +++ b/chrome/browser/ui/passwords/bubble_controllers/save_unsynced_credentials_locally_bubble_controller.h
@@ -0,0 +1,45 @@ +// Copyright 2020 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef CHROME_BROWSER_UI_PASSWORDS_BUBBLE_CONTROLLERS_SAVE_UNSYNCED_CREDENTIALS_LOCALLY_BUBBLE_CONTROLLER_H_ +#define CHROME_BROWSER_UI_PASSWORDS_BUBBLE_CONTROLLERS_SAVE_UNSYNCED_CREDENTIALS_LOCALLY_BUBBLE_CONTROLLER_H_ + +#include <vector> + +#include "base/memory/weak_ptr.h" +#include "chrome/browser/ui/passwords/bubble_controllers/password_bubble_controller_base.h" + +class PasswordsModelDelegate; + +// This controller provides data and actions for the +// PasswordSaveUnsyncedCredentialsLocallyView. +class SaveUnsyncedCredentialsLocallyBubbleController + : public PasswordBubbleControllerBase { + public: + explicit SaveUnsyncedCredentialsLocallyBubbleController( + base::WeakPtr<PasswordsModelDelegate> delegate); + ~SaveUnsyncedCredentialsLocallyBubbleController() override; + + // Called by the view code when the save button is clicked by the user. + // Saves the uncommitted credentials to the password store. + void OnSaveClicked(); + + // Called by the view code when the cancel button is clicked by the user. + // Drops the unsynced credentials. + void OnCancelClicked(); + + const std::vector<autofill::PasswordForm>& unsynced_credentials() const { + return unsynced_credentials_; + } + + private: + // PasswordBubbleControllerBase methods: + base::string16 GetTitle() const override; + void ReportInteractions() override; + + std::vector<autofill::PasswordForm> unsynced_credentials_; + password_manager::metrics_util::UIDismissalReason dismissal_reason_; +}; + +#endif // CHROME_BROWSER_UI_PASSWORDS_BUBBLE_CONTROLLERS_SAVE_UNSYNCED_CREDENTIALS_LOCALLY_BUBBLE_CONTROLLER_H_
diff --git a/chrome/browser/ui/passwords/bubble_controllers/save_unsynced_credentials_locally_bubble_controller_unittest.cc b/chrome/browser/ui/passwords/bubble_controllers/save_unsynced_credentials_locally_bubble_controller_unittest.cc new file mode 100644 index 0000000..f2f2dc0 --- /dev/null +++ b/chrome/browser/ui/passwords/bubble_controllers/save_unsynced_credentials_locally_bubble_controller_unittest.cc
@@ -0,0 +1,41 @@ +// Copyright 2020 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "chrome/browser/ui/passwords/bubble_controllers/save_unsynced_credentials_locally_bubble_controller.h" + +#include <vector> + +#include "base/strings/utf_string_conversions.h" +#include "chrome/browser/ui/passwords/passwords_model_delegate_mock.h" +#include "components/autofill/core/common/password_form.h" +#include "testing/gmock/include/gmock/gmock.h" +#include "testing/gtest/include/gtest/gtest.h" + +using base::ASCIIToUTF16; +using testing::NiceMock; +using testing::ReturnRef; + +class SaveUnsyncedCredentialsLocallyBubbleControllerTest + : public ::testing::Test { + public: + SaveUnsyncedCredentialsLocallyBubbleControllerTest() { + unsynced_credentials_.resize(1); + unsynced_credentials_[0].username_value = ASCIIToUTF16("user"); + unsynced_credentials_[0].password_value = ASCIIToUTF16("password"); + } + ~SaveUnsyncedCredentialsLocallyBubbleControllerTest() override = default; + + protected: + NiceMock<PasswordsModelDelegateMock> model_delegate_mock_; + std::vector<autofill::PasswordForm> unsynced_credentials_; +}; + +TEST_F(SaveUnsyncedCredentialsLocallyBubbleControllerTest, + ShouldGetCredentialsFromDelegate) { + EXPECT_CALL(model_delegate_mock_, GetUnsyncedCredentials()) + .WillOnce(ReturnRef(unsynced_credentials_)); + SaveUnsyncedCredentialsLocallyBubbleController controller( + model_delegate_mock_.AsWeakPtr()); + EXPECT_EQ(controller.unsynced_credentials(), unsynced_credentials_); +}
diff --git a/chrome/browser/ui/search/search_tab_helper.cc b/chrome/browser/ui/search/search_tab_helper.cc index 34db820..ed10e1d 100644 --- a/chrome/browser/ui/search/search_tab_helper.cc +++ b/chrome/browser/ui/search/search_tab_helper.cc
@@ -97,21 +97,6 @@ namespace { -// TODO(mahmadi): Make sure all the vector icons returned by -// AutocompleteMatch::GetVectorIcon have an equivalent SVG resource. -std::string AutocompleteMatchVectorIconToResourceName( - const gfx::VectorIcon& icon) { - if (icon.name == omnibox::kClockIcon.name) { - return kClockIconResourceName; - } else if (icon.name == omnibox::kPageIcon.name) { - return kPageIconResourceName; - } else if (icon.name == vector_icons::kSearchIcon.name) { - return kSearchIconResourceName; - } else { - return ""; - } -} - std::vector<chrome::mojom::AutocompleteMatchPtr> CreateAutocompleteMatches( const AutocompleteResult& result) { std::vector<chrome::mojom::AutocompleteMatchPtr> matches; @@ -134,7 +119,8 @@ } mojom_match->destination_url = match.destination_url.spec(); mojom_match->icon_url = - AutocompleteMatchVectorIconToResourceName(match.GetVectorIcon(false)); + SearchTabHelper::AutocompleteMatchVectorIconToResourceName( + match.GetVectorIcon(false)); mojom_match->image_dominant_color = match.image_dominant_color; mojom_match->image_url = match.image_url.spec(); mojom_match->fill_into_edit = match.fill_into_edit; @@ -263,6 +249,51 @@ web_contents_, chrome_colors::RevertReason::TAB_CLOSED); } +// static +std::string SearchTabHelper::AutocompleteMatchVectorIconToResourceName( + const gfx::VectorIcon& icon) { + if (icon.name == omnibox::kBlankIcon.name) { + return ""; // An empty resource name is effectively a blank icon. + } else if (icon.name == omnibox::kBookmarkIcon.name) { + return kBookmarkIconResourceName; + } else if (icon.name == omnibox::kCalculatorIcon.name) { + return kCalculatorIconResourceName; + } else if (icon.name == omnibox::kClockIcon.name) { + return kClockIconResourceName; + } else if (icon.name == omnibox::kDriveDocsIcon.name) { + return kDriveDocsIconResourceName; + } else if (icon.name == omnibox::kDriveFolderIcon.name) { + return kDriveFolderIconResourceName; + } else if (icon.name == omnibox::kDriveFormsIcon.name) { + return kDriveFormIconResourceName; + } else if (icon.name == omnibox::kDriveImageIcon.name) { + return kDriveImageIconResourceName; + } else if (icon.name == omnibox::kDriveLogoIcon.name) { + return kDriveLogoIconResourceName; + } else if (icon.name == omnibox::kDrivePdfIcon.name) { + return kDrivePdfIconResourceName; + } else if (icon.name == omnibox::kDriveSheetsIcon.name) { + return kDriveSheetsIconResourceName; + } else if (icon.name == omnibox::kDriveSlidesIcon.name) { + return kDriveSlidesIconResourceName; + } else if (icon.name == omnibox::kDriveVideoIcon.name) { + return kDriveVideoIconResourceName; + } else if (icon.name == omnibox::kExtensionAppIcon.name) { + return kExtensionAppIconResourceName; + } else if (icon.name == omnibox::kPageIcon.name) { + return kPageIconResourceName; + } else if (icon.name == omnibox::kPedalIcon.name) { + return ""; // Pedals are not supported in the NTP Realbox. + } else if (icon.name == vector_icons::kSearchIcon.name) { + return kSearchIconResourceName; + } else { + NOTREACHED() + << "Every vector icon returned by AutocompleteMatch::GetVectorIcon " + "must have an equivalent SVG resource for the NTP Realbox."; + return ""; + } +} + void SearchTabHelper::DidStartNavigation( content::NavigationHandle* navigation_handle) { if (!navigation_handle->IsInMainFrame())
diff --git a/chrome/browser/ui/search/search_tab_helper.h b/chrome/browser/ui/search/search_tab_helper.h index 6b74b2c..84d5310 100644 --- a/chrome/browser/ui/search/search_tab_helper.h +++ b/chrome/browser/ui/search/search_tab_helper.h
@@ -76,6 +76,11 @@ SearchIPCRouter& ipc_router_for_testing() { return ipc_router_; } + // Returns an equivalent SVG for the given Omnibox vector icon for use in the + // NTP Realbox. + static std::string AutocompleteMatchVectorIconToResourceName( + const gfx::VectorIcon& icon); + private: friend class content::WebContentsUserData<SearchTabHelper>; friend class SearchIPCRouterTest;
diff --git a/chrome/browser/ui/search/search_tab_helper_unittest.cc b/chrome/browser/ui/search/search_tab_helper_unittest.cc index ae2cc35..73eb256 100644 --- a/chrome/browser/ui/search/search_tab_helper_unittest.cc +++ b/chrome/browser/ui/search/search_tab_helper_unittest.cc
@@ -20,12 +20,16 @@ #include "chrome/test/base/browser_with_test_window_test.h" #include "chrome/test/base/chrome_render_view_host_test_harness.h" #include "chrome/test/base/testing_profile.h" +#include "components/omnibox/browser/autocomplete_match.h" +#include "components/omnibox/browser/autocomplete_match_type.h" +#include "components/omnibox/browser/vector_icons.h" #include "components/strings/grit/components_strings.h" #include "components/sync/driver/test_sync_service.h" #include "content/public/browser/web_contents.h" #include "testing/gmock/include/gmock/gmock.h" #include "testing/gtest/include/gtest/gtest.h" #include "ui/base/l10n/l10n_util.h" +#include "ui/gfx/vector_icon_types.h" #include "url/gurl.h" using testing::_; @@ -103,3 +107,19 @@ EXPECT_EQ(l10n_util::GetStringUTF16(IDS_NEW_TAB_TITLE), web_contents()->GetTitle()); } + +// Tests that all Omnibox vector icons map to an equivalent SVG for use in the +// NTP Realbox. +TEST_F(SearchTabHelperTest, VectorIcons) { + for (int type = AutocompleteMatchType::URL_WHAT_YOU_TYPED; + type != AutocompleteMatchType::NUM_TYPES; type++) { + AutocompleteMatch match; + match.type = (AutocompleteMatchType::Type)type; + const gfx::VectorIcon& vector_icon = match.GetVectorIcon( + /*is_bookmark=*/false); + const std::string& svg_name = + SearchTabHelper::AutocompleteMatchVectorIconToResourceName(vector_icon); + DCHECK(!svg_name.empty() || vector_icon.name == omnibox::kPedalIcon.name || + vector_icon.name == omnibox::kBlankIcon.name); + } +}
diff --git a/chrome/browser/ui/tab_contents/core_tab_helper.cc b/chrome/browser/ui/tab_contents/core_tab_helper.cc index f55db8f..9f5c1daa 100644 --- a/chrome/browser/ui/tab_contents/core_tab_helper.cc +++ b/chrome/browser/ui/tab_contents/core_tab_helper.cc
@@ -93,7 +93,7 @@ // Bind the InterfacePtr into the callback so that it's kept alive until // there's either a connection error or a response. auto* thumbnail_capturer_proxy = chrome_render_frame.get(); - thumbnail_capturer_proxy->RequestThumbnailForContextNode( + thumbnail_capturer_proxy->RequestImageForContextNode( kImageSearchThumbnailMinSize, gfx::Size(kImageSearchThumbnailMaxWidth, kImageSearchThumbnailMaxHeight), chrome::mojom::ImageFormat::JPEG, @@ -252,7 +252,8 @@ chrome_render_frame, const GURL& src_url, const std::vector<uint8_t>& thumbnail_data, - const gfx::Size& original_size) { + const gfx::Size& original_size, + const std::string& image_extension) { if (thumbnail_data.empty()) return;
diff --git a/chrome/browser/ui/tab_contents/core_tab_helper.h b/chrome/browser/ui/tab_contents/core_tab_helper.h index 1a9b232..206357b1 100644 --- a/chrome/browser/ui/tab_contents/core_tab_helper.h +++ b/chrome/browser/ui/tab_contents/core_tab_helper.h
@@ -66,7 +66,8 @@ chrome_render_frame, const GURL& src_url, const std::vector<uint8_t>& thumbnail_data, - const gfx::Size& original_size); + const gfx::Size& original_size, + const std::string& image_extension); // The time when we started to create the new tab page. This time is from // before we created this WebContents.
diff --git a/chrome/browser/ui/views/chrome_browser_main_extra_parts_views_linux.cc b/chrome/browser/ui/views/chrome_browser_main_extra_parts_views_linux.cc index 1646e50..285689c7 100644 --- a/chrome/browser/ui/views/chrome_browser_main_extra_parts_views_linux.cc +++ b/chrome/browser/ui/views/chrome_browser_main_extra_parts_views_linux.cc
@@ -28,8 +28,8 @@ views::LinuxUI* linux_ui = nullptr; // GtkUi is the only LinuxUI implementation for now. #if BUILDFLAG(USE_GTK) - DCHECK(ui::GtkUiDelegate::instance()); - linux_ui = BuildGtkUi(ui::GtkUiDelegate::instance()); + if (ui::GtkUiDelegate::instance()) + linux_ui = BuildGtkUi(ui::GtkUiDelegate::instance()); #endif return linux_ui; }
diff --git a/chrome/browser/ui/views/extensions/bookmark_override_browsertest.cc b/chrome/browser/ui/views/extensions/bookmark_override_browsertest.cc deleted file mode 100644 index fd74bd93..0000000 --- a/chrome/browser/ui/views/extensions/bookmark_override_browsertest.cc +++ /dev/null
@@ -1,93 +0,0 @@ -// Copyright 2014 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "build/build_config.h" -#include "chrome/app/chrome_command_ids.h" -#include "chrome/browser/extensions/api/commands/command_service.h" -#include "chrome/browser/extensions/extension_apitest.h" -#include "chrome/browser/ui/browser.h" -#include "chrome/browser/ui/browser_commands.h" -#include "chrome/browser/ui/tabs/tab_strip_model.h" -#include "chrome/browser/ui/views/bookmarks/bookmark_bubble_view.h" -#include "chrome/browser/ui/views/frame/browser_view.h" -#include "chrome/browser/ui/views/location_bar/star_view.h" -#include "chrome/browser/ui/views/toolbar/toolbar_view.h" -#include "chrome/test/base/ui_test_utils.h" -#include "extensions/common/manifest_constants.h" -#include "extensions/test/result_catcher.h" -#include "net/test/embedded_test_server/embedded_test_server.h" -#include "ui/events/event_utils.h" - -typedef extensions::ExtensionApiTest BookmarkOverrideTest; - -namespace { -// Bookmark this page keybinding. -#if defined(OS_MACOSX) -const char kBookmarkKeybinding[] = "Command+D"; -#else -const char kBookmarkKeybinding[] = "Ctrl+D"; -#endif // defined(OS_MACOSX) -} - -// Test that clicking the star brings up the bookmark UI, if no extension -// requests to override ctrl-D and the user has assigned it to an extension. -// Flaky on all platforms: https://crbug.com/448956. -IN_PROC_BROWSER_TEST_F(BookmarkOverrideTest, DISABLED_NonOverrideStarClick) { - ASSERT_TRUE(embedded_test_server()->Start()); - ASSERT_TRUE(RunExtensionTest("keybinding/basics")) << message_; - const extensions::Extension* extension = GetSingleLoadedExtension(); - - extensions::CommandService* command_service = - extensions::CommandService::Get(browser()->profile()); - - // Simulate the user setting the keybinding to Ctrl+D. - command_service->UpdateKeybindingPrefs( - extension->id(), extensions::manifest_values::kBrowserActionCommandEvent, - kBookmarkKeybinding); - - // Check that the BookmarkBubbleView is shown when clicking on the star. - BrowserView* browser_view = reinterpret_cast<BrowserView*>( - browser()->window()); - views::View* star_view = - browser_view->toolbar_button_provider()->GetPageActionIconView( - PageActionIconType::kBookmarkStar); - - ui::MouseEvent pressed_event( - ui::ET_MOUSE_PRESSED, gfx::Point(), gfx::Point(), ui::EventTimeForNow(), - ui::EF_LEFT_MOUSE_BUTTON, ui::EF_LEFT_MOUSE_BUTTON); - ui::MouseEvent released_event( - ui::ET_MOUSE_RELEASED, gfx::Point(), gfx::Point(), ui::EventTimeForNow(), - ui::EF_LEFT_MOUSE_BUTTON, ui::EF_LEFT_MOUSE_BUTTON); - - // Verify that clicking once shows the bookmark bubble. - EXPECT_FALSE(BookmarkBubbleView::bookmark_bubble()); - star_view->OnMousePressed(pressed_event); - EXPECT_FALSE(BookmarkBubbleView::bookmark_bubble()); - star_view->OnMouseReleased(released_event); - EXPECT_TRUE(BookmarkBubbleView::bookmark_bubble()); -} - -// Test that invoking the IDC_BOOKMARK_THIS_TAB command (as done by the app -// menu) brings up the bookmark UI, if no extension requests to override ctrl-D -// and the user has assigned it to an extension. Flaky on all platforms: -// https://crbug.com/448956. -IN_PROC_BROWSER_TEST_F(BookmarkOverrideTest, DISABLED_NonOverrideBookmarkTab) { - ASSERT_TRUE(embedded_test_server()->Start()); - ASSERT_TRUE(RunExtensionTest("keybinding/basics")) << message_; - const extensions::Extension* extension = GetSingleLoadedExtension(); - - extensions::CommandService* command_service = - extensions::CommandService::Get(browser()->profile()); - - // Simulate the user setting the keybinding to Ctrl+D. - command_service->UpdateKeybindingPrefs( - extension->id(), extensions::manifest_values::kBrowserActionCommandEvent, - kBookmarkKeybinding); - - // Check that the BookmarkBubbleView is shown when executing - // IDC_BOOKMARK_THIS_TAB. - EXPECT_FALSE(BookmarkBubbleView::bookmark_bubble()); - chrome::ExecuteCommand(browser(), IDC_BOOKMARK_THIS_TAB); - EXPECT_TRUE(BookmarkBubbleView::bookmark_bubble()); -}
diff --git a/chrome/browser/ui/views/extensions/chooser_dialog_view_unittest.cc b/chrome/browser/ui/views/extensions/chooser_dialog_view_unittest.cc index f346b19..2064c5fb 100644 --- a/chrome/browser/ui/views/extensions/chooser_dialog_view_unittest.cc +++ b/chrome/browser/ui/views/extensions/chooser_dialog_view_unittest.cc
@@ -22,28 +22,31 @@ void SetUp() override { ChromeViewsTestBase::SetUp(); + auto controller = std::make_unique<FakeBluetoothChooserController>(); controller_ = controller.get(); dialog_ = new ChooserDialogView(std::move(controller)); + // Must be called after a view has registered itself with the controller. + controller_->SetBluetoothStatus( + FakeBluetoothChooserController::BluetoothStatus::IDLE); + gfx::NativeView parent = gfx::kNullNativeView; #if defined(OS_MACOSX) // We need a native view parent for the dialog to avoid a DCHECK // on Mac. parent_widget_ = CreateTestWidget(); - - widget_ = views::DialogDelegate::CreateDialogWidget( - dialog_, GetContext(), parent_widget_->GetNativeView()); + parent = parent_widget_->GetNativeView(); +#endif + widget_ = views::DialogDelegate::CreateDialogWidget(dialog_, GetContext(), + parent); widget_->SetVisibilityChangedAnimationsEnabled(false); + widget_->Show(); +#if defined(OS_MACOSX) // Necessary for Mac. On other platforms this happens in the focus // manager, but it's disabled for Mac due to crbug.com/650859. parent_widget_->Activate(); widget_->Activate(); -#else - widget_ = views::DialogDelegate::CreateDialogWidget(dialog_, GetContext(), - nullptr); #endif - controller_->SetBluetoothStatus( - FakeBluetoothChooserController::BluetoothStatus::IDLE); ASSERT_NE(nullptr, table_view()); ASSERT_NE(nullptr, re_scan_button()); @@ -51,9 +54,7 @@ void TearDown() override { widget_->Close(); -#if defined(OS_MACOSX) parent_widget_.reset(); -#endif ChromeViewsTestBase::TearDown(); } @@ -79,9 +80,7 @@ FakeBluetoothChooserController* controller_ = nullptr; private: -#if defined(OS_MACOSX) std::unique_ptr<views::Widget> parent_widget_; -#endif views::Widget* widget_ = nullptr; DISALLOW_COPY_AND_ASSIGN(ChooserDialogViewTest);
diff --git a/chrome/browser/ui/views/extensions/extension_dialog.cc b/chrome/browser/ui/views/extensions/extension_dialog.cc index 445459f..ebeb13e 100644 --- a/chrome/browser/ui/views/extensions/extension_dialog.cc +++ b/chrome/browser/ui/views/extensions/extension_dialog.cc
@@ -30,23 +30,25 @@ #if defined(OS_CHROMEOS) #include "ash/public/cpp/tablet_mode.h" +#include "ash/public/cpp/window_properties.h" +#include "ui/aura/window.h" #endif using content::BrowserContext; using content::WebContents; +ExtensionDialog::InitParams::InitParams(int width, int height) + : width(width), height(height) {} +ExtensionDialog::InitParams::InitParams(const InitParams& other) = default; +ExtensionDialog::InitParams::~InitParams() = default; + // static ExtensionDialog* ExtensionDialog::Show(const GURL& url, gfx::NativeWindow parent_window, Profile* profile, WebContents* web_contents, - bool is_modal, - int width, - int height, - int min_width, - int min_height, - const base::string16& title, - ExtensionDialogObserver* observer) { + ExtensionDialogObserver* observer, + const InitParams& init_params) { std::unique_ptr<extensions::ExtensionViewHost> host = extensions::ExtensionViewHostFactory::CreateDialogHost(url, profile); if (!host) @@ -54,16 +56,16 @@ // Preferred size must be set before views::Widget::CreateWindowWithParent() // is called because CreateWindowWithParent() references CanResize(). ExtensionViewViews* view = GetExtensionView(host.get()); - view->SetPreferredSize(gfx::Size(width, height)); - view->set_minimum_size(gfx::Size(min_width, min_height)); + view->SetPreferredSize(gfx::Size(init_params.width, init_params.height)); + view->set_minimum_size( + gfx::Size(init_params.min_width, init_params.min_height)); host->SetAssociatedWebContents(web_contents); DCHECK(parent_window); extensions::ExtensionViewHost* host_ptr = host.get(); ExtensionDialog* dialog = new ExtensionDialog(std::move(host), observer); - dialog->set_title(title); - dialog->InitWindow(parent_window, is_modal, width, height, min_width, - min_height); + dialog->set_title(init_params.title); + dialog->InitWindow(parent_window, init_params); // Show a white background while the extension loads. This is prettier than // flashing a black unfilled window frame. @@ -144,8 +146,8 @@ } void ExtensionDialog::Observe(int type, - const content::NotificationSource& source, - const content::NotificationDetails& details) { + const content::NotificationSource& source, + const content::NotificationDetails& details) { switch (type) { case extensions::NOTIFICATION_EXTENSION_HOST_DID_STOP_FIRST_LOAD: // Avoid potential overdraw by removing the temporary background after @@ -199,15 +201,12 @@ } void ExtensionDialog::InitWindow(gfx::NativeWindow parent, - bool is_modal, - int width, - int height, - int min_width, - int min_height) { + const InitParams& init_params) { views::Widget* window = - is_modal ? constrained_window::CreateBrowserModalDialogViews(this, parent) - : views::DialogDelegate::CreateDialogWidget( - this, nullptr /* context */, nullptr /* parent */); + init_params.is_modal + ? constrained_window::CreateBrowserModalDialogViews(this, parent) + : views::DialogDelegate::CreateDialogWidget( + this, nullptr /* context */, nullptr /* parent */); // Center the window over the parent browser window or the screen. gfx::Rect screen_rect = @@ -215,22 +214,31 @@ gfx::Rect bounds = parent ? views::Widget::GetWidgetForNativeWindow(parent) ->GetWindowBoundsInScreen() : screen_rect; - bounds.ClampToCenteredSize({width, height}); + bounds.ClampToCenteredSize({init_params.width, init_params.height}); // Make sure bounds is larger than {min_width, min_height}. - if (bounds.width() < min_width) { - bounds.set_x(bounds.x() + (bounds.width() - min_width) / 2); - bounds.set_width(min_width); + if (bounds.width() < init_params.min_width) { + bounds.set_x(bounds.x() + (bounds.width() - init_params.min_width) / 2); + bounds.set_width(init_params.min_width); } - if (bounds.height() < min_height) { - bounds.set_y(bounds.y() + (bounds.height() - min_height) / 2); - bounds.set_height(min_height); + if (bounds.height() < init_params.min_height) { + bounds.set_y(bounds.y() + (bounds.height() - init_params.min_height) / 2); + bounds.set_height(init_params.min_height); } // Make sure bounds is still on screen. bounds.AdjustToFit(screen_rect); window->SetBounds(bounds); +#if defined(OS_CHROMEOS) + if (init_params.title_color) { + aura::Window* native_view = window->GetNativeWindow(); + // Frame active color changes the title color when dialog is active. + native_view->SetProperty(ash::kFrameActiveColorKey, + init_params.title_color.value()); + } +#endif + window->Show(); // TODO(jamescook): Remove redundant call to Activate()? window->Activate();
diff --git a/chrome/browser/ui/views/extensions/extension_dialog.h b/chrome/browser/ui/views/extensions/extension_dialog.h index be094fe0..9c8ba00 100644 --- a/chrome/browser/ui/views/extensions/extension_dialog.h +++ b/chrome/browser/ui/views/extensions/extension_dialog.h
@@ -10,8 +10,11 @@ #include "base/logging.h" #include "base/macros.h" #include "base/memory/ref_counted.h" +#include "base/optional.h" +#include "base/strings/string16.h" #include "content/public/browser/notification_observer.h" #include "content/public/browser/notification_registrar.h" +#include "third_party/skia/include/core/SkColor.h" #include "ui/gfx/native_widget_types.h" #include "ui/views/window/dialog_delegate.h" @@ -35,23 +38,36 @@ public content::NotificationObserver, public base::RefCounted<ExtensionDialog> { public: + struct InitParams { + InitParams(int width, int height); + InitParams(const InitParams& other); + ~InitParams(); + + // |is_modal| determines whether the dialog is modal to |parent_window|. + bool is_modal = false; + + // |width| and |height| are the size of the dialog in pixels. + int width = 0; + int height = 0; + int min_width = 0; + int min_height = 0; + base::string16 title; + +#if defined(OS_CHROMEOS) + // |title_color| customizes the color of the window title. + base::Optional<SkColor> title_color; +#endif + }; // Create and show a dialog with |url| centered over the provided window. // |parent_window| is the parent window to which the pop-up will be attached. // |profile| is the profile that the extension is registered with. // |web_contents| is the tab that spawned the dialog. - // |is_modal| determines whether the dialog is modal to |parent_window|. - // |width| and |height| are the size of the dialog in pixels. static ExtensionDialog* Show(const GURL& url, gfx::NativeWindow parent_window, Profile* profile, content::WebContents* web_contents, - bool is_modal, - int width, - int height, - int min_width, - int min_height, - const base::string16& title, - ExtensionDialogObserver* observer); + ExtensionDialogObserver* observer, + const InitParams& init_params); // Notifies the dialog that the observer has been destroyed and should not // be sent notifications. @@ -95,11 +111,7 @@ ExtensionDialogObserver* observer); void InitWindow(gfx::NativeWindow parent_window, - bool is_modal, - int width, - int height, - int min_width, - int min_height); + const InitParams& init_params); ExtensionViewViews* GetExtensionView() const; static ExtensionViewViews* GetExtensionView(
diff --git a/chrome/browser/ui/views/extensions/extension_dialog_bounds_browsertest.cc b/chrome/browser/ui/views/extensions/extension_dialog_bounds_browsertest.cc index bb26567d..aa9aa17 100644 --- a/chrome/browser/ui/views/extensions/extension_dialog_bounds_browsertest.cc +++ b/chrome/browser/ui/views/extensions/extension_dialog_bounds_browsertest.cc
@@ -54,16 +54,14 @@ // Dimensions of a dialog that would be bigger than the remaining display // work area when the docked magnifier is enabled. - constexpr int kDialogWidth = 1000; - constexpr int kDialogHeight = 1000; - constexpr int kDialogMinimumWidth = 640; - constexpr int kDialogMinimumHeight = 240; + ExtensionDialog::InitParams params(1000, 1000); + params.is_modal = true; + params.min_width = 640; + params.min_height = 240; auto* dialog = ExtensionDialog::Show( extension->url().Resolve("main.html"), browser()->window()->GetNativeWindow(), browser()->profile(), - nullptr /* web_contents */, true /* is_modal */, kDialogWidth, - kDialogHeight, kDialogMinimumWidth, kDialogMinimumHeight, - base::string16() /* title */, nullptr /* observer */); + nullptr /* web_contents */, nullptr /* observer */, params); ASSERT_TRUE(dialog); ASSERT_TRUE(init_listener.WaitUntilSatisfied()); }
diff --git a/chrome/browser/ui/views/extensions/extension_dialog_browsertest.cc b/chrome/browser/ui/views/extensions/extension_dialog_browsertest.cc index 9e5ea4c..8ec34e3e 100644 --- a/chrome/browser/ui/views/extensions/extension_dialog_browsertest.cc +++ b/chrome/browser/ui/views/extensions/extension_dialog_browsertest.cc
@@ -22,13 +22,14 @@ LoadExtension(test_data_dir_.AppendASCII("uitest/tab_traversal")); ASSERT_TRUE(extension.get()); - constexpr int kDialogWidth = 400; - constexpr int kDialogHeight = 300; + ExtensionDialog::InitParams params(400, 300); + params.is_modal = true; + params.min_width = 400; + params.min_height = 300; auto* dialog = ExtensionDialog::Show( extension->url().Resolve("main.html"), browser()->window()->GetNativeWindow(), browser()->profile(), - /*web_contents=*/nullptr, /*is_modal=*/true, kDialogWidth, kDialogHeight, - kDialogWidth, kDialogHeight, base::string16(), /*observer=*/nullptr); + /*web_contents=*/nullptr, /*observer=*/nullptr, params); ASSERT_TRUE(dialog); ASSERT_TRUE(init_listener.WaitUntilSatisfied());
diff --git a/chrome/browser/ui/views/extensions/extension_dialog_interactive_uitest.cc b/chrome/browser/ui/views/extensions/extension_dialog_interactive_uitest.cc index 17d2a1a..4e2d141 100644 --- a/chrome/browser/ui/views/extensions/extension_dialog_interactive_uitest.cc +++ b/chrome/browser/ui/views/extensions/extension_dialog_interactive_uitest.cc
@@ -44,10 +44,14 @@ // Open ExtensionDialog, whose initial page is the extension's main.html. // The main.html contains three buttons. - ExtensionDialog* dialog = ExtensionDialog::Show( - extension->url().Resolve("main.html"), - browser()->window()->GetNativeWindow(), browser()->profile(), nullptr, - true, 300, 300, 300, 300, base::string16(), nullptr); + ExtensionDialog::InitParams params(300, 300); + params.is_modal = true; + params.min_width = 300; + params.min_height = 300; + ExtensionDialog* dialog = + ExtensionDialog::Show(extension->url().Resolve("main.html"), + browser()->window()->GetNativeWindow(), + browser()->profile(), nullptr, nullptr, params); ASSERT_TRUE(dialog); ASSERT_TRUE(init_listener.WaitUntilSatisfied());
diff --git a/chrome/browser/ui/views/frame/browser_view.cc b/chrome/browser/ui/views/frame/browser_view.cc index 6a74a9c6..714a595 100644 --- a/chrome/browser/ui/views/frame/browser_view.cc +++ b/chrome/browser/ui/views/frame/browser_view.cc
@@ -1454,9 +1454,8 @@ return; GetFocusManager()->RotatePaneFocus( - forwards ? - views::FocusManager::kForward : views::FocusManager::kBackward, - views::FocusManager::kWrap); + forwards ? views::FocusManager::kForward : views::FocusManager::kBackward, + views::FocusManager::FocusCycleWrapping::kEnabled); } bool BrowserView::ActivateFirstInactiveBubbleForAccessibility() {
diff --git a/chrome/browser/ui/views/frame/top_controls_slide_controller_chromeos_browsertest.cc b/chrome/browser/ui/views/frame/top_controls_slide_controller_chromeos_browsertest.cc index fac19b9f..e806e719 100644 --- a/chrome/browser/ui/views/frame/top_controls_slide_controller_chromeos_browsertest.cc +++ b/chrome/browser/ui/views/frame/top_controls_slide_controller_chromeos_browsertest.cc
@@ -1350,7 +1350,7 @@ // request bubble resulting in top chrome unhiding. auto decided = [](ContentSetting) {}; permissions::PermissionRequestImpl permission_request( - url, ContentSettingsType::GEOLOCATION, true /* user_gesture */, + url, url, ContentSettingsType::GEOLOCATION, true /* user_gesture */, base::BindRepeating(decided), base::DoNothing() /* delete_callback */); auto* permission_manager = permissions::PermissionRequestManager::FromWebContents(active_contents);
diff --git a/chrome/browser/ui/views/omnibox/omnibox_popup_contents_view.h b/chrome/browser/ui/views/omnibox/omnibox_popup_contents_view.h index 9d0641d..c0d94af 100644 --- a/chrome/browser/ui/views/omnibox/omnibox_popup_contents_view.h +++ b/chrome/browser/ui/views/omnibox/omnibox_popup_contents_view.h
@@ -108,11 +108,10 @@ // the specified point. size_t GetIndexForPoint(const gfx::Point& point); - LocationBarView* location_bar_view() { return location_bar_view_; } - // views::View: const char* GetClassName() const override; + // Our model that contains our business logic. std::unique_ptr<OmniboxPopupModel> model_; // The popup that contains this view. We create this, but it deletes itself @@ -124,6 +123,7 @@ // The edit view that invokes us. OmniboxViewViews* omnibox_view_; + // The location bar view that owns |omnibox_view_|. LocationBarView* location_bar_view_; // The child WebView for the suggestions. This only exists if the
diff --git a/chrome/browser/ui/views/omnibox/omnibox_result_view_unittest.cc b/chrome/browser/ui/views/omnibox/omnibox_result_view_unittest.cc index 7860f12..6f27e09 100644 --- a/chrome/browser/ui/views/omnibox/omnibox_result_view_unittest.cc +++ b/chrome/browser/ui/views/omnibox/omnibox_result_view_unittest.cc
@@ -60,6 +60,14 @@ // Create a widget and assign bounds to support calls to HitTestPoint. widget_ = CreateTestWidget(); + // Install |test_screen_| after superclass setup and widget creation; on Ash + // both these require the Screen to work well with the underlying Shell, and + // TestScreen has no knowledge of that. + test_screen_ = std::make_unique<display::test::TestScreen>(); + scoped_screen_override_ = + std::make_unique<display::test::ScopedScreenOverride>( + test_screen_.get()); + edit_model_ = std::make_unique<OmniboxEditModel>( nullptr, nullptr, std::make_unique<TestOmniboxClient>()); popup_view_ = @@ -77,6 +85,8 @@ } void TearDown() override { + scoped_screen_override_.reset(); + test_screen_.reset(); widget_.reset(); ChromeViewsTestBase::TearDown(); } @@ -91,7 +101,7 @@ int flags, float x, float y) { - test_screen_.set_cursor_screen_point(gfx::Point(x, y)); + test_screen_->set_cursor_screen_point(gfx::Point(x, y)); return ui::MouseEvent(type, gfx::Point(x, y), gfx::Point(), ui::EventTimeForNow(), flags, 0); } @@ -105,8 +115,8 @@ OmniboxResultView* result_view_; std::unique_ptr<views::Widget> widget_; - display::test::TestScreen test_screen_; - display::test::ScopedScreenOverride scoped_screen_override_{&test_screen_}; + std::unique_ptr<display::test::TestScreen> test_screen_; + std::unique_ptr<display::test::ScopedScreenOverride> scoped_screen_override_; }; TEST_F(OmniboxResultViewTest, MousePressedWithLeftButtonSelectsThisResult) {
diff --git a/chrome/browser/ui/views/passwords/password_save_unsynced_credentials_locally_view.cc b/chrome/browser/ui/views/passwords/password_save_unsynced_credentials_locally_view.cc new file mode 100644 index 0000000..d811534 --- /dev/null +++ b/chrome/browser/ui/views/passwords/password_save_unsynced_credentials_locally_view.cc
@@ -0,0 +1,82 @@ +// Copyright 2020 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "chrome/browser/ui/views/passwords/password_save_unsynced_credentials_locally_view.h" + +#include <numeric> +#include <utility> + +#include "base/macros.h" +#include "base/strings/utf_string_conversions.h" +#include "chrome/browser/ui/passwords/manage_passwords_view_utils.h" +#include "chrome/browser/ui/passwords/passwords_model_delegate.h" +#include "chrome/browser/ui/views/chrome_layout_provider.h" +#include "chrome/browser/ui/views/passwords/password_items_view.h" +#include "chrome/grit/generated_resources.h" +#include "ui/base/ui_base_types.h" +#include "ui/views/controls/label.h" +#include "ui/views/layout/box_layout.h" +#include "ui/views/window/dialog_delegate.h" + +PasswordSaveUnsyncedCredentialsLocallyView:: + PasswordSaveUnsyncedCredentialsLocallyView( + content::WebContents* web_contents, + views::View* anchor_view) + : PasswordBubbleViewBase(web_contents, + anchor_view, + /*easily_dismissable=*/false), + controller_(PasswordsModelDelegateFromWebContents(web_contents)) { + DialogDelegate::SetButtons(ui::DIALOG_BUTTON_OK | ui::DIALOG_BUTTON_CANCEL); + DialogDelegate::SetAcceptCallback(base::BindOnce( + &SaveUnsyncedCredentialsLocallyBubbleController::OnSaveClicked, + base::Unretained(&controller_))); + // TODO(crbug.com/1062344): Add proper (translated) string. + DialogDelegate::SetButtonLabel(ui::DIALOG_BUTTON_OK, + base::ASCIIToUTF16("Save")); + DialogDelegate::SetCancelCallback(base::BindOnce( + &SaveUnsyncedCredentialsLocallyBubbleController::OnCancelClicked, + base::Unretained(&controller_))); + CreateLayout(); +} + +PasswordSaveUnsyncedCredentialsLocallyView:: + ~PasswordSaveUnsyncedCredentialsLocallyView() = default; + +PasswordBubbleControllerBase* +PasswordSaveUnsyncedCredentialsLocallyView::GetController() { + return &controller_; +} + +const PasswordBubbleControllerBase* +PasswordSaveUnsyncedCredentialsLocallyView::GetController() const { + return &controller_; +} + +void PasswordSaveUnsyncedCredentialsLocallyView::CreateLayout() { + SetLayoutManager(std::make_unique<views::BoxLayout>( + views::BoxLayout::Orientation::kVertical)); + for (const autofill::PasswordForm& row : controller_.unsynced_credentials()) { + auto* row_view = AddChildView(std::make_unique<views::View>()); + auto* username_label = row_view->AddChildView(CreateUsernameLabel(row)); + auto* password_label = row_view->AddChildView( + CreatePasswordLabel(row, IDS_PASSWORDS_VIA_FEDERATION, false)); + auto* row_layout = + row_view->SetLayoutManager(std::make_unique<views::BoxLayout>( + views::BoxLayout::Orientation::kHorizontal)); + row_layout->SetFlexForView(username_label, 1); + row_layout->SetFlexForView(password_label, 1); + } +} + +bool PasswordSaveUnsyncedCredentialsLocallyView::ShouldShowCloseButton() const { + return true; +} + +gfx::Size PasswordSaveUnsyncedCredentialsLocallyView::CalculatePreferredSize() + const { + const int width = ChromeLayoutProvider::Get()->GetDistanceMetric( + DISTANCE_BUBBLE_PREFERRED_WIDTH) - + margins().width(); + return gfx::Size(width, GetHeightForWidth(width)); +}
diff --git a/chrome/browser/ui/views/passwords/password_save_unsynced_credentials_locally_view.h b/chrome/browser/ui/views/passwords/password_save_unsynced_credentials_locally_view.h new file mode 100644 index 0000000..e819913 --- /dev/null +++ b/chrome/browser/ui/views/passwords/password_save_unsynced_credentials_locally_view.h
@@ -0,0 +1,42 @@ +// Copyright 2020 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef CHROME_BROWSER_UI_VIEWS_PASSWORDS_PASSWORD_SAVE_UNSYNCED_CREDENTIALS_LOCALLY_VIEW_H_ +#define CHROME_BROWSER_UI_VIEWS_PASSWORDS_PASSWORD_SAVE_UNSYNCED_CREDENTIALS_LOCALLY_VIEW_H_ + +#include <memory> +#include <vector> + +#include "base/macros.h" +#include "chrome/browser/ui/passwords/bubble_controllers/save_unsynced_credentials_locally_bubble_controller.h" +#include "chrome/browser/ui/views/passwords/password_bubble_view_base.h" +#include "components/autofill/core/common/password_form.h" +#include "content/public/browser/web_contents.h" +#include "ui/views/view.h" + +// A dialog that shows up on sign out in case there are passwords not committed +// to the user account. By clicking the save button, the user can save those +// passwords locally. +class PasswordSaveUnsyncedCredentialsLocallyView + : public PasswordBubbleViewBase { + public: + PasswordSaveUnsyncedCredentialsLocallyView(content::WebContents* web_contents, + views::View* anchor_view); + ~PasswordSaveUnsyncedCredentialsLocallyView() override; + + private: + // PasswordBubbleViewBase + PasswordBubbleControllerBase* GetController() override; + const PasswordBubbleControllerBase* GetController() const override; + + void CreateLayout(); + + // LocationBarBubbleDelegateView: + bool ShouldShowCloseButton() const override; + gfx::Size CalculatePreferredSize() const override; + + SaveUnsyncedCredentialsLocallyBubbleController controller_; +}; + +#endif // CHROME_BROWSER_UI_VIEWS_PASSWORDS_PASSWORD_SAVE_UNSYNCED_CREDENTIALS_LOCALLY_VIEW_H_
diff --git a/chrome/browser/ui/views/passwords/password_save_unsynced_credentials_locally_view_unittest.cc b/chrome/browser/ui/views/passwords/password_save_unsynced_credentials_locally_view_unittest.cc new file mode 100644 index 0000000..cb15cd08 --- /dev/null +++ b/chrome/browser/ui/views/passwords/password_save_unsynced_credentials_locally_view_unittest.cc
@@ -0,0 +1,63 @@ +// Copyright 2020 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "chrome/browser/ui/views/passwords/password_save_unsynced_credentials_locally_view.h" + +#include <vector> + +#include "base/strings/utf_string_conversions.h" +#include "chrome/browser/ui/passwords/passwords_model_delegate_mock.h" +#include "chrome/browser/ui/views/passwords/password_bubble_view_test_base.h" +#include "components/autofill/core/common/password_form.h" +#include "testing/gmock/include/gmock/gmock.h" +#include "testing/gtest/include/gtest/gtest.h" +#include "ui/views/bubble/bubble_dialog_delegate_view.h" +#include "ui/views/widget/widget.h" + +using base::ASCIIToUTF16; +using testing::ReturnRef; + +class PasswordSaveUnsyncedCredentialsLocallyViewTest + : public PasswordBubbleViewTestBase { + public: + PasswordSaveUnsyncedCredentialsLocallyViewTest() { + ON_CALL(*model_delegate_mock(), GetUnsyncedCredentials()) + .WillByDefault(ReturnRef(unsynced_credentials_)); + + unsynced_credentials_.resize(1); + unsynced_credentials_[0].username_value = ASCIIToUTF16("user"); + unsynced_credentials_[0].password_value = ASCIIToUTF16("password"); + } + ~PasswordSaveUnsyncedCredentialsLocallyViewTest() override = default; + + void CreateViewAndShow(); + + void TearDown() override; + + protected: + PasswordSaveUnsyncedCredentialsLocallyView* view_; + std::vector<autofill::PasswordForm> unsynced_credentials_; +}; + +void PasswordSaveUnsyncedCredentialsLocallyViewTest::CreateViewAndShow() { + CreateAnchorViewAndShow(); + + view_ = new PasswordSaveUnsyncedCredentialsLocallyView(web_contents(), + anchor_view()); + views::BubbleDialogDelegateView::CreateBubble(view_)->Show(); +} + +void PasswordSaveUnsyncedCredentialsLocallyViewTest::TearDown() { + view_->GetWidget()->CloseWithReason( + views::Widget::ClosedReason::kCloseButtonClicked); + + PasswordBubbleViewTestBase::TearDown(); +} + +TEST_F(PasswordSaveUnsyncedCredentialsLocallyViewTest, HasTitleAndTwoButtons) { + CreateViewAndShow(); + EXPECT_TRUE(view_->ShouldShowWindowTitle()); + EXPECT_TRUE(view_->GetOkButton()); + EXPECT_TRUE(view_->GetCancelButton()); +}
diff --git a/chrome/browser/ui/views/renderer_context_menu/render_view_context_menu_views.cc b/chrome/browser/ui/views/renderer_context_menu/render_view_context_menu_views.cc index 3d829c6..8d62892 100644 --- a/chrome/browser/ui/views/renderer_context_menu/render_view_context_menu_views.cc +++ b/chrome/browser/ui/views/renderer_context_menu/render_view_context_menu_views.cc
@@ -30,10 +30,73 @@ #include "ui/views/controls/menu/menu_host.h" #include "ui/views/controls/menu/menu_item_view.h" #include "ui/views/controls/menu/submenu_view.h" +#include "ui/views/view.h" +#include "ui/views/view_observer.h" #include "ui/views/widget/widget.h" using content::WebContents; +class RenderViewContextMenuViews::SubmenuViewObserver + : public views::ViewObserver, + public views::WidgetObserver { + public: + SubmenuViewObserver(RenderViewContextMenuViews* parent, + views::SubmenuView* submenu_view) + : parent_(parent), submenu_view_(submenu_view) { + observed_submenu_view_.Add(submenu_view); + auto* widget = submenu_view_->host(); + if (widget) + observed_submenu_widget_.Add(widget); + } + + SubmenuViewObserver(const SubmenuViewObserver&) = delete; + SubmenuViewObserver& operator=(const SubmenuViewObserver&) = delete; + + ~SubmenuViewObserver() override = default; + + // ViewObserver: + void OnViewIsDeleting(views::View* observed_view) override { + // The submenu view is being deleted, make sure the parent no longer + // observes it. + DCHECK_EQ(submenu_view_, observed_view); + parent_->OnSubmenuClosed(); + } + + void OnViewBoundsChanged(views::View* observed_view) override { + DCHECK_EQ(submenu_view_, observed_view); + parent_->OnSubmenuViewBoundsChanged( + submenu_view_->host()->GetWindowBoundsInScreen()); + } + + void OnViewAddedToWidget(views::View* observed_view) override { + DCHECK_EQ(submenu_view_, observed_view); + auto* widget = submenu_view_->host(); + if (widget) + observed_submenu_widget_.Add(widget); + } + + // WidgetObserver: + void OnWidgetBoundsChanged(views::Widget* widget, + const gfx::Rect& new_bounds_in_screen) override { + DCHECK_EQ(submenu_view_->host(), widget); + parent_->OnSubmenuViewBoundsChanged(new_bounds_in_screen); + } + + void OnWidgetClosing(views::Widget* widget) override { + // The widget is being closed, make sure the parent bubble no longer + // observes it. + DCHECK_EQ(submenu_view_->host(), widget); + parent_->OnSubmenuClosed(); + } + + private: + RenderViewContextMenuViews* const parent_; + views::SubmenuView* const submenu_view_; + ScopedObserver<views::View, views::ViewObserver> observed_submenu_view_{this}; + ScopedObserver<views::Widget, views::WidgetObserver> observed_submenu_widget_{ + this}; +}; + //////////////////////////////////////////////////////////////////////////////// // RenderViewContextMenuViews, public: @@ -303,15 +366,17 @@ base::MessageLoopCurrent::ScopedNestableTaskAllower allow; RunMenuAt(top_level_widget, screen_point, params().source_type); - for (auto& observer : observers_) { - auto* submenu_host = static_cast<ToolkitDelegateViews*>(toolkit_delegate()) - ->menu_view() - ->GetSubmenu() - ->host(); - if (submenu_host) { - observer.OnContextMenuShown(params_, - submenu_host->GetWindowBoundsInScreen()); + auto* submenu_view = static_cast<ToolkitDelegateViews*>(toolkit_delegate()) + ->menu_view() + ->GetSubmenu(); + if (submenu_view) { + for (auto& observer : observers_) { + observer.OnContextMenuShown( + params_, submenu_view->host()->GetWindowBoundsInScreen()); } + + submenu_view_observer_ = + std::make_unique<SubmenuViewObserver>(this, submenu_view); } } @@ -331,3 +396,14 @@ ->GetNativeView() : web_contents->GetNativeView(); } + +void RenderViewContextMenuViews::OnSubmenuViewBoundsChanged( + const gfx::Rect& new_bounds_in_screen) { + for (auto& observer : observers_) { + observer.OnContextMenuViewBoundsChanged(new_bounds_in_screen); + } +} + +void RenderViewContextMenuViews::OnSubmenuClosed() { + submenu_view_observer_.reset(); +}
diff --git a/chrome/browser/ui/views/renderer_context_menu/render_view_context_menu_views.h b/chrome/browser/ui/views/renderer_context_menu/render_view_context_menu_views.h index 3e052117..bdaea169 100644 --- a/chrome/browser/ui/views/renderer_context_menu/render_view_context_menu_views.h +++ b/chrome/browser/ui/views/renderer_context_menu/render_view_context_menu_views.h
@@ -52,6 +52,8 @@ ui::Accelerator* accelerator) const override; private: + class SubmenuViewObserver; + void AppendPlatformEditableItems() override; bool IsCommandIdChecked(int command_id) const override; bool IsCommandIdEnabled(int command_id) const override; @@ -62,8 +64,16 @@ aura::Window* GetActiveNativeView(); views::Widget* GetTopLevelWidget(); + void OnSubmenuViewBoundsChanged(const gfx::Rect& new_bounds_in_screen); + void OnSubmenuClosed(); + // Model for the BiDi input submenu. ui::SimpleMenuModel bidi_submenu_model_; + + // View observer of the submenu view and widget. SubmenuViewObserver is used + // to observe bounds changes. + std::unique_ptr<SubmenuViewObserver> submenu_view_observer_; + DISALLOW_COPY_AND_ASSIGN(RenderViewContextMenuViews); };
diff --git a/chrome/browser/ui/views/select_file_dialog_extension.cc b/chrome/browser/ui/views/select_file_dialog_extension.cc index a5e482e..79bccf44 100644 --- a/chrome/browser/ui/views/select_file_dialog_extension.cc +++ b/chrome/browser/ui/views/select_file_dialog_extension.cc
@@ -42,9 +42,12 @@ #include "ui/views/widget/widget.h" #if defined(OS_CHROMEOS) +#include "base/feature_list.h" #include "chrome/browser/chromeos/login/ui/login_display_host.h" #include "chrome/browser/chromeos/login/ui/webui_login_view.h" #include "chrome/browser/chromeos/profiles/profile_helper.h" +#include "chromeos/constants/chromeos_features.h" +#include "ui/gfx/color_palette.h" #endif using extensions::AppWindow; @@ -397,13 +400,22 @@ default_path.BaseName().value(), file_types, file_type_index, default_extension, show_android_picker_apps); + ExtensionDialog::InitParams dialog_params(kFileManagerWidth, + kFileManagerHeight); + dialog_params.is_modal = (owner_window != nullptr); + dialog_params.min_width = kFileManagerMinimumWidth; + dialog_params.min_height = kFileManagerMinimumHeight; + dialog_params.title = file_manager::util::GetSelectFileDialogTitle(type); +#if defined(OS_CHROMEOS) + if (base::FeatureList::IsEnabled(chromeos::features::kFilesNG)) { + dialog_params.title_color = gfx::kGoogleGrey300; + } +#endif + ExtensionDialog* dialog = ExtensionDialog::Show( file_manager_url, base_window ? base_window->GetNativeWindow() : owner_window, profile_, - web_contents, (owner_window != nullptr) /* is_modal */, kFileManagerWidth, - kFileManagerHeight, kFileManagerMinimumWidth, kFileManagerMinimumHeight, - file_manager::util::GetSelectFileDialogTitle(type), - this /* ExtensionDialog::Observer */); + web_contents, this /* ExtensionDialog::Observer */, dialog_params); if (!dialog) { LOG(ERROR) << "Unable to create extension dialog"; return;
diff --git a/chrome/browser/ui/views/select_file_dialog_extension.h b/chrome/browser/ui/views/select_file_dialog_extension.h index 50fc903..78535525 100644 --- a/chrome/browser/ui/views/select_file_dialog_extension.h +++ b/chrome/browser/ui/views/select_file_dialog_extension.h
@@ -93,7 +93,7 @@ void* params) override; private: - friend class SelectFileDialogExtensionBrowserTest; + friend class BaseSelectFileDialogExtensionBrowserTest; friend class SelectFileDialogExtensionTest; friend class SelectFileDialogExtensionTestFactory;
diff --git a/chrome/browser/ui/views/select_file_dialog_extension_browsertest.cc b/chrome/browser/ui/views/select_file_dialog_extension_browsertest.cc index eaa51ab..e1906d0 100644 --- a/chrome/browser/ui/views/select_file_dialog_extension_browsertest.cc +++ b/chrome/browser/ui/views/select_file_dialog_extension_browsertest.cc
@@ -8,6 +8,7 @@ #include "ash/public/cpp/keyboard/keyboard_switches.h" #include "ash/public/cpp/test/shell_test_api.h" +#include "ash/public/cpp/window_properties.h" #include "base/bind_helpers.h" #include "base/files/file_util.h" #include "base/files/scoped_temp_dir.h" @@ -16,6 +17,7 @@ #include "base/path_service.h" #include "base/run_loop.h" #include "base/strings/utf_string_conversions.h" +#include "base/test/scoped_feature_list.h" #include "base/threading/platform_thread.h" #include "base/threading/thread_restrictions.h" #include "build/build_config.h" @@ -45,6 +47,8 @@ #include "extensions/test/extension_test_message_listener.h" #include "net/test/embedded_test_server/embedded_test_server.h" #include "services/service_manager/public/cpp/connector.h" +#include "ui/aura/window.h" +#include "ui/gfx/color_palette.h" #include "ui/shell_dialogs/select_file_dialog.h" #include "ui/shell_dialogs/select_file_policy.h" #include "ui/shell_dialogs/selected_file_info.h" @@ -131,9 +135,8 @@ DISALLOW_COPY_AND_ASSIGN(MockSelectFileDialogListener); }; -class SelectFileDialogExtensionBrowserTest - : public extensions::ExtensionBrowserTest, - public testing::WithParamInterface<bool> { +class BaseSelectFileDialogExtensionBrowserTest + : public extensions::ExtensionBrowserTest { public: enum DialogButtonType { DIALOG_BTN_OK, @@ -256,7 +259,7 @@ ui::SelectFileDialog::FileTypeInfo file_types; file_types.extensions = {{"html"}}; dialog_->SelectFile(dialog_type, base::string16() /* title */, file_path, - GetParam() ? &file_types : nullptr, + UseFileTypeFilter() ? &file_types : nullptr, 0 /* file_type_index */, FILE_PATH_LITERAL("") /* default_extension */, owning_window, this /* params */); @@ -325,6 +328,8 @@ ASSERT_FALSE(dialog_->IsRunning(owning_window)); } + virtual bool UseFileTypeFilter() { return false; } + base::ScopedTempDir tmp_dir_; base::FilePath downloads_dir_; @@ -333,6 +338,15 @@ std::unique_ptr<MockSelectFileDialogListener> second_listener_; scoped_refptr<SelectFileDialogExtension> second_dialog_; + + base::test::ScopedFeatureList feature_list_; +}; + +// Tests FileDialog with and without file filter. +class SelectFileDialogExtensionBrowserTest + : public BaseSelectFileDialogExtensionBrowserTest, + public testing::WithParamInterface<bool> { + bool UseFileTypeFilter() override { return GetParam(); } }; IN_PROC_BROWSER_TEST_P(SelectFileDialogExtensionBrowserTest, CreateAndDestroy) { @@ -584,3 +598,47 @@ INSTANTIATE_TEST_SUITE_P(SelectFileDialogExtensionBrowserTest, SelectFileDialogExtensionBrowserTest, testing::Bool()); + +// Tests that depend on state of flag on and off. +class SelectFileDialogExtensionFlagTest + : public BaseSelectFileDialogExtensionBrowserTest, + public testing::WithParamInterface<bool> { + void SetUp() override { + // Use the GetParam to define the state of the feature flags. + if (GetParam()) { + feature_list_.InitAndEnableFeature(chromeos::features::kFilesNG); + } else { + feature_list_.InitAndDisableFeature(chromeos::features::kFilesNG); + } + + BaseSelectFileDialogExtensionBrowserTest::SetUp(); + } +}; + +IN_PROC_BROWSER_TEST_P(SelectFileDialogExtensionFlagTest, DialogColoredTitle) { + gfx::NativeWindow owning_window = browser()->window()->GetNativeWindow(); + ASSERT_NE(nullptr, owning_window); + + // Open the file dialog on the default path. + ASSERT_NO_FATAL_FAILURE(OpenDialog(ui::SelectFileDialog::SELECT_OPEN_FILE, + base::FilePath(), owning_window, "")); + content::RenderFrameHost* frame_host = + dialog_->GetRenderViewHost()->GetMainFrame(); + aura::Window* dialog_window = + frame_host->GetNativeView()->GetToplevelWindow(); + SkColor value = dialog_window->GetProperty(ash::kFrameActiveColorKey); + + if (GetParam()) { + // FilesNG enabled the title should be grey. + EXPECT_EQ(value, gfx::kGoogleGrey300); + } else { + // FilesNG disabled the title should be the original color. + EXPECT_NE(value, gfx::kGoogleGrey300); + } + + CloseDialog(DIALOG_BTN_CANCEL, owning_window); +} + +INSTANTIATE_TEST_SUITE_P(SelectFileDialogExtensionFlagTest, + SelectFileDialogExtensionFlagTest, + testing::Bool());
diff --git a/chrome/browser/ui/views/tabs/color_picker_view_unittest.cc b/chrome/browser/ui/views/tabs/color_picker_view_unittest.cc index db0aafe..aa5975275 100644 --- a/chrome/browser/ui/views/tabs/color_picker_view_unittest.cc +++ b/chrome/browser/ui/views/tabs/color_picker_view_unittest.cc
@@ -48,10 +48,10 @@ auto color_picker = std::make_unique<ColorPickerView>( bubble_view(), kTestColors, tab_groups::TabGroupColorId::kBlue, color_selected_callback_.Get()); + color_picker->SizeToPreferredSize(); color_picker_ = color_picker.get(); widget_->SetContentsView(color_picker.release()); - - color_picker_->SizeToPreferredSize(); + widget_->Show(); } void TearDown() override {
diff --git a/chrome/browser/ui/webui/chromeos/login/marketing_opt_in_screen_handler.cc b/chrome/browser/ui/webui/chromeos/login/marketing_opt_in_screen_handler.cc index 56719bf6..f4a26f5 100644 --- a/chrome/browser/ui/webui/chromeos/login/marketing_opt_in_screen_handler.cc +++ b/chrome/browser/ui/webui/chromeos/login/marketing_opt_in_screen_handler.cc
@@ -54,8 +54,8 @@ IDS_LOGIN_MARKETING_OPT_IN_SCREEN_GET_CHROMEBOOK_UPDATES); builder->Add("marketingOptInScreenAllSet", IDS_LOGIN_MARKETING_OPT_IN_SCREEN_ALL_SET); - builder->Add("marketingOptInA11yLinkLabel", - IDS_MARKETING_OPT_IN_ACCESSIBILITY_SETTINGS_LINK); + builder->Add("marketingOptInA11yButtonLabel", + IDS_MARKETING_OPT_IN_ACCESSIBILITY_BUTTON_LABEL); builder->Add("finalA11yPageTitle", IDS_MARKETING_OPT_IN_ACCESSIBILITY_TITLE); builder->Add("finalA11yPageNavButtonSettingTitle", IDS_MARKETING_OPT_IN_ACCESSIBILITY_NAV_BUTTON_SETTING_TITLE); @@ -80,16 +80,6 @@ a11y_nav_buttons_toggle_metrics_reporter_timer_.FireNow(); } -void MarketingOptInScreenHandler::UpdateAllSetButtonVisibility(bool visible) { - CallJS("login.MarketingOptInScreen.updateAllSetButtonVisibility", visible); -} - -void MarketingOptInScreenHandler::UpdateA11ySettingsButtonVisibility( - bool shown) { - CallJS("login.MarketingOptInScreen.updateA11ySettingsButtonVisibility", - shown); -} - void MarketingOptInScreenHandler::UpdateA11yShelfNavigationButtonToggle( bool enabled) { CallJS("login.MarketingOptInScreen.updateA11yNavigationButtonToggle", @@ -104,9 +94,6 @@ AddCallback( "login.MarketingOptInScreen.setA11yNavigationButtonsEnabled", &MarketingOptInScreenHandler::HandleSetA11yNavigationButtonsEnabled); - AddCallback( - "login.MarketingOptInScreen.accessibilityPageVisibilityChanged", - &MarketingOptInScreenHandler::HandleAccessibilityPageVisibilityChanged); } void MarketingOptInScreenHandler::GetAdditionalParameters( @@ -123,11 +110,6 @@ screen_->OnAllSet(play_communications_opt_in, tips_communications_opt_in); } -void MarketingOptInScreenHandler::HandleAccessibilityPageVisibilityChanged( - bool shown) { - screen_->OnAccessibilityPageVisibilityChanged(shown); -} - void MarketingOptInScreenHandler::HandleSetA11yNavigationButtonsEnabled( bool enabled) { ProfileManager::GetActiveUserProfile()->GetPrefs()->SetBoolean(
diff --git a/chrome/browser/ui/webui/chromeos/login/marketing_opt_in_screen_handler.h b/chrome/browser/ui/webui/chromeos/login/marketing_opt_in_screen_handler.h index 02fa13e..d9f2278 100644 --- a/chrome/browser/ui/webui/chromeos/login/marketing_opt_in_screen_handler.h +++ b/chrome/browser/ui/webui/chromeos/login/marketing_opt_in_screen_handler.h
@@ -30,12 +30,6 @@ // Hides the contents of the screen. virtual void Hide() = 0; - // Shows or hides the screen's all set (next) button visibility. - virtual void UpdateAllSetButtonVisibility(bool visible) = 0; - - // Sets whether the a11y Settings button is visible. - virtual void UpdateA11ySettingsButtonVisibility(bool shown) = 0; - // Sets whether the a11y setting for showing shelf navigation buttons is // toggled on or off. virtual void UpdateA11yShelfNavigationButtonToggle(bool enabled) = 0; @@ -58,8 +52,6 @@ void Bind(MarketingOptInScreen* screen) override; void Show() override; void Hide() override; - void UpdateAllSetButtonVisibility(bool visible) override; - void UpdateA11ySettingsButtonVisibility(bool shown) override; void UpdateA11yShelfNavigationButtonToggle(bool enabled) override; private: @@ -71,7 +63,6 @@ // WebUI event handlers. void HandleAllSet(bool play_communications_opt_in, bool tips_communications_opt_in); - void HandleAccessibilityPageVisibilityChanged(bool shown); void HandleSetA11yNavigationButtonsEnabled(bool enabled); MarketingOptInScreen* screen_ = nullptr;
diff --git a/chrome/browser/ui/webui/discards/BUILD.gn b/chrome/browser/ui/webui/discards/BUILD.gn index 91df9ad..ec52c2e 100644 --- a/chrome/browser/ui/webui/discards/BUILD.gn +++ b/chrome/browser/ui/webui/discards/BUILD.gn
@@ -6,7 +6,10 @@ if (is_win || is_mac || is_desktop_linux || is_chromeos) { mojom("mojo_bindings") { - sources = [ "discards.mojom" ] + sources = [ + "discards.mojom", + "site_data.mojom", + ] public_deps = [ "//chrome/browser/resource_coordinator:mojo_bindings",
diff --git a/chrome/browser/ui/webui/discards/discards.mojom b/chrome/browser/ui/webui/discards/discards.mojom index 38a6a7b..d4d0aba 100644 --- a/chrome/browser/ui/webui/discards/discards.mojom +++ b/chrome/browser/ui/webui/discards/discards.mojom
@@ -16,72 +16,6 @@ VISIBLE = 2, }; -struct SiteCharacteristicsFeature { - // The cumulative observation time for this feature in seconds, set to 0 once - // this feature has been observed. - int64 observation_duration; - // The time at which this feature has been used (set to 0 if it hasn't been - // used), in seconds since epoch. - int64 use_timestamp; -}; - -struct SiteCharacteristicsPerformanceMeasurement { - // A decaying average of the CPU usage measurements. Units: microseconds. - float avg_cpu_usage_us; - // A decaying average of the process footprint measurements. Units: kilobytes. - float avg_footprint_kb; - // A decaying average of the wall-clock load time duration of the tab. - // Units: microseconds. - float avg_load_duration_us; -}; - -struct SiteCharacteristicsDatabaseSize { - // The total number of rows in the database, or -1 if the value is not - // available. - int64 num_rows; - - // The total size of the database on disk in kilobytes, or -1 if the value - // is not available. - int64 on_disk_size_kb; -}; - -// The data stored for a given origin, this should mirror the -// SiteDataProto structure in -// performance_manager/persistence/site_data/site_data.proto. -struct SiteCharacteristicsDatabaseValue { - // The last time this site has been in the loaded state, in seconds since - // epoch. - uint32 last_loaded; - - SiteCharacteristicsFeature updates_favicon_in_background; - SiteCharacteristicsFeature updates_title_in_background; - SiteCharacteristicsFeature uses_audio_in_background; - - // Load time performance measurement estimates. This maintains a decaying - // average of the resource usage of a page until shortly after it becomes - // idle. - SiteCharacteristicsPerformanceMeasurement? load_time_estimates; -}; - -// Provides the key and miscellaneous in-memory only data pertaining to a -// row that potentially exists in a database. -struct SiteCharacteristicsDatabaseEntry { - // The origin associated with this row. - string origin; - - // This row is pending flush to disk. - bool is_dirty; - - // NULL if the database entry doesn't exist on disk or in memory. - SiteCharacteristicsDatabaseValue? value; -}; - -// Contains information about a specific DB instance. -struct SiteCharacteristicsDatabase { - // Contains the entries requested. - array<SiteCharacteristicsDatabaseEntry> db_rows; -}; - // Discard related information about a single tab in a browser. struct TabDiscardsInfo { // The URL associated with the tab. This corresponds to GetLastCommittedURL, @@ -141,20 +75,6 @@ // each tab currently open in the browser, across all profiles. GetTabDiscardsInfo() => (array<TabDiscardsInfo> infos); - // Returns the in-memory entries and the entries for the requested origins. - // Note that any entry may take some time to load from disk, and so there may - // not be any data for a given entry until on the second or subsequent - // requests. - GetSiteCharacteristicsDatabase( - array<string> explicitly_requested_origins) => - (SiteCharacteristicsDatabase? result); - - // Returns the size of the database in number of rows and kilobytes. - // Note that this may be fairly expensive to acquire, and so shouldn't be - // called frequently. - GetSiteCharacteristicsDatabaseSize() => - (SiteCharacteristicsDatabaseSize? db_size); - // Sets the auto-discardable state of a tab, as specified by its stable // |tab_id|, earlier returned by GetTabDiscardsInfo. Invokes a callback when // the change has been made.
diff --git a/chrome/browser/ui/webui/discards/discards_ui.cc b/chrome/browser/ui/webui/discards/discards_ui.cc index 7ac12f7..22843d9 100644 --- a/chrome/browser/ui/webui/discards/discards_ui.cc +++ b/chrome/browser/ui/webui/discards/discards_ui.cc
@@ -17,8 +17,6 @@ #include "chrome/browser/profiles/profile.h" #include "chrome/browser/resource_coordinator/lifecycle_unit.h" #include "chrome/browser/resource_coordinator/lifecycle_unit_state.mojom.h" -#include "chrome/browser/resource_coordinator/local_site_characteristics_data_reader.h" -#include "chrome/browser/resource_coordinator/local_site_characteristics_data_store.h" #include "chrome/browser/resource_coordinator/local_site_characteristics_data_store_inspector.h" #include "chrome/browser/resource_coordinator/tab_activity_watcher.h" #include "chrome/browser/resource_coordinator/tab_lifecycle_unit_external.h" @@ -26,6 +24,8 @@ #include "chrome/browser/resource_coordinator/time.h" #include "chrome/browser/ui/webui/discards/discards.mojom.h" #include "chrome/browser/ui/webui/discards/graph_dump_impl.h" +#include "chrome/browser/ui/webui/discards/site_data.mojom-forward.h" +#include "chrome/browser/ui/webui/discards/site_data_provider_impl.h" #include "chrome/browser/ui/webui/favicon_source.h" #include "chrome/common/webui_url_constants.h" #include "chrome/grit/browser_resources.h" @@ -44,6 +44,10 @@ #include "url/gurl.h" #include "url/origin.h" +namespace resource_coordinator { +class LocalSiteCharacteristicsDataStoreInspector; +} // namespace resource_coordinator + namespace { discards::mojom::LifecycleUnitVisibility GetLifecycleUnitVisibility( @@ -88,82 +92,13 @@ return engagement_svc->GetDetails(nav_entry->GetURL()).total_score; } -discards::mojom::SiteCharacteristicsFeaturePtr ConvertFeatureFromProto( - const SiteDataFeatureProto& proto) { - discards::mojom::SiteCharacteristicsFeaturePtr feature = - discards::mojom::SiteCharacteristicsFeature::New(); - - if (proto.has_observation_duration()) { - feature->observation_duration = proto.observation_duration(); - } else { - feature->observation_duration = 0; - } - - if (proto.has_use_timestamp()) { - feature->use_timestamp = proto.use_timestamp(); - } else { - feature->use_timestamp = 0; - } - - return feature; -} - -discards::mojom::SiteCharacteristicsDatabaseEntryPtr ConvertEntryFromProto( - SiteDataProto* proto) { - discards::mojom::SiteCharacteristicsDatabaseValuePtr value = - discards::mojom::SiteCharacteristicsDatabaseValue::New(); - - if (proto->has_last_loaded()) { - value->last_loaded = proto->last_loaded(); - } else { - value->last_loaded = 0; - } - value->updates_favicon_in_background = - ConvertFeatureFromProto(proto->updates_favicon_in_background()); - value->updates_title_in_background = - ConvertFeatureFromProto(proto->updates_title_in_background()); - value->uses_audio_in_background = - ConvertFeatureFromProto(proto->uses_audio_in_background()); - - if (proto->has_load_time_estimates()) { - const auto& load_time_estimates_proto = proto->load_time_estimates(); - DCHECK(load_time_estimates_proto.has_avg_cpu_usage_us()); - DCHECK(load_time_estimates_proto.has_avg_footprint_kb()); - - discards::mojom::SiteCharacteristicsPerformanceMeasurementPtr - load_time_estimates = - discards::mojom::SiteCharacteristicsPerformanceMeasurement::New(); - if (load_time_estimates_proto.has_avg_cpu_usage_us()) { - load_time_estimates->avg_cpu_usage_us = - load_time_estimates_proto.avg_cpu_usage_us(); - } - if (load_time_estimates_proto.has_avg_footprint_kb()) { - load_time_estimates->avg_footprint_kb = - load_time_estimates_proto.avg_footprint_kb(); - } - if (load_time_estimates_proto.has_avg_load_duration_us()) { - load_time_estimates->avg_load_duration_us = - load_time_estimates_proto.avg_load_duration_us(); - } - - value->load_time_estimates = std::move(load_time_estimates); - } - - discards::mojom::SiteCharacteristicsDatabaseEntryPtr entry = - discards::mojom::SiteCharacteristicsDatabaseEntry::New(); - entry->value = std::move(value); - return entry; -} class DiscardsDetailsProviderImpl : public discards::mojom::DetailsProvider { public: // This instance is deleted when the supplied pipe is destroyed. - DiscardsDetailsProviderImpl( - resource_coordinator::LocalSiteCharacteristicsDataStoreInspector* - data_store_inspector, + explicit DiscardsDetailsProviderImpl( mojo::PendingReceiver<discards::mojom::DetailsProvider> receiver) - : data_store_inspector_(data_store_inspector), - receiver_(this, std::move(receiver)) {} + : receiver_(this, std::move(receiver)) {} ~DiscardsDetailsProviderImpl() override {} @@ -235,11 +170,6 @@ std::move(callback).Run(std::move(infos)); } - void GetSiteCharacteristicsDatabase( - const std::vector<std::string>& explicitly_requested_origins, - GetSiteCharacteristicsDatabaseCallback callback) override; - void GetSiteCharacteristicsDatabaseSize( - GetSiteCharacteristicsDatabaseSizeCallback callback) override; void SetAutoDiscardable(int32_t id, bool is_auto_discardable, @@ -282,105 +212,11 @@ } private: - using LocalSiteCharacteristicsDataStoreInspector = - resource_coordinator::LocalSiteCharacteristicsDataStoreInspector; - using SiteCharacteristicsDataReader = - resource_coordinator::SiteCharacteristicsDataReader; - using SiteCharacteristicsDataStore = - resource_coordinator::SiteCharacteristicsDataStore; - using OriginToReaderMap = - base::flat_map<std::string, - std::unique_ptr<SiteCharacteristicsDataReader>>; - - // This map pins requested readers and their associated data in memory until - // after the next read finishes. This is necessary to allow the database reads - // to go through and populate the requested entries. - OriginToReaderMap requested_origins_; - - LocalSiteCharacteristicsDataStoreInspector* data_store_inspector_; mojo::Receiver<discards::mojom::DetailsProvider> receiver_; DISALLOW_COPY_AND_ASSIGN(DiscardsDetailsProviderImpl); }; -void DiscardsDetailsProviderImpl::GetSiteCharacteristicsDatabase( - const std::vector<std::string>& explicitly_requested_origins, - GetSiteCharacteristicsDatabaseCallback callback) { - if (!data_store_inspector_) { - // Early return with a nullptr if there's no inspector. - std::move(callback).Run(nullptr); - return; - } - - // Move all previously explicitly requested origins to this local map. - // Move any currently requested origins over to the member variable, or - // populate them if they weren't previously requested. - // The difference will remain in this map and go out of scope at the end of - // this function. - OriginToReaderMap prev_requested_origins; - prev_requested_origins.swap(requested_origins_); - SiteCharacteristicsDataStore* data_store = - data_store_inspector_->GetDataStore(); - DCHECK(data_store); - for (const std::string& origin : explicitly_requested_origins) { - auto it = prev_requested_origins.find(origin); - if (it == prev_requested_origins.end()) { - GURL url(origin); - requested_origins_[origin] = - data_store->GetReaderForOrigin(url::Origin::Create(url)); - } else { - requested_origins_[origin] = std::move(it->second); - prev_requested_origins.erase(it); - } - } - - discards::mojom::SiteCharacteristicsDatabasePtr result = - discards::mojom::SiteCharacteristicsDatabase::New(); - std::vector<url::Origin> in_memory_origins = - data_store_inspector_->GetAllInMemoryOrigins(); - for (const url::Origin& origin : in_memory_origins) { - // Get the data for this origin and convert it from proto to the - // corresponding mojo structure. - std::unique_ptr<SiteDataProto> proto; - bool is_dirty = false; - if (data_store_inspector_->GetDataForOrigin(origin, &is_dirty, &proto)) { - auto entry = ConvertEntryFromProto(proto.get()); - entry->origin = origin.Serialize(); - entry->is_dirty = is_dirty; - result->db_rows.push_back(std::move(entry)); - } - } - - // Return the result. - std::move(callback).Run(std::move(result)); -} - -void DiscardsDetailsProviderImpl::GetSiteCharacteristicsDatabaseSize( - GetSiteCharacteristicsDatabaseSizeCallback callback) { - if (!data_store_inspector_) { - // Early return with a nullptr if there's no inspector. - std::move(callback).Run(nullptr); - return; - } - - // Adapt the inspector callback to the mojom callback with this lambda. - auto inspector_callback = base::BindOnce( - [](GetSiteCharacteristicsDatabaseSizeCallback callback, - base::Optional<int64_t> num_rows, - base::Optional<int64_t> on_disk_size_kb) { - discards::mojom::SiteCharacteristicsDatabaseSizePtr result = - discards::mojom::SiteCharacteristicsDatabaseSize::New(); - result->num_rows = num_rows.has_value() ? num_rows.value() : -1; - result->on_disk_size_kb = - on_disk_size_kb.has_value() ? on_disk_size_kb.value() : -1; - - std::move(callback).Run(std::move(result)); - }, - std::move(callback)); - - data_store_inspector_->GetDatabaseSize(std::move(inspector_callback)); -} - } // namespace DiscardsUI::DiscardsUI(content::WebUI* web_ui) @@ -410,6 +246,9 @@ source->AddResourcePath( "chrome/browser/resource_coordinator/lifecycle_unit_state.mojom-lite.js", IDR_DISCARDS_LIFECYCLE_UNIT_STATE_MOJOM_LITE_JS); + source->AddResourcePath( + "chrome/browser/ui/webui/discards/site_data.mojom-lite.js", + IDR_DISCARDS_SITE_DATA_MOJOM_LITE_JS); // Add the mojo base dependency for the WebUI Graph Dump. source->AddResourcePath( @@ -435,7 +274,13 @@ void DiscardsUI::BindInterface( mojo::PendingReceiver<discards::mojom::DetailsProvider> receiver) { - ui_handler_ = std::make_unique<DiscardsDetailsProviderImpl>( + ui_handler_ = + std::make_unique<DiscardsDetailsProviderImpl>(std::move(receiver)); +} + +void DiscardsUI::BindInterface( + mojo::PendingReceiver<discards::mojom::SiteDataProvider> receiver) { + site_data_provider_ = std::make_unique<SiteDataProviderImpl>( data_store_inspector_, std::move(receiver)); }
diff --git a/chrome/browser/ui/webui/discards/discards_ui.h b/chrome/browser/ui/webui/discards/discards_ui.h index 3f66260..f454366 100644 --- a/chrome/browser/ui/webui/discards/discards_ui.h +++ b/chrome/browser/ui/webui/discards/discards_ui.h
@@ -9,6 +9,7 @@ #include "base/macros.h" #include "chrome/browser/ui/webui/discards/discards.mojom-forward.h" +#include "chrome/browser/ui/webui/discards/site_data.mojom-forward.h" #include "mojo/public/cpp/bindings/pending_receiver.h" #include "ui/webui/mojo_web_ui_controller.h" @@ -28,6 +29,11 @@ void BindInterface( mojo::PendingReceiver<discards::mojom::DetailsProvider> receiver); + // Instantiates the implementor of the mojom::SiteDataProvider mojo + // interface passing the pending receiver that will be internally bound. + void BindInterface( + mojo::PendingReceiver<discards::mojom::SiteDataProvider> receiver); + // Instantiates the implementor of the mojom::GraphDump mojo // interface passing the pending receiver that will be internally bound. void BindInterface( @@ -35,6 +41,7 @@ private: std::unique_ptr<discards::mojom::DetailsProvider> ui_handler_; + std::unique_ptr<discards::mojom::SiteDataProvider> site_data_provider_; resource_coordinator::LocalSiteCharacteristicsDataStoreInspector* data_store_inspector_;
diff --git a/chrome/browser/ui/webui/discards/site_data.mojom b/chrome/browser/ui/webui/discards/site_data.mojom new file mode 100644 index 0000000..1084c80 --- /dev/null +++ b/chrome/browser/ui/webui/discards/site_data.mojom
@@ -0,0 +1,90 @@ +// Copyright 2020 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +module discards.mojom; + +struct SiteCharacteristicsFeature { + // The cumulative observation time for this feature in seconds, set to 0 once + // this feature has been observed. + int64 observation_duration; + // The time at which this feature has been used (set to 0 if it hasn't been + // used), in seconds since epoch. + int64 use_timestamp; +}; + +struct SiteCharacteristicsPerformanceMeasurement { + // A decaying average of the CPU usage measurements. Units: microseconds. + float avg_cpu_usage_us; + // A decaying average of the process footprint measurements. Units: kilobytes. + float avg_footprint_kb; + // A decaying average of the wall-clock load time duration of the tab. + // Units: microseconds. + float avg_load_duration_us; +}; + +struct SiteCharacteristicsDatabaseSize { + // The total number of rows in the database, or -1 if the value is not + // available. + int64 num_rows; + + // The total size of the database on disk in kilobytes, or -1 if the value + // is not available. + int64 on_disk_size_kb; +}; + +// The data stored for a given origin, this should mirror the +// SiteDataProto structure in +// performance_manager/persistence/site_data/site_data.proto. +struct SiteCharacteristicsDatabaseValue { + // The last time this site has been in the loaded state, in seconds since + // epoch. + uint32 last_loaded; + + SiteCharacteristicsFeature updates_favicon_in_background; + SiteCharacteristicsFeature updates_title_in_background; + SiteCharacteristicsFeature uses_audio_in_background; + + // Load time performance measurement estimates. This maintains a decaying + // average of the resource usage of a page until shortly after it becomes + // idle. + SiteCharacteristicsPerformanceMeasurement? load_time_estimates; +}; + +// Provides the key and miscellaneous in-memory only data pertaining to a +// row that potentially exists in a database. +struct SiteCharacteristicsDatabaseEntry { + // The origin associated with this row. + string origin; + + // This row is pending flush to disk. + bool is_dirty; + + // NULL if the database entry doesn't exist on disk or in memory. + SiteCharacteristicsDatabaseValue? value; +}; + +// Contains information about a specific DB instance. +struct SiteCharacteristicsDatabase { + // Contains the entries requested. + array<SiteCharacteristicsDatabaseEntry> db_rows; +}; + +// Interface for providing information about the site data database. Lives in +// the browser process and is invoked in the renderer process via Javascript +// code running in the chrome://discards WebUI. +interface SiteDataProvider { + // Returns the in-memory entries and the entries for the requested origins. + // Note that any entry may take some time to load from disk, and so there may + // not be any data for a given entry until on the second or subsequent + // requests. The WebUI is expected to poll this function. + GetSiteCharacteristicsDatabase( + array<string> explicitly_requested_origins) => + (SiteCharacteristicsDatabase? result); + + // Returns the size of the database in number of rows and kilobytes. + // Note that this may be fairly expensive to acquire, and so shouldn't be + // called frequently. + GetSiteCharacteristicsDatabaseSize() => + (SiteCharacteristicsDatabaseSize? db_size); +};
diff --git a/chrome/browser/ui/webui/discards/site_data_provider_impl.cc b/chrome/browser/ui/webui/discards/site_data_provider_impl.cc new file mode 100644 index 0000000..8d701889f --- /dev/null +++ b/chrome/browser/ui/webui/discards/site_data_provider_impl.cc
@@ -0,0 +1,147 @@ +// Copyright 2020 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "chrome/browser/ui/webui/discards/site_data_provider_impl.h" + +#include "base/bind_helpers.h" +#include "chrome/browser/resource_coordinator/local_site_characteristics_data_reader.h" +#include "chrome/browser/resource_coordinator/local_site_characteristics_data_store.h" +#include "chrome/browser/resource_coordinator/local_site_characteristics_data_store_inspector.h" + +namespace { + +discards::mojom::SiteCharacteristicsFeaturePtr ConvertFeatureFromProto( + const SiteDataFeatureProto& proto) { + discards::mojom::SiteCharacteristicsFeaturePtr feature = + discards::mojom::SiteCharacteristicsFeature::New(); + + if (proto.has_observation_duration()) + feature->observation_duration = proto.observation_duration(); + + if (proto.has_use_timestamp()) + feature->use_timestamp = proto.use_timestamp(); + + return feature; +} + +discards::mojom::SiteCharacteristicsDatabaseEntryPtr ConvertEntryFromProto( + SiteDataProto* proto) { + discards::mojom::SiteCharacteristicsDatabaseValuePtr value = + discards::mojom::SiteCharacteristicsDatabaseValue::New(); + + if (proto->has_last_loaded()) + value->last_loaded = proto->last_loaded(); + + value->updates_favicon_in_background = + ConvertFeatureFromProto(proto->updates_favicon_in_background()); + value->updates_title_in_background = + ConvertFeatureFromProto(proto->updates_title_in_background()); + value->uses_audio_in_background = + ConvertFeatureFromProto(proto->uses_audio_in_background()); + + if (proto->has_load_time_estimates()) { + const auto& load_time_estimates_proto = proto->load_time_estimates(); + DCHECK(load_time_estimates_proto.has_avg_cpu_usage_us()); + DCHECK(load_time_estimates_proto.has_avg_footprint_kb()); + + discards::mojom::SiteCharacteristicsPerformanceMeasurementPtr + load_time_estimates = + discards::mojom::SiteCharacteristicsPerformanceMeasurement::New(); + if (load_time_estimates_proto.has_avg_cpu_usage_us()) { + load_time_estimates->avg_cpu_usage_us = + load_time_estimates_proto.avg_cpu_usage_us(); + } + if (load_time_estimates_proto.has_avg_footprint_kb()) { + load_time_estimates->avg_footprint_kb = + load_time_estimates_proto.avg_footprint_kb(); + } + if (load_time_estimates_proto.has_avg_load_duration_us()) { + load_time_estimates->avg_load_duration_us = + load_time_estimates_proto.avg_load_duration_us(); + } + + value->load_time_estimates = std::move(load_time_estimates); + } + + discards::mojom::SiteCharacteristicsDatabaseEntryPtr entry = + discards::mojom::SiteCharacteristicsDatabaseEntry::New(); + entry->value = std::move(value); + return entry; +} + +} // namespace + +SiteDataProviderImpl::SiteDataProviderImpl( + resource_coordinator::LocalSiteCharacteristicsDataStoreInspector* + data_store_inspector, + mojo::PendingReceiver<discards::mojom::SiteDataProvider> receiver) + : data_store_inspector_(data_store_inspector), + receiver_(this, std::move(receiver)) {} + +SiteDataProviderImpl::~SiteDataProviderImpl() = default; + +void SiteDataProviderImpl::GetSiteCharacteristicsDatabase( + const std::vector<std::string>& explicitly_requested_origins, + GetSiteCharacteristicsDatabaseCallback callback) { + // Move all previously explicitly requested origins to this local map. + // Move any currently requested origins over to the member variable, or + // populate them if they weren't previously requested. + // The difference will remain in this map and go out of scope at the end of + // this function. + OriginToReaderMap prev_requested_origins; + prev_requested_origins.swap(requested_origins_); + resource_coordinator::SiteCharacteristicsDataStore* data_store = + data_store_inspector_->GetDataStore(); + DCHECK(data_store); + for (const std::string& origin : explicitly_requested_origins) { + auto it = prev_requested_origins.find(origin); + if (it == prev_requested_origins.end()) { + GURL url(origin); + requested_origins_[origin] = + data_store->GetReaderForOrigin(url::Origin::Create(url)); + } else { + requested_origins_[origin] = std::move(it->second); + } + } + + discards::mojom::SiteCharacteristicsDatabasePtr result = + discards::mojom::SiteCharacteristicsDatabase::New(); + std::vector<url::Origin> in_memory_origins = + data_store_inspector_->GetAllInMemoryOrigins(); + for (const url::Origin& origin : in_memory_origins) { + // Get the data for this origin and convert it from proto to the + // corresponding mojo structure. + std::unique_ptr<SiteDataProto> proto; + bool is_dirty = false; + if (data_store_inspector_->GetDataForOrigin(origin, &is_dirty, &proto)) { + auto entry = ConvertEntryFromProto(proto.get()); + entry->origin = origin.Serialize(); + entry->is_dirty = is_dirty; + result->db_rows.push_back(std::move(entry)); + } + } + + // Return the result. + std::move(callback).Run(std::move(result)); +} + +void SiteDataProviderImpl::GetSiteCharacteristicsDatabaseSize( + GetSiteCharacteristicsDatabaseSizeCallback callback) { + // Adapt the inspector callback to the mojom callback with this lambda. + auto inspector_callback = base::BindOnce( + [](GetSiteCharacteristicsDatabaseSizeCallback callback, + base::Optional<int64_t> num_rows, + base::Optional<int64_t> on_disk_size_kb) { + discards::mojom::SiteCharacteristicsDatabaseSizePtr result = + discards::mojom::SiteCharacteristicsDatabaseSize::New(); + result->num_rows = num_rows.has_value() ? num_rows.value() : -1; + result->on_disk_size_kb = + on_disk_size_kb.has_value() ? on_disk_size_kb.value() : -1; + + std::move(callback).Run(std::move(result)); + }, + std::move(callback)); + + data_store_inspector_->GetDatabaseSize(std::move(inspector_callback)); +}
diff --git a/chrome/browser/ui/webui/discards/site_data_provider_impl.h b/chrome/browser/ui/webui/discards/site_data_provider_impl.h new file mode 100644 index 0000000..2d67c742 --- /dev/null +++ b/chrome/browser/ui/webui/discards/site_data_provider_impl.h
@@ -0,0 +1,58 @@ +// Copyright 2020 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef CHROME_BROWSER_UI_WEBUI_DISCARDS_SITE_DATA_PROVIDER_IMPL_H_ +#define CHROME_BROWSER_UI_WEBUI_DISCARDS_SITE_DATA_PROVIDER_IMPL_H_ + +#include <map> +#include <memory> + +#include "base/sequence_checker.h" +#include "chrome/browser/ui/webui/discards/site_data.mojom.h" +#include "mojo/public/cpp/bindings/pending_receiver.h" +#include "mojo/public/cpp/bindings/pending_remote.h" +#include "mojo/public/cpp/bindings/receiver.h" +#include "mojo/public/cpp/bindings/remote.h" + +namespace resource_coordinator { +class LocalSiteCharacteristicsDataStoreInspector; +class SiteCharacteristicsDataReader; +} // namespace resource_coordinator + +class SiteDataProviderImpl : public discards::mojom::SiteDataProvider { + public: + SiteDataProviderImpl( + resource_coordinator::LocalSiteCharacteristicsDataStoreInspector* + data_store_inspector, + mojo::PendingReceiver<discards::mojom::SiteDataProvider> receiver); + ~SiteDataProviderImpl() override; + SiteDataProviderImpl(const SiteDataProviderImpl& other) = delete; + SiteDataProviderImpl& operator=(const SiteDataProviderImpl&) = delete; + + void GetSiteCharacteristicsDatabase( + const std::vector<std::string>& explicitly_requested_origins, + GetSiteCharacteristicsDatabaseCallback callback) override; + void GetSiteCharacteristicsDatabaseSize( + GetSiteCharacteristicsDatabaseSizeCallback callback) override; + + private: + using LocalSiteCharacteristicsDataStoreInspector = + resource_coordinator::LocalSiteCharacteristicsDataStoreInspector; + using SiteCharacteristicsDataReader = + resource_coordinator::SiteCharacteristicsDataReader; + using OriginToReaderMap = + std::map<std::string, std::unique_ptr<SiteCharacteristicsDataReader>>; + + // This map pins requested readers and their associated data in memory until + // after the next read finishes. This is necessary to allow the database reads + // to go through and populate the requested entries. + OriginToReaderMap requested_origins_; + + resource_coordinator::LocalSiteCharacteristicsDataStoreInspector* + data_store_inspector_ = nullptr; + + mojo::Receiver<discards::mojom::SiteDataProvider> receiver_{this}; +}; + +#endif // CHROME_BROWSER_UI_WEBUI_DISCARDS_SITE_DATA_PROVIDER_IMPL_H_
diff --git a/chrome/browser/ui/webui/extensions/extension_settings_browsertest.cc b/chrome/browser/ui/webui/extensions/extension_settings_browsertest.cc index 65cd42dd..3b391f2 100644 --- a/chrome/browser/ui/webui/extensions/extension_settings_browsertest.cc +++ b/chrome/browser/ui/webui/extensions/extension_settings_browsertest.cc
@@ -97,12 +97,6 @@ extensions::ScopedTestDialogAutoConfirm::ACCEPT); } -void ExtensionSettingsUIBrowserTest::EnableErrorConsole() { - error_console_override_ = - std::make_unique<extensions::FeatureSwitch::ScopedOverride>( - extensions::FeatureSwitch::error_console(), true); -} - void ExtensionSettingsUIBrowserTest::SetDevModeEnabled(bool enabled) { browser()->profile()->GetPrefs()->SetBoolean( prefs::kExtensionsUIDeveloperMode, enabled);
diff --git a/chrome/browser/ui/webui/extensions/extension_settings_browsertest.h b/chrome/browser/ui/webui/extensions/extension_settings_browsertest.h index a74021ec..f1f50ca3 100644 --- a/chrome/browser/ui/webui/extensions/extension_settings_browsertest.h +++ b/chrome/browser/ui/webui/extensions/extension_settings_browsertest.h
@@ -13,7 +13,6 @@ #include "chrome/test/base/web_ui_browser_test.h" #include "extensions/browser/scoped_ignore_content_verifier_for_test.h" #include "extensions/browser/test_management_policy.h" -#include "extensions/common/feature_switch.h" namespace extensions { class Extension; @@ -72,10 +71,6 @@ // Disable extension install verification. extensions::ScopedInstallVerifierBypassForTest ignore_install_verification_; - // Used to enable the error console. - std::unique_ptr<extensions::FeatureSwitch::ScopedOverride> - error_console_override_; - std::unique_ptr<extensions::ScopedTestDialogAutoConfirm> uninstall_auto_confirm_;
diff --git a/chrome/browser/ui/webui/print_preview/local_printer_handler_default.cc b/chrome/browser/ui/webui/print_preview/local_printer_handler_default.cc index 1cb79452..876b308 100644 --- a/chrome/browser/ui/webui/print_preview/local_printer_handler_default.cc +++ b/chrome/browser/ui/webui/print_preview/local_printer_handler_default.cc
@@ -60,10 +60,10 @@ base::Value FetchCapabilitiesAsync(const std::string& device_name, const std::string& locale) { - PrinterSemanticCapsAndDefaults::Papers additional_papers; + PrinterSemanticCapsAndDefaults::Papers user_defined_papers; #if defined(OS_MACOSX) if (base::FeatureList::IsEnabled(features::kEnableCustomMacPaperSizes)) - additional_papers = GetMacCustomPaperSizes(); + user_defined_papers = GetMacCustomPaperSizes(); #endif base::ScopedBlockingCall scoped_blocking_call(FROM_HERE, @@ -80,8 +80,8 @@ } return GetSettingsOnBlockingTaskRunner( - device_name, basic_info, additional_papers, - /* has_secure_protocol */ false, print_backend); + device_name, basic_info, std::move(user_defined_papers), + /*has_secure_protocol=*/false, print_backend); } std::string GetDefaultPrinterAsync(const std::string& locale) {
diff --git a/chrome/browser/ui/webui/quota_internals/quota_internals_handler.cc b/chrome/browser/ui/webui/quota_internals/quota_internals_handler.cc index 6d2752f9..22ea3e4 100644 --- a/chrome/browser/ui/webui/quota_internals/quota_internals_handler.cc +++ b/chrome/browser/ui/webui/quota_internals/quota_internals_handler.cc
@@ -30,6 +30,10 @@ web_ui()->RegisterMessageCallback( "requestInfo", base::BindRepeating(&QuotaInternalsHandler::OnRequestInfo, base::Unretained(this))); + web_ui()->RegisterMessageCallback( + "triggerStoragePressure", + base::BindRepeating(&QuotaInternalsHandler::OnTriggerStoragePressure, + base::Unretained(this))); } void QuotaInternalsHandler::ReportAvailableSpace(int64_t available_space) { @@ -85,4 +89,19 @@ Profile::FromWebUI(web_ui()))->GetQuotaManager()); } +void QuotaInternalsHandler::OnTriggerStoragePressure( + const base::ListValue* args) { + CHECK_EQ(1U, args->GetSize()); + std::string origin_string; + CHECK(args->GetString(0, &origin_string)); + GURL url(origin_string); + + if (!proxy_.get()) + proxy_ = new QuotaInternalsProxy(this); + proxy_->TriggerStoragePressure( + url::Origin::Create(url), + BrowserContext::GetDefaultStoragePartition(Profile::FromWebUI(web_ui())) + ->GetQuotaManager()); +} + } // namespace quota_internals
diff --git a/chrome/browser/ui/webui/quota_internals/quota_internals_handler.h b/chrome/browser/ui/webui/quota_internals/quota_internals_handler.h index 515002f0..9e74b93c 100644 --- a/chrome/browser/ui/webui/quota_internals/quota_internals_handler.h +++ b/chrome/browser/ui/webui/quota_internals/quota_internals_handler.h
@@ -45,6 +45,7 @@ private: void OnRequestInfo(const base::ListValue*); + void OnTriggerStoragePressure(const base::ListValue*); void SendMessage(const std::string& message, const base::Value& value); scoped_refptr<QuotaInternalsProxy> proxy_;
diff --git a/chrome/browser/ui/webui/quota_internals/quota_internals_proxy.cc b/chrome/browser/ui/webui/quota_internals/quota_internals_proxy.cc index ec4f5d2..100c0a0 100644 --- a/chrome/browser/ui/webui/quota_internals/quota_internals_proxy.cc +++ b/chrome/browser/ui/webui/quota_internals/quota_internals_proxy.cc
@@ -67,6 +67,19 @@ ReportStatistics(stats); } +void QuotaInternalsProxy::TriggerStoragePressure( + url::Origin origin, + scoped_refptr<storage::QuotaManager> quota_manager) { + DCHECK(quota_manager.get()); + if (!BrowserThread::CurrentlyOn(BrowserThread::IO)) { + base::PostTask(FROM_HERE, {BrowserThread::IO}, + base::BindOnce(&QuotaInternalsProxy::TriggerStoragePressure, + this, origin, quota_manager)); + return; + } + quota_manager->SimulateStoragePressure(origin); +} + QuotaInternalsProxy::~QuotaInternalsProxy() = default; #define RELAY_TO_HANDLER(func, arg_t) \
diff --git a/chrome/browser/ui/webui/quota_internals/quota_internals_proxy.h b/chrome/browser/ui/webui/quota_internals/quota_internals_proxy.h index bcae62c..893f2dd 100644 --- a/chrome/browser/ui/webui/quota_internals/quota_internals_proxy.h +++ b/chrome/browser/ui/webui/quota_internals/quota_internals_proxy.h
@@ -39,6 +39,9 @@ explicit QuotaInternalsProxy(QuotaInternalsHandler* handler); void RequestInfo(scoped_refptr<storage::QuotaManager> quota_manager); + void TriggerStoragePressure( + url::Origin origin, + scoped_refptr<storage::QuotaManager> quota_manager); private: friend class base::DeleteHelper<QuotaInternalsProxy>;
diff --git a/chrome/browser/ui/webui/settings/OWNERS b/chrome/browser/ui/webui/settings/OWNERS index 93f7d79..b19cbb7 100644 --- a/chrome/browser/ui/webui/settings/OWNERS +++ b/chrome/browser/ui/webui/settings/OWNERS
@@ -2,4 +2,9 @@ per-file people_handler*=tangltom@chromium.org +per-file safe_browsing_handler*=msramek@chromium.org +per-file safe_browsing_handler*=sauski@google.com +per-file site_settings_handler*=msramek@chromium.org +per-file site_settings_handler*=sauski@google.com + # COMPONENT: UI>Settings
diff --git a/chrome/browser/ui/webui/settings/chromeos/os_settings_localized_strings_provider.cc b/chrome/browser/ui/webui/settings/chromeos/os_settings_localized_strings_provider.cc index 212c0efc..6d86d645 100644 --- a/chrome/browser/ui/webui/settings/chromeos/os_settings_localized_strings_provider.cc +++ b/chrome/browser/ui/webui/settings/chromeos/os_settings_localized_strings_provider.cc
@@ -971,16 +971,29 @@ {"touchpadSpeed", IDS_SETTINGS_TOUCHPAD_SPEED_LABEL}, {"pointerSlow", IDS_SETTINGS_POINTER_SPEED_SLOW_LABEL}, {"pointerFast", IDS_SETTINGS_POINTER_SPEED_FAST_LABEL}, + {"mouseScrollSpeed", IDS_SETTINGS_MOUSE_SCROLL_SPEED_LABEL}, {"mouseSpeed", IDS_SETTINGS_MOUSE_SPEED_LABEL}, {"mouseSwapButtons", IDS_SETTINGS_MOUSE_SWAP_BUTTONS_LABEL}, {"mouseReverseScroll", IDS_SETTINGS_MOUSE_REVERSE_SCROLL_LABEL}, {"mouseAccelerationLabel", IDS_SETTINGS_MOUSE_ACCELERATION_LABEL}, + {"mouseScrollAccelerationLabel", + IDS_SETTINGS_MOUSE_SCROLL_ACCELERATION_LABEL}, {"touchpadAccelerationLabel", IDS_SETTINGS_TOUCHPAD_ACCELERATION_LABEL}, + {"touchpadScrollAccelerationLabel", + IDS_SETTINGS_TOUCHPAD_SCROLL_ACCELERATION_LABEL}, + {"touchpadScrollSpeed", IDS_SETTINGS_TOUCHPAD_SCROLL_SPEED_LABEL}, }; AddLocalizedStringsBulk(html_source, kPointersStrings); html_source->AddString("naturalScrollLearnMoreLink", GetHelpUrlWithBoard(chrome::kNaturalScrollHelpURL)); + + html_source->AddBoolean( + "allowDisableMouseAcceleration", + base::FeatureList::IsEnabled(::features::kAllowDisableMouseAcceleration)); + html_source->AddBoolean( + "allowScrollSettings", + base::FeatureList::IsEnabled(features::kAllowScrollSettings)); } void AddDeviceKeyboardStrings(content::WebUIDataSource* html_source) { @@ -1140,10 +1153,6 @@ html_source->AddBoolean("hasExternalTouchDevice", display::HasExternalTouchscreenDevice()); - - html_source->AddBoolean( - "allowDisableMouseAcceleration", - base::FeatureList::IsEnabled(::features::kAllowDisableMouseAcceleration)); } void AddDeviceStorageStrings(content::WebUIDataSource* html_source) {
diff --git a/chrome/browser/ui/webui/settings/chromeos/os_settings_ui.cc b/chrome/browser/ui/webui/settings/chromeos/os_settings_ui.cc index f43296e0..fefd823 100644 --- a/chrome/browser/ui/webui/settings/chromeos/os_settings_ui.cc +++ b/chrome/browser/ui/webui/settings/chromeos/os_settings_ui.cc
@@ -133,21 +133,6 @@ InitOSWebUIHandlers(html_source); - // TODO(https://crbug.com/1063412): Move the block below to - // os_settings_localized_strings_provider.cc. - static constexpr webui::LocalizedString kScrollStrings[] = { - {"touchpadScrollSpeed", IDS_SETTINGS_TOUCHPAD_SCROLL_SPEED_LABEL}, - {"mouseScrollSpeed", IDS_SETTINGS_MOUSE_SCROLL_SPEED_LABEL}, - {"mouseScrollAccelerationLabel", - IDS_SETTINGS_MOUSE_SCROLL_ACCELERATION_LABEL}, - {"touchpadScrollAccelerationLabel", - IDS_SETTINGS_TOUCHPAD_SCROLL_ACCELERATION_LABEL}, - }; - AddLocalizedStringsBulk(html_source, kScrollStrings); - html_source->AddBoolean( - "allowScrollSettings", - base::FeatureList::IsEnabled(::features::kAllowScrollSettings)); - // This handler is for chrome://os-settings. html_source->AddBoolean("isOSSettings", true);
diff --git a/chrome/browser/ui/webui/settings/safety_check_handler_unittest.cc b/chrome/browser/ui/webui/settings/safety_check_handler_unittest.cc index b9322b7..bff0d7c 100644 --- a/chrome/browser/ui/webui/settings/safety_check_handler_unittest.cc +++ b/chrome/browser/ui/webui/settings/safety_check_handler_unittest.cc
@@ -481,7 +481,7 @@ static_cast<int>(SafetyCheckHandler::SafeBrowsingStatus::kDisabled)); ASSERT_TRUE(event); VerifyDisplayString( - event, "Safe Browsing is off. To stay safe on the web, turn it on."); + event, "Safe Browsing is off. Browser recommends turning it on."); histogram_tester_.ExpectBucketCount( "SafetyCheck.SafeBrowsingResult", SafetyCheckHandler::SafeBrowsingStatus::kDisabled, 1);
diff --git a/chrome/browser/ui/webui/settings/settings_ui.cc b/chrome/browser/ui/webui/settings/settings_ui.cc index 94737d69..bd6edc5 100644 --- a/chrome/browser/ui/webui/settings/settings_ui.cc +++ b/chrome/browser/ui/webui/settings/settings_ui.cc
@@ -66,6 +66,7 @@ #include "chrome/grit/generated_resources.h" #include "chrome/grit/settings_resources.h" #include "chrome/grit/settings_resources_map.h" +#include "components/content_settings/core/common/features.h" #include "components/favicon_base/favicon_url_parser.h" #include "components/password_manager/core/common/password_manager_features.h" #include "components/pref_registry/pref_registry_syncable.h" @@ -253,6 +254,9 @@ html_source->AddBoolean("signinAllowed", !profile->IsGuestSession() && profile->GetPrefs()->GetBoolean( prefs::kSigninAllowed)); + html_source->AddBoolean( + "improvedCookieControlsEnabled", + base::FeatureList::IsEnabled(content_settings::kImprovedCookieControls)); html_source->AddBoolean( "privacySettingsRedesignEnabled",
diff --git a/chrome/browser/ui/webui/signin/signin_error_ui.cc b/chrome/browser/ui/webui/signin/signin_error_ui.cc index cef4339..39f01b21 100644 --- a/chrome/browser/ui/webui/signin/signin_error_ui.cc +++ b/chrome/browser/ui/webui/signin/signin_error_ui.cc
@@ -68,6 +68,8 @@ content::WebUIDataSource::Create(chrome::kChromeUISigninErrorHost); source->UseStringsJs(); source->SetDefaultResource(IDR_SIGNIN_ERROR_HTML); + source->AddResourcePath("signin_error_app.html", IDR_SIGNIN_ERROR_APP_HTML); + source->AddResourcePath("signin_error_app.js", IDR_SIGNIN_ERROR_APP_JS); source->AddResourcePath("signin_error.js", IDR_SIGNIN_ERROR_JS); source->AddResourcePath("signin_shared_old_css.html", IDR_SIGNIN_SHARED_OLD_CSS_HTML);
diff --git a/chrome/browser/upboarding/query_tiles/internal/BUILD.gn b/chrome/browser/upboarding/query_tiles/internal/BUILD.gn index f6b467a..d71ae15 100644 --- a/chrome/browser/upboarding/query_tiles/internal/BUILD.gn +++ b/chrome/browser/upboarding/query_tiles/internal/BUILD.gn
@@ -11,6 +11,8 @@ sources = [ "cached_image_loader.cc", "cached_image_loader.h", + "config.cc", + "config.h", "image_data_store.cc", "image_data_store.h", "image_decoder.cc",
diff --git a/chrome/browser/upboarding/query_tiles/internal/config.cc b/chrome/browser/upboarding/query_tiles/internal/config.cc new file mode 100644 index 0000000..81c05902 --- /dev/null +++ b/chrome/browser/upboarding/query_tiles/internal/config.cc
@@ -0,0 +1,45 @@ +// Copyright 2020 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "chrome/browser/upboarding/query_tiles/internal/config.h" + +namespace upboarding { +namespace { + +// Default base URL string for the Query Tiles server. +constexpr char kDefaultBaseURL[] = + "https://autopush-gsaprototype-pa.sandbox.googleapis.com"; + +// Default URL string for GetQueryTiles RPC. +constexpr char kDefaultGetQueryTilePath[] = "/v1/querytiles"; + +// Default state of QueryTile feature. +constexpr bool kDefaultQueryTileState = false; + +const GURL BuildGetQueryTileURL(const GURL& base_url, const char* path) { + GURL::Replacements replacements; + replacements.SetPathStr(path); + return base_url.ReplaceComponents(replacements); +} + +} // namespace + +std::unique_ptr<QueryTilesConfig> QueryTilesConfig::Create() { + return std::make_unique<QueryTilesConfig>(); +} + +std::unique_ptr<QueryTilesConfig> QueryTilesConfig::CreateFromFinch() { + // TODO(hesen): Implement reading parameters from Finch. + return std::make_unique<QueryTilesConfig>(); +} + +QueryTilesConfig::QueryTilesConfig() + : is_enabled(kDefaultQueryTileState), + base_url(GURL(kDefaultBaseURL)), + get_query_tile_url( + BuildGetQueryTileURL(base_url, kDefaultGetQueryTilePath)) {} + +QueryTilesConfig::~QueryTilesConfig() = default; + +} // namespace upboarding
diff --git a/chrome/browser/upboarding/query_tiles/internal/config.h b/chrome/browser/upboarding/query_tiles/internal/config.h new file mode 100644 index 0000000..c601eac --- /dev/null +++ b/chrome/browser/upboarding/query_tiles/internal/config.h
@@ -0,0 +1,40 @@ +// Copyright 2020 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef CHROME_BROWSER_UPBOARDING_QUERY_TILES_INTERNAL_CONFIG_H_ +#define CHROME_BROWSER_UPBOARDING_QUERY_TILES_INTERNAL_CONFIG_H_ + +#include <memory> +#include <string> +#include <utility> + +#include "url/gurl.h" + +namespace upboarding { + +struct QueryTilesConfig { + // Creates a default QueryTilesConfig. + static std::unique_ptr<QueryTilesConfig> Create(); + + // Creates a QueryTilesConfig that reads parameters from Finch. + static std::unique_ptr<QueryTilesConfig> CreateFromFinch(); + + QueryTilesConfig(); + ~QueryTilesConfig(); + QueryTilesConfig(const QueryTilesConfig& other) = delete; + QueryTilesConfig& operator=(const QueryTilesConfig& other) = delete; + + // Flag to tell whether query tiles is enabled or not. + bool is_enabled; + + // The base URL for the Query Tiles server. + GURL base_url; + + // The URL for GetQueryTiles RPC. + GURL get_query_tile_url; +}; + +} // namespace upboarding + +#endif // CHROME_BROWSER_UPBOARDING_QUERY_TILES_INTERNAL_CONFIG_H_
diff --git a/chrome/browser/vr/service/xr_runtime_manager_impl.cc b/chrome/browser/vr/service/xr_runtime_manager_impl.cc index ef9c38407..9834e03 100644 --- a/chrome/browser/vr/service/xr_runtime_manager_impl.cc +++ b/chrome/browser/vr/service/xr_runtime_manager_impl.cc
@@ -12,6 +12,8 @@ #include "base/feature_list.h" #include "base/lazy_instance.h" #include "base/memory/singleton.h" +#include "base/metrics/user_metrics.h" +#include "base/metrics/user_metrics_action.h" #include "base/trace_event/common/trace_event_common.h" #include "build/build_config.h" #include "chrome/browser/vr/service/browser_xr_runtime_impl.h" @@ -107,8 +109,11 @@ if (arcore_device_provider) { providers.emplace_back(std::move(arcore_device_provider)); } else { - // TODO(crbug.com/1050470): Remove this logging after investigation. + // TODO(https://crbug.com/1050470): Remove this logging after + // investigation. LOG(ERROR) << "Could not get ARCoreDeviceProviderFactory"; + base::RecordAction(base::UserMetricsAction( + "XR.ARCoreDeviceProviderFactory.NotInstalled")); } #endif // BUILDFLAG(ENABLE_ARCORE) #endif // defined(OS_ANDROID)
diff --git a/chrome/browser/web_applications/system_web_app_manager.cc b/chrome/browser/web_applications/system_web_app_manager.cc index d9960f9..c3d1480 100644 --- a/chrome/browser/web_applications/system_web_app_manager.cc +++ b/chrome/browser/web_applications/system_web_app_manager.cc
@@ -125,7 +125,8 @@ infos.at(SystemAppType::MEDIA).show_in_launcher = false; infos.at(SystemAppType::MEDIA).show_in_search = false; infos.at(SystemAppType::MEDIA).enabled_origin_trials = - OriginTrialsMap({{GetOrigin("chrome://media-app"), {"FileHandling"}}}); + OriginTrialsMap({{GetOrigin("chrome://media-app"), + {"FileHandling", "NativeFileSystem2"}}}); } if (SystemWebAppManager::IsAppEnabled(SystemAppType::PRINT_MANAGEMENT)) {
diff --git a/chrome/common/chrome_features.cc b/chrome/common/chrome_features.cc index 2bd9811a..95b96ca 100644 --- a/chrome/common/chrome_features.cc +++ b/chrome/common/chrome_features.cc
@@ -45,13 +45,6 @@ base::FEATURE_DISABLED_BY_DEFAULT}; #endif // defined(OS_MACOSX) -#if defined(OS_ANDROID) -// Enables messaging in site permissions UI informing user when notifications -// are disabled for the entire app. -const base::Feature kAppNotificationStatusMessaging{ - "AppNotificationStatusMessaging", base::FEATURE_DISABLED_BY_DEFAULT}; -#endif // defined(OS_ANDROID) - #if !defined(OS_ANDROID) // App Service related flags. See chrome/services/app_service/README.md. const base::Feature kAppServiceContextMenu{"AppServiceContextMenu", @@ -143,11 +136,6 @@ const base::Feature kAllowDisableMouseAcceleration{ "AllowDisableMouseAcceleration", base::FEATURE_ENABLED_BY_DEFAULT}; -// Shows settings for adjusting scroll acceleration/sensitivity for -// mouse/touchpad. -const base::Feature kAllowScrollSettings{"AllowScrollSettings", - base::FEATURE_ENABLED_BY_DEFAULT}; - // Enable project Crostini, Linux VMs on Chrome OS. const base::Feature kCrostini{"Crostini", base::FEATURE_DISABLED_BY_DEFAULT};
diff --git a/chrome/common/chrome_features.h b/chrome/common/chrome_features.h index f3adaf7..47d16c9 100644 --- a/chrome/common/chrome_features.h +++ b/chrome/common/chrome_features.h
@@ -48,11 +48,6 @@ extern const base::Feature kShow10_9ObsoleteInfobar; #endif // defined(OS_MACOSX) -#if defined(OS_ANDROID) -COMPONENT_EXPORT(CHROME_FEATURES) -extern const base::Feature kAppNotificationStatusMessaging; -#endif // defined(OS_ANDROID) - #if !defined(OS_ANDROID) COMPONENT_EXPORT(CHROME_FEATURES) extern const base::Feature kAppServiceContextMenu; @@ -98,8 +93,6 @@ #if defined(OS_CHROMEOS) COMPONENT_EXPORT(CHROME_FEATURES) extern const base::Feature kAllowDisableMouseAcceleration; -COMPONENT_EXPORT(CHROME_FEATURES) -extern const base::Feature kAllowScrollSettings; COMPONENT_EXPORT(CHROME_FEATURES) extern const base::Feature kCrostini; COMPONENT_EXPORT(CHROME_FEATURES) extern const base::Feature kCrostiniAdditionalEnterpriseReporting;
diff --git a/chrome/common/chrome_render_frame.mojom b/chrome/common/chrome_render_frame.mojom index 9ef0e773..dc08a008 100644 --- a/chrome/common/chrome_render_frame.mojom +++ b/chrome/common/chrome_render_frame.mojom
@@ -12,6 +12,9 @@ enum ImageFormat { JPEG, PNG, + // ORIGINAL means request basic image formats, JPG/PNG/GIF, if the original + // image format is not one of them, encode the image to JPG and return. + ORIGINAL, }; [Native] @@ -27,16 +30,19 @@ // (if there indeed is an image at that location). RequestReloadImageForContextNode(); - // Requests an encoded thumbnail of the image selected by the most recently - // opened context menu. The encoding format is specified as a parameter. If - // no image is selected or there's an error capturing a thumbnail, - // |thumbnail_data| will be empty. If the image area is larger than - // |thumbnail_min_area_pixels| it will be downscaled to fit within - // |thumbnail_max_size_pixels|. - RequestThumbnailForContextNode(int32 thumbnail_min_area_pixels, - gfx.mojom.Size thumbnail_max_size_pixels, + // Requests an encoded image selected by the most recently opened context + // menu. The encoding format is specified as a parameter. If no image is + // selected or there's an error capturing the image, |image_data| will be + // empty. If the image area is larger than |image_min_area_pixels| it will be + // downscaled to fit within |image_max_size_pixels|. + // If |image_format| is ORIGINAL, return orinal image data except image + // larger than size specified as a parameter. In that case, returns a resized + // JPEG static image. + RequestImageForContextNode(int32 image_min_area_pixels, + gfx.mojom.Size image_max_size_pixels, ImageFormat image_format) - => (array<uint8> thumbnail_data, gfx.mojom.Size original_size); + => (array<uint8> image_data, gfx.mojom.Size original_size, + string encoded_extension); // For WebUI testing, this message requests JavaScript to be executed at a // time which is late enough to not be thrown out, and early enough to be
diff --git a/chrome/common/chrome_switches.cc b/chrome/common/chrome_switches.cc index 3185babc..411a2dd 100644 --- a/chrome/common/chrome_switches.cc +++ b/chrome/common/chrome_switches.cc
@@ -575,6 +575,12 @@ // durations to be significantly less than the test timeout. const char kStartStackProfilerBrowserTest[] = "browser-test"; +// Interval, in minutes, used for storage pressure notification throttling. +// Useful for developers testing applications that might use non-trivial +// amounts of disk space. +const char kStoragePressureNotificationInterval[] = + "storage-pressure-notification-interval"; + // Sets the supervised user ID for any loaded or newly created profile to the // given value. Pass an empty string to mark the profile as non-supervised. // Used for testing.
diff --git a/chrome/common/chrome_switches.h b/chrome/common/chrome_switches.h index 35177f4..d4e12dd 100644 --- a/chrome/common/chrome_switches.h +++ b/chrome/common/chrome_switches.h
@@ -169,6 +169,7 @@ extern const char kStartMaximized[]; extern const char kStartStackProfiler[]; extern const char kStartStackProfilerBrowserTest[]; +extern const char kStoragePressureNotificationInterval[]; extern const char kSupervisedUserId[]; extern const char kSystemLogUploadFrequency[]; extern const char kTaskManagerShowExtraRenderers[];
diff --git a/chrome/common/extensions/api/tabs.json b/chrome/common/extensions/api/tabs.json index 3a4751ab..6554046 100644 --- a/chrome/common/extensions/api/tabs.json +++ b/chrome/common/extensions/api/tabs.json
@@ -7,6 +7,12 @@ "namespace": "tabs", "description": "Use the <code>chrome.tabs</code> API to interact with the browser's tab system. You can use this API to create, modify, and rearrange tabs in the browser.", "types": [ + { + "id": "TabStatus", + "type": "string", + "enum": ["unloaded", "loading", "complete"], + "description": "The tab's loading status." + }, { "id": "MutedInfoReason", "type": "string", "description": "An event that caused a muted state change.", @@ -58,7 +64,11 @@ "pendingUrl": {"type": "string", "optional": true, "description": "The URL the tab is navigating to, before it has committed. This property is only present if the extension's manifest includes the <code>\"tabs\"</code> permission and there is a pending navigation."}, "title": {"type": "string", "optional": true, "description": "The title of the tab. This property is only present if the extension's manifest includes the <code>\"tabs\"</code> permission."}, "favIconUrl": {"type": "string", "optional": true, "description": "The URL of the tab's favicon. This property is only present if the extension's manifest includes the <code>\"tabs\"</code> permission. It may also be an empty string if the tab is loading."}, - "status": {"type": "string", "optional": true, "description": "One of <em>unloaded</em>, <em>loading</em> or <em>complete</em>."}, + "status": { + "$ref": "TabStatus", + "optional": true, + "description": "The tab's loading status." + }, "incognito": {"type": "boolean", "description": "Whether the tab is in an incognito window."}, "width": {"type": "integer", "optional": true, "description": "The width of the tab in pixels."}, "height": {"type": "integer", "optional": true, "description": "The height of the tab in pixels."}, @@ -122,12 +132,6 @@ } }, { - "id": "TabStatus", - "type": "string", - "enum": ["unloaded", "loading", "complete"], - "description": "The tab loading status." - }, - { "id": "WindowType", "type": "string", "enum": ["normal", "popup", "panel", "app", "devtools"], @@ -1014,9 +1018,9 @@ "description": "Lists the changes to the state of the tab that was updated.", "properties": { "status": { - "type": "string", + "$ref": "TabStatus", "optional": true, - "description": "The tab loading status. One of <em>unloaded</em>, <em>loading</em> or <em>complete</em>." + "description": "The tab's loading status." }, "url": { "type": "string",
diff --git a/chrome/common/extensions/manifest_handlers/extension_action_handler_unittest.cc b/chrome/common/extensions/manifest_handlers/extension_action_handler_unittest.cc index ef8f999..4c77ad2 100644 --- a/chrome/common/extensions/manifest_handlers/extension_action_handler_unittest.cc +++ b/chrome/common/extensions/manifest_handlers/extension_action_handler_unittest.cc
@@ -27,14 +27,6 @@ namespace { -// TODO(devlin): We don't need this separate enum now that SystemIndicator is -// no longer part of ActionInfo. -enum class TestActionType { - kBrowserAction, - kPageAction, - kAction, -}; - base::FilePath GetTestDataDir() { base::FilePath path; base::PathService::Get(chrome::DIR_TEST_DATA, &path); @@ -83,7 +75,7 @@ // ("page_action", "browser_action", "action"). class ExtensionActionManifestTest : public ManifestTest, - public testing::WithParamInterface<TestActionType> { + public testing::WithParamInterface<ActionInfo::Type> { public: ExtensionActionManifestTest() {} ~ExtensionActionManifestTest() override {} @@ -101,13 +93,13 @@ const char* action_key = nullptr; switch (GetParam()) { - case TestActionType::kBrowserAction: + case ActionInfo::TYPE_BROWSER: action_key = manifest_keys::kBrowserAction; break; - case TestActionType::kPageAction: + case ActionInfo::TYPE_PAGE: action_key = manifest_keys::kPageAction; break; - case TestActionType::kAction: + case ActionInfo::TYPE_ACTION: action_key = manifest_keys::kAction; break; } @@ -124,13 +116,13 @@ const ActionInfo* GetActionInfo(const Extension& extension) { const ActionInfo* action_info = nullptr; switch (GetParam()) { - case TestActionType::kBrowserAction: + case ActionInfo::TYPE_BROWSER: action_info = ActionInfo::GetBrowserActionInfo(&extension); break; - case TestActionType::kPageAction: + case ActionInfo::TYPE_PAGE: action_info = ActionInfo::GetPageActionInfo(&extension); break; - case TestActionType::kAction: + case ActionInfo::TYPE_ACTION: action_info = ActionInfo::GetExtensionActionInfo(&extension); break; } @@ -223,13 +215,13 @@ const char* expected_error = nullptr; switch (GetParam()) { - case TestActionType::kBrowserAction: + case ActionInfo::TYPE_BROWSER: expected_error = manifest_errors::kInvalidBrowserAction; break; - case TestActionType::kPageAction: + case ActionInfo::TYPE_PAGE: expected_error = manifest_errors::kInvalidPageAction; break; - case TestActionType::kAction: + case ActionInfo::TYPE_ACTION: expected_error = manifest_errors::kInvalidAction; break; } @@ -257,7 +249,7 @@ constexpr char kDefaultStateInvalid[] = R"({"default_state": "foo"})"; // default_state is only valid for "action" types. - const bool default_state_allowed = GetParam() == TestActionType::kAction; + const bool default_state_allowed = GetParam() == ActionInfo::TYPE_ACTION; const char* key_disallowed_error = manifest_errors::kDefaultStateShouldNotBeSet; @@ -304,8 +296,8 @@ INSTANTIATE_TEST_SUITE_P(All, ExtensionActionManifestTest, - testing::Values(TestActionType::kBrowserAction, - TestActionType::kPageAction, - TestActionType::kAction)); + testing::Values(ActionInfo::TYPE_BROWSER, + ActionInfo::TYPE_PAGE, + ActionInfo::TYPE_ACTION)); } // namespace extensions
diff --git a/chrome/common/pref_names.cc b/chrome/common/pref_names.cc index 15f9afa..cd1dc81 100644 --- a/chrome/common/pref_names.cc +++ b/chrome/common/pref_names.cc
@@ -514,14 +514,14 @@ const char kMouseSensitivity[] = "settings.mouse.sensitivity2"; // A integer pref for the touchpad scroll sensitivity, in the range -// [kMinPointerSensitivity, kMaxPointerSensitivity]. +// [PointerSensitivity::kLowest, PointerSensitivity::kHighest]. const char kMouseScrollSensitivity[] = "settings.mouse.scroll_sensitivity"; // A integer pref for the touchpad sensitivity. const char kTouchpadSensitivity[] = "settings.touchpad.sensitivity2"; // A integer pref for the touchpad scroll sensitivity, in the range -// [kMinPointerSensitivity, kMaxPointerSensitivity]. +// [PointerSensitivity::kLowest, PointerSensitivity::kHighest]. const char kTouchpadScrollSensitivity[] = "settings.touchpad.scroll_sensitivity";
diff --git a/chrome/common/webui_url_constants.cc b/chrome/common/webui_url_constants.cc index c147a80..f62481b 100644 --- a/chrome/common/webui_url_constants.cc +++ b/chrome/common/webui_url_constants.cc
@@ -88,6 +88,7 @@ const char kChromeUIInterventionsInternalsHost[] = "interventions-internals"; const char kChromeUIInvalidationsHost[] = "invalidations"; const char kChromeUIKaleidoscopeHost[] = "kaleidoscope"; +const char kChromeUIKaleidoscopeURL[] = "chrome://kaleidoscope"; const char kChromeUIKaleidoscopeContentHost[] = "kaleidoscope-content"; const char kChromeUIKaleidoscopeContentURL[] = "chrome://kaleidoscope-content"; const char kChromeUIKillHost[] = "kill"; @@ -361,6 +362,7 @@ // chrome_autocomplete_provider_client.cc to be listed by the built-in // AutocompleteProvider. +const char kAccessibilitySubPage[] = "accessibility"; const char kAddressesSubPage[] = "addresses"; const char kAppearanceSubPage[] = "appearance"; const char kAutofillSubPage[] = "autofill"; @@ -379,6 +381,7 @@ const char kPaymentsSubPage[] = "payments"; const char kPrintingSettingsSubPage[] = "printing"; const char kPrivacySubPage[] = "privacy"; +const char kResetSubPage[] = "reset"; const char kResetProfileSettingsSubPage[] = "resetProfileSettings"; const char kSearchSubPage[] = "search"; const char kSearchEnginesSubPage[] = "searchEngines"; @@ -389,7 +392,6 @@ #if defined(OS_CHROMEOS) // NOTE: Add new OS settings to IsOSSettingsSubPage() below. -const char kAccessibilitySubPage[] = "accessibility"; const char kAccountManagerSubPage[] = "accountManager"; const char kAccountSubPage[] = "accounts"; const char kAmbientModeSubPage[] = "ambientMode"; @@ -423,11 +425,12 @@ const char kNativePrintingSettingsSubPage[] = "cupsPrinters"; const char kNetworkDetailSubPage[] = "networkDetail"; const char kNetworksSubPage[] = "networks"; +const char kOsAccessibilitySubPage[] = "osAccessibility"; +const char kOsResetSubPage[] = "osReset"; const char kPluginVmDetailsSubPage[] = "pluginVm/details"; const char kPluginVmSharedPathsSubPage[] = "pluginVm/sharedPaths"; const char kPointerOverlaySubPage[] = "pointer-overlay"; const char kPowerSubPage[] = "power"; -const char kResetSubPage[] = "reset"; const char kSmartLockSettingsSubPage[] = "multidevice/features/smartLock"; const char kSmbSharesSubPage[] = "smbShares"; const char kStorageSubPage[] = "storage"; @@ -443,7 +446,6 @@ // Any changes here need to be kept in sync with chrome_new_window_client.cc bool IsOSSettingsSubPage(const std::string& sub_page) { static const char* const kSubPages[] = { - kAccessibilitySubPage, kAccountManagerSubPage, kAccountSubPage, kAmbientModeSubPage, @@ -480,10 +482,10 @@ kNetworksSubPage, kPluginVmDetailsSubPage, kPluginVmSharedPathsSubPage, + kOsAccessibilitySubPage, + kOsResetSubPage, kPointerOverlaySubPage, kPowerSubPage, - // reset is both an OS and browser sub page, but prefer the OS version - kResetSubPage, kSmartLockSettingsSubPage, kSmbSharesSubPage, kStorageSubPage,
diff --git a/chrome/common/webui_url_constants.h b/chrome/common/webui_url_constants.h index 3976e0b..e275dbe 100644 --- a/chrome/common/webui_url_constants.h +++ b/chrome/common/webui_url_constants.h
@@ -93,9 +93,15 @@ extern const char kChromeUIInterstitialURL[]; extern const char kChromeUIInterventionsInternalsHost[]; extern const char kChromeUIInvalidationsHost[]; + +// |kChromeUIKaleidoscopeHost| and |kChromeUIKaleidoscopeContentHost| are used +// in the public repo, so are defined here. We only use the URL constants in the +// internal repo, but they are defined here to be near the host constants. extern const char kChromeUIKaleidoscopeHost[]; +extern const char kChromeUIKaleidoscopeURL[]; extern const char kChromeUIKaleidoscopeContentHost[]; extern const char kChromeUIKaleidoscopeContentURL[]; + extern const char kChromeUIKillHost[]; extern const char kChromeUILocalStateHost[]; extern const char kChromeUIManagementHost[]; @@ -315,6 +321,7 @@ extern const char kChromeUIWebRtcLogsHost[]; // Settings sub-pages. +extern const char kAccessibilitySubPage[]; extern const char kAddressesSubPage[]; extern const char kAppearanceSubPage[]; extern const char kAutofillSubPage[]; @@ -336,6 +343,7 @@ extern const char kPeopleSubPage[]; extern const char kPrintingSettingsSubPage[]; extern const char kPrivacySubPage[]; +extern const char kResetSubPage[]; extern const char kResetProfileSettingsSubPage[]; extern const char kSearchSubPage[]; extern const char kSearchEnginesSubPage[]; @@ -377,11 +385,12 @@ extern const char kNativePrintingSettingsSubPage[]; extern const char kNetworkDetailSubPage[]; extern const char kNetworksSubPage[]; +extern const char kOsAccessibilitySubPage[]; +extern const char kOsResetSubPage[]; extern const char kPluginVmDetailsSubPage[]; extern const char kPluginVmSharedPathsSubPage[]; extern const char kPointerOverlaySubPage[]; extern const char kPowerSubPage[]; -extern const char kResetSubPage[]; extern const char kSmartLockSettingsSubPage[]; extern const char kSmbSharesSubPage[]; extern const char kStorageSubPage[];
diff --git a/chrome/installer/linux/BUILD.gn b/chrome/installer/linux/BUILD.gn index f1129b4..9c92012 100644 --- a/chrome/installer/linux/BUILD.gn +++ b/chrome/installer/linux/BUILD.gn
@@ -21,6 +21,9 @@ # Enables checks that ensure the packages are installable on all supported # distributions. enable_distro_version_check = true + + # Enable building snap packages + enable_snap_package = false } assert(is_linux) @@ -358,6 +361,12 @@ assert(defined(invoker.channel)) channel = invoker.channel + if (is_chrome_branded) { + package = "google-chrome" + } else { + package = "chromium-browser" + } + deb_target_name = "${target_name}_deb" action(deb_target_name) { visibility = [ ":*" ] @@ -380,19 +389,12 @@ } inputs = packaging_files - if (is_chrome_branded) { - package = "google-chrome" - } else { - package = "chromium-browser" - } outputs = [ "$root_out_dir/${package}-${channel}_${chrome_version_full}-1_${deb_arch}.deb" ] args = [ rebase_path("$root_out_dir/installer/debian/build.sh", root_build_dir), "-a", deb_arch, - "-b", - rebase_path(root_out_dir, root_build_dir), "-c", invoker.channel, "-d", @@ -436,19 +438,12 @@ } inputs = packaging_files - if (is_chrome_branded) { - package = "google-chrome" - } else { - package = "chromium-browser" - } outputs = [ "$root_out_dir/${package}-${channel}-${chrome_version_full}-1.${rpm_arch}.rpm" ] args = [ rebase_path("$root_out_dir/installer/rpm/build.sh", root_build_dir), "-a", rpm_arch, - "-b", - rebase_path(root_out_dir, root_build_dir), "-c", invoker.channel, "-d", @@ -466,12 +461,54 @@ ":merge_rpm_dependencies", ] } + + if (enable_snap_package) { + snap_target_name = "${target_name}_snap" + action(snap_target_name) { + visibility = [ ":*" ] + deps = [ + ":installer_deps", + ":save_build_info", + ] + script = "//build/gn_run_binary.py" + sources = [ + "snap/chrome.launcher.in", + "snap/snapcraft.yaml.in", + ] + if (!is_chrome_branded) { + package = "chromium" + } + if (current_cpu == "x86") { + snap_arch = "i386" + } else if (current_cpu == "x64") { + snap_arch = "amd64" + } else if (current_cpu == "arm") { + snap_arch = "armhf" + } else if (current_cpu == "arm64") { + snap_arch = "arm64" + } else { + assert(false, "Linux installer not configured for this architecture.") + } + args = [ + rebase_path("snap/build.sh", root_build_dir), + package, + channel, + chrome_version_full, + snap_arch, + target_os, + ] + outputs = [ "$root_out_dir/${package}-${channel}_${chrome_version_full}_${snap_arch}.snap" ] + } + } } group(target_name) { deps = [ ":$deb_target_name" ] if (!is_chromeos) { deps += [ ":$rpm_target_name" ] + if (enable_snap_package) { + deps += [ ":$snap_target_name" ] + } } } }
diff --git a/chrome/installer/linux/common/chromium-browser/chromium-browser.info b/chrome/installer/linux/common/chromium-browser/chromium-browser.info index 3593c9e..6f67b061 100644 --- a/chrome/installer/linux/common/chromium-browser/chromium-browser.info +++ b/chrome/installer/linux/common/chromium-browser/chromium-browser.info
@@ -8,6 +8,9 @@ # Base name of the package. PACKAGE="chromium-browser" +# Base name of the snap package +SNAPNAME="chromium" + # Filename of the main executable (for generating launcher scripts, etc.) PROGNAME=chrome
diff --git a/chrome/installer/linux/common/google-chrome/google-chrome.info b/chrome/installer/linux/common/google-chrome/google-chrome.info index 28cd2e2..2ad1b5c 100644 --- a/chrome/installer/linux/common/google-chrome/google-chrome.info +++ b/chrome/installer/linux/common/google-chrome/google-chrome.info
@@ -8,6 +8,9 @@ # Base name of the package. PACKAGE="google-chrome" +# Base name of the snap package +SNAPNAME="google-chrome" + # Filename of the main executable (for generating launcher scripts, etc.) PROGNAME=chrome
diff --git a/chrome/installer/linux/common/installer.include b/chrome/installer/linux/common/installer.include index e6bc6fea..f73118e 100644 --- a/chrome/installer/linux/common/installer.include +++ b/chrome/installer/linux/common/installer.include
@@ -75,6 +75,7 @@ -e "s#@@PACKAGE@@#${PACKAGE}#g" \ -e "s#@@PACKAGE_ORIG@@#${PACKAGE_ORIG}#g" \ -e "s#@@PACKAGE_FILENAME@@#${PACKAGE_FILENAME}#g" \ + -e "s#@@SNAPNAME@@#${SNAPNAME}#g" \ -e "s#@@PROGNAME@@#${PROGNAME}#g" \ -e "s#@@CHANNEL@@#${CHANNEL}#g" \ -e "s#@@COMPANY_FULLNAME@@#${COMPANY_FULLNAME}#g" \ @@ -82,7 +83,7 @@ -e "s#@@PACKAGE_RELEASE@@#${PACKAGE_RELEASE}#g" \ -e "s#@@VERSIONFULL@@#${VERSIONFULL}#g" \ -e "s#@@INSTALLDIR@@#${INSTALLDIR}#g" \ - -e "s#@@BUILDDIR@@#${BUILDDIR}#g" \ + -e "s#@@BUILDDIR@@#${OUTPUTDIR}#g" \ -e "s#@@STAGEDIR@@#${STAGEDIR}#g" \ -e "s#@@SCRIPTDIR@@#${SCRIPTDIR}#g" \ -e "s#@@MENUNAME@@#${MENUNAME}#g" \ @@ -115,7 +116,7 @@ } get_version_info() { - source "${BUILDDIR}/installer/version.txt" + source "${OUTPUTDIR}/installer/version.txt" VERSION="${MAJOR}.${MINOR}.${BUILD}.${PATCH}" # TODO(phajdan.jr): Provide a mechanism to pass a different package # release number if needed. The meaning of it is to bump it for @@ -137,41 +138,41 @@ # is_component_build flag is true. # app - STRIPPEDFILE="${BUILDDIR}/${PROGNAME}.stripped" + STRIPPEDFILE="${OUTPUTDIR}/${PROGNAME}.stripped" install -m 755 "${STRIPPEDFILE}" "${STAGEDIR}/${INSTALLDIR}/${PROGNAME}" # crashpad - buildfile="${BUILDDIR}/crashpad_handler" + buildfile="${OUTPUTDIR}/crashpad_handler" strippedfile="${buildfile}.stripped" debugfile="${buildfile}.debug" - "${BUILDDIR}/installer/common/eu-strip" -o "${strippedfile}" -f "${debugfile}" "${buildfile}" + "${OUTPUTDIR}/installer/common/eu-strip" -o "${strippedfile}" -f "${debugfile}" "${buildfile}" install -m 755 "${strippedfile}" "${STAGEDIR}/${INSTALLDIR}/crashpad_handler" # resources - install -m 644 "${BUILDDIR}/resources.pak" "${STAGEDIR}/${INSTALLDIR}/" + install -m 644 "${OUTPUTDIR}/resources.pak" "${STAGEDIR}/${INSTALLDIR}/" # TODO(mmoss): This has broken a couple times on adding new .pak files. Maybe # we should flag all installer files in FILES.cfg and get them from there, so # there's only one place people need to keep track of such things (and in # only the public repository). - if [ -r "${BUILDDIR}/chrome_100_percent.pak" ]; then - install -m 644 "${BUILDDIR}/chrome_100_percent.pak" "${STAGEDIR}/${INSTALLDIR}/" - install -m 644 "${BUILDDIR}/chrome_200_percent.pak" "${STAGEDIR}/${INSTALLDIR}/" + if [ -r "${OUTPUTDIR}/chrome_100_percent.pak" ]; then + install -m 644 "${OUTPUTDIR}/chrome_100_percent.pak" "${STAGEDIR}/${INSTALLDIR}/" + install -m 644 "${OUTPUTDIR}/chrome_200_percent.pak" "${STAGEDIR}/${INSTALLDIR}/" else - install -m 644 "${BUILDDIR}/theme_resources_100_percent.pak" "${STAGEDIR}/${INSTALLDIR}/" - install -m 644 "${BUILDDIR}/ui_resources_100_percent.pak" "${STAGEDIR}/${INSTALLDIR}/" + install -m 644 "${OUTPUTDIR}/theme_resources_100_percent.pak" "${STAGEDIR}/${INSTALLDIR}/" + install -m 644 "${OUTPUTDIR}/ui_resources_100_percent.pak" "${STAGEDIR}/${INSTALLDIR}/" fi # ICU data file; Necessary when the GN icu_use_data_file flag is true. - install -m 644 "${BUILDDIR}/icudtl.dat" "${STAGEDIR}/${INSTALLDIR}/" + install -m 644 "${OUTPUTDIR}/icudtl.dat" "${STAGEDIR}/${INSTALLDIR}/" # V8 snapshot files; Necessary when the GN v8_use_external_startup_data flag # is true. # Use v8_context_snapshot.bin instead of snapshot_blob.bin if it is available. # TODO(crbug.com/764576): Unship snapshot_blob.bin on ChromeOS and drop this branch - if [ -f "${BUILDDIR}/v8_context_snapshot.bin" ]; then - install -m 644 "${BUILDDIR}/v8_context_snapshot.bin" "${STAGEDIR}/${INSTALLDIR}/" + if [ -f "${OUTPUTDIR}/v8_context_snapshot.bin" ]; then + install -m 644 "${OUTPUTDIR}/v8_context_snapshot.bin" "${STAGEDIR}/${INSTALLDIR}/" else - install -m 644 "${BUILDDIR}/snapshot_blob.bin" "${STAGEDIR}/${INSTALLDIR}/" + install -m 644 "${OUTPUTDIR}/snapshot_blob.bin" "${STAGEDIR}/${INSTALLDIR}/" fi # sandbox @@ -180,29 +181,29 @@ # where it did not support hyphens, so this is stuck as is to avoid breaking # anyone who expects the build artifact to have the underscore. # the code looks for, but the build targets can't use hyphens (scons bug?) - buildfile="${BUILDDIR}/${PROGNAME}_sandbox" + buildfile="${OUTPUTDIR}/${PROGNAME}_sandbox" strippedfile="${buildfile}.stripped" debugfile="${buildfile}.debug" - "${BUILDDIR}/installer/common/eu-strip" -o "${strippedfile}" -f "${debugfile}" "${buildfile}" + "${OUTPUTDIR}/installer/common/eu-strip" -o "${strippedfile}" -f "${debugfile}" "${buildfile}" install -m 4755 "${strippedfile}" "${STAGEDIR}/${INSTALLDIR}/chrome-sandbox" # l10n paks install -m 755 -d "${STAGEDIR}/${INSTALLDIR}/locales/" - find "${BUILDDIR}/locales" -type f -name '*.pak' -exec \ + find "${OUTPUTDIR}/locales" -type f -name '*.pak' -exec \ cp -a '{}' "${STAGEDIR}/${INSTALLDIR}/locales/" \; find "${STAGEDIR}/${INSTALLDIR}/locales" -type f -exec chmod 644 '{}' \; # MEI Preload - if [ -f "${BUILDDIR}/MEIPreload/manifest.json" ]; then + if [ -f "${OUTPUTDIR}/MEIPreload/manifest.json" ]; then install -m 755 -d "${STAGEDIR}/${INSTALLDIR}/MEIPreload/" - install -m 644 "${BUILDDIR}/MEIPreload/manifest.json" "${STAGEDIR}/${INSTALLDIR}/MEIPreload/" - install -m 644 "${BUILDDIR}/MEIPreload/preloaded_data.pb" "${STAGEDIR}/${INSTALLDIR}/MEIPreload/" + install -m 644 "${OUTPUTDIR}/MEIPreload/manifest.json" "${STAGEDIR}/${INSTALLDIR}/MEIPreload/" + install -m 644 "${OUTPUTDIR}/MEIPreload/preloaded_data.pb" "${STAGEDIR}/${INSTALLDIR}/MEIPreload/" fi # Widevine CDM. - if [ -d "${BUILDDIR}/WidevineCdm" ]; then + if [ -d "${OUTPUTDIR}/WidevineCdm" ]; then # No need to strip; libwidevinecdm.so starts out stripped. - cp -a "${BUILDDIR}/WidevineCdm" "${STAGEDIR}/${INSTALLDIR}/" + cp -a "${OUTPUTDIR}/WidevineCdm" "${STAGEDIR}/${INSTALLDIR}/" find "${STAGEDIR}/${INSTALLDIR}/WidevineCdm" -type d -exec chmod 755 '{}' \; find "${STAGEDIR}/${INSTALLDIR}/WidevineCdm" -type f -exec chmod 644 '{}' \; find "${STAGEDIR}/${INSTALLDIR}/WidevineCdm" -name libwidevinecdm.so \ @@ -210,32 +211,32 @@ fi # ANGLE - if [ -f "${BUILDDIR}/libEGL.so" ]; then + if [ -f "${OUTPUTDIR}/libEGL.so" ]; then for file in libEGL.so libGLESv2.so; do - buildfile="${BUILDDIR}/${file}" + buildfile="${OUTPUTDIR}/${file}" strippedfile="${buildfile}.stripped" debugfile="${buildfile}.debug" - "${BUILDDIR}/installer/common/eu-strip" -o "${strippedfile}" -f "${debugfile}" "${buildfile}" + "${OUTPUTDIR}/installer/common/eu-strip" -o "${strippedfile}" -f "${debugfile}" "${buildfile}" install -m ${SHLIB_PERMS} "${strippedfile}" "${STAGEDIR}/${INSTALLDIR}/${file}" done fi # SwiftShader - if [ -f "${BUILDDIR}/swiftshader/libEGL.so" ]; then + if [ -f "${OUTPUTDIR}/swiftshader/libEGL.so" ]; then install -m 755 -d "${STAGEDIR}/${INSTALLDIR}/swiftshader/" for file in libEGL.so libGLESv2.so; do - buildfile="${BUILDDIR}/swiftshader/${file}" + buildfile="${OUTPUTDIR}/swiftshader/${file}" strippedfile="${buildfile}.stripped" debugfile="${buildfile}.debug" - "${BUILDDIR}/installer/common/eu-strip" -o "${strippedfile}" -f "${debugfile}" "${buildfile}" + "${OUTPUTDIR}/installer/common/eu-strip" -o "${strippedfile}" -f "${debugfile}" "${buildfile}" install -m ${SHLIB_PERMS} "${strippedfile}" "${STAGEDIR}/${INSTALLDIR}/swiftshader/${file}" done fi # libc++ - if [ -f "${BUILDDIR}/lib/libc++.so" ]; then + if [ -f "${OUTPUTDIR}/lib/libc++.so" ]; then install -m 755 -d "${STAGEDIR}/${INSTALLDIR}/lib/" - install -m ${SHLIB_PERMS} -s "${BUILDDIR}/lib/libc++.so" "${STAGEDIR}/${INSTALLDIR}/lib/" + install -m ${SHLIB_PERMS} -s "${OUTPUTDIR}/lib/libc++.so" "${STAGEDIR}/${INSTALLDIR}/lib/" fi # nacl_helper and nacl_helper_bootstrap @@ -243,11 +244,11 @@ # mangles the special ELF program headers of nacl_helper_bootstrap. # Explicitly use eu-strip instead, because it doesn't have that problem. for file in nacl_helper nacl_helper_bootstrap; do - buildfile="${BUILDDIR}/${file}" + buildfile="${OUTPUTDIR}/${file}" if [ -f "${buildfile}" ]; then strippedfile="${buildfile}.stripped" debugfile="${buildfile}.debug" - "${BUILDDIR}/installer/common/eu-strip" -o "${strippedfile}" -f "${debugfile}" "${buildfile}" + "${OUTPUTDIR}/installer/common/eu-strip" -o "${strippedfile}" -f "${debugfile}" "${buildfile}" install -m 755 "${strippedfile}" "${STAGEDIR}/${INSTALLDIR}/${file}" fi done @@ -256,7 +257,7 @@ # certainly resets the OSABI and ABIVERSION fields to non-NaCl values, # although the NaCl IRT loader doesn't care about these fields. In any # case, the IRT binaries are already stripped by NaCl's build process. - for filename in ${BUILDDIR}/nacl_irt_*.nexe; do + for filename in ${OUTPUTDIR}/nacl_irt_*.nexe; do # Re-check the filename in case globbing matched nothing. if [ -f "$filename" ]; then install -m 644 "$filename" "${STAGEDIR}/${INSTALLDIR}/`basename "$filename"`" @@ -264,22 +265,26 @@ done # default apps - if [ -d "${BUILDDIR}/default_apps" ]; then - cp -a "${BUILDDIR}/default_apps" "${STAGEDIR}/${INSTALLDIR}/" + if [ -d "${OUTPUTDIR}/default_apps" ]; then + cp -a "${OUTPUTDIR}/default_apps" "${STAGEDIR}/${INSTALLDIR}/" find "${STAGEDIR}/${INSTALLDIR}/default_apps" -type d -exec chmod 755 '{}' \; find "${STAGEDIR}/${INSTALLDIR}/default_apps" -type f -exec chmod 644 '{}' \; fi # launcher script and symlink - process_template "${BUILDDIR}/installer/common/wrapper" \ + process_template "${OUTPUTDIR}/installer/common/wrapper" \ "${STAGEDIR}/${INSTALLDIR}/${PACKAGE}" chmod 755 "${STAGEDIR}/${INSTALLDIR}/${PACKAGE}" - if [ ! -f "${STAGEDIR}/${INSTALLDIR}/${PACKAGE_ORIG}" ]; then - ln -sn "${INSTALLDIR}/${PACKAGE}" \ - "${STAGEDIR}/${INSTALLDIR}/${PACKAGE_ORIG}" + if [ ! -z "${PACKAGE_ORIG}" ]; then + if [ ! -f "${STAGEDIR}/${INSTALLDIR}/${PACKAGE_ORIG}" ]; then + ln -sn "${INSTALLDIR}/${PACKAGE}" \ + "${STAGEDIR}/${INSTALLDIR}/${PACKAGE_ORIG}" + fi fi - ln -snf "${INSTALLDIR}/${PACKAGE}" \ - "${STAGEDIR}/usr/bin/${USR_BIN_SYMLINK_NAME}" + if [ ! -z "${USR_BIN_SYMLINK_NAME}" ]; then + ln -snf "${INSTALLDIR}/${PACKAGE}" \ + "${STAGEDIR}/usr/bin/${USR_BIN_SYMLINK_NAME}" + fi # app icons local icon_regex=".*product_logo_[0-9]\+\." @@ -290,41 +295,41 @@ icon_regex=".*product_logo_[0-9]\+_dev\." fi fi - LOGO_RESOURCES_PNG=$(find "${BUILDDIR}/installer/theme/" \ + LOGO_RESOURCES_PNG=$(find "${OUTPUTDIR}/installer/theme/" \ -regextype sed -regex "${icon_regex}png" -printf "%f ") - LOGO_RESOURCE_XPM=$(find "${BUILDDIR}/installer/theme/" \ + LOGO_RESOURCE_XPM=$(find "${OUTPUTDIR}/installer/theme/" \ -regextype sed -regex "${icon_regex}xpm" -printf "%f") for logo in ${LOGO_RESOURCES_PNG} ${LOGO_RESOURCE_XPM}; do install -m 644 \ - "${BUILDDIR}/installer/theme/${logo}" \ + "${OUTPUTDIR}/installer/theme/${logo}" \ "${STAGEDIR}/${INSTALLDIR}/" done # desktop integration - install -m 755 "${BUILDDIR}/xdg-mime" "${STAGEDIR}${INSTALLDIR}/" - install -m 755 "${BUILDDIR}/xdg-settings" "${STAGEDIR}${INSTALLDIR}/" + install -m 755 "${OUTPUTDIR}/xdg-mime" "${STAGEDIR}${INSTALLDIR}/" + install -m 755 "${OUTPUTDIR}/xdg-settings" "${STAGEDIR}${INSTALLDIR}/" if [ ${PACKAGE:0:6} = google ]; then - process_template "${BUILDDIR}/installer/common/google-chrome.appdata.xml.template" \ + process_template "${OUTPUTDIR}/installer/common/google-chrome.appdata.xml.template" \ "${STAGEDIR}/usr/share/appdata/${PACKAGE}.appdata.xml" chmod 644 "${STAGEDIR}/usr/share/appdata/${PACKAGE}.appdata.xml" else - install -m 644 "${BUILDDIR}/installer/common/chromium-browser.appdata.xml" \ + install -m 644 "${OUTPUTDIR}/installer/common/chromium-browser.appdata.xml" \ "${STAGEDIR}/usr/share/appdata/${PACKAGE}.appdata.xml" fi - process_template "${BUILDDIR}/installer/common/desktop.template" \ + process_template "${OUTPUTDIR}/installer/common/desktop.template" \ "${STAGEDIR}/usr/share/applications/${PACKAGE}.desktop" chmod 644 "${STAGEDIR}/usr/share/applications/${PACKAGE}.desktop" - process_template "${BUILDDIR}/installer/common/default-app.template" \ + process_template "${OUTPUTDIR}/installer/common/default-app.template" \ "${STAGEDIR}/usr/share/gnome-control-center/default-apps/${PACKAGE}.xml" chmod 644 "${STAGEDIR}/usr/share/gnome-control-center/default-apps/${PACKAGE}.xml" - process_template "${BUILDDIR}/installer/common/default-app-block.template" \ + process_template "${OUTPUTDIR}/installer/common/default-app-block.template" \ "${STAGEDIR}${INSTALLDIR}/default-app-block" chmod 644 "${STAGEDIR}${INSTALLDIR}/default-app-block" # documentation - process_template "${BUILDDIR}/installer/common/manpage.1.in" \ + process_template "${OUTPUTDIR}/installer/common/manpage.1.in" \ "${STAGEDIR}/usr/share/man/man1/${USR_BIN_SYMLINK_NAME}.1" gzip -9n "${STAGEDIR}/usr/share/man/man1/${USR_BIN_SYMLINK_NAME}.1" chmod 644 "${STAGEDIR}/usr/share/man/man1/${USR_BIN_SYMLINK_NAME}.1.gz"
diff --git a/chrome/installer/linux/debian/build.sh b/chrome/installer/linux/debian/build.sh index c8e2130..29e94a6f 100755 --- a/chrome/installer/linux/debian/build.sh +++ b/chrome/installer/linux/debian/build.sh
@@ -67,22 +67,22 @@ stage_install_common log_cmd echo "Staging Debian install files in '${STAGEDIR}'..." install -m 755 -d "${STAGEDIR}/${INSTALLDIR}/cron" - process_template "${BUILDDIR}/installer/common/repo.cron" \ + process_template "${OUTPUTDIR}/installer/common/repo.cron" \ "${STAGEDIR}/${INSTALLDIR}/cron/${PACKAGE}" chmod 755 "${STAGEDIR}/${INSTALLDIR}/cron/${PACKAGE}" pushd "${STAGEDIR}/etc/cron.daily/" > /dev/null ln -snf "${INSTALLDIR}/cron/${PACKAGE}" "${PACKAGE}" popd > /dev/null - process_template "${BUILDDIR}/installer/debian/debian.menu" \ + process_template "${OUTPUTDIR}/installer/debian/debian.menu" \ "${STAGEDIR}/usr/share/menu/${PACKAGE}.menu" chmod 644 "${STAGEDIR}/usr/share/menu/${PACKAGE}.menu" - process_template "${BUILDDIR}/installer/debian/postinst" \ + process_template "${OUTPUTDIR}/installer/debian/postinst" \ "${STAGEDIR}/DEBIAN/postinst" chmod 755 "${STAGEDIR}/DEBIAN/postinst" - process_template "${BUILDDIR}/installer/debian/prerm" \ + process_template "${OUTPUTDIR}/installer/debian/prerm" \ "${STAGEDIR}/DEBIAN/prerm" chmod 755 "${STAGEDIR}/DEBIAN/prerm" - process_template "${BUILDDIR}/installer/debian/postrm" \ + process_template "${OUTPUTDIR}/installer/debian/postrm" \ "${STAGEDIR}/DEBIAN/postrm" chmod 755 "${STAGEDIR}/DEBIAN/postrm" } @@ -135,10 +135,9 @@ } usage() { - echo "usage: $(basename $0) [-a target_arch] [-b 'dir'] -c channel" - echo " -d branding [-f] [-o 'dir'] -s 'dir' -t target_os" + echo "usage: $(basename $0) [-a target_arch] -c channel -d branding" + echo " [-f] [-o 'dir'] -s 'dir' -t target_os" echo "-a arch deb package architecture" - echo "-b dir build input directory [${BUILDDIR}]" echo "-c channel the package channel (unstable, beta, stable)" echo "-d brand either chromium or google_chrome" echo "-f indicates that this is an official build" @@ -179,9 +178,6 @@ a ) ARCHITECTURE="$OPTARG" ;; - b ) - BUILDDIR=$(readlink -f "${OPTARG}") - ;; c ) CHANNEL="$OPTARG" ;; @@ -229,29 +225,28 @@ # call cleanup() on exit trap cleanup 0 process_opts "$@" -BUILDDIR=${BUILDDIR:=$(readlink -f "${SCRIPTDIR}/../../../../out/Release")} IS_OFFICIAL_BUILD=${IS_OFFICIAL_BUILD:=0} -STAGEDIR="${BUILDDIR}/deb-staging-${CHANNEL}" +STAGEDIR="${OUTPUTDIR}/deb-staging-${CHANNEL}" mkdir -p "${STAGEDIR}" -TMPFILEDIR="${BUILDDIR}/deb-tmp-${CHANNEL}" +TMPFILEDIR="${OUTPUTDIR}/deb-tmp-${CHANNEL}" mkdir -p "${TMPFILEDIR}" DEB_CHANGELOG="${TMPFILEDIR}/changelog" DEB_FILES="${TMPFILEDIR}/files" DEB_CONTROL="${TMPFILEDIR}/control" -source ${BUILDDIR}/installer/common/installer.include +source ${OUTPUTDIR}/installer/common/installer.include get_version_info VERSIONFULL="${VERSION}-${PACKAGE_RELEASE}" if [ "$BRANDING" = "google_chrome" ]; then - source "${BUILDDIR}/installer/common/google-chrome.info" + source "${OUTPUTDIR}/installer/common/google-chrome.info" else - source "${BUILDDIR}/installer/common/chromium-browser.info" + source "${OUTPUTDIR}/installer/common/chromium-browser.info" fi eval $(sed -e "s/^\([^=]\+\)=\(.*\)$/export \1='\2'/" \ - "${BUILDDIR}/installer/theme/BRANDING") + "${OUTPUTDIR}/installer/theme/BRANDING") verify_channel @@ -260,7 +255,7 @@ export DEBEMAIL="${MAINTMAIL}" export ARCHITECTURE="${ARCHITECTURE}" -DEB_COMMON_DEPS="${BUILDDIR}/deb_common.deps" +DEB_COMMON_DEPS="${OUTPUTDIR}/deb_common.deps" COMMON_DEPS=$(sed ':a;N;$!ba;s/\n/, /g' "${DEB_COMMON_DEPS}") COMMON_PREDEPS="dpkg (>= 1.14.0)" MANUAL_RECOMMENDS="${SCRIPTDIR}/manual_recommends"
diff --git a/chrome/installer/linux/rpm/build.sh b/chrome/installer/linux/rpm/build.sh index 8e9c7e5..9df8ceb 100755 --- a/chrome/installer/linux/rpm/build.sh +++ b/chrome/installer/linux/rpm/build.sh
@@ -49,7 +49,7 @@ SHLIB_PERMS=755 stage_install_common log_cmd echo "Staging RPM install files in '${STAGEDIR}'..." - process_template "${BUILDDIR}/installer/common/rpmrepo.cron" \ + process_template "${OUTPUTDIR}/installer/common/rpmrepo.cron" \ "${STAGEDIR}/etc/cron.daily/${PACKAGE}" chmod 755 "${STAGEDIR}/etc/cron.daily/${PACKAGE}" } @@ -85,7 +85,7 @@ do_package() { log_cmd echo "Packaging ${ARCHITECTURE}..." PROVIDES="${PACKAGE}" - RPM_COMMON_DEPS="${BUILDDIR}/rpm_common.deps" + RPM_COMMON_DEPS="${OUTPUTDIR}/rpm_common.deps" DEPENDS=$(cat "${RPM_COMMON_DEPS}" | tr '\n' ',') gen_spec @@ -126,10 +126,9 @@ } usage() { - echo "usage: $(basename $0) [-a target_arch] [-b 'dir'] -c channel" - echo " -d branding [-f] [-o 'dir'] -t target_os" + echo "usage: $(basename $0) [-a target_arch] -c channel -d branding" + echo " [-f] [-o 'dir'] -t target_os" echo "-a arch rpm package architecture" - echo "-b dir build input directory [${BUILDDIR}]" echo "-c channel the package channel (unstable, beta, stable)" echo "-d brand either chromium or google_chrome" echo "-f indicates that this is an official build" @@ -166,9 +165,6 @@ a ) ARCHITECTURE="$OPTARG" ;; - b ) - BUILDDIR=$(readlink -f "${OPTARG}") - ;; c ) CHANNEL="$OPTARG" verify_channel @@ -215,28 +211,27 @@ trap cleanup 0 process_opts "$@" export ARCHITECTURE="${ARCHITECTURE}" -BUILDDIR=${BUILDDIR:=$(readlink -f "${SCRIPTDIR}/../../../../out/Release")} IS_OFFICIAL_BUILD=${IS_OFFICIAL_BUILD:=0} -STAGEDIR="${BUILDDIR}/rpm-staging-${CHANNEL}" +STAGEDIR="${OUTPUTDIR}/rpm-staging-${CHANNEL}" mkdir -p "${STAGEDIR}" -TMPFILEDIR="${BUILDDIR}/rpm-tmp-${CHANNEL}" +TMPFILEDIR="${OUTPUTDIR}/rpm-tmp-${CHANNEL}" mkdir -p "${TMPFILEDIR}" -RPMBUILD_DIR="${BUILDDIR}/rpm-build-${CHANNEL}" +RPMBUILD_DIR="${OUTPUTDIR}/rpm-build-${CHANNEL}" mkdir -p "${RPMBUILD_DIR}" SPEC="${TMPFILEDIR}/chrome.spec" -source ${BUILDDIR}/installer/common/installer.include +source ${OUTPUTDIR}/installer/common/installer.include get_version_info if [ "$BRANDING" = "google_chrome" ]; then - source "${BUILDDIR}/installer/common/google-chrome.info" + source "${OUTPUTDIR}/installer/common/google-chrome.info" else - source "${BUILDDIR}/installer/common/chromium-browser.info" + source "${OUTPUTDIR}/installer/common/chromium-browser.info" fi eval $(sed -e "s/^\([^=]\+\)=\(.*\)$/export \1='\2'/" \ - "${BUILDDIR}/installer/theme/BRANDING") + "${OUTPUTDIR}/installer/theme/BRANDING") REPOCONFIG="http://dl.google.com/linux/${PACKAGE#google-}/rpm/stable" verify_channel
diff --git a/chrome/installer/linux/snap/OWNERS b/chrome/installer/linux/snap/OWNERS new file mode 100644 index 0000000..3f47d18 --- /dev/null +++ b/chrome/installer/linux/snap/OWNERS
@@ -0,0 +1 @@ +olivier.tilloy@canonical.com
diff --git a/chrome/installer/linux/snap/build.sh b/chrome/installer/linux/snap/build.sh new file mode 100755 index 0000000..f811aac --- /dev/null +++ b/chrome/installer/linux/snap/build.sh
@@ -0,0 +1,65 @@ +#!/bin/bash +# +# Copyright (c) 2020 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +set -e +set -o pipefail +if [ "$VERBOSE" ]; then + set -x +fi +set -u + +# Remove temporary files and unwanted packaging output. +cleanup() { + log_cmd echo "Cleaning..." + rm -rf "${TMPFILEDIR}" +} + +SCRIPTDIR=$(readlink -f "$(dirname "$0")") +OUTPUTDIR="${PWD}" +SNAPNAME="$1" +CHANNEL="$2" +VERSION="$3" +SNAP_ARCH="$4" +TARGET_OS="$5" + +# call cleanup() on exit +trap cleanup 0 + +LOCKFILE="${OUTPUTDIR}/snap-lock" +TMPFILEDIR="${OUTPUTDIR}/snap-${CHANNEL}" +STAGEDIR="${TMPFILEDIR}/chrome" +mkdir -p "${STAGEDIR}" + +cp "${OUTPUTDIR}/installer/version.txt" "${TMPFILEDIR}/" + +source ${OUTPUTDIR}/installer/common/installer.include + +if [ "$SNAPNAME" = "google-chrome" ]; then + source "${OUTPUTDIR}/installer/common/google-chrome.info" +else + source "${OUTPUTDIR}/installer/common/chromium-browser.info" +fi + +prep_staging_common +PACKAGE_ORIG= # unused, but needs to be set +USR_BIN_SYMLINK_NAME= # unused, but needs to be set +SHLIB_PERMS=644 +BRANDING="$(echo ${SNAPNAME} | tr '-' '_')" +stage_install_common +LAUNCHER_SCRIPT="${TMPFILEDIR}/chrome.launcher" +process_template "${SCRIPTDIR}/chrome.launcher.in" "${LAUNCHER_SCRIPT}" +chmod +x "${LAUNCHER_SCRIPT}" +process_template "${SCRIPTDIR}/snapcraft.yaml.in" "${TMPFILEDIR}/snapcraft.yaml" + +cd "${TMPFILEDIR}" + +# Use flock to serialize all executions of snapcraft, as it currently +# doesn't handle well concurrent builds for the same snap name +# (https://bugs.launchpad.net/snapcraft/+bug/1869030). +flock "${LOCKFILE}" snapcraft + +mv "${SNAPNAME}_${VERSION}_${SNAP_ARCH}.snap" \ + "${OUTPUTDIR}/${SNAPNAME}-${CHANNEL}_${VERSION}_${SNAP_ARCH}.snap"
diff --git a/chrome/installer/linux/snap/chrome.launcher.in b/chrome/installer/linux/snap/chrome.launcher.in new file mode 100755 index 0000000..081ae39 --- /dev/null +++ b/chrome/installer/linux/snap/chrome.launcher.in
@@ -0,0 +1,105 @@ +#!/bin/sh + +# Initially copied from +# https://git.launchpad.net/~chromium-team/chromium-browser/+git/snap-from-source/tree/launcher/chromium.launcher?h=stable + +REALHOME=$(getent passwd $(id -u) | cut -d ':' -f 6) + +# When running the snap for the first time, try and locate an existing +# @@SNAPNAME@@ config in $HOME/.config/@@SNAPNAME@@, and import it if it was +# created by an older version of @@SNAPNAME@@ (the profile data format is not +# guaranteed to be forward-compatible). This requires the personal-files plug +# to be connected. +if [ ! -d "$HOME/.config/@@SNAPNAME@@" ]; then + CHROME_CONFIG="$REALHOME/.config/@@SNAPNAME@@" + if [ -d "$CHROME_CONFIG" ]; then + PREF_FILE="$CHROME_CONFIG/Default/Preferences" + if [ -r "$PREF_FILE" ]; then + VERSION=$(sed -e 's/.*"last_chrome_version":"\([0-9\.]\+\)".*/\1/' \ + "$PREF_FILE") + if [ ! -z "$VERSION" ]; then + OLD=$(printf "$VERSION\n$SNAP_VERSION" | sort -V | head -1) + if [ "$OLD" = "$VERSION" ]; then + SIZE=$(du -sb $CHROME_CONFIG | cut -f 1) + AVAILABLE_BLOCKS=$(stat -f -c %a $HOME) + BLOCK_SIZE=$(stat -f -c %s $HOME) + AVAILABLE_SIZE=$(($AVAILABLE_BLOCKS*$BLOCK_SIZE)) + if [ $AVAILABLE_SIZE -gt $SIZE ]; then + printf "Importing existing @@SNAPNAME@@ profile from " + printf "$CHROME_CONFIG (version $VERSION)\n" + TS1=$(date +%s.%3N) + cp -R "$CHROME_CONFIG" "$HOME/.config/" + TS2=$(date +%s.%3N) + T=$(printf "$TS1 $TS2" | awk '{printf "%.3f",$2-$1}') + printf "Import done in $T s\n" + else + printf "Not importing existing @@SNAPNAME@@ profile from " + printf "$CHROME_CONFIG (version $VERSION) because there is not " + printf "enough available space in $HOME (required: $SIZE bytes / " + printf "available: $AVAILABLE_SIZE bytes)\n" + fi + fi + fi + fi + fi +fi + +# Specify that no encrypted password store (keyring) should be used when the +# password-manager-service interface is not plugged, because @@SNAPNAME@@ +# won't fall back to the basic store (no encryption) if it fails to talk to +# the default password store for the current desktop environment. +# Ref: https://launchpad.net/bugs/1763829 +PASSWORD_STORE=basic +dbus-send --session --dest=org.freedesktop.secrets /org/freedesktop/secrets \ + --print-reply org.freedesktop.DBus.Properties.GetAll \ + string:'org.freedesktop.Secret.Service' >/dev/null 2>&1 +if [ "$?" -eq "0" ]; then + # An empty string means detect the store based on the current DE + # (os_crypt::SelectBackend()) + PASSWORD_STORE= +else + dbus-send --session --dest=org.kde.kwalletd5 /modules/kwalletd5 \ + --print-reply org.freedesktop.DBus.Properties.GetAll \ + string:'org.kde.KWallet' >/dev/null 2>&1 + if [ "$?" -eq "0" ]; then + # An empty string means detect the store based on the current DE + # (os_crypt::SelectBackend()) + PASSWORD_STORE= + fi +fi + +# Allow @@SNAPNAME@@ to look for the flash player plugin inside the snap's +# confinement. That .so file has to be extracted from the upstream flash +# distribution (https://get.adobe.com/flashplayer/) and copied there. +# Ref: https://launchpad.net/bugs/1771162 +FLASHSO=$SNAP_USER_DATA/.local/lib/libpepflashplayer.so +if [ -e $FLASHSO ]; then + FLASHVERSION=$(grep -a -z LNX $FLASHSO | cut -d ' ' -f 2 | sed -e "s/,/./g") + FLASH_OPTS="--ppapi-flash-path=$FLASHSO --ppapi-flash-version=$FLASHVERSION" +fi + +WANT_TEMP_PROFILE=0 +for arg in "$@"; do + shift + if [ "$arg" = "--temp-profile" ]; then + WANT_TEMP_PROFILE=1 + continue + fi + set -- "$@" "$arg" +done + +if [ $WANT_TEMP_PROFILE -eq 0 ] ; then + exec "$SNAP/@@INSTALLDIR@@/@@PACKAGE@@" \ + --password-store=$PASSWORD_STORE \ + $FLASH_OPTS \ + "$@" +else + TEMP_PROFILE=$(mktemp -d) + trap "rm -rf $TEMP_PROFILE" EXIT + # we can't exec here as we need to clean-up the temporary profile + "$SNAP/@@INSTALLDIR@@/@@PACKAGE@@" \ + --user-data-dir=$TEMP_PROFILE \ + --password-store=$PASSWORD_STORE \ + $FLASH_OPTS \ + "$@" +fi
diff --git a/chrome/installer/linux/snap/snapcraft.yaml.in b/chrome/installer/linux/snap/snapcraft.yaml.in new file mode 100644 index 0000000..f62329b --- /dev/null +++ b/chrome/installer/linux/snap/snapcraft.yaml.in
@@ -0,0 +1,203 @@ +# Initially copied from +# https://git.launchpad.net/~chromium-team/chromium-browser/+git/snap-from-source/tree/snapcraft.yaml?h=stable + +name: @@SNAPNAME@@ +adopt-info: chromium +summary: @@SHORTDESC@@ +description: @@FULLDESC@@ +confinement: strict +base: core18 + +apps: + @@SNAPNAME@@: + command: bin/desktop-launch "$SNAP/bin/chrome.launcher" + desktop: bin/@@SNAPNAME@@.desktop + environment: + DISABLE_WAYLAND: 1 + CHROME_DESKTOP: @@SNAPNAME@@.desktop + plugs: + - audio-playback + - audio-record + - camera + - cups-control + - desktop + - gsettings + - home + - joystick + - mount-observe + - network + - network-manager + - opengl + - password-manager-service + - pulseaudio # remove once snapd 2.41 is available everywhere + - raw-usb # for WebUSB (https://launchpad.net/bugs/1780678) + - removable-media + - screen-inhibit-control + - u2f-devices + - unity7 # required for xdg-open to work + - upower-observe + - x11 + slots: + - mpris + +plugs: + browser-sandbox: + interface: browser-support + allow-sandbox: true + gtk-3-themes: + interface: content + target: $SNAP/data-dir/themes + default-provider: gtk-common-themes + icon-themes: + interface: content + target: $SNAP/data-dir/icons + default-provider: gtk-common-themes + sound-themes: + interface: content + target: $SNAP/data-dir/sounds + default-provider: gtk-common-themes + @@SNAPNAME@@-config: + interface: personal-files + read: [$HOME/.config/@@SNAPNAME@@] + +parts: + chromium: + plugin: nil + source: . + after: [desktop-gtk3, gtk-key-themes] + stage-packages: + - libgbm1 + - libgl1-mesa-glx + - libgtk-3-0 + - libnss3 + - libsecret-1-0 + - libxss1 + - pulseaudio + - shared-mime-info + - ubuntu-settings + override-pull: | + set -eux + snapcraftctl pull + . $SNAPCRAFT_PART_SRC/version.txt + snapcraftctl set-version "$MAJOR.$MINOR.$BUILD.$PATCH" + override-build: | + set -eux + snapcraftctl build + + # Launcher script + mkdir -p $SNAPCRAFT_PART_INSTALL/bin + cp $SNAPCRAFT_PART_SRC/chrome.launcher $SNAPCRAFT_PART_INSTALL/bin/ + + # @@SNAPNAME@@ build artifacts (installed by stage_install_common) + cp -R $SNAPCRAFT_PART_SRC/chrome/* $SNAPCRAFT_PART_INSTALL/ + + # Custom desktop file + mkdir -p $SNAPCRAFT_PART_INSTALL/bin + sed \ + -e "s:Exec=/usr/bin/:Exec=@@SNAPNAME@@:g" \ + -e "s:Icon=@@PACKAGE@@:Icon=@@INSTALLDIR@@/product_logo_256.png:" \ + $SNAPCRAFT_PART_SRC/chrome/usr/share/applications/@@PACKAGE@@.desktop \ + > $SNAPCRAFT_PART_INSTALL/bin/@@SNAPNAME@@.desktop + prime: + - -etc/gss + - -etc/init.d + - -etc/sensors.d + - -etc/ucf.conf + - -etc/xdg + - -usr/include + - -usr/lib/tmpfiles.d + - -usr/share/apport + - -usr/share/bash-completion + - -usr/share/bug + - -usr/share/doc + - -usr/share/doc-base + - -usr/share/gettext + - -usr/share/gnome-control-center + - -usr/share/GConf + - -usr/share/icons + - -usr/share/lintian + - -usr/share/man + - -usr/share/pam-configs + - -usr/share/pkgconfig + - -usr/share/polkit-1 + - -usr/share/session-migration + - -usr/share/sounds + - -usr/share/ubuntu + - -usr/share/ubuntu-wayland + - -usr/share/upstart + - -usr/share/zsh + - -var + + desktop-gtk3: + source: https://github.com/ubuntu/snapcraft-desktop-helpers.git + source-subdir: gtk + plugin: make + make-parameters: ["FLAVOR=gtk3"] + build-packages: + - build-essential + - libgtk-3-dev + stage-packages: + - libxkbcommon0 + - ttf-ubuntu-font-family + - shared-mime-info + - libgtk-3-0 + - libgdk-pixbuf2.0-0 + - libglib2.0-bin + - libgtk-3-bin + - unity-gtk3-module + - locales-all + - xdg-user-dirs + - ibus-gtk3 + - libibus-1.0-5 + - fcitx-frontend-gtk3 + prime: + - -etc/gss + - -etc/presage.xml + - -etc/ucf.conf + - -etc/X11 + - -usr/lib/glib-networking + - -usr/lib/systemd + - -usr/share/apport + - -usr/share/bash-completion + - -usr/share/doc + - -usr/share/doc-base + - -usr/share/gettext + - -usr/share/GConf + - -usr/share/icons + - -usr/share/lintian + - -usr/share/man + - -usr/share/pkgconfig + - -usr/share/presage + - -usr/share/upstart + - -var + + shared-mime-info: + after: [chromium] + plugin: nil + override-pull: "" + override-prime: | + set -eux + glib-compile-schemas usr/share/glib-2.0/schemas + update-mime-database usr/share/mime + + # Install the keybindings themes (see https://launchpad.net/bugs/1849163) + gtk-key-themes: + plugin: nil + stage-packages: + - libgtk-3-common + prime: + - usr/share/themes/Default/ + - usr/share/themes/Emacs/ + + # Create a symlink xdg-email -> xdg-open, as the latter is perfectly able to + # handle mailto: URLs (see https://launchpad.net/bugs/1849774). + # xdg-open is a wrapper provided by the core snap. + # TODO: remove once https://launchpad.net/bugs/1863625 is fixed. + xdg-email: + plugin: nil + override-pull: "" + override-prime: | + set -eux + mkdir -p usr/bin + cd usr/bin + ln -s /usr/bin/xdg-open xdg-email
diff --git a/chrome/renderer/chrome_render_frame_observer.cc b/chrome/renderer/chrome_render_frame_observer.cc index 025a1a8d..fc5ba67 100644 --- a/chrome/renderer/chrome_render_frame_observer.cc +++ b/chrome/renderer/chrome_render_frame_observer.cc
@@ -95,41 +95,9 @@ namespace { -// If the source image is null or occupies less area than -// |thumbnail_min_area_pixels|, we return the image unmodified. Otherwise, we -// scale down the image so that the width and height do not exceed -// |thumbnail_max_size_pixels|, preserving the original aspect ratio. -SkBitmap Downscale(const SkBitmap& image, - int thumbnail_min_area_pixels, - const gfx::Size& thumbnail_max_size_pixels) { - if (image.isNull()) - return SkBitmap(); - - gfx::Size image_size(image.width(), image.height()); - - if (image_size.GetArea() < thumbnail_min_area_pixels) - return image; - - if (image_size.width() <= thumbnail_max_size_pixels.width() && - image_size.height() <= thumbnail_max_size_pixels.height()) - return image; - - gfx::SizeF scaled_size = gfx::SizeF(image_size); - - if (scaled_size.width() > thumbnail_max_size_pixels.width()) { - scaled_size.Scale(thumbnail_max_size_pixels.width() / scaled_size.width()); - } - - if (scaled_size.height() > thumbnail_max_size_pixels.height()) { - scaled_size.Scale( - thumbnail_max_size_pixels.height() / scaled_size.height()); - } - - return skia::ImageOperations::Resize(image, - skia::ImageOperations::RESIZE_GOOD, - static_cast<int>(scaled_size.width()), - static_cast<int>(scaled_size.height())); -} +const char kGifExtension[] = ".gif"; +const char kPngExtension[] = ".png"; +const char kJpgExtension[] = ".jpg"; #if defined(OS_ANDROID) base::Lock& GetFrameHeaderMapLock() { @@ -248,22 +216,37 @@ } } -void ChromeRenderFrameObserver::RequestThumbnailForContextNode( +void ChromeRenderFrameObserver::RequestImageForContextNode( int32_t thumbnail_min_area_pixels, const gfx::Size& thumbnail_max_size_pixels, chrome::mojom::ImageFormat image_format, - RequestThumbnailForContextNodeCallback callback) { + RequestImageForContextNodeCallback callback) { WebNode context_node = render_frame()->GetWebFrame()->ContextMenuNode(); - SkBitmap thumbnail; + std::vector<uint8_t> image_data; gfx::Size original_size; - if (!context_node.IsNull() && context_node.IsElementNode()) { - SkBitmap image = context_node.To<WebElement>().ImageContents(); - original_size = gfx::Size(image.width(), image.height()); - thumbnail = Downscale(image, - thumbnail_min_area_pixels, - thumbnail_max_size_pixels); + std::string image_extension; + + if (context_node.IsNull() || !context_node.IsElementNode()) { + std::move(callback).Run(image_data, original_size, image_extension); + return; } + WebElement web_element = context_node.To<WebElement>(); + original_size = web_element.GetImageSize(); + image_extension = "." + web_element.ImageExtension(); + if (!NeedsEncodeImage(image_extension, image_format) && + !NeedsDownscale(original_size, thumbnail_min_area_pixels, + thumbnail_max_size_pixels)) { + image_data = web_element.CopyOfImageData(); + std::move(callback).Run(std::move(image_data), original_size, + image_extension); + return; + } + + SkBitmap image = web_element.ImageContents(); + SkBitmap thumbnail = + Downscale(image, thumbnail_min_area_pixels, thumbnail_max_size_pixels); + SkBitmap bitmap; if (thumbnail.colorType() == kN32_SkColorType) { bitmap = thumbnail; @@ -274,23 +257,37 @@ } } - std::vector<uint8_t> thumbnail_data; constexpr int kDefaultQuality = 90; std::vector<unsigned char> data; + if (image_format == chrome::mojom::ImageFormat::ORIGINAL) { + // ORIGINAL will only fall back to here if the image needs to downscale. + // Let's PNG downscale to PNG and JEPG downscale to JPEG. + if (image_extension == kPngExtension) { + image_format = chrome::mojom::ImageFormat::PNG; + } else if (image_extension == kJpgExtension) { + image_format = chrome::mojom::ImageFormat::JPEG; + } + } + switch (image_format) { case chrome::mojom::ImageFormat::PNG: if (gfx::PNGCodec::EncodeBGRASkBitmap( bitmap, kDiscardTransparencyForContextMenu, &data)) { - thumbnail_data.swap(data); + image_data.swap(data); + image_extension = kPngExtension; } break; + case chrome::mojom::ImageFormat::ORIGINAL: + // Any format other than PNG and JPEG fall back to here. case chrome::mojom::ImageFormat::JPEG: - if (gfx::JPEGCodec::Encode(bitmap, kDefaultQuality, &data)) - thumbnail_data.swap(data); + if (gfx::JPEGCodec::Encode(bitmap, kDefaultQuality, &data)) { + image_data.swap(data); + image_extension = kJpgExtension; + } break; } - std::move(callback).Run(thumbnail_data, original_size); + std::move(callback).Run(image_data, original_size, image_extension); } void ChromeRenderFrameObserver::GetWebApplicationInfo( @@ -539,3 +536,71 @@ render_frame()->GetRenderView()->GetWebView()->SetWindowFeatures( content::ConvertMojoWindowFeaturesToWebWindowFeatures(*window_features)); } + +// static +bool ChromeRenderFrameObserver::NeedsDownscale( + const gfx::Size& original_image_size, + int32_t requested_image_min_area_pixels, + const gfx::Size& requested_image_max_size) { + if (original_image_size.GetArea() < requested_image_min_area_pixels) + return false; + if (original_image_size.width() <= requested_image_max_size.width() && + original_image_size.height() <= requested_image_max_size.height()) + return false; + return true; +} + +// static +SkBitmap ChromeRenderFrameObserver::Downscale( + const SkBitmap& image, + int requested_image_min_area_pixels, + const gfx::Size& requested_image_max_size) { + if (image.isNull()) + return SkBitmap(); + + gfx::Size image_size(image.width(), image.height()); + + if (!NeedsDownscale(image_size, requested_image_min_area_pixels, + requested_image_max_size)) + return image; + + gfx::SizeF scaled_size = gfx::SizeF(image_size); + + if (scaled_size.width() > requested_image_max_size.width()) { + scaled_size.Scale(requested_image_max_size.width() / scaled_size.width()); + } + + if (scaled_size.height() > requested_image_max_size.height()) { + scaled_size.Scale(requested_image_max_size.height() / scaled_size.height()); + } + + return skia::ImageOperations::Resize(image, + skia::ImageOperations::RESIZE_GOOD, + static_cast<int>(scaled_size.width()), + static_cast<int>(scaled_size.height())); +} + +// static +bool ChromeRenderFrameObserver::NeedsEncodeImage( + const std::string& image_extension, + chrome::mojom::ImageFormat image_format) { + switch (image_format) { + case chrome::mojom::ImageFormat::PNG: + return !base::EqualsCaseInsensitiveASCII(image_extension, kPngExtension); + break; + case chrome::mojom::ImageFormat::JPEG: + return !base::EqualsCaseInsensitiveASCII(image_extension, kJpgExtension); + break; + case chrome::mojom::ImageFormat::ORIGINAL: + return !base::EqualsCaseInsensitiveASCII(image_extension, + kGifExtension) && + !base::EqualsCaseInsensitiveASCII(image_extension, + kJpgExtension) && + !base::EqualsCaseInsensitiveASCII(image_extension, kPngExtension); + break; + } + + // Should never hit this code since all cases were handled above. + NOTREACHED(); + return true; +}
diff --git a/chrome/renderer/chrome_render_frame_observer.h b/chrome/renderer/chrome_render_frame_observer.h index fc2ecc2..a7257c75 100644 --- a/chrome/renderer/chrome_render_frame_observer.h +++ b/chrome/renderer/chrome_render_frame_observer.h
@@ -57,6 +57,8 @@ #endif private: + friend class ChromeRenderFrameObserverTest; + enum TextCaptureType { PRELIMINARY_CAPTURE, FINAL_CAPTURE }; // RenderFrameObserver implementation. @@ -85,11 +87,11 @@ void SetWindowFeatures( blink::mojom::WindowFeaturesPtr window_features) override; void ExecuteWebUIJavaScript(const base::string16& javascript) override; - void RequestThumbnailForContextNode( + void RequestImageForContextNode( int32_t thumbnail_min_area_pixels, const gfx::Size& thumbnail_max_size_pixels, chrome::mojom::ImageFormat image_format, - RequestThumbnailForContextNodeCallback callback) override; + RequestImageForContextNodeCallback callback) override; void RequestReloadImageForContextNode() override; void SetClientSidePhishingDetection(bool enable_phishing_detection) override; void GetWebApplicationInfo(GetWebApplicationInfoCallback callback) override; @@ -109,6 +111,23 @@ // TODO(dglazkov): This is incompatible with OOPIF and needs to be updated. void CapturePageText(TextCaptureType capture_type); + // Check if the image need to downscale. + static bool NeedsDownscale(const gfx::Size& original_image_size, + int32_t requested_image_min_area_pixels, + const gfx::Size& requested_image_max_size); + + // If the source image is null or occupies less area than + // |requested_image_min_area_pixels|, we return the image unmodified. + // Otherwise, we scale down the image so that the width and height do not + // exceed |requested_image_max_size|, preserving the original aspect ratio. + static SkBitmap Downscale(const SkBitmap& image, + int requested_image_min_area_pixels, + const gfx::Size& requested_image_max_size); + + // Check if the image need to encode to fit requested image format. + static bool NeedsEncodeImage(const std::string& image_extension, + chrome::mojom::ImageFormat image_format); + // Have the same lifetime as us. translate::TranslateAgent* translate_agent_; #if BUILDFLAG(SAFE_BROWSING_CSD) @@ -131,4 +150,4 @@ DISALLOW_COPY_AND_ASSIGN(ChromeRenderFrameObserver); }; -#endif // CHROME_RENDERER_CHROME_RENDER_FRAME_OBSERVER_H_ +#endif // CHROME_RENDERER_CHROME_RENDER_FRAME_OBSERVER_H_ \ No newline at end of file
diff --git a/chrome/renderer/chrome_render_frame_observer_unittest.cc b/chrome/renderer/chrome_render_frame_observer_unittest.cc new file mode 100644 index 0000000..13790a9 --- /dev/null +++ b/chrome/renderer/chrome_render_frame_observer_unittest.cc
@@ -0,0 +1,98 @@ +// Copyright 2020 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "chrome/renderer/chrome_render_frame_observer.h" + +#include "chrome/common/chrome_render_frame.mojom.h" +#include "testing/gtest/include/gtest/gtest.h" + +class ChromeRenderFrameObserverTest : public testing::Test { + public: + bool NeedsDownscale(const gfx::Size& original_image_size, + int32_t requested_image_min_area_pixels, + const gfx::Size& requested_image_max_size) { + return ChromeRenderFrameObserver::NeedsDownscale( + original_image_size, requested_image_min_area_pixels, + requested_image_max_size); + } + + bool NeedsEncodeImage(const std::string& image_extension, + chrome::mojom::ImageFormat image_format) { + return ChromeRenderFrameObserver::NeedsEncodeImage(image_extension, + image_format); + } +}; + +TEST_F(ChromeRenderFrameObserverTest, + NeedsDownscale_RequestLargeThanOriginalReturnFalse) { + EXPECT_FALSE( + NeedsDownscale(/* original_image_size */ gfx::Size(10, 10), + /* requested_image_min_area_pixels */ 200, + /* requested_image_max_size */ gfx::Size(20, 20))); +} + +TEST_F(ChromeRenderFrameObserverTest, NeedsDownscale_SameSizeReturnFalse) { + EXPECT_FALSE( + NeedsDownscale(/* original_image_size */ gfx::Size(10, 10), + /* requested_image_min_area_pixels */ 100, + /* requested_image_max_size */ gfx::Size(10, 10))); +} + +TEST_F(ChromeRenderFrameObserverTest, NeedsDownscale_OnlyWidthShortReturnTrue) { + EXPECT_TRUE(NeedsDownscale(/* original_image_size */ gfx::Size(10, 10), + /* requested_image_min_area_pixels */ 100, + /* requested_image_max_size */ gfx::Size(9, 10))); +} + +TEST_F(ChromeRenderFrameObserverTest, NeedsDownscale_OnlyAreaSmallReturnFalse) { + EXPECT_FALSE( + NeedsDownscale(/* original_image_size */ gfx::Size(10, 10), + /* requested_image_min_area_pixels */ 20, + /* requested_image_max_size */ gfx::Size(20, 20))); +} + +TEST_F(ChromeRenderFrameObserverTest, NeedsEncodeImage_JpegFormat) { + EXPECT_TRUE( + NeedsEncodeImage(/* image_extension */ ".png", + /* image_format */ chrome::mojom::ImageFormat::JPEG)); + EXPECT_FALSE( + NeedsEncodeImage(/* image_extension */ ".jpg", + /* image_format */ chrome::mojom::ImageFormat::JPEG)); + EXPECT_TRUE( + NeedsEncodeImage(/* image_extension */ ".gif", + /* image_format */ chrome::mojom::ImageFormat::JPEG)); + EXPECT_TRUE( + NeedsEncodeImage(/* image_extension */ ".bmp", + /* image_format */ chrome::mojom::ImageFormat::JPEG)); +} + +TEST_F(ChromeRenderFrameObserverTest, NeedsEncodeImage_PngFormat) { + EXPECT_FALSE( + NeedsEncodeImage(/* image_extension */ ".png", + /* image_format */ chrome::mojom::ImageFormat::PNG)); + EXPECT_TRUE( + NeedsEncodeImage(/* image_extension */ ".jpg", + /* image_format */ chrome::mojom::ImageFormat::PNG)); + EXPECT_TRUE( + NeedsEncodeImage(/* image_extension */ ".gif", + /* image_format */ chrome::mojom::ImageFormat::PNG)); + EXPECT_TRUE( + NeedsEncodeImage(/* image_extension */ ".bmp", + /* image_format */ chrome::mojom::ImageFormat::PNG)); +} + +TEST_F(ChromeRenderFrameObserverTest, NeedsEncodeImage_OriginalFormat) { + EXPECT_FALSE(NeedsEncodeImage( + /* image_extension */ ".png", + /* image_format */ chrome::mojom::ImageFormat::ORIGINAL)); + EXPECT_FALSE(NeedsEncodeImage( + /* image_extension */ ".jpg", + /* image_format */ chrome::mojom::ImageFormat::ORIGINAL)); + EXPECT_FALSE(NeedsEncodeImage( + /* image_extension */ ".gif", + /* image_format */ chrome::mojom::ImageFormat::ORIGINAL)); + EXPECT_TRUE(NeedsEncodeImage( + /* image_extension */ ".bmp", + /* image_format */ chrome::mojom::ImageFormat::ORIGINAL)); +}
diff --git a/chrome/services/app_service/public/mojom/types.mojom b/chrome/services/app_service/public/mojom/types.mojom index b42d270..dc39c281 100644 --- a/chrome/services/app_service/public/mojom/types.mojom +++ b/chrome/services/app_service/public/mojom/types.mojom
@@ -186,6 +186,8 @@ kFromKeyboard = 12, // Keyboard shortcut for opening app. kFromOtherApp = 13, // Clicking link in another app or webui. kFromMenu = 14, // Menu. + kFromInstalledNotification = 15, // Installed notification + kFromTest = 16, // Test }; enum TriState {
diff --git a/chrome/test/BUILD.gn b/chrome/test/BUILD.gn index 0c687ac..0c5fff6 100644 --- a/chrome/test/BUILD.gn +++ b/chrome/test/BUILD.gn
@@ -1921,7 +1921,6 @@ "../browser/ui/views/certificate_selector_dialog_browsertest.cc", "../browser/ui/views/collected_cookies_views_browsertest.cc", "../browser/ui/views/desktop_capture/desktop_media_picker_views_browsertest.cc", - "../browser/ui/views/extensions/bookmark_override_browsertest.cc", "../browser/ui/views/extensions/extension_install_blocked_dialog_view_browsertest.cc", "../browser/ui/views/extensions/extension_install_dialog_view_browsertest.cc", "../browser/ui/views/extensions/extension_installed_bubble_view_browsertest.cc", @@ -3490,6 +3489,7 @@ "../common/string_matching/tokenized_string_match_unittest.cc", "../common/string_matching/tokenized_string_unittest.cc", "../renderer/chrome_content_renderer_client_unittest.cc", + "../renderer/chrome_render_frame_observer_unittest.cc", "../renderer/content_settings_agent_impl_unittest.cc", "../renderer/instant_restricted_id_cache_unittest.cc", "../renderer/media/chrome_key_systems_provider_unittest.cc", @@ -3887,6 +3887,7 @@ "../browser/diagnostics/diagnostics_model_unittest.cc", "../browser/download/download_commands_unittest.cc", "../browser/download/download_shelf_unittest.cc", + "../browser/enterprise/connectors/connectors_manager_unittest.cc", "../browser/enterprise/connectors/enterprise_connectors_policy_handler_unittest.cc", "../browser/enterprise/reporting/browser_report_generator_unittest.cc", "../browser/enterprise/reporting/extension_info_unittest.cc", @@ -4087,6 +4088,7 @@ "../browser/ui/passwords/bubble_controllers/auto_sign_in_bubble_controller_unittest.cc", "../browser/ui/passwords/bubble_controllers/generation_confirmation_bubble_controller_unittest.cc", "../browser/ui/passwords/bubble_controllers/items_bubble_controller_unittest.cc", + "../browser/ui/passwords/bubble_controllers/save_unsynced_credentials_locally_bubble_controller_unittest.cc", "../browser/ui/passwords/bubble_controllers/save_update_bubble_controller_unittest.cc", "../browser/ui/passwords/bubble_controllers/save_update_with_account_store_bubble_controller_unittest.cc", "../browser/ui/passwords/bubble_controllers/sign_in_promo_bubble_controller_unittest.cc", @@ -4280,6 +4282,7 @@ "../browser/ui/toolbar/mock_media_router_action_controller.h", "../browser/ui/views/passwords/password_bubble_view_test_base.cc", "../browser/ui/views/passwords/password_bubble_view_test_base.h", + "../browser/ui/views/passwords/password_save_unsynced_credentials_locally_view_unittest.cc", "../browser/ui/views/passwords/password_save_update_with_account_store_view_unittest.cc", "../common/media_router/discovery/media_sink_internal_unittest.cc", "../common/media_router/discovery/media_sink_service_base_unittest.cc",
diff --git a/chrome/test/data/policy/policy_test_cases.json b/chrome/test/data/policy/policy_test_cases.json index 572f52dd..4de99724 100644 --- a/chrome/test/data/policy/policy_test_cases.json +++ b/chrome/test/data/policy/policy_test_cases.json
@@ -640,13 +640,16 @@ ] }, - "SafeBrowsingEnhancedProtection": { + "SafeBrowsingProtectionLevel": { "os": ["win", "linux", "mac", "chromeos"], "can_be_recommended": true, "policy_pref_mapping_test": [ { - "policies": { "SafeBrowsingEnhancedProtection": false }, - "prefs": { "safebrowsing.enhanced": {} } + "policies": { "SafeBrowsingProtectionLevel": 2 }, + "prefs": { + "safebrowsing.enabled": { "value": true }, + "safebrowsing.enhanced": { "value": true } + } } ] },
diff --git a/chrome/test/data/webui/cr_elements/cr_action_menu_test.js b/chrome/test/data/webui/cr_elements/cr_action_menu_test.js index 257e080..98012487 100644 --- a/chrome/test/data/webui/cr_elements/cr_action_menu_test.js +++ b/chrome/test/data/webui/cr_elements/cr_action_menu_test.js
@@ -247,10 +247,31 @@ menu.showAt(dots); assertTrue(dialog.open); + let anchorHasFocus = false; + let tabkeyCloseEventFired = false; + + const checkTestDone = () => { + assertFalse(dialog.open); + if (key !== 'Tab') { + resolve(); + } else if (anchorHasFocus && tabkeyCloseEventFired) { + resolve(); + } + }; + // Check that focus returns to the anchor element. - dots.addEventListener('focus', resolve); + dots.addEventListener('focus', () => { + anchorHasFocus = true; + checkTestDone(); + }); + + // Check that a Tab key close fires a custom event. + menu.addEventListener('tabkeyclose', () => { + tabkeyCloseEventFired = true; + checkTestDone(); + }); + MockInteractions.keyDownOn(menu, key, [], key); - assertFalse(dialog.open); }); }
diff --git a/chrome/test/data/webui/extensions/a11y/extensions_a11y_test.js b/chrome/test/data/webui/extensions/a11y/extensions_a11y_test.js index 2961274..e4d9dddc 100644 --- a/chrome/test/data/webui/extensions/a11y/extensions_a11y_test.js +++ b/chrome/test/data/webui/extensions/a11y/extensions_a11y_test.js
@@ -220,7 +220,6 @@ /** @override */ testGenPreamble() { GEN(' SetDevModeEnabled(true);'); - GEN(' EnableErrorConsole();'); GEN(' InstallErrorsExtension();'); }
diff --git a/chrome/test/data/webui/extensions/cr_extensions_browsertest.js b/chrome/test/data/webui/extensions/cr_extensions_browsertest.js index d94e868..df8bcbf 100644 --- a/chrome/test/data/webui/extensions/cr_extensions_browsertest.js +++ b/chrome/test/data/webui/extensions/cr_extensions_browsertest.js
@@ -761,7 +761,6 @@ /** @override */ testGenPreamble() { GEN(' SetDevModeEnabled(true);'); - GEN(' EnableErrorConsole();'); GEN(' InstallErrorsExtension();'); }
diff --git a/chrome/test/data/webui/extensions/runtime_hosts_dialog_test.js b/chrome/test/data/webui/extensions/runtime_hosts_dialog_test.js index 0e812040..13c4412 100644 --- a/chrome/test/data/webui/extensions/runtime_hosts_dialog_test.js +++ b/chrome/test/data/webui/extensions/runtime_hosts_dialog_test.js
@@ -121,6 +121,8 @@ expectEquals( 'https://example.com:80/*', getPatternFromSite('https://example.com:80/*')); + expectEquals( + 'http://localhost:3030/*', getPatternFromSite('http://localhost:3030')); }); test('update site access', function() {
diff --git a/chrome/test/data/webui/media/media_feeds_webui_browsertest.js b/chrome/test/data/webui/media/media_feeds_webui_browsertest.js index 4add181e..8148514e 100644 --- a/chrome/test/data/webui/media/media_feeds_webui_browsertest.js +++ b/chrome/test/data/webui/media/media_feeds_webui_browsertest.js
@@ -38,7 +38,8 @@ GEN('item->is_family_friendly = true;'); GEN('item->action_status ='); GEN(' media_feeds::mojom::MediaFeedItemActionStatus::kPotential;'); - GEN('item->genre = base::ASCIIToUTF16("test");'); + GEN('item->genre.push_back("test");'); + GEN('item->genre.push_back("test2");'); GEN('item->duration = base::TimeDelta::FromSeconds(30);'); GEN('item->live = media_feeds::mojom::LiveDetails::New();'); GEN('item->live->start_time = base::Time::FromDeltaSinceWindowsEpoch('); @@ -92,6 +93,8 @@ GEN('item->play_next_candidate->identifiers.push_back('); GEN(' media_feeds::mojom::Identifier::New('); GEN(' media_feeds::mojom::Identifier::Type::kPartnerId, "TEST4"));'); + GEN('item->safe_search_result ='); + GEN(' media_feeds::mojom::SafeSearchResult::kSafe;'); GEN('media_session::MediaImage image1;'); GEN('image1.src = GURL("https://www.example.org/image1.png");'); GEN('item->images.push_back(image1);'); @@ -175,7 +178,7 @@ 'Action Status', 'Action URL', 'Action Start Time (secs)', 'Interaction Counters', 'Content Ratings', 'Genre', 'Live Details', 'TV Episode', 'Play Next Candidate', 'Identifiers', 'Shown Count', - 'Clicked', 'Images' + 'Clicked', 'Images', 'Safe Search Result' ], feedItemsHeaders.map(x => x.textContent.trim())); @@ -201,7 +204,8 @@ assertEquals( 'MPAA PG-13, agency TEST2', feedItemsContents.childNodes[9].textContent.trim()); - assertEquals('test', feedItemsContents.childNodes[10].textContent.trim()); + assertEquals( + 'test, test2', feedItemsContents.childNodes[10].textContent.trim()); assertTrue( feedItemsContents.childNodes[11].textContent.trim().includes('Live')); assertEquals( @@ -218,6 +222,7 @@ assertEquals( 'https://www.example.org/image1.pnghttps://www.example.org/image2.png', feedItemsContents.childNodes[17].textContent.trim()); + assertEquals('Safe', feedItemsContents.childNodes[18].textContent.trim()); }); });
diff --git a/chrome/test/data/webui/print_preview/header_test.js b/chrome/test/data/webui/print_preview/header_test.js index 31b67baf..ed7d86d 100644 --- a/chrome/test/data/webui/print_preview/header_test.js +++ b/chrome/test/data/webui/print_preview/header_test.js
@@ -11,9 +11,6 @@ /** @enum {string} */ header_test.TestNames = { HeaderPrinterTypes: 'header printer types', - HeaderWithDuplex: 'header with duplex', - HeaderWithCopies: 'header with copies', - HeaderWithNup: 'header with nup', HeaderChangesForState: 'header changes for state', EnterprisePolicy: 'enterprise policy', }; @@ -38,6 +35,7 @@ 'FooName', DestinationConnectionStatus.ONLINE); header.state = State.READY; header.managed = false; + header.sheetCount = 1; fakeDataBind(model, header, 'settings'); document.body.appendChild(header); }); @@ -56,44 +54,18 @@ test(assert(header_test.TestNames.HeaderPrinterTypes), function() { const summary = header.$$('.summary'); assertEquals('1 sheet of paper', summary.textContent.trim()); - header.setSetting('pages', [1, 2, 3]); + header.sheetCount = 3; assertEquals('3 sheets of paper', summary.textContent.trim()); setPdfDestination(); assertEquals('3 pages', summary.textContent.trim()); - header.setSetting('pages', [1]); + header.sheetCount = 1; assertEquals('1 page', summary.textContent.trim()); // Verify the chrome://print case of a zero length document does not show // the summary. - header.setSetting('pages', []); + header.sheetCount = 0; assertEquals('', summary.textContent); }); - // Tests that the message is correctly adjusted with a duplex printer. - test(assert(header_test.TestNames.HeaderWithDuplex), function() { - const summary = header.$$('.summary'); - assertEquals('1 sheet of paper', summary.textContent.trim()); - header.setSetting('pages', [1, 2, 3]); - assertEquals('3 sheets of paper', summary.textContent.trim()); - header.setSetting('duplex', true); - assertEquals('2 sheets of paper', summary.textContent.trim()); - header.setSetting('pages', [1, 2]); - assertEquals('1 sheet of paper', summary.textContent.trim()); - }); - - // Tests that the message is correctly adjusted with multiple copies. - test(assert(header_test.TestNames.HeaderWithCopies), function() { - const summary = header.$$('.summary'); - assertEquals('1 sheet of paper', summary.textContent.trim()); - header.setSetting('copies', 4); - assertEquals('4 sheets of paper', summary.textContent.trim()); - header.setSetting('duplex', true); - assertEquals('4 sheets of paper', summary.textContent.trim()); - header.setSetting('pages', [1, 2]); - assertEquals('4 sheets of paper', summary.textContent.trim()); - header.setSetting('duplex', false); - assertEquals('8 sheets of paper', summary.textContent.trim()); - }); - // 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), function() {
diff --git a/chrome/test/data/webui/print_preview/policy_test.js b/chrome/test/data/webui/print_preview/policy_test.js index ae04f721..e4d27eb 100644 --- a/chrome/test/data/webui/print_preview/policy_test.js +++ b/chrome/test/data/webui/print_preview/policy_test.js
@@ -75,11 +75,13 @@ } initialSettings.policies = {[settingName]: policy}; } - // We want to make sure sticky settings get overridden. - initialSettings.serializedAppStateStr = JSON.stringify({ - version: 2, - [serializedSettingName]: !defaultMode, - }); + if (defaultMode !== undefined) { + // We want to make sure sticky settings get overridden. + initialSettings.serializedAppStateStr = JSON.stringify({ + version: 2, + [serializedSettingName]: !defaultMode, + }); + } return loadInitialSettings(initialSettings); } @@ -96,102 +98,104 @@ } /** Tests different scenarios of applying header/footer policy. */ - test(assert(policy_tests.TestNames.HeaderFooterPolicy), function() { - [{ - // No policies. - allowedMode: undefined, - defaultMode: undefined, - expectedDisabled: false, - expectedChecked: false, - }, - { - // Restrict header/footer to be enabled. - allowedMode: true, - defaultMode: undefined, - expectedDisabled: true, - expectedChecked: true, - }, - { - // Restrict header/footer to be disabled. - allowedMode: false, - defaultMode: undefined, - expectedDisabled: true, - expectedChecked: false, - }, - { - // Check header/footer checkbox. - allowedMode: undefined, - defaultMode: true, - expectedDisabled: false, - expectedChecked: true, - }, - { - // Uncheck header/footer checkbox. - allowedMode: undefined, - defaultMode: false, - expectedDisabled: false, - expectedChecked: false, - }].forEach(subtestParams => { - doPolicySetup( + test(assert(policy_tests.TestNames.HeaderFooterPolicy), async () => { + const tests = [ + { + // No policies. + allowedMode: undefined, + defaultMode: undefined, + expectedDisabled: false, + expectedChecked: true, + }, + { + // Restrict header/footer to be enabled. + allowedMode: true, + defaultMode: undefined, + expectedDisabled: true, + expectedChecked: true, + }, + { + // Restrict header/footer to be disabled. + allowedMode: false, + defaultMode: undefined, + expectedDisabled: true, + expectedChecked: false, + }, + { + // Check header/footer checkbox. + allowedMode: undefined, + defaultMode: true, + expectedDisabled: false, + expectedChecked: true, + }, + { + // Uncheck header/footer checkbox. + allowedMode: undefined, + defaultMode: false, + expectedDisabled: false, + expectedChecked: false, + } + ]; + for (const subtestParams of tests) { + await doPolicySetup( 'headerFooter', 'isHeaderFooterEnabled', subtestParams.allowedMode, - subtestParams.defaultMode) - .then(function() { - toggleMoreSettings(); - const checkbox = getCheckbox('headerFooter'); - assertEquals(subtestParams.expectedDisabled, checkbox.disabled); - assertEquals(subtestParams.expectedChecked, checkbox.checked); - }); - }); + subtestParams.defaultMode); + toggleMoreSettings(); + const checkbox = getCheckbox('headerFooter'); + assertEquals(subtestParams.expectedDisabled, checkbox.disabled); + assertEquals(subtestParams.expectedChecked, checkbox.checked); + } }); /** Tests different scenarios of applying background graphics policy. */ - test(assert(policy_tests.TestNames.CssBackgroundPolicy), function() { - [{ - // No policies. - allowedMode: undefined, - defaultMode: undefined, - expectedDisabled: false, - expectedChecked: true, - }, - { - // Restrict background graphics to be enabled. - // Check that checkbox value default mode is not applied if it - // contradicts allowed mode. - allowedMode: BackgroundGraphicsModeRestriction.ENABLED, - defaultMode: BackgroundGraphicsModeRestriction.DISABLED, - expectedDisabled: true, - expectedChecked: true, - }, - { - // Restrict background graphics to be disabled. - allowedMode: BackgroundGraphicsModeRestriction.DISABLED, - defaultMode: undefined, - expectedDisabled: true, - expectedChecked: false, - }, - { - // Check background graphics checkbox. - allowedMode: undefined, - defaultMode: BackgroundGraphicsModeRestriction.ENABLED, - expectedDisabled: false, - expectedChecked: true, - }, - { - // Uncheck background graphics checkbox. - allowedMode: BackgroundGraphicsModeRestriction.UNSET, - defaultMode: BackgroundGraphicsModeRestriction.DISABLED, - expectedDisabled: false, - expectedChecked: false, - }].forEach(subtestParams => { - doPolicySetup( + test(assert(policy_tests.TestNames.CssBackgroundPolicy), async () => { + const tests = [ + { + // No policies. + allowedMode: undefined, + defaultMode: undefined, + expectedDisabled: false, + expectedChecked: false, + }, + { + // Restrict background graphics to be enabled. + // Check that checkbox value default mode is not applied if it + // contradicts allowed mode. + allowedMode: BackgroundGraphicsModeRestriction.ENABLED, + defaultMode: BackgroundGraphicsModeRestriction.DISABLED, + expectedDisabled: true, + expectedChecked: true, + }, + { + // Restrict background graphics to be disabled. + allowedMode: BackgroundGraphicsModeRestriction.DISABLED, + defaultMode: undefined, + expectedDisabled: true, + expectedChecked: false, + }, + { + // Check background graphics checkbox. + allowedMode: undefined, + defaultMode: BackgroundGraphicsModeRestriction.ENABLED, + expectedDisabled: false, + expectedChecked: true, + }, + { + // Uncheck background graphics checkbox. + allowedMode: BackgroundGraphicsModeRestriction.UNSET, + defaultMode: BackgroundGraphicsModeRestriction.DISABLED, + expectedDisabled: false, + expectedChecked: false, + } + ]; + for (const subtestParams of tests) { + await doPolicySetup( 'cssBackground', 'isCssBackgroundEnabled', subtestParams.allowedMode, - subtestParams.defaultMode) - .then(function() { - toggleMoreSettings(); - const checkbox = getCheckbox('cssBackground'); - assertEquals(subtestParams.expectedDisabled, checkbox.disabled); - assertEquals(subtestParams.expectedChecked, checkbox.checked); - }); - }); + subtestParams.defaultMode); + toggleMoreSettings(); + const checkbox = getCheckbox('cssBackground'); + assertEquals(subtestParams.expectedDisabled, checkbox.disabled); + assertEquals(subtestParams.expectedChecked, checkbox.checked); + } }); });
diff --git a/chrome/test/data/webui/print_preview/print_preview_sidebar_test.js b/chrome/test/data/webui/print_preview/print_preview_sidebar_test.js index bc99f65..cfd3c29 100644 --- a/chrome/test/data/webui/print_preview/print_preview_sidebar_test.js +++ b/chrome/test/data/webui/print_preview/print_preview_sidebar_test.js
@@ -14,6 +14,8 @@ /** @enum {string} */ print_preview_sidebar_test.TestNames = { SettingsSectionsVisibilityChange: 'settings sections visibility change', + SheetCountWithDuplex: 'sheet count with duplex', + SheetCountWithCopies: 'sheet count with copies', }; suite(print_preview_sidebar_test.suiteName, function() { @@ -43,6 +45,8 @@ sidebar = document.createElement('print-preview-sidebar'); sidebar.settings = model.settings; + sidebar.setSetting('duplex', false); + sidebar.pageCount = 1; fakeDataBind(model, sidebar, 'settings'); document.body.appendChild(sidebar); sidebar.init(false, 'FooDevice', null); @@ -71,4 +75,36 @@ }); }); }); + + // 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.$$('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.$$('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_preview_ui_browsertest.js b/chrome/test/data/webui/print_preview/print_preview_ui_browsertest.js index 988406bd..6e62e97 100644 --- a/chrome/test/data/webui/print_preview/print_preview_ui_browsertest.js +++ b/chrome/test/data/webui/print_preview/print_preview_ui_browsertest.js
@@ -89,6 +89,14 @@ .SettingsSectionsVisibilityChange); }); +TEST_F('PrintPreviewSidebarTest', 'SheetCountWithDuplex', function() { + this.runMochaTest(print_preview_sidebar_test.TestNames.SheetCountWithDuplex); +}); + +TEST_F('PrintPreviewSidebarTest', 'SheetCountWithCopies', function() { + this.runMochaTest(print_preview_sidebar_test.TestNames.SheetCountWithCopies); +}); + // eslint-disable-next-line no-var var PrintPreviewPagesSettingsTest = class extends PrintPreviewTest { /** @override */ @@ -811,14 +819,6 @@ this.runMochaTest(header_test.TestNames.HeaderPrinterTypes); }); -TEST_F('PrintPreviewHeaderTest', 'HeaderWithDuplex', function() { - this.runMochaTest(header_test.TestNames.HeaderWithDuplex); -}); - -TEST_F('PrintPreviewHeaderTest', 'HeaderWithCopies', function() { - this.runMochaTest(header_test.TestNames.HeaderWithCopies); -}); - TEST_F('PrintPreviewHeaderTest', 'HeaderChangesForState', function() { this.runMochaTest(header_test.TestNames.HeaderChangesForState); });
diff --git a/chrome/test/data/webui/settings/chromeos/os_settings_menu_test.js b/chrome/test/data/webui/settings/chromeos/os_settings_menu_test.js index 501b3377..7af4bc5 100644 --- a/chrome/test/data/webui/settings/chromeos/os_settings_menu_test.js +++ b/chrome/test/data/webui/settings/chromeos/os_settings_menu_test.js
@@ -10,7 +10,7 @@ ADVANCED: new settings.Route('/advanced'), }; routes.BLUETOOTH = routes.BASIC.createSection('/bluetooth', 'bluetooth'); - routes.RESET = routes.ADVANCED.createSection('/reset', 'reset'); + routes.RESET = routes.ADVANCED.createSection('/osReset', 'osReset'); settings.Router.resetInstanceForTesting(new settings.Router(routes)); settings.routes = routes; @@ -90,13 +90,13 @@ test('openResetSection', function() { const selector = settingsMenu.$.subMenu; const path = new window.URL(selector.selected).pathname; - assertEquals('/reset', path); + assertEquals('/osReset', path); }); test('navigateToAnotherSection', function() { const selector = settingsMenu.$.subMenu; let path = new window.URL(selector.selected).pathname; - assertEquals('/reset', path); + assertEquals('/osReset', path); settings.Router.getInstance().navigateTo(settings.routes.BLUETOOTH, ''); Polymer.dom.flush(); @@ -108,7 +108,7 @@ test('navigateToBasic', function() { const selector = settingsMenu.$.subMenu; const path = new window.URL(selector.selected).pathname; - assertEquals('/reset', path); + assertEquals('/osReset', path); settings.Router.getInstance().navigateTo(settings.routes.BASIC, ''); Polymer.dom.flush();
diff --git a/chrome/test/data/webui/settings/chromeos/os_settings_page_test.js b/chrome/test/data/webui/settings/chromeos/os_settings_page_test.js index 5c00d41..50d07131 100644 --- a/chrome/test/data/webui/settings/chromeos/os_settings_page_test.js +++ b/chrome/test/data/webui/settings/chromeos/os_settings_page_test.js
@@ -85,7 +85,7 @@ await test_util.flushTasks(); const sectionNames = - ['privacy', 'languages', 'files', 'reset', 'dateTime', 'a11y']; + ['privacy', 'languages', 'files', 'osReset', 'dateTime', 'a11y']; for (const name of sectionNames) { const section = settingsPage.shadowRoot.querySelector( @@ -113,7 +113,7 @@ const visibleSections = [ 'internet', 'bluetooth', 'device', 'search', 'apps', 'privacy', - 'languages', 'files', 'reset', 'dateTime', 'a11y' + 'languages', 'files', 'osReset', 'dateTime', 'a11y' ]; for (const name of visibleSections) { const section = settingsPage.shadowRoot.querySelector(
diff --git a/chrome/test/data/webui/settings/cookies_page_test.js b/chrome/test/data/webui/settings/cookies_page_test.js index c55a849..efe4c25 100644 --- a/chrome/test/data/webui/settings/cookies_page_test.js +++ b/chrome/test/data/webui/settings/cookies_page_test.js
@@ -9,7 +9,7 @@ // #import {TestMetricsBrowserProxy} from 'chrome://test/settings/test_metrics_browser_proxy.m.js'; // #import {TestSiteSettingsPrefsBrowserProxy} from 'chrome://test/settings/test_site_settings_prefs_browser_proxy.m.js'; // #import {createRawSiteException, createDefaultContentSetting,createSiteSettingsPrefs,createContentSettingTypeToValuePair} from 'chrome://test/settings/test_util.m.js'; -// #import {isChildVisible, flushTasks} from 'chrome://test/test_util.m.js'; +// #import {isChildVisible, isVisible, flushTasks} from 'chrome://test/test_util.m.js'; // clang-format on suite('CrSettingsCookiesPageTest', function() { @@ -43,6 +43,12 @@ /** @type {array<!Element>} */ let radioButtons; + suiteSetup(function() { + loadTimeData.overrideValues({ + improvedCookieControlsEnabled: true, + }); + }); + setup(function() { testMetricsBrowserProxy = new TestMetricsBrowserProxy(); settings.MetricsBrowserProxyImpl.instance_ = testMetricsBrowserProxy; @@ -213,6 +219,9 @@ assertTrue(test_util.isChildVisible(page, '#clearOnExit')); assertTrue(test_util.isChildVisible(page, '#doNotTrack')); assertTrue(test_util.isChildVisible(page, '#networkPrediction')); + // Ensure that with the improvedCookieControls flag enabled that the block + // third party cookies radio is visible. + assertTrue(test_util.isVisible(blockThirdPartyIncognito)); }); test('NetworkPredictionClickRecorded', async function() { @@ -346,3 +355,53 @@ } }); }); + +suite('CrSettingsCookiesPageTest_ImprovedCookieControlsDisabled', function() { + /** @type {TestSiteSettingsPrefsBrowserProxy} */ + let siteSettingsBrowserProxy; + + /** @type {SettingsSecurityPageElement} */ + let page; + + suiteSetup(function() { + loadTimeData.overrideValues({ + improvedCookieControlsEnabled: false, + }); + }); + + setup(function() { + siteSettingsBrowserProxy = new TestSiteSettingsPrefsBrowserProxy(); + settings.SiteSettingsPrefsBrowserProxyImpl.instance_ = + siteSettingsBrowserProxy; + PolymerTest.clearBody(); + page = document.createElement('settings-cookies-page'); + page.prefs = { + profile: { + cookie_controls_mode: {value: 0}, + block_third_party_cookies: {value: false}, + }, + }; + document.body.appendChild(page); + Polymer.dom.flush(); + }); + + teardown(function() { + page.remove(); + }); + + test('BlockThirdPartyRadio_Hidden', function() { + assertFalse(test_util.isChildVisible(page, '#blockThirdPartyIncognito')); + }); + + test('BlockThirdPartyRadio_NotSelected', async function() { + // Create a preference state that would select the removed radio button + // and ensure the correct radio button is instead selected. + page.set( + 'prefs.profile.cookie_controls_mode.value', + settings.CookieControlsMode.INCOGNITO_ONLY); + Polymer.dom.flush(); + await siteSettingsBrowserProxy.whenCalled('getDefaultValueForContentType'); + + assertTrue(page.$$('#allowAll').checked); + }); +});
diff --git a/chrome/test/data/webui/settings/password_check_test.js b/chrome/test/data/webui/settings/password_check_test.js index c05afae..e1f1424 100644 --- a/chrome/test/data/webui/settings/password_check_test.js +++ b/chrome/test/data/webui/settings/password_check_test.js
@@ -947,11 +947,11 @@ validateLeakedPasswordsList(checkPasswordSection, leakedPasswords); leakedPasswords.push(autofill_test_util.makeCompromisedCredential( - 'three.com', 'test2', 'PHISHED', 3, 3)); + 'three.com', 'test2', 'PHISHED', 3, 6)); leakedPasswords.push(autofill_test_util.makeCompromisedCredential( - 'four.com', 'test1', 'LEAKED', 4, 5)); + 'four.com', 'test1', 'LEAKED', 4, 4)); leakedPasswords.push(autofill_test_util.makeCompromisedCredential( - 'five.com', 'test0', 'LEAKED', 5, 4)); + 'five.com', 'test0', 'LEAKED', 5, 5)); checkPasswordSection.updateCompromisedPasswordList( shuffleArray(leakedPasswords)); Polymer.dom.flush(); @@ -959,16 +959,16 @@ }); // Test verifies that deleting and adding works as it should - test('deleteComrpomisedCredemtials', function() { + test('deleteCompromisedCredemtials', function() { const leakedPasswords = [ autofill_test_util.makeCompromisedCredential( 'one.com', 'test4', 'PHISHED', 0, 0), autofill_test_util.makeCompromisedCredential( - 'two.com', 'test3', 'LEAKED', 1, 2), + '2two.com', 'test3', 'LEAKED', 1, 2), autofill_test_util.makeCompromisedCredential( - 'three.com', 'test2', 'LEAKED', 2, 2), + '3three.com', 'test2', 'LEAKED', 2, 2), autofill_test_util.makeCompromisedCredential( - 'four.com', 'test2', 'LEAKED', 3, 2), + '4four.com', 'test2', 'LEAKED', 3, 2), ]; const checkPasswordSection = createCheckPasswordSection(); checkPasswordSection.updateCompromisedPasswordList(leakedPasswords); @@ -978,7 +978,7 @@ // remove 2nd and 3rd elements leakedPasswords.splice(1, 2); leakedPasswords.push(autofill_test_util.makeCompromisedCredential( - 'five.com', 'test2', 'LEAKED', 4, 3)); + 'five.com', 'test2', 'LEAKED', 4, 5)); checkPasswordSection.updateCompromisedPasswordList( shuffleArray(leakedPasswords)); @@ -986,6 +986,54 @@ validateLeakedPasswordsList(checkPasswordSection, leakedPasswords); }); + // Test verifies sorting. Phished passwords always shown above leaked even + // if they are older + test('sortCompromisedCredentials', function() { + const leakedPasswords = [ + autofill_test_util.makeCompromisedCredential( + 'one.com', 'test6', 'PHISHED', 6, 3), + autofill_test_util.makeCompromisedCredential( + 'two.com', 'test5', 'PHISHED_AND_LEAKED', 5, 4), + autofill_test_util.makeCompromisedCredential( + 'three.com', 'test4', 'PHISHED', 4, 5), + autofill_test_util.makeCompromisedCredential( + 'four.com', 'test3', 'LEAKED', 3, 0), + autofill_test_util.makeCompromisedCredential( + 'five.com', 'test2', 'LEAKED', 2, 1), + autofill_test_util.makeCompromisedCredential( + 'six.com', 'test1', 'LEAKED', 1, 2), + ]; + const checkPasswordSection = createCheckPasswordSection(); + checkPasswordSection.updateCompromisedPasswordList( + shuffleArray(leakedPasswords)); + Polymer.dom.flush(); + validateLeakedPasswordsList(checkPasswordSection, leakedPasswords); + }); + + // Test verifies sorting by username in case compromise type, compromise + // time and origin are equal. + test('sortCompromisedCredentialsByUsername', function() { + const leakedPasswords = [ + autofill_test_util.makeCompromisedCredential( + 'example.com', 'test0', 'LEAKED', 0, 1), + autofill_test_util.makeCompromisedCredential( + 'example.com', 'test1', 'LEAKED', 1, 1), + autofill_test_util.makeCompromisedCredential( + 'example.com', 'test2', 'LEAKED', 2, 1), + autofill_test_util.makeCompromisedCredential( + 'example.com', 'test3', 'LEAKED', 3, 1), + autofill_test_util.makeCompromisedCredential( + 'example.com', 'test4', 'LEAKED', 4, 1), + autofill_test_util.makeCompromisedCredential( + 'example.com', 'test5', 'LEAKED', 5, 1), + ]; + const checkPasswordSection = createCheckPasswordSection(); + checkPasswordSection.updateCompromisedPasswordList( + shuffleArray(leakedPasswords)); + Polymer.dom.flush(); + validateLeakedPasswordsList(checkPasswordSection, leakedPasswords); + }); + // Verify that the edit dialog is not shown if a plaintext password could // not be obtained. test('editDialogWithoutPlaintextPassword', async function() {
diff --git a/chrome/test/data/webui/settings/passwords_and_autofill_fake_data.js b/chrome/test/data/webui/settings/passwords_and_autofill_fake_data.js index a22a9c6c..d2adf2e 100644 --- a/chrome/test/data/webui/settings/passwords_and_autofill_fake_data.js +++ b/chrome/test/data/webui/settings/passwords_and_autofill_fake_data.js
@@ -119,20 +119,19 @@ * @param {string=} username * @param {string=} type * @param {number=} id - * @param {number=} createTime + * @param {number=} elapsedMinSinceCompromise * @return {chrome.passwordsPrivate.CompromisedCredential} * @private */ /* #export */ function makeCompromisedCredential( - url, username, type, id, createTime) { + url, username, type, id, elapsedMinSinceCompromise) { return { id: id, formattedOrigin: url, changePasswordUrl: `http://${url}/`, username: username, - elapsedTimeSinceCompromise: - (Math.floor(Math.random() * 60)).toString() + ' min ago', - compromiseTime: createTime, + elapsedTimeSinceCompromise: `${elapsedMinSinceCompromise} minutes ago`, + compromiseTime: Date.now() - (elapsedMinSinceCompromise * 60000), compromiseType: type, }; }
diff --git a/chrome/test/data/webui/settings/safety_check_page_test.js b/chrome/test/data/webui/settings/safety_check_page_test.js index eab3c08..0ca5d27 100644 --- a/chrome/test/data/webui/settings/safety_check_page_test.js +++ b/chrome/test/data/webui/settings/safety_check_page_test.js
@@ -112,9 +112,9 @@ await safetyCheckBrowserProxy.whenCalled('runSafetyCheck'); Polymer.dom.flush(); - // No button is present. + // Only the icon button is present. assertFalse(!!page.$$('#safetyCheckParentButton')); - assertFalse(!!page.$$('#safetyCheckParentIconButton')); + assertTrue(!!page.$$('#safetyCheckParentIconButton')); // Collapse is opened. assertTrue(page.$$('#safetyCheckCollapse').opened);
diff --git a/chrome/test/permissions/permission_request_manager_test_api.cc b/chrome/test/permissions/permission_request_manager_test_api.cc index 747cb522..82720b3b 100644 --- a/chrome/test/permissions/permission_request_manager_test_api.cc +++ b/chrome/test/permissions/permission_request_manager_test_api.cc
@@ -26,9 +26,10 @@ bool user_gesture = true; auto decided = [](ContentSetting) {}; request_ = std::make_unique<permissions::PermissionRequestImpl>( - GURL("https://example.com"), type, user_gesture, base::Bind(decided), - base::Bind(&TestPermissionRequestOwner::DeleteThis, - base::Unretained(this))); + GURL("https://embedder_example.test"), GURL("https://example.com"), type, + user_gesture, base::BindOnce(decided), + base::BindOnce(&TestPermissionRequestOwner::DeleteThis, + base::Unretained(this))); } permissions::PermissionRequestImpl* request() { return request_.get(); }
diff --git a/chrome/test/pixel/browser_skia_gold_pixel_diff_unittest.cc b/chrome/test/pixel/browser_skia_gold_pixel_diff_unittest.cc index 3bebaee..4e9458e 100644 --- a/chrome/test/pixel/browser_skia_gold_pixel_diff_unittest.cc +++ b/chrome/test/pixel/browser_skia_gold_pixel_diff_unittest.cc
@@ -18,27 +18,31 @@ class MockBrowserSkiaGoldPixelDiff : public BrowserSkiaGoldPixelDiff { public: - MockBrowserSkiaGoldPixelDiff() {} - MOCK_CONST_METHOD2(UploadToSkiaGoldServer, - bool(const base::FilePath&, const std::string&)); + MockBrowserSkiaGoldPixelDiff() = default; + MOCK_CONST_METHOD1(LaunchProcess, int(const base::CommandLine&)); bool GrabWindowSnapshotInternal(gfx::NativeWindow window, const gfx::Rect& snapshot_bounds, - gfx::Image* image) const { + gfx::Image* image) const override { SkBitmap bitmap; bitmap.allocN32Pixels(10, 10); *image = gfx::Image::CreateFrom1xBitmap(bitmap); return true; } - int LaunchProcess(const base::CommandLine& cmdline) const override { - return 0; - } +}; + +class MockBrowserSkiaGoldPixelDiffMockUpload + : public MockBrowserSkiaGoldPixelDiff { + public: + MockBrowserSkiaGoldPixelDiffMockUpload() = default; + MOCK_CONST_METHOD2(UploadToSkiaGoldServer, + bool(const base::FilePath&, const std::string&)); }; class BrowserSkiaGoldPixelDiffTest : public views::test::WidgetTest { public: BrowserSkiaGoldPixelDiffTest() { auto* cmd_line = base::CommandLine::ForCurrentProcess(); - cmd_line->AppendSwitchASCII("build-revision", "test"); + cmd_line->AppendSwitchASCII("git-revision", "test"); } private: @@ -47,7 +51,7 @@ TEST_F(BrowserSkiaGoldPixelDiffTest, CompareScreenshotByView) { views::View view; - MockBrowserSkiaGoldPixelDiff mock_pixel; + MockBrowserSkiaGoldPixelDiffMockUpload mock_pixel; EXPECT_CALL(mock_pixel, UploadToSkiaGoldServer(_, "Prefix_Demo")) .Times(1) .WillOnce(Return(true)); @@ -57,3 +61,17 @@ EXPECT_TRUE(ret); widget->CloseNow(); } + +TEST_F(BrowserSkiaGoldPixelDiffTest, BypassSkiaGoldFunctionality) { + base::CommandLine::ForCurrentProcess()->AppendSwitch( + "bypass-skia-gold-functionality"); + + views::View view; + MockBrowserSkiaGoldPixelDiff mock_pixel; + EXPECT_CALL(mock_pixel, LaunchProcess(_)).Times(0); + views::Widget* widget = CreateTopLevelNativeWidget(); + mock_pixel.Init(widget, "Prefix"); + bool ret = mock_pixel.CompareScreenshot("Demo", &view); + EXPECT_TRUE(ret); + widget->CloseNow(); +}
diff --git a/chrome/updater/server/win/server.cc b/chrome/updater/server/win/server.cc index 7df49ea..148e51d 100644 --- a/chrome/updater/server/win/server.cc +++ b/chrome/updater/server/win/server.cc
@@ -229,7 +229,6 @@ // Called by the COM RPC runtime on one of its threads. HRESULT UpdaterImpl::UpdateAll(IUpdaterObserver* observer) { using IUpdaterObserverPtr = Microsoft::WRL::ComPtr<IUpdaterObserver>; - using ICompleteStatusPtr = Microsoft::WRL::ComPtr<ICompleteStatus>; // Invoke the in-process |update_service| on the main sequence. auto com_server = ComServer::Instance(); @@ -250,11 +249,7 @@ base::ThreadPool::PostTaskAndReplyWithResult( FROM_HERE, {base::MayBlock()}, base::BindOnce( - [](IUpdaterObserverPtr observer, - ICompleteStatusPtr status) { - return observer->OnComplete(status.Get()); - }, - observer, + &IUpdaterObserver::OnComplete, observer, Microsoft::WRL::Make<CompleteStatusImpl>( static_cast<int>(result), L"Test")), base::BindOnce([](HRESULT hr) {
diff --git a/chrome/updater/update_service_in_process.cc b/chrome/updater/update_service_in_process.cc index c2a4899..81ed9f9 100644 --- a/chrome/updater/update_service_in_process.cc +++ b/chrome/updater/update_service_in_process.cc
@@ -49,6 +49,55 @@ FROM_HERE, base::BindOnce(std::move(callback), RegistrationResponse(0))); } +namespace { + +std::vector<base::Optional<update_client::CrxComponent>> GetComponents( + scoped_refptr<PersistedData> persisted_data, + const std::vector<std::string>& ids) { + std::vector<base::Optional<update_client::CrxComponent>> components; + for (const auto& id : ids) { + components.push_back(base::MakeRefCounted<Installer>(id, persisted_data) + ->MakeCrxComponent()); + } + return components; +} + +void UpdateStateCallbackRun(UpdateService::StateChangeCallback state_update, + update_client::CrxUpdateItem crx_update_item) { + UpdateService::UpdateState update_state = + UpdateService::UpdateState::kUnknown; + switch (crx_update_item.state) { + case update_client::ComponentState::kNew: + update_state = UpdateService::UpdateState::kNotStarted; + break; + case update_client::ComponentState::kChecking: + update_state = UpdateService::UpdateState::kCheckingForUpdates; + break; + case update_client::ComponentState::kDownloading: + case update_client::ComponentState::kDownloadingDiff: + update_state = UpdateService::UpdateState::kDownloading; + break; + case update_client::ComponentState::kUpdating: + case update_client::ComponentState::kUpdatingDiff: + update_state = UpdateService::UpdateState::kInstalling; + break; + case update_client::ComponentState::kUpdated: + update_state = UpdateService::UpdateState::kUpdated; + break; + case update_client::ComponentState::kUpToDate: + update_state = UpdateService::UpdateState::kNoUpdate; + break; + case update_client::ComponentState::kUpdateError: + update_state = UpdateService::UpdateState::kUpdateError; + break; + default: + break; + } + state_update.Run(update_state); +} + +} // namespace + void UpdateServiceInProcess::UpdateAll(StateChangeCallback state_update, Callback callback) { DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); @@ -57,54 +106,9 @@ DCHECK(base::Contains(app_ids, kUpdaterAppId)); update_client_->Update( - app_ids, - base::BindOnce( - [](scoped_refptr<PersistedData> persisted_data, - const std::vector<std::string>& ids) { - std::vector<base::Optional<update_client::CrxComponent>> components; - for (const auto& id : ids) { - components.push_back( - base::MakeRefCounted<Installer>(id, persisted_data) - ->MakeCrxComponent()); - } - return components; - }, - persisted_data_), - base::BindRepeating( - [](StateChangeCallback state_update, - update_client::CrxUpdateItem crx_update_item) { - UpdateState update_state = UpdateState::kUnknown; - switch (crx_update_item.state) { - case update_client::ComponentState::kNew: - update_state = UpdateState::kNotStarted; - break; - case update_client::ComponentState::kChecking: - update_state = UpdateState::kCheckingForUpdates; - break; - case update_client::ComponentState::kDownloading: - case update_client::ComponentState::kDownloadingDiff: - update_state = UpdateState::kDownloading; - break; - case update_client::ComponentState::kUpdating: - case update_client::ComponentState::kUpdatingDiff: - update_state = UpdateState::kInstalling; - break; - case update_client::ComponentState::kUpdated: - update_state = UpdateState::kUpdated; - break; - case update_client::ComponentState::kUpToDate: - update_state = UpdateState::kNoUpdate; - break; - case update_client::ComponentState::kUpdateError: - update_state = UpdateState::kUpdateError; - break; - default: - break; - } - state_update.Run(update_state); - }, - state_update), - false, std::move(callback)); + app_ids, base::BindOnce(&GetComponents, persisted_data_), + base::BindRepeating(&UpdateStateCallbackRun, state_update), false, + std::move(callback)); } void UpdateServiceInProcess::Update(const std::string& app_id, @@ -112,8 +116,11 @@ StateChangeCallback state_update, Callback callback) { DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); - // TODO(crbug.com/1059020): Implement. - NOTREACHED(); + + update_client_->Update( + {app_id}, base::BindOnce(&GetComponents, persisted_data_), + base::BindRepeating(&UpdateStateCallbackRun, state_update), + priority == Priority::kForeground, std::move(callback)); } void UpdateServiceInProcess::Uninitialize() {
diff --git a/chromecast/external_mojo/external_service_support/BUILD.gn b/chromecast/external_mojo/external_service_support/BUILD.gn index af091c2..7c3f4cb 100644 --- a/chromecast/external_mojo/external_service_support/BUILD.gn +++ b/chromecast/external_mojo/external_service_support/BUILD.gn
@@ -28,6 +28,7 @@ deps = [ "//base", "//base:base_static", + "//chromecast:chromecast_buildflags", ] if (!is_fuchsia) {
diff --git a/chromecast/external_mojo/external_service_support/process_setup.cc b/chromecast/external_mojo/external_service_support/process_setup.cc index 7493b66..8b8b8d45 100644 --- a/chromecast/external_mojo/external_service_support/process_setup.cc +++ b/chromecast/external_mojo/external_service_support/process_setup.cc
@@ -13,6 +13,7 @@ #include "base/feature_list.h" #include "base/logging.h" #include "build/build_config.h" +#include "chromecast/chromecast_buildflags.h" #if !defined(OS_ANDROID) && !defined(OS_FUCHSIA) #include "chromecast/external_mojo/external_service_support/crash_reporter_client.h" @@ -36,6 +37,13 @@ logging::LOG_TO_SYSTEM_DEBUG_LOG | logging::LOG_TO_STDERR; logging::InitLogging(settings); +#if BUILDFLAG(IS_CAST_DESKTOP_BUILD) + logging::SetLogItems(true, true, true, false); +#else + // Timestamp available through logcat -v time. + logging::SetLogItems(true, true, false, false); +#endif // BUILDFLAG(IS_CAST_DESKTOP_BUILD) + base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); base::FeatureList::InitializeInstance( command_line->GetSwitchValueASCII(switches::kEnableFeatures),
diff --git a/chromeos/components/media_app_ui/resources/js/launch.js b/chromeos/components/media_app_ui/resources/js/launch.js index 28d2b377..9826942 100644 --- a/chromeos/components/media_app_ui/resources/js/launch.js +++ b/chromeos/components/media_app_ui/resources/js/launch.js
@@ -62,35 +62,55 @@ }); guestMessagePipe.registerHandler(Message.DELETE_FILE, async (message) => { - const deleteMsg = /** @type {DeleteFileMessage} */ (message); + const deleteMsg = /** @type{DeleteFileMessage} */ (message); + assertFileAndDirectoryMutable(deleteMsg.token, 'Delete'); - if (!currentlyWritableFile || deleteMsg.token !== fileToken) { - throw new Error('File not current for delete.'); - } - - if (!currentDirectoryHandle) { - throw new Error('Delete for file without launch directory.'); + if (!(await isCurrentHandleInCurrentDirectory())) { + return {deleteResult: DeleteResult.FILE_MOVED}; } // Get the name from the file reference. Handles file renames. const currentFilename = (await currentlyWritableFile.handle.getFile()).name; - // Check the file to be deleted exists in the directory handle. Prevents - // deleting the wrong file / deleting a file that doesn't exist (this isn't - // a failure case in `removeEntry()` but should be handled with different UX - // in MediaApp). - const fileHandle = await currentDirectoryHandle.getFile(currentFilename); - - const isSameFileHandle = - await fileHandle.isSameEntry(currentlyWritableFile.handle); - if (!isSameFileHandle) { - return {deleteResult: DeleteResult.FILE_MOVED}; - } - await currentDirectoryHandle.removeEntry(currentFilename); return {deleteResult: DeleteResult.SUCCESS}; }); +/** Handler to rename the currently focused file. */ +guestMessagePipe.registerHandler(Message.RENAME_FILE, async (message) => { + const renameMsg = /** @type{RenameFileMessage} */ (message); + assertFileAndDirectoryMutable(renameMsg.token, 'Rename'); + + if (await filenameExistsInCurrentDirectory(renameMsg.newFilename)) { + return {renameResult: RenameResult.FILE_EXISTS}; + } + + const originalFile = await currentlyWritableFile.handle.getFile(); + const renamedFileHandle = await currentDirectoryHandle.getFile( + renameMsg.newFilename, {create: true}); + + // Copy file data over to the new file. + const writer = await renamedFileHandle.createWritable(); + // TODO(b/153021155): Use originalFile.stream(). + await writer.write(await originalFile.arrayBuffer()); + await writer.truncate(originalFile.size); + await writer.close(); + + // Remove the old file since the new file has all the data & the new name. + // Note even though removing an entry that doesn't exist is considered + // success, we first check the `currentlyWritableFile.handle` is the same as + // the handle for the file with that filename in the `currentDirectoryHandle`. + if (await isCurrentHandleInCurrentDirectory()) { + await currentDirectoryHandle.removeEntry(originalFile.name); + } + + // Reload current file so it is in an editable state, this is done before + // removing the old file so the relaunch starts sooner. + await launchWithDirectory(currentDirectoryHandle, renamedFileHandle); + + return {renameResult: RenameResult.SUCCESS}; +}); + guestMessagePipe.registerHandler(Message.NAVIGATE, async (message) => { const navigate = /** @type {NavigateMessage} */ (message); @@ -120,6 +140,63 @@ } /** + * Throws an error if the file or directory handles don't exist or the token for + * the file to be mutated is incorrect. + * @param {number} editFileToken + * @param {string} operation + */ +function assertFileAndDirectoryMutable(editFileToken, operation) { + if (!currentlyWritableFile || editFileToken !== fileToken) { + throw new Error(`${operation} failed. File not current.`); + } + + if (!currentDirectoryHandle) { + throw new Error(`${operation} failed. File without launch directory.`); + } +} + +/** + * Returns whether `currentlyWritableFile.handle` is in`currentDirectoryHandle`. + * Prevents mutating the wrong file or a file that doesn't exist. + * @return {!Promise<!boolean>} + */ +async function isCurrentHandleInCurrentDirectory() { + // Get the name from the file reference. Handles file renames. + const currentFilename = (await currentlyWritableFile.handle.getFile()).name; + const fileHandle = await getFileHandleFromCurrentDirectory(currentFilename); + return fileHandle ? fileHandle.isSameEntry(currentlyWritableFile.handle) : + false; +} + +/** + * Returns if a`filename` exists in `currentDirectoryHandle`. + * @param {string} filename + * @return {!Promise<!boolean>} + */ +async function filenameExistsInCurrentDirectory(filename) { + return (await getFileHandleFromCurrentDirectory(filename, true)) !== null; +} + +/** + * Returns the `FileSystemFileHandle` for `filename` if it exists in the current + * directory, otherwise null. + * @param {string} filename + * @param {boolean} suppressError + * @return {!Promise<!FileSystemHandle|null>} + */ +async function getFileHandleFromCurrentDirectory( + filename, suppressError = false) { + try { + return (await currentDirectoryHandle.getFile(filename, {create: false})); + } catch (/** @type {Object} */ e) { + if (!suppressError) { + console.error(e); + } + return null; + } +} + +/** * Gets a file from a handle received via the fileHandling API. * @param {?FileSystemHandle} fileSystemHandle * @return {Promise<?{file: !File, handle: !FileSystemFileHandle}>} @@ -158,7 +235,6 @@ } entryIndex = currentFiles.findIndex(i => i.file.name === focusFile.name); currentDirectoryHandle = directory; - sendFilesToGuest(); } /** @@ -171,7 +247,7 @@ await setCurrentDirectory(directory, asFile.file); // Load currentFiles into the guest. - sendFilesToGuest(); + await sendFilesToGuest(); } /**
diff --git a/chromeos/components/media_app_ui/resources/js/media_app.externs.js b/chromeos/components/media_app_ui/resources/js/media_app.externs.js index 73b6766..d17152af 100644 --- a/chromeos/components/media_app_ui/resources/js/media_app.externs.js +++ b/chromeos/components/media_app_ui/resources/js/media_app.externs.js
@@ -60,6 +60,15 @@ mediaApp.AbstractFile.prototype.deleteOriginalFile; /** + * A function that will rename the original file. Returns a promise that + * resolves to an enum value (see RenameResult in message_types) reflecting the + * result of the deletion (SUCCESS, FILE_EXISTS), rejected if the + * rename fails. + * @type {function(string): Promise<number>|undefined} + */ +mediaApp.AbstractFile.prototype.renameOriginalFile; + +/** * Wraps an HTML FileList object. * @record * @struct
diff --git a/chromeos/components/media_app_ui/resources/js/message_types.js b/chromeos/components/media_app_ui/resources/js/message_types.js index fb53c59..6d5f2d4 100644 --- a/chromeos/components/media_app_ui/resources/js/message_types.js +++ b/chromeos/components/media_app_ui/resources/js/message_types.js
@@ -17,6 +17,7 @@ NAVIGATE: 'navigate', OPEN_FEEDBACK_DIALOG: 'open-feedback-dialog', OVERWRITE_FILE: 'overwrite-file', + RENAME_FILE: 'rename-file', }; /** @@ -32,14 +33,14 @@ * Message sent by the unprivileged context to request the privileged context to * delete the currently writable file. * If the supplied file `token` is invalid the request is rejected. - * @typedef {{ token: number }} + * @typedef {{token: number}} */ let DeleteFileMessage; /** * Response message sent by the privileged context indicating if a requested * delete was successful. - * @typedef {{ deleteResult: DeleteResult }} + * @typedef {{deleteResult: DeleteResult}} */ let DeleteFileResponse; @@ -64,7 +65,27 @@ /** * Message sent by the unprivileged context to the privileged context requesting * the app be relaunched with the next/previous file in the current directory - * set to writable. Direction must be either 'next' or 'prev' + * set to writable. Direction must be either 'next' or 'prev'. * @typedef {{direction: number}} */ let NavigateMessage; + +/** + * Enum for valid results of renaming a file. + * @enum {number} + */ +const RenameResult = { + SUCCESS: 0, + FILE_EXISTS: 1, +}; + +/** + * Message sent by the unprivileged context to request the privileged context to + * rename the currently writable file. + * If the supplied file `token` is invalid the request is rejected. + @typedef {{token: number, newFilename: string}} + */ +let RenameFileMessage; + +/** @typedef {{renameResult: RenameResult}} */ +let RenameFileResponse;
diff --git a/chromeos/components/media_app_ui/resources/js/receiver.js b/chromeos/components/media_app_ui/resources/js/receiver.js index 969de46..e21b46e 100644 --- a/chromeos/components/media_app_ui/resources/js/receiver.js +++ b/chromeos/components/media_app_ui/resources/js/receiver.js
@@ -57,6 +57,18 @@ Message.DELETE_FILE, {token: this.token})); return deleteResponse.deleteResult; } + + /** + * @override + * @param {string} newName + * @return {!Promise<number>} + */ + async renameOriginalFile(newName) { + const renameResponse = + /** @type {!RenameFileResponse} */ (await parentMessagePipe.sendMessage( + Message.RENAME_FILE, {token: this.token, newFilename: newName})); + return renameResponse.renameResult; + } } /**
diff --git a/chromeos/components/media_app_ui/resources/js/web_app_file_handling.externs.js b/chromeos/components/media_app_ui/resources/js/web_app_file_handling.externs.js index 30be6a1..445d1d0f 100644 --- a/chromeos/components/media_app_ui/resources/js/web_app_file_handling.externs.js +++ b/chromeos/components/media_app_ui/resources/js/web_app_file_handling.externs.js
@@ -83,7 +83,7 @@ /** * @param {FileSystemHandle} other - * @return {Promise<boolean>} + * @return {!Promise<boolean>} */ isSameEntry(other) {}
diff --git a/chromeos/components/media_app_ui/resources/mock/js/app_main.js b/chromeos/components/media_app_ui/resources/mock/js/app_main.js index 2d579f1..7d7f0f6 100644 --- a/chromeos/components/media_app_ui/resources/mock/js/app_main.js +++ b/chromeos/components/media_app_ui/resources/mock/js/app_main.js
@@ -51,15 +51,20 @@ /** @override */ async loadFiles(files) { const file = files.item(0); - const factory = - file.mimeType.match('^video/') ? createVideoChild : createImgChild; + const isVideo = file.mimeType.match('^video/'); + // TODO(b/152832337): Remove this check when always using real image files + // in tests. Image with size < 0 can't reliably be decoded. Don't apply the + // size check to videos so MediaAppUIBrowserTest.CanFullscreenVideo doesn't + // fail. + if (file.size > 0 || isVideo) { + const factory = isVideo ? createVideoChild : createImgChild; + // Note the mock app will just leak this Blob URL. + const child = await factory(URL.createObjectURL(file.blob)); - // Note the mock app will just leak this Blob URL. - const child = await factory(URL.createObjectURL(file.blob)); - - // Simulate an app that shows one image at a time. - this.replaceChild(child, this.currentMedia); - this.currentMedia = child; + // Simulate an app that shows one image at a time. + this.replaceChild(child, this.currentMedia); + this.currentMedia = child; + } } /** @override */
diff --git a/chromeos/components/media_app_ui/test/driver.js b/chromeos/components/media_app_ui/test/driver.js index 61df6cd..4e84543 100644 --- a/chromeos/components/media_app_ui/test/driver.js +++ b/chromeos/components/media_app_ui/test/driver.js
@@ -87,7 +87,7 @@ constructor() { this.isFile = true; this.isDirectory = false; - this.name = ''; + this.name = 'fake_file.png'; } /** @override */ async isSameEntry(other) { @@ -117,6 +117,12 @@ } /** @override */ async getFile() { + // TODO(b/152832337): Use a real image file and set mime type to be + // 'image/png'. In tests, the src_internal app struggles to reliably load + // empty images because a size of 0 can't be decoded but also can't reliably + // load real images due to b/152832025. Mitigate this for now by now by not + // providing a mime type so the image doesn't get loaded in tests but we can + // still test the IPC mechanisms. return new File([], this.name); } } @@ -147,10 +153,18 @@ this.files.push(fileHandle); } /** @override */ - getFile(name, options) { - const fileHandler = this.files.find(f => f.name === name); - return fileHandler ? Promise.resolve(fileHandler) : - Promise.reject(new Error(`File ${name} not found`)); + async getFile(name, options) { + const fileHandle = this.files.find(f => f.name === name); + if (!fileHandle && options.create === true) { + // Simulate creating a new file. + const newFileHandle = new FakeFileSystemFileHandle(); + newFileHandle.name = name; + this.files.push(newFileHandle); + return Promise.resolve(newFileHandle); + } + return fileHandle ? Promise.resolve(fileHandle) : + Promise.reject((createNamedError( + 'NotFoundError', `File ${name} not found`))); } /** @override */ getDirectory(name, options) {} @@ -206,3 +220,15 @@ entryIndex = 0; return sendFilesToGuest(); } + +/** + * Creates an `Error` with the name field set. + * @param {string} name + * @param {string} msg + * @return {Error} + */ +function createNamedError(name, msg) { + const error = new Error(msg); + error.name = name; + return error; +}
diff --git a/chromeos/components/media_app_ui/test/driver_api.js b/chromeos/components/media_app_ui/test/driver_api.js index 05e0d48..5e9208f 100644 --- a/chromeos/components/media_app_ui/test/driver_api.js +++ b/chromeos/components/media_app_ui/test/driver_api.js
@@ -12,6 +12,7 @@ * overwriteLastFile: (string|undefined), * pathToRoot: (Array<string>|undefined), * property: (string|undefined), + * renameLastFile: (string|undefined), * requestFullscreen: (boolean|undefined), * testQuery: string, * }}
diff --git a/chromeos/components/media_app_ui/test/guest_query_receiver.js b/chromeos/components/media_app_ui/test/guest_query_receiver.js index ed78ae7..1628dece0 100644 --- a/chromeos/components/media_app_ui/test/guest_query_receiver.js +++ b/chromeos/components/media_app_ui/test/guest_query_receiver.js
@@ -62,8 +62,20 @@ } catch (/** @type{Error} */ error) { result = `deleteOriginalFile failed Error: ${error}`; } + } else if (data.renameLastFile) { + try { + const renameResult = + await lastReceivedFileList.item(0).renameOriginalFile( + data.renameLastFile); + if (renameResult === RenameResult.FILE_EXISTS) { + result = 'renameOriginalFile resolved file exists'; + } else { + result = 'renameOriginalFile resolved success'; + } + } catch (/** @type{Error} */ error) { + result = `renameOriginalFile failed Error: ${error}`; + } } - return {testQueryResult: result}; } @@ -107,7 +119,7 @@ return; } catch (/** @type {GenericErrorResponse} */ e) { if (e.message !== EXPECTED_ERROR) { - console.error('Unepxected error in signalTestHandlersReady', e); + console.error('Unexpected error in signalTestHandlersReady', e); return; } }
diff --git a/chromeos/components/media_app_ui/test/media_app_ui_browsertest.js b/chromeos/components/media_app_ui/test/media_app_ui_browsertest.js index 254f565..2decb9e6 100644 --- a/chromeos/components/media_app_ui/test/media_app_ui_browsertest.js +++ b/chromeos/components/media_app_ui/test/media_app_ui_browsertest.js
@@ -202,6 +202,7 @@ // Simulate steps taken to load a file via a launch event. const firstFile = directory.files[0]; loadFile(await createTestImageFile(), firstFile); + // Set `currentDirectoryHandle` in launch.js. currentDirectoryHandle = directory; let testResponse; @@ -254,7 +255,45 @@ result = await guestMessagePipe.sendMessage('test', {navigate: 'prev'}); assertEquals(result.testQueryResult, 'loadPrev called'); assertEquals(entryIndex, 1); + testDone(); +}); +// Tests the IPC behind the implementation of ReceivedFile.renameOriginalFile() +// in the untrusted context. +TEST_F('MediaAppUIBrowserTest', 'RenameOriginalIPC', async () => { + const directory = createMockTestDirectory(); + // Simulate steps taken to load a file via a launch event. + const firstFile = directory.files[0]; + loadFile(await createTestImageFile(), firstFile); + // Set `currentDirectoryHandle` in launch.js. + currentDirectoryHandle = directory; + let testResponse; + + // Nothing should be deleted initially. + assertEquals(null, directory.lastDeleted); + + // Test normal rename flow. + const messageRename = {renameLastFile: 'new_file_name.png'}; + testResponse = await guestMessagePipe.sendMessage('test', messageRename); + + assertEquals( + testResponse.testQueryResult, 'renameOriginalFile resolved success'); + // The original file that was renamed got deleted. + assertEquals(firstFile, directory.lastDeleted); + // There is still one file which is the renamed version of the original file. + assertEquals(directory.files.length, 1); + assertEquals(directory.files[0].name, 'new_file_name.png'); + + // Test renaming when a file with the new name already exists. + const messageRenameExists = {renameLastFile: 'new_file_name.png'}; + testResponse = + await guestMessagePipe.sendMessage('test', messageRenameExists); + + assertEquals( + testResponse.testQueryResult, 'renameOriginalFile resolved file exists'); + // No change to the existing file. + assertEquals(directory.files.length, 1); + assertEquals(directory.files[0].name, 'new_file_name.png'); testDone(); });
diff --git a/chromeos/components/sample_system_web_app_ui/BUILD.gn b/chromeos/components/sample_system_web_app_ui/BUILD.gn index f8b398f2..fa36e18 100644 --- a/chromeos/components/sample_system_web_app_ui/BUILD.gn +++ b/chromeos/components/sample_system_web_app_ui/BUILD.gn
@@ -26,14 +26,11 @@ } js_type_check("closure_compile") { - deps = [ ":app" ] + deps = [ ":untrusted" ] } -js_library("app") { - sources = [ - "resources/app.js", - "resources/receiver.js", - ] +js_library("untrusted") { + sources = [ "resources/untrusted.js" ] } js2gtest("browser_tests_js") {
diff --git a/chromeos/components/sample_system_web_app_ui/resources/app.js b/chromeos/components/sample_system_web_app_ui/resources/app.js deleted file mode 100644 index d9c5c512..0000000 --- a/chromeos/components/sample_system_web_app_ui/resources/app.js +++ /dev/null
@@ -1,6 +0,0 @@ -// Copyright 2019 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -var header = document.getElementById('title'); -header.textContent = 'Sample System Web App';
diff --git a/chromeos/components/sample_system_web_app_ui/resources/index.html b/chromeos/components/sample_system_web_app_ui/resources/index.html index 21f71dd..196639a 100644 --- a/chromeos/components/sample_system_web_app_ui/resources/index.html +++ b/chromeos/components/sample_system_web_app_ui/resources/index.html
@@ -4,9 +4,8 @@ <!DOCTYPE html> <meta charset="utf-8"> <title>Sample System Web App</title> -<header id='title'></header> +<header id='title'>Sample System Web App</header> <br> -<a href="/sandbox.html"><button>Untrusted</button></a> +<a href="/sandbox.html"><button>Untrusted Sandbox Demo</button></a> <!-- Below mojo script required to run browser tests --> <script src="chrome://resources/mojo/mojo/public/js/mojo_bindings_lite.js"></script> -<script src='app.js'></script> \ No newline at end of file
diff --git a/chromeos/components/sample_system_web_app_ui/resources/sample_system_web_app_resources.grd b/chromeos/components/sample_system_web_app_ui/resources/sample_system_web_app_resources.grd index e1d9e9d..cc572bc 100644 --- a/chromeos/components/sample_system_web_app_ui/resources/sample_system_web_app_resources.grd +++ b/chromeos/components/sample_system_web_app_ui/resources/sample_system_web_app_resources.grd
@@ -17,14 +17,13 @@ <include name="IDR_SAMPLE_SYSTEM_WEB_APP_INDEX_HTML" file="index.html" type="BINDATA" compress="gzip" /> <include name="IDR_SAMPLE_SYSTEM_WEB_APP_PWA_HTML" file="pwa.html" type="BINDATA" compress="gzip" /> <include name="IDR_SAMPLE_SYSTEM_WEB_APP_SANDBOX_HTML" file="sandbox.html" type="BINDATA" compress="gzip" /> - <include name="IDR_SAMPLE_SYSTEM_WEB_APP_JS" file="app.js" type="BINDATA" compress="gzip" /> <include name="IDR_SAMPLE_SYSTEM_WEB_APP_MANIFEST" file="manifest.json" type="BINDATA" compress="gzip" /> <include name="IDR_SAMPLE_SYSTEM_WEB_APP_ICON_192" file="app_icon_192.png" type="BINDATA" compress="gzip" /> <!-- Untrusted app contents. --> - <include name="IDR_SAMPLE_SYSTEM_WEB_APP_APP_HTML" file="app.html" type="BINDATA" compress="gzip" /> - <include name="IDR_SAMPLE_SYSTEM_WEB_APP_RECEIVER_JS" file="receiver.js" type="BINDATA" compress="gzip" /> + <include name="IDR_SAMPLE_SYSTEM_WEB_APP_UNTRUSTED_HTML" file="untrusted.html" type="BINDATA" compress="gzip" /> + <include name="IDR_SAMPLE_SYSTEM_WEB_APP_UNTRUSTED_JS" file="untrusted.js" type="BINDATA" compress="gzip" /> </if> </includes> </release> -</grit> \ No newline at end of file +</grit>
diff --git a/chromeos/components/sample_system_web_app_ui/resources/sandbox.html b/chromeos/components/sample_system_web_app_ui/resources/sandbox.html index d88ef63..d994131d 100644 --- a/chromeos/components/sample_system_web_app_ui/resources/sandbox.html +++ b/chromeos/components/sample_system_web_app_ui/resources/sandbox.html
@@ -4,6 +4,6 @@ <!DOCTYPE html> <meta charset="utf-8"> <title>Sample System Web App</title> -<iframe src="chrome-untrusted://sample-system-web-app/app.html"></iframe> +<iframe src="chrome-untrusted://sample-system-web-app/untrusted.html"></iframe> <!-- Below mojo script required to run browser tests --> -<script src="chrome://resources/mojo/mojo/public/js/mojo_bindings_lite.js"></script> \ No newline at end of file +<script src="chrome://resources/mojo/mojo/public/js/mojo_bindings_lite.js"></script>
diff --git a/chromeos/components/sample_system_web_app_ui/resources/app.html b/chromeos/components/sample_system_web_app_ui/resources/untrusted.html similarity index 89% rename from chromeos/components/sample_system_web_app_ui/resources/app.html rename to chromeos/components/sample_system_web_app_ui/resources/untrusted.html index 4187d76f..0ad232aa 100644 --- a/chromeos/components/sample_system_web_app_ui/resources/app.html +++ b/chromeos/components/sample_system_web_app_ui/resources/untrusted.html
@@ -6,4 +6,4 @@ <meta charset="utf-8"> <title>Untrusted Sample System Web App</title> <h1 id='untrusted-title'>Sample System Web App</h1> -<script src="receiver.js"></script> \ No newline at end of file +<script src="untrusted.js"></script>
diff --git a/chromeos/components/sample_system_web_app_ui/resources/receiver.js b/chromeos/components/sample_system_web_app_ui/resources/untrusted.js similarity index 99% rename from chromeos/components/sample_system_web_app_ui/resources/receiver.js rename to chromeos/components/sample_system_web_app_ui/resources/untrusted.js index 3df79a56..ba2e7ae9 100644 --- a/chromeos/components/sample_system_web_app_ui/resources/receiver.js +++ b/chromeos/components/sample_system_web_app_ui/resources/untrusted.js
@@ -11,4 +11,4 @@ window.parent.postMessage( {'success': true}, 'chrome://sample-system-web-app'); } -}); \ No newline at end of file +});
diff --git a/chromeos/components/sample_system_web_app_ui/sample_system_web_app_ui.cc b/chromeos/components/sample_system_web_app_ui/sample_system_web_app_ui.cc index 5edbd36..12fc1cd 100644 --- a/chromeos/components/sample_system_web_app_ui/sample_system_web_app_ui.cc +++ b/chromeos/components/sample_system_web_app_ui/sample_system_web_app_ui.cc
@@ -19,10 +19,10 @@ content::WebUIDataSource* CreateUntrustedSampleSystemWebAppDataSource() { content::WebUIDataSource* untrusted_source = content::WebUIDataSource::Create(kChromeUIUntrustedSampleSystemWebAppURL); - untrusted_source->AddResourcePath("app.html", - IDR_SAMPLE_SYSTEM_WEB_APP_APP_HTML); - untrusted_source->AddResourcePath("receiver.js", - IDR_SAMPLE_SYSTEM_WEB_APP_RECEIVER_JS); + untrusted_source->AddResourcePath("untrusted.html", + IDR_SAMPLE_SYSTEM_WEB_APP_UNTRUSTED_HTML); + untrusted_source->AddResourcePath("untrusted.js", + IDR_SAMPLE_SYSTEM_WEB_APP_UNTRUSTED_JS); untrusted_source->AddFrameAncestor(GURL(kChromeUISampleSystemWebAppURL)); return untrusted_source; } @@ -37,7 +37,6 @@ IDR_SAMPLE_SYSTEM_WEB_APP_PWA_HTML); trusted_source->AddResourcePath("sandbox.html", IDR_SAMPLE_SYSTEM_WEB_APP_SANDBOX_HTML); - trusted_source->AddResourcePath("app.js", IDR_SAMPLE_SYSTEM_WEB_APP_JS); trusted_source->AddResourcePath("manifest.json", IDR_SAMPLE_SYSTEM_WEB_APP_MANIFEST); trusted_source->AddResourcePath("app_icon_192.png",
diff --git a/chromeos/components/sync_wifi/network_type_conversions.cc b/chromeos/components/sync_wifi/network_type_conversions.cc index d23c1a5..f8ca3c0e 100644 --- a/chromeos/components/sync_wifi/network_type_conversions.cc +++ b/chromeos/components/sync_wifi/network_type_conversions.cc
@@ -82,7 +82,7 @@ return sync_pb::WifiConfigurationSpecifics::AUTOMATICALLY_CONNECT_ENABLED; } - return sync_pb::WifiConfigurationSpecifics::AUTOMATICALLY_CONNECT_ENABLED; + return sync_pb::WifiConfigurationSpecifics::AUTOMATICALLY_CONNECT_DISABLED; } sync_pb::WifiConfigurationSpecifics_IsPreferredOption IsPreferredProtoFromMojo(
diff --git a/chromeos/constants/chromeos_features.cc b/chromeos/constants/chromeos_features.cc index ad52f00..cde1a2e 100644 --- a/chromeos/constants/chromeos_features.cc +++ b/chromeos/constants/chromeos_features.cc
@@ -16,6 +16,11 @@ } // namespace +// Shows settings for adjusting scroll acceleration/sensitivity for +// mouse/touchpad. +const base::Feature kAllowScrollSettings{"AllowScrollSettings", + base::FEATURE_DISABLED_BY_DEFAULT}; + // Controls whether to enable Ambient mode feature. const base::Feature kAmbientModeFeature{"ChromeOSAmbientMode", base::FEATURE_DISABLED_BY_DEFAULT}; @@ -87,7 +92,7 @@ // Enables the option to share the mic with Crostini or not const base::Feature kCrostiniShowMicSetting{"CrostiniShowMicSetting", - base::FEATURE_ENABLED_BY_DEFAULT}; + base::FEATURE_DISABLED_BY_DEFAULT}; // Enables or disables Crostini GPU support. const base::Feature kCrostiniGpuSupport{"CrostiniGpuSupport", @@ -249,6 +254,10 @@ const base::Feature kQuickAnswersRichUi{"QuickAnswersRichUi", base::FEATURE_DISABLED_BY_DEFAULT}; +// Controls whether dogfood version of quick answers. +const base::Feature kQuickAnswersDogfood{"QuickAnswersDogfood", + base::FEATURE_DISABLED_BY_DEFAULT}; + // ChromeOS Files App mounts RAR archives via rar2fs instead of avfs. // https://crbug.com/996549 const base::Feature kRar2Fs{"Rar2Fs", base::FEATURE_ENABLED_BY_DEFAULT}; @@ -287,7 +296,7 @@ // Shows the Play Store icon in Demo Mode. const base::Feature kShowPlayInDemoMode{"ShowPlayInDemoMode", - base::FEATURE_DISABLED_BY_DEFAULT}; + base::FEATURE_ENABLED_BY_DEFAULT}; // Shows the progress bar during Demo Mode setup. const base::Feature kShowProgressBarInDemoModeSetup{ @@ -386,6 +395,10 @@ return base::FeatureList::IsEnabled(kParentalControlsSettings); } +bool IsQuickAnswersDogfood() { + return base::FeatureList::IsEnabled(kQuickAnswersDogfood); +} + bool IsQuickAnswersEnabled() { return base::FeatureList::IsEnabled(kQuickAnswers); }
diff --git a/chromeos/constants/chromeos_features.h b/chromeos/constants/chromeos_features.h index 63592c8..2dbed49 100644 --- a/chromeos/constants/chromeos_features.h +++ b/chromeos/constants/chromeos_features.h
@@ -16,6 +16,8 @@ // being rolled out via Finch, add a comment in the .cc file. COMPONENT_EXPORT(CHROMEOS_CONSTANTS) +extern const base::Feature kAllowScrollSettings; +COMPONENT_EXPORT(CHROMEOS_CONSTANTS) extern const base::Feature kAmbientModeFeature; COMPONENT_EXPORT(CHROMEOS_CONSTANTS) extern const base::Feature kArcAdbSideloadingFeature; @@ -110,12 +112,14 @@ extern const base::Feature kPluginVmShowCameraSetting; COMPONENT_EXPORT(CHROMEOS_CONSTANTS) extern const base::Feature kPrintJobManagementApp; -COMPONENT_EXPORT(CHROMEOS_CONSTANTS) extern const base::Feature kQuickAnswers; -COMPONENT_EXPORT(CHROMEOS_CONSTANTS) extern const base::Feature kRar2Fs; COMPONENT_EXPORT(CHROMEOS_CONSTANTS) extern const base::Feature kPrinterStatus; +COMPONENT_EXPORT(CHROMEOS_CONSTANTS) extern const base::Feature kQuickAnswers; +COMPONENT_EXPORT(CHROMEOS_CONSTANTS) +extern const base::Feature kQuickAnswersDogfood; COMPONENT_EXPORT(CHROMEOS_CONSTANTS) extern const base::Feature kQuickAnswersRichUi; +COMPONENT_EXPORT(CHROMEOS_CONSTANTS) extern const base::Feature kRar2Fs; COMPONENT_EXPORT(CHROMEOS_CONSTANTS) extern const base::Feature kReleaseNotes; COMPONENT_EXPORT(CHROMEOS_CONSTANTS) @@ -172,6 +176,7 @@ COMPONENT_EXPORT(CHROMEOS_CONSTANTS) bool IsInstantTetheringBackgroundAdvertisingSupported(); COMPONENT_EXPORT(CHROMEOS_CONSTANTS) bool IsParentalControlsSettingsEnabled(); +COMPONENT_EXPORT(CHROMEOS_CONSTANTS) bool IsQuickAnswersDogfood(); COMPONENT_EXPORT(CHROMEOS_CONSTANTS) bool IsQuickAnswersEnabled(); COMPONENT_EXPORT(CHROMEOS_CONSTANTS) bool IsQuickAnswersRichUiEnabled(); COMPONENT_EXPORT(CHROMEOS_CONSTANTS) bool IsSplitSettingsSyncEnabled();
diff --git a/chromeos/network/network_metadata_store.cc b/chromeos/network/network_metadata_store.cc index f873333..3100a15 100644 --- a/chromeos/network/network_metadata_store.cc +++ b/chromeos/network/network_metadata_store.cc
@@ -92,7 +92,12 @@ } SetPref(guid, kIsFromSync, base::Value(false)); - SetPref(guid, kLastConnectedTimestampPref, base::Value(0)); + + // Only clear last connected if the passphrase changes. Other settings + // (autoconnect, dns, etc.) won't affect the ability to connect to a network. + if (set_properties->HasKey(shill::kPassphraseProperty)) { + SetPref(guid, kLastConnectedTimestampPref, base::Value(0)); + } } void NetworkMetadataStore::OnConfigurationRemoved(
diff --git a/chromeos/profiles/airmont.afdo.newest.txt b/chromeos/profiles/airmont.afdo.newest.txt index 7a9fe22..1ce0e89 100644 --- a/chromeos/profiles/airmont.afdo.newest.txt +++ b/chromeos/profiles/airmont.afdo.newest.txt
@@ -1 +1 @@ -chromeos-chrome-amd64-airmont-83-4085.6-1584959535-benchmark-83.0.4097.3-r1-redacted.afdo.xz \ No newline at end of file +chromeos-chrome-amd64-airmont-83-4091.0-1585565910-benchmark-83.0.4099.3-r1-redacted.afdo.xz \ No newline at end of file
diff --git a/chromeos/profiles/broadwell.afdo.newest.txt b/chromeos/profiles/broadwell.afdo.newest.txt index 98f271a..37bdc7a 100644 --- a/chromeos/profiles/broadwell.afdo.newest.txt +++ b/chromeos/profiles/broadwell.afdo.newest.txt
@@ -1 +1 @@ -chromeos-chrome-amd64-broadwell-83-4085.6-1585564150-benchmark-83.0.4097.3-r1-redacted.afdo.xz \ No newline at end of file +chromeos-chrome-amd64-broadwell-83-4085.6-1585564150-benchmark-83.0.4099.3-r1-redacted.afdo.xz \ No newline at end of file
diff --git a/chromeos/profiles/orderfile.newest.txt b/chromeos/profiles/orderfile.newest.txt index 6e0e388..b904978 100644 --- a/chromeos/profiles/orderfile.newest.txt +++ b/chromeos/profiles/orderfile.newest.txt
@@ -1 +1 @@ -chromeos-chrome-orderfile-field-83-4085.6-1584956258-benchmark-83.0.4091.0-r2.orderfile.xz \ No newline at end of file +chromeos-chrome-orderfile-field-83-4085.6-1584956258-benchmark-83.0.4097.3-r1.orderfile.xz \ No newline at end of file
diff --git a/chromeos/profiles/silvermont.afdo.newest.txt b/chromeos/profiles/silvermont.afdo.newest.txt index c88ada9..37024c5 100644 --- a/chromeos/profiles/silvermont.afdo.newest.txt +++ b/chromeos/profiles/silvermont.afdo.newest.txt
@@ -1 +1 @@ -chromeos-chrome-amd64-silvermont-83-4085.6-1584956258-benchmark-83.0.4097.3-r1-redacted.afdo.xz \ No newline at end of file +chromeos-chrome-amd64-silvermont-83-4091.0-1585562740-benchmark-83.0.4099.3-r1-redacted.afdo.xz \ No newline at end of file
diff --git a/chromeos/services/cellular_setup/ota_activator_impl.cc b/chromeos/services/cellular_setup/ota_activator_impl.cc index 2f50622..6ab35d5c 100644 --- a/chromeos/services/cellular_setup/ota_activator_impl.cc +++ b/chromeos/services/cellular_setup/ota_activator_impl.cc
@@ -221,9 +221,9 @@ NET_LOG(DEBUG) << "No SIM detected; restarting modem."; ShillDeviceClient::Get()->Reset( dbus::ObjectPath(cellular_device->path()), - base::Bind(&OtaActivatorImpl::AttemptNextActivationStep, - weak_ptr_factory_.GetWeakPtr()), - base::Bind(&OnModemResetError)); + base::BindOnce(&OtaActivatorImpl::AttemptNextActivationStep, + weak_ptr_factory_.GetWeakPtr()), + base::BindOnce(&OnModemResetError)); return; }
diff --git a/chromeos/services/device_sync/cryptauth_device_syncer_impl.cc b/chromeos/services/device_sync/cryptauth_device_syncer_impl.cc index bca41393..97a14dc 100644 --- a/chromeos/services/device_sync/cryptauth_device_syncer_impl.cc +++ b/chromeos/services/device_sync/cryptauth_device_syncer_impl.cc
@@ -256,8 +256,8 @@ request_context_, local_better_together_device_metadata_, key_registry_->GetActiveKey( CryptAuthKeyBundle::Name::kDeviceSyncBetterTogetherGroupKey), - base::Bind(&CryptAuthDeviceSyncerImpl::OnSyncMetadataFinished, - base::Unretained(this))); + base::BindOnce(&CryptAuthDeviceSyncerImpl::OnSyncMetadataFinished, + base::Unretained(this))); } void CryptAuthDeviceSyncerImpl::OnSyncMetadataFinished( @@ -346,8 +346,8 @@ CryptAuthFeatureStatusGetterImpl::Factory::Create(client_factory_); feature_status_getter_->GetFeatureStatuses( request_context_, device_ids, - base::Bind(&CryptAuthDeviceSyncerImpl::OnGetFeatureStatusesFinished, - base::Unretained(this))); + base::BindOnce(&CryptAuthDeviceSyncerImpl::OnGetFeatureStatusesFinished, + base::Unretained(this))); } void CryptAuthDeviceSyncerImpl::OnGetFeatureStatusesFinished( @@ -651,8 +651,8 @@ CryptAuthGroupPrivateKeySharerImpl::Factory::Create(client_factory_); group_private_key_sharer_->ShareGroupPrivateKey( request_context_, *group_key, id_to_encrypting_key_map, - base::Bind(&CryptAuthDeviceSyncerImpl::OnShareGroupPrivateKeyFinished, - base::Unretained(this))); + base::BindOnce(&CryptAuthDeviceSyncerImpl::OnShareGroupPrivateKeyFinished, + base::Unretained(this))); } void CryptAuthDeviceSyncerImpl::OnShareGroupPrivateKeyFinished(
diff --git a/chromeos/services/device_sync/cryptauth_gcm_manager_impl.cc b/chromeos/services/device_sync/cryptauth_gcm_manager_impl.cc index 9cdee053..4701078 100644 --- a/chromeos/services/device_sync/cryptauth_gcm_manager_impl.cc +++ b/chromeos/services/device_sync/cryptauth_gcm_manager_impl.cc
@@ -256,8 +256,8 @@ std::vector<std::string> sender_ids(1, kCryptAuthGcmSenderId); gcm_driver_->Register( kCryptAuthGcmAppId, sender_ids, - base::Bind(&CryptAuthGCMManagerImpl::OnRegistrationCompleted, - weak_ptr_factory_.GetWeakPtr())); + base::BindOnce(&CryptAuthGCMManagerImpl::OnRegistrationCompleted, + weak_ptr_factory_.GetWeakPtr())); } std::string CryptAuthGCMManagerImpl::GetRegistrationId() {
diff --git a/chromeos/services/device_sync/device_sync_impl.cc b/chromeos/services/device_sync/device_sync_impl.cc index 992615c3..6465206 100644 --- a/chromeos/services/device_sync/device_sync_impl.cc +++ b/chromeos/services/device_sync/device_sync_impl.cc
@@ -617,10 +617,10 @@ device_notifier_->NotifyDevices( device_instance_ids, target_service, CryptAuthFeatureTypeFromSoftwareFeature(feature), - base::Bind(&DeviceSyncImpl::OnNotifyDevicesSuccess, - weak_ptr_factory_.GetWeakPtr(), request_id), - base::Bind(&DeviceSyncImpl::OnNotifyDevicesError, - weak_ptr_factory_.GetWeakPtr(), request_id)); + base::BindOnce(&DeviceSyncImpl::OnNotifyDevicesSuccess, + weak_ptr_factory_.GetWeakPtr(), request_id), + base::BindOnce(&DeviceSyncImpl::OnNotifyDevicesError, + weak_ptr_factory_.GetWeakPtr(), request_id)); } void DeviceSyncImpl::GetDevicesActivityStatus( @@ -645,10 +645,10 @@ cryptauth_gcm_manager_.get()); cryptauth_device_activity_getter_->GetDevicesActivityStatus( - base::Bind(&DeviceSyncImpl::OnGetDevicesActivityStatusFinished, - weak_ptr_factory_.GetWeakPtr(), request_id), - base::Bind(&DeviceSyncImpl::OnGetDevicesActivityStatusError, - weak_ptr_factory_.GetWeakPtr(), request_id)); + base::BindOnce(&DeviceSyncImpl::OnGetDevicesActivityStatusFinished, + weak_ptr_factory_.GetWeakPtr(), request_id), + base::BindOnce(&DeviceSyncImpl::OnGetDevicesActivityStatusError, + weak_ptr_factory_.GetWeakPtr(), request_id)); } void DeviceSyncImpl::GetDebugInfo(GetDebugInfoCallback callback) { @@ -1121,8 +1121,8 @@ void DeviceSyncImpl::StartSetSoftwareFeatureTimer() { set_software_feature_timer_->Start( FROM_HERE, kSetFeatureEnabledTimeout, - base::Bind(&DeviceSyncImpl::OnSetSoftwareFeatureTimerFired, - base::Unretained(this))); + base::BindOnce(&DeviceSyncImpl::OnSetSoftwareFeatureTimerFired, + base::Unretained(this))); } void DeviceSyncImpl::OnSetSoftwareFeatureTimerFired() {
diff --git a/chromeos/services/device_sync/device_sync_service_unittest.cc b/chromeos/services/device_sync/device_sync_service_unittest.cc index ae260e7..9cf7e4d4 100644 --- a/chromeos/services/device_sync/device_sync_service_unittest.cc +++ b/chromeos/services/device_sync/device_sync_service_unittest.cc
@@ -1252,9 +1252,9 @@ if (!manager) { device_sync_->SetSoftwareFeatureState( public_key, software_feature, enabled, is_exclusive, - base::Bind(&DeviceSyncServiceTest:: - OnSetSoftwareFeatureStateCompletedSynchronously, - base::Unretained(this), run_loop.QuitClosure())); + base::BindOnce(&DeviceSyncServiceTest:: + OnSetSoftwareFeatureStateCompletedSynchronously, + base::Unretained(this), run_loop.QuitClosure())); run_loop.Run(); return; } @@ -1265,8 +1265,9 @@ device_sync_->SetSoftwareFeatureState( public_key, software_feature, enabled, is_exclusive, - base::Bind(&DeviceSyncServiceTest::OnSetSoftwareFeatureStateCompleted, - base::Unretained(this))); + base::BindOnce( + &DeviceSyncServiceTest::OnSetSoftwareFeatureStateCompleted, + base::Unretained(this))); run_loop.Run(); fake_software_feature_manager_factory_->instance()->set_delegate(nullptr); @@ -1295,9 +1296,9 @@ if (!manager) { device_sync_->FindEligibleDevices( software_feature, - base::Bind(&DeviceSyncServiceTest:: - OnFindEligibleDevicesCompletedSynchronously, - base::Unretained(this), run_loop.QuitClosure())); + base::BindOnce(&DeviceSyncServiceTest:: + OnFindEligibleDevicesCompletedSynchronously, + base::Unretained(this), run_loop.QuitClosure())); run_loop.Run(); return; } @@ -1308,8 +1309,8 @@ device_sync_->FindEligibleDevices( software_feature, - base::Bind(&DeviceSyncServiceTest::OnFindEligibleDevicesCompleted, - base::Unretained(this))); + base::BindOnce(&DeviceSyncServiceTest::OnFindEligibleDevicesCompleted, + base::Unretained(this))); run_loop.Run(); fake_software_feature_manager_factory_->instance()->set_delegate(nullptr); @@ -1326,7 +1327,7 @@ if (!fake_device_notifier()) { device_sync_->NotifyDevices( device_instance_ids, target_service, feature, - base::Bind( + base::BindOnce( &DeviceSyncServiceTest::OnNotifyDevicesCompletedSynchronously, base::Unretained(this), run_loop.QuitClosure())); run_loop.Run(); @@ -1337,8 +1338,8 @@ fake_device_notifier()->set_delegate(&delegate); device_sync_->NotifyDevices( device_instance_ids, target_service, feature, - base::Bind(&DeviceSyncServiceTest::OnNotifyDevicesCompleted, - base::Unretained(this))); + base::BindOnce(&DeviceSyncServiceTest::OnNotifyDevicesCompleted, + base::Unretained(this))); run_loop.Run(); fake_device_notifier()->set_delegate(nullptr); } @@ -1370,7 +1371,7 @@ if (!manager) { device_sync_->SetFeatureStatus( device_instance_id, software_feature, status_change, - base::Bind( + base::BindOnce( &DeviceSyncServiceTest::OnSetFeatureStatusCompletedSynchronously, base::Unretained(this), run_loop.QuitClosure())); run_loop.Run(); @@ -1383,8 +1384,8 @@ device_sync_->SetFeatureStatus( device_instance_id, software_feature, status_change, - base::Bind(&DeviceSyncServiceTest::OnSetFeatureStatusCompleted, - base::Unretained(this))); + base::BindOnce(&DeviceSyncServiceTest::OnSetFeatureStatusCompleted, + base::Unretained(this))); run_loop.Run(); fake_software_feature_manager_factory_->instance()->set_delegate(nullptr); @@ -1402,7 +1403,7 @@ if (!fake_feature_status_setter()) { device_sync_->SetFeatureStatus( device_instance_id, software_feature, status_change, - base::Bind( + base::BindOnce( &DeviceSyncServiceTest::OnSetFeatureStatusCompletedSynchronously, base::Unretained(this), run_loop.QuitClosure())); run_loop.Run(); @@ -1413,8 +1414,8 @@ fake_feature_status_setter()->set_delegate(&delegate); device_sync_->SetFeatureStatus( device_instance_id, software_feature, status_change, - base::Bind(&DeviceSyncServiceTest::OnSetFeatureStatusCompleted, - base::Unretained(this))); + base::BindOnce(&DeviceSyncServiceTest::OnSetFeatureStatusCompleted, + base::Unretained(this))); run_loop.Run(); fake_feature_status_setter()->set_delegate(nullptr);
diff --git a/chromeos/services/device_sync/remote_device_provider_impl.cc b/chromeos/services/device_sync/remote_device_provider_impl.cc index 3fd7ecf..ab62e245 100644 --- a/chromeos/services/device_sync/remote_device_provider_impl.cc +++ b/chromeos/services/device_sync/remote_device_provider_impl.cc
@@ -155,8 +155,8 @@ remote_device_v2_loader_ = RemoteDeviceV2LoaderImpl::Factory::Create(); remote_device_v2_loader_->Load( v2_device_manager_->GetSyncedDevices(), user_email_, user_private_key_, - base::Bind(&RemoteDeviceProviderImpl::OnV2RemoteDevicesLoaded, - weak_ptr_factory_.GetWeakPtr())); + base::BindOnce(&RemoteDeviceProviderImpl::OnV2RemoteDevicesLoaded, + weak_ptr_factory_.GetWeakPtr())); } void RemoteDeviceProviderImpl::OnV1RemoteDevicesLoaded(
diff --git a/chromeos/services/multidevice_setup/eligible_host_devices_provider_impl.cc b/chromeos/services/multidevice_setup/eligible_host_devices_provider_impl.cc index 1d2aaaa8..1984d95 100644 --- a/chromeos/services/multidevice_setup/eligible_host_devices_provider_impl.cc +++ b/chromeos/services/multidevice_setup/eligible_host_devices_provider_impl.cc
@@ -96,9 +96,9 @@ if (base::FeatureList::IsEnabled( features::kCryptAuthV2DeviceActivityStatus)) { - device_sync_client_->GetDevicesActivityStatus( - base::Bind(&EligibleHostDevicesProviderImpl::OnGetDevicesActivityStatus, - base::Unretained(this))); + device_sync_client_->GetDevicesActivityStatus(base::BindOnce( + &EligibleHostDevicesProviderImpl::OnGetDevicesActivityStatus, + base::Unretained(this))); } }
diff --git a/chromeos/services/multidevice_setup/host_backend_delegate_impl.cc b/chromeos/services/multidevice_setup/host_backend_delegate_impl.cc index cb65464..0f0d381 100644 --- a/chromeos/services/multidevice_setup/host_backend_delegate_impl.cc +++ b/chromeos/services/multidevice_setup/host_backend_delegate_impl.cc
@@ -391,10 +391,10 @@ if (failed_request_was_to_set_pending_host || failed_request_was_to_remove_pending_host) { NotifyBackendRequestFailed(); - timer_->Start(FROM_HERE, - base::TimeDelta::FromMinutes(kNumMinutesBetweenRetries), - base::Bind(&HostBackendDelegateImpl::AttemptNetworkRequest, - base::Unretained(this), true /* is_retry */)); + timer_->Start( + FROM_HERE, base::TimeDelta::FromMinutes(kNumMinutesBetweenRetries), + base::BindOnce(&HostBackendDelegateImpl::AttemptNetworkRequest, + base::Unretained(this), true /* is_retry */)); } }
diff --git a/chromeos/services/multidevice_setup/host_verifier_impl.cc b/chromeos/services/multidevice_setup/host_verifier_impl.cc index 155aecd0..e22cc7dd 100644 --- a/chromeos/services/multidevice_setup/host_verifier_impl.cc +++ b/chromeos/services/multidevice_setup/host_verifier_impl.cc
@@ -250,9 +250,9 @@ base::Time now = clock_->Now(); DCHECK(now < time_to_fire); - retry_timer_->Start( - FROM_HERE, time_to_fire - now /* delay */, - base::Bind(&HostVerifierImpl::UpdateRetryState, base::Unretained(this))); + retry_timer_->Start(FROM_HERE, time_to_fire - now /* delay */, + base::BindOnce(&HostVerifierImpl::UpdateRetryState, + base::Unretained(this))); } void HostVerifierImpl::AttemptHostVerification() { @@ -308,9 +308,9 @@ // receive this message (see https://crbug.com/913816). Thus, schedule a sync // after the phone has had enough time to enable its features. Note that this // sync is canceled if the Chromebook does receive the push message. - sync_timer_->Start( - FROM_HERE, kSyncDelay, - base::Bind(&HostVerifierImpl::OnSyncTimerFired, base::Unretained(this))); + sync_timer_->Start(FROM_HERE, kSyncDelay, + base::BindOnce(&HostVerifierImpl::OnSyncTimerFired, + base::Unretained(this))); } void HostVerifierImpl::OnNotifyDevicesFinished( @@ -328,9 +328,9 @@ // receive this message (see https://crbug.com/913816). Thus, schedule a sync // after the phone has had enough time to enable its features. Note that this // sync is canceled if the Chromebook does receive the push message. - sync_timer_->Start( - FROM_HERE, kSyncDelay, - base::Bind(&HostVerifierImpl::OnSyncTimerFired, base::Unretained(this))); + sync_timer_->Start(FROM_HERE, kSyncDelay, + base::BindOnce(&HostVerifierImpl::OnSyncTimerFired, + base::Unretained(this))); } void HostVerifierImpl::OnSyncTimerFired() {
diff --git a/chromeos/services/network_config/cros_network_config.cc b/chromeos/services/network_config/cros_network_config.cc index c24507525..3d2f5fd 100644 --- a/chromeos/services/network_config/cros_network_config.cc +++ b/chromeos/services/network_config/cros_network_config.cc
@@ -1827,8 +1827,8 @@ network_configuration_handler_->GetManagedProperties( chromeos::LoginState::Get()->primary_user_hash(), network->path(), - base::Bind(&CrosNetworkConfig::GetManagedPropertiesSuccess, - weak_factory_.GetWeakPtr(), callback_id), + base::BindOnce(&CrosNetworkConfig::GetManagedPropertiesSuccess, + weak_factory_.GetWeakPtr(), callback_id), base::Bind(&CrosNetworkConfig::GetManagedPropertiesFailure, weak_factory_.GetWeakPtr(), guid, callback_id)); } @@ -1876,8 +1876,8 @@ managed_properties_[callback_id] = std::move(managed_properties); network_configuration_handler_->GetManagedProperties( chromeos::LoginState::Get()->primary_user_hash(), eap_state->path(), - base::Bind(&CrosNetworkConfig::GetManagedPropertiesSuccessEap, - weak_factory_.GetWeakPtr(), callback_id), + base::BindOnce(&CrosNetworkConfig::GetManagedPropertiesSuccessEap, + weak_factory_.GetWeakPtr(), callback_id), base::Bind(&CrosNetworkConfig::GetManagedPropertiesSuccessNoEap, weak_factory_.GetWeakPtr(), callback_id)); } @@ -2372,8 +2372,8 @@ network_connection_handler_->ConnectToNetwork( service_path, - base::Bind(&CrosNetworkConfig::StartConnectSuccess, - weak_factory_.GetWeakPtr(), callback_id), + base::BindOnce(&CrosNetworkConfig::StartConnectSuccess, + weak_factory_.GetWeakPtr(), callback_id), base::Bind(&CrosNetworkConfig::StartConnectFailure, weak_factory_.GetWeakPtr(), callback_id), true /* check_error_state */, chromeos::ConnectCallbackMode::ON_STARTED); @@ -2434,8 +2434,8 @@ network_connection_handler_->DisconnectNetwork( service_path, - base::Bind(&CrosNetworkConfig::StartDisconnectSuccess, - weak_factory_.GetWeakPtr(), callback_id), + base::BindOnce(&CrosNetworkConfig::StartDisconnectSuccess, + weak_factory_.GetWeakPtr(), callback_id), base::Bind(&CrosNetworkConfig::StartDisconnectFailure, weak_factory_.GetWeakPtr(), callback_id)); }
diff --git a/chromeos/services/secure_channel/ble_advertiser_impl.cc b/chromeos/services/secure_channel/ble_advertiser_impl.cc index 64f4231..f139f672 100644 --- a/chromeos/services/secure_channel/ble_advertiser_impl.cc +++ b/chromeos/services/secure_channel/ble_advertiser_impl.cc
@@ -274,7 +274,7 @@ timer->Start( FROM_HERE, base::TimeDelta::FromSeconds(kNumSecondsPerAdvertisementTimeslot), - base::Bind( + base::BindOnce( &BleAdvertiserImpl::StopAdvertisementRequestAndUpdateActiveRequests, base::Unretained(this), index_to_add, false /* replaced_by_higher_priority_advertisement */,
diff --git a/chromeos/services/secure_channel/ble_scanner_impl.cc b/chromeos/services/secure_channel/ble_scanner_impl.cc index 1edbcc62e..fd2345d 100644 --- a/chromeos/services/secure_channel/ble_scanner_impl.cc +++ b/chromeos/services/secure_channel/ble_scanner_impl.cc
@@ -132,8 +132,8 @@ is_initializing_discovery_session_ = true; ble_synchronizer_->StartDiscoverySession( - base::Bind(&BleScannerImpl::OnDiscoverySessionStarted, - weak_ptr_factory_.GetWeakPtr()), + base::BindOnce(&BleScannerImpl::OnDiscoverySessionStarted, + weak_ptr_factory_.GetWeakPtr()), base::Bind(&BleScannerImpl::OnStartDiscoverySessionError, weak_ptr_factory_.GetWeakPtr())); }
diff --git a/chromeos/services/secure_channel/ble_synchronizer.cc b/chromeos/services/secure_channel/ble_synchronizer.cc index f9b4b72..9a46515 100644 --- a/chromeos/services/secure_channel/ble_synchronizer.cc +++ b/chromeos/services/secure_channel/ble_synchronizer.cc
@@ -72,8 +72,8 @@ base::TimeDelta::FromMilliseconds(kTimeBetweenEachCommandMs)) { timer_->Start(FROM_HERE, base::TimeDelta::FromMilliseconds(kTimeBetweenEachCommandMs), - base::Bind(&BleSynchronizer::ProcessQueue, - weak_ptr_factory_.GetWeakPtr())); + base::BindOnce(&BleSynchronizer::ProcessQueue, + weak_ptr_factory_.GetWeakPtr())); return; }
diff --git a/chromeos/services/secure_channel/ble_synchronizer_unittest.cc b/chromeos/services/secure_channel/ble_synchronizer_unittest.cc index 783d0bc..b8b2408 100644 --- a/chromeos/services/secure_channel/ble_synchronizer_unittest.cc +++ b/chromeos/services/secure_channel/ble_synchronizer_unittest.cc
@@ -324,8 +324,9 @@ void StartDiscoverySession() { synchronizer_->StartDiscoverySession( - base::Bind(&SecureChannelBleSynchronizerTest::OnDiscoverySessionStarted, - base::Unretained(this)), + base::BindOnce( + &SecureChannelBleSynchronizerTest::OnDiscoverySessionStarted, + base::Unretained(this)), base::Bind( &SecureChannelBleSynchronizerTest::OnErrorStartingDiscoverySession, base::Unretained(this)));
diff --git a/chromeos/services/secure_channel/ble_weave_client_connection.cc b/chromeos/services/secure_channel/ble_weave_client_connection.cc index 8d85d7c0..8bf8143 100644 --- a/chromeos/services/secure_channel/ble_weave_client_connection.cc +++ b/chromeos/services/secure_channel/ble_weave_client_connection.cc
@@ -229,10 +229,10 @@ PA_LOG(INFO) << "Creating GATT connection with " << GetDeviceInfoLogString() << "."; bluetooth_device->CreateGattConnection( - base::Bind( + base::BindOnce( &BluetoothLowEnergyWeaveClientConnection::OnGattConnectionCreated, weak_ptr_factory_.GetWeakPtr()), - base::Bind( + base::BindOnce( &BluetoothLowEnergyWeaveClientConnection::OnCreateGattConnectionError, weak_ptr_factory_.GetWeakPtr())); } @@ -612,11 +612,12 @@ PA_LOG(INFO) << "Starting notification session for " << GetDeviceInfoLogString() << "."; characteristic->StartNotifySession( - base::Bind( + base::BindOnce( &BluetoothLowEnergyWeaveClientConnection::OnNotifySessionStarted, weak_ptr_factory_.GetWeakPtr()), - base::Bind(&BluetoothLowEnergyWeaveClientConnection::OnNotifySessionError, - weak_ptr_factory_.GetWeakPtr())); + base::BindOnce( + &BluetoothLowEnergyWeaveClientConnection::OnNotifySessionError, + weak_ptr_factory_.GetWeakPtr())); } void BluetoothLowEnergyWeaveClientConnection::OnNotifySessionStarted( @@ -693,12 +694,12 @@ characteristic->WriteRemoteCharacteristic( pending_write_request_->value, - base::Bind(&BluetoothLowEnergyWeaveClientConnection:: - OnRemoteCharacteristicWritten, - weak_ptr_factory_.GetWeakPtr()), - base::Bind(&BluetoothLowEnergyWeaveClientConnection:: - OnWriteRemoteCharacteristicError, - weak_ptr_factory_.GetWeakPtr())); + base::BindOnce(&BluetoothLowEnergyWeaveClientConnection:: + OnRemoteCharacteristicWritten, + weak_ptr_factory_.GetWeakPtr()), + base::BindOnce(&BluetoothLowEnergyWeaveClientConnection:: + OnWriteRemoteCharacteristicError, + weak_ptr_factory_.GetWeakPtr())); } void BluetoothLowEnergyWeaveClientConnection::OnRemoteCharacteristicWritten() {
diff --git a/components/arc/mojom/accessibility_helper.mojom b/components/arc/mojom/accessibility_helper.mojom index 1bf45f17..1092b14 100644 --- a/components/arc/mojom/accessibility_helper.mojom +++ b/components/arc/mojom/accessibility_helper.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: 21 +// Next MinVersion: 22 module arc.mojom; @@ -329,6 +329,32 @@ SURFACE_REMOVED, }; +// These fields are taken from int attributes of +// AccessibilityEvent and AccessibilityRecord. +[Extensible] +enum AccessibilityEventIntProperty { + ACTION, + FROM_INDEX, + TO_INDEX, + ITEM_COUNT, + CURRENT_ITEM_INDEX, + SCROLL_X, + SCROLL_Y, + MAX_SCROLL_X, + MAX_SCROLL_Y, + SCROLL_DELTA_X, + SCROLL_DELTA_Y, +}; + +// These fields are taken from string attributes of +// AccessibilityEvent and AccessibilityRecord. +[Extensible] +enum AccessibilityEventStringProperty { + CLASS_NAME, + PACKAGE_NAME, + CONTENT_DESCRIPTION, +}; + // AccessibilityEventData is a struct to contain info of // AccessibilityEvent in Android. // https://developer.android.com/reference/android/view/accessibility/AccessibilityEvent.html @@ -360,6 +386,10 @@ // Retrieved from AccessibilityRecord.getText(). [MinVersion=15] array<string>? event_text; + + [MinVersion=21] map<AccessibilityEventIntProperty, int32>? int_properties; + [MinVersion=21] + map<AccessibilityEventStringProperty, string>? string_properties; }; // AccessibilityActionData is a struct to contain info of AccessibilityAction in
diff --git a/components/arc/mojom/intent_helper.mojom b/components/arc/mojom/intent_helper.mojom index fc676f6..114c21f 100644 --- a/components/arc/mojom/intent_helper.mojom +++ b/components/arc/mojom/intent_helper.mojom
@@ -173,8 +173,10 @@ AMBIENTMODE, PLUGINVMDETAILS, PLUGINVMSHAREDPATHS, + OSRESET, + OSACCESSIBILITY, - LAST = PLUGINVMSHAREDPATHS, + LAST = OSACCESSIBILITY, }; // Describes an unique chrome app.
diff --git a/components/autofill/android/autofill_provider_android.cc b/components/autofill/android/autofill_provider_android.cc index 1a6f12c..7612937 100644 --- a/components/autofill/android/autofill_provider_android.cc +++ b/components/autofill/android/autofill_provider_android.cc
@@ -11,6 +11,7 @@ #include "base/android/jni_string.h" #include "components/autofill/android/form_data_android.h" #include "components/autofill/android/jni_headers/AutofillProvider_jni.h" +#include "components/autofill/core/browser/autofill_driver.h" #include "components/autofill/core/browser/autofill_handler_proxy.h" #include "components/autofill/core/common/autofill_constants.h" #include "content/public/browser/browser_thread.h" @@ -103,7 +104,10 @@ if (obj.is_null()) return; - form_ = std::make_unique<FormDataAndroid>(form); + form_ = std::make_unique<FormDataAndroid>( + form, base::BindRepeating( + &AutofillDriver::TransformBoundingBoxToViewportCoordinates, + base::Unretained(handler->driver()))); size_t index; if (!form_->GetFieldIndex(field, &index)) {
diff --git a/components/autofill/android/form_data_android.cc b/components/autofill/android/form_data_android.cc index 7b344ea..6746368 100644 --- a/components/autofill/android/form_data_android.cc +++ b/components/autofill/android/form_data_android.cc
@@ -19,8 +19,12 @@ namespace autofill { -FormDataAndroid::FormDataAndroid(const FormData& form) - : form_(form), index_(0) {} +FormDataAndroid::FormDataAndroid(const FormData& form, + const TransformCallback& callback) + : form_(form), index_(0) { + for (FormFieldData& field : form_.fields) + field.bounds = callback.Run(field.bounds); +} FormDataAndroid::~FormDataAndroid() { JNIEnv* env = AttachCurrentThread();
diff --git a/components/autofill/android/form_data_android.h b/components/autofill/android/form_data_android.h index b54928f..bc612708 100644 --- a/components/autofill/android/form_data_android.h +++ b/components/autofill/android/form_data_android.h
@@ -18,7 +18,13 @@ // available in Java. class FormDataAndroid { public: - FormDataAndroid(const FormData& form); + // The callback func to transform FormFieldData's bounds to viewport's + // coordinates, it is only used in FormDataAndroid constructor and transforms + // bounds in place to avoids an extra copy of FormData. + using TransformCallback = + base::RepeatingCallback<gfx::RectF(const gfx::RectF&)>; + + FormDataAndroid(const FormData& form, const TransformCallback& callback); virtual ~FormDataAndroid(); base::android::ScopedJavaLocalRef<jobject> GetJavaPeer( @@ -53,6 +59,8 @@ const FormData& form_for_testing() { return form_; } private: + // Same as the form passed in from constructor, but FormFieldData's bounds is + // transformed to viewport coordinates. FormData form_; std::vector<std::unique_ptr<FormFieldDataAndroid>> fields_; JavaObjectWeakGlobalRef java_ref_;
diff --git a/components/autofill/android/form_field_data_android.cc b/components/autofill/android/form_field_data_android.cc index 320ec22..da13426 100644 --- a/components/autofill/android/form_field_data_android.cc +++ b/components/autofill/android/form_field_data_android.cc
@@ -56,7 +56,8 @@ field_ptr_->should_autocomplete, jplaceholder, jtype, jid, joption_values, joption_contents, IsCheckable(field_ptr_->check_status), IsChecked(field_ptr_->check_status), field_ptr_->max_length, - jheuristic_type); + jheuristic_type, field_ptr_->bounds.x(), field_ptr_->bounds.y(), + field_ptr_->bounds.right(), field_ptr_->bounds.bottom()); java_ref_ = JavaObjectWeakGlobalRef(env, obj); } return obj;
diff --git a/components/autofill/android/java/src/org/chromium/components/autofill/FormFieldData.java b/components/autofill/android/java/src/org/chromium/components/autofill/FormFieldData.java index 9a95d0a..ba4dfe7 100644 --- a/components/autofill/android/java/src/org/chromium/components/autofill/FormFieldData.java +++ b/components/autofill/android/java/src/org/chromium/components/autofill/FormFieldData.java
@@ -4,6 +4,8 @@ package org.chromium.components.autofill; +import android.graphics.RectF; + import androidx.annotation.IntDef; import org.chromium.base.annotations.CalledByNative; @@ -40,6 +42,10 @@ public final @ControlType int mControlType; public final int mMaxLength; public final String mHeuristicType; + // The bounds in the viewport's coordinates + private final RectF mBounds; + // The bounds in the container view's coordinates. + private RectF mBoundsInContainerViewCoordinates; private boolean mIsChecked; private String mValue; @@ -51,7 +57,7 @@ private FormFieldData(String name, String label, String value, String autocompleteAttr, boolean shouldAutocomplete, String placeholder, String type, String id, String[] optionValues, String[] optionContents, boolean isCheckField, boolean isChecked, - int maxLength, String heuristicType) { + int maxLength, String heuristicType, float left, float top, float right, float bottom) { mName = name; mLabel = label; mValue = value; @@ -72,12 +78,25 @@ } mMaxLength = maxLength; mHeuristicType = heuristicType; + mBounds = new RectF(left, top, right, bottom); } public @ControlType int getControlType() { return mControlType; } + public RectF getBounds() { + return mBounds; + } + + public void setBoundsInContainerViewCoordinates(RectF bounds) { + mBoundsInContainerViewCoordinates = bounds; + } + + public RectF getBoundsInContainerViewCoordinates() { + return mBoundsInContainerViewCoordinates; + } + /** * @return value of field. */ @@ -120,9 +139,10 @@ private static FormFieldData createFormFieldData(String name, String label, String value, String autocompleteAttr, boolean shouldAutocomplete, String placeholder, String type, String id, String[] optionValues, String[] optionContents, boolean isCheckField, - boolean isChecked, int maxLength, String heuristicType) { + boolean isChecked, int maxLength, String heuristicType, float left, float top, + float right, float bottom) { return new FormFieldData(name, label, value, autocompleteAttr, shouldAutocomplete, placeholder, type, id, optionValues, optionContents, isCheckField, isChecked, - maxLength, heuristicType); + maxLength, heuristicType, left, top, right, bottom); } }
diff --git a/components/autofill/core/browser/autofill_handler.h b/components/autofill/core/browser/autofill_handler.h index 32dc40af..bcf4079 100644 --- a/components/autofill/core/browser/autofill_handler.h +++ b/components/autofill/core/browser/autofill_handler.h
@@ -142,6 +142,8 @@ // Returns the present form structures seen by Autofill handler. const FormStructureMap& form_structures() const { return form_structures_; } + AutofillDriver* driver() { return driver_; } + #if defined(UNIT_TEST) // A public wrapper that calls |mutable_form_structures| for testing purposes // only. @@ -213,8 +215,6 @@ bool value_from_dynamic_change_form_ = false; - AutofillDriver* driver() { return driver_; } - FormStructureMap* mutable_form_structures() { return &form_structures_; } private:
diff --git a/components/browser_ui/settings/android/java/src/org/chromium/components/browser_ui/settings/ManagedPreferencesUtils.java b/components/browser_ui/settings/android/java/src/org/chromium/components/browser_ui/settings/ManagedPreferencesUtils.java index 44d99827..b1d1742 100644 --- a/components/browser_ui/settings/android/java/src/org/chromium/components/browser_ui/settings/ManagedPreferencesUtils.java +++ b/components/browser_ui/settings/android/java/src/org/chromium/components/browser_ui/settings/ManagedPreferencesUtils.java
@@ -11,8 +11,10 @@ import android.widget.ImageView; import android.widget.TextView; +import androidx.annotation.DrawableRes; import androidx.annotation.Nullable; import androidx.annotation.StringRes; +import androidx.annotation.VisibleForTesting; import androidx.preference.Preference; import org.chromium.ui.base.ViewUtils; @@ -66,34 +68,44 @@ /** * @return The resource ID for the Managed By Enterprise icon. */ - public static int getManagedByEnterpriseIconId() { + public static @DrawableRes int getManagedByEnterpriseIconId() { return R.drawable.controlled_setting_mandatory; } /** * @return The resource ID for the Managed by Custodian icon. */ - public static int getManagedByCustodianIconId() { + public static @DrawableRes int getManagedByCustodianIconId() { return R.drawable.ic_account_child_grey600_36dp; } /** * @return The appropriate Drawable based on whether the preference is controlled by a policy or - * a custodian. + * a custodian. */ public static Drawable getManagedIconDrawable( @Nullable ManagedPreferenceDelegate delegate, Preference preference) { - if (delegate == null) return preference.getIcon(); + int resId = getManagedIconResId(delegate, preference); + return resId == 0 ? preference.getIcon() + : SettingsUtils.getTintedIcon(preference.getContext(), resId); + } + + /** + * @return The resource ID for the managed icon to show. Returns 0 if no managed icon should be + * shown. + */ + @VisibleForTesting(otherwise = VisibleForTesting.PRIVATE) + public static int getManagedIconResId( + @Nullable ManagedPreferenceDelegate delegate, Preference preference) { + if (delegate == null) return 0; if (delegate.isPreferenceControlledByPolicy(preference)) { - return SettingsUtils.getTintedIcon( - preference.getContext(), getManagedByEnterpriseIconId()); + return getManagedByEnterpriseIconId(); } else if (delegate.isPreferenceControlledByCustodian(preference)) { - return SettingsUtils.getTintedIcon( - preference.getContext(), getManagedByCustodianIconId()); + return getManagedByCustodianIconId(); } - return preference.getIcon(); + return 0; } /**
diff --git a/components/browser_ui/site_settings/OWNERS b/components/browser_ui/site_settings/OWNERS new file mode 100644 index 0000000..b889d5b --- /dev/null +++ b/components/browser_ui/site_settings/OWNERS
@@ -0,0 +1 @@ +file://chrome/android/java/src/org/chromium/chrome/browser/site_settings/OWNERS
diff --git a/components/browser_ui/site_settings/android/BUILD.gn b/components/browser_ui/site_settings/android/BUILD.gn new file mode 100644 index 0000000..0652687 --- /dev/null +++ b/components/browser_ui/site_settings/android/BUILD.gn
@@ -0,0 +1,30 @@ +# Copyright 2020 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//build/config/android/rules.gni") + +generate_jni("site_settings_jni_headers") { + sources = [ "java/src/org/chromium/components/browser_ui/site_settings/SiteSettingsFeatureList.java" ] +} + +android_library("java") { + sources = [ "java/src/org/chromium/components/browser_ui/site_settings/SiteSettingsFeatureList.java" ] + deps = [ + "//base:base_java", + "//base:jni_java", + ] + annotation_processor_deps = [ "//base/android/jni_generator:jni_processor" ] +} + +source_set("android") { + sources = [ + "features.cc", + "features.h", + "site_settings_feature_list.cc", + ] + deps = [ + ":site_settings_jni_headers", + "//base", + ] +}
diff --git a/components/browser_ui/site_settings/android/features.cc b/components/browser_ui/site_settings/android/features.cc new file mode 100644 index 0000000..358edad --- /dev/null +++ b/components/browser_ui/site_settings/android/features.cc
@@ -0,0 +1,15 @@ +// Copyright 2020 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "components/browser_ui/site_settings/android/features.h" + +#include "base/feature_list.h" +#include "base/metrics/field_trial_params.h" + +namespace browser_ui { + +const base::Feature kAppNotificationStatusMessaging{ + "AppNotificationStatusMessaging", base::FEATURE_DISABLED_BY_DEFAULT}; + +} // namespace browser_ui
diff --git a/components/browser_ui/site_settings/android/features.h b/components/browser_ui/site_settings/android/features.h new file mode 100644 index 0000000..523b7ff3 --- /dev/null +++ b/components/browser_ui/site_settings/android/features.h
@@ -0,0 +1,20 @@ +// Copyright 2020 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef COMPONENTS_BROWSER_UI_SITE_SETTINGS_ANDROID_FEATURES_H_ +#define COMPONENTS_BROWSER_UI_SITE_SETTINGS_ANDROID_FEATURES_H_ + +namespace base { +struct Feature; +} // namespace base + +namespace browser_ui { + +// Enables messaging in the site settings UI to tell users notifications are +// disabled for the entire app +extern const base::Feature kAppNotificationStatusMessaging; + +} // namespace browser_ui + +#endif // COMPONENTS_BROWSER_UI_SITE_SETTINGS_ANDROID_FEATURES_H_
diff --git a/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/SiteSettingsFeatureList.java b/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/SiteSettingsFeatureList.java new file mode 100644 index 0000000..791e34d --- /dev/null +++ b/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/SiteSettingsFeatureList.java
@@ -0,0 +1,64 @@ +// Copyright 2020 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +package org.chromium.components.browser_ui.site_settings; + +import org.chromium.base.FeatureList; +import org.chromium.base.annotations.JNINamespace; +import org.chromium.base.annotations.MainDex; +import org.chromium.base.annotations.NativeMethods; +import org.chromium.base.library_loader.LibraryLoader; + +/** + * Provides an API for querying the status of Site Settings features. + */ +// TODO(crbug.com/1060097): Remove/update this once a generalized FeatureList exists. +@JNINamespace("browser_ui") +@MainDex +public class SiteSettingsFeatureList { + public static final String APP_NOTIFICATION_STATUS_MESSAGING = "AppNotificationStatusMessaging"; + + private SiteSettingsFeatureList() {} + + /** + * Returns whether the specified feature is enabled or not. + * + * Note: Features queried through this API must be added to the array + * |kFeaturesExposedToJava| in + * //components/browser_ui/site_settings/android/site_settings_feature_list.cc + * + * @param featureName The name of the feature to query. + * @return Whether the feature is enabled or not. + */ + public static boolean isEnabled(String featureName) { + Boolean testValue = FeatureList.getTestValueForFeature(featureName); + if (testValue != null) return testValue; + assert isNativeInitialized(); + return SiteSettingsFeatureListJni.get().isEnabled(featureName); + } + + /** + * @return Whether the native FeatureList is initialized or not. + */ + private static boolean isNativeInitialized() { + if (FeatureList.hasTestFeatures()) return true; + + if (!LibraryLoader.getInstance().isInitialized()) return false; + // Even if the native library is loaded, the C++ FeatureList might not be initialized yet. + // In that case, accessing it will not immediately fail, but instead cause a crash later + // when it is initialized. Return whether the native FeatureList has been initialized, + // so the return value can be tested, or asserted for a more actionable stack trace + // on failure. + // + // The FeatureList is however guaranteed to be initialized by the time + // AsyncInitializationActivity#finishNativeInitialization is called. + return SiteSettingsFeatureListJni.get().isInitialized(); + } + + @NativeMethods + interface Natives { + boolean isInitialized(); + boolean isEnabled(String featureName); + } +}
diff --git a/components/browser_ui/site_settings/android/site_settings_feature_list.cc b/components/browser_ui/site_settings/android/site_settings_feature_list.cc new file mode 100644 index 0000000..f1b262d --- /dev/null +++ b/components/browser_ui/site_settings/android/site_settings_feature_list.cc
@@ -0,0 +1,51 @@ +// Copyright 2020 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "base/android/jni_string.h" +#include "base/feature_list.h" +#include "base/stl_util.h" + +#include "components/browser_ui/site_settings/android/features.h" +#include "components/browser_ui/site_settings/android/site_settings_jni_headers/SiteSettingsFeatureList_jni.h" + +using base::android::ConvertJavaStringToUTF8; +using base::android::JavaParamRef; + +namespace browser_ui { + +namespace { + +// Array of features exposed through the Java ContentFeatureList API. Entries in +// this array may either refer to features defined in the header of this file or +// in other locations in the code base (e.g. content_features.h). +const base::Feature* kFeaturesExposedToJava[] = { + &kAppNotificationStatusMessaging, +}; + +// TODO(crbug.com/1060097): Remove this once a generalized FeatureList exists. +const base::Feature* FindFeatureExposedToJava(const std::string& feature_name) { + for (size_t i = 0; i < base::size(kFeaturesExposedToJava); ++i) { + if (kFeaturesExposedToJava[i]->name == feature_name) + return kFeaturesExposedToJava[i]; + } + NOTREACHED() << "Queried feature not found in SiteSettingsFeatureList: " + << feature_name; + return nullptr; +} + +} // namespace + +static jboolean JNI_SiteSettingsFeatureList_IsInitialized(JNIEnv* env) { + return !!base::FeatureList::GetInstance(); +} + +static jboolean JNI_SiteSettingsFeatureList_IsEnabled( + JNIEnv* env, + const JavaParamRef<jstring>& jfeature_name) { + const base::Feature* feature = + FindFeatureExposedToJava(ConvertJavaStringToUTF8(env, jfeature_name)); + return base::FeatureList::IsEnabled(*feature); +} + +} // namespace browser_ui
diff --git a/components/cronet/cronet_global_state_stubs.cc b/components/cronet/cronet_global_state_stubs.cc index 1680ef2d..06171d4 100644 --- a/components/cronet/cronet_global_state_stubs.cc +++ b/components/cronet/cronet_global_state_stubs.cc
@@ -69,7 +69,7 @@ std::unique_ptr<net::ProxyConfigService> proxy_config_service, net::NetLog* net_log) { return net::ConfiguredProxyResolutionService::CreateUsingSystemProxyResolver( - std::move(proxy_config_service), net_log, /*quick_check_enabled=*/true); + std::move(proxy_config_service), /*quick_check_enabled=*/true, net_log); } std::string CreateDefaultUserAgent(const std::string& partial_user_agent) {
diff --git a/components/dom_distiller/content/browser/distillability_driver.cc b/components/dom_distiller/content/browser/distillability_driver.cc index 99a9a1a..667c099 100644 --- a/components/dom_distiller/content/browser/distillability_driver.cc +++ b/components/dom_distiller/content/browser/distillability_driver.cc
@@ -25,7 +25,7 @@ base::WeakPtr<DistillabilityDriver> distillability_driver) : distillability_driver_(distillability_driver) {} - ~DistillabilityServiceImpl() override {} + ~DistillabilityServiceImpl() override = default; void NotifyIsDistillable(bool is_distillable, bool is_last_update,
diff --git a/components/dom_distiller/content/browser/distillability_driver.h b/components/dom_distiller/content/browser/distillability_driver.h index d12f7fb..dbe64d0 100644 --- a/components/dom_distiller/content/browser/distillability_driver.h +++ b/components/dom_distiller/content/browser/distillability_driver.h
@@ -7,7 +7,6 @@ #include <string> -#include "base/macros.h" #include "base/memory/weak_ptr.h" #include "base/observer_list.h" #include "base/optional.h" @@ -42,6 +41,9 @@ UMAHelper::DistillabilityDriverTimer& GetTimer() { return timer_; } + DistillabilityDriver(const DistillabilityDriver&) = delete; + DistillabilityDriver& operator=(const DistillabilityDriver&) = delete; + private: explicit DistillabilityDriver(content::WebContents* web_contents); friend class content::WebContentsUserData<DistillabilityDriver>; @@ -70,8 +72,6 @@ base::WeakPtrFactory<DistillabilityDriver> weak_factory_{this}; WEB_CONTENTS_USER_DATA_KEY_DECL(); - - DISALLOW_COPY_AND_ASSIGN(DistillabilityDriver); }; } // namespace dom_distiller
diff --git a/components/dom_distiller/content/browser/distiller_javascript_service_impl.cc b/components/dom_distiller/content/browser/distiller_javascript_service_impl.cc index faf05be..7d13921 100644 --- a/components/dom_distiller/content/browser/distiller_javascript_service_impl.cc +++ b/components/dom_distiller/content/browser/distiller_javascript_service_impl.cc
@@ -12,7 +12,7 @@ DistillerUIHandle* distiller_ui_handle) : distiller_ui_handle_(distiller_ui_handle) {} -DistillerJavaScriptServiceImpl::~DistillerJavaScriptServiceImpl() {} +DistillerJavaScriptServiceImpl::~DistillerJavaScriptServiceImpl() = default; void DistillerJavaScriptServiceImpl::HandleDistillerOpenSettingsCall() { if (!distiller_ui_handle_) {
diff --git a/components/dom_distiller/content/browser/distiller_javascript_service_impl.h b/components/dom_distiller/content/browser/distiller_javascript_service_impl.h index b5c5dd8..57bf852 100644 --- a/components/dom_distiller/content/browser/distiller_javascript_service_impl.h +++ b/components/dom_distiller/content/browser/distiller_javascript_service_impl.h
@@ -5,7 +5,6 @@ #ifndef COMPONENTS_DOM_DISTILLER_CONTENT_BROWSER_DISTILLER_JAVASCRIPT_SERVICE_IMPL_H_ #define COMPONENTS_DOM_DISTILLER_CONTENT_BROWSER_DISTILLER_JAVASCRIPT_SERVICE_IMPL_H_ -#include "base/macros.h" #include "components/dom_distiller/content/common/mojom/distiller_javascript_service.mojom.h" #include "components/dom_distiller/core/distiller_ui_handle.h" #include "mojo/public/cpp/bindings/pending_receiver.h" @@ -16,7 +15,8 @@ class DistillerJavaScriptServiceImpl : public mojom::DistillerJavaScriptService { public: - DistillerJavaScriptServiceImpl(DistillerUIHandle* distiller_ui_handle); + explicit DistillerJavaScriptServiceImpl( + DistillerUIHandle* distiller_ui_handle); ~DistillerJavaScriptServiceImpl() override; // Mojo mojom::DistillerJavaScriptService implementation. @@ -24,10 +24,13 @@ // Show the Android view containing Reader Mode settings. void HandleDistillerOpenSettingsCall() override; + DistillerJavaScriptServiceImpl(const DistillerJavaScriptServiceImpl&) = + delete; + DistillerJavaScriptServiceImpl& operator=( + const DistillerJavaScriptServiceImpl&) = delete; + private: DistillerUIHandle* distiller_ui_handle_; - - DISALLOW_COPY_AND_ASSIGN(DistillerJavaScriptServiceImpl); }; // static
diff --git a/components/dom_distiller/content/browser/distiller_page_web_contents.cc b/components/dom_distiller/content/browser/distiller_page_web_contents.cc index c9f350193..334896b 100644 --- a/components/dom_distiller/content/browser/distiller_page_web_contents.cc +++ b/components/dom_distiller/content/browser/distiller_page_web_contents.cc
@@ -74,7 +74,7 @@ } } -DistillerPageWebContents::~DistillerPageWebContents() {} +DistillerPageWebContents::~DistillerPageWebContents() = default; bool DistillerPageWebContents::StringifyOutput() { return false;
diff --git a/components/dom_distiller/content/browser/distiller_page_web_contents.h b/components/dom_distiller/content/browser/distiller_page_web_contents.h index a10da14..ca1b6c1 100644 --- a/components/dom_distiller/content/browser/distiller_page_web_contents.h +++ b/components/dom_distiller/content/browser/distiller_page_web_contents.h
@@ -8,7 +8,6 @@ #include <memory> #include <string> -#include "base/macros.h" #include "components/dom_distiller/core/distiller_page.h" #include "content/public/browser/web_contents.h" #include "content/public/browser/web_contents_delegate.h" @@ -36,8 +35,8 @@ public: explicit DistillerPageWebContentsFactory( content::BrowserContext* browser_context) - : DistillerPageFactory(), browser_context_(browser_context) {} - ~DistillerPageWebContentsFactory() override {} + : browser_context_(browser_context) {} + ~DistillerPageWebContentsFactory() override = default; std::unique_ptr<DistillerPage> CreateDistillerPage( const gfx::Size& render_view_size) const override; @@ -69,6 +68,9 @@ const GURL& validated_url, int error_code) override; + DistillerPageWebContents(const DistillerPageWebContents&) = delete; + DistillerPageWebContents& operator=(const DistillerPageWebContents&) = delete; + protected: bool StringifyOutput() override; void DistillPageImpl(const GURL& url, const std::string& script) override; @@ -112,7 +114,6 @@ content::BrowserContext* browser_context_; gfx::Size render_view_size_; base::WeakPtrFactory<DistillerPageWebContents> weak_factory_{this}; - DISALLOW_COPY_AND_ASSIGN(DistillerPageWebContents); }; } // namespace dom_distiller
diff --git a/components/dom_distiller/content/browser/dom_distiller_viewer_source.cc b/components/dom_distiller/content/browser/dom_distiller_viewer_source.cc index 2e17be3..d55e6cb 100644 --- a/components/dom_distiller/content/browser/dom_distiller_viewer_source.cc +++ b/components/dom_distiller/content/browser/dom_distiller_viewer_source.cc
@@ -205,7 +205,7 @@ const std::string& scheme) : scheme_(scheme), dom_distiller_service_(dom_distiller_service) {} -DomDistillerViewerSource::~DomDistillerViewerSource() {} +DomDistillerViewerSource::~DomDistillerViewerSource() = default; std::string DomDistillerViewerSource::GetSource() { return scheme_ + "://";
diff --git a/components/dom_distiller/content/browser/dom_distiller_viewer_source.h b/components/dom_distiller/content/browser/dom_distiller_viewer_source.h index 0e1e660..d656de2 100644 --- a/components/dom_distiller/content/browser/dom_distiller_viewer_source.h +++ b/components/dom_distiller/content/browser/dom_distiller_viewer_source.h
@@ -9,7 +9,6 @@ #include <string> #include "base/compiler_specific.h" -#include "base/macros.h" #include "content/public/browser/url_data_source.h" #include "content/public/browser/web_contents.h" @@ -40,6 +39,9 @@ std::string GetContentSecurityPolicyStyleSrc() override; std::string GetContentSecurityPolicyChildSrc() override; + DomDistillerViewerSource(const DomDistillerViewerSource&) = delete; + DomDistillerViewerSource& operator=(const DomDistillerViewerSource&) = delete; + private: friend class DomDistillerViewerSourceTest; @@ -49,8 +51,6 @@ // The service which contains all the functionality needed to interact with // the list of articles. DomDistillerServiceInterface* dom_distiller_service_; - - DISALLOW_COPY_AND_ASSIGN(DomDistillerViewerSource); }; } // namespace dom_distiller
diff --git a/components/dom_distiller/content/browser/test_distillability_observer.h b/components/dom_distiller/content/browser/test_distillability_observer.h index ed499176..3c3035cc 100644 --- a/components/dom_distiller/content/browser/test_distillability_observer.h +++ b/components/dom_distiller/content/browser/test_distillability_observer.h
@@ -40,5 +40,4 @@ } // namespace dom_distiller -#endif // defined - // COMPONENTS_DOM_DISTILLER_CONTENT_BROWSER_TEST_DISTILLABILITY_OBSERVER_H_ +#endif // COMPONENTS_DOM_DISTILLER_CONTENT_BROWSER_TEST_DISTILLABILITY_OBSERVER_H_
diff --git a/components/dom_distiller/content/browser/uma_helper.h b/components/dom_distiller/content/browser/uma_helper.h index c144ff41..9244c148 100644 --- a/components/dom_distiller/content/browser/uma_helper.h +++ b/components/dom_distiller/content/browser/uma_helper.h
@@ -5,7 +5,6 @@ #ifndef COMPONENTS_DOM_DISTILLER_CONTENT_BROWSER_UMA_HELPER_H_ #define COMPONENTS_DOM_DISTILLER_CONTENT_BROWSER_UMA_HELPER_H_ -#include "base/macros.h" #include "base/time/time.h" namespace content { @@ -94,8 +93,9 @@ // navigates to another page. static void LogTimeOnDistilledPage(base::TimeDelta time); - private: - DISALLOW_IMPLICIT_CONSTRUCTORS(UMAHelper); + UMAHelper() = delete; + UMAHelper(const UMAHelper&) = delete; + UMAHelper& operator=(const UMAHelper&) = delete; }; } // namespace dom_distiller
diff --git a/components/dom_distiller/content/browser/uma_helper_unittest.cc b/components/dom_distiller/content/browser/uma_helper_unittest.cc index 417154f..56fd714 100644 --- a/components/dom_distiller/content/browser/uma_helper_unittest.cc +++ b/components/dom_distiller/content/browser/uma_helper_unittest.cc
@@ -3,9 +3,9 @@ // found in the LICENSE file. #include "components/dom_distiller/content/browser/uma_helper.h" + #include <string> -#include "base/macros.h" #include "base/test/metrics/histogram_tester.h" #include "base/test/task_environment.h" #include "base/time/time.h"
diff --git a/components/dom_distiller/content/renderer/distiller_native_javascript.cc b/components/dom_distiller/content/renderer/distiller_native_javascript.cc index b67f7fb..42186a9 100644 --- a/components/dom_distiller/content/renderer/distiller_native_javascript.cc +++ b/components/dom_distiller/content/renderer/distiller_native_javascript.cc
@@ -22,7 +22,7 @@ content::RenderFrame* render_frame) : render_frame_(render_frame) {} -DistillerNativeJavaScript::~DistillerNativeJavaScript() {} +DistillerNativeJavaScript::~DistillerNativeJavaScript() = default; void DistillerNativeJavaScript::AddJavaScriptObjectToFrame( v8::Local<v8::Context> context) {
diff --git a/components/dom_distiller/content/renderer/distiller_native_javascript.h b/components/dom_distiller/content/renderer/distiller_native_javascript.h index ce21ee7..4828b20e 100644 --- a/components/dom_distiller/content/renderer/distiller_native_javascript.h +++ b/components/dom_distiller/content/renderer/distiller_native_javascript.h
@@ -32,6 +32,7 @@ v8::Local<v8::Object> javascript_object, const std::string& name, const base::RepeatingCallback<Sig>& callback); + // Make sure the mojo service is connected. void EnsureServiceConnected();
diff --git a/components/exo/wayland/clients/test/wayland_client_test_helper.cc b/components/exo/wayland/clients/test/wayland_client_test_helper.cc index 49e352bf..7435a25 100644 --- a/components/exo/wayland/clients/test/wayland_client_test_helper.cc +++ b/components/exo/wayland/clients/test/wayland_client_test_helper.cc
@@ -21,7 +21,6 @@ #include "components/exo/wayland/server.h" #include "components/exo/wm_helper_chromeos.h" #include "ui/aura/window_tree_host.h" -#include "ui/events/gesture_detection/gesture_configuration.h" #include "ui/wm/core/cursor_manager.h" #include "ui/wm/core/wm_core_switches.h" @@ -107,19 +106,6 @@ ash_test_helper_ = std::make_unique<ash::AshTestHelper>(); ash_test_helper_->SetUp(); - ash::Shell::GetPrimaryRootWindow()->Show(); - ash::Shell::GetPrimaryRootWindow()->GetHost()->Show(); - ash::Shell::GetPrimaryRootWindow()->MoveCursorTo(gfx::Point(-1000, -1000)); - ash::Shell::Get()->cursor_manager()->EnableMouseEvents(); - - // Changing GestureConfiguration shouldn't make tests fail. These values - // prevent unexpected events from being generated during tests. Such as - // delayed events which create race conditions on slower tests. - ui::GestureConfiguration* gesture_config = - ui::GestureConfiguration::GetInstance(); - gesture_config->set_max_touch_down_duration_for_click_in_ms(800); - gesture_config->set_long_press_time_in_ms(1000); - gesture_config->set_max_touch_move_in_pixels_for_click(5); wm_helper_ = std::make_unique<WMHelperChromeOS>(); WMHelper::SetInstance(wm_helper_.get());
diff --git a/components/feed/core/common/pref_names.cc b/components/feed/core/common/pref_names.cc index 18d90fa..1abd2fc4 100644 --- a/components/feed/core/common/pref_names.cc +++ b/components/feed/core/common/pref_names.cc
@@ -31,6 +31,11 @@ const char kHostOverrideHost[] = "feed.host_override.host"; const char kHostOverrideBlessNonce[] = "feed.host_override.bless_nonce"; +const char kThrottlerRequestCountListPrefName[] = + "feedv2.request_throttler.request_counts"; +const char kThrottlerLastRequestTime[] = + "feedv2.request_throttler.last_request_time"; + } // namespace prefs void RegisterProfilePrefs(PrefRegistrySimple* registry) { @@ -41,6 +46,9 @@ registry->RegisterTimePref(prefs::kLastFetchAttemptTime, base::Time()); registry->RegisterTimeDeltaPref(prefs::kBackgroundRefreshPeriod, base::TimeDelta()); + registry->RegisterListPref(feed::prefs::kThrottlerRequestCountListPrefName); + registry->RegisterTimePref(feed::prefs::kThrottlerLastRequestTime, + base::Time()); UserClassifier::RegisterProfilePrefs(registry); }
diff --git a/components/feed/core/common/pref_names.h b/components/feed/core/common/pref_names.h index 048f964f..f3bc8f0 100644 --- a/components/feed/core/common/pref_names.h +++ b/components/feed/core/common/pref_names.h
@@ -42,6 +42,13 @@ // The pref name for the feed host override auth token. extern const char kHostOverrideBlessNonce[]; +// The following prefs are used only by v2. + +// The pref name for the request throttler counts. +extern const char kThrottlerRequestCountListPrefName[]; +// The pref name for the request throttler's last request time. +extern const char kThrottlerLastRequestTime[]; + } // namespace prefs void RegisterProfilePrefs(PrefRegistrySimple* registry);
diff --git a/components/feed/core/common/user_classifier.h b/components/feed/core/common/user_classifier.h index 92eb40c5..154df8b 100644 --- a/components/feed/core/common/user_classifier.h +++ b/components/feed/core/common/user_classifier.h
@@ -47,7 +47,7 @@ // The provided |pref_service| may be nullptr in unit-tests. UserClassifier(PrefService* pref_service, const base::Clock* clock); - ~UserClassifier(); + virtual ~UserClassifier(); // Registers profile prefs for all rates. Called from pref_names.cc. static void RegisterProfilePrefs(PrefRegistrySimple* registry); @@ -61,7 +61,8 @@ double GetEstimatedAvgTime(Event event) const; // Return the classification of the current user. - UserClass GetUserClass() const; + // Virtual for testing. + virtual UserClass GetUserClass() const; std::string GetUserClassDescriptionForDebugging() const; // Resets the classification (emulates a fresh upgrade / install).
diff --git a/components/feed/core/v2/BUILD.gn b/components/feed/core/v2/BUILD.gn index adee7ac4..99d8d69 100644 --- a/components/feed/core/v2/BUILD.gn +++ b/components/feed/core/v2/BUILD.gn
@@ -20,14 +20,16 @@ "feed_store.h", "feed_stream.cc", "feed_stream.h", - "master_refresh_throttler.cc", - "master_refresh_throttler.h", + "prefs.cc", + "prefs.h", "proto_util.cc", "proto_util.h", "public/feed_service.cc", "public/feed_service.h", "public/feed_stream_api.h", "refresh_task_scheduler.h", + "request_throttler.cc", + "request_throttler.h", "scheduling.cc", "scheduling.h", "stream_event_metrics.cc", @@ -75,6 +77,7 @@ "feed_network_impl_unittest.cc", "feed_store_unittest.cc", "feed_stream_unittest.cc", + "request_throttler_unittest.cc", "stream_model_unittest.cc", "stream_model_update_request_unittest.cc", "test/callback_receiver.h",
diff --git a/components/feed/core/v2/enums.cc b/components/feed/core/v2/enums.cc index f383670..ce8c0ce3 100644 --- a/components/feed/core/v2/enums.cc +++ b/components/feed/core/v2/enums.cc
@@ -29,6 +29,20 @@ return out << "kNoResponseBody"; case LoadStreamStatus::kProtoTranslationFailed: return out << "kProtoTranslationFailed"; + case LoadStreamStatus::kDataInStoreIsStale: + return out << "kDataInStoreIsStale"; + case LoadStreamStatus::kDataInStoreIsStaleTimestampInFuture: + return out << "kDataInStoreIsStaleTimestampInFuture"; + case LoadStreamStatus::kCannotLoadFromNetworkSupressedForHistoryDelete: + return out << "kCannotLoadFromNetworkSupressedForHistoryDelete"; + case LoadStreamStatus::kCannotLoadFromNetworkOffline: + return out << "kCannotLoadFromNetworkOffline"; + case LoadStreamStatus::kCannotLoadFromNetworkThrottled: + return out << "kCannotLoadFromNetworkThrottled"; + case LoadStreamStatus::kLoadNotAllowedEulaNotAccepted: + return out << "kLoadNotAllowedEulaNotAccepted"; + case LoadStreamStatus::kLoadNotAllowedArticlesListHidden: + return out << "kLoadNotAllowedArticlesListHidden"; } #else return out << (static_cast<int>(value));
diff --git a/components/feed/core/v2/enums.h b/components/feed/core/v2/enums.h index 6db09be..dc6d84e 100644 --- a/components/feed/core/v2/enums.h +++ b/components/feed/core/v2/enums.h
@@ -11,17 +11,9 @@ namespace feed { -// Describes the behavior for attempting to refresh (over the network) while -// loading the feed. -enum class LoadRefreshBehavior { - // Wait for feed refresh before showing the result. - kWaitForRefresh, - // Load what is available locally, begin the refresh, and populate results - // below the fold when they are received. - kRefreshInline, - // Wait a limited amount of time for the network fetch. If the fetch doesn't - // complete in time, just show the user what's available locally. - kLimitedWaitForRefresh, +enum NetworkRequestType : int { + kFeedQuery = 0, + kUploadActions = 1, }; enum class LoadStreamStatus { @@ -33,8 +25,17 @@ kNoStreamDataInStore = 4, kModelAlreadyLoaded = 5, kNoResponseBody = 6, - // TODO(harringtond): Let's add more specific errors here. + // TODO(harringtond): Let's add more specific proto translation errors. kProtoTranslationFailed = 7, + kDataInStoreIsStale = 8, + // The timestamp for stored data is in the future, so we're treating stored + // data as it it is stale. + kDataInStoreIsStaleTimestampInFuture = 9, + kCannotLoadFromNetworkSupressedForHistoryDelete = 10, + kCannotLoadFromNetworkOffline = 11, + kCannotLoadFromNetworkThrottled = 12, + kLoadNotAllowedEulaNotAccepted = 13, + kLoadNotAllowedArticlesListHidden = 14, }; std::ostream& operator<<(std::ostream& out, LoadStreamStatus value);
diff --git a/components/feed/core/v2/feed_stream.cc b/components/feed/core/v2/feed_stream.cc index 7f4cedb..c3215643 100644 --- a/components/feed/core/v2/feed_stream.cc +++ b/components/feed/core/v2/feed_stream.cc
@@ -16,6 +16,7 @@ #include "components/feed/core/proto/v2/store.pb.h" #include "components/feed/core/proto/v2/ui.pb.h" #include "components/feed/core/shared_prefs/pref_names.h" +#include "components/feed/core/v2/enums.h" #include "components/feed/core/v2/feed_network.h" #include "components/feed/core/v2/feed_store.h" #include "components/feed/core/v2/refresh_task_scheduler.h" @@ -132,8 +133,10 @@ std::unique_ptr<StreamModelUpdateRequest> FeedStream::WireResponseTranslator::TranslateWireResponse( feedwire::Response response, - base::TimeDelta response_time) { - return ::feed::TranslateWireResponse(std::move(response), response_time); + base::TimeDelta response_time, + base::Time current_time) { + return ::feed::TranslateWireResponse(std::move(response), response_time, + current_time); } FeedStream::FeedStream( @@ -156,12 +159,10 @@ tick_clock_(tick_clock), background_task_runner_(background_task_runner), task_queue_(this), - user_classifier_(profile_prefs, clock), - refresh_throttler_(profile_prefs, clock) { - // TODO(harringtond): Use these members. + user_classifier_(std::make_unique<UserClassifier>(profile_prefs, clock)), + request_throttler_(profile_prefs, clock) { static WireResponseTranslator default_translator; wire_response_translator_ = &default_translator; - (void)feed_network_; // Inserting this task first ensures that |store_| is initialized before // it is used. @@ -183,6 +184,21 @@ void FeedStream::TriggerStreamLoad() { if (model_monitor_ || model_loading_in_progress_) return; + + if (!delegate_->IsEulaAccepted()) { + stream_event_observer_->OnLoadStream( + LoadStreamStatus::kNoStatus, + LoadStreamStatus::kLoadNotAllowedEulaNotAccepted); + return; + } + + if (!IsArticlesListVisible()) { + stream_event_observer_->OnLoadStream( + LoadStreamStatus::kNoStatus, + LoadStreamStatus::kLoadNotAllowedArticlesListHidden); + return; + } + model_loading_in_progress_ = true; task_queue_.AddTask(std::make_unique<LoadStreamTask>( this, base::BindOnce(&FeedStream::LoadStreamTaskComplete, @@ -190,6 +206,8 @@ } void FeedStream::LoadStreamTaskComplete(LoadStreamTask::Result result) { + stream_event_observer_->OnLoadStream(result.load_from_store_status, + result.final_status); DVLOG(1) << "LoadStreamTaskComplete load_from_store_status=" << result.load_from_store_status << " final_status=" << result.final_status; @@ -248,7 +266,7 @@ } UserClass FeedStream::GetUserClass() { - return user_classifier_.GetUserClass(); + return user_classifier_->GetUserClass(); } base::Time FeedStream::GetLastFetchTime() { @@ -277,25 +295,16 @@ idle_callback_ = idle_callback; } +void FeedStream::SetUserClassifierForTesting( + std::unique_ptr<UserClassifier> user_classifier) { + user_classifier_ = std::move(user_classifier); +} + void FeedStream::OnStoreChange(const StreamModel::StoreUpdate& update) { store_->WriteOperations(update.sequence_number, update.operations); } -// TODO(harringtond): Ensure this function gets test coverage when fetching -// functionality is added. -ShouldRefreshResult FeedStream::ShouldRefresh(TriggerType trigger) { - if (delegate_->IsOffline()) { - return ShouldRefreshResult::kDontRefreshNetworkOffline; - } - - if (!delegate_->IsEulaAccepted()) { - return ShouldRefreshResult::kDontRefreshEulaNotAccepted; - } - - if (!IsArticlesListVisible()) { - return ShouldRefreshResult::kDontRefreshArticlesHidden; - } - +LoadStreamStatus FeedStream::ShouldMakeFeedQueryRequest() { // TODO(harringtond): |suppress_refreshes_until_| was historically used for // privacy purposes after clearing data to make sure sync data made it to the // server. I'm not sure we need this now. But also, it was documented as not @@ -303,24 +312,18 @@ // I've tried to keep the same functionality as the old feed code, but we // should revisit this. if (tick_clock_->NowTicks() < suppress_refreshes_until_) { - return ShouldRefreshResult::kDontRefreshRefreshSuppressed; + return LoadStreamStatus::kCannotLoadFromNetworkSupressedForHistoryDelete; } - const UserClass user_class = GetUserClass(); - - if (clock_->Now() - GetLastFetchTime() < - GetUserClassTriggerThreshold(user_class, trigger)) { - return ShouldRefreshResult::kDontRefreshNotStale; + if (delegate_->IsOffline()) { + return LoadStreamStatus::kCannotLoadFromNetworkOffline; } - if (!refresh_throttler_.RequestQuota(user_class)) { - return ShouldRefreshResult::kDontRefreshRefreshThrottled; + if (!request_throttler_.RequestQuota(NetworkRequestType::kFeedQuery)) { + return LoadStreamStatus::kCannotLoadFromNetworkThrottled; } - UMA_HISTOGRAM_ENUMERATION("ContentSuggestions.Feed.Scheduler.RefreshTrigger", - trigger); - - return ShouldRefreshResult::kShouldRefresh; + return LoadStreamStatus::kNoStatus; } void FeedStream::OnEulaAccepted() {
diff --git a/components/feed/core/v2/feed_stream.h b/components/feed/core/v2/feed_stream.h index 2f464a0b..2e6ca42 100644 --- a/components/feed/core/v2/feed_stream.h +++ b/components/feed/core/v2/feed_stream.h
@@ -16,8 +16,8 @@ #include "components/feed/core/common/user_classifier.h" #include "components/feed/core/proto/v2/wire/response.pb.h" #include "components/feed/core/v2/enums.h" -#include "components/feed/core/v2/master_refresh_throttler.h" #include "components/feed/core/v2/public/feed_stream_api.h" +#include "components/feed/core/v2/request_throttler.h" #include "components/feed/core/v2/stream_model.h" #include "components/feed/core/v2/tasks/load_stream_task.h" #include "components/offline_pages/task/task_queue.h" @@ -55,6 +55,8 @@ // Concrete implementation should have no observable effects on the Feed. class EventObserver { public: + virtual void OnLoadStream(LoadStreamStatus load_from_store_status, + LoadStreamStatus final_status) = 0; virtual void OnMaybeTriggerRefresh(TriggerType trigger, bool clear_all_before_refresh) = 0; virtual void OnClearAll(base::TimeDelta time_since_last_clear) = 0; @@ -68,7 +70,8 @@ ~WireResponseTranslator() = default; virtual std::unique_ptr<StreamModelUpdateRequest> TranslateWireResponse( feedwire::Response response, - base::TimeDelta response_time); + base::TimeDelta response_time, + base::Time current_time); }; FeedStream(RefreshTaskScheduler* refresh_task_scheduler, @@ -140,6 +143,11 @@ // Returns the time of the last content fetch. base::Time GetLastFetchTime(); + // Determines if a FeedQuery request can be made. If successful, + // returns |LoadStreamStatus::kNoStatus| and acquires throttler quota. + // Otherwise returns the reason. + LoadStreamStatus ShouldMakeFeedQueryRequest(); + // Loads |model|. Should be used for testing in place of typical model // loading from network or storage. void LoadModelForTesting(std::unique_ptr<StreamModel> model); @@ -149,6 +157,8 @@ // Returns the model if it is loaded, or null otherwise. StreamModel* GetModel() { return model_.get(); } + const base::Clock* GetClock() { return clock_; } + WireResponseTranslator* GetWireResponseTranslator() const { return wire_response_translator_; } @@ -159,6 +169,8 @@ } void SetIdleCallbackForTesting(base::RepeatingClosure idle_callback); + void SetUserClassifierForTesting( + std::unique_ptr<UserClassifier> user_classifier); private: class ModelMonitor; @@ -170,11 +182,6 @@ void LoadStreamTaskComplete(LoadStreamTask::Result result); - // Determines whether or not a fetch should be allowed. - // If a fetch is allowed, quota is reserved with the assumption that a fetch - // will follow shortly. - ShouldRefreshResult ShouldRefresh(TriggerType trigger); - void ClearAll(); // Unowned. @@ -206,8 +213,8 @@ base::ObserverList<SurfaceInterface> surfaces_; // Mutable state. - UserClassifier user_classifier_; - MasterRefreshThrottler refresh_throttler_; + std::unique_ptr<UserClassifier> user_classifier_; + RequestThrottler request_throttler_; base::TimeTicks suppress_refreshes_until_; // To allow tests to wait on task queue idle.
diff --git a/components/feed/core/v2/feed_stream_unittest.cc b/components/feed/core/v2/feed_stream_unittest.cc index 97b75bbe..db62466 100644 --- a/components/feed/core/v2/feed_stream_unittest.cc +++ b/components/feed/core/v2/feed_stream_unittest.cc
@@ -23,6 +23,7 @@ #include "components/feed/core/shared_prefs/pref_names.h" #include "components/feed/core/v2/feed_network.h" #include "components/feed/core/v2/refresh_task_scheduler.h" +#include "components/feed/core/v2/scheduling.h" #include "components/feed/core/v2/stream_model.h" #include "components/feed/core/v2/stream_model_update_request.h" #include "components/feed/core/v2/tasks/load_stream_from_store_task.h" @@ -40,8 +41,13 @@ auto complete = [&](LoadStreamFromStoreTask::Result task_result) { result = std::move(task_result); }; - LoadStreamFromStoreTask load_task(store, - base::BindLambdaForTesting(complete)); + LoadStreamFromStoreTask load_task( + store, /*clock=*/nullptr, + UserClass::kActiveSuggestionsConsumer, // Has no effect. + base::BindLambdaForTesting(complete)); + // We want to load the data no matter how stale. + load_task.IgnoreStalenessForTesting(); + base::RunLoop run_loop; load_task.Execute(run_loop.QuitClosure()); run_loop.Run(); @@ -107,6 +113,24 @@ base::Optional<feedui::StreamUpdate> update; }; +class TestUserClassifier : public UserClassifier { + public: + TestUserClassifier(PrefService* pref_service, const base::Clock* clock) + : UserClassifier(pref_service, clock) {} + // UserClassifier. + UserClass GetUserClass() const override { + return overridden_user_class_.value_or(UserClassifier::GetUserClass()); + } + + // Test use. + void OverrideUserClass(UserClass user_class) { + overridden_user_class_ = user_class; + } + + private: + base::Optional<UserClass> overridden_user_class_; +}; + class TestFeedNetwork : public FeedNetwork { public: // FeedNetwork implementation. @@ -141,12 +165,13 @@ public: std::unique_ptr<StreamModelUpdateRequest> TranslateWireResponse( feedwire::Response response, - base::TimeDelta response_time) override { + base::TimeDelta response_time, + base::Time current_time) override { if (injected_response_) { return std::move(injected_response_); } return FeedStream::WireResponseTranslator::TranslateWireResponse( - std::move(response), response_time); + std::move(response), response_time, current_time); } void InjectResponse(std::unique_ptr<StreamModelUpdateRequest> response) { injected_response_ = std::move(response); @@ -174,6 +199,12 @@ class TestEventObserver : public FeedStream::EventObserver { public: // FeedStreamUnittest::StreamEventObserver. + void OnLoadStream(LoadStreamStatus load_from_store_status, + LoadStreamStatus final_status) override { + load_stream_status = final_status; + LOG(INFO) << "OnLoadStream: " << final_status + << " (store status: " << load_from_store_status << ")"; + } void OnMaybeTriggerRefresh(TriggerType trigger, bool clear_all_before_refresh) override { refresh_trigger_type = trigger; @@ -184,6 +215,7 @@ // Test access. + base::Optional<LoadStreamStatus> load_stream_status; base::Optional<base::TimeDelta> time_since_last_clear; base::Optional<TriggerType> refresh_trigger_type; }; @@ -193,12 +225,19 @@ void SetUp() override { feed::prefs::RegisterFeedSharedProfilePrefs(profile_prefs_.registry()); feed::RegisterProfilePrefs(profile_prefs_.registry()); - + CHECK_EQ(kTestTimeEpoch, task_environment_.GetMockClock()->Now()); stream_ = std::make_unique<FeedStream>( &refresh_scheduler_, &event_observer_, this, &profile_prefs_, &network_, - store_.get(), &clock_, &tick_clock_, + store_.get(), task_environment_.GetMockClock(), + task_environment_.GetMockTickClock(), task_environment_.GetMainThreadTaskRunner()); + // Set the user classifier. + auto user_classifier = std::make_unique<TestUserClassifier>( + &profile_prefs_, task_environment_.GetMockClock()); + user_classifier_ = user_classifier.get(); + stream_->SetUserClassifierForTesting(std::move(user_classifier)); + WaitForIdleTaskQueue(); // Wait for any initialization. stream_->SetWireResponseTranslatorForTesting(&response_translator_); @@ -214,8 +253,8 @@ } // FeedStream::Delegate. - bool IsEulaAccepted() override { return true; } - bool IsOffline() override { return false; } + bool IsEulaAccepted() override { return is_eula_accepted_; } + bool IsOffline() override { return is_offline_; } // For tests. @@ -242,6 +281,7 @@ protected: base::test::TaskEnvironment task_environment_{ base::test::TaskEnvironment::TimeSource::MOCK_TIME}; + TestUserClassifier* user_classifier_; TestEventObserver event_observer_; TestingPrefServiceSimple profile_prefs_; TestFeedNetwork network_; @@ -252,10 +292,10 @@ leveldb_proto::ProtoDbType::FEED_STREAM_DATABASE, /*file_path=*/{}, task_environment_.GetMainThreadTaskRunner())); - base::SimpleTestClock clock_; - base::SimpleTestTickClock tick_clock_; FakeRefreshTaskScheduler refresh_scheduler_; std::unique_ptr<FeedStream> stream_; + bool is_eula_accepted_ = true; + bool is_offline_ = false; }; TEST_F(FeedStreamTest, IsArticlesListVisibleByDefault) { @@ -446,11 +486,118 @@ // Verify the model is filled correctly. EXPECT_STRINGS_EQUAL(ModelStateFor(MakeTypicalInitialModelState()), stream_->GetModel()->DumpStateForTesting()); + // Verify the data was written to the store. + EXPECT_STRINGS_EQUAL(ModelStateFor(store_.get()), + ModelStateFor(MakeTypicalInitialModelState())); +} + +TEST_F(FeedStreamTest, LoadFromNetworkBecauseStoreIsStale) { + // Fill the store with stream data that is just barely stale, and verify we + // fetch new data over the network. + user_classifier_->OverrideUserClass(UserClass::kActiveSuggestionsConsumer); + store_->SaveFullStream(MakeTypicalInitialModelState( + + kTestTimeEpoch - base::TimeDelta::FromHours(12) - + base::TimeDelta::FromMinutes(1)), + base::DoNothing()); + + // Store is stale, so we should fallback to a network request. + response_translator_.InjectResponse(MakeTypicalInitialModelState()); + TestSurface surface; + stream_->AttachSurface(&surface); + WaitForIdleTaskQueue(); + + EXPECT_TRUE(network_.query_request_sent); + EXPECT_TRUE(response_translator_.InjectedResponseConsumed()); + ASSERT_TRUE(surface.initial_state); +} + +TEST_F(FeedStreamTest, LoadFromNetworkFailsDueToProtoTranslation) { + // No data in the store, so we should fetch from the network. + // The network will respond with an empty response, which should fail proto + // translation. + TestSurface surface; + stream_->AttachSurface(&surface); + WaitForIdleTaskQueue(); + + EXPECT_EQ(LoadStreamStatus::kProtoTranslationFailed, + event_observer_.load_stream_status); +} + +TEST_F(FeedStreamTest, DoNotLoadFromNetworkWhenOffline) { + is_offline_ = true; + response_translator_.InjectResponse(MakeTypicalInitialModelState()); + TestSurface surface; + stream_->AttachSurface(&surface); + WaitForIdleTaskQueue(); + // TODO(harringtond): Implement zero-state and check that it is triggered. + EXPECT_EQ(LoadStreamStatus::kCannotLoadFromNetworkOffline, + event_observer_.load_stream_status); + EXPECT_FALSE(network_.query_request_sent); +} + +TEST_F(FeedStreamTest, DoNotLoadStreamWhenArticleListIsHidden) { + stream_->SetArticlesListVisible(false); + response_translator_.InjectResponse(MakeTypicalInitialModelState()); + TestSurface surface; + stream_->AttachSurface(&surface); + WaitForIdleTaskQueue(); + // TODO(harringtond): Implement zero-state and check that it is triggered. + EXPECT_EQ(LoadStreamStatus::kLoadNotAllowedArticlesListHidden, + event_observer_.load_stream_status); +} + +TEST_F(FeedStreamTest, DoNotLoadStreamWhenEulaIsNotAccepted) { + is_eula_accepted_ = false; + response_translator_.InjectResponse(MakeTypicalInitialModelState()); + TestSurface surface; + stream_->AttachSurface(&surface); + WaitForIdleTaskQueue(); + // TODO(harringtond): Implement zero-state and check that it is triggered. + EXPECT_FALSE(network_.query_request_sent); + EXPECT_EQ(LoadStreamStatus::kLoadNotAllowedEulaNotAccepted, + event_observer_.load_stream_status); +} + +TEST_F(FeedStreamTest, DoNotLoadFromNetworkAfterHistoryIsDeleted) { + stream_->OnHistoryDeleted(); + task_environment_.FastForwardBy(kSuppressRefreshDuration - + base::TimeDelta::FromSeconds(1)); + response_translator_.InjectResponse(MakeTypicalInitialModelState()); + TestSurface surface; + stream_->AttachSurface(&surface); + WaitForIdleTaskQueue(); + + ASSERT_FALSE(surface.initial_state); + EXPECT_EQ(LoadStreamStatus::kCannotLoadFromNetworkSupressedForHistoryDelete, + event_observer_.load_stream_status); + + stream_->DetachSurface(&surface); + task_environment_.FastForwardBy(base::TimeDelta::FromSeconds(2)); + stream_->AttachSurface(&surface); + WaitForIdleTaskQueue(); + + ASSERT_TRUE(surface.initial_state); + ASSERT_EQ(2, surface.initial_state->updated_slices().size()); +} + +TEST_F(FeedStreamTest, ShouldMakeFeedQueryRequestConsumesQuota) { + LoadStreamStatus status = LoadStreamStatus::kNoStatus; + for (; status == LoadStreamStatus::kNoStatus; + status = stream_->ShouldMakeFeedQueryRequest()) { + } + + ASSERT_EQ(LoadStreamStatus::kCannotLoadFromNetworkThrottled, status); } TEST_F(FeedStreamTest, LoadStreamFromStore) { - // Fill the store with stream data, and verify it loads. - store_->SaveFullStream(MakeTypicalInitialModelState(), base::DoNothing()); + // Fill the store with stream data that is just barely fresh, and verify it + // loads. + user_classifier_->OverrideUserClass(UserClass::kActiveSuggestionsConsumer); + store_->SaveFullStream(MakeTypicalInitialModelState( + kTestTimeEpoch - base::TimeDelta::FromHours(12) + + base::TimeDelta::FromMinutes(1)), + base::DoNothing()); TestSurface surface; stream_->AttachSurface(&surface); WaitForIdleTaskQueue();
diff --git a/components/feed/core/v2/master_refresh_throttler.cc b/components/feed/core/v2/master_refresh_throttler.cc deleted file mode 100644 index f247555..0000000 --- a/components/feed/core/v2/master_refresh_throttler.cc +++ /dev/null
@@ -1,38 +0,0 @@ -// Copyright 2020 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "components/feed/core/v2/master_refresh_throttler.h" - -#include "components/prefs/pref_service.h" - -namespace feed { - -MasterRefreshThrottler::MasterRefreshThrottler(PrefService* profile_prefs, - const base::Clock* clock) - : rare_throttler_(UserClass::kRareSuggestionsViewer, profile_prefs, clock), - active_viewer_throttler_(UserClass::kActiveSuggestionsViewer, - profile_prefs, - clock), - active_consumer_throttler_(UserClass::kActiveSuggestionsConsumer, - profile_prefs, - clock) - -{} - -bool MasterRefreshThrottler::RequestQuota(UserClass user_class) { - return GetThrottler(user_class).RequestQuota(); -} - -RefreshThrottler& MasterRefreshThrottler::GetThrottler(UserClass user_class) { - switch (user_class) { - case UserClass::kRareSuggestionsViewer: - return rare_throttler_; - case UserClass::kActiveSuggestionsViewer: - return active_viewer_throttler_; - case UserClass::kActiveSuggestionsConsumer: - return active_consumer_throttler_; - } -} - -} // namespace feed
diff --git a/components/feed/core/v2/master_refresh_throttler.h b/components/feed/core/v2/master_refresh_throttler.h deleted file mode 100644 index bf97e76..0000000 --- a/components/feed/core/v2/master_refresh_throttler.h +++ /dev/null
@@ -1,36 +0,0 @@ -// Copyright 2020 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef COMPONENTS_FEED_CORE_V2_MASTER_REFRESH_THROTTLER_H_ -#define COMPONENTS_FEED_CORE_V2_MASTER_REFRESH_THROTTLER_H_ - -#include "components/feed/core/common/enums.h" -#include "components/feed/core/common/refresh_throttler.h" -#include "components/feed/core/common/user_classifier.h" - -class PrefService; - -namespace feed { - -// A refresh throttler that supports all |UserClass|es. -// TODO(crbug.com/1066230): When v2 is the only Feed implementation, make -// |RefreshThrottler| a private implementation detail of this class. -class MasterRefreshThrottler { - public: - MasterRefreshThrottler(PrefService* profile_prefs, const base::Clock* clock); - MasterRefreshThrottler(const MasterRefreshThrottler&) = delete; - MasterRefreshThrottler& operator=(const MasterRefreshThrottler&) = delete; - - bool RequestQuota(UserClass user_class); - - private: - RefreshThrottler& GetThrottler(UserClass user_class); - - RefreshThrottler rare_throttler_; - RefreshThrottler active_viewer_throttler_; - RefreshThrottler active_consumer_throttler_; -}; - -} // namespace feed -#endif // COMPONENTS_FEED_CORE_V2_MASTER_REFRESH_THROTTLER_H_
diff --git a/components/feed/core/v2/prefs.cc b/components/feed/core/v2/prefs.cc new file mode 100644 index 0000000..d3d5a0b --- /dev/null +++ b/components/feed/core/v2/prefs.cc
@@ -0,0 +1,56 @@ +// Copyright 2020 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "components/feed/core/v2/prefs.h" + +#include <utility> + +#include "base/value_conversions.h" +#include "base/values.h" +#include "components/prefs/pref_registry_simple.h" +#include "components/prefs/pref_service.h" + +namespace feed { +namespace { +const char kThrottlerRequestCountListPrefName[] = + "feedv2.request_throttler.request_counts"; +const char kThrottlerLastRequestTime[] = + "feedv2.request_throttler.last_request_time"; + +} // namespace + +namespace prefs { + +std::vector<int> GetThrottlerRequestCounts(PrefService* pref_service) { + std::vector<int> result; + const auto& value_list = + pref_service->GetList(kThrottlerRequestCountListPrefName)->GetList(); + for (const base::Value& value : value_list) { + result.push_back(value.is_int() ? value.GetInt() : 0); + } + return result; +} + +void SetThrottlerRequestCounts(std::vector<int> request_counts, + PrefService* pref_service) { + std::vector<base::Value> value_list; + for (int count : request_counts) { + value_list.push_back(base::Value(count)); + } + + pref_service->Set(kThrottlerRequestCountListPrefName, + base::Value(std::move(value_list))); +} + +base::Time GetLastRequestTime(PrefService* pref_service) { + return pref_service->GetTime(kThrottlerLastRequestTime); +} + +void SetLastRequestTime(base::Time request_time, PrefService* pref_service) { + return pref_service->SetTime(kThrottlerLastRequestTime, request_time); +} + +} // namespace prefs + +} // namespace feed
diff --git a/components/feed/core/v2/prefs.h b/components/feed/core/v2/prefs.h new file mode 100644 index 0000000..29da3c9 --- /dev/null +++ b/components/feed/core/v2/prefs.h
@@ -0,0 +1,33 @@ +// Copyright 2020 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef COMPONENTS_FEED_CORE_V2_PREFS_H_ +#define COMPONENTS_FEED_CORE_V2_PREFS_H_ + +#include <vector> + +#include "base/time/time.h" + +class PrefService; + +namespace feed { +namespace prefs { + +// Functions for accessing prefs. + +// For counting previously made requests, one integer for each +// |NetworkRequestType|. +std::vector<int> GetThrottlerRequestCounts(PrefService* pref_service); +void SetThrottlerRequestCounts(std::vector<int> request_counts, + PrefService* pref_service); + +// Time of the last request. For determining whether the next day's quota should +// be released. +base::Time GetLastRequestTime(PrefService* pref_service); +void SetLastRequestTime(base::Time request_time, PrefService* pref_service); + +} // namespace prefs +} // namespace feed + +#endif // COMPONENTS_FEED_CORE_V2_PREFS_H_
diff --git a/components/feed/core/v2/proto_util.cc b/components/feed/core/v2/proto_util.cc index 19537c6..9002971 100644 --- a/components/feed/core/v2/proto_util.cc +++ b/components/feed/core/v2/proto_util.cc
@@ -8,6 +8,7 @@ #include "base/strings/strcat.h" #include "base/strings/string_number_conversions.h" +#include "components/feed/core/proto/v2/store.pb.h" namespace feed { @@ -34,3 +35,15 @@ } } // namespace feed + +namespace feedstore { +void SetLastAddedTime(base::Time t, feedstore::StreamData* data) { + data->set_last_added_time_millis( + (t - base::Time::UnixEpoch()).InMilliseconds()); +} + +base::Time GetLastAddedTime(const feedstore::StreamData& data) { + return base::Time::UnixEpoch() + + base::TimeDelta::FromMilliseconds(data.last_added_time_millis()); +} +} // namespace feedstore
diff --git a/components/feed/core/v2/proto_util.h b/components/feed/core/v2/proto_util.h index 0870112e..c7700625 100644 --- a/components/feed/core/v2/proto_util.h +++ b/components/feed/core/v2/proto_util.h
@@ -7,8 +7,14 @@ #include <string> +#include "base/time/time.h" + #include "components/feed/core/proto/v2/wire/content_id.pb.h" +namespace feedstore { +class StreamData; +} + // Helper functions/classes for dealing with feed proto messages. namespace feed { @@ -28,4 +34,11 @@ } // namespace feed +namespace feedstore { + +void SetLastAddedTime(base::Time t, feedstore::StreamData* data); +base::Time GetLastAddedTime(const feedstore::StreamData& data); + +} // namespace feedstore + #endif // COMPONENTS_FEED_CORE_V2_PROTO_UTIL_H_
diff --git a/components/feed/core/v2/request_throttler.cc b/components/feed/core/v2/request_throttler.cc new file mode 100644 index 0000000..95d4d8b5 --- /dev/null +++ b/components/feed/core/v2/request_throttler.cc
@@ -0,0 +1,76 @@ +// Copyright 2020 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "components/feed/core/v2/request_throttler.h" + +#include <vector> + +#include "base/time/clock.h" +#include "components/feed/core/v2/prefs.h" +#include "components/prefs/pref_service.h" + +namespace feed { +namespace { +int GetMaxRequestsPerDay(NetworkRequestType request_type) { + // TODO(harringtond): Decide what launchable values are. + switch (request_type) { + case NetworkRequestType::kFeedQuery: + return 20; + case NetworkRequestType::kUploadActions: + return 20; + } +} + +int DaysSinceOrigin(const base::Time& time_value) { + // |LocalMidnight()| DCHECKs on some platforms if |time_value| is too small + // (like zero). So if time is before the unix epoch, return 0. + return time_value < base::Time::UnixEpoch() + ? 0 + : time_value.LocalMidnight().since_origin().InDays(); +} + +} // namespace + +RequestThrottler::RequestThrottler(PrefService* pref_service, + const base::Clock* clock) + : pref_service_(pref_service), clock_(clock) { + DCHECK(pref_service); + DCHECK(clock); +} + +bool RequestThrottler::RequestQuota(NetworkRequestType request_type) { + ResetCountersIfDayChanged(); + + const int max_requests_per_day = GetMaxRequestsPerDay(request_type); + + // Fetch request counts from prefs. There's an entry for each request type. + // We may need to resize the list. + std::vector<int> request_counts = + feed::prefs::GetThrottlerRequestCounts(pref_service_); + const size_t request_count_index = static_cast<size_t>(request_type); + if (request_counts.size() <= request_count_index) + request_counts.resize(request_count_index + 1); + + int& requests_already_made = request_counts[request_count_index]; + if (requests_already_made >= max_requests_per_day) + return false; + requests_already_made++; + feed::prefs::SetThrottlerRequestCounts(request_counts, pref_service_); + return true; +} + +void RequestThrottler::ResetCountersIfDayChanged() { + // Grant new quota on local midnight to spread out when clients that start + // making un-throttled requests to server. + const base::Time now = clock_->Now(); + const bool day_changed = + DaysSinceOrigin(feed::prefs::GetLastRequestTime(pref_service_)) != + DaysSinceOrigin(now); + feed::prefs::SetLastRequestTime(now, pref_service_); + + if (day_changed) + feed::prefs::SetThrottlerRequestCounts({}, pref_service_); +} + +} // namespace feed
diff --git a/components/feed/core/v2/request_throttler.h b/components/feed/core/v2/request_throttler.h new file mode 100644 index 0000000..344d600f2 --- /dev/null +++ b/components/feed/core/v2/request_throttler.h
@@ -0,0 +1,41 @@ +// Copyright 2020 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef COMPONENTS_FEED_CORE_V2_REQUEST_THROTTLER_H_ +#define COMPONENTS_FEED_CORE_V2_REQUEST_THROTTLER_H_ + +#include "components/feed/core/v2/enums.h" + +class PrefService; +namespace base { +class Clock; +} + +namespace feed { + +// Limits number of network requests that can be made each day. +class RequestThrottler { + public: + RequestThrottler(PrefService* pref_service, const base::Clock* clock); + + RequestThrottler(const RequestThrottler&) = delete; + RequestThrottler& operator=(const RequestThrottler&) = delete; + + // Returns whether quota is available for another request, persists the usage + // of said quota, and reports this information to UMA. + bool RequestQuota(NetworkRequestType request_type); + + private: + void ResetCountersIfDayChanged(); + + // Provides durable storage. + PrefService* pref_service_; + + // Used to access current time, injected for testing. + const base::Clock* clock_; +}; + +} // namespace feed + +#endif // COMPONENTS_FEED_CORE_V2_REQUEST_THROTTLER_H_
diff --git a/components/feed/core/v2/request_throttler_unittest.cc b/components/feed/core/v2/request_throttler_unittest.cc new file mode 100644 index 0000000..0cf0e98 --- /dev/null +++ b/components/feed/core/v2/request_throttler_unittest.cc
@@ -0,0 +1,55 @@ +// Copyright 2020 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "components/feed/core/v2/request_throttler.h" + +#include <memory> + +#include "base/test/simple_test_clock.h" +#include "components/feed/core/common/pref_names.h" +#include "components/prefs/testing_pref_service.h" +#include "testing/gtest/include/gtest/gtest.h" + +namespace feed { +namespace { + +const int kMaximumQueryRequestsPerDay = 20; + +class FeedRequestThrottlerTest : public testing::Test { + public: + FeedRequestThrottlerTest() { + RegisterProfilePrefs(test_prefs_.registry()); + + base::Time now; + EXPECT_TRUE(base::Time::FromString("2018-06-11 12:01AM", &now)); + test_clock_.SetNow(now); + } + + protected: + TestingPrefServiceSimple test_prefs_; + base::SimpleTestClock test_clock_; + RequestThrottler throttler_{&test_prefs_, &test_clock_}; +}; + +TEST_F(FeedRequestThrottlerTest, RequestQuotaAllAtOnce) { + for (int i = 0; i < kMaximumQueryRequestsPerDay; ++i) { + EXPECT_TRUE(throttler_.RequestQuota(NetworkRequestType::kFeedQuery)); + } + EXPECT_FALSE(throttler_.RequestQuota(NetworkRequestType::kFeedQuery)); +} + +TEST_F(FeedRequestThrottlerTest, QuotaIsPerDay) { + for (int i = 0; i < kMaximumQueryRequestsPerDay; ++i) { + EXPECT_TRUE(throttler_.RequestQuota(NetworkRequestType::kUploadActions)); + } + // Because we started at 12:01AM, we need to advance 24 hours before making + // another successful request. + test_clock_.Advance(base::TimeDelta::FromHours(23)); + EXPECT_FALSE(throttler_.RequestQuota(NetworkRequestType::kUploadActions)); + test_clock_.Advance(base::TimeDelta::FromHours(1)); + EXPECT_TRUE(throttler_.RequestQuota(NetworkRequestType::kUploadActions)); +} + +} // namespace +} // namespace feed
diff --git a/components/feed/core/v2/scheduling.cc b/components/feed/core/v2/scheduling.cc index 8ea45b1..2151147 100644 --- a/components/feed/core/v2/scheduling.cc +++ b/components/feed/core/v2/scheduling.cc
@@ -40,16 +40,12 @@ } } -LoadRefreshBehavior DetermineLoadRefreshBehavior(UserClass user_class, - bool has_content, - base::TimeDelta content_age) { - if (!has_content) - return LoadRefreshBehavior::kWaitForRefresh; - if (content_age > - GetUserClassTriggerThreshold(user_class, TriggerType::kForegrounded)) - return LoadRefreshBehavior::kLimitedWaitForRefresh; - // TODO(harringtond): We are probably not going to support |kRefreshInline|. - return LoadRefreshBehavior::kRefreshInline; +bool ShouldWaitForNewContent(UserClass user_class, + bool has_content, + base::TimeDelta content_age) { + return !has_content || + content_age > GetUserClassTriggerThreshold(user_class, + TriggerType::kForegrounded); } } // namespace feed
diff --git a/components/feed/core/v2/scheduling.h b/components/feed/core/v2/scheduling.h index 27ddc1f..3361fc66 100644 --- a/components/feed/core/v2/scheduling.h +++ b/components/feed/core/v2/scheduling.h
@@ -16,16 +16,15 @@ // The following should be true: // - At most one fetch is attempted per T. // - Content is considered stale if time since last fetch is > T. We'll prefer -// to refresh stale content before showing it. See LoadRefreshBehavior. +// to refresh stale content before showing it. // - For TriggerType::kFixedTimer, T is the time between scheduled fetches. base::TimeDelta GetUserClassTriggerThreshold(UserClass user_class, TriggerType trigger); -// Determines which LoadRefreshBehavior should be used when refreshing the -// stream. -LoadRefreshBehavior DetermineLoadRefreshBehavior(UserClass user_class, - bool has_content, - base::TimeDelta content_age); +// Returns whether we should wait for new content before showing stream content. +bool ShouldWaitForNewContent(UserClass user_class, + bool has_content, + base::TimeDelta content_age); } // namespace feed #endif // COMPONENTS_FEED_CORE_V2_SCHEDULING_H_
diff --git a/components/feed/core/v2/stream_event_metrics.cc b/components/feed/core/v2/stream_event_metrics.cc index 3de72f3..ffce8fa 100644 --- a/components/feed/core/v2/stream_event_metrics.cc +++ b/components/feed/core/v2/stream_event_metrics.cc
@@ -7,6 +7,11 @@ namespace feed { +void StreamEventMetrics::OnLoadStream(LoadStreamStatus load_from_store_status, + LoadStreamStatus final_status) { + // TODO(harringtond): Add UMA for this, or record it with another histogram. +} + void StreamEventMetrics::OnMaybeTriggerRefresh(TriggerType trigger, bool clear_all_before_refresh) { // TODO(harringtond): Either add UMA for this or remove it.
diff --git a/components/feed/core/v2/stream_event_metrics.h b/components/feed/core/v2/stream_event_metrics.h index 745b241..3940c2f 100644 --- a/components/feed/core/v2/stream_event_metrics.h +++ b/components/feed/core/v2/stream_event_metrics.h
@@ -5,6 +5,7 @@ #ifndef COMPONENTS_FEED_CORE_V2_STREAM_EVENT_METRICS_H_ #define COMPONENTS_FEED_CORE_V2_STREAM_EVENT_METRICS_H_ +#include "components/feed/core/v2/enums.h" #include "components/feed/core/v2/feed_stream.h" namespace feed { @@ -12,6 +13,8 @@ // Reports UMA metrics for stream events. class StreamEventMetrics : public FeedStream::EventObserver { public: + void OnLoadStream(LoadStreamStatus load_from_store_status, + LoadStreamStatus final_status) override; void OnMaybeTriggerRefresh(TriggerType trigger, bool clear_all_before_refresh) override; void OnClearAll(base::TimeDelta time_since_last_clear) override;
diff --git a/components/feed/core/v2/stream_model_update_request.cc b/components/feed/core/v2/stream_model_update_request.cc index 0c0b88e..1cd8d8d7 100644 --- a/components/feed/core/v2/stream_model_update_request.cc +++ b/components/feed/core/v2/stream_model_update_request.cc
@@ -14,6 +14,7 @@ #include "components/feed/core/proto/v2/wire/payload_metadata.pb.h" #include "components/feed/core/proto/v2/wire/stream_structure.pb.h" #include "components/feed/core/proto/v2/wire/token.pb.h" +#include "components/feed/core/v2/proto_util.h" namespace feed { @@ -208,7 +209,8 @@ std::unique_ptr<StreamModelUpdateRequest> TranslateWireResponse( feedwire::Response response, - base::TimeDelta response_time) { + base::TimeDelta response_time, + base::Time current_time) { if (response.response_version() != feedwire::Response::FEED_RESPONSE) return nullptr; @@ -242,10 +244,11 @@ *result->stream_data.mutable_shared_state_id() = result->shared_states.front().content_id(); } - + feedstore::SetLastAddedTime(current_time, &result->stream_data); result->server_response_time = feed_response->feed_response_metadata().response_time_ms(); result->response_time = response_time; + return result; }
diff --git a/components/feed/core/v2/stream_model_update_request.h b/components/feed/core/v2/stream_model_update_request.h index a81b79c..6aea209 100644 --- a/components/feed/core/v2/stream_model_update_request.h +++ b/components/feed/core/v2/stream_model_update_request.h
@@ -66,7 +66,8 @@ std::unique_ptr<StreamModelUpdateRequest> TranslateWireResponse( feedwire::Response response, - base::TimeDelta response_time); + base::TimeDelta response_time, + base::Time current_time); } // namespace feed
diff --git a/components/feed/core/v2/stream_model_update_request_unittest.cc b/components/feed/core/v2/stream_model_update_request_unittest.cc index f8cad45..1e70748d 100644 --- a/components/feed/core/v2/stream_model_update_request_unittest.cc +++ b/components/feed/core/v2/stream_model_update_request_unittest.cc
@@ -14,6 +14,7 @@ #include "base/time/time.h" #include "components/feed/core/proto/v2/wire/feed_response.pb.h" #include "components/feed/core/proto/v2/wire/response.pb.h" +#include "components/feed/core/v2/proto_util.h" #include "testing/gtest/include/gtest/gtest.h" namespace feed { @@ -21,7 +22,8 @@ const char kResponsePbPath[] = "components/test/data/feed/response.binarypb"; constexpr base::TimeDelta kResponseTime = base::TimeDelta::FromSeconds(42); - +const base::Time kCurrentTime = + base::Time::UnixEpoch() + base::TimeDelta::FromDays(123); // TODO(iwells): Replace response.binarypb with a response that uses the new // wire protocol. // @@ -75,9 +77,10 @@ kExpectedStreamStructureCount + 1); std::unique_ptr<StreamModelUpdateRequest> translated = - TranslateWireResponse(response, kResponseTime); + TranslateWireResponse(response, kResponseTime, kCurrentTime); ASSERT_TRUE(translated); + EXPECT_EQ(kCurrentTime, feedstore::GetLastAddedTime(translated->stream_data)); ASSERT_EQ(translated->stream_structures.size(), static_cast<size_t>(kExpectedStreamStructureCount));
diff --git a/components/feed/core/v2/tasks/load_stream_from_store_task.cc b/components/feed/core/v2/tasks/load_stream_from_store_task.cc index 0d1127ec4..c3c2a26 100644 --- a/components/feed/core/v2/tasks/load_stream_from_store_task.cc +++ b/components/feed/core/v2/tasks/load_stream_from_store_task.cc
@@ -7,9 +7,12 @@ #include <algorithm> #include <utility> +#include "base/time/clock.h" #include "components/feed/core/proto/v2/store.pb.h" #include "components/feed/core/v2/feed_store.h" +#include "components/feed/core/v2/proto_util.h" #include "components/feed/core/v2/public/feed_stream_api.h" +#include "components/feed/core/v2/scheduling.h" #include "components/feed/core/v2/stream_model_update_request.h" namespace feed { @@ -22,8 +25,12 @@ LoadStreamFromStoreTask::LoadStreamFromStoreTask( FeedStore* store, + const base::Clock* clock, + UserClass user_class, base::OnceCallback<void(Result)> callback) : store_(store), + clock_(clock), + user_class_(user_class), result_callback_(std::move(callback)), update_request_(std::make_unique<StreamModelUpdateRequest>()) {} @@ -44,8 +51,19 @@ Complete(LoadStreamStatus::kNoStreamDataInStore); return; } - // TODO(harringtond): Add other failure cases: - // - Is the content stale? + if (!ignore_staleness_) { + const base::TimeDelta content_age = + clock_->Now() - feedstore::GetLastAddedTime(result.stream_data); + if (content_age < base::TimeDelta()) { + Complete(LoadStreamStatus::kDataInStoreIsStaleTimestampInFuture); + return; + } else if (ShouldWaitForNewContent(user_class_, true, content_age)) { + Complete(LoadStreamStatus::kDataInStoreIsStale); + return; + } + } + + // TODO(harringtond): Add other failure cases? std::vector<ContentId> referenced_content_ids; for (const feedstore::StreamStructureSet& structure_set :
diff --git a/components/feed/core/v2/tasks/load_stream_from_store_task.h b/components/feed/core/v2/tasks/load_stream_from_store_task.h index 99e34c1d..3718c2c9 100644 --- a/components/feed/core/v2/tasks/load_stream_from_store_task.h +++ b/components/feed/core/v2/tasks/load_stream_from_store_task.h
@@ -14,6 +14,10 @@ #include "components/feed/core/v2/feed_store.h" #include "components/offline_pages/task/task.h" +namespace base { +class Clock; +} + namespace feed { struct StreamModelUpdateRequest; @@ -30,11 +34,15 @@ }; LoadStreamFromStoreTask(FeedStore* store, + const base::Clock* clock, + UserClass user_class, base::OnceCallback<void(Result)> callback); ~LoadStreamFromStoreTask() override; LoadStreamFromStoreTask(const LoadStreamFromStoreTask&) = delete; LoadStreamFromStoreTask& operator=(const LoadStreamFromStoreTask&) = delete; + void IgnoreStalenessForTesting() { ignore_staleness_ = true; } + private: void Run() override; @@ -48,6 +56,9 @@ } FeedStore* store_; // Unowned. + const base::Clock* clock_; + UserClass user_class_; + bool ignore_staleness_ = false; base::OnceCallback<void(Result)> result_callback_; std::unique_ptr<StreamModelUpdateRequest> update_request_;
diff --git a/components/feed/core/v2/tasks/load_stream_task.cc b/components/feed/core/v2/tasks/load_stream_task.cc index daeabcc..82e1086 100644 --- a/components/feed/core/v2/tasks/load_stream_task.cc +++ b/components/feed/core/v2/tasks/load_stream_task.cc
@@ -7,7 +7,9 @@ #include <memory> #include <utility> +#include "base/bind_helpers.h" #include "base/logging.h" +#include "base/time/clock.h" #include "base/time/time.h" #include "components/feed/core/proto/v2/wire/client_info.pb.h" #include "components/feed/core/proto/v2/wire/feed_request.pb.h" @@ -37,7 +39,7 @@ } load_from_store_task_ = std::make_unique<LoadStreamFromStoreTask>( - stream_->GetStore(), + stream_->GetStore(), stream_->GetClock(), stream_->GetUserClass(), base::BindOnce(&LoadStreamTask::LoadFromStoreComplete, GetWeakPtr())); load_from_store_task_->Execute(base::DoNothing()); } @@ -57,6 +59,12 @@ return; } + LoadStreamStatus final_status = stream_->ShouldMakeFeedQueryRequest(); + if (final_status != LoadStreamStatus::kNoStatus) { + Done(final_status); + return; + } + // TODO(harringtond): Add throttling. // TODO(harringtond): Request parameters here are all placeholder values. feedwire::Request request; @@ -83,12 +91,17 @@ std::unique_ptr<StreamModelUpdateRequest> update_request = stream_->GetWireResponseTranslator()->TranslateWireResponse( - *result.response_body, base::TimeTicks::Now() - fetch_start_time_); + *result.response_body, base::TimeTicks::Now() - fetch_start_time_, + stream_->GetClock()->Now()); if (!update_request) { Done(LoadStreamStatus::kProtoTranslationFailed); return; } + stream_->GetStore()->SaveFullStream( + std::make_unique<StreamModelUpdateRequest>(*update_request), + base::DoNothing()); + auto model = std::make_unique<StreamModel>(); model->Update(std::move(update_request)); stream_->LoadModel(std::move(model));
diff --git a/components/feed/core/v2/test/stream_builder.cc b/components/feed/core/v2/test/stream_builder.cc index 97dd8f3..2dab90e 100644 --- a/components/feed/core/v2/test/stream_builder.cc +++ b/components/feed/core/v2/test/stream_builder.cc
@@ -7,10 +7,13 @@ #include <utility> #include "base/strings/string_number_conversions.h" +#include "components/feed/core/v2/proto_util.h" #include "components/feed/core/v2/stream_model_update_request.h" namespace feed { +const base::Time kTestTimeEpoch = base::Time::UnixEpoch(); + ContentId MakeContentId(ContentId::Type type, std::string content_domain, int id_number) { @@ -143,7 +146,8 @@ }; } -std::unique_ptr<StreamModelUpdateRequest> MakeTypicalInitialModelState() { +std::unique_ptr<StreamModelUpdateRequest> MakeTypicalInitialModelState( + base::Time last_added_time) { auto initial_update = std::make_unique<StreamModelUpdateRequest>(); initial_update->source = StreamModelUpdateRequest::Source::kInitialLoadFromStore; @@ -159,6 +163,7 @@ initial_update->shared_states.push_back(MakeSharedState(0)); *initial_update->stream_data.mutable_content_id() = MakeRootId(); *initial_update->stream_data.mutable_shared_state_id() = MakeSharedStateId(0); + SetLastAddedTime(last_added_time, &initial_update->stream_data); return initial_update; }
diff --git a/components/feed/core/v2/test/stream_builder.h b/components/feed/core/v2/test/stream_builder.h index 94b7da1..536c4d7de 100644 --- a/components/feed/core/v2/test/stream_builder.h +++ b/components/feed/core/v2/test/stream_builder.h
@@ -9,6 +9,7 @@ #include <string> #include <vector> +#include "base/time/time.h" #include "components/feed/core/proto/v2/store.pb.h" #include "components/feed/core/v2/public/feed_stream_api.h" @@ -16,6 +17,8 @@ namespace feed { struct StreamModelUpdateRequest; +extern const base::Time kTestTimeEpoch; + ContentId MakeContentId(ContentId::Type type, std::string content_domain, int id_number); @@ -46,7 +49,8 @@ // |-Cluster 1 // |-Content 1 std::vector<feedstore::DataOperation> MakeTypicalStreamOperations(); -std::unique_ptr<StreamModelUpdateRequest> MakeTypicalInitialModelState(); +std::unique_ptr<StreamModelUpdateRequest> MakeTypicalInitialModelState( + base::Time last_added_time = kTestTimeEpoch); } // namespace feed #endif // COMPONENTS_FEED_CORE_V2_TEST_STREAM_BUILDER_H_
diff --git a/components/omnibox/browser/autocomplete_result.cc b/components/omnibox/browser/autocomplete_result.cc index 6820fa7..d74a65b9 100644 --- a/components/omnibox/browser/autocomplete_result.cc +++ b/components/omnibox/browser/autocomplete_result.cc
@@ -73,11 +73,9 @@ }; // static -size_t AutocompleteResult::GetMaxMatches(bool is_zero_suggest) { +size_t AutocompleteResult::GetMaxMatches() { #if (defined(OS_ANDROID)) constexpr size_t kDefaultMaxAutocompleteMatches = 5; - if (is_zero_suggest) - return kDefaultMaxAutocompleteMatches; #elif defined(OS_IOS) // !defined(OS_ANDROID) constexpr size_t kDefaultMaxAutocompleteMatches = 6; #else // !defined(OS_ANDROID) && !defined(OS_IOS) @@ -586,7 +584,7 @@ const CompareWithDemoteByType<AutocompleteMatch>& comparing_object) { // In the process of trimming, drop all matches with a demoted relevance // score of 0. - size_t max_matches_by_policy = GetMaxMatches(input_from_omnibox_focus); + size_t max_matches_by_policy = GetMaxMatches(); size_t num_matches = 0; while (num_matches < matches.size() && comparing_object.GetDemotedRelevance(matches[num_matches]) > 0) {
diff --git a/components/omnibox/browser/autocomplete_result.h b/components/omnibox/browser/autocomplete_result.h index 408bbc7e..442bf033 100644 --- a/components/omnibox/browser/autocomplete_result.h +++ b/components/omnibox/browser/autocomplete_result.h
@@ -32,7 +32,7 @@ using MatchDedupComparator = std::pair<GURL, bool>; // Max number of matches we'll show from the various providers. - static size_t GetMaxMatches(bool is_zero_suggest = false); + static size_t GetMaxMatches(); AutocompleteResult(); ~AutocompleteResult();
diff --git a/components/omnibox/browser/local_history_zero_suggest_provider.cc b/components/omnibox/browser/local_history_zero_suggest_provider.cc index 79d32b6e..52cbb63 100644 --- a/components/omnibox/browser/local_history_zero_suggest_provider.cc +++ b/components/omnibox/browser/local_history_zero_suggest_provider.cc
@@ -156,7 +156,7 @@ AutocompleteProviderListener* listener) : AutocompleteProvider( AutocompleteProvider::TYPE_ZERO_SUGGEST_LOCAL_HISTORY), - max_matches_(AutocompleteResult::GetMaxMatches(/*is_zero_suggest=*/true)), + max_matches_(AutocompleteResult::GetMaxMatches()), client_(client), listener_(listener) {}
diff --git a/components/omnibox/common/omnibox_features.cc b/components/omnibox/common/omnibox_features.cc index a181260..0eac70f9 100644 --- a/components/omnibox/common/omnibox_features.cc +++ b/components/omnibox/common/omnibox_features.cc
@@ -199,7 +199,13 @@ // Returns whether IsInstantExtendedAPIEnabled should be ignored when deciding // the number of Google-provided search suggestions. const base::Feature kOmniboxDisableInstantExtendedLimit{ - "OmniboxDisableInstantExtendedLimit", base::FEATURE_DISABLED_BY_DEFAULT}; + "OmniboxDisableInstantExtendedLimit", +#if defined(OS_ANDROID) + base::FEATURE_ENABLED_BY_DEFAULT +#else + base::FEATURE_DISABLED_BY_DEFAULT +#endif +}; // Show the search engine logo in the omnibox on Android (desktop already does // this).
diff --git a/components/password_manager/core/browser/http_password_store_migrator.cc b/components/password_manager/core/browser/http_password_store_migrator.cc index c604c129..637bc8c 100644 --- a/components/password_manager/core/browser/http_password_store_migrator.cc +++ b/components/password_manager/core/browser/http_password_store_migrator.cc
@@ -9,6 +9,7 @@ #include "base/bind.h" #include "base/memory/weak_ptr.h" +#include "base/metrics/histogram_functions.h" #include "base/stl_util.h" #include "base/strings/strcat.h" #include "components/password_manager/core/browser/password_manager_client.h" @@ -97,8 +98,8 @@ void HttpPasswordStoreMigrator::OnHSTSQueryResult(HSTSResult is_hsts) { DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); - mode_ = - (is_hsts == HSTSResult::kYes) ? MigrationMode::MOVE : MigrationMode::COPY; + mode_ = (is_hsts == HSTSResult::kYes) ? HttpPasswordMigrationMode::kMove + : HttpPasswordMigrationMode::kCopy; got_hsts_query_result_ = true; if (is_hsts == HSTSResult::kYes) @@ -122,18 +123,17 @@ HttpPasswordStoreMigrator::MigrateHttpFormToHttps(*form); client_->GetProfilePasswordStore()->AddLogin(new_form); - if (mode_ == MigrationMode::MOVE) + if (mode_ == HttpPasswordMigrationMode::kMove) client_->GetProfilePasswordStore()->RemoveLogin(*form); *form = std::move(new_form); } + // Only log data if there was at least one migrated password. if (!results_.empty()) { - // Only log data if there was at least one migrated password. - metrics_util::LogCountHttpMigratedPasswords(results_.size()); - metrics_util::LogHttpPasswordMigrationMode( - mode_ == MigrationMode::MOVE - ? metrics_util::HTTP_PASSWORD_MIGRATION_MODE_MOVE - : metrics_util::HTTP_PASSWORD_MIGRATION_MODE_COPY); + base::UmaHistogramCounts100("PasswordManager.HttpPasswordMigrationCount", + results_.size()); + base::UmaHistogramEnumeration("PasswordManager.HttpPasswordMigrationMode", + mode_); } if (consumer_)
diff --git a/components/password_manager/core/browser/http_password_store_migrator.h b/components/password_manager/core/browser/http_password_store_migrator.h index 91bf4dc..6f2f8f0 100644 --- a/components/password_manager/core/browser/http_password_store_migrator.h +++ b/components/password_manager/core/browser/http_password_store_migrator.h
@@ -22,6 +22,18 @@ class PasswordManagerClient; +// These values are persisted to logs. Entries should not be renumbered and +// numeric values should never be reused. +// +// Needs to stay in sync with HttpPasswordMigrationMode in enums.xml. +enum class HttpPasswordMigrationMode { + // HTTP credentials are deleted after migration to HTTPS. + kMove = 0, + // HTTP credentials are kept after migration to HTTPS. + kCopy = 1, + kMaxValue = kCopy, +}; + // The class is responsible for migrating the passwords saved on HTTP to HTTPS // origin. It automatically determines whether HTTP passwords should be moved or // copied depending on the site's HSTS status. If a site has HSTS enabled, the @@ -62,11 +74,6 @@ void OnHSTSQueryResult(HSTSResult is_hsts); private: - enum class MigrationMode { - MOVE, // HTTP credentials are deleted after migration to HTTPS. - COPY, // HTTP credentials are kept after migration to HTTPS. - }; - void ProcessPasswordStoreResults(); const PasswordManagerClient* const client_; @@ -78,7 +85,7 @@ // if both are set to true |ProcessPasswordStoreResults| gets called. bool got_hsts_query_result_ = false; bool got_password_store_results_ = false; - MigrationMode mode_; + HttpPasswordMigrationMode mode_ = HttpPasswordMigrationMode::kMove; std::vector<std::unique_ptr<autofill::PasswordForm>> results_; GURL http_origin_domain_; SEQUENCE_CHECKER(sequence_checker_);
diff --git a/components/password_manager/core/browser/password_form_metrics_recorder.cc b/components/password_manager/core/browser/password_form_metrics_recorder.cc index 00c2f04..ef8b2bc 100644 --- a/components/password_manager/core/browser/password_form_metrics_recorder.cc +++ b/components/password_manager/core/browser/password_form_metrics_recorder.cc
@@ -532,6 +532,8 @@ break; // Other reasons to show a bubble: + // TODO(crbug.com/1063853): Decide how to collect metrics for this new UI. + case metrics_util::AUTOMATIC_SAVE_UNSYNCED_CREDENTIALS_LOCALLY: case metrics_util::MANUAL_MANAGE_PASSWORDS: case metrics_util::AUTOMATIC_GENERATED_PASSWORD_CONFIRMATION: case metrics_util::MANUAL_GENERATED_PASSWORD_CONFIRMATION:
diff --git a/components/password_manager/core/browser/password_manager_client.h b/components/password_manager/core/browser/password_manager_client.h index be298cf..f513c3c 100644 --- a/components/password_manager/core/browser/password_manager_client.h +++ b/components/password_manager/core/browser/password_manager_client.h
@@ -22,6 +22,7 @@ #include "components/password_manager/core/browser/leak_detection_dialog_utils.h" #include "components/password_manager/core/browser/manage_passwords_referrer.h" #include "components/password_manager/core/browser/password_manager_metrics_util.h" +#include "components/password_manager/core/browser/password_reuse_detector.h" #include "components/password_manager/core/browser/password_store.h" #include "components/safe_browsing/buildflags.h" #include "net/cert/cert_status_flags.h" @@ -332,7 +333,7 @@ virtual void CheckProtectedPasswordEntry( metrics_util::PasswordType reused_password_type, const std::string& username, - const std::vector<std::string>& matching_domains, + const std::vector<MatchingReusedCredential>& matching_reused_credentials, bool password_field_exists) = 0; #endif
diff --git a/components/password_manager/core/browser/password_manager_metrics_util.cc b/components/password_manager/core/browser/password_manager_metrics_util.cc index 873bcd3..b327c6b 100644 --- a/components/password_manager/core/browser/password_manager_metrics_util.cc +++ b/components/password_manager/core/browser/password_manager_metrics_util.cc
@@ -140,16 +140,6 @@ ACCOUNT_CHOOSER_ACTION_COUNT); } -void LogCountHttpMigratedPasswords(int count) { - base::UmaHistogramCounts100("PasswordManager.HttpPasswordMigrationCount", - count); -} - -void LogHttpPasswordMigrationMode(HttpPasswordMigrationMode mode) { - base::UmaHistogramEnumeration("PasswordManager.HttpPasswordMigrationMode", - mode, HTTP_PASSWORD_MIGRATION_MODE_COUNT); -} - void LogCredentialManagerGetResult(CredentialManagerGetResult result, CredentialMediationRequirement mediation) { switch (mediation) {
diff --git a/components/password_manager/core/browser/password_manager_metrics_util.h b/components/password_manager/core/browser/password_manager_metrics_util.h index 17d689c5..56edd89 100644 --- a/components/password_manager/core/browser/password_manager_metrics_util.h +++ b/components/password_manager/core/browser/password_manager_metrics_util.h
@@ -30,7 +30,8 @@ MANUAL_WITH_PASSWORD_PENDING_UPDATE, AUTOMATIC_WITH_PASSWORD_PENDING_UPDATE, MANUAL_GENERATED_PASSWORD_CONFIRMATION, - NUM_DISPLAY_DISPOSITIONS + AUTOMATIC_SAVE_UNSYNCED_CREDENTIALS_LOCALLY, + NUM_DISPLAY_DISPOSITIONS, }; // Metrics: "PasswordManager.UIDismissalReason" @@ -224,13 +225,6 @@ kMaxValue = kAutoSignIn, }; -// Metrics: "PasswordManager.HttpPasswordMigrationMode" -enum HttpPasswordMigrationMode { - HTTP_PASSWORD_MIGRATION_MODE_MOVE, - HTTP_PASSWORD_MIGRATION_MODE_COPY, - HTTP_PASSWORD_MIGRATION_MODE_COUNT -}; - enum PasswordReusePasswordFieldDetected { NO_PASSWORD_FIELD, HAS_PASSWORD_FIELD, @@ -512,12 +506,6 @@ void LogAccountChooserUserActionOneAccount(AccountChooserUserAction action); void LogAccountChooserUserActionManyAccounts(AccountChooserUserAction action); -// Logs number of passwords migrated from HTTP to HTTPS. -void LogCountHttpMigratedPasswords(int count); - -// Logs mode of HTTP password migration. -void LogHttpPasswordMigrationMode(HttpPasswordMigrationMode mode); - // Log the result of navigator.credentials.get. void LogCredentialManagerGetResult(CredentialManagerGetResult result, CredentialMediationRequirement mediation);
diff --git a/components/password_manager/core/browser/password_manager_test_utils.h b/components/password_manager/core/browser/password_manager_test_utils.h index 451f5bac..e53078c0 100644 --- a/components/password_manager/core/browser/password_manager_test_utils.h +++ b/components/password_manager/core/browser/password_manager_test_utils.h
@@ -120,7 +120,7 @@ MOCK_METHOD4(OnReuseFound, void(size_t, base::Optional<PasswordHashData>, - const std::vector<std::string>&, + const std::vector<MatchingReusedCredential>&, int)); };
diff --git a/components/password_manager/core/browser/password_reuse_detection_manager.cc b/components/password_manager/core/browser/password_reuse_detection_manager.cc index b5512b1..3a83ff44 100644 --- a/components/password_manager/core/browser/password_reuse_detection_manager.cc +++ b/components/password_manager/core/browser/password_reuse_detection_manager.cc
@@ -106,15 +106,20 @@ void PasswordReuseDetectionManager::OnReuseFound( size_t password_length, base::Optional<PasswordHashData> reused_protected_password_hash, - const std::vector<std::string>& matching_domains, + const std::vector<MatchingReusedCredential>& matching_reused_credentials, int saved_passwords) { reuse_on_this_page_was_found_ = true; metrics_util::PasswordType reused_password_type = GetReusedPasswordType( - reused_protected_password_hash, matching_domains.size()); + reused_protected_password_hash, matching_reused_credentials.size()); if (password_manager_util::IsLoggingActive(client_)) { BrowserSavePasswordProgressLogger logger(client_->GetLogManager()); - std::vector<std::string> domains_to_log(matching_domains); + std::vector<std::string> domains_to_log; + domains_to_log.reserve(matching_reused_credentials.size()); + for (const MatchingReusedCredential& credential : + matching_reused_credentials) { + domains_to_log.push_back(credential.signon_realm); + } switch (reused_password_type) { case metrics_util::PasswordType::PRIMARY_ACCOUNT_PASSWORD: domains_to_log.push_back("CHROME SYNC PASSWORD"); @@ -145,7 +150,7 @@ : false; metrics_util::LogPasswordReuse(password_length, saved_passwords, - matching_domains.size(), + matching_reused_credentials.size(), password_field_detected, reused_password_type); #if defined(SYNC_PASSWORD_REUSE_WARNING_ENABLED) if (reused_password_type == @@ -159,7 +164,7 @@ : ""; client_->CheckProtectedPasswordEntry(reused_password_type, username, - matching_domains, + matching_reused_credentials, password_field_detected); #endif }
diff --git a/components/password_manager/core/browser/password_reuse_detection_manager.h b/components/password_manager/core/browser/password_reuse_detection_manager.h index 6667082..f947007 100644 --- a/components/password_manager/core/browser/password_reuse_detection_manager.h +++ b/components/password_manager/core/browser/password_reuse_detection_manager.h
@@ -10,6 +10,7 @@ #include "base/time/time.h" #include "build/build_config.h" #include "components/password_manager/core/browser/password_manager_metrics_util.h" +#include "components/password_manager/core/browser/password_reuse_detector.h" #include "components/password_manager/core/browser/password_reuse_detector_consumer.h" #include "url/gurl.h" @@ -39,7 +40,7 @@ void OnReuseFound( size_t password_length, base::Optional<PasswordHashData> reused_protected_password_hash, - const std::vector<std::string>& matching_domains, + const std::vector<MatchingReusedCredential>& matching_reused_credentials, int saved_passwords) override; void SetClockForTesting(base::Clock* clock);
diff --git a/components/password_manager/core/browser/password_reuse_detection_manager_unittest.cc b/components/password_manager/core/browser/password_reuse_detection_manager_unittest.cc index 6f641a8..2bda479 100644 --- a/components/password_manager/core/browser/password_reuse_detection_manager_unittest.cc +++ b/components/password_manager/core/browser/password_reuse_detection_manager_unittest.cc
@@ -139,7 +139,7 @@ PasswordReuseDetectionManager manager(&client_); // Simulate that reuse found. - manager.OnReuseFound(0ul, base::nullopt, {"https://example.com"}, 0); + manager.OnReuseFound(0ul, base::nullopt, {{"https://example.com"}}, 0); // Expect no checking of reuse. EXPECT_CALL(*store_, CheckReuse(_, _, _)).Times(0);
diff --git a/components/password_manager/core/browser/password_reuse_detector.cc b/components/password_manager/core/browser/password_reuse_detector.cc index ed6c654e..1e479a9c 100644 --- a/components/password_manager/core/browser/password_reuse_detector.cc +++ b/components/password_manager/core/browser/password_reuse_detector.cc
@@ -69,9 +69,20 @@ rhs.rend()); } -PasswordReuseDetector::PasswordReuseDetector() {} +bool MatchingReusedCredential::operator<( + const MatchingReusedCredential& other) const { + return std::tie(signon_realm, username) < + std::tie(other.signon_realm, other.username); +} -PasswordReuseDetector::~PasswordReuseDetector() {} +bool MatchingReusedCredential::operator==( + const MatchingReusedCredential& other) const { + return signon_realm == other.signon_realm && username == other.username; +} + +PasswordReuseDetector::PasswordReuseDetector() = default; + +PasswordReuseDetector::~PasswordReuseDetector() = default; void PasswordReuseDetector::OnGetPasswordStoreResults( std::vector<std::unique_ptr<autofill::PasswordForm>> results) { @@ -109,9 +120,9 @@ ? reused_enterprise_password_hash->length : 0; - std::vector<std::string> matching_domains; + std::vector<MatchingReusedCredential> matching_reused_credentials; size_t saved_reused_password_length = - CheckSavedPasswordReuse(input, domain, &matching_domains); + CheckSavedPasswordReuse(input, domain, &matching_reused_credentials); size_t max_reused_password_length = std::max({saved_reused_password_length, gaia_reused_password_length, @@ -128,8 +139,8 @@ reused_protected_password_hash = std::move(reused_enterprise_password_hash); } consumer->OnReuseFound(max_reused_password_length, - reused_protected_password_hash, matching_domains, - saved_passwords_); + reused_protected_password_hash, + matching_reused_credentials, saved_passwords_); } base::Optional<PasswordHashData> PasswordReuseDetector::CheckGaiaPasswordReuse( @@ -173,37 +184,44 @@ size_t PasswordReuseDetector::CheckSavedPasswordReuse( const base::string16& input, const std::string& domain, - std::vector<std::string>* matching_domains_out) { + std::vector<MatchingReusedCredential>* matching_reused_credentials_out) { const std::string registry_controlled_domain = GetRegistryControlledDomain(GURL(domain)); // More than one password call match |input| if they share a common suffix - // with |input|. Collect the set of domains for all matches. - std::set<std::string> matching_domains_set; + // with |input|. Collect the set of MatchingReusedCredential for all matches. + std::set<MatchingReusedCredential> matching_reused_credentials_set; // The longest password match is kept for metrics. size_t longest_match_len = 0; for (auto passwords_iterator = FindFirstSavedPassword(input); - passwords_iterator != passwords_.end(); + passwords_iterator != passwords_with_matching_reused_credentials_.end(); passwords_iterator = FindNextSavedPassword(input, passwords_iterator)) { - const std::set<std::string>& domains = passwords_iterator->second; - DCHECK(!domains.empty()); + const std::set<MatchingReusedCredential>& credentials = + passwords_iterator->second; + DCHECK(!credentials.empty()); + + std::set<std::string> signon_realms; + for (const auto& credential : credentials) { + signon_realms.insert( + GetRegistryControlledDomain(GURL(credential.signon_realm))); + } // If the page's URL matches a saved domain for this password, // this isn't password-reuse. - if (domains.find(registry_controlled_domain) != domains.end()) + if (base::Contains(signon_realms, registry_controlled_domain)) continue; - matching_domains_set.insert(domains.begin(), domains.end()); - DCHECK(passwords_iterator->first.size()); - if (longest_match_len < passwords_iterator->first.size()) - longest_match_len = passwords_iterator->first.size(); + matching_reused_credentials_set.insert(credentials.begin(), + credentials.end()); + DCHECK(!passwords_iterator->first.empty()); + longest_match_len = + std::max(longest_match_len, passwords_iterator->first.size()); } - if (matching_domains_set.size() == 0) - return 0; - *matching_domains_out = std::vector<std::string>(matching_domains_set.begin(), - matching_domains_set.end()); + matching_reused_credentials_out->assign( + matching_reused_credentials_set.begin(), + matching_reused_credentials_set.end()); return longest_match_len; } @@ -265,33 +283,35 @@ void PasswordReuseDetector::AddPassword(const autofill::PasswordForm& form) { if (form.password_value.size() < kMinPasswordLengthToCheck) return; - GURL signon_realm(form.signon_realm); - const std::string domain = GetRegistryControlledDomain(signon_realm); - std::set<std::string>& domains = passwords_[form.password_value]; - if (domains.find(domain) == domains.end()) { - ++saved_passwords_; - domains.insert(domain); + + const auto result = + passwords_with_matching_reused_credentials_[form.password_value].insert( + {form.signon_realm, form.username_value}); + if (result.second) { + saved_passwords_++; } } PasswordReuseDetector::passwords_iterator PasswordReuseDetector::FindFirstSavedPassword(const base::string16& input) { - // Keys in |passwords_| are ordered by lexicographical order of reversed - // strings. In order to check a password reuse a key of |passwords_| that is - // a suffix of |input| should be found. The longest such key should be the - // largest key in the |passwords_| keys order that is equal or smaller to - // |input|. There may be more, shorter, matches as well -- call - // FindNextSavedPassword(it) to find the next one. - if (passwords_.empty()) - return passwords_.end(); + // Keys in |passwords_with_matching_reused_credentials_| are ordered by + // lexicographical order of reversed strings. In order to check a password + // reuse a key of |passwords_with_matching_reused_credentials_| that is a + // suffix of |input| should be found. The longest such key should be the + // largest key in the |passwords_with_matching_reused_credentials_| keys order + // that is equal or smaller to |input|. There may be more, shorter, matches as + // well -- call FindNextSavedPassword(it) to find the next one. + if (passwords_with_matching_reused_credentials_.empty()) + return passwords_with_matching_reused_credentials_.end(); // lower_bound returns the first key that is bigger or equal to input. - passwords_iterator it = passwords_.lower_bound(input); - if (it != passwords_.end() && it->first == input) { + passwords_iterator it = + passwords_with_matching_reused_credentials_.lower_bound(input); + if (it != passwords_with_matching_reused_credentials_.end() && + it->first == input) { // If the key is equal then a saved password is found. return it; } - // Otherwise the previous key is a candidate for password reuse. return FindNextSavedPassword(input, it); } @@ -300,10 +320,12 @@ PasswordReuseDetector::FindNextSavedPassword( const base::string16& input, PasswordReuseDetector::passwords_iterator it) { - if (it == passwords_.begin()) - return passwords_.end(); + if (it == passwords_with_matching_reused_credentials_.begin()) + return passwords_with_matching_reused_credentials_.end(); --it; - return IsSuffix(input, it->first) ? it : passwords_.end(); + return IsSuffix(input, it->first) + ? it + : passwords_with_matching_reused_credentials_.end(); } } // namespace password_manager
diff --git a/components/password_manager/core/browser/password_reuse_detector.h b/components/password_manager/core/browser/password_reuse_detector.h index b5e0998..ce98ad7 100644 --- a/components/password_manager/core/browser/password_reuse_detector.h +++ b/components/password_manager/core/browser/password_reuse_detector.h
@@ -28,6 +28,16 @@ bool operator()(const base::string16& lhs, const base::string16& rhs) const; }; +// Container for the signon_realm and username that a compromised saved password +// is saved on/with. +struct MatchingReusedCredential { + std::string signon_realm; + base::string16 username; + + bool operator<(const MatchingReusedCredential& other) const; + bool operator==(const MatchingReusedCredential& other) const; +}; + // Per-profile class responsible for detection of password reuse, i.e. that the // user input on some site contains the password saved on another site. // It receives saved passwords through PasswordStoreConsumer interface. @@ -77,11 +87,15 @@ void ClearAllNonGmailPasswordHash(); private: - using passwords_iterator = std::map<base::string16, - std::set<std::string>, - ReverseStringLess>::const_iterator; + using PasswordsReusedCredentialsMap = + std::map<base::string16, + std::set<MatchingReusedCredential>, + ReverseStringLess>; - // Add password from |form| to |passwords_|. + using passwords_iterator = PasswordsReusedCredentialsMap::const_iterator; + + // Add password from |form| to |passwords_| and + // |passwords_with_matching_reused_credentials_|. void AddPassword(const autofill::PasswordForm& form); // If Gaia password reuse is found, return the PasswordHashData of the reused @@ -96,30 +110,40 @@ const base::string16& input, const std::string& domain); - // If saved-password reuse is found, fill in the registry-controlled - // domains that match any reused password, and return the length of the + // If saved-password reuse is found, fill in the MatchingReusedCredentials + // that match any reused password, and return the length of the // longest password matched. If no reuse is found, return 0. size_t CheckSavedPasswordReuse( const base::string16& input, const std::string& domain, - std::vector<std::string>* matching_domains_out); + std::vector<MatchingReusedCredential>* matching_reused_credentials_out); - // Returns the iterator to |passwords_| that corresponds to the longest key in - // |passwords_| that is a suffix of |input|. Returns passwords_.end() in case - // when no key in |passwords_| is a prefix of |input|. + // Returns the iterator to |passwords_with_matching_reused_credentials_| that + // corresponds to the longest key in + // |passwords_with_matching_reused_credentials_| that is a suffix of |input|. + // Returns passwords_with_matching_reused_credentials_.end() in case when no + // key in |passwords_with_matching_reused_credentials_| is a prefix of + // |input|. passwords_iterator FindFirstSavedPassword(const base::string16& input); // Call this repeatedly with iterator from |FindFirstSavedPassword| to - // find other matching passwords. This returns the iterator to |passwords_| - // that is the next previous matching entry that's a suffix of |input|, or - // passwords_.end() if there are no more. + // find other matching passwords. This returns the iterator to + // |passwords_with_matching_reused_credentials_| that is the next previous + // matching entry that's a suffix of |input|, or + // passwords_with_matching_reused_credentials_.end() if there are no more. passwords_iterator FindNextSavedPassword(const base::string16& input, passwords_iterator it); + // Contains all passwords. // A key is a password. - // A value is a set of registry controlled domains on which the password - // saved. - std::map<base::string16, std::set<std::string>, ReverseStringLess> passwords_; + // A value is a set of pairs of signon_realms and username on which the + // password is saved. + // The order of the keys are ordered in lexicographical order of reversed + // strings. The reason for this is to optimize the lookup time. If the strings + // were not reversed, it would be needed to loop over the length of the typed + // input and size of this map and then find the suffix (O(n*m*log(n))). + // See https://crbug.com/668155. + PasswordsReusedCredentialsMap passwords_with_matching_reused_credentials_; // Number of passwords in |passwords_|, each password is calculated the number // of times how many different sites it's saved on.
diff --git a/components/password_manager/core/browser/password_reuse_detector_consumer.h b/components/password_manager/core/browser/password_reuse_detector_consumer.h index 16c1981e..aec00fc 100644 --- a/components/password_manager/core/browser/password_reuse_detector_consumer.h +++ b/components/password_manager/core/browser/password_reuse_detector_consumer.h
@@ -13,6 +13,7 @@ #include "base/optional.h" #include "base/strings/string16.h" #include "components/password_manager/core/browser/hash_password_manager.h" +#include "components/password_manager/core/browser/password_reuse_detector.h" namespace password_manager { @@ -26,15 +27,16 @@ // Called when a password reuse is found. // |password_length| is the length of the re-used password, or the max length // if multiple passwords were matched. |reused_protected_password_hash| is the - // Gaia or enterprise password that matches the reuse. |matching_domains| is - // the list of domains for which |password| is saved (may be empty if - // |reused_protected_password_hash| is not null), |saved_passwords| - // is the total number of passwords (with unique domains) stored in Password - // Manager. + // Gaia or enterprise password that matches the reuse. + // |matching_reused_credentials| is the list of MatchingReusedCredentials that + // contains the signon_realm which the |password| is saved (may be empty if + // |reused_protected_password_hash| is not null) on and the username, + // |saved_passwords| is the total number of passwords (with unique domains) + // stored in Password Manager. virtual void OnReuseFound( size_t password_length, base::Optional<PasswordHashData> reused_protected_password_hash, - const std::vector<std::string>& matching_domains, + const std::vector<MatchingReusedCredential>& matching_reused_credentials, int saved_passwords) = 0; };
diff --git a/components/password_manager/core/browser/password_reuse_detector_unittest.cc b/components/password_manager/core/browser/password_reuse_detector_unittest.cc index f58a6bc..add16cb 100644 --- a/components/password_manager/core/browser/password_reuse_detector_unittest.cc +++ b/components/password_manager/core/browser/password_reuse_detector_unittest.cc
@@ -20,6 +20,8 @@ using autofill::PasswordForm; using base::ASCIIToUTF16; using testing::_; +using testing::IsEmpty; +using testing::UnorderedElementsAreArray; namespace password_manager { @@ -31,36 +33,43 @@ const base::Optional<PasswordHashData> NO_GAIA_OR_ENTERPRISE_REUSE = base::nullopt; -std::vector<std::pair<std::string, std::string>> GetTestDomainsPasswords() { +struct TestData { + // Comma separated list of domains. + std::string domains; + std::string username; + std::string password; +}; + +std::vector<TestData> GetTestDomainsPasswords() { return { - {"https://accounts.google.com", "saved_password"}, - {"https://facebook.com", "123456789"}, - {"https://a.appspot.com", "abcdefghi"}, - {"https://twitter.com", "short"}, - {"https://example1.com", "secretword"}, - {"https://example2.com", "secretword"}, + {"https://accounts.google.com", "gUsername", "saved_password"}, + {"https://facebook.com", "fbUsername", "123456789"}, + {"https://a.appspot.com", "appspotUsername", "abcdefghi"}, + {"https://twitter.com", "twitterUsername", "short"}, + {"https://example1.com", "example1Username", "secretword"}, + {"https://example2.com", "example2Username", "secretword"}, }; } std::unique_ptr<PasswordForm> GetForm(const std::string& domain, + const std::string& username, const std::string& password) { - std::unique_ptr<PasswordForm> form(new PasswordForm); + auto form = std::make_unique<PasswordForm>(); form->signon_realm = domain; form->password_value = ASCIIToUTF16(password); + form->username_value = ASCIIToUTF16(username); return form; } -// Convert a vector of pairs of strings ("domain[,domain...]", "password") -// into a vector of PasswordForms. +// Convert a vector of TestData structs into a vector of PasswordForms. std::vector<std::unique_ptr<PasswordForm>> GetForms( - const std::vector<std::pair<std::string, std::string>>& domains_passwords) { + std::vector<TestData> test_data) { std::vector<std::unique_ptr<PasswordForm>> result; - for (const auto& domains_password : domains_passwords) { + for (const auto& data : test_data) { // Some passwords are used on multiple domains. - for (const auto& domain : - base::SplitString(domains_password.first, ",", base::TRIM_WHITESPACE, - base::SPLIT_WANT_ALL)) { - result.push_back(GetForm(domain, domains_password.second)); + for (const auto& domain : base::SplitString( + data.domains, ",", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL)) { + result.push_back(GetForm(domain, data.username, data.password)); } } return result; @@ -81,7 +90,7 @@ std::vector<PasswordHashData> result; for (const auto& password : passwords) { PasswordHashData password_hash("username_" + password, - base::ASCIIToUTF16(password), + ASCIIToUTF16(password), /*is_gaia_password=*/true); result.push_back(password_hash); } @@ -92,8 +101,8 @@ const std::vector<std::string>& passwords) { std::vector<PasswordHashData> result; for (const auto& password : passwords) { - PasswordHashData password_hash("enterprise_username_" + password, - base::ASCIIToUTF16(password), + PasswordHashData password_hash("enterpriseUsername_" + password, + ASCIIToUTF16(password), /*is_gaia_password=*/false); result.push_back(password_hash); } @@ -121,25 +130,31 @@ "https://evil.com", &mockConsumer); testing::Mock::VerifyAndClearExpectations(&mockConsumer); - EXPECT_CALL(mockConsumer, OnReuseFound(strlen("saved_password"), - Matches(NO_GAIA_OR_ENTERPRISE_REUSE), - StringVector({"google.com"}), 5)); + std::vector<MatchingReusedCredential> credentials = { + {"https://accounts.google.com", ASCIIToUTF16("gUsername")}}; + EXPECT_CALL(mockConsumer, + OnReuseFound(strlen("saved_password"), + Matches(NO_GAIA_OR_ENTERPRISE_REUSE), + UnorderedElementsAreArray(credentials), 5)); reuse_detector.CheckReuse(ASCIIToUTF16("123saved_password"), "https://evil.com", &mockConsumer); testing::Mock::VerifyAndClearExpectations(&mockConsumer); - EXPECT_CALL(mockConsumer, OnReuseFound(strlen("saved_password"), - Matches(NO_GAIA_OR_ENTERPRISE_REUSE), - StringVector({"google.com"}), 5)); + EXPECT_CALL(mockConsumer, + OnReuseFound(strlen("saved_password"), + Matches(NO_GAIA_OR_ENTERPRISE_REUSE), + UnorderedElementsAreArray(credentials), 5)); reuse_detector.CheckReuse(ASCIIToUTF16("saved_password"), "https://evil.com", &mockConsumer); testing::Mock::VerifyAndClearExpectations(&mockConsumer); + credentials = {{"https://example1.com", ASCIIToUTF16("example1Username")}, + {"https://example2.com", ASCIIToUTF16("example2Username")}}; EXPECT_CALL( mockConsumer, OnReuseFound(strlen("secretword"), Matches(NO_GAIA_OR_ENTERPRISE_REUSE), - StringVector({"example1.com", "example2.com"}), 5)); + UnorderedElementsAreArray(credentials), 5)); reuse_detector.CheckReuse(ASCIIToUTF16("abcdsecretword"), "https://evil.com", &mockConsumer); } @@ -159,11 +174,14 @@ reuse_detector.OnGetPasswordStoreResults(GetForms(GetTestDomainsPasswords())); MockPasswordReuseDetectorConsumer mockConsumer; + const std::vector<MatchingReusedCredential> credentials = { + {"https://a.appspot.com", ASCIIToUTF16("appspotUsername")}}; // a.appspot.com and b.appspot.com are not PSL matches. So reuse event should // be raised. - EXPECT_CALL(mockConsumer, OnReuseFound(strlen("abcdefghi"), - Matches(NO_GAIA_OR_ENTERPRISE_REUSE), - StringVector({"a.appspot.com"}), 5)); + EXPECT_CALL( + mockConsumer, + OnReuseFound(strlen("abcdefghi"), Matches(NO_GAIA_OR_ENTERPRISE_REUSE), + UnorderedElementsAreArray(credentials), 5)); reuse_detector.CheckReuse(ASCIIToUTF16("abcdefghi"), "https://b.appspot.com", &mockConsumer); } @@ -202,10 +220,12 @@ if (type == PasswordStoreChange::REMOVE) { EXPECT_CALL(mockConsumer, OnReuseFound(_, _, _, _)).Times(0); } else { + const std::vector<MatchingReusedCredential> credentials = { + {"https://accounts.google.com", ASCIIToUTF16("gUsername")}}; EXPECT_CALL(mockConsumer, OnReuseFound(strlen("saved_password"), Matches(NO_GAIA_OR_ENTERPRISE_REUSE), - StringVector({"google.com"}), 5)); + UnorderedElementsAreArray(credentials), 5)); } reuse_detector.CheckReuse(ASCIIToUTF16("123saved_password"), "https://evil.com", &mockConsumer); @@ -215,11 +235,12 @@ TEST(PasswordReuseDetectorTest, MatchMultiplePasswords) { // These all have different length passwods so we can check the // returned length. - const std::vector<std::pair<std::string, std::string>> domain_passwords = { - {"https://a.com, https://all.com", "34567890"}, - {"https://b.com, https://b2.com, https://all.com", "01234567890"}, - {"https://c.com, https://all.com", "1234567890"}, - {"https://d.com", "123456789"}, + const std::vector<TestData> domain_passwords = { + {"https://a.com, https://all.com", "aUsername", "34567890"}, + {"https://b.com, https://b2.com, https://all.com", "bUsername", + "01234567890"}, + {"https://c.com, https://all.com", "cUsername", "1234567890"}, + {"https://d.com", "dUsername", "123456789"}, }; PasswordReuseDetector reuse_detector; @@ -227,19 +248,30 @@ MockPasswordReuseDetectorConsumer mockConsumer; + std::vector<MatchingReusedCredential> credentials = { + {"https://a.com", ASCIIToUTF16("aUsername")}, + {"https://all.com", ASCIIToUTF16("aUsername")}, + {"https://all.com", ASCIIToUTF16("bUsername")}, + {"https://all.com", ASCIIToUTF16("cUsername")}, + {"https://b.com", ASCIIToUTF16("bUsername")}, + {"https://b2.com", ASCIIToUTF16("bUsername")}, + {"https://c.com", ASCIIToUTF16("cUsername")}}; EXPECT_CALL( mockConsumer, - OnReuseFound( - strlen("01234567890"), Matches(NO_GAIA_OR_ENTERPRISE_REUSE), - StringVector({"a.com", "all.com", "b.com", "b2.com", "c.com"}), 8)); + OnReuseFound(strlen("01234567890"), Matches(NO_GAIA_OR_ENTERPRISE_REUSE), + UnorderedElementsAreArray(credentials), 8)); reuse_detector.CheckReuse(ASCIIToUTF16("abcd01234567890"), "https://evil.com", &mockConsumer); testing::Mock::VerifyAndClearExpectations(&mockConsumer); + credentials = {{"https://a.com", ASCIIToUTF16("aUsername")}, + {"https://all.com", ASCIIToUTF16("aUsername")}, + {"https://all.com", ASCIIToUTF16("cUsername")}, + {"https://c.com", ASCIIToUTF16("cUsername")}}; EXPECT_CALL( mockConsumer, OnReuseFound(strlen("1234567890"), Matches(NO_GAIA_OR_ENTERPRISE_REUSE), - StringVector({"a.com", "all.com", "c.com"}), 8)); + UnorderedElementsAreArray(credentials), 8)); reuse_detector.CheckReuse(ASCIIToUTF16("1234567890"), "https://evil.com", &mockConsumer); testing::Mock::VerifyAndClearExpectations(&mockConsumer); @@ -283,7 +315,7 @@ EXPECT_CALL(mockConsumer, OnReuseFound(strlen("gaia_pw1"), Matches(expected_reused_password_hash), - StringVector(), 5)); + IsEmpty(), 5)); reuse_detector.CheckReuse(ASCIIToUTF16("gaia_pw1"), "https://phishing.example.com", &mockConsumer); @@ -331,14 +363,15 @@ EXPECT_CALL(mockConsumer, OnReuseFound(strlen("enterprise_pw2"), Matches(expected_reused_password_hash), - StringVector(), 5)); + IsEmpty(), 5)); reuse_detector.CheckReuse(ASCIIToUTF16("enterprise_pw2"), "https://phishing.com", &mockConsumer); } TEST(PasswordReuseDetectorTest, MatchGaiaAndMultipleSavedPasswords) { - const std::vector<std::pair<std::string, std::string>> domain_passwords = { - {"https://a.com", "34567890"}, {"https://b.com", "01234567890"}, + const std::vector<TestData> domain_passwords = { + {"https://a.com", "aUsername", "34567890"}, + {"https://b.com", "bUsername", "01234567890"}, }; PasswordReuseDetector reuse_detector; reuse_detector.OnGetPasswordStoreResults(GetForms(domain_passwords)); @@ -353,16 +386,20 @@ MockPasswordReuseDetectorConsumer mockConsumer; - EXPECT_CALL(mockConsumer, OnReuseFound(strlen("01234567890"), - Matches(expected_reused_password_hash), - StringVector({"a.com", "b.com"}), 2)); + const std::vector<MatchingReusedCredential> credentials = { + {"https://a.com", ASCIIToUTF16("aUsername")}, + {"https://b.com", ASCIIToUTF16("bUsername")}}; + EXPECT_CALL(mockConsumer, + OnReuseFound(strlen("01234567890"), + Matches(expected_reused_password_hash), + UnorderedElementsAreArray(credentials), 2)); reuse_detector.CheckReuse(ASCIIToUTF16("abcd01234567890"), "https://evil.com", &mockConsumer); testing::Mock::VerifyAndClearExpectations(&mockConsumer); EXPECT_CALL(mockConsumer, OnReuseFound(strlen("1234567890"), Matches(expected_reused_password_hash), - StringVector(), 2)); + IsEmpty(), 2)); reuse_detector.CheckReuse(ASCIIToUTF16("xyz1234567890"), "https://evil.com", &mockConsumer); testing::Mock::VerifyAndClearExpectations(&mockConsumer); @@ -380,16 +417,20 @@ std::string gaia_password = "gaia_password"; reuse_detector.UseGaiaPasswordHash(PrepareGaiaPasswordData({gaia_password})); - EXPECT_CALL(mockConsumer, OnReuseFound(strlen("saved_password"), - Matches(NO_GAIA_OR_ENTERPRISE_REUSE), - StringVector({"google.com"}), 5)); + const std::vector<MatchingReusedCredential> credentials = { + {"https://accounts.google.com", ASCIIToUTF16("gUsername")}}; + EXPECT_CALL(mockConsumer, + OnReuseFound(strlen("saved_password"), + Matches(NO_GAIA_OR_ENTERPRISE_REUSE), + UnorderedElementsAreArray(credentials), 5)); reuse_detector.CheckReuse(ASCIIToUTF16("saved_password"), "https://evil.com", &mockConsumer); } TEST(PasswordReuseDetectorTest, MatchEnterpriseAndMultipleSavedPasswords) { - const std::vector<std::pair<std::string, std::string>> domain_passwords = { - {"https://a.com", "34567890"}, {"https://b.com", "01234567890"}, + const std::vector<TestData> domain_passwords = { + {"https://a.com", "aUsername", "34567890"}, + {"https://b.com", "bUsername", "01234567890"}, }; PasswordReuseDetector reuse_detector; ConfigureEnterprisePasswordProtection(&reuse_detector); @@ -405,16 +446,20 @@ MockPasswordReuseDetectorConsumer mockConsumer; - EXPECT_CALL(mockConsumer, OnReuseFound(strlen("01234567890"), - Matches(expected_reused_password_hash), - StringVector({"a.com", "b.com"}), 2)); + const std::vector<MatchingReusedCredential> credentials = { + {"https://a.com", ASCIIToUTF16("aUsername")}, + {"https://b.com", ASCIIToUTF16("bUsername")}}; + EXPECT_CALL(mockConsumer, + OnReuseFound(strlen("01234567890"), + Matches(expected_reused_password_hash), + UnorderedElementsAreArray(credentials), 2)); reuse_detector.CheckReuse(ASCIIToUTF16("abcd01234567890"), "https://evil.com", &mockConsumer); testing::Mock::VerifyAndClearExpectations(&mockConsumer); EXPECT_CALL(mockConsumer, OnReuseFound(strlen("1234567890"), Matches(expected_reused_password_hash), - StringVector(), 2)); + IsEmpty(), 2)); reuse_detector.CheckReuse(ASCIIToUTF16("xyz1234567890"), "https://evil.com", &mockConsumer); testing::Mock::VerifyAndClearExpectations(&mockConsumer); @@ -434,16 +479,20 @@ reuse_detector.UseNonGaiaEnterprisePasswordHash( PrepareEnterprisePasswordData({enterprise_password})); - EXPECT_CALL(mockConsumer, OnReuseFound(strlen("saved_password"), - Matches(NO_GAIA_OR_ENTERPRISE_REUSE), - StringVector({"google.com"}), 5)); + const std::vector<MatchingReusedCredential> credentials = { + {"https://accounts.google.com", ASCIIToUTF16("gUsername")}}; + EXPECT_CALL(mockConsumer, + OnReuseFound(strlen("saved_password"), + Matches(NO_GAIA_OR_ENTERPRISE_REUSE), + UnorderedElementsAreArray(credentials), 5)); reuse_detector.CheckReuse(ASCIIToUTF16("saved_password"), "https://evil.com", &mockConsumer); } TEST(PasswordReuseDetectorTest, MatchGaiaEnterpriseAndSavedPassword) { - const std::vector<std::pair<std::string, std::string>> domain_passwords = { - {"https://a.com", "34567890"}, {"https://b.com", "01234567890"}, + const std::vector<TestData> domain_passwords = { + {"https://a.com", "aUsername", "34567890"}, + {"https://b.com", "bUsername", "01234567890"}, }; PasswordReuseDetector reuse_detector; ConfigureEnterprisePasswordProtection(&reuse_detector); @@ -462,16 +511,20 @@ MockPasswordReuseDetectorConsumer mockConsumer; - EXPECT_CALL(mockConsumer, OnReuseFound(strlen("01234567890"), - Matches(expected_reused_password_hash), - StringVector({"a.com", "b.com"}), 2)); + const std::vector<MatchingReusedCredential> credentials = { + {"https://a.com", ASCIIToUTF16("aUsername")}, + {"https://b.com", ASCIIToUTF16("bUsername")}}; + EXPECT_CALL(mockConsumer, + OnReuseFound(strlen("01234567890"), + Matches(expected_reused_password_hash), + UnorderedElementsAreArray(credentials), 2)); reuse_detector.CheckReuse(ASCIIToUTF16("abcd01234567890"), "https://evil.com", &mockConsumer); testing::Mock::VerifyAndClearExpectations(&mockConsumer); EXPECT_CALL(mockConsumer, OnReuseFound(strlen("1234567890"), Matches(expected_reused_password_hash), - StringVector(), 2)); + IsEmpty(), 2)); reuse_detector.CheckReuse(ASCIIToUTF16("xyz1234567890"), "https://evil.com", &mockConsumer); testing::Mock::VerifyAndClearExpectations(&mockConsumer);
diff --git a/components/password_manager/core/browser/password_store.cc b/components/password_manager/core/browser/password_store.cc index 95dbd00..99df71e 100644 --- a/components/password_manager/core/browser/password_store.cc +++ b/components/password_manager/core/browser/password_store.cc
@@ -95,13 +95,13 @@ void PasswordStore::CheckReuseRequest::OnReuseFound( size_t password_length, base::Optional<PasswordHashData> reused_protected_password_hash, - const std::vector<std::string>& matching_domains, + const std::vector<MatchingReusedCredential>& matching_reused_credentials, int saved_passwords) { origin_task_runner_->PostTask( FROM_HERE, base::BindOnce(&PasswordReuseDetectorConsumer::OnReuseFound, consumer_weak_, password_length, reused_protected_password_hash, - matching_domains, saved_passwords)); + matching_reused_credentials, saved_passwords)); TRACE_EVENT_NESTABLE_ASYNC_END0("passwords", "CheckReuseRequest", this); } #endif
diff --git a/components/password_manager/core/browser/password_store.h b/components/password_manager/core/browser/password_store.h index 55f7baa..f4d812e 100644 --- a/components/password_manager/core/browser/password_store.h +++ b/components/password_manager/core/browser/password_store.h
@@ -408,7 +408,8 @@ void OnReuseFound( size_t password_length, base::Optional<PasswordHashData> reused_protected_password_hash, - const std::vector<std::string>& matching_domains, + const std::vector<MatchingReusedCredential>& + matching_reused_credentials, int saved_passwords) override; private:
diff --git a/components/password_manager/core/browser/password_store_unittest.cc b/components/password_manager/core/browser/password_store_unittest.cc index 37085fb..cd80477 100644 --- a/components/password_manager/core/browser/password_store_unittest.cc +++ b/components/password_manager/core/browser/password_store_unittest.cc
@@ -45,6 +45,8 @@ using base::WaitableEvent; using testing::_; using testing::DoAll; +using testing::ElementsAreArray; +using testing::IsEmpty; using testing::UnorderedElementsAre; using testing::WithArg; @@ -1181,9 +1183,11 @@ TEST_F(PasswordStoreTest, CheckPasswordReuse) { static constexpr PasswordFormData kTestCredentials[] = { {PasswordForm::Scheme::kHtml, "https://www.google.com", - "https://www.google.com", "", L"", L"", L"", L"", L"password", true, 1}, + "https://www.google.com", "", L"", L"", L"", L"username1", L"password", + true, 1}, {PasswordForm::Scheme::kHtml, "https://facebook.com", - "https://facebook.com", "", L"", L"", L"", L"", L"topsecret", true, 1}}; + "https://facebook.com", "", L"", L"", L"", L"username2", L"topsecret", + true, 1}}; scoped_refptr<PasswordStoreDefault> store = CreatePasswordStore(); store->Init(nullptr); @@ -1207,10 +1211,12 @@ for (const auto& test_data : kReuseTestData) { MockPasswordReuseDetectorConsumer mock_consumer; if (test_data.reused_password_len != 0) { + const std::vector<MatchingReusedCredential> credentials = { + {"https://www.google.com", base::ASCIIToUTF16("username1")}}; EXPECT_CALL( mock_consumer, OnReuseFound(test_data.reused_password_len, Matches(base::nullopt), - std::vector<std::string>({test_data.reuse_domain}), 2)); + ElementsAreArray(credentials), 2)); } else { EXPECT_CALL(mock_consumer, OnReuseFound(_, _, _, _)).Times(0); } @@ -1248,7 +1254,7 @@ MockPasswordReuseDetectorConsumer mock_consumer; EXPECT_CALL(mock_consumer, OnReuseFound(sync_password.size(), Matches(sync_password_hash), - std::vector<std::string>(), 0)); + IsEmpty(), 0)); store->CheckReuse(input, "https://facebook.com", &mock_consumer); WaitForPasswordStore(); testing::Mock::VerifyAndClearExpectations(&mock_consumer); @@ -1265,7 +1271,7 @@ // Check that Gaia password reuse is found. EXPECT_CALL(mock_consumer, OnReuseFound(gaia_password.size(), Matches(gaia_password_hash), - std::vector<std::string>(), 0)); + IsEmpty(), 0)); store->CheckReuse(input, "https://example.com", &mock_consumer); WaitForPasswordStore(); testing::Mock::VerifyAndClearExpectations(&mock_consumer); @@ -1297,9 +1303,9 @@ ASSERT_TRUE(enterprise_password_hash.has_value()); // Check that enterprise password reuse is found. - EXPECT_CALL(mock_consumer, OnReuseFound(enterprise_password.size(), - Matches(enterprise_password_hash), - std::vector<std::string>(), 0)); + EXPECT_CALL(mock_consumer, + OnReuseFound(enterprise_password.size(), + Matches(enterprise_password_hash), IsEmpty(), 0)); store->CheckReuse(input, "https://example.com", &mock_consumer); WaitForPasswordStore(); testing::Mock::VerifyAndClearExpectations(&mock_consumer); @@ -1327,7 +1333,7 @@ // Check that gmail password reuse is found. EXPECT_CALL(mock_consumer, OnReuseFound(gmail_password.size(), Matches(gmail_password_hash), - std::vector<std::string>(), 0)); + IsEmpty(), 0)); store->CheckReuse(gmail_password, "https://example.com", &mock_consumer); WaitForPasswordStore(); testing::Mock::VerifyAndClearExpectations(&mock_consumer); @@ -1355,7 +1361,7 @@ testing::Mock::VerifyAndClearExpectations(&mock_consumer); EXPECT_CALL(mock_consumer, OnReuseFound(gmail_password.size(), Matches(gmail_password_hash), - std::vector<std::string>(), 0)) + IsEmpty(), 0)) .Times(1); store->CheckReuse(gmail_password, "https://example.com", &mock_consumer); WaitForPasswordStore();
diff --git a/components/password_manager/core/browser/stub_password_manager_client.cc b/components/password_manager/core/browser/stub_password_manager_client.cc index 142de57e..6ddeb33 100644 --- a/components/password_manager/core/browser/stub_password_manager_client.cc +++ b/components/password_manager/core/browser/stub_password_manager_client.cc
@@ -114,7 +114,7 @@ void StubPasswordManagerClient::CheckProtectedPasswordEntry( metrics_util::PasswordType reused_password_type, const std::string& username, - const std::vector<std::string>& matching_domains, + const std::vector<MatchingReusedCredential>& matching_reused_credentials, bool password_field_exists) {} #endif
diff --git a/components/password_manager/core/browser/stub_password_manager_client.h b/components/password_manager/core/browser/stub_password_manager_client.h index ca4b823b..1b42b1a3 100644 --- a/components/password_manager/core/browser/stub_password_manager_client.h +++ b/components/password_manager/core/browser/stub_password_manager_client.h
@@ -12,6 +12,7 @@ #include "components/password_manager/core/browser/password_manager_client.h" #include "components/password_manager/core/browser/password_manager_metrics_recorder.h" #include "components/password_manager/core/browser/password_manager_metrics_util.h" +#include "components/password_manager/core/browser/password_reuse_detector.h" #include "components/password_manager/core/browser/stub_credentials_filter.h" #include "testing/gmock/include/gmock/gmock.h" @@ -77,7 +78,7 @@ void CheckProtectedPasswordEntry( metrics_util::PasswordType reused_password_type, const std::string& username, - const std::vector<std::string>& matching_domains, + const std::vector<MatchingReusedCredential>& matching_reused_credentials, bool password_field_exists) override; #endif
diff --git a/components/payments/content/android/byte_buffer_helper.cc b/components/payments/content/android/byte_buffer_helper.cc index d9555571..bef82fc 100644 --- a/components/payments/content/android/byte_buffer_helper.cc +++ b/components/payments/content/android/byte_buffer_helper.cc
@@ -13,9 +13,10 @@ std::vector<uint8_t> JavaByteBufferToNativeByteVector( JNIEnv* env, - const base::android::JavaParamRef<jobject>& buffer) { - jbyte* buf_in = static_cast<jbyte*>(env->GetDirectBufferAddress(buffer)); - jlong buf_size = env->GetDirectBufferCapacity(buffer); + const base::android::JavaRef<jobject>& buffer) { + jbyte* buf_in = + static_cast<jbyte*>(env->GetDirectBufferAddress(buffer.obj())); + jlong buf_size = env->GetDirectBufferCapacity(buffer.obj()); std::vector<uint8_t> result(buf_size); memcpy(&result[0], buf_in, buf_size); return result;
diff --git a/components/payments/content/android/byte_buffer_helper.h b/components/payments/content/android/byte_buffer_helper.h index b728805..fd21d4a 100644 --- a/components/payments/content/android/byte_buffer_helper.h +++ b/components/payments/content/android/byte_buffer_helper.h
@@ -10,6 +10,8 @@ #include <vector> #include "base/android/scoped_java_ref.h" +#include "base/logging.h" +#include "mojo/public/cpp/bindings/struct_ptr.h" namespace payments { namespace android { @@ -22,7 +24,39 @@ // &details); std::vector<uint8_t> JavaByteBufferToNativeByteVector( JNIEnv* env, - const base::android::JavaParamRef<jobject>& buffer); + const base::android::JavaRef<jobject>& buffer); + +// Deserializes a java.nio.ByteBuffer into a native Mojo object. Returns true if +// deserialization is successful. +template <typename T> +bool DeserializeFromJavaByteBuffer( + JNIEnv* env, + const base::android::JavaRef<jobject>& jbuffer, + mojo::StructPtr<T>* out) { + DCHECK(out); + return T::Deserialize(JavaByteBufferToNativeByteVector(env, jbuffer), out); +} + +// Deserializes a java.nio.ByteBuffer[] into a vector of native Mojo objects. +// The content of |out| is replaced. Returns true if all entries are +// deserialized successfully. +template <typename T> +bool DeserializeFromJavaByteBufferArray( + JNIEnv* env, + const base::android::JavaRef<jobjectArray>& jbuffers, + std::vector<mojo::StructPtr<T>>* out) { + DCHECK(out); + out->clear(); + for (const auto& jbuffer : jbuffers.ReadElements<jobject>()) { + mojo::StructPtr<T> data; + if (!DeserializeFromJavaByteBuffer(env, jbuffer, &data)) { + out->clear(); + return false; + } + out->push_back(std::move(data)); + } + return true; +} } // namespace android } // namespace payments
diff --git a/components/payments/content/autofill_payment_app_factory.cc b/components/payments/content/autofill_payment_app_factory.cc index 6bba1f2e..5e39b15 100644 --- a/components/payments/content/autofill_payment_app_factory.cc +++ b/components/payments/content/autofill_payment_app_factory.cc
@@ -46,6 +46,13 @@ AutofillPaymentAppFactory::~AutofillPaymentAppFactory() = default; void AutofillPaymentAppFactory::Create(base::WeakPtr<Delegate> delegate) { + // No need to create autofill payment apps if native app creation is skipped + // because autofill payment apps are created completely by the Java factory. + if (delegate->SkipCreatingNativePaymentApps()) { + delegate->OnDoneCreatingPaymentApps(); + return; + } + const std::vector<autofill::CreditCard*>& cards = delegate->GetPaymentRequestDelegate() ->GetPersonalDataManager()
diff --git a/components/payments/content/payment_app_factory.h b/components/payments/content/payment_app_factory.h index a33a2c55..7d74c3a 100644 --- a/components/payments/content/payment_app_factory.h +++ b/components/payments/content/payment_app_factory.h
@@ -11,7 +11,9 @@ #include "base/callback_forward.h" #include "base/macros.h" #include "base/memory/weak_ptr.h" +#include "components/payments/content/service_worker_payment_app_finder.h" #include "components/payments/core/payment_app.h" +#include "content/public/browser/payment_app_provider.h" #include "third_party/blink/public/mojom/payments/payment_request.mojom.h" class GURL; @@ -31,8 +33,9 @@ namespace payments { -class PaymentRequestSpec; class ContentPaymentRequestDelegate; +class PaymentManifestWebDataService; +class PaymentRequestSpec; // Base class for a factory that can create instances of payment apps. class PaymentAppFactory { @@ -42,16 +45,23 @@ virtual ~Delegate() = default; virtual content::WebContents* GetWebContents() = 0; - virtual ContentPaymentRequestDelegate* GetPaymentRequestDelegate() = 0; - virtual PaymentRequestSpec* GetSpec() = 0; virtual const GURL& GetTopOrigin() = 0; virtual const GURL& GetFrameOrigin() = 0; virtual const url::Origin& GetFrameSecurityOrigin() = 0; virtual content::RenderFrameHost* GetInitiatorRenderFrameHost() const = 0; + virtual const std::vector<mojom::PaymentMethodDataPtr>& GetMethodData() + const = 0; + virtual scoped_refptr<PaymentManifestWebDataService> + GetPaymentManifestWebDataService() const = 0; + virtual bool MayCrawlForInstallablePaymentApps() = 0; + + // These parameters are only used to create native payment apps. virtual const std::vector<autofill::AutofillProfile*>& GetBillingProfiles() = 0; virtual bool IsRequestedAutofillDataAvailable() = 0; - virtual bool MayCrawlForInstallablePaymentApps() = 0; + virtual ContentPaymentRequestDelegate* GetPaymentRequestDelegate() + const = 0; + virtual PaymentRequestSpec* GetSpec() const = 0; // Called after an app is installed. Used for just-in-time installable // payment handlers, for example. @@ -66,6 +76,18 @@ virtual void OnPaymentAppCreationError( const std::string& error_message) = 0; + // Whether the factory should early exit before creating platform-specific + // PaymentApp objects. This is used by PaymentAppServiceBridge to skip + // creating native PaymentApps, which currently cannot be used over JNI. + virtual bool SkipCreatingNativePaymentApps() const = 0; + + // When SkipCreatingNativePaymentApps() is true, this callback is called + // when service-worker payment app info is available. + virtual void OnCreatingNativePaymentAppsSkipped( + const content::PaymentAppProvider::PaymentApps& apps, + const ServiceWorkerPaymentAppFinder::InstallablePaymentApps& + installable_apps) = 0; + // Called when all apps of this factory have been created. virtual void OnDoneCreatingPaymentApps() = 0; };
diff --git a/components/payments/content/payment_app_service.cc b/components/payments/content/payment_app_service.cc index 22407757..b0631dd3 100644 --- a/components/payments/content/payment_app_service.cc +++ b/components/payments/content/payment_app_service.cc
@@ -21,10 +21,12 @@ PaymentAppService::~PaymentAppService() = default; +size_t PaymentAppService::GetNumberOfFactories() const { + return factories_.size(); +} + void PaymentAppService::Create( - base::WeakPtr<PaymentAppFactory::Delegate> delegate, - size_t* number_of_payment_app_factories) { - *number_of_payment_app_factories = factories_.size(); + base::WeakPtr<PaymentAppFactory::Delegate> delegate) { for (const auto& factory : factories_) { factory->Create(delegate); }
diff --git a/components/payments/content/payment_app_service.h b/components/payments/content/payment_app_service.h index 2a62d3f..cea8f09 100644 --- a/components/payments/content/payment_app_service.h +++ b/components/payments/content/payment_app_service.h
@@ -22,14 +22,13 @@ PaymentAppService(); ~PaymentAppService() override; - // Sets |number_of_payment_app_factories| to the number of payment app - // factories, which is the number of times that - // |delegate->OnDoneCreatingPaymentApps()| will be called. The value is passed - // in as out-param instead of being returned, so it can be set before any - // factory can call OnDoneCreatingPaymentApps(), which can happen for - // factories that execute synchronously, e.g., AutofillPaymentAppFactory. - void Create(base::WeakPtr<PaymentAppFactory::Delegate> delegate, - size_t* number_of_payment_app_factories); + // Returns the number of payment app factories, which is the number of times + // that |delegate->OnDoneCreatingPaymentApps()| will be called as a result of + // Create(). + size_t GetNumberOfFactories() const; + + // Create payment apps for |delegate|. + void Create(base::WeakPtr<PaymentAppFactory::Delegate> delegate); private: std::vector<std::unique_ptr<PaymentAppFactory>> factories_;
diff --git a/components/payments/content/payment_request_state.cc b/components/payments/content/payment_request_state.cc index 29add52..b2ee9bb 100644 --- a/components/payments/content/payment_request_state.cc +++ b/components/payments/content/payment_request_state.cc
@@ -86,10 +86,10 @@ PopulateProfileCache(); // |web_contents_| is null in unit tests. - PaymentAppServiceFactory::GetForContext( - web_contents_ ? web_contents_->GetBrowserContext() : nullptr) - ->Create(weak_ptr_factory_.GetWeakPtr(), - &number_of_payment_app_factories_); + PaymentAppService* service = PaymentAppServiceFactory::GetForContext( + web_contents_ ? web_contents_->GetBrowserContext() : nullptr); + number_of_payment_app_factories_ = service->GetNumberOfFactories(); + service->Create(weak_ptr_factory_.GetWeakPtr()); spec_->AddObserver(this); } @@ -100,12 +100,12 @@ return web_contents_; } -ContentPaymentRequestDelegate* -PaymentRequestState::GetPaymentRequestDelegate() { +ContentPaymentRequestDelegate* PaymentRequestState::GetPaymentRequestDelegate() + const { return payment_request_delegate_; } -PaymentRequestSpec* PaymentRequestState::GetSpec() { +PaymentRequestSpec* PaymentRequestState::GetSpec() const { return spec_; } @@ -126,6 +126,16 @@ return initiator_render_frame_host_; } +const std::vector<mojom::PaymentMethodDataPtr>& +PaymentRequestState::GetMethodData() const { + return GetSpec()->method_data(); +} + +scoped_refptr<PaymentManifestWebDataService> +PaymentRequestState::GetPaymentManifestWebDataService() const { + return GetPaymentRequestDelegate()->GetPaymentManifestWebDataService(); +} + const std::vector<autofill::AutofillProfile*>& PaymentRequestState::GetBillingProfiles() { return shipping_profiles_; @@ -166,6 +176,17 @@ get_all_payment_apps_error_ = error_message; } +bool PaymentRequestState::SkipCreatingNativePaymentApps() const { + return false; +} + +void PaymentRequestState::OnCreatingNativePaymentAppsSkipped( + const content::PaymentAppProvider::PaymentApps& unused_apps, + const ServiceWorkerPaymentAppFinder::InstallablePaymentApps& + unused_installable_apps) { + NOTREACHED(); +} + void PaymentRequestState::OnDoneCreatingPaymentApps() { DCHECK_NE(0U, number_of_payment_app_factories_); if (--number_of_payment_app_factories_ > 0U)
diff --git a/components/payments/content/payment_request_state.h b/components/payments/content/payment_request_state.h index 3fbf03d..9487b13 100644 --- a/components/payments/content/payment_request_state.h +++ b/components/payments/content/payment_request_state.h
@@ -131,12 +131,16 @@ // PaymentAppFactory::Delegate content::WebContents* GetWebContents() override; - ContentPaymentRequestDelegate* GetPaymentRequestDelegate() override; - PaymentRequestSpec* GetSpec() override; + ContentPaymentRequestDelegate* GetPaymentRequestDelegate() const override; + PaymentRequestSpec* GetSpec() const override; const GURL& GetTopOrigin() override; const GURL& GetFrameOrigin() override; const url::Origin& GetFrameSecurityOrigin() override; content::RenderFrameHost* GetInitiatorRenderFrameHost() const override; + const std::vector<mojom::PaymentMethodDataPtr>& GetMethodData() + const override; + scoped_refptr<PaymentManifestWebDataService> + GetPaymentManifestWebDataService() const override; const std::vector<autofill::AutofillProfile*>& GetBillingProfiles() override; bool IsRequestedAutofillDataAvailable() override; bool MayCrawlForInstallablePaymentApps() override; @@ -144,6 +148,11 @@ int64_t registration_id) override; void OnPaymentAppCreated(std::unique_ptr<PaymentApp> app) override; void OnPaymentAppCreationError(const std::string& error_message) override; + bool SkipCreatingNativePaymentApps() const override; + void OnCreatingNativePaymentAppsSkipped( + const content::PaymentAppProvider::PaymentApps& apps, + const ServiceWorkerPaymentAppFinder::InstallablePaymentApps& + installable_apps) override; void OnDoneCreatingPaymentApps() override; // PaymentResponseHelper::Delegate
diff --git a/components/payments/content/service_worker_payment_app_factory.cc b/components/payments/content/service_worker_payment_app_factory.cc index c80946f..047613ad 100644 --- a/components/payments/content/service_worker_payment_app_factory.cc +++ b/components/payments/content/service_worker_payment_app_factory.cc
@@ -57,6 +57,13 @@ return; } + if (delegate_->SkipCreatingNativePaymentApps()) { + delegate_->OnCreatingNativePaymentAppsSkipped( + std::move(apps), std::move(installable_apps)); + FinishAndCleanup(); + return; + } + for (auto& installed_app : apps) { auto app = std::make_unique<ServiceWorkerPaymentApp>( delegate_->GetWebContents()->GetBrowserContext(), @@ -141,8 +148,8 @@ ServiceWorkerPaymentAppFinder::GetInstance()->GetAllPaymentApps( delegate->GetFrameSecurityOrigin(), delegate->GetInitiatorRenderFrameHost(), delegate->GetWebContents(), - delegate->GetPaymentRequestDelegate()->GetPaymentManifestWebDataService(), - Clone(delegate->GetSpec()->method_data()), + delegate->GetPaymentManifestWebDataService(), + Clone(delegate->GetMethodData()), delegate->MayCrawlForInstallablePaymentApps(), base::BindOnce(&ServiceWorkerPaymentAppCreator::CreatePaymentApps, creator_raw_pointer->GetWeakPtr()),
diff --git a/components/performance_manager/graph/page_node_impl.cc b/components/performance_manager/graph/page_node_impl.cc index 11ee907a..6ee39cf1 100644 --- a/components/performance_manager/graph/page_node_impl.cc +++ b/components/performance_manager/graph/page_node_impl.cc
@@ -20,9 +20,10 @@ const std::string& browser_context_id, const GURL& visible_url, bool is_visible, - bool is_audible) + bool is_audible, + base::TimeTicks visibility_change_time) : contents_proxy_(contents_proxy), - visibility_change_time_(base::TimeTicks::Now()), + visibility_change_time_(visibility_change_time), main_frame_url_(visible_url), browser_context_id_(browser_context_id), is_visible_(is_visible),
diff --git a/components/performance_manager/graph/page_node_impl.h b/components/performance_manager/graph/page_node_impl.h index a1d4516..50694c72 100644 --- a/components/performance_manager/graph/page_node_impl.h +++ b/components/performance_manager/graph/page_node_impl.h
@@ -33,7 +33,8 @@ const std::string& browser_context_id, const GURL& visible_url, bool is_visible, - bool is_audible); + bool is_audible, + base::TimeTicks visibility_change_time); ~PageNodeImpl() override; // Returns the web contents associated with this page node. It is valid to
diff --git a/components/performance_manager/performance_manager_impl.cc b/components/performance_manager/performance_manager_impl.cc index 3ad0188..8fc4ff3b 100644 --- a/components/performance_manager/performance_manager_impl.cc +++ b/components/performance_manager/performance_manager_impl.cc
@@ -124,10 +124,12 @@ const std::string& browser_context_id, const GURL& visible_url, bool is_visible, - bool is_audible) { + bool is_audible, + base::TimeTicks visibility_change_time) { return CreateNodeImpl<PageNodeImpl>(base::OnceCallback<void(PageNodeImpl*)>(), contents_proxy, browser_context_id, - visible_url, is_visible, is_audible); + visible_url, is_visible, is_audible, + visibility_change_time); } // static
diff --git a/components/performance_manager/performance_manager_impl.h b/components/performance_manager/performance_manager_impl.h index 349006b..a7f2180 100644 --- a/components/performance_manager/performance_manager_impl.h +++ b/components/performance_manager/performance_manager_impl.h
@@ -100,7 +100,8 @@ const std::string& browser_context_id, const GURL& visible_url, bool is_visible, - bool is_audible); + bool is_audible, + base::TimeTicks visibility_change_time); static std::unique_ptr<ProcessNodeImpl> CreateProcessNode( RenderProcessHostProxy proxy); static std::unique_ptr<WorkerNodeImpl> CreateWorkerNode(
diff --git a/components/performance_manager/performance_manager_impl_unittest.cc b/components/performance_manager/performance_manager_impl_unittest.cc index d75e7c6a..48179029 100644 --- a/components/performance_manager/performance_manager_impl_unittest.cc +++ b/components/performance_manager/performance_manager_impl_unittest.cc
@@ -55,7 +55,8 @@ EXPECT_NE(nullptr, process_node.get()); std::unique_ptr<PageNodeImpl> page_node = PerformanceManagerImpl::CreatePageNode(WebContentsProxy(), std::string(), - GURL(), false, false); + GURL(), false, false, + base::TimeTicks::Now()); EXPECT_NE(nullptr, page_node.get()); // Create a node of each type. @@ -77,7 +78,8 @@ PerformanceManagerImpl::CreateProcessNode(RenderProcessHostProxy()); std::unique_ptr<PageNodeImpl> page_node = PerformanceManagerImpl::CreatePageNode(WebContentsProxy(), std::string(), - GURL(), false, false); + GURL(), false, false, + base::TimeTicks::Now()); std::unique_ptr<FrameNodeImpl> parent1_frame = PerformanceManagerImpl::CreateFrameNode( @@ -121,7 +123,8 @@ // Create a page node for something to target. std::unique_ptr<PageNodeImpl> page_node = PerformanceManagerImpl::CreatePageNode(WebContentsProxy(), std::string(), - GURL(), false, false); + GURL(), false, false, + base::TimeTicks::Now()); base::RunLoop run_loop; base::OnceClosure quit_closure = run_loop.QuitClosure(); EXPECT_FALSE(PerformanceManagerImpl::OnPMTaskRunnerForTesting()); @@ -142,7 +145,8 @@ // Create a page node for something to target. std::unique_ptr<PageNodeImpl> page_node = PerformanceManagerImpl::CreatePageNode(WebContentsProxy(), std::string(), - GURL(), false, false); + GURL(), false, false, + base::TimeTicks::Now()); base::RunLoop run_loop; EXPECT_FALSE(PerformanceManagerImpl::OnPMTaskRunnerForTesting());
diff --git a/components/performance_manager/performance_manager_tab_helper.cc b/components/performance_manager/performance_manager_tab_helper.cc index 58d4b2d..ba27767 100644 --- a/components/performance_manager/performance_manager_tab_helper.cc +++ b/components/performance_manager/performance_manager_tab_helper.cc
@@ -33,7 +33,7 @@ web_contents->GetBrowserContext()->UniqueId(), web_contents->GetVisibleURL(), web_contents->GetVisibility() == content::Visibility::VISIBLE, - web_contents->IsCurrentlyAudible()); + web_contents->IsCurrentlyAudible(), web_contents->GetLastActiveTime()); // Dispatch creation notifications for any pre-existing frames. std::vector<content::RenderFrameHost*> existing_frames = web_contents->GetAllFrames();
diff --git a/components/performance_manager/test_support/graph_test_harness.h b/components/performance_manager/test_support/graph_test_harness.h index 53b2881..eefcd98 100644 --- a/components/performance_manager/test_support/graph_test_harness.h +++ b/components/performance_manager/test_support/graph_test_harness.h
@@ -108,9 +108,11 @@ const std::string& browser_context_id = std::string(), const GURL& url = GURL(), bool is_visible = false, - bool is_audible = false) { + bool is_audible = false, + base::TimeTicks visibility_change_time = base::TimeTicks::Now()) { return std::make_unique<PageNodeImpl>(wc_proxy, browser_context_id, url, - is_visible, is_audible); + is_visible, is_audible, + visibility_change_time); } };
diff --git a/components/performance_manager/worker_watcher_unittest.cc b/components/performance_manager/worker_watcher_unittest.cc index 53220e4..bc9668e1 100644 --- a/components/performance_manager/worker_watcher_unittest.cc +++ b/components/performance_manager/worker_watcher_unittest.cc
@@ -502,11 +502,13 @@ }; TestFrameNodeSource::TestFrameNodeSource() - : page_node_(PerformanceManagerImpl::CreatePageNode(WebContentsProxy(), - "page_node_context_id", - GURL(), - false, - false)) {} + : page_node_( + PerformanceManagerImpl::CreatePageNode(WebContentsProxy(), + "page_node_context_id", + GURL(), + false, + false, + base::TimeTicks::Now())) {} TestFrameNodeSource::~TestFrameNodeSource() { std::vector<std::unique_ptr<NodeBase>> nodes;
diff --git a/components/permissions/permission_context_base.cc b/components/permissions/permission_context_base.cc index 4fbf0c5f..0d55900a 100644 --- a/components/permissions/permission_context_base.cc +++ b/components/permissions/permission_context_base.cc
@@ -355,7 +355,8 @@ std::unique_ptr<PermissionRequest> request_ptr = std::make_unique<PermissionRequestImpl>( - requesting_origin, content_settings_type_, user_gesture, + embedding_origin, requesting_origin, content_settings_type_, + user_gesture, base::BindOnce(&PermissionContextBase::PermissionDecided, weak_factory_.GetWeakPtr(), id, requesting_origin, embedding_origin, std::move(callback)),
diff --git a/components/permissions/permission_request.cc b/components/permissions/permission_request.cc index dde93aa9..7808608 100644 --- a/components/permissions/permission_request.cc +++ b/components/permissions/permission_request.cc
@@ -21,6 +21,11 @@ return base::string16(); } +GURL PermissionRequest::GetEmbeddingOrigin() const { + NOTREACHED(); + return GURL(); +} + #if defined(OS_ANDROID) base::string16 PermissionRequest::GetQuietTitleText() const { return base::string16();
diff --git a/components/permissions/permission_request.h b/components/permissions/permission_request.h index 6e8dbb8..35beab0 100644 --- a/components/permissions/permission_request.h +++ b/components/permissions/permission_request.h
@@ -117,6 +117,10 @@ // Returns a warning prompt text related to this permission. virtual base::string16 GetMessageTextWarningFragment() const; + // Get the top-level origin currently displayed in the address bar associated + // with this request. + virtual GURL GetEmbeddingOrigin() const; + // Get the origin on whose behalf this permission request is being made. virtual GURL GetOrigin() const = 0;
diff --git a/components/permissions/permission_request_impl.cc b/components/permissions/permission_request_impl.cc index e740cb7..bc95fa89d 100644 --- a/components/permissions/permission_request_impl.cc +++ b/components/permissions/permission_request_impl.cc
@@ -23,12 +23,14 @@ namespace permissions { PermissionRequestImpl::PermissionRequestImpl( + const GURL& embedding_origin, const GURL& request_origin, ContentSettingsType content_settings_type, bool has_gesture, PermissionDecidedCallback permission_decided_callback, base::OnceClosure delete_callback) - : request_origin_(request_origin), + : embedding_origin_(embedding_origin), + request_origin_(request_origin), content_settings_type_(content_settings_type), has_gesture_(has_gesture), permission_decided_callback_(std::move(permission_decided_callback)), @@ -146,14 +148,13 @@ message_id = IDS_AR_INFOBAR_TEXT; break; case ContentSettingsType::STORAGE_ACCESS: - // TODO(https://crbug.com/989663): Plumb through second context origin for - // string instead of using GetOrigin() for both. return l10n_util::GetStringFUTF16( IDS_STORAGE_ACCESS_INFOBAR_TEXT, url_formatter::FormatUrlForSecurityDisplay( GetOrigin(), url_formatter::SchemeDisplay::OMIT_CRYPTOGRAPHIC), url_formatter::FormatUrlForSecurityDisplay( - GetOrigin(), url_formatter::SchemeDisplay::OMIT_CRYPTOGRAPHIC)); + GetEmbeddingOrigin(), + url_formatter::SchemeDisplay::OMIT_CRYPTOGRAPHIC)); default: NOTREACHED(); return base::string16(); @@ -229,14 +230,13 @@ message_id = IDS_AR_PERMISSION_FRAGMENT; break; case ContentSettingsType::STORAGE_ACCESS: - // TODO(https://crbug.com/989663): Plumb through second context origin for - // string instead of using GetOrigin() for both. return l10n_util::GetStringFUTF16( IDS_STORAGE_ACCESS_PERMISSION_FRAGMENT, url_formatter::FormatUrlForSecurityDisplay( GetOrigin(), url_formatter::SchemeDisplay::OMIT_CRYPTOGRAPHIC), url_formatter::FormatUrlForSecurityDisplay( - GetOrigin(), url_formatter::SchemeDisplay::OMIT_CRYPTOGRAPHIC)); + GetEmbeddingOrigin(), + url_formatter::SchemeDisplay::OMIT_CRYPTOGRAPHIC)); default: NOTREACHED(); return base::string16(); @@ -250,6 +250,10 @@ return base::string16(); } +GURL PermissionRequestImpl::GetEmbeddingOrigin() const { + return embedding_origin_; +} + GURL PermissionRequestImpl::GetOrigin() const { return request_origin_; }
diff --git a/components/permissions/permission_request_impl.h b/components/permissions/permission_request_impl.h index b038f7f..2f13e38 100644 --- a/components/permissions/permission_request_impl.h +++ b/components/permissions/permission_request_impl.h
@@ -24,7 +24,8 @@ public: using PermissionDecidedCallback = base::OnceCallback<void(ContentSetting)>; - PermissionRequestImpl(const GURL& request_origin, + PermissionRequestImpl(const GURL& embedding_origin, + const GURL& request_origin, ContentSettingsType content_settings_type, bool has_gesture, PermissionDecidedCallback permission_decided_callback, @@ -42,6 +43,7 @@ #endif base::string16 GetMessageTextFragment() const override; base::string16 GetMessageTextWarningFragment() const override; + GURL GetEmbeddingOrigin() const override; GURL GetOrigin() const override; void PermissionGranted() override; void PermissionDenied() override; @@ -51,6 +53,7 @@ PermissionRequestGestureType GetGestureType() const override; ContentSettingsType GetContentSettingsType() const override; + GURL embedding_origin_; GURL request_origin_; ContentSettingsType content_settings_type_; bool has_gesture_;
diff --git a/components/policy/resources/policy_templates.json b/components/policy/resources/policy_templates.json index 251535e..1d7d4f9 100644 --- a/components/policy/resources/policy_templates.json +++ b/components/policy/resources/policy_templates.json
@@ -735,9 +735,9 @@ 'desc': '''Configure Safe Browsing related policies.''', 'policies': [ 'SafeBrowsingEnabled', - 'SafeBrowsingEnhancedProtection', 'SafeBrowsingExtendedReportingEnabled', 'SafeBrowsingExtendedReportingOptInAllowed', + 'SafeBrowsingProtectionLevel', 'SafeBrowsingWhitelistDomains', 'PasswordProtectionWarningTrigger', 'PasswordProtectionLoginURLs', @@ -2727,7 +2727,9 @@ 'id': 14, 'caption': '''Enable Safe Browsing''', 'tags': ['system-security'], - 'desc': '''Enables <ph name="PRODUCT_NAME">$1<ex>Google Chrome</ex></ph>'s Safe Browsing feature and prevents users from changing this setting. + 'desc': '''This policy is deprecated in M83, please use SafeBrowsingProtectionLevel instead. + + Enables <ph name="PRODUCT_NAME">$1<ex>Google Chrome</ex></ph>'s Safe Browsing feature and prevents users from changing this setting. If you enable this setting, Safe Browsing is always active. @@ -2739,33 +2741,57 @@ See https://developers.google.com/safe-browsing for more info on Safe Browsing. - This policy is available only on Windows instances that are joined to a <ph name="MS_AD_NAME">Microsoft® Active Directory®</ph> domain. or Windows 10 Pro or Enterprise instances that enrolled for device management.''', + This policy is available only on Windows instances that are joined to a <ph name="MS_AD_NAME">Microsoft® Active Directory®</ph> domain. or Windows 10 Pro or Enterprise instances that enrolled for device management. + + If the policy SafeBrowsingProtectionLevel is set, the value of the policy SafeBrowsingEnabled is ignored.''', }, { - 'name': 'SafeBrowsingEnhancedProtection', - 'owners': ['bdea@chromium.org'], - 'type': 'main', - 'schema': { 'type': 'boolean' }, - 'supported_on': ['chrome.*:82-', 'chrome_os:82-'], + 'name': 'SafeBrowsingProtectionLevel', + 'owners': ['vakh@chromium.org', 'file://components/safe_browsing/OWNERS'], + 'type': 'int-enum', + 'schema': { + 'type': 'integer', + 'enum': [ 0, 1, 2 ], + }, + 'items': [ + { + 'name': 'NoProtection', + 'value': 0, + 'caption': '''Safe Browsing is never active.''', + }, + { + 'name': 'StandardProtection', + 'value': 1, + 'caption': '''Safe Browsing is active in the standard mode.''', + }, + { + 'name': 'EnhancedProtection', + 'value': 2, + 'caption': '''Safe Browsing is active in the enhanced mode. This mode provides better security, but requires sharing more browsing information with Google.''', + }, + ], + 'supported_on': ['chrome.*:83-', 'chrome_os:83-'], 'future': True, 'features': { 'can_be_recommended': True, 'dynamic_refresh': True, 'per_profile': True, }, - 'example_value': True, + 'example_value': 2, 'id': 684, - 'caption': '''Enable Safe Browsing Enhanced Protection''', + 'caption': '''Safe Browsing Protection Level''', 'tags': ['system-security'], - 'desc': '''Enables <ph name="PRODUCT_NAME">$1<ex>Google Chrome</ex></ph>'s Safe Browsing Enhanced Protection feature and prevents users from changing this setting. + 'desc': '''Allows you to control whether <ph name="PRODUCT_NAME">$1<ex>Google Chrome</ex></ph>'s Safe Browsing feature is enabled and the mode it operates in. - If you enable this setting, Safe Browsing Enhanced protection is always active. + If this policy is set to 'NoProtection' (value 0), Safe Browsing is never active. - If you disable this setting, Safe Browsing Enhanced Protection is never active. + If this policy is set to 'StandardProtection' (value 1, which is the default), Safe Browsing is always active in the standard mode. - If you set this policy as mandatory, users cannot change or override the "Enable phishing and malware protection" setting in <ph name="PRODUCT_NAME">$1<ex>Google Chrome</ex></ph>. + If this policy is set to 'EnhancedProtection' (value 2), Safe Browsing is always active in the enhanced mode, which provides better security, but requires sharing more browsing information with Google. - If this policy is left not set, Safe Browsing Enhanced protection will be disabled by default but the user can enable it. + If you set this policy as mandatory, users cannot change or override the Safe Browsing setting in <ph name="PRODUCT_NAME">$1<ex>Google Chrome</ex></ph>. + + If this policy is left not set, Safe Browsing will operate in Standard Protection mode but users can change this setting. See https://developers.google.com/safe-browsing for more info on Safe Browsing.''', }, @@ -18762,7 +18788,6 @@ 'type': 'main', 'schema': { 'type': 'boolean' }, 'supported_on': ['chrome_os:77-'], - 'future': True, 'features': { 'dynamic_refresh': True, 'per_profile': True, @@ -21051,6 +21076,7 @@ 'SafeBrowsingEnabled', 'SafeBrowsingExtendedReportingEnabled', 'SafeBrowsingExtendedReportingOptInAllowed', + 'SafeBrowsingProtectionLevel', 'SafeBrowsingWhitelistDomains', ], },
diff --git a/components/printing/browser/printer_capabilities.cc b/components/printing/browser/printer_capabilities.cc index d0c3c3ec..4f45d5a 100644 --- a/components/printing/browser/printer_capabilities.cc +++ b/components/printing/browser/printer_capabilities.cc
@@ -95,7 +95,7 @@ // an empty dictionary if a dictionary could not be generated. base::Value GetPrinterCapabilitiesOnBlockingTaskRunner( const std::string& device_name, - const PrinterSemanticCapsAndDefaults::Papers& additional_papers, + PrinterSemanticCapsAndDefaults::Papers user_defined_papers, bool has_secure_protocol, scoped_refptr<PrintBackend> backend) { DCHECK(!device_name.empty()); @@ -126,8 +126,7 @@ PopulateAllPaperDisplayNames(&info); #endif // BUILDFLAG(PRINT_MEDIA_L10N_ENABLED) - info.papers.insert(info.papers.end(), additional_papers.begin(), - additional_papers.end()); + info.user_defined_papers = std::move(user_defined_papers); #if defined(OS_CHROMEOS) if (!has_secure_protocol) @@ -166,7 +165,7 @@ base::Value GetSettingsOnBlockingTaskRunner( const std::string& device_name, const PrinterBasicInfo& basic_info, - const PrinterSemanticCapsAndDefaults::Papers& additional_papers, + PrinterSemanticCapsAndDefaults::Papers user_defined_papers, bool has_secure_protocol, scoped_refptr<PrintBackend> print_backend) { SCOPED_UMA_HISTOGRAM_TIMER("Printing.PrinterCapabilities"); @@ -194,9 +193,9 @@ base::Value printer_info_capabilities(base::Value::Type::DICTIONARY); printer_info_capabilities.SetKey(kPrinter, std::move(printer_info)); printer_info_capabilities.SetKey( - kSettingCapabilities, - GetPrinterCapabilitiesOnBlockingTaskRunner( - device_name, additional_papers, has_secure_protocol, print_backend)); + kSettingCapabilities, GetPrinterCapabilitiesOnBlockingTaskRunner( + device_name, std::move(user_defined_papers), + has_secure_protocol, print_backend)); return printer_info_capabilities; }
diff --git a/components/printing/browser/printer_capabilities.h b/components/printing/browser/printer_capabilities.h index 2ed1a03..73f881f 100644 --- a/components/printing/browser/printer_capabilities.h +++ b/components/printing/browser/printer_capabilities.h
@@ -33,12 +33,12 @@ // as |device_name| in the PrinterBackend. The returned dictionary is suitable // for passage to the WebUI. The settings are obtained using |print_backend|, // which is required. -// Data from |basic_info|, |additional_papers| and |has_secure_protocol| are +// Data from |basic_info|, |user_defined_papers| and |has_secure_protocol| are // incorporated into the returned dictionary. base::Value GetSettingsOnBlockingTaskRunner( const std::string& device_name, const PrinterBasicInfo& basic_info, - const PrinterSemanticCapsAndDefaults::Papers& additional_papers, + PrinterSemanticCapsAndDefaults::Papers user_defined_papers, bool has_secure_protocol, scoped_refptr<PrintBackend> print_backend);
diff --git a/components/printing/browser/printer_capabilities_unittest.cc b/components/printing/browser/printer_capabilities_unittest.cc index 2476507..507cfed 100644 --- a/components/printing/browser/printer_capabilities_unittest.cc +++ b/components/printing/browser/printer_capabilities_unittest.cc
@@ -34,6 +34,25 @@ std::move(done_closure).Run(); } +void VerifyPaper(const Value& paper_dict, + const std::string& expected_name, + const std::string& expected_vendor, + const gfx::Size& expected_size) { + ASSERT_TRUE(paper_dict.is_dict()); + const std::string* name = paper_dict.FindStringKey("custom_display_name"); + ASSERT_TRUE(name); + EXPECT_EQ(expected_name, *name); + const std::string* vendor = paper_dict.FindStringKey("vendor_id"); + ASSERT_TRUE(vendor); + EXPECT_EQ(expected_vendor, *vendor); + base::Optional<int> width = paper_dict.FindIntKey("width_microns"); + ASSERT_TRUE(width.has_value()); + EXPECT_EQ(expected_size.width(), width.value()); + base::Optional<int> height = paper_dict.FindIntKey("height_microns"); + ASSERT_TRUE(height.has_value()); + EXPECT_EQ(expected_size.height(), height.value()); +} + } // namespace class PrinterCapabilitiesTest : public testing::Test { @@ -58,15 +77,15 @@ base::Value GetSettingsOnBlockingTaskRunnerAndWaitForResults( const std::string& printer_name, const PrinterBasicInfo& basic_info, - const PrinterSemanticCapsAndDefaults::Papers& papers) { + PrinterSemanticCapsAndDefaults::Papers papers) { base::RunLoop run_loop; base::Value settings; base::PostTaskAndReplyWithResult( blocking_task_runner_.get(), FROM_HERE, base::BindOnce(&GetSettingsOnBlockingTaskRunner, printer_name, - basic_info, papers, /*has_secure_protocol=*/false, - test_backend_), + basic_info, std::move(papers), + /*has_secure_protocol=*/false, test_backend_), base::BindOnce(&GetSettingsDone, run_loop.QuitClosure(), &settings)); run_loop.Run(); @@ -87,11 +106,11 @@ TEST_F(PrinterCapabilitiesTest, NonNullForMissingPrinter) { std::string printer_name = "missing_printer"; PrinterBasicInfo basic_info; - PrinterSemanticCapsAndDefaults::Papers no_additional_papers; + PrinterSemanticCapsAndDefaults::Papers no_user_defined_papers; base::Value settings_dictionary = - GetSettingsOnBlockingTaskRunnerAndWaitForResults(printer_name, basic_info, - no_additional_papers); + GetSettingsOnBlockingTaskRunnerAndWaitForResults( + printer_name, basic_info, std::move(no_user_defined_papers)); ASSERT_FALSE(settings_dictionary.DictEmpty()); } @@ -99,7 +118,7 @@ TEST_F(PrinterCapabilitiesTest, ProvidedCapabilitiesUsed) { std::string printer_name = "test_printer"; PrinterBasicInfo basic_info; - PrinterSemanticCapsAndDefaults::Papers no_additional_papers; + PrinterSemanticCapsAndDefaults::Papers no_user_defined_papers; // Set a capability and add a valid printer. auto caps = std::make_unique<PrinterSemanticCapsAndDefaults>(); @@ -107,8 +126,8 @@ print_backend()->AddValidPrinter(printer_name, std::move(caps)); base::Value settings_dictionary = - GetSettingsOnBlockingTaskRunnerAndWaitForResults(printer_name, basic_info, - no_additional_papers); + GetSettingsOnBlockingTaskRunnerAndWaitForResults( + printer_name, basic_info, std::move(no_user_defined_papers)); // Verify settings were created. ASSERT_FALSE(settings_dictionary.DictEmpty()); @@ -131,14 +150,14 @@ TEST_F(PrinterCapabilitiesTest, NullCapabilitiesExcluded) { std::string printer_name = "test_printer"; PrinterBasicInfo basic_info; - PrinterSemanticCapsAndDefaults::Papers no_additional_papers; + PrinterSemanticCapsAndDefaults::Papers no_user_defined_papers; // Return false when attempting to retrieve capabilities. print_backend()->AddValidPrinter(printer_name, nullptr); base::Value settings_dictionary = - GetSettingsOnBlockingTaskRunnerAndWaitForResults(printer_name, basic_info, - no_additional_papers); + GetSettingsOnBlockingTaskRunnerAndWaitForResults( + printer_name, basic_info, std::move(no_user_defined_papers)); // Verify settings were created. ASSERT_FALSE(settings_dictionary.DictEmpty()); @@ -150,23 +169,24 @@ EXPECT_TRUE(caps_dict->DictEmpty()); } -TEST_F(PrinterCapabilitiesTest, AdditionalPapers) { +TEST_F(PrinterCapabilitiesTest, UserDefinedPapers) { std::string printer_name = "test_printer"; PrinterBasicInfo basic_info; // Set a capability and add a valid printer. auto caps = std::make_unique<PrinterSemanticCapsAndDefaults>(); + caps->papers.push_back({"printer_foo", "printer_vendor", {100, 234}}); caps->dpis = {{600, 600}}; print_backend()->AddValidPrinter(printer_name, std::move(caps)); // Add some more paper sizes. - PrinterSemanticCapsAndDefaults::Papers additional_papers; - additional_papers.push_back({"foo", "vendor", {200, 300}}); - additional_papers.push_back({"bar", "vendor", {600, 600}}); + PrinterSemanticCapsAndDefaults::Papers user_defined_papers; + user_defined_papers.push_back({"foo", "vendor", {200, 300}}); + user_defined_papers.push_back({"bar", "vendor", {600, 600}}); base::Value settings_dictionary = - GetSettingsOnBlockingTaskRunnerAndWaitForResults(printer_name, basic_info, - additional_papers); + GetSettingsOnBlockingTaskRunnerAndWaitForResults( + printer_name, basic_info, std::move(user_defined_papers)); // Verify settings were created. ASSERT_FALSE(settings_dictionary.DictEmpty()); @@ -178,7 +198,7 @@ const Value* printer = cdd->FindKeyOfType(kPrinter, Value::Type::DICTIONARY); ASSERT_TRUE(printer); - // Verify there are 2 paper sizes. + // Verify there are 3 paper sizes. const Value* media_size = printer->FindKeyOfType("media_size", Value::Type::DICTIONARY); ASSERT_TRUE(media_size); @@ -186,48 +206,20 @@ media_size->FindKeyOfType("option", Value::Type::LIST); ASSERT_TRUE(media_option); const auto& list = media_option->GetList(); - ASSERT_EQ(2U, list.size()); - ASSERT_TRUE(list[0].is_dict()); - ASSERT_TRUE(list[1].is_dict()); + ASSERT_EQ(3U, list.size()); - // Verify the 2 paper sizes are the ones in |additional_papers|. - const Value* name; - const Value* vendor; - const Value* width; - const Value* height; - - name = list[0].FindKeyOfType("custom_display_name", Value::Type::STRING); - ASSERT_TRUE(name); - EXPECT_EQ("foo", name->GetString()); - vendor = list[0].FindKeyOfType("vendor_id", Value::Type::STRING); - ASSERT_TRUE(vendor); - EXPECT_EQ("vendor", vendor->GetString()); - width = list[0].FindKeyOfType("width_microns", Value::Type::INTEGER); - ASSERT_TRUE(width); - EXPECT_EQ(200, width->GetInt()); - height = list[0].FindKeyOfType("height_microns", Value::Type::INTEGER); - ASSERT_TRUE(height); - EXPECT_EQ(300, height->GetInt()); - - name = list[1].FindKeyOfType("custom_display_name", Value::Type::STRING); - ASSERT_TRUE(name); - EXPECT_EQ("bar", name->GetString()); - vendor = list[1].FindKeyOfType("vendor_id", Value::Type::STRING); - ASSERT_TRUE(vendor); - EXPECT_EQ("vendor", vendor->GetString()); - width = list[1].FindKeyOfType("width_microns", Value::Type::INTEGER); - ASSERT_TRUE(width); - EXPECT_EQ(600, width->GetInt()); - height = list[1].FindKeyOfType("height_microns", Value::Type::INTEGER); - ASSERT_TRUE(height); - EXPECT_EQ(600, height->GetInt()); + // Verify the 3 paper sizes are the ones in |caps->papers|, followed by the + // ones in |user_defined_papers|. + VerifyPaper(list[0], "printer_foo", "printer_vendor", {100, 234}); + VerifyPaper(list[1], "foo", "vendor", {200, 300}); + VerifyPaper(list[2], "bar", "vendor", {600, 600}); } #if defined(OS_CHROMEOS) TEST_F(PrinterCapabilitiesTest, HasNotSecureProtocol) { std::string printer_name = "test_printer"; PrinterBasicInfo basic_info; - PrinterSemanticCapsAndDefaults::Papers no_additional_papers; + PrinterSemanticCapsAndDefaults::Papers no_user_defined_papers; // Set a capability and add a valid printer. auto caps = std::make_unique<PrinterSemanticCapsAndDefaults>(); @@ -235,8 +227,8 @@ print_backend()->AddValidPrinter(printer_name, std::move(caps)); base::Value settings_dictionary = - GetSettingsOnBlockingTaskRunnerAndWaitForResults(printer_name, basic_info, - no_additional_papers); + GetSettingsOnBlockingTaskRunnerAndWaitForResults( + printer_name, basic_info, std::move(no_user_defined_papers)); // Verify settings were created. ASSERT_FALSE(settings_dictionary.DictEmpty());
diff --git a/components/printing/common/cloud_print_cdd_conversion.cc b/components/printing/common/cloud_print_cdd_conversion.cc index a8f4e57f..f570ecf3 100644 --- a/components/printing/common/cloud_print_cdd_conversion.cc +++ b/components/printing/common/cloud_print_cdd_conversion.cc
@@ -58,6 +58,17 @@ } #endif // defined(OS_CHROMEOS) +printer::Media ConvertPaperToMedia( + const printing::PrinterSemanticCapsAndDefaults::Paper& paper) { + gfx::Size paper_size = paper.size_um; + if (paper_size.width() > paper_size.height()) + paper_size.SetSize(paper_size.height(), paper_size.width()); + printer::Media new_media(paper.display_name, paper.vendor_id, + paper_size.width(), paper_size.height()); + new_media.MatchBySize(); + return new_media; +} + printer::MediaCapability GetMediaCapabilities( const printing::PrinterSemanticCapsAndDefaults& semantic_info) { printer::MediaCapability media_capabilities; @@ -70,12 +81,7 @@ default_media.MatchBySize(); for (const auto& paper : semantic_info.papers) { - gfx::Size paper_size = paper.size_um; - if (paper_size.width() > paper_size.height()) - paper_size.SetSize(paper_size.height(), paper_size.width()); - printer::Media new_media(paper.display_name, paper.vendor_id, - paper_size.width(), paper_size.height()); - new_media.MatchBySize(); + printer::Media new_media = ConvertPaperToMedia(paper); if (!new_media.IsValid()) continue; @@ -90,6 +96,16 @@ if (!is_default_set && default_media.IsValid()) media_capabilities.AddDefaultOption(default_media, true); + // Allow user defined paper sizes to be repeats of existing paper sizes. + // Do not allow user defined paper sizes to be the default, for now. + // TODO(thestig): Figure out the default paper policy here. + for (const auto& paper : semantic_info.user_defined_papers) { + printer::Media new_media = ConvertPaperToMedia(paper); + if (!new_media.IsValid()) + continue; + + media_capabilities.AddOption(new_media); + } return media_capabilities; }
diff --git a/components/profile_metrics/state.cc b/components/profile_metrics/state.cc index 97e9a76..3bb503ad 100644 --- a/components/profile_metrics/state.cc +++ b/components/profile_metrics/state.cc
@@ -51,4 +51,12 @@ "Profile.State.LastUsed" + GetStateSuffix(suffix), days_since_last_use); } +void LogProfileAllAccountsNames(AllAccountsNames names) { + base::UmaHistogramEnumeration("Profile.AllAccounts.Names", names); +} + +void LogProfileAllAccountsCategories(AllAccountsCategories categories) { + base::UmaHistogramEnumeration("Profile.AllAccounts.Categories", categories); +} + } // namespace profile_metrics \ No newline at end of file
diff --git a/components/profile_metrics/state.h b/components/profile_metrics/state.h index ef48100d..79ff2599 100644 --- a/components/profile_metrics/state.h +++ b/components/profile_metrics/state.h
@@ -48,6 +48,35 @@ kMaxValue = kSignedOut }; +// Classification of what gaia names appear or appeared in this profile since +// the last time gaia cookies got deleted. Thus, this also includes signed-out +// accounts. In order to protect privacy, only classifies whether multiple +// distinct gaia names appeared in this profile and if so, whether sync is +// enabled for one of them. Furthermore, this classification uses a low-entropy +// hash to detect distinct names. In case of a rare hash collision (less than +// 0.1% of cases), multiple names get recorded as a single name. Entries should +// not be renumbered and numeric values should never be reused. +enum class AllAccountsNames { + kLikelySingleName = 0, // Gets also rare false records due to hash collision. + kMultipleNamesWithoutSync = 1, + kMultipleNamesWithSync = 2, + kMaxValue = kMultipleNamesWithSync +}; + +// Classification of what account categories out of {consumer, enterprise} +// appear or appeared in this profile since the last time gaia cookies got +// deleted. Thus, this also includes signed-out accounts. If both categories +// appeared, it also distinguishes whether sync is enabled and for which of +// them. Entries should not be renumbered and numeric values should never be +// reused. +enum class AllAccountsCategories { + kSingleCategory = 0, + kBothConsumerAndEnterpriseNoSync = 1, + kBothConsumerAndEnterpriseSyncingConsumer = 2, + kBothConsumerAndEnterpriseSyncingEnterprise = 3, + kMaxValue = kBothConsumerAndEnterpriseSyncingEnterprise +}; + // Different types of reporting for profile state. This is used as a histogram // suffix. enum class StateSuffix { @@ -77,6 +106,12 @@ // Records the days since last use of a profile. void LogProfileDaysSinceLastUse(int days_since_last_use, StateSuffix suffix); +// Records the state of account names used in multi-login. +void LogProfileAllAccountsNames(AllAccountsNames names); + +// Records the state of account categories used in multi-login. +void LogProfileAllAccountsCategories(AllAccountsCategories categories); + } // namespace profile_metrics #endif // COMPONENTS_PROFILE_METRICS_STATE_H_
diff --git a/components/proxy_config/ios/proxy_service_factory.cc b/components/proxy_config/ios/proxy_service_factory.cc index f24037e5..4fd69797 100644 --- a/components/proxy_config/ios/proxy_service_factory.cc +++ b/components/proxy_config/ios/proxy_service_factory.cc
@@ -54,6 +54,6 @@ DCHECK_CURRENTLY_ON(web::WebThread::IO); std::unique_ptr<net::ProxyResolutionService> proxy_resolution_service( net::ConfiguredProxyResolutionService::CreateUsingSystemProxyResolver( - std::move(proxy_config_service), net_log, quick_check_enabled)); + std::move(proxy_config_service), quick_check_enabled, net_log)); return proxy_resolution_service; }
diff --git a/components/renderer_context_menu/render_view_context_menu_observer.h b/components/renderer_context_menu/render_view_context_menu_observer.h index 60081418..ee2cbe4 100644 --- a/components/renderer_context_menu/render_view_context_menu_observer.h +++ b/components/renderer_context_menu/render_view_context_menu_observer.h
@@ -106,7 +106,10 @@ virtual void OnMenuClosed() {} virtual void OnContextMenuShown(const content::ContextMenuParams& params, - gfx::Rect bounds) {} + const gfx::Rect& bounds_in_screen) {} + // + virtual void OnContextMenuViewBoundsChanged( + const gfx::Rect& bounds_in_screen) {} }; #endif // COMPONENTS_RENDERER_CONTEXT_MENU_RENDER_VIEW_CONTEXT_MENU_OBSERVER_H_
diff --git a/components/safe_browsing/content/browser/browser_url_loader_throttle.cc b/components/safe_browsing/content/browser/browser_url_loader_throttle.cc index 1f7fd8dd..f80d1c98 100644 --- a/components/safe_browsing/content/browser/browser_url_loader_throttle.cc +++ b/components/safe_browsing/content/browser/browser_url_loader_throttle.cc
@@ -34,12 +34,14 @@ base::RepeatingCallback<content::WebContents*()> web_contents_getter, base::WeakPtr<BrowserURLLoaderThrottle> throttle, bool real_time_lookup_enabled, + bool enhanced_protection_enabled, base::WeakPtr<RealTimeUrlLookupService> url_lookup_service) : delegate_getter_(std::move(delegate_getter)), frame_tree_node_id_(frame_tree_node_id), web_contents_getter_(web_contents_getter), throttle_(std::move(throttle)), real_time_lookup_enabled_(real_time_lookup_enabled), + enhanced_protection_enabled_(enhanced_protection_enabled), url_lookup_service_(url_lookup_service) {} // Starts the initial safe browsing check. This check and future checks may be @@ -70,7 +72,7 @@ url_checker_ = std::make_unique<SafeBrowsingUrlCheckerImpl>( headers, load_flags, resource_type, has_user_gesture, url_checker_delegate, web_contents_getter_, real_time_lookup_enabled_, - url_lookup_service_); + enhanced_protection_enabled_, url_lookup_service_); CheckUrl(url, method); } @@ -137,6 +139,7 @@ bool skip_checks_ = false; base::WeakPtr<BrowserURLLoaderThrottle> throttle_; bool real_time_lookup_enabled_ = false; + bool enhanced_protection_enabled_ = false; base::WeakPtr<RealTimeUrlLookupService> url_lookup_service_; }; @@ -164,9 +167,13 @@ url_lookup_service ? url_lookup_service->CanPerformFullURLLookup() : false; + bool enhanced_protection_enabled = + url_lookup_service && url_lookup_service->IsUserEpOptedIn(); + io_checker_ = std::make_unique<CheckerOnIO>( std::move(delegate_getter), frame_tree_node_id, web_contents_getter, - weak_factory_.GetWeakPtr(), real_time_lookup_enabled, url_lookup_service); + weak_factory_.GetWeakPtr(), real_time_lookup_enabled, + enhanced_protection_enabled, url_lookup_service); } BrowserURLLoaderThrottle::~BrowserURLLoaderThrottle() {
diff --git a/components/safe_browsing/content/browser/mojo_safe_browsing_impl.cc b/components/safe_browsing/content/browser/mojo_safe_browsing_impl.cc index f07586b..43e5f81 100644 --- a/components/safe_browsing/content/browser/mojo_safe_browsing_impl.cc +++ b/components/safe_browsing/content/browser/mojo_safe_browsing_impl.cc
@@ -156,7 +156,8 @@ delegate_, base::BindRepeating(&GetWebContentsFromID, render_process_id_, static_cast<int>(render_frame_id)), - /*real_time_lookup_enabled=*/false, /* url_lookup_service */ nullptr); + /*real_time_lookup_enabled=*/false, /*enhanced_protection_enabled=*/false, + /*url_lookup_service=*/nullptr); checker_impl->CheckUrl( url, method,
diff --git a/components/safe_browsing/content/browser/safe_browsing_url_checker_impl_content.cc b/components/safe_browsing/content/browser/safe_browsing_url_checker_impl_content.cc index 02bfff1..6cb1a96c 100644 --- a/components/safe_browsing/content/browser/safe_browsing_url_checker_impl_content.cc +++ b/components/safe_browsing/content/browser/safe_browsing_url_checker_impl_content.cc
@@ -21,7 +21,7 @@ bool SafeBrowsingUrlCheckerImpl::CanPerformFullURLLookup(const GURL& url) { return real_time_lookup_enabled_ && RealTimePolicyEngine::CanPerformFullURLLookupForResourceType( - resource_type_) && + resource_type_, enhanced_protection_enabled_) && RealTimeUrlLookupService::CanCheckUrl(url); } @@ -44,7 +44,11 @@ bool is_rt_lookup_successful, std::unique_ptr<RTLookupResponse> response) { DCHECK(CurrentlyOnThread(ThreadID::IO)); - DCHECK_EQ(ResourceType::kMainFrame, resource_type_); + bool is_expected_resource_type = + (ResourceType::kMainFrame == resource_type_) || + ((ResourceType::kSubFrame == resource_type_) && + enhanced_protection_enabled_); + DCHECK(is_expected_resource_type); const GURL& url = urls_[next_index_].url;
diff --git a/components/safe_browsing/content/password_protection/mock_password_protection_service.h b/components/safe_browsing/content/password_protection/mock_password_protection_service.h index 5b2f883..d560014 100644 --- a/components/safe_browsing/content/password_protection/mock_password_protection_service.h +++ b/components/safe_browsing/content/password_protection/mock_password_protection_service.h
@@ -51,8 +51,9 @@ MOCK_METHOD1(SanitizeReferrerChain, void(ReferrerChain*)); MOCK_METHOD2(ShowInterstitial, void(content::WebContents*, ReusedPasswordAccountType)); - MOCK_METHOD2(PersistPhishedSavedPasswordCredential, - void(const std::string&, const std::vector<std::string>&)); + MOCK_METHOD1( + PersistPhishedSavedPasswordCredential, + void(const std::vector<password_manager::MatchingReusedCredential>&)); MOCK_METHOD3(IsPingingEnabled, bool(LoginReputationClientRequest::TriggerType, ReusedPasswordAccountType, @@ -89,13 +90,14 @@ const GURL&, const GURL&, const std::string&)); - MOCK_METHOD6(MaybeStartProtectedPasswordEntryRequest, - void(content::WebContents*, - const GURL&, - const std::string&, - PasswordType, - const std::vector<std::string>&, - bool)); + MOCK_METHOD6( + MaybeStartProtectedPasswordEntryRequest, + void(content::WebContents*, + const GURL&, + const std::string&, + PasswordType, + const std::vector<password_manager::MatchingReusedCredential>&, + bool)); private: DISALLOW_COPY_AND_ASSIGN(MockPasswordProtectionService);
diff --git a/components/safe_browsing/content/password_protection/password_protection_request.cc b/components/safe_browsing/content/password_protection/password_protection_request.cc index 83371f8..cfbe5ee 100644 --- a/components/safe_browsing/content/password_protection/password_protection_request.cc +++ b/components/safe_browsing/content/password_protection/password_protection_request.cc
@@ -29,11 +29,13 @@ #include "content/public/browser/web_contents.h" #include "net/base/escape.h" #include "net/base/load_flags.h" +#include "net/base/registry_controlled_domains/registry_controlled_domain.h" #include "net/base/url_util.h" #include "net/http/http_status_code.h" #include "net/traffic_annotation/network_traffic_annotation.h" #include "services/network/public/cpp/simple_url_loader.h" #include "services/service_manager/public/cpp/interface_provider.h" +#include "url/gurl.h" #include "url/origin.h" using content::BrowserThread; @@ -69,6 +71,24 @@ } #endif +std::vector<std::string> GetMatchingDomains( + const std::vector<password_manager::MatchingReusedCredential>& + matching_reused_credentials) { + std::vector<std::string> matching_domains; + matching_domains.reserve(matching_reused_credentials.size()); + for (const auto& credential : matching_reused_credentials) { + std::string domain = net::registry_controlled_domains::GetDomainAndRegistry( + GURL(credential.signon_realm), + net::registry_controlled_domains::INCLUDE_PRIVATE_REGISTRIES); + matching_domains.push_back(std::move(domain)); + } + auto matching_domains_it = + std::unique(matching_domains.begin(), matching_domains.end()); + matching_domains.resize( + std::distance(matching_domains.begin(), matching_domains_it)); + return matching_domains; +} + } // namespace PasswordProtectionRequest::PasswordProtectionRequest( @@ -78,7 +98,8 @@ const GURL& password_form_frame_url, const std::string& username, PasswordType password_type, - const std::vector<std::string>& matching_domains, + const std::vector<password_manager::MatchingReusedCredential>& + matching_reused_credentials, LoginReputationClientRequest::TriggerType type, bool password_field_exists, PasswordProtectionService* pps, @@ -90,7 +111,8 @@ password_form_frame_url_(password_form_frame_url), username_(username), password_type_(password_type), - matching_domains_(matching_domains), + matching_domains_(GetMatchingDomains(matching_reused_credentials)), + matching_reused_credentials_(matching_reused_credentials), trigger_type_(type), password_field_exists_(password_field_exists), password_protection_service_(pps), @@ -103,8 +125,7 @@ trigger_type_ == LoginReputationClientRequest::PASSWORD_REUSE_EVENT); DCHECK(trigger_type_ != LoginReputationClientRequest::PASSWORD_REUSE_EVENT || password_type_ != PasswordType::SAVED_PASSWORD || - matching_domains_.size() > 0); - + !matching_reused_credentials_.empty()); request_proto_->set_trigger_type(trigger_type_); }
diff --git a/components/safe_browsing/content/password_protection/password_protection_request.h b/components/safe_browsing/content/password_protection/password_protection_request.h index ff16420..0cd8581 100644 --- a/components/safe_browsing/content/password_protection/password_protection_request.h +++ b/components/safe_browsing/content/password_protection/password_protection_request.h
@@ -12,6 +12,7 @@ #include "base/task/cancelable_task_tracker.h" #include "base/time/time.h" #include "components/password_manager/core/browser/password_manager_metrics_util.h" +#include "components/password_manager/core/browser/password_reuse_detector.h" #include "components/safe_browsing/buildflags.h" #include "components/safe_browsing/content/common/safe_browsing.mojom.h" #include "components/safe_browsing/content/password_protection/metrics_util.h" @@ -58,17 +59,19 @@ content::BrowserThread::DeleteOnUIThread>, public content::WebContentsObserver { public: - PasswordProtectionRequest(content::WebContents* web_contents, - const GURL& main_frame_url, - const GURL& password_form_action, - const GURL& password_form_frame_url, - const std::string& username, - PasswordType password_type, - const std::vector<std::string>& matching_origins, - LoginReputationClientRequest::TriggerType type, - bool password_field_exists, - PasswordProtectionService* pps, - int request_timeout_in_ms); + PasswordProtectionRequest( + content::WebContents* web_contents, + const GURL& main_frame_url, + const GURL& password_form_action, + const GURL& password_form_frame_url, + const std::string& username, + PasswordType password_type, + const std::vector<password_manager::MatchingReusedCredential>& + matching_reused_credentials, + LoginReputationClientRequest::TriggerType type, + bool password_field_exists, + PasswordProtectionService* pps, + int request_timeout_in_ms); base::WeakPtr<PasswordProtectionRequest> GetWeakPtr() { return weakptr_factory_.GetWeakPtr(); @@ -101,10 +104,15 @@ PasswordType password_type() const { return password_type_; } - const std::vector<std::string> matching_domains() const& { + const std::vector<std::string>& matching_domains() const { return matching_domains_; } + const std::vector<password_manager::MatchingReusedCredential>& + matching_reused_credentials() const { + return matching_reused_credentials_; + } + bool is_modal_warning_showing() const { return is_modal_warning_showing_; } void set_is_modal_warning_showing(bool is_warning_showing) { @@ -219,6 +227,12 @@ // Otherwise, may or may not be empty. const std::vector<std::string> matching_domains_; + // Signon_realms from the Password Manager that match this password. + // Should be non-empty if |reused_password_type_| == SAVED_PASSWORD. + // Otherwise, may or may not be empty. + const std::vector<password_manager::MatchingReusedCredential> + matching_reused_credentials_; + // If this request is for unfamiliar login page or for a password reuse event. const LoginReputationClientRequest::TriggerType trigger_type_;
diff --git a/components/safe_browsing/content/password_protection/password_protection_service.cc b/components/safe_browsing/content/password_protection/password_protection_service.cc index 6000cf1..5eb5de72 100644 --- a/components/safe_browsing/content/password_protection/password_protection_service.cc +++ b/components/safe_browsing/content/password_protection/password_protection_service.cc
@@ -111,7 +111,7 @@ StartRequest(web_contents, main_frame_url, password_form_action, password_form_frame_url, /* username */ "", PasswordType::PASSWORD_TYPE_UNKNOWN, - {}, /* matching_domains: not used for this type */ + {}, /* matching_reused_credentials: not used for this type */ LoginReputationClientRequest::UNFAMILIAR_LOGIN_PAGE, true); } } @@ -123,7 +123,8 @@ const GURL& main_frame_url, const std::string& username, PasswordType password_type, - const std::vector<std::string>& matching_domains, + const std::vector<password_manager::MatchingReusedCredential>& + matching_reused_credentials, bool password_field_exists) { DCHECK_CURRENTLY_ON(BrowserThread::UI); ReusedPasswordAccountType reused_password_account_type = @@ -144,7 +145,7 @@ #endif // defined(FULL_SAFE_BROWSING) if (can_send_ping) { StartRequest(web_contents, main_frame_url, GURL(), GURL(), username, - password_type, matching_domains, + password_type, matching_reused_credentials, LoginReputationClientRequest::PASSWORD_REUSE_EVENT, password_field_exists); } else { @@ -226,15 +227,17 @@ const GURL& password_form_frame_url, const std::string& username, PasswordType password_type, - const std::vector<std::string>& matching_domains, + const std::vector<password_manager::MatchingReusedCredential>& + matching_reused_credentials, LoginReputationClientRequest::TriggerType trigger_type, bool password_field_exists) { DCHECK_CURRENTLY_ON(BrowserThread::UI); scoped_refptr<PasswordProtectionRequest> request( new PasswordProtectionRequest( web_contents, main_frame_url, password_form_action, - password_form_frame_url, username, password_type, matching_domains, - trigger_type, password_field_exists, this, GetRequestTimeoutInMS())); + password_form_frame_url, username, password_type, + matching_reused_credentials, trigger_type, password_field_exists, + this, GetRequestTimeoutInMS())); request->Start(); pending_requests_.insert(std::move(request)); } @@ -329,8 +332,8 @@ verdict == LoginReputationClientResponse::PHISHING || verdict == LoginReputationClientResponse::LOW_REPUTATION; if (is_unsafe_url) { - PersistPhishedSavedPasswordCredential(request->username(), - request->matching_domains()); + PersistPhishedSavedPasswordCredential( + request->matching_reused_credentials()); } }
diff --git a/components/safe_browsing/content/password_protection/password_protection_service.h b/components/safe_browsing/content/password_protection/password_protection_service.h index 4e6ec73..78c22f87 100644 --- a/components/safe_browsing/content/password_protection/password_protection_service.h +++ b/components/safe_browsing/content/password_protection/password_protection_service.h
@@ -21,6 +21,7 @@ #include "components/history/core/browser/history_service.h" #include "components/history/core/browser/history_service_observer.h" #include "components/password_manager/core/browser/password_manager_metrics_util.h" +#include "components/password_manager/core/browser/password_reuse_detector.h" #include "components/safe_browsing/buildflags.h" #include "components/safe_browsing/content/common/safe_browsing.mojom.h" #include "components/safe_browsing/content/password_protection/metrics_util.h" @@ -97,15 +98,17 @@ // Creates an instance of PasswordProtectionRequest and call Start() on that // instance. This function also insert this request object in |requests_| for // record keeping. - void StartRequest(content::WebContents* web_contents, - const GURL& main_frame_url, - const GURL& password_form_action, - const GURL& password_form_frame_url, - const std::string& username, - PasswordType password_type, - const std::vector<std::string>& matching_domains, - LoginReputationClientRequest::TriggerType trigger_type, - bool password_field_exists); + void StartRequest( + content::WebContents* web_contents, + const GURL& main_frame_url, + const GURL& password_form_action, + const GURL& password_form_frame_url, + const std::string& username, + PasswordType password_type, + const std::vector<password_manager::MatchingReusedCredential>& + matching_reused_credentials, + LoginReputationClientRequest::TriggerType trigger_type, + bool password_field_exists); #if defined(ON_FOCUS_PING_ENABLED) virtual void MaybeStartPasswordFieldOnFocusRequest( @@ -122,7 +125,8 @@ const GURL& main_frame_url, const std::string& username, PasswordType password_type, - const std::vector<std::string>& matching_domains, + const std::vector<password_manager::MatchingReusedCredential>& + matching_reused_credentials, bool password_field_exists); #endif @@ -209,11 +213,11 @@ RequestOutcome* reason) const = 0; // Persist the phished saved password credential in the "compromised - // credentials" table. Calls the password store to add a row for each domain - // where the phished saved password is used on. + // credentials" table. Calls the password store to add a row for each + // MatchingReusedCredential where the phished saved password is used on. virtual void PersistPhishedSavedPasswordCredential( - const std::string& username, - const std::vector<std::string>& matching_domains) = 0; + const std::vector<password_manager::MatchingReusedCredential>& + matching_reused_credentials) = 0; // Converts from password::metrics_util::PasswordType to // LoginReputationClientRequest::PasswordReuseEvent::ReusedPasswordType.
diff --git a/components/safe_browsing/content/password_protection/password_protection_service_unittest.cc b/components/safe_browsing/content/password_protection/password_protection_service_unittest.cc index 04b3ef6..27ba5ef5 100644 --- a/components/safe_browsing/content/password_protection/password_protection_service_unittest.cc +++ b/components/safe_browsing/content/password_protection/password_protection_service_unittest.cc
@@ -45,6 +45,7 @@ #include "testing/gmock/include/gmock/gmock.h" #include "testing/gtest/include/gtest/gtest.h" +using base::ASCIIToUTF16; using testing::_; using testing::AnyNumber; using testing::ElementsAre; @@ -55,8 +56,8 @@ const char kFormActionUrl[] = "https://form_action.com/"; const char kPasswordFrameUrl[] = "https://password_frame.com/"; -const char kSavedDomain[] = "saved_domain.com"; -const char kSavedDomain2[] = "saved_domain2.com"; +const char kSavedDomain[] = "http://saved_domain.com"; +const char kSavedDomain2[] = "http://saved_domain2.com"; const char kTargetUrl[] = "http://foo.com/"; const char kUserName[] = "username"; @@ -306,7 +307,8 @@ void InitializeAndStartPasswordEntryRequest( PasswordType type, - const std::vector<std::string>& matching_domains, + const std::vector<password_manager::MatchingReusedCredential>& + matching_reused_credentials, bool match_whitelist, int timeout_in_ms, content::WebContents* web_contents) { @@ -317,8 +319,9 @@ request_ = new PasswordProtectionRequest( web_contents, target_url, GURL(), GURL(), kUserName, type, - matching_domains, LoginReputationClientRequest::PASSWORD_REUSE_EVENT, - true, password_protection_service_.get(), timeout_in_ms); + matching_reused_credentials, + LoginReputationClientRequest::PASSWORD_REUSE_EVENT, true, + password_protection_service_.get(), timeout_in_ms); request_->Start(); } @@ -924,7 +927,8 @@ .WillRepeatedly(Return(account_info)); InitializeAndStartPasswordEntryRequest( - PasswordType::OTHER_GAIA_PASSWORD, {"gmail.com"}, + PasswordType::OTHER_GAIA_PASSWORD, + {{"gmail.com", ASCIIToUTF16("username")}}, /*match_whitelist=*/false, /*timeout_in_ms=*/10000, web_contents.get()); password_protection_service_->WaitForResponse(); @@ -1098,7 +1102,7 @@ } TEST_P(PasswordProtectionServiceTest, - VerifyNonSyncPasswordProtectionRequestProto) { + VerifySavePasswordProtectionRequestProto) { // Set up valid response. LoginReputationClientResponse expected_response = CreateVerdictProto(LoginReputationClientResponse::PHISHING, 10 * kMinute, @@ -1109,7 +1113,9 @@ // Initialize request triggered by saved password reuse. InitializeAndStartPasswordEntryRequest( - PasswordType::SAVED_PASSWORD, {kSavedDomain, kSavedDomain2}, + PasswordType::SAVED_PASSWORD, + {{kSavedDomain, ASCIIToUTF16("username")}, + {kSavedDomain2, ASCIIToUTF16("username")}}, false /* match whitelist */, 100000 /* timeout in ms*/, web_contents.get()); password_protection_service_->WaitForResponse(); @@ -1123,8 +1129,8 @@ if (password_protection_service_->IsExtendedReporting() && !password_protection_service_->IsIncognito()) { ASSERT_EQ(2, reuse_event.domains_matching_password_size()); - EXPECT_EQ(kSavedDomain, reuse_event.domains_matching_password(0)); - EXPECT_EQ(kSavedDomain2, reuse_event.domains_matching_password(1)); + EXPECT_EQ("saved_domain.com", reuse_event.domains_matching_password(0)); + EXPECT_EQ("saved_domain2.com", reuse_event.domains_matching_password(1)); } else { EXPECT_EQ(0, reuse_event.domains_matching_password_size()); } @@ -1376,7 +1382,8 @@ std::unique_ptr<content::WebContents> web_contents = GetWebContents(); password_protection_service_->StartRequest( web_contents.get(), GURL("about:blank"), GURL(), GURL(), "username", - PasswordType::SAVED_PASSWORD, {"example.com"}, + PasswordType::SAVED_PASSWORD, + {{"example1.com", ASCIIToUTF16("username")}}, LoginReputationClientRequest::UNFAMILIAR_LOGIN_PAGE, true); base::RunLoop().RunUntilIdle(); histograms_.ExpectTotalCount(kPasswordOnFocusRequestOutcomeHistogram, 1); @@ -1397,7 +1404,7 @@ std::unique_ptr<content::WebContents> web_contents = GetWebContents(); password_protection_service_->StartRequest( web_contents.get(), GURL("about:blank"), GURL(), GURL(), kUserName, - PasswordType::SAVED_PASSWORD, {"example.com"}, + PasswordType::SAVED_PASSWORD, {{"example.com", ASCIIToUTF16("username")}}, LoginReputationClientRequest::UNFAMILIAR_LOGIN_PAGE, true); base::RunLoop().RunUntilIdle(); @@ -1422,7 +1429,7 @@ std::unique_ptr<content::WebContents> web_contents = GetWebContents(); password_protection_service_->StartRequest( web_contents.get(), GURL("about:blank"), GURL(), GURL(), kUserName, - PasswordType::SAVED_PASSWORD, {"example.com"}, + PasswordType::SAVED_PASSWORD, {{"example.com", ASCIIToUTF16("username")}}, LoginReputationClientRequest::UNFAMILIAR_LOGIN_PAGE, true); base::RunLoop().RunUntilIdle(); @@ -1445,7 +1452,7 @@ std::unique_ptr<content::WebContents> web_contents = GetWebContents(); password_protection_service_->StartRequest( web_contents.get(), GURL("about:blank"), GURL(), GURL(), kUserName, - PasswordType::SAVED_PASSWORD, {"example.com"}, + PasswordType::SAVED_PASSWORD, {{"example.com", ASCIIToUTF16("username")}}, LoginReputationClientRequest::UNFAMILIAR_LOGIN_PAGE, true); task_environment_.FastForwardUntilNoTasksRemain();
diff --git a/components/safe_browsing/core/browser/safe_browsing_url_checker_impl.cc b/components/safe_browsing/core/browser/safe_browsing_url_checker_impl.cc index bd21644..ecb94a3 100644 --- a/components/safe_browsing/core/browser/safe_browsing_url_checker_impl.cc +++ b/components/safe_browsing/core/browser/safe_browsing_url_checker_impl.cc
@@ -102,6 +102,7 @@ scoped_refptr<UrlCheckerDelegate> url_checker_delegate, const base::RepeatingCallback<content::WebContents*()>& web_contents_getter, bool real_time_lookup_enabled, + bool enhanced_protection_enabled, base::WeakPtr<RealTimeUrlLookupService> url_lookup_service_on_ui) : headers_(headers), load_flags_(load_flags), @@ -111,6 +112,7 @@ url_checker_delegate_(std::move(url_checker_delegate)), database_manager_(url_checker_delegate_->GetDatabaseManager()), real_time_lookup_enabled_(real_time_lookup_enabled), + enhanced_protection_enabled_(enhanced_protection_enabled), url_lookup_service_on_ui_(url_lookup_service_on_ui) {} SafeBrowsingUrlCheckerImpl::~SafeBrowsingUrlCheckerImpl() { @@ -459,7 +461,11 @@ void SafeBrowsingUrlCheckerImpl::OnCheckUrlForHighConfidenceAllowlist( bool did_match_allowlist) { DCHECK(CurrentlyOnThread(ThreadID::IO)); - DCHECK_EQ(ResourceType::kMainFrame, resource_type_); + bool is_expected_resource_type = + (ResourceType::kMainFrame == resource_type_) || + ((ResourceType::kSubFrame == resource_type_) && + enhanced_protection_enabled_); + DCHECK(is_expected_resource_type); const GURL& url = urls_[next_index_].url; if (did_match_allowlist) {
diff --git a/components/safe_browsing/core/browser/safe_browsing_url_checker_impl.h b/components/safe_browsing/core/browser/safe_browsing_url_checker_impl.h index 2840117f..cde4bf0 100644 --- a/components/safe_browsing/core/browser/safe_browsing_url_checker_impl.h +++ b/components/safe_browsing/core/browser/safe_browsing_url_checker_impl.h
@@ -85,6 +85,7 @@ const base::RepeatingCallback<content::WebContents*()>& web_contents_getter, bool real_time_lookup_enabled, + bool enhanced_protection_enabled, base::WeakPtr<RealTimeUrlLookupService> url_lookup_service_on_ui); ~SafeBrowsingUrlCheckerImpl() override; @@ -241,6 +242,9 @@ // Whether real time lookup is enabled for this request. bool real_time_lookup_enabled_; + // Whether enhanced protection is enabled for this profile. + bool enhanced_protection_enabled_; + // This object is used to perform real time url check. Can only be accessed in // UI thread. base::WeakPtr<RealTimeUrlLookupService> url_lookup_service_on_ui_;
diff --git a/components/safe_browsing/core/common/BUILD.gn b/components/safe_browsing/core/common/BUILD.gn index 485922f1..f3a82dc 100644 --- a/components/safe_browsing/core/common/BUILD.gn +++ b/components/safe_browsing/core/common/BUILD.gn
@@ -22,14 +22,36 @@ ] } +source_set("safe_browsing_policy_handler") { + sources = [ + "safe_browsing_policy_handler.cc", + "safe_browsing_policy_handler.h", + ] + + deps = [ + ":safe_browsing_prefs", + "//base:base", + "//components/policy:generated", + "//components/policy/core/browser", + "//components/prefs", + "//components/strings:components_strings_grit", + ] +} + source_set("unit_tests") { testonly = true - sources = [ "safe_browsing_prefs_unittest.cc" ] + sources = [ + "safe_browsing_policy_handler_unittest.cc", + "safe_browsing_prefs_unittest.cc", + ] deps = [ + ":safe_browsing_policy_handler", ":safe_browsing_prefs", ":test_support", "//base:base", "//base/test:test_support", + "//components/policy/core/browser:browser", + "//components/policy/core/browser:test_support", "//components/prefs:test_support", "//components/safe_browsing/core:features", "//testing/gtest",
diff --git a/components/safe_browsing/core/common/DEPS b/components/safe_browsing/core/common/DEPS index bb334b1..bfcfa352 100644 --- a/components/safe_browsing/core/common/DEPS +++ b/components/safe_browsing/core/common/DEPS
@@ -1,7 +1,10 @@ include_rules = [ "+components/policy/core/browser", + "+components/policy/core/common", + "+components/policy/policy_constants.h", "+components/pref_registry", "+components/prefs", + "+components/strings/grit/components_strings.h", "+content/public/test", "+crypto/sha2.h", "+ipc",
diff --git a/components/safe_browsing/core/common/safe_browsing_policy_handler.cc b/components/safe_browsing/core/common/safe_browsing_policy_handler.cc new file mode 100644 index 0000000..510fafd --- /dev/null +++ b/components/safe_browsing/core/common/safe_browsing_policy_handler.cc
@@ -0,0 +1,225 @@ +// Copyright 2020 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "components/safe_browsing/core/common/safe_browsing_policy_handler.h" + +#include "base/optional.h" +#include "base/strings/string_number_conversions.h" +#include "base/values.h" +#include "components/policy/core/browser/policy_error_map.h" +#include "components/policy/core/common/policy_map.h" +#include "components/policy/policy_constants.h" +#include "components/prefs/pref_service.h" +#include "components/prefs/pref_value_map.h" +#include "components/safe_browsing/core/common/safe_browsing_prefs.h" +#include "components/strings/grit/components_strings.h" + +namespace safe_browsing { + +namespace { + +using ProtectionLevel = SafeBrowsingPolicyHandler::ProtectionLevel; + +// The result of checking a policy value. +enum class PolicyCheckResult { + // The policy is not set. + kNotSet, + // The policy is set to an invalid value. + kInvalid, + // The policy is set to a valid value. + kValid +}; + +// Checks the value of the SafeBrowsingEnabled policy. |errors| may be +// nullptr. +PolicyCheckResult CheckSafeBrowsingEnabled( + const base::Value* safe_browsing_enabled, + policy::PolicyErrorMap* errors) { + if (!safe_browsing_enabled) + return PolicyCheckResult::kNotSet; + + if (!safe_browsing_enabled->is_bool()) { + if (errors) { + errors->AddError(policy::key::kSafeBrowsingEnabled, IDS_POLICY_TYPE_ERROR, + base::Value::GetTypeName(base::Value::Type::BOOLEAN)); + } + return PolicyCheckResult::kInvalid; + } + + return PolicyCheckResult::kValid; +} + +// Returns the target value of the Safe Browsing Protection Level derived only +// from the legacy SafeBrowsingEnabled policy. If this policy is not set or +// does not have a valid value, returns |nullopt|. +base::Optional<ProtectionLevel> GetValueFromSafeBrowsingEnabledPolicy( + const policy::PolicyMap& policies) { + const base::Value* safe_browsing_enabled = + policies.GetValue(policy::key::kSafeBrowsingEnabled); + + if (CheckSafeBrowsingEnabled(safe_browsing_enabled, nullptr /*error*/) != + PolicyCheckResult::kValid) { + return base::nullopt; + } + + return safe_browsing_enabled->GetBool() ? ProtectionLevel::kStandardProtection + : ProtectionLevel::kNoProtection; +} + +// Returns true if |value| is within the valid range of the +// SafeBrowsingProtectionLevel enum policy. +bool IsValidSafeBrowsingProtectionLevelValue(int value) { + return value >= 0 && value <= static_cast<int>(ProtectionLevel::kMaxValue); +} + +// Checks the value of the SafeBrowsingProtectionLevel policy. |errors| may be +// nullptr. +PolicyCheckResult CheckSafeBrowsingProtectionLevel( + const base::Value* safe_browsing_protection_level, + policy::PolicyErrorMap* errors) { + if (!safe_browsing_protection_level) + return PolicyCheckResult::kNotSet; + + if (!safe_browsing_protection_level->is_int()) { + if (errors) { + errors->AddError(policy::key::kSafeBrowsingProtectionLevel, + IDS_POLICY_TYPE_ERROR, + base::Value::GetTypeName(base::Value::Type::INTEGER)); + } + return PolicyCheckResult::kInvalid; + } + + const int value = safe_browsing_protection_level->GetInt(); + if (!IsValidSafeBrowsingProtectionLevelValue(value)) { + if (errors) { + errors->AddError(policy::key::kSafeBrowsingProtectionLevel, + IDS_POLICY_OUT_OF_RANGE_ERROR, + base::NumberToString(value)); + } + return PolicyCheckResult::kInvalid; + } + return PolicyCheckResult::kValid; +} + +// Returns the target value of Safe Browsing protection level derived only +// from the SafeBrowsingProtectionLevel policy. If this policy is not set or +// does not have a valid value, returns |nullopt|. +base::Optional<ProtectionLevel> GetValueFromSafeBrowsingProtectionLevelPolicy( + const policy::PolicyMap& policies) { + const base::Value* safe_browsing_protection_level = + policies.GetValue(policy::key::kSafeBrowsingProtectionLevel); + + if (CheckSafeBrowsingProtectionLevel(safe_browsing_protection_level, + nullptr /*error*/) != + PolicyCheckResult::kValid) { + return base::nullopt; + } + + return static_cast<ProtectionLevel>(safe_browsing_protection_level->GetInt()); +} + +// Returns the target value of Safe Browsing protection level, derived from +// both the SafeBrowsingEnabled policy and the +// SafeBrowsingProtectionLevel policy. If both policies are set, +// SafeBrowsingProtectionLevel wins. +base::Optional<ProtectionLevel> GetValueFromBothPolicies( + const policy::PolicyMap& policies) { + const base::Optional<ProtectionLevel> safe_browsing_protection_level = + GetValueFromSafeBrowsingProtectionLevelPolicy(policies); + + if (safe_browsing_protection_level.has_value()) { + // SafeBrowsingProtectionLevel overrides SafeBrowsingEnabled policy. + return safe_browsing_protection_level; + } + + return GetValueFromSafeBrowsingEnabledPolicy(policies); +} + +} // namespace + +bool SafeBrowsingPolicyHandler::CheckPolicySettings( + const policy::PolicyMap& policies, + policy::PolicyErrorMap* errors) { + // Deprecated boolean policy SafeBrowsingEnabled. + const base::Value* safe_browsing_enabled = + policies.GetValue(policy::key::kSafeBrowsingEnabled); + PolicyCheckResult safe_browsing_enabled_result = + CheckSafeBrowsingEnabled(safe_browsing_enabled, errors); + + // Enumerated policy SafeBrowsingProtectionLevel + const base::Value* safe_browsing_protection_level = + policies.GetValue(policy::key::kSafeBrowsingProtectionLevel); + PolicyCheckResult safe_browsing_protection_level_result = + CheckSafeBrowsingProtectionLevel(safe_browsing_protection_level, errors); + + if (safe_browsing_enabled_result == PolicyCheckResult::kValid && + safe_browsing_protection_level_result == PolicyCheckResult::kValid) { + errors->AddError(policy::key::kSafeBrowsingEnabled, IDS_POLICY_OVERRIDDEN, + policy::key::kSafeBrowsingProtectionLevel); + } + + // Always continue to ApplyPolicySettings which can handle invalid policy + // values. + return true; +} + +void SafeBrowsingPolicyHandler::ApplyPolicySettings( + const policy::PolicyMap& policies, + PrefValueMap* prefs) { + const base::Optional<ProtectionLevel> value = + GetValueFromBothPolicies(policies); + + if (!value.has_value()) + return; + + switch (value.value()) { + case ProtectionLevel::kNoProtection: + prefs->SetBoolean(prefs::kSafeBrowsingEnabled, false); + prefs->SetBoolean(prefs::kSafeBrowsingEnhanced, false); + return; + case ProtectionLevel::kStandardProtection: + prefs->SetBoolean(prefs::kSafeBrowsingEnabled, true); + prefs->SetBoolean(prefs::kSafeBrowsingEnhanced, false); + return; + case ProtectionLevel::kEnhancedProtection: + // |kSafeBrowsingEnhanced| is enabled, but so is + // |kSafeBrowsingEnabled| because the extensions API should see Safe + // Browsing as enabled. See https://crbug.com/1064722 for more background. + prefs->SetBoolean(prefs::kSafeBrowsingEnabled, true); + prefs->SetBoolean(prefs::kSafeBrowsingEnhanced, true); + return; + } +} + +// static +SafeBrowsingPolicyHandler::ProtectionLevel +SafeBrowsingPolicyHandler::GetSafeBrowsingProtectionLevel( + const PrefService* pref_sevice) { + bool safe_browsing_enhanced = + pref_sevice->GetBoolean(prefs::kSafeBrowsingEnhanced); + bool safe_browsing_enabled = + pref_sevice->GetBoolean(prefs::kSafeBrowsingEnabled); + + if (safe_browsing_enhanced) + return ProtectionLevel::kEnhancedProtection; + + if (safe_browsing_enabled) + return ProtectionLevel::kStandardProtection; + + return ProtectionLevel::kNoProtection; +} + +// static +bool SafeBrowsingPolicyHandler::IsSafeBrowsingProtectionLevelSetByPolicy( + const PrefService* pref_service) { + bool is_safe_browsing_enabled_managed = + pref_service->IsManagedPreference(prefs::kSafeBrowsingEnabled); + bool is_safe_browsing_enhanced_managed = + pref_service->IsManagedPreference(prefs::kSafeBrowsingEnhanced); + DCHECK_EQ(is_safe_browsing_enabled_managed, + is_safe_browsing_enhanced_managed); + return is_safe_browsing_enabled_managed && is_safe_browsing_enhanced_managed; +} + +} // namespace safe_browsing
diff --git a/components/safe_browsing/core/common/safe_browsing_policy_handler.h b/components/safe_browsing/core/common/safe_browsing_policy_handler.h new file mode 100644 index 0000000..e184216 --- /dev/null +++ b/components/safe_browsing/core/common/safe_browsing_policy_handler.h
@@ -0,0 +1,68 @@ +// Copyright 2020 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef COMPONENTS_SAFE_BROWSING_CORE_COMMON_SAFE_BROWSING_POLICY_HANDLER_H_ +#define COMPONENTS_SAFE_BROWSING_CORE_COMMON_SAFE_BROWSING_POLICY_HANDLER_H_ + +#include "base/macros.h" +#include "components/policy/core/browser/configuration_policy_handler.h" + +class PrefService; + +namespace safe_browsing { + +// Handles the SafeBrowsingEnabled and SafeBrowsingProtectionLevel policies. +// Controls the managed values of the prefs |kSafeBrowsingEnabled| and +// |kSafeBrowsingEnhanced|. +class SafeBrowsingPolicyHandler : public policy::ConfigurationPolicyHandler { + public: + SafeBrowsingPolicyHandler() = default; + ~SafeBrowsingPolicyHandler() override = default; + SafeBrowsingPolicyHandler(const SafeBrowsingPolicyHandler&) = delete; + SafeBrowsingPolicyHandler& operator=(const SafeBrowsingPolicyHandler&) = + delete; + + // Safe Browsing protection level as set by policy. The values must match the + // 'SafeBrowsingProtectionLevel' policy definition. + enum class ProtectionLevel { + // Safe Browsing is disabled. + // Prior to M83, this was set by setting the SafeBrowsingEnabled policy to + // |false| or 0x00. + kNoProtection = 0, + + // Default: Standard Safe Browsing is enabled. + // Prior to M83, this was set by setting the SafeBrowsingEnabled policy to + // |true| or 0x01. + kStandardProtection = 1, + + // Enhanced Protection is enabled. This provides the strongest Safe Browsing + // protection but requires sending more data to Google. + kEnhancedProtection = 2, + + // Maximal valid value for range checking. + kMaxValue = kEnhancedProtection + }; + + // ConfigurationPolicyHandler methods: + bool CheckPolicySettings(const policy::PolicyMap& policies, + policy::PolicyErrorMap* errors) override; + void ApplyPolicySettings(const policy::PolicyMap& policies, + PrefValueMap* prefs) override; + + // Returns the current policy-set Safe Browsing protection level according to + // the values in |pref_service|. If no policy mandating Safe Browsing + // protection level is set, the default will be + // |ProtectionLevel::kStandardProtection|. + static ProtectionLevel GetSafeBrowsingProtectionLevel( + const PrefService* pref_service); + + // Returns true if Safe Browsing protection level is set by an active policy + // in |pref_service|. + static bool IsSafeBrowsingProtectionLevelSetByPolicy( + const PrefService* pref_service); +}; + +} // namespace safe_browsing + +#endif // COMPONENTS_SAFE_BROWSING_CORE_COMMON_SAFE_BROWSING_POLICY_HANDLER_H_
diff --git a/components/safe_browsing/core/common/safe_browsing_policy_handler_unittest.cc b/components/safe_browsing/core/common/safe_browsing_policy_handler_unittest.cc new file mode 100644 index 0000000..f8958d0 --- /dev/null +++ b/components/safe_browsing/core/common/safe_browsing_policy_handler_unittest.cc
@@ -0,0 +1,183 @@ +// Copyright 2020 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "components/safe_browsing/core/common/safe_browsing_policy_handler.h" + +#include <vector> + +#include "base/memory/ptr_util.h" +#include "components/policy/core/browser/configuration_policy_pref_store.h" +#include "components/policy/core/browser/configuration_policy_pref_store_test.h" +#include "components/policy/core/common/policy_map.h" +#include "components/policy/policy_constants.h" +#include "components/safe_browsing/core/common/safe_browsing_prefs.h" +#include "testing/gtest/include/gtest/gtest.h" + +namespace safe_browsing { + +class SafeBrowsingPolicyHandlerTest + : public policy::ConfigurationPolicyPrefStoreTest { + public: + SafeBrowsingPolicyHandlerTest() { + handler_list_.AddHandler(std::make_unique<SafeBrowsingPolicyHandler>()); + } + + const std::vector<int> kValidSBProtectionLevelValues{0, 1, 2}; + const std::vector<bool> kValidSBEnabledValues{false, true}; + + bool GetExpectedSBEnabledValueForProtectionLevelValue(int protection_level) { + switch (protection_level) { + case 0: + return false; + case 1: + return true; + case 2: + return true; + default: + NOTREACHED(); + return false; + } + } + + bool GetExpectedSBEnhancedValueForProtectionLevelValue(int protection_level) { + switch (protection_level) { + case 0: + return false; + case 1: + return false; + case 2: + return true; + default: + NOTREACHED(); + return false; + } + } +}; + +TEST_F(SafeBrowsingPolicyHandlerTest, OnlyNewPolicySet) { + EXPECT_FALSE(store_->GetValue(prefs::kSafeBrowsingEnabled, nullptr)); + EXPECT_FALSE(store_->GetValue(prefs::kSafeBrowsingEnhanced, nullptr)); + + for (auto level : kValidSBProtectionLevelValues) { + policy::PolicyMap policy; + policy.Set(policy::key::kSafeBrowsingProtectionLevel, + policy::POLICY_LEVEL_MANDATORY, policy::POLICY_SCOPE_USER, + policy::POLICY_SOURCE_CLOUD, + std::make_unique<base::Value>(level), nullptr); + UpdateProviderPolicy(policy); + + const base::Value* value = nullptr; + ASSERT_TRUE(store_->GetValue(prefs::kSafeBrowsingEnabled, &value)); + EXPECT_EQ(GetExpectedSBEnabledValueForProtectionLevelValue(level), + value->GetBool()); + + ASSERT_TRUE(store_->GetValue(prefs::kSafeBrowsingEnhanced, &value)); + EXPECT_EQ(GetExpectedSBEnhancedValueForProtectionLevelValue(level), + value->GetBool()); + } +} + +TEST_F(SafeBrowsingPolicyHandlerTest, OnlyLegacyPolicySet) { + EXPECT_FALSE(store_->GetValue(prefs::kSafeBrowsingEnabled, nullptr)); + EXPECT_FALSE(store_->GetValue(prefs::kSafeBrowsingEnhanced, nullptr)); + + for (auto enabled : kValidSBEnabledValues) { + policy::PolicyMap policy; + policy.Set(policy::key::kSafeBrowsingEnabled, + policy::POLICY_LEVEL_MANDATORY, policy::POLICY_SCOPE_USER, + policy::POLICY_SOURCE_CLOUD, + std::make_unique<base::Value>(enabled), nullptr); + UpdateProviderPolicy(policy); + + const base::Value* value = nullptr; + ASSERT_TRUE(store_->GetValue(prefs::kSafeBrowsingEnabled, &value)); + EXPECT_EQ(enabled, value->GetBool()); + + ASSERT_TRUE(store_->GetValue(prefs::kSafeBrowsingEnhanced, &value)); + EXPECT_FALSE(value->GetBool()); + } +} + +TEST_F(SafeBrowsingPolicyHandlerTest, NewPolicyOverridesLegacyPolicy) { + EXPECT_FALSE(store_->GetValue(prefs::kSafeBrowsingEnabled, nullptr)); + EXPECT_FALSE(store_->GetValue(prefs::kSafeBrowsingEnhanced, nullptr)); + + for (auto level : kValidSBProtectionLevelValues) { + for (auto enabled : kValidSBEnabledValues) { + policy::PolicyMap policy; + policy.Set(policy::key::kSafeBrowsingProtectionLevel, + policy::POLICY_LEVEL_MANDATORY, policy::POLICY_SCOPE_USER, + policy::POLICY_SOURCE_CLOUD, + std::make_unique<base::Value>(level), nullptr); + policy.Set(policy::key::kSafeBrowsingEnabled, + policy::POLICY_LEVEL_MANDATORY, policy::POLICY_SCOPE_USER, + policy::POLICY_SOURCE_CLOUD, + std::make_unique<base::Value>(enabled), nullptr); + UpdateProviderPolicy(policy); + + const base::Value* value = nullptr; + ASSERT_TRUE(store_->GetValue(prefs::kSafeBrowsingEnabled, &value)); + EXPECT_EQ(GetExpectedSBEnabledValueForProtectionLevelValue(level), + value->GetBool()); + + ASSERT_TRUE(store_->GetValue(prefs::kSafeBrowsingEnhanced, &value)); + EXPECT_EQ(GetExpectedSBEnhancedValueForProtectionLevelValue(level), + value->GetBool()); + } + } +} + +TEST_F(SafeBrowsingPolicyHandlerTest, LegacyPolicyAppliesIfNewPolicyInvalid) { + EXPECT_FALSE(store_->GetValue(prefs::kSafeBrowsingEnabled, nullptr)); + EXPECT_FALSE(store_->GetValue(prefs::kSafeBrowsingEnhanced, nullptr)); + + for (auto enabled : kValidSBEnabledValues) { + policy::PolicyMap policy; + policy.Set(policy::key::kSafeBrowsingProtectionLevel, + policy::POLICY_LEVEL_MANDATORY, policy::POLICY_SCOPE_USER, + policy::POLICY_SOURCE_CLOUD, + std::make_unique<base::Value>(5 /* out of range */), nullptr); + policy.Set(policy::key::kSafeBrowsingEnabled, + policy::POLICY_LEVEL_MANDATORY, policy::POLICY_SCOPE_USER, + policy::POLICY_SOURCE_CLOUD, + std::make_unique<base::Value>(enabled), nullptr); + UpdateProviderPolicy(policy); + + const base::Value* value = nullptr; + ASSERT_TRUE(store_->GetValue(prefs::kSafeBrowsingEnabled, &value)); + EXPECT_EQ(enabled, value->GetBool()); + + ASSERT_TRUE(store_->GetValue(prefs::kSafeBrowsingEnhanced, &value)); + EXPECT_FALSE(value->GetBool()); + } +} + +TEST_F(SafeBrowsingPolicyHandlerTest, NewPolicyAppliesIfLegacyPolicyInvalid) { + EXPECT_FALSE(store_->GetValue(prefs::kSafeBrowsingEnabled, nullptr)); + EXPECT_FALSE(store_->GetValue(prefs::kSafeBrowsingEnhanced, nullptr)); + + for (auto level : kValidSBProtectionLevelValues) { + policy::PolicyMap policy; + policy.Set(policy::key::kSafeBrowsingProtectionLevel, + policy::POLICY_LEVEL_MANDATORY, policy::POLICY_SCOPE_USER, + policy::POLICY_SOURCE_CLOUD, + std::make_unique<base::Value>(level), nullptr); + policy.Set(policy::key::kSafeBrowsingEnabled, + policy::POLICY_LEVEL_MANDATORY, policy::POLICY_SCOPE_USER, + policy::POLICY_SOURCE_CLOUD, + std::make_unique<base::Value>(4 /* wrong type */), nullptr); + UpdateProviderPolicy(policy); + + const base::Value* value = nullptr; + ASSERT_TRUE(store_->GetValue(prefs::kSafeBrowsingEnabled, &value)); + EXPECT_EQ(GetExpectedSBEnabledValueForProtectionLevelValue(level), + value->GetBool()); + + ASSERT_TRUE(store_->GetValue(prefs::kSafeBrowsingEnhanced, &value)); + EXPECT_EQ(GetExpectedSBEnhancedValueForProtectionLevelValue(level), + value->GetBool()); + } +} + +} // namespace safe_browsing
diff --git a/components/safe_browsing/core/features.cc b/components/safe_browsing/core/features.cc index 3c3b57c8..bfb9388 100644 --- a/components/safe_browsing/core/features.cc +++ b/components/safe_browsing/core/features.cc
@@ -103,6 +103,10 @@ "SafeBrowsingRealTimeUrlLookupEnabledWithToken", base::FEATURE_DISABLED_BY_DEFAULT}; +const base::Feature kRealTimeUrlLookupNonMainframeEnabledForEP{ + "SafeBrowsingRealTimeUrlLookupNonMainframeEnabledForEP", + base::FEATURE_ENABLED_BY_DEFAULT}; + const base::Feature kSafeBrowsingAvailableOnIOS{ "SafeBrowsingAvailableOnIOS", base::FEATURE_DISABLED_BY_DEFAULT}; @@ -151,6 +155,7 @@ {&kRealTimeUrlLookupEnabledForAllAndroidDevices, true}, {&kRealTimeUrlLookupEnabledForEP, true}, {&kRealTimeUrlLookupEnabledWithToken, true}, + {&kRealTimeUrlLookupNonMainframeEnabledForEP, true}, {&kSafeBrowsingAvailableOnIOS, true}, {&kSafeBrowsingSeparateNetworkContexts, true}, {&kSuspiciousSiteTriggerQuotaFeature, true},
diff --git a/components/safe_browsing/core/features.h b/components/safe_browsing/core/features.h index 89a4ad1..edfde97 100644 --- a/components/safe_browsing/core/features.h +++ b/components/safe_browsing/core/features.h
@@ -99,6 +99,10 @@ // Controls whether the GAIA-keyed real time URL lookup is enabled. extern const base::Feature kRealTimeUrlLookupEnabledWithToken; +// Controls whether the real time URL lookup is enabled for non mainframe URLs +// for Enhanced Protection users. +extern const base::Feature kRealTimeUrlLookupNonMainframeEnabledForEP; + // Specifies which non-resource HTML Elements to collect based on their tag and // attributes. It's a single param containing a comma-separated list of pairs. // For example: "tag1,id,tag1,height,tag2,foo" - this will collect elements with
diff --git a/components/safe_browsing/core/realtime/policy_engine.cc b/components/safe_browsing/core/realtime/policy_engine.cc index 092389a..a9c1914 100644 --- a/components/safe_browsing/core/realtime/policy_engine.cc +++ b/components/safe_browsing/core/realtime/policy_engine.cc
@@ -111,10 +111,19 @@ // static bool RealTimePolicyEngine::CanPerformFullURLLookupForResourceType( - ResourceType resource_type) { + ResourceType resource_type, + bool enhanced_protection_enabled) { UMA_HISTOGRAM_ENUMERATION("SafeBrowsing.RT.ResourceTypes.Requested", resource_type); - return resource_type == ResourceType::kMainFrame; + if (resource_type == ResourceType::kMainFrame) { + return true; + } + if (resource_type == ResourceType::kSubFrame && enhanced_protection_enabled && + base::FeatureList::IsEnabled( + kRealTimeUrlLookupNonMainframeEnabledForEP)) { + return true; + } + return false; } } // namespace safe_browsing
diff --git a/components/safe_browsing/core/realtime/policy_engine.h b/components/safe_browsing/core/realtime/policy_engine.h index 6a7bad8..e92d8be 100644 --- a/components/safe_browsing/core/realtime/policy_engine.h +++ b/components/safe_browsing/core/realtime/policy_engine.h
@@ -37,7 +37,8 @@ // Return true if full URL lookups are enabled for |resource_type|. static bool CanPerformFullURLLookupForResourceType( - ResourceType resource_type); + ResourceType resource_type, + bool enhanced_protection_enabled); // Return true if the feature to enable full URL lookups is enabled and the // allowlist fetch is enabled for the profile represented by
diff --git a/components/safe_browsing/core/realtime/policy_engine_unittest.cc b/components/safe_browsing/core/realtime/policy_engine_unittest.cc index 375a0f3..ab89e37 100644 --- a/components/safe_browsing/core/realtime/policy_engine_unittest.cc +++ b/components/safe_browsing/core/realtime/policy_engine_unittest.cc
@@ -268,11 +268,11 @@ } TEST_F(RealTimePolicyEngineTest, - TestCanPerformFullURLLookup_EnabledMainFrameOnly) { + TestCanPerformFullURLLookup_EnabledMainFrameOnlyForNonEpUser) { for (int i = 0; i <= static_cast<int>(ResourceType::kMaxValue); i++) { ResourceType resource_type = static_cast<ResourceType>(i); bool enabled = RealTimePolicyEngine::CanPerformFullURLLookupForResourceType( - resource_type); + resource_type, /*enhanced_protection_enabled=*/false); switch (resource_type) { case ResourceType::kMainFrame: EXPECT_TRUE(enabled); @@ -284,4 +284,22 @@ } } +TEST_F(RealTimePolicyEngineTest, + TestCanPerformFullURLLookup_EnabledNonMainFrameForEpUser) { + for (int i = 0; i <= static_cast<int>(ResourceType::kMaxValue); i++) { + ResourceType resource_type = static_cast<ResourceType>(i); + bool enabled = RealTimePolicyEngine::CanPerformFullURLLookupForResourceType( + resource_type, /*enhanced_protection_enabled=*/true); + switch (resource_type) { + case ResourceType::kMainFrame: + case ResourceType::kSubFrame: + EXPECT_TRUE(enabled); + break; + default: + EXPECT_FALSE(enabled); + break; + } + } +} + } // namespace safe_browsing
diff --git a/components/safe_browsing/core/realtime/url_lookup_service.cc b/components/safe_browsing/core/realtime/url_lookup_service.cc index 7a649a8..43e4520 100644 --- a/components/safe_browsing/core/realtime/url_lookup_service.cc +++ b/components/safe_browsing/core/realtime/url_lookup_service.cc
@@ -413,6 +413,10 @@ pref_service_, is_off_the_record_, sync_service_); } +bool RealTimeUrlLookupService::IsUserEpOptedIn() const { + return IsEnhancedProtectionEnabled(*pref_service_); +} + // static SBThreatType RealTimeUrlLookupService::GetSBThreatTypeForRTThreatType( RTLookupResponse::ThreatInfo::ThreatType rt_threat_type) {
diff --git a/components/safe_browsing/core/realtime/url_lookup_service.h b/components/safe_browsing/core/realtime/url_lookup_service.h index ae13b4f..4155168 100644 --- a/components/safe_browsing/core/realtime/url_lookup_service.h +++ b/components/safe_browsing/core/realtime/url_lookup_service.h
@@ -77,6 +77,9 @@ // local hash-based method. bool IsInBackoffMode() const; + // Returns true if this profile has opted-in to Enhanced Protection. + bool IsUserEpOptedIn() const; + // Start the full URL lookup for |url|, call |request_callback| on the same // thread when request is sent, call |response_callback| on the same thread // when response is received.
diff --git a/components/schema_org/BUILD.gn b/components/schema_org/BUILD.gn index b6676efb..0425765 100644 --- a/components/schema_org/BUILD.gn +++ b/components/schema_org/BUILD.gn
@@ -38,6 +38,9 @@ [ "--schema-file", rebase_path("//third_party/schema_org/schema.jsonld", root_build_dir), + "--overrides-file", + rebase_path("//third_party/schema_org/overrides.jsonld", + root_build_dir), "--output-dir", rebase_path("$target_gen_dir", root_build_dir), "--templates",
diff --git a/components/schema_org/extractor.cc b/components/schema_org/extractor.cc index aeca043..6925e45 100644 --- a/components/schema_org/extractor.cc +++ b/components/schema_org/extractor.cc
@@ -10,11 +10,9 @@ #include <utility> #include <vector> -#include "base/containers/flat_set.h" #include "base/json/json_parser.h" #include "base/no_destructor.h" #include "base/strings/string_number_conversions.h" -#include "base/values.h" #include "components/schema_org/common/improved_metadata.mojom.h" #include "components/schema_org/schema_org_entity_names.h" #include "components/schema_org/schema_org_property_configurations.h" @@ -52,14 +50,6 @@ using improved::mojom::Values; using improved::mojom::ValuesPtr; -bool IsSupportedType(const std::string& type) { - static const base::NoDestructor<base::flat_set<base::StringPiece>> - kSupportedTypes(base::flat_set<base::StringPiece>( - {entity::kVideoObject, entity::kMovie, entity::kTVEpisode, - entity::kTVSeason, entity::kTVSeries, entity::kDataFeed})); - return kSupportedTypes->find(type) != kSupportedTypes->end(); -} - void ExtractEntity(const base::DictionaryValue&, Entity*, int recursion_level); // Parses a string into a property value. The string may be parsed as a @@ -112,11 +102,13 @@ } } if (prop_config.boolean) { - if (value == "https://schema.org/True" || value == "true") { + if (value == "https://schema.org/True" || + value == "http://schema.org/True" || value == "true") { values->bool_values.push_back(true); return true; } - if (value == "https://schema.org/False" || value == "false") { + if (value == "https://schema.org/False" || + value == "http://schema.org/False" || value == "false") { values->bool_values.push_back(false); return true; } @@ -265,9 +257,20 @@ } } +} // namespace + +Extractor::Extractor(base::flat_set<base::StringPiece> supported_entity_types) + : supported_types_(supported_entity_types) {} + +Extractor::~Extractor() = default; + +bool Extractor::IsSupportedType(const std::string& type) { + return supported_types_.find(type) != supported_types_.end(); +} + // Extract a JSONObject which corresponds to a single (possibly nested) // entity. -EntityPtr ExtractTopLevelEntity(const base::DictionaryValue& val) { +EntityPtr Extractor::ExtractTopLevelEntity(const base::DictionaryValue& val) { EntityPtr entity = Entity::New(); std::string type; val.GetString(kJSONLDKeyType, &type); @@ -278,8 +281,6 @@ return entity; } -} // namespace - EntityPtr Extractor::Extract(const std::string& content) { base::Optional<base::Value> value(base::JSONReader::Read(content)); const base::DictionaryValue* dict_value = nullptr;
diff --git a/components/schema_org/extractor.h b/components/schema_org/extractor.h index 0a301f6..9695a7215 100644 --- a/components/schema_org/extractor.h +++ b/components/schema_org/extractor.h
@@ -7,6 +7,8 @@ #include <string> +#include "base/containers/flat_set.h" +#include "base/values.h" #include "components/schema_org/common/improved_metadata.mojom-forward.h" namespace schema_org { @@ -14,7 +16,19 @@ // Extract structured metadata (schema.org in JSON-LD) from text content. class Extractor { public: - static improved::mojom::EntityPtr Extract(const std::string& content); + explicit Extractor(base::flat_set<base::StringPiece> supported_entity_types); + Extractor(const Extractor&) = delete; + Extractor& operator=(const Extractor&) = delete; + ~Extractor(); + + improved::mojom::EntityPtr Extract(const std::string& content); + + private: + bool IsSupportedType(const std::string& type); + improved::mojom::EntityPtr ExtractTopLevelEntity( + const base::DictionaryValue& val); + + const base::flat_set<base::StringPiece> supported_types_; }; } // namespace schema_org
diff --git a/components/schema_org/extractor_unittest.cc b/components/schema_org/extractor_unittest.cc index 75bbaac..f76085f 100644 --- a/components/schema_org/extractor_unittest.cc +++ b/components/schema_org/extractor_unittest.cc
@@ -10,6 +10,7 @@ #include "base/strings/string_number_conversions.h" #include "components/schema_org/common/improved_metadata.mojom.h" +#include "components/schema_org/schema_org_entity_names.h" #include "testing/gtest/include/gtest/gtest.h" namespace schema_org { @@ -23,11 +24,11 @@ class SchemaOrgExtractorTest : public testing::Test { public: - SchemaOrgExtractorTest() = default; + SchemaOrgExtractorTest() : extractor_({entity::kVideoObject}) {} protected: EntityPtr Extract(const std::string& text) { - return Extractor::Extract(text); + return extractor_.Extract(text); } PropertyPtr CreateStringProperty(const std::string& name, @@ -48,6 +49,9 @@ PropertyPtr CreateUrlProperty(const std::string& name, const GURL& url); PropertyPtr CreateEntityProperty(const std::string& name, EntityPtr value); + + private: + Extractor extractor_; }; PropertyPtr SchemaOrgExtractorTest::CreateStringProperty(
diff --git a/components/schema_org/generate_schema_org_code.py b/components/schema_org/generate_schema_org_code.py index d6df8e9..28ba1a66 100644 --- a/components/schema_org/generate_schema_org_code.py +++ b/components/schema_org/generate_schema_org_code.py
@@ -123,13 +123,29 @@ return parsed_prop -def get_template_vars(schema_file_path): +def merge_with_schema(schema, overrides, thing): + indices = [ + i for i, x in enumerate(schema['@graph']) if x['@id'] == thing['@id'] + ] + for index in indices: + schema['@graph'][index] = thing + if not indices: + schema['@graph'].append(thing) + + +def get_template_vars(schema_file_path, overrides_file_path): """Read the needed template variables from the schema file.""" template_vars = {'entities': [], 'properties': [], 'enums': []} with open(schema_file_path) as schema_file: schema = json.loads(schema_file.read()) + if overrides_file_path: + with open(overrides_file_path) as overrides_file: + overrides = json.loads(overrides_file.read()) + for thing in overrides['@graph']: + merge_with_schema(schema, overrides, thing) + for thing in schema['@graph']: if thing['@type'] == 'rdfs:Class': template_vars['entities'].append(object_name_from_id(thing['@id'])) @@ -164,14 +180,18 @@ parser = argparse.ArgumentParser() parser.add_argument( '--schema-file', - help='Schema.org schema file to use for code generation.') + help='Schema.org JSON-LD schema file to use for code generation.') + parser.add_argument( + '--overrides-file', + help='JSON-LD schema file with overrides to support changes not in the ' + 'latest schema.org version. Optional.') parser.add_argument( '--output-dir', help='Output directory in which to place generated code files.') parser.add_argument('--templates', nargs='+') args = parser.parse_args() - template_vars = get_template_vars(args.schema_file) + template_vars = get_template_vars(args.schema_file, args.overrides_file) for template_file in args.templates: generate_file( os.path.join(args.output_dir,
diff --git a/components/schema_org/generate_schema_org_code_unittest.cc b/components/schema_org/generate_schema_org_code_unittest.cc index dfb1f33..3de5e7a9 100644 --- a/components/schema_org/generate_schema_org_code_unittest.cc +++ b/components/schema_org/generate_schema_org_code_unittest.cc
@@ -85,4 +85,11 @@ .has_value()); } +TEST(GenerateSchemaOrgCodeTest, GetPropertyConfigurationUsesOverridesFile) { + EXPECT_TRUE(property::GetPropertyConfiguration(property::kTarget).url); + EXPECT_THAT( + property::GetPropertyConfiguration(property::kIdentifier).thing_types, + testing::UnorderedElementsAre("http://schema.org/PropertyValue")); +} + } // namespace schema_org
diff --git a/components/schema_org/generate_schema_org_code_unittest.py b/components/schema_org/generate_schema_org_code_unittest.py index 7ee91b9..fb2f6d23 100644 --- a/components/schema_org/generate_schema_org_code_unittest.py +++ b/components/schema_org/generate_schema_org_code_unittest.py
@@ -40,7 +40,7 @@ with mock.patch('__builtin__.open', mock.mock_open(read_data=file_content)) as m_open: self.assertEqual( - generate_schema_org_code.get_template_vars(m_open), { + generate_schema_org_code.get_template_vars(m_open, m_open), { 'entities': ['MediaObject'], 'properties': [{ 'name': 'propertyName',
diff --git a/components/services/storage/dom_storage/OWNERS b/components/services/storage/dom_storage/OWNERS new file mode 100644 index 0000000..aeb1ffd --- /dev/null +++ b/components/services/storage/dom_storage/OWNERS
@@ -0,0 +1,4 @@ +file://content/browser/dom_storage/OWNERS + +# TEAM: storage-dev@chromium.org +# COMPONENT: Blink>Storage>DOMStorage
diff --git a/components/services/storage/indexed_db/OWNERS b/components/services/storage/indexed_db/OWNERS new file mode 100644 index 0000000..a740487 --- /dev/null +++ b/components/services/storage/indexed_db/OWNERS
@@ -0,0 +1,4 @@ +file://content/browser/indexed_db/OWNERS + +# TEAM: storage-dev@chromium.org +# COMPONENT: Blink>Storage>IndexedDB
diff --git a/components/viz/service/display/display.cc b/components/viz/service/display/display.cc index 684d848..065855c 100644 --- a/components/viz/service/display/display.cc +++ b/components/viz/service/display/display.cc
@@ -1076,10 +1076,9 @@ if (occlusion_in_quad_content_space.Contains(quad->visible_rect)) { // Case 1: for simple transforms (scale or translation), define the - // occlusion region in the quad content space. If the |quad| is not - // shown on the screen, then remove |quad| from the compositor frame. - quad = pass->quad_list.EraseAndInvalidateAllPointers(quad); - + // occlusion region in the quad content space. If |quad| is not + // shown on the screen, then set its rect and visible_rect to be empty. + quad->visible_rect.set_size(gfx::Size()); } else if (occlusion_in_quad_content_space.Intersects(quad->visible_rect)) { // Case 2: for simple transforms, if the quad is partially shown on // screen and the region formed by (occlusion region - visible_rect) is @@ -1107,20 +1106,18 @@ ++new_quad; } quad = new_quad; - } else { - ++quad; + continue; } } else if (occlusion_in_quad_content_space.IsEmpty() && occlusion_in_target_space.Contains( cc::MathUtil::MapEnclosingClippedRect(transform, quad->visible_rect))) { // Case 3: for non simple transforms, define the occlusion region in - // target space. If the |quad| is not shown on the screen, then remove - // |quad| from the compositor frame. - quad = pass->quad_list.EraseAndInvalidateAllPointers(quad); - } else { - ++quad; + // target space. If |quad| is not shown on the screen, then set its + // rect and visible_rect to be empty. + quad->visible_rect.set_size(gfx::Size()); } + ++quad; } }
diff --git a/components/viz/service/display/display_resource_provider.cc b/components/viz/service/display/display_resource_provider.cc index 2c73d436..9958510 100644 --- a/components/viz/service/display/display_resource_provider.cc +++ b/components/viz/service/display/display_resource_provider.cc
@@ -961,8 +961,7 @@ ExternalUseClient::ImageContext* DisplayResourceProvider::LockSetForExternalUse::LockResource( ResourceId id, - bool is_video_plane, - float sdr_scale_factor) { + bool is_video_plane) { auto it = resource_provider_->resources_.find(id); DCHECK(it != resource_provider_->resources_.end()); @@ -973,43 +972,17 @@ DCHECK(!base::Contains(resources_, std::make_pair(id, &resource))); resources_.emplace_back(id, &resource); - // Ignore sdr_scale_factor for video planes, if the src color space - // is invalid, or if it's already HDR. - const gfx::ColorSpace& original_src = resource.transferable.color_space; - if (is_video_plane || !original_src.IsValid() || original_src.IsHDR()) { - sdr_scale_factor = 1.0f; - } - - if (resource.image_context && - resource.image_context->sdr_scale_factor() != sdr_scale_factor) { - // Must rebuild the image context with a new color space, which requires - // releasing the old image context on the GPU main thread. - std::vector<std::unique_ptr<ExternalUseClient::ImageContext>> to_release; - to_release.push_back(std::move(resource.image_context)); - resource_provider_->external_use_client_->ReleaseImageContexts( - std::move(to_release)); - } - if (!resource.image_context) { - sk_sp<SkColorSpace> src_color_space; - if (!is_video_plane) { - if (sdr_scale_factor != 1.0f) { - src_color_space = original_src.GetScaledColorSpace(sdr_scale_factor) - .ToSkColorSpace(); - } else { - src_color_space = original_src.ToSkColorSpace(); - } - } - // Else the resource |color_space| is handled externally in SkiaRenderer - // using a special color filter. - + sk_sp<SkColorSpace> image_color_space; + // Video color conversion is handled externally in SkiaRenderer using a + // special color filter. + if (!is_video_plane) + image_color_space = resource.transferable.color_space.ToSkColorSpace(); resource.image_context = resource_provider_->external_use_client_->CreateImageContext( resource.transferable.mailbox_holder, resource.transferable.size, resource.transferable.format, resource.transferable.ycbcr_info, - std::move(src_color_space)); - // Save the SDR scale, in order to cache the scaled SkColorSpace - resource.image_context->set_sdr_scale_factor(sdr_scale_factor); + std::move(image_color_space)); } resource.locked_for_external_use = true;
diff --git a/components/viz/service/display/display_resource_provider.h b/components/viz/service/display/display_resource_provider.h index 5a64d63..358e41bb 100644 --- a/components/viz/service/display/display_resource_provider.h +++ b/components/viz/service/display/display_resource_provider.h
@@ -243,7 +243,7 @@ // There should be at most one instance of this class per // |resource_provider|. Both |resource_provider| and |client| outlive this // class. - LockSetForExternalUse(DisplayResourceProvider* resourcqe_provider, + LockSetForExternalUse(DisplayResourceProvider* resource_provider, ExternalUseClient* client); ~LockSetForExternalUse(); @@ -254,8 +254,7 @@ // Lock a resource for external use. The return value was created by // |client| at some point in the past. ExternalUseClient::ImageContext* LockResource(ResourceId resource_id, - bool is_video_plane = false, - float sdr_scale_factor = 1.f); + bool is_video_plane); // Unlock all locked resources with a |sync_token|. The |sync_token| should // be waited on before reusing the resource's backing to ensure that any
diff --git a/components/viz/service/display/display_resource_provider_unittest.cc b/components/viz/service/display/display_resource_provider_unittest.cc index e12f364..577d60f0 100644 --- a/components/viz/service/display/display_resource_provider_unittest.cc +++ b/components/viz/service/display/display_resource_provider_unittest.cc
@@ -289,7 +289,7 @@ Return(ByMove(std::move(owned_image_context))))); ExternalUseClient::ImageContext* locked_image_context = - lock_set.LockResource(parent_id); + lock_set.LockResource(parent_id, /*is_video_plane=*/false); EXPECT_EQ(image_context, locked_image_context); ASSERT_EQ(holder.mailbox, mailbox); ASSERT_TRUE(holder.sync_token.HasData());
diff --git a/components/viz/service/display/display_unittest.cc b/components/viz/service/display/display_unittest.cc index fb3e3bf4..ea49824 100644 --- a/components/viz/service/display/display_unittest.cc +++ b/components/viz/service/display/display_unittest.cc
@@ -111,6 +111,14 @@ return gfx::SwapTimings{now, now}; } +size_t NumVisibleRects(const QuadList& quads) { + size_t visible_rects = 0; + for (const auto* q : quads) { + if (!q->visible_rect.size().IsEmpty()) + visible_rects++; + } + return visible_rects; +} } // namespace class DisplayTest : public testing::Test { @@ -1010,12 +1018,12 @@ SkBlendMode::kSrcOver, 0); quad->SetNew(shared_quad_state, rect1, rect1, SK_ColorBLACK, false); - EXPECT_EQ(1u, frame.render_pass_list.front()->quad_list.size()); + EXPECT_EQ(1u, NumVisibleRects(frame.render_pass_list.front()->quad_list)); display_->RemoveOverdrawQuads(&frame); // This is a base case, the compositor frame contains only one // DrawQuad, so the size of quad_list remains unchanged after calling // RemoveOverdrawQuads. - EXPECT_EQ(1u, frame.render_pass_list.front()->quad_list.size()); + EXPECT_EQ(1u, NumVisibleRects(frame.render_pass_list.front()->quad_list)); EXPECT_EQ(rect1.ToString(), frame.render_pass_list.front() ->quad_list.ElementAt(0) ->visible_rect.ToString()); @@ -1041,7 +1049,7 @@ quad->SetNew(shared_quad_state, rect1, rect1, SK_ColorBLACK, false); quad2->SetNew(shared_quad_state2, rect2, rect2, SK_ColorBLACK, false); - EXPECT_EQ(2u, frame.render_pass_list.front()->quad_list.size()); + EXPECT_EQ(2u, NumVisibleRects(frame.render_pass_list.front()->quad_list)); display_->RemoveOverdrawQuads(&frame); // Since |quad| (defined by rect1 (0, 0, 100x100)) cannot cover |quad2| // (define by rect2 (50, 50, 100x100)), the |quad_list| size remains the @@ -1049,7 +1057,7 @@ // screen is rect2 - rect1 U rect2 = (100, 50, 50x50 U 50, 100, 100x50), // which cannot be represented by a smaller rect (its visible_rect stays // the same). - EXPECT_EQ(2u, frame.render_pass_list.front()->quad_list.size()); + EXPECT_EQ(2u, NumVisibleRects(frame.render_pass_list.front()->quad_list)); EXPECT_EQ(rect1.ToString(), frame.render_pass_list.front() ->quad_list.ElementAt(0) ->visible_rect.ToString()); @@ -1076,14 +1084,14 @@ quad->SetNew(shared_quad_state, rect1, rect1, SK_ColorBLACK, false); quad2->SetNew(shared_quad_state2, rect3, rect3, SK_ColorBLACK, false); - EXPECT_EQ(2u, frame.render_pass_list.front()->quad_list.size()); + EXPECT_EQ(2u, NumVisibleRects(frame.render_pass_list.front()->quad_list)); display_->RemoveOverdrawQuads(&frame); // Since |quad| (defined by rect1 (0, 0, 100x100)) cannot cover |quad2| // (define by rect3 (25, 25, 50x100)), the |quad_list| size remains the same // after calling RemoveOverdrawQuads. The visible region of |quad2| on // screen is rect3 - rect1 U rect3 = (25, 100, 50x25), which updates its // visible_rect accordingly. - EXPECT_EQ(2u, frame.render_pass_list.front()->quad_list.size()); + EXPECT_EQ(2u, NumVisibleRects(frame.render_pass_list.front()->quad_list)); EXPECT_EQ(rect1.ToString(), frame.render_pass_list.front() ->quad_list.ElementAt(0) ->visible_rect.ToString()); @@ -1110,7 +1118,7 @@ quad->SetNew(shared_quad_state, rect7, rect7, SK_ColorBLACK, false); quad2->SetNew(shared_quad_state2, rect6, rect6, SK_ColorBLACK, false); - EXPECT_EQ(2u, frame.render_pass_list.front()->quad_list.size()); + EXPECT_EQ(2u, NumVisibleRects(frame.render_pass_list.front()->quad_list)); display_->RemoveOverdrawQuads(&frame); // Since |quad| (defined by rect7 (0, 20, 100x100)) cannot cover |quad2| @@ -1119,7 +1127,7 @@ // screen is rect6 - rect7 = (25, 0, 50x20 U 25, 120, 50x40), which // cannot be represented by a smaller rect (its visible_rect stays the // same). - EXPECT_EQ(2u, frame.render_pass_list.front()->quad_list.size()); + EXPECT_EQ(2u, NumVisibleRects(frame.render_pass_list.front()->quad_list)); EXPECT_EQ(rect7.ToString(), frame.render_pass_list.front() ->quad_list.ElementAt(0) ->visible_rect.ToString()); @@ -1143,14 +1151,14 @@ quad->SetNew(shared_quad_state, rect1, rect1, SK_ColorBLACK, false); quad2->SetNew(shared_quad_state2, rect4, rect4, SK_ColorBLACK, false); - EXPECT_EQ(2u, frame.render_pass_list.front()->quad_list.size()); + EXPECT_EQ(2u, NumVisibleRects(frame.render_pass_list.front()->quad_list)); display_->RemoveOverdrawQuads(&frame); // Since |quad| (defined by rect1 (0, 0, 100x100)) cannot cover |quad2| // (define by rect4 (150, 0, 50x50)), the |quad_list| size remains the same // after calling RemoveOverdrawQuads. The visible region of |quad2| on // screen is rect4 (150, 0, 50x50), its visible_rect stays the same. - EXPECT_EQ(2u, frame.render_pass_list.front()->quad_list.size()); + EXPECT_EQ(2u, NumVisibleRects(frame.render_pass_list.front()->quad_list)); EXPECT_EQ(rect1.ToString(), frame.render_pass_list.front() ->quad_list.ElementAt(0) ->visible_rect.ToString()); @@ -1175,7 +1183,7 @@ quad->SetNew(shared_quad_state, rect1, rect1, SK_ColorBLACK, false); quad2->SetNew(shared_quad_state2, rect5, rect5, SK_ColorBLACK, false); - EXPECT_EQ(2u, frame.render_pass_list.front()->quad_list.size()); + EXPECT_EQ(2u, NumVisibleRects(frame.render_pass_list.front()->quad_list)); display_->RemoveOverdrawQuads(&frame); // Since |quad| (defined by rect1 (0, 0, 100x100)) cannot cover |quad2| @@ -1184,7 +1192,7 @@ // screen is rect5 - rect1 = (100, 0, 20x100 U 0, 100, 100x20), // which cannot be represented by a smaller rect (its visible_rect stays the // same). - EXPECT_EQ(2u, frame.render_pass_list.front()->quad_list.size()); + EXPECT_EQ(2u, NumVisibleRects(frame.render_pass_list.front()->quad_list)); EXPECT_EQ(rect1.ToString(), frame.render_pass_list.front() ->quad_list.ElementAt(0) ->visible_rect.ToString()); @@ -1233,13 +1241,13 @@ // | +-+ | | | // +-----+ +-------+ { - EXPECT_EQ(3u, frame.render_pass_list.front()->quad_list.size()); + EXPECT_EQ(3u, NumVisibleRects(frame.render_pass_list.front()->quad_list)); display_->RemoveOverdrawQuads(&frame); // The third quad (defined by rects[2](25, 25, 50x50)) is completely // occluded by the first quad (defined by rects[0](0, 0, 100x100)), so the // third quad is removed from the |quad_list|, leaving the first and second // (defined by rects[1](150, 0, 150x150); the largest) quads intact. - ASSERT_EQ(2u, frame.render_pass_list.front()->quad_list.size()); + ASSERT_EQ(2u, NumVisibleRects(frame.render_pass_list.front()->quad_list)); EXPECT_EQ(rects[0].ToString(), frame.render_pass_list.front() ->quad_list.ElementAt(0) ->visible_rect.ToString()); @@ -1289,14 +1297,14 @@ // | +-+ | | | | // +-----+ +-----+-+ { - EXPECT_EQ(4u, frame.render_pass_list.front()->quad_list.size()); + EXPECT_EQ(4u, NumVisibleRects(frame.render_pass_list.front()->quad_list)); display_->RemoveOverdrawQuads(&frame); // The third (defined by rects[2](25, 25, 50x50)) and fourth (defined by // rects[3](150, 0, 100x100)) quads are completely occluded by the first // (defined by rects[0](0, 0, 100x100)) and second (defined by rects[1](150, // 0, 150x150)) quads, respectively, so both are removed from the // |quad_list|, leaving the first and and second quads intact. - ASSERT_EQ(2u, frame.render_pass_list.front()->quad_list.size()); + ASSERT_EQ(2u, NumVisibleRects(frame.render_pass_list.front()->quad_list)); EXPECT_EQ(rects[0].ToString(), frame.render_pass_list.front() ->quad_list.ElementAt(0) ->visible_rect.ToString()); @@ -1345,10 +1353,10 @@ quad->SetNew(shared_quad_state, rect1, rect1, SK_ColorBLACK, false); quad2->SetNew(shared_quad_state2, rect1, rect1, SK_ColorBLACK, false); - EXPECT_EQ(2u, frame.render_pass_list.front()->quad_list.size()); + EXPECT_EQ(2u, NumVisibleRects(frame.render_pass_list.front()->quad_list)); display_->RemoveOverdrawQuads(&frame); // |quad2| overlaps |quad1|, so |quad2| is removed from the |quad_list|. - EXPECT_EQ(1u, frame.render_pass_list.front()->quad_list.size()); + EXPECT_EQ(1u, NumVisibleRects(frame.render_pass_list.front()->quad_list)); EXPECT_EQ(rect1.ToString(), frame.render_pass_list.front() ->quad_list.ElementAt(0) ->visible_rect.ToString()); @@ -1370,11 +1378,11 @@ quad->SetNew(shared_quad_state, rect1, rect1, SK_ColorBLACK, false); quad2->SetNew(shared_quad_state2, rect2, rect2, SK_ColorBLACK, false); - EXPECT_EQ(2u, frame.render_pass_list.front()->quad_list.size()); + EXPECT_EQ(2u, NumVisibleRects(frame.render_pass_list.front()->quad_list)); display_->RemoveOverdrawQuads(&frame); // |quad2| is hiding behind |quad1|, so |quad2| is removed from the // |quad_list|. - EXPECT_EQ(1u, frame.render_pass_list.front()->quad_list.size()); + EXPECT_EQ(1u, NumVisibleRects(frame.render_pass_list.front()->quad_list)); EXPECT_EQ(rect1.ToString(), frame.render_pass_list.front() ->quad_list.ElementAt(0) ->visible_rect.ToString()); @@ -1396,11 +1404,11 @@ quad->SetNew(shared_quad_state, rect1, rect1, SK_ColorBLACK, false); quad2->SetNew(shared_quad_state2, rect3, rect3, SK_ColorBLACK, false); - EXPECT_EQ(2u, frame.render_pass_list.front()->quad_list.size()); + EXPECT_EQ(2u, NumVisibleRects(frame.render_pass_list.front()->quad_list)); display_->RemoveOverdrawQuads(&frame); // |quad2| is behind |quad1| and aligns with the edge of |quad1|, so |quad2| // is removed from the |quad_list|. - EXPECT_EQ(1u, frame.render_pass_list.front()->quad_list.size()); + EXPECT_EQ(1u, NumVisibleRects(frame.render_pass_list.front()->quad_list)); EXPECT_EQ(rect1.ToString(), frame.render_pass_list.front() ->quad_list.ElementAt(0) ->visible_rect.ToString()); @@ -1424,11 +1432,11 @@ quad->SetNew(shared_quad_state, rect1, rect1, SK_ColorBLACK, false); quad2->SetNew(shared_quad_state2, rect4, rect4, SK_ColorBLACK, false); - EXPECT_EQ(2u, frame.render_pass_list.front()->quad_list.size()); + EXPECT_EQ(2u, NumVisibleRects(frame.render_pass_list.front()->quad_list)); display_->RemoveOverdrawQuads(&frame); // |quad2| is covered by |quad 1|, so |quad2| is removed from the // |quad_list|. - EXPECT_EQ(1u, frame.render_pass_list.front()->quad_list.size()); + EXPECT_EQ(1u, NumVisibleRects(frame.render_pass_list.front()->quad_list)); EXPECT_EQ(rect1.ToString(), frame.render_pass_list.front() ->quad_list.ElementAt(0) ->visible_rect.ToString()); @@ -1487,12 +1495,12 @@ quad->SetNew(shared_quad_state, rect1, rect1, SK_ColorBLACK, false); quad2->SetNew(shared_quad_state2, rect2, rect2, SK_ColorBLACK, false); - EXPECT_EQ(2u, frame.render_pass_list.front()->quad_list.size()); + EXPECT_EQ(2u, NumVisibleRects(frame.render_pass_list.front()->quad_list)); display_->RemoveOverdrawQuads(&frame); // |rect2| becomes (12, 12, 50x50) after applying half scale transform, // |quad2| is now covered by |quad|. So the size of |quad_list| is reduced // by 1. - EXPECT_EQ(1u, frame.render_pass_list.front()->quad_list.size()); + EXPECT_EQ(1u, NumVisibleRects(frame.render_pass_list.front()->quad_list)); EXPECT_EQ(rect1.ToString(), frame.render_pass_list.front() ->quad_list.ElementAt(0) ->visible_rect.ToString()); @@ -1510,12 +1518,12 @@ quad->SetNew(shared_quad_state, rect1, rect1, SK_ColorBLACK, false); quad2->SetNew(shared_quad_state2, rect3, rect3, SK_ColorBLACK, false); - EXPECT_EQ(2u, frame.render_pass_list.front()->quad_list.size()); + EXPECT_EQ(2u, NumVisibleRects(frame.render_pass_list.front()->quad_list)); display_->RemoveOverdrawQuads(&frame); // |rect3| becomes (25, 25, 50x25) after applying half scale transform, // |quad2| is now covered by |quad|. So the size of |quad_list| is reduced // by 1. - EXPECT_EQ(1u, frame.render_pass_list.front()->quad_list.size()); + EXPECT_EQ(1u, NumVisibleRects(frame.render_pass_list.front()->quad_list)); EXPECT_EQ(rect1.ToString(), frame.render_pass_list.front() ->quad_list.ElementAt(0) ->visible_rect.ToString()); @@ -1535,12 +1543,12 @@ quad->SetNew(shared_quad_state, rect1, rect1, SK_ColorBLACK, false); quad2->SetNew(shared_quad_state2, rect4, rect4, SK_ColorBLACK, false); - EXPECT_EQ(2u, frame.render_pass_list.front()->quad_list.size()); + EXPECT_EQ(2u, NumVisibleRects(frame.render_pass_list.front()->quad_list)); display_->RemoveOverdrawQuads(&frame); // |rect4| becomes (0, 0, 60x60) after applying half scale transform, // |quad2| is now covered by |quad1|. So the size of |quad_list| is reduced // by 1. - EXPECT_EQ(1u, frame.render_pass_list.front()->quad_list.size()); + EXPECT_EQ(1u, NumVisibleRects(frame.render_pass_list.front()->quad_list)); EXPECT_EQ(rect1.ToString(), frame.render_pass_list.front() ->quad_list.ElementAt(0) ->visible_rect.ToString()); @@ -1552,11 +1560,11 @@ SkBlendMode::kSrcOver, 0); quad->SetNew(shared_quad_state, rect1, rect1, SK_ColorBLACK, false); - EXPECT_EQ(1u, frame.render_pass_list.front()->quad_list.size()); + EXPECT_EQ(1u, NumVisibleRects(frame.render_pass_list.front()->quad_list)); display_->RemoveOverdrawQuads(&frame); // The compositor frame contains only one quad, so |quad_list| remains 1 // after calling RemoveOverdrawQuads. - EXPECT_EQ(1u, frame.render_pass_list.front()->quad_list.size()); + EXPECT_EQ(1u, NumVisibleRects(frame.render_pass_list.front()->quad_list)); EXPECT_EQ(rect1.ToString(), frame.render_pass_list.front() ->quad_list.ElementAt(0) ->visible_rect.ToString()); @@ -1576,19 +1584,19 @@ quad->SetNew(shared_quad_state, rect1, rect1, SK_ColorBLACK, false); quad2->SetNew(shared_quad_state2, rect5, rect5, SK_ColorBLACK, false); - EXPECT_EQ(2u, frame.render_pass_list.front()->quad_list.size()); + EXPECT_EQ(2u, NumVisibleRects(frame.render_pass_list.front()->quad_list)); display_->RemoveOverdrawQuads(&frame); // |quad2| (defined by |rect5|) becomes (50, 50, 120x120) after // applying double scale transform, it is not covered by |quad| (defined by // |rect1| (0, 0, 100x100)). So the size of |quad_list| is the same. // Since visible region of |rect5| is not a rect, quad2::visible_rect stays // the same. - EXPECT_EQ(2u, frame.render_pass_list.front()->quad_list.size()); + EXPECT_EQ(2u, NumVisibleRects(frame.render_pass_list.front()->quad_list)); EXPECT_EQ(rect1.ToString(), frame.render_pass_list.front() ->quad_list.ElementAt(0) ->visible_rect.ToString()); EXPECT_EQ(rect5.ToString(), frame.render_pass_list.front() - ->quad_list.ElementAt(1) + ->quad_list.ElementAt(4) ->visible_rect.ToString()); } @@ -1604,20 +1612,20 @@ quad->SetNew(shared_quad_state, rect1, rect1, SK_ColorBLACK, false); quad2->SetNew(shared_quad_state2, rect6, rect6, SK_ColorBLACK, false); - EXPECT_EQ(2u, frame.render_pass_list.front()->quad_list.size()); + EXPECT_EQ(2u, NumVisibleRects(frame.render_pass_list.front()->quad_list)); display_->RemoveOverdrawQuads(&frame); // |quad2| (defined by |rect6|) becomes (24, 24, 50x100) after // applying double scale transform, it is not covered by |quad| (defined by // |rect1| (0, 0, 100x100)). So the size of |quad_list| is the same. // Since visible region of |rect5| is (12, 50, 25x12), quad2::visible_rect // updates accordingly. - EXPECT_EQ(2u, frame.render_pass_list.front()->quad_list.size()); + EXPECT_EQ(2u, NumVisibleRects(frame.render_pass_list.front()->quad_list)); EXPECT_EQ(rect1.ToString(), frame.render_pass_list.front() ->quad_list.ElementAt(0) ->visible_rect.ToString()); EXPECT_EQ(gfx::Rect(12, 50, 25, 12).ToString(), frame.render_pass_list.front() - ->quad_list.ElementAt(1) + ->quad_list.ElementAt(4) ->visible_rect.ToString()); } @@ -1633,19 +1641,19 @@ quad->SetNew(shared_quad_state, rect1, rect1, SK_ColorBLACK, false); quad2->SetNew(shared_quad_state2, rect7, rect7, SK_ColorBLACK, false); - EXPECT_EQ(2u, frame.render_pass_list.front()->quad_list.size()); + EXPECT_EQ(2u, NumVisibleRects(frame.render_pass_list.front()->quad_list)); display_->RemoveOverdrawQuads(&frame); // |quad2| (defined by |rect7|) becomes (150, 0, 50x50) after // applying double scale transform, it is not covered by |quad| (defined by // |rect1| (0, 0, 100x100)). So the size of |quad_list| is the same. // Since visible region of |rect7| is not a rect, quad2::visible_rect stays // the same. - EXPECT_EQ(2u, frame.render_pass_list.front()->quad_list.size()); + EXPECT_EQ(2u, NumVisibleRects(frame.render_pass_list.front()->quad_list)); EXPECT_EQ(rect1.ToString(), frame.render_pass_list.front() ->quad_list.ElementAt(0) ->visible_rect.ToString()); EXPECT_EQ(rect7.ToString(), frame.render_pass_list.front() - ->quad_list.ElementAt(1) + ->quad_list.ElementAt(4) ->visible_rect.ToString()); } @@ -1661,19 +1669,19 @@ quad->SetNew(shared_quad_state, rect1, rect1, SK_ColorBLACK, false); quad2->SetNew(shared_quad_state2, rect8, rect8, SK_ColorBLACK, false); - EXPECT_EQ(2u, frame.render_pass_list.front()->quad_list.size()); + EXPECT_EQ(2u, NumVisibleRects(frame.render_pass_list.front()->quad_list)); display_->RemoveOverdrawQuads(&frame); // |quad2| (defined by |rect8|) becomes (0, 0, 120x120) after // applying double scale transform, it is not covered by |quad1| (defined by // |rect1| (0, 0, 100x100)). So the size of |quad_list| is the same. // Since visible region of |rect8| is not a rect, quad2::visible_rect stays // the same. - EXPECT_EQ(2u, frame.render_pass_list.front()->quad_list.size()); + EXPECT_EQ(2u, NumVisibleRects(frame.render_pass_list.front()->quad_list)); EXPECT_EQ(rect1.ToString(), frame.render_pass_list.front() ->quad_list.ElementAt(0) ->visible_rect.ToString()); EXPECT_EQ(rect8.ToString(), frame.render_pass_list.front() - ->quad_list.ElementAt(1) + ->quad_list.ElementAt(4) ->visible_rect.ToString()); } @@ -1689,19 +1697,19 @@ quad->SetNew(shared_quad_state, rect10, rect10, SK_ColorBLACK, false); quad2->SetNew(shared_quad_state2, rect9, rect9, SK_ColorBLACK, false); - EXPECT_EQ(2u, frame.render_pass_list.front()->quad_list.size()); + EXPECT_EQ(2u, NumVisibleRects(frame.render_pass_list.front()->quad_list)); display_->RemoveOverdrawQuads(&frame); // |quad2| (defined by |rect9|) becomes (24, 0, 50x160) after // applying double scale transform, it is not covered by |quad| (defined by // |rect10| (0, 20, 100x100)). So the size of |quad_list| is the same. // Since visible region of |rect9| is not a rect, quad2::visible_rect stays // the same - EXPECT_EQ(2u, frame.render_pass_list.front()->quad_list.size()); + EXPECT_EQ(2u, NumVisibleRects(frame.render_pass_list.front()->quad_list)); EXPECT_EQ(rect10.ToString(), frame.render_pass_list.front() ->quad_list.ElementAt(0) ->visible_rect.ToString()); EXPECT_EQ(rect9.ToString(), frame.render_pass_list.front() - ->quad_list.ElementAt(1) + ->quad_list.ElementAt(4) ->visible_rect.ToString()); } } @@ -1747,12 +1755,12 @@ quad->SetNew(shared_quad_state, rect, rect, SK_ColorBLACK, false); quad2->SetNew(shared_quad_state2, rect, rect, SK_ColorBLACK, false); - EXPECT_EQ(2u, frame.render_pass_list.front()->quad_list.size()); + EXPECT_EQ(2u, NumVisibleRects(frame.render_pass_list.front()->quad_list)); display_->RemoveOverdrawQuads(&frame); // zero matrix transform is non-invertible, so |quad2| is not removed from // draw occlusion algorithm. EXPECT_FALSE(zero_scale.GetInverse(&inverted)); - EXPECT_EQ(2u, frame.render_pass_list.front()->quad_list.size()); + EXPECT_EQ(2u, NumVisibleRects(frame.render_pass_list.front()->quad_list)); EXPECT_EQ(rect.ToString(), frame.render_pass_list.front() ->quad_list.ElementAt(0) ->visible_rect.ToString()); @@ -1771,7 +1779,7 @@ quad->SetNew(shared_quad_state, rect, rect, SK_ColorBLACK, false); quad2->SetNew(shared_quad_state2, rect, rect, SK_ColorBLACK, false); - EXPECT_EQ(2u, frame.render_pass_list.front()->quad_list.size()); + EXPECT_EQ(2u, NumVisibleRects(frame.render_pass_list.front()->quad_list)); display_->RemoveOverdrawQuads(&frame); // This test verifies that the draw occlusion algorithm does not break when // the scale of the transform is very close to zero. |epsilon_scale| @@ -1782,7 +1790,7 @@ EXPECT_TRUE(cc::MathUtil::MapEnclosedRectWith2dAxisAlignedTransform( epsilon_scale, rect) .IsEmpty()); - EXPECT_EQ(2u, frame.render_pass_list.front()->quad_list.size()); + EXPECT_EQ(2u, NumVisibleRects(frame.render_pass_list.front()->quad_list)); EXPECT_EQ(rect.ToString(), frame.render_pass_list.front() ->quad_list.ElementAt(0) ->visible_rect.ToString()); @@ -1801,7 +1809,7 @@ quad->SetNew(shared_quad_state, rect, rect, SK_ColorBLACK, false); quad2->SetNew(shared_quad_state2, rect, rect, SK_ColorBLACK, false); - EXPECT_EQ(2u, frame.render_pass_list.front()->quad_list.size()); + EXPECT_EQ(2u, NumVisibleRects(frame.render_pass_list.front()->quad_list)); display_->RemoveOverdrawQuads(&frame); // This test verifies that the draw occlusion algorithm works well with // small scales that is just larger than the epsilon scale in the previous @@ -1809,7 +1817,7 @@ // |quad2| will be transformed to a tiny rect that is covered by the // occlusion rect, so |quad2| is removed. EXPECT_TRUE(larger_epsilon_scale.GetInverse(&inverted)); - EXPECT_EQ(1u, frame.render_pass_list.front()->quad_list.size()); + EXPECT_EQ(1u, NumVisibleRects(frame.render_pass_list.front()->quad_list)); EXPECT_EQ(rect.ToString(), frame.render_pass_list.front() ->quad_list.ElementAt(0) ->visible_rect.ToString()); @@ -1850,7 +1858,7 @@ quad->SetNew(shared_quad_state, rect, rect, SK_ColorBLACK, false); quad2->SetNew(shared_quad_state2, rect, rect, SK_ColorBLACK, false); - EXPECT_EQ(2u, frame.render_pass_list.front()->quad_list.size()); + EXPECT_EQ(2u, NumVisibleRects(frame.render_pass_list.front()->quad_list)); display_->RemoveOverdrawQuads(&frame); // Since the x-axis is negated, |quad2| after applying transform does not // intersect with |quad| any more, so no quad is removed. @@ -1861,7 +1869,7 @@ // ---------+---------- // | // | - EXPECT_EQ(2u, frame.render_pass_list.front()->quad_list.size()); + EXPECT_EQ(2u, NumVisibleRects(frame.render_pass_list.front()->quad_list)); EXPECT_EQ(rect.ToString(), frame.render_pass_list.front() ->quad_list.ElementAt(0) ->visible_rect.ToString()); @@ -1882,7 +1890,7 @@ quad->SetNew(shared_quad_state, rect, rect, SK_ColorBLACK, false); quad2->SetNew(shared_quad_state2, rect, rect, SK_ColorBLACK, false); - EXPECT_EQ(2u, frame.render_pass_list.front()->quad_list.size()); + EXPECT_EQ(2u, NumVisibleRects(frame.render_pass_list.front()->quad_list)); display_->RemoveOverdrawQuads(&frame); // Since the y-axis is negated, |quad2| after applying transform does not // intersect with |quad| any more, so no quad is removed. @@ -1893,7 +1901,7 @@ // ---------+---------- // | | // |----+ - EXPECT_EQ(2u, frame.render_pass_list.front()->quad_list.size()); + EXPECT_EQ(2u, NumVisibleRects(frame.render_pass_list.front()->quad_list)); EXPECT_EQ(rect.ToString(), frame.render_pass_list.front() ->quad_list.ElementAt(0) ->visible_rect.ToString()); @@ -1914,7 +1922,7 @@ quad->SetNew(shared_quad_state, rect, rect, SK_ColorBLACK, false); quad2->SetNew(shared_quad_state2, rect, rect, SK_ColorBLACK, false); - EXPECT_EQ(2u, frame.render_pass_list.front()->quad_list.size()); + EXPECT_EQ(2u, NumVisibleRects(frame.render_pass_list.front()->quad_list)); display_->RemoveOverdrawQuads(&frame); // Since z-axis is missing in a 2d plane, negating the z-axis does not cause // |q2| to move at all. So |quad2| overlaps with |quad| in target space. @@ -1925,7 +1933,7 @@ // ---------+---------- // | // | - EXPECT_EQ(1u, frame.render_pass_list.front()->quad_list.size()); + EXPECT_EQ(1u, NumVisibleRects(frame.render_pass_list.front()->quad_list)); EXPECT_EQ(rect.ToString(), frame.render_pass_list.front() ->quad_list.ElementAt(0) ->visible_rect.ToString()); @@ -1975,12 +1983,12 @@ SkBlendMode::kSrcOver, 0); quad->SetNew(shared_quad_state, rect1, rect1, SK_ColorBLACK, false); quad2->SetNew(shared_quad_state2, rect2, rect2, SK_ColorBLACK, false); - EXPECT_EQ(2u, frame.render_pass_list.front()->quad_list.size()); + EXPECT_EQ(2u, NumVisibleRects(frame.render_pass_list.front()->quad_list)); display_->RemoveOverdrawQuads(&frame); // In target space, |quad| becomes (0, 0, 71x100) (after applying rotation // transform) and |quad2| becomes (75, 75 10x10). So |quad2| does not // intersect with |quad|. No changes in quads. - EXPECT_EQ(2u, frame.render_pass_list.front()->quad_list.size()); + EXPECT_EQ(2u, NumVisibleRects(frame.render_pass_list.front()->quad_list)); EXPECT_EQ(rect1.ToString(), frame.render_pass_list.front() ->quad_list.ElementAt(0) ->visible_rect.ToString()); @@ -1999,12 +2007,12 @@ SkBlendMode::kSrcOver, 0); quad->SetNew(shared_quad_state, rect1, rect1, SK_ColorBLACK, false); quad2->SetNew(shared_quad_state2, rect2, rect2, SK_ColorBLACK, false); - EXPECT_EQ(2u, frame.render_pass_list.front()->quad_list.size()); + EXPECT_EQ(2u, NumVisibleRects(frame.render_pass_list.front()->quad_list)); display_->RemoveOverdrawQuads(&frame); // In target space, |quad| becomes (0, 0, 70x100) and |quad2| becomes // (53, 75 8x10) (after applying rotation transform). So |quad2| is behind // |quad|. |quad2| is removed from |quad_list|. - EXPECT_EQ(1u, frame.render_pass_list.front()->quad_list.size()); + EXPECT_EQ(1u, NumVisibleRects(frame.render_pass_list.front()->quad_list)); EXPECT_EQ(rect1.ToString(), frame.render_pass_list.front() ->quad_list.ElementAt(0) ->visible_rect.ToString()); @@ -2021,17 +2029,17 @@ SkBlendMode::kSrcOver, 0); quad->SetNew(shared_quad_state, rect1, rect1, SK_ColorBLACK, false); quad2->SetNew(shared_quad_state2, rect3, rect3, SK_ColorBLACK, false); - EXPECT_EQ(2u, frame.render_pass_list.front()->quad_list.size()); + EXPECT_EQ(2u, NumVisibleRects(frame.render_pass_list.front()->quad_list)); display_->RemoveOverdrawQuads(&frame); // In target space, |quad| becomes (0, 0, 71x100) (after applying rotation // transform) and |quad2| becomes (50, 50, 25x100). So |quad2| does not // intersect with |quad|. No changes in quads. - EXPECT_EQ(2u, frame.render_pass_list.front()->quad_list.size()); + EXPECT_EQ(2u, NumVisibleRects(frame.render_pass_list.front()->quad_list)); EXPECT_EQ(rect1.ToString(), frame.render_pass_list.front() ->quad_list.ElementAt(0) ->visible_rect.ToString()); EXPECT_EQ(rect3.ToString(), frame.render_pass_list.front() - ->quad_list.ElementAt(1) + ->quad_list.ElementAt(2) ->visible_rect.ToString()); } @@ -2047,17 +2055,17 @@ SkBlendMode::kSrcOver, 0); quad->SetNew(shared_quad_state, rect1, rect1, SK_ColorBLACK, false); quad2->SetNew(shared_quad_state2, rect3, rect3, SK_ColorBLACK, false); - EXPECT_EQ(2u, frame.render_pass_list.front()->quad_list.size()); + EXPECT_EQ(2u, NumVisibleRects(frame.render_pass_list.front()->quad_list)); display_->RemoveOverdrawQuads(&frame); // Since both |quad| and |quad2| went through the same transform and |rect1| // does not cover |rect3| initially, |quad| does not cover |quad2| in target // space. - EXPECT_EQ(2u, frame.render_pass_list.front()->quad_list.size()); + EXPECT_EQ(2u, NumVisibleRects(frame.render_pass_list.front()->quad_list)); EXPECT_EQ(rect1.ToString(), frame.render_pass_list.front() ->quad_list.ElementAt(0) ->visible_rect.ToString()); EXPECT_EQ(rect3.ToString(), frame.render_pass_list.front() - ->quad_list.ElementAt(1) + ->quad_list.ElementAt(2) ->visible_rect.ToString()); } } @@ -2100,13 +2108,13 @@ SkBlendMode::kSrcOver, 0); quad->SetNew(shared_quad_state, rect1, rect1, SK_ColorBLACK, false); quad2->SetNew(shared_quad_state2, rect1, rect1, SK_ColorBLACK, false); - EXPECT_EQ(2u, frame.render_pass_list.front()->quad_list.size()); + EXPECT_EQ(2u, NumVisibleRects(frame.render_pass_list.front()->quad_list)); display_->RemoveOverdrawQuads(&frame); // The transform used on |quad| is a combination of rotation and // perspective matrix, so it does not preserve 2d axis. Since it takes too // long to define a enclosed rect to describe the occlusion region, // occlusion region is not defined and no changes in quads. - EXPECT_EQ(2u, frame.render_pass_list.front()->quad_list.size()); + EXPECT_EQ(2u, NumVisibleRects(frame.render_pass_list.front()->quad_list)); EXPECT_EQ(rect1.ToString(), frame.render_pass_list.front() ->quad_list.ElementAt(0) ->visible_rect.ToString()); @@ -2124,13 +2132,13 @@ SkBlendMode::kSrcOver, 0); quad->SetNew(shared_quad_state, rect1, rect1, SK_ColorBLACK, false); quad2->SetNew(shared_quad_state2, rect2, rect2, SK_ColorBLACK, false); - EXPECT_EQ(2u, frame.render_pass_list.front()->quad_list.size()); + EXPECT_EQ(2u, NumVisibleRects(frame.render_pass_list.front()->quad_list)); display_->RemoveOverdrawQuads(&frame); // The transform used on |quad2| is a combination of rotation and // perspective matrix, so it does not preserve 2d axis. it's easy to find // an enclosing rect to describe |quad2|. |quad2| is hiding behind |quad|, // so it's removed from |quad_list|. - EXPECT_EQ(1u, frame.render_pass_list.front()->quad_list.size()); + EXPECT_EQ(1u, NumVisibleRects(frame.render_pass_list.front()->quad_list)); EXPECT_EQ(rect1.ToString(), frame.render_pass_list.front() ->quad_list.ElementAt(0) ->visible_rect.ToString()); @@ -2170,11 +2178,11 @@ SkBlendMode::kSrcOver, 0); quad->SetNew(shared_quad_state, rect1, rect1, SK_ColorBLACK, false); quad2->SetNew(shared_quad_state2, rect2, rect2, SK_ColorBLACK, false); - EXPECT_EQ(2u, frame.render_pass_list.front()->quad_list.size()); + EXPECT_EQ(2u, NumVisibleRects(frame.render_pass_list.front()->quad_list)); display_->RemoveOverdrawQuads(&frame); // Since the opacity of |rect2| is less than 1, |rect1| cannot occlude // |rect2| even though |rect2| is inside |rect1|. - EXPECT_EQ(2u, frame.render_pass_list.front()->quad_list.size()); + EXPECT_EQ(2u, NumVisibleRects(frame.render_pass_list.front()->quad_list)); EXPECT_EQ(rect1.ToString(), frame.render_pass_list.front() ->quad_list.ElementAt(0) ->visible_rect.ToString()); @@ -2192,10 +2200,10 @@ SkBlendMode::kSrcOver, 0); quad->SetNew(shared_quad_state, rect1, rect1, SK_ColorBLACK, false); quad2->SetNew(shared_quad_state2, rect2, rect2, SK_ColorBLACK, false); - EXPECT_EQ(2u, frame.render_pass_list.front()->quad_list.size()); + EXPECT_EQ(2u, NumVisibleRects(frame.render_pass_list.front()->quad_list)); display_->RemoveOverdrawQuads(&frame); // Repeat the above test and set the opacity of |rect1| to 1. - EXPECT_EQ(1u, frame.render_pass_list.front()->quad_list.size()); + EXPECT_EQ(1u, NumVisibleRects(frame.render_pass_list.front()->quad_list)); EXPECT_EQ(rect1.ToString(), frame.render_pass_list.front() ->quad_list.ElementAt(0) ->visible_rect.ToString()); @@ -2234,11 +2242,11 @@ SkBlendMode::kSrcOver, 0); quad->SetNew(shared_quad_state, rect1, rect1, SK_ColorBLACK, false); quad2->SetNew(shared_quad_state2, rect2, rect2, SK_ColorBLACK, false); - EXPECT_EQ(2u, frame.render_pass_list.front()->quad_list.size()); + EXPECT_EQ(2u, NumVisibleRects(frame.render_pass_list.front()->quad_list)); display_->RemoveOverdrawQuads(&frame); // Since the opaqueness of |rect2| is false, |rect1| cannot occlude // |rect2| even though |rect2| is inside |rect1|. - EXPECT_EQ(2u, frame.render_pass_list.front()->quad_list.size()); + EXPECT_EQ(2u, NumVisibleRects(frame.render_pass_list.front()->quad_list)); EXPECT_EQ(rect1.ToString(), frame.render_pass_list.front() ->quad_list.ElementAt(0) ->visible_rect.ToString()); @@ -2256,10 +2264,10 @@ SkBlendMode::kSrcOver, 0); quad->SetNew(shared_quad_state, rect1, rect1, SK_ColorBLACK, false); quad2->SetNew(shared_quad_state2, rect2, rect2, SK_ColorBLACK, false); - EXPECT_EQ(2u, frame.render_pass_list.front()->quad_list.size()); + EXPECT_EQ(2u, NumVisibleRects(frame.render_pass_list.front()->quad_list)); display_->RemoveOverdrawQuads(&frame); // Repeat the above test and set the opaqueness of |rect2| to true. - EXPECT_EQ(1u, frame.render_pass_list.front()->quad_list.size()); + EXPECT_EQ(1u, NumVisibleRects(frame.render_pass_list.front()->quad_list)); EXPECT_EQ(rect1.ToString(), frame.render_pass_list.front() ->quad_list.ElementAt(0) ->visible_rect.ToString()); @@ -2306,11 +2314,11 @@ quad->SetNew(shared_quad_state, rect1, rect1, SK_ColorBLACK, false); quad2->SetNew(shared_quad_state2, rect2, rect1, SK_ColorBLACK, false); - EXPECT_EQ(2u, frame.render_pass_list.front()->quad_list.size()); + EXPECT_EQ(2u, NumVisibleRects(frame.render_pass_list.front()->quad_list)); display_->RemoveOverdrawQuads(&frame); // Since both |quad| and |quad2| are inside of a 3d object, DrawOcclusion // will not be applied to them. - EXPECT_EQ(2u, frame.render_pass_list.front()->quad_list.size()); + EXPECT_EQ(2u, NumVisibleRects(frame.render_pass_list.front()->quad_list)); EXPECT_EQ(rect1.ToString(), frame.render_pass_list.front() ->quad_list.ElementAt(0) ->rect.ToString()); @@ -2363,11 +2371,11 @@ SkBlendMode::kSrcOver, 0); quad->SetNew(shared_quad_state, rect1, rect1, SK_ColorBLACK, false); quad2->SetNew(shared_quad_state2, rect2, rect2, SK_ColorBLACK, false); - EXPECT_EQ(2u, frame.render_pass_list.front()->quad_list.size()); + EXPECT_EQ(2u, NumVisibleRects(frame.render_pass_list.front()->quad_list)); display_->RemoveOverdrawQuads(&frame); // |rect2| and |rect1| are disjoined as show in the first image. The size of // |quad_list| remains 2. - EXPECT_EQ(2u, frame.render_pass_list.front()->quad_list.size()); + EXPECT_EQ(2u, NumVisibleRects(frame.render_pass_list.front()->quad_list)); EXPECT_EQ(rect1.ToString(), frame.render_pass_list.front() ->quad_list.ElementAt(0) ->visible_rect.ToString()); @@ -2392,12 +2400,12 @@ SkBlendMode::kSrcOver, 0); quad->SetNew(shared_quad_state, rect1, rect1, SK_ColorBLACK, false); quad2->SetNew(shared_quad_state2, rect2, rect2, SK_ColorBLACK, false); - EXPECT_EQ(2u, frame.render_pass_list.front()->quad_list.size()); + EXPECT_EQ(2u, NumVisibleRects(frame.render_pass_list.front()->quad_list)); display_->RemoveOverdrawQuads(&frame); // Move |quad| defind by |rect1| over |quad2| defind by |rect2| by applying // translation transform. |quad2| will be covered by |quad|, so |quad_list| // size is reduced by 1. - EXPECT_EQ(1u, frame.render_pass_list.front()->quad_list.size()); + EXPECT_EQ(1u, NumVisibleRects(frame.render_pass_list.front()->quad_list)); EXPECT_EQ(rect1.ToString(), frame.render_pass_list.front() ->quad_list.ElementAt(0) ->visible_rect.ToString()); @@ -2422,19 +2430,19 @@ SkBlendMode::kSrcOver, 0); quad->SetNew(shared_quad_state, rect1, rect1, SK_ColorBLACK, false); quad2->SetNew(shared_quad_state2, rect3, rect3, SK_ColorBLACK, false); - EXPECT_EQ(2u, frame.render_pass_list.front()->quad_list.size()); + EXPECT_EQ(2u, NumVisibleRects(frame.render_pass_list.front()->quad_list)); display_->RemoveOverdrawQuads(&frame); // Move |quad| defind by |rect1| over |quad2| defind by |rect3| by applying // translation transform. In target space, |quad| is (50, 50, 100x100) and // |quad2| is (100, 100, 100x20). So the visible region of |quad2| is // (150, 100, 50x20). - EXPECT_EQ(2u, frame.render_pass_list.front()->quad_list.size()); + EXPECT_EQ(2u, NumVisibleRects(frame.render_pass_list.front()->quad_list)); EXPECT_EQ(rect1.ToString(), frame.render_pass_list.front() ->quad_list.ElementAt(0) ->visible_rect.ToString()); EXPECT_EQ(gfx::Rect(150, 100, 50, 20).ToString(), frame.render_pass_list.front() - ->quad_list.ElementAt(1) + ->quad_list.ElementAt(2) ->visible_rect.ToString()); } } @@ -2490,12 +2498,12 @@ quad->SetNew(shared_quad_state, rect1, rect1, SK_ColorBLACK, false); quad2->SetNew(shared_quad_state2, rect2, rect2, SK_ColorBLACK, false); quad3->SetNew(shared_quad_state3, rect3, rect3, SK_ColorBLACK, false); - EXPECT_EQ(3u, frame.render_pass_list.front()->quad_list.size()); + EXPECT_EQ(3u, NumVisibleRects(frame.render_pass_list.front()->quad_list)); display_->RemoveOverdrawQuads(&frame); // The occlusion rect is enlarged horizontally after visiting |rect1| and // |rect2|. |rect3| is covered by both |rect1| and |rect2|, so |rect3| is // removed from |quad_list|. - EXPECT_EQ(2u, frame.render_pass_list.front()->quad_list.size()); + EXPECT_EQ(2u, NumVisibleRects(frame.render_pass_list.front()->quad_list)); EXPECT_EQ(rect1.ToString(), frame.render_pass_list.front() ->quad_list.ElementAt(0) ->visible_rect.ToString()); @@ -2517,12 +2525,12 @@ rect4, is_clipped, opaque_content, opacity, SkBlendMode::kSrcOver, 0); quad3->SetNew(shared_quad_state3, rect4, rect4, SK_ColorBLACK, false); - EXPECT_EQ(3u, frame.render_pass_list.front()->quad_list.size()); + EXPECT_EQ(3u, NumVisibleRects(frame.render_pass_list.front()->quad_list)); display_->RemoveOverdrawQuads(&frame); // The occlusion rect, which is enlarged horizontally after visiting |rect1| // and |rect2|, is (0, 0, 160x60). Since visible region of rect 4 is // (160, 10, 30x30), |visible_rect| of |quad3| is updated. - EXPECT_EQ(3u, frame.render_pass_list.front()->quad_list.size()); + EXPECT_EQ(3u, NumVisibleRects(frame.render_pass_list.front()->quad_list)); EXPECT_EQ(rect1.ToString(), frame.render_pass_list.front() ->quad_list.ElementAt(0) ->visible_rect.ToString()); @@ -2531,7 +2539,7 @@ ->visible_rect.ToString()); EXPECT_EQ(gfx::Rect(160, 10, 30, 30).ToString(), frame.render_pass_list.front() - ->quad_list.ElementAt(2) + ->quad_list.ElementAt(3) ->visible_rect.ToString()); } @@ -2546,12 +2554,12 @@ rect5, is_clipped, opaque_content, opacity, SkBlendMode::kSrcOver, 0); quad3->SetNew(shared_quad_state3, rect5, rect5, SK_ColorBLACK, false); - EXPECT_EQ(3u, frame.render_pass_list.front()->quad_list.size()); + EXPECT_EQ(3u, NumVisibleRects(frame.render_pass_list.front()->quad_list)); display_->RemoveOverdrawQuads(&frame); // The occlusion rect, which is enlarged horizontally after visiting |rect1| // and |rect2|, is (0, 0, 160x60). Since visible region of rect 5 is // (10, 60, 120x50), |visible_rect| of |quad3| is updated. - EXPECT_EQ(3u, frame.render_pass_list.front()->quad_list.size()); + EXPECT_EQ(3u, NumVisibleRects(frame.render_pass_list.front()->quad_list)); EXPECT_EQ(rect1.ToString(), frame.render_pass_list.front() ->quad_list.ElementAt(0) ->visible_rect.ToString()); @@ -2560,7 +2568,7 @@ ->visible_rect.ToString()); EXPECT_EQ(gfx::Rect(10, 60, 120, 50).ToString(), frame.render_pass_list.front() - ->quad_list.ElementAt(2) + ->quad_list.ElementAt(3) ->visible_rect.ToString()); } } @@ -2620,13 +2628,13 @@ quad2->SetNew(shared_quad_state2, rect2, rect2, SK_ColorBLACK, false); quad3->SetNew(shared_quad_state3, rect3, rect3, SK_ColorBLACK, false); EXPECT_EQ(2u, frame.render_pass_list.at(1)->quad_list.size()); - EXPECT_EQ(1u, frame.render_pass_list.front()->quad_list.size()); + EXPECT_EQ(1u, NumVisibleRects(frame.render_pass_list.front()->quad_list)); display_->RemoveOverdrawQuads(&frame); // The occlusion rect is enlarged horizontally after visiting |rect1| and // |rect2|. |rect3| is covered by the unioned region of |rect1| and |rect2|. // But |rect3| so |rect3| is to be removed from |quad_list|. EXPECT_EQ(2u, frame.render_pass_list.at(1)->quad_list.size()); - EXPECT_EQ(1u, frame.render_pass_list.front()->quad_list.size()); + EXPECT_EQ(1u, NumVisibleRects(frame.render_pass_list.front()->quad_list)); EXPECT_EQ(rect1.ToString(), frame.render_pass_list.at(1) ->quad_list.ElementAt(0) ->visible_rect.ToString()); @@ -2689,13 +2697,13 @@ mask_resource_id, gfx::RectF(), gfx::Size(), gfx::Vector2dF(1, 1), gfx::PointF(), gfx::RectF(), false, 1.0f); - EXPECT_EQ(1u, frame.render_pass_list.front()->quad_list.size()); + EXPECT_EQ(1u, NumVisibleRects(frame.render_pass_list.front()->quad_list)); EXPECT_EQ(1u, frame.render_pass_list.at(1)->quad_list.size()); display_->RemoveOverdrawQuads(&frame); // |rect1| and |rect2| shares the same region where |rect1| is a draw // quad and |rect2| RenderPass. |rect2| will be not removed from the // |quad_list|. - EXPECT_EQ(1u, frame.render_pass_list.front()->quad_list.size()); + EXPECT_EQ(1u, NumVisibleRects(frame.render_pass_list.front()->quad_list)); EXPECT_EQ(1u, frame.render_pass_list.at(1)->quad_list.size()); EXPECT_EQ(rect1.ToString(), frame.render_pass_list.front() ->quad_list.ElementAt(0) @@ -2747,11 +2755,11 @@ SkBlendMode::kSrcOver, 0); quad->SetNew(shared_quad_state, rect1, rect1, SK_ColorBLACK, false); quad2->SetNew(shared_quad_state2, rect2, rect2, SK_ColorBLACK, false); - EXPECT_EQ(2u, frame.render_pass_list.front()->quad_list.size()); + EXPECT_EQ(2u, NumVisibleRects(frame.render_pass_list.front()->quad_list)); display_->RemoveOverdrawQuads(&frame); // |rect1| covers |rect2| as shown in the figure above, So the size of // |quad_list| is reduced by 1. - EXPECT_EQ(1u, frame.render_pass_list.front()->quad_list.size()); + EXPECT_EQ(1u, NumVisibleRects(frame.render_pass_list.front()->quad_list)); EXPECT_EQ(rect1.ToString(), frame.render_pass_list.front() ->quad_list.ElementAt(0) ->visible_rect.ToString()); @@ -2774,17 +2782,17 @@ SkBlendMode::kSrcOver, 0); quad->SetNew(shared_quad_state, rect1, rect1, SK_ColorBLACK, false); quad2->SetNew(shared_quad_state2, rect2, rect2, SK_ColorBLACK, false); - EXPECT_EQ(2u, frame.render_pass_list.front()->quad_list.size()); + EXPECT_EQ(2u, NumVisibleRects(frame.render_pass_list.front()->quad_list)); display_->RemoveOverdrawQuads(&frame); // In the target space, a clip is applied on |quad| (defined by |clip_rect|, // (0, 0, 60x60) |quad| and |quad2| (50, 50, 25x25) don't intersect in the // target space. So no change is applied to quads. - EXPECT_EQ(2u, frame.render_pass_list.front()->quad_list.size()); + EXPECT_EQ(2u, NumVisibleRects(frame.render_pass_list.front()->quad_list)); EXPECT_EQ(rect1.ToString(), frame.render_pass_list.front() ->quad_list.ElementAt(0) ->visible_rect.ToString()); EXPECT_EQ(rect2.ToString(), frame.render_pass_list.front() - ->quad_list.ElementAt(1) + ->quad_list.ElementAt(2) ->visible_rect.ToString()); } @@ -2803,19 +2811,19 @@ SkBlendMode::kSrcOver, 0); quad->SetNew(shared_quad_state, rect1, rect1, SK_ColorBLACK, false); quad2->SetNew(shared_quad_state2, rect3, rect3, SK_ColorBLACK, false); - EXPECT_EQ(2u, frame.render_pass_list.front()->quad_list.size()); + EXPECT_EQ(2u, NumVisibleRects(frame.render_pass_list.front()->quad_list)); display_->RemoveOverdrawQuads(&frame); // In the target space, a clip is applied on |quad| (defined by |rect3|, // (50, 50, 20x10)). |quad| intersects with |quad2| in the target space. The // visible region of |quad2| is (60, 50, 10x10). So |quad2| is updated // accordingly. - EXPECT_EQ(2u, frame.render_pass_list.front()->quad_list.size()); + EXPECT_EQ(2u, NumVisibleRects(frame.render_pass_list.front()->quad_list)); EXPECT_EQ(rect1.ToString(), frame.render_pass_list.front() ->quad_list.ElementAt(0) ->visible_rect.ToString()); EXPECT_EQ(gfx::Rect(60, 50, 10, 10).ToString(), frame.render_pass_list.front() - ->quad_list.ElementAt(1) + ->quad_list.ElementAt(2) ->visible_rect.ToString()); } } @@ -2854,13 +2862,13 @@ quad2->SetNew(shared_quad_state2, rect2, rect2, SK_ColorBLACK, false); frame.render_pass_list.front()->copy_requests.push_back( CopyOutputRequest::CreateStubForTesting()); - EXPECT_EQ(2u, frame.render_pass_list.front()->quad_list.size()); + EXPECT_EQ(2u, NumVisibleRects(frame.render_pass_list.front()->quad_list)); display_->RemoveOverdrawQuads(&frame); // root RenderPass contains |rect1|, |rect2| and copy_request (where // |rect2| is in |rect1|). Since our current implementation only supports // occlusion with copy_request on root RenderPass, |quad_list| reduces its // size by 1 after calling remove overdraw. - EXPECT_EQ(1u, frame.render_pass_list.front()->quad_list.size()); + EXPECT_EQ(1u, NumVisibleRects(frame.render_pass_list.front()->quad_list)); EXPECT_EQ(rect1.ToString(), frame.render_pass_list.front() ->quad_list.ElementAt(0) ->visible_rect.ToString()); @@ -2932,12 +2940,12 @@ gfx::Vector2dF(1, 1), gfx::PointF(), gfx::RectF(), false, 1.0f); D1->SetNew(shared_quad_state3, rect3, rect3, SK_ColorBLACK, false); D2->SetNew(shared_quad_state4, rect4, rect4, SK_ColorBLACK, false); - EXPECT_EQ(4u, frame.render_pass_list.front()->quad_list.size()); + EXPECT_EQ(4u, NumVisibleRects(frame.render_pass_list.front()->quad_list)); display_->RemoveOverdrawQuads(&frame); // As shown in the image above, the opaque region |d1| and |d2| does not // occlude each other. Since RenderPassDrawQuad |r1| and |r2| cannot be // removed to reduce overdraw, |quad_list| remains unchanged. - EXPECT_EQ(4u, frame.render_pass_list.front()->quad_list.size()); + EXPECT_EQ(4u, NumVisibleRects(frame.render_pass_list.front()->quad_list)); EXPECT_EQ(rect1.ToString(), frame.render_pass_list.front() ->quad_list.ElementAt(0) ->visible_rect.ToString()); @@ -2980,12 +2988,12 @@ gfx::Vector2dF(1, 1), gfx::PointF(), gfx::RectF(), false, 1.0f); D1->SetNew(shared_quad_state3, rect3, rect3, SK_ColorBLACK, false); D2->SetNew(shared_quad_state4, rect6, rect6, SK_ColorBLACK, false); - EXPECT_EQ(4u, frame.render_pass_list.front()->quad_list.size()); + EXPECT_EQ(4u, NumVisibleRects(frame.render_pass_list.front()->quad_list)); display_->RemoveOverdrawQuads(&frame); // As shown in the image above, the opaque region |d1| and |d2| does not // occlude each other. Since RenderPassDrawQuad |r1| and |r2| cannot be // removed to reduce overdraw, |quad_list| remains unchanged. - EXPECT_EQ(4u, frame.render_pass_list.front()->quad_list.size()); + EXPECT_EQ(4u, NumVisibleRects(frame.render_pass_list.front()->quad_list)); EXPECT_EQ(rect5.ToString(), frame.render_pass_list.front() ->quad_list.ElementAt(0) ->visible_rect.ToString()); @@ -3027,12 +3035,12 @@ gfx::Vector2dF(1, 1), gfx::PointF(), gfx::RectF(), false, 1.0f); D1->SetNew(shared_quad_state3, rect3, rect3, SK_ColorBLACK, false); D2->SetNew(shared_quad_state4, rect7, rect7, SK_ColorBLACK, false); - EXPECT_EQ(4u, frame.render_pass_list.front()->quad_list.size()); + EXPECT_EQ(4u, NumVisibleRects(frame.render_pass_list.front()->quad_list)); display_->RemoveOverdrawQuads(&frame); // As shown in the image above, the opaque region |d2| is contained in |d1| // Since RenderPassDrawQuad |r1| and |r2| cannot be removed to reduce // overdraw, |quad_list| is reduced by 1. - EXPECT_EQ(3u, frame.render_pass_list.front()->quad_list.size()); + EXPECT_EQ(3u, NumVisibleRects(frame.render_pass_list.front()->quad_list)); EXPECT_EQ(rect5.ToString(), frame.render_pass_list.front() ->quad_list.ElementAt(0) ->visible_rect.ToString()); @@ -3109,11 +3117,11 @@ quad4->SetNew(shared_quad_state, rect1_4, rect1_4, SK_ColorBLACK, false); quad5->SetNew(shared_quad_state2, rect_in_rect1, rect_in_rect1, SK_ColorBLACK, false); - EXPECT_EQ(5u, frame.render_pass_list.front()->quad_list.size()); + EXPECT_EQ(5u, NumVisibleRects(frame.render_pass_list.front()->quad_list)); display_->RemoveOverdrawQuads(&frame); // |visible_rect| of |shared_quad_state| is formed by 4 DrawQuads and it // covers the visible region of |shared_quad_state2|. - EXPECT_EQ(4u, frame.render_pass_list.front()->quad_list.size()); + EXPECT_EQ(4u, NumVisibleRects(frame.render_pass_list.front()->quad_list)); EXPECT_EQ(rect1_1.ToString(), frame.render_pass_list.front() ->quad_list.ElementAt(0) ->visible_rect.ToString()); @@ -3144,12 +3152,12 @@ opacity, SkBlendMode::kSrcOver, 0); quad5->SetNew(shared_quad_state2, rect_intersects_rect1, rect_intersects_rect1, SK_ColorBLACK, false); - EXPECT_EQ(5u, frame.render_pass_list.front()->quad_list.size()); + EXPECT_EQ(5u, NumVisibleRects(frame.render_pass_list.front()->quad_list)); display_->RemoveOverdrawQuads(&frame); // |visible_rect| of |shared_quad_state| is formed by 4 DrawQuads and it // partially covers the visible region of |shared_quad_state2|. The // |visible_rect| of |quad5| is updated. - EXPECT_EQ(5u, frame.render_pass_list.front()->quad_list.size()); + EXPECT_EQ(5u, NumVisibleRects(frame.render_pass_list.front()->quad_list)); EXPECT_EQ(rect1_1.ToString(), frame.render_pass_list.front() ->quad_list.ElementAt(0) ->visible_rect.ToString()); @@ -3164,7 +3172,7 @@ ->visible_rect.ToString()); EXPECT_EQ(gfx::Rect(100, 0, 30, 30).ToString(), frame.render_pass_list.front() - ->quad_list.ElementAt(4) + ->quad_list.ElementAt(5) ->visible_rect.ToString()); } @@ -3191,13 +3199,13 @@ quad4->SetNew(shared_quad_state, rect2_4, rect2_4, SK_ColorBLACK, false); quad5->SetNew(shared_quad_state2, rect3_1, rect3_1, SK_ColorBLACK, false); quad6->SetNew(shared_quad_state2, rect3_2, rect3_2, SK_ColorBLACK, false); - EXPECT_EQ(6u, frame.render_pass_list.front()->quad_list.size()); + EXPECT_EQ(6u, NumVisibleRects(frame.render_pass_list.front()->quad_list)); display_->RemoveOverdrawQuads(&frame); // |visible_rect| of |shared_quad_state| is formed by 4 DrawQuads and it // partially covers the visible region of |shared_quad_state2|. So the // |visible_rect| of DrawQuads in |share_quad_state2| are updated to the // region shown on screen. - EXPECT_EQ(6u, frame.render_pass_list.front()->quad_list.size()); + EXPECT_EQ(6u, NumVisibleRects(frame.render_pass_list.front()->quad_list)); EXPECT_EQ(rect2_1.ToString(), frame.render_pass_list.front() ->quad_list.ElementAt(0) ->visible_rect.ToString()); @@ -3212,11 +3220,11 @@ ->visible_rect.ToString()); EXPECT_EQ(gfx::Rect(0, 0, 20, 30).ToString(), frame.render_pass_list.front() - ->quad_list.ElementAt(4) + ->quad_list.ElementAt(5) ->visible_rect.ToString()); EXPECT_EQ(gfx::Rect(120, 0, 20, 30).ToString(), frame.render_pass_list.front() - ->quad_list.ElementAt(5) + ->quad_list.ElementAt(6) ->visible_rect.ToString()); } } @@ -3282,15 +3290,15 @@ quad2->SetNew(shared_quad_state2, rect2, rect2, SK_ColorBLACK, false); quad3->SetNew(shared_quad_state3, rect3, rect3, SK_ColorBLACK, false); - EXPECT_EQ(3u, frame.render_pass_list.front()->quad_list.size()); + EXPECT_EQ(3u, NumVisibleRects(frame.render_pass_list.front()->quad_list)); display_->RemoveOverdrawQuads(&frame); // |quad2| is removed because it is not shown on screen in the target space. - EXPECT_EQ(2u, frame.render_pass_list.front()->quad_list.size()); + EXPECT_EQ(2u, NumVisibleRects(frame.render_pass_list.front()->quad_list)); EXPECT_EQ(rect1.ToString(), frame.render_pass_list.front() ->quad_list.ElementAt(0) ->visible_rect.ToString()); EXPECT_EQ(rect3.ToString(), frame.render_pass_list.front() - ->quad_list.ElementAt(1) + ->quad_list.ElementAt(2) ->visible_rect.ToString()); } @@ -3312,11 +3320,11 @@ quad1->SetNew(shared_quad_state1, rect1, rect1, SK_ColorBLACK, false); quad3->SetNew(shared_quad_state3, rect3, rect3, SK_ColorBLACK, false); - EXPECT_EQ(2u, frame.render_pass_list.front()->quad_list.size()); + EXPECT_EQ(2u, NumVisibleRects(frame.render_pass_list.front()->quad_list)); display_->RemoveOverdrawQuads(&frame); // |quad3| follows an non-invertible transform and it's covered by the // occlusion rect. So |quad3| is removed from the |frame|. - EXPECT_EQ(1u, frame.render_pass_list.front()->quad_list.size()); + EXPECT_EQ(1u, NumVisibleRects(frame.render_pass_list.front()->quad_list)); EXPECT_EQ(rect1.ToString(), frame.render_pass_list.front() ->quad_list.ElementAt(0) ->visible_rect.ToString()); @@ -3352,12 +3360,12 @@ SkBlendMode::kSrcOver, 0); quad->SetNew(shared_quad_state, rect1, rect1, SK_ColorBLACK, false); - EXPECT_EQ(1u, frame.render_pass_list.front()->quad_list.size()); + EXPECT_EQ(1u, NumVisibleRects(frame.render_pass_list.front()->quad_list)); display_->RemoveOverdrawQuads(&frame); // This is a base case, the compositor frame contains only one // DrawQuad, so the size of quad_list remains unchanged after calling // RemoveOverdrawQuads. - EXPECT_EQ(1u, frame.render_pass_list.front()->quad_list.size()); + EXPECT_EQ(1u, NumVisibleRects(frame.render_pass_list.front()->quad_list)); EXPECT_EQ(rect1.ToString(), frame.render_pass_list.front() ->quad_list.ElementAt(0) ->visible_rect.ToString()); @@ -3876,11 +3884,11 @@ rounded_corner_quad->SetNew(shared_quad_state_with_rrect, quad_rect, quad_rect, SK_ColorBLUE, false); - EXPECT_EQ(2u, frame.render_pass_list.front()->quad_list.size()); + EXPECT_EQ(2u, NumVisibleRects(frame.render_pass_list.front()->quad_list)); display_->RemoveOverdrawQuads(&frame); // Since none of the quads are culled, there should be 2 quads. - EXPECT_EQ(2u, frame.render_pass_list.front()->quad_list.size()); + EXPECT_EQ(2u, NumVisibleRects(frame.render_pass_list.front()->quad_list)); EXPECT_EQ(quad_rect.ToString(), frame.render_pass_list.front() ->quad_list.ElementAt(0) ->visible_rect.ToString()); @@ -3932,12 +3940,12 @@ rounded_corner_quad->SetNew(shared_quad_state_with_rrect, quad_rect, quad_rect, SK_ColorBLUE, false); - EXPECT_EQ(2u, frame.render_pass_list.front()->quad_list.size()); + EXPECT_EQ(2u, NumVisibleRects(frame.render_pass_list.front()->quad_list)); display_->RemoveOverdrawQuads(&frame); // Since the quad with rounded corner completely covers the quad with // no rounded corner, the later quad is culled. We should only have 1 quad // in the final list now. - EXPECT_EQ(1u, frame.render_pass_list.front()->quad_list.size()); + EXPECT_EQ(1u, NumVisibleRects(frame.render_pass_list.front()->quad_list)); EXPECT_EQ(quad_rect.ToString(), frame.render_pass_list.front() ->quad_list.ElementAt(0) ->visible_rect.ToString()); @@ -4006,9 +4014,9 @@ quad_rects[i - 1], SK_ColorRED, false); } - EXPECT_EQ(4u, frame.render_pass_list.front()->quad_list.size()); + EXPECT_EQ(4u, NumVisibleRects(frame.render_pass_list.front()->quad_list)); display_->RemoveOverdrawQuads(&frame); - ASSERT_EQ(6u, frame.render_pass_list.front()->quad_list.size()); + ASSERT_EQ(6u, NumVisibleRects(frame.render_pass_list.front()->quad_list)); EXPECT_EQ(occluding_rect.ToString(), frame.render_pass_list.front() ->quad_list.ElementAt(0) ->visible_rect.ToString()); @@ -4121,9 +4129,9 @@ occluded_rect, SK_ColorRED, false); } - EXPECT_EQ(3u, frame.render_pass_list.front()->quad_list.size()); + EXPECT_EQ(3u, NumVisibleRects(frame.render_pass_list.front()->quad_list)); display_->RemoveOverdrawQuads(&frame); - ASSERT_EQ(6u, frame.render_pass_list.front()->quad_list.size()); + ASSERT_EQ(6u, NumVisibleRects(frame.render_pass_list.front()->quad_list)); // Expected visible quads: // +---------+-------+--------------+ @@ -4203,9 +4211,9 @@ occluded_quad->SetNew(shared_quad_state_occluded, occluded_rect, occluded_rect, SK_ColorRED, false); - EXPECT_EQ(2u, frame.render_pass_list.front()->quad_list.size()); + EXPECT_EQ(2u, NumVisibleRects(frame.render_pass_list.front()->quad_list)); display_->RemoveOverdrawQuads(&frame); - EXPECT_EQ(5u, frame.render_pass_list.front()->quad_list.size()); + EXPECT_EQ(5u, NumVisibleRects(frame.render_pass_list.front()->quad_list)); } TEST_F(DisplayTest, DrawOcclusionWithRoundedCornerPartialOcclude) { @@ -4289,12 +4297,12 @@ rounded_corner_quad->SetNew(shared_quad_state_with_rrect, quad_rect, quad_rect, SK_ColorBLUE, false); - EXPECT_EQ(5u, frame.render_pass_list.front()->quad_list.size()); + EXPECT_EQ(5u, NumVisibleRects(frame.render_pass_list.front()->quad_list)); display_->RemoveOverdrawQuads(&frame); // Since the quad with rounded corner completely covers the quad with // no rounded corner, the later quad is culled. We should only have 1 quad // in the final list now. - EXPECT_EQ(5u, frame.render_pass_list.front()->quad_list.size()); + EXPECT_EQ(5u, NumVisibleRects(frame.render_pass_list.front()->quad_list)); EXPECT_EQ(quad_rect.ToString(), frame.render_pass_list.front() ->quad_list.ElementAt(0) ->visible_rect.ToString());
diff --git a/components/viz/service/display/external_use_client.h b/components/viz/service/display/external_use_client.h index c5d80b5..bfb95f8 100644 --- a/components/viz/service/display/external_use_client.h +++ b/components/viz/service/display/external_use_client.h
@@ -52,18 +52,6 @@ ResourceFormat resource_format() const { return resource_format_; } sk_sp<SkColorSpace> color_space() const { return color_space_; } - // NOTE: This is metadata that should be set to match any factor baked into - // the |color_space| of this context. It is theoretically possible that the - // context's image could be updated using SkImage::reinterpretColorSpace - // if just the scale factor changes across frames. However, to respect the - // thread safety rules, a new SDR scale factor currently requires making a - // new ImageContext if its image has already been created. - float sdr_scale_factor() const { return sdr_scale_factor_; } - void set_sdr_scale_factor(float sdr_scale_factor) { - DCHECK(!image_); - sdr_scale_factor_ = sdr_scale_factor; - } - SkAlphaType alpha_type() const { return alpha_type_; } void set_alpha_type(SkAlphaType alpha_type) { DCHECK(!image_); @@ -90,11 +78,6 @@ const gfx::Size size_; const ResourceFormat resource_format_; const sk_sp<SkColorSpace> color_space_; - // Records the SDR white level scaling factor applied to |color_space_| when - // the ImageContext was made. Since this is already in the SkColorSpace, - // this is only used by the DisplayResourceProvider to determine if a cached - // ImageContext matches the requested white level. - float sdr_scale_factor_ = 1.0f; SkAlphaType alpha_type_ = kPremul_SkAlphaType; GrSurfaceOrigin origin_ = kTopLeft_GrSurfaceOrigin;
diff --git a/components/viz/service/display/skia_output_surface.h b/components/viz/service/display/skia_output_surface.h index 5107556..1be83a0 100644 --- a/components/viz/service/display/skia_output_surface.h +++ b/components/viz/service/display/skia_output_surface.h
@@ -83,7 +83,7 @@ virtual void MakePromiseSkImage( ExternalUseClient::ImageContext* image_context) = 0; - // Make a promise SkImage from the given |contexts| and the |yuv_color_space|. + // Make a promise SkImage from the given |contexts| and |image_color_space|. // For YUV format, at least three resource contexts should be provided. // contexts[0] contains pixels from y panel, contexts[1] contains pixels // from u panel, contexts[2] contains pixels from v panel. For NV12 format, @@ -92,8 +92,7 @@ // has_alpha is true, the last item in contexts contains alpha panel. virtual sk_sp<SkImage> MakePromiseSkImageFromYUV( const std::vector<ExternalUseClient::ImageContext*>& contexts, - SkYUVColorSpace yuv_color_space, - sk_sp<SkColorSpace> dst_color_space, + sk_sp<SkColorSpace> image_color_space, bool has_alpha) = 0; // Called if SwapBuffers() will be skipped.
diff --git a/components/viz/service/display/skia_renderer.cc b/components/viz/service/display/skia_renderer.cc index 0775c97..be18ae5 100644 --- a/components/viz/service/display/skia_renderer.cc +++ b/components/viz/service/display/skia_renderer.cc
@@ -559,13 +559,9 @@ lock_.emplace(resource_provider, resource_id, alpha_type, origin); sk_image_ = lock_->sk_image(); } else { - float sdr_white_level = - skia_renderer->current_frame()->display_color_spaces.GetSDRWhiteLevel(); - float sdr_scale_factor = - sdr_white_level / gfx::ColorSpace::kDefaultSDRWhiteLevel; auto* image_context = skia_renderer->lock_set_for_external_use_->LockResource( - resource_id, /*video_plane=*/false, sdr_scale_factor); + resource_id, /*is_video_plane=*/false); // |ImageContext::image| provides thread safety: (a) this ImageContext is // only accessed by GPU thread after |image| is set and (b) the fields of // ImageContext that are accessed by both compositor and GPU thread are no @@ -585,8 +581,7 @@ public: ScopedYUVSkImageBuilder(SkiaRenderer* skia_renderer, const YUVVideoDrawQuad* quad, - sk_sp<SkColorSpace> dst_color_space, - bool has_color_conversion_filter) { + sk_sp<SkColorSpace> dst_color_space) { DCHECK(skia_renderer->is_using_ddl()); DCHECK(IsTextureResource(skia_renderer->resource_provider_, quad->y_plane_resource_id())); @@ -598,14 +593,6 @@ IsTextureResource(skia_renderer->resource_provider_, quad->a_plane_resource_id())); - SkYUVColorSpace yuv_color_space; - if (has_color_conversion_filter) { - yuv_color_space = kIdentity_SkYUVColorSpace; - } else { - yuv_color_space = kRec601_SkYUVColorSpace; - quad->video_color_space.ToSkYUVColorSpace(&yuv_color_space); - } - const bool is_i420 = quad->u_plane_resource_id() != quad->v_plane_resource_id(); const bool has_alpha = quad->a_plane_resource_id() != kInvalidResourceId; @@ -615,25 +602,26 @@ // Skia API ignores the color space information on the individual planes. // Dropping them here avoids some LOG spam. auto* y_context = skia_renderer->lock_set_for_external_use_->LockResource( - quad->y_plane_resource_id(), true /* is_video_plane */); + quad->y_plane_resource_id(), /*is_video_plane=*/true); contexts.push_back(std::move(y_context)); auto* u_context = skia_renderer->lock_set_for_external_use_->LockResource( - quad->u_plane_resource_id(), true /* is_video_plane */); + quad->u_plane_resource_id(), /*is_video_plane=*/true); contexts.push_back(std::move(u_context)); if (is_i420) { auto* v_context = skia_renderer->lock_set_for_external_use_->LockResource( - quad->v_plane_resource_id(), true /* is_video_plane */); + quad->v_plane_resource_id(), /*is_video_plane=*/true); contexts.push_back(std::move(v_context)); } if (has_alpha) { auto* a_context = skia_renderer->lock_set_for_external_use_->LockResource( - quad->a_plane_resource_id(), true /* is_video_plane */); + quad->a_plane_resource_id(), /*is_video_plane=*/true); contexts.push_back(std::move(a_context)); } + // Note: YUV to RGB and color conversion is handled by a color filter. sk_image_ = skia_renderer->skia_output_surface_->MakePromiseSkImageFromYUV( - std::move(contexts), yuv_color_space, dst_color_space, has_alpha); + std::move(contexts), dst_color_space, has_alpha); LOG_IF(ERROR, !sk_image_) << "Failed to create the promise sk yuva image."; } @@ -1660,6 +1648,7 @@ SkPaint paint; paint.setFilterQuality(batched_quad_state_.filter_quality); paint.setBlendMode(batched_quad_state_.blend_mode); + current_canvas_->experimental_DrawEdgeAAImageSet( &batched_quads_.front(), batched_quads_.size(), batched_draw_regions_.data(), &batched_cdt_matrices_.front(), &paint, @@ -1694,30 +1683,14 @@ // PrepareCanvasForRPDQ will have updated params->opacity and blend_mode to // account for the layer applying those effects. color = SkColorSetA(color, params->opacity * SkColorGetA(color)); + const SkPoint* draw_region = params->draw_region.has_value() ? params->draw_region->points : nullptr; - SkColor4f color4f = SkColor4f::FromColor(color); - float sdr_white_level = - current_frame()->display_color_spaces.GetSDRWhiteLevel(); - if (sdr_white_level != gfx::ColorSpace::kDefaultSDRWhiteLevel) { - // SkColor is always sRGB. Use skcms to linearize, scale, and re-encode - const float scale_factor = - sdr_white_level / gfx::ColorSpace::kDefaultSDRWhiteLevel; - const auto* srgb_to_linear = skcms_sRGB_TransferFunction(); - const auto* linear_to_srgb = skcms_sRGB_Inverse_TransferFunction(); - - for (int c = 0; c < 3; ++c) { - color4f[c] = skcms_TransferFunction_eval( - linear_to_srgb, scale_factor * skcms_TransferFunction_eval( - srgb_to_linear, color4f[c])); - } - } - current_canvas_->experimental_DrawEdgeAAQuad( gfx::RectFToSkRect(params->visible_rect), draw_region, - static_cast<SkCanvas::QuadAAFlags>(params->aa_flags), color4f, - params->blend_mode); + static_cast<SkCanvas::QuadAAFlags>(params->aa_flags), + SkColor4f::FromColor(color), params->blend_mode); } void SkiaRenderer::DrawSingleImage(const SkImage* image, @@ -1791,6 +1764,7 @@ paint.setStyle(SkPaint::kStroke_Style); paint.setStrokeJoin(SkPaint::kMiter_Join); paint.setStrokeWidth(quad->width); + current_canvas_->drawPath(path, paint); } @@ -2103,13 +2077,8 @@ } #endif - sk_sp<SkColorFilter> color_filter = - GetColorFilter(src_color_space, dst_color_space, quad->resource_offset, - quad->resource_multiplier); - DCHECK(resource_provider_); - ScopedYUVSkImageBuilder builder( - this, quad, frame_color_space.ToSkColorSpace(), !!color_filter); + ScopedYUVSkImageBuilder builder(this, quad, dst_color_space.ToSkColorSpace()); const SkImage* image = builder.sk_image(); if (!image) return; @@ -2117,13 +2086,17 @@ params->vis_tex_coords = cc::MathUtil::ScaleRectProportional( quad->ya_tex_coord_rect, gfx::RectF(quad->rect), params->visible_rect); - SkPaint paint = params->paint(); - if (color_filter) - paint.setColorFilter(color_filter); - // Use provided, unclipped texture coordinates as the content area, which will // force coord clamping unless the geometry was clipped, or they span the // entire YUV image. + SkPaint paint = params->paint(); + + sk_sp<SkColorFilter> color_filter = + GetColorFilter(src_color_space, dst_color_space, quad->resource_offset, + quad->resource_multiplier); + DCHECK(!paint.getColorFilter()); + paint.setColorFilter(color_filter); + DrawSingleImage(image, quad->ya_tex_coord_rect, rpdq_params, &paint, params); } @@ -2202,14 +2175,10 @@ const gfx::ColorSpace& dst, float resource_offset, float resource_multiplier) { - gfx::ColorSpace adjusted_src = src; - float sdr_white_level = - current_frame()->display_color_spaces.GetSDRWhiteLevel(); - if (src.IsValid() && !src.IsHDR() && - sdr_white_level != gfx::ColorSpace::kDefaultSDRWhiteLevel) { - adjusted_src = src.GetScaledColorSpace( - sdr_white_level / gfx::ColorSpace::kDefaultSDRWhiteLevel); - } + // If the input color space is PQ, and it did not specify a white level, + // override it with the frame's white level. + gfx::ColorSpace adjusted_src = src.GetWithPQSDRWhiteLevel( + current_frame()->display_color_spaces.GetSDRWhiteLevel()); sk_sp<SkRuntimeEffect>& effect = color_filter_cache_[dst][adjusted_src]; if (!effect) {
diff --git a/components/viz/service/display_embedder/skia_output_surface_impl.cc b/components/viz/service/display_embedder/skia_output_surface_impl.cc index aac49db..8c0ea3f 100644 --- a/components/viz/service/display_embedder/skia_output_surface_impl.cc +++ b/components/viz/service/display_embedder/skia_output_surface_impl.cc
@@ -313,8 +313,7 @@ sk_sp<SkImage> SkiaOutputSurfaceImpl::MakePromiseSkImageFromYUV( const std::vector<ImageContext*>& contexts, - SkYUVColorSpace yuv_color_space, - sk_sp<SkColorSpace> dst_color_space, + sk_sp<SkColorSpace> image_color_space, bool has_alpha) { DCHECK_CALLED_ON_VALID_THREAD(thread_checker_); DCHECK(current_paint_); @@ -348,10 +347,11 @@ texture_contexts[i] = context; } + // Note: YUV to RGB conversion is handled by a color filter in SkiaRenderer. auto image = current_paint_->recorder()->makeYUVAPromiseTexture( - yuv_color_space, formats, yuva_sizes, indices, yuva_sizes[0].width(), - yuva_sizes[0].height(), kTopLeft_GrSurfaceOrigin, dst_color_space, - Fulfill, DoNothing, DoNothing, texture_contexts); + kIdentity_SkYUVColorSpace, formats, yuva_sizes, indices, + yuva_sizes[0].width(), yuva_sizes[0].height(), kTopLeft_GrSurfaceOrigin, + image_color_space, Fulfill, DoNothing, DoNothing, texture_contexts); DCHECK(image); return image; }
diff --git a/components/viz/service/display_embedder/skia_output_surface_impl.h b/components/viz/service/display_embedder/skia_output_surface_impl.h index 7894c272..187a383 100644 --- a/components/viz/service/display_embedder/skia_output_surface_impl.h +++ b/components/viz/service/display_embedder/skia_output_surface_impl.h
@@ -93,8 +93,7 @@ SkCanvas* BeginPaintCurrentFrame() override; sk_sp<SkImage> MakePromiseSkImageFromYUV( const std::vector<ImageContext*>& contexts, - SkYUVColorSpace yuv_color_space, - sk_sp<SkColorSpace> dst_color_space, + sk_sp<SkColorSpace> image_color_space, bool has_alpha) override; void SwapBuffersSkipped() override; void ScheduleOutputSurfaceAsOverlay(
diff --git a/components/viz/test/fake_skia_output_surface.cc b/components/viz/test/fake_skia_output_surface.cc index fbfad0c9..433c5cfd 100644 --- a/components/viz/test/fake_skia_output_surface.cc +++ b/components/viz/test/fake_skia_output_surface.cc
@@ -164,8 +164,7 @@ sk_sp<SkImage> FakeSkiaOutputSurface::MakePromiseSkImageFromYUV( const std::vector<ImageContext*>& contexts, - SkYUVColorSpace yuv_color_space, - sk_sp<SkColorSpace> dst_color_space, + sk_sp<SkColorSpace> image_color_space, bool has_alpha) { DCHECK_CALLED_ON_VALID_THREAD(thread_checker_); NOTIMPLEMENTED();
diff --git a/components/viz/test/fake_skia_output_surface.h b/components/viz/test/fake_skia_output_surface.h index fae4a037..5f37a1d 100644 --- a/components/viz/test/fake_skia_output_surface.h +++ b/components/viz/test/fake_skia_output_surface.h
@@ -70,8 +70,7 @@ SkCanvas* BeginPaintCurrentFrame() override; sk_sp<SkImage> MakePromiseSkImageFromYUV( const std::vector<ImageContext*>& contexts, - SkYUVColorSpace yuv_color_space, - sk_sp<SkColorSpace> dst_color_space, + sk_sp<SkColorSpace> image_color_space, bool has_alpha) override; void SwapBuffersSkipped() override {} SkCanvas* BeginPaintRenderPass(const RenderPassId& id,
diff --git a/content/browser/appcache/appcache.cc b/content/browser/appcache/appcache.cc index f823298..52f9bcd1 100644 --- a/content/browser/appcache/appcache.cc +++ b/content/browser/appcache/appcache.cc
@@ -341,6 +341,7 @@ info.response_size = pair.second.response_size(); info.padding_size = pair.second.padding_size(); info.response_id = pair.second.response_id(); + info.token_expires = pair.second.token_expires(); } }
diff --git a/content/browser/appcache/appcache_internals_ui.cc b/content/browser/appcache/appcache_internals_ui.cc index 0d23b0a..7e9f65c 100644 --- a/content/browser/appcache/appcache_internals_ui.cc +++ b/content/browser/appcache/appcache_internals_ui.cc
@@ -82,6 +82,7 @@ appcache_info.last_update_time.ToJsTime()); dict_value->SetDouble("lastAccessTime", appcache_info.last_access_time.ToJsTime()); + dict_value->SetDouble("tokenExpires", appcache_info.token_expires.ToJsTime()); dict_value->SetString("responseSizes", base::UTF16ToUTF8(base::FormatBytesUnlocalized( appcache_info.response_sizes))); @@ -145,6 +146,7 @@ dict->SetBoolean("isFallback", resource_info.is_fallback); dict->SetBoolean("isIntercept", resource_info.is_intercept); dict->SetBoolean("isForeign", resource_info.is_foreign); + dict->SetDouble("tokenExpires", resource_info.token_expires.ToJsTime()); return dict; }
diff --git a/content/browser/appcache/appcache_storage_impl.cc b/content/browser/appcache/appcache_storage_impl.cc index 78bbc3c..566e151 100644 --- a/content/browser/appcache/appcache_storage_impl.cc +++ b/content/browser/appcache/appcache_storage_impl.cc
@@ -365,6 +365,8 @@ info.padding_sizes = cache_record.padding_size; info.last_access_time = group.last_access_time; info.last_update_time = cache_record.update_time; + // TODO(enne): should this be cache? group? both?? + info.token_expires = group.token_expires; info.cache_id = cache_record.cache_id; info.group_id = group.group_id; info.is_complete = true;
diff --git a/content/browser/appcache/appcache_update_job.cc b/content/browser/appcache/appcache_update_job.cc index 1cabcfbb..2f0caeee 100644 --- a/content/browser/appcache/appcache_update_job.cc +++ b/content/browser/appcache/appcache_update_job.cc
@@ -130,12 +130,12 @@ // // The logic below is a workaround while a longer-term fix gets developed and // deployed. We'll consider all cache entries with invalid times to have been - // created on Sun, Jun 16 2019. + // created on Tue, Dec 31 2019. // // TODO(cmp): Add timeline info here. bool found_corruption = false; static constexpr base::Time::Exploded kInvalidTimePlaceholderExploded = { - 2019, 7, 0, 7, 0, 0, 0, 0}; + 2019, 12, 2, 31, 0, 0, 0, 0}; if (request_time.is_null()) { bool conversion_succeeded = base::Time::FromUTCExploded( kInvalidTimePlaceholderExploded, &request_time);
diff --git a/content/browser/renderer_host/input/event_latency_aura_browsertest.cc b/content/browser/renderer_host/input/event_latency_aura_browsertest.cc new file mode 100644 index 0000000..f0fecd8 --- /dev/null +++ b/content/browser/renderer_host/input/event_latency_aura_browsertest.cc
@@ -0,0 +1,123 @@ +// Copyright 2020 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "base/test/metrics/histogram_tester.h" +#include "content/browser/renderer_host/render_widget_host_impl.h" +#include "content/public/browser/render_view_host.h" +#include "content/public/test/content_browser_test.h" +#include "content/public/test/content_browser_test_utils.h" +#include "content/public/test/hit_test_region_observer.h" +#include "content/shell/browser/shell.h" +#include "testing/gmock/include/gmock/gmock.h" +#include "testing/gtest/include/gtest/gtest.h" +#include "ui/aura/window.h" +#include "ui/aura/window_tree_host.h" +#include "ui/events/test/event_generator.h" + +namespace content { + +class EventLatencyBrowserTest : public ContentBrowserTest { + public: + EventLatencyBrowserTest() = default; + ~EventLatencyBrowserTest() override = default; + + EventLatencyBrowserTest(const EventLatencyBrowserTest&) = delete; + EventLatencyBrowserTest& operator=(const EventLatencyBrowserTest&) = delete; + + protected: + RenderWidgetHostImpl* GetWidgetHost() { + return RenderWidgetHostImpl::From( + shell()->web_contents()->GetRenderViewHost()->GetWidget()); + } + + // Starts the test server and navigates to the test page. Returns after the + // navigation is complete. + void LoadTestPage() { + ASSERT_TRUE(embedded_test_server()->Start()); + + // Navigate to the test page which has a rAF animation and a main thread + // animation running. + GURL test_url = + embedded_test_server()->GetURL("/event-latency-animation.html"); + EXPECT_TRUE(NavigateToURL(shell(), test_url)); + + aura::Window* content = shell()->web_contents()->GetContentNativeView(); + content->GetHost()->SetBoundsInPixels(gfx::Rect(800, 600)); + + RenderWidgetHostImpl* host = GetWidgetHost(); + HitTestRegionObserver observer(host->GetFrameSinkId()); + + // Wait for the hit test data to be ready. + observer.WaitForHitTestData(); + } + + void FocusButton() const { ASSERT_TRUE(ExecJs(shell(), "focusButton()")); } + + void StartAnimations() const { + ASSERT_TRUE(ExecJs(shell(), "startAnimations()")); + } +}; + +// Tests that if a key-press on a page causes a visual update, appropriate event +// latency metrics are reported. +IN_PROC_BROWSER_TEST_F(EventLatencyBrowserTest, KeyPressOnButton) { + base::HistogramTester histogram_tester; + + ASSERT_NO_FATAL_FAILURE(LoadTestPage()); + FocusButton(); + + ui::test::EventGenerator generator(shell() + ->web_contents() + ->GetRenderWidgetHostView() + ->GetNativeView() + ->GetRootWindow()); + + // Press and release the space key. Since the button on the test page is + // focused, this should change the visuals of the button and generate a + // compositor frame with appropriate event latency metrics. + generator.PressKey(ui::VKEY_SPACE, 0); + generator.ReleaseKey(ui::VKEY_SPACE, 0); + RunUntilInputProcessed(GetWidgetHost()); + + FetchHistogramsFromChildProcesses(); + + base::HistogramTester::CountsMap expected_counts = { + {"EventLatency.KeyReleased.TotalLatency", 1}, + }; + EXPECT_THAT(histogram_tester.GetTotalCountsForPrefix("EventLatency."), + testing::ContainerEq(expected_counts)); +} + +// Tests that if a key-press on a page with an animation causes a visual update, +// appropriate event latency metrics are reported. +IN_PROC_BROWSER_TEST_F(EventLatencyBrowserTest, KeyPressOnButtonWithAnimation) { + base::HistogramTester histogram_tester; + + ASSERT_NO_FATAL_FAILURE(LoadTestPage()); + StartAnimations(); + FocusButton(); + + ui::test::EventGenerator generator(shell() + ->web_contents() + ->GetRenderWidgetHostView() + ->GetNativeView() + ->GetRootWindow()); + + // Press and release the space key. Since the button on the test page is + // focused, this should change the visuals of the button and generate a + // compositor frame with appropriate event latency metrics. + generator.PressKey(ui::VKEY_SPACE, 0); + generator.ReleaseKey(ui::VKEY_SPACE, 0); + RunUntilInputProcessed(GetWidgetHost()); + + FetchHistogramsFromChildProcesses(); + + base::HistogramTester::CountsMap expected_counts = { + {"EventLatency.KeyReleased.TotalLatency", 1}, + }; + EXPECT_THAT(histogram_tester.GetTotalCountsForPrefix("EventLatency."), + testing::ContainerEq(expected_counts)); +} + +} // namespace content
diff --git a/content/browser/renderer_host/render_view_host_impl.cc b/content/browser/renderer_host/render_view_host_impl.cc index f27504c..01a4e3dc 100644 --- a/content/browser/renderer_host/render_view_host_impl.cc +++ b/content/browser/renderer_host/render_view_host_impl.cc
@@ -208,6 +208,11 @@ display::win::ScreenWin::GetSystemMetricsInDIP(SM_CXHSCROLL); #elif defined(OS_LINUX) prefs->system_font_family_name = gfx::Font().GetFontName(); +#elif defined(OS_FUCHSIA) + // Make Blink's "focus ring" invisible. The focus ring is a hairline border + // that's rendered around clickable targets. + // TODO(crbug.com/1066605): Consider exposing this as a FIDL parameter. + prefs->focus_ring_color = SK_AlphaTRANSPARENT; #endif }
diff --git a/content/browser/renderer_host/render_widget_host_view_mac.mm b/content/browser/renderer_host/render_widget_host_view_mac.mm index de6fb32..6c8313f 100644 --- a/content/browser/renderer_host/render_widget_host_view_mac.mm +++ b/content/browser/renderer_host/render_widget_host_view_mac.mm
@@ -1701,6 +1701,10 @@ if (!widget_host) return; + // For popups, do not support QuickLook. + if (popup_parent_host_view_) + return; + int32_t target_widget_process_id = widget_host->GetProcess()->GetID(); int32_t target_widget_routing_id = widget_host->GetRoutingID(); TextInputClientMac::GetInstance()->GetStringAtPoint(
diff --git a/content/browser/resources/appcache/appcache_internals.css b/content/browser/resources/appcache/appcache_internals.css index b2fe53f3..eb3908a 100644 --- a/content/browser/resources/appcache/appcache_internals.css +++ b/content/browser/resources/appcache/appcache_internals.css
@@ -79,6 +79,14 @@ text-align: start; } +.appcache-details th { + text-align: start; +} + .appcache-details td { width: 80px; } + +.appcache-details td.token-expires { + width: 500px; +}
diff --git a/content/browser/resources/appcache/appcache_internals.html b/content/browser/resources/appcache/appcache_internals.html index aed90a7..951164f 100644 --- a/content/browser/resources/appcache/appcache_internals.html +++ b/content/browser/resources/appcache/appcache_internals.html
@@ -67,6 +67,12 @@ <span> Last Update Time: </span> <span jscontent="new Date(lastUpdateTime)"></span> </li> + <li> + <span> Token Expires: </span> + <span jscontent= + "tokenExpires ? new Date(tokenExpires) : '(unset)'"> + </span> + </li> </ul> </div> <div class="appcache-manifest-commands" @@ -91,13 +97,14 @@ </div> <table id="appcache-info-template"> - <thead> + <thead class="appcache-details-header"> <tr> <th>File URL</th> <th>Total Size</th> <th>Response</th> <th>Padding</th> <th>Properties</th> + <th>Token Expires</th> </tr> </thead> <tbody class="appcache-details" @@ -112,6 +119,9 @@ <td jscontent="responseSize"></td> <td jscontent="paddingSize"></td> <td jscontent="properties"></td> + <td class="token-expires" jscontent= + "tokenExpires ? new Date(tokenExpires) : '(unset)'"> + </td> </tr> </tbody> </table>
diff --git a/content/browser/resources/appcache/appcache_internals.js b/content/browser/resources/appcache/appcache_internals.js index 4933f5b..12eccae9 100644 --- a/content/browser/resources/appcache/appcache_internals.js +++ b/content/browser/resources/appcache/appcache_internals.js
@@ -173,7 +173,8 @@ totalSize: details.totalSize, properties: properties, fileUrl: details.url, - responseId: details.responseId + responseId: details.responseId, + tokenExpires: details.tokenExpires, }); } return simpleVector;
diff --git a/content/browser/tracing/perfetto_file_tracer.cc b/content/browser/tracing/perfetto_file_tracer.cc index 4efdf2b..68e9d54 100644 --- a/content/browser/tracing/perfetto_file_tracer.cc +++ b/content/browser/tracing/perfetto_file_tracer.cc
@@ -93,11 +93,12 @@ switches::kPerfettoOutputFile); } +// Use USER_VISIBLE priority for the drainer because BEST_EFFORT tasks are not +// run at startup and we want the trace file to be written soon. PerfettoFileTracer::PerfettoFileTracer() - : background_task_runner_(base::ThreadPool::CreateSequencedTaskRunner( - {base::MayBlock(), base::TaskPriority::BEST_EFFORT, - base::TaskShutdownBehavior::BLOCK_SHUTDOWN})), - background_drainer_(background_task_runner_) { + : background_drainer_(base::ThreadPool::CreateSequencedTaskRunner( + {base::MayBlock(), base::TaskPriority::USER_VISIBLE, + base::TaskShutdownBehavior::BLOCK_SHUTDOWN})) { GetTracingService().BindConsumerHost( consumer_host_.BindNewPipeAndPassReceiver()); @@ -129,15 +130,6 @@ void PerfettoFileTracer::OnTracingEnabled() {} -void PerfettoFileTracer::SetBackgroundTaskPriorityForTesting( - base::TaskPriority priority) { - background_drainer_.Reset(); - background_task_runner_ = base::ThreadPool::CreateSequencedTaskRunner( - {base::MayBlock(), priority, base::TaskShutdownBehavior::BLOCK_SHUTDOWN}); - background_drainer_ = - base::SequenceBound<BackgroundDrainer>(background_task_runner_); -} - void PerfettoFileTracer::OnTracingDisabled() { has_been_disabled_ = true; }
diff --git a/content/browser/tracing/perfetto_file_tracer.h b/content/browser/tracing/perfetto_file_tracer.h index 0edf3a3..36174b8 100644 --- a/content/browser/tracing/perfetto_file_tracer.h +++ b/content/browser/tracing/perfetto_file_tracer.h
@@ -39,15 +39,12 @@ bool is_finished_for_testing() const { return !background_drainer_; } - CONTENT_EXPORT void SetBackgroundTaskPriorityForTesting(base::TaskPriority); - private: void OnNoMorePackets(bool queued_after_disable); void ReadBuffers(); void OnTracingSessionEnded(); - scoped_refptr<base::SequencedTaskRunner> background_task_runner_; base::SequenceBound<BackgroundDrainer> background_drainer_; mojo::Receiver<tracing::mojom::TracingSessionClient> receiver_{this}; mojo::Remote<tracing::mojom::TracingSessionHost> tracing_session_host_;
diff --git a/content/browser/tracing/startup_tracing_browsertest.cc b/content/browser/tracing/startup_tracing_browsertest.cc index bb9d6d0..e4992ea 100644 --- a/content/browser/tracing/startup_tracing_browsertest.cc +++ b/content/browser/tracing/startup_tracing_browsertest.cc
@@ -53,14 +53,6 @@ temp_file_path_.AsUTF8Unsafe()); } - void PreRunTestOnMainThread() override { - // Ensure that the file is written quickly for these tests. - TracingControllerImpl::GetInstance() - ->set_startup_file_endpoint_priority_for_testing( - base::TaskPriority::USER_BLOCKING); - ContentBrowserTest::PreRunTestOnMainThread(); - } - protected: base::FilePath temp_file_path_; @@ -182,15 +174,6 @@ temp_file_path_.AsUTF8Unsafe()); } - void PreRunTestOnMainThread() override { - // Ensure that the file is written quickly for these tests. - TracingControllerImpl::GetInstance() - ->perfetto_file_tracer_for_testing() - ->SetBackgroundTaskPriorityForTesting( - base::TaskPriority::USER_BLOCKING); - ContentBrowserTest::PreRunTestOnMainThread(); - } - protected: base::FilePath temp_file_path_;
diff --git a/content/browser/tracing/tracing_controller_impl.cc b/content/browser/tracing/tracing_controller_impl.cc index 377015f..42ffc449 100644 --- a/content/browser/tracing/tracing_controller_impl.cc +++ b/content/browser/tracing/tracing_controller_impl.cc
@@ -463,10 +463,12 @@ if (!tracing::TraceStartupConfig::GetInstance()->IsEnabled()) return; + // Use USER_VISIBLE priority because BEST_EFFORT tasks are not run at startup + // and we want the trace file to be written soon. StopTracing(CreateFileEndpoint( startup_trace_file_, base::BindRepeating(OnStoppedStartupTracing, startup_trace_file_), - startup_file_endpoint_priority_)); + base::TaskPriority::USER_VISIBLE)); } void TracingControllerImpl::FinalizeStartupTracingIfNeeded() {
diff --git a/content/browser/tracing/tracing_controller_impl.h b/content/browser/tracing/tracing_controller_impl.h index 57ca5c91f..0c62e83 100644 --- a/content/browser/tracing/tracing_controller_impl.h +++ b/content/browser/tracing/tracing_controller_impl.h
@@ -93,11 +93,6 @@ return perfetto_file_tracer_.get(); } - void set_startup_file_endpoint_priority_for_testing( - base::TaskPriority priority) { - startup_file_endpoint_priority_ = priority; - } - private: friend std::default_delete<TracingControllerImpl>; @@ -138,8 +133,6 @@ base::FilePath startup_trace_file_; // This timer initiates trace file saving. base::OneShotTimer startup_trace_timer_; - base::TaskPriority startup_file_endpoint_priority_ = - base::TaskPriority::BEST_EFFORT; #if defined(OS_CHROMEOS) bool are_statistics_loaded_ = false;
diff --git a/content/public/android/java/src/org/chromium/content/browser/accessibility/WebContentsAccessibilityImpl.java b/content/public/android/java/src/org/chromium/content/browser/accessibility/WebContentsAccessibilityImpl.java index 98e31c6..c048536 100644 --- a/content/public/android/java/src/org/chromium/content/browser/accessibility/WebContentsAccessibilityImpl.java +++ b/content/public/android/java/src/org/chromium/content/browser/accessibility/WebContentsAccessibilityImpl.java
@@ -51,7 +51,6 @@ import org.chromium.ui.base.WindowAndroid; import java.util.ArrayList; -import java.util.Arrays; import java.util.Calendar; import java.util.HashSet; import java.util.List; @@ -168,8 +167,8 @@ // Unordered list of event types we will throttle if multiple events of the given type are sent // in quick succession. - private Set<Integer> mEventsToThrottle = new HashSet<Integer>(Arrays.asList( - AccessibilityEvent.TYPE_VIEW_SCROLLED, AccessibilityEvent.TYPE_WINDOW_CONTENT_CHANGED)); + // TODO (mschillaci) - No event types added in M83 to disable all throttling. + private Set<Integer> mEventsToThrottle = new HashSet<Integer>(); // For events being throttled (see: |mEventsToThrottle|), this array will map the eventType // to the last time (long in milliseconds) such an event has been sent. @@ -181,8 +180,13 @@ // This array maps a given virtualViewId to an |AccessibilityNodeInfo| for that view. We use // this to update a node quickly rather than building from one scratch each time. + // TODO (mschillaci) - Nothing is added to the cache in M83, it is disabled. private SparseArray<AccessibilityNodeInfo> mNodeInfoCache = new SparseArray<>(); + // TODO (mschillaci) - Revert this change to re-enable throttling. + private Runnable mSendWindowContentChangedRunnable; + private static final int WINDOW_CONTENT_CHANGED_DELAY_MS = 500; + /** * Create a WebContentsAccessibilityImpl object. */ @@ -374,7 +378,8 @@ if (WebContentsAccessibilityImplJni.get().populateAccessibilityNodeInfo( mNativeObj, WebContentsAccessibilityImpl.this, info, virtualViewId)) { // After successfully populating this node, add it to our cache then return. - mNodeInfoCache.put(virtualViewId, AccessibilityNodeInfo.obtain(info)); + // TODO (mschillaci) - Uncomment this line to re-enable caching. + // mNodeInfoCache.put(virtualViewId, AccessibilityNodeInfo.obtain(info)); return info; } else { info.recycle(); @@ -412,7 +417,9 @@ public void setObscuredByAnotherView(boolean isObscured) { if (isObscured != mIsObscuredByAnotherView) { mIsObscuredByAnotherView = isObscured; - sendAccessibilityEvent(View.NO_ID, AccessibilityEvent.TYPE_WINDOW_CONTENT_CHANGED); + // TODO (mschillaci) - Revert this change to re-enable throttling. + // sendAccessibilityEvent(View.NO_ID, AccessibilityEvent.TYPE_WINDOW_CONTENT_CHANGED); + mView.sendAccessibilityEvent(AccessibilityEvent.TYPE_WINDOW_CONTENT_CHANGED); } } @@ -791,7 +798,9 @@ // Invalidate the container view, since the chrome accessibility tree is now // ready and listed as the child of the container view. - sendAccessibilityEvent(View.NO_ID, AccessibilityEvent.TYPE_WINDOW_CONTENT_CHANGED); + // TODO (mschillaci) - Revert this change to re-enable throttling. + // sendAccessibilityEvent(View.NO_ID, AccessibilityEvent.TYPE_WINDOW_CONTENT_CHANGED); + sendWindowContentChangedOnView(); // (Re-) focus focused element, since we weren't able to create an // AccessibilityNodeInfo for this element before. @@ -1060,7 +1069,30 @@ */ @CalledByNative private void sendDelayedWindowContentChangedEvent() { - sendAccessibilityEvent(View.NO_ID, AccessibilityEvent.TYPE_WINDOW_CONTENT_CHANGED); + // TODO (mschillaci) - Revert this change to re-enable throttling. + if (mSendWindowContentChangedRunnable != null) return; + + mSendWindowContentChangedRunnable = new Runnable() { + @Override + public void run() { + sendWindowContentChangedOnView(); + } + }; + + mView.postDelayed(mSendWindowContentChangedRunnable, WINDOW_CONTENT_CHANGED_DELAY_MS); + } + + private void sendWindowContentChangedOnView() { + if (mSendWindowContentChangedRunnable != null) { + mView.removeCallbacks(mSendWindowContentChangedRunnable); + mSendWindowContentChangedRunnable = null; + } + mView.sendAccessibilityEvent(AccessibilityEvent.TYPE_WINDOW_CONTENT_CHANGED); + } + + private void sendWindowContentChangedOnVirtualView(int virtualViewId) { + sendAccessibilityEvent(virtualViewId, AccessibilityEvent.TYPE_WINDOW_CONTENT_CHANGED); + // sendAccessibilityEvent(View.NO_ID, AccessibilityEvent.TYPE_WINDOW_CONTENT_CHANGED); } private void sendAccessibilityEvent(int virtualViewId, int eventType) { @@ -1079,6 +1111,7 @@ } // Check whether this type of event is one we want to throttle, and if not then send it + // TODO (mschillaci) - Will always return true until we enable throttling (see line: 171). if (!mEventsToThrottle.contains(eventType)) { AccessibilityEvent event = buildAccessibilityEvent(virtualViewId, eventType); if (event == null) return; @@ -1282,9 +1315,13 @@ mNativeObj, WebContentsAccessibilityImpl.this); if (rootId != mCurrentRootId) { mCurrentRootId = rootId; - sendAccessibilityEvent(View.NO_ID, AccessibilityEvent.TYPE_WINDOW_CONTENT_CHANGED); + // TODO (mschillaci) - Revert this change to re-enable throttling. + // sendAccessibilityEvent(View.NO_ID, AccessibilityEvent.TYPE_WINDOW_CONTENT_CHANGED); + sendWindowContentChangedOnView(); } else { - sendAccessibilityEvent(id, AccessibilityEvent.TYPE_WINDOW_CONTENT_CHANGED); + // TODO (mschillaci) - Revert this change to re-enable throttling. + // sendAccessibilityEvent(id, AccessibilityEvent.TYPE_WINDOW_CONTENT_CHANGED); + sendWindowContentChangedOnVirtualView(id); } } @@ -1294,7 +1331,9 @@ mAccessibilityFocusRect = null; mUserHasTouchExplored = false; // Invalidate the host, since its child is now gone. - sendAccessibilityEvent(View.NO_ID, AccessibilityEvent.TYPE_WINDOW_CONTENT_CHANGED); + // TODO (mschillaci) - Revert this change to re-enable throttling. + // sendAccessibilityEvent(View.NO_ID, AccessibilityEvent.TYPE_WINDOW_CONTENT_CHANGED); + sendWindowContentChangedOnView(); } @CalledByNative @@ -1397,6 +1436,10 @@ addAction(node, ACTION_SET_TEXT); addAction(node, AccessibilityNodeInfo.ACTION_PASTE); + if (ACTION_IME_ENTER != 0) { + addAction(node, ACTION_IME_ENTER); + } + if (hasNonEmptyValue) { addAction(node, AccessibilityNodeInfo.ACTION_SET_SELECTION); addAction(node, AccessibilityNodeInfo.ACTION_CUT); @@ -1461,10 +1504,6 @@ if (isRangeType) { addAction(node, ACTION_SET_PROGRESS); } - - if (isForm && ACTION_IME_ENTER != 0) { - addAction(node, ACTION_IME_ENTER); - } } @CalledByNative
diff --git a/content/public/test/android/javatests/src/org/chromium/content_public/browser/test/util/TouchCommon.java b/content/public/test/android/javatests/src/org/chromium/content_public/browser/test/util/TouchCommon.java index 61ca471..dee2bbd 100644 --- a/content/public/test/android/javatests/src/org/chromium/content_public/browser/test/util/TouchCommon.java +++ b/content/public/test/android/javatests/src/org/chromium/content_public/browser/test/util/TouchCommon.java
@@ -27,36 +27,46 @@ /** * Starts (synchronously) a drag motion. Normally followed by dragTo() and dragEnd(). * + * @param view The view to dispatch the events to. + * @param x X coordinate, in screen coordinates. + * @param y Y coordinate, in screen coordinates. + * @param downTime When the drag was started, in millis since the epoch. + */ + public static void dragStart(View view, float x, float y, long downTime) { + float[] windowXY = screenToWindowCoordinates(view, x, y); + float windowX = windowXY[0]; + float windowY = windowXY[1]; + MotionEvent event = MotionEvent.obtain( + downTime, downTime, MotionEvent.ACTION_DOWN, windowX, windowY, 0); + dispatchTouchEvent(view, event); + } + + /** + * Starts (synchronously) a drag motion. Normally followed by dragTo() and dragEnd(). + * * @activity activity The activity where the touch action is being performed. * @param x X coordinate, in screen coordinates. * @param y Y coordinate, in screen coordinates. * @param downTime When the drag was started, in millis since the epoch. */ public static void dragStart(Activity activity, float x, float y, long downTime) { - View root = getRootViewForActivity(activity); - float[] windowXY = screenToWindowCoordinates(root, x, y); - float windowX = windowXY[0]; - float windowY = windowXY[1]; - MotionEvent event = MotionEvent.obtain( - downTime, downTime, MotionEvent.ACTION_DOWN, windowX, windowY, 0); - dispatchTouchEvent(root, event); + dragStart(getRootViewForActivity(activity), x, y, downTime); } /** * Drags / moves (synchronously) to the specified coordinates. Normally preceeded by * dragStart() and followed by dragEnd() * - * @activity activity The activity where the touch action is being performed. + * @param view The view to dispatch events to. * @param fromX X coordinate of the initial touch, in screen coordinates. - * @param toX Xcoordinate of the drag destination, in screen coordinates. + * @param toX X coordinate of the drag destination, in screen coordinates. * @param fromY X coordinate of the initial touch, in screen coordinates. * @param toY Y coordinate of the drag destination, in screen coordinates. * @param stepCount How many move steps to include in the drag. * @param downTime When the drag was started, in millis since the epoch. */ - public static void dragTo(Activity activity, float fromX, float toX, float fromY, float toY, + public static void dragTo(View view, float fromX, float toX, float fromY, float toY, int stepCount, long downTime) { - View rootView = getRootViewForActivity(activity); float x = fromX; float y = fromY; float yStep = (toY - fromY) / stepCount; @@ -65,18 +75,54 @@ y += yStep; x += xStep; long eventTime = SystemClock.uptimeMillis(); - float[] windowXY = screenToWindowCoordinates(rootView, x, y); + float[] windowXY = screenToWindowCoordinates(view, x, y); float windowX = windowXY[0]; float windowY = windowXY[1]; MotionEvent event = MotionEvent.obtain( downTime, eventTime, MotionEvent.ACTION_MOVE, windowX, windowY, 0); - dispatchTouchEvent(rootView, event); + dispatchTouchEvent(view, event); } } /** + * Drags / moves (synchronously) to the specified coordinates. Normally preceded by + * dragStart() and followed by dragEnd() + * + * @activity activity The activity where the touch action is being performed. + * @param fromX X coordinate of the initial touch, in screen coordinates. + * @param toX X coordinate of the drag destination, in screen coordinates. + * @param fromY X coordinate of the initial touch, in screen coordinates. + * @param toY Y coordinate of the drag destination, in screen coordinates. + * @param stepCount How many move steps to include in the drag. + * @param downTime When the drag was started, in millis since the epoch. + */ + public static void dragTo(Activity activity, float fromX, float toX, float fromY, float toY, + int stepCount, long downTime) { + dragTo(getRootViewForActivity(activity), fromX, toX, fromY, toY, stepCount, downTime); + } + + /** * Finishes (synchronously) a drag / move at the specified coordinate. - * Normally preceeded by dragStart() and dragTo(). + * Normally preceded by dragStart() and dragTo(). + * + * @param view The view to dispatch events to. + * @param x X coordinate, in screen coordinates. + * @param y Y coordinate, in screen coordinates. + * @param downTime When the drag was started, in millis since the epoch. + */ + public static void dragEnd(View view, float x, float y, long downTime) { + float[] windowXY = screenToWindowCoordinates(view, x, y); + float windowX = windowXY[0]; + float windowY = windowXY[1]; + long eventTime = SystemClock.uptimeMillis(); + MotionEvent event = + MotionEvent.obtain(downTime, eventTime, MotionEvent.ACTION_UP, windowX, windowY, 0); + dispatchTouchEvent(view, event); + } + + /** + * Finishes (synchronously) a drag / move at the specified coordinate. + * Normally preceded by dragStart() and dragTo(). * * @activity activity The activity where the touch action is being performed. * @param x X coordinate, in screen coordinates. @@ -84,14 +130,7 @@ * @param downTime When the drag was started, in millis since the epoch. */ public static void dragEnd(Activity activity, float x, float y, long downTime) { - View root = getRootViewForActivity(activity); - float[] windowXY = screenToWindowCoordinates(root, x, y); - float windowX = windowXY[0]; - float windowY = windowXY[1]; - long eventTime = SystemClock.uptimeMillis(); - MotionEvent event = - MotionEvent.obtain(downTime, eventTime, MotionEvent.ACTION_UP, windowX, windowY, 0); - dispatchTouchEvent(root, event); + dragEnd(getRootViewForActivity(activity), x, y, downTime); } /**
diff --git a/content/renderer/media/audio/audio_renderer_mixer_manager.cc b/content/renderer/media/audio/audio_renderer_mixer_manager.cc index fe5c686e..a530168 100644 --- a/content/renderer/media/audio/audio_renderer_mixer_manager.cc +++ b/content/renderer/media/audio/audio_renderer_mixer_manager.cc
@@ -116,9 +116,6 @@ 21); return; case media::AudioLatency::LATENCY_PLAYBACK: - UMA_HISTOGRAM_CUSTOM_COUNTS( - "Media.Audio.Render.AudioInputsPerMixer.LatencyPlayback", value, 1, - 20, 21); return; default: NOTREACHED();
diff --git a/content/shell/BUILD.gn b/content/shell/BUILD.gn index 410c686a..c19ff419 100644 --- a/content/shell/BUILD.gn +++ b/content/shell/BUILD.gn
@@ -48,6 +48,7 @@ source_set("web_test_common") { testonly = true sources = [ + "common/web_test/web_test_constants.h", "common/web_test/web_test_string_util.cc", "common/web_test/web_test_string_util.h", "common/web_test/web_test_switches.cc",
diff --git a/content/shell/browser/web_test/web_test_client_impl.cc b/content/shell/browser/web_test/web_test_client_impl.cc index 0f26dc5..0ac6afd 100644 --- a/content/shell/browser/web_test/web_test_client_impl.cc +++ b/content/shell/browser/web_test/web_test_client_impl.cc
@@ -24,7 +24,7 @@ #include "content/shell/browser/web_test/web_test_content_browser_client.h" #include "content/shell/browser/web_test/web_test_content_index_provider.h" #include "content/shell/browser/web_test/web_test_permission_manager.h" -#include "content/shell/test_runner/web_test_delegate.h" +#include "content/shell/common/web_test/web_test_constants.h" #include "content/test/mock_platform_notification_service.h" #include "mojo/public/cpp/bindings/pending_receiver.h" #include "mojo/public/cpp/bindings/self_owned_associated_receiver.h" @@ -63,8 +63,8 @@ scoped_refptr<storage::QuotaManager> quota_manager, int32_t quota) { DCHECK_CURRENTLY_ON(BrowserThread::IO); - DCHECK(quota >= 0 || quota == test_runner::kDefaultDatabaseQuota); - if (quota == test_runner::kDefaultDatabaseQuota) { + DCHECK(quota >= 0 || quota == kDefaultDatabaseQuota); + if (quota == kDefaultDatabaseQuota) { // Reset quota to settings with a zero refresh interval to force // QuotaManager to refresh settings immediately. storage::QuotaSettings default_settings;
diff --git a/content/shell/common/web_test/web_test_constants.h b/content/shell/common/web_test/web_test_constants.h new file mode 100644 index 0000000..247ad8fa --- /dev/null +++ b/content/shell/common/web_test/web_test_constants.h
@@ -0,0 +1,14 @@ +// Copyright 2013 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef CONTENT_SHELL_COMMON_WEB_TEST_WEB_TEST_CONSTANTS_H_ +#define CONTENT_SHELL_COMMON_WEB_TEST_WEB_TEST_CONSTANTS_H_ + +namespace content { + +constexpr int kDefaultDatabaseQuota = -1; + +} // namespace content + +#endif // CONTENT_SHELL_COMMON_WEB_TEST_WEB_TEST_CONSTANTS_H_
diff --git a/content/shell/test_runner/test_runner.cc b/content/shell/test_runner/test_runner.cc index acd850c..cc436a0 100644 --- a/content/shell/test_runner/test_runner.cc +++ b/content/shell/test_runner/test_runner.cc
@@ -21,6 +21,7 @@ #include "base/strings/utf_string_conversions.h" #include "build/build_config.h" #include "cc/paint/paint_canvas.h" +#include "content/shell/common/web_test/web_test_constants.h" #include "content/shell/common/web_test/web_test_string_util.h" #include "content/shell/test_runner/layout_dump.h" #include "content/shell/test_runner/mock_content_settings_client.h" @@ -1537,7 +1538,7 @@ if (delegate_) { // Reset the default quota for each origin. - delegate_->SetDatabaseQuota(kDefaultDatabaseQuota); + delegate_->SetDatabaseQuota(content::kDefaultDatabaseQuota); delegate_->SetDeviceColorSpace("reset"); delegate_->SetDeviceScaleFactor(GetDefaultDeviceScaleFactor()); delegate_->SetBlockThirdPartyCookies(false);
diff --git a/content/shell/test_runner/web_test_delegate.h b/content/shell/test_runner/web_test_delegate.h index 2817082..750aa70 100644 --- a/content/shell/test_runner/web_test_delegate.h +++ b/content/shell/test_runner/web_test_delegate.h
@@ -40,8 +40,6 @@ class WebWidgetTestProxy; struct TestPreferences; -constexpr int kDefaultDatabaseQuota = -1; - class WebTestDelegate { public: virtual ~WebTestDelegate() = default;
diff --git a/content/test/BUILD.gn b/content/test/BUILD.gn index 67cc46d..7381088 100644 --- a/content/test/BUILD.gn +++ b/content/test/BUILD.gn
@@ -1000,6 +1000,7 @@ "../browser/renderer_host/input/autoscroll_browsertest.cc", "../browser/renderer_host/input/composited_scrolling_browsertest.cc", "../browser/renderer_host/input/compositor_event_ack_browsertest.cc", + "../browser/renderer_host/input/event_latency_aura_browsertest.cc", "../browser/renderer_host/input/fling_browsertest.cc", "../browser/renderer_host/input/interaction_mq_dynamic_browsertest.cc", "../browser/renderer_host/input/main_thread_event_queue_browsertest.cc", @@ -1499,6 +1500,7 @@ } else { sources -= [ "../browser/accessibility/touch_accessibility_aura_browsertest.cc", + "../browser/renderer_host/input/event_latency_aura_browsertest.cc", "../browser/renderer_host/input/touch_selection_controller_client_aura_browsertest.cc", "../browser/renderer_host/render_widget_host_view_aura_browsertest.cc", "../browser/web_contents/web_contents_view_aura_browsertest.cc",
diff --git a/content/test/data/event-latency-animation.html b/content/test/data/event-latency-animation.html new file mode 100644 index 0000000..38db7eaf --- /dev/null +++ b/content/test/data/event-latency-animation.html
@@ -0,0 +1,71 @@ +<!DOCTYPE html> +<html lang="en"> + <head> + <meta charset="utf-8"> + <meta name="viewport" content="width=device-width"> + <title>EventLatency vs. Animation</title> + <style> + #raf-box { + display: inline-block; + width: 100px; + height: 100px; + background-color: blue; + } + + #main-box { + display: inline-block; + width: 100px; + height: 100px; + background-color: red; + } + + .pulse-width { + animation: pulse-width 1s infinite; + } + + @keyframes pulse-width { + 0% { + width: 100px; + } + 100% { + width: 200px; + } + } + </style> + </head> + + <body> + <button id="button">Press here with space</button> + <div> + <div id="raf-box"></div> + <div id="main-box"></div> + </div> + <script> + var button = document.getElementById('button'); + var rafBox = document.getElementById('raf-box'); + var mainBox = document.getElementById('main-box'); + + var rafId = null; + var rafStart = null; + + var focusButton = function() { + button.focus(); + }; + + var rafAnimate = function(time) { + if (rafStart === null) + rafStart = time; + var w = Math.floor((time - rafStart) / 10) % 100 + 100; + rafBox.style.width = w + 'px'; + rafId = requestAnimationFrame(rafAnimate); + }; + + var startAnimations = function() { + if (rafId === null) + rafId = requestAnimationFrame(rafAnimate); + if (!mainBox.classList.contains('pulse-width')) + mainBox.classList.add('pulse-width'); + }; + </script> + </body> +</html>
diff --git a/content/test/gpu/gpu_tests/pixel_integration_test.py b/content/test/gpu/gpu_tests/pixel_integration_test.py index a315e6a..b4fa0c1 100644 --- a/content/test/gpu/gpu_tests/pixel_integration_test.py +++ b/content/test/gpu/gpu_tests/pixel_integration_test.py
@@ -78,6 +78,7 @@ if sys.platform.startswith('win'): pages += namespace.DirectCompositionPages(cls.test_base_name) pages += namespace.LowLatencySwapChainPages(cls.test_base_name) + pages += namespace.HdrTestPages(cls.test_base_name) for p in pages: yield(p.name, skia_gold_integration_test_base.GPU_RELATIVE_PATH + p.url,
diff --git a/content/test/gpu/gpu_tests/pixel_test_pages.py b/content/test/gpu/gpu_tests/pixel_test_pages.py index 54fc5e07..a1836e10 100644 --- a/content/test/gpu/gpu_tests/pixel_test_pages.py +++ b/content/test/gpu/gpu_tests/pixel_test_pages.py
@@ -1976,3 +1976,20 @@ tolerance=tolerance_dc, expected_colors=_FOUR_COLOR_VIDEO_240x135_EXPECTED_COLORS), ] + + @staticmethod + def HdrTestPages(base_name): + return [ + PixelTestPage( + 'pixel_canvas2d.html', + base_name + '_Canvas2DRedBoxScrgbLinear', + test_rect=[0, 0, 300, 300], + browser_args=['--force-color-profile=scrgb-linear']), + + PixelTestPage( + 'pixel_canvas2d.html', + base_name + '_Canvas2DRedBoxHdr10', + test_rect=[0, 0, 300, 300], + browser_args=['--force-color-profile=hdr10']), + ] +
diff --git a/content/test/gpu/gpu_tests/skia_gold_integration_test_base.py b/content/test/gpu/gpu_tests/skia_gold_integration_test_base.py index 6f7d48c..6b693bc 100644 --- a/content/test/gpu/gpu_tests/skia_gold_integration_test_base.py +++ b/content/test/gpu/gpu_tests/skia_gold_integration_test_base.py
@@ -77,7 +77,7 @@ _skia_gold_temp_dir = None _local_run = None - _build_revision = None + _git_revision = None @classmethod def SetParsedCommandLineOptions(cls, options): @@ -102,12 +102,16 @@ def _AddDefaultArgs(browser_args): if not browser_args: browser_args = [] + force_color_profile_arg = [ + arg for arg in browser_args if arg.startswith('--force-color-profile=') + ] + if not force_color_profile_arg: + browser_args = browser_args + [ + '--force-color-profile=srgb', + '--ensure-forced-color-profile', + ] # All tests receive the following options. - return [ - '--force-color-profile=srgb', - '--ensure-forced-color-profile', - '--enable-gpu-benchmarking', - '--test-type=gpu'] + browser_args + return browser_args + ['--enable-gpu-benchmarking', '--test-type=gpu'] @classmethod def StopBrowser(cls): @@ -123,7 +127,7 @@ def AddCommandlineArgs(cls, parser): super(SkiaGoldIntegrationTestBase, cls).AddCommandlineArgs(parser) parser.add_option( - '--build-revision', + '--git-revision', help='Chrome revision being tested.', default=None) parser.add_option( @@ -140,15 +144,15 @@ 'profile after the test completes; leave the system using the sRGB color ' 'profile. See http://crbug.com/784456.') parser.add_option( - '--review-patch-issue', + '--gerrit-issue', help='For Skia Gold integration. Gerrit issue ID.', default='') parser.add_option( - '--review-patch-set', + '--gerrit-patchset', help='For Skia Gold integration. Gerrit patch set number.', default='') parser.add_option( - '--buildbucket-build-id', + '--buildbucket-id', help='For Skia Gold integration. Buildbucket build ID.', default='') parser.add_option( @@ -335,16 +339,15 @@ '--commit', self._GetBuildRevision(), ] - # If --review-patch-issue is passed, then we assume we're running on a - # trybot. - if parsed_options.review_patch_issue: + # If --gerrit-issue is passed, then we assume we're running on a trybot. + if parsed_options.gerrit_issue: build_id_args += [ '--issue', - parsed_options.review_patch_issue, + parsed_options.gerrit_issue, '--patchset', - parsed_options.review_patch_set, + parsed_options.gerrit_patchset, '--jobid', - parsed_options.buildbucket_build_id, + parsed_options.buildbucket_id, '--crs', 'gerrit', '--cis', @@ -439,10 +442,10 @@ # If we're running on a trybot, instead generate a link to all results # for the CL so that the user can visit a single page instead of # clicking on multiple links on potentially multiple bots. - elif parsed_options.review_patch_issue: + elif parsed_options.gerrit_issue: cl_images = ('https://%s-gold.skia.org/search?' 'issue=%s&new_clstore=true' % ( - SKIA_GOLD_INSTANCE, parsed_options.review_patch_issue)) + SKIA_GOLD_INSTANCE, parsed_options.gerrit_issue)) self.artifacts.CreateLink('triage_link_for_entire_cl', cl_images) else: try: @@ -503,7 +506,7 @@ # grace period. However, fail if we're on a trybot so that as many images # can be triaged as possible before a new test is committed. if (page.grace_period_end and date.today() <= page.grace_period_end and - not parsed_options.review_patch_issue): + not parsed_options.gerrit_issue): return False return True @@ -570,25 +573,25 @@ @classmethod def _GetBuildRevision(cls): """Returns the current git master revision being tested.""" - # Do nothing if we've already determined the build revision. - if cls._build_revision is not None: + # Do nothing if we've already determined the git revision. + if cls._git_revision is not None: pass - # use the --build-revision value if it's been set. - elif cls.GetParsedCommandLineOptions().build_revision: - cls._build_revision = cls.GetParsedCommandLineOptions().build_revision + # use the --git-revision value if it's been set. + elif cls.GetParsedCommandLineOptions().git_revision: + cls._git_revision = cls.GetParsedCommandLineOptions().git_revision # Try to determine what revision we're on using git. else: try: - cls._build_revision = subprocess.check_output( + cls._git_revision = subprocess.check_output( ['git', 'rev-parse', 'origin/master'], shell=IsWin(), cwd=path_util.GetChromiumSrcDir()).strip() - logging.warning('Automatically determined build revision to be %s', - cls._build_revision) + logging.warning('Automatically determined git revision to be %s', + cls._git_revision) except subprocess.CalledProcessError: - raise Exception('--build-revision not passed, and unable to ' + raise Exception('--git-revision not passed, and unable to ' 'determine revision using git') - return cls._build_revision + return cls._git_revision @classmethod def GenerateGpuTests(cls, options):
diff --git a/content/test/gpu/gpu_tests/test_expectations/pixel_expectations.txt b/content/test/gpu/gpu_tests/test_expectations/pixel_expectations.txt index 257fa57..5363314b 100644 --- a/content/test/gpu/gpu_tests/test_expectations/pixel_expectations.txt +++ b/content/test/gpu/gpu_tests/test_expectations/pixel_expectations.txt
@@ -210,3 +210,8 @@ # VP9 appears to not recover correctly after GPU process crashes on Windows. crbug.com/1033982 [ win nvidia ] Pixel_Video_Context_Loss_VP9 [ RetryOnFailure ] + +# HDR rendering with PQ color space appears to be broken on Windows RS2. +# TODO(sunnyps): Revert this temporary suppression after ensuring pixel tests +# always run on Windows RS3 or above. +crbug.com/1066979 [ win ] Pixel_Canvas2DRedBoxHdr10 [ Skip ]
diff --git a/content/test/gpu/gpu_tests/test_expectations/webgl2_conformance_expectations.txt b/content/test/gpu/gpu_tests/test_expectations/webgl2_conformance_expectations.txt index 2cbed90..2b598bc 100644 --- a/content/test/gpu/gpu_tests/test_expectations/webgl2_conformance_expectations.txt +++ b/content/test/gpu/gpu_tests/test_expectations/webgl2_conformance_expectations.txt
@@ -174,7 +174,6 @@ crbug.com/angleproject/2291 [ win no-use-gl ] conformance2/rendering/framebuffer-texture-changing-base-level.html [ Failure ] crbug.com/angleproject/3033 [ win no-passthrough ] conformance2/textures/misc/generate-mipmap-with-large-base-level.html [ Failure ] crbug.com/angleproject/1465 [ win no-use-gl ] conformance2/glsl3/tricky-loop-conditions.html [ Failure ] -crbug.com/951628 [ win no-passthrough ] conformance/rendering/blending.html [ Failure ] # Win / NVidia crbug.com/631317 [ d3d11 win nvidia ] deqp/functional/gles3/fbomultisample* [ RetryOnFailure ] @@ -278,7 +277,6 @@ crbug.com/989050 [ d3d11 win7 amd ] conformance2/textures/misc/tex-unpack-params-imagedata.html [ RetryOnFailure ] # Passthrough command decoder -crbug.com/951628 [ passthrough ] conformance/rendering/blending.html [ Failure ] crbug.com/953120 [ passthrough ] conformance/programs/program-test.html [ Failure ] # Passthrough command decoder / OpenGL / Windows @@ -611,9 +609,6 @@ # Linux failures # #################### -# Intel failed issues -crbug.com/950552 [ linux intel no-passthrough ] conformance2/textures/misc/tex-3d-size-limit.html [ Failure ] - # Intel driver issues crbug.com/950552 [ linux intel mesa_lt_19.1.2 ] conformance2/textures/misc/tex-base-level-bug.html [ Failure ]
diff --git a/content/test/gpu/gpu_tests/test_expectations/webgl_conformance_expectations.txt b/content/test/gpu/gpu_tests/test_expectations/webgl_conformance_expectations.txt index 3f739032..8544745 100644 --- a/content/test/gpu/gpu_tests/test_expectations/webgl_conformance_expectations.txt +++ b/content/test/gpu/gpu_tests/test_expectations/webgl_conformance_expectations.txt
@@ -20,7 +20,6 @@ # =================================== # It's expected that not all extensions will be available on all platforms. # Having a test listed here is not necessarily a problem. -[ win vulkan passthrough ] WebglExtension_EXT_float_blend [ Failure ] # Skip these, rather than expect them to fail, to speed up test # execution. The browser is restarted even after expected test @@ -134,6 +133,9 @@ crbug.com/angleproject/2722 [ vulkan passthrough ] conformance/textures/misc/copy-tex-image-and-sub-image-2d.html [ Failure ] crbug.com/angleproject/2914 [ vulkan passthrough ] conformance/textures/misc/texture-copying-feedback-loops.html [ Failure ] crbug.com/angleproject/2722 [ vulkan passthrough ] conformance/textures/misc/texture-mips.html [ Failure ] +crbug.com/1063472 [ intel vulkan passthrough ] conformance/extensions/webgl-compressed-texture-astc.html [ Failure ] +crbug.com/1063472 [ intel vulkan passthrough ] conformance/extensions/webgl-compressed-texture-s3tc-srgb.html [ Failure ] +crbug.com/1063472 [ intel vulkan passthrough ] conformance/extensions/webgl-compressed-texture-s3tc.html [ Failure ] #################### # Win failures # @@ -148,9 +150,6 @@ crbug.com/854100 [ win intel opengl passthrough intel_lt_25.20.100.6577 ] conformance/glsl/variables/gl-pointcoord.html [ Failure ] crbug.com/angleproject/2909 [ win intel vulkan passthrough intel_lt_26.20.100.7000 ] conformance/ogles/GL/faceforward/faceforward_001_to_006.html [ Failure ] crbug.com/angleproject/2722 [ win intel vulkan passthrough intel_lt_26.20.100.7323 ] conformance/rendering/clipping-wide-points.html [ Failure ] -crbug.com/1063472 [ win intel vulkan passthrough ] conformance/extensions/webgl-compressed-texture-astc.html [ Failure ] -crbug.com/1063472 [ win intel vulkan passthrough ] conformance/extensions/webgl-compressed-texture-s3tc-srgb.html [ Failure ] -crbug.com/1063472 [ win intel vulkan passthrough ] conformance/extensions/webgl-compressed-texture-s3tc.html [ Failure ] # This is an OpenGL driver bug on Intel platform and it is fixed in # Intel Driver 25.20.100.6444. @@ -366,8 +365,8 @@ # Linux / Vulkan / Passthrough command decoder crbug.com/angleproject/3469 [ linux vulkan passthrough intel ] conformance/extensions/webgl-draw-buffers.html [ Failure ] -crbug.com/1021428 [ linux vulkan passthrough intel ] conformance/rendering/scissor-rect-repeated-rendering.html [ Failure ] -crbug.com/1021428 [ linux vulkan passthrough intel ] WebglExtension_EXT_float_blend [ Failure ] +crbug.com/1021428 [ linux vulkan passthrough intel ] conformance/rendering/rendering-sampling-feedback-loop.html [ Failure ] +crbug.com/1021428 [ linux vulkan passthrough intel ] WebglExtension_EXT_shader_texture_lod [ Failure ] crbug.com/1021428 [ linux vulkan passthrough intel ] WebglExtension_WEBGL_depth_texture [ Failure ] # NVIDIA
diff --git a/device/bluetooth/bluez/bluetooth_adapter_bluez.cc b/device/bluetooth/bluez/bluetooth_adapter_bluez.cc index 7abc304..786800c 100644 --- a/device/bluetooth/bluez/bluetooth_adapter_bluez.cc +++ b/device/bluetooth/bluez/bluetooth_adapter_bluez.cc
@@ -352,9 +352,9 @@ ->GetBluetoothAdapterClient() ->GetProperties(object_path_) ->alias.Set( - name, - base::Bind(&BluetoothAdapterBlueZ::OnPropertyChangeCompleted, - weak_ptr_factory_.GetWeakPtr(), callback, error_callback)); + name, base::BindOnce( + &BluetoothAdapterBlueZ::OnPropertyChangeCompleted, + weak_ptr_factory_.GetWeakPtr(), callback, error_callback)); } bool BluetoothAdapterBlueZ::IsInitialized() const { @@ -393,8 +393,9 @@ ->GetProperties(object_path_) ->powered.Set( powered, - base::Bind(&BluetoothAdapterBlueZ::OnPropertyChangeCompleted, - weak_ptr_factory_.GetWeakPtr(), callback, error_callback)); + base::BindOnce(&BluetoothAdapterBlueZ::OnPropertyChangeCompleted, + weak_ptr_factory_.GetWeakPtr(), callback, + error_callback)); } bool BluetoothAdapterBlueZ::IsDiscoverable() const { @@ -425,8 +426,9 @@ ->GetProperties(object_path_) ->discoverable.Set( discoverable, - base::Bind(&BluetoothAdapterBlueZ::OnSetDiscoverable, - weak_ptr_factory_.GetWeakPtr(), callback, error_callback)); + base::BindOnce(&BluetoothAdapterBlueZ::OnSetDiscoverable, + weak_ptr_factory_.GetWeakPtr(), callback, + error_callback)); } uint32_t BluetoothAdapterBlueZ::GetDiscoverableTimeout() const { @@ -559,7 +561,7 @@ ->GetBluetoothLEAdvertisingManagerClient() ->SetAdvertisingInterval( object_path_, min_ms, max_ms, callback, - base::Bind(&SetIntervalErrorCallbackConnector, error_callback)); + base::BindOnce(&SetIntervalErrorCallbackConnector, error_callback)); } void BluetoothAdapterBlueZ::ResetAdvertising( @@ -568,9 +570,9 @@ DCHECK(bluez::BluezDBusManager::Get()); bluez::BluezDBusManager::Get() ->GetBluetoothLEAdvertisingManagerClient() - ->ResetAdvertising( - object_path_, callback, - base::Bind(&ResetAdvertisingErrorCallbackConnector, error_callback)); + ->ResetAdvertising(object_path_, callback, + base::BindOnce(&ResetAdvertisingErrorCallbackConnector, + error_callback)); } device::BluetoothLocalGattService* BluetoothAdapterBlueZ::GetGattService( @@ -985,8 +987,8 @@ ->GetBluetoothAdapterClient() ->CreateServiceRecord( object_path_, record, callback, - base::Bind(&BluetoothAdapterBlueZ::ServiceRecordErrorConnector, - weak_ptr_factory_.GetWeakPtr(), error_callback)); + base::BindOnce(&BluetoothAdapterBlueZ::ServiceRecordErrorConnector, + weak_ptr_factory_.GetWeakPtr(), error_callback)); } void BluetoothAdapterBlueZ::RemoveServiceRecord( @@ -997,8 +999,8 @@ ->GetBluetoothAdapterClient() ->RemoveServiceRecord( object_path_, handle, callback, - base::Bind(&BluetoothAdapterBlueZ::ServiceRecordErrorConnector, - weak_ptr_factory_.GetWeakPtr(), error_callback)); + base::BindOnce(&BluetoothAdapterBlueZ::ServiceRecordErrorConnector, + weak_ptr_factory_.GetWeakPtr(), error_callback)); } BluetoothDeviceBlueZ* BluetoothAdapterBlueZ::GetDeviceWithPath( @@ -1481,9 +1483,9 @@ ->GetBluetoothAdapterClient() ->GetProperties(object_path_) ->discoverable_timeout.Set( - 0, - base::Bind(&BluetoothAdapterBlueZ::OnPropertyChangeCompleted, - weak_ptr_factory_.GetWeakPtr(), callback, error_callback)); + 0, base::BindOnce(&BluetoothAdapterBlueZ::OnPropertyChangeCompleted, + weak_ptr_factory_.GetWeakPtr(), callback, + error_callback)); } void BluetoothAdapterBlueZ::OnPropertyChangeCompleted( @@ -1569,7 +1571,7 @@ // This is the first request to start device discovery. bluez::BluezDBusManager::Get()->GetBluetoothAdapterClient()->StartDiscovery( object_path_, - base::BindRepeating( + base::BindOnce( &BluetoothAdapterBlueZ::OnStartDiscovery, weak_ptr_factory_.GetWeakPtr(), base::BindRepeating(copyable_callback, /*is_error=*/false, @@ -1605,7 +1607,7 @@ auto copyable_callback = base::AdaptCallbackForRepeating(std::move(callback)); bluez::BluezDBusManager::Get()->GetBluetoothAdapterClient()->StopDiscovery( object_path_, - base::BindRepeating( + base::BindOnce( &BluetoothAdapterBlueZ::OnStopDiscovery, weak_ptr_factory_.GetWeakPtr(), base::BindRepeating(copyable_callback, /*is_error=*/false, @@ -1664,9 +1666,9 @@ ->GetBluetoothAdapterClient() ->SetDiscoveryFilter( object_path_, dbus_discovery_filter, - base::BindRepeating(&BluetoothAdapterBlueZ::OnSetDiscoveryFilter, - weak_ptr_factory_.GetWeakPtr(), callback, - copyable_error_callback), + base::BindOnce(&BluetoothAdapterBlueZ::OnSetDiscoveryFilter, + weak_ptr_factory_.GetWeakPtr(), callback, + copyable_error_callback), base::BindOnce(&BluetoothAdapterBlueZ::OnSetDiscoveryFilterError, weak_ptr_factory_.GetWeakPtr(), callback, copyable_error_callback)); @@ -1744,9 +1746,9 @@ base::AdaptCallbackForRepeating(std::move(error_callback)); bluez::BluezDBusManager::Get()->GetBluetoothAdapterClient()->StartDiscovery( object_path_, - base::BindRepeating(&BluetoothAdapterBlueZ::OnStartDiscovery, - weak_ptr_factory_.GetWeakPtr(), callback, - copyable_error_callback), + base::BindOnce(&BluetoothAdapterBlueZ::OnStartDiscovery, + weak_ptr_factory_.GetWeakPtr(), callback, + copyable_error_callback), base::BindOnce(&BluetoothAdapterBlueZ::OnStartDiscoveryError, weak_ptr_factory_.GetWeakPtr(), callback, copyable_error_callback));
diff --git a/device/bluetooth/bluez/bluetooth_adapter_profile_bluez_unittest.cc b/device/bluetooth/bluez/bluetooth_adapter_profile_bluez_unittest.cc index 39b289a..9bce702e 100644 --- a/device/bluetooth/bluez/bluetooth_adapter_profile_bluez_unittest.cc +++ b/device/bluetooth/bluez/bluetooth_adapter_profile_bluez_unittest.cc
@@ -225,10 +225,11 @@ bluez::BluezDBusManager::Get()->GetBluetoothDeviceClient()->ConnectProfile( dbus::ObjectPath(bluez::FakeBluetoothDeviceClient::kPairedDevicePath), bluez::FakeBluetoothProfileManagerClient::kRfcommUuid, - base::Bind(&BluetoothAdapterProfileBlueZTest::DBusConnectSuccessCallback, - base::Unretained(this)), - base::Bind(&BluetoothAdapterProfileBlueZTest::DBusErrorCallback, - base::Unretained(this))); + base::BindOnce( + &BluetoothAdapterProfileBlueZTest::DBusConnectSuccessCallback, + base::Unretained(this)), + base::BindOnce(&BluetoothAdapterProfileBlueZTest::DBusErrorCallback, + base::Unretained(this))); base::RunLoop().RunUntilIdle(); @@ -267,10 +268,11 @@ bluez::BluezDBusManager::Get()->GetBluetoothDeviceClient()->ConnectProfile( dbus::ObjectPath(bluez::FakeBluetoothDeviceClient::kPairedDevicePath), bluez::FakeBluetoothProfileManagerClient::kRfcommUuid, - base::Bind(&BluetoothAdapterProfileBlueZTest::DBusConnectSuccessCallback, - base::Unretained(this)), - base::Bind(&BluetoothAdapterProfileBlueZTest::DBusErrorCallback, - base::Unretained(this))); + base::BindOnce( + &BluetoothAdapterProfileBlueZTest::DBusConnectSuccessCallback, + base::Unretained(this)), + base::BindOnce(&BluetoothAdapterProfileBlueZTest::DBusErrorCallback, + base::Unretained(this))); base::RunLoop().RunUntilIdle(); @@ -282,10 +284,11 @@ bluez::BluezDBusManager::Get()->GetBluetoothDeviceClient()->ConnectProfile( dbus::ObjectPath(bluez::FakeBluetoothDeviceClient::kLegacyAutopairPath), bluez::FakeBluetoothProfileManagerClient::kRfcommUuid, - base::Bind(&BluetoothAdapterProfileBlueZTest::DBusConnectSuccessCallback, - base::Unretained(this)), - base::Bind(&BluetoothAdapterProfileBlueZTest::DBusErrorCallback, - base::Unretained(this))); + base::BindOnce( + &BluetoothAdapterProfileBlueZTest::DBusConnectSuccessCallback, + base::Unretained(this)), + base::BindOnce(&BluetoothAdapterProfileBlueZTest::DBusErrorCallback, + base::Unretained(this))); base::RunLoop().RunUntilIdle(); @@ -298,10 +301,11 @@ bluez::BluezDBusManager::Get()->GetBluetoothDeviceClient()->ConnectProfile( dbus::ObjectPath(bluez::FakeBluetoothDeviceClient::kDisplayPinCodePath), bluez::FakeBluetoothProfileManagerClient::kRfcommUuid, - base::Bind(&BluetoothAdapterProfileBlueZTest::DBusConnectSuccessCallback, - base::Unretained(this)), - base::Bind(&BluetoothAdapterProfileBlueZTest::DBusErrorCallback, - base::Unretained(this))); + base::BindOnce( + &BluetoothAdapterProfileBlueZTest::DBusConnectSuccessCallback, + base::Unretained(this)), + base::BindOnce(&BluetoothAdapterProfileBlueZTest::DBusErrorCallback, + base::Unretained(this))); base::RunLoop().RunUntilIdle();
diff --git a/device/bluetooth/bluez/bluetooth_advertisement_bluez.cc b/device/bluetooth/bluez/bluetooth_advertisement_bluez.cc index 2436b4b5..5d40d14 100644 --- a/device/bluetooth/bluez/bluetooth_advertisement_bluez.cc +++ b/device/bluetooth/bluez/bluetooth_advertisement_bluez.cc
@@ -99,7 +99,7 @@ ->GetBluetoothLEAdvertisingManagerClient() ->RegisterAdvertisement( adapter_path_, provider_->object_path(), success_callback, - base::Bind(&RegisterErrorCallbackConnector, error_callback)); + base::BindOnce(&RegisterErrorCallbackConnector, error_callback)); } BluetoothAdvertisementBlueZ::~BluetoothAdvertisementBlueZ() { @@ -122,7 +122,7 @@ ->GetBluetoothLEAdvertisingManagerClient() ->UnregisterAdvertisement( adapter_path_, provider_->object_path(), success_callback, - base::Bind(&UnregisterErrorCallbackConnector, error_callback)); + base::BindOnce(&UnregisterErrorCallbackConnector, error_callback)); provider_.reset(); }
diff --git a/device/bluetooth/bluez/bluetooth_bluez_unittest.cc b/device/bluetooth/bluez/bluetooth_bluez_unittest.cc index b7c5eec..fa867f0a 100644 --- a/device/bluetooth/bluez/bluetooth_bluez_unittest.cc +++ b/device/bluetooth/bluez/bluetooth_bluez_unittest.cc
@@ -276,7 +276,7 @@ // Call to fill the adapter_ member with a BluetoothAdapter instance. void GetAdapter() { - adapter_ = new BluetoothAdapterBlueZ(base::Bind( + adapter_ = new BluetoothAdapterBlueZ(base::BindOnce( &BluetoothBlueZTest::AdapterCallback, base::Unretained(this))); base::RunLoop().Run(); ASSERT_TRUE(adapter_.get() != nullptr); @@ -297,8 +297,8 @@ adapter_->SetPowered(true, GetCallback(), GetErrorCallback()); adapter_->StartDiscoverySession( - base::Bind(&BluetoothBlueZTest::DiscoverySessionCallback, - base::Unretained(this)), + base::BindOnce(&BluetoothBlueZTest::DiscoverySessionCallback, + base::Unretained(this)), GetErrorCallback()); base::RunLoop().Run(); ASSERT_EQ(2, callback_count_); @@ -691,8 +691,8 @@ adapter_->SetPowered(true, GetCallback(), GetErrorCallback()); adapter_->StartDiscoverySession( - base::Bind(&BluetoothBlueZTest::DiscoverySessionCallback, - base::Unretained(this)), + base::BindOnce(&BluetoothBlueZTest::DiscoverySessionCallback, + base::Unretained(this)), GetErrorCallback()); base::RunLoop().Run(); EXPECT_EQ(2, callback_count_); @@ -727,8 +727,8 @@ adapter_->SetPowered(true, GetCallback(), GetErrorCallback()); adapter_->StartDiscoverySession( - base::Bind(&BluetoothBlueZTest::DiscoverySessionCallback, - base::Unretained(this)), + base::BindOnce(&BluetoothBlueZTest::DiscoverySessionCallback, + base::Unretained(this)), GetErrorCallback()); base::RunLoop().Run(); EXPECT_EQ(2, callback_count_); @@ -764,8 +764,8 @@ GetAdapter(); adapter_->SetPowered(true, GetCallback(), GetErrorCallback()); adapter_->StartDiscoverySession( - base::Bind(&BluetoothBlueZTest::DiscoverySessionCallback, - base::Unretained(this)), + base::BindOnce(&BluetoothBlueZTest::DiscoverySessionCallback, + base::Unretained(this)), GetErrorCallback()); base::RunLoop().Run(); EXPECT_EQ(2, callback_count_); @@ -887,8 +887,8 @@ // StartDiscoverySession pending. base::RunLoop start_loop_2; adapter_->StartDiscoverySession( - base::Bind(&BluetoothBlueZTest::DiscoverySessionCallbackWithClosure, - base::Unretained(this), start_loop_2.QuitClosure()), + base::BindOnce(&BluetoothBlueZTest::DiscoverySessionCallbackWithClosure, + base::Unretained(this), start_loop_2.QuitClosure()), GetErrorCallback()); // Run loop waiting for DiscoveryChanged to be called in the observer @@ -923,8 +923,8 @@ // Request device discovery 3 times. for (int i = 0; i < 3; i++) { adapter_->StartDiscoverySession( - base::Bind(&BluetoothBlueZTest::DiscoverySessionCallback, - base::Unretained(this)), + base::BindOnce(&BluetoothBlueZTest::DiscoverySessionCallback, + base::Unretained(this)), GetErrorCallback()); } @@ -955,8 +955,8 @@ // Request device discovery 3 times. for (int i = 0; i < 3; i++) { adapter_->StartDiscoverySession( - base::Bind(&BluetoothBlueZTest::DiscoverySessionCallback, - base::Unretained(this)), + base::BindOnce(&BluetoothBlueZTest::DiscoverySessionCallback, + base::Unretained(this)), GetErrorCallback()); } @@ -1005,8 +1005,8 @@ // Request device discovery 3 times. for (int i = 0; i < 3; i++) { adapter_->StartDiscoverySession( - base::Bind(&BluetoothBlueZTest::DiscoverySessionCallback, - base::Unretained(this)), + base::BindOnce(&BluetoothBlueZTest::DiscoverySessionCallback, + base::Unretained(this)), GetErrorCallback()); } @@ -1043,8 +1043,8 @@ fake_bluetooth_adapter_client_->BluetoothAdapterClient::StopDiscovery( dbus::ObjectPath(bluez::FakeBluetoothAdapterClient::kAdapterPath), GetCallback(), - base::Bind(&BluetoothBlueZTest::DBusErrorCallback, - base::Unretained(this))); + base::BindOnce(&BluetoothBlueZTest::DBusErrorCallback, + base::Unretained(this))); base::RunLoop().Run(); EXPECT_EQ(2, observer.discovering_changed_count()); EXPECT_EQ(4, callback_count_); @@ -1060,8 +1060,8 @@ // It should be possible to successfully start discovery. for (int i = 0; i < 2; i++) { adapter_->StartDiscoverySession( - base::Bind(&BluetoothBlueZTest::DiscoverySessionCallback, - base::Unretained(this)), + base::BindOnce(&BluetoothBlueZTest::DiscoverySessionCallback, + base::Unretained(this)), GetErrorCallback()); } @@ -1108,8 +1108,8 @@ // application other than us. Starting and stopping discovery will succeed // but it won't cause the discovery state to change. adapter_->StartDiscoverySession( - base::Bind(&BluetoothBlueZTest::DiscoverySessionCallback, - base::Unretained(this)), + base::BindOnce(&BluetoothBlueZTest::DiscoverySessionCallback, + base::Unretained(this)), GetErrorCallback()); // Run the loop, as there should have been a D-Bus call. base::RunLoop().Run(); @@ -1129,8 +1129,8 @@ // Start discovery again. adapter_->StartDiscoverySession( - base::Bind(&BluetoothBlueZTest::DiscoverySessionCallback, - base::Unretained(this)), + base::BindOnce(&BluetoothBlueZTest::DiscoverySessionCallback, + base::Unretained(this)), GetErrorCallback()); // Run the loop, as there should have been a D-Bus call. base::RunLoop().Run(); @@ -1148,8 +1148,8 @@ fake_bluetooth_adapter_client_->BluetoothAdapterClient::StopDiscovery( dbus::ObjectPath(bluez::FakeBluetoothAdapterClient::kAdapterPath), GetCallback(), - base::Bind(&BluetoothBlueZTest::DBusErrorCallback, - base::Unretained(this))); + base::BindOnce(&BluetoothBlueZTest::DBusErrorCallback, + base::Unretained(this))); base::RunLoop().Run(); EXPECT_EQ(5, observer.discovering_changed_count()); EXPECT_EQ(9, callback_count_); @@ -1186,8 +1186,8 @@ // Request device discovery 3 times. for (int i = 0; i < 3; i++) { adapter_->StartDiscoverySession( - base::Bind(&BluetoothBlueZTest::DiscoverySessionCallback, - base::Unretained(this)), + base::BindOnce(&BluetoothBlueZTest::DiscoverySessionCallback, + base::Unretained(this)), GetErrorCallback()); // Run loop every time as we are calling dbus on every session start. base::RunLoop().Run(); @@ -1227,8 +1227,8 @@ fake_bluetooth_adapter_client_->BluetoothAdapterClient::StopDiscovery( dbus::ObjectPath(bluez::FakeBluetoothAdapterClient::kAdapterPath), GetCallback(), - base::Bind(&BluetoothBlueZTest::DBusErrorCallback, - base::Unretained(this))); + base::BindOnce(&BluetoothBlueZTest::DBusErrorCallback, + base::Unretained(this))); base::RunLoop().Run(); EXPECT_EQ(2, observer.discovering_changed_count()); EXPECT_EQ(4, callback_count_); @@ -1256,8 +1256,8 @@ // Request a new discovery session. adapter_->StartDiscoverySession( - base::Bind(&BluetoothBlueZTest::DiscoverySessionCallback, - base::Unretained(this)), + base::BindOnce(&BluetoothBlueZTest::DiscoverySessionCallback, + base::Unretained(this)), GetErrorCallback()); base::RunLoop().Run(); EXPECT_EQ(1, observer.discovering_changed_count()); @@ -1272,8 +1272,8 @@ // in turn will destroy the previous session. Adapter should still be // discovering and the reference count should be 1. adapter_->StartDiscoverySession( - base::Bind(&BluetoothBlueZTest::DiscoverySessionCallback, - base::Unretained(this)), + base::BindOnce(&BluetoothBlueZTest::DiscoverySessionCallback, + base::Unretained(this)), GetErrorCallback()); base::RunLoop().Run(); EXPECT_EQ(1, observer.discovering_changed_count()); @@ -1286,8 +1286,8 @@ // Request a new session. adapter_->StartDiscoverySession( - base::Bind(&BluetoothBlueZTest::DiscoverySessionCallback, - base::Unretained(this)), + base::BindOnce(&BluetoothBlueZTest::DiscoverySessionCallback, + base::Unretained(this)), GetErrorCallback()); base::RunLoop().Run(); EXPECT_EQ(1, observer.discovering_changed_count()); @@ -1342,9 +1342,10 @@ auto* comparison_filter_holder = discovery_filter.get(); adapter_->StartDiscoverySessionWithFilter( std::move(discovery_filter), - base::Bind(&BluetoothBlueZTest::DiscoverySessionCallback, - base::Unretained(this)), - base::Bind(&BluetoothBlueZTest::ErrorCallback, base::Unretained(this))); + base::BindOnce(&BluetoothBlueZTest::DiscoverySessionCallback, + base::Unretained(this)), + base::BindOnce(&BluetoothBlueZTest::ErrorCallback, + base::Unretained(this))); base::RunLoop().Run(); EXPECT_EQ(2, callback_count_); EXPECT_EQ(0, error_callback_count_); @@ -1402,9 +1403,10 @@ adapter_->StartDiscoverySessionWithFilter( std::move(discovery_filter), - base::Bind(&BluetoothBlueZTest::DiscoverySessionCallback, - base::Unretained(this)), - base::Bind(&BluetoothBlueZTest::ErrorCallback, base::Unretained(this))); + base::BindOnce(&BluetoothBlueZTest::DiscoverySessionCallback, + base::Unretained(this)), + base::BindOnce(&BluetoothBlueZTest::ErrorCallback, + base::Unretained(this))); base::RunLoop().Run(); @@ -1465,9 +1467,10 @@ adapter_->StartDiscoverySessionWithFilter( std::move(discovery_filter), - base::Bind(&BluetoothBlueZTest::DiscoverySessionCallback, - base::Unretained(this)), - base::Bind(&BluetoothBlueZTest::ErrorCallback, base::Unretained(this))); + base::BindOnce(&BluetoothBlueZTest::DiscoverySessionCallback, + base::Unretained(this)), + base::BindOnce(&BluetoothBlueZTest::ErrorCallback, + base::Unretained(this))); base::RunLoop().Run(); @@ -1590,9 +1593,10 @@ adapter_->StartDiscoverySessionWithFilter( std::move(discovery_filter), - base::Bind(&BluetoothBlueZTest::DiscoverySessionCallback, - base::Unretained(this)), - base::Bind(&BluetoothBlueZTest::ErrorCallback, base::Unretained(this))); + base::BindOnce(&BluetoothBlueZTest::DiscoverySessionCallback, + base::Unretained(this)), + base::BindOnce(&BluetoothBlueZTest::ErrorCallback, + base::Unretained(this))); base::RunLoop().Run(); @@ -1665,9 +1669,10 @@ adapter_->StartDiscoverySessionWithFilter( std::move(discovery_filter), - base::Bind(&BluetoothBlueZTest::DiscoverySessionCallback, - base::Unretained(this)), - base::Bind(&BluetoothBlueZTest::ErrorCallback, base::Unretained(this))); + base::BindOnce(&BluetoothBlueZTest::DiscoverySessionCallback, + base::Unretained(this)), + base::BindOnce(&BluetoothBlueZTest::ErrorCallback, + base::Unretained(this))); base::RunLoop().Run(); @@ -1688,9 +1693,10 @@ adapter_->StartDiscoverySessionWithFilter( std::move(discovery_filter), - base::Bind(&BluetoothBlueZTest::DiscoverySessionCallback, - base::Unretained(this)), - base::Bind(&BluetoothBlueZTest::ErrorCallback, base::Unretained(this))); + base::BindOnce(&BluetoothBlueZTest::DiscoverySessionCallback, + base::Unretained(this)), + base::BindOnce(&BluetoothBlueZTest::ErrorCallback, + base::Unretained(this))); base::RunLoop().Run(); @@ -1716,9 +1722,10 @@ adapter_->StartDiscoverySessionWithFilter( std::move(discovery_filter3), - base::Bind(&BluetoothBlueZTest::DiscoverySessionCallback, - base::Unretained(this)), - base::Bind(&BluetoothBlueZTest::ErrorCallback, base::Unretained(this))); + base::BindOnce(&BluetoothBlueZTest::DiscoverySessionCallback, + base::Unretained(this)), + base::BindOnce(&BluetoothBlueZTest::ErrorCallback, + base::Unretained(this))); base::RunLoop().Run(); @@ -1734,9 +1741,10 @@ // start additionally classic scan adapter_->StartDiscoverySession( - base::Bind(&BluetoothBlueZTest::DiscoverySessionCallback, - base::Unretained(this)), - base::Bind(&BluetoothBlueZTest::ErrorCallback, base::Unretained(this))); + base::BindOnce(&BluetoothBlueZTest::DiscoverySessionCallback, + base::Unretained(this)), + base::BindOnce(&BluetoothBlueZTest::ErrorCallback, + base::Unretained(this))); base::RunLoop().Run(); @@ -3537,8 +3545,9 @@ fake_bluetooth_device_client_->SimulatePairing( dbus::ObjectPath(bluez::FakeBluetoothDeviceClient::kRequestPinCodePath), - true, GetCallback(), base::Bind(&BluetoothBlueZTest::DBusErrorCallback, - base::Unretained(this))); + true, GetCallback(), + base::BindOnce(&BluetoothBlueZTest::DBusErrorCallback, + base::Unretained(this))); EXPECT_EQ(1, pairing_delegate.call_count_); EXPECT_EQ(1, pairing_delegate.request_pincode_count_); @@ -3590,8 +3599,9 @@ fake_bluetooth_device_client_->SimulatePairing( dbus::ObjectPath(bluez::FakeBluetoothDeviceClient::kConfirmPasskeyPath), - true, GetCallback(), base::Bind(&BluetoothBlueZTest::DBusErrorCallback, - base::Unretained(this))); + true, GetCallback(), + base::BindOnce(&BluetoothBlueZTest::DBusErrorCallback, + base::Unretained(this))); EXPECT_EQ(1, pairing_delegate.call_count_); EXPECT_EQ(1, pairing_delegate.confirm_passkey_count_); @@ -3644,8 +3654,9 @@ fake_bluetooth_device_client_->SimulatePairing( dbus::ObjectPath(bluez::FakeBluetoothDeviceClient::kRequestPasskeyPath), - true, GetCallback(), base::Bind(&BluetoothBlueZTest::DBusErrorCallback, - base::Unretained(this))); + true, GetCallback(), + base::BindOnce(&BluetoothBlueZTest::DBusErrorCallback, + base::Unretained(this))); EXPECT_EQ(1, pairing_delegate.call_count_); EXPECT_EQ(1, pairing_delegate.request_passkey_count_); @@ -3698,8 +3709,9 @@ fake_bluetooth_device_client_->SimulatePairing( dbus::ObjectPath(bluez::FakeBluetoothDeviceClient::kJustWorksPath), true, - GetCallback(), base::Bind(&BluetoothBlueZTest::DBusErrorCallback, - base::Unretained(this))); + GetCallback(), + base::BindOnce(&BluetoothBlueZTest::DBusErrorCallback, + base::Unretained(this))); EXPECT_EQ(1, pairing_delegate.call_count_); EXPECT_EQ(1, pairing_delegate.authorize_pairing_count_); @@ -3748,8 +3760,9 @@ fake_bluetooth_device_client_->SimulatePairing( dbus::ObjectPath(bluez::FakeBluetoothDeviceClient::kRequestPinCodePath), - true, GetCallback(), base::Bind(&BluetoothBlueZTest::DBusErrorCallback, - base::Unretained(this))); + true, GetCallback(), + base::BindOnce(&BluetoothBlueZTest::DBusErrorCallback, + base::Unretained(this))); base::RunLoop().Run(); @@ -3787,8 +3800,9 @@ fake_bluetooth_device_client_->SimulatePairing( dbus::ObjectPath(bluez::FakeBluetoothDeviceClient::kConfirmPasskeyPath), - true, GetCallback(), base::Bind(&BluetoothBlueZTest::DBusErrorCallback, - base::Unretained(this))); + true, GetCallback(), + base::BindOnce(&BluetoothBlueZTest::DBusErrorCallback, + base::Unretained(this))); base::RunLoop().Run(); @@ -3826,8 +3840,9 @@ fake_bluetooth_device_client_->SimulatePairing( dbus::ObjectPath(bluez::FakeBluetoothDeviceClient::kRequestPasskeyPath), - true, GetCallback(), base::Bind(&BluetoothBlueZTest::DBusErrorCallback, - base::Unretained(this))); + true, GetCallback(), + base::BindOnce(&BluetoothBlueZTest::DBusErrorCallback, + base::Unretained(this))); base::RunLoop().Run(); @@ -3865,8 +3880,9 @@ fake_bluetooth_device_client_->SimulatePairing( dbus::ObjectPath(bluez::FakeBluetoothDeviceClient::kJustWorksPath), true, - GetCallback(), base::Bind(&BluetoothBlueZTest::DBusErrorCallback, - base::Unretained(this))); + GetCallback(), + base::BindOnce(&BluetoothBlueZTest::DBusErrorCallback, + base::Unretained(this))); base::RunLoop().Run(); @@ -3907,8 +3923,9 @@ fake_bluetooth_device_client_->SimulatePairing( dbus::ObjectPath(bluez::FakeBluetoothDeviceClient::kRequestPasskeyPath), - true, GetCallback(), base::Bind(&BluetoothBlueZTest::DBusErrorCallback, - base::Unretained(this))); + true, GetCallback(), + base::BindOnce(&BluetoothBlueZTest::DBusErrorCallback, + base::Unretained(this))); EXPECT_EQ(1, pairing_delegate.call_count_); EXPECT_EQ(1, pairing_delegate.request_passkey_count_); @@ -4054,8 +4071,8 @@ adapter_->SetPowered(true, GetCallback(), GetErrorCallback()); adapter_->SetDiscoverable(true, GetCallback(), GetErrorCallback()); adapter_->StartDiscoverySession( - base::Bind(&BluetoothBlueZTest::DiscoverySessionCallback, - base::Unretained(this)), + base::BindOnce(&BluetoothBlueZTest::DiscoverySessionCallback, + base::Unretained(this)), GetErrorCallback()); base::RunLoop().Run(); ASSERT_EQ(3, callback_count_); @@ -4192,8 +4209,8 @@ EXPECT_EQ(1, error_callback_count_--) << "OnPropertyChangeCompleted error"; adapter_bluez->StartDiscoverySession( - base::BindRepeating(&BluetoothBlueZTest::DiscoverySessionCallback, - base::Unretained(this)), + base::BindOnce(&BluetoothBlueZTest::DiscoverySessionCallback, + base::Unretained(this)), GetErrorCallback()); EXPECT_EQ(0, callback_count_) << "AddDiscoverySession error"; EXPECT_EQ(1, error_callback_count_--) << "AddDiscoverySession error"; @@ -4233,8 +4250,8 @@ // From BluetoothAdapater: adapter_->StartDiscoverySession( - base::Bind(&BluetoothBlueZTest::DiscoverySessionCallback, - base::Unretained(this)), + base::BindOnce(&BluetoothBlueZTest::DiscoverySessionCallback, + base::Unretained(this)), GetErrorCallback()); EXPECT_EQ(0, callback_count_) << "StartDiscoverySession error"; EXPECT_EQ(1, error_callback_count_--) << "StartDiscoverySession error"; @@ -4260,7 +4277,7 @@ [&](std::unique_ptr<BluetoothDiscoverySession> session) { loop.Quit(); }), - base::BindRepeating([]() { + base::BindOnce([]() { ADD_FAILURE() << "Unexpected discovery session start error."; })); loop.Run(); @@ -4273,7 +4290,7 @@ [&](std::unique_ptr<BluetoothDiscoverySession> session) { loop.Quit(); }), - base::BindRepeating([]() { + base::BindOnce([]() { ADD_FAILURE() << "Unexpected discovery session start error."; })); loop.Run(); @@ -4289,8 +4306,8 @@ for (int i = 0; i < kNumberOfDiscoverySessions; i++) { adapter_bluez->StartDiscoverySession( - base::BindRepeating(&BluetoothBlueZTest::DiscoverySessionCallback, - base::Unretained(this)), + base::BindOnce(&BluetoothBlueZTest::DiscoverySessionCallback, + base::Unretained(this)), GetErrorCallback()); } adapter_->Shutdown(); @@ -4309,8 +4326,8 @@ for (int i = 0; i < kNumberOfDiscoverySessions; i++) { adapter_bluez->StartDiscoverySession( - base::BindRepeating(&BluetoothBlueZTest::DiscoverySessionCallback, - base::Unretained(this)), + base::BindOnce(&BluetoothBlueZTest::DiscoverySessionCallback, + base::Unretained(this)), GetErrorCallback()); } adapter_->Shutdown(); @@ -4327,10 +4344,9 @@ { base::RunLoop loop; adapter_->StartDiscoverySession( - base::BindRepeating( - [](std::unique_ptr<BluetoothDiscoverySession> session) { - ADD_FAILURE() << "Unexpected discovery session start success."; - }), + base::BindOnce([](std::unique_ptr<BluetoothDiscoverySession> session) { + ADD_FAILURE() << "Unexpected discovery session start success."; + }), loop.QuitClosure()); loop.Run(); } @@ -4342,7 +4358,7 @@ [&](std::unique_ptr<BluetoothDiscoverySession> session) { loop.Quit(); }), - base::BindRepeating([]() { + base::BindOnce([]() { ADD_FAILURE() << "Unexpected discovery session start error."; })); loop.Run();
diff --git a/device/bluetooth/bluez/bluetooth_device_bluez.cc b/device/bluetooth/bluez/bluetooth_device_bluez.cc index acccb50..fadcb54 100644 --- a/device/bluetooth/bluez/bluetooth_device_bluez.cc +++ b/device/bluetooth/bluez/bluetooth_device_bluez.cc
@@ -458,10 +458,10 @@ // currently connected. bluez::BluezDBusManager::Get()->GetBluetoothDeviceClient()->GetConnInfo( object_path_, - base::Bind(&BluetoothDeviceBlueZ::OnGetConnInfo, - weak_ptr_factory_.GetWeakPtr(), callback), - base::Bind(&BluetoothDeviceBlueZ::OnGetConnInfoError, - weak_ptr_factory_.GetWeakPtr(), callback)); + base::BindOnce(&BluetoothDeviceBlueZ::OnGetConnInfo, + weak_ptr_factory_.GetWeakPtr(), callback), + base::BindOnce(&BluetoothDeviceBlueZ::OnGetConnInfoError, + weak_ptr_factory_.GetWeakPtr(), callback)); } void BluetoothDeviceBlueZ::SetConnectionLatency( @@ -499,10 +499,10 @@ bluez::BluezDBusManager::Get()->GetBluetoothDeviceClient(); client->SetLEConnectionParameters( object_path_, connection_parameters, - base::Bind(&BluetoothDeviceBlueZ::OnSetLEConnectionParameters, - weak_ptr_factory_.GetWeakPtr(), callback), - base::Bind(&BluetoothDeviceBlueZ::OnSetLEConnectionParametersError, - weak_ptr_factory_.GetWeakPtr(), error_callback)); + base::BindOnce(&BluetoothDeviceBlueZ::OnSetLEConnectionParameters, + weak_ptr_factory_.GetWeakPtr(), callback), + base::BindOnce(&BluetoothDeviceBlueZ::OnSetLEConnectionParametersError, + weak_ptr_factory_.GetWeakPtr(), error_callback)); } void BluetoothDeviceBlueZ::Connect( @@ -556,11 +556,11 @@ bluez::BluezDBusManager::Get()->GetBluetoothDeviceClient()->Pair( object_path_, - base::Bind(&BluetoothDeviceBlueZ::OnPairDuringConnect, - weak_ptr_factory_.GetWeakPtr(), dupe_callback, - dupe_error_callback), - base::Bind(&BluetoothDeviceBlueZ::OnPairDuringConnectError, - weak_ptr_factory_.GetWeakPtr(), dupe_error_callback)); + base::BindOnce(&BluetoothDeviceBlueZ::OnPairDuringConnect, + weak_ptr_factory_.GetWeakPtr(), dupe_callback, + dupe_error_callback), + base::BindOnce(&BluetoothDeviceBlueZ::OnPairDuringConnectError, + weak_ptr_factory_.GetWeakPtr(), dupe_error_callback)); } } @@ -625,8 +625,8 @@ << "Sending explicit cancel"; bluez::BluezDBusManager::Get()->GetBluetoothDeviceClient()->CancelPairing( object_path_, base::DoNothing(), - base::Bind(&BluetoothDeviceBlueZ::OnCancelPairingError, - weak_ptr_factory_.GetWeakPtr())); + base::BindOnce(&BluetoothDeviceBlueZ::OnCancelPairingError, + weak_ptr_factory_.GetWeakPtr())); } // Since there is no callback to this method it's possible that the pairing @@ -641,10 +641,10 @@ BLUETOOTH_LOG(EVENT) << object_path_.value() << ": Disconnecting"; bluez::BluezDBusManager::Get()->GetBluetoothDeviceClient()->Disconnect( object_path_, - base::Bind(&BluetoothDeviceBlueZ::OnDisconnect, - weak_ptr_factory_.GetWeakPtr(), callback), - base::Bind(&BluetoothDeviceBlueZ::OnDisconnectError, - weak_ptr_factory_.GetWeakPtr(), error_callback)); + base::BindOnce(&BluetoothDeviceBlueZ::OnDisconnect, + weak_ptr_factory_.GetWeakPtr(), callback), + base::BindOnce(&BluetoothDeviceBlueZ::OnDisconnectError, + weak_ptr_factory_.GetWeakPtr(), error_callback)); } void BluetoothDeviceBlueZ::Forget(const base::Closure& callback, @@ -652,8 +652,8 @@ BLUETOOTH_LOG(EVENT) << object_path_.value() << ": Removing device"; bluez::BluezDBusManager::Get()->GetBluetoothAdapterClient()->RemoveDevice( adapter()->object_path(), object_path_, callback, - base::Bind(&BluetoothDeviceBlueZ::OnForgetError, - weak_ptr_factory_.GetWeakPtr(), error_callback)); + base::BindOnce(&BluetoothDeviceBlueZ::OnForgetError, + weak_ptr_factory_.GetWeakPtr(), error_callback)); } void BluetoothDeviceBlueZ::ConnectToService( @@ -694,8 +694,8 @@ const GetServiceRecordsErrorCallback& error_callback) { bluez::BluezDBusManager::Get()->GetBluetoothDeviceClient()->GetServiceRecords( object_path_, callback, - base::Bind(&BluetoothDeviceBlueZ::OnGetServiceRecordsError, - weak_ptr_factory_.GetWeakPtr(), error_callback)); + base::BindOnce(&BluetoothDeviceBlueZ::OnGetServiceRecordsError, + weak_ptr_factory_.GetWeakPtr(), error_callback)); } #if defined(OS_CHROMEOS) @@ -704,8 +704,8 @@ const ExecuteWriteErrorCallback& error_callback) { bluez::BluezDBusManager::Get()->GetBluetoothDeviceClient()->ExecuteWrite( object_path_, callback, - base::Bind(&BluetoothDeviceBlueZ::OnExecuteWriteError, - weak_ptr_factory_.GetWeakPtr(), error_callback)); + base::BindOnce(&BluetoothDeviceBlueZ::OnExecuteWriteError, + weak_ptr_factory_.GetWeakPtr(), error_callback)); } void BluetoothDeviceBlueZ::AbortWrite( @@ -713,8 +713,8 @@ const AbortWriteErrorCallback& error_callback) { bluez::BluezDBusManager::Get()->GetBluetoothDeviceClient()->AbortWrite( object_path_, callback, - base::Bind(&BluetoothDeviceBlueZ::OnAbortWriteError, - weak_ptr_factory_.GetWeakPtr(), error_callback)); + base::BindOnce(&BluetoothDeviceBlueZ::OnAbortWriteError, + weak_ptr_factory_.GetWeakPtr(), error_callback)); } #endif @@ -1076,8 +1076,8 @@ bluez::BluezDBusManager::Get() ->GetBluetoothDeviceClient() ->GetProperties(object_path_) - ->trusted.Set(true, base::Bind(&BluetoothDeviceBlueZ::OnSetTrusted, - weak_ptr_factory_.GetWeakPtr())); + ->trusted.Set(true, base::BindOnce(&BluetoothDeviceBlueZ::OnSetTrusted, + weak_ptr_factory_.GetWeakPtr())); } void BluetoothDeviceBlueZ::OnSetTrusted(bool success) { @@ -1114,10 +1114,10 @@ void BluetoothDeviceBlueZ::UnpauseDiscovery() { bluez::BluezDBusManager::Get()->GetBluetoothAdapterClient()->UnpauseDiscovery( - adapter()->object_path(), base::Bind([]() { + adapter()->object_path(), base::BindOnce([]() { BLUETOOTH_LOG(EVENT) << "Successfully un-paused discovery"; }), - base::Bind( + base::BindOnce( [](const std::string& error_name, const std::string& error_message) { BLUETOOTH_LOG(EVENT) << "Failed to un-pause discovery"; }));
diff --git a/device/bluetooth/bluez/bluetooth_gatt_bluez_unittest.cc b/device/bluetooth/bluez/bluetooth_gatt_bluez_unittest.cc index 797173e..1f14eb2 100644 --- a/device/bluetooth/bluez/bluetooth_gatt_bluez_unittest.cc +++ b/device/bluetooth/bluez/bluetooth_gatt_bluez_unittest.cc
@@ -431,10 +431,10 @@ ASSERT_EQ(0, error_callback_count_); device->CreateGattConnection( - base::Bind(&BluetoothGattBlueZTest::GattConnectionCallback, - base::Unretained(this)), - base::Bind(&BluetoothGattBlueZTest::ConnectErrorCallback, - base::Unretained(this))); + base::BindOnce(&BluetoothGattBlueZTest::GattConnectionCallback, + base::Unretained(this)), + base::BindOnce(&BluetoothGattBlueZTest::ConnectErrorCallback, + base::Unretained(this))); EXPECT_EQ(1, success_callback_count_); EXPECT_EQ(0, error_callback_count_); @@ -451,10 +451,10 @@ EXPECT_FALSE(gatt_conn_->IsConnected()); device->CreateGattConnection( - base::Bind(&BluetoothGattBlueZTest::GattConnectionCallback, - base::Unretained(this)), - base::Bind(&BluetoothGattBlueZTest::ConnectErrorCallback, - base::Unretained(this))); + base::BindOnce(&BluetoothGattBlueZTest::GattConnectionCallback, + base::Unretained(this)), + base::BindOnce(&BluetoothGattBlueZTest::ConnectErrorCallback, + base::Unretained(this))); EXPECT_EQ(2, success_callback_count_); EXPECT_EQ(0, error_callback_count_); @@ -476,10 +476,10 @@ EXPECT_FALSE(gatt_conn_->IsConnected()); device->CreateGattConnection( - base::Bind(&BluetoothGattBlueZTest::GattConnectionCallback, - base::Unretained(this)), - base::Bind(&BluetoothGattBlueZTest::ConnectErrorCallback, - base::Unretained(this))); + base::BindOnce(&BluetoothGattBlueZTest::GattConnectionCallback, + base::Unretained(this)), + base::BindOnce(&BluetoothGattBlueZTest::ConnectErrorCallback, + base::Unretained(this))); EXPECT_EQ(4, success_callback_count_); EXPECT_EQ(0, error_callback_count_); @@ -663,10 +663,10 @@ // Verify that the device can be connected to again: device->CreateGattConnection( - base::Bind(&BluetoothGattBlueZTest::GattConnectionCallback, - base::Unretained(this)), - base::Bind(&BluetoothGattBlueZTest::ConnectErrorCallback, - base::Unretained(this))); + base::BindOnce(&BluetoothGattBlueZTest::GattConnectionCallback, + base::Unretained(this)), + base::BindOnce(&BluetoothGattBlueZTest::ConnectErrorCallback, + base::Unretained(this))); properties->connected.ReplaceValue(true); EXPECT_TRUE(device->IsConnected()); @@ -1028,10 +1028,11 @@ characteristic->GetIdentifier()); EXPECT_EQ(kHeartRateMeasurementUUID, characteristic->GetUUID()); characteristic->WriteRemoteCharacteristic( - write_value, base::Bind(&BluetoothGattBlueZTest::SuccessCallback, - base::Unretained(this)), - base::Bind(&BluetoothGattBlueZTest::ServiceErrorCallback, - base::Unretained(this))); + write_value, + base::BindOnce(&BluetoothGattBlueZTest::SuccessCallback, + base::Unretained(this)), + base::BindOnce(&BluetoothGattBlueZTest::ServiceErrorCallback, + base::Unretained(this))); EXPECT_TRUE(observer.last_gatt_characteristic_id().empty()); EXPECT_FALSE(observer.last_gatt_characteristic_uuid().IsValid()); EXPECT_EQ(0, success_callback_count_); @@ -1050,10 +1051,11 @@ characteristic->GetIdentifier()); EXPECT_EQ(kBodySensorLocationUUID, characteristic->GetUUID()); characteristic->WriteRemoteCharacteristic( - write_value, base::Bind(&BluetoothGattBlueZTest::SuccessCallback, - base::Unretained(this)), - base::Bind(&BluetoothGattBlueZTest::ServiceErrorCallback, - base::Unretained(this))); + write_value, + base::BindOnce(&BluetoothGattBlueZTest::SuccessCallback, + base::Unretained(this)), + base::BindOnce(&BluetoothGattBlueZTest::ServiceErrorCallback, + base::Unretained(this))); EXPECT_TRUE(observer.last_gatt_characteristic_id().empty()); EXPECT_FALSE(observer.last_gatt_characteristic_uuid().IsValid()); EXPECT_EQ(0, success_callback_count_); @@ -1076,10 +1078,11 @@ characteristic->GetIdentifier()); EXPECT_EQ(kHeartRateControlPointUUID, characteristic->GetUUID()); characteristic->WriteRemoteCharacteristic( - write_value, base::Bind(&BluetoothGattBlueZTest::SuccessCallback, - base::Unretained(this)), - base::Bind(&BluetoothGattBlueZTest::ServiceErrorCallback, - base::Unretained(this))); + write_value, + base::BindOnce(&BluetoothGattBlueZTest::SuccessCallback, + base::Unretained(this)), + base::BindOnce(&BluetoothGattBlueZTest::ServiceErrorCallback, + base::Unretained(this))); EXPECT_TRUE(observer.last_gatt_characteristic_id().empty()); EXPECT_FALSE(observer.last_gatt_characteristic_uuid().IsValid()); EXPECT_EQ(1, success_callback_count_); @@ -1093,10 +1096,11 @@ invalid_write_length.push_back(0x01); invalid_write_length.push_back(0x00); characteristic->WriteRemoteCharacteristic( - invalid_write_length, base::Bind(&BluetoothGattBlueZTest::SuccessCallback, - base::Unretained(this)), - base::Bind(&BluetoothGattBlueZTest::ServiceErrorCallback, - base::Unretained(this))); + invalid_write_length, + base::BindOnce(&BluetoothGattBlueZTest::SuccessCallback, + base::Unretained(this)), + base::BindOnce(&BluetoothGattBlueZTest::ServiceErrorCallback, + base::Unretained(this))); EXPECT_EQ(1, success_callback_count_); EXPECT_EQ(3, error_callback_count_); EXPECT_EQ(BluetoothRemoteGattService::GATT_ERROR_INVALID_LENGTH, @@ -1106,10 +1110,11 @@ std::vector<uint8_t> invalid_write_value; invalid_write_value.push_back(0x02); characteristic->WriteRemoteCharacteristic( - invalid_write_value, base::Bind(&BluetoothGattBlueZTest::SuccessCallback, - base::Unretained(this)), - base::Bind(&BluetoothGattBlueZTest::ServiceErrorCallback, - base::Unretained(this))); + invalid_write_value, + base::BindOnce(&BluetoothGattBlueZTest::SuccessCallback, + base::Unretained(this)), + base::BindOnce(&BluetoothGattBlueZTest::ServiceErrorCallback, + base::Unretained(this))); EXPECT_EQ(1, success_callback_count_); EXPECT_EQ(4, error_callback_count_); EXPECT_EQ(BluetoothRemoteGattService::GATT_ERROR_FAILED, last_service_error_); @@ -1126,10 +1131,10 @@ characteristic->GetIdentifier()); EXPECT_EQ(kBodySensorLocationUUID, characteristic->GetUUID()); characteristic->ReadRemoteCharacteristic( - base::Bind(&BluetoothGattBlueZTest::ValueCallback, - base::Unretained(this)), - base::Bind(&BluetoothGattBlueZTest::ServiceErrorCallback, - base::Unretained(this))); + base::BindOnce(&BluetoothGattBlueZTest::ValueCallback, + base::Unretained(this)), + base::BindOnce(&BluetoothGattBlueZTest::ServiceErrorCallback, + base::Unretained(this))); EXPECT_EQ(2, success_callback_count_); EXPECT_EQ(4, error_callback_count_); EXPECT_EQ(0, observer.gatt_characteristic_value_changed_count()); @@ -1147,10 +1152,10 @@ characteristic->GetIdentifier()); EXPECT_EQ(kBodySensorLocationUUID, characteristic->GetUUID()); characteristic->ReadRemoteCharacteristic( - base::Bind(&BluetoothGattBlueZTest::ValueCallback, - base::Unretained(this)), - base::Bind(&BluetoothGattBlueZTest::ServiceErrorCallback, - base::Unretained(this))); + base::BindOnce(&BluetoothGattBlueZTest::ValueCallback, + base::Unretained(this)), + base::BindOnce(&BluetoothGattBlueZTest::ServiceErrorCallback, + base::Unretained(this))); // Callback counts shouldn't change, this one will be delayed until after // tne next one. @@ -1160,10 +1165,10 @@ // Next read should error because IN_PROGRESS characteristic->ReadRemoteCharacteristic( - base::Bind(&BluetoothGattBlueZTest::ValueCallback, - base::Unretained(this)), - base::Bind(&BluetoothGattBlueZTest::ServiceErrorCallback, - base::Unretained(this))); + base::BindOnce(&BluetoothGattBlueZTest::ValueCallback, + base::Unretained(this)), + base::BindOnce(&BluetoothGattBlueZTest::ServiceErrorCallback, + base::Unretained(this))); EXPECT_EQ(5, error_callback_count_); EXPECT_EQ(BluetoothRemoteGattService::GATT_ERROR_IN_PROGRESS, last_service_error_); @@ -1177,10 +1182,10 @@ // Test unauthorized actions. fake_bluetooth_gatt_characteristic_client_->SetAuthorized(false); characteristic->ReadRemoteCharacteristic( - base::Bind(&BluetoothGattBlueZTest::ValueCallback, - base::Unretained(this)), - base::Bind(&BluetoothGattBlueZTest::ServiceErrorCallback, - base::Unretained(this))); + base::BindOnce(&BluetoothGattBlueZTest::ValueCallback, + base::Unretained(this)), + base::BindOnce(&BluetoothGattBlueZTest::ServiceErrorCallback, + base::Unretained(this))); EXPECT_EQ(3, success_callback_count_); EXPECT_EQ(6, error_callback_count_); EXPECT_EQ(BluetoothRemoteGattService::GATT_ERROR_NOT_AUTHORIZED, @@ -1191,10 +1196,10 @@ // Test unauthenticated / needs login. fake_bluetooth_gatt_characteristic_client_->SetAuthenticated(false); characteristic->ReadRemoteCharacteristic( - base::Bind(&BluetoothGattBlueZTest::ValueCallback, - base::Unretained(this)), - base::Bind(&BluetoothGattBlueZTest::ServiceErrorCallback, - base::Unretained(this))); + base::BindOnce(&BluetoothGattBlueZTest::ValueCallback, + base::Unretained(this)), + base::BindOnce(&BluetoothGattBlueZTest::ServiceErrorCallback, + base::Unretained(this))); EXPECT_EQ(3, success_callback_count_); EXPECT_EQ(7, error_callback_count_); EXPECT_EQ(BluetoothRemoteGattService::GATT_ERROR_NOT_PAIRED, @@ -1240,13 +1245,13 @@ EXPECT_EQ(characteristic->GetValue(), last_read_value_); characteristic->ReadRemoteCharacteristic( - base::Bind(&BluetoothGattBlueZTest::ValueCallback, - base::Unretained(this)), - base::Bind(&BluetoothGattBlueZTest::ServiceErrorCallback, - base::Unretained(this))); + base::BindOnce(&BluetoothGattBlueZTest::ValueCallback, + base::Unretained(this)), + base::BindOnce(&BluetoothGattBlueZTest::ServiceErrorCallback, + base::Unretained(this))); }), - base::Bind(&BluetoothGattBlueZTest::ServiceErrorCallback, - base::Unretained(this))); + base::BindOnce(&BluetoothGattBlueZTest::ServiceErrorCallback, + base::Unretained(this))); EXPECT_EQ(2, success_callback_count_); EXPECT_EQ(0, error_callback_count_); EXPECT_EQ(characteristic->GetValue(), last_read_value_); @@ -1291,13 +1296,13 @@ characteristic->WriteRemoteCharacteristic( write_value, - base::Bind(&BluetoothGattBlueZTest::SuccessCallback, - base::Unretained(this)), - base::Bind(&BluetoothGattBlueZTest::ServiceErrorCallback, - base::Unretained(this))); + base::BindOnce(&BluetoothGattBlueZTest::SuccessCallback, + base::Unretained(this)), + base::BindOnce(&BluetoothGattBlueZTest::ServiceErrorCallback, + base::Unretained(this))); }), - base::Bind(&BluetoothGattBlueZTest::ServiceErrorCallback, - base::Unretained(this))); + base::BindOnce(&BluetoothGattBlueZTest::ServiceErrorCallback, + base::Unretained(this))); EXPECT_EQ(2, success_callback_count_); EXPECT_EQ(0, error_callback_count_); } @@ -1346,13 +1351,13 @@ characteristic->WriteRemoteCharacteristic( std::vector<uint8_t>({0x01}), - base::Bind(&BluetoothGattBlueZTest::SuccessCallback, - base::Unretained(this)), - base::Bind(&BluetoothGattBlueZTest::ServiceErrorCallback, - base::Unretained(this))); + base::BindOnce(&BluetoothGattBlueZTest::SuccessCallback, + base::Unretained(this)), + base::BindOnce(&BluetoothGattBlueZTest::ServiceErrorCallback, + base::Unretained(this))); }), - base::Bind(&BluetoothGattBlueZTest::ServiceErrorCallback, - base::Unretained(this))); + base::BindOnce(&BluetoothGattBlueZTest::ServiceErrorCallback, + base::Unretained(this))); EXPECT_EQ(2, success_callback_count_); EXPECT_EQ(0, error_callback_count_); } @@ -1399,13 +1404,13 @@ .value()); characteristic->ReadRemoteCharacteristic( - base::Bind(&BluetoothGattBlueZTest::ValueCallback, - base::Unretained(this)), - base::Bind(&BluetoothGattBlueZTest::ServiceErrorCallback, - base::Unretained(this))); + base::BindOnce(&BluetoothGattBlueZTest::ValueCallback, + base::Unretained(this)), + base::BindOnce(&BluetoothGattBlueZTest::ServiceErrorCallback, + base::Unretained(this))); }), - base::Bind(&BluetoothGattBlueZTest::ServiceErrorCallback, - base::Unretained(this))); + base::BindOnce(&BluetoothGattBlueZTest::ServiceErrorCallback, + base::Unretained(this))); EXPECT_EQ(2, success_callback_count_); EXPECT_EQ(0, error_callback_count_); EXPECT_EQ(characteristic->GetValue(), last_read_value_); @@ -1511,10 +1516,10 @@ // Read value. GattDescriptorValueChanged event will be sent after a // successful read. descriptor->ReadRemoteDescriptor( - base::Bind(&BluetoothGattBlueZTest::ValueCallback, - base::Unretained(this)), - base::Bind(&BluetoothGattBlueZTest::ServiceErrorCallback, - base::Unretained(this))); + base::BindOnce(&BluetoothGattBlueZTest::ValueCallback, + base::Unretained(this)), + base::BindOnce(&BluetoothGattBlueZTest::ServiceErrorCallback, + base::Unretained(this))); EXPECT_EQ(1, success_callback_count_); EXPECT_EQ(0, error_callback_count_); EXPECT_TRUE(ValuesEqual(last_read_value_, descriptor->GetValue())); @@ -1525,10 +1530,11 @@ // Write value. Writes to this descriptor will fail. desc_value[0] = 0x03; descriptor->WriteRemoteDescriptor( - desc_value, base::Bind(&BluetoothGattBlueZTest::SuccessCallback, - base::Unretained(this)), - base::Bind(&BluetoothGattBlueZTest::ServiceErrorCallback, - base::Unretained(this))); + desc_value, + base::BindOnce(&BluetoothGattBlueZTest::SuccessCallback, + base::Unretained(this)), + base::BindOnce(&BluetoothGattBlueZTest::ServiceErrorCallback, + base::Unretained(this))); EXPECT_EQ(1, success_callback_count_); EXPECT_EQ(1, error_callback_count_); EXPECT_EQ(BluetoothRemoteGattService::GATT_ERROR_NOT_PERMITTED, @@ -1540,10 +1546,10 @@ // Read value. The value should remain unchanged. descriptor->ReadRemoteDescriptor( - base::Bind(&BluetoothGattBlueZTest::ValueCallback, - base::Unretained(this)), - base::Bind(&BluetoothGattBlueZTest::ServiceErrorCallback, - base::Unretained(this))); + base::BindOnce(&BluetoothGattBlueZTest::ValueCallback, + base::Unretained(this)), + base::BindOnce(&BluetoothGattBlueZTest::ServiceErrorCallback, + base::Unretained(this))); EXPECT_EQ(2, success_callback_count_); EXPECT_EQ(1, error_callback_count_); EXPECT_TRUE(ValuesEqual(last_read_value_, descriptor->GetValue())); @@ -1554,10 +1560,10 @@ // Start notifications on the descriptor's characteristic. The descriptor // value should change. characteristic->StartNotifySession( - base::Bind(&BluetoothGattBlueZTest::NotifySessionCallback, - base::Unretained(this)), - base::Bind(&BluetoothGattBlueZTest::ServiceErrorCallback, - base::Unretained(this))); + base::BindOnce(&BluetoothGattBlueZTest::NotifySessionCallback, + base::Unretained(this)), + base::BindOnce(&BluetoothGattBlueZTest::ServiceErrorCallback, + base::Unretained(this))); base::RunLoop().Run(); EXPECT_EQ(3, success_callback_count_); EXPECT_EQ(1, error_callback_count_); @@ -1566,10 +1572,10 @@ // Read the new descriptor value. We should receive a value updated event. descriptor->ReadRemoteDescriptor( - base::Bind(&BluetoothGattBlueZTest::ValueCallback, - base::Unretained(this)), - base::Bind(&BluetoothGattBlueZTest::ServiceErrorCallback, - base::Unretained(this))); + base::BindOnce(&BluetoothGattBlueZTest::ValueCallback, + base::Unretained(this)), + base::BindOnce(&BluetoothGattBlueZTest::ServiceErrorCallback, + base::Unretained(this))); EXPECT_EQ(4, success_callback_count_); EXPECT_EQ(1, error_callback_count_); EXPECT_TRUE(ValuesEqual(last_read_value_, descriptor->GetValue())); @@ -1612,10 +1618,10 @@ // Request to start notifications. characteristic->StartNotifySession( - base::Bind(&BluetoothGattBlueZTest::NotifySessionCallback, - base::Unretained(this)), - base::Bind(&BluetoothGattBlueZTest::ServiceErrorCallback, - base::Unretained(this))); + base::BindOnce(&BluetoothGattBlueZTest::NotifySessionCallback, + base::Unretained(this)), + base::BindOnce(&BluetoothGattBlueZTest::ServiceErrorCallback, + base::Unretained(this))); // The operation still hasn't completed but we should have received the first // notification. @@ -1626,15 +1632,15 @@ // Send a two more requests, which should get queued. characteristic->StartNotifySession( - base::Bind(&BluetoothGattBlueZTest::NotifySessionCallback, - base::Unretained(this)), - base::Bind(&BluetoothGattBlueZTest::ServiceErrorCallback, - base::Unretained(this))); + base::BindOnce(&BluetoothGattBlueZTest::NotifySessionCallback, + base::Unretained(this)), + base::BindOnce(&BluetoothGattBlueZTest::ServiceErrorCallback, + base::Unretained(this))); characteristic->StartNotifySession( - base::Bind(&BluetoothGattBlueZTest::NotifySessionCallback, - base::Unretained(this)), - base::Bind(&BluetoothGattBlueZTest::ServiceErrorCallback, - base::Unretained(this))); + base::BindOnce(&BluetoothGattBlueZTest::NotifySessionCallback, + base::Unretained(this)), + base::BindOnce(&BluetoothGattBlueZTest::ServiceErrorCallback, + base::Unretained(this))); EXPECT_EQ(0, success_callback_count_); EXPECT_EQ(0, error_callback_count_); EXPECT_EQ(1, observer.gatt_characteristic_value_changed_count()); @@ -1659,8 +1665,8 @@ // characteristic should still be notifying. BluetoothGattNotifySession* session = update_sessions_[0].get(); EXPECT_TRUE(session->IsActive()); - session->Stop(base::Bind(&BluetoothGattBlueZTest::SuccessCallback, - base::Unretained(this))); + session->Stop(base::BindOnce(&BluetoothGattBlueZTest::SuccessCallback, + base::Unretained(this))); // Run message loop to stop the notify session. base::RunLoop().Run(); @@ -1693,10 +1699,10 @@ // Enable notifications again. characteristic->StartNotifySession( - base::Bind(&BluetoothGattBlueZTest::NotifySessionCallback, - base::Unretained(this)), - base::Bind(&BluetoothGattBlueZTest::ServiceErrorCallback, - base::Unretained(this))); + base::BindOnce(&BluetoothGattBlueZTest::NotifySessionCallback, + base::Unretained(this)), + base::BindOnce(&BluetoothGattBlueZTest::ServiceErrorCallback, + base::Unretained(this))); EXPECT_EQ(0, success_callback_count_); EXPECT_EQ(0, error_callback_count_); EXPECT_EQ(1, observer.gatt_characteristic_value_changed_count()); @@ -1719,10 +1725,10 @@ // Request another session. This should return immediately. characteristic->StartNotifySession( - base::Bind(&BluetoothGattBlueZTest::NotifySessionCallback, - base::Unretained(this)), - base::Bind(&BluetoothGattBlueZTest::ServiceErrorCallback, - base::Unretained(this))); + base::BindOnce(&BluetoothGattBlueZTest::NotifySessionCallback, + base::Unretained(this)), + base::BindOnce(&BluetoothGattBlueZTest::ServiceErrorCallback, + base::Unretained(this))); // Run message loop to stop the notify session. base::RunLoop().Run(); @@ -1775,25 +1781,25 @@ // Send several requests to start notifications. characteristic->StartNotifySession( - base::Bind(&BluetoothGattBlueZTest::NotifySessionCallback, - base::Unretained(this)), - base::Bind(&BluetoothGattBlueZTest::ServiceErrorCallback, - base::Unretained(this))); + base::BindOnce(&BluetoothGattBlueZTest::NotifySessionCallback, + base::Unretained(this)), + base::BindOnce(&BluetoothGattBlueZTest::ServiceErrorCallback, + base::Unretained(this))); characteristic->StartNotifySession( - base::Bind(&BluetoothGattBlueZTest::NotifySessionCallback, - base::Unretained(this)), - base::Bind(&BluetoothGattBlueZTest::ServiceErrorCallback, - base::Unretained(this))); + base::BindOnce(&BluetoothGattBlueZTest::NotifySessionCallback, + base::Unretained(this)), + base::BindOnce(&BluetoothGattBlueZTest::ServiceErrorCallback, + base::Unretained(this))); characteristic->StartNotifySession( - base::Bind(&BluetoothGattBlueZTest::NotifySessionCallback, - base::Unretained(this)), - base::Bind(&BluetoothGattBlueZTest::ServiceErrorCallback, - base::Unretained(this))); + base::BindOnce(&BluetoothGattBlueZTest::NotifySessionCallback, + base::Unretained(this)), + base::BindOnce(&BluetoothGattBlueZTest::ServiceErrorCallback, + base::Unretained(this))); characteristic->StartNotifySession( - base::Bind(&BluetoothGattBlueZTest::NotifySessionCallback, - base::Unretained(this)), - base::Bind(&BluetoothGattBlueZTest::ServiceErrorCallback, - base::Unretained(this))); + base::BindOnce(&BluetoothGattBlueZTest::NotifySessionCallback, + base::Unretained(this)), + base::BindOnce(&BluetoothGattBlueZTest::ServiceErrorCallback, + base::Unretained(this))); // The operation still hasn't completed but we should have received the first // notification. @@ -1820,10 +1826,10 @@ // marked as inactive. fake_bluetooth_gatt_characteristic_client_->StopNotify( fake_bluetooth_gatt_characteristic_client_->GetHeartRateMeasurementPath(), - base::Bind(&BluetoothGattBlueZTest::SuccessCallback, - base::Unretained(this)), - base::Bind(&BluetoothGattBlueZTest::DBusErrorCallback, - base::Unretained(this))); + base::BindOnce(&BluetoothGattBlueZTest::SuccessCallback, + base::Unretained(this)), + base::BindOnce(&BluetoothGattBlueZTest::DBusErrorCallback, + base::Unretained(this))); EXPECT_EQ(5, success_callback_count_); EXPECT_EQ(0, error_callback_count_); @@ -1842,10 +1848,10 @@ success_callback_count_ = 0; observer.Reset(); characteristic->StartNotifySession( - base::Bind(&BluetoothGattBlueZTest::NotifySessionCallback, - base::Unretained(this)), - base::Bind(&BluetoothGattBlueZTest::ServiceErrorCallback, - base::Unretained(this))); + base::BindOnce(&BluetoothGattBlueZTest::NotifySessionCallback, + base::Unretained(this)), + base::BindOnce(&BluetoothGattBlueZTest::ServiceErrorCallback, + base::Unretained(this))); // Run message loop to start the notify session. base::RunLoop().RunUntilIdle(); @@ -1895,10 +1901,10 @@ ->GetHeartRateMeasurementPath() .value()) ->StartNotifySession( - base::Bind(&BluetoothGattBlueZTest::NotifySessionCallback, - base::Unretained(this)), - base::Bind(&BluetoothGattBlueZTest::ServiceErrorCallback, - base::Unretained(this))); + base::BindOnce(&BluetoothGattBlueZTest::NotifySessionCallback, + base::Unretained(this)), + base::BindOnce(&BluetoothGattBlueZTest::ServiceErrorCallback, + base::Unretained(this))); base::RunLoop().Run(); // Obtain writable Heart Rate Control Point characteristic. @@ -1915,10 +1921,10 @@ for (int i = 0; i < 1000; ++i) { characteristic->PrepareWriteRemoteCharacteristic( write_value, - base::Bind(&BluetoothGattBlueZTest::SuccessCallback, - base::Unretained(this)), - base::Bind(&BluetoothGattBlueZTest::ServiceErrorCallback, - base::Unretained(this))); + base::BindOnce(&BluetoothGattBlueZTest::SuccessCallback, + base::Unretained(this)), + base::BindOnce(&BluetoothGattBlueZTest::ServiceErrorCallback, + base::Unretained(this))); } EXPECT_EQ(1000, success_callback_count_); EXPECT_EQ(0, error_callback_count_); @@ -1940,10 +1946,10 @@ for (int i = 0; i < 1000; ++i) { characteristic->PrepareWriteRemoteCharacteristic( write_value, - base::Bind(&BluetoothGattBlueZTest::SuccessCallback, - base::Unretained(this)), - base::Bind(&BluetoothGattBlueZTest::ServiceErrorCallback, - base::Unretained(this))); + base::BindOnce(&BluetoothGattBlueZTest::SuccessCallback, + base::Unretained(this)), + base::BindOnce(&BluetoothGattBlueZTest::ServiceErrorCallback, + base::Unretained(this))); } EXPECT_EQ(1000, success_callback_count_); EXPECT_EQ(0, error_callback_count_); @@ -1988,26 +1994,26 @@ // Request to start notifications. characteristic->StartNotifySession( device::BluetoothGattCharacteristic::NotificationType::kNotification, - base::Bind(&BluetoothGattBlueZTest::NotifySessionCallback, - base::Unretained(this)), - base::Bind(&BluetoothGattBlueZTest::ServiceErrorCallback, - base::Unretained(this))); + base::BindOnce(&BluetoothGattBlueZTest::NotifySessionCallback, + base::Unretained(this)), + base::BindOnce(&BluetoothGattBlueZTest::ServiceErrorCallback, + base::Unretained(this))); base::RunLoop().Run(); EXPECT_EQ(1, observer.gatt_characteristic_value_changed_count()); // Request to start indications. fake_bluetooth_gatt_characteristic_client_->StopNotify( fake_bluetooth_gatt_characteristic_client_->GetHeartRateMeasurementPath(), - base::Bind(&BluetoothGattBlueZTest::SuccessCallback, - base::Unretained(this)), - base::Bind(&BluetoothGattBlueZTest::DBusErrorCallback, - base::Unretained(this))); + base::BindOnce(&BluetoothGattBlueZTest::SuccessCallback, + base::Unretained(this)), + base::BindOnce(&BluetoothGattBlueZTest::DBusErrorCallback, + base::Unretained(this))); characteristic->StartNotifySession( device::BluetoothGattCharacteristic::NotificationType::kIndication, - base::Bind(&BluetoothGattBlueZTest::NotifySessionCallback, - base::Unretained(this)), - base::Bind(&BluetoothGattBlueZTest::ServiceErrorCallback, - base::Unretained(this))); + base::BindOnce(&BluetoothGattBlueZTest::NotifySessionCallback, + base::Unretained(this)), + base::BindOnce(&BluetoothGattBlueZTest::ServiceErrorCallback, + base::Unretained(this))); base::RunLoop().Run(); EXPECT_EQ(2, observer.gatt_characteristic_value_changed_count()); }
diff --git a/device/bluetooth/bluez/bluetooth_socket_bluez.cc b/device/bluetooth/bluez/bluetooth_socket_bluez.cc index 12d1e74f..6f5b858 100644 --- a/device/bluetooth/bluez/bluetooth_socket_bluez.cc +++ b/device/bluetooth/bluez/bluetooth_socket_bluez.cc
@@ -263,10 +263,10 @@ bluez::BluezDBusManager::Get()->GetBluetoothDeviceClient()->ConnectProfile( device_path_, uuid_.canonical_value(), - base::Bind(&BluetoothSocketBlueZ::OnConnectProfile, this, - success_callback), - base::Bind(&BluetoothSocketBlueZ::OnConnectProfileError, this, - error_callback)); + base::BindOnce(&BluetoothSocketBlueZ::OnConnectProfile, this, + success_callback), + base::BindOnce(&BluetoothSocketBlueZ::OnConnectProfileError, this, + error_callback)); } void BluetoothSocketBlueZ::OnRegisterProfileError(
diff --git a/device/fido/make_credential_request_handler.cc b/device/fido/make_credential_request_handler.cc index 5d4d347d..1083a8a 100644 --- a/device/fido/make_credential_request_handler.cc +++ b/device/fido/make_credential_request_handler.cc
@@ -350,11 +350,14 @@ // order to create a credential (as specified by CTAP 2.0), even if // user-verification is "discouraged". However, if the request is U2F-only // then that doesn't apply and UV must be set to discouraged so that the - // request can be translated to U2F. + // request can be translated to U2F. Platform authenticators are exempted + // from this UV enforcement. if (authenticator->Options()->user_verification_availability == AuthenticatorSupportedOptions::UserVerificationAvailability:: kSupportedAndConfigured && - !request_.is_u2f_only) { + !request_.is_u2f_only && + authenticator->AuthenticatorTransport() != + FidoTransportProtocol::kInternal) { if (authenticator->Options()->supports_uv_token) { authenticator->GetUvToken( base::BindOnce(&MakeCredentialRequestHandler::OnHaveUvToken,
diff --git a/docs/gpu/gpu_testing.md b/docs/gpu/gpu_testing.md index f662463..807b42f6 100644 --- a/docs/gpu/gpu_testing.md +++ b/docs/gpu/gpu_testing.md
@@ -296,12 +296,12 @@ --passthrough` If, for some reason, the local run code is unable to determine what the git -revision is, simply pass '--build-revision aabbccdd'. Note that `aabbccdd` must +revision is, simply pass `--git-revision aabbccdd`. Note that `aabbccdd` must be replaced with an actual Chromium src revision (typically whatever revision origin/master is currently synced to) in order for the tests to work. This can be done automatically using: ``run_gpu_integration_test.py pixel --no-skia-gold-failure --local-run ---passthrough --build-revision `git rev-parse origin/master` `` +--passthrough --git-revision `git rev-parse origin/master` `` ## Running Binaries from the Bots Locally
diff --git a/docs/security/faq.md b/docs/security/faq.md index 23b3daff..2e09e25 100644 --- a/docs/security/faq.md +++ b/docs/security/faq.md
@@ -249,6 +249,14 @@ on the currently-loaded page when the user clicks the bookmark; these are called [bookmarklets](https://en.wikipedia.org/wiki/Bookmarklet). +<a name="TOC-Does-executing-JavaScript-in-a-PDF-file-mean-there-s-an-XSS-vulnerability-"></a> +## Does executing JavaScript in a PDF file mean there's an XSS vulnerability? + +No. PDF files have the ability to run JavaScript, usually to facilitate field +validation during form fill-out. Note that the set of bindings provided to +the PDF are more limited than those provided by the DOM to HTML documents (e.g. +no document.cookie). + <a name="TOC-Is-Chrome-s-support-for-userinfo-in-HTTP-URLs-e.g.-http:-user:password-example.com-considered-a-vulnerability-"></a> ## Is Chrome's support for userinfo in HTTP URLs (e.g. http://user:password@example.com) considered a vulnerability? @@ -677,6 +685,14 @@ an extension to be installed on their device(s). Please report such bugs via https://bugs.chromium.org/p/chromium/issues/entry?template=Security+Bug. +<a name="TOC-Are-PDF-files-static-content-in-Chromium-"></a> +## Are PDF files static content in Chromium? + +No. PDF files have some powerful capabilities including invoking printing or +posting form data. To mitigate abuse of these capabiliies, such as beaconing +upon document open, we require interaction with the document (a "user gesture") +before allowing their use. + ## TODO * https://dev.chromium.org/Home/chromium-security/client-identification-mechanisms
diff --git a/docs/security/web-mitigation-metrics.md b/docs/security/web-mitigation-metrics.md index ca1c70cf..2314c43 100644 --- a/docs/security/web-mitigation-metrics.md +++ b/docs/security/web-mitigation-metrics.md
@@ -97,7 +97,23 @@ [Cross-Origin-Resource-Policy][corp] restricts a resource to only be fetched by "same-origin" or "same-site" pages. -* We do not currently track this metric. +* "NetworkService.CrossOriginResourcePolicy.Result" UMA histogram records the + result of the CORP check. + + * "success": The CORP check passes successfully. + * "same-origin violation": "same-origin" is specified on a cross-origin + response. + * "same-origin violation with COEP involvement": No CORP header + is specified but that is treated as "same-origin" because the initiator + context enables Cross-Origin Embedder Policy (see below), and the response + comes from cross-origin. + * "same-site violation": "same-site" is specified on a cross-site response. + +* "NetworkService.CrossOriginResourcePolciy.ReportOnlyResult" UMA histogram + records the result of the CORP check, only when a + Cross-Origin-Embedder-Policy-Report-Only header is attached to the initiator + context. The format is same as + "NetworkService.CrossOriginResourcePolicy.Result". [Cross-Origin-Opener-Policy][coop] is used to restrict the usage of window openers. Pages can choose to restrict this relation to same-origin pages with
diff --git a/docs/windows_build_instructions.md b/docs/windows_build_instructions.md index 8eb3fc8..8845f848 100644 --- a/docs/windows_build_instructions.md +++ b/docs/windows_build_instructions.md
@@ -61,22 +61,6 @@ Windows" → Change. Or, you can download the standalone SDK installer and use it to install the Debugging Tools. -### Known issue with Visual Studio 16.5.0 -Visual Studio 16.5.0 includes some header files which are incompatible with the -C++ standard used in Chromium (see [crbug.com/1063424](https://crbug.com/1063424) -for details.) A workaround is to install the older command-line tools: -```shell -$ PATH_TO_INSTALLER.exe ^ - --add "Microsoft.VisualStudio.Component.VC.14.24.ARM64" ^ - --add "Microsoft.VisualStudio.Component.VC.14.24.x86.x64" ^ - --add "Microsoft.VisualStudio.Component.VC.14.24.ATL.ARM64" ^ - --add "Microsoft.VisualStudio.Component.VC.14.24.ATL" ^ - --add "Microsoft.VisualStudio.Component.VC.14.24.MFC.ARM64" ^ - --add "Microsoft.VisualStudio.Component.VC.14.24.MFC" ^ - --includeRecommended -``` - - ## Install `depot_tools` Download the [depot_tools bundle](https://storage.googleapis.com/chrome-infra/depot_tools.zip)
diff --git a/extensions/browser/BUILD.gn b/extensions/browser/BUILD.gn index 33f4dd83..14c3482 100644 --- a/extensions/browser/BUILD.gn +++ b/extensions/browser/BUILD.gn
@@ -336,6 +336,8 @@ "suggest_permission_util.h", "task_queue_util.cc", "task_queue_util.h", + "ui_util.cc", + "ui_util.h", "uninstall_ping_sender.cc", "uninstall_ping_sender.h", "uninstall_reason.h",
diff --git a/extensions/browser/api/bluetooth/bluetooth_private_api.cc b/extensions/browser/api/bluetooth/bluetooth_private_api.cc index 5ba3224..644c17f 100644 --- a/extensions/browser/api/bluetooth/bluetooth_private_api.cc +++ b/extensions/browser/api/bluetooth/bluetooth_private_api.cc
@@ -54,6 +54,21 @@ return device::BLUETOOTH_TRANSPORT_INVALID; } } + +bool IsActualConnectionFailure(bt_private::ConnectResultType result) { + DCHECK(result != bt_private::CONNECT_RESULT_TYPE_SUCCESS); + + switch (result) { + case bt_private::CONNECT_RESULT_TYPE_INPROGRESS: + case bt_private::CONNECT_RESULT_TYPE_AUTHCANCELED: + case bt_private::CONNECT_RESULT_TYPE_AUTHREJECTED: + // The connection is not a failure if it's still in progress, the user + // canceled auth, or the user entered incorrect auth details. + return false; + default: + return true; + } +} #endif // defined(OS_CHROMEOS) std::string GetListenerId(const EventListenerInfo& details) { @@ -633,9 +648,15 @@ void BluetoothPrivateRecordPairingFunction::DoWork( scoped_refptr<device::BluetoothAdapter> adapter) { #if defined(OS_CHROMEOS) - device::RecordPairingResult( - params_->success, GetBluetoothTransport(params_->transport), - base::TimeDelta::FromMilliseconds(params_->pairing_duration_ms)); + bt_private::ConnectResultType result = params_->result; + bool success = (result == bt_private::CONNECT_RESULT_TYPE_SUCCESS); + + // Only emit metrics if this is a success or a true connection failure. + if (success || IsActualConnectionFailure(result)) { + device::RecordPairingResult( + success, GetBluetoothTransport(params_->transport), + base::TimeDelta::FromMilliseconds(params_->pairing_duration_ms)); + } #endif // defined(OS_CHROMEOS) Respond(NoArguments()); @@ -657,8 +678,14 @@ void BluetoothPrivateRecordReconnectionFunction::DoWork( scoped_refptr<device::BluetoothAdapter> adapter) { #if defined(OS_CHROMEOS) - device::RecordUserInitiatedReconnectionAttemptResult( - params_->success, device::BluetoothUiSurface::kSettings); + bt_private::ConnectResultType result = params_->result; + bool success = (result == bt_private::CONNECT_RESULT_TYPE_SUCCESS); + + // Only emit metrics if this is a success or a true connection failure. + if (success || IsActualConnectionFailure(result)) { + device::RecordUserInitiatedReconnectionAttemptResult( + success, device::BluetoothUiSurface::kSettings); + } #endif // defined(OS_CHROMEOS) Respond(NoArguments());
diff --git a/extensions/browser/extension_host.cc b/extensions/browser/extension_host.cc index 524c060..01fbe50e 100644 --- a/extensions/browser/extension_host.cc +++ b/extensions/browser/extension_host.cc
@@ -416,6 +416,10 @@ } void ExtensionHost::RenderViewReady() { + if (has_creation_notification_already_fired_) + return; + has_creation_notification_already_fired_ = true; + content::NotificationService::current()->Notify( extensions::NOTIFICATION_EXTENSION_HOST_CREATED, content::Source<BrowserContext>(browser_context_),
diff --git a/extensions/browser/extension_host.h b/extensions/browser/extension_host.h index 093fb25..b5d2c76 100644 --- a/extensions/browser/extension_host.h +++ b/extensions/browser/extension_host.h
@@ -186,6 +186,12 @@ // Whether CreateRenderViewNow was called before the extension was ready. bool is_render_view_creation_pending_; + // Whether NOTIFICATION_EXTENSION_HOST_CREATED has been already delivered + // (since it is triggered by RenderViewReady which happens not only for the + // very first RenderViewHost, but also can happen when swapping RenderViewHost + // for another one). + bool has_creation_notification_already_fired_ = false; + // Whether the ExtensionHost has finished loading some content at least once. // There may be subsequent loads - such as reloads and navigations - and this // will not affect its value (it will remain true).
diff --git a/extensions/browser/extension_util.cc b/extensions/browser/extension_util.cc index c3231cfa..4484967 100644 --- a/extensions/browser/extension_util.cc +++ b/extensions/browser/extension_util.cc
@@ -10,6 +10,7 @@ #include "extensions/browser/extension_prefs.h" #include "extensions/browser/extension_registry.h" #include "extensions/browser/extensions_browser_client.h" +#include "extensions/browser/ui_util.h" #include "extensions/common/extension.h" #include "extensions/common/features/behavior_feature.h" #include "extensions/common/features/feature.h" @@ -152,7 +153,7 @@ // withheld permissions couldn't be granted), extensions that are part of // chrome or corporate policy, and extensions that are whitelisted to script // everywhere must always have permission to run on a page. - return Extension::ShouldDisplayInExtensionSettings(type, location) && + return ui_util::ShouldDisplayInExtensionSettings(type, location) && !Manifest::IsPolicyLocation(location) && !Manifest::IsComponentLocation(location) && !PermissionsData::CanExecuteScriptEverywhere(extension_id, location);
diff --git a/extensions/browser/ui_util.cc b/extensions/browser/ui_util.cc new file mode 100644 index 0000000..5cacc23 --- /dev/null +++ b/extensions/browser/ui_util.cc
@@ -0,0 +1,47 @@ +// Copyright 2020 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "extensions/browser/ui_util.h" + +#include "base/command_line.h" +#include "extensions/common/extension.h" +#include "extensions/common/switches.h" + +namespace extensions { +namespace ui_util { + +bool ShouldDisplayInExtensionSettings(Manifest::Type type, + Manifest::Location location) { + // Don't show for themes since the settings UI isn't really useful for them. + if (type == Manifest::TYPE_THEME) + return false; + + // Hide component extensions because they are only extensions as an + // implementation detail of Chrome. + if (Manifest::IsComponentLocation(location) && + !base::CommandLine::ForCurrentProcess()->HasSwitch( + switches::kShowComponentExtensionOptions)) { + return false; + } + + // Unless they are unpacked, never show hosted apps. Note: We intentionally + // show packaged apps and platform apps because there are some pieces of + // functionality that are only available in chrome://extensions/ but which + // are needed for packaged and platform apps. For example, inspecting + // background pages. See http://crbug.com/116134. + if (!Manifest::IsUnpackedLocation(location) && + type == Manifest::TYPE_HOSTED_APP) { + return false; + } + + return true; +} + +bool ShouldDisplayInExtensionSettings(const Extension& extension) { + return ShouldDisplayInExtensionSettings(extension.GetType(), + extension.location()); +} + +} // namespace ui_util +} // namespace extensions
diff --git a/extensions/browser/ui_util.h b/extensions/browser/ui_util.h new file mode 100644 index 0000000..1cab1e8 --- /dev/null +++ b/extensions/browser/ui_util.h
@@ -0,0 +1,25 @@ +// Copyright 2020 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef EXTENSIONS_BROWSER_UI_UTIL_H_ +#define EXTENSIONS_BROWSER_UI_UTIL_H_ + +#include "extensions/common/manifest.h" + +namespace extensions { +class Extension; + +namespace ui_util { + +// Returns true if an extension with the given |type| and |location| should be +// displayed in the extension settings page (e.g. chrome://extensions). +bool ShouldDisplayInExtensionSettings(Manifest::Type type, + Manifest::Location location); +// Convenience method of the above taking an Extension object. +bool ShouldDisplayInExtensionSettings(const Extension& extension); + +} // namespace ui_util +} // namespace extensions + +#endif // EXTENSIONS_BROWSER_UI_UTIL_H_
diff --git a/extensions/common/api/bluetooth_private.idl b/extensions/common/api/bluetooth_private.idl index 9973dac..d3d88c52 100644 --- a/extensions/common/api/bluetooth_private.idl +++ b/extensions/common/api/bluetooth_private.idl
@@ -152,13 +152,14 @@ // Pairs the given device. static void pair(DOMString deviceAddress, optional VoidCallback callback); - // Record that a pairing attempt finished. Do not record cancellations. - static void recordPairing(boolean success, bluetooth.Transport transport, - long pairingDurationMs); + // Record that a pairing attempt finished. Ignores cancellations. + static void recordPairing(bluetooth.Transport transport, + long pairingDurationMs, + optional ConnectResultType result); // Record that a user-initiated reconnection attempt to an already paired - // device finished. Do not record cancellations. - static void recordReconnection(boolean success); + // device finished. Ignores cancellations. + static void recordReconnection(optional ConnectResultType result); // Record that a user selected a device to connect to. static void recordDeviceSelection(long selectionDurationMs,
diff --git a/extensions/common/extension.cc b/extensions/common/extension.cc index 3499882..980c185 100644 --- a/extensions/common/extension.cc +++ b/extensions/common/extension.cc
@@ -326,33 +326,6 @@ url::kStandardSchemeSeparator, extension_id})); } -// static -bool Extension::ShouldDisplayInExtensionSettings(Manifest::Type type, - Manifest::Location location) { - // Don't show for themes since the settings UI isn't really useful for them. - if (type == Manifest::TYPE_THEME) - return false; - - // Hide component extensions because they are only extensions as an - // implementation detail of Chrome. - if (Manifest::IsComponentLocation(location) && - !base::CommandLine::ForCurrentProcess()->HasSwitch( - switches::kShowComponentExtensionOptions)) { - return false; - } - - // Unless they are unpacked, never show hosted apps. Note: We intentionally - // show packaged apps and platform apps because there are some pieces of - // functionality that are only available in chrome://extensions/ but which - // are needed for packaged and platform apps. For example, inspecting - // background pages. See http://crbug.com/116134. - if (!Manifest::IsUnpackedLocation(location) && - type == Manifest::TYPE_HOSTED_APP) - return false; - - return true; -} - bool Extension::OverlapsWithOrigin(const GURL& origin) const { if (url() == origin) return true; @@ -387,10 +360,6 @@ return is_app() && display_in_new_tab_page_; } -bool Extension::ShouldDisplayInExtensionSettings() const { - return Extension::ShouldDisplayInExtensionSettings(GetType(), location()); -} - bool Extension::ShouldExposeViaManagementAPI() const { // Hide component extensions because they are only extensions as an // implementation detail of Chrome.
diff --git a/extensions/common/extension.h b/extensions/common/extension.h index bee8d173..2cd380b9 100644 --- a/extensions/common/extension.h +++ b/extensions/common/extension.h
@@ -222,11 +222,6 @@ // Returns the base extension url for a given |extension_id|. static GURL GetBaseURLFromExtensionId(const ExtensionId& extension_id); - // Returns true if the extension should be displayed in the extension - // settings page (i.e. chrome://extensions). - static bool ShouldDisplayInExtensionSettings(Manifest::Type type, - Manifest::Location location); - // Returns true if this extension or app includes areas within |origin|. bool OverlapsWithOrigin(const GURL& origin) const; @@ -234,16 +229,16 @@ // for displaying in a launcher or new tab page. bool RequiresSortOrdinal() const; + // TODO(devlin): The core Extension class shouldn't be responsible for these + // ShouldDisplay/ShouldExpose style functions; it doesn't know about the NTP, + // Management API, etc. + // Returns true if the extension should be displayed in the app launcher. bool ShouldDisplayInAppLauncher() const; // Returns true if the extension should be displayed in the browser NTP. bool ShouldDisplayInNewTabPage() const; - // Returns true if the extension should be displayed in the extension - // settings page (i.e. chrome://extensions). - bool ShouldDisplayInExtensionSettings() const; - // Returns true if the extension should be exposed via the chrome.management // API. bool ShouldExposeViaManagementAPI() const;
diff --git a/extensions/common/feature_switch.cc b/extensions/common/feature_switch.cc index 9bb857b5..ae90db2 100644 --- a/extensions/common/feature_switch.cc +++ b/extensions/common/feature_switch.cc
@@ -33,7 +33,6 @@ #else FeatureSwitch::DEFAULT_DISABLED), #endif - error_console(switches::kErrorConsole, FeatureSwitch::DEFAULT_ENABLED), embedded_extension_options(switches::kEmbeddedExtensionOptions, FeatureSwitch::DEFAULT_DISABLED), trace_app_source(switches::kTraceAppSource, @@ -54,7 +53,6 @@ // Default is yes. FeatureSwitch prompt_for_external_extensions; - FeatureSwitch error_console; FeatureSwitch embedded_extension_options; FeatureSwitch trace_app_source; FeatureSwitch load_media_router_component_extension; @@ -71,9 +69,6 @@ FeatureSwitch* FeatureSwitch::prompt_for_external_extensions() { return &g_common_switches.Get().prompt_for_external_extensions; } -FeatureSwitch* FeatureSwitch::error_console() { - return &g_common_switches.Get().error_console; -} FeatureSwitch* FeatureSwitch::embedded_extension_options() { return &g_common_switches.Get().embedded_extension_options; }
diff --git a/extensions/common/feature_switch.h b/extensions/common/feature_switch.h index e1d201a0..152390dc4 100644 --- a/extensions/common/feature_switch.h +++ b/extensions/common/feature_switch.h
@@ -30,7 +30,6 @@ public: static FeatureSwitch* force_dev_mode_highlighting(); static FeatureSwitch* prompt_for_external_extensions(); - static FeatureSwitch* error_console(); static FeatureSwitch* embedded_extension_options(); static FeatureSwitch* trace_app_source(); static FeatureSwitch* load_media_router_component_extension();
diff --git a/extensions/common/switches.cc b/extensions/common/switches.cc index 1bdd168..0a3989a6 100644 --- a/extensions/common/switches.cc +++ b/extensions/common/switches.cc
@@ -35,10 +35,6 @@ const char kDisableExtensionsHttpThrottling[] = "disable-extensions-http-throttling"; -// Allows the ErrorConsole to collect runtime and manifest errors, and display -// them in the chrome:extensions page. -const char kErrorConsole[] = "error-console"; - // Marks a renderer as extension process. const char kExtensionProcess[] = "extension-process";
diff --git a/extensions/common/switches.h b/extensions/common/switches.h index f2e707a..2b3b6af 100644 --- a/extensions/common/switches.h +++ b/extensions/common/switches.h
@@ -18,7 +18,6 @@ extern const char kEmbeddedExtensionOptions[]; extern const char kEnableExperimentalExtensionApis[]; extern const char kEnableBLEAdvertising[]; -extern const char kErrorConsole[]; extern const char kExtensionProcess[]; extern const char kExtensionsOnChromeURLs[]; extern const char kForceDevModeHighlighting[];
diff --git a/fuchsia/engine/BUILD.gn b/fuchsia/engine/BUILD.gn index 22d08528..45208c8 100644 --- a/fuchsia/engine/BUILD.gn +++ b/fuchsia/engine/BUILD.gn
@@ -128,8 +128,8 @@ "browser/context_impl.h", "browser/cookie_manager_impl.cc", "browser/cookie_manager_impl.h", - "browser/discarding_event_filter.cc", - "browser/discarding_event_filter.h", + "browser/event_filter.cc", + "browser/event_filter.h", "browser/frame_impl.cc", "browser/frame_impl.h", "browser/frame_layout_manager.cc", @@ -276,6 +276,7 @@ sources = [ "browser/ax_tree_converter_unittest.cc", "browser/cookie_manager_impl_unittest.cc", + "browser/event_filter_unittest.cc", "browser/frame_impl_unittest.cc", "browser/url_request_rewrite_rules_manager_unittest.cc", "common/web_engine_url_loader_throttle_unittest.cc",
diff --git a/fuchsia/engine/browser/discarding_event_filter.cc b/fuchsia/engine/browser/discarding_event_filter.cc deleted file mode 100644 index ca89a12..0000000 --- a/fuchsia/engine/browser/discarding_event_filter.cc +++ /dev/null
@@ -1,17 +0,0 @@ -// Copyright 2019 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "fuchsia/engine/browser/discarding_event_filter.h" - -DiscardingEventFilter::DiscardingEventFilter() = default; - -DiscardingEventFilter::~DiscardingEventFilter() = default; - -ui::EventDispatchDetails DiscardingEventFilter::RewriteEvent( - const ui::Event& event, - const Continuation continuation) { - if (discard_events_) - return DiscardEvent(continuation); - return SendEvent(continuation, &event); -}
diff --git a/fuchsia/engine/browser/discarding_event_filter.h b/fuchsia/engine/browser/discarding_event_filter.h deleted file mode 100644 index 49132ae..0000000 --- a/fuchsia/engine/browser/discarding_event_filter.h +++ /dev/null
@@ -1,36 +0,0 @@ -// Copyright 2019 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef FUCHSIA_ENGINE_BROWSER_DISCARDING_EVENT_FILTER_H_ -#define FUCHSIA_ENGINE_BROWSER_DISCARDING_EVENT_FILTER_H_ - -#include <memory> - -#include "base/macros.h" -#include "ui/events/event_rewriter.h" - -// Event filter which will drop incoming events when |discard_events_| is set. -class DiscardingEventFilter : public ui::EventRewriter { - public: - DiscardingEventFilter(); - ~DiscardingEventFilter() override; - - void set_discard_events(bool discard_events) { - discard_events_ = discard_events; - } - - private: - // ui::EventRewriter overrides. - ui::EventDispatchDetails RewriteEvent( - const ui::Event& event, - const Continuation continuation) override; - - // When set, all incoming events will be discarded before they are - // delivered to their sink. - bool discard_events_ = false; - - DISALLOW_COPY_AND_ASSIGN(DiscardingEventFilter); -}; - -#endif // FUCHSIA_ENGINE_BROWSER_DISCARDING_EVENT_FILTER_H_
diff --git a/fuchsia/engine/browser/event_filter.cc b/fuchsia/engine/browser/event_filter.cc new file mode 100644 index 0000000..2a93512 --- /dev/null +++ b/fuchsia/engine/browser/event_filter.cc
@@ -0,0 +1,148 @@ +// Copyright 2019 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "fuchsia/engine/browser/event_filter.h" + +#include <limits> + +#include "ui/events/event.h" + +namespace { + +using fuchsia::web::InputTypes; + +const uint64_t kInputTypeNone = 0; +const uint64_t kInputTypeAll = std::numeric_limits<uint64_t>::max(); + +static_assert( + std::is_same<uint64_t, + std::underlying_type<fuchsia::web::InputTypes>::type>::value, + "InputTypes is not an uint64."); + +} // namespace + +EventFilter::EventFilter() { + // Allow all inputs by default. + ConfigureInputTypes(fuchsia::web::InputTypes::ALL, + fuchsia::web::AllowInputState::ALLOW); +} + +EventFilter::~EventFilter() = default; + +void EventFilter::ConfigureInputTypes(fuchsia::web::InputTypes types, + fuchsia::web::AllowInputState allow) { + // If |types| contains ALL, all other type bits are superseded. + if (allow == fuchsia::web::AllowInputState::ALLOW) { + if (static_cast<uint64_t>(types) & + static_cast<uint64_t>(fuchsia::web::InputTypes::ALL)) { + enabled_input_types_ = kInputTypeAll; + enable_unknown_types_ = true; + } else { + enabled_input_types_ |= static_cast<uint64_t>(types); + } + } else { + if (static_cast<uint64_t>(types) & + static_cast<uint64_t>(fuchsia::web::InputTypes::ALL)) { + enabled_input_types_ = kInputTypeNone; + enable_unknown_types_ = false; + } else { + enabled_input_types_ &= static_cast<uint64_t>(~types); + } + } +} + +void EventFilter::OnEvent(ui::Event* event) { + if (!IsEventAllowed(event->type())) { + event->StopPropagation(); + return; + } + + // Allow base class to route |event| to event type-specific handlers. + ui::EventHandler::OnEvent(event); +} + +void EventFilter::OnGestureEvent(ui::GestureEvent* event) { + if (!IsEventAllowed(event->type())) { + event->StopPropagation(); + return; + } + + ui::EventHandler::OnGestureEvent(event); +} + +bool EventFilter::IsEventAllowed(ui::EventType type) { + switch (type) { + case ui::ET_KEY_PRESSED: + case ui::ET_KEY_RELEASED: + return IsTypeEnabled(InputTypes::KEY); + + case ui::ET_MOUSE_PRESSED: + case ui::ET_MOUSE_DRAGGED: + case ui::ET_MOUSE_RELEASED: + return IsTypeEnabled(InputTypes::MOUSE_CLICK); + + case ui::ET_MOUSE_MOVED: + case ui::ET_MOUSE_ENTERED: + case ui::ET_MOUSE_EXITED: + return IsTypeEnabled(InputTypes::MOUSE_MOVE); + + case ui::ET_MOUSEWHEEL: + return IsTypeEnabled(InputTypes::MOUSE_WHEEL); + + case ui::ET_GESTURE_TAP: + case ui::ET_GESTURE_TAP_DOWN: + case ui::ET_GESTURE_TAP_CANCEL: + case ui::ET_GESTURE_TAP_UNCONFIRMED: + case ui::ET_GESTURE_DOUBLE_TAP: + case ui::ET_GESTURE_TWO_FINGER_TAP: + case ui::ET_GESTURE_LONG_PRESS: + case ui::ET_GESTURE_LONG_TAP: + return IsTypeEnabled(InputTypes::GESTURE_TAP); + + case ui::ET_GESTURE_PINCH_BEGIN: + case ui::ET_GESTURE_PINCH_END: + case ui::ET_GESTURE_PINCH_UPDATE: + return IsTypeEnabled(InputTypes::GESTURE_PINCH); + + case ui::ET_GESTURE_SCROLL_BEGIN: + case ui::ET_GESTURE_SCROLL_END: + case ui::ET_GESTURE_SCROLL_UPDATE: + case ui::ET_GESTURE_SWIPE: + case ui::ET_SCROLL: + case ui::ET_SCROLL_FLING_START: + case ui::ET_SCROLL_FLING_CANCEL: + return IsTypeEnabled(InputTypes::GESTURE_DRAG); + + // Allow low-level touch events and non-input control messages to pass + // through unimpeded. + case ui::ET_TOUCH_RELEASED: + case ui::ET_TOUCH_PRESSED: + case ui::ET_TOUCH_MOVED: + case ui::ET_TOUCH_CANCELLED: + case ui::ET_DROP_TARGET_EVENT: + case ui::ET_GESTURE_SHOW_PRESS: + case ui::ET_GESTURE_BEGIN: + case ui::ET_GESTURE_END: + case ui::ET_CANCEL_MODE: + case ui::ET_MOUSE_CAPTURE_CHANGED: + return true; + + case ui::ET_UMA_DATA: + NOTREACHED(); // ChromeOS only. + break; + + case ui::ET_LAST: + NOTREACHED(); + FALLTHROUGH; + + case ui::ET_UNKNOWN: + break; + } + + return enable_unknown_types_; +} + +bool EventFilter::IsTypeEnabled(InputTypes type) const { + return (enabled_input_types_ & static_cast<uint64_t>(type)); +}
diff --git a/fuchsia/engine/browser/event_filter.h b/fuchsia/engine/browser/event_filter.h new file mode 100644 index 0000000..8d3c7efc --- /dev/null +++ b/fuchsia/engine/browser/event_filter.h
@@ -0,0 +1,48 @@ +// Copyright 2019 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef FUCHSIA_ENGINE_BROWSER_EVENT_FILTER_H_ +#define FUCHSIA_ENGINE_BROWSER_EVENT_FILTER_H_ + +#include <fuchsia/web/cpp/fidl.h> +#include <memory> + +#include "base/macros.h" +#include "fuchsia/engine/web_engine_export.h" +#include "ui/events/event_handler.h" +#include "ui/events/types/event_type.h" + +// Event filter which can be configured to drop all events, or certain kinds of +// events. +class WEB_ENGINE_EXPORT EventFilter : public ui::EventHandler { + public: + EventFilter(); + ~EventFilter() override; + + EventFilter(const EventFilter&) = delete; + EventFilter& operator=(const EventFilter&) = delete; + + void ConfigureInputTypes(fuchsia::web::InputTypes types, + fuchsia::web::AllowInputState allow); + + private: + friend class EventFilterTest; + + bool IsEventAllowed(ui::EventType type); + + // Returns whether |type| is set in the |enabled_input_types_| bitmask. + bool IsTypeEnabled(fuchsia::web::InputTypes type) const; + + // ui::EventRewriter implementation. + void OnEvent(ui::Event* event) final; + void OnGestureEvent(ui::GestureEvent* event) final; + + uint64_t enabled_input_types_ = 0; + + // Allows input events not mapped to fuchsia::web::InputTypes entries + // to be processed. Set by allowing or denying fuchsia::web::InputTypes::ALL. + bool enable_unknown_types_ = true; +}; + +#endif // FUCHSIA_ENGINE_BROWSER_EVENT_FILTER_H_
diff --git a/fuchsia/engine/browser/event_filter_unittest.cc b/fuchsia/engine/browser/event_filter_unittest.cc new file mode 100644 index 0000000..6110d59 --- /dev/null +++ b/fuchsia/engine/browser/event_filter_unittest.cc
@@ -0,0 +1,208 @@ +// Copyright 2020 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include <fuchsia/web/cpp/fidl.h> + +#include "fuchsia/engine/browser/event_filter.h" +#include "testing/gtest/include/gtest/gtest.h" +#include "ui/events/event.h" + +using fuchsia::web::InputTypes; + +struct EventTypeMappingEntry { + ui::EventType ui_type; + fuchsia::web::InputTypes fuchsia_type; +}; + +constexpr EventTypeMappingEntry kEventTypeMappings[] = { + {ui::ET_MOUSE_PRESSED, InputTypes::MOUSE_CLICK}, + {ui::ET_MOUSE_DRAGGED, InputTypes::MOUSE_CLICK}, + {ui::ET_MOUSE_RELEASED, InputTypes::MOUSE_CLICK}, + + {ui::ET_MOUSE_MOVED, InputTypes::MOUSE_MOVE}, + {ui::ET_MOUSE_ENTERED, InputTypes::MOUSE_MOVE}, + {ui::ET_MOUSE_EXITED, InputTypes::MOUSE_MOVE}, + + {ui::ET_MOUSEWHEEL, InputTypes::MOUSE_WHEEL}, + + {ui::ET_GESTURE_TAP, InputTypes::GESTURE_TAP}, + {ui::ET_GESTURE_TAP_DOWN, InputTypes::GESTURE_TAP}, + {ui::ET_GESTURE_TAP_CANCEL, InputTypes::GESTURE_TAP}, + {ui::ET_GESTURE_TAP_UNCONFIRMED, InputTypes::GESTURE_TAP}, + {ui::ET_GESTURE_DOUBLE_TAP, InputTypes::GESTURE_TAP}, + {ui::ET_GESTURE_TWO_FINGER_TAP, InputTypes::GESTURE_TAP}, + {ui::ET_GESTURE_LONG_PRESS, InputTypes::GESTURE_TAP}, + {ui::ET_GESTURE_LONG_TAP, InputTypes::GESTURE_TAP}, + + {ui::ET_GESTURE_PINCH_BEGIN, InputTypes::GESTURE_PINCH}, + {ui::ET_GESTURE_PINCH_END, InputTypes::GESTURE_PINCH}, + {ui::ET_GESTURE_PINCH_UPDATE, InputTypes::GESTURE_PINCH}, + + {ui::ET_GESTURE_SCROLL_BEGIN, InputTypes::GESTURE_DRAG}, + {ui::ET_GESTURE_SCROLL_END, InputTypes::GESTURE_DRAG}, + {ui::ET_GESTURE_SCROLL_UPDATE, InputTypes::GESTURE_DRAG}, + {ui::ET_GESTURE_SWIPE, InputTypes::GESTURE_DRAG}, + {ui::ET_SCROLL, InputTypes::GESTURE_DRAG}, + {ui::ET_SCROLL_FLING_START, InputTypes::GESTURE_DRAG}, + {ui::ET_SCROLL_FLING_CANCEL, InputTypes::GESTURE_DRAG}, + + {ui::ET_KEY_PRESSED, InputTypes::KEY}, + {ui::ET_KEY_RELEASED, InputTypes::KEY}, +}; + +constexpr ui::EventType kAlwaysAllowedEventTypes[] = { + ui::ET_TOUCH_RELEASED, ui::ET_TOUCH_PRESSED, + ui::ET_TOUCH_MOVED, ui::ET_TOUCH_CANCELLED, + ui::ET_DROP_TARGET_EVENT, ui::ET_GESTURE_SHOW_PRESS, + ui::ET_GESTURE_BEGIN, ui::ET_GESTURE_END, + ui::ET_CANCEL_MODE, ui::ET_MOUSE_CAPTURE_CHANGED, +}; + +constexpr ui::EventType kUserEvent = + static_cast<ui::EventType>(ui::ET_LAST + 1); + +class TestEvent : public ui::Event { + public: + explicit TestEvent(ui::EventType type) + : ui::Event(type, {} /* time_stamp */, 0 /* flags */) {} + ~TestEvent() override = default; +}; + +class EventFilterTest : public testing::Test { + public: + EventFilterTest() = default; + ~EventFilterTest() override = default; + + protected: + void OnEvent(ui::Event* event) { event_filter_.OnEvent(event); } + + EventFilter event_filter_; +}; + +TEST_F(EventFilterTest, AllowedByDefault) { + for (const auto& entry : kEventTypeMappings) { + TestEvent event(entry.ui_type); + ASSERT_FALSE(event.stopped_propagation()); + OnEvent(&event); + EXPECT_FALSE(event.stopped_propagation()); + } +} + +TEST_F(EventFilterTest, SelectivelyAllowed) { + event_filter_.ConfigureInputTypes(fuchsia::web::InputTypes::ALL, + fuchsia::web::AllowInputState::DENY); + for (const auto& entry : kEventTypeMappings) { + event_filter_.ConfigureInputTypes(entry.fuchsia_type, + fuchsia::web::AllowInputState::ALLOW); + TestEvent event(entry.ui_type); + ASSERT_FALSE(event.stopped_propagation()); + OnEvent(&event); + EXPECT_FALSE(event.stopped_propagation()); + } +} + +TEST_F(EventFilterTest, AllDenied) { + event_filter_.ConfigureInputTypes(fuchsia::web::InputTypes::ALL, + fuchsia::web::AllowInputState::DENY); + for (const auto& entry : kEventTypeMappings) { + TestEvent event(entry.ui_type); + ASSERT_FALSE(event.stopped_propagation()); + OnEvent(&event); + EXPECT_TRUE(event.stopped_propagation()); + } +} + +TEST_F(EventFilterTest, SelectivelyDenied) { + for (const auto& entry : kEventTypeMappings) { + event_filter_.ConfigureInputTypes(entry.fuchsia_type, + fuchsia::web::AllowInputState::DENY); + TestEvent event(entry.ui_type); + ASSERT_FALSE(event.stopped_propagation()); + OnEvent(&event); + EXPECT_TRUE(event.stopped_propagation()); + } +} + +TEST_F(EventFilterTest, AllowCombination) { + event_filter_.ConfigureInputTypes(fuchsia::web::InputTypes::ALL, + fuchsia::web::AllowInputState::DENY); + event_filter_.ConfigureInputTypes( + InputTypes::MOUSE_CLICK | InputTypes::MOUSE_WHEEL, + fuchsia::web::AllowInputState::ALLOW); + + TestEvent event1(ui::ET_MOUSE_PRESSED); + ASSERT_FALSE(event1.stopped_propagation()); + OnEvent(&event1); + EXPECT_FALSE(event1.stopped_propagation()); + + TestEvent event2(ui::ET_MOUSEWHEEL); + ASSERT_FALSE(event2.stopped_propagation()); + OnEvent(&event2); + EXPECT_FALSE(event2.stopped_propagation()); + + // Events not explicitly re-enabled are still denied. + TestEvent dropped_event(ui::ET_KEY_PRESSED); + ASSERT_FALSE(dropped_event.stopped_propagation()); + OnEvent(&dropped_event); + EXPECT_TRUE(dropped_event.stopped_propagation()); +} + +TEST_F(EventFilterTest, AllowUnknown) { + TestEvent event(kUserEvent); + ASSERT_FALSE(event.stopped_propagation()); + OnEvent(&event); + EXPECT_FALSE(event.stopped_propagation()); + + TestEvent event2(ui::ET_UNKNOWN); + ASSERT_FALSE(event2.stopped_propagation()); + OnEvent(&event); + EXPECT_FALSE(event2.stopped_propagation()); +} + +TEST_F(EventFilterTest, DenyUnknown) { + event_filter_.ConfigureInputTypes(fuchsia::web::InputTypes::ALL, + fuchsia::web::AllowInputState::DENY); + TestEvent event(kUserEvent); + ASSERT_FALSE(event.stopped_propagation()); + OnEvent(&event); + EXPECT_TRUE(event.stopped_propagation()); + + TestEvent event2(ui::ET_UNKNOWN); + ASSERT_FALSE(event2.stopped_propagation()); + OnEvent(&event2); + EXPECT_TRUE(event2.stopped_propagation()); +} + +TEST_F(EventFilterTest, AllowUnknown_AllowAllAfterDenyAll) { + event_filter_.ConfigureInputTypes(fuchsia::web::InputTypes::ALL, + fuchsia::web::AllowInputState::DENY); + event_filter_.ConfigureInputTypes(fuchsia::web::InputTypes::ALL, + fuchsia::web::AllowInputState::ALLOW); + TestEvent event(kUserEvent); + ASSERT_FALSE(event.stopped_propagation()); + OnEvent(&event); + EXPECT_FALSE(event.stopped_propagation()); +} + +TEST_F(EventFilterTest, DenyUnknown_AllowSomeAfterDenyAll) { + event_filter_.ConfigureInputTypes(fuchsia::web::InputTypes::ALL, + fuchsia::web::AllowInputState::DENY); + event_filter_.ConfigureInputTypes(fuchsia::web::InputTypes::MOUSE_CLICK, + fuchsia::web::AllowInputState::ALLOW); + TestEvent event(kUserEvent); + ASSERT_FALSE(event.stopped_propagation()); + OnEvent(&event); + EXPECT_TRUE(event.stopped_propagation()); +} + +TEST_F(EventFilterTest, LowLevelAndControlAlwaysAllowed) { + event_filter_.ConfigureInputTypes(fuchsia::web::InputTypes::ALL, + fuchsia::web::AllowInputState::DENY); + for (ui::EventType type : kAlwaysAllowedEventTypes) { + TestEvent event(type); + ASSERT_FALSE(event.stopped_propagation()); + OnEvent(&event); + EXPECT_FALSE(event.stopped_propagation()); + } +}
diff --git a/fuchsia/engine/browser/frame_impl.cc b/fuchsia/engine/browser/frame_impl.cc index 3bed07e0..beff069 100644 --- a/fuchsia/engine/browser/frame_impl.cc +++ b/fuchsia/engine/browser/frame_impl.cc
@@ -34,6 +34,7 @@ #include "fuchsia/base/message_port.h" #include "fuchsia/engine/browser/accessibility_bridge.h" #include "fuchsia/engine/browser/context_impl.h" +#include "fuchsia/engine/browser/event_filter.h" #include "fuchsia/engine/browser/frame_layout_manager.h" #include "fuchsia/engine/browser/web_engine_devtools_controller.h" #include "mojo/public/cpp/bindings/associated_remote.h" @@ -517,6 +518,7 @@ aura::client::SetFocusClient(root_window(), nullptr); wm::SetActivationClient(root_window(), nullptr); + root_window()->RemovePreTargetHandler(&event_filter_); root_window()->RemovePreTargetHandler(focus_controller_.get()); web_contents_->GetNativeView()->Hide(); window_tree_host_->Hide(); @@ -741,8 +743,9 @@ log_level_ = ConsoleLogLevelToLoggingSeverity(level); } -void FrameImpl::SetEnableInput(bool enable_input) { - discarding_event_filter_.set_discard_events(!enable_input); +void FrameImpl::ConfigureInputTypes(fuchsia::web::InputTypes types, + fuchsia::web::AllowInputState allow) { + event_filter_.ConfigureInputTypes(types, allow); } void FrameImpl::SetPopupFrameCreationListener( @@ -804,9 +807,7 @@ window_tree_host_ = std::move(window_tree_host); window_tree_host_->InitHost(); - - window_tree_host_->window()->GetHost()->AddEventRewriter( - &discarding_event_filter_); + root_window()->AddPreTargetHandler(&event_filter_); // Add hooks which automatically set the focus state when input events are // received.
diff --git a/fuchsia/engine/browser/frame_impl.h b/fuchsia/engine/browser/frame_impl.h index 46429c9..9052d30d 100644 --- a/fuchsia/engine/browser/frame_impl.h +++ b/fuchsia/engine/browser/frame_impl.h
@@ -21,7 +21,7 @@ #include "content/public/browser/web_contents_delegate.h" #include "content/public/browser/web_contents_observer.h" #include "fuchsia/engine/browser/accessibility_bridge.h" -#include "fuchsia/engine/browser/discarding_event_filter.h" +#include "fuchsia/engine/browser/event_filter.h" #include "fuchsia/engine/browser/frame_permission_controller.h" #include "fuchsia/engine/browser/navigation_controller_impl.h" #include "fuchsia/engine/browser/url_request_rewrite_rules_manager.h" @@ -163,7 +163,8 @@ fidl::InterfaceHandle<fuchsia::web::NavigationEventListener> listener) override; void SetJavaScriptLogLevel(fuchsia::web::ConsoleLogLevel level) override; - void SetEnableInput(bool enable_input) override; + void ConfigureInputTypes(fuchsia::web::InputTypes types, + fuchsia::web::AllowInputState allow) override; void SetPopupFrameCreationListener( fidl::InterfaceHandle<fuchsia::web::PopupFrameCreationListener> listener) override; @@ -226,7 +227,6 @@ std::unique_ptr<aura::WindowTreeHost> window_tree_host_; std::unique_ptr<wm::FocusController> focus_controller_; - DiscardingEventFilter discarding_event_filter_; // Owned via |window_tree_host_|. FrameLayoutManager* layout_manager_ = nullptr; @@ -235,6 +235,7 @@ fuchsia::accessibility::semantics::SemanticsManagerPtr semantics_manager_for_test_; + EventFilter event_filter_; NavigationControllerImpl navigation_controller_; logging::LogSeverity log_level_; std::map<uint64_t, OriginScopedScript> before_load_scripts_;
diff --git a/fuchsia/runners/cast/application_controller_impl.cc b/fuchsia/runners/cast/application_controller_impl.cc index 766eab0c..90fac16 100644 --- a/fuchsia/runners/cast/application_controller_impl.cc +++ b/fuchsia/runners/cast/application_controller_impl.cc
@@ -26,5 +26,8 @@ ApplicationControllerImpl::~ApplicationControllerImpl() = default; void ApplicationControllerImpl::SetTouchInputEnabled(bool enable) { - frame_->SetEnableInput(enable); + frame_->ConfigureInputTypes(fuchsia::web::InputTypes::GESTURE_TAP | + fuchsia::web::InputTypes::GESTURE_DRAG, + (enable ? fuchsia::web::AllowInputState::ALLOW + : fuchsia::web::AllowInputState::DENY)); }
diff --git a/fuchsia/runners/cast/application_controller_impl_unittest.cc b/fuchsia/runners/cast/application_controller_impl_unittest.cc index 6d18a09..ae9ff9b 100644 --- a/fuchsia/runners/cast/application_controller_impl_unittest.cc +++ b/fuchsia/runners/cast/application_controller_impl_unittest.cc
@@ -26,7 +26,9 @@ LOG(FATAL) << "No mock defined for " << name; } - MOCK_METHOD1(SetEnableInput, void(bool)); + MOCK_METHOD2(ConfigureInputTypes, + void(fuchsia::web::InputTypes types, + fuchsia::web::AllowInputState allow)); }; class ApplicationControllerImplTest : public chromium::cast::ApplicationContext, @@ -71,11 +73,18 @@ }; // Verifies that SetTouchInputEnabled() calls the Frame API correctly. -TEST_F(ApplicationControllerImplTest, SetEnableInput) { +TEST_F(ApplicationControllerImplTest, ConfigureInputTypes) { base::RunLoop run_loop; - EXPECT_CALL(frame_, SetEnableInput(true)).Times(2); - EXPECT_CALL(frame_, SetEnableInput(false)) + EXPECT_CALL(frame_, + ConfigureInputTypes(fuchsia::web::InputTypes::GESTURE_TAP | + fuchsia::web::InputTypes::GESTURE_DRAG, + fuchsia::web::AllowInputState::ALLOW)) + .Times(2); + EXPECT_CALL(frame_, + ConfigureInputTypes(fuchsia::web::InputTypes::GESTURE_TAP | + fuchsia::web::InputTypes::GESTURE_DRAG, + fuchsia::web::AllowInputState::DENY)) .WillOnce(InvokeWithoutArgs([&run_loop]() { run_loop.Quit(); })); application_ptr_->SetTouchInputEnabled(true);
diff --git a/fuchsia/runners/cast/cast_component.cc b/fuchsia/runners/cast/cast_component.cc index 635345a..2fcf3f0 100644 --- a/fuchsia/runners/cast/cast_component.cc +++ b/fuchsia/runners/cast/cast_component.cc
@@ -69,7 +69,8 @@ OnRewriteRulesReceived(std::move(initial_rewrite_rules_)); frame()->SetMediaSessionId(media_session_id_); - frame()->SetEnableInput(false); + frame()->ConfigureInputTypes(fuchsia::web::InputTypes::ALL, + fuchsia::web::AllowInputState::DENY); frame()->SetNavigationEventListener( navigation_listener_binding_.NewBinding()); api_bindings_client_->AttachToFrame(
diff --git a/gpu/ipc/service/gpu_watchdog_thread_v2.cc b/gpu/ipc/service/gpu_watchdog_thread_v2.cc index d52eba6..6dcf2ded 100644 --- a/gpu/ipc/service/gpu_watchdog_thread_v2.cc +++ b/gpu/ipc/service/gpu_watchdog_thread_v2.cc
@@ -219,7 +219,7 @@ base::BindOnce(&GpuWatchdogThreadImplV2::OnWatchdogTimeout, weak_ptr_), timeout); - last_arm_disarm_counter_ = base::subtle::NoBarrier_Load(&arm_disarm_counter_); + last_arm_disarm_counter_ = ReadArmDisarmCounter(); watchdog_start_timeticks_ = base::TimeTicks::Now(); last_on_watchdog_timeout_timeticks_ = watchdog_start_timeticks_; @@ -327,8 +327,7 @@ base::BindOnce(&GpuWatchdogThreadImplV2::OnWatchdogTimeout, weak_ptr_), timeout); last_on_watchdog_timeout_timeticks_ = base::TimeTicks::Now(); - last_arm_disarm_counter_ = - base::subtle::NoBarrier_Load(&arm_disarm_counter_); + last_arm_disarm_counter_ = ReadArmDisarmCounter(); #if defined(OS_WIN) if (watched_thread_handle_) { last_on_watchdog_timeout_thread_ticks_ = GetWatchedThreadTime(); @@ -406,7 +405,11 @@ bool GpuWatchdogThreadImplV2::IsArmed() { // It's an odd number. - return base::subtle::NoBarrier_Load(&arm_disarm_counter_) & 1; + return base::subtle::Release_Load(&arm_disarm_counter_) & 1; +} + +base::subtle::Atomic32 GpuWatchdogThreadImplV2::ReadArmDisarmCounter() { + return base::subtle::Release_Load(&arm_disarm_counter_); } // Running on the watchdog thread. @@ -426,8 +429,7 @@ GpuWatchdogHistogram(GpuWatchdogThreadEvent::kGpuWatchdogStart); } - base::subtle::Atomic32 arm_disarm_counter = - base::subtle::NoBarrier_Load(&arm_disarm_counter_); + auto arm_disarm_counter = ReadArmDisarmCounter(); GpuWatchdogTimeoutHistogram(GpuWatchdogTimeoutEvent::kTimeout); if (power_resumed_event_) num_of_timeout_after_power_resume_++; @@ -452,8 +454,7 @@ // No gpu hang. Continue with another OnWatchdogTimeout task. if (no_gpu_hang) { last_on_watchdog_timeout_timeticks_ = base::TimeTicks::Now(); - last_arm_disarm_counter_ = - base::subtle::NoBarrier_Load(&arm_disarm_counter_); + last_arm_disarm_counter_ = ReadArmDisarmCounter(); task_runner()->PostDelayedTask( FROM_HERE, @@ -630,8 +631,7 @@ crash_keys::num_of_processors.Set(base::NumberToString(num_of_processors_)); // Check the arm_disarm_counter value one more time. - base::subtle::Atomic32 last_arm_disarm_counter = - base::subtle::NoBarrier_Load(&arm_disarm_counter_); + auto last_arm_disarm_counter = ReadArmDisarmCounter(); base::debug::Alias(&last_arm_disarm_counter); // Deliberately crash the process to create a crash dump.
diff --git a/gpu/ipc/service/gpu_watchdog_thread_v2.h b/gpu/ipc/service/gpu_watchdog_thread_v2.h index f47586a..8fb5939 100644 --- a/gpu/ipc/service/gpu_watchdog_thread_v2.h +++ b/gpu/ipc/service/gpu_watchdog_thread_v2.h
@@ -79,6 +79,7 @@ void Disarm(); void InProgress(); bool IsArmed(); + base::subtle::Atomic32 ReadArmDisarmCounter(); void OnWatchdogTimeout(); bool WatchedThreadNeedsMoreThreadTime(bool no_gpu_hang_detected); #if defined(OS_WIN)
diff --git a/infra/config/buckets/ci.star b/infra/config/buckets/ci.star index b3bb26a..74462ae 100644 --- a/infra/config/buckets/ci.star +++ b/infra/config/buckets/ci.star
@@ -359,6 +359,7 @@ ci.clang_builder( name = 'CFI Linux CF', + goma_backend = goma.backend.RBE_PROD, ) ci.clang_builder(
diff --git a/infra/config/consoles/chromium-header.textpb b/infra/config/consoles/chromium-header.textpb index 4788a99..0b121a5 100644 --- a/infra/config/consoles/chromium-header.textpb +++ b/infra/config/consoles/chromium-header.textpb
@@ -164,13 +164,13 @@ links { name: "Branch Consoles" links { - text: "beta" - url: "/p/chromium/g/main-beta/console" + text: "m81" + url: "/p/chromium/g/main-m81/console" alt: "Beta branch console" } links { - text: "stable" - url: "/p/chromium/g/main-stable/console" + text: "m80" + url: "/p/chromium/g/main-m80/console" alt: "Stable branch console" } links {
diff --git a/infra/config/consoles/main.star b/infra/config/consoles/main.star index d368349a..67ada62 100644 --- a/infra/config/consoles/main.star +++ b/infra/config/consoles/main.star
@@ -1,680 +1,3 @@ -luci.console_view( - name = 'main', - header = '//consoles/chromium-header.textpb', - repo = 'https://chromium.googlesource.com/chromium/src', - title = 'Chromium Main Console', - entries = [ - luci.console_view_entry( - builder = 'ci/android-archive-dbg', - category = 'chromium|android', - short_name = 'dbg', - ), - luci.console_view_entry( - builder = 'ci/android-archive-rel', - category = 'chromium|android', - short_name = 'rel', - ), - luci.console_view_entry( - builder = 'ci/linux-archive-dbg', - category = 'chromium|linux', - short_name = 'dbg', - ), - luci.console_view_entry( - builder = 'ci/linux-archive-rel', - category = 'chromium|linux', - short_name = 'rel', - ), - luci.console_view_entry( - builder = 'ci/mac-archive-dbg', - category = 'chromium|mac', - short_name = 'dbg', - ), - luci.console_view_entry( - builder = 'ci/mac-archive-rel', - category = 'chromium|mac', - short_name = 'rel', - ), - luci.console_view_entry( - builder = 'ci/win32-archive-rel', - category = 'chromium|win|rel', - short_name = '32', - ), - luci.console_view_entry( - builder = 'ci/win-archive-rel', - category = 'chromium|win|rel', - short_name = '64', - ), - luci.console_view_entry( - builder = 'ci/win32-archive-dbg', - category = 'chromium|win|dbg', - short_name = '32', - ), - luci.console_view_entry( - builder = 'ci/win-archive-dbg', - category = 'chromium|win|dbg', - short_name = '64', - ), - luci.console_view_entry( - builder = 'ci/Win Builder', - category = 'chromium.win|release|builder', - short_name = '32', - ), - luci.console_view_entry( - builder = 'ci/Win x64 Builder', - category = 'chromium.win|release|builder', - short_name = '64', - ), - luci.console_view_entry( - builder = 'ci/Win7 (32) Tests', - category = 'chromium.win|release|tester', - short_name = '32', - ), - luci.console_view_entry( - builder = 'ci/Win7 Tests (1)', - category = 'chromium.win|release|tester', - short_name = '32', - ), - luci.console_view_entry( - builder = 'ci/Win 7 Tests x64 (1)', - category = 'chromium.win|release|tester', - short_name = '64', - ), - luci.console_view_entry( - builder = 'ci/Win10 Tests x64', - category = 'chromium.win|release|tester', - short_name = 'w10', - ), - luci.console_view_entry( - builder = 'ci/Win x64 Builder (dbg)', - category = 'chromium.win|debug|builder', - short_name = '64', - ), - luci.console_view_entry( - builder = 'ci/Win Builder (dbg)', - category = 'chromium.win|debug|builder', - short_name = '32', - ), - luci.console_view_entry( - builder = 'ci/Win7 Tests (dbg)(1)', - category = 'chromium.win|debug|tester', - short_name = '7', - ), - luci.console_view_entry( - builder = 'ci/Win10 Tests x64 (dbg)', - category = 'chromium.win|debug|tester', - short_name = '10', - ), - luci.console_view_entry( - builder = 'ci/Windows deterministic', - category = 'chromium.win|misc', - short_name = 'det', - ), - luci.console_view_entry( - builder = 'ci/WebKit Win10', - category = 'chromium.win|misc', - short_name = 'wbk', - ), - luci.console_view_entry( - builder = 'ci/Mac Builder', - category = 'chromium.mac|release', - short_name = 'bld', - ), - luci.console_view_entry( - builder = 'ci/Mac10.10 Tests', - category = 'chromium.mac|release', - short_name = '10', - ), - luci.console_view_entry( - builder = 'ci/Mac10.11 Tests', - category = 'chromium.mac|release', - short_name = '11', - ), - luci.console_view_entry( - builder = 'ci/Mac10.12 Tests', - category = 'chromium.mac|release', - short_name = '12', - ), - luci.console_view_entry( - builder = 'ci/Mac10.13 Tests', - category = 'chromium.mac|release', - short_name = '13', - ), - luci.console_view_entry( - builder = 'ci/Mac10.14 Tests', - category = 'chromium.mac|release', - short_name = '14', - ), - luci.console_view_entry( - builder = 'ci/WebKit Mac10.13 (retina)', - category = 'chromium.mac|release', - short_name = 'ret', - ), - luci.console_view_entry( - builder = 'ci/Mac Builder (dbg)', - category = 'chromium.mac|debug', - short_name = 'bld', - ), - luci.console_view_entry( - builder = 'ci/Mac10.13 Tests (dbg)', - category = 'chromium.mac|debug', - short_name = '13', - ), - luci.console_view_entry( - builder = 'ci/ios-device', - category = 'chromium.mac|ios|default', - short_name = 'dev', - ), - luci.console_view_entry( - builder = 'ci/ios-simulator', - category = 'chromium.mac|ios|default', - short_name = 'sim', - ), - luci.console_view_entry( - builder = 'ci/ios-simulator-full-configs', - category = 'chromium.mac|ios|default', - short_name = 'ful', - ), - luci.console_view_entry( - builder = 'ci/ios-simulator-noncq', - category = 'chromium.mac|ios|default', - short_name = 'non', - ), - luci.console_view_entry( - builder = 'ci/Linux Builder', - category = 'chromium.linux|release', - short_name = 'bld', - ), - luci.console_view_entry( - builder = 'ci/Linux Tests', - category = 'chromium.linux|release', - short_name = 'tst', - ), - luci.console_view_entry( - builder = 'ci/Network Service Linux', - category = 'chromium.linux|release', - short_name = 'nsl', - ), - luci.console_view_entry( - builder = 'ci/linux-gcc-rel', - category = 'chromium.linux|release', - short_name = 'gcc', - ), - luci.console_view_entry( - builder = 'ci/Deterministic Linux', - category = 'chromium.linux|release', - short_name = 'det', - ), - luci.console_view_entry( - builder = 'ci/linux-ozone-rel', - category = 'chromium.linux|release', - short_name = 'ozo', - ), - luci.console_view_entry( - builder = 'ci/linux-trusty-rel', - category = 'chromium.linux|release', - short_name = 'tru', - ), - luci.console_view_entry( - builder = 'ci/Linux Builder (dbg)(32)', - category = 'chromium.linux|debug|builder', - short_name = '32', - ), - luci.console_view_entry( - builder = 'ci/Linux Builder (dbg)', - category = 'chromium.linux|debug|builder', - short_name = '64', - ), - luci.console_view_entry( - builder = 'ci/Deterministic Linux (dbg)', - category = 'chromium.linux|debug|builder', - short_name = 'det', - ), - luci.console_view_entry( - builder = 'ci/Linux Tests (dbg)(1)', - category = 'chromium.linux|debug|tester', - short_name = '64', - ), - luci.console_view_entry( - builder = 'ci/Cast Linux', - category = 'chromium.linux|cast', - short_name = 'vid', - ), - luci.console_view_entry( - builder = 'ci/Cast Audio Linux', - category = 'chromium.linux|cast', - short_name = 'aud', - ), - luci.console_view_entry( - builder = 'ci/Fuchsia ARM64', - category = 'chromium.linux|fuchsia|a64', - ), - luci.console_view_entry( - builder = 'ci/fuchsia-arm64-cast', - category = 'chromium.linux|fuchsia|cast', - short_name = 'a64', - ), - luci.console_view_entry( - builder = 'ci/fuchsia-x64-cast', - category = 'chromium.linux|fuchsia|cast', - short_name = 'x64', - ), - luci.console_view_entry( - builder = 'ci/Deterministic Fuchsia (dbg)', - category = 'chromium.linux|fuchsia|x64', - short_name = 'det', - ), - luci.console_view_entry( - builder = 'ci/Fuchsia x64', - category = 'chromium.linux|fuchsia|x64', - short_name = 'rel', - ), - luci.console_view_entry( - builder = 'ci/Linux ChromiumOS Full', - category = 'chromium.chromiumos|default', - short_name = 'ful', - ), - luci.console_view_entry( - builder = 'ci/linux-chromeos-rel', - category = 'chromium.chromiumos|default', - short_name = 'rel', - ), - luci.console_view_entry( - builder = 'ci/linux-chromeos-dbg', - category = 'chromium.chromiumos|default', - short_name = 'dbg', - ), - luci.console_view_entry( - builder = 'ci/chromeos-amd64-generic-asan-rel', - category = 'chromium.chromiumos|simple|release|x64', - short_name = 'asn', - ), - luci.console_view_entry( - builder = 'ci/chromeos-amd64-generic-cfi-thin-lto-rel', - category = 'chromium.chromiumos|simple|release|x64', - short_name = 'cfi', - ), - luci.console_view_entry( - builder = 'ci/chromeos-amd64-generic-dbg', - category = 'chromium.chromiumos|simple|debug|x64', - short_name = 'dbg', - ), - luci.console_view_entry( - builder = 'ci/chromeos-amd64-generic-rel', - category = 'chromium.chromiumos|simple|release|x64', - short_name = 'rel', - ), - luci.console_view_entry( - builder = 'ci/chromeos-arm-generic-dbg', - category = 'chromium.chromiumos|simple|debug', - short_name = 'arm', - ), - luci.console_view_entry( - builder = 'ci/chromeos-arm-generic-rel', - category = 'chromium.chromiumos|simple|release', - short_name = 'arm', - ), - luci.console_view_entry( - builder = 'ci/chromeos-kevin-rel', - category = 'chromium.chromiumos|simple|release', - short_name = 'kvn', - ), - luci.console_view_entry( - builder = 'ci/android-cronet-arm-dbg', - category = 'chromium.android|cronet|arm', - short_name = 'dbg', - ), - luci.console_view_entry( - builder = 'ci/android-cronet-arm-rel', - category = 'chromium.android|cronet|arm', - short_name = 'rel', - ), - luci.console_view_entry( - builder = 'ci/android-cronet-kitkat-arm-rel', - category = 'chromium.android|cronet|test', - short_name = 'k', - ), - luci.console_view_entry( - builder = 'ci/android-cronet-lollipop-arm-rel', - category = 'chromium.android|cronet|test', - short_name = 'l', - ), - luci.console_view_entry( - builder = 'ci/Android arm Builder (dbg)', - category = 'chromium.android|builder|arm', - short_name = '32', - ), - luci.console_view_entry( - builder = 'ci/Android arm64 Builder (dbg)', - category = 'chromium.android|builder|arm', - short_name = '64', - ), - luci.console_view_entry( - builder = 'ci/Android x86 Builder (dbg)', - category = 'chromium.android|builder|x86', - short_name = '32', - ), - luci.console_view_entry( - builder = 'ci/Android x64 Builder (dbg)', - category = 'chromium.android|builder|x86', - short_name = '64', - ), - luci.console_view_entry( - builder = 'ci/KitKat Phone Tester (dbg)', - category = 'chromium.android|tester|phone', - short_name = 'K', - ), - luci.console_view_entry( - builder = 'ci/Lollipop Phone Tester', - category = 'chromium.android|tester|phone', - short_name = 'L', - ), - luci.console_view_entry( - builder = 'ci/Marshmallow 64 bit Tester', - category = 'chromium.android|tester|phone', - short_name = 'M', - ), - luci.console_view_entry( - builder = 'ci/Nougat Phone Tester', - category = 'chromium.android|tester|phone', - short_name = 'N', - ), - luci.console_view_entry( - builder = 'ci/Oreo Phone Tester', - category = 'chromium.android|tester|phone', - short_name = 'O', - ), - luci.console_view_entry( - builder = 'ci/android-pie-arm64-dbg', - category = 'chromium.android|tester|phone', - short_name = 'P', - ), - luci.console_view_entry( - builder = 'ci/KitKat Tablet Tester', - category = 'chromium.android|tester|tablet', - short_name = 'K', - ), - luci.console_view_entry( - builder = 'ci/Lollipop Tablet Tester', - category = 'chromium.android|tester|tablet', - short_name = 'L', - ), - luci.console_view_entry( - builder = 'ci/Marshmallow Tablet Tester', - category = 'chromium.android|tester|tablet', - short_name = 'M', - ), - luci.console_view_entry( - builder = 'ci/Android WebView L (dbg)', - category = 'chromium.android|tester|webview', - short_name = 'L', - ), - luci.console_view_entry( - builder = 'ci/Android WebView M (dbg)', - category = 'chromium.android|tester|webview', - short_name = 'M', - ), - luci.console_view_entry( - builder = 'ci/Android WebView N (dbg)', - category = 'chromium.android|tester|webview', - short_name = 'N', - ), - luci.console_view_entry( - builder = 'ci/Android WebView O (dbg)', - category = 'chromium.android|tester|webview', - short_name = 'O', - ), - luci.console_view_entry( - builder = 'ci/Android WebView P (dbg)', - category = 'chromium.android|tester|webview', - short_name = 'P', - ), - luci.console_view_entry( - builder = 'ci/android-kitkat-arm-rel', - category = 'chromium.android|on_cq', - short_name = 'K', - ), - luci.console_view_entry( - builder = 'ci/android-marshmallow-arm64-rel', - category = 'chromium.android|on_cq', - short_name = 'M', - ), - luci.console_view_entry( - builder = 'ci/Cast Android (dbg)', - category = 'chromium.android|on_cq', - short_name = 'cst', - ), - luci.console_view_entry( - builder = 'ci/android-pie-arm64-rel', - category = 'chromium.android|on_cq', - short_name = 'P', - ), - luci.console_view_entry( - builder = 'chrome:ci/linux-chromeos-chrome', - category = 'chrome', - short_name = 'cro', - ), - luci.console_view_entry( - builder = 'chrome:ci/linux-chrome', - category = 'chrome', - short_name = 'lnx', - ), - luci.console_view_entry( - builder = 'chrome:ci/mac-chrome', - category = 'chrome', - short_name = 'mac', - ), - luci.console_view_entry( - builder = 'chrome:ci/win-chrome', - category = 'chrome', - short_name = 'win', - ), - luci.console_view_entry( - builder = 'ci/win-asan', - category = 'chromium.memory|win', - short_name = 'asn', - ), - luci.console_view_entry( - builder = 'ci/Mac ASan 64 Builder', - category = 'chromium.memory|mac', - short_name = 'bld', - ), - luci.console_view_entry( - builder = 'ci/Mac ASan 64 Tests (1)', - category = 'chromium.memory|mac', - short_name = 'tst', - ), - luci.console_view_entry( - builder = 'ci/Linux TSan Builder', - category = 'chromium.memory|linux|TSan v2', - short_name = 'bld', - ), - luci.console_view_entry( - builder = 'ci/Linux TSan Tests', - category = 'chromium.memory|linux|TSan v2', - short_name = 'tst', - ), - luci.console_view_entry( - builder = 'ci/Linux ASan LSan Builder', - category = 'chromium.memory|linux|asan lsan', - short_name = 'bld', - ), - luci.console_view_entry( - builder = 'ci/Linux ASan LSan Tests (1)', - category = 'chromium.memory|linux|asan lsan', - short_name = 'tst', - ), - luci.console_view_entry( - builder = 'ci/Linux ASan Tests (sandboxed)', - category = 'chromium.memory|linux|asan lsan', - short_name = 'sbx', - ), - luci.console_view_entry( - builder = 'ci/Linux MSan Builder', - category = 'chromium.memory|linux|msan', - short_name = 'bld', - ), - luci.console_view_entry( - builder = 'ci/Linux MSan Tests', - category = 'chromium.memory|linux|msan', - short_name = 'tst', - ), - luci.console_view_entry( - builder = 'ci/WebKit Linux ASAN', - category = 'chromium.memory|linux|webkit', - short_name = 'asn', - ), - luci.console_view_entry( - builder = 'ci/WebKit Linux MSAN', - category = 'chromium.memory|linux|webkit', - short_name = 'msn', - ), - luci.console_view_entry( - builder = 'ci/WebKit Linux Leak', - category = 'chromium.memory|linux|webkit', - short_name = 'lk', - ), - luci.console_view_entry( - builder = 'ci/Linux Chromium OS ASan LSan Builder', - category = 'chromium.memory|cros|asan', - short_name = 'bld', - ), - luci.console_view_entry( - builder = 'ci/Linux Chromium OS ASan LSan Tests (1)', - category = 'chromium.memory|cros|asan', - short_name = 'tst', - ), - luci.console_view_entry( - builder = 'ci/Linux ChromiumOS MSan Builder', - category = 'chromium.memory|cros|msan', - short_name = 'bld', - ), - luci.console_view_entry( - builder = 'ci/Linux ChromiumOS MSan Tests', - category = 'chromium.memory|cros|msan', - short_name = 'tst', - ), - luci.console_view_entry( - builder = 'ci/android-asan', - category = 'chromium.memory|android', - short_name = 'asn', - ), - luci.console_view_entry( - builder = 'ci/Linux CFI', - category = 'chromium.memory|cfi', - short_name = 'lnx', - ), - luci.console_view_entry( - builder = 'ci/Dawn Linux x64 DEPS Builder', - category = 'chromium.dawn|DEPS|Linux|Builder', - short_name = 'x64', - ), - luci.console_view_entry( - builder = 'ci/Dawn Linux x64 DEPS Release (Intel HD 630)', - category = 'chromium.dawn|DEPS|Linux|Intel', - short_name = 'x64', - ), - luci.console_view_entry( - builder = 'ci/Dawn Linux x64 DEPS Release (NVIDIA)', - category = 'chromium.dawn|DEPS|Linux|Nvidia', - short_name = 'x64', - ), - luci.console_view_entry( - builder = 'ci/Dawn Mac x64 DEPS Builder', - category = 'chromium.dawn|DEPS|Mac|Builder', - short_name = 'x64', - ), - luci.console_view_entry( - builder = 'ci/Dawn Mac x64 DEPS Release (AMD)', - category = 'chromium.dawn|DEPS|Mac|AMD', - short_name = 'x64', - ), - luci.console_view_entry( - builder = 'ci/Dawn Mac x64 DEPS Release (Intel)', - category = 'chromium.dawn|DEPS|Mac|Intel', - short_name = 'x64', - ), - luci.console_view_entry( - builder = 'ci/Dawn Win10 x86 DEPS Builder', - category = 'chromium.dawn|DEPS|Windows|Builder', - short_name = 'x86', - ), - luci.console_view_entry( - builder = 'ci/Dawn Win10 x64 DEPS Builder', - category = 'chromium.dawn|DEPS|Windows|Builder', - short_name = 'x64', - ), - luci.console_view_entry( - builder = 'ci/Dawn Win10 x86 DEPS Release (Intel HD 630)', - category = 'chromium.dawn|DEPS|Windows|Intel', - short_name = 'x86', - ), - luci.console_view_entry( - builder = 'ci/Dawn Win10 x64 DEPS Release (Intel HD 630)', - category = 'chromium.dawn|DEPS|Windows|Intel', - short_name = 'x64', - ), - luci.console_view_entry( - builder = 'ci/Dawn Win10 x86 DEPS Release (NVIDIA)', - category = 'chromium.dawn|DEPS|Windows|Nvidia', - short_name = 'x86', - ), - luci.console_view_entry( - builder = 'ci/Dawn Win10 x64 DEPS Release (NVIDIA)', - category = 'chromium.dawn|DEPS|Windows|Nvidia', - short_name = 'x64', - ), - luci.console_view_entry( - builder = 'ci/GPU Mac Builder', - category = 'chromium.gpu|Mac', - ), - luci.console_view_entry( - builder = 'ci/Mac Release (Intel)', - category = 'chromium.gpu|Mac', - ), - luci.console_view_entry( - builder = 'ci/Mac Retina Release (AMD)', - category = 'chromium.gpu|Mac', - ), - luci.console_view_entry( - builder = 'ci/GPU Linux Builder', - category = 'chromium.gpu|Linux', - ), - luci.console_view_entry( - builder = 'ci/Linux Release (NVIDIA)', - category = 'chromium.gpu|Linux', - ), - luci.console_view_entry( - builder = 'ci/Android Release (Nexus 5X)', - category = 'chromium.gpu|Android', - ), - # TODO(gbeaty): FYI builders should not be mirrors for try builders on - # the CQ, but things are what they are - luci.console_view_entry( - builder = 'ci/ios-simulator-cronet', - category = 'chromium.fyi|cronet', - ), - luci.console_view_entry( - builder = 'ci/mac-osxbeta-rel', - category = 'chromium.fyi|mac', - short_name = 'beta', - ), - luci.console_view_entry( - builder = 'ci/chromeos-kevin-rel-hw-tests', - category = 'chromium.fyi|chromos', - ), - luci.console_view_entry( - builder = 'ci/VR Linux', - category = 'chromium.fyi|linux', - ), - luci.console_view_entry( - builder = 'ci/Linux Ozone Tester (Wayland)', - category = 'chromium.fyi|linux', - short_name = 'low', - ), - luci.console_view_entry( - builder = 'ci/Linux Ozone Tester (X11)', - category = 'chromium.fyi|linux', - short_name = 'lox', - ), - ], -) +exec('//versioned/trunk/consoles/main.star') +exec('//versioned/milestones/m80/consoles/main.star') +exec('//versioned/milestones/m81/consoles/main.star')
diff --git a/infra/config/generated/cr-buildbucket.cfg b/infra/config/generated/cr-buildbucket.cfg index 2c4a6eb..bb1e602e 100644 --- a/infra/config/generated/cr-buildbucket.cfg +++ b/infra/config/generated/cr-buildbucket.cfg
@@ -817,6 +817,7 @@ name: "chromium" cipd_package: "infra/recipe_bundles/chromium.googlesource.com/chromium/tools/build" cipd_version: "refs/heads/master" + properties_j: "$build/goma:{\"enable_ats\":true,\"rpc_extra_params\":\"?prod\",\"server_host\":\"goma.chromium.org\"}" properties_j: "$kitchen:{\"devshell\":true,\"git_auth\":true}" properties_j: "mastername:\"chromium.clang\"" properties_j: "perf_dashboard_machine_group:\"ChromiumClang\""
diff --git a/infra/config/generated/luci-milo.cfg b/infra/config/generated/luci-milo.cfg index 976fea8..55dd710 100644 --- a/infra/config/generated/luci-milo.cfg +++ b/infra/config/generated/luci-milo.cfg
@@ -185,13 +185,13 @@ links: < name: "Branch Consoles" links: < - text: "beta" - url: "/p/chromium/g/main-beta/console" + text: "m81" + url: "/p/chromium/g/main-m81/console" alt: "Beta branch console" > links: < - text: "stable" - url: "/p/chromium/g/main-stable/console" + text: "m80" + url: "/p/chromium/g/main-m80/console" alt: "Stable branch console" > links: < @@ -557,13 +557,13 @@ links: < name: "Branch Consoles" links: < - text: "beta" - url: "/p/chromium/g/main-beta/console" + text: "m81" + url: "/p/chromium/g/main-m81/console" alt: "Beta branch console" > links: < - text: "stable" - url: "/p/chromium/g/main-stable/console" + text: "m80" + url: "/p/chromium/g/main-m80/console" alt: "Stable branch console" > links: < @@ -1033,13 +1033,13 @@ links: < name: "Branch Consoles" links: < - text: "beta" - url: "/p/chromium/g/main-beta/console" + text: "m81" + url: "/p/chromium/g/main-m81/console" alt: "Beta branch console" > links: < - text: "stable" - url: "/p/chromium/g/main-stable/console" + text: "m80" + url: "/p/chromium/g/main-m80/console" alt: "Stable branch console" > links: < @@ -1339,13 +1339,13 @@ links: < name: "Branch Consoles" links: < - text: "beta" - url: "/p/chromium/g/main-beta/console" + text: "m81" + url: "/p/chromium/g/main-m81/console" alt: "Beta branch console" > links: < - text: "stable" - url: "/p/chromium/g/main-stable/console" + text: "m80" + url: "/p/chromium/g/main-m80/console" alt: "Stable branch console" > links: < @@ -1661,13 +1661,13 @@ links: < name: "Branch Consoles" links: < - text: "beta" - url: "/p/chromium/g/main-beta/console" + text: "m81" + url: "/p/chromium/g/main-m81/console" alt: "Beta branch console" > links: < - text: "stable" - url: "/p/chromium/g/main-stable/console" + text: "m80" + url: "/p/chromium/g/main-m80/console" alt: "Stable branch console" > links: < @@ -2137,13 +2137,13 @@ links: < name: "Branch Consoles" links: < - text: "beta" - url: "/p/chromium/g/main-beta/console" + text: "m81" + url: "/p/chromium/g/main-m81/console" alt: "Beta branch console" > links: < - text: "stable" - url: "/p/chromium/g/main-stable/console" + text: "m80" + url: "/p/chromium/g/main-m80/console" alt: "Stable branch console" > links: < @@ -2529,13 +2529,13 @@ links: < name: "Branch Consoles" links: < - text: "beta" - url: "/p/chromium/g/main-beta/console" + text: "m81" + url: "/p/chromium/g/main-m81/console" alt: "Beta branch console" > links: < - text: "stable" - url: "/p/chromium/g/main-stable/console" + text: "m80" + url: "/p/chromium/g/main-m80/console" alt: "Stable branch console" > links: < @@ -2955,13 +2955,13 @@ links: < name: "Branch Consoles" links: < - text: "beta" - url: "/p/chromium/g/main-beta/console" + text: "m81" + url: "/p/chromium/g/main-m81/console" alt: "Beta branch console" > links: < - text: "stable" - url: "/p/chromium/g/main-stable/console" + text: "m80" + url: "/p/chromium/g/main-m80/console" alt: "Stable branch console" > links: < @@ -3509,13 +3509,13 @@ links: < name: "Branch Consoles" links: < - text: "beta" - url: "/p/chromium/g/main-beta/console" + text: "m81" + url: "/p/chromium/g/main-m81/console" alt: "Beta branch console" > links: < - text: "stable" - url: "/p/chromium/g/main-stable/console" + text: "m80" + url: "/p/chromium/g/main-m80/console" alt: "Stable branch console" > links: < @@ -3870,13 +3870,13 @@ links: < name: "Branch Consoles" links: < - text: "beta" - url: "/p/chromium/g/main-beta/console" + text: "m81" + url: "/p/chromium/g/main-m81/console" alt: "Beta branch console" > links: < - text: "stable" - url: "/p/chromium/g/main-stable/console" + text: "m80" + url: "/p/chromium/g/main-m80/console" alt: "Stable branch console" > links: < @@ -4256,13 +4256,13 @@ links: < name: "Branch Consoles" links: < - text: "beta" - url: "/p/chromium/g/main-beta/console" + text: "m81" + url: "/p/chromium/g/main-m81/console" alt: "Beta branch console" > links: < - text: "stable" - url: "/p/chromium/g/main-stable/console" + text: "m80" + url: "/p/chromium/g/main-m80/console" alt: "Stable branch console" > links: < @@ -5732,13 +5732,13 @@ links: < name: "Branch Consoles" links: < - text: "beta" - url: "/p/chromium/g/main-beta/console" + text: "m81" + url: "/p/chromium/g/main-m81/console" alt: "Beta branch console" > links: < - text: "stable" - url: "/p/chromium/g/main-stable/console" + text: "m80" + url: "/p/chromium/g/main-m80/console" alt: "Stable branch console" > links: < @@ -6065,13 +6065,13 @@ links: < name: "Branch Consoles" links: < - text: "beta" - url: "/p/chromium/g/main-beta/console" + text: "m81" + url: "/p/chromium/g/main-m81/console" alt: "Beta branch console" > links: < - text: "stable" - url: "/p/chromium/g/main-stable/console" + text: "m80" + url: "/p/chromium/g/main-m80/console" alt: "Stable branch console" > links: < @@ -6742,13 +6742,13 @@ links: < name: "Branch Consoles" links: < - text: "beta" - url: "/p/chromium/g/main-beta/console" + text: "m81" + url: "/p/chromium/g/main-m81/console" alt: "Beta branch console" > links: < - text: "stable" - url: "/p/chromium/g/main-stable/console" + text: "m80" + url: "/p/chromium/g/main-m80/console" alt: "Stable branch console" > links: < @@ -7108,13 +7108,13 @@ links: < name: "Branch Consoles" links: < - text: "beta" - url: "/p/chromium/g/main-beta/console" + text: "m81" + url: "/p/chromium/g/main-m81/console" alt: "Beta branch console" > links: < - text: "stable" - url: "/p/chromium/g/main-stable/console" + text: "m80" + url: "/p/chromium/g/main-m80/console" alt: "Stable branch console" > links: < @@ -7445,13 +7445,13 @@ links: < name: "Branch Consoles" links: < - text: "beta" - url: "/p/chromium/g/main-beta/console" + text: "m81" + url: "/p/chromium/g/main-m81/console" alt: "Beta branch console" > links: < - text: "stable" - url: "/p/chromium/g/main-stable/console" + text: "m80" + url: "/p/chromium/g/main-m80/console" alt: "Stable branch console" > links: < @@ -7812,13 +7812,13 @@ links: < name: "Branch Consoles" links: < - text: "beta" - url: "/p/chromium/g/main-beta/console" + text: "m81" + url: "/p/chromium/g/main-m81/console" alt: "Beta branch console" > links: < - text: "stable" - url: "/p/chromium/g/main-stable/console" + text: "m80" + url: "/p/chromium/g/main-m80/console" alt: "Stable branch console" > links: < @@ -8144,13 +8144,13 @@ links: < name: "Branch Consoles" links: < - text: "beta" - url: "/p/chromium/g/main-beta/console" + text: "m81" + url: "/p/chromium/g/main-m81/console" alt: "Beta branch console" > links: < - text: "stable" - url: "/p/chromium/g/main-stable/console" + text: "m80" + url: "/p/chromium/g/main-m80/console" alt: "Stable branch console" > links: < @@ -8466,13 +8466,13 @@ links: < name: "Branch Consoles" links: < - text: "beta" - url: "/p/chromium/g/main-beta/console" + text: "m81" + url: "/p/chromium/g/main-m81/console" alt: "Beta branch console" > links: < - text: "stable" - url: "/p/chromium/g/main-stable/console" + text: "m80" + url: "/p/chromium/g/main-m80/console" alt: "Stable branch console" > links: < @@ -8828,13 +8828,13 @@ links: < name: "Branch Consoles" links: < - text: "beta" - url: "/p/chromium/g/main-beta/console" + text: "m81" + url: "/p/chromium/g/main-m81/console" alt: "Beta branch console" > links: < - text: "stable" - url: "/p/chromium/g/main-stable/console" + text: "m80" + url: "/p/chromium/g/main-m80/console" alt: "Stable branch console" > links: < @@ -9160,13 +9160,13 @@ links: < name: "Branch Consoles" links: < - text: "beta" - url: "/p/chromium/g/main-beta/console" + text: "m81" + url: "/p/chromium/g/main-m81/console" alt: "Beta branch console" > links: < - text: "stable" - url: "/p/chromium/g/main-stable/console" + text: "m80" + url: "/p/chromium/g/main-m80/console" alt: "Stable branch console" > links: < @@ -9567,13 +9567,13 @@ links: < name: "Branch Consoles" links: < - text: "beta" - url: "/p/chromium/g/main-beta/console" + text: "m81" + url: "/p/chromium/g/main-m81/console" alt: "Beta branch console" > links: < - text: "stable" - url: "/p/chromium/g/main-stable/console" + text: "m80" + url: "/p/chromium/g/main-m80/console" alt: "Stable branch console" > links: < @@ -9872,13 +9872,13 @@ links: < name: "Branch Consoles" links: < - text: "beta" - url: "/p/chromium/g/main-beta/console" + text: "m81" + url: "/p/chromium/g/main-m81/console" alt: "Beta branch console" > links: < - text: "stable" - url: "/p/chromium/g/main-stable/console" + text: "m80" + url: "/p/chromium/g/main-m80/console" alt: "Stable branch console" > links: < @@ -11363,13 +11363,13 @@ links: < name: "Branch Consoles" links: < - text: "beta" - url: "/p/chromium/g/main-beta/console" + text: "m81" + url: "/p/chromium/g/main-m81/console" alt: "Beta branch console" > links: < - text: "stable" - url: "/p/chromium/g/main-stable/console" + text: "m80" + url: "/p/chromium/g/main-m80/console" alt: "Stable branch console" > links: < @@ -11781,13 +11781,13 @@ links: < name: "Branch Consoles" links: < - text: "beta" - url: "/p/chromium/g/main-beta/console" + text: "m81" + url: "/p/chromium/g/main-m81/console" alt: "Beta branch console" > links: < - text: "stable" - url: "/p/chromium/g/main-stable/console" + text: "m80" + url: "/p/chromium/g/main-m80/console" alt: "Stable branch console" > links: < @@ -12283,13 +12283,13 @@ links: < name: "Branch Consoles" links: < - text: "beta" - url: "/p/chromium/g/main-beta/console" + text: "m81" + url: "/p/chromium/g/main-m81/console" alt: "Beta branch console" > links: < - text: "stable" - url: "/p/chromium/g/main-stable/console" + text: "m80" + url: "/p/chromium/g/main-m80/console" alt: "Stable branch console" > links: < @@ -12590,13 +12590,13 @@ links: < name: "Branch Consoles" links: < - text: "beta" - url: "/p/chromium/g/main-beta/console" + text: "m81" + url: "/p/chromium/g/main-m81/console" alt: "Beta branch console" > links: < - text: "stable" - url: "/p/chromium/g/main-stable/console" + text: "m80" + url: "/p/chromium/g/main-m80/console" alt: "Stable branch console" > links: <
diff --git a/infra/config/main.star b/infra/config/main.star index fe31750..1bd98e50 100755 --- a/infra/config/main.star +++ b/infra/config/main.star
@@ -129,8 +129,6 @@ exec('//consoles/luci.chromium.goma.star') exec('//consoles/luci.chromium.try.star') exec('//consoles/main.star') -exec('//consoles/main-m80.star') -exec('//consoles/main-m81.star') exec('//consoles/sheriff.ios.star') exec('//consoles/try-m80.star') exec('//consoles/try-m81.star')
diff --git a/infra/config/consoles/main-m80.star b/infra/config/versioned/milestones/m80/consoles/main.star similarity index 64% rename from infra/config/consoles/main-m80.star rename to infra/config/versioned/milestones/m80/consoles/main.star index 32c2aa1..a1647b7d 100644 --- a/infra/config/consoles/main-m80.star +++ b/infra/config/versioned/milestones/m80/consoles/main.star
@@ -1,159 +1,162 @@ -# TOD(https://crbug.com/922150) Add to chromium header +load('//lib/builders.star', 'builder_name', 'defaults') +load('../vars.star', 'vars') + +defaults.bucket.set(vars.ci_bucket) + +# TODO(https://crbug.com/922150) Add to chromium header luci.console_view( - name = 'main-m80', + name = vars.main_console_name, header = '//consoles/chromium-header.textpb', repo = 'https://chromium.googlesource.com/chromium/src', - # TODO(gbeaty) Define the main consoles inside the respective versioned - # directories once their contents are stablilized - refs = ['refs/branch-heads/3987'], - title = 'Chromium M80 Console', + refs = [vars.ref], + title = vars.main_console_title, entries = [ luci.console_view_entry( - builder = 'ci-m80/Linux Builder', + builder = builder_name('Linux Builder'), category = 'chromium.linux|release', short_name = 'bld', ), luci.console_view_entry( - builder = 'ci-m80/Linux Ozone Tester (Headless)', + builder = builder_name('Linux Ozone Tester (Headless)'), category = 'linux', short_name = 'loh', ), luci.console_view_entry( - builder = 'ci-m80/Linux Ozone Tester (Wayland)', + builder = builder_name('Linux Ozone Tester (Wayland)'), category = 'linux', short_name = 'low', ), luci.console_view_entry( - builder = 'ci-m80/Linux Ozone Tester (X11)', + builder = builder_name('Linux Ozone Tester (X11)'), category = 'linux', short_name = 'lox', ), luci.console_view_entry( - builder = 'ci-m80/Linux Tests', + builder = builder_name('Linux Tests'), category = 'chromium.linux|release', short_name = 'tst', ), luci.console_view_entry( - builder = 'ci-m80/linux-chromeos-rel', + builder = builder_name('linux-chromeos-rel'), category = 'chromium.chromiumos|default', short_name = 'rel', ), luci.console_view_entry( - builder = 'ci-m80/linux-ozone-rel', + builder = builder_name('linux-ozone-rel'), category = 'chromium.linux|release', short_name = 'ozo', ), luci.console_view_entry( - builder = 'ci-m80/chromeos-amd64-generic-rel', + builder = builder_name('chromeos-amd64-generic-rel'), category = 'chromium.chromiumos|simple|release|x64', short_name = 'rel', ), luci.console_view_entry( - builder = 'ci-m80/Mac Builder', + builder = builder_name('Mac Builder'), category = 'chromium.mac|release', short_name = 'bld', ), luci.console_view_entry( - builder = 'ci-m80/Mac10.10 Tests', + builder = builder_name('Mac10.10 Tests'), category = 'chromium.mac|release', short_name = '10', ), luci.console_view_entry( - builder = 'ci-m80/Mac10.11 Tests', + builder = builder_name('Mac10.11 Tests'), category = 'chromium.mac|release', short_name = '11', ), luci.console_view_entry( - builder = 'ci-m80/Mac10.12 Tests', + builder = builder_name('Mac10.12 Tests'), category = 'chromium.mac|release', short_name = '12', ), luci.console_view_entry( - builder = 'ci-m80/Mac10.13 Tests', + builder = builder_name('Mac10.13 Tests'), category = 'chromium.mac|release', short_name = '13', ), luci.console_view_entry( - builder = 'ci-m80/Mac10.14 Tests', + builder = builder_name('Mac10.14 Tests'), category = 'chromium.mac|release', short_name = '14', ), luci.console_view_entry( - builder = 'ci-m80/WebKit Mac10.13 (retina)', + builder = builder_name('WebKit Mac10.13 (retina)'), category = 'chromium.mac|release', short_name = 'ret', ), luci.console_view_entry( - builder = 'ci-m80/ios-simulator', + builder = builder_name('ios-simulator'), category = 'chromium.mac|ios|default', short_name = 'sim', ), luci.console_view_entry( - builder = 'ci-m80/Win x64 Builder', + builder = builder_name('Win x64 Builder'), category = 'chromium.win|release|builder', short_name = '64', ), luci.console_view_entry( - builder = 'ci-m80/Win 7 Tests x64 (1)', + builder = builder_name('Win 7 Tests x64 (1)'), category = 'chromium.win|release|tester', short_name = '64', ), luci.console_view_entry( - builder = 'ci-m80/Win10 Tests x64', + builder = builder_name('Win10 Tests x64'), category = 'chromium.win|release|tester', short_name = 'w10', ), # TODO(https://crbug.com/922150) Add the following builders to the main # console or don't have them be mirrored by main waterfall trybots luci.console_view_entry( - builder = 'ci-m80/android-kitkat-arm-rel', + builder = builder_name('android-kitkat-arm-rel'), category = 'chromium.android', short_name = 'k', ), luci.console_view_entry( - builder = 'ci-m80/android-marshmallow-arm64-rel', + builder = builder_name('android-marshmallow-arm64-rel'), category = 'chromium.android', short_name = 'm', ), luci.console_view_entry( - builder = 'ci-m80/mac-osxbeta-rel', + builder = builder_name('mac-osxbeta-rel'), category = 'chromium.fyi|mac', short_name = 'osxbeta', ), luci.console_view_entry( - builder = 'ci-m80/Win10 Tests x64 1803', + builder = builder_name('Win10 Tests x64 1803'), category = 'chromium.fyi|win10|1803', ), luci.console_view_entry( - builder = 'ci-m80/Android Release (Nexus 5X)', + builder = builder_name('Android Release (Nexus 5X)'), category = 'chromium.gpu|android', ), luci.console_view_entry( - builder = 'ci-m80/GPU Linux Builder', + builder = builder_name('GPU Linux Builder'), category = 'chromium.gpu|linux', ), luci.console_view_entry( - builder = 'ci-m80/Linux Release (NVIDIA)', + builder = builder_name('Linux Release (NVIDIA)'), category = 'chromium.gpu|linux', ), luci.console_view_entry( - builder = 'ci-m80/GPU Mac Builder', + builder = builder_name('GPU Mac Builder'), category = 'chromium.gpu|mac', ), luci.console_view_entry( - builder = 'ci-m80/Mac Release (Intel)', + builder = builder_name('Mac Release (Intel)'), category = 'chromium.gpu|mac', ), luci.console_view_entry( - builder = 'ci-m80/Mac Retina Release (AMD)', + builder = builder_name('Mac Retina Release (AMD)'), category = 'chromium.gpu|mac', ), luci.console_view_entry( - builder = 'ci-m80/GPU Win x64 Builder', + builder = builder_name('GPU Win x64 Builder'), category = 'chromium.gpu|win', ), luci.console_view_entry( - builder = 'ci-m80/Win10 x64 Release (NVIDIA)', + builder = builder_name('Win10 x64 Release (NVIDIA)'), category = 'chromium.gpu|win', ), ],
diff --git a/infra/config/versioned/milestones/m80/vars.star b/infra/config/versioned/milestones/m80/vars.star index 6e388a27..a5d8eb5 100644 --- a/infra/config/versioned/milestones/m80/vars.star +++ b/infra/config/versioned/milestones/m80/vars.star
@@ -4,5 +4,7 @@ ci_poller = 'm80-gitiles-trigger', try_bucket = 'try-m80', cq_group = 'cq-m80', - cq_ref_regexp = 'refs/branch-heads/3987' + cq_ref_regexp = 'refs/branch-heads/3987', + main_console_name = 'main-m80', + main_console_title = 'Chromium M80 Console', )
diff --git a/infra/config/consoles/main-m81.star b/infra/config/versioned/milestones/m81/consoles/main.star similarity index 65% rename from infra/config/consoles/main-m81.star rename to infra/config/versioned/milestones/m81/consoles/main.star index e0bbab34e..ddc4d8f 100644 --- a/infra/config/consoles/main-m81.star +++ b/infra/config/versioned/milestones/m81/consoles/main.star
@@ -1,243 +1,246 @@ -# TOD(https://crbug.com/922150) Add to chromium header +load('//lib/builders.star', 'builder_name', 'defaults') +load('../vars.star', 'vars') + +defaults.bucket.set(vars.ci_bucket) + +# TODO(https://crbug.com/922150) Add to chromium header luci.console_view( - name = 'main-m81', + name = vars.main_console_name, header = '//consoles/chromium-header.textpb', repo = 'https://chromium.googlesource.com/chromium/src', - # TODO(gbeaty) Define the main consoles inside the respective versioned - # directories once their contents are stablilized - refs = ['refs/branch-heads/4044'], - title = 'Chromium M81 Console', + refs = [vars.ref], + title = vars.main_console_title, entries = [ luci.console_view_entry( - builder = 'ci-m81/Linux Builder', + builder = builder_name('Linux Builder'), category = 'chromium.linux|release', short_name = 'bld', ), luci.console_view_entry( - builder = 'ci-m81/Linux Ozone Tester (Headless)', + builder = builder_name('Linux Ozone Tester (Headless)'), category = 'linux', short_name = 'loh', ), luci.console_view_entry( - builder = 'ci-m81/Linux Ozone Tester (Wayland)', + builder = builder_name('Linux Ozone Tester (Wayland)'), category = 'linux', short_name = 'low', ), luci.console_view_entry( - builder = 'ci-m81/Linux Ozone Tester (X11)', + builder = builder_name('Linux Ozone Tester (X11)'), category = 'linux', short_name = 'lox', ), luci.console_view_entry( - builder = 'ci-m81/Linux Tests', + builder = builder_name('Linux Tests'), category = 'chromium.linux|release', short_name = 'tst', ), luci.console_view_entry( - builder = 'ci-m81/linux-ozone-rel', + builder = builder_name('linux-ozone-rel'), category = 'chromium.linux|release', short_name = 'ozo', ), luci.console_view_entry( - builder = 'ci-m81/Cast Linux', + builder = builder_name('Cast Linux'), category = 'chromium.linux|cast', short_name = 'vid', ), luci.console_view_entry( - builder = 'ci-m81/Fuchsia ARM64', + builder = builder_name('Fuchsia ARM64'), category = 'chromium.linux|fuchsia|a64', ), luci.console_view_entry( - builder = 'ci-m81/Fuchsia x64', + builder = builder_name('Fuchsia x64'), category = 'chromium.linux|fuchsia|x64', short_name = 'rel', ), luci.console_view_entry( - builder = 'ci-m81/linux-chromeos-rel', + builder = builder_name('linux-chromeos-rel'), category = 'chromium.chromiumos|default', short_name = 'rel', ), luci.console_view_entry( - builder = 'ci-m81/linux-chromeos-dbg', + builder = builder_name('linux-chromeos-dbg'), category = 'chromium.chromiumos|default', short_name = 'dbg', ), luci.console_view_entry( - builder = 'ci-m81/chromeos-arm-generic-rel', + builder = builder_name('chromeos-arm-generic-rel'), category = 'chromium.chromiumos|simple|release', short_name = 'arm', ), luci.console_view_entry( - builder = 'ci-m81/chromeos-amd64-generic-rel', + builder = builder_name('chromeos-amd64-generic-rel'), category = 'chromium.chromiumos|simple|release|x64', short_name = 'rel', ), luci.console_view_entry( - builder = 'ci-m81/Mac Builder', + builder = builder_name('Mac Builder'), category = 'chromium.mac|release', short_name = 'bld', ), luci.console_view_entry( - builder = 'ci-m81/Mac10.10 Tests', + builder = builder_name('Mac10.10 Tests'), category = 'chromium.mac|release', short_name = '10', ), luci.console_view_entry( - builder = 'ci-m81/Mac10.11 Tests', + builder = builder_name('Mac10.11 Tests'), category = 'chromium.mac|release', short_name = '11', ), luci.console_view_entry( - builder = 'ci-m81/Mac10.12 Tests', + builder = builder_name('Mac10.12 Tests'), category = 'chromium.mac|release', short_name = '12', ), luci.console_view_entry( - builder = 'ci-m81/Mac10.13 Tests', + builder = builder_name('Mac10.13 Tests'), category = 'chromium.mac|release', short_name = '13', ), luci.console_view_entry( - builder = 'ci-m81/Mac10.14 Tests', + builder = builder_name('Mac10.14 Tests'), category = 'chromium.mac|release', short_name = '14', ), luci.console_view_entry( - builder = 'ci-m81/WebKit Mac10.13 (retina)', + builder = builder_name('WebKit Mac10.13 (retina)'), category = 'chromium.mac|release', short_name = 'ret', ), luci.console_view_entry( - builder = 'ci-m81/Mac Builder (dbg)', + builder = builder_name('Mac Builder (dbg)'), category = 'chromium.mac|debug', short_name = 'bld', ), luci.console_view_entry( - builder = 'ci-m81/Mac10.13 Tests (dbg)', + builder = builder_name('Mac10.13 Tests (dbg)'), category = 'chromium.mac|debug', short_name = '13', ), luci.console_view_entry( - builder = 'ci-m81/ios-simulator', + builder = builder_name('ios-simulator'), category = 'chromium.mac|ios|default', short_name = 'sim', ), luci.console_view_entry( - builder = 'ci-m81/Win x64 Builder', + builder = builder_name('Win x64 Builder'), category = 'chromium.win|release|builder', short_name = '64', ), luci.console_view_entry( - builder = 'ci-m81/Win 7 Tests x64 (1)', + builder = builder_name('Win 7 Tests x64 (1)'), category = 'chromium.win|release|tester', short_name = '64', ), luci.console_view_entry( - builder = 'ci-m81/Win10 Tests x64', + builder = builder_name('Win10 Tests x64'), category = 'chromium.win|release|tester', short_name = 'w10', ), luci.console_view_entry( - builder = 'ci-m81/Win Builder (dbg)', + builder = builder_name('Win Builder (dbg)'), category = 'chromium.win|debug|builder', short_name = '32', ), luci.console_view_entry( - builder = 'ci-m81/Win7 Tests (dbg)(1)', + builder = builder_name('Win7 Tests (dbg)(1)'), category = 'chromium.win|debug|tester', short_name = '7', ), luci.console_view_entry( - builder = 'ci-m81/Linux ASan LSan Builder', + builder = builder_name('Linux ASan LSan Builder'), category = 'chromium.memory|linux|asan lsan', short_name = 'bld', ), luci.console_view_entry( - builder = 'ci-m81/Linux ASan LSan Tests (1)', + builder = builder_name('Linux ASan LSan Tests (1)'), category = 'chromium.memory|linux|asan lsan', short_name = 'tst', ), luci.console_view_entry( - builder = 'ci-m81/Linux ASan Tests (sandboxed)', + builder = builder_name('Linux ASan Tests (sandboxed)'), category = 'chromium.memory|linux|asan lsan', short_name = 'sbx', ), # TODO(https://crbug.com/922150) Add the following builders to the main # console or don't have them be mirrored by main waterfall trybots luci.console_view_entry( - builder = 'ci-m81/android-kitkat-arm-rel', + builder = builder_name('android-kitkat-arm-rel'), category = 'chromium.android', short_name = 'k', ), luci.console_view_entry( - builder = 'ci-m81/android-marshmallow-arm64-rel', + builder = builder_name('android-marshmallow-arm64-rel'), category = 'chromium.android', short_name = 'm', ), luci.console_view_entry( - builder = 'ci-m81/Cast Android (dbg)', + builder = builder_name('Cast Android (dbg)'), category = 'chromium.android', short_name = 'cst', ), luci.console_view_entry( - builder = 'ci-m81/Android arm Builder (dbg)', + builder = builder_name('Android arm Builder (dbg)'), category = 'chromium.android|builder|arm', short_name = '32', ), luci.console_view_entry( - builder = 'ci-m81/android-cronet-arm-rel', + builder = builder_name('android-cronet-arm-rel'), category = 'chromium.android|cronet|arm', short_name = 'rel', ), luci.console_view_entry( - builder = 'ci-m81/android-cronet-kitkat-arm-rel', + builder = builder_name('android-cronet-kitkat-arm-rel'), category = 'chromium.android|cronet|test', short_name = 'k', ), luci.console_view_entry( - builder = 'ci-m81/android-cronet-lollipop-arm-rel', + builder = builder_name('android-cronet-lollipop-arm-rel'), category = 'chromium.android|cronet|test', short_name = 'l', ), luci.console_view_entry( - builder = 'ci-m81/mac-osxbeta-rel', + builder = builder_name('mac-osxbeta-rel'), category = 'chromium.fyi|mac', short_name = 'osxbeta', ), luci.console_view_entry( - builder = 'ci-m81/Win10 Tests x64 1803', + builder = builder_name('Win10 Tests x64 1803'), category = 'chromium.fyi|win10|1803', ), luci.console_view_entry( - builder = 'ci-m81/Android Release (Nexus 5X)', + builder = builder_name('Android Release (Nexus 5X)'), category = 'chromium.gpu|android', ), luci.console_view_entry( - builder = 'ci-m81/GPU Linux Builder', + builder = builder_name('GPU Linux Builder'), category = 'chromium.gpu|linux', ), luci.console_view_entry( - builder = 'ci-m81/Linux Release (NVIDIA)', + builder = builder_name('Linux Release (NVIDIA)'), category = 'chromium.gpu|linux', ), luci.console_view_entry( - builder = 'ci-m81/GPU Mac Builder', + builder = builder_name('GPU Mac Builder'), category = 'chromium.gpu|mac', ), luci.console_view_entry( - builder = 'ci-m81/Mac Release (Intel)', + builder = builder_name('Mac Release (Intel)'), category = 'chromium.gpu|mac', ), luci.console_view_entry( - builder = 'ci-m81/Mac Retina Release (AMD)', + builder = builder_name('Mac Retina Release (AMD)'), category = 'chromium.gpu|mac', ), luci.console_view_entry( - builder = 'ci-m81/GPU Win x64 Builder', + builder = builder_name('GPU Win x64 Builder'), category = 'chromium.gpu|win', ), luci.console_view_entry( - builder = 'ci-m81/Win10 x64 Release (NVIDIA)', + builder = builder_name('Win10 x64 Release (NVIDIA)'), category = 'chromium.gpu|win', ), ],
diff --git a/infra/config/versioned/milestones/m81/vars.star b/infra/config/versioned/milestones/m81/vars.star index 592db51..742d89e 100644 --- a/infra/config/versioned/milestones/m81/vars.star +++ b/infra/config/versioned/milestones/m81/vars.star
@@ -5,4 +5,6 @@ try_bucket = 'try-m81', cq_group = 'cq-m81', cq_ref_regexp = 'refs/branch-heads/4044', + main_console_name = 'main-m81', + main_console_title = 'Chromium M81 Console', )
diff --git a/infra/config/versioned/trunk/consoles/main.star b/infra/config/versioned/trunk/consoles/main.star new file mode 100644 index 0000000..47b4b69 --- /dev/null +++ b/infra/config/versioned/trunk/consoles/main.star
@@ -0,0 +1,686 @@ +load('//lib/builders.star', 'builder_name', 'defaults') +load('../vars.star', 'vars') + +defaults.bucket.set(vars.ci_bucket) + +luci.console_view( + name = vars.main_console_name, + header = '//consoles/chromium-header.textpb', + repo = 'https://chromium.googlesource.com/chromium/src', + refs = [vars.ref], + title = vars.main_console_title, + entries = [ + luci.console_view_entry( + builder = builder_name('android-archive-dbg'), + category = 'chromium|android', + short_name = 'dbg', + ), + luci.console_view_entry( + builder = builder_name('android-archive-rel'), + category = 'chromium|android', + short_name = 'rel', + ), + luci.console_view_entry( + builder = builder_name('linux-archive-dbg'), + category = 'chromium|linux', + short_name = 'dbg', + ), + luci.console_view_entry( + builder = builder_name('linux-archive-rel'), + category = 'chromium|linux', + short_name = 'rel', + ), + luci.console_view_entry( + builder = builder_name('mac-archive-dbg'), + category = 'chromium|mac', + short_name = 'dbg', + ), + luci.console_view_entry( + builder = builder_name('mac-archive-rel'), + category = 'chromium|mac', + short_name = 'rel', + ), + luci.console_view_entry( + builder = builder_name('win32-archive-rel'), + category = 'chromium|win|rel', + short_name = '32', + ), + luci.console_view_entry( + builder = builder_name('win-archive-rel'), + category = 'chromium|win|rel', + short_name = '64', + ), + luci.console_view_entry( + builder = builder_name('win32-archive-dbg'), + category = 'chromium|win|dbg', + short_name = '32', + ), + luci.console_view_entry( + builder = builder_name('win-archive-dbg'), + category = 'chromium|win|dbg', + short_name = '64', + ), + luci.console_view_entry( + builder = builder_name('Win Builder'), + category = 'chromium.win|release|builder', + short_name = '32', + ), + luci.console_view_entry( + builder = builder_name('Win x64 Builder'), + category = 'chromium.win|release|builder', + short_name = '64', + ), + luci.console_view_entry( + builder = builder_name('Win7 (32) Tests'), + category = 'chromium.win|release|tester', + short_name = '32', + ), + luci.console_view_entry( + builder = builder_name('Win7 Tests (1)'), + category = 'chromium.win|release|tester', + short_name = '32', + ), + luci.console_view_entry( + builder = builder_name('Win 7 Tests x64 (1)'), + category = 'chromium.win|release|tester', + short_name = '64', + ), + luci.console_view_entry( + builder = builder_name('Win10 Tests x64'), + category = 'chromium.win|release|tester', + short_name = 'w10', + ), + luci.console_view_entry( + builder = builder_name('Win x64 Builder (dbg)'), + category = 'chromium.win|debug|builder', + short_name = '64', + ), + luci.console_view_entry( + builder = builder_name('Win Builder (dbg)'), + category = 'chromium.win|debug|builder', + short_name = '32', + ), + luci.console_view_entry( + builder = builder_name('Win7 Tests (dbg)(1)'), + category = 'chromium.win|debug|tester', + short_name = '7', + ), + luci.console_view_entry( + builder = builder_name('Win10 Tests x64 (dbg)'), + category = 'chromium.win|debug|tester', + short_name = '10', + ), + luci.console_view_entry( + builder = builder_name('Windows deterministic'), + category = 'chromium.win|misc', + short_name = 'det', + ), + luci.console_view_entry( + builder = builder_name('WebKit Win10'), + category = 'chromium.win|misc', + short_name = 'wbk', + ), + luci.console_view_entry( + builder = builder_name('Mac Builder'), + category = 'chromium.mac|release', + short_name = 'bld', + ), + luci.console_view_entry( + builder = builder_name('Mac10.10 Tests'), + category = 'chromium.mac|release', + short_name = '10', + ), + luci.console_view_entry( + builder = builder_name('Mac10.11 Tests'), + category = 'chromium.mac|release', + short_name = '11', + ), + luci.console_view_entry( + builder = builder_name('Mac10.12 Tests'), + category = 'chromium.mac|release', + short_name = '12', + ), + luci.console_view_entry( + builder = builder_name('Mac10.13 Tests'), + category = 'chromium.mac|release', + short_name = '13', + ), + luci.console_view_entry( + builder = builder_name('Mac10.14 Tests'), + category = 'chromium.mac|release', + short_name = '14', + ), + luci.console_view_entry( + builder = builder_name('WebKit Mac10.13 (retina)'), + category = 'chromium.mac|release', + short_name = 'ret', + ), + luci.console_view_entry( + builder = builder_name('Mac Builder (dbg)'), + category = 'chromium.mac|debug', + short_name = 'bld', + ), + luci.console_view_entry( + builder = builder_name('Mac10.13 Tests (dbg)'), + category = 'chromium.mac|debug', + short_name = '13', + ), + luci.console_view_entry( + builder = builder_name('ios-device'), + category = 'chromium.mac|ios|default', + short_name = 'dev', + ), + luci.console_view_entry( + builder = builder_name('ios-simulator'), + category = 'chromium.mac|ios|default', + short_name = 'sim', + ), + luci.console_view_entry( + builder = builder_name('ios-simulator-full-configs'), + category = 'chromium.mac|ios|default', + short_name = 'ful', + ), + luci.console_view_entry( + builder = builder_name('ios-simulator-noncq'), + category = 'chromium.mac|ios|default', + short_name = 'non', + ), + luci.console_view_entry( + builder = builder_name('Linux Builder'), + category = 'chromium.linux|release', + short_name = 'bld', + ), + luci.console_view_entry( + builder = builder_name('Linux Tests'), + category = 'chromium.linux|release', + short_name = 'tst', + ), + luci.console_view_entry( + builder = builder_name('Network Service Linux'), + category = 'chromium.linux|release', + short_name = 'nsl', + ), + luci.console_view_entry( + builder = builder_name('linux-gcc-rel'), + category = 'chromium.linux|release', + short_name = 'gcc', + ), + luci.console_view_entry( + builder = builder_name('Deterministic Linux'), + category = 'chromium.linux|release', + short_name = 'det', + ), + luci.console_view_entry( + builder = builder_name('linux-ozone-rel'), + category = 'chromium.linux|release', + short_name = 'ozo', + ), + luci.console_view_entry( + builder = builder_name('linux-trusty-rel'), + category = 'chromium.linux|release', + short_name = 'tru', + ), + luci.console_view_entry( + builder = builder_name('Linux Builder (dbg)(32)'), + category = 'chromium.linux|debug|builder', + short_name = '32', + ), + luci.console_view_entry( + builder = builder_name('Linux Builder (dbg)'), + category = 'chromium.linux|debug|builder', + short_name = '64', + ), + luci.console_view_entry( + builder = builder_name('Deterministic Linux (dbg)'), + category = 'chromium.linux|debug|builder', + short_name = 'det', + ), + luci.console_view_entry( + builder = builder_name('Linux Tests (dbg)(1)'), + category = 'chromium.linux|debug|tester', + short_name = '64', + ), + luci.console_view_entry( + builder = builder_name('Cast Linux'), + category = 'chromium.linux|cast', + short_name = 'vid', + ), + luci.console_view_entry( + builder = builder_name('Cast Audio Linux'), + category = 'chromium.linux|cast', + short_name = 'aud', + ), + luci.console_view_entry( + builder = builder_name('Fuchsia ARM64'), + category = 'chromium.linux|fuchsia|a64', + ), + luci.console_view_entry( + builder = builder_name('fuchsia-arm64-cast'), + category = 'chromium.linux|fuchsia|cast', + short_name = 'a64', + ), + luci.console_view_entry( + builder = builder_name('fuchsia-x64-cast'), + category = 'chromium.linux|fuchsia|cast', + short_name = 'x64', + ), + luci.console_view_entry( + builder = builder_name('Deterministic Fuchsia (dbg)'), + category = 'chromium.linux|fuchsia|x64', + short_name = 'det', + ), + luci.console_view_entry( + builder = builder_name('Fuchsia x64'), + category = 'chromium.linux|fuchsia|x64', + short_name = 'rel', + ), + luci.console_view_entry( + builder = builder_name('Linux ChromiumOS Full'), + category = 'chromium.chromiumos|default', + short_name = 'ful', + ), + luci.console_view_entry( + builder = builder_name('linux-chromeos-rel'), + category = 'chromium.chromiumos|default', + short_name = 'rel', + ), + luci.console_view_entry( + builder = builder_name('linux-chromeos-dbg'), + category = 'chromium.chromiumos|default', + short_name = 'dbg', + ), + luci.console_view_entry( + builder = builder_name('chromeos-amd64-generic-asan-rel'), + category = 'chromium.chromiumos|simple|release|x64', + short_name = 'asn', + ), + luci.console_view_entry( + builder = builder_name('chromeos-amd64-generic-cfi-thin-lto-rel'), + category = 'chromium.chromiumos|simple|release|x64', + short_name = 'cfi', + ), + luci.console_view_entry( + builder = builder_name('chromeos-amd64-generic-dbg'), + category = 'chromium.chromiumos|simple|debug|x64', + short_name = 'dbg', + ), + luci.console_view_entry( + builder = builder_name('chromeos-amd64-generic-rel'), + category = 'chromium.chromiumos|simple|release|x64', + short_name = 'rel', + ), + luci.console_view_entry( + builder = builder_name('chromeos-arm-generic-dbg'), + category = 'chromium.chromiumos|simple|debug', + short_name = 'arm', + ), + luci.console_view_entry( + builder = builder_name('chromeos-arm-generic-rel'), + category = 'chromium.chromiumos|simple|release', + short_name = 'arm', + ), + luci.console_view_entry( + builder = builder_name('chromeos-kevin-rel'), + category = 'chromium.chromiumos|simple|release', + short_name = 'kvn', + ), + luci.console_view_entry( + builder = builder_name('android-cronet-arm-dbg'), + category = 'chromium.android|cronet|arm', + short_name = 'dbg', + ), + luci.console_view_entry( + builder = builder_name('android-cronet-arm-rel'), + category = 'chromium.android|cronet|arm', + short_name = 'rel', + ), + luci.console_view_entry( + builder = builder_name('android-cronet-kitkat-arm-rel'), + category = 'chromium.android|cronet|test', + short_name = 'k', + ), + luci.console_view_entry( + builder = builder_name('android-cronet-lollipop-arm-rel'), + category = 'chromium.android|cronet|test', + short_name = 'l', + ), + luci.console_view_entry( + builder = builder_name('Android arm Builder (dbg)'), + category = 'chromium.android|builder|arm', + short_name = '32', + ), + luci.console_view_entry( + builder = builder_name('Android arm64 Builder (dbg)'), + category = 'chromium.android|builder|arm', + short_name = '64', + ), + luci.console_view_entry( + builder = builder_name('Android x86 Builder (dbg)'), + category = 'chromium.android|builder|x86', + short_name = '32', + ), + luci.console_view_entry( + builder = builder_name('Android x64 Builder (dbg)'), + category = 'chromium.android|builder|x86', + short_name = '64', + ), + luci.console_view_entry( + builder = builder_name('KitKat Phone Tester (dbg)'), + category = 'chromium.android|tester|phone', + short_name = 'K', + ), + luci.console_view_entry( + builder = builder_name('Lollipop Phone Tester'), + category = 'chromium.android|tester|phone', + short_name = 'L', + ), + luci.console_view_entry( + builder = builder_name('Marshmallow 64 bit Tester'), + category = 'chromium.android|tester|phone', + short_name = 'M', + ), + luci.console_view_entry( + builder = builder_name('Nougat Phone Tester'), + category = 'chromium.android|tester|phone', + short_name = 'N', + ), + luci.console_view_entry( + builder = builder_name('Oreo Phone Tester'), + category = 'chromium.android|tester|phone', + short_name = 'O', + ), + luci.console_view_entry( + builder = builder_name('android-pie-arm64-dbg'), + category = 'chromium.android|tester|phone', + short_name = 'P', + ), + luci.console_view_entry( + builder = builder_name('KitKat Tablet Tester'), + category = 'chromium.android|tester|tablet', + short_name = 'K', + ), + luci.console_view_entry( + builder = builder_name('Lollipop Tablet Tester'), + category = 'chromium.android|tester|tablet', + short_name = 'L', + ), + luci.console_view_entry( + builder = builder_name('Marshmallow Tablet Tester'), + category = 'chromium.android|tester|tablet', + short_name = 'M', + ), + luci.console_view_entry( + builder = builder_name('Android WebView L (dbg)'), + category = 'chromium.android|tester|webview', + short_name = 'L', + ), + luci.console_view_entry( + builder = builder_name('Android WebView M (dbg)'), + category = 'chromium.android|tester|webview', + short_name = 'M', + ), + luci.console_view_entry( + builder = builder_name('Android WebView N (dbg)'), + category = 'chromium.android|tester|webview', + short_name = 'N', + ), + luci.console_view_entry( + builder = builder_name('Android WebView O (dbg)'), + category = 'chromium.android|tester|webview', + short_name = 'O', + ), + luci.console_view_entry( + builder = builder_name('Android WebView P (dbg)'), + category = 'chromium.android|tester|webview', + short_name = 'P', + ), + luci.console_view_entry( + builder = builder_name('android-kitkat-arm-rel'), + category = 'chromium.android|on_cq', + short_name = 'K', + ), + luci.console_view_entry( + builder = builder_name('android-marshmallow-arm64-rel'), + category = 'chromium.android|on_cq', + short_name = 'M', + ), + luci.console_view_entry( + builder = builder_name('Cast Android (dbg)'), + category = 'chromium.android|on_cq', + short_name = 'cst', + ), + luci.console_view_entry( + builder = builder_name('android-pie-arm64-rel'), + category = 'chromium.android|on_cq', + short_name = 'P', + ), + luci.console_view_entry( + builder = 'chrome:ci/linux-chromeos-chrome', + category = 'chrome', + short_name = 'cro', + ), + luci.console_view_entry( + builder = 'chrome:ci/linux-chrome', + category = 'chrome', + short_name = 'lnx', + ), + luci.console_view_entry( + builder = 'chrome:ci/mac-chrome', + category = 'chrome', + short_name = 'mac', + ), + luci.console_view_entry( + builder = 'chrome:ci/win-chrome', + category = 'chrome', + short_name = 'win', + ), + luci.console_view_entry( + builder = builder_name('win-asan'), + category = 'chromium.memory|win', + short_name = 'asn', + ), + luci.console_view_entry( + builder = builder_name('Mac ASan 64 Builder'), + category = 'chromium.memory|mac', + short_name = 'bld', + ), + luci.console_view_entry( + builder = builder_name('Mac ASan 64 Tests (1)'), + category = 'chromium.memory|mac', + short_name = 'tst', + ), + luci.console_view_entry( + builder = builder_name('Linux TSan Builder'), + category = 'chromium.memory|linux|TSan v2', + short_name = 'bld', + ), + luci.console_view_entry( + builder = builder_name('Linux TSan Tests'), + category = 'chromium.memory|linux|TSan v2', + short_name = 'tst', + ), + luci.console_view_entry( + builder = builder_name('Linux ASan LSan Builder'), + category = 'chromium.memory|linux|asan lsan', + short_name = 'bld', + ), + luci.console_view_entry( + builder = builder_name('Linux ASan LSan Tests (1)'), + category = 'chromium.memory|linux|asan lsan', + short_name = 'tst', + ), + luci.console_view_entry( + builder = builder_name('Linux ASan Tests (sandboxed)'), + category = 'chromium.memory|linux|asan lsan', + short_name = 'sbx', + ), + luci.console_view_entry( + builder = builder_name('Linux MSan Builder'), + category = 'chromium.memory|linux|msan', + short_name = 'bld', + ), + luci.console_view_entry( + builder = builder_name('Linux MSan Tests'), + category = 'chromium.memory|linux|msan', + short_name = 'tst', + ), + luci.console_view_entry( + builder = builder_name('WebKit Linux ASAN'), + category = 'chromium.memory|linux|webkit', + short_name = 'asn', + ), + luci.console_view_entry( + builder = builder_name('WebKit Linux MSAN'), + category = 'chromium.memory|linux|webkit', + short_name = 'msn', + ), + luci.console_view_entry( + builder = builder_name('WebKit Linux Leak'), + category = 'chromium.memory|linux|webkit', + short_name = 'lk', + ), + luci.console_view_entry( + builder = builder_name('Linux Chromium OS ASan LSan Builder'), + category = 'chromium.memory|cros|asan', + short_name = 'bld', + ), + luci.console_view_entry( + builder = builder_name('Linux Chromium OS ASan LSan Tests (1)'), + category = 'chromium.memory|cros|asan', + short_name = 'tst', + ), + luci.console_view_entry( + builder = builder_name('Linux ChromiumOS MSan Builder'), + category = 'chromium.memory|cros|msan', + short_name = 'bld', + ), + luci.console_view_entry( + builder = builder_name('Linux ChromiumOS MSan Tests'), + category = 'chromium.memory|cros|msan', + short_name = 'tst', + ), + luci.console_view_entry( + builder = builder_name('android-asan'), + category = 'chromium.memory|android', + short_name = 'asn', + ), + luci.console_view_entry( + builder = builder_name('Linux CFI'), + category = 'chromium.memory|cfi', + short_name = 'lnx', + ), + luci.console_view_entry( + builder = builder_name('Dawn Linux x64 DEPS Builder'), + category = 'chromium.dawn|DEPS|Linux|Builder', + short_name = 'x64', + ), + luci.console_view_entry( + builder = builder_name('Dawn Linux x64 DEPS Release (Intel HD 630)'), + category = 'chromium.dawn|DEPS|Linux|Intel', + short_name = 'x64', + ), + luci.console_view_entry( + builder = builder_name('Dawn Linux x64 DEPS Release (NVIDIA)'), + category = 'chromium.dawn|DEPS|Linux|Nvidia', + short_name = 'x64', + ), + luci.console_view_entry( + builder = builder_name('Dawn Mac x64 DEPS Builder'), + category = 'chromium.dawn|DEPS|Mac|Builder', + short_name = 'x64', + ), + luci.console_view_entry( + builder = builder_name('Dawn Mac x64 DEPS Release (AMD)'), + category = 'chromium.dawn|DEPS|Mac|AMD', + short_name = 'x64', + ), + luci.console_view_entry( + builder = builder_name('Dawn Mac x64 DEPS Release (Intel)'), + category = 'chromium.dawn|DEPS|Mac|Intel', + short_name = 'x64', + ), + luci.console_view_entry( + builder = builder_name('Dawn Win10 x86 DEPS Builder'), + category = 'chromium.dawn|DEPS|Windows|Builder', + short_name = 'x86', + ), + luci.console_view_entry( + builder = builder_name('Dawn Win10 x64 DEPS Builder'), + category = 'chromium.dawn|DEPS|Windows|Builder', + short_name = 'x64', + ), + luci.console_view_entry( + builder = builder_name('Dawn Win10 x86 DEPS Release (Intel HD 630)'), + category = 'chromium.dawn|DEPS|Windows|Intel', + short_name = 'x86', + ), + luci.console_view_entry( + builder = builder_name('Dawn Win10 x64 DEPS Release (Intel HD 630)'), + category = 'chromium.dawn|DEPS|Windows|Intel', + short_name = 'x64', + ), + luci.console_view_entry( + builder = builder_name('Dawn Win10 x86 DEPS Release (NVIDIA)'), + category = 'chromium.dawn|DEPS|Windows|Nvidia', + short_name = 'x86', + ), + luci.console_view_entry( + builder = builder_name('Dawn Win10 x64 DEPS Release (NVIDIA)'), + category = 'chromium.dawn|DEPS|Windows|Nvidia', + short_name = 'x64', + ), + luci.console_view_entry( + builder = builder_name('GPU Mac Builder'), + category = 'chromium.gpu|Mac', + ), + luci.console_view_entry( + builder = builder_name('Mac Release (Intel)'), + category = 'chromium.gpu|Mac', + ), + luci.console_view_entry( + builder = builder_name('Mac Retina Release (AMD)'), + category = 'chromium.gpu|Mac', + ), + luci.console_view_entry( + builder = builder_name('GPU Linux Builder'), + category = 'chromium.gpu|Linux', + ), + luci.console_view_entry( + builder = builder_name('Linux Release (NVIDIA)'), + category = 'chromium.gpu|Linux', + ), + luci.console_view_entry( + builder = builder_name('Android Release (Nexus 5X)'), + category = 'chromium.gpu|Android', + ), + # TODO(gbeaty): FYI builders should not be mirrors for try builders on + # the CQ, but things are what they are + luci.console_view_entry( + builder = builder_name('ios-simulator-cronet'), + category = 'chromium.fyi|cronet', + ), + luci.console_view_entry( + builder = builder_name('mac-osxbeta-rel'), + category = 'chromium.fyi|mac', + short_name = 'beta', + ), + luci.console_view_entry( + builder = builder_name('chromeos-kevin-rel-hw-tests'), + category = 'chromium.fyi|chromos', + ), + luci.console_view_entry( + builder = builder_name('VR Linux'), + category = 'chromium.fyi|linux', + ), + luci.console_view_entry( + builder = builder_name('Linux Ozone Tester (Wayland)'), + category = 'chromium.fyi|linux', + short_name = 'low', + ), + luci.console_view_entry( + builder = builder_name('Linux Ozone Tester (X11)'), + category = 'chromium.fyi|linux', + short_name = 'lox', + ), + ], +)
diff --git a/infra/config/versioned/trunk/vars.star b/infra/config/versioned/trunk/vars.star index 9b6c8ff0..cd2d4f3 100644 --- a/infra/config/versioned/trunk/vars.star +++ b/infra/config/versioned/trunk/vars.star
@@ -5,6 +5,8 @@ try_bucket = 'try', cq_group = 'cq', cq_ref_regexp = 'refs/heads/.+', + main_console_name = 'main', + main_console_title = 'Chromium Main Console', # Delete this line for branches tree_status_host = 'chromium-status.appspot.com/', )
diff --git a/ios/build/bots/scripts/PRESUBMIT.py b/ios/build/bots/scripts/PRESUBMIT.py index 395a79c..8402bb32 100644 --- a/ios/build/bots/scripts/PRESUBMIT.py +++ b/ios/build/bots/scripts/PRESUBMIT.py
@@ -17,6 +17,7 @@ # 'iossim_util_test.py', 'run_test.py', 'shard_util_test.py', + 'standard_json_util_test.py', 'test_apps_test.py', # 'test_runner_test.py', 'wpr_runner_test.py',
diff --git a/ios/build/bots/scripts/standard_json_util.py b/ios/build/bots/scripts/standard_json_util.py new file mode 100644 index 0000000..8f0855a9 --- /dev/null +++ b/ios/build/bots/scripts/standard_json_util.py
@@ -0,0 +1,76 @@ +# Copyright 2020 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import logging +from collections import OrderedDict + +LOGGER = logging.getLogger(__name__) + + +class StdJson(): + + def __init__(self, **kwargs): + """Module for storing the results in standard JSON format. + + https://chromium.googlesource.com/chromium/src/+/master/docs/testing/json_test_results_format.md + """ + + self.tests = OrderedDict() + + if 'passed' in kwargs: + self.mark_all_passed(kwargs['passed']) + if 'failed' in kwargs: + self.mark_all_failed(kwargs['failed']) + if 'flaked' in kwargs: + self.mark_all_passed(kwargs['flaked'], flaky=True) + + def mark_passed(self, test, flaky=False): + """Set test as passed + + Params: + test (str): a test in format "{TestCase}/{testMethod}" + + If flaky=True, or if 'FAIL' already set in 'actual', + apply is_flaky=True for all test(s). + """ + if test in self.tests: + self.tests[test]['actual'] = self.tests[test]['actual'] + " PASS" + else: + self.tests[test] = {'expected': 'PASS', 'actual': 'PASS'} + + if flaky or 'FAIL' in self.tests[test]['actual']: + self.tests[test]['is_flaky'] = True + + def mark_all_passed(self, tests, flaky=False): + """Mark all tests as PASS""" + for test in tests: + self.mark_passed(test, flaky) + + def mark_failed(self, test): + """Set test(s) as failed. + + Params: + test (str): a test in format "{TestCase}/{testMethod}" + """ + if test in self.tests: + self.tests[test]['actual'] = self.tests[test]['actual'] + " FAIL" + else: + self.tests[test] = {'expected': 'PASS', 'actual': 'FAIL'} + + def mark_all_failed(self, tests): + """Mark all tests as FAIL""" + for test in tests: + self.mark_failed(test) + + def mark_timeout(self, test): + """Set test as TIMEOUT, which is used to indicate a test abort/timeout + + Params: + test (str): a test in format "{TestCase}/{testMethod}" + """ + + if test in self.tests: + self.tests[test]['actual'] = self.tests[test]['actual'] + " TIMEOUT" + else: + self.tests[test] = {'expected': 'PASS', 'actual': 'TIMEOUT'}
diff --git a/ios/build/bots/scripts/standard_json_util_tests.py b/ios/build/bots/scripts/standard_json_util_tests.py new file mode 100644 index 0000000..600036ba --- /dev/null +++ b/ios/build/bots/scripts/standard_json_util_tests.py
@@ -0,0 +1,94 @@ +# Copyright 2020 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. +"""Unittests for standard_json_util.py.""" + +import collections +import standard_json_util as sju + + +class UnitTest(unittest.TestCase): + + def test_base_cases(self): + """Test invalid test names are skipped""" + passed = ['', None] + failed = ['', None] + + output = sju.StdJson(passed=passed, failed=failed) + self.assertFalse(output.tests) + + def test_single_constructor(self): + """Test one test passing, failing, flaking via constructor""" + test = 'a' + + output = sju.StdJson(passed=test) + self.assertEqual(output.tests['a']['actual'], 'PASS') + + output = sju.StdJson(failed=test) + self.assertEqual(output.tests['a']['actual'], 'FAIL') + + output = sju.StdJson(passed=test, flaky=True) + self.assertEqual(output.tests['a']['actual'], 'PASS') + self.assertTrue(output.tests['a']['is_flaky']) + + def test_multi_run(self): + """Test multiple executions of the same test""" + test = 'a' + + output = sju.StdJson(passed=test) + self.assertEqual(output.tests['a']['actual'], 'PASS') + + output.mark_failed(test) + self.assertEqual(output.tests['a']['actual'], 'PASS FAIL') + + output.mark_pass(test, flaky=True) + self.assertEqual(output.tests['a']['actual'], 'PASS FAIL PASS') + self.assertTrue(output.tests['a']['is_flaky']) + + def test_multi_scenario(self): + """Test a scenario where some tests pass, fail and flake""" + passed = ['a', 'b', 'c'] + failed = ['d'] + flaked = ['e'] + + output = sju.StdJson(passed=passed, failed=failed, flaked=flaked) + self.assertEqual(len(output.tests), 5) + # Ensure that the flaked is set as passed, with is_flaky=True + self.assertTrue(output.tests['e']['is_flaky']) + + # A retry that re-runs failed fails again + output.mark_failed('d') + self.assertEqual(output.tests['d']['actual'], 'FAIL FAIL') + + # Another retry of 'd' passes, so we set it as a flaky pass + output.mark_passed('d', flaky=True) + self.assertEqual(output.tests['d']['actual'], 'FAIL FAIL PASS') + self.assertTrue(output.tests['d']['is_flaky']) + + def test_flaky_without_explicit(self): + """Test setting pass on an already failed test, w/o explicit flaky""" + test = 'e' + output = sju.StdJson() + output.mark_failed(test) + self.assertEqual(output.tests['e']['actual'], 'FAIL') + + output.mark_passed(test) + self.assertEqual(output.tests['e']['actual'], 'FAIL PASS') + self.assertTrue(output.tests['e']['is_flaky']) + + def test_timeout(self): + """Test setting timeout""" + test = 'e' + output = sju.StdJson() + output.mark_timeout(test) + self.assertEqual(output.tests['e']['actual'], 'TIMEOUT') + + output = sju.StdJson() + output.mark_failed(test) + self.assertEqual(output.tests['e']['actual'], 'FAIL') + output.mark_timeout(test) + self.assertTrue(output.tests['e']['actual'], 'FAIL TIMEOUT') + + +if __name__ == '__main__': + unittest.main()
diff --git a/ios/build/bots/scripts/test_apps.py b/ios/build/bots/scripts/test_apps.py index 7e98ec8..a5556c3 100644 --- a/ios/build/bots/scripts/test_apps.py +++ b/ios/build/bots/scripts/test_apps.py
@@ -242,7 +242,9 @@ self.test_app_path, self.host_app_path, self.release): test_name = '%s/%s' % (test_class, test_method) if (test_name not in none_tests and - # Filter by self.included_tests if specified + # inlcuded_tests contains the tests to execute, which may be a subset + # of all tests b/c of the iOS test sharding logic in run.py. Filter by + # self.included_tests if specified (test_class in self.included_tests if self.included_tests else True)): all_tests.append(test_name) return all_tests
diff --git a/ios/build/bots/scripts/test_runner.py b/ios/build/bots/scripts/test_runner.py index 344693f..5f604bf 100644 --- a/ios/build/bots/scripts/test_runner.py +++ b/ios/build/bots/scripts/test_runner.py
@@ -22,6 +22,7 @@ import coverage_util import gtest_utils import iossim_util +import standard_json_util as sju import test_apps import xctest_utils @@ -615,6 +616,12 @@ else: raise + # Instantiate this after crash retries so that all tests have a first + # pass before entering the retry block below. + # For each retry that passes, we want to mark it separately as passed + # (ie/ "FAIL PASS"), with is_flaky=True. + output = sju.StdJson(passed=passed, failed=failed, flaked=flaked) + # Retry failed test cases. retry_results = {} test_app.excluded_tests = [] @@ -631,6 +638,7 @@ # If the test passed on retry, consider it flake instead of failure. if test in retry_result.passed_tests: flaked[test] = failed.pop(test) + output.mark_passed(test, flaky=True) # Save the result of the latest run for each test. retry_results[test] = retry_result @@ -643,14 +651,8 @@ 'FAIL': len(failed) + len(flaked), 'PASS': len(passed), } - tests = collections.OrderedDict() - for test in passed: - tests[test] = { 'expected': 'PASS', 'actual': 'PASS' } - for test in failed: - tests[test] = { 'expected': 'PASS', 'actual': 'FAIL' } - for test in flaked: - tests[test] = { 'expected': 'PASS', 'actual': 'FAIL' } - self.test_results['tests'] = tests + + self.test_results['tests'] = output.tests self.logs['passed tests'] = passed if flaked:
diff --git a/ios/build/bots/scripts/xcodebuild_runner.py b/ios/build/bots/scripts/xcodebuild_runner.py index cff0f28f..19c2a52 100644 --- a/ios/build/bots/scripts/xcodebuild_runner.py +++ b/ios/build/bots/scripts/xcodebuild_runner.py
@@ -14,6 +14,7 @@ import coverage_util import iossim_util +import standard_json_util as sju import test_apps import test_runner import xcode_log_parser @@ -387,7 +388,9 @@ self.logs['flaked tests'] = list( all_failures - set(self.logs['failed tests'])) - # Gets not-started/interrupted tests + # Gets not-started/interrupted tests. + # all_tests_to_run takes into consideration that only a subset of tests may + # have run due to the test sharding logic in run.py. all_tests_to_run = set([ test_name for launch_command in launch_commands for test_name in launch_command.egtests_app.get_all_tests() @@ -403,35 +406,27 @@ 'FAIL': len(self.logs['failed tests'] + self.logs['aborted tests']), 'PASS': len(self.logs['passed tests']), } - self.test_results['tests'] = collections.OrderedDict() + output = sju.StdJson() for shard_attempts in attempts_results: for attempt, attempt_results in enumerate(shard_attempts): - for test in attempt_results['failed'].keys() + self.logs[ - 'aborted tests']: - if attempt == len(shard_attempts) - 1: - test_result = 'FAIL' - else: - test_result = self.test_results['tests'].get(test, {}).get( - 'actual', '') + ' FAIL' - self.test_results['tests'][test] = { - 'expected': 'PASS', - 'actual': test_result.strip() - } + for test in attempt_results['failed'].keys(): + output.mark_failed(test) + + # 'aborted tests' in logs is an array of strings, each string defined + # as "{TestCase}/{testMethod}" + for test in self.logs['aborted tests']: + output.mark_aborted(test) for test in attempt_results['passed']: - test_result = self.test_results['tests'].get(test, {}).get( - 'actual', '') + ' PASS' - self.test_results['tests'][test] = { - 'expected': 'PASS', - 'actual': test_result.strip() - } - if 'FAIL' in test_result: - self.test_results['tests'][test]['is_flaky'] = True + output.mark_passed(test) + + self.test_results['tests'] = output.tests # Test is failed if there are failures for the last run. - return not self.logs['failed tests'] + # or if there are aborted tests. + return not self.logs['failed tests'] and not self.logs['aborted tests'] class DeviceXcodeTestRunner(SimulatorParallelTestRunner,
diff --git a/ios/chrome/app/DEPS b/ios/chrome/app/DEPS index 2ace0b17..5891cb7 100644 --- a/ios/chrome/app/DEPS +++ b/ios/chrome/app/DEPS
@@ -26,6 +26,7 @@ "+components/web_resource", "+ios/chrome/browser", "+ios/chrome/browser/feature_engagement", + "+ios/components/webui", "+ios/net", "+ios/public/provider/chrome", "+mojo/core/embedder/embedder.h",
diff --git a/ios/chrome/app/startup/BUILD.gn b/ios/chrome/app/startup/BUILD.gn index 920eba0..f992127 100644 --- a/ios/chrome/app/startup/BUILD.gn +++ b/ios/chrome/app/startup/BUILD.gn
@@ -61,6 +61,7 @@ "//ios/chrome/browser/web:web_internal", "//ios/chrome/common", "//ios/chrome/common/app_group", + "//ios/components/webui:url_constants", "//ios/net", "//ios/public/provider/chrome/browser", "//ios/web", @@ -79,6 +80,7 @@ "//ios/chrome/app", "//ios/chrome/browser", "//ios/chrome/common/app_group", + "//ios/components/webui:url_constants", "//testing/gtest", "//url", ]
diff --git a/ios/chrome/app/startup/chrome_app_startup_parameters.mm b/ios/chrome/app/startup/chrome_app_startup_parameters.mm index 7fbc9c4..95febc32 100644 --- a/ios/chrome/app/startup/chrome_app_startup_parameters.mm +++ b/ios/chrome/app/startup/chrome_app_startup_parameters.mm
@@ -12,6 +12,7 @@ #include "ios/chrome/browser/chrome_url_constants.h" #include "ios/chrome/common/app_group/app_group_constants.h" #include "ios/chrome/common/x_callback_url.h" +#include "ios/components/webui/web_ui_url_constants.h" #import "net/base/mac/url_conversions.h" #include "url/gurl.h"
diff --git a/ios/chrome/app/startup/chrome_app_startup_parameters_unittest.mm b/ios/chrome/app/startup/chrome_app_startup_parameters_unittest.mm index 824bbe2..6d08629 100644 --- a/ios/chrome/app/startup/chrome_app_startup_parameters_unittest.mm +++ b/ios/chrome/app/startup/chrome_app_startup_parameters_unittest.mm
@@ -10,6 +10,7 @@ #import "ios/chrome/app/app_startup_parameters.h" #include "ios/chrome/browser/chrome_url_constants.h" #include "ios/chrome/common/app_group/app_group_constants.h" +#include "ios/components/webui/web_ui_url_constants.h" #include "testing/gtest_mac.h" #include "testing/platform_test.h" #include "url/gurl.h"
diff --git a/ios/chrome/app/strings/ios_strings.grd b/ios/chrome/app/strings/ios_strings.grd index a6d7b77..058eda4 100644 --- a/ios/chrome/app/strings/ios_strings.grd +++ b/ios/chrome/app/strings/ios_strings.grd
@@ -664,7 +664,21 @@ Sign Out </message> <message name="IDS_IOS_DISCONNECT_DIALOG_CONTINUE_AND_CLEAR_MOBILE" desc="The title of the continue and clear browsing data button on the disconnect dialog [iOS only]."> - Sign Out and Clear Synced Data + Sign Out and Clear Data from this Device + </message> + <message name="IDS_IOS_DISCONNECT_NON_MANAGED_ACCOUNT_FOOTER_INFO_MOBILE" desc="The information text on the disconnect footer describing signout for non-managed accounts [Length: 400em]."> + By signing out, your bookmarks, history, passwords, and other Chrome data will no longer be synced to your Google Account. + </message> + <message name="IDS_IOS_DISCONNECT_MANAGED_ACCOUNT_FOOTER_INFO_MOBILE" desc="The information text on the disconnect footer describing signout for managed accounts [Length: 400em]."> + By signing out, your bookmarks, history, passwords, and other Chrome data will no longer be synced to your Google Account. + +Because your account is managed by <ph name="HOSTED_DOMAIN">$1<ex>google.com</ex></ph>, your Chrome data will be deleted from this device when signing out. Your synced data will remain in your Google Account. + </message> + <message name="IDS_IOS_DISCONNECT_DESTRUCTIVE_DIALOG_INFO_MOBILE" desc="The information text on the disconnect dialog describing signout and clearing data [Length: 400em]."> + This will sign you out, turn off sync, and clear all Chrome data from this device. Your synced data will remain in your Google Account. + </message> + <message name="IDS_IOS_DISCONNECT_KEEP_DATA_DIALOG_INFO_MOBILE" desc="The information text on the disconnect dialog describing signout without removing synced data [Length: 400em]."> + This will sign you out and turn off sync, but your bookmarks, history, passwords and other Chrome data will remain on this device. </message> <message name="IDS_IOS_DISCONNECT_DIALOG_INFO_MOBILE" desc="The information text on the disconnect dialog [Length: 400em]."> Changes to your bookmarks, history, passwords, and other settings will no longer be synced to your Google Account. However, your existing data will remain stored in your Google Account. @@ -1586,8 +1600,8 @@ <message name="IDS_IOS_SHARE_MENU_PRINT_ACTION" desc="The text label of the Print action in the extension menu that starts the printing process. [Length: 13em] [iOS only]"> Print </message> - <message name="IDS_IOS_SHARE_MENU_GENERATE_QR_CODE_ACTION" desc="The text label of the Share as QR Code action in the extension menu that generates and shows a QR code for the current page. [iOS only]"> - Share as QR code + <message name="IDS_IOS_SHARE_MENU_GENERATE_QR_CODE_ACTION" desc="The text label of the action in the extension menu that generates and shows a QR code for the current page. [iOS only]"> + Create a QR Code </message> <message name="IDS_IOS_SHARE_MENU_READING_LIST_ACTION" desc="The text label of the Add To Reading List action in the extension menu that adds the current page to the reading list. [Length: 25em] [iOS only]"> Read Later
diff --git a/ios/chrome/browser/BUILD.gn b/ios/chrome/browser/BUILD.gn index 7d1e209..adf96cc 100644 --- a/ios/chrome/browser/BUILD.gn +++ b/ios/chrome/browser/BUILD.gn
@@ -113,6 +113,7 @@ "//ios/chrome/browser/web:feature_flags", "//ios/chrome/common", "//ios/components/io_thread", + "//ios/components/webui:url_constants", "//ios/net", "//ios/public/provider/chrome/browser", "//ios/public/provider/chrome/browser/voice", @@ -165,7 +166,10 @@ "chrome_url_constants.h", ] - deps = [ "//base" ] + deps = [ + "//base", + "//ios/components/webui:url_constants", + ] libs = [ "UIKit.framework" ] } @@ -279,6 +283,7 @@ "//components/prefs:test_support", "//components/proxy_config", "//components/variations", + "//ios/components/webui:url_constants", "//ios/public/provider/chrome/browser", "//ios/public/provider/chrome/browser/signin", "//ios/web/public/test",
diff --git a/ios/chrome/browser/DEPS b/ios/chrome/browser/DEPS index 80c4d47..a3294f9 100644 --- a/ios/chrome/browser/DEPS +++ b/ios/chrome/browser/DEPS
@@ -108,6 +108,8 @@ "+google_apis", "+ios/chrome/app", "+ios/components/io_thread", + "+ios/components/ui_util", + "+ios/components/webui", "+ios/net", "+ios/public/provider/chrome", "+ios/public/provider/components",
diff --git a/ios/chrome/browser/autocomplete/BUILD.gn b/ios/chrome/browser/autocomplete/BUILD.gn index 0afacd6..0422617 100644 --- a/ios/chrome/browser/autocomplete/BUILD.gn +++ b/ios/chrome/browser/autocomplete/BUILD.gn
@@ -41,6 +41,7 @@ "//ios/chrome/browser/signin", "//ios/chrome/browser/sync", "//ios/chrome/browser/web_state_list", + "//ios/components/webui:url_constants", "//ios/public/provider/chrome/browser", "//ios/web", "//url",
diff --git a/ios/chrome/browser/autocomplete/autocomplete_provider_client_impl.mm b/ios/chrome/browser/autocomplete/autocomplete_provider_client_impl.mm index 7e35c30..5ba8187 100644 --- a/ios/chrome/browser/autocomplete/autocomplete_provider_client_impl.mm +++ b/ios/chrome/browser/autocomplete/autocomplete_provider_client_impl.mm
@@ -32,6 +32,7 @@ #include "ios/chrome/browser/signin/identity_manager_factory.h" #include "ios/chrome/browser/sync/profile_sync_service_factory.h" #import "ios/chrome/browser/web_state_list/web_state_list.h" +#include "ios/components/webui/web_ui_url_constants.h" #include "services/network/public/cpp/shared_url_loader_factory.h" #if !defined(__has_feature) || !__has_feature(objc_arc)
diff --git a/ios/chrome/browser/autocomplete/in_memory_url_index_factory.cc b/ios/chrome/browser/autocomplete/in_memory_url_index_factory.cc index 68a626b..7f6d129d 100644 --- a/ios/chrome/browser/autocomplete/in_memory_url_index_factory.cc +++ b/ios/chrome/browser/autocomplete/in_memory_url_index_factory.cc
@@ -17,6 +17,7 @@ #include "ios/chrome/browser/chrome_url_constants.h" #include "ios/chrome/browser/history/history_service_factory.h" #include "ios/chrome/browser/search_engines/template_url_service_factory.h" +#include "ios/components/webui/web_ui_url_constants.h" namespace ios {
diff --git a/ios/chrome/browser/browser_about_rewriter.cc b/ios/chrome/browser/browser_about_rewriter.cc index 0b8bce8..d7f6d6e 100644 --- a/ios/chrome/browser/browser_about_rewriter.cc +++ b/ios/chrome/browser/browser_about_rewriter.cc
@@ -12,6 +12,7 @@ #include "components/url_formatter/url_fixer.h" #include "ios/chrome/browser/chrome_url_constants.h" #include "ios/chrome/browser/ui/ui_feature_flags.h" +#include "ios/components/webui/web_ui_url_constants.h" #include "url/url_constants.h" namespace {
diff --git a/ios/chrome/browser/browser_state/BUILD.gn b/ios/chrome/browser/browser_state/BUILD.gn index 633c606..9cba7401 100644 --- a/ios/chrome/browser/browser_state/BUILD.gn +++ b/ios/chrome/browser/browser_state/BUILD.gn
@@ -28,6 +28,7 @@ "//components/webdata_services", "//ios/chrome/browser:chrome_url_constants", "//ios/chrome/browser/net:net_types", + "//ios/components/webui:url_constants", "//ios/web/public/webui", ]
diff --git a/ios/chrome/browser/browser_state/chrome_browser_state.mm b/ios/chrome/browser/browser_state/chrome_browser_state.mm index 20f23244..efa0497 100644 --- a/ios/chrome/browser/browser_state/chrome_browser_state.mm +++ b/ios/chrome/browser/browser_state/chrome_browser_state.mm
@@ -13,6 +13,7 @@ #include "components/sync_preferences/pref_service_syncable.h" #include "components/variations/net/variations_http_headers.h" #include "ios/chrome/browser/chrome_url_constants.h" +#include "ios/components/webui/web_ui_url_constants.h" #include "ios/web/public/thread/web_thread.h" #import "ios/web/public/web_state.h" #include "ios/web/public/webui/web_ui_ios.h"
diff --git a/ios/chrome/browser/chrome_url_constants.cc b/ios/chrome/browser/chrome_url_constants.cc index 48913bf..b1f978a 100644 --- a/ios/chrome/browser/chrome_url_constants.cc +++ b/ios/chrome/browser/chrome_url_constants.cc
@@ -7,8 +7,7 @@ #include <stddef.h> #include "base/stl_util.h" - -const char kChromeUIScheme[] = "chrome"; +#include "ios/components/webui/web_ui_url_constants.h" const char kChromeUIChromeURLsURL[] = "chrome://chrome-urls/"; const char kChromeUICreditsURL[] = "chrome://credits/"; @@ -47,7 +46,6 @@ const char kChromeUIPrefsInternalsHost[] = "prefs-internals"; const char kChromeUISignInInternalsHost[] = "signin-internals"; const char kChromeUISuggestionsHost[] = "suggestions"; -const char kChromeUISyncInternalsHost[] = "sync-internals"; const char kChromeUITermsHost[] = "terms"; const char kChromeUITranslateInternalsHost[] = "translate-internals"; const char kChromeUIURLKeyedMetricsHost[] = "ukm";
diff --git a/ios/chrome/browser/chrome_url_constants.h b/ios/chrome/browser/chrome_url_constants.h index 715781a..c879478 100644 --- a/ios/chrome/browser/chrome_url_constants.h +++ b/ios/chrome/browser/chrome_url_constants.h
@@ -9,15 +9,6 @@ // Contains constants for known URLs and portions thereof. -// TODO(blundell): This file should be ios_chrome_url_constants.*, and all of -// these constants should have a kIOSChrome prefix instead of a kChrome -// prefix. crbug.com/537174 - -// URL scheme for Chrome on iOS. This needs to be kept in sync with the constant -// kChromeUIScheme defined in content/public/common/url_constants.h until Chrome -// on iOS stops depending on //content downstream. -extern const char kChromeUIScheme[]; - // chrome: URLs (including schemes). Should be kept in sync with the // URL components below. extern const char kChromeUIChromeURLsURL[]; @@ -59,7 +50,6 @@ extern const char kChromeUIPrefsInternalsHost[]; extern const char kChromeUISignInInternalsHost[]; extern const char kChromeUISuggestionsHost[]; -extern const char kChromeUISyncInternalsHost[]; extern const char kChromeUITermsHost[]; extern const char kChromeUITranslateInternalsHost[]; extern const char kChromeUIURLKeyedMetricsHost[];
diff --git a/ios/chrome/browser/chrome_url_util.mm b/ios/chrome/browser/chrome_url_util.mm index 15ed15deb..313bd7f 100644 --- a/ios/chrome/browser/chrome_url_util.mm +++ b/ios/chrome/browser/chrome_url_util.mm
@@ -11,6 +11,7 @@ #include "base/strings/string_util.h" #include "base/strings/sys_string_conversions.h" #include "ios/chrome/browser/chrome_url_constants.h" +#include "ios/components/webui/web_ui_url_constants.h" #import "ios/net/url_scheme_util.h" #include "url/gurl.h" #include "url/url_constants.h"
diff --git a/ios/chrome/browser/chrome_url_util_unittest.mm b/ios/chrome/browser/chrome_url_util_unittest.mm index 990492f..5783c10 100644 --- a/ios/chrome/browser/chrome_url_util_unittest.mm +++ b/ios/chrome/browser/chrome_url_util_unittest.mm
@@ -7,6 +7,7 @@ #include "base/stl_util.h" #include "base/strings/sys_string_conversions.h" #include "ios/chrome/browser/chrome_url_constants.h" +#include "ios/components/webui/web_ui_url_constants.h" #import "net/base/mac/url_conversions.h" #import "testing/gtest_mac.h" #include "testing/platform_test.h"
diff --git a/ios/chrome/browser/favicon/BUILD.gn b/ios/chrome/browser/favicon/BUILD.gn index 8fa6fd79..f6b55494 100644 --- a/ios/chrome/browser/favicon/BUILD.gn +++ b/ios/chrome/browser/favicon/BUILD.gn
@@ -34,6 +34,7 @@ "//ios/chrome/browser/history", "//ios/chrome/browser/ui/util", "//ios/chrome/common/ui/favicon", + "//ios/components/webui:url_constants", "//ios/web", "//skia", "//ui/base",
diff --git a/ios/chrome/browser/favicon/favicon_client_impl.mm b/ios/chrome/browser/favicon/favicon_client_impl.mm index 56f6cbe..f4f5043 100644 --- a/ios/chrome/browser/favicon/favicon_client_impl.mm +++ b/ios/chrome/browser/favicon/favicon_client_impl.mm
@@ -15,6 +15,7 @@ #include "components/favicon_base/select_favicon_frames.h" #include "components/grit/components_scaled_resources.h" #include "ios/chrome/browser/chrome_url_constants.h" +#include "ios/components/webui/web_ui_url_constants.h" #include "ui/base/layout.h" #include "ui/base/resource/resource_bundle.h" #include "ui/gfx/favicon_size.h"
diff --git a/ios/chrome/browser/history/BUILD.gn b/ios/chrome/browser/history/BUILD.gn index b940bfbf..d05ebac 100644 --- a/ios/chrome/browser/history/BUILD.gn +++ b/ios/chrome/browser/history/BUILD.gn
@@ -32,6 +32,7 @@ "//ios/chrome/browser", "//ios/chrome/browser/browser_state", "//ios/chrome/browser/signin", + "//ios/components/webui:url_constants", "//ios/web", "//net", "//url",
diff --git a/ios/chrome/browser/history/history_utils.cc b/ios/chrome/browser/history/history_utils.cc index 1cc3dd7..bab8f9e5 100644 --- a/ios/chrome/browser/history/history_utils.cc +++ b/ios/chrome/browser/history/history_utils.cc
@@ -6,6 +6,7 @@ #include "components/dom_distiller/core/url_constants.h" #include "ios/chrome/browser/chrome_url_constants.h" +#include "ios/components/webui/web_ui_url_constants.h" #include "url/gurl.h" #include "url/url_constants.h"
diff --git a/ios/chrome/browser/interstitials/BUILD.gn b/ios/chrome/browser/interstitials/BUILD.gn index ff6ac09..5b7157c 100644 --- a/ios/chrome/browser/interstitials/BUILD.gn +++ b/ios/chrome/browser/interstitials/BUILD.gn
@@ -26,6 +26,7 @@ "//ios/chrome/browser/browser_state", "//ios/chrome/browser/history", "//ios/chrome/browser/ui/util", + "//ios/components/ui_util", "//ios/web", "//ios/web/common", "//ios/web/public",
diff --git a/ios/chrome/browser/interstitials/ios_chrome_controller_client.mm b/ios/chrome/browser/interstitials/ios_chrome_controller_client.mm index 5b05769..cf3c2c8 100644 --- a/ios/chrome/browser/interstitials/ios_chrome_controller_client.mm +++ b/ios/chrome/browser/interstitials/ios_chrome_controller_client.mm
@@ -32,7 +32,11 @@ web_state_->AddObserver(this); } -IOSChromeControllerClient::~IOSChromeControllerClient() {} +IOSChromeControllerClient::~IOSChromeControllerClient() { + if (web_state_) { + web_state_->RemoveObserver(this); + } +} void IOSChromeControllerClient::SetWebInterstitial( web::WebInterstitial* web_interstitial) {
diff --git a/ios/chrome/browser/interstitials/ios_security_interstitial_page.mm b/ios/chrome/browser/interstitials/ios_security_interstitial_page.mm index 916884e..e7c2a1e 100644 --- a/ios/chrome/browser/interstitials/ios_security_interstitial_page.mm +++ b/ios/chrome/browser/interstitials/ios_security_interstitial_page.mm
@@ -14,7 +14,7 @@ #include "ios/chrome/browser/application_context.h" #include "ios/chrome/browser/browser_state/chrome_browser_state.h" #include "ios/chrome/browser/pref_names.h" -#include "ios/chrome/browser/ui/util/dynamic_type_util.h" +#include "ios/components/ui_util/dynamic_type_util.h" #include "ios/web/common/features.h" #include "ios/web/public/security/web_interstitial.h" #import "ios/web/public/web_state.h" @@ -39,7 +39,7 @@ bool converted = base::StringToDouble(old_size.substr(0, old_size.size() - 1), &new_size); DCHECK(converted); - new_size *= SystemSuggestedFontSizeMultiplier(); + new_size *= ui_util::SystemSuggestedFontSizeMultiplier(); load_time_data.SetString("fontsize", base::StringPrintf("%.0lf%%", new_size)); } }
diff --git a/ios/chrome/browser/metrics/BUILD.gn b/ios/chrome/browser/metrics/BUILD.gn index 756a763..dc76f8fd 100644 --- a/ios/chrome/browser/metrics/BUILD.gn +++ b/ios/chrome/browser/metrics/BUILD.gn
@@ -82,6 +82,7 @@ "//ios/chrome/browser/variations:ios_chrome_ui_string_overrider_factory", "//ios/chrome/browser/web_state_list", "//ios/chrome/common", + "//ios/components/webui:url_constants", "//ios/public/provider/chrome/browser", "//ios/web/common", "//ios/web/public/deprecated", @@ -148,6 +149,7 @@ "//ios/chrome/browser/sessions:restoration_agent", "//ios/chrome/browser/sessions:restoration_observer", "//ios/chrome/browser/web_state_list", + "//ios/components/webui:url_constants", "//ios/web", "//services/metrics/public/cpp:ukm_builders", "//ui/base", @@ -228,6 +230,7 @@ configs += [ "//build/config/compiler:enable_arc" ] testonly = true sources = [ + "demographics_egtest.mm", "tab_usage_recorder_egtest.mm", "ukm_egtest.mm", ] @@ -239,6 +242,7 @@ "//base/test:test_support", "//components/browser_sync", "//components/metrics", + "//components/metrics:demographic_metrics_provider", "//components/metrics_services_manager", "//components/strings", "//components/ukm", @@ -283,6 +287,7 @@ ] testonly = true sources = [ + "demographics_egtest.mm", "tab_usage_recorder_egtest.mm", "ukm_egtest.mm", ] @@ -290,7 +295,9 @@ ":eg_test_support+eg2", ":tab_usage_recorder_metrics", "//base/test:test_support", + "//components/metrics:demographic_metrics_provider", "//components/strings:components_strings_grit", + "//components/ukm", "//ios/chrome/app/strings:ios_strings_grit", "//ios/chrome/browser/ui/authentication:eg_test_support+eg2", "//ios/chrome/test:eg_test_support+eg2", @@ -316,11 +323,15 @@ ":metrics", "//base", "//base/test:test_support", + "//components/metrics", "//components/metrics_services_manager", + "//components/network_time", + "//components/sync/base", "//components/ukm", "//ios/chrome/app:app_internal", "//ios/chrome/app/strings", "//ios/chrome/browser", + "//ios/chrome/browser/browser_state", "//ios/chrome/browser/metrics:metrics_internal", "//ios/chrome/browser/tabs", "//ios/chrome/browser/ui/main", @@ -333,6 +344,10 @@ "//ios/testing/earl_grey:earl_grey_support", "//net:test_support", "//services/metrics/public/cpp:metrics_cpp", + "//third_party/metrics_proto", + + #TODO(crbug.com/1066297): Remove the below line. + "//third_party/zlib/google:compression_utils", "//ui/base", ] configs += [ "//build/config/compiler:enable_arc" ] @@ -365,15 +380,20 @@ deps = [ "//base", "//base/test:test_support", + "//components/metrics", "//components/metrics_services_manager", - "//components/metrics_services_manager:metrics_services_manager", + "//components/network_time", + "//components/sync/base", "//components/ukm", "//ios/chrome/browser", + "//ios/chrome/browser/browser_state", "//ios/chrome/browser/metrics", "//ios/chrome/browser/metrics:metrics_internal", "//ios/chrome/test/app:test_support", "//ios/testing:nserror_support", "//services/metrics/public/cpp:metrics_cpp", + "//third_party/metrics_proto", + "//third_party/zlib/google:compression_utils", ] }
diff --git a/ios/chrome/browser/metrics/DEPS b/ios/chrome/browser/metrics/DEPS index 0875a3ef..96d839d 100644 --- a/ios/chrome/browser/metrics/DEPS +++ b/ios/chrome/browser/metrics/DEPS
@@ -4,4 +4,8 @@ "tab_usage_recorder_egtest\.mm": [ "+ios/web/public/test/http_server", ], + + "metrics_app_interface\.mm": [ + "+third_party/zlib/google/compression_utils.h", + ], }
diff --git a/ios/chrome/browser/metrics/demographics_egtest.mm b/ios/chrome/browser/metrics/demographics_egtest.mm new file mode 100644 index 0000000..b6b30819 --- /dev/null +++ b/ios/chrome/browser/metrics/demographics_egtest.mm
@@ -0,0 +1,232 @@ +// Copyright 2020 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "base/macros.h" +#import "base/test/ios/wait_util.h" +#include "base/time/default_clock.h" +#include "base/time/default_tick_clock.h" +#include "base/time/time.h" +#include "components/metrics/demographic_metrics_provider.h" +#include "components/ukm/ukm_service.h" +#import "ios/chrome/browser/metrics/metrics_app_interface.h" +#import "ios/chrome/browser/ui/authentication/signin_earl_grey_ui.h" +#import "ios/chrome/browser/ui/authentication/signin_earlgrey_utils.h" +#import "ios/chrome/test/earl_grey/chrome_earl_grey.h" +#import "ios/chrome/test/earl_grey/chrome_test_case.h" +#import "ios/testing/earl_grey/app_launch_configuration.h" +#import "ios/testing/earl_grey/earl_grey_test.h" +#include "third_party/metrics_proto/user_demographics.pb.h" + +#if !defined(__has_feature) || !__has_feature(objc_arc) +#error "This file requires ARC support." +#endif + +namespace { + +const int kTestBirthYear = 1990; + +// TODO(crbug.com/1066910): Use a proto instead. +// Corresponds to GENDER_MALE in UserDemographicsProto::Gender. +const int kTestGender = 1; + +} // namespace + +@interface DemographicsTestCase : ChromeTestCase + +@end + +@implementation DemographicsTestCase + +- (void)setUp { + [super setUp]; + GREYAssertNil([MetricsAppInterface setupHistogramTester], + @"Failed to set up histogram tester."); + [MetricsAppInterface overrideMetricsAndCrashReportingForTesting]; + [self addUserDemographicsToSyncServerWithBirthYear:kTestBirthYear + gender:kTestGender]; + [self signInAndSync]; + [self grantMetricsConsent]; + + // Set a network time so that SyncPrefs::GetUserNoisedBirthYearAndGender + // does not return a UserDemographicsResult for the kCannotGetTime status. + [MetricsAppInterface setNetworkTimeForTesting]; + + // Record a source in the UKM service so that there is data with which to + // generate a UKM Report. + [self addDummyUKMSource]; + + [MetricsAppInterface buildAndStoreUKMLog]; + GREYAssertTrue([MetricsAppInterface hasUnsentLogs], + @"The UKM service should have unsent logs."); +} + +- (void)tearDown { + [MetricsAppInterface stopOverridingMetricsAndCrashReportingForTesting]; + GREYAssertNil([MetricsAppInterface releaseHistogramTester], + @"Failed to release histogram tester."); + [super tearDown]; +} + +- (AppLaunchConfiguration)appConfigurationForTestCase { + NSString* testName = [self getTestName]; + AppLaunchConfiguration config; + + // Features are enabled or disabled based on the name of the test that is + // running. This is done because (A) parameterized tests do not exist in Earl + // Grey and (B) it is inefficient to use ensureAppLaunchedWithConfiguration + // for each test. + // + // Note that in the if statements, @selector(testSomething) is used rather + // than @"testSomething" because the former checks that the testSomething + // method exists somewhere--but not necessarily in this class. + if ([testName isEqual:NSStringFromSelector(@selector( + testSyncAndRecordUserDemographicsEnabled))]) { + config.features_enabled.push_back( + metrics::DemographicMetricsProvider::kDemographicMetricsReporting); + config.features_enabled.push_back( + ukm::UkmService::kReportUserNoisedUserBirthYearAndGender); + } else if ([testName + isEqual:NSStringFromSelector(@selector( + testSyncAndRecordUserDemographicsDisabled))]) { + config.features_disabled.push_back( + metrics::DemographicMetricsProvider::kDemographicMetricsReporting); + config.features_disabled.push_back( + ukm::UkmService::kReportUserNoisedUserBirthYearAndGender); + } + return config; +} + +#pragma mark - Helpers + +// Adds user demographics, which are ModelType::PRIORITY_PREFERENCES, to the +// fake sync server. The year is the un-noised birth year, and the gender +// corresponds to the options in UserDemographicsProto::Gender. +// +// Also, verifies (A) that before adding the demographics, the server has no +// priority preferences and (B) that after adding the demographics, the server +// has one priority preference. +- (void)addUserDemographicsToSyncServerWithBirthYear:(int)year + gender:(int)gender { + GREYAssertEqual( + [ChromeEarlGrey + numberOfSyncEntitiesWithType:syncer::PRIORITY_PREFERENCES], + 0, @"The fake sync server should have no priority preferences."); + + [ChromeEarlGrey addUserDemographicsToSyncServerWithBirthYear:year + gender:gender]; + + GREYAssertEqual( + [ChromeEarlGrey + numberOfSyncEntitiesWithType:syncer::PRIORITY_PREFERENCES], + 1, @"The fake sync server should have one priority preference."); +} + +// Signs into Chrome with a fake identity, turns on sync, and then waits up to +// kSyncUKMOperationsTimeout for sync to initialize. +- (void)signInAndSync { + // Note that there is only one profile on iOS. Additionally, URL-keyed + // anonymized data collection is turned on as part of the flow to Sign in to + // Chrome and Turn on sync. This matches the main user flow that enables + // UKM. + [SigninEarlGreyUI signinWithFakeIdentity:[SigninEarlGreyUtils fakeIdentity1]]; + [ChromeEarlGrey waitForSyncInitialized:YES + syncTimeout:syncher::kSyncUKMOperationsTimeout]; +} + +// Adds a dummy UKM source to the UKM service's recordings. The presence of this +// dummy source allows UKM reports to be built and logged. +- (void)addDummyUKMSource { + const uint64_t sourceId = 0x54321; + [MetricsAppInterface UKMRecordDummySource:sourceId]; + GREYAssert([MetricsAppInterface UKMHasDummySource:sourceId], + @"Failed to record dummy source."); +} + +// Turns on metrics collection for testing and verifies that this has been +// successfully done. +- (void)grantMetricsConsent { + GREYAssertFalse( + [MetricsAppInterface setMetricsAndCrashReportingForTesting:YES], + @"User consent has already been granted."); + GREYAssert([MetricsAppInterface checkUKMRecordingEnabled:YES], + @"Failed to assert that UKM recording is enabled."); + + // The client ID is non-zero after metrics uploading permissions are updated. + GREYAssertNotEqual(0U, [MetricsAppInterface UKMClientID], + @"Client ID should be non-zero."); +} + +// Returns the short test name, e.g. "testSomething" of the test that is +// currently running. The short test name is extracted from the string for the +// test's name property, e.g. "-[DemographicsTestCase testSomething]". +- (NSString*)getTestName { + int testNameStart = [self.name rangeOfString:@"test"].location; + return [self.name + substringWithRange:NSMakeRange(testNameStart, + self.name.length - testNameStart - 1)]; +} + +#pragma mark - Tests + +// The tests in this file should correspond to the demographics-related tests in +// //chrome/browser/metrics/ukm_browsertest.cc. + +// Tests that user demographics are synced, recorded by UKM, and logged in +// histograms. +// +// Corresponds to AddSyncedUserBirthYearAndGenderToProtoData in +// //chrome/browser/metrics/ukm_browsertest.cc with features enabled. +- (void)testSyncAndRecordUserDemographicsEnabled { +#if defined(CHROME_EARL_GREY_1) + EARL_GREY_TEST_DISABLED(@"This test relies on EG2 utilities."); +#endif + + // See |appConfigurationForTestCase| for feature set-up. The kUkmFeature is + // enabled by default. + GREYAssertTrue([ChromeEarlGrey isDemographicMetricsReportingEnabled] && + [MetricsAppInterface + isReportUserNoisedUserBirthYearAndGenderEnabled] && + [ChromeEarlGrey isUKMEnabled], + @"Failed to enable the requisite features."); + + GREYAssertTrue([MetricsAppInterface UKMReportHasBirthYear:kTestBirthYear + gender:kTestGender], + @"The report should contain the specified user demographics"); + + int successBucket = 0; // 0 denotes UserDemographicsStatus::kSuccess. + GREYAssertNil([MetricsAppInterface + expectUniqueSampleWithCount:1 + forBucket:successBucket + forHistogram:@"UKM.UserDemographics.Status"], + @"Unexpected histogram contents"); +} + +// Tests that user demographics are neither recorded by UKM nor logged in +// histograms when sync is turned on. +// +// Corresponds to AddSyncedUserBirthYearAndGenderToProtoData in +// //chrome/browser/metrics/ukm_browsertest.cc with features disabled. +- (void)testSyncAndRecordUserDemographicsDisabled { +#if defined(CHROME_EARL_GREY_1) + EARL_GREY_TEST_DISABLED(@"This test relies on EG2 utilities."); +#endif + + // See |appConfigurationForTestCase| for feature set-up. The kUkmFeature is + // enabled by default. + GREYAssertFalse([ChromeEarlGrey isDemographicMetricsReportingEnabled], + @"Failed to disable kDemographicMetricsReporting."); + GREYAssertFalse( + [MetricsAppInterface isReportUserNoisedUserBirthYearAndGenderEnabled], + @"Failed to disable kReportUserNoisedUserBirthYearAndGender."); + GREYAssertTrue([ChromeEarlGrey isUKMEnabled], + @"Failed to enable kUkmFeature."); + + GREYAssertFalse([MetricsAppInterface UKMReportHasUserDemographics], + @"The report should not contain user demographics."); + GREYAssertNil([MetricsAppInterface expectSum:0 + forHistogram:@"UKM.UserDemographics.Status"], + @"Unexpected histogram contents."); +} + +@end
diff --git a/ios/chrome/browser/metrics/ios_chrome_stability_metrics_provider.mm b/ios/chrome/browser/metrics/ios_chrome_stability_metrics_provider.mm index 202edd7..c0146ab 100644 --- a/ios/chrome/browser/metrics/ios_chrome_stability_metrics_provider.mm +++ b/ios/chrome/browser/metrics/ios_chrome_stability_metrics_provider.mm
@@ -7,6 +7,7 @@ #include "base/feature_list.h" #include "base/metrics/histogram_macros.h" #include "ios/chrome/browser/chrome_url_constants.h" +#include "ios/components/webui/web_ui_url_constants.h" #include "ios/web/common/features.h" #import "ios/web/public/navigation/navigation_context.h" #include "url/gurl.h"
diff --git a/ios/chrome/browser/metrics/metrics_app_interface.h b/ios/chrome/browser/metrics/metrics_app_interface.h index 6349cbd..cd78ae03 100644 --- a/ios/chrome/browser/metrics/metrics_app_interface.h +++ b/ios/chrome/browser/metrics/metrics_app_interface.h
@@ -9,39 +9,73 @@ #include "base/compiler_specific.h" -// MetricsAppInterface contains the app-side -// implementation for helpers. These helpers are compiled into -// the app binary and can be called from either app or test code. +namespace syncher { + +// Constant for timeout while waiting for asynchronous sync and UKM operations. +const NSTimeInterval kSyncUKMOperationsTimeout = 10.0; + +} // namespace syncher + +// MetricsAppInterface contains the app-side implementation for helpers. These +// helpers are compiled into the app binary and can be called from either app or +// test code. @interface MetricsAppInterface : NSObject // Enable/Disable the metrics in the app for test. // |overrideMetricsAndCrashReportingForTesting| must be called before setting -// the value +// the value. // |stopOverridingMetricsAndCrashReportingForTesting| must be called at the end // of the test for cleanup. -// |setMetricsAndCrashReportingForTesting:| can be called to set to -// enable/disable metrics. It returns whether metrics were previously enabled. +// |setMetricsAndCrashReportingForTesting:| can be called to enable/disable +// metrics. It returns whether metrics were previously enabled. + (void)overrideMetricsAndCrashReportingForTesting; + (void)stopOverridingMetricsAndCrashReportingForTesting; + (BOOL)setMetricsAndCrashReportingForTesting:(BOOL)enabled; -// Returns whether the UKM recording is |enabled|. +// TODO(crbug.com/1066297): Refactor to remove duplicate code. +// Returns whether UKM recording is |enabled|. + (BOOL)checkUKMRecordingEnabled:(BOOL)enabled; +// Returns YES if the ReportUserNoisedUserBirthYearAndGender feature is enabled. ++ (BOOL)isReportUserNoisedUserBirthYearAndGenderEnabled WARN_UNUSED_RESULT; + +// TODO(crbug.com/1066297): Refactor to remove duplicate code. // Returns the current UKM client ID. + (uint64_t)UKMClientID; +// TODO(crbug.com/1066297): Refactor to remove duplicate code. // Checks whether a sourceID is registered for UKM. + (BOOL)UKMHasDummySource:(int64_t)sourceId; +// TODO(crbug.com/1066297): Refactor to remove duplicate code. // Adds a new sourceID for UKM. + (void)UKMRecordDummySource:(int64_t)sourceId; -// Creates a chrome_test_util::HistogramTester that will record every histograms +// TODO(crbug.com/1066297): Refactor to remove duplicate code. +// Sets the network time to approximately now. ++ (void)setNetworkTimeForTesting; + +// TODO(crbug.com/1066297): Refactor to remove duplicate code. +// If new data are available, creates a UKM Report and stores it in the +// UKM service's UnsentLogStore. ++ (void)buildAndStoreUKMLog; + +// TODO(crbug.com/1066297): Refactor to remove duplicate code. +// Returns YES if the UKM service has logs to send. ++ (BOOL)hasUnsentLogs; + +// Returns YES if the UKM service's report has the expected year and gender. +// Gender corresponds to the options in UserDemographicsProto::Gender. ++ (BOOL)UKMReportHasBirthYear:(int)year gender:(int)gender; + +// Returns YES if the UKM service's report has user demographics. ++ (BOOL)UKMReportHasUserDemographics; + +// Creates a chrome_test_util::HistogramTester that will record every histogram // sent during test. + (NSError*)setupHistogramTester WARN_UNUSED_RESULT; -// Released the chrome_test_util::HistogramTester. +// Releases the chrome_test_util::HistogramTester. + (NSError*)releaseHistogramTester WARN_UNUSED_RESULT; // We don't know the values of the samples, but we know how many there are.
diff --git a/ios/chrome/browser/metrics/metrics_app_interface.mm b/ios/chrome/browser/metrics/metrics_app_interface.mm index c186db9..8bc0124a 100644 --- a/ios/chrome/browser/metrics/metrics_app_interface.mm +++ b/ios/chrome/browser/metrics/metrics_app_interface.mm
@@ -4,24 +4,37 @@ #include "ios/chrome/browser/metrics/metrics_app_interface.h" +#include <memory> + +#include "base/feature_list.h" +#include "base/run_loop.h" #include "base/stl_util.h" #include "base/strings/sys_string_conversions.h" #import "base/test/ios/wait_util.h" +#include "base/time/default_clock.h" +#include "base/time/default_tick_clock.h" +#include "base/time/time.h" +#include "components/metrics/unsent_log_store.h" #include "components/metrics_services_manager/metrics_services_manager.h" +#include "components/network_time/network_time_tracker.h" +#include "components/sync/base/pref_names.h" #include "components/ukm/ukm_service.h" #include "ios/chrome/browser/application_context.h" +#include "ios/chrome/browser/browser_state/chrome_browser_state.h" +#include "ios/chrome/browser/browser_state/chrome_browser_state_manager.h" #include "ios/chrome/browser/metrics/ios_chrome_metrics_service_accessor.h" #import "ios/chrome/test/app/histogram_test_util.h" #import "ios/testing/nserror_util.h" #include "services/metrics/public/cpp/ukm_source_id.h" +#include "third_party/metrics_proto/ukm/report.pb.h" +#include "third_party/metrics_proto/user_demographics.pb.h" +#include "third_party/zlib/google/compression_utils.h" #if !defined(__has_feature) || !__has_feature(objc_arc) #error "This file requires ARC support." #endif namespace { -// Constant for timeout while waiting for asynchronous sync and UKM operations. -const NSTimeInterval kSyncUKMOperationsTimeout = 10.0; bool g_metrics_enabled = false; @@ -43,6 +56,11 @@ return service ? service->recording_enabled_ : false; } + static bool IsReportUserNoisedUserBirthYearAndGenderEnabled() { + return base::FeatureList::IsEnabled( + ukm::UkmService::kReportUserNoisedUserBirthYearAndGender); + } + static uint64_t client_id() { auto* service = ukm_service(); return service ? service->client_id_ : 0; @@ -61,6 +79,53 @@ service->UpdateSourceURL(source_id, GURL("http://example.com")); } + static void BuildAndStoreUkmLog() { + ukm::UkmService* service = ukm_service(); + + // Wait for initialization to complete before flushing. + base::RunLoop run_loop; + service->SetInitializationCompleteCallbackForTesting( + run_loop.QuitClosure()); + run_loop.Run(); + + service->Flush(); + } + + static bool HasUnsentLogs() { + ukm::UkmService* service = ukm_service(); + return service->reporting_service_.ukm_log_store()->has_unsent_logs(); + } + + static std::unique_ptr<ukm::Report> GetUKMReport() { + if (!HasUnsentLogs()) { + return nullptr; + } + + metrics::UnsentLogStore* log_store = + ukm_service()->reporting_service_.ukm_log_store(); + if (log_store->has_staged_log()) { + // For testing purposes, we are examining the content of a staged log + // without ever sending the log, so discard any previously staged log. + log_store->DiscardStagedLog(); + } + log_store->StageNextLog(); + if (!log_store->has_staged_log()) { + return nullptr; + } + + std::string uncompressed_log_data; + if (!compression::GzipUncompress(log_store->staged_log(), + &uncompressed_log_data)) { + return nullptr; + } + + std::unique_ptr<ukm::Report> report = std::make_unique<ukm::Report>(); + if (!report->ParseFromString(uncompressed_log_data)) { + return nullptr; + } + return report; + } + private: static ukm::UkmService* ukm_service() { return GetApplicationContext() @@ -95,8 +160,13 @@ ConditionBlock condition = ^{ return metrics::UkmEGTestHelper::ukm_enabled() == enabled; }; - return base::test::ios::WaitUntilConditionOrTimeout(kSyncUKMOperationsTimeout, - condition); + return base::test::ios::WaitUntilConditionOrTimeout( + syncher::kSyncUKMOperationsTimeout, condition); +} + ++ (BOOL)isReportUserNoisedUserBirthYearAndGenderEnabled { + return metrics::UkmEGTestHelper:: + IsReportUserNoisedUserBirthYearAndGenderEnabled(); } + (uint64_t)UKMClientID { @@ -108,7 +178,51 @@ } + (void)UKMRecordDummySource:(int64_t)sourceID { - return metrics::UkmEGTestHelper::RecordDummySource(sourceID); + metrics::UkmEGTestHelper::RecordDummySource(sourceID); +} + ++ (void)setNetworkTimeForTesting { + // The resolution was arbitrarily chosen. + base::TimeDelta resolution = base::TimeDelta::FromMilliseconds(17); + + // Simulate the latency in the network to get the network time from the remote + // server. + base::TimeDelta latency = base::TimeDelta::FromMilliseconds(50); + + base::DefaultClock clock; + base::DefaultTickClock tickClock; + GetApplicationContext()->GetNetworkTimeTracker()->UpdateNetworkTime( + clock.Now() - latency / 2, resolution, latency, tickClock.NowTicks()); +} + ++ (void)buildAndStoreUKMLog { + metrics::UkmEGTestHelper::BuildAndStoreUkmLog(); +} + ++ (BOOL)hasUnsentLogs { + return metrics::UkmEGTestHelper::HasUnsentLogs(); +} + ++ (BOOL)UKMReportHasBirthYear:(int)year gender:(int)gender { + std::unique_ptr<ukm::Report> report = + metrics::UkmEGTestHelper::GetUKMReport(); + + int birthYearOffset = + GetApplicationContext() + ->GetChromeBrowserStateManager() + ->GetLastUsedBrowserState() + ->GetPrefs() + ->GetInteger(syncer::prefs::kSyncDemographicsBirthYearOffset); + int noisedBirthYear = year + birthYearOffset; + + return report && gender == report->user_demographics().gender() && + noisedBirthYear == report->user_demographics().birth_year(); +} + ++ (BOOL)UKMReportHasUserDemographics { + std::unique_ptr<ukm::Report> report = + metrics::UkmEGTestHelper::GetUKMReport(); + return report && report->has_user_demographics(); } + (NSError*)setupHistogramTester {
diff --git a/ios/chrome/browser/metrics/tab_usage_recorder_browser_agent.mm b/ios/chrome/browser/metrics/tab_usage_recorder_browser_agent.mm index 7a7b45b9d..b2cac62 100644 --- a/ios/chrome/browser/metrics/tab_usage_recorder_browser_agent.mm +++ b/ios/chrome/browser/metrics/tab_usage_recorder_browser_agent.mm
@@ -15,6 +15,7 @@ #import "ios/chrome/browser/prerender/prerender_service_factory.h" #import "ios/chrome/browser/sessions/session_restoration_browser_agent.h" #import "ios/chrome/browser/web_state_list/web_state_list.h" +#include "ios/components/webui/web_ui_url_constants.h" #import "ios/web/public/navigation/navigation_context.h" #import "ios/web/public/navigation/navigation_item.h" #import "ios/web/public/navigation/navigation_manager.h"
diff --git a/ios/chrome/browser/metrics/ukm_egtest.mm b/ios/chrome/browser/metrics/ukm_egtest.mm index 96c2d6b..84e271f0 100644 --- a/ios/chrome/browser/metrics/ukm_egtest.mm +++ b/ios/chrome/browser/metrics/ukm_egtest.mm
@@ -2,8 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#import <XCTest/XCTest.h> - #include "base/ios/ios_util.h" #include "base/macros.h" #include "base/stl_util.h" @@ -12,6 +10,7 @@ #import "ios/chrome/browser/metrics/metrics_app_interface.h" #import "ios/chrome/browser/ui/authentication/signin_earl_grey_ui.h" #import "ios/chrome/browser/ui/authentication/signin_earlgrey_utils.h" +#import "ios/chrome/browser/ui/authentication/signin_earlgrey_utils_app_interface.h" #include "ios/chrome/grit/ios_strings.h" #import "ios/chrome/test/earl_grey/chrome_actions.h" #import "ios/chrome/test/earl_grey/chrome_earl_grey.h" @@ -41,9 +40,6 @@ namespace { -// Constant for timeout while waiting for asynchronous sync and UKM operations. -const NSTimeInterval kSyncUKMOperationsTimeout = 10.0; - void ClearBrowsingData() { [ChromeEarlGreyUI openSettingsMenu]; [ChromeEarlGreyUI tapSettingsMenuButton:SettingsMenuPrivacyButton()]; @@ -95,26 +91,6 @@ [ChromeEarlGrey waitForMainTabCount:(tab_count + 1)]; } -// Signs out of sync. -void SignOut() { - [ChromeEarlGreyUI openSettingsMenu]; - [ChromeEarlGreyUI tapSettingsMenuButton:SettingsAccountButton()]; - - // Remove |identity| from the device. - FakeChromeIdentity* identity = [SigninEarlGreyUtils fakeIdentity1]; - [[EarlGrey - selectElementWithMatcher:ButtonWithAccessibilityLabel(identity.userEmail)] - performAction:grey_tap()]; - [[EarlGrey - selectElementWithMatcher:ButtonWithAccessibilityLabel(@"Remove account")] - performAction:grey_tap()]; - - [[EarlGrey selectElementWithMatcher:SettingsDoneButton()] - performAction:grey_tap()]; - - [SigninEarlGreyUtils checkSignedOut]; -} - } // namespace // UKM tests. @@ -150,7 +126,7 @@ [super setUp]; [ChromeEarlGrey waitForSyncInitialized:NO - syncTimeout:kSyncUKMOperationsTimeout]; + syncTimeout:syncher::kSyncUKMOperationsTimeout]; GREYAssert([MetricsAppInterface checkUKMRecordingEnabled:NO], @"Failed to assert that UKM was not enabled."); // Sign in to Chrome and turn sync on. @@ -160,7 +136,7 @@ // flow that enables UKM. [SigninEarlGreyUI signinWithFakeIdentity:[SigninEarlGreyUtils fakeIdentity1]]; [ChromeEarlGrey waitForSyncInitialized:YES - syncTimeout:kSyncUKMOperationsTimeout]; + syncTimeout:syncher::kSyncUKMOperationsTimeout]; // Grant metrics consent and update MetricsServicesManager. [MetricsAppInterface overrideMetricsAndCrashReportingForTesting]; @@ -172,7 +148,7 @@ - (void)tearDown { [ChromeEarlGrey waitForSyncInitialized:YES - syncTimeout:kSyncUKMOperationsTimeout]; + syncTimeout:syncher::kSyncUKMOperationsTimeout]; GREYAssert([MetricsAppInterface checkUKMRecordingEnabled:YES], @"Failed to assert that UKM was enabled."); @@ -183,14 +159,17 @@ GREYAssert([MetricsAppInterface checkUKMRecordingEnabled:NO], @"Failed to assert that UKM was not enabled."); - // Sign out of Chrome and Turn sync off. + // Sign out of Chrome and Turn off sync. // // Note: URL-keyed anonymized data collection is turned off as part of the - // flow to Sign out of Chrome and Turn sync off. This matchers the main user + // flow to Sign out of Chrome and Turn sync off. This matches the main user // flow that disables UKM. - SignOut(); + if (![SigninEarlGreyUtilsAppInterface isSignedOut]) { + [SigninEarlGreyUtilsAppInterface signOut]; + } + [ChromeEarlGrey waitForSyncInitialized:NO - syncTimeout:kSyncUKMOperationsTimeout]; + syncTimeout:syncher::kSyncUKMOperationsTimeout]; [ChromeEarlGrey clearSyncServerData]; [super tearDown]; @@ -295,7 +274,7 @@ // Make sure that providing metrics consent doesn't enable UKM w/o sync. - (void)testConsentAddedButNoSync { - SignOut(); + [SigninEarlGreyUtilsAppInterface signOut]; [MetricsAppInterface setMetricsAndCrashReportingForTesting:NO]; GREYAssert([MetricsAppInterface checkUKMRecordingEnabled:NO], @"Failed to assert that UKM was not enabled."); @@ -364,7 +343,7 @@ #endif uint64_t originalClientID = [MetricsAppInterface UKMClientID]; - SignOut(); + [SigninEarlGreyUtilsAppInterface signOut]; GREYAssert([MetricsAppInterface checkUKMRecordingEnabled:NO], @"Failed to assert that UKM was not enabled.");
diff --git a/ios/chrome/browser/open_from_clipboard/BUILD.gn b/ios/chrome/browser/open_from_clipboard/BUILD.gn index 0c4d8dc..800fd30 100644 --- a/ios/chrome/browser/open_from_clipboard/BUILD.gn +++ b/ios/chrome/browser/open_from_clipboard/BUILD.gn
@@ -13,5 +13,6 @@ "//components/open_from_clipboard", "//ios/chrome/browser", "//ios/chrome/common/app_group", + "//ios/components/webui:url_constants", ] }
diff --git a/ios/chrome/browser/open_from_clipboard/create_clipboard_recent_content.mm b/ios/chrome/browser/open_from_clipboard/create_clipboard_recent_content.mm index 174dcdf..39f3284 100644 --- a/ios/chrome/browser/open_from_clipboard/create_clipboard_recent_content.mm +++ b/ios/chrome/browser/open_from_clipboard/create_clipboard_recent_content.mm
@@ -7,6 +7,7 @@ #import "components/open_from_clipboard/clipboard_recent_content_ios.h" #include "ios/chrome/browser/chrome_url_constants.h" #include "ios/chrome/common/app_group/app_group_constants.h" +#include "ios/components/webui/web_ui_url_constants.h" #if !defined(__has_feature) || !__has_feature(objc_arc) #error "This file requires ARC support."
diff --git a/ios/chrome/browser/reading_list/BUILD.gn b/ios/chrome/browser/reading_list/BUILD.gn index 45fbb6c8..899826a 100644 --- a/ios/chrome/browser/reading_list/BUILD.gn +++ b/ios/chrome/browser/reading_list/BUILD.gn
@@ -46,6 +46,7 @@ "//ios/chrome/browser/favicon", "//ios/chrome/browser/history", "//ios/chrome/common", + "//ios/components/webui:url_constants", "//ios/web/public", "//ios/web/public/deprecated", "//ios/web/public/security",
diff --git a/ios/chrome/browser/reading_list/offline_url_utils.cc b/ios/chrome/browser/reading_list/offline_url_utils.cc index d27b0f6..ec7d53b 100644 --- a/ios/chrome/browser/reading_list/offline_url_utils.cc +++ b/ios/chrome/browser/reading_list/offline_url_utils.cc
@@ -12,6 +12,7 @@ #include "components/reading_list/core/reading_list_entry.h" #include "components/reading_list/core/reading_list_model.h" #include "ios/chrome/browser/chrome_url_constants.h" +#include "ios/components/webui/web_ui_url_constants.h" #include "net/base/url_util.h" namespace {
diff --git a/ios/chrome/browser/send_tab_to_self/BUILD.gn b/ios/chrome/browser/send_tab_to_self/BUILD.gn index bdd33048..f62657a 100644 --- a/ios/chrome/browser/send_tab_to_self/BUILD.gn +++ b/ios/chrome/browser/send_tab_to_self/BUILD.gn
@@ -34,6 +34,7 @@ "//ios/chrome/browser/ui/infobars:infobars_ui", "//ios/chrome/browser/ui/util", "//ios/chrome/browser/web_state_list", + "//ios/components/webui:url_constants", "//ios/web", "//ui/base", "//ui/gfx",
diff --git a/ios/chrome/browser/send_tab_to_self/send_tab_to_self_util.mm b/ios/chrome/browser/send_tab_to_self/send_tab_to_self_util.mm index 867dd54..33448bc 100644 --- a/ios/chrome/browser/send_tab_to_self/send_tab_to_self_util.mm +++ b/ios/chrome/browser/send_tab_to_self/send_tab_to_self_util.mm
@@ -23,6 +23,7 @@ #import "ios/chrome/browser/tabs/tab_model.h" #import "ios/chrome/browser/tabs/tab_model_list.h" #import "ios/chrome/browser/web_state_list/web_state_list.h" +#include "ios/components/webui/web_ui_url_constants.h" #import "ios/web/public/navigation/navigation_item.h" #import "ios/web/public/navigation/navigation_manager.h" #import "ios/web/public/web_state.h"
diff --git a/ios/chrome/browser/sync/BUILD.gn b/ios/chrome/browser/sync/BUILD.gn index 8339783..1472f03b 100644 --- a/ios/chrome/browser/sync/BUILD.gn +++ b/ios/chrome/browser/sync/BUILD.gn
@@ -81,6 +81,7 @@ "//ios/chrome/browser/undo", "//ios/chrome/browser/webdata_services", "//ios/chrome/common", + "//ios/components/webui:url_constants", "//ios/web", "//ios/web/public/session", "//net",
diff --git a/ios/chrome/browser/sync/session_sync_service_factory.mm b/ios/chrome/browser/sync/session_sync_service_factory.mm index b1d30c1..b9787071 100644 --- a/ios/chrome/browser/sync/session_sync_service_factory.mm +++ b/ios/chrome/browser/sync/session_sync_service_factory.mm
@@ -27,6 +27,7 @@ #import "ios/chrome/browser/sync/sessions/ios_chrome_local_session_event_router.h" #include "ios/chrome/browser/tabs/ios_synced_window_delegate_getter.h" #include "ios/chrome/common/channel_info.h" +#include "ios/components/webui/web_ui_url_constants.h" #include "ios/web/public/thread/web_thread.h" #include "url/gurl.h"
diff --git a/ios/chrome/browser/translate/BUILD.gn b/ios/chrome/browser/translate/BUILD.gn index e05a416c..1f8b4d3 100644 --- a/ios/chrome/browser/translate/BUILD.gn +++ b/ios/chrome/browser/translate/BUILD.gn
@@ -67,6 +67,7 @@ "//ios/chrome/browser/ui/infobars/coordinators:translate", "//ios/chrome/browser/ui/translate:translate_ui", "//ios/chrome/browser/ui/util", + "//ios/components/webui:url_constants", "//ios/web/public/deprecated", "//third_party/metrics_proto", "//ui/base", @@ -132,6 +133,7 @@ "//ios/chrome/test/app:test_support", "//ios/chrome/test/earl_grey:test_support", "//ios/chrome/test/fakes", + "//ios/components/webui:url_constants", "//ios/testing/earl_grey:earl_grey_support", "//ios/third_party/earl_grey:earl_grey+link", "//ios/web:earl_grey_test_support", @@ -163,6 +165,7 @@ "//ios/chrome/browser/ui/translate:legacy_translate_constants", "//ios/chrome/browser/ui/translate:translate_ui_constants", "//ios/chrome/test/earl_grey:eg_test_support+eg2", + "//ios/components/webui:url_constants", "//ios/testing/earl_grey:eg_test_support+eg2", "//ios/third_party/earl_grey2:test_lib", "//ios/web/public:public",
diff --git a/ios/chrome/browser/translate/translate_egtest.mm b/ios/chrome/browser/translate/translate_egtest.mm index aef25e93..bc081db0 100644 --- a/ios/chrome/browser/translate/translate_egtest.mm +++ b/ios/chrome/browser/translate/translate_egtest.mm
@@ -25,6 +25,7 @@ #import "ios/chrome/test/earl_grey/chrome_earl_grey_ui.h" #import "ios/chrome/test/earl_grey/chrome_matchers.h" #import "ios/chrome/test/earl_grey/chrome_test_case.h" +#include "ios/components/webui/web_ui_url_constants.h" #import "ios/testing/earl_grey/earl_grey_test.h" #include "ios/web/public/test/http_server/data_response_provider.h" #import "ios/web/public/test/http_server/http_server.h"
diff --git a/ios/chrome/browser/translate/translate_service_ios.mm b/ios/chrome/browser/translate/translate_service_ios.mm index 7faef36..8c45341 100644 --- a/ios/chrome/browser/translate/translate_service_ios.mm +++ b/ios/chrome/browser/translate/translate_service_ios.mm
@@ -13,6 +13,7 @@ #include "ios/chrome/browser/application_context.h" #include "ios/chrome/browser/chrome_url_constants.h" #include "ios/chrome/browser/translate/chrome_ios_translate_client.h" +#include "ios/components/webui/web_ui_url_constants.h" #include "url/gurl.h" #if !defined(__has_feature) || !__has_feature(objc_arc)
diff --git a/ios/chrome/browser/ui/browser_view/BUILD.gn b/ios/chrome/browser/ui/browser_view/BUILD.gn index 1b810aa..3ac4343 100644 --- a/ios/chrome/browser/ui/browser_view/BUILD.gn +++ b/ios/chrome/browser/ui/browser_view/BUILD.gn
@@ -172,6 +172,7 @@ "//ios/chrome/common", "//ios/chrome/common/ui/colors", "//ios/chrome/common/ui/util", + "//ios/components/webui:url_constants", "//ios/public/provider/chrome/browser", "//ios/public/provider/chrome/browser/ui", "//ios/public/provider/chrome/browser/voice",
diff --git a/ios/chrome/browser/ui/browser_view/browser_view_controller.h b/ios/chrome/browser/ui/browser_view/browser_view_controller.h index c3be42a..c34e06d 100644 --- a/ios/chrome/browser/ui/browser_view/browser_view_controller.h +++ b/ios/chrome/browser/ui/browser_view/browser_view_controller.h
@@ -23,7 +23,6 @@ @class BrowserContainerViewController; @class BrowserViewControllerDependencyFactory; @protocol FindInPageCommands; -@protocol OmniboxFocuser; @protocol PasswordBreachCommands; @protocol PopupMenuCommands; @protocol FakeboxFocuser; @@ -62,7 +61,6 @@ BrowserCommands, BrowsingDataCommands, FindInPageCommands, - OmniboxFocuser, PasswordBreachCommands, PopupMenuCommands, FakeboxFocuser,
diff --git a/ios/chrome/browser/ui/browser_view/browser_view_controller.mm b/ios/chrome/browser/ui/browser_view/browser_view_controller.mm index 6bf41ca8..6d8b603 100644 --- a/ios/chrome/browser/ui/browser_view/browser_view_controller.mm +++ b/ios/chrome/browser/ui/browser_view/browser_view_controller.mm
@@ -548,6 +548,9 @@ // Command handler for help commands @property(nonatomic, weak) id<HelpCommands> helpHandler; +// Command handler for omnibox commands +@property(nonatomic, weak) id<OmniboxCommands> omniboxHandler; + // Primary toolbar. @property(nonatomic, strong) PrimaryToolbarCoordinator* primaryToolbarCoordinator; @@ -788,7 +791,6 @@ BrowserCommands, BrowsingDataCommands, FindInPageCommands, - OmniboxFocuser, PasswordBreachCommands, PopupMenuCommands, FakeboxFocuser, @@ -796,8 +798,8 @@ ToolbarCommands>)dispatcher { return static_cast< id<ApplicationCommands, BrowserCommands, BrowsingDataCommands, - FindInPageCommands, OmniboxFocuser, PasswordBreachCommands, - PopupMenuCommands, FakeboxFocuser, SnackbarCommands, ToolbarCommands>>( + FindInPageCommands, PasswordBreachCommands, PopupMenuCommands, + FakeboxFocuser, SnackbarCommands, ToolbarCommands>>( self.commandDispatcher); } @@ -1074,7 +1076,7 @@ } - (void)shieldWasTapped:(id)sender { - [self.dispatcher cancelOmniboxEdit]; + [self.omniboxHandler cancelOmniboxEdit]; } - (void)userEnteredTabSwitcher { @@ -1095,7 +1097,7 @@ BOOL offTheRecord = self.isOffTheRecord; ProceduralBlock oldForegroundTabWasAddedCompletionBlock = self.foregroundTabWasAddedCompletionBlock; - __weak BrowserViewController* weakSelf = self; + id<OmniboxCommands> omniboxCommandHandler = self.omniboxHandler; self.foregroundTabWasAddedCompletionBlock = ^{ if (oldForegroundTabWasAddedCompletionBlock) { oldForegroundTabWasAddedCompletionBlock(); @@ -1109,7 +1111,7 @@ UMA_HISTOGRAM_TIMES("Toolbar.Menu.NewTabPresentationDuration", timeDelta); } if (focusOmnibox) { - [weakSelf.dispatcher focusOmnibox]; + [omniboxCommandHandler focusOmnibox]; } }; @@ -1174,7 +1176,7 @@ // Present voice search. _voiceSearchController->StartRecognition(self, self.currentWebState); - [self.dispatcher cancelOmniboxEdit]; + [self.omniboxHandler cancelOmniboxEdit]; } #pragma mark - browser_view_controller+private.h @@ -1238,7 +1240,7 @@ [_bookmarkInteractionController dismissBookmarkModalControllerAnimated:NO]; [_bookmarkInteractionController dismissSnackbar]; if (dismissOmnibox) { - [self.dispatcher cancelOmniboxEdit]; + [self.omniboxHandler cancelOmniboxEdit]; } [_dialogPresenter cancelAllDialogs]; [self.helpHandler hideAllHelpBubbles]; @@ -1394,6 +1396,7 @@ keyCommandsForConsumer:self baseViewController:self dispatcher:self.dispatcher + omniboxHandler:self.omniboxHandler editingText:[firstResponder isKindOfClass:[UITextField class]] || [firstResponder @@ -2169,6 +2172,9 @@ self.popupMenuCoordinator; self.tabStripCoordinator.longPressDelegate = self.popupMenuCoordinator; + self.omniboxHandler = + HandlerForProtocol(self.browser->GetCommandDispatcher(), OmniboxCommands); + _sadTabCoordinator = [[SadTabCoordinator alloc] initWithBaseViewController:self.browserContainerViewController browser:self.browser]; @@ -4107,7 +4113,7 @@ DCHECK(self.visible || self.dismissingModal); // Dismiss the omnibox (if open). - [self.dispatcher cancelOmniboxEdit]; + [self.omniboxHandler cancelOmniboxEdit]; // Dismiss the soft keyboard (if open). [[self viewForWebState:self.currentWebState] endEditing:NO]; // Dismiss Find in Page focus. @@ -4615,7 +4621,7 @@ - (void)prepareForPageInfoPresentation { // Dismiss the omnibox (if open). - [self.dispatcher cancelOmniboxEdit]; + [self.omniboxHandler cancelOmniboxEdit]; } - (CGPoint)convertToPresentationCoordinatesForOrigin:(CGPoint)origin {
diff --git a/ios/chrome/browser/ui/browser_view/browser_view_controller_helper.mm b/ios/chrome/browser/ui/browser_view/browser_view_controller_helper.mm index 16a8aaa..ec8e2923 100644 --- a/ios/chrome/browser/ui/browser_view/browser_view_controller_helper.mm +++ b/ios/chrome/browser/ui/browser_view/browser_view_controller_helper.mm
@@ -12,6 +12,7 @@ #include "ios/chrome/browser/bookmarks/bookmark_model_factory.h" #include "ios/chrome/browser/browser_state/chrome_browser_state.h" #include "ios/chrome/browser/chrome_url_constants.h" +#include "ios/components/webui/web_ui_url_constants.h" #import "ios/web/public/web_state.h" namespace {
diff --git a/ios/chrome/browser/ui/browser_view/browser_view_controller_unittest.mm b/ios/chrome/browser/ui/browser_view/browser_view_controller_unittest.mm index 775754b..7092b60ee 100644 --- a/ios/chrome/browser/ui/browser_view/browser_view_controller_unittest.mm +++ b/ios/chrome/browser/ui/browser_view/browser_view_controller_unittest.mm
@@ -214,7 +214,8 @@ // TODO(altse): Needs a testing |Profile| that implements AutocompleteClassifier // before enabling again. TEST_F(BrowserViewControllerTest, DISABLED_TestShieldWasTapped) { - [bvc_.dispatcher focusOmnibox]; + [HandlerForProtocol(browser_->GetCommandDispatcher(), OmniboxCommands) + focusOmnibox]; EXPECT_TRUE([[bvc_ typingShield] superview] != nil); EXPECT_FALSE([[bvc_ typingShield] isHidden]); [bvc_ shieldWasTapped:nil];
diff --git a/ios/chrome/browser/ui/browser_view/key_commands_provider.h b/ios/chrome/browser/ui/browser_view/key_commands_provider.h index cb46a02..f095cefa 100644 --- a/ios/chrome/browser/ui/browser_view/key_commands_provider.h +++ b/ios/chrome/browser/ui/browser_view/key_commands_provider.h
@@ -10,7 +10,7 @@ #import "ios/chrome/browser/ui/commands/application_commands.h" #import "ios/chrome/browser/ui/commands/browser_commands.h" #import "ios/chrome/browser/ui/commands/find_in_page_commands.h" -#import "ios/chrome/browser/ui/toolbar/public/omnibox_focuser.h" +#import "ios/chrome/browser/ui/commands/omnibox_commands.h" @protocol KeyCommandsPlumbing <NSObject> @@ -56,8 +56,8 @@ baseViewController:(UIViewController*)baseViewController dispatcher:(id<ApplicationCommands, BrowserCommands, - FindInPageCommands, - OmniboxFocuser>)dispatcher + FindInPageCommands>)dispatcher + omniboxHandler:(id<OmniboxCommands>)omniboxHandler editingText:(BOOL)editingText; @end
diff --git a/ios/chrome/browser/ui/browser_view/key_commands_provider.mm b/ios/chrome/browser/ui/browser_view/key_commands_provider.mm index 5375b447..33a5ab7 100644 --- a/ios/chrome/browser/ui/browser_view/key_commands_provider.mm +++ b/ios/chrome/browser/ui/browser_view/key_commands_provider.mm
@@ -26,13 +26,14 @@ dispatcher:(id<ApplicationCommands, BrowserCommands, FindInPageCommands, - OmniboxFocuser>)dispatcher + OmniboxCommands>)dispatcher + omniboxHandler:(id<OmniboxCommands>)omniboxHandler editingText:(BOOL)editingText { __weak id<KeyCommandsPlumbing> weakConsumer = consumer; __weak UIViewController* weakBaseViewController = baseViewController; - __weak id<ApplicationCommands, BrowserCommands, FindInPageCommands, - OmniboxFocuser> + __weak id<ApplicationCommands, BrowserCommands, FindInPageCommands> weakDispatcher = dispatcher; + __weak id<OmniboxCommands> weakOmniboxHandler = omniboxHandler; // Block to have the tab model open the tab at |index|, if there is one. void (^focusTab)(NSUInteger) = ^(NSUInteger index) { @@ -150,7 +151,7 @@ title:l10n_util::GetNSStringWithFixup( IDS_IOS_KEYBOARD_OPEN_LOCATION) action:^{ - [weakDispatcher focusOmnibox]; + [weakOmniboxHandler focusOmnibox]; }], [UIKeyCommand cr_keyCommandWithInput:@"w" modifierFlags:UIKeyModifierCommand
diff --git a/ios/chrome/browser/ui/browser_view/key_commands_provider_unittest.mm b/ios/chrome/browser/ui/browser_view/key_commands_provider_unittest.mm index 18afa77..46078fe 100644 --- a/ios/chrome/browser/ui/browser_view/key_commands_provider_unittest.mm +++ b/ios/chrome/browser/ui/browser_view/key_commands_provider_unittest.mm
@@ -24,13 +24,13 @@ KeyCommandsProvider* provider = [[KeyCommandsProvider alloc] init]; id mockConsumer = [OCMockObject mockForProtocol:@protocol(KeyCommandsPlumbing)]; - id<ApplicationCommands, BrowserCommands, FindInPageCommands, OmniboxFocuser> - dispatcher = nil; + id<ApplicationCommands, BrowserCommands, FindInPageCommands> dispatcher = nil; [[[mockConsumer expect] andReturnUnsignedInteger:0] tabsCount]; EXPECT_NE(nil, [provider keyCommandsForConsumer:mockConsumer baseViewController:nil dispatcher:dispatcher + omniboxHandler:nil editingText:YES]); } @@ -38,14 +38,15 @@ KeyCommandsProvider* provider = [[KeyCommandsProvider alloc] init]; id mockConsumer = [OCMockObject mockForProtocol:@protocol(KeyCommandsPlumbing)]; - id<ApplicationCommands, BrowserCommands, FindInPageCommands, OmniboxFocuser> - dispatcher = nil; + id<ApplicationCommands, BrowserCommands, FindInPageCommands> dispatcher = nil; [[[mockConsumer expect] andReturnUnsignedInteger:0] tabsCount]; for (id element in [provider keyCommandsForConsumer:mockConsumer baseViewController:nil dispatcher:dispatcher + omniboxHandler:nil + editingText:YES]) { EXPECT_TRUE([element isKindOfClass:[UIKeyCommand class]]); } @@ -55,8 +56,7 @@ KeyCommandsProvider* provider = [[KeyCommandsProvider alloc] init]; id mockConsumer = [OCMockObject mockForProtocol:@protocol(KeyCommandsPlumbing)]; - id<ApplicationCommands, BrowserCommands, FindInPageCommands, OmniboxFocuser> - dispatcher = nil; + id<ApplicationCommands, BrowserCommands, FindInPageCommands> dispatcher = nil; // No tabs. [[[mockConsumer expect] andReturnUnsignedInteger:0] tabsCount]; @@ -64,6 +64,8 @@ [[provider keyCommandsForConsumer:mockConsumer baseViewController:nil dispatcher:dispatcher + omniboxHandler:nil + editingText:NO] count]; // Tabs. @@ -73,6 +75,8 @@ [[provider keyCommandsForConsumer:mockConsumer baseViewController:nil dispatcher:dispatcher + omniboxHandler:nil + editingText:NO] count]; EXPECT_GT(numberOfKeyCommandsWithTabs, numberOfKeyCommandsWithoutTabs); @@ -82,8 +86,7 @@ KeyCommandsProvider* provider = [[KeyCommandsProvider alloc] init]; id mockConsumer = [OCMockObject mockForProtocol:@protocol(KeyCommandsPlumbing)]; - id<ApplicationCommands, BrowserCommands, FindInPageCommands, OmniboxFocuser> - dispatcher = nil; + id<ApplicationCommands, BrowserCommands, FindInPageCommands> dispatcher = nil; // Not editing text. [[[mockConsumer expect] andReturnUnsignedInteger:1] tabsCount]; @@ -92,6 +95,8 @@ [[provider keyCommandsForConsumer:mockConsumer baseViewController:nil dispatcher:dispatcher + omniboxHandler:nil + editingText:NO] count]; // Editing text. @@ -101,6 +106,8 @@ [[provider keyCommandsForConsumer:mockConsumer baseViewController:nil dispatcher:dispatcher + omniboxHandler:nil + editingText:YES] count]; EXPECT_LT(numberOfKeyCommandsWhenEditingText, @@ -111,8 +118,7 @@ KeyCommandsProvider* provider = [[KeyCommandsProvider alloc] init]; id mockConsumer = [OCMockObject mockForProtocol:@protocol(KeyCommandsPlumbing)]; - id<ApplicationCommands, BrowserCommands, FindInPageCommands, OmniboxFocuser> - dispatcher = nil; + id<ApplicationCommands, BrowserCommands, FindInPageCommands> dispatcher = nil; // No Find in Page. [[[mockConsumer expect] andReturnUnsignedInteger:1] tabsCount]; @@ -121,6 +127,8 @@ [[provider keyCommandsForConsumer:mockConsumer baseViewController:nil dispatcher:dispatcher + omniboxHandler:nil + editingText:NO] count]; // Tabs. @@ -130,6 +138,8 @@ [[provider keyCommandsForConsumer:mockConsumer baseViewController:nil dispatcher:dispatcher + omniboxHandler:nil + editingText:NO] count]; EXPECT_GT(numberOfKeyCommandsWithFIP, numberOfKeyCommandsWithoutFIP);
diff --git a/ios/chrome/browser/ui/commands/BUILD.gn b/ios/chrome/browser/ui/commands/BUILD.gn index 662de24..ffc9a21 100644 --- a/ios/chrome/browser/ui/commands/BUILD.gn +++ b/ios/chrome/browser/ui/commands/BUILD.gn
@@ -19,6 +19,7 @@ "help_commands.h", "infobar_commands.h", "load_query_commands.h", + "omnibox_commands.h", "omnibox_suggestion_commands.h", "open_new_tab_command.h", "open_new_tab_command.mm",
diff --git a/ios/chrome/browser/ui/toolbar/public/omnibox_focuser.h b/ios/chrome/browser/ui/commands/omnibox_commands.h similarity index 64% rename from ios/chrome/browser/ui/toolbar/public/omnibox_focuser.h rename to ios/chrome/browser/ui/commands/omnibox_commands.h index de4f4826..46c057cd 100644 --- a/ios/chrome/browser/ui/toolbar/public/omnibox_focuser.h +++ b/ios/chrome/browser/ui/commands/omnibox_commands.h
@@ -2,13 +2,13 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef IOS_CHROME_BROWSER_UI_TOOLBAR_PUBLIC_OMNIBOX_FOCUSER_H_ -#define IOS_CHROME_BROWSER_UI_TOOLBAR_PUBLIC_OMNIBOX_FOCUSER_H_ +#ifndef IOS_CHROME_BROWSER_UI_COMMANDS_OMNIBOX_COMMANDS_H_ +#define IOS_CHROME_BROWSER_UI_COMMANDS_OMNIBOX_COMMANDS_H_ #import <Foundation/Foundation.h> -// This protocol provides callbacks for focusing the omnibox. -@protocol OmniboxFocuser +// Commands for focusing the omnibox in varous ways +@protocol OmniboxCommands // Give focus to the omnibox, if it is visible. No-op if it is not visible. If // current page is an NTP, first focus the NTP fakebox. - (void)focusOmnibox; @@ -18,4 +18,4 @@ - (void)cancelOmniboxEdit; @end -#endif // IOS_CHROME_BROWSER_UI_TOOLBAR_PUBLIC_OMNIBOX_FOCUSER_H_ +#endif // IOS_CHROME_BROWSER_UI_COMMANDS_OMNIBOX_COMMANDS_H_
diff --git a/ios/chrome/browser/ui/content_suggestions/BUILD.gn b/ios/chrome/browser/ui/content_suggestions/BUILD.gn index 0ad695c..af9ea01 100644 --- a/ios/chrome/browser/ui/content_suggestions/BUILD.gn +++ b/ios/chrome/browser/ui/content_suggestions/BUILD.gn
@@ -183,6 +183,7 @@ "//ios/chrome/browser/ui/toolbar/public", "//ios/chrome/browser/ui/util", "//ios/chrome/common/ui/colors", + "//ios/components/ui_util", "//ios/third_party/material_components_ios", "//ios/web/common", "//ui/base",
diff --git a/ios/chrome/browser/ui/content_suggestions/content_suggestions_collection_utils.mm b/ios/chrome/browser/ui/content_suggestions/content_suggestions_collection_utils.mm index e552df2b..6c5e5ec9 100644 --- a/ios/chrome/browser/ui/content_suggestions/content_suggestions_collection_utils.mm +++ b/ios/chrome/browser/ui/content_suggestions/content_suggestions_collection_utils.mm
@@ -12,11 +12,11 @@ #import "ios/chrome/browser/ui/location_bar/location_bar_constants.h" #import "ios/chrome/browser/ui/ntp/new_tab_page_header_constants.h" #import "ios/chrome/browser/ui/toolbar/public/toolbar_utils.h" -#include "ios/chrome/browser/ui/util/dynamic_type_util.h" #include "ios/chrome/browser/ui/util/ui_util.h" #import "ios/chrome/browser/ui/util/uikit_ui_util.h" #import "ios/chrome/common/ui/colors/semantic_color_names.h" #include "ios/chrome/grit/ios_strings.h" +#include "ios/components/ui_util/dynamic_type_util.h" #include "ui/base/l10n/l10n_util.h" #if !defined(__has_feature) || !__has_feature(objc_arc) @@ -71,7 +71,7 @@ return topInset; return topInset + kDoodleTopMarginOther + AlignValueToPixel(kDoodleScaledTopMarginOther * - SystemSuggestedFontSizeMultiplier()); + ui_util::SystemSuggestedFontSizeMultiplier()); } CGFloat searchFieldTopMargin() {
diff --git a/ios/chrome/browser/ui/content_suggestions/content_suggestions_coordinator.mm b/ios/chrome/browser/ui/content_suggestions/content_suggestions_coordinator.mm index 9a6dd26..8c199a7 100644 --- a/ios/chrome/browser/ui/content_suggestions/content_suggestions_coordinator.mm +++ b/ios/chrome/browser/ui/content_suggestions/content_suggestions_coordinator.mm
@@ -131,9 +131,9 @@ self.headerController = [[ContentSuggestionsHeaderViewController alloc] init]; // TODO(crbug.com/1045047): Use HandlerForProtocol after commands protocol // clean up. - self.headerController.dispatcher = static_cast< - id<ApplicationCommands, BrowserCommands, OmniboxFocuser, FakeboxFocuser>>( - self.browser->GetCommandDispatcher()); + self.headerController.dispatcher = + static_cast<id<ApplicationCommands, BrowserCommands, OmniboxCommands, + FakeboxFocuser>>(self.browser->GetCommandDispatcher()); self.headerController.commandHandler = self.NTPMediator; self.headerController.delegate = self.NTPMediator; self.headerController.readingListModel = @@ -188,7 +188,7 @@ // TODO(crbug.com/1045047): Use HandlerForProtocol after commands protocol // clean up. self.NTPMediator.dispatcher = - static_cast<id<ApplicationCommands, BrowserCommands, OmniboxFocuser, + static_cast<id<ApplicationCommands, BrowserCommands, OmniboxCommands, SnackbarCommands>>(self.browser->GetCommandDispatcher()); self.NTPMediator.NTPMetrics = [[NTPHomeMetrics alloc] initWithBrowserState:self.browser->GetBrowserState() @@ -238,9 +238,9 @@ didTriggerAction:(OverscrollAction)action { // TODO(crbug.com/1045047): Use HandlerForProtocol after commands protocol // clean up. - id<ApplicationCommands, BrowserCommands, OmniboxFocuser, SnackbarCommands> + id<ApplicationCommands, BrowserCommands, OmniboxCommands, SnackbarCommands> handler = static_cast<id<ApplicationCommands, BrowserCommands, - OmniboxFocuser, SnackbarCommands>>( + OmniboxCommands, SnackbarCommands>>( self.browser->GetCommandDispatcher()); switch (action) { case OverscrollAction::NEW_TAB: {
diff --git a/ios/chrome/browser/ui/content_suggestions/content_suggestions_header_view_controller.h b/ios/chrome/browser/ui/content_suggestions/content_suggestions_header_view_controller.h index 99df0984..424e382 100644 --- a/ios/chrome/browser/ui/content_suggestions/content_suggestions_header_view_controller.h +++ b/ios/chrome/browser/ui/content_suggestions/content_suggestions_header_view_controller.h
@@ -19,7 +19,7 @@ @protocol ContentSuggestionsHeaderViewControllerDelegate; @protocol FakeboxFocuser; @protocol NewTabPageControllerDelegate; -@protocol OmniboxFocuser; +@protocol OmniboxCommands; @class PrimaryToolbarViewController; class ReadingListModel; @@ -38,7 +38,7 @@ - (instancetype)initWithCoder:(NSCoder*)aDecoder NS_UNAVAILABLE; @property(nonatomic, weak) - id<ApplicationCommands, BrowserCommands, OmniboxFocuser, FakeboxFocuser> + id<ApplicationCommands, BrowserCommands, OmniboxCommands, FakeboxFocuser> dispatcher; @property(nonatomic, weak) id<ContentSuggestionsHeaderViewControllerDelegate> delegate;
diff --git a/ios/chrome/browser/ui/content_suggestions/content_suggestions_header_view_controller.mm b/ios/chrome/browser/ui/content_suggestions/content_suggestions_header_view_controller.mm index 539c8d4..5071fef3 100644 --- a/ios/chrome/browser/ui/content_suggestions/content_suggestions_header_view_controller.mm +++ b/ios/chrome/browser/ui/content_suggestions/content_suggestions_header_view_controller.mm
@@ -13,6 +13,7 @@ #import "ios/chrome/browser/ntp/new_tab_page_tab_helper.h" #import "ios/chrome/browser/ui/commands/application_commands.h" #import "ios/chrome/browser/ui/commands/browser_commands.h" +#import "ios/chrome/browser/ui/commands/omnibox_commands.h" #import "ios/chrome/browser/ui/content_suggestions/content_suggestions_collection_synchronizing.h" #import "ios/chrome/browser/ui/content_suggestions/content_suggestions_collection_utils.h" #import "ios/chrome/browser/ui/content_suggestions/content_suggestions_commands.h" @@ -23,7 +24,6 @@ #import "ios/chrome/browser/ui/ntp/new_tab_page_controller_delegate.h" #import "ios/chrome/browser/ui/ntp/new_tab_page_header_constants.h" #import "ios/chrome/browser/ui/toolbar/public/fakebox_focuser.h" -#import "ios/chrome/browser/ui/toolbar/public/omnibox_focuser.h" #import "ios/chrome/browser/ui/toolbar/public/toolbar_utils.h" #import "ios/chrome/browser/ui/util/named_guide.h" #include "ios/chrome/browser/ui/util/ui_util.h"
diff --git a/ios/chrome/browser/ui/content_suggestions/ntp_home_mediator.h b/ios/chrome/browser/ui/content_suggestions/ntp_home_mediator.h index 5e8c112..cfe733e 100644 --- a/ios/chrome/browser/ui/content_suggestions/ntp_home_mediator.h +++ b/ios/chrome/browser/ui/content_suggestions/ntp_home_mediator.h
@@ -33,7 +33,7 @@ @protocol LogoVendor; @protocol NTPHomeConsumer; @class NTPHomeMetrics; -@protocol OmniboxFocuser; +@protocol OmniboxCommands; class TemplateURLService; @protocol SnackbarCommands; class UrlLoadingBrowserAgent; @@ -61,7 +61,7 @@ // Dispatcher. @property(nonatomic, weak, nullable) - id<ApplicationCommands, BrowserCommands, OmniboxFocuser, SnackbarCommands> + id<ApplicationCommands, BrowserCommands, OmniboxCommands, SnackbarCommands> dispatcher; // Suggestions service used to get the suggestions. @property(nonatomic, assign, nonnull)
diff --git a/ios/chrome/browser/ui/content_suggestions/ntp_home_mediator.mm b/ios/chrome/browser/ui/content_suggestions/ntp_home_mediator.mm index 4c40f01..ae25248a 100644 --- a/ios/chrome/browser/ui/content_suggestions/ntp_home_mediator.mm +++ b/ios/chrome/browser/ui/content_suggestions/ntp_home_mediator.mm
@@ -22,6 +22,7 @@ #import "ios/chrome/browser/ui/alert_coordinator/alert_coordinator.h" #import "ios/chrome/browser/ui/commands/application_commands.h" #import "ios/chrome/browser/ui/commands/browser_commands.h" +#import "ios/chrome/browser/ui/commands/omnibox_commands.h" #import "ios/chrome/browser/ui/commands/open_new_tab_command.h" #import "ios/chrome/browser/ui/commands/reading_list_add_command.h" #import "ios/chrome/browser/ui/commands/snackbar_commands.h" @@ -41,7 +42,6 @@ #include "ios/chrome/browser/ui/ntp/metrics.h" #import "ios/chrome/browser/ui/ntp/new_tab_page_header_constants.h" #import "ios/chrome/browser/ui/ntp/notification_promo_whats_new.h" -#import "ios/chrome/browser/ui/toolbar/public/omnibox_focuser.h" #import "ios/chrome/browser/ui/util/uikit_ui_util.h" #import "ios/chrome/browser/url_loading/url_loading_browser_agent.h" #import "ios/chrome/browser/url_loading/url_loading_params.h"
diff --git a/ios/chrome/browser/ui/first_run/BUILD.gn b/ios/chrome/browser/ui/first_run/BUILD.gn index f250a32b..e1adf9b 100644 --- a/ios/chrome/browser/ui/first_run/BUILD.gn +++ b/ios/chrome/browser/ui/first_run/BUILD.gn
@@ -7,7 +7,6 @@ sources = [ "first_run_chrome_signin_view_controller.h", "first_run_chrome_signin_view_controller.mm", - "first_run_histograms.h", "first_run_util.h", "first_run_util.mm", "orientation_limiting_navigation_controller.h",
diff --git a/ios/chrome/browser/ui/first_run/first_run_histograms.h b/ios/chrome/browser/ui/first_run/first_run_histograms.h deleted file mode 100644 index 2c26fde..0000000 --- a/ios/chrome/browser/ui/first_run/first_run_histograms.h +++ /dev/null
@@ -1,34 +0,0 @@ -// Copyright 2016 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef IOS_CHROME_BROWSER_UI_FIRST_RUN_FIRST_RUN_HISTOGRAMS_H_ -#define IOS_CHROME_BROWSER_UI_FIRST_RUN_FIRST_RUN_HISTOGRAMS_H_ - -#include "base/metrics/histogram.h" - -// HISTOGRAM_POINTER_BLOCK differ from STATIC_HISTOGRAM_POINTER_BLOCK -// on using static histogram pointer, in this one we create a new histogram -// from the histogram_factory_get_invocation each time this is called. -// This is needed on the first run because the same funciton try to log -// different histogram names, also we don't need static histogram as first run -// logging only happens once (may be little more in some cases). -#define HISTOGRAM_POINTER_BLOCK(constant_histogram_name, \ - histogram_add_method_invocation, \ - histogram_factory_get_invocation) \ - do { \ - base::HistogramBase* histogram_pointer = histogram_factory_get_invocation; \ - histogram_pointer->histogram_add_method_invocation; \ - } while (0) - -// This UMA_HISTOGRAM_CUSTOM_TIMES_FIRST_RUN uses the HISTOGRAM_POINTER_BLOCK -// instead of STATIC_HISTOGRAM_POINTER_BLOCK which handles being called with -// different names from same function. -#define UMA_HISTOGRAM_CUSTOM_TIMES_FIRST_RUN(name, sample, min, max, \ - bucket_count) \ - HISTOGRAM_POINTER_BLOCK(name, AddTime(sample), \ - base::Histogram::FactoryTimeGet( \ - name, min, max, bucket_count, \ - base::HistogramBase::kUmaTargetedHistogramFlag)) - -#endif // IOS_CHROME_BROWSER_UI_FIRST_RUN_FIRST_RUN_HISTOGRAMS_H_
diff --git a/ios/chrome/browser/ui/first_run/first_run_util.h b/ios/chrome/browser/ui/first_run/first_run_util.h index 1302b40..f6c8e4f4 100644 --- a/ios/chrome/browser/ui/first_run/first_run_util.h +++ b/ios/chrome/browser/ui/first_run/first_run_util.h
@@ -11,10 +11,6 @@ @class FirstRunConfiguration; @protocol SyncPresenter; -namespace base { -class TimeTicks; -} - namespace web { class WebState; } @@ -42,17 +38,7 @@ FirstRunConfiguration* config, id<SyncPresenter> presenter); -// Records Product tour timing metrics using histogram. -void RecordProductTourTimingMetrics(NSString* timer_name, - base::TimeTicks start_time); - // Posts a notification that First Run did finish. void FirstRunDismissed(); -// Enables or disables the data reduction proxy and also sets a key indicating -// application is using Data Reduction Proxy. -void SetDataReductionProxyEnabled(ChromeBrowserState* browserState, - BOOL enabled, - BOOL toggled_switch); - #endif // IOS_CHROME_BROWSER_UI_FIRST_RUN_FIRST_RUN_UTIL_H_
diff --git a/ios/chrome/browser/ui/first_run/first_run_util.mm b/ios/chrome/browser/ui/first_run/first_run_util.mm index 7a29ad1..126c5bc 100644 --- a/ios/chrome/browser/ui/first_run/first_run_util.mm +++ b/ios/chrome/browser/ui/first_run/first_run_util.mm
@@ -19,7 +19,6 @@ #import "ios/chrome/browser/first_run/first_run_configuration.h" #include "ios/chrome/browser/first_run/first_run_metrics.h" #include "ios/chrome/browser/signin/identity_manager_factory.h" -#include "ios/chrome/browser/ui/first_run/first_run_histograms.h" #import "ios/chrome/browser/ui/settings/sync/utils/sync_util.h" #include "ios/chrome/browser/ui/util/ui_util.h" #include "ios/web/public/thread/web_thread.h" @@ -101,17 +100,6 @@ DisplaySyncErrors(browserState, web_state, presenter); } -void RecordProductTourTimingMetrics(NSString* timer_name, - base::TimeTicks start_time) { - base::TimeDelta delta = base::TimeTicks::Now() - start_time; - NSString* histogramName = - [NSString stringWithFormat:@"ProductTour.IOSScreens%@", timer_name]; - UMA_HISTOGRAM_CUSTOM_TIMES_FIRST_RUN(base::SysNSStringToUTF8(histogramName), - delta, - base::TimeDelta::FromMilliseconds(10), - base::TimeDelta::FromMinutes(3), 50); -} - void FirstRunDismissed() { [[NSNotificationCenter defaultCenter] postNotificationName:kChromeFirstRunUIDidFinishNotification
diff --git a/ios/chrome/browser/ui/fullscreen/fullscreen_controller_impl.mm b/ios/chrome/browser/ui/fullscreen/fullscreen_controller_impl.mm index c6b028c..d6542d9 100644 --- a/ios/chrome/browser/ui/fullscreen/fullscreen_controller_impl.mm +++ b/ios/chrome/browser/ui/fullscreen/fullscreen_controller_impl.mm
@@ -176,10 +176,6 @@ } void FullscreenControllerImpl::SetWebStateList(WebStateList* web_state_list) { - if (fullscreen::features::ShouldScopeFullscreenControllerToBrowser()) - // If FullscreenController is Browser-scoped, then WebStateList observation - // should last the entire lifetime of the Browser. - return; web_state_list_observer_.SetWebStateList(web_state_list); }
diff --git a/ios/chrome/browser/ui/infobars/BUILD.gn b/ios/chrome/browser/ui/infobars/BUILD.gn index 188dd71..a169480 100644 --- a/ios/chrome/browser/ui/infobars/BUILD.gn +++ b/ios/chrome/browser/ui/infobars/BUILD.gn
@@ -167,6 +167,7 @@ "//ios/chrome/browser/ui/infobars/modals:public", "//ios/chrome/browser/ui/popup_menu:constants", "//ios/chrome/test/earl_grey:eg_test_support+eg2", + "//ios/components/webui:url_constants", "//ios/testing/earl_grey:eg_test_support+eg2", "//ios/third_party/earl_grey2:test_lib", "//ios/web/public/test/http_server", @@ -202,6 +203,7 @@ "//ios/chrome/browser/ui/infobars/modals:public", "//ios/chrome/browser/ui/popup_menu:constants", "//ios/chrome/test/earl_grey:test_support", + "//ios/components/webui:url_constants", "//ios/testing/earl_grey:earl_grey_support", "//ios/web/public/test/http_server", "//ui/base",
diff --git a/ios/chrome/browser/ui/infobars/translate_infobar_egtest.mm b/ios/chrome/browser/ui/infobars/translate_infobar_egtest.mm index ef65e06..0de20a29 100644 --- a/ios/chrome/browser/ui/infobars/translate_infobar_egtest.mm +++ b/ios/chrome/browser/ui/infobars/translate_infobar_egtest.mm
@@ -29,6 +29,7 @@ #import "ios/chrome/test/earl_grey/chrome_earl_grey_ui.h" #import "ios/chrome/test/earl_grey/chrome_matchers.h" #import "ios/chrome/test/earl_grey/chrome_test_case.h" +#include "ios/components/webui/web_ui_url_constants.h" #import "ios/testing/earl_grey/app_launch_manager.h" #import "ios/testing/earl_grey/earl_grey_test.h" #include "ios/web/public/test/http_server/data_response_provider.h"
diff --git a/ios/chrome/browser/ui/location_bar/BUILD.gn b/ios/chrome/browser/ui/location_bar/BUILD.gn index c3d0a70d..514a736 100644 --- a/ios/chrome/browser/ui/location_bar/BUILD.gn +++ b/ios/chrome/browser/ui/location_bar/BUILD.gn
@@ -116,6 +116,7 @@ "//ios/chrome/browser/reading_list", "//ios/chrome/browser/ssl", "//ios/chrome/browser/web_state_list", + "//ios/components/webui:url_constants", "//ios/web/public", "//ios/web/public/security", ]
diff --git a/ios/chrome/browser/ui/location_bar/location_bar_coordinator.h b/ios/chrome/browser/ui/location_bar/location_bar_coordinator.h index fb32c215..375f497b 100644 --- a/ios/chrome/browser/ui/location_bar/location_bar_coordinator.h +++ b/ios/chrome/browser/ui/location_bar/location_bar_coordinator.h
@@ -7,9 +7,9 @@ #import "ios/chrome/browser/ui/coordinators/chrome_coordinator.h" +#import "ios/chrome/browser/ui/commands/omnibox_commands.h" #import "ios/chrome/browser/ui/location_bar/location_bar_url_loader.h" #import "ios/chrome/browser/ui/omnibox/location_bar_delegate.h" -#import "ios/chrome/browser/ui/toolbar/public/omnibox_focuser.h" @protocol EditViewAnimatee; @protocol LocationBarAnimatee; @@ -18,7 +18,7 @@ // Location bar coordinator. @interface LocationBarCoordinator - : ChromeCoordinator <LocationBarURLLoader, OmniboxFocuser> + : ChromeCoordinator <LocationBarURLLoader, OmniboxCommands> // Unavailable, use -initWithBaseViewController:browser:. - (instancetype)initWithBaseViewController:(UIViewController*)viewController
diff --git a/ios/chrome/browser/ui/location_bar/location_bar_coordinator.mm b/ios/chrome/browser/ui/location_bar/location_bar_coordinator.mm index dfa06d0..78d52f6 100644 --- a/ios/chrome/browser/ui/location_bar/location_bar_coordinator.mm +++ b/ios/chrome/browser/ui/location_bar/location_bar_coordinator.mm
@@ -130,7 +130,7 @@ [self.browser->GetCommandDispatcher() startDispatchingToTarget:self - forProtocol:@protocol(OmniboxFocuser)]; + forProtocol:@protocol(OmniboxCommands)]; [self.browser->GetCommandDispatcher() startDispatchingToTarget:self forProtocol:@protocol(LoadQueryCommands)]; @@ -310,7 +310,7 @@ [self cancelOmniboxEdit]; } -#pragma mark - OmniboxFocuser +#pragma mark - OmniboxCommands - (void)focusOmniboxFromFakebox { [self.omniboxCoordinator focusOmnibox];
diff --git a/ios/chrome/browser/ui/location_bar/location_bar_generic_coordinator.h b/ios/chrome/browser/ui/location_bar/location_bar_generic_coordinator.h index cbc66c38b..d989a33 100644 --- a/ios/chrome/browser/ui/location_bar/location_bar_generic_coordinator.h +++ b/ios/chrome/browser/ui/location_bar/location_bar_generic_coordinator.h
@@ -7,9 +7,9 @@ #import <UIKit/UIKit.h> +#import "ios/chrome/browser/ui/commands/omnibox_commands.h" #import "ios/chrome/browser/ui/location_bar/location_bar_url_loader.h" #import "ios/chrome/browser/ui/omnibox/location_bar_delegate.h" -#import "ios/chrome/browser/ui/toolbar/public/omnibox_focuser.h" class ChromeBrowserState; class WebStateList; @@ -21,9 +21,9 @@ @protocol OmniboxPopupPresenterDelegate; @protocol ToolbarCoordinatorDelegate; -@protocol LocationBarGenericCoordinator<NSObject, - LocationBarURLLoader, - OmniboxFocuser> +@protocol LocationBarGenericCoordinator <NSObject, + LocationBarURLLoader, + OmniboxCommands> // Command dispatcher. @property(nonatomic, strong) CommandDispatcher* commandDispatcher;
diff --git a/ios/chrome/browser/ui/location_bar/location_bar_model_delegate_ios.mm b/ios/chrome/browser/ui/location_bar/location_bar_model_delegate_ios.mm index 7ba03a83..53aa5c4 100644 --- a/ios/chrome/browser/ui/location_bar/location_bar_model_delegate_ios.mm +++ b/ios/chrome/browser/ui/location_bar/location_bar_model_delegate_ios.mm
@@ -16,6 +16,7 @@ #include "ios/chrome/browser/pref_names.h" #import "ios/chrome/browser/reading_list/offline_page_tab_helper.h" #include "ios/chrome/browser/web_state_list/web_state_list.h" +#include "ios/components/webui/web_ui_url_constants.h" #import "ios/web/public/navigation/navigation_item.h" #import "ios/web/public/navigation/navigation_manager.h" #import "ios/web/public/security/ssl_status.h"
diff --git a/ios/chrome/browser/ui/main/scene_controller.mm b/ios/chrome/browser/ui/main/scene_controller.mm index ccda7dc4..2d10697 100644 --- a/ios/chrome/browser/ui/main/scene_controller.mm +++ b/ios/chrome/browser/ui/main/scene_controller.mm
@@ -44,6 +44,7 @@ #import "ios/chrome/browser/ui/browser_view/browser_view_controller.h" #import "ios/chrome/browser/ui/commands/browser_commands.h" #import "ios/chrome/browser/ui/commands/command_dispatcher.h" +#import "ios/chrome/browser/ui/commands/omnibox_commands.h" #import "ios/chrome/browser/ui/commands/open_new_tab_command.h" #import "ios/chrome/browser/ui/commands/show_signin_command.h" #import "ios/chrome/browser/ui/first_run/first_run_util.h" @@ -56,7 +57,6 @@ #import "ios/chrome/browser/ui/settings/settings_navigation_controller.h" #import "ios/chrome/browser/ui/signin_interaction/signin_interaction_coordinator.h" #include "ios/chrome/browser/ui/tab_grid/tab_grid_coordinator.h" -#import "ios/chrome/browser/ui/toolbar/public/omnibox_focuser.h" #import "ios/chrome/browser/ui/ui_feature_flags.h" #import "ios/chrome/browser/ui/util/multi_window_support.h" #import "ios/chrome/browser/ui/util/top_view_controller.h" @@ -1108,9 +1108,9 @@ }; case FOCUS_OMNIBOX: return ^{ - id<OmniboxFocuser> focusHandler = HandlerForProtocol( + id<OmniboxCommands> focusHandler = HandlerForProtocol( self.currentInterface.browser->GetCommandDispatcher(), - OmniboxFocuser); + OmniboxCommands); [focusHandler focusOmnibox]; }; default: @@ -1513,9 +1513,10 @@ - (void)displayCurrentBVCAndFocusOmnibox:(BOOL)focusOmnibox { ProceduralBlock completion = nil; if (focusOmnibox) { - __weak BrowserViewController* weakCurrentBVC = self.currentInterface.bvc; + id<OmniboxCommands> omniboxHandler = HandlerForProtocol( + self.currentInterface.browser->GetCommandDispatcher(), OmniboxCommands); completion = ^{ - [weakCurrentBVC.dispatcher focusOmnibox]; + [omniboxHandler focusOmnibox]; }; } [self.mainCoordinator
diff --git a/ios/chrome/browser/ui/omnibox/omnibox_coordinator.mm b/ios/chrome/browser/ui/omnibox/omnibox_coordinator.mm index 18bf751..dfc1a49 100644 --- a/ios/chrome/browser/ui/omnibox/omnibox_coordinator.mm +++ b/ios/chrome/browser/ui/omnibox/omnibox_coordinator.mm
@@ -17,6 +17,7 @@ #import "ios/chrome/browser/search_engines/template_url_service_factory.h" #import "ios/chrome/browser/ui/commands/command_dispatcher.h" #import "ios/chrome/browser/ui/commands/load_query_commands.h" +#import "ios/chrome/browser/ui/commands/omnibox_commands.h" #import "ios/chrome/browser/ui/location_bar/location_bar_constants.h" #import "ios/chrome/browser/ui/omnibox/omnibox_mediator.h" #import "ios/chrome/browser/ui/omnibox/omnibox_text_field_ios.h" @@ -27,7 +28,6 @@ #include "ios/chrome/browser/ui/omnibox/popup/omnibox_popup_view_ios.h" #import "ios/chrome/browser/ui/toolbar/keyboard_assist/toolbar_assistive_keyboard_delegate.h" #import "ios/chrome/browser/ui/toolbar/keyboard_assist/toolbar_assistive_keyboard_views.h" -#import "ios/chrome/browser/ui/toolbar/public/omnibox_focuser.h" #include "ios/chrome/browser/ui/ui_feature_flags.h" #if !defined(__has_feature) || !__has_feature(objc_arc) @@ -70,7 +70,7 @@ // TODO(crbug.com/1045047): Use HandlerForProtocol after commands protocol // clean up. self.viewController.dispatcher = - static_cast<id<BrowserCommands, LoadQueryCommands, OmniboxFocuser>>( + static_cast<id<BrowserCommands, LoadQueryCommands, OmniboxCommands>>( self.browser->GetCommandDispatcher()); self.viewController.delegate = self; self.mediator = [[OmniboxMediator alloc] init]; @@ -84,8 +84,8 @@ DCHECK(self.editController); - id<OmniboxFocuser> focuser = - static_cast<id<OmniboxFocuser>>(self.browser->GetCommandDispatcher()); + id<OmniboxCommands> focuser = + static_cast<id<OmniboxCommands>>(self.browser->GetCommandDispatcher()); _editView = std::make_unique<OmniboxViewIOS>( self.textField, self.editController, self.mediator, self.browser->GetBrowserState(), focuser);
diff --git a/ios/chrome/browser/ui/omnibox/omnibox_view_controller.h b/ios/chrome/browser/ui/omnibox/omnibox_view_controller.h index 256dbb7c..aa55cdd 100644 --- a/ios/chrome/browser/ui/omnibox/omnibox_view_controller.h +++ b/ios/chrome/browser/ui/omnibox/omnibox_view_controller.h
@@ -14,7 +14,7 @@ @protocol BrowserCommands; @protocol LoadQueryCommands; -@protocol OmniboxFocuser; +@protocol OmniboxCommands; @class OmniboxViewController; class OmniboxTextChangeDelegate; @@ -47,7 +47,7 @@ // The dispatcher for the paste and go action. @property(nonatomic, weak) - id<BrowserCommands, LoadQueryCommands, OmniboxFocuser> + id<BrowserCommands, LoadQueryCommands, OmniboxCommands> dispatcher; // The delegate for this object.
diff --git a/ios/chrome/browser/ui/omnibox/omnibox_view_controller.mm b/ios/chrome/browser/ui/omnibox/omnibox_view_controller.mm index 97669066..c03dcf8 100644 --- a/ios/chrome/browser/ui/omnibox/omnibox_view_controller.mm +++ b/ios/chrome/browser/ui/omnibox/omnibox_view_controller.mm
@@ -13,11 +13,11 @@ #include "components/strings/grit/components_strings.h" #import "ios/chrome/browser/ui/commands/browser_commands.h" #import "ios/chrome/browser/ui/commands/load_query_commands.h" +#import "ios/chrome/browser/ui/commands/omnibox_commands.h" #import "ios/chrome/browser/ui/omnibox/omnibox_constants.h" #import "ios/chrome/browser/ui/omnibox/omnibox_container_view.h" #include "ios/chrome/browser/ui/omnibox/omnibox_text_change_delegate.h" #import "ios/chrome/browser/ui/omnibox/omnibox_text_field_delegate.h" -#import "ios/chrome/browser/ui/toolbar/public/omnibox_focuser.h" #import "ios/chrome/browser/ui/toolbar/public/toolbar_constants.h" #include "ios/chrome/browser/ui/ui_feature_flags.h" #include "ios/chrome/browser/ui/util/ui_util.h"
diff --git a/ios/chrome/browser/ui/omnibox/omnibox_view_ios.h b/ios/chrome/browser/ui/omnibox/omnibox_view_ios.h index 66351c4..7f50e49 100644 --- a/ios/chrome/browser/ui/omnibox/omnibox_view_ios.h +++ b/ios/chrome/browser/ui/omnibox/omnibox_view_ios.h
@@ -24,7 +24,7 @@ struct AutocompleteMatch; @class OmniboxTextFieldIOS; @class OmniboxTextFieldPasteDelegate; -@protocol OmniboxFocuser; +@protocol OmniboxCommands; // iOS implementation of OmniBoxView. Wraps a UITextField and // interfaces with the rest of the autocomplete system. @@ -37,7 +37,7 @@ WebOmniboxEditController* controller, id<OmniboxLeftImageConsumer> left_image_consumer, ChromeBrowserState* browser_state, - id<OmniboxFocuser> omnibox_focuser); + id<OmniboxCommands> omnibox_focuser); void SetPopupProvider(OmniboxPopupProvider* provider) { popup_provider_ = provider; @@ -174,7 +174,7 @@ __weak id<OmniboxLeftImageConsumer> left_image_consumer_; // Focuser, used to transition the location bar to focused/defocused state as // necessary. - __weak id<OmniboxFocuser> omnibox_focuser_; + __weak id<OmniboxCommands> omnibox_focuser_; State state_before_change_; NSString* marked_text_before_change_;
diff --git a/ios/chrome/browser/ui/omnibox/omnibox_view_ios.mm b/ios/chrome/browser/ui/omnibox/omnibox_view_ios.mm index 898955d3..9335e6a 100644 --- a/ios/chrome/browser/ui/omnibox/omnibox_view_ios.mm +++ b/ios/chrome/browser/ui/omnibox/omnibox_view_ios.mm
@@ -23,11 +23,11 @@ #include "components/omnibox/common/omnibox_focus_state.h" #include "ios/chrome/browser/autocomplete/autocomplete_scheme_classifier_impl.h" #include "ios/chrome/browser/browser_state/chrome_browser_state.h" +#import "ios/chrome/browser/ui/commands/omnibox_commands.h" #include "ios/chrome/browser/ui/omnibox/chrome_omnibox_client_ios.h" #include "ios/chrome/browser/ui/omnibox/omnibox_text_field_paste_delegate.h" #import "ios/chrome/browser/ui/omnibox/omnibox_util.h" #include "ios/chrome/browser/ui/omnibox/web_omnibox_edit_controller.h" -#import "ios/chrome/browser/ui/toolbar/public/omnibox_focuser.h" #include "ios/chrome/browser/ui/util/ui_util.h" #import "ios/chrome/browser/ui/util/uikit_ui_util.h" #include "ios/chrome/grit/ios_strings.h" @@ -72,7 +72,7 @@ WebOmniboxEditController* controller, id<OmniboxLeftImageConsumer> left_image_consumer, ChromeBrowserState* browser_state, - id<OmniboxFocuser> omnibox_focuser) + id<OmniboxCommands> omnibox_focuser) : OmniboxView(controller, controller ? std::make_unique<ChromeOmniboxClientIOS>(controller,
diff --git a/ios/chrome/browser/ui/omnibox/omnibox_view_ios_unittest.mm b/ios/chrome/browser/ui/omnibox/omnibox_view_ios_unittest.mm index 5206ca4..d9882f1 100644 --- a/ios/chrome/browser/ui/omnibox/omnibox_view_ios_unittest.mm +++ b/ios/chrome/browser/ui/omnibox/omnibox_view_ios_unittest.mm
@@ -26,7 +26,7 @@ view_ = std::make_unique<OmniboxViewIOS>( mockOmniboxTextfield_, /* WebOmniboxEditController*/ nullptr, /*id<OmniboxLeftImageConsumer> */ nil, browser_state_.get(), - /*id<OmniboxFocuser>*/ nil); + /*id<OmniboxCommands>*/ nil); } // Test broser state.
diff --git a/ios/chrome/browser/ui/omnibox/popup/omnibox_popup_coordinator.h b/ios/chrome/browser/ui/omnibox/popup/omnibox_popup_coordinator.h index 77b8e90..d432f04 100644 --- a/ios/chrome/browser/ui/omnibox/popup/omnibox_popup_coordinator.h +++ b/ios/chrome/browser/ui/omnibox/popup/omnibox_popup_coordinator.h
@@ -10,7 +10,7 @@ #include <memory> @protocol OmniboxPopupPresenterDelegate; -@protocol OmniboxFocuser; +@protocol OmniboxCommands; class OmniboxPopupViewIOS; // Coordinator for the Omnibox Popup.
diff --git a/ios/chrome/browser/ui/page_info/BUILD.gn b/ios/chrome/browser/ui/page_info/BUILD.gn index 4f3174e..f651c117 100644 --- a/ios/chrome/browser/ui/page_info/BUILD.gn +++ b/ios/chrome/browser/ui/page_info/BUILD.gn
@@ -42,6 +42,7 @@ "//ios/chrome/common", "//ios/chrome/common/ui/colors", "//ios/chrome/common/ui/util", + "//ios/components/webui:url_constants", "//ios/web", "//ios/web/public/security", "//ui/base", @@ -102,6 +103,7 @@ "//ios/chrome/browser/ui/fullscreen:coordinators", "//ios/chrome/browser/ui/page_info/requirements", "//ios/chrome/browser/web_state_list", + "//ios/components/webui:url_constants", "//ios/web", "//ios/web/public", "//ios/web/public/security",
diff --git a/ios/chrome/browser/ui/page_info/page_info_description.mm b/ios/chrome/browser/ui/page_info/page_info_description.mm index 3a72285..c288881f 100644 --- a/ios/chrome/browser/ui/page_info/page_info_description.mm +++ b/ios/chrome/browser/ui/page_info/page_info_description.mm
@@ -12,6 +12,7 @@ #include "components/strings/grit/components_strings.h" #include "ios/chrome/browser/chrome_url_constants.h" #include "ios/chrome/grit/ios_strings.h" +#include "ios/components/webui/web_ui_url_constants.h" #include "ios/web/public/security/ssl_status.h" #include "ui/base/l10n/l10n_util.h"
diff --git a/ios/chrome/browser/ui/page_info/page_info_site_security_mediator.mm b/ios/chrome/browser/ui/page_info/page_info_site_security_mediator.mm index 21fec87..7df4546 100644 --- a/ios/chrome/browser/ui/page_info/page_info_site_security_mediator.mm +++ b/ios/chrome/browser/ui/page_info/page_info_site_security_mediator.mm
@@ -15,6 +15,7 @@ #import "ios/chrome/browser/ui/page_info/page_info_site_security_description.h" #include "ios/chrome/grit/ios_chromium_strings.h" #include "ios/chrome/grit/ios_strings.h" +#include "ios/components/webui/web_ui_url_constants.h" #include "ios/web/public/security/ssl_status.h" #include "ui/base/l10n/l10n_util.h" #include "url/gurl.h"
diff --git a/ios/chrome/browser/ui/popup_menu/BUILD.gn b/ios/chrome/browser/ui/popup_menu/BUILD.gn index 8d348c9..f837200b 100644 --- a/ios/chrome/browser/ui/popup_menu/BUILD.gn +++ b/ios/chrome/browser/ui/popup_menu/BUILD.gn
@@ -79,6 +79,7 @@ "//ios/chrome/browser/web", "//ios/chrome/browser/web:feature_flags", "//ios/chrome/browser/web_state_list", + "//ios/components/webui:url_constants", "//ios/public/provider/chrome/browser", "//ios/public/provider/chrome/browser/user_feedback", "//ios/web",
diff --git a/ios/chrome/browser/ui/popup_menu/popup_menu_mediator.mm b/ios/chrome/browser/ui/popup_menu/popup_menu_mediator.mm index 6546ba9c..5ffad90 100644 --- a/ios/chrome/browser/ui/popup_menu/popup_menu_mediator.mm +++ b/ios/chrome/browser/ui/popup_menu/popup_menu_mediator.mm
@@ -46,6 +46,7 @@ #import "ios/chrome/browser/web_state_list/web_state_list.h" #import "ios/chrome/browser/web_state_list/web_state_list_observer_bridge.h" #include "ios/chrome/grit/ios_strings.h" +#include "ios/components/webui/web_ui_url_constants.h" #include "ios/public/provider/chrome/browser/chrome_browser_provider.h" #import "ios/public/provider/chrome/browser/user_feedback/user_feedback_provider.h" #include "ios/web/common/features.h"
diff --git a/ios/chrome/browser/ui/qr_scanner/qr_scanner_legacy_coordinator.mm b/ios/chrome/browser/ui/qr_scanner/qr_scanner_legacy_coordinator.mm index c2227dd..c390f41 100644 --- a/ios/chrome/browser/ui/qr_scanner/qr_scanner_legacy_coordinator.mm +++ b/ios/chrome/browser/ui/qr_scanner/qr_scanner_legacy_coordinator.mm
@@ -8,9 +8,9 @@ #import "ios/chrome/browser/main/browser.h" #import "ios/chrome/browser/ui/commands/browser_commands.h" #import "ios/chrome/browser/ui/commands/command_dispatcher.h" +#import "ios/chrome/browser/ui/commands/omnibox_commands.h" #import "ios/chrome/browser/ui/qr_scanner/qr_scanner_view_controller.h" #import "ios/chrome/browser/ui/scanner/scanner_presenting.h" -#import "ios/chrome/browser/ui/toolbar/public/omnibox_focuser.h" #if !defined(__has_feature) || !__has_feature(objc_arc) #error "This file requires ARC support." @@ -48,7 +48,7 @@ - (void)showQRScanner { DCHECK(self.browser); CommandDispatcher* dispatcher = self.browser->GetCommandDispatcher(); - id<OmniboxFocuser> handler = HandlerForProtocol(dispatcher, OmniboxFocuser); + id<OmniboxCommands> handler = HandlerForProtocol(dispatcher, OmniboxCommands); [handler cancelOmniboxEdit]; self.viewController = [[QRScannerViewController alloc] initWithPresentationProvider:self
diff --git a/ios/chrome/browser/ui/settings/google_services/accounts_table_egtest.mm b/ios/chrome/browser/ui/settings/google_services/accounts_table_egtest.mm index dd869a5..acecfdd 100644 --- a/ios/chrome/browser/ui/settings/google_services/accounts_table_egtest.mm +++ b/ios/chrome/browser/ui/settings/google_services/accounts_table_egtest.mm
@@ -2,12 +2,15 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#import <UIKit/UIKit.h> + #import "base/test/scoped_feature_list.h" #import "ios/chrome/browser/ui/authentication/signin_earl_grey_ui.h" #import "ios/chrome/browser/ui/authentication/signin_earlgrey_utils.h" #import "ios/chrome/browser/ui/authentication/signin_earlgrey_utils_app_interface.h" #import "ios/chrome/browser/ui/bookmarks/bookmark_earl_grey.h" #import "ios/chrome/browser/ui/bookmarks/bookmark_earl_grey_ui.h" +#import "ios/chrome/browser/ui/settings/google_services/accounts_table_view_controller_constants.h" #import "ios/chrome/browser/ui/ui_feature_flags.h" #import "ios/chrome/grit/ios_strings.h" #import "ios/chrome/test/earl_grey/chrome_earl_grey.h" @@ -24,6 +27,7 @@ #endif using chrome_test_util::ButtonWithAccessibilityLabel; +using chrome_test_util::ButtonWithAccessibilityLabelId; using chrome_test_util::SettingsAccountButton; using chrome_test_util::SettingsDoneButton; using chrome_test_util::SignOutAccountsButton; @@ -40,9 +44,49 @@ return ButtonWithAccessibilityLabel(fakeIdentity.userEmail); } +// Returns a matcher for when there are no bookmarks saved. id<GREYMatcher> NoBookmarksLabel() { return grey_text(l10n_util::GetNSString(IDS_IOS_BOOKMARK_NO_BOOKMARKS_LABEL)); } + +// Returns a matcher for the button to sign out and clear data. +id<GREYMatcher> SignOutAndClearDataButton() { + return grey_accessibilityID( + kSettingsAccountsTableViewSignoutAndClearDataCellId); +} + +// Opens the list of accounts and taps the sign out button, |buttonMatcher|. +void SignOut(id<GREYMatcher> buttonMatcher, int labelID) { + [ChromeEarlGreyUI openSettingsMenu]; + [ChromeEarlGreyUI tapSettingsMenuButton:SettingsAccountButton()]; + [ChromeEarlGreyUI tapAccountsMenuButton:buttonMatcher]; + + // Both of the Buttons on the screen have the same label and traits. We need + // to match with the Button that does not have an accessibility label as this + // is the one created by the ActionSheetCoordinator. + [[EarlGrey selectElementWithMatcher:grey_allOf(ButtonWithAccessibilityLabelId( + labelID), + grey_not(buttonMatcher), nil)] + performAction:grey_tap()]; + + // Wait until the user is signed out. + [[GREYUIThreadExecutor sharedInstance] drainUntilIdle]; + [[EarlGrey selectElementWithMatcher:SettingsDoneButton()] + performAction:grey_tap()]; + [SigninEarlGreyUtils checkSignedOut]; +} + +// Signs out of account using the sign out button. +void SignOut() { + SignOut(SignOutAccountsButton(), + IDS_IOS_DISCONNECT_DIALOG_CONTINUE_BUTTON_MOBILE); +} + +// Signs out of account using the sign out and clear data button. +void SignOutAndClearData() { + SignOut(SignOutAndClearDataButton(), + IDS_IOS_DISCONNECT_DIALOG_CONTINUE_AND_CLEAR_MOBILE); +} } // Integration tests using the Account Settings screen. @@ -193,8 +237,7 @@ [SigninEarlGreyUtilsAppInterface addBookmark:@"http://youtube.com" withTitle:@"cats"]; - [SigninEarlGreyUI - signOutWithSignOutConfirmation:SignOutConfirmationNonManagedUser]; + SignOut(); // Open the Bookmarks screen on the Tools menu. [BookmarkEarlGreyUI openBookmarks]; @@ -219,8 +262,7 @@ [SigninEarlGreyUtilsAppInterface addBookmark:@"http://youtube.com" withTitle:@"cats"]; - [SigninEarlGreyUI signOutWithSignOutConfirmation: - SignOutConfirmationNonManagedUserWithClearedData]; + SignOutAndClearData(); // Open the Bookmarks screen on the Tools menu. [BookmarkEarlGreyUI openBookmarks]; @@ -244,8 +286,7 @@ [SigninEarlGreyUtilsAppInterface addBookmark:@"http://youtube.com" withTitle:@"cats"]; - [SigninEarlGreyUI - signOutWithSignOutConfirmation:SignOutConfirmationManagedUser]; + SignOutAndClearData(); // Open the Bookmarks screen on the Tools menu. [BookmarkEarlGreyUI openBookmarks]; @@ -275,8 +316,12 @@ // Open the "Disconnect Account" dialog, then tap "Cancel". [ChromeEarlGreyUI tapAccountsMenuButton:SignOutAccountsButton()]; - [[EarlGrey selectElementWithMatcher:chrome_test_util::CancelButton()] - performAction:grey_tap()]; + // Note that the iPad does not provide a CANCEL button by design. Click + // anywhere on the screen to exit. + [[[EarlGrey + selectElementWithMatcher:grey_anyOf(chrome_test_util::CancelButton(), + SignOutAccountsButton(), nil)] + atIndex:1] performAction:grey_tap()]; // Check that Account Settings screen is open and |fakeIdentity| is signed in. [[EarlGrey selectElementWithMatcher:chrome_test_util::
diff --git a/ios/chrome/browser/ui/settings/google_services/accounts_table_view_controller.mm b/ios/chrome/browser/ui/settings/google_services/accounts_table_view_controller.mm index 04bb5073..fef3bbd3 100644 --- a/ios/chrome/browser/ui/settings/google_services/accounts_table_view_controller.mm +++ b/ios/chrome/browser/ui/settings/google_services/accounts_table_view_controller.mm
@@ -22,6 +22,7 @@ #include "ios/chrome/browser/sync/profile_sync_service_factory.h" #include "ios/chrome/browser/sync/sync_setup_service.h" #include "ios/chrome/browser/sync/sync_setup_service_factory.h" +#import "ios/chrome/browser/ui/alert_coordinator/action_sheet_coordinator.h" #import "ios/chrome/browser/ui/alert_coordinator/alert_coordinator.h" #import "ios/chrome/browser/ui/authentication/cells/table_view_account_item.h" #import "ios/chrome/browser/ui/authentication/resized_avatar_cache.h" @@ -32,9 +33,11 @@ #import "ios/chrome/browser/ui/settings/sync/utils/sync_util.h" #import "ios/chrome/browser/ui/signin_interaction/signin_interaction_coordinator.h" #import "ios/chrome/browser/ui/table_view/cells/table_view_detail_text_item.h" +#import "ios/chrome/browser/ui/table_view/cells/table_view_link_header_footer_item.h" #import "ios/chrome/browser/ui/table_view/cells/table_view_text_header_footer_item.h" #import "ios/chrome/browser/ui/table_view/table_view_model.h" #include "ios/chrome/browser/ui/ui_feature_flags.h" +#import "ios/chrome/common/ui/colors/semantic_color_names.h" #include "ios/chrome/grit/ios_chromium_strings.h" #include "ios/chrome/grit/ios_strings.h" #import "ios/public/provider/chrome/browser/chrome_browser_provider.h" @@ -60,8 +63,19 @@ typedef NS_ENUM(NSInteger, ItemType) { ItemTypeAccount = kItemTypeEnumZero, ItemTypeAddAccount, + // Provides experimental and production sign out items. In the experimental + // item, this type is used only for non-managed accounts. ItemTypeSignOut, + // Experimental sign out item that clears Chrome data. Used for both managed + // and non-managed accounts. + ItemTypeSignOutAndClearData, ItemTypeHeader, + // Detailed description of the actions taken by sign out e.g. turning off sync + // and clearing Chrome data. + ItemTypeSignOutManagedAccountFooter, + // Detailed description of the actions taken by sign out, e.g. turning off + // sync. + ItemTypeSignOutNonManagedAccountFooter, }; } // namespace @@ -209,9 +223,31 @@ toSectionWithIdentifier:SectionIdentifierAccounts]; // Sign out section. - [model addSectionWithIdentifier:SectionIdentifierSignOut]; - [model addItem:[self signOutItem] - toSectionWithIdentifier:SectionIdentifierSignOut]; + if (base::FeatureList::IsEnabled(kClearSyncedData)) { + [model addSectionWithIdentifier:SectionIdentifierSignOut]; + // Adds a signout option if the account is not managed. + if (![self authService]->IsAuthenticatedIdentityManaged()) { + [model addItem:[self experimentalSignOutItem] + toSectionWithIdentifier:SectionIdentifierSignOut]; + } + // Adds a signout and clear data option. + [model addItem:[self experimentalSignOutAndClearDataItem] + toSectionWithIdentifier:SectionIdentifierSignOut]; + + // Adds a footer with signout explanation depending on the type of + // account whether managed or non-managed. + if ([self authService]->IsAuthenticatedIdentityManaged()) { + [model setFooter:[self signOutManagedAccountFooterItem] + forSectionWithIdentifier:SectionIdentifierSignOut]; + } else { + [model setFooter:[self signOutNonManagedAccountFooterItem] + forSectionWithIdentifier:SectionIdentifierSignOut]; + } + } else { + [model addSectionWithIdentifier:SectionIdentifierSignOut]; + [model addItem:[self signOutItem] + toSectionWithIdentifier:SectionIdentifierSignOut]; + } } #pragma mark - Model objects @@ -223,6 +259,22 @@ return header; } +- (TableViewLinkHeaderFooterItem*)signOutNonManagedAccountFooterItem { + TableViewLinkHeaderFooterItem* footer = [[TableViewLinkHeaderFooterItem alloc] + initWithType:ItemTypeSignOutNonManagedAccountFooter]; + footer.text = l10n_util::GetNSString( + IDS_IOS_DISCONNECT_NON_MANAGED_ACCOUNT_FOOTER_INFO_MOBILE); + return footer; +} + +- (TableViewLinkHeaderFooterItem*)signOutManagedAccountFooterItem { + TableViewLinkHeaderFooterItem* footer = [[TableViewLinkHeaderFooterItem alloc] + initWithType:ItemTypeSignOutManagedAccountFooter]; + footer.text = l10n_util::GetNSStringF( + IDS_IOS_DISCONNECT_MANAGED_ACCOUNT_FOOTER_INFO_MOBILE, self.hostedDomain); + return footer; +} + - (TableViewItem*)accountItem:(ChromeIdentity*)identity { TableViewAccountItem* item = [[TableViewAccountItem alloc] initWithType:ItemTypeAccount]; @@ -260,6 +312,29 @@ return item; } +- (TableViewItem*)experimentalSignOutItem { + TableViewDetailTextItem* item = + [[TableViewDetailTextItem alloc] initWithType:ItemTypeSignOut]; + item.text = + l10n_util::GetNSString(IDS_IOS_DISCONNECT_DIALOG_CONTINUE_BUTTON_MOBILE); + item.textColor = [UIColor colorNamed:kBlueColor]; + item.accessibilityTraits |= UIAccessibilityTraitButton; + item.accessibilityIdentifier = kSettingsAccountsTableViewSignoutCellId; + return item; +} + +- (TableViewItem*)experimentalSignOutAndClearDataItem { + TableViewDetailTextItem* item = [[TableViewDetailTextItem alloc] + initWithType:ItemTypeSignOutAndClearData]; + item.text = l10n_util::GetNSString( + IDS_IOS_DISCONNECT_DIALOG_CONTINUE_AND_CLEAR_MOBILE); + item.textColor = [UIColor colorNamed:kRedColor]; + item.accessibilityTraits |= UIAccessibilityTraitButton; + item.accessibilityIdentifier = + kSettingsAccountsTableViewSignoutAndClearDataCellId; + return item; +} + #pragma mark - UITableViewDelegate - (void)tableView:(UITableView*)tableView @@ -281,7 +356,14 @@ [self showAddAccount]; break; case ItemTypeSignOut: - [self showDisconnect]; + if (base::FeatureList::IsEnabled(kClearSyncedData)) { + [self showSignOutWithClearData:NO]; + } else { + [self showSignOut]; + } + break; + case ItemTypeSignOutAndClearData: + [self showSignOutWithClearData:YES]; break; default: break; @@ -344,7 +426,46 @@ ->PresentAccountDetailsController(identity, self, /*animated=*/YES); } -- (void)showDisconnect { +- (void)showSignOutWithClearData:(BOOL)forceClearData { + NSString* alertMessage = nil; + NSString* signOutTitle = nil; + UIAlertActionStyle actionStyle = UIAlertActionStyleDefault; + + if (forceClearData) { + alertMessage = l10n_util::GetNSString( + IDS_IOS_DISCONNECT_DESTRUCTIVE_DIALOG_INFO_MOBILE); + signOutTitle = l10n_util::GetNSString( + IDS_IOS_DISCONNECT_DIALOG_CONTINUE_AND_CLEAR_MOBILE); + actionStyle = UIAlertActionStyleDestructive; + } else { + alertMessage = + l10n_util::GetNSString(IDS_IOS_DISCONNECT_KEEP_DATA_DIALOG_INFO_MOBILE); + signOutTitle = l10n_util::GetNSString( + IDS_IOS_DISCONNECT_DIALOG_CONTINUE_BUTTON_MOBILE); + actionStyle = UIAlertActionStyleDefault; + } + + _alertCoordinator = + [[ActionSheetCoordinator alloc] initWithBaseViewController:self + title:nil + message:alertMessage + rect:self.view.frame + view:self.view]; + + __weak AccountsTableViewController* weakSelf = self; + [_alertCoordinator + addItemWithTitle:signOutTitle + action:^{ + [weakSelf handleSignOutWithForceClearData:forceClearData]; + } + style:actionStyle]; + [_alertCoordinator addItemWithTitle:l10n_util::GetNSString(IDS_CANCEL) + action:nil + style:UIAlertActionStyleCancel]; + [_alertCoordinator start]; +} + +- (void)showSignOut { if (_authenticationOperationInProgress || [_alertCoordinator isVisible] || self != [self.navigationController topViewController]) { // An action is already in progress, ignore user's request. @@ -354,23 +475,12 @@ NSString* title = nil; NSString* message = nil; NSString* continueButtonTitle = nil; - NSString* clearDataButtonTitle = nil; if ([self authService] -> IsAuthenticatedIdentityManaged()) { - signin::IdentityManager* identityManager = - IdentityManagerFactory::GetForBrowserState(_browser->GetBrowserState()); - base::Optional<AccountInfo> accountInfo = - identityManager->FindExtendedAccountInfoForAccountWithRefreshToken( - identityManager->GetPrimaryAccountInfo()); - std::string hosted_domain = accountInfo.has_value() - ? accountInfo.value().hosted_domain - : std::string(); - title = l10n_util::GetNSString(IDS_IOS_MANAGED_DISCONNECT_DIALOG_TITLE_UNITY); - message = - l10n_util::GetNSStringF(IDS_IOS_MANAGED_DISCONNECT_DIALOG_INFO_UNITY, - base::UTF8ToUTF16(hosted_domain)); + message = l10n_util::GetNSStringF( + IDS_IOS_MANAGED_DISCONNECT_DIALOG_INFO_UNITY, self.hostedDomain); continueButtonTitle = l10n_util::GetNSString(IDS_IOS_MANAGED_DISCONNECT_DIALOG_ACCEPT_UNITY); } else { @@ -379,8 +489,6 @@ l10n_util::GetNSString(IDS_IOS_DISCONNECT_DIALOG_INFO_MOBILE_UNITY); continueButtonTitle = l10n_util::GetNSString( IDS_IOS_DISCONNECT_DIALOG_CONTINUE_BUTTON_MOBILE); - clearDataButtonTitle = l10n_util::GetNSString( - IDS_IOS_DISCONNECT_DIALOG_CONTINUE_AND_CLEAR_MOBILE); } _alertCoordinator = @@ -388,46 +496,35 @@ title:title message:message]; + __weak AccountsTableViewController* weakSelf = self; [_alertCoordinator addItemWithTitle:l10n_util::GetNSString(IDS_CANCEL) action:nil style:UIAlertActionStyleCancel]; - __weak AccountsTableViewController* weakSelf = self; - [_alertCoordinator - addItemWithTitle:continueButtonTitle - action:^{ - [weakSelf handleDisconnectWithForceClearSyncData:NO]; - } - style:UIAlertActionStyleDefault]; + [_alertCoordinator addItemWithTitle:continueButtonTitle + action:^{ + [weakSelf handleSignOutWithForceClearData:NO]; + } + style:UIAlertActionStyleDefault]; - if (base::FeatureList::IsEnabled(kClearSyncedData) && - ![self authService] -> IsAuthenticatedIdentityManaged()) { - DCHECK(clearDataButtonTitle); - [_alertCoordinator - addItemWithTitle:clearDataButtonTitle - action:^{ - [weakSelf handleDisconnectWithForceClearSyncData:YES]; - } - style:UIAlertActionStyleDestructive]; - } [_alertCoordinator start]; } -- (void)handleDisconnectWithForceClearSyncData:(BOOL)forceClearSyncData { +- (void)handleSignOutWithForceClearData:(BOOL)forceClearData { AuthenticationService* authService = [self authService]; if (authService->IsAuthenticated()) { _authenticationOperationInProgress = YES; [self preventUserInteraction]; authService->SignOut( - signin_metrics::USER_CLICKED_SIGNOUT_SETTINGS, forceClearSyncData, ^{ + signin_metrics::USER_CLICKED_SIGNOUT_SETTINGS, forceClearData, ^{ [self allowUserInteraction]; _authenticationOperationInProgress = NO; [base::mac::ObjCCastStrict<SettingsNavigationController>( self.navigationController) popViewControllerOrCloseSettingsAnimated:YES]; }); - if (base::FeatureList::IsEnabled(kClearSyncedData)) { + if (base::FeatureList::IsEnabled(kClearSyncedData) && forceClearData) { UMA_HISTOGRAM_BOOLEAN("Signin.UserRequestedWipeDataOnSignout", - forceClearSyncData); + forceClearData); } } } @@ -472,6 +569,20 @@ _browser->GetBrowserState()); } +#pragma mark - IdentityManager + +- (base::string16)hostedDomain { + signin::IdentityManager* identityManager = + IdentityManagerFactory::GetForBrowserState(_browser->GetBrowserState()); + base::Optional<AccountInfo> accountInfo = + identityManager->FindExtendedAccountInfoForAccountWithRefreshToken( + identityManager->GetPrimaryAccountInfo()); + std::string hosted_domain = accountInfo.has_value() + ? accountInfo.value().hosted_domain + : std::string(); + return base::UTF8ToUTF16(hosted_domain); +} + #pragma mark - ChromeIdentityBrowserOpener - (void)openURL:(NSURL*)url
diff --git a/ios/chrome/browser/ui/settings/google_services/accounts_table_view_controller_constants.h b/ios/chrome/browser/ui/settings/google_services/accounts_table_view_controller_constants.h index 7e1b241..e874333 100644 --- a/ios/chrome/browser/ui/settings/google_services/accounts_table_view_controller_constants.h +++ b/ios/chrome/browser/ui/settings/google_services/accounts_table_view_controller_constants.h
@@ -13,6 +13,8 @@ extern NSString* const kSettingsAccountsTableViewAddAccountCellId; // The accessibility identifier of the signout cell. extern NSString* const kSettingsAccountsTableViewSignoutCellId; +// The accessibility identifier of the signout and clear data cell. +extern NSString* const kSettingsAccountsTableViewSignoutAndClearDataCellId; // The accessibility identifier of the sync account cell. extern NSString* const kSettingsAccountsTableViewSyncCellId;
diff --git a/ios/chrome/browser/ui/settings/google_services/accounts_table_view_controller_constants.mm b/ios/chrome/browser/ui/settings/google_services/accounts_table_view_controller_constants.mm index b7dfa40..ea12d7f 100644 --- a/ios/chrome/browser/ui/settings/google_services/accounts_table_view_controller_constants.mm +++ b/ios/chrome/browser/ui/settings/google_services/accounts_table_view_controller_constants.mm
@@ -13,5 +13,7 @@ @"kSettingsAccountsTableViewAddAccountCellId"; NSString* const kSettingsAccountsTableViewSignoutCellId = @"kSettingsAccountsTableViewSignoutCellId"; +NSString* const kSettingsAccountsTableViewSignoutAndClearDataCellId = + @"kSettingsAccountsTableViewSignoutAndClearDataCellId"; NSString* const kSettingsAccountsTableViewSyncCellId = @"kSettingsAccountsTableViewSyncCellId";
diff --git a/ios/chrome/browser/ui/toolbar/adaptive_toolbar_coordinator.mm b/ios/chrome/browser/ui/toolbar/adaptive_toolbar_coordinator.mm index 0fa196ee..b43345aa 100644 --- a/ios/chrome/browser/ui/toolbar/adaptive_toolbar_coordinator.mm +++ b/ios/chrome/browser/ui/toolbar/adaptive_toolbar_coordinator.mm
@@ -121,7 +121,7 @@ // clean up. self.actionHandler.dispatcher = static_cast<id<ApplicationCommands, BrowserCommands, FindInPageCommands, - OmniboxFocuser>>(self.browser->GetCommandDispatcher()); + OmniboxCommands>>(self.browser->GetCommandDispatcher()); self.actionHandler.incognito = self.browser->GetBrowserState()->IsOffTheRecord();
diff --git a/ios/chrome/browser/ui/toolbar/adaptive_toolbar_view_controller.mm b/ios/chrome/browser/ui/toolbar/adaptive_toolbar_view_controller.mm index 0269d7a2..751d5868 100644 --- a/ios/chrome/browser/ui/toolbar/adaptive_toolbar_view_controller.mm +++ b/ios/chrome/browser/ui/toolbar/adaptive_toolbar_view_controller.mm
@@ -7,6 +7,7 @@ #include "base/logging.h" #include "base/metrics/user_metrics.h" #import "ios/chrome/browser/ui/commands/browser_commands.h" +#import "ios/chrome/browser/ui/commands/omnibox_commands.h" #import "ios/chrome/browser/ui/popup_menu/public/popup_menu_long_press_delegate.h" #import "ios/chrome/browser/ui/toolbar/adaptive_toolbar_view.h" #import "ios/chrome/browser/ui/toolbar/buttons/toolbar_button.h" @@ -15,7 +16,6 @@ #import "ios/chrome/browser/ui/toolbar/buttons/toolbar_tab_grid_button.h" #import "ios/chrome/browser/ui/toolbar/buttons/toolbar_tools_menu_button.h" #import "ios/chrome/browser/ui/toolbar/public/features.h" -#import "ios/chrome/browser/ui/toolbar/public/omnibox_focuser.h" #import "ios/chrome/browser/ui/toolbar/public/toolbar_constants.h" #import "ios/chrome/browser/ui/ui_feature_flags.h" #include "ios/chrome/browser/ui/util/animation_util.h"
diff --git a/ios/chrome/browser/ui/toolbar/buttons/toolbar_button_actions_handler.h b/ios/chrome/browser/ui/toolbar/buttons/toolbar_button_actions_handler.h index 7a086ab0..62856962 100644 --- a/ios/chrome/browser/ui/toolbar/buttons/toolbar_button_actions_handler.h +++ b/ios/chrome/browser/ui/toolbar/buttons/toolbar_button_actions_handler.h
@@ -10,15 +10,17 @@ @protocol ApplicationCommands; @protocol BrowserCommands; @protocol FindInPageCommands; -@protocol OmniboxFocuser; +@protocol OmniboxCommands; // Handler for the actions associated with the different toolbar buttons. @interface ToolbarButtonActionsHandler : NSObject // Dispatcher for the actions. -@property(nonatomic, weak) - id<ApplicationCommands, BrowserCommands, FindInPageCommands, OmniboxFocuser> - dispatcher; +@property(nonatomic, weak) id<ApplicationCommands, + BrowserCommands, + FindInPageCommands, + OmniboxCommands> + dispatcher; // Whether this handler is created in incognito. @property(nonatomic, assign) BOOL incognito;
diff --git a/ios/chrome/browser/ui/toolbar/buttons/toolbar_button_actions_handler.mm b/ios/chrome/browser/ui/toolbar/buttons/toolbar_button_actions_handler.mm index 96c687f8..332fdf86 100644 --- a/ios/chrome/browser/ui/toolbar/buttons/toolbar_button_actions_handler.mm +++ b/ios/chrome/browser/ui/toolbar/buttons/toolbar_button_actions_handler.mm
@@ -11,9 +11,9 @@ #import "ios/chrome/browser/ui/commands/application_commands.h" #import "ios/chrome/browser/ui/commands/browser_commands.h" #import "ios/chrome/browser/ui/commands/find_in_page_commands.h" +#import "ios/chrome/browser/ui/commands/omnibox_commands.h" #import "ios/chrome/browser/ui/commands/open_new_tab_command.h" #import "ios/chrome/browser/ui/toolbar/public/features.h" -#import "ios/chrome/browser/ui/toolbar/public/omnibox_focuser.h" #include "url/gurl.h" #if !defined(__has_feature) || !__has_feature(objc_arc)
diff --git a/ios/chrome/browser/ui/toolbar/primary_toolbar_coordinator.mm b/ios/chrome/browser/ui/toolbar/primary_toolbar_coordinator.mm index 2b837db..916d7eb 100644 --- a/ios/chrome/browser/ui/toolbar/primary_toolbar_coordinator.mm +++ b/ios/chrome/browser/ui/toolbar/primary_toolbar_coordinator.mm
@@ -75,7 +75,7 @@ // TODO(crbug.com/1045047): Use HandlerForProtocol after commands protocol // clean up. self.viewController.dispatcher = - static_cast<id<ApplicationCommands, BrowserCommands, OmniboxFocuser>>( + static_cast<id<ApplicationCommands, BrowserCommands, OmniboxCommands>>( self.browser->GetCommandDispatcher()); self.viewController.delegate = self;
diff --git a/ios/chrome/browser/ui/toolbar/primary_toolbar_view_controller.mm b/ios/chrome/browser/ui/toolbar/primary_toolbar_view_controller.mm index eca65ad..10f74c02 100644 --- a/ios/chrome/browser/ui/toolbar/primary_toolbar_view_controller.mm +++ b/ios/chrome/browser/ui/toolbar/primary_toolbar_view_controller.mm
@@ -6,6 +6,7 @@ #include "base/logging.h" #import "ios/chrome/browser/ui/commands/browser_commands.h" +#import "ios/chrome/browser/ui/commands/omnibox_commands.h" #import "ios/chrome/browser/ui/fullscreen/fullscreen_animator.h" #import "ios/chrome/browser/ui/toolbar/adaptive_toolbar_view_controller+subclassing.h" #import "ios/chrome/browser/ui/toolbar/buttons/toolbar_button.h" @@ -14,7 +15,6 @@ #import "ios/chrome/browser/ui/toolbar/buttons/toolbar_tools_menu_button.h" #import "ios/chrome/browser/ui/toolbar/primary_toolbar_view.h" #import "ios/chrome/browser/ui/toolbar/primary_toolbar_view_controller_delegate.h" -#import "ios/chrome/browser/ui/toolbar/public/omnibox_focuser.h" #import "ios/chrome/browser/ui/toolbar/public/toolbar_constants.h" #import "ios/chrome/browser/ui/toolbar/public/toolbar_utils.h" #import "ios/chrome/browser/ui/util/dynamic_type_util.h"
diff --git a/ios/chrome/browser/ui/toolbar/public/BUILD.gn b/ios/chrome/browser/ui/toolbar/public/BUILD.gn index bf7c9cb..773a1395 100644 --- a/ios/chrome/browser/ui/toolbar/public/BUILD.gn +++ b/ios/chrome/browser/ui/toolbar/public/BUILD.gn
@@ -6,7 +6,6 @@ configs += [ "//build/config/compiler:enable_arc" ] sources = [ "fakebox_focuser.h", - "omnibox_focuser.h", "side_swipe_toolbar_interacting.h", "side_swipe_toolbar_snapshot_providing.h", "toolbar_coordinating.h", @@ -21,6 +20,7 @@ "//ios/chrome/browser/ui/fullscreen:ui", "//ios/chrome/browser/ui/ntp", "//ios/chrome/browser/ui/util", + "//ios/components/ui_util", "//ios/public/provider/chrome/browser/voice", ] public_deps = [ ":constants" ]
diff --git a/ios/chrome/browser/ui/toolbar/public/toolbar_utils.mm b/ios/chrome/browser/ui/toolbar/public/toolbar_utils.mm index 3f60006..efa1411 100644 --- a/ios/chrome/browser/ui/toolbar/public/toolbar_utils.mm +++ b/ios/chrome/browser/ui/toolbar/public/toolbar_utils.mm
@@ -5,8 +5,8 @@ #import "ios/chrome/browser/ui/toolbar/public/toolbar_utils.h" #import "ios/chrome/browser/ui/toolbar/public/toolbar_constants.h" -#import "ios/chrome/browser/ui/util/dynamic_type_util.h" #import "ios/chrome/browser/ui/util/uikit_ui_util.h" +#include "ios/components/ui_util/dynamic_type_util.h" #if !defined(__has_feature) || !__has_feature(objc_arc) #error "This file requires ARC support." @@ -37,7 +37,7 @@ } // namespace CGFloat ToolbarClampedFontSizeMultiplier(UIContentSizeCategory category) { - return SystemSuggestedFontSizeMultiplier( + return ui_util::SystemSuggestedFontSizeMultiplier( category, UIContentSizeCategoryLarge, UIContentSizeCategoryAccessibilityExtraLarge); }
diff --git a/ios/chrome/browser/ui/util/BUILD.gn b/ios/chrome/browser/ui/util/BUILD.gn index 31b3363..f0f7969 100644 --- a/ios/chrome/browser/ui/util/BUILD.gn +++ b/ios/chrome/browser/ui/util/BUILD.gn
@@ -128,7 +128,6 @@ sources = [ "CRUILabel+AttributeUtils_unittest.mm", "core_text_util_unittest.mm", - "dynamic_type_util_unittest.mm", "force_touch_long_press_gesture_recognizer_unittest.mm", "label_link_controller_unittest.mm", "label_observer_unittest.mm",
diff --git a/ios/chrome/browser/ui/util/dynamic_type_util.h b/ios/chrome/browser/ui/util/dynamic_type_util.h index 7b919fb9..df88d26 100644 --- a/ios/chrome/browser/ui/util/dynamic_type_util.h +++ b/ios/chrome/browser/ui/util/dynamic_type_util.h
@@ -7,21 +7,6 @@ #import <UIKit/UIKit.h> -// Returns system suggested font size multiplier (e.g. 1.5 if the font size -// should be 50% bigger) for the actual system preferred content size category. -float SystemSuggestedFontSizeMultiplier(); - -// Returns system suggested font size multiplier (e.g. 1.5 if the font size -// should be 50% bigger) for the given |category|. -float SystemSuggestedFontSizeMultiplier(UIContentSizeCategory category); - -// Returns system suggested font size multiplier (e.g. 1.5 if the font size -// should be 50% bigger) for the given |category|. The multiplier is clamped -// between the multipliers associated with |min_category| and |max_category|. -float SystemSuggestedFontSizeMultiplier(UIContentSizeCategory category, - UIContentSizeCategory min_category, - UIContentSizeCategory max_category); - // ******************** // Specific cases utils // ********************
diff --git a/ios/chrome/browser/ui/util/dynamic_type_util.mm b/ios/chrome/browser/ui/util/dynamic_type_util.mm index 7093a0c..ddbe9db 100644 --- a/ios/chrome/browser/ui/util/dynamic_type_util.mm +++ b/ios/chrome/browser/ui/util/dynamic_type_util.mm
@@ -11,54 +11,6 @@ #error "This file requires ARC support." #endif -float SystemSuggestedFontSizeMultiplier() { - return SystemSuggestedFontSizeMultiplier( - UIApplication.sharedApplication.preferredContentSizeCategory); -} - -float SystemSuggestedFontSizeMultiplier(UIContentSizeCategory category) { - // Scaling numbers are calculated by [UIFont - // preferredFontForTextStyle:UIFontTextStyleBody].pointSize, which are [14, - // 15, 16, 17(default), 19, 21, 23, 28, 33, 40, 47, 53]. - static NSDictionary* font_size_map = @{ - UIContentSizeCategoryUnspecified : @1, - UIContentSizeCategoryExtraSmall : @0.82, - UIContentSizeCategorySmall : @0.88, - UIContentSizeCategoryMedium : @0.94, - UIContentSizeCategoryLarge : @1, // system default - UIContentSizeCategoryExtraLarge : @1.12, - UIContentSizeCategoryExtraExtraLarge : @1.24, - UIContentSizeCategoryExtraExtraExtraLarge : @1.35, - UIContentSizeCategoryAccessibilityMedium : @1.65, - UIContentSizeCategoryAccessibilityLarge : @1.94, - UIContentSizeCategoryAccessibilityExtraLarge : @2.35, - UIContentSizeCategoryAccessibilityExtraExtraLarge : @2.76, - UIContentSizeCategoryAccessibilityExtraExtraExtraLarge : @3.12, - }; - NSNumber* font_size = font_size_map[category]; - static dispatch_once_t once_token; - dispatch_once(&once_token, ^{ - // In case there is a new accessibility value, log if there is a value we - // are missing. Use the sharedApplication value as this method can be called - // with an explicit value for the first time. - UMA_HISTOGRAM_BOOLEAN("Accessibility.iOS.NewLargerTextCategory", - !font_size_map[UIApplication.sharedApplication - .preferredContentSizeCategory]); - }); - return font_size ? font_size.floatValue : 1; -} - -float SystemSuggestedFontSizeMultiplier(UIContentSizeCategory category, - UIContentSizeCategory min_category, - UIContentSizeCategory max_category) { - float min_multiplier = SystemSuggestedFontSizeMultiplier(min_category); - float max_multiplier = SystemSuggestedFontSizeMultiplier(max_category); - DCHECK(min_multiplier < max_multiplier); - return std::min( - max_multiplier, - std::max(min_multiplier, SystemSuggestedFontSizeMultiplier(category))); -} - UIFont* LocationBarSteadyViewFont(UIContentSizeCategory currentCategory) { return PreferredFontForTextStyleWithMaxCategory( UIFontTextStyleBody, currentCategory,
diff --git a/ios/chrome/browser/ui/webui/BUILD.gn b/ios/chrome/browser/ui/webui/BUILD.gn index 72650f9..c4ed0b5 100644 --- a/ios/chrome/browser/ui/webui/BUILD.gn +++ b/ios/chrome/browser/ui/webui/BUILD.gn
@@ -113,6 +113,7 @@ "//ios/chrome/browser/ui/webui/translate_internals", "//ios/chrome/common", "//ios/components/webui:provider", + "//ios/components/webui:url_constants", "//ios/components/webui/sync_internals", "//url", ] @@ -142,6 +143,7 @@ "//ios/chrome/browser/ui/omnibox:omnibox_internal", "//ios/chrome/test/app:test_support", "//ios/chrome/test/earl_grey:test_support", + "//ios/components/webui:url_constants", "//ios/testing/earl_grey:earl_grey_support", "//net:test_support", "//ui/base", @@ -168,6 +170,7 @@ "//ios/chrome/app/strings", "//ios/chrome/browser:chrome_url_constants", "//ios/chrome/test/earl_grey:eg_test_support+eg2", + "//ios/components/webui:url_constants", "//ios/testing/earl_grey:eg_test_support+eg2", "//ios/third_party/earl_grey2:test_lib", "//ios/web/public/test:element_selector",
diff --git a/ios/chrome/browser/ui/webui/chrome_web_ui_ios_controller_factory.mm b/ios/chrome/browser/ui/webui/chrome_web_ui_ios_controller_factory.mm index 8ab25d4..e0c34a3 100644 --- a/ios/chrome/browser/ui/webui/chrome_web_ui_ios_controller_factory.mm +++ b/ios/chrome/browser/ui/webui/chrome_web_ui_ios_controller_factory.mm
@@ -31,6 +31,7 @@ #include "ios/chrome/browser/ui/webui/user_actions_ui.h" #include "ios/chrome/browser/ui/webui/version_ui.h" #include "ios/components/webui/sync_internals/sync_internals_ui.h" +#include "ios/components/webui/web_ui_url_constants.h" #include "url/gurl.h" #if !defined(__has_feature) || !__has_feature(objc_arc) @@ -105,7 +106,7 @@ if (url_host == kChromeUIUserActionsHost) return &NewWebUIIOS<UserActionsUI>; if (url_host == kChromeUISyncInternalsHost) - return &NewWebUIIOSWithHost<SyncInternalsUI>; + return &NewWebUIIOS<SyncInternalsUI>; if (url_host == kChromeUITermsHost) return &NewWebUIIOSWithHost<TermsUI>; if (url_host == kChromeUIVersionHost)
diff --git a/ios/chrome/browser/ui/webui/web_ui_egtest.mm b/ios/chrome/browser/ui/webui/web_ui_egtest.mm index c616b03b..67b6db4 100644 --- a/ios/chrome/browser/ui/webui/web_ui_egtest.mm +++ b/ios/chrome/browser/ui/webui/web_ui_egtest.mm
@@ -18,6 +18,7 @@ #import "ios/chrome/test/earl_grey/chrome_earl_grey_ui.h" #import "ios/chrome/test/earl_grey/chrome_matchers.h" #import "ios/chrome/test/earl_grey/chrome_test_case.h" +#include "ios/components/webui/web_ui_url_constants.h" #import "ios/testing/earl_grey/earl_grey_test.h" #include "net/test/embedded_test_server/embedded_test_server.h" #include "ui/base/device_form_factor.h"
diff --git a/ios/chrome/browser/url_loading/BUILD.gn b/ios/chrome/browser/url_loading/BUILD.gn index bf93aec..3f641faf 100644 --- a/ios/chrome/browser/url_loading/BUILD.gn +++ b/ios/chrome/browser/url_loading/BUILD.gn
@@ -42,6 +42,7 @@ "//ios/chrome/browser/web", "//ios/chrome/browser/web_state_list", "//ios/chrome/browser/web_state_list:agents", + "//ios/components/webui:url_constants", "//ios/web/public", "//ui/base", "//url",
diff --git a/ios/chrome/browser/url_loading/url_loading_util.mm b/ios/chrome/browser/url_loading/url_loading_util.mm index 6d4c40cf..60fbc82 100644 --- a/ios/chrome/browser/url_loading/url_loading_util.mm +++ b/ios/chrome/browser/url_loading/url_loading_util.mm
@@ -15,6 +15,7 @@ #include "ios/chrome/browser/sessions/live_tab_context_browser_agent.h" #import "ios/chrome/browser/web/load_timing_tab_helper.h" #import "ios/chrome/browser/web_state_list/web_state_list.h" +#include "ios/components/webui/web_ui_url_constants.h" #import "ios/web/public/web_state.h" #include "net/base/url_util.h" #include "url/gurl.h"
diff --git a/ios/chrome/browser/web/BUILD.gn b/ios/chrome/browser/web/BUILD.gn index a74c2ab..0c56acdb 100644 --- a/ios/chrome/browser/web/BUILD.gn +++ b/ios/chrome/browser/web/BUILD.gn
@@ -52,6 +52,8 @@ "//ios/chrome/browser/ui/fullscreen", "//ios/chrome/browser/ui/util", "//ios/chrome/common/ui/util", + "//ios/components/ui_util", + "//ios/components/webui:url_constants", "//ios/net", "//ios/web", "//ios/web/common", @@ -258,6 +260,7 @@ "//ios/chrome/browser/ui/elements", "//ios/chrome/browser/ui/util", "//ios/chrome/browser/web:feature_flags", + "//ios/components/webui:url_constants", "//ios/public/provider/chrome/browser", "//ios/public/provider/chrome/browser/voice", "//ios/web",
diff --git a/ios/chrome/browser/web/chrome_web_client.mm b/ios/chrome/browser/web/chrome_web_client.mm index 744ccbb..fb83836 100644 --- a/ios/chrome/browser/web/chrome_web_client.mm +++ b/ios/chrome/browser/web/chrome_web_client.mm
@@ -25,6 +25,7 @@ #import "ios/chrome/browser/ui/elements/windowed_container_view.h" #import "ios/chrome/browser/web/error_page_util.h" #include "ios/chrome/browser/web/features.h" +#include "ios/components/webui/web_ui_url_constants.h" #include "ios/public/provider/chrome/browser/browser_url_rewriter_provider.h" #import "ios/public/provider/chrome/browser/chrome_browser_provider.h" #include "ios/public/provider/chrome/browser/chrome_browser_provider.h"
diff --git a/ios/chrome/browser/web/font_size_tab_helper.mm b/ios/chrome/browser/web/font_size_tab_helper.mm index bf06e2f..e2121ab 100644 --- a/ios/chrome/browser/web/font_size_tab_helper.mm +++ b/ios/chrome/browser/web/font_size_tab_helper.mm
@@ -18,7 +18,7 @@ #include "ios/chrome/browser/application_context.h" #include "ios/chrome/browser/browser_state/chrome_browser_state.h" #include "ios/chrome/browser/pref_names.h" -#include "ios/chrome/browser/ui/util/dynamic_type_util.h" +#include "ios/components/ui_util/dynamic_type_util.h" #include "ios/web/public/js_messaging/web_frame.h" #include "ios/web/public/js_messaging/web_frame_util.h" #include "ios/web/public/js_messaging/web_frames_manager.h" @@ -222,8 +222,8 @@ int FontSizeTabHelper::GetFontSize() const { // Multiply by 100 as the web property needs a percentage. - return SystemSuggestedFontSizeMultiplier() * GetCurrentUserZoomMultiplier() * - 100; + return ui_util::SystemSuggestedFontSizeMultiplier() * + GetCurrentUserZoomMultiplier() * 100; } void FontSizeTabHelper::WebStateDestroyed(web::WebState* web_state) {
diff --git a/ios/chrome/browser/web/sad_tab_tab_helper.mm b/ios/chrome/browser/web/sad_tab_tab_helper.mm index 64a7f85..f5077482 100644 --- a/ios/chrome/browser/web/sad_tab_tab_helper.mm +++ b/ios/chrome/browser/web/sad_tab_tab_helper.mm
@@ -20,6 +20,7 @@ #import "ios/chrome/browser/web/features.h" #import "ios/chrome/browser/web/page_placeholder_tab_helper.h" #import "ios/chrome/browser/web/sad_tab_tab_helper_delegate.h" +#include "ios/components/webui/web_ui_url_constants.h" #include "ios/web/public/navigation/navigation_context.h" #import "ios/web/public/navigation/navigation_manager.h" #import "ios/web/public/web_state.h"
diff --git a/ios/chrome/test/BUILD.gn b/ios/chrome/test/BUILD.gn index b6be102..4fb2069230 100644 --- a/ios/chrome/test/BUILD.gn +++ b/ios/chrome/test/BUILD.gn
@@ -52,6 +52,7 @@ "//ios/chrome/browser/browser_state:browser_state_impl", "//ios/chrome/browser/content_settings", "//ios/chrome/browser/prefs:browser_prefs", + "//ios/components/webui:url_constants", "//ios/public/provider/chrome/browser", "//ios/public/provider/chrome/browser:test_support", "//ios/web",
diff --git a/ios/chrome/test/DEPS b/ios/chrome/test/DEPS index 95ffef9..5e4a818 100644 --- a/ios/chrome/test/DEPS +++ b/ios/chrome/test/DEPS
@@ -20,6 +20,7 @@ "+google_apis", "+ios/chrome/app", "+ios/chrome/browser", + "+ios/components/webui", "+ios/public/provider/chrome", "+ios/web/web_state/ui", "+ios/public/test",
diff --git a/ios/chrome/test/app/BUILD.gn b/ios/chrome/test/app/BUILD.gn index 10a7b08..144bb626 100644 --- a/ios/chrome/test/app/BUILD.gn +++ b/ios/chrome/test/app/BUILD.gn
@@ -44,6 +44,7 @@ "//components/metrics", "//components/prefs", "//components/signin/public/base", + "//components/sync/base", "//components/sync/test/fake_server", "//components/sync_device_info", "//google_apis",
diff --git a/ios/chrome/test/app/sync_test_util.h b/ios/chrome/test/app/sync_test_util.h index 6d14005..4bd654f 100644 --- a/ios/chrome/test/app/sync_test_util.h +++ b/ios/chrome/test/app/sync_test_util.h
@@ -40,15 +40,18 @@ NSError** error); // Injects a bookmark into the fake sync server with |url| and |title|. -void InjectBookmarkOnFakeSyncServer(std::string url, std::string title); +void AddBookmarkToFakeSyncServer(std::string url, std::string title); // Injects a legacy bookmark into the fake sync server. The legacy bookmark // means 2015 and earlier, prior to the adoption of GUIDs for originator client // item ID. -void InjectLegacyBookmarkOnFakeSyncServer( - std::string url, - std::string title, - std::string originator_client_item_id); +void AddLegacyBookmarkToFakeSyncServer(std::string url, + std::string title, + std::string originator_client_item_id); + +// Injects user demographics into the fake sync server. +// TODO(crbug.com/1066297): Refactor to remove duplicate code. +void AddUserDemographicsToSyncServer(int birth_year, int gender); // Injects an autofill profile into the fake sync server with |guid| and // |full_name|. @@ -83,11 +86,11 @@ BOOL VerifySessionsOnSyncServer(const std::multiset<std::string>& expected_urls, NSError** error); -// Adds typed URL into HistoryService. -void AddTypedURLOnClient(const GURL& url); +// Adds typed URL to HistoryService. +void AddTypedURLToClient(const GURL& url); -// Injects typed URL to sync FakeServer. -void InjectTypedURLOnFakeSyncServer(const std::string& url); +// Injects a typed URL into the fake sync server. +void AddTypedURLToFakeSyncServer(const std::string& url); // Returns YES if the provided |url| is present (or not) if |expected_present| // is YES (or NO).
diff --git a/ios/chrome/test/app/sync_test_util.mm b/ios/chrome/test/app/sync_test_util.mm index d2a18669..c4608e0a 100644 --- a/ios/chrome/test/app/sync_test_util.mm +++ b/ios/chrome/test/app/sync_test_util.mm
@@ -17,6 +17,7 @@ #include "components/autofill/core/browser/personal_data_manager.h" #include "components/history/core/browser/history_service.h" #include "components/keyed_service/core/service_access_type.h" +#include "components/sync/base/pref_names.h" #include "components/sync/driver/profile_sync_service.h" #include "components/sync/driver/sync_service.h" #include "components/sync/test/fake_server/entity_builder_factory.h" @@ -110,7 +111,6 @@ } int GetNumberOfSyncEntities(syncer::ModelType type) { - DCHECK(gSyncFakeServer); std::unique_ptr<base::DictionaryValue> entities = gSyncFakeServer->GetEntitiesAsDictionaryValue(); @@ -142,19 +142,16 @@ return result == testing::AssertionSuccess(); } -void InjectBookmarkOnFakeSyncServer(std::string url, std::string title) { - DCHECK(gSyncFakeServer); +void AddBookmarkToFakeSyncServer(std::string url, std::string title) { fake_server::EntityBuilderFactory entity_builder_factory; fake_server::BookmarkEntityBuilder bookmark_builder = entity_builder_factory.NewBookmarkEntityBuilder(title); gSyncFakeServer->InjectEntity(bookmark_builder.BuildBookmark(GURL(url))); } -void InjectLegacyBookmarkOnFakeSyncServer( - std::string url, - std::string title, - std::string originator_client_item_id) { - DCHECK(gSyncFakeServer); +void AddLegacyBookmarkToFakeSyncServer(std::string url, + std::string title, + std::string originator_client_item_id) { DCHECK(!base::IsValidGUID(originator_client_item_id)); fake_server::EntityBuilderFactory entity_builder_factory; fake_server::BookmarkEntityBuilder bookmark_builder = @@ -184,9 +181,26 @@ return info_provider->GetLocalDeviceInfo()->guid(); } +void AddUserDemographicsToSyncServer(int birth_year, int gender) { + sync_pb::EntitySpecifics specifics; + specifics.mutable_priority_preference()->mutable_preference()->set_name( + syncer::prefs::kSyncDemographics); + specifics.mutable_priority_preference()->mutable_preference()->set_value( + base::StringPrintf("{\"birth_year\":%d,\"gender\":%d}", birth_year, + gender)); + + std::unique_ptr<syncer::LoopbackServerEntity> entity = + syncer::PersistentUniqueClientEntity::CreateFromSpecificsForTesting( + /*non_unique_name=*/syncer::prefs::kSyncDemographics, + /*client_tag=*/specifics.preference().name(), specifics, + /*creation_time=*/0, + /*last_modified_time=*/0); + + gSyncFakeServer->InjectEntity(std::move(entity)); +} + void AddAutofillProfileToFakeSyncServer(std::string guid, std::string full_name) { - DCHECK(gSyncFakeServer); sync_pb::EntitySpecifics entity_specifics; sync_pb::AutofillProfileSpecifics* autofill_profile = entity_specifics.mutable_autofill_profile(); @@ -201,7 +215,6 @@ } void DeleteAutofillProfileFromFakeSyncServer(std::string guid) { - DCHECK(gSyncFakeServer); std::vector<sync_pb::SyncEntity> autofill_profiles = gSyncFakeServer->GetSyncEntitiesByModelType(syncer::AUTOFILL_PROFILE); std::string entity_id; @@ -265,7 +278,7 @@ return result == testing::AssertionSuccess(); } -void AddTypedURLOnClient(const GURL& url) { +void AddTypedURLToClient(const GURL& url) { ChromeBrowserState* browser_state = chrome_test_util::GetOriginalBrowserState(); history::HistoryService* historyService = @@ -277,8 +290,7 @@ history::SOURCE_BROWSED, false); } -void InjectTypedURLOnFakeSyncServer(const std::string& url) { - DCHECK(gSyncFakeServer); +void AddTypedURLToFakeSyncServer(const std::string& url) { sync_pb::EntitySpecifics entitySpecifics; sync_pb::TypedUrlSpecifics* typedUrl = entitySpecifics.mutable_typed_url(); typedUrl->set_url(url); @@ -355,7 +367,6 @@ } void DeleteTypedUrlFromFakeSyncServer(std::string url) { - DCHECK(gSyncFakeServer); std::vector<sync_pb::SyncEntity> typed_urls = gSyncFakeServer->GetSyncEntitiesByModelType(syncer::TYPED_URLS); std::string entity_id;
diff --git a/ios/chrome/test/earl_grey/BUILD.gn b/ios/chrome/test/earl_grey/BUILD.gn index 018be6a7..044bfa0 100644 --- a/ios/chrome/test/earl_grey/BUILD.gn +++ b/ios/chrome/test/earl_grey/BUILD.gn
@@ -248,6 +248,7 @@ "//components/autofill/core/browser", "//components/browsing_data/core", "//components/content_settings/core/browser", + "//components/metrics:demographic_metrics_provider", "//components/strings", "//components/sync/base", "//components/translate/core/browser", @@ -388,6 +389,7 @@ "//components/autofill/core/browser", "//components/browsing_data/core", "//components/content_settings/core/browser", + "//components/metrics:demographic_metrics_provider", "//components/strings", "//components/sync/base", "//components/translate/core/browser",
diff --git a/ios/chrome/test/earl_grey/chrome_earl_grey.h b/ios/chrome/test/earl_grey/chrome_earl_grey.h index 0e53bae..df06f61 100644 --- a/ios/chrome/test/earl_grey/chrome_earl_grey.h +++ b/ios/chrome/test/earl_grey/chrome_earl_grey.h
@@ -155,6 +155,12 @@ // Stops the sync server. The server should be running when calling this. - (void)stopSync; +// Injects user demographics into the fake sync server. The year is the +// un-noised birth year, and the gender corresponds to the options in +// UserDemographicsProto::Gender. +- (void)addUserDemographicsToSyncServerWithBirthYear:(int)birthYear + gender:(int)gender; + // Clears the autofill profile for the given |GUID|. - (void)clearAutofillProfileWithGUID:(const std::string&)GUID; @@ -479,6 +485,9 @@ // Returns YES if AutofillEnableCompanyName feature is enabled. - (BOOL)isAutofillCompanyNameEnabled WARN_UNUSED_RESULT; +// Returns YES if DemographicMetricsReporting feature is enabled. +- (BOOL)isDemographicMetricsReportingEnabled WARN_UNUSED_RESULT; + // Returns YES if the |launchSwitch| is found in host app launch switches. - (BOOL)appHasLaunchSwitch:(const std::string&)launchSwitch;
diff --git a/ios/chrome/test/earl_grey/chrome_earl_grey.mm b/ios/chrome/test/earl_grey/chrome_earl_grey.mm index 96f185d..33381072 100644 --- a/ios/chrome/test/earl_grey/chrome_earl_grey.mm +++ b/ios/chrome/test/earl_grey/chrome_earl_grey.mm
@@ -621,6 +621,13 @@ [ChromeEarlGreyAppInterface stopSync]; } +- (void)addUserDemographicsToSyncServerWithBirthYear:(int)birthYear + gender:(int)gender { + [ChromeEarlGreyAppInterface + addUserDemographicsToSyncServerWithBirthYear:birthYear + gender:gender]; +} + - (void)clearAutofillProfileWithGUID:(const std::string&)UTF8GUID { NSString* GUID = base::SysUTF8ToNSString(UTF8GUID); [ChromeEarlGreyAppInterface clearAutofillProfileWithGUID:GUID]; @@ -847,6 +854,10 @@ return [ChromeEarlGreyAppInterface isAutofillCompanyNameEnabled]; } +- (BOOL)isDemographicMetricsReportingEnabled { + return [ChromeEarlGreyAppInterface isDemographicMetricsReportingEnabled]; +} + - (BOOL)appHasLaunchSwitch:(const std::string&)launchSwitch { return [ChromeEarlGreyAppInterface appHasLaunchSwitch:base::SysUTF8ToNSString(launchSwitch)];
diff --git a/ios/chrome/test/earl_grey/chrome_earl_grey_app_interface.h b/ios/chrome/test/earl_grey/chrome_earl_grey_app_interface.h index 72d539e..cbf344e 100644 --- a/ios/chrome/test/earl_grey/chrome_earl_grey_app_interface.h +++ b/ios/chrome/test/earl_grey/chrome_earl_grey_app_interface.h
@@ -229,21 +229,6 @@ // Returns the size of the current WebState's web view. + (CGSize)webStateWebViewSize; -#pragma mark - Sync Utilities (EG2) - -// Clears the autofill profile for the given |GUID|. -+ (void)clearAutofillProfileWithGUID:(NSString*)GUID; - -// Injects an autofill profile into the fake sync server with |GUID| and -// |full_name|. -+ (void)addAutofillProfileToFakeSyncServerWithGUID:(NSString*)GUID - autofillProfileName:(NSString*)fullName; - -// Returns YES if there is an autofilll profile with the corresponding |GUID| -// and |full_name|. -+ (BOOL)isAutofillProfilePresentWithGUID:(NSString*)GUID - autofillProfileName:(NSString*)fullName; - #pragma mark - Bookmarks Utilities (EG2) // Waits for the bookmark internal state to be done loading. @@ -320,6 +305,25 @@ // Triggers a sync cycle for a |type|. + (void)triggerSyncCycleForType:(syncer::ModelType)type; +// Injects user demographics into the fake sync server. The year is the +// un-noised birth year, and the gender corresponds to the options in +// UserDemographicsProto::Gender.. ++ (void)addUserDemographicsToSyncServerWithBirthYear:(int)birthYear + gender:(int)gender; + +// Clears the autofill profile for the given |GUID|. ++ (void)clearAutofillProfileWithGUID:(NSString*)GUID; + +// Injects an autofill profile into the fake sync server with |GUID| and +// |full_name|. ++ (void)addAutofillProfileToFakeSyncServerWithGUID:(NSString*)GUID + autofillProfileName:(NSString*)fullName; + +// Returns YES if there is an autofilll profile with the corresponding |GUID| +// and |full_name|. ++ (BOOL)isAutofillProfilePresentWithGUID:(NSString*)GUID + autofillProfileName:(NSString*)fullName; + // Deletes an autofill profile from the fake sync server with |GUID|, if it // exists. If it doesn't exist, nothing is done. + (void)deleteAutofillProfileFromFakeSyncServerWithGUID:(NSString*)GUID; @@ -384,6 +388,9 @@ // Returns YES if AutofillEnableCompanyName feature is enabled. + (BOOL)isAutofillCompanyNameEnabled WARN_UNUSED_RESULT; +// Returns YES if DemographicMetricsReporting feature is enabled. ++ (BOOL)isDemographicMetricsReportingEnabled WARN_UNUSED_RESULT; + // Returns YES if the |launchSwitch| is found in host app launch switches. + (BOOL)appHasLaunchSwitch:(NSString*)launchSwitch;
diff --git a/ios/chrome/test/earl_grey/chrome_earl_grey_app_interface.mm b/ios/chrome/test/earl_grey/chrome_earl_grey_app_interface.mm index 21f742d..6ef32ff 100644 --- a/ios/chrome/test/earl_grey/chrome_earl_grey_app_interface.mm +++ b/ios/chrome/test/earl_grey/chrome_earl_grey_app_interface.mm
@@ -13,6 +13,7 @@ #include "components/autofill/core/common/autofill_features.h" #include "components/browsing_data/core/pref_names.h" #include "components/content_settings/core/browser/host_content_settings_map.h" +#include "components/metrics/demographic_metrics_provider.h" #include "components/prefs/pref_service.h" #import "components/ukm/ios/features.h" #include "components/variations/variations_associated_data.h" @@ -425,27 +426,6 @@ return [web_state->GetWebViewProxy() bounds].size; } -#pragma mark - Sync Utilities (EG2) - -+ (void)clearAutofillProfileWithGUID:(NSString*)GUID { - std::string utfGUID = base::SysNSStringToUTF8(GUID); - chrome_test_util::ClearAutofillProfile(utfGUID); -} - -+ (void)addAutofillProfileToFakeSyncServerWithGUID:(NSString*)GUID - autofillProfileName:(NSString*)fullName { - std::string utfGUID = base::SysNSStringToUTF8(GUID); - std::string utfFullName = base::SysNSStringToUTF8(fullName); - chrome_test_util::AddAutofillProfileToFakeSyncServer(utfGUID, utfFullName); -} - -+ (BOOL)isAutofillProfilePresentWithGUID:(NSString*)GUID - autofillProfileName:(NSString*)fullName { - std::string utfGUID = base::SysNSStringToUTF8(GUID); - std::string utfFullName = base::SysNSStringToUTF8(fullName); - return chrome_test_util::IsAutofillProfilePresent(utfGUID, utfFullName); -} - #pragma mark - Bookmarks Utilities (EG2) + (NSError*)waitForBookmarksToFinishinLoading { @@ -482,26 +462,25 @@ } + (void)addFakeSyncServerBookmarkWithURL:(NSString*)URL title:(NSString*)title { - chrome_test_util::InjectBookmarkOnFakeSyncServer( - base::SysNSStringToUTF8(URL), base::SysNSStringToUTF8(title)); + chrome_test_util::AddBookmarkToFakeSyncServer(base::SysNSStringToUTF8(URL), + base::SysNSStringToUTF8(title)); } + (void)addFakeSyncServerLegacyBookmarkWithURL:(NSString*)URL title:(NSString*)title originator_client_item_id: (NSString*)originator_client_item_id { - chrome_test_util::InjectLegacyBookmarkOnFakeSyncServer( + chrome_test_util::AddLegacyBookmarkToFakeSyncServer( base::SysNSStringToUTF8(URL), base::SysNSStringToUTF8(title), base::SysNSStringToUTF8(originator_client_item_id)); } + (void)addFakeSyncServerTypedURL:(NSString*)URL { - chrome_test_util::InjectTypedURLOnFakeSyncServer( - base::SysNSStringToUTF8(URL)); + chrome_test_util::AddTypedURLToFakeSyncServer(base::SysNSStringToUTF8(URL)); } + (void)addHistoryServiceTypedURL:(NSString*)URL { - chrome_test_util::AddTypedURLOnClient(GURL(base::SysNSStringToUTF8(URL))); + chrome_test_util::AddTypedURLToClient(GURL(base::SysNSStringToUTF8(URL))); } + (void)deleteHistoryServiceTypedURL:(NSString*)URL { @@ -521,6 +500,30 @@ chrome_test_util::TriggerSyncCycle(type); } ++ (void)addUserDemographicsToSyncServerWithBirthYear:(int)birthYear + gender:(int)gender { + chrome_test_util::AddUserDemographicsToSyncServer(birthYear, gender); +} + ++ (void)clearAutofillProfileWithGUID:(NSString*)GUID { + std::string utfGUID = base::SysNSStringToUTF8(GUID); + chrome_test_util::ClearAutofillProfile(utfGUID); +} + ++ (void)addAutofillProfileToFakeSyncServerWithGUID:(NSString*)GUID + autofillProfileName:(NSString*)fullName { + std::string utfGUID = base::SysNSStringToUTF8(GUID); + std::string utfFullName = base::SysNSStringToUTF8(fullName); + chrome_test_util::AddAutofillProfileToFakeSyncServer(utfGUID, utfFullName); +} + ++ (BOOL)isAutofillProfilePresentWithGUID:(NSString*)GUID + autofillProfileName:(NSString*)fullName { + std::string utfGUID = base::SysNSStringToUTF8(GUID); + std::string utfFullName = base::SysNSStringToUTF8(fullName); + return chrome_test_util::IsAutofillProfilePresent(utfGUID, utfFullName); +} + + (void)deleteAutofillProfileFromFakeSyncServerWithGUID:(NSString*)GUID { chrome_test_util::DeleteAutofillProfileFromFakeSyncServer( base::SysNSStringToUTF8(GUID)); @@ -691,6 +694,11 @@ autofill::features::kAutofillEnableCompanyName); } ++ (BOOL)isDemographicMetricsReportingEnabled { + return base::FeatureList::IsEnabled( + metrics::DemographicMetricsProvider::kDemographicMetricsReporting); +} + + (BOOL)appHasLaunchSwitch:(NSString*)launchSwitch { return base::CommandLine::ForCurrentProcess()->HasSwitch( base::SysNSStringToUTF8(launchSwitch));
diff --git a/ios/chrome/test/ios_chrome_unit_test_suite.mm b/ios/chrome/test/ios_chrome_unit_test_suite.mm index 35c9fe34..d298d31 100644 --- a/ios/chrome/test/ios_chrome_unit_test_suite.mm +++ b/ios/chrome/test/ios_chrome_unit_test_suite.mm
@@ -13,6 +13,7 @@ #include "ios/chrome/browser/chrome_paths.h" #include "ios/chrome/browser/chrome_url_constants.h" #include "ios/chrome/test/testing_application_context.h" +#include "ios/components/webui/web_ui_url_constants.h" #import "ios/public/provider/chrome/browser/chrome_browser_provider.h" #include "ios/public/provider/chrome/browser/test_chrome_provider_initializer.h" #import "ios/web/public/web_client.h"
diff --git a/ios/components/BUILD.gn b/ios/components/BUILD.gn index d3b5bed..e974aa0 100644 --- a/ios/components/BUILD.gn +++ b/ios/components/BUILD.gn
@@ -25,6 +25,7 @@ "//base", "//base/test:run_all_unittests", "//ios/components/io_thread:unit_tests", + "//ios/components/ui_util:unit_tests", ] assert_no_deps = ios_assert_no_deps
diff --git a/ios/components/ui_util/BUILD.gn b/ios/components/ui_util/BUILD.gn new file mode 100644 index 0000000..f8a071b --- /dev/null +++ b/ios/components/ui_util/BUILD.gn
@@ -0,0 +1,21 @@ +source_set("ui_util") { + configs += [ "//build/config/compiler:enable_arc" ] + sources = [ + "dynamic_type_util.h", + "dynamic_type_util.mm", + ] + libs = [ "UIKit.framework" ] + deps = [ "//base" ] +} + +source_set("unit_tests") { + configs += [ "//build/config/compiler:enable_arc" ] + testonly = true + sources = [ "dynamic_type_util_unittest.mm" ] + deps = [ + ":ui_util", + "//base", + "//testing/gtest", + "//third_party/ocmock", + ] +}
diff --git a/ios/components/ui_util/dynamic_type_util.h b/ios/components/ui_util/dynamic_type_util.h new file mode 100644 index 0000000..4f7c001 --- /dev/null +++ b/ios/components/ui_util/dynamic_type_util.h
@@ -0,0 +1,29 @@ +// Copyright 2020 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef IOS_COMPONENTS_UI_UTIL_DYNAMIC_TYPE_UTIL_H_ +#define IOS_COMPONENTS_UI_UTIL_DYNAMIC_TYPE_UTIL_H_ + +#import <UIKit/UIKit.h> + +namespace ui_util { + +// Returns system suggested font size multiplier (e.g. 1.5 if the font size +// should be 50% bigger) for the actual system preferred content size category. +float SystemSuggestedFontSizeMultiplier(); + +// Returns system suggested font size multiplier (e.g. 1.5 if the font size +// should be 50% bigger) for the given |category|. +float SystemSuggestedFontSizeMultiplier(UIContentSizeCategory category); + +// Returns system suggested font size multiplier (e.g. 1.5 if the font size +// should be 50% bigger) for the given |category|. The multiplier is clamped +// between the multipliers associated with |min_category| and |max_category|. +float SystemSuggestedFontSizeMultiplier(UIContentSizeCategory category, + UIContentSizeCategory min_category, + UIContentSizeCategory max_category); + +} // namespace ui_util + +#endif // IOS_COMPONENTS_UI_UTIL_DYNAMIC_TYPE_UTIL_H_
diff --git a/ios/components/ui_util/dynamic_type_util.mm b/ios/components/ui_util/dynamic_type_util.mm new file mode 100644 index 0000000..12689d2c --- /dev/null +++ b/ios/components/ui_util/dynamic_type_util.mm
@@ -0,0 +1,63 @@ +// Copyright 2020 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#import "ios/components/ui_util/dynamic_type_util.h" + +#include "base/metrics/histogram_macros.h" + +#if !defined(__has_feature) || !__has_feature(objc_arc) +#error "This file requires ARC support." +#endif + +namespace ui_util { + +float SystemSuggestedFontSizeMultiplier() { + return SystemSuggestedFontSizeMultiplier( + UIApplication.sharedApplication.preferredContentSizeCategory); +} + +float SystemSuggestedFontSizeMultiplier(UIContentSizeCategory category) { + // Scaling numbers are calculated by [UIFont + // preferredFontForTextStyle:UIFontTextStyleBody].pointSize, which are [14, + // 15, 16, 17(default), 19, 21, 23, 28, 33, 40, 47, 53]. + static NSDictionary* font_size_map = @{ + UIContentSizeCategoryUnspecified : @1, + UIContentSizeCategoryExtraSmall : @0.82, + UIContentSizeCategorySmall : @0.88, + UIContentSizeCategoryMedium : @0.94, + UIContentSizeCategoryLarge : @1, // system default + UIContentSizeCategoryExtraLarge : @1.12, + UIContentSizeCategoryExtraExtraLarge : @1.24, + UIContentSizeCategoryExtraExtraExtraLarge : @1.35, + UIContentSizeCategoryAccessibilityMedium : @1.65, + UIContentSizeCategoryAccessibilityLarge : @1.94, + UIContentSizeCategoryAccessibilityExtraLarge : @2.35, + UIContentSizeCategoryAccessibilityExtraExtraLarge : @2.76, + UIContentSizeCategoryAccessibilityExtraExtraExtraLarge : @3.12, + }; + NSNumber* font_size = font_size_map[category]; + static dispatch_once_t once_token; + dispatch_once(&once_token, ^{ + // In case there is a new accessibility value, log if there is a value we + // are missing. Use the sharedApplication value as this method can be called + // with an explicit value for the first time. + UMA_HISTOGRAM_BOOLEAN("Accessibility.iOS.NewLargerTextCategory", + !font_size_map[UIApplication.sharedApplication + .preferredContentSizeCategory]); + }); + return font_size ? font_size.floatValue : 1; +} + +float SystemSuggestedFontSizeMultiplier(UIContentSizeCategory category, + UIContentSizeCategory min_category, + UIContentSizeCategory max_category) { + float min_multiplier = SystemSuggestedFontSizeMultiplier(min_category); + float max_multiplier = SystemSuggestedFontSizeMultiplier(max_category); + DCHECK(min_multiplier < max_multiplier); + return std::min( + max_multiplier, + std::max(min_multiplier, SystemSuggestedFontSizeMultiplier(category))); +} + +} // namespace ui_util
diff --git a/ios/chrome/browser/ui/util/dynamic_type_util_unittest.mm b/ios/components/ui_util/dynamic_type_util_unittest.mm similarity index 97% rename from ios/chrome/browser/ui/util/dynamic_type_util_unittest.mm rename to ios/components/ui_util/dynamic_type_util_unittest.mm index b68e23d..68f5f9d 100644 --- a/ios/chrome/browser/ui/util/dynamic_type_util_unittest.mm +++ b/ios/components/ui_util/dynamic_type_util_unittest.mm
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "ios/chrome/browser/ui/util/dynamic_type_util.h" +#include "ios/components/ui_util/dynamic_type_util.h" #import <UIKit/UIKit.h> @@ -15,6 +15,8 @@ #error "This file requires ARC support." #endif +namespace ui_util { + // Test fixture for DynamicTypeUtil class. class DynamicTypeUtilTest : public PlatformTest { protected: @@ -118,3 +120,5 @@ SystemSuggestedFontSizeMultiplier(UIContentSizeCategoryExtraExtraLarge), multiplier); } + +} // namespace ui_util
diff --git a/ios/components/webui/BUILD.gn b/ios/components/webui/BUILD.gn index 191b2183e..639c14d5 100644 --- a/ios/components/webui/BUILD.gn +++ b/ios/components/webui/BUILD.gn
@@ -5,3 +5,10 @@ source_set("provider") { sources = [ "web_ui_provider.h" ] } + +source_set("url_constants") { + sources = [ + "web_ui_url_constants.cc", + "web_ui_url_constants.h", + ] +}
diff --git a/ios/components/webui/sync_internals/BUILD.gn b/ios/components/webui/sync_internals/BUILD.gn index a725efe6..40a88be 100644 --- a/ios/components/webui/sync_internals/BUILD.gn +++ b/ios/components/webui/sync_internals/BUILD.gn
@@ -18,6 +18,7 @@ "//components/sync/driver:resources", "//components/version_info:version_info", "//ios/components/webui:provider", + "//ios/components/webui:url_constants", "//ios/web/public", "//ios/web/public/thread", "//ios/web/public/webui",
diff --git a/ios/components/webui/sync_internals/sync_internals_ui.h b/ios/components/webui/sync_internals/sync_internals_ui.h index a03bff8..95ca2c4c 100644 --- a/ios/components/webui/sync_internals/sync_internals_ui.h +++ b/ios/components/webui/sync_internals/sync_internals_ui.h
@@ -17,7 +17,7 @@ // The implementation for the chrome://sync-internals page. class SyncInternalsUI : public web::WebUIIOSController { public: - explicit SyncInternalsUI(web::WebUIIOS* web_ui, const std::string& host); + explicit SyncInternalsUI(web::WebUIIOS* web_ui); ~SyncInternalsUI() override; private:
diff --git a/ios/components/webui/sync_internals/sync_internals_ui.mm b/ios/components/webui/sync_internals/sync_internals_ui.mm index 80e30630..614baa7 100644 --- a/ios/components/webui/sync_internals/sync_internals_ui.mm +++ b/ios/components/webui/sync_internals/sync_internals_ui.mm
@@ -9,6 +9,7 @@ #include "components/grit/sync_driver_resources.h" #include "components/sync/driver/about_sync_util.h" #include "ios/components/webui/sync_internals/sync_internals_message_handler.h" +#include "ios/components/webui/web_ui_url_constants.h" #include "ios/web/public/browser_state.h" #include "ios/web/public/web_state.h" #include "ios/web/public/webui/web_ui_ios.h" @@ -20,9 +21,9 @@ namespace { -web::WebUIIOSDataSource* CreateSyncInternalsHTMLSource( - const std::string& host) { - web::WebUIIOSDataSource* source = web::WebUIIOSDataSource::Create(host); +web::WebUIIOSDataSource* CreateSyncInternalsHTMLSource() { + web::WebUIIOSDataSource* source = + web::WebUIIOSDataSource::Create(kChromeUISyncInternalsHost); source->UseStringsJs(); source->AddResourcePath(syncer::sync_ui_util::kSyncIndexJS, @@ -55,10 +56,10 @@ } // namespace -SyncInternalsUI::SyncInternalsUI(web::WebUIIOS* web_ui, const std::string& host) +SyncInternalsUI::SyncInternalsUI(web::WebUIIOS* web_ui) : web::WebUIIOSController(web_ui) { web::WebUIIOSDataSource::Add(web_ui->GetWebState()->GetBrowserState(), - CreateSyncInternalsHTMLSource(host)); + CreateSyncInternalsHTMLSource()); web_ui->AddMessageHandler(std::make_unique<SyncInternalsMessageHandler>()); }
diff --git a/ios/components/webui/web_ui_url_constants.cc b/ios/components/webui/web_ui_url_constants.cc new file mode 100644 index 0000000..f0a627b1e --- /dev/null +++ b/ios/components/webui/web_ui_url_constants.cc
@@ -0,0 +1,9 @@ +// Copyright 2020 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "ios/components/webui/web_ui_url_constants.h" + +const char kChromeUIScheme[] = "chrome"; + +const char kChromeUISyncInternalsHost[] = "sync-internals";
diff --git a/ios/components/webui/web_ui_url_constants.h b/ios/components/webui/web_ui_url_constants.h new file mode 100644 index 0000000..451f6fa --- /dev/null +++ b/ios/components/webui/web_ui_url_constants.h
@@ -0,0 +1,15 @@ +// Copyright 2020 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef IOS_COMPONENTS_WEBUI_WEB_UI_URL_CONSTANTS_H_ +#define IOS_COMPONENTS_WEBUI_WEB_UI_URL_CONSTANTS_H_ + +// URL scheme for Web UI in iOS. Should be kept in sync with kChromeUIScheme +// defined in content/public/common/url_constants.h +extern const char kChromeUIScheme[]; + +// Hosts for feature specific Web UIs. +extern const char kChromeUISyncInternalsHost[]; + +#endif // IOS_COMPONENTS_WEBUI_WEB_UI_URL_CONSTANTS_H_
diff --git a/ios/web/shell/shell_url_request_context_getter.mm b/ios/web/shell/shell_url_request_context_getter.mm index 82add2fda..c7a02d2 100644 --- a/ios/web/shell/shell_url_request_context_getter.mm +++ b/ios/web/shell/shell_url_request_context_getter.mm
@@ -82,8 +82,8 @@ user_agent)); storage_->set_proxy_resolution_service( net::ConfiguredProxyResolutionService::CreateUsingSystemProxyResolver( - std::move(proxy_config_service_), url_request_context_->net_log(), - /*quick_check_enabled=*/true)); + std::move(proxy_config_service_), /*quick_check_enabled=*/true, + url_request_context_->net_log())); storage_->set_ssl_config_service( std::make_unique<net::SSLConfigServiceDefaults>()); storage_->set_cert_verifier(
diff --git a/ios/web_view/internal/web_view_url_request_context_getter.mm b/ios/web_view/internal/web_view_url_request_context_getter.mm index 5a917b1..a782c371 100644 --- a/ios/web_view/internal/web_view_url_request_context_getter.mm +++ b/ios/web_view/internal/web_view_url_request_context_getter.mm
@@ -91,8 +91,8 @@ user_agent)); storage_->set_proxy_resolution_service( net::ConfiguredProxyResolutionService::CreateUsingSystemProxyResolver( - std::move(proxy_config_service_), url_request_context_->net_log(), - /*quick_check_enabled=*/true)); + std::move(proxy_config_service_), /*quick_check_enabled=*/true, + url_request_context_->net_log())); storage_->set_ssl_config_service( std::make_unique<net::SSLConfigServiceDefaults>()); storage_->set_cert_verifier(
diff --git a/media/filters/gav1_video_decoder.cc b/media/filters/gav1_video_decoder.cc index ebe4ffe8..dbf7acd 100644 --- a/media/filters/gav1_video_decoder.cc +++ b/media/filters/gav1_video_decoder.cc
@@ -376,7 +376,8 @@ libgav1::StatusCode status = libgav1_decoder_->EnqueueFrame( buffer->data(), buffer->data_size(), - buffer->timestamp().InMicroseconds() /* user_private_data */); + buffer->timestamp().InMicroseconds() /* user_private_data */, + /* buffer_private_data = */ nullptr); if (status != kLibgav1StatusOk) { MEDIA_LOG(ERROR, media_log_) << "libgav1::Decoder::EnqueueFrame() failed, "
diff --git a/media/gpu/v4l2/v4l2_device.cc b/media/gpu/v4l2/v4l2_device.cc index aa2282ca..ee5c443 100644 --- a/media/gpu/v4l2/v4l2_device.cc +++ b/media/gpu/v4l2/v4l2_device.cc
@@ -872,8 +872,8 @@ format.fmt.pix_mp.plane_fmt[0].sizeimage = buffer_size; if (device_->Ioctl(VIDIOC_S_FMT, &format) != 0 || format.fmt.pix_mp.pixelformat != fourcc) { - VPQLOGF(2) << "Failed to set format on queue " << type_ - << ". format_fourcc=0x" << std::hex << fourcc; + VPQLOGF(2) << "Failed to set format (format_fourcc=0x" << std::hex << fourcc + << ")"; return base::nullopt; }
diff --git a/media/gpu/v4l2/v4l2_slice_video_decode_accelerator.cc b/media/gpu/v4l2/v4l2_slice_video_decode_accelerator.cc index 128b436..4f9ff1d5 100644 --- a/media/gpu/v4l2/v4l2_slice_video_decode_accelerator.cc +++ b/media/gpu/v4l2/v4l2_slice_video_decode_accelerator.cc
@@ -1576,6 +1576,7 @@ // Duplicate the buffer FDs for the VideoFrame instance. std::vector<base::ScopedFD> duped_fds; + std::vector<ColorPlaneLayout> color_planes; for (const gfx::NativePixmapPlane& plane : handle.planes) { duped_fds.emplace_back(HANDLE_EINTR(dup(plane.fd.get()))); if (!duped_fds.back().is_valid()) { @@ -1583,9 +1584,14 @@ NOTIFY_ERROR(PLATFORM_FAILURE); return; } + color_planes.push_back( + ColorPlaneLayout(base::checked_cast<int32_t>(plane.stride), + base::checked_cast<size_t>(plane.offset), + base::checked_cast<size_t>(plane.size))); } - auto layout = VideoFrameLayout::Create( - gl_image_format_fourcc_->ToVideoPixelFormat(), gl_image_size_); + auto layout = VideoFrameLayout::CreateWithPlanes( + gl_image_format_fourcc_->ToVideoPixelFormat(), gl_image_size_, + std::move(color_planes)); if (!layout) { LOG(ERROR) << "Cannot create layout!"; NOTIFY_ERROR(INVALID_ARGUMENT);
diff --git a/media/gpu/v4l2/v4l2_slice_video_decoder.cc b/media/gpu/v4l2/v4l2_slice_video_decoder.cc index d549fd7..aa5526e 100644 --- a/media/gpu/v4l2/v4l2_slice_video_decoder.cc +++ b/media/gpu/v4l2/v4l2_slice_video_decoder.cc
@@ -232,27 +232,6 @@ return true; } -bool V4L2SliceVideoDecoder::SetCodedSizeOnInputQueue( - const gfx::Size& coded_size) { - struct v4l2_format format = {}; - - format.type = V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE; - if (device_->Ioctl(VIDIOC_G_FMT, &format) != 0) { - VPLOGF(1) << "Failed getting OUTPUT format"; - return false; - } - - format.fmt.pix_mp.width = coded_size.width(); - format.fmt.pix_mp.height = coded_size.height(); - - if (device_->Ioctl(VIDIOC_S_FMT, &format) != 0) { - VPLOGF(1) << "Failed setting OUTPUT format"; - return false; - } - - return true; -} - bool V4L2SliceVideoDecoder::SetupOutputFormat(const gfx::Size& size, const gfx::Rect& visible_rect) { DCHECK_CALLED_ON_VALID_SEQUENCE(decoder_sequence_checker_); @@ -486,8 +465,8 @@ } DCHECK_GT(num_output_frames, 0u); - if (!SetCodedSizeOnInputQueue(pic_size)) { - VLOGF(1) << "Failed to set coded size on input queue"; + if (!backend_->ApplyResolution(pic_size, visible_rect, num_output_frames)) { + SetState(State::kError); return; }
diff --git a/media/gpu/v4l2/v4l2_slice_video_decoder.h b/media/gpu/v4l2/v4l2_slice_video_decoder.h index 85de3b2..801edede 100644 --- a/media/gpu/v4l2/v4l2_slice_video_decoder.h +++ b/media/gpu/v4l2/v4l2_slice_video_decoder.h
@@ -110,10 +110,6 @@ // Setup format for input queue. bool SetupInputFormat(uint32_t input_format_fourcc); - // Set the coded size on the input queue. - // Return true if the successful, false otherwise. - bool SetCodedSizeOnInputQueue(const gfx::Size& size); - // Setup format for output queue. This function sets output format on output // queue that is supported by a v4l2 driver, can be allocatable by // VideoFramePool and can be composited by chrome. This also updates format
diff --git a/media/gpu/v4l2/v4l2_vda_helpers.cc b/media/gpu/v4l2/v4l2_vda_helpers.cc index 12b382f..86d2ccd 100644 --- a/media/gpu/v4l2/v4l2_vda_helpers.cc +++ b/media/gpu/v4l2/v4l2_vda_helpers.cc
@@ -6,10 +6,12 @@ #include "base/bind.h" #include "media/base/color_plane_layout.h" +#include "media/base/video_decoder_config.h" #include "media/gpu/chromeos/fourcc.h" #include "media/gpu/macros.h" #include "media/gpu/v4l2/v4l2_device.h" #include "media/gpu/v4l2/v4l2_image_processor_backend.h" +#include "media/video/h264_parser.h" namespace media { namespace v4l2_vda_helpers { @@ -138,5 +140,128 @@ return gfx::Size(adjusted_coded_width, adjusted_coded_height); } +// static +std::unique_ptr<InputBufferFragmentSplitter> +InputBufferFragmentSplitter::CreateFromProfile( + media::VideoCodecProfile profile) { + switch (VideoCodecProfileToVideoCodec(profile)) { + case kCodecH264: + return std::make_unique< + v4l2_vda_helpers::H264InputBufferFragmentSplitter>(); + case kCodecVP8: + case kCodecVP9: + // VP8/VP9 don't need any frame splitting, use the default implementation. + return std::make_unique<v4l2_vda_helpers::InputBufferFragmentSplitter>(); + default: + LOG(ERROR) << "Unhandled profile: " << profile; + return nullptr; + } +} + +bool InputBufferFragmentSplitter::AdvanceFrameFragment(const uint8_t* data, + size_t size, + size_t* endpos) { + *endpos = size; + return true; +} + +void InputBufferFragmentSplitter::Reset() {} + +bool InputBufferFragmentSplitter::IsPartialFramePending() const { + return false; +} + +H264InputBufferFragmentSplitter::H264InputBufferFragmentSplitter() + : h264_parser_(new H264Parser()) {} + +bool H264InputBufferFragmentSplitter::AdvanceFrameFragment(const uint8_t* data, + size_t size, + size_t* endpos) { + DCHECK(h264_parser_); + + // For H264, we need to feed HW one frame at a time. This is going to take + // some parsing of our input stream. + h264_parser_->SetStream(data, size); + H264NALU nalu; + H264Parser::Result result; + *endpos = 0; + + // Keep on peeking the next NALs while they don't indicate a frame + // boundary. + while (true) { + bool end_of_frame = false; + result = h264_parser_->AdvanceToNextNALU(&nalu); + if (result == H264Parser::kInvalidStream || + result == H264Parser::kUnsupportedStream) { + return false; + } + if (result == H264Parser::kEOStream) { + // We've reached the end of the buffer before finding a frame boundary. + partial_frame_pending_ = true; + *endpos = size; + return true; + } + switch (nalu.nal_unit_type) { + case H264NALU::kNonIDRSlice: + case H264NALU::kIDRSlice: + if (nalu.size < 1) + return false; + + // For these two, if the "first_mb_in_slice" field is zero, start a + // new frame and return. This field is Exp-Golomb coded starting on + // the eighth data bit of the NAL; a zero value is encoded with a + // leading '1' bit in the byte, which we can detect as the byte being + // (unsigned) greater than or equal to 0x80. + if (nalu.data[1] >= 0x80) { + end_of_frame = true; + break; + } + break; + case H264NALU::kSEIMessage: + case H264NALU::kSPS: + case H264NALU::kPPS: + case H264NALU::kAUD: + case H264NALU::kEOSeq: + case H264NALU::kEOStream: + case H264NALU::kReserved14: + case H264NALU::kReserved15: + case H264NALU::kReserved16: + case H264NALU::kReserved17: + case H264NALU::kReserved18: + // These unconditionally signal a frame boundary. + end_of_frame = true; + break; + default: + // For all others, keep going. + break; + } + if (end_of_frame) { + if (!partial_frame_pending_ && *endpos == 0) { + // The frame was previously restarted, and we haven't filled the + // current frame with any contents yet. Start the new frame here and + // continue parsing NALs. + } else { + // The frame wasn't previously restarted and/or we have contents for + // the current frame; signal the start of a new frame here: we don't + // have a partial frame anymore. + partial_frame_pending_ = false; + return true; + } + } + *endpos = (nalu.data + nalu.size) - data; + } + NOTREACHED(); + return false; +} + +void H264InputBufferFragmentSplitter::Reset() { + partial_frame_pending_ = false; + h264_parser_.reset(new H264Parser()); +} + +bool H264InputBufferFragmentSplitter::IsPartialFramePending() const { + return partial_frame_pending_; +} + } // namespace v4l2_vda_helpers } // namespace media
diff --git a/media/gpu/v4l2/v4l2_vda_helpers.h b/media/gpu/v4l2/v4l2_vda_helpers.h index efac751..b0c780c 100644 --- a/media/gpu/v4l2/v4l2_vda_helpers.h +++ b/media/gpu/v4l2/v4l2_vda_helpers.h
@@ -9,6 +9,7 @@ #include "base/memory/scoped_refptr.h" #include "base/optional.h" +#include "media/base/video_codecs.h" #include "media/gpu/chromeos/fourcc.h" #include "media/gpu/chromeos/image_processor.h" #include "ui/gfx/geometry/size.h" @@ -16,6 +17,7 @@ namespace media { class V4L2Device; +class H264Parser; // Helper static methods to be shared between V4L2VideoDecodeAccelerator and // V4L2SliceVideoDecodeAccelerator. This avoids some code duplication between @@ -65,6 +67,51 @@ gfx::Size NativePixmapSizeFromHandle(const gfx::NativePixmapHandle& handle, const Fourcc fourcc, const gfx::Size& current_size); + +// Interface to split an input stream into chunks containing whole frames. +// This default implementation can be used for codecs that do not support frame +// splitting (like VP8 or VP9), whereas codecs that use slices can inherit +// and specialize it. +class InputBufferFragmentSplitter { + public: + static std::unique_ptr<InputBufferFragmentSplitter> CreateFromProfile( + media::VideoCodecProfile profile); + + explicit InputBufferFragmentSplitter() = default; + virtual ~InputBufferFragmentSplitter() = default; + + // Advance to the next fragment that begins a frame. + virtual bool AdvanceFrameFragment(const uint8_t* data, + size_t size, + size_t* endpos); + + virtual void Reset(); + + // Returns true if we may currently be in the middle of a frame (e.g. we + // haven't yet parsed all the slices of a multi-slice H.264 frame). + virtual bool IsPartialFramePending() const; +}; + +// Splitter for H.264, making sure to properly report when a partial frame +// may be pending. +class H264InputBufferFragmentSplitter : public InputBufferFragmentSplitter { + public: + explicit H264InputBufferFragmentSplitter(); + + bool AdvanceFrameFragment(const uint8_t* data, + size_t size, + size_t* endpos) override; + void Reset() override; + bool IsPartialFramePending() const override; + + private: + // For H264 decode, hardware requires that we send it frame-sized chunks. + // We'll need to parse the stream. + std::unique_ptr<H264Parser> h264_parser_; + // Set if we have a pending incomplete frame in the input buffer. + bool partial_frame_pending_ = false; +}; + } // namespace v4l2_vda_helpers } // namespace media
diff --git a/media/gpu/v4l2/v4l2_video_decode_accelerator.cc b/media/gpu/v4l2/v4l2_video_decode_accelerator.cc index d593768..7147d9f 100644 --- a/media/gpu/v4l2/v4l2_video_decode_accelerator.cc +++ b/media/gpu/v4l2/v4l2_video_decode_accelerator.cc
@@ -37,7 +37,6 @@ #include "media/gpu/v4l2/v4l2_image_processor_backend.h" #include "media/gpu/v4l2/v4l2_stateful_workaround.h" #include "media/gpu/v4l2/v4l2_vda_helpers.h" -#include "media/video/h264_parser.h" #include "ui/gfx/geometry/rect.h" #include "ui/gfx/native_pixmap_handle.h" #include "ui/gl/gl_context.h" @@ -144,14 +143,12 @@ decoder_cmd_supported_(false), flush_awaiting_last_output_buffer_(false), reset_pending_(false), - decoder_partial_frame_pending_(false), output_dpb_size_(0), picture_clearing_count_(0), device_poll_thread_("V4L2DevicePollThread"), egl_display_(egl_display), get_gl_context_cb_(get_gl_context_cb), make_context_current_cb_(make_context_current_cb), - video_profile_(VIDEO_CODEC_PROFILE_UNKNOWN), input_format_fourcc_(0), weak_this_factory_(this) { weak_this_ = weak_this_factory_.GetWeakPtr(); @@ -196,8 +193,6 @@ decode_client_ = client_; } - video_profile_ = config.profile; - // We need the context to be initialized to query extensions. if (make_context_current_cb_) { if (egl_display_ == EGL_NO_DISPLAY) { @@ -260,8 +255,12 @@ if (!config_result) return; - if (config.profile >= H264PROFILE_MIN && config.profile <= H264PROFILE_MAX) { - decoder_h264_parser_.reset(new H264Parser()); + frame_splitter_ = + v4l2_vda_helpers::InputBufferFragmentSplitter::CreateFromProfile( + config.profile); + if (!frame_splitter_) { + NOTIFY_ERROR(INVALID_ARGUMENT); + return; } base::trace_event::MemoryDumpManager::GetInstance()->RegisterDumpProvider( @@ -674,17 +673,9 @@ if (output_mode_ == Config::OutputMode::IMPORT) { DCHECK_GT(handle.planes.size(), 0u); DCHECK(!iter->output_frame); - - auto layout = VideoFrameLayout::Create( - egl_image_format_fourcc_->ToVideoPixelFormat(), egl_image_size_); - if (!layout) { - LOG(ERROR) << "Cannot create layout!"; - NOTIFY_ERROR(INVALID_ARGUMENT); - return; - } - // Duplicate the buffer FDs for the VideoFrame instance. std::vector<base::ScopedFD> duped_fds; + std::vector<ColorPlaneLayout> color_planes; for (const gfx::NativePixmapPlane& plane : handle.planes) { duped_fds.emplace_back(HANDLE_EINTR(dup(plane.fd.get()))); if (!duped_fds.back().is_valid()) { @@ -692,6 +683,18 @@ NOTIFY_ERROR(PLATFORM_FAILURE); return; } + color_planes.push_back( + ColorPlaneLayout(base::checked_cast<int32_t>(plane.stride), + base::checked_cast<size_t>(plane.offset), + base::checked_cast<size_t>(plane.size))); + } + auto layout = VideoFrameLayout::CreateWithPlanes( + egl_image_format_fourcc_->ToVideoPixelFormat(), egl_image_size_, + std::move(color_planes)); + if (!layout) { + LOG(ERROR) << "Cannot create layout!"; + NOTIFY_ERROR(INVALID_ARGUMENT); + return; } iter->output_frame = VideoFrame::WrapExternalDmabufs( @@ -920,7 +923,6 @@ if (schedule_task && AppendToInputFrame(NULL, 0) && FlushInputFrame()) { VLOGF(2) << "enqueued flush buffer"; - decoder_partial_frame_pending_ = false; schedule_task = true; } else { // If we failed to enqueue the empty buffer (due to pipeline @@ -950,7 +952,8 @@ } } - if (!AdvanceFrameFragment(data, data_size, &decoded_size)) { + if (!frame_splitter_->AdvanceFrameFragment(data, data_size, + &decoded_size)) { LOG(ERROR) << "Invalid Stream"; NOTIFY_ERROR(UNREADABLE_INPUT); return; @@ -991,94 +994,6 @@ } } -bool V4L2VideoDecodeAccelerator::AdvanceFrameFragment(const uint8_t* data, - size_t size, - size_t* endpos) { - DCHECK(decoder_thread_.task_runner()->BelongsToCurrentThread()); - - if (video_profile_ >= H264PROFILE_MIN && video_profile_ <= H264PROFILE_MAX) { - // For H264, we need to feed HW one frame at a time. This is going to take - // some parsing of our input stream. - decoder_h264_parser_->SetStream(data, size); - H264NALU nalu; - H264Parser::Result result; - *endpos = 0; - - // Keep on peeking the next NALs while they don't indicate a frame - // boundary. - for (;;) { - bool end_of_frame = false; - result = decoder_h264_parser_->AdvanceToNextNALU(&nalu); - if (result == H264Parser::kInvalidStream || - result == H264Parser::kUnsupportedStream) - return false; - if (result == H264Parser::kEOStream) { - // We've reached the end of the buffer before finding a frame boundary. - decoder_partial_frame_pending_ = true; - *endpos = size; - return true; - } - switch (nalu.nal_unit_type) { - case H264NALU::kNonIDRSlice: - case H264NALU::kIDRSlice: - if (nalu.size < 1) - return false; - // For these two, if the "first_mb_in_slice" field is zero, start a - // new frame and return. This field is Exp-Golomb coded starting on - // the eighth data bit of the NAL; a zero value is encoded with a - // leading '1' bit in the byte, which we can detect as the byte being - // (unsigned) greater than or equal to 0x80. - if (nalu.data[1] >= 0x80) { - end_of_frame = true; - break; - } - break; - case H264NALU::kSEIMessage: - case H264NALU::kSPS: - case H264NALU::kPPS: - case H264NALU::kAUD: - case H264NALU::kEOSeq: - case H264NALU::kEOStream: - case H264NALU::kReserved14: - case H264NALU::kReserved15: - case H264NALU::kReserved16: - case H264NALU::kReserved17: - case H264NALU::kReserved18: - // These unconditionally signal a frame boundary. - end_of_frame = true; - break; - default: - // For all others, keep going. - break; - } - if (end_of_frame) { - if (!decoder_partial_frame_pending_ && *endpos == 0) { - // The frame was previously restarted, and we haven't filled the - // current frame with any contents yet. Start the new frame here and - // continue parsing NALs. - } else { - // The frame wasn't previously restarted and/or we have contents for - // the current frame; signal the start of a new frame here: we don't - // have a partial frame anymore. - decoder_partial_frame_pending_ = false; - return true; - } - } - *endpos = (nalu.data + nalu.size) - data; - } - NOTREACHED(); - return false; - } else { - DCHECK_GE(video_profile_, VP8PROFILE_MIN); - DCHECK_LE(video_profile_, VP9PROFILE_MAX); - // For VP8/9, we can just dump the entire buffer. No fragmentation needed, - // and we never return a partial frame. - *endpos = size; - decoder_partial_frame_pending_ = false; - return true; - } -} - void V4L2VideoDecodeAccelerator::ScheduleDecodeBufferTaskIfNeeded() { DCHECK(decoder_thread_.task_runner()->BelongsToCurrentThread()); @@ -1108,7 +1023,7 @@ return false; // If we only have a partial frame, don't flush and process yet. - if (decoder_partial_frame_pending_) + if (frame_splitter_->IsPartialFramePending()) return true; if (!FlushInputFrame()) @@ -1143,7 +1058,7 @@ // Both of these calls will set kError state if they fail. // Only flush the frame if it's complete. return (AppendToInputFrame(data, size) && - (decoder_partial_frame_pending_ || FlushInputFrame())); + (frame_splitter_->IsPartialFramePending() || FlushInputFrame())); } bool V4L2VideoDecodeAccelerator::AppendToInputFrame(const void* data, @@ -1897,16 +1812,12 @@ return; } - // Reset format-specific bits. - if (video_profile_ >= H264PROFILE_MIN && video_profile_ <= H264PROFILE_MAX) { - decoder_h264_parser_.reset(new H264Parser()); - } + frame_splitter_->Reset(); // Jobs drained, we're finished resetting. DCHECK_EQ(decoder_state_, kResetting); decoder_state_ = kInitialized; - decoder_partial_frame_pending_ = false; decoder_delay_bitstream_buffer_id_ = -1; child_task_runner_->PostTask( FROM_HERE, base::BindOnce(&Client::NotifyResetDone, client_)); @@ -1951,7 +1862,7 @@ input_queue_ = nullptr; output_queue_ = nullptr; - decoder_h264_parser_ = nullptr; + frame_splitter_ = nullptr; workarounds_.clear(); // Clear the V4L2 devices in the decoder thread so the V4L2Device's
diff --git a/media/gpu/v4l2/v4l2_video_decode_accelerator.h b/media/gpu/v4l2/v4l2_video_decode_accelerator.h index 82ca519..e4d27c1 100644 --- a/media/gpu/v4l2/v4l2_video_decode_accelerator.h +++ b/media/gpu/v4l2/v4l2_video_decode_accelerator.h
@@ -48,9 +48,12 @@ namespace media { -class H264Parser; class V4L2StatefulWorkaround; +namespace v4l2_vda_helpers { +class InputBufferFragmentSplitter; +} + // This class handles video accelerators directly through a V4L2 device exported // by the hardware blocks. // @@ -218,8 +221,6 @@ // Decode from the buffers queued in decoder_input_queue_. Calls // DecodeBufferInitial() or DecodeBufferContinue() as appropriate. void DecodeBufferTask(); - // Advance to the next fragment that begins a frame. - bool AdvanceFrameFragment(const uint8_t* data, size_t size, size_t* endpos); // Schedule another DecodeBufferTask() if we're behind. void ScheduleDecodeBufferTaskIfNeeded(); @@ -501,17 +502,16 @@ // base::circular_deque because we need to do random access in OnMemoryDump(). base::circular_deque<std::unique_ptr<BitstreamBufferRef>> decoder_input_queue_; - // For H264 decode, hardware requires that we send it frame-sized chunks. - // We'll need to parse the stream. - std::unique_ptr<H264Parser> decoder_h264_parser_; + + // Used to split our input frames at the correct boundary. Only really useful + // for H.264 streams. + std::unique_ptr<v4l2_vda_helpers::InputBufferFragmentSplitter> + frame_splitter_; // Workaround for V4L2VideoDecodeAccelerator. This is created only if some // workaround is necessary for the V4L2VideoDecodeAccelerator. std::vector<std::unique_ptr<V4L2StatefulWorkaround>> workarounds_; - // Set if the decoder has a pending incomplete frame in an input buffer. - bool decoder_partial_frame_pending_; - // // Hardware state and associated queues. Since decoder_thread_ services // the hardware, decoder_thread_ owns these too. @@ -579,9 +579,7 @@ // Callback to set the correct gl context. MakeGLContextCurrentCallback make_context_current_cb_; - // The codec we'll be decoding for. - VideoCodecProfile video_profile_; - // Chosen input format for video_profile_. + // Chosen input format for the video profile we are decoding from. uint32_t input_format_fourcc_; // Chosen output format. base::Optional<Fourcc> output_format_fourcc_;
diff --git a/media/gpu/v4l2/v4l2_video_decoder_backend.h b/media/gpu/v4l2/v4l2_video_decoder_backend.h index 7baba3f96..093df178 100644 --- a/media/gpu/v4l2/v4l2_video_decoder_backend.h +++ b/media/gpu/v4l2/v4l2_video_decoder_backend.h
@@ -75,6 +75,12 @@ // Called whenever the V4L2 stream is stopped (|Streamoff| called on both // |V4L2Queue|s). virtual void OnStreamStopped() = 0; + // Called when the resolution has been decided, in case the backend needs + // to do something specific beyond applying these parameters to the CAPTURE + // queue. + virtual bool ApplyResolution(const gfx::Size& pic_size, + const gfx::Rect& visible_rect, + const size_t num_output_frames) = 0; // Called when ChangeResolution is done. |success| indicates whether there is // any error occurs during the resolution change. virtual void OnChangeResolutionDone(bool success) = 0;
diff --git a/media/gpu/v4l2/v4l2_video_decoder_backend_stateless.cc b/media/gpu/v4l2/v4l2_video_decoder_backend_stateless.cc index d2880a2..3ca859a4 100644 --- a/media/gpu/v4l2/v4l2_video_decoder_backend_stateless.cc +++ b/media/gpu/v4l2/v4l2_video_decoder_backend_stateless.cc
@@ -522,6 +522,31 @@ client_->ChangeResolution(pic_size, visible_rect, num_output_frames); } +bool V4L2StatelessVideoDecoderBackend::ApplyResolution( + const gfx::Size& pic_size, + const gfx::Rect& visible_rect, + const size_t num_output_frames) { + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); + DCHECK_EQ(input_queue_->QueuedBuffersCount(), 0u); + + struct v4l2_format format = {}; + + format.type = V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE; + if (device_->Ioctl(VIDIOC_G_FMT, &format) != 0) { + VPLOGF(1) << "Failed getting OUTPUT format"; + return false; + } + + format.fmt.pix_mp.width = pic_size.width(); + format.fmt.pix_mp.height = pic_size.height(); + if (device_->Ioctl(VIDIOC_S_FMT, &format) != 0) { + VPLOGF(1) << "Failed setting OUTPUT format"; + return false; + } + + return true; +} + void V4L2StatelessVideoDecoderBackend::OnChangeResolutionDone(bool success) { if (!success) { client_->OnBackendError();
diff --git a/media/gpu/v4l2/v4l2_video_decoder_backend_stateless.h b/media/gpu/v4l2/v4l2_video_decoder_backend_stateless.h index baaebdc..0dfa817 100644 --- a/media/gpu/v4l2/v4l2_video_decoder_backend_stateless.h +++ b/media/gpu/v4l2/v4l2_video_decoder_backend_stateless.h
@@ -44,6 +44,9 @@ int32_t bitstream_id) override; void OnOutputBufferDequeued(V4L2ReadableBufferRef buffer) override; void OnStreamStopped() override; + bool ApplyResolution(const gfx::Size& pic_size, + const gfx::Rect& visible_rect, + const size_t num_output_frames) override; void OnChangeResolutionDone(bool success) override; void ClearPendingRequests(DecodeStatus status) override;
diff --git a/media/learning/common/labelled_example_unittest.cc b/media/learning/common/labelled_example_unittest.cc index 1c9e77f..59ef70d 100644 --- a/media/learning/common/labelled_example_unittest.cc +++ b/media/learning/common/labelled_example_unittest.cc
@@ -4,6 +4,8 @@ #include "media/learning/common/labelled_example.h" +#include <algorithm> + #include "testing/gtest/include/gtest/gtest.h" namespace media {
diff --git a/net/BUILD.gn b/net/BUILD.gn index c208dc8..dd1fe1f4 100644 --- a/net/BUILD.gn +++ b/net/BUILD.gn
@@ -448,6 +448,8 @@ "base/http_user_agent_settings.h", "base/ip_pattern.cc", "base/ip_pattern.h", + "base/isolation_info.cc", + "base/isolation_info.h", "base/load_flags.h", "base/load_flags_list.h", "base/load_states.h", @@ -4131,6 +4133,7 @@ "base/ip_address_unittest.cc", "base/ip_endpoint_unittest.cc", "base/ip_pattern_unittest.cc", + "base/isolation_info_unittest.cc", "base/lookup_string_in_fixed_set_unittest.cc", "base/mime_sniffer_unittest.cc", "base/mime_util_unittest.cc",
diff --git a/net/base/isolation_info.cc b/net/base/isolation_info.cc new file mode 100644 index 0000000..38a4b655 --- /dev/null +++ b/net/base/isolation_info.cc
@@ -0,0 +1,212 @@ +// Copyright 2020 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "net/base/isolation_info.h" + +#include "base/logging.h" + +namespace net { + +namespace { + +// Checks that |origin| is consistent with |site_for_cookies|. +bool ValidateSameSite(const url::Origin& origin, + const SiteForCookies& site_for_cookies) { + // If not sending SameSite cookies, or sending them for a non-scheme, consider + // all origins consistent. Note that SiteForCookies should never be created + // for websocket schemes for valid navigations, since frames can't be + // navigated to those schemes. + if (site_for_cookies.IsNull() || + (site_for_cookies.scheme() != url::kHttpScheme && + site_for_cookies.scheme() != url::kHttpsScheme)) { + return true; + } + + // Shouldn't send cookies for opaque origins. + if (origin.opaque()) + return false; + + // TODO(https://crbug.com/1060631): GetURL() is expensive. Maybe make a + // version of IsFirstParty that works on origins? + return site_for_cookies.IsFirstParty(origin.GetURL()); +} + +// Checks if these values are consistent. See IsolationInfo::Create() for +// descriptions of consistent sets of values. Also allows values used by the +// 0-argument constructor. Additionally, |opaque_and_non_transient| can only be +// true if both origins are opaque and |site_for_cookies| is null. +bool IsConsistent(IsolationInfo::RedirectMode redirect_mode, + const base::Optional<url::Origin>& top_frame_origin, + const base::Optional<url::Origin>& frame_origin, + const SiteForCookies& site_for_cookies, + bool opaque_and_non_transient) { + // Check for the default-constructed case. + if (!top_frame_origin) { + return redirect_mode == IsolationInfo::RedirectMode::kUpdateNothing && + !frame_origin && site_for_cookies.IsNull() && + !opaque_and_non_transient; + } + + // |frame_origin| may only be nullopt is |top_frame_origin| is as well. + if (!frame_origin) + return false; + + // As long as there is a |top_frame_origin|, |site_for_cookies| must be + // consistent with the |top_frame_origin|. + if (!ValidateSameSite(*top_frame_origin, site_for_cookies)) + return false; + + if (opaque_and_non_transient) { + return (redirect_mode == IsolationInfo::RedirectMode::kUpdateNothing && + top_frame_origin->opaque() && top_frame_origin == frame_origin && + site_for_cookies.IsNull()); + } + + switch (redirect_mode) { + case IsolationInfo::RedirectMode::kUpdateTopFrame: + // TODO(https://crbug.com/1056706): Check that |top_frame_origin| and + // |frame_origin| are the same, once the ViewSource code creates a + // consistent IsolationInfo object. + // + // TODO(https://crbug.com/1060631): Once CreatePartial() is removed, check + // if SiteForCookies is non-null if the scheme is HTTP or HTTPS. + return true; + case IsolationInfo::RedirectMode::kUpdateFrameOnly: + // For subframe navigations, the subframe's origin may not be consistent + // with the SiteForCookies, so SameSite cookies may be sent if there's a + // redirect to main frames site. + return true; + case IsolationInfo::RedirectMode::kUpdateNothing: + // SiteForCookies must consistent with the frame origin as well for + // subresources. + return ValidateSameSite(*frame_origin, site_for_cookies); + } +} + +} // namespace + +IsolationInfo::IsolationInfo() + : IsolationInfo(RedirectMode::kUpdateNothing, + base::nullopt, + base::nullopt, + SiteForCookies(), + false /* opaque_and_non_transient */) {} + +IsolationInfo::IsolationInfo(const IsolationInfo&) = default; +IsolationInfo::IsolationInfo(IsolationInfo&&) = default; +IsolationInfo::~IsolationInfo() = default; +IsolationInfo& IsolationInfo::operator=(const IsolationInfo&) = default; +IsolationInfo& IsolationInfo::operator=(IsolationInfo&&) = default; + +IsolationInfo IsolationInfo::CreateForInternalRequest( + const url::Origin& top_frame_origin) { + return IsolationInfo(RedirectMode::kUpdateNothing, top_frame_origin, + top_frame_origin, + SiteForCookies::FromOrigin(top_frame_origin), + false /* opaque_and_non_transient */); +} + +IsolationInfo IsolationInfo::CreateTransient() { + return CreateForInternalRequest(url::Origin()); +} + +IsolationInfo IsolationInfo::CreateOpaqueAndNonTransient() { + url::Origin opaque_origin; + return IsolationInfo(RedirectMode::kUpdateNothing, opaque_origin, + opaque_origin, SiteForCookies(), + true /* opaque_and_non_transient */); +} + +IsolationInfo IsolationInfo::Create(RedirectMode redirect_mode, + const url::Origin& top_frame_origin, + const url::Origin& frame_origin, + const SiteForCookies& site_for_cookies) { + return IsolationInfo(redirect_mode, top_frame_origin, frame_origin, + site_for_cookies, false /* opaque_and_non_transient */); +} + +IsolationInfo IsolationInfo::CreatePartial( + RedirectMode redirect_mode, + const net::NetworkIsolationKey& network_isolation_key) { + if (!network_isolation_key.IsFullyPopulated()) + return IsolationInfo(); + + url::Origin top_frame_origin = *network_isolation_key.GetTopFrameOrigin(); + url::Origin frame_origin; + if (network_isolation_key.GetFrameOrigin().has_value()) { + frame_origin = *network_isolation_key.GetFrameOrigin(); + } else if (redirect_mode == RedirectMode::kUpdateTopFrame) { + frame_origin = top_frame_origin; + } else { + frame_origin = url::Origin(); + } + + bool opaque_and_non_transient = top_frame_origin.opaque() && + frame_origin.opaque() && + !network_isolation_key.IsTransient(); + + return IsolationInfo(redirect_mode, top_frame_origin, frame_origin, + SiteForCookies(), opaque_and_non_transient); +} + +base::Optional<IsolationInfo> IsolationInfo::CreateIfConsistent( + RedirectMode redirect_mode, + const base::Optional<url::Origin>& top_frame_origin, + const base::Optional<url::Origin>& frame_origin, + const SiteForCookies& site_for_cookies, + bool opaque_and_non_transient) { + if (!IsConsistent(redirect_mode, top_frame_origin, frame_origin, + site_for_cookies, opaque_and_non_transient)) { + return base::nullopt; + } + return IsolationInfo(redirect_mode, top_frame_origin, frame_origin, + site_for_cookies, opaque_and_non_transient); +} + +IsolationInfo IsolationInfo::CreateForRedirect( + const url::Origin& new_origin) const { + if (redirect_mode_ == RedirectMode::kUpdateNothing) + return *this; + + if (redirect_mode_ == RedirectMode::kUpdateFrameOnly) { + return IsolationInfo(redirect_mode_, top_frame_origin_, new_origin, + site_for_cookies_, opaque_and_non_transient_); + } + + DCHECK_EQ(RedirectMode::kUpdateTopFrame, redirect_mode_); + return IsolationInfo(redirect_mode_, new_origin, new_origin, + SiteForCookies::FromOrigin(new_origin), + opaque_and_non_transient_); +} + +bool IsolationInfo::IsEqualForTesting(const IsolationInfo& other) const { + return (redirect_mode_ == other.redirect_mode_ && + top_frame_origin_ == other.top_frame_origin_ && + frame_origin_ == other.frame_origin_ && + network_isolation_key_ == other.network_isolation_key_ && + opaque_and_non_transient_ == other.opaque_and_non_transient_ && + site_for_cookies_.IsEquivalent(other.site_for_cookies_)); +} + +IsolationInfo::IsolationInfo( + RedirectMode redirect_mode, + const base::Optional<url::Origin>& top_frame_origin, + const base::Optional<url::Origin>& frame_origin, + const SiteForCookies& site_for_cookies, + bool opaque_and_non_transient) + : redirect_mode_(redirect_mode), + top_frame_origin_(top_frame_origin), + frame_origin_(frame_origin), + network_isolation_key_( + !top_frame_origin ? NetworkIsolationKey() + : NetworkIsolationKey(*top_frame_origin, + *frame_origin, + opaque_and_non_transient)), + site_for_cookies_(site_for_cookies), + opaque_and_non_transient_(opaque_and_non_transient) { + DCHECK(IsConsistent(redirect_mode_, top_frame_origin_, frame_origin_, + site_for_cookies_, opaque_and_non_transient_)); +} + +} // namespace net
diff --git a/net/base/isolation_info.h b/net/base/isolation_info.h new file mode 100644 index 0000000..7ad885b7e3 --- /dev/null +++ b/net/base/isolation_info.h
@@ -0,0 +1,185 @@ +// Copyright 2020 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef NET_BASE_ISOLATION_INFO_H_ +#define NET_BASE_ISOLATION_INFO_H_ + +#include "base/optional.h" +#include "net/base/net_export.h" +#include "net/base/network_isolation_key.h" +#include "net/cookies/site_for_cookies.h" +#include "url/origin.h" + +namespace net { + +// Class to store information about network stack requests based on the context +// in which they are made. It provides NetworkIsolationKeys, used to shard +// storage, and SiteForCookies, used determine when to send same site cookies. +// The IsolationInfo is typically the same for all subresource requests made in +// the context of the same frame, but may be different for different frames +// within a page. The IsolationInfo associated with requests for frames may +// change as redirects are followed, and this class also contains the logic on +// how to do that. +// +// The SiteForCookies logic in this class is currently unused, but will +// eventually replace the logic in URLRequest/RedirectInfo for tracking and +// updating that value. +class NET_EXPORT IsolationInfo { + public: + // The update-on-redirect patterns. + // + // In general, almost everything should use kUpdateNothing, as a + // kUpdateTopFrame request accidentally sent or redirected to an attacker + // allows cross-site tracking, and kUpdateFrameOnly allows information + // leaks between sites that iframe each other. Anything that uses + // kUpdateTopFrame should be user triggered and user visible, like a main + // frame navigation or downloads. + // + // The RedirectMode is a core part of an IsolationInfo, and using an + // IsolationInfo with one value to create an IsolationInfo with another + // RedirectMode is generally not a good idea, unless the RedirectMode of the + // new IsolationInfo is kUpdateNothing. + enum class RedirectMode { + // Update top level origin, frame origin, and SiteForCookies on redirect. + // These requests allow users to be recognized across sites on redirect, so + // should not generally be used for anything other than navigations. + kUpdateTopFrame, + + // Only update frame origin on redirect. + kUpdateFrameOnly, + + // Update nothing on redirect. + kUpdateNothing, + }; + + // Default constructor returns an IsolationInfo with empty origins, a null + // SiteForCookies(), and a RedirectMode of kUpdateNothing. + IsolationInfo(); + IsolationInfo(const IsolationInfo&); + IsolationInfo(IsolationInfo&&); + ~IsolationInfo(); + + IsolationInfo& operator=(const IsolationInfo&); + IsolationInfo& operator=(IsolationInfo&&); + + // Simple constructor for internal requests. Sets |frame_origin| and + // |site_for_cookies| match |top_frame_origin|. Sets |redirect_mode| to + // kUpdateNothing. Will only send SameSite cookies to the site associated with + // the passed in origin. + static IsolationInfo CreateForInternalRequest( + const url::Origin& top_frame_origin); + + // Creates a transient IsolationInfo. A transient IsolationInfo will not save + // data to disk and not send SameSite cookies. Equivalent to calling + // CreateForInternalRequest with a fresh opaque origin. + static IsolationInfo CreateTransient(); + + // Creates a non-transient IsolationInfo. Just like a transient IsolationInfo + // (no SameSite cookies, opaque Origins), but does write data to disk, so this + // allows use of the disk cache with a transient NIK. + static IsolationInfo CreateOpaqueAndNonTransient(); + + // Creates an IsolationInfo with the provided parameters. If the parameters + // are inconsistent, DCHECKs. In particular: + // * If |redirect_mode| is kUpdateTopFrame, |top_frame_origin| must equal + // |frame_origin|, and |site_for_cookies| must be either null or first party + // with respect to them. + // * If |redirect_mode| is kUpdateFrameOnly, |top_frame_origin| must be + // first party with respect to |site_for_cookies|, or |site_for_cookies| + // must be null. + // * If |redirect_mode| is kUpdateNothing, |top_frame_origin| and + // |frame_origin| must be first party with respect to |site_for_cookies|, or + // |site_for_cookies| must be null. + // + // Note that the |site_for_cookies| consistency checks are skipped when + // |site_for_cookies| is not HTTP/HTTPS. + static IsolationInfo Create(RedirectMode redirect_mode, + const url::Origin& top_frame_origin, + const url::Origin& frame_origin, + const SiteForCookies& site_for_cookies); + + // Create an IsolationInfos that may not be fully correct - in particular, + // the SiteForCookies will always set to null, and if the NetworkIsolationKey + // only has a top frame origin, the frame origin will either be set to the top + // frame origin, in the kUpdateTopFrame case, or be replaced by an opaque + // origin in all other cases. If the NetworkIsolationKey is not fully + // populated, will create an empty IsolationInfo. This is intended for use + // while transitioning from NIKs being set on only some requests to + // IsolationInfos being set on all requests. + // + // TODO(https://crbug.com/1060631): Remove this once no longer needed. + static IsolationInfo CreatePartial( + RedirectMode redirect_mode, + const net::NetworkIsolationKey& network_isolation_key); + + // Returns nullopt if the arguments are not consistent. Otherwise, returns a + // fully populated IsolationInfo. Any IsolationInfo that can be created by + // the other construction methods, including the 0-argument constructor, is + // considered consistent. + // + // Intended for use by cross-process deserialization. + static base::Optional<IsolationInfo> CreateIfConsistent( + RedirectMode redirect_mode, + const base::Optional<url::Origin>& top_frame_origin, + const base::Optional<url::Origin>& frame_origin, + const SiteForCookies& site_for_cookies, + bool opaque_and_non_transient); + + // Create a new IsolationInfo for a redirect to the supplied origin. |this| is + // unmodified. + IsolationInfo CreateForRedirect(const url::Origin& new_origin) const; + + RedirectMode redirect_mode() const { return redirect_mode_; } + + bool IsEmpty() const { return !top_frame_origin_; } + + // These may only be nullopt if created by the empty constructor. If one is + // nullopt, both are, and SiteForCookies is null. + const base::Optional<url::Origin>& top_frame_origin() const { + return top_frame_origin_; + } + const base::Optional<url::Origin>& frame_origin() const { + return frame_origin_; + } + + const NetworkIsolationKey& network_isolation_key() const { + return network_isolation_key_; + } + + // The value that should be consulted for the third-party cookie blocking + // policy, as defined in Section 2.1.1 and 2.1.2 of + // https://tools.ietf.org/html/draft-ietf-httpbis-cookie-same-site. + // + // WARNING: This value must only be used for the third-party cookie blocking + // policy. It MUST NEVER be used for any kind of SECURITY check. + const SiteForCookies& site_for_cookies() const { return site_for_cookies_; } + + bool opaque_and_non_transient() const { return opaque_and_non_transient_; } + + bool IsEqualForTesting(const IsolationInfo& other) const; + + private: + IsolationInfo(RedirectMode redirect_mode, + const base::Optional<url::Origin>& top_frame_origin, + const base::Optional<url::Origin>& frame_origin, + const SiteForCookies& site_for_cookies, + bool opaque_and_non_transient); + + RedirectMode redirect_mode_; + + base::Optional<url::Origin> top_frame_origin_; + base::Optional<url::Origin> frame_origin_; + + // This can be deduced from the two origins above, but keep a cached version + // to avoid repeated eTLD+1 calculations, when this is using eTLD+1. + net::NetworkIsolationKey network_isolation_key_; + + SiteForCookies site_for_cookies_; + + bool opaque_and_non_transient_ = false; +}; + +} // namespace net + +#endif // NET_BASE_ISOLATION_INFO_H_
diff --git a/net/base/isolation_info_unittest.cc b/net/base/isolation_info_unittest.cc new file mode 100644 index 0000000..60c8deb --- /dev/null +++ b/net/base/isolation_info_unittest.cc
@@ -0,0 +1,507 @@ +// Copyright 2020 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "net/base/isolation_info.h" + +#include "base/optional.h" +#include "base/test/scoped_feature_list.h" +#include "net/base/features.h" +#include "net/cookies/site_for_cookies.h" +#include "testing/gtest/include/gtest/gtest.h" +#include "url/gurl.h" +#include "url/origin.h" +#include "url/url_util.h" + +namespace net { + +namespace { + +void DuplicateAndCompare(const IsolationInfo& isolation_info) { + base::Optional<IsolationInfo> duplicate_isolation_info = + IsolationInfo::CreateIfConsistent( + isolation_info.redirect_mode(), isolation_info.top_frame_origin(), + isolation_info.frame_origin(), isolation_info.site_for_cookies(), + isolation_info.opaque_and_non_transient()); + + ASSERT_TRUE(duplicate_isolation_info); + EXPECT_TRUE(isolation_info.IsEqualForTesting(*duplicate_isolation_info)); +} + +class IsolationInfoTest : public testing::Test { + public: + IsolationInfoTest() { + // Only test the case where NIK modifies the top frame origins, since + // IsolationInfo doesn't enforce the flag itself. + feature_list_.InitAndEnableFeature( + features::kUseRegistrableDomainInNetworkIsolationKey); + } + + const url::Origin kOrigin1 = url::Origin::Create(GURL("https://a.foo.test")); + const url::Origin kOrigin2 = url::Origin::Create(GURL("https://b.bar.test")); + const url::Origin kOrigin3 = url::Origin::Create(GURL("https://c.baz.test")); + const url::Origin kOpaqueOrigin; + + base::test::ScopedFeatureList feature_list_; +}; + +TEST_F(IsolationInfoTest, UpdateTopFrame) { + IsolationInfo isolation_info = IsolationInfo::Create( + IsolationInfo::RedirectMode::kUpdateTopFrame, kOrigin1, kOrigin1, + SiteForCookies::FromOrigin(kOrigin1)); + EXPECT_EQ(IsolationInfo::RedirectMode::kUpdateTopFrame, + isolation_info.redirect_mode()); + EXPECT_EQ(kOrigin1, isolation_info.top_frame_origin()); + EXPECT_EQ(kOrigin1, isolation_info.frame_origin()); + EXPECT_TRUE(isolation_info.network_isolation_key().IsFullyPopulated()); + EXPECT_FALSE(isolation_info.network_isolation_key().IsTransient()); + EXPECT_EQ("https://foo.test https://foo.test", + isolation_info.network_isolation_key().ToString()); + EXPECT_TRUE( + isolation_info.site_for_cookies().IsFirstParty(kOrigin1.GetURL())); + EXPECT_FALSE(isolation_info.opaque_and_non_transient()); + + DuplicateAndCompare(isolation_info); + + IsolationInfo redirected_isolation_info = + isolation_info.CreateForRedirect(kOrigin3); + EXPECT_EQ(IsolationInfo::RedirectMode::kUpdateTopFrame, + redirected_isolation_info.redirect_mode()); + EXPECT_EQ(kOrigin3, redirected_isolation_info.top_frame_origin()); + EXPECT_EQ(kOrigin3, redirected_isolation_info.frame_origin()); + EXPECT_TRUE( + redirected_isolation_info.network_isolation_key().IsFullyPopulated()); + EXPECT_FALSE(redirected_isolation_info.network_isolation_key().IsTransient()); + EXPECT_EQ("https://baz.test https://baz.test", + redirected_isolation_info.network_isolation_key().ToString()); + EXPECT_TRUE(redirected_isolation_info.site_for_cookies().IsFirstParty( + kOrigin3.GetURL())); + EXPECT_FALSE(redirected_isolation_info.opaque_and_non_transient()); +} + +TEST_F(IsolationInfoTest, UpdateFrameOnly) { + IsolationInfo isolation_info = IsolationInfo::Create( + IsolationInfo::RedirectMode::kUpdateFrameOnly, kOrigin1, kOrigin2, + SiteForCookies::FromOrigin(kOrigin1)); + EXPECT_EQ(IsolationInfo::RedirectMode::kUpdateFrameOnly, + isolation_info.redirect_mode()); + EXPECT_EQ(kOrigin1, isolation_info.top_frame_origin()); + EXPECT_EQ(kOrigin2, isolation_info.frame_origin()); + EXPECT_TRUE(isolation_info.network_isolation_key().IsFullyPopulated()); + EXPECT_FALSE(isolation_info.network_isolation_key().IsTransient()); + EXPECT_EQ("https://foo.test https://bar.test", + isolation_info.network_isolation_key().ToString()); + EXPECT_TRUE( + isolation_info.site_for_cookies().IsFirstParty(kOrigin1.GetURL())); + EXPECT_FALSE(isolation_info.opaque_and_non_transient()); + + DuplicateAndCompare(isolation_info); + + IsolationInfo redirected_isolation_info = + isolation_info.CreateForRedirect(kOrigin3); + EXPECT_EQ(IsolationInfo::RedirectMode::kUpdateFrameOnly, + redirected_isolation_info.redirect_mode()); + EXPECT_EQ(kOrigin1, redirected_isolation_info.top_frame_origin()); + EXPECT_EQ(kOrigin3, redirected_isolation_info.frame_origin()); + EXPECT_TRUE( + redirected_isolation_info.network_isolation_key().IsFullyPopulated()); + EXPECT_FALSE(redirected_isolation_info.network_isolation_key().IsTransient()); + EXPECT_EQ("https://foo.test https://baz.test", + redirected_isolation_info.network_isolation_key().ToString()); + EXPECT_TRUE(redirected_isolation_info.site_for_cookies().IsFirstParty( + kOrigin1.GetURL())); + EXPECT_FALSE(redirected_isolation_info.opaque_and_non_transient()); +} + +TEST_F(IsolationInfoTest, UpdateNothing) { + IsolationInfo isolation_info; + EXPECT_EQ(IsolationInfo::RedirectMode::kUpdateNothing, + isolation_info.redirect_mode()); + EXPECT_FALSE(isolation_info.top_frame_origin()); + EXPECT_FALSE(isolation_info.frame_origin()); + EXPECT_TRUE(isolation_info.network_isolation_key().IsEmpty()); + EXPECT_TRUE(isolation_info.site_for_cookies().IsNull()); + EXPECT_FALSE(isolation_info.opaque_and_non_transient()); + + DuplicateAndCompare(isolation_info); + + IsolationInfo redirected_isolation_info = + isolation_info.CreateForRedirect(kOrigin3); + EXPECT_TRUE(isolation_info.IsEqualForTesting(redirected_isolation_info)); +} + +TEST_F(IsolationInfoTest, UpdateNothingWithSiteForCookies) { + IsolationInfo isolation_info = IsolationInfo::Create( + IsolationInfo::RedirectMode::kUpdateNothing, kOrigin1, kOrigin1, + SiteForCookies::FromOrigin(kOrigin1)); + EXPECT_EQ(IsolationInfo::RedirectMode::kUpdateNothing, + isolation_info.redirect_mode()); + EXPECT_EQ(kOrigin1, isolation_info.top_frame_origin()); + EXPECT_EQ(kOrigin1, isolation_info.frame_origin()); + EXPECT_TRUE(isolation_info.network_isolation_key().IsFullyPopulated()); + EXPECT_FALSE(isolation_info.network_isolation_key().IsTransient()); + EXPECT_EQ("https://foo.test https://foo.test", + isolation_info.network_isolation_key().ToString()); + EXPECT_TRUE( + isolation_info.site_for_cookies().IsFirstParty(kOrigin1.GetURL())); + EXPECT_FALSE(isolation_info.opaque_and_non_transient()); + + DuplicateAndCompare(isolation_info); + + IsolationInfo redirected_isolation_info = + isolation_info.CreateForRedirect(kOrigin3); + EXPECT_TRUE(isolation_info.IsEqualForTesting(redirected_isolation_info)); +} + +// Test case of a subresource for cross-site subframe (which has an empty +// site-for-cookies). +TEST_F(IsolationInfoTest, UpdateNothingWithEmptySiteForCookies) { + IsolationInfo isolation_info = + IsolationInfo::Create(IsolationInfo::RedirectMode::kUpdateNothing, + kOrigin1, kOrigin2, SiteForCookies()); + EXPECT_EQ(IsolationInfo::RedirectMode::kUpdateNothing, + isolation_info.redirect_mode()); + EXPECT_EQ(kOrigin1, isolation_info.top_frame_origin()); + EXPECT_EQ(kOrigin2, isolation_info.frame_origin()); + EXPECT_TRUE(isolation_info.network_isolation_key().IsFullyPopulated()); + EXPECT_FALSE(isolation_info.network_isolation_key().IsTransient()); + EXPECT_EQ("https://foo.test https://bar.test", + isolation_info.network_isolation_key().ToString()); + EXPECT_TRUE(isolation_info.site_for_cookies().IsNull()); + EXPECT_FALSE(isolation_info.opaque_and_non_transient()); + + DuplicateAndCompare(isolation_info); + + IsolationInfo redirected_isolation_info = + isolation_info.CreateForRedirect(kOrigin3); + EXPECT_TRUE(isolation_info.IsEqualForTesting(redirected_isolation_info)); +} + +TEST_F(IsolationInfoTest, CreateTransient) { + IsolationInfo isolation_info = IsolationInfo::CreateTransient(); + EXPECT_EQ(IsolationInfo::RedirectMode::kUpdateNothing, + isolation_info.redirect_mode()); + EXPECT_TRUE(isolation_info.top_frame_origin()->opaque()); + EXPECT_TRUE(isolation_info.frame_origin()->opaque()); + EXPECT_TRUE(isolation_info.network_isolation_key().IsFullyPopulated()); + EXPECT_TRUE(isolation_info.network_isolation_key().IsTransient()); + EXPECT_TRUE(isolation_info.site_for_cookies().IsNull()); + EXPECT_FALSE(isolation_info.opaque_and_non_transient()); + + DuplicateAndCompare(isolation_info); + + IsolationInfo redirected_isolation_info = + isolation_info.CreateForRedirect(kOrigin3); + EXPECT_TRUE(isolation_info.IsEqualForTesting(redirected_isolation_info)); +} + +TEST_F(IsolationInfoTest, CreateOpaqueAndNonTransient) { + IsolationInfo isolation_info = IsolationInfo::CreateOpaqueAndNonTransient(); + EXPECT_EQ(IsolationInfo::RedirectMode::kUpdateNothing, + isolation_info.redirect_mode()); + EXPECT_TRUE(isolation_info.top_frame_origin()->opaque()); + EXPECT_TRUE(isolation_info.frame_origin()->opaque()); + EXPECT_TRUE(isolation_info.network_isolation_key().IsFullyPopulated()); + EXPECT_FALSE(isolation_info.network_isolation_key().IsTransient()); + EXPECT_TRUE( + isolation_info.network_isolation_key().GetTopFrameOrigin()->opaque()); + EXPECT_TRUE( + isolation_info.network_isolation_key().GetFrameOrigin()->opaque()); + EXPECT_TRUE(isolation_info.site_for_cookies().IsNull()); + EXPECT_TRUE(isolation_info.opaque_and_non_transient()); + + DuplicateAndCompare(isolation_info); + + IsolationInfo redirected_isolation_info = + isolation_info.CreateForRedirect(kOrigin3); + EXPECT_TRUE(isolation_info.IsEqualForTesting(redirected_isolation_info)); +} + +TEST_F(IsolationInfoTest, CreateForInternalRequest) { + IsolationInfo isolation_info = + IsolationInfo::CreateForInternalRequest(kOrigin1); + EXPECT_EQ(IsolationInfo::RedirectMode::kUpdateNothing, + isolation_info.redirect_mode()); + EXPECT_EQ(kOrigin1, isolation_info.top_frame_origin()); + EXPECT_EQ(kOrigin1, isolation_info.frame_origin()); + EXPECT_TRUE(isolation_info.network_isolation_key().IsFullyPopulated()); + EXPECT_FALSE(isolation_info.network_isolation_key().IsTransient()); + EXPECT_EQ("https://foo.test https://foo.test", + isolation_info.network_isolation_key().ToString()); + EXPECT_TRUE( + isolation_info.site_for_cookies().IsFirstParty(kOrigin1.GetURL())); + EXPECT_FALSE(isolation_info.opaque_and_non_transient()); + + DuplicateAndCompare(isolation_info); + + IsolationInfo redirected_isolation_info = + isolation_info.CreateForRedirect(kOrigin3); + EXPECT_TRUE(isolation_info.IsEqualForTesting(redirected_isolation_info)); +} + +TEST_F(IsolationInfoTest, CreatePartialUpdateTopFrame) { + const NetworkIsolationKey kNIK(kOrigin1, kOrigin1); + IsolationInfo isolation_info = IsolationInfo::CreatePartial( + IsolationInfo::RedirectMode::kUpdateTopFrame, kNIK); + EXPECT_EQ(IsolationInfo::RedirectMode::kUpdateTopFrame, + isolation_info.redirect_mode()); + EXPECT_EQ(kOrigin1, isolation_info.top_frame_origin()); + EXPECT_EQ(kOrigin1, isolation_info.frame_origin()); + EXPECT_EQ(kNIK, isolation_info.network_isolation_key()); + EXPECT_TRUE(isolation_info.site_for_cookies().IsNull()); + EXPECT_FALSE(isolation_info.opaque_and_non_transient()); + + DuplicateAndCompare(isolation_info); +} + +TEST_F(IsolationInfoTest, CreatePartialUpdateFrameOnly) { + const NetworkIsolationKey kNIK(kOrigin1, kOrigin2); + IsolationInfo isolation_info = IsolationInfo::CreatePartial( + IsolationInfo::RedirectMode::kUpdateFrameOnly, kNIK); + EXPECT_EQ(IsolationInfo::RedirectMode::kUpdateFrameOnly, + isolation_info.redirect_mode()); + EXPECT_EQ(kOrigin1, isolation_info.top_frame_origin()); + EXPECT_EQ(kOrigin2, isolation_info.frame_origin()); + EXPECT_EQ(kNIK, isolation_info.network_isolation_key()); + EXPECT_TRUE(isolation_info.site_for_cookies().IsNull()); + EXPECT_FALSE(isolation_info.opaque_and_non_transient()); + + DuplicateAndCompare(isolation_info); +} + +TEST_F(IsolationInfoTest, CreatePartialUpdateNothing) { + const NetworkIsolationKey kNIK(kOrigin1, kOrigin2); + IsolationInfo isolation_info = IsolationInfo::CreatePartial( + IsolationInfo::RedirectMode::kUpdateNothing, kNIK); + EXPECT_EQ(IsolationInfo::RedirectMode::kUpdateNothing, + isolation_info.redirect_mode()); + EXPECT_EQ(kOrigin1, isolation_info.top_frame_origin()); + EXPECT_EQ(kOrigin2, isolation_info.frame_origin()); + EXPECT_EQ(kNIK, isolation_info.network_isolation_key()); + EXPECT_TRUE(isolation_info.site_for_cookies().IsNull()); + EXPECT_FALSE(isolation_info.opaque_and_non_transient()); + + DuplicateAndCompare(isolation_info); +} + +TEST_F(IsolationInfoTest, CreatePartialTransient) { + const NetworkIsolationKey kNIK = NetworkIsolationKey::CreateTransient(); + IsolationInfo isolation_info = IsolationInfo::CreatePartial( + IsolationInfo::RedirectMode::kUpdateNothing, kNIK); + EXPECT_EQ(IsolationInfo::RedirectMode::kUpdateNothing, + isolation_info.redirect_mode()); + EXPECT_EQ(*kNIK.GetTopFrameOrigin(), isolation_info.top_frame_origin()); + EXPECT_EQ(*kNIK.GetFrameOrigin(), isolation_info.frame_origin()); + EXPECT_EQ(kNIK, isolation_info.network_isolation_key()); + EXPECT_TRUE(isolation_info.site_for_cookies().IsNull()); + EXPECT_FALSE(isolation_info.opaque_and_non_transient()); + + DuplicateAndCompare(isolation_info); +} + +TEST_F(IsolationInfoTest, CreatePartialOpaqueAndNonTransient) { + const NetworkIsolationKey kNIK = + NetworkIsolationKey::CreateOpaqueAndNonTransient(); + IsolationInfo isolation_info = IsolationInfo::CreatePartial( + IsolationInfo::RedirectMode::kUpdateNothing, kNIK); + EXPECT_EQ(IsolationInfo::RedirectMode::kUpdateNothing, + isolation_info.redirect_mode()); + EXPECT_EQ(*kNIK.GetTopFrameOrigin(), isolation_info.top_frame_origin()); + EXPECT_EQ(*kNIK.GetFrameOrigin(), isolation_info.frame_origin()); + EXPECT_EQ(kNIK, isolation_info.network_isolation_key()); + EXPECT_TRUE(isolation_info.site_for_cookies().IsNull()); + EXPECT_TRUE(isolation_info.opaque_and_non_transient()); + + DuplicateAndCompare(isolation_info); +} + +TEST_F(IsolationInfoTest, CreatePartialEmpty) { + IsolationInfo isolation_info = IsolationInfo::CreatePartial( + IsolationInfo::RedirectMode::kUpdateNothing, NetworkIsolationKey()); + EXPECT_EQ(IsolationInfo::RedirectMode::kUpdateNothing, + isolation_info.redirect_mode()); + EXPECT_FALSE(isolation_info.top_frame_origin()); + EXPECT_FALSE(isolation_info.frame_origin()); + EXPECT_EQ(NetworkIsolationKey(), isolation_info.network_isolation_key()); + EXPECT_TRUE(isolation_info.site_for_cookies().IsNull()); + EXPECT_FALSE(isolation_info.opaque_and_non_transient()); + + DuplicateAndCompare(isolation_info); +} + +TEST_F(IsolationInfoTest, + CreatePartialEmptyNoFrameOriginRedirectModeUpdateTopFrame) { + base::test::ScopedFeatureList feature_list; + feature_list.InitAndDisableFeature( + features::kAppendFrameOriginToNetworkIsolationKey); + + const NetworkIsolationKey kNIK(kOrigin1, kOrigin1); + EXPECT_FALSE(kNIK.GetFrameOrigin()); + IsolationInfo isolation_info = IsolationInfo::CreatePartial( + IsolationInfo::RedirectMode::kUpdateTopFrame, kNIK); + EXPECT_EQ(IsolationInfo::RedirectMode::kUpdateTopFrame, + isolation_info.redirect_mode()); + EXPECT_EQ(kOrigin1, isolation_info.top_frame_origin()); + EXPECT_EQ(kOrigin1, isolation_info.frame_origin()); + EXPECT_EQ(kNIK, isolation_info.network_isolation_key()); + EXPECT_TRUE(isolation_info.site_for_cookies().IsNull()); + EXPECT_FALSE(isolation_info.opaque_and_non_transient()); + + DuplicateAndCompare(isolation_info); +} + +TEST_F(IsolationInfoTest, + CreatePartialEmptyNoFrameOriginRedirectModeUpdateFrameOnly) { + base::test::ScopedFeatureList feature_list; + feature_list.InitAndDisableFeature( + features::kAppendFrameOriginToNetworkIsolationKey); + + const NetworkIsolationKey kNIK(kOrigin1, kOrigin2); + EXPECT_FALSE(kNIK.GetFrameOrigin()); + IsolationInfo isolation_info = IsolationInfo::CreatePartial( + IsolationInfo::RedirectMode::kUpdateFrameOnly, kNIK); + EXPECT_EQ(IsolationInfo::RedirectMode::kUpdateFrameOnly, + isolation_info.redirect_mode()); + EXPECT_EQ(kOrigin1, isolation_info.top_frame_origin()); + ASSERT_TRUE(isolation_info.frame_origin()); + EXPECT_TRUE(isolation_info.frame_origin()->opaque()); + EXPECT_EQ(kNIK, isolation_info.network_isolation_key()); + EXPECT_TRUE(isolation_info.site_for_cookies().IsNull()); + EXPECT_FALSE(isolation_info.opaque_and_non_transient()); + + DuplicateAndCompare(isolation_info); +} + +TEST_F(IsolationInfoTest, + CreatePartialEmptyNoFrameOriginRedirectModeUpdateNothing) { + base::test::ScopedFeatureList feature_list; + feature_list.InitAndDisableFeature( + features::kAppendFrameOriginToNetworkIsolationKey); + + const NetworkIsolationKey kNIK(kOrigin1, kOrigin2); + EXPECT_FALSE(kNIK.GetFrameOrigin()); + IsolationInfo isolation_info = IsolationInfo::CreatePartial( + IsolationInfo::RedirectMode::kUpdateNothing, kNIK); + EXPECT_EQ(IsolationInfo::RedirectMode::kUpdateNothing, + isolation_info.redirect_mode()); + EXPECT_EQ(kOrigin1, isolation_info.top_frame_origin()); + ASSERT_TRUE(isolation_info.frame_origin()); + EXPECT_TRUE(isolation_info.frame_origin()->opaque()); + EXPECT_EQ(kNIK, isolation_info.network_isolation_key()); + EXPECT_TRUE(isolation_info.site_for_cookies().IsNull()); + EXPECT_FALSE(isolation_info.opaque_and_non_transient()); + + DuplicateAndCompare(isolation_info); +} + +// Test that in the UpdateNothing case, the SiteForCookies does not have to +// match the frame origin, unlike in the HTTP/HTTPS case. +TEST_F(IsolationInfoTest, CustomSchemeUpdateNothing) { + // Have to register the scheme, or url::Origin::Create() will return an opaque + // origin. + url::ScopedSchemeRegistryForTests scoped_registry; + url::AddStandardScheme("foo", url::SCHEME_WITH_HOST); + + const GURL kCustomOriginUrl = GURL("foo://a.foo.com"); + const url::Origin kCustomOrigin = url::Origin::Create(kCustomOriginUrl); + + IsolationInfo isolation_info = IsolationInfo::Create( + IsolationInfo::RedirectMode::kUpdateNothing, kCustomOrigin, kOrigin1, + SiteForCookies::FromOrigin(kCustomOrigin)); + EXPECT_EQ(IsolationInfo::RedirectMode::kUpdateNothing, + isolation_info.redirect_mode()); + EXPECT_EQ(kCustomOrigin, isolation_info.top_frame_origin()); + EXPECT_EQ(kOrigin1, isolation_info.frame_origin()); + EXPECT_TRUE(isolation_info.network_isolation_key().IsFullyPopulated()); + EXPECT_FALSE(isolation_info.network_isolation_key().IsTransient()); + EXPECT_EQ("foo://a.foo.com https://foo.test", + isolation_info.network_isolation_key().ToString()); + EXPECT_TRUE(isolation_info.site_for_cookies().IsFirstParty(kCustomOriginUrl)); + EXPECT_FALSE(isolation_info.opaque_and_non_transient()); + + DuplicateAndCompare(isolation_info); + + IsolationInfo redirected_isolation_info = + isolation_info.CreateForRedirect(kOrigin2); + EXPECT_TRUE(isolation_info.IsEqualForTesting(redirected_isolation_info)); +} + +// Success cases are covered by other tests, so only need a separate test to +// cover the failure cases. +TEST_F(IsolationInfoTest, CreateIfConsistentFails) { + // Main frames with inconsistent SiteForCookies. + EXPECT_FALSE(IsolationInfo::CreateIfConsistent( + IsolationInfo::RedirectMode::kUpdateTopFrame, kOrigin1, kOrigin1, + SiteForCookies::FromOrigin(kOrigin2), + false /* opaque_and_non_transient */)); + EXPECT_FALSE(IsolationInfo::CreateIfConsistent( + IsolationInfo::RedirectMode::kUpdateTopFrame, kOpaqueOrigin, + kOpaqueOrigin, SiteForCookies::FromOrigin(kOrigin1), + false /* opaque_and_non_transient */)); + + // Sub frame with inconsistent SiteForCookies. + EXPECT_FALSE(IsolationInfo::CreateIfConsistent( + IsolationInfo::RedirectMode::kUpdateFrameOnly, kOrigin1, kOrigin2, + SiteForCookies::FromOrigin(kOrigin2), + false /* opaque_and_non_transient */)); + + // Sub resources with inconsistent SiteForCookies. + EXPECT_FALSE(IsolationInfo::CreateIfConsistent( + IsolationInfo::RedirectMode::kUpdateNothing, kOrigin1, kOrigin2, + SiteForCookies::FromOrigin(kOrigin1), + false /* opaque_and_non_transient */)); + EXPECT_FALSE(IsolationInfo::CreateIfConsistent( + IsolationInfo::RedirectMode::kUpdateNothing, kOrigin1, kOrigin2, + SiteForCookies::FromOrigin(kOrigin2), + false /* opaque_and_non_transient */)); + + // |opaque_and_non_transient| for wrong RedirectModes. + EXPECT_FALSE(IsolationInfo::CreateIfConsistent( + IsolationInfo::RedirectMode::kUpdateTopFrame, kOpaqueOrigin, + kOpaqueOrigin, SiteForCookies(), true /* opaque_and_non_transient */)); + EXPECT_FALSE(IsolationInfo::CreateIfConsistent( + IsolationInfo::RedirectMode::kUpdateFrameOnly, kOpaqueOrigin, + kOpaqueOrigin, SiteForCookies(), true /* opaque_and_non_transient */)); + + // |opaque_and_non_transient| with empty origins. + EXPECT_FALSE(IsolationInfo::CreateIfConsistent( + IsolationInfo::RedirectMode::kUpdateNothing, base::nullopt, base::nullopt, + SiteForCookies(), true /* opaque_and_non_transient */)); + + // |opaque_and_non_transient| with non-opaque origins. + EXPECT_FALSE(IsolationInfo::CreateIfConsistent( + IsolationInfo::RedirectMode::kUpdateNothing, kOrigin1, kOrigin1, + SiteForCookies(), true /* opaque_and_non_transient */)); + + // Incorrectly have empty/non-empty origins: + EXPECT_FALSE(IsolationInfo::CreateIfConsistent( + IsolationInfo::RedirectMode::kUpdateNothing, base::nullopt, kOrigin1, + SiteForCookies(), false /* opaque_and_non_transient */)); + EXPECT_FALSE(IsolationInfo::CreateIfConsistent( + IsolationInfo::RedirectMode::kUpdateNothing, kOrigin1, base::nullopt, + SiteForCookies(), false /* opaque_and_non_transient */)); + EXPECT_FALSE(IsolationInfo::CreateIfConsistent( + IsolationInfo::RedirectMode::kUpdateTopFrame, base::nullopt, kOrigin1, + SiteForCookies::FromOrigin(kOrigin1), + false /* opaque_and_non_transient */)); + EXPECT_FALSE(IsolationInfo::CreateIfConsistent( + IsolationInfo::RedirectMode::kUpdateTopFrame, kOrigin1, base::nullopt, + SiteForCookies::FromOrigin(kOrigin1), + false /* opaque_and_non_transient */)); + EXPECT_FALSE(IsolationInfo::CreateIfConsistent( + IsolationInfo::RedirectMode::kUpdateFrameOnly, base::nullopt, kOrigin2, + SiteForCookies(), false /* opaque_and_non_transient */)); + EXPECT_FALSE(IsolationInfo::CreateIfConsistent( + IsolationInfo::RedirectMode::kUpdateFrameOnly, kOrigin1, base::nullopt, + SiteForCookies(), false /* opaque_and_non_transient */)); + + // No origins with non-null SiteForCookies. + EXPECT_FALSE(IsolationInfo::CreateIfConsistent( + IsolationInfo::RedirectMode::kUpdateNothing, base::nullopt, base::nullopt, + SiteForCookies::FromOrigin(kOrigin1), + false /* opaque_and_non_transient */)); +} + +} // namespace + +} // namespace net
diff --git a/net/base/network_isolation_key.cc b/net/base/network_isolation_key.cc index 7d2e226..51df950 100644 --- a/net/base/network_isolation_key.cc +++ b/net/base/network_isolation_key.cc
@@ -56,19 +56,9 @@ NetworkIsolationKey::NetworkIsolationKey(const url::Origin& top_frame_origin, const url::Origin& frame_origin) - : use_frame_origin_(base::FeatureList::IsEnabled( - net::features::kAppendFrameOriginToNetworkIsolationKey)), - top_frame_origin_(top_frame_origin), - original_top_frame_origin_(top_frame_origin) { - if (use_frame_origin_) { - frame_origin_ = frame_origin; - original_frame_origin_ = frame_origin; - } - if (base::FeatureList::IsEnabled( - net::features::kUseRegistrableDomainInNetworkIsolationKey)) { - ReplaceOriginsWithRegistrableDomains(); - } -} + : NetworkIsolationKey(top_frame_origin, + frame_origin, + false /* opaque_and_non_transient */) {} NetworkIsolationKey::NetworkIsolationKey() : use_frame_origin_(base::FeatureList::IsEnabled( @@ -92,9 +82,8 @@ NetworkIsolationKey NetworkIsolationKey::CreateOpaqueAndNonTransient() { url::Origin opaque_origin; - NetworkIsolationKey key(opaque_origin, opaque_origin); - key.opaque_and_non_transient_ = true; - return key; + return NetworkIsolationKey(opaque_origin, opaque_origin, + true /* opaque_and_non_transient */); } NetworkIsolationKey NetworkIsolationKey::CreateWithNewFrameOrigin( @@ -149,11 +138,6 @@ return IsOpaque(); } -bool NetworkIsolationKey::IsOpaque() const { - return top_frame_origin_->opaque() || - (use_frame_origin_ && frame_origin_->opaque()); -} - bool NetworkIsolationKey::ToValue(base::Value* out_value) const { if (IsEmpty()) { *out_value = base::Value(base::Value::Type::LIST); @@ -239,9 +223,34 @@ return !top_frame_origin_.has_value() && !frame_origin_.has_value(); } +NetworkIsolationKey::NetworkIsolationKey(const url::Origin& top_frame_origin, + const url::Origin& frame_origin, + bool opaque_and_non_transient) + : opaque_and_non_transient_(opaque_and_non_transient), + use_frame_origin_(base::FeatureList::IsEnabled( + net::features::kAppendFrameOriginToNetworkIsolationKey)), + top_frame_origin_(top_frame_origin), + original_top_frame_origin_(top_frame_origin) { + DCHECK(!opaque_and_non_transient || top_frame_origin.opaque()); + if (use_frame_origin_) { + DCHECK(!opaque_and_non_transient || frame_origin.opaque()); + frame_origin_ = frame_origin; + original_frame_origin_ = frame_origin; + } + if (base::FeatureList::IsEnabled( + net::features::kUseRegistrableDomainInNetworkIsolationKey)) { + ReplaceOriginsWithRegistrableDomains(); + } +} + void NetworkIsolationKey::ReplaceOriginsWithRegistrableDomains() { SwitchToRegistrableDomainAndRemovePort(&top_frame_origin_); SwitchToRegistrableDomainAndRemovePort(&frame_origin_); } +bool NetworkIsolationKey::IsOpaque() const { + return top_frame_origin_->opaque() || + (use_frame_origin_ && frame_origin_->opaque()); +} + } // namespace net
diff --git a/net/base/network_isolation_key.h b/net/base/network_isolation_key.h index aa362e07..ddfe1e5 100644 --- a/net/base/network_isolation_key.h +++ b/net/base/network_isolation_key.h
@@ -33,8 +33,8 @@ public: // Full constructor. When a request is initiated by the top frame, it must // also populate the |frame_origin| parameter when calling this constructor. - explicit NetworkIsolationKey(const url::Origin& top_frame_origin, - const url::Origin& frame_origin); + NetworkIsolationKey(const url::Origin& top_frame_origin, + const url::Origin& frame_origin); // Construct an empty key. NetworkIsolationKey(); @@ -139,11 +139,17 @@ WARN_UNUSED_RESULT; private: + // These classes need to be able to set |opaque_and_non_transient_| + friend class IsolationInfo; friend struct mojo::StructTraits<network::mojom::NetworkIsolationKeyDataView, net::NetworkIsolationKey>; FRIEND_TEST_ALL_PREFIXES(NetworkIsolationKeyWithFrameOriginTest, UseRegistrableDomain); + NetworkIsolationKey(const url::Origin& top_frame_origin, + const url::Origin& frame_origin, + bool opaque_and_non_transient); + void ReplaceOriginsWithRegistrableDomains(); bool IsOpaque() const;
diff --git a/net/cert/internal/cert_issuer_source_sync_unittest.h b/net/cert/internal/cert_issuer_source_sync_unittest.h index b8f148c..7d4548b 100644 --- a/net/cert/internal/cert_issuer_source_sync_unittest.h +++ b/net/cert/internal/cert_issuer_source_sync_unittest.h
@@ -5,6 +5,8 @@ #ifndef NET_CERT_INTERNAL_CERT_ISSUER_SOURCE_SYNC_UNITTEST_H_ #define NET_CERT_INTERNAL_CERT_ISSUER_SOURCE_SYNC_UNITTEST_H_ +#include <algorithm> + #include "net/cert/internal/cert_errors.h" #include "net/cert/internal/cert_issuer_source.h" #include "net/cert/internal/test_helpers.h"
diff --git a/net/http/http_network_transaction_unittest.cc b/net/http/http_network_transaction_unittest.cc index 86d5348..abbce47 100644 --- a/net/http/http_network_transaction_unittest.cc +++ b/net/http/http_network_transaction_unittest.cc
@@ -5586,7 +5586,7 @@ std::make_unique<ProxyConfigServiceFixed>(ProxyConfigWithAnnotation( ProxyConfig::CreateAutoDetect(), TRAFFIC_ANNOTATION_FOR_TESTS)), std::make_unique<SameProxyWithDifferentSchemesProxyResolverFactory>(), - nullptr, /*quick_check_enabled=*/true); + nullptr); std::unique_ptr<HttpNetworkSession> session = CreateSession(&session_deps_); @@ -6007,7 +6007,7 @@ proxy_config, TRAFFIC_ANNOTATION_FOR_TESTS)), std::make_unique<CapturingProxyResolverFactory>( &capturing_proxy_resolver), - nullptr, /*quick_check_enabled=*/true); + nullptr); std::unique_ptr<HttpNetworkSession> session(CreateSession(&session_deps_)); @@ -6611,7 +6611,7 @@ proxy_config, TRAFFIC_ANNOTATION_FOR_TESTS)), std::make_unique<CapturingProxyResolverFactory>( &capturing_proxy_resolver), - nullptr, /*quick_check_enabled=*/true); + nullptr); std::unique_ptr<HttpNetworkSession> session(CreateSession(&session_deps_)); @@ -7150,7 +7150,7 @@ proxy_config, TRAFFIC_ANNOTATION_FOR_TESTS)), std::make_unique<CapturingProxyResolverFactory>( &capturing_proxy_resolver), - nullptr, /*quick_check_enabled=*/true); + nullptr); std::unique_ptr<HttpNetworkSession> session(CreateSession(&session_deps_)); @@ -7285,7 +7285,7 @@ proxy_config, TRAFFIC_ANNOTATION_FOR_TESTS)), std::make_unique<CapturingProxyResolverFactory>( &capturing_proxy_resolver), - nullptr, /*quick_check_enabled=*/true); + nullptr); std::unique_ptr<HttpNetworkSession> session(CreateSession(&session_deps_)); // Fetch https://proxy:70/ via HTTP/2. @@ -14184,7 +14184,7 @@ session_deps_.proxy_resolution_service = std::make_unique<ConfiguredProxyResolutionService>( std::move(proxy_config_service), std::move(proxy_resolver_factory), - &net_log, /*quick_check_enabled=*/true); + &net_log); session_deps_.net_log = &net_log; @@ -14265,7 +14265,7 @@ proxy_config, TRAFFIC_ANNOTATION_FOR_TESTS)), std::make_unique<CapturingProxyResolverFactory>( &capturing_proxy_resolver), - nullptr, /*quick_check_enabled=*/true); + nullptr); RecordingTestNetLog net_log; session_deps_.net_log = &net_log; @@ -17647,7 +17647,7 @@ std::make_unique<ConfiguredProxyResolutionService>( std::make_unique<ProxyConfigServiceFixed>(ProxyConfigWithAnnotation( proxy_config, TRAFFIC_ANNOTATION_FOR_TESTS)), - nullptr, nullptr, /*quick_check_enabled=*/true); + nullptr, nullptr); SSLSocketDataProvider ssl1(ASYNC, OK); // to the proxy ssl1.next_proto = kProtoHTTP2; @@ -19290,8 +19290,7 @@ new ConfiguredProxyResolutionService( std::make_unique<ProxyConfigServiceFixed>(ProxyConfigWithAnnotation( proxy_config, TRAFFIC_ANNOTATION_FOR_TESTS)), - std::make_unique<FailingProxyResolverFactory>(), nullptr, - /*quick_check_enabled=*/true)); + std::make_unique<FailingProxyResolverFactory>(), nullptr)); HttpRequestInfo request; request.method = "GET"; @@ -19321,8 +19320,7 @@ new ConfiguredProxyResolutionService( std::make_unique<ProxyConfigServiceFixed>(ProxyConfigWithAnnotation( proxy_config, TRAFFIC_ANNOTATION_FOR_TESTS)), - base::WrapUnique(proxy_resolver_factory), nullptr, - /*quick_check_enabled=*/true)); + base::WrapUnique(proxy_resolver_factory), nullptr)); HttpRequestInfo request; request.method = "GET"; request.url = GURL("http://www.example.org/");
diff --git a/net/http/http_stream_factory_job_controller_unittest.cc b/net/http/http_stream_factory_job_controller_unittest.cc index ed9d68ed..1dfc39f5 100644 --- a/net/http/http_stream_factory_job_controller_unittest.cc +++ b/net/http/http_stream_factory_job_controller_unittest.cc
@@ -363,8 +363,7 @@ new ConfiguredProxyResolutionService( std::make_unique<ProxyConfigServiceFixed>(ProxyConfigWithAnnotation( proxy_config, TRAFFIC_ANNOTATION_FOR_TESTS)), - std::make_unique<FailingProxyResolverFactory>(), nullptr, - /*quick_check_enabled=*/true)); + std::make_unique<FailingProxyResolverFactory>(), nullptr)); HttpRequestInfo request_info; request_info.method = "GET"; request_info.url = GURL("http://www.google.com"); @@ -402,8 +401,7 @@ new ConfiguredProxyResolutionService( std::make_unique<ProxyConfigServiceFixed>(ProxyConfigWithAnnotation( proxy_config, TRAFFIC_ANNOTATION_FOR_TESTS)), - base::WrapUnique(proxy_resolver_factory), nullptr, - /*quick_check_enabled=*/true)); + base::WrapUnique(proxy_resolver_factory), nullptr)); HttpRequestInfo request_info; request_info.method = "GET"; request_info.url = GURL("http://www.google.com");
diff --git a/net/log/net_log_event_type_list.h b/net/log/net_log_event_type_list.h index 433f4a8..abd99fb7 100644 --- a/net/log/net_log_event_type_list.h +++ b/net/log/net_log_event_type_list.h
@@ -1812,6 +1812,15 @@ // } EVENT_TYPE(QUIC_SESSION_STREAM_FRAME_SENT) +// A stream frame is coalesced with an existing stream frame. +// { +// "stream_id": <The id of the stream which this data is for>, +// "fin": <True if this is the final data set by the peer on this stream>, +// "offset": <Offset in the byte stream where this data starts>, +// "length": <Length of the data in this frame>, +// } +EVENT_TYPE(QUIC_SESSION_STREAM_FRAME_COALESCED) + // Session received an ACK frame. // { // "sent_info": <Details of packet sent by the peer> @@ -2175,6 +2184,15 @@ // } EVENT_TYPE(QUIC_SESSION_MESSAGE_FRAME_RECEIVED) +// Session received a HANDSHAKE_DONE frame. +EVENT_TYPE(QUIC_SESSION_HANDSHAKE_DONE_FRAME_RECEIVED) + +// Session sent a coalesced QUIC packet. +// { +// "info": <coalesced packet info> +// } +EVENT_TYPE(QUIC_SESSION_COALESCED_PACKET_SENT) + // ------------------------------------------------------------------------ // QuicHttpStream // ------------------------------------------------------------------------
diff --git a/net/nqe/network_quality_estimator_util.cc b/net/nqe/network_quality_estimator_util.cc index 7df30e83..5ffdda2a 100644 --- a/net/nqe/network_quality_estimator_util.cc +++ b/net/nqe/network_quality_estimator_util.cc
@@ -58,7 +58,7 @@ // reasons, but is needed to maximize the chances of a cache hit. return IsPrivateHost(request.context()->host_resolver(), HostPortPair::FromURL(request.url()), - request.network_isolation_key()); + request.isolation_info().network_isolation_key()); } bool IsPrivateHostForTesting(HostResolver* host_resolver,
diff --git a/net/nqe/throughput_analyzer_unittest.cc b/net/nqe/throughput_analyzer_unittest.cc index 8d6b87e..6443680 100644 --- a/net/nqe/throughput_analyzer_unittest.cc +++ b/net/nqe/throughput_analyzer_unittest.cc
@@ -29,7 +29,7 @@ #include "base/threading/thread_task_runner_handle.h" #include "base/time/default_tick_clock.h" #include "net/base/features.h" -#include "net/base/network_isolation_key.h" +#include "net/base/isolation_info.h" #include "net/dns/mock_host_resolver.h" #include "net/log/test_net_log.h" #include "net/nqe/network_quality_estimator.h" @@ -221,7 +221,8 @@ context.CreateRequest(kUrl, DEFAULT_PRIORITY, &test_delegate, TRAFFIC_ANNOTATION_FOR_TESTS)); if (use_network_isolation_key) - request->set_network_isolation_key(kNetworkIsolationKey); + request->set_isolation_info(IsolationInfo::CreatePartial( + IsolationInfo::RedirectMode::kUpdateNothing, kNetworkIsolationKey)); throughput_analyzer.NotifyStartTransaction(*(request.get())); requests.push_back(std::move(request)); }
diff --git a/net/proxy_resolution/configured_proxy_resolution_service.cc b/net/proxy_resolution/configured_proxy_resolution_service.cc index ae0a8be..40da0994 100644 --- a/net/proxy_resolution/configured_proxy_resolution_service.cc +++ b/net/proxy_resolution/configured_proxy_resolution_service.cc
@@ -847,8 +847,7 @@ ConfiguredProxyResolutionService::ConfiguredProxyResolutionService( std::unique_ptr<ProxyConfigService> config_service, std::unique_ptr<ProxyResolverFactory> resolver_factory, - NetLog* net_log, - bool quick_check_enabled) + NetLog* net_log) : config_service_(std::move(config_service)), resolver_factory_(std::move(resolver_factory)), current_state_(STATE_NONE), @@ -856,7 +855,7 @@ net_log_(net_log), stall_proxy_auto_config_delay_( TimeDelta::FromMilliseconds(kDelayAfterNetworkChangesMs)), - quick_check_enabled_(quick_check_enabled) { + quick_check_enabled_(true) { NetworkChangeNotifier::AddIPAddressObserver(this); NetworkChangeNotifier::AddDNSObserver(this); config_service_->AddObserver(this); @@ -866,8 +865,8 @@ std::unique_ptr<ConfiguredProxyResolutionService> ConfiguredProxyResolutionService::CreateUsingSystemProxyResolver( std::unique_ptr<ProxyConfigService> proxy_config_service, - NetLog* net_log, - bool quick_check_enabled) { + bool quick_check_enabled, + NetLog* net_log) { DCHECK(proxy_config_service); if (!ProxyResolverFactoryForSystem::IsSupported()) { @@ -880,7 +879,8 @@ std::move(proxy_config_service), std::make_unique<ProxyResolverFactoryForSystem>( kDefaultNumPacThreads), - net_log, quick_check_enabled); + net_log); + proxy_resolution_service->set_quick_check_enabled(quick_check_enabled); return proxy_resolution_service; } @@ -891,8 +891,7 @@ NetLog* net_log) { return std::make_unique<ConfiguredProxyResolutionService>( std::move(proxy_config_service), - std::make_unique<ProxyResolverFactoryForNullResolver>(), net_log, - /*quick_check_enabled=*/false); + std::make_unique<ProxyResolverFactoryForNullResolver>(), net_log); } // static @@ -902,8 +901,8 @@ // TODO(eroman): This isn't quite right, won't work if |pc| specifies // a PAC script. return CreateUsingSystemProxyResolver( - std::make_unique<ProxyConfigServiceFixed>(pc), nullptr, - /*quick_check_enabled=*/true); + std::make_unique<ProxyConfigServiceFixed>(pc), + /*quick_check_enabled=*/true, nullptr); } // static @@ -923,8 +922,7 @@ // Use direct connections. return std::make_unique<ConfiguredProxyResolutionService>( std::make_unique<ProxyConfigServiceDirect>(), - std::make_unique<ProxyResolverFactoryForNullResolver>(), nullptr, - /*quick_check_enabled=*/true); + std::make_unique<ProxyResolverFactoryForNullResolver>(), nullptr); } // static @@ -942,8 +940,7 @@ return std::make_unique<ConfiguredProxyResolutionService>( std::move(proxy_config_service), - std::make_unique<ProxyResolverFactoryForPacResult>(pac_string), nullptr, - /*quick_check_enabled=*/true); + std::make_unique<ProxyResolverFactoryForPacResult>(pac_string), nullptr); } // static @@ -957,8 +954,7 @@ return std::make_unique<ConfiguredProxyResolutionService>( std::move(proxy_config_service), - std::make_unique<ProxyResolverFactoryForPacResult>(pac_string), nullptr, - /*quick_check_enabled=*/true); + std::make_unique<ProxyResolverFactoryForPacResult>(pac_string), nullptr); } int ConfiguredProxyResolutionService::ResolveProxy( @@ -998,9 +994,10 @@ return rv; } - auto req = std::make_unique<ConfiguredProxyResolutionRequest>( - this, url, method, network_isolation_key, result, std::move(callback), - net_log); + std::unique_ptr<ConfiguredProxyResolutionRequest> req = + std::make_unique<ConfiguredProxyResolutionRequest>( + this, url, method, network_isolation_key, result, std::move(callback), + net_log); if (current_state_ == STATE_READY) { // Start the resolve request.
diff --git a/net/proxy_resolution/configured_proxy_resolution_service.h b/net/proxy_resolution/configured_proxy_resolution_service.h index 768ca0f7..04c973b 100644 --- a/net/proxy_resolution/configured_proxy_resolution_service.h +++ b/net/proxy_resolution/configured_proxy_resolution_service.h
@@ -105,8 +105,7 @@ ConfiguredProxyResolutionService( std::unique_ptr<ProxyConfigService> config_service, std::unique_ptr<ProxyResolverFactory> resolver_factory, - NetLog* net_log, - bool quick_check_enabled); + NetLog* net_log); ~ConfiguredProxyResolutionService() override; @@ -185,8 +184,8 @@ static std::unique_ptr<ConfiguredProxyResolutionService> CreateUsingSystemProxyResolver( std::unique_ptr<ProxyConfigService> proxy_config_service, - NetLog* net_log, - bool quick_check_enabled); + bool quick_check_enabled, + NetLog* net_log); // Creates a ConfiguredProxyResolutionService without support for proxy // autoconfig. @@ -248,6 +247,7 @@ // ConfiguredProxyResolutionService. static std::unique_ptr<PacPollPolicy> CreateDefaultPacPollPolicy(); + void set_quick_check_enabled(bool value) { quick_check_enabled_ = value; } bool quick_check_enabled_for_testing() const { return quick_check_enabled_; } private:
diff --git a/net/proxy_resolution/configured_proxy_resolution_service_unittest.cc b/net/proxy_resolution/configured_proxy_resolution_service_unittest.cc index f9000e2..9e091368 100644 --- a/net/proxy_resolution/configured_proxy_resolution_service_unittest.cc +++ b/net/proxy_resolution/configured_proxy_resolution_service_unittest.cc
@@ -389,7 +389,7 @@ new MockAsyncProxyResolverFactory(false); ConfiguredProxyResolutionService service( std::make_unique<MockProxyConfigService>(ProxyConfig::CreateDirect()), - base::WrapUnique(factory), nullptr, /*quick_check_enabled=*/true); + base::WrapUnique(factory), nullptr); GURL url("http://www.google.com/"); @@ -427,8 +427,7 @@ config.proxy_rules().bypass_rules.ParseFromString("*.org"); ConfiguredProxyResolutionService service( - std::make_unique<MockProxyConfigService>(config), nullptr, nullptr, - /*quick_check_enabled=*/true); + std::make_unique<MockProxyConfigService>(config), nullptr, nullptr); GURL url("http://www.google.com/"); GURL bypass_url("http://internet.org"); @@ -495,8 +494,7 @@ config.proxy_rules().bypass_rules.ParseFromString("*.org"); ConfiguredProxyResolutionService service( - std::make_unique<MockProxyConfigService>(config), nullptr, nullptr, - /*quick_check_enabled=*/true); + std::make_unique<MockProxyConfigService>(config), nullptr, nullptr); GURL url("http://www.google.com/"); GURL bypass_url("http://internet.org"); @@ -578,8 +576,7 @@ std::unique_ptr<ConfiguredProxyResolutionService> service = std::make_unique<ConfiguredProxyResolutionService>( - base::WrapUnique(config_service), base::WrapUnique(factory), nullptr, - /*quick_check_enabled=*/true); + base::WrapUnique(config_service), base::WrapUnique(factory), nullptr); GURL url("http://www.google.com/"); GURL url2("http://www.example.com/"); @@ -645,8 +642,7 @@ std::unique_ptr<ConfiguredProxyResolutionService> service = std::make_unique<ConfiguredProxyResolutionService>( - base::WrapUnique(config_service), base::WrapUnique(factory), nullptr, - /*quick_check_enabled=*/true); + base::WrapUnique(config_service), base::WrapUnique(factory), nullptr); GURL url("http://www.google.com/"); @@ -696,8 +692,7 @@ std::unique_ptr<ConfiguredProxyResolutionService> service = std::make_unique<ConfiguredProxyResolutionService>( - base::WrapUnique(config_service), base::WrapUnique(factory), nullptr, - /*quick_check_enabled=*/true); + base::WrapUnique(config_service), base::WrapUnique(factory), nullptr); GURL url("http://www.google.com/"); ProxyInfo info; @@ -765,8 +760,7 @@ std::unique_ptr<ConfiguredProxyResolutionService> service = std::make_unique<ConfiguredProxyResolutionService>( - base::WrapUnique(config_service), base::WrapUnique(factory), nullptr, - /*quick_check_enabled=*/true); + base::WrapUnique(config_service), base::WrapUnique(factory), nullptr); GURL url("http://www.google.com/"); ProxyInfo info; @@ -819,9 +813,8 @@ int rv; { - ConfiguredProxyResolutionService service(base::WrapUnique(config_service), - base::WrapUnique(factory), nullptr, - /*quick_check_enabled=*/true); + ConfiguredProxyResolutionService service( + base::WrapUnique(config_service), base::WrapUnique(factory), nullptr); rv = service.ResolveProxy(url, std::string(), NetworkIsolationKey(), &info, callback.callback(), &request, log.bound()); EXPECT_THAT(rv, IsError(ERR_IO_PENDING)); @@ -852,8 +845,7 @@ std::unique_ptr<ConfiguredProxyResolutionService> service = std::make_unique<ConfiguredProxyResolutionService>( - base::WrapUnique(config_service), base::WrapUnique(factory), nullptr, - /*quick_check_enabled=*/true); + base::WrapUnique(config_service), base::WrapUnique(factory), nullptr); GURL url("http://www.google.com/"); @@ -900,8 +892,7 @@ new MockAsyncProxyResolverFactory(false); ConfiguredProxyResolutionService service(base::WrapUnique(config_service), - base::WrapUnique(factory), nullptr, - /*quick_check_enabled=*/true); + base::WrapUnique(factory), nullptr); GURL url("http://www.google.com/"); @@ -965,8 +956,7 @@ new MockAsyncProxyResolverFactory(false); ConfiguredProxyResolutionService service(base::WrapUnique(config_service), - base::WrapUnique(factory), nullptr, - /*quick_check_enabled=*/true); + base::WrapUnique(factory), nullptr); GURL url("http://username:password@www.google.com/?ref#hash#hash"); @@ -999,8 +989,7 @@ new MockAsyncProxyResolverFactory(false); ConfiguredProxyResolutionService service(base::WrapUnique(config_service), - base::WrapUnique(factory), nullptr, - /*quick_check_enabled=*/true); + base::WrapUnique(factory), nullptr); GURL url("http://www.google.com/"); @@ -1049,8 +1038,7 @@ new MockAsyncProxyResolverFactory(false); ConfiguredProxyResolutionService service(base::WrapUnique(config_service), - base::WrapUnique(factory), nullptr, - /*quick_check_enabled=*/true); + base::WrapUnique(factory), nullptr); GURL url("http://this-causes-js-error/"); @@ -1109,8 +1097,7 @@ new MockAsyncProxyResolverFactory(false); ConfiguredProxyResolutionService service(base::WrapUnique(config_service), - base::WrapUnique(factory), nullptr, - /*quick_check_enabled=*/true); + base::WrapUnique(factory), nullptr); GURL url("http://www.google.com/"); @@ -1167,8 +1154,7 @@ MockAsyncProxyResolverFactory* factory = new MockAsyncProxyResolverFactory(false); ConfiguredProxyResolutionService service(base::WrapUnique(config_service), - base::WrapUnique(factory), nullptr, - /*quick_check_enabled=*/true); + base::WrapUnique(factory), nullptr); // Resolve something. GURL url("http://www.google.com/"); @@ -1209,8 +1195,7 @@ new MockAsyncProxyResolverFactory(false); ConfiguredProxyResolutionService service(base::WrapUnique(config_service), - base::WrapUnique(factory), nullptr, - /*quick_check_enabled=*/true); + base::WrapUnique(factory), nullptr); // Start first resolve request. GURL url("http://www.google.com/"); @@ -1275,8 +1260,7 @@ new MockAsyncProxyResolverFactory(false); ConfiguredProxyResolutionService service(base::WrapUnique(config_service), - base::WrapUnique(factory), nullptr, - /*quick_check_enabled=*/true); + base::WrapUnique(factory), nullptr); // Start first resolve request. GURL url("http://www.google.com/"); @@ -1348,8 +1332,7 @@ new MockAsyncProxyResolverFactory(false); ConfiguredProxyResolutionService service(base::WrapUnique(config_service), - base::WrapUnique(factory), nullptr, - /*quick_check_enabled=*/true); + base::WrapUnique(factory), nullptr); // Start two resolve requests. GURL url1("http://www.google.com/"); @@ -1423,8 +1406,7 @@ new MockAsyncProxyResolverFactory(false); ConfiguredProxyResolutionService service(base::WrapUnique(config_service), - base::WrapUnique(factory), nullptr, - /*quick_check_enabled=*/true); + base::WrapUnique(factory), nullptr); // Start first resolve request. GURL url("http://www.google.com/"); @@ -1474,8 +1456,7 @@ new MockAsyncProxyResolverFactory(true); ConfiguredProxyResolutionService service(base::WrapUnique(config_service), - base::WrapUnique(factory), nullptr, - /*quick_check_enabled=*/true); + base::WrapUnique(factory), nullptr); MockPacFileFetcher* fetcher = new MockPacFileFetcher; service.SetPacFileFetchers(base::WrapUnique(fetcher), @@ -1527,8 +1508,7 @@ new MockAsyncProxyResolverFactory(false); ConfiguredProxyResolutionService service(base::WrapUnique(config_service), - base::WrapUnique(factory), nullptr, - /*quick_check_enabled=*/true); + base::WrapUnique(factory), nullptr); // Start first resolve request. GURL url("http://www.google.com/"); @@ -1589,8 +1569,7 @@ new MockAsyncProxyResolverFactory(false); ConfiguredProxyResolutionService service(base::WrapUnique(config_service), - base::WrapUnique(factory), nullptr, - /*quick_check_enabled=*/true); + base::WrapUnique(factory), nullptr); GURL url("http://www.google.com/"); @@ -1728,8 +1707,7 @@ new MockAsyncProxyResolverFactory(false); ConfiguredProxyResolutionService service(base::WrapUnique(config_service), - base::WrapUnique(factory), nullptr, - /*quick_check_enabled=*/true); + base::WrapUnique(factory), nullptr); GURL url("http://www.google.com/"); @@ -1792,8 +1770,7 @@ new MockAsyncProxyResolverFactory(false); ConfiguredProxyResolutionService service(base::WrapUnique(config_service), - base::WrapUnique(factory), nullptr, - /*quick_check_enabled=*/true); + base::WrapUnique(factory), nullptr); GURL url("http://www.google.com/"); @@ -1899,8 +1876,7 @@ new MockAsyncProxyResolverFactory(false); ConfiguredProxyResolutionService service(base::WrapUnique(config_service), - base::WrapUnique(factory), nullptr, - /*quick_check_enabled=*/true); + base::WrapUnique(factory), nullptr); GURL url("http://www.google.com/"); @@ -1998,8 +1974,7 @@ config.proxy_rules().bypass_rules.ParseFromString("*.org"); ConfiguredProxyResolutionService service( - std::make_unique<MockProxyConfigService>(config), nullptr, nullptr, - /*quick_check_enabled=*/true); + std::make_unique<MockProxyConfigService>(config), nullptr, nullptr); int rv; GURL url1("http://www.webkit.org"); @@ -2042,8 +2017,7 @@ EXPECT_EQ(3u, additional_bad_proxies.size()); ConfiguredProxyResolutionService service( - std::make_unique<MockProxyConfigService>(config), nullptr, nullptr, - /*quick_check_enabled=*/true); + std::make_unique<MockProxyConfigService>(config), nullptr, nullptr); ProxyInfo proxy_info; proxy_info.UseProxyList(proxy_list); const ProxyRetryInfoMap& retry_info = service.proxy_retry_info(); @@ -2064,8 +2038,7 @@ std::unique_ptr<ProxyResolutionRequest> request; { ConfiguredProxyResolutionService service( - std::make_unique<MockProxyConfigService>(config), nullptr, nullptr, - /*quick_check_enabled=*/true); + std::make_unique<MockProxyConfigService>(config), nullptr, nullptr); GURL test_url("http://www.msn.com"); ProxyInfo info; TestCompletionCallback callback; @@ -2078,8 +2051,7 @@ } { ConfiguredProxyResolutionService service( - std::make_unique<MockProxyConfigService>(config), nullptr, nullptr, - /*quick_check_enabled=*/true); + std::make_unique<MockProxyConfigService>(config), nullptr, nullptr); GURL test_url("ftp://ftp.google.com"); ProxyInfo info; TestCompletionCallback callback; @@ -2092,8 +2064,7 @@ } { ConfiguredProxyResolutionService service( - std::make_unique<MockProxyConfigService>(config), nullptr, nullptr, - /*quick_check_enabled=*/true); + std::make_unique<MockProxyConfigService>(config), nullptr, nullptr); GURL test_url("https://webbranch.techcu.com"); ProxyInfo info; TestCompletionCallback callback; @@ -2107,8 +2078,7 @@ { config.proxy_rules().ParseFromString("foopy1:8080"); ConfiguredProxyResolutionService service( - std::make_unique<MockProxyConfigService>(config), nullptr, nullptr, - /*quick_check_enabled=*/true); + std::make_unique<MockProxyConfigService>(config), nullptr, nullptr); GURL test_url("http://www.microsoft.com"); ProxyInfo info; TestCompletionCallback callback; @@ -2131,8 +2101,7 @@ ProxyConfig config; config.proxy_rules().ParseFromString("https=foopy2:8080"); ConfiguredProxyResolutionService service( - std::make_unique<MockProxyConfigService>(config), nullptr, nullptr, - /*quick_check_enabled=*/true); + std::make_unique<MockProxyConfigService>(config), nullptr, nullptr); GURL test_url("http://www.google.com"); ProxyInfo info; TestCompletionCallback callback; @@ -2148,8 +2117,7 @@ ProxyConfig config; config.proxy_rules().ParseFromString("https=foopy2:8080"); ConfiguredProxyResolutionService service( - std::make_unique<MockProxyConfigService>(config), nullptr, nullptr, - /*quick_check_enabled=*/true); + std::make_unique<MockProxyConfigService>(config), nullptr, nullptr); GURL test_url("https://www.google.com"); ProxyInfo info; TestCompletionCallback callback; @@ -2164,8 +2132,7 @@ { ProxyConfig config; ConfiguredProxyResolutionService service( - std::make_unique<MockProxyConfigService>(config), nullptr, nullptr, - /*quick_check_enabled=*/true); + std::make_unique<MockProxyConfigService>(config), nullptr, nullptr); GURL test_url("http://www.google.com"); ProxyInfo info; TestCompletionCallback callback; @@ -2191,8 +2158,7 @@ std::unique_ptr<ProxyResolutionRequest> request; { ConfiguredProxyResolutionService service( - std::make_unique<MockProxyConfigService>(config), nullptr, nullptr, - /*quick_check_enabled=*/true); + std::make_unique<MockProxyConfigService>(config), nullptr, nullptr); GURL test_url("http://www.msn.com"); ProxyInfo info; TestCompletionCallback callback; @@ -2205,8 +2171,7 @@ } { ConfiguredProxyResolutionService service( - std::make_unique<MockProxyConfigService>(config), nullptr, nullptr, - /*quick_check_enabled=*/true); + std::make_unique<MockProxyConfigService>(config), nullptr, nullptr); GURL test_url("ftp://ftp.google.com"); ProxyInfo info; TestCompletionCallback callback; @@ -2219,8 +2184,7 @@ } { ConfiguredProxyResolutionService service( - std::make_unique<MockProxyConfigService>(config), nullptr, nullptr, - /*quick_check_enabled=*/true); + std::make_unique<MockProxyConfigService>(config), nullptr, nullptr); GURL test_url("https://webbranch.techcu.com"); ProxyInfo info; TestCompletionCallback callback; @@ -2233,8 +2197,7 @@ } { ConfiguredProxyResolutionService service( - std::make_unique<MockProxyConfigService>(config), nullptr, nullptr, - /*quick_check_enabled=*/true); + std::make_unique<MockProxyConfigService>(config), nullptr, nullptr); GURL test_url("unknown://www.microsoft.com"); ProxyInfo info; TestCompletionCallback callback; @@ -2260,8 +2223,7 @@ new MockAsyncProxyResolverFactory(false); ConfiguredProxyResolutionService service(base::WrapUnique(config_service), - base::WrapUnique(factory), nullptr, - /*quick_check_enabled=*/true); + base::WrapUnique(factory), nullptr); // Start 3 requests. @@ -2335,8 +2297,7 @@ new MockAsyncProxyResolverFactory(true); ConfiguredProxyResolutionService service(base::WrapUnique(config_service), - base::WrapUnique(factory), nullptr, - /*quick_check_enabled=*/true); + base::WrapUnique(factory), nullptr); MockPacFileFetcher* fetcher = new MockPacFileFetcher; service.SetPacFileFetchers(base::WrapUnique(fetcher), @@ -2443,8 +2404,7 @@ new MockAsyncProxyResolverFactory(true); ConfiguredProxyResolutionService service(base::WrapUnique(config_service), - base::WrapUnique(factory), nullptr, - /*quick_check_enabled=*/true); + base::WrapUnique(factory), nullptr); MockPacFileFetcher* fetcher = new MockPacFileFetcher; service.SetPacFileFetchers(base::WrapUnique(fetcher), @@ -2507,8 +2467,7 @@ new MockAsyncProxyResolverFactory(true); ConfiguredProxyResolutionService service(base::WrapUnique(config_service), - base::WrapUnique(factory), nullptr, - /*quick_check_enabled=*/true); + base::WrapUnique(factory), nullptr); MockPacFileFetcher* fetcher = new MockPacFileFetcher; service.SetPacFileFetchers(base::WrapUnique(fetcher), @@ -2609,8 +2568,7 @@ MockAsyncProxyResolverFactory* factory = new MockAsyncProxyResolverFactory(true); ConfiguredProxyResolutionService service(base::WrapUnique(config_service), - base::WrapUnique(factory), nullptr, - /*quick_check_enabled=*/true); + base::WrapUnique(factory), nullptr); MockPacFileFetcher* fetcher = new MockPacFileFetcher; service.SetPacFileFetchers(base::WrapUnique(fetcher), @@ -2696,8 +2654,7 @@ MockAsyncProxyResolverFactory* factory = new MockAsyncProxyResolverFactory(true); ConfiguredProxyResolutionService service(base::WrapUnique(config_service), - base::WrapUnique(factory), nullptr, - /*quick_check_enabled=*/true); + base::WrapUnique(factory), nullptr); MockPacFileFetcher* fetcher = new MockPacFileFetcher; service.SetPacFileFetchers(base::WrapUnique(fetcher), @@ -2776,8 +2733,7 @@ MockAsyncProxyResolverFactory* factory = new MockAsyncProxyResolverFactory(true); ConfiguredProxyResolutionService service(base::WrapUnique(config_service), - base::WrapUnique(factory), nullptr, - /*quick_check_enabled=*/true); + base::WrapUnique(factory), nullptr); MockPacFileFetcher* fetcher = new MockPacFileFetcher; service.SetPacFileFetchers(base::WrapUnique(fetcher), @@ -2840,8 +2796,7 @@ MockAsyncProxyResolverFactory* factory = new MockAsyncProxyResolverFactory(true); ConfiguredProxyResolutionService service(base::WrapUnique(config_service), - base::WrapUnique(factory), nullptr, - /*quick_check_enabled=*/true); + base::WrapUnique(factory), nullptr); MockPacFileFetcher* fetcher = new MockPacFileFetcher; service.SetPacFileFetchers(base::WrapUnique(fetcher), @@ -2913,8 +2868,7 @@ MockAsyncProxyResolverFactory* factory = new MockAsyncProxyResolverFactory(true); ConfiguredProxyResolutionService service(base::WrapUnique(config_service), - base::WrapUnique(factory), nullptr, - /*quick_check_enabled=*/true); + base::WrapUnique(factory), nullptr); MockPacFileFetcher* fetcher = new MockPacFileFetcher; service.SetPacFileFetchers(base::WrapUnique(fetcher), @@ -2952,8 +2906,7 @@ new MockAsyncProxyResolverFactory(false); ConfiguredProxyResolutionService service(base::WrapUnique(config_service), - base::WrapUnique(factory), nullptr, - /*quick_check_enabled=*/true); + base::WrapUnique(factory), nullptr); GURL url("http://www.google.com/"); @@ -2979,8 +2932,7 @@ MockAsyncProxyResolverFactory* factory = new MockAsyncProxyResolverFactory(false); ConfiguredProxyResolutionService service(base::WrapUnique(config_service), - base::WrapUnique(factory), nullptr, - /*quick_check_enabled=*/true); + base::WrapUnique(factory), nullptr); // Start 1 request. @@ -3036,8 +2988,7 @@ RecordingTestNetLog log; ConfiguredProxyResolutionService service(base::WrapUnique(config_service), - base::WrapUnique(factory), &log, - /*quick_check_enabled=*/true); + base::WrapUnique(factory), &log); MockPacFileFetcher* fetcher = new MockPacFileFetcher; service.SetPacFileFetchers(base::WrapUnique(fetcher), @@ -3160,8 +3111,7 @@ new MockAsyncProxyResolverFactory(true); ConfiguredProxyResolutionService service(base::WrapUnique(config_service), - base::WrapUnique(factory), nullptr, - /*quick_check_enabled=*/true); + base::WrapUnique(factory), nullptr); MockPacFileFetcher* fetcher = new MockPacFileFetcher; service.SetPacFileFetchers(base::WrapUnique(fetcher), @@ -3271,8 +3221,7 @@ new MockAsyncProxyResolverFactory(true); ConfiguredProxyResolutionService service(base::WrapUnique(config_service), - base::WrapUnique(factory), nullptr, - /*quick_check_enabled=*/true); + base::WrapUnique(factory), nullptr); MockPacFileFetcher* fetcher = new MockPacFileFetcher; service.SetPacFileFetchers(base::WrapUnique(fetcher), @@ -3388,8 +3337,7 @@ new MockAsyncProxyResolverFactory(true); ConfiguredProxyResolutionService service(base::WrapUnique(config_service), - base::WrapUnique(factory), nullptr, - /*quick_check_enabled=*/true); + base::WrapUnique(factory), nullptr); MockPacFileFetcher* fetcher = new MockPacFileFetcher; service.SetPacFileFetchers(base::WrapUnique(fetcher), @@ -3501,8 +3449,7 @@ new MockAsyncProxyResolverFactory(true); ConfiguredProxyResolutionService service(base::WrapUnique(config_service), - base::WrapUnique(factory), nullptr, - /*quick_check_enabled=*/true); + base::WrapUnique(factory), nullptr); MockPacFileFetcher* fetcher = new MockPacFileFetcher; service.SetPacFileFetchers(base::WrapUnique(fetcher), @@ -3676,8 +3623,7 @@ new MockAsyncProxyResolverFactory(true); ConfiguredProxyResolutionService service(base::WrapUnique(config_service), - base::WrapUnique(factory), nullptr, - /*quick_check_enabled=*/true); + base::WrapUnique(factory), nullptr); MockPacFileFetcher* fetcher = new MockPacFileFetcher; service.SetPacFileFetchers(base::WrapUnique(fetcher), @@ -3785,8 +3731,7 @@ factory = new MockAsyncProxyResolverFactory(false); service_.reset(new ConfiguredProxyResolutionService( - std::move(config_service), base::WrapUnique(factory), nullptr, - /*quick_check_enabled=*/true)); + std::move(config_service), base::WrapUnique(factory), nullptr)); // Do an initial request to initialize the service (configure the PAC // script). @@ -3949,8 +3894,7 @@ new MockAsyncProxyResolverFactory(true); ConfiguredProxyResolutionService service(base::WrapUnique(config_service), - base::WrapUnique(factory), nullptr, - /*quick_check_enabled=*/true); + base::WrapUnique(factory), nullptr); MockPacFileFetcher* fetcher = new MockPacFileFetcher; service.SetPacFileFetchers(base::WrapUnique(fetcher), @@ -3983,8 +3927,7 @@ new MockAsyncProxyResolverFactory(true); ConfiguredProxyResolutionService service(base::WrapUnique(config_service), - base::WrapUnique(factory), nullptr, - /*quick_check_enabled=*/true); + base::WrapUnique(factory), nullptr); MockPacFileFetcher* fetcher = new MockPacFileFetcher; service.SetPacFileFetchers(base::WrapUnique(fetcher), @@ -4012,8 +3955,7 @@ ConfiguredProxyResolutionService service( base::WrapUnique(config_service), - std::make_unique<MockAsyncProxyResolverFactory>(false), nullptr, - /*quick_check_enabled=*/true); + std::make_unique<MockAsyncProxyResolverFactory>(false), nullptr); pac_histogram.VerifyHistogram(); @@ -4124,8 +4066,7 @@ MockAsyncProxyResolverFactory* factory = new MockAsyncProxyResolverFactory(true); ConfiguredProxyResolutionService service(base::WrapUnique(config_service), - base::WrapUnique(factory), nullptr, - /*quick_check_enabled=*/true); + base::WrapUnique(factory), nullptr); MockPacFileFetcher* fetcher = new MockPacFileFetcher; service.SetPacFileFetchers(base::WrapUnique(fetcher), @@ -4187,8 +4128,7 @@ ConfiguredProxyResolutionService service( base::WrapUnique(config_service), - std::make_unique<MockAsyncProxyResolverFactory>(false), nullptr, - /*quick_check_enabled=*/true); + std::make_unique<MockAsyncProxyResolverFactory>(false), nullptr); ConfiguredProxyResolutionService* casted_service = nullptr; EXPECT_TRUE(service.CastToConfiguredProxyResolutionService(&casted_service));
diff --git a/net/quic/quic_connection_logger.cc b/net/quic/quic_connection_logger.cc index 1440a13..a8c5285f 100644 --- a/net/quic/quic_connection_logger.cc +++ b/net/quic/quic_connection_logger.cc
@@ -593,6 +593,14 @@ } } +void QuicConnectionLogger::OnStreamFrameCoalesced( + const quic::QuicStreamFrame& frame) { + if (!net_log_.IsCapturing()) + return; + net_log_.AddEvent(NetLogEventType::QUIC_SESSION_STREAM_FRAME_COALESCED, + [&] { return NetLogQuicStreamFrameParams(frame); }); +} + void QuicConnectionLogger::OnPacketSent( const quic::SerializedPacket& serialized_packet, quic::TransmissionType transmission_type, @@ -954,6 +962,24 @@ frame.message_length); } +void QuicConnectionLogger::OnHandshakeDoneFrame( + const quic::QuicHandshakeDoneFrame& frame) { + if (!net_log_.IsCapturing()) + return; + net_log_.AddEvent( + NetLogEventType::QUIC_SESSION_HANDSHAKE_DONE_FRAME_RECEIVED); +} + +void QuicConnectionLogger::OnCoalescedPacketSent( + const quic::QuicCoalescedPacket& coalesced_packet, + size_t length) { + if (!net_log_.IsCapturing()) + return; + net_log_.AddEventWithStringParams( + NetLogEventType::QUIC_SESSION_COALESCED_PACKET_SENT, "info", + coalesced_packet.ToString(length)); +} + void QuicConnectionLogger::OnPublicResetPacket( const quic::QuicPublicResetPacket& packet) { UpdatePublicResetAddressMismatchHistogram(
diff --git a/net/quic/quic_connection_logger.h b/net/quic/quic_connection_logger.h index 30d6729..58bbcf6 100644 --- a/net/quic/quic_connection_logger.h +++ b/net/quic/quic_connection_logger.h
@@ -44,6 +44,7 @@ // quic::QuicPacketCreator::DebugDelegateInterface void OnFrameAddedToPacket(const quic::QuicFrame& frame) override; + void OnStreamFrameCoalesced(const quic::QuicStreamFrame& frame) override; // QuicConnectionDebugVisitorInterface void OnPacketSent(const quic::SerializedPacket& serialized_packet, @@ -94,6 +95,9 @@ void OnRetireConnectionIdFrame( const quic::QuicRetireConnectionIdFrame& frame) override; void OnMessageFrame(const quic::QuicMessageFrame& frame) override; + void OnHandshakeDoneFrame(const quic::QuicHandshakeDoneFrame& frame) override; + void OnCoalescedPacketSent(const quic::QuicCoalescedPacket& coalesced_packet, + size_t length) override; void OnPublicResetPacket(const quic::QuicPublicResetPacket& packet) override; void OnVersionNegotiationPacket( const quic::QuicVersionNegotiationPacket& packet) override;
diff --git a/net/quic/quic_http3_logger.cc b/net/quic/quic_http3_logger.cc index 1b5f923f..0d08aec 100644 --- a/net/quic/quic_http3_logger.cc +++ b/net/quic/quic_http3_logger.cc
@@ -20,7 +20,6 @@ base::Value NetLogSettingsParams(const quic::SettingsFrame& frame) { base::Value dict(base::Value::Type::DICTIONARY); - // TODO(renjietang): Use string literal for setting identifiers. for (auto setting : frame.values) { dict.SetIntKey( quic::SpdyUtils::H3SettingsToString(
diff --git a/net/reporting/reporting_uploader.cc b/net/reporting/reporting_uploader.cc index d33e518c..aacec913 100644 --- a/net/reporting/reporting_uploader.cc +++ b/net/reporting/reporting_uploader.cc
@@ -14,6 +14,7 @@ #include "base/strings/string_split.h" #include "base/strings/string_util.h" #include "net/base/elements_upload_data_stream.h" +#include "net/base/isolation_info.h" #include "net/base/load_flags.h" #include "net/base/network_isolation_key.h" #include "net/base/upload_bytes_element_reader.h" @@ -177,7 +178,9 @@ upload->request->SetLoadFlags(LOAD_DISABLE_CACHE); upload->request->set_allow_credentials(false); - upload->request->set_network_isolation_key(upload->network_isolation_key); + upload->request->set_isolation_info(IsolationInfo::CreatePartial( + IsolationInfo::RedirectMode::kUpdateNothing, + upload->network_isolation_key)); upload->request->SetExtraRequestHeaderByName( HttpRequestHeaders::kOrigin, upload->report_origin.Serialize(), true); @@ -208,7 +211,9 @@ upload->request->SetLoadFlags(LOAD_DISABLE_CACHE); upload->request->set_allow_credentials(false); - upload->request->set_network_isolation_key(upload->network_isolation_key); + upload->request->set_isolation_info(IsolationInfo::CreatePartial( + IsolationInfo::RedirectMode::kUpdateNothing, + upload->network_isolation_key)); upload->request->SetExtraRequestHeaderByName( HttpRequestHeaders::kContentType, kUploadContentType, true);
diff --git a/net/url_request/url_request.cc b/net/url_request/url_request.cc index 5c742cf..e1296e2 100644 --- a/net/url_request/url_request.cc +++ b/net/url_request/url_request.cc
@@ -279,7 +279,7 @@ dict.SetStringKey("method", method_); dict.SetStringKey("network_isolation_key", - network_isolation_key_.ToDebugString()); + isolation_info_.network_isolation_key().ToDebugString()); dict.SetBoolKey("has_upload", has_upload()); dict.SetBoolKey("is_pending", is_pending_); @@ -622,8 +622,8 @@ net_log_.BeginEvent(NetLogEventType::URL_REQUEST_START_JOB, [&] { return NetLogURLRequestStartParams( - url(), method_, load_flags_, privacy_mode_, network_isolation_key_, - site_for_cookies_, initiator_, + url(), method_, load_flags_, privacy_mode_, + isolation_info_.network_isolation_key(), site_for_cookies_, initiator_, upload_data_stream_ ? upload_data_stream_->identifier() : -1); }); @@ -922,6 +922,8 @@ referrer_ = redirect_info.new_referrer; referrer_policy_ = redirect_info.new_referrer_policy; site_for_cookies_ = redirect_info.new_site_for_cookies; + isolation_info_ = isolation_info_.CreateForRedirect( + url::Origin::Create(redirect_info.new_url)); url_chain_.push_back(redirect_info.new_url); --redirect_limit_; @@ -1030,7 +1032,7 @@ bool enable_privacy_mode = !g_default_can_use_cookies; if (network_delegate_) { enable_privacy_mode = network_delegate_->ForcePrivacyMode( - url(), site_for_cookies_, network_isolation_key_.GetTopFrameOrigin()); + url(), site_for_cookies_, isolation_info_.top_frame_origin()); } return enable_privacy_mode ? PRIVACY_MODE_ENABLED : PRIVACY_MODE_DISABLED; }
diff --git a/net/url_request/url_request.h b/net/url_request/url_request.h index 2d3e5c6..c1dfbab 100644 --- a/net/url_request/url_request.h +++ b/net/url_request/url_request.h
@@ -22,12 +22,12 @@ #include "base/time/time.h" #include "net/base/auth.h" #include "net/base/ip_endpoint.h" +#include "net/base/isolation_info.h" #include "net/base/load_states.h" #include "net/base/load_timing_info.h" #include "net/base/net_error_details.h" #include "net/base/net_export.h" #include "net/base/network_delegate.h" -#include "net/base/network_isolation_key.h" #include "net/base/privacy_mode.h" #include "net/base/proxy_server.h" #include "net/base/request_priority.h" @@ -276,14 +276,17 @@ // This method may only be called before Start(). void set_site_for_cookies(const SiteForCookies& site_for_cookies); - // This key is used to isolate requests from different contexts in accessing - // shared network resources like the cache. - const NetworkIsolationKey& network_isolation_key() const { - return network_isolation_key_; + // Sets IsolationInfo for the request, which affects whether SameSite cookies + // are sent, what NetworkIsolationKey is used for cached resources, and how + // that behavior changes when following redirects. This may only be changed + // before Start() is called. + // + // TODO(https://crbug.com/1060631): This isn't actually used yet for SameSite + // cookies. Update consumers and fix that. + void set_isolation_info(const IsolationInfo& isolation_info) { + isolation_info_ = isolation_info; } - void set_network_isolation_key(const NetworkIsolationKey& key) { - network_isolation_key_ = key; - } + const IsolationInfo& isolation_info() const { return isolation_info_; } // Indicate whether SameSite cookies should be attached even though the // request is cross-site. @@ -842,7 +845,7 @@ std::vector<GURL> url_chain_; SiteForCookies site_for_cookies_; - NetworkIsolationKey network_isolation_key_; + IsolationInfo isolation_info_; bool attach_same_site_cookies_; base::Optional<url::Origin> initiator_;
diff --git a/net/url_request/url_request_context_builder.cc b/net/url_request/url_request_context_builder.cc index 6bc7ae4..2e255cb 100644 --- a/net/url_request/url_request_context_builder.cc +++ b/net/url_request/url_request_context_builder.cc
@@ -498,7 +498,17 @@ proxy_resolution_service_ = CreateProxyResolutionService( std::move(proxy_config_service_), context.get(), context->host_resolver(), context->network_delegate(), - context->net_log(), pac_quick_check_enabled_); + context->net_log()); + + // Although CreateProxyResolutionService() tries its best to set the PAC + // quick check flag, it may be overridden by a child class. We should make + // sure we set that value here if applicable. + ConfiguredProxyResolutionService* configured_proxy_resolution_service = + nullptr; + if (proxy_resolution_service_->CastToConfiguredProxyResolutionService( + &configured_proxy_resolution_service)) + configured_proxy_resolution_service->set_quick_check_enabled( + pac_quick_check_enabled_); } ProxyResolutionService* proxy_resolution_service = proxy_resolution_service_.get(); @@ -624,10 +634,9 @@ URLRequestContext* url_request_context, HostResolver* host_resolver, NetworkDelegate* network_delegate, - NetLog* net_log, - bool pac_quick_check_enabled) { + NetLog* net_log) { return ConfiguredProxyResolutionService::CreateUsingSystemProxyResolver( - std::move(proxy_config_service), net_log, pac_quick_check_enabled); + std::move(proxy_config_service), pac_quick_check_enabled_, net_log); } } // namespace net
diff --git a/net/url_request/url_request_context_builder.h b/net/url_request/url_request_context_builder.h index 1c21cbe3..f3ab423 100644 --- a/net/url_request/url_request_context_builder.h +++ b/net/url_request/url_request_context_builder.h
@@ -326,8 +326,7 @@ URLRequestContext* url_request_context, HostResolver* host_resolver, NetworkDelegate* network_delegate, - NetLog* net_log, - bool pac_quick_check_enabled); + NetLog* net_log); private: std::string name_;
diff --git a/net/url_request/url_request_http_job.cc b/net/url_request/url_request_http_job.cc index c57348b4..221d7cd 100644 --- a/net/url_request/url_request_http_job.cc +++ b/net/url_request/url_request_http_job.cc
@@ -259,7 +259,8 @@ request_info_.url = request_->url(); request_info_.method = request_->method(); - request_info_.network_isolation_key = request_->network_isolation_key(); + request_info_.network_isolation_key = + request_->isolation_info().network_isolation_key(); request_info_.load_flags = request_->load_flags(); request_info_.disable_secure_dns = request_->disable_secure_dns(); request_info_.traffic_annotation =
diff --git a/net/url_request/url_request_http_job_unittest.cc b/net/url_request/url_request_http_job_unittest.cc index ce1f2ca9..5b175d2 100644 --- a/net/url_request/url_request_http_job_unittest.cc +++ b/net/url_request/url_request_http_job_unittest.cc
@@ -21,6 +21,7 @@ #include "base/test/bind_test_util.h" #include "base/test/metrics/histogram_tester.h" #include "net/base/auth.h" +#include "net/base/isolation_info.h" #include "net/base/request_priority.h" #include "net/cert/ct_policy_status.h" #include "net/cookies/cookie_monster.h" @@ -459,7 +460,8 @@ TEST_F(URLRequestHttpJobWithMockSocketsTest, TestSuccessfulCachedHeadRequest) { const url::Origin kOrigin1 = url::Origin::Create(GURL("http://www.example.com")); - const NetworkIsolationKey kTestNetworkIsolationKey(kOrigin1, kOrigin1); + const IsolationInfo kTestIsolationInfo = + IsolationInfo::CreateForInternalRequest(kOrigin1); // Cache the response. { @@ -476,7 +478,7 @@ GURL("http://www.example.com"), DEFAULT_PRIORITY, &delegate, TRAFFIC_ANNOTATION_FOR_TESTS); - request->set_network_isolation_key(kTestNetworkIsolationKey); + request->set_isolation_info(kTestIsolationInfo); request->Start(); ASSERT_TRUE(request->is_pending()); delegate.RunUntilComplete(); @@ -505,7 +507,7 @@ // Use the cached version. request->SetLoadFlags(LOAD_SKIP_CACHE_VALIDATION); request->set_method("HEAD"); - request->set_network_isolation_key(kTestNetworkIsolationKey); + request->set_isolation_info(kTestIsolationInfo); request->Start(); ASSERT_TRUE(request->is_pending()); delegate.RunUntilComplete();
diff --git a/net/url_request/url_request_quic_unittest.cc b/net/url_request/url_request_quic_unittest.cc index a9145151..dd512da 100644 --- a/net/url_request/url_request_quic_unittest.cc +++ b/net/url_request/url_request_quic_unittest.cc
@@ -13,6 +13,7 @@ #include "base/test/bind_test_util.h" #include "build/build_config.h" #include "net/base/features.h" +#include "net/base/isolation_info.h" #include "net/base/load_timing_info.h" #include "net/base/network_delegate.h" #include "net/cert/mock_cert_verifier.h" @@ -349,7 +350,8 @@ const url::Origin kOrigin1 = url::Origin::Create(GURL("http://www.example.com")); - const NetworkIsolationKey kTestNetworkIsolationKey(kOrigin1, kOrigin1); + const IsolationInfo kTestIsolationInfo = + IsolationInfo::CreateForInternalRequest(kOrigin1); Init(); @@ -359,7 +361,7 @@ std::unique_ptr<URLRequest> request_0 = CreateRequest( GURL(UrlFromPath(kKittenPath)), DEFAULT_PRIORITY, &delegate_0); - request_0->set_network_isolation_key(kTestNetworkIsolationKey); + request_0->set_isolation_info(kTestIsolationInfo); request_0->Start(); ASSERT_TRUE(request_0->is_pending()); @@ -374,7 +376,7 @@ std::unique_ptr<URLRequest> request = CreateRequest(GURL(UrlFromPath(kIndexPath)), DEFAULT_PRIORITY, &delegate); - request->set_network_isolation_key(kTestNetworkIsolationKey); + request->set_isolation_info(kTestIsolationInfo); request->Start(); ASSERT_TRUE(request->is_pending()); @@ -449,7 +451,8 @@ const url::Origin kOrigin1 = url::Origin::Create(GURL("http://www.example.com")); - const NetworkIsolationKey kTestNetworkIsolationKey(kOrigin1, kOrigin1); + const IsolationInfo kTestIsolationInfo = + IsolationInfo::CreateForInternalRequest(kOrigin1); Init(); @@ -459,7 +462,7 @@ std::unique_ptr<URLRequest> request_0 = CreateRequest( GURL(UrlFromPath(kKittenPath)), DEFAULT_PRIORITY, &delegate_0); - request_0->set_network_isolation_key(kTestNetworkIsolationKey); + request_0->set_isolation_info(kTestIsolationInfo); request_0->Start(); ASSERT_TRUE(request_0->is_pending()); @@ -474,7 +477,7 @@ std::unique_ptr<URLRequest> request_1 = CreateRequest( GURL(UrlFromPath(kFaviconPath)), DEFAULT_PRIORITY, &delegate_1); - request_1->set_network_isolation_key(kTestNetworkIsolationKey); + request_1->set_isolation_info(kTestIsolationInfo); request_1->Start(); ASSERT_TRUE(request_1->is_pending()); @@ -489,7 +492,7 @@ std::unique_ptr<URLRequest> request = CreateRequest(GURL(UrlFromPath(kIndexPath)), DEFAULT_PRIORITY, &delegate); - request->set_network_isolation_key(kTestNetworkIsolationKey); + request->set_isolation_info(kTestIsolationInfo); request->Start(); ASSERT_TRUE(request->is_pending());
diff --git a/net/url_request/url_request_unittest.cc b/net/url_request/url_request_unittest.cc index a2cee16..d254cc6 100644 --- a/net/url_request/url_request_unittest.cc +++ b/net/url_request/url_request_unittest.cc
@@ -57,6 +57,7 @@ #include "net/base/escape.h" #include "net/base/features.h" #include "net/base/hash_value.h" +#include "net/base/isolation_info.h" #include "net/base/load_flags.h" #include "net/base/load_timing_info.h" #include "net/base/load_timing_info_test_util.h" @@ -2805,14 +2806,14 @@ public: const url::Origin origin1_; const url::Origin origin2_; - const NetworkIsolationKey network_isolation_key1_; - const NetworkIsolationKey network_isolation_key2_; + const IsolationInfo isolation_info1_; + const IsolationInfo isolation_info2_; URLRequestTestHTTP() : origin1_(url::Origin::Create(GURL("https://foo.test/"))), origin2_(url::Origin::Create(GURL("https://bar.test/"))), - network_isolation_key1_(NetworkIsolationKey(origin1_, origin1_)), - network_isolation_key2_(NetworkIsolationKey(origin2_, origin2_)), + isolation_info1_(IsolationInfo::CreateForInternalRequest(origin1_)), + isolation_info2_(IsolationInfo::CreateForInternalRequest(origin2_)), test_server_(base::FilePath(kTestFilePath)) {} protected: @@ -5568,7 +5569,7 @@ TestDelegate d; std::unique_ptr<URLRequest> request(context.CreateRequest( request_url, DEFAULT_PRIORITY, &d, TRAFFIC_ANNOTATION_FOR_TESTS)); - request->set_network_isolation_key(network_isolation_key1_); + request->set_isolation_info(isolation_info1_); request->Start(); d.RunUntilComplete(); @@ -5581,7 +5582,7 @@ request = context.CreateRequest(request_url, DEFAULT_PRIORITY, &d, TRAFFIC_ANNOTATION_FOR_TESTS); - request->set_network_isolation_key(network_isolation_key1_); + request->set_isolation_info(isolation_info1_); request->Start(); d.RunUntilComplete(); @@ -5749,7 +5750,7 @@ d.set_credentials(AuthCredentials(kUser, kSecret)); std::unique_ptr<URLRequest> r(context.CreateRequest( request_url, DEFAULT_PRIORITY, &d, TRAFFIC_ANNOTATION_FOR_TESTS)); - r->set_network_isolation_key(network_isolation_key1_); + r->set_isolation_info(isolation_info1_); r->Start(); d.RunUntilComplete(); } @@ -5774,7 +5775,7 @@ std::unique_ptr<URLRequest> r(context.CreateRequest( request_url, DEFAULT_PRIORITY, &d, TRAFFIC_ANNOTATION_FOR_TESTS)); r->SetLoadFlags(LOAD_VALIDATE_CACHE); - r->set_network_isolation_key(network_isolation_key1_); + r->set_isolation_info(isolation_info1_); r->Start(); d.RunUntilComplete(); @@ -5970,7 +5971,7 @@ TestDelegate d; std::unique_ptr<URLRequest> req(default_context().CreateRequest( redirect_url, DEFAULT_PRIORITY, &d, TRAFFIC_ANNOTATION_FOR_TESTS)); - req->set_network_isolation_key(network_isolation_key1_); + req->set_isolation_info(isolation_info1_); req->Start(); d.RunUntilComplete(); EXPECT_EQ(OK, d.request_status()); @@ -5982,7 +5983,7 @@ TestDelegate d; std::unique_ptr<URLRequest> req(default_context().CreateRequest( redirect_url, DEFAULT_PRIORITY, &d, TRAFFIC_ANNOTATION_FOR_TESTS)); - req->set_network_isolation_key(network_isolation_key1_); + req->set_isolation_info(isolation_info1_); req->Start(); d.RunUntilRedirect(); @@ -6411,7 +6412,7 @@ HttpRequestHeaders headers; headers.SetHeader("foo", "1"); req->SetExtraRequestHeaders(headers); - req->set_network_isolation_key(network_isolation_key1_); + req->set_isolation_info(isolation_info1_); req->Start(); d.RunUntilComplete(); @@ -6429,7 +6430,7 @@ HttpRequestHeaders headers; headers.SetHeader("foo", "1"); req->SetExtraRequestHeaders(headers); - req->set_network_isolation_key(network_isolation_key1_); + req->set_isolation_info(isolation_info1_); req->Start(); d.RunUntilComplete(); @@ -6449,7 +6450,7 @@ HttpRequestHeaders headers; headers.SetHeader("foo", "2"); req->SetExtraRequestHeaders(headers); - req->set_network_isolation_key(network_isolation_key1_); + req->set_isolation_info(isolation_info1_); req->Start(); d.RunUntilComplete(); @@ -6472,7 +6473,7 @@ std::unique_ptr<URLRequest> r(default_context().CreateRequest( http_test_server()->GetURL("/auth-basic"), DEFAULT_PRIORITY, &d, TRAFFIC_ANNOTATION_FOR_TESTS)); - r->set_network_isolation_key(network_isolation_key1_); + r->set_isolation_info(isolation_info1_); r->Start(); d.RunUntilComplete(); @@ -6491,7 +6492,7 @@ http_test_server()->GetURL("/auth-basic"), DEFAULT_PRIORITY, &d, TRAFFIC_ANNOTATION_FOR_TESTS)); r->SetLoadFlags(LOAD_VALIDATE_CACHE); - r->set_network_isolation_key(network_isolation_key1_); + r->set_isolation_info(isolation_info1_); r->Start(); d.RunUntilComplete(); @@ -6609,6 +6610,97 @@ EXPECT_EQ(1, network_delegate.set_cookie_count()); } +// Tests the IsolationInfo is updated approiately on redirect. +TEST_F(URLRequestTestHTTP, IsolationInfoUpdatedOnRedirect) { + base::test::ScopedFeatureList feature_list; + feature_list.InitAndEnableFeature( + net::features::kSplitCacheByNetworkIsolationKey); + + ASSERT_TRUE(http_test_server()->Start()); + + GURL redirect_url = + http_test_server()->GetURL("redirected.test", "/cachetime"); + GURL original_url = http_test_server()->GetURL( + "original.test", "/server-redirect?" + redirect_url.spec()); + + url::Origin original_origin = url::Origin::Create(original_url); + url::Origin redirect_origin = url::Origin::Create(redirect_url); + + // Since transient IsolationInfos use opaque origins, need to create a single + // consistent transient origin one for be used as the original and updated + // info in the same test case. + IsolationInfo transient_isolation_info = IsolationInfo::CreateTransient(); + + const struct { + IsolationInfo info_before_redirect; + IsolationInfo expected_info_after_redirect; + } kTestCases[] = { + {IsolationInfo(), IsolationInfo()}, + {IsolationInfo::Create(IsolationInfo::RedirectMode::kUpdateTopFrame, + original_origin, original_origin, + SiteForCookies()), + IsolationInfo::Create(IsolationInfo::RedirectMode::kUpdateTopFrame, + redirect_origin, redirect_origin, + SiteForCookies::FromOrigin(redirect_origin))}, + {IsolationInfo::Create(IsolationInfo::RedirectMode::kUpdateFrameOnly, + original_origin, original_origin, + SiteForCookies::FromOrigin(original_origin)), + IsolationInfo::Create(IsolationInfo::RedirectMode::kUpdateFrameOnly, + original_origin, redirect_origin, + SiteForCookies::FromOrigin(original_origin))}, + {IsolationInfo::Create(IsolationInfo::RedirectMode::kUpdateNothing, + original_origin, original_origin, + SiteForCookies()), + IsolationInfo::Create(IsolationInfo::RedirectMode::kUpdateNothing, + original_origin, original_origin, + SiteForCookies())}, + {transient_isolation_info, transient_isolation_info}, + }; + + for (const auto& test_case : kTestCases) { + // Populate the cache, using the expected final IsolationInfo. + { + TestDelegate d; + + std::unique_ptr<URLRequest> r(default_context().CreateRequest( + redirect_url, DEFAULT_PRIORITY, &d, TRAFFIC_ANNOTATION_FOR_TESTS)); + r->set_isolation_info(test_case.expected_info_after_redirect); + r->Start(); + d.RunUntilComplete(); + EXPECT_THAT(d.request_status(), IsOk()); + } + + // Send a request using the initial IsolationInfo that should be redirected + // to the cached url, and should use the cached entry if the NIK was + // updated, except in the case the IsolationInfo's NIK was empty. + { + TestDelegate d; + + std::unique_ptr<URLRequest> r(default_context().CreateRequest( + original_url, DEFAULT_PRIORITY, &d, TRAFFIC_ANNOTATION_FOR_TESTS)); + r->set_isolation_info(test_case.info_before_redirect); + r->Start(); + d.RunUntilComplete(); + EXPECT_THAT(d.request_status(), IsOk()); + EXPECT_EQ(redirect_url, r->url()); + + EXPECT_EQ(!test_case.expected_info_after_redirect.network_isolation_key() + .IsTransient(), + r->was_cached()); + EXPECT_EQ(test_case.expected_info_after_redirect.redirect_mode(), + r->isolation_info().redirect_mode()); + EXPECT_EQ(test_case.expected_info_after_redirect.top_frame_origin(), + r->isolation_info().top_frame_origin()); + EXPECT_EQ(test_case.expected_info_after_redirect.frame_origin(), + r->isolation_info().frame_origin()); + EXPECT_EQ(test_case.expected_info_after_redirect.network_isolation_key(), + r->isolation_info().network_isolation_key()); + EXPECT_TRUE(test_case.expected_info_after_redirect.site_for_cookies() + .IsEquivalent(r->isolation_info().site_for_cookies())); + } + } +} + // Tests that |key_auth_cache_by_network_isolation_key| is respected. TEST_F(URLRequestTestHTTP, AuthWithNetworkIsolationKey) { ASSERT_TRUE(http_test_server()->Start()); @@ -6635,7 +6727,7 @@ std::unique_ptr<URLRequest> r(url_request_context.CreateRequest( url, DEFAULT_PRIORITY, &d, TRAFFIC_ANNOTATION_FOR_TESTS)); r->SetLoadFlags(LOAD_BYPASS_CACHE); - r->set_network_isolation_key(network_isolation_key1_); + r->set_isolation_info(isolation_info1_); r->Start(); d.RunUntilComplete(); @@ -6655,7 +6747,7 @@ http_test_server()->GetURL("/auth-basic"), DEFAULT_PRIORITY, &d, TRAFFIC_ANNOTATION_FOR_TESTS)); r->SetLoadFlags(LOAD_BYPASS_CACHE); - r->set_network_isolation_key(network_isolation_key2_); + r->set_isolation_info(isolation_info2_); r->Start(); d.RunUntilComplete(); @@ -7183,7 +7275,7 @@ std::unique_ptr<URLRequest> r(default_context().CreateRequest( http_test_server()->GetURL("/auth-basic"), DEFAULT_PRIORITY, &d, TRAFFIC_ANNOTATION_FOR_TESTS)); - r->set_network_isolation_key(network_isolation_key1_); + r->set_isolation_info(isolation_info1_); r->Start(); d.RunUntilAuthRequired(); @@ -7218,7 +7310,7 @@ http_test_server()->GetURL("/auth-basic"), DEFAULT_PRIORITY, &d, TRAFFIC_ANNOTATION_FOR_TESTS)); r->SetLoadFlags(LOAD_VALIDATE_CACHE); - r->set_network_isolation_key(network_isolation_key1_); + r->set_isolation_info(isolation_info1_); r->Start(); d.RunUntilComplete(); @@ -8002,7 +8094,7 @@ std::unique_ptr<URLRequest> req(default_context().CreateRequest( http_test_server()->GetURL("/cachetime"), DEFAULT_PRIORITY, &d, TRAFFIC_ANNOTATION_FOR_TESTS)); - req->set_network_isolation_key(network_isolation_key1_); + req->set_isolation_info(isolation_info1_); req->Start(); d.RunUntilComplete(); @@ -8013,7 +8105,7 @@ req = default_context().CreateRequest( http_test_server()->GetURL("/cachetime"), DEFAULT_PRIORITY, &d, TRAFFIC_ANNOTATION_FOR_TESTS); - req->set_network_isolation_key(network_isolation_key1_); + req->set_isolation_info(isolation_info1_); req->Start(); d.RunUntilComplete(); @@ -11332,7 +11424,7 @@ [](scoped_refptr<const HttpResponseHeaders>* left, scoped_refptr<const HttpResponseHeaders> right) { *left = right; }, base::Unretained(&raw_resp_headers))); - r->set_network_isolation_key(network_isolation_key1_); + r->set_isolation_info(isolation_info1_); r->Start(); while (!delegate.response_started_count()) base::RunLoop().RunUntilIdle(); @@ -11358,7 +11450,7 @@ base::Bind([](scoped_refptr<const HttpResponseHeaders>) { FAIL() << "Callback should not be called unless request is sent"; })); - r->set_network_isolation_key(network_isolation_key1_); + r->set_isolation_info(isolation_info1_); r->Start(); delegate.RunUntilComplete(); EXPECT_TRUE(r->was_cached()); @@ -11466,7 +11558,7 @@ r->SetExtraRequestHeaders(extra_headers); r->SetRequestHeadersCallback(req_headers_callback); r->SetResponseHeadersCallback(resp_headers_callback); - r->set_network_isolation_key(network_isolation_key1_); + r->set_isolation_info(isolation_info1_); r->Start(); delegate.RunUntilComplete(); EXPECT_FALSE(r->is_pending()); @@ -11490,7 +11582,7 @@ r2->SetRequestHeadersCallback(req_headers_callback); r2->SetResponseHeadersCallback(resp_headers_callback); r2->SetLoadFlags(LOAD_VALIDATE_CACHE); - r2->set_network_isolation_key(network_isolation_key1_); + r2->set_isolation_info(isolation_info1_); r2->Start(); delegate.RunUntilComplete(); EXPECT_FALSE(r2->is_pending());
diff --git a/net/websockets/websocket_end_to_end_test.cc b/net/websockets/websocket_end_to_end_test.cc index 8a7c393..86e2580 100644 --- a/net/websockets/websocket_end_to_end_test.cc +++ b/net/websockets/websocket_end_to_end_test.cc
@@ -465,8 +465,8 @@ ProxyConfigWithAnnotation(proxy_config, TRAFFIC_ANNOTATION_FOR_TESTS)); std::unique_ptr<ProxyResolutionService> proxy_resolution_service( ConfiguredProxyResolutionService::CreateUsingSystemProxyResolver( - std::move(proxy_config_service), NetLog::Get(), - /*quick_check_enabled=*/true)); + std::move(proxy_config_service), /*quick_check_enabled=*/true, + NetLog::Get())); ASSERT_EQ(ws_server.host_port_pair().host(), "127.0.0.1"); context_.set_proxy_resolution_service(proxy_resolution_service.get()); InitialiseContext();
diff --git a/net/websockets/websocket_stream.cc b/net/websockets/websocket_stream.cc index 0087486b6..934a8c8 100644 --- a/net/websockets/websocket_stream.cc +++ b/net/websockets/websocket_stream.cc
@@ -13,6 +13,7 @@ #include "base/time/time.h" #include "base/timer/timer.h" #include "net/base/ip_endpoint.h" +#include "net/base/isolation_info.h" #include "net/base/load_flags.h" #include "net/base/url_util.h" #include "net/http/http_request_headers.h" @@ -141,7 +142,8 @@ url_request_->SetExtraRequestHeaders(headers); url_request_->set_initiator(origin); url_request_->set_site_for_cookies(site_for_cookies); - url_request_->set_network_isolation_key(network_isolation_key); + url_request_->set_isolation_info(IsolationInfo::CreatePartial( + IsolationInfo::RedirectMode::kUpdateNothing, network_isolation_key)); auto create_helper = std::make_unique<WebSocketHandshakeStreamCreateHelper>( connect_delegate_.get(), requested_subprotocols, this);
diff --git a/printing/backend/print_backend.h b/printing/backend/print_backend.h index daecb5f..2c3848a 100644 --- a/printing/backend/print_backend.h +++ b/printing/backend/print_backend.h
@@ -113,6 +113,7 @@ }; using Papers = std::vector<Paper>; Papers papers; + Papers user_defined_papers; Paper default_paper; std::vector<gfx::Size> dpis;
diff --git a/remoting/host/backoff_timer.cc b/remoting/host/backoff_timer.cc index a7dd3d3..ecffc5a 100644 --- a/remoting/host/backoff_timer.cc +++ b/remoting/host/backoff_timer.cc
@@ -41,7 +41,7 @@ void BackoffTimer::StartTimer() { timer_->Start( posted_from_, backoff_entry_->GetTimeUntilRelease(), - base::Bind(&BackoffTimer::OnTimerFired, base::Unretained(this))); + base::BindOnce(&BackoffTimer::OnTimerFired, base::Unretained(this))); } void BackoffTimer::OnTimerFired() {
diff --git a/remoting/host/client_session.cc b/remoting/host/client_session.cc index b5ff08b..30b5c59a 100644 --- a/remoting/host/client_session.cc +++ b/remoting/host/client_session.cc
@@ -304,8 +304,8 @@ if (max_duration_ > base::TimeDelta()) { max_duration_timer_.Start( FROM_HERE, max_duration_, - base::Bind(&ClientSession::DisconnectSession, base::Unretained(this), - protocol::MAX_SESSION_LENGTH)); + base::BindOnce(&ClientSession::DisconnectSession, + base::Unretained(this), protocol::MAX_SESSION_LENGTH)); } // Notify EventHandler.
diff --git a/remoting/host/client_session_unittest.cc b/remoting/host/client_session_unittest.cc index 2fe3589..50e64f8 100644 --- a/remoting/host/client_session_unittest.cc +++ b/remoting/host/client_session_unittest.cc
@@ -39,25 +39,6 @@ #include "third_party/webrtc/modules/desktop_capture/desktop_geometry.h" #include "ui/events/event.h" -// TODO(crbug.com/961064): Fix memory leaks in tests and re-enable on LSAN. -#ifdef LEAK_SANITIZER -#define MAYBE_LocalInputTest DISABLED_LocalInputTest -#define MAYBE_ClampMouseEvents DISABLED_ClampMouseEvents -#define MAYBE_DisableInputs DISABLED_DisableInputs -#define MAYBE_MultiMonMouseMove_SameSize DISABLED_MultiMonMouseMove_SameSize -#define MAYBE_RestoreEventState DISABLED_RestoreEventState -#define MAYBE_MultiMonMouseMove DISABLED_MultiMonMouseMove -#define MAYBE_DisconnectOnLocalInputTest DISABLED_DisconnectOnLocalInputTest -#else -#define MAYBE_LocalInputTest LocalInputTest -#define MAYBE_ClampMouseEvents ClampMouseEvents -#define MAYBE_DisableInputs DisableInputs -#define MAYBE_MultiMonMouseMove_SameSize MultiMonMouseMove_SameSize -#define MAYBE_RestoreEventState RestoreEventState -#define MAYBE_MultiMonMouseMove MultiMonMouseMove -#define MAYBE_DisconnectOnLocalInputTest DisconnectOnLocalInputTest -#endif - namespace remoting { using protocol::FakeSession; @@ -312,22 +293,22 @@ int x_min, x_max, y_min, y_max; bool initialized = false; - for (DisplayGeometry disp : displays_.displays()) { - int disp_x_max = disp.x + disp.width; - int disp_y_max = disp.y + disp.height; + for (auto& disp : displays_.displays()) { + int disp_x_max = disp->x + disp->width; + int disp_y_max = disp->y + disp->height; if (!initialized) { - x_min = disp.x; + x_min = disp->x; x_max = disp_x_max; - y_min = disp.y; + y_min = disp->y; y_max = disp_y_max; initialized = true; } else { - if (disp.x < x_min) - x_min = disp.x; + if (disp->x < x_min) + x_min = disp->x; if (disp_x_max > x_max) x_max = disp_x_max; - if (disp.y < y_min) - y_min = disp.y; + if (disp->y < y_min) + y_min = disp->y; if (disp_y_max > y_max) y_max = disp_y_max; } @@ -430,7 +411,7 @@ NotifyVideoSizeAll(); } -TEST_F(ClientSessionTest, MAYBE_MultiMonMouseMove) { +TEST_F(ClientSessionTest, MultiMonMouseMove) { CreateClientSession(); ConnectClientSession(); SetupMultiDisplay(); @@ -487,7 +468,7 @@ kDisplay2Height + kDisplay2YOffset - 1)); } -TEST_F(ClientSessionTest, MAYBE_MultiMonMouseMove_SameSize) { +TEST_F(ClientSessionTest, MultiMonMouseMove_SameSize) { CreateClientSession(); ConnectClientSession(); SetupMultiDisplay_SameSize(); @@ -543,7 +524,7 @@ kDisplay1Height + kDisplay2YOffset - 1)); } -TEST_F(ClientSessionTest, MAYBE_DisableInputs) { +TEST_F(ClientSessionTest, DisableInputs) { CreateClientSession(); ConnectClientSession(); SetupSingleDisplay(); @@ -599,7 +580,7 @@ EqualsClipboardEvent(kMimeTypeTextUtf8, "c")); } -TEST_F(ClientSessionTest, MAYBE_LocalInputTest) { +TEST_F(ClientSessionTest, LocalInputTest) { CreateClientSession(); ConnectClientSession(); SetupSingleDisplay(); @@ -639,7 +620,7 @@ // eventually (via dependency injection, not sleep!) } -TEST_F(ClientSessionTest, MAYBE_DisconnectOnLocalInputTest) { +TEST_F(ClientSessionTest, DisconnectOnLocalInputTest) { desktop_environment_options_.set_terminate_upon_input(true); CreateClientSession(); ConnectClientSession(); @@ -650,7 +631,7 @@ EXPECT_FALSE(connection_->is_connected()); } -TEST_F(ClientSessionTest, MAYBE_RestoreEventState) { +TEST_F(ClientSessionTest, RestoreEventState) { CreateClientSession(); ConnectClientSession(); SetupSingleDisplay(); @@ -688,7 +669,7 @@ EXPECT_THAT(key_events[3], EqualsKeyEvent(2, false)); } -TEST_F(ClientSessionTest, MAYBE_ClampMouseEvents) { +TEST_F(ClientSessionTest, ClampMouseEvents) { CreateClientSession(); ConnectClientSession(); SetupSingleDisplay();
diff --git a/remoting/host/continue_window_mac.mm b/remoting/host/continue_window_mac.mm index ffb0a9a..07b272b9 100644 --- a/remoting/host/continue_window_mac.mm +++ b/remoting/host/continue_window_mac.mm
@@ -56,6 +56,9 @@ ContinueWindowMac::~ContinueWindowMac() { DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); + if (controller_) { + HideUi(); + } } void ContinueWindowMac::ShowUi() { @@ -73,6 +76,7 @@ @autoreleasepool { [controller_ hide]; + controller_.reset(); } }
diff --git a/remoting/host/daemon_process_unittest.cc b/remoting/host/daemon_process_unittest.cc index 857868f..4d267d0e 100644 --- a/remoting/host/daemon_process_unittest.cc +++ b/remoting/host/daemon_process_unittest.cc
@@ -165,7 +165,8 @@ void DaemonProcessTest::SetUp() { scoped_refptr<AutoThreadTaskRunner> task_runner = new AutoThreadTaskRunner( task_environment_.GetMainThreadTaskRunner(), - base::Bind(&DaemonProcessTest::QuitMessageLoop, base::Unretained(this))); + base::BindOnce(&DaemonProcessTest::QuitMessageLoop, + base::Unretained(this))); daemon_process_.reset( new MockDaemonProcess(task_runner, task_runner, base::Bind(&DaemonProcessTest::DeleteDaemonProcess,
diff --git a/remoting/host/desktop_capturer_proxy.cc b/remoting/host/desktop_capturer_proxy.cc index 80c75de..cc446146 100644 --- a/remoting/host/desktop_capturer_proxy.cc +++ b/remoting/host/desktop_capturer_proxy.cc
@@ -193,8 +193,9 @@ SourceId id = -1; if (id_index >= 0 && id_index < desktop_display_info_->NumDisplays()) { - DisplayGeometry display = desktop_display_info_->displays()[id_index]; - id = display.id; + const DisplayGeometry* display = + desktop_display_info_->displays()[id_index].get(); + id = display->id; } capture_task_runner_->PostTask( FROM_HERE, @@ -217,17 +218,17 @@ auto layout = std::make_unique<protocol::VideoLayout>(); LOG(INFO) << "DCP::OnFrameCaptured"; - for (auto display : desktop_display_info_->displays()) { + for (auto& display : desktop_display_info_->displays()) { protocol::VideoTrackLayout* track = layout->add_video_track(); - track->set_position_x(display.x); - track->set_position_y(display.y); - track->set_width(display.width); - track->set_height(display.height); - track->set_x_dpi(display.dpi); - track->set_y_dpi(display.dpi); - LOG(INFO) << " Display: " << display.x << "," << display.y << " " - << display.width << "x" << display.height << " @ " - << display.dpi; + track->set_position_x(display->x); + track->set_position_y(display->y); + track->set_width(display->width); + track->set_height(display->height); + track->set_x_dpi(display->dpi); + track->set_y_dpi(display->dpi); + LOG(INFO) << " Display: " << display->x << "," << display->y << " " + << display->width << "x" << display->height << " @ " + << display->dpi; } client_session_control_->OnDesktopDisplayChanged(std::move(layout)); }
diff --git a/remoting/host/desktop_display_info.cc b/remoting/host/desktop_display_info.cc index 299a24c..8e7f5d6 100644 --- a/remoting/host/desktop_display_info.cc +++ b/remoting/host/desktop_display_info.cc
@@ -20,16 +20,16 @@ bool DesktopDisplayInfo::operator==(const DesktopDisplayInfo& other) { if (other.displays_.size() == displays_.size()) { for (size_t display = 0; display < displays_.size(); display++) { - DisplayGeometry this_display = displays_[display]; - DisplayGeometry other_display = other.displays_[display]; - if (this_display.id != other_display.id || - this_display.x != other_display.x || - this_display.y != other_display.y || - this_display.width != other_display.width || - this_display.height != other_display.height || - this_display.dpi != other_display.dpi || - this_display.bpp != other_display.bpp || - this_display.is_default != other_display.is_default) { + const DisplayGeometry* this_display = displays_[display].get(); + const DisplayGeometry* other_display = other.displays_[display].get(); + if (this_display->id != other_display->id || + this_display->x != other_display->x || + this_display->y != other_display->y || + this_display->width != other_display->width || + this_display->height != other_display->height || + this_display->dpi != other_display->dpi || + this_display->bpp != other_display->bpp || + this_display->is_default != other_display->is_default) { return false; } } @@ -69,7 +69,7 @@ const DisplayGeometry* DesktopDisplayInfo::GetDisplayInfo(unsigned int id) { if (id < 0 || id >= displays_.size()) return nullptr; - return &displays_[id]; + return displays_[id].get(); } // Calculate the offset from the origin of the desktop to the origin of the @@ -118,18 +118,18 @@ return webrtc::DesktopVector(); } - DisplayGeometry disp_info = displays_[disp_index]; - webrtc::DesktopVector origin(disp_info.x, disp_info.y); + const DisplayGeometry* disp_info = displays_[disp_index].get(); + webrtc::DesktopVector origin(disp_info->x, disp_info->y); // Find topleft-most display coordinate. This is the topleft of the desktop. int dx = 0; int dy = 0; - for (size_t id = 0; id < displays_.size(); id++) { - DisplayGeometry disp = displays_[id]; - if (disp.x < dx) - dx = disp.x; - if (disp.y < dy) - dy = disp.y; + for (auto& display : displays_) { + const DisplayGeometry* disp = display.get(); + if (disp->x < dx) + dx = disp->x; + if (disp->y < dy) + dy = disp->y; } webrtc::DesktopVector topleft(dx, dy); @@ -149,12 +149,12 @@ #endif // defined(OS_MACOSX) } -void DesktopDisplayInfo::AddDisplay(DisplayGeometry* display) { - displays_.push_back(*display); +void DesktopDisplayInfo::AddDisplay(std::unique_ptr<DisplayGeometry> display) { + displays_.push_back(std::move(display)); } void DesktopDisplayInfo::AddDisplayFrom(protocol::VideoTrackLayout track) { - auto* display = new DisplayGeometry(); + std::unique_ptr<DisplayGeometry> display(new DisplayGeometry()); display->x = track.position_x(); display->y = track.position_y(); display->width = track.width(); @@ -162,7 +162,7 @@ display->dpi = track.x_dpi(); display->bpp = 24; display->is_default = false; - displays_.push_back(*display); + displays_.push_back(std::move(display)); } #if !defined(OS_MACOSX) @@ -172,8 +172,8 @@ #if defined(OS_WIN) BOOL enum_result = TRUE; for (int device_index = 0;; ++device_index) { - DisplayGeometry info; - info.id = device_index; + std::unique_ptr<DisplayGeometry> info(new DisplayGeometry()); + info->id = device_index; DISPLAY_DEVICE device = {}; device.cb = sizeof(device); @@ -187,9 +187,9 @@ if (!(device.StateFlags & DISPLAY_DEVICE_ACTIVE)) continue; - info.is_default = false; + info->is_default = false; if (device.StateFlags & DISPLAY_DEVICE_PRIMARY_DEVICE) - info.is_default = true; + info->is_default = true; // Get additional info about device. DEVMODE devmode; @@ -197,13 +197,13 @@ EnumDisplaySettingsEx(device.DeviceName, ENUM_CURRENT_SETTINGS, &devmode, 0); - info.x = devmode.dmPosition.x; - info.y = devmode.dmPosition.y; - info.width = devmode.dmPelsWidth; - info.height = devmode.dmPelsHeight; - info.dpi = devmode.dmLogPixels; - info.bpp = devmode.dmBitsPerPel; - displays_.push_back(info); + info->x = devmode.dmPosition.x; + info->y = devmode.dmPosition.y; + info->width = devmode.dmPelsWidth; + info->height = devmode.dmPelsHeight; + info->dpi = devmode.dmLogPixels; + info->bpp = devmode.dmBitsPerPel; + displays_.push_back(std::move(info)); } #endif // OS_WIN }
diff --git a/remoting/host/desktop_display_info.h b/remoting/host/desktop_display_info.h index ecaa256..6826e9a 100644 --- a/remoting/host/desktop_display_info.h +++ b/remoting/host/desktop_display_info.h
@@ -41,7 +41,7 @@ webrtc::DesktopVector CalcDisplayOffset(webrtc::ScreenId id); // Add a new display with the given info to the display list. - void AddDisplay(DisplayGeometry* display); + void AddDisplay(std::unique_ptr<DisplayGeometry> display); void AddDisplayFrom(protocol::VideoTrackLayout track); @@ -51,10 +51,12 @@ bool operator==(const DesktopDisplayInfo& other); bool operator!=(const DesktopDisplayInfo& other); - const std::vector<DisplayGeometry>& displays() const { return displays_; } + const std::vector<std::unique_ptr<DisplayGeometry>>& displays() const { + return displays_; + } private: - std::vector<DisplayGeometry> displays_; + std::vector<std::unique_ptr<DisplayGeometry>> displays_; DISALLOW_COPY_AND_ASSIGN(DesktopDisplayInfo); };
diff --git a/remoting/host/desktop_display_info_mac.mm b/remoting/host/desktop_display_info_mac.mm index b12319a..8bbabc5 100644 --- a/remoting/host/desktop_display_info_mac.mm +++ b/remoting/host/desktop_display_info_mac.mm
@@ -22,13 +22,13 @@ int main_display_height = 0; for (NSUInteger i = 0; i < [screens count]; ++i) { - DisplayGeometry info; + std::unique_ptr<DisplayGeometry> info(new DisplayGeometry()); NSScreen* screen = [screens objectAtIndex:i]; NSDictionary* device = [screen deviceDescription]; CGDirectDisplayID id = static_cast<CGDirectDisplayID>( [[device objectForKey:@"NSScreenNumber"] intValue]); - info.id = id; + info->id = id; float dsf = 1.0f; if ([screen respondsToSelector:@selector(backingScaleFactor)]) @@ -42,21 +42,21 @@ if (i == 0) { DCHECK(x == 0); DCHECK(y == 0); - info.is_default = true; + info->is_default = true; main_display_height = height; } else { - info.is_default = false; + info->is_default = false; } - info.x = x; + info->x = x; // Convert origin from lower left to upper left (based on main display). - info.y = main_display_height - y - height; - info.width = bounds.size.width; - info.height = height; - info.dpi = (int)(kDefaultScreenDpi * dsf); - info.bpp = 24; + info->y = main_display_height - y - height; + info->width = bounds.size.width; + info->height = height; + info->dpi = (int)(kDefaultScreenDpi * dsf); + info->bpp = 24; - displays_.push_back(info); + displays_.push_back(std::move(info)); } }
diff --git a/remoting/host/desktop_display_info_unittest.cc b/remoting/host/desktop_display_info_unittest.cc index 6c1b461..f6c87a0 100644 --- a/remoting/host/desktop_display_info_unittest.cc +++ b/remoting/host/desktop_display_info_unittest.cc
@@ -8,28 +8,6 @@ #include "build/build_config.h" #include "testing/gtest/include/gtest/gtest.h" -// TODO(crbug.com/961064): Fix memory leaks in tests and re-enable on LSAN. -#ifdef LEAK_SANITIZER -#define MAYBE_SingleDisplay DISABLED_SingleDisplay -#define MAYBE_DualDisplayRight_ReverseOrder \ - DISABLED_DualDisplayRight_ReverseOrder -#define MAYBE_DualDisplayLeft_ReverseOrder DISABLED_DualDisplayLeft_ReverseOrder -#define MAYBE_DualDisplayRight DISABLED_DualDisplayRight -#define MAYBE_DualDisplayLeft DISABLED_DualDisplayLeft -#define MAYBE_Multimon3 DISABLED_Multimon3 -#define MAYBE_TripleDisplayMiddle DISABLED_TripleDisplayMiddle -#define MAYBE_Multimon7 DISABLED_Multimon7 -#else -#define MAYBE_SingleDisplay SingleDisplay -#define MAYBE_DualDisplayRight_ReverseOrder DualDisplayRight_ReverseOrder -#define MAYBE_DualDisplayLeft_ReverseOrder DualDisplayLeft_ReverseOrder -#define MAYBE_DualDisplayRight DualDisplayRight -#define MAYBE_DualDisplayLeft DualDisplayLeft -#define MAYBE_Multimon3 Multimon3 -#define MAYBE_TripleDisplayMiddle TripleDisplayMiddle -#define MAYBE_Multimon7 Multimon7 -#endif - namespace remoting { class DesktopDisplayInfoTest : public testing::Test { @@ -43,7 +21,7 @@ display->dpi = 96; display->bpp = 24; display->is_default = false; - info_.AddDisplay(display); + info_.AddDisplay(std::unique_ptr<DisplayGeometry>(display)); } void VerifyDisplayOffset(const base::Location& from_here, @@ -64,7 +42,7 @@ // | 300x200 | // +---------+ // o = desktop origin -TEST_F(DesktopDisplayInfoTest, MAYBE_SingleDisplay) { +TEST_F(DesktopDisplayInfoTest, SingleDisplay) { AddDisplay(0, 0, 300, 200); VerifyDisplayOffset(FROM_HERE, 0, 0, 0); @@ -75,7 +53,7 @@ // | 300x200 | 500x400 | // +---------+ | // +------------+ -TEST_F(DesktopDisplayInfoTest, MAYBE_DualDisplayRight) { +TEST_F(DesktopDisplayInfoTest, DualDisplayRight) { AddDisplay(0, 0, 300, 200); AddDisplay(300, 0, 500, 400); @@ -88,7 +66,7 @@ // | 300x200 | 500x400 | // +---------+ | // +------------+ -TEST_F(DesktopDisplayInfoTest, MAYBE_DualDisplayRight_ReverseOrder) { +TEST_F(DesktopDisplayInfoTest, DualDisplayRight_ReverseOrder) { AddDisplay(300, 0, 500, 400); AddDisplay(0, 0, 300, 200); @@ -101,7 +79,7 @@ // | 300x200 | 500x400 | // +---------+ | // +------------+ -TEST_F(DesktopDisplayInfoTest, MAYBE_DualDisplayLeft) { +TEST_F(DesktopDisplayInfoTest, DualDisplayLeft) { AddDisplay(0, 0, 500, 400); AddDisplay(-300, 0, 300, 200); @@ -119,7 +97,7 @@ // | 300x200 | 500x400 | // +---------+ | // +------------+ -TEST_F(DesktopDisplayInfoTest, MAYBE_DualDisplayLeft_ReverseOrder) { +TEST_F(DesktopDisplayInfoTest, DualDisplayLeft_ReverseOrder) { AddDisplay(-300, 0, 300, 200); AddDisplay(0, 0, 500, 400); @@ -137,7 +115,7 @@ // | 300x200 | 500x400 | 2 | // +---------+ | 400x350 | // +------------+---------+ -TEST_F(DesktopDisplayInfoTest, MAYBE_TripleDisplayMiddle) { +TEST_F(DesktopDisplayInfoTest, TripleDisplayMiddle) { AddDisplay(-300, 0, 300, 200); AddDisplay(0, 0, 500, 400); // Default display. AddDisplay(500, 50, 400, 350); @@ -162,7 +140,7 @@ // +-----------+ - 950 // | | | | | // -300 0 300 500 900 -TEST_F(DesktopDisplayInfoTest, MAYBE_Multimon3) { +TEST_F(DesktopDisplayInfoTest, Multimon3) { AddDisplay(0, 0, 500, 400); // Default display. AddDisplay(300, 400, 600, 450); AddDisplay(-300, 350, 300, 200); @@ -195,7 +173,7 @@ // - - 0 6 7 8 1 1 1 1 // 7 4 0 0 0 2 3 5 9 // 0 0 0 5 0 0 -TEST_F(DesktopDisplayInfoTest, MAYBE_Multimon7) { +TEST_F(DesktopDisplayInfoTest, Multimon7) { AddDisplay(80, -10, 70, 60); AddDisplay(60, -50, 60, 40); AddDisplay(-70, 40, 30, 60);
diff --git a/remoting/host/input_injector_mac.cc b/remoting/host/input_injector_mac.cc index 568519b..d4875c6 100644 --- a/remoting/host/input_injector_mac.cc +++ b/remoting/host/input_injector_mac.cc
@@ -37,6 +37,7 @@ value = set_bit ? (value | bit) : (value & ~bit); } +// Must be called on UI thread. void CreateAndPostKeyEvent(int keycode, bool pressed, uint64_t flags, @@ -51,6 +52,40 @@ } } +// Must be called on UI thread. +void PostMouseEvent(int32_t x, + int32_t y, + bool left_down, + bool right_down, + bool middle_down) { + // We use the deprecated CGPostMouseEvent API because we receive low-level + // mouse events, whereas CGEventCreateMouseEvent is for injecting higher-level + // events. For example, the deprecated APIs will detect double-clicks or drags + // in a way that is consistent with how they would be generated using a local + // mouse, whereas the new APIs expect us to inject these higher-level events + // directly. + // + // See crbug.com/677857 for more details. + CGPoint position = CGPointMake(x, y); + +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" + CGError error = + CGPostMouseEvent(position, true, 3, left_down, right_down, middle_down); +#pragma clang diagnostic pop + if (error != kCGErrorSuccess) + LOG(WARNING) << "CGPostMouseEvent error " << error; +} + +// Must be called on UI thread. +void CreateAndPostScrollWheelEvent(int32_t delta_x, int32_t delta_y) { + base::ScopedCFTypeRef<CGEventRef> eventRef(CGEventCreateScrollWheelEvent( + nullptr, kCGScrollEventUnitPixel, 2, delta_y, delta_x)); + if (eventRef) { + CGEventPost(kCGSessionEventTap, eventRef); + } +} + // This value is not defined. Give it the obvious name so that if it is ever // added there will be a handy compilation error to remind us to remove this // definition. @@ -70,7 +105,8 @@ class InputInjectorMac : public InputInjector { public: explicit InputInjectorMac( - scoped_refptr<base::SingleThreadTaskRunner> task_runner); + scoped_refptr<base::SingleThreadTaskRunner> input_thread_task_runner, + scoped_refptr<base::SingleThreadTaskRunner> ui_thread_task_runner); ~InputInjectorMac() override; // ClipboardStub interface. @@ -90,7 +126,9 @@ // The actual implementation resides in InputInjectorMac::Core class. class Core : public base::RefCountedThreadSafe<Core> { public: - explicit Core(scoped_refptr<base::SingleThreadTaskRunner> task_runner); + explicit Core( + scoped_refptr<base::SingleThreadTaskRunner> input_thread_task_runner, + scoped_refptr<base::SingleThreadTaskRunner> ui_thread_task_runner); // Mirrors the ClipboardStub interface. void InjectClipboardEvent(const ClipboardEvent& event); @@ -111,7 +149,8 @@ void WakeUpDisplay(); - scoped_refptr<base::SingleThreadTaskRunner> task_runner_; + scoped_refptr<base::SingleThreadTaskRunner> input_thread_task_runner_; + scoped_refptr<base::SingleThreadTaskRunner> ui_thread_task_runner_; webrtc::DesktopVector mouse_pos_; uint32_t mouse_button_state_; std::unique_ptr<Clipboard> clipboard_; @@ -128,8 +167,9 @@ }; InputInjectorMac::InputInjectorMac( - scoped_refptr<base::SingleThreadTaskRunner> task_runner) { - core_ = new Core(task_runner); + scoped_refptr<base::SingleThreadTaskRunner> input_thread_task_runner, + scoped_refptr<base::SingleThreadTaskRunner> ui_thread_task_runner) { + core_ = new Core(input_thread_task_runner, ui_thread_task_runner); } InputInjectorMac::~InputInjectorMac() { @@ -162,8 +202,10 @@ } InputInjectorMac::Core::Core( - scoped_refptr<base::SingleThreadTaskRunner> task_runner) - : task_runner_(task_runner), + scoped_refptr<base::SingleThreadTaskRunner> input_thread_task_runner, + scoped_refptr<base::SingleThreadTaskRunner> ui_thread_task_runner) + : input_thread_task_runner_(input_thread_task_runner), + ui_thread_task_runner_(ui_thread_task_runner), mouse_button_state_(0), clipboard_(Clipboard::Create()), left_modifiers_(0), @@ -183,8 +225,8 @@ } void InputInjectorMac::Core::InjectClipboardEvent(const ClipboardEvent& event) { - if (!task_runner_->BelongsToCurrentThread()) { - task_runner_->PostTask( + if (!input_thread_task_runner_->BelongsToCurrentThread()) { + input_thread_task_runner_->PostTask( FROM_HERE, base::BindOnce(&Core::InjectClipboardEvent, this, event)); return; } @@ -239,7 +281,9 @@ flags |= kCGEventFlagMaskAlphaShift; } - CreateAndPostKeyEvent(keycode, event.pressed(), flags, base::string16()); + ui_thread_task_runner_->PostTask( + FROM_HERE, base::BindOnce(CreateAndPostKeyEvent, keycode, event.pressed(), + flags, base::string16())); } void InputInjectorMac::Core::InjectTextEvent(const TextEvent& event) { @@ -251,8 +295,12 @@ // Applications that ignore UnicodeString field will see the text event as // Space key. - CreateAndPostKeyEvent(kVK_Space, /*pressed=*/true, 0, text); - CreateAndPostKeyEvent(kVK_Space, /*pressed=*/false, 0, text); + ui_thread_task_runner_->PostTask( + FROM_HERE, base::BindOnce(CreateAndPostKeyEvent, kVK_Space, + /*pressed=*/true, 0, text)); + ui_thread_task_runner_->PostTask( + FROM_HERE, base::BindOnce(CreateAndPostKeyEvent, kVK_Space, + /*pressed=*/false, 0, text)); } void InputInjectorMac::Core::InjectMouseEvent(const MouseEvent& event) { @@ -275,44 +323,29 @@ VLOG(1) << "Unknown mouse button: " << event.button(); } } - // We use the deprecated CGPostMouseEvent API because we receive low-level - // mouse events, whereas CGEventCreateMouseEvent is for injecting higher-level - // events. For example, the deprecated APIs will detect double-clicks or drags - // in a way that is consistent with how they would be generated using a local - // mouse, whereas the new APIs expect us to inject these higher-level events - // directly. - // - // See crbug.com/677857 for more details. - CGPoint position = CGPointMake(mouse_pos_.x(), mouse_pos_.y()); enum { LeftBit = 1 << (MouseEvent::BUTTON_LEFT - 1), MiddleBit = 1 << (MouseEvent::BUTTON_MIDDLE - 1), RightBit = 1 << (MouseEvent::BUTTON_RIGHT - 1) }; -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wdeprecated-declarations" - CGError error = CGPostMouseEvent(position, true, 3, - (mouse_button_state_ & LeftBit) != 0, - (mouse_button_state_ & RightBit) != 0, - (mouse_button_state_ & MiddleBit) != 0); -#pragma clang diagnostic pop - if (error != kCGErrorSuccess) - LOG(WARNING) << "CGPostMouseEvent error " << error; + ui_thread_task_runner_->PostTask( + FROM_HERE, base::BindOnce(PostMouseEvent, mouse_pos_.x(), mouse_pos_.y(), + (mouse_button_state_ & LeftBit) != 0, + (mouse_button_state_ & RightBit) != 0, + (mouse_button_state_ & MiddleBit) != 0)); if (event.has_wheel_delta_x() && event.has_wheel_delta_y()) { - int delta_x = static_cast<int>(event.wheel_delta_x()); - int delta_y = static_cast<int>(event.wheel_delta_y()); - base::ScopedCFTypeRef<CGEventRef> event(CGEventCreateScrollWheelEvent( - nullptr, kCGScrollEventUnitPixel, 2, delta_y, delta_x)); - if (event) - CGEventPost(kCGSessionEventTap, event); + ui_thread_task_runner_->PostTask( + FROM_HERE, + base::BindOnce(CreateAndPostScrollWheelEvent, event.wheel_delta_x(), + event.wheel_delta_y())); } } void InputInjectorMac::Core::Start( std::unique_ptr<protocol::ClipboardStub> client_clipboard) { - if (!task_runner_->BelongsToCurrentThread()) { - task_runner_->PostTask( + if (!input_thread_task_runner_->BelongsToCurrentThread()) { + input_thread_task_runner_->PostTask( FROM_HERE, base::BindOnce(&Core::Start, this, std::move(client_clipboard))); return; @@ -322,8 +355,9 @@ } void InputInjectorMac::Core::Stop() { - if (!task_runner_->BelongsToCurrentThread()) { - task_runner_->PostTask(FROM_HERE, base::BindOnce(&Core::Stop, this)); + if (!input_thread_task_runner_->BelongsToCurrentThread()) { + input_thread_task_runner_->PostTask(FROM_HERE, + base::BindOnce(&Core::Stop, this)); return; } @@ -364,9 +398,10 @@ // static std::unique_ptr<InputInjector> InputInjector::Create( - scoped_refptr<base::SingleThreadTaskRunner> main_task_runner, - scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner) { - return base::WrapUnique(new InputInjectorMac(main_task_runner)); + scoped_refptr<base::SingleThreadTaskRunner> input_thread_task_runner, + scoped_refptr<base::SingleThreadTaskRunner> ui_thread_task_runner) { + return base::WrapUnique( + new InputInjectorMac(input_thread_task_runner, ui_thread_task_runner)); } // static
diff --git a/remoting/host/it2me/it2me_confirmation_dialog_linux.cc b/remoting/host/it2me/it2me_confirmation_dialog_linux.cc index 69c2b9c0..db4795f5 100644 --- a/remoting/host/it2me/it2me_confirmation_dialog_linux.cc +++ b/remoting/host/it2me/it2me_confirmation_dialog_linux.cc
@@ -75,9 +75,9 @@ CreateWindow(remote_user_email); dialog_timer_.Start(FROM_HERE, kDialogTimeout, - base::Bind(&It2MeConfirmationDialogLinux::OnResponse, - base::Unretained(this), - /*dialog=*/nullptr, GTK_RESPONSE_NONE)); + base::BindOnce(&It2MeConfirmationDialogLinux::OnResponse, + base::Unretained(this), + /*dialog=*/nullptr, GTK_RESPONSE_NONE)); } void It2MeConfirmationDialogLinux::Hide() {
diff --git a/remoting/host/it2me/it2me_host.cc b/remoting/host/it2me/it2me_host.cc index 70ea532..2a4c98d 100644 --- a/remoting/host/it2me/it2me_host.cc +++ b/remoting/host/it2me/it2me_host.cc
@@ -272,8 +272,8 @@ } ValidationCallback It2MeHost::GetValidationCallbackForTesting() { - return base::Bind(&It2MeHost::ValidateConnectionDetails, - base::Unretained(this)); + return base::BindOnce(&It2MeHost::ValidateConnectionDetails, + base::Unretained(this)); } void It2MeHost::OnPolicyUpdate( @@ -463,8 +463,8 @@ std::unique_ptr<protocol::AuthenticatorFactory> factory( new protocol::It2MeHostAuthenticatorFactory( local_certificate, host_key_pair_, access_code_hash, - base::Bind(&It2MeHost::ValidateConnectionDetails, - base::Unretained(this)))); + base::BindOnce(&It2MeHost::ValidateConnectionDetails, + base::Unretained(this)))); host_->SetAuthenticatorFactory(std::move(factory)); // Pass the Access Code to the script object before changing state.
diff --git a/remoting/host/it2me/it2me_native_messaging_host_unittest.cc b/remoting/host/it2me/it2me_native_messaging_host_unittest.cc index 2a532fd..70607c5 100644 --- a/remoting/host/it2me/it2me_native_messaging_host_unittest.cc +++ b/remoting/host/it2me/it2me_native_messaging_host_unittest.cc
@@ -283,8 +283,8 @@ host_task_runner_ = new AutoThreadTaskRunner( host_thread_->task_runner(), - base::Bind(&It2MeNativeMessagingHostTest::ExitTest, - base::Unretained(this))); + base::BindOnce(&It2MeNativeMessagingHostTest::ExitTest, + base::Unretained(this))); host_task_runner_->PostTask( FROM_HERE, base::BindOnce(&It2MeNativeMessagingHostTest::StartHost,
diff --git a/remoting/host/mac/permission_utils.mm b/remoting/host/mac/permission_utils.mm index 8861dad..f94ec89 100644 --- a/remoting/host/mac/permission_utils.mm +++ b/remoting/host/mac/permission_utils.mm
@@ -149,14 +149,11 @@ layer_integer == CGWindowLevelForKey(kCGDockWindowLevelKey)) { return true; } - return false; } - - // Screen capture is always allowed in older macOS versions. - return true; + return false; } - // Previous to 10.15, screen capture was always allowed. + // Screen capture is always allowed in older macOS versions. return true; }
diff --git a/remoting/host/resizing_host_observer.cc b/remoting/host/resizing_host_observer.cc index ffc6027..79fdc92 100644 --- a/remoting/host/resizing_host_observer.cc +++ b/remoting/host/resizing_host_observer.cc
@@ -149,8 +149,8 @@ if (now < next_allowed_resize) { deferred_resize_timer_.Start( FROM_HERE, next_allowed_resize - now, - base::Bind(&ResizingHostObserver::SetScreenResolution, - weak_factory_.GetWeakPtr(), resolution)); + base::BindOnce(&ResizingHostObserver::SetScreenResolution, + weak_factory_.GetWeakPtr(), resolution)); return; }
diff --git a/remoting/host/security_key/security_key_auth_handler_posix.cc b/remoting/host/security_key/security_key_auth_handler_posix.cc index d5541fc..fcfaadf 100644 --- a/remoting/host/security_key/security_key_auth_handler_posix.cc +++ b/remoting/host/security_key/security_key_auth_handler_posix.cc
@@ -169,11 +169,12 @@ // that task has completed, the main thread will be called back and we will // resume setting up our security key auth socket there. file_task_runner_->PostTaskAndReply( - FROM_HERE, base::Bind(base::IgnoreResult(&base::DeleteFile), - g_security_key_socket_name.Get(), - /*recursive=*/false), - base::Bind(&SecurityKeyAuthHandlerPosix::CreateSocket, - weak_factory_.GetWeakPtr())); + FROM_HERE, + base::BindOnce(base::IgnoreResult(&base::DeleteFile), + g_security_key_socket_name.Get(), + /*recursive=*/false), + base::BindOnce(&SecurityKeyAuthHandlerPosix::CreateSocket, + weak_factory_.GetWeakPtr())); } void SecurityKeyAuthHandlerPosix::CreateSocket() { @@ -238,8 +239,8 @@ void SecurityKeyAuthHandlerPosix::DoAccept() { DCHECK(thread_checker_.CalledOnValidThread()); int result = auth_socket_->Accept( - &accept_socket_, base::Bind(&SecurityKeyAuthHandlerPosix::OnAccepted, - base::Unretained(this))); + &accept_socket_, base::BindOnce(&SecurityKeyAuthHandlerPosix::OnAccepted, + base::Unretained(this))); if (result != net::ERR_IO_PENDING) { OnAccepted(result); }
diff --git a/remoting/host/security_key/security_key_auth_handler_posix_unittest.cc b/remoting/host/security_key/security_key_auth_handler_posix_unittest.cc index c29dfe9..7a73279c 100644 --- a/remoting/host/security_key/security_key_auth_handler_posix_unittest.cc +++ b/remoting/host/security_key/security_key_auth_handler_posix_unittest.cc
@@ -92,7 +92,7 @@ auth_handler_->CreateSecurityKeyConnection(); ASSERT_TRUE(file_thread_.task_runner()->PostTaskAndReply( - FROM_HERE, base::Bind(&RunUntilIdle), run_loop_->QuitClosure())); + FROM_HERE, base::BindOnce(&RunUntilIdle), run_loop_->QuitClosure())); run_loop_->Run(); run_loop_.reset(new base::RunLoop);
diff --git a/remoting/host/security_key/security_key_ipc_server_impl.cc b/remoting/host/security_key/security_key_ipc_server_impl.cc index 04dc4fe..497f180 100644 --- a/remoting/host/security_key/security_key_ipc_server_impl.cc +++ b/remoting/host/security_key/security_key_ipc_server_impl.cc
@@ -105,8 +105,8 @@ // methods must execute on the same thread (due to |thread_Checker_| so // the posted task and D'Tor can not execute concurrently. timer_.Start(FROM_HERE, initial_connect_timeout_, - base::Bind(&SecurityKeyIpcServerImpl::OnChannelError, - base::Unretained(this))); + base::BindOnce(&SecurityKeyIpcServerImpl::OnChannelError, + base::Unretained(this))); return true; } @@ -116,8 +116,8 @@ // Since we have received a response, we update the timer and wait // for a subsequent request. timer_.Start(FROM_HERE, security_key_request_timeout_, - base::Bind(&SecurityKeyIpcServerImpl::OnChannelError, - base::Unretained(this))); + base::BindOnce(&SecurityKeyIpcServerImpl::OnChannelError, + base::Unretained(this))); return ipc_channel_->Send( new ChromotingNetworkToRemoteSecurityKeyMsg_Response(response)); @@ -173,8 +173,8 @@ // Reset the timer to give the client a chance to send the request. timer_.Start(FROM_HERE, initial_connect_timeout_, - base::Bind(&SecurityKeyIpcServerImpl::OnChannelError, - base::Unretained(this))); + base::BindOnce(&SecurityKeyIpcServerImpl::OnChannelError, + base::Unretained(this))); ipc_channel_->Send( new ChromotingNetworkToRemoteSecurityKeyMsg_ConnectionReady()); @@ -199,8 +199,8 @@ // Reset the timer to give the client a chance to send the response. timer_.Start(FROM_HERE, security_key_request_timeout_, - base::Bind(&SecurityKeyIpcServerImpl::OnChannelError, - base::Unretained(this))); + base::BindOnce(&SecurityKeyIpcServerImpl::OnChannelError, + base::Unretained(this))); HOST_LOG << "Received security key request: " << GetCommandCode(request_data); message_callback_.Run(connection_id_, request_data);
diff --git a/remoting/host/security_key/security_key_socket.cc b/remoting/host/security_key/security_key_socket.cc index f30e72b..5572f79 100644 --- a/remoting/host/security_key/security_key_socket.cc +++ b/remoting/host/security_key/security_key_socket.cc
@@ -135,7 +135,7 @@ })"); int result = socket_->Write( write_buffer_.get(), write_buffer_->BytesRemaining(), - base::Bind(&SecurityKeySocket::OnDataWritten, base::Unretained(this)), + base::BindOnce(&SecurityKeySocket::OnDataWritten, base::Unretained(this)), traffic_annotation); if (result != net::ERR_IO_PENDING) { OnDataWritten(result); @@ -176,7 +176,7 @@ int result = socket_->Read( read_buffer_.get(), kRequestReadBufferLength, - base::Bind(&SecurityKeySocket::OnDataRead, base::Unretained(this))); + base::BindOnce(&SecurityKeySocket::OnDataRead, base::Unretained(this))); if (result != net::ERR_IO_PENDING) { OnDataRead(result); }
diff --git a/remoting/host/setup/me2me_native_messaging_host.cc b/remoting/host/setup/me2me_native_messaging_host.cc index 0b03ee29..7fa772f 100644 --- a/remoting/host/setup/me2me_native_messaging_host.cc +++ b/remoting/host/setup/me2me_native_messaging_host.cc
@@ -203,8 +203,8 @@ if (pairing_registry_.get()) { pairing_registry_->ClearAllPairings( - base::Bind(&Me2MeNativeMessagingHost::SendBooleanResult, weak_ptr_, - base::Passed(&response))); + base::BindOnce(&Me2MeNativeMessagingHost::SendBooleanResult, weak_ptr_, + base::Passed(&response))); } else { SendBooleanResult(std::move(response), false); } @@ -232,8 +232,8 @@ if (pairing_registry_.get()) { pairing_registry_->DeletePairing( - client_id, base::Bind(&Me2MeNativeMessagingHost::SendBooleanResult, - weak_ptr_, base::Passed(&response))); + client_id, base::BindOnce(&Me2MeNativeMessagingHost::SendBooleanResult, + weak_ptr_, base::Passed(&response))); } else { SendBooleanResult(std::move(response), false); } @@ -332,8 +332,8 @@ if (pairing_registry_.get()) { pairing_registry_->GetAllPairings( - base::Bind(&Me2MeNativeMessagingHost::SendPairedClientsResponse, - weak_ptr_, base::Passed(&response))); + base::BindOnce(&Me2MeNativeMessagingHost::SendPairedClientsResponse, + weak_ptr_, base::Passed(&response))); } else { std::unique_ptr<base::ListValue> no_paired_clients(new base::ListValue); SendPairedClientsResponse(std::move(response), @@ -473,9 +473,9 @@ }; oauth_client_->GetCredentialsFromAuthCode( - oauth_client_info, auth_code, need_user_email, base::Bind( - &Me2MeNativeMessagingHost::SendCredentialsResponse, weak_ptr_, - base::Passed(&response))); + oauth_client_info, auth_code, need_user_email, + base::BindOnce(&Me2MeNativeMessagingHost::SendCredentialsResponse, + weak_ptr_, base::Passed(&response))); } void Me2MeNativeMessagingHost::ProcessIt2mePermissionCheck( @@ -484,8 +484,9 @@ DCHECK(task_runner()->BelongsToCurrentThread()); daemon_controller_->CheckPermission( - /* it2me */ true, base::Bind(&Me2MeNativeMessagingHost::SendBooleanResult, - weak_ptr_, base::Passed(&response))); + /* it2me */ true, + base::BindOnce(&Me2MeNativeMessagingHost::SendBooleanResult, weak_ptr_, + base::Passed(&response))); } void Me2MeNativeMessagingHost::SendConfigResponse(
diff --git a/remoting/host/setup/me2me_native_messaging_host_unittest.cc b/remoting/host/setup/me2me_native_messaging_host_unittest.cc index e894f7a..78adb6b 100644 --- a/remoting/host/setup/me2me_native_messaging_host_unittest.cc +++ b/remoting/host/setup/me2me_native_messaging_host_unittest.cc
@@ -317,8 +317,8 @@ // Arrange to run |task_environment_| until no components depend on it. host_task_runner_ = new AutoThreadTaskRunner( host_thread_->task_runner(), - base::Bind(&Me2MeNativeMessagingHostTest::ExitTest, - base::Unretained(this))); + base::BindOnce(&Me2MeNativeMessagingHostTest::ExitTest, + base::Unretained(this))); host_task_runner_->PostTask( FROM_HERE, base::BindOnce(&Me2MeNativeMessagingHostTest::StartHost, @@ -356,8 +356,9 @@ std::unique_ptr<ChromotingHostContext> context = ChromotingHostContext::Create(new remoting::AutoThreadTaskRunner( - host_task_runner_, base::Bind(&Me2MeNativeMessagingHostTest::StopHost, - base::Unretained(this)))); + host_task_runner_, + base::BindOnce(&Me2MeNativeMessagingHostTest::StopHost, + base::Unretained(this)))); std::unique_ptr<remoting::Me2MeNativeMessagingHost> host( new Me2MeNativeMessagingHost(false, 0, std::move(context),
diff --git a/remoting/host/setup/service_client.cc b/remoting/host/setup/service_client.cc index f171a08a..3e783069 100644 --- a/remoting/host/setup/service_client.cc +++ b/remoting/host/setup/service_client.cc
@@ -155,8 +155,8 @@ directory_service_client_.RegisterHost( host_id, host_name, public_key, host_client_id, oauth_access_token, - base::Bind(&ServiceClient::Core::OnRegisterHostResponse, - base::Unretained(this))); + base::BindOnce(&ServiceClient::Core::OnRegisterHostResponse, + base::Unretained(this))); } void ServiceClient::Core::DeleteHost(const std::string& host_id, @@ -169,8 +169,8 @@ directory_service_client_.DeleteHost( host_id, oauth_access_token, - base::Bind(&ServiceClient::Core::OnDeleteHostResponse, - base::Unretained(this))); + base::BindOnce(&ServiceClient::Core::OnDeleteHostResponse, + base::Unretained(this))); } void ServiceClient::Core::OnRegisterHostResponse(
diff --git a/remoting/host/token_validator_factory_impl_unittest.cc b/remoting/host/token_validator_factory_impl_unittest.cc index f470e4a..7e55ec36 100644 --- a/remoting/host/token_validator_factory_impl_unittest.cc +++ b/remoting/host/token_validator_factory_impl_unittest.cc
@@ -193,8 +193,8 @@ CreateResponse(token_validator_->token_scope())); token_validator_->ValidateThirdPartyToken( - kToken, base::Bind(&TokenValidatorFactoryImplTest::SuccessCallback, - base::Unretained(this))); + kToken, base::BindOnce(&TokenValidatorFactoryImplTest::SuccessCallback, + base::Unretained(this))); run_loop_.Run(); } @@ -207,8 +207,8 @@ ")]}'\n" + CreateResponse(token_validator_->token_scope())); token_validator_->ValidateThirdPartyToken( - kToken, base::Bind(&TokenValidatorFactoryImplTest::SuccessCallback, - base::Unretained(this))); + kToken, base::BindOnce(&TokenValidatorFactoryImplTest::SuccessCallback, + base::Unretained(this))); run_loop_.Run(); } @@ -219,8 +219,8 @@ SetResponse(net::URLRequestTestJob::test_error_headers(), std::string()); token_validator_->ValidateThirdPartyToken( - kToken, base::Bind(&TokenValidatorFactoryImplTest::FailureCallback, - base::Unretained(this))); + kToken, base::BindOnce(&TokenValidatorFactoryImplTest::FailureCallback, + base::Unretained(this))); run_loop_.Run(); } @@ -232,8 +232,8 @@ CreateResponse(kBadScope)); token_validator_->ValidateThirdPartyToken( - kToken, base::Bind(&TokenValidatorFactoryImplTest::FailureCallback, - base::Unretained(this))); + kToken, base::BindOnce(&TokenValidatorFactoryImplTest::FailureCallback, + base::Unretained(this))); run_loop_.Run(); } @@ -245,8 +245,8 @@ token_validator_->ValidateThirdPartyToken( kToken, - base::Bind(&TokenValidatorFactoryImplTest::DeleteOnFailureCallback, - base::Unretained(this))); + base::BindOnce(&TokenValidatorFactoryImplTest::DeleteOnFailureCallback, + base::Unretained(this))); run_loop_.Run(); } @@ -258,8 +258,8 @@ token_validator_->ValidateThirdPartyToken( kToken, - base::Bind(&TokenValidatorFactoryImplTest::DeleteOnFailureCallback, - base::Unretained(this))); + base::BindOnce(&TokenValidatorFactoryImplTest::DeleteOnFailureCallback, + base::Unretained(this))); run_loop_.Run(); } @@ -271,8 +271,8 @@ token_validator_->ValidateThirdPartyToken( kToken, - base::Bind(&TokenValidatorFactoryImplTest::DeleteOnFailureCallback, - base::Unretained(this))); + base::BindOnce(&TokenValidatorFactoryImplTest::DeleteOnFailureCallback, + base::Unretained(this))); run_loop_.Run(); } @@ -284,8 +284,8 @@ token_validator_->ValidateThirdPartyToken( kToken, - base::Bind(&TokenValidatorFactoryImplTest::DeleteOnFailureCallback, - base::Unretained(this))); + base::BindOnce(&TokenValidatorFactoryImplTest::DeleteOnFailureCallback, + base::Unretained(this))); run_loop_.Run(); }
diff --git a/remoting/host/win/worker_process_launcher_unittest.cc b/remoting/host/win/worker_process_launcher_unittest.cc index 78f756b..52786d0 100644 --- a/remoting/host/win/worker_process_launcher_unittest.cc +++ b/remoting/host/win/worker_process_launcher_unittest.cc
@@ -193,8 +193,8 @@ void WorkerProcessLauncherTest::SetUp() { task_runner_ = new AutoThreadTaskRunner( task_environment_.GetMainThreadTaskRunner(), - base::Bind(&WorkerProcessLauncherTest::QuitMainMessageLoop, - base::Unretained(this))); + base::BindOnce(&WorkerProcessLauncherTest::QuitMainMessageLoop, + base::Unretained(this))); // Set up process launcher delegate launcher_delegate_.reset(new MockProcessLauncherDelegate());
diff --git a/remoting/host/xmpp_register_support_host_request.cc b/remoting/host/xmpp_register_support_host_request.cc index f10a69b..4a27932 100644 --- a/remoting/host/xmpp_register_support_host_request.cc +++ b/remoting/host/xmpp_register_support_host_request.cc
@@ -84,8 +84,8 @@ request_ = iq_sender_->SendIq( jingle_xmpp::STR_SET, directory_bot_jid_, CreateRegistrationRequest(host_jid), - base::BindRepeating(&XmppRegisterSupportHostRequest::ProcessResponse, - base::Unretained(this))); + base::BindOnce(&XmppRegisterSupportHostRequest::ProcessResponse, + base::Unretained(this))); if (!request_) { LOG(ERROR) << "Error sending the register-support-host request."; CallCallback(std::string(), base::TimeDelta(),
diff --git a/remoting/protocol/audio_pump.cc b/remoting/protocol/audio_pump.cc index df41e95b..f034579 100644 --- a/remoting/protocol/audio_pump.cc +++ b/remoting/protocol/audio_pump.cc
@@ -256,8 +256,8 @@ DCHECK(packet); audio_stub_->ProcessAudioPacket( - std::move(packet), - base::Bind(&AudioPump::OnPacketSent, weak_factory_.GetWeakPtr(), size)); + std::move(packet), base::BindOnce(&AudioPump::OnPacketSent, + weak_factory_.GetWeakPtr(), size)); } void AudioPump::OnPacketSent(int size) {
diff --git a/remoting/protocol/capture_scheduler.cc b/remoting/protocol/capture_scheduler.cc index d8776ff3..9b9a097 100644 --- a/remoting/protocol/capture_scheduler.cc +++ b/remoting/protocol/capture_scheduler.cc
@@ -168,9 +168,9 @@ delay = std::max(base::TimeDelta(), delay - (tick_clock_->NowTicks() - last_capture_started_time_)); - capture_timer_->Start( - FROM_HERE, delay, - base::Bind(&CaptureScheduler::CaptureNextFrame, base::Unretained(this))); + capture_timer_->Start(FROM_HERE, delay, + base::BindOnce(&CaptureScheduler::CaptureNextFrame, + base::Unretained(this))); } void CaptureScheduler::CaptureNextFrame() {
diff --git a/remoting/protocol/channel_multiplexer.cc b/remoting/protocol/channel_multiplexer.cc index ea161bc5..6674d84 100644 --- a/remoting/protocol/channel_multiplexer.cc +++ b/remoting/protocol/channel_multiplexer.cc
@@ -371,8 +371,8 @@ base::Unretained(this))); writer_.Start(base::Bind(&P2PStreamSocket::Write, base::Unretained(base_channel_.get())), - base::Bind(&ChannelMultiplexer::OnBaseChannelError, - base::Unretained(this))); + base::BindOnce(&ChannelMultiplexer::OnBaseChannelError, + base::Unretained(this))); } DoCreatePendingChannels();
diff --git a/remoting/protocol/chromium_socket_factory.cc b/remoting/protocol/chromium_socket_factory.cc index 0cb2f8e..6f4bd06 100644 --- a/remoting/protocol/chromium_socket_factory.cc +++ b/remoting/protocol/chromium_socket_factory.cc
@@ -314,11 +314,10 @@ reinterpret_cast<uint8_t*>(packet.data->data()), packet.data->size(), packet.options.packet_time_params, (base::TimeTicks::Now() - base::TimeTicks()).InMicroseconds()); - int result = socket_->SendTo( - packet.data.get(), - packet.data->size(), - packet.address, - base::Bind(&UdpPacketSocket::OnSendCompleted, base::Unretained(this))); + int result = + socket_->SendTo(packet.data.get(), packet.data->size(), packet.address, + base::BindOnce(&UdpPacketSocket::OnSendCompleted, + base::Unretained(this))); if (result == net::ERR_IO_PENDING) { send_pending_ = true; } else { @@ -364,11 +363,10 @@ int result = 0; while (result >= 0) { receive_buffer_ = base::MakeRefCounted<net::IOBuffer>(kReceiveBufferSize); - result = socket_->RecvFrom( - receive_buffer_.get(), - kReceiveBufferSize, - &receive_address_, - base::Bind(&UdpPacketSocket::OnReadCompleted, base::Unretained(this))); + result = socket_->RecvFrom(receive_buffer_.get(), kReceiveBufferSize, + &receive_address_, + base::BindOnce(&UdpPacketSocket::OnReadCompleted, + base::Unretained(this))); HandleReadResult(result); } }
diff --git a/remoting/protocol/connection_tester.cc b/remoting/protocol/connection_tester.cc index 59e6c21..301e242 100644 --- a/remoting/protocol/connection_tester.cc +++ b/remoting/protocol/connection_tester.cc
@@ -73,10 +73,11 @@ int bytes_to_write = std::min(output_buffer_->BytesRemaining(), message_size_); - result = client_socket_->Write( - output_buffer_.get(), bytes_to_write, - base::Bind(&StreamConnectionTester::OnWritten, base::Unretained(this)), - TRAFFIC_ANNOTATION_FOR_TESTS); + result = + client_socket_->Write(output_buffer_.get(), bytes_to_write, + base::BindOnce(&StreamConnectionTester::OnWritten, + base::Unretained(this)), + TRAFFIC_ANNOTATION_FOR_TESTS); HandleWriteResult(result); } } @@ -100,10 +101,9 @@ int result = 1; while (result > 0) { input_buffer_->SetCapacity(input_buffer_->offset() + message_size_); - result = host_socket_->Read( - input_buffer_.get(), - message_size_, - base::Bind(&StreamConnectionTester::OnRead, base::Unretained(this))); + result = host_socket_->Read(input_buffer_.get(), message_size_, + base::BindOnce(&StreamConnectionTester::OnRead, + base::Unretained(this))); HandleReadResult(result); }; }
diff --git a/remoting/protocol/fake_authenticator.cc b/remoting/protocol/fake_authenticator.cc index 8a84bf3..8861b12 100644 --- a/remoting/protocol/fake_authenticator.cc +++ b/remoting/protocol/fake_authenticator.cc
@@ -45,8 +45,8 @@ write_buf->data()[0] = 0; int result = socket_->Write( write_buf.get(), 1, - base::Bind(&FakeChannelAuthenticator::OnAuthBytesWritten, - weak_factory_.GetWeakPtr()), + base::BindOnce(&FakeChannelAuthenticator::OnAuthBytesWritten, + weak_factory_.GetWeakPtr()), TRAFFIC_ANNOTATION_FOR_TESTS); if (result != net::ERR_IO_PENDING) { // This will not call the callback because |did_read_bytes_| is @@ -59,8 +59,8 @@ base::MakeRefCounted<net::IOBuffer>(1); int result = socket_->Read(read_buf.get(), 1, - base::Bind(&FakeChannelAuthenticator::OnAuthBytesRead, - weak_factory_.GetWeakPtr())); + base::BindOnce(&FakeChannelAuthenticator::OnAuthBytesRead, + weak_factory_.GetWeakPtr())); if (result != net::ERR_IO_PENDING) OnAuthBytesRead(result); } else {
diff --git a/remoting/protocol/ice_transport_channel.cc b/remoting/protocol/ice_transport_channel.cc index 92355f7..fe4f3e88 100644 --- a/remoting/protocol/ice_transport_channel.cc +++ b/remoting/protocol/ice_transport_channel.cc
@@ -137,7 +137,7 @@ // Create P2PDatagramSocket adapter for the P2PTransportChannel. std::unique_ptr<TransportChannelSocketAdapter> socket( new TransportChannelSocketAdapter(channel_.get())); - socket->SetOnDestroyedCallback(base::Bind( + socket->SetOnDestroyedCallback(base::BindOnce( &IceTransportChannel::OnChannelDestroyed, base::Unretained(this))); std::move(callback_).Run(std::move(socket)); }
diff --git a/remoting/protocol/message_reader.cc b/remoting/protocol/message_reader.cc index 723ff359..cd08d89 100644 --- a/remoting/protocol/message_reader.cc +++ b/remoting/protocol/message_reader.cc
@@ -53,9 +53,8 @@ while (read_succeeded && !closed_ && !read_pending_) { read_buffer_ = base::MakeRefCounted<net::IOBuffer>(kReadBufferSize); int result = socket_->Read( - read_buffer_.get(), - kReadBufferSize, - base::Bind(&MessageReader::OnRead, weak_factory_.GetWeakPtr())); + read_buffer_.get(), kReadBufferSize, + base::BindOnce(&MessageReader::OnRead, weak_factory_.GetWeakPtr())); HandleReadResult(result, &read_succeeded); }
diff --git a/remoting/protocol/negotiating_authenticator_base.cc b/remoting/protocol/negotiating_authenticator_base.cc index 4d2b377..5e60d17 100644 --- a/remoting/protocol/negotiating_authenticator_base.cc +++ b/remoting/protocol/negotiating_authenticator_base.cc
@@ -103,9 +103,9 @@ // give it to the underlying authenticator to process. // |current_authenticator_| is owned, so Unretained() is safe here. current_authenticator_->ProcessMessage( - message, base::Bind(&NegotiatingAuthenticatorBase::UpdateState, - base::Unretained(this), - base::Passed(std::move(resume_callback)))); + message, base::BindOnce(&NegotiatingAuthenticatorBase::UpdateState, + base::Unretained(this), + base::Passed(std::move(resume_callback)))); } else { // Otherwise, just discard the message. UpdateState(std::move(resume_callback));
diff --git a/remoting/protocol/pairing_authenticator_base.cc b/remoting/protocol/pairing_authenticator_base.cc index f73dcbc..6165da2 100644 --- a/remoting/protocol/pairing_authenticator_base.cc +++ b/remoting/protocol/pairing_authenticator_base.cc
@@ -59,10 +59,10 @@ spake2_authenticator_.reset(); CreateSpakeAuthenticatorWithPin( WAITING_MESSAGE, - base::Bind(&PairingAuthenticatorBase::ProcessMessage, - weak_factory_.GetWeakPtr(), - base::Owned(new jingle_xmpp::XmlElement(*message)), - base::Passed(std::move(resume_callback)))); + base::BindOnce(&PairingAuthenticatorBase::ProcessMessage, + weak_factory_.GetWeakPtr(), + base::Owned(new jingle_xmpp::XmlElement(*message)), + base::Passed(std::move(resume_callback)))); return; } @@ -72,9 +72,9 @@ // to the peer and retrying with the PIN. spake2_authenticator_->ProcessMessage( message, - base::Bind(&PairingAuthenticatorBase::CheckForFailedSpakeExchange, - weak_factory_.GetWeakPtr(), - base::Passed(std::move(resume_callback)))); + base::BindOnce(&PairingAuthenticatorBase::CheckForFailedSpakeExchange, + weak_factory_.GetWeakPtr(), + base::Passed(std::move(resume_callback)))); } std::unique_ptr<jingle_xmpp::XmlElement> PairingAuthenticatorBase::GetNextMessage() {
diff --git a/remoting/protocol/pairing_host_authenticator.cc b/remoting/protocol/pairing_host_authenticator.cc index 40ef17a5..2b6cb56 100644 --- a/remoting/protocol/pairing_host_authenticator.cc +++ b/remoting/protocol/pairing_host_authenticator.cc
@@ -39,9 +39,10 @@ using_paired_secret_ = true; waiting_for_paired_secret_ = true; pairing_registry_->GetPairing( - client_id, base::Bind(&PairingHostAuthenticator::InitializeWithPairing, - weak_factory_.GetWeakPtr(), preferred_initial_state, - base::Passed(std::move(resume_callback)))); + client_id, + base::BindOnce(&PairingHostAuthenticator::InitializeWithPairing, + weak_factory_.GetWeakPtr(), preferred_initial_state, + base::Passed(std::move(resume_callback)))); } PairingHostAuthenticator::~PairingHostAuthenticator() = default;
diff --git a/remoting/protocol/pairing_registry_unittest.cc b/remoting/protocol/pairing_registry_unittest.cc index 7591e8b76..1fd7ad78 100644 --- a/remoting/protocol/pairing_registry_unittest.cc +++ b/remoting/protocol/pairing_registry_unittest.cc
@@ -97,17 +97,17 @@ EXPECT_NE(pairing_1.shared_secret(), pairing_2.shared_secret()); - registry->GetPairing(pairing_1.client_id(), - base::Bind(&PairingRegistryTest::ExpectSecret, - base::Unretained(this), - pairing_1.shared_secret())); + registry->GetPairing( + pairing_1.client_id(), + base::BindOnce(&PairingRegistryTest::ExpectSecret, base::Unretained(this), + pairing_1.shared_secret())); EXPECT_EQ(1, callback_count_); // Check that the second client is paired with a different shared secret. - registry->GetPairing(pairing_2.client_id(), - base::Bind(&PairingRegistryTest::ExpectSecret, - base::Unretained(this), - pairing_2.shared_secret())); + registry->GetPairing( + pairing_2.client_id(), + base::BindOnce(&PairingRegistryTest::ExpectSecret, base::Unretained(this), + pairing_2.shared_secret())); EXPECT_EQ(2, callback_count_); } @@ -117,9 +117,8 @@ PairingRegistry::Pairing pairing_1 = registry->CreatePairing("client1"); PairingRegistry::Pairing pairing_2 = registry->CreatePairing("client2"); - registry->GetAllPairings( - base::Bind(&PairingRegistryTest::set_pairings, - base::Unretained(this))); + registry->GetAllPairings(base::BindOnce(&PairingRegistryTest::set_pairings, + base::Unretained(this))); ASSERT_EQ(2u, pairings_->GetSize()); const base::DictionaryValue* actual_pairing_1; @@ -147,13 +146,12 @@ registry->DeletePairing( pairing_1.client_id(), - base::Bind(&PairingRegistryTest::ExpectSaveSuccess, - base::Unretained(this))); + base::BindOnce(&PairingRegistryTest::ExpectSaveSuccess, + base::Unretained(this))); // Re-read the list, and verify it only has the pairing_2 client. - registry->GetAllPairings( - base::Bind(&PairingRegistryTest::set_pairings, - base::Unretained(this))); + registry->GetAllPairings(base::BindOnce(&PairingRegistryTest::set_pairings, + base::Unretained(this))); ASSERT_EQ(1u, pairings_->GetSize()); const base::DictionaryValue* actual_pairing_2; @@ -170,14 +168,12 @@ PairingRegistry::Pairing pairing_1 = registry->CreatePairing("client1"); PairingRegistry::Pairing pairing_2 = registry->CreatePairing("client2"); - registry->ClearAllPairings( - base::Bind(&PairingRegistryTest::ExpectSaveSuccess, - base::Unretained(this))); + registry->ClearAllPairings(base::BindOnce( + &PairingRegistryTest::ExpectSaveSuccess, base::Unretained(this))); // Re-read the list, and verify it is empty. - registry->GetAllPairings( - base::Bind(&PairingRegistryTest::set_pairings, - base::Unretained(this))); + registry->GetAllPairings(base::BindOnce(&PairingRegistryTest::set_pairings, + base::Unretained(this))); EXPECT_TRUE(pairings_->empty()); } @@ -222,35 +218,35 @@ PairingRegistry::Pairing pairing_2 = registry->CreatePairing("client2"); registry->GetPairing( pairing_1.client_id(), - base::Bind(&MockPairingRegistryCallbacks::GetPairingCallback, - base::Unretained(&callbacks))); + base::BindOnce(&MockPairingRegistryCallbacks::GetPairingCallback, + base::Unretained(&callbacks))); registry->GetPairing( pairing_2.client_id(), - base::Bind(&MockPairingRegistryCallbacks::GetPairingCallback, - base::Unretained(&callbacks))); + base::BindOnce(&MockPairingRegistryCallbacks::GetPairingCallback, + base::Unretained(&callbacks))); registry->DeletePairing( pairing_2.client_id(), - base::Bind(&MockPairingRegistryCallbacks::DoneCallback, - base::Unretained(&callbacks))); + base::BindOnce(&MockPairingRegistryCallbacks::DoneCallback, + base::Unretained(&callbacks))); registry->GetPairing( pairing_1.client_id(), - base::Bind(&MockPairingRegistryCallbacks::GetPairingCallback, - base::Unretained(&callbacks))); + base::BindOnce(&MockPairingRegistryCallbacks::GetPairingCallback, + base::Unretained(&callbacks))); registry->GetPairing( pairing_2.client_id(), - base::Bind(&MockPairingRegistryCallbacks::GetPairingCallback, - base::Unretained(&callbacks))); + base::BindOnce(&MockPairingRegistryCallbacks::GetPairingCallback, + base::Unretained(&callbacks))); registry->ClearAllPairings( - base::Bind(&MockPairingRegistryCallbacks::DoneCallback, - base::Unretained(&callbacks))); + base::BindOnce(&MockPairingRegistryCallbacks::DoneCallback, + base::Unretained(&callbacks))); registry->GetAllPairings( - base::Bind(&MockPairingRegistryCallbacks::GetAllPairingsCallback, - base::Unretained(&callbacks))); + base::BindOnce(&MockPairingRegistryCallbacks::GetAllPairingsCallback, + base::Unretained(&callbacks))); PairingRegistry::Pairing pairing_3 = registry->CreatePairing("client3"); registry->GetPairing( pairing_3.client_id(), - base::Bind(&MockPairingRegistryCallbacks::GetPairingCallback, - base::Unretained(&callbacks))); + base::BindOnce(&MockPairingRegistryCallbacks::GetPairingCallback, + base::Unretained(&callbacks))); run_loop_.Run(); }
diff --git a/remoting/protocol/pseudotcp_adapter_unittest.cc b/remoting/protocol/pseudotcp_adapter_unittest.cc index d213868..1f0a8d7fc 100644 --- a/remoting/protocol/pseudotcp_adapter_unittest.cc +++ b/remoting/protocol/pseudotcp_adapter_unittest.cc
@@ -253,9 +253,8 @@ input_buffer_->set_offset(input_buffer_->capacity() - kMessageSize); result = host_socket_->Read( - input_buffer_.get(), - kMessageSize, - base::Bind(&TCPChannelTester::OnRead, base::Unretained(this))); + input_buffer_.get(), kMessageSize, + base::BindOnce(&TCPChannelTester::OnRead, base::Unretained(this))); HandleReadResult(result); }; }
diff --git a/remoting/protocol/pseudotcp_channel_factory.cc b/remoting/protocol/pseudotcp_channel_factory.cc index 9e466ba..1fe4cfa 100644 --- a/remoting/protocol/pseudotcp_channel_factory.cc +++ b/remoting/protocol/pseudotcp_channel_factory.cc
@@ -76,8 +76,8 @@ adapter->SetWriteWaitsForSend(true); int result = adapter->Connect( - base::Bind(&PseudoTcpChannelFactory::OnPseudoTcpConnected, - base::Unretained(this), name, callback)); + base::BindOnce(&PseudoTcpChannelFactory::OnPseudoTcpConnected, + base::Unretained(this), name, callback)); if (result != net::ERR_IO_PENDING) OnPseudoTcpConnected(name, callback, result); }
diff --git a/remoting/protocol/ssl_hmac_channel_authenticator.cc b/remoting/protocol/ssl_hmac_channel_authenticator.cc index c4fa431..6d1ce95 100644 --- a/remoting/protocol/ssl_hmac_channel_authenticator.cc +++ b/remoting/protocol/ssl_hmac_channel_authenticator.cc
@@ -283,7 +283,7 @@ std::make_unique<NetStreamSocketAdapter>(std::move(socket))); net::SSLServerSocket* raw_server_socket = server_socket.get(); socket_ = std::move(server_socket); - result = raw_server_socket->Handshake(base::Bind( + result = raw_server_socket->Handshake(base::BindOnce( &SslHmacChannelAuthenticator::OnConnected, base::Unretained(this))); #endif } else { @@ -329,7 +329,7 @@ host_and_port, ssl_config); #endif - result = socket_->Connect(base::Bind( + result = socket_->Connect(base::BindOnce( &SslHmacChannelAuthenticator::OnConnected, base::Unretained(this))); } @@ -382,8 +382,8 @@ while (true) { int result = socket_->Write( auth_write_buf_.get(), auth_write_buf_->BytesRemaining(), - base::Bind(&SslHmacChannelAuthenticator::OnAuthBytesWritten, - base::Unretained(this)), + base::BindOnce(&SslHmacChannelAuthenticator::OnAuthBytesWritten, + base::Unretained(this)), kTrafficAnnotation); if (result == net::ERR_IO_PENDING) break; @@ -420,11 +420,10 @@ void SslHmacChannelAuthenticator::ReadAuthenticationBytes() { while (true) { - int result = - socket_->Read(auth_read_buf_.get(), - auth_read_buf_->RemainingCapacity(), - base::Bind(&SslHmacChannelAuthenticator::OnAuthBytesRead, - base::Unretained(this))); + int result = socket_->Read( + auth_read_buf_.get(), auth_read_buf_->RemainingCapacity(), + base::BindOnce(&SslHmacChannelAuthenticator::OnAuthBytesRead, + base::Unretained(this))); if (result == net::ERR_IO_PENDING) break; if (!HandleAuthBytesRead(result))
diff --git a/remoting/protocol/stream_message_pipe_adapter.cc b/remoting/protocol/stream_message_pipe_adapter.cc index 7bbc79f..d81d2b10 100644 --- a/remoting/protocol/stream_message_pipe_adapter.cc +++ b/remoting/protocol/stream_message_pipe_adapter.cc
@@ -36,8 +36,8 @@ writer_ = std::make_unique<BufferedSocketWriter>(); writer_->Start( base::Bind(&P2PStreamSocket::Write, base::Unretained(socket_.get())), - base::Bind(&StreamMessagePipeAdapter::CloseOnError, - base::Unretained(this))); + base::BindOnce(&StreamMessagePipeAdapter::CloseOnError, + base::Unretained(this))); reader_ = std::make_unique<MessageReader>(); reader_->StartReading(socket_.get(),
diff --git a/remoting/protocol/transport_context.cc b/remoting/protocol/transport_context.cc index 6b2f4cca..d8538eb 100644 --- a/remoting/protocol/transport_context.cc +++ b/remoting/protocol/transport_context.cc
@@ -127,7 +127,7 @@ break; } ice_config_request_[relay_mode_] = std::move(request); - ice_config_request_[relay_mode_]->Send(base::Bind( + ice_config_request_[relay_mode_]->Send(base::BindOnce( &TransportContext::OnIceConfig, base::Unretained(this), relay_mode_)); } }
diff --git a/remoting/protocol/validating_authenticator.cc b/remoting/protocol/validating_authenticator.cc index 83a246f0..59a2172 100644 --- a/remoting/protocol/validating_authenticator.cc +++ b/remoting/protocol/validating_authenticator.cc
@@ -64,9 +64,9 @@ state_ = PROCESSING_MESSAGE; current_authenticator_->ProcessMessage( - message, base::Bind(&ValidatingAuthenticator::UpdateState, - weak_factory_.GetWeakPtr(), - base::Passed(std::move(resume_callback)))); + message, base::BindOnce(&ValidatingAuthenticator::UpdateState, + weak_factory_.GetWeakPtr(), + base::Passed(std::move(resume_callback)))); } std::unique_ptr<jingle_xmpp::XmlElement> ValidatingAuthenticator::GetNextMessage() { @@ -131,9 +131,9 @@ state_ = PROCESSING_MESSAGE; std::move(validation_callback_) .Run(remote_jid_, - base::Bind(&ValidatingAuthenticator::OnValidateComplete, - weak_factory_.GetWeakPtr(), - base::Passed(std::move(resume_callback)))); + base::BindOnce(&ValidatingAuthenticator::OnValidateComplete, + weak_factory_.GetWeakPtr(), + base::Passed(std::move(resume_callback)))); } else { std::move(resume_callback).Run(); }
diff --git a/remoting/protocol/webrtc_frame_scheduler_simple.cc b/remoting/protocol/webrtc_frame_scheduler_simple.cc index f128703..7f3d5b33 100644 --- a/remoting/protocol/webrtc_frame_scheduler_simple.cc +++ b/remoting/protocol/webrtc_frame_scheduler_simple.cc
@@ -290,9 +290,10 @@ target_capture_time = std::max(target_capture_time, now); - capture_timer_.Start(FROM_HERE, target_capture_time - now, - base::Bind(&WebrtcFrameSchedulerSimple::CaptureNextFrame, - base::Unretained(this))); + capture_timer_.Start( + FROM_HERE, target_capture_time - now, + base::BindOnce(&WebrtcFrameSchedulerSimple::CaptureNextFrame, + base::Unretained(this))); } void WebrtcFrameSchedulerSimple::CaptureNextFrame() {
diff --git a/remoting/protocol/webrtc_video_stream.cc b/remoting/protocol/webrtc_video_stream.cc index 6c2ae3d2..22cef71 100644 --- a/remoting/protocol/webrtc_video_stream.cc +++ b/remoting/protocol/webrtc_video_stream.cc
@@ -233,9 +233,9 @@ if (encoder_) { current_frame_stats_->encode_started_time = base::TimeTicks::Now(); - encoder_->Encode( - std::move(frame), frame_params, - base::Bind(&WebrtcVideoStream::OnFrameEncoded, base::Unretained(this))); + encoder_->Encode(std::move(frame), frame_params, + base::BindOnce(&WebrtcVideoStream::OnFrameEncoded, + base::Unretained(this))); } }
diff --git a/sandbox/linux/syscall_broker/broker_process_unittest.cc b/sandbox/linux/syscall_broker/broker_process_unittest.cc index a4fc812..e1144da 100644 --- a/sandbox/linux/syscall_broker/broker_process_unittest.cc +++ b/sandbox/linux/syscall_broker/broker_process_unittest.cc
@@ -64,7 +64,7 @@ BrokerFilePermission::ReadOnly("/proc/cpuinfo")}; BrokerProcess open_broker(kFakeErrnoSentinel, BrokerCommandSet(), permissions); - ASSERT_TRUE(open_broker.Init(base::BindRepeating(&NoOpCallback))); + ASSERT_TRUE(open_broker.Init(base::BindOnce(&NoOpCallback))); ASSERT_TRUE(TestUtils::CurrentProcessHasChildren()); } // Destroy the broker and check it has exited properly. @@ -77,7 +77,7 @@ std::vector<BrokerFilePermission> empty; BrokerProcess open_broker(kFakeErrnoSentinel, command_set, empty); - ASSERT_TRUE(open_broker.Init(base::BindRepeating(&NoOpCallback))); + ASSERT_TRUE(open_broker.Init(base::BindOnce(&NoOpCallback))); int fd = open_broker.Open(NULL, O_RDONLY); ASSERT_EQ(fd, -EFAULT); @@ -105,7 +105,7 @@ BrokerFilePermission::ReadWrite(kRW_WhiteListed)}; BrokerProcess open_broker(denied_errno, command_set, permissions, fast_check_in_client); - ASSERT_TRUE(open_broker.Init(base::BindRepeating(&NoOpCallback))); + ASSERT_TRUE(open_broker.Init(base::BindOnce(&NoOpCallback))); int fd = -1; fd = open_broker.Open(kR_WhiteListed, O_RDONLY); @@ -264,7 +264,7 @@ BrokerFilePermission::ReadOnlyRecursive("/proc/")}; BrokerProcess open_broker(kFakeErrnoSentinel, command_set, permissions, fast_check_in_client); - ASSERT_TRUE(open_broker.Init(base::BindRepeating(&NoOpCallback))); + ASSERT_TRUE(open_broker.Init(base::BindOnce(&NoOpCallback))); // Open cpuinfo via the broker. int cpuinfo_fd = open_broker.Open(kFileCpuInfo, O_RDONLY); @@ -327,7 +327,7 @@ BrokerProcess open_broker(kFakeErrnoSentinel, command_set, permissions, fast_check_in_client); - ASSERT_TRUE(open_broker.Init(base::BindRepeating(&NoOpCallback))); + ASSERT_TRUE(open_broker.Init(base::BindOnce(&NoOpCallback))); int fd = open_broker.Open(kFileCpuInfo, O_RDWR); ASSERT_EQ(fd, -kFakeErrnoSentinel); @@ -405,7 +405,7 @@ std::vector<BrokerFilePermission> permissions = { BrokerFilePermission::ReadWrite(tempfile_name)}; BrokerProcess open_broker(kFakeErrnoSentinel, command_set, permissions); - ASSERT_TRUE(open_broker.Init(base::BindRepeating(&NoOpCallback))); + ASSERT_TRUE(open_broker.Init(base::BindOnce(&NoOpCallback))); // Check we can access that file with read or write. int can_access = open_broker.Access(tempfile_name, R_OK | W_OK); @@ -444,7 +444,7 @@ BrokerProcess open_broker(kFakeErrnoSentinel, command_set, permissions, true /* fast_check_in_client */, true /* quiet_failures_for_tests */); - SANDBOX_ASSERT(open_broker.Init(base::BindRepeating(&NoOpCallback))); + SANDBOX_ASSERT(open_broker.Init(base::BindOnce(&NoOpCallback))); const pid_t broker_pid = open_broker.broker_pid(); SANDBOX_ASSERT(kill(broker_pid, SIGKILL) == 0); @@ -472,7 +472,7 @@ BrokerFilePermission::ReadOnly(kCpuInfo)}; BrokerProcess open_broker(kFakeErrnoSentinel, command_set, permissions, fast_check_in_client); - ASSERT_TRUE(open_broker.Init(base::BindRepeating(&NoOpCallback))); + ASSERT_TRUE(open_broker.Init(base::BindOnce(&NoOpCallback))); // Test that we do the right thing for O_CLOEXEC and O_NONBLOCK. int fd = -1; @@ -562,7 +562,7 @@ std::vector<BrokerFilePermission> permissions = { BrokerFilePermission::ReadOnly(kCpuInfo)}; BrokerProcess open_broker(kFakeErrnoSentinel, command_set, permissions); - SANDBOX_ASSERT(open_broker.Init(base::BindRepeating(&NoOpCallback))); + SANDBOX_ASSERT(open_broker.Init(base::BindOnce(&NoOpCallback))); const int ipc_fd = BrokerProcessTestHelper::GetIPCDescriptor(&open_broker); SANDBOX_ASSERT(ipc_fd >= 0); @@ -615,7 +615,7 @@ BrokerProcess open_broker(kFakeErrnoSentinel, command_set, permissions, true /* fast_check_in_client */, false /* quiet_failures_for_tests */); - ASSERT_TRUE(open_broker.Init(base::BindRepeating(&CloseFD, lifeline_fds[0]))); + ASSERT_TRUE(open_broker.Init(base::BindOnce(&CloseFD, lifeline_fds[0]))); // Make sure the writing end only exists in the broker process. CloseFD(lifeline_fds[1]); @@ -661,7 +661,7 @@ }; BrokerProcess open_broker(kFakeErrnoSentinel, command_set, permissions); - ASSERT_TRUE(open_broker.Init(base::BindRepeating(&NoOpCallback))); + ASSERT_TRUE(open_broker.Init(base::BindOnce(&NoOpCallback))); int fd = -1; @@ -756,7 +756,7 @@ BrokerFilePermission::ReadOnly(tempfile_name)}; BrokerProcess open_broker(kFakeErrnoSentinel, BrokerCommandSet(), permissions, fast_check_in_client); - ASSERT_TRUE(open_broker.Init(base::BindRepeating(&NoOpCallback))); + ASSERT_TRUE(open_broker.Init(base::BindOnce(&NoOpCallback))); memset(&sb, 0, sizeof(sb)); EXPECT_EQ(-kFakeErrnoSentinel, @@ -771,7 +771,7 @@ std::vector<BrokerFilePermission> permissions; BrokerProcess open_broker(kFakeErrnoSentinel, command_set, permissions, fast_check_in_client); - ASSERT_TRUE(open_broker.Init(base::BindRepeating(&NoOpCallback))); + ASSERT_TRUE(open_broker.Init(base::BindOnce(&NoOpCallback))); memset(&sb, 0, sizeof(sb)); EXPECT_EQ(-kFakeErrnoSentinel, @@ -782,7 +782,7 @@ std::vector<BrokerFilePermission> permissions; BrokerProcess open_broker(kFakeErrnoSentinel, command_set, permissions, fast_check_in_client); - ASSERT_TRUE(open_broker.Init(base::BindRepeating(&NoOpCallback))); + ASSERT_TRUE(open_broker.Init(base::BindOnce(&NoOpCallback))); memset(&sb, 0, sizeof(sb)); EXPECT_EQ(-kFakeErrnoSentinel, @@ -794,7 +794,7 @@ BrokerFilePermission::ReadOnly(nonesuch_name)}; BrokerProcess open_broker(kFakeErrnoSentinel, command_set, permissions, fast_check_in_client); - ASSERT_TRUE(open_broker.Init(base::BindRepeating(&NoOpCallback))); + ASSERT_TRUE(open_broker.Init(base::BindOnce(&NoOpCallback))); memset(&sb, 0, sizeof(sb)); EXPECT_EQ(-ENOENT, open_broker.Stat(nonesuch_name, follow_links, &sb)); @@ -827,7 +827,7 @@ BrokerFilePermission::ReadWriteCreate(nonesuch_name)}; BrokerProcess open_broker(kFakeErrnoSentinel, command_set, permissions, fast_check_in_client); - ASSERT_TRUE(open_broker.Init(base::BindRepeating(&NoOpCallback))); + ASSERT_TRUE(open_broker.Init(base::BindOnce(&NoOpCallback))); memset(&sb, 0, sizeof(sb)); EXPECT_EQ(-ENOENT, open_broker.Stat(nonesuch_name, follow_links, &sb)); @@ -859,7 +859,7 @@ BrokerFilePermission::ReadOnly(tempfile_name)}; BrokerProcess open_broker(kFakeErrnoSentinel, command_set, permissions, fast_check_in_client); - ASSERT_TRUE(open_broker.Init(base::BindRepeating(&NoOpCallback))); + ASSERT_TRUE(open_broker.Init(base::BindOnce(&NoOpCallback))); memset(&sb, 0, sizeof(sb)); EXPECT_EQ(0, open_broker.Stat(tempfile_name, follow_links, &sb)); @@ -924,7 +924,7 @@ // itself is not allowed. BrokerProcess open_broker(kFakeErrnoSentinel, BrokerCommandSet(), rwc_permissions, fast_check_in_client); - ASSERT_TRUE(open_broker.Init(base::BindRepeating(&NoOpCallback))); + ASSERT_TRUE(open_broker.Init(base::BindOnce(&NoOpCallback))); EXPECT_EQ(-kFakeErrnoSentinel, open_broker.Rename(oldpath.c_str(), newpath.c_str())); @@ -941,7 +941,7 @@ BrokerFilePermission::ReadWriteCreate(oldpath)}; BrokerProcess open_broker(kFakeErrnoSentinel, command_set, permissions, fast_check_in_client); - ASSERT_TRUE(open_broker.Init(base::BindRepeating(&NoOpCallback))); + ASSERT_TRUE(open_broker.Init(base::BindOnce(&NoOpCallback))); EXPECT_EQ(-kFakeErrnoSentinel, open_broker.Rename(oldpath.c_str(), newpath.c_str())); @@ -955,7 +955,7 @@ BrokerFilePermission::ReadWriteCreate(newpath)}; BrokerProcess open_broker(kFakeErrnoSentinel, command_set, permissions, fast_check_in_client); - ASSERT_TRUE(open_broker.Init(base::BindRepeating(&NoOpCallback))); + ASSERT_TRUE(open_broker.Init(base::BindOnce(&NoOpCallback))); EXPECT_EQ(-kFakeErrnoSentinel, open_broker.Rename(oldpath.c_str(), newpath.c_str())); @@ -970,7 +970,7 @@ BrokerFilePermission::ReadWriteCreate(newpath)}; BrokerProcess open_broker(kFakeErrnoSentinel, command_set, permissions, fast_check_in_client); - ASSERT_TRUE(open_broker.Init(base::BindRepeating(&NoOpCallback))); + ASSERT_TRUE(open_broker.Init(base::BindOnce(&NoOpCallback))); EXPECT_EQ(-kFakeErrnoSentinel, open_broker.Rename(oldpath.c_str(), newpath.c_str())); @@ -985,7 +985,7 @@ BrokerFilePermission::ReadOnly(newpath)}; BrokerProcess open_broker(kFakeErrnoSentinel, command_set, permissions, fast_check_in_client); - ASSERT_TRUE(open_broker.Init(base::BindRepeating(&NoOpCallback))); + ASSERT_TRUE(open_broker.Init(base::BindOnce(&NoOpCallback))); EXPECT_EQ(-kFakeErrnoSentinel, open_broker.Rename(oldpath.c_str(), newpath.c_str())); @@ -997,7 +997,7 @@ // Check rename passes with write permissions to both files. BrokerProcess open_broker(kFakeErrnoSentinel, command_set, rwc_permissions, fast_check_in_client); - ASSERT_TRUE(open_broker.Init(base::BindRepeating(&NoOpCallback))); + ASSERT_TRUE(open_broker.Init(base::BindOnce(&NoOpCallback))); EXPECT_EQ(0, open_broker.Rename(oldpath.c_str(), newpath.c_str())); // ... and files were moved around. @@ -1041,7 +1041,7 @@ BrokerFilePermission::ReadOnly(newpath_name)}; BrokerProcess open_broker(kFakeErrnoSentinel, BrokerCommandSet(), permissions, fast_check_in_client); - ASSERT_TRUE(open_broker.Init(base::BindRepeating(&NoOpCallback))); + ASSERT_TRUE(open_broker.Init(base::BindOnce(&NoOpCallback))); EXPECT_EQ(-kFakeErrnoSentinel, open_broker.Readlink(newpath_name, buf, sizeof(buf))); } @@ -1054,7 +1054,7 @@ std::vector<BrokerFilePermission> permissions; BrokerProcess open_broker(kFakeErrnoSentinel, command_set, permissions, fast_check_in_client); - ASSERT_TRUE(open_broker.Init(base::BindRepeating(&NoOpCallback))); + ASSERT_TRUE(open_broker.Init(base::BindOnce(&NoOpCallback))); EXPECT_EQ(-kFakeErrnoSentinel, open_broker.Readlink(nonesuch_name, buf, sizeof(buf))); } @@ -1063,7 +1063,7 @@ std::vector<BrokerFilePermission> permissions; BrokerProcess open_broker(kFakeErrnoSentinel, command_set, permissions, fast_check_in_client); - ASSERT_TRUE(open_broker.Init(base::BindRepeating(&NoOpCallback))); + ASSERT_TRUE(open_broker.Init(base::BindOnce(&NoOpCallback))); EXPECT_EQ(-kFakeErrnoSentinel, open_broker.Readlink(newpath_name, buf, sizeof(buf))); } @@ -1073,7 +1073,7 @@ BrokerFilePermission::ReadOnly(nonesuch_name)}; BrokerProcess open_broker(kFakeErrnoSentinel, command_set, permissions, fast_check_in_client); - ASSERT_TRUE(open_broker.Init(base::BindRepeating(&NoOpCallback))); + ASSERT_TRUE(open_broker.Init(base::BindOnce(&NoOpCallback))); EXPECT_EQ(-ENOENT, open_broker.Readlink(nonesuch_name, buf, sizeof(buf))); } { @@ -1082,7 +1082,7 @@ BrokerFilePermission::ReadOnly(newpath_name)}; BrokerProcess open_broker(kFakeErrnoSentinel, command_set, permissions, fast_check_in_client); - ASSERT_TRUE(open_broker.Init(base::BindRepeating(&NoOpCallback))); + ASSERT_TRUE(open_broker.Init(base::BindOnce(&NoOpCallback))); ssize_t retlen = open_broker.Readlink(newpath_name, buf, sizeof(buf)); EXPECT_TRUE(retlen == static_cast<ssize_t>(strlen(oldpath_name))); EXPECT_EQ(0, memcmp(oldpath_name, buf, retlen)); @@ -1093,7 +1093,7 @@ BrokerFilePermission::ReadOnly(newpath_name)}; BrokerProcess open_broker(kFakeErrnoSentinel, command_set, permissions, fast_check_in_client); - ASSERT_TRUE(open_broker.Init(base::BindRepeating(&NoOpCallback))); + ASSERT_TRUE(open_broker.Init(base::BindOnce(&NoOpCallback))); EXPECT_EQ(-ENAMETOOLONG, open_broker.Readlink(newpath_name, buf, 4)); } @@ -1137,7 +1137,7 @@ // Actual file with permissions to use but command itself not allowed. BrokerProcess open_broker(kFakeErrnoSentinel, BrokerCommandSet(), rw_permissions, fast_check_in_client); - ASSERT_TRUE(open_broker.Init(base::BindRepeating(&NoOpCallback))); + ASSERT_TRUE(open_broker.Init(base::BindOnce(&NoOpCallback))); EXPECT_EQ(-kFakeErrnoSentinel, open_broker.Mkdir(path_name, 0600)); } @@ -1147,56 +1147,56 @@ // Nonexistent file with no permissions to see file. BrokerProcess open_broker(kFakeErrnoSentinel, command_set, no_permissions, fast_check_in_client); - ASSERT_TRUE(open_broker.Init(base::BindRepeating(&NoOpCallback))); + ASSERT_TRUE(open_broker.Init(base::BindOnce(&NoOpCallback))); EXPECT_EQ(-kFakeErrnoSentinel, open_broker.Mkdir(nonesuch_name, 0600)); } { // Actual file with no permissions to see file. BrokerProcess open_broker(kFakeErrnoSentinel, command_set, no_permissions, fast_check_in_client); - ASSERT_TRUE(open_broker.Init(base::BindRepeating(&NoOpCallback))); + ASSERT_TRUE(open_broker.Init(base::BindOnce(&NoOpCallback))); EXPECT_EQ(-kFakeErrnoSentinel, open_broker.Mkdir(path_name, 0600)); } { // Nonexistent file with insufficient permissions to see file. BrokerProcess open_broker(kFakeErrnoSentinel, command_set, ro_permissions, fast_check_in_client); - ASSERT_TRUE(open_broker.Init(base::BindRepeating(&NoOpCallback))); + ASSERT_TRUE(open_broker.Init(base::BindOnce(&NoOpCallback))); EXPECT_EQ(-kFakeErrnoSentinel, open_broker.Mkdir(nonesuch_name, 0600)); } { // Actual file with insufficient permissions to see file. BrokerProcess open_broker(kFakeErrnoSentinel, command_set, ro_permissions, fast_check_in_client); - ASSERT_TRUE(open_broker.Init(base::BindRepeating(&NoOpCallback))); + ASSERT_TRUE(open_broker.Init(base::BindOnce(&NoOpCallback))); EXPECT_EQ(-kFakeErrnoSentinel, open_broker.Mkdir(path_name, 0600)); } { // Nonexistent file with insufficient permissions to see file, case 2. BrokerProcess open_broker(kFakeErrnoSentinel, command_set, rw_permissions, fast_check_in_client); - ASSERT_TRUE(open_broker.Init(base::BindRepeating(&NoOpCallback))); + ASSERT_TRUE(open_broker.Init(base::BindOnce(&NoOpCallback))); EXPECT_EQ(-kFakeErrnoSentinel, open_broker.Mkdir(nonesuch_name, 0600)); } { // Actual file with insufficient permissions to see file, case 2. BrokerProcess open_broker(kFakeErrnoSentinel, command_set, rw_permissions, fast_check_in_client); - ASSERT_TRUE(open_broker.Init(base::BindRepeating(&NoOpCallback))); + ASSERT_TRUE(open_broker.Init(base::BindOnce(&NoOpCallback))); EXPECT_EQ(-kFakeErrnoSentinel, open_broker.Mkdir(path_name, 0600)); } { // Nonexistent file with permissions to see file. BrokerProcess open_broker(kFakeErrnoSentinel, command_set, rwc_permissions, fast_check_in_client); - ASSERT_TRUE(open_broker.Init(base::BindRepeating(&NoOpCallback))); + ASSERT_TRUE(open_broker.Init(base::BindOnce(&NoOpCallback))); EXPECT_EQ(-ENOENT, open_broker.Mkdir(nonesuch_name, 0600)); } { // Actual file with permissions to see file. BrokerProcess open_broker(kFakeErrnoSentinel, command_set, rwc_permissions, fast_check_in_client); - ASSERT_TRUE(open_broker.Init(base::BindRepeating(&NoOpCallback))); + ASSERT_TRUE(open_broker.Init(base::BindOnce(&NoOpCallback))); EXPECT_EQ(0, open_broker.Mkdir(path_name, 0600)); } @@ -1242,7 +1242,7 @@ // Actual dir with permissions to use but command itself not allowed. BrokerProcess open_broker(kFakeErrnoSentinel, BrokerCommandSet(), rw_permissions, fast_check_in_client); - ASSERT_TRUE(open_broker.Init(base::BindRepeating(&NoOpCallback))); + ASSERT_TRUE(open_broker.Init(base::BindOnce(&NoOpCallback))); EXPECT_EQ(-kFakeErrnoSentinel, open_broker.Rmdir(path_name)); } EXPECT_EQ(0, access(path_name, F_OK)); @@ -1253,7 +1253,7 @@ // Nonexistent dir with no permissions to see dir. BrokerProcess open_broker(kFakeErrnoSentinel, command_set, no_permissions, fast_check_in_client); - ASSERT_TRUE(open_broker.Init(base::BindRepeating(&NoOpCallback))); + ASSERT_TRUE(open_broker.Init(base::BindOnce(&NoOpCallback))); EXPECT_EQ(-kFakeErrnoSentinel, open_broker.Rmdir(nonesuch_name)); } EXPECT_EQ(0, access(path_name, F_OK)); @@ -1262,7 +1262,7 @@ // Actual dir with no permissions to see dir. BrokerProcess open_broker(kFakeErrnoSentinel, command_set, no_permissions, fast_check_in_client); - ASSERT_TRUE(open_broker.Init(base::BindRepeating(&NoOpCallback))); + ASSERT_TRUE(open_broker.Init(base::BindOnce(&NoOpCallback))); EXPECT_EQ(-kFakeErrnoSentinel, open_broker.Rmdir(path_name)); } EXPECT_EQ(0, access(path_name, F_OK)); @@ -1271,7 +1271,7 @@ // Nonexistent dir with insufficient permissions to see dir. BrokerProcess open_broker(kFakeErrnoSentinel, command_set, ro_permissions, fast_check_in_client); - ASSERT_TRUE(open_broker.Init(base::BindRepeating(&NoOpCallback))); + ASSERT_TRUE(open_broker.Init(base::BindOnce(&NoOpCallback))); EXPECT_EQ(-kFakeErrnoSentinel, open_broker.Rmdir(nonesuch_name)); } EXPECT_EQ(0, access(path_name, F_OK)); @@ -1280,7 +1280,7 @@ // Actual dir with insufficient permissions to see dir. BrokerProcess open_broker(kFakeErrnoSentinel, command_set, ro_permissions, fast_check_in_client); - ASSERT_TRUE(open_broker.Init(base::BindRepeating(&NoOpCallback))); + ASSERT_TRUE(open_broker.Init(base::BindOnce(&NoOpCallback))); EXPECT_EQ(-kFakeErrnoSentinel, open_broker.Rmdir(path_name)); } EXPECT_EQ(0, access(path_name, F_OK)); @@ -1289,7 +1289,7 @@ // Nonexistent dir with insufficient permissions to see dir, case 2. BrokerProcess open_broker(kFakeErrnoSentinel, command_set, rw_permissions, fast_check_in_client); - ASSERT_TRUE(open_broker.Init(base::BindRepeating(&NoOpCallback))); + ASSERT_TRUE(open_broker.Init(base::BindOnce(&NoOpCallback))); EXPECT_EQ(-kFakeErrnoSentinel, open_broker.Rmdir(nonesuch_name)); } EXPECT_EQ(0, access(path_name, F_OK)); @@ -1298,7 +1298,7 @@ // Actual dir with insufficient permissions to see dir, case 2. BrokerProcess open_broker(kFakeErrnoSentinel, command_set, rw_permissions, fast_check_in_client); - ASSERT_TRUE(open_broker.Init(base::BindRepeating(&NoOpCallback))); + ASSERT_TRUE(open_broker.Init(base::BindOnce(&NoOpCallback))); EXPECT_EQ(-kFakeErrnoSentinel, open_broker.Rmdir(path_name)); } EXPECT_EQ(0, access(path_name, F_OK)); @@ -1307,7 +1307,7 @@ // Nonexistent dir with permissions to see dir. BrokerProcess open_broker(kFakeErrnoSentinel, command_set, rwc_permissions, fast_check_in_client); - ASSERT_TRUE(open_broker.Init(base::BindRepeating(&NoOpCallback))); + ASSERT_TRUE(open_broker.Init(base::BindOnce(&NoOpCallback))); EXPECT_TRUE(open_broker.Rmdir(nonesuch_name) < 0); } EXPECT_EQ(0, access(path_name, F_OK)); @@ -1316,7 +1316,7 @@ // Actual dir with permissions to see dir. BrokerProcess open_broker(kFakeErrnoSentinel, command_set, rwc_permissions, fast_check_in_client); - ASSERT_TRUE(open_broker.Init(base::BindRepeating(&NoOpCallback))); + ASSERT_TRUE(open_broker.Init(base::BindOnce(&NoOpCallback))); EXPECT_EQ(0, open_broker.Rmdir(path_name)); } // Confirm it was erased. @@ -1363,7 +1363,7 @@ // Actual file with permissions to use but command itself not allowed. BrokerProcess open_broker(kFakeErrnoSentinel, BrokerCommandSet(), rwc_permissions, fast_check_in_client); - ASSERT_TRUE(open_broker.Init(base::BindRepeating(&NoOpCallback))); + ASSERT_TRUE(open_broker.Init(base::BindOnce(&NoOpCallback))); EXPECT_EQ(-kFakeErrnoSentinel, open_broker.Unlink(path_name)); } EXPECT_EQ(0, access(path_name, F_OK)); @@ -1374,7 +1374,7 @@ // Nonexistent file with no permissions to see file. BrokerProcess open_broker(kFakeErrnoSentinel, command_set, no_permissions, fast_check_in_client); - ASSERT_TRUE(open_broker.Init(base::BindRepeating(&NoOpCallback))); + ASSERT_TRUE(open_broker.Init(base::BindOnce(&NoOpCallback))); EXPECT_EQ(-kFakeErrnoSentinel, open_broker.Unlink(nonesuch_name)); } EXPECT_EQ(0, access(path_name, F_OK)); @@ -1383,7 +1383,7 @@ // Actual file with no permissions to see file. BrokerProcess open_broker(kFakeErrnoSentinel, command_set, no_permissions, fast_check_in_client); - ASSERT_TRUE(open_broker.Init(base::BindRepeating(&NoOpCallback))); + ASSERT_TRUE(open_broker.Init(base::BindOnce(&NoOpCallback))); EXPECT_EQ(-kFakeErrnoSentinel, open_broker.Unlink(path_name)); } EXPECT_EQ(0, access(path_name, F_OK)); @@ -1392,7 +1392,7 @@ // Nonexistent file with insufficient permissions to see file. BrokerProcess open_broker(kFakeErrnoSentinel, command_set, ro_permissions, fast_check_in_client); - ASSERT_TRUE(open_broker.Init(base::BindRepeating(&NoOpCallback))); + ASSERT_TRUE(open_broker.Init(base::BindOnce(&NoOpCallback))); EXPECT_EQ(-kFakeErrnoSentinel, open_broker.Unlink(nonesuch_name)); } EXPECT_EQ(0, access(path_name, F_OK)); @@ -1401,7 +1401,7 @@ // Actual file with insufficient permissions to see file. BrokerProcess open_broker(kFakeErrnoSentinel, command_set, ro_permissions, fast_check_in_client); - ASSERT_TRUE(open_broker.Init(base::BindRepeating(&NoOpCallback))); + ASSERT_TRUE(open_broker.Init(base::BindOnce(&NoOpCallback))); EXPECT_EQ(-kFakeErrnoSentinel, open_broker.Unlink(path_name)); } EXPECT_EQ(0, access(path_name, F_OK)); @@ -1410,7 +1410,7 @@ // Nonexistent file with insufficient permissions to see file, case 2. BrokerProcess open_broker(kFakeErrnoSentinel, command_set, rw_permissions, fast_check_in_client); - ASSERT_TRUE(open_broker.Init(base::BindRepeating(&NoOpCallback))); + ASSERT_TRUE(open_broker.Init(base::BindOnce(&NoOpCallback))); EXPECT_EQ(-kFakeErrnoSentinel, open_broker.Unlink(nonesuch_name)); } EXPECT_EQ(0, access(path_name, F_OK)); @@ -1419,7 +1419,7 @@ // Actual file with insufficient permissions to see file, case 2. BrokerProcess open_broker(kFakeErrnoSentinel, command_set, rw_permissions, fast_check_in_client); - ASSERT_TRUE(open_broker.Init(base::BindRepeating(&NoOpCallback))); + ASSERT_TRUE(open_broker.Init(base::BindOnce(&NoOpCallback))); EXPECT_EQ(-kFakeErrnoSentinel, open_broker.Unlink(path_name)); } EXPECT_EQ(0, access(path_name, F_OK)); @@ -1428,7 +1428,7 @@ // Nonexistent file with permissions to see file. BrokerProcess open_broker(kFakeErrnoSentinel, command_set, rwc_permissions, fast_check_in_client); - ASSERT_TRUE(open_broker.Init(base::BindRepeating(&NoOpCallback))); + ASSERT_TRUE(open_broker.Init(base::BindOnce(&NoOpCallback))); EXPECT_TRUE(open_broker.Unlink(nonesuch_name) < 0); } EXPECT_EQ(0, access(path_name, F_OK)); @@ -1437,7 +1437,7 @@ // Actual file with permissions to see file. BrokerProcess open_broker(kFakeErrnoSentinel, command_set, rwc_permissions, fast_check_in_client); - ASSERT_TRUE(open_broker.Init(base::BindRepeating(&NoOpCallback))); + ASSERT_TRUE(open_broker.Init(base::BindOnce(&NoOpCallback))); EXPECT_EQ(0, open_broker.Unlink(path_name)); } // Confirm it was erased.
diff --git a/services/network/network_context_unittest.cc b/services/network/network_context_unittest.cc index 067d4c4..808aa71 100644 --- a/services/network/network_context_unittest.cc +++ b/services/network/network_context_unittest.cc
@@ -2504,90 +2504,10 @@ proxy_resolver_factory.network_isolation_key()); } -// Test mojom::ProxyResolver that completes calls to GetProxyForUrl() with a -// DIRECT "proxy". It additionally emits a script error on line 42 for every -// call to GetProxyForUrl(). -class MockMojoProxyResolver : public proxy_resolver::mojom::ProxyResolver { - public: - MockMojoProxyResolver() {} - - private: - // Overridden from proxy_resolver::mojom::ProxyResolver: - void GetProxyForUrl( - const GURL& url, - const net::NetworkIsolationKey& network_isolation_key, - mojo::PendingRemote<proxy_resolver::mojom::ProxyResolverRequestClient> - pending_client) override { - // Report a Javascript error and then complete the request successfully, - // having chosen DIRECT connections. - mojo::Remote<proxy_resolver::mojom::ProxyResolverRequestClient> client( - std::move(pending_client)); - client->OnError(42, "Failed: FindProxyForURL(url=" + url.spec() + ")"); - - net::ProxyInfo result; - result.UseDirect(); - - client->ReportResult(net::OK, result); - } - - DISALLOW_COPY_AND_ASSIGN(MockMojoProxyResolver); -}; - -// Test mojom::ProxyResolverFactory implementation that successfully completes -// any CreateResolver() requests, and binds the request to a new -// MockMojoProxyResolver. -class MockMojoProxyResolverFactory - : public proxy_resolver::mojom::ProxyResolverFactory { - public: - MockMojoProxyResolverFactory() {} - - // Binds and returns a mock ProxyResolverFactory whose lifetime is bound to - // the message pipe. - static mojo::PendingRemote<proxy_resolver::mojom::ProxyResolverFactory> - Create() { - mojo::PendingRemote<proxy_resolver::mojom::ProxyResolverFactory> remote; - mojo::MakeSelfOwnedReceiver( - std::make_unique<MockMojoProxyResolverFactory>(), - remote.InitWithNewPipeAndPassReceiver()); - return remote; - } - - private: - void CreateResolver( - const std::string& pac_url, - mojo::PendingReceiver<proxy_resolver::mojom::ProxyResolver> receiver, - mojo::PendingRemote< - proxy_resolver::mojom::ProxyResolverFactoryRequestClient> - pending_client) override { - // Bind |receiver| to a new MockMojoProxyResolver, and return success. - mojo::MakeSelfOwnedReceiver(std::make_unique<MockMojoProxyResolver>(), - std::move(receiver)); - - mojo::Remote<proxy_resolver::mojom::ProxyResolverFactoryRequestClient> - client(std::move(pending_client)); - client->ReportResult(net::OK); - } - - DISALLOW_COPY_AND_ASSIGN(MockMojoProxyResolverFactory); -}; - TEST_F(NetworkContextTest, PacQuickCheck) { // Check the default value. - // Note that unless we explicitly create a proxy resolver factory, the code - // will assume that we should use a system proxy resolver (i.e. use system - // APIs to resolve a proxy). This isn't supported on all platforms. On - // unsupported platforms, we'd simply ignore the PAC quick check input and - // default to false. - mojom::NetworkContextParamsPtr context_params = CreateContextParams(); -#if defined(OS_CHROMEOS) - context_params->dhcp_wpad_url_client = - network::MockMojoDhcpWpadUrlClient::CreateWithSelfOwnedReceiver( - std::string()); -#endif // defined(OS_CHROMEOS) - context_params->proxy_resolver_factory = - MockMojoProxyResolverFactory::Create(); std::unique_ptr<NetworkContext> network_context = - CreateContextWithParams(std::move(context_params)); + CreateContextWithParams(CreateContextParams()); net::ConfiguredProxyResolutionService* proxy_resolution_service = nullptr; ASSERT_TRUE( network_context->url_request_context() @@ -2596,14 +2516,7 @@ EXPECT_TRUE(proxy_resolution_service->quick_check_enabled_for_testing()); // Explicitly enable. - context_params = CreateContextParams(); -#if defined(OS_CHROMEOS) - context_params->dhcp_wpad_url_client = - network::MockMojoDhcpWpadUrlClient::CreateWithSelfOwnedReceiver( - std::string()); -#endif // defined(OS_CHROMEOS) - context_params->proxy_resolver_factory = - MockMojoProxyResolverFactory::Create(); + mojom::NetworkContextParamsPtr context_params = CreateContextParams(); context_params->pac_quick_check_enabled = true; network_context = CreateContextWithParams(std::move(context_params)); proxy_resolution_service = nullptr; @@ -2615,13 +2528,6 @@ // Explicitly disable. context_params = CreateContextParams(); -#if defined(OS_CHROMEOS) - context_params->dhcp_wpad_url_client = - network::MockMojoDhcpWpadUrlClient::CreateWithSelfOwnedReceiver( - std::string()); -#endif // defined(OS_CHROMEOS) - context_params->proxy_resolver_factory = - MockMojoProxyResolverFactory::Create(); context_params->pac_quick_check_enabled = false; network_context = CreateContextWithParams(std::move(context_params)); proxy_resolution_service = nullptr; @@ -4785,6 +4691,73 @@ EXPECT_EQ(0u, pac_errors.size()); } +// Test mojom::ProxyResolver that completes calls to GetProxyForUrl() with a +// DIRECT "proxy". It additionally emits a script error on line 42 for every +// call to GetProxyForUrl(). +class MockMojoProxyResolver : public proxy_resolver::mojom::ProxyResolver { + public: + MockMojoProxyResolver() {} + + private: + // Overridden from proxy_resolver::mojom::ProxyResolver: + void GetProxyForUrl( + const GURL& url, + const net::NetworkIsolationKey& network_isolation_key, + mojo::PendingRemote<proxy_resolver::mojom::ProxyResolverRequestClient> + pending_client) override { + // Report a Javascript error and then complete the request successfully, + // having chosen DIRECT connections. + mojo::Remote<proxy_resolver::mojom::ProxyResolverRequestClient> client( + std::move(pending_client)); + client->OnError(42, "Failed: FindProxyForURL(url=" + url.spec() + ")"); + + net::ProxyInfo result; + result.UseDirect(); + + client->ReportResult(net::OK, result); + } + + DISALLOW_COPY_AND_ASSIGN(MockMojoProxyResolver); +}; + +// Test mojom::ProxyResolverFactory implementation that successfully completes +// any CreateResolver() requests, and binds the request to a new +// MockMojoProxyResolver. +class MockMojoProxyResolverFactory + : public proxy_resolver::mojom::ProxyResolverFactory { + public: + MockMojoProxyResolverFactory() {} + + // Binds and returns a mock ProxyResolverFactory whose lifetime is bound to + // the message pipe. + static mojo::PendingRemote<proxy_resolver::mojom::ProxyResolverFactory> + Create() { + mojo::PendingRemote<proxy_resolver::mojom::ProxyResolverFactory> remote; + mojo::MakeSelfOwnedReceiver( + std::make_unique<MockMojoProxyResolverFactory>(), + remote.InitWithNewPipeAndPassReceiver()); + return remote; + } + + private: + void CreateResolver( + const std::string& pac_url, + mojo::PendingReceiver<proxy_resolver::mojom::ProxyResolver> receiver, + mojo::PendingRemote< + proxy_resolver::mojom::ProxyResolverFactoryRequestClient> + pending_client) override { + // Bind |receiver| to a new MockMojoProxyResolver, and return success. + mojo::MakeSelfOwnedReceiver(std::make_unique<MockMojoProxyResolver>(), + std::move(receiver)); + + mojo::Remote<proxy_resolver::mojom::ProxyResolverFactoryRequestClient> + client(std::move(pending_client)); + client->ReportResult(net::OK); + } + + DISALLOW_COPY_AND_ASSIGN(MockMojoProxyResolverFactory); +}; + // Tests that when a ProxyErrorClient is provided to NetworkContextParams, this // client's OnPACScriptError() method is called whenever the PAC script throws // an error.
diff --git a/services/network/network_service_network_delegate.cc b/services/network/network_service_network_delegate.cc index fd814b92..c0e1a2e 100644 --- a/services/network/network_service_network_delegate.cc +++ b/services/network/network_service_network_delegate.cc
@@ -11,6 +11,7 @@ #include "base/strings/utf_string_conversions.h" #include "build/build_config.h" #include "components/domain_reliability/monitor.h" +#include "net/base/isolation_info.h" #include "net/base/load_flags.h" #include "net/base/net_errors.h" #include "net/url_request/url_request.h" @@ -191,9 +192,11 @@ allowed_from_caller && network_context_->cookie_manager() ->cookie_settings() - .IsCookieAccessAllowed( - request.url(), request.site_for_cookies().RepresentativeUrl(), - request.network_isolation_key().GetTopFrameOrigin()); + .IsCookieAccessAllowed(request.url(), + request.site_for_cookies().RepresentativeUrl(), + request.isolation_info() + .network_isolation_key() + .GetTopFrameOrigin()); if (!allowed) return false; @@ -218,9 +221,9 @@ allowed_from_caller && network_context_->cookie_manager() ->cookie_settings() - .IsCookieAccessAllowed( - request.url(), request.site_for_cookies().RepresentativeUrl(), - request.network_isolation_key().GetTopFrameOrigin()); + .IsCookieAccessAllowed(request.url(), + request.site_for_cookies().RepresentativeUrl(), + request.isolation_info().top_frame_origin()); if (!allowed) return false; URLLoader* url_loader = URLLoader::ForRequest(request);
diff --git a/services/network/proxy_resolving_client_socket_unittest.cc b/services/network/proxy_resolving_client_socket_unittest.cc index 84a404f..74923b4 100644 --- a/services/network/proxy_resolving_client_socket_unittest.cc +++ b/services/network/proxy_resolving_client_socket_unittest.cc
@@ -690,8 +690,7 @@ std::make_unique<net::ProxyConfigServiceFixed>( net::ProxyConfigWithAnnotation(proxy_config, TRAFFIC_ANNOTATION_FOR_TESTS)), - std::move(proxy_resolver_factory), nullptr, - true /* quick_check_enabled */); + std::move(proxy_resolver_factory), nullptr); context->set_proxy_resolution_service(&service); context->Init(); @@ -734,8 +733,7 @@ std::make_unique<net::ProxyConfigServiceFixed>( net::ProxyConfigWithAnnotation(proxy_config, TRAFFIC_ANNOTATION_FOR_TESTS)), - std::move(proxy_resolver_factory), nullptr, - true /* quick_check_enabled */); + std::move(proxy_resolver_factory), nullptr); context->set_proxy_resolution_service(&service); context->Init(); @@ -768,8 +766,7 @@ std::make_unique<net::ProxyConfigServiceFixed>( net::ProxyConfigWithAnnotation(proxy_config, TRAFFIC_ANNOTATION_FOR_TESTS)), - std::move(proxy_resolver_factory), nullptr, - true /* quick_check_enabled */); + std::move(proxy_resolver_factory), nullptr); context->set_proxy_resolution_service(&service); context->Init();
diff --git a/services/network/proxy_service_mojo.cc b/services/network/proxy_service_mojo.cc index 8769803..6459806c 100644 --- a/services/network/proxy_service_mojo.cc +++ b/services/network/proxy_service_mojo.cc
@@ -26,7 +26,6 @@ std::unique_ptr<net::DhcpPacFileFetcher> dhcp_pac_file_fetcher, net::HostResolver* host_resolver, net::NetLog* net_log, - bool pac_quick_check_enabled, net::NetworkDelegate* network_delegate) { DCHECK(proxy_config_service); DCHECK(pac_file_fetcher); @@ -42,7 +41,7 @@ network_delegate, base::ThreadTaskRunnerHandle::Get()), net_log), - net_log, pac_quick_check_enabled)); + net_log)); // Configure fetchers to use for PAC script downloads and auto-detect. proxy_resolution_service->SetPacFileFetchers(
diff --git a/services/network/proxy_service_mojo.h b/services/network/proxy_service_mojo.h index e36d0af..030f78e2 100644 --- a/services/network/proxy_service_mojo.h +++ b/services/network/proxy_service_mojo.h
@@ -47,7 +47,6 @@ std::unique_ptr<net::DhcpPacFileFetcher> dhcp_pac_file_fetcher, net::HostResolver* host_resolver, net::NetLog* net_log, - bool pac_quick_check_enabled, net::NetworkDelegate* network_delegate); } // namespace network
diff --git a/services/network/proxy_service_mojo_unittest.cc b/services/network/proxy_service_mojo_unittest.cc index 64cdcb3b..242d0c1 100644 --- a/services/network/proxy_service_mojo_unittest.cc +++ b/services/network/proxy_service_mojo_unittest.cc
@@ -127,8 +127,7 @@ TRAFFIC_ANNOTATION_FOR_TESTS)), base::WrapUnique(fetcher_), std::make_unique<net::DoNothingDhcpPacFileFetcher>(), - &mock_host_resolver_, &net_log_, true /* pac_quick_check_enabled */, - &network_delegate_); + &mock_host_resolver_, &net_log_, &network_delegate_); } base::test::TaskEnvironment task_environment_;
diff --git a/services/network/public/cpp/cross_origin_resource_policy.cc b/services/network/public/cpp/cross_origin_resource_policy.cc index 9da4ce38..9419456 100644 --- a/services/network/public/cpp/cross_origin_resource_policy.cc +++ b/services/network/public/cpp/cross_origin_resource_policy.cc
@@ -7,6 +7,7 @@ #include <string> #include "base/feature_list.h" +#include "base/metrics/histogram_macros.h" #include "net/base/registry_controlled_domains/registry_controlled_domain.h" #include "net/http/http_response_headers.h" #include "services/network/public/cpp/cross_origin_embedder_policy.h" @@ -23,6 +24,34 @@ namespace { +// Do not reorder values because we use this in UMA histograms. +enum class CorpResult { + kSuccess = 0, + kNotSameOrigin = 1, + kNotSameOriginAfterDefaultedToSameOriginByCoep = 2, + kNotSameSite = 3, + kMaxValue = kNotSameSite, +}; + +CorpResult ToCorpResult(const base::Optional<BlockedByResponseReason>& value) { + if (!value) { + return CorpResult::kSuccess; + } + switch (*value) { + case BlockedByResponseReason::kCoepFrameResourceNeedsCoepHeader: + case BlockedByResponseReason::kCoopSandboxedIFrameCannotNavigateToCoopPage: + NOTREACHED(); + return CorpResult::kSuccess; + case BlockedByResponseReason::kCorpNotSameOrigin: + return CorpResult::kNotSameOrigin; + case BlockedByResponseReason:: + kCorpNotSameOriginAfterDefaultedToSameOriginByCoep: + return CorpResult::kNotSameOriginAfterDefaultedToSameOriginByCoep; + case BlockedByResponseReason::kCorpNotSameSite: + return CorpResult::kNotSameSite; + } +} + // https://fetch.spec.whatwg.org/#cross-origin-resource-policy-header says: // > ABNF: // > Cross-Origin-Resource-Policy = %s"same-origin" / %s"same-site" @@ -188,6 +217,9 @@ const auto result = IsBlockedInternal( policy, request_url, request_initiator, request_mode, request_initiator_site_lock, embedder_policy.report_only_value); + UMA_HISTOGRAM_ENUMERATION( + "NetworkService.CrossOriginResourcePolicy.ReportOnlyResult", + ToCorpResult(result)); if (result == kBlockedDueToCoep || (result.has_value() && request_mode == mojom::RequestMode::kNavigate)) { reporter->QueueCorpViolationReport(original_url, /*report_only=*/true); @@ -202,6 +234,8 @@ const auto result = IsBlockedInternal(policy, request_url, request_initiator, request_mode, request_initiator_site_lock, embedder_policy.value); + UMA_HISTOGRAM_ENUMERATION("NetworkService.CrossOriginResourcePolicy.Result", + ToCorpResult(result)); if (reporter && (result == kBlockedDueToCoep || (result.has_value() && request_mode == mojom::RequestMode::kNavigate))) {
diff --git a/services/network/resource_scheduler/resource_scheduler.cc b/services/network/resource_scheduler/resource_scheduler.cc index f8c789a0..e738be0 100644 --- a/services/network/resource_scheduler/resource_scheduler.cc +++ b/services/network/resource_scheduler/resource_scheduler.cc
@@ -25,6 +25,7 @@ #include "base/time/tick_clock.h" #include "base/trace_event/trace_event.h" #include "net/base/host_port_pair.h" +#include "net/base/isolation_info.h" #include "net/base/load_flags.h" #include "net/base/request_priority.h" #include "net/http/http_server_properties.h" @@ -761,8 +762,9 @@ net::HttpServerProperties& http_server_properties = *request->url_request()->context()->http_server_properties(); if (!http_server_properties.SupportsRequestPriority( - scheme_host_port, - request->url_request()->network_isolation_key())) { + scheme_host_port, request->url_request() + ->isolation_info() + .network_isolation_key())) { attributes |= kAttributeDelayable; } } @@ -1065,8 +1067,9 @@ bool supports_priority = url_request.context() ->http_server_properties() - ->SupportsRequestPriority(scheme_host_port, - url_request.network_isolation_key()); + ->SupportsRequestPriority( + scheme_host_port, + url_request.isolation_info().network_isolation_key()); if (!priority_delayable) { // TODO(willchan): We should really improve this algorithm as described in
diff --git a/services/network/resource_scheduler/resource_scheduler_unittest.cc b/services/network/resource_scheduler/resource_scheduler_unittest.cc index 784a596..560d4f379 100644 --- a/services/network/resource_scheduler/resource_scheduler_unittest.cc +++ b/services/network/resource_scheduler/resource_scheduler_unittest.cc
@@ -24,8 +24,8 @@ #include "base/timer/timer.h" #include "net/base/features.h" #include "net/base/host_port_pair.h" +#include "net/base/isolation_info.h" #include "net/base/load_timing_info.h" -#include "net/base/network_isolation_key.h" #include "net/base/request_priority.h" #include "net/nqe/network_quality_estimator_test_util.h" #include "net/test/embedded_test_server/embedded_test_server.h" @@ -251,8 +251,7 @@ int child_id, int route_id) { return GetNewTestRequest(url, priority, TRAFFIC_ANNOTATION_FOR_TESTS, - child_id, route_id, true, - net::NetworkIsolationKey()); + child_id, route_id, true, net::IsolationInfo()); } std::unique_ptr<TestRequest> NewRequest(const char* url, @@ -279,7 +278,7 @@ net::RequestPriority priority, const net::NetworkTrafficAnnotationTag& traffic_annotation) { return GetNewTestRequest(url, priority, traffic_annotation, kBrowserChildId, - kBrowserRouteId, true, net::NetworkIsolationKey()); + kBrowserRouteId, true, net::IsolationInfo()); } std::unique_ptr<TestRequest> NewSyncRequest(const char* url, @@ -300,16 +299,15 @@ int child_id, int route_id) { return GetNewTestRequest(url, priority, TRAFFIC_ANNOTATION_FOR_TESTS, - child_id, route_id, false, - net::NetworkIsolationKey()); + child_id, route_id, false, net::IsolationInfo()); } - std::unique_ptr<TestRequest> NewRequestWithNetworkIsolationKey( + std::unique_ptr<TestRequest> NewRequestWithIsolationInfo( const char* url, net::RequestPriority priority, - const net::NetworkIsolationKey& network_isolation_key) { + const net::IsolationInfo& isolation_info) { return GetNewTestRequest(url, priority, TRAFFIC_ANNOTATION_FOR_TESTS, - kChildId, kRouteId, true, network_isolation_key); + kChildId, kRouteId, true, isolation_info); } std::unique_ptr<TestRequest> GetNewTestRequest( @@ -319,10 +317,10 @@ int child_id, int route_id, bool is_async, - const net::NetworkIsolationKey& network_isolation_key) { + const net::IsolationInfo& isolation_info) { std::unique_ptr<net::URLRequest> url_request(NewURLRequestWithChildAndRoute( url, priority, traffic_annotation, child_id, route_id)); - url_request->set_network_isolation_key(network_isolation_key); + url_request->set_isolation_info(isolation_info); auto scheduled_request = scheduler_->ScheduleRequest( child_id, route_id, is_async, url_request.get()); @@ -581,41 +579,43 @@ } TEST_F(ResourceSchedulerTest, - MaxRequestsPerHostForSpdyWhenNotDelayableWithNetworkIsolationKey) { + MaxRequestsPerHostForSpdyWhenNotDelayableWithIsolationInfo) { const url::Origin kOrigin1 = url::Origin::Create(GURL("https://foo.test/")); - const net::NetworkIsolationKey kNetworkIsolationKey1(kOrigin1, kOrigin1); + const net::IsolationInfo kIsolationInfo1 = + net::IsolationInfo::CreateForInternalRequest(kOrigin1); const url::Origin kOrigin2 = url::Origin::Create(GURL("https://bar.test/")); - const net::NetworkIsolationKey kNetworkIsolationKey2(kOrigin2, kOrigin2); + const net::IsolationInfo kIsolationInfo2 = + net::IsolationInfo::CreateForInternalRequest(kOrigin2); InitializeScheduler(); context_->http_server_properties()->SetSupportsSpdy( - url::SchemeHostPort("https", "spdyhost", 443), kNetworkIsolationKey1, - true); + url::SchemeHostPort("https", "spdyhost", 443), + kIsolationInfo1.network_isolation_key(), true); // Add more than max-per-host low-priority requests. std::vector<std::unique_ptr<TestRequest>> requests; for (size_t i = 0; i < kMaxNumDelayableRequestsPerHostPerClient + 1; ++i) { - requests.push_back(NewRequestWithNetworkIsolationKey( - "https://spdyhost/low", net::LOWEST, kNetworkIsolationKey1)); + requests.push_back(NewRequestWithIsolationInfo( + "https://spdyhost/low", net::LOWEST, kIsolationInfo1)); // No throttling. EXPECT_TRUE(requests.back()->started()); } requests.clear(); - // Requests with different NetworkIsolationKeys should be throttled as if they + // Requests with different IsolationInfos should be throttled as if they // don't support H2. for (size_t i = 0; i < kMaxNumDelayableRequestsPerHostPerClient + 1; ++i) { - requests.push_back(NewRequestWithNetworkIsolationKey( - "https://spdyhost/low", net::LOWEST, net::NetworkIsolationKey())); + requests.push_back(NewRequestWithIsolationInfo( + "https://spdyhost/low", net::LOWEST, net::IsolationInfo())); EXPECT_EQ(i < kMaxNumDelayableRequestsPerHostPerClient, requests.back()->started()); } requests.clear(); for (size_t i = 0; i < kMaxNumDelayableRequestsPerHostPerClient + 1; ++i) { - requests.push_back(NewRequestWithNetworkIsolationKey( - "https://spdyhost/low", net::LOWEST, kNetworkIsolationKey2)); + requests.push_back(NewRequestWithIsolationInfo( + "https://spdyhost/low", net::LOWEST, kIsolationInfo2)); EXPECT_EQ(i < kMaxNumDelayableRequestsPerHostPerClient, requests.back()->started()); } @@ -1761,13 +1761,14 @@ } } -TEST_F( - ResourceSchedulerTest, - MaxRequestsPerHostForSpdyWhenDelayableSlowConnectionsWithNetworkIsolationKey) { +TEST_F(ResourceSchedulerTest, + MaxRequestsPerHostForSpdyWhenDelayableSlowConnectionsWithIsolationInfo) { const url::Origin kOrigin1 = url::Origin::Create(GURL("https://foo.test/")); - const net::NetworkIsolationKey kNetworkIsolationKey1(kOrigin1, kOrigin1); + const net::IsolationInfo kIsolationInfo1 = + net::IsolationInfo::CreateForInternalRequest(kOrigin1); const url::Origin kOrigin2 = url::Origin::Create(GURL("https://bar.test/")); - const net::NetworkIsolationKey kNetworkIsolationKey2(kOrigin2, kOrigin2); + const net::IsolationInfo kIsolationInfo2 = + net::IsolationInfo::CreateForInternalRequest(kOrigin2); ConfigureDelayRequestsOnMultiplexedConnectionsFieldTrial(); network_quality_estimator_.SetAndNotifyObserversOfEffectiveConnectionType( @@ -1775,8 +1776,8 @@ InitializeScheduler(); context_->http_server_properties()->SetSupportsSpdy( - url::SchemeHostPort("https", "spdyhost", 443), kNetworkIsolationKey1, - true); + url::SchemeHostPort("https", "spdyhost", 443), + kIsolationInfo1.network_isolation_key(), true); // Should be in sync with resource_scheduler.cc for effective connection type // of 2G. @@ -1789,8 +1790,8 @@ // requests. They should all be allowed. std::vector<std::unique_ptr<TestRequest>> requests; for (size_t i = 0; i < kMaxNumDelayableRequestsPerHostPerClient + 1; ++i) { - requests.push_back(NewRequestWithNetworkIsolationKey( - "https://spdyhost/low", net::LOWEST, kNetworkIsolationKey1)); + requests.push_back(NewRequestWithIsolationInfo( + "https://spdyhost/low", net::LOWEST, kIsolationInfo1)); EXPECT_TRUE(requests[i]->started()); } @@ -1800,26 +1801,26 @@ for (size_t i = kMaxNumDelayableRequestsPerHostPerClient + 1; i < kDefaultMaxNumDelayableRequestsPerClient + 1; i++) { EXPECT_EQ(i, requests.size()); - requests.push_back(NewRequestWithNetworkIsolationKey( - "https://spdyhost/low", net::LOWEST, kNetworkIsolationKey1)); + requests.push_back(NewRequestWithIsolationInfo( + "https://spdyhost/low", net::LOWEST, kIsolationInfo1)); EXPECT_EQ(i < kDefaultMaxNumDelayableRequestsPerClient, requests[i]->started()); } requests.clear(); - // Requests with other NetworkIsolationKeys are subject to the + // Requests with other IsolationInfos are subject to the // kMaxNumDelayableRequestsPerHostPerClient limit. for (size_t i = 0; i < kMaxNumDelayableRequestsPerHostPerClient + 1; ++i) { - requests.push_back(NewRequestWithNetworkIsolationKey( - "https://spdyhost/low", net::LOWEST, net::NetworkIsolationKey())); + requests.push_back(NewRequestWithIsolationInfo( + "https://spdyhost/low", net::LOWEST, net::IsolationInfo())); EXPECT_EQ(i < kMaxNumDelayableRequestsPerHostPerClient, requests[i]->started()); } requests.clear(); for (size_t i = 0; i < kMaxNumDelayableRequestsPerHostPerClient + 1; ++i) { - requests.push_back(NewRequestWithNetworkIsolationKey( - "https://spdyhost/low", net::LOWEST, kNetworkIsolationKey2)); + requests.push_back(NewRequestWithIsolationInfo( + "https://spdyhost/low", net::LOWEST, kIsolationInfo2)); EXPECT_EQ(i < kMaxNumDelayableRequestsPerHostPerClient, requests[i]->started()); }
diff --git a/services/network/url_loader.cc b/services/network/url_loader.cc index fb4f8ad..3dc126f9 100644 --- a/services/network/url_loader.cc +++ b/services/network/url_loader.cc
@@ -26,6 +26,7 @@ #include "mojo/public/cpp/system/simple_watcher.h" #include "net/base/elements_upload_data_stream.h" #include "net/base/ip_endpoint.h" +#include "net/base/isolation_info.h" #include "net/base/load_flags.h" #include "net/base/mime_sniffer.h" #include "net/base/upload_bytes_element_reader.h" @@ -523,10 +524,6 @@ custom_proxy_pre_cache_headers_(request.custom_proxy_pre_cache_headers), custom_proxy_post_cache_headers_(request.custom_proxy_post_cache_headers), fetch_window_id_(request.fetch_window_id), - update_network_isolation_key_on_redirect_( - request.trusted_params - ? request.trusted_params->update_network_isolation_key_on_redirect - : mojom::UpdateNetworkIsolationKeyOnRedirect::kDoNotUpdate), origin_policy_manager_(nullptr), trust_token_helper_(std::move(trust_token_helper)), isolated_world_origin_(request.isolated_world_origin) { @@ -561,13 +558,30 @@ url_request_->set_referrer_policy(request.referrer_policy); url_request_->set_upgrade_if_insecure(request.upgrade_if_insecure); + net::IsolationInfo::RedirectMode redirect_mode; + if (!request.trusted_params) { + redirect_mode = net::IsolationInfo::RedirectMode::kUpdateNothing; + } else { + switch (request.trusted_params->update_network_isolation_key_on_redirect) { + case mojom::UpdateNetworkIsolationKeyOnRedirect:: + kUpdateTopFrameAndFrameOrigin: + redirect_mode = net::IsolationInfo::RedirectMode::kUpdateTopFrame; + break; + case mojom::UpdateNetworkIsolationKeyOnRedirect::kUpdateFrameOrigin: + redirect_mode = net::IsolationInfo::RedirectMode::kUpdateFrameOnly; + break; + case mojom::UpdateNetworkIsolationKeyOnRedirect::kDoNotUpdate: + redirect_mode = net::IsolationInfo::RedirectMode::kUpdateNothing; + break; + } + } if (factory_params_->network_isolation_key) { - url_request_->set_network_isolation_key( - factory_params_->network_isolation_key.value()); + url_request_->set_isolation_info(net::IsolationInfo::CreatePartial( + redirect_mode, factory_params_->network_isolation_key.value())); } else if (request.trusted_params && !request.trusted_params->network_isolation_key.IsEmpty()) { - url_request_->set_network_isolation_key( - request.trusted_params->network_isolation_key); + url_request_->set_isolation_info(net::IsolationInfo::CreatePartial( + redirect_mode, request.trusted_params->network_isolation_key)); } if (factory_params_->disable_secure_dns) { @@ -893,28 +907,6 @@ LogConcerningRequestHeaders(modified_headers, true /* added_during_redirect */); - // See if network isolation key needs to be updated. - // TODO(crbug.com/979296): Consider changing this code to copy an origin - // instead of creating one from a URL which lacks opacity information - if (url_request_->network_isolation_key().IsFullyPopulated() && - update_network_isolation_key_on_redirect_ != - mojom::UpdateNetworkIsolationKeyOnRedirect::kDoNotUpdate) { - const GURL& url = new_url ? new_url.value() : *deferred_redirect_url_; - const url::Origin& new_origin = url::Origin::Create(url); - - if (update_network_isolation_key_on_redirect_ == - mojom::UpdateNetworkIsolationKeyOnRedirect:: - kUpdateTopFrameAndFrameOrigin) { - url_request_->set_network_isolation_key(net::NetworkIsolationKey( - new_origin /* top frame origin */, new_origin /* frame origin */)); - } else if (update_network_isolation_key_on_redirect_ == - mojom::UpdateNetworkIsolationKeyOnRedirect::kUpdateFrameOrigin) { - url_request_->set_network_isolation_key( - url_request_->network_isolation_key().CreateWithNewFrameOrigin( - new_origin)); - } - } - deferred_redirect_url_.reset(); new_redirect_url_ = new_url;
diff --git a/services/network/url_loader.h b/services/network/url_loader.h index 9a07d08b..9098fa1 100644 --- a/services/network/url_loader.h +++ b/services/network/url_loader.h
@@ -425,11 +425,6 @@ std::unique_ptr<FileOpenerForUpload> file_opener_for_upload_; - // See detailed comment in - // mojom::network::URLRequest::update_network_isolation_key_on_redirect. - mojom::UpdateNetworkIsolationKeyOnRedirect - update_network_isolation_key_on_redirect_; - // Will only be set for requests that have |obey_origin_policy| set. mojom::OriginPolicyManager* origin_policy_manager_;
diff --git a/services/network/url_request_context_builder_mojo.cc b/services/network/url_request_context_builder_mojo.cc index 95c48bb3..986f9c49 100644 --- a/services/network/url_request_context_builder_mojo.cc +++ b/services/network/url_request_context_builder_mojo.cc
@@ -57,8 +57,7 @@ net::URLRequestContext* url_request_context, net::HostResolver* host_resolver, net::NetworkDelegate* network_delegate, - net::NetLog* net_log, - bool pac_quick_check_enabled) { + net::NetLog* net_log) { DCHECK(url_request_context); DCHECK(host_resolver); @@ -72,12 +71,12 @@ std::move(mojo_proxy_resolver_factory_), std::move(proxy_config_service), std::move(pac_file_fetcher), std::move(dhcp_pac_file_fetcher), host_resolver, net_log, - pac_quick_check_enabled, network_delegate); + network_delegate); } return net::URLRequestContextBuilder::CreateProxyResolutionService( std::move(proxy_config_service), url_request_context, host_resolver, - network_delegate, net_log, pac_quick_check_enabled); + network_delegate, net_log); } } // namespace network
diff --git a/services/network/url_request_context_builder_mojo.h b/services/network/url_request_context_builder_mojo.h index 77cf6e37..15ee45e 100644 --- a/services/network/url_request_context_builder_mojo.h +++ b/services/network/url_request_context_builder_mojo.h
@@ -59,8 +59,7 @@ net::URLRequestContext* url_request_context, net::HostResolver* host_resolver, net::NetworkDelegate* network_delegate, - net::NetLog* net_log, - bool pac_quick_check_enabled) override; + net::NetLog* net_log) override; std::unique_ptr<net::DhcpPacFileFetcher> CreateDhcpPacFileFetcher( net::URLRequestContext* context);
diff --git a/skia/config/SkUserConfig.h b/skia/config/SkUserConfig.h index 66b4b03c..3c8ffdd 100644 --- a/skia/config/SkUserConfig.h +++ b/skia/config/SkUserConfig.h
@@ -195,22 +195,12 @@ # define SK_SUPPORT_LEGACY_ANISOTROPIC_MIPMAP_SCALE #endif -// Remove this after we fixed all the issues related to the new SDF algorithm -// (https://codereview.chromium.org/1643143002) -#ifndef SK_USE_LEGACY_DISTANCE_FIELDS -#define SK_USE_LEGACY_DISTANCE_FIELDS -#endif - // For now, Chrome should only attempt to reduce opList splitting when recording // DDLs #ifndef SK_DISABLE_REDUCE_OPLIST_SPLITTING #define SK_DISABLE_REDUCE_OPLIST_SPLITTING #endif -#ifndef SK_IGNORE_LINEONLY_AA_CONVEX_PATH_OPTS -#define SK_IGNORE_LINEONLY_AA_CONVEX_PATH_OPTS -#endif - // Max. verb count for paths rendered by the edge-AA tessellating path renderer. #define GR_AA_TESSELLATOR_MAX_VERB_COUNT 100 @@ -218,15 +208,8 @@ #define SK_SUPPORT_LEGACY_AAA_CHOICE #endif -// We're turning this off indefinitely, -// until we can figure out some fundamental problems with its approach. -// -// See chromium:913223, skia:6886. -#define SK_DISABLE_DAA - // Staging for lowp::bilerp_clamp_8888, and for planned misc. others. #define SK_DISABLE_LOWP_BILERP_CLAMP_CLAMP_STAGE -#define SK_DISABLE_NEXT_BATCH_OF_LOWP_STAGES ///////////////////////// Imported from BUILD.gn and skia_common.gypi
diff --git a/storage/browser/quota/quota_manager.cc b/storage/browser/quota/quota_manager.cc index acd2318..4f2ba2c 100644 --- a/storage/browser/quota/quota_manager.cc +++ b/storage/browser/quota/quota_manager.cc
@@ -1508,6 +1508,10 @@ } } +void QuotaManager::SimulateStoragePressure(const url::Origin origin) { + storage_pressure_callback_.Run(origin); +} + void QuotaManager::SetStoragePressureCallback( base::RepeatingCallback<void(url::Origin)> storage_pressure_callback) { storage_pressure_callback_ = storage_pressure_callback;
diff --git a/storage/browser/quota/quota_manager.h b/storage/browser/quota/quota_manager.h index 34de4614..2f19920 100644 --- a/storage/browser/quota/quota_manager.h +++ b/storage/browser/quota/quota_manager.h
@@ -418,6 +418,9 @@ void MaybeRunStoragePressureCallback(const url::Origin& origin, int64_t total_space, int64_t available_space); + // Used from quota-internals page to test behavior of the storage pressure + // callback. + void SimulateStoragePressure(const url::Origin origin); void PostTaskAndReplyWithResultForDBThread( const base::Location& from_here,
diff --git a/testing/buildbot/chromium.android.json b/testing/buildbot/chromium.android.json index 82fe96e5..c953c2d 100644 --- a/testing/buildbot/chromium.android.json +++ b/testing/buildbot/chromium.android.json
@@ -21229,10 +21229,10 @@ "--shared-prefs-file=//chrome/android/shared_preference_files/test/vr_ddview_skipdon_setupcomplete.json", "--replace-system-package=com.google.vr.vrcore,//third_party/gvr-android-sdk/test-apks/vr_services/vr_services_current.apk", "--additional-apk=//third_party/gvr-android-sdk/test-apks/vr_keyboard/vr_keyboard_current.apk", - "--git-revision", - "${got_revision}", "--gs-results-bucket=chromium-result-details", - "--recover-devices" + "--recover-devices", + "--git-revision", + "${got_revision}" ], "merge": { "args": [ @@ -21621,10 +21621,10 @@ "--shared-prefs-file=//chrome/android/shared_preference_files/test/vr_ddview_skipdon_setupcomplete.json", "--replace-system-package=com.google.vr.vrcore,//third_party/gvr-android-sdk/test-apks/vr_services/vr_services_current.apk", "--additional-apk=//third_party/gvr-android-sdk/test-apks/vr_keyboard/vr_keyboard_current.apk", - "--git-revision", - "${got_revision}", "--gs-results-bucket=chromium-result-details", - "--recover-devices" + "--recover-devices", + "--git-revision", + "${got_revision}" ], "merge": { "args": [ @@ -37207,10 +37207,10 @@ "--shared-prefs-file=//chrome/android/shared_preference_files/test/vr_ddview_skipdon_setupcomplete.json", "--replace-system-package=com.google.vr.vrcore,//third_party/gvr-android-sdk/test-apks/vr_services/vr_services_current.apk", "--additional-apk=//third_party/gvr-android-sdk/test-apks/vr_keyboard/vr_keyboard_current.apk", - "--git-revision", - "${got_revision}", "--gs-results-bucket=chromium-result-details", - "--recover-devices" + "--recover-devices", + "--git-revision", + "${got_revision}" ], "merge": { "args": [
diff --git a/testing/buildbot/chromium.ci.json b/testing/buildbot/chromium.ci.json index 17949679..1656b602 100644 --- a/testing/buildbot/chromium.ci.json +++ b/testing/buildbot/chromium.ci.json
@@ -6950,10 +6950,10 @@ "-v", "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc", "--dont-restore-color-profile-after-test", - "--build-revision", - "${got_revision}", "--test-machine-name", - "${buildername}" + "${buildername}", + "--git-revision", + "${got_revision}" ], "isolate_name": "telemetry_gpu_integration_test", "merge": { @@ -6962,11 +6962,11 @@ }, "name": "maps_pixel_test", "precommit_args": [ - "--review-patch-issue", + "--gerrit-issue", "${patch_issue}", - "--review-patch-set", + "--gerrit-patchset", "${patch_set}", - "--buildbucket-build-id", + "--buildbucket-id", "${buildbucket_build_id}" ], "should_retry_with_patch": false, @@ -6995,10 +6995,10 @@ "-v", "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc", "--dont-restore-color-profile-after-test", - "--build-revision", - "${got_revision}", "--test-machine-name", - "${buildername}" + "${buildername}", + "--git-revision", + "${got_revision}" ], "isolate_name": "telemetry_gpu_integration_test", "merge": { @@ -7007,11 +7007,11 @@ }, "name": "pixel_skia_gold_test", "precommit_args": [ - "--review-patch-issue", + "--gerrit-issue", "${patch_issue}", - "--review-patch-set", + "--gerrit-patchset", "${patch_set}", - "--buildbucket-build-id", + "--buildbucket-id", "${buildbucket_build_id}" ], "should_retry_with_patch": false, @@ -7482,10 +7482,10 @@ "-v", "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc", "--dont-restore-color-profile-after-test", - "--build-revision", - "${got_revision}", "--test-machine-name", - "${buildername}" + "${buildername}", + "--git-revision", + "${got_revision}" ], "isolate_name": "telemetry_gpu_integration_test", "merge": { @@ -7494,11 +7494,11 @@ }, "name": "maps_pixel_test", "precommit_args": [ - "--review-patch-issue", + "--gerrit-issue", "${patch_issue}", - "--review-patch-set", + "--gerrit-patchset", "${patch_set}", - "--buildbucket-build-id", + "--buildbucket-id", "${buildbucket_build_id}" ], "should_retry_with_patch": false, @@ -7527,10 +7527,10 @@ "-v", "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc", "--dont-restore-color-profile-after-test", - "--build-revision", - "${got_revision}", "--test-machine-name", - "${buildername}" + "${buildername}", + "--git-revision", + "${got_revision}" ], "isolate_name": "telemetry_gpu_integration_test", "merge": { @@ -7539,11 +7539,11 @@ }, "name": "pixel_skia_gold_test", "precommit_args": [ - "--review-patch-issue", + "--gerrit-issue", "${patch_issue}", - "--review-patch-set", + "--gerrit-patchset", "${patch_set}", - "--buildbucket-build-id", + "--buildbucket-id", "${buildbucket_build_id}" ], "should_retry_with_patch": false, @@ -7765,10 +7765,10 @@ "-v", "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc", "--dont-restore-color-profile-after-test", - "--build-revision", - "${got_revision}", "--test-machine-name", - "${buildername}" + "${buildername}", + "--git-revision", + "${got_revision}" ], "isolate_name": "telemetry_gpu_integration_test", "merge": { @@ -7777,11 +7777,11 @@ }, "name": "android_webview_pixel_skia_gold_test", "precommit_args": [ - "--review-patch-issue", + "--gerrit-issue", "${patch_issue}", - "--review-patch-set", + "--gerrit-patchset", "${patch_set}", - "--buildbucket-build-id", + "--buildbucket-id", "${buildbucket_build_id}" ], "should_retry_with_patch": false, @@ -7998,10 +7998,10 @@ "-v", "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc", "--dont-restore-color-profile-after-test", - "--build-revision", - "${got_revision}", "--test-machine-name", - "${buildername}" + "${buildername}", + "--git-revision", + "${got_revision}" ], "isolate_name": "telemetry_gpu_integration_test", "merge": { @@ -8010,11 +8010,11 @@ }, "name": "maps_pixel_test", "precommit_args": [ - "--review-patch-issue", + "--gerrit-issue", "${patch_issue}", - "--review-patch-set", + "--gerrit-patchset", "${patch_set}", - "--buildbucket-build-id", + "--buildbucket-id", "${buildbucket_build_id}" ], "should_retry_with_patch": false, @@ -8042,10 +8042,10 @@ "-v", "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc", "--dont-restore-color-profile-after-test", - "--build-revision", - "${got_revision}", "--test-machine-name", - "${buildername}" + "${buildername}", + "--git-revision", + "${got_revision}" ], "isolate_name": "telemetry_gpu_integration_test", "merge": { @@ -8054,11 +8054,11 @@ }, "name": "pixel_skia_gold_test", "precommit_args": [ - "--review-patch-issue", + "--gerrit-issue", "${patch_issue}", - "--review-patch-set", + "--gerrit-patchset", "${patch_set}", - "--buildbucket-build-id", + "--buildbucket-id", "${buildbucket_build_id}" ], "should_retry_with_patch": false, @@ -8585,10 +8585,10 @@ "-v", "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc", "--dont-restore-color-profile-after-test", - "--build-revision", - "${got_revision}", "--test-machine-name", - "${buildername}" + "${buildername}", + "--git-revision", + "${got_revision}" ], "isolate_name": "telemetry_gpu_integration_test", "merge": { @@ -8597,11 +8597,11 @@ }, "name": "maps_pixel_test", "precommit_args": [ - "--review-patch-issue", + "--gerrit-issue", "${patch_issue}", - "--review-patch-set", + "--gerrit-patchset", "${patch_set}", - "--buildbucket-build-id", + "--buildbucket-id", "${buildbucket_build_id}" ], "should_retry_with_patch": false, @@ -8630,10 +8630,10 @@ "-v", "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc", "--dont-restore-color-profile-after-test", - "--build-revision", - "${got_revision}", "--test-machine-name", - "${buildername}" + "${buildername}", + "--git-revision", + "${got_revision}" ], "isolate_name": "telemetry_gpu_integration_test", "merge": { @@ -8642,11 +8642,11 @@ }, "name": "pixel_skia_gold_test", "precommit_args": [ - "--review-patch-issue", + "--gerrit-issue", "${patch_issue}", - "--review-patch-set", + "--gerrit-patchset", "${patch_set}", - "--buildbucket-build-id", + "--buildbucket-id", "${buildbucket_build_id}" ], "should_retry_with_patch": false, @@ -9195,10 +9195,10 @@ "-v", "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc", "--dont-restore-color-profile-after-test", - "--build-revision", - "${got_revision}", "--test-machine-name", - "${buildername}" + "${buildername}", + "--git-revision", + "${got_revision}" ], "isolate_name": "telemetry_gpu_integration_test", "merge": { @@ -9207,11 +9207,11 @@ }, "name": "maps_pixel_test", "precommit_args": [ - "--review-patch-issue", + "--gerrit-issue", "${patch_issue}", - "--review-patch-set", + "--gerrit-patchset", "${patch_set}", - "--buildbucket-build-id", + "--buildbucket-id", "${buildbucket_build_id}" ], "should_retry_with_patch": false, @@ -9240,10 +9240,10 @@ "-v", "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc", "--dont-restore-color-profile-after-test", - "--build-revision", - "${got_revision}", "--test-machine-name", - "${buildername}" + "${buildername}", + "--git-revision", + "${got_revision}" ], "isolate_name": "telemetry_gpu_integration_test", "merge": { @@ -9252,11 +9252,11 @@ }, "name": "pixel_skia_gold_test", "precommit_args": [ - "--review-patch-issue", + "--gerrit-issue", "${patch_issue}", - "--review-patch-set", + "--gerrit-patchset", "${patch_set}", - "--buildbucket-build-id", + "--buildbucket-id", "${buildbucket_build_id}" ], "should_retry_with_patch": false, @@ -9758,10 +9758,10 @@ "-v", "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc", "--dont-restore-color-profile-after-test", - "--build-revision", - "${got_revision}", "--test-machine-name", - "${buildername}" + "${buildername}", + "--git-revision", + "${got_revision}" ], "isolate_name": "telemetry_gpu_integration_test", "merge": { @@ -9770,11 +9770,11 @@ }, "name": "maps_pixel_test", "precommit_args": [ - "--review-patch-issue", + "--gerrit-issue", "${patch_issue}", - "--review-patch-set", + "--gerrit-patchset", "${patch_set}", - "--buildbucket-build-id", + "--buildbucket-id", "${buildbucket_build_id}" ], "should_retry_with_patch": false, @@ -9803,10 +9803,10 @@ "-v", "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc", "--dont-restore-color-profile-after-test", - "--build-revision", - "${got_revision}", "--test-machine-name", - "${buildername}" + "${buildername}", + "--git-revision", + "${got_revision}" ], "isolate_name": "telemetry_gpu_integration_test", "merge": { @@ -9815,11 +9815,11 @@ }, "name": "pixel_skia_gold_test", "precommit_args": [ - "--review-patch-issue", + "--gerrit-issue", "${patch_issue}", - "--review-patch-set", + "--gerrit-patchset", "${patch_set}", - "--buildbucket-build-id", + "--buildbucket-id", "${buildbucket_build_id}" ], "should_retry_with_patch": false, @@ -9951,10 +9951,10 @@ "-v", "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc", "--dont-restore-color-profile-after-test", - "--build-revision", - "${got_revision}", "--test-machine-name", - "${buildername}" + "${buildername}", + "--git-revision", + "${got_revision}" ], "isolate_name": "telemetry_gpu_integration_test", "merge": { @@ -9963,11 +9963,11 @@ }, "name": "pixel_skia_gold_test", "precommit_args": [ - "--review-patch-issue", + "--gerrit-issue", "${patch_issue}", - "--review-patch-set", + "--gerrit-patchset", "${patch_set}", - "--buildbucket-build-id", + "--buildbucket-id", "${buildbucket_build_id}" ], "should_retry_with_patch": false, @@ -10103,10 +10103,10 @@ "-v", "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc --enable-features=UseSkiaRenderer --use-gl=egl --enable-gpu-rasterization --force-gpu-rasterization --enable-oop-rasterization --disable-software-compositing-fallback --disable-headless-mode", "--dont-restore-color-profile-after-test", - "--build-revision", - "${got_revision}", "--test-machine-name", - "${buildername}" + "${buildername}", + "--git-revision", + "${got_revision}" ], "isolate_name": "telemetry_gpu_integration_test", "merge": { @@ -10115,11 +10115,11 @@ }, "name": "egl_pixel_skia_gold_test", "precommit_args": [ - "--review-patch-issue", + "--gerrit-issue", "${patch_issue}", - "--review-patch-set", + "--gerrit-patchset", "${patch_set}", - "--buildbucket-build-id", + "--buildbucket-id", "${buildbucket_build_id}" ], "should_retry_with_patch": false, @@ -10202,10 +10202,10 @@ "-v", "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc --use-vulkan=native --disable-vulkan-fallback-to-gl-for-testing --enable-features=UseSkiaRenderer,Vulkan --use-cmd-decoder=validating", "--dont-restore-color-profile-after-test", - "--build-revision", - "${got_revision}", "--test-machine-name", - "${buildername}" + "${buildername}", + "--git-revision", + "${got_revision}" ], "isolate_name": "telemetry_gpu_integration_test", "merge": { @@ -10214,11 +10214,11 @@ }, "name": "vulkan_pixel_skia_gold_test", "precommit_args": [ - "--review-patch-issue", + "--gerrit-issue", "${patch_issue}", - "--review-patch-set", + "--gerrit-patchset", "${patch_set}", - "--buildbucket-build-id", + "--buildbucket-id", "${buildbucket_build_id}" ], "should_retry_with_patch": false, @@ -10558,10 +10558,10 @@ "-v", "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc", "--dont-restore-color-profile-after-test", - "--build-revision", - "${got_revision}", "--test-machine-name", - "${buildername}" + "${buildername}", + "--git-revision", + "${got_revision}" ], "isolate_name": "telemetry_gpu_integration_test", "merge": { @@ -10570,11 +10570,11 @@ }, "name": "maps_pixel_test", "precommit_args": [ - "--review-patch-issue", + "--gerrit-issue", "${patch_issue}", - "--review-patch-set", + "--gerrit-patchset", "${patch_set}", - "--buildbucket-build-id", + "--buildbucket-id", "${buildbucket_build_id}" ], "should_retry_with_patch": false, @@ -10602,10 +10602,10 @@ "-v", "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc", "--dont-restore-color-profile-after-test", - "--build-revision", - "${got_revision}", "--test-machine-name", - "${buildername}" + "${buildername}", + "--git-revision", + "${got_revision}" ], "isolate_name": "telemetry_gpu_integration_test", "merge": { @@ -10614,11 +10614,11 @@ }, "name": "pixel_skia_gold_test", "precommit_args": [ - "--review-patch-issue", + "--gerrit-issue", "${patch_issue}", - "--review-patch-set", + "--gerrit-patchset", "${patch_set}", - "--buildbucket-build-id", + "--buildbucket-id", "${buildbucket_build_id}" ], "should_retry_with_patch": false, @@ -37763,10 +37763,10 @@ "-v", "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc", "--dont-restore-color-profile-after-test", - "--build-revision", - "${got_revision}", "--test-machine-name", - "${buildername}" + "${buildername}", + "--git-revision", + "${got_revision}" ], "isolate_name": "telemetry_gpu_integration_test", "merge": { @@ -37775,11 +37775,11 @@ }, "name": "maps_pixel_test", "precommit_args": [ - "--review-patch-issue", + "--gerrit-issue", "${patch_issue}", - "--review-patch-set", + "--gerrit-patchset", "${patch_set}", - "--buildbucket-build-id", + "--buildbucket-id", "${buildbucket_build_id}" ], "should_retry_with_patch": false, @@ -37806,10 +37806,10 @@ "-v", "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc", "--dont-restore-color-profile-after-test", - "--build-revision", - "${got_revision}", "--test-machine-name", - "${buildername}" + "${buildername}", + "--git-revision", + "${got_revision}" ], "isolate_name": "telemetry_gpu_integration_test", "merge": { @@ -37818,11 +37818,11 @@ }, "name": "pixel_skia_gold_test", "precommit_args": [ - "--review-patch-issue", + "--gerrit-issue", "${patch_issue}", - "--review-patch-set", + "--gerrit-patchset", "${patch_set}", - "--buildbucket-build-id", + "--buildbucket-id", "${buildbucket_build_id}" ], "should_retry_with_patch": false, @@ -38243,10 +38243,10 @@ "-v", "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc", "--dont-restore-color-profile-after-test", - "--build-revision", - "${got_revision}", "--test-machine-name", - "${buildername}" + "${buildername}", + "--git-revision", + "${got_revision}" ], "isolate_name": "telemetry_gpu_integration_test", "merge": { @@ -38255,11 +38255,11 @@ }, "name": "maps_pixel_test", "precommit_args": [ - "--review-patch-issue", + "--gerrit-issue", "${patch_issue}", - "--review-patch-set", + "--gerrit-patchset", "${patch_set}", - "--buildbucket-build-id", + "--buildbucket-id", "${buildbucket_build_id}" ], "should_retry_with_patch": false, @@ -38286,10 +38286,10 @@ "-v", "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc", "--dont-restore-color-profile-after-test", - "--build-revision", - "${got_revision}", "--test-machine-name", - "${buildername}" + "${buildername}", + "--git-revision", + "${got_revision}" ], "isolate_name": "telemetry_gpu_integration_test", "merge": { @@ -38298,11 +38298,11 @@ }, "name": "pixel_skia_gold_test", "precommit_args": [ - "--review-patch-issue", + "--gerrit-issue", "${patch_issue}", - "--review-patch-set", + "--gerrit-patchset", "${patch_set}", - "--buildbucket-build-id", + "--buildbucket-id", "${buildbucket_build_id}" ], "should_retry_with_patch": false, @@ -39018,10 +39018,10 @@ "-v", "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc", "--dont-restore-color-profile-after-test", - "--build-revision", - "${got_revision}", "--test-machine-name", - "${buildername}" + "${buildername}", + "--git-revision", + "${got_revision}" ], "isolate_name": "telemetry_gpu_integration_test", "merge": { @@ -39030,11 +39030,11 @@ }, "name": "maps_pixel_test", "precommit_args": [ - "--review-patch-issue", + "--gerrit-issue", "${patch_issue}", - "--review-patch-set", + "--gerrit-patchset", "${patch_set}", - "--buildbucket-build-id", + "--buildbucket-id", "${buildbucket_build_id}" ], "should_retry_with_patch": false, @@ -39062,10 +39062,10 @@ "-v", "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc", "--dont-restore-color-profile-after-test", - "--build-revision", - "${got_revision}", "--test-machine-name", - "${buildername}" + "${buildername}", + "--git-revision", + "${got_revision}" ], "isolate_name": "telemetry_gpu_integration_test", "merge": { @@ -39074,11 +39074,11 @@ }, "name": "pixel_skia_gold_test", "precommit_args": [ - "--review-patch-issue", + "--gerrit-issue", "${patch_issue}", - "--review-patch-set", + "--gerrit-patchset", "${patch_set}", - "--buildbucket-build-id", + "--buildbucket-id", "${buildbucket_build_id}" ], "should_retry_with_patch": false, @@ -39597,10 +39597,10 @@ "-v", "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc", "--dont-restore-color-profile-after-test", - "--build-revision", - "${got_revision}", "--test-machine-name", - "${buildername}" + "${buildername}", + "--git-revision", + "${got_revision}" ], "isolate_name": "telemetry_gpu_integration_test", "merge": { @@ -39609,11 +39609,11 @@ }, "name": "maps_pixel_test", "precommit_args": [ - "--review-patch-issue", + "--gerrit-issue", "${patch_issue}", - "--review-patch-set", + "--gerrit-patchset", "${patch_set}", - "--buildbucket-build-id", + "--buildbucket-id", "${buildbucket_build_id}" ], "should_retry_with_patch": false, @@ -39640,10 +39640,10 @@ "-v", "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc", "--dont-restore-color-profile-after-test", - "--build-revision", - "${got_revision}", "--test-machine-name", - "${buildername}" + "${buildername}", + "--git-revision", + "${got_revision}" ], "isolate_name": "telemetry_gpu_integration_test", "merge": { @@ -39652,11 +39652,11 @@ }, "name": "pixel_skia_gold_test", "precommit_args": [ - "--review-patch-issue", + "--gerrit-issue", "${patch_issue}", - "--review-patch-set", + "--gerrit-patchset", "${patch_set}", - "--buildbucket-build-id", + "--buildbucket-id", "${buildbucket_build_id}" ], "should_retry_with_patch": false, @@ -40214,10 +40214,10 @@ "-v", "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc", "--dont-restore-color-profile-after-test", - "--build-revision", - "${got_revision}", "--test-machine-name", - "${buildername}" + "${buildername}", + "--git-revision", + "${got_revision}" ], "isolate_name": "telemetry_gpu_integration_test", "merge": { @@ -40226,11 +40226,11 @@ }, "name": "maps_pixel_test", "precommit_args": [ - "--review-patch-issue", + "--gerrit-issue", "${patch_issue}", - "--review-patch-set", + "--gerrit-patchset", "${patch_set}", - "--buildbucket-build-id", + "--buildbucket-id", "${buildbucket_build_id}" ], "should_retry_with_patch": false, @@ -40258,10 +40258,10 @@ "-v", "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc", "--dont-restore-color-profile-after-test", - "--build-revision", - "${got_revision}", "--test-machine-name", - "${buildername}" + "${buildername}", + "--git-revision", + "${got_revision}" ], "isolate_name": "telemetry_gpu_integration_test", "merge": { @@ -40270,11 +40270,11 @@ }, "name": "pixel_skia_gold_test", "precommit_args": [ - "--review-patch-issue", + "--gerrit-issue", "${patch_issue}", - "--review-patch-set", + "--gerrit-patchset", "${patch_set}", - "--buildbucket-build-id", + "--buildbucket-id", "${buildbucket_build_id}" ], "should_retry_with_patch": false, @@ -40855,10 +40855,10 @@ "-v", "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc", "--dont-restore-color-profile-after-test", - "--build-revision", - "${got_revision}", "--test-machine-name", - "${buildername}" + "${buildername}", + "--git-revision", + "${got_revision}" ], "isolate_name": "telemetry_gpu_integration_test", "merge": { @@ -40867,11 +40867,11 @@ }, "name": "maps_pixel_test", "precommit_args": [ - "--review-patch-issue", + "--gerrit-issue", "${patch_issue}", - "--review-patch-set", + "--gerrit-patchset", "${patch_set}", - "--buildbucket-build-id", + "--buildbucket-id", "${buildbucket_build_id}" ], "should_retry_with_patch": false, @@ -40898,10 +40898,10 @@ "-v", "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc", "--dont-restore-color-profile-after-test", - "--build-revision", - "${got_revision}", "--test-machine-name", - "${buildername}" + "${buildername}", + "--git-revision", + "${got_revision}" ], "isolate_name": "telemetry_gpu_integration_test", "merge": { @@ -40910,11 +40910,11 @@ }, "name": "pixel_skia_gold_test", "precommit_args": [ - "--review-patch-issue", + "--gerrit-issue", "${patch_issue}", - "--review-patch-set", + "--gerrit-patchset", "${patch_set}", - "--buildbucket-build-id", + "--buildbucket-id", "${buildbucket_build_id}" ], "should_retry_with_patch": false, @@ -41372,10 +41372,10 @@ "-v", "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc --enable-features=UseSkiaRenderer", "--dont-restore-color-profile-after-test", - "--build-revision", - "${got_revision}", "--test-machine-name", - "${buildername}" + "${buildername}", + "--git-revision", + "${got_revision}" ], "isolate_name": "telemetry_gpu_integration_test", "merge": { @@ -41384,11 +41384,11 @@ }, "name": "maps_pixel_test", "precommit_args": [ - "--review-patch-issue", + "--gerrit-issue", "${patch_issue}", - "--review-patch-set", + "--gerrit-patchset", "${patch_set}", - "--buildbucket-build-id", + "--buildbucket-id", "${buildbucket_build_id}" ], "should_retry_with_patch": false, @@ -41487,10 +41487,10 @@ "-v", "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc --enable-features=UseSkiaRenderer", "--dont-restore-color-profile-after-test", - "--build-revision", - "${got_revision}", "--test-machine-name", - "${buildername}" + "${buildername}", + "--git-revision", + "${got_revision}" ], "isolate_name": "telemetry_gpu_integration_test", "merge": { @@ -41499,11 +41499,11 @@ }, "name": "skia_renderer_pixel_skia_gold_test", "precommit_args": [ - "--review-patch-issue", + "--gerrit-issue", "${patch_issue}", - "--review-patch-set", + "--gerrit-patchset", "${patch_set}", - "--buildbucket-build-id", + "--buildbucket-id", "${buildbucket_build_id}" ], "should_retry_with_patch": false, @@ -41574,10 +41574,10 @@ "-v", "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc --use-vulkan=native --disable-vulkan-fallback-to-gl-for-testing --enable-features=UseSkiaRenderer,Vulkan --use-cmd-decoder=validating", "--dont-restore-color-profile-after-test", - "--build-revision", - "${got_revision}", "--test-machine-name", - "${buildername}" + "${buildername}", + "--git-revision", + "${got_revision}" ], "isolate_name": "telemetry_gpu_integration_test", "merge": { @@ -41586,11 +41586,11 @@ }, "name": "vulkan_pixel_skia_gold_test", "precommit_args": [ - "--review-patch-issue", + "--gerrit-issue", "${patch_issue}", - "--review-patch-set", + "--gerrit-patchset", "${patch_set}", - "--buildbucket-build-id", + "--buildbucket-id", "${buildbucket_build_id}" ], "should_retry_with_patch": false, @@ -41807,10 +41807,10 @@ "-v", "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc --enable-features=UseSkiaRenderer", "--dont-restore-color-profile-after-test", - "--build-revision", - "${got_revision}", "--test-machine-name", - "${buildername}" + "${buildername}", + "--git-revision", + "${got_revision}" ], "isolate_name": "telemetry_gpu_integration_test", "merge": { @@ -41819,11 +41819,11 @@ }, "name": "maps_pixel_test", "precommit_args": [ - "--review-patch-issue", + "--gerrit-issue", "${patch_issue}", - "--review-patch-set", + "--gerrit-patchset", "${patch_set}", - "--buildbucket-build-id", + "--buildbucket-id", "${buildbucket_build_id}" ], "should_retry_with_patch": false, @@ -41922,10 +41922,10 @@ "-v", "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc --enable-features=UseSkiaRenderer", "--dont-restore-color-profile-after-test", - "--build-revision", - "${got_revision}", "--test-machine-name", - "${buildername}" + "${buildername}", + "--git-revision", + "${got_revision}" ], "isolate_name": "telemetry_gpu_integration_test", "merge": { @@ -41934,11 +41934,11 @@ }, "name": "skia_renderer_pixel_skia_gold_test", "precommit_args": [ - "--review-patch-issue", + "--gerrit-issue", "${patch_issue}", - "--review-patch-set", + "--gerrit-patchset", "${patch_set}", - "--buildbucket-build-id", + "--buildbucket-id", "${buildbucket_build_id}" ], "should_retry_with_patch": false, @@ -42009,10 +42009,10 @@ "-v", "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc --use-vulkan=native --disable-vulkan-fallback-to-gl-for-testing --enable-features=UseSkiaRenderer,Vulkan --use-cmd-decoder=validating", "--dont-restore-color-profile-after-test", - "--build-revision", - "${got_revision}", "--test-machine-name", - "${buildername}" + "${buildername}", + "--git-revision", + "${got_revision}" ], "isolate_name": "telemetry_gpu_integration_test", "merge": { @@ -42021,11 +42021,11 @@ }, "name": "vulkan_pixel_skia_gold_test", "precommit_args": [ - "--review-patch-issue", + "--gerrit-issue", "${patch_issue}", - "--review-patch-set", + "--gerrit-patchset", "${patch_set}", - "--buildbucket-build-id", + "--buildbucket-id", "${buildbucket_build_id}" ], "should_retry_with_patch": false, @@ -44172,7 +44172,7 @@ "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" }, - "name": "headless_content_unittests", + "name": "content_unittests_headless", "swarming": { "can_use_on_swarming_builders": true, "dimension_sets": [ @@ -44190,11 +44190,11 @@ "--no-xvfb", "--ozone-platform=headless" ], - "experiment_percentage": 100, "merge": { "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" }, + "name": "events_unittests_headless", "swarming": { "can_use_on_swarming_builders": true, "dimension_sets": [ @@ -44216,6 +44216,7 @@ "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" }, + "name": "ozone_unittests_headless", "swarming": { "can_use_on_swarming_builders": true, "dimension_sets": [ @@ -44237,6 +44238,7 @@ "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" }, + "name": "services_unittests_headless", "swarming": { "can_use_on_swarming_builders": true, "dimension_sets": [ @@ -44263,6 +44265,7 @@ "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" }, + "name": "accessibility_unittests_wayland", "swarming": { "can_use_on_swarming_builders": true, "dimension_sets": [ @@ -44285,6 +44288,7 @@ "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" }, + "name": "aura_unittests_wayland", "swarming": { "can_use_on_swarming_builders": true, "dimension_sets": [ @@ -44307,6 +44311,7 @@ "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" }, + "name": "content_unittests_wayland", "swarming": { "can_use_on_swarming_builders": true, "dimension_sets": [ @@ -44329,6 +44334,7 @@ "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" }, + "name": "events_unittests_wayland", "swarming": { "can_use_on_swarming_builders": true, "dimension_sets": [ @@ -44351,6 +44357,7 @@ "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" }, + "name": "gpu_unittests_wayland", "swarming": { "can_use_on_swarming_builders": true, "dimension_sets": [ @@ -44373,6 +44380,7 @@ "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" }, + "name": "ui_touch_selection_unittests_wayland", "swarming": { "can_use_on_swarming_builders": true, "dimension_sets": [ @@ -44387,16 +44395,16 @@ }, { "args": [ - "--test-launcher-filter-file=../../testing/buildbot/filters/ozone-linux.wayland_views_unittests.filter", "--no-xvfb", "--use-weston", - "--ozone-platform=wayland" + "--ozone-platform=wayland", + "--test-launcher-filter-file=../../testing/buildbot/filters/ozone-linux.wayland_views_unittests.filter" ], "merge": { "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" }, - "name": "wayland_views_unittests", + "name": "views_unittests_wayland", "swarming": { "can_use_on_swarming_builders": true, "dimension_sets": [ @@ -44421,6 +44429,7 @@ "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" }, + "name": "accessibility_unittests_x11", "swarming": { "can_use_on_swarming_builders": true, "dimension_sets": [ @@ -44441,6 +44450,7 @@ "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" }, + "name": "aura_unittests_x11", "swarming": { "can_use_on_swarming_builders": true, "dimension_sets": [ @@ -44461,6 +44471,7 @@ "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" }, + "name": "content_unittests_x11", "swarming": { "can_use_on_swarming_builders": true, "dimension_sets": [ @@ -44481,6 +44492,7 @@ "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" }, + "name": "events_unittests_x11", "swarming": { "can_use_on_swarming_builders": true, "dimension_sets": [ @@ -44501,6 +44513,7 @@ "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" }, + "name": "gpu_unittests_x11", "swarming": { "can_use_on_swarming_builders": true, "dimension_sets": [ @@ -44521,6 +44534,7 @@ "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" }, + "name": "ozone_x11_unittests_x11", "swarming": { "can_use_on_swarming_builders": true, "dimension_sets": [ @@ -44541,6 +44555,7 @@ "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" }, + "name": "ui_touch_selection_unittests_x11", "swarming": { "can_use_on_swarming_builders": true, "dimension_sets": [ @@ -44555,13 +44570,14 @@ }, { "args": [ - "--test-launcher-filter-file=../../testing/buildbot/filters/ozone-linux.x11_views_unittests.filter", - "--ozone-platform=x11" + "--ozone-platform=x11", + "--test-launcher-filter-file=../../testing/buildbot/filters/ozone-linux.x11_views_unittests.filter" ], "merge": { "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" }, + "name": "views_unittests_x11", "swarming": { "can_use_on_swarming_builders": true, "dimension_sets": [ @@ -44847,10 +44863,10 @@ "-v", "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc", "--dont-restore-color-profile-after-test", - "--build-revision", - "${got_revision}", "--test-machine-name", - "${buildername}" + "${buildername}", + "--git-revision", + "${got_revision}" ], "isolate_name": "telemetry_gpu_integration_test", "merge": { @@ -44859,11 +44875,11 @@ }, "name": "maps_pixel_test", "precommit_args": [ - "--review-patch-issue", + "--gerrit-issue", "${patch_issue}", - "--review-patch-set", + "--gerrit-patchset", "${patch_set}", - "--buildbucket-build-id", + "--buildbucket-id", "${buildbucket_build_id}" ], "should_retry_with_patch": false, @@ -44890,10 +44906,10 @@ "-v", "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc", "--dont-restore-color-profile-after-test", - "--build-revision", - "${got_revision}", "--test-machine-name", - "${buildername}" + "${buildername}", + "--git-revision", + "${got_revision}" ], "isolate_name": "telemetry_gpu_integration_test", "merge": { @@ -44902,11 +44918,11 @@ }, "name": "pixel_skia_gold_test", "precommit_args": [ - "--review-patch-issue", + "--gerrit-issue", "${patch_issue}", - "--review-patch-set", + "--gerrit-patchset", "${patch_set}", - "--buildbucket-build-id", + "--buildbucket-id", "${buildbucket_build_id}" ], "should_retry_with_patch": false, @@ -58694,10 +58710,10 @@ "-v", "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc", "--dont-restore-color-profile-after-test", - "--build-revision", - "${got_revision}", "--test-machine-name", - "${buildername}" + "${buildername}", + "--git-revision", + "${got_revision}" ], "isolate_name": "telemetry_gpu_integration_test", "merge": { @@ -58706,11 +58722,11 @@ }, "name": "maps_pixel_test", "precommit_args": [ - "--review-patch-issue", + "--gerrit-issue", "${patch_issue}", - "--review-patch-set", + "--gerrit-patchset", "${patch_set}", - "--buildbucket-build-id", + "--buildbucket-id", "${buildbucket_build_id}" ], "should_retry_with_patch": false, @@ -58736,10 +58752,10 @@ "-v", "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc", "--dont-restore-color-profile-after-test", - "--build-revision", - "${got_revision}", "--test-machine-name", - "${buildername}" + "${buildername}", + "--git-revision", + "${got_revision}" ], "isolate_name": "telemetry_gpu_integration_test", "merge": { @@ -58748,11 +58764,11 @@ }, "name": "pixel_skia_gold_test", "precommit_args": [ - "--review-patch-issue", + "--gerrit-issue", "${patch_issue}", - "--review-patch-set", + "--gerrit-patchset", "${patch_set}", - "--buildbucket-build-id", + "--buildbucket-id", "${buildbucket_build_id}" ], "should_retry_with_patch": false, @@ -59200,10 +59216,10 @@ "-v", "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc", "--dont-restore-color-profile-after-test", - "--build-revision", - "${got_revision}", "--test-machine-name", - "${buildername}" + "${buildername}", + "--git-revision", + "${got_revision}" ], "isolate_name": "telemetry_gpu_integration_test", "merge": { @@ -59212,11 +59228,11 @@ }, "name": "maps_pixel_test", "precommit_args": [ - "--review-patch-issue", + "--gerrit-issue", "${patch_issue}", - "--review-patch-set", + "--gerrit-patchset", "${patch_set}", - "--buildbucket-build-id", + "--buildbucket-id", "${buildbucket_build_id}" ], "should_retry_with_patch": false, @@ -59242,10 +59258,10 @@ "-v", "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc", "--dont-restore-color-profile-after-test", - "--build-revision", - "${got_revision}", "--test-machine-name", - "${buildername}" + "${buildername}", + "--git-revision", + "${got_revision}" ], "isolate_name": "telemetry_gpu_integration_test", "merge": { @@ -59254,11 +59270,11 @@ }, "name": "pixel_skia_gold_test", "precommit_args": [ - "--review-patch-issue", + "--gerrit-issue", "${patch_issue}", - "--review-patch-set", + "--gerrit-patchset", "${patch_set}", - "--buildbucket-build-id", + "--buildbucket-id", "${buildbucket_build_id}" ], "should_retry_with_patch": false, @@ -59884,10 +59900,10 @@ "-v", "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc", "--dont-restore-color-profile-after-test", - "--build-revision", - "${got_revision}", "--test-machine-name", - "${buildername}" + "${buildername}", + "--git-revision", + "${got_revision}" ], "isolate_name": "telemetry_gpu_integration_test", "merge": { @@ -59896,11 +59912,11 @@ }, "name": "maps_pixel_test", "precommit_args": [ - "--review-patch-issue", + "--gerrit-issue", "${patch_issue}", - "--review-patch-set", + "--gerrit-patchset", "${patch_set}", - "--buildbucket-build-id", + "--buildbucket-id", "${buildbucket_build_id}" ], "should_retry_with_patch": false, @@ -59932,10 +59948,10 @@ "-v", "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc", "--dont-restore-color-profile-after-test", - "--build-revision", - "${got_revision}", "--test-machine-name", - "${buildername}" + "${buildername}", + "--git-revision", + "${got_revision}" ], "isolate_name": "telemetry_gpu_integration_test", "merge": { @@ -59944,11 +59960,11 @@ }, "name": "pixel_skia_gold_test", "precommit_args": [ - "--review-patch-issue", + "--gerrit-issue", "${patch_issue}", - "--review-patch-set", + "--gerrit-patchset", "${patch_set}", - "--buildbucket-build-id", + "--buildbucket-id", "${buildbucket_build_id}" ], "should_retry_with_patch": false, @@ -60560,10 +60576,10 @@ "-v", "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc", "--dont-restore-color-profile-after-test", - "--build-revision", - "${got_revision}", "--test-machine-name", - "${buildername}" + "${buildername}", + "--git-revision", + "${got_revision}" ], "isolate_name": "telemetry_gpu_integration_test", "merge": { @@ -60572,11 +60588,11 @@ }, "name": "maps_pixel_test", "precommit_args": [ - "--review-patch-issue", + "--gerrit-issue", "${patch_issue}", - "--review-patch-set", + "--gerrit-patchset", "${patch_set}", - "--buildbucket-build-id", + "--buildbucket-id", "${buildbucket_build_id}" ], "should_retry_with_patch": false, @@ -60602,10 +60618,10 @@ "-v", "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc", "--dont-restore-color-profile-after-test", - "--build-revision", - "${got_revision}", "--test-machine-name", - "${buildername}" + "${buildername}", + "--git-revision", + "${got_revision}" ], "isolate_name": "telemetry_gpu_integration_test", "merge": { @@ -60614,11 +60630,11 @@ }, "name": "pixel_skia_gold_test", "precommit_args": [ - "--review-patch-issue", + "--gerrit-issue", "${patch_issue}", - "--review-patch-set", + "--gerrit-patchset", "${patch_set}", - "--buildbucket-build-id", + "--buildbucket-id", "${buildbucket_build_id}" ], "should_retry_with_patch": false, @@ -61210,10 +61226,10 @@ "-v", "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc", "--dont-restore-color-profile-after-test", - "--build-revision", - "${got_revision}", "--test-machine-name", - "${buildername}" + "${buildername}", + "--git-revision", + "${got_revision}" ], "isolate_name": "telemetry_gpu_integration_test", "merge": { @@ -61222,11 +61238,11 @@ }, "name": "maps_pixel_test", "precommit_args": [ - "--review-patch-issue", + "--gerrit-issue", "${patch_issue}", - "--review-patch-set", + "--gerrit-patchset", "${patch_set}", - "--buildbucket-build-id", + "--buildbucket-id", "${buildbucket_build_id}" ], "should_retry_with_patch": false, @@ -61254,10 +61270,10 @@ "-v", "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc", "--dont-restore-color-profile-after-test", - "--build-revision", - "${got_revision}", "--test-machine-name", - "${buildername}" + "${buildername}", + "--git-revision", + "${got_revision}" ], "isolate_name": "telemetry_gpu_integration_test", "merge": { @@ -61266,11 +61282,11 @@ }, "name": "pixel_skia_gold_test", "precommit_args": [ - "--review-patch-issue", + "--gerrit-issue", "${patch_issue}", - "--review-patch-set", + "--gerrit-patchset", "${patch_set}", - "--buildbucket-build-id", + "--buildbucket-id", "${buildbucket_build_id}" ], "should_retry_with_patch": false, @@ -61752,10 +61768,10 @@ "-v", "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc", "--dont-restore-color-profile-after-test", - "--build-revision", - "${got_revision}", "--test-machine-name", - "${buildername}" + "${buildername}", + "--git-revision", + "${got_revision}" ], "isolate_name": "telemetry_gpu_integration_test", "merge": { @@ -61764,11 +61780,11 @@ }, "name": "maps_pixel_test", "precommit_args": [ - "--review-patch-issue", + "--gerrit-issue", "${patch_issue}", - "--review-patch-set", + "--gerrit-patchset", "${patch_set}", - "--buildbucket-build-id", + "--buildbucket-id", "${buildbucket_build_id}" ], "should_retry_with_patch": false, @@ -61796,10 +61812,10 @@ "-v", "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc", "--dont-restore-color-profile-after-test", - "--build-revision", - "${got_revision}", "--test-machine-name", - "${buildername}" + "${buildername}", + "--git-revision", + "${got_revision}" ], "isolate_name": "telemetry_gpu_integration_test", "merge": { @@ -61808,11 +61824,11 @@ }, "name": "pixel_skia_gold_test", "precommit_args": [ - "--review-patch-issue", + "--gerrit-issue", "${patch_issue}", - "--review-patch-set", + "--gerrit-patchset", "${patch_set}", - "--buildbucket-build-id", + "--buildbucket-id", "${buildbucket_build_id}" ], "should_retry_with_patch": false, @@ -62289,10 +62305,10 @@ "-v", "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc", "--dont-restore-color-profile-after-test", - "--build-revision", - "${got_revision}", "--test-machine-name", - "${buildername}" + "${buildername}", + "--git-revision", + "${got_revision}" ], "isolate_name": "telemetry_gpu_integration_test", "merge": { @@ -62301,11 +62317,11 @@ }, "name": "maps_pixel_test", "precommit_args": [ - "--review-patch-issue", + "--gerrit-issue", "${patch_issue}", - "--review-patch-set", + "--gerrit-patchset", "${patch_set}", - "--buildbucket-build-id", + "--buildbucket-id", "${buildbucket_build_id}" ], "should_retry_with_patch": false, @@ -62333,10 +62349,10 @@ "-v", "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc", "--dont-restore-color-profile-after-test", - "--build-revision", - "${got_revision}", "--test-machine-name", - "${buildername}" + "${buildername}", + "--git-revision", + "${got_revision}" ], "isolate_name": "telemetry_gpu_integration_test", "merge": { @@ -62345,11 +62361,11 @@ }, "name": "pixel_skia_gold_test", "precommit_args": [ - "--review-patch-issue", + "--gerrit-issue", "${patch_issue}", - "--review-patch-set", + "--gerrit-patchset", "${patch_set}", - "--buildbucket-build-id", + "--buildbucket-id", "${buildbucket_build_id}" ], "should_retry_with_patch": false, @@ -62985,10 +63001,10 @@ "-v", "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc", "--dont-restore-color-profile-after-test", - "--build-revision", - "${got_revision}", "--test-machine-name", - "${buildername}" + "${buildername}", + "--git-revision", + "${got_revision}" ], "isolate_name": "telemetry_gpu_integration_test", "merge": { @@ -62997,11 +63013,11 @@ }, "name": "maps_pixel_test", "precommit_args": [ - "--review-patch-issue", + "--gerrit-issue", "${patch_issue}", - "--review-patch-set", + "--gerrit-patchset", "${patch_set}", - "--buildbucket-build-id", + "--buildbucket-id", "${buildbucket_build_id}" ], "should_retry_with_patch": false, @@ -63029,10 +63045,10 @@ "-v", "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc", "--dont-restore-color-profile-after-test", - "--build-revision", - "${got_revision}", "--test-machine-name", - "${buildername}" + "${buildername}", + "--git-revision", + "${got_revision}" ], "isolate_name": "telemetry_gpu_integration_test", "merge": { @@ -63041,11 +63057,11 @@ }, "name": "pixel_skia_gold_test", "precommit_args": [ - "--review-patch-issue", + "--gerrit-issue", "${patch_issue}", - "--review-patch-set", + "--gerrit-patchset", "${patch_set}", - "--buildbucket-build-id", + "--buildbucket-id", "${buildbucket_build_id}" ], "should_retry_with_patch": false, @@ -63745,10 +63761,10 @@ "-v", "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc", "--dont-restore-color-profile-after-test", - "--build-revision", - "${got_revision}", "--test-machine-name", - "${buildername}" + "${buildername}", + "--git-revision", + "${got_revision}" ], "isolate_name": "telemetry_gpu_integration_test", "merge": { @@ -63757,11 +63773,11 @@ }, "name": "maps_pixel_test", "precommit_args": [ - "--review-patch-issue", + "--gerrit-issue", "${patch_issue}", - "--review-patch-set", + "--gerrit-patchset", "${patch_set}", - "--buildbucket-build-id", + "--buildbucket-id", "${buildbucket_build_id}" ], "should_retry_with_patch": false, @@ -63789,10 +63805,10 @@ "-v", "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc", "--dont-restore-color-profile-after-test", - "--build-revision", - "${got_revision}", "--test-machine-name", - "${buildername}" + "${buildername}", + "--git-revision", + "${got_revision}" ], "isolate_name": "telemetry_gpu_integration_test", "merge": { @@ -63801,11 +63817,11 @@ }, "name": "pixel_skia_gold_test", "precommit_args": [ - "--review-patch-issue", + "--gerrit-issue", "${patch_issue}", - "--review-patch-set", + "--gerrit-patchset", "${patch_set}", - "--buildbucket-build-id", + "--buildbucket-id", "${buildbucket_build_id}" ], "should_retry_with_patch": false, @@ -64244,10 +64260,10 @@ "-v", "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc", "--dont-restore-color-profile-after-test", - "--build-revision", - "${got_revision}", "--test-machine-name", - "${buildername}" + "${buildername}", + "--git-revision", + "${got_revision}" ], "isolate_name": "telemetry_gpu_integration_test", "merge": { @@ -64256,11 +64272,11 @@ }, "name": "maps_pixel_test", "precommit_args": [ - "--review-patch-issue", + "--gerrit-issue", "${patch_issue}", - "--review-patch-set", + "--gerrit-patchset", "${patch_set}", - "--buildbucket-build-id", + "--buildbucket-id", "${buildbucket_build_id}" ], "should_retry_with_patch": false, @@ -64286,10 +64302,10 @@ "-v", "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc", "--dont-restore-color-profile-after-test", - "--build-revision", - "${got_revision}", "--test-machine-name", - "${buildername}" + "${buildername}", + "--git-revision", + "${got_revision}" ], "isolate_name": "telemetry_gpu_integration_test", "merge": { @@ -64298,11 +64314,11 @@ }, "name": "pixel_skia_gold_test", "precommit_args": [ - "--review-patch-issue", + "--gerrit-issue", "${patch_issue}", - "--review-patch-set", + "--gerrit-patchset", "${patch_set}", - "--buildbucket-build-id", + "--buildbucket-id", "${buildbucket_build_id}" ], "should_retry_with_patch": false, @@ -64700,10 +64716,10 @@ "-v", "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc", "--dont-restore-color-profile-after-test", - "--build-revision", - "${got_revision}", "--test-machine-name", - "${buildername}" + "${buildername}", + "--git-revision", + "${got_revision}" ], "isolate_coverage_data": true, "isolate_name": "telemetry_gpu_integration_test", @@ -64713,11 +64729,11 @@ }, "name": "maps_pixel_test", "precommit_args": [ - "--review-patch-issue", + "--gerrit-issue", "${patch_issue}", - "--review-patch-set", + "--gerrit-patchset", "${patch_set}", - "--buildbucket-build-id", + "--buildbucket-id", "${buildbucket_build_id}" ], "should_retry_with_patch": false, @@ -64743,10 +64759,10 @@ "-v", "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc", "--dont-restore-color-profile-after-test", - "--build-revision", - "${got_revision}", "--test-machine-name", - "${buildername}" + "${buildername}", + "--git-revision", + "${got_revision}" ], "isolate_coverage_data": true, "isolate_name": "telemetry_gpu_integration_test", @@ -64756,11 +64772,11 @@ }, "name": "pixel_skia_gold_test", "precommit_args": [ - "--review-patch-issue", + "--gerrit-issue", "${patch_issue}", - "--review-patch-set", + "--gerrit-patchset", "${patch_set}", - "--buildbucket-build-id", + "--buildbucket-id", "${buildbucket_build_id}" ], "should_retry_with_patch": false, @@ -65143,10 +65159,10 @@ "-v", "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc", "--dont-restore-color-profile-after-test", - "--build-revision", - "${got_revision}", "--test-machine-name", - "${buildername}" + "${buildername}", + "--git-revision", + "${got_revision}" ], "isolate_name": "telemetry_gpu_integration_test", "merge": { @@ -65155,11 +65171,11 @@ }, "name": "maps_pixel_test", "precommit_args": [ - "--review-patch-issue", + "--gerrit-issue", "${patch_issue}", - "--review-patch-set", + "--gerrit-patchset", "${patch_set}", - "--buildbucket-build-id", + "--buildbucket-id", "${buildbucket_build_id}" ], "should_retry_with_patch": false, @@ -65187,10 +65203,10 @@ "-v", "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc", "--dont-restore-color-profile-after-test", - "--build-revision", - "${got_revision}", "--test-machine-name", - "${buildername}" + "${buildername}", + "--git-revision", + "${got_revision}" ], "isolate_name": "telemetry_gpu_integration_test", "merge": { @@ -65199,11 +65215,11 @@ }, "name": "pixel_skia_gold_test", "precommit_args": [ - "--review-patch-issue", + "--gerrit-issue", "${patch_issue}", - "--review-patch-set", + "--gerrit-patchset", "${patch_set}", - "--buildbucket-build-id", + "--buildbucket-id", "${buildbucket_build_id}" ], "should_retry_with_patch": false, @@ -65594,10 +65610,10 @@ "-v", "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc", "--dont-restore-color-profile-after-test", - "--build-revision", - "${got_revision}", "--test-machine-name", - "${buildername}" + "${buildername}", + "--git-revision", + "${got_revision}" ], "isolate_name": "telemetry_gpu_integration_test", "merge": { @@ -65606,11 +65622,11 @@ }, "name": "maps_pixel_test", "precommit_args": [ - "--review-patch-issue", + "--gerrit-issue", "${patch_issue}", - "--review-patch-set", + "--gerrit-patchset", "${patch_set}", - "--buildbucket-build-id", + "--buildbucket-id", "${buildbucket_build_id}" ], "should_retry_with_patch": false, @@ -65638,10 +65654,10 @@ "-v", "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc", "--dont-restore-color-profile-after-test", - "--build-revision", - "${got_revision}", "--test-machine-name", - "${buildername}" + "${buildername}", + "--git-revision", + "${got_revision}" ], "isolate_name": "telemetry_gpu_integration_test", "merge": { @@ -65650,11 +65666,11 @@ }, "name": "pixel_skia_gold_test", "precommit_args": [ - "--review-patch-issue", + "--gerrit-issue", "${patch_issue}", - "--review-patch-set", + "--gerrit-patchset", "${patch_set}", - "--buildbucket-build-id", + "--buildbucket-id", "${buildbucket_build_id}" ], "should_retry_with_patch": false, @@ -66080,10 +66096,10 @@ "-v", "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc", "--dont-restore-color-profile-after-test", - "--build-revision", - "${got_revision}", "--test-machine-name", - "${buildername}" + "${buildername}", + "--git-revision", + "${got_revision}" ], "isolate_coverage_data": true, "isolate_name": "telemetry_gpu_integration_test", @@ -66093,11 +66109,11 @@ }, "name": "maps_pixel_test", "precommit_args": [ - "--review-patch-issue", + "--gerrit-issue", "${patch_issue}", - "--review-patch-set", + "--gerrit-patchset", "${patch_set}", - "--buildbucket-build-id", + "--buildbucket-id", "${buildbucket_build_id}" ], "should_retry_with_patch": false, @@ -66125,10 +66141,10 @@ "-v", "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc", "--dont-restore-color-profile-after-test", - "--build-revision", - "${got_revision}", "--test-machine-name", - "${buildername}" + "${buildername}", + "--git-revision", + "${got_revision}" ], "isolate_coverage_data": true, "isolate_name": "telemetry_gpu_integration_test", @@ -66138,11 +66154,11 @@ }, "name": "pixel_skia_gold_test", "precommit_args": [ - "--review-patch-issue", + "--gerrit-issue", "${patch_issue}", - "--review-patch-set", + "--gerrit-patchset", "${patch_set}", - "--buildbucket-build-id", + "--buildbucket-id", "${buildbucket_build_id}" ], "should_retry_with_patch": false, @@ -87279,10 +87295,10 @@ "--shared-prefs-file=//chrome/android/shared_preference_files/test/vr_ddview_skipdon_setupcomplete.json", "--replace-system-package=com.google.vr.vrcore,//third_party/gvr-android-sdk/test-apks/vr_services/vr_services_current.apk", "--additional-apk=//third_party/gvr-android-sdk/test-apks/vr_keyboard/vr_keyboard_current.apk", - "--git-revision", - "${got_revision}", "--gs-results-bucket=chromium-result-details", - "--recover-devices" + "--recover-devices", + "--git-revision", + "${got_revision}" ], "merge": { "args": [ @@ -90027,10 +90043,10 @@ "--shared-prefs-file=//chrome/android/shared_preference_files/test/vr_ddview_skipdon_setupcomplete.json", "--replace-system-package=com.google.vr.vrcore,//third_party/gvr-android-sdk/test-apks/vr_services/vr_services_current.apk", "--additional-apk=//third_party/gvr-android-sdk/test-apks/vr_keyboard/vr_keyboard_current.apk", - "--git-revision", - "${got_revision}", "--gs-results-bucket=chromium-result-details", - "--recover-devices" + "--recover-devices", + "--git-revision", + "${got_revision}" ], "merge": { "args": [ @@ -130992,10 +131008,10 @@ "-v", "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc", "--dont-restore-color-profile-after-test", - "--build-revision", - "${got_revision}", "--test-machine-name", - "${buildername}" + "${buildername}", + "--git-revision", + "${got_revision}" ], "isolate_name": "telemetry_gpu_integration_test", "merge": { @@ -131004,11 +131020,11 @@ }, "name": "maps_pixel_test", "precommit_args": [ - "--review-patch-issue", + "--gerrit-issue", "${patch_issue}", - "--review-patch-set", + "--gerrit-patchset", "${patch_set}", - "--buildbucket-build-id", + "--buildbucket-id", "${buildbucket_build_id}" ], "should_retry_with_patch": false, @@ -131035,10 +131051,10 @@ "-v", "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc", "--dont-restore-color-profile-after-test", - "--build-revision", - "${got_revision}", "--test-machine-name", - "${buildername}" + "${buildername}", + "--git-revision", + "${got_revision}" ], "isolate_name": "telemetry_gpu_integration_test", "merge": { @@ -131047,11 +131063,11 @@ }, "name": "pixel_skia_gold_test", "precommit_args": [ - "--review-patch-issue", + "--gerrit-issue", "${patch_issue}", - "--review-patch-set", + "--gerrit-patchset", "${patch_set}", - "--buildbucket-build-id", + "--buildbucket-id", "${buildbucket_build_id}" ], "should_retry_with_patch": false, @@ -131805,10 +131821,10 @@ "-v", "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc", "--dont-restore-color-profile-after-test", - "--build-revision", - "${got_revision}", "--test-machine-name", - "${buildername}" + "${buildername}", + "--git-revision", + "${got_revision}" ], "isolate_name": "telemetry_gpu_integration_test", "merge": { @@ -131817,11 +131833,11 @@ }, "name": "maps_pixel_test", "precommit_args": [ - "--review-patch-issue", + "--gerrit-issue", "${patch_issue}", - "--review-patch-set", + "--gerrit-patchset", "${patch_set}", - "--buildbucket-build-id", + "--buildbucket-id", "${buildbucket_build_id}" ], "should_retry_with_patch": false, @@ -131849,10 +131865,10 @@ "-v", "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc", "--dont-restore-color-profile-after-test", - "--build-revision", - "${got_revision}", "--test-machine-name", - "${buildername}" + "${buildername}", + "--git-revision", + "${got_revision}" ], "isolate_name": "telemetry_gpu_integration_test", "merge": { @@ -131861,11 +131877,11 @@ }, "name": "pixel_skia_gold_test", "precommit_args": [ - "--review-patch-issue", + "--gerrit-issue", "${patch_issue}", - "--review-patch-set", + "--gerrit-patchset", "${patch_set}", - "--buildbucket-build-id", + "--buildbucket-id", "${buildbucket_build_id}" ], "should_retry_with_patch": false, @@ -132680,10 +132696,10 @@ "-v", "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc", "--dont-restore-color-profile-after-test", - "--build-revision", - "${got_revision}", "--test-machine-name", - "${buildername}" + "${buildername}", + "--git-revision", + "${got_revision}" ], "isolate_name": "telemetry_gpu_integration_test", "merge": { @@ -132692,11 +132708,11 @@ }, "name": "maps_pixel_test", "precommit_args": [ - "--review-patch-issue", + "--gerrit-issue", "${patch_issue}", - "--review-patch-set", + "--gerrit-patchset", "${patch_set}", - "--buildbucket-build-id", + "--buildbucket-id", "${buildbucket_build_id}" ], "should_retry_with_patch": false, @@ -132724,10 +132740,10 @@ "-v", "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc", "--dont-restore-color-profile-after-test", - "--build-revision", - "${got_revision}", "--test-machine-name", - "${buildername}" + "${buildername}", + "--git-revision", + "${got_revision}" ], "isolate_name": "telemetry_gpu_integration_test", "merge": { @@ -132736,11 +132752,11 @@ }, "name": "pixel_skia_gold_test", "precommit_args": [ - "--review-patch-issue", + "--gerrit-issue", "${patch_issue}", - "--review-patch-set", + "--gerrit-patchset", "${patch_set}", - "--buildbucket-build-id", + "--buildbucket-id", "${buildbucket_build_id}" ], "should_retry_with_patch": false, @@ -133483,10 +133499,10 @@ "-v", "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc", "--dont-restore-color-profile-after-test", - "--build-revision", - "${got_revision}", "--test-machine-name", - "${buildername}" + "${buildername}", + "--git-revision", + "${got_revision}" ], "isolate_name": "telemetry_gpu_integration_test", "merge": { @@ -133495,11 +133511,11 @@ }, "name": "maps_pixel_test", "precommit_args": [ - "--review-patch-issue", + "--gerrit-issue", "${patch_issue}", - "--review-patch-set", + "--gerrit-patchset", "${patch_set}", - "--buildbucket-build-id", + "--buildbucket-id", "${buildbucket_build_id}" ], "should_retry_with_patch": false, @@ -133526,10 +133542,10 @@ "-v", "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc", "--dont-restore-color-profile-after-test", - "--build-revision", - "${got_revision}", "--test-machine-name", - "${buildername}" + "${buildername}", + "--git-revision", + "${got_revision}" ], "isolate_name": "telemetry_gpu_integration_test", "merge": { @@ -133538,11 +133554,11 @@ }, "name": "pixel_skia_gold_test", "precommit_args": [ - "--review-patch-issue", + "--gerrit-issue", "${patch_issue}", - "--review-patch-set", + "--gerrit-patchset", "${patch_set}", - "--buildbucket-build-id", + "--buildbucket-id", "${buildbucket_build_id}" ], "should_retry_with_patch": false, @@ -134418,10 +134434,10 @@ "-v", "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc", "--dont-restore-color-profile-after-test", - "--build-revision", - "${got_revision}", "--test-machine-name", - "${buildername}" + "${buildername}", + "--git-revision", + "${got_revision}" ], "isolate_name": "telemetry_gpu_integration_test", "merge": { @@ -134430,11 +134446,11 @@ }, "name": "maps_pixel_test", "precommit_args": [ - "--review-patch-issue", + "--gerrit-issue", "${patch_issue}", - "--review-patch-set", + "--gerrit-patchset", "${patch_set}", - "--buildbucket-build-id", + "--buildbucket-id", "${buildbucket_build_id}" ], "should_retry_with_patch": false, @@ -134462,10 +134478,10 @@ "-v", "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc", "--dont-restore-color-profile-after-test", - "--build-revision", - "${got_revision}", "--test-machine-name", - "${buildername}" + "${buildername}", + "--git-revision", + "${got_revision}" ], "isolate_name": "telemetry_gpu_integration_test", "merge": { @@ -134474,11 +134490,11 @@ }, "name": "pixel_skia_gold_test", "precommit_args": [ - "--review-patch-issue", + "--gerrit-issue", "${patch_issue}", - "--review-patch-set", + "--gerrit-patchset", "${patch_set}", - "--buildbucket-build-id", + "--buildbucket-id", "${buildbucket_build_id}" ], "should_retry_with_patch": false, @@ -135336,10 +135352,10 @@ "-v", "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc", "--dont-restore-color-profile-after-test", - "--build-revision", - "${got_revision}", "--test-machine-name", - "${buildername}" + "${buildername}", + "--git-revision", + "${got_revision}" ], "isolate_name": "telemetry_gpu_integration_test", "merge": { @@ -135348,11 +135364,11 @@ }, "name": "maps_pixel_test", "precommit_args": [ - "--review-patch-issue", + "--gerrit-issue", "${patch_issue}", - "--review-patch-set", + "--gerrit-patchset", "${patch_set}", - "--buildbucket-build-id", + "--buildbucket-id", "${buildbucket_build_id}" ], "should_retry_with_patch": false, @@ -135380,10 +135396,10 @@ "-v", "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc", "--dont-restore-color-profile-after-test", - "--build-revision", - "${got_revision}", "--test-machine-name", - "${buildername}" + "${buildername}", + "--git-revision", + "${got_revision}" ], "isolate_name": "telemetry_gpu_integration_test", "merge": { @@ -135392,11 +135408,11 @@ }, "name": "pixel_skia_gold_test", "precommit_args": [ - "--review-patch-issue", + "--gerrit-issue", "${patch_issue}", - "--review-patch-set", + "--gerrit-patchset", "${patch_set}", - "--buildbucket-build-id", + "--buildbucket-id", "${buildbucket_build_id}" ], "should_retry_with_patch": false, @@ -136385,10 +136401,10 @@ "-v", "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc", "--dont-restore-color-profile-after-test", - "--build-revision", - "${got_revision}", "--test-machine-name", - "${buildername}" + "${buildername}", + "--git-revision", + "${got_revision}" ], "isolate_name": "telemetry_gpu_integration_test", "merge": { @@ -136397,11 +136413,11 @@ }, "name": "maps_pixel_test", "precommit_args": [ - "--review-patch-issue", + "--gerrit-issue", "${patch_issue}", - "--review-patch-set", + "--gerrit-patchset", "${patch_set}", - "--buildbucket-build-id", + "--buildbucket-id", "${buildbucket_build_id}" ], "should_retry_with_patch": false, @@ -136477,10 +136493,10 @@ "-v", "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc", "--dont-restore-color-profile-after-test", - "--build-revision", - "${got_revision}", "--test-machine-name", - "${buildername}" + "${buildername}", + "--git-revision", + "${got_revision}" ], "isolate_name": "telemetry_gpu_integration_test", "merge": { @@ -136489,11 +136505,11 @@ }, "name": "pixel_skia_gold_test", "precommit_args": [ - "--review-patch-issue", + "--gerrit-issue", "${patch_issue}", - "--review-patch-set", + "--gerrit-patchset", "${patch_set}", - "--buildbucket-build-id", + "--buildbucket-id", "${buildbucket_build_id}" ], "should_retry_with_patch": false, @@ -137118,10 +137134,10 @@ "-v", "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc --disable-features=UseSkiaRenderer", "--dont-restore-color-profile-after-test", - "--build-revision", - "${got_revision}", "--test-machine-name", - "${buildername}" + "${buildername}", + "--git-revision", + "${got_revision}" ], "isolate_name": "telemetry_gpu_integration_test", "merge": { @@ -137130,11 +137146,11 @@ }, "name": "gl_renderer_maps_pixel_tests", "precommit_args": [ - "--review-patch-issue", + "--gerrit-issue", "${patch_issue}", - "--review-patch-set", + "--gerrit-patchset", "${patch_set}", - "--buildbucket-build-id", + "--buildbucket-id", "${buildbucket_build_id}" ], "should_retry_with_patch": false, @@ -137161,10 +137177,10 @@ "-v", "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc --disable-features=UseSkiaRenderer", "--dont-restore-color-profile-after-test", - "--build-revision", - "${got_revision}", "--test-machine-name", - "${buildername}" + "${buildername}", + "--git-revision", + "${got_revision}" ], "isolate_name": "telemetry_gpu_integration_test", "merge": { @@ -137173,11 +137189,11 @@ }, "name": "gl_renderer_pixel_skia_gold_tests", "precommit_args": [ - "--review-patch-issue", + "--gerrit-issue", "${patch_issue}", - "--review-patch-set", + "--gerrit-patchset", "${patch_set}", - "--buildbucket-build-id", + "--buildbucket-id", "${buildbucket_build_id}" ], "should_retry_with_patch": false, @@ -138553,10 +138569,10 @@ "-v", "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc", "--dont-restore-color-profile-after-test", - "--build-revision", - "${got_revision}", "--test-machine-name", - "${buildername}" + "${buildername}", + "--git-revision", + "${got_revision}" ], "isolate_name": "telemetry_gpu_integration_test", "merge": { @@ -138565,11 +138581,11 @@ }, "name": "maps_pixel_test", "precommit_args": [ - "--review-patch-issue", + "--gerrit-issue", "${patch_issue}", - "--review-patch-set", + "--gerrit-patchset", "${patch_set}", - "--buildbucket-build-id", + "--buildbucket-id", "${buildbucket_build_id}" ], "should_retry_with_patch": false, @@ -138645,10 +138661,10 @@ "-v", "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc", "--dont-restore-color-profile-after-test", - "--build-revision", - "${got_revision}", "--test-machine-name", - "${buildername}" + "${buildername}", + "--git-revision", + "${got_revision}" ], "isolate_name": "telemetry_gpu_integration_test", "merge": { @@ -138657,11 +138673,11 @@ }, "name": "pixel_skia_gold_test", "precommit_args": [ - "--review-patch-issue", + "--gerrit-issue", "${patch_issue}", - "--review-patch-set", + "--gerrit-patchset", "${patch_set}", - "--buildbucket-build-id", + "--buildbucket-id", "${buildbucket_build_id}" ], "should_retry_with_patch": false, @@ -139327,11 +139343,12 @@ }, { "args": [ - "--build-revision=${got_revision}", "--test-launcher-filter-file=../../testing/buildbot/filters/pixel_browser_tests.filter", "--browser-ui-tests-verify-pixels", "--test-launcher-retry-limit=0", - "--enable-pixel-output-in-tests" + "--enable-pixel-output-in-tests", + "--git-revision", + "${got_revision}" ], "experiment_percentage": 100, "merge": { @@ -139340,9 +139357,12 @@ }, "name": "pixel_browser_tests", "precommit_args": [ - "--issue=${patch_issue}", - "--patchset=${patch_set}", - "--jobid=${buildbucket_build_id}" + "--gerrit-issue", + "${patch_issue}", + "--gerrit-patchset", + "${patch_set}", + "--buildbucket-id", + "${buildbucket_build_id}" ], "swarming": { "can_use_on_swarming_builders": true, @@ -147825,10 +147845,10 @@ "-v", "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc", "--dont-restore-color-profile-after-test", - "--build-revision", - "${got_revision}", "--test-machine-name", - "${buildername}" + "${buildername}", + "--git-revision", + "${got_revision}" ], "isolate_name": "telemetry_gpu_integration_test", "merge": { @@ -147837,11 +147857,11 @@ }, "name": "maps_pixel_test", "precommit_args": [ - "--review-patch-issue", + "--gerrit-issue", "${patch_issue}", - "--review-patch-set", + "--gerrit-patchset", "${patch_set}", - "--buildbucket-build-id", + "--buildbucket-id", "${buildbucket_build_id}" ], "should_retry_with_patch": false, @@ -147868,10 +147888,10 @@ "-v", "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc", "--dont-restore-color-profile-after-test", - "--build-revision", - "${got_revision}", "--test-machine-name", - "${buildername}" + "${buildername}", + "--git-revision", + "${got_revision}" ], "isolate_name": "telemetry_gpu_integration_test", "merge": { @@ -147880,11 +147900,11 @@ }, "name": "pixel_skia_gold_test", "precommit_args": [ - "--review-patch-issue", + "--gerrit-issue", "${patch_issue}", - "--review-patch-set", + "--gerrit-patchset", "${patch_set}", - "--buildbucket-build-id", + "--buildbucket-id", "${buildbucket_build_id}" ], "should_retry_with_patch": false, @@ -148416,10 +148436,10 @@ "-v", "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc", "--dont-restore-color-profile-after-test", - "--build-revision", - "${got_revision}", "--test-machine-name", - "${buildername}" + "${buildername}", + "--git-revision", + "${got_revision}" ], "isolate_name": "telemetry_gpu_integration_test", "merge": { @@ -148428,11 +148448,11 @@ }, "name": "maps_pixel_test", "precommit_args": [ - "--review-patch-issue", + "--gerrit-issue", "${patch_issue}", - "--review-patch-set", + "--gerrit-patchset", "${patch_set}", - "--buildbucket-build-id", + "--buildbucket-id", "${buildbucket_build_id}" ], "should_retry_with_patch": false, @@ -148468,10 +148488,10 @@ "-v", "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc", "--dont-restore-color-profile-after-test", - "--build-revision", - "${got_revision}", "--test-machine-name", - "${buildername}" + "${buildername}", + "--git-revision", + "${got_revision}" ], "isolate_name": "telemetry_gpu_integration_test", "merge": { @@ -148480,11 +148500,11 @@ }, "name": "pixel_skia_gold_test", "precommit_args": [ - "--review-patch-issue", + "--gerrit-issue", "${patch_issue}", - "--review-patch-set", + "--gerrit-patchset", "${patch_set}", - "--buildbucket-build-id", + "--buildbucket-id", "${buildbucket_build_id}" ], "should_retry_with_patch": false, @@ -149099,10 +149119,10 @@ "-v", "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc", "--dont-restore-color-profile-after-test", - "--build-revision", - "${got_revision}", "--test-machine-name", - "${buildername}" + "${buildername}", + "--git-revision", + "${got_revision}" ], "isolate_coverage_data": true, "isolate_name": "telemetry_gpu_integration_test", @@ -149112,11 +149132,11 @@ }, "name": "maps_pixel_test", "precommit_args": [ - "--review-patch-issue", + "--gerrit-issue", "${patch_issue}", - "--review-patch-set", + "--gerrit-patchset", "${patch_set}", - "--buildbucket-build-id", + "--buildbucket-id", "${buildbucket_build_id}" ], "should_retry_with_patch": false, @@ -149152,10 +149172,10 @@ "-v", "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc", "--dont-restore-color-profile-after-test", - "--build-revision", - "${got_revision}", "--test-machine-name", - "${buildername}" + "${buildername}", + "--git-revision", + "${got_revision}" ], "isolate_coverage_data": true, "isolate_name": "telemetry_gpu_integration_test", @@ -149165,11 +149185,11 @@ }, "name": "pixel_skia_gold_test", "precommit_args": [ - "--review-patch-issue", + "--gerrit-issue", "${patch_issue}", - "--review-patch-set", + "--gerrit-patchset", "${patch_set}", - "--buildbucket-build-id", + "--buildbucket-id", "${buildbucket_build_id}" ], "should_retry_with_patch": false, @@ -150041,10 +150061,10 @@ "-v", "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc", "--dont-restore-color-profile-after-test", - "--build-revision", - "${got_revision}", "--test-machine-name", - "${buildername}" + "${buildername}", + "--git-revision", + "${got_revision}" ], "isolate_name": "telemetry_gpu_integration_test", "merge": { @@ -150053,11 +150073,11 @@ }, "name": "maps_pixel_test", "precommit_args": [ - "--review-patch-issue", + "--gerrit-issue", "${patch_issue}", - "--review-patch-set", + "--gerrit-patchset", "${patch_set}", - "--buildbucket-build-id", + "--buildbucket-id", "${buildbucket_build_id}" ], "should_retry_with_patch": false, @@ -150085,10 +150105,10 @@ "-v", "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc", "--dont-restore-color-profile-after-test", - "--build-revision", - "${got_revision}", "--test-machine-name", - "${buildername}" + "${buildername}", + "--git-revision", + "${got_revision}" ], "isolate_name": "telemetry_gpu_integration_test", "merge": { @@ -150097,11 +150117,11 @@ }, "name": "pixel_skia_gold_test", "precommit_args": [ - "--review-patch-issue", + "--gerrit-issue", "${patch_issue}", - "--review-patch-set", + "--gerrit-patchset", "${patch_set}", - "--buildbucket-build-id", + "--buildbucket-id", "${buildbucket_build_id}" ], "should_retry_with_patch": false, @@ -150720,10 +150740,10 @@ "-v", "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc", "--dont-restore-color-profile-after-test", - "--build-revision", - "${got_revision}", "--test-machine-name", - "${buildername}" + "${buildername}", + "--git-revision", + "${got_revision}" ], "isolate_name": "telemetry_gpu_integration_test", "merge": { @@ -150732,11 +150752,11 @@ }, "name": "maps_pixel_test", "precommit_args": [ - "--review-patch-issue", + "--gerrit-issue", "${patch_issue}", - "--review-patch-set", + "--gerrit-patchset", "${patch_set}", - "--buildbucket-build-id", + "--buildbucket-id", "${buildbucket_build_id}" ], "should_retry_with_patch": false, @@ -150764,10 +150784,10 @@ "-v", "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc", "--dont-restore-color-profile-after-test", - "--build-revision", - "${got_revision}", "--test-machine-name", - "${buildername}" + "${buildername}", + "--git-revision", + "${got_revision}" ], "isolate_name": "telemetry_gpu_integration_test", "merge": { @@ -150776,11 +150796,11 @@ }, "name": "pixel_skia_gold_test", "precommit_args": [ - "--review-patch-issue", + "--gerrit-issue", "${patch_issue}", - "--review-patch-set", + "--gerrit-patchset", "${patch_set}", - "--buildbucket-build-id", + "--buildbucket-id", "${buildbucket_build_id}" ], "should_retry_with_patch": false, @@ -151618,10 +151638,10 @@ "-v", "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc", "--dont-restore-color-profile-after-test", - "--build-revision", - "${got_revision}", "--test-machine-name", - "${buildername}" + "${buildername}", + "--git-revision", + "${got_revision}" ], "isolate_name": "telemetry_gpu_integration_test", "merge": { @@ -151630,11 +151650,11 @@ }, "name": "maps_pixel_test", "precommit_args": [ - "--review-patch-issue", + "--gerrit-issue", "${patch_issue}", - "--review-patch-set", + "--gerrit-patchset", "${patch_set}", - "--buildbucket-build-id", + "--buildbucket-id", "${buildbucket_build_id}" ], "should_retry_with_patch": false, @@ -151671,10 +151691,10 @@ "-v", "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc", "--dont-restore-color-profile-after-test", - "--build-revision", - "${got_revision}", "--test-machine-name", - "${buildername}" + "${buildername}", + "--git-revision", + "${got_revision}" ], "isolate_name": "telemetry_gpu_integration_test", "merge": { @@ -151683,11 +151703,11 @@ }, "name": "pixel_skia_gold_test", "precommit_args": [ - "--review-patch-issue", + "--gerrit-issue", "${patch_issue}", - "--review-patch-set", + "--gerrit-patchset", "${patch_set}", - "--buildbucket-build-id", + "--buildbucket-id", "${buildbucket_build_id}" ], "should_retry_with_patch": false, @@ -152689,10 +152709,10 @@ "-v", "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc", "--dont-restore-color-profile-after-test", - "--build-revision", - "${got_revision}", "--test-machine-name", - "${buildername}" + "${buildername}", + "--git-revision", + "${got_revision}" ], "isolate_name": "telemetry_gpu_integration_test", "merge": { @@ -152701,11 +152721,11 @@ }, "name": "maps_pixel_test", "precommit_args": [ - "--review-patch-issue", + "--gerrit-issue", "${patch_issue}", - "--review-patch-set", + "--gerrit-patchset", "${patch_set}", - "--buildbucket-build-id", + "--buildbucket-id", "${buildbucket_build_id}" ], "should_retry_with_patch": false, @@ -152742,10 +152762,10 @@ "-v", "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc", "--dont-restore-color-profile-after-test", - "--build-revision", - "${got_revision}", "--test-machine-name", - "${buildername}" + "${buildername}", + "--git-revision", + "${got_revision}" ], "isolate_name": "telemetry_gpu_integration_test", "merge": { @@ -152754,11 +152774,11 @@ }, "name": "pixel_skia_gold_test", "precommit_args": [ - "--review-patch-issue", + "--gerrit-issue", "${patch_issue}", - "--review-patch-set", + "--gerrit-patchset", "${patch_set}", - "--buildbucket-build-id", + "--buildbucket-id", "${buildbucket_build_id}" ], "should_retry_with_patch": false, @@ -185191,10 +185211,10 @@ "--shared-prefs-file=//chrome/android/shared_preference_files/test/vr_ddview_skipdon_setupcomplete.json", "--replace-system-package=com.google.vr.vrcore,//third_party/gvr-android-sdk/test-apks/vr_services/vr_services_current.apk", "--additional-apk=//third_party/gvr-android-sdk/test-apks/vr_keyboard/vr_keyboard_current.apk", - "--git-revision", - "${got_revision}", "--gs-results-bucket=chromium-result-details", - "--recover-devices" + "--recover-devices", + "--git-revision", + "${got_revision}" ], "merge": { "args": [ @@ -227248,16 +227268,17 @@ ] }, "linux-upload-perfetto": { - "gtest_tests": [ + "isolated_scripts": [ { + "isolate_name": "upload_trace_processor", "merge": { "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" + "script": "//testing/merge_scripts/standard_isolated_script_merge.py" }, + "name": "upload_trace_processor", "swarming": { "can_use_on_swarming_builders": false }, - "test": "upload_trace_processor", "test_target": "//tools/perf/core/perfetto_binary_roller:upload_trace_processor" } ] @@ -234164,11 +234185,12 @@ "gtest_tests": [ { "args": [ - "--build-revision=${got_revision}", "--test-launcher-filter-file=../../testing/buildbot/filters/pixel_browser_tests.filter", "--browser-ui-tests-verify-pixels", "--test-launcher-retry-limit=0", - "--enable-pixel-output-in-tests" + "--enable-pixel-output-in-tests", + "--git-revision", + "${got_revision}" ], "experiment_percentage": 100, "merge": { @@ -234177,9 +234199,12 @@ }, "name": "pixel_browser_tests", "precommit_args": [ - "--issue=${patch_issue}", - "--patchset=${patch_set}", - "--jobid=${buildbucket_build_id}" + "--gerrit-issue", + "${patch_issue}", + "--gerrit-patchset", + "${patch_set}", + "--buildbucket-id", + "${buildbucket_build_id}" ], "swarming": { "can_use_on_swarming_builders": true,
diff --git a/testing/buildbot/chromium.fyi.json b/testing/buildbot/chromium.fyi.json index 7007faf..8e80d13 100644 --- a/testing/buildbot/chromium.fyi.json +++ b/testing/buildbot/chromium.fyi.json
@@ -38582,16 +38582,17 @@ ] }, "linux-upload-perfetto": { - "gtest_tests": [ + "isolated_scripts": [ { + "isolate_name": "upload_trace_processor", "merge": { "args": [], - "script": "//testing/merge_scripts/standard_gtest_merge.py" + "script": "//testing/merge_scripts/standard_isolated_script_merge.py" }, + "name": "upload_trace_processor", "swarming": { "can_use_on_swarming_builders": false }, - "test": "upload_trace_processor", "test_target": "//tools/perf/core/perfetto_binary_roller:upload_trace_processor" } ] @@ -42162,11 +42163,12 @@ "gtest_tests": [ { "args": [ - "--build-revision=${got_revision}", "--test-launcher-filter-file=../../testing/buildbot/filters/pixel_browser_tests.filter", "--browser-ui-tests-verify-pixels", "--test-launcher-retry-limit=0", - "--enable-pixel-output-in-tests" + "--enable-pixel-output-in-tests", + "--git-revision", + "${got_revision}" ], "experiment_percentage": 100, "merge": { @@ -42175,9 +42177,12 @@ }, "name": "pixel_browser_tests", "precommit_args": [ - "--issue=${patch_issue}", - "--patchset=${patch_set}", - "--jobid=${buildbucket_build_id}" + "--gerrit-issue", + "${patch_issue}", + "--gerrit-patchset", + "${patch_set}", + "--buildbucket-id", + "${buildbucket_build_id}" ], "swarming": { "can_use_on_swarming_builders": true,
diff --git a/testing/buildbot/chromium.gpu.fyi.json b/testing/buildbot/chromium.gpu.fyi.json index 0b9a954f..a555b89 100644 --- a/testing/buildbot/chromium.gpu.fyi.json +++ b/testing/buildbot/chromium.gpu.fyi.json
@@ -3804,10 +3804,10 @@ "-v", "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc", "--dont-restore-color-profile-after-test", - "--build-revision", - "${got_revision}", "--test-machine-name", - "${buildername}" + "${buildername}", + "--git-revision", + "${got_revision}" ], "isolate_name": "telemetry_gpu_integration_test", "merge": { @@ -3816,11 +3816,11 @@ }, "name": "maps_pixel_test", "precommit_args": [ - "--review-patch-issue", + "--gerrit-issue", "${patch_issue}", - "--review-patch-set", + "--gerrit-patchset", "${patch_set}", - "--buildbucket-build-id", + "--buildbucket-id", "${buildbucket_build_id}" ], "should_retry_with_patch": false, @@ -3849,10 +3849,10 @@ "-v", "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc", "--dont-restore-color-profile-after-test", - "--build-revision", - "${got_revision}", "--test-machine-name", - "${buildername}" + "${buildername}", + "--git-revision", + "${got_revision}" ], "isolate_name": "telemetry_gpu_integration_test", "merge": { @@ -3861,11 +3861,11 @@ }, "name": "pixel_skia_gold_test", "precommit_args": [ - "--review-patch-issue", + "--gerrit-issue", "${patch_issue}", - "--review-patch-set", + "--gerrit-patchset", "${patch_set}", - "--buildbucket-build-id", + "--buildbucket-id", "${buildbucket_build_id}" ], "should_retry_with_patch": false, @@ -4336,10 +4336,10 @@ "-v", "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc", "--dont-restore-color-profile-after-test", - "--build-revision", - "${got_revision}", "--test-machine-name", - "${buildername}" + "${buildername}", + "--git-revision", + "${got_revision}" ], "isolate_name": "telemetry_gpu_integration_test", "merge": { @@ -4348,11 +4348,11 @@ }, "name": "maps_pixel_test", "precommit_args": [ - "--review-patch-issue", + "--gerrit-issue", "${patch_issue}", - "--review-patch-set", + "--gerrit-patchset", "${patch_set}", - "--buildbucket-build-id", + "--buildbucket-id", "${buildbucket_build_id}" ], "should_retry_with_patch": false, @@ -4381,10 +4381,10 @@ "-v", "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc", "--dont-restore-color-profile-after-test", - "--build-revision", - "${got_revision}", "--test-machine-name", - "${buildername}" + "${buildername}", + "--git-revision", + "${got_revision}" ], "isolate_name": "telemetry_gpu_integration_test", "merge": { @@ -4393,11 +4393,11 @@ }, "name": "pixel_skia_gold_test", "precommit_args": [ - "--review-patch-issue", + "--gerrit-issue", "${patch_issue}", - "--review-patch-set", + "--gerrit-patchset", "${patch_set}", - "--buildbucket-build-id", + "--buildbucket-id", "${buildbucket_build_id}" ], "should_retry_with_patch": false, @@ -4619,10 +4619,10 @@ "-v", "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc", "--dont-restore-color-profile-after-test", - "--build-revision", - "${got_revision}", "--test-machine-name", - "${buildername}" + "${buildername}", + "--git-revision", + "${got_revision}" ], "isolate_name": "telemetry_gpu_integration_test", "merge": { @@ -4631,11 +4631,11 @@ }, "name": "android_webview_pixel_skia_gold_test", "precommit_args": [ - "--review-patch-issue", + "--gerrit-issue", "${patch_issue}", - "--review-patch-set", + "--gerrit-patchset", "${patch_set}", - "--buildbucket-build-id", + "--buildbucket-id", "${buildbucket_build_id}" ], "should_retry_with_patch": false, @@ -4852,10 +4852,10 @@ "-v", "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc", "--dont-restore-color-profile-after-test", - "--build-revision", - "${got_revision}", "--test-machine-name", - "${buildername}" + "${buildername}", + "--git-revision", + "${got_revision}" ], "isolate_name": "telemetry_gpu_integration_test", "merge": { @@ -4864,11 +4864,11 @@ }, "name": "maps_pixel_test", "precommit_args": [ - "--review-patch-issue", + "--gerrit-issue", "${patch_issue}", - "--review-patch-set", + "--gerrit-patchset", "${patch_set}", - "--buildbucket-build-id", + "--buildbucket-id", "${buildbucket_build_id}" ], "should_retry_with_patch": false, @@ -4896,10 +4896,10 @@ "-v", "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc", "--dont-restore-color-profile-after-test", - "--build-revision", - "${got_revision}", "--test-machine-name", - "${buildername}" + "${buildername}", + "--git-revision", + "${got_revision}" ], "isolate_name": "telemetry_gpu_integration_test", "merge": { @@ -4908,11 +4908,11 @@ }, "name": "pixel_skia_gold_test", "precommit_args": [ - "--review-patch-issue", + "--gerrit-issue", "${patch_issue}", - "--review-patch-set", + "--gerrit-patchset", "${patch_set}", - "--buildbucket-build-id", + "--buildbucket-id", "${buildbucket_build_id}" ], "should_retry_with_patch": false, @@ -5439,10 +5439,10 @@ "-v", "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc", "--dont-restore-color-profile-after-test", - "--build-revision", - "${got_revision}", "--test-machine-name", - "${buildername}" + "${buildername}", + "--git-revision", + "${got_revision}" ], "isolate_name": "telemetry_gpu_integration_test", "merge": { @@ -5451,11 +5451,11 @@ }, "name": "maps_pixel_test", "precommit_args": [ - "--review-patch-issue", + "--gerrit-issue", "${patch_issue}", - "--review-patch-set", + "--gerrit-patchset", "${patch_set}", - "--buildbucket-build-id", + "--buildbucket-id", "${buildbucket_build_id}" ], "should_retry_with_patch": false, @@ -5484,10 +5484,10 @@ "-v", "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc", "--dont-restore-color-profile-after-test", - "--build-revision", - "${got_revision}", "--test-machine-name", - "${buildername}" + "${buildername}", + "--git-revision", + "${got_revision}" ], "isolate_name": "telemetry_gpu_integration_test", "merge": { @@ -5496,11 +5496,11 @@ }, "name": "pixel_skia_gold_test", "precommit_args": [ - "--review-patch-issue", + "--gerrit-issue", "${patch_issue}", - "--review-patch-set", + "--gerrit-patchset", "${patch_set}", - "--buildbucket-build-id", + "--buildbucket-id", "${buildbucket_build_id}" ], "should_retry_with_patch": false, @@ -6049,10 +6049,10 @@ "-v", "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc", "--dont-restore-color-profile-after-test", - "--build-revision", - "${got_revision}", "--test-machine-name", - "${buildername}" + "${buildername}", + "--git-revision", + "${got_revision}" ], "isolate_name": "telemetry_gpu_integration_test", "merge": { @@ -6061,11 +6061,11 @@ }, "name": "maps_pixel_test", "precommit_args": [ - "--review-patch-issue", + "--gerrit-issue", "${patch_issue}", - "--review-patch-set", + "--gerrit-patchset", "${patch_set}", - "--buildbucket-build-id", + "--buildbucket-id", "${buildbucket_build_id}" ], "should_retry_with_patch": false, @@ -6094,10 +6094,10 @@ "-v", "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc", "--dont-restore-color-profile-after-test", - "--build-revision", - "${got_revision}", "--test-machine-name", - "${buildername}" + "${buildername}", + "--git-revision", + "${got_revision}" ], "isolate_name": "telemetry_gpu_integration_test", "merge": { @@ -6106,11 +6106,11 @@ }, "name": "pixel_skia_gold_test", "precommit_args": [ - "--review-patch-issue", + "--gerrit-issue", "${patch_issue}", - "--review-patch-set", + "--gerrit-patchset", "${patch_set}", - "--buildbucket-build-id", + "--buildbucket-id", "${buildbucket_build_id}" ], "should_retry_with_patch": false, @@ -6612,10 +6612,10 @@ "-v", "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc", "--dont-restore-color-profile-after-test", - "--build-revision", - "${got_revision}", "--test-machine-name", - "${buildername}" + "${buildername}", + "--git-revision", + "${got_revision}" ], "isolate_name": "telemetry_gpu_integration_test", "merge": { @@ -6624,11 +6624,11 @@ }, "name": "maps_pixel_test", "precommit_args": [ - "--review-patch-issue", + "--gerrit-issue", "${patch_issue}", - "--review-patch-set", + "--gerrit-patchset", "${patch_set}", - "--buildbucket-build-id", + "--buildbucket-id", "${buildbucket_build_id}" ], "should_retry_with_patch": false, @@ -6657,10 +6657,10 @@ "-v", "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc", "--dont-restore-color-profile-after-test", - "--build-revision", - "${got_revision}", "--test-machine-name", - "${buildername}" + "${buildername}", + "--git-revision", + "${got_revision}" ], "isolate_name": "telemetry_gpu_integration_test", "merge": { @@ -6669,11 +6669,11 @@ }, "name": "pixel_skia_gold_test", "precommit_args": [ - "--review-patch-issue", + "--gerrit-issue", "${patch_issue}", - "--review-patch-set", + "--gerrit-patchset", "${patch_set}", - "--buildbucket-build-id", + "--buildbucket-id", "${buildbucket_build_id}" ], "should_retry_with_patch": false, @@ -6805,10 +6805,10 @@ "-v", "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc", "--dont-restore-color-profile-after-test", - "--build-revision", - "${got_revision}", "--test-machine-name", - "${buildername}" + "${buildername}", + "--git-revision", + "${got_revision}" ], "isolate_name": "telemetry_gpu_integration_test", "merge": { @@ -6817,11 +6817,11 @@ }, "name": "pixel_skia_gold_test", "precommit_args": [ - "--review-patch-issue", + "--gerrit-issue", "${patch_issue}", - "--review-patch-set", + "--gerrit-patchset", "${patch_set}", - "--buildbucket-build-id", + "--buildbucket-id", "${buildbucket_build_id}" ], "should_retry_with_patch": false, @@ -6957,10 +6957,10 @@ "-v", "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc --enable-features=UseSkiaRenderer --use-gl=egl --enable-gpu-rasterization --force-gpu-rasterization --enable-oop-rasterization --disable-software-compositing-fallback --disable-headless-mode", "--dont-restore-color-profile-after-test", - "--build-revision", - "${got_revision}", "--test-machine-name", - "${buildername}" + "${buildername}", + "--git-revision", + "${got_revision}" ], "isolate_name": "telemetry_gpu_integration_test", "merge": { @@ -6969,11 +6969,11 @@ }, "name": "egl_pixel_skia_gold_test", "precommit_args": [ - "--review-patch-issue", + "--gerrit-issue", "${patch_issue}", - "--review-patch-set", + "--gerrit-patchset", "${patch_set}", - "--buildbucket-build-id", + "--buildbucket-id", "${buildbucket_build_id}" ], "should_retry_with_patch": false, @@ -7056,10 +7056,10 @@ "-v", "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc --use-vulkan=native --disable-vulkan-fallback-to-gl-for-testing --enable-features=UseSkiaRenderer,Vulkan --use-cmd-decoder=validating", "--dont-restore-color-profile-after-test", - "--build-revision", - "${got_revision}", "--test-machine-name", - "${buildername}" + "${buildername}", + "--git-revision", + "${got_revision}" ], "isolate_name": "telemetry_gpu_integration_test", "merge": { @@ -7068,11 +7068,11 @@ }, "name": "vulkan_pixel_skia_gold_test", "precommit_args": [ - "--review-patch-issue", + "--gerrit-issue", "${patch_issue}", - "--review-patch-set", + "--gerrit-patchset", "${patch_set}", - "--buildbucket-build-id", + "--buildbucket-id", "${buildbucket_build_id}" ], "should_retry_with_patch": false, @@ -7571,10 +7571,10 @@ "-v", "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc", "--dont-restore-color-profile-after-test", - "--build-revision", - "${got_revision}", "--test-machine-name", - "${buildername}" + "${buildername}", + "--git-revision", + "${got_revision}" ], "isolate_name": "telemetry_gpu_integration_test", "merge": { @@ -7583,11 +7583,11 @@ }, "name": "maps_pixel_test", "precommit_args": [ - "--review-patch-issue", + "--gerrit-issue", "${patch_issue}", - "--review-patch-set", + "--gerrit-patchset", "${patch_set}", - "--buildbucket-build-id", + "--buildbucket-id", "${buildbucket_build_id}" ], "should_retry_with_patch": false, @@ -7614,10 +7614,10 @@ "-v", "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc", "--dont-restore-color-profile-after-test", - "--build-revision", - "${got_revision}", "--test-machine-name", - "${buildername}" + "${buildername}", + "--git-revision", + "${got_revision}" ], "isolate_name": "telemetry_gpu_integration_test", "merge": { @@ -7626,11 +7626,11 @@ }, "name": "pixel_skia_gold_test", "precommit_args": [ - "--review-patch-issue", + "--gerrit-issue", "${patch_issue}", - "--review-patch-set", + "--gerrit-patchset", "${patch_set}", - "--buildbucket-build-id", + "--buildbucket-id", "${buildbucket_build_id}" ], "should_retry_with_patch": false, @@ -8346,10 +8346,10 @@ "-v", "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc", "--dont-restore-color-profile-after-test", - "--build-revision", - "${got_revision}", "--test-machine-name", - "${buildername}" + "${buildername}", + "--git-revision", + "${got_revision}" ], "isolate_name": "telemetry_gpu_integration_test", "merge": { @@ -8358,11 +8358,11 @@ }, "name": "maps_pixel_test", "precommit_args": [ - "--review-patch-issue", + "--gerrit-issue", "${patch_issue}", - "--review-patch-set", + "--gerrit-patchset", "${patch_set}", - "--buildbucket-build-id", + "--buildbucket-id", "${buildbucket_build_id}" ], "should_retry_with_patch": false, @@ -8390,10 +8390,10 @@ "-v", "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc", "--dont-restore-color-profile-after-test", - "--build-revision", - "${got_revision}", "--test-machine-name", - "${buildername}" + "${buildername}", + "--git-revision", + "${got_revision}" ], "isolate_name": "telemetry_gpu_integration_test", "merge": { @@ -8402,11 +8402,11 @@ }, "name": "pixel_skia_gold_test", "precommit_args": [ - "--review-patch-issue", + "--gerrit-issue", "${patch_issue}", - "--review-patch-set", + "--gerrit-patchset", "${patch_set}", - "--buildbucket-build-id", + "--buildbucket-id", "${buildbucket_build_id}" ], "should_retry_with_patch": false, @@ -8925,10 +8925,10 @@ "-v", "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc", "--dont-restore-color-profile-after-test", - "--build-revision", - "${got_revision}", "--test-machine-name", - "${buildername}" + "${buildername}", + "--git-revision", + "${got_revision}" ], "isolate_name": "telemetry_gpu_integration_test", "merge": { @@ -8937,11 +8937,11 @@ }, "name": "maps_pixel_test", "precommit_args": [ - "--review-patch-issue", + "--gerrit-issue", "${patch_issue}", - "--review-patch-set", + "--gerrit-patchset", "${patch_set}", - "--buildbucket-build-id", + "--buildbucket-id", "${buildbucket_build_id}" ], "should_retry_with_patch": false, @@ -8968,10 +8968,10 @@ "-v", "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc", "--dont-restore-color-profile-after-test", - "--build-revision", - "${got_revision}", "--test-machine-name", - "${buildername}" + "${buildername}", + "--git-revision", + "${got_revision}" ], "isolate_name": "telemetry_gpu_integration_test", "merge": { @@ -8980,11 +8980,11 @@ }, "name": "pixel_skia_gold_test", "precommit_args": [ - "--review-patch-issue", + "--gerrit-issue", "${patch_issue}", - "--review-patch-set", + "--gerrit-patchset", "${patch_set}", - "--buildbucket-build-id", + "--buildbucket-id", "${buildbucket_build_id}" ], "should_retry_with_patch": false, @@ -9542,10 +9542,10 @@ "-v", "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc", "--dont-restore-color-profile-after-test", - "--build-revision", - "${got_revision}", "--test-machine-name", - "${buildername}" + "${buildername}", + "--git-revision", + "${got_revision}" ], "isolate_name": "telemetry_gpu_integration_test", "merge": { @@ -9554,11 +9554,11 @@ }, "name": "maps_pixel_test", "precommit_args": [ - "--review-patch-issue", + "--gerrit-issue", "${patch_issue}", - "--review-patch-set", + "--gerrit-patchset", "${patch_set}", - "--buildbucket-build-id", + "--buildbucket-id", "${buildbucket_build_id}" ], "should_retry_with_patch": false, @@ -9586,10 +9586,10 @@ "-v", "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc", "--dont-restore-color-profile-after-test", - "--build-revision", - "${got_revision}", "--test-machine-name", - "${buildername}" + "${buildername}", + "--git-revision", + "${got_revision}" ], "isolate_name": "telemetry_gpu_integration_test", "merge": { @@ -9598,11 +9598,11 @@ }, "name": "pixel_skia_gold_test", "precommit_args": [ - "--review-patch-issue", + "--gerrit-issue", "${patch_issue}", - "--review-patch-set", + "--gerrit-patchset", "${patch_set}", - "--buildbucket-build-id", + "--buildbucket-id", "${buildbucket_build_id}" ], "should_retry_with_patch": false, @@ -10183,10 +10183,10 @@ "-v", "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc", "--dont-restore-color-profile-after-test", - "--build-revision", - "${got_revision}", "--test-machine-name", - "${buildername}" + "${buildername}", + "--git-revision", + "${got_revision}" ], "isolate_name": "telemetry_gpu_integration_test", "merge": { @@ -10195,11 +10195,11 @@ }, "name": "maps_pixel_test", "precommit_args": [ - "--review-patch-issue", + "--gerrit-issue", "${patch_issue}", - "--review-patch-set", + "--gerrit-patchset", "${patch_set}", - "--buildbucket-build-id", + "--buildbucket-id", "${buildbucket_build_id}" ], "should_retry_with_patch": false, @@ -10226,10 +10226,10 @@ "-v", "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc", "--dont-restore-color-profile-after-test", - "--build-revision", - "${got_revision}", "--test-machine-name", - "${buildername}" + "${buildername}", + "--git-revision", + "${got_revision}" ], "isolate_name": "telemetry_gpu_integration_test", "merge": { @@ -10238,11 +10238,11 @@ }, "name": "pixel_skia_gold_test", "precommit_args": [ - "--review-patch-issue", + "--gerrit-issue", "${patch_issue}", - "--review-patch-set", + "--gerrit-patchset", "${patch_set}", - "--buildbucket-build-id", + "--buildbucket-id", "${buildbucket_build_id}" ], "should_retry_with_patch": false, @@ -10700,10 +10700,10 @@ "-v", "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc --enable-features=UseSkiaRenderer", "--dont-restore-color-profile-after-test", - "--build-revision", - "${got_revision}", "--test-machine-name", - "${buildername}" + "${buildername}", + "--git-revision", + "${got_revision}" ], "isolate_name": "telemetry_gpu_integration_test", "merge": { @@ -10712,11 +10712,11 @@ }, "name": "maps_pixel_test", "precommit_args": [ - "--review-patch-issue", + "--gerrit-issue", "${patch_issue}", - "--review-patch-set", + "--gerrit-patchset", "${patch_set}", - "--buildbucket-build-id", + "--buildbucket-id", "${buildbucket_build_id}" ], "should_retry_with_patch": false, @@ -10815,10 +10815,10 @@ "-v", "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc --enable-features=UseSkiaRenderer", "--dont-restore-color-profile-after-test", - "--build-revision", - "${got_revision}", "--test-machine-name", - "${buildername}" + "${buildername}", + "--git-revision", + "${got_revision}" ], "isolate_name": "telemetry_gpu_integration_test", "merge": { @@ -10827,11 +10827,11 @@ }, "name": "skia_renderer_pixel_skia_gold_test", "precommit_args": [ - "--review-patch-issue", + "--gerrit-issue", "${patch_issue}", - "--review-patch-set", + "--gerrit-patchset", "${patch_set}", - "--buildbucket-build-id", + "--buildbucket-id", "${buildbucket_build_id}" ], "should_retry_with_patch": false, @@ -10902,10 +10902,10 @@ "-v", "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc --use-vulkan=native --disable-vulkan-fallback-to-gl-for-testing --enable-features=UseSkiaRenderer,Vulkan --use-cmd-decoder=validating", "--dont-restore-color-profile-after-test", - "--build-revision", - "${got_revision}", "--test-machine-name", - "${buildername}" + "${buildername}", + "--git-revision", + "${got_revision}" ], "isolate_name": "telemetry_gpu_integration_test", "merge": { @@ -10914,11 +10914,11 @@ }, "name": "vulkan_pixel_skia_gold_test", "precommit_args": [ - "--review-patch-issue", + "--gerrit-issue", "${patch_issue}", - "--review-patch-set", + "--gerrit-patchset", "${patch_set}", - "--buildbucket-build-id", + "--buildbucket-id", "${buildbucket_build_id}" ], "should_retry_with_patch": false, @@ -11135,10 +11135,10 @@ "-v", "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc --enable-features=UseSkiaRenderer", "--dont-restore-color-profile-after-test", - "--build-revision", - "${got_revision}", "--test-machine-name", - "${buildername}" + "${buildername}", + "--git-revision", + "${got_revision}" ], "isolate_name": "telemetry_gpu_integration_test", "merge": { @@ -11147,11 +11147,11 @@ }, "name": "maps_pixel_test", "precommit_args": [ - "--review-patch-issue", + "--gerrit-issue", "${patch_issue}", - "--review-patch-set", + "--gerrit-patchset", "${patch_set}", - "--buildbucket-build-id", + "--buildbucket-id", "${buildbucket_build_id}" ], "should_retry_with_patch": false, @@ -11250,10 +11250,10 @@ "-v", "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc --enable-features=UseSkiaRenderer", "--dont-restore-color-profile-after-test", - "--build-revision", - "${got_revision}", "--test-machine-name", - "${buildername}" + "${buildername}", + "--git-revision", + "${got_revision}" ], "isolate_name": "telemetry_gpu_integration_test", "merge": { @@ -11262,11 +11262,11 @@ }, "name": "skia_renderer_pixel_skia_gold_test", "precommit_args": [ - "--review-patch-issue", + "--gerrit-issue", "${patch_issue}", - "--review-patch-set", + "--gerrit-patchset", "${patch_set}", - "--buildbucket-build-id", + "--buildbucket-id", "${buildbucket_build_id}" ], "should_retry_with_patch": false, @@ -11337,10 +11337,10 @@ "-v", "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc --use-vulkan=native --disable-vulkan-fallback-to-gl-for-testing --enable-features=UseSkiaRenderer,Vulkan --use-cmd-decoder=validating", "--dont-restore-color-profile-after-test", - "--build-revision", - "${got_revision}", "--test-machine-name", - "${buildername}" + "${buildername}", + "--git-revision", + "${got_revision}" ], "isolate_name": "telemetry_gpu_integration_test", "merge": { @@ -11349,11 +11349,11 @@ }, "name": "vulkan_pixel_skia_gold_test", "precommit_args": [ - "--review-patch-issue", + "--gerrit-issue", "${patch_issue}", - "--review-patch-set", + "--gerrit-patchset", "${patch_set}", - "--buildbucket-build-id", + "--buildbucket-id", "${buildbucket_build_id}" ], "should_retry_with_patch": false, @@ -12055,10 +12055,10 @@ "-v", "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc", "--dont-restore-color-profile-after-test", - "--build-revision", - "${got_revision}", "--test-machine-name", - "${buildername}" + "${buildername}", + "--git-revision", + "${got_revision}" ], "isolate_name": "telemetry_gpu_integration_test", "merge": { @@ -12067,11 +12067,11 @@ }, "name": "maps_pixel_test", "precommit_args": [ - "--review-patch-issue", + "--gerrit-issue", "${patch_issue}", - "--review-patch-set", + "--gerrit-patchset", "${patch_set}", - "--buildbucket-build-id", + "--buildbucket-id", "${buildbucket_build_id}" ], "should_retry_with_patch": false, @@ -12097,10 +12097,10 @@ "-v", "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc", "--dont-restore-color-profile-after-test", - "--build-revision", - "${got_revision}", "--test-machine-name", - "${buildername}" + "${buildername}", + "--git-revision", + "${got_revision}" ], "isolate_name": "telemetry_gpu_integration_test", "merge": { @@ -12109,11 +12109,11 @@ }, "name": "pixel_skia_gold_test", "precommit_args": [ - "--review-patch-issue", + "--gerrit-issue", "${patch_issue}", - "--review-patch-set", + "--gerrit-patchset", "${patch_set}", - "--buildbucket-build-id", + "--buildbucket-id", "${buildbucket_build_id}" ], "should_retry_with_patch": false, @@ -12739,10 +12739,10 @@ "-v", "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc", "--dont-restore-color-profile-after-test", - "--build-revision", - "${got_revision}", "--test-machine-name", - "${buildername}" + "${buildername}", + "--git-revision", + "${got_revision}" ], "isolate_name": "telemetry_gpu_integration_test", "merge": { @@ -12751,11 +12751,11 @@ }, "name": "maps_pixel_test", "precommit_args": [ - "--review-patch-issue", + "--gerrit-issue", "${patch_issue}", - "--review-patch-set", + "--gerrit-patchset", "${patch_set}", - "--buildbucket-build-id", + "--buildbucket-id", "${buildbucket_build_id}" ], "should_retry_with_patch": false, @@ -12787,10 +12787,10 @@ "-v", "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc", "--dont-restore-color-profile-after-test", - "--build-revision", - "${got_revision}", "--test-machine-name", - "${buildername}" + "${buildername}", + "--git-revision", + "${got_revision}" ], "isolate_name": "telemetry_gpu_integration_test", "merge": { @@ -12799,11 +12799,11 @@ }, "name": "pixel_skia_gold_test", "precommit_args": [ - "--review-patch-issue", + "--gerrit-issue", "${patch_issue}", - "--review-patch-set", + "--gerrit-patchset", "${patch_set}", - "--buildbucket-build-id", + "--buildbucket-id", "${buildbucket_build_id}" ], "should_retry_with_patch": false, @@ -13415,10 +13415,10 @@ "-v", "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc", "--dont-restore-color-profile-after-test", - "--build-revision", - "${got_revision}", "--test-machine-name", - "${buildername}" + "${buildername}", + "--git-revision", + "${got_revision}" ], "isolate_name": "telemetry_gpu_integration_test", "merge": { @@ -13427,11 +13427,11 @@ }, "name": "maps_pixel_test", "precommit_args": [ - "--review-patch-issue", + "--gerrit-issue", "${patch_issue}", - "--review-patch-set", + "--gerrit-patchset", "${patch_set}", - "--buildbucket-build-id", + "--buildbucket-id", "${buildbucket_build_id}" ], "should_retry_with_patch": false, @@ -13457,10 +13457,10 @@ "-v", "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc", "--dont-restore-color-profile-after-test", - "--build-revision", - "${got_revision}", "--test-machine-name", - "${buildername}" + "${buildername}", + "--git-revision", + "${got_revision}" ], "isolate_name": "telemetry_gpu_integration_test", "merge": { @@ -13469,11 +13469,11 @@ }, "name": "pixel_skia_gold_test", "precommit_args": [ - "--review-patch-issue", + "--gerrit-issue", "${patch_issue}", - "--review-patch-set", + "--gerrit-patchset", "${patch_set}", - "--buildbucket-build-id", + "--buildbucket-id", "${buildbucket_build_id}" ], "should_retry_with_patch": false, @@ -14065,10 +14065,10 @@ "-v", "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc", "--dont-restore-color-profile-after-test", - "--build-revision", - "${got_revision}", "--test-machine-name", - "${buildername}" + "${buildername}", + "--git-revision", + "${got_revision}" ], "isolate_name": "telemetry_gpu_integration_test", "merge": { @@ -14077,11 +14077,11 @@ }, "name": "maps_pixel_test", "precommit_args": [ - "--review-patch-issue", + "--gerrit-issue", "${patch_issue}", - "--review-patch-set", + "--gerrit-patchset", "${patch_set}", - "--buildbucket-build-id", + "--buildbucket-id", "${buildbucket_build_id}" ], "should_retry_with_patch": false, @@ -14109,10 +14109,10 @@ "-v", "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc", "--dont-restore-color-profile-after-test", - "--build-revision", - "${got_revision}", "--test-machine-name", - "${buildername}" + "${buildername}", + "--git-revision", + "${got_revision}" ], "isolate_name": "telemetry_gpu_integration_test", "merge": { @@ -14121,11 +14121,11 @@ }, "name": "pixel_skia_gold_test", "precommit_args": [ - "--review-patch-issue", + "--gerrit-issue", "${patch_issue}", - "--review-patch-set", + "--gerrit-patchset", "${patch_set}", - "--buildbucket-build-id", + "--buildbucket-id", "${buildbucket_build_id}" ], "should_retry_with_patch": false, @@ -14607,10 +14607,10 @@ "-v", "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc", "--dont-restore-color-profile-after-test", - "--build-revision", - "${got_revision}", "--test-machine-name", - "${buildername}" + "${buildername}", + "--git-revision", + "${got_revision}" ], "isolate_name": "telemetry_gpu_integration_test", "merge": { @@ -14619,11 +14619,11 @@ }, "name": "maps_pixel_test", "precommit_args": [ - "--review-patch-issue", + "--gerrit-issue", "${patch_issue}", - "--review-patch-set", + "--gerrit-patchset", "${patch_set}", - "--buildbucket-build-id", + "--buildbucket-id", "${buildbucket_build_id}" ], "should_retry_with_patch": false, @@ -14651,10 +14651,10 @@ "-v", "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc", "--dont-restore-color-profile-after-test", - "--build-revision", - "${got_revision}", "--test-machine-name", - "${buildername}" + "${buildername}", + "--git-revision", + "${got_revision}" ], "isolate_name": "telemetry_gpu_integration_test", "merge": { @@ -14663,11 +14663,11 @@ }, "name": "pixel_skia_gold_test", "precommit_args": [ - "--review-patch-issue", + "--gerrit-issue", "${patch_issue}", - "--review-patch-set", + "--gerrit-patchset", "${patch_set}", - "--buildbucket-build-id", + "--buildbucket-id", "${buildbucket_build_id}" ], "should_retry_with_patch": false, @@ -15144,10 +15144,10 @@ "-v", "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc", "--dont-restore-color-profile-after-test", - "--build-revision", - "${got_revision}", "--test-machine-name", - "${buildername}" + "${buildername}", + "--git-revision", + "${got_revision}" ], "isolate_name": "telemetry_gpu_integration_test", "merge": { @@ -15156,11 +15156,11 @@ }, "name": "maps_pixel_test", "precommit_args": [ - "--review-patch-issue", + "--gerrit-issue", "${patch_issue}", - "--review-patch-set", + "--gerrit-patchset", "${patch_set}", - "--buildbucket-build-id", + "--buildbucket-id", "${buildbucket_build_id}" ], "should_retry_with_patch": false, @@ -15188,10 +15188,10 @@ "-v", "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc", "--dont-restore-color-profile-after-test", - "--build-revision", - "${got_revision}", "--test-machine-name", - "${buildername}" + "${buildername}", + "--git-revision", + "${got_revision}" ], "isolate_name": "telemetry_gpu_integration_test", "merge": { @@ -15200,11 +15200,11 @@ }, "name": "pixel_skia_gold_test", "precommit_args": [ - "--review-patch-issue", + "--gerrit-issue", "${patch_issue}", - "--review-patch-set", + "--gerrit-patchset", "${patch_set}", - "--buildbucket-build-id", + "--buildbucket-id", "${buildbucket_build_id}" ], "should_retry_with_patch": false, @@ -15840,10 +15840,10 @@ "-v", "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc", "--dont-restore-color-profile-after-test", - "--build-revision", - "${got_revision}", "--test-machine-name", - "${buildername}" + "${buildername}", + "--git-revision", + "${got_revision}" ], "isolate_name": "telemetry_gpu_integration_test", "merge": { @@ -15852,11 +15852,11 @@ }, "name": "maps_pixel_test", "precommit_args": [ - "--review-patch-issue", + "--gerrit-issue", "${patch_issue}", - "--review-patch-set", + "--gerrit-patchset", "${patch_set}", - "--buildbucket-build-id", + "--buildbucket-id", "${buildbucket_build_id}" ], "should_retry_with_patch": false, @@ -15884,10 +15884,10 @@ "-v", "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc", "--dont-restore-color-profile-after-test", - "--build-revision", - "${got_revision}", "--test-machine-name", - "${buildername}" + "${buildername}", + "--git-revision", + "${got_revision}" ], "isolate_name": "telemetry_gpu_integration_test", "merge": { @@ -15896,11 +15896,11 @@ }, "name": "pixel_skia_gold_test", "precommit_args": [ - "--review-patch-issue", + "--gerrit-issue", "${patch_issue}", - "--review-patch-set", + "--gerrit-patchset", "${patch_set}", - "--buildbucket-build-id", + "--buildbucket-id", "${buildbucket_build_id}" ], "should_retry_with_patch": false, @@ -16600,10 +16600,10 @@ "-v", "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc", "--dont-restore-color-profile-after-test", - "--build-revision", - "${got_revision}", "--test-machine-name", - "${buildername}" + "${buildername}", + "--git-revision", + "${got_revision}" ], "isolate_name": "telemetry_gpu_integration_test", "merge": { @@ -16612,11 +16612,11 @@ }, "name": "maps_pixel_test", "precommit_args": [ - "--review-patch-issue", + "--gerrit-issue", "${patch_issue}", - "--review-patch-set", + "--gerrit-patchset", "${patch_set}", - "--buildbucket-build-id", + "--buildbucket-id", "${buildbucket_build_id}" ], "should_retry_with_patch": false, @@ -16644,10 +16644,10 @@ "-v", "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc", "--dont-restore-color-profile-after-test", - "--build-revision", - "${got_revision}", "--test-machine-name", - "${buildername}" + "${buildername}", + "--git-revision", + "${got_revision}" ], "isolate_name": "telemetry_gpu_integration_test", "merge": { @@ -16656,11 +16656,11 @@ }, "name": "pixel_skia_gold_test", "precommit_args": [ - "--review-patch-issue", + "--gerrit-issue", "${patch_issue}", - "--review-patch-set", + "--gerrit-patchset", "${patch_set}", - "--buildbucket-build-id", + "--buildbucket-id", "${buildbucket_build_id}" ], "should_retry_with_patch": false, @@ -19740,10 +19740,10 @@ "-v", "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc", "--dont-restore-color-profile-after-test", - "--build-revision", - "${got_revision}", "--test-machine-name", - "${buildername}" + "${buildername}", + "--git-revision", + "${got_revision}" ], "isolate_name": "telemetry_gpu_integration_test", "merge": { @@ -19752,11 +19752,11 @@ }, "name": "maps_pixel_test", "precommit_args": [ - "--review-patch-issue", + "--gerrit-issue", "${patch_issue}", - "--review-patch-set", + "--gerrit-patchset", "${patch_set}", - "--buildbucket-build-id", + "--buildbucket-id", "${buildbucket_build_id}" ], "should_retry_with_patch": false, @@ -19783,10 +19783,10 @@ "-v", "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc", "--dont-restore-color-profile-after-test", - "--build-revision", - "${got_revision}", "--test-machine-name", - "${buildername}" + "${buildername}", + "--git-revision", + "${got_revision}" ], "isolate_name": "telemetry_gpu_integration_test", "merge": { @@ -19795,11 +19795,11 @@ }, "name": "pixel_skia_gold_test", "precommit_args": [ - "--review-patch-issue", + "--gerrit-issue", "${patch_issue}", - "--review-patch-set", + "--gerrit-patchset", "${patch_set}", - "--buildbucket-build-id", + "--buildbucket-id", "${buildbucket_build_id}" ], "should_retry_with_patch": false, @@ -20553,10 +20553,10 @@ "-v", "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc", "--dont-restore-color-profile-after-test", - "--build-revision", - "${got_revision}", "--test-machine-name", - "${buildername}" + "${buildername}", + "--git-revision", + "${got_revision}" ], "isolate_name": "telemetry_gpu_integration_test", "merge": { @@ -20565,11 +20565,11 @@ }, "name": "maps_pixel_test", "precommit_args": [ - "--review-patch-issue", + "--gerrit-issue", "${patch_issue}", - "--review-patch-set", + "--gerrit-patchset", "${patch_set}", - "--buildbucket-build-id", + "--buildbucket-id", "${buildbucket_build_id}" ], "should_retry_with_patch": false, @@ -20597,10 +20597,10 @@ "-v", "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc", "--dont-restore-color-profile-after-test", - "--build-revision", - "${got_revision}", "--test-machine-name", - "${buildername}" + "${buildername}", + "--git-revision", + "${got_revision}" ], "isolate_name": "telemetry_gpu_integration_test", "merge": { @@ -20609,11 +20609,11 @@ }, "name": "pixel_skia_gold_test", "precommit_args": [ - "--review-patch-issue", + "--gerrit-issue", "${patch_issue}", - "--review-patch-set", + "--gerrit-patchset", "${patch_set}", - "--buildbucket-build-id", + "--buildbucket-id", "${buildbucket_build_id}" ], "should_retry_with_patch": false, @@ -21428,10 +21428,10 @@ "-v", "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc", "--dont-restore-color-profile-after-test", - "--build-revision", - "${got_revision}", "--test-machine-name", - "${buildername}" + "${buildername}", + "--git-revision", + "${got_revision}" ], "isolate_name": "telemetry_gpu_integration_test", "merge": { @@ -21440,11 +21440,11 @@ }, "name": "maps_pixel_test", "precommit_args": [ - "--review-patch-issue", + "--gerrit-issue", "${patch_issue}", - "--review-patch-set", + "--gerrit-patchset", "${patch_set}", - "--buildbucket-build-id", + "--buildbucket-id", "${buildbucket_build_id}" ], "should_retry_with_patch": false, @@ -21472,10 +21472,10 @@ "-v", "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc", "--dont-restore-color-profile-after-test", - "--build-revision", - "${got_revision}", "--test-machine-name", - "${buildername}" + "${buildername}", + "--git-revision", + "${got_revision}" ], "isolate_name": "telemetry_gpu_integration_test", "merge": { @@ -21484,11 +21484,11 @@ }, "name": "pixel_skia_gold_test", "precommit_args": [ - "--review-patch-issue", + "--gerrit-issue", "${patch_issue}", - "--review-patch-set", + "--gerrit-patchset", "${patch_set}", - "--buildbucket-build-id", + "--buildbucket-id", "${buildbucket_build_id}" ], "should_retry_with_patch": false, @@ -22231,10 +22231,10 @@ "-v", "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc", "--dont-restore-color-profile-after-test", - "--build-revision", - "${got_revision}", "--test-machine-name", - "${buildername}" + "${buildername}", + "--git-revision", + "${got_revision}" ], "isolate_name": "telemetry_gpu_integration_test", "merge": { @@ -22243,11 +22243,11 @@ }, "name": "maps_pixel_test", "precommit_args": [ - "--review-patch-issue", + "--gerrit-issue", "${patch_issue}", - "--review-patch-set", + "--gerrit-patchset", "${patch_set}", - "--buildbucket-build-id", + "--buildbucket-id", "${buildbucket_build_id}" ], "should_retry_with_patch": false, @@ -22274,10 +22274,10 @@ "-v", "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc", "--dont-restore-color-profile-after-test", - "--build-revision", - "${got_revision}", "--test-machine-name", - "${buildername}" + "${buildername}", + "--git-revision", + "${got_revision}" ], "isolate_name": "telemetry_gpu_integration_test", "merge": { @@ -22286,11 +22286,11 @@ }, "name": "pixel_skia_gold_test", "precommit_args": [ - "--review-patch-issue", + "--gerrit-issue", "${patch_issue}", - "--review-patch-set", + "--gerrit-patchset", "${patch_set}", - "--buildbucket-build-id", + "--buildbucket-id", "${buildbucket_build_id}" ], "should_retry_with_patch": false, @@ -23166,10 +23166,10 @@ "-v", "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc", "--dont-restore-color-profile-after-test", - "--build-revision", - "${got_revision}", "--test-machine-name", - "${buildername}" + "${buildername}", + "--git-revision", + "${got_revision}" ], "isolate_name": "telemetry_gpu_integration_test", "merge": { @@ -23178,11 +23178,11 @@ }, "name": "maps_pixel_test", "precommit_args": [ - "--review-patch-issue", + "--gerrit-issue", "${patch_issue}", - "--review-patch-set", + "--gerrit-patchset", "${patch_set}", - "--buildbucket-build-id", + "--buildbucket-id", "${buildbucket_build_id}" ], "should_retry_with_patch": false, @@ -23210,10 +23210,10 @@ "-v", "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc", "--dont-restore-color-profile-after-test", - "--build-revision", - "${got_revision}", "--test-machine-name", - "${buildername}" + "${buildername}", + "--git-revision", + "${got_revision}" ], "isolate_name": "telemetry_gpu_integration_test", "merge": { @@ -23222,11 +23222,11 @@ }, "name": "pixel_skia_gold_test", "precommit_args": [ - "--review-patch-issue", + "--gerrit-issue", "${patch_issue}", - "--review-patch-set", + "--gerrit-patchset", "${patch_set}", - "--buildbucket-build-id", + "--buildbucket-id", "${buildbucket_build_id}" ], "should_retry_with_patch": false, @@ -24084,10 +24084,10 @@ "-v", "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc", "--dont-restore-color-profile-after-test", - "--build-revision", - "${got_revision}", "--test-machine-name", - "${buildername}" + "${buildername}", + "--git-revision", + "${got_revision}" ], "isolate_name": "telemetry_gpu_integration_test", "merge": { @@ -24096,11 +24096,11 @@ }, "name": "maps_pixel_test", "precommit_args": [ - "--review-patch-issue", + "--gerrit-issue", "${patch_issue}", - "--review-patch-set", + "--gerrit-patchset", "${patch_set}", - "--buildbucket-build-id", + "--buildbucket-id", "${buildbucket_build_id}" ], "should_retry_with_patch": false, @@ -24128,10 +24128,10 @@ "-v", "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc", "--dont-restore-color-profile-after-test", - "--build-revision", - "${got_revision}", "--test-machine-name", - "${buildername}" + "${buildername}", + "--git-revision", + "${got_revision}" ], "isolate_name": "telemetry_gpu_integration_test", "merge": { @@ -24140,11 +24140,11 @@ }, "name": "pixel_skia_gold_test", "precommit_args": [ - "--review-patch-issue", + "--gerrit-issue", "${patch_issue}", - "--review-patch-set", + "--gerrit-patchset", "${patch_set}", - "--buildbucket-build-id", + "--buildbucket-id", "${buildbucket_build_id}" ], "should_retry_with_patch": false, @@ -25133,10 +25133,10 @@ "-v", "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc", "--dont-restore-color-profile-after-test", - "--build-revision", - "${got_revision}", "--test-machine-name", - "${buildername}" + "${buildername}", + "--git-revision", + "${got_revision}" ], "isolate_name": "telemetry_gpu_integration_test", "merge": { @@ -25145,11 +25145,11 @@ }, "name": "maps_pixel_test", "precommit_args": [ - "--review-patch-issue", + "--gerrit-issue", "${patch_issue}", - "--review-patch-set", + "--gerrit-patchset", "${patch_set}", - "--buildbucket-build-id", + "--buildbucket-id", "${buildbucket_build_id}" ], "should_retry_with_patch": false, @@ -25225,10 +25225,10 @@ "-v", "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc", "--dont-restore-color-profile-after-test", - "--build-revision", - "${got_revision}", "--test-machine-name", - "${buildername}" + "${buildername}", + "--git-revision", + "${got_revision}" ], "isolate_name": "telemetry_gpu_integration_test", "merge": { @@ -25237,11 +25237,11 @@ }, "name": "pixel_skia_gold_test", "precommit_args": [ - "--review-patch-issue", + "--gerrit-issue", "${patch_issue}", - "--review-patch-set", + "--gerrit-patchset", "${patch_set}", - "--buildbucket-build-id", + "--buildbucket-id", "${buildbucket_build_id}" ], "should_retry_with_patch": false, @@ -25866,10 +25866,10 @@ "-v", "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc --disable-features=UseSkiaRenderer", "--dont-restore-color-profile-after-test", - "--build-revision", - "${got_revision}", "--test-machine-name", - "${buildername}" + "${buildername}", + "--git-revision", + "${got_revision}" ], "isolate_name": "telemetry_gpu_integration_test", "merge": { @@ -25878,11 +25878,11 @@ }, "name": "gl_renderer_maps_pixel_tests", "precommit_args": [ - "--review-patch-issue", + "--gerrit-issue", "${patch_issue}", - "--review-patch-set", + "--gerrit-patchset", "${patch_set}", - "--buildbucket-build-id", + "--buildbucket-id", "${buildbucket_build_id}" ], "should_retry_with_patch": false, @@ -25909,10 +25909,10 @@ "-v", "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc --disable-features=UseSkiaRenderer", "--dont-restore-color-profile-after-test", - "--build-revision", - "${got_revision}", "--test-machine-name", - "${buildername}" + "${buildername}", + "--git-revision", + "${got_revision}" ], "isolate_name": "telemetry_gpu_integration_test", "merge": { @@ -25921,11 +25921,11 @@ }, "name": "gl_renderer_pixel_skia_gold_tests", "precommit_args": [ - "--review-patch-issue", + "--gerrit-issue", "${patch_issue}", - "--review-patch-set", + "--gerrit-patchset", "${patch_set}", - "--buildbucket-build-id", + "--buildbucket-id", "${buildbucket_build_id}" ], "should_retry_with_patch": false, @@ -27301,10 +27301,10 @@ "-v", "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc", "--dont-restore-color-profile-after-test", - "--build-revision", - "${got_revision}", "--test-machine-name", - "${buildername}" + "${buildername}", + "--git-revision", + "${got_revision}" ], "isolate_name": "telemetry_gpu_integration_test", "merge": { @@ -27313,11 +27313,11 @@ }, "name": "maps_pixel_test", "precommit_args": [ - "--review-patch-issue", + "--gerrit-issue", "${patch_issue}", - "--review-patch-set", + "--gerrit-patchset", "${patch_set}", - "--buildbucket-build-id", + "--buildbucket-id", "${buildbucket_build_id}" ], "should_retry_with_patch": false, @@ -27393,10 +27393,10 @@ "-v", "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc", "--dont-restore-color-profile-after-test", - "--build-revision", - "${got_revision}", "--test-machine-name", - "${buildername}" + "${buildername}", + "--git-revision", + "${got_revision}" ], "isolate_name": "telemetry_gpu_integration_test", "merge": { @@ -27405,11 +27405,11 @@ }, "name": "pixel_skia_gold_test", "precommit_args": [ - "--review-patch-issue", + "--gerrit-issue", "${patch_issue}", - "--review-patch-set", + "--gerrit-patchset", "${patch_set}", - "--buildbucket-build-id", + "--buildbucket-id", "${buildbucket_build_id}" ], "should_retry_with_patch": false, @@ -28420,10 +28420,10 @@ "-v", "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc", "--dont-restore-color-profile-after-test", - "--build-revision", - "${got_revision}", "--test-machine-name", - "${buildername}" + "${buildername}", + "--git-revision", + "${got_revision}" ], "isolate_name": "telemetry_gpu_integration_test", "merge": { @@ -28432,11 +28432,11 @@ }, "name": "maps_pixel_test", "precommit_args": [ - "--review-patch-issue", + "--gerrit-issue", "${patch_issue}", - "--review-patch-set", + "--gerrit-patchset", "${patch_set}", - "--buildbucket-build-id", + "--buildbucket-id", "${buildbucket_build_id}" ], "should_retry_with_patch": false, @@ -28464,10 +28464,10 @@ "-v", "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc", "--dont-restore-color-profile-after-test", - "--build-revision", - "${got_revision}", "--test-machine-name", - "${buildername}" + "${buildername}", + "--git-revision", + "${got_revision}" ], "isolate_name": "telemetry_gpu_integration_test", "merge": { @@ -28476,11 +28476,11 @@ }, "name": "pixel_skia_gold_test", "precommit_args": [ - "--review-patch-issue", + "--gerrit-issue", "${patch_issue}", - "--review-patch-set", + "--gerrit-patchset", "${patch_set}", - "--buildbucket-build-id", + "--buildbucket-id", "${buildbucket_build_id}" ], "should_retry_with_patch": false, @@ -29099,10 +29099,10 @@ "-v", "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc", "--dont-restore-color-profile-after-test", - "--build-revision", - "${got_revision}", "--test-machine-name", - "${buildername}" + "${buildername}", + "--git-revision", + "${got_revision}" ], "isolate_name": "telemetry_gpu_integration_test", "merge": { @@ -29111,11 +29111,11 @@ }, "name": "maps_pixel_test", "precommit_args": [ - "--review-patch-issue", + "--gerrit-issue", "${patch_issue}", - "--review-patch-set", + "--gerrit-patchset", "${patch_set}", - "--buildbucket-build-id", + "--buildbucket-id", "${buildbucket_build_id}" ], "should_retry_with_patch": false, @@ -29143,10 +29143,10 @@ "-v", "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc", "--dont-restore-color-profile-after-test", - "--build-revision", - "${got_revision}", "--test-machine-name", - "${buildername}" + "${buildername}", + "--git-revision", + "${got_revision}" ], "isolate_name": "telemetry_gpu_integration_test", "merge": { @@ -29155,11 +29155,11 @@ }, "name": "pixel_skia_gold_test", "precommit_args": [ - "--review-patch-issue", + "--gerrit-issue", "${patch_issue}", - "--review-patch-set", + "--gerrit-patchset", "${patch_set}", - "--buildbucket-build-id", + "--buildbucket-id", "${buildbucket_build_id}" ], "should_retry_with_patch": false, @@ -29997,10 +29997,10 @@ "-v", "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc", "--dont-restore-color-profile-after-test", - "--build-revision", - "${got_revision}", "--test-machine-name", - "${buildername}" + "${buildername}", + "--git-revision", + "${got_revision}" ], "isolate_name": "telemetry_gpu_integration_test", "merge": { @@ -30009,11 +30009,11 @@ }, "name": "maps_pixel_test", "precommit_args": [ - "--review-patch-issue", + "--gerrit-issue", "${patch_issue}", - "--review-patch-set", + "--gerrit-patchset", "${patch_set}", - "--buildbucket-build-id", + "--buildbucket-id", "${buildbucket_build_id}" ], "should_retry_with_patch": false, @@ -30050,10 +30050,10 @@ "-v", "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc", "--dont-restore-color-profile-after-test", - "--build-revision", - "${got_revision}", "--test-machine-name", - "${buildername}" + "${buildername}", + "--git-revision", + "${got_revision}" ], "isolate_name": "telemetry_gpu_integration_test", "merge": { @@ -30062,11 +30062,11 @@ }, "name": "pixel_skia_gold_test", "precommit_args": [ - "--review-patch-issue", + "--gerrit-issue", "${patch_issue}", - "--review-patch-set", + "--gerrit-patchset", "${patch_set}", - "--buildbucket-build-id", + "--buildbucket-id", "${buildbucket_build_id}" ], "should_retry_with_patch": false, @@ -31068,10 +31068,10 @@ "-v", "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc", "--dont-restore-color-profile-after-test", - "--build-revision", - "${got_revision}", "--test-machine-name", - "${buildername}" + "${buildername}", + "--git-revision", + "${got_revision}" ], "isolate_name": "telemetry_gpu_integration_test", "merge": { @@ -31080,11 +31080,11 @@ }, "name": "maps_pixel_test", "precommit_args": [ - "--review-patch-issue", + "--gerrit-issue", "${patch_issue}", - "--review-patch-set", + "--gerrit-patchset", "${patch_set}", - "--buildbucket-build-id", + "--buildbucket-id", "${buildbucket_build_id}" ], "should_retry_with_patch": false, @@ -31121,10 +31121,10 @@ "-v", "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc", "--dont-restore-color-profile-after-test", - "--build-revision", - "${got_revision}", "--test-machine-name", - "${buildername}" + "${buildername}", + "--git-revision", + "${got_revision}" ], "isolate_name": "telemetry_gpu_integration_test", "merge": { @@ -31133,11 +31133,11 @@ }, "name": "pixel_skia_gold_test", "precommit_args": [ - "--review-patch-issue", + "--gerrit-issue", "${patch_issue}", - "--review-patch-set", + "--gerrit-patchset", "${patch_set}", - "--buildbucket-build-id", + "--buildbucket-id", "${buildbucket_build_id}" ], "should_retry_with_patch": false,
diff --git a/testing/buildbot/chromium.gpu.json b/testing/buildbot/chromium.gpu.json index 474c2ee..b75c4746 100644 --- a/testing/buildbot/chromium.gpu.json +++ b/testing/buildbot/chromium.gpu.json
@@ -171,10 +171,10 @@ "-v", "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc", "--dont-restore-color-profile-after-test", - "--build-revision", - "${got_revision}", "--test-machine-name", - "${buildername}" + "${buildername}", + "--git-revision", + "${got_revision}" ], "isolate_name": "telemetry_gpu_integration_test", "merge": { @@ -183,11 +183,11 @@ }, "name": "maps_pixel_test", "precommit_args": [ - "--review-patch-issue", + "--gerrit-issue", "${patch_issue}", - "--review-patch-set", + "--gerrit-patchset", "${patch_set}", - "--buildbucket-build-id", + "--buildbucket-id", "${buildbucket_build_id}" ], "should_retry_with_patch": false, @@ -215,10 +215,10 @@ "-v", "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc", "--dont-restore-color-profile-after-test", - "--build-revision", - "${got_revision}", "--test-machine-name", - "${buildername}" + "${buildername}", + "--git-revision", + "${got_revision}" ], "isolate_name": "telemetry_gpu_integration_test", "merge": { @@ -227,11 +227,11 @@ }, "name": "pixel_skia_gold_test", "precommit_args": [ - "--review-patch-issue", + "--gerrit-issue", "${patch_issue}", - "--review-patch-set", + "--gerrit-patchset", "${patch_set}", - "--buildbucket-build-id", + "--buildbucket-id", "${buildbucket_build_id}" ], "should_retry_with_patch": false, @@ -652,10 +652,10 @@ "-v", "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc", "--dont-restore-color-profile-after-test", - "--build-revision", - "${got_revision}", "--test-machine-name", - "${buildername}" + "${buildername}", + "--git-revision", + "${got_revision}" ], "isolate_name": "telemetry_gpu_integration_test", "merge": { @@ -664,11 +664,11 @@ }, "name": "maps_pixel_test", "precommit_args": [ - "--review-patch-issue", + "--gerrit-issue", "${patch_issue}", - "--review-patch-set", + "--gerrit-patchset", "${patch_set}", - "--buildbucket-build-id", + "--buildbucket-id", "${buildbucket_build_id}" ], "should_retry_with_patch": false, @@ -695,10 +695,10 @@ "-v", "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc", "--dont-restore-color-profile-after-test", - "--build-revision", - "${got_revision}", "--test-machine-name", - "${buildername}" + "${buildername}", + "--git-revision", + "${got_revision}" ], "isolate_name": "telemetry_gpu_integration_test", "merge": { @@ -707,11 +707,11 @@ }, "name": "pixel_skia_gold_test", "precommit_args": [ - "--review-patch-issue", + "--gerrit-issue", "${patch_issue}", - "--review-patch-set", + "--gerrit-patchset", "${patch_set}", - "--buildbucket-build-id", + "--buildbucket-id", "${buildbucket_build_id}" ], "should_retry_with_patch": false, @@ -1095,10 +1095,10 @@ "-v", "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc", "--dont-restore-color-profile-after-test", - "--build-revision", - "${got_revision}", "--test-machine-name", - "${buildername}" + "${buildername}", + "--git-revision", + "${got_revision}" ], "isolate_name": "telemetry_gpu_integration_test", "merge": { @@ -1107,11 +1107,11 @@ }, "name": "maps_pixel_test", "precommit_args": [ - "--review-patch-issue", + "--gerrit-issue", "${patch_issue}", - "--review-patch-set", + "--gerrit-patchset", "${patch_set}", - "--buildbucket-build-id", + "--buildbucket-id", "${buildbucket_build_id}" ], "should_retry_with_patch": false, @@ -1138,10 +1138,10 @@ "-v", "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc", "--dont-restore-color-profile-after-test", - "--build-revision", - "${got_revision}", "--test-machine-name", - "${buildername}" + "${buildername}", + "--git-revision", + "${got_revision}" ], "isolate_name": "telemetry_gpu_integration_test", "merge": { @@ -1150,11 +1150,11 @@ }, "name": "pixel_skia_gold_test", "precommit_args": [ - "--review-patch-issue", + "--gerrit-issue", "${patch_issue}", - "--review-patch-set", + "--gerrit-patchset", "${patch_set}", - "--buildbucket-build-id", + "--buildbucket-id", "${buildbucket_build_id}" ], "should_retry_with_patch": false, @@ -1497,10 +1497,10 @@ "-v", "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc", "--dont-restore-color-profile-after-test", - "--build-revision", - "${got_revision}", "--test-machine-name", - "${buildername}" + "${buildername}", + "--git-revision", + "${got_revision}" ], "isolate_name": "telemetry_gpu_integration_test", "merge": { @@ -1509,11 +1509,11 @@ }, "name": "maps_pixel_test", "precommit_args": [ - "--review-patch-issue", + "--gerrit-issue", "${patch_issue}", - "--review-patch-set", + "--gerrit-patchset", "${patch_set}", - "--buildbucket-build-id", + "--buildbucket-id", "${buildbucket_build_id}" ], "should_retry_with_patch": false, @@ -1539,10 +1539,10 @@ "-v", "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc", "--dont-restore-color-profile-after-test", - "--build-revision", - "${got_revision}", "--test-machine-name", - "${buildername}" + "${buildername}", + "--git-revision", + "${got_revision}" ], "isolate_name": "telemetry_gpu_integration_test", "merge": { @@ -1551,11 +1551,11 @@ }, "name": "pixel_skia_gold_test", "precommit_args": [ - "--review-patch-issue", + "--gerrit-issue", "${patch_issue}", - "--review-patch-set", + "--gerrit-patchset", "${patch_set}", - "--buildbucket-build-id", + "--buildbucket-id", "${buildbucket_build_id}" ], "should_retry_with_patch": false, @@ -1920,10 +1920,10 @@ "-v", "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc", "--dont-restore-color-profile-after-test", - "--build-revision", - "${got_revision}", "--test-machine-name", - "${buildername}" + "${buildername}", + "--git-revision", + "${got_revision}" ], "isolate_name": "telemetry_gpu_integration_test", "merge": { @@ -1932,11 +1932,11 @@ }, "name": "maps_pixel_test", "precommit_args": [ - "--review-patch-issue", + "--gerrit-issue", "${patch_issue}", - "--review-patch-set", + "--gerrit-patchset", "${patch_set}", - "--buildbucket-build-id", + "--buildbucket-id", "${buildbucket_build_id}" ], "should_retry_with_patch": false, @@ -1962,10 +1962,10 @@ "-v", "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc", "--dont-restore-color-profile-after-test", - "--build-revision", - "${got_revision}", "--test-machine-name", - "${buildername}" + "${buildername}", + "--git-revision", + "${got_revision}" ], "isolate_name": "telemetry_gpu_integration_test", "merge": { @@ -1974,11 +1974,11 @@ }, "name": "pixel_skia_gold_test", "precommit_args": [ - "--review-patch-issue", + "--gerrit-issue", "${patch_issue}", - "--review-patch-set", + "--gerrit-patchset", "${patch_set}", - "--buildbucket-build-id", + "--buildbucket-id", "${buildbucket_build_id}" ], "should_retry_with_patch": false, @@ -2376,10 +2376,10 @@ "-v", "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc", "--dont-restore-color-profile-after-test", - "--build-revision", - "${got_revision}", "--test-machine-name", - "${buildername}" + "${buildername}", + "--git-revision", + "${got_revision}" ], "isolate_coverage_data": true, "isolate_name": "telemetry_gpu_integration_test", @@ -2389,11 +2389,11 @@ }, "name": "maps_pixel_test", "precommit_args": [ - "--review-patch-issue", + "--gerrit-issue", "${patch_issue}", - "--review-patch-set", + "--gerrit-patchset", "${patch_set}", - "--buildbucket-build-id", + "--buildbucket-id", "${buildbucket_build_id}" ], "should_retry_with_patch": false, @@ -2419,10 +2419,10 @@ "-v", "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc", "--dont-restore-color-profile-after-test", - "--build-revision", - "${got_revision}", "--test-machine-name", - "${buildername}" + "${buildername}", + "--git-revision", + "${got_revision}" ], "isolate_coverage_data": true, "isolate_name": "telemetry_gpu_integration_test", @@ -2432,11 +2432,11 @@ }, "name": "pixel_skia_gold_test", "precommit_args": [ - "--review-patch-issue", + "--gerrit-issue", "${patch_issue}", - "--review-patch-set", + "--gerrit-patchset", "${patch_set}", - "--buildbucket-build-id", + "--buildbucket-id", "${buildbucket_build_id}" ], "should_retry_with_patch": false, @@ -2819,10 +2819,10 @@ "-v", "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc", "--dont-restore-color-profile-after-test", - "--build-revision", - "${got_revision}", "--test-machine-name", - "${buildername}" + "${buildername}", + "--git-revision", + "${got_revision}" ], "isolate_name": "telemetry_gpu_integration_test", "merge": { @@ -2831,11 +2831,11 @@ }, "name": "maps_pixel_test", "precommit_args": [ - "--review-patch-issue", + "--gerrit-issue", "${patch_issue}", - "--review-patch-set", + "--gerrit-patchset", "${patch_set}", - "--buildbucket-build-id", + "--buildbucket-id", "${buildbucket_build_id}" ], "should_retry_with_patch": false, @@ -2863,10 +2863,10 @@ "-v", "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc", "--dont-restore-color-profile-after-test", - "--build-revision", - "${got_revision}", "--test-machine-name", - "${buildername}" + "${buildername}", + "--git-revision", + "${got_revision}" ], "isolate_name": "telemetry_gpu_integration_test", "merge": { @@ -2875,11 +2875,11 @@ }, "name": "pixel_skia_gold_test", "precommit_args": [ - "--review-patch-issue", + "--gerrit-issue", "${patch_issue}", - "--review-patch-set", + "--gerrit-patchset", "${patch_set}", - "--buildbucket-build-id", + "--buildbucket-id", "${buildbucket_build_id}" ], "should_retry_with_patch": false, @@ -3270,10 +3270,10 @@ "-v", "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc", "--dont-restore-color-profile-after-test", - "--build-revision", - "${got_revision}", "--test-machine-name", - "${buildername}" + "${buildername}", + "--git-revision", + "${got_revision}" ], "isolate_name": "telemetry_gpu_integration_test", "merge": { @@ -3282,11 +3282,11 @@ }, "name": "maps_pixel_test", "precommit_args": [ - "--review-patch-issue", + "--gerrit-issue", "${patch_issue}", - "--review-patch-set", + "--gerrit-patchset", "${patch_set}", - "--buildbucket-build-id", + "--buildbucket-id", "${buildbucket_build_id}" ], "should_retry_with_patch": false, @@ -3314,10 +3314,10 @@ "-v", "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc", "--dont-restore-color-profile-after-test", - "--build-revision", - "${got_revision}", "--test-machine-name", - "${buildername}" + "${buildername}", + "--git-revision", + "${got_revision}" ], "isolate_name": "telemetry_gpu_integration_test", "merge": { @@ -3326,11 +3326,11 @@ }, "name": "pixel_skia_gold_test", "precommit_args": [ - "--review-patch-issue", + "--gerrit-issue", "${patch_issue}", - "--review-patch-set", + "--gerrit-patchset", "${patch_set}", - "--buildbucket-build-id", + "--buildbucket-id", "${buildbucket_build_id}" ], "should_retry_with_patch": false, @@ -3756,10 +3756,10 @@ "-v", "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc", "--dont-restore-color-profile-after-test", - "--build-revision", - "${got_revision}", "--test-machine-name", - "${buildername}" + "${buildername}", + "--git-revision", + "${got_revision}" ], "isolate_coverage_data": true, "isolate_name": "telemetry_gpu_integration_test", @@ -3769,11 +3769,11 @@ }, "name": "maps_pixel_test", "precommit_args": [ - "--review-patch-issue", + "--gerrit-issue", "${patch_issue}", - "--review-patch-set", + "--gerrit-patchset", "${patch_set}", - "--buildbucket-build-id", + "--buildbucket-id", "${buildbucket_build_id}" ], "should_retry_with_patch": false, @@ -3801,10 +3801,10 @@ "-v", "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc", "--dont-restore-color-profile-after-test", - "--build-revision", - "${got_revision}", "--test-machine-name", - "${buildername}" + "${buildername}", + "--git-revision", + "${got_revision}" ], "isolate_coverage_data": true, "isolate_name": "telemetry_gpu_integration_test", @@ -3814,11 +3814,11 @@ }, "name": "pixel_skia_gold_test", "precommit_args": [ - "--review-patch-issue", + "--gerrit-issue", "${patch_issue}", - "--review-patch-set", + "--gerrit-patchset", "${patch_set}", - "--buildbucket-build-id", + "--buildbucket-id", "${buildbucket_build_id}" ], "should_retry_with_patch": false, @@ -4285,10 +4285,10 @@ "-v", "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc", "--dont-restore-color-profile-after-test", - "--build-revision", - "${got_revision}", "--test-machine-name", - "${buildername}" + "${buildername}", + "--git-revision", + "${got_revision}" ], "isolate_name": "telemetry_gpu_integration_test", "merge": { @@ -4297,11 +4297,11 @@ }, "name": "maps_pixel_test", "precommit_args": [ - "--review-patch-issue", + "--gerrit-issue", "${patch_issue}", - "--review-patch-set", + "--gerrit-patchset", "${patch_set}", - "--buildbucket-build-id", + "--buildbucket-id", "${buildbucket_build_id}" ], "should_retry_with_patch": false, @@ -4328,10 +4328,10 @@ "-v", "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc", "--dont-restore-color-profile-after-test", - "--build-revision", - "${got_revision}", "--test-machine-name", - "${buildername}" + "${buildername}", + "--git-revision", + "${got_revision}" ], "isolate_name": "telemetry_gpu_integration_test", "merge": { @@ -4340,11 +4340,11 @@ }, "name": "pixel_skia_gold_test", "precommit_args": [ - "--review-patch-issue", + "--gerrit-issue", "${patch_issue}", - "--review-patch-set", + "--gerrit-patchset", "${patch_set}", - "--buildbucket-build-id", + "--buildbucket-id", "${buildbucket_build_id}" ], "should_retry_with_patch": false, @@ -4876,10 +4876,10 @@ "-v", "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc", "--dont-restore-color-profile-after-test", - "--build-revision", - "${got_revision}", "--test-machine-name", - "${buildername}" + "${buildername}", + "--git-revision", + "${got_revision}" ], "isolate_name": "telemetry_gpu_integration_test", "merge": { @@ -4888,11 +4888,11 @@ }, "name": "maps_pixel_test", "precommit_args": [ - "--review-patch-issue", + "--gerrit-issue", "${patch_issue}", - "--review-patch-set", + "--gerrit-patchset", "${patch_set}", - "--buildbucket-build-id", + "--buildbucket-id", "${buildbucket_build_id}" ], "should_retry_with_patch": false, @@ -4928,10 +4928,10 @@ "-v", "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc", "--dont-restore-color-profile-after-test", - "--build-revision", - "${got_revision}", "--test-machine-name", - "${buildername}" + "${buildername}", + "--git-revision", + "${got_revision}" ], "isolate_name": "telemetry_gpu_integration_test", "merge": { @@ -4940,11 +4940,11 @@ }, "name": "pixel_skia_gold_test", "precommit_args": [ - "--review-patch-issue", + "--gerrit-issue", "${patch_issue}", - "--review-patch-set", + "--gerrit-patchset", "${patch_set}", - "--buildbucket-build-id", + "--buildbucket-id", "${buildbucket_build_id}" ], "should_retry_with_patch": false, @@ -5559,10 +5559,10 @@ "-v", "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc", "--dont-restore-color-profile-after-test", - "--build-revision", - "${got_revision}", "--test-machine-name", - "${buildername}" + "${buildername}", + "--git-revision", + "${got_revision}" ], "isolate_coverage_data": true, "isolate_name": "telemetry_gpu_integration_test", @@ -5572,11 +5572,11 @@ }, "name": "maps_pixel_test", "precommit_args": [ - "--review-patch-issue", + "--gerrit-issue", "${patch_issue}", - "--review-patch-set", + "--gerrit-patchset", "${patch_set}", - "--buildbucket-build-id", + "--buildbucket-id", "${buildbucket_build_id}" ], "should_retry_with_patch": false, @@ -5612,10 +5612,10 @@ "-v", "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc", "--dont-restore-color-profile-after-test", - "--build-revision", - "${got_revision}", "--test-machine-name", - "${buildername}" + "${buildername}", + "--git-revision", + "${got_revision}" ], "isolate_coverage_data": true, "isolate_name": "telemetry_gpu_integration_test", @@ -5625,11 +5625,11 @@ }, "name": "pixel_skia_gold_test", "precommit_args": [ - "--review-patch-issue", + "--gerrit-issue", "${patch_issue}", - "--review-patch-set", + "--gerrit-patchset", "${patch_set}", - "--buildbucket-build-id", + "--buildbucket-id", "${buildbucket_build_id}" ], "should_retry_with_patch": false,
diff --git a/testing/buildbot/chromium.linux.json b/testing/buildbot/chromium.linux.json index 748a8d2..40d58abf 100644 --- a/testing/buildbot/chromium.linux.json +++ b/testing/buildbot/chromium.linux.json
@@ -2693,7 +2693,7 @@ "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" }, - "name": "headless_content_unittests", + "name": "content_unittests_headless", "swarming": { "can_use_on_swarming_builders": true, "dimension_sets": [ @@ -2711,11 +2711,11 @@ "--no-xvfb", "--ozone-platform=headless" ], - "experiment_percentage": 100, "merge": { "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" }, + "name": "events_unittests_headless", "swarming": { "can_use_on_swarming_builders": true, "dimension_sets": [ @@ -2737,6 +2737,7 @@ "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" }, + "name": "ozone_unittests_headless", "swarming": { "can_use_on_swarming_builders": true, "dimension_sets": [ @@ -2758,6 +2759,7 @@ "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" }, + "name": "services_unittests_headless", "swarming": { "can_use_on_swarming_builders": true, "dimension_sets": [ @@ -2784,6 +2786,7 @@ "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" }, + "name": "accessibility_unittests_wayland", "swarming": { "can_use_on_swarming_builders": true, "dimension_sets": [ @@ -2806,6 +2809,7 @@ "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" }, + "name": "aura_unittests_wayland", "swarming": { "can_use_on_swarming_builders": true, "dimension_sets": [ @@ -2828,6 +2832,7 @@ "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" }, + "name": "content_unittests_wayland", "swarming": { "can_use_on_swarming_builders": true, "dimension_sets": [ @@ -2850,6 +2855,7 @@ "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" }, + "name": "events_unittests_wayland", "swarming": { "can_use_on_swarming_builders": true, "dimension_sets": [ @@ -2872,6 +2878,7 @@ "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" }, + "name": "gpu_unittests_wayland", "swarming": { "can_use_on_swarming_builders": true, "dimension_sets": [ @@ -2894,6 +2901,7 @@ "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" }, + "name": "ui_touch_selection_unittests_wayland", "swarming": { "can_use_on_swarming_builders": true, "dimension_sets": [ @@ -2908,16 +2916,16 @@ }, { "args": [ - "--test-launcher-filter-file=../../testing/buildbot/filters/ozone-linux.wayland_views_unittests.filter", "--no-xvfb", "--use-weston", - "--ozone-platform=wayland" + "--ozone-platform=wayland", + "--test-launcher-filter-file=../../testing/buildbot/filters/ozone-linux.wayland_views_unittests.filter" ], "merge": { "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" }, - "name": "wayland_views_unittests", + "name": "views_unittests_wayland", "swarming": { "can_use_on_swarming_builders": true, "dimension_sets": [ @@ -2942,6 +2950,7 @@ "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" }, + "name": "accessibility_unittests_x11", "swarming": { "can_use_on_swarming_builders": true, "dimension_sets": [ @@ -2962,6 +2971,7 @@ "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" }, + "name": "aura_unittests_x11", "swarming": { "can_use_on_swarming_builders": true, "dimension_sets": [ @@ -2982,6 +2992,7 @@ "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" }, + "name": "content_unittests_x11", "swarming": { "can_use_on_swarming_builders": true, "dimension_sets": [ @@ -3002,6 +3013,7 @@ "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" }, + "name": "events_unittests_x11", "swarming": { "can_use_on_swarming_builders": true, "dimension_sets": [ @@ -3022,6 +3034,7 @@ "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" }, + "name": "gpu_unittests_x11", "swarming": { "can_use_on_swarming_builders": true, "dimension_sets": [ @@ -3042,6 +3055,7 @@ "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" }, + "name": "ozone_x11_unittests_x11", "swarming": { "can_use_on_swarming_builders": true, "dimension_sets": [ @@ -3062,6 +3076,7 @@ "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" }, + "name": "ui_touch_selection_unittests_x11", "swarming": { "can_use_on_swarming_builders": true, "dimension_sets": [ @@ -3076,13 +3091,14 @@ }, { "args": [ - "--test-launcher-filter-file=../../testing/buildbot/filters/ozone-linux.x11_views_unittests.filter", - "--ozone-platform=x11" + "--ozone-platform=x11", + "--test-launcher-filter-file=../../testing/buildbot/filters/ozone-linux.x11_views_unittests.filter" ], "merge": { "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" }, + "name": "views_unittests_x11", "swarming": { "can_use_on_swarming_builders": true, "dimension_sets": [
diff --git a/testing/buildbot/chromium.win.json b/testing/buildbot/chromium.win.json index cb4e2ac..ff42b26 100644 --- a/testing/buildbot/chromium.win.json +++ b/testing/buildbot/chromium.win.json
@@ -1739,11 +1739,12 @@ }, { "args": [ - "--build-revision=${got_revision}", "--test-launcher-filter-file=../../testing/buildbot/filters/pixel_browser_tests.filter", "--browser-ui-tests-verify-pixels", "--test-launcher-retry-limit=0", - "--enable-pixel-output-in-tests" + "--enable-pixel-output-in-tests", + "--git-revision", + "${got_revision}" ], "experiment_percentage": 100, "merge": { @@ -1752,9 +1753,12 @@ }, "name": "pixel_browser_tests", "precommit_args": [ - "--issue=${patch_issue}", - "--patchset=${patch_set}", - "--jobid=${buildbucket_build_id}" + "--gerrit-issue", + "${patch_issue}", + "--gerrit-patchset", + "${patch_set}", + "--buildbucket-id", + "${buildbucket_build_id}" ], "swarming": { "can_use_on_swarming_builders": true,
diff --git a/testing/buildbot/client.v8.fyi.json b/testing/buildbot/client.v8.fyi.json index 440ce56..1eb9c95 100644 --- a/testing/buildbot/client.v8.fyi.json +++ b/testing/buildbot/client.v8.fyi.json
@@ -132,10 +132,10 @@ "-v", "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc", "--dont-restore-color-profile-after-test", - "--build-revision", - "${got_cr_revision}", "--test-machine-name", - "${buildername}" + "${buildername}", + "--git-revision", + "${got_cr_revision}" ], "isolate_name": "telemetry_gpu_integration_test", "merge": { @@ -144,11 +144,11 @@ }, "name": "maps_pixel_test", "precommit_args": [ - "--review-patch-issue", + "--gerrit-issue", "${patch_issue}", - "--review-patch-set", + "--gerrit-patchset", "${patch_set}", - "--buildbucket-build-id", + "--buildbucket-id", "${buildbucket_build_id}" ], "should_retry_with_patch": false, @@ -175,10 +175,10 @@ "-v", "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc", "--dont-restore-color-profile-after-test", - "--build-revision", - "${got_cr_revision}", "--test-machine-name", - "${buildername}" + "${buildername}", + "--git-revision", + "${got_cr_revision}" ], "isolate_name": "telemetry_gpu_integration_test", "merge": { @@ -187,11 +187,11 @@ }, "name": "pixel_skia_gold_test", "precommit_args": [ - "--review-patch-issue", + "--gerrit-issue", "${patch_issue}", - "--review-patch-set", + "--gerrit-patchset", "${patch_set}", - "--buildbucket-build-id", + "--buildbucket-id", "${buildbucket_build_id}" ], "should_retry_with_patch": false, @@ -463,10 +463,10 @@ "-v", "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc", "--dont-restore-color-profile-after-test", - "--build-revision", - "${got_cr_revision}", "--test-machine-name", - "${buildername}" + "${buildername}", + "--git-revision", + "${got_cr_revision}" ], "isolate_name": "telemetry_gpu_integration_test", "merge": { @@ -475,11 +475,11 @@ }, "name": "maps_pixel_test", "precommit_args": [ - "--review-patch-issue", + "--gerrit-issue", "${patch_issue}", - "--review-patch-set", + "--gerrit-patchset", "${patch_set}", - "--buildbucket-build-id", + "--buildbucket-id", "${buildbucket_build_id}" ], "should_retry_with_patch": false, @@ -505,10 +505,10 @@ "-v", "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc", "--dont-restore-color-profile-after-test", - "--build-revision", - "${got_cr_revision}", "--test-machine-name", - "${buildername}" + "${buildername}", + "--git-revision", + "${got_cr_revision}" ], "isolate_name": "telemetry_gpu_integration_test", "merge": { @@ -517,11 +517,11 @@ }, "name": "pixel_skia_gold_test", "precommit_args": [ - "--review-patch-issue", + "--gerrit-issue", "${patch_issue}", - "--review-patch-set", + "--gerrit-patchset", "${patch_set}", - "--buildbucket-build-id", + "--buildbucket-id", "${buildbucket_build_id}" ], "should_retry_with_patch": false, @@ -789,10 +789,10 @@ "-v", "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc", "--dont-restore-color-profile-after-test", - "--build-revision", - "${got_cr_revision}", "--test-machine-name", - "${buildername}" + "${buildername}", + "--git-revision", + "${got_cr_revision}" ], "isolate_name": "telemetry_gpu_integration_test", "merge": { @@ -801,11 +801,11 @@ }, "name": "maps_pixel_test", "precommit_args": [ - "--review-patch-issue", + "--gerrit-issue", "${patch_issue}", - "--review-patch-set", + "--gerrit-patchset", "${patch_set}", - "--buildbucket-build-id", + "--buildbucket-id", "${buildbucket_build_id}" ], "should_retry_with_patch": false, @@ -831,10 +831,10 @@ "-v", "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc", "--dont-restore-color-profile-after-test", - "--build-revision", - "${got_cr_revision}", "--test-machine-name", - "${buildername}" + "${buildername}", + "--git-revision", + "${got_cr_revision}" ], "isolate_name": "telemetry_gpu_integration_test", "merge": { @@ -843,11 +843,11 @@ }, "name": "pixel_skia_gold_test", "precommit_args": [ - "--review-patch-issue", + "--gerrit-issue", "${patch_issue}", - "--review-patch-set", + "--gerrit-patchset", "${patch_set}", - "--buildbucket-build-id", + "--buildbucket-id", "${buildbucket_build_id}" ], "should_retry_with_patch": false, @@ -1111,10 +1111,10 @@ "-v", "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc", "--dont-restore-color-profile-after-test", - "--build-revision", - "${got_cr_revision}", "--test-machine-name", - "${buildername}" + "${buildername}", + "--git-revision", + "${got_cr_revision}" ], "isolate_name": "telemetry_gpu_integration_test", "merge": { @@ -1123,11 +1123,11 @@ }, "name": "maps_pixel_test", "precommit_args": [ - "--review-patch-issue", + "--gerrit-issue", "${patch_issue}", - "--review-patch-set", + "--gerrit-patchset", "${patch_set}", - "--buildbucket-build-id", + "--buildbucket-id", "${buildbucket_build_id}" ], "should_retry_with_patch": false, @@ -1152,10 +1152,10 @@ "-v", "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc", "--dont-restore-color-profile-after-test", - "--build-revision", - "${got_cr_revision}", "--test-machine-name", - "${buildername}" + "${buildername}", + "--git-revision", + "${got_cr_revision}" ], "isolate_name": "telemetry_gpu_integration_test", "merge": { @@ -1164,11 +1164,11 @@ }, "name": "pixel_skia_gold_test", "precommit_args": [ - "--review-patch-issue", + "--gerrit-issue", "${patch_issue}", - "--review-patch-set", + "--gerrit-patchset", "${patch_set}", - "--buildbucket-build-id", + "--buildbucket-id", "${buildbucket_build_id}" ], "should_retry_with_patch": false, @@ -1779,10 +1779,10 @@ "-v", "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc", "--dont-restore-color-profile-after-test", - "--build-revision", - "${got_cr_revision}", "--test-machine-name", - "${buildername}" + "${buildername}", + "--git-revision", + "${got_cr_revision}" ], "isolate_name": "telemetry_gpu_integration_test", "merge": { @@ -1791,11 +1791,11 @@ }, "name": "maps_pixel_test", "precommit_args": [ - "--review-patch-issue", + "--gerrit-issue", "${patch_issue}", - "--review-patch-set", + "--gerrit-patchset", "${patch_set}", - "--buildbucket-build-id", + "--buildbucket-id", "${buildbucket_build_id}" ], "should_retry_with_patch": false, @@ -1821,10 +1821,10 @@ "-v", "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc", "--dont-restore-color-profile-after-test", - "--build-revision", - "${got_cr_revision}", "--test-machine-name", - "${buildername}" + "${buildername}", + "--git-revision", + "${got_cr_revision}" ], "isolate_name": "telemetry_gpu_integration_test", "merge": { @@ -1833,11 +1833,11 @@ }, "name": "pixel_skia_gold_test", "precommit_args": [ - "--review-patch-issue", + "--gerrit-issue", "${patch_issue}", - "--review-patch-set", + "--gerrit-patchset", "${patch_set}", - "--buildbucket-build-id", + "--buildbucket-id", "${buildbucket_build_id}" ], "should_retry_with_patch": false,
diff --git a/testing/buildbot/gn_isolate_map.pyl b/testing/buildbot/gn_isolate_map.pyl index 36f13857..3388e83 100644 --- a/testing/buildbot/gn_isolate_map.pyl +++ b/testing/buildbot/gn_isolate_map.pyl
@@ -1726,7 +1726,8 @@ }, "upload_trace_processor": { "label": "//tools/perf/core/perfetto_binary_roller:upload_trace_processor", - "type": "raw", + "type": "generated_script", + "script": "upload_trace_processor", }, "url_unittests": { "label": "//url:url_unittests",
diff --git a/testing/buildbot/mixins.pyl b/testing/buildbot/mixins.pyl index ff5db41..c8475ed 100644 --- a/testing/buildbot/mixins.pyl +++ b/testing/buildbot/mixins.pyl
@@ -630,6 +630,18 @@ }, }, }, + 'skia_gold_test': { + '$mixin_append': { + 'args': [ + '--git-revision', '${got_revision}', + ], + 'precommit_args': [ + '--gerrit-issue', '${patch_issue}', + '--gerrit-patchset', '${patch_set}', + '--buildbucket-id', '${buildbucket_build_id}', + ], + } + }, 'swarming_containment_auto': { 'swarming': { 'containment_type': 'AUTO',
diff --git a/testing/buildbot/test_suite_exceptions.pyl b/testing/buildbot/test_suite_exceptions.pyl index 5b654b0..ecfbd4a7 100644 --- a/testing/buildbot/test_suite_exceptions.pyl +++ b/testing/buildbot/test_suite_exceptions.pyl
@@ -1280,27 +1280,27 @@ # use ${got_cr_revision}, which is only set on the V8 bots. 'Android V8 FYI Release (Nexus 5X)': { 'args': { - '--build-revision': '${got_cr_revision}', + '--git-revision': '${got_cr_revision}', }, }, 'Linux V8 FYI Release (NVIDIA)': { 'args': { - '--build-revision': '${got_cr_revision}', + '--git-revision': '${got_cr_revision}', }, }, 'Linux V8 FYI Release - pointer compression (NVIDIA)': { 'args': { - '--build-revision': '${got_cr_revision}', + '--git-revision': '${got_cr_revision}', }, }, 'Mac V8 FYI Release (Intel)': { 'args': { - '--build-revision': '${got_cr_revision}', + '--git-revision': '${got_cr_revision}', }, }, 'Win V8 FYI Release (NVIDIA)': { 'args': { - '--build-revision': '${got_cr_revision}', + '--git-revision': '${got_cr_revision}', }, }, }, @@ -1876,27 +1876,27 @@ # use ${got_cr_revision}, which is only set on the V8 bots. 'Android V8 FYI Release (Nexus 5X)': { 'args': { - '--build-revision': '${got_cr_revision}', + '--git-revision': '${got_cr_revision}', }, }, 'Linux V8 FYI Release (NVIDIA)': { 'args': { - '--build-revision': '${got_cr_revision}', + '--git-revision': '${got_cr_revision}', }, }, 'Linux V8 FYI Release - pointer compression (NVIDIA)': { 'args': { - '--build-revision': '${got_cr_revision}', + '--git-revision': '${got_cr_revision}', }, }, 'Mac V8 FYI Release (Intel)': { 'args': { - '--build-revision': '${got_cr_revision}', + '--git-revision': '${got_cr_revision}', }, }, 'Win V8 FYI Release (NVIDIA)': { 'args': { - '--build-revision': '${got_cr_revision}', + '--git-revision': '${got_cr_revision}', }, }, }, @@ -2239,6 +2239,24 @@ 'Win10 FYI x64 Exp Release (Intel HD 630)', ], }, + 'views_unittests_wayland': { + 'modifications': { + 'Linux Ozone Tester (Wayland)': { + 'args': [ + '--test-launcher-filter-file=../../testing/buildbot/filters/ozone-linux.wayland_views_unittests.filter', + ], + }, + }, + }, + 'views_unittests_x11': { + 'modifications': { + 'Linux Ozone Tester (X11)': { + 'args': [ + '--test-launcher-filter-file=../../testing/buildbot/filters/ozone-linux.x11_views_unittests.filter', + ], + }, + }, + }, 'viz_unittests': { 'modifications': { 'android-marshmallow-x86-fyi-rel': {
diff --git a/testing/buildbot/test_suites.pyl b/testing/buildbot/test_suites.pyl index 2e424658f..f248c93 100644 --- a/testing/buildbot/test_suites.pyl +++ b/testing/buildbot/test_suites.pyl
@@ -40,14 +40,11 @@ '--shared-prefs-file=//chrome/android/shared_preference_files/test/vr_ddview_skipdon_setupcomplete.json', '--replace-system-package=com.google.vr.vrcore,//third_party/gvr-android-sdk/test-apks/vr_services/vr_services_current.apk', '--additional-apk=//third_party/gvr-android-sdk/test-apks/vr_keyboard/vr_keyboard_current.apk', - '--git-revision', '${got_revision}', ], - 'precommit_args': [ - '--gerrit-issue', '${patch_issue}', - '--gerrit-patchset', '${patch_set}', - '--buildbucket-id', '${buildbucket_build_id}', + 'mixins': [ + 'chrome-gold-service-account', + 'skia_gold_test', ], - 'mixins': ['chrome-gold-service-account'], 'swarming': { 'shards': 4, }, @@ -193,23 +190,13 @@ 'name': 'android_webview_pixel_skia_gold_test', 'args': [ '--dont-restore-color-profile-after-test', - '--build-revision', - '${got_revision}', '--test-machine-name', '${buildername}', ], - 'precommit_args': [ - # Gerrit issue ID - '--review-patch-issue', - '${patch_issue}', - # Patch set number - '--review-patch-set', - '${patch_set}', - # Buildbucket ID - '--buildbucket-build-id', - '${buildbucket_build_id}', + 'mixins': [ + 'chrome-gpu-gold-service-account', + 'skia_gold_test', ], - 'mixins': ['chrome-gpu-gold-service-account'], 'telemetry_test_name': 'pixel', }, }, @@ -2193,47 +2180,27 @@ 'name': 'gl_renderer_maps_pixel_tests', 'args': [ '--dont-restore-color-profile-after-test', - '--build-revision', - '${got_revision}', '--test-machine-name', '${buildername}', '--extra-browser-args=--disable-features=UseSkiaRenderer', ], - 'precommit_args': [ - # Gerrit issue ID - '--review-patch-issue', - '${patch_issue}', - # Patch set number - '--review-patch-set', - '${patch_set}', - # Buildbucket ID - '--buildbucket-build-id', - '${buildbucket_build_id}', + 'mixins': [ + 'chrome-gpu-gold-service-account', + 'skia_gold_test', ], - 'mixins': ['chrome-gpu-gold-service-account'], }, 'pixel': { 'name': 'gl_renderer_pixel_skia_gold_tests', 'args': [ '--dont-restore-color-profile-after-test', - '--build-revision', - '${got_revision}', '--test-machine-name', '${buildername}', '--extra-browser-args=--disable-features=UseSkiaRenderer', ], - 'precommit_args': [ - # Gerrit issue ID - '--review-patch-issue', - '${patch_issue}', - # Patch set number - '--review-patch-set', - '${patch_set}', - # Buildbucket ID - '--buildbucket-build-id', - '${buildbucket_build_id}', + 'mixins': [ + 'chrome-gpu-gold-service-account', + 'skia_gold_test', ], - 'mixins': ['chrome-gpu-gold-service-account'], }, 'screenshot_sync': { 'name': 'gl_renderer_screenshot_sync_tests', @@ -2316,24 +2283,14 @@ 'name': 'egl_pixel_skia_gold_test', 'args': [ '--dont-restore-color-profile-after-test', - '--build-revision', - '${got_revision}', '--test-machine-name', '${buildername}', '--extra-browser-args=--enable-features=UseSkiaRenderer --use-gl=egl --enable-gpu-rasterization --force-gpu-rasterization --enable-oop-rasterization --disable-software-compositing-fallback --disable-headless-mode', ], - 'precommit_args': [ - # Gerrit issue ID - '--review-patch-issue', - '${patch_issue}', - # Patch set number - '--review-patch-set', - '${patch_set}', - # Buildbucket ID - '--buildbucket-build-id', - '${buildbucket_build_id}', + 'mixins': [ + 'chrome-gpu-gold-service-account', + 'skia_gold_test', ], - 'mixins': ['chrome-gpu-gold-service-account'], 'telemetry_test_name': 'pixel', }, }, @@ -2364,24 +2321,14 @@ 'name': 'maps_pixel_test', 'args': [ '--dont-restore-color-profile-after-test', - '--build-revision', - '${got_revision}', '--test-machine-name', '${buildername}', '--extra-browser-args=--enable-features=UseSkiaRenderer', ], - 'precommit_args': [ - # Gerrit issue ID - '--review-patch-issue', - '${patch_issue}', - # Patch set number - '--review-patch-set', - '${patch_set}', - # Buildbucket ID - '--buildbucket-build-id', - '${buildbucket_build_id}', + 'mixins': [ + 'chrome-gpu-gold-service-account', + 'skia_gold_test', ], - 'mixins': ['chrome-gpu-gold-service-account'], }, 'screenshot_sync': { 'args': [ @@ -2393,24 +2340,14 @@ 'name': 'skia_renderer_pixel_skia_gold_test', 'args': [ '--dont-restore-color-profile-after-test', - '--build-revision', - '${got_revision}', '--test-machine-name', '${buildername}', '--extra-browser-args=--enable-features=UseSkiaRenderer', ], - 'precommit_args': [ - # Gerrit issue ID - '--review-patch-issue', - '${patch_issue}', - # Patch set number - '--review-patch-set', - '${patch_set}', - # Buildbucket ID - '--buildbucket-build-id', - '${buildbucket_build_id}', + 'mixins': [ + 'chrome-gpu-gold-service-account', + 'skia_gold_test', ], - 'mixins': ['chrome-gpu-gold-service-account'], 'telemetry_test_name': 'pixel', }, }, @@ -2438,24 +2375,14 @@ 'name': 'vulkan_pixel_skia_gold_test', 'args': [ '--dont-restore-color-profile-after-test', - '--build-revision', - '${got_revision}', '--test-machine-name', '${buildername}', '--extra-browser-args=--use-vulkan=native --disable-vulkan-fallback-to-gl-for-testing --enable-features=UseSkiaRenderer,Vulkan --use-cmd-decoder=validating', ], - 'precommit_args': [ - # Gerrit issue ID - '--review-patch-issue', - '${patch_issue}', - # Patch set number - '--review-patch-set', - '${patch_set}', - # Buildbucket ID - '--buildbucket-build-id', - '${buildbucket_build_id}', + 'mixins': [ + 'chrome-gpu-gold-service-account', + 'skia_gold_test', ], - 'mixins': ['chrome-gpu-gold-service-account'], 'telemetry_test_name': 'pixel', }, }, @@ -2476,45 +2403,25 @@ 'name': 'maps_pixel_test', 'args': [ '--dont-restore-color-profile-after-test', - '--build-revision', - '${got_revision}', '--test-machine-name', '${buildername}', ], - 'precommit_args': [ - # Gerrit issue ID - '--review-patch-issue', - '${patch_issue}', - # Patch set number - '--review-patch-set', - '${patch_set}', - # Buildbucket ID - '--buildbucket-build-id', - '${buildbucket_build_id}', + 'mixins': [ + 'chrome-gpu-gold-service-account', + 'skia_gold_test', ], - 'mixins': ['chrome-gpu-gold-service-account'], }, 'pixel_skia': { 'name': 'pixel_skia_gold_test', 'args': [ '--dont-restore-color-profile-after-test', - '--build-revision', - '${got_revision}', '--test-machine-name', '${buildername}', ], - 'precommit_args': [ - # Gerrit issue ID - '--review-patch-issue', - '${patch_issue}', - # Patch set number - '--review-patch-set', - '${patch_set}', - # Buildbucket ID - '--buildbucket-build-id', - '${buildbucket_build_id}', + 'mixins': [ + 'chrome-gpu-gold-service-account', + 'skia_gold_test', ], - 'mixins': ['chrome-gpu-gold-service-account'], 'telemetry_test_name': 'pixel', }, 'screenshot_sync': { @@ -2925,6 +2832,28 @@ 'sandbox_linux_unittests': {}, }, + 'linux_ozone_common_gtests': { + 'content_unittests': {}, + 'events_unittests': {}, + }, + + 'linux_ozone_headless_only_gtests': { + 'ozone_unittests': {}, + 'services_unittests': {}, + }, + + 'linux_ozone_wayland_and_x11_gtests': { + 'accessibility_unittests': {}, + 'aura_unittests': {}, + 'gpu_unittests': {}, + 'ui_touch_selection_unittests': {}, + 'views_unittests': {} + }, + + 'linux_ozone_x11_only_gtests': { + 'ozone_x11_unittests': {}, + }, + 'linux_specific_chromium_isolated_scripts': { 'not_site_per_process_blink_web_tests': { # not_site_per_process_blink_web_tests provides coverage for @@ -3193,49 +3122,6 @@ }, }, - 'ozone_linux_gtests_headless': { - 'events_unittests': { - 'experiment_percentage': 100, - }, - 'headless_content_unittests': { - # TODO(https://crbug.com/106023): Use variants to uniquify the test - # name instead of manually prepending "headless_". - 'test': 'content_unittests', - }, - 'ozone_unittests': {}, - 'services_unittests': {}, - }, - - 'ozone_linux_gtests_wayland': { - 'accessibility_unittests': {}, - 'aura_unittests': {}, - 'content_unittests': {}, - 'events_unittests': {}, - 'gpu_unittests': {}, - 'ui_touch_selection_unittests': {}, - 'wayland_views_unittests': { - 'args': [ - '--test-launcher-filter-file=../../testing/buildbot/filters/ozone-linux.wayland_views_unittests.filter', - ], - 'test': 'views_unittests', - } - }, - - 'ozone_linux_gtests_x11': { - 'accessibility_unittests': {}, - 'aura_unittests': {}, - 'content_unittests': {}, - 'events_unittests': {}, - 'gpu_unittests': {}, - 'ozone_x11_unittests': {}, - 'ui_touch_selection_unittests': {}, - 'views_unittests': { - 'args': [ - '--test-launcher-filter-file=../../testing/buildbot/filters/ozone-linux.x11_views_unittests.filter', - ], - } - }, - 'performance_smoke_test_isolated_scripts': { 'performance_test_suite': { 'args': [ @@ -3259,7 +3145,6 @@ 'pixel_browser_tests': { 'name': 'pixel_browser_tests', 'args': [ - '--build-revision=${got_revision}', '--test-launcher-filter-file=../../testing/buildbot/filters/pixel_browser_tests.filter', '--browser-ui-tests-verify-pixels', # Do not allow retry or it will break the bulk approval process. @@ -3269,14 +3154,12 @@ '--test-launcher-retry-limit=0', '--enable-pixel-output-in-tests', ], - 'precommit_args': [ - '--issue=${patch_issue}', - '--patchset=${patch_set}', - '--jobid=${buildbucket_build_id}', - ], 'experiment_percentage': 100, 'test': 'browser_tests', - 'mixins': ['chrome-gold-service-account'], + 'mixins': [ + 'chrome-gold-service-account', + 'skia_gold_test', + ], }, }, @@ -4874,5 +4757,49 @@ ] }, }, + + 'linux_ozone_headless_tests': { + 'linux_ozone_headless_only_gtests': { + 'variants': [ + 'OZONE_HEADLESS', + ] + }, + 'linux_ozone_common_gtests': { + 'variants': [ + 'OZONE_HEADLESS', + ] + }, + }, + + 'linux_ozone_wayland_tests': { + 'linux_ozone_wayland_and_x11_gtests': { + 'variants': [ + 'OZONE_WAYLAND', + ] + }, + 'linux_ozone_common_gtests': { + 'variants': [ + 'OZONE_WAYLAND', + ] + }, + }, + + 'linux_ozone_x11_tests': { + 'linux_ozone_x11_only_gtests': { + 'variants': [ + 'OZONE_X11', + ] + }, + 'linux_ozone_wayland_and_x11_gtests': { + 'variants': [ + 'OZONE_X11', + ] + }, + 'linux_ozone_common_gtests': { + 'variants': [ + 'OZONE_X11', + ] + }, + }, } }
diff --git a/testing/buildbot/v8.ci.json b/testing/buildbot/v8.ci.json index 03c1b98b..dfaae979 100644 --- a/testing/buildbot/v8.ci.json +++ b/testing/buildbot/v8.ci.json
@@ -132,10 +132,10 @@ "-v", "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc", "--dont-restore-color-profile-after-test", - "--build-revision", - "${got_cr_revision}", "--test-machine-name", - "${buildername}" + "${buildername}", + "--git-revision", + "${got_cr_revision}" ], "isolate_name": "telemetry_gpu_integration_test", "merge": { @@ -144,11 +144,11 @@ }, "name": "maps_pixel_test", "precommit_args": [ - "--review-patch-issue", + "--gerrit-issue", "${patch_issue}", - "--review-patch-set", + "--gerrit-patchset", "${patch_set}", - "--buildbucket-build-id", + "--buildbucket-id", "${buildbucket_build_id}" ], "should_retry_with_patch": false, @@ -175,10 +175,10 @@ "-v", "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc", "--dont-restore-color-profile-after-test", - "--build-revision", - "${got_cr_revision}", "--test-machine-name", - "${buildername}" + "${buildername}", + "--git-revision", + "${got_cr_revision}" ], "isolate_name": "telemetry_gpu_integration_test", "merge": { @@ -187,11 +187,11 @@ }, "name": "pixel_skia_gold_test", "precommit_args": [ - "--review-patch-issue", + "--gerrit-issue", "${patch_issue}", - "--review-patch-set", + "--gerrit-patchset", "${patch_set}", - "--buildbucket-build-id", + "--buildbucket-id", "${buildbucket_build_id}" ], "should_retry_with_patch": false, @@ -1609,10 +1609,10 @@ "-v", "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc", "--dont-restore-color-profile-after-test", - "--build-revision", - "${got_cr_revision}", "--test-machine-name", - "${buildername}" + "${buildername}", + "--git-revision", + "${got_cr_revision}" ], "isolate_name": "telemetry_gpu_integration_test", "merge": { @@ -1621,11 +1621,11 @@ }, "name": "maps_pixel_test", "precommit_args": [ - "--review-patch-issue", + "--gerrit-issue", "${patch_issue}", - "--review-patch-set", + "--gerrit-patchset", "${patch_set}", - "--buildbucket-build-id", + "--buildbucket-id", "${buildbucket_build_id}" ], "should_retry_with_patch": false, @@ -1651,10 +1651,10 @@ "-v", "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc", "--dont-restore-color-profile-after-test", - "--build-revision", - "${got_cr_revision}", "--test-machine-name", - "${buildername}" + "${buildername}", + "--git-revision", + "${got_cr_revision}" ], "isolate_name": "telemetry_gpu_integration_test", "merge": { @@ -1663,11 +1663,11 @@ }, "name": "pixel_skia_gold_test", "precommit_args": [ - "--review-patch-issue", + "--gerrit-issue", "${patch_issue}", - "--review-patch-set", + "--gerrit-patchset", "${patch_set}", - "--buildbucket-build-id", + "--buildbucket-id", "${buildbucket_build_id}" ], "should_retry_with_patch": false, @@ -1935,10 +1935,10 @@ "-v", "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc", "--dont-restore-color-profile-after-test", - "--build-revision", - "${got_cr_revision}", "--test-machine-name", - "${buildername}" + "${buildername}", + "--git-revision", + "${got_cr_revision}" ], "isolate_name": "telemetry_gpu_integration_test", "merge": { @@ -1947,11 +1947,11 @@ }, "name": "maps_pixel_test", "precommit_args": [ - "--review-patch-issue", + "--gerrit-issue", "${patch_issue}", - "--review-patch-set", + "--gerrit-patchset", "${patch_set}", - "--buildbucket-build-id", + "--buildbucket-id", "${buildbucket_build_id}" ], "should_retry_with_patch": false, @@ -1977,10 +1977,10 @@ "-v", "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc", "--dont-restore-color-profile-after-test", - "--build-revision", - "${got_cr_revision}", "--test-machine-name", - "${buildername}" + "${buildername}", + "--git-revision", + "${got_cr_revision}" ], "isolate_name": "telemetry_gpu_integration_test", "merge": { @@ -1989,11 +1989,11 @@ }, "name": "pixel_skia_gold_test", "precommit_args": [ - "--review-patch-issue", + "--gerrit-issue", "${patch_issue}", - "--review-patch-set", + "--gerrit-patchset", "${patch_set}", - "--buildbucket-build-id", + "--buildbucket-id", "${buildbucket_build_id}" ], "should_retry_with_patch": false, @@ -2257,10 +2257,10 @@ "-v", "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc", "--dont-restore-color-profile-after-test", - "--build-revision", - "${got_cr_revision}", "--test-machine-name", - "${buildername}" + "${buildername}", + "--git-revision", + "${got_cr_revision}" ], "isolate_name": "telemetry_gpu_integration_test", "merge": { @@ -2269,11 +2269,11 @@ }, "name": "maps_pixel_test", "precommit_args": [ - "--review-patch-issue", + "--gerrit-issue", "${patch_issue}", - "--review-patch-set", + "--gerrit-patchset", "${patch_set}", - "--buildbucket-build-id", + "--buildbucket-id", "${buildbucket_build_id}" ], "should_retry_with_patch": false, @@ -2298,10 +2298,10 @@ "-v", "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc", "--dont-restore-color-profile-after-test", - "--build-revision", - "${got_cr_revision}", "--test-machine-name", - "${buildername}" + "${buildername}", + "--git-revision", + "${got_cr_revision}" ], "isolate_name": "telemetry_gpu_integration_test", "merge": { @@ -2310,11 +2310,11 @@ }, "name": "pixel_skia_gold_test", "precommit_args": [ - "--review-patch-issue", + "--gerrit-issue", "${patch_issue}", - "--review-patch-set", + "--gerrit-patchset", "${patch_set}", - "--buildbucket-build-id", + "--buildbucket-id", "${buildbucket_build_id}" ], "should_retry_with_patch": false, @@ -2925,10 +2925,10 @@ "-v", "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc", "--dont-restore-color-profile-after-test", - "--build-revision", - "${got_cr_revision}", "--test-machine-name", - "${buildername}" + "${buildername}", + "--git-revision", + "${got_cr_revision}" ], "isolate_name": "telemetry_gpu_integration_test", "merge": { @@ -2937,11 +2937,11 @@ }, "name": "maps_pixel_test", "precommit_args": [ - "--review-patch-issue", + "--gerrit-issue", "${patch_issue}", - "--review-patch-set", + "--gerrit-patchset", "${patch_set}", - "--buildbucket-build-id", + "--buildbucket-id", "${buildbucket_build_id}" ], "should_retry_with_patch": false, @@ -2967,10 +2967,10 @@ "-v", "--extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc", "--dont-restore-color-profile-after-test", - "--build-revision", - "${got_cr_revision}", "--test-machine-name", - "${buildername}" + "${buildername}", + "--git-revision", + "${got_cr_revision}" ], "isolate_name": "telemetry_gpu_integration_test", "merge": { @@ -2979,11 +2979,11 @@ }, "name": "pixel_skia_gold_test", "precommit_args": [ - "--review-patch-issue", + "--gerrit-issue", "${patch_issue}", - "--review-patch-set", + "--gerrit-patchset", "${patch_set}", - "--buildbucket-build-id", + "--buildbucket-id", "${buildbucket_build_id}" ], "should_retry_with_patch": false,
diff --git a/testing/buildbot/variants.pyl b/testing/buildbot/variants.pyl index fc3f0c59..1be2655 100644 --- a/testing/buildbot/variants.pyl +++ b/testing/buildbot/variants.pyl
@@ -9,6 +9,27 @@ # * trailing commas are allowed. { + 'OZONE_HEADLESS': { + 'args': [ + '--no-xvfb', + '--ozone-platform=headless', + ], + 'identifier': 'headless', + }, + 'OZONE_WAYLAND': { + 'args': [ + '--no-xvfb', + '--use-weston', + '--ozone-platform=wayland' + ], + 'identifier': 'wayland', + }, + 'OZONE_X11': { + 'args': [ + '--ozone-platform=x11', + ], + 'identifier': 'x11', + }, 'IPHONE_6S_12_3_1': { 'swarming': { 'dimension_sets': [
diff --git a/testing/buildbot/waterfalls.pyl b/testing/buildbot/waterfalls.pyl index e5c0658..38dabf0e 100644 --- a/testing/buildbot/waterfalls.pyl +++ b/testing/buildbot/waterfalls.pyl
@@ -2088,7 +2088,7 @@ }, 'linux-upload-perfetto': { 'test_suites': { - 'gtest_tests': 'upload_perfetto', + 'isolated_scripts': 'upload_perfetto', }, 'use_swarming': False, }, @@ -3915,37 +3915,27 @@ ] }, 'Linux Ozone Tester (Headless)': { - 'args': [ - '--no-xvfb', - '--ozone-platform=headless' - ], 'mixins': [ 'linux-xenial', ], 'test_suites': { - 'gtest_tests': 'ozone_linux_gtests_headless', + 'gtest_tests': 'linux_ozone_headless_tests', }, }, 'Linux Ozone Tester (Wayland)': { - 'args': [ - '--no-xvfb', - '--use-weston', - '--ozone-platform=wayland' - ], 'mixins': [ 'linux-xenial', ], 'test_suites': { - 'gtest_tests': 'ozone_linux_gtests_wayland', + 'gtest_tests': 'linux_ozone_wayland_tests', }, }, 'Linux Ozone Tester (X11)': { - 'args': [ '--ozone-platform=x11' ], 'mixins': [ 'linux-xenial', ], 'test_suites': { - 'gtest_tests': 'ozone_linux_gtests_x11', + 'gtest_tests': 'linux_ozone_x11_tests', }, }, 'Linux Tests': {
diff --git a/testing/merge_scripts/code_coverage/merge_lib.py b/testing/merge_scripts/code_coverage/merge_lib.py index 52b783f..721bd84 100644 --- a/testing/merge_scripts/code_coverage/merge_lib.py +++ b/testing/merge_scripts/code_coverage/merge_lib.py
@@ -280,9 +280,12 @@ profile_output_file_path=output_file, profdata_tool_path=profdata_tool_path) - # Remove inputs, as they won't be needed and they can be pretty large. - for input_file in profile_input_file_paths: - os.remove(input_file) + # Remove inputs when merging profraws as they won't be needed and they can be + # pretty large. If the inputs are profdata files, do not remove them as they + # might be used again for multiple test types coverage. + if input_extension == '.profraw': + for input_file in profile_input_file_paths: + os.remove(input_file) return invalid_profraw_files + invalid_profdata_files, counter_overflows
diff --git a/testing/variations/fieldtrial_testing_config.json b/testing/variations/fieldtrial_testing_config.json index 61c1dcbb..c380504 100644 --- a/testing/variations/fieldtrial_testing_config.json +++ b/testing/variations/fieldtrial_testing_config.json
@@ -3243,13 +3243,17 @@ "MayBlockWithoutDelay": [ { "platforms": [ - "windows", - "mac" + "android", + "chromeos", + "linux", + "mac", + "windows" ], "experiments": [ { "name": "Enabled", "enable_features": [ + "FixedMaxBestEffortTasks", "MayBlockWithoutDelay" ] }
diff --git a/third_party/blink/public/mojom/appcache/appcache.mojom b/third_party/blink/public/mojom/appcache/appcache.mojom index b1419ac..f3ea903 100644 --- a/third_party/blink/public/mojom/appcache/appcache.mojom +++ b/third_party/blink/public/mojom/appcache/appcache.mojom
@@ -4,6 +4,7 @@ module blink.mojom; +import "mojo/public/mojom/base/time.mojom"; import "mojo/public/mojom/base/unguessable_token.mojom"; import "services/network/public/mojom/url_loader_factory.mojom"; import "third_party/blink/public/mojom/appcache/appcache_info.mojom"; @@ -48,6 +49,7 @@ bool is_foreign; bool is_explicit; int64 response_id; + mojo_base.mojom.Time token_expires; }; struct AppCacheErrorDetails {
diff --git a/third_party/blink/public/mojom/appcache/appcache_info.mojom b/third_party/blink/public/mojom/appcache/appcache_info.mojom index f3084e6..eeb1b043 100644 --- a/third_party/blink/public/mojom/appcache/appcache_info.mojom +++ b/third_party/blink/public/mojom/appcache/appcache_info.mojom
@@ -27,6 +27,7 @@ mojo_base.mojom.Time creation_time; mojo_base.mojom.Time last_update_time; mojo_base.mojom.Time last_access_time; + mojo_base.mojom.Time token_expires; int64 cache_id; int64 group_id; AppCacheStatus status;
diff --git a/third_party/blink/public/web/web_element.h b/third_party/blink/public/web/web_element.h index 44de9e7..2ef0ed3 100644 --- a/third_party/blink/public/web/web_element.h +++ b/third_party/blink/public/web/web_element.h
@@ -31,12 +31,19 @@ #ifndef THIRD_PARTY_BLINK_PUBLIC_WEB_WEB_ELEMENT_H_ #define THIRD_PARTY_BLINK_PUBLIC_WEB_WEB_ELEMENT_H_ +#include <vector> + #include "third_party/blink/public/web/web_node.h" #include "third_party/skia/include/core/SkBitmap.h" +namespace gfx { +class Size; +} + namespace blink { class Element; +class Image; struct WebRect; // Provides access to some properties of a DOM element node. @@ -86,6 +93,17 @@ // Returns the image contents of this element or a null SkBitmap // if there isn't any. SkBitmap ImageContents(); + + // Returns a copy of original image data of this element or an empty vector + // if there isn't any. + std::vector<uint8_t> CopyOfImageData(); + + // Returns the original image file extension. + std::string ImageExtension(); + + // Returns the original image size. + gfx::Size GetImageSize(); + void RequestFullscreen(); #if INSIDE_BLINK @@ -93,6 +111,9 @@ WebElement& operator=(Element*); operator Element*() const; #endif + + private: + Image* GetImage(); }; DECLARE_WEB_NODE_TYPE_CASTS(WebElement);
diff --git a/third_party/blink/renderer/bindings/IDLExtendedAttributes.md b/third_party/blink/renderer/bindings/IDLExtendedAttributes.md index 042217f1..1ed4cc3 100644 --- a/third_party/blink/renderer/bindings/IDLExtendedAttributes.md +++ b/third_party/blink/renderer/bindings/IDLExtendedAttributes.md
@@ -365,6 +365,14 @@ Whether you should allow an interface to have a named constructor or not depends on the spec of each interface. +### [NamedConstructor_CallWith] _(i)_ + +Summary: The same as `[CallWith]` but applied to the named constructors. + +### [NamedConstructor_RaisesException] _(i)_ + +Summary: The same as `[RaisesException]` but applied to the named constructors. + ### [NewObject] _(m)_ Standard: [NewObject](https://heycam.github.io/webidl/#NewObject)
diff --git a/third_party/blink/renderer/bindings/IDLExtendedAttributes.txt b/third_party/blink/renderer/bindings/IDLExtendedAttributes.txt index 55e4175..4bb4a418 100644 --- a/third_party/blink/renderer/bindings/IDLExtendedAttributes.txt +++ b/third_party/blink/renderer/bindings/IDLExtendedAttributes.txt
@@ -76,6 +76,8 @@ Measure MeasureAs=* NamedConstructor=* +NamedConstructor_CallWith=Document +NamedConstructor_RaisesException NoInterfaceObject NotEnumerable OverrideBuiltins
diff --git a/third_party/blink/renderer/bindings/generated_in_modules.gni b/third_party/blink/renderer/bindings/generated_in_modules.gni index 86c73167..fac8c3d 100644 --- a/third_party/blink/renderer/bindings/generated_in_modules.gni +++ b/third_party/blink/renderer/bindings/generated_in_modules.gni
@@ -990,6 +990,8 @@ "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_rtc_dtmf_sender.h", "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_rtc_dtmf_tone_change_event.cc", "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_rtc_dtmf_tone_change_event.h", + "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_rtc_encoded_audio_frame.cc", + "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_rtc_encoded_audio_frame.h", "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_rtc_encoded_video_frame.cc", "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_rtc_encoded_video_frame.h", "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_rtc_error.cc",
diff --git a/third_party/blink/renderer/bindings/scripts/bind_gen/dictionary.py b/third_party/blink/renderer/bindings/scripts/bind_gen/dictionary.py index 1d72ec5..baeeebbb 100644 --- a/third_party/blink/renderer/bindings/scripts/bind_gen/dictionary.py +++ b/third_party/blink/renderer/bindings/scripts/bind_gen/dictionary.py
@@ -94,6 +94,9 @@ SymbolNode( "member_names", "const auto* ${member_names} = " "GetV8MemberNames(${isolate}).data();"), + SymbolNode( + "is_in_secure_context", "const bool ${is_in_secure_context} = " + "${execution_context}->IsSecureContext();"), ] # Execution context @@ -109,7 +112,60 @@ code_node.register_code_symbols(local_vars) -def make_dict_member_get_def(cg_context): +def _make_include_headers(cg_context): + assert isinstance(cg_context, CodeGenContext) + + dictionary = cg_context.dictionary + + header_includes = set() + source_includes = set() + + if dictionary.inherited: + header_includes.add( + PathManager(dictionary.inherited).api_path(ext="h")) + else: + header_includes.add( + "third_party/blink/renderer/platform/bindings/dictionary_base.h") + + header_includes.update([ + component_export_header(dictionary.components[0]), + "third_party/blink/renderer/bindings/core/v8/generated_code_helper.h", + "third_party/blink/renderer/bindings/core/v8/native_value_traits_impl.h", + "v8/include/v8.h", + ]) + source_includes.update([ + "third_party/blink/renderer/platform/bindings/exception_messages.h", + "third_party/blink/renderer/platform/bindings/exception_state.h", + "third_party/blink/renderer/platform/bindings/v8_per_isolate_data.h", + "third_party/blink/renderer/platform/heap/visitor.h", + ]) + + header_includes.update( + collect_include_headers_of_idl_types( + [member.idl_type for member in dictionary.own_members])) + + return header_includes, source_includes + + +def _make_forward_declarations(cg_context): + assert isinstance(cg_context, CodeGenContext) + + dictionary = cg_context.dictionary + + header_class_fwd_decls = set([ + "ExceptionState", + "Visitor", + ]) + header_struct_fwd_decls = set() + + source_class_fwd_decls = set() + source_struct_fwd_decls = set() + + return (header_class_fwd_decls, header_struct_fwd_decls, + source_class_fwd_decls, source_struct_fwd_decls) + + +def make_dict_member_get(cg_context): assert isinstance(cg_context, CodeGenContext) member = cg_context.dict_member @@ -117,51 +173,58 @@ name = blink_member_name.get_api blink_type = blink_type_info(member.idl_type) + decls = ListNode() + defs = ListNode() + + func_def = CxxFuncDefNode( + name=name, + arg_decls=[], + return_type=blink_type.const_ref_t, + const=True) + decls.append(func_def) + func_def.set_base_template_vars(cg_context.template_bindings()) + func_def.body.extend([ + TextNode(_format("DCHECK({}());", blink_member_name.has_api)), + TextNode(_format("return {};", blink_member_name.value_var)), + ]) + if blink_type.ref_t != blink_type.const_ref_t: func_def = CxxFuncDefNode( name=name, arg_decls=[], return_type=blink_type.ref_t) + decls.append(func_def) func_def.set_base_template_vars(cg_context.template_bindings()) func_def.body.extend([ TextNode(_format("DCHECK({}());", blink_member_name.has_api)), TextNode(_format("return {};", blink_member_name.value_var)), ]) - else: - func_def = None - const_func_def = CxxFuncDefNode( - name=name, - arg_decls=[], - return_type=blink_type.const_ref_t, - const=True) - const_func_def.set_base_template_vars(cg_context.template_bindings()) - const_func_def.body.extend([ - TextNode(_format("DCHECK({}());", blink_member_name.has_api)), - TextNode(_format("return {};", blink_member_name.value_var)), - ]) - - return ListNode([func_def, const_func_def]) + return decls, defs -def make_dict_member_has_def(cg_context): +def make_dict_member_has(cg_context): assert isinstance(cg_context, CodeGenContext) member = cg_context.dict_member + decls = ListNode() + defs = ListNode() + func_def = CxxFuncDefNode( name=_blink_member_name(member).has_api, arg_decls=[], return_type="bool", const=True) + decls.append(func_def) func_def.set_base_template_vars(cg_context.template_bindings()) body = func_def.body _1 = _member_presence_expr(member) body.append(TextNode(_format("return {_1};", _1=_1))) - return func_def + return decls, defs -def make_dict_member_set_def(cg_context): +def make_dict_member_set(cg_context): assert isinstance(cg_context, CodeGenContext) T = TextNode @@ -171,7 +234,7 @@ real_type = member.idl_type.unwrap(typedef=True) type_info = blink_type_info(real_type) - decls = ListNode() # Includes inline definitions. + decls = ListNode() defs = ListNode() template_func_def = CxxFuncDefNode( @@ -223,15 +286,11 @@ return decls, defs -def make_dict_member_defs(cg_context): +def make_dict_member_vars(cg_context): assert isinstance(cg_context, CodeGenContext) member = cg_context.dict_member - get_def = make_dict_member_get_def(cg_context) - has_def = make_dict_member_has_def(cg_context) - set_decls, set_defs = make_dict_member_set_def(cg_context) - default_value_initializer = "" if member.default_value: default_expr = make_default_value_expr(member.idl_type, @@ -251,8 +310,7 @@ else: presense_var_def = None - return (get_def, has_def, set_decls, set_defs, value_var_def, - presense_var_def) + return value_var_def, presense_var_def def make_get_v8_dict_member_names_func(cg_context): @@ -708,47 +766,37 @@ member_value_var_defs = ListNode() member_presense_var_defs = ListNode() for member in cg_context.dictionary.own_members: - (member_get_decls, member_has_decls, member_set_decls, member_set_defs, - member_value_var, member_presense_var) = make_dict_member_defs( - cg_context.make_copy(dict_member=member)) + member_context = cg_context.make_copy(dict_member=member) + get_decls, get_defs = make_dict_member_get(member_context) + has_decls, has_defs = make_dict_member_has(member_context) + set_decls, set_defs = make_dict_member_set(member_context) + value_var_def, presense_var_def = make_dict_member_vars(member_context) member_accessor_decls.extend([ TextNode(""), - member_get_decls, - member_has_decls, - member_set_decls, + get_decls, + has_decls, + set_decls, ]) member_accessor_defs.extend([ TextNode(""), - member_set_defs, + get_defs, + has_defs, + set_defs, ]) - member_value_var_defs.append(member_value_var) - member_presense_var_defs.append(member_presense_var) + member_value_var_defs.append(value_var_def) + member_presense_var_defs.append(presense_var_def) # Header part (copyright, include directives, and forward declarations) - if dictionary.inherited: - base_class_header = PathManager(dictionary.inherited).api_path(ext="h") - else: - base_class_header = ( - "third_party/blink/renderer/platform/bindings/dictionary_base.h") - header_node.accumulator.add_include_headers( - collect_include_headers_of_idl_types( - [member.idl_type for member in dictionary.own_members])) - header_node.accumulator.add_include_headers([ - base_class_header, - component_export_header(component), - "v8/include/v8.h", - ]) - header_node.accumulator.add_class_decls([ - "ExceptionState", - "Visitor", - ]) - source_node.accumulator.add_include_headers([ - "third_party/blink/renderer/bindings/core/v8/native_value_traits_impl.h", - "third_party/blink/renderer/platform/bindings/exception_messages.h", - "third_party/blink/renderer/platform/bindings/exception_state.h", - "third_party/blink/renderer/platform/bindings/v8_per_isolate_data.h", - "third_party/blink/renderer/platform/heap/visitor.h", - ]) + header_includes, source_includes = _make_include_headers(cg_context) + header_node.accumulator.add_include_headers(header_includes) + source_node.accumulator.add_include_headers(source_includes) + + (header_class_fwd_decls, header_struct_fwd_decls, source_class_fwd_decls, + source_struct_fwd_decls) = _make_forward_declarations(cg_context) + header_node.accumulator.add_class_decls(header_class_fwd_decls) + header_node.accumulator.add_struct_decls(header_struct_fwd_decls) + source_node.accumulator.add_class_decls(source_class_fwd_decls) + source_node.accumulator.add_struct_decls(source_struct_fwd_decls) header_node.extend([ make_copyright_header(),
diff --git a/third_party/blink/renderer/bindings/scripts/web_idl/callback_interface.py b/third_party/blink/renderer/bindings/scripts/web_idl/callback_interface.py index 5bd788e..4224996 100644 --- a/third_party/blink/renderer/bindings/scripts/web_idl/callback_interface.py +++ b/third_party/blink/renderer/bindings/scripts/web_idl/callback_interface.py
@@ -52,10 +52,12 @@ self.attributes = [] self.constants = constants - self.operations = operations - self.operation_groups = [] self.constructors = [] self.constructor_groups = [] + self.named_constructors = [] + self.named_constructor_groups = [] + self.operations = operations + self.operation_groups = [] def __init__(self, ir): assert isinstance(ir, CallbackInterface.IR)
diff --git a/third_party/blink/renderer/bindings/scripts/web_idl/constructor.py b/third_party/blink/renderer/bindings/scripts/web_idl/constructor.py index d389f3a9..ceacd26 100644 --- a/third_party/blink/renderer/bindings/scripts/web_idl/constructor.py +++ b/third_party/blink/renderer/bindings/scripts/web_idl/constructor.py
@@ -27,14 +27,16 @@ class IR(FunctionLike.IR, WithExtendedAttributes, WithCodeGeneratorInfo, WithExposure, WithOwnerMixin, WithComponent, WithDebugInfo): def __init__(self, + identifier, arguments, return_type, extended_attributes=None, component=None, debug_info=None): + assert identifier is None or isinstance(identifier, Identifier) FunctionLike.IR.__init__( self, - identifier=Identifier('constructor'), + identifier=(identifier or Identifier('constructor')), arguments=arguments, return_type=return_type) WithExtendedAttributes.__init__(self, extended_attributes)
diff --git a/third_party/blink/renderer/bindings/scripts/web_idl/idl_compiler.py b/third_party/blink/renderer/bindings/scripts/web_idl/idl_compiler.py index 7fc0f61..e7c2cd0f 100644 --- a/third_party/blink/renderer/bindings/scripts/web_idl/idl_compiler.py +++ b/third_party/blink/renderer/bindings/scripts/web_idl/idl_compiler.py
@@ -101,6 +101,8 @@ # Process inheritances. self._process_interface_inheritances() + self._copy_named_constructor_extattrs() + # Make groups of overloaded functions including inherited ones. self._group_overloaded_functions() self._propagate_extattrs_to_overload_group() @@ -405,6 +407,28 @@ if is_own_member(operation) ]) + def _copy_named_constructor_extattrs(self): + old_irs = self._ir_map.irs_of_kind(IRMap.IR.Kind.INTERFACE) + + self._ir_map.move_to_new_phase() + + def copy_extattrs(ext_attrs, ir): + if 'NamedConstructor_CallWith' in ext_attrs: + ir.extended_attributes.append( + ExtendedAttribute( + key='CallWith', + values=ext_attrs.values_of( + 'NamedConstructor_CallWith'))) + if 'NamedConstructor_RaisesException' in ext_attrs: + ir.extended_attributes.append( + ExtendedAttribute(key='RaisesException')) + + for old_ir in old_irs: + new_ir = self._maybe_make_copy(old_ir) + self._ir_map.add(new_ir) + for named_constructor_ir in new_ir.named_constructors: + copy_extattrs(new_ir.extended_attributes, named_constructor_ir) + def _group_overloaded_functions(self): old_irs = self._ir_map.irs_of_kinds(IRMap.IR.Kind.CALLBACK_INTERFACE, IRMap.IR.Kind.INTERFACE, @@ -414,6 +438,7 @@ for old_ir in old_irs: assert not old_ir.constructor_groups + assert not old_ir.named_constructor_groups assert not old_ir.operation_groups new_ir = self._maybe_make_copy(old_ir) self._ir_map.add(new_ir) @@ -423,6 +448,12 @@ for identifier, constructors in itertools.groupby( sorted(new_ir.constructors, key=sort_key), key=sort_key) ] + new_ir.named_constructor_groups = [ + ConstructorGroup.IR(constructors=list(constructors)) + for identifier, constructors in itertools.groupby( + sorted(new_ir.named_constructors, key=sort_key), + key=sort_key) + ] new_ir.operation_groups = [ OperationGroup.IR(operations=list(operations)) for identifier, operations in itertools.groupby( @@ -444,7 +475,9 @@ new_ir = self._maybe_make_copy(old_ir) self._ir_map.add(new_ir) - for group in new_ir.constructor_groups + new_ir.operation_groups: + for group in itertools.chain(new_ir.constructor_groups, + new_ir.named_constructor_groups, + new_ir.operation_groups): for key in ANY_OF: if any(key in overload.extended_attributes for overload in group): @@ -465,7 +498,9 @@ new_ir = self._maybe_make_copy(old_ir) self._ir_map.add(new_ir) - for group in new_ir.constructor_groups + new_ir.operation_groups: + for group in itertools.chain(new_ir.constructor_groups, + new_ir.named_constructor_groups, + new_ir.operation_groups): exposures = map(lambda overload: overload.exposure, group) # [Exposed]
diff --git a/third_party/blink/renderer/bindings/scripts/web_idl/interface.py b/third_party/blink/renderer/bindings/scripts/web_idl/interface.py index ebadc02..ae67aab 100644 --- a/third_party/blink/renderer/bindings/scripts/web_idl/interface.py +++ b/third_party/blink/renderer/bindings/scripts/web_idl/interface.py
@@ -38,6 +38,7 @@ attributes=None, constants=None, constructors=None, + named_constructors=None, operations=None, indexed_and_named_properties=None, stringifier=None, @@ -54,6 +55,8 @@ assert constants is None or isinstance(constants, (list, tuple)) assert constructors is None or isinstance(constructors, (list, tuple)) + assert named_constructors is None or isinstance( + named_constructors, (list, tuple)) assert operations is None or isinstance(operations, (list, tuple)) assert indexed_and_named_properties is None or isinstance( indexed_and_named_properties, IndexedAndNamedProperties.IR) @@ -66,6 +69,7 @@ attributes = attributes or [] constants = constants or [] constructors = constructors or [] + named_constructors = named_constructors or [] operations = operations or [] assert all( isinstance(attribute, Attribute.IR) @@ -76,6 +80,9 @@ isinstance(constructor, Constructor.IR) for constructor in constructors) assert all( + isinstance(named_constructor, Constructor.IR) + for named_constructor in named_constructors) + assert all( isinstance(operation, Operation.IR) for operation in operations) @@ -104,6 +111,8 @@ self.constants = list(constants) self.constructors = list(constructors) self.constructor_groups = [] + self.named_constructors = list(named_constructors) + self.named_constructor_groups = [] self.operations = list(operations) self.operation_groups = [] self.exposed_constructs = [] @@ -121,6 +130,8 @@ yield constant for constructor in self.constructors: yield constructor + for named_constructor in self.named_constructors: + yield named_constructor for operation in self.operations: yield operation @@ -151,23 +162,33 @@ ]) self._constructor_groups = tuple([ ConstructorGroup( - constructor_group_ir, - filter( - lambda x: x.identifier == constructor_group_ir.identifier, - self._constructors), - owner=self) for constructor_group_ir in ir.constructor_groups + group_ir, + filter(lambda x: x.identifier == group_ir.identifier, + self._constructors), + owner=self) for group_ir in ir.constructor_groups ]) assert len(self._constructor_groups) <= 1 + self._named_constructors = tuple([ + Constructor(named_constructor_ir, owner=self) + for named_constructor_ir in ir.named_constructors + ]) + self._named_constructor_groups = tuple([ + ConstructorGroup( + group_ir, + filter(lambda x: x.identifier == group_ir.identifier, + self._named_constructors), + owner=self) for group_ir in ir.named_constructor_groups + ]) self._operations = tuple([ Operation(operation_ir, owner=self) for operation_ir in ir.operations ]) self._operation_groups = tuple([ OperationGroup( - operation_group_ir, - filter(lambda x: x.identifier == operation_group_ir.identifier, + group_ir, + filter(lambda x: x.identifier == group_ir.identifier, self._operations), - owner=self) for operation_group_ir in ir.operation_groups + owner=self) for group_ir in ir.operation_groups ]) self._exposed_constructs = tuple(ir.exposed_constructs) self._legacy_window_aliases = tuple(ir.legacy_window_aliases) @@ -259,6 +280,16 @@ return self._constructor_groups @property + def named_constructors(self): + """Returns named constructors.""" + return self._named_constructors + + @property + def named_constructor_groups(self): + """Returns groups of overloaded named constructors.""" + return self._named_constructor_groups + + @property def operations(self): """ Returns all operations, including special operations without an
diff --git a/third_party/blink/renderer/bindings/scripts/web_idl/ir_builder.py b/third_party/blink/renderer/bindings/scripts/web_idl/ir_builder.py index f530224..5f2fe5f 100644 --- a/third_party/blink/renderer/bindings/scripts/web_idl/ir_builder.py +++ b/third_party/blink/renderer/bindings/scripts/web_idl/ir_builder.py
@@ -130,6 +130,8 @@ else: assert False + named_constructors = self._build_named_constructors(node) + indexed_and_named_properties = None if indexed_and_named_property_operations: indexed_and_named_properties = IndexedAndNamedProperties.IR( @@ -149,6 +151,7 @@ attributes=attributes, constants=constants, constructors=constructors, + named_constructors=named_constructors, operations=operations, indexed_and_named_properties=indexed_and_named_properties, stringifier=stringifier, @@ -198,7 +201,7 @@ idl_type = self._take_type(child_nodes) extended_attributes = self._take_extended_attributes( child_nodes) or fallback_extended_attributes - assert len(child_nodes) == 0 + assert not child_nodes return Attribute.IR( identifier=Identifier(node.GetName()), idl_type=idl_type, @@ -232,10 +235,11 @@ arguments = self._take_arguments(child_nodes) extended_attributes = self._take_extended_attributes( child_nodes) or fallback_extended_attributes - assert len(child_nodes) == 0 + assert not child_nodes return_type = self._idl_type_factory.reference_type( interface_identifier) return Constructor.IR( + identifier=None, arguments=arguments, return_type=return_type, extended_attributes=extended_attributes, @@ -248,7 +252,7 @@ return_type = self._take_type(child_nodes) extended_attributes = self._take_extended_attributes( child_nodes) or fallback_extended_attributes - assert len(child_nodes) == 0 + assert not child_nodes return Operation.IR( identifier=Identifier(node.GetName()), arguments=arguments, @@ -269,6 +273,37 @@ } return build_functions[node.GetClass()](node) + def _build_named_constructors(self, node): + assert node.GetClass() == 'Interface' + named_constructors = [] + + for child in node.GetChildren(): + if child.GetClass() == 'ExtAttributes': + interface_ext_attrs = child.GetChildren() + break + else: + return named_constructors + + for ext_attr in interface_ext_attrs: + if ext_attr.GetName() != 'NamedConstructor': + continue + call_node = ext_attr.GetChildren()[0] + assert call_node.GetClass() == 'Call' + child_nodes = list(call_node.GetChildren()) + arguments = self._take_arguments(child_nodes) + return_type = self._idl_type_factory.reference_type( + Identifier(node.GetName())) + assert not child_nodes + named_constructors.append( + Constructor.IR( + identifier=Identifier(call_node.GetName()), + arguments=arguments, + return_type=return_type, + component=self._component, + debug_info=self._build_debug_info(node))) + + return named_constructors + def _build_dictionary(self, node): child_nodes = list(node.GetChildren()) inherited = self._take_inheritance(child_nodes) @@ -292,7 +327,7 @@ idl_type = self._take_type(child_nodes, is_optional=(not is_required)) default_value = self._take_default_value(child_nodes) extended_attributes = self._take_extended_attributes(child_nodes) - assert len(child_nodes) == 0 + assert not child_nodes return DictionaryMember.IR( identifier=Identifier(node.GetName()), @@ -331,7 +366,7 @@ arguments = self._take_arguments(child_nodes) return_type = self._take_type(child_nodes) extended_attributes = self._take_extended_attributes(child_nodes) - assert len(child_nodes) == 0 + assert not child_nodes return CallbackFunction.IR( identifier=Identifier(node.GetName()), arguments=arguments, @@ -355,7 +390,7 @@ def _build_typedef(self, node): child_nodes = list(node.GetChildren()) idl_type = self._take_type(child_nodes) - assert len(child_nodes) == 0 + assert not child_nodes return Typedef.IR( identifier=Identifier(node.GetName()), @@ -387,7 +422,7 @@ is_variadic=is_variadic, extended_attributes=extended_attributes) default_value = self._take_default_value(child_nodes) - assert len(child_nodes) == 0 + assert not child_nodes return Argument.IR( identifier=Identifier(node.GetName()), index=index, @@ -487,7 +522,7 @@ debug_info=self._build_debug_info(node)) def _build_literal_constant(self, node): - assert len(node.GetChildren()) == 0 + assert not node.GetChildren() type_token = node.GetProperty('TYPE') value_token = node.GetProperty('VALUE')
diff --git a/third_party/blink/renderer/bindings/scripts/web_idl/namespace.py b/third_party/blink/renderer/bindings/scripts/web_idl/namespace.py index 4af3c116..6c146122 100644 --- a/third_party/blink/renderer/bindings/scripts/web_idl/namespace.py +++ b/third_party/blink/renderer/bindings/scripts/web_idl/namespace.py
@@ -65,6 +65,8 @@ self.constants = list(constants) self.constructors = [] self.constructor_groups = [] + self.named_constructors = [] + self.named_constructor_groups = [] self.operations = list(operations) self.operation_groups = []
diff --git a/third_party/blink/renderer/core/animation/animation.cc b/third_party/blink/renderer/core/animation/animation.cc index 0179a24f..56a74a84 100644 --- a/third_party/blink/renderer/core/animation/animation.cc +++ b/third_party/blink/renderer/core/animation/animation.cc
@@ -122,7 +122,7 @@ // https://drafts.csswg.org/css-animations-2/#animation-composite-order and // https://drafts.csswg.org/css-transitions-2/#animation-composite-order Animation::AnimationClassPriority priority; - if (animation.IsCSSTransition()) + if (animation.IsCSSTransition() && animation.IsOwned()) priority = Animation::AnimationClassPriority::kCssTransitionPriority; else if (animation.IsCSSAnimation() && animation.IsOwned()) priority = Animation::AnimationClassPriority::kCssAnimationPriority;
diff --git a/third_party/blink/renderer/core/animation/animation.h b/third_party/blink/renderer/core/animation/animation.h index de64480..a71d09d7 100644 --- a/third_party/blink/renderer/core/animation/animation.h +++ b/third_party/blink/renderer/core/animation/animation.h
@@ -119,9 +119,9 @@ virtual bool IsCSSAnimation() const { return false; } virtual bool IsCSSTransition() const { return false; } - virtual Element* OwningElemnt() const { return nullptr; } + virtual Element* OwningElement() const { return nullptr; } virtual void ClearOwningElement() {} - bool IsOwned() const { return !OwningElemnt(); } + bool IsOwned() const { return OwningElement(); } // Returns whether the animation is finished. bool Update(TimingUpdateReason);
diff --git a/third_party/blink/renderer/core/animation/css/css_animation.h b/third_party/blink/renderer/core/animation/css/css_animation.h index 46e1722f..b9ac7401 100644 --- a/third_party/blink/renderer/core/animation/css/css_animation.h +++ b/third_party/blink/renderer/core/animation/css/css_animation.h
@@ -24,7 +24,7 @@ bool IsCSSAnimation() const final { return true; } void ClearOwningElement() final { owning_element_ = nullptr; } - Element* OwningElement() const { return owning_element_; } + Element* OwningElement() const override { return owning_element_; } const String& animationName() const { return animation_name_; }
diff --git a/third_party/blink/renderer/core/animation/css/css_animations.cc b/third_party/blink/renderer/core/animation/css/css_animations.cc index a02235d..7708587c3 100644 --- a/third_party/blink/renderer/core/animation/css/css_animations.cc +++ b/third_party/blink/renderer/core/animation/css/css_animations.cc
@@ -637,6 +637,7 @@ !animation->Limited()) { retargeted_compositor_transitions.insert(property); } + animation->ClearOwningElement(); animation->cancel(); // after cancelation, transitions must be downgraded or they'll fail // to be considered when retriggering themselves. This can happen if
diff --git a/third_party/blink/renderer/core/animation/css/css_transition.cc b/third_party/blink/renderer/core/animation/css/css_transition.cc index d02c129b..4c42248 100644 --- a/third_party/blink/renderer/core/animation/css/css_transition.cc +++ b/third_party/blink/renderer/core/animation/css/css_transition.cc
@@ -5,6 +5,7 @@ #include "third_party/blink/renderer/core/animation/css/css_transition.h" #include "third_party/blink/renderer/core/animation/css/css_animations.h" +#include "third_party/blink/renderer/core/animation/keyframe_effect.h" #include "third_party/blink/renderer/core/dom/document.h" namespace blink { @@ -14,7 +15,11 @@ AnimationEffect* content, const PropertyHandle& transition_property) : Animation(execution_context, timeline, content), - transition_property_(transition_property) {} + transition_property_(transition_property) { + // The owning_element does not always equal to the target element of an + // animation. + owning_element_ = To<KeyframeEffect>(effect())->target(); +} AtomicString CSSTransition::transitionProperty() const { return transition_property_.GetCSSPropertyName().ToAtomicString();
diff --git a/third_party/blink/renderer/core/animation/css/css_transition.h b/third_party/blink/renderer/core/animation/css/css_transition.h index 458b546..07b5deb 100644 --- a/third_party/blink/renderer/core/animation/css/css_transition.h +++ b/third_party/blink/renderer/core/animation/css/css_transition.h
@@ -8,6 +8,7 @@ #include "third_party/blink/renderer/core/animation/animation.h" #include "third_party/blink/renderer/core/animation/animation_effect.h" #include "third_party/blink/renderer/core/core_export.h" +#include "third_party/blink/renderer/core/dom/element.h" namespace blink { @@ -22,6 +23,9 @@ bool IsCSSTransition() const final { return true; } + void ClearOwningElement() final { owning_element_ = nullptr; } + Element* OwningElement() const override { return owning_element_; } + AtomicString transitionProperty() const; const CSSProperty& TransitionCSSProperty() const { return transition_property_.GetCSSProperty(); @@ -37,6 +41,10 @@ // display:none must update the play state. // https://drafts.csswg.org/css-transitions-2/#requirements-on-pending-style-changes String playState() const override; + void Trace(blink::Visitor* visitor) override { + Animation::Trace(visitor); + visitor->Trace(owning_element_); + } protected: AnimationEffect::EventDelegate* CreateEventDelegate( @@ -45,8 +53,11 @@ private: PropertyHandle transition_property_; + // The owning element of a transition refers to the element or pseudo-element + // to which the transition-property property was applied that generated the + // animation. + Member<Element> owning_element_; }; - template <> struct DowncastTraits<CSSTransition> { static bool AllowFrom(const Animation& animation) {
diff --git a/third_party/blink/renderer/core/css/properties/computed_style_utils.cc b/third_party/blink/renderer/core/css/properties/computed_style_utils.cc index 02c6ecb..27f19a3 100644 --- a/third_party/blink/renderer/core/css/properties/computed_style_utils.cc +++ b/third_party/blink/renderer/core/css/properties/computed_style_utils.cc
@@ -289,8 +289,15 @@ const FillLayer* curr_layer) { CSSValueList* list = CSSValueList::CreateCommaSeparated(); for (; curr_layer; curr_layer = curr_layer->Next()) { - list->Append( - *ZoomAdjustedPixelValueForLength(curr_layer->PositionX(), style)); + const Length& from_edge = curr_layer->PositionX(); + if (curr_layer->BackgroundXOrigin() == BackgroundEdgeOrigin::kRight) { + // TODO(crbug.com/610627): This should use two-value syntax once the + // parser accepts it. + list->Append(*ZoomAdjustedPixelValueForLength( + from_edge.SubtractFromOneHundredPercent(), style)); + } else { + list->Append(*ZoomAdjustedPixelValueForLength(from_edge, style)); + } } return list; } @@ -300,8 +307,15 @@ const FillLayer* curr_layer) { CSSValueList* list = CSSValueList::CreateCommaSeparated(); for (; curr_layer; curr_layer = curr_layer->Next()) { - list->Append( - *ZoomAdjustedPixelValueForLength(curr_layer->PositionY(), style)); + const Length& from_edge = curr_layer->PositionY(); + if (curr_layer->BackgroundYOrigin() == BackgroundEdgeOrigin::kBottom) { + // TODO(crbug.com/610627): This should use two-value syntax once the + // parser accepts it. + list->Append(*ZoomAdjustedPixelValueForLength( + from_edge.SubtractFromOneHundredPercent(), style)); + } else { + list->Append(*ZoomAdjustedPixelValueForLength(from_edge, style)); + } } return list; } @@ -1818,8 +1832,10 @@ result->Append(*CSSPrimitiveValue::CreateFromLength(translate.X(), zoom)); result->Append(*CSSPrimitiveValue::CreateFromLength(translate.Y(), zoom)); if (operation.Is3DOperation()) { + // Since this is pixel length, we must unzoom (CreateFromLength above + // does the division internally). result->Append(*CSSNumericLiteralValue::Create( - translate.Z(), CSSPrimitiveValue::UnitType::kPixels)); + translate.Z() / zoom, CSSPrimitiveValue::UnitType::kPixels)); } return result; } @@ -1883,8 +1899,11 @@ const auto& matrix = To<MatrixTransformOperation>(operation).Matrix(); auto* result = MakeGarbageCollected<CSSFunctionValue>(CSSValueID::kMatrix); - double values[6] = {matrix.A(), matrix.B(), matrix.C(), - matrix.D(), matrix.E() / zoom, matrix.F() / zoom}; + // CSS matrix values are returned in column-major order. + double values[6] = {matrix.A(), matrix.B(), // + matrix.C(), matrix.D(), // + // E and F are pixel lengths so unzoom + matrix.E() / zoom, matrix.F() / zoom}; for (double value : values) { result->Append(*CSSNumericLiteralValue::Create( value, CSSPrimitiveValue::UnitType::kNumber)); @@ -1895,11 +1914,15 @@ const auto& matrix = To<Matrix3DTransformOperation>(operation).Matrix(); CSSFunctionValue* result = MakeGarbageCollected<CSSFunctionValue>(CSSValueID::kMatrix3d); + // CSS matrix values are returned in column-major order. double values[16] = { - matrix.M11(), matrix.M12(), matrix.M13(), - matrix.M14(), matrix.M21(), matrix.M22(), - matrix.M23(), matrix.M24(), matrix.M31(), - matrix.M32(), matrix.M33(), matrix.M34(), + // Note that the transformation matrix operates on (Length^3 * R). + // Each column contains 3 scalars followed by a reciprocal length + // (with a value in 1/px) which must be unzoomed accordingly. + matrix.M11(), matrix.M12(), matrix.M13(), matrix.M14() * zoom, + matrix.M21(), matrix.M22(), matrix.M23(), matrix.M24() * zoom, + matrix.M31(), matrix.M32(), matrix.M33(), matrix.M34() * zoom, + // Last column has 3 pixel lengths and a scalar matrix.M41() / zoom, matrix.M42() / zoom, matrix.M43() / zoom, matrix.M44()}; for (double value : values) {
diff --git a/third_party/blink/renderer/core/css/resolver/cascade_map.cc b/third_party/blink/renderer/core/css/resolver/cascade_map.cc index c599b1c6..eed741f 100644 --- a/third_party/blink/renderer/core/css/resolver/cascade_map.cc +++ b/third_party/blink/renderer/core/css/resolver/cascade_map.cc
@@ -34,6 +34,7 @@ bool CascadeMap::Add(const CSSPropertyName& name, CascadePriority priority) { if (name.IsCustomProperty()) { + DCHECK_NE(CascadeOrigin::kUserAgent, priority.GetOrigin()); auto result = custom_properties_.insert(name, priority); if (result.is_new_entry || result.stored_value->value < priority) { result.stored_value->value = priority;
diff --git a/third_party/blink/renderer/core/css/resolver/cascade_map_test.cc b/third_party/blink/renderer/core/css/resolver/cascade_map_test.cc index 2e8bfa0d..9465986 100644 --- a/third_party/blink/renderer/core/css/resolver/cascade_map_test.cc +++ b/third_party/blink/renderer/core/css/resolver/cascade_map_test.cc
@@ -21,19 +21,19 @@ TEST(CascadeMapTest, AddCustom) { CascadeMap map; - CascadePriority ua(CascadeOrigin::kUserAgent); + CascadePriority user(CascadeOrigin::kUser); CascadePriority author(CascadeOrigin::kAuthor); CSSPropertyName x(AtomicString("--x")); CSSPropertyName y(AtomicString("--y")); - EXPECT_TRUE(map.Add(x, ua)); + EXPECT_TRUE(map.Add(x, user)); EXPECT_TRUE(map.Add(x, author)); EXPECT_FALSE(map.Add(x, author)); ASSERT_TRUE(map.Find(x)); EXPECT_EQ(author, *map.Find(x)); EXPECT_FALSE(map.Find(y)); - EXPECT_TRUE(map.Add(y, ua)); + EXPECT_TRUE(map.Add(y, user)); // --x should be unchanged. ASSERT_TRUE(map.Find(x)); @@ -41,24 +41,24 @@ // --y should exist too. ASSERT_TRUE(map.Find(y)); - EXPECT_EQ(ua, *map.Find(y)); + EXPECT_EQ(user, *map.Find(y)); } TEST(CascadeMapTest, AddNative) { CascadeMap map; - CascadePriority ua(CascadeOrigin::kUserAgent); + CascadePriority user(CascadeOrigin::kUser); CascadePriority author(CascadeOrigin::kAuthor); CSSPropertyName color(CSSPropertyID::kColor); CSSPropertyName display(CSSPropertyID::kDisplay); - EXPECT_TRUE(map.Add(color, ua)); + EXPECT_TRUE(map.Add(color, user)); EXPECT_TRUE(map.Add(color, author)); EXPECT_FALSE(map.Add(color, author)); ASSERT_TRUE(map.Find(color)); EXPECT_EQ(author, *map.Find(color)); EXPECT_FALSE(map.Find(display)); - EXPECT_TRUE(map.Add(display, ua)); + EXPECT_TRUE(map.Add(display, user)); // color should be unchanged. ASSERT_TRUE(map.Find(color)); @@ -66,20 +66,20 @@ // display should exist too. ASSERT_TRUE(map.Find(display)); - EXPECT_EQ(ua, *map.Find(display)); + EXPECT_EQ(user, *map.Find(display)); } TEST(CascadeMapTest, FindAndMutateCustom) { CascadeMap map; - CascadePriority ua(CascadeOrigin::kUserAgent); + CascadePriority user(CascadeOrigin::kUser); CascadePriority author(CascadeOrigin::kAuthor); CSSPropertyName x(AtomicString("--x")); - EXPECT_TRUE(map.Add(x, ua)); + EXPECT_TRUE(map.Add(x, user)); CascadePriority* p = map.Find(x); ASSERT_TRUE(p); - EXPECT_EQ(ua, *p); + EXPECT_EQ(user, *p); *p = author; @@ -90,15 +90,15 @@ TEST(CascadeMapTest, FindAndMutateNative) { CascadeMap map; - CascadePriority ua(CascadeOrigin::kUserAgent); + CascadePriority user(CascadeOrigin::kUser); CascadePriority author(CascadeOrigin::kAuthor); CSSPropertyName color(CSSPropertyID::kColor); - EXPECT_TRUE(map.Add(color, ua)); + EXPECT_TRUE(map.Add(color, user)); CascadePriority* p = map.Find(color); ASSERT_TRUE(p); - EXPECT_EQ(ua, *p); + EXPECT_EQ(user, *p); *p = author; @@ -109,14 +109,14 @@ TEST(CascadeMapTest, AtCustom) { CascadeMap map; - CascadePriority ua(CascadeOrigin::kUserAgent); + CascadePriority user(CascadeOrigin::kUser); CascadePriority author(CascadeOrigin::kAuthor); CSSPropertyName x(AtomicString("--x")); EXPECT_EQ(CascadePriority(), map.At(x)); - EXPECT_TRUE(map.Add(x, ua)); - EXPECT_EQ(ua, map.At(x)); + EXPECT_TRUE(map.Add(x, user)); + EXPECT_EQ(user, map.At(x)); EXPECT_TRUE(map.Add(x, author)); EXPECT_EQ(author, map.At(x)); @@ -124,14 +124,14 @@ TEST(CascadeMapTest, AtNative) { CascadeMap map; - CascadePriority ua(CascadeOrigin::kUserAgent); + CascadePriority user(CascadeOrigin::kUser); CascadePriority author(CascadeOrigin::kAuthor); CSSPropertyName color(CSSPropertyID::kColor); EXPECT_EQ(CascadePriority(), map.At(color)); - EXPECT_TRUE(map.Add(color, ua)); - EXPECT_EQ(ua, map.At(color)); + EXPECT_TRUE(map.Add(color, user)); + EXPECT_EQ(user, map.At(color)); EXPECT_TRUE(map.Add(color, author)); EXPECT_EQ(author, map.At(color));
diff --git a/third_party/blink/renderer/core/css/resolver/style_resolver.cc b/third_party/blink/renderer/core/css/resolver/style_resolver.cc index 366a27a..57e17491 100644 --- a/third_party/blink/renderer/core/css/resolver/style_resolver.cc +++ b/third_party/blink/renderer/core/css/resolver/style_resolver.cc
@@ -1012,6 +1012,8 @@ auto* set = MakeGarbageCollected<MutableCSSPropertyValueSet>( state.GetParserMode()); set->SetProperty(property.GetCSSProperty().PropertyID(), *value); + cascade.MutableMatchResult().FinishAddingUARules(); + cascade.MutableMatchResult().FinishAddingUserRules(); cascade.MutableMatchResult().AddMatchedProperties(set); cascade.Apply(); } else {
diff --git a/third_party/blink/renderer/core/exported/web_element.cc b/third_party/blink/renderer/core/exported/web_element.cc index 89dde07..ae14334 100644 --- a/third_party/blink/renderer/core/exported/web_element.cc +++ b/third_party/blink/renderer/core/exported/web_element.cc
@@ -44,6 +44,7 @@ #include "third_party/blink/renderer/platform/wtf/casting.h" #include "third_party/blink/renderer/platform/wtf/text/atomic_string.h" #include "third_party/blink/renderer/platform/wtf/text/wtf_string.h" +#include "ui/gfx/geometry/size.h" namespace blink { @@ -149,14 +150,33 @@ } SkBitmap WebElement::ImageContents() { - if (IsNull()) - return {}; - Image* image = Unwrap<Element>()->ImageContents(); + Image* image = GetImage(); if (!image) return {}; return image->AsSkBitmapForCurrentFrame(kRespectImageOrientation); } +std::vector<uint8_t> WebElement::CopyOfImageData() { + Image* image = GetImage(); + if (!image || !image->Data()) + return std::vector<uint8_t>(); + return image->Data()->CopyAs<std::vector<uint8_t>>(); +} + +std::string WebElement::ImageExtension() { + Image* image = GetImage(); + if (!image) + return std::string(); + return image->FilenameExtension().Utf8(); +} + +gfx::Size WebElement::GetImageSize() { + Image* image = GetImage(); + if (!image) + return gfx::Size(); + return gfx::Size(image->width(), image->height()); +} + void WebElement::RequestFullscreen() { Element* element = Unwrap<Element>(); Fullscreen::RequestFullscreen(*element); @@ -175,4 +195,10 @@ return blink::To<Element>(private_.Get()); } +Image* WebElement::GetImage() { + if (IsNull()) + return nullptr; + return Unwrap<Element>()->ImageContents(); +} + } // namespace blink
diff --git a/third_party/blink/renderer/core/frame/ad_tracker.cc b/third_party/blink/renderer/core/frame/ad_tracker.cc index c8787dc..9476585d 100644 --- a/third_party/blink/renderer/core/frame/ad_tracker.cc +++ b/third_party/blink/renderer/core/frame/ad_tracker.cc
@@ -16,6 +16,7 @@ #include "third_party/blink/renderer/platform/loader/fetch/resource_request.h" #include "third_party/blink/renderer/platform/weborigin/kurl.h" #include "third_party/blink/renderer/platform/wtf/casting.h" +#include "v8/include/v8.h" namespace blink { @@ -79,11 +80,24 @@ local_root_ = nullptr; } -String AdTracker::ScriptAtTopOfStack(ExecutionContext* execution_context) { - std::unique_ptr<blink::SourceLocation> current_stack_trace = - SourceLocation::Capture(execution_context); - // TODO(jkarlin): Url() sometimes returns String(), why? - return current_stack_trace ? current_stack_trace->Url() : ""; +String AdTracker::ScriptAtTopOfStack() { + // CurrentStackTrace is 10x faster than CaptureStackTrace if all that you need + // is the url of the script at the top of the stack. See crbug.com/1057211 for + // more detail. + v8::Isolate* isolate = v8::Isolate::GetCurrent(); + DCHECK(isolate); + + v8::Local<v8::StackTrace> stack_trace = + v8::StackTrace::CurrentStackTrace(isolate, /*frame_limit=*/1); + if (stack_trace.IsEmpty() || stack_trace->GetFrameCount() < 1) + return String(); + + v8::Local<v8::StackFrame> frame = stack_trace->GetFrame(isolate, 0); + v8::Local<v8::String> script_name = frame->GetScriptNameOrSourceURL(); + if (script_name.IsEmpty() || !script_name->Length()) + return String(); + + return ToCoreString(script_name); } ExecutionContext* AdTracker::GetCurrentExecutionContext() { @@ -175,7 +189,7 @@ if (!async_stack_enabled_) return; - if (IsAdScriptInStack(StackType::kBottomOnly)) + if (IsAdScriptInStack(StackType::kBottomAndTop)) task->SetAdTask(); } @@ -217,7 +231,7 @@ // (e.g., when v8 is executed) but not the entire stack. For a small cost we // can also check the top of the stack (this is much cheaper than getting the // full stack from v8). - String top_script = ScriptAtTopOfStack(execution_context); + String top_script = ScriptAtTopOfStack(); if (!top_script.IsEmpty() && IsKnownAdScript(execution_context, top_script)) return true;
diff --git a/third_party/blink/renderer/core/frame/ad_tracker.h b/third_party/blink/renderer/core/frame/ad_tracker.h index 1374c25..04e15e42 100644 --- a/third_party/blink/renderer/core/frame/ad_tracker.h +++ b/third_party/blink/renderer/core/frame/ad_tracker.h
@@ -86,7 +86,7 @@ protected: // Protected for testing. - virtual String ScriptAtTopOfStack(ExecutionContext*); + virtual String ScriptAtTopOfStack(); virtual ExecutionContext* GetCurrentExecutionContext(); private:
diff --git a/third_party/blink/renderer/core/frame/ad_tracker_test.cc b/third_party/blink/renderer/core/frame/ad_tracker_test.cc index 6ab43924..8f86535a 100644 --- a/third_party/blink/renderer/core/frame/ad_tracker_test.cc +++ b/third_party/blink/renderer/core/frame/ad_tracker_test.cc
@@ -51,11 +51,12 @@ return is_ad_.at(url); } - protected: - String ScriptAtTopOfStack(ExecutionContext* execution_context) override { - if (script_at_top_.IsEmpty()) - return AdTracker::ScriptAtTopOfStack(execution_context); + void SetSimTest() { sim_test_ = true; } + protected: + String ScriptAtTopOfStack() override { + if (sim_test_) + return AdTracker::ScriptAtTopOfStack(); return script_at_top_; } @@ -87,6 +88,7 @@ String script_at_top_; Member<ExecutionContext> execution_context_; String ad_suffix_; + bool sim_test_ = false; }; } // namespace @@ -327,6 +329,7 @@ LoadURL("https://example.com/test.html"); ad_tracker_ = MakeGarbageCollected<TestAdTracker>(GetDocument().GetFrame()); + ad_tracker_->SetSimTest(); GetDocument().GetFrame()->SetAdTrackerForTesting(ad_tracker_); }
diff --git a/third_party/blink/renderer/core/html/forms/file_input_type.cc b/third_party/blink/renderer/core/html/forms/file_input_type.cc index 68800687..62d3be9 100644 --- a/third_party/blink/renderer/core/html/forms/file_input_type.cc +++ b/third_party/blink/renderer/core/html/forms/file_input_type.cc
@@ -208,7 +208,7 @@ } bool FileInputType::TypeShouldForceLegacyLayout() const { - return true; + return !RuntimeEnabledFeatures::LayoutNGForControlsEnabled(); } LayoutObject* FileInputType::CreateLayoutObject(const ComputedStyle& style,
diff --git a/third_party/blink/renderer/core/html/forms/html_input_element.cc b/third_party/blink/renderer/core/html/forms/html_input_element.cc index 8983697a..ce0b6a33 100644 --- a/third_party/blink/renderer/core/html/forms/html_input_element.cc +++ b/third_party/blink/renderer/core/html/forms/html_input_element.cc
@@ -49,6 +49,7 @@ #include "third_party/blink/renderer/core/events/before_text_inserted_event.h" #include "third_party/blink/renderer/core/events/keyboard_event.h" #include "third_party/blink/renderer/core/events/mouse_event.h" +#include "third_party/blink/renderer/core/fileapi/file_list.h" #include "third_party/blink/renderer/core/frame/deprecation.h" #include "third_party/blink/renderer/core/frame/local_frame.h" #include "third_party/blink/renderer/core/frame/local_frame_view.h" @@ -1821,6 +1822,10 @@ return input_type_view_->FileStatusText(); } +bool HTMLInputElement::ShouldApplyMiddleEllipsis() const { + return files() && files()->length() <= 1; +} + bool HTMLInputElement::ShouldAppearIndeterminate() const { return input_type_->ShouldAppearIndeterminate(); }
diff --git a/third_party/blink/renderer/core/html/forms/html_input_element.h b/third_party/blink/renderer/core/html/forms/html_input_element.h index 7a69753..9b0f10e0 100644 --- a/third_party/blink/renderer/core/html/forms/html_input_element.h +++ b/third_party/blink/renderer/core/html/forms/html_input_element.h
@@ -283,6 +283,9 @@ // is not truncated by ellipsis. // Return a null string for other types. String FileStatusText() const; + // Returns true if an ellipsis should be injected at the middle of the text. + // This function is called only if text-overflow:ellipsis is specified. + bool ShouldApplyMiddleEllipsis() const; unsigned height() const; unsigned width() const;
diff --git a/third_party/blink/renderer/core/html/forms/html_option_element.idl b/third_party/blink/renderer/core/html/forms/html_option_element.idl index fd2eb01..9c6341bf 100644 --- a/third_party/blink/renderer/core/html/forms/html_option_element.idl +++ b/third_party/blink/renderer/core/html/forms/html_option_element.idl
@@ -21,13 +21,15 @@ // https://html.spec.whatwg.org/C/#the-option-element [ + ConstructorCallWith=Document, Exposed=Window, HTMLConstructor, NamedConstructor=Option(optional DOMString data = null, optional DOMString value = null, optional boolean defaultSelected = false, optional boolean selected = false), - ConstructorCallWith=Document, + NamedConstructor_CallWith=Document, + NamedConstructor_RaisesException, RaisesException=Constructor ] interface HTMLOptionElement : HTMLElement { [CEReactions, Reflect] attribute boolean disabled;
diff --git a/third_party/blink/renderer/core/html/html_image_element.idl b/third_party/blink/renderer/core/html/html_image_element.idl index 794e413..bcd431f 100644 --- a/third_party/blink/renderer/core/html/html_image_element.idl +++ b/third_party/blink/renderer/core/html/html_image_element.idl
@@ -21,11 +21,12 @@ // https://html.spec.whatwg.org/C/#the-img-element [ - Exposed=Window, ActiveScriptWrappable, ConstructorCallWith=Document, + Exposed=Window, HTMLConstructor, - NamedConstructor=Image(optional unsigned long width, optional unsigned long height) + NamedConstructor=Image(optional unsigned long width, optional unsigned long height), + NamedConstructor_CallWith=Document ] interface HTMLImageElement : HTMLElement { [CEReactions, Reflect] attribute DOMString alt; [CEReactions, Reflect, URL] attribute USVString src;
diff --git a/third_party/blink/renderer/core/html/media/html_audio_element.idl b/third_party/blink/renderer/core/html/media/html_audio_element.idl index 698f97b6..3c84dc9d 100644 --- a/third_party/blink/renderer/core/html/media/html_audio_element.idl +++ b/third_party/blink/renderer/core/html/media/html_audio_element.idl
@@ -26,9 +26,10 @@ // https://html.spec.whatwg.org/C/#the-audio-element [ + ConstructorCallWith=Document, Exposed=Window, HTMLConstructor, NamedConstructor=Audio(optional DOMString src), - ConstructorCallWith=Document + NamedConstructor_CallWith=Document ] interface HTMLAudioElement : HTMLMediaElement { };
diff --git a/third_party/blink/renderer/core/html/resources/controls_refresh.css b/third_party/blink/renderer/core/html/resources/controls_refresh.css index 49390c0..e90e099 100644 --- a/third_party/blink/renderer/core/html/resources/controls_refresh.css +++ b/third_party/blink/renderer/core/html/resources/controls_refresh.css
@@ -100,7 +100,7 @@ } meter::-webkit-meter-bar { - background: #efefef; + background: -internal-light-dark-color(#efefef, #4a4a4a); border-width: thin; grid-row-start: line1; grid-row-end: line2; @@ -112,15 +112,15 @@ } meter::-webkit-meter-optimum-value { - background: #107c10; + background: -internal-light-dark-color(#107c10, #74b374) } meter::-webkit-meter-suboptimum-value { - background: #ffb900; + background: -internal-light-dark-color(#ffb900, #f2c812) } meter::-webkit-meter-even-less-good-value { - background: #d83b01; + background: -internal-light-dark-color(#d83b01, #e98f6d) } input[type="date" i]::-webkit-calendar-picker-indicator,
diff --git a/third_party/blink/renderer/core/layout/layout_box_model_object.cc b/third_party/blink/renderer/core/layout/layout_box_model_object.cc index 2313995..e3b2080 100644 --- a/third_party/blink/renderer/core/layout/layout_box_model_object.cc +++ b/third_party/blink/renderer/core/layout/layout_box_model_object.cc
@@ -96,7 +96,8 @@ Layer()->GetScrollableArea()->UsesCompositedScrolling(); } -BackgroundPaintLocation LayoutBoxModelObject::GetBackgroundPaintLocation( +BackgroundPaintLocation +LayoutBoxModelObject::ComputeBackgroundPaintLocationIfComposited( uint32_t* main_thread_scrolling_reasons) const { bool may_have_scrolling_layers_without_scrolling = IsA<LayoutView>(this); const auto* scrollable_area = GetScrollableArea(); @@ -540,6 +541,7 @@ // Removing a layer may affect existence of the LocalBorderBoxProperties, so // we need to ensure that we update paint properties. SetNeedsPaintPropertyUpdate(); + SetBackgroundPaintLocation(kBackgroundPaintInGraphicsLayer); } bool LayoutBoxModelObject::HasSelfPaintingLayer() const {
diff --git a/third_party/blink/renderer/core/layout/layout_box_model_object.h b/third_party/blink/renderer/core/layout/layout_box_model_object.h index 068165d3..dd19932 100644 --- a/third_party/blink/renderer/core/layout/layout_box_model_object.h +++ b/third_party/blink/renderer/core/layout/layout_box_model_object.h
@@ -185,13 +185,13 @@ bool UsesCompositedScrolling() const; - // Returns which layers backgrounds should be painted into for overflow - // scrolling boxes. + // Returns which layers backgrounds should be painted into for a overflow + // scrolling box if it uses composited scrolling. // TODO(yigu): PaintLayerScrollableArea::ComputeNeedsCompositedScrolling // calls this method to obtain main thread scrolling reasons due to // background paint location. Once the cases get handled on compositor the // parameter "reasons" could be removed. - BackgroundPaintLocation GetBackgroundPaintLocation( + BackgroundPaintLocation ComputeBackgroundPaintLocationIfComposited( uint32_t* main_thread_scrolling_reasons = nullptr) const; // These return the CSS computed padding values.
diff --git a/third_party/blink/renderer/core/layout/layout_grid.cc b/third_party/blink/renderer/core/layout/layout_grid.cc index 6e618a4..4088d0ec 100644 --- a/third_party/blink/renderer/core/layout/layout_grid.cc +++ b/third_party/blink/renderer/core/layout/layout_grid.cc
@@ -194,7 +194,12 @@ bool LayoutGrid::NamedGridLinesDefinitionDidChange( const ComputedStyle& old_style) const { return old_style.NamedGridRowLines() != StyleRef().NamedGridRowLines() || - old_style.NamedGridColumnLines() != StyleRef().NamedGridColumnLines(); + old_style.NamedGridColumnLines() != + StyleRef().NamedGridColumnLines() || + old_style.ImplicitNamedGridRowLines() != + StyleRef().ImplicitNamedGridRowLines() || + old_style.ImplicitNamedGridColumnLines() != + StyleRef().ImplicitNamedGridColumnLines(); } void LayoutGrid::ComputeTrackSizesForDefiniteSize(
diff --git a/third_party/blink/renderer/core/layout/layout_object.h b/third_party/blink/renderer/core/layout/layout_object.h index cca6625..09f6574c 100644 --- a/third_party/blink/renderer/core/layout/layout_object.h +++ b/third_party/blink/renderer/core/layout/layout_object.h
@@ -2311,9 +2311,10 @@ layout_object_.fragment_.SetSelectionVisualRect(r); } - void SetPreviousBackgroundPaintLocation(BackgroundPaintLocation location) { - layout_object_.bitfields_.SetPreviousBackgroundPaintLocation(location); + void SetBackgroundPaintLocation(BackgroundPaintLocation location) { + layout_object_.SetBackgroundPaintLocation(location); } + void UpdatePreviousOutlineMayBeAffectedByDescendants() { layout_object_.SetPreviousOutlineMayBeAffectedByDescendants( layout_object_.OutlineMayBeAffectedByDescendants()); @@ -2431,8 +2432,14 @@ bool CompositedScrollsWithRespectTo( const LayoutBoxModelObject& paint_invalidation_container) const; - BackgroundPaintLocation PreviousBackgroundPaintLocation() const { - return bitfields_.PreviousBackgroundPaintLocation(); + BackgroundPaintLocation GetBackgroundPaintLocation() const { + return bitfields_.GetBackgroundPaintLocation(); + } + void SetBackgroundPaintLocation(BackgroundPaintLocation location) { + if (GetBackgroundPaintLocation() != location) { + SetBackgroundNeedsFullPaintInvalidation(); + bitfields_.SetBackgroundPaintLocation(location); + } } bool IsBackgroundAttachmentFixedObject() const { @@ -2922,7 +2929,7 @@ selection_state_(static_cast<unsigned>(SelectionState::kNone)), subtree_paint_property_update_reasons_( static_cast<unsigned>(SubtreePaintPropertyUpdateReason::kNone)), - previous_background_paint_location_(0) {} + background_paint_location_(kBackgroundPaintInGraphicsLayer) {} // Self needs layout for style means that this layout object is marked for a // full layout. This is the default layout but it is expensive as it @@ -3191,8 +3198,9 @@ unsigned subtree_paint_property_update_reasons_ : kSubtreePaintPropertyUpdateReasonsBitfieldWidth; - // BackgroundPaintLocation of previous paint invalidation. - unsigned previous_background_paint_location_ : 2; + // Updated during CompositingUpdate in pre-CompositeAfterPaint, or PrePaint + // in CompositeAfterPaint. + unsigned background_paint_location_ : 2; // BackgroundPaintLocation. public: bool IsOutOfFlowPositioned() const { @@ -3259,15 +3267,13 @@ static_cast<unsigned>(SubtreePaintPropertyUpdateReason::kNone); } - ALWAYS_INLINE BackgroundPaintLocation - PreviousBackgroundPaintLocation() const { - return static_cast<BackgroundPaintLocation>( - previous_background_paint_location_); + ALWAYS_INLINE BackgroundPaintLocation GetBackgroundPaintLocation() const { + return static_cast<BackgroundPaintLocation>(background_paint_location_); } - ALWAYS_INLINE void SetPreviousBackgroundPaintLocation( + ALWAYS_INLINE void SetBackgroundPaintLocation( BackgroundPaintLocation location) { - previous_background_paint_location_ = static_cast<unsigned>(location); - DCHECK_EQ(location, PreviousBackgroundPaintLocation()); + background_paint_location_ = static_cast<unsigned>(location); + DCHECK_EQ(location, GetBackgroundPaintLocation()); } };
diff --git a/third_party/blink/renderer/core/layout/layout_theme.cc b/third_party/blink/renderer/core/layout/layout_theme.cc index d092d20..b1cbf53 100644 --- a/third_party/blink/renderer/core/layout/layout_theme.cc +++ b/third_party/blink/renderer/core/layout/layout_theme.cc
@@ -295,6 +295,19 @@ } String LayoutTheme::ExtraDefaultStyleSheet() { + if (RuntimeEnabledFeatures::LayoutNGForControlsEnabled()) { + return String(R"CSS( +input[type="file" i] { + overflow: hidden; + text-overflow: ellipsis; + white-space: pre; +} + +input[type="file" i]::-webkit-file-upload-button { + margin-inline-end: 4px; +} +)CSS"); + } return g_empty_string; }
diff --git a/third_party/blink/renderer/core/layout/ng/inline/ng_fragment_items.cc b/third_party/blink/renderer/core/layout/ng/inline/ng_fragment_items.cc index 87aba819..794995b 100644 --- a/third_party/blink/renderer/core/layout/ng/inline/ng_fragment_items.cc +++ b/third_party/blink/renderer/core/layout/ng/inline/ng_fragment_items.cc
@@ -13,4 +13,35 @@ text_content_(std::move(builder->text_content_)), first_line_text_content_(std::move(builder->first_line_text_content_)) {} +// static +void NGFragmentItems::AssociateWithLayoutObject( + Vector<std::unique_ptr<NGFragmentItem>>* items) { + // items_[0] can be: + // - kBox for list marker, e.g. <li>abc</li> + // - kLine for line, e.g. <div>abc</div> + // Calling get() is necessary below because operator<< in std::unique_ptr is + // a C++20 feature. + // TODO(https://crbug.com/980914): Drop .get() once we move to C++20. + DCHECK(items->IsEmpty() || (*items)[0]->IsContainer()) << (*items)[0].get(); + HashMap<const LayoutObject*, wtf_size_t> last_fragment_map; + for (wtf_size_t index = 1u; index < items->size(); ++index) { + const NGFragmentItem& item = *(*items)[index]; + if (item.Type() == NGFragmentItem::kLine) + continue; + LayoutObject* const layout_object = item.GetMutableLayoutObject(); + DCHECK(layout_object->IsInLayoutNGInlineFormattingContext()) << item; + auto insert_result = last_fragment_map.insert(layout_object, index); + if (insert_result.is_new_entry) { + layout_object->SetFirstInlineFragmentItemIndex(index); + continue; + } + const wtf_size_t last_index = insert_result.stored_value->value; + insert_result.stored_value->value = index; + DCHECK_GT(last_index, 0u) << item; + DCHECK_LT(last_index, items->size()); + DCHECK_LT(last_index, index); + (*items)[last_index]->SetDeltaToNextForSameLayoutObject(index - last_index); + } +} + } // namespace blink
diff --git a/third_party/blink/renderer/core/layout/ng/inline/ng_fragment_items.h b/third_party/blink/renderer/core/layout/ng/inline/ng_fragment_items.h index fe62f758..76c95f1 100644 --- a/third_party/blink/renderer/core/layout/ng/inline/ng_fragment_items.h +++ b/third_party/blink/renderer/core/layout/ng/inline/ng_fragment_items.h
@@ -28,6 +28,9 @@ return UNLIKELY(first_line) ? first_line_text_content_ : text_content_; } + static void AssociateWithLayoutObject( + Vector<std::unique_ptr<NGFragmentItem>>* items); + private: // TODO(kojii): inline capacity TBD. Vector<std::unique_ptr<NGFragmentItem>> items_;
diff --git a/third_party/blink/renderer/core/layout/ng/inline/ng_fragment_items_builder.cc b/third_party/blink/renderer/core/layout/ng/inline/ng_fragment_items_builder.cc index e746f74..243c9d36 100644 --- a/third_party/blink/renderer/core/layout/ng/inline/ng_fragment_items_builder.cc +++ b/third_party/blink/renderer/core/layout/ng/inline/ng_fragment_items_builder.cc
@@ -217,37 +217,8 @@ const PhysicalSize& outer_size, void* data) { ConvertToPhysical(writing_mode, direction, outer_size); - AssociateNextForSameLayoutObject(); + NGFragmentItems::AssociateWithLayoutObject(&items_); new (data) NGFragmentItems(this); } -void NGFragmentItemsBuilder::AssociateNextForSameLayoutObject() { - // items_[0] can be: - // - kBox for list marker, e.g. <li>abc</li> - // - kLine for line, e.g. <div>abc</div> - // Calling get() is necessary below because operator<< in std::unique_ptr is - // a C++20 feature. - // TODO(https://crbug.com/980914): Drop .get() once we move to C++20. - DCHECK(items_.IsEmpty() || items_[0]->IsContainer()) << items_[0].get(); - HashMap<const LayoutObject*, wtf_size_t> last_fragment_map; - for (wtf_size_t index = 1u; index < items_.size(); ++index) { - const NGFragmentItem& item = *items_[index]; - if (item.Type() == NGFragmentItem::kLine) - continue; - LayoutObject* const layout_object = item.GetMutableLayoutObject(); - DCHECK(layout_object->IsInLayoutNGInlineFormattingContext()) << item; - auto insert_result = last_fragment_map.insert(layout_object, index); - if (insert_result.is_new_entry) { - layout_object->SetFirstInlineFragmentItemIndex(index); - continue; - } - const wtf_size_t last_index = insert_result.stored_value->value; - insert_result.stored_value->value = index; - DCHECK_GT(last_index, 0u) << item; - DCHECK_LT(last_index, items_.size()); - DCHECK_LT(last_index, index); - items_[last_index]->SetDeltaToNextForSameLayoutObject(index - last_index); - } -} - } // namespace blink
diff --git a/third_party/blink/renderer/core/layout/ng/inline/ng_fragment_items_builder.h b/third_party/blink/renderer/core/layout/ng/inline/ng_fragment_items_builder.h index 5c069e7..84be85e 100644 --- a/third_party/blink/renderer/core/layout/ng/inline/ng_fragment_items_builder.h +++ b/third_party/blink/renderer/core/layout/ng/inline/ng_fragment_items_builder.h
@@ -84,8 +84,6 @@ TextDirection direction, const PhysicalSize& outer_size); - void AssociateNextForSameLayoutObject(); - Vector<std::unique_ptr<NGFragmentItem>> items_; Vector<LogicalOffset> offsets_; String text_content_;
diff --git a/third_party/blink/renderer/core/layout/ng/inline/ng_inline_layout_algorithm.cc b/third_party/blink/renderer/core/layout/ng/inline/ng_inline_layout_algorithm.cc index 2e60530..76a67f7 100644 --- a/third_party/blink/renderer/core/layout/ng/inline/ng_inline_layout_algorithm.cc +++ b/third_party/blink/renderer/core/layout/ng/inline/ng_inline_layout_algorithm.cc
@@ -8,6 +8,7 @@ #include "base/compiler_specific.h" #include "base/containers/adapters.h" +#include "third_party/blink/renderer/core/html/forms/html_input_element.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_box_state.h" #include "third_party/blink/renderer/core/layout/ng/inline/ng_inline_break_token.h" @@ -327,8 +328,16 @@ line_info->AvailableWidth() - line_info->TextIndent() && node_.GetLayoutBlockFlow()->ShouldTruncateOverflowingText()) || ShouldTruncateForLineClamp(*line_info))) { - inline_size = NGLineTruncator(*line_info) - .TruncateLine(inline_size, &line_box_, box_states_); + NGLineTruncator truncator(*line_info); + auto* input = + DynamicTo<HTMLInputElement>(node_.GetLayoutBlockFlow()->GetNode()); + if (input && input->ShouldApplyMiddleEllipsis()) { + inline_size = truncator.TruncateLineInTheMiddle(inline_size, &line_box_, + box_states_); + } else { + inline_size = + truncator.TruncateLine(inline_size, &line_box_, box_states_); + } } // Negative margins can make the position negative, but the inline size is
diff --git a/third_party/blink/renderer/core/layout/ng/inline/ng_line_truncator.cc b/third_party/blink/renderer/core/layout/ng/inline/ng_line_truncator.cc index f455de5..0306094 100644 --- a/third_party/blink/renderer/core/layout/ng/inline/ng_line_truncator.cc +++ b/third_party/blink/renderer/core/layout/ng/inline/ng_line_truncator.cc
@@ -14,6 +14,22 @@ namespace blink { +namespace { + +bool IsLeftMostOffset(const ShapeResult& shape_result, unsigned offset) { + if (shape_result.Rtl()) + return offset == shape_result.NumCharacters(); + return offset == 0; +} + +bool IsRightMostOffset(const ShapeResult& shape_result, unsigned offset) { + if (shape_result.Rtl()) + return offset == 0; + return offset == shape_result.NumCharacters(); +} + +} // namespace + NGLineTruncator::NGLineTruncator(const NGLineInfo& line_info) : line_style_(&line_info.LineStyle()), available_width_(line_info.AvailableWidth() - line_info.TextIndent()), @@ -44,6 +60,7 @@ NGLineBoxFragmentBuilder::ChildList* line_box, NGLineBoxFragmentBuilder::Child* ellipsized_child) { // Create the ellipsis, associating it with the ellipsized child. + DCHECK(ellipsized_child->HasInFlowFragment()); LayoutObject* ellipsized_layout_object = ellipsized_child->PhysicalFragment()->GetMutableLayoutObject(); DCHECK(ellipsized_layout_object); @@ -75,6 +92,48 @@ return ellipsis_inline_offset; } +wtf_size_t NGLineTruncator::AddTruncatedChild( + wtf_size_t source_index, + bool leave_one_character, + LayoutUnit position, + TextDirection edge, + NGLineBoxFragmentBuilder::ChildList* line_box, + NGInlineLayoutStateStack* box_states) { + NGLineBoxFragmentBuilder::ChildList& line = *line_box; + + scoped_refptr<ShapeResult> shape_result = + line[source_index].fragment->TextShapeResult()->CreateShapeResult(); + unsigned text_offset = shape_result->OffsetToFit(position, edge); + if (IsLtr(edge) ? IsLeftMostOffset(*shape_result, text_offset) + : IsRightMostOffset(*shape_result, text_offset)) { + if (!leave_one_character) + return kDidNotAddChild; + text_offset = + shape_result->OffsetToFit(shape_result->PositionForOffset( + IsRtl(edge) == shape_result->Rtl() + ? 1 + : shape_result->NumCharacters() - 1), + edge); + } + + const auto& fragment = line[source_index].fragment; + const bool keep_start = edge == fragment->ResolvedDirection(); + scoped_refptr<const NGPhysicalTextFragment> truncated_fragment = + keep_start ? fragment->TrimText(fragment->StartOffset(), + fragment->StartOffset() + text_offset) + : fragment->TrimText(fragment->StartOffset() + text_offset, + fragment->EndOffset()); + wtf_size_t new_index = line.size(); + line.AddChild(); + box_states->ChildInserted(new_index); + line[new_index] = line[source_index]; + line[new_index].inline_size = line_style_->IsHorizontalWritingMode() + ? truncated_fragment->Size().width + : truncated_fragment->Size().height; + line[new_index].fragment = std::move(truncated_fragment); + return new_index; +} + LayoutUnit NGLineTruncator::TruncateLine( LayoutUnit line_width, NGLineBoxFragmentBuilder::ChildList* line_box, @@ -143,6 +202,180 @@ return std::max(ellipsis_inline_offset + ellipsis_width_, line_width); } +// This function was designed to work only with <input type=file>. +// We assume the line box contains: +// (Optional) children without in-flow fragments +// Children with in-flow fragments, and +// (Optional) children without in-flow fragments +// in this order, and the children with in-flow fragments have no padding, +// no border, and no margin. +// Children with IsPlaceholder() can appear anywhere. +LayoutUnit NGLineTruncator::TruncateLineInTheMiddle( + LayoutUnit line_width, + NGLineBoxFragmentBuilder::ChildList* line_box, + NGInlineLayoutStateStack* box_states) { + // Shape the ellipsis and compute its inline size. + SetupEllipsis(); + + NGLineBoxFragmentBuilder::ChildList& line = *line_box; + wtf_size_t initial_index_left = kNotFound; + wtf_size_t initial_index_right = kNotFound; + for (wtf_size_t i = 0; i < line_box->size(); ++i) { + auto& child = line[i]; + if (!child.fragment && child.IsPlaceholder()) + continue; + if (child.HasOutOfFlowFragment() || !child.fragment || + !child.fragment->TextShapeResult()) { + if (initial_index_right != kNotFound) + break; + continue; + } + if (initial_index_left == kNotFound) + initial_index_left = i; + initial_index_right = i; + } + // There are no truncatable children. + if (initial_index_left == kNotFound) + return line_width; + DCHECK_NE(initial_index_right, kNotFound); + DCHECK(line[initial_index_left].HasInFlowFragment()); + DCHECK(line[initial_index_right].HasInFlowFragment()); + + // line[]: + // s s s p f f p f f s s + // ^ ^ + // initial_index_left | + // initial_index_right + // s: child without in-flow fragment + // p: placeholder child + // f: child with in-flow fragment + + const LayoutUnit static_width_left = line[initial_index_left].InlineOffset(); + LayoutUnit static_width_right = LayoutUnit(0); + for (wtf_size_t i = initial_index_right + 1; i < line.size(); ++i) + static_width_right += line[i].inline_size; + const LayoutUnit available_width = + available_width_ - static_width_left - static_width_right; + if (available_width <= ellipsis_width_) + return line_width; + LayoutUnit available_width_left = (available_width - ellipsis_width_) / 2; + LayoutUnit available_width_right = available_width_left; + + // Children for ellipsis and truncated fragments will have index which + // is >= new_child_start. + const wtf_size_t new_child_start = line.size(); + + wtf_size_t index_left = initial_index_left; + wtf_size_t index_right = initial_index_right; + + if (IsLtr(line_direction_)) { + // Find truncation point at the left, truncate, and add an ellipsis. + while (available_width_left >= line[index_left].inline_size) + available_width_left -= line[index_left++].inline_size; + DCHECK_LE(index_left, index_right); + DCHECK(!line[index_left].IsPlaceholder()); + wtf_size_t new_index = AddTruncatedChild( + index_left, index_left == initial_index_left, available_width_left, + TextDirection::kLtr, line_box, box_states); + if (new_index == kDidNotAddChild) { + DCHECK_GT(index_left, initial_index_left); + DCHECK_GT(index_left, 0u); + wtf_size_t i = index_left; + while (!line[--i].HasInFlowFragment()) + DCHECK(line[i].IsPlaceholder()); + PlaceEllipsisNextTo(line_box, &line[i]); + available_width_right += available_width_left; + } else { + PlaceEllipsisNextTo(line_box, &line[new_index]); + available_width_right += + available_width_left - line[new_index].inline_size; + } + + // Find truncation point at the right. + while (available_width_right >= line[index_right].inline_size) + available_width_right -= line[index_right--].inline_size; + LayoutUnit new_modified_right_offset = + line[line.size() - 1].InlineOffset() + ellipsis_width_; + DCHECK_LE(index_left, index_right); + DCHECK(!line[index_right].IsPlaceholder()); + if (available_width_right > 0) { + new_index = AddTruncatedChild( + index_right, false, + line[index_right].inline_size - available_width_right, + TextDirection::kRtl, line_box, box_states); + if (new_index != kDidNotAddChild) { + line[new_index].rect.offset.inline_offset = new_modified_right_offset; + new_modified_right_offset += line[new_index].inline_size; + } + } + // Shift unchanged children at the right of the truncated child. + // It's ok to modify existing children's offsets because they are not + // web-exposed. + LayoutUnit offset_diff = line[index_right].InlineOffset() + + line[index_right].inline_size - + new_modified_right_offset; + for (wtf_size_t i = index_right + 1; i < new_child_start; ++i) + line[i].rect.offset.inline_offset -= offset_diff; + line_width -= offset_diff; + + } else { + // Find truncation point at the right, truncate, and add an ellipsis. + while (available_width_right >= line[index_right].inline_size) + available_width_right -= line[index_right--].inline_size; + DCHECK_LE(index_left, index_right); + DCHECK(!line[index_right].IsPlaceholder()); + wtf_size_t new_index = + AddTruncatedChild(index_right, index_right == initial_index_right, + line[index_right].inline_size - available_width_right, + TextDirection::kRtl, line_box, box_states); + if (new_index == kDidNotAddChild) { + DCHECK_LT(index_right, initial_index_right); + wtf_size_t i = index_right; + while (!line[++i].HasInFlowFragment()) + DCHECK(line[i].IsPlaceholder()); + PlaceEllipsisNextTo(line_box, &line[i]); + available_width_left += available_width_right; + } else { + line[new_index].rect.offset.inline_offset += + line[index_right].inline_size - line[new_index].inline_size; + PlaceEllipsisNextTo(line_box, &line[new_index]); + available_width_left += + available_width_right - line[new_index].inline_size; + } + LayoutUnit ellipsis_offset = line[line.size() - 1].InlineOffset(); + + // Find truncation point at the left. + while (available_width_left >= line[index_left].inline_size) + available_width_left -= line[index_left++].inline_size; + DCHECK_LE(index_left, index_right); + DCHECK(!line[index_left].IsPlaceholder()); + if (available_width_left > 0) { + new_index = AddTruncatedChild(index_left, false, available_width_left, + TextDirection::kLtr, line_box, box_states); + if (new_index != kDidNotAddChild) { + line[new_index].rect.offset.inline_offset = + ellipsis_offset - line[new_index].inline_size; + } + } + + // Shift unchanged children at the left of the truncated child. + // It's ok to modify existing children's offsets because they are not + // web-exposed. + LayoutUnit offset_diff = + line[line.size() - 1].InlineOffset() - line[index_left].InlineOffset(); + for (wtf_size_t i = index_left; i > 0; --i) + line[i - 1].rect.offset.inline_offset += offset_diff; + line_width -= offset_diff; + } + // Hide left/right truncated children and children between them. + for (wtf_size_t i = index_left; i <= index_right; ++i) { + if (line[i].HasInFlowFragment()) + HideChild(&line[i]); + } + + return line_width; +} + // Hide this child from being painted. Leaves a hidden fragment so that layout // queries such as |offsetWidth| work as if it is not truncated. void NGLineTruncator::HideChild(NGLineBoxFragmentBuilder::Child* child) {
diff --git a/third_party/blink/renderer/core/layout/ng/inline/ng_line_truncator.h b/third_party/blink/renderer/core/layout/ng/inline/ng_line_truncator.h index f0dd0a8..c65fa3c 100644 --- a/third_party/blink/renderer/core/layout/ng/inline/ng_line_truncator.h +++ b/third_party/blink/renderer/core/layout/ng/inline/ng_line_truncator.h
@@ -33,6 +33,11 @@ NGLineBoxFragmentBuilder::ChildList* line_box, NGInlineLayoutStateStack* box_states); + LayoutUnit TruncateLineInTheMiddle( + LayoutUnit line_width, + NGLineBoxFragmentBuilder::ChildList* line_box, + NGInlineLayoutStateStack* box_states); + private: const ComputedStyle& EllipsisStyle() const; @@ -44,6 +49,24 @@ NGLineBoxFragmentBuilder::ChildList* line_box, NGLineBoxFragmentBuilder::Child* ellipsized_child); + static constexpr wtf_size_t kDidNotAddChild = WTF::kNotFound; + // Add a child with truncated text of (*line_box)[source_index]. + // This function returns the index of the new child. + // If the truncated text is empty, kDidNotAddChild is returned. + // + // |leave_one_character| - Force to leave at least one character regardless of + // |position|. + // |position| and |edge| - Indicate truncation point and direction. + // If |edge| is TextDirection::kLtr, the left side of + // |position| will be copied to the new child. + // Otherwise, the right side of |position| will be + // copied. + wtf_size_t AddTruncatedChild(wtf_size_t source_index, + bool leave_one_character, + LayoutUnit position, + TextDirection edge, + NGLineBoxFragmentBuilder::ChildList* line_box, + NGInlineLayoutStateStack* box_states); bool EllipsizeChild( LayoutUnit line_width, LayoutUnit ellipsis_width,
diff --git a/third_party/blink/renderer/core/paint/background_image_geometry.cc b/third_party/blink/renderer/core/paint/background_image_geometry.cc index 3f08574..eadaebb 100644 --- a/third_party/blink/renderer/core/paint/background_image_geometry.cc +++ b/third_party/blink/renderer/core/paint/background_image_geometry.cc
@@ -43,22 +43,8 @@ if (!view) return false; - // TODO(wangxianzhu): For CAP, inline this function into - // FixedBackgroundPaintsInLocalCoordinates(). - if (RuntimeEnabledFeatures::CompositeAfterPaintEnabled()) { - return view->GetBackgroundPaintLocation() != - kBackgroundPaintInScrollingContents; - } - - if (global_paint_flags & kGlobalPaintFlattenCompositingLayers) - return false; - - PaintLayer* root_layer = view->Layer(); - if (!root_layer || root_layer->GetCompositingState() == kNotComposited) - return false; - - CompositedLayerMapping* mapping = root_layer->GetCompositedLayerMapping(); - return !mapping->BackgroundPaintsOntoScrollingContentsLayer(); + return !(view->GetBackgroundPaintLocation() & + kBackgroundPaintInScrollingContents); } LayoutPoint AccumulatedScrollOffsetForFixedBackground( @@ -405,15 +391,8 @@ // The LayoutView is the only object that can paint a fixed background into // its scrolling contents layer, so it gets a special adjustment here. if (auto* layout_view = DynamicTo<LayoutView>(obj)) { - if (RuntimeEnabledFeatures::CompositeAfterPaintEnabled()) { - DCHECK_EQ(obj.GetBackgroundPaintLocation(), - kBackgroundPaintInScrollingContents); + if (obj.GetBackgroundPaintLocation() & kBackgroundPaintInScrollingContents) rect.SetLocation(LayoutPoint(layout_view->ScrolledContentOffset())); - } else if (auto* mapping = obj.Layer()->GetCompositedLayerMapping()) { - if (mapping->BackgroundPaintsOntoScrollingContentsLayer()) { - rect.SetLocation(LayoutPoint(layout_view->ScrolledContentOffset())); - } - } } rect.MoveBy(AccumulatedScrollOffsetForFixedBackground(obj, container));
diff --git a/third_party/blink/renderer/core/paint/box_paint_invalidator.cc b/third_party/blink/renderer/core/paint/box_paint_invalidator.cc index bb1a9a4..53a09c5 100644 --- a/third_party/blink/renderer/core/paint/box_paint_invalidator.cc +++ b/third_party/blink/renderer/core/paint/box_paint_invalidator.cc
@@ -184,27 +184,14 @@ bool BoxPaintInvalidator::BackgroundPaintsOntoScrollingContentsLayer() { if (!HasEffectiveBackground()) return false; - if (RuntimeEnabledFeatures::CompositeAfterPaintEnabled()) { - return box_.GetBackgroundPaintLocation() & - kBackgroundPaintInScrollingContents; - } - if (!box_.HasLayer()) - return false; - if (auto* mapping = box_.Layer()->GetCompositedLayerMapping()) - return mapping->BackgroundPaintsOntoScrollingContentsLayer(); - return false; + return box_.GetBackgroundPaintLocation() & + kBackgroundPaintInScrollingContents; } bool BoxPaintInvalidator::BackgroundPaintsOntoMainGraphicsLayer() { if (!HasEffectiveBackground()) return false; - if (RuntimeEnabledFeatures::CompositeAfterPaintEnabled()) - return box_.GetBackgroundPaintLocation() & kBackgroundPaintInGraphicsLayer; - if (!box_.HasLayer()) - return true; - if (auto* mapping = box_.Layer()->GetCompositedLayerMapping()) - return mapping->BackgroundPaintsOntoGraphicsLayer(); - return true; + return box_.GetBackgroundPaintLocation() & kBackgroundPaintInGraphicsLayer; } bool BoxPaintInvalidator::ShouldFullyInvalidateBackgroundOnLayoutOverflowChange( @@ -288,16 +275,6 @@ BoxPaintInvalidator::BackgroundInvalidationType BoxPaintInvalidator::ComputeBackgroundInvalidation( bool& should_invalidate_all_layers) { - // Need to fully invalidate the background on all layers if background paint - // location changed. - auto new_background_location = box_.GetBackgroundPaintLocation(); - if (new_background_location != box_.PreviousBackgroundPaintLocation()) { - should_invalidate_all_layers = true; - box_.GetMutableForPainting().SetPreviousBackgroundPaintLocation( - new_background_location); - return BackgroundInvalidationType::kFull; - } - // If background changed, we may paint the background on different graphics // layer, so we need to fully invalidate the background on all layers. if (box_.BackgroundNeedsFullPaintInvalidation()) {
diff --git a/third_party/blink/renderer/core/paint/box_painter_test.cc b/third_party/blink/renderer/core/paint/box_painter_test.cc index b886a493..5a929df6 100644 --- a/third_party/blink/renderer/core/paint/box_painter_test.cc +++ b/third_party/blink/renderer/core/paint/box_painter_test.cc
@@ -209,11 +209,6 @@ } TEST_P(BoxPainterTest, ScrollHitTestProperties) { - // This test depends on the CompositeAfterPaint behavior of painting solid - // color backgrounds into both the non-scrolled and scrolled spaces. - if (!RuntimeEnabledFeatures::CompositeAfterPaintEnabled()) - return; - SetBodyInnerHTML(R"HTML( <style> ::-webkit-scrollbar { display: none; } @@ -239,15 +234,14 @@ // scrolled contents. EXPECT_EQ( kBackgroundPaintInGraphicsLayer | kBackgroundPaintInScrollingContents, - container.GetBackgroundPaintLocation()); + container.ComputeBackgroundPaintLocationIfComposited()); + EXPECT_EQ(kBackgroundPaintInGraphicsLayer, + container.GetBackgroundPaintLocation()); EXPECT_THAT( RootPaintController().GetDisplayItemList(), ElementsAre( IsSameId(&ViewScrollingBackgroundClient(), kDocumentBackgroundType), IsSameId(&container, kBackgroundType), - IsSameId(&container.GetScrollableArea() - ->GetScrollingBackgroundDisplayItemClient(), - kBackgroundType), IsSameId(&child, kBackgroundType))); HitTestData scroll_hit_test_data; @@ -271,9 +265,10 @@ PaintChunk::Id(container, DisplayItem::kScrollHitTest), container.FirstFragment().LocalBorderBoxProperties(), &scroll_hit_test_data, IntRect(0, 0, 200, 200)), - IsPaintChunk(2, 4, - PaintChunk::Id(container, kScrollingBackgroundChunkType), - scrolling_contents_properties))); + IsPaintChunk( + 2, 3, + PaintChunk::Id(container, kClippedContentsBackgroundChunkType), + scrolling_contents_properties))); // We always create scroll node for the root layer. const auto& root_transform = paint_chunks[0].properties.Transform();
diff --git a/third_party/blink/renderer/core/paint/compositing/composited_layer_mapping.cc b/third_party/blink/renderer/core/paint/compositing/composited_layer_mapping.cc index 41967f4..4a32393 100644 --- a/third_party/blink/renderer/core/paint/compositing/composited_layer_mapping.cc +++ b/third_party/blink/renderer/core/paint/compositing/composited_layer_mapping.cc
@@ -190,8 +190,6 @@ : owning_layer_(layer), pending_update_scope_(kGraphicsLayerUpdateNone), scrolling_contents_are_empty_(false), - background_paints_onto_scrolling_contents_layer_(false), - background_paints_onto_graphics_layer_(false), draws_background_onto_content_layer_(false) { CreatePrimaryGraphicsLayer(); } @@ -260,40 +258,6 @@ graphics_layer_->SetHitTestable(true); } -void CompositedLayerMapping::UpdateBackgroundPaintsOntoScrollingContentsLayer( - bool& invalidate_graphics_layer, - bool& invalidate_scrolling_contents_layer) { - invalidate_graphics_layer = false; - invalidate_scrolling_contents_layer = false; - // We can only paint the background onto the scrolling contents layer if - // it would be visually correct and we are using composited scrolling meaning - // we have a scrolling contents layer to paint it into. - BackgroundPaintLocation paint_location = - GetLayoutObject().GetBackgroundPaintLocation(); - bool should_paint_onto_scrolling_contents_layer = - paint_location & kBackgroundPaintInScrollingContents && - owning_layer_.GetScrollableArea()->UsesCompositedScrolling(); - if (should_paint_onto_scrolling_contents_layer != - BackgroundPaintsOntoScrollingContentsLayer()) { - background_paints_onto_scrolling_contents_layer_ = - should_paint_onto_scrolling_contents_layer; - // The scrolling contents layer needs to be updated for changed - // m_backgroundPaintsOntoScrollingContentsLayer. - if (HasScrollingLayer()) - invalidate_scrolling_contents_layer = true; - } - bool should_paint_onto_graphics_layer = - !background_paints_onto_scrolling_contents_layer_ || - paint_location & kBackgroundPaintInGraphicsLayer; - if (should_paint_onto_graphics_layer != - !!background_paints_onto_graphics_layer_) { - background_paints_onto_graphics_layer_ = should_paint_onto_graphics_layer; - // The graphics layer needs to be updated for changed - // m_backgroundPaintsOntoGraphicsLayer. - invalidate_graphics_layer = true; - } -} - void CompositedLayerMapping::UpdateContentsOpaque() { // If there is a foreground layer, children paint into that layer and // not graphics_layer_, and so don't contribute to the opaqueness of the @@ -322,40 +286,35 @@ // TODO(crbug.com/705019): Contents could be opaque, but that cannot be // determined from the main thread. Or can it? graphics_layer_->SetContentsOpaque(false); - } else { - // For non-root layers, background is painted by the scrolling contents - // layer if all backgrounds are background attachment local, otherwise - // background is painted by the primary graphics layer. - if (HasScrollingLayer() && - background_paints_onto_scrolling_contents_layer_) { - // Backgrounds painted onto the foreground are clipped by the padding box - // rect. - // TODO(flackr): This should actually check the entire overflow rect - // within the scrolling contents layer but since we currently only trigger - // this for solid color backgrounds the answer will be the same. - scrolling_contents_layer_->SetContentsOpaque( - owning_layer_.BackgroundIsKnownToBeOpaqueInRect( - ToLayoutBox(GetLayoutObject()).PhysicalPaddingBoxRect(), - should_check_children)); + } else if (BackgroundPaintsOntoScrollingContentsLayer()) { + DCHECK(HasScrollingLayer()); + // Backgrounds painted onto the foreground are clipped by the padding box + // rect. + // TODO(flackr): This should actually check the entire overflow rect + // within the scrolling contents layer but since we currently only trigger + // this for solid color backgrounds the answer will be the same. + scrolling_contents_layer_->SetContentsOpaque( + owning_layer_.BackgroundIsKnownToBeOpaqueInRect( + ToLayoutBox(GetLayoutObject()).PhysicalPaddingBoxRect(), + should_check_children)); - if (GetLayoutObject().GetBackgroundPaintLocation() & - kBackgroundPaintInGraphicsLayer) { - graphics_layer_->SetContentsOpaque( - owning_layer_.BackgroundIsKnownToBeOpaqueInRect( - CompositedBounds(), should_check_children)); - } else { - // If we only paint the background onto the scrolling contents layer we - // are going to leave a hole in the m_graphicsLayer where the background - // is so it is not opaque. - graphics_layer_->SetContentsOpaque(false); - } - } else { - if (HasScrollingLayer()) - scrolling_contents_layer_->SetContentsOpaque(false); + if (BackgroundPaintsOntoGraphicsLayer()) { graphics_layer_->SetContentsOpaque( owning_layer_.BackgroundIsKnownToBeOpaqueInRect( CompositedBounds(), should_check_children)); + } else { + // If we only paint the background onto the scrolling contents layer we + // are going to leave a hole in the m_graphicsLayer where the background + // is so it is not opaque. + graphics_layer_->SetContentsOpaque(false); } + } else { + DCHECK(BackgroundPaintsOntoGraphicsLayer()); + if (HasScrollingLayer()) + scrolling_contents_layer_->SetContentsOpaque(false); + graphics_layer_->SetContentsOpaque( + owning_layer_.BackgroundIsKnownToBeOpaqueInRect(CompositedBounds(), + should_check_children)); } } @@ -763,22 +722,7 @@ UpdateContentsRect(); UpdateBackgroundColor(); - - bool invalidate_graphics_layer; - bool invalidate_scrolling_contents_layer; - UpdateBackgroundPaintsOntoScrollingContentsLayer( - invalidate_graphics_layer, invalidate_scrolling_contents_layer); - - // This depends on background_paints_onto_graphics_layer_. UpdateDrawsContentAndPaintsHitTest(); - - // These invalidations need to happen after - // |UpdateDrawsContentAndPaintsHitTest|. - if (invalidate_graphics_layer) - graphics_layer_->SetNeedsDisplay(); - if (invalidate_scrolling_contents_layer) - scrolling_contents_layer_->SetNeedsDisplay(); - UpdateElementId(); UpdateContentsOpaque(); UpdateRasterizationPolicy(); @@ -1546,7 +1490,7 @@ if (layout_object.GetNode() && layout_object.GetNode()->IsDocumentNode()) { if (owning_layer_.NeedsCompositedScrolling()) - return background_paints_onto_graphics_layer_; + return BackgroundPaintsOntoGraphicsLayer(); // Look to see if the root object has a non-simple background LayoutObject* root_object = @@ -2166,10 +2110,10 @@ graphics_layer == mask_layer_.get() || graphics_layer == scrolling_contents_layer_.get() || graphics_layer == decoration_outline_layer_.get()) { - if (background_paints_onto_scrolling_contents_layer_) { + if (BackgroundPaintsOntoScrollingContentsLayer()) { if (graphics_layer == scrolling_contents_layer_.get()) paint_layer_flags &= ~kPaintLayerPaintingSkipRootBackground; - else if (!background_paints_onto_graphics_layer_) + else if (!BackgroundPaintsOntoGraphicsLayer()) paint_layer_flags |= kPaintLayerPaintingSkipRootBackground; }
diff --git a/third_party/blink/renderer/core/paint/compositing/composited_layer_mapping.h b/third_party/blink/renderer/core/paint/compositing/composited_layer_mapping.h index 7a055a2..bb399d8 100644 --- a/third_party/blink/renderer/core/paint/compositing/composited_layer_mapping.h +++ b/third_party/blink/renderer/core/paint/compositing/composited_layer_mapping.h
@@ -100,12 +100,6 @@ const PaintLayer* compositing_container, Vector<PaintLayer*>& layers_needing_paint_invalidation); - // Update whether background paints onto scrolling contents layer. - // Returns (through the reference params) what invalidations are needed. - void UpdateBackgroundPaintsOntoScrollingContentsLayer( - bool& invalidate_graphics_layer, - bool& invalidate_scrolling_contents_layer); - // Update whether layer needs blending. void UpdateContentsOpaque(); @@ -257,27 +251,29 @@ bool AdjustForCompositedScrolling(const GraphicsLayer*, IntSize& offset) const; + bool DrawsBackgroundOntoContentLayer() const { + return draws_background_onto_content_layer_; + } + + private: // Returns true for layers with scrollable overflow which have a background // that can be painted into the composited scrolling contents layer (i.e. // the background can scroll with the content). When the background is also // opaque this allows us to composite the scroller even on low DPI as we can // draw with subpixel anti-aliasing. bool BackgroundPaintsOntoScrollingContentsLayer() const { - return background_paints_onto_scrolling_contents_layer_; + return GetLayoutObject().GetBackgroundPaintLocation() & + kBackgroundPaintInScrollingContents; } // Returns true if the background paints onto the main graphics layer. // In some situations, we may paint background on both the main graphics layer // and the scrolling contents layer. bool BackgroundPaintsOntoGraphicsLayer() const { - return background_paints_onto_graphics_layer_; + return GetLayoutObject().GetBackgroundPaintLocation() & + kBackgroundPaintInGraphicsLayer; } - bool DrawsBackgroundOntoContentLayer() const { - return draws_background_onto_content_layer_; - } - - private: IntRect RecomputeInterestRect(const GraphicsLayer*) const; static bool InterestRectChangedEnoughToRepaint( const IntRect& previous_interest_rect, @@ -484,15 +480,6 @@ unsigned scrolling_contents_are_empty_ : 1; - // Keep track of whether the background is painted onto the scrolling contents - // layer for invalidations. - unsigned background_paints_onto_scrolling_contents_layer_ : 1; - - // Solid color border boxes may be painted into both the scrolling contents - // layer and the graphics layer because the scrolling contents layer is - // clipped by the padding box. - unsigned background_paints_onto_graphics_layer_ : 1; - bool draws_background_onto_content_layer_; friend class CompositedLayerMappingTest;
diff --git a/third_party/blink/renderer/core/paint/compositing/composited_layer_mapping_test.cc b/third_party/blink/renderer/core/paint/compositing/composited_layer_mapping_test.cc index 422234a..b43664b 100644 --- a/third_party/blink/renderer/core/paint/compositing/composited_layer_mapping_test.cc +++ b/third_party/blink/renderer/core/paint/compositing/composited_layer_mapping_test.cc
@@ -1150,7 +1150,7 @@ const auto* container = ToLayoutBox(GetLayoutObjectByElementId("container")); EXPECT_EQ(kBackgroundPaintInScrollingContents, - container->GetBackgroundPaintLocation()); + container->ComputeBackgroundPaintLocationIfComposited()); // We currently don't use composited scrolling when the container has a // border-radius so even though we can paint the background onto the scrolling @@ -1158,7 +1158,8 @@ // this case. const auto* mapping = container->Layer()->GetCompositedLayerMapping(); EXPECT_FALSE(mapping->HasScrollingLayer()); - EXPECT_FALSE(mapping->BackgroundPaintsOntoScrollingContentsLayer()); + EXPECT_EQ(kBackgroundPaintInGraphicsLayer, + container->GetBackgroundPaintLocation()); } TEST_F(CompositedLayerMappingTest, StickyPositionMainThreadOffset) {
diff --git a/third_party/blink/renderer/core/paint/paint_and_raster_invalidation_test.cc b/third_party/blink/renderer/core/paint/paint_and_raster_invalidation_test.cc index 53a4a9d..773e223 100644 --- a/third_party/blink/renderer/core/paint/paint_and_raster_invalidation_test.cc +++ b/third_party/blink/renderer/core/paint/paint_and_raster_invalidation_test.cc
@@ -329,11 +329,6 @@ UpdateAllLifecyclePhasesForTest(); EXPECT_EQ(kBackgroundPaintInScrollingContents, GetLayoutView().GetBackgroundPaintLocation()); - if (!RuntimeEnabledFeatures::CompositeAfterPaintEnabled()) { - const auto* mapping = GetLayoutView().Layer()->GetCompositedLayerMapping(); - EXPECT_TRUE(mapping->BackgroundPaintsOntoScrollingContentsLayer()); - EXPECT_FALSE(mapping->BackgroundPaintsOntoGraphicsLayer()); - } // Resize the content. GetDocument().View()->SetTracksRasterInvalidations(true); @@ -364,11 +359,6 @@ UpdateAllLifecyclePhasesForTest(); EXPECT_EQ(kBackgroundPaintInScrollingContents, GetLayoutView().GetBackgroundPaintLocation()); - if (!RuntimeEnabledFeatures::CompositeAfterPaintEnabled()) { - const auto* mapping = GetLayoutView().Layer()->GetCompositedLayerMapping(); - EXPECT_TRUE(mapping->BackgroundPaintsOntoScrollingContentsLayer()); - EXPECT_FALSE(mapping->BackgroundPaintsOntoGraphicsLayer()); - } // Resize the content. GetDocument().View()->SetTracksRasterInvalidations(true); @@ -414,6 +404,10 @@ content->GetLayoutObject()->ContainerForPaintInvalidation()); } EXPECT_EQ(kBackgroundPaintInScrollingContents, + content->GetLayoutObject() + ->View() + ->ComputeBackgroundPaintLocationIfComposited()); + EXPECT_EQ(kBackgroundPaintInGraphicsLayer, content->GetLayoutObject()->View()->GetBackgroundPaintLocation()); // Resize the content. @@ -430,11 +424,7 @@ UpdateAllLifecyclePhasesForTest(); // The iframe doesn't have anything visible by itself, so we only issue // raster invalidation for the frame contents. - const auto* iframe_layout_view = content->GetLayoutObject()->View(); - const auto* client = RuntimeEnabledFeatures::CompositeAfterPaintEnabled() - ? &iframe_layout_view->GetScrollableArea() - ->GetScrollingBackgroundDisplayItemClient() - : iframe_layout_view; + const auto* client = content->GetLayoutObject()->View(); EXPECT_THAT(GetRasterInvalidationTracking()->Invalidations(), UnorderedElementsAre(RasterInvalidationInfo{ client, client->DebugName(), IntRect(0, 100, 100, 100), @@ -489,7 +479,6 @@ UpdateAllLifecyclePhasesForTest(); Element* iframe = GetDocument().getElementById("iframe"); Element* content = ChildDocument().getElementById("content"); - LayoutView* frame_layout_view = content->GetLayoutObject()->View(); if (!RuntimeEnabledFeatures::CompositeAfterPaintEnabled()) { EXPECT_EQ(GetLayoutView(), content->GetLayoutObject()->ContainerForPaintInvalidation()); @@ -499,28 +488,11 @@ GetDocument().View()->SetTracksRasterInvalidations(true); content->setAttribute(html_names::kStyleAttr, "height: 500px"); UpdateAllLifecyclePhasesForTest(); - const auto* client = RuntimeEnabledFeatures::CompositeAfterPaintEnabled() - ? &frame_layout_view->GetScrollableArea() - ->GetScrollingBackgroundDisplayItemClient() - : frame_layout_view; - if (RuntimeEnabledFeatures::CompositeAfterPaintEnabled()) { - // The duplication is because we invalidated both the old visual rect and - // the new visual rect of the scrolling background display item which - // changed size, and then both mapped to the same rect in the layer. - EXPECT_THAT(GetRasterInvalidationTracking()->Invalidations(), - UnorderedElementsAre( - RasterInvalidationInfo{ - client, client->DebugName(), IntRect(0, 0, 100, 100), - PaintInvalidationReason::kBackground}, - RasterInvalidationInfo{ - client, client->DebugName(), IntRect(0, 0, 100, 100), - PaintInvalidationReason::kBackground})); - } else { - EXPECT_THAT(GetRasterInvalidationTracking()->Invalidations(), - UnorderedElementsAre(RasterInvalidationInfo{ - client, client->DebugName(), IntRect(0, 0, 100, 100), - PaintInvalidationReason::kBackground})); - } + const auto* client = content->GetLayoutObject()->View(); + EXPECT_THAT(GetRasterInvalidationTracking()->Invalidations(), + UnorderedElementsAre(RasterInvalidationInfo{ + client, client->DebugName(), IntRect(0, 0, 100, 100), + PaintInvalidationReason::kBackground})); GetDocument().View()->SetTracksRasterInvalidations(false); // Resize the iframe. @@ -542,6 +514,7 @@ Element* target = GetDocument().getElementById("target"); target->setAttribute(html_names::kClassAttr, "solid composited scroll local-attachment border"); + UpdateAllLifecyclePhasesForTest(); target->setInnerHTML( "<div id=child style='width: 500px; height: 500px'></div>", ASSERT_NO_EXCEPTION); @@ -551,11 +524,6 @@ auto* target_obj = ToLayoutBoxModelObject(target->GetLayoutObject()); EXPECT_EQ(kBackgroundPaintInScrollingContents, target_obj->GetBackgroundPaintLocation()); - if (!RuntimeEnabledFeatures::CompositeAfterPaintEnabled()) { - const auto* mapping = target_obj->Layer()->GetCompositedLayerMapping(); - EXPECT_TRUE(mapping->BackgroundPaintsOntoScrollingContentsLayer()); - EXPECT_FALSE(mapping->BackgroundPaintsOntoGraphicsLayer()); - } auto container_raster_invalidation_tracking = [&]() -> const RasterInvalidationTracking* { @@ -640,11 +608,6 @@ UpdateAllLifecyclePhasesForTest(); EXPECT_EQ(kBackgroundPaintInScrollingContents, target_obj->GetBackgroundPaintLocation()); - if (!RuntimeEnabledFeatures::CompositeAfterPaintEnabled()) { - const auto* mapping = target_obj->Layer()->GetCompositedLayerMapping(); - EXPECT_TRUE(mapping->BackgroundPaintsOntoScrollingContentsLayer()); - EXPECT_FALSE(mapping->BackgroundPaintsOntoGraphicsLayer()); - } // No invalidation on the container layer. EXPECT_FALSE(container_raster_invalidation_tracking()->HasInvalidations()); @@ -686,7 +649,10 @@ if (!RuntimeEnabledFeatures::CompositeAfterPaintEnabled()) EXPECT_EQ(&GetLayoutView(), object->ContainerForPaintInvalidation()); EXPECT_EQ(kBackgroundPaintInScrollingContents, - ToLayoutBoxModelObject(object)->GetBackgroundPaintLocation()); + ToLayoutBoxModelObject(object) + ->ComputeBackgroundPaintLocationIfComposited()); + EXPECT_EQ(kBackgroundPaintInGraphicsLayer, + object->GetBackgroundPaintLocation()); // Resize the content. GetDocument().View()->SetTracksRasterInvalidations(true); @@ -729,11 +695,6 @@ EXPECT_EQ( kBackgroundPaintInScrollingContents | kBackgroundPaintInGraphicsLayer, target_object->GetBackgroundPaintLocation()); - if (!RuntimeEnabledFeatures::CompositeAfterPaintEnabled()) { - const auto* mapping = target_object->Layer()->GetCompositedLayerMapping(); - EXPECT_TRUE(mapping->BackgroundPaintsOntoScrollingContentsLayer()); - EXPECT_TRUE(mapping->BackgroundPaintsOntoGraphicsLayer()); - } const auto* contents_raster_invalidation_tracking = RuntimeEnabledFeatures::CompositeAfterPaintEnabled()
diff --git a/third_party/blink/renderer/core/paint/paint_controller_paint_test.cc b/third_party/blink/renderer/core/paint/paint_controller_paint_test.cc index b0e73c5..cafc505 100644 --- a/third_party/blink/renderer/core/paint/paint_controller_paint_test.cc +++ b/third_party/blink/renderer/core/paint/paint_controller_paint_test.cc
@@ -316,9 +316,6 @@ ElementsAre( IsSameId(&ViewScrollingBackgroundClient(), kDocumentBackgroundType), IsSameId(&container, kBackgroundType), - IsSameId(&container.GetScrollableArea() - ->GetScrollingBackgroundDisplayItemClient(), - kBackgroundType), IsSameId(&child, kBackgroundType))); HitTestData view_scroll_hit_test; view_scroll_hit_test.scroll_translation = @@ -349,9 +346,10 @@ PaintChunk::Id(container, DisplayItem::kScrollHitTest), container.FirstFragment().LocalBorderBoxProperties(), &container_scroll_hit_test, IntRect(0, 0, 200, 200)), - IsPaintChunk(2, 4, - PaintChunk::Id(container, kScrollingBackgroundChunkType), - container.FirstFragment().ContentsProperties()))); + IsPaintChunk( + 2, 3, + PaintChunk::Id(container, kClippedContentsBackgroundChunkType), + container.FirstFragment().ContentsProperties()))); } TEST_P(PaintControllerPaintTestForCAP, NonStackingScrollHitTestOrder) { @@ -393,9 +391,6 @@ IsSameId(&ViewScrollingBackgroundClient(), kDocumentBackgroundType), IsSameId(&neg_z_child, kBackgroundType), IsSameId(&container, kBackgroundType), - IsSameId(&container.GetScrollableArea() - ->GetScrollingBackgroundDisplayItemClient(), - kBackgroundType), IsSameId(&child, kBackgroundType), IsSameId(&pos_z_child, kBackgroundType))); HitTestData container_scroll_hit_test; @@ -427,11 +422,12 @@ PaintChunk::Id(container, DisplayItem::kScrollHitTest), container.FirstFragment().LocalBorderBoxProperties(), &container_scroll_hit_test, IntRect(0, 0, 200, 200)), - IsPaintChunk(3, 5, - PaintChunk::Id(container, kScrollingBackgroundChunkType), - container.FirstFragment().ContentsProperties()), IsPaintChunk( - 5, 6, + 3, 4, + PaintChunk::Id(container, kClippedContentsBackgroundChunkType), + container.FirstFragment().ContentsProperties()), + IsPaintChunk( + 4, 5, PaintChunk::Id(*pos_z_child.Layer(), DisplayItem::kLayerChunk), pos_z_child.FirstFragment().LocalBorderBoxProperties()))); }
diff --git a/third_party/blink/renderer/core/paint/paint_layer.cc b/third_party/blink/renderer/core/paint/paint_layer.cc index 226235642..0d52eb1 100644 --- a/third_party/blink/renderer/core/paint/paint_layer.cc +++ b/third_party/blink/renderer/core/paint/paint_layer.cc
@@ -865,19 +865,6 @@ } } -TransformationMatrix PaintLayer::PerspectiveTransform() const { - if (!GetLayoutObject().HasTransformRelatedProperty()) - return TransformationMatrix(); - - const ComputedStyle& style = GetLayoutObject().StyleRef(); - if (!style.HasPerspective()) - return TransformationMatrix(); - - TransformationMatrix t; - t.ApplyPerspective(style.Perspective()); - return t; -} - FloatPoint PaintLayer::PerspectiveOrigin() const { if (!GetLayoutObject().HasTransformRelatedProperty()) return FloatPoint(); @@ -1555,12 +1542,16 @@ if (Compositor()) { Compositor()->SetNeedsCompositingUpdate(kCompositingUpdateRebuildTree); } + GetLayoutObject().SetNeedsPaintPropertyUpdate(); } else if (!RequiresScrollableArea() && scrollable_area_) { scrollable_area_->Dispose(); scrollable_area_.Clear(); if (Compositor()) { Compositor()->SetNeedsCompositingUpdate(kCompositingUpdateRebuildTree); } + GetLayoutObject().SetBackgroundPaintLocation( + kBackgroundPaintInGraphicsLayer); + GetLayoutObject().SetNeedsPaintPropertyUpdate(); } }
diff --git a/third_party/blink/renderer/core/paint/paint_layer.h b/third_party/blink/renderer/core/paint/paint_layer.h index 3f650d3..98a4660 100644 --- a/third_party/blink/renderer/core/paint/paint_layer.h +++ b/third_party/blink/renderer/core/paint/paint_layer.h
@@ -509,10 +509,6 @@ TransformationMatrix CurrentTransform() const; TransformationMatrix RenderableTransform(GlobalPaintFlags) const; - // Get the perspective transform, which is applied to transformed sublayers. - // Returns true if the layer has a -webkit-perspective. - // Note that this transform does not have the perspective-origin baked in. - TransformationMatrix PerspectiveTransform() const; FloatPoint PerspectiveOrigin() const; bool Preserves3D() const { return GetLayoutObject().StyleRef().Preserves3D();
diff --git a/third_party/blink/renderer/core/paint/paint_layer_scrollable_area.cc b/third_party/blink/renderer/core/paint/paint_layer_scrollable_area.cc index edca409..64c41cd 100644 --- a/third_party/blink/renderer/core/paint/paint_layer_scrollable_area.cc +++ b/third_party/blink/renderer/core/paint/paint_layer_scrollable_area.cc
@@ -622,28 +622,24 @@ if (Layer()->EnclosingPaginationLayer()) box->SetSubtreeShouldCheckForPaintInvalidation(); - // If not composited, background always paints into the main graphics layer. - bool background_paint_in_graphics_layer = true; - bool background_paint_in_scrolling_contents = false; - if (RuntimeEnabledFeatures::CompositeAfterPaintEnabled() || - UsesCompositedScrolling()) { + if (!box->BackgroundNeedsFullPaintInvalidation()) { auto background_paint_location = box->GetBackgroundPaintLocation(); - background_paint_in_graphics_layer = + bool background_paint_in_graphics_layer = background_paint_location & kBackgroundPaintInGraphicsLayer; - background_paint_in_scrolling_contents = + bool background_paint_in_scrolling_contents = background_paint_location & kBackgroundPaintInScrollingContents; - } - // Both local attachment background painted in graphics layer and normal - // attachment background painted in scrolling contents require paint - // invalidation. Fixed attachment background has been dealt with in - // frame_view->InvalidateBackgroundAttachmentFixedDescendantsOnScroll(). - auto background_layers = box->StyleRef().BackgroundLayers(); - if ((background_layers.AnyLayerHasLocalAttachmentImage() && - background_paint_in_graphics_layer) || - (background_layers.AnyLayerHasDefaultAttachmentImage() && - background_paint_in_scrolling_contents)) - box->SetBackgroundNeedsFullPaintInvalidation(); + // Both local attachment background painted in graphics layer and normal + // attachment background painted in scrolling contents require paint + // invalidation. Fixed attachment background has been dealt with in + // frame_view->InvalidateBackgroundAttachmentFixedDescendantsOnScroll(). + auto background_layers = box->StyleRef().BackgroundLayers(); + if ((background_layers.AnyLayerHasLocalAttachmentImage() && + background_paint_in_graphics_layer) || + (background_layers.AnyLayerHasDefaultAttachmentImage() && + background_paint_in_scrolling_contents)) + box->SetBackgroundNeedsFullPaintInvalidation(); + } // If any scrolling content might have been clipped by a cull rect, then // that cull rect could be affected by scroll offset. For composited @@ -2459,7 +2455,29 @@ : DocumentLifecycle::kInCompositingUpdate, GetDocument()->Lifecycle().GetState()); + const auto* box = GetLayoutBox(); + auto old_background_paint_location = box->GetBackgroundPaintLocation(); non_composited_main_thread_scrolling_reasons_ = 0; + auto new_background_paint_location = + box->ComputeBackgroundPaintLocationIfComposited( + &non_composited_main_thread_scrolling_reasons_); + bool needs_composited_scrolling = ComputeNeedsCompositedScrollingInternal( + new_background_paint_location, force_prefer_compositing_to_lcd_text); + if (!needs_composited_scrolling) + new_background_paint_location = kBackgroundPaintInGraphicsLayer; + if (new_background_paint_location != old_background_paint_location) { + box->GetMutableForPainting().SetBackgroundPaintLocation( + new_background_paint_location); + } + + return needs_composited_scrolling; +} + +bool PaintLayerScrollableArea::ComputeNeedsCompositedScrollingInternal( + BackgroundPaintLocation background_paint_location_if_composited, + bool force_prefer_compositing_to_lcd_text) { + DCHECK_EQ(background_paint_location_if_composited, + GetLayoutBox()->ComputeBackgroundPaintLocationIfComposited()); if (CompositingReasonFinder::RequiresCompositingForRootScroller(*layer_)) return true; @@ -2493,8 +2511,7 @@ // transforms are also integer. bool background_supports_lcd_text = box->StyleRef().IsStackingContext() && - (box->GetBackgroundPaintLocation( - &non_composited_main_thread_scrolling_reasons_) & + (background_paint_location_if_composited & kBackgroundPaintInScrollingContents) && layer_->BackgroundIsKnownToBeOpaqueInRect(box->PhysicalPaddingBoxRect(), true) &&
diff --git a/third_party/blink/renderer/core/paint/paint_layer_scrollable_area.h b/third_party/blink/renderer/core/paint/paint_layer_scrollable_area.h index a475c70..afe17a03 100644 --- a/third_party/blink/renderer/core/paint/paint_layer_scrollable_area.h +++ b/third_party/blink/renderer/core/paint/paint_layer_scrollable_area.h
@@ -455,6 +455,8 @@ // Rectangle encompassing the scroll corner and resizer rect. IntRect ScrollCornerAndResizerRect() const; + // This also updates main thread scrolling reasons and the LayoutBox's + // background paint location. bool ComputeNeedsCompositedScrolling( bool force_prefer_compositing_to_lcd_text); @@ -680,6 +682,11 @@ IntSize PixelSnappedBorderBoxSize() const; + using BackgroundPaintLocation = uint8_t; + bool ComputeNeedsCompositedScrollingInternal( + BackgroundPaintLocation background_paint_location_if_composited, + bool force_prefer_compositing_to_lcd_text); + // PaintLayer is destructed before PaintLayerScrollable area, during this // time before PaintLayerScrollableArea has been collected layer_ will // be set to nullptr by the Dispose method.
diff --git a/third_party/blink/renderer/core/paint/paint_layer_scrollable_area_test.cc b/third_party/blink/renderer/core/paint/paint_layer_scrollable_area_test.cc index 984cefe..da749e25 100644 --- a/third_party/blink/renderer/core/paint/paint_layer_scrollable_area_test.cc +++ b/third_party/blink/renderer/core/paint/paint_layer_scrollable_area_test.cc
@@ -911,20 +911,17 @@ auto* scroller = ToLayoutBox(GetLayoutObjectByElementId("scroller")); auto* scrollable_area = scroller->GetScrollableArea(); EXPECT_EQ(kBackgroundPaintInScrollingContents, + scroller->ComputeBackgroundPaintLocationIfComposited()); + EXPECT_EQ(kBackgroundPaintInGraphicsLayer, scroller->GetBackgroundPaintLocation()); // Programmatically changing the scroll offset. scrollable_area->SetScrollOffset(ScrollOffset(0, 1), mojom::blink::ScrollType::kProgrammatic); - if (RuntimeEnabledFeatures::CompositeAfterPaintEnabled()) { - // No invalidation because the background paints into scrolling contents. - EXPECT_FALSE(scroller->ShouldDoFullPaintInvalidation()); - EXPECT_FALSE(scroller->BackgroundNeedsFullPaintInvalidation()); - } else { - // Full invalidation because there is no separate scrolling contents layer. - EXPECT_TRUE(scroller->ShouldDoFullPaintInvalidation()); - EXPECT_TRUE(scroller->BackgroundNeedsFullPaintInvalidation()); - } + // Full invalidation because there is no separate scrolling contents layer. + EXPECT_TRUE(scroller->ShouldDoFullPaintInvalidation()); + EXPECT_TRUE(scroller->BackgroundNeedsFullPaintInvalidation()); + EXPECT_TRUE(scroller->NeedsPaintPropertyUpdate()); UpdateAllLifecyclePhasesForTest(); EXPECT_EQ(FloatSize(0, 1), scrollable_area->GetScrollOffset()); @@ -953,7 +950,9 @@ auto* scrollable_area = scroller->GetScrollableArea(); EXPECT_EQ( kBackgroundPaintInGraphicsLayer | kBackgroundPaintInScrollingContents, - scroller->GetBackgroundPaintLocation()); + scroller->ComputeBackgroundPaintLocationIfComposited()); + EXPECT_EQ(kBackgroundPaintInGraphicsLayer, + scroller->GetBackgroundPaintLocation()); // Programmatically changing the scroll offset. scrollable_area->SetScrollOffset(ScrollOffset(0, 1), @@ -1045,6 +1044,8 @@ auto* fixed_background_div = ToLayoutBox(GetLayoutObjectByElementId("fixed-background")); EXPECT_EQ(kBackgroundPaintInScrollingContents, + fixed_background_div->ComputeBackgroundPaintLocationIfComposited()); + EXPECT_EQ(kBackgroundPaintInGraphicsLayer, fixed_background_div->GetBackgroundPaintLocation()); auto* div_scrollable_area = fixed_background_div->GetScrollableArea(); auto* view_scrollable_area = GetLayoutView().GetScrollableArea();
diff --git a/third_party/blink/renderer/core/scheduler_integration_tests/frame_throttling_test.cc b/third_party/blink/renderer/core/scheduler_integration_tests/frame_throttling_test.cc index 00de705..18b79eae 100644 --- a/third_party/blink/renderer/core/scheduler_integration_tests/frame_throttling_test.cc +++ b/third_party/blink/renderer/core/scheduler_integration_tests/frame_throttling_test.cc
@@ -667,9 +667,15 @@ LoadURL("https://example.com/"); main_resource.Complete("<iframe id=frame sandbox src=iframe.html></iframe>"); - frame_resource.Complete( - "<style> html { background-image: linear-gradient(red, blue); " - "background-attachment: fixed; } </style>"); + frame_resource.Complete(R"HTML( + <style> + html { + background-image: linear-gradient(red, blue); + background-attachment: fixed; + will-change: transform; + } + </style> + )HTML"); // Move the frame offscreen to throttle it. auto* frame_element = @@ -710,6 +716,9 @@ CompositeFrame(); EXPECT_FALSE( frame_element->contentDocument()->View()->CanThrottleRendering()); + // This CompositeFrame handles the visual update scheduled when we unthrottle + // the iframe. + CompositeFrame(); // The fixed background in the throttled sub frame should be considered. EXPECT_TRUE(frame_element->contentDocument() ->View()
diff --git a/third_party/blink/renderer/core/trustedtypes/trusted_types_util.cc b/third_party/blink/renderer/core/trustedtypes/trusted_types_util.cc index 0e185a64..23103e70 100644 --- a/third_party/blink/renderer/core/trustedtypes/trusted_types_util.cc +++ b/third_party/blink/renderer/core/trustedtypes/trusted_types_util.cc
@@ -6,6 +6,7 @@ #include "third_party/blink/public/mojom/reporting/reporting.mojom-blink.h" #include "third_party/blink/public/platform/platform.h" +#include "third_party/blink/renderer/bindings/core/v8/script_value.h" #include "third_party/blink/renderer/bindings/core/v8/string_or_trusted_html_or_trusted_script_or_trusted_script_url.h" #include "third_party/blink/renderer/bindings/core/v8/string_or_trusted_script.h" #include "third_party/blink/renderer/bindings/core/v8/v8_binding_for_core.h" @@ -18,6 +19,8 @@ #include "third_party/blink/renderer/core/trustedtypes/trusted_script_url.h" #include "third_party/blink/renderer/core/trustedtypes/trusted_type_policy.h" #include "third_party/blink/renderer/core/trustedtypes/trusted_type_policy_factory.h" +#include "third_party/blink/renderer/platform/bindings/exception_state.h" +#include "third_party/blink/renderer/platform/bindings/script_state.h" #include "third_party/blink/renderer/platform/runtime_enabled_features.h" #include "third_party/blink/renderer/platform/wtf/text/string_builder.h" @@ -118,6 +121,18 @@ return ""; } +HeapVector<ScriptValue> GetDefaultCallbackArgs( + v8::Isolate* isolate, + const char* type, + const ExceptionState& exception_state) { + ScriptState* script_state = ScriptState::Current(isolate); + HeapVector<ScriptValue> args; + args.push_back(ScriptValue::From(script_state, type)); + args.push_back( + ScriptValue::From(script_state, GetSamplePrefix(exception_state))); + return args; +} + // Handle failure of a Trusted Type assignment. // // If trusted type assignment fails, we need to @@ -213,7 +228,10 @@ } TrustedScript* result = default_policy->CreateScript( - doc->GetIsolate(), script, HeapVector<ScriptValue>(), exception_state); + doc->GetIsolate(), script, + GetDefaultCallbackArgs(doc->GetIsolate(), "TrustedScript", + exception_state), + exception_state); if (exception_state.HadException()) { exception_state.ClearException(); return String(); @@ -262,9 +280,11 @@ return html; } } - TrustedHTML* result = - default_policy->CreateHTML(execution_context->GetIsolate(), html, - HeapVector<ScriptValue>(), exception_state); + TrustedHTML* result = default_policy->CreateHTML( + execution_context->GetIsolate(), html, + GetDefaultCallbackArgs(execution_context->GetIsolate(), "TrustedHTML", + exception_state), + exception_state); if (exception_state.HadException()) { return g_empty_string; } @@ -314,9 +334,11 @@ return script; } } - TrustedScript* result = - default_policy->CreateScript(execution_context->GetIsolate(), script, - HeapVector<ScriptValue>(), exception_state); + TrustedScript* result = default_policy->CreateScript( + execution_context->GetIsolate(), script, + GetDefaultCallbackArgs(execution_context->GetIsolate(), "TrustedScript", + exception_state), + exception_state); DCHECK_EQ(!result, exception_state.HadException()); if (exception_state.HadException()) { return g_empty_string; @@ -362,7 +384,9 @@ } } TrustedScriptURL* result = default_policy->CreateScriptURL( - execution_context->GetIsolate(), script_url, HeapVector<ScriptValue>(), + execution_context->GetIsolate(), script_url, + GetDefaultCallbackArgs(execution_context->GetIsolate(), + "TrustedScriptURL", exception_state), exception_state); if (exception_state.HadException()) {
diff --git a/third_party/blink/renderer/modules/BUILD.gn b/third_party/blink/renderer/modules/BUILD.gn index f196baa..054d8fe 100644 --- a/third_party/blink/renderer/modules/BUILD.gn +++ b/third_party/blink/renderer/modules/BUILD.gn
@@ -382,6 +382,8 @@ "peerconnection/peer_connection_dependency_factory_test.cc", "peerconnection/peer_connection_tracker_test.cc", "peerconnection/rtc_data_channel_test.cc", + "peerconnection/rtc_encoded_audio_underlying_sink_test.cc", + "peerconnection/rtc_encoded_audio_underlying_source_test.cc", "peerconnection/rtc_encoded_video_underlying_sink_test.cc", "peerconnection/rtc_encoded_video_underlying_source_test.cc", "peerconnection/rtc_ice_transport_test.cc",
diff --git a/third_party/blink/renderer/modules/accessibility/ax_layout_object.cc b/third_party/blink/renderer/modules/accessibility/ax_layout_object.cc index e0c7b0c8..f24e9272 100644 --- a/third_party/blink/renderer/modules/accessibility/ax_layout_object.cc +++ b/third_party/blink/renderer/modules/accessibility/ax_layout_object.cc
@@ -1521,6 +1521,8 @@ // buttons which will return their name. // https://html.spec.whatwg.org/C/#dom-input-value if (const auto* input = DynamicTo<HTMLInputElement>(GetNode())) { + if (input->type() == input_type_names::kFile) + return input->FileStatusText(); if (input->type() != input_type_names::kButton && input->type() != input_type_names::kCheckbox && input->type() != input_type_names::kImage &&
diff --git a/third_party/blink/renderer/modules/accessibility/ax_object_cache_impl.cc b/third_party/blink/renderer/modules/accessibility/ax_object_cache_impl.cc index 9536c14b..0495fe4 100644 --- a/third_party/blink/renderer/modules/accessibility/ax_object_cache_impl.cc +++ b/third_party/blink/renderer/modules/accessibility/ax_object_cache_impl.cc
@@ -37,6 +37,7 @@ #include "third_party/blink/renderer/core/aom/accessible_node.h" #include "third_party/blink/renderer/core/display_lock/display_lock_utilities.h" #include "third_party/blink/renderer/core/dom/document.h" +#include "third_party/blink/renderer/core/dom/document_lifecycle.h" #include "third_party/blink/renderer/core/editing/editing_utilities.h" #include "third_party/blink/renderer/core/frame/local_frame.h" #include "third_party/blink/renderer/core/frame/local_frame_view.h" @@ -1033,6 +1034,9 @@ } void AXObjectCacheImpl::ProcessUpdates(Document& document) { + // None of the updates should alter the document lifecycle. + DocumentLifecycle::DisallowTransitionScope disallow(document.Lifecycle()); + TreeUpdateCallbackQueue old_tree_update_callback_queue; tree_update_callback_queue_.swap(old_tree_update_callback_queue); for (auto& tree_update : old_tree_update_callback_queue) {
diff --git a/third_party/blink/renderer/modules/cookie_store/cookie_store.cc b/third_party/blink/renderer/modules/cookie_store/cookie_store.cc index 7ad9901..97b6c8d 100644 --- a/third_party/blink/renderer/modules/cookie_store/cookie_store.cc +++ b/third_party/blink/renderer/modules/cookie_store/cookie_store.cc
@@ -345,7 +345,6 @@ } void CookieStore::ContextDestroyed() { - StopObserving(); backend_.reset(); }
diff --git a/third_party/blink/renderer/modules/gamepad/gamepad_shared_memory_reader.h b/third_party/blink/renderer/modules/gamepad/gamepad_shared_memory_reader.h index e1f4e07..1248ecef 100644 --- a/third_party/blink/renderer/modules/gamepad/gamepad_shared_memory_reader.h +++ b/third_party/blink/renderer/modules/gamepad/gamepad_shared_memory_reader.h
@@ -14,6 +14,7 @@ #include "mojo/public/cpp/system/buffer.h" #include "third_party/blink/renderer/platform/heap/handle.h" #include "third_party/blink/renderer/platform/mojo/heap_mojo_receiver.h" +#include "third_party/blink/renderer/platform/mojo/heap_mojo_wrapper_mode.h" namespace base { class ReadOnlySharedMemoryRegion; @@ -64,7 +65,9 @@ bool ever_interacted_with_ = false; - HeapMojoReceiver<device::mojom::blink::GamepadObserver> receiver_; + HeapMojoReceiver<device::mojom::blink::GamepadObserver, + HeapMojoWrapperMode::kWithoutContextObserver> + receiver_; mojo::Remote<device::mojom::blink::GamepadMonitor> gamepad_monitor_remote_; blink::GamepadListener* listener_ = nullptr; };
diff --git a/third_party/blink/renderer/modules/locks/lock_manager.cc b/third_party/blink/renderer/modules/locks/lock_manager.cc index 5786f39..badfb8ee2 100644 --- a/third_party/blink/renderer/modules/locks/lock_manager.cc +++ b/third_party/blink/renderer/modules/locks/lock_manager.cc
@@ -207,7 +207,9 @@ }; LockManager::LockManager(ExecutionContext* context) - : ExecutionContextLifecycleObserver(context) {} + : ExecutionContextLifecycleObserver(context), + service_(context), + observer_(context) {} ScriptPromise LockManager::request(ScriptState* script_state, const String& name, @@ -421,6 +423,8 @@ ExecutionContextLifecycleObserver::Trace(visitor); visitor->Trace(pending_requests_); visitor->Trace(held_locks_); + visitor->Trace(service_); + visitor->Trace(observer_); } void LockManager::ContextDestroyed() {
diff --git a/third_party/blink/renderer/modules/locks/lock_manager.h b/third_party/blink/renderer/modules/locks/lock_manager.h index 2c3eea52..98e86bb 100644 --- a/third_party/blink/renderer/modules/locks/lock_manager.h +++ b/third_party/blink/renderer/modules/locks/lock_manager.h
@@ -7,7 +7,6 @@ #include "base/macros.h" #include "base/optional.h" -#include "mojo/public/cpp/bindings/remote.h" #include "third_party/blink/public/mojom/feature_observer/feature_observer.mojom-blink.h" #include "third_party/blink/public/mojom/locks/lock_manager.mojom-blink-forward.h" #include "third_party/blink/renderer/bindings/core/v8/string_or_string_sequence.h" @@ -16,6 +15,8 @@ #include "third_party/blink/renderer/modules/modules_export.h" #include "third_party/blink/renderer/platform/bindings/script_wrappable.h" #include "third_party/blink/renderer/platform/heap/heap_allocator.h" +#include "third_party/blink/renderer/platform/mojo/heap_mojo_remote.h" +#include "third_party/blink/renderer/platform/mojo/heap_mojo_wrapper_mode.h" namespace blink { @@ -74,8 +75,12 @@ HeapHashSet<Member<LockRequestImpl>> pending_requests_; HeapHashSet<Member<Lock>> held_locks_; - mojo::Remote<mojom::blink::LockManager> service_; - mojo::Remote<mojom::blink::FeatureObserver> observer_; + HeapMojoRemote<mojom::blink::LockManager, + HeapMojoWrapperMode::kWithoutContextObserver> + service_; + HeapMojoRemote<mojom::blink::FeatureObserver, + HeapMojoWrapperMode::kWithoutContextObserver> + observer_; base::Optional<bool> cached_allowed_;
diff --git a/third_party/blink/renderer/modules/mediasession/media_session.cc b/third_party/blink/renderer/modules/mediasession/media_session.cc index f648cd51..58f2207 100644 --- a/third_party/blink/renderer/modules/mediasession/media_session.cc +++ b/third_party/blink/renderer/modules/mediasession/media_session.cc
@@ -128,11 +128,8 @@ MediaSession::MediaSession(ExecutionContext* execution_context) : ExecutionContextClient(execution_context), clock_(base::DefaultTickClock::GetInstance()), - playback_state_(mojom::blink::MediaSessionPlaybackState::NONE) {} - -void MediaSession::Dispose() { - client_receiver_.reset(); -} + playback_state_(mojom::blink::MediaSessionPlaybackState::NONE), + client_receiver_(this, execution_context) {} void MediaSession::setPlaybackState(const String& playback_state) { playback_state_ = StringToMediaSessionPlaybackState(playback_state); @@ -374,6 +371,7 @@ } void MediaSession::Trace(Visitor* visitor) { + visitor->Trace(client_receiver_); visitor->Trace(metadata_); visitor->Trace(action_handlers_); ScriptWrappable::Trace(visitor);
diff --git a/third_party/blink/renderer/modules/mediasession/media_session.h b/third_party/blink/renderer/modules/mediasession/media_session.h index fac22b5..6031551 100644 --- a/third_party/blink/renderer/modules/mediasession/media_session.h +++ b/third_party/blink/renderer/modules/mediasession/media_session.h
@@ -6,13 +6,14 @@ #define THIRD_PARTY_BLINK_RENDERER_MODULES_MEDIASESSION_MEDIA_SESSION_H_ #include <memory> -#include "mojo/public/cpp/bindings/receiver.h" #include "mojo/public/cpp/bindings/remote.h" #include "third_party/blink/public/mojom/mediasession/media_session.mojom-blink.h" #include "third_party/blink/renderer/core/execution_context/execution_context_lifecycle_observer.h" #include "third_party/blink/renderer/modules/modules_export.h" #include "third_party/blink/renderer/platform/bindings/script_wrappable.h" #include "third_party/blink/renderer/platform/heap/handle.h" +#include "third_party/blink/renderer/platform/mojo/heap_mojo_receiver.h" +#include "third_party/blink/renderer/platform/mojo/heap_mojo_wrapper_mode.h" #include "third_party/blink/renderer/platform/wtf/text/wtf_string.h" namespace base { @@ -33,13 +34,10 @@ blink::mojom::blink::MediaSessionClient { USING_GARBAGE_COLLECTED_MIXIN(MediaSession); DEFINE_WRAPPERTYPEINFO(); - USING_PRE_FINALIZER(MediaSession, Dispose); public: explicit MediaSession(ExecutionContext*); - void Dispose(); - void setPlaybackState(const String&); String playbackState(); @@ -88,8 +86,9 @@ Member<MediaMetadata> metadata_; HeapHashMap<String, Member<V8MediaSessionActionHandler>> action_handlers_; mojo::Remote<mojom::blink::MediaSessionService> service_; - mojo::Receiver<blink::mojom::blink::MediaSessionClient> client_receiver_{ - this}; + HeapMojoReceiver<blink::mojom::blink::MediaSessionClient, + HeapMojoWrapperMode::kWithoutContextObserver> + client_receiver_; }; } // namespace blink
diff --git a/third_party/blink/renderer/modules/mediastream/media_devices.cc b/third_party/blink/renderer/modules/mediastream/media_devices.cc index 40a9642..1fc3e9a 100644 --- a/third_party/blink/renderer/modules/mediastream/media_devices.cc +++ b/third_party/blink/renderer/modules/mediastream/media_devices.cc
@@ -60,7 +60,9 @@ } // namespace MediaDevices::MediaDevices(ExecutionContext* context) - : ExecutionContextLifecycleObserver(context), stopped_(false) {} + : ExecutionContextLifecycleObserver(context), + stopped_(false), + receiver_(this, context) {} MediaDevices::~MediaDevices() = default; @@ -194,7 +196,6 @@ return; stopped_ = true; - StopObserving(); requests_.clear(); dispatcher_host_.reset(); } @@ -245,7 +246,9 @@ GetDispatcherHost(document->GetFrame()) ->AddMediaDevicesListener(true /* audio input */, true /* video input */, true /* audio output */, - receiver_.BindNewPipeAndPassRemote()); + receiver_.BindNewPipeAndPassRemote( + GetExecutionContext()->GetTaskRunner( + TaskType::kMediaElementEvent))); } void MediaDevices::StopObserving() { @@ -254,10 +257,6 @@ receiver_.reset(); } -void MediaDevices::Dispose() { - StopObserving(); -} - void MediaDevices::DevicesEnumerated( ScriptPromiseResolver* resolver, const Vector<Vector<WebMediaDeviceInfo>>& enumeration, @@ -369,6 +368,7 @@ } void MediaDevices::Trace(Visitor* visitor) { + visitor->Trace(receiver_); visitor->Trace(scheduled_events_); visitor->Trace(requests_); EventTargetWithInlineData::Trace(visitor);
diff --git a/third_party/blink/renderer/modules/mediastream/media_devices.h b/third_party/blink/renderer/modules/mediastream/media_devices.h index fa5ffd1..4ebba1a 100644 --- a/third_party/blink/renderer/modules/mediastream/media_devices.h +++ b/third_party/blink/renderer/modules/mediastream/media_devices.h
@@ -6,7 +6,6 @@ #define THIRD_PARTY_BLINK_RENDERER_MODULES_MEDIASTREAM_MEDIA_DEVICES_H_ #include "base/callback.h" -#include "mojo/public/cpp/bindings/receiver.h" #include "mojo/public/cpp/bindings/remote.h" #include "third_party/blink/public/mojom/mediastream/media_devices.mojom-blink.h" #include "third_party/blink/renderer/bindings/core/v8/active_script_wrappable.h" @@ -17,6 +16,7 @@ #include "third_party/blink/renderer/modules/mediastream/user_media_request.h" #include "third_party/blink/renderer/modules/modules_export.h" #include "third_party/blink/renderer/platform/heap/heap_allocator.h" +#include "third_party/blink/renderer/platform/mojo/heap_mojo_receiver.h" #include "third_party/blink/renderer/platform/scheduler/public/post_cancellable_task.h" namespace blink { @@ -36,7 +36,6 @@ public mojom::blink::MediaDevicesListener { USING_GARBAGE_COLLECTED_MIXIN(MediaDevices); DEFINE_WRAPPERTYPEINFO(); - USING_PRE_FINALIZER(MediaDevices, Dispose); public: explicit MediaDevices(ExecutionContext*); @@ -108,7 +107,6 @@ void DispatchScheduledEvents(); void StartObserving(); void StopObserving(); - void Dispose(); void DevicesEnumerated(ScriptPromiseResolver*, const Vector<Vector<WebMediaDeviceInfo>>&, Vector<mojom::blink::VideoInputDeviceCapabilitiesPtr>, @@ -123,7 +121,7 @@ TaskHandle dispatch_scheduled_events_task_handle_; HeapVector<Member<Event>> scheduled_events_; mojo::Remote<mojom::blink::MediaDevicesDispatcherHost> dispatcher_host_; - mojo::Receiver<mojom::blink::MediaDevicesListener> receiver_{this}; + HeapMojoReceiver<mojom::blink::MediaDevicesListener> receiver_; HeapHashSet<Member<ScriptPromiseResolver>> requests_; EnumerateDevicesTestCallback enumerate_devices_test_callback_;
diff --git a/third_party/blink/renderer/modules/notifications/notification_manager.cc b/third_party/blink/renderer/modules/notifications/notification_manager.cc index 55f75cc..f98a023 100644 --- a/third_party/blink/renderer/modules/notifications/notification_manager.cc +++ b/third_party/blink/renderer/modules/notifications/notification_manager.cc
@@ -47,7 +47,9 @@ const char NotificationManager::kSupplementName[] = "NotificationManager"; NotificationManager::NotificationManager(ExecutionContext& context) - : Supplement<ExecutionContext>(context) {} + : Supplement<ExecutionContext>(context), + notification_service_(&context), + permission_service_(&context) {} NotificationManager::~NotificationManager() = default; @@ -69,7 +71,7 @@ V8NotificationPermissionCallback* deprecated_callback) { ExecutionContext* context = ExecutionContext::From(script_state); - if (!permission_service_) { + if (!permission_service_.is_bound()) { // See https://bit.ly/2S0zRAS for task types scoped_refptr<base::SingleThreadTaskRunner> task_runner = context->GetTaskRunner(TaskType::kMiscPlatformAPI); @@ -227,9 +229,9 @@ resolver->Resolve(notifications); } -const mojo::Remote<mojom::blink::NotificationService>& +mojom::blink::NotificationService* NotificationManager::GetNotificationService() { - if (!notification_service_) { + if (!notification_service_.is_bound()) { // See https://bit.ly/2S0zRAS for task types scoped_refptr<base::SingleThreadTaskRunner> task_runner = GetSupplementable()->GetTaskRunner(TaskType::kMiscPlatformAPI); @@ -241,10 +243,12 @@ WrapWeakPersistent(this))); } - return notification_service_; + return notification_service_.get(); } void NotificationManager::Trace(Visitor* visitor) { + visitor->Trace(notification_service_); + visitor->Trace(permission_service_); Supplement<ExecutionContext>::Trace(visitor); }
diff --git a/third_party/blink/renderer/modules/notifications/notification_manager.h b/third_party/blink/renderer/modules/notifications/notification_manager.h index e66b084..bb3d8d1 100644 --- a/third_party/blink/renderer/modules/notifications/notification_manager.h +++ b/third_party/blink/renderer/modules/notifications/notification_manager.h
@@ -7,12 +7,13 @@ #include "base/macros.h" #include "mojo/public/cpp/bindings/pending_remote.h" -#include "mojo/public/cpp/bindings/remote.h" #include "third_party/blink/public/mojom/notifications/notification_service.mojom-blink.h" #include "third_party/blink/public/mojom/permissions/permission.mojom-blink.h" #include "third_party/blink/public/platform/web_string.h" #include "third_party/blink/renderer/bindings/modules/v8/v8_notification_permission_callback.h" #include "third_party/blink/renderer/core/execution_context/execution_context.h" +#include "third_party/blink/renderer/platform/mojo/heap_mojo_remote.h" +#include "third_party/blink/renderer/platform/mojo/heap_mojo_wrapper_mode.h" #include "third_party/blink/renderer/platform/wtf/text/wtf_string.h" namespace blink { @@ -93,8 +94,7 @@ // Returns an initialized NotificationService remote. A connection will be // established the first time this method is called. - const mojo::Remote<mojom::blink::NotificationService>& - GetNotificationService(); + mojom::blink::NotificationService* GetNotificationService(); void OnPermissionRequestComplete( ScriptPromiseResolver* resolver, @@ -104,8 +104,12 @@ void OnNotificationServiceConnectionError(); void OnPermissionServiceConnectionError(); - mojo::Remote<mojom::blink::NotificationService> notification_service_; - mojo::Remote<mojom::blink::PermissionService> permission_service_; + HeapMojoRemote<mojom::blink::NotificationService, + HeapMojoWrapperMode::kWithoutContextObserver> + notification_service_; + HeapMojoRemote<mojom::blink::PermissionService, + HeapMojoWrapperMode::kWithoutContextObserver> + permission_service_; DISALLOW_COPY_AND_ASSIGN(NotificationManager); };
diff --git a/third_party/blink/renderer/modules/peerconnection/BUILD.gn b/third_party/blink/renderer/modules/peerconnection/BUILD.gn index aa511e6..5cf4876a 100644 --- a/third_party/blink/renderer/modules/peerconnection/BUILD.gn +++ b/third_party/blink/renderer/modules/peerconnection/BUILD.gn
@@ -78,6 +78,10 @@ "rtc_dtmf_tone_change_event.h", "rtc_encoded_audio_frame.cc", "rtc_encoded_audio_frame.h", + "rtc_encoded_audio_underlying_sink.cc", + "rtc_encoded_audio_underlying_sink.h", + "rtc_encoded_audio_underlying_source.cc", + "rtc_encoded_audio_underlying_source.h", "rtc_encoded_video_frame.cc", "rtc_encoded_video_frame.h", "rtc_encoded_video_underlying_sink.cc",
diff --git a/third_party/blink/renderer/modules/peerconnection/fake_rtc_rtp_transceiver_impl.cc b/third_party/blink/renderer/modules/peerconnection/fake_rtc_rtp_transceiver_impl.cc index 17d9b77..d158076 100644 --- a/third_party/blink/renderer/modules/peerconnection/fake_rtc_rtp_transceiver_impl.cc +++ b/third_party/blink/renderer/modules/peerconnection/fake_rtc_rtp_transceiver_impl.cc
@@ -100,9 +100,10 @@ return nullptr; } -void FakeRTCRtpSenderImpl::SetParameters(Vector<webrtc::RtpEncodingParameters>, - webrtc::DegradationPreference, - blink::RTCVoidRequest*) { +void FakeRTCRtpSenderImpl::SetParameters( + Vector<webrtc::RtpEncodingParameters>, + absl::optional<webrtc::DegradationPreference>, + blink::RTCVoidRequest*) { NOTIMPLEMENTED(); }
diff --git a/third_party/blink/renderer/modules/peerconnection/fake_rtc_rtp_transceiver_impl.h b/third_party/blink/renderer/modules/peerconnection/fake_rtc_rtp_transceiver_impl.h index 6da00f3..e8bac93 100644 --- a/third_party/blink/renderer/modules/peerconnection/fake_rtc_rtp_transceiver_impl.h +++ b/third_party/blink/renderer/modules/peerconnection/fake_rtc_rtp_transceiver_impl.h
@@ -47,7 +47,7 @@ std::unique_ptr<blink::RtcDtmfSenderHandler> GetDtmfSender() const override; std::unique_ptr<webrtc::RtpParameters> GetParameters() const override; void SetParameters(Vector<webrtc::RtpEncodingParameters>, - webrtc::DegradationPreference, + absl::optional<webrtc::DegradationPreference>, blink::RTCVoidRequest*) override; void GetStats(RTCStatsReportCallback, const Vector<webrtc::NonStandardGroupId>&) override;
diff --git a/third_party/blink/renderer/modules/peerconnection/mock_rtc_peer_connection_handler_platform.cc b/third_party/blink/renderer/modules/peerconnection/mock_rtc_peer_connection_handler_platform.cc index badabfd..4906840f 100644 --- a/third_party/blink/renderer/modules/peerconnection/mock_rtc_peer_connection_handler_platform.cc +++ b/third_party/blink/renderer/modules/peerconnection/mock_rtc_peer_connection_handler_platform.cc
@@ -81,7 +81,7 @@ return std::unique_ptr<webrtc::RtpParameters>(); } void SetParameters(Vector<webrtc::RtpEncodingParameters>, - webrtc::DegradationPreference, + absl::optional<webrtc::DegradationPreference>, RTCVoidRequest*) override {} void GetStats(RTCStatsReportCallback, const Vector<webrtc::NonStandardGroupId>&) override {}
diff --git a/third_party/blink/renderer/modules/peerconnection/rtc_encoded_audio_frame.cc b/third_party/blink/renderer/modules/peerconnection/rtc_encoded_audio_frame.cc index dffb6fb..208b4bf 100644 --- a/third_party/blink/renderer/modules/peerconnection/rtc_encoded_audio_frame.cc +++ b/third_party/blink/renderer/modules/peerconnection/rtc_encoded_audio_frame.cc
@@ -6,14 +6,37 @@ #include "third_party/blink/renderer/core/typed_arrays/dom_array_buffer.h" #include "third_party/blink/renderer/platform/wtf/text/string_builder.h" +#include "third_party/webrtc/api/frame_transformer_interface.h" namespace blink { +RTCEncodedAudioFrame::RTCEncodedAudioFrame( + std::unique_ptr<webrtc::TransformableFrameInterface> webrtc_frame) + : webrtc_frame_(std::move(webrtc_frame)) {} + +RTCEncodedAudioFrame::RTCEncodedAudioFrame( + std::unique_ptr<webrtc::TransformableAudioFrameInterface> + webrtc_audio_frame) { + if (webrtc_audio_frame) { + wtf_size_t num_csrcs = webrtc_audio_frame->GetHeader().numCSRCs; + contributing_sources_.ReserveInitialCapacity(num_csrcs); + for (wtf_size_t i = 0; i < num_csrcs; i++) { + contributing_sources_.push_back( + webrtc_audio_frame->GetHeader().arrOfCSRCs[i]); + } + } + webrtc_frame_ = std::move(webrtc_audio_frame); +} + uint64_t RTCEncodedAudioFrame::timestamp() const { - return 0; + return webrtc_frame_ ? webrtc_frame_->GetTimestamp() : 0; } DOMArrayBuffer* RTCEncodedAudioFrame::data() const { + if (webrtc_frame_ && !frame_data_) { + frame_data_ = DOMArrayBuffer::Create(webrtc_frame_->GetData().data(), + webrtc_frame_->GetData().size()); + } return frame_data_; } @@ -26,11 +49,11 @@ } uint32_t RTCEncodedAudioFrame::synchronizationSource() const { - return 0; + return webrtc_frame_ ? webrtc_frame_->GetSsrc() : 0; } Vector<uint32_t> RTCEncodedAudioFrame::contributingSources() const { - return Vector<uint32_t>(); + return webrtc_frame_ ? contributing_sources_ : Vector<uint32_t>(); } String RTCEncodedAudioFrame::toString() const { @@ -43,6 +66,17 @@ return sb.ToString(); } +std::unique_ptr<webrtc::TransformableFrameInterface> +RTCEncodedAudioFrame::PassDelegate() { + // Sync the delegate data with |frame_data_| if necessary. + if (webrtc_frame_ && frame_data_) { + webrtc_frame_->SetData(rtc::ArrayView<const uint8_t>( + static_cast<const uint8_t*>(frame_data_->Data()), + frame_data_->ByteLengthAsSizeT())); + } + return std::move(webrtc_frame_); +} + void RTCEncodedAudioFrame::Trace(Visitor* visitor) { ScriptWrappable::Trace(visitor); visitor->Trace(frame_data_);
diff --git a/third_party/blink/renderer/modules/peerconnection/rtc_encoded_audio_frame.h b/third_party/blink/renderer/modules/peerconnection/rtc_encoded_audio_frame.h index ff0cb07..7565e4b1 100644 --- a/third_party/blink/renderer/modules/peerconnection/rtc_encoded_audio_frame.h +++ b/third_party/blink/renderer/modules/peerconnection/rtc_encoded_audio_frame.h
@@ -7,18 +7,28 @@ #include <stdint.h> +#include "third_party/blink/renderer/modules/modules_export.h" #include "third_party/blink/renderer/platform/bindings/script_wrappable.h" #include "third_party/blink/renderer/platform/wtf/text/wtf_string.h" +#include "third_party/blink/renderer/platform/wtf/vector.h" + +namespace webrtc { +class TransformableAudioFrameInterface; +class TransformableFrameInterface; +} // namespace webrtc namespace blink { class DOMArrayBuffer; -class RTCEncodedAudioFrame final : public ScriptWrappable { +class MODULES_EXPORT RTCEncodedAudioFrame final : public ScriptWrappable { DEFINE_WRAPPERTYPEINFO(); public: - RTCEncodedAudioFrame() = default; + explicit RTCEncodedAudioFrame( + std::unique_ptr<webrtc::TransformableFrameInterface> webrtc_frame); + explicit RTCEncodedAudioFrame( + std::unique_ptr<webrtc::TransformableAudioFrameInterface> webrtc_frame); // rtc_encoded_audio_frame.idl implementation. uint64_t timestamp() const; @@ -29,10 +39,17 @@ Vector<uint32_t> contributingSources() const; String toString() const; + // Returns and transfers ownership of the internal WebRTC frame + // backing this RTCEncodedVideoFrame, leaving the RTCEncodedVideoFrame + // without a delegate WebRTC frame. + std::unique_ptr<webrtc::TransformableFrameInterface> PassDelegate(); + void Trace(Visitor*) override; private: mutable Member<DOMArrayBuffer> frame_data_; + Vector<uint32_t> contributing_sources_; + std::unique_ptr<webrtc::TransformableFrameInterface> webrtc_frame_; }; } // namespace blink
diff --git a/third_party/blink/renderer/modules/peerconnection/rtc_encoded_audio_underlying_sink.cc b/third_party/blink/renderer/modules/peerconnection/rtc_encoded_audio_underlying_sink.cc new file mode 100644 index 0000000..2635b634 --- /dev/null +++ b/third_party/blink/renderer/modules/peerconnection/rtc_encoded_audio_underlying_sink.cc
@@ -0,0 +1,76 @@ +// Copyright 2020 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "third_party/blink/renderer/modules/peerconnection/rtc_encoded_audio_underlying_sink.h" + +#include "third_party/blink/renderer/bindings/modules/v8/v8_rtc_encoded_audio_frame.h" +#include "third_party/blink/renderer/core/dom/dom_exception.h" +#include "third_party/blink/renderer/platform/bindings/exception_state.h" +#include "third_party/blink/renderer/platform/peerconnection/rtc_encoded_audio_stream_transformer.h" +#include "third_party/webrtc/api/frame_transformer_interface.h" + +namespace blink { + +RTCEncodedAudioUnderlyingSink::RTCEncodedAudioUnderlyingSink( + ScriptState* script_state, + TransformerCallback transformer_callback) + : transformer_callback_(std::move(transformer_callback)) { + DCHECK(transformer_callback_); +} + +ScriptPromise RTCEncodedAudioUnderlyingSink::start( + ScriptState* script_state, + WritableStreamDefaultController* controller, + ExceptionState&) { + // No extra setup needed. + return ScriptPromise::CastUndefined(script_state); +} + +ScriptPromise RTCEncodedAudioUnderlyingSink::write( + ScriptState* script_state, + ScriptValue chunk, + WritableStreamDefaultController* controller, + ExceptionState& exception_state) { + RTCEncodedAudioFrame* encoded_frame = + V8RTCEncodedAudioFrame::ToImplWithTypeCheck(script_state->GetIsolate(), + chunk.V8Value()); + if (!encoded_frame) { + exception_state.ThrowDOMException(DOMExceptionCode::kTypeMismatchError, + "Invalid frame"); + return ScriptPromise(); + } + + // Get webrtc frame and send it to the decoder. + if (!transformer_callback_) { + exception_state.ThrowDOMException(DOMExceptionCode::kInvalidStateError, + "Stream closed"); + return ScriptPromise(); + } + + transformer_callback_.Run()->SendFrameToSink(encoded_frame->PassDelegate()); + return ScriptPromise::CastUndefined(script_state); +} + +ScriptPromise RTCEncodedAudioUnderlyingSink::close(ScriptState* script_state, + ExceptionState&) { + // Disconnect from the transformer if the sink is closed. + if (transformer_callback_) + transformer_callback_.Reset(); + return ScriptPromise::CastUndefined(script_state); +} + +ScriptPromise RTCEncodedAudioUnderlyingSink::abort( + ScriptState* script_state, + ScriptValue reason, + ExceptionState& exception_state) { + // It is not possible to cancel any frames already sent to the WebRTC sink, + // thus abort() has the same effect as close(). + return close(script_state, exception_state); +} + +void RTCEncodedAudioUnderlyingSink::Trace(Visitor* visitor) { + UnderlyingSinkBase::Trace(visitor); +} + +} // namespace blink
diff --git a/third_party/blink/renderer/modules/peerconnection/rtc_encoded_audio_underlying_sink.h b/third_party/blink/renderer/modules/peerconnection/rtc_encoded_audio_underlying_sink.h new file mode 100644 index 0000000..152606c4 --- /dev/null +++ b/third_party/blink/renderer/modules/peerconnection/rtc_encoded_audio_underlying_sink.h
@@ -0,0 +1,44 @@ +// Copyright 2020 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef THIRD_PARTY_BLINK_RENDERER_MODULES_PEERCONNECTION_RTC_ENCODED_AUDIO_UNDERLYING_SINK_H_ +#define THIRD_PARTY_BLINK_RENDERER_MODULES_PEERCONNECTION_RTC_ENCODED_AUDIO_UNDERLYING_SINK_H_ + +#include "third_party/blink/renderer/core/streams/underlying_sink_base.h" +#include "third_party/blink/renderer/modules/modules_export.h" + +namespace blink { + +class ExceptionState; +class RTCEncodedAudioStreamTransformer; + +class MODULES_EXPORT RTCEncodedAudioUnderlyingSink final + : public UnderlyingSinkBase { + public: + using TransformerCallback = + base::RepeatingCallback<RTCEncodedAudioStreamTransformer*()>; + RTCEncodedAudioUnderlyingSink(ScriptState*, TransformerCallback); + + // UnderlyingSinkBase + ScriptPromise start(ScriptState*, + WritableStreamDefaultController*, + ExceptionState&) override; + ScriptPromise write(ScriptState*, + ScriptValue chunk, + WritableStreamDefaultController*, + ExceptionState&) override; + ScriptPromise close(ScriptState*, ExceptionState&) override; + ScriptPromise abort(ScriptState*, + ScriptValue reason, + ExceptionState&) override; + + void Trace(Visitor*) override; + + private: + TransformerCallback transformer_callback_; +}; + +} // namespace blink + +#endif // THIRD_PARTY_BLINK_RENDERER_MODULES_PEERCONNECTION_RTC_ENCODED_AUDIO_UNDERLYING_SINK_H_
diff --git a/third_party/blink/renderer/modules/peerconnection/rtc_encoded_audio_underlying_sink_test.cc b/third_party/blink/renderer/modules/peerconnection/rtc_encoded_audio_underlying_sink_test.cc new file mode 100644 index 0000000..01d09ced --- /dev/null +++ b/third_party/blink/renderer/modules/peerconnection/rtc_encoded_audio_underlying_sink_test.cc
@@ -0,0 +1,130 @@ +// Copyright 2020 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "third_party/blink/renderer/modules/peerconnection/rtc_encoded_audio_underlying_sink.h" + +#include "base/memory/scoped_refptr.h" +#include "testing/gmock/include/gmock/gmock.h" +#include "testing/gtest/include/gtest/gtest.h" +#include "third_party/blink/public/platform/scheduler/test/renderer_scheduler_test_support.h" +#include "third_party/blink/renderer/bindings/core/v8/script_promise_tester.h" +#include "third_party/blink/renderer/bindings/core/v8/to_v8_for_core.h" +#include "third_party/blink/renderer/bindings/core/v8/v8_binding_for_testing.h" +#include "third_party/blink/renderer/bindings/modules/v8/v8_rtc_encoded_audio_frame.h" +#include "third_party/blink/renderer/core/streams/writable_stream.h" +#include "third_party/blink/renderer/core/streams/writable_stream_default_writer.h" +#include "third_party/blink/renderer/platform/bindings/exception_state.h" +#include "third_party/blink/renderer/platform/peerconnection/rtc_encoded_audio_stream_transformer.h" +#include "third_party/blink/renderer/platform/testing/testing_platform_support.h" +#include "third_party/blink/renderer/platform/wtf/vector.h" +#include "third_party/webrtc/api/frame_transformer_interface.h" +#include "third_party/webrtc/api/scoped_refptr.h" +#include "third_party/webrtc/rtc_base/ref_counted_object.h" + +using testing::_; + +namespace blink { + +namespace { + +class MockWebRtcTransformedFrameCallback + : public webrtc::TransformedFrameCallback { + public: + MOCK_METHOD1(OnTransformedFrame, + void(std::unique_ptr<webrtc::TransformableFrameInterface>)); +}; + +} // namespace + +class RTCEncodedAudioUnderlyingSinkTest : public testing::Test { + public: + RTCEncodedAudioUnderlyingSinkTest() + : main_task_runner_( + blink::scheduler::GetSingleThreadTaskRunnerForTesting()), + webrtc_callback_( + new rtc::RefCountedObject<MockWebRtcTransformedFrameCallback>()), + transformer_(main_task_runner_) {} + + void SetUp() override { + EXPECT_FALSE(transformer_.HasTransformedFrameCallback()); + transformer_.RegisterTransformedFrameCallback(webrtc_callback_); + EXPECT_TRUE(transformer_.HasTransformedFrameCallback()); + } + + void TearDown() override { + platform_->RunUntilIdle(); + transformer_.UnregisterTransformedFrameCallback(); + EXPECT_FALSE(transformer_.HasTransformedFrameCallback()); + } + + RTCEncodedAudioUnderlyingSink* CreateSink(ScriptState* script_state) { + return MakeGarbageCollected<RTCEncodedAudioUnderlyingSink>( + script_state, + WTF::BindRepeating(&RTCEncodedAudioUnderlyingSinkTest::GetTransformer, + WTF::Unretained(this))); + } + + RTCEncodedAudioStreamTransformer* GetTransformer() { return &transformer_; } + + ScriptValue CreateEncodedAudioFrameChunk(ScriptState* script_state) { + RTCEncodedAudioFrame* frame = MakeGarbageCollected<RTCEncodedAudioFrame>( + std::unique_ptr<webrtc::TransformableFrameInterface>()); + return ScriptValue(script_state->GetIsolate(), + ToV8(frame, script_state->GetContext()->Global(), + script_state->GetIsolate())); + } + + protected: + ScopedTestingPlatformSupport<TestingPlatformSupport> platform_; + scoped_refptr<base::SingleThreadTaskRunner> main_task_runner_; + rtc::scoped_refptr<MockWebRtcTransformedFrameCallback> webrtc_callback_; + RTCEncodedAudioStreamTransformer transformer_; +}; + +TEST_F(RTCEncodedAudioUnderlyingSinkTest, + WriteToStreamForwardsToWebRtcCallback) { + V8TestingScope v8_scope; + ScriptState* script_state = v8_scope.GetScriptState(); + auto* sink = CreateSink(script_state); + auto* stream = + WritableStream::CreateWithCountQueueingStrategy(script_state, sink, 1u); + + NonThrowableExceptionState exception_state; + auto* writer = stream->getWriter(script_state, exception_state); + + EXPECT_CALL(*webrtc_callback_, OnTransformedFrame(_)); + ScriptPromiseTester write_tester( + script_state, + writer->write(script_state, CreateEncodedAudioFrameChunk(script_state), + exception_state)); + EXPECT_FALSE(write_tester.IsFulfilled()); + + writer->releaseLock(script_state); + ScriptPromiseTester close_tester( + script_state, stream->close(script_state, exception_state)); + close_tester.WaitUntilSettled(); + + // Writing to the sink after the stream closes should fail. + DummyExceptionStateForTesting dummy_exception_state; + sink->write(script_state, CreateEncodedAudioFrameChunk(script_state), nullptr, + dummy_exception_state); + EXPECT_TRUE(dummy_exception_state.HadException()); + EXPECT_EQ(dummy_exception_state.Code(), + static_cast<ExceptionCode>(DOMExceptionCode::kInvalidStateError)); +} + +TEST_F(RTCEncodedAudioUnderlyingSinkTest, WriteInvalidDataFails) { + V8TestingScope v8_scope; + ScriptState* script_state = v8_scope.GetScriptState(); + auto* sink = CreateSink(script_state); + ScriptValue v8_integer = ScriptValue::From(script_state, 0); + + // Writing something that is not an RTCEncodedAudioFrame integer to the sink + // should fail. + DummyExceptionStateForTesting dummy_exception_state; + sink->write(script_state, v8_integer, nullptr, dummy_exception_state); + EXPECT_TRUE(dummy_exception_state.HadException()); +} + +} // namespace blink
diff --git a/third_party/blink/renderer/modules/peerconnection/rtc_encoded_audio_underlying_source.cc b/third_party/blink/renderer/modules/peerconnection/rtc_encoded_audio_underlying_source.cc new file mode 100644 index 0000000..91addd31 --- /dev/null +++ b/third_party/blink/renderer/modules/peerconnection/rtc_encoded_audio_underlying_source.cc
@@ -0,0 +1,88 @@ +// Copyright 2020 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "third_party/blink/renderer/modules/peerconnection/rtc_encoded_audio_underlying_source.h" + +#include "third_party/blink/renderer/bindings/core/v8/v8_throw_dom_exception.h" +#include "third_party/blink/renderer/core/streams/readable_stream_default_controller_with_script_scope.h" +#include "third_party/blink/renderer/modules/peerconnection/rtc_encoded_audio_frame.h" +#include "third_party/blink/renderer/platform/bindings/exception_code.h" +#include "third_party/blink/renderer/platform/bindings/exception_state.h" +#include "third_party/blink/renderer/platform/wtf/vector.h" +#include "third_party/webrtc/api/frame_transformer_interface.h" + +namespace blink { + +// Frames should not be queued at all. We allow queuing a few frames to deal +// with transient slowdowns. Specified as a negative number of frames since +// queuing is reported by the stream controller as a negative desired size. +const int RTCEncodedAudioUnderlyingSource::kMinQueueDesiredSize = -60; + +RTCEncodedAudioUnderlyingSource::RTCEncodedAudioUnderlyingSource( + ScriptState* script_state, + base::OnceClosure disconnect_callback, + bool is_receiver) + : UnderlyingSourceBase(script_state), + script_state_(script_state), + disconnect_callback_(std::move(disconnect_callback)), + is_receiver_(is_receiver) { + DCHECK(disconnect_callback_); +} + +ScriptPromise RTCEncodedAudioUnderlyingSource::pull(ScriptState* script_state) { + DCHECK_CALLED_ON_VALID_THREAD(thread_checker_); + // WebRTC is a push source without backpressure support, so nothing to do + // here. + return ScriptPromise::CastUndefined(script_state); +} + +ScriptPromise RTCEncodedAudioUnderlyingSource::Cancel(ScriptState* script_state, + ScriptValue reason) { + DCHECK_CALLED_ON_VALID_THREAD(thread_checker_); + if (disconnect_callback_) + std::move(disconnect_callback_).Run(); + return ScriptPromise::CastUndefined(script_state); +} + +void RTCEncodedAudioUnderlyingSource::Trace(Visitor* visitor) { + visitor->Trace(script_state_); + UnderlyingSourceBase::Trace(visitor); +} + +void RTCEncodedAudioUnderlyingSource::OnFrameFromSource( + std::unique_ptr<webrtc::TransformableFrameInterface> webrtc_frame) { + DCHECK_CALLED_ON_VALID_THREAD(thread_checker_); + // If the source is canceled or there are too many queued frames, + // drop the new frame. + if (!disconnect_callback_ || !Controller() || + Controller()->DesiredSize() <= kMinQueueDesiredSize) { + return; + } + + RTCEncodedAudioFrame* encoded_frame = nullptr; + if (is_receiver_) { + // Receivers produce frames as webrtc::TransformableAudioFrameInterface, + // which allows exposing the CSRCs. + std::unique_ptr<webrtc::TransformableAudioFrameInterface> audio_frame = + base::WrapUnique(static_cast<webrtc::TransformableAudioFrameInterface*>( + webrtc_frame.release())); + encoded_frame = + MakeGarbageCollected<RTCEncodedAudioFrame>(std::move(audio_frame)); + } else { + encoded_frame = + MakeGarbageCollected<RTCEncodedAudioFrame>(std::move(webrtc_frame)); + } + Controller()->Enqueue(encoded_frame); +} + +void RTCEncodedAudioUnderlyingSource::Close() { + DCHECK_CALLED_ON_VALID_THREAD(thread_checker_); + if (disconnect_callback_) + std::move(disconnect_callback_).Run(); + + if (Controller()) + Controller()->Close(); +} + +} // namespace blink
diff --git a/third_party/blink/renderer/modules/peerconnection/rtc_encoded_audio_underlying_source.h b/third_party/blink/renderer/modules/peerconnection/rtc_encoded_audio_underlying_source.h new file mode 100644 index 0000000..7ee6684 --- /dev/null +++ b/third_party/blink/renderer/modules/peerconnection/rtc_encoded_audio_underlying_source.h
@@ -0,0 +1,50 @@ +// Copyright 2020 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef THIRD_PARTY_BLINK_RENDERER_MODULES_PEERCONNECTION_RTC_ENCODED_AUDIO_UNDERLYING_SOURCE_H_ +#define THIRD_PARTY_BLINK_RENDERER_MODULES_PEERCONNECTION_RTC_ENCODED_AUDIO_UNDERLYING_SOURCE_H_ + +#include "base/threading/thread_checker.h" +#include "third_party/blink/renderer/core/streams/underlying_source_base.h" +#include "third_party/blink/renderer/modules/modules_export.h" + +namespace webrtc { +class TransformableFrameInterface; +} // namespace webrtc + +namespace blink { + +class MODULES_EXPORT RTCEncodedAudioUnderlyingSource + : public UnderlyingSourceBase { + public: + explicit RTCEncodedAudioUnderlyingSource( + ScriptState*, + base::OnceClosure disconnect_callback, + bool is_receiver); + + // UnderlyingSourceBase + ScriptPromise pull(ScriptState*) override; + ScriptPromise Cancel(ScriptState*, ScriptValue reason) override; + + void OnFrameFromSource(std::unique_ptr<webrtc::TransformableFrameInterface>); + void Close(); + + void Trace(Visitor*) override; + + private: + FRIEND_TEST_ALL_PREFIXES(RTCEncodedAudioUnderlyingSourceTest, + QueuedFramesAreDroppedWhenOverflow); + static const int kMinQueueDesiredSize; + + const Member<ScriptState> script_state_; + base::OnceClosure disconnect_callback_; + // Indicates if this source is for a receiver. Receiver sources + // expose CSRCs. + const bool is_receiver_; + THREAD_CHECKER(thread_checker_); +}; + +} // namespace blink + +#endif // THIRD_PARTY_BLINK_RENDERER_MODULES_PEERCONNECTION_RTC_ENCODED_AUDIO_UNDERLYING_SOURCE_H_
diff --git a/third_party/blink/renderer/modules/peerconnection/rtc_encoded_audio_underlying_source_test.cc b/third_party/blink/renderer/modules/peerconnection/rtc_encoded_audio_underlying_source_test.cc new file mode 100644 index 0000000..297f93e3 --- /dev/null +++ b/third_party/blink/renderer/modules/peerconnection/rtc_encoded_audio_underlying_source_test.cc
@@ -0,0 +1,104 @@ +// Copyright 2020 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "third_party/blink/renderer/modules/peerconnection/rtc_encoded_audio_underlying_source.h" +#include <memory> + +#include "base/test/mock_callback.h" +#include "testing/gmock/include/gmock/gmock.h" +#include "testing/gtest/include/gtest/gtest.h" +#include "third_party/blink/renderer/bindings/core/v8/script_promise_tester.h" +#include "third_party/blink/renderer/bindings/core/v8/v8_binding_for_testing.h" +#include "third_party/blink/renderer/bindings/modules/v8/v8_rtc_encoded_audio_frame.h" +#include "third_party/blink/renderer/core/streams/readable_stream.h" +#include "third_party/blink/renderer/core/streams/readable_stream_default_controller_with_script_scope.h" +#include "third_party/blink/renderer/modules/peerconnection/rtc_encoded_audio_frame.h" +#include "third_party/blink/renderer/platform/bindings/exception_state.h" +#include "third_party/webrtc/api/frame_transformer_interface.h" + +namespace blink { + +namespace { +class FakeTransformableFrame : public webrtc::TransformableFrameInterface { + public: + FakeTransformableFrame() = default; + ~FakeTransformableFrame() override = default; + + rtc::ArrayView<const uint8_t> GetData() const override { return nullptr; } + void SetData(rtc::ArrayView<const uint8_t> data) override {} + uint32_t GetTimestamp() const override { return 0; } + uint32_t GetSsrc() const override { return 0; } +}; +} // namespace + +class RTCEncodedAudioUnderlyingSourceTest : public testing::Test { + public: + RTCEncodedAudioUnderlyingSource* CreateSource(ScriptState* script_state, + bool is_receiver = false) { + return MakeGarbageCollected<RTCEncodedAudioUnderlyingSource>( + script_state, WTF::Bind(disconnect_callback_.Get()), is_receiver); + } + + protected: + base::MockOnceClosure disconnect_callback_; +}; + +TEST_F(RTCEncodedAudioUnderlyingSourceTest, + SourceDataFlowsThroughStreamAndCloses) { + V8TestingScope v8_scope; + ScriptState* script_state = v8_scope.GetScriptState(); + auto* source = CreateSource(script_state); + auto* stream = + ReadableStream::CreateWithCountQueueingStrategy(script_state, source, 0); + + NonThrowableExceptionState exception_state; + auto* reader = stream->getReader(script_state, exception_state); + + ScriptPromiseTester read_tester(script_state, + reader->read(script_state, exception_state)); + EXPECT_FALSE(read_tester.IsFulfilled()); + source->OnFrameFromSource(std::make_unique<FakeTransformableFrame>()); + read_tester.WaitUntilSettled(); + EXPECT_TRUE(read_tester.IsFulfilled()); + + EXPECT_CALL(disconnect_callback_, Run()); + source->Close(); +} + +TEST_F(RTCEncodedAudioUnderlyingSourceTest, CancelStream) { + V8TestingScope v8_scope; + auto* source = CreateSource(v8_scope.GetScriptState()); + auto* stream = ReadableStream::CreateWithCountQueueingStrategy( + v8_scope.GetScriptState(), source, 0); + + EXPECT_CALL(disconnect_callback_, Run()); + NonThrowableExceptionState exception_state; + stream->cancel(v8_scope.GetScriptState(), exception_state); +} + +TEST_F(RTCEncodedAudioUnderlyingSourceTest, + QueuedFramesAreDroppedWhenOverflow) { + V8TestingScope v8_scope; + ScriptState* script_state = v8_scope.GetScriptState(); + auto* source = CreateSource(script_state); + // Create a stream, to ensure there is a controller associated to the source. + ReadableStream::CreateWithCountQueueingStrategy(v8_scope.GetScriptState(), + source, 0); + for (int i = 0; i > RTCEncodedAudioUnderlyingSource::kMinQueueDesiredSize; + --i) { + EXPECT_EQ(source->Controller()->DesiredSize(), i); + source->OnFrameFromSource(std::make_unique<FakeTransformableFrame>()); + } + EXPECT_EQ(source->Controller()->DesiredSize(), + RTCEncodedAudioUnderlyingSource::kMinQueueDesiredSize); + + source->OnFrameFromSource(std::make_unique<FakeTransformableFrame>()); + EXPECT_EQ(source->Controller()->DesiredSize(), + RTCEncodedAudioUnderlyingSource::kMinQueueDesiredSize); + + EXPECT_CALL(disconnect_callback_, Run()); + source->Close(); +} + +} // namespace blink
diff --git a/third_party/blink/renderer/modules/peerconnection/rtc_rtp_send_parameters.idl b/third_party/blink/renderer/modules/peerconnection/rtc_rtp_send_parameters.idl index 29664cb..da4295d 100644 --- a/third_party/blink/renderer/modules/peerconnection/rtc_rtp_send_parameters.idl +++ b/third_party/blink/renderer/modules/peerconnection/rtc_rtp_send_parameters.idl
@@ -2,9 +2,16 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +// https://w3c.github.io/mst-content-hint/#dom-rtcdegradationpreference +enum RTCDegradationPreference { + "maintain-framerate", + "maintain-resolution", + "balanced" +}; + // https://w3c.github.io/webrtc-pc/#rtcsendrtpparameters dictionary RTCRtpSendParameters : RTCRtpParameters { required DOMString transactionId; required sequence<RTCRtpEncodingParameters> encodings; - //TODO(orphis): Missing degradationPrerence. https://crbug.com/857041 -}; \ No newline at end of file + RTCDegradationPreference degradationPreference; +};
diff --git a/third_party/blink/renderer/modules/peerconnection/rtc_rtp_sender.cc b/third_party/blink/renderer/modules/peerconnection/rtc_rtp_sender.cc index e6548ff9..2e89d4ee 100644 --- a/third_party/blink/renderer/modules/peerconnection/rtc_rtp_sender.cc +++ b/third_party/blink/renderer/modules/peerconnection/rtc_rtp_sender.cc
@@ -281,7 +281,8 @@ return result; } -std::tuple<Vector<webrtc::RtpEncodingParameters>, webrtc::DegradationPreference> +std::tuple<Vector<webrtc::RtpEncodingParameters>, + absl::optional<webrtc::DegradationPreference>> ToRtpParameters(const RTCRtpSendParameters* parameters) { Vector<webrtc::RtpEncodingParameters> encodings; if (parameters->hasEncodings()) { @@ -292,8 +293,22 @@ } } - webrtc::DegradationPreference degradation_preference = - webrtc::DegradationPreference::BALANCED; + absl::optional<webrtc::DegradationPreference> degradation_preference; + + if (parameters->hasDegradationPreference()) { + if (parameters->degradationPreference() == "balanced") { + degradation_preference = webrtc::DegradationPreference::BALANCED; + } else if (parameters->degradationPreference() == "maintain-framerate") { + degradation_preference = + webrtc::DegradationPreference::MAINTAIN_FRAMERATE; + } else if (parameters->degradationPreference() == "maintain-resolution") { + degradation_preference = + webrtc::DegradationPreference::MAINTAIN_RESOLUTION; + } else { + NOTREACHED(); + } + } + return std::make_tuple(encodings, degradation_preference); } @@ -417,12 +432,28 @@ RTCRtpSendParameters* RTCRtpSender::getParameters() { RTCRtpSendParameters* parameters = RTCRtpSendParameters::Create(); - // TODO(orphis): Forward missing field: degradationPreference std::unique_ptr<webrtc::RtpParameters> webrtc_parameters = sender_->GetParameters(); parameters->setTransactionId(webrtc_parameters->transaction_id.c_str()); + if (webrtc_parameters->degradation_preference.has_value()) { + WTF::String degradation_preference_str; + switch (webrtc_parameters->degradation_preference.value()) { + case webrtc::DegradationPreference::MAINTAIN_FRAMERATE: + degradation_preference_str = "maintain-framerate"; + break; + case webrtc::DegradationPreference::MAINTAIN_RESOLUTION: + degradation_preference_str = "maintain-resolution"; + break; + case webrtc::DegradationPreference::BALANCED: + degradation_preference_str = "balanced"; + break; + default: + NOTREACHED(); + } + parameters->setDegradationPreference(degradation_preference_str); + } RTCRtcpParameters* rtcp = RTCRtcpParameters::Create(); rtcp->setCname(webrtc_parameters->rtcp.cname.c_str()); rtcp->setReducedSize(webrtc_parameters->rtcp.reduced_size); @@ -515,7 +546,7 @@ // native layer without having to transform all the other read-only // parameters. Vector<webrtc::RtpEncodingParameters> encodings; - webrtc::DegradationPreference degradation_preference; + absl::optional<webrtc::DegradationPreference> degradation_preference; std::tie(encodings, degradation_preference) = ToRtpParameters(parameters); auto* request = MakeGarbageCollected<SetParametersRequest>(resolver, this);
diff --git a/third_party/blink/renderer/modules/peerconnection/rtc_rtp_sender_impl.cc b/third_party/blink/renderer/modules/peerconnection/rtc_rtp_sender_impl.cc index 91599bb1..23f13db8 100644 --- a/third_party/blink/renderer/modules/peerconnection/rtc_rtp_sender_impl.cc +++ b/third_party/blink/renderer/modules/peerconnection/rtc_rtp_sender_impl.cc
@@ -251,9 +251,10 @@ return std::make_unique<webrtc::RtpParameters>(parameters_); } - void SetParameters(Vector<webrtc::RtpEncodingParameters> encodings, - webrtc::DegradationPreference degradation_preference, - base::OnceCallback<void(webrtc::RTCError)> callback) { + void SetParameters( + Vector<webrtc::RtpEncodingParameters> encodings, + absl::optional<webrtc::DegradationPreference> degradation_preference, + base::OnceCallback<void(webrtc::RTCError)> callback) { DCHECK(main_task_runner_->BelongsToCurrentThread()); webrtc::RtpParameters new_parameters = parameters_; @@ -510,7 +511,7 @@ void RTCRtpSenderImpl::SetParameters( Vector<webrtc::RtpEncodingParameters> encodings, - webrtc::DegradationPreference degradation_preference, + absl::optional<webrtc::DegradationPreference> degradation_preference, blink::RTCVoidRequest* request) { internal_->SetParameters( std::move(encodings), degradation_preference,
diff --git a/third_party/blink/renderer/modules/peerconnection/rtc_rtp_sender_impl.h b/third_party/blink/renderer/modules/peerconnection/rtc_rtp_sender_impl.h index 5ba8472a..ec05fea 100644 --- a/third_party/blink/renderer/modules/peerconnection/rtc_rtp_sender_impl.h +++ b/third_party/blink/renderer/modules/peerconnection/rtc_rtp_sender_impl.h
@@ -143,7 +143,7 @@ std::unique_ptr<blink::RtcDtmfSenderHandler> GetDtmfSender() const override; std::unique_ptr<webrtc::RtpParameters> GetParameters() const override; void SetParameters(Vector<webrtc::RtpEncodingParameters>, - webrtc::DegradationPreference, + absl::optional<webrtc::DegradationPreference>, blink::RTCVoidRequest*) override; void GetStats(RTCStatsReportCallback, const Vector<webrtc::NonStandardGroupId>&) override;
diff --git a/third_party/blink/renderer/modules/permissions/permissions.cc b/third_party/blink/renderer/modules/permissions/permissions.cc index 9782344..5ec49bc 100644 --- a/third_party/blink/renderer/modules/permissions/permissions.cc +++ b/third_party/blink/renderer/modules/permissions/permissions.cc
@@ -155,9 +155,14 @@ return promise; } +void Permissions::Trace(Visitor* visitor) { + visitor->Trace(service_); + ScriptWrappable::Trace(visitor); +} + PermissionService* Permissions::GetService( ExecutionContext* execution_context) { - if (!service_) { + if (!service_.is_bound()) { ConnectToPermissionService( execution_context, service_.BindNewPipeAndPassReceiver(
diff --git a/third_party/blink/renderer/modules/permissions/permissions.h b/third_party/blink/renderer/modules/permissions/permissions.h index 66260d0..c58cd0f4 100644 --- a/third_party/blink/renderer/modules/permissions/permissions.h +++ b/third_party/blink/renderer/modules/permissions/permissions.h
@@ -5,11 +5,12 @@ #ifndef THIRD_PARTY_BLINK_RENDERER_MODULES_PERMISSIONS_PERMISSIONS_H_ #define THIRD_PARTY_BLINK_RENDERER_MODULES_PERMISSIONS_PERMISSIONS_H_ -#include "mojo/public/cpp/bindings/remote.h" #include "third_party/blink/public/mojom/permissions/permission.mojom-blink.h" #include "third_party/blink/renderer/bindings/core/v8/script_promise.h" #include "third_party/blink/renderer/platform/bindings/script_wrappable.h" #include "third_party/blink/renderer/platform/heap/handle.h" +#include "third_party/blink/renderer/platform/mojo/heap_mojo_remote.h" +#include "third_party/blink/renderer/platform/mojo/heap_mojo_wrapper_mode.h" namespace blink { @@ -22,6 +23,7 @@ DEFINE_WRAPPERTYPEINFO(); public: + Permissions() : service_(nullptr) {} ScriptPromise query(ScriptState*, const ScriptValue&, ExceptionState&); ScriptPromise request(ScriptState*, const ScriptValue&, ExceptionState&); ScriptPromise revoke(ScriptState*, const ScriptValue&, ExceptionState&); @@ -29,6 +31,8 @@ const HeapVector<ScriptValue>&, ExceptionState&); + void Trace(Visitor*) override; + private: mojom::blink::PermissionService* GetService(ExecutionContext*); void ServiceConnectionError(); @@ -40,7 +44,9 @@ Vector<int>, const Vector<mojom::blink::PermissionStatus>&); - mojo::Remote<mojom::blink::PermissionService> service_; + HeapMojoRemote<mojom::blink::PermissionService, + HeapMojoWrapperMode::kWithoutContextObserver> + service_; }; } // namespace blink
diff --git a/third_party/blink/renderer/platform/BUILD.gn b/third_party/blink/renderer/platform/BUILD.gn index 05c95f5..6658b51 100644 --- a/third_party/blink/renderer/platform/BUILD.gn +++ b/third_party/blink/renderer/platform/BUILD.gn
@@ -1270,6 +1270,8 @@ "peerconnection/rtc_api_name.h", "peerconnection/rtc_dtmf_sender_handler.cc", "peerconnection/rtc_dtmf_sender_handler.h", + "peerconnection/rtc_encoded_audio_stream_transformer.cc", + "peerconnection/rtc_encoded_audio_stream_transformer.h", "peerconnection/rtc_encoded_video_stream_transformer.cc", "peerconnection/rtc_encoded_video_stream_transformer.h", "peerconnection/rtc_event_log_output_sink.h", @@ -1894,6 +1896,7 @@ "mojo/string16_mojom_traits_test.cc", "p2p/filtering_network_manager_test.cc", "p2p/ipc_network_manager_test.cc", + "peerconnection/rtc_encoded_audio_stream_transformer_test.cc", "peerconnection/rtc_encoded_video_stream_transformer_test.cc", "peerconnection/rtc_stats_test.cc", "peerconnection/rtc_video_decoder_adapter_test.cc",
diff --git a/third_party/blink/renderer/platform/peerconnection/rtc_encoded_audio_stream_transformer.cc b/third_party/blink/renderer/platform/peerconnection/rtc_encoded_audio_stream_transformer.cc new file mode 100644 index 0000000..18f46d1d --- /dev/null +++ b/third_party/blink/renderer/platform/peerconnection/rtc_encoded_audio_stream_transformer.cc
@@ -0,0 +1,137 @@ +// Copyright 2020 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "third_party/blink/renderer/platform/peerconnection/rtc_encoded_audio_stream_transformer.h" + +#include <utility> + +#include "base/memory/ptr_util.h" +#include "base/single_thread_task_runner.h" +#include "third_party/blink/renderer/platform/peerconnection/rtc_scoped_refptr_cross_thread_copier.h" +#include "third_party/blink/renderer/platform/scheduler/public/post_cross_thread_task.h" +#include "third_party/blink/renderer/platform/wtf/cross_thread_functional.h" +#include "third_party/webrtc/api/frame_transformer_interface.h" +#include "third_party/webrtc/rtc_base/ref_counted_object.h" + +namespace blink { + +namespace { + +// This delegate class exists to work around the fact that +// RTCEncodedAudioStreamTransformer cannot derive from rtc::RefCountedObject +// and post tasks referencing itself as an rtc::scoped_refptr. Instead, +// RTCEncodedAudioStreamTransformer creates a delegate using +// rtc::RefCountedObject and posts tasks referencing the delegate, which invokes +// the RTCEncodedAudioStreamTransformer via callbacks. +class RTCEncodedAudioStreamTransformerDelegate + : public webrtc::FrameTransformerInterface { + public: + RTCEncodedAudioStreamTransformerDelegate( + const base::WeakPtr<RTCEncodedAudioStreamTransformer>& transformer, + scoped_refptr<base::SingleThreadTaskRunner> main_task_runner) + : transformer_(transformer), + main_task_runner_(std::move(main_task_runner)) { + DCHECK(main_task_runner_->BelongsToCurrentThread()); + } + + // webrtc::FrameTransformerInterface + void RegisterTransformedFrameCallback( + rtc::scoped_refptr<webrtc::TransformedFrameCallback> + send_frame_to_sink_callback) override { + PostCrossThreadTask( + *main_task_runner_, FROM_HERE, + CrossThreadBindOnce( + &RTCEncodedAudioStreamTransformer::RegisterTransformedFrameCallback, + transformer_, std::move(send_frame_to_sink_callback))); + } + + void UnregisterTransformedFrameCallback() override { + PostCrossThreadTask( + *main_task_runner_, FROM_HERE, + CrossThreadBindOnce(&RTCEncodedAudioStreamTransformer:: + UnregisterTransformedFrameCallback, + transformer_)); + } + + void Transform( + std::unique_ptr<webrtc::TransformableFrameInterface> frame) override { + auto audio_frame = base::WrapUnique( + static_cast<webrtc::TransformableFrameInterface*>(frame.release())); + PostCrossThreadTask( + *main_task_runner_, FROM_HERE, + CrossThreadBindOnce(&RTCEncodedAudioStreamTransformer::TransformFrame, + transformer_, std::move(audio_frame))); + } + + private: + base::WeakPtr<RTCEncodedAudioStreamTransformer> transformer_; + const scoped_refptr<base::SingleThreadTaskRunner> main_task_runner_; +}; + +} // namespace + +RTCEncodedAudioStreamTransformer::RTCEncodedAudioStreamTransformer( + scoped_refptr<base::SingleThreadTaskRunner> main_task_runner) { + DCHECK(main_task_runner->BelongsToCurrentThread()); + delegate_ = + new rtc::RefCountedObject<RTCEncodedAudioStreamTransformerDelegate>( + weak_factory_.GetWeakPtr(), std::move(main_task_runner)); +} + +void RTCEncodedAudioStreamTransformer::RegisterTransformedFrameCallback( + rtc::scoped_refptr<webrtc::TransformedFrameCallback> callback) { + DCHECK_CALLED_ON_VALID_THREAD(thread_checker_); + send_frame_to_sink_cb_ = callback; +} + +void RTCEncodedAudioStreamTransformer::UnregisterTransformedFrameCallback() { + DCHECK_CALLED_ON_VALID_THREAD(thread_checker_); + send_frame_to_sink_cb_ = nullptr; +} + +void RTCEncodedAudioStreamTransformer::TransformFrame( + std::unique_ptr<webrtc::TransformableFrameInterface> frame) { + DCHECK_CALLED_ON_VALID_THREAD(thread_checker_); + // If no transformer callback has been set, drop the frame. + if (!transformer_callback_) + return; + + transformer_callback_.Run(std::move(frame)); +} + +void RTCEncodedAudioStreamTransformer::SendFrameToSink( + std::unique_ptr<webrtc::TransformableFrameInterface> frame) { + DCHECK_CALLED_ON_VALID_THREAD(thread_checker_); + if (send_frame_to_sink_cb_) + send_frame_to_sink_cb_->OnTransformedFrame(std::move(frame)); +} + +void RTCEncodedAudioStreamTransformer::SetTransformerCallback( + TransformerCallback callback) { + DCHECK_CALLED_ON_VALID_THREAD(thread_checker_); + transformer_callback_ = std::move(callback); +} + +void RTCEncodedAudioStreamTransformer::ResetTransformerCallback() { + DCHECK_CALLED_ON_VALID_THREAD(thread_checker_); + transformer_callback_.Reset(); +} + +bool RTCEncodedAudioStreamTransformer::HasTransformerCallback() const { + DCHECK_CALLED_ON_VALID_THREAD(thread_checker_); + return !transformer_callback_.is_null(); +} + +bool RTCEncodedAudioStreamTransformer::HasTransformedFrameCallback() const { + DCHECK_CALLED_ON_VALID_THREAD(thread_checker_); + return !!send_frame_to_sink_cb_; +} + +rtc::scoped_refptr<webrtc::FrameTransformerInterface> +RTCEncodedAudioStreamTransformer::Delegate() { + DCHECK_CALLED_ON_VALID_THREAD(thread_checker_); + return delegate_; +} + +} // namespace blink
diff --git a/third_party/blink/renderer/platform/peerconnection/rtc_encoded_audio_stream_transformer.h b/third_party/blink/renderer/platform/peerconnection/rtc_encoded_audio_stream_transformer.h new file mode 100644 index 0000000..f1beece0 --- /dev/null +++ b/third_party/blink/renderer/platform/peerconnection/rtc_encoded_audio_stream_transformer.h
@@ -0,0 +1,84 @@ +// Copyright 2020 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef THIRD_PARTY_BLINK_RENDERER_PLATFORM_PEERCONNECTION_RTC_ENCODED_AUDIO_STREAM_TRANSFORMER_H_ +#define THIRD_PARTY_BLINK_RENDERER_PLATFORM_PEERCONNECTION_RTC_ENCODED_AUDIO_STREAM_TRANSFORMER_H_ + +#include <stdint.h> + +#include <memory> +#include <vector> + +#include "base/callback.h" +#include "base/memory/weak_ptr.h" +#include "base/threading/thread_checker.h" +#include "third_party/blink/renderer/platform/platform_export.h" +#include "third_party/webrtc/api/scoped_refptr.h" + +namespace base { +class SingleThreadTaskRunner; +} // namespace base + +namespace webrtc { +class FrameTransformerInterface; +class TransformedFrameCallback; +class TransformableFrameInterface; +} // namespace webrtc + +namespace blink { + +class PLATFORM_EXPORT RTCEncodedAudioStreamTransformer { + public: + using TransformerCallback = base::RepeatingCallback<void( + std::unique_ptr<webrtc::TransformableFrameInterface>)>; + explicit RTCEncodedAudioStreamTransformer( + scoped_refptr<base::SingleThreadTaskRunner> main_task_runner); + + // Called by WebRTC to let us know about a callback object to send transformed + // frames to the WebRTC decoder. Runs on an internal WebRTC thread. + // The callback can run on any thread. + void RegisterTransformedFrameCallback( + rtc::scoped_refptr<webrtc::TransformedFrameCallback>); + + // Called by WebRTC to let us know that any reference to the callback object + // reported by RegisterTransformedFrameCallback() should be released since + // the callback is no longer useful and is intended for destruction. + void UnregisterTransformedFrameCallback(); + + // Called by WebRTC to notify of new untransformed frames from the WebRTC + // stack. Runs on an internal WebRTC thread. + void TransformFrame(std::unique_ptr<webrtc::TransformableFrameInterface>); + + // Send a transformed frame to the WebRTC sink. Must run on the main + // thread. + void SendFrameToSink( + std::unique_ptr<webrtc::TransformableFrameInterface> frame); + + // Set a callback to be invoked on every untransformed frame. Must run on the + // main thread. + void SetTransformerCallback(TransformerCallback); + + // Removes the callback + void ResetTransformerCallback(); + + // Returns true if a callback has been set with SetTransformerCallback(), + // false otherwise. Must run on the main thread. + bool HasTransformerCallback() const; + + // Returns true if a webrtc::TransformedFrameCallback is registered. + bool HasTransformedFrameCallback() const; + + rtc::scoped_refptr<webrtc::FrameTransformerInterface> Delegate(); + + private: + THREAD_CHECKER(thread_checker_); + rtc::scoped_refptr<webrtc::FrameTransformerInterface> delegate_; + rtc::scoped_refptr<webrtc::TransformedFrameCallback> send_frame_to_sink_cb_; + TransformerCallback transformer_callback_; + base::WeakPtrFactory<RTCEncodedAudioStreamTransformer> weak_factory_{this}; +}; + +} // namespace blink + +#endif // THIRD_PARTY_BLINK_RENDERER_PLATFORM_PEERCONNECTION_RTC_ENCODED_AUDIO_STREAM_TRANSFORMER_H_
diff --git a/third_party/blink/renderer/platform/peerconnection/rtc_encoded_audio_stream_transformer_test.cc b/third_party/blink/renderer/platform/peerconnection/rtc_encoded_audio_stream_transformer_test.cc new file mode 100644 index 0000000..bd72fe5 --- /dev/null +++ b/third_party/blink/renderer/platform/peerconnection/rtc_encoded_audio_stream_transformer_test.cc
@@ -0,0 +1,105 @@ +// Copyright 2020 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "third_party/blink/renderer/platform/peerconnection/rtc_encoded_audio_stream_transformer.h" + +#include <stdint.h> + +#include <memory> +#include <vector> + +#include "base/memory/scoped_refptr.h" +#include "base/single_thread_task_runner.h" +#include "base/test/task_environment.h" +#include "testing/gmock/include/gmock/gmock.h" +#include "testing/gtest/include/gtest/gtest.h" +#include "third_party/blink/public/platform/scheduler/test/renderer_scheduler_test_support.h" +#include "third_party/blink/renderer/platform/peerconnection/rtc_scoped_refptr_cross_thread_copier.h" +#include "third_party/blink/renderer/platform/scheduler/public/post_cross_thread_task.h" +#include "third_party/blink/renderer/platform/wtf/cross_thread_functional.h" +#include "third_party/blink/renderer/platform/wtf/functional.h" +#include "third_party/webrtc/api/frame_transformer_interface.h" +#include "third_party/webrtc/rtc_base/ref_counted_object.h" + +namespace blink { + +namespace { + +class MockWebRtcTransformedFrameCallback + : public webrtc::TransformedFrameCallback { + public: + MOCK_METHOD1(OnTransformedFrame, + void(std::unique_ptr<webrtc::TransformableFrameInterface>)); +}; + +class MockTransformerCallbackHolder { + public: + MOCK_METHOD1(OnEncodedFrame, + void(std::unique_ptr<webrtc::TransformableFrameInterface>)); +}; + +} // namespace + +class RTCEncodedAudioStreamTransformerTest : public ::testing::Test { + public: + RTCEncodedAudioStreamTransformerTest() + : main_task_runner_( + blink::scheduler::GetSingleThreadTaskRunnerForTesting()), + webrtc_task_runner_(base::ThreadPool::CreateSingleThreadTaskRunner({})), + webrtc_callback_( + new rtc::RefCountedObject<MockWebRtcTransformedFrameCallback>()), + encoded_audio_stream_transformer_(main_task_runner_) {} + + void SetUp() override { + EXPECT_FALSE( + encoded_audio_stream_transformer_.HasTransformedFrameCallback()); + encoded_audio_stream_transformer_.RegisterTransformedFrameCallback( + webrtc_callback_); + EXPECT_TRUE( + encoded_audio_stream_transformer_.HasTransformedFrameCallback()); + } + + void TearDown() override { + encoded_audio_stream_transformer_.UnregisterTransformedFrameCallback(); + EXPECT_FALSE( + encoded_audio_stream_transformer_.HasTransformedFrameCallback()); + } + + protected: + base::test::TaskEnvironment task_environment_; + scoped_refptr<base::SingleThreadTaskRunner> main_task_runner_; + scoped_refptr<base::SingleThreadTaskRunner> webrtc_task_runner_; + rtc::scoped_refptr<MockWebRtcTransformedFrameCallback> webrtc_callback_; + MockTransformerCallbackHolder mock_transformer_callback_holder_; + RTCEncodedAudioStreamTransformer encoded_audio_stream_transformer_; +}; + +TEST_F(RTCEncodedAudioStreamTransformerTest, + TransformerForwardsFrameToTransformerCallback) { + EXPECT_FALSE(encoded_audio_stream_transformer_.HasTransformerCallback()); + encoded_audio_stream_transformer_.SetTransformerCallback( + WTF::BindRepeating(&MockTransformerCallbackHolder::OnEncodedFrame, + WTF::Unretained(&mock_transformer_callback_holder_))); + EXPECT_TRUE(encoded_audio_stream_transformer_.HasTransformerCallback()); + + EXPECT_CALL(mock_transformer_callback_holder_, OnEncodedFrame); + // Frames are pushed to the RTCEncodedAudioStreamTransformer via its delegate, + // which would normally be registered with a WebRTC sender or receiver. + // In this test, manually send the frame to the transformer on the simulated + // WebRTC thread. + PostCrossThreadTask( + *webrtc_task_runner_, FROM_HERE, + CrossThreadBindOnce(&webrtc::FrameTransformerInterface::Transform, + encoded_audio_stream_transformer_.Delegate(), + nullptr)); + task_environment_.RunUntilIdle(); +} + +TEST_F(RTCEncodedAudioStreamTransformerTest, TransformerForwardsFrameToWebRTC) { + EXPECT_CALL(*webrtc_callback_, OnTransformedFrame); + encoded_audio_stream_transformer_.SendFrameToSink(nullptr); + task_environment_.RunUntilIdle(); +} + +} // namespace blink
diff --git a/third_party/blink/renderer/platform/peerconnection/rtc_rtp_sender_platform.h b/third_party/blink/renderer/platform/peerconnection/rtc_rtp_sender_platform.h index d474552..457824c6 100644 --- a/third_party/blink/renderer/platform/peerconnection/rtc_rtp_sender_platform.h +++ b/third_party/blink/renderer/platform/peerconnection/rtc_rtp_sender_platform.h
@@ -49,7 +49,7 @@ virtual std::unique_ptr<RtcDtmfSenderHandler> GetDtmfSender() const = 0; virtual std::unique_ptr<webrtc::RtpParameters> GetParameters() const = 0; virtual void SetParameters(Vector<webrtc::RtpEncodingParameters>, - webrtc::DegradationPreference, + absl::optional<webrtc::DegradationPreference>, RTCVoidRequest*) = 0; virtual void GetStats(RTCStatsReportCallback, const Vector<webrtc::NonStandardGroupId>&) = 0;
diff --git a/third_party/blink/renderer/platform/runtime_enabled_features.json5 b/third_party/blink/renderer/platform/runtime_enabled_features.json5 index 9e08f5c..e6f7c68c2c 100644 --- a/third_party/blink/renderer/platform/runtime_enabled_features.json5 +++ b/third_party/blink/renderer/platform/runtime_enabled_features.json5
@@ -927,6 +927,11 @@ status: "experimental", }, { + name: "LayoutNGForControls", + depends_on: ["LayoutNG"], + status: "experimental", + }, + { name: "LayoutNGFragmentItem", implied_by: ["LayoutNGBlockFragmentation", "LayoutNGFragmentTraversal"], },
diff --git a/third_party/blink/renderer/platform/scheduler/main_thread/main_thread_scheduler_impl.cc b/third_party/blink/renderer/platform/scheduler/main_thread/main_thread_scheduler_impl.cc index 449c0fd..9bf6ae8 100644 --- a/third_party/blink/renderer/platform/scheduler/main_thread/main_thread_scheduler_impl.cc +++ b/third_party/blink/renderer/platform/scheduler/main_thread/main_thread_scheduler_impl.cc
@@ -1477,7 +1477,7 @@ break; case UseCase::kNone: - // It's only safe to block tasks that if we are expecting a compositor + // It's only safe to block tasks if we are expecting a compositor // driven gesture. if (main_thread_only().blocking_input_expected_soon && any_thread().last_gesture_was_compositor_driven) { @@ -2597,7 +2597,7 @@ MainThreadTaskQueue* task_queue) const { DCHECK(task_queue); - // If |task_queue| is associated to a frame, the the frame scheduler computes + // If |task_queue| is associated to a frame, then the frame scheduler computes // the priority. FrameSchedulerImpl* frame_scheduler = task_queue->GetFrameScheduler();
diff --git a/third_party/blink/renderer/platform/scheduler/main_thread/user_model.cc b/third_party/blink/renderer/platform/scheduler/main_thread/user_model.cc index a9cba7913..0b04962 100644 --- a/third_party/blink/renderer/platform/scheduler/main_thread/user_model.cc +++ b/third_party/blink/renderer/platform/scheduler/main_thread/user_model.cc
@@ -98,8 +98,7 @@ base::TimeDelta::FromMilliseconds(kExpectSubsequentGestureMillis); return true; } else { - // If we've have a finished a gesture then a subsequent gesture is deemed - // likely. + // If we have finished a gesture then a subsequent gesture is deemed likely. base::TimeDelta expect_subsequent_gesture_for = base::TimeDelta::FromMilliseconds(kExpectSubsequentGestureMillis); if (last_continuous_gesture_time_.is_null() ||
diff --git a/third_party/blink/web_tests/FlagExpectations/composite-after-paint b/third_party/blink/web_tests/FlagExpectations/composite-after-paint index ccaa477..870b0ee3 100644 --- a/third_party/blink/web_tests/FlagExpectations/composite-after-paint +++ b/third_party/blink/web_tests/FlagExpectations/composite-after-paint
@@ -78,9 +78,6 @@ # No composited scrolling for overflow:hidden (on marquee). compositing/overflow/do-not-repaint-if-scrolling-composited-layers.html [ Failure ] -# We paint the iframe's content background in the scrolling layer, causing invalidation on scroll. -paint/invalidation/scroll/iframe-scroll-repaint.html [ Failure ] - # Extra layers for non-fast scrolling areas. compositing/overflow/textarea-scroll-touch.html [ Failure ]
diff --git a/third_party/blink/web_tests/FlagExpectations/layout-ng-fragment-item b/third_party/blink/web_tests/FlagExpectations/layout-ng-fragment-item index 19dfbdd8..c5c62f89 100644 --- a/third_party/blink/web_tests/FlagExpectations/layout-ng-fragment-item +++ b/third_party/blink/web_tests/FlagExpectations/layout-ng-fragment-item
@@ -4,7 +4,6 @@ # tags: [ Release Debug ] crbug.com/309675 compositing/gestures/gesture-tapHighlight-simple-longPress.html [ Failure ] -crbug.com/663585 editing/pasteboard/data-transfer-items-image-png.html [ Pass ] crbug.com/245154 editing/selection/modify_move/move-by-character-brute-force.html [ Pass ] crbug.com/24182 editing/selection/modify_move/move-by-word-visually-crash-test-5.html [ Pass ] crbug.com/591099 editing/selection/paint-hyphen.html [ Failure ] @@ -15,7 +14,7 @@ crbug.com/986282 external/wpt/client-hints/accept-ch-lifetime.tentative.https.html [ Crash ] crbug.com/982194 external/wpt/css/CSS2/floats/floats-rule3-outside-left-002.xht [ Failure ] crbug.com/982194 external/wpt/css/CSS2/floats/floats-rule3-outside-right-002.xht [ Failure ] -crbug.com/982194 external/wpt/css/CSS2/floats/floats-rule7-outside-left-001.xht [ Failure Timeout ] +crbug.com/982194 external/wpt/css/CSS2/floats/floats-rule7-outside-left-001.xht [ Failure ] crbug.com/982194 external/wpt/css/CSS2/floats/floats-rule7-outside-right-001.xht [ Failure ] crbug.com/982194 external/wpt/css/css-contain/contain-layout-017.html [ Failure ] crbug.com/982194 external/wpt/css/css-contain/contain-paint-021.html [ Failure ] @@ -94,7 +93,7 @@ crbug.com/852645 external/wpt/fullscreen/api/element-request-fullscreen-two-iframes-manual.html [ Timeout ] crbug.com/982194 external/wpt/html/dom/elements/requirements-relating-to-bidirctional-algorithm-formatting-characters/dir-isolation-005c.html [ Failure ] crbug.com/982194 external/wpt/html/rendering/non-replaced-elements/the-fieldset-and-legend-elements/fieldset-vertical.html [ Failure ] -crbug.com/736415 external/wpt/html/user-activation/navigation-state-reset-crossorigin.sub.tentative.html [ Failure ] +crbug.com/736415 external/wpt/html/user-activation/navigation-state-reset-crossorigin.sub.tentative.html [ Pass Timeout ] crbug.com/736415 external/wpt/html/user-activation/navigation-state-reset-sameorigin.tentative.html [ Failure ] crbug.com/626703 external/wpt/infrastructure/testdriver/actions/eventOrder.html [ Timeout ] crbug.com/982194 external/wpt/intersection-observe/v2/scaled-target.html [ Failure ] @@ -130,7 +129,7 @@ crbug.com/982194 fast/multicol/vertical-lr/abspos-auto-position-on-line.html [ Failure Pass ] crbug.com/982194 fast/multicol/vertical-lr/nested-columns.html [ Failure ] crbug.com/814953 fast/replaced/no-focus-ring-iframe.html [ Failure ] -crbug.com/986018 fast/scroll-snap/snaps-for-different-key-granularity.html [ Pass ] +crbug.com/986018 fast/scroll-snap/snaps-for-different-key-granularity.html [ Failure Pass ] crbug.com/889952 fast/selectors/selection-window-inactive.html [ Failure ] crbug.com/591099 fast/selectors/shadow-host-div-with-span.html [ Failure ] crbug.com/591099 fast/selectors/shadow-host-div-with-text.html [ Failure ] @@ -143,21 +142,17 @@ crbug.com/451577 crbug.com/924308 http/tests/devtools/console/console-format-es6-2.js [ Crash Failure Pass Timeout ] crbug.com/451577 crbug.com/916975 http/tests/devtools/console/console-repeat-count.js [ Crash Failure Pass Timeout ] crbug.com/451577 http/tests/devtools/console/console-search.js [ Pass ] -crbug.com/967526 http/tests/devtools/console/console-uncaught-promise.js [ Pass ] -crbug.com/982194 http/tests/devtools/coverage/decorations-after-script-formatter.js [ Timeout ] crbug.com/678482 http/tests/devtools/debugger/fetch-breakpoints.js [ Pass ] crbug.com/846997 http/tests/devtools/editor/text-editor-ctrl-d-1.js [ Pass ] crbug.com/850358 http/tests/devtools/editor/text-editor-enter-behaviour.js [ Pass ] crbug.com/846982 crbug.com/874695 http/tests/devtools/editor/text-editor-formatter.js [ Crash Pass Timeout ] crbug.com/420008 crbug.com/749738 http/tests/devtools/editor/text-editor-word-jumps.js [ Crash Pass Timeout ] -crbug.com/596486 http/tests/devtools/elements/insert-node.js [ Pass ] crbug.com/937811 http/tests/devtools/elements/shadow/elements-panel-shadow-selection-on-refresh-2.js [ Pass ] -crbug.com/937811 http/tests/devtools/elements/shadow/elements-panel-shadow-selection-on-refresh-3.js [ Pass Timeout ] +crbug.com/937811 http/tests/devtools/elements/shadow/elements-panel-shadow-selection-on-refresh-3.js [ Pass ] crbug.com/959002 crbug.com/959042 http/tests/devtools/elements/styles-1/color-aware-property-value-edit.js [ Crash Pass Timeout ] crbug.com/959002 crbug.com/959042 http/tests/devtools/elements/styles-1/edit-resource-referred-by-multiple-styletags.js [ Crash Pass Timeout ] -crbug.com/528419 http/tests/devtools/elements/styles-2/pseudo-elements.js [ Pass ] crbug.com/959002 crbug.com/959042 http/tests/devtools/elements/styles-3/style-autocomplete.js [ Crash Pass Timeout ] -crbug.com/938884 http/tests/devtools/elements/styles-3/styles-add-blank-property.js [ Pass Timeout ] +crbug.com/938884 http/tests/devtools/elements/styles-3/styles-add-blank-property.js [ Pass ] crbug.com/945665 http/tests/devtools/elements/styles-3/styles-add-new-rule-tab.js [ Failure ] crbug.com/945665 http/tests/devtools/elements/styles-3/styles-add-new-rule.js [ Failure ] crbug.com/945665 http/tests/devtools/elements/styles-3/styles-change-node-while-editing.js [ Failure ] @@ -165,40 +160,30 @@ crbug.com/959002 crbug.com/959042 http/tests/devtools/elements/styles-3/styles-variables.js [ Crash Pass Timeout ] crbug.com/667560 http/tests/devtools/elements/styles-4/inline-style-sourcemap.js [ Failure Pass ] crbug.com/959002 crbug.com/959042 http/tests/devtools/elements/styles-4/styles-keyframes.js [ Crash Pass Timeout ] -crbug.com/946714 http/tests/devtools/elements/styles-4/styles-live-locations-leak.js [ Pass Timeout ] crbug.com/982116 http/tests/devtools/elements/styles-4/styles-new-API.js [ Pass ] -crbug.com/849978 http/tests/devtools/elements/styles-4/stylesheet-source-url-comment.js [ Timeout ] +crbug.com/849978 http/tests/devtools/elements/styles-4/stylesheet-source-url-comment.js [ Pass ] crbug.com/959002 crbug.com/959042 http/tests/devtools/elements/styles-4/undo-add-new-rule.js [ Crash Pass Timeout ] crbug.com/978304 http/tests/devtools/elements/styles-4/undo-add-property.js [ Pass ] -crbug.com/451577 http/tests/devtools/elements/user-properties.js [ Pass ] -crbug.com/941860 http/tests/devtools/extensions/extensions-events.js [ Pass ] crbug.com/246190 crbug.com/989860 http/tests/devtools/indexeddb/live-update-indexeddb-list.js [ Crash Failure Pass Timeout ] crbug.com/336481 http/tests/devtools/jump-to-previous-editing-location.js [ Failure ] -crbug.com/327078 http/tests/devtools/network/long-script-content.js [ Pass ] -crbug.com/938200 http/tests/devtools/network/network-blocked-reason.js [ Pass Timeout ] +crbug.com/938200 http/tests/devtools/network/network-blocked-reason.js [ Pass ] crbug.com/982194 http/tests/devtools/network/network-cookies-pane.js [ Failure ] crbug.com/679833 crbug.com/762529 http/tests/devtools/network/network-datareceived.js [ Crash Failure Timeout ] crbug.com/759632 http/tests/devtools/network/network-datasaver-warning.js [ Failure ] crbug.com/945629 http/tests/devtools/network/network-filters.js [ Pass ] crbug.com/817167 crbug.com/874695 http/tests/devtools/oopif/oopif-cookies-refresh.js [ Crash Failure Pass Timeout ] crbug.com/818076 http/tests/devtools/oopif/oopif-elements-navigate-in.js [ Pass ] -crbug.com/874695 http/tests/devtools/persistence/persistence-mimetype-on-rename.js [ Pass ] crbug.com/450493 crbug.com/971262 http/tests/devtools/profiler/live-line-level-heap-profile.js [ Crash Pass Timeout ] -crbug.com/831673 http/tests/devtools/reveal-objects.js [ Pass Timeout ] -crbug.com/849670 http/tests/devtools/service-workers/service-worker-v8-cache.js [ Timeout ] +crbug.com/831673 http/tests/devtools/reveal-objects.js [ Pass ] +crbug.com/849670 http/tests/devtools/service-workers/service-worker-v8-cache.js [ Pass ] crbug.com/874695 http/tests/devtools/sources/debugger-breakpoints/breakpoints-ui-shifted-breakpoint.js [ Timeout ] -crbug.com/874695 http/tests/devtools/sources/debugger-breakpoints/dom-breakpoints.js [ Crash Pass ] crbug.com/450493 crbug.com/912793 http/tests/devtools/sources/debugger-breakpoints/restore-locations-for-breakpoint-with-broken-source-map.js [ Crash Failure Pass Timeout ] -crbug.com/874695 http/tests/devtools/sources/debugger-frameworks/frameworks-dom-xhr-event-breakpoints.js [ Pass ] crbug.com/450493 crbug.com/916975 http/tests/devtools/sources/debugger-ui/call-stack-show-more.js [ Crash Failure Pass Timeout ] crbug.com/450493 http/tests/devtools/sources/debugger-ui/continue-to-location-markers-in-top-level-function.js [ Pass ] crbug.com/450493 http/tests/devtools/sources/debugger-ui/continue-to-location-markers.js [ Pass ] crbug.com/450493 http/tests/devtools/sources/debugger/debug-inlined-scripts.js [ Failure ] -crbug.com/874695 http/tests/devtools/sources/debugger/debugger-proto-property.js [ Pass ] -crbug.com/874695 http/tests/devtools/sxg/sxg-cert-not-found.js [ Pass ] -crbug.com/874695 http/tests/devtools/sxg/sxg-disable-cache.js [ Pass ] crbug.com/851363 http/tests/devtools/sxg/sxg-prefetch-fail.js [ Failure Pass ] -crbug.com/851363 http/tests/devtools/sxg/sxg-prefetch.js [ Failure Pass ] +crbug.com/851363 http/tests/devtools/sxg/sxg-prefetch.js [ Pass ] crbug.com/420008 crbug.com/916975 http/tests/devtools/tracing/timeline-misc/timeline-event-causes.js [ Crash Failure Pass Timeout ] crbug.com/982194 http/tests/input/discard-events-to-unstable-iframe.html [ Failure ] crbug.com/982194 http/tests/inspector-protocol/target/target-expose-devtools-protocol.js [ Failure ] @@ -233,6 +218,7 @@ crbug.com/982194 external/wpt/css/CSS2/text/text-decoration-va-length-002.xht [ Failure ] crbug.com/982194 external/wpt/css/CSS2/text/white-space-nowrap-attribute-001.xht [ Failure ] crbug.com/982194 external/wpt/css/compositing/mix-blend-mode/mix-blend-mode-blended-with-transform-and-perspective.html [ Pass ] +crbug.com/982194 external/wpt/css/css-animations/animationevent-marker-pseudoelement.html [ Pass ] crbug.com/982194 external/wpt/css/css-backgrounds/background-attachment-local/attachment-local-clipping-color-5.html [ Failure ] crbug.com/982194 external/wpt/css/css-backgrounds/background-attachment-local/attachment-local-clipping-image-5.html [ Failure ] crbug.com/982194 external/wpt/css/css-break/avoid-border-break.html [ Failure ] @@ -290,7 +276,7 @@ crbug.com/982194 external/wpt/css/css-fonts/font-variant-descriptor-01.html [ Failure ] crbug.com/982194 external/wpt/css/css-fonts/font-variant-position-01.html [ Pass ] crbug.com/982194 external/wpt/css/css-fonts/font-variant-position.html [ Failure ] -crbug.com/982194 external/wpt/css/css-fonts/variations/font-descriptor-range-reversed.html [ Failure ] +crbug.com/982194 external/wpt/css/css-fonts/variations/font-descriptor-range-reversed.html [ Pass ] crbug.com/982194 external/wpt/css/css-grid/alignment/grid-baseline-align-cycles-001.html [ Failure ] crbug.com/982194 external/wpt/css/css-grid/alignment/grid-self-alignment-baseline-with-grid-001.html [ Failure ] crbug.com/982194 external/wpt/css/css-grid/alignment/grid-self-alignment-baseline-with-grid-002.html [ Failure ] @@ -468,7 +454,6 @@ crbug.com/982194 external/wpt/css/css-ui/text-overflow-015.html [ Failure ] crbug.com/982194 external/wpt/css/css-ui/text-overflow-021.html [ Failure ] crbug.com/982194 external/wpt/css/css-ui/text-overflow-026.html [ Failure ] -crbug.com/982194 external/wpt/css/css-ui/webkit-appearance-menulist-001.html [ Failure Pass ] crbug.com/982194 external/wpt/css/css-ui/webkit-appearance-textfield-001.html [ Pass ] crbug.com/982194 external/wpt/css/css-values/ch-unit-017.html [ Failure ] crbug.com/982194 external/wpt/css/css-will-change/will-change-abspos-cb-001.html [ Failure ] @@ -641,7 +626,8 @@ crbug.com/982194 external/wpt/forced-colors-mode/forced-colors-mode-19.html [ Failure ] crbug.com/982194 external/wpt/forced-colors-mode/forced-colors-mode-23.html [ Failure ] crbug.com/982194 external/wpt/forced-colors-mode/forced-colors-mode-26.tentative.html [ Pass ] -crbug.com/982194 external/wpt/geolocation-API/PositionOptions.https.html [ Failure ] +crbug.com/982194 external/wpt/geolocation-API/PositionOptions.https.html [ Failure Pass ] +crbug.com/982194 external/wpt/html/cross-origin-opener-policy/coep-blob-popup.https.html [ Pass ] crbug.com/982194 external/wpt/html/rendering/non-replaced-elements/tables/table-border-1.html [ Failure ] crbug.com/982194 external/wpt/html/rendering/non-replaced-elements/tables/table-border-3q.html [ Failure ] crbug.com/982194 external/wpt/html/rendering/non-replaced-elements/tables/table-border-3s.html [ Failure ] @@ -722,6 +708,7 @@ crbug.com/982194 external/wpt/trusted-types/eval-csp-no-tt.tentative.html [ Failure ] crbug.com/982194 external/wpt/trusted-types/eval-no-csp-no-tt-default-policy.tentative.html [ Failure ] crbug.com/982194 external/wpt/trusted-types/eval-no-csp-no-tt.tentative.html [ Failure ] +crbug.com/982194 external/wpt/webaudio/the-audio-api/the-audioworklet-interface/suspended-context-messageport.https.html [ Failure ] crbug.com/982194 external/wpt/websockets/opening-handshake/005.html [ Pass ] crbug.com/982194 external/wpt/webvtt/rendering/cues-with-video/processing-model/2_cues_overlapping_completely_move_up.html [ Failure ] crbug.com/982194 external/wpt/webvtt/rendering/cues-with-video/processing-model/2_cues_overlapping_partially_move_down.html [ Failure ] @@ -927,53 +914,42 @@ crbug.com/982194 fast/multicol/vertical-lr/column-rules.html [ Failure ] crbug.com/982194 fast/multicol/vertical-lr/float-avoidance.html [ Failure ] crbug.com/982194 fast/multicol/vertical-lr/float-big-line.html [ Failure ] -crbug.com/982194 fast/multicol/vertical-lr/float-break.html [ Failure Timeout ] +crbug.com/982194 fast/multicol/vertical-lr/float-break.html [ Failure ] crbug.com/982194 fast/multicol/vertical-lr/float-content-break.html [ Failure ] crbug.com/982194 fast/multicol/vertical-lr/float-edge.html [ Failure ] crbug.com/982194 fast/multicol/vertical-lr/float-paginate.html [ Failure ] crbug.com/982194 fast/multicol/vertical-lr/unsplittable-inline-block.html [ Failure ] crbug.com/982194 fast/multicol/vertical-rl/nested-columns.html [ Failure Pass ] -crbug.com/982194 fast/scroll-snap/snaps-after-scrollbar-scrolling.html [ Pass ] +crbug.com/982194 fast/scroll-snap/snaps-after-scrollbar-scrolling.html [ Failure Pass ] crbug.com/982194 fragmentation/repeating-thead-under-repeating-thead.html [ Failure ] crbug.com/982194 http/tests/devtools/application-panel/resources-panel-iframe-idb.js [ Pass ] -crbug.com/982194 http/tests/devtools/application-panel/storage-view-reports-quota.js [ Timeout ] -crbug.com/982194 http/tests/devtools/cache-storage/cache-data.js [ Pass ] +crbug.com/982194 http/tests/devtools/application-panel/storage-view-reports-quota.js [ Pass ] crbug.com/982194 http/tests/devtools/editor/text-editor-reveal-line.js [ Pass ] -crbug.com/982194 http/tests/devtools/elements/styles-1/disable-property-workingcopy-update.js [ Pass Timeout ] -crbug.com/982194 http/tests/devtools/elements/styles-4/styles-update-from-js.js [ Failure Timeout ] +crbug.com/982194 http/tests/devtools/elements/styles-1/disable-property-workingcopy-update.js [ Pass ] +crbug.com/982194 http/tests/devtools/elements/styles-4/styles-update-from-js.js [ Failure ] crbug.com/982194 http/tests/devtools/indexeddb/database-refresh-view.js [ Pass ] crbug.com/982194 http/tests/devtools/network/network-eventsource.js [ Pass ] crbug.com/982194 http/tests/devtools/network/network-search.js [ Pass ] -crbug.com/982194 http/tests/devtools/oopif/oopif-storage.js [ Pass ] -crbug.com/982194 http/tests/devtools/persistence/persistence-external-change-breakpoints.js [ Pass ] -crbug.com/982194 http/tests/devtools/profiler/heap-snapshot-location.js [ Pass ] -crbug.com/982194 http/tests/devtools/resource-tree/resource-tree-crafted-frame-add.js [ Pass ] -crbug.com/982194 http/tests/devtools/resource-tree/resource-tree-frame-in-crafted-frame.js [ Pass ] +crbug.com/982194 http/tests/devtools/oopif/oopif-storage.js [ Failure Pass ] crbug.com/982194 http/tests/devtools/resource-tree/resource-tree-frame-navigate.js [ Pass ] crbug.com/982194 http/tests/devtools/resource-tree/resource-tree-htmlimports.js [ Pass ] -crbug.com/982194 http/tests/devtools/service-workers/service-worker-agents.js [ Pass ] -crbug.com/982194 http/tests/devtools/service-workers/service-workers-force-update-on-page-load.js [ Pass ] -crbug.com/982194 http/tests/devtools/service-workers/service-workers-redundant.js [ Pass ] crbug.com/982194 http/tests/devtools/service-workers/user-agent-override.js [ Pass ] crbug.com/982194 http/tests/devtools/sources/debugger-breakpoints/disable-breakpoints.js [ Failure Pass ] crbug.com/982194 http/tests/devtools/sources/debugger-breakpoints/set-breakpoint.js [ Failure Pass ] crbug.com/982194 http/tests/devtools/sources/debugger-breakpoints/set-conditional-breakpoint.js [ Failure Pass ] crbug.com/982194 http/tests/devtools/sources/debugger-ui/popover-for-spread-operator.js [ Pass ] crbug.com/982194 http/tests/devtools/sources/debugger/debugger-disable-enable.js [ Pass ] -crbug.com/982194 http/tests/devtools/sources/debugger/js-with-inline-stylesheets.js [ Failure Pass ] crbug.com/982194 http/tests/devtools/sources/debugger/navigator-view.js [ Pass ] -crbug.com/982194 http/tests/devtools/tracing/timeline-paint/paint-profiler-update.js [ Pass ] -crbug.com/982194 http/tests/loading/onbeforeunload-detach.html [ Failure Pass ] crbug.com/982194 jquery/attributes.html [ Pass ] crbug.com/982194 jquery/core.html [ Pass ] crbug.com/982194 jquery/css.html [ Pass ] crbug.com/982194 jquery/data.html [ Pass ] crbug.com/982194 jquery/dimensions.html [ Pass ] crbug.com/982194 jquery/event.html [ Pass ] -crbug.com/982194 jquery/manipulation.html [ Pass ] +crbug.com/982194 jquery/manipulation.html [ Pass Timeout ] crbug.com/982194 jquery/offset.html [ Pass ] crbug.com/982194 jquery/traversing.html [ Pass ] -crbug.com/982194 media/video-canvas-draw.html [ Failure Pass ] +crbug.com/982194 media/video-canvas-draw.html [ Crash Failure Pass ] crbug.com/982194 virtual/android/url-bar/bottom-and-top-fixed-sticks-to-top.html [ Failure ] crbug.com/908347 virtual/audio-service/media/autoplay/webaudio-audio-context-resume.html [ Failure Pass ] crbug.com/942951 virtual/audio-service/media/controls/controls-layout-in-different-size.html [ Pass ] @@ -990,7 +966,7 @@ crbug.com/985520 virtual/focusless-spat-nav/fast/spatial-navigation/focusless/snav-focusless-enter-from-interest-a11y.html [ Pass ] crbug.com/985520 virtual/focusless-spat-nav/fast/spatial-navigation/focusless/snav-focusless-enter-from-interest.html [ Pass ] crbug.com/956736 virtual/gpu-rasterization/images/imagemap-focus-ring-outline-color-not-inherited-from-map.html [ Failure ] -crbug.com/982194 virtual/gpu/fast/canvas/OffscreenCanvas-zero-size-readback.html [ Crash ] +crbug.com/982194 virtual/gpu/fast/canvas/OffscreenCanvas-zero-size-readback.html [ Crash Pass ] crbug.com/982194 virtual/gpu/fast/canvas/canvas-arc-circumference.html [ Failure ] crbug.com/982194 virtual/gpu/fast/canvas/canvas-ellipse-circumference-fill.html [ Failure ] crbug.com/982194 virtual/gpu/fast/canvas/canvas-ellipse-circumference.html [ Failure ] @@ -1081,6 +1057,7 @@ crbug.com/982194 virtual/speech-with-unified-autoplay/external/wpt/speech-api/SpeechSynthesis-speak-without-activation-fails.tentative.html [ Pass ] crbug.com/982194 virtual/stable/media/stable/video-object-fit-stable.html [ Pass ] crbug.com/982194 virtual/text-antialias/font-format-support-color-cff2-vertical.html [ Failure ] +crbug.com/982194 virtual/threaded-no-composited-antialiasing/animations/events/animation-iteration-event.html [ Failure Pass ] crbug.com/982194 virtual/threaded-no-composited-antialiasing/animations/timing/animation-duration-infinite.html [ Pass ] crbug.com/982194 virtual/threaded/external/wpt/feature-policy/experimental-features/lazyload/lazyload-disabled-tentative.sub.html [ Failure Pass ] crbug.com/982194 virtual/threaded/external/wpt/feature-policy/experimental-features/lazyload/lazyload-enabled-tentative.sub.html [ Pass ]
diff --git a/third_party/blink/web_tests/SlowTests b/third_party/blink/web_tests/SlowTests index 7f8e9ec..40884876 100644 --- a/third_party/blink/web_tests/SlowTests +++ b/third_party/blink/web_tests/SlowTests
@@ -608,3 +608,5 @@ # Reaching the stack size limit makes for a consistently slow test with # occasional timeouts on Win7 crbug.com/937546 [ Win7 ] http/tests/security/xss-DENIED-cross-origin-stack-overflow.html [ Slow ] + +crbug.com/1066517 http/tests/websocket/workers/worker-reload.html [ Slow ]
diff --git a/third_party/blink/web_tests/TestExpectations b/third_party/blink/web_tests/TestExpectations index b9223739..897e4ea 100644 --- a/third_party/blink/web_tests/TestExpectations +++ b/third_party/blink/web_tests/TestExpectations
@@ -322,45 +322,24 @@ crbug.com/1018273 [ Mac ] compositing/gestures/gesture-tapHighlight-2-iframe-scrolled-inner.html [ Failure ] +# Fails due to lack of support for image orientation in tiling shaders. +crbug.com/1066634 external/wpt/css/css-images/image-orientation/image-orientation-background-properties.html [ Failure ] + # Fail due to lack of fuzzy matching on Linux, Win and Mac platforms for WPT. The pixels in the pre-rotated reference # images do not exactly match the exif rotated images, probably due to jpeg decoding/encoding issues. Maybe # adjusting the image size to a multiple of 8 would fix this (so all jpeg blocks are solid color). -crbug.com/997202 [ Linux ] external/wpt/css/css-images/image-orientation/image-orientation-default.html [ Failure ] -crbug.com/997202 [ Linux ] external/wpt/css/css-images/image-orientation/image-orientation-from-image-composited-dynamic1.html [ Failure ] -crbug.com/997202 [ Linux ] external/wpt/css/css-images/image-orientation/image-orientation-from-image-composited.html [ Failure ] -crbug.com/997202 [ Linux ] external/wpt/css/css-images/image-orientation/image-orientation-from-image-content-images.html [ Failure ] -crbug.com/997202 [ Linux ] external/wpt/css/css-images/image-orientation/image-orientation-from-image-dynamic1.html [ Failure ] -crbug.com/997202 [ Linux ] external/wpt/css/css-images/image-orientation/image-orientation-from-image-image-document.html [ Failure ] -crbug.com/997202 [ Linux ] external/wpt/css/css-images/image-orientation/image-orientation-from-image.html [ Failure ] -crbug.com/997202 [ Linux ] external/wpt/css/css-images/image-orientation/image-orientation-none-image-document.html [ Failure ] -crbug.com/997202 [ Linux ] external/wpt/css/css-images/image-orientation/image-orientation-from-image-composited-dynamic2.html [ Failure ] -crbug.com/997202 [ Linux ] external/wpt/css/css-images/image-orientation/image-orientation-from-image-dynamic2.html [ Failure ] -crbug.com/997202 [ Linux ] external/wpt/css/css-images/image-orientation/image-orientation-none-content-images.html [ Failure ] -crbug.com/997202 [ Linux ] external/wpt/css/css-images/image-orientation/image-orientation-none.html [ Failure ] -crbug.com/997202 [ Mac ] external/wpt/css/css-images/image-orientation/image-orientation-default.html [ Failure ] -crbug.com/997202 [ Mac ] external/wpt/css/css-images/image-orientation/image-orientation-from-image-composited-dynamic1.html [ Failure ] -crbug.com/997202 [ Mac ] external/wpt/css/css-images/image-orientation/image-orientation-from-image-composited.html [ Failure ] -crbug.com/997202 [ Mac ] external/wpt/css/css-images/image-orientation/image-orientation-from-image-content-images.html [ Failure ] -crbug.com/997202 [ Mac ] external/wpt/css/css-images/image-orientation/image-orientation-from-image-dynamic1.html [ Failure ] -crbug.com/997202 [ Mac ] external/wpt/css/css-images/image-orientation/image-orientation-from-image-image-document.html [ Failure ] -crbug.com/997202 [ Mac ] external/wpt/css/css-images/image-orientation/image-orientation-from-image.html [ Failure ] -crbug.com/997202 [ Mac ] external/wpt/css/css-images/image-orientation/image-orientation-none-image-document.html [ Failure ] -crbug.com/997202 [ Mac ] external/wpt/css/css-images/image-orientation/image-orientation-from-image-composited-dynamic2.html [ Failure ] -crbug.com/997202 [ Mac ] external/wpt/css/css-images/image-orientation/image-orientation-from-image-dynamic2.html [ Failure ] -crbug.com/997202 [ Mac ] external/wpt/css/css-images/image-orientation/image-orientation-none-content-images.html [ Failure ] -crbug.com/997202 [ Mac ] external/wpt/css/css-images/image-orientation/image-orientation-none.html [ Failure ] -crbug.com/997202 [ Win ] external/wpt/css/css-images/image-orientation/image-orientation-default.html [ Failure ] -crbug.com/997202 [ Win ] external/wpt/css/css-images/image-orientation/image-orientation-from-image-composited-dynamic1.html [ Failure ] -crbug.com/997202 [ Win ] external/wpt/css/css-images/image-orientation/image-orientation-from-image-composited.html [ Failure ] -crbug.com/997202 [ Win ] external/wpt/css/css-images/image-orientation/image-orientation-from-image-content-images.html [ Failure ] -crbug.com/997202 [ Win ] external/wpt/css/css-images/image-orientation/image-orientation-from-image-dynamic1.html [ Failure ] -crbug.com/997202 [ Win ] external/wpt/css/css-images/image-orientation/image-orientation-from-image-image-document.html [ Failure ] -crbug.com/997202 [ Win ] external/wpt/css/css-images/image-orientation/image-orientation-from-image.html [ Failure ] -crbug.com/997202 [ Win ] external/wpt/css/css-images/image-orientation/image-orientation-none-image-document.html [ Failure ] -crbug.com/997202 [ Win ] external/wpt/css/css-images/image-orientation/image-orientation-from-image-composited-dynamic2.html [ Failure ] -crbug.com/997202 [ Win ] external/wpt/css/css-images/image-orientation/image-orientation-from-image-dynamic2.html [ Failure ] -crbug.com/997202 [ Win ] external/wpt/css/css-images/image-orientation/image-orientation-none-content-images.html [ Failure ] -crbug.com/997202 [ Win ] external/wpt/css/css-images/image-orientation/image-orientation-none.html [ Failure ] +crbug.com/997202 external/wpt/css/css-images/image-orientation/image-orientation-default.html [ Failure ] +crbug.com/997202 external/wpt/css/css-images/image-orientation/image-orientation-from-image-composited-dynamic1.html [ Failure ] +crbug.com/997202 external/wpt/css/css-images/image-orientation/image-orientation-from-image-composited.html [ Failure ] +crbug.com/997202 external/wpt/css/css-images/image-orientation/image-orientation-from-image-content-images.html [ Failure ] +crbug.com/997202 external/wpt/css/css-images/image-orientation/image-orientation-from-image-dynamic1.html [ Failure ] +crbug.com/997202 external/wpt/css/css-images/image-orientation/image-orientation-from-image-embedded-content.html [ Failure ] +crbug.com/997202 external/wpt/css/css-images/image-orientation/image-orientation-from-image.html [ Failure ] +crbug.com/997202 external/wpt/css/css-images/image-orientation/image-orientation-none-image-document.html [ Failure ] +crbug.com/997202 external/wpt/css/css-images/image-orientation/image-orientation-from-image-composited-dynamic2.html [ Failure ] +crbug.com/997202 external/wpt/css/css-images/image-orientation/image-orientation-from-image-dynamic2.html [ Failure ] +crbug.com/997202 external/wpt/css/css-images/image-orientation/image-orientation-none-content-images.html [ Failure ] +crbug.com/997202 external/wpt/css/css-images/image-orientation/image-orientation-none.html [ Failure ] crbug.com/1042453 [ Win ] external/wpt/css/filter-effects/idlharness.any.html [ Timeout Pass ] crbug.com/1042453 [ Mac ] external/wpt/css/filter-effects/idlharness.any.html [ Timeout Pass ] @@ -881,6 +860,8 @@ crbug.com/591099 fast/multicol/vertical-lr/nested-columns.html [ Failure ] crbug.com/591099 fast/multicol/vertical-lr/unsplittable-inline-block.html [ Failure ] crbug.com/591099 [ Win ] virtual/text-antialias/ellipsis-with-self-painting-layer.html [ Failure ] +crbug.com/591099 [ Mac ] fast/multicol/file-upload-as-multicol.html [ Failure ] +crbug.com/591099 [ Mac ] virtual/layout_ng_block_frag/fast/multicol/file-upload-as-multicol.html [ Failure ] # LayoutNG failures that needs to be triaged crbug.com/591099 virtual/text-antialias/selection/selection-rect-line-height-too-small.html [ Failure ] @@ -2304,6 +2285,10 @@ crbug.com/1052717 external/wpt/css/css-text/line-break/line-break-normal-hyphens-002.html [ Failure ] crbug.com/1052717 external/wpt/css/css-text/line-break/line-break-strict-hyphens-002.html [ Failure ] +# Link event firing +crbug.com/922618 external/wpt/html/semantics/document-metadata/the-link-element/link-multiple-error-events.html [ Timeout ] +crbug.com/922618 external/wpt/html/semantics/document-metadata/the-link-element/link-multiple-load-events.html [ Timeout ] + # Sheriff 2020-02-06 # Flaking on Linux Leak crbug.com/1049599 [ Linux ] virtual/threaded-prefer-compositing/fast/scrolling/events/overscroll-event-fired-to-element-with-overscroll-behavior.html [ Pass Failure Timeout ] @@ -2898,6 +2883,239 @@ # Hit a DCHECK crbug.com/918664 external/wpt/css/vendor-imports/mozilla/mozilla-central-reftests/sizing/block-size-with-min-or-max-content-table-1a.html [ Failure Pass ] +# WebVTT is off because additional padding +crbug.com/1012242 external/wpt/webvtt/rendering/cues-with-video/processing-model/2_cues_overlapping_completely_move_up.html [ Failure ] +crbug.com/1012242 external/wpt/webvtt/rendering/cues-with-video/processing-model/2_cues_overlapping_partially_move_down.html [ Failure ] +crbug.com/1012242 external/wpt/webvtt/rendering/cues-with-video/processing-model/2_cues_overlapping_partially_move_up.html [ Failure ] +crbug.com/1012242 external/wpt/webvtt/rendering/cues-with-video/processing-model/align_end.html [ Failure ] +crbug.com/1012242 external/wpt/webvtt/rendering/cues-with-video/processing-model/align_end_wrapped.html [ Failure ] +crbug.com/1012242 external/wpt/webvtt/rendering/cues-with-video/processing-model/align_start.html [ Failure ] +crbug.com/1012242 external/wpt/webvtt/rendering/cues-with-video/processing-model/align_start_wrapped.html [ Failure ] +crbug.com/1012242 external/wpt/webvtt/rendering/cues-with-video/processing-model/basic.html [ Failure ] +crbug.com/1012242 external/wpt/webvtt/rendering/cues-with-video/processing-model/bidi/bidi_ruby.html [ Failure ] +crbug.com/1012242 external/wpt/webvtt/rendering/cues-with-video/processing-model/bidi/u002E_LF_u05D0.html [ Failure ] +crbug.com/1012242 external/wpt/webvtt/rendering/cues-with-video/processing-model/bidi/u002E_u2028_u05D0.html [ Failure ] +crbug.com/1012242 external/wpt/webvtt/rendering/cues-with-video/processing-model/bidi/u002E_u2029_u05D0.html [ Failure ] +crbug.com/1012242 external/wpt/webvtt/rendering/cues-with-video/processing-model/bidi/u0041_first.html [ Failure ] +crbug.com/1012242 external/wpt/webvtt/rendering/cues-with-video/processing-model/bidi/u05D0_first.html [ Failure ] +crbug.com/1012242 external/wpt/webvtt/rendering/cues-with-video/processing-model/bidi/u0628_first.html [ Failure ] +crbug.com/1012242 external/wpt/webvtt/rendering/cues-with-video/processing-model/bidi/u06E9_no_strong_dir.html [ Failure ] +crbug.com/1012242 external/wpt/webvtt/rendering/cues-with-video/processing-model/cue_too_long.html [ Failure ] +crbug.com/1012242 external/wpt/webvtt/rendering/cues-with-video/processing-model/decode_escaped_entities.html [ Failure ] +crbug.com/1012242 external/wpt/webvtt/rendering/cues-with-video/processing-model/disable_controls_reposition.html [ Failure ] +crbug.com/1012242 external/wpt/webvtt/rendering/cues-with-video/processing-model/dom_override_cue_align_position_line_size.html [ Failure ] +crbug.com/1012242 external/wpt/webvtt/rendering/cues-with-video/processing-model/dom_override_cue_align_position_line_size_while_paused.html [ Failure ] +crbug.com/1012242 external/wpt/webvtt/rendering/cues-with-video/processing-model/dom_override_cue_line.html [ Failure ] +crbug.com/1012242 external/wpt/webvtt/rendering/cues-with-video/processing-model/dom_override_cue_text.html [ Failure ] +crbug.com/1012242 external/wpt/webvtt/rendering/cues-with-video/processing-model/dom_override_cue_text_while_paused.html [ Failure ] +crbug.com/1012242 external/wpt/webvtt/rendering/cues-with-video/processing-model/enable_controls_reposition.html [ Failure ] +crbug.com/1012242 external/wpt/webvtt/rendering/cues-with-video/processing-model/evil/9_cues_overlapping_completely_all_cues_have_same_timestamp.html [ Failure ] +crbug.com/1012242 external/wpt/webvtt/rendering/cues-with-video/processing-model/evil/9_cues_overlapping_completely.html [ Failure ] +crbug.com/1012242 external/wpt/webvtt/rendering/cues-with-video/processing-model/evil/media_height_19.html [ Failure ] +crbug.com/1012242 external/wpt/webvtt/rendering/cues-with-video/processing-model/evil/single_quote.html [ Failure ] +crbug.com/1012242 external/wpt/webvtt/rendering/cues-with-video/processing-model/evil/size_90.html [ Failure ] +crbug.com/1012242 external/wpt/webvtt/rendering/cues-with-video/processing-model/evil/size_99.html [ Failure ] +crbug.com/1012242 external/wpt/webvtt/rendering/cues-with-video/processing-model/line_0_is_top.html [ Failure ] +crbug.com/1012242 external/wpt/webvtt/rendering/cues-with-video/processing-model/line_1_wrapped_cue_grow_downwards.html [ Failure ] +crbug.com/1012242 external/wpt/webvtt/rendering/cues-with-video/processing-model/line_-2_wrapped_cue_grow_upwards.html [ Failure ] +crbug.com/1012242 external/wpt/webvtt/rendering/cues-with-video/processing-model/line_50_percent.html [ Failure ] +crbug.com/1012242 external/wpt/webvtt/rendering/cues-with-video/processing-model/line_integer_and_percent_mixed_overlap.html [ Failure ] +crbug.com/1012242 external/wpt/webvtt/rendering/cues-with-video/processing-model/line_integer_and_percent_mixed_overlap_move_up.html [ Failure ] +crbug.com/1012242 external/wpt/webvtt/rendering/cues-with-video/processing-model/line_percent_and_integer_mixed_overlap.html [ Failure ] +crbug.com/1012242 external/wpt/webvtt/rendering/cues-with-video/processing-model/line_percent_and_integer_mixed_overlap_move_up.html [ Failure ] +crbug.com/1012242 external/wpt/webvtt/rendering/cues-with-video/processing-model/media_height400_with_controls.html [ Failure ] +crbug.com/1012242 external/wpt/webvtt/rendering/cues-with-video/processing-model/media_with_controls.html [ Failure ] +crbug.com/1012242 external/wpt/webvtt/rendering/cues-with-video/processing-model/navigate_cue_position.html [ Failure ] +crbug.com/1012242 external/wpt/webvtt/rendering/cues-with-video/processing-model/one_line_cue_plus_wrapped_cue.html [ Failure ] +crbug.com/1012242 external/wpt/webvtt/rendering/cues-with-video/processing-model/repaint.html [ Failure ] +crbug.com/1012242 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue/background_properties.html [ Failure ] +crbug.com/1012242 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue/background_shorthand_css_relative_url.html [ Failure ] +crbug.com/1012242 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue/background_shorthand.html [ Failure ] +crbug.com/1012242 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue/color_hex.html [ Failure ] +crbug.com/1012242 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue/color_hsla.html [ Failure ] +crbug.com/1012242 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue/color_rgba.html [ Failure ] +crbug.com/1012242 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue/cue_selector_single_colon.html [ Failure ] +crbug.com/1012242 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue/font_properties.html [ Failure ] +crbug.com/1012242 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue/font_shorthand.html [ Failure ] +crbug.com/1012242 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/background_box.html [ Failure ] +crbug.com/1012242 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/background_properties.html [ Failure ] +crbug.com/1012242 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/background_shorthand_css_relative_url.html [ Failure ] +crbug.com/1012242 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/background_shorthand.html [ Failure ] +crbug.com/1012242 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/bold_object/bold_animation_with_timestamp.html [ Failure ] +crbug.com/1012242 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/bold_object/bold_background_properties.html [ Failure ] +crbug.com/1012242 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/bold_object/bold_background_shorthand.html [ Failure ] +crbug.com/1012242 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/bold_object/bold_color.html [ Failure ] +crbug.com/1012242 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/bold_object/bold_font_properties.html [ Failure ] +crbug.com/1012242 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/bold_object/bold_font_shorthand.html [ Failure ] +crbug.com/1012242 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/bold_object/bold_namespace.html [ Failure ] +crbug.com/1012242 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/bold_object/bold_outline_properties.html [ Failure ] +crbug.com/1012242 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/bold_object/bold_outline_shorthand.html [ Failure ] +crbug.com/1012242 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/bold_object/bold_text-decoration_line-through.html [ Failure ] +crbug.com/1012242 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/bold_object/bold_text-shadow.html [ Failure ] +crbug.com/1012242 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/bold_object/bold_timestamp_future.html [ Failure ] +crbug.com/1012242 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/bold_object/bold_timestamp_past.html [ Failure ] +crbug.com/1012242 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/bold_object/bold_transition_with_timestamp.html [ Failure ] +crbug.com/1012242 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/bold_object/bold_white-space_normal_wrapped.html [ Failure ] +crbug.com/1012242 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/bold_object/bold_white-space_nowrap.html [ Failure ] +crbug.com/1012242 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/bold_object/bold_white-space_pre-line_wrapped.html [ Failure ] +crbug.com/1012242 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/bold_object/bold_white-space_pre_wrapped.html [ Failure ] +crbug.com/1012242 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/bold_object/bold_white-space_pre-wrap_wrapped.html [ Failure ] +crbug.com/1012242 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/bold_object/bold_with_class.html [ Failure ] +crbug.com/1012242 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/bold_object/bold_with_class_object_specific_selector.html [ Failure ] +crbug.com/1012242 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/class_object/class_animation_with_timestamp.html [ Failure ] +crbug.com/1012242 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/class_object/class_background_properties.html [ Failure ] +crbug.com/1012242 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/class_object/class_background_shorthand.html [ Failure ] +crbug.com/1012242 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/class_object/class_color.html [ Failure ] +crbug.com/1012242 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/class_object/class_font_properties.html [ Failure ] +crbug.com/1012242 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/class_object/class_font_shorthand.html [ Failure ] +crbug.com/1012242 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/class_object/class_namespace.html [ Failure ] +crbug.com/1012242 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/class_object/class_outline_properties.html [ Failure ] +crbug.com/1012242 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/class_object/class_outline_shorthand.html [ Failure ] +crbug.com/1012242 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/class_object/class_text-decoration_line-through.html [ Failure ] +crbug.com/1012242 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/class_object/class_text-shadow.html [ Failure ] +crbug.com/1012242 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/class_object/class_timestamp_future.html [ Failure ] +crbug.com/1012242 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/class_object/class_timestamp_past.html [ Failure ] +crbug.com/1012242 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/class_object/class_transition_with_timestamp.html [ Failure ] +crbug.com/1012242 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/class_object/class_white-space_nowrap.html [ Failure ] +crbug.com/1012242 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/class_object/class_white-space_pre_wrapped.html [ Failure ] +crbug.com/1012242 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/class_object/class_white-space_pre-wrap_wrapped.html [ Failure ] +crbug.com/1012242 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/class_object/class_with_class.html [ Failure ] +crbug.com/1012242 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/class_object/class_with_class_object_specific_selector.html [ Failure ] +crbug.com/1012242 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/color_hex.html [ Failure ] +crbug.com/1012242 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/color_hsla.html [ Failure ] +crbug.com/1012242 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/color_rgba.html [ Failure ] +crbug.com/1012242 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/cue_func_selector_single_colon.html [ Failure ] +crbug.com/1012242 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/font_properties.html [ Failure ] +crbug.com/1012242 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/font_shorthand.html [ Failure ] +crbug.com/1012242 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/id_color.html [ Failure ] +crbug.com/1012242 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/inherit_values_from_media_element.html [ Failure ] +crbug.com/1012242 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/italic_object/italic_animation_with_timestamp.html [ Failure ] +crbug.com/1012242 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/italic_object/italic_background_properties.html [ Failure ] +crbug.com/1012242 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/italic_object/italic_background_shorthand.html [ Failure ] +crbug.com/1012242 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/italic_object/italic_color.html [ Failure ] +crbug.com/1012242 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/italic_object/italic_font_properties.html [ Failure ] +crbug.com/1012242 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/italic_object/italic_font_shorthand.html [ Failure ] +crbug.com/1012242 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/italic_object/italic_namespace.html [ Failure ] +crbug.com/1012242 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/italic_object/italic_outline_properties.html [ Failure ] +crbug.com/1012242 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/italic_object/italic_outline_shorthand.html [ Failure ] +crbug.com/1012242 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/italic_object/italic_text-decoration_line-through.html [ Failure ] +crbug.com/1012242 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/italic_object/italic_text-shadow.html [ Failure ] +crbug.com/1012242 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/italic_object/italic_timestamp_future.html [ Failure ] +crbug.com/1012242 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/italic_object/italic_timestamp_past.html [ Failure ] +crbug.com/1012242 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/italic_object/italic_transition_with_timestamp.html [ Failure ] +crbug.com/1012242 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/italic_object/italic_white-space_normal_wrapped.html [ Failure ] +crbug.com/1012242 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/italic_object/italic_white-space_nowrap.html [ Failure ] +crbug.com/1012242 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/italic_object/italic_white-space_pre-line_wrapped.html [ Failure ] +crbug.com/1012242 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/italic_object/italic_white-space_pre_wrapped.html [ Failure ] +crbug.com/1012242 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/italic_object/italic_white-space_pre-wrap_wrapped.html [ Failure ] +crbug.com/1012242 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/italic_object/italic_with_class.html [ Failure ] +crbug.com/1012242 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/italic_object/italic_with_class_object_specific_selector.html [ Failure ] +crbug.com/1012242 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/not_allowed_properties.html [ Failure ] +crbug.com/1012242 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/not_root_selector.html [ Failure ] +crbug.com/1012242 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/outline_properties.html [ Failure ] +crbug.com/1012242 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/outline_shorthand.html [ Failure ] +crbug.com/1012242 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/root_namespace.html [ Failure ] +crbug.com/1012242 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/root_selector.html [ Failure ] +crbug.com/1012242 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/text-decoration_line-through.html [ Failure ] +crbug.com/1012242 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/text-decoration_overline.html [ Failure ] +crbug.com/1012242 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/text-decoration_overline_underline_line-through.html [ Failure ] +crbug.com/1012242 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/text-decoration_underline.html [ Failure ] +crbug.com/1012242 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/text-shadow.html [ Failure ] +crbug.com/1012242 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/type_selector_root.html [ Failure ] +crbug.com/1012242 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/underline_object/underline_animation_with_timestamp.html [ Failure ] +crbug.com/1012242 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/underline_object/underline_background_properties.html [ Failure ] +crbug.com/1012242 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/underline_object/underline_background_shorthand.html [ Failure ] +crbug.com/1012242 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/underline_object/underline_color.html [ Failure ] +crbug.com/1012242 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/underline_object/underline_font_properties.html [ Failure ] +crbug.com/1012242 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/underline_object/underline_font_shorthand.html [ Failure ] +crbug.com/1012242 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/underline_object/underline_namespace.html [ Failure ] +crbug.com/1012242 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/underline_object/underline_outline_properties.html [ Failure ] +crbug.com/1012242 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/underline_object/underline_outline_shorthand.html [ Failure ] +crbug.com/1012242 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/underline_object/underline_text-decoration_line-through.html [ Failure ] +crbug.com/1012242 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/underline_object/underline_text-shadow.html [ Failure ] +crbug.com/1012242 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/underline_object/underline_timestamp_future.html [ Failure ] +crbug.com/1012242 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/underline_object/underline_timestamp_past.html [ Failure ] +crbug.com/1012242 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/underline_object/underline_transition_with_timestamp.html [ Failure ] +crbug.com/1012242 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/underline_object/underline_white-space_normal_wrapped.html [ Failure ] +crbug.com/1012242 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/underline_object/underline_white-space_nowrap.html [ Failure ] +crbug.com/1012242 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/underline_object/underline_white-space_pre-line_wrapped.html [ Failure ] +crbug.com/1012242 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/underline_object/underline_white-space_pre_wrapped.html [ Failure ] +crbug.com/1012242 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/underline_object/underline_white-space_pre-wrap_wrapped.html [ Failure ] +crbug.com/1012242 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/underline_object/underline_with_class.html [ Failure ] +crbug.com/1012242 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/underline_object/underline_with_class_object_specific_selector.html [ Failure ] +crbug.com/1012242 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/voice_object/voice_animation_with_timestamp.html [ Failure ] +crbug.com/1012242 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/voice_object/voice_background_properties.html [ Failure ] +crbug.com/1012242 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/voice_object/voice_background_shorthand.html [ Failure ] +crbug.com/1012242 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/voice_object/voice_color.html [ Failure ] +crbug.com/1012242 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/voice_object/voice_font_properties.html [ Failure ] +crbug.com/1012242 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/voice_object/voice_font_shorthand.html [ Failure ] +crbug.com/1012242 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/voice_object/voice_namespace.html [ Failure ] +crbug.com/1012242 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/voice_object/voice_outline_properties.html [ Failure ] +crbug.com/1012242 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/voice_object/voice_outline_shorthand.html [ Failure ] +crbug.com/1012242 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/voice_object/voice_text-decoration_line-through.html [ Failure ] +crbug.com/1012242 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/voice_object/voice_text-shadow.html [ Failure ] +crbug.com/1012242 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/voice_object/voice_timestamp_future.html [ Failure ] +crbug.com/1012242 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/voice_object/voice_timestamp_past.html [ Failure ] +crbug.com/1012242 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/voice_object/voice_transition_with_timestamp.html [ Failure ] +crbug.com/1012242 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/voice_object/voice_voice_attribute.html [ Failure ] +crbug.com/1012242 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/voice_object/voice_white-space_normal_wrapped.html [ Failure ] +crbug.com/1012242 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/voice_object/voice_white-space_nowrap.html [ Failure ] +crbug.com/1012242 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/voice_object/voice_white-space_pre-line_wrapped.html [ Failure ] +crbug.com/1012242 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/voice_object/voice_white-space_pre_wrapped.html [ Failure ] +crbug.com/1012242 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/voice_object/voice_white-space_pre-wrap_wrapped.html [ Failure ] +crbug.com/1012242 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/voice_object/voice_with_class.html [ Failure ] +crbug.com/1012242 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/voice_object/voice_with_class_object_specific_selector.html [ Failure ] +crbug.com/1012242 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/white-space_normal_wrapped.html [ Failure ] +crbug.com/1012242 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/white-space_nowrap_wrapped.html [ Failure ] +crbug.com/1012242 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/white-space_pre.html [ Failure ] +crbug.com/1012242 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/white-space_pre-line_wrapped.html [ Failure ] +crbug.com/1012242 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/white-space_pre_wrapped.html [ Failure ] +crbug.com/1012242 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/white-space_pre-wrap_wrapped.html [ Failure ] +crbug.com/1012242 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue/inherit_values_from_media_element.html [ Failure ] +crbug.com/1012242 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue/outline_properties.html [ Failure ] +crbug.com/1012242 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue/outline_shorthand.html [ Failure ] +crbug.com/1012242 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue-region/font_properties.html [ Failure ] +crbug.com/1012242 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue-region_function/font_properties.html [ Failure ] +crbug.com/1012242 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue/text-decoration_line-through.html [ Failure ] +crbug.com/1012242 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue/text-decoration_overline.html [ Failure ] +crbug.com/1012242 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue/text-decoration_overline_underline_line-through.html [ Failure ] +crbug.com/1012242 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue/text-decoration_underline.html [ Failure ] +crbug.com/1012242 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue/text-shadow.html [ Failure ] +crbug.com/1012242 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue/white-space_normal_wrapped.html [ Failure ] +crbug.com/1012242 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue/white-space_nowrap_wrapped.html [ Failure ] +crbug.com/1012242 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue/white-space_pre.html [ Failure ] +crbug.com/1012242 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue/white-space_pre-line_wrapped.html [ Failure ] +crbug.com/1012242 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue/white-space_pre_wrapped.html [ Failure ] +crbug.com/1012242 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue/white-space_pre-wrap_wrapped.html [ Failure ] +crbug.com/1012242 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/default_styles/bold_object_default_font-style.html [ Failure ] +crbug.com/1012242 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/default_styles/inherit_as_default_value_inherits_values_from_media_element.html [ Failure ] +crbug.com/1012242 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/default_styles/italic_object_default_font-style.html [ Failure ] +crbug.com/1012242 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/default_styles/underline_object_default_font-style.html [ Failure ] +crbug.com/1012242 external/wpt/webvtt/rendering/cues-with-video/processing-model/size_50.html [ Failure ] +crbug.com/1012242 external/wpt/webvtt/rendering/cues-with-video/processing-model/too_many_cues.html [ Failure ] +crbug.com/1012242 external/wpt/webvtt/rendering/cues-with-video/processing-model/too_many_cues_wrapped.html [ Failure ] +crbug.com/1012242 external/wpt/webvtt/rendering/cues-with-video/processing-model/align_center.html [ Failure ] +crbug.com/1012242 external/wpt/webvtt/rendering/cues-with-video/processing-model/align_center_position_50.html [ Failure ] +crbug.com/1012242 external/wpt/webvtt/rendering/cues-with-video/processing-model/align_center_position_gt_50.html [ Failure ] +crbug.com/1012242 external/wpt/webvtt/rendering/cues-with-video/processing-model/align_center_position_lt_50.html [ Failure ] +crbug.com/1012242 external/wpt/webvtt/rendering/cues-with-video/processing-model/align_center_position_lt_50_size_gt_maximum_size.html [ Failure ] +crbug.com/1012242 external/wpt/webvtt/rendering/cues-with-video/processing-model/align_center_wrapped.html [ Failure ] +crbug.com/1012242 external/wpt/webvtt/rendering/cues-with-video/processing-model/regions/basic.html [ Failure ] +crbug.com/1012242 external/wpt/webvtt/rendering/cues-with-video/processing-model/regions/regionanchor_x_50_percent.html [ Failure ] +crbug.com/1012242 external/wpt/webvtt/rendering/cues-with-video/processing-model/regions/regionanchor_y_50_percent.html [ Failure ] +crbug.com/1012242 external/wpt/webvtt/rendering/cues-with-video/processing-model/regions/scroll_up.html [ Failure ] +crbug.com/1012242 external/wpt/webvtt/rendering/cues-with-video/processing-model/regions/single_line_top_left.html [ Failure ] +crbug.com/1012242 external/wpt/webvtt/rendering/cues-with-video/processing-model/regions/viewportanchor_x_50_percent.html [ Failure ] +crbug.com/1012242 external/wpt/webvtt/rendering/cues-with-video/processing-model/regions/viewportanchor_y_50_percent.html [ Failure ] +crbug.com/1012242 external/wpt/webvtt/rendering/cues-with-video/processing-model/regions/width_50_percent.html [ Failure ] +crbug.com/1012242 external/wpt/webvtt/rendering/cues-with-video/processing-model/align_center_position_gt_50_size_gt_maximum_size.html [ Failure ] +crbug.com/1012242 external/wpt/webvtt/rendering/cues-with-video/processing-model/bidi/start_alignment.html [ Failure ] +crbug.com/1012242 external/wpt/webvtt/rendering/cues-with-video/processing-model/bidi/vertical_rl.html [ Failure ] +crbug.com/1012242 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue/vertical_ruby-position.html [ Failure ] +crbug.com/1012242 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/class_object/class_vertical_text-combine-upright.html [ Failure ] +crbug.com/1012242 external/wpt/webvtt/rendering/cues-with-video/processing-model/bidi/vertical_lr.html [ Failure ] +crbug.com/1012242 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue/vertical_text-combine-upright.html [ Failure ] + # FontFace object failures detected by WPT test crbug.com/965409 external/wpt/css/css-font-loading/fontface-descriptor-updates.html [ Failure ] @@ -2945,6 +3163,12 @@ crbug.com/947951 [ Win ] external/wpt/pointerevents/pointerevent_touch-action-inherit_child-auto-child-none_touch.html [ Pass Timeout ] # ====== New tests from wpt-importer added here ====== +crbug.com/626703 [ Linux ] external/wpt/css/css-overflow/text-overflow-ellipsis-002.html [ Failure ] +crbug.com/626703 [ Mac ] external/wpt/css/css-overflow/text-overflow-ellipsis-002.html [ Failure ] +crbug.com/626703 [ Win ] external/wpt/css/css-overflow/text-overflow-ellipsis-002.html [ Failure ] +crbug.com/626703 [ Linux ] external/wpt/css/css-overflow/webkit-line-clamp-035.html [ Failure ] +crbug.com/626703 [ Mac ] external/wpt/css/css-overflow/webkit-line-clamp-035.html [ Failure ] +crbug.com/626703 [ Win ] external/wpt/css/css-overflow/webkit-line-clamp-035.html [ Failure ] crbug.com/626703 [ Mac10.14 ] external/wpt/preload/download-resources.html [ Timeout ] crbug.com/626703 [ Mac10.10 ] virtual/threaded/external/wpt/css/css-scroll-snap/snap-after-initial-layout/writing-mode-vertical-rl.html [ Timeout ] crbug.com/626703 [ Mac10.10 ] virtual/threaded/external/wpt/requestidlecallback/callback-invoked.html [ Timeout ] @@ -3136,12 +3360,6 @@ crbug.com/626703 [ Mac10.13 ] external/wpt/screen-capture/getdisplaymedia.https.html [ Failure Timeout ] crbug.com/626703 [ Mac10.14 ] external/wpt/screen-capture/getdisplaymedia.https.html [ Failure Timeout ] crbug.com/626703 [ Retina ] external/wpt/screen-capture/getdisplaymedia.https.html [ Timeout ] -crbug.com/626703 [ Linux ] external/wpt/html/semantics/document-metadata/the-link-element/link-multiple-error-events.html [ Timeout ] -crbug.com/626703 [ Mac ] external/wpt/html/semantics/document-metadata/the-link-element/link-multiple-error-events.html [ Timeout ] -crbug.com/626703 [ Win ] external/wpt/html/semantics/document-metadata/the-link-element/link-multiple-error-events.html [ Timeout ] -crbug.com/626703 [ Linux ] external/wpt/html/semantics/document-metadata/the-link-element/link-multiple-load-events.html [ Timeout ] -crbug.com/626703 [ Mac ] external/wpt/html/semantics/document-metadata/the-link-element/link-multiple-load-events.html [ Timeout ] -crbug.com/626703 [ Win ] external/wpt/html/semantics/document-metadata/the-link-element/link-multiple-load-events.html [ Timeout ] crbug.com/626703 external/wpt/streams/readable-byte-streams/construct-byob-request.any.sharedworker.html [ Timeout ] crbug.com/626703 [ Linux ] external/wpt/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/window-iframe-messagechannel.https.html [ Timeout ] crbug.com/626703 [ Mac ] external/wpt/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/window-iframe-messagechannel.https.html [ Timeout ] @@ -3194,7 +3412,6 @@ crbug.com/626703 [ Win7 ] external/wpt/pointerevents/extension/pointerevent_touch-action-pan-right-css_touch.html [ Timeout ] crbug.com/626703 [ Mac10.11 ] external/wpt/shape-detection/detection-security-test.https.html [ Timeout ] crbug.com/626703 [ Mac10.11 ] external/wpt/shape-detection/shapedetection-cross-origin.sub.https.html [ Timeout ] -crbug.com/626703 external/wpt/webvtt/rendering/cues-with-video/processing-model/align_center_position_gt_50_size_gt_maximum_size.html [ Failure ] crbug.com/626703 external/wpt/webrtc/RTCPeerConnection-setRemoteDescription-offer.html [ Timeout ] crbug.com/626703 virtual/webrtc-wpt-plan-b/external/wpt/webrtc/RTCPeerConnection-setRemoteDescription-offer.html [ Timeout ] crbug.com/626703 external/wpt/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/broadcastchannel-success.https.html [ Timeout ] @@ -3208,7 +3425,6 @@ crbug.com/626703 [ Mac10.11 ] external/wpt/shape-detection/detection-HTMLVideoElement-invalid-state.html [ Timeout ] crbug.com/626703 [ Mac10.12 ] external/wpt/html/semantics/embedded-content/media-elements/track/track-element/track-mode.html [ Timeout ] crbug.com/1004760 [ Mac ] external/wpt/html/semantics/embedded-content/media-elements/ready-states/autoplay-hidden.optional.html [ Timeout ] -crbug.com/626703 external/wpt/webvtt/rendering/cues-with-video/processing-model/bidi/start_alignment.html [ Failure ] crbug.com/626703 [ Retina ] external/wpt/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/open-features-tokenization-top-left.html [ Timeout ] crbug.com/626703 external/wpt/mediacapture-streams/MediaStream-MediaElement-srcObject.https.html [ Timeout ] crbug.com/626703 virtual/audio-service/external/wpt/mediacapture-streams/MediaStream-MediaElement-srcObject.https.html [ Timeout ] @@ -3250,11 +3466,6 @@ crbug.com/626703 [ Mac ] external/wpt/html/rendering/widgets/button-layout/propagate-text-decoration.html [ Failure ] crbug.com/626703 external/wpt/xhr/abort-after-stop.any.worker.html [ Timeout ] crbug.com/626703 virtual/omt-worker-fetch/external/wpt/xhr/abort-after-stop.any.worker.html [ Timeout ] -crbug.com/626703 external/wpt/webvtt/rendering/cues-with-video/processing-model/bidi/vertical_rl.html [ Failure ] -crbug.com/626703 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue/vertical_ruby-position.html [ Failure ] -crbug.com/626703 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/class_object/class_vertical_text-combine-upright.html [ Failure ] -crbug.com/626703 external/wpt/webvtt/rendering/cues-with-video/processing-model/bidi/vertical_lr.html [ Failure ] -crbug.com/626703 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue/vertical_text-combine-upright.html [ Failure ] crbug.com/626703 virtual/speech-with-unified-autoplay/external/wpt/speech-api/SpeechSynthesisUtterance-volume-manual.html [ Skip ] crbug.com/626703 external/wpt/speech-api/SpeechSynthesisUtterance-volume-manual.html [ Skip ] crbug.com/626703 [ Mac10.11 ] external/wpt/webrtc/no-media-call.html [ Timeout ] @@ -3439,20 +3650,6 @@ crbug.com/626703 external/wpt/css/css-will-change/will-change-abspos-cb-001.html [ Failure ] ### See crbug.com/891427 comment near the top of this file: crbug.com/626703 external/wpt/html/rendering/non-replaced-elements/the-fieldset-and-legend-elements/legend-block-margins-2.html [ Failure ] -crbug.com/626703 external/wpt/webvtt/rendering/cues-with-video/processing-model/align_center.html [ Failure ] -crbug.com/626703 external/wpt/webvtt/rendering/cues-with-video/processing-model/align_center_position_50.html [ Failure ] -crbug.com/626703 external/wpt/webvtt/rendering/cues-with-video/processing-model/align_center_position_gt_50.html [ Failure ] -crbug.com/626703 external/wpt/webvtt/rendering/cues-with-video/processing-model/align_center_position_lt_50.html [ Failure ] -crbug.com/626703 external/wpt/webvtt/rendering/cues-with-video/processing-model/align_center_position_lt_50_size_gt_maximum_size.html [ Failure ] -crbug.com/626703 external/wpt/webvtt/rendering/cues-with-video/processing-model/align_center_wrapped.html [ Failure ] -crbug.com/626703 external/wpt/webvtt/rendering/cues-with-video/processing-model/regions/basic.html [ Failure ] -crbug.com/626703 external/wpt/webvtt/rendering/cues-with-video/processing-model/regions/regionanchor_x_50_percent.html [ Failure ] -crbug.com/626703 external/wpt/webvtt/rendering/cues-with-video/processing-model/regions/regionanchor_y_50_percent.html [ Failure ] -crbug.com/626703 external/wpt/webvtt/rendering/cues-with-video/processing-model/regions/scroll_up.html [ Failure ] -crbug.com/626703 external/wpt/webvtt/rendering/cues-with-video/processing-model/regions/single_line_top_left.html [ Failure ] -crbug.com/626703 external/wpt/webvtt/rendering/cues-with-video/processing-model/regions/viewportanchor_x_50_percent.html [ Failure ] -crbug.com/626703 external/wpt/webvtt/rendering/cues-with-video/processing-model/regions/viewportanchor_y_50_percent.html [ Failure ] -crbug.com/626703 external/wpt/webvtt/rendering/cues-with-video/processing-model/regions/width_50_percent.html [ Failure ] crbug.com/767352 external/wpt/css/css-backgrounds/border-image-width-008.html [ Failure ] crbug.com/367760 external/wpt/svg/pservers/reftests/meshgradient-basic-004.svg [ Failure ] crbug.com/367760 external/wpt/svg/pservers/reftests/meshgradient-basic-001.svg [ Failure ] @@ -3819,221 +4016,7 @@ crbug.com/626703 external/wpt/requestidlecallback/callback-xhr-sync.html [ Timeout ] crbug.com/626703 external/wpt/screen-orientation/onchange-event-subframe.html [ Timeout ] crbug.com/626703 external/wpt/svg/linking/reftests/href-filter-element.html [ Failure ] -crbug.com/626703 external/wpt/webvtt/rendering/cues-with-video/processing-model/2_cues_overlapping_completely_move_up.html [ Failure ] -crbug.com/626703 external/wpt/webvtt/rendering/cues-with-video/processing-model/2_cues_overlapping_partially_move_down.html [ Failure ] -crbug.com/626703 external/wpt/webvtt/rendering/cues-with-video/processing-model/2_cues_overlapping_partially_move_up.html [ Failure ] -crbug.com/626703 external/wpt/webvtt/rendering/cues-with-video/processing-model/align_end.html [ Failure ] -crbug.com/626703 external/wpt/webvtt/rendering/cues-with-video/processing-model/align_end_wrapped.html [ Failure ] -crbug.com/626703 external/wpt/webvtt/rendering/cues-with-video/processing-model/align_start.html [ Failure ] -crbug.com/626703 external/wpt/webvtt/rendering/cues-with-video/processing-model/align_start_wrapped.html [ Failure ] -crbug.com/626703 external/wpt/webvtt/rendering/cues-with-video/processing-model/basic.html [ Failure ] -crbug.com/626703 external/wpt/webvtt/rendering/cues-with-video/processing-model/bidi/bidi_ruby.html [ Failure ] -crbug.com/626703 external/wpt/webvtt/rendering/cues-with-video/processing-model/bidi/u002E_LF_u05D0.html [ Failure ] -crbug.com/626703 external/wpt/webvtt/rendering/cues-with-video/processing-model/bidi/u002E_u2028_u05D0.html [ Failure ] -crbug.com/626703 external/wpt/webvtt/rendering/cues-with-video/processing-model/bidi/u002E_u2029_u05D0.html [ Failure ] -crbug.com/626703 external/wpt/webvtt/rendering/cues-with-video/processing-model/bidi/u0041_first.html [ Failure ] -crbug.com/626703 external/wpt/webvtt/rendering/cues-with-video/processing-model/bidi/u05D0_first.html [ Failure ] -crbug.com/626703 external/wpt/webvtt/rendering/cues-with-video/processing-model/bidi/u0628_first.html [ Failure ] -crbug.com/626703 external/wpt/webvtt/rendering/cues-with-video/processing-model/bidi/u06E9_no_strong_dir.html [ Failure ] -crbug.com/626703 external/wpt/webvtt/rendering/cues-with-video/processing-model/cue_too_long.html [ Failure ] -crbug.com/626703 external/wpt/webvtt/rendering/cues-with-video/processing-model/decode_escaped_entities.html [ Failure ] -crbug.com/626703 external/wpt/webvtt/rendering/cues-with-video/processing-model/disable_controls_reposition.html [ Failure ] -crbug.com/626703 external/wpt/webvtt/rendering/cues-with-video/processing-model/dom_override_cue_align_position_line_size.html [ Failure ] -crbug.com/626703 external/wpt/webvtt/rendering/cues-with-video/processing-model/dom_override_cue_align_position_line_size_while_paused.html [ Failure ] -crbug.com/626703 external/wpt/webvtt/rendering/cues-with-video/processing-model/dom_override_cue_line.html [ Failure ] -crbug.com/626703 external/wpt/webvtt/rendering/cues-with-video/processing-model/dom_override_cue_text.html [ Failure ] -crbug.com/626703 external/wpt/webvtt/rendering/cues-with-video/processing-model/dom_override_cue_text_while_paused.html [ Failure ] -crbug.com/626703 external/wpt/webvtt/rendering/cues-with-video/processing-model/enable_controls_reposition.html [ Failure ] -crbug.com/626703 external/wpt/webvtt/rendering/cues-with-video/processing-model/evil/9_cues_overlapping_completely_all_cues_have_same_timestamp.html [ Failure ] -crbug.com/626703 external/wpt/webvtt/rendering/cues-with-video/processing-model/evil/9_cues_overlapping_completely.html [ Failure ] -crbug.com/626703 external/wpt/webvtt/rendering/cues-with-video/processing-model/evil/media_height_19.html [ Failure ] -crbug.com/626703 external/wpt/webvtt/rendering/cues-with-video/processing-model/evil/single_quote.html [ Failure ] -crbug.com/626703 external/wpt/webvtt/rendering/cues-with-video/processing-model/evil/size_90.html [ Failure ] -crbug.com/626703 external/wpt/webvtt/rendering/cues-with-video/processing-model/evil/size_99.html [ Failure ] -crbug.com/626703 external/wpt/webvtt/rendering/cues-with-video/processing-model/line_0_is_top.html [ Failure ] -crbug.com/626703 external/wpt/webvtt/rendering/cues-with-video/processing-model/line_1_wrapped_cue_grow_downwards.html [ Failure ] -crbug.com/626703 external/wpt/webvtt/rendering/cues-with-video/processing-model/line_-2_wrapped_cue_grow_upwards.html [ Failure ] -crbug.com/626703 external/wpt/webvtt/rendering/cues-with-video/processing-model/line_50_percent.html [ Failure ] -crbug.com/626703 external/wpt/webvtt/rendering/cues-with-video/processing-model/line_integer_and_percent_mixed_overlap.html [ Failure ] -crbug.com/626703 external/wpt/webvtt/rendering/cues-with-video/processing-model/line_integer_and_percent_mixed_overlap_move_up.html [ Failure ] -crbug.com/626703 external/wpt/webvtt/rendering/cues-with-video/processing-model/line_percent_and_integer_mixed_overlap.html [ Failure ] -crbug.com/626703 external/wpt/webvtt/rendering/cues-with-video/processing-model/line_percent_and_integer_mixed_overlap_move_up.html [ Failure ] -crbug.com/626703 external/wpt/webvtt/rendering/cues-with-video/processing-model/media_height400_with_controls.html [ Failure ] -crbug.com/626703 external/wpt/webvtt/rendering/cues-with-video/processing-model/media_with_controls.html [ Failure ] -crbug.com/626703 external/wpt/webvtt/rendering/cues-with-video/processing-model/navigate_cue_position.html [ Failure ] -crbug.com/626703 external/wpt/webvtt/rendering/cues-with-video/processing-model/one_line_cue_plus_wrapped_cue.html [ Failure ] -crbug.com/626703 external/wpt/webvtt/rendering/cues-with-video/processing-model/repaint.html [ Failure ] -crbug.com/626703 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue/background_properties.html [ Failure ] -crbug.com/626703 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue/background_shorthand_css_relative_url.html [ Failure ] -crbug.com/626703 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue/background_shorthand.html [ Failure ] -crbug.com/626703 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue/color_hex.html [ Failure ] -crbug.com/626703 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue/color_hsla.html [ Failure ] -crbug.com/626703 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue/color_rgba.html [ Failure ] -crbug.com/626703 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue/cue_selector_single_colon.html [ Failure ] -crbug.com/626703 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue/font_properties.html [ Failure ] -crbug.com/626703 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue/font_shorthand.html [ Failure ] -crbug.com/626703 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/background_box.html [ Failure ] -crbug.com/626703 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/background_properties.html [ Failure ] -crbug.com/626703 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/background_shorthand_css_relative_url.html [ Failure ] -crbug.com/626703 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/background_shorthand.html [ Failure ] -crbug.com/626703 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/bold_object/bold_animation_with_timestamp.html [ Failure ] -crbug.com/626703 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/bold_object/bold_background_properties.html [ Failure ] -crbug.com/626703 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/bold_object/bold_background_shorthand.html [ Failure ] -crbug.com/626703 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/bold_object/bold_color.html [ Failure ] -crbug.com/626703 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/bold_object/bold_font_properties.html [ Failure ] -crbug.com/626703 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/bold_object/bold_font_shorthand.html [ Failure ] -crbug.com/626703 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/bold_object/bold_namespace.html [ Failure ] -crbug.com/626703 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/bold_object/bold_outline_properties.html [ Failure ] -crbug.com/626703 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/bold_object/bold_outline_shorthand.html [ Failure ] -crbug.com/626703 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/bold_object/bold_text-decoration_line-through.html [ Failure ] -crbug.com/626703 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/bold_object/bold_text-shadow.html [ Failure ] -crbug.com/626703 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/bold_object/bold_timestamp_future.html [ Failure ] -crbug.com/626703 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/bold_object/bold_timestamp_past.html [ Failure ] -crbug.com/626703 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/bold_object/bold_transition_with_timestamp.html [ Failure ] -crbug.com/626703 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/bold_object/bold_white-space_normal_wrapped.html [ Failure ] -crbug.com/626703 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/bold_object/bold_white-space_nowrap.html [ Failure ] -crbug.com/626703 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/bold_object/bold_white-space_pre-line_wrapped.html [ Failure ] -crbug.com/626703 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/bold_object/bold_white-space_pre_wrapped.html [ Failure ] -crbug.com/626703 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/bold_object/bold_white-space_pre-wrap_wrapped.html [ Failure ] -crbug.com/626703 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/bold_object/bold_with_class.html [ Failure ] -crbug.com/626703 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/bold_object/bold_with_class_object_specific_selector.html [ Failure ] -crbug.com/626703 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/class_object/class_animation_with_timestamp.html [ Failure ] -crbug.com/626703 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/class_object/class_background_properties.html [ Failure ] -crbug.com/626703 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/class_object/class_background_shorthand.html [ Failure ] -crbug.com/626703 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/class_object/class_color.html [ Failure ] -crbug.com/626703 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/class_object/class_font_properties.html [ Failure ] -crbug.com/626703 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/class_object/class_font_shorthand.html [ Failure ] -crbug.com/626703 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/class_object/class_namespace.html [ Failure ] -crbug.com/626703 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/class_object/class_outline_properties.html [ Failure ] -crbug.com/626703 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/class_object/class_outline_shorthand.html [ Failure ] -crbug.com/626703 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/class_object/class_text-decoration_line-through.html [ Failure ] -crbug.com/626703 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/class_object/class_text-shadow.html [ Failure ] -crbug.com/626703 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/class_object/class_timestamp_future.html [ Failure ] -crbug.com/626703 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/class_object/class_timestamp_past.html [ Failure ] -crbug.com/626703 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/class_object/class_transition_with_timestamp.html [ Failure ] -crbug.com/626703 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/class_object/class_white-space_nowrap.html [ Failure ] -crbug.com/626703 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/class_object/class_white-space_pre_wrapped.html [ Failure ] -crbug.com/626703 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/class_object/class_white-space_pre-wrap_wrapped.html [ Failure ] -crbug.com/626703 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/class_object/class_with_class.html [ Failure ] -crbug.com/626703 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/class_object/class_with_class_object_specific_selector.html [ Failure ] -crbug.com/626703 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/color_hex.html [ Failure ] -crbug.com/626703 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/color_hsla.html [ Failure ] -crbug.com/626703 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/color_rgba.html [ Failure ] -crbug.com/626703 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/cue_func_selector_single_colon.html [ Failure ] -crbug.com/626703 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/font_properties.html [ Failure ] -crbug.com/626703 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/font_shorthand.html [ Failure ] -crbug.com/626703 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/id_color.html [ Failure ] -crbug.com/626703 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/inherit_values_from_media_element.html [ Failure ] -crbug.com/626703 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/italic_object/italic_animation_with_timestamp.html [ Failure ] -crbug.com/626703 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/italic_object/italic_background_properties.html [ Failure ] -crbug.com/626703 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/italic_object/italic_background_shorthand.html [ Failure ] -crbug.com/626703 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/italic_object/italic_color.html [ Failure ] -crbug.com/626703 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/italic_object/italic_font_properties.html [ Failure ] -crbug.com/626703 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/italic_object/italic_font_shorthand.html [ Failure ] -crbug.com/626703 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/italic_object/italic_namespace.html [ Failure ] -crbug.com/626703 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/italic_object/italic_outline_properties.html [ Failure ] -crbug.com/626703 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/italic_object/italic_outline_shorthand.html [ Failure ] -crbug.com/626703 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/italic_object/italic_text-decoration_line-through.html [ Failure ] -crbug.com/626703 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/italic_object/italic_text-shadow.html [ Failure ] -crbug.com/626703 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/italic_object/italic_timestamp_future.html [ Failure ] -crbug.com/626703 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/italic_object/italic_timestamp_past.html [ Failure ] -crbug.com/626703 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/italic_object/italic_transition_with_timestamp.html [ Failure ] -crbug.com/626703 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/italic_object/italic_white-space_normal_wrapped.html [ Failure ] -crbug.com/626703 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/italic_object/italic_white-space_nowrap.html [ Failure ] -crbug.com/626703 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/italic_object/italic_white-space_pre-line_wrapped.html [ Failure ] -crbug.com/626703 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/italic_object/italic_white-space_pre_wrapped.html [ Failure ] -crbug.com/626703 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/italic_object/italic_white-space_pre-wrap_wrapped.html [ Failure ] -crbug.com/626703 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/italic_object/italic_with_class.html [ Failure ] -crbug.com/626703 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/italic_object/italic_with_class_object_specific_selector.html [ Failure ] -crbug.com/626703 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/not_allowed_properties.html [ Failure ] -crbug.com/626703 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/not_root_selector.html [ Failure ] -crbug.com/626703 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/outline_properties.html [ Failure ] -crbug.com/626703 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/outline_shorthand.html [ Failure ] -crbug.com/626703 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/root_namespace.html [ Failure ] -crbug.com/626703 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/root_selector.html [ Failure ] -crbug.com/626703 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/text-decoration_line-through.html [ Failure ] -crbug.com/626703 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/text-decoration_overline.html [ Failure ] -crbug.com/626703 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/text-decoration_overline_underline_line-through.html [ Failure ] -crbug.com/626703 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/text-decoration_underline.html [ Failure ] -crbug.com/626703 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/text-shadow.html [ Failure ] -crbug.com/626703 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/type_selector_root.html [ Failure ] -crbug.com/626703 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/underline_object/underline_animation_with_timestamp.html [ Failure ] -crbug.com/626703 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/underline_object/underline_background_properties.html [ Failure ] -crbug.com/626703 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/underline_object/underline_background_shorthand.html [ Failure ] -crbug.com/626703 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/underline_object/underline_color.html [ Failure ] -crbug.com/626703 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/underline_object/underline_font_properties.html [ Failure ] -crbug.com/626703 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/underline_object/underline_font_shorthand.html [ Failure ] -crbug.com/626703 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/underline_object/underline_namespace.html [ Failure ] -crbug.com/626703 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/underline_object/underline_outline_properties.html [ Failure ] -crbug.com/626703 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/underline_object/underline_outline_shorthand.html [ Failure ] -crbug.com/626703 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/underline_object/underline_text-decoration_line-through.html [ Failure ] -crbug.com/626703 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/underline_object/underline_text-shadow.html [ Failure ] -crbug.com/626703 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/underline_object/underline_timestamp_future.html [ Failure ] -crbug.com/626703 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/underline_object/underline_timestamp_past.html [ Failure ] -crbug.com/626703 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/underline_object/underline_transition_with_timestamp.html [ Failure ] -crbug.com/626703 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/underline_object/underline_white-space_normal_wrapped.html [ Failure ] -crbug.com/626703 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/underline_object/underline_white-space_nowrap.html [ Failure ] -crbug.com/626703 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/underline_object/underline_white-space_pre-line_wrapped.html [ Failure ] -crbug.com/626703 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/underline_object/underline_white-space_pre_wrapped.html [ Failure ] -crbug.com/626703 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/underline_object/underline_white-space_pre-wrap_wrapped.html [ Failure ] -crbug.com/626703 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/underline_object/underline_with_class.html [ Failure ] -crbug.com/626703 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/underline_object/underline_with_class_object_specific_selector.html [ Failure ] -crbug.com/626703 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/voice_object/voice_animation_with_timestamp.html [ Failure ] -crbug.com/626703 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/voice_object/voice_background_properties.html [ Failure ] -crbug.com/626703 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/voice_object/voice_background_shorthand.html [ Failure ] -crbug.com/626703 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/voice_object/voice_color.html [ Failure ] -crbug.com/626703 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/voice_object/voice_font_properties.html [ Failure ] -crbug.com/626703 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/voice_object/voice_font_shorthand.html [ Failure ] -crbug.com/626703 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/voice_object/voice_namespace.html [ Failure ] -crbug.com/626703 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/voice_object/voice_outline_properties.html [ Failure ] -crbug.com/626703 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/voice_object/voice_outline_shorthand.html [ Failure ] -crbug.com/626703 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/voice_object/voice_text-decoration_line-through.html [ Failure ] -crbug.com/626703 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/voice_object/voice_text-shadow.html [ Failure ] -crbug.com/626703 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/voice_object/voice_timestamp_future.html [ Failure ] -crbug.com/626703 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/voice_object/voice_timestamp_past.html [ Failure ] -crbug.com/626703 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/voice_object/voice_transition_with_timestamp.html [ Failure ] -crbug.com/626703 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/voice_object/voice_voice_attribute.html [ Failure ] -crbug.com/626703 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/voice_object/voice_white-space_normal_wrapped.html [ Failure ] -crbug.com/626703 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/voice_object/voice_white-space_nowrap.html [ Failure ] -crbug.com/626703 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/voice_object/voice_white-space_pre-line_wrapped.html [ Failure ] -crbug.com/626703 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/voice_object/voice_white-space_pre_wrapped.html [ Failure ] -crbug.com/626703 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/voice_object/voice_white-space_pre-wrap_wrapped.html [ Failure ] -crbug.com/626703 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/voice_object/voice_with_class.html [ Failure ] -crbug.com/626703 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/voice_object/voice_with_class_object_specific_selector.html [ Failure ] -crbug.com/626703 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/white-space_normal_wrapped.html [ Failure ] -crbug.com/626703 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/white-space_nowrap_wrapped.html [ Failure ] -crbug.com/626703 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/white-space_pre.html [ Failure ] -crbug.com/626703 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/white-space_pre-line_wrapped.html [ Failure ] -crbug.com/626703 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/white-space_pre_wrapped.html [ Failure ] -crbug.com/626703 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue_function/white-space_pre-wrap_wrapped.html [ Failure ] -crbug.com/626703 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue/inherit_values_from_media_element.html [ Failure ] -crbug.com/626703 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue/outline_properties.html [ Failure ] -crbug.com/626703 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue/outline_shorthand.html [ Failure ] -crbug.com/626703 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue-region/font_properties.html [ Failure ] -crbug.com/626703 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue-region_function/font_properties.html [ Failure ] -crbug.com/626703 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue/text-decoration_line-through.html [ Failure ] -crbug.com/626703 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue/text-decoration_overline.html [ Failure ] -crbug.com/626703 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue/text-decoration_overline_underline_line-through.html [ Failure ] -crbug.com/626703 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue/text-decoration_underline.html [ Failure ] -crbug.com/626703 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue/text-shadow.html [ Failure ] -crbug.com/626703 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue/white-space_normal_wrapped.html [ Failure ] -crbug.com/626703 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue/white-space_nowrap_wrapped.html [ Failure ] -crbug.com/626703 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue/white-space_pre.html [ Failure ] -crbug.com/626703 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue/white-space_pre-line_wrapped.html [ Failure ] -crbug.com/626703 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue/white-space_pre_wrapped.html [ Failure ] -crbug.com/626703 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/cue/white-space_pre-wrap_wrapped.html [ Failure ] -crbug.com/626703 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/default_styles/bold_object_default_font-style.html [ Failure ] -crbug.com/626703 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/default_styles/inherit_as_default_value_inherits_values_from_media_element.html [ Failure ] -crbug.com/626703 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/default_styles/italic_object_default_font-style.html [ Failure ] -crbug.com/626703 external/wpt/webvtt/rendering/cues-with-video/processing-model/selectors/default_styles/underline_object_default_font-style.html [ Failure ] -crbug.com/626703 external/wpt/webvtt/rendering/cues-with-video/processing-model/size_50.html [ Failure ] -crbug.com/626703 external/wpt/webvtt/rendering/cues-with-video/processing-model/too_many_cues.html [ Failure ] -crbug.com/626703 external/wpt/webvtt/rendering/cues-with-video/processing-model/too_many_cues_wrapped.html [ Failure ] crbug.com/626703 virtual/omt-worker-fetch/external/wpt/xhr/event-readystatechange-loaded.htm [ Failure Timeout ] -crbug.com/626703 external/wpt/xhr/preserve-ua-header-on-redirect.htm [ Failure ] -crbug.com/626703 virtual/omt-worker-fetch/external/wpt/xhr/preserve-ua-header-on-redirect.htm [ Failure ] -crbug.com/626703 external/wpt/xhr/setrequestheader-header-allowed.htm [ Failure ] -crbug.com/626703 virtual/omt-worker-fetch/external/wpt/xhr/setrequestheader-header-allowed.htm [ Failure ] crbug.com/626703 [ Win10 ] external/wpt/preload/delaying-onload-link-preload-after-discovery.html [ Timeout ] crbug.com/626703 [ Win ] external/wpt/css/css-writing-modes/box-offsets-rel-pos-vlr-005.xht [ Failure ] crbug.com/626703 [ Win ] external/wpt/css/css-writing-modes/box-offsets-rel-pos-vrl-004.xht [ Failure ] @@ -4656,6 +4639,10 @@ crbug.com/985520 virtual/focusless-spat-nav/fast/spatial-navigation/focusless/snav-focusless-enter-from-interest-a11y.html [ Crash ] crbug.com/985520 virtual/focusless-spat-nav/fast/spatial-navigation/focusless/snav-focusless-enter-from-interest.html [ Crash ] +# User-Agent is not able to be set on XHR/fetch +crbug.com/571722 external/wpt/xhr/preserve-ua-header-on-redirect.htm [ Failure ] +crbug.com/571722 virtual/omt-worker-fetch/external/wpt/xhr/preserve-ua-header-on-redirect.htm [ Failure ] + # Sheriff failures 2017-02-21 crbug.com/73609 http/tests/media/video-play-stall.html [ Pass Timeout ] crbug.com/73609 virtual/audio-service/http/tests/media/video-play-stall.html [ Pass Timeout ] @@ -6657,6 +6644,8 @@ # Sheriff 2020-04-01 crbug.com/1066122 virtual/threaded-no-composited-antialiasing/animations/events/animation-iteration-event.html [ Pass Failure ] crbug.com/1066732 fast/events/platform-wheelevent-paging-y-in-scrolling-div.html [ Pass Failure ] +# Sheriff 2020-04-02 +crbug.com/1067084 virtual/paint-timing/external/wpt/paint-timing/fcp-only/fcp-with-rtl.html [ Pass Failure ] # TODO(danakj): Rebaseline for Mac 10.14 crbug.com/1066392 [ Mac ] virtual/gpu-rasterization/images/ycbcr-with-cmyk-color-profile.html [ Pass Failure ]
diff --git a/third_party/blink/web_tests/css3/flexbox/multiline-min-preferred-width.html b/third_party/blink/web_tests/css3/flexbox/multiline-min-preferred-width.html deleted file mode 100644 index dd65a509..0000000 --- a/third_party/blink/web_tests/css3/flexbox/multiline-min-preferred-width.html +++ /dev/null
@@ -1,33 +0,0 @@ -<!DOCTYPE html> -<html> -<head> -<link rel="stylesheet" href="resources/flexbox.css"> -<script src="../../resources/testharness.js"></script> -<script src="../../resources/testharnessreport.js"></script> -<script src="../../resources/check-layout-th.js"></script> -<style> -.item { - padding: 7px; - background-color: green; - border: 4px solid olive; - width: min-content; -} - -.square { - background-color: lime; - width: 20px; - height: 20px; -} -</style> -</head> -<body onload="checkLayout('.container')"> -<div id=log></div> - -<div class="container flexbox wrap" data-expected-height=42> - <div class="item flexbox wrap" data-expected-width=42 data-expected-height=42> - <div class="square" data-expected-width=20 data-expected-height=20></div> - </div> -</div> - -</body> -</html>
diff --git a/third_party/blink/web_tests/css3/flexbox/multiline-reverse-wrap-baseline.html b/third_party/blink/web_tests/css3/flexbox/multiline-reverse-wrap-baseline.html deleted file mode 100644 index 34aa49e..0000000 --- a/third_party/blink/web_tests/css3/flexbox/multiline-reverse-wrap-baseline.html +++ /dev/null
@@ -1,55 +0,0 @@ -<!DOCTYPE html> -<html> -<style> -.flexbox { - width: 200px; - display: flex; - background-color: #aaa; - position: relative; - flex-wrap: wrap-reverse; - align-items: baseline; - margin-bottom: 10px; -} -.flexbox > div { - border: 0; -} - -.flexbox :nth-child(1) { - background-color: lightblue; -} -.flexbox :nth-child(2) { - background-color: lightgreen; -} -.flexbox :nth-child(3) { - background-color: pink; -} -.flexbox :nth-child(4) { - background-color: yellow; -} -</style> -<body> -<p>Test to make sure that wrap-reverse flips the cross axis directions and items -with baseline alignment are aligned to cross axis start.</p> - -<div class="flexbox"> - <div style="flex: 1 0 100px;">first<br>first<br>first</div> - <div style="flex: 1 0 100px;">second</div> - <div style="flex: 1 0 100px; margin-top: 5px">third</div> - <div style="flex: 1 0 100px;">fourth<br>fourth</div> -</div> - -<div class="flexbox"> - <div style="flex: 1 0 100px;">first<br>first<br>first</div> - <div style="flex: 1 0 100px;">second</div> - <div style="flex: 1 0 100px;">third</div> - <div style="flex: 1 0 100px; margin-bottom: 5px">fourth<br>fourth</div> -</div> - -<div class="flexbox" style="width: 300px;"> - <div style="flex: 1 0 100px; align-self: flex-start; height: 100px">first</div> - <div style="flex: 1 0 100px;">second</div> - <div style="flex: 1 0 100px;">third<br>third</div> -</div> - -</body> -</html>
diff --git a/third_party/blink/web_tests/css3/flexbox/overflow-and-padding.html b/third_party/blink/web_tests/css3/flexbox/overflow-and-padding.html index 52d146b..d14972d 100644 --- a/third_party/blink/web_tests/css3/flexbox/overflow-and-padding.html +++ b/third_party/blink/web_tests/css3/flexbox/overflow-and-padding.html
@@ -1,31 +1,45 @@ <!DOCTYPE html> +<html> +<title>CSS Flexbox: padding on a flexbox with overflowing content.</title> +<link rel="help" href="https://drafts.csswg.org/css-overflow-3/#overflow-properties"> +<link rel="help" href="https://drafts.csswg.org/css-flexbox/#item-margins"> +<link rel="help" href="https://codereview.chromium.org/134603002"> +<meta name="assert" content="This test checks that all paddings but padding-right work on a flexbox in the face of overflowing content, matching the Blink/WebKit behavior for 'display:block'." /> + +<style> +#scrollable { + overflow: scroll; + background: pink; + height: 300px; + width: 300px; + box-sizing: border-box; + display: flex; + padding: 100px; +} + +#item { + width: 300px; + height: 300px; + background: salmon; + flex-shrink: 0; +} +</style> + <script src="../../resources/testharness.js"></script> <script src="../../resources/testharnessreport.js"></script> <script src="../../resources/check-layout-th.js"></script> -<style> -#scrollable { - overflow: scroll; - background: pink; - height: 300px; - width: 300px; - box-sizing: border-box; - display: flex; - padding: 100px; -} -#item { - width: 300px; - height: 300px; - background: salmon; - flex-shrink: 0; -} -</style> + +<body onload="checkLayout('#scrollable')"> + <div id=log></div> -Tests that padding bottom on a flexbox works in the face of overflowing content. + +<p>Tests that padding bottom on a flexbox works in the face of overflowing content. Padding-right does not work. This matches the Blink/WebKit display:block behavior. -Unfortunately, IE and Gecko both lose the padding bottom and the padding right. +Unfortunately, IE and Gecko both lose the padding bottom and the padding right.</p> + <div id="scrollable" data-expected-scroll-height=500 data-expected-scroll-width=400> - <div id="item"></div> + <div id="item"></div> </div> -<script> -checkLayout('#scrollable'); -</script> + +</body> +</html>
diff --git a/third_party/blink/web_tests/css3/flexbox/shrinking-column-flexbox.html b/third_party/blink/web_tests/css3/flexbox/shrinking-column-flexbox.html deleted file mode 100644 index 7dcd3fe09d..0000000 --- a/third_party/blink/web_tests/css3/flexbox/shrinking-column-flexbox.html +++ /dev/null
@@ -1,52 +0,0 @@ -<!DOCTYPE html> - -<link href="resources/flexbox.css" rel="stylesheet"> - -<style> -body { - width: 800px; - height: 600px; -} - -.green { - background: green; -} - -.blue { - background: blue; -} - -.inner { - height: 200px; -} - -.small { - height: 100px; -} -</style> - -<script src="../../resources/testharness.js"></script> -<script src="../../resources/testharnessreport.js"></script> -<script src="../../resources/check-layout-th.js"></script> - -<script> -onload = function() { - document.body.offsetWidth; - document.getElementById("target").classList.add("small"); - - checkLayout("body"); -}; -</script> - -<body class="flexbox column"> - -<div class="flexbox column flex-one-one-auto"> - <div class="flex-one-one-auto green" data-expected-height="250" id="target"> - <div class="inner"></div> - </div> - <div class="flex-one-one-auto blue" data-expected-height="350"> - <div class="inner"></div> - </div> -</div> - -<div id=log></div>
diff --git a/third_party/blink/web_tests/css3/flexbox/stretch-after-sibling-size-change.html b/third_party/blink/web_tests/css3/flexbox/stretch-after-sibling-size-change.html deleted file mode 100644 index 06bd402..0000000 --- a/third_party/blink/web_tests/css3/flexbox/stretch-after-sibling-size-change.html +++ /dev/null
@@ -1,23 +0,0 @@ -<!DOCTYPE html> -<html> -<head> -<link href="resources/flexbox.css" rel="stylesheet"> -<script src="../../resources/testharness.js"></script> -<script src="../../resources/testharnessreport.js"></script> -<script src="../../resources/check-layout-th.js"></script> -<script> -window.onload = function() -{ - document.getElementById("a").style.height = "20px" - checkLayout(".flexbox"); -}; -</script> -</head> -<body> -<div id=log></div> -<div data-expected-width="100" data-expected-height="20" class="flexbox" style="width: 100px"> - <div id=a class="flex-one" data-expected-width="50" data-expected-height="20" style="background-color: blue; height: 30px;"></div> - <div id=b class="flex-one" data-expected-width="50" data-expected-height="20" style="background-color: green"></div> -</div> -</body> -</html>
diff --git a/third_party/blink/web_tests/css3/flexbox/stretching-orthogonal-flows.html b/third_party/blink/web_tests/css3/flexbox/stretching-orthogonal-flows.html deleted file mode 100644 index b60ad8f..0000000 --- a/third_party/blink/web_tests/css3/flexbox/stretching-orthogonal-flows.html +++ /dev/null
@@ -1,9 +0,0 @@ -<!DOCTYPE html> -<link href="resources/flexbox.css" rel="stylesheet"> - -<p>You should see no red.</p> - -<div class="flexbox column align-items-stretch" style="background-color: red;"> - <div style="background-color: green; height: 20px;"></div> - <div style="writing-mode: vertical-lr; background-color: green; height: 20px;"></div> -</div>
diff --git a/third_party/blink/web_tests/css3/flexbox/text-overflow-on-flexbox.html b/third_party/blink/web_tests/css3/flexbox/text-overflow-on-flexbox.html deleted file mode 100644 index 34054a3..0000000 --- a/third_party/blink/web_tests/css3/flexbox/text-overflow-on-flexbox.html +++ /dev/null
@@ -1,27 +0,0 @@ -<!DOCTYPE html> -<html> -<head> -<style> -div.flex { - display: flex; - width: 100px; - overflow: hidden; - text-overflow: ellipsis; -} -</style> -</head> -<body> - <div class="flex"> - AAAAAAAAAAAAAAAAAAAA - </div> - <div class="flex"> - <b>bbbbbbbbbbbbbbbbbbbb</b> - </div> - <div class="flex"> - <div>cccccccccccccccccccc</div> - </div> - <div class="flex"> - DDDDDDDDDDDDDDDDDDDD<b>ee</b>FFFFFFFFFFFFFFFFFFFF - </div> -</body> -</html>
diff --git a/third_party/blink/web_tests/css3/flexbox/vertical-align-do-not-effect-flex-items-expected.html b/third_party/blink/web_tests/css3/flexbox/vertical-align-do-not-effect-flex-items-expected.html deleted file mode 100644 index 32a6be89..0000000 --- a/third_party/blink/web_tests/css3/flexbox/vertical-align-do-not-effect-flex-items-expected.html +++ /dev/null
@@ -1,20 +0,0 @@ -<!DOCTYPE html> -<link href='resources/flexbox.css' rel='stylesheet'> - -<style> -.flexbox { - background-color: lightgrey; -} -</style> - -<p>This test checks that vertical-align should have no effect on a flex item -i.e flex items' content should not be shifted by the vertical-align</p> - -<div class='flexbox'> - <!-- flex item: block child --> - <div>block</div> - <!-- flex item: anonymous block box around inline content --> - anonymous item 2 - <!-- flex item: inline child --> - <span>item 3</span> -</div>
diff --git a/third_party/blink/web_tests/css3/flexbox/vertical-align-do-not-effect-flex-items.html b/third_party/blink/web_tests/css3/flexbox/vertical-align-do-not-effect-flex-items.html deleted file mode 100644 index e26054d..0000000 --- a/third_party/blink/web_tests/css3/flexbox/vertical-align-do-not-effect-flex-items.html +++ /dev/null
@@ -1,26 +0,0 @@ -<!DOCTYPE html> -<link href='resources/flexbox.css' rel='stylesheet'> - -<style> -.flexbox { - background-color: lightgrey; -} -#item1 { - vertical-align: 10px; -} -#item3 { - vertical-align: 30px; -} -</style> - -<p>This test checks that vertical-align should have no effect on a flex item -i.e flex items' content should not be shifted by the vertical-align</p> - -<div class='flexbox'> - <!-- flex item: block child --> - <div id='item1'>block</div> - <!-- flex item: anonymous block box around inline content --> - anonymous item 2 - <!-- flex item: inline child --> - <span id='item3'>item 3</span> -</div>
diff --git a/third_party/blink/web_tests/css3/flexbox/vertical-flexbox-percentage-ignored.html b/third_party/blink/web_tests/css3/flexbox/vertical-flexbox-percentage-ignored.html deleted file mode 100644 index eb2e342..0000000 --- a/third_party/blink/web_tests/css3/flexbox/vertical-flexbox-percentage-ignored.html +++ /dev/null
@@ -1,17 +0,0 @@ -<!DOCTYPE html> -<html> -<link href="resources/flexbox.css" rel="stylesheet"> -<style> -.flexbox { - max-height: 10px; - overflow: hidden; -} -</style> - -<body> - -<div class="flexbox column"> - <div style="height: 1%"> - The height here should be ignored. - </div> -</div>
diff --git a/third_party/blink/web_tests/css3/flexbox/width-change-and-relayout-children.html b/third_party/blink/web_tests/css3/flexbox/width-change-and-relayout-children.html deleted file mode 100644 index 4a893fd6..0000000 --- a/third_party/blink/web_tests/css3/flexbox/width-change-and-relayout-children.html +++ /dev/null
@@ -1,38 +0,0 @@ -<!DOCTYPE html> -<html> -<head> -<link href="resources/flexbox.css" rel="stylesheet"> -<style> -.flexitem { - width: 100%; - height: 3em; - min-height: 3em; -} -.child { - background-color: salmon; -} -</style> -<script src="../../resources/testharness.js"></script> -<script src="../../resources/testharnessreport.js"></script> -<script src="../../resources/check-layout-th.js"></script> -</head> -<body> -<div id=log></div> -<div id="container" style="width: 100px" data-expected-width="200"> -<div class="flexbox column" data-expected-width="200"> - <div class="flexitem" data-expected-width="200"> - <div class="child" data-expected-width="200">This div should be 200px wide.</div> - </div> -</div> -</div> -<script> -var container = document.getElementById('container'); -container.offsetWidth; -container.style.width = "200px"; -window.onload = function() -{ - checkLayout("#container"); -}; -</script> -</body> -</html>
diff --git a/third_party/blink/web_tests/css3/flexbox/wrapping-column-dynamic-changes.html b/third_party/blink/web_tests/css3/flexbox/wrapping-column-dynamic-changes.html deleted file mode 100644 index 6be71f8..0000000 --- a/third_party/blink/web_tests/css3/flexbox/wrapping-column-dynamic-changes.html +++ /dev/null
@@ -1,35 +0,0 @@ -<!DOCTYPE html> -<html> -<link href="resources/flexbox.css" rel="stylesheet"> -<style> -.flexbox { - width: 600px; - height: 160px; - outline: 2px solid black; -} -.item { - height: 20px; - background-color: green; - margin: 5px; -} -</style> -<script src="../../resources/testharness.js"></script> -<script src="../../resources/testharnessreport.js"></script> -<script src="../../resources/check-layout-th.js"></script> -<body onload="checkLayout('.flexbox')"> -<div id=log></div> - -<p>The green boxes should all be within the black box</p> - -<div class="flexbox column wrap" id="test"> - <div class="item" data-expected-width="290"></div> - <div class="item" data-expected-width="290"></div> - <div class="item" data-expected-width="290"></div> - <div class="item" data-expected-width="290"></div> -</div> - -<script> -var flex = document.getElementById("test"); -flex.offsetWidth; -flex.style.height = "60px"; -</script>
diff --git a/third_party/blink/web_tests/external/WPT_BASE_MANIFEST_7.json b/third_party/blink/web_tests/external/WPT_BASE_MANIFEST_7.json index 9c0d1046..280692a 100644 --- a/third_party/blink/web_tests/external/WPT_BASE_MANIFEST_7.json +++ b/third_party/blink/web_tests/external/WPT_BASE_MANIFEST_7.json
@@ -64907,6 +64907,18 @@ {} ] ], + "css/css-overflow/text-overflow-ellipsis-002.html": [ + [ + "css/css-overflow/text-overflow-ellipsis-002.html", + [ + [ + "/css/css-overflow/reference/text-overflow-ellipsis-002-ref.html", + "==" + ] + ], + {} + ] + ], "css/css-overflow/text-overflow-ellipsis-rtl-001.html": [ [ "css/css-overflow/text-overflow-ellipsis-rtl-001.html", @@ -65399,6 +65411,30 @@ {} ] ], + "css/css-overflow/webkit-line-clamp-034.html": [ + [ + "css/css-overflow/webkit-line-clamp-034.html", + [ + [ + "/css/reference/blank.html", + "==" + ] + ], + {} + ] + ], + "css/css-overflow/webkit-line-clamp-035.html": [ + [ + "css/css-overflow/webkit-line-clamp-035.html", + [ + [ + "/css/css-overflow/reference/webkit-line-clamp-035-ref.html", + "==" + ] + ], + {} + ] + ], "css/css-overflow/webkit-line-clamp/webkit-line-clamp-with-line-height.tentative.html": [ [ "css/css-overflow/webkit-line-clamp/webkit-line-clamp-with-line-height.tentative.html", @@ -108425,6 +108461,18 @@ {} ] ], + "css/filter-effects/svg-relative-urls-0001.html": [ + [ + "css/filter-effects/svg-relative-urls-0001.html", + [ + [ + "/css/filter-effects/reference/svg-relative-urls-0001-ref.html", + "==" + ] + ], + {} + ] + ], "css/filter-effects/svg-sourcegraphic-currentcolor-dynamic-001.html": [ [ "css/filter-effects/svg-sourcegraphic-currentcolor-dynamic-001.html", @@ -150134,6 +150182,9 @@ "css/css-overflow/reference/text-overflow-ellipsis-001-ref.html": [ [] ], + "css/css-overflow/reference/text-overflow-ellipsis-002-ref.html": [ + [] + ], "css/css-overflow/reference/text-overflow-ellipsis-rtl-001-ref.html": [ [] ], @@ -150239,6 +150290,9 @@ "css/css-overflow/reference/webkit-line-clamp-032-ref.html": [ [] ], + "css/css-overflow/reference/webkit-line-clamp-035-ref.html": [ + [] + ], "css/css-overflow/webkit-line-clamp/webkit-line-clamp-with-line-height-ref.html": [ [] ], @@ -159218,6 +159272,9 @@ "css/filter-effects/reference/svg-feoffset-ref.html": [ [] ], + "css/filter-effects/reference/svg-relative-urls-0001-ref.html": [ + [] + ], "css/filter-effects/support/1x1-green.png": [ [] ], @@ -159260,12 +159317,18 @@ "css/filter-effects/support/cat.png": [ [] ], + "css/filter-effects/support/div-with-filter.html": [ + [] + ], "css/filter-effects/support/filter-external-002-filter.svg": [ [] ], "css/filter-effects/support/filtersubregion00.png": [ [] ], + "css/filter-effects/support/hueRotate.svg": [ + [] + ], "css/filter-effects/support/import-green.css": [ [] ], @@ -186845,9 +186908,6 @@ "webauthn/getcredential-extensions.https-expected.txt": [ [] ], - "webauthn/getcredential-passing.https-expected.txt": [ - [] - ], "webauthn/helpers.js": [ [] ], @@ -218894,6 +218954,12 @@ {} ] ], + "css/css-flexbox/canvas-dynamic-change-001.html": [ + [ + "css/css-flexbox/canvas-dynamic-change-001.html", + {} + ] + ], "css/css-flexbox/change-column-flex-width.html": [ [ "css/css-flexbox/change-column-flex-width.html", @@ -235558,6 +235624,12 @@ {} ] ], + "css/geometry/DOMQuad-nan.html": [ + [ + "css/geometry/DOMQuad-nan.html", + {} + ] + ], "css/geometry/DOMRect-001.html": [ [ "css/geometry/DOMRect-001.html", @@ -235570,6 +235642,12 @@ {} ] ], + "css/geometry/DOMRect-nan.html": [ + [ + "css/geometry/DOMRect-nan.html", + {} + ] + ], "css/geometry/DOMRectList.html": [ [ "css/geometry/DOMRectList.html", @@ -291377,6 +291455,14 @@ } ] ], + "pointerevents/pointerevent_lostpointercapture_for_disconnected_shadow_host.html": [ + [ + "pointerevents/pointerevent_lostpointercapture_for_disconnected_shadow_host.html", + { + "testdriver": true + } + ] + ], "pointerevents/pointerevent_lostpointercapture_is_first.html": [ [ "pointerevents/pointerevent_lostpointercapture_is_first.html", @@ -313855,6 +313941,12 @@ {} ] ], + "trust-tokens/trust-token-parameter-validation-xhr.tentative.https.html": [ + [ + "trust-tokens/trust-token-parameter-validation-xhr.tentative.https.html", + {} + ] + ], "trust-tokens/trust-token-parameter-validation.tentative.https.html": [ [ "trust-tokens/trust-token-parameter-validation.tentative.https.html", @@ -322561,6 +322653,15 @@ } ] ], + "webauthn/getcredential-rk-passing.https.html": [ + [ + "webauthn/getcredential-rk-passing.https.html", + { + "testdriver": true, + "timeout": "long" + } + ] + ], "webauthn/getcredential-timeout.https.html": [ [ "webauthn/getcredential-timeout.https.html", @@ -355452,7 +355553,7 @@ "support" ], "cookie-store/README.md": [ - "c406dcc774e0df8f7805c21cd7421fb0facedf28", + "b8a1d0a6098492b615dfae8a1e5e44ade8a2f3db", "support" ], "cookie-store/change_eventhandler_for_document_cookie.tentative.https.window.js": [ @@ -355476,7 +355577,7 @@ "testharness" ], "cookie-store/cookieListItem_attributes.tentative.https.any.js": [ - "4e5f9b02fc64b3707bd330ab729deb736274bb3a", + "1738b8709abfd3a8929ebef625274f4956ab0d75", "testharness" ], "cookie-store/cookieStoreManager_getSubscriptions_empty.tentative.https.any.js": [ @@ -355492,7 +355593,7 @@ "testharness" ], "cookie-store/cookieStore_delete_arguments.tentative.https.any.js": [ - "c0d4a328f5ce1ba09fa37d4322bd5f5447bdb6a0", + "76d4403ba8d59383730510990ff417e8f1ab6e0a", "testharness" ], "cookie-store/cookieStore_delete_basic.tentative.https.any.js": [ @@ -355560,7 +355661,7 @@ "testharness" ], "cookie-store/cookieStore_set_arguments.tentative.https.any.js": [ - "a82c36f96902c8335066fedf10f31fe4a8f68700", + "b9074c827d2a1ffa9b3ee1a0a28714396c4ae0d8", "testharness" ], "cookie-store/cookieStore_special_names.tentative.https.any.js": [ @@ -382159,6 +382260,10 @@ "3aa9ce6bdc304de010684856e511553a046543d0", "testharness" ], + "css/css-flexbox/canvas-dynamic-change-001.html": [ + "38aa0006d5799f684c16bcb893c6783f184a182e", + "testharness" + ], "css/css-flexbox/change-column-flex-width.html": [ "bea59bc2444758c778bad914d3c18c4f2eb1cf7c", "testharness" @@ -403975,6 +404080,10 @@ "814bfd6a2f8149e97709471510b3f77f0f72b756", "support" ], + "css/css-overflow/reference/text-overflow-ellipsis-002-ref.html": [ + "cf26b6b8c848521940936165002eb6aab46c068d", + "support" + ], "css/css-overflow/reference/text-overflow-ellipsis-rtl-001-ref.html": [ "5c75e38d8308ac81dcfe5eef7e18fd7ad56d6b3b", "support" @@ -404115,6 +404224,10 @@ "8f5b1ef53eb72dd82f1211744a21c34dede17b46", "support" ], + "css/css-overflow/reference/webkit-line-clamp-035-ref.html": [ + "f7488ba2ec6ebeae2d281b29586aaedb9effab97", + "support" + ], "css/css-overflow/scroll-overflow-padding-block-001.html": [ "13df853ab3462dff7db84d6558d4b941bf83995d", "testharness" @@ -404127,6 +404240,10 @@ "41c11d581e982c7de2d51d38b18decd99e8a60b3", "reftest" ], + "css/css-overflow/text-overflow-ellipsis-002.html": [ + "019e8902af09137954cff4c72aa2cf4cbb3f4e4d", + "reftest" + ], "css/css-overflow/text-overflow-ellipsis-rtl-001.html": [ "32284f89c2e5c4db774ba1a73fd3594f49606b06", "reftest" @@ -404291,6 +404408,14 @@ "261cf5b6b2478698cd50c25f6d6a437e6853e5b1", "reftest" ], + "css/css-overflow/webkit-line-clamp-034.html": [ + "acc66952f1a3b1a4997ac2c54c9ee7f2b1aa855a", + "reftest" + ], + "css/css-overflow/webkit-line-clamp-035.html": [ + "52b539d505f2913ad8d824fa2d403020bd4e9de1", + "reftest" + ], "css/css-overflow/webkit-line-clamp/webkit-line-clamp-with-line-height-ref.html": [ "c2c8914161af668cd57ce7ebac15b2100d93be8b", "support" @@ -440079,6 +440204,10 @@ "5623b08ecd71b292e698ee249a79b59d0046300f", "support" ], + "css/filter-effects/reference/svg-relative-urls-0001-ref.html": [ + "82f301f5f6ff95f743f2488093fe63ac766a84bf", + "support" + ], "css/filter-effects/support/1x1-green.png": [ "b98ca0ba0a03c580ac339e4a3653539cfa8edc71", "support" @@ -440135,6 +440264,10 @@ "85dd7324815b8f8ef1a1d0496224c1a0661db9d8", "support" ], + "css/filter-effects/support/div-with-filter.html": [ + "9a4d4105a8d50b55297783871e144a5858d7a33e", + "support" + ], "css/filter-effects/support/filter-external-002-filter.svg": [ "0d5fc65c6fdfe2b4f507326fb379e468dbe85d46", "support" @@ -440143,6 +440276,10 @@ "b6c4bccb63cd850f473a59d9e3c0cf26c699db13", "support" ], + "css/filter-effects/support/hueRotate.svg": [ + "ed294041e156d0087cd551aa593846bb3ec136fa", + "support" + ], "css/filter-effects/support/import-green.css": [ "537104e663364492c6ef388e4afce190e9c5bc58", "support" @@ -440275,6 +440412,10 @@ "3d8118b387d938b588e8e88ad5ec87a5343e4f72", "reftest" ], + "css/filter-effects/svg-relative-urls-0001.html": [ + "3edf7447b8f7fa0cf55f87a6ba051797bdd6f914", + "reftest" + ], "css/filter-effects/svg-sourcegraphic-currentcolor-dynamic-001.html": [ "e3be6544dc803ba7d9c69e9a1d906296c2c15301", "reftest" @@ -440460,7 +440601,7 @@ "testharness" ], "css/geometry/DOMMatrixInit-validate-fixup.html": [ - "b89b75205eb1f866fa0ea276b09387f8706e54ad", + "78eaa78e21bf887b4e79c57756f2a01688711240", "testharness" ], "css/geometry/DOMPoint-001.html": [ @@ -440472,13 +440613,17 @@ "testharness" ], "css/geometry/DOMQuad-001.html": [ - "9ca2a6d9d3d2e0cc21201835a2af763ece7749d6", + "42cb29fa95a0bb37119ce6faf35b7e726fbce629", "testharness" ], "css/geometry/DOMQuad-002.html": [ "5734be1f2938a2d4995c4b4b74ab9c7e5d807f59", "testharness" ], + "css/geometry/DOMQuad-nan.html": [ + "8d93d5ecfad500f352d7aca70bfde105a25c5901", + "testharness" + ], "css/geometry/DOMRect-001.html": [ "3055d8d26bca5d648760cf8ba70227ad8f1c0374", "testharness" @@ -440487,6 +440632,10 @@ "a5f0f88428f467d9211db58a2e3f2a9a628bd101", "testharness" ], + "css/geometry/DOMRect-nan.html": [ + "4a7cde5d330781eb7cebedd1a6f81c36553c4ad2", + "testharness" + ], "css/geometry/DOMRectList.html": [ "f3d050cd5f21b4e4a6f85b53621c6eabe3c76bb7", "testharness" @@ -455268,7 +455417,7 @@ "support" ], "feature-policy/experimental-features/resources/feature-policy-trust-token-redemption.html": [ - "2449df3abe2cb54e830976df127d6345692a9e83", + "cf6c98307aadacc202d0fbc4b8895145f00aab40", "support" ], "feature-policy/experimental-features/resources/focus_steal.html": [ @@ -455328,7 +455477,7 @@ "support" ], "feature-policy/experimental-features/trust-token-redemption-default-feature-policy.tentative.https.sub.html": [ - "efbb75aa4761b76ca5978cd33b9cf208eea4432f", + "c0485aa90d4c5237f04cc73f93eae36e2f89cad8", "testharness" ], "feature-policy/experimental-features/trust-token-redemption-supported-by-feature-policy.tentative.html": [ @@ -497035,6 +497184,10 @@ "f92daeb02e7c39fdedb60c58cd3eeb9085b7703a", "testharness" ], + "pointerevents/pointerevent_lostpointercapture_for_disconnected_shadow_host.html": [ + "26fa992f76109173d2e1ee166283056789388180", + "testharness" + ], "pointerevents/pointerevent_lostpointercapture_is_first.html": [ "6ce0f3e59a04db4ecf23d9fd60b57164ceb67f85", "testharness" @@ -519871,6 +520024,10 @@ "e2d0950d5e27aa9905a9c2e1ca26242ed57fee53", "testharness" ], + "trust-tokens/trust-token-parameter-validation-xhr.tentative.https.html": [ + "4a6c30c6d32424c9b1d3dce883d3f44862c6e3b6", + "testharness" + ], "trust-tokens/trust-token-parameter-validation.tentative.https.html": [ "c3a612724ee8a0216f64b7a66434736df9def9a4", "testharness" @@ -524955,12 +525112,12 @@ "820f9b529f16e5644d3d288f406db6e71a72cf34", "testharness" ], - "webauthn/getcredential-passing.https-expected.txt": [ - "9d58d1c155d94136a490b605fdf5538038322b5f", - "support" - ], "webauthn/getcredential-passing.https.html": [ - "c5237d2cda27e573ee591e95fdad92fae06e56a7", + "1af35aa9cb14327d3d1d4ea660b7380d6b0f65bd", + "testharness" + ], + "webauthn/getcredential-rk-passing.https.html": [ + "8c0254fee4258478e5920c30f693c84e07cfcb2e", "testharness" ], "webauthn/getcredential-timeout.https.html": [ @@ -524968,7 +525125,7 @@ "testharness" ], "webauthn/helpers.js": [ - "27abaaf4766c4a2fe85f1034be8df9145b712f75", + "c355d0586257b802c3f4a401c7ddedad16c860f9", "support" ], "webauthn/idlharness-manual.https.window.js": [
diff --git a/third_party/blink/web_tests/external/wpt/cookie-store/cookieStore_delete_arguments.tentative.https.any.js b/third_party/blink/web_tests/external/wpt/cookie-store/cookieStore_delete_arguments.tentative.https.any.js index 76d4403..c201065 100644 --- a/third_party/blink/web_tests/external/wpt/cookie-store/cookieStore_delete_arguments.tentative.https.any.js +++ b/third_party/blink/web_tests/external/wpt/cookie-store/cookieStore_delete_arguments.tentative.https.any.js
@@ -155,6 +155,17 @@ }, 'cookieStore.delete with missing / at the end of path'); promise_test(async testCase => { + const currentUrl = new URL(self.location.href); + const currentPath = currentUrl.pathname; + const currentDirectory = + currentPath.substr(0, currentPath.lastIndexOf('/') + 1); + const invalidPath = currentDirectory.substr(1); + + await promise_rejects_js(testCase, TypeError, cookieStore.delete( + { name: 'cookie-name', path: invalidPath })); +}, 'cookieStore.delete with path that does not start with /'); + +promise_test(async testCase => { await cookieStore.set('cookie-name', 'cookie-value'); testCase.add_cleanup(async () => { await cookieStore.delete('cookie-name');
diff --git a/third_party/blink/web_tests/external/wpt/css/css-animations/Document-getAnimations.tentative-expected.txt b/third_party/blink/web_tests/external/wpt/css/css-animations/Document-getAnimations.tentative-expected.txt index a39a5d0..71d24842 100644 --- a/third_party/blink/web_tests/external/wpt/css/css-animations/Document-getAnimations.tentative-expected.txt +++ b/third_party/blink/web_tests/external/wpt/css/css-animations/Document-getAnimations.tentative-expected.txt
@@ -5,7 +5,8 @@ PASS Order of CSS Animations - within an element PASS Order of CSS Animations - across elements PASS Order of CSS Animations - across and within elements -FAIL Order of CSS Animations - markup-bound vs free animations assert_equals: Markup-bound animations come first expected "animTop" but got "animLeft" +PASS Order of CSS Animations - markup-bound vs free animations +PASS Order of CSS Animations - free animation vs CSS Transitions FAIL Order of CSS Animations - free animations assert_equals: Free animations are returned in the order they are started expected object "[object CSSAnimation]" but got object "[object CSSAnimation]" PASS Order of CSS Animations and CSS Transitions PASS Finished but filling CSS Animations are returned
diff --git a/third_party/blink/web_tests/external/wpt/css/css-animations/Document-getAnimations.tentative.html b/third_party/blink/web_tests/external/wpt/css/css-animations/Document-getAnimations.tentative.html index b310875..4416735 100644 --- a/third_party/blink/web_tests/external/wpt/css/css-animations/Document-getAnimations.tentative.html +++ b/third_party/blink/web_tests/external/wpt/css/css-animations/Document-getAnimations.tentative.html
@@ -181,6 +181,29 @@ }, 'Order of CSS Animations - markup-bound vs free animations'); test(t => { + // Add an animation first + const div = addDiv(t, { style: 'animation: animLeft 100s' }); + const animLeft = document.getAnimations()[0]; + // Disassociate animLeft from markup and restart + div.style.animation = ''; + animLeft.play(); + + div.style.top = '0px'; + div.style.transition = 'all 100s'; + flushComputedStyle(div); + // *Then* add a transition + div.style.top = '100px'; + flushComputedStyle(div); + + // Although the transition was added later, it should come first in the list + const animations = document.getAnimations(); + assert_equals(animations.length, 2, + 'Both CSS animations and transitions are returned'); + assert_class_string(animations[0], 'CSSTransition', 'Transition comes first'); + assert_equals(animations[1], animLeft, 'Free animations come last'); +}, 'Order of CSS Animations - free animation vs CSS Transitions'); + +test(t => { const div = addDiv(t, { style: 'animation: animLeft 100s, animTop 100s' }); const animLeft = document.getAnimations()[0]; const animTop = document.getAnimations()[1];
diff --git a/third_party/blink/web_tests/external/wpt/css/css-backgrounds/background-position-three-four-values.html b/third_party/blink/web_tests/external/wpt/css/css-backgrounds/background-position-three-four-values.html new file mode 100644 index 0000000..b3a1314 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/css/css-backgrounds/background-position-three-four-values.html
@@ -0,0 +1,41 @@ +<!DOCTYPE html> +<html xmlns="http://www.w3.org/1999/xhtml"> +<head> + +<title>CSS Test: 'Background-position' with three and four values</title> +<link rel="help" href="http://www.w3.org/TR/css3-background/#background-position" /> +<meta name="assert" content="If three or four values are given to 'background-position', then each percentage or length value represents an offset from the edge specified by the preceeding keyword." /> +<link rel="match" href="reference/background-position-three-four-values-ref.html"> +<style type="text/css"> +div { + width: 200px; + height: 200px; + border: 2px solid black; + background-image: url("support/blue_color.png"); + background-repeat: no-repeat; + display: inline-block; +} +.test1 { + background-position: left 50px center; +} +.test2 { + background-position: right 25px top 75%; +} +.test3 { + background-position: left 25px bottom 75%; +} +.test4 { + background-position: right 25px bottom 25%; +} +</style> + +</head> +<body> + +<div class="test1"></div> +<div class="test2"></div> +<div class="test3"></div> +<div class="test4"></div> + +</body> +</html> \ No newline at end of file
diff --git a/third_party/blink/web_tests/external/wpt/css/css-backgrounds/background-position-xy-three-four-values-passthru.html b/third_party/blink/web_tests/external/wpt/css/css-backgrounds/background-position-xy-three-four-values-passthru.html new file mode 100644 index 0000000..e504ecca --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/css/css-backgrounds/background-position-xy-three-four-values-passthru.html
@@ -0,0 +1,51 @@ +<!DOCTYPE html> +<html xmlns="http://www.w3.org/1999/xhtml"> +<head> + +<title>CSS Test: 'Background-position' with three and four values</title> +<link rel="help" href="http://www.w3.org/TR/css3-background/#background-position" /> +<meta name="assert" content="background-position-x/y will round-trip serialized values even if the new three/four value syntax is used for background-position." /> +<link rel="match" href="reference/background-position-three-four-values-ref.html"> +<style type="text/css"> +div { + width: 200px; + height: 200px; + border: 2px solid black; + background-image: url("support/blue_color.png"); + background-repeat: no-repeat; + display: inline-block; +} +#test1 { + background-position: left 50px center; +} +#test2 { + background-position: right 25px top 75%; +} +#test3 { + background-position: left 25px bottom 75%; +} +#test4 { + background-position: right 25px bottom 25%; +} +</style> + +</head> +<body> + +<div id="test1"></div> +<div id="test2"></div> +<div id="test3"></div> +<div id="test4"></div> + +<script> +for (let id of ['test1','test2','test3','test4']) { + let d = document.getElementById(id); + let x = getComputedStyle(d).backgroundPositionX; + let y = getComputedStyle(d).backgroundPositionY; + d.style.backgroundPositionX = x; + d.style.backgroundPositionY = y; +} +</script> + +</body> +</html> \ No newline at end of file
diff --git a/third_party/blink/web_tests/external/wpt/css/css-backgrounds/background_position_three_four_values.htm b/third_party/blink/web_tests/external/wpt/css/css-backgrounds/background_position_three_four_values.htm deleted file mode 100644 index 1430c54..0000000 --- a/third_party/blink/web_tests/external/wpt/css/css-backgrounds/background_position_three_four_values.htm +++ /dev/null
@@ -1,39 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml"> - <head> - <title>CSS Test: 'Background-position' with three and four values</title> - <link rel="author" title="Microsoft" href="http://www.microsoft.com/" /> - <link rel="help" href="http://www.w3.org/TR/css3-background/#background-position" /> - <meta name="flags" content="" /> - <meta name="assert" content="If three or four values are given to 'background-position', then each percentage or length value represents an offset from the edge specified by the keyword." /> - <style type="text/css"> - div - { - width: 3in; - height: 2in; - border: thick solid black; - margin: 10px; - background-image: url("support/blue_color.png"); - background-repeat: no-repeat; - } - .reference - { - background-position: right center; - } - .test1 - { - background-position: left 2in center; - } - .test2 - { - background-position: left 2in top 50%; - } - </style> - </head> - <body> - <p>Test passes if the content of the three black boxes is identical.</p> - <div class="reference"></div> - <div class="test1"></div> - <div class="test2"></div> - </body> -</html> \ No newline at end of file
diff --git a/third_party/blink/web_tests/external/wpt/css/css-backgrounds/reference/background-position-three-four-values-ref.html b/third_party/blink/web_tests/external/wpt/css/css-backgrounds/reference/background-position-three-four-values-ref.html new file mode 100644 index 0000000..e721a2c0 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/css/css-backgrounds/reference/background-position-three-four-values-ref.html
@@ -0,0 +1,37 @@ +<!DOCTYPE html> +<html xmlns="http://www.w3.org/1999/xhtml"> +<head> + +<style type="text/css"> +div { + width: 200px; + height: 200px; + border: 2px solid black; + background-image: url("../support/blue_color.png"); + background-repeat: no-repeat; + display: inline-block; +} +.test1 { + background-position: 50px 50%; +} +.test2 { + background-position: 75% 75%; +} +.test3 { + background-position: 25px 25%; +} +.test4 { + background-position: 75% 75%; +} +</style> + +</head> +<body> + +<div class="test1"></div> +<div class="test2"></div> +<div class="test3"></div> +<div class="test4"></div> + +</body> +</html> \ No newline at end of file
diff --git a/third_party/blink/web_tests/external/wpt/css/css-flexbox/flex-item-vertical-align.html b/third_party/blink/web_tests/external/wpt/css/css-flexbox/flex-item-vertical-align.html new file mode 100644 index 0000000..be9b66d --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/css/css-flexbox/flex-item-vertical-align.html
@@ -0,0 +1,28 @@ +<!DOCTYPE html> +<link href="support/flexbox.css" rel="stylesheet"> +<title>CSS Flexbox: vertical-align on a flex item</title> +<link rel="help" href="https://drafts.csswg.org/css-flexbox/#flex-containers"> +<link rel="help" href="https://drafts.csswg.org/css-inline/#propdef-vertical-align"> +<link rel="match" href="reference/flex-item-vertical-align-ref.html"> +<meta name="assert" content="vertical-align should have no effect on a flex item, i.e. flex items' content should not be shifted by the vertical-align."> + +<style> +.flexbox { + background-color: lightgrey; +} +#item1 { + vertical-align: 10px; +} +#item3 { + vertical-align: 30px; +} +</style> + +<div class='flexbox'> + <!-- flex item: block child --> + <div id='item1'>block</div> + <!-- flex item: anonymous block box around inline content --> + anonymous item 2 + <!-- flex item: inline child --> + <span id='item3'>item 3</span> +</div>
diff --git a/third_party/blink/web_tests/css3/flexbox/z-index.html b/third_party/blink/web_tests/external/wpt/css/css-flexbox/flex-item-z-ordering-001.html similarity index 63% rename from third_party/blink/web_tests/css3/flexbox/z-index.html rename to third_party/blink/web_tests/external/wpt/css/css-flexbox/flex-item-z-ordering-001.html index 499e686..d7344eb 100644 --- a/third_party/blink/web_tests/css3/flexbox/z-index.html +++ b/third_party/blink/web_tests/external/wpt/css/css-flexbox/flex-item-z-ordering-001.html
@@ -1,17 +1,22 @@ <!DOCTYPE html> +<title>CSS Flexbox: z-index on non-positioned flex-items</title> +<link rel="help" href="https://drafts.csswg.org/css-flexbox/#painting"> +<link rel="bookmark" href="https://bugs.webkit.org/show_bug.cgi?id=91405"> +<link rel="match" href="reference/flex-item-z-ordering-001-ref.html"> +<meta name="assert" content="z-index on non-positioned flex-items works."> <style> .flex-item { width: 50px; height: 50px; } .positioned { - position: absolute; - left: 25px; + position: absolute; + left: 25px; height: 25px; - width: 50px; + width: 50px; } </style> -<div>This tests that z-index on non-positioned flex-items works. The green boxes should be above the orange boxes, which should be above the purple boxes, which are above the salmon boxes.<div> +<div>The green boxes should be above the orange boxes, which should be above the purple boxes, which are above the salmon boxes.<div> <div style="position:relative"> <div style="display:flex;"> <div class="flex-item" style="z-index: 1; background-color: salmon;"></div>
diff --git a/third_party/blink/web_tests/css3/flexbox/flex-one-sets-flex-basis-to-zero-px.html b/third_party/blink/web_tests/external/wpt/css/css-flexbox/flex-one-sets-flex-basis-to-zero-px.html similarity index 61% rename from third_party/blink/web_tests/css3/flexbox/flex-one-sets-flex-basis-to-zero-px.html rename to third_party/blink/web_tests/external/wpt/css/css-flexbox/flex-one-sets-flex-basis-to-zero-px.html index 26b2383..46b715f 100644 --- a/third_party/blink/web_tests/css3/flexbox/flex-one-sets-flex-basis-to-zero-px.html +++ b/third_party/blink/web_tests/external/wpt/css/css-flexbox/flex-one-sets-flex-basis-to-zero-px.html
@@ -1,12 +1,18 @@ <!DOCTYPE html> <html> -<link href="resources/flexbox.css" rel="stylesheet"> +<title>CSS Flexbox: flex-basis with zero pixel</title> +<link rel="help" href="https://drafts.csswg.org/css-flexbox/#flex-property"> +<link rel="stylesheet" type="text/css" href="/fonts/ahem.css" /> +<link href="support/flexbox.css" rel="stylesheet"> +<meta name="assert" content="This test ensures that setting 'flex-basis' property to +zero pixel or percentage in combination with one value of both 'flex-grow' and 'flex-shrink' +and 'writing-mode' value works properly."> <style> .flexbox > div { font-family: Ahem; font-size: 14px; } - + .flex-one-one-zero-percent { flex: 1 1 0%; min-width: 0; @@ -23,11 +29,10 @@ writing-mode: vertical-rl; } </style> -<script src="../../resources/testharness.js"></script> -<script src="../../resources/testharnessreport.js"></script> -<script src="../../resources/check-layout-th.js"></script> -<script src="../../resources/ahem.js"></script> -<body onload="checkLayout('.flexbox');"> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/resources/check-layout-th.js"></script> +<body onload="document.fonts.ready.then(() => { checkLayout('.flexbox'); })"> <div id=log></div> <div class="flexbox column"> <div class="flex-one" data-expected-height="14">Flex item with flex: 1</div>
diff --git a/third_party/blink/web_tests/external/wpt/css/css-flexbox/flexbox-flex-direction-column-percentage-ignored.html b/third_party/blink/web_tests/external/wpt/css/css-flexbox/flexbox-flex-direction-column-percentage-ignored.html new file mode 100644 index 0000000..037ef3e --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/css/css-flexbox/flexbox-flex-direction-column-percentage-ignored.html
@@ -0,0 +1,19 @@ +<!DOCTYPE html> +<title>CSS Flexbox: height of a child of a flexbox with flex-direction: column</title> +<link rel="help" href="https://drafts.csswg.org/css-flexbox/#definite-sizes"> +<link rel="bookmark" href="https://crbug.com/404337"> +<link rel="match" href="reference/flexbox-flex-direction-column-percentage-ignored-ref.html"> +<meta name="assert" content="This test ensures that the percentage height of child of a flexbox with 'flex-direction: column' and no explicit height but with max-height set should be treated as 'auto'."> +<link href="support/flexbox.css" rel="stylesheet"> +<style> +.flexbox { + max-height: 10px; + overflow: hidden; +} +</style> + +<div class="flexbox column"> + <div style="height: 1%"> + The height here should be ignored. + </div> +</div>
diff --git a/third_party/blink/web_tests/external/wpt/css/css-flexbox/flexbox_width-change-and-relayout-children.html b/third_party/blink/web_tests/external/wpt/css/css-flexbox/flexbox_width-change-and-relayout-children.html new file mode 100644 index 0000000..a5f086d --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/css/css-flexbox/flexbox_width-change-and-relayout-children.html
@@ -0,0 +1,40 @@ +<!DOCTYPE html> +<html> +<head> +<title>CSS Flexbox: Flex children width when the parent width is changed</title> +<link rel="help" href="https://drafts.csswg.org/css-flexbox/#flex-containers"> +<link rel="help" href="https://drafts.csswg.org/css-flexbox/#flex-direction-property"> +<link rel="bookmark" href="https://bugs.webkit.org/show_bug.cgi?id=108231"> +<meta name="assert" content="Flexbox should relayout flex children when width changes."> +<link href="support/flexbox.css" rel="stylesheet"> +<style> +.flexitem { + width: 100%; + height: 3em; + min-height: 3em; +} +.child { + background-color: salmon; +} +</style> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/resources/check-layout-th.js"></script> +</head> +<body> +<div id=log></div> +<div id="container" style="width: 100px" data-expected-width="200"> +<div class="flexbox column" data-expected-width="200"> + <div class="flexitem" data-expected-width="200"> + <div class="child" data-expected-width="200">This div should be 200px wide.</div> + </div> +</div> +</div> +<script> +var container = document.getElementById('container'); +container.offsetWidth; +container.style.width = "200px"; +checkLayout("#container"); +</script> +</body> +</html>
diff --git a/third_party/blink/web_tests/external/wpt/css/css-flexbox/flexbox_width-wrapping-column.html b/third_party/blink/web_tests/external/wpt/css/css-flexbox/flexbox_width-wrapping-column.html new file mode 100644 index 0000000..2b55559b --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/css/css-flexbox/flexbox_width-wrapping-column.html
@@ -0,0 +1,44 @@ +<!DOCTYPE html> +<html> +<title>CSS Flexbox: the width calculation of flexbox with flex-direction: column and flex-wrap: wrap</title> +<link rel="help" href="https://drafts.csswg.org/css-flexbox/#flex-containers"> +<link rel="help" href="https://drafts.csswg.org/css-flexbox/#flex-direction-property"> +<link rel="help" href="https://drafts.csswg.org/css-flexbox/#flex-wrap-property"> +<link rel="bookmark" href="https://crbug.com/607262"> +<link rel="bookmark" href="https://crbug.com/607856"> +<meta name="assert" content="This test ensures that the width of a flexbox with 'flex-direction: column' and 'flex-wrap: wrap' is updated when the wrapping column dynamically changes."> +<link href="support/flexbox.css" rel="stylesheet"> +<style> +.flexbox { + width: 600px; + height: 160px; + outline: 2px solid black; +} +.item { + height: 20px; + background-color: green; + margin: 5px; +} +</style> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/resources/check-layout-th.js"></script> +<script> +function change() { + var flex = document.getElementById("test"); + flex.offsetWidth; + flex.style.height = "60px"; + checkLayout('.flexbox'); +} +</script> +<body onload="change()"> +<div id=log></div> + +<p>The green boxes should all be within the black box</p> + +<div class="flexbox column wrap" id="test"> + <div class="item" data-expected-width="290"></div> + <div class="item" data-expected-width="290"></div> + <div class="item" data-expected-width="290"></div> + <div class="item" data-expected-width="290"></div> +</div>
diff --git a/third_party/blink/web_tests/external/wpt/css/css-flexbox/multiline-min-preferred-width.html b/third_party/blink/web_tests/external/wpt/css/css-flexbox/multiline-min-preferred-width.html new file mode 100644 index 0000000..b5974aa --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/css/css-flexbox/multiline-min-preferred-width.html
@@ -0,0 +1,36 @@ +<!DOCTYPE html> +<html> +<head> +<title>CSS Flexbox: nested multiline (wrapping) flex boxes.</title> +<link rel="stylesheet" href="support/flexbox.css" > +<link rel="help" href="https://www.w3.org/TR/css-flexbox-1/#flex-wrap-property"> +<meta name="assert" content="This test ensures that nested multiline flex boxes with 'flex-wrap: wrap' and the min preferred width set are laid out properly."/> +<style> +.item { + padding: 7px; + background-color: green; + border: 4px solid olive; + width: min-content; +} + +.square { + background-color: lime; + width: 20px; + height: 20px; +} +</style> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/resources/check-layout-th.js"></script> +</head> +<body onload="checkLayout('.container')"> +<div id=log></div> + +<div class="container flexbox wrap" data-expected-height=42> + <div class="item flexbox wrap" data-expected-width=42 data-expected-height=42> + <div class="square" data-expected-width=20 data-expected-height=20></div> + </div> +</div> + +</body> +</html>
diff --git a/third_party/blink/web_tests/external/wpt/css/css-flexbox/multiline-reverse-wrap-baseline.html b/third_party/blink/web_tests/external/wpt/css/css-flexbox/multiline-reverse-wrap-baseline.html new file mode 100644 index 0000000..310ad28 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/css/css-flexbox/multiline-reverse-wrap-baseline.html
@@ -0,0 +1,57 @@ +<!DOCTYPE html> +<html> +<title>CSS Flexbox: multiline reverse wrap baseline.</title> +<link rel="help" href="https://www.w3.org/TR/css-flexbox-1/#flex-wrap-property"> +<link rel="match" href="reference/multiline-reverse-wrap-baseline-ref.html"> +<meta name="assert" content="This test ensures that 'flex-wrap: wrap-reverse' flips the cross axis directions and items with baseline alignment are aligned to cross axis start."/> +<style> +.flexbox { + width: 200px; + display: flex; + background-color: #aaa; + position: relative; + flex-wrap: wrap-reverse; + align-items: baseline; + margin-bottom: 10px; +} +.flexbox > div { + border: 0; +} + +.flexbox :nth-child(1) { + background-color: lightblue; +} +.flexbox :nth-child(2) { + background-color: lightgreen; +} +.flexbox :nth-child(3) { + background-color: pink; +} +.flexbox :nth-child(4) { + background-color: yellow; +} +</style> +<body> + +<div class="flexbox"> + <div style="flex: 1 0 100px;">first<br>first<br>first</div> + <div style="flex: 1 0 100px;">second</div> + <div style="flex: 1 0 100px; margin-top: 5px">third</div> + <div style="flex: 1 0 100px;">fourth<br>fourth</div> +</div> + +<div class="flexbox"> + <div style="flex: 1 0 100px;">first<br>first<br>first</div> + <div style="flex: 1 0 100px;">second</div> + <div style="flex: 1 0 100px;">third</div> + <div style="flex: 1 0 100px; margin-bottom: 5px">fourth<br>fourth</div> +</div> + +<div class="flexbox" style="width: 300px;"> + <div style="flex: 1 0 100px; align-self: flex-start; height: 100px">first</div> + <div style="flex: 1 0 100px;">second</div> + <div style="flex: 1 0 100px;">third<br>third</div> +</div> + +</body> +</html>
diff --git a/third_party/blink/web_tests/css3/flexbox/multiline-shrink-to-fit.html b/third_party/blink/web_tests/external/wpt/css/css-flexbox/multiline-shrink-to-fit.html similarity index 71% rename from third_party/blink/web_tests/css3/flexbox/multiline-shrink-to-fit.html rename to third_party/blink/web_tests/external/wpt/css/css-flexbox/multiline-shrink-to-fit.html index 7943283..e2a65a5 100644 --- a/third_party/blink/web_tests/css3/flexbox/multiline-shrink-to-fit.html +++ b/third_party/blink/web_tests/external/wpt/css/css-flexbox/multiline-shrink-to-fit.html
@@ -1,33 +1,36 @@ <!DOCTYPE html> <html> +<title>CSS Flexbox: multiline column flexboxes and shrink-to-fit.</title> +<link rel="help" href="https://www.w3.org/TR/css-flexbox-1/#intrinsic-sizes"> +<link rel="match" href="reference/multiline-shrink-to-fit-ref.html"> +<meta name="assert" content="This test ensures that multiline column flexboxes shrink-to-fit works properly."/> <style> .flexbox { - display: flex; - background-color: #aaa; - position: relative; - flex-wrap: wrap; - flex-direction: column; - float: left; - align-content: flex-start; + display: flex; + background-color: #aaa; + position: relative; + flex-wrap: wrap; + flex-direction: column; + float: left; + align-content: flex-start; } .flexbox > * { - flex: none; + flex: none; } .flexbox :nth-child(1) { - background-color: lightblue; + background-color: lightblue; } .flexbox :nth-child(2) { - background-color: lightgreen; + background-color: lightgreen; } .flexbox :nth-child(3) { - background-color: pink; + background-color: pink; } .flexbox :nth-child(4) { - background-color: yellow; + background-color: yellow; } </style> <body> -<p>Test to make sure that multiline column flexboxes shrink-to-fit properly.</p> <div class="flexbox"> <div style="width: 100px; height: 20px"></div>
diff --git a/third_party/blink/web_tests/external/wpt/css/css-flexbox/reference/flex-item-vertical-align-ref.html b/third_party/blink/web_tests/external/wpt/css/css-flexbox/reference/flex-item-vertical-align-ref.html new file mode 100644 index 0000000..82d7a6e --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/css/css-flexbox/reference/flex-item-vertical-align-ref.html
@@ -0,0 +1,17 @@ +<!DOCTYPE html> +<link href="../support/flexbox.css" rel="stylesheet"> + +<style> +.flexbox { + background-color: lightgrey; +} +</style> + +<div class='flexbox'> + <!-- flex item: block child --> + <div>block</div> + <!-- flex item: anonymous block box around inline content --> + anonymous item 2 + <!-- flex item: inline child --> + <span>item 3</span> +</div>
diff --git a/third_party/blink/web_tests/css3/flexbox/z-index-expected.html b/third_party/blink/web_tests/external/wpt/css/css-flexbox/reference/flex-item-z-ordering-001-ref.html similarity index 82% rename from third_party/blink/web_tests/css3/flexbox/z-index-expected.html rename to third_party/blink/web_tests/external/wpt/css/css-flexbox/reference/flex-item-z-ordering-001-ref.html index 2404e995..a97de6e 100644 --- a/third_party/blink/web_tests/css3/flexbox/z-index-expected.html +++ b/third_party/blink/web_tests/external/wpt/css/css-flexbox/reference/flex-item-z-ordering-001-ref.html
@@ -13,7 +13,7 @@ width: 50px; } </style> -<div>This tests that z-index on non-positioned flex-items works. The green boxes should be above the orange boxes, which should be above the purple boxes, which are above the salmon boxes.<div> +<div>The green boxes should be above the orange boxes, which should be above the purple boxes, which are above the salmon boxes.<div> <div class="container" style="position:relative"> <div class="large" style="z-index: 1; background-color: salmon;"></div> <div class="large" style="z-index: 100; background-color: orange; left: 50px;"></div>
diff --git a/third_party/blink/web_tests/css3/flexbox/vertical-flexbox-percentage-ignored-expected.html b/third_party/blink/web_tests/external/wpt/css/css-flexbox/reference/flexbox-flex-direction-column-percentage-ignored-ref.html similarity index 100% rename from third_party/blink/web_tests/css3/flexbox/vertical-flexbox-percentage-ignored-expected.html rename to third_party/blink/web_tests/external/wpt/css/css-flexbox/reference/flexbox-flex-direction-column-percentage-ignored-ref.html
diff --git a/third_party/blink/web_tests/css3/flexbox/multiline-reverse-wrap-baseline-expected.html b/third_party/blink/web_tests/external/wpt/css/css-flexbox/reference/multiline-reverse-wrap-baseline-ref.html similarity index 90% rename from third_party/blink/web_tests/css3/flexbox/multiline-reverse-wrap-baseline-expected.html rename to third_party/blink/web_tests/external/wpt/css/css-flexbox/reference/multiline-reverse-wrap-baseline-ref.html index 368e1d0..d4911b3 100644 --- a/third_party/blink/web_tests/css3/flexbox/multiline-reverse-wrap-baseline-expected.html +++ b/third_party/blink/web_tests/external/wpt/css/css-flexbox/reference/multiline-reverse-wrap-baseline-ref.html
@@ -15,8 +15,6 @@ </style> </head> <body> -<p>Test to make sure that wrap-reverse flips the cross axis directions and items -with baseline alignment are aligned to cross axis start.</p> <table style="background-color: #aaa"> <tr><td colspan=2 style="height: 5px"></td></tr>
diff --git a/third_party/blink/web_tests/css3/flexbox/multiline-shrink-to-fit-expected.html b/third_party/blink/web_tests/external/wpt/css/css-flexbox/reference/multiline-shrink-to-fit-ref.html similarity index 95% rename from third_party/blink/web_tests/css3/flexbox/multiline-shrink-to-fit-expected.html rename to third_party/blink/web_tests/external/wpt/css/css-flexbox/reference/multiline-shrink-to-fit-ref.html index 8cf1c11..1429b251 100644 --- a/third_party/blink/web_tests/css3/flexbox/multiline-shrink-to-fit-expected.html +++ b/third_party/blink/web_tests/external/wpt/css/css-flexbox/reference/multiline-shrink-to-fit-ref.html
@@ -31,7 +31,6 @@ </style> <body> -<p>Test to make sure that multiline column flexboxes shrink-to-fit properly.</p> <div class="testcase" style="height: 60px; width: 100px"> <div style="width: 100px; height: 20px"></div>
diff --git a/third_party/blink/web_tests/css3/flexbox/stretching-orthogonal-flows-expected.html b/third_party/blink/web_tests/external/wpt/css/css-flexbox/reference/stretching-orthogonal-flows-ref.html similarity index 100% rename from third_party/blink/web_tests/css3/flexbox/stretching-orthogonal-flows-expected.html rename to third_party/blink/web_tests/external/wpt/css/css-flexbox/reference/stretching-orthogonal-flows-ref.html
diff --git a/third_party/blink/web_tests/css3/flexbox/text-overflow-on-flexbox-expected.html b/third_party/blink/web_tests/external/wpt/css/css-flexbox/reference/text-overflow-on-flexbox-001-ref.html similarity index 100% rename from third_party/blink/web_tests/css3/flexbox/text-overflow-on-flexbox-expected.html rename to third_party/blink/web_tests/external/wpt/css/css-flexbox/reference/text-overflow-on-flexbox-001-ref.html
diff --git a/third_party/blink/web_tests/external/wpt/css/css-flexbox/shrinking-column-flexbox.html b/third_party/blink/web_tests/external/wpt/css/css-flexbox/shrinking-column-flexbox.html new file mode 100644 index 0000000..680dc7e --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/css/css-flexbox/shrinking-column-flexbox.html
@@ -0,0 +1,54 @@ +<!DOCTYPE html> +<title>CSS Flexbox: Shrink column</title> +<link rel="help" href="https://drafts.csswg.org/css-flexbox/#flex-property"> +<link href="support/flexbox.css" rel="stylesheet"> +<meta name="assert" content="This test ensures that flexbox shrinks the column height of a flex item +after applying a new style."> +<style> +body { + width: 800px; + height: 600px; +} + +.green { + background: green; +} + +.blue { + background: blue; +} + +.inner { + height: 200px; +} + +.small { + height: 100px; +} +</style> + +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/resources/check-layout-th.js"></script> + +<script> +onload = function() { + document.body.offsetWidth; + document.getElementById("target").classList.add("small"); + + checkLayout("body"); +}; +</script> + +<body class="flexbox column"> + +<div class="flexbox column flex-one-one-auto"> + <div class="flex-one-one-auto green" data-expected-height="250" id="target"> + <div class="inner"></div> + </div> + <div class="flex-one-one-auto blue" data-expected-height="350"> + <div class="inner"></div> + </div> +</div> + +<div id=log></div>
diff --git a/third_party/blink/web_tests/external/wpt/css/css-flexbox/stretch-after-sibling-size-change.html b/third_party/blink/web_tests/external/wpt/css/css-flexbox/stretch-after-sibling-size-change.html new file mode 100644 index 0000000..918ac38 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/css/css-flexbox/stretch-after-sibling-size-change.html
@@ -0,0 +1,27 @@ +<!DOCTYPE html> +<html> +<head> +<title>CSS Flexbox: Stretch after sibling size is changed</title> +<link rel="help" href="https://drafts.csswg.org/css-flexbox/#flex-property"> +<link href="support/flexbox.css" rel="stylesheet"> +<meta name="assert" content="This test ensures that flexbox stretches flex items +after a flex item height is changed."> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/resources/check-layout-th.js"></script> +<script> +window.onload = function() +{ + document.getElementById("a").style.height = "20px"; + checkLayout(".flexbox"); +}; +</script> +</head> +<body> +<div id=log></div> +<div data-expected-width="100" data-expected-height="20" class="flexbox" style="width: 100px"> + <div id=a class="flex-one" data-expected-width="50" data-expected-height="20" style="background-color: blue; height: 30px;"></div> + <div id=b class="flex-one" data-expected-width="50" data-expected-height="20" style="background-color: green"></div> +</div> +</body> +</html>
diff --git a/third_party/blink/web_tests/css3/flexbox/stretched-child-shrink-on-relayout.html b/third_party/blink/web_tests/external/wpt/css/css-flexbox/stretched-child-shrink-on-relayout.html similarity index 74% rename from third_party/blink/web_tests/css3/flexbox/stretched-child-shrink-on-relayout.html rename to third_party/blink/web_tests/external/wpt/css/css-flexbox/stretched-child-shrink-on-relayout.html index a6b8967fe..b427d7f 100644 --- a/third_party/blink/web_tests/css3/flexbox/stretched-child-shrink-on-relayout.html +++ b/third_party/blink/web_tests/external/wpt/css/css-flexbox/stretched-child-shrink-on-relayout.html
@@ -1,4 +1,8 @@ <!DOCTYPE html> +<title>CSS Flexbox: Shrink stretched child on relayout</title> +<link rel="help" href="https://drafts.csswg.org/css-flexbox/#flex-property"> +<link rel="help" href="https://drafts.csswg.org/css-flexbox/#flex-flow-property"> +<meta name="assert" content="This ensures that flexbox shrinks stretched children after removing a sibling, in various writing-modes and flows."> <style> .flexbox { display: flex; @@ -33,9 +37,9 @@ } </style> </head> -<script src="../../resources/testharness.js"></script> -<script src="../../resources/testharnessreport.js"></script> -<script src="../../resources/check-layout-th.js"></script> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/resources/check-layout-th.js"></script> <body onload="checkLayout('.flexbox')"> <div id=log></div>
diff --git a/third_party/blink/web_tests/external/wpt/css/css-flexbox/stretching-orthogonal-flows.html b/third_party/blink/web_tests/external/wpt/css/css-flexbox/stretching-orthogonal-flows.html new file mode 100644 index 0000000..acaa787f --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/css/css-flexbox/stretching-orthogonal-flows.html
@@ -0,0 +1,15 @@ +<!DOCTYPE html> +<title>CSS Flexbox: Stretch alignment for children with orthogonal flows</title> +<link rel="help" href="https://drafts.csswg.org/css-flexbox/#flex-property"> +<link rel="help" href="https://drafts.csswg.org/css-flexbox/#align-items-property"> +<link rel="match" href="reference/stretching-orthogonal-flows-ref.html"> +<link href="support/flexbox.css" rel="stylesheet"> +<meta name="assert" content="The test ensures that the stretch alignment of flex items work +similarly with both parallel and orthogonal flows."> + +<p>You should see no red.</p> + +<div class="flexbox column align-items-stretch" style="background-color: red;"> + <div style="background-color: green; height: 20px;"></div> + <div style="writing-mode: vertical-lr; background-color: green; height: 20px;"></div> +</div>
diff --git a/third_party/blink/web_tests/external/wpt/css/css-flexbox/text-overflow-on-flexbox-001.html b/third_party/blink/web_tests/external/wpt/css/css-flexbox/text-overflow-on-flexbox-001.html new file mode 100644 index 0000000..ba043099 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/css/css-flexbox/text-overflow-on-flexbox-001.html
@@ -0,0 +1,31 @@ +<!DOCTYPE html> +<html> +<head> +<title>CSS Flexbox: text-overflow in flexbox</title> +<link rel="help" href="https://drafts.csswg.org/css-flexbox/#flex-containers"> +<link rel="match" href="reference/text-overflow-on-flexbox-001-ref.html"> +<meta name="assert" content="This test ensures that the text-overflow on flexbox should have no effect"/> +<style> +div.flex { + display: flex; + width: 100px; + overflow: hidden; + text-overflow: ellipsis; +} +</style> +</head> +<body> + <div class="flex"> + AAAAAAAAAAAAAAAAAAAA + </div> + <div class="flex"> + <b>bbbbbbbbbbbbbbbbbbbb</b> + </div> + <div class="flex"> + <div>cccccccccccccccccccc</div> + </div> + <div class="flex"> + DDDDDDDDDDDDDDDDDDDD<b>ee</b>FFFFFFFFFFFFFFFFFFFF + </div> +</body> +</html>
diff --git a/third_party/blink/web_tests/external/wpt/css/css-grid/placement/grid-placement-using-named-grid-lines-007.html b/third_party/blink/web_tests/external/wpt/css/css-grid/placement/grid-placement-using-named-grid-lines-007.html new file mode 100644 index 0000000..4e6c4cc --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/css/css-grid/placement/grid-placement-using-named-grid-lines-007.html
@@ -0,0 +1,57 @@ +<!DOCTYPE html> +<meta charset="utf-8"> +<title>CSS Grid Layout Test: Grid item placement with dynamically named grid lines</title> +<link rel="author" title="Oriol Brufau" href="mailto:obrufau@igalia.com"> +<link rel="help" href="http://www.w3.org/TR/css-grid-1/#line-placement"> +<link rel="match" href="../../reference/ref-filled-green-300px-square.html"> +<meta name="assert" content="Grid item placement is updated when the names of the grid lines change dynamically."> +<style> +.container { + display: grid; + width: 300px; + height: 100px; + background: red; +} +.container::before { + content: ""; + grid-area: main; + background: green; +} +.explicit { + grid-template-columns: [quux-start] 100% [quux-end]; + grid-template-rows: [quux-start] 100% [quux-end]; +} +.explicit.changed { + grid-template-columns: [main-start] 100% [main-end]; + grid-template-rows: [main-start] 100% [main-end]; +} +.auto-repeat { + grid-template-columns: repeat(auto-fill, [quux-start] 100% [quux-end]); + grid-template-rows: repeat(auto-fill, [quux-start] 100% [quux-end]); +} +.auto-repeat.changed { + grid-template-columns: repeat(auto-fill, [main-start] 100% [main-end]); + grid-template-rows: repeat(auto-fill, [main-start] 100% [main-end]); +} +.implicit { + grid-template-columns: 100%; + grid-template-rows: 100%; + grid-template-areas: "quux"; +} +.implicit.changed { + grid-template-areas: "main"; +} +</style> +<p>Test passes if there is a filled green square and <strong>no red</strong>.</p> +<div class="container explicit"></div> +<div class="container auto-repeat"></div> +<div class="container implicit"></div> +<script> +// Force layout +document.body.offsetLeft; + +// Change the grid line names +for (let container of document.querySelectorAll(".container")) { + container.classList.add("changed"); +} +</script>
diff --git a/third_party/blink/web_tests/external/wpt/css/css-images/image-orientation/image-orientation-background-properties.html b/third_party/blink/web_tests/external/wpt/css/css-images/image-orientation/image-orientation-background-properties.html new file mode 100644 index 0000000..45651286 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/css/css-images/image-orientation/image-orientation-background-properties.html
@@ -0,0 +1,55 @@ +<!DOCTYPE html> +<html> +<head> +<meta charset="utf-8"> +<title>CSS Images Module Level 3: image-orientation with background properties</title> +<link rel="author" title="Stephen Chenney" href="mailto:schenney@chromium.org"> +<link rel="help" href="https://drafts.csswg.org/css-images-3/#propdef-image-orientation"> +<link rel="match" href="reference/image-orientation-background-properties-ref.html"> +<meta name=fuzzy content="10;100"> +<style> + div { + position: absolute; + width: 200px; + height: 200PX; + vertical-align: top; + background-image: url(support/exif-orientation-5-lu.jpg); + background-repeat: no-repeat; + } + + .repeat { + background-repeat: repeat; + top: 20px; + left: 20px; + } + + .position { + background-position: bottom right; + top: 20px; + left: 240px; + } + + .cover { + background-size: cover; + top: 240px; + left: 20px; + } + + .contain { + background-size: contain; + top: 240px; + left: 240px; + } +</style> +</head> +<body> + <div class="repeat"> + </div> + <div class="position"> + </div> + <div class="cover"> + </div> + <div class="contain"> + </div> +</body> +</html>
diff --git a/third_party/blink/web_tests/external/wpt/css/css-images/image-orientation/image-orientation-default.html b/third_party/blink/web_tests/external/wpt/css/css-images/image-orientation/image-orientation-default.html index 36fb1a6..8a16ff7 100644 --- a/third_party/blink/web_tests/external/wpt/css/css-images/image-orientation/image-orientation-default.html +++ b/third_party/blink/web_tests/external/wpt/css/css-images/image-orientation/image-orientation-default.html
@@ -11,9 +11,6 @@ body { overflow: hidden; } - img { - border: 1px solid black; - } div { display: inline-block; width: 100px;
diff --git a/third_party/blink/web_tests/external/wpt/css/css-images/image-orientation/image-orientation-from-image-composited-dynamic1.html b/third_party/blink/web_tests/external/wpt/css/css-images/image-orientation/image-orientation-from-image-composited-dynamic1.html index 26db7da..69043ee 100644 --- a/third_party/blink/web_tests/external/wpt/css/css-images/image-orientation/image-orientation-from-image-composited-dynamic1.html +++ b/third_party/blink/web_tests/external/wpt/css/css-images/image-orientation/image-orientation-from-image-composited-dynamic1.html
@@ -12,7 +12,6 @@ overflow: hidden;} img { will-change: transform; - border: 1px solid black; image-orientation: none; } div {
diff --git a/third_party/blink/web_tests/external/wpt/css/css-images/image-orientation/image-orientation-from-image-composited-dynamic2.html b/third_party/blink/web_tests/external/wpt/css/css-images/image-orientation/image-orientation-from-image-composited-dynamic2.html index f6474af..b23ef385 100644 --- a/third_party/blink/web_tests/external/wpt/css/css-images/image-orientation/image-orientation-from-image-composited-dynamic2.html +++ b/third_party/blink/web_tests/external/wpt/css/css-images/image-orientation/image-orientation-from-image-composited-dynamic2.html
@@ -13,7 +13,6 @@ } img { will-change: transform; - border: 1px solid black; image-orientation: from-image; } div {
diff --git a/third_party/blink/web_tests/external/wpt/css/css-images/image-orientation/image-orientation-from-image-composited.html b/third_party/blink/web_tests/external/wpt/css/css-images/image-orientation/image-orientation-from-image-composited.html index 596e497e..7caa91d 100644 --- a/third_party/blink/web_tests/external/wpt/css/css-images/image-orientation/image-orientation-from-image-composited.html +++ b/third_party/blink/web_tests/external/wpt/css/css-images/image-orientation/image-orientation-from-image-composited.html
@@ -14,7 +14,6 @@ } img { will-change: transform; - border: 1px solid black; } div { display: inline-block;
diff --git a/third_party/blink/web_tests/external/wpt/css/css-images/image-orientation/image-orientation-from-image-computed-style.html b/third_party/blink/web_tests/external/wpt/css/css-images/image-orientation/image-orientation-from-image-computed-style.html index 3293324..a8ded7c2 100644 --- a/third_party/blink/web_tests/external/wpt/css/css-images/image-orientation/image-orientation-from-image-computed-style.html +++ b/third_party/blink/web_tests/external/wpt/css/css-images/image-orientation/image-orientation-from-image-computed-style.html
@@ -10,7 +10,8 @@ <style> body { overflow: hidden; - image-orientation: from-image;} + image-orientation: from-image; + } div { display: inline-block; width: 100px;
diff --git a/third_party/blink/web_tests/external/wpt/css/css-images/image-orientation/image-orientation-from-image-content-images.html b/third_party/blink/web_tests/external/wpt/css/css-images/image-orientation/image-orientation-from-image-content-images.html index 36a2a34..5b89216 100644 --- a/third_party/blink/web_tests/external/wpt/css/css-images/image-orientation/image-orientation-from-image-content-images.html +++ b/third_party/blink/web_tests/external/wpt/css/css-images/image-orientation/image-orientation-from-image-content-images.html
@@ -10,7 +10,6 @@ <style> div.image { display: inline-block; - border: 1px solid black; } div.container { display: inline-block;
diff --git a/third_party/blink/web_tests/external/wpt/css/css-images/image-orientation/image-orientation-from-image-dynamic1.html b/third_party/blink/web_tests/external/wpt/css/css-images/image-orientation/image-orientation-from-image-dynamic1.html index 15e05884..d1617a640 100644 --- a/third_party/blink/web_tests/external/wpt/css/css-images/image-orientation/image-orientation-from-image-dynamic1.html +++ b/third_party/blink/web_tests/external/wpt/css/css-images/image-orientation/image-orientation-from-image-dynamic1.html
@@ -12,7 +12,6 @@ overflow: hidden; } img { - border: 1px solid black; image-orientation: none; } div {
diff --git a/third_party/blink/web_tests/external/wpt/css/css-images/image-orientation/image-orientation-from-image-dynamic2.html b/third_party/blink/web_tests/external/wpt/css/css-images/image-orientation/image-orientation-from-image-dynamic2.html index c0df221..5a37a96 100644 --- a/third_party/blink/web_tests/external/wpt/css/css-images/image-orientation/image-orientation-from-image-dynamic2.html +++ b/third_party/blink/web_tests/external/wpt/css/css-images/image-orientation/image-orientation-from-image-dynamic2.html
@@ -12,7 +12,6 @@ overflow: hidden; } img { - border: 1px solid black; image-orientation: from-image; } div {
diff --git a/third_party/blink/web_tests/external/wpt/css/css-images/image-orientation/image-orientation-from-image-embedded-content.html b/third_party/blink/web_tests/external/wpt/css/css-images/image-orientation/image-orientation-from-image-embedded-content.html new file mode 100644 index 0000000..d153935 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/css/css-images/image-orientation/image-orientation-from-image-embedded-content.html
@@ -0,0 +1,46 @@ +<!DOCTYPE html> +<html> +<head> +<meta charset="utf-8"> +<title>CSS Images Module Level 3: image-orientation: from-image in embedded content</title> +<link rel="author" title="Stephen Chenney" href="mailto:schenney@chromium.org"> +<link rel="help" href="https://drafts.csswg.org/css-images-3/#propdef-image-orientation"> +<link rel="match" href="reference/image-orientation-from-image-embedded-content-ref.html"> +<meta name=fuzzy content="10;100"> +<style> + iframe { + display: inline-block; + width: 120px; + height: 110px; + vertical-align: top; + image-orientation: from-image; + } + embed { + object-fit: none; + object-position: top left; + image-orientation: from-image; + } + object { + object-fit: none; + object-position: top left; + image-orientation: from-image; + } +</style> +</head> +<body> + <p>The images should rotate respecting their EXIF orientation because image + documents always respect the orientation, regardless of the image-orientation + property.</p> + <iframe src="support/exif-orientation-1-ul.jpg" frameborder=0></iframe> + <embed type="image/jpeg" src="support/exif-orientation-2-ur.jpg" width="120" height="110px"> + <object type="image/jpeg" data="support/exif-orientation-3-lr.jpg" width="120" height="110px"></object> + <iframe src="support/exif-orientation-4-lol.jpg" frameborder=0></iframe> + <br> + <iframe src="support/exif-orientation-5-lu.jpg" frameborder=0></iframe> + <embed type="image/jpeg" src="support/exif-orientation-6-ru.jpg" width="120" height="110px"> + <object type="image/jpeg" data="support/exif-orientation-7-rl.jpg" width="120" height="110px"></object> + <iframe src="support/exif-orientation-8-llo.jpg" frameborder=0></iframe> + <br> + <iframe src="support/exif-orientation-9-u.jpg" frameborder=0></iframe> +</body> +</html> \ No newline at end of file
diff --git a/third_party/blink/web_tests/external/wpt/css/css-images/image-orientation/image-orientation-from-image-image-document.html b/third_party/blink/web_tests/external/wpt/css/css-images/image-orientation/image-orientation-from-image-image-document.html deleted file mode 100644 index 793fc017..0000000 --- a/third_party/blink/web_tests/external/wpt/css/css-images/image-orientation/image-orientation-from-image-image-document.html +++ /dev/null
@@ -1,37 +0,0 @@ -<!DOCTYPE html> -<html> -<head> -<meta charset="utf-8"> -<title>CSS Images Module Level 3: image-orientation: from-image in image documents</title> -<link rel="author" title="Stephen Chenney" href="mailto:schenney@chromium.org"> -<link rel="help" href="https://drafts.csswg.org/css-images-3/#propdef-image-orientation"> -<link rel="match" href="reference/image-orientation-from-image-image-document-ref.html"> -<meta name=fuzzy content="10;100"> -<style> - iframe { - display: inline-block; - width: 120px; - height: 110px; - vertical-align: top; - border: 1px solid black; - image-orientation: from-image; - } -</style> -</head> -<body> - <p>The images should rotate respecting their EXIF orientation because image - documents always respect the orientation, regardless of the image-orientation - property.</p> - <iframe src="support/exif-orientation-1-ul.jpg" frameborder=0></iframe> - <iframe src="support/exif-orientation-2-ur.jpg" frameborder=0></iframe> - <iframe src="support/exif-orientation-3-lr.jpg" frameborder=0></iframe> - <iframe src="support/exif-orientation-4-lol.jpg" frameborder=0></iframe> - <br> - <iframe src="support/exif-orientation-5-lu.jpg" frameborder=0></iframe> - <iframe src="support/exif-orientation-6-ru.jpg" frameborder=0></iframe> - <iframe src="support/exif-orientation-7-rl.jpg" frameborder=0></iframe> - <iframe src="support/exif-orientation-8-llo.jpg" frameborder=0></iframe> - <br> - <iframe src="support/exif-orientation-9-u.jpg" frameborder=0></iframe> -</body> -</html> \ No newline at end of file
diff --git a/third_party/blink/web_tests/external/wpt/css/css-images/image-orientation/image-orientation-from-image.html b/third_party/blink/web_tests/external/wpt/css/css-images/image-orientation/image-orientation-from-image.html index f1343e9..9e27bd79 100644 --- a/third_party/blink/web_tests/external/wpt/css/css-images/image-orientation/image-orientation-from-image.html +++ b/third_party/blink/web_tests/external/wpt/css/css-images/image-orientation/image-orientation-from-image.html
@@ -12,9 +12,6 @@ overflow: hidden; image-orientation: from-image; } - img { - border: 1px solid black; - } div { display: inline-block; width: 100px;
diff --git a/third_party/blink/web_tests/external/wpt/css/css-images/image-orientation/image-orientation-none-content-images.html b/third_party/blink/web_tests/external/wpt/css/css-images/image-orientation/image-orientation-none-content-images.html index 7bcb5ce3..da5b670 100644 --- a/third_party/blink/web_tests/external/wpt/css/css-images/image-orientation/image-orientation-none-content-images.html +++ b/third_party/blink/web_tests/external/wpt/css/css-images/image-orientation/image-orientation-none-content-images.html
@@ -10,7 +10,6 @@ <style> div.image { display: inline-block; - border: 1px solid black; } div.container { display: inline-block;
diff --git a/third_party/blink/web_tests/external/wpt/css/css-images/image-orientation/image-orientation-none-image-document.html b/third_party/blink/web_tests/external/wpt/css/css-images/image-orientation/image-orientation-none-image-document.html index 29ec30f1..d333b5f 100644 --- a/third_party/blink/web_tests/external/wpt/css/css-images/image-orientation/image-orientation-none-image-document.html +++ b/third_party/blink/web_tests/external/wpt/css/css-images/image-orientation/image-orientation-none-image-document.html
@@ -15,7 +15,6 @@ width: 120px; height: 110px; vertical-align: top; - border: 1px solid black; image-orientation: none; } </style>
diff --git a/third_party/blink/web_tests/external/wpt/css/css-images/image-orientation/image-orientation-none.html b/third_party/blink/web_tests/external/wpt/css/css-images/image-orientation/image-orientation-none.html index 03c46c6..c903cee7 100644 --- a/third_party/blink/web_tests/external/wpt/css/css-images/image-orientation/image-orientation-none.html +++ b/third_party/blink/web_tests/external/wpt/css/css-images/image-orientation/image-orientation-none.html
@@ -12,9 +12,6 @@ overflow: hidden; image-orientation: none; } - img { - border: 1px solid black; - } div { display: inline-block; width: 100px;
diff --git a/third_party/blink/web_tests/external/wpt/css/css-images/image-orientation/reference/image-orientation-background-properties-ref.html b/third_party/blink/web_tests/external/wpt/css/css-images/image-orientation/reference/image-orientation-background-properties-ref.html new file mode 100644 index 0000000..0d2aabc --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/css/css-images/image-orientation/reference/image-orientation-background-properties-ref.html
@@ -0,0 +1,53 @@ +<!DOCTYPE html> +<html> +<head> +<meta charset="utf-8"> +<title>CSS Images Module Level 3: image-orientation with background properties reference</title> +<link rel="author" title="Stephen Chenney" href="mailto:schenney@chromium.org"> +<link rel="help" href="https://drafts.csswg.org/css-images-3/#propdef-image-orientation"> +<style> + div { + position: absolute; + width: 200px; + height: 200PX; + vertical-align: top; + background-image: url(../support/exif-orientation-5-lu-pre-rotated.jpg); + background-repeat: no-repeat; + } + + .repeat { + background-repeat: repeat; + top: 20px; + left: 20px; + } + + .position { + background-position: bottom right; + top: 20px; + left: 240px; + } + + .cover { + background-size: cover; + top: 240px; + left: 20px; + } + + .contain { + background-size: contain; + top: 240px; + left: 240px; + } +</style> +</head> +<body> + <div class="repeat"> + </div> + <div class="position"> + </div> + <div class="cover"> + </div> + <div class="contain"> + </div> +</body> +</html>
diff --git a/third_party/blink/web_tests/external/wpt/css/css-images/image-orientation/reference/image-orientation-default-ref.html b/third_party/blink/web_tests/external/wpt/css/css-images/image-orientation/reference/image-orientation-default-ref.html index aa8bede..a146af3 100644 --- a/third_party/blink/web_tests/external/wpt/css/css-images/image-orientation/reference/image-orientation-default-ref.html +++ b/third_party/blink/web_tests/external/wpt/css/css-images/image-orientation/reference/image-orientation-default-ref.html
@@ -8,10 +8,6 @@ body { overflow: hidden; } - img { - border: 1px - solid black; - } div { display: inline-block; width: 100px;
diff --git a/third_party/blink/web_tests/external/wpt/css/css-images/image-orientation/reference/image-orientation-from-image-content-images-ref.html b/third_party/blink/web_tests/external/wpt/css/css-images/image-orientation/reference/image-orientation-from-image-content-images-ref.html index 21fed5f..c0d29909 100644 --- a/third_party/blink/web_tests/external/wpt/css/css-images/image-orientation/reference/image-orientation-from-image-content-images-ref.html +++ b/third_party/blink/web_tests/external/wpt/css/css-images/image-orientation/reference/image-orientation-from-image-content-images-ref.html
@@ -7,7 +7,6 @@ <style> div.image { display: inline-block; - border: 1px solid black; } div.container { display: inline-block;
diff --git a/third_party/blink/web_tests/external/wpt/css/css-images/image-orientation/reference/image-orientation-from-image-embedded-content-ref.html b/third_party/blink/web_tests/external/wpt/css/css-images/image-orientation/reference/image-orientation-from-image-embedded-content-ref.html new file mode 100644 index 0000000..343d0668 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/css/css-images/image-orientation/reference/image-orientation-from-image-embedded-content-ref.html
@@ -0,0 +1,44 @@ +<!DOCTYPE html> +<html> +<head> +<meta charset="utf-8"> +<title>CSS Images Module Level 3: image-orientation: from-image in embedded content (reference)</title> +<link rel="author" title="Stephen Chenney" href="mailto:schenney@chromium.org"> +<link rel="help" href="https://drafts.csswg.org/css-images-3/#propdef-image-orientation"> +<style> + iframe { + display: inline-block; + width: 120px; + height: 110px; + vertical-align: top; + } + embed { + object-fit: none; + object-position: top left; + image-orientation: from-image; + } + object { + object-fit: none; + object-position: top left; + image-orientation: from-image; + } +</style> +</head> +<body> + <p>The images should rotate respecting their EXIF orientation because image + documents always respect the orientation, regardless of the image-orientation + property.</p> + <iframe src="../support/exif-orientation-1-ul-pre-rotated.jpg" frameborder=0></iframe> + <embed type="image/jpeg" src="../support/exif-orientation-2-ur-pre-rotated.jpg" width="120" height="110px"> + <object type="image/jpeg" data="../support/exif-orientation-3-lr-pre-rotated.jpg" width="120" height="110px"></object> + <iframe src="../support/exif-orientation-4-lol-pre-rotated.jpg" frameborder=0></iframe> + <br> + <iframe src="../support/exif-orientation-5-lu-pre-rotated.jpg" frameborder=0></iframe> + <embed type="image/jpeg" src="../support/exif-orientation-6-ru-pre-rotated.jpg" width="120" height="110px"> + <object type="image/jpeg" data="../support/exif-orientation-7-rl-pre-rotated.jpg" width="120" height="110px"></object> + <iframe src="../support/exif-orientation-8-llo-pre-rotated.jpg" frameborder=0></iframe> + <br> + <iframe src="../support/exif-orientation-9-u-pre-rotated.jpg" frameborder=0></iframe> +</body> +</html> +
diff --git a/third_party/blink/web_tests/external/wpt/css/css-images/image-orientation/reference/image-orientation-from-image-image-document-ref.html b/third_party/blink/web_tests/external/wpt/css/css-images/image-orientation/reference/image-orientation-from-image-image-document-ref.html deleted file mode 100644 index d2c7e691..0000000 --- a/third_party/blink/web_tests/external/wpt/css/css-images/image-orientation/reference/image-orientation-from-image-image-document-ref.html +++ /dev/null
@@ -1,35 +0,0 @@ -<!DOCTYPE html> -<html> -<head> -<meta charset="utf-8"> -<title>CSS Images Module Level 3: image-orientation: from-image in image documents</title> -<link rel="author" title="Stephen Chenney" href="mailto:schenney@chromium.org"> -<link rel="help" href="https://drafts.csswg.org/css-images-3/#propdef-image-orientation"> -<style> - iframe { - display: inline-block; - width: 120px; - height: 110px; - vertical-align: top; - border: 1px solid black; - } -</style> -</head> -<body> - <p>The images should rotate respecting their EXIF orientation because image - documents always respect the orientation, regardless of the image-orientation - property.</p> - <iframe src="../support/exif-orientation-1-ul-pre-rotated.jpg" frameborder=0></iframe> - <iframe src="../support/exif-orientation-2-ur-pre-rotated.jpg" frameborder=0></iframe> - <iframe src="../support/exif-orientation-3-lr-pre-rotated.jpg" frameborder=0></iframe> - <iframe src="../support/exif-orientation-4-lol-pre-rotated.jpg" frameborder=0></iframe> - <br> - <iframe src="../support/exif-orientation-5-lu-pre-rotated.jpg" frameborder=0></iframe> - <iframe src="../support/exif-orientation-6-ru-pre-rotated.jpg" frameborder=0></iframe> - <iframe src="../support/exif-orientation-7-rl-pre-rotated.jpg" frameborder=0></iframe> - <iframe src="../support/exif-orientation-8-llo-pre-rotated.jpg" frameborder=0></iframe> - <br> - <iframe src="../support/exif-orientation-9-u-pre-rotated.jpg" frameborder=0></iframe> -</body> -</html> -
diff --git a/third_party/blink/web_tests/external/wpt/css/css-images/image-orientation/reference/image-orientation-from-image-ref.html b/third_party/blink/web_tests/external/wpt/css/css-images/image-orientation/reference/image-orientation-from-image-ref.html index d731e83..c569690 100644 --- a/third_party/blink/web_tests/external/wpt/css/css-images/image-orientation/reference/image-orientation-from-image-ref.html +++ b/third_party/blink/web_tests/external/wpt/css/css-images/image-orientation/reference/image-orientation-from-image-ref.html
@@ -9,9 +9,6 @@ body { overflow: hidden; } - img { - border: 1px solid black; - } div { display: inline-block; width: 100px;
diff --git a/third_party/blink/web_tests/external/wpt/css/css-images/image-orientation/reference/image-orientation-none-content-images-ref.html b/third_party/blink/web_tests/external/wpt/css/css-images/image-orientation/reference/image-orientation-none-content-images-ref.html index d73c554f..5192f5c 100644 --- a/third_party/blink/web_tests/external/wpt/css/css-images/image-orientation/reference/image-orientation-none-content-images-ref.html +++ b/third_party/blink/web_tests/external/wpt/css/css-images/image-orientation/reference/image-orientation-none-content-images-ref.html
@@ -8,7 +8,6 @@ <style> div.image { display: inline-block; - border: 1px solid black; } div.container { display: inline-block;
diff --git a/third_party/blink/web_tests/external/wpt/css/css-images/image-orientation/reference/image-orientation-none-image-document-ref.html b/third_party/blink/web_tests/external/wpt/css/css-images/image-orientation/reference/image-orientation-none-image-document-ref.html index db84d0e..90eaeaa 100644 --- a/third_party/blink/web_tests/external/wpt/css/css-images/image-orientation/reference/image-orientation-none-image-document-ref.html +++ b/third_party/blink/web_tests/external/wpt/css/css-images/image-orientation/reference/image-orientation-none-image-document-ref.html
@@ -13,7 +13,6 @@ width: 120px; height: 110px; vertical-align: top; - border: 1px solid black; } </style> </head>
diff --git a/third_party/blink/web_tests/external/wpt/css/css-images/image-orientation/reference/image-orientation-none-ref.html b/third_party/blink/web_tests/external/wpt/css/css-images/image-orientation/reference/image-orientation-none-ref.html index 8293d6e0..c4d140f1 100644 --- a/third_party/blink/web_tests/external/wpt/css/css-images/image-orientation/reference/image-orientation-none-ref.html +++ b/third_party/blink/web_tests/external/wpt/css/css-images/image-orientation/reference/image-orientation-none-ref.html
@@ -9,9 +9,6 @@ body { overflow: hidden; } - img { - border: 1px solid black; - } div { display: inline-block; width: 100px;
diff --git a/third_party/blink/web_tests/external/wpt/css/css-overflow/reference/text-overflow-ellipsis-002-ref.html b/third_party/blink/web_tests/external/wpt/css/css-overflow/reference/text-overflow-ellipsis-002-ref.html new file mode 100644 index 0000000..cf26b6b8 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/css/css-overflow/reference/text-overflow-ellipsis-002-ref.html
@@ -0,0 +1,13 @@ +<!doctype html> +<meta charset="utf-8"> +<title>CSS Reference</title> +<link rel="stylesheet" href="/fonts/ahem.css"> +<style> +div { + background-color: green; + display: inline-block; + vertical-align: top; + font-family: Ahem; +} +</style> +<div><span>ABC</span><span style="visibility: hidden">…</span></div>
diff --git a/third_party/blink/web_tests/external/wpt/css/css-overflow/reference/webkit-line-clamp-035-ref.html b/third_party/blink/web_tests/external/wpt/css/css-overflow/reference/webkit-line-clamp-035-ref.html new file mode 100644 index 0000000..f7488ba --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/css/css-overflow/reference/webkit-line-clamp-035-ref.html
@@ -0,0 +1,23 @@ +<!doctype html> +<meta charset="utf-8"> +<title>CSS reference</title> +<link rel="stylesheet" href="/fonts/ahem.css"> +<style> +#parent { + display: inline-block; + background: green; +} +#clamp { + font-family: Ahem; + display: -webkit-box; + -webkit-box-orient: vertical; + overflow: hidden; /* can be removed once implementations update their old -webkit-line-clamp implementations */ +} +</style> +<div id="parent"> + <div id="clamp"> + AAA<br> + BBB<br> + CCC<span style="visibility: hidden">…</span> + </div> +</div>
diff --git a/third_party/blink/web_tests/external/wpt/css/css-overflow/text-overflow-ellipsis-002.html b/third_party/blink/web_tests/external/wpt/css/css-overflow/text-overflow-ellipsis-002.html new file mode 100644 index 0000000..019e8902 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/css/css-overflow/text-overflow-ellipsis-002.html
@@ -0,0 +1,25 @@ +<!doctype html> +<meta charset="utf-8"> +<title>CSS Overflow: text-overflow with visibility: hidden; and visibility: visible; descendant</title> +<link rel="author" title="Tim Nguyen" href="mailto:ntim.bugs@gmail.com"> +<link rel="help" href="https://drafts.csswg.org/css-overflow-3/#ellipsing-details"> +<link rel="match" href="reference/text-overflow-ellipsis-002-ref.html"> +<link rel="stylesheet" href="/fonts/ahem.css"> +<style> +#parent { + background-color: green; + display: inline-block; + vertical-align: top; + font-family: Ahem; +} +#element { + visibility: hidden; + text-overflow: ellipsis; + white-space: nowrap; + max-width: 4ch; + overflow: hidden; +} +</style> +<div id="parent"> + <div id="element"><span style="visibility: visible">ABCABCABCABC</span></div> +</div>
diff --git a/third_party/blink/web_tests/external/wpt/css/css-overflow/webkit-line-clamp-034.html b/third_party/blink/web_tests/external/wpt/css/css-overflow/webkit-line-clamp-034.html new file mode 100644 index 0000000..acc6695 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/css/css-overflow/webkit-line-clamp-034.html
@@ -0,0 +1,22 @@ +<!doctype html> +<meta charset="utf-8"> +<title>CSS Overflow: -webkit-line-clamp with visibility: hidden;</title> +<link rel="author" title="Tim Nguyen" href="mailto:ntim.bugs@gmail.com"> +<link rel="help" href="https://drafts.csswg.org/css-overflow-3/#webkit-line-clamp"> +<link rel="match" href="/css/reference/blank.html"> +<style> +#clamp { + visibility: hidden; + display: -webkit-box; + -webkit-box-orient: vertical; + -webkit-line-clamp: 3; + overflow: hidden; /* can be removed once implementations update their old -webkit-line-clamp implementations */ +} +</style> +<div id="clamp"> + AAAAAAAAA<br> + BBBBBBBBB<br> + CCCCCCCCC<br> + DDDDDDDDD<br> + EEEEEEEEE +</div>
diff --git a/third_party/blink/web_tests/external/wpt/css/css-overflow/webkit-line-clamp-035.html b/third_party/blink/web_tests/external/wpt/css/css-overflow/webkit-line-clamp-035.html new file mode 100644 index 0000000..52b539d --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/css/css-overflow/webkit-line-clamp-035.html
@@ -0,0 +1,33 @@ +<!doctype html> +<meta charset="utf-8"> +<title>CSS Overflow: -webkit-line-clamp with visibility: hidden; and visibility: visible; descendant</title> +<link rel="author" title="Tim Nguyen" href="mailto:ntim.bugs@gmail.com"> +<link rel="help" href="https://drafts.csswg.org/css-overflow-3/#webkit-line-clamp"> +<link rel="match" href="reference/webkit-line-clamp-035-ref.html"> +<link rel="stylesheet" href="/fonts/ahem.css"> +<style> +#parent { + display: inline-block; + background: green; +} +#clamp { + font-family: Ahem; + visibility: hidden; + display: -webkit-box; + -webkit-box-orient: vertical; + -webkit-line-clamp: 3; + width: 4ch; + overflow: hidden; /* can be removed once implementations update their old -webkit-line-clamp implementations */ +} +</style> +<div id="parent"> + <div id="clamp"> + <span style="visibility: visible"> + AAA<br> + BBB<br> + CCCCCCCCC<br> + DDDDDDDDD<br> + EEEEEEEEE + </span> + </div> +</div>
diff --git a/third_party/blink/web_tests/external/wpt/css/css-transforms/animation/transform-interpolation-computed-value-expected.txt b/third_party/blink/web_tests/external/wpt/css/css-transforms/animation/transform-interpolation-computed-value-expected.txt index 7a61e08..1fca5d4 100644 --- a/third_party/blink/web_tests/external/wpt/css/css-transforms/animation/transform-interpolation-computed-value-expected.txt +++ b/third_party/blink/web_tests/external/wpt/css/css-transforms/animation/transform-interpolation-computed-value-expected.txt
@@ -1,5 +1,5 @@ This is a testharness.js-based test. -Found 87 tests; 34 PASS, 53 FAIL, 0 TIMEOUT, 0 NOTRUN. +Found 87 tests; 36 PASS, 51 FAIL, 0 TIMEOUT, 0 NOTRUN. FAIL Interpolation between translateX(0px) and translateX(50px) gives the correct computed value halfway according to computedStyleMap. assert_equals: The value at 50% progress is as expected expected "translateX(25px)" but got "translate(25px, 0px)" FAIL Interpolation between translateX(0px) and translateX(50px) gives the correct computed value halfway according to computedStyleMap with zoom active. assert_equals: The value at 50% progress is as expected expected "translateX(25px)" but got "translate(25px, 0px)" FAIL Interpolation between translateX(0px) and translateX(50px) gives the correct computed value halfway according to commitStyles. assert_equals: The value at 50% progress is as expected expected "translateX(25px)" but got "matrix(1, 0, 0, 1, 25, 0)" @@ -13,10 +13,10 @@ PASS Interpolation between translateX(50px) and translateY(50px) gives the correct computed value halfway according to computedStyleMap with zoom active. FAIL Interpolation between translateX(50px) and translateY(50px) gives the correct computed value halfway according to commitStyles. assert_equals: The value at 50% progress is as expected expected "translate(25px, 25px)" but got "matrix(1, 0, 0, 1, 25, 25)" PASS Interpolation between translateX(50px) and translateZ(50px) gives the correct computed value halfway according to computedStyleMap. -FAIL Interpolation between translateX(50px) and translateZ(50px) gives the correct computed value halfway according to computedStyleMap with zoom active. assert_equals: The value at 50% progress is as expected expected "translate3d(25px, 0px, 25px)" but got "translate3d(25px, 0px, 31.25px)" +PASS Interpolation between translateX(50px) and translateZ(50px) gives the correct computed value halfway according to computedStyleMap with zoom active. FAIL Interpolation between translateX(50px) and translateZ(50px) gives the correct computed value halfway according to commitStyles. assert_equals: The value at 50% progress is as expected expected "translate3d(25px, 0px, 25px)" but got "matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 25, 0, 25, 1)" PASS Interpolation between translateZ(50px) and translateX(50px) gives the correct computed value halfway according to computedStyleMap. -FAIL Interpolation between translateZ(50px) and translateX(50px) gives the correct computed value halfway according to computedStyleMap with zoom active. assert_equals: The value at 50% progress is as expected expected "translate3d(25px, 0px, 25px)" but got "translate3d(25px, 0px, 31.25px)" +PASS Interpolation between translateZ(50px) and translateX(50px) gives the correct computed value halfway according to computedStyleMap with zoom active. FAIL Interpolation between translateZ(50px) and translateX(50px) gives the correct computed value halfway according to commitStyles. assert_equals: The value at 50% progress is as expected expected "translate3d(25px, 0px, 25px)" but got "matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 25, 0, 25, 1)" FAIL Interpolation between translateZ(-50px) and translateZ(50px) gives the correct computed value halfway according to computedStyleMap. assert_equals: The value at 50% progress is as expected expected "translateZ(0px)" but got "translate3d(0px, 0px, 0px)" FAIL Interpolation between translateZ(-50px) and translateZ(50px) gives the correct computed value halfway according to computedStyleMap with zoom active. assert_equals: The value at 50% progress is as expected expected "translateZ(0px)" but got "translate3d(0px, 0px, 0px)"
diff --git a/third_party/blink/web_tests/external/wpt/css/geometry/DOMMatrixInit-validate-fixup.html b/third_party/blink/web_tests/external/wpt/css/geometry/DOMMatrixInit-validate-fixup.html index b89b752..78eaa78 100644 --- a/third_party/blink/web_tests/external/wpt/css/geometry/DOMMatrixInit-validate-fixup.html +++ b/third_party/blink/web_tests/external/wpt/css/geometry/DOMMatrixInit-validate-fixup.html
@@ -28,6 +28,12 @@ test(() => { assert_true('fromMatrix' in DOMMatrix, 'fromMatrix should exist'); assert_throws_js(TypeError, () => DOMMatrix.fromMatrix(dict)); + assert_true('multiply' in DOMMatrix.prototype, 'multiply should exist'); + assert_throws_js(TypeError, () => new DOMMatrix().multiply(dict)); + assert_true('multiplySelf' in DOMMatrix.prototype, 'multiplySelf should exist'); + assert_throws_js(TypeError, () => new DOMMatrix().multiplySelf(dict)); + assert_true('preMultiplySelf' in DOMMatrix.prototype, 'preMultiplySelf should exist'); + assert_throws_js(TypeError, () => new DOMMatrix().preMultiplySelf(dict)); }, `${format_dict(dict)} (invalid)`); });
diff --git a/third_party/blink/web_tests/external/wpt/html/cross-origin-embedder-policy/resources/report.py b/third_party/blink/web_tests/external/wpt/html/cross-origin-embedder-policy/resources/report.py index 1f628ca..dd1a047c 100644 --- a/third_party/blink/web_tests/external/wpt/html/cross-origin-embedder-policy/resources/report.py +++ b/third_party/blink/web_tests/external/wpt/html/cross-origin-embedder-policy/resources/report.py
@@ -2,13 +2,15 @@ def main(request, response): - if request.method == 'OPTIONS': - # CORS preflight - response.headers.set('Access-Control-Allow-Origin', '*') - response.headers.set('Access-Control-Allow-Methods', 'POST') - response.headers.set('Access-Control-Allow-Headers', 'content-type') - return '' response.headers.set('Access-Control-Allow-Origin', '*') + response.headers.set('Access-Control-Allow-Methods', 'OPTIONS, GET, POST') + response.headers.set('Access-Control-Allow-Headers', 'Content-Type') + response.headers.set('Cache-Control', 'no-cache, no-store, must-revalidate'); + + # CORS preflight + if request.method == 'OPTIONS': + return '' + uuidMap = { 'endpoint': '01234567-0123-0123-0123-0123456789AB', 'report-only-endpoint': '01234567-0123-0123-0123-0123456789CD' @@ -33,6 +35,7 @@ return 'done' if request.method == 'GET': + response.headers.set('Content-Type', 'application/json') return json.dumps(request.server.stash.take(key, path) or []) response.status = 400
diff --git a/third_party/blink/web_tests/external/wpt/mst-content-hint/RTCRtpSendParameters-degradationPreference.html b/third_party/blink/web_tests/external/wpt/mst-content-hint/RTCRtpSendParameters-degradationPreference.html new file mode 100644 index 0000000..3573bb587 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/mst-content-hint/RTCRtpSendParameters-degradationPreference.html
@@ -0,0 +1,129 @@ +<!doctype html> +<meta charset=utf-8> +<title>RTCRtpSendParameters degradationPreference</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script> + 'use strict'; + +promise_test(async t => { + const pc = new RTCPeerConnection(); + t.add_cleanup(() => pc.close()); + const { sender } = pc.addTransceiver('video'); + + let param = sender.getParameters(); + + assert_equals(param.degradationPreference, undefined, + 'Expect initial param.degradationPreference to be undefined'); + + param.degradationPreference = 'maintain-framerate'; + await sender.setParameters(param); + param = sender.getParameters(); + assert_equals(param.degradationPreference, 'maintain-framerate'); + + param.degradationPreference = 'maintain-resolution'; + await sender.setParameters(param); + param = sender.getParameters(); + assert_equals(param.degradationPreference, 'maintain-resolution'); + + param.degradationPreference = 'balanced'; + await sender.setParameters(param); + param = sender.getParameters(); + assert_equals(param.degradationPreference, 'balanced'); + + param.degradationPreference = undefined; + await sender.setParameters(param); + param = sender.getParameters(); + assert_equals(param.degradationPreference, undefined); +}, 'setParameters with degradationPreference set should succeed on video transceiver'); + +promise_test(async t => { + const pc = new RTCPeerConnection(); + t.add_cleanup(() => pc.close()); + const { sender } = pc.addTransceiver('video'); + + let param = sender.getParameters(); + + assert_equals(param.degradationPreference, undefined, + 'Expect initial param.degradationPreference to be undefined'); + + param.degradationPreference = undefined; + + await sender.setParameters(param); + + param = sender.getParameters(); + assert_equals(param.degradationPreference, undefined); +}, 'setParameters with degradationPreference unset should succeed on video transceiver'); + +promise_test(async t => { + const pc = new RTCPeerConnection(); + t.add_cleanup(() => pc.close()); + const { sender } = pc.addTransceiver('video'); + + let param = sender.getParameters(); + param.degradationPreference = 'invalid'; + + return promise_rejects_js(t, TypeError, sender.setParameters(param)); +}, 'setParameters with invalid degradationPreference should throw TypeError on video transceiver'); + +promise_test(async t => { + const pc = new RTCPeerConnection(); + t.add_cleanup(() => pc.close()); + const { sender } = pc.addTransceiver('audio'); + + let param = sender.getParameters(); + + assert_equals(param.degradationPreference, undefined, + 'Expect initial param.degradationPreference to be undefined'); + + param.degradationPreference = 'maintain-framerate'; + await sender.setParameters(param); + param = sender.getParameters(); + assert_equals(param.degradationPreference, 'maintain-framerate'); + + param.degradationPreference = 'maintain-resolution'; + await sender.setParameters(param); + param = sender.getParameters(); + assert_equals(param.degradationPreference, 'maintain-resolution'); + + param.degradationPreference = 'balanced'; + await sender.setParameters(param); + param = sender.getParameters(); + assert_equals(param.degradationPreference, 'balanced'); + + param.degradationPreference = undefined; + await sender.setParameters(param); + param = sender.getParameters(); + assert_equals(param.degradationPreference, undefined); +}, 'setParameters with degradationPreference set should succeed on audio transceiver'); + +promise_test(async t => { + const pc = new RTCPeerConnection(); + t.add_cleanup(() => pc.close()); + const { sender } = pc.addTransceiver('audio'); + + let param = sender.getParameters(); + + assert_equals(param.degradationPreference, undefined, + 'Expect initial param.degradationPreference to be undefined'); + + param.degradationPreference = undefined; + + await sender.setParameters(param); + + param = sender.getParameters(); + assert_equals(param.degradationPreference, undefined); +}, 'setParameters with degradationPreference unset should succeed on audio transceiver'); + +promise_test(async t => { + const pc = new RTCPeerConnection(); + t.add_cleanup(() => pc.close()); + const { sender } = pc.addTransceiver('audio'); + + let param = sender.getParameters(); + param.degradationPreference = 'invalid'; + + return promise_rejects_js(t, TypeError, sender.setParameters(param)); +}, 'setParameters with invalid degradationPreference should throw TypeError on audio transceiver'); + +</script>
diff --git a/third_party/blink/web_tests/external/wpt/pointerevents/pointerevent_pointercapture-in-custom-element.html b/third_party/blink/web_tests/external/wpt/pointerevents/pointerevent_pointercapture-in-custom-element.html index e8f143b..6f7c905 100644 --- a/third_party/blink/web_tests/external/wpt/pointerevents/pointerevent_pointercapture-in-custom-element.html +++ b/third_party/blink/web_tests/external/wpt/pointerevents/pointerevent_pointercapture-in-custom-element.html
@@ -48,59 +48,58 @@ <wc-wc id="wc-wc"></wc-wc> <div id="log"></div> <script> - var logDiv = document.getElementById("log"); - function logMessage(message){ - var log = document.createElement("div"); - var messageNode = document.createTextNode(message); - log.appendChild(messageNode); - logDiv.appendChild(log); - } - var events = []; - - var content = document.getElementById("wc-wc") - .shadowRoot.getElementById("content"); - - content.addEventListener("pointerdown", function(e){ - content.setPointerCapture(e.pointerId); - events.push("pointerdown@content"); - }); - content.addEventListener("gotpointercapture", function(e){ - logMessage("Pointer was captured by custom element's Shadow DOM!"); - events.push("gotpointercapture@content"); - }); - content.addEventListener("pointerup", function(e){ - content.releasePointerCapture(e.pointerId); - events.push("pointerup@content"); - }); - content.addEventListener("lostpointercapture", function(e){ - logMessage("Pointer was released by custom element's Shadow DOM!"); - events.push("lostpointercapture@content"); - if(window.promise_test && wc_shadow_dom_test){ - wc_shadow_dom_test.step(function(){ - assert_array_equals(events, ["pointerdown@content", - "gotpointercapture@content", "pointerup@content", - "lostpointercapture@content"]); - resolve_test(); - wc_shadow_dom_test.done(); - }); - } - }); - - var wc_shadow_dom_test = null; - var resolve_test = null; - var reject_test = null; - - function cleanup(){ - events = []; - shadow_dom_test = null; - resolve_test = null; - reject_test = null; - } - function onLoad(){ + var logDiv = document.getElementById("log"); + function logMessage(message){ + var log = document.createElement("div"); + var messageNode = document.createTextNode(message); + log.appendChild(messageNode); + logDiv.appendChild(log); + } + var events = []; + + var content = document.getElementById("wc-wc") + .shadowRoot.getElementById("content"); + + content.addEventListener("pointerdown", function(e){ + content.setPointerCapture(e.pointerId); + events.push("pointerdown@content"); + }); + content.addEventListener("gotpointercapture", function(e){ + logMessage("Pointer was captured by custom element's Shadow DOM!"); + events.push("gotpointercapture@content"); + }); + content.addEventListener("pointerup", function(e){ + content.releasePointerCapture(e.pointerId); + events.push("pointerup@content"); + }); + content.addEventListener("lostpointercapture", function(e){ + logMessage("Pointer was released by custom element's Shadow DOM!"); + events.push("lostpointercapture@content"); + if(window.promise_test && wc_shadow_dom_test){ + wc_shadow_dom_test.step(function(){ + assert_array_equals(events, ["pointerdown@content", + "gotpointercapture@content", "pointerup@content", + "lostpointercapture@content"]); + resolve_test(); + }); + } + }); + + var wc_shadow_dom_test = null; + var resolve_test = null; + var reject_test = null; + + function cleanup(){ + events = []; + shadow_dom_test = null; + resolve_test = null; + reject_test = null; + } if(window.promise_test){ - promise_test(function(t){ - return new Promise(function(resolve, reject){ + promise_test(async function(t){ + var actions_promise; + return new Promise(async function(resolve, reject){ wc_shadow_dom_test = t; resolve_test = resolve; reject_test = reject; @@ -109,11 +108,14 @@ }); var contentRect = content.getBoundingClientRect(); var actions = new test_driver.Actions(); - var actions_promise = actions - .pointerMove(contentRect.x, contentRect.y) - .pointerDown({button: actions.ButtonType.LEFT}) - .pointerUp({button: actions.ButtonType.LEFT}) - .send(); + actions_promise = actions + .pointerMove(Math.ceil(contentRect.x), Math.ceil(contentRect.y)) + .pointerDown({button: actions.ButtonType.LEFT}) + .pointerUp({button: actions.ButtonType.LEFT}) + .send(); + }).then(async()=>{ + await actions_promise; + t.done(); }); }, "PointerCapture works for custom element Shadow DOM."); }
diff --git a/third_party/blink/web_tests/external/wpt/pointerevents/pointerevent_pointercapture-in-shadow-dom.html b/third_party/blink/web_tests/external/wpt/pointerevents/pointerevent_pointercapture-in-shadow-dom.html index 8279665f..9463623 100644 --- a/third_party/blink/web_tests/external/wpt/pointerevents/pointerevent_pointercapture-in-shadow-dom.html +++ b/third_party/blink/web_tests/external/wpt/pointerevents/pointerevent_pointercapture-in-shadow-dom.html
@@ -34,64 +34,64 @@ <div id="shadowhost"></div> <div id="log"></div> <script> - var logDiv = document.getElementById("log"); - function logMessage(message){ - var log = document.createElement("div"); - var messageNode = document.createTextNode(message); - log.appendChild(messageNode); - logDiv.appendChild(log); - } - var events = []; - - var host = document.getElementById("shadowhost"); - var shadowRoot = host.attachShadow({mode: "open"}); - var template = document.getElementById("template"); - var node = template.content.cloneNode(true); - shadowRoot.appendChild(node); - - var content = host.shadowRoot.getElementById("content"); - - content.addEventListener("pointerdown", function(e){ - content.setPointerCapture(e.pointerId); - events.push("pointerdown@content"); - }); - content.addEventListener("gotpointercapture", function(e){ - logMessage("Pointer was captured by Shadow DOM!"); - events.push("gotpointercapture@content"); - }); - content.addEventListener("pointerup", function(e){ - content.releasePointerCapture(e.pointerId); - events.push("pointerup@content"); - }); - content.addEventListener("lostpointercapture", function(e){ - logMessage("Pointer was released by Shadow DOM!"); - events.push("lostpointercapture@content"); - if(window.promise_test && shadow_dom_test){ - shadow_dom_test.step(function(){ - assert_array_equals(events, ["pointerdown@content", - "gotpointercapture@content", "pointerup@content", - "lostpointercapture@content"]); - resolve_test(); - shadow_dom_test.done(); - }); - } - }); - - var shadow_dom_test = null; - var resolve_test = null; - var reject_test = null; - - function cleanup(){ - events = []; - shadow_dom_test = null; - resolve_test = null; - reject_test = null; - } - function onLoad(){ + var logDiv = document.getElementById("log"); + function logMessage(message){ + var log = document.createElement("div"); + var messageNode = document.createTextNode(message); + log.appendChild(messageNode); + logDiv.appendChild(log); + } + var events = []; + + var host = document.getElementById("shadowhost"); + var shadowRoot = host.attachShadow({mode: "open"}); + var template = document.getElementById("template"); + var node = template.content.cloneNode(true); + shadowRoot.appendChild(node); + + var content = host.shadowRoot.getElementById("content"); + + content.addEventListener("pointerdown", function(e){ + content.setPointerCapture(e.pointerId); + events.push("pointerdown@content"); + }); + content.addEventListener("gotpointercapture", function(e){ + logMessage("Pointer was captured by Shadow DOM!"); + events.push("gotpointercapture@content"); + }); + content.addEventListener("pointerup", function(e){ + content.releasePointerCapture(e.pointerId); + events.push("pointerup@content"); + }); + content.addEventListener("lostpointercapture", function(e){ + logMessage("Pointer was released by Shadow DOM!"); + events.push("lostpointercapture@content"); + if(window.promise_test && shadow_dom_test){ + shadow_dom_test.step(function(){ + assert_array_equals(events, ["pointerdown@content", + "gotpointercapture@content", "pointerup@content", + "lostpointercapture@content"]); + resolve_test(); + }); + } + }); + + var shadow_dom_test = null; + var resolve_test = null; + var reject_test = null; + + function cleanup(){ + events = []; + shadow_dom_test = null; + resolve_test = null; + reject_test = null; + } + if(window.promise_test){ - promise_test(function(t){ - return new Promise(function(resolve, reject){ + promise_test(async function(t){ + var actions_promise; + return new Promise(async function(resolve, reject){ shadow_dom_test = t; resolve_test = resolve; reject_test = reject; @@ -100,11 +100,14 @@ }); var contentRect = content.getBoundingClientRect(); var actions = new test_driver.Actions(); - var actions_promise = actions - .pointerMove(contentRect.x, contentRect.y) - .pointerDown({button: actions.ButtonType.LEFT}) - .pointerUp({button: actions.ButtonType.LEFT}) - .send(); + actions_promise = actions + .pointerMove(Math.ceil(contentRect.x), Math.ceil(contentRect.y)) + .pointerDown({button: actions.ButtonType.LEFT}) + .pointerUp({button: actions.ButtonType.LEFT}) + .send(); + }).then(async ()=>{ + await actions_promise; + t.done(); }); }, "PointerCapture works for Shadow DOM element."); }
diff --git a/third_party/blink/web_tests/external/wpt/trusted-types/default-policy-callback-arguments.tentative.https.html b/third_party/blink/web_tests/external/wpt/trusted-types/default-policy-callback-arguments.tentative.https.html new file mode 100644 index 0000000..5944b0e --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/trusted-types/default-policy-callback-arguments.tentative.https.html
@@ -0,0 +1,47 @@ +<!DOCTYPE html> +<head> + <script src="/resources/testharness.js"></script> + <script src="/resources/testharnessreport.js"></script> + <meta http-equiv="Content-Security-Policy" + content="require-trusted-types-for 'script'"> +</head> +<body> + <div id="log"></div> + <div id="div"></div> + <script id="script"></script> + <script> + var current_case = undefined; + function checker(...args) { + assert_equals(args.length, 3); + assert_true(current_case && current_case.length == 4); + assert_equals(args[0], current_case[0], "Expecting the value."); + assert_equals(args[1], current_case[1], "Expecting the type name."); + assert_equals(args[2], current_case[2], "Expecting the sink name."); + return args[0]; + } + + trustedTypes.createPolicy("default", { + createHTML: checker, + createScript: checker, + createScriptURL: checker + }); + + const div = document.getElementById("div"); + const script = document.getElementById("script"); + const cases = [ + [ "abc", "TrustedHTML", "Element innerHTML", + _ => div.innerHTML = "abc" ], + [ "2+2", "TrustedScript", "Node textContent", + _ => script.textContent = "2+2" ], + [ "about:blank", "TrustedScriptURL", "HTMLScriptElement src", + _ => script.src = "about:blank" ], + ]; + for (var tc of cases) { + test(t => { + current_case = tc; + tc[3](); + }, `Test callback arguments, case ${tc[2]}`); + } + </script> +</body> +
diff --git a/third_party/blink/web_tests/external/wpt/webrtc/RTCRtpParameters-codecs.html b/third_party/blink/web_tests/external/wpt/webrtc/RTCRtpParameters-codecs.html index fdb58446..f5fa65e2 100644 --- a/third_party/blink/web_tests/external/wpt/webrtc/RTCRtpParameters-codecs.html +++ b/third_party/blink/web_tests/external/wpt/webrtc/RTCRtpParameters-codecs.html
@@ -28,7 +28,6 @@ sequence<RTCRtpHeaderExtensionParameters> headerExtensions; RTCRtcpParameters rtcp; sequence<RTCRtpCodecParameters> codecs; - RTCDegradationPreference degradationPreference; }; dictionary RTCRtpCodecParameters {
diff --git a/third_party/blink/web_tests/external/wpt/webrtc/RTCRtpParameters-degradationPreference-expected.txt b/third_party/blink/web_tests/external/wpt/webrtc/RTCRtpParameters-degradationPreference-expected.txt deleted file mode 100644 index 57b1f47..0000000 --- a/third_party/blink/web_tests/external/wpt/webrtc/RTCRtpParameters-degradationPreference-expected.txt +++ /dev/null
@@ -1,5 +0,0 @@ -This is a testharness.js-based test. -FAIL setParameters with degradationPreference set should succeed assert_equals: Expect initial param.degradationPreference to be balanced expected (string) "balanced" but got (undefined) undefined -FAIL setParameters with degradationPreference unset should succeed assert_equals: Expect initial param.degradationPreference to be balanced expected (string) "balanced" but got (undefined) undefined -Harness: the test ran to completion. -
diff --git a/third_party/blink/web_tests/external/wpt/webrtc/RTCRtpParameters-degradationPreference.html b/third_party/blink/web_tests/external/wpt/webrtc/RTCRtpParameters-degradationPreference.html deleted file mode 100644 index e2c92bc1..0000000 --- a/third_party/blink/web_tests/external/wpt/webrtc/RTCRtpParameters-degradationPreference.html +++ /dev/null
@@ -1,87 +0,0 @@ -<!doctype html> -<meta charset=utf-8> -<title>RTCRtpParameters degradationPreference</title> -<script src="/resources/testharness.js"></script> -<script src="/resources/testharnessreport.js"></script> -<script src="dictionary-helper.js"></script> -<script src="RTCRtpParameters-helper.js"></script> -<script> - 'use strict'; - - // Test is based on the following editor draft: - // https://w3c.github.io/webrtc-pc/archives/20170605/webrtc.html - - // The following helper functions are called from RTCRtpParameters-helper.js: - // validateSenderRtpParameters - - /* - 5.2. RTCRtpSender Interface - interface RTCRtpSender { - Promise<void> setParameters(optional RTCRtpParameters parameters); - RTCRtpParameters getParameters(); - }; - - dictionary RTCRtpParameters { - DOMString transactionId; - sequence<RTCRtpEncodingParameters> encodings; - sequence<RTCRtpHeaderExtensionParameters> headerExtensions; - RTCRtcpParameters rtcp; - sequence<RTCRtpCodecParameters> codecs; - RTCDegradationPreference degradationPreference; - }; - - enum RTCDegradationPreference { - "maintain-framerate", - "maintain-resolution", - "balanced" - }; - - - degradationPreference is set to the last value passed into setParameters, - or the default value of "balanced" if setParameters hasn't been called. - */ - - promise_test(t => { - const pc = new RTCPeerConnection(); - t.add_cleanup(() => pc.close()); - const { sender } = pc.addTransceiver('audio'); - - const param = sender.getParameters(); - validateSenderRtpParameters(param); - - assert_equals(param.degradationPreference, 'balanced', - 'Expect initial param.degradationPreference to be balanced'); - - param.degradationPreference = 'maintain-framerate'; - - return pc.setParameters(param) - .then(() => { - const param = sender.getParameters(); - validateSenderRtpParameters(param); - - assert_equals(param.degradationPreference, 'maintain-framerate'); - }); - }, 'setParameters with degradationPreference set should succeed'); - - promise_test(t => { - const pc = new RTCPeerConnection(); - t.add_cleanup(() => pc.close()); - const { sender } = pc.addTransceiver('audio'); - - const param = sender.getParameters(); - validateSenderRtpParameters(param); - - assert_equals(param.degradationPreference, 'balanced', - 'Expect initial param.degradationPreference to be balanced'); - - param.degradationPreference = undefined; - - return pc.setParameters(param) - .then(() => { - const param = sender.getParameters(); - validateSenderRtpParameters(param); - - assert_equals(param.degradationPreference, undefined); - }); - }, 'setParameters with degradationPreference unset should succeed'); - -</script>
diff --git a/third_party/blink/web_tests/external/wpt/webrtc/RTCRtpParameters-encodings.html b/third_party/blink/web_tests/external/wpt/webrtc/RTCRtpParameters-encodings.html index 2f94186..00e80885 100644 --- a/third_party/blink/web_tests/external/wpt/webrtc/RTCRtpParameters-encodings.html +++ b/third_party/blink/web_tests/external/wpt/webrtc/RTCRtpParameters-encodings.html
@@ -41,7 +41,6 @@ sequence<RTCRtpHeaderExtensionParameters> headerExtensions; RTCRtcpParameters rtcp; sequence<RTCRtpCodecParameters> codecs; - RTCDegradationPreference degradationPreference; }; dictionary RTCRtpEncodingParameters {
diff --git a/third_party/blink/web_tests/external/wpt/webrtc/RTCRtpParameters-headerExtensions.html b/third_party/blink/web_tests/external/wpt/webrtc/RTCRtpParameters-headerExtensions.html index 85c3338..7de2b75f 100644 --- a/third_party/blink/web_tests/external/wpt/webrtc/RTCRtpParameters-headerExtensions.html +++ b/third_party/blink/web_tests/external/wpt/webrtc/RTCRtpParameters-headerExtensions.html
@@ -27,7 +27,6 @@ sequence<RTCRtpHeaderExtensionParameters> headerExtensions; RTCRtcpParameters rtcp; sequence<RTCRtpCodecParameters> codecs; - RTCDegradationPreference degradationPreference; }; dictionary RTCRtpHeaderExtensionParameters {
diff --git a/third_party/blink/web_tests/external/wpt/webrtc/RTCRtpParameters-helper.js b/third_party/blink/web_tests/external/wpt/webrtc/RTCRtpParameters-helper.js index d61d8e149..17ecfbaf 100644 --- a/third_party/blink/web_tests/external/wpt/webrtc/RTCRtpParameters-helper.js +++ b/third_party/blink/web_tests/external/wpt/webrtc/RTCRtpParameters-helper.js
@@ -46,9 +46,6 @@ - rtcp.cname is set to the CNAME of the associated RTCPeerConnection. rtcp.reducedSize is set to true if reduced-size RTCP has been negotiated for sending, and false otherwise. - - - degradationPreference is set to the last value passed into setParameters, or the - default value of "balanced" if setParameters hasn't been called. */ function validateSenderRtpParameters(param) { validateRtpParameters(param); @@ -80,7 +77,7 @@ - rtcp.reducedSize is set to true if the receiver is currently prepared to receive reduced-size RTCP packets, and false otherwise. rtcp.cname is left undefined. - - transactionId and degradationPreference are left undefined. + - transactionId is left undefined. */ function validateReceiverRtpParameters(param) { validateRtpParameters(param); @@ -93,9 +90,6 @@ assert_equals(param.rtcp.cname, undefined, 'Expect receiver param.rtcp.cname to be unset'); - - assert_equals(param.degradationPreference, undefined, - 'Expect receiver param.degradationPreference to be unset'); } /* @@ -105,7 +99,6 @@ sequence<RTCRtpHeaderExtensionParameters> headerExtensions; RTCRtcpParameters rtcp; sequence<RTCRtpCodecParameters> codecs; - RTCDegradationPreference degradationPreference; }; enum RTCDegradationPreference { @@ -134,9 +127,6 @@ for(const codec of param.codecs) { validateCodecParameters(codec); } - - assert_optional_enum_field(param, 'degradationPreference', - ['maintain-framerate', 'maintain-resolution', 'balanced']); } /* @@ -307,4 +297,4 @@ const encoding2 = getFirstEncoding(param2); assert_equals(encoding2[field], value2); }, desc + ' without RTCRtpTransceiverInit'); -} \ No newline at end of file +}
diff --git a/third_party/blink/web_tests/external/wpt/webrtc/RTCRtpParameters-rtcp.html b/third_party/blink/web_tests/external/wpt/webrtc/RTCRtpParameters-rtcp.html index 82fb49b..7965304 100644 --- a/third_party/blink/web_tests/external/wpt/webrtc/RTCRtpParameters-rtcp.html +++ b/third_party/blink/web_tests/external/wpt/webrtc/RTCRtpParameters-rtcp.html
@@ -27,7 +27,6 @@ sequence<RTCRtpHeaderExtensionParameters> headerExtensions; RTCRtcpParameters rtcp; sequence<RTCRtpCodecParameters> codecs; - RTCDegradationPreference degradationPreference; }; dictionary RTCRtcpParameters {
diff --git a/third_party/blink/web_tests/external/wpt/webrtc/RTCRtpParameters-transactionId.html b/third_party/blink/web_tests/external/wpt/webrtc/RTCRtpParameters-transactionId.html index ae56fb4..a7b7865 100644 --- a/third_party/blink/web_tests/external/wpt/webrtc/RTCRtpParameters-transactionId.html +++ b/third_party/blink/web_tests/external/wpt/webrtc/RTCRtpParameters-transactionId.html
@@ -48,7 +48,6 @@ sequence<RTCRtpHeaderExtensionParameters> headerExtensions; RTCRtcpParameters rtcp; sequence<RTCRtpCodecParameters> codecs; - RTCDegradationPreference degradationPreference; }; getParameters
diff --git a/third_party/blink/web_tests/external/wpt/webrtc/RTCRtpReceiver-getParameters.html b/third_party/blink/web_tests/external/wpt/webrtc/RTCRtpReceiver-getParameters.html index 7f8ac67..4be0e3b9 100644 --- a/third_party/blink/web_tests/external/wpt/webrtc/RTCRtpReceiver-getParameters.html +++ b/third_party/blink/web_tests/external/wpt/webrtc/RTCRtpReceiver-getParameters.html
@@ -30,9 +30,7 @@ - rtcp.reducedSize is set to true if the receiver is currently prepared to receive reduced-size RTCP packets, and false otherwise. rtcp.cname is left undefined. - - - transactionId and degradationPreference are left undefined. - */ + */ promise_test(async t => { const pc = new RTCPeerConnection(); t.add_cleanup(() => pc.close());
diff --git a/third_party/blink/web_tests/external/wpt/xhr/setrequestheader-header-allowed-expected.txt b/third_party/blink/web_tests/external/wpt/xhr/setrequestheader-header-allowed-expected.txt new file mode 100644 index 0000000..1ec807d --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/xhr/setrequestheader-header-allowed-expected.txt
@@ -0,0 +1,13 @@ +This is a testharness.js-based test. +PASS XMLHttpRequest: setRequestHeader() - headers that are allowed (Authorization) +PASS XMLHttpRequest: setRequestHeader() - headers that are allowed (Pragma) +FAIL XMLHttpRequest: setRequestHeader() - headers that are allowed (User-Agent) assert_equals: expected "User-Agent," but got "" +PASS XMLHttpRequest: setRequestHeader() - headers that are allowed (Content-Transfer-Encoding) +PASS XMLHttpRequest: setRequestHeader() - headers that are allowed (Content-Type) +PASS XMLHttpRequest: setRequestHeader() - headers that are allowed (Overwrite) +PASS XMLHttpRequest: setRequestHeader() - headers that are allowed (If) +PASS XMLHttpRequest: setRequestHeader() - headers that are allowed (Status-URI) +PASS XMLHttpRequest: setRequestHeader() - headers that are allowed (X-Pink-Unicorn) +PASS XMLHttpRequest: setRequestHeader() - headers that are allowed (!#$%&'*+-.^_`|~0123456789abcdefghijklmnopqrstuvwxyz) +Harness: the test ran to completion. +
diff --git a/third_party/blink/web_tests/fast/forms/file/display-none-upload-button-expected.txt b/third_party/blink/web_tests/fast/forms/file/display-none-upload-button-expected.txt index 710a434f..4ce7201d 100644 --- a/third_party/blink/web_tests/fast/forms/file/display-none-upload-button-expected.txt +++ b/third_party/blink/web_tests/fast/forms/file/display-none-upload-button-expected.txt
@@ -1,4 +1,4 @@ -FAIL document.querySelector('input').offsetHeight > 10 should be true. Was false. +PASS document.querySelector('input').offsetHeight > 10 is true PASS successfullyParsed is true TEST COMPLETE
diff --git a/third_party/blink/web_tests/flag-specific/composite-after-paint/fast/forms/form-element-geometry-expected.png b/third_party/blink/web_tests/flag-specific/composite-after-paint/fast/forms/form-element-geometry-expected.png deleted file mode 100644 index b308a31..0000000 --- a/third_party/blink/web_tests/flag-specific/composite-after-paint/fast/forms/form-element-geometry-expected.png +++ /dev/null Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/composite-after-paint/fast/forms/select/listbox-appearance-basic-expected.png b/third_party/blink/web_tests/flag-specific/composite-after-paint/fast/forms/select/listbox-appearance-basic-expected.png deleted file mode 100644 index ab77753f..0000000 --- a/third_party/blink/web_tests/flag-specific/composite-after-paint/fast/forms/select/listbox-appearance-basic-expected.png +++ /dev/null Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/composite-after-paint/fast/forms/select/listbox-clip-expected.png b/third_party/blink/web_tests/flag-specific/composite-after-paint/fast/forms/select/listbox-clip-expected.png deleted file mode 100644 index 24a1cce..0000000 --- a/third_party/blink/web_tests/flag-specific/composite-after-paint/fast/forms/select/listbox-clip-expected.png +++ /dev/null Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/composite-after-paint/fast/forms/select/listbox-scrollbar-incremental-load-expected.png b/third_party/blink/web_tests/flag-specific/composite-after-paint/fast/forms/select/listbox-scrollbar-incremental-load-expected.png deleted file mode 100644 index d5a6750..0000000 --- a/third_party/blink/web_tests/flag-specific/composite-after-paint/fast/forms/select/listbox-scrollbar-incremental-load-expected.png +++ /dev/null Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/composite-after-paint/fast/forms/select/menulist-appearance-basic-expected.png b/third_party/blink/web_tests/flag-specific/composite-after-paint/fast/forms/select/menulist-appearance-basic-expected.png deleted file mode 100644 index 7d76964..0000000 --- a/third_party/blink/web_tests/flag-specific/composite-after-paint/fast/forms/select/menulist-appearance-basic-expected.png +++ /dev/null Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/composite-after-paint/fast/forms/select/select-initial-position-expected.png b/third_party/blink/web_tests/flag-specific/composite-after-paint/fast/forms/select/select-initial-position-expected.png deleted file mode 100644 index 8bd0728..0000000 --- a/third_party/blink/web_tests/flag-specific/composite-after-paint/fast/forms/select/select-initial-position-expected.png +++ /dev/null Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/composite-after-paint/fast/forms/select/select-overflow-scroll-expected.png b/third_party/blink/web_tests/flag-specific/composite-after-paint/fast/forms/select/select-overflow-scroll-expected.png deleted file mode 100644 index 2aef380..0000000 --- a/third_party/blink/web_tests/flag-specific/composite-after-paint/fast/forms/select/select-overflow-scroll-expected.png +++ /dev/null Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/composite-after-paint/fast/forms/select/select-overflow-scroll-inherited-expected.png b/third_party/blink/web_tests/flag-specific/composite-after-paint/fast/forms/select/select-overflow-scroll-inherited-expected.png deleted file mode 100644 index 1daea05..0000000 --- a/third_party/blink/web_tests/flag-specific/composite-after-paint/fast/forms/select/select-overflow-scroll-inherited-expected.png +++ /dev/null Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/composite-after-paint/fast/frames/frame-set-scaling-rotate-expected.png b/third_party/blink/web_tests/flag-specific/composite-after-paint/fast/frames/frame-set-scaling-rotate-expected.png deleted file mode 100644 index c9a2f89..0000000 --- a/third_party/blink/web_tests/flag-specific/composite-after-paint/fast/frames/frame-set-scaling-rotate-expected.png +++ /dev/null Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/composite-after-paint/fast/frames/frame-set-scaling-skew-expected.png b/third_party/blink/web_tests/flag-specific/composite-after-paint/fast/frames/frame-set-scaling-skew-expected.png deleted file mode 100644 index 05108ce..0000000 --- a/third_party/blink/web_tests/flag-specific/composite-after-paint/fast/frames/frame-set-scaling-skew-expected.png +++ /dev/null Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/composite-after-paint/fragmentation/outline-crossing-columns-expected.png b/third_party/blink/web_tests/flag-specific/composite-after-paint/fragmentation/outline-crossing-columns-expected.png deleted file mode 100644 index c89db93..0000000 --- a/third_party/blink/web_tests/flag-specific/composite-after-paint/fragmentation/outline-crossing-columns-expected.png +++ /dev/null Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/composite-after-paint/paint/invalidation/scroll/iframe-scroll-repaint-expected.txt b/third_party/blink/web_tests/flag-specific/composite-after-paint/paint/invalidation/scroll/iframe-scroll-repaint-expected.txt new file mode 100644 index 0000000..82c7392 --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/composite-after-paint/paint/invalidation/scroll/iframe-scroll-repaint-expected.txt
@@ -0,0 +1,11 @@ +{ + "layers": [ + { + "name": "Scrolling background of LayoutView #document", + "bounds": [800, 600], + "contentsOpaque": true, + "backgroundColor": "#FFFFFF" + } + ] +} +
diff --git a/third_party/blink/web_tests/flag-specific/composite-after-paint/paint/invalidation/scroll/repaint-composited-child-in-scrolled-container-expected.txt b/third_party/blink/web_tests/flag-specific/composite-after-paint/paint/invalidation/scroll/repaint-composited-child-in-scrolled-container-expected.txt index 4b768f2..9d3237e5 100644 --- a/third_party/blink/web_tests/flag-specific/composite-after-paint/paint/invalidation/scroll/repaint-composited-child-in-scrolled-container-expected.txt +++ b/third_party/blink/web_tests/flag-specific/composite-after-paint/paint/invalidation/scroll/repaint-composited-child-in-scrolled-container-expected.txt
@@ -6,7 +6,6 @@ "contentsOpaque": true, "backgroundColor": "#FFFFFF", "invalidations": [ - [8, 8, 285, 285], [8, 293, 285, 15] ] },
diff --git a/third_party/blink/web_tests/flag-specific/composite-after-paint/paint/invalidation/scroll/repaint-during-scroll-with-zoom-expected.txt b/third_party/blink/web_tests/flag-specific/composite-after-paint/paint/invalidation/scroll/repaint-during-scroll-with-zoom-expected.txt index 96df02e..e4baced2 100644 --- a/third_party/blink/web_tests/flag-specific/composite-after-paint/paint/invalidation/scroll/repaint-during-scroll-with-zoom-expected.txt +++ b/third_party/blink/web_tests/flag-specific/composite-after-paint/paint/invalidation/scroll/repaint-during-scroll-with-zoom-expected.txt
@@ -6,8 +6,8 @@ "contentsOpaque": true, "backgroundColor": "#C0C0C0", "invalidations": [ - [3, 65, 235, 235], [3, 300, 235, 15], + [3, 65, 55, 17], [238, 65, 15, 235] ] }
diff --git a/third_party/blink/web_tests/flag-specific/composite-after-paint/scrollbars/listbox-scrollbar-combinations-expected.png b/third_party/blink/web_tests/flag-specific/composite-after-paint/scrollbars/listbox-scrollbar-combinations-expected.png deleted file mode 100644 index 53e8b82..0000000 --- a/third_party/blink/web_tests/flag-specific/composite-after-paint/scrollbars/listbox-scrollbar-combinations-expected.png +++ /dev/null Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/composite-after-paint/virtual/prefer_compositing_to_lcd_text/scrollbars/listbox-scrollbar-combinations-expected.png b/third_party/blink/web_tests/flag-specific/composite-after-paint/virtual/prefer_compositing_to_lcd_text/scrollbars/listbox-scrollbar-combinations-expected.png deleted file mode 100644 index 53e8b82..0000000 --- a/third_party/blink/web_tests/flag-specific/composite-after-paint/virtual/prefer_compositing_to_lcd_text/scrollbars/listbox-scrollbar-combinations-expected.png +++ /dev/null Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/composite-after-paint/virtual/use-common-select-popup/virtual/controls-refresh/color-scheme/select/select-multiple-appearance-basic-expected.png b/third_party/blink/web_tests/flag-specific/composite-after-paint/virtual/use-common-select-popup/virtual/controls-refresh/color-scheme/select/select-multiple-appearance-basic-expected.png deleted file mode 100644 index 2f945f3..0000000 --- a/third_party/blink/web_tests/flag-specific/composite-after-paint/virtual/use-common-select-popup/virtual/controls-refresh/color-scheme/select/select-multiple-appearance-basic-expected.png +++ /dev/null Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/disable-layout-ng/fast/forms/file/display-none-upload-button-expected.txt b/third_party/blink/web_tests/flag-specific/disable-layout-ng/fast/forms/file/display-none-upload-button-expected.txt new file mode 100644 index 0000000..710a434f --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/disable-layout-ng/fast/forms/file/display-none-upload-button-expected.txt
@@ -0,0 +1,6 @@ +FAIL document.querySelector('input').offsetHeight > 10 should be true. Was false. +PASS successfullyParsed is true + +TEST COMPLETE + +Tests that a display:none upload button works.
diff --git a/third_party/blink/web_tests/flag-specific/disable-layout-ng/fast/forms/file/file-appearance-basic-expected.png b/third_party/blink/web_tests/flag-specific/disable-layout-ng/fast/forms/file/file-appearance-basic-expected.png new file mode 100644 index 0000000..493fb74 --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/disable-layout-ng/fast/forms/file/file-appearance-basic-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/disable-layout-ng/fast/forms/file/file-appearance-bidi-filenames-expected.png b/third_party/blink/web_tests/flag-specific/disable-layout-ng/fast/forms/file/file-appearance-bidi-filenames-expected.png new file mode 100644 index 0000000..8fc0f6b --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/disable-layout-ng/fast/forms/file/file-appearance-bidi-filenames-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/disable-layout-ng/paint/invalidation/overflow/composited-overflow-local-background-removed-expected.txt b/third_party/blink/web_tests/flag-specific/disable-layout-ng/paint/invalidation/overflow/composited-overflow-local-background-removed-expected.txt index bce2b25..e34c0cb 100644 --- a/third_party/blink/web_tests/flag-specific/disable-layout-ng/paint/invalidation/overflow/composited-overflow-local-background-removed-expected.txt +++ b/third_party/blink/web_tests/flag-specific/disable-layout-ng/paint/invalidation/overflow/composited-overflow-local-background-removed-expected.txt
@@ -9,9 +9,6 @@ { "name": "LayoutBlockFlow DIV id='scroller'", "bounds": [200, 200], - "invalidations": [ - [0, 0, 200, 200] - ], "transform": 1 }, {
diff --git a/third_party/blink/web_tests/paint/invalidation/overflow/composited-overflow-local-background-removed-expected.txt b/third_party/blink/web_tests/paint/invalidation/overflow/composited-overflow-local-background-removed-expected.txt index 93e198c..fcd10555 100644 --- a/third_party/blink/web_tests/paint/invalidation/overflow/composited-overflow-local-background-removed-expected.txt +++ b/third_party/blink/web_tests/paint/invalidation/overflow/composited-overflow-local-background-removed-expected.txt
@@ -9,9 +9,6 @@ { "name": "LayoutNGBlockFlow DIV id='scroller'", "bounds": [200, 200], - "invalidations": [ - [0, 0, 200, 200] - ], "transform": 1 }, {
diff --git a/third_party/blink/web_tests/platform/linux/fast/forms/file/file-appearance-basic-expected.png b/third_party/blink/web_tests/platform/linux/fast/forms/file/file-appearance-basic-expected.png index 493fb74..a0a18f7 100644 --- a/third_party/blink/web_tests/platform/linux/fast/forms/file/file-appearance-basic-expected.png +++ b/third_party/blink/web_tests/platform/linux/fast/forms/file/file-appearance-basic-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/fast/forms/file/file-appearance-bidi-filenames-expected.png b/third_party/blink/web_tests/platform/linux/fast/forms/file/file-appearance-bidi-filenames-expected.png index 8fc0f6b..92403c4 100644 --- a/third_party/blink/web_tests/platform/linux/fast/forms/file/file-appearance-bidi-filenames-expected.png +++ b/third_party/blink/web_tests/platform/linux/fast/forms/file/file-appearance-bidi-filenames-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/virtual/controls-refresh-hc/virtual/controls-refresh/color-scheme/file/file-appearance-basic-expected.png b/third_party/blink/web_tests/platform/linux/virtual/controls-refresh-hc/virtual/controls-refresh/color-scheme/file/file-appearance-basic-expected.png index d9d36e2..7bd23ae 100644 --- a/third_party/blink/web_tests/platform/linux/virtual/controls-refresh-hc/virtual/controls-refresh/color-scheme/file/file-appearance-basic-expected.png +++ b/third_party/blink/web_tests/platform/linux/virtual/controls-refresh-hc/virtual/controls-refresh/color-scheme/file/file-appearance-basic-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/virtual/controls-refresh/color-scheme/file/file-appearance-basic-expected.png b/third_party/blink/web_tests/platform/linux/virtual/controls-refresh/color-scheme/file/file-appearance-basic-expected.png index c696e021..db11dc6 100644 --- a/third_party/blink/web_tests/platform/linux/virtual/controls-refresh/color-scheme/file/file-appearance-basic-expected.png +++ b/third_party/blink/web_tests/platform/linux/virtual/controls-refresh/color-scheme/file/file-appearance-basic-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/virtual/dark-color-scheme/meter/meter-appearance-basic-expected.png b/third_party/blink/web_tests/platform/linux/virtual/dark-color-scheme/meter/meter-appearance-basic-expected.png new file mode 100644 index 0000000..89eeabd --- /dev/null +++ b/third_party/blink/web_tests/platform/linux/virtual/dark-color-scheme/meter/meter-appearance-basic-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/virtual/form-controls-refresh-disabled/fast/forms/file/file-appearance-basic-expected.png b/third_party/blink/web_tests/platform/linux/virtual/form-controls-refresh-disabled/fast/forms/file/file-appearance-basic-expected.png index d4855cf..0590c94 100644 --- a/third_party/blink/web_tests/platform/linux/virtual/form-controls-refresh-disabled/fast/forms/file/file-appearance-basic-expected.png +++ b/third_party/blink/web_tests/platform/linux/virtual/form-controls-refresh-disabled/fast/forms/file/file-appearance-basic-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/linux/virtual/form-controls-refresh-disabled/fast/forms/file/file-appearance-bidi-filenames-expected.png b/third_party/blink/web_tests/platform/linux/virtual/form-controls-refresh-disabled/fast/forms/file/file-appearance-bidi-filenames-expected.png index 4dab7cf0..e2ddf95 100644 --- a/third_party/blink/web_tests/platform/linux/virtual/form-controls-refresh-disabled/fast/forms/file/file-appearance-bidi-filenames-expected.png +++ b/third_party/blink/web_tests/platform/linux/virtual/form-controls-refresh-disabled/fast/forms/file/file-appearance-bidi-filenames-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac-mac10.10/fast/forms/form-element-geometry-expected.png b/third_party/blink/web_tests/platform/mac-mac10.10/fast/forms/form-element-geometry-expected.png index 0f7452ae..88a63803 100644 --- a/third_party/blink/web_tests/platform/mac-mac10.10/fast/forms/form-element-geometry-expected.png +++ b/third_party/blink/web_tests/platform/mac-mac10.10/fast/forms/form-element-geometry-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac-mac10.10/virtual/form-controls-refresh-disabled/fast/forms/file/file-appearance-basic-expected.png b/third_party/blink/web_tests/platform/mac-mac10.10/virtual/form-controls-refresh-disabled/fast/forms/file/file-appearance-basic-expected.png index de67ed7..1b55df72 100644 --- a/third_party/blink/web_tests/platform/mac-mac10.10/virtual/form-controls-refresh-disabled/fast/forms/file/file-appearance-basic-expected.png +++ b/third_party/blink/web_tests/platform/mac-mac10.10/virtual/form-controls-refresh-disabled/fast/forms/file/file-appearance-basic-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac-mac10.10/virtual/form-controls-refresh-disabled/fast/forms/file/file-appearance-bidi-filenames-expected.png b/third_party/blink/web_tests/platform/mac-mac10.10/virtual/form-controls-refresh-disabled/fast/forms/file/file-appearance-bidi-filenames-expected.png index d5a35135..fa8b07e 100644 --- a/third_party/blink/web_tests/platform/mac-mac10.10/virtual/form-controls-refresh-disabled/fast/forms/file/file-appearance-bidi-filenames-expected.png +++ b/third_party/blink/web_tests/platform/mac-mac10.10/virtual/form-controls-refresh-disabled/fast/forms/file/file-appearance-bidi-filenames-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac-mac10.10/virtual/form-controls-refresh-disabled/fast/forms/file/file-input-direction-expected.png b/third_party/blink/web_tests/platform/mac-mac10.10/virtual/form-controls-refresh-disabled/fast/forms/file/file-input-direction-expected.png index 323b26e2..6fc053d 100644 --- a/third_party/blink/web_tests/platform/mac-mac10.10/virtual/form-controls-refresh-disabled/fast/forms/file/file-input-direction-expected.png +++ b/third_party/blink/web_tests/platform/mac-mac10.10/virtual/form-controls-refresh-disabled/fast/forms/file/file-input-direction-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac-mac10.10/virtual/form-controls-refresh-disabled/fast/forms/file/file-input-pressed-state-expected.png b/third_party/blink/web_tests/platform/mac-mac10.10/virtual/form-controls-refresh-disabled/fast/forms/file/file-input-pressed-state-expected.png index 4774d308..1cb4127 100644 --- a/third_party/blink/web_tests/platform/mac-mac10.10/virtual/form-controls-refresh-disabled/fast/forms/file/file-input-pressed-state-expected.png +++ b/third_party/blink/web_tests/platform/mac-mac10.10/virtual/form-controls-refresh-disabled/fast/forms/file/file-input-pressed-state-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac-mac10.10/virtual/form-controls-refresh-disabled/fast/forms/file/input-file-re-render-expected.png b/third_party/blink/web_tests/platform/mac-mac10.10/virtual/form-controls-refresh-disabled/fast/forms/file/input-file-re-render-expected.png index 3b40d97..2beda95 100644 --- a/third_party/blink/web_tests/platform/mac-mac10.10/virtual/form-controls-refresh-disabled/fast/forms/file/input-file-re-render-expected.png +++ b/third_party/blink/web_tests/platform/mac-mac10.10/virtual/form-controls-refresh-disabled/fast/forms/file/input-file-re-render-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac-mac10.10/virtual/form-controls-refresh-disabled/fast/forms/form-element-geometry-expected.png b/third_party/blink/web_tests/platform/mac-mac10.10/virtual/form-controls-refresh-disabled/fast/forms/form-element-geometry-expected.png index c00dbec2..527cca2 100644 --- a/third_party/blink/web_tests/platform/mac-mac10.10/virtual/form-controls-refresh-disabled/fast/forms/form-element-geometry-expected.png +++ b/third_party/blink/web_tests/platform/mac-mac10.10/virtual/form-controls-refresh-disabled/fast/forms/form-element-geometry-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac-mac10.10/virtual/form-controls-refresh-disabled/fast/forms/input-appearance-height-expected.png b/third_party/blink/web_tests/platform/mac-mac10.10/virtual/form-controls-refresh-disabled/fast/forms/input-appearance-height-expected.png index ad37de8..5fb9509 100644 --- a/third_party/blink/web_tests/platform/mac-mac10.10/virtual/form-controls-refresh-disabled/fast/forms/input-appearance-height-expected.png +++ b/third_party/blink/web_tests/platform/mac-mac10.10/virtual/form-controls-refresh-disabled/fast/forms/input-appearance-height-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac-mac10.10/virtual/form-controls-refresh-disabled/fast/forms/input-value-expected.png b/third_party/blink/web_tests/platform/mac-mac10.10/virtual/form-controls-refresh-disabled/fast/forms/input-value-expected.png index 31d6e0a..c123410 100644 --- a/third_party/blink/web_tests/platform/mac-mac10.10/virtual/form-controls-refresh-disabled/fast/forms/input-value-expected.png +++ b/third_party/blink/web_tests/platform/mac-mac10.10/virtual/form-controls-refresh-disabled/fast/forms/input-value-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac-mac10.11/fast/forms/file/file-appearance-bidi-filenames-expected.png b/third_party/blink/web_tests/platform/mac-mac10.11/fast/forms/file/file-appearance-bidi-filenames-expected.png index ba211a9..c6c48b80 100644 --- a/third_party/blink/web_tests/platform/mac-mac10.11/fast/forms/file/file-appearance-bidi-filenames-expected.png +++ b/third_party/blink/web_tests/platform/mac-mac10.11/fast/forms/file/file-appearance-bidi-filenames-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac-mac10.11/virtual/form-controls-refresh-disabled/fast/forms/file/file-appearance-basic-expected.png b/third_party/blink/web_tests/platform/mac-mac10.11/virtual/form-controls-refresh-disabled/fast/forms/file/file-appearance-basic-expected.png index 2d811a1..79b1419 100644 --- a/third_party/blink/web_tests/platform/mac-mac10.11/virtual/form-controls-refresh-disabled/fast/forms/file/file-appearance-basic-expected.png +++ b/third_party/blink/web_tests/platform/mac-mac10.11/virtual/form-controls-refresh-disabled/fast/forms/file/file-appearance-basic-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac-mac10.11/virtual/form-controls-refresh-disabled/fast/forms/file/file-appearance-bidi-filenames-expected.png b/third_party/blink/web_tests/platform/mac-mac10.11/virtual/form-controls-refresh-disabled/fast/forms/file/file-appearance-bidi-filenames-expected.png index 40b1d63..f56b3249 100644 --- a/third_party/blink/web_tests/platform/mac-mac10.11/virtual/form-controls-refresh-disabled/fast/forms/file/file-appearance-bidi-filenames-expected.png +++ b/third_party/blink/web_tests/platform/mac-mac10.11/virtual/form-controls-refresh-disabled/fast/forms/file/file-appearance-bidi-filenames-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac-mac10.11/virtual/form-controls-refresh-disabled/fast/forms/file/file-input-direction-expected.png b/third_party/blink/web_tests/platform/mac-mac10.11/virtual/form-controls-refresh-disabled/fast/forms/file/file-input-direction-expected.png index 77659d68..dc92d5e0 100644 --- a/third_party/blink/web_tests/platform/mac-mac10.11/virtual/form-controls-refresh-disabled/fast/forms/file/file-input-direction-expected.png +++ b/third_party/blink/web_tests/platform/mac-mac10.11/virtual/form-controls-refresh-disabled/fast/forms/file/file-input-direction-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac-mac10.11/virtual/form-controls-refresh-disabled/fast/forms/file/file-input-pressed-state-expected.png b/third_party/blink/web_tests/platform/mac-mac10.11/virtual/form-controls-refresh-disabled/fast/forms/file/file-input-pressed-state-expected.png index f4b5364..d2d30e9 100644 --- a/third_party/blink/web_tests/platform/mac-mac10.11/virtual/form-controls-refresh-disabled/fast/forms/file/file-input-pressed-state-expected.png +++ b/third_party/blink/web_tests/platform/mac-mac10.11/virtual/form-controls-refresh-disabled/fast/forms/file/file-input-pressed-state-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac-mac10.11/virtual/form-controls-refresh-disabled/fast/forms/file/input-file-re-render-expected.png b/third_party/blink/web_tests/platform/mac-mac10.11/virtual/form-controls-refresh-disabled/fast/forms/file/input-file-re-render-expected.png index 5797009..dcb507ab 100644 --- a/third_party/blink/web_tests/platform/mac-mac10.11/virtual/form-controls-refresh-disabled/fast/forms/file/input-file-re-render-expected.png +++ b/third_party/blink/web_tests/platform/mac-mac10.11/virtual/form-controls-refresh-disabled/fast/forms/file/input-file-re-render-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac-mac10.11/virtual/form-controls-refresh-disabled/fast/forms/form-element-geometry-expected.png b/third_party/blink/web_tests/platform/mac-mac10.11/virtual/form-controls-refresh-disabled/fast/forms/form-element-geometry-expected.png index 5a0f92f..bdf7982 100644 --- a/third_party/blink/web_tests/platform/mac-mac10.11/virtual/form-controls-refresh-disabled/fast/forms/form-element-geometry-expected.png +++ b/third_party/blink/web_tests/platform/mac-mac10.11/virtual/form-controls-refresh-disabled/fast/forms/form-element-geometry-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac-mac10.11/virtual/form-controls-refresh-disabled/fast/forms/input-appearance-height-expected.png b/third_party/blink/web_tests/platform/mac-mac10.11/virtual/form-controls-refresh-disabled/fast/forms/input-appearance-height-expected.png index c1a960c..191da37 100644 --- a/third_party/blink/web_tests/platform/mac-mac10.11/virtual/form-controls-refresh-disabled/fast/forms/input-appearance-height-expected.png +++ b/third_party/blink/web_tests/platform/mac-mac10.11/virtual/form-controls-refresh-disabled/fast/forms/input-appearance-height-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac-mac10.11/virtual/form-controls-refresh-disabled/fast/forms/input-value-expected.png b/third_party/blink/web_tests/platform/mac-mac10.11/virtual/form-controls-refresh-disabled/fast/forms/input-value-expected.png index 8cf866e..5bd74355 100644 --- a/third_party/blink/web_tests/platform/mac-mac10.11/virtual/form-controls-refresh-disabled/fast/forms/input-value-expected.png +++ b/third_party/blink/web_tests/platform/mac-mac10.11/virtual/form-controls-refresh-disabled/fast/forms/input-value-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac-mac10.12/fast/forms/file/file-appearance-bidi-filenames-expected.png b/third_party/blink/web_tests/platform/mac-mac10.12/fast/forms/file/file-appearance-bidi-filenames-expected.png index 2ff08f9..025af1e 100644 --- a/third_party/blink/web_tests/platform/mac-mac10.12/fast/forms/file/file-appearance-bidi-filenames-expected.png +++ b/third_party/blink/web_tests/platform/mac-mac10.12/fast/forms/file/file-appearance-bidi-filenames-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac-mac10.12/fast/forms/form-element-geometry-expected.png b/third_party/blink/web_tests/platform/mac-mac10.12/fast/forms/form-element-geometry-expected.png index ac1cbf92..ab623605 100644 --- a/third_party/blink/web_tests/platform/mac-mac10.12/fast/forms/form-element-geometry-expected.png +++ b/third_party/blink/web_tests/platform/mac-mac10.12/fast/forms/form-element-geometry-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac-mac10.12/virtual/form-controls-refresh-disabled/fast/forms/file/file-appearance-basic-expected.png b/third_party/blink/web_tests/platform/mac-mac10.12/virtual/form-controls-refresh-disabled/fast/forms/file/file-appearance-basic-expected.png index f42c22a7a..b06b91cb 100644 --- a/third_party/blink/web_tests/platform/mac-mac10.12/virtual/form-controls-refresh-disabled/fast/forms/file/file-appearance-basic-expected.png +++ b/third_party/blink/web_tests/platform/mac-mac10.12/virtual/form-controls-refresh-disabled/fast/forms/file/file-appearance-basic-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac-mac10.12/virtual/form-controls-refresh-disabled/fast/forms/file/file-appearance-bidi-filenames-expected.png b/third_party/blink/web_tests/platform/mac-mac10.12/virtual/form-controls-refresh-disabled/fast/forms/file/file-appearance-bidi-filenames-expected.png index 9c93487..b0d7a6e 100644 --- a/third_party/blink/web_tests/platform/mac-mac10.12/virtual/form-controls-refresh-disabled/fast/forms/file/file-appearance-bidi-filenames-expected.png +++ b/third_party/blink/web_tests/platform/mac-mac10.12/virtual/form-controls-refresh-disabled/fast/forms/file/file-appearance-bidi-filenames-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac-mac10.12/virtual/form-controls-refresh-disabled/fast/forms/form-element-geometry-expected.png b/third_party/blink/web_tests/platform/mac-mac10.12/virtual/form-controls-refresh-disabled/fast/forms/form-element-geometry-expected.png index 65bcde4..7e622ab6d 100644 --- a/third_party/blink/web_tests/platform/mac-mac10.12/virtual/form-controls-refresh-disabled/fast/forms/form-element-geometry-expected.png +++ b/third_party/blink/web_tests/platform/mac-mac10.12/virtual/form-controls-refresh-disabled/fast/forms/form-element-geometry-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac-mac10.12/virtual/form-controls-refresh-disabled/fast/forms/input-value-expected.png b/third_party/blink/web_tests/platform/mac-mac10.12/virtual/form-controls-refresh-disabled/fast/forms/input-value-expected.png index 0261aa9..612805b 100644 --- a/third_party/blink/web_tests/platform/mac-mac10.12/virtual/form-controls-refresh-disabled/fast/forms/input-value-expected.png +++ b/third_party/blink/web_tests/platform/mac-mac10.12/virtual/form-controls-refresh-disabled/fast/forms/input-value-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac-mac10.13/fast/forms/file/file-appearance-bidi-filenames-expected.png b/third_party/blink/web_tests/platform/mac-mac10.13/fast/forms/file/file-appearance-bidi-filenames-expected.png index 0bda409..4588995 100644 --- a/third_party/blink/web_tests/platform/mac-mac10.13/fast/forms/file/file-appearance-bidi-filenames-expected.png +++ b/third_party/blink/web_tests/platform/mac-mac10.13/fast/forms/file/file-appearance-bidi-filenames-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac-mac10.13/virtual/form-controls-refresh-disabled/fast/forms/file/file-appearance-basic-expected.png b/third_party/blink/web_tests/platform/mac-mac10.13/virtual/form-controls-refresh-disabled/fast/forms/file/file-appearance-basic-expected.png index 0146c47..ef6281ef 100644 --- a/third_party/blink/web_tests/platform/mac-mac10.13/virtual/form-controls-refresh-disabled/fast/forms/file/file-appearance-basic-expected.png +++ b/third_party/blink/web_tests/platform/mac-mac10.13/virtual/form-controls-refresh-disabled/fast/forms/file/file-appearance-basic-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac-mac10.13/virtual/form-controls-refresh-disabled/fast/forms/file/file-appearance-bidi-filenames-expected.png b/third_party/blink/web_tests/platform/mac-mac10.13/virtual/form-controls-refresh-disabled/fast/forms/file/file-appearance-bidi-filenames-expected.png index 2675959..0e243e9 100644 --- a/third_party/blink/web_tests/platform/mac-mac10.13/virtual/form-controls-refresh-disabled/fast/forms/file/file-appearance-bidi-filenames-expected.png +++ b/third_party/blink/web_tests/platform/mac-mac10.13/virtual/form-controls-refresh-disabled/fast/forms/file/file-appearance-bidi-filenames-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac-mac10.13/virtual/form-controls-refresh-disabled/fast/forms/file/file-input-direction-expected.png b/third_party/blink/web_tests/platform/mac-mac10.13/virtual/form-controls-refresh-disabled/fast/forms/file/file-input-direction-expected.png index 7161c29..9742d39 100644 --- a/third_party/blink/web_tests/platform/mac-mac10.13/virtual/form-controls-refresh-disabled/fast/forms/file/file-input-direction-expected.png +++ b/third_party/blink/web_tests/platform/mac-mac10.13/virtual/form-controls-refresh-disabled/fast/forms/file/file-input-direction-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac-mac10.13/virtual/form-controls-refresh-disabled/fast/forms/file/file-input-pressed-state-expected.png b/third_party/blink/web_tests/platform/mac-mac10.13/virtual/form-controls-refresh-disabled/fast/forms/file/file-input-pressed-state-expected.png index de5f5da..bf82441 100644 --- a/third_party/blink/web_tests/platform/mac-mac10.13/virtual/form-controls-refresh-disabled/fast/forms/file/file-input-pressed-state-expected.png +++ b/third_party/blink/web_tests/platform/mac-mac10.13/virtual/form-controls-refresh-disabled/fast/forms/file/file-input-pressed-state-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac-mac10.13/virtual/form-controls-refresh-disabled/fast/forms/file/input-file-re-render-expected.png b/third_party/blink/web_tests/platform/mac-mac10.13/virtual/form-controls-refresh-disabled/fast/forms/file/input-file-re-render-expected.png index 5f2480d..cf9cf24a1 100644 --- a/third_party/blink/web_tests/platform/mac-mac10.13/virtual/form-controls-refresh-disabled/fast/forms/file/input-file-re-render-expected.png +++ b/third_party/blink/web_tests/platform/mac-mac10.13/virtual/form-controls-refresh-disabled/fast/forms/file/input-file-re-render-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac-mac10.13/virtual/form-controls-refresh-disabled/fast/forms/form-element-geometry-expected.png b/third_party/blink/web_tests/platform/mac-mac10.13/virtual/form-controls-refresh-disabled/fast/forms/form-element-geometry-expected.png index f9a4ad1..01533740 100644 --- a/third_party/blink/web_tests/platform/mac-mac10.13/virtual/form-controls-refresh-disabled/fast/forms/form-element-geometry-expected.png +++ b/third_party/blink/web_tests/platform/mac-mac10.13/virtual/form-controls-refresh-disabled/fast/forms/form-element-geometry-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac-mac10.13/virtual/form-controls-refresh-disabled/fast/forms/input-appearance-height-expected.png b/third_party/blink/web_tests/platform/mac-mac10.13/virtual/form-controls-refresh-disabled/fast/forms/input-appearance-height-expected.png index 6436f8f..d0c64fd 100644 --- a/third_party/blink/web_tests/platform/mac-mac10.13/virtual/form-controls-refresh-disabled/fast/forms/input-appearance-height-expected.png +++ b/third_party/blink/web_tests/platform/mac-mac10.13/virtual/form-controls-refresh-disabled/fast/forms/input-appearance-height-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac-mac10.13/virtual/form-controls-refresh-disabled/fast/forms/input-value-expected.png b/third_party/blink/web_tests/platform/mac-mac10.13/virtual/form-controls-refresh-disabled/fast/forms/input-value-expected.png index b7582527..b663377 100644 --- a/third_party/blink/web_tests/platform/mac-mac10.13/virtual/form-controls-refresh-disabled/fast/forms/input-value-expected.png +++ b/third_party/blink/web_tests/platform/mac-mac10.13/virtual/form-controls-refresh-disabled/fast/forms/input-value-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac/fast/files/file-in-input-display-expected.png b/third_party/blink/web_tests/platform/mac/fast/files/file-in-input-display-expected.png index 7011c91e..9d007647 100644 --- a/third_party/blink/web_tests/platform/mac/fast/files/file-in-input-display-expected.png +++ b/third_party/blink/web_tests/platform/mac/fast/files/file-in-input-display-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac/fast/forms/file/file-appearance-basic-expected.png b/third_party/blink/web_tests/platform/mac/fast/forms/file/file-appearance-basic-expected.png index 785080bf..6114e9e 100644 --- a/third_party/blink/web_tests/platform/mac/fast/forms/file/file-appearance-basic-expected.png +++ b/third_party/blink/web_tests/platform/mac/fast/forms/file/file-appearance-basic-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac/fast/forms/file/file-appearance-bidi-filenames-expected.png b/third_party/blink/web_tests/platform/mac/fast/forms/file/file-appearance-bidi-filenames-expected.png index 5430af4..1583b77 100644 --- a/third_party/blink/web_tests/platform/mac/fast/forms/file/file-appearance-bidi-filenames-expected.png +++ b/third_party/blink/web_tests/platform/mac/fast/forms/file/file-appearance-bidi-filenames-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac/fast/forms/file/file-input-direction-expected.png b/third_party/blink/web_tests/platform/mac/fast/forms/file/file-input-direction-expected.png index bf0d7fd8..5d0bc8f 100644 --- a/third_party/blink/web_tests/platform/mac/fast/forms/file/file-input-direction-expected.png +++ b/third_party/blink/web_tests/platform/mac/fast/forms/file/file-input-direction-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac/fast/forms/file/file-input-pressed-state-expected.png b/third_party/blink/web_tests/platform/mac/fast/forms/file/file-input-pressed-state-expected.png index b75e05e2..8212ebd7f 100644 --- a/third_party/blink/web_tests/platform/mac/fast/forms/file/file-input-pressed-state-expected.png +++ b/third_party/blink/web_tests/platform/mac/fast/forms/file/file-input-pressed-state-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac/fast/forms/file/input-file-re-render-expected.png b/third_party/blink/web_tests/platform/mac/fast/forms/file/input-file-re-render-expected.png index 113940e..626c6d0 100644 --- a/third_party/blink/web_tests/platform/mac/fast/forms/file/input-file-re-render-expected.png +++ b/third_party/blink/web_tests/platform/mac/fast/forms/file/input-file-re-render-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac/fast/forms/form-element-geometry-expected.png b/third_party/blink/web_tests/platform/mac/fast/forms/form-element-geometry-expected.png index fff8f0a..41a69a8a 100644 --- a/third_party/blink/web_tests/platform/mac/fast/forms/form-element-geometry-expected.png +++ b/third_party/blink/web_tests/platform/mac/fast/forms/form-element-geometry-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac/fast/forms/input-appearance-height-expected.png b/third_party/blink/web_tests/platform/mac/fast/forms/input-appearance-height-expected.png index ceb2a22..15a7be9 100644 --- a/third_party/blink/web_tests/platform/mac/fast/forms/input-appearance-height-expected.png +++ b/third_party/blink/web_tests/platform/mac/fast/forms/input-appearance-height-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac/fast/forms/input-value-expected.png b/third_party/blink/web_tests/platform/mac/fast/forms/input-value-expected.png index 8bac8dff..33710d6 100644 --- a/third_party/blink/web_tests/platform/mac/fast/forms/input-value-expected.png +++ b/third_party/blink/web_tests/platform/mac/fast/forms/input-value-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac/http/tests/filesystem/input-display-expected.png b/third_party/blink/web_tests/platform/mac/http/tests/filesystem/input-display-expected.png index 7011c91e..9d007647 100644 --- a/third_party/blink/web_tests/platform/mac/http/tests/filesystem/input-display-expected.png +++ b/third_party/blink/web_tests/platform/mac/http/tests/filesystem/input-display-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac/paint/invalidation/overflow/composited-overflow-local-background-removed-expected.txt b/third_party/blink/web_tests/platform/mac/paint/invalidation/overflow/composited-overflow-local-background-removed-expected.txt index faa1bdeb..5b20b8b6 100644 --- a/third_party/blink/web_tests/platform/mac/paint/invalidation/overflow/composited-overflow-local-background-removed-expected.txt +++ b/third_party/blink/web_tests/platform/mac/paint/invalidation/overflow/composited-overflow-local-background-removed-expected.txt
@@ -9,9 +9,6 @@ { "name": "LayoutNGBlockFlow DIV id='scroller'", "bounds": [200, 200], - "invalidations": [ - [0, 0, 200, 200] - ], "transform": 1 }, {
diff --git a/third_party/blink/web_tests/platform/mac/virtual/controls-refresh-hc/virtual/controls-refresh/color-scheme/button/button-appearance-basic-expected.png b/third_party/blink/web_tests/platform/mac/virtual/controls-refresh-hc/virtual/controls-refresh/color-scheme/button/button-appearance-basic-expected.png index 44ec3c2f..dd85044 100644 --- a/third_party/blink/web_tests/platform/mac/virtual/controls-refresh-hc/virtual/controls-refresh/color-scheme/button/button-appearance-basic-expected.png +++ b/third_party/blink/web_tests/platform/mac/virtual/controls-refresh-hc/virtual/controls-refresh/color-scheme/button/button-appearance-basic-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac/virtual/controls-refresh-hc/virtual/controls-refresh/color-scheme/file/file-appearance-basic-expected.png b/third_party/blink/web_tests/platform/mac/virtual/controls-refresh-hc/virtual/controls-refresh/color-scheme/file/file-appearance-basic-expected.png index cebe1b0..6317c99 100644 --- a/third_party/blink/web_tests/platform/mac/virtual/controls-refresh-hc/virtual/controls-refresh/color-scheme/file/file-appearance-basic-expected.png +++ b/third_party/blink/web_tests/platform/mac/virtual/controls-refresh-hc/virtual/controls-refresh/color-scheme/file/file-appearance-basic-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac/virtual/controls-refresh/color-scheme/button/button-appearance-basic-expected.png b/third_party/blink/web_tests/platform/mac/virtual/controls-refresh/color-scheme/button/button-appearance-basic-expected.png index bc845e7a..db92103 100644 --- a/third_party/blink/web_tests/platform/mac/virtual/controls-refresh/color-scheme/button/button-appearance-basic-expected.png +++ b/third_party/blink/web_tests/platform/mac/virtual/controls-refresh/color-scheme/button/button-appearance-basic-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac/virtual/controls-refresh/color-scheme/file/file-appearance-basic-expected.png b/third_party/blink/web_tests/platform/mac/virtual/controls-refresh/color-scheme/file/file-appearance-basic-expected.png index d329cbd..9d8f436 100644 --- a/third_party/blink/web_tests/platform/mac/virtual/controls-refresh/color-scheme/file/file-appearance-basic-expected.png +++ b/third_party/blink/web_tests/platform/mac/virtual/controls-refresh/color-scheme/file/file-appearance-basic-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac/virtual/dark-color-scheme/button/button-appearance-basic-expected.png b/third_party/blink/web_tests/platform/mac/virtual/dark-color-scheme/button/button-appearance-basic-expected.png index 637e1dd..cf457954 100644 --- a/third_party/blink/web_tests/platform/mac/virtual/dark-color-scheme/button/button-appearance-basic-expected.png +++ b/third_party/blink/web_tests/platform/mac/virtual/dark-color-scheme/button/button-appearance-basic-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac/virtual/dark-color-scheme/meter/meter-appearance-basic-expected.png b/third_party/blink/web_tests/platform/mac/virtual/dark-color-scheme/meter/meter-appearance-basic-expected.png new file mode 100644 index 0000000..b779ed5 --- /dev/null +++ b/third_party/blink/web_tests/platform/mac/virtual/dark-color-scheme/meter/meter-appearance-basic-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac/virtual/form-controls-refresh-disabled/fast/forms/file/file-appearance-basic-expected.png b/third_party/blink/web_tests/platform/mac/virtual/form-controls-refresh-disabled/fast/forms/file/file-appearance-basic-expected.png index 304afb0..d73d5487 100644 --- a/third_party/blink/web_tests/platform/mac/virtual/form-controls-refresh-disabled/fast/forms/file/file-appearance-basic-expected.png +++ b/third_party/blink/web_tests/platform/mac/virtual/form-controls-refresh-disabled/fast/forms/file/file-appearance-basic-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac/virtual/form-controls-refresh-disabled/fast/forms/file/file-appearance-bidi-filenames-expected.png b/third_party/blink/web_tests/platform/mac/virtual/form-controls-refresh-disabled/fast/forms/file/file-appearance-bidi-filenames-expected.png index c43df5c..add8405 100644 --- a/third_party/blink/web_tests/platform/mac/virtual/form-controls-refresh-disabled/fast/forms/file/file-appearance-bidi-filenames-expected.png +++ b/third_party/blink/web_tests/platform/mac/virtual/form-controls-refresh-disabled/fast/forms/file/file-appearance-bidi-filenames-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac/virtual/form-controls-refresh-disabled/fast/forms/file/file-input-direction-expected.png b/third_party/blink/web_tests/platform/mac/virtual/form-controls-refresh-disabled/fast/forms/file/file-input-direction-expected.png index 4dc23636..bf151b0 100644 --- a/third_party/blink/web_tests/platform/mac/virtual/form-controls-refresh-disabled/fast/forms/file/file-input-direction-expected.png +++ b/third_party/blink/web_tests/platform/mac/virtual/form-controls-refresh-disabled/fast/forms/file/file-input-direction-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac/virtual/form-controls-refresh-disabled/fast/forms/file/file-input-pressed-state-expected.png b/third_party/blink/web_tests/platform/mac/virtual/form-controls-refresh-disabled/fast/forms/file/file-input-pressed-state-expected.png index aa46072..95159871 100644 --- a/third_party/blink/web_tests/platform/mac/virtual/form-controls-refresh-disabled/fast/forms/file/file-input-pressed-state-expected.png +++ b/third_party/blink/web_tests/platform/mac/virtual/form-controls-refresh-disabled/fast/forms/file/file-input-pressed-state-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac/virtual/form-controls-refresh-disabled/fast/forms/file/input-file-re-render-expected.png b/third_party/blink/web_tests/platform/mac/virtual/form-controls-refresh-disabled/fast/forms/file/input-file-re-render-expected.png index 0f5ee50..530a555f 100644 --- a/third_party/blink/web_tests/platform/mac/virtual/form-controls-refresh-disabled/fast/forms/file/input-file-re-render-expected.png +++ b/third_party/blink/web_tests/platform/mac/virtual/form-controls-refresh-disabled/fast/forms/file/input-file-re-render-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac/virtual/form-controls-refresh-disabled/fast/forms/form-element-geometry-expected.png b/third_party/blink/web_tests/platform/mac/virtual/form-controls-refresh-disabled/fast/forms/form-element-geometry-expected.png index 9d20943..68cec74 100644 --- a/third_party/blink/web_tests/platform/mac/virtual/form-controls-refresh-disabled/fast/forms/form-element-geometry-expected.png +++ b/third_party/blink/web_tests/platform/mac/virtual/form-controls-refresh-disabled/fast/forms/form-element-geometry-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac/virtual/form-controls-refresh-disabled/fast/forms/input-appearance-height-expected.png b/third_party/blink/web_tests/platform/mac/virtual/form-controls-refresh-disabled/fast/forms/input-appearance-height-expected.png index 991324c..dc12b3fc 100644 --- a/third_party/blink/web_tests/platform/mac/virtual/form-controls-refresh-disabled/fast/forms/input-appearance-height-expected.png +++ b/third_party/blink/web_tests/platform/mac/virtual/form-controls-refresh-disabled/fast/forms/input-appearance-height-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/mac/virtual/form-controls-refresh-disabled/fast/forms/input-value-expected.png b/third_party/blink/web_tests/platform/mac/virtual/form-controls-refresh-disabled/fast/forms/input-value-expected.png index 8de28aad..9987cf09 100644 --- a/third_party/blink/web_tests/platform/mac/virtual/form-controls-refresh-disabled/fast/forms/input-value-expected.png +++ b/third_party/blink/web_tests/platform/mac/virtual/form-controls-refresh-disabled/fast/forms/input-value-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/fast/forms/file/file-appearance-basic-expected.png b/third_party/blink/web_tests/platform/win/fast/forms/file/file-appearance-basic-expected.png index fffb21f..a183c13 100644 --- a/third_party/blink/web_tests/platform/win/fast/forms/file/file-appearance-basic-expected.png +++ b/third_party/blink/web_tests/platform/win/fast/forms/file/file-appearance-basic-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/fast/forms/file/file-appearance-bidi-filenames-expected.png b/third_party/blink/web_tests/platform/win/fast/forms/file/file-appearance-bidi-filenames-expected.png index 1941048a..b61e4e9 100644 --- a/third_party/blink/web_tests/platform/win/fast/forms/file/file-appearance-bidi-filenames-expected.png +++ b/third_party/blink/web_tests/platform/win/fast/forms/file/file-appearance-bidi-filenames-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/virtual/controls-refresh-hc/virtual/controls-refresh/color-scheme/file/file-appearance-basic-expected.png b/third_party/blink/web_tests/platform/win/virtual/controls-refresh-hc/virtual/controls-refresh/color-scheme/file/file-appearance-basic-expected.png new file mode 100644 index 0000000..05fccb3 --- /dev/null +++ b/third_party/blink/web_tests/platform/win/virtual/controls-refresh-hc/virtual/controls-refresh/color-scheme/file/file-appearance-basic-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/virtual/controls-refresh/color-scheme/file/file-appearance-basic-expected.png b/third_party/blink/web_tests/platform/win/virtual/controls-refresh/color-scheme/file/file-appearance-basic-expected.png index f3cef2d..51870508 100644 --- a/third_party/blink/web_tests/platform/win/virtual/controls-refresh/color-scheme/file/file-appearance-basic-expected.png +++ b/third_party/blink/web_tests/platform/win/virtual/controls-refresh/color-scheme/file/file-appearance-basic-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/virtual/dark-color-scheme/meter/meter-appearance-basic-expected.png b/third_party/blink/web_tests/platform/win/virtual/dark-color-scheme/meter/meter-appearance-basic-expected.png new file mode 100644 index 0000000..89eeabd --- /dev/null +++ b/third_party/blink/web_tests/platform/win/virtual/dark-color-scheme/meter/meter-appearance-basic-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/virtual/form-controls-refresh-disabled/fast/forms/file/file-appearance-basic-expected.png b/third_party/blink/web_tests/platform/win/virtual/form-controls-refresh-disabled/fast/forms/file/file-appearance-basic-expected.png index 7c98f72..3e1e0d94 100644 --- a/third_party/blink/web_tests/platform/win/virtual/form-controls-refresh-disabled/fast/forms/file/file-appearance-basic-expected.png +++ b/third_party/blink/web_tests/platform/win/virtual/form-controls-refresh-disabled/fast/forms/file/file-appearance-basic-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win/virtual/form-controls-refresh-disabled/fast/forms/file/file-appearance-bidi-filenames-expected.png b/third_party/blink/web_tests/platform/win/virtual/form-controls-refresh-disabled/fast/forms/file/file-appearance-bidi-filenames-expected.png index 1b830eaf..39e8912d 100644 --- a/third_party/blink/web_tests/platform/win/virtual/form-controls-refresh-disabled/fast/forms/file/file-appearance-bidi-filenames-expected.png +++ b/third_party/blink/web_tests/platform/win/virtual/form-controls-refresh-disabled/fast/forms/file/file-appearance-bidi-filenames-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win7/fast/forms/file/file-appearance-bidi-filenames-expected.png b/third_party/blink/web_tests/platform/win7/fast/forms/file/file-appearance-bidi-filenames-expected.png index 3d091a0..94e2371 100644 --- a/third_party/blink/web_tests/platform/win7/fast/forms/file/file-appearance-bidi-filenames-expected.png +++ b/third_party/blink/web_tests/platform/win7/fast/forms/file/file-appearance-bidi-filenames-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/platform/win7/virtual/form-controls-refresh-disabled/fast/forms/file/file-appearance-bidi-filenames-expected.png b/third_party/blink/web_tests/platform/win7/virtual/form-controls-refresh-disabled/fast/forms/file/file-appearance-bidi-filenames-expected.png index 1c4c9f4..9b3145f9 100644 --- a/third_party/blink/web_tests/platform/win7/virtual/form-controls-refresh-disabled/fast/forms/file/file-appearance-bidi-filenames-expected.png +++ b/third_party/blink/web_tests/platform/win7/virtual/form-controls-refresh-disabled/fast/forms/file/file-appearance-bidi-filenames-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/typedcssom/computedstyle/transform.html b/third_party/blink/web_tests/typedcssom/computedstyle/transform.html new file mode 100644 index 0000000..ad08b94 --- /dev/null +++ b/third_party/blink/web_tests/typedcssom/computedstyle/transform.html
@@ -0,0 +1,92 @@ +<!DOCTYPE html> +<html> +<head> +<script src='../../resources/testharness.js'></script> +<script src='../../resources/testharnessreport.js'></script> +</head> +<style> + /* regression test for failing to unzoom transform coefficients */ + body { zoom: 1.5; } +</style> +<body> +<div id='testElement'></div> + +<script> + +var testElement = document.getElementById('testElement'); +var computedStyleMap = testElement.computedStyleMap(); + +test(function() { + var result = computedStyleMap.get('transform'); + assert_equals(result.toString(), 'none'); +}, 'transform is none by default'); + +test(function() { + testElement.style.transform = 'translate(100px, 30%)'; + var result = computedStyleMap.get('transform'); + assert_equals(result.toString(), 'translate(100px, 30%)'); +}, 'transform preserves a translate value'); + +test(function() { + testElement.style.transform = 'translate3d(100px, 30%, 40px)'; + var result = computedStyleMap.get('transform'); + assert_equals(result.toString(), 'translate3d(100px, 30%, 40px)'); +}, 'transform preserves a translate3d value'); + +test(function() { + testElement.style.transform = 'rotate(90deg)'; + var result = computedStyleMap.get('transform'); + assert_equals(result.toString(), 'rotate(90deg)'); +}, 'transform preserves a rotate value'); + +test(function() { + testElement.style.transform = 'rotate3d(0, 0, 1, 90deg)'; + var result = computedStyleMap.get('transform'); + assert_equals(result.toString(), 'rotate3d(0, 0, 1, 90deg)'); +}, 'transform preserves a rotate3d value'); + +test(function() { + testElement.style.transform = 'scale(1, 2)'; + var result = computedStyleMap.get('transform'); + assert_equals(result.toString(), 'scale(1, 2)'); +}, 'transform preserves a scale value'); + +test(function() { + testElement.style.transform = 'scale3d(1, 2, 3)'; + var result = computedStyleMap.get('transform'); + assert_equals(result.toString(), 'scale3d(1, 2, 3)'); +}, 'transform preserves a scale3d value'); + +test(function() { + testElement.style.transform = 'perspective(100px)'; + var result = computedStyleMap.get('transform'); + assert_equals(result.toString(), 'perspective(100px)'); +}, 'transform preserves a perspective value'); + +test(function() { + testElement.style.transform = 'skew(10deg, 10deg)'; + var result = computedStyleMap.get('transform'); + assert_equals(result.toString(), 'skew(10deg, 10deg)'); +}, 'transform preserves a skew value'); + +test(function() { + testElement.style.transform = 'matrix(1, 0, 0, 2, 3, 4)'; + var result = computedStyleMap.get('transform'); + assert_equals(result.toString(), 'matrix(1, 0, 0, 2, 3, 4)'); +}, 'transform preserves a matrix value'); + +test(function() { + testElement.style.transform = 'matrix3d(1, 0, 0, 0, 0, 2, 0, 0, 0, 0, 3, 0, 4, 5, 6, 1)'; + var result = computedStyleMap.get('transform'); + assert_equals(result.toString(), 'matrix3d(1, 0, 0, 0, 0, 2, 0, 0, 0, 0, 3, 0, 4, 5, 6, 1)'); +}, 'transform preserves a matrix3d value'); + +test(function() { + testElement.style.transform = 'matrix3d(1, 0, 0, 0.01, 0, 2, 0, 0.02, 0, 0, 3, 0.03, 4, 5, 6, 1)'; + var result = computedStyleMap.get('transform'); + assert_equals(result.toString(), 'matrix3d(1, 0, 0, 0.01, 0, 2, 0, 0.02, 0, 0, 3, 0.03, 4, 5, 6, 1)'); +}, 'transform preserves a matrix3d value with perspective'); + +</script> +</body> +</html>
diff --git a/third_party/blink/web_tests/virtual/controls-refresh-hc/virtual/controls-refresh/color-scheme/file/file-appearance-basic-expected.png b/third_party/blink/web_tests/virtual/controls-refresh-hc/virtual/controls-refresh/color-scheme/file/file-appearance-basic-expected.png deleted file mode 100644 index 774c51c..0000000 --- a/third_party/blink/web_tests/virtual/controls-refresh-hc/virtual/controls-refresh/color-scheme/file/file-appearance-basic-expected.png +++ /dev/null Binary files differ
diff --git a/third_party/blink/web_tests/virtual/dark-color-scheme/meter/meter-appearance-basic.html b/third_party/blink/web_tests/virtual/dark-color-scheme/meter/meter-appearance-basic.html new file mode 100644 index 0000000..2f2a7157 --- /dev/null +++ b/third_party/blink/web_tests/virtual/dark-color-scheme/meter/meter-appearance-basic.html
@@ -0,0 +1,20 @@ +<!DOCTYPE html> +<html> +<meta name="color-scheme" content="dark"> +<head> +<style> + meter.tall { width: 30px; height: 40px; } + meter { color-scheme:dark; } +</style> +</head> +<body> +<ul> + <li><meter min="0" max="100" low="30" high="60" optimum="100" value="80"></meter> + <meter min="0" max="100" low="30" high="60" optimum="100" value="45"></meter> + <meter min="0" max="100" low="30" high="60" optimum="100" value="25"></meter></li> + <li><meter class="tall" min="0" max="100" low="30" high="60" optimum="100" value="75"></meter> + <meter class="tall" min="0" max="100" low="30" high="60" optimum="100" value="45"></meter> + <meter class="tall" min="0" max="100" low="30" high="60" optimum="100" value="25"></meter></li> +</ul> +</body> +</html> \ No newline at end of file
diff --git a/third_party/closure_compiler/externs/bluetooth_private.js b/third_party/closure_compiler/externs/bluetooth_private.js index 8f8f8feb..39020d2d 100644 --- a/third_party/closure_compiler/externs/bluetooth_private.js +++ b/third_party/closure_compiler/externs/bluetooth_private.js
@@ -109,8 +109,10 @@ /** * Changes the state of the Bluetooth adapter. - * @param {!chrome.bluetoothPrivate.NewAdapterState} adapterState - * @param {function():void=} callback + * @param {!chrome.bluetoothPrivate.NewAdapterState} adapterState The new state + * of the adapter. + * @param {function():void=} callback Called when all the state changes have + * been completed. */ chrome.bluetoothPrivate.setAdapterState = function(adapterState, callback) {}; @@ -158,19 +160,19 @@ chrome.bluetoothPrivate.pair = function(deviceAddress, callback) {}; /** - * Record that a pairing attempt finished. Do not record cancellations. - * @param {boolean} success + * Record that a pairing attempt finished. Ignores cancellations. * @param {!chrome.bluetooth.Transport} transport * @param {number} pairingDurationMs + * @param {!chrome.bluetoothPrivate.ConnectResultType=} result */ -chrome.bluetoothPrivate.recordPairing = function(success, transport, pairingDurationMs) {}; +chrome.bluetoothPrivate.recordPairing = function(transport, pairingDurationMs, result) {}; /** * Record that a user-initiated reconnection attempt to an already paired device - * finished. Do not record cancellations. - * @param {boolean} success + * finished. Ignores cancellations. + * @param {!chrome.bluetoothPrivate.ConnectResultType=} result */ -chrome.bluetoothPrivate.recordReconnection = function(success) {}; +chrome.bluetoothPrivate.recordReconnection = function(result) {}; /** * Record that a user selected a device to connect to.
diff --git a/third_party/custom_tabs_client/BUILD.gn b/third_party/custom_tabs_client/BUILD.gn index 8fa4a910..c2950ac 100644 --- a/third_party/custom_tabs_client/BUILD.gn +++ b/third_party/custom_tabs_client/BUILD.gn
@@ -5,14 +5,58 @@ import("//build/config/android/rules.gni") android_resources("chrome_tabs_client_example_apk_resources") { - resource_dirs = [ "src/Application/src/main/res" ] + sources = [ + "src/Application/src/main/res/anim/slide_in_left.xml", + "src/Application/src/main/res/anim/slide_in_right.xml", + "src/Application/src/main/res/anim/slide_out_left.xml", + "src/Application/src/main/res/anim/slide_out_right.xml", + "src/Application/src/main/res/drawable-hdpi/ic_arrow_back.png", + "src/Application/src/main/res/drawable-hdpi/ic_launcher.png", + "src/Application/src/main/res/drawable-hdpi/ic_notification_icon.png", + "src/Application/src/main/res/drawable-hdpi/ic_play.png", + "src/Application/src/main/res/drawable-hdpi/ic_share.png", + "src/Application/src/main/res/drawable-hdpi/ic_stop.png", + "src/Application/src/main/res/drawable-mdpi/ic_arrow_back.png", + "src/Application/src/main/res/drawable-mdpi/ic_launcher.png", + "src/Application/src/main/res/drawable-mdpi/ic_notification_icon.png", + "src/Application/src/main/res/drawable-mdpi/ic_play.png", + "src/Application/src/main/res/drawable-mdpi/ic_share.png", + "src/Application/src/main/res/drawable-mdpi/ic_stop.png", + "src/Application/src/main/res/drawable-xhdpi/ic_arrow_back.png", + "src/Application/src/main/res/drawable-xhdpi/ic_launcher.png", + "src/Application/src/main/res/drawable-xhdpi/ic_notification_icon.png", + "src/Application/src/main/res/drawable-xhdpi/ic_play.png", + "src/Application/src/main/res/drawable-xhdpi/ic_share.png", + "src/Application/src/main/res/drawable-xhdpi/ic_stop.png", + "src/Application/src/main/res/drawable-xxhdpi/cover.jpg", + "src/Application/src/main/res/drawable-xxhdpi/ic_arrow_back.png", + "src/Application/src/main/res/drawable-xxhdpi/ic_launcher.png", + "src/Application/src/main/res/drawable-xxhdpi/ic_notification_icon.png", + "src/Application/src/main/res/drawable-xxhdpi/ic_play.png", + "src/Application/src/main/res/drawable-xxhdpi/ic_share.png", + "src/Application/src/main/res/drawable-xxhdpi/ic_stop.png", + "src/Application/src/main/res/drawable-xxxhdpi/ic_arrow_back.png", + "src/Application/src/main/res/drawable-xxxhdpi/ic_launcher.png", + "src/Application/src/main/res/drawable-xxxhdpi/ic_share.png", + "src/Application/src/main/res/layout/main.xml", + "src/Application/src/main/res/layout/remote_view.xml", + "src/Application/src/main/res/raw/amazing_grace.mp3", + "src/Application/src/main/res/values/strings.xml", + ] android_manifest = "src/Application/src/main/AndroidManifest.xml" custom_package = "org.chromium.customtabsclient" deps = [ "//third_party/android_deps:android_support_v7_appcompat_java" ] } android_resources("custom_tabs_support_resources") { - resource_dirs = [ "src/customtabs/res" ] + sources = [ + "src/customtabs/res/layout/browser_actions_context_menu_page.xml", + "src/customtabs/res/layout/browser_actions_context_menu_row.xml", + "src/customtabs/res/values/colors.xml", + "src/customtabs/res/values/dimens.xml", + "src/customtabs/res/values/strings.xml", + "src/customtabs/res/xml/image_share_filepaths.xml", + ] android_manifest = "src/customtabs/AndroidManifest.xml" custom_package = "android.support.customtabs" }
diff --git a/third_party/harfbuzz-ng/README.chromium b/third_party/harfbuzz-ng/README.chromium index 42e8361..20a50b4 100644 --- a/third_party/harfbuzz-ng/README.chromium +++ b/third_party/harfbuzz-ng/README.chromium
@@ -1,10 +1,10 @@ Name: harfbuzz-ng Short Name: harfbuzz-ng URL: http://harfbuzz.org -Version: 2.6.4-585 +Version: 2.6.4-722 CPEPrefix: cpe:/a:harfbuzz_project:harfbuzz:2.6.4 -Date: 20200303 -Revision: 558f922788ccceaa80c31bf0e379be4c96598d13 +Date: 20200401 +Revision: 014e038b2c2fd55e0bffbe5c5adc893c07df187a Security Critical: yes License: MIT License File: src/COPYING
diff --git a/third_party/libgav1/BUILD.gn b/third_party/libgav1/BUILD.gn index 8fb704c..9a31f42 100644 --- a/third_party/libgav1/BUILD.gn +++ b/third_party/libgav1/BUILD.gn
@@ -54,6 +54,7 @@ sources = gav1_common_sources sources += gav1_gav1_sources + sources += gav1_post_filter_sources sources += gav1_tile_sources } }
diff --git a/third_party/libgav1/README.chromium b/third_party/libgav1/README.chromium index 0887ee8..fc62bb71 100644 --- a/third_party/libgav1/README.chromium +++ b/third_party/libgav1/README.chromium
@@ -2,9 +2,9 @@ Short Name: libgav1 URL: https://chromium.googlesource.com/codecs/libgav1/ Version: 0 -Date: Thursday February 20 2020 +Date: Thursday March 26 2020 Branch: master -Commit: fa1c3c4e673cf12ffa22b8fbe4a7c79314571f1b +Commit: 638ef84819f8b3cd614dcf63378fe4814aa4cb2a License: Apache 2.0 License File: libgav1/LICENSE Security Critical: yes
diff --git a/third_party/libgav1/libgav1_srcs.gni b/third_party/libgav1/libgav1_srcs.gni index 85d525d..e460d03 100644 --- a/third_party/libgav1/libgav1_srcs.gni +++ b/third_party/libgav1/libgav1_srcs.gni
@@ -7,6 +7,7 @@ "//third_party/libgav1/src/src/decoder_impl.cc", "//third_party/libgav1/src/src/decoder_impl.h", "//third_party/libgav1/src/src/decoder_settings.cc", + "//third_party/libgav1/src/src/decoder_state.h", "//third_party/libgav1/src/src/film_grain.cc", "//third_party/libgav1/src/src/film_grain.h", "//third_party/libgav1/src/src/frame_buffer.cc", @@ -22,8 +23,6 @@ "//third_party/libgav1/src/src/motion_vector.h", "//third_party/libgav1/src/src/obu_parser.cc", "//third_party/libgav1/src/src/obu_parser.h", - "//third_party/libgav1/src/src/post_filter.cc", - "//third_party/libgav1/src/src/post_filter.h", "//third_party/libgav1/src/src/prediction_mask.cc", "//third_party/libgav1/src/src/prediction_mask.h", "//third_party/libgav1/src/src/quantizer.cc", @@ -74,6 +73,8 @@ "//third_party/libgav1/src/src/dsp/arm/mask_blend_neon.h", "//third_party/libgav1/src/src/dsp/arm/motion_field_projection_neon.cc", "//third_party/libgav1/src/src/dsp/arm/motion_field_projection_neon.h", + "//third_party/libgav1/src/src/dsp/arm/motion_vector_search_neon.cc", + "//third_party/libgav1/src/src/dsp/arm/motion_vector_search_neon.h", "//third_party/libgav1/src/src/dsp/arm/obmc_neon.cc", "//third_party/libgav1/src/src/dsp/arm/obmc_neon.h", "//third_party/libgav1/src/src/dsp/arm/super_res_neon.cc", @@ -112,6 +113,8 @@ "//third_party/libgav1/src/src/dsp/mask_blend.h", "//third_party/libgav1/src/src/dsp/motion_field_projection.cc", "//third_party/libgav1/src/src/dsp/motion_field_projection.h", + "//third_party/libgav1/src/src/dsp/motion_vector_search.cc", + "//third_party/libgav1/src/src/dsp/motion_vector_search.h", "//third_party/libgav1/src/src/dsp/obmc.cc", "//third_party/libgav1/src/src/dsp/obmc.h", "//third_party/libgav1/src/src/dsp/super_res.cc", @@ -122,6 +125,8 @@ "//third_party/libgav1/src/src/dsp/weight_mask.h", "//third_party/libgav1/src/src/dsp/x86/average_blend_sse4.cc", "//third_party/libgav1/src/src/dsp/x86/average_blend_sse4.h", + "//third_party/libgav1/src/src/dsp/x86/cdef_sse4.cc", + "//third_party/libgav1/src/src/dsp/x86/cdef_sse4.h", "//third_party/libgav1/src/src/dsp/x86/common_sse4.h", "//third_party/libgav1/src/src/dsp/x86/convolve_sse4.cc", "//third_party/libgav1/src/src/dsp/x86/convolve_sse4.h", @@ -146,6 +151,8 @@ "//third_party/libgav1/src/src/dsp/x86/super_res_sse4.cc", "//third_party/libgav1/src/src/dsp/x86/super_res_sse4.h", "//third_party/libgav1/src/src/dsp/x86/transpose_sse4.h", + "//third_party/libgav1/src/src/dsp/x86/warp_sse4.cc", + "//third_party/libgav1/src/src/dsp/x86/warp_sse4.h", "//third_party/libgav1/src/src/dsp/x86/weight_mask_sse4.cc", "//third_party/libgav1/src/src/dsp/x86/weight_mask_sse4.h", ] @@ -160,6 +167,15 @@ "//third_party/libgav1/src/src/gav1/version.h", ] +gav1_post_filter_sources = [ + "//third_party/libgav1/src/src/post_filter.h", + "//third_party/libgav1/src/src/post_filter/cdef.cc", + "//third_party/libgav1/src/src/post_filter/deblock.cc", + "//third_party/libgav1/src/src/post_filter/loop_restoration.cc", + "//third_party/libgav1/src/src/post_filter/post_filter.cc", + "//third_party/libgav1/src/src/post_filter/super_res.cc", +] + gav1_tile_sources = [ "//third_party/libgav1/src/src/tile.h", "//third_party/libgav1/src/src/tile/bitstream/mode_info.cc", @@ -186,6 +202,7 @@ "//third_party/libgav1/src/src/utils/constants.h", "//third_party/libgav1/src/src/utils/cpu.cc", "//third_party/libgav1/src/src/utils/cpu.h", + "//third_party/libgav1/src/src/utils/dynamic_buffer.h", "//third_party/libgav1/src/src/utils/entropy_decoder.cc", "//third_party/libgav1/src/src/utils/entropy_decoder.h", "//third_party/libgav1/src/src/utils/executor.cc",
diff --git a/third_party/libvpx/README.chromium b/third_party/libvpx/README.chromium index e7e8bd2..0abbb81 100644 --- a/third_party/libvpx/README.chromium +++ b/third_party/libvpx/README.chromium
@@ -6,9 +6,9 @@ License File: source/libvpx/LICENSE Security Critical: yes -Date: Wednesday March 04 2020 +Date: Tuesday March 31 2020 Branch: master -Commit: 5532775efe808cb0942e7b99bf2f232c6ce99fee +Commit: 667138e1f0581772de2b990e144bcd6c49a6adb8 Description: Contains the sources used to compile libvpx binaries used by Google Chrome and
diff --git a/third_party/libvpx/source/config/vpx_version.h b/third_party/libvpx/source/config/vpx_version.h index cc6a83c9..8f985cb 100644 --- a/third_party/libvpx/source/config/vpx_version.h +++ b/third_party/libvpx/source/config/vpx_version.h
@@ -2,8 +2,8 @@ #define VERSION_MAJOR 1 #define VERSION_MINOR 8 #define VERSION_PATCH 2 -#define VERSION_EXTRA "100-g5532775ef" +#define VERSION_EXTRA "125-g667138e1f" #define VERSION_PACKED \ ((VERSION_MAJOR << 16) | (VERSION_MINOR << 8) | (VERSION_PATCH)) -#define VERSION_STRING_NOSP "v1.8.2-100-g5532775ef" -#define VERSION_STRING " v1.8.2-100-g5532775ef" +#define VERSION_STRING_NOSP "v1.8.2-125-g667138e1f" +#define VERSION_STRING " v1.8.2-125-g667138e1f"
diff --git a/third_party/opus/README.chromium b/third_party/opus/README.chromium index ba64082..8f4ed5e 100644 --- a/third_party/opus/README.chromium +++ b/third_party/opus/README.chromium
@@ -16,6 +16,7 @@ * set 'x' flags: "chmod 750 win32/genversion.bat" * remove assertion messages in release builds (see crbug/1053572) * apply patch to fix int-overflow in silk (https://gitlab.xiph.org/xiph/opus/-/commit/923bebde) +* apply patch to fix another int-overflow in silk (https://gitlab.xiph.org/xiph/opus/-/commit/adcb7bc2) Opus' own unit tests are located in ./src/tests Additional chromium tests are located in ./tests
diff --git a/third_party/opus/src/silk/NSQ_del_dec.c b/third_party/opus/src/silk/NSQ_del_dec.c index baf17f4..00e749c 100644 --- a/third_party/opus/src/silk/NSQ_del_dec.c +++ b/third_party/opus/src/silk/NSQ_del_dec.c
@@ -451,7 +451,7 @@ /* Input minus prediction plus noise feedback */ /* r = x[ i ] - LTP_pred - LPC_pred + n_AR + n_Tilt + n_LF + n_LTP */ - tmp1 = silk_ADD32( n_AR_Q14, n_LF_Q14 ); /* Q14 */ + tmp1 = silk_ADD_SAT32( n_AR_Q14, n_LF_Q14 ); /* Q14 */ tmp2 = silk_ADD32( n_LTP_Q14, LPC_pred_Q14 ); /* Q13 */ tmp1 = silk_SUB_SAT32( tmp2, tmp1 ); /* Q13 */ tmp1 = silk_RSHIFT_ROUND( tmp1, 4 ); /* Q10 */
diff --git a/third_party/schema_org/README.chromium b/third_party/schema_org/README.chromium index f58b9b5..219e642 100644 --- a/third_party/schema_org/README.chromium +++ b/third_party/schema_org/README.chromium
@@ -1,7 +1,7 @@ Name: Schema.org is a collaborative, community activity with a mission to create, maintain, and promote schemas for structured data on the Internet. Short Name: schema_org -URL: http://schema.org/version/6.0/schema.jsonld +URL: http://schema.org/version/6.0/schema.jsonld Version: 6.0 Date: 20200121 License: Creative Commons Attribution-ShareAlike 3.0 Unported @@ -16,4 +16,5 @@ https://cs.chromium.org/chromium/src/third_party/blink/renderer/modules/document_metadata/ Local Modifications: -None. +The overrides file was created manually and is used to apply schema changes that +have not yet been released.
diff --git a/third_party/schema_org/overrides.jsonld b/third_party/schema_org/overrides.jsonld new file mode 100644 index 0000000..007bec1 --- /dev/null +++ b/third_party/schema_org/overrides.jsonld
@@ -0,0 +1,31 @@ +{ + "@context": { + "rdf": "http://www.w3.org/1999/02/22-rdf-syntax-ns#", + "rdfs": "http://www.w3.org/2000/01/rdf-schema#", + "xsd": "http://www.w3.org/2001/XMLSchema#" + }, + "@graph": [ + { + "@id": "http://schema.org/CompleteDataFeed", + "@type": "rdfs:Class", + "rdfs:comment": "A CompleteDataFeed is a DataFeed whose standard representation includes content for every item currently in the feed.", + "rdfs:label": "CompleteDataFeed", + "rdfs:subClassOf": { + "@id": "http://schema.org/DataFeed" + } + }, + { + "@id": "http://schema.org/target", + "@type": "rdf:Property", + "http://schema.org/domainIncludes": { + "@id": "http://schema.org/Action" + }, + "http://schema.org/rangeIncludes": [ + {"@id": "http://schema.org/EntryPoint"}, + {"@id": "http://schema.org/URL"} + ], + "rdfs:comment": "Indicates a target EntryPoint for an Action.", + "rdfs:label": "target" + } + ] +}
diff --git a/tools/idl_parser/idl_parser.py b/tools/idl_parser/idl_parser.py index b927905..f8e4d685 100755 --- a/tools/idl_parser/idl_parser.py +++ b/tools/idl_parser/idl_parser.py
@@ -44,7 +44,9 @@ from idl_node import IDLAttribute, IDLNode SRC_DIR = os.path.abspath(os.path.dirname(__file__)) -sys.path.insert(0, os.path.join(SRC_DIR, os.pardir, os.pardir, 'third_party')) +# Preserve sys.path[0] as is. +# https://docs.python.org/3/library/sys.html?highlight=path[0]#sys.path +sys.path.insert(1, os.path.join(SRC_DIR, os.pardir, os.pardir, 'third_party')) from ply import lex from ply import yacc
diff --git a/tools/mb/lib/validation.py b/tools/mb/lib/validation.py index c8f3ea2..3029649 100644 --- a/tools/mb/lib/validation.py +++ b/tools/mb/lib/validation.py
@@ -3,7 +3,9 @@ # found in the LICENSE file. """Validation functions for the Meta-Build config file""" +import ast import collections +import json def GetAllConfigsMaster(masters): @@ -132,6 +134,83 @@ 'responsible for public build artifacts.') +def _GetConfigsByBuilder(masters): + """Builds a mapping from buildername -> [config] + + Args + masters: the master's dict from mb_config.pyl + """ + + result = collections.defaultdict(list) + for master in masters.values(): + for buildername, builder in master.items(): + result[buildername].append(builder) + + return result + + +def CheckMasterBucketConsistency(errs, masters_file, buckets_file): + """Checks that mb_config_buckets.pyl is consistent with mb_config.pyl + + mb_config_buckets.pyl is a subset of mb_config.pyl. + Make sure all configs that do exist are consistent. + Populates errs with any errors + + Args: + errs: an accumulator for errors + masters_file: string form of mb_config.pyl + bucket_file: string form of mb_config_buckets.pyl + """ + master_contents = ast.literal_eval(masters_file) + bucket_contents = ast.literal_eval(buckets_file) + + def check_missing(bucket_dict, master_dict): + return [name for name in bucket_dict.keys() if name not in master_dict] + + # Cross check builders + configs_by_builder = _GetConfigsByBuilder(master_contents['masters']) + for builders in bucket_contents['buckets'].values(): + missing = check_missing(builders, configs_by_builder) + errs.extend('Builder "%s" from mb_config_buckets.pyl ' + 'not found in mb_config.pyl' % builder for builder in missing) + + for buildername, config in builders.items(): + if config not in configs_by_builder[buildername]: + errs.append('Builder "%s" from mb_config_buckets.pyl ' + 'doesn\'t match mb_config.pyl' % buildername) + + def check_mismatch(bucket_dict, master_dict): + mismatched = [] + for configname, config in bucket_dict.items(): + if configname in master_dict and config != master_dict[configname]: + mismatched.append(configname) + + return mismatched + + # Cross check configs + missing = check_missing(bucket_contents['configs'], + master_contents['configs']) + errs.extend('Config "%s" from mb_config_buckets.pyl ' + 'not found in mb_config.pyl' % config for config in missing) + + mismatched = check_mismatch(bucket_contents['configs'], + master_contents['configs']) + errs.extend( + 'Config "%s" from mb_config_buckets.pyl doesn\'t match mb_config.pyl' % + config for config in mismatched) + + # Cross check mixins + missing = check_missing(bucket_contents['mixins'], master_contents['mixins']) + errs.extend('Mixin "%s" from mb_config_buckets.pyl ' + 'not found in mb_config.pyl' % mixin for mixin in missing) + + mismatched = check_mismatch(bucket_contents['mixins'], + master_contents['mixins']) + errs.extend( + 'Mixin "%s" from mb_config_buckets.pyl doesn\'t match mb_config.pyl' % + mixin for mixin in mismatched) + + def CheckDuplicateConfigs(errs, config_pool, mixin_pool, grouping, flatten_config): """Check for duplicate configs.
diff --git a/tools/mb/mb.py b/tools/mb/mb.py index dfd14c5a..178084a 100755 --- a/tools/mb/mb.py +++ b/tools/mb/mb.py
@@ -383,7 +383,7 @@ return self.RunGNAnalyze(vals) def CmdExportBucket(self): - self.ReadConfigFile() + self.ReadConfigFile(self.args.config_file) obj = {} for bucket, builders in self.buckets.items(): obj[bucket] = {} @@ -418,7 +418,7 @@ if self.group_by_bucket: return self.CmdExportBucket() - self.ReadConfigFile() + self.ReadConfigFile(self.args.config_file) obj = {} for master, builders in self.masters.items(): obj[master] = {} @@ -795,11 +795,14 @@ self.buckets, FlattenConfig) if errs: - raise MBErr(('mb config file %s has problems:' % self.args.config_file) + - '\n ' + '\n '.join(errs)) + raise MBErr(('mb config file %s has problems:' % + (self.args.config_file if self.args.config_file else self. + default_config_bucket)) + '\n ' + '\n '.join(errs)) if print_ok: - self.Print('mb config file %s looks ok.' % self.args.config_file) + self.Print('mb config file %s looks ok.' % + (self.args.config_file + if self.args.config_file else self.default_config_bucket)) return 0 def CmdValidate(self, print_ok=True): @@ -808,15 +811,20 @@ # Validate both bucket and master configs if # a specific one isn't specified if getattr(self.args, 'config_file', None) is None: + # Cross reference bucket and master configs + # Bucket configs should be a subset of master configs, but consistent for + # any builders present in both. + validation.CheckMasterBucketConsistency( + errs, self.ReadFile(self.default_config_master), + self.ReadFile(self.default_config_bucket)) + # Read the file to make sure it parses. - self.args.config_file = self.default_config_bucket - self.ReadConfigFile() + self.ReadConfigFile(self.default_config_bucket) self.CmdValidateBucket() - self.args.config_file = self.default_config_master - self.ReadConfigFile() + self.ReadConfigFile(self.default_config_master) else: - self.ReadConfigFile() + self.ReadConfigFile(self.args.config_file) if self.group_by_bucket: return self.CmdValidateBucket() @@ -845,11 +853,14 @@ self.masters, FlattenConfig) if errs: - raise MBErr(('mb config file %s has problems:' % self.args.config_file) + - '\n ' + '\n '.join(errs)) + raise MBErr(('mb config file %s has problems:' % + (self.args.config_file if self.args.config_file else self. + default_config_master)) + '\n ' + '\n '.join(errs)) if print_ok: - self.Print('mb config file %s looks ok.' % self.args.config_file) + self.Print('mb config file %s looks ok.' % + (self.args.config_file + if self.args.config_file else self.default_config_master)) return 0 def GetConfig(self): @@ -890,7 +901,7 @@ return ' '.join(gn_args) def Lookup(self): - self.ReadConfigFile() + self.ReadConfigFile(self.args.config_file) try: if self.group_by_bucket: config = self.ConfigFromArgsBucket() @@ -946,15 +957,14 @@ vals['gn_args'] = gn_args return vals - def ReadConfigFile(self): - if not self.Exists(self.args.config_file): - raise MBErr('config file not found at %s' % self.args.config_file) + def ReadConfigFile(self, config_file): + if not self.Exists(config_file): + raise MBErr('config file not found at %s' % config_file) try: - contents = ast.literal_eval(self.ReadFile(self.args.config_file)) + contents = ast.literal_eval(self.ReadFile(config_file)) except SyntaxError as e: - raise MBErr('Failed to parse config file "%s": %s' % - (self.args.config_file, e)) + raise MBErr('Failed to parse config file "%s": %s' % (config_file, e)) self.configs = contents['configs'] self.mixins = contents['mixins']
diff --git a/tools/mb/mb_config.pyl b/tools/mb/mb_config.pyl index 0958465..8ea2a1d 100644 --- a/tools/mb/mb_config.pyl +++ b/tools/mb/mb_config.pyl
@@ -1392,7 +1392,7 @@ ], 'cfi_full_cfi_icall_cfi_diag_recover_release_static': [ - 'cfi_full', 'cfi_icall', 'cfi_diag', 'cfi_recover', 'thin_lto', 'release', 'static', + 'cfi_full', 'cfi_icall', 'cfi_diag', 'cfi_recover', 'thin_lto', 'release', 'static', 'goma', ], 'cfi_full_cfi_icall_cfi_diag_thin_lto_release_static_dcheck_always_on_goma': [
diff --git a/tools/mb/mb_config_buckets.pyl b/tools/mb/mb_config_buckets.pyl index 94805b2..a99755a 100644 --- a/tools/mb/mb_config_buckets.pyl +++ b/tools/mb/mb_config_buckets.pyl
@@ -21,10 +21,10 @@ 'Afl Upload Linux ASan': 'afl_asan_shared_release_bot', 'Android ASAN (dbg)': 'android_clang_asan_debug_bot', 'Android CFI': 'android_cfi_full_cfi_diag_thin_lto_release_static_dcheck_always_on_goma', - 'Android FYI 32 Vk Release (Pixel 2)': 'gpu_tests_android_vulkan_ndk_release_trybot', - 'Android FYI 32 dEQP Vk Release (Pixel 2)': 'deqp_android_vulkan_ndk_release_trybot', - 'Android FYI 64 Vk Release (Pixel 2)': 'gpu_tests_android_vulkan_ndk_release_trybot_arm64', - 'Android FYI 64 dEQP Vk Release (Pixel 2)': 'deqp_android_vulkan_ndk_release_trybot_arm64', + 'Android FYI 32 Vk Release (Pixel 2)': 'gpu_fyi_tests_android_vulkan_ndk_release_trybot', + 'Android FYI 32 dEQP Vk Release (Pixel 2)': 'angle_deqp_android_vulkan_ndk_release_trybot', + 'Android FYI 64 Vk Release (Pixel 2)': 'gpu_fyi_tests_android_vulkan_ndk_release_trybot_arm64', + 'Android FYI 64 dEQP Vk Release (Pixel 2)': 'angle_deqp_android_vulkan_ndk_release_trybot_arm64', 'Android FYI Release (NVIDIA Shield TV)': 'gpu_tests_android_release_trybot_arm64', 'Android FYI Release (Nexus 5)': 'gpu_tests_android_release_trybot', 'Android FYI Release (Nexus 5X)': 'gpu_tests_android_release_trybot_arm64', @@ -34,11 +34,11 @@ 'Android FYI Release (Pixel 2)': 'gpu_tests_android_release_trybot', 'Android FYI SkiaRenderer GL (Nexus 5X)': 'gpu_tests_android_release_trybot_arm64', 'Android FYI SkiaRenderer Vulkan (Pixel 2)': 'gpu_tests_android_release_trybot', - 'Android FYI dEQP Release (Nexus 5X)': 'deqp_android_release_trybot_arm64', + 'Android FYI dEQP Release (Nexus 5X)': 'angle_deqp_android_release_trybot_arm64', 'Android Release (Nexus 5X)': 'gpu_tests_android_release_trybot_arm64_fastbuild', 'Android WebLayer P FYI (rel)': 'android_release_bot_minimal_symbols_arm64', + 'Android WebView P Blink-CORS FYI (rel)': 'android_release_bot_minimal_symbols_arm64_webview_google', 'Android WebView P FYI (rel)': 'android_release_bot_minimal_symbols_arm64_webview_google', - 'Android WebView P OOR-CORS FYI (rel)': 'android_release_bot_minimal_symbols_arm64_webview_google', 'Android arm Builder (dbg)': 'android_webview_google_debug_static_bot', 'Android arm64 Builder (dbg)': 'android_webview_google_debug_static_bot_arm64', 'Android x64 Builder (dbg)': 'android_debug_static_bot_x64', @@ -67,24 +67,25 @@ 'local': 'debug_bot_local_build', 'goma': 'debug_bot' }, + 'Fuchsia ARM64': 'release_bot_fuchsia_arm64', 'Fuchsia x64': 'release_bot_fuchsia', 'GPU FYI Linux Builder': 'gpu_fyi_tests_release_trybot', 'GPU FYI Linux Builder (dbg)': 'gpu_fyi_tests_debug_trybot', - 'GPU FYI Linux Ozone Builder': 'gpu_fyi_tests_ozone_linux_system_gbm_libdrm_release_trybot', - 'GPU FYI Linux dEQP Builder': 'deqp_release_trybot', + 'GPU FYI Linux Ozone Builder': 'angle_ozone_linux_system_gbm_libdrm_release_trybot', + 'GPU FYI Linux dEQP Builder': 'angle_deqp_release_trybot', 'GPU FYI Mac Builder': 'gpu_fyi_tests_release_trybot', 'GPU FYI Mac Builder (dbg)': 'gpu_fyi_tests_debug_trybot', - 'GPU FYI Mac dEQP Builder': 'deqp_release_trybot', - 'GPU FYI Perf Android 64 Builder': 'gpu_tests_android_vulkan_ndk_release_trybot_arm64', + 'GPU FYI Mac dEQP Builder': 'angle_deqp_release_trybot', + 'GPU FYI Perf Android 64 Builder': 'gpu_fyi_tests_android_vulkan_ndk_release_trybot_arm64', 'GPU FYI Win Builder': 'gpu_fyi_tests_release_trybot_x86', 'GPU FYI Win Builder (dbg)': 'gpu_fyi_tests_debug_trybot_x86', - 'GPU FYI Win dEQP Builder': 'deqp_release_trybot_x86', + 'GPU FYI Win dEQP Builder': 'angle_deqp_release_trybot_x86', 'GPU FYI Win x64 Builder': 'gpu_fyi_tests_release_trybot', 'GPU FYI Win x64 Builder (dbg)': 'gpu_fyi_tests_debug_trybot', 'GPU FYI Win x64 DX12 Vulkan Builder': 'gpu_fyi_tests_dx12vk_release_trybot', 'GPU FYI Win x64 DX12 Vulkan Builder (dbg)': 'gpu_fyi_tests_dx12vk_debug_trybot', - 'GPU FYI Win x64 dEQP Builder': 'deqp_release_trybot', + 'GPU FYI Win x64 dEQP Builder': 'angle_deqp_release_trybot', 'GPU FYI XR Win x64 Builder': 'gpu_fyi_tests_release_trybot', 'GPU Linux Builder': 'gpu_tests_release_trybot', 'GPU Linux Builder (dbg)': 'gpu_tests_debug_bot', @@ -115,6 +116,7 @@ 'Linux ChromiumOS Full': 'chromeos_with_codecs_release_bot', 'Linux ChromiumOS MSan Builder': 'chromeos_msan_release_bot', 'Linux FYI GPU TSAN Release': 'gpu_fyi_tests_release_trybot_tsan', + 'Linux FYI SkiaRenderer Dawn Release (Intel HD 630)': 'gpu_tests_sk_dawn_release_trybot', 'Linux MSan Builder': 'msan_release_bot', 'Linux TSan Builder': 'tsan_disable_nacl_release_bot', 'Linux Viz': 'release_trybot', @@ -135,6 +137,7 @@ 'Mojo ChromiumOS': 'chromeos_with_codecs_release_trybot', 'Mojo Linux': 'release_trybot', 'Mojo Windows': 'release_bot_x86_minimal_symbols', + 'Network Service Linux': 'release_trybot', 'Site Isolation Android': 'android_release_bot_minimal_symbols_arm64', 'TSAN Debug': 'tsan_disable_nacl_debug_bot', 'TSAN Release': 'tsan_disable_nacl_release_bot', @@ -144,7 +147,7 @@ 'ToTAndroid64': 'android_clang_tot_release_arm64', 'ToTAndroidASan': 'android_clang_tot_asan', 'ToTAndroidCFI': 'android_clang_tot_cfi_full_cfi_diag_thin_lto_release_static_dcheck_always_on', - 'ToTAndroidOfficial': 'android_clang_tot_release_minimal_symbols_official_optimize', + 'ToTAndroidOfficial': 'android_clang_tot_official_arm64', 'ToTLinux': 'clang_tot_linux_full_symbols_shared_release', 'ToTLinux (dbg)': 'clang_tot_shared_debug', 'ToTLinuxASan': 'clang_tot_asan_lsan_static_release', @@ -165,7 +168,8 @@ 'ToTWinASanLibfuzzer': 'libfuzzer_windows_asan_clang_tot_release_bot', 'ToTWinCFI': 'clang_tot_win_cfi_full_cfi_diag_thin_lto_release_static_dcheck_always_on_x86', 'ToTWinCFI64': 'clang_tot_win_cfi_full_cfi_diag_thin_lto_release_static_dcheck_always_on', - 'ToTiOS': 'ios_error', + 'ToTiOS': 'ios_clang_tot', + 'ToTiOSDevice': 'ios_clang_device_tot', 'UBSan Release': 'ubsan_release_bot', 'UBSan vptr Release': 'ubsan_vptr_release_bot', 'UBSanVptr Linux': 'ubsan_vptr_release_bot', @@ -174,7 +178,6 @@ 'WebKit Linux Leak': 'release_bot', 'WebKit Linux MSAN': 'msan_release_bot', 'WebKit Mac10.13 (retina)': 'release_bot', - 'Win10 FYI x64 SkiaRenderer Dawn Release (NVIDIA)': 'gpu_tests_sk_dawn_release_trybot', 'Win 10 Fast Ring': 'release_trybot', 'Win ASan Release': 'asan_fuzzer_v8_heap_release_bot', 'Win ASan Release Media': 'asan_fuzzer_v8_heap_chrome_with_codecs_release_bot', @@ -182,7 +185,9 @@ 'Win Builder (dbg)': 'gpu_tests_debug_bot_x86', 'Win x64 Builder': 'gpu_tests_release_bot_minimal_symbols', 'Win x64 Builder (dbg)': 'gpu_tests_debug_bot', + 'Win10 FYI x64 SkiaRenderer Dawn Release (NVIDIA)': 'gpu_tests_sk_dawn_release_trybot', 'Windows deterministic': 'release_bot_x86_minimal_symbols', + 'android-10-arm64-rel': 'android_release_trybot_arm64_fastbuild_webview_google', 'android-archive-dbg': 'android_without_codecs_debug_bot', 'android-archive-rel': 'android_without_codecs_release_bot_minimal_symbols', 'android-arm64-proguard-rel': 'android_release_bot_minimal_symbols_arm64_webview_google', @@ -201,36 +206,39 @@ 'android-kitkat-arm-rel': 'android_release_trybot_fastbuild', 'android-lollipop-arm-rel': 'android_release_trybot_fastbuild_webview_google', 'android-marshmallow-arm64-rel': 'gpu_tests_android_release_trybot_arm64_resource_whitelisting_fastbuild_java_coverage', - 'android-marshmallow-x86-fyi-rel': 'android_release_trybot_x86_resource_whitelisting', + 'android-marshmallow-x86-fyi-rel': 'android_release_trybot_x86_fastbuild_resource_whitelisting', 'android-mojo-webview-rel': 'android_release_bot_minimal_symbols_arm64', 'android-pie-arm64-dbg': 'android_debug_trybot_arm64', 'android-pie-arm64-rel': 'android_release_trybot_arm64_webview_google', - 'android-pie-x86-rel': 'android_release_trybot_x86', - 'chromeos-amd64-generic-cfi-thin-lto-rel': 'cros_chrome_sdk_cfi_thin_lto', - 'chromeos-amd64-generic-dbg': 'cros_chrome_sdk_dbg', - 'chromeos-amd64-generic-rel': 'cros_chrome_sdk', - 'chromeos-amd64-generic-rel-vm-tests': 'cros_chrome_sdk_dcheck_always_on', - 'chromeos-arm-generic-dbg': 'cros_chrome_sdk_dbg', - 'chromeos-arm-generic-rel': 'cros_chrome_sdk_dcheck_always_on', - 'chromeos-kevin-rel': 'cros_chrome_sdk', - 'chromeos-kevin-rel-hw-tests': 'cros_chrome_sdk', + 'android-pie-x86-rel': 'android_release_trybot_x86_fastbuild_webview_google', + 'chromeos-amd64-generic-cfi-thin-lto-rel': 'chromeos_amd64-generic_cfi_thin_lto', + 'chromeos-amd64-generic-dbg': 'chromeos_amd64-generic_dbg', + 'chromeos-amd64-generic-rel': 'chromeos_amd64-generic', + 'chromeos-amd64-generic-rel-vm-tests': 'chromeos_amd64-generic_dcheck_always_on', + 'chromeos-arm-generic-dbg': 'chromeos_arm-generic_dbg', + 'chromeos-arm-generic-rel': 'chromeos_arm-generic_dcheck_always_on', + 'chromeos-kevin-rel': 'chromeos_kevin', + 'chromeos-kevin-rel-hw-tests': 'chromeos_kevin', 'fuchsia-arm64-cast': 'release_trybot_fuchsia_arm64_cast', 'fuchsia-fyi-arm64-rel': 'release_trybot_fuchsia_arm64', 'fuchsia-fyi-x64-dbg': 'debug_bot_fuchsia', 'fuchsia-fyi-x64-rel': 'release_trybot_fuchsia', 'fuchsia-x64-cast': 'release_trybot_fuchsia_cast', 'fuchsia-x64-dbg': 'debug_bot_fuchsia_compile_only', - 'ios-device': 'ios_error', + 'ios-device': 'ios_device_release_rbe_compile_only', 'ios-simulator': 'ios_error', 'ios-simulator-code-coverage': 'clang_code_coverage_ios', 'ios-simulator-cr-recipe': 'ios_simulator_debug_static_bot', - 'ios-simulator-cronet': 'ios_error', + 'ios-simulator-cronet': 'ios_cronet', 'ios-simulator-full-configs': 'ios_error', + 'ios-webkit-tot': 'ios_simulator_debug_static_rbe_bot', + 'ios13-sdk-device': 'ios_device_release_static_rbe_bot', 'linux-annotator-rel': 'release_trybot', 'linux-archive-dbg': 'debug_bot', 'linux-archive-rel': 'release_bot', 'linux-bfcache-rel': 'release_bot', 'linux-blink-animation-use-time-delta': 'debug_bot_enable_blink_animation_use_time_delta', + 'linux-blink-cors-rel': 'release_bot_minimal_symbols', 'linux-blink-heap-concurrent-marking-tsan-rel': 'release_trybot_tsan', 'linux-blink-heap-verification': 'release_bot_enable_blink_heap_verification_dcheck_always_on', 'linux-chromeos-code-coverage': 'chromeos_with_codecs_release_bot_coverage', @@ -240,15 +248,15 @@ 'linux-code-coverage': 'clang_code_coverage', 'linux-fieldtrial-rel': 'release_bot_minimal_symbols', 'linux-gcc-rel': 'release_bot_x86_minimal_symbols_no_clang_cxx11', - 'linux-oor-cors-rel': 'release_bot_minimal_symbols', 'linux-ozone-rel': 'ozone_linux_release_trybot', - 'linux-swangle-tot-angle-x64': 'deqp_release_trybot', - 'linux-swangle-tot-angle-x86': 'deqp_release_trybot_x86', - 'linux-swangle-tot-swiftshader-x64': 'deqp_release_trybot', - 'linux-swangle-tot-swiftshader-x86': 'deqp_release_trybot_x86', - 'linux-swangle-x64': 'deqp_release_trybot', - 'linux-swangle-x86': 'deqp_release_trybot_x86', + 'linux-swangle-tot-angle-x64': 'angle_deqp_release_trybot', + 'linux-swangle-tot-angle-x86': 'angle_deqp_release_trybot_x86', + 'linux-swangle-tot-swiftshader-x64': 'angle_deqp_release_trybot', + 'linux-swangle-tot-swiftshader-x86': 'angle_deqp_release_trybot_x86', + 'linux-swangle-x64': 'angle_deqp_release_trybot', + 'linux-swangle-x86': 'angle_deqp_release_trybot_x86', 'linux-trusty-rel': 'gpu_tests_release_trybot_no_symbols_use_dummy_lastchange', + 'linux-upload-perfetto': 'release_bot', 'linux-win_cross-rel': 'clang_tot_win_release_cross', 'linux-wpt-fyi-rel': 'release_trybot', 'mac-archive-dbg': 'debug_bot', @@ -257,25 +265,26 @@ 'mac-hermetic-upgrade-rel': 'release_bot', 'mac-mojo-rel': 'release_trybot', 'mac-osxbeta-rel': 'gpu_tests_release_trybot_deterministic_mac', + 'mac-upload-perfetto': 'release_bot', 'win-annotator-rel': 'release_trybot', 'win-archive-dbg': 'debug_bot', 'win-archive-rel': 'release_bot_minimal_symbols_enable_archive_compression', 'win-asan': 'asan_clang_fuzzer_static_v8_heap_minimal_symbols_release', 'win-celab-builder-rel': 'release_bot_minimal_symbols', 'win-pixel-builder-rel': 'release_bot', - 'win-swangle-tot-angle-x64': 'deqp_release_trybot', - 'win-swangle-tot-angle-x86': 'deqp_release_trybot_x86', - 'win-swangle-tot-swiftshader-x64': 'deqp_release_trybot', - 'win-swangle-tot-swiftshader-x86': 'deqp_release_trybot_x86', - 'win-swangle-x64': 'deqp_release_trybot', - 'win-swangle-x86': 'deqp_release_trybot_x86', + 'win-swangle-tot-angle-x64': 'angle_deqp_release_trybot', + 'win-swangle-tot-angle-x86': 'angle_deqp_release_trybot_x86', + 'win-swangle-tot-swiftshader-x64': 'angle_deqp_release_trybot', + 'win-swangle-tot-swiftshader-x86': 'angle_deqp_release_trybot_x86', + 'win-swangle-x64': 'angle_deqp_release_trybot', + 'win-swangle-x86': 'angle_deqp_release_trybot_x86', + 'win-upload-perfetto': 'release_bot', 'win10-code-coverage': 'clang_code_coverage', 'win32-archive-dbg': 'debug_bot_x86', 'win32-archive-rel': 'release_bot_x86_minimal_symbols_enable_archive_compression', 'win32-arm64-rel': 'win32_arm64_release_bot', - 'Chromium Android ARM 32-bit Goma RBE Staging': 'android_release_bot_minimal_symbols', 'Chromium Android ARM 32-bit Goma RBE ToT': 'android_release_bot_minimal_symbols', - 'Chromium Android ARM 32-bit Goma RBE ToT (ATS)': 'android_release_bot_minimal_symbols', + 'Chromium Android ARM 32-bit Goma RBE ToT (ATS)': 'android_release_bot_minimal_symbols_java_goma', 'Chromium Linux Goma RBE Staging': 'release_bot', 'Chromium Linux Goma RBE Staging (clobber)': 'release_bot', 'Chromium Linux Goma RBE Staging (dbg)': 'debug_bot', @@ -291,6 +300,7 @@ 'Chromium Win Goma RBE Staging': 'release_bot_x86_minimal_symbols', 'Chromium Win Goma RBE Staging (clobber)': 'release_bot_x86_minimal_symbols', 'Chromium Win Goma RBE ToT': 'release_bot_x86_minimal_symbols', + 'Chromium iOS Goma RBE ToT': 'ios_device_release_compile_only', 'CrWinGomaStaging': 'release_bot_x86_minimal_symbols', 'Linux Builder Goma Canary': 'gpu_tests_release_bot', 'Linux Builder Goma Latest Client': 'gpu_tests_release_bot', @@ -320,14 +330,14 @@ 'android-archive-dbg-goma-rbe-ats-latest': 'android_without_codecs_debug_bot', 'android-archive-dbg-goma-rbe-canary': 'android_without_codecs_debug_bot', 'android-archive-dbg-goma-rbe-latest': 'android_without_codecs_debug_bot', - 'chromeos-amd64-generic-rel-goma-canary': 'cros_chrome_sdk', - 'chromeos-amd64-generic-rel-goma-latest': 'cros_chrome_sdk', - 'chromeos-amd64-generic-rel-goma-rbe-canary': 'cros_chrome_sdk', - 'chromeos-amd64-generic-rel-goma-rbe-latest': 'cros_chrome_sdk', - 'ios-device-goma-canary-clobber': 'ios_error', - 'ios-device-goma-latest-clobber': 'ios_error', - 'ios-device-goma-rbe-canary-clobber': 'ios_error', - 'ios-device-goma-rbe-latest-clobber': 'ios_error', + 'chromeos-amd64-generic-rel-goma-canary': 'chromeos_amd64-generic', + 'chromeos-amd64-generic-rel-goma-latest': 'chromeos_amd64-generic', + 'chromeos-amd64-generic-rel-goma-rbe-canary': 'chromeos_amd64-generic', + 'chromeos-amd64-generic-rel-goma-rbe-latest': 'chromeos_amd64-generic', + 'ios-device-goma-canary-clobber': 'ios_device_release_compile_only', + 'ios-device-goma-latest-clobber': 'ios_device_release_compile_only', + 'ios-device-goma-rbe-canary-clobber': 'ios_device_release_rbe_compile_only', + 'ios-device-goma-rbe-latest-clobber': 'ios_device_release_rbe_compile_only', 'linux-archive-rel-goma-canary': 'release_bot', 'linux-archive-rel-goma-canary-localoutputcache': 'release_bot', 'linux-archive-rel-goma-latest': 'release_bot', @@ -344,25 +354,26 @@ 'mac-archive-rel-goma-rbe-latest': 'release_bot_mac_strip_minimal_symbols', 'win32-archive-rel-goma-canary-localoutputcache': 'release_bot_x86_minimal_symbols_enable_archive_compression', 'win32-archive-rel-goma-latest-localoutputcache': 'release_bot_x86_minimal_symbols_enable_archive_compression', - 'android-bfcache-rel': 'android_release_bot_minimal_symbols_arm64', + 'android-bfcache-rel': 'android_release_trybot', 'android-binary-size': 'android_binary_size', 'android-deterministic-dbg': 'android_debug_bot', 'android-deterministic-rel': 'android_without_codecs_release_trybot', 'android-opus-kitkat-arm-rel': 'android_release_trybot', 'android-oreo-arm64-cts-networkservice-dbg': 'android_debug_trybot_arm64', 'android-oreo-arm64-dbg': 'android_debug_trybot_arm64', + 'android-pie-arm64-coverage-rel': 'android_release_trybot_arm64_webview_google_native_coverage', 'android-weblayer-pie-arm64-fyi-rel': 'android_release_trybot_arm64', 'android-webview-marshmallow-arm64-dbg': 'android_release_trybot_arm64_webview_google', 'android-webview-nougat-arm64-dbg': 'android_release_trybot_arm64_webview_google', 'android-webview-oreo-arm64-dbg': 'android_release_trybot_arm64_webview_google', 'android-webview-pie-arm64-dbg': 'android_release_trybot_arm64_webview_google', 'android-webview-pie-arm64-fyi-rel': 'android_release_trybot_arm64_webview_google', - 'android_angle_deqp_rel_ng': 'deqp_android_release_trybot_arm64', + 'android_angle_deqp_rel_ng': 'angle_deqp_android_release_trybot_arm64', 'android_angle_rel_ng': 'gpu_tests_android_release_trybot_arm64', - 'android_angle_vk32_deqp_rel_ng': 'deqp_android_vulkan_ndk_release_trybot', - 'android_angle_vk32_rel_ng': 'gpu_tests_android_vulkan_ndk_release_trybot', - 'android_angle_vk64_deqp_rel_ng': 'deqp_android_vulkan_ndk_release_trybot_arm64', - 'android_angle_vk64_rel_ng': 'gpu_tests_android_vulkan_ndk_release_trybot_arm64', + 'android_angle_vk32_deqp_rel_ng': 'angle_deqp_android_vulkan_ndk_release_trybot', + 'android_angle_vk32_rel_ng': 'gpu_fyi_tests_android_vulkan_ndk_release_trybot', + 'android_angle_vk64_deqp_rel_ng': 'angle_deqp_android_vulkan_ndk_release_trybot_arm64', + 'android_angle_vk64_rel_ng': 'gpu_fyi_tests_android_vulkan_ndk_release_trybot_arm64', 'android_archive_rel_ng': 'android_release_trybot', 'android_arm64_dbg_recipe': 'android_debug_trybot_compile_only_arm64_fastbuild', 'android_blink_rel': 'android_release_trybot', @@ -380,7 +391,7 @@ 'cast_shell_android': 'android_cast_debug_static_bot_compile_only', 'cast_shell_audio_linux': 'cast_audio_release_trybot', 'cast_shell_linux': 'cast_release_trybot', - 'chromeos-kevin-compile-rel': 'cros_chrome_sdk', + 'chromeos-kevin-compile-rel': 'chromeos_kevin', 'chromium_presubmit': 'presubmit', 'closure_compilation': 'closure_compilation', 'dawn-linux-x64-deps-rel': 'dawn_tests_release_trybot', @@ -394,55 +405,57 @@ 'gpu-fyi-try-android-l-nexus-5-32': 'gpu_tests_android_release_trybot', 'gpu-fyi-try-android-l-nexus-6-32': 'gpu_tests_android_release_trybot', 'gpu-fyi-try-android-m-nexus-5x-64': 'gpu_tests_android_release_trybot_arm64', - 'gpu-fyi-try-android-m-nexus-5x-deqp-64': 'deqp_android_release_trybot_arm64', + 'gpu-fyi-try-android-m-nexus-5x-deqp-64': 'angle_deqp_android_release_trybot_arm64', 'gpu-fyi-try-android-m-nexus-5x-skgl-64': 'gpu_tests_android_release_trybot_arm64', 'gpu-fyi-try-android-m-nexus-6p-64': 'gpu_tests_android_release_trybot_arm64', 'gpu-fyi-try-android-m-nexus-9-64': 'gpu_tests_android_release_trybot_arm64', 'gpu-fyi-try-android-n-nvidia-shield-tv-64': 'gpu_tests_android_release_trybot_arm64', 'gpu-fyi-try-android-p-pixel-2-32': 'gpu_tests_android_release_trybot', 'gpu-fyi-try-android-p-pixel-2-skv-32': 'gpu_tests_android_release_trybot', - 'gpu-fyi-try-android-q-pixel-2-deqp-vk-32': 'deqp_android_vulkan_ndk_release_trybot', - 'gpu-fyi-try-android-q-pixel-2-deqp-vk-64': 'deqp_android_vulkan_ndk_release_trybot_arm64', - 'gpu-fyi-try-android-q-pixel-2-vk-32': 'gpu_tests_android_vulkan_ndk_release_trybot', - 'gpu-fyi-try-android-q-pixel-2-vk-64': 'gpu_tests_android_vulkan_ndk_release_trybot_arm64', - 'gpu-fyi-try-linux-intel-dqp': 'deqp_release_trybot', + 'gpu-fyi-try-android-q-pixel-2-deqp-vk-32': 'angle_deqp_android_vulkan_ndk_release_trybot', + 'gpu-fyi-try-android-q-pixel-2-deqp-vk-64': 'angle_deqp_android_vulkan_ndk_release_trybot_arm64', + 'gpu-fyi-try-android-q-pixel-2-vk-32': 'gpu_fyi_tests_android_vulkan_ndk_release_trybot', + 'gpu-fyi-try-android-q-pixel-2-vk-64': 'gpu_fyi_tests_android_vulkan_ndk_release_trybot_arm64', + 'gpu-fyi-try-linux-intel-dqp': 'angle_deqp_release_trybot', 'gpu-fyi-try-linux-intel-exp': 'gpu_fyi_tests_release_trybot', 'gpu-fyi-try-linux-intel-rel': 'gpu_fyi_tests_release_trybot', + 'gpu-fyi-try-linux-intel-sk-dawn-rel': 'gpu_tests_sk_dawn_release_trybot', 'gpu-fyi-try-linux-intel-skv': 'gpu_fyi_tests_release_trybot', 'gpu-fyi-try-linux-nvidia-dbg': 'gpu_fyi_tests_debug_trybot', - 'gpu-fyi-try-linux-nvidia-dqp': 'deqp_release_trybot', + 'gpu-fyi-try-linux-nvidia-dqp': 'angle_deqp_release_trybot', 'gpu-fyi-try-linux-nvidia-exp': 'gpu_fyi_tests_release_trybot', 'gpu-fyi-try-linux-nvidia-rel': 'gpu_fyi_tests_release_trybot', 'gpu-fyi-try-linux-nvidia-skv': 'gpu_fyi_tests_release_trybot', 'gpu-fyi-try-linux-nvidia-tsn': 'gpu_fyi_tests_release_trybot_tsan', - 'gpu-fyi-try-mac-amd-dqp': 'deqp_release_trybot', + 'gpu-fyi-try-mac-amd-dqp': 'angle_deqp_release_trybot', 'gpu-fyi-try-mac-amd-pro-rel': 'gpu_fyi_tests_release_trybot', 'gpu-fyi-try-mac-amd-retina-dbg': 'gpu_fyi_tests_debug_trybot', 'gpu-fyi-try-mac-amd-retina-exp': 'gpu_fyi_tests_release_trybot', 'gpu-fyi-try-mac-amd-retina-rel': 'gpu_fyi_tests_release_trybot', 'gpu-fyi-try-mac-asan': 'gpu_fyi_tests_release_trybot_asan', 'gpu-fyi-try-mac-intel-dbg': 'gpu_fyi_tests_debug_trybot', - 'gpu-fyi-try-mac-intel-dqp': 'deqp_release_trybot', + 'gpu-fyi-try-mac-intel-dqp': 'angle_deqp_release_trybot', 'gpu-fyi-try-mac-intel-exp': 'gpu_fyi_tests_release_trybot', 'gpu-fyi-try-mac-intel-rel': 'gpu_fyi_tests_release_trybot', 'gpu-fyi-try-mac-nvidia-retina-dbg': 'gpu_fyi_tests_debug_trybot', 'gpu-fyi-try-mac-nvidia-retina-exp': 'gpu_fyi_tests_release_trybot', 'gpu-fyi-try-mac-nvidia-retina-rel': 'gpu_fyi_tests_release_trybot', - 'gpu-fyi-try-win10-intel-dqp-64': 'deqp_release_trybot', + 'gpu-fyi-try-win10-intel-dqp-64': 'angle_deqp_release_trybot', 'gpu-fyi-try-win10-intel-exp-64': 'gpu_fyi_tests_release_trybot', 'gpu-fyi-try-win10-intel-rel-64': 'gpu_fyi_tests_release_trybot', 'gpu-fyi-try-win10-nvidia-dbg-64': 'gpu_fyi_tests_debug_trybot', - 'gpu-fyi-try-win10-nvidia-dqp-64': 'deqp_release_trybot', + 'gpu-fyi-try-win10-nvidia-dqp-64': 'angle_deqp_release_trybot', 'gpu-fyi-try-win10-nvidia-dx12vk-dbg-64': 'gpu_fyi_tests_dx12vk_debug_trybot', 'gpu-fyi-try-win10-nvidia-dx12vk-rel-64': 'gpu_fyi_tests_dx12vk_release_trybot', 'gpu-fyi-try-win10-nvidia-exp-64': 'gpu_fyi_tests_release_trybot', 'gpu-fyi-try-win10-nvidia-rel-32': 'gpu_fyi_tests_release_trybot_x86', 'gpu-fyi-try-win10-nvidia-rel-64': 'gpu_fyi_tests_release_trybot', + 'gpu-fyi-try-win10-nvidia-sk-dawn-rel-64': 'gpu_tests_sk_dawn_release_trybot', 'gpu-fyi-try-win10-nvidia-skgl-64': 'gpu_fyi_tests_release_trybot', 'gpu-fyi-try-win7-amd-dbg-32': 'gpu_fyi_tests_debug_trybot_x86', - 'gpu-fyi-try-win7-amd-dqp-32': 'deqp_release_trybot_x86', + 'gpu-fyi-try-win7-amd-dqp-32': 'angle_deqp_release_trybot_x86', 'gpu-fyi-try-win7-amd-rel-32': 'gpu_fyi_tests_release_trybot_x86', - 'gpu-fyi-try-win7-nvidia-dqp-64': 'deqp_release_trybot', + 'gpu-fyi-try-win7-nvidia-dqp-64': 'angle_deqp_release_trybot', 'gpu-fyi-try-win7-nvidia-rel-32': 'gpu_fyi_tests_release_trybot_x86', 'gpu-fyi-try-win7-nvidia-rel-64': 'gpu_fyi_tests_release_trybot', 'gpu-try-android-m-nexus-5x-64': 'gpu_tests_android_release_trybot_arm64', @@ -453,6 +466,7 @@ 'layout_test_leak_detection': 'release_trybot', 'leak_detection_linux': 'release_trybot', 'linux-angle-rel': 'gpu_fyi_tests_release_trybot', + 'linux-autofill-assistant': 'autofill_assistant_release_trybot', 'linux-blink-heap-verification-try': 'release_trybot_enable_blink_heap_verification', 'linux-blink-rel': 'release_bot_minimal_symbols', 'linux-chromeos-compile-dbg': 'chromeos_with_codecs_debug_bot', @@ -460,20 +474,22 @@ 'linux-clang-tidy-rel': 'release_trybot', 'linux-dawn-rel': 'dawn_tests_release_trybot', 'linux-dcheck-off-rel': 'release_trybot_dcheck_off', + 'linux-layout-tests-edit-ng': 'release_trybot', 'linux-layout-tests-fragment-item': 'release_trybot', 'linux-libfuzzer-asan-rel': 'libfuzzer_asan_release_trybot', + 'linux-ozone-x11-and-wayland-rel': 'ozone_linux_release_trybot', 'linux-rel': 'gpu_tests_release_trybot_no_symbols_use_dummy_lastchange_code_coverage', - 'linux-swangle-try-tot-angle-x64': 'deqp_release_trybot', - 'linux-swangle-try-tot-angle-x86': 'deqp_release_trybot_x86', - 'linux-swangle-try-tot-swiftshader-x64': 'deqp_release_trybot', - 'linux-swangle-try-tot-swiftshader-x86': 'deqp_release_trybot_x86', - 'linux-swangle-try-x64': 'deqp_release_trybot', - 'linux-swangle-try-x86': 'deqp_release_trybot_x86', + 'linux-swangle-try-tot-angle-x64': 'angle_deqp_release_trybot', + 'linux-swangle-try-tot-angle-x86': 'angle_deqp_release_trybot_x86', + 'linux-swangle-try-tot-swiftshader-x64': 'angle_deqp_release_trybot', + 'linux-swangle-try-tot-swiftshader-x86': 'angle_deqp_release_trybot_x86', + 'linux-swangle-try-x64': 'angle_deqp_release_trybot', + 'linux-swangle-try-x86': 'angle_deqp_release_trybot_x86', 'linux-viz-rel': 'release_trybot', 'linux-webkit-msan-rel': 'msan_release_bot', 'linux_android_dbg_ng': 'android_debug_bot', - 'linux_angle_deqp_rel_ng': 'deqp_release_trybot', - 'linux_angle_ozone_rel_ng': 'gpu_fyi_tests_ozone_linux_system_gbm_libdrm_release_trybot', + 'linux_angle_deqp_rel_ng': 'angle_deqp_release_trybot', + 'linux_angle_ozone_rel_ng': 'angle_ozone_linux_system_gbm_libdrm_release_trybot', 'linux_arm': 'release_trybot_arm', 'linux_chromium_archive_rel_ng': 'release_bot', 'linux_chromium_asan_rel_ng': 'asan_lsan_release_trybot', @@ -497,6 +513,7 @@ 'linux_upload_clang': 'release_bot', 'linux_vr': 'vr_release_trybot', 'mac-angle-rel': 'gpu_fyi_tests_release_trybot', + 'mac-coverage-rel': 'gpu_tests_release_trybot_deterministic_mac_code_coverage', 'mac-dawn-rel': 'dawn_tests_release_trybot', 'mac-rel': 'gpu_tests_release_trybot_deterministic_mac', 'mac10.10-blink-rel': 'release_bot_minimal_symbols', @@ -519,22 +536,731 @@ 'mac_optional_gpu_tests_rel': 'gpu_fyi_tests_release_trybot', 'mac_upload_clang': 'release_bot', 'try-nougat-phone-tester': 'android_debug_trybot_arm64', - 'win-angle-deqp-rel-32': 'deqp_release_trybot_x86', - 'win-angle-deqp-rel-64': 'deqp_release_trybot', + 'win-angle-deqp-rel-32': 'angle_deqp_release_trybot_x86', + 'win-angle-deqp-rel-64': 'angle_deqp_release_trybot', 'win-angle-rel-32': 'gpu_fyi_tests_release_trybot_x86', 'win-angle-rel-64': 'gpu_fyi_tests_release_trybot', 'win-celab-try-rel': 'release_bot_minimal_symbols', 'win-dawn-rel': 'dawn_tests_release_trybot', 'win-libfuzzer-asan-rel': 'libfuzzer_windows_asan_release_trybot', - 'win-swangle-try-tot-angle-x64': 'deqp_release_trybot', - 'win-swangle-try-tot-angle-x86': 'deqp_release_trybot_x86', - 'win-swangle-try-tot-swiftshader-x64': 'deqp_release_trybot', - 'win-swangle-try-tot-swiftshader-x86': 'deqp_release_trybot_x86', - 'win-swangle-try-x64': 'deqp_release_trybot', - 'win-swangle-try-x86': 'deqp_release_trybot_x86', + 'win-swangle-try-tot-angle-x64': 'angle_deqp_release_trybot', + 'win-swangle-try-tot-angle-x86': 'angle_deqp_release_trybot_x86', + 'win-swangle-try-tot-swiftshader-x64': 'angle_deqp_release_trybot', + 'win-swangle-try-tot-swiftshader-x86': 'angle_deqp_release_trybot_x86', + 'win-swangle-try-x64': 'angle_deqp_release_trybot', + 'win-swangle-try-x86': 'angle_deqp_release_trybot_x86', 'win10-blink-rel': 'release_bot_x86_minimal_symbols', + 'win10_chromium_x64_coverage_rel_ng': 'gpu_tests_release_trybot_resource_whitelisting_code_coverage', 'win10_chromium_x64_dbg_ng': 'gpu_tests_debug_bot', - 'win10_chromium_x64_rel_ng': 'gpu_tests_release_trybot_resource_whitelisting', + 'win10_chromium_x64_rel_ng': 'gpu_tests_release_trybot_resource_whitelisting_code_coverage', + 'win10_chromium_x64_rel_ng_exp': 'release_trybot', + 'win7-blink-rel': 'release_bot_x86_minimal_symbols', + 'win7-rel': 'gpu_tests_release_trybot_x86_resource_whitelisting', + 'win_archive': 'release_trybot_x86', + 'win_chromium_compile_dbg_ng': 'gpu_tests_debug_trybot_x86_compile_only', + 'win_chromium_compile_rel_ng': 'gpu_tests_release_trybot_x86_resource_whitelisting', + 'win_chromium_dbg_ng': 'gpu_tests_debug_bot_x86', + 'win_chromium_x64_rel_ng': 'gpu_tests_release_trybot', + 'win_mojo': 'release_trybot_x86', + 'win_optional_gpu_tests_rel': 'gpu_fyi_tests_release_trybot', + 'win_upload_clang': 'release_bot', + 'win_x64_archive': 'release_trybot', + 'WebRTC Chromium Android Builder': 'android_debug_static_bot_arm64', + 'WebRTC Chromium Linux Builder': 'gpu_tests_release_bot', + 'WebRTC Chromium Mac Builder': 'gpu_tests_release_bot', + 'WebRTC Chromium Win Builder': 'release_bot_x86_minimal_symbols_no_com_init_hooks_with_codecs', + 'WebRTC Chromium FYI Android Builder': 'android_release_bot_minimal_symbols', + 'WebRTC Chromium FYI Android Builder (dbg)': 'android_debug_static_bot', + 'WebRTC Chromium FYI Android Builder ARM64 (dbg)': 'android_debug_static_bot_arm64', + 'WebRTC Chromium FYI Linux Builder': 'gpu_tests_release_bot', + 'WebRTC Chromium FYI Linux Builder (dbg)': 'debug_bot', + 'WebRTC Chromium FYI Mac Builder': 'gpu_tests_release_bot', + 'WebRTC Chromium FYI Mac Builder (dbg)': 'debug_bot', + 'WebRTC Chromium FYI Win Builder': 'release_bot_x86_minimal_symbols_no_com_init_hooks_with_codecs', + 'WebRTC Chromium FYI Win Builder (dbg)': 'debug_bot_x86_no_com_init_hooks_with_codecs' + }, + + 'ci-m80': { + 'Android Release (Nexus 5X)': 'gpu_tests_android_release_trybot_arm64_fastbuild', + 'GPU Linux Builder': 'gpu_tests_release_trybot', + 'GPU Mac Builder': 'gpu_tests_release_trybot_deterministic_mac', + 'GPU Win x64 Builder': 'gpu_tests_release_trybot_resource_whitelisting', + 'Linux Builder': 'gpu_tests_release_bot', + 'Mac Builder': 'gpu_tests_release_bot_minimal_symbols', + 'WebKit Mac10.13 (retina)': 'release_bot', + 'Win x64 Builder': 'gpu_tests_release_bot_minimal_symbols', + 'android-kitkat-arm-rel': 'android_release_trybot_fastbuild', + 'android-marshmallow-arm64-rel': 'gpu_tests_android_release_trybot_arm64_resource_whitelisting_fastbuild_java_coverage', + 'chromeos-amd64-generic-rel': 'chromeos_amd64-generic', + 'ios-simulator': 'ios_error', + 'linux-chromeos-rel': 'chromeos_with_codecs_release_trybot_code_coverage', + 'linux-ozone-rel': 'ozone_linux_release_trybot', + 'mac-osxbeta-rel': 'gpu_tests_release_trybot_deterministic_mac', + 'Android arm Builder (dbg)': 'android_webview_google_debug_static_bot', + 'Cast Android (dbg)': 'android_cast_debug_static_bot', + 'Cast Linux': 'cast_release_bot', + 'Fuchsia ARM64': 'release_bot_fuchsia_arm64', + 'Fuchsia x64': 'release_bot_fuchsia', + 'Linux ASan LSan Builder': 'asan_lsan_release_trybot', + 'Mac Builder (dbg)': 'gpu_tests_debug_bot', + 'Win Builder (dbg)': 'gpu_tests_debug_bot_x86', + 'android-cronet-arm-rel': 'android_cronet_release_bot_minimal_symbols_arm_no_neon', + 'chromeos-arm-generic-rel': 'chromeos_arm-generic_dcheck_always_on', + 'linux-chromeos-dbg': 'chromeos_with_codecs_debug_bot', + 'Chromium Android ARM 32-bit Goma RBE ToT': 'android_release_bot_minimal_symbols', + 'Chromium Android ARM 32-bit Goma RBE ToT (ATS)': 'android_release_bot_minimal_symbols_java_goma', + 'Chromium Linux Goma RBE Staging': 'release_bot', + 'Chromium Linux Goma RBE Staging (clobber)': 'release_bot', + 'Chromium Linux Goma RBE Staging (dbg)': 'debug_bot', + 'Chromium Linux Goma RBE Staging (dbg) (clobber)': 'debug_bot', + 'Chromium Linux Goma RBE ToT': 'release_bot', + 'Chromium Linux Goma RBE ToT (ATS)': 'release_bot', + 'Chromium Linux Goma Staging': 'release_bot', + 'Chromium Mac Goma RBE Staging': 'release_bot', + 'Chromium Mac Goma RBE Staging (clobber)': 'release_bot', + 'Chromium Mac Goma RBE Staging (dbg)': 'debug_bot', + 'Chromium Mac Goma RBE ToT': 'release_bot', + 'Chromium Mac Goma Staging': 'release_bot', + 'Chromium Win Goma RBE Staging': 'release_bot_x86_minimal_symbols', + 'Chromium Win Goma RBE Staging (clobber)': 'release_bot_x86_minimal_symbols', + 'Chromium Win Goma RBE ToT': 'release_bot_x86_minimal_symbols', + 'Chromium iOS Goma RBE ToT': 'ios_device_release_compile_only', + 'CrWinGomaStaging': 'release_bot_x86_minimal_symbols', + 'Linux Builder Goma Canary': 'gpu_tests_release_bot', + 'Linux Builder Goma Latest Client': 'gpu_tests_release_bot', + 'Linux Builder Goma RBE Canary': 'gpu_tests_release_bot', + 'Linux Builder Goma RBE Latest Client': 'gpu_tests_release_bot', + 'Mac Builder (dbg) Goma Canary': 'gpu_tests_debug_bot', + 'Mac Builder (dbg) Goma Canary (clobber)': 'gpu_tests_debug_bot', + 'Mac Builder (dbg) Goma Latest Client': 'gpu_tests_debug_bot', + 'Mac Builder (dbg) Goma Latest Client (clobber)': 'gpu_tests_debug_bot', + 'Mac Builder (dbg) Goma RBE Canary (clobber)': 'gpu_tests_debug_bot', + 'Mac Builder (dbg) Goma RBE Latest Client (clobber)': 'gpu_tests_debug_bot', + 'Mac Builder Goma Canary': 'gpu_tests_release_bot_minimal_symbols', + 'Mac Builder Goma Latest Client': 'gpu_tests_release_bot_minimal_symbols', + 'Win Builder (dbg) Goma Canary': 'gpu_tests_debug_bot_x86', + 'Win Builder (dbg) Goma Latest Client': 'gpu_tests_debug_bot_x86', + 'Win Builder (dbg) Goma RBE Latest Client': 'gpu_tests_debug_bot_x86', + 'Win Builder Goma Canary': 'gpu_tests_release_bot_x86_minimal_symbols', + 'Win Builder Goma Latest Client': 'gpu_tests_release_bot_x86_minimal_symbols', + 'Win Builder Goma RBE Latest Client': 'gpu_tests_release_bot_x86_minimal_symbols', + 'Win7 Builder (dbg) Goma Canary': 'gpu_tests_debug_bot_x86', + 'Win7 Builder (dbg) Goma Latest Client': 'gpu_tests_debug_bot_x86', + 'Win7 Builder Goma Canary': 'gpu_tests_release_bot_x86_minimal_symbols', + 'Win7 Builder Goma Latest Client': 'gpu_tests_release_bot_x86_minimal_symbols', + 'android-archive-dbg-goma-canary': 'android_without_codecs_debug_bot', + 'android-archive-dbg-goma-latest': 'android_without_codecs_debug_bot', + 'android-archive-dbg-goma-rbe-ats-canary': 'android_without_codecs_debug_bot', + 'android-archive-dbg-goma-rbe-ats-latest': 'android_without_codecs_debug_bot', + 'android-archive-dbg-goma-rbe-canary': 'android_without_codecs_debug_bot', + 'android-archive-dbg-goma-rbe-latest': 'android_without_codecs_debug_bot', + 'chromeos-amd64-generic-rel-goma-canary': 'chromeos_amd64-generic', + 'chromeos-amd64-generic-rel-goma-latest': 'chromeos_amd64-generic', + 'chromeos-amd64-generic-rel-goma-rbe-canary': 'chromeos_amd64-generic', + 'chromeos-amd64-generic-rel-goma-rbe-latest': 'chromeos_amd64-generic', + 'ios-device-goma-canary-clobber': 'ios_device_release_compile_only', + 'ios-device-goma-latest-clobber': 'ios_device_release_compile_only', + 'ios-device-goma-rbe-canary-clobber': 'ios_device_release_rbe_compile_only', + 'ios-device-goma-rbe-latest-clobber': 'ios_device_release_rbe_compile_only', + 'linux-archive-rel-goma-canary': 'release_bot', + 'linux-archive-rel-goma-canary-localoutputcache': 'release_bot', + 'linux-archive-rel-goma-latest': 'release_bot', + 'linux-archive-rel-goma-latest-localoutputcache': 'release_bot', + 'linux-archive-rel-goma-rbe-ats-canary': 'release_bot', + 'linux-archive-rel-goma-rbe-ats-latest': 'release_bot', + 'linux-archive-rel-goma-rbe-canary': 'release_bot', + 'linux-archive-rel-goma-rbe-latest': 'release_bot', + 'mac-archive-rel-goma-canary': 'release_bot_mac_strip_minimal_symbols', + 'mac-archive-rel-goma-canary-localoutputcache': 'release_bot_mac_strip_minimal_symbols', + 'mac-archive-rel-goma-latest': 'release_bot_mac_strip_minimal_symbols', + 'mac-archive-rel-goma-latest-localoutputcache': 'release_bot_mac_strip_minimal_symbols', + 'mac-archive-rel-goma-rbe-canary': 'release_bot_mac_strip_minimal_symbols', + 'mac-archive-rel-goma-rbe-latest': 'release_bot_mac_strip_minimal_symbols', + 'win32-archive-rel-goma-canary-localoutputcache': 'release_bot_x86_minimal_symbols_enable_archive_compression', + 'win32-archive-rel-goma-latest-localoutputcache': 'release_bot_x86_minimal_symbols_enable_archive_compression', + 'android-10-arm64-rel': 'android_release_trybot_arm64_fastbuild_webview_google', + 'android-asan': 'android_clang_asan_release_trybot', + 'android-bfcache-rel': 'android_release_trybot', + 'android-binary-size': 'android_binary_size', + 'android-cronet-arm-dbg': 'android_cronet_debug_static_bot_arm_no_neon', + 'android-deterministic-dbg': 'android_debug_bot', + 'android-deterministic-rel': 'android_without_codecs_release_trybot', + 'android-lollipop-arm-rel': 'android_release_trybot_fastbuild_webview_google', + 'android-marshmallow-x86-fyi-rel': 'android_release_trybot_x86_fastbuild_resource_whitelisting', + 'android-opus-kitkat-arm-rel': 'android_release_trybot', + 'android-oreo-arm64-cts-networkservice-dbg': 'android_debug_trybot_arm64', + 'android-oreo-arm64-dbg': 'android_debug_trybot_arm64', + 'android-pie-arm64-coverage-rel': 'android_release_trybot_arm64_webview_google_native_coverage', + 'android-pie-arm64-dbg': 'android_debug_trybot_arm64', + 'android-pie-arm64-rel': 'android_release_trybot_arm64_webview_google', + 'android-pie-x86-rel': 'android_release_trybot_x86_fastbuild_webview_google', + 'android-weblayer-pie-arm64-fyi-rel': 'android_release_trybot_arm64', + 'android-webview-marshmallow-arm64-dbg': 'android_release_trybot_arm64_webview_google', + 'android-webview-nougat-arm64-dbg': 'android_release_trybot_arm64_webview_google', + 'android-webview-oreo-arm64-dbg': 'android_release_trybot_arm64_webview_google', + 'android-webview-pie-arm64-dbg': 'android_release_trybot_arm64_webview_google', + 'android-webview-pie-arm64-fyi-rel': 'android_release_trybot_arm64_webview_google', + 'android_angle_deqp_rel_ng': 'angle_deqp_android_release_trybot_arm64', + 'android_angle_rel_ng': 'gpu_tests_android_release_trybot_arm64', + 'android_angle_vk32_deqp_rel_ng': 'angle_deqp_android_vulkan_ndk_release_trybot', + 'android_angle_vk32_rel_ng': 'gpu_fyi_tests_android_vulkan_ndk_release_trybot', + 'android_angle_vk64_deqp_rel_ng': 'angle_deqp_android_vulkan_ndk_release_trybot_arm64', + 'android_angle_vk64_rel_ng': 'gpu_fyi_tests_android_vulkan_ndk_release_trybot_arm64', + 'android_archive_rel_ng': 'android_release_trybot', + 'android_arm64_dbg_recipe': 'android_debug_trybot_compile_only_arm64_fastbuild', + 'android_blink_rel': 'android_release_trybot', + 'android_cfi_rel_ng': 'android_cfi_full_cfi_diag_thin_lto_release_static_dcheck_always_on_goma', + 'android_clang_dbg_recipe': 'android_clang_asan_debug_trybot_compile_only_fastbuild', + 'android_compile_dbg': 'android_debug_trybot_compile_only', + 'android_compile_x64_dbg': 'android_debug_trybot_compile_only_x64', + 'android_compile_x86_dbg': 'android_debug_trybot_compile_only_x86', + 'android_cronet': 'android_cronet_release_trybot_arm_no_neon', + 'android_cronet_tester': 'android_cronet_debug_static_bot_arm_no_neon', + 'android_mojo': 'android_release_trybot_arm64', + 'android_n5x_swarming_dbg': 'android_debug_trybot_arm64', + 'android_optional_gpu_tests_rel': 'gpu_tests_android_release_trybot_arm64', + 'android_unswarmed_pixel_aosp': 'android_debug_trybot_arm64', + 'cast_shell_android': 'android_cast_debug_static_bot_compile_only', + 'cast_shell_audio_linux': 'cast_audio_release_trybot', + 'cast_shell_linux': 'cast_release_trybot', + 'chromeos-amd64-generic-cfi-thin-lto-rel': 'chromeos_amd64-generic_cfi_thin_lto', + 'chromeos-amd64-generic-dbg': 'chromeos_amd64-generic_dbg', + 'chromeos-arm-generic-dbg': 'chromeos_arm-generic_dbg', + 'chromeos-kevin-compile-rel': 'chromeos_kevin', + 'chromeos-kevin-rel': 'chromeos_kevin', + 'chromium_presubmit': 'presubmit', + 'closure_compilation': 'closure_compilation', + 'dawn-linux-x64-deps-rel': 'dawn_tests_release_trybot', + 'dawn-mac-x64-deps-rel': 'dawn_tests_release_trybot', + 'dawn-win10-x64-deps-rel': 'dawn_tests_release_trybot', + 'dawn-win10-x86-deps-rel': 'dawn_tests_release_trybot_x86', + 'fuchsia-angle-rel': 'gpu_fyi_tests_release_trybot_fuchsia', + 'fuchsia-arm64-cast': 'release_trybot_fuchsia_arm64_cast', + 'fuchsia-compile-x64-dbg': 'debug_bot_fuchsia_compile_only', + 'fuchsia-fyi-arm64-rel': 'release_trybot_fuchsia_arm64', + 'fuchsia-fyi-x64-dbg': 'debug_bot_fuchsia', + 'fuchsia-fyi-x64-rel': 'release_trybot_fuchsia', + 'fuchsia-x64-cast': 'release_trybot_fuchsia_cast', + 'fuchsia_arm64': 'release_trybot_fuchsia_arm64', + 'fuchsia_x64': 'release_trybot_fuchsia', + 'gpu-fyi-try-android-l-nexus-5-32': 'gpu_tests_android_release_trybot', + 'gpu-fyi-try-android-l-nexus-6-32': 'gpu_tests_android_release_trybot', + 'gpu-fyi-try-android-m-nexus-5x-64': 'gpu_tests_android_release_trybot_arm64', + 'gpu-fyi-try-android-m-nexus-5x-deqp-64': 'angle_deqp_android_release_trybot_arm64', + 'gpu-fyi-try-android-m-nexus-5x-skgl-64': 'gpu_tests_android_release_trybot_arm64', + 'gpu-fyi-try-android-m-nexus-6p-64': 'gpu_tests_android_release_trybot_arm64', + 'gpu-fyi-try-android-m-nexus-9-64': 'gpu_tests_android_release_trybot_arm64', + 'gpu-fyi-try-android-n-nvidia-shield-tv-64': 'gpu_tests_android_release_trybot_arm64', + 'gpu-fyi-try-android-p-pixel-2-32': 'gpu_tests_android_release_trybot', + 'gpu-fyi-try-android-p-pixel-2-skv-32': 'gpu_tests_android_release_trybot', + 'gpu-fyi-try-android-q-pixel-2-deqp-vk-32': 'angle_deqp_android_vulkan_ndk_release_trybot', + 'gpu-fyi-try-android-q-pixel-2-deqp-vk-64': 'angle_deqp_android_vulkan_ndk_release_trybot_arm64', + 'gpu-fyi-try-android-q-pixel-2-vk-32': 'gpu_fyi_tests_android_vulkan_ndk_release_trybot', + 'gpu-fyi-try-android-q-pixel-2-vk-64': 'gpu_fyi_tests_android_vulkan_ndk_release_trybot_arm64', + 'gpu-fyi-try-linux-intel-dqp': 'angle_deqp_release_trybot', + 'gpu-fyi-try-linux-intel-exp': 'gpu_fyi_tests_release_trybot', + 'gpu-fyi-try-linux-intel-rel': 'gpu_fyi_tests_release_trybot', + 'gpu-fyi-try-linux-intel-sk-dawn-rel': 'gpu_tests_sk_dawn_release_trybot', + 'gpu-fyi-try-linux-intel-skv': 'gpu_fyi_tests_release_trybot', + 'gpu-fyi-try-linux-nvidia-dbg': 'gpu_fyi_tests_debug_trybot', + 'gpu-fyi-try-linux-nvidia-dqp': 'angle_deqp_release_trybot', + 'gpu-fyi-try-linux-nvidia-exp': 'gpu_fyi_tests_release_trybot', + 'gpu-fyi-try-linux-nvidia-rel': 'gpu_fyi_tests_release_trybot', + 'gpu-fyi-try-linux-nvidia-skv': 'gpu_fyi_tests_release_trybot', + 'gpu-fyi-try-linux-nvidia-tsn': 'gpu_fyi_tests_release_trybot_tsan', + 'gpu-fyi-try-mac-amd-dqp': 'angle_deqp_release_trybot', + 'gpu-fyi-try-mac-amd-pro-rel': 'gpu_fyi_tests_release_trybot', + 'gpu-fyi-try-mac-amd-retina-dbg': 'gpu_fyi_tests_debug_trybot', + 'gpu-fyi-try-mac-amd-retina-exp': 'gpu_fyi_tests_release_trybot', + 'gpu-fyi-try-mac-amd-retina-rel': 'gpu_fyi_tests_release_trybot', + 'gpu-fyi-try-mac-asan': 'gpu_fyi_tests_release_trybot_asan', + 'gpu-fyi-try-mac-intel-dbg': 'gpu_fyi_tests_debug_trybot', + 'gpu-fyi-try-mac-intel-dqp': 'angle_deqp_release_trybot', + 'gpu-fyi-try-mac-intel-exp': 'gpu_fyi_tests_release_trybot', + 'gpu-fyi-try-mac-intel-rel': 'gpu_fyi_tests_release_trybot', + 'gpu-fyi-try-mac-nvidia-retina-dbg': 'gpu_fyi_tests_debug_trybot', + 'gpu-fyi-try-mac-nvidia-retina-exp': 'gpu_fyi_tests_release_trybot', + 'gpu-fyi-try-mac-nvidia-retina-rel': 'gpu_fyi_tests_release_trybot', + 'gpu-fyi-try-win10-intel-dqp-64': 'angle_deqp_release_trybot', + 'gpu-fyi-try-win10-intel-exp-64': 'gpu_fyi_tests_release_trybot', + 'gpu-fyi-try-win10-intel-rel-64': 'gpu_fyi_tests_release_trybot', + 'gpu-fyi-try-win10-nvidia-dbg-64': 'gpu_fyi_tests_debug_trybot', + 'gpu-fyi-try-win10-nvidia-dqp-64': 'angle_deqp_release_trybot', + 'gpu-fyi-try-win10-nvidia-dx12vk-dbg-64': 'gpu_fyi_tests_dx12vk_debug_trybot', + 'gpu-fyi-try-win10-nvidia-dx12vk-rel-64': 'gpu_fyi_tests_dx12vk_release_trybot', + 'gpu-fyi-try-win10-nvidia-exp-64': 'gpu_fyi_tests_release_trybot', + 'gpu-fyi-try-win10-nvidia-rel-32': 'gpu_fyi_tests_release_trybot_x86', + 'gpu-fyi-try-win10-nvidia-rel-64': 'gpu_fyi_tests_release_trybot', + 'gpu-fyi-try-win10-nvidia-sk-dawn-rel-64': 'gpu_tests_sk_dawn_release_trybot', + 'gpu-fyi-try-win10-nvidia-skgl-64': 'gpu_fyi_tests_release_trybot', + 'gpu-fyi-try-win7-amd-dbg-32': 'gpu_fyi_tests_debug_trybot_x86', + 'gpu-fyi-try-win7-amd-dqp-32': 'angle_deqp_release_trybot_x86', + 'gpu-fyi-try-win7-amd-rel-32': 'gpu_fyi_tests_release_trybot_x86', + 'gpu-fyi-try-win7-nvidia-dqp-64': 'angle_deqp_release_trybot', + 'gpu-fyi-try-win7-nvidia-rel-32': 'gpu_fyi_tests_release_trybot_x86', + 'gpu-fyi-try-win7-nvidia-rel-64': 'gpu_fyi_tests_release_trybot', + 'gpu-try-android-m-nexus-5x-64': 'gpu_tests_android_release_trybot_arm64', + 'gpu-try-linux-nvidia-dbg': 'gpu_tests_debug_bot', + 'gpu-try-linux-nvidia-rel': 'gpu_tests_release_trybot', + 'gpu-try-mac-amd-retina-dbg': 'gpu_tests_debug_bot', + 'gpu-try-mac-intel-dbg': 'gpu_tests_debug_bot', + 'ios-device': 'ios_device_release_rbe_compile_only', + 'ios-simulator-code-coverage': 'clang_code_coverage_ios', + 'ios-simulator-cr-recipe': 'ios_simulator_debug_static_bot', + 'ios-simulator-cronet': 'ios_cronet', + 'ios-simulator-full-configs': 'ios_error', + 'layout_test_leak_detection': 'release_trybot', + 'leak_detection_linux': 'release_trybot', + 'linux-angle-rel': 'gpu_fyi_tests_release_trybot', + 'linux-annotator-rel': 'release_trybot', + 'linux-autofill-assistant': 'autofill_assistant_release_trybot', + 'linux-bfcache-rel': 'release_bot', + 'linux-blink-heap-concurrent-marking-tsan-rel': 'release_trybot_tsan', + 'linux-blink-heap-verification-try': 'release_trybot_enable_blink_heap_verification', + 'linux-blink-rel': 'release_bot_minimal_symbols', + 'linux-chromeos-compile-dbg': 'chromeos_with_codecs_debug_bot', + 'linux-clang-tidy-dbg': 'debug_bot', + 'linux-clang-tidy-rel': 'release_trybot', + 'linux-dawn-rel': 'dawn_tests_release_trybot', + 'linux-dcheck-off-rel': 'release_trybot_dcheck_off', + 'linux-gcc-rel': 'release_bot_x86_minimal_symbols_no_clang_cxx11', + 'linux-layout-tests-edit-ng': 'release_trybot', + 'linux-layout-tests-fragment-item': 'release_trybot', + 'linux-libfuzzer-asan-rel': 'libfuzzer_asan_release_trybot', + 'linux-ozone-x11-and-wayland-rel': 'ozone_linux_release_trybot', + 'linux-rel': 'gpu_tests_release_trybot_no_symbols_use_dummy_lastchange_code_coverage', + 'linux-swangle-try-tot-angle-x64': 'angle_deqp_release_trybot', + 'linux-swangle-try-tot-angle-x86': 'angle_deqp_release_trybot_x86', + 'linux-swangle-try-tot-swiftshader-x64': 'angle_deqp_release_trybot', + 'linux-swangle-try-tot-swiftshader-x86': 'angle_deqp_release_trybot_x86', + 'linux-swangle-try-x64': 'angle_deqp_release_trybot', + 'linux-swangle-try-x86': 'angle_deqp_release_trybot_x86', + 'linux-trusty-rel': 'gpu_tests_release_trybot_no_symbols_use_dummy_lastchange', + 'linux-viz-rel': 'release_trybot', + 'linux-webkit-msan-rel': 'msan_release_bot', + 'linux-wpt-fyi-rel': 'release_trybot', + 'linux_android_dbg_ng': 'android_debug_bot', + 'linux_angle_deqp_rel_ng': 'angle_deqp_release_trybot', + 'linux_angle_ozone_rel_ng': 'angle_ozone_linux_system_gbm_libdrm_release_trybot', + 'linux_arm': 'release_trybot_arm', + 'linux_chromium_archive_rel_ng': 'release_bot', + 'linux_chromium_asan_rel_ng': 'asan_lsan_release_trybot', + 'linux_chromium_cfi_rel_ng': 'cfi_full_cfi_icall_cfi_diag_thin_lto_release_static_dcheck_always_on_goma', + 'linux_chromium_chromeos_asan_rel_ng': 'asan_lsan_chromeos_release_trybot', + 'linux_chromium_chromeos_msan_rel_ng': 'chromeos_msan_release_bot', + 'linux_chromium_clobber_deterministic': 'release_trybot', + 'linux_chromium_clobber_rel_ng': 'release_trybot', + 'linux_chromium_compile_dbg_32_ng': 'debug_bot_x86', + 'linux_chromium_compile_dbg_ng': 'debug_bot', + 'linux_chromium_compile_rel_ng': 'release_trybot', + 'linux_chromium_dbg_ng': 'gpu_tests_debug_bot', + 'linux_chromium_msan_rel_ng': 'msan_release_bot', + 'linux_chromium_tsan_rel_ng': 'tsan_disable_nacl_release_trybot', + 'linux_chromium_ubsan_rel_ng': 'ubsan_vptr_release_bot', + 'linux_layout_tests_composite_after_paint': 'release_trybot', + 'linux_layout_tests_layout_ng_disabled': 'release_trybot', + 'linux_mojo': 'release_trybot', + 'linux_mojo_chromeos': 'chromeos_with_codecs_release_trybot', + 'linux_optional_gpu_tests_rel': 'gpu_fyi_tests_release_trybot', + 'linux_upload_clang': 'release_bot', + 'linux_vr': 'vr_release_trybot', + 'mac-angle-rel': 'gpu_fyi_tests_release_trybot', + 'mac-coverage-rel': 'gpu_tests_release_trybot_deterministic_mac_code_coverage', + 'mac-dawn-rel': 'dawn_tests_release_trybot', + 'mac-rel': 'gpu_tests_release_trybot_deterministic_mac', + 'mac10.10-blink-rel': 'release_bot_minimal_symbols', + 'mac10.11-blink-rel': 'release_bot_minimal_symbols', + 'mac10.12-blink-rel': 'release_bot_minimal_symbols', + 'mac10.13-blink-rel': 'release_bot_minimal_symbols', + 'mac10.13_retina-blink-rel': 'release_bot_minimal_symbols', + 'mac10.14-blink-rel': 'release_bot_minimal_symbols', + 'mac10.15-blink-rel': 'release_bot_minimal_symbols_no_nacl', + 'mac_chromium_10.10': 'gpu_tests_release_trybot_deterministic_mac', + 'mac_chromium_10.12_rel_ng': 'gpu_tests_release_trybot_deterministic_mac', + 'mac_chromium_10.13_rel_ng': 'release_trybot', + 'mac_chromium_10.14_rel_ng': 'release_trybot', + 'mac_chromium_10.15_rel_ng': 'release_trybot_no_nacl', + 'mac_chromium_archive_rel_ng': 'release_bot_mac_strip_minimal_symbols', + 'mac_chromium_asan_rel_ng': 'asan_dcheck_disable_nacl_release_bot', + 'mac_chromium_compile_dbg_ng': 'gpu_tests_debug_bot', + 'mac_chromium_compile_rel_ng': 'gpu_tests_release_trybot_deterministic_mac', + 'mac_chromium_dbg_ng': 'gpu_tests_debug_bot', + 'mac_optional_gpu_tests_rel': 'gpu_fyi_tests_release_trybot', + 'mac_upload_clang': 'release_bot', + 'try-nougat-phone-tester': 'android_debug_trybot_arm64', + 'win-angle-deqp-rel-32': 'angle_deqp_release_trybot_x86', + 'win-angle-deqp-rel-64': 'angle_deqp_release_trybot', + 'win-angle-rel-32': 'gpu_fyi_tests_release_trybot_x86', + 'win-angle-rel-64': 'gpu_fyi_tests_release_trybot', + 'win-annotator-rel': 'release_trybot', + 'win-asan': 'asan_clang_fuzzer_static_v8_heap_minimal_symbols_release', + 'win-celab-try-rel': 'release_bot_minimal_symbols', + 'win-dawn-rel': 'dawn_tests_release_trybot', + 'win-libfuzzer-asan-rel': 'libfuzzer_windows_asan_release_trybot', + 'win-swangle-try-tot-angle-x64': 'angle_deqp_release_trybot', + 'win-swangle-try-tot-angle-x86': 'angle_deqp_release_trybot_x86', + 'win-swangle-try-tot-swiftshader-x64': 'angle_deqp_release_trybot', + 'win-swangle-try-tot-swiftshader-x86': 'angle_deqp_release_trybot_x86', + 'win-swangle-try-x64': 'angle_deqp_release_trybot', + 'win-swangle-try-x86': 'angle_deqp_release_trybot_x86', + 'win10-blink-rel': 'release_bot_x86_minimal_symbols', + 'win10_chromium_x64_coverage_rel_ng': 'gpu_tests_release_trybot_resource_whitelisting_code_coverage', + 'win10_chromium_x64_dbg_ng': 'gpu_tests_debug_bot', + 'win10_chromium_x64_rel_ng': 'gpu_tests_release_trybot_resource_whitelisting_code_coverage', + 'win10_chromium_x64_rel_ng_exp': 'release_trybot', + 'win7-blink-rel': 'release_bot_x86_minimal_symbols', + 'win7-rel': 'gpu_tests_release_trybot_x86_resource_whitelisting', + 'win_archive': 'release_trybot_x86', + 'win_chromium_compile_dbg_ng': 'gpu_tests_debug_trybot_x86_compile_only', + 'win_chromium_compile_rel_ng': 'gpu_tests_release_trybot_x86_resource_whitelisting', + 'win_chromium_dbg_ng': 'gpu_tests_debug_bot_x86', + 'win_chromium_x64_rel_ng': 'gpu_tests_release_trybot', + 'win_mojo': 'release_trybot_x86', + 'win_optional_gpu_tests_rel': 'gpu_fyi_tests_release_trybot', + 'win_upload_clang': 'release_bot', + 'win_x64_archive': 'release_trybot', + 'WebRTC Chromium Android Builder': 'android_debug_static_bot_arm64', + 'WebRTC Chromium Linux Builder': 'gpu_tests_release_bot', + 'WebRTC Chromium Mac Builder': 'gpu_tests_release_bot', + 'WebRTC Chromium Win Builder': 'release_bot_x86_minimal_symbols_no_com_init_hooks_with_codecs', + 'WebRTC Chromium FYI Android Builder': 'android_release_bot_minimal_symbols', + 'WebRTC Chromium FYI Android Builder (dbg)': 'android_debug_static_bot', + 'WebRTC Chromium FYI Android Builder ARM64 (dbg)': 'android_debug_static_bot_arm64', + 'WebRTC Chromium FYI Linux Builder': 'gpu_tests_release_bot', + 'WebRTC Chromium FYI Linux Builder (dbg)': 'debug_bot', + 'WebRTC Chromium FYI Mac Builder': 'gpu_tests_release_bot', + 'WebRTC Chromium FYI Mac Builder (dbg)': 'debug_bot', + 'WebRTC Chromium FYI Win Builder': 'release_bot_x86_minimal_symbols_no_com_init_hooks_with_codecs', + 'WebRTC Chromium FYI Win Builder (dbg)': 'debug_bot_x86_no_com_init_hooks_with_codecs' + }, + + 'ci-m81': { + 'Android Release (Nexus 5X)': 'gpu_tests_android_release_trybot_arm64_fastbuild', + 'Android arm Builder (dbg)': 'android_webview_google_debug_static_bot', + 'Cast Android (dbg)': 'android_cast_debug_static_bot', + 'Cast Linux': 'cast_release_bot', + 'Fuchsia ARM64': 'release_bot_fuchsia_arm64', + 'Fuchsia x64': 'release_bot_fuchsia', + 'GPU Linux Builder': 'gpu_tests_release_trybot', + 'GPU Mac Builder': 'gpu_tests_release_trybot_deterministic_mac', + 'GPU Win x64 Builder': 'gpu_tests_release_trybot_resource_whitelisting', + 'Linux ASan LSan Builder': 'asan_lsan_release_trybot', + 'Linux Builder': 'gpu_tests_release_bot', + 'Mac Builder': 'gpu_tests_release_bot_minimal_symbols', + 'Mac Builder (dbg)': 'gpu_tests_debug_bot', + 'WebKit Mac10.13 (retina)': 'release_bot', + 'Win Builder (dbg)': 'gpu_tests_debug_bot_x86', + 'Win x64 Builder': 'gpu_tests_release_bot_minimal_symbols', + 'android-cronet-arm-rel': 'android_cronet_release_bot_minimal_symbols_arm_no_neon', + 'android-kitkat-arm-rel': 'android_release_trybot_fastbuild', + 'android-marshmallow-arm64-rel': 'gpu_tests_android_release_trybot_arm64_resource_whitelisting_fastbuild_java_coverage', + 'chromeos-amd64-generic-rel': 'chromeos_amd64-generic', + 'chromeos-arm-generic-rel': 'chromeos_arm-generic_dcheck_always_on', + 'ios-simulator': 'ios_error', + 'linux-chromeos-dbg': 'chromeos_with_codecs_debug_bot', + 'linux-chromeos-rel': 'chromeos_with_codecs_release_trybot_code_coverage', + 'linux-ozone-rel': 'ozone_linux_release_trybot', + 'mac-osxbeta-rel': 'gpu_tests_release_trybot_deterministic_mac', + 'Chromium Android ARM 32-bit Goma RBE ToT': 'android_release_bot_minimal_symbols', + 'Chromium Android ARM 32-bit Goma RBE ToT (ATS)': 'android_release_bot_minimal_symbols_java_goma', + 'Chromium Linux Goma RBE Staging': 'release_bot', + 'Chromium Linux Goma RBE Staging (clobber)': 'release_bot', + 'Chromium Linux Goma RBE Staging (dbg)': 'debug_bot', + 'Chromium Linux Goma RBE Staging (dbg) (clobber)': 'debug_bot', + 'Chromium Linux Goma RBE ToT': 'release_bot', + 'Chromium Linux Goma RBE ToT (ATS)': 'release_bot', + 'Chromium Linux Goma Staging': 'release_bot', + 'Chromium Mac Goma RBE Staging': 'release_bot', + 'Chromium Mac Goma RBE Staging (clobber)': 'release_bot', + 'Chromium Mac Goma RBE Staging (dbg)': 'debug_bot', + 'Chromium Mac Goma RBE ToT': 'release_bot', + 'Chromium Mac Goma Staging': 'release_bot', + 'Chromium Win Goma RBE Staging': 'release_bot_x86_minimal_symbols', + 'Chromium Win Goma RBE Staging (clobber)': 'release_bot_x86_minimal_symbols', + 'Chromium Win Goma RBE ToT': 'release_bot_x86_minimal_symbols', + 'Chromium iOS Goma RBE ToT': 'ios_device_release_compile_only', + 'CrWinGomaStaging': 'release_bot_x86_minimal_symbols', + 'Linux Builder Goma Canary': 'gpu_tests_release_bot', + 'Linux Builder Goma Latest Client': 'gpu_tests_release_bot', + 'Linux Builder Goma RBE Canary': 'gpu_tests_release_bot', + 'Linux Builder Goma RBE Latest Client': 'gpu_tests_release_bot', + 'Mac Builder (dbg) Goma Canary': 'gpu_tests_debug_bot', + 'Mac Builder (dbg) Goma Canary (clobber)': 'gpu_tests_debug_bot', + 'Mac Builder (dbg) Goma Latest Client': 'gpu_tests_debug_bot', + 'Mac Builder (dbg) Goma Latest Client (clobber)': 'gpu_tests_debug_bot', + 'Mac Builder (dbg) Goma RBE Canary (clobber)': 'gpu_tests_debug_bot', + 'Mac Builder (dbg) Goma RBE Latest Client (clobber)': 'gpu_tests_debug_bot', + 'Mac Builder Goma Canary': 'gpu_tests_release_bot_minimal_symbols', + 'Mac Builder Goma Latest Client': 'gpu_tests_release_bot_minimal_symbols', + 'Win Builder (dbg) Goma Canary': 'gpu_tests_debug_bot_x86', + 'Win Builder (dbg) Goma Latest Client': 'gpu_tests_debug_bot_x86', + 'Win Builder (dbg) Goma RBE Latest Client': 'gpu_tests_debug_bot_x86', + 'Win Builder Goma Canary': 'gpu_tests_release_bot_x86_minimal_symbols', + 'Win Builder Goma Latest Client': 'gpu_tests_release_bot_x86_minimal_symbols', + 'Win Builder Goma RBE Latest Client': 'gpu_tests_release_bot_x86_minimal_symbols', + 'Win7 Builder (dbg) Goma Canary': 'gpu_tests_debug_bot_x86', + 'Win7 Builder (dbg) Goma Latest Client': 'gpu_tests_debug_bot_x86', + 'Win7 Builder Goma Canary': 'gpu_tests_release_bot_x86_minimal_symbols', + 'Win7 Builder Goma Latest Client': 'gpu_tests_release_bot_x86_minimal_symbols', + 'android-archive-dbg-goma-canary': 'android_without_codecs_debug_bot', + 'android-archive-dbg-goma-latest': 'android_without_codecs_debug_bot', + 'android-archive-dbg-goma-rbe-ats-canary': 'android_without_codecs_debug_bot', + 'android-archive-dbg-goma-rbe-ats-latest': 'android_without_codecs_debug_bot', + 'android-archive-dbg-goma-rbe-canary': 'android_without_codecs_debug_bot', + 'android-archive-dbg-goma-rbe-latest': 'android_without_codecs_debug_bot', + 'chromeos-amd64-generic-rel-goma-canary': 'chromeos_amd64-generic', + 'chromeos-amd64-generic-rel-goma-latest': 'chromeos_amd64-generic', + 'chromeos-amd64-generic-rel-goma-rbe-canary': 'chromeos_amd64-generic', + 'chromeos-amd64-generic-rel-goma-rbe-latest': 'chromeos_amd64-generic', + 'ios-device-goma-canary-clobber': 'ios_device_release_compile_only', + 'ios-device-goma-latest-clobber': 'ios_device_release_compile_only', + 'ios-device-goma-rbe-canary-clobber': 'ios_device_release_rbe_compile_only', + 'ios-device-goma-rbe-latest-clobber': 'ios_device_release_rbe_compile_only', + 'linux-archive-rel-goma-canary': 'release_bot', + 'linux-archive-rel-goma-canary-localoutputcache': 'release_bot', + 'linux-archive-rel-goma-latest': 'release_bot', + 'linux-archive-rel-goma-latest-localoutputcache': 'release_bot', + 'linux-archive-rel-goma-rbe-ats-canary': 'release_bot', + 'linux-archive-rel-goma-rbe-ats-latest': 'release_bot', + 'linux-archive-rel-goma-rbe-canary': 'release_bot', + 'linux-archive-rel-goma-rbe-latest': 'release_bot', + 'mac-archive-rel-goma-canary': 'release_bot_mac_strip_minimal_symbols', + 'mac-archive-rel-goma-canary-localoutputcache': 'release_bot_mac_strip_minimal_symbols', + 'mac-archive-rel-goma-latest': 'release_bot_mac_strip_minimal_symbols', + 'mac-archive-rel-goma-latest-localoutputcache': 'release_bot_mac_strip_minimal_symbols', + 'mac-archive-rel-goma-rbe-canary': 'release_bot_mac_strip_minimal_symbols', + 'mac-archive-rel-goma-rbe-latest': 'release_bot_mac_strip_minimal_symbols', + 'win32-archive-rel-goma-canary-localoutputcache': 'release_bot_x86_minimal_symbols_enable_archive_compression', + 'win32-archive-rel-goma-latest-localoutputcache': 'release_bot_x86_minimal_symbols_enable_archive_compression', + 'android-10-arm64-rel': 'android_release_trybot_arm64_fastbuild_webview_google', + 'android-asan': 'android_clang_asan_release_trybot', + 'android-bfcache-rel': 'android_release_trybot', + 'android-binary-size': 'android_binary_size', + 'android-cronet-arm-dbg': 'android_cronet_debug_static_bot_arm_no_neon', + 'android-deterministic-dbg': 'android_debug_bot', + 'android-deterministic-rel': 'android_without_codecs_release_trybot', + 'android-lollipop-arm-rel': 'android_release_trybot_fastbuild_webview_google', + 'android-marshmallow-x86-fyi-rel': 'android_release_trybot_x86_fastbuild_resource_whitelisting', + 'android-opus-kitkat-arm-rel': 'android_release_trybot', + 'android-oreo-arm64-cts-networkservice-dbg': 'android_debug_trybot_arm64', + 'android-oreo-arm64-dbg': 'android_debug_trybot_arm64', + 'android-pie-arm64-coverage-rel': 'android_release_trybot_arm64_webview_google_native_coverage', + 'android-pie-arm64-dbg': 'android_debug_trybot_arm64', + 'android-pie-arm64-rel': 'android_release_trybot_arm64_webview_google', + 'android-pie-x86-rel': 'android_release_trybot_x86_fastbuild_webview_google', + 'android-weblayer-pie-arm64-fyi-rel': 'android_release_trybot_arm64', + 'android-webview-marshmallow-arm64-dbg': 'android_release_trybot_arm64_webview_google', + 'android-webview-nougat-arm64-dbg': 'android_release_trybot_arm64_webview_google', + 'android-webview-oreo-arm64-dbg': 'android_release_trybot_arm64_webview_google', + 'android-webview-pie-arm64-dbg': 'android_release_trybot_arm64_webview_google', + 'android-webview-pie-arm64-fyi-rel': 'android_release_trybot_arm64_webview_google', + 'android_angle_deqp_rel_ng': 'angle_deqp_android_release_trybot_arm64', + 'android_angle_rel_ng': 'gpu_tests_android_release_trybot_arm64', + 'android_angle_vk32_deqp_rel_ng': 'angle_deqp_android_vulkan_ndk_release_trybot', + 'android_angle_vk32_rel_ng': 'gpu_fyi_tests_android_vulkan_ndk_release_trybot', + 'android_angle_vk64_deqp_rel_ng': 'angle_deqp_android_vulkan_ndk_release_trybot_arm64', + 'android_angle_vk64_rel_ng': 'gpu_fyi_tests_android_vulkan_ndk_release_trybot_arm64', + 'android_archive_rel_ng': 'android_release_trybot', + 'android_arm64_dbg_recipe': 'android_debug_trybot_compile_only_arm64_fastbuild', + 'android_blink_rel': 'android_release_trybot', + 'android_cfi_rel_ng': 'android_cfi_full_cfi_diag_thin_lto_release_static_dcheck_always_on_goma', + 'android_clang_dbg_recipe': 'android_clang_asan_debug_trybot_compile_only_fastbuild', + 'android_compile_dbg': 'android_debug_trybot_compile_only', + 'android_compile_x64_dbg': 'android_debug_trybot_compile_only_x64', + 'android_compile_x86_dbg': 'android_debug_trybot_compile_only_x86', + 'android_cronet': 'android_cronet_release_trybot_arm_no_neon', + 'android_cronet_tester': 'android_cronet_debug_static_bot_arm_no_neon', + 'android_mojo': 'android_release_trybot_arm64', + 'android_n5x_swarming_dbg': 'android_debug_trybot_arm64', + 'android_optional_gpu_tests_rel': 'gpu_tests_android_release_trybot_arm64', + 'android_unswarmed_pixel_aosp': 'android_debug_trybot_arm64', + 'cast_shell_android': 'android_cast_debug_static_bot_compile_only', + 'cast_shell_audio_linux': 'cast_audio_release_trybot', + 'cast_shell_linux': 'cast_release_trybot', + 'chromeos-amd64-generic-cfi-thin-lto-rel': 'chromeos_amd64-generic_cfi_thin_lto', + 'chromeos-amd64-generic-dbg': 'chromeos_amd64-generic_dbg', + 'chromeos-arm-generic-dbg': 'chromeos_arm-generic_dbg', + 'chromeos-kevin-compile-rel': 'chromeos_kevin', + 'chromeos-kevin-rel': 'chromeos_kevin', + 'chromium_presubmit': 'presubmit', + 'closure_compilation': 'closure_compilation', + 'dawn-linux-x64-deps-rel': 'dawn_tests_release_trybot', + 'dawn-mac-x64-deps-rel': 'dawn_tests_release_trybot', + 'dawn-win10-x64-deps-rel': 'dawn_tests_release_trybot', + 'dawn-win10-x86-deps-rel': 'dawn_tests_release_trybot_x86', + 'fuchsia-angle-rel': 'gpu_fyi_tests_release_trybot_fuchsia', + 'fuchsia-arm64-cast': 'release_trybot_fuchsia_arm64_cast', + 'fuchsia-compile-x64-dbg': 'debug_bot_fuchsia_compile_only', + 'fuchsia-fyi-arm64-rel': 'release_trybot_fuchsia_arm64', + 'fuchsia-fyi-x64-dbg': 'debug_bot_fuchsia', + 'fuchsia-fyi-x64-rel': 'release_trybot_fuchsia', + 'fuchsia-x64-cast': 'release_trybot_fuchsia_cast', + 'fuchsia_arm64': 'release_trybot_fuchsia_arm64', + 'fuchsia_x64': 'release_trybot_fuchsia', + 'gpu-fyi-try-android-l-nexus-5-32': 'gpu_tests_android_release_trybot', + 'gpu-fyi-try-android-l-nexus-6-32': 'gpu_tests_android_release_trybot', + 'gpu-fyi-try-android-m-nexus-5x-64': 'gpu_tests_android_release_trybot_arm64', + 'gpu-fyi-try-android-m-nexus-5x-deqp-64': 'angle_deqp_android_release_trybot_arm64', + 'gpu-fyi-try-android-m-nexus-5x-skgl-64': 'gpu_tests_android_release_trybot_arm64', + 'gpu-fyi-try-android-m-nexus-6p-64': 'gpu_tests_android_release_trybot_arm64', + 'gpu-fyi-try-android-m-nexus-9-64': 'gpu_tests_android_release_trybot_arm64', + 'gpu-fyi-try-android-n-nvidia-shield-tv-64': 'gpu_tests_android_release_trybot_arm64', + 'gpu-fyi-try-android-p-pixel-2-32': 'gpu_tests_android_release_trybot', + 'gpu-fyi-try-android-p-pixel-2-skv-32': 'gpu_tests_android_release_trybot', + 'gpu-fyi-try-android-q-pixel-2-deqp-vk-32': 'angle_deqp_android_vulkan_ndk_release_trybot', + 'gpu-fyi-try-android-q-pixel-2-deqp-vk-64': 'angle_deqp_android_vulkan_ndk_release_trybot_arm64', + 'gpu-fyi-try-android-q-pixel-2-vk-32': 'gpu_fyi_tests_android_vulkan_ndk_release_trybot', + 'gpu-fyi-try-android-q-pixel-2-vk-64': 'gpu_fyi_tests_android_vulkan_ndk_release_trybot_arm64', + 'gpu-fyi-try-linux-intel-dqp': 'angle_deqp_release_trybot', + 'gpu-fyi-try-linux-intel-exp': 'gpu_fyi_tests_release_trybot', + 'gpu-fyi-try-linux-intel-rel': 'gpu_fyi_tests_release_trybot', + 'gpu-fyi-try-linux-intel-sk-dawn-rel': 'gpu_tests_sk_dawn_release_trybot', + 'gpu-fyi-try-linux-intel-skv': 'gpu_fyi_tests_release_trybot', + 'gpu-fyi-try-linux-nvidia-dbg': 'gpu_fyi_tests_debug_trybot', + 'gpu-fyi-try-linux-nvidia-dqp': 'angle_deqp_release_trybot', + 'gpu-fyi-try-linux-nvidia-exp': 'gpu_fyi_tests_release_trybot', + 'gpu-fyi-try-linux-nvidia-rel': 'gpu_fyi_tests_release_trybot', + 'gpu-fyi-try-linux-nvidia-skv': 'gpu_fyi_tests_release_trybot', + 'gpu-fyi-try-linux-nvidia-tsn': 'gpu_fyi_tests_release_trybot_tsan', + 'gpu-fyi-try-mac-amd-dqp': 'angle_deqp_release_trybot', + 'gpu-fyi-try-mac-amd-pro-rel': 'gpu_fyi_tests_release_trybot', + 'gpu-fyi-try-mac-amd-retina-dbg': 'gpu_fyi_tests_debug_trybot', + 'gpu-fyi-try-mac-amd-retina-exp': 'gpu_fyi_tests_release_trybot', + 'gpu-fyi-try-mac-amd-retina-rel': 'gpu_fyi_tests_release_trybot', + 'gpu-fyi-try-mac-asan': 'gpu_fyi_tests_release_trybot_asan', + 'gpu-fyi-try-mac-intel-dbg': 'gpu_fyi_tests_debug_trybot', + 'gpu-fyi-try-mac-intel-dqp': 'angle_deqp_release_trybot', + 'gpu-fyi-try-mac-intel-exp': 'gpu_fyi_tests_release_trybot', + 'gpu-fyi-try-mac-intel-rel': 'gpu_fyi_tests_release_trybot', + 'gpu-fyi-try-mac-nvidia-retina-dbg': 'gpu_fyi_tests_debug_trybot', + 'gpu-fyi-try-mac-nvidia-retina-exp': 'gpu_fyi_tests_release_trybot', + 'gpu-fyi-try-mac-nvidia-retina-rel': 'gpu_fyi_tests_release_trybot', + 'gpu-fyi-try-win10-intel-dqp-64': 'angle_deqp_release_trybot', + 'gpu-fyi-try-win10-intel-exp-64': 'gpu_fyi_tests_release_trybot', + 'gpu-fyi-try-win10-intel-rel-64': 'gpu_fyi_tests_release_trybot', + 'gpu-fyi-try-win10-nvidia-dbg-64': 'gpu_fyi_tests_debug_trybot', + 'gpu-fyi-try-win10-nvidia-dqp-64': 'angle_deqp_release_trybot', + 'gpu-fyi-try-win10-nvidia-dx12vk-dbg-64': 'gpu_fyi_tests_dx12vk_debug_trybot', + 'gpu-fyi-try-win10-nvidia-dx12vk-rel-64': 'gpu_fyi_tests_dx12vk_release_trybot', + 'gpu-fyi-try-win10-nvidia-exp-64': 'gpu_fyi_tests_release_trybot', + 'gpu-fyi-try-win10-nvidia-rel-32': 'gpu_fyi_tests_release_trybot_x86', + 'gpu-fyi-try-win10-nvidia-rel-64': 'gpu_fyi_tests_release_trybot', + 'gpu-fyi-try-win10-nvidia-sk-dawn-rel-64': 'gpu_tests_sk_dawn_release_trybot', + 'gpu-fyi-try-win10-nvidia-skgl-64': 'gpu_fyi_tests_release_trybot', + 'gpu-fyi-try-win7-amd-dbg-32': 'gpu_fyi_tests_debug_trybot_x86', + 'gpu-fyi-try-win7-amd-dqp-32': 'angle_deqp_release_trybot_x86', + 'gpu-fyi-try-win7-amd-rel-32': 'gpu_fyi_tests_release_trybot_x86', + 'gpu-fyi-try-win7-nvidia-dqp-64': 'angle_deqp_release_trybot', + 'gpu-fyi-try-win7-nvidia-rel-32': 'gpu_fyi_tests_release_trybot_x86', + 'gpu-fyi-try-win7-nvidia-rel-64': 'gpu_fyi_tests_release_trybot', + 'gpu-try-android-m-nexus-5x-64': 'gpu_tests_android_release_trybot_arm64', + 'gpu-try-linux-nvidia-dbg': 'gpu_tests_debug_bot', + 'gpu-try-linux-nvidia-rel': 'gpu_tests_release_trybot', + 'gpu-try-mac-amd-retina-dbg': 'gpu_tests_debug_bot', + 'gpu-try-mac-intel-dbg': 'gpu_tests_debug_bot', + 'ios-device': 'ios_device_release_rbe_compile_only', + 'ios-simulator-code-coverage': 'clang_code_coverage_ios', + 'ios-simulator-cr-recipe': 'ios_simulator_debug_static_bot', + 'ios-simulator-cronet': 'ios_cronet', + 'ios-simulator-full-configs': 'ios_error', + 'layout_test_leak_detection': 'release_trybot', + 'leak_detection_linux': 'release_trybot', + 'linux-angle-rel': 'gpu_fyi_tests_release_trybot', + 'linux-annotator-rel': 'release_trybot', + 'linux-autofill-assistant': 'autofill_assistant_release_trybot', + 'linux-bfcache-rel': 'release_bot', + 'linux-blink-heap-concurrent-marking-tsan-rel': 'release_trybot_tsan', + 'linux-blink-heap-verification-try': 'release_trybot_enable_blink_heap_verification', + 'linux-blink-rel': 'release_bot_minimal_symbols', + 'linux-chromeos-compile-dbg': 'chromeos_with_codecs_debug_bot', + 'linux-clang-tidy-dbg': 'debug_bot', + 'linux-clang-tidy-rel': 'release_trybot', + 'linux-dawn-rel': 'dawn_tests_release_trybot', + 'linux-dcheck-off-rel': 'release_trybot_dcheck_off', + 'linux-gcc-rel': 'release_bot_x86_minimal_symbols_no_clang_cxx11', + 'linux-layout-tests-edit-ng': 'release_trybot', + 'linux-layout-tests-fragment-item': 'release_trybot', + 'linux-libfuzzer-asan-rel': 'libfuzzer_asan_release_trybot', + 'linux-ozone-x11-and-wayland-rel': 'ozone_linux_release_trybot', + 'linux-rel': 'gpu_tests_release_trybot_no_symbols_use_dummy_lastchange_code_coverage', + 'linux-swangle-try-tot-angle-x64': 'angle_deqp_release_trybot', + 'linux-swangle-try-tot-angle-x86': 'angle_deqp_release_trybot_x86', + 'linux-swangle-try-tot-swiftshader-x64': 'angle_deqp_release_trybot', + 'linux-swangle-try-tot-swiftshader-x86': 'angle_deqp_release_trybot_x86', + 'linux-swangle-try-x64': 'angle_deqp_release_trybot', + 'linux-swangle-try-x86': 'angle_deqp_release_trybot_x86', + 'linux-trusty-rel': 'gpu_tests_release_trybot_no_symbols_use_dummy_lastchange', + 'linux-viz-rel': 'release_trybot', + 'linux-webkit-msan-rel': 'msan_release_bot', + 'linux-wpt-fyi-rel': 'release_trybot', + 'linux_android_dbg_ng': 'android_debug_bot', + 'linux_angle_deqp_rel_ng': 'angle_deqp_release_trybot', + 'linux_angle_ozone_rel_ng': 'angle_ozone_linux_system_gbm_libdrm_release_trybot', + 'linux_arm': 'release_trybot_arm', + 'linux_chromium_archive_rel_ng': 'release_bot', + 'linux_chromium_asan_rel_ng': 'asan_lsan_release_trybot', + 'linux_chromium_cfi_rel_ng': 'cfi_full_cfi_icall_cfi_diag_thin_lto_release_static_dcheck_always_on_goma', + 'linux_chromium_chromeos_asan_rel_ng': 'asan_lsan_chromeos_release_trybot', + 'linux_chromium_chromeos_msan_rel_ng': 'chromeos_msan_release_bot', + 'linux_chromium_clobber_deterministic': 'release_trybot', + 'linux_chromium_clobber_rel_ng': 'release_trybot', + 'linux_chromium_compile_dbg_32_ng': 'debug_bot_x86', + 'linux_chromium_compile_dbg_ng': 'debug_bot', + 'linux_chromium_compile_rel_ng': 'release_trybot', + 'linux_chromium_dbg_ng': 'gpu_tests_debug_bot', + 'linux_chromium_msan_rel_ng': 'msan_release_bot', + 'linux_chromium_tsan_rel_ng': 'tsan_disable_nacl_release_trybot', + 'linux_chromium_ubsan_rel_ng': 'ubsan_vptr_release_bot', + 'linux_layout_tests_composite_after_paint': 'release_trybot', + 'linux_layout_tests_layout_ng_disabled': 'release_trybot', + 'linux_mojo': 'release_trybot', + 'linux_mojo_chromeos': 'chromeos_with_codecs_release_trybot', + 'linux_optional_gpu_tests_rel': 'gpu_fyi_tests_release_trybot', + 'linux_upload_clang': 'release_bot', + 'linux_vr': 'vr_release_trybot', + 'mac-angle-rel': 'gpu_fyi_tests_release_trybot', + 'mac-coverage-rel': 'gpu_tests_release_trybot_deterministic_mac_code_coverage', + 'mac-dawn-rel': 'dawn_tests_release_trybot', + 'mac-rel': 'gpu_tests_release_trybot_deterministic_mac', + 'mac10.10-blink-rel': 'release_bot_minimal_symbols', + 'mac10.11-blink-rel': 'release_bot_minimal_symbols', + 'mac10.12-blink-rel': 'release_bot_minimal_symbols', + 'mac10.13-blink-rel': 'release_bot_minimal_symbols', + 'mac10.13_retina-blink-rel': 'release_bot_minimal_symbols', + 'mac10.14-blink-rel': 'release_bot_minimal_symbols', + 'mac10.15-blink-rel': 'release_bot_minimal_symbols_no_nacl', + 'mac_chromium_10.10': 'gpu_tests_release_trybot_deterministic_mac', + 'mac_chromium_10.12_rel_ng': 'gpu_tests_release_trybot_deterministic_mac', + 'mac_chromium_10.13_rel_ng': 'release_trybot', + 'mac_chromium_10.14_rel_ng': 'release_trybot', + 'mac_chromium_10.15_rel_ng': 'release_trybot_no_nacl', + 'mac_chromium_archive_rel_ng': 'release_bot_mac_strip_minimal_symbols', + 'mac_chromium_asan_rel_ng': 'asan_dcheck_disable_nacl_release_bot', + 'mac_chromium_compile_dbg_ng': 'gpu_tests_debug_bot', + 'mac_chromium_compile_rel_ng': 'gpu_tests_release_trybot_deterministic_mac', + 'mac_chromium_dbg_ng': 'gpu_tests_debug_bot', + 'mac_optional_gpu_tests_rel': 'gpu_fyi_tests_release_trybot', + 'mac_upload_clang': 'release_bot', + 'try-nougat-phone-tester': 'android_debug_trybot_arm64', + 'win-angle-deqp-rel-32': 'angle_deqp_release_trybot_x86', + 'win-angle-deqp-rel-64': 'angle_deqp_release_trybot', + 'win-angle-rel-32': 'gpu_fyi_tests_release_trybot_x86', + 'win-angle-rel-64': 'gpu_fyi_tests_release_trybot', + 'win-annotator-rel': 'release_trybot', + 'win-asan': 'asan_clang_fuzzer_static_v8_heap_minimal_symbols_release', + 'win-celab-try-rel': 'release_bot_minimal_symbols', + 'win-dawn-rel': 'dawn_tests_release_trybot', + 'win-libfuzzer-asan-rel': 'libfuzzer_windows_asan_release_trybot', + 'win-swangle-try-tot-angle-x64': 'angle_deqp_release_trybot', + 'win-swangle-try-tot-angle-x86': 'angle_deqp_release_trybot_x86', + 'win-swangle-try-tot-swiftshader-x64': 'angle_deqp_release_trybot', + 'win-swangle-try-tot-swiftshader-x86': 'angle_deqp_release_trybot_x86', + 'win-swangle-try-x64': 'angle_deqp_release_trybot', + 'win-swangle-try-x86': 'angle_deqp_release_trybot_x86', + 'win10-blink-rel': 'release_bot_x86_minimal_symbols', + 'win10_chromium_x64_coverage_rel_ng': 'gpu_tests_release_trybot_resource_whitelisting_code_coverage', + 'win10_chromium_x64_dbg_ng': 'gpu_tests_debug_bot', + 'win10_chromium_x64_rel_ng': 'gpu_tests_release_trybot_resource_whitelisting_code_coverage', 'win10_chromium_x64_rel_ng_exp': 'release_trybot', 'win7-blink-rel': 'release_bot_x86_minimal_symbols', 'win7-rel': 'gpu_tests_release_trybot_x86_resource_whitelisting', @@ -563,9 +1289,8 @@ }, 'findit': { - 'Chromium Android ARM 32-bit Goma RBE Staging': 'android_release_bot_minimal_symbols', 'Chromium Android ARM 32-bit Goma RBE ToT': 'android_release_bot_minimal_symbols', - 'Chromium Android ARM 32-bit Goma RBE ToT (ATS)': 'android_release_bot_minimal_symbols', + 'Chromium Android ARM 32-bit Goma RBE ToT (ATS)': 'android_release_bot_minimal_symbols_java_goma', 'Chromium Linux Goma RBE Staging': 'release_bot', 'Chromium Linux Goma RBE Staging (clobber)': 'release_bot', 'Chromium Linux Goma RBE Staging (dbg)': 'debug_bot', @@ -581,6 +1306,7 @@ 'Chromium Win Goma RBE Staging': 'release_bot_x86_minimal_symbols', 'Chromium Win Goma RBE Staging (clobber)': 'release_bot_x86_minimal_symbols', 'Chromium Win Goma RBE ToT': 'release_bot_x86_minimal_symbols', + 'Chromium iOS Goma RBE ToT': 'ios_device_release_compile_only', 'CrWinGomaStaging': 'release_bot_x86_minimal_symbols', 'Linux Builder Goma Canary': 'gpu_tests_release_bot', 'Linux Builder Goma Latest Client': 'gpu_tests_release_bot', @@ -604,22 +1330,20 @@ 'Win7 Builder (dbg) Goma Latest Client': 'gpu_tests_debug_bot_x86', 'Win7 Builder Goma Canary': 'gpu_tests_release_bot_x86_minimal_symbols', 'Win7 Builder Goma Latest Client': 'gpu_tests_release_bot_x86_minimal_symbols', - 'WinMSVC64 Goma Canary': 'win_msvc_release_bot', - 'WinMSVC64 Goma Latest Client': 'win_msvc_release_bot', 'android-archive-dbg-goma-canary': 'android_without_codecs_debug_bot', 'android-archive-dbg-goma-latest': 'android_without_codecs_debug_bot', 'android-archive-dbg-goma-rbe-ats-canary': 'android_without_codecs_debug_bot', 'android-archive-dbg-goma-rbe-ats-latest': 'android_without_codecs_debug_bot', 'android-archive-dbg-goma-rbe-canary': 'android_without_codecs_debug_bot', 'android-archive-dbg-goma-rbe-latest': 'android_without_codecs_debug_bot', - 'chromeos-amd64-generic-rel-goma-canary': 'cros_chrome_sdk', - 'chromeos-amd64-generic-rel-goma-latest': 'cros_chrome_sdk', - 'chromeos-amd64-generic-rel-goma-rbe-canary': 'cros_chrome_sdk', - 'chromeos-amd64-generic-rel-goma-rbe-latest': 'cros_chrome_sdk', - 'ios-device-goma-canary-clobber': 'ios_error', - 'ios-device-goma-latest-clobber': 'ios_error', - 'ios-device-goma-rbe-canary-clobber': 'ios_error', - 'ios-device-goma-rbe-latest-clobber': 'ios_error', + 'chromeos-amd64-generic-rel-goma-canary': 'chromeos_amd64-generic', + 'chromeos-amd64-generic-rel-goma-latest': 'chromeos_amd64-generic', + 'chromeos-amd64-generic-rel-goma-rbe-canary': 'chromeos_amd64-generic', + 'chromeos-amd64-generic-rel-goma-rbe-latest': 'chromeos_amd64-generic', + 'ios-device-goma-canary-clobber': 'ios_device_release_compile_only', + 'ios-device-goma-latest-clobber': 'ios_device_release_compile_only', + 'ios-device-goma-rbe-canary-clobber': 'ios_device_release_rbe_compile_only', + 'ios-device-goma-rbe-latest-clobber': 'ios_device_release_rbe_compile_only', 'linux-archive-rel-goma-canary': 'release_bot', 'linux-archive-rel-goma-canary-localoutputcache': 'release_bot', 'linux-archive-rel-goma-latest': 'release_bot', @@ -636,8 +1360,9 @@ 'mac-archive-rel-goma-rbe-latest': 'release_bot_mac_strip_minimal_symbols', 'win32-archive-rel-goma-canary-localoutputcache': 'release_bot_x86_minimal_symbols_enable_archive_compression', 'win32-archive-rel-goma-latest-localoutputcache': 'release_bot_x86_minimal_symbols_enable_archive_compression', + 'android-10-arm64-rel': 'android_release_trybot_arm64_fastbuild_webview_google', 'android-asan': 'android_clang_asan_release_trybot', - 'android-bfcache-rel': 'android_release_bot_minimal_symbols_arm64', + 'android-bfcache-rel': 'android_release_trybot', 'android-binary-size': 'android_binary_size', 'android-cronet-arm-dbg': 'android_cronet_debug_static_bot_arm_no_neon', 'android-deterministic-dbg': 'android_debug_bot', @@ -645,24 +1370,26 @@ 'android-kitkat-arm-rel': 'android_release_trybot_fastbuild', 'android-lollipop-arm-rel': 'android_release_trybot_fastbuild_webview_google', 'android-marshmallow-arm64-rel': 'gpu_tests_android_release_trybot_arm64_resource_whitelisting_fastbuild_java_coverage', - 'android-marshmallow-x86-fyi-rel': 'android_release_trybot_x86_resource_whitelisting', + 'android-marshmallow-x86-fyi-rel': 'android_release_trybot_x86_fastbuild_resource_whitelisting', 'android-opus-kitkat-arm-rel': 'android_release_trybot', 'android-oreo-arm64-cts-networkservice-dbg': 'android_debug_trybot_arm64', 'android-oreo-arm64-dbg': 'android_debug_trybot_arm64', + 'android-pie-arm64-coverage-rel': 'android_release_trybot_arm64_webview_google_native_coverage', 'android-pie-arm64-dbg': 'android_debug_trybot_arm64', 'android-pie-arm64-rel': 'android_release_trybot_arm64_webview_google', - 'android-pie-x86-rel': 'android_release_trybot_x86', + 'android-pie-x86-rel': 'android_release_trybot_x86_fastbuild_webview_google', + 'android-weblayer-pie-arm64-fyi-rel': 'android_release_trybot_arm64', 'android-webview-marshmallow-arm64-dbg': 'android_release_trybot_arm64_webview_google', 'android-webview-nougat-arm64-dbg': 'android_release_trybot_arm64_webview_google', 'android-webview-oreo-arm64-dbg': 'android_release_trybot_arm64_webview_google', 'android-webview-pie-arm64-dbg': 'android_release_trybot_arm64_webview_google', 'android-webview-pie-arm64-fyi-rel': 'android_release_trybot_arm64_webview_google', - 'android_angle_deqp_rel_ng': 'deqp_android_release_trybot_arm64', + 'android_angle_deqp_rel_ng': 'angle_deqp_android_release_trybot_arm64', 'android_angle_rel_ng': 'gpu_tests_android_release_trybot_arm64', - 'android_angle_vk32_deqp_rel_ng': 'deqp_android_vulkan_ndk_release_trybot', - 'android_angle_vk32_rel_ng': 'gpu_tests_android_vulkan_ndk_release_trybot', - 'android_angle_vk64_deqp_rel_ng': 'deqp_android_vulkan_ndk_release_trybot_arm64', - 'android_angle_vk64_rel_ng': 'gpu_tests_android_vulkan_ndk_release_trybot_arm64', + 'android_angle_vk32_deqp_rel_ng': 'angle_deqp_android_vulkan_ndk_release_trybot', + 'android_angle_vk32_rel_ng': 'gpu_fyi_tests_android_vulkan_ndk_release_trybot', + 'android_angle_vk64_deqp_rel_ng': 'angle_deqp_android_vulkan_ndk_release_trybot_arm64', + 'android_angle_vk64_rel_ng': 'gpu_fyi_tests_android_vulkan_ndk_release_trybot_arm64', 'android_archive_rel_ng': 'android_release_trybot', 'android_arm64_dbg_recipe': 'android_debug_trybot_compile_only_arm64_fastbuild', 'android_blink_rel': 'android_release_trybot', @@ -680,13 +1407,13 @@ 'cast_shell_android': 'android_cast_debug_static_bot_compile_only', 'cast_shell_audio_linux': 'cast_audio_release_trybot', 'cast_shell_linux': 'cast_release_trybot', - 'chromeos-amd64-generic-cfi-thin-lto-rel': 'cros_chrome_sdk_cfi_thin_lto', - 'chromeos-amd64-generic-dbg': 'cros_chrome_sdk_dbg', - 'chromeos-amd64-generic-rel': 'cros_chrome_sdk', - 'chromeos-arm-generic-dbg': 'cros_chrome_sdk_dbg', - 'chromeos-arm-generic-rel': 'cros_chrome_sdk_dcheck_always_on', - 'chromeos-kevin-compile-rel': 'cros_chrome_sdk', - 'chromeos-kevin-rel': 'cros_chrome_sdk', + 'chromeos-amd64-generic-cfi-thin-lto-rel': 'chromeos_amd64-generic_cfi_thin_lto', + 'chromeos-amd64-generic-dbg': 'chromeos_amd64-generic_dbg', + 'chromeos-amd64-generic-rel': 'chromeos_amd64-generic', + 'chromeos-arm-generic-dbg': 'chromeos_arm-generic_dbg', + 'chromeos-arm-generic-rel': 'chromeos_arm-generic_dcheck_always_on', + 'chromeos-kevin-compile-rel': 'chromeos_kevin', + 'chromeos-kevin-rel': 'chromeos_kevin', 'chromium_presubmit': 'presubmit', 'closure_compilation': 'closure_compilation', 'dawn-linux-x64-deps-rel': 'dawn_tests_release_trybot', @@ -705,55 +1432,57 @@ 'gpu-fyi-try-android-l-nexus-5-32': 'gpu_tests_android_release_trybot', 'gpu-fyi-try-android-l-nexus-6-32': 'gpu_tests_android_release_trybot', 'gpu-fyi-try-android-m-nexus-5x-64': 'gpu_tests_android_release_trybot_arm64', - 'gpu-fyi-try-android-m-nexus-5x-deqp-64': 'deqp_android_release_trybot_arm64', + 'gpu-fyi-try-android-m-nexus-5x-deqp-64': 'angle_deqp_android_release_trybot_arm64', 'gpu-fyi-try-android-m-nexus-5x-skgl-64': 'gpu_tests_android_release_trybot_arm64', 'gpu-fyi-try-android-m-nexus-6p-64': 'gpu_tests_android_release_trybot_arm64', 'gpu-fyi-try-android-m-nexus-9-64': 'gpu_tests_android_release_trybot_arm64', 'gpu-fyi-try-android-n-nvidia-shield-tv-64': 'gpu_tests_android_release_trybot_arm64', 'gpu-fyi-try-android-p-pixel-2-32': 'gpu_tests_android_release_trybot', 'gpu-fyi-try-android-p-pixel-2-skv-32': 'gpu_tests_android_release_trybot', - 'gpu-fyi-try-android-q-pixel-2-deqp-vk-32': 'deqp_android_vulkan_ndk_release_trybot', - 'gpu-fyi-try-android-q-pixel-2-deqp-vk-64': 'deqp_android_vulkan_ndk_release_trybot_arm64', - 'gpu-fyi-try-android-q-pixel-2-vk-32': 'gpu_tests_android_vulkan_ndk_release_trybot', - 'gpu-fyi-try-android-q-pixel-2-vk-64': 'gpu_tests_android_vulkan_ndk_release_trybot_arm64', - 'gpu-fyi-try-linux-intel-dqp': 'deqp_release_trybot', + 'gpu-fyi-try-android-q-pixel-2-deqp-vk-32': 'angle_deqp_android_vulkan_ndk_release_trybot', + 'gpu-fyi-try-android-q-pixel-2-deqp-vk-64': 'angle_deqp_android_vulkan_ndk_release_trybot_arm64', + 'gpu-fyi-try-android-q-pixel-2-vk-32': 'gpu_fyi_tests_android_vulkan_ndk_release_trybot', + 'gpu-fyi-try-android-q-pixel-2-vk-64': 'gpu_fyi_tests_android_vulkan_ndk_release_trybot_arm64', + 'gpu-fyi-try-linux-intel-dqp': 'angle_deqp_release_trybot', 'gpu-fyi-try-linux-intel-exp': 'gpu_fyi_tests_release_trybot', 'gpu-fyi-try-linux-intel-rel': 'gpu_fyi_tests_release_trybot', + 'gpu-fyi-try-linux-intel-sk-dawn-rel': 'gpu_tests_sk_dawn_release_trybot', 'gpu-fyi-try-linux-intel-skv': 'gpu_fyi_tests_release_trybot', 'gpu-fyi-try-linux-nvidia-dbg': 'gpu_fyi_tests_debug_trybot', - 'gpu-fyi-try-linux-nvidia-dqp': 'deqp_release_trybot', + 'gpu-fyi-try-linux-nvidia-dqp': 'angle_deqp_release_trybot', 'gpu-fyi-try-linux-nvidia-exp': 'gpu_fyi_tests_release_trybot', 'gpu-fyi-try-linux-nvidia-rel': 'gpu_fyi_tests_release_trybot', 'gpu-fyi-try-linux-nvidia-skv': 'gpu_fyi_tests_release_trybot', 'gpu-fyi-try-linux-nvidia-tsn': 'gpu_fyi_tests_release_trybot_tsan', - 'gpu-fyi-try-mac-amd-dqp': 'deqp_release_trybot', + 'gpu-fyi-try-mac-amd-dqp': 'angle_deqp_release_trybot', 'gpu-fyi-try-mac-amd-pro-rel': 'gpu_fyi_tests_release_trybot', 'gpu-fyi-try-mac-amd-retina-dbg': 'gpu_fyi_tests_debug_trybot', 'gpu-fyi-try-mac-amd-retina-exp': 'gpu_fyi_tests_release_trybot', 'gpu-fyi-try-mac-amd-retina-rel': 'gpu_fyi_tests_release_trybot', 'gpu-fyi-try-mac-asan': 'gpu_fyi_tests_release_trybot_asan', 'gpu-fyi-try-mac-intel-dbg': 'gpu_fyi_tests_debug_trybot', - 'gpu-fyi-try-mac-intel-dqp': 'deqp_release_trybot', + 'gpu-fyi-try-mac-intel-dqp': 'angle_deqp_release_trybot', 'gpu-fyi-try-mac-intel-exp': 'gpu_fyi_tests_release_trybot', 'gpu-fyi-try-mac-intel-rel': 'gpu_fyi_tests_release_trybot', 'gpu-fyi-try-mac-nvidia-retina-dbg': 'gpu_fyi_tests_debug_trybot', 'gpu-fyi-try-mac-nvidia-retina-exp': 'gpu_fyi_tests_release_trybot', 'gpu-fyi-try-mac-nvidia-retina-rel': 'gpu_fyi_tests_release_trybot', - 'gpu-fyi-try-win10-intel-dqp-64': 'deqp_release_trybot', + 'gpu-fyi-try-win10-intel-dqp-64': 'angle_deqp_release_trybot', 'gpu-fyi-try-win10-intel-exp-64': 'gpu_fyi_tests_release_trybot', 'gpu-fyi-try-win10-intel-rel-64': 'gpu_fyi_tests_release_trybot', 'gpu-fyi-try-win10-nvidia-dbg-64': 'gpu_fyi_tests_debug_trybot', - 'gpu-fyi-try-win10-nvidia-dqp-64': 'deqp_release_trybot', + 'gpu-fyi-try-win10-nvidia-dqp-64': 'angle_deqp_release_trybot', 'gpu-fyi-try-win10-nvidia-dx12vk-dbg-64': 'gpu_fyi_tests_dx12vk_debug_trybot', 'gpu-fyi-try-win10-nvidia-dx12vk-rel-64': 'gpu_fyi_tests_dx12vk_release_trybot', 'gpu-fyi-try-win10-nvidia-exp-64': 'gpu_fyi_tests_release_trybot', 'gpu-fyi-try-win10-nvidia-rel-32': 'gpu_fyi_tests_release_trybot_x86', 'gpu-fyi-try-win10-nvidia-rel-64': 'gpu_fyi_tests_release_trybot', + 'gpu-fyi-try-win10-nvidia-sk-dawn-rel-64': 'gpu_tests_sk_dawn_release_trybot', 'gpu-fyi-try-win10-nvidia-skgl-64': 'gpu_fyi_tests_release_trybot', 'gpu-fyi-try-win7-amd-dbg-32': 'gpu_fyi_tests_debug_trybot_x86', - 'gpu-fyi-try-win7-amd-dqp-32': 'deqp_release_trybot_x86', + 'gpu-fyi-try-win7-amd-dqp-32': 'angle_deqp_release_trybot_x86', 'gpu-fyi-try-win7-amd-rel-32': 'gpu_fyi_tests_release_trybot_x86', - 'gpu-fyi-try-win7-nvidia-dqp-64': 'deqp_release_trybot', + 'gpu-fyi-try-win7-nvidia-dqp-64': 'angle_deqp_release_trybot', 'gpu-fyi-try-win7-nvidia-rel-32': 'gpu_fyi_tests_release_trybot_x86', 'gpu-fyi-try-win7-nvidia-rel-64': 'gpu_fyi_tests_release_trybot', 'gpu-try-android-m-nexus-5x-64': 'gpu_tests_android_release_trybot_arm64', @@ -761,16 +1490,17 @@ 'gpu-try-linux-nvidia-rel': 'gpu_tests_release_trybot', 'gpu-try-mac-amd-retina-dbg': 'gpu_tests_debug_bot', 'gpu-try-mac-intel-dbg': 'gpu_tests_debug_bot', - 'ios-device': 'ios_error', + 'ios-device': 'ios_device_release_rbe_compile_only', 'ios-simulator': 'ios_error', 'ios-simulator-code-coverage': 'clang_code_coverage_ios', 'ios-simulator-cr-recipe': 'ios_simulator_debug_static_bot', - 'ios-simulator-cronet': 'ios_error', + 'ios-simulator-cronet': 'ios_cronet', 'ios-simulator-full-configs': 'ios_error', 'layout_test_leak_detection': 'release_trybot', 'leak_detection_linux': 'release_trybot', 'linux-angle-rel': 'gpu_fyi_tests_release_trybot', 'linux-annotator-rel': 'release_trybot', + 'linux-autofill-assistant': 'autofill_assistant_release_trybot', 'linux-bfcache-rel': 'release_bot', 'linux-blink-heap-concurrent-marking-tsan-rel': 'release_trybot_tsan', 'linux-blink-heap-verification-try': 'release_trybot_enable_blink_heap_verification', @@ -783,24 +1513,25 @@ 'linux-dawn-rel': 'dawn_tests_release_trybot', 'linux-dcheck-off-rel': 'release_trybot_dcheck_off', 'linux-gcc-rel': 'release_bot_x86_minimal_symbols_no_clang_cxx11', + 'linux-layout-tests-edit-ng': 'release_trybot', 'linux-layout-tests-fragment-item': 'release_trybot', 'linux-libfuzzer-asan-rel': 'libfuzzer_asan_release_trybot', 'linux-ozone-rel': 'ozone_linux_release_trybot', 'linux-ozone-x11-and-wayland-rel': 'ozone_linux_release_trybot', 'linux-rel': 'gpu_tests_release_trybot_no_symbols_use_dummy_lastchange_code_coverage', - 'linux-swangle-try-tot-angle-x64': 'deqp_release_trybot', - 'linux-swangle-try-tot-angle-x86': 'deqp_release_trybot_x86', - 'linux-swangle-try-tot-swiftshader-x64': 'deqp_release_trybot', - 'linux-swangle-try-tot-swiftshader-x86': 'deqp_release_trybot_x86', - 'linux-swangle-try-x64': 'deqp_release_trybot', - 'linux-swangle-try-x86': 'deqp_release_trybot_x86', + 'linux-swangle-try-tot-angle-x64': 'angle_deqp_release_trybot', + 'linux-swangle-try-tot-angle-x86': 'angle_deqp_release_trybot_x86', + 'linux-swangle-try-tot-swiftshader-x64': 'angle_deqp_release_trybot', + 'linux-swangle-try-tot-swiftshader-x86': 'angle_deqp_release_trybot_x86', + 'linux-swangle-try-x64': 'angle_deqp_release_trybot', + 'linux-swangle-try-x86': 'angle_deqp_release_trybot_x86', 'linux-trusty-rel': 'gpu_tests_release_trybot_no_symbols_use_dummy_lastchange', 'linux-viz-rel': 'release_trybot', 'linux-webkit-msan-rel': 'msan_release_bot', 'linux-wpt-fyi-rel': 'release_trybot', 'linux_android_dbg_ng': 'android_debug_bot', - 'linux_angle_deqp_rel_ng': 'deqp_release_trybot', - 'linux_angle_ozone_rel_ng': 'gpu_fyi_tests_ozone_linux_system_gbm_libdrm_release_trybot', + 'linux_angle_deqp_rel_ng': 'angle_deqp_release_trybot', + 'linux_angle_ozone_rel_ng': 'angle_ozone_linux_system_gbm_libdrm_release_trybot', 'linux_arm': 'release_trybot_arm', 'linux_chromium_archive_rel_ng': 'release_bot', 'linux_chromium_asan_rel_ng': 'asan_lsan_release_trybot', @@ -824,6 +1555,7 @@ 'linux_upload_clang': 'release_bot', 'linux_vr': 'vr_release_trybot', 'mac-angle-rel': 'gpu_fyi_tests_release_trybot', + 'mac-coverage-rel': 'gpu_tests_release_trybot_deterministic_mac_code_coverage', 'mac-dawn-rel': 'dawn_tests_release_trybot', 'mac-osxbeta-rel': 'gpu_tests_release_trybot_deterministic_mac', 'mac-rel': 'gpu_tests_release_trybot_deterministic_mac', @@ -847,8 +1579,8 @@ 'mac_optional_gpu_tests_rel': 'gpu_fyi_tests_release_trybot', 'mac_upload_clang': 'release_bot', 'try-nougat-phone-tester': 'android_debug_trybot_arm64', - 'win-angle-deqp-rel-32': 'deqp_release_trybot_x86', - 'win-angle-deqp-rel-64': 'deqp_release_trybot', + 'win-angle-deqp-rel-32': 'angle_deqp_release_trybot_x86', + 'win-angle-deqp-rel-64': 'angle_deqp_release_trybot', 'win-angle-rel-32': 'gpu_fyi_tests_release_trybot_x86', 'win-angle-rel-64': 'gpu_fyi_tests_release_trybot', 'win-annotator-rel': 'release_trybot', @@ -856,15 +1588,16 @@ 'win-celab-try-rel': 'release_bot_minimal_symbols', 'win-dawn-rel': 'dawn_tests_release_trybot', 'win-libfuzzer-asan-rel': 'libfuzzer_windows_asan_release_trybot', - 'win-swangle-try-tot-angle-x64': 'deqp_release_trybot', - 'win-swangle-try-tot-angle-x86': 'deqp_release_trybot_x86', - 'win-swangle-try-tot-swiftshader-x64': 'deqp_release_trybot', - 'win-swangle-try-tot-swiftshader-x86': 'deqp_release_trybot_x86', - 'win-swangle-try-x64': 'deqp_release_trybot', - 'win-swangle-try-x86': 'deqp_release_trybot_x86', + 'win-swangle-try-tot-angle-x64': 'angle_deqp_release_trybot', + 'win-swangle-try-tot-angle-x86': 'angle_deqp_release_trybot_x86', + 'win-swangle-try-tot-swiftshader-x64': 'angle_deqp_release_trybot', + 'win-swangle-try-tot-swiftshader-x86': 'angle_deqp_release_trybot_x86', + 'win-swangle-try-x64': 'angle_deqp_release_trybot', + 'win-swangle-try-x86': 'angle_deqp_release_trybot_x86', 'win10-blink-rel': 'release_bot_x86_minimal_symbols', + 'win10_chromium_x64_coverage_rel_ng': 'gpu_tests_release_trybot_resource_whitelisting_code_coverage', 'win10_chromium_x64_dbg_ng': 'gpu_tests_debug_bot', - 'win10_chromium_x64_rel_ng': 'gpu_tests_release_trybot_resource_whitelisting', + 'win10_chromium_x64_rel_ng': 'gpu_tests_release_trybot_resource_whitelisting_code_coverage', 'win10_chromium_x64_rel_ng_exp': 'release_trybot', 'win7-blink-rel': 'release_bot_x86_minimal_symbols', 'win7-rel': 'gpu_tests_release_trybot_x86_resource_whitelisting', @@ -895,8 +1628,7 @@ 'goma': { 'Chromium Android ARM 32-bit Goma RBE Staging': 'android_release_bot_minimal_symbols', 'Chromium Android ARM 32-bit Goma RBE ToT': 'android_release_bot_minimal_symbols', - 'Chromium Android ARM 32-bit Goma RBE ToT (ATS)': 'android_release_bot_minimal_symbols', - 'Chromium iOS Goma RBE ToT': 'ios_error', + 'Chromium Android ARM 32-bit Goma RBE ToT (ATS)': 'android_release_bot_minimal_symbols_java_goma', 'Chromium Linux Goma RBE Staging': 'release_bot', 'Chromium Linux Goma RBE Staging (clobber)': 'release_bot', 'Chromium Linux Goma RBE Staging (dbg)': 'debug_bot', @@ -912,6 +1644,7 @@ 'Chromium Win Goma RBE Staging': 'release_bot_x86_minimal_symbols', 'Chromium Win Goma RBE Staging (clobber)': 'release_bot_x86_minimal_symbols', 'Chromium Win Goma RBE ToT': 'release_bot_x86_minimal_symbols', + 'Chromium iOS Goma RBE ToT': 'ios_device_release_compile_only', 'CrWinGomaStaging': 'release_bot_x86_minimal_symbols', 'Linux Builder Goma Canary': 'gpu_tests_release_bot', 'Linux Builder Goma Latest Client': 'gpu_tests_release_bot', @@ -941,14 +1674,14 @@ 'android-archive-dbg-goma-rbe-ats-latest': 'android_without_codecs_debug_bot', 'android-archive-dbg-goma-rbe-canary': 'android_without_codecs_debug_bot', 'android-archive-dbg-goma-rbe-latest': 'android_without_codecs_debug_bot', - 'chromeos-amd64-generic-rel-goma-canary': 'cros_chrome_sdk', - 'chromeos-amd64-generic-rel-goma-latest': 'cros_chrome_sdk', - 'chromeos-amd64-generic-rel-goma-rbe-canary': 'cros_chrome_sdk', - 'chromeos-amd64-generic-rel-goma-rbe-latest': 'cros_chrome_sdk', - 'ios-device-goma-canary-clobber': 'ios_error', - 'ios-device-goma-latest-clobber': 'ios_error', - 'ios-device-goma-rbe-canary-clobber': 'ios_error', - 'ios-device-goma-rbe-latest-clobber': 'ios_error', + 'chromeos-amd64-generic-rel-goma-canary': 'chromeos_amd64-generic', + 'chromeos-amd64-generic-rel-goma-latest': 'chromeos_amd64-generic', + 'chromeos-amd64-generic-rel-goma-rbe-canary': 'chromeos_amd64-generic', + 'chromeos-amd64-generic-rel-goma-rbe-latest': 'chromeos_amd64-generic', + 'ios-device-goma-canary-clobber': 'ios_device_release_compile_only', + 'ios-device-goma-latest-clobber': 'ios_device_release_compile_only', + 'ios-device-goma-rbe-canary-clobber': 'ios_device_release_rbe_compile_only', + 'ios-device-goma-rbe-latest-clobber': 'ios_device_release_rbe_compile_only', 'linux-archive-rel-goma-canary': 'release_bot', 'linux-archive-rel-goma-canary-localoutputcache': 'release_bot', 'linux-archive-rel-goma-latest': 'release_bot', @@ -965,8 +1698,9 @@ 'mac-archive-rel-goma-rbe-latest': 'release_bot_mac_strip_minimal_symbols', 'win32-archive-rel-goma-canary-localoutputcache': 'release_bot_x86_minimal_symbols_enable_archive_compression', 'win32-archive-rel-goma-latest-localoutputcache': 'release_bot_x86_minimal_symbols_enable_archive_compression', + 'android-10-arm64-rel': 'android_release_trybot_arm64_fastbuild_webview_google', 'android-asan': 'android_clang_asan_release_trybot', - 'android-bfcache-rel': 'android_release_bot_minimal_symbols_arm64', + 'android-bfcache-rel': 'android_release_trybot', 'android-binary-size': 'android_binary_size', 'android-cronet-arm-dbg': 'android_cronet_debug_static_bot_arm_no_neon', 'android-deterministic-dbg': 'android_debug_bot', @@ -974,24 +1708,26 @@ 'android-kitkat-arm-rel': 'android_release_trybot_fastbuild', 'android-lollipop-arm-rel': 'android_release_trybot_fastbuild_webview_google', 'android-marshmallow-arm64-rel': 'gpu_tests_android_release_trybot_arm64_resource_whitelisting_fastbuild_java_coverage', - 'android-marshmallow-x86-fyi-rel': 'android_release_trybot_x86_resource_whitelisting', + 'android-marshmallow-x86-fyi-rel': 'android_release_trybot_x86_fastbuild_resource_whitelisting', 'android-opus-kitkat-arm-rel': 'android_release_trybot', 'android-oreo-arm64-cts-networkservice-dbg': 'android_debug_trybot_arm64', 'android-oreo-arm64-dbg': 'android_debug_trybot_arm64', + 'android-pie-arm64-coverage-rel': 'android_release_trybot_arm64_webview_google_native_coverage', 'android-pie-arm64-dbg': 'android_debug_trybot_arm64', 'android-pie-arm64-rel': 'android_release_trybot_arm64_webview_google', - 'android-pie-x86-rel': 'android_release_trybot_x86', + 'android-pie-x86-rel': 'android_release_trybot_x86_fastbuild_webview_google', + 'android-weblayer-pie-arm64-fyi-rel': 'android_release_trybot_arm64', 'android-webview-marshmallow-arm64-dbg': 'android_release_trybot_arm64_webview_google', 'android-webview-nougat-arm64-dbg': 'android_release_trybot_arm64_webview_google', 'android-webview-oreo-arm64-dbg': 'android_release_trybot_arm64_webview_google', 'android-webview-pie-arm64-dbg': 'android_release_trybot_arm64_webview_google', 'android-webview-pie-arm64-fyi-rel': 'android_release_trybot_arm64_webview_google', - 'android_angle_deqp_rel_ng': 'deqp_android_release_trybot_arm64', + 'android_angle_deqp_rel_ng': 'angle_deqp_android_release_trybot_arm64', 'android_angle_rel_ng': 'gpu_tests_android_release_trybot_arm64', - 'android_angle_vk32_deqp_rel_ng': 'deqp_android_vulkan_ndk_release_trybot', - 'android_angle_vk32_rel_ng': 'gpu_tests_android_vulkan_ndk_release_trybot', - 'android_angle_vk64_deqp_rel_ng': 'deqp_android_vulkan_ndk_release_trybot_arm64', - 'android_angle_vk64_rel_ng': 'gpu_tests_android_vulkan_ndk_release_trybot_arm64', + 'android_angle_vk32_deqp_rel_ng': 'angle_deqp_android_vulkan_ndk_release_trybot', + 'android_angle_vk32_rel_ng': 'gpu_fyi_tests_android_vulkan_ndk_release_trybot', + 'android_angle_vk64_deqp_rel_ng': 'angle_deqp_android_vulkan_ndk_release_trybot_arm64', + 'android_angle_vk64_rel_ng': 'gpu_fyi_tests_android_vulkan_ndk_release_trybot_arm64', 'android_archive_rel_ng': 'android_release_trybot', 'android_arm64_dbg_recipe': 'android_debug_trybot_compile_only_arm64_fastbuild', 'android_blink_rel': 'android_release_trybot', @@ -1009,13 +1745,13 @@ 'cast_shell_android': 'android_cast_debug_static_bot_compile_only', 'cast_shell_audio_linux': 'cast_audio_release_trybot', 'cast_shell_linux': 'cast_release_trybot', - 'chromeos-amd64-generic-cfi-thin-lto-rel': 'cros_chrome_sdk_cfi_thin_lto', - 'chromeos-amd64-generic-dbg': 'cros_chrome_sdk_dbg', - 'chromeos-amd64-generic-rel': 'cros_chrome_sdk', - 'chromeos-arm-generic-dbg': 'cros_chrome_sdk_dbg', - 'chromeos-arm-generic-rel': 'cros_chrome_sdk_dcheck_always_on', - 'chromeos-kevin-compile-rel': 'cros_chrome_sdk', - 'chromeos-kevin-rel': 'cros_chrome_sdk', + 'chromeos-amd64-generic-cfi-thin-lto-rel': 'chromeos_amd64-generic_cfi_thin_lto', + 'chromeos-amd64-generic-dbg': 'chromeos_amd64-generic_dbg', + 'chromeos-amd64-generic-rel': 'chromeos_amd64-generic', + 'chromeos-arm-generic-dbg': 'chromeos_arm-generic_dbg', + 'chromeos-arm-generic-rel': 'chromeos_arm-generic_dcheck_always_on', + 'chromeos-kevin-compile-rel': 'chromeos_kevin', + 'chromeos-kevin-rel': 'chromeos_kevin', 'chromium_presubmit': 'presubmit', 'closure_compilation': 'closure_compilation', 'dawn-linux-x64-deps-rel': 'dawn_tests_release_trybot', @@ -1034,55 +1770,57 @@ 'gpu-fyi-try-android-l-nexus-5-32': 'gpu_tests_android_release_trybot', 'gpu-fyi-try-android-l-nexus-6-32': 'gpu_tests_android_release_trybot', 'gpu-fyi-try-android-m-nexus-5x-64': 'gpu_tests_android_release_trybot_arm64', - 'gpu-fyi-try-android-m-nexus-5x-deqp-64': 'deqp_android_release_trybot_arm64', + 'gpu-fyi-try-android-m-nexus-5x-deqp-64': 'angle_deqp_android_release_trybot_arm64', 'gpu-fyi-try-android-m-nexus-5x-skgl-64': 'gpu_tests_android_release_trybot_arm64', 'gpu-fyi-try-android-m-nexus-6p-64': 'gpu_tests_android_release_trybot_arm64', 'gpu-fyi-try-android-m-nexus-9-64': 'gpu_tests_android_release_trybot_arm64', 'gpu-fyi-try-android-n-nvidia-shield-tv-64': 'gpu_tests_android_release_trybot_arm64', 'gpu-fyi-try-android-p-pixel-2-32': 'gpu_tests_android_release_trybot', 'gpu-fyi-try-android-p-pixel-2-skv-32': 'gpu_tests_android_release_trybot', - 'gpu-fyi-try-android-q-pixel-2-deqp-vk-32': 'deqp_android_vulkan_ndk_release_trybot', - 'gpu-fyi-try-android-q-pixel-2-deqp-vk-64': 'deqp_android_vulkan_ndk_release_trybot_arm64', - 'gpu-fyi-try-android-q-pixel-2-vk-32': 'gpu_tests_android_vulkan_ndk_release_trybot', - 'gpu-fyi-try-android-q-pixel-2-vk-64': 'gpu_tests_android_vulkan_ndk_release_trybot_arm64', - 'gpu-fyi-try-linux-intel-dqp': 'deqp_release_trybot', + 'gpu-fyi-try-android-q-pixel-2-deqp-vk-32': 'angle_deqp_android_vulkan_ndk_release_trybot', + 'gpu-fyi-try-android-q-pixel-2-deqp-vk-64': 'angle_deqp_android_vulkan_ndk_release_trybot_arm64', + 'gpu-fyi-try-android-q-pixel-2-vk-32': 'gpu_fyi_tests_android_vulkan_ndk_release_trybot', + 'gpu-fyi-try-android-q-pixel-2-vk-64': 'gpu_fyi_tests_android_vulkan_ndk_release_trybot_arm64', + 'gpu-fyi-try-linux-intel-dqp': 'angle_deqp_release_trybot', 'gpu-fyi-try-linux-intel-exp': 'gpu_fyi_tests_release_trybot', 'gpu-fyi-try-linux-intel-rel': 'gpu_fyi_tests_release_trybot', + 'gpu-fyi-try-linux-intel-sk-dawn-rel': 'gpu_tests_sk_dawn_release_trybot', 'gpu-fyi-try-linux-intel-skv': 'gpu_fyi_tests_release_trybot', 'gpu-fyi-try-linux-nvidia-dbg': 'gpu_fyi_tests_debug_trybot', - 'gpu-fyi-try-linux-nvidia-dqp': 'deqp_release_trybot', + 'gpu-fyi-try-linux-nvidia-dqp': 'angle_deqp_release_trybot', 'gpu-fyi-try-linux-nvidia-exp': 'gpu_fyi_tests_release_trybot', 'gpu-fyi-try-linux-nvidia-rel': 'gpu_fyi_tests_release_trybot', 'gpu-fyi-try-linux-nvidia-skv': 'gpu_fyi_tests_release_trybot', 'gpu-fyi-try-linux-nvidia-tsn': 'gpu_fyi_tests_release_trybot_tsan', - 'gpu-fyi-try-mac-amd-dqp': 'deqp_release_trybot', + 'gpu-fyi-try-mac-amd-dqp': 'angle_deqp_release_trybot', 'gpu-fyi-try-mac-amd-pro-rel': 'gpu_fyi_tests_release_trybot', 'gpu-fyi-try-mac-amd-retina-dbg': 'gpu_fyi_tests_debug_trybot', 'gpu-fyi-try-mac-amd-retina-exp': 'gpu_fyi_tests_release_trybot', 'gpu-fyi-try-mac-amd-retina-rel': 'gpu_fyi_tests_release_trybot', 'gpu-fyi-try-mac-asan': 'gpu_fyi_tests_release_trybot_asan', 'gpu-fyi-try-mac-intel-dbg': 'gpu_fyi_tests_debug_trybot', - 'gpu-fyi-try-mac-intel-dqp': 'deqp_release_trybot', + 'gpu-fyi-try-mac-intel-dqp': 'angle_deqp_release_trybot', 'gpu-fyi-try-mac-intel-exp': 'gpu_fyi_tests_release_trybot', 'gpu-fyi-try-mac-intel-rel': 'gpu_fyi_tests_release_trybot', 'gpu-fyi-try-mac-nvidia-retina-dbg': 'gpu_fyi_tests_debug_trybot', 'gpu-fyi-try-mac-nvidia-retina-exp': 'gpu_fyi_tests_release_trybot', 'gpu-fyi-try-mac-nvidia-retina-rel': 'gpu_fyi_tests_release_trybot', - 'gpu-fyi-try-win10-intel-dqp-64': 'deqp_release_trybot', + 'gpu-fyi-try-win10-intel-dqp-64': 'angle_deqp_release_trybot', 'gpu-fyi-try-win10-intel-exp-64': 'gpu_fyi_tests_release_trybot', 'gpu-fyi-try-win10-intel-rel-64': 'gpu_fyi_tests_release_trybot', 'gpu-fyi-try-win10-nvidia-dbg-64': 'gpu_fyi_tests_debug_trybot', - 'gpu-fyi-try-win10-nvidia-dqp-64': 'deqp_release_trybot', + 'gpu-fyi-try-win10-nvidia-dqp-64': 'angle_deqp_release_trybot', 'gpu-fyi-try-win10-nvidia-dx12vk-dbg-64': 'gpu_fyi_tests_dx12vk_debug_trybot', 'gpu-fyi-try-win10-nvidia-dx12vk-rel-64': 'gpu_fyi_tests_dx12vk_release_trybot', 'gpu-fyi-try-win10-nvidia-exp-64': 'gpu_fyi_tests_release_trybot', 'gpu-fyi-try-win10-nvidia-rel-32': 'gpu_fyi_tests_release_trybot_x86', 'gpu-fyi-try-win10-nvidia-rel-64': 'gpu_fyi_tests_release_trybot', + 'gpu-fyi-try-win10-nvidia-sk-dawn-rel-64': 'gpu_tests_sk_dawn_release_trybot', 'gpu-fyi-try-win10-nvidia-skgl-64': 'gpu_fyi_tests_release_trybot', 'gpu-fyi-try-win7-amd-dbg-32': 'gpu_fyi_tests_debug_trybot_x86', - 'gpu-fyi-try-win7-amd-dqp-32': 'deqp_release_trybot_x86', + 'gpu-fyi-try-win7-amd-dqp-32': 'angle_deqp_release_trybot_x86', 'gpu-fyi-try-win7-amd-rel-32': 'gpu_fyi_tests_release_trybot_x86', - 'gpu-fyi-try-win7-nvidia-dqp-64': 'deqp_release_trybot', + 'gpu-fyi-try-win7-nvidia-dqp-64': 'angle_deqp_release_trybot', 'gpu-fyi-try-win7-nvidia-rel-32': 'gpu_fyi_tests_release_trybot_x86', 'gpu-fyi-try-win7-nvidia-rel-64': 'gpu_fyi_tests_release_trybot', 'gpu-try-android-m-nexus-5x-64': 'gpu_tests_android_release_trybot_arm64', @@ -1090,16 +1828,17 @@ 'gpu-try-linux-nvidia-rel': 'gpu_tests_release_trybot', 'gpu-try-mac-amd-retina-dbg': 'gpu_tests_debug_bot', 'gpu-try-mac-intel-dbg': 'gpu_tests_debug_bot', - 'ios-device': 'ios_error', + 'ios-device': 'ios_device_release_rbe_compile_only', 'ios-simulator': 'ios_error', 'ios-simulator-code-coverage': 'clang_code_coverage_ios', 'ios-simulator-cr-recipe': 'ios_simulator_debug_static_bot', - 'ios-simulator-cronet': 'ios_error', + 'ios-simulator-cronet': 'ios_cronet', 'ios-simulator-full-configs': 'ios_error', 'layout_test_leak_detection': 'release_trybot', 'leak_detection_linux': 'release_trybot', 'linux-angle-rel': 'gpu_fyi_tests_release_trybot', 'linux-annotator-rel': 'release_trybot', + 'linux-autofill-assistant': 'autofill_assistant_release_trybot', 'linux-bfcache-rel': 'release_bot', 'linux-blink-heap-concurrent-marking-tsan-rel': 'release_trybot_tsan', 'linux-blink-heap-verification-try': 'release_trybot_enable_blink_heap_verification', @@ -1112,24 +1851,25 @@ 'linux-dawn-rel': 'dawn_tests_release_trybot', 'linux-dcheck-off-rel': 'release_trybot_dcheck_off', 'linux-gcc-rel': 'release_bot_x86_minimal_symbols_no_clang_cxx11', + 'linux-layout-tests-edit-ng': 'release_trybot', 'linux-layout-tests-fragment-item': 'release_trybot', 'linux-libfuzzer-asan-rel': 'libfuzzer_asan_release_trybot', 'linux-ozone-rel': 'ozone_linux_release_trybot', 'linux-ozone-x11-and-wayland-rel': 'ozone_linux_release_trybot', 'linux-rel': 'gpu_tests_release_trybot_no_symbols_use_dummy_lastchange_code_coverage', - 'linux-swangle-try-tot-angle-x64': 'deqp_release_trybot', - 'linux-swangle-try-tot-angle-x86': 'deqp_release_trybot_x86', - 'linux-swangle-try-tot-swiftshader-x64': 'deqp_release_trybot', - 'linux-swangle-try-tot-swiftshader-x86': 'deqp_release_trybot_x86', - 'linux-swangle-try-x64': 'deqp_release_trybot', - 'linux-swangle-try-x86': 'deqp_release_trybot_x86', + 'linux-swangle-try-tot-angle-x64': 'angle_deqp_release_trybot', + 'linux-swangle-try-tot-angle-x86': 'angle_deqp_release_trybot_x86', + 'linux-swangle-try-tot-swiftshader-x64': 'angle_deqp_release_trybot', + 'linux-swangle-try-tot-swiftshader-x86': 'angle_deqp_release_trybot_x86', + 'linux-swangle-try-x64': 'angle_deqp_release_trybot', + 'linux-swangle-try-x86': 'angle_deqp_release_trybot_x86', 'linux-trusty-rel': 'gpu_tests_release_trybot_no_symbols_use_dummy_lastchange', 'linux-viz-rel': 'release_trybot', 'linux-webkit-msan-rel': 'msan_release_bot', 'linux-wpt-fyi-rel': 'release_trybot', 'linux_android_dbg_ng': 'android_debug_bot', - 'linux_angle_deqp_rel_ng': 'deqp_release_trybot', - 'linux_angle_ozone_rel_ng': 'gpu_fyi_tests_ozone_linux_system_gbm_libdrm_release_trybot', + 'linux_angle_deqp_rel_ng': 'angle_deqp_release_trybot', + 'linux_angle_ozone_rel_ng': 'angle_ozone_linux_system_gbm_libdrm_release_trybot', 'linux_arm': 'release_trybot_arm', 'linux_chromium_archive_rel_ng': 'release_bot', 'linux_chromium_asan_rel_ng': 'asan_lsan_release_trybot', @@ -1153,6 +1893,7 @@ 'linux_upload_clang': 'release_bot', 'linux_vr': 'vr_release_trybot', 'mac-angle-rel': 'gpu_fyi_tests_release_trybot', + 'mac-coverage-rel': 'gpu_tests_release_trybot_deterministic_mac_code_coverage', 'mac-dawn-rel': 'dawn_tests_release_trybot', 'mac-osxbeta-rel': 'gpu_tests_release_trybot_deterministic_mac', 'mac-rel': 'gpu_tests_release_trybot_deterministic_mac', @@ -1176,8 +1917,8 @@ 'mac_optional_gpu_tests_rel': 'gpu_fyi_tests_release_trybot', 'mac_upload_clang': 'release_bot', 'try-nougat-phone-tester': 'android_debug_trybot_arm64', - 'win-angle-deqp-rel-32': 'deqp_release_trybot_x86', - 'win-angle-deqp-rel-64': 'deqp_release_trybot', + 'win-angle-deqp-rel-32': 'angle_deqp_release_trybot_x86', + 'win-angle-deqp-rel-64': 'angle_deqp_release_trybot', 'win-angle-rel-32': 'gpu_fyi_tests_release_trybot_x86', 'win-angle-rel-64': 'gpu_fyi_tests_release_trybot', 'win-annotator-rel': 'release_trybot', @@ -1185,15 +1926,16 @@ 'win-celab-try-rel': 'release_bot_minimal_symbols', 'win-dawn-rel': 'dawn_tests_release_trybot', 'win-libfuzzer-asan-rel': 'libfuzzer_windows_asan_release_trybot', - 'win-swangle-try-tot-angle-x64': 'deqp_release_trybot', - 'win-swangle-try-tot-angle-x86': 'deqp_release_trybot_x86', - 'win-swangle-try-tot-swiftshader-x64': 'deqp_release_trybot', - 'win-swangle-try-tot-swiftshader-x86': 'deqp_release_trybot_x86', - 'win-swangle-try-x64': 'deqp_release_trybot', - 'win-swangle-try-x86': 'deqp_release_trybot_x86', + 'win-swangle-try-tot-angle-x64': 'angle_deqp_release_trybot', + 'win-swangle-try-tot-angle-x86': 'angle_deqp_release_trybot_x86', + 'win-swangle-try-tot-swiftshader-x64': 'angle_deqp_release_trybot', + 'win-swangle-try-tot-swiftshader-x86': 'angle_deqp_release_trybot_x86', + 'win-swangle-try-x64': 'angle_deqp_release_trybot', + 'win-swangle-try-x86': 'angle_deqp_release_trybot_x86', 'win10-blink-rel': 'release_bot_x86_minimal_symbols', + 'win10_chromium_x64_coverage_rel_ng': 'gpu_tests_release_trybot_resource_whitelisting_code_coverage', 'win10_chromium_x64_dbg_ng': 'gpu_tests_debug_bot', - 'win10_chromium_x64_rel_ng': 'gpu_tests_release_trybot_resource_whitelisting', + 'win10_chromium_x64_rel_ng': 'gpu_tests_release_trybot_resource_whitelisting_code_coverage', 'win10_chromium_x64_rel_ng_exp': 'release_trybot', 'win7-blink-rel': 'release_bot_x86_minimal_symbols', 'win7-rel': 'gpu_tests_release_trybot_x86_resource_whitelisting', @@ -1222,8 +1964,9 @@ }, 'try': { + 'android-10-arm64-rel': 'android_release_trybot_arm64_fastbuild_webview_google', 'android-asan': 'android_clang_asan_release_trybot', - 'android-bfcache-rel': 'android_release_bot_minimal_symbols_arm64', + 'android-bfcache-rel': 'android_release_trybot', 'android-binary-size': 'android_binary_size', 'android-cronet-arm-dbg': 'android_cronet_debug_static_bot_arm_no_neon', 'android-deterministic-dbg': 'android_debug_bot', @@ -1231,24 +1974,26 @@ 'android-kitkat-arm-rel': 'android_release_trybot_fastbuild', 'android-lollipop-arm-rel': 'android_release_trybot_fastbuild_webview_google', 'android-marshmallow-arm64-rel': 'gpu_tests_android_release_trybot_arm64_resource_whitelisting_fastbuild_java_coverage', - 'android-marshmallow-x86-fyi-rel': 'android_release_trybot_x86_resource_whitelisting', + 'android-marshmallow-x86-fyi-rel': 'android_release_trybot_x86_fastbuild_resource_whitelisting', 'android-opus-kitkat-arm-rel': 'android_release_trybot', 'android-oreo-arm64-cts-networkservice-dbg': 'android_debug_trybot_arm64', 'android-oreo-arm64-dbg': 'android_debug_trybot_arm64', + 'android-pie-arm64-coverage-rel': 'android_release_trybot_arm64_webview_google_native_coverage', 'android-pie-arm64-dbg': 'android_debug_trybot_arm64', 'android-pie-arm64-rel': 'android_release_trybot_arm64_webview_google', - 'android-pie-x86-rel': 'android_release_trybot_x86', + 'android-pie-x86-rel': 'android_release_trybot_x86_fastbuild_webview_google', + 'android-weblayer-pie-arm64-fyi-rel': 'android_release_trybot_arm64', 'android-webview-marshmallow-arm64-dbg': 'android_release_trybot_arm64_webview_google', 'android-webview-nougat-arm64-dbg': 'android_release_trybot_arm64_webview_google', 'android-webview-oreo-arm64-dbg': 'android_release_trybot_arm64_webview_google', 'android-webview-pie-arm64-dbg': 'android_release_trybot_arm64_webview_google', 'android-webview-pie-arm64-fyi-rel': 'android_release_trybot_arm64_webview_google', - 'android_angle_deqp_rel_ng': 'deqp_android_release_trybot_arm64', + 'android_angle_deqp_rel_ng': 'angle_deqp_android_release_trybot_arm64', 'android_angle_rel_ng': 'gpu_tests_android_release_trybot_arm64', - 'android_angle_vk32_deqp_rel_ng': 'deqp_android_vulkan_ndk_release_trybot', - 'android_angle_vk32_rel_ng': 'gpu_tests_android_vulkan_ndk_release_trybot', - 'android_angle_vk64_deqp_rel_ng': 'deqp_android_vulkan_ndk_release_trybot_arm64', - 'android_angle_vk64_rel_ng': 'gpu_tests_android_vulkan_ndk_release_trybot_arm64', + 'android_angle_vk32_deqp_rel_ng': 'angle_deqp_android_vulkan_ndk_release_trybot', + 'android_angle_vk32_rel_ng': 'gpu_fyi_tests_android_vulkan_ndk_release_trybot', + 'android_angle_vk64_deqp_rel_ng': 'angle_deqp_android_vulkan_ndk_release_trybot_arm64', + 'android_angle_vk64_rel_ng': 'gpu_fyi_tests_android_vulkan_ndk_release_trybot_arm64', 'android_archive_rel_ng': 'android_release_trybot', 'android_arm64_dbg_recipe': 'android_debug_trybot_compile_only_arm64_fastbuild', 'android_blink_rel': 'android_release_trybot', @@ -1266,13 +2011,13 @@ 'cast_shell_android': 'android_cast_debug_static_bot_compile_only', 'cast_shell_audio_linux': 'cast_audio_release_trybot', 'cast_shell_linux': 'cast_release_trybot', - 'chromeos-amd64-generic-cfi-thin-lto-rel': 'cros_chrome_sdk_cfi_thin_lto', - 'chromeos-amd64-generic-dbg': 'cros_chrome_sdk_dbg', - 'chromeos-amd64-generic-rel': 'cros_chrome_sdk', - 'chromeos-arm-generic-dbg': 'cros_chrome_sdk_dbg', - 'chromeos-arm-generic-rel': 'cros_chrome_sdk_dcheck_always_on', - 'chromeos-kevin-compile-rel': 'cros_chrome_sdk', - 'chromeos-kevin-rel': 'cros_chrome_sdk', + 'chromeos-amd64-generic-cfi-thin-lto-rel': 'chromeos_amd64-generic_cfi_thin_lto', + 'chromeos-amd64-generic-dbg': 'chromeos_amd64-generic_dbg', + 'chromeos-amd64-generic-rel': 'chromeos_amd64-generic', + 'chromeos-arm-generic-dbg': 'chromeos_arm-generic_dbg', + 'chromeos-arm-generic-rel': 'chromeos_arm-generic_dcheck_always_on', + 'chromeos-kevin-compile-rel': 'chromeos_kevin', + 'chromeos-kevin-rel': 'chromeos_kevin', 'chromium_presubmit': 'presubmit', 'closure_compilation': 'closure_compilation', 'dawn-linux-x64-deps-rel': 'dawn_tests_release_trybot', @@ -1291,45 +2036,46 @@ 'gpu-fyi-try-android-l-nexus-5-32': 'gpu_tests_android_release_trybot', 'gpu-fyi-try-android-l-nexus-6-32': 'gpu_tests_android_release_trybot', 'gpu-fyi-try-android-m-nexus-5x-64': 'gpu_tests_android_release_trybot_arm64', - 'gpu-fyi-try-android-m-nexus-5x-deqp-64': 'deqp_android_release_trybot_arm64', + 'gpu-fyi-try-android-m-nexus-5x-deqp-64': 'angle_deqp_android_release_trybot_arm64', 'gpu-fyi-try-android-m-nexus-5x-skgl-64': 'gpu_tests_android_release_trybot_arm64', 'gpu-fyi-try-android-m-nexus-6p-64': 'gpu_tests_android_release_trybot_arm64', 'gpu-fyi-try-android-m-nexus-9-64': 'gpu_tests_android_release_trybot_arm64', 'gpu-fyi-try-android-n-nvidia-shield-tv-64': 'gpu_tests_android_release_trybot_arm64', 'gpu-fyi-try-android-p-pixel-2-32': 'gpu_tests_android_release_trybot', 'gpu-fyi-try-android-p-pixel-2-skv-32': 'gpu_tests_android_release_trybot', - 'gpu-fyi-try-android-q-pixel-2-deqp-vk-32': 'deqp_android_vulkan_ndk_release_trybot', - 'gpu-fyi-try-android-q-pixel-2-deqp-vk-64': 'deqp_android_vulkan_ndk_release_trybot_arm64', - 'gpu-fyi-try-android-q-pixel-2-vk-32': 'gpu_tests_android_vulkan_ndk_release_trybot', - 'gpu-fyi-try-android-q-pixel-2-vk-64': 'gpu_tests_android_vulkan_ndk_release_trybot_arm64', - 'gpu-fyi-try-linux-intel-dqp': 'deqp_release_trybot', + 'gpu-fyi-try-android-q-pixel-2-deqp-vk-32': 'angle_deqp_android_vulkan_ndk_release_trybot', + 'gpu-fyi-try-android-q-pixel-2-deqp-vk-64': 'angle_deqp_android_vulkan_ndk_release_trybot_arm64', + 'gpu-fyi-try-android-q-pixel-2-vk-32': 'gpu_fyi_tests_android_vulkan_ndk_release_trybot', + 'gpu-fyi-try-android-q-pixel-2-vk-64': 'gpu_fyi_tests_android_vulkan_ndk_release_trybot_arm64', + 'gpu-fyi-try-linux-intel-dqp': 'angle_deqp_release_trybot', 'gpu-fyi-try-linux-intel-exp': 'gpu_fyi_tests_release_trybot', 'gpu-fyi-try-linux-intel-rel': 'gpu_fyi_tests_release_trybot', + 'gpu-fyi-try-linux-intel-sk-dawn-rel': 'gpu_tests_sk_dawn_release_trybot', 'gpu-fyi-try-linux-intel-skv': 'gpu_fyi_tests_release_trybot', 'gpu-fyi-try-linux-nvidia-dbg': 'gpu_fyi_tests_debug_trybot', - 'gpu-fyi-try-linux-nvidia-dqp': 'deqp_release_trybot', + 'gpu-fyi-try-linux-nvidia-dqp': 'angle_deqp_release_trybot', 'gpu-fyi-try-linux-nvidia-exp': 'gpu_fyi_tests_release_trybot', 'gpu-fyi-try-linux-nvidia-rel': 'gpu_fyi_tests_release_trybot', 'gpu-fyi-try-linux-nvidia-skv': 'gpu_fyi_tests_release_trybot', 'gpu-fyi-try-linux-nvidia-tsn': 'gpu_fyi_tests_release_trybot_tsan', - 'gpu-fyi-try-mac-amd-dqp': 'deqp_release_trybot', + 'gpu-fyi-try-mac-amd-dqp': 'angle_deqp_release_trybot', 'gpu-fyi-try-mac-amd-pro-rel': 'gpu_fyi_tests_release_trybot', 'gpu-fyi-try-mac-amd-retina-dbg': 'gpu_fyi_tests_debug_trybot', 'gpu-fyi-try-mac-amd-retina-exp': 'gpu_fyi_tests_release_trybot', 'gpu-fyi-try-mac-amd-retina-rel': 'gpu_fyi_tests_release_trybot', 'gpu-fyi-try-mac-asan': 'gpu_fyi_tests_release_trybot_asan', 'gpu-fyi-try-mac-intel-dbg': 'gpu_fyi_tests_debug_trybot', - 'gpu-fyi-try-mac-intel-dqp': 'deqp_release_trybot', + 'gpu-fyi-try-mac-intel-dqp': 'angle_deqp_release_trybot', 'gpu-fyi-try-mac-intel-exp': 'gpu_fyi_tests_release_trybot', 'gpu-fyi-try-mac-intel-rel': 'gpu_fyi_tests_release_trybot', 'gpu-fyi-try-mac-nvidia-retina-dbg': 'gpu_fyi_tests_debug_trybot', 'gpu-fyi-try-mac-nvidia-retina-exp': 'gpu_fyi_tests_release_trybot', 'gpu-fyi-try-mac-nvidia-retina-rel': 'gpu_fyi_tests_release_trybot', - 'gpu-fyi-try-win10-intel-dqp-64': 'deqp_release_trybot', + 'gpu-fyi-try-win10-intel-dqp-64': 'angle_deqp_release_trybot', 'gpu-fyi-try-win10-intel-exp-64': 'gpu_fyi_tests_release_trybot', 'gpu-fyi-try-win10-intel-rel-64': 'gpu_fyi_tests_release_trybot', 'gpu-fyi-try-win10-nvidia-dbg-64': 'gpu_fyi_tests_debug_trybot', - 'gpu-fyi-try-win10-nvidia-dqp-64': 'deqp_release_trybot', + 'gpu-fyi-try-win10-nvidia-dqp-64': 'angle_deqp_release_trybot', 'gpu-fyi-try-win10-nvidia-dx12vk-dbg-64': 'gpu_fyi_tests_dx12vk_debug_trybot', 'gpu-fyi-try-win10-nvidia-dx12vk-rel-64': 'gpu_fyi_tests_dx12vk_release_trybot', 'gpu-fyi-try-win10-nvidia-exp-64': 'gpu_fyi_tests_release_trybot', @@ -1338,9 +2084,9 @@ 'gpu-fyi-try-win10-nvidia-sk-dawn-rel-64': 'gpu_tests_sk_dawn_release_trybot', 'gpu-fyi-try-win10-nvidia-skgl-64': 'gpu_fyi_tests_release_trybot', 'gpu-fyi-try-win7-amd-dbg-32': 'gpu_fyi_tests_debug_trybot_x86', - 'gpu-fyi-try-win7-amd-dqp-32': 'deqp_release_trybot_x86', + 'gpu-fyi-try-win7-amd-dqp-32': 'angle_deqp_release_trybot_x86', 'gpu-fyi-try-win7-amd-rel-32': 'gpu_fyi_tests_release_trybot_x86', - 'gpu-fyi-try-win7-nvidia-dqp-64': 'deqp_release_trybot', + 'gpu-fyi-try-win7-nvidia-dqp-64': 'angle_deqp_release_trybot', 'gpu-fyi-try-win7-nvidia-rel-32': 'gpu_fyi_tests_release_trybot_x86', 'gpu-fyi-try-win7-nvidia-rel-64': 'gpu_fyi_tests_release_trybot', 'gpu-try-android-m-nexus-5x-64': 'gpu_tests_android_release_trybot_arm64', @@ -1348,11 +2094,11 @@ 'gpu-try-linux-nvidia-rel': 'gpu_tests_release_trybot', 'gpu-try-mac-amd-retina-dbg': 'gpu_tests_debug_bot', 'gpu-try-mac-intel-dbg': 'gpu_tests_debug_bot', - 'ios-device': 'ios_error', + 'ios-device': 'ios_device_release_rbe_compile_only', 'ios-simulator': 'ios_error', 'ios-simulator-code-coverage': 'clang_code_coverage_ios', 'ios-simulator-cr-recipe': 'ios_simulator_debug_static_bot', - 'ios-simulator-cronet': 'ios_error', + 'ios-simulator-cronet': 'ios_cronet', 'ios-simulator-full-configs': 'ios_error', 'layout_test_leak_detection': 'release_trybot', 'leak_detection_linux': 'release_trybot', @@ -1377,19 +2123,19 @@ 'linux-ozone-rel': 'ozone_linux_release_trybot', 'linux-ozone-x11-and-wayland-rel': 'ozone_linux_release_trybot', 'linux-rel': 'gpu_tests_release_trybot_no_symbols_use_dummy_lastchange_code_coverage', - 'linux-swangle-try-tot-angle-x64': 'deqp_release_trybot', - 'linux-swangle-try-tot-angle-x86': 'deqp_release_trybot_x86', - 'linux-swangle-try-tot-swiftshader-x64': 'deqp_release_trybot', - 'linux-swangle-try-tot-swiftshader-x86': 'deqp_release_trybot_x86', - 'linux-swangle-try-x64': 'deqp_release_trybot', - 'linux-swangle-try-x86': 'deqp_release_trybot_x86', + 'linux-swangle-try-tot-angle-x64': 'angle_deqp_release_trybot', + 'linux-swangle-try-tot-angle-x86': 'angle_deqp_release_trybot_x86', + 'linux-swangle-try-tot-swiftshader-x64': 'angle_deqp_release_trybot', + 'linux-swangle-try-tot-swiftshader-x86': 'angle_deqp_release_trybot_x86', + 'linux-swangle-try-x64': 'angle_deqp_release_trybot', + 'linux-swangle-try-x86': 'angle_deqp_release_trybot_x86', 'linux-trusty-rel': 'gpu_tests_release_trybot_no_symbols_use_dummy_lastchange', 'linux-viz-rel': 'release_trybot', 'linux-webkit-msan-rel': 'msan_release_bot', 'linux-wpt-fyi-rel': 'release_trybot', 'linux_android_dbg_ng': 'android_debug_bot', - 'linux_angle_deqp_rel_ng': 'deqp_release_trybot', - 'linux_angle_ozone_rel_ng': 'gpu_fyi_tests_ozone_linux_system_gbm_libdrm_release_trybot', + 'linux_angle_deqp_rel_ng': 'angle_deqp_release_trybot', + 'linux_angle_ozone_rel_ng': 'angle_ozone_linux_system_gbm_libdrm_release_trybot', 'linux_arm': 'release_trybot_arm', 'linux_chromium_archive_rel_ng': 'release_bot', 'linux_chromium_asan_rel_ng': 'asan_lsan_release_trybot', @@ -1413,6 +2159,7 @@ 'linux_upload_clang': 'release_bot', 'linux_vr': 'vr_release_trybot', 'mac-angle-rel': 'gpu_fyi_tests_release_trybot', + 'mac-coverage-rel': 'gpu_tests_release_trybot_deterministic_mac_code_coverage', 'mac-dawn-rel': 'dawn_tests_release_trybot', 'mac-osxbeta-rel': 'gpu_tests_release_trybot_deterministic_mac', 'mac-rel': 'gpu_tests_release_trybot_deterministic_mac', @@ -1436,8 +2183,8 @@ 'mac_optional_gpu_tests_rel': 'gpu_fyi_tests_release_trybot', 'mac_upload_clang': 'release_bot', 'try-nougat-phone-tester': 'android_debug_trybot_arm64', - 'win-angle-deqp-rel-32': 'deqp_release_trybot_x86', - 'win-angle-deqp-rel-64': 'deqp_release_trybot', + 'win-angle-deqp-rel-32': 'angle_deqp_release_trybot_x86', + 'win-angle-deqp-rel-64': 'angle_deqp_release_trybot', 'win-angle-rel-32': 'gpu_fyi_tests_release_trybot_x86', 'win-angle-rel-64': 'gpu_fyi_tests_release_trybot', 'win-annotator-rel': 'release_trybot', @@ -1445,15 +2192,16 @@ 'win-celab-try-rel': 'release_bot_minimal_symbols', 'win-dawn-rel': 'dawn_tests_release_trybot', 'win-libfuzzer-asan-rel': 'libfuzzer_windows_asan_release_trybot', - 'win-swangle-try-tot-angle-x64': 'deqp_release_trybot', - 'win-swangle-try-tot-angle-x86': 'deqp_release_trybot_x86', - 'win-swangle-try-tot-swiftshader-x64': 'deqp_release_trybot', - 'win-swangle-try-tot-swiftshader-x86': 'deqp_release_trybot_x86', - 'win-swangle-try-x64': 'deqp_release_trybot', - 'win-swangle-try-x86': 'deqp_release_trybot_x86', + 'win-swangle-try-tot-angle-x64': 'angle_deqp_release_trybot', + 'win-swangle-try-tot-angle-x86': 'angle_deqp_release_trybot_x86', + 'win-swangle-try-tot-swiftshader-x64': 'angle_deqp_release_trybot', + 'win-swangle-try-tot-swiftshader-x86': 'angle_deqp_release_trybot_x86', + 'win-swangle-try-x64': 'angle_deqp_release_trybot', + 'win-swangle-try-x86': 'angle_deqp_release_trybot_x86', 'win10-blink-rel': 'release_bot_x86_minimal_symbols', + 'win10_chromium_x64_coverage_rel_ng': 'gpu_tests_release_trybot_resource_whitelisting_code_coverage', 'win10_chromium_x64_dbg_ng': 'gpu_tests_debug_bot', - 'win10_chromium_x64_rel_ng': 'gpu_tests_release_trybot_resource_whitelisting', + 'win10_chromium_x64_rel_ng': 'gpu_tests_release_trybot_resource_whitelisting_code_coverage', 'win10_chromium_x64_rel_ng_exp': 'release_trybot', 'win7-blink-rel': 'release_bot_x86_minimal_symbols', 'win7-rel': 'gpu_tests_release_trybot_x86_resource_whitelisting', @@ -1481,6 +2229,90 @@ 'WebRTC Chromium FYI Win Builder (dbg)': 'debug_bot_x86_no_com_init_hooks_with_codecs' }, + 'try-m80': { + 'android-kitkat-arm-rel': 'android_release_trybot_fastbuild', + 'android-marshmallow-arm64-rel': 'gpu_tests_android_release_trybot_arm64_resource_whitelisting_fastbuild_java_coverage', + 'chromeos-amd64-generic-rel': 'chromeos_amd64-generic', + 'chromium_presubmit': 'presubmit', + 'ios-simulator': 'ios_error', + 'linux-chromeos-rel': 'chromeos_with_codecs_release_trybot_code_coverage', + 'linux-rel': 'gpu_tests_release_trybot_no_symbols_use_dummy_lastchange_code_coverage', + 'mac-rel': 'gpu_tests_release_trybot_deterministic_mac', + 'win10_chromium_x64_rel_ng': 'gpu_tests_release_trybot_resource_whitelisting_code_coverage', + 'android-binary-size': 'android_binary_size', + 'android_compile_dbg': 'android_debug_trybot_compile_only', + 'android_cronet': 'android_cronet_release_trybot_arm_no_neon', + 'cast_shell_android': 'android_cast_debug_static_bot_compile_only', + 'cast_shell_linux': 'cast_release_trybot', + 'chromeos-arm-generic-rel': 'chromeos_arm-generic_dcheck_always_on', + 'fuchsia_arm64': 'release_trybot_fuchsia_arm64', + 'fuchsia_x64': 'release_trybot_fuchsia', + 'linux-chromeos-compile-dbg': 'chromeos_with_codecs_debug_bot', + 'linux-libfuzzer-asan-rel': 'libfuzzer_asan_release_trybot', + 'linux-ozone-rel': 'ozone_linux_release_trybot', + 'linux_chromium_asan_rel_ng': 'asan_lsan_release_trybot', + 'linux_chromium_compile_dbg_ng': 'debug_bot', + 'linux_chromium_tsan_rel_ng': 'tsan_disable_nacl_release_trybot', + 'mac_chromium_compile_dbg_ng': 'gpu_tests_debug_bot', + 'win-libfuzzer-asan-rel': 'libfuzzer_windows_asan_release_trybot', + 'win_chromium_compile_dbg_ng': 'gpu_tests_debug_trybot_x86_compile_only', + 'WebRTC Chromium Android Builder': 'android_debug_static_bot_arm64', + 'WebRTC Chromium Linux Builder': 'gpu_tests_release_bot', + 'WebRTC Chromium Mac Builder': 'gpu_tests_release_bot', + 'WebRTC Chromium Win Builder': 'release_bot_x86_minimal_symbols_no_com_init_hooks_with_codecs', + 'WebRTC Chromium FYI Android Builder': 'android_release_bot_minimal_symbols', + 'WebRTC Chromium FYI Android Builder (dbg)': 'android_debug_static_bot', + 'WebRTC Chromium FYI Android Builder ARM64 (dbg)': 'android_debug_static_bot_arm64', + 'WebRTC Chromium FYI Linux Builder': 'gpu_tests_release_bot', + 'WebRTC Chromium FYI Linux Builder (dbg)': 'debug_bot', + 'WebRTC Chromium FYI Mac Builder': 'gpu_tests_release_bot', + 'WebRTC Chromium FYI Mac Builder (dbg)': 'debug_bot', + 'WebRTC Chromium FYI Win Builder': 'release_bot_x86_minimal_symbols_no_com_init_hooks_with_codecs', + 'WebRTC Chromium FYI Win Builder (dbg)': 'debug_bot_x86_no_com_init_hooks_with_codecs' + }, + + 'try-m81': { + 'android-binary-size': 'android_binary_size', + 'android-kitkat-arm-rel': 'android_release_trybot_fastbuild', + 'android-marshmallow-arm64-rel': 'gpu_tests_android_release_trybot_arm64_resource_whitelisting_fastbuild_java_coverage', + 'android_compile_dbg': 'android_debug_trybot_compile_only', + 'android_cronet': 'android_cronet_release_trybot_arm_no_neon', + 'cast_shell_android': 'android_cast_debug_static_bot_compile_only', + 'cast_shell_linux': 'cast_release_trybot', + 'chromeos-amd64-generic-rel': 'chromeos_amd64-generic', + 'chromeos-arm-generic-rel': 'chromeos_arm-generic_dcheck_always_on', + 'chromium_presubmit': 'presubmit', + 'fuchsia_arm64': 'release_trybot_fuchsia_arm64', + 'fuchsia_x64': 'release_trybot_fuchsia', + 'ios-simulator': 'ios_error', + 'linux-chromeos-compile-dbg': 'chromeos_with_codecs_debug_bot', + 'linux-chromeos-rel': 'chromeos_with_codecs_release_trybot_code_coverage', + 'linux-libfuzzer-asan-rel': 'libfuzzer_asan_release_trybot', + 'linux-ozone-rel': 'ozone_linux_release_trybot', + 'linux-rel': 'gpu_tests_release_trybot_no_symbols_use_dummy_lastchange_code_coverage', + 'linux_chromium_asan_rel_ng': 'asan_lsan_release_trybot', + 'linux_chromium_compile_dbg_ng': 'debug_bot', + 'linux_chromium_tsan_rel_ng': 'tsan_disable_nacl_release_trybot', + 'mac-rel': 'gpu_tests_release_trybot_deterministic_mac', + 'mac_chromium_compile_dbg_ng': 'gpu_tests_debug_bot', + 'win-libfuzzer-asan-rel': 'libfuzzer_windows_asan_release_trybot', + 'win10_chromium_x64_rel_ng': 'gpu_tests_release_trybot_resource_whitelisting_code_coverage', + 'win_chromium_compile_dbg_ng': 'gpu_tests_debug_trybot_x86_compile_only', + 'WebRTC Chromium Android Builder': 'android_debug_static_bot_arm64', + 'WebRTC Chromium Linux Builder': 'gpu_tests_release_bot', + 'WebRTC Chromium Mac Builder': 'gpu_tests_release_bot', + 'WebRTC Chromium Win Builder': 'release_bot_x86_minimal_symbols_no_com_init_hooks_with_codecs', + 'WebRTC Chromium FYI Android Builder': 'android_release_bot_minimal_symbols', + 'WebRTC Chromium FYI Android Builder (dbg)': 'android_debug_static_bot', + 'WebRTC Chromium FYI Android Builder ARM64 (dbg)': 'android_debug_static_bot_arm64', + 'WebRTC Chromium FYI Linux Builder': 'gpu_tests_release_bot', + 'WebRTC Chromium FYI Linux Builder (dbg)': 'debug_bot', + 'WebRTC Chromium FYI Mac Builder': 'gpu_tests_release_bot', + 'WebRTC Chromium FYI Mac Builder (dbg)': 'debug_bot', + 'WebRTC Chromium FYI Win Builder': 'release_bot_x86_minimal_symbols_no_com_init_hooks_with_codecs', + 'WebRTC Chromium FYI Win Builder (dbg)': 'debug_bot_x86_no_com_init_hooks_with_codecs' + }, + 'webrtc': { 'WebRTC Chromium Android Builder': 'android_debug_static_bot_arm64', 'WebRTC Chromium Linux Builder': 'gpu_tests_release_bot', @@ -1507,8 +2339,7 @@ 'WebRTC Chromium FYI Mac Builder (dbg)': 'debug_bot', 'WebRTC Chromium FYI Win Builder': 'release_bot_x86_minimal_symbols_no_com_init_hooks_with_codecs', 'WebRTC Chromium FYI Win Builder (dbg)': 'debug_bot_x86_no_com_init_hooks_with_codecs' - }, - + } }, 'public_artifact_builders': { @@ -1631,13 +2462,14 @@ 'strip_debug_info', 'clang_tot' ], - 'android_clang_tot_release_minimal_symbols_official_optimize': [ + 'android_clang_tot_official_arm64': [ 'android', 'release', 'static', 'minimal_symbols', 'official_optimize', - 'clang_tot' + 'clang_tot', + 'arm64' ], 'android_clang_tot_x64': [ 'android_without_codecs', @@ -1649,26 +2481,26 @@ ], 'android_cronet_debug_static_bot_arm64': [ 'android', - 'cronet', + 'cronet_android', 'debug_static_bot', 'arm64' ], 'android_cronet_debug_static_bot_arm_no_neon': [ 'android', - 'cronet', + 'cronet_android', 'debug_static_bot', 'arm_no_neon', 'release_java' ], 'android_cronet_debug_static_bot_x86': [ 'android', - 'cronet', + 'cronet_android', 'debug_static_bot', 'x86' ], 'android_cronet_release_bot_minimal_symbols_arm64': [ 'android', - 'cronet', + 'cronet_android', 'official_optimize', 'release_bot', 'minimal_symbols', @@ -1677,7 +2509,7 @@ ], 'android_cronet_release_bot_minimal_symbols_arm_no_neon': [ 'android', - 'cronet', + 'cronet_android', 'official_optimize', 'release_bot', 'minimal_symbols', @@ -1686,7 +2518,7 @@ ], 'android_cronet_release_bot_minimal_symbols_arm_no_neon_clang_asan': [ 'android', - 'cronet', + 'cronet_android', 'release_bot', 'minimal_symbols', 'arm_no_neon', @@ -1696,7 +2528,7 @@ ], 'android_cronet_release_bot_minimal_symbols_x86': [ 'android', - 'cronet', + 'cronet_android', 'official_optimize', 'release_bot', 'minimal_symbols', @@ -1705,7 +2537,7 @@ ], 'android_cronet_release_trybot_arm_no_neon': [ 'android', - 'cronet', + 'cronet_android', 'release_trybot', 'arm_no_neon' ], @@ -1773,6 +2605,13 @@ 'minimal_symbols', 'strip_debug_info' ], + 'android_release_bot_minimal_symbols_java_goma': [ + 'android', + 'release_bot', + 'minimal_symbols', + 'strip_debug_info', + 'use_java_goma' + ], 'android_release_bot_minimal_symbols_arm64': [ 'android', 'release_bot', @@ -1799,6 +2638,14 @@ 'arm64', 'strip_debug_info' ], + 'android_release_trybot_arm64_fastbuild_webview_google': [ + 'android', + 'release_trybot', + 'arm64', + 'strip_debug_info', + 'android_fastbuild', + 'webview_google' + ], 'android_release_trybot_arm64_webview_google': [ 'android', 'release_trybot', @@ -1806,12 +2653,21 @@ 'strip_debug_info', 'webview_google' ], + 'android_release_trybot_arm64_webview_google_native_coverage': [ + 'android', + 'release_trybot', + 'arm64', + 'strip_debug_info', + 'webview_google', + 'use_clang_coverage', + 'partial_code_coverage_instrumentation' + ], 'android_release_trybot_fastbuild': [ 'android', 'release_trybot', 'strip_debug_info', 'android_fastbuild', - 'android_no_proguard', + 'android_no_proguard' ], 'android_release_trybot_fastbuild_webview_google': [ 'android', @@ -1821,18 +2677,21 @@ 'android_no_proguard', 'webview_google' ], - 'android_release_trybot_x86': [ - 'android', - 'release_trybot', - 'strip_debug_info', - 'x86' - ], - 'android_release_trybot_x86_resource_whitelisting': [ + 'android_release_trybot_x86_fastbuild_resource_whitelisting': [ 'android', 'release_trybot', 'x86', + 'android_fastbuild', 'resource_whitelisting' ], + 'android_release_trybot_x86_fastbuild_webview_google': [ + 'android', + 'release_trybot', + 'strip_debug_info', + 'x86', + 'android_fastbuild', + 'webview_google' + ], 'android_webview_google_debug_static_bot': [ 'android', 'debug_static_bot', @@ -1859,6 +2718,40 @@ 'release_trybot', 'strip_debug_info' ], + 'angle_deqp_android_release_trybot_arm64': [ + 'angle_deqp_tests', + 'android', + 'shared_release_trybot', + 'arm64' + ], + 'angle_deqp_android_vulkan_ndk_release_trybot': [ + 'angle_deqp_tests', + 'android', + 'vulkan_ndk', + 'shared_release_trybot' + ], + 'angle_deqp_android_vulkan_ndk_release_trybot_arm64': [ + 'angle_deqp_tests', + 'android', + 'vulkan_ndk', + 'shared_release_trybot', + 'arm64' + ], + 'angle_deqp_release_trybot': [ + 'angle_deqp_tests', + 'shared_release_trybot' + ], + 'angle_deqp_release_trybot_x86': [ + 'angle_deqp_tests', + 'shared_release_trybot', + 'x86' + ], + 'angle_ozone_linux_system_gbm_libdrm_release_trybot': [ + 'angle_tests', + 'ozone_linux', + 'system_gbm_libdrm', + 'release_trybot' + ], 'asan_clang_shared_v8_heap_minimal_symbols_release_tot': [ 'asan', 'clang_tot', @@ -2022,7 +2915,8 @@ 'cfi_recover', 'thin_lto', 'release', - 'static' + 'static', + 'goma', ], 'cfi_full_cfi_icall_cfi_diag_thin_lto_release_static_dcheck_always_on_goma': [ 'cfi_full', @@ -2034,6 +2928,36 @@ 'dcheck_always_on', 'goma' ], + 'chromeos_amd64-generic': [ + 'chromeos_device', + 'amd64-generic' + ], + 'chromeos_amd64-generic_cfi_thin_lto': [ + 'chromeos_device', + 'amd64-generic', + 'cfi_full', + 'thin_lto' + ], + 'chromeos_amd64-generic_dcheck_always_on': [ + 'chromeos_device', + 'amd64-generic', + 'dcheck_always_on' + ], + 'chromeos_amd64-generic_dbg': [ + 'chromeos_device', + 'amd64-generic', + 'debug' + ], + 'chromeos_arm-generic_dcheck_always_on': [ + 'chromeos_device', + 'arm-generic', + 'dcheck_always_on' + ], + 'chromeos_arm-generic_dbg': [ + 'chromeos_device', + 'arm-generic', + 'debug' + ], 'chromeos_asan_lsan_fuzzer_v8_heap_release_bot': [ 'chromeos', 'asan', @@ -2042,6 +2966,10 @@ 'v8_heap', 'release_bot' ], + 'chromeos_kevin': [ + 'chromeos_device', + 'kevin' + ], 'chromeos_msan_release_bot': [ 'chromeos', 'msan', @@ -2082,7 +3010,8 @@ 'use_clang_coverage', 'debug_static_bot', 'x64', - 'ios' + 'ios', + 'ios_use_goma_rbe' ], 'clang_tot_asan_lsan_static_release': [ 'clang_tot', @@ -2199,22 +3128,6 @@ 'closure_compilation': [ 'error' ], - 'cros_chrome_sdk': [ - 'cros_chrome_sdk' - ], - 'cros_chrome_sdk_dbg': [ - 'cros_chrome_sdk', - 'debug' - ], - 'cros_chrome_sdk_dcheck_always_on': [ - 'cros_chrome_sdk', - 'dcheck_always_on' - ], - 'cros_chrome_sdk_cfi_thin_lto': [ - 'cros_chrome_sdk', - 'cfi_full', - 'thin_lto' - ], 'dawn_tests_release_trybot': [ 'dawn_tests', 'release_trybot' @@ -2257,52 +3170,36 @@ 'no_com_init_hooks', 'chrome_with_codecs' ], - 'deqp_android_release_trybot_arm64': [ - 'angle_deqp_tests', - 'android', - 'shared_release_trybot', - 'arm64' - ], - 'deqp_android_vulkan_ndk_release_trybot': [ - 'angle_deqp_tests', - 'android', + 'gpu_fyi_tests_android_vulkan_ndk_release_trybot': [ + 'gpu_fyi_android_tests', 'vulkan_ndk', - 'shared_release_trybot' + 'release_trybot', + 'static_angle' ], - 'deqp_android_vulkan_ndk_release_trybot_arm64': [ - 'angle_deqp_tests', - 'android', + 'gpu_fyi_tests_android_vulkan_ndk_release_trybot_arm64': [ + 'gpu_fyi_android_tests', 'vulkan_ndk', - 'shared_release_trybot', - 'arm64' - ], - 'deqp_release_trybot_x86': [ - 'angle_deqp_tests', - 'shared_release_trybot', - 'x86' - ], - 'deqp_release_trybot': [ - 'angle_deqp_tests', - 'shared_release_trybot' + 'release_trybot', + 'arm64', + 'static_angle' ], 'gpu_fyi_tests_debug_trybot': [ 'gpu_fyi_tests', 'debug_bot' ], - 'gpu_fyi_tests_dx12vk_debug_trybot': [ - 'gpu_fyi_tests', - 'dx12vk', - 'debug_bot' - ], 'gpu_fyi_tests_debug_trybot_x86': [ 'gpu_fyi_tests', 'debug_bot', 'x86' ], - 'gpu_fyi_tests_ozone_linux_system_gbm_libdrm_release_trybot': [ + 'gpu_fyi_tests_dx12vk_debug_trybot': [ 'gpu_fyi_tests', - 'ozone_linux', - 'system_gbm_libdrm', + 'dx12vk', + 'debug_bot' + ], + 'gpu_fyi_tests_dx12vk_release_trybot': [ + 'gpu_fyi_tests', + 'dx12vk', 'release_trybot' ], 'gpu_fyi_tests_release_trybot': [ @@ -2315,6 +3212,11 @@ 'asan', 'disable_nacl' ], + 'gpu_fyi_tests_release_trybot_fuchsia': [ + 'gpu_fyi_tests', + 'release_trybot', + 'fuchsia' + ], 'gpu_fyi_tests_release_trybot_tsan': [ 'gpu_fyi_tests', 'release_trybot', @@ -2326,16 +3228,6 @@ 'release_trybot', 'x86' ], - 'gpu_fyi_tests_release_trybot_fuchsia': [ - 'gpu_fyi_tests', - 'release_trybot', - 'fuchsia' - ], - 'gpu_fyi_tests_dx12vk_release_trybot': [ - 'gpu_fyi_tests', - 'dx12vk', - 'release_trybot' - ], 'gpu_tests_android_release_bot_minimal_symbols_arm64_fastbuild_java_coverage': [ 'gpu_tests', 'android', @@ -2395,21 +3287,6 @@ 'use_java_coverage', 'partial_code_coverage_instrumentation' ], - 'gpu_tests_android_vulkan_ndk_release_trybot': [ - 'gpu_tests', - 'android', - 'vulkan_ndk', - 'release_trybot', - 'static_angle' - ], - 'gpu_tests_android_vulkan_ndk_release_trybot_arm64': [ - 'gpu_tests', - 'android', - 'vulkan_ndk', - 'release_trybot', - 'arm64', - 'static_angle' - ], 'gpu_tests_debug_bot': [ 'gpu_tests', 'debug_bot' @@ -2434,7 +3311,7 @@ 'gpu_tests', 'release_bot', 'minimal_symbols', - 'disable_nacl', + 'disable_nacl' ], 'gpu_tests_release_bot_x86_minimal_symbols': [ 'gpu_tests', @@ -2451,11 +3328,25 @@ 'release_trybot', 'mac_deterministic_build' ], + 'gpu_tests_release_trybot_deterministic_mac_code_coverage': [ + 'gpu_tests', + 'release_trybot', + 'mac_deterministic_build', + 'use_clang_coverage', + 'partial_code_coverage_instrumentation' + ], 'gpu_tests_release_trybot_resource_whitelisting': [ 'gpu_tests', 'release_trybot', 'resource_whitelisting' ], + 'gpu_tests_release_trybot_resource_whitelisting_code_coverage': [ + 'gpu_tests', + 'release_trybot', + 'resource_whitelisting', + 'use_clang_coverage', + 'partial_code_coverage_instrumentation' + ], 'gpu_tests_release_trybot_no_symbols_use_dummy_lastchange': [ 'gpu_tests', 'release_trybot', @@ -2483,14 +3374,57 @@ 'gpu_tests_sk_dawn_release_trybot': [ 'gpu_tests', 'sk_dawn', - 'release_trybot', + 'release_trybot' ], 'ios_error': [ 'error' ], - 'ios_simulator_debug_static_bot': [ + 'ios_clang_tot': [ + 'clang_tot', 'ios_simulator', - 'debug_static_bot' + 'ios_disable_code_signing', + 'release', + 'static' + ], + 'ios_clang_device_tot': [ + 'clang_tot', + 'ios_device', + 'release' + ], + 'ios_cronet': [ + 'additional_target_cpus_x86', + 'cronet_ios', + 'debug_static_bot', + 'ios_deployment_target_9_0', + 'ios_simulator' + ], + 'ios_device_release_compile_only': [ + 'compile_only', + 'ios_device', + 'ios_disable_code_signing', + 'release_bot' + ], + 'ios_device_release_rbe_compile_only': [ + 'compile_only', + 'ios_device', + 'ios_disable_code_signing', + 'ios_use_goma_rbe', + 'release_bot' + ], + 'ios_device_release_static_rbe_bot': [ + 'ios_device', + 'ios_disable_code_signing', + 'ios_use_goma_rbe', + 'release_bot' + ], + 'ios_simulator_debug_static_bot': [ + 'debug_static_bot', + 'ios_simulator' + ], + 'ios_simulator_debug_static_rbe_bot': [ + 'debug_static_bot', + 'ios_simulator', + 'ios_use_goma_rbe' ], 'libfuzzer_asan_debug_bot': [ 'libfuzzer', @@ -2742,7 +3676,7 @@ 'release_bot_minimal_symbols_no_nacl': [ 'release_bot', 'minimal_symbols', - 'disable_nacl', + 'disable_nacl' ], 'release_trybot': [ 'release_trybot' @@ -2781,7 +3715,7 @@ ], 'release_trybot_no_nacl': [ 'release_trybot', - 'disable_nacl', + 'disable_nacl' ], 'release_trybot_tsan': [ 'release_trybot', @@ -2833,10 +3767,6 @@ 'release_trybot', 'ozone' ], - 'win_msvc_release_bot': [ - 'no_clang', - 'release_bot' - ], 'win32_arm64_release_bot': [ 'arm64', 'disable_nacl', @@ -2846,10 +3776,18 @@ }, 'mixins': { + 'additional_target_cpus_x86': { + 'gn_args': 'additional_target_cpus=["x86"]' + }, + 'afl': { 'gn_args': 'use_afl=true' }, + 'amd64-generic': { + 'args_file': '//build/args/chromeos/amd64-generic.gni' + }, + 'android': { 'mixins': [ 'android_without_codecs', @@ -2877,10 +3815,26 @@ 'gn_args': 'build_angle_deqp_tests=true' }, + 'angle_tests': { + 'mixins': [ + 'angle_trace_perf_tests', + 'gpu_tests', + 'internal_gles_conform_tests' + ] + }, + + 'angle_trace_perf_tests': { + 'gn_args': 'build_angle_trace_perf_tests=true' + }, + 'arm': { 'gn_args': 'target_cpu="arm"' }, + 'arm-generic': { + 'args_file': '//build/args/chromeos/arm-generic.gni' + }, + 'arm64': { 'gn_args': 'target_cpu="arm64"' }, @@ -2897,7 +3851,7 @@ }, 'autofill_assistant_api': { - 'gn_args': 'enable_autofill_assistant_api=true', + 'gn_args': 'enable_autofill_assistant_api=true' }, 'cast': { @@ -2946,7 +3900,14 @@ 'mixins': [ 'ffmpeg_branding_chromeos', 'proprietary_codecs' - ], + ] + }, + + 'chromeos_device': { + 'gn_args': 'is_chromeos_device=true ozone_platform_headless=true', + 'mixins': [ + 'goma' + ] }, 'chromeos_with_codecs': { @@ -2970,16 +3931,25 @@ 'compile_only': { 'mixins': [ 'no_symbols' + ] + }, + + 'cronet_common': { + 'gn_args': 'disable_file_support=true disable_ftp_support=true enable_websockets=false include_transport_security_state_preload_list=false use_crash_key_stubs=true use_platform_icu_alternatives=true' + }, + + 'cronet_android': { + 'mixins': [ + 'cronet_common' ], + 'gn_args': 'use_partition_alloc=false enable_reporting=true use_hashed_jni_names=true clang_use_default_sample_profile=false enable_resource_whitelist_generation=false' }, - 'cronet': { - 'gn_args': 'disable_file_support=true disable_ftp_support=true enable_websockets=false use_platform_icu_alternatives=true use_partition_alloc=false enable_reporting=true include_transport_security_state_preload_list=false use_crash_key_stubs=true use_hashed_jni_names=true clang_use_default_sample_profile=false enable_resource_whitelist_generation=false' - }, - - 'cros_chrome_sdk': { - 'cros_passthrough': True, - 'gn_args': 'ozone_platform_headless=true' + 'cronet_ios': { + 'mixins': [ + 'cronet_common' + ], + 'gn_args': 'disable_brotli_filter=false is_cronet_build=true' }, 'dawn_tests': { @@ -3086,8 +4056,17 @@ 'gn_args': 'use_goma=true' }, + 'gpu_fyi_android_tests': { + 'mixins': [ + 'android', + 'angle_trace_perf_tests', + 'gpu_tests' + ] + }, + 'gpu_fyi_tests': { 'mixins': [ + 'angle_trace_perf_tests', 'gpu_tests', 'internal_gles_conform_tests' ], @@ -3118,6 +4097,21 @@ 'gn_args': 'target_os="ios"' }, + 'ios_deployment_target_9_0': { + 'gn_args': 'ios_deployment_target="9.0"' + }, + + 'ios_device': { + 'mixins': [ + 'ios' + ], + 'gn_args': 'target_cpu="arm64"' + }, + + 'ios_disable_code_signing': { + 'gn_args': 'ios_enable_code_signing=false' + }, + 'ios_simulator': { 'mixins': [ 'ios' @@ -3125,6 +4119,14 @@ 'gn_args': 'target_cpu="x64"' }, + 'ios_use_goma_rbe': { + 'gn_args': 'ios_use_goma_rbe=true' + }, + + 'kevin': { + 'args_file': '//build/args/chromeos/kevin.gni' + }, + 'libfuzzer': { 'gn_args': 'use_libfuzzer=true' }, @@ -3182,7 +4184,7 @@ }, 'ozone_linux': { - 'gn_args': 'use_ozone=true ozone_platform="headless"' + 'gn_args': 'use_ozone=true ozone_platform="headless" use_bundled_weston=true' }, 'partial_code_coverage_instrumentation': { @@ -3246,7 +4248,7 @@ }, 'sk_dawn': { - 'gn_args': 'skia_uses_dawn=true', + 'gn_args': 'skia_use_dawn=true' }, 'stable_channel': { @@ -3312,6 +4314,10 @@ 'gn_args': 'use_jacoco_coverage=true' }, + 'use_java_goma': { + 'gn_args': 'use_java_goma=true' + }, + 'v8_simulate_arm': { 'gn_args': 'target_cpu="x86" v8_target_cpu="arm"' },
diff --git a/tools/mb/mb_unittest.py b/tools/mb/mb_unittest.py index 39f507ed..41094364 100755 --- a/tools/mb/mb_unittest.py +++ b/tools/mb/mb_unittest.py
@@ -236,6 +236,58 @@ } """ +# Same as previous config but with fake_debug_builder +# and fake_simplechrome_builder configs swapped +TEST_CONFIG_BUCKET_2 = """\ +{ + 'public_artifact_builders': {}, + 'buckets': { + 'ci': { + 'fake_builder': 'rel_bot', + 'fake_debug_builder': 'cros_chrome_sdk', + 'fake_simplechrome_builder': 'debug_goma', + 'fake_args_bot': '//build/args/bots/fake_master/fake_args_bot.gn', + 'fake_multi_phase': { 'phase_1': 'phase_1', 'phase_2': 'phase_2'}, + 'fake_args_file': 'args_file_goma', + } + }, + 'configs': { + 'args_file_goma': ['args_file', 'goma'], + 'cros_chrome_sdk': ['cros_chrome_sdk'], + 'rel_bot': ['rel', 'goma', 'fake_feature1'], + 'debug_goma': ['debug', 'goma'], + 'phase_1': ['phase_1'], + 'phase_2': ['phase_2'], + }, + 'mixins': { + 'cros_chrome_sdk': { + 'cros_passthrough': True, + }, + 'fake_feature1': { + 'gn_args': 'enable_doom_melon=true', + }, + 'goma': { + 'gn_args': 'use_goma=true', + }, + 'args_file': { + 'args_file': '//build/args/fake.gn', + }, + 'phase_1': { + 'gn_args': 'phase=1', + }, + 'phase_2': { + 'gn_args': 'phase=2', + }, + 'rel': { + 'gn_args': 'is_debug=false', + }, + 'debug': { + 'gn_args': 'is_debug=true', + }, + }, +} +""" + TEST_BAD_CONFIG = """\ { 'configs': { @@ -956,6 +1008,12 @@ mbw = self.fake_mbw() self.check(['validate'], mbw=mbw, ret=0) + def test_validate_inconsistent(self): + mbw = self.fake_mbw() + mbw.files[mbw.default_config_bucket] = TEST_CONFIG_BUCKET_2 + self.check(['validate'], mbw=mbw, ret=1) + self.assertIn('mb_config_buckets.pyl doesn\'t match', mbw.out) + def test_bad_validate(self): mbw = self.fake_mbw() mbw.files[mbw.default_config_master] = TEST_BAD_CONFIG
diff --git a/tools/metrics/actions/actions.xml b/tools/metrics/actions/actions.xml index f068967..edc8476 100644 --- a/tools/metrics/actions/actions.xml +++ b/tools/metrics/actions/actions.xml
@@ -24634,6 +24634,18 @@ </description> </action> +<action name="XR.ARCoreDeviceProviderFactory.NotInstalled" + not_user_triggered="true"> + <owner>bialpio@chromium.org</owner> + <description> + Raised when XR service was unable to obtain necessary component. The action + is not directly raised by the user's behavior as it should only be logged + when the user navigates to a website that uses WebXR Device API, only in + case the necessary provider was not installed during browser start-up. + Created to assess the impact of the issue causing https://crbug.com/1050470. + </description> +</action> + <action name="ZoomMinus"> <owner>Please list the metric's owners. Add more owner tags as needed.</owner> <description>Please enter the description of this user action.</description>
diff --git a/tools/metrics/histograms/enums.xml b/tools/metrics/histograms/enums.xml index 8480ab7a..c4d1c4f 100644 --- a/tools/metrics/histograms/enums.xml +++ b/tools/metrics/histograms/enums.xml
@@ -10983,6 +10983,8 @@ <int value="3" label="Out of Date"/> <int value="4" label="Search by Image Unavailable"/> <int value="5" label="OS Below Android O"/> + <int value="6" label="Invalid Package"/> + <int value="7" label="Image Format Not Support"/> </enum> <enum name="ContextMenuOption"> @@ -42791,6 +42793,8 @@ <int value="8" label="Bad tv episode"/> <int value="9" label="Bad play next candidate"/> <int value="10" label="Bad images"/> + <int value="11" label="Bad safe search result"/> + <int value="12" label="Bad genres"/> </enum> <enum name="MediaFeedReadResult"> @@ -47034,6 +47038,13 @@ <int value="10" label="kVia"/> </enum> +<enum name="NetworkServiceCorpResult"> + <int value="0" label="success"/> + <int value="1" label="same-origin violation"/> + <int value="2" label="same-origin violation with COEP involvement"/> + <int value="3" label="same-site violation"/> +</enum> + <enum name="NetworkServiceError"> <int value="0" label="UNKNOWN"/> <int value="1" label="AAA_FAILED"/> @@ -48709,6 +48720,14 @@ <int value="2" label="NTP omnibox tapped."/> <int value="3" label="NTP omnibox long-pressed (from paste action)."/> <int value="4" label="Accelerator tapped."/> + <int value="5" label="Tab switcher omnibox tapped (obsolete)."/> + <int value="6" label="Tasks surface fake box tapped."/> + <int value="7" label="Tasks surface fake box long pressed."/> + <int value="8" label="Default with hardware keyboard."/> + <int value="9" label="Search query."/> + <int value="10" label="Launched new incognito tab."/> + <int value="11" label="Menu or keyboard action."/> + <int value="12" label="Unfocus."/> </enum> <enum name="OmniboxInputType"> @@ -50070,6 +50089,9 @@ <int value="6" label="Opened automatically / Auto-signin toast"/> <int value="7" label="Opened manually / Offering a password to update"/> <int value="8" label="Opened automatically / Offering a password to update"/> + <int value="9" + label="Opened automatically / Offering to save unsynced passwords + locally"/> </enum> <enum name="PasswordBubbleSignInPromoDismissalReason"> @@ -53956,6 +53978,19 @@ <int value="4" label="Auto-created after deleting last user"/> </enum> +<enum name="ProfileAllAccountsCategories"> + <int value="0" label="Either consumer or enterprise, not both"/> + <int value="1" label="Both consumer and enterprise (no sync)"/> + <int value="2" label="Both consumer and enterprise (consumer syncing)"/> + <int value="3" label="Both consumer and enterprise (enterprise syncing)"/> +</enum> + +<enum name="ProfileAllAccountsNames"> + <int value="0" label="At most one name (or a rare hash collision)"/> + <int value="1" label="Multiple names (no sync)"/> + <int value="2" label="Multiple names (sync enabled for one of them)"/> +</enum> + <enum name="ProfileAndroidAccountManagementMenu"> <int value="0" label="Opened Menu"> User arrived at the Account management screen.
diff --git a/tools/metrics/histograms/histograms.xml b/tools/metrics/histograms/histograms.xml index 51dbcb9..bb9b952 100644 --- a/tools/metrics/histograms/histograms.xml +++ b/tools/metrics/histograms/histograms.xml
@@ -9015,6 +9015,16 @@ </summary> </histogram> +<histogram name="Ash.Login.Login.MigrationBanner" enum="BooleanShown" + expires_after="M86"> + <owner>rsorokin@chromium.org</owner> + <owner>cros-oac@google.com</owner> + <summary> + Whether the cryptohome migration banner was shown on the Chrome OS login + screen. + </summary> +</histogram> + <histogram name="Ash.Login.Login.UserClicks" enum="LoginScreenUserClickTarget" expires_after="2020-09-01"> <owner>rsorokin@chromium.org</owner> @@ -45148,9 +45158,9 @@ </summary> </histogram> -<histogram name="Enterprise.HeartbeatSignal" enum="BooleanSuccess" - expires_after="2020-04-01"> - <owner>ayaelattar@chromium.org</owner> +<histogram name="Enterprise.HeartbeatSignalSuccess" enum="BooleanSuccess" + expires_after="2020-08-01"> + <owner>igorcov@chromium.org</owner> <owner>poromov@chromium.org</owner> <summary> Result of a single attempt to signal a device heartbeat, which is used for @@ -68114,6 +68124,17 @@ </summary> </histogram> +<histogram name="Kerberos.EncryptionTypesAcquireKerberosTgt" + enum="KerberosEncryptionTypes" expires_after="M86"> + <owner>fsandrade@chromium.org</owner> + <owner>tomdobro@chromium.org</owner> + <summary> + The Kerberos encryption types used while succesfully creating or refreshing + a Kerberos TGT. This value is derived from the Kerberos configuration + 'enctypes' fields. + </summary> +</histogram> + <histogram name="Kerberos.NumberOfAccounts.Managed" units="units" expires_after="2020-10-30"> <owner>fsandrade@chromium.org</owner> @@ -71141,6 +71162,10 @@ <histogram name="Media.Audio.Render.AudioInputsPerMixer.LatencyExact" units="inputs" expires_after="M85"> + <obsolete> + Removed on April 2020. + </obsolete> + <owner>guidou@chromium.org</owner> <owner>olka@chromium.org</owner> <summary> Number of simultaneous inputs coming to the AudioRendererMixer which renders @@ -71229,8 +71254,9 @@ </histogram> <histogram name="Media.Audio.Render.FramesRequested" units="frames" - expires_after="2020-04-05"> - <owner>tommi@chromium.org</owner> + expires_after="2021-04-05"> + <owner>guidou@chromium.org</owner> + <owner>olka@chromium.org</owner> <summary> The number of frames audio is actually rendered at if the number is different from the desired number of frames. If the desired frame size is @@ -71277,8 +71303,9 @@ </histogram> <histogram name="Media.Audio.Render.Glitches" units="glitches" - expires_after="2020-04-05"> - <owner>tommi@chromium.org</owner> + expires_after="2021-04-05"> + <owner>guidou@chromium.org</owner> + <owner>olka@chromium.org</owner> <summary> The number of glitches that were detected at the OS level while an audio stream was active. A glitch is detected if the OS has to skip rendering a @@ -71310,8 +71337,9 @@ </histogram> <histogram name="Media.Audio.Render.LargestGlitchMs" units="ms" - expires_after="2020-04-05"> - <owner>tommi@chromium.org</owner> + expires_after="2021-04-05"> + <owner>guidou@chromium.org</owner> + <owner>olka@chromium.org</owner> <summary> The length in milliseconds of the largest glitch that was detected at the OS level. This value is logged when an audio output stream that has suffered @@ -71320,8 +71348,9 @@ </histogram> <histogram name="Media.Audio.Render.LostFramesInMs" units="ms" - expires_after="2020-04-05"> - <owner>tommi@chromium.org</owner> + expires_after="2021-04-05"> + <owner>guidou@chromium.org</owner> + <owner>olka@chromium.org</owner> <summary> The combined length in milliseconds of audio glitches. This is useful to know in particular for audio processing such as echo cancellation. This @@ -71345,7 +71374,8 @@ </histogram> <histogram name="Media.Audio.Render.OutputDeviceAuthorizationTimedOut" - enum="BooleanTimedOut" expires_after="2020-04-05"> + enum="BooleanTimedOut" expires_after="2021-04-05"> + <owner>guidou@chromium.org</owner> <owner>olka@chromium.org</owner> <summary> Whether audio output device timed out waiting for authorization reply from @@ -71399,7 +71429,8 @@ <histogram name="Media.Audio.Render.SinkCache.GetOutputDeviceInfoCacheUtilization" - enum="GetOutputDeviceInfoCacheHit" expires_after="2020-04-05"> + enum="GetOutputDeviceInfoCacheHit" expires_after="2021-04-05"> + <owner>guidou@chromium.org</owner> <owner>olka@chromium.org</owner> <summary> Whether a cached sink was used to get audio output device information, or a @@ -71408,7 +71439,8 @@ </histogram> <histogram name="Media.Audio.Render.SinkCache.InfoSinkReusedForOutput" - enum="BooleanReused" expires_after="M85"> + enum="BooleanReused" expires_after="2021-04-05"> + <owner>guidou@chromium.org</owner> <owner>olka@chromium.org</owner> <summary> When a new sink is created to get output device information, it is cached. @@ -71419,7 +71451,8 @@ </histogram> <histogram name="Media.Audio.Render.SinkCache.UsedForSinkCreation" - enum="BooleanUsage" expires_after="2020-04-05"> + enum="BooleanUsage" expires_after="2021-04-05"> + <owner>guidou@chromium.org</owner> <owner>olka@chromium.org</owner> <summary> Whether a sink was created through the sink cache or directly. @@ -100093,6 +100126,25 @@ </summary> </histogram> +<histogram name="NetworkService.CrossOriginResourcePolicy.ReportOnlyResult" + enum="NetworkServiceCorpResult" expires_after="2020-09-30"> + <owner>mkwst@chromium.org</owner> + <owner>yhirano@chromium.org</owner> + <summary> + Records the result of the Cross-Origin Resource Policy check, with + cross-origin-embedder-policy-report-only involvement. + </summary> +</histogram> + +<histogram name="NetworkService.CrossOriginResourcePolicy.Result" + enum="NetworkServiceCorpResult" expires_after="2020-09-30"> + <owner>mkwst@chromium.org</owner> + <owner>yhirano@chromium.org</owner> + <summary> + Records the result of the Cross-Origin Resource Policy check. + </summary> +</histogram> + <histogram name="NetworkService.MdnsResponder.ServiceError" enum="MdnsResponderServiceError" expires_after="M81"> <owner>qingsi@chromium.org</owner> @@ -101867,6 +101919,9 @@ <histogram name="NewTabPage.RecentTabsPage.TimeVisibleAndroid" units="ms" expires_after="M82"> + <obsolete> + Removed March 2020. + </obsolete> <owner>pkotwicz@chromium.org</owner> <owner>treib@chromium.org</owner> <summary> @@ -112173,7 +112228,7 @@ </histogram> <histogram name="PageLoad.Experimental.Bytes.Unfinished" units="KB" - expires_after="2020-04-05"> + expires_after="2021-04-05"> <owner>johnidel@chromium.org</owner> <owner>jkarlin@chromium.org</owner> <summary> @@ -116043,7 +116098,7 @@ </histogram> <histogram name="PasswordManager.HttpPasswordMigrationCount" - units="saved credentials" expires_after="M82"> + units="saved credentials" expires_after="M87"> <owner>vasilii@chromium.org</owner> <owner>jdoerrie@chromium.org</owner> <summary> @@ -116053,7 +116108,7 @@ </histogram> <histogram name="PasswordManager.HttpPasswordMigrationMode" - enum="HttpPasswordMigrationMode" expires_after="M82"> + enum="HttpPasswordMigrationMode" expires_after="M87"> <owner>jdoerrie@chromium.org</owner> <owner>vasilii@chromium.org</owner> <summary> @@ -128332,6 +128387,9 @@ </histogram> <histogram name="ProductTour.IOSScreens" units="ms" expires_after="M85"> + <obsolete> + Removed 04/2020. See crrev.com/c/2129507 + </obsolete> <!-- Name completed by histogram_suffixes name="IOSProductTourScreens" --> <owner>mrefaat@google.com</owner> @@ -128344,6 +128402,36 @@ <summary>The frequency of ways that new user profiles are added.</summary> </histogram> +<histogram name="Profile.AllAccounts.Categories" + enum="ProfileAllAccountsCategories" expires_after="2021-03-11"> + <owner>jkrcal@chromium.org</owner> + <owner>droger@chromium.org</owner> + <summary> + Classification of what account categories out of {consumer, enterprise} + appear or appeared in this profile since the last time gaia cookies got + deleted. Thus, this also includes signed-out accounts. If both categories + appeared, it also distinguishes whether sync is enabled and for which of + them. Recorded on every activation of a Chrome window (for the respective + profile). + </summary> +</histogram> + +<histogram name="Profile.AllAccounts.Names" enum="ProfileAllAccountsNames" + expires_after="2021-03-11"> + <owner>jkrcal@chromium.org</owner> + <owner>droger@chromium.org</owner> + <summary> + Classification of what gaia names appear or appeared in this profile since + the last time gaia cookies got deleted. Thus, this also includes signed-out + accounts. In order to protect privacy, only reports whether multiple + distinct gaia names appeared in this profile and if so, whether sync is + enabled for one of them. Furthermore, this metric uses a low-entropy hash to + detect distinct names. In case of a rare hash collision (less than 0.1% of + cases), multiple names get recorded as a single name. Recorded on every + activation of a Chrome window (for the respective profile). + </summary> +</histogram> + <histogram name="Profile.AndroidAccountManagementMenu" enum="ProfileAndroidAccountManagementMenu" expires_after="2020-04-26"> <owner>aruslan@chromium.org</owner> @@ -187438,6 +187526,8 @@ label="From app list recommendation."/> <suffix name="FromChromeInternal" label="From Chrome Internal."/> <suffix name="FromFileManager" label="From FileManager."/> + <suffix name="FromInstalledNotification" + label="From installed notification."/> <suffix name="FromKeyboard" label="From keyboard shortcut."/> <suffix name="FromLink" label="From Link."/> <suffix name="FromMenu" label="From menu."/> @@ -190056,6 +190146,9 @@ </histogram_suffixes> <histogram_suffixes name="IOSProductTourScreens" separator=""> + <obsolete> + Removed 04/2020. See crrev.com/c/2129507 + </obsolete> <suffix name="Incognito" label=""/> <suffix name="Sync" label=""/> <suffix name="Unknown" label=""/> @@ -199746,7 +199839,11 @@ <suffix name="BOOKMARK" label="BOOKMARK"/> <suffix name="DEVICE_INFO" label="DEVICE_INFO"/> <suffix name="DICTIONARY" label="DICTIONARY"/> - <suffix name="EXPERIMENTS" label="EXPERIMENTS"/> + <suffix name="EXPERIMENTS" label="EXPERIMENTS"> + <obsolete> + Deprecated 4/2020. + </obsolete> + </suffix> <suffix name="EXTENSION" label="EXTENSION"/> <suffix name="EXTENSION_SETTING" label="EXTENSION_SETTING"/> <suffix name="FAVICON_IMAGE" label="FAVICON_IMAGE"/> @@ -199780,6 +199877,7 @@ <suffix name="PROXY_TABS" label="PROXY_TABS"/> <suffix name="READING_LIST" label="READING_LIST"/> <suffix name="SEARCH_ENGINE" label="SEARCH_ENGINE"/> + <suffix name="SECURITY_EVENT" label="SECURITY_EVENT"/> <suffix name="SEND_TAB_TO_SELF" label="SEND_TAB_TO_SELF"/> <suffix name="SESSION" label="SESSION"/> <suffix name="SHARING_MESSAGE" label="SHARING_MESSAGE"/>
diff --git a/tools/perf/BUILD.gn b/tools/perf/BUILD.gn index 7af7567..30cbd29 100644 --- a/tools/perf/BUILD.gn +++ b/tools/perf/BUILD.gn
@@ -93,3 +93,9 @@ data_deps += [ "//chrome/android/webapk/shell_apk:maps_go_webapk" ] } } + +# This group makes visible those targets in subdirectories that are not +# explicitly depended on. +group("gn_all") { + deps = [ "//tools/perf/core/perfetto_binary_roller:upload_trace_processor" ] +}
diff --git a/tools/perf/core/minidump_unittest.py b/tools/perf/core/minidump_unittest.py index 9943be2..fb27552 100644 --- a/tools/perf/core/minidump_unittest.py +++ b/tools/perf/core/minidump_unittest.py
@@ -33,9 +33,7 @@ # Minidump symbolization doesn't work in ChromeOS local mode if the rootfs is # still read-only, so skip the test in that case. # TODO(crbug.com/1038043): Test is failing on chromeos-betty-chrome. - # TODO(crbug.com/1056235): Re-enable on Linux once the crashes are fixed. - @decorators.Disabled('chromeos-local', 'chromeos-board-betty', - 'chromeos-board-betty-pi-arc', 'linux') + @decorators.Disabled('chromeos-local', 'chromeos-board-betty') def testSymbolizeMinidump(self): # Wait for the browser to restart fully before crashing self._LoadPageThenWait('var sam = "car";', 'sam') @@ -78,9 +76,7 @@ # Minidump symbolization doesn't work in ChromeOS local mode if the rootfs is # still read-only, so skip the test in that case. # TODO(crbug.com/1038043): Test is failing on chromeos-betty-chrome. - # TODO(crbug.com/1056235): Re-enable on Linux once the crashes are fixed. - @decorators.Disabled('chromeos-local', 'chromeos-board-betty', - 'chromeos-board-betty-pi-arc', 'linux') + @decorators.Disabled('chromeos-local', 'chromeos-board-betty') def testMultipleCrashMinidumps(self): # Wait for the browser to restart fully before crashing self._LoadPageThenWait('var cat = "dog";', 'cat')
diff --git a/ui/accessibility/BUILD.gn b/ui/accessibility/BUILD.gn index c8d25ec..97d2c4a6 100644 --- a/ui/accessibility/BUILD.gn +++ b/ui/accessibility/BUILD.gn
@@ -33,6 +33,41 @@ sources = [ "ax_constants.mojom" ] } +# A tiny subset of accessibility code that's allowed to be +# included by Blink. The rule of thumb (for now) is that it's +# anything platform-neutral (no platform/ directory) that +# relates to a single accessibility node (no trees, etc.). +jumbo_component("ax_base") { + sources = [ + "ax_base_export.h", + "ax_enum_util.cc", + "ax_enum_util.h", + "ax_node_data.cc", + "ax_node_data.h", + "ax_node_text_styles.cc", + "ax_node_text_styles.h", + "ax_relative_bounds.cc", + "ax_relative_bounds.h", + "ax_role_properties.cc", + "ax_role_properties.h", + "ax_text_utils.cc", + "ax_text_utils.h", + ] + + public_deps = [ + ":ax_constants_mojo", + ":ax_enums_mojo", + "//base", + "//base:i18n", + "//ui/base", + "//ui/gfx", + "//ui/gfx/geometry", + "//ui/strings", + ] + + defines = [ "AX_BASE_IMPLEMENTATION" ] +} + jumbo_component("accessibility") { sources = [ "accessibility_features.cc", @@ -48,8 +83,6 @@ "ax_active_popup.h", "ax_clipping_behavior.h", "ax_coordinate_system.h", - "ax_enum_util.cc", - "ax_enum_util.h", "ax_event.cc", "ax_event.h", "ax_event_bundle_sink.h", @@ -63,25 +96,15 @@ "ax_mode_observer.h", "ax_node.cc", "ax_node.h", - "ax_node_data.cc", - "ax_node_data.h", "ax_node_position.cc", "ax_node_position.h", - "ax_node_text_styles.cc", - "ax_node_text_styles.h", "ax_offscreen_result.h", "ax_position.h", "ax_range.h", - "ax_relative_bounds.cc", - "ax_relative_bounds.h", - "ax_role_properties.cc", - "ax_role_properties.h", "ax_serializable_tree.cc", "ax_serializable_tree.h", "ax_table_info.cc", "ax_table_info.h", - "ax_text_utils.cc", - "ax_text_utils.h", "ax_tree.cc", "ax_tree.h", "ax_tree_combiner.cc", @@ -169,11 +192,12 @@ } } - defines = [ "ACCESSIBILITY_IMPLEMENTATION" ] + defines = [ "AX_IMPLEMENTATION" ] deps = [ "//third_party/cld_3/src/src:cld_3" ] public_deps = [ + ":ax_base", ":ax_constants_mojo", ":ax_enums_mojo", "//base",
diff --git a/ui/accessibility/ax_base_export.h b/ui/accessibility/ax_base_export.h new file mode 100644 index 0000000..bab8cb5 --- /dev/null +++ b/ui/accessibility/ax_base_export.h
@@ -0,0 +1,32 @@ +// Copyright 2013 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef UI_ACCESSIBILITY_AX_BASE_EXPORT_H_ +#define UI_ACCESSIBILITY_AX_BASE_EXPORT_H_ + +// Defines AX_BASE_EXPORT so that functionality implemented by the +// ui/accessibility:ax_base module can be exported to consumers. + +#if defined(COMPONENT_BUILD) +#if defined(WIN32) + +#if defined(AX_BASE_IMPLEMENTATION) +#define AX_BASE_EXPORT __declspec(dllexport) +#else +#define AX_BASE_EXPORT __declspec(dllimport) +#endif // defined(AX_BASE_IMPLEMENTATION) + +#else // defined(WIN32) +#if defined(AX_BASE_IMPLEMENTATION) +#define AX_BASE_EXPORT __attribute__((visibility("default"))) +#else +#define AX_BASE_EXPORT +#endif +#endif + +#else // defined(COMPONENT_BUILD) +#define AX_BASE_EXPORT +#endif + +#endif // UI_ACCESSIBILITY_AX_BASE_EXPORT_H_
diff --git a/ui/accessibility/ax_enum_util.h b/ui/accessibility/ax_enum_util.h index 487f164..89425cae 100644 --- a/ui/accessibility/ax_enum_util.h +++ b/ui/accessibility/ax_enum_util.h
@@ -5,175 +5,188 @@ #ifndef UI_ACCESSIBILITY_AX_ENUM_UTIL_H_ #define UI_ACCESSIBILITY_AX_ENUM_UTIL_H_ +#include "ui/accessibility/ax_base_export.h" #include "ui/accessibility/ax_enums.mojom-forward.h" -#include "ui/accessibility/ax_export.h" namespace ui { // ax::mojom::Event -AX_EXPORT const char* ToString(ax::mojom::Event event); -AX_EXPORT ax::mojom::Event ParseEvent(const char* event); +AX_BASE_EXPORT const char* ToString(ax::mojom::Event event); +AX_BASE_EXPORT ax::mojom::Event ParseEvent(const char* event); // ax::mojom::Role -AX_EXPORT const char* ToString(ax::mojom::Role role); -AX_EXPORT ax::mojom::Role ParseRole(const char* role); +AX_BASE_EXPORT const char* ToString(ax::mojom::Role role); +AX_BASE_EXPORT ax::mojom::Role ParseRole(const char* role); // ax::mojom::State -AX_EXPORT const char* ToString(ax::mojom::State state); -AX_EXPORT ax::mojom::State ParseState(const char* state); +AX_BASE_EXPORT const char* ToString(ax::mojom::State state); +AX_BASE_EXPORT ax::mojom::State ParseState(const char* state); // ax::mojom::Action -AX_EXPORT const char* ToString(ax::mojom::Action action); -AX_EXPORT ax::mojom::Action ParseAction(const char* action); +AX_BASE_EXPORT const char* ToString(ax::mojom::Action action); +AX_BASE_EXPORT ax::mojom::Action ParseAction(const char* action); // ax::mojom::ActionFlags -AX_EXPORT const char* ToString(ax::mojom::ActionFlags action_flags); -AX_EXPORT ax::mojom::ActionFlags ParseActionFlags(const char* action_flags); +AX_BASE_EXPORT const char* ToString(ax::mojom::ActionFlags action_flags); +AX_BASE_EXPORT ax::mojom::ActionFlags ParseActionFlags( + const char* action_flags); // ax::mojom::DefaultActionVerb -AX_EXPORT const char* ToString( +AX_BASE_EXPORT const char* ToString( ax::mojom::DefaultActionVerb default_action_verb); -AX_EXPORT ax::mojom::DefaultActionVerb ParseDefaultActionVerb( +AX_BASE_EXPORT ax::mojom::DefaultActionVerb ParseDefaultActionVerb( const char* default_action_verb); // ax::mojom::Mutation -AX_EXPORT const char* ToString(ax::mojom::Mutation mutation); -AX_EXPORT ax::mojom::Mutation ParseMutation(const char* mutation); +AX_BASE_EXPORT const char* ToString(ax::mojom::Mutation mutation); +AX_BASE_EXPORT ax::mojom::Mutation ParseMutation(const char* mutation); // ax::mojom::StringAttribute -AX_EXPORT const char* ToString(ax::mojom::StringAttribute string_attribute); -AX_EXPORT ax::mojom::StringAttribute ParseStringAttribute( +AX_BASE_EXPORT const char* ToString( + ax::mojom::StringAttribute string_attribute); +AX_BASE_EXPORT ax::mojom::StringAttribute ParseStringAttribute( const char* string_attribute); // ax::mojom::IntAttribute -AX_EXPORT const char* ToString(ax::mojom::IntAttribute int_attribute); -AX_EXPORT ax::mojom::IntAttribute ParseIntAttribute(const char* int_attribute); +AX_BASE_EXPORT const char* ToString(ax::mojom::IntAttribute int_attribute); +AX_BASE_EXPORT ax::mojom::IntAttribute ParseIntAttribute( + const char* int_attribute); // ax::mojom::FloatAttribute -AX_EXPORT const char* ToString(ax::mojom::FloatAttribute float_attribute); -AX_EXPORT ax::mojom::FloatAttribute ParseFloatAttribute( +AX_BASE_EXPORT const char* ToString(ax::mojom::FloatAttribute float_attribute); +AX_BASE_EXPORT ax::mojom::FloatAttribute ParseFloatAttribute( const char* float_attribute); // ax::mojom::BoolAttribute -AX_EXPORT const char* ToString(ax::mojom::BoolAttribute bool_attribute); -AX_EXPORT ax::mojom::BoolAttribute ParseBoolAttribute( +AX_BASE_EXPORT const char* ToString(ax::mojom::BoolAttribute bool_attribute); +AX_BASE_EXPORT ax::mojom::BoolAttribute ParseBoolAttribute( const char* bool_attribute); // ax::mojom::IntListAttribute -AX_EXPORT const char* ToString(ax::mojom::IntListAttribute int_list_attribute); -AX_EXPORT ax::mojom::IntListAttribute ParseIntListAttribute( +AX_BASE_EXPORT const char* ToString( + ax::mojom::IntListAttribute int_list_attribute); +AX_BASE_EXPORT ax::mojom::IntListAttribute ParseIntListAttribute( const char* int_list_attribute); // ax::mojom::StringListAttribute -AX_EXPORT const char* ToString( +AX_BASE_EXPORT const char* ToString( ax::mojom::StringListAttribute string_list_attribute); -AX_EXPORT ax::mojom::StringListAttribute ParseStringListAttribute( +AX_BASE_EXPORT ax::mojom::StringListAttribute ParseStringListAttribute( const char* string_list_attribute); // ax::mojom::ListStyle -AX_EXPORT const char* ToString(ax::mojom::ListStyle list_style); -AX_EXPORT ax::mojom::ListStyle ParseListStyle(const char* list_style); +AX_BASE_EXPORT const char* ToString(ax::mojom::ListStyle list_style); +AX_BASE_EXPORT ax::mojom::ListStyle ParseListStyle(const char* list_style); // ax::mojom::MarkerType -AX_EXPORT const char* ToString(ax::mojom::MarkerType marker_type); -AX_EXPORT ax::mojom::MarkerType ParseMarkerType(const char* marker_type); +AX_BASE_EXPORT const char* ToString(ax::mojom::MarkerType marker_type); +AX_BASE_EXPORT ax::mojom::MarkerType ParseMarkerType(const char* marker_type); // ax::mojom::MoveDirection -AX_EXPORT const char* ToString(ax::mojom::MoveDirection move_direction); -AX_EXPORT ax::mojom::MoveDirection ParseMoveDirection( +AX_BASE_EXPORT const char* ToString(ax::mojom::MoveDirection move_direction); +AX_BASE_EXPORT ax::mojom::MoveDirection ParseMoveDirection( const char* move_direction); // ax::mojom::EditCommand -AX_EXPORT const char* ToString(ax::mojom::EditCommand edit_command); -AX_EXPORT ax::mojom::EditCommand ParseEditCommand(const char* edit_command); +AX_BASE_EXPORT const char* ToString(ax::mojom::EditCommand edit_command); +AX_BASE_EXPORT ax::mojom::EditCommand ParseEditCommand( + const char* edit_command); // ax::mojom::SelectionCommand -AX_EXPORT const char* ToString(ax::mojom::SelectionCommand selection_command); -AX_EXPORT ax::mojom::SelectionCommand ParseSelectionCommand( +AX_BASE_EXPORT const char* ToString( + ax::mojom::SelectionCommand selection_command); +AX_BASE_EXPORT ax::mojom::SelectionCommand ParseSelectionCommand( const char* selection_command); // ax::mojom::TextBoundary -AX_EXPORT const char* ToString(ax::mojom::TextBoundary text_boundary); -AX_EXPORT ax::mojom::TextBoundary ParseTextBoundary(const char* text_boundary); +AX_BASE_EXPORT const char* ToString(ax::mojom::TextBoundary text_boundary); +AX_BASE_EXPORT ax::mojom::TextBoundary ParseTextBoundary( + const char* text_boundary); // ax:mojom::TextDecorationStyle -AX_EXPORT const char* ToString( +AX_BASE_EXPORT const char* ToString( ax::mojom::TextDecorationStyle text_decoration_style); -AX_EXPORT ax::mojom::TextDecorationStyle ParseTextDecorationStyle( +AX_BASE_EXPORT ax::mojom::TextDecorationStyle ParseTextDecorationStyle( const char* text_decoration_style); // ax::mojom::TextDirection -AX_EXPORT const char* ToString(ax::mojom::TextDirection text_direction); -AX_EXPORT ax::mojom::TextDirection ParseTextDirection( +AX_BASE_EXPORT const char* ToString(ax::mojom::TextDirection text_direction); +AX_BASE_EXPORT ax::mojom::TextDirection ParseTextDirection( const char* text_direction); // ax::mojom::TextPosition -AX_EXPORT const char* ToString(ax::mojom::TextPosition text_position); -AX_EXPORT ax::mojom::TextPosition ParseTextPosition(const char* text_position); +AX_BASE_EXPORT const char* ToString(ax::mojom::TextPosition text_position); +AX_BASE_EXPORT ax::mojom::TextPosition ParseTextPosition( + const char* text_position); // ax::mojom::TextStyle -AX_EXPORT const char* ToString(ax::mojom::TextStyle text_style); -AX_EXPORT ax::mojom::TextStyle ParseTextStyle(const char* text_style); +AX_BASE_EXPORT const char* ToString(ax::mojom::TextStyle text_style); +AX_BASE_EXPORT ax::mojom::TextStyle ParseTextStyle(const char* text_style); // ax::mojom::AriaCurrentState -AX_EXPORT const char* ToString(ax::mojom::AriaCurrentState aria_current_state); -AX_EXPORT ax::mojom::AriaCurrentState ParseAriaCurrentState( +AX_BASE_EXPORT const char* ToString( + ax::mojom::AriaCurrentState aria_current_state); +AX_BASE_EXPORT ax::mojom::AriaCurrentState ParseAriaCurrentState( const char* aria_current_state); // ax::mojom::HasPopup -AX_EXPORT const char* ToString(ax::mojom::HasPopup has_popup); -AX_EXPORT ax::mojom::HasPopup ParseHasPopup(const char* has_popup); +AX_BASE_EXPORT const char* ToString(ax::mojom::HasPopup has_popup); +AX_BASE_EXPORT ax::mojom::HasPopup ParseHasPopup(const char* has_popup); // ax::mojom::InvalidState -AX_EXPORT const char* ToString(ax::mojom::InvalidState invalid_state); -AX_EXPORT ax::mojom::InvalidState ParseInvalidState(const char* invalid_state); +AX_BASE_EXPORT const char* ToString(ax::mojom::InvalidState invalid_state); +AX_BASE_EXPORT ax::mojom::InvalidState ParseInvalidState( + const char* invalid_state); // ax::mojom::Restriction -AX_EXPORT const char* ToString(ax::mojom::Restriction restriction); -AX_EXPORT ax::mojom::Restriction ParseRestriction(const char* restriction); +AX_BASE_EXPORT const char* ToString(ax::mojom::Restriction restriction); +AX_BASE_EXPORT ax::mojom::Restriction ParseRestriction(const char* restriction); // ax::mojom::CheckedState -AX_EXPORT const char* ToString(ax::mojom::CheckedState checked_state); -AX_EXPORT ax::mojom::CheckedState ParseCheckedState(const char* checked_state); +AX_BASE_EXPORT const char* ToString(ax::mojom::CheckedState checked_state); +AX_BASE_EXPORT ax::mojom::CheckedState ParseCheckedState( + const char* checked_state); // ax::mojom::SortDirection -AX_EXPORT const char* ToString(ax::mojom::SortDirection sort_direction); -AX_EXPORT ax::mojom::SortDirection ParseSortDirection( +AX_BASE_EXPORT const char* ToString(ax::mojom::SortDirection sort_direction); +AX_BASE_EXPORT ax::mojom::SortDirection ParseSortDirection( const char* sort_direction); // ax::mojom::NameFrom -AX_EXPORT const char* ToString(ax::mojom::NameFrom name_from); -AX_EXPORT ax::mojom::NameFrom ParseNameFrom(const char* name_from); +AX_BASE_EXPORT const char* ToString(ax::mojom::NameFrom name_from); +AX_BASE_EXPORT ax::mojom::NameFrom ParseNameFrom(const char* name_from); // ax::mojom::DescriptionFrom -AX_EXPORT const char* ToString(ax::mojom::DescriptionFrom description_from); -AX_EXPORT ax::mojom::DescriptionFrom ParseDescriptionFrom( +AX_BASE_EXPORT const char* ToString( + ax::mojom::DescriptionFrom description_from); +AX_BASE_EXPORT ax::mojom::DescriptionFrom ParseDescriptionFrom( const char* description_from); // ax::mojom::EventFrom -AX_EXPORT const char* ToString(ax::mojom::EventFrom event_from); -AX_EXPORT ax::mojom::EventFrom ParseEventFrom(const char* event_from); +AX_BASE_EXPORT const char* ToString(ax::mojom::EventFrom event_from); +AX_BASE_EXPORT ax::mojom::EventFrom ParseEventFrom(const char* event_from); // ax::mojom::Gesture -AX_EXPORT const char* ToString(ax::mojom::Gesture gesture); -AX_EXPORT ax::mojom::Gesture ParseGesture(const char* gesture); +AX_BASE_EXPORT const char* ToString(ax::mojom::Gesture gesture); +AX_BASE_EXPORT ax::mojom::Gesture ParseGesture(const char* gesture); // ax::mojom::TextAffinity -AX_EXPORT const char* ToString(ax::mojom::TextAffinity text_affinity); -AX_EXPORT ax::mojom::TextAffinity ParseTextAffinity(const char* text_affinity); +AX_BASE_EXPORT const char* ToString(ax::mojom::TextAffinity text_affinity); +AX_BASE_EXPORT ax::mojom::TextAffinity ParseTextAffinity( + const char* text_affinity); // ax::mojom::TreeOrder -AX_EXPORT const char* ToString(ax::mojom::TreeOrder tree_order); -AX_EXPORT ax::mojom::TreeOrder ParseTreeOrder(const char* tree_order); +AX_BASE_EXPORT const char* ToString(ax::mojom::TreeOrder tree_order); +AX_BASE_EXPORT ax::mojom::TreeOrder ParseTreeOrder(const char* tree_order); // ax::mojom::ImageAnnotationStatus -AX_EXPORT const char* ToString(ax::mojom::ImageAnnotationStatus status); -AX_EXPORT ax::mojom::ImageAnnotationStatus ParseImageAnnotationStatus( +AX_BASE_EXPORT const char* ToString(ax::mojom::ImageAnnotationStatus status); +AX_BASE_EXPORT ax::mojom::ImageAnnotationStatus ParseImageAnnotationStatus( const char* status); // ax::mojom::Dropeffect -AX_EXPORT const char* ToString(ax::mojom::Dropeffect dropeffect); -AX_EXPORT ax::mojom::Dropeffect ParseDropeffect(const char* dropeffect); +AX_BASE_EXPORT const char* ToString(ax::mojom::Dropeffect dropeffect); +AX_BASE_EXPORT ax::mojom::Dropeffect ParseDropeffect(const char* dropeffect); } // namespace ui
diff --git a/ui/accessibility/ax_export.h b/ui/accessibility/ax_export.h index f437365..ad8dd68 100644 --- a/ui/accessibility/ax_export.h +++ b/ui/accessibility/ax_export.h
@@ -11,14 +11,14 @@ #if defined(COMPONENT_BUILD) #if defined(WIN32) -#if defined(ACCESSIBILITY_IMPLEMENTATION) +#if defined(AX_IMPLEMENTATION) #define AX_EXPORT __declspec(dllexport) #else #define AX_EXPORT __declspec(dllimport) #endif // defined(ACCESSIBILITY_IMPLEMENTATION) #else // defined(WIN32) -#if defined(ACCESSIBILITY_IMPLEMENTATION) +#if defined(AX_IMPLEMENTATION) #define AX_EXPORT __attribute__((visibility("default"))) #else #define AX_EXPORT
diff --git a/ui/accessibility/ax_node_data.h b/ui/accessibility/ax_node_data.h index c2693373..36dbf00 100644 --- a/ui/accessibility/ax_node_data.h +++ b/ui/accessibility/ax_node_data.h
@@ -14,8 +14,8 @@ #include "base/strings/string16.h" #include "base/strings/string_split.h" +#include "ui/accessibility/ax_base_export.h" #include "ui/accessibility/ax_enums.mojom-forward.h" -#include "ui/accessibility/ax_export.h" #include "ui/accessibility/ax_node_text_styles.h" #include "ui/accessibility/ax_relative_bounds.h" #include "ui/gfx/geometry/rect_f.h" @@ -24,16 +24,16 @@ // Return true if |attr| should be interpreted as the id of another node // in the same tree. -AX_EXPORT bool IsNodeIdIntAttribute(ax::mojom::IntAttribute attr); +AX_BASE_EXPORT bool IsNodeIdIntAttribute(ax::mojom::IntAttribute attr); // Return true if |attr| should be interpreted as a list of ids of // nodes in the same tree. -AX_EXPORT bool IsNodeIdIntListAttribute(ax::mojom::IntListAttribute attr); +AX_BASE_EXPORT bool IsNodeIdIntListAttribute(ax::mojom::IntListAttribute attr); // A compact representation of the accessibility information for a // single accessible object, in a form that can be serialized and sent from // one process to another. -struct AX_EXPORT AXNodeData { +struct AX_BASE_EXPORT AXNodeData { AXNodeData(); virtual ~AXNodeData();
diff --git a/ui/accessibility/ax_node_text_styles.h b/ui/accessibility/ax_node_text_styles.h index 37d5d0f..2dd98a98 100644 --- a/ui/accessibility/ax_node_text_styles.h +++ b/ui/accessibility/ax_node_text_styles.h
@@ -7,7 +7,7 @@ #include <string> -#include "ui/accessibility/ax_export.h" +#include "ui/accessibility/ax_base_export.h" namespace ui { @@ -15,7 +15,7 @@ // a snapshot at a given time and is not intended to be held for periods of // time. For this reason, it is a move-only class, to encourage deliberate // short-term usage. -struct AX_EXPORT AXNodeTextStyles { +struct AX_BASE_EXPORT AXNodeTextStyles { AXNodeTextStyles(); // Move-only class, explicitly delete copy-construction and assignment
diff --git a/ui/accessibility/ax_relative_bounds.h b/ui/accessibility/ax_relative_bounds.h index 4f15611..de780d5 100644 --- a/ui/accessibility/ax_relative_bounds.h +++ b/ui/accessibility/ax_relative_bounds.h
@@ -10,8 +10,8 @@ #include <memory> #include <ostream> +#include "ui/accessibility/ax_base_export.h" #include "ui/accessibility/ax_enums.mojom-forward.h" -#include "ui/accessibility/ax_export.h" #include "ui/gfx/geometry/rect_f.h" #include "ui/gfx/transform.h" @@ -31,7 +31,7 @@ // Otherwise, for a node other than the root, the bounds are relative to // the root of the tree, and for the root of a tree, the bounds are relative // to its immediate containing node. -struct AX_EXPORT AXRelativeBounds final { +struct AX_BASE_EXPORT AXRelativeBounds final { AXRelativeBounds(); virtual ~AXRelativeBounds(); @@ -57,8 +57,8 @@ std::unique_ptr<gfx::Transform> transform; }; -AX_EXPORT std::ostream& operator<<(std::ostream& stream, - const AXRelativeBounds& bounds); +AX_BASE_EXPORT std::ostream& operator<<(std::ostream& stream, + const AXRelativeBounds& bounds); } // namespace ui
diff --git a/ui/accessibility/ax_role_properties.h b/ui/accessibility/ax_role_properties.h index be7bd96..d601cdc8 100644 --- a/ui/accessibility/ax_role_properties.h +++ b/ui/accessibility/ax_role_properties.h
@@ -5,8 +5,8 @@ #ifndef UI_ACCESSIBILITY_AX_ROLE_PROPERTIES_H_ #define UI_ACCESSIBILITY_AX_ROLE_PROPERTIES_H_ +#include "ui/accessibility/ax_base_export.h" #include "ui/accessibility/ax_enums.mojom-forward.h" -#include "ui/accessibility/ax_export.h" namespace ui { @@ -18,143 +18,146 @@ // Returns true for objects which have the characteristic "Children // Presentational: True". This concept is defined in the ARIA specification. See // https://www.w3.org/TR/wai-aria-1.1/#childrenArePresentational. -AX_EXPORT bool HasPresentationalChildren(const ax::mojom::Role role); +AX_BASE_EXPORT bool HasPresentationalChildren(const ax::mojom::Role role); // Checks if the given role is an alert or alert-dialog type. -AX_EXPORT bool IsAlert(const ax::mojom::Role role); +AX_BASE_EXPORT bool IsAlert(const ax::mojom::Role role); // Checks if the given role is a clickable type. -AX_EXPORT bool IsClickable(const ax::mojom::Role role); +AX_BASE_EXPORT bool IsClickable(const ax::mojom::Role role); // Returns true if the provided role belongs to a cell or a table header. -AX_EXPORT bool IsCellOrTableHeader(const ax::mojom::Role role); +AX_BASE_EXPORT bool IsCellOrTableHeader(const ax::mojom::Role role); // Returns true if the provided role belongs to a container with selectable // children. -AX_EXPORT bool IsContainerWithSelectableChildren(const ax::mojom::Role role); +AX_BASE_EXPORT bool IsContainerWithSelectableChildren( + const ax::mojom::Role role); // Returns true if the provided role is a control. -AX_EXPORT bool IsControl(const ax::mojom::Role role); +AX_BASE_EXPORT bool IsControl(const ax::mojom::Role role); // Returns true if the provided role is a control on the Android platform. -AX_EXPORT bool IsControlOnAndroid(const ax::mojom::Role role, bool isFocusable); +AX_BASE_EXPORT bool IsControlOnAndroid(const ax::mojom::Role role, + bool isFocusable); // Returns true if the provided role belongs to a document. -AX_EXPORT bool IsDocument(const ax::mojom::Role role); +AX_BASE_EXPORT bool IsDocument(const ax::mojom::Role role); // Returns true if the provided role represents a dialog. -AX_EXPORT bool IsDialog(const ax::mojom::Role role); +AX_BASE_EXPORT bool IsDialog(const ax::mojom::Role role); // Returns true if the provided role is a form. -AX_EXPORT bool IsForm(const ax::mojom::Role role); +AX_BASE_EXPORT bool IsForm(const ax::mojom::Role role); // Returns true if crossing into or out of the provided role should count as // crossing a format boundary. -AX_EXPORT bool IsFormatBoundary(const ax::mojom::Role role); +AX_BASE_EXPORT bool IsFormatBoundary(const ax::mojom::Role role); // Returns true if the provided role belongs to a heading. -AX_EXPORT bool IsHeading(const ax::mojom::Role role); +AX_BASE_EXPORT bool IsHeading(const ax::mojom::Role role); // Returns true if the provided role belongs to a heading or a table header. -AX_EXPORT bool IsHeadingOrTableHeader(const ax::mojom::Role role); +AX_BASE_EXPORT bool IsHeadingOrTableHeader(const ax::mojom::Role role); // Returns true if the provided role belongs to an iframe. -AX_EXPORT bool IsIframe(const ax::mojom::Role role); +AX_BASE_EXPORT bool IsIframe(const ax::mojom::Role role); // Returns true if the provided role is for any kind of image or video. -AX_EXPORT bool IsImageOrVideo(const ax::mojom::Role role); +AX_BASE_EXPORT bool IsImageOrVideo(const ax::mojom::Role role); // Returns true if the provided role belongs to an image, graphic, canvas, etc. -AX_EXPORT bool IsImage(const ax::mojom::Role role); +AX_BASE_EXPORT bool IsImage(const ax::mojom::Role role); // Returns true if the provided role is item-like, specifically if it can hold // pos_in_set and set_size values. -AX_EXPORT bool IsItemLike(const ax::mojom::Role role); +AX_BASE_EXPORT bool IsItemLike(const ax::mojom::Role role); // Returns true if the role is a subclass of the ARIA Landmark abstract role. -AX_EXPORT bool IsLandmark(const ax::mojom::Role role); +AX_BASE_EXPORT bool IsLandmark(const ax::mojom::Role role); // Returns true if the provided role belongs to a link. -AX_EXPORT bool IsLink(const ax::mojom::Role role); +AX_BASE_EXPORT bool IsLink(const ax::mojom::Role role); // Returns true if the provided role belongs to a list. -AX_EXPORT bool IsList(const ax::mojom::Role role); +AX_BASE_EXPORT bool IsList(const ax::mojom::Role role); // Returns true if the provided role belongs to a list item. -AX_EXPORT bool IsListItem(const ax::mojom::Role role); +AX_BASE_EXPORT bool IsListItem(const ax::mojom::Role role); // Returns true if the provided role belongs to a menu item, including menu item // checkbox and menu item radio buttons. -AX_EXPORT bool IsMenuItem(ax::mojom::Role role); +AX_BASE_EXPORT bool IsMenuItem(ax::mojom::Role role); // Returns true if the provided role belongs to a menu or related control. -AX_EXPORT bool IsMenuRelated(const ax::mojom::Role role); +AX_BASE_EXPORT bool IsMenuRelated(const ax::mojom::Role role); // Returns true if this object supports readonly. // Note: This returns false for table cells and headers, it is up to the // caller to make sure that they are included IFF they are within an // ARIA-1.1+ role='grid' or 'treegrid', and not role='table'. -AX_EXPORT bool IsReadOnlySupported(const ax::mojom::Role role); +AX_BASE_EXPORT bool IsReadOnlySupported(const ax::mojom::Role role); // Returns true if the provided role belongs to a widget that can contain a // table or grid row. -AX_EXPORT bool IsRowContainer(const ax::mojom::Role role); +AX_BASE_EXPORT bool IsRowContainer(const ax::mojom::Role role); // Returns true if the role is a subclass of the ARIA Section abstract role. -AX_EXPORT bool IsSection(const ax::mojom::Role role); +AX_BASE_EXPORT bool IsSection(const ax::mojom::Role role); // Returns true if the role is a subclass of the ARIA Sectionhead role. -AX_EXPORT bool IsSectionhead(const ax::mojom::Role role); +AX_BASE_EXPORT bool IsSectionhead(const ax::mojom::Role role); // Returns true if the role is a subclass of the ARIA Select abstract role. -AX_EXPORT bool IsSelect(const ax::mojom::Role role); +AX_BASE_EXPORT bool IsSelect(const ax::mojom::Role role); // Returns true if the provided role is ordered-set like, specifically if it // can hold set_size values. -AX_EXPORT bool IsSetLike(const ax::mojom::Role role); +AX_BASE_EXPORT bool IsSetLike(const ax::mojom::Role role); // Returns true if the provided role belongs to a non-interactive list. -AX_EXPORT bool IsStaticList(const ax::mojom::Role role); +AX_BASE_EXPORT bool IsStaticList(const ax::mojom::Role role); // Returns true if the role is a subclass of the ARIA Structure abstract role. -AX_EXPORT bool IsStructure(const ax::mojom::Role role); +AX_BASE_EXPORT bool IsStructure(const ax::mojom::Role role); // Returns true if the provided role belongs to a table or grid column, and the // table is not used for layout purposes. -AX_EXPORT bool IsTableColumn(ax::mojom::Role role); +AX_BASE_EXPORT bool IsTableColumn(ax::mojom::Role role); // Returns true if the provided role belongs to a table header. -AX_EXPORT bool IsTableHeader(ax::mojom::Role role); +AX_BASE_EXPORT bool IsTableHeader(ax::mojom::Role role); // Returns true if the provided role belongs to a table, a grid or a treegrid. -AX_EXPORT bool IsTableLike(const ax::mojom::Role role); +AX_BASE_EXPORT bool IsTableLike(const ax::mojom::Role role); // Returns true if the provided role belongs to a table or grid row, and the // table is not used for layout purposes. -AX_EXPORT bool IsTableRow(ax::mojom::Role role); +AX_BASE_EXPORT bool IsTableRow(ax::mojom::Role role); // Returns true if it's a text-related node e.g. static text, line break, or // inline text box node. -AX_EXPORT bool IsText(ax::mojom::Role role); +AX_BASE_EXPORT bool IsText(ax::mojom::Role role); // Returns true if it's a text-related node e.g. a static text or line break // node. -AX_EXPORT bool IsTextOrLineBreak(ax::mojom::Role role); +AX_BASE_EXPORT bool IsTextOrLineBreak(ax::mojom::Role role); // Returns true if the role supports expand/collapse. -AX_EXPORT bool SupportsExpandCollapse(const ax::mojom::Role role); +AX_BASE_EXPORT bool SupportsExpandCollapse(const ax::mojom::Role role); // Returns true if the role supports hierarchical level. -AX_EXPORT bool SupportsHierarchicalLevel(const ax::mojom::Role role); +AX_BASE_EXPORT bool SupportsHierarchicalLevel(const ax::mojom::Role role); // Returns true if the provided role can have an orientation. -AX_EXPORT bool SupportsOrientation(const ax::mojom::Role role); +AX_BASE_EXPORT bool SupportsOrientation(const ax::mojom::Role role); // Returns true if the provided role supports toggle. -AX_EXPORT bool SupportsToggle(const ax::mojom::Role role); +AX_BASE_EXPORT bool SupportsToggle(const ax::mojom::Role role); // Returns true if the node should be read only by default -AX_EXPORT bool ShouldHaveReadonlyStateByDefault(const ax::mojom::Role role); +AX_BASE_EXPORT bool ShouldHaveReadonlyStateByDefault( + const ax::mojom::Role role); } // namespace ui
diff --git a/ui/accessibility/ax_text_utils.h b/ui/accessibility/ax_text_utils.h index 7e4d0ea..6356331 100644 --- a/ui/accessibility/ax_text_utils.h +++ b/ui/accessibility/ax_text_utils.h
@@ -10,8 +10,8 @@ #include <vector> #include "base/strings/string16.h" +#include "ui/accessibility/ax_base_export.h" #include "ui/accessibility/ax_enums.mojom-forward.h" -#include "ui/accessibility/ax_export.h" namespace ui { @@ -20,26 +20,27 @@ // (depending on |direction|) from the given |start_offset| until the // given boundary is found, and return the offset of that boundary, // using the vector of line break character offsets in |line_breaks|. -AX_EXPORT size_t FindAccessibleTextBoundary(const base::string16& text, - const std::vector<int>& line_breaks, - ax::mojom::TextBoundary boundary, - size_t start_offset, - ax::mojom::MoveDirection direction, - ax::mojom::TextAffinity affinity); +AX_BASE_EXPORT size_t +FindAccessibleTextBoundary(const base::string16& text, + const std::vector<int>& line_breaks, + ax::mojom::TextBoundary boundary, + size_t start_offset, + ax::mojom::MoveDirection direction, + ax::mojom::TextAffinity affinity); // Returns a string ID that corresponds to the name of the given action. -AX_EXPORT base::string16 ActionVerbToLocalizedString( +AX_BASE_EXPORT base::string16 ActionVerbToLocalizedString( const ax::mojom::DefaultActionVerb action_verb); // Returns the non-localized string representation of a supported action. // Some APIs on Linux and Windows need to return non-localized action names. -AX_EXPORT base::string16 ActionVerbToUnlocalizedString( +AX_BASE_EXPORT base::string16 ActionVerbToUnlocalizedString( const ax::mojom::DefaultActionVerb action_verb); // Returns indices of all word starts in |text|. -AX_EXPORT std::vector<int> GetWordStartOffsets(const base::string16& text); +AX_BASE_EXPORT std::vector<int> GetWordStartOffsets(const base::string16& text); // Returns indices of all word ends in |text|. -AX_EXPORT std::vector<int> GetWordEndOffsets(const base::string16& text); +AX_BASE_EXPORT std::vector<int> GetWordEndOffsets(const base::string16& text); } // namespace ui
diff --git a/ui/aura/window.cc b/ui/aura/window.cc index 31b6744..c26afb9 100644 --- a/ui/aura/window.cc +++ b/ui/aura/window.cc
@@ -776,29 +776,34 @@ delegate_->UpdateVisualState(); } -#if !defined(NDEBUG) +#if DCHECK_IS_ON() std::string Window::GetDebugInfo() const { + std::string name = GetName(); + if (name.empty()) + name = "Unknown"; + std::string layer_state = "NoLayer"; + if (layer()) { + layer_state = base::StringPrintf( + "%s opacity=%.1f", + layer()->GetTargetVisibility() ? "LayerVisible" : "LayerHidden", + layer()->opacity()); + } return base::StringPrintf( - "%s<%d> bounds(%d, %d, %d, %d) %s %s opacity=%.1f " - "occlusion_state=%s", - GetName().empty() ? "Unknown" : GetName().c_str(), id(), bounds().x(), - bounds().y(), bounds().width(), bounds().height(), - visible_ ? "WindowVisible" : "WindowHidden", - layer() - ? (layer()->GetTargetVisibility() ? "LayerVisible" : "LayerHidden") - : "NoLayer", - layer() ? layer()->opacity() : 1.0f, - OcclusionStateToString(occlusion_state_)); + "%s<%d> bounds=%s %s %s occlusion_state=%s", name.c_str(), id(), + bounds().ToString().c_str(), visible_ ? "WindowVisible" : "WindowHidden", + layer_state.c_str(), OcclusionStateToString(occlusion_state_)); +} + +std::string Window::GetWindowHierarchy(int depth) const { + std::string hierarchy = + base::StringPrintf("%*s%s\n", depth * 2, "", GetDebugInfo().c_str()); + for (Window* child : children_) + hierarchy += child->GetWindowHierarchy(depth + 1); + return hierarchy; } void Window::PrintWindowHierarchy(int depth) const { - VLOG(0) << base::StringPrintf( - "%*s%s", depth * 2, "", GetDebugInfo().c_str()); - for (Windows::const_iterator it = children_.begin(); - it != children_.end(); ++it) { - Window* child = *it; - child->PrintWindowHierarchy(depth + 1); - } + VLOG(0) << GetWindowHierarchy(depth); } #endif
diff --git a/ui/aura/window.h b/ui/aura/window.h index 0f625fc..05874de 100644 --- a/ui/aura/window.h +++ b/ui/aura/window.h
@@ -15,6 +15,7 @@ #include "base/compiler_specific.h" #include "base/containers/flat_set.h" +#include "base/logging.h" #include "base/macros.h" #include "base/memory/weak_ptr.h" #include "base/observer_list.h" @@ -400,9 +401,10 @@ // Overridden from ui::LayerOwner: std::unique_ptr<ui::Layer> RecreateLayer() override; -#if !defined(NDEBUG) +#if DCHECK_IS_ON() // These methods are useful when debugging. std::string GetDebugInfo() const; + std::string GetWindowHierarchy(int depth) const; void PrintWindowHierarchy(int depth) const; #endif
diff --git a/ui/base/test/skia_gold_pixel_diff.cc b/ui/base/test/skia_gold_pixel_diff.cc index 8b31ad0..cbd8bd2 100644 --- a/ui/base/test/skia_gold_pixel_diff.cc +++ b/ui/base/test/skia_gold_pixel_diff.cc
@@ -37,14 +37,15 @@ const char* kSkiaGoldCtl = "tools/skia_goldctl/linux/goldctl"; #endif -const char* kBuildRevisionKey = "build-revision"; +const char* kBuildRevisionKey = "git-revision"; // The switch keys for tryjob. -const char* kIssueKey = "issue"; -const char* kPatchSetKey = "patchset"; -const char* kJobIdKey = "jobid"; +const char* kIssueKey = "gerrit-issue"; +const char* kPatchSetKey = "gerrit-patchset"; +const char* kJobIdKey = "buildbucket-id"; const char* kNoLuciAuth = "no-luci-auth"; +const char* kBypassSkiaGoldFunctionality = "bypass-skia-gold-functionality"; SkiaGoldPixelDiff::SkiaGoldPixelDiff() = default; @@ -134,6 +135,12 @@ } void SkiaGoldPixelDiff::InitSkiaGold() { + if (base::CommandLine::ForCurrentProcess()->HasSwitch( + kBypassSkiaGoldFunctionality)) { + LOG(WARNING) << "Bypassing Skia Gold initialization due to " + << "--bypass-skia-gold-functionality being present."; + return; + } base::ScopedAllowBlockingForTesting allow_blocking; base::CommandLine cmd(GetAbsoluteSrcRelativePath(kSkiaGoldCtl)); cmd.AppendSwitchPath("work-dir", working_dir_); @@ -207,6 +214,13 @@ bool SkiaGoldPixelDiff::UploadToSkiaGoldServer( const base::FilePath& local_file_path, const std::string& remote_golden_image_name) const { + if (base::CommandLine::ForCurrentProcess()->HasSwitch( + kBypassSkiaGoldFunctionality)) { + LOG(WARNING) << "Bypassing Skia Gold comparison due to " + << "--bypass-skia-gold-functionality being present."; + return true; + } + base::ScopedAllowBlockingForTesting allow_blocking; base::CommandLine cmd(GetAbsoluteSrcRelativePath(kSkiaGoldCtl)); cmd.AppendSwitchASCII("test-name", remote_golden_image_name);
diff --git a/ui/base/test/skia_gold_pixel_diff_unittest.cc b/ui/base/test/skia_gold_pixel_diff_unittest.cc index f7f47e4..a8abdf0 100644 --- a/ui/base/test/skia_gold_pixel_diff_unittest.cc +++ b/ui/base/test/skia_gold_pixel_diff_unittest.cc
@@ -5,18 +5,19 @@ #include "ui/base/test/skia_gold_pixel_diff.h" #include "base/command_line.h" +#include "testing/gmock/include/gmock/gmock.h" #include "testing/gtest/include/gtest/gtest.h" #include "third_party/skia/include/core/SkBitmap.h" #include "third_party/skia/include/core/SkImageInfo.h" #include "ui/gfx/image/image.h" #include "ui/gfx/native_widget_types.h" +using ::testing::_; + class MockSkiaGoldPixelDiff : public SkiaGoldPixelDiff { public: - MockSkiaGoldPixelDiff() {} - int LaunchProcess(const base::CommandLine& cmdline) const override { - return 0; - } + MockSkiaGoldPixelDiff() = default; + MOCK_CONST_METHOD1(LaunchProcess, int(const base::CommandLine&)); bool UploadToSkiaGoldServer( const base::FilePath& local_file_path, const std::string& remote_golden_image_name) const override { @@ -28,7 +29,7 @@ public: SkiaGoldPixelDiffTest() { auto* cmd_line = base::CommandLine::ForCurrentProcess(); - cmd_line->AppendSwitchASCII("build-revision", "test"); + cmd_line->AppendSwitchASCII("git-revision", "test"); } ~SkiaGoldPixelDiffTest() override {} @@ -48,3 +49,19 @@ bool ret = mock_pixel.CompareScreenshot("test", bitmap); EXPECT_TRUE(ret); } + +TEST_F(SkiaGoldPixelDiffTest, BypassSkiaGoldFunctionality) { + base::CommandLine::ForCurrentProcess()->AppendSwitch( + "bypass-skia-gold-functionality"); + + SkBitmap bitmap; + SkImageInfo info = + SkImageInfo::Make(10, 10, SkColorType::kBGRA_8888_SkColorType, + SkAlphaType::kPremul_SkAlphaType); + bitmap.allocPixels(info, 10 * 4); + MockSkiaGoldPixelDiff mock_pixel; + EXPECT_CALL(mock_pixel, LaunchProcess(_)).Times(0); + mock_pixel.Init("Prefix"); + bool ret = mock_pixel.CompareScreenshot("test", bitmap); + EXPECT_TRUE(ret); +}
diff --git a/ui/base/x/BUILD.gn b/ui/base/x/BUILD.gn index b58cc65..76584b2 100644 --- a/ui/base/x/BUILD.gn +++ b/ui/base/x/BUILD.gn
@@ -21,6 +21,8 @@ "x11_display_util.h", "x11_menu_list.cc", "x11_menu_list.h", + "x11_menu_registrar.cc", + "x11_menu_registrar.h", "x11_pointer_grab.cc", "x11_pointer_grab.h", "x11_shm_image_pool.cc",
diff --git a/ui/views/widget/desktop_aura/x11_desktop_handler.cc b/ui/base/x/x11_menu_registrar.cc similarity index 67% rename from ui/views/widget/desktop_aura/x11_desktop_handler.cc rename to ui/base/x/x11_menu_registrar.cc index 8089aa3..2d1d23f 100644 --- a/ui/views/widget/desktop_aura/x11_desktop_handler.cc +++ b/ui/base/x/x11_menu_registrar.cc
@@ -2,13 +2,11 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "ui/views/widget/desktop_aura/x11_desktop_handler.h" +#include "ui/base/x/x11_menu_registrar.h" #include <memory> #include <string> -#include "ui/aura/env.h" -#include "ui/aura/window_event_dispatcher.h" #include "ui/base/x/x11_menu_list.h" #include "ui/base/x/x11_util.h" #include "ui/events/x/x11_window_event_manager.h" @@ -19,43 +17,36 @@ namespace { // Our global instance. Deleted when our Env() is deleted. -views::X11DesktopHandler* g_handler = nullptr; +ui::X11MenuRegistrar* g_handler = nullptr; } // namespace -namespace views { +namespace ui { // static -X11DesktopHandler* X11DesktopHandler::get() { +X11MenuRegistrar* X11MenuRegistrar::Get() { if (!g_handler) - g_handler = new X11DesktopHandler; + g_handler = new X11MenuRegistrar; return g_handler; } -// static -X11DesktopHandler* X11DesktopHandler::get_dont_create() { - return g_handler; -} - -X11DesktopHandler::X11DesktopHandler() +X11MenuRegistrar::X11MenuRegistrar() : xdisplay_(gfx::GetXDisplay()), x_root_window_(DefaultRootWindow(xdisplay_)) { if (ui::X11EventSource::HasInstance()) ui::X11EventSource::GetInstance()->AddXEventDispatcher(this); - aura::Env::GetInstance()->AddObserver(this); x_root_window_events_ = std::make_unique<ui::XScopedEventSelector>( x_root_window_, StructureNotifyMask | SubstructureNotifyMask); } -X11DesktopHandler::~X11DesktopHandler() { - aura::Env::GetInstance()->RemoveObserver(this); +X11MenuRegistrar::~X11MenuRegistrar() { if (ui::X11EventSource::HasInstance()) ui::X11EventSource::GetInstance()->RemoveXEventDispatcher(this); } -bool X11DesktopHandler::DispatchXEvent(XEvent* event) { +bool X11MenuRegistrar::DispatchXEvent(XEvent* event) { if (event->type != CreateNotify && event->type != DestroyNotify) { return false; } @@ -72,14 +63,7 @@ return false; } -void X11DesktopHandler::OnWindowInitialized(aura::Window* window) {} - -void X11DesktopHandler::OnWillDestroyEnv() { - g_handler = nullptr; - delete this; -} - -void X11DesktopHandler::OnWindowCreatedOrDestroyed(int event_type, XID window) { +void X11MenuRegistrar::OnWindowCreatedOrDestroyed(int event_type, XID window) { // Menus created by Chrome can be drag and drop targets. Since they are // direct children of the screen root window and have override_redirect // we cannot use regular _NET_CLIENT_LIST_STACKING property to find them @@ -91,10 +75,10 @@ // The window might be destroyed if the message pump did not get a chance to // run but we can safely ignore the X error. gfx::X11ErrorTracker error_tracker; - ui::XMenuList::GetInstance()->MaybeRegisterMenu(window); + XMenuList::GetInstance()->MaybeRegisterMenu(window); } else { - ui::XMenuList::GetInstance()->MaybeUnregisterMenu(window); + XMenuList::GetInstance()->MaybeUnregisterMenu(window); } } -} // namespace views +} // namespace ui
diff --git a/ui/base/x/x11_menu_registrar.h b/ui/base/x/x11_menu_registrar.h new file mode 100644 index 0000000..b3a30a24 --- /dev/null +++ b/ui/base/x/x11_menu_registrar.h
@@ -0,0 +1,54 @@ +// Copyright (c) 2012 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef UI_BASE_X_X11_MENU_REGISTRAR_H_ +#define UI_BASE_X_X11_MENU_REGISTRAR_H_ + +#include <stdint.h> + +#include <memory> +#include <string> +#include <vector> + +#include "ui/events/platform/x11/x11_event_source.h" +#include "ui/gfx/x/x11.h" +#include "ui/gfx/x/x11_types.h" + +namespace ui { + +class XScopedEventSelector; + +// A singleton that owns global objects related to the desktop and listens for +// X11 events on the X11 root window. Destroys itself when the browser +// shuts down. +class X11MenuRegistrar : public ui::XEventDispatcher { + public: + // Returns the singleton handler. Creates one if one has not + // already been created. + static X11MenuRegistrar* Get(); + + // ui::XEventDispatcher + bool DispatchXEvent(XEvent* event) override; + + private: + X11MenuRegistrar(); + ~X11MenuRegistrar() override; + + // Called when |window| has been created or destroyed. |window| may not be + // managed by Chrome. + void OnWindowCreatedOrDestroyed(int event_type, XID window); + + // The display and the native X window hosting the root window. + XDisplay* xdisplay_; + + // The native root window. + ::Window x_root_window_; + + // Events selected on |x_root_window_|. + std::unique_ptr<ui::XScopedEventSelector> x_root_window_events_; +}; + +} // namespace ui + +#endif // UI_BASE_X_X11_MENU_REGISTRAR_H_
diff --git a/ui/base/x/x11_window.cc b/ui/base/x/x11_window.cc index 8fb12cb..62c8122e 100644 --- a/ui/base/x/x11_window.cc +++ b/ui/base/x/x11_window.cc
@@ -16,6 +16,7 @@ #include "third_party/skia/include/core/SkRegion.h" #include "ui/base/hit_test_x11.h" #include "ui/base/wm_role_names_linux.h" +#include "ui/base/x/x11_menu_registrar.h" #include "ui/base/x/x11_pointer_grab.h" #include "ui/base/x/x11_util.h" #include "ui/base/x/x11_util_internal.h" @@ -151,6 +152,10 @@ } void XWindow::Init(const Configuration& config) { + // Ensure that the X11MenuRegistrar exists. The X11MenuRegistrar is + // necessary to properly track menu windows. + X11MenuRegistrar::Get(); + activatable_ = config.activatable; unsigned long attribute_mask = CWBackPixel | CWBitGravity;
diff --git a/ui/display/win/screen_win.cc b/ui/display/win/screen_win.cc index 81ecf6c..ee77605 100644 --- a/ui/display/win/screen_win.cc +++ b/ui/display/win/screen_win.cc
@@ -180,27 +180,35 @@ return touching_display_infos; } -gfx::DisplayColorSpaces GetSourceColorSpaces( - const Display& display, - ColorProfileReader* color_profile_reader, - bool hdr_enabled) { - if (Display::HasForceDisplayColorProfile()) - return display.color_spaces(); - if (hdr_enabled) - return gfx::DisplayColorSpaces(); - return gfx::DisplayColorSpaces( - color_profile_reader->GetDisplayColorSpace(display.id())); +// Default scRGB white level in nits. This is used to determine the SDR scaling +// factor with the user configured white level from the SDR brightness slider. +constexpr float kDefaultScrgbWhiteLevel = 80.0f; + +// Helper function to create gfx::DisplayColorSpaces from given |color_space| +// and |sdr_white_level| with default buffer formats for Windows. +gfx::DisplayColorSpaces CreateDisplayColorSpaces( + const gfx::ColorSpace& color_space, + float sdr_white_level = kDefaultScrgbWhiteLevel) { + gfx::DisplayColorSpaces display_color_spaces(color_space); + // When alpha is not needed, specify BGRX_8888 to get + // DXGI_ALPHA_MODE_IGNORE. This saves significant power (see + // https://crbug.com/1057163). + display_color_spaces.SetOutputBufferFormats(gfx::BufferFormat::BGRX_8888, + gfx::BufferFormat::BGRA_8888); + display_color_spaces.SetSDRWhiteLevel(sdr_white_level); + return display_color_spaces; } -void ConfigureColorSpacesForHdr(float sdr_white_level, - gfx::DisplayColorSpaces* color_spaces) { - color_spaces->SetSDRWhiteLevel(sdr_white_level); +// Updates |color_spaces| for HDR and WCG content usage with appropriate color +// HDR spaces and given |sdr_white_level|. +gfx::DisplayColorSpaces GetDisplayColorSpacesForHdr(float sdr_white_level) { + auto color_spaces = + CreateDisplayColorSpaces(gfx::ColorSpace::CreateSRGB(), sdr_white_level); // This will map to DXGI_COLOR_SPACE_RGB_FULL_G10_NONE_P709. In that space, // the brightness of (1,1,1) is 80 nits. - constexpr float kScrgbWhiteLevel = 80.0f; - const auto scrgb_linear = - gfx::ColorSpace::CreateSCRGBLinear(kScrgbWhiteLevel / sdr_white_level); + const auto scrgb_linear = gfx::ColorSpace::CreateSCRGBLinear( + kDefaultScrgbWhiteLevel / sdr_white_level); // This will map to DXGI_COLOR_SPACE_RGB_FULL_G2084_NONE_P2020, with sRGB's // (1,1,1) mapping to the specified number of nits. @@ -214,21 +222,44 @@ // Windows RS3, but RGB10A2 with HDR10 color space works fine (see // https://crbug.com/937108#c92). if (base::win::GetVersion() > base::win::Version::WIN10_RS3) { - color_spaces->SetOutputColorSpaceAndBufferFormat( + color_spaces.SetOutputColorSpaceAndBufferFormat( usage, !kNeedsAlpha, scrgb_linear, gfx::BufferFormat::RGBA_F16); } else { - color_spaces->SetOutputColorSpaceAndBufferFormat( - usage, !kNeedsAlpha, hdr10, gfx::BufferFormat::BGRA_1010102); + color_spaces.SetOutputColorSpaceAndBufferFormat( + usage, !kNeedsAlpha, hdr10, gfx::BufferFormat::RGBA_1010102); } // Use RGBA F16 backbuffers for HDR if alpha channel is required. - color_spaces->SetOutputColorSpaceAndBufferFormat( + color_spaces.SetOutputColorSpaceAndBufferFormat( usage, kNeedsAlpha, scrgb_linear, gfx::BufferFormat::RGBA_F16); } + return color_spaces; } -Display CreateDisplayFromDisplayInfo(const DisplayInfo& display_info, - ColorProfileReader* color_profile_reader, - bool hdr_enabled) { +// Sets SDR white level and buffer formats on |display_color_spaces| when using +// a forced color profile. +gfx::DisplayColorSpaces GetForcedDisplayColorSpaces() { + // Adjust white level to default for Windows if color space is PQ. This is + // needed because the color space is created with the cross-platform default + // white level which is different (gfx::ColorSpace::kDefaultSDRWhiteLevel). + const auto& color_space = + Display::GetForcedDisplayColorProfile().GetWithPQSDRWhiteLevel( + kDefaultScrgbWhiteLevel); + auto display_color_spaces = CreateDisplayColorSpaces(color_space); + // Use the forced color profile's buffer format for all content usages. + if (color_space.GetTransferID() == gfx::ColorSpace::TransferID::SMPTEST2084) { + display_color_spaces.SetOutputBufferFormats( + gfx::BufferFormat::RGBA_1010102, gfx::BufferFormat::RGBA_1010102); + } else if (color_space.IsHDR()) { + display_color_spaces.SetOutputBufferFormats(gfx::BufferFormat::RGBA_F16, + gfx::BufferFormat::RGBA_F16); + } + return display_color_spaces; +} + +Display CreateDisplayFromDisplayInfo( + const DisplayInfo& display_info, + const ColorProfileReader* color_profile_reader, + bool hdr_enabled) { const float scale_factor = display_info.device_scale_factor(); const gfx::Rect bounds = gfx::ScaleToEnclosingRect(display_info.screen_rect(), 1.0f / scale_factor); @@ -239,22 +270,24 @@ display.set_rotation(display_info.rotation()); display.set_display_frequency(display_info.display_frequency()); - // Compute the DisplayColorSpace for this configuration. - gfx::DisplayColorSpaces color_spaces = - GetSourceColorSpaces(display, color_profile_reader, hdr_enabled); - // When alpha is not needed, specify BGRX_8888 to get DXGI_ALPHA_MODE_IGNORE. - // This saves significant power (see https://crbug.com/1057163). - color_spaces.SetOutputBufferFormats(gfx::BufferFormat::BGRX_8888, - gfx::BufferFormat::BGRA_8888); - if (hdr_enabled && !Display::HasForceDisplayColorProfile()) { - ConfigureColorSpacesForHdr(display_info.sdr_white_level(), &color_spaces); - + // DisplayColorSpaces is created using the forced color profile if present, or + // from the ICC profile provided by |color_profile_reader| for SDR content, + // and HDR10 or scRGB linear for HDR and WCG content if HDR is enabled. + gfx::DisplayColorSpaces color_spaces; + if (Display::HasForceDisplayColorProfile()) { + color_spaces = GetForcedDisplayColorSpaces(); + } else if (hdr_enabled) { + color_spaces = GetDisplayColorSpacesForHdr(display_info.sdr_white_level()); + } else { + color_spaces = CreateDisplayColorSpaces( + color_profile_reader->GetDisplayColorSpace(display.id())); + } + if (color_spaces.SupportsHDR()) { // These are (ab)used by pages via media query APIs to detect HDR support. display.set_color_depth(Display::kHDR10BitsPerPixel); display.set_depth_per_component(Display::kHDR10BitsPerComponent); } display.set_color_spaces(color_spaces); - return display; }
diff --git a/ui/events/keycodes/dom/keycode_converter.cc b/ui/events/keycodes/dom/keycode_converter.cc index cc2aa86..e5550482 100644 --- a/ui/events/keycodes/dom/keycode_converter.cc +++ b/ui/events/keycodes/dom/keycode_converter.cc
@@ -93,10 +93,8 @@ // static DomCode KeycodeConverter::NativeKeycodeToDomCode(int native_keycode) { for (auto& mapping : kDomCodeMappings) { - if (mapping.native_keycode == native_keycode) { - if (mapping.code != nullptr) - return static_cast<DomCode>(mapping.usb_keycode); - } + if (mapping.native_keycode == native_keycode) + return static_cast<DomCode>(mapping.usb_keycode); } return DomCode::NONE; }
diff --git a/ui/events/keycodes/dom/keycode_converter_unittest.cc b/ui/events/keycodes/dom/keycode_converter_unittest.cc index bb4ee79..19780ad 100644 --- a/ui/events/keycodes/dom/keycode_converter_unittest.cc +++ b/ui/events/keycodes/dom/keycode_converter_unittest.cc
@@ -172,6 +172,10 @@ EXPECT_STREQ(entry->code, ui::KeycodeConverter::DomCodeToCodeString(code)); } + ui::DomCode code = + ui::KeycodeConverter::NativeKeycodeToDomCode(entry->native_keycode); + EXPECT_EQ(entry->native_keycode, + ui::KeycodeConverter::DomCodeToNativeKeycode(code)); } }
diff --git a/ui/events/ozone/evdev/input_device_factory_evdev.cc b/ui/events/ozone/evdev/input_device_factory_evdev.cc index aca1bdc..ce41f93 100644 --- a/ui/events/ozone/evdev/input_device_factory_evdev.cc +++ b/ui/events/ozone/evdev/input_device_factory_evdev.cc
@@ -343,12 +343,12 @@ SetIntPropertyForOneType(DT_MOUSE, "Pointer Sensitivity", input_device_settings_.mouse_sensitivity); - SetIntPropertyForOneType(DT_MOUSE, "Scroll Sensitivity", + SetIntPropertyForOneType(DT_MOUSE, "Mouse Scroll Sensitivity", input_device_settings_.mouse_scroll_sensitivity); SetBoolPropertyForOneType(DT_MOUSE, "Pointer Acceleration", input_device_settings_.mouse_acceleration_enabled); SetBoolPropertyForOneType( - DT_MOUSE, "Scroll Acceleration", + DT_MOUSE, "Mouse Scroll Acceleration", input_device_settings_.mouse_scroll_acceleration_enabled); SetBoolPropertyForOneType( DT_MOUSE, "Mouse Reverse Scrolling",
diff --git a/ui/file_manager/file_manager/foreground/css/file_manager.css b/ui/file_manager/file_manager/foreground/css/file_manager.css index fb95731..290e8f4b 100644 --- a/ui/file_manager/file_manager/foreground/css/file_manager.css +++ b/ui/file_manager/file_manager/foreground/css/file_manager.css
@@ -2654,10 +2654,14 @@ } body.files-ng .table-header-cell { - cursor: pointer; padding-bottom: 16px; } +html:not(.pointer-active) body.files-ng .table-header-cell, +body.files-ng .table-header-cell:active { + cursor: pointer; +} + body.files-ng #list-container .table-header-cell:first-child .table-header-label { margin-inline-start: 12px; @@ -2667,6 +2671,12 @@ --cr-icon-button-icon-size: 16px; --cr-icon-button-size: 32px; border-radius: 50%; + cursor: default; +} + +html:not(.pointer-active) body.files-ng .table-header-label .sort-icon, +body.files-ng .table-header-label .sort-icon:active { + cursor: pointer; } body.files-ng .table-label-container { @@ -2682,7 +2692,8 @@ text-overflow: ellipsis; } -body.files-ng .table-header-label .sorted .sort-icon:hover { +html:not(.pointer-active) body.files-ng .table-header-label .sorted +.sort-icon:hover { background-color: rgba(0, 0, 0, 4%); } @@ -2733,10 +2744,15 @@ --cr-icon-button-size: 32px; --cr-icon-button-margin-start: 0px; --cr-icon-button-fill-color: var(--google-grey-500); - cursor: col-resize ; + cursor: default; height: 32px; } +html:not(.pointer-active) body.files-ng .table-header-splitter +.splitter-icon:hover { + cursor: col-resize; +} + body.files-ng #list-container .table-row-cell .size { padding-inline-end: 5px; padding-inline-start: 22px;
diff --git a/ui/file_manager/file_manager/foreground/js/ui/file_grid.js b/ui/file_manager/file_manager/foreground/js/ui/file_grid.js index 04b751e..b2e5e6ff 100644 --- a/ui/file_manager/file_manager/foreground/js/ui/file_grid.js +++ b/ui/file_manager/file_manager/foreground/js/ui/file_grid.js
@@ -256,8 +256,8 @@ const index = item.listIndex; const nextIndex = index + 1; - if (util.isFilesNg()) { - const entry = this.dataModel.item(index); + const entry = this.dataModel.item(index); + if (entry && util.isFilesNg()) { if (entry.isDirectory && previousTitle !== 'dir') { // For first Directory we add a title div before the element. const title = document.createElement('div');
diff --git a/ui/gfx/color_space.cc b/ui/gfx/color_space.cc index 09f8a763..d5f8e3d 100644 --- a/ui/gfx/color_space.cc +++ b/ui/gfx/color_space.cc
@@ -428,7 +428,12 @@ PRINT_ENUM_CASE(TransferID, IEC61966_2_1_HDR) PRINT_ENUM_CASE(TransferID, LINEAR_HDR) case TransferID::SMPTEST2084: - ss << "PQ (SDR white point " << transfer_params_[0] << ")"; + ss << "PQ (SDR white point "; + if (transfer_params_[0] == 0.f) + ss << "default " << kDefaultSDRWhiteLevel; + else + ss << transfer_params_[0]; + ss << " nits)"; break; case TransferID::CUSTOM: { skcms_TransferFunction fn; @@ -607,11 +612,11 @@ transfer_fn = SkNamedTransferFn::kHLG; break; case TransferID::SMPTEST2084: - transfer_fn = SkNamedTransferFn::kPQ; + GetPQTransferFunction(&transfer_fn); break; default: if (!GetTransferFunction(&transfer_fn)) { - DLOG(ERROR) << "Failed to transfer function for SkColorSpace"; + DLOG(ERROR) << "Failed to get transfer function for SkColorSpace"; return nullptr; } break; @@ -940,6 +945,23 @@ } } +void ColorSpace::GetPQTransferFunction(skcms_TransferFunction* fn) const { + DCHECK_EQ(transfer_, TransferID::SMPTEST2084); + const float sdr_white_level = + transfer_params_[0] == 0.0f ? kDefaultSDRWhiteLevel : transfer_params_[0]; + // The generic PQ transfer function produces normalized luminance values i.e. + // the range 0-1 represents 0-10000 nits for the reference display, but we + // want to map 1.0 to |sdr_white_level| nits so we need to scale accordingly. + const float w = 10000.0f / sdr_white_level; + // Distribute scaling factor W by scaling A and B with X ^ (1/F): + // ((A + Bx^C) / (D + Ex^C))^F * W = ((A + Bx^C) / (D + Ex^C) * W^(1/F))^F + // See https://crbug.com/1058580#c32 for discussion. + *fn = SkNamedTransferFn::kPQ; + const float ws = powf(w, 1 / fn->f); + fn->a = ws * fn->a; + fn->b = ws * fn->b; +} + bool ColorSpace::GetInverseTransferFunction(skcms_TransferFunction* fn) const { if (!GetTransferFunction(fn)) return false; @@ -950,7 +972,7 @@ bool ColorSpace::GetPQSDRWhiteLevel(float* sdr_white_level) const { if (transfer_ != TransferID::SMPTEST2084) return false; - if (transfer_params_[0] == 0.f) + if (transfer_params_[0] == 0.0f) *sdr_white_level = kDefaultSDRWhiteLevel; else *sdr_white_level = transfer_params_[0];
diff --git a/ui/gfx/color_space.h b/ui/gfx/color_space.h index 423af948..43be18e 100644 --- a/ui/gfx/color_space.h +++ b/ui/gfx/color_space.h
@@ -330,6 +330,8 @@ static bool GetTransferFunction(TransferID, skcms_TransferFunction* fn); static size_t TransferParamCount(TransferID); + void GetPQTransferFunction(skcms_TransferFunction* fn) const; + void SetCustomTransferFunction(const skcms_TransferFunction& fn); void SetCustomPrimaries(const skcms_Matrix3x3& to_XYZD50);
diff --git a/ui/gtk/gtk_ui_delegate.h b/ui/gtk/gtk_ui_delegate.h index 830d157..15036cb 100644 --- a/ui/gtk/gtk_ui_delegate.h +++ b/ui/gtk/gtk_ui_delegate.h
@@ -10,6 +10,7 @@ using GdkKeymap = struct _GdkKeymap; using GdkWindow = struct _GdkWindow; +using GtkWindow = struct _GtkWindow; namespace ui { @@ -49,6 +50,10 @@ // function abstracts away such functionality. virtual bool SetGdkWindowTransientFor(GdkWindow* window, gfx::AcceleratedWidget parent) = 0; + + // Presents |window|, doing all the necessary platform-specific operations + // needed, if any. + virtual void ShowGtkWindow(GtkWindow* window) = 0; }; } // namespace ui
diff --git a/ui/gtk/gtk_ui_delegate_x11.cc b/ui/gtk/gtk_ui_delegate_x11.cc index bffc4d3874..7de953d 100644 --- a/ui/gtk/gtk_ui_delegate_x11.cc +++ b/ui/gtk/gtk_ui_delegate_x11.cc
@@ -5,8 +5,10 @@ #include "ui/gtk/gtk_ui_delegate_x11.h" #include <gdk/gdkx.h> +#include <gtk/gtk.h> #include "base/logging.h" +#include "ui/events/platform/x11/x11_event_source.h" #include "ui/gfx/native_widget_types.h" #include "ui/gfx/x/x11.h" #include "ui/gtk/gtk_event_loop_x11.h" @@ -53,4 +55,12 @@ return display_; } +void GtkUiDelegateX11::ShowGtkWindow(GtkWindow* window) { + // We need to call gtk_window_present after making the widgets visible to make + // sure window gets correctly raised and gets focus. + DCHECK(X11EventSource::HasInstance()); + gtk_window_present_with_time(window, + X11EventSource::GetInstance()->GetTimestamp()); +} + } // namespace ui
diff --git a/ui/gtk/gtk_ui_delegate_x11.h b/ui/gtk/gtk_ui_delegate_x11.h index cdff352..d2e4b32 100644 --- a/ui/gtk/gtk_ui_delegate_x11.h +++ b/ui/gtk/gtk_ui_delegate_x11.h
@@ -32,6 +32,7 @@ GdkWindow* GetGdkWindow(gfx::AcceleratedWidget window_id) override; bool SetGdkWindowTransientFor(GdkWindow* window, gfx::AcceleratedWidget parent) override; + void ShowGtkWindow(GtkWindow* window) override; private: GdkDisplay* GetGdkDisplay();
diff --git a/ui/native_theme/common_theme.cc b/ui/native_theme/common_theme.cc index cbef81b9..aac3821 100644 --- a/ui/native_theme/common_theme.cc +++ b/ui/native_theme/common_theme.cc
@@ -182,6 +182,9 @@ case NativeTheme::kColorId_ThrobberSpinningColor: return gfx::kGoogleBlue300; + case NativeTheme::kColorId_BubbleBorder: + return gfx::kGoogleGrey800; + // Alert icon colors case NativeTheme::kColorId_AlertSeverityLow: return gfx::kGoogleGreen300; @@ -516,6 +519,9 @@ return base_theme->GetSystemColor( NativeTheme::kColorId_BubbleFooterBackground); + case NativeTheme::kColorId_BubbleBorder: + return gfx::kGoogleGrey300; + case NativeTheme::kColorId_NumColors: // Keeping the kColorId_NumColors case instead of using the default case // allows ColorId additions to trigger compile error for an incomplete
diff --git a/ui/native_theme/native_theme_color_id.h b/ui/native_theme/native_theme_color_id.h index cd62bb2..0fddcbf 100644 --- a/ui/native_theme/native_theme_color_id.h +++ b/ui/native_theme/native_theme_color_id.h
@@ -128,6 +128,8 @@ OP(kColorId_ThrobberSpinningColor), \ OP(kColorId_ThrobberWaitingColor), \ OP(kColorId_ThrobberLightColor), \ + /* Colors for Bubble Border */ \ + OP(kColorId_BubbleBorder), \ /* Colors for icons that alert, e.g. upgrade reminders. */ \ OP(kColorId_AlertSeverityLow), \ OP(kColorId_AlertSeverityMedium), \
diff --git a/ui/ozone/platform/wayland/host/gtk_ui_delegate_wayland.cc b/ui/ozone/platform/wayland/host/gtk_ui_delegate_wayland.cc index 4f0a93b..fef56d4f 100644 --- a/ui/ozone/platform/wayland/host/gtk_ui_delegate_wayland.cc +++ b/ui/ozone/platform/wayland/host/gtk_ui_delegate_wayland.cc
@@ -43,4 +43,10 @@ return false; } +void GtkUiDelegateWayland::ShowGtkWindow(GtkWindow* window) { + // TODO(crbug.com/1008755): Check if gtk_window_present_with_time is needed + // here as well, similarly to what is done in X11 impl. + gtk_window_present(window); +} + } // namespace ui
diff --git a/ui/ozone/platform/wayland/host/gtk_ui_delegate_wayland.h b/ui/ozone/platform/wayland/host/gtk_ui_delegate_wayland.h index f32f2527..dd7baf93b 100644 --- a/ui/ozone/platform/wayland/host/gtk_ui_delegate_wayland.h +++ b/ui/ozone/platform/wayland/host/gtk_ui_delegate_wayland.h
@@ -25,6 +25,7 @@ GdkWindow* GetGdkWindow(gfx::AcceleratedWidget window_id) override; bool SetGdkWindowTransientFor(GdkWindow* window, gfx::AcceleratedWidget parent) override; + void ShowGtkWindow(GtkWindow* window) override; private: WaylandConnection* const connection_;
diff --git a/ui/views/BUILD.gn b/ui/views/BUILD.gn index 4569ee0..d3fa4cd0 100644 --- a/ui/views/BUILD.gn +++ b/ui/views/BUILD.gn
@@ -762,7 +762,6 @@ "widget/desktop_aura/desktop_drag_drop_client_aurax11.h", "widget/desktop_aura/desktop_screen_x11.h", "widget/desktop_aura/desktop_window_tree_host_x11.h", - "widget/desktop_aura/x11_desktop_handler.h", "widget/desktop_aura/x11_desktop_window_move_client.h", "widget/desktop_aura/x11_move_loop.h", "widget/desktop_aura/x11_move_loop_delegate.h", @@ -773,7 +772,6 @@ "widget/desktop_aura/desktop_drag_drop_client_aurax11.cc", "widget/desktop_aura/desktop_screen_x11.cc", "widget/desktop_aura/desktop_window_tree_host_x11.cc", - "widget/desktop_aura/x11_desktop_handler.cc", "widget/desktop_aura/x11_desktop_window_move_client.cc", "widget/desktop_aura/x11_topmost_window_finder.cc", "widget/desktop_aura/x11_whole_screen_move_loop.cc",
diff --git a/ui/views/bubble/bubble_border.cc b/ui/views/bubble/bubble_border.cc index a70ae59..9b27830 100644 --- a/ui/views/bubble/bubble_border.cc +++ b/ui/views/bubble/bubble_border.cc
@@ -323,7 +323,8 @@ flags.setAntiAlias(true); flags.setStyle(cc::PaintFlags::kStroke_Style); flags.setStrokeWidth(kBorderThicknessDip); - constexpr SkColor kBorderColor = gfx::kGoogleGrey600; + SkColor kBorderColor = view.GetNativeTheme()->GetSystemColor( + ui::NativeTheme::kColorId_BubbleBorder); flags.setColor(kBorderColor); canvas->DrawRoundRect(bounds, corner_radius(), flags); }
diff --git a/ui/views/controls/menu/menu_config.h b/ui/views/controls/menu/menu_config.h index 16539424..9d0e8aa 100644 --- a/ui/views/controls/menu/menu_config.h +++ b/ui/views/controls/menu/menu_config.h
@@ -24,6 +24,10 @@ MenuConfig(); ~MenuConfig(); + // Menus are the only place using kGroupingPropertyKey, so any value (other + // than 0) is fine. + static constexpr int kMenuControllerGroupingId = 1001; + static const MenuConfig& instance(); // Helper methods to simplify access to MenuConfig:
diff --git a/ui/views/controls/menu/menu_controller.cc b/ui/views/controls/menu/menu_controller.cc index 8fe4384..d8c09129 100644 --- a/ui/views/controls/menu/menu_controller.cc +++ b/ui/views/controls/menu/menu_controller.cc
@@ -2088,12 +2088,9 @@ menu_open_mouse_loc_ = mouse_pos; } - // Menus are the only place using kGroupingPropertyKey, so any value (other - // than 0) is fine. - constexpr int kGroupingId = 1001; item->GetSubmenu()->GetWidget()->SetNativeWindowProperty( TooltipManager::kGroupingPropertyKey, - reinterpret_cast<void*>(kGroupingId)); + reinterpret_cast<void*>(MenuConfig::kMenuControllerGroupingId)); // Set the selection indices for this menu level based on traversal order. SetSelectionIndices(item);
diff --git a/ui/views/focus/focus_manager.cc b/ui/views/focus/focus_manager.cc index efd6fb9..462a3e6 100644 --- a/ui/views/focus/focus_manager.cc +++ b/ui/views/focus/focus_manager.cc
@@ -155,7 +155,7 @@ } bool FocusManager::RotatePaneFocus(Direction direction, - FocusCycleWrappingBehavior wrap) { + FocusCycleWrapping wrapping) { // Get the list of all accessible panes. std::vector<View*> panes; widget_->widget_delegate()->GetAccessiblePanes(&panes); @@ -189,7 +189,8 @@ else index++; - if (wrap == kNoWrap && (index >= count || index < 0)) + if (wrapping == FocusCycleWrapping::kDisabled && + (index >= count || index < 0)) return false; index = (index + count) % count;
diff --git a/ui/views/focus/focus_manager.h b/ui/views/focus/focus_manager.h index ec75d3d0..909a4fe 100644 --- a/ui/views/focus/focus_manager.h +++ b/ui/views/focus/focus_manager.h
@@ -140,7 +140,7 @@ // TODO(dmazzoni): use Direction in place of bool reverse throughout. enum Direction { kForward, kBackward }; - enum FocusCycleWrappingBehavior { kWrap, kNoWrap }; + enum class FocusCycleWrapping { kEnabled, kDisabled }; FocusManager(Widget* widget, std::unique_ptr<FocusManagerDelegate> delegate); ~FocusManager() override; @@ -269,7 +269,7 @@ // order to trap keyboard focus within that pane. If |wrap| is kWrap, // it keeps cycling within this widget, otherwise it returns false after // reaching the last pane so that focus can cycle to another widget. - bool RotatePaneFocus(Direction direction, FocusCycleWrappingBehavior wrap); + bool RotatePaneFocus(Direction direction, FocusCycleWrapping wrapping); // Convenience method that returns true if the passed |key_event| should // trigger tab traversal (if it is a TAB key press with or without SHIFT
diff --git a/ui/views/focus/focus_manager_unittest.cc b/ui/views/focus/focus_manager_unittest.cc index 0463acc..b96e3175 100644 --- a/ui/views/focus/focus_manager_unittest.cc +++ b/ui/views/focus/focus_manager_unittest.cc
@@ -574,44 +574,44 @@ FocusManager* focus_manager = GetWidget()->GetFocusManager(); // Advance forwards. Focus should stay trapped within each pane. - EXPECT_TRUE(focus_manager->RotatePaneFocus(FocusManager::kForward, - FocusManager::kWrap)); + EXPECT_TRUE(focus_manager->RotatePaneFocus( + FocusManager::kForward, FocusManager::FocusCycleWrapping::kEnabled)); EXPECT_EQ(v1, focus_manager->GetFocusedView()); focus_manager->AdvanceFocus(false); EXPECT_EQ(v2, focus_manager->GetFocusedView()); focus_manager->AdvanceFocus(false); EXPECT_EQ(v1, focus_manager->GetFocusedView()); - EXPECT_TRUE(focus_manager->RotatePaneFocus(FocusManager::kForward, - FocusManager::kWrap)); + EXPECT_TRUE(focus_manager->RotatePaneFocus( + FocusManager::kForward, FocusManager::FocusCycleWrapping::kEnabled)); EXPECT_EQ(v3, focus_manager->GetFocusedView()); focus_manager->AdvanceFocus(false); EXPECT_EQ(v4, focus_manager->GetFocusedView()); focus_manager->AdvanceFocus(false); EXPECT_EQ(v3, focus_manager->GetFocusedView()); - EXPECT_TRUE(focus_manager->RotatePaneFocus(FocusManager::kForward, - FocusManager::kWrap)); + EXPECT_TRUE(focus_manager->RotatePaneFocus( + FocusManager::kForward, FocusManager::FocusCycleWrapping::kEnabled)); EXPECT_EQ(v1, focus_manager->GetFocusedView()); // Advance backwards. - EXPECT_TRUE(focus_manager->RotatePaneFocus(FocusManager::kBackward, - FocusManager::kWrap)); + EXPECT_TRUE(focus_manager->RotatePaneFocus( + FocusManager::kBackward, FocusManager::FocusCycleWrapping::kEnabled)); EXPECT_EQ(v3, focus_manager->GetFocusedView()); - EXPECT_TRUE(focus_manager->RotatePaneFocus(FocusManager::kBackward, - FocusManager::kWrap)); + EXPECT_TRUE(focus_manager->RotatePaneFocus( + FocusManager::kBackward, FocusManager::FocusCycleWrapping::kEnabled)); EXPECT_EQ(v1, focus_manager->GetFocusedView()); // Advance without wrap. When it gets to the end of the list of // panes, RotatePaneFocus should return false but the current // focused view shouldn't change. - EXPECT_TRUE(focus_manager->RotatePaneFocus(FocusManager::kForward, - FocusManager::kNoWrap)); + EXPECT_TRUE(focus_manager->RotatePaneFocus( + FocusManager::kForward, FocusManager::FocusCycleWrapping::kDisabled)); EXPECT_EQ(v3, focus_manager->GetFocusedView()); - EXPECT_FALSE(focus_manager->RotatePaneFocus(FocusManager::kForward, - FocusManager::kNoWrap)); + EXPECT_FALSE(focus_manager->RotatePaneFocus( + FocusManager::kForward, FocusManager::FocusCycleWrapping::kDisabled)); EXPECT_EQ(v3, focus_manager->GetFocusedView()); }
diff --git a/ui/views/test/views_test_helper_aura.cc b/ui/views/test/views_test_helper_aura.cc index b194ed5..a77451a 100644 --- a/ui/views/test/views_test_helper_aura.cc +++ b/ui/views/test/views_test_helper_aura.cc
@@ -4,13 +4,15 @@ #include "ui/views/test/views_test_helper_aura.h" +#include "base/logging.h" +#include "ui/aura/window.h" #include "ui/views/test/test_views_delegate.h" namespace views { namespace { -ViewsTestHelperAura* g_instance = nullptr; +ViewsTestHelperAura::TestViewsDelegateFactory g_delegate_factory = nullptr; } // namespace @@ -20,32 +22,38 @@ } ViewsTestHelperAura::ViewsTestHelperAura() { - DCHECK(!g_instance); - g_instance = this; - aura_test_helper_ = std::make_unique<aura::test::AuraTestHelper>(); } ViewsTestHelperAura::~ViewsTestHelperAura() { + // Ensure all Widgets (and Windows) are closed in unit tests. + // + // Most tests do not try to create desktop Aura Widgets, and on most platforms + // will thus create Widgets that are owned by the RootWindow. These will + // automatically be destroyed when the RootWindow is torn down (during + // destruction of the AuraTestHelper). However, on Mac there are only desktop + // widgets, so any unclosed widgets will remain unowned, holding a Compositor, + // and will cause UAFs if closed (e.g. by the test freeing a + // unique_ptr<Widget> with WIDGET_OWNS_NATIVE_WIDGET) after the ContextFactory + // is destroyed by our owner. + // + // So, although it shouldn't matter for this helper, check for unclosed + // windows to complain about faulty tests early. +#if DCHECK_IS_ON() gfx::NativeWindow root_window = GetContext(); if (root_window) { - // Ensure all Widgets (and windows) are closed in unit tests. This is done - // automatically when the RootWindow is torn down, but is an error on - // platforms that must ensure no Compositors are alive when the - // ContextFactory is torn down. - // So, although it's optional, check the root window to detect failures - // before they hit the CQ on other platforms. - DCHECK(root_window->children().empty()) << "Not all windows were closed."; + DCHECK(root_window->children().empty()) + << "Not all windows were closed:\n" + << root_window->GetWindowHierarchy(0); } - - g_instance = nullptr; +#endif } std::unique_ptr<TestViewsDelegate> ViewsTestHelperAura::GetFallbackTestViewsDelegate() { // The factory delegate takes priority over the parent default. - return factory_.is_null() ? ViewsTestHelper::GetFallbackTestViewsDelegate() - : std::move(factory_).Run(); + return g_delegate_factory ? (*g_delegate_factory)() + : ViewsTestHelper::GetFallbackTestViewsDelegate(); } void ViewsTestHelperAura::SetUp() { @@ -59,10 +67,8 @@ // static void ViewsTestHelperAura::SetFallbackTestViewsDelegateFactory( TestViewsDelegateFactory factory) { - if (g_instance) { - DCHECK(g_instance->factory_.is_null()); - g_instance->factory_ = std::move(factory); - } + DCHECK_NE(g_delegate_factory == nullptr, factory == nullptr); + g_delegate_factory = factory; } } // namespace views
diff --git a/ui/views/test/views_test_helper_aura.h b/ui/views/test/views_test_helper_aura.h index d003367..0ac2c52 100644 --- a/ui/views/test/views_test_helper_aura.h +++ b/ui/views/test/views_test_helper_aura.h
@@ -7,7 +7,6 @@ #include <memory> -#include "base/callback_forward.h" #include "ui/aura/test/aura_test_helper.h" #include "ui/views/test/views_test_helper.h" @@ -15,8 +14,7 @@ class ViewsTestHelperAura : public ViewsTestHelper { public: - using TestViewsDelegateFactory = - base::OnceCallback<std::unique_ptr<TestViewsDelegate>()>; + using TestViewsDelegateFactory = std::unique_ptr<TestViewsDelegate> (*)(); ViewsTestHelperAura(); ViewsTestHelperAura(const ViewsTestHelperAura&) = delete; @@ -29,14 +27,12 @@ gfx::NativeWindow GetContext() override; // Provides a way for test helpers to customize what delegate will be used - // if one is not provided by the test/framework. If no ViewsTestHelperAura - // has been created, this does nothing. + // if one is not provided by the test/framework. static void SetFallbackTestViewsDelegateFactory( TestViewsDelegateFactory factory); private: std::unique_ptr<aura::test::AuraTestHelper> aura_test_helper_; - TestViewsDelegateFactory factory_; }; } // namespace views
diff --git a/ui/views/widget/desktop_aura/desktop_window_tree_host_x11.cc b/ui/views/widget/desktop_aura/desktop_window_tree_host_x11.cc index 7439257d..2c94941c 100644 --- a/ui/views/widget/desktop_aura/desktop_window_tree_host_x11.cc +++ b/ui/views/widget/desktop_aura/desktop_window_tree_host_x11.cc
@@ -57,7 +57,6 @@ #include "ui/views/widget/desktop_aura/desktop_drag_drop_client_aurax11.h" #include "ui/views/widget/desktop_aura/desktop_native_cursor_manager.h" #include "ui/views/widget/desktop_aura/desktop_native_widget_aura.h" -#include "ui/views/widget/desktop_aura/x11_desktop_handler.h" #include "ui/views/widget/desktop_aura/x11_desktop_window_move_client.h" #include "ui/views/window/native_frame_view.h" #include "ui/wm/core/compound_event_filter.h" @@ -97,10 +96,6 @@ void DesktopWindowTreeHostX11::OnNativeWidgetCreated( const Widget::InitParams& params) { - // Ensure that the X11DesktopHandler exists so that it tracks create/destroy - // notify events. - X11DesktopHandler::get(); - x11_window_move_client_ = std::make_unique<X11DesktopWindowMoveClient>(); wm::SetWindowMoveClient(window(), x11_window_move_client_.get());
diff --git a/ui/views/widget/desktop_aura/x11_desktop_handler.h b/ui/views/widget/desktop_aura/x11_desktop_handler.h deleted file mode 100644 index a5486c1..0000000 --- a/ui/views/widget/desktop_aura/x11_desktop_handler.h +++ /dev/null
@@ -1,71 +0,0 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef UI_VIEWS_WIDGET_DESKTOP_AURA_X11_DESKTOP_HANDLER_H_ -#define UI_VIEWS_WIDGET_DESKTOP_AURA_X11_DESKTOP_HANDLER_H_ - -#include <stdint.h> - -#include <memory> -#include <string> -#include <vector> - -#include "base/macros.h" -#include "base/observer_list.h" -#include "ui/aura/env_observer.h" -#include "ui/events/platform/x11/x11_event_source.h" -#include "ui/gfx/x/x11.h" -#include "ui/gfx/x/x11_types.h" -#include "ui/views/views_export.h" - -namespace ui { -class XScopedEventSelector; -} - -namespace views { - -// A singleton that owns global objects related to the desktop and listens for -// X11 events on the X11 root window. Destroys itself when aura::Env is -// deleted. -class VIEWS_EXPORT X11DesktopHandler : public ui::XEventDispatcher, - public aura::EnvObserver { - public: - // Returns the singleton handler. Creates one if one has not - // already been created. - static X11DesktopHandler* get(); - - // Returns the singleton handler, or nullptr if one has not already - // been created. - static X11DesktopHandler* get_dont_create(); - - // ui::XEventDispatcher - bool DispatchXEvent(XEvent* event) override; - - // Overridden from aura::EnvObserver: - void OnWindowInitialized(aura::Window* window) override; - void OnWillDestroyEnv() override; - - private: - X11DesktopHandler(); - ~X11DesktopHandler() override; - - // Called when |window| has been created or destroyed. |window| may not be - // managed by Chrome. - void OnWindowCreatedOrDestroyed(int event_type, XID window); - - // The display and the native X window hosting the root window. - XDisplay* xdisplay_; - - // The native root window. - ::Window x_root_window_; - - // Events selected on x_root_window_. - std::unique_ptr<ui::XScopedEventSelector> x_root_window_events_; - - DISALLOW_COPY_AND_ASSIGN(X11DesktopHandler); -}; - -} // namespace views - -#endif // UI_VIEWS_WIDGET_DESKTOP_AURA_X11_DESKTOP_HANDLER_H_
diff --git a/ui/views/widget/desktop_aura/x11_topmost_window_finder_interactive_uitest.cc b/ui/views/widget/desktop_aura/x11_topmost_window_finder_interactive_uitest.cc index e11ba38..ce5c9ef 100644 --- a/ui/views/widget/desktop_aura/x11_topmost_window_finder_interactive_uitest.cc +++ b/ui/views/widget/desktop_aura/x11_topmost_window_finder_interactive_uitest.cc
@@ -21,7 +21,6 @@ #include "ui/views/test/views_interactive_ui_test_base.h" #include "ui/views/test/x11_property_change_waiter.h" #include "ui/views/widget/desktop_aura/desktop_native_widget_aura.h" -#include "ui/views/widget/desktop_aura/x11_desktop_handler.h" #include "ui/views/widget/widget.h" namespace views { @@ -169,10 +168,6 @@ // Make X11 synchronous for our display connection. This does not force the // window manager to behave synchronously. XSynchronize(xdisplay(), x11::True); - - // Ensure that the X11DesktopHandler exists. The X11DesktopHandler is - // necessary to properly track menu windows. - X11DesktopHandler::get(); } void TearDown() override {
diff --git a/ui/webui/resources/cr_components/chromeos/bluetooth_dialog.js b/ui/webui/resources/cr_components/chromeos/bluetooth_dialog.js index ba8c2d3b..64e983b7 100644 --- a/ui/webui/resources/cr_components/chromeos/bluetooth_dialog.js +++ b/ui/webui/resources/cr_components/chromeos/bluetooth_dialog.js
@@ -162,7 +162,9 @@ if (wasPairing) { const transport = device.transport ? device.transport : chrome.bluetooth.Transport.INVALID; - this.recordPairingMetrics_(transport, lastError, result); + const connectResult = lastError ? undefined : result; + chrome.bluetoothPrivate.recordPairing( + transport, this.getPairingDurationMs_(), connectResult); } let error; @@ -583,45 +585,6 @@ }, /** - * Record metrics for pairing attempt results. - * @param {!chrome.bluetooth.Transport} transport The transport type of the - * device. - * @param {!{message: string}} lastError chrome.runtime.lastError. - * @param {!chrome.bluetoothPrivate.ConnectResultType} result The connection - * result. - * @private - */ - recordPairingMetrics_(transport, lastError, result) { - // TODO(crbug.com/953149): Also create metrics which break down the simple - // boolean success/failure metric with error reasons, including |lastError|. - - let success; - if (lastError) { - success = false; - } else { - switch (result) { - case chrome.bluetoothPrivate.ConnectResultType.SUCCESS: - success = true; - break; - case chrome.bluetoothPrivate.ConnectResultType.IN_PROGRESS: - case chrome.bluetoothPrivate.ConnectResultType.ALREADY_CONNECTED: - case chrome.bluetoothPrivate.ConnectResultType.AUTH_CANCELED: - case chrome.bluetoothPrivate.ConnectResultType.AUTH_REJECTED: - // Cases like this do not reflect success or failure to pair, - // particularly AUTH_CANCELED or AUTH_REJECTED. Do not emit to - // metrics. - return; - default: - success = false; - break; - } - } - - chrome.bluetoothPrivate.recordPairing( - success, transport, this.getPairingDurationMs_()); - }, - - /** * Calculate how long it took to complete pairing, excluding how long the user * took to confirm the pairing auth process. * @return {number}
diff --git a/ui/webui/resources/cr_elements/cr_action_menu/cr_action_menu.js b/ui/webui/resources/cr_elements/cr_action_menu/cr_action_menu.js index 21ba352b..59196c2d8 100644 --- a/ui/webui/resources/cr_elements/cr_action_menu/cr_action_menu.js +++ b/ui/webui/resources/cr_elements/cr_action_menu/cr_action_menu.js
@@ -238,8 +238,12 @@ */ onKeyDown_(e) { e.stopPropagation(); + if (e.key === 'Tab' || e.key === 'Escape') { this.close(); + if (e.key === 'Tab') { + this.fire('tabkeyclose', {shiftKey: e.shiftKey}); + } e.preventDefault(); return; }
diff --git a/weblayer/browser/browser_main_parts_impl.cc b/weblayer/browser/browser_main_parts_impl.cc index f0b6bcd..1488377 100644 --- a/weblayer/browser/browser_main_parts_impl.cc +++ b/weblayer/browser/browser_main_parts_impl.cc
@@ -176,6 +176,7 @@ void BrowserMainPartsImpl::PostMainMessageLoopRun() { params_->delegate->PostMainMessageLoopRun(); + browser_process_->StartTearDown(); } void BrowserMainPartsImpl::PreDefaultMainMessageLoopRun(
diff --git a/weblayer/browser/browser_process.cc b/weblayer/browser/browser_process.cc index ad66283..d1df17ae 100644 --- a/weblayer/browser/browser_process.cc +++ b/weblayer/browser/browser_process.cc
@@ -6,34 +6,23 @@ #include "base/memory/ptr_util.h" #include "base/memory/ref_counted.h" +#include "base/path_service.h" +#include "base/threading/thread_restrictions.h" #include "base/time/default_clock.h" #include "base/time/default_tick_clock.h" #include "components/network_time/network_time_tracker.h" -#include "components/prefs/in_memory_pref_store.h" +#include "components/prefs/json_pref_store.h" #include "components/prefs/pref_registry_simple.h" #include "components/prefs/pref_service.h" #include "components/prefs/pref_service_factory.h" +#include "weblayer/browser/download_manager_delegate_impl.h" #include "weblayer/browser/system_network_context_manager.h" +#include "weblayer/common/weblayer_paths.h" namespace weblayer { namespace { BrowserProcess* g_browser_process = nullptr; - -// Creates the PrefService that will be used as the browser process's local -// state. -std::unique_ptr<PrefService> CreatePrefService() { - auto pref_registry = base::MakeRefCounted<PrefRegistrySimple>(); - - network_time::NetworkTimeTracker::RegisterPrefs(pref_registry.get()); - - PrefServiceFactory pref_service_factory; - pref_service_factory.set_user_prefs( - base::MakeRefCounted<InMemoryPrefStore>()); - - return pref_service_factory.Create(pref_registry); -} - } // namespace BrowserProcess::BrowserProcess() { @@ -53,11 +42,33 @@ return g_browser_process; } +void BrowserProcess::StartTearDown() { + if (local_state_) + local_state_->CommitPendingWrite(); +} + PrefService* BrowserProcess::GetLocalState() { DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); - if (!local_state_) - local_state_ = CreatePrefService(); + if (!local_state_) { + auto pref_registry = base::MakeRefCounted<PrefRegistrySimple>(); + + RegisterPrefs(pref_registry.get()); + + base::FilePath path; + CHECK(base::PathService::Get(DIR_USER_DATA, &path)); + path = path.AppendASCII("Local State"); + PrefServiceFactory pref_service_factory; + pref_service_factory.set_user_prefs( + base::MakeRefCounted<JsonPrefStore>(path)); + + { + // Creating the prefs service may require reading the preferences from + // disk. + base::ScopedAllowBlocking allow_io; + local_state_ = pref_service_factory.Create(pref_registry); + } + } return local_state_.get(); } @@ -82,4 +93,9 @@ return network_time_tracker_.get(); } +void BrowserProcess::RegisterPrefs(PrefRegistrySimple* pref_registry) { + network_time::NetworkTimeTracker::RegisterPrefs(pref_registry); + pref_registry->RegisterIntegerPref(kDownloadNextIDPref, 0); +} + } // namespace weblayer
diff --git a/weblayer/browser/browser_process.h b/weblayer/browser/browser_process.h index a4e961a..f8f7302 100644 --- a/weblayer/browser/browser_process.h +++ b/weblayer/browser/browser_process.h
@@ -11,6 +11,7 @@ #include "base/memory/scoped_refptr.h" #include "base/sequence_checker.h" +class PrefRegistrySimple; class PrefService; namespace network_time { @@ -32,11 +33,16 @@ static BrowserProcess* GetInstance(); + // Does cleanup that needs to occur before threads are torn down. + void StartTearDown(); + PrefService* GetLocalState(); scoped_refptr<network::SharedURLLoaderFactory> GetSharedURLLoaderFactory(); network_time::NetworkTimeTracker* GetNetworkTimeTracker(); private: + void RegisterPrefs(PrefRegistrySimple* pref_registry); + std::unique_ptr<PrefService> local_state_; std::unique_ptr<network_time::NetworkTimeTracker> network_time_tracker_; SEQUENCE_CHECKER(sequence_checker_);
diff --git a/weblayer/browser/download_callback_proxy.cc b/weblayer/browser/download_callback_proxy.cc index adda1bf9..e40063ba 100644 --- a/weblayer/browser/download_callback_proxy.cc +++ b/weblayer/browser/download_callback_proxy.cc
@@ -76,7 +76,8 @@ DownloadImpl* download_impl = static_cast<DownloadImpl*>(download); JNIEnv* env = AttachCurrentThread(); Java_DownloadCallbackProxy_createDownload( - env, java_delegate_, reinterpret_cast<jlong>(download_impl)); + env, java_delegate_, reinterpret_cast<jlong>(download_impl), + download_impl->GetId()); Java_DownloadCallbackProxy_downloadStarted(env, java_delegate_, download_impl->java_download()); }
diff --git a/weblayer/browser/download_impl.cc b/weblayer/browser/download_impl.cc index d8b6315..1ceb3b1 100644 --- a/weblayer/browser/download_impl.cc +++ b/weblayer/browser/download_impl.cc
@@ -158,6 +158,10 @@ } } +uint32_t DownloadImpl::GetId() { + return item_->GetId(); +} + void DownloadImpl::ResumeInternal() { if (resume_pending_) { resume_pending_ = false;
diff --git a/weblayer/browser/download_impl.h b/weblayer/browser/download_impl.h index c25b90c3..72c08f5 100644 --- a/weblayer/browser/download_impl.h +++ b/weblayer/browser/download_impl.h
@@ -81,6 +81,8 @@ std::string GetMimeType() override; DownloadError GetError() override; + uint32_t GetId(); + private: explicit DownloadImpl(download::DownloadItem* item);
diff --git a/weblayer/browser/download_manager_delegate_impl.cc b/weblayer/browser/download_manager_delegate_impl.cc index eb85613..2e5e10d 100644 --- a/weblayer/browser/download_manager_delegate_impl.cc +++ b/weblayer/browser/download_manager_delegate_impl.cc
@@ -8,12 +8,15 @@ #include "base/task/post_task.h" #include "base/task/thread_pool.h" #include "base/threading/sequenced_task_runner_handle.h" +#include "build/build_config.h" #include "components/download/public/common/download_item.h" +#include "components/prefs/pref_service.h" #include "content/public/browser/browser_task_traits.h" #include "content/public/browser/download_item_utils.h" #include "content/public/browser/download_manager.h" #include "net/base/filename_util.h" #include "weblayer/browser/browser_context_impl.h" +#include "weblayer/browser/browser_process.h" #include "weblayer/browser/download_impl.h" #include "weblayer/browser/download_manager_delegate_impl.h" #include "weblayer/browser/profile_impl.h" @@ -45,6 +48,8 @@ } // namespace +const char kDownloadNextIDPref[] = "weblayer_download_next_id"; + DownloadManagerDelegateImpl::DownloadManagerDelegateImpl( content::DownloadManager* download_manager) : download_manager_(download_manager) { @@ -60,6 +65,15 @@ download->RemoveObserver(this); } +void DownloadManagerDelegateImpl::GetNextId( + content::DownloadIdCallback callback) { + // Need to return a unique id, even across crashes, to avoid notification + // intents with different data (e.g. notification GUID) getting dup'd. This is + // also persisted in the on-disk download database to support resumption. + auto* local_state = BrowserProcess::GetInstance()->GetLocalState(); + std::move(callback).Run(local_state->GetInteger(kDownloadNextIDPref)); +} + bool DownloadManagerDelegateImpl::DetermineDownloadTarget( download::DownloadItem* item, content::DownloadTargetCallback* callback) { @@ -147,6 +161,17 @@ // Create a DownloadImpl which will be owned by |item|. DownloadImpl::Create(item); + auto* local_state = BrowserProcess::GetInstance()->GetLocalState(); + int next_id = local_state->GetInteger(kDownloadNextIDPref); + if (item->GetId() >= static_cast<uint32_t>(next_id)) { + next_id = item->GetId(); + // Reset the counter when it gets close to max value of unsigned 32 bit + // integer since that's what the download system persists. + if (++next_id == (std::numeric_limits<uint32_t>::max() / 2) - 1) + next_id = 0; + local_state->SetInteger(kDownloadNextIDPref, next_id); + } + auto* delegate = GetDelegate(item); if (delegate) delegate->DownloadStarted(DownloadImpl::Get(item));
diff --git a/weblayer/browser/download_manager_delegate_impl.h b/weblayer/browser/download_manager_delegate_impl.h index 83d8b8e..29d023e 100644 --- a/weblayer/browser/download_manager_delegate_impl.h +++ b/weblayer/browser/download_manager_delegate_impl.h
@@ -14,6 +14,8 @@ namespace weblayer { class DownloadDelegate; +extern const char kDownloadNextIDPref[]; + class DownloadManagerDelegateImpl : public content::DownloadManagerDelegate, public content::DownloadManager::Observer, public download::DownloadItem::Observer { @@ -29,6 +31,7 @@ private: // content::DownloadManagerDelegate implementation: + void GetNextId(content::DownloadIdCallback callback) override; bool DetermineDownloadTarget( download::DownloadItem* item, content::DownloadTargetCallback* callback) override;
diff --git a/weblayer/browser/java/org/chromium/weblayer_private/DownloadCallbackProxy.java b/weblayer/browser/java/org/chromium/weblayer_private/DownloadCallbackProxy.java index 3d887e7..0d0d692 100644 --- a/weblayer/browser/java/org/chromium/weblayer_private/DownloadCallbackProxy.java +++ b/weblayer/browser/java/org/chromium/weblayer_private/DownloadCallbackProxy.java
@@ -69,8 +69,8 @@ } @CalledByNative - private DownloadImpl createDownload(long nativeDownloadImpl) { - return new DownloadImpl(mClient, nativeDownloadImpl); + private DownloadImpl createDownload(long nativeDownloadImpl, int id) { + return new DownloadImpl(mClient, nativeDownloadImpl, id); } @CalledByNative
diff --git a/weblayer/browser/java/org/chromium/weblayer_private/DownloadImpl.java b/weblayer/browser/java/org/chromium/weblayer_private/DownloadImpl.java index 81e9279d..ad6c826 100644 --- a/weblayer/browser/java/org/chromium/weblayer_private/DownloadImpl.java +++ b/weblayer/browser/java/org/chromium/weblayer_private/DownloadImpl.java
@@ -62,7 +62,7 @@ private long mNativeDownloadImpl; private boolean mDisableNotification; - private int mNotificationId; + private final int mNotificationId; private NotificationCompat.Builder mBuilder; private static boolean sCreatedChannel = false; private static final HashMap<Integer, DownloadImpl> sMap = new HashMap<Integer, DownloadImpl>(); @@ -131,9 +131,10 @@ return nextId; } - public DownloadImpl(IDownloadCallbackClient client, long nativeDownloadImpl) { + public DownloadImpl(IDownloadCallbackClient client, long nativeDownloadImpl, int id) { mClient = client; mNativeDownloadImpl = nativeDownloadImpl; + mNotificationId = id; try { mClientDownload = client.createClientDownload(this); } catch (RemoteException e) { @@ -299,7 +300,6 @@ if (!sCreatedChannel) createNotificationChannel(); - mNotificationId = getNextNotificationId(); sMap.put(Integer.valueOf(mNotificationId), this); Intent deleteIntent = createIntent();
diff --git a/weblayer/public/java/org/chromium/weblayer/CookieChangedCallback.java b/weblayer/public/java/org/chromium/weblayer/CookieChangedCallback.java index 00b375e..9224097 100644 --- a/weblayer/public/java/org/chromium/weblayer/CookieChangedCallback.java +++ b/weblayer/public/java/org/chromium/weblayer/CookieChangedCallback.java
@@ -4,11 +4,13 @@ package org.chromium.weblayer; +import androidx.annotation.NonNull; + /** * Callback used to listen for cookie changes. * * @since 83 */ public abstract class CookieChangedCallback { - public abstract void onCookieChanged(String cookie, @CookieChangeCause int cause); + public abstract void onCookieChanged(@NonNull String cookie, @CookieChangeCause int cause); }
diff --git a/weblayer/public/java/org/chromium/weblayer/CrashReporterCallback.java b/weblayer/public/java/org/chromium/weblayer/CrashReporterCallback.java index 0cc11d8..0e73360a5 100644 --- a/weblayer/public/java/org/chromium/weblayer/CrashReporterCallback.java +++ b/weblayer/public/java/org/chromium/weblayer/CrashReporterCallback.java
@@ -4,6 +4,8 @@ package org.chromium.weblayer; +import androidx.annotation.NonNull; + /** * Callback object for results of asynchronous {@link CrashReporterController} operations. */ @@ -14,14 +16,14 @@ * * @param localIds an array of crash report IDs available to be uploaded. */ - public void onPendingCrashReports(String[] localIds) {} + public void onPendingCrashReports(@NonNull String[] localIds) {} /** * Called when a crash has been deleted. * * @param localId the local identifier of the crash that was deleted. */ - public void onCrashDeleted(String localId) {} + public void onCrashDeleted(@NonNull String localId) {} /** * Called when a crash has been uploaded. @@ -29,7 +31,7 @@ * @param localId the local identifier of the crash that was uploaded. * @param reportId the remote identifier for the uploaded crash. */ - public void onCrashUploadSucceeded(String localId, String reportId) {} + public void onCrashUploadSucceeded(@NonNull String localId, @NonNull String reportId) {} /** * Called when a crash failed to upload. @@ -37,5 +39,5 @@ * @param localId the local identifier of the crash that failed to upload. * @param failureReason a free text string giving the failure reason. */ - public void onCrashUploadFailed(String localId, String faulreReason) {} + public void onCrashUploadFailed(@NonNull String localId, @NonNull String faulreReason) {} }
diff --git a/weblayer/public/java/org/chromium/weblayer/CrashReporterController.java b/weblayer/public/java/org/chromium/weblayer/CrashReporterController.java index 7f806b3..f353173 100644 --- a/weblayer/public/java/org/chromium/weblayer/CrashReporterController.java +++ b/weblayer/public/java/org/chromium/weblayer/CrashReporterController.java
@@ -91,7 +91,7 @@ * * @param localId a crash identifier. */ - public void deleteCrash(String localId) { + public void deleteCrash(@NonNull String localId) { try { mImpl.deleteCrash(localId); } catch (RemoteException e) { @@ -110,7 +110,7 @@ * * @param localId a crash identifier. */ - public void uploadCrash(String localId) { + public void uploadCrash(@NonNull String localId) { try { mImpl.uploadCrash(localId); } catch (RemoteException e) {
diff --git a/weblayer/public/java/org/chromium/weblayer/Tab.java b/weblayer/public/java/org/chromium/weblayer/Tab.java index feb120f4..f87738f3 100644 --- a/weblayer/public/java/org/chromium/weblayer/Tab.java +++ b/weblayer/public/java/org/chromium/weblayer/Tab.java
@@ -285,6 +285,7 @@ * @return the unique id. * @since 82 */ + @NonNull public String getGuid() { ThreadCheck.ensureOnUiThread(); if (WebLayer.getSupportedMajorVersionInternal() < 82) {
diff --git a/weblayer/public/java/org/chromium/weblayer/TabCallback.java b/weblayer/public/java/org/chromium/weblayer/TabCallback.java index 5f22835..31267e2 100644 --- a/weblayer/public/java/org/chromium/weblayer/TabCallback.java +++ b/weblayer/public/java/org/chromium/weblayer/TabCallback.java
@@ -29,7 +29,7 @@ * Triggered when a context menu should be displayed. * Added in M82. */ - public void showContextMenu(ContextMenuParams params) {} + public void showContextMenu(@NonNull ContextMenuParams params) {} /** * Triggered when a tab's contents have been rendered inactive due to a modal overlay, or active
diff --git a/weblayer/public/java/org/chromium/weblayer/UrlBarController.java b/weblayer/public/java/org/chromium/weblayer/UrlBarController.java index 96a2b96b..ecfaf24e 100644 --- a/weblayer/public/java/org/chromium/weblayer/UrlBarController.java +++ b/weblayer/public/java/org/chromium/weblayer/UrlBarController.java
@@ -7,6 +7,8 @@ import android.os.RemoteException; import android.view.View; +import androidx.annotation.NonNull; + import org.chromium.weblayer_private.interfaces.APICallException; import org.chromium.weblayer_private.interfaces.IUrlBarController; import org.chromium.weblayer_private.interfaces.ObjectWrapper; @@ -31,7 +33,8 @@ * @param options The options provided to tweak the URL bar display. * @since 82 */ - public View createUrlBarView(UrlBarOptions options) { + @NonNull + public View createUrlBarView(@NonNull UrlBarOptions options) { ThreadCheck.ensureOnUiThread(); if (WebLayer.getSupportedMajorVersionInternal() < 82) { throw new UnsupportedOperationException();
diff --git a/weblayer/public/java/org/chromium/weblayer/UrlBarOptions.java b/weblayer/public/java/org/chromium/weblayer/UrlBarOptions.java index 26f77b6..6b8f46f 100644 --- a/weblayer/public/java/org/chromium/weblayer/UrlBarOptions.java +++ b/weblayer/public/java/org/chromium/weblayer/UrlBarOptions.java
@@ -6,6 +6,8 @@ import android.os.Bundle; +import androidx.annotation.NonNull; + /** * Class containing options to tweak the URL bar. */ @@ -39,6 +41,7 @@ * @param textSize The desired size of the URL bar text in scalable pixels. * The default is 14.0F and the minimum allowed size is 5.0F. */ + @NonNull public Builder setTextSizeSP(float textSize) { mOptions.putFloat(URL_TEXT_SIZE, textSize); return this; @@ -47,6 +50,7 @@ /** * Builds a UrlBarOptions object. */ + @NonNull public UrlBarOptions build() { return new UrlBarOptions(this); }
diff --git a/weblayer/public/java/org/chromium/weblayer/WebLayer.java b/weblayer/public/java/org/chromium/weblayer/WebLayer.java index 71e7cc2..3a317fe 100644 --- a/weblayer/public/java/org/chromium/weblayer/WebLayer.java +++ b/weblayer/public/java/org/chromium/weblayer/WebLayer.java
@@ -200,7 +200,7 @@ * * @return the supported version, or -1 if WebLayer is not available. */ - public static int getSupportedMajorVersion(Context context) { + public static int getSupportedMajorVersion(@NonNull Context context) { ThreadCheck.ensureOnUiThread(); context = context.getApplicationContext(); return getWebLayerLoader(context).getMajorVersion(); @@ -227,7 +227,8 @@ * string such as "79.0.3945.0", while {@link getSupportedMajorVersion} will only return the * major version integer (79 in the example). */ - public static String getSupportedFullVersion(Context context) { + @NonNull + public static String getSupportedFullVersion(@NonNull Context context) { ThreadCheck.ensureOnUiThread(); context = context.getApplicationContext(); return getWebLayerLoader(context).getVersion(); @@ -237,6 +238,7 @@ * Returns the Chrome version this client was built at. This will return a full version string * such as "79.0.3945.0". */ + @NonNull public static String getVersion() { ThreadCheck.ensureOnUiThread(); return WebLayerClientVersionConstants.PRODUCT_VERSION; @@ -277,14 +279,11 @@ } Class factoryClass = remoteClassLoader.loadClass( "org.chromium.weblayer_private.WebLayerFactoryImpl"); - // NOTE: the 20 comes from the previous scheme of incrementing versioning. It must - // remain at 20 for Chrome version 79. - // TODO(https://crbug.com/1031830): change 20 to -1 when tip of tree is at 83. mFactory = IWebLayerFactory.Stub.asInterface( (IBinder) factoryClass .getMethod("create", String.class, int.class, int.class) .invoke(null, WebLayerClientVersionConstants.PRODUCT_VERSION, - WebLayerClientVersionConstants.PRODUCT_MAJOR_VERSION, 20)); + WebLayerClientVersionConstants.PRODUCT_MAJOR_VERSION, -1)); available = mFactory.isClientSupported(); majorVersion = mFactory.getImplementationMajorVersion(); version = mFactory.getImplementationVersion(); @@ -496,6 +495,7 @@ * * @since 81 */ + @NonNull public static Fragment createBrowserFragment( @Nullable String profileName, @Nullable String persistenceId) { ThreadCheck.ensureOnUiThread();