diff --git a/AUTHORS b/AUTHORS index c556566..b9d133f1 100644 --- a/AUTHORS +++ b/AUTHORS
@@ -413,6 +413,7 @@ Jacob Clark <jacob.jh.clark@googlemail.com> Jacob Mandelson <jacob@mandelson.org> Jaehun Lim <ljaehun.lim@samsung.com> +Jaehyun Ko <jaehyun.dev@gmail.com> Jaehyun Lee <j-hyun.lee@samsung.com> Jaekyeom Kim <btapiz@gmail.com> Jaemin Seo <jaemin86.seo@samsung.com> @@ -822,6 +823,7 @@ Ravi Phaneendra Kasibhatla <r.kasibhatla@samsung.com> Ravi Phaneendra Kasibhatla <ravi.kasibhatla@motorola.com> Raviraj Sitaram <raviraj.p.sitaram@intel.com> +Reda Tawfik <redatawfik@noogler.google.com> Réda Housni Alaoui <alaoui.rda@gmail.com> Refael Ackermann <refack@gmail.com> Renata Hodovan <rhodovan.u-szeged@partner.samsung.com>
diff --git a/DEPS b/DEPS index 16b94ad..f15ce50 100644 --- a/DEPS +++ b/DEPS
@@ -195,11 +195,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': '74a7a81b984c93e7a8682d5096ea674c40fac663', + 'skia_revision': '7b9da25e1b8b893a063879908ac9eba9323868d0', # 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': 'd6c02e4a7fc7051ff7d194041f222acf26fee1e5', + 'v8_revision': '953fc9e3d3661002171cf00cbacdd7a673cf5332', # 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. @@ -207,11 +207,11 @@ # 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': '382e698da1996ab3e086de6817ec175d6073f623', + 'angle_revision': 'fba96e90cf66bad35d6328cb6b70c7bffd3278f6', # 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': '4568d8587998b3db6c25ba7def35105ee1c31f42', + 'swiftshader_revision': '0e6261985136ffcf0cfea48c34939b3e36888307', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling PDFium # and whatever else without interference from each other. @@ -266,7 +266,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': '6d143ae8af4efab8ad440d0e895aac01a62b4f5b', + 'devtools_frontend_revision': '45929d74770b4f616a179cce7b93f9d6ecde75a3', # 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. @@ -318,7 +318,7 @@ # Three lines of non-changing comments so that # the commit queue can handle CLs rolling feed # and whatever else without interference from each other. - 'dawn_revision': 'eac38cfbc1dee9080a31350c43a538e9f0e8f372', + 'dawn_revision': '1ea3a22f521ef0e0c7ed4ba9f41ac56b5157a7f0', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling feed # and whatever else without interference from each other. @@ -831,7 +831,7 @@ }, 'src/third_party/breakpad/breakpad': - Var('chromium_git') + '/breakpad/breakpad.git' + '@' + '2757a2c9c819fcae3784576aef0c8400c7ad06d7', + Var('chromium_git') + '/breakpad/breakpad.git' + '@' + 'a6218eb66d7b4880825168a83e66bfea746908a6', 'src/third_party/byte_buddy': { 'packages': [ @@ -875,7 +875,7 @@ # Build tools for Chrome OS. 'src/third_party/chromite': { - 'url': Var('chromium_git') + '/chromiumos/chromite.git' + '@' + 'de0ed93bda6323335cf84bc3d33e3aa848786a65', + 'url': Var('chromium_git') + '/chromiumos/chromite.git' + '@' + '963bc42f87194b3d8707eafc9214ad70e65ab77d', 'condition': 'checkout_chromeos', }, @@ -895,7 +895,7 @@ }, 'src/third_party/depot_tools': - Var('chromium_git') + '/chromium/tools/depot_tools.git' + '@' + '98b332f2dbbd25add6b0904cc9d01608ceeaa52d', + Var('chromium_git') + '/chromium/tools/depot_tools.git' + '@' + '6c7b829e54738b0f532871b9f6dde15cf2c05373', 'src/third_party/devtools-frontend/src': Var('chromium_git') + '/devtools/devtools-frontend' + '@' + Var('devtools_frontend_revision'), @@ -1248,7 +1248,7 @@ }, 'src/third_party/perfetto': - Var('android_git') + '/platform/external/perfetto.git' + '@' + '4b656a010be50665d73995d66c5f5a544262b10f', + Var('android_git') + '/platform/external/perfetto.git' + '@' + '9a482652ab182496ba1ea2d3f391b187f5ff80f7', 'src/third_party/perl': { 'url': Var('chromium_git') + '/chromium/deps/perl.git' + '@' + '6f3e5028eb65d0b4c5fdd792106ac4c84eee1eb3', @@ -1537,7 +1537,7 @@ Var('chromium_git') + '/v8/v8.git' + '@' + Var('v8_revision'), 'src-internal': { - 'url': 'https://chrome-internal.googlesource.com/chrome/src-internal.git@981002aea991551f0f26639a5a8d3db42196881a', + 'url': 'https://chrome-internal.googlesource.com/chrome/src-internal.git@9dedfc814fbb91b7132d65baea3d4606419600c2', 'condition': 'checkout_src_internal', },
diff --git a/WATCHLISTS b/WATCHLISTS index 7bc4ff8..8cc6a9b 100644 --- a/WATCHLISTS +++ b/WATCHLISTS
@@ -2159,7 +2159,8 @@ 'hanxi+watch@chromium.org', 'pkotwicz+watch@chromium.org'], 'base': ['vmpstr+watch@chromium.org'], - 'base_allocator': ['wfh+watch@chromium.org'], + 'base_allocator': ['wfh+watch@chromium.org', + 'lizeb+watch@chromium.org'], 'base_memory': ['gavinp+memory@chromium.org'], 'base_scheduler': ['scheduler-bugs+base@chromium.org'], 'base_thread_pool': ['fdoray+watch@chromium.org',
diff --git a/android_webview/glue/java/src/com/android/webview/chromium/WebViewChromiumFactoryProvider.java b/android_webview/glue/java/src/com/android/webview/chromium/WebViewChromiumFactoryProvider.java index 36ab09c..5c5c68b 100644 --- a/android_webview/glue/java/src/com/android/webview/chromium/WebViewChromiumFactoryProvider.java +++ b/android_webview/glue/java/src/com/android/webview/chromium/WebViewChromiumFactoryProvider.java
@@ -17,7 +17,6 @@ import android.view.ViewGroup; import android.webkit.CookieManager; import android.webkit.GeolocationPermissions; -import android.webkit.PacProcessor; import android.webkit.ServiceWorkerController; import android.webkit.TokenBindingService; import android.webkit.TracingController; @@ -716,9 +715,4 @@ getSingleton().getBrowserContextOnUiThread().setWebLayerRunningInSameProcess(); }); } - - @Override - public PacProcessor getPacProcessor() { - return PacProcessorImpl.getInstance(); - } }
diff --git a/android_webview/glue/java/src/com/android/webview/chromium/WebViewChromiumFactoryProviderForR.java b/android_webview/glue/java/src/com/android/webview/chromium/WebViewChromiumFactoryProviderForR.java index 925594aa..f06585a 100644 --- a/android_webview/glue/java/src/com/android/webview/chromium/WebViewChromiumFactoryProviderForR.java +++ b/android_webview/glue/java/src/com/android/webview/chromium/WebViewChromiumFactoryProviderForR.java
@@ -4,6 +4,8 @@ package com.android.webview.chromium; +import android.webkit.PacProcessor; + class WebViewChromiumFactoryProviderForR extends WebViewChromiumFactoryProvider { public static WebViewChromiumFactoryProvider create(android.webkit.WebViewDelegate delegate) { return new WebViewChromiumFactoryProviderForR(delegate); @@ -12,4 +14,9 @@ protected WebViewChromiumFactoryProviderForR(android.webkit.WebViewDelegate delegate) { super(delegate); } + + @Override + public PacProcessor getPacProcessor() { + return PacProcessorImpl.getInstance(); + } }
diff --git a/ash/ambient/ambient_controller.cc b/ash/ambient/ambient_controller.cc index 0eafbe63..cebeccd 100644 --- a/ash/ambient/ambient_controller.cc +++ b/ash/ambient/ambient_controller.cc
@@ -25,6 +25,7 @@ #include "ash/system/power/power_status.h" #include "base/bind.h" #include "base/bind_helpers.h" +#include "base/check.h" #include "base/memory/weak_ptr.h" #include "base/time/time.h" #include "base/timer/timer.h" @@ -35,6 +36,7 @@ #include "chromeos/dbus/power_manager/idle.pb.h" #include "chromeos/services/assistant/public/cpp/assistant_service.h" #include "components/prefs/pref_registry_simple.h" +#include "components/prefs/pref_service.h" #include "ui/base/ui_base_types.h" #include "ui/views/widget/widget.h" #include "ui/wm/core/visibility_controller.h" @@ -109,6 +111,16 @@ return mode == AmbientUiMode::kInSessionUi; } +bool IsAmbientModeEnabled() { + if (!AmbientClient::Get()->IsAmbientModeAllowed()) + return false; + + ash::SessionControllerImpl* controller = Shell::Get()->session_controller(); + PrefService* prefs = controller->GetActivePrefService(); + DCHECK(prefs); + return prefs->GetBoolean(ambient::prefs::kAmbientModeEnabled); +} + } // namespace // AmbientController::InactivityMonitor---------------------------------- @@ -256,7 +268,7 @@ } void AmbientController::OnLockStateChanged(bool locked) { - if (!AmbientClient::Get()->IsAmbientModeAllowed()) { + if (!IsAmbientModeEnabled()) { VLOG(1) << "Ambient mode is not allowed."; return; } @@ -339,7 +351,7 @@ void AmbientController::ScreenIdleStateChanged( const power_manager::ScreenIdleState& idle_state) { - if (!AmbientClient::Get()->IsAmbientModeAllowed()) + if (!IsAmbientModeEnabled()) return; if (!idle_state.dimmed()) @@ -366,7 +378,9 @@ } void AmbientController::ShowUi(AmbientUiMode mode) { - if (!AmbientClient::Get()->IsAmbientModeAllowed()) { + // TODO(meilinw): move the eligibility check to the idle entry point once + // implemented: b/149246117. + if (!IsAmbientModeEnabled()) { LOG(WARNING) << "Ambient mode is not allowed."; return; }
diff --git a/ash/app_list/views/apps_grid_view.cc b/ash/app_list/views/apps_grid_view.cc index 36d4a09..d53ee0b 100644 --- a/ash/app_list/views/apps_grid_view.cc +++ b/ash/app_list/views/apps_grid_view.cc
@@ -116,14 +116,6 @@ // apps grid view. constexpr int kEndCardifiedAnimationDuration = 350; -// The background card opacity of the active apps grid page, when background -// cards are shown. -constexpr float kBackgroundCardOpacityActivePage = 0.2f; - -// The background card opacity of inactive apps grid pages, when background -// cards are shown. -constexpr float kBackgroundCardOpacityInactivePage = 0.1f; - // The opacity for the background cards when hidden. constexpr float kBackgroundCardOpacityHide = 0.0f; @@ -360,6 +352,17 @@ AppListFolderItem::FOLDER_TYPE_OEM; } +// Returns the relative horizontal position of a point compared to a rect. -1 +// means the point is outside on the left side of the rect. 0 means the point is +// within the rect. 1 means it's on the right side of the rect. +int CompareHorizontalPointPositionToRect(gfx::Point point, gfx::Rect bounds) { + if (point.x() > bounds.right()) + return 1; + if (point.x() < bounds.x()) + return -1; + return 0; +} + } // namespace std::string GridIndex::ToString() const { @@ -744,6 +747,14 @@ MaybeStartPageFlipTimer(last_drag_point_); + if (cardified_state_) { + int hovered_page = GetPageFlipTargetForDrag(last_drag_point_); + if (hovered_page == -1) + hovered_page = pagination_model_.selected_page(); + + SetHighlightedBackgroundCard(hovered_page); + } + if (last_drop_target != drop_target_ || last_drop_target_region != drop_target_region_) { if (drop_target_region_ == ON_ITEM && DraggedItemCanEnterFolder() && @@ -1584,11 +1595,11 @@ const gfx::Rect& current, bool animate_target, const gfx::Rect& target) { - // Determine page of |current| and |target|. -1 means in the left invisible - // page, 0 is the center visible page and 1 means in the right invisible page. + // Determine page of |current| and |target|. const int current_page = - current.x() < 0 ? -1 : current.x() >= width() ? 1 : 0; - const int target_page = target.x() < 0 ? -1 : target.x() >= width() ? 1 : 0; + CompareHorizontalPointPositionToRect(current.origin(), GetLocalBounds()); + const int target_page = + CompareHorizontalPointPositionToRect(target.origin(), GetLocalBounds()); const int dir = current_page < target_page || (current_page == target_page && current.y() < target.y()) @@ -2295,7 +2306,7 @@ cardified_state_ = true; UpdateTilePadding(); for (int i = 0; i < pagination_model_.total_pages(); i++) - AppendBackgroundCard(kBackgroundCardOpacityHide); + AppendBackgroundCard(); MaybeCreateGradientMask(); AnimateCardifiedState(); } @@ -2381,13 +2392,13 @@ const bool is_active_page = background_cards_[pagination_model_.selected_page()] == background_card; - background_card->SetOpacity(is_active_page - ? kBackgroundCardOpacityActivePage - : kBackgroundCardOpacityInactivePage); + background_card->SetColor( + GetAppListConfig().GetCardifiedBackgroundColor(is_active_page)); } else { background_card->SetOpacity(kBackgroundCardOpacityHide); } } + highlighted_page_ = pagination_model_.selected_page(); } void AppsGridView::RecenterItemsContainer() { @@ -2493,29 +2504,7 @@ void AppsGridView::MaybeStartPageFlipTimer(const gfx::Point& drag_point) { if (!IsPointWithinPageFlipBuffer(drag_point)) StopPageFlipTimer(); - int new_page_flip_target = -1; - - // Drag zones are at the edges of the scroll axis. - if (pagination_controller_->scroll_axis() == - PaginationController::SCROLL_AXIS_VERTICAL) { - if (drag_point.y() < - GetAppListConfig().page_flip_zone_size() + GetInsets().top()) { - new_page_flip_target = pagination_model_.selected_page() - 1; - } else if (IsPointWithinBottomDragBuffer(drag_point)) { - // If the drag point is within the drag buffer, but not over the shelf. - new_page_flip_target = pagination_model_.selected_page() + 1; - } - } else { - // TODO(xiyuan): Fix this for RTL. - if (new_page_flip_target == -1 && - drag_point.x() < GetAppListConfig().page_flip_zone_size()) - new_page_flip_target = pagination_model_.selected_page() - 1; - - if (new_page_flip_target == -1 && - drag_point.x() > width() - GetAppListConfig().page_flip_zone_size()) { - new_page_flip_target = pagination_model_.selected_page() + 1; - } - } + int new_page_flip_target = GetPageFlipTargetForDrag(drag_point); if (new_page_flip_target == page_flip_target_) return; @@ -2990,11 +2979,10 @@ Layout(); } -void AppsGridView::AppendBackgroundCard(float opacity) { +void AppsGridView::AppendBackgroundCard() { background_cards_.push_back( std::make_unique<ui::Layer>(ui::LAYER_SOLID_COLOR)); ui::Layer* current_layer = background_cards_.back().get(); - current_layer->SetColor(gfx::kGoogleGrey100); // The size of the grid excluding the outer padding. const gfx::Size grid_size = GetTileGridSize(); // The size for the background card that will be displayed. The outer padding @@ -3021,7 +3009,6 @@ horizontal_padding, vertical_padding + vertical_page_start_offset, background_card_size.width() - 2 * kCardifiedHorizontalPadding, background_card_size.height())); - current_layer->SetOpacity(opacity); current_layer->SetVisible(true); current_layer->SetRoundedCornerRadius( gfx::RoundedCornersF(kBackgroundCardCornerRadius)); @@ -3066,8 +3053,9 @@ const int page_difference = new_page_count - previous_page_count; if (page_difference > 0) { - for (int i = previous_page_count; i < new_page_count; ++i) - AppendBackgroundCard(kBackgroundCardOpacityHide); + for (int i = background_cards_.size(); i <= new_page_count; ++i) { + AppendBackgroundCard(); + } } else { for (int i = 0; i < page_difference; ++i) RemoveBackgroundCard(); @@ -3110,12 +3098,6 @@ } Layout(); } - if (cardified_state_) { - background_cards_[old_selected]->SetOpacity( - kBackgroundCardOpacityInactivePage); - background_cards_[new_selected]->SetOpacity( - kBackgroundCardOpacityActivePage); - } } void AppsGridView::TransitionStarting() { @@ -3969,4 +3951,48 @@ } } +int AppsGridView::GetPageFlipTargetForDrag(const gfx::Point& drag_point) { + int new_page_flip_target = -1; + + // Drag zones are at the edges of the scroll axis. + if (pagination_controller_->scroll_axis() == + PaginationController::SCROLL_AXIS_VERTICAL) { + if (drag_point.y() < + GetAppListConfig().page_flip_zone_size() + GetInsets().top()) { + new_page_flip_target = pagination_model_.selected_page() - 1; + } else if (IsPointWithinBottomDragBuffer(drag_point)) { + // If the drag point is within the drag buffer, but not over the shelf. + new_page_flip_target = pagination_model_.selected_page() + 1; + } + } else { + // TODO(xiyuan): Fix this for RTL. + if (new_page_flip_target == -1 && + drag_point.x() < GetAppListConfig().page_flip_zone_size()) + new_page_flip_target = pagination_model_.selected_page() - 1; + + if (new_page_flip_target == -1 && + drag_point.x() > width() - GetAppListConfig().page_flip_zone_size()) { + new_page_flip_target = pagination_model_.selected_page() + 1; + } + } + return new_page_flip_target; +} + +void AppsGridView::SetHighlightedBackgroundCard(int new_highlighted_page) { + if (!IsValidPageFlipTarget(new_highlighted_page)) + return; + + if (new_highlighted_page != highlighted_page_) { + background_cards_[highlighted_page_]->SetColor( + GetAppListConfig().GetCardifiedBackgroundColor( + /*is_active=*/false)); + if (static_cast<int>(background_cards_.size()) == new_highlighted_page) + AppendBackgroundCard(); + background_cards_[new_highlighted_page]->SetColor( + GetAppListConfig().GetCardifiedBackgroundColor(/*is_active=*/true)); + + highlighted_page_ = new_highlighted_page; + } +} + } // namespace ash
diff --git a/ash/app_list/views/apps_grid_view.h b/ash/app_list/views/apps_grid_view.h index 77841ce8..3c1ab15 100644 --- a/ash/app_list/views/apps_grid_view.h +++ b/ash/app_list/views/apps_grid_view.h
@@ -311,9 +311,8 @@ // Translates the items container view to center the current page in the apps // grid. void RecenterItemsContainer(); - // Appends a background card to the back of |background_cards_| with a defined - // |opacity|. - void AppendBackgroundCard(float opacity); + // Appends a background card to the back of |background_cards_|. + void AppendBackgroundCard(); // Removes the background card at the end of |background_cards_|. void RemoveBackgroundCard(); // Masks the apps grid container to background cards bounds. @@ -741,6 +740,12 @@ // Create a layer mask for graident alpha when the feature is enabled. void MaybeCreateGradientMask(); + // Obtains the target page to flip for |drag_point|. + int GetPageFlipTargetForDrag(const gfx::Point& drag_point); + + // Updates the highlighted background card. Used only for cardified state. + void SetHighlightedBackgroundCard(int new_highlighted_page); + AppListModel* model_ = nullptr; // Owned by AppListView. AppListItemList* item_list_ = nullptr; // Not owned. @@ -906,6 +911,9 @@ // recent drag on AppsGridView instead of the app icon. gfx::PointF last_mouse_drag_point_; + // The highlighted page during cardified state. + int highlighted_page_ = -1; + // Layer array for apps grid background cards. Used to display the background // card during cardified state. std::vector<std::unique_ptr<ui::Layer>> background_cards_;
diff --git a/ash/clipboard/clipboard_history_controller.cc b/ash/clipboard/clipboard_history_controller.cc index e6e5145e..73fe8c9 100644 --- a/ash/clipboard/clipboard_history_controller.cc +++ b/ash/clipboard/clipboard_history_controller.cc
@@ -140,15 +140,6 @@ } void ClipboardHistoryController::ShowMenu() { - auto* host = ash::GetWindowTreeHostForDisplay( - display::Screen::GetScreen()->GetPrimaryDisplay().id()); - // Some web apps render the caret in an IFrame, and we will not get the - // bounds in that case. - // TODO(https://crbug.com/1099930): Show the menu in the middle of the - // webview if the bounds are empty. - const gfx::Rect textfield_bounds = - host->GetInputMethod()->GetTextInputClient()->GetCaretBounds(); - if (!CanShowMenu()) return; @@ -175,7 +166,7 @@ context_menu_ = std::make_unique<ClipboardHistoryMenuModelAdapter>(std::move(menu_model)); - context_menu_->Run(textfield_bounds); + context_menu_->Run(CalculateAnchorRect()); } void ClipboardHistoryController::MenuOptionSelected(int index) { @@ -219,4 +210,46 @@ base::TimeDelta::FromMilliseconds(100)); } +bool ClipboardHistoryController::IsMenuShowing() const { + return context_menu_ && context_menu_->IsRunning(); +} + +gfx::Rect ClipboardHistoryController::GetClipboardHistoryMenuBoundsForTest() + const { + return context_menu_->GetClipboardHistoryMenuBoundsForTest(); +} + +gfx::Rect ClipboardHistoryController::CalculateAnchorRect() const { + display::Display display = display::Screen::GetScreen()->GetPrimaryDisplay(); + auto* host = ash::GetWindowTreeHostForDisplay(display.id()); + + // Some web apps render the caret in an IFrame, and we will not get the + // bounds in that case. + // TODO(https://crbug.com/1099930): Show the menu in the middle of the + // webview if the bounds are empty. + ui::TextInputClient* text_input_client = + host->GetInputMethod()->GetTextInputClient(); + + // |text_input_client| may be null. For example, in clamshell mode and without + // any window open. + const gfx::Rect textfield_bounds = + text_input_client ? text_input_client->GetCaretBounds() : gfx::Rect(); + + // Note that the width of caret's bounds may be zero in some views (such as + // the search bar of Google search web page). So we cannot use + // gfx::Size::IsEmpty() here. In addition, the applications using IFrame may + // provide unreliable |textfield_bounds| which are not fully contained by the + // display bounds. + // TODO(https://crbug.com/1110027). + const bool textfield_bounds_are_valid = + textfield_bounds.size() != gfx::Size() && + display.bounds().Contains(textfield_bounds); + + if (textfield_bounds_are_valid) + return textfield_bounds; + + return gfx::Rect(display::Screen::GetScreen()->GetCursorScreenPoint(), + gfx::Size()); +} + } // namespace ash
diff --git a/ash/clipboard/clipboard_history_controller.h b/ash/clipboard/clipboard_history_controller.h index 60aa4918..662d6a00 100644 --- a/ash/clipboard/clipboard_history_controller.h +++ b/ash/clipboard/clipboard_history_controller.h
@@ -8,6 +8,7 @@ #include <memory> #include <vector> +#include "ash/ash_export.h" #include "base/memory/weak_ptr.h" #include "ui/base/models/simple_menu_model.h" @@ -22,7 +23,7 @@ // Shows a menu with the last few things saved in the clipboard when the // keyboard shortcut is pressed. -class ClipboardHistoryController { +class ASH_EXPORT ClipboardHistoryController { public: ClipboardHistoryController(); ClipboardHistoryController(const ClipboardHistoryController&) = delete; @@ -42,9 +43,15 @@ // Called when a menu option is selected. void MenuOptionSelected(int index); + bool IsMenuShowing() const; + + gfx::Rect GetClipboardHistoryMenuBoundsForTest() const; + ClipboardHistory* clipboard_history() { return clipboard_history_.get(); } private: + gfx::Rect CalculateAnchorRect() const; + // The menu being shown. std::unique_ptr<ClipboardHistoryMenuModelAdapter> context_menu_; // Used to keep track of what is being copied to the clipboard.
diff --git a/ash/clipboard/clipboard_history_menu_model_adapter.cc b/ash/clipboard/clipboard_history_menu_model_adapter.cc index 2901cd4..d287c36 100644 --- a/ash/clipboard/clipboard_history_menu_model_adapter.cc +++ b/ash/clipboard/clipboard_history_menu_model_adapter.cc
@@ -10,6 +10,7 @@ #include "ui/views/controls/menu/menu_item_view.h" #include "ui/views/controls/menu/menu_runner.h" #include "ui/views/controls/menu/menu_types.h" +#include "ui/views/controls/menu/submenu_view.h" namespace ash { @@ -33,4 +34,13 @@ views::MenuAnchorPosition::kBubbleRight, ui::MENU_SOURCE_KEYBOARD); } -} // namespace ash \ No newline at end of file +bool ClipboardHistoryMenuModelAdapter::IsRunning() const { + return menu_runner_ && menu_runner_->IsRunning(); +} + +gfx::Rect +ClipboardHistoryMenuModelAdapter::GetClipboardHistoryMenuBoundsForTest() const { + return root_view_->GetSubmenu()->GetBoundsInScreen(); +} + +} // namespace ash
diff --git a/ash/clipboard/clipboard_history_menu_model_adapter.h b/ash/clipboard/clipboard_history_menu_model_adapter.h index ccd4b28e2..e5d5012 100644 --- a/ash/clipboard/clipboard_history_menu_model_adapter.h +++ b/ash/clipboard/clipboard_history_menu_model_adapter.h
@@ -39,6 +39,10 @@ // Shows the menu, anchored below |anchor_rect|. void Run(const gfx::Rect& anchor_rect); + bool IsRunning() const; + + gfx::Rect GetClipboardHistoryMenuBoundsForTest() const; + private: // The model which holds the contents of the menu. std::unique_ptr<ui::SimpleMenuModel> const model_; @@ -51,4 +55,4 @@ } // namespace ash -#endif // ASH_CLIPBOARD_CLIPBOARD_HISTORY_MENU_MODEL_ADAPTER_H_ \ No newline at end of file +#endif // ASH_CLIPBOARD_CLIPBOARD_HISTORY_MENU_MODEL_ADAPTER_H_
diff --git a/ash/public/cpp/app_list/app_list_config.cc b/ash/public/cpp/app_list/app_list_config.cc index ba5d187..12b8a300 100644 --- a/ash/public/cpp/app_list/app_list_config.cc +++ b/ash/public/cpp/app_list/app_list_config.cc
@@ -325,7 +325,10 @@ all_apps_opacity_start_px_(8.0f), all_apps_opacity_end_px_(144.0f), search_result_title_font_style_(ui::ResourceBundle::BaseFont), - search_tile_height_(92) {} + search_tile_height_(92), + cardified_background_color_(SkColorSetA(SK_ColorWHITE, 26 /* 10% */)), + cardified_background_color_active_( + SkColorSetA(SK_ColorWHITE, 41 /* 16% */)) {} AppListConfig::AppListConfig(const AppListConfig& base_config, float scale_x, @@ -469,7 +472,10 @@ all_apps_opacity_end_px_(base_config.all_apps_opacity_end_px_), search_result_title_font_style_( base_config.search_result_title_font_style_), - search_tile_height_(base_config.search_tile_height_) {} + search_tile_height_(base_config.search_tile_height_), + cardified_background_color_(base_config.cardified_background_color_), + cardified_background_color_active_( + base_config.cardified_background_color_active_) {} AppListConfig::~AppListConfig() = default; @@ -523,4 +529,9 @@ return available_bounds.height() / kAppsGridMarginRatio; } +SkColor AppListConfig::GetCardifiedBackgroundColor(bool is_active) const { + return is_active ? cardified_background_color_active_ + : cardified_background_color_; +} + } // namespace ash
diff --git a/ash/public/cpp/app_list/app_list_config.h b/ash/public/cpp/app_list/app_list_config.h index 43a9d23..fe9a8dc 100644 --- a/ash/public/cpp/app_list/app_list_config.h +++ b/ash/public/cpp/app_list/app_list_config.h
@@ -239,6 +239,9 @@ int GetIdealHorizontalMargin(const gfx::Rect& abailable_bounds) const; int GetIdealVerticalMargin(const gfx::Rect& abailable_bounds) const; + // Returns the color and opacity for the page background. + SkColor GetCardifiedBackgroundColor(bool is_active) const; + private: const AppListConfigType type_; @@ -459,6 +462,10 @@ // Max number of search result list items in the launcher suggestion window. const size_t max_search_result_list_items_ = 5; + // Cardified app list background properties + const SkColor cardified_background_color_; + const SkColor cardified_background_color_active_; + DISALLOW_COPY_AND_ASSIGN(AppListConfig); };
diff --git a/ash/public/cpp/test/test_ambient_client.h b/ash/public/cpp/test/test_ambient_client.h index 513b843..0ac6add 100644 --- a/ash/public/cpp/test/test_ambient_client.h +++ b/ash/public/cpp/test/test_ambient_client.h
@@ -15,7 +15,7 @@ namespace ash { // An implementation for test support. -// IsAmbientModeAllowedForProfile() returns true to run the unittests. +// IsAmbientModeAllowed() returns true to run the unittests. class ASH_PUBLIC_EXPORT TestAmbientClient : public AmbientClient { public: explicit TestAmbientClient(device::TestWakeLockProvider* wake_lock_provider);
diff --git a/ash/system/overview/overview_button_tray_unittest.cc b/ash/system/overview/overview_button_tray_unittest.cc index ba5f4f0..f9f18f5 100644 --- a/ash/system/overview/overview_button_tray_unittest.cc +++ b/ash/system/overview/overview_button_tray_unittest.cc
@@ -426,6 +426,9 @@ // Tests that the tray remains visible when leaving tablet mode due to external // mouse being connected. TEST_F(OverviewButtonTrayTest, LeaveTabletModeBecauseExternalMouse) { + // Make sure no mouse is attached as that prevents tablet mode. + TabletModeControllerTestApi().DetachAllMice(); + TabletModeControllerTestApi().OpenLidToAngle(315.0f); EXPECT_TRUE(TabletModeControllerTestApi().IsTabletModeStarted()); ASSERT_TRUE(GetTray()->GetVisible()); @@ -438,6 +441,9 @@ // Using the developers keyboard shortcut to enable tablet mode should force the // overview tray button visible, even though the events are not blocked. TEST_F(OverviewButtonTrayTest, ForDevTabletModeForcesTheButtonShown) { + // Make sure no mouse is attached as that prevents tablet mode. + TabletModeControllerTestApi().DetachAllMice(); + Shell::Get()->tablet_mode_controller()->SetEnabledForDev(true); EXPECT_TRUE(TabletModeControllerTestApi().IsTabletModeStarted()); EXPECT_FALSE(TabletModeControllerTestApi().AreEventsBlocked());
diff --git a/ash/wm/overview/overview_session_unittest.cc b/ash/wm/overview/overview_session_unittest.cc index 6ed6548..55e40ca 100644 --- a/ash/wm/overview/overview_session_unittest.cc +++ b/ash/wm/overview/overview_session_unittest.cc
@@ -3500,8 +3500,9 @@ item_center, item_center + shift, base::TimeDelta::FromMilliseconds(10), 10); - ui::DrawWaiterForTest::WaitForCompositingStarted( - windows[0]->GetRootWindow()->layer()->GetCompositor()); + ui::Compositor* const compositor = + windows[0]->GetRootWindow()->layer()->GetCompositor(); + ui::DrawWaiterForTest::WaitForCompositingStarted(compositor); ASSERT_TRUE(grid_event_handler->IsFlingInProgressForTesting()); // Test that the scroll offset decreases as we advance the clock. Check the @@ -3516,6 +3517,7 @@ i < kMaxLoops && grid_event_handler->IsFlingInProgressForTesting(); ++i) { task_environment()->FastForwardBy(base::TimeDelta::FromMilliseconds(50)); + ui::DrawWaiterForTest::WaitForCompositingStarted(compositor); float scroll_offset = grid->scroll_offset(); EXPECT_LE(scroll_offset, previous_scroll_offset);
diff --git a/base/BUILD.gn b/base/BUILD.gn index 2922f48..fda1a07 100644 --- a/base/BUILD.gn +++ b/base/BUILD.gn
@@ -1263,6 +1263,7 @@ "//base/third_party/double_conversion", "//base/third_party/dynamic_annotations", "//build:branding_buildflags", + "//build:lacros_buildflags", "//third_party/modp_b64", ] @@ -1289,7 +1290,8 @@ # Needed for <atomic> if using newer C++ library than sysroot, except if # building inside the cros_sdk environment - use host_toolchain as a # more robust check for this. - if (!use_sysroot && (is_android || ((is_linux || is_chromeos) && !is_chromecast)) && + if (!use_sysroot && + (is_android || ((is_linux || is_chromeos) && !is_chromecast)) && host_toolchain != "//build/toolchain/cros:host") { libs += [ "atomic" ] } @@ -1317,7 +1319,8 @@ deps += [ "//base/allocator:tcmalloc" ] } else if ((is_linux || is_chromeos) && use_allocator == "none") { sources += [ "allocator/allocator_shim_default_dispatch_to_glibc.cc" ] - } else if ((is_linux || is_chromeos || is_android) && use_allocator == "partition") { + } else if ((is_linux || is_chromeos || is_android) && + use_allocator == "partition") { # Cannot use the same dispatching for host-side binaries. if (is_a_target_toolchain) { sources += [ @@ -1520,6 +1523,11 @@ ] } + # Lacros. + if (chromeos_is_browser_only) { + sources += [ "system/sys_info_chromeos.cc" ] + } + # Fuchsia. if (is_fuchsia) { sources += [ @@ -2926,6 +2934,7 @@ "//base/test:run_all_base_unittests", "//base/test:test_support", "//base/third_party/dynamic_annotations", + "//build:lacros_buildflags", "//testing/gmock", "//testing/gtest", "//third_party/icu", @@ -3590,6 +3599,7 @@ "android/java/src/org/chromium/base/supplier/DestroyableObservableSupplier.java", "android/java/src/org/chromium/base/supplier/ObservableSupplier.java", "android/java/src/org/chromium/base/supplier/ObservableSupplierImpl.java", + "android/java/src/org/chromium/base/supplier/OneShotCallback.java", "android/java/src/org/chromium/base/supplier/Supplier.java", "android/java/src/org/chromium/base/task/AsyncTask.java", "android/java/src/org/chromium/base/task/BackgroundOnlyAsyncTask.java", @@ -3830,6 +3840,7 @@ "android/junit/src/org/chromium/base/process_launcher/ChildConnectionAllocatorTest.java", "android/junit/src/org/chromium/base/process_launcher/ChildProcessConnectionTest.java", "android/junit/src/org/chromium/base/supplier/ObservableSupplierImplTest.java", + "android/junit/src/org/chromium/base/supplier/OneShotCallbackTest.java", "android/junit/src/org/chromium/base/task/AsyncTaskThreadTest.java", "android/junit/src/org/chromium/base/task/TaskTraitsTest.java", "android/junit/src/org/chromium/base/util/GarbageCollectionTestUtilsUnitTest.java",
diff --git a/base/allocator/allocator_shim.cc b/base/allocator/allocator_shim.cc index 9ac0e90..ea5d7b5 100644 --- a/base/allocator/allocator_shim.cc +++ b/base/allocator/allocator_shim.cc
@@ -10,7 +10,6 @@ #include <new> #include "base/allocator/buildflags.h" -#include "base/atomicops.h" #include "base/bits.h" #include "base/check_op.h" #include "base/macros.h" @@ -37,13 +36,12 @@ namespace { -base::subtle::AtomicWord g_chain_head = - reinterpret_cast<base::subtle::AtomicWord>( - &base::allocator::AllocatorDispatch::default_dispatch); +std::atomic<const base::allocator::AllocatorDispatch*> g_chain_head{ + &base::allocator::AllocatorDispatch::default_dispatch}; bool g_call_new_handler_on_malloc_failure = false; -inline size_t GetCachedPageSize() { +ALWAYS_INLINE size_t GetCachedPageSize() { static size_t pagesize = 0; if (!pagesize) pagesize = base::GetPageSize(); @@ -66,9 +64,8 @@ #endif } -inline const base::allocator::AllocatorDispatch* GetChainHead() { - return reinterpret_cast<const base::allocator::AllocatorDispatch*>( - base::subtle::NoBarrier_Load(&g_chain_head)); +ALWAYS_INLINE const base::allocator::AllocatorDispatch* GetChainHead() { + return g_chain_head.load(std::memory_order_relaxed); } } // namespace @@ -99,13 +96,11 @@ // we don't really want this to be a release-store with a corresponding // acquire-load during malloc(). std::atomic_thread_fence(std::memory_order_seq_cst); - subtle::AtomicWord old_value = - reinterpret_cast<subtle::AtomicWord>(chain_head); // Set the chain head to the new dispatch atomically. If we lose the race, - // the comparison will fail, and the new head of chain will be returned. - if (subtle::NoBarrier_CompareAndSwap( - &g_chain_head, old_value, - reinterpret_cast<subtle::AtomicWord>(dispatch)) == old_value) { + // retry. + if (g_chain_head.compare_exchange_strong(chain_head, dispatch, + std::memory_order_relaxed, + std::memory_order_relaxed)) { // Success. return; } @@ -116,8 +111,7 @@ void RemoveAllocatorDispatchForTesting(AllocatorDispatch* dispatch) { DCHECK_EQ(GetChainHead(), dispatch); - subtle::NoBarrier_Store(&g_chain_head, - reinterpret_cast<subtle::AtomicWord>(dispatch->next)); + g_chain_head.store(dispatch->next, std::memory_order_relaxed); } } // namespace allocator
diff --git a/base/allocator/allocator_shim_unittest.cc b/base/allocator/allocator_shim_unittest.cc index 56b1d950..11b00c270 100644 --- a/base/allocator/allocator_shim_unittest.cc +++ b/base/allocator/allocator_shim_unittest.cc
@@ -7,13 +7,13 @@ #include <stdlib.h> #include <string.h> +#include <atomic> #include <memory> #include <new> #include <vector> #include "base/allocator/buildflags.h" #include "base/allocator/partition_allocator/partition_alloc.h" -#include "base/atomicops.h" #include "base/process/process_metrics.h" #include "base/synchronization/waitable_event.h" #include "base/threading/platform_thread.h" @@ -23,8 +23,8 @@ #include "testing/gtest/include/gtest/gtest.h" #if defined(OS_WIN) -#include <windows.h> #include <malloc.h> +#include <windows.h> #elif defined(OS_APPLE) #include <malloc/malloc.h> #include "base/allocator/allocator_interception_mac.h" @@ -51,8 +51,8 @@ namespace allocator { namespace { -using testing::MockFunction; using testing::_; +using testing::MockFunction; // Special sentinel values used for testing GetSizeEstimate() interception. const char kTestSizeEstimateData[] = "test_value"; @@ -223,11 +223,11 @@ static void NewHandler() { if (!instance_) return; - subtle::Barrier_AtomicIncrement(&instance_->num_new_handler_calls, 1); + instance_->num_new_handler_calls.fetch_add(1, std::memory_order_relaxed); } int32_t GetNumberOfNewHandlerCalls() { - return subtle::Acquire_Load(&instance_->num_new_handler_calls); + return instance_->num_new_handler_calls.load(std::memory_order_acquire); } void SetUp() override { @@ -247,7 +247,7 @@ memset(&aligned_reallocs_intercepted_by_addr, 0, array_size); memset(&aligned_frees_intercepted_by_addr, 0, array_size); did_fail_realloc_0xfeed_once.reset(new ThreadLocalBoolean()); - subtle::Release_Store(&num_new_handler_calls, 0); + num_new_handler_calls.store(0, std::memory_order_release); instance_ = this; #if defined(OS_APPLE) @@ -278,7 +278,7 @@ size_t aligned_reallocs_intercepted_by_addr[kMaxSizeTracked]; size_t aligned_frees_intercepted_by_addr[kMaxSizeTracked]; std::unique_ptr<ThreadLocalBoolean> did_fail_realloc_0xfeed_once; - subtle::Atomic32 num_new_handler_calls; + std::atomic<uint32_t> num_new_handler_calls; private: static AllocatorShimTest* instance_; @@ -296,7 +296,8 @@ class ThreadDelegateForNewHandlerTest : public PlatformThread::Delegate { public: - ThreadDelegateForNewHandlerTest(WaitableEvent* event) : event_(event) {} + explicit ThreadDelegateForNewHandlerTest(WaitableEvent* event) + : event_(event) {} void ThreadMain() override { event_->Wait(); @@ -445,7 +446,7 @@ ASSERT_GE(allocs_intercepted_by_size[19], 1u); ChromeMallocZone* default_zone = - reinterpret_cast<ChromeMallocZone*>(malloc_default_zone()); + reinterpret_cast<ChromeMallocZone*>(malloc_default_zone()); default_zone->free_definite_size(malloc_default_zone(), alloc_ptr, 19); ASSERT_GE(free_definite_sizes_intercepted_by_size[19], 1u); RemoveAllocatorDispatchForTesting(&g_mock_dispatch);
diff --git a/base/android/java/src/org/chromium/base/supplier/OneShotCallback.java b/base/android/java/src/org/chromium/base/supplier/OneShotCallback.java new file mode 100644 index 0000000..680bad8 --- /dev/null +++ b/base/android/java/src/org/chromium/base/supplier/OneShotCallback.java
@@ -0,0 +1,58 @@ +// 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. + +package org.chromium.base.supplier; + +import androidx.annotation.NonNull; + +import org.chromium.base.Callback; + +import java.lang.ref.WeakReference; + +/** + * Helper class to handle safely querying a single instance of an object from an + * {@link ObservableSupplier}. + * + * Assuming the underlying {@link Supplier} gets set with a + * value, this class will guarantee only a single call makes it back to the passed in + * {@link Callback}. + * + * For {@link ObservableSupplier}s that already have a valid value set, this will have the same + * underlying behavior as {@link ObservableSupplierImpl}, which asynchronously triggers the callback + * when {@link ObservableSupplier#addObserver(Callback)} is called. + * + * This class does not hold a strong reference to the {@link ObservableSupplier}, but does hold a + * strong reference to the {@link Callback}. + * + * @param <E> The type of the wrapped object. + */ +public class OneShotCallback<E> { + private final Callback<E> mCallbackWrapper = new CallbackWrapper(); + private final WeakReference<ObservableSupplier<E>> mWeakSupplier; + private final Callback<E> mCallback; + + /** + * Creates a {@link OneShotCallback} instance, automatically registering as an observer to + * {@code supplier} and waiting to trigger {@code callback}. + * @param supplier The {@link ObservableSupplier} to wait for. + * @param callback The {@link Callback} to notify with a valid value. + */ + public OneShotCallback(@NonNull ObservableSupplier<E> supplier, @NonNull Callback<E> callback) { + mWeakSupplier = new WeakReference<>(supplier); + mCallback = callback; + + supplier.addObserver(mCallbackWrapper); + } + + private class CallbackWrapper implements Callback<E> { + @Override + public void onResult(E result) { + mCallback.onResult(result); + ObservableSupplier<E> supplier = mWeakSupplier.get(); + assert supplier + != null : "This can only be called by supplier, which should not be null."; + supplier.removeObserver(mCallbackWrapper); + } + } +} \ No newline at end of file
diff --git a/base/android/junit/src/org/chromium/base/supplier/OneShotCallbackTest.java b/base/android/junit/src/org/chromium/base/supplier/OneShotCallbackTest.java new file mode 100644 index 0000000..0d91072 --- /dev/null +++ b/base/android/junit/src/org/chromium/base/supplier/OneShotCallbackTest.java
@@ -0,0 +1,95 @@ +// 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.supplier; + +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.Mockito.never; +import static org.mockito.Mockito.times; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.verifyNoMoreInteractions; + +import android.os.Handler; + +import org.junit.Rule; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.mockito.Mock; +import org.mockito.junit.MockitoJUnit; +import org.mockito.junit.MockitoRule; +import org.robolectric.annotation.Config; + +import org.chromium.base.Callback; +import org.chromium.base.test.BaseRobolectricTestRunner; + +/** Unit tests for {@link OneShotCallback}. */ +@RunWith(BaseRobolectricTestRunner.class) +@Config(manifest = Config.NONE) +public class OneShotCallbackTest { + @Rule + public MockitoRule mMockitoRule = MockitoJUnit.rule(); + + @Mock + Callback<Integer> mCallbackMock; + + @Test + public void testNotCalledWithNoValue() { + Handler handler = new Handler(); + ObservableSupplierImpl<Integer> supplier = new ObservableSupplierImpl<>(); + + handler.post(() -> new OneShotCallback<>(supplier, mCallbackMock)); + + handler.post(() -> { verify(mCallbackMock, never()).onResult(any()); }); + } + + @Test + public void testCalledWithPresetValue() { + Handler handler = new Handler(); + ObservableSupplierImpl<Integer> supplier = new ObservableSupplierImpl<>(); + supplier.set(5); + + handler.post(() -> { new OneShotCallback<>(supplier, mCallbackMock); }); + + handler.post(() -> { verify(mCallbackMock, times(1)).onResult(5); }); + } + + @Test + public void testCalledWithSet() { + Handler handler = new Handler(); + ObservableSupplierImpl<Integer> supplier = new ObservableSupplierImpl<>(); + + handler.post(() -> new OneShotCallback<>(supplier, mCallbackMock)); + handler.post(() -> { verify(mCallbackMock, never()).onResult(any()); }); + + supplier.set(5); + handler.post(() -> { verify(mCallbackMock, times(1)).onResult(5); }); + } + + @Test + public void testNotCalledWithPresetValueOnlyOnce() { + Handler handler = new Handler(); + ObservableSupplierImpl<Integer> supplier = new ObservableSupplierImpl<>(); + supplier.set(5); + supplier.set(10); + + handler.post(() -> { new OneShotCallback<>(supplier, mCallbackMock); }); + + handler.post(() -> { verify(mCallbackMock, times(1)).onResult(10); }); + } + + @Test + public void testCalledWithSetOnlyOnce() { + Handler handler = new Handler(); + ObservableSupplierImpl<Integer> supplier = new ObservableSupplierImpl<>(); + + handler.post(() -> new OneShotCallback<>(supplier, mCallbackMock)); + handler.post(() -> { verify(mCallbackMock, never()).onResult(any()); }); + + supplier.set(5); + handler.post(() -> { verify(mCallbackMock, times(1)).onResult(5); }); + + supplier.set(10); + verifyNoMoreInteractions(mCallbackMock); + } +} \ No newline at end of file
diff --git a/base/system/sys_info.cc b/base/system/sys_info.cc index 31d2e09..4c5340d0 100644 --- a/base/system/sys_info.cc +++ b/base/system/sys_info.cc
@@ -20,6 +20,7 @@ #include "base/task_runner_util.h" #include "base/time/time.h" #include "build/build_config.h" +#include "build/lacros_buildflags.h" namespace base { namespace { @@ -83,7 +84,8 @@ } #endif -#if !defined(OS_APPLE) && !defined(OS_ANDROID) && !defined(OS_CHROMEOS) +#if !defined(OS_APPLE) && !defined(OS_ANDROID) && !defined(OS_CHROMEOS) && \ + !BUILDFLAG(IS_LACROS) std::string SysInfo::HardwareModelName() { return std::string(); }
diff --git a/base/system/sys_info.h b/base/system/sys_info.h index 458035c..4f39c00f 100644 --- a/base/system/sys_info.h +++ b/base/system/sys_info.h
@@ -17,6 +17,7 @@ #include "base/gtest_prod_util.h" #include "base/time/time.h" #include "build/build_config.h" +#include "build/lacros_buildflags.h" namespace base { @@ -127,7 +128,7 @@ // allocate. static size_t VMAllocationGranularity(); -#if defined(OS_CHROMEOS) +#if defined(OS_CHROMEOS) || BUILDFLAG(IS_LACROS) // Set |value| and return true if LsbRelease contains information about |key|. static bool GetLsbReleaseValue(const std::string& key, std::string* value); @@ -164,7 +165,7 @@ // Crashes if running on Chrome OS non-test image. Use only for really // sensitive and risky use cases. static void CrashIfChromeOSNonTestImage(); -#endif // defined(OS_CHROMEOS) +#endif // defined(OS_CHROMEOS) || BUILDFLAG(IS_LACROS) #if defined(OS_ANDROID) // Returns the Android build's codename.
diff --git a/base/system/sys_info_linux.cc b/base/system/sys_info_linux.cc index f69569fb..5032512d 100644 --- a/base/system/sys_info_linux.cc +++ b/base/system/sys_info_linux.cc
@@ -20,6 +20,7 @@ #include "base/strings/string_util.h" #include "base/system/sys_info_internal.h" #include "build/build_config.h" +#include "build/lacros_buildflags.h" namespace { @@ -73,7 +74,7 @@ // static std::string SysInfo::CPUModelName() { -#if defined(OS_CHROMEOS) && defined(ARCH_CPU_ARMEL) +#if (defined(OS_CHROMEOS) || BUILDFLAG(IS_LACROS)) && defined(ARCH_CPU_ARMEL) const char kCpuModelPrefix[] = "Hardware"; #else const char kCpuModelPrefix[] = "model name";
diff --git a/base/system/sys_info_posix.cc b/base/system/sys_info_posix.cc index 51deaa3..32e72d76 100644 --- a/base/system/sys_info_posix.cc +++ b/base/system/sys_info_posix.cc
@@ -20,6 +20,7 @@ #include "base/system/sys_info_internal.h" #include "base/threading/scoped_blocking_call.h" #include "build/build_config.h" +#include "build/lacros_buildflags.h" #if defined(OS_ANDROID) #include <sys/vfs.h> @@ -172,7 +173,8 @@ } #endif //! defined(OS_APPLE) && !defined(OS_ANDROID) -#if !defined(OS_APPLE) && !defined(OS_ANDROID) && !defined(OS_CHROMEOS) +#if !defined(OS_APPLE) && !defined(OS_ANDROID) && !defined(OS_CHROMEOS) && \ + !BUILDFLAG(IS_LACROS) // static std::string SysInfo::OperatingSystemVersion() { struct utsname info; @@ -184,7 +186,8 @@ } #endif -#if !defined(OS_APPLE) && !defined(OS_ANDROID) && !defined(OS_CHROMEOS) +#if !defined(OS_APPLE) && !defined(OS_ANDROID) && !defined(OS_CHROMEOS) && \ + !BUILDFLAG(IS_LACROS) // static void SysInfo::OperatingSystemVersionNumbers(int32_t* major_version, int32_t* minor_version,
diff --git a/base/system/sys_info_unittest.cc b/base/system/sys_info_unittest.cc index 57416c5..4ff9a9a 100644 --- a/base/system/sys_info_unittest.cc +++ b/base/system/sys_info_unittest.cc
@@ -21,6 +21,7 @@ #include "base/threading/platform_thread.h" #include "base/time/time.h" #include "build/build_config.h" +#include "build/lacros_buildflags.h" #include "testing/gtest/include/gtest/gtest-death-test.h" #include "testing/gtest/include/gtest/gtest.h" #include "testing/platform_test.h" @@ -193,7 +194,7 @@ #endif } -#if defined(OS_CHROMEOS) +#if defined(OS_CHROMEOS) || BUILDFLAG(IS_LACROS) TEST_F(SysInfoTest, GoogleChromeOSVersionNumbers) { int32_t os_major_version = -1; @@ -297,6 +298,6 @@ SysInfo::CrashIfChromeOSNonTestImage(); } -#endif // OS_CHROMEOS +#endif // OS_CHROMEOS || BUILDFLAG(IS_LACROS) } // namespace base
diff --git a/build/chromeos/test_runner.py b/build/chromeos/test_runner.py index 8db6ab72..54ad6ba 100755 --- a/build/chromeos/test_runner.py +++ b/build/chromeos/test_runner.py
@@ -933,7 +933,20 @@ help='A Tast test to run in the device (eg: "ui.ChromeLogin").') add_common_args(gtest_parser, tast_test_parser, host_cmd_parser) - args, unknown_args = parser.parse_known_args() + + args = sys.argv[1:] + unknown_args = [] + # If a '--' is present in the args, treat everything to the right of it as + # args to the test and everything to the left as args to this test runner. + # Otherwise treat all known args as args to this test runner and all unknown + # args as test args. + if '--' in args: + unknown_args = args[args.index('--') + 1:] + args = args[0:args.index('--')] + if unknown_args: + args = parser.parse_args(args=args) + else: + args, unknown_args = parser.parse_known_args() logging.basicConfig(level=logging.DEBUG if args.verbose else logging.WARN)
diff --git a/build/fuchsia/linux.sdk.sha1 b/build/fuchsia/linux.sdk.sha1 index a626d44a..7485b99 100644 --- a/build/fuchsia/linux.sdk.sha1 +++ b/build/fuchsia/linux.sdk.sha1
@@ -1 +1 @@ -0.20200803.1.1 +0.20200803.2.1
diff --git a/build/fuchsia/mac.sdk.sha1 b/build/fuchsia/mac.sdk.sha1 index a626d44a..7485b99 100644 --- a/build/fuchsia/mac.sdk.sha1 +++ b/build/fuchsia/mac.sdk.sha1
@@ -1 +1 @@ -0.20200803.1.1 +0.20200803.2.1
diff --git a/chrome/android/chrome_java_sources.gni b/chrome/android/chrome_java_sources.gni index a0bf1e83..2ceb874 100644 --- a/chrome/android/chrome_java_sources.gni +++ b/chrome/android/chrome_java_sources.gni
@@ -76,6 +76,7 @@ "java/src/org/chromium/chrome/browser/app/appmenu/AppMenuPropertiesDelegateImpl.java", "java/src/org/chromium/chrome/browser/app/appmenu/UpdateMenuItemViewBinder.java", "java/src/org/chromium/chrome/browser/app/flags/ChromeCachedFlags.java", + "java/src/org/chromium/chrome/browser/app/reengagement/ReengagementActivity.java", "java/src/org/chromium/chrome/browser/app/send_tab_to_self/SendTabToSelfNotificationReceiver.java", "java/src/org/chromium/chrome/browser/app/tab_activity_glue/ActivityTabWebContentsDelegateAndroid.java", "java/src/org/chromium/chrome/browser/app/tab_activity_glue/ReparentingDelegateFactory.java", @@ -1333,6 +1334,7 @@ "java/src/org/chromium/chrome/browser/query_tiles/QueryTileUtils.java", "java/src/org/chromium/chrome/browser/query_tiles/TileProviderFactory.java", "java/src/org/chromium/chrome/browser/rappor/RapporServiceBridge.java", + "java/src/org/chromium/chrome/browser/reengagement/ReengagementNotificationController.java", "java/src/org/chromium/chrome/browser/resources/ResourceMapper.java", "java/src/org/chromium/chrome/browser/rlz/RevenueStats.java", "java/src/org/chromium/chrome/browser/rlz/RlzPingHandler.java",
diff --git a/chrome/android/chrome_junit_test_java_sources.gni b/chrome/android/chrome_junit_test_java_sources.gni index 9c4c37c..1c8dac3c 100644 --- a/chrome/android/chrome_junit_test_java_sources.gni +++ b/chrome/android/chrome_junit_test_java_sources.gni
@@ -199,6 +199,7 @@ "junit/src/org/chromium/chrome/browser/photo_picker/PickerBitmapViewTest.java", "junit/src/org/chromium/chrome/browser/policy/EnterpriseInfoTest.java", "junit/src/org/chromium/chrome/browser/privacy/settings/PrivacyPreferencesManagerTest.java", + "junit/src/org/chromium/chrome/browser/reengagement/ReengagementNotificationControllerTest.java", "junit/src/org/chromium/chrome/browser/search_engines/SearchEngineChoiceMetricsTest.java", "junit/src/org/chromium/chrome/browser/search_engines/SearchEngineChoiceNotificationTest.java", "junit/src/org/chromium/chrome/browser/search_engines/settings/SearchEngineAdapterTest.java",
diff --git a/chrome/android/chrome_test_java_sources.gni b/chrome/android/chrome_test_java_sources.gni index cb1c645..f19b742 100644 --- a/chrome/android/chrome_test_java_sources.gni +++ b/chrome/android/chrome_test_java_sources.gni
@@ -466,6 +466,7 @@ "javatests/src/org/chromium/chrome/browser/query_tiles/QueryTileSectionToOmniboxTest.java", "javatests/src/org/chromium/chrome/browser/query_tiles/TileMatchers.java", "javatests/src/org/chromium/chrome/browser/query_tiles/ViewActions.java", + "javatests/src/org/chromium/chrome/browser/reengagement/ReengagementNotificationControllerIntegrationTest.java", "javatests/src/org/chromium/chrome/browser/search_engines/TemplateUrlServiceTest.java", "javatests/src/org/chromium/chrome/browser/search_engines/settings/SearchEngineSettingsTest.java", "javatests/src/org/chromium/chrome/browser/searchwidget/SearchActivityTest.java",
diff --git a/chrome/android/expectations/monochrome_public_bundle.AndroidManifest.expected b/chrome/android/expectations/monochrome_public_bundle.AndroidManifest.expected index 98482c46..f3e8f3d6 100644 --- a/chrome/android/expectations/monochrome_public_bundle.AndroidManifest.expected +++ b/chrome/android/expectations/monochrome_public_bundle.AndroidManifest.expected
@@ -61,7 +61,7 @@ <permission android:name="$PACKAGE.permission.C2D_MESSAGE" android:protectionLevel="signature"/> <permission android:name="$PACKAGE.TOS_ACKED" android:protectionLevel="signatureOrSystem"/> <permission android:label="Debug web pages" android:name="$PACKAGE.permission.DEBUG" android:permissionGroup="android.permission-group.DEVELOPMENT_TOOLS" android:protectionLevel="signature"/> - <application # DIFF-ANCHOR: fb4067c5 + <application # DIFF-ANCHOR: 8b4c7922 android:allowBackup="false" android:extractNativeLibs="false" android:icon="@drawable/ic_launcher" @@ -475,6 +475,12 @@ android:name="org.chromium.chrome.browser.LauncherShortcutActivity" android:taskAffinity="" android:theme="@android:style/Theme.NoDisplay"/> + <activity # DIFF-ANCHOR: f490b994 + android:excludeFromRecents="true" + android:exported="false" + android:name="org.chromium.chrome.browser.app.reengagement.ReengagementActivity" + android:taskAffinity="" + android:theme="@android:style/Theme.Translucent"/> <activity # DIFF-ANCHOR: 9ad44b6b android:excludeFromRecents="true" android:exported="false" @@ -1454,5 +1460,5 @@ android:exported="true" android:name="org.chromium.chrome.browser.prerender.ChromePrerenderService" tools:ignore="ExportedService"/> - </application> # DIFF-ANCHOR: fb4067c5 + </application> # DIFF-ANCHOR: 8b4c7922 </manifest>
diff --git a/chrome/android/expectations/trichrome_chrome_bundle.AndroidManifest.expected b/chrome/android/expectations/trichrome_chrome_bundle.AndroidManifest.expected index 1aa9586..9d790cbf 100644 --- a/chrome/android/expectations/trichrome_chrome_bundle.AndroidManifest.expected +++ b/chrome/android/expectations/trichrome_chrome_bundle.AndroidManifest.expected
@@ -61,7 +61,7 @@ <permission android:name="$PACKAGE.permission.C2D_MESSAGE" android:protectionLevel="signature"/> <permission android:name="$PACKAGE.TOS_ACKED" android:protectionLevel="signatureOrSystem"/> <permission android:label="Debug web pages" android:name="$PACKAGE.permission.DEBUG" android:permissionGroup="android.permission-group.DEVELOPMENT_TOOLS" android:protectionLevel="signature"/> - <application # DIFF-ANCHOR: 8e598e1a + <application # DIFF-ANCHOR: 1b98dacf android:allowBackup="false" android:extractNativeLibs="false" android:icon="@drawable/ic_launcher" @@ -475,6 +475,12 @@ android:name="org.chromium.chrome.browser.LauncherShortcutActivity" android:taskAffinity="" android:theme="@android:style/Theme.NoDisplay"/> + <activity # DIFF-ANCHOR: f490b994 + android:excludeFromRecents="true" + android:exported="false" + android:name="org.chromium.chrome.browser.app.reengagement.ReengagementActivity" + android:taskAffinity="" + android:theme="@android:style/Theme.Translucent"/> <activity # DIFF-ANCHOR: 9ad44b6b android:excludeFromRecents="true" android:exported="false" @@ -1255,5 +1261,5 @@ android:name="org.chromium.chrome.browser.prerender.ChromePrerenderService" tools:ignore="ExportedService"/> <uses-static-library android:certDigest="32a2fc74d731105859e5a85df16d95f102d85b22099b8064c5d8915c61dad1e0" android:name="org.chromium.trichromelibrary" android:version="$VERSION_NUMBER"/> - </application> # DIFF-ANCHOR: 8e598e1a + </application> # DIFF-ANCHOR: 1b98dacf </manifest>
diff --git a/chrome/android/feed/core/java/src/org/chromium/chrome/browser/feed/v2/FeedStreamSurface.java b/chrome/android/feed/core/java/src/org/chromium/chrome/browser/feed/v2/FeedStreamSurface.java index 39a986b..274ce13 100644 --- a/chrome/android/feed/core/java/src/org/chromium/chrome/browser/feed/v2/FeedStreamSurface.java +++ b/chrome/android/feed/core/java/src/org/chromium/chrome/browser/feed/v2/FeedStreamSurface.java
@@ -8,6 +8,7 @@ import android.content.Context; import android.view.ContextThemeWrapper; import android.view.View; +import android.view.ViewParent; import androidx.annotation.Nullable; import androidx.annotation.VisibleForTesting; @@ -85,7 +86,8 @@ private final long mNativeFeedStreamSurface; private final FeedListContentManager mContentManager; private final SurfaceScope mSurfaceScope; - private final RecyclerView mRootView; + @VisibleForTesting + RecyclerView mRootView; private final HybridListRenderer mHybridListRenderer; private final SnackbarManager mSnackbarManager; private final Activity mActivity; @@ -97,6 +99,8 @@ private int mHeaderCount; private BottomSheetContent mBottomSheetContent; + // If the bottom sheet was opened in response to an action on a slice, this is the slice ID. + private String mBottomSheetOriginatingSliceId; private final int mLoadMoreTriggerLookahead; private boolean mIsLoadingMoreContent; @@ -512,8 +516,57 @@ return new FeedListContentManager.NativeViewContent(sliceId, R.layout.no_content_v2); } + /** + * Returns the immediate child of parentView which contains descendentView. + * If descendentView is not in parentView's view heirarchy, this returns null. + * Note that the returned view may be descendentView, or descendentView.getParent(), + * or descendentView.getParent().getParent(), etc... + */ + View findChildViewContainingDescendent(View parentView, View descendentView) { + if (parentView == null || descendentView == null) return null; + // Find the direct child of parentView which owns view. + if (parentView == descendentView.getParent()) { + return descendentView; + } else { + // One of the view's ancestors might be the child. + ViewParent p = descendentView.getParent(); + while (true) { + if (p == null) { + return null; + } + if (p.getParent() == parentView) { + if (p instanceof View) return (View) p; + return null; + } + p = p.getParent(); + } + } + } + + @VisibleForTesting + String getSliceIdFromView(View view) { + View childOfRoot = findChildViewContainingDescendent(mRootView, view); + + if (childOfRoot != null) { + // View is a child of the recycler view, find slice using the index. + int position = mRootView.getChildAdapterPosition(childOfRoot); + if (position >= 0 && position < mContentManager.getItemCount()) { + return mContentManager.getContent(position).getKey(); + } + } else if (mBottomSheetContent != null + && findChildViewContainingDescendent(mBottomSheetContent.getContentView(), view) + != null) { + // View is a child of the bottom sheet, return slice associated with the bottom sheet. + return mBottomSheetOriginatingSliceId; + } + return ""; + } + @Override - public void navigateTab(String url) { + public void navigateTab(String url, View actionSourceView) { + FeedStreamSurfaceJni.get().reportOpenAction(mNativeFeedStreamSurface, + FeedStreamSurface.this, getSliceIdFromView(actionSourceView)); + openUrl(url, WindowOpenDisposition.CURRENT_TAB); // Attempts to load more content if needed. @@ -521,7 +574,10 @@ } @Override - public void navigateNewTab(String url) { + public void navigateNewTab(String url, View actionSourceView) { + FeedStreamSurfaceJni.get().reportOpenInNewTabAction(mNativeFeedStreamSurface, + FeedStreamSurface.this, getSliceIdFromView(actionSourceView)); + openUrl(url, WindowOpenDisposition.NEW_FOREGROUND_TAB); // Attempts to load more content if needed. @@ -530,6 +586,9 @@ @Override public void navigateIncognitoTab(String url) { + FeedStreamSurfaceJni.get().reportOpenInNewIncognitoTabAction( + mNativeFeedStreamSurface, FeedStreamSurface.this); + openUrl(url, WindowOpenDisposition.OFF_THE_RECORD); // Attempts to load more content if needed. @@ -538,17 +597,23 @@ @Override public void downloadLink(String url) { + FeedStreamSurfaceJni.get().reportDownloadAction( + mNativeFeedStreamSurface, FeedStreamSurface.this); RequestCoordinatorBridge.getForProfile(Profile.getLastUsedRegularProfile()) .savePageLater( url, OfflinePageBridge.NTP_SUGGESTIONS_NAMESPACE, true /* user requested*/); } @Override - public void showBottomSheet(View view) { + public void showBottomSheet(View view, View actionSourceView) { dismissBottomSheet(); + FeedStreamSurfaceJni.get().reportContextMenuOpened( + mNativeFeedStreamSurface, FeedStreamSurface.this); + // Make a sheetContent with the view. mBottomSheetContent = new CardMenuBottomSheetContent(view); + mBottomSheetOriginatingSliceId = getSliceIdFromView(actionSourceView); mBottomSheetController.requestShowContent(mBottomSheetContent, true); } @@ -558,6 +623,13 @@ mBottomSheetController.hideContent(mBottomSheetContent, true); } mBottomSheetContent = null; + mBottomSheetOriginatingSliceId = null; + } + + @Override + public void recordActionManageInterests() { + FeedStreamSurfaceJni.get().reportManageInterestsAction( + mNativeFeedStreamSurface, FeedStreamSurface.this); } @Override @@ -573,6 +645,9 @@ @Override public void sendFeedback(Map<String, String> productSpecificDataMap) { + FeedStreamSurfaceJni.get().reportSendFeedbackAction( + mNativeFeedStreamSurface, FeedStreamSurface.this); + Profile profile = Profile.getLastUsedRegularProfile(); if (profile == null) { return; @@ -721,36 +796,28 @@ interface Natives { long init(FeedStreamSurface caller); int[] getExperimentIds(); - // TODO(jianli): Call this function at the appropriate time. void reportSliceViewed( long nativeFeedStreamSurface, FeedStreamSurface caller, String sliceId); void reportNavigationStarted(long nativeFeedStreamSurface, FeedStreamSurface caller); - // TODO(jianli): Call this function at the appropriate time. void reportPageLoaded(long nativeFeedStreamSurface, FeedStreamSurface caller, String url, boolean inNewTab); - // TODO(jianli): Call this function at the appropriate time. void reportOpenAction( long nativeFeedStreamSurface, FeedStreamSurface caller, String sliceId); - // TODO(jianli): Call this function at the appropriate time. void reportOpenInNewTabAction( long nativeFeedStreamSurface, FeedStreamSurface caller, String sliceId); - // TODO(jianli): Call this function at the appropriate time. void reportOpenInNewIncognitoTabAction( long nativeFeedStreamSurface, FeedStreamSurface caller); - // TODO(jianli): Call this function at the appropriate time. void reportSendFeedbackAction(long nativeFeedStreamSurface, FeedStreamSurface caller); - // TODO(jianli): Call this function at the appropriate time. - void reportLearnMoreAction(long nativeFeedStreamSurface, FeedStreamSurface caller); - // TODO(jianli): Call this function at the appropriate time. void reportDownloadAction(long nativeFeedStreamSurface, FeedStreamSurface caller); - // TODO(jianli): Call this function at the appropriate time. - void reportRemoveAction(long nativeFeedStreamSurface, FeedStreamSurface caller); - // TODO(jianli): Call this function at the appropriate time. - void reportNotInterestedInAction(long nativeFeedStreamSurface, FeedStreamSurface caller); - // TODO(jianli): Call this function at the appropriate time. - void reportManageInterestsAction(long nativeFeedStreamSurface, FeedStreamSurface caller); - // TODO(jianli): Call this function at the appropriate time. void reportContextMenuOpened(long nativeFeedStreamSurface, FeedStreamSurface caller); + void reportManageInterestsAction(long nativeFeedStreamSurface, FeedStreamSurface caller); + + // TODO(crbug.com/1111101): These actions aren't visible to the client, so these functions + // are never called. + void reportLearnMoreAction(long nativeFeedStreamSurface, FeedStreamSurface caller); + void reportRemoveAction(long nativeFeedStreamSurface, FeedStreamSurface caller); + void reportNotInterestedInAction(long nativeFeedStreamSurface, FeedStreamSurface caller); + // TODO(jianli): Call this function at the appropriate time. void reportStreamScrolled( long nativeFeedStreamSurface, FeedStreamSurface caller, int distanceDp);
diff --git a/chrome/android/java/AndroidManifest.xml b/chrome/android/java/AndroidManifest.xml index efc966d..13a3bea6 100644 --- a/chrome/android/java/AndroidManifest.xml +++ b/chrome/android/java/AndroidManifest.xml
@@ -370,6 +370,12 @@ </intent-filter> </activity> + <activity android:name="org.chromium.chrome.browser.app.reengagement.ReengagementActivity" + android:theme="@android:style/Theme.Translucent" + android:taskAffinity="" + android:excludeFromRecents="true" + android:exported="false" /> + <receiver android:name="org.chromium.chrome.browser.sharing.click_to_call.ClickToCallMessageHandler$PhoneUnlockedReceiver" android:exported="true"> <intent-filter> <action android:name="android.intent.action.USER_PRESENT" />
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ChromeTabbedActivity.java b/chrome/android/java/src/org/chromium/chrome/browser/ChromeTabbedActivity.java index 88a70247..7b83efb 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/ChromeTabbedActivity.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/ChromeTabbedActivity.java
@@ -33,6 +33,7 @@ import androidx.annotation.VisibleForTesting; import org.chromium.base.ApiCompatibilityUtils; +import org.chromium.base.CallbackController; import org.chromium.base.CommandLine; import org.chromium.base.ContextUtils; import org.chromium.base.IntentUtils; @@ -45,6 +46,7 @@ import org.chromium.base.metrics.RecordUserAction; import org.chromium.base.supplier.ObservableSupplier; import org.chromium.base.supplier.ObservableSupplierImpl; +import org.chromium.base.supplier.OneShotCallback; import org.chromium.base.supplier.Supplier; import org.chromium.base.task.PostTask; import org.chromium.chrome.R; @@ -72,6 +74,7 @@ import org.chromium.chrome.browser.dom_distiller.ReaderModeManager; import org.chromium.chrome.browser.download.DownloadOpenSource; import org.chromium.chrome.browser.download.DownloadUtils; +import org.chromium.chrome.browser.feature_engagement.TrackerFactory; import org.chromium.chrome.browser.feed.FeedProcessScopeFactory; import org.chromium.chrome.browser.feed.v2.FeedStreamSurface; import org.chromium.chrome.browser.firstrun.FirstRunSignInProcessor; @@ -157,6 +160,7 @@ import org.chromium.components.browser_ui.util.BrowserControlsVisibilityDelegate; import org.chromium.components.browser_ui.util.ComposedBrowserControlsVisibilityDelegate; import org.chromium.components.embedder_support.util.UrlConstants; +import org.chromium.components.feature_engagement.EventConstants; import org.chromium.content_public.browser.LoadUrlParams; import org.chromium.content_public.browser.NavigationHandle; import org.chromium.content_public.browser.UiThreadTaskTraits; @@ -290,6 +294,8 @@ private ObservableSupplierImpl<EphemeralTabCoordinator> mEphemeralTabCoordinatorSupplier = new ObservableSupplierImpl<>(); + private CallbackController mCallbackController = new CallbackController(); + private final IncognitoTabHost mIncognitoTabHost = new IncognitoTabHost() { @Override public boolean hasIncognitoTabs() { @@ -1030,6 +1036,18 @@ // TODO(tedchoc): We should cache the last visible time and reuse it to avoid different // values of this depending on when it is called after the activity was // shown. + + if (mCallbackController != null) { + new OneShotCallback<>( + mTabModelProfileSupplier, mCallbackController.makeCancelable(profile -> { + assert profile != null : "Unexpectedly null profile from TabModel."; + if (profile == null) return; + + TrackerFactory.getTrackerForProfile(profile).notifyEvent( + EventConstants.STARTED_FROM_MAIN_INTENT); + })); + } + mMainIntentMetrics.onMainIntentWithNative( mInactivityTracker.getTimeSinceLastBackgroundedMs()); } @@ -2050,6 +2068,11 @@ @Override public void onDestroyInternal() { + if (mCallbackController != null) { + mCallbackController.destroy(); + mCallbackController = null; + } + if (mOverviewModeController != null && mOverviewModeObserver != null) { mOverviewModeController.removeOverviewModeObserver(mOverviewModeObserver); }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/DefaultBrowserInfo.java b/chrome/android/java/src/org/chromium/chrome/browser/DefaultBrowserInfo.java index 9756d3fe..526736e7 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/DefaultBrowserInfo.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/DefaultBrowserInfo.java
@@ -11,17 +11,22 @@ import android.text.TextUtils; import androidx.annotation.IntDef; +import androidx.annotation.VisibleForTesting; import org.chromium.base.BuildInfo; +import org.chromium.base.Callback; import org.chromium.base.ContextUtils; +import org.chromium.base.ObserverList; import org.chromium.base.PackageManagerUtils; +import org.chromium.base.ThreadUtils; import org.chromium.base.metrics.RecordHistogram; import org.chromium.base.task.AsyncTask; import org.chromium.base.task.BackgroundOnlyAsyncTask; +import org.chromium.base.task.PostTask; import org.chromium.chrome.R; import org.chromium.chrome.browser.preferences.ChromePreferenceKeys; import org.chromium.chrome.browser.preferences.SharedPreferencesManager; -import org.chromium.content_public.browser.BrowserStartupController; +import org.chromium.content_public.browser.UiThreadTaskTraits; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; @@ -31,6 +36,7 @@ import java.util.Set; import java.util.concurrent.ExecutionException; import java.util.concurrent.RejectedExecutionException; +import java.util.concurrent.atomic.AtomicReference; /** * A utility class for querying information about the default browser setting. @@ -56,19 +62,40 @@ int NUM_ENTRIES = 5; } - /** - * Helper class for passing information about the system's default browser settings back from a - * worker task. - */ - private static class DefaultInfo { - public boolean isChromeSystem; - public boolean isChromeDefault; - public boolean isDefaultSystem; - public boolean hasDefault; - public int browserCount; - public int systemCount; + /** Contains all status related to the default browser state on the device. */ + public static class DefaultInfo { + /** Whether or not Chrome is the system browser. */ + public final boolean isChromeSystem; + + /** Whether or not Chrome is the default browser. */ + public final boolean isChromeDefault; + + /** Whether or not the default browser is the system browser. */ + public final boolean isDefaultSystem; + + /** Whether or not the user has set a default browser. */ + public final boolean hasDefault; + + /** The number of browsers installed on this device. */ + public final int browserCount; + + /** The number of system browsers installed on this device. */ + public final int systemCount; + + /** Creates an instance of the {@link DefaultInfo} class. */ + public DefaultInfo(boolean isChromeSystem, boolean isChromeDefault, boolean isDefaultSystem, + boolean hasDefault, int browserCount, int systemCount) { + this.isChromeSystem = isChromeSystem; + this.isChromeDefault = isChromeDefault; + this.isDefaultSystem = isDefaultSystem; + this.hasDefault = hasDefault; + this.browserCount = browserCount; + this.systemCount = systemCount; + } } + private static DefaultInfoTask sDefaultInfoTask; + /** A lock to synchronize background tasks to retrieve browser information. */ private static final Object sDirCreationLock = new Object(); @@ -81,6 +108,8 @@ * Initialize an AsyncTask for getting menu title of opening a link in default browser. */ public static void initBrowserFetcher() { + // TODO(crbug.com/1107527): Make this depend on getDefaultBrowserInfo instead of rolling + // it's own AsyncTask. Potentially update DefaultInfo to include extra data if necessary. synchronized (sDirCreationLock) { if (sDefaultBrowserFetcher == null) { sDefaultBrowserFetcher = new BackgroundOnlyAsyncTask<ArrayList<String>>() { @@ -143,62 +172,146 @@ } /** + * Determines various information about browsers on the system. + * @param callback To be called with a {@link DefaultInfo} instance if possible. Can be {@code + * null}. + * @see DefaultInfo + */ + public static void getDefaultBrowserInfo(Callback<DefaultInfo> callback) { + ThreadUtils.checkUiThread(); + if (sDefaultInfoTask == null) sDefaultInfoTask = new DefaultInfoTask(); + sDefaultInfoTask.get(callback); + } + + /** * Log statistics about the current default browser to UMA. */ public static void logDefaultBrowserStats() { - assert BrowserStartupController.getInstance().isFullBrowserStarted(); + getDefaultBrowserInfo(info -> { + if (info == null) return; - try { - new AsyncTask<DefaultInfo>() { - @Override - protected DefaultInfo doInBackground() { - Context context = ContextUtils.getApplicationContext(); + RecordHistogram.recordCount100Histogram( + getSystemBrowserCountUmaName(info), info.systemCount); + RecordHistogram.recordCount100Histogram( + getDefaultBrowserCountUmaName(info), info.browserCount); + RecordHistogram.recordEnumeratedHistogram("Mobile.DefaultBrowser.State", + getDefaultBrowserUmaState(info), MobileDefaultBrowserState.NUM_ENTRIES); + }); + } - DefaultInfo info = new DefaultInfo(); + @VisibleForTesting + public static void setDefaultInfoForTests(DefaultInfo info) { + DefaultInfoTask.setDefaultInfoForTests(info); + } - // Query the default handler first. - ResolveInfo defaultRi = PackageManagerUtils.resolveDefaultWebBrowserActivity(); - if (defaultRi != null && defaultRi.match != 0) { - info.hasDefault = true; - info.isChromeDefault = isSamePackage(context, defaultRi); - info.isDefaultSystem = isSystemPackage(defaultRi); - } + @VisibleForTesting + public static void clearDefaultInfoForTests() { + DefaultInfoTask.clearDefaultInfoForTests(); + } - // Query all other intent handlers. - Set<String> uniquePackages = new HashSet<>(); - List<ResolveInfo> ris = PackageManagerUtils.queryAllWebBrowsersInfo(); - if (ris != null) { - for (ResolveInfo ri : ris) { - String packageName = ri.activityInfo.applicationInfo.packageName; - if (!uniquePackages.add(packageName)) continue; + private static class DefaultInfoTask extends AsyncTask<DefaultInfo> { + private static AtomicReference<DefaultInfo> sTestInfo; - if (isSystemPackage(ri)) { - if (isSamePackage(context, ri)) info.isChromeSystem = true; - info.systemCount++; - } - } - } + private final ObserverList<Callback<DefaultInfo>> mObservers = new ObserverList<>(); - info.browserCount = uniquePackages.size(); + @VisibleForTesting + public static void setDefaultInfoForTests(DefaultInfo info) { + sTestInfo = new AtomicReference<DefaultInfo>(info); + } - return info; + public static void clearDefaultInfoForTests() { + sTestInfo = null; + } + + /** + * Queues up {@code callback} to be notified of the result of this {@link AsyncTask}. If + * the task has not been started, this will start it. If the task is finished, this will + * send the result. If the task is running this will queue the callback up until the task + * is done. + * + * @param callback The {@link Callback} to notify with the right {@link DefaultInfo}. + */ + public void get(Callback<DefaultInfo> callback) { + ThreadUtils.checkUiThread(); + + if (getStatus() == Status.FINISHED) { + DefaultInfo info = null; + try { + info = sTestInfo == null ? get() : sTestInfo.get(); + } catch (InterruptedException | ExecutionException e) { + // Fail silently here since this is not a critical task. } - @Override - protected void onPostExecute(DefaultInfo info) { - if (info == null) return; + final DefaultInfo postInfo = info; + PostTask.postTask(UiThreadTaskTraits.DEFAULT, () -> callback.onResult(postInfo)); + } else { + if (getStatus() == Status.PENDING) { + try { + executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR); + } catch (RejectedExecutionException e) { + // Fail silently here since this is not a critical task. + PostTask.postTask( + UiThreadTaskTraits.DEFAULT, () -> callback.onResult(null)); + return; + } + } + mObservers.addObserver(callback); + } + } - RecordHistogram.recordCount100Histogram( - getSystemBrowserCountUmaName(info), info.systemCount); - RecordHistogram.recordCount100Histogram( - getDefaultBrowserCountUmaName(info), info.browserCount); - RecordHistogram.recordEnumeratedHistogram("Mobile.DefaultBrowser.State", - getDefaultBrowserUmaState(info), MobileDefaultBrowserState.NUM_ENTRIES); + @Override + protected DefaultInfo doInBackground() { + Context context = ContextUtils.getApplicationContext(); + + boolean isChromeSystem = false; + boolean isChromeDefault = false; + boolean isDefaultSystem = false; + boolean hasDefault = false; + int browserCount = 0; + int systemCount = 0; + + // Query the default handler first. + ResolveInfo defaultRi = PackageManagerUtils.resolveDefaultWebBrowserActivity(); + if (defaultRi != null && defaultRi.match != 0) { + hasDefault = true; + isChromeDefault = isSamePackage(context, defaultRi); + isDefaultSystem = isSystemPackage(defaultRi); + } + + // Query all other intent handlers. + Set<String> uniquePackages = new HashSet<>(); + List<ResolveInfo> ris = PackageManagerUtils.queryAllWebBrowsersInfo(); + if (ris != null) { + for (ResolveInfo ri : ris) { + String packageName = ri.activityInfo.applicationInfo.packageName; + if (!uniquePackages.add(packageName)) continue; + + if (isSystemPackage(ri)) { + if (isSamePackage(context, ri)) isChromeSystem = true; + systemCount++; + } } } - .executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR); - } catch (RejectedExecutionException ex) { - // Fail silently here since this is not a critical task. + + browserCount = uniquePackages.size(); + + return new DefaultInfo(isChromeSystem, isChromeDefault, isDefaultSystem, hasDefault, + browserCount, systemCount); + } + + @Override + protected void onPostExecute(DefaultInfo defaultInfo) { + flushCallbacks(sTestInfo == null ? defaultInfo : sTestInfo.get()); + } + + @Override + protected void onCancelled() { + flushCallbacks(null); + } + + private void flushCallbacks(DefaultInfo info) { + for (Callback<DefaultInfo> callback : mObservers) callback.onResult(info); + mObservers.clear(); } }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/app/reengagement/ReengagementActivity.java b/chrome/android/java/src/org/chromium/chrome/browser/app/reengagement/ReengagementActivity.java new file mode 100644 index 0000000..8d5b15e --- /dev/null +++ b/chrome/android/java/src/org/chromium/chrome/browser/app/reengagement/ReengagementActivity.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.app.reengagement; + +import android.app.Activity; +import android.content.Intent; +import android.os.Bundle; + +import org.chromium.base.StrictModeContext; +import org.chromium.chrome.browser.IntentHandler; +import org.chromium.chrome.browser.reengagement.ReengagementNotificationController; + +/** Trampoline activity to start the NTP from the reengagement notification. */ +public class ReengagementActivity extends Activity { + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + String action = getIntent().getAction(); + if (ReengagementNotificationController.LAUNCH_NTP_ACTION.equals(action)) { + Intent intent = + IntentHandler.createTrustedOpenNewTabIntent(this, /* incognito = */ false); + try (StrictModeContext ignored = StrictModeContext.allowDiskWrites()) { + startActivity(intent); + } + } + finish(); + } +}
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/customtabs/BaseCustomTabRootUiCoordinator.java b/chrome/android/java/src/org/chromium/chrome/browser/customtabs/BaseCustomTabRootUiCoordinator.java index 96c4cc73..19ee882 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/customtabs/BaseCustomTabRootUiCoordinator.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/customtabs/BaseCustomTabRootUiCoordinator.java
@@ -5,22 +5,29 @@ package org.chromium.chrome.browser.customtabs; import org.chromium.base.supplier.ObservableSupplier; +import org.chromium.base.supplier.OneShotCallback; import org.chromium.base.supplier.Supplier; import org.chromium.chrome.browser.ActivityTabProvider; import org.chromium.chrome.browser.ChromeActivity; +import org.chromium.chrome.browser.app.reengagement.ReengagementActivity; import org.chromium.chrome.browser.bookmarks.BookmarkBridge; import org.chromium.chrome.browser.compositor.layouts.OverviewModeBehavior; import org.chromium.chrome.browser.contextualsearch.ContextualSearchManager; import org.chromium.chrome.browser.customtabs.content.CustomTabActivityNavigationController; import org.chromium.chrome.browser.customtabs.features.toolbar.CustomTabToolbarCoordinator; +import org.chromium.chrome.browser.feature_engagement.TrackerFactory; +import org.chromium.chrome.browser.lifecycle.NativeInitObserver; import org.chromium.chrome.browser.profiles.Profile; +import org.chromium.chrome.browser.reengagement.ReengagementNotificationController; import org.chromium.chrome.browser.share.ShareDelegate; import org.chromium.chrome.browser.ui.RootUiCoordinator; +import org.chromium.components.feature_engagement.Tracker; /** * A {@link RootUiCoordinator} variant that controls UI for {@link BaseCustomTabActivity}. */ -public class BaseCustomTabRootUiCoordinator extends RootUiCoordinator { +public class BaseCustomTabRootUiCoordinator + extends RootUiCoordinator implements NativeInitObserver { private final CustomTabToolbarCoordinator mToolbarCoordinator; private final CustomTabActivityNavigationController mNavigationController; @@ -46,4 +53,17 @@ mToolbarCoordinator.onToolbarInitialized(mToolbarManager); mNavigationController.onToolbarInitialized(mToolbarManager); } + + @Override + public void onFinishNativeInitialization() { + if (!ReengagementNotificationController.isEnabled()) return; + new OneShotCallback<>(mProfileSupplier, mCallbackController.makeCancelable(profile -> { + assert profile != null : "Unexpectedly null profile from TabModel."; + if (profile == null) return; + Tracker tracker = TrackerFactory.getTrackerForProfile(profile); + ReengagementNotificationController controller = new ReengagementNotificationController( + mActivity, tracker, ReengagementActivity.class); + controller.tryToReengageTheUser(); + })); + } }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/fullscreen/BrowserControlsManager.java b/chrome/android/java/src/org/chromium/chrome/browser/fullscreen/BrowserControlsManager.java index a4f494d..af18a4b 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/fullscreen/BrowserControlsManager.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/fullscreen/BrowserControlsManager.java
@@ -622,7 +622,10 @@ TabBrowserControlsOffsetHelper offsetHelper = null; if (tab != null) offsetHelper = TabBrowserControlsOffsetHelper.get(tab); - if (offsetHelper != null && offsetHelper.offsetInitialized()) { + // Browser controls should always be shown on native pages and restoring offsets might cause + // the controls to get stuck in an invalid position. + if (offsetHelper != null && offsetHelper.offsetInitialized() && tab != null + && !tab.isNativePage()) { updateBrowserControlsOffsets(false, offsetHelper.topControlsOffset(), offsetHelper.bottomControlsOffset(), offsetHelper.contentOffset(), offsetHelper.topControlsMinHeightOffset(),
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/notifications/NotificationUmaTracker.java b/chrome/android/java/src/org/chromium/chrome/browser/notifications/NotificationUmaTracker.java index d66f681..73623966 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/notifications/NotificationUmaTracker.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/notifications/NotificationUmaTracker.java
@@ -17,7 +17,6 @@ import org.chromium.base.ContextUtils; import org.chromium.base.MathUtils; -import org.chromium.base.library_loader.LibraryLoader; import org.chromium.base.metrics.RecordHistogram; import org.chromium.chrome.browser.notifications.channels.ChromeChannelDefinitions; import org.chromium.chrome.browser.preferences.ChromePreferenceKeys; @@ -54,7 +53,10 @@ SystemNotificationType.PERMISSION_REQUESTS, SystemNotificationType.PERMISSION_REQUESTS_HIGH, SystemNotificationType.ANNOUNCEMENT, SystemNotificationType.SHARE_SAVE_IMAGE, SystemNotificationType.TWA_DISCLOSURE_INITIAL, - SystemNotificationType.TWA_DISCLOSURE_SUBSEQUENT}) + SystemNotificationType.TWA_DISCLOSURE_SUBSEQUENT, + SystemNotificationType.CHROME_REENGAGEMENT_1, + SystemNotificationType.CHROME_REENGAGEMENT_2, + SystemNotificationType.CHROME_REENGAGEMENT_3}) @Retention(RetentionPolicy.SOURCE) public @interface SystemNotificationType { int UNKNOWN = -1; @@ -83,8 +85,11 @@ int SHARE_SAVE_IMAGE = 22; int TWA_DISCLOSURE_INITIAL = 23; int TWA_DISCLOSURE_SUBSEQUENT = 24; + int CHROME_REENGAGEMENT_1 = 25; + int CHROME_REENGAGEMENT_2 = 26; + int CHROME_REENGAGEMENT_3 = 27; - int NUM_ENTRIES = 25; + int NUM_ENTRIES = 28; } /* @@ -316,7 +321,6 @@ private static void recordHistogram(String name, @SystemNotificationType int type) { if (type == SystemNotificationType.UNKNOWN) return; - if (!LibraryLoader.getInstance().isInitialized()) return; RecordHistogram.recordEnumeratedHistogram(name, type, SystemNotificationType.NUM_ENTRIES); }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/notifications/channels/ChromeChannelDefinitions.java b/chrome/android/java/src/org/chromium/chrome/browser/notifications/channels/ChromeChannelDefinitions.java index 2e8ba69..9150c91 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/notifications/channels/ChromeChannelDefinitions.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/notifications/channels/ChromeChannelDefinitions.java
@@ -14,7 +14,6 @@ import org.chromium.chrome.R; import org.chromium.chrome.browser.webapps.WebApkServiceClient; import org.chromium.components.browser_ui.notifications.channels.ChannelDefinitions; -import org.chromium.components.browser_ui.notifications.channels.ChannelDefinitions.PredefinedChannel; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy;
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/omnibox/voice/AssistantVoiceSearchService.java b/chrome/android/java/src/org/chromium/chrome/browser/omnibox/voice/AssistantVoiceSearchService.java index 879b208..090a149d 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/omnibox/voice/AssistantVoiceSearchService.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/omnibox/voice/AssistantVoiceSearchService.java
@@ -55,10 +55,8 @@ } // Constants for Assistant Voice Search. - // TODO(crbug.com/1041576): Update this placeholder to a the real min version once the code has - // landed. @VisibleForTesting - public static final String DEFAULT_ASSISTANT_AGSA_MIN_VERSION = "10.98"; + public static final String DEFAULT_ASSISTANT_AGSA_MIN_VERSION = "11.7"; @VisibleForTesting public static final int DEFAULT_ASSISTANT_MIN_ANDROID_SDK_VERSION = Build.VERSION_CODES.LOLLIPOP;
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 f47251c..1227cd39 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
@@ -1299,7 +1299,9 @@ mPaymentUIsManager.getShippingAddressesSection().setErrorMessage(details.error); } - mPaymentUIsManager.enableUserInterfaceAfterPaymentRequestUpdateEvent(); + boolean providedInformationToPaymentRequestUI = + mPaymentUIsManager.enableAndUpdatePaymentRequestUIWithPaymentInfo(); + if (providedInformationToPaymentRequestUI) recordShowEventAndTransactionAmount(); } private void initializeWithUpdatedDetails(PaymentDetails details) { @@ -1343,7 +1345,9 @@ triggerPaymentAppUiSkipIfApplicable(chromeActivity); if (mIsFinishedQueryingPaymentApps && !mShouldSkipShowingPaymentRequestUi) { - mPaymentUIsManager.enableUserInterfaceAfterPaymentRequestUpdateEvent(); + boolean providedInformationToPaymentRequestUI = + mPaymentUIsManager.enableAndUpdatePaymentRequestUIWithPaymentInfo(); + if (providedInformationToPaymentRequestUI) recordShowEventAndTransactionAmount(); } } @@ -1367,7 +1371,9 @@ return; } - mPaymentUIsManager.enableUserInterfaceAfterPaymentRequestUpdateEvent(); + boolean providedInformationToPaymentRequestUI = + mPaymentUIsManager.enableAndUpdatePaymentRequestUIWithPaymentInfo(); + if (providedInformationToPaymentRequestUI) recordShowEventAndTransactionAmount(); } /** @@ -1457,37 +1463,24 @@ if (mWaitForUpdatedDetails) return; mHandler.post(() -> { - if (mPaymentUIsManager.getPaymentRequestUI() != null) providePaymentInformation(); + if (mPaymentUIsManager.getPaymentRequestUI() != null) { + mPaymentUIsManager.providePaymentInformationToPaymentRequestUI(); + recordShowEventAndTransactionAmount(); + } }); } - // Implement PaymentUIsManager.Delegate: - @Override - public void providePaymentInformation() { - // Do not display service worker payment apps summary in single line so as to display its - // origin completely. - mPaymentUIsManager.getPaymentMethodsSection() - .setDisplaySelectedItemSummaryInSingleLineInNormalMode( - mPaymentUIsManager.getSelectedPaymentAppType() - != PaymentAppType.SERVICE_WORKER_APP); - mPaymentUIsManager.getPaymentInformationCallback().onResult(new PaymentInformation( - mPaymentUIsManager.getUiShoppingCart(), - mPaymentUIsManager.getShippingAddressesSection(), - mPaymentUIsManager.getUiShippingOptions(), mPaymentUIsManager.getContactSection(), - mPaymentUIsManager.getPaymentMethodsSection())); - mPaymentUIsManager.setPaymentInformationCallback(null); - - if (!mDidRecordShowEvent) { - mDidRecordShowEvent = true; - mJourneyLogger.setEventOccurred(Event.SHOWN); - // Record the triggered transaction amount only when the total amount in details is - // finalized (i.e. mWaitForUpdatedDetails == false). Otherwise it will get recorded when - // the updated details become available. - if (!mWaitForUpdatedDetails) { - assert mRawTotal != null; - mJourneyLogger.recordTransactionAmount( - mRawTotal.amount.currency, mRawTotal.amount.value, false /*completed*/); - } + private void recordShowEventAndTransactionAmount() { + if (mDidRecordShowEvent) return; + mDidRecordShowEvent = true; + mJourneyLogger.setEventOccurred(Event.SHOWN); + // Record the triggered transaction amount only when the total amount in details is + // finalized (i.e. mWaitForUpdatedDetails == false). Otherwise it will get recorded when + // the updated details become available. + if (!mWaitForUpdatedDetails) { + assert mRawTotal != null; + mJourneyLogger.recordTransactionAmount( + mRawTotal.amount.currency, mRawTotal.amount.value, false /*completed*/); } } @@ -1676,7 +1669,8 @@ // information when cancelled). mPaymentUIsManager.getShippingAddressesSection().setSelectedItemIndex( SectionInformation.NO_SELECTION); - providePaymentInformation(); + mPaymentUIsManager.providePaymentInformationToPaymentRequestUI(); + recordShowEventAndTransactionAmount(); } else { if (toEdit == null) { // Address is complete and user was in the "Add flow": add an item to @@ -1699,7 +1693,8 @@ startShippingAddressChangeNormalization(editedAddress); } } else { - providePaymentInformation(); + mPaymentUIsManager.providePaymentInformationToPaymentRequestUI(); + recordShowEventAndTransactionAmount(); } if (!mRetryQueue.isEmpty()) mHandler.post(mRetryQueue.remove());
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/payments/ui/PaymentUIsManager.java b/chrome/android/java/src/org/chromium/chrome/browser/payments/ui/PaymentUIsManager.java index cd4c112..3a6206b3 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/payments/ui/PaymentUIsManager.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/payments/ui/PaymentUIsManager.java
@@ -77,8 +77,6 @@ /** The delegate of this class. */ public interface Delegate { - /** Provide payment information to the Payment Request UI. */ - void providePaymentInformation(); } /** @@ -278,11 +276,6 @@ mUiShippingOptions = uiShippingOptions; } - /** Get the PaymentInformation callback. */ - public Callback<PaymentInformation> getPaymentInformationCallback() { - return mPaymentInformationCallback; - } - /** * Set the call back of PaymentInformation. This callback would be invoked when the payment * information is retrieved. @@ -565,13 +558,17 @@ } /** - * Update Payment Request UI with the update event's information and enable the UI (The user - * interface is disabled with a "↻" spinner being displayed and the user is unable to interact - * with the user interface until this "enableUserInterface" method is called). + * Update Payment Request UI with the update event's information and enable the UI. This method + * should be called when the user interface is disabled with a "↻" spinner being displayed. The + * user is unable to interact with the user interface until this method is called. + * @return Whether this is the first time that payment information has been provided to the user + * interface, which indicates that the "UI shown" event should be recorded now. */ - public void enableUserInterfaceAfterPaymentRequestUpdateEvent() { + public boolean enableAndUpdatePaymentRequestUIWithPaymentInfo() { + boolean isFirstUpdate = false; if (mPaymentInformationCallback != null && mPaymentMethodsSection != null) { - mDelegate.providePaymentInformation(); + providePaymentInformationToPaymentRequestUI(); + isFirstUpdate = true; } else { mPaymentRequestUI.updateOrderSummarySection(mUiShoppingCart); if (shouldShowShippingSection()) { @@ -579,6 +576,7 @@ PaymentRequestUI.DataType.SHIPPING_OPTIONS, mUiShippingOptions); } } + return isFirstUpdate; } /** Implements {@link PaymentRequestUI.Client.shouldShowShippingSection}. */ @@ -667,4 +665,16 @@ mPaymentHandlerUi.clickSecurityIconForTest(); return true; } + + /** Provide PaymentInformation to the PaymentRequest UI. */ + public void providePaymentInformationToPaymentRequestUI() { + // Do not display service worker payment apps summary in single line so as to display its + // origin completely. + mPaymentMethodsSection.setDisplaySelectedItemSummaryInSingleLineInNormalMode( + getSelectedPaymentAppType() != PaymentAppType.SERVICE_WORKER_APP); + mPaymentInformationCallback.onResult( + new PaymentInformation(mUiShoppingCart, mShippingAddressesSection, + mUiShippingOptions, mContactSection, mPaymentMethodsSection)); + mPaymentInformationCallback = null; + } }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/reengagement/ReengagementNotificationController.java b/chrome/android/java/src/org/chromium/chrome/browser/reengagement/ReengagementNotificationController.java new file mode 100644 index 0000000..db28e8027 --- /dev/null +++ b/chrome/android/java/src/org/chromium/chrome/browser/reengagement/ReengagementNotificationController.java
@@ -0,0 +1,144 @@ +// 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.reengagement; + +import android.app.Activity; +import android.app.PendingIntent; +import android.content.Context; +import android.content.Intent; +import android.text.TextUtils; + +import androidx.annotation.StringRes; +import androidx.annotation.VisibleForTesting; + +import org.chromium.base.Callback; +import org.chromium.chrome.R; +import org.chromium.chrome.browser.DefaultBrowserInfo; +import org.chromium.chrome.browser.flags.ChromeFeatureList; +import org.chromium.chrome.browser.notifications.NotificationUmaTracker; +import org.chromium.chrome.browser.notifications.NotificationUmaTracker.SystemNotificationType; +import org.chromium.chrome.browser.notifications.NotificationWrapperBuilderFactory; +import org.chromium.chrome.browser.notifications.channels.ChromeChannelDefinitions.ChannelId; +import org.chromium.components.browser_ui.notifications.NotificationManagerProxy; +import org.chromium.components.browser_ui.notifications.NotificationManagerProxyImpl; +import org.chromium.components.browser_ui.notifications.NotificationMetadata; +import org.chromium.components.browser_ui.notifications.NotificationWrapper; +import org.chromium.components.browser_ui.notifications.NotificationWrapperBuilder; +import org.chromium.components.browser_ui.notifications.PendingIntentProvider; +import org.chromium.components.feature_engagement.FeatureConstants; +import org.chromium.components.feature_engagement.Tracker; + +/** + * Controller to manage when and how we show re-engagement notifications to users. + * TODO(crbug.com/1107536): Modularize this file. + */ +public class ReengagementNotificationController { + /** An {@link Intent} action to open Chrome to the NTP. */ + public static final String LAUNCH_NTP_ACTION = "launch_ntp"; + + @VisibleForTesting(otherwise = VisibleForTesting.PRIVATE) + protected static final String NOTIFICATION_TAG = "reengagement_notification"; + @VisibleForTesting(otherwise = VisibleForTesting.PRIVATE) + protected static final int NOTIFICATION_ID = 200; + + private final Context mContext; + private final Tracker mTracker; + private final Class<? extends Activity> mActivityClazz; + + /** @return Whether or not the re-engagement notification is enabled. */ + public static boolean isEnabled() { + return ChromeFeatureList.isEnabled(ChromeFeatureList.REENGAGEMENT_NOTIFICATION); + } + + /** Creates an instance of ReengagementNotificationController. */ + public ReengagementNotificationController( + Context context, Tracker tracker, Class<? extends Activity> activityClazz) { + mContext = context; + mTracker = tracker; + mActivityClazz = activityClazz; + } + + /** Attempt to re-engage the user by showing a notification (if criteria are met). */ + public void tryToReengageTheUser() { + if (!isEnabled()) return; + getDefaultBrowserInfo(info -> { + if (info == null || info.browserCount <= 1) return; + + if (showNotification(FeatureConstants.CHROME_REENGAGEMENT_NOTIFICATION_1_FEATURE)) { + return; + } + if (showNotification(FeatureConstants.CHROME_REENGAGEMENT_NOTIFICATION_2_FEATURE)) { + return; + } + if (showNotification(FeatureConstants.CHROME_REENGAGEMENT_NOTIFICATION_3_FEATURE)) { + return; + } + }); + } + + @VisibleForTesting(otherwise = VisibleForTesting.PRIVATE) + protected void getDefaultBrowserInfo(Callback<DefaultBrowserInfo.DefaultInfo> callback) { + DefaultBrowserInfo.getDefaultBrowserInfo(callback); + } + + private boolean showNotification(String feature) { + @StringRes + int titleId = 0; + @StringRes + int descriptionId = 0; + @SystemNotificationType + int notificationUmaType = SystemNotificationType.UNKNOWN; + + if (TextUtils.equals( + feature, FeatureConstants.CHROME_REENGAGEMENT_NOTIFICATION_1_FEATURE)) { + titleId = R.string.chrome_reengagement_notification_1_title; + descriptionId = R.string.chrome_reengagement_notification_1_description; + notificationUmaType = SystemNotificationType.CHROME_REENGAGEMENT_1; + } else if (TextUtils.equals( + feature, FeatureConstants.CHROME_REENGAGEMENT_NOTIFICATION_2_FEATURE)) { + titleId = R.string.chrome_reengagement_notification_2_title; + descriptionId = R.string.chrome_reengagement_notification_2_description; + notificationUmaType = SystemNotificationType.CHROME_REENGAGEMENT_2; + } else if (TextUtils.equals( + feature, FeatureConstants.CHROME_REENGAGEMENT_NOTIFICATION_3_FEATURE)) { + titleId = R.string.chrome_reengagement_notification_3_title; + descriptionId = R.string.chrome_reengagement_notification_3_description; + notificationUmaType = SystemNotificationType.CHROME_REENGAGEMENT_3; + } else { + return false; + } + + if (!mTracker.shouldTriggerHelpUI(feature)) return false; + mTracker.dismissed(feature); + + NotificationMetadata metadata = + new NotificationMetadata(notificationUmaType, NOTIFICATION_TAG, NOTIFICATION_ID); + NotificationWrapperBuilder builder = + NotificationWrapperBuilderFactory.createNotificationWrapperBuilder( + /* preferCompat = */ true, ChannelId.UPDATES, + /* remoteAppPackageName = */ null, metadata); + + Intent intent = new Intent(mContext, mActivityClazz); + intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); + intent.setAction(LAUNCH_NTP_ACTION); + + PendingIntentProvider intentProvider = PendingIntentProvider.getActivity( + mContext, 0, intent, PendingIntent.FLAG_UPDATE_CURRENT); + + builder.setContentTitle(mContext.getString(titleId)) + .setContentText(mContext.getString(descriptionId)) + .setSmallIcon(R.drawable.ic_chrome) + .setContentIntent(intentProvider) + .setAutoCancel(true); + + NotificationManagerProxy notificationManager = new NotificationManagerProxyImpl(mContext); + NotificationWrapper notification = builder.buildNotificationWrapper(); + notificationManager.notify(notification); + + NotificationUmaTracker.getInstance().onNotificationShown( + notificationUmaType, notification.getNotification()); + return true; + } +}
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ui/RootUiCoordinator.java b/chrome/android/java/src/org/chromium/chrome/browser/ui/RootUiCoordinator.java index 9c07d38..fac1f7b 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/ui/RootUiCoordinator.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/ui/RootUiCoordinator.java
@@ -15,6 +15,7 @@ import org.chromium.base.ApiCompatibilityUtils; import org.chromium.base.Callback; +import org.chromium.base.CallbackController; import org.chromium.base.TraceEvent; import org.chromium.base.metrics.RecordUserAction; import org.chromium.base.supplier.ObservableSupplier; @@ -138,11 +139,12 @@ private ToolbarActionModeCallback mActionModeControllerCallback; private ObservableSupplierImpl<Boolean> mOmniboxFocusStateSupplier = new ObservableSupplierImpl<>(); - private final ObservableSupplier<Profile> mProfileSupplier; + protected final ObservableSupplier<Profile> mProfileSupplier; private final ObservableSupplier<BookmarkBridge> mBookmarkBridgeSupplier; private final ObservableSupplierImpl<AppMenuCoordinator> mAppMenuSupplier; private BottomSheetObserver mContextualSearchSuppressor; private final Supplier<ContextualSearchManager> mContextualSearchManagerSupplier; + protected final CallbackController mCallbackController; /** * Create a new {@link RootUiCoordinator} for the given activity. @@ -165,6 +167,7 @@ ObservableSupplier<BookmarkBridge> bookmarkBridgeSupplier, ObservableSupplier<OverviewModeBehavior> overviewModeBehaviorSupplier, Supplier<ContextualSearchManager> contextualSearchManagerSupplier) { + mCallbackController = new CallbackController(); mActivity = activity; mOnOmniboxFocusChangedListener = onOmniboxFocusChangedListener; mActivity.getLifecycleDispatcher().register(this); @@ -199,6 +202,7 @@ @Override public void destroy() { + mCallbackController.destroy(); mMenuOrKeyboardActionController.unregisterMenuOrKeyboardActionHandler(this); mActivity.getLayoutManagerSupplier().removeObserver(mLayoutManagerSupplierCallback);
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 55f7da24..76ad607 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/TabsTest.java +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/TabsTest.java
@@ -390,7 +390,7 @@ } private void scrollDown() { - fling(0.f, 0.5f, 0.f, 0.75f, 100); + fling(0.f, 0.9f, 0.f, 0.1f, 100); } /**
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/reengagement/ReengagementNotificationControllerIntegrationTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/reengagement/ReengagementNotificationControllerIntegrationTest.java new file mode 100644 index 0000000..52e2e0d --- /dev/null +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/reengagement/ReengagementNotificationControllerIntegrationTest.java
@@ -0,0 +1,381 @@ +// 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.reengagement; + +import static org.mockito.Mockito.doReturn; +import static org.mockito.Mockito.never; +import static org.mockito.Mockito.reset; +import static org.mockito.Mockito.times; +import static org.mockito.Mockito.verify; + +import android.annotation.TargetApi; +import android.app.Notification; +import android.app.NotificationManager; +import android.content.Context; +import android.content.Intent; +import android.os.Build; +import android.service.notification.StatusBarNotification; +import android.support.test.InstrumentationRegistry; +import android.text.TextUtils; + +import androidx.annotation.StringRes; +import androidx.test.filters.MediumTest; +import androidx.test.filters.SmallTest; + +import org.junit.After; +import org.junit.Assert; +import org.junit.Before; +import org.junit.Rule; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.mockito.Mock; +import org.mockito.junit.MockitoJUnit; +import org.mockito.junit.MockitoRule; + +import org.chromium.base.FeatureList; +import org.chromium.base.test.util.CallbackHelper; +import org.chromium.base.test.util.CommandLineFlags; +import org.chromium.base.test.util.UrlUtils; +import org.chromium.chrome.R; +import org.chromium.chrome.browser.DefaultBrowserInfo; +import org.chromium.chrome.browser.app.reengagement.ReengagementActivity; +import org.chromium.chrome.browser.customtabs.CustomTabActivityTestRule; +import org.chromium.chrome.browser.customtabs.CustomTabsTestUtils; +import org.chromium.chrome.browser.feature_engagement.TrackerFactory; +import org.chromium.chrome.browser.flags.ChromeFeatureList; +import org.chromium.chrome.browser.flags.ChromeSwitches; +import org.chromium.chrome.browser.ntp.NewTabPage; +import org.chromium.chrome.browser.tab.Tab; +import org.chromium.chrome.browser.tab.TabCreationState; +import org.chromium.chrome.browser.tabmodel.EmptyTabModelSelectorObserver; +import org.chromium.chrome.browser.tabmodel.TabModelSelectorObserver; +import org.chromium.chrome.test.ChromeJUnit4ClassRunner; +import org.chromium.chrome.test.ChromeTabbedActivityTestRule; +import org.chromium.components.feature_engagement.EventConstants; +import org.chromium.components.feature_engagement.FeatureConstants; +import org.chromium.components.feature_engagement.Tracker; +import org.chromium.content_public.browser.test.util.CriteriaHelper; +import org.chromium.content_public.browser.test.util.TestThreadUtils; +import org.chromium.content_public.common.ContentUrlConstants; + +import java.util.HashMap; +import java.util.Map; + +/** Integration tests for {@link ReengagementNotificationController}. */ +@RunWith(ChromeJUnit4ClassRunner.class) +@CommandLineFlags.Add({ChromeSwitches.DISABLE_FIRST_RUN_EXPERIENCE}) +public class ReengagementNotificationControllerIntegrationTest { + @Rule + public ChromeTabbedActivityTestRule mTabbedActivityTestRule = + new ChromeTabbedActivityTestRule(); + + @Rule + public CustomTabActivityTestRule mCustomTabActivityTestRule = new CustomTabActivityTestRule(); + + @Rule + public MockitoRule mMockitoRule = MockitoJUnit.rule(); + + @Mock + public Tracker mTracker; + + @Before + public void setUp() throws Exception { + reset(mTracker); + FeatureList.setTestCanUseDefaultsForTesting(); + setReengagementNotificationEnabled(true); + TrackerFactory.setTrackerForTests(mTracker); + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) closeReengagementNotifications(); + } + + @After + public void tearDown() { + TrackerFactory.setTrackerForTests(null); + DefaultBrowserInfo.clearDefaultInfoForTests(); + FeatureList.resetTestCanUseDefaultsForTesting(); + FeatureList.setTestFeatures(null); + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) closeReengagementNotifications(); + } + + @Test + @MediumTest + public void testReengagementNotificationSent() { + DefaultBrowserInfo.setDefaultInfoForTests( + createDefaultInfo(/* passesPrecondition = */ true)); + doReturn(true).when(mTracker).shouldTriggerHelpUI( + FeatureConstants.CHROME_REENGAGEMENT_NOTIFICATION_1_FEATURE); + mCustomTabActivityTestRule.startCustomTabActivityWithIntent( + CustomTabsTestUtils.createMinimalCustomTabIntent( + InstrumentationRegistry.getTargetContext(), + ContentUrlConstants.ABOUT_BLANK_DISPLAY_URL)); + verify(mTracker, times(1)) + .shouldTriggerHelpUI(FeatureConstants.CHROME_REENGAGEMENT_NOTIFICATION_1_FEATURE); + verify(mTracker, times(1)) + .dismissed(FeatureConstants.CHROME_REENGAGEMENT_NOTIFICATION_1_FEATURE); + + verifyNotification(R.string.chrome_reengagement_notification_1_title, + R.string.chrome_reengagement_notification_1_description); + } + + @Test + @MediumTest + public void testReengagementDifferentNotificationSent() { + DefaultBrowserInfo.setDefaultInfoForTests( + createDefaultInfo(/* passesPrecondition = */ true)); + doReturn(true).when(mTracker).shouldTriggerHelpUI( + FeatureConstants.CHROME_REENGAGEMENT_NOTIFICATION_2_FEATURE); + mCustomTabActivityTestRule.startCustomTabActivityWithIntent( + CustomTabsTestUtils.createMinimalCustomTabIntent( + InstrumentationRegistry.getTargetContext(), + ContentUrlConstants.ABOUT_BLANK_DISPLAY_URL)); + verify(mTracker, times(1)) + .shouldTriggerHelpUI(FeatureConstants.CHROME_REENGAGEMENT_NOTIFICATION_2_FEATURE); + verify(mTracker, times(1)) + .dismissed(FeatureConstants.CHROME_REENGAGEMENT_NOTIFICATION_2_FEATURE); + + verifyNotification(R.string.chrome_reengagement_notification_2_title, + R.string.chrome_reengagement_notification_2_description); + } + + @Test + @MediumTest + public void testReengagementNotificationNotSentDueToIPH() { + DefaultBrowserInfo.setDefaultInfoForTests( + createDefaultInfo(/* passesPrecondition = */ true)); + mCustomTabActivityTestRule.startCustomTabActivityWithIntent( + CustomTabsTestUtils.createMinimalCustomTabIntent( + InstrumentationRegistry.getTargetContext(), + ContentUrlConstants.ABOUT_BLANK_DISPLAY_URL)); + verifyHasNoNotifications(); + verify(mTracker, times(1)) + .shouldTriggerHelpUI(FeatureConstants.CHROME_REENGAGEMENT_NOTIFICATION_1_FEATURE); + verify(mTracker, times(1)) + .shouldTriggerHelpUI(FeatureConstants.CHROME_REENGAGEMENT_NOTIFICATION_2_FEATURE); + verify(mTracker, times(1)) + .shouldTriggerHelpUI(FeatureConstants.CHROME_REENGAGEMENT_NOTIFICATION_3_FEATURE); + verify(mTracker, never()) + .dismissed(FeatureConstants.CHROME_REENGAGEMENT_NOTIFICATION_1_FEATURE); + verify(mTracker, never()) + .dismissed(FeatureConstants.CHROME_REENGAGEMENT_NOTIFICATION_2_FEATURE); + verify(mTracker, never()) + .dismissed(FeatureConstants.CHROME_REENGAGEMENT_NOTIFICATION_3_FEATURE); + } + + @Test + @MediumTest + public void testReengagementNotificationNotSentDueToPreconditions() { + DefaultBrowserInfo.setDefaultInfoForTests( + createDefaultInfo(/* passesPrecondition = */ false)); + mCustomTabActivityTestRule.startCustomTabActivityWithIntent( + CustomTabsTestUtils.createMinimalCustomTabIntent( + InstrumentationRegistry.getTargetContext(), + ContentUrlConstants.ABOUT_BLANK_DISPLAY_URL)); + verifyHasNoNotifications(); + verify(mTracker, never()) + .shouldTriggerHelpUI(FeatureConstants.CHROME_REENGAGEMENT_NOTIFICATION_1_FEATURE); + verify(mTracker, never()) + .shouldTriggerHelpUI(FeatureConstants.CHROME_REENGAGEMENT_NOTIFICATION_2_FEATURE); + verify(mTracker, never()) + .shouldTriggerHelpUI(FeatureConstants.CHROME_REENGAGEMENT_NOTIFICATION_3_FEATURE); + verify(mTracker, never()) + .dismissed(FeatureConstants.CHROME_REENGAGEMENT_NOTIFICATION_1_FEATURE); + verify(mTracker, never()) + .dismissed(FeatureConstants.CHROME_REENGAGEMENT_NOTIFICATION_2_FEATURE); + verify(mTracker, never()) + .dismissed(FeatureConstants.CHROME_REENGAGEMENT_NOTIFICATION_3_FEATURE); + } + + @Test + @MediumTest + public void testReengagementNotificationNotSentDueToUnavailablePreconditions() { + DefaultBrowserInfo.setDefaultInfoForTests(null); + mCustomTabActivityTestRule.startCustomTabActivityWithIntent( + CustomTabsTestUtils.createMinimalCustomTabIntent( + InstrumentationRegistry.getTargetContext(), + ContentUrlConstants.ABOUT_BLANK_DISPLAY_URL)); + verifyHasNoNotifications(); + verify(mTracker, never()) + .shouldTriggerHelpUI(FeatureConstants.CHROME_REENGAGEMENT_NOTIFICATION_1_FEATURE); + verify(mTracker, never()) + .shouldTriggerHelpUI(FeatureConstants.CHROME_REENGAGEMENT_NOTIFICATION_2_FEATURE); + verify(mTracker, never()) + .shouldTriggerHelpUI(FeatureConstants.CHROME_REENGAGEMENT_NOTIFICATION_3_FEATURE); + verify(mTracker, never()) + .dismissed(FeatureConstants.CHROME_REENGAGEMENT_NOTIFICATION_1_FEATURE); + verify(mTracker, never()) + .dismissed(FeatureConstants.CHROME_REENGAGEMENT_NOTIFICATION_2_FEATURE); + verify(mTracker, never()) + .dismissed(FeatureConstants.CHROME_REENGAGEMENT_NOTIFICATION_3_FEATURE); + } + + @Test + @SmallTest + public void testEngagementTracked() { + mTabbedActivityTestRule.startMainActivityFromLauncher(); + verify(mTracker, times(1)).notifyEvent(EventConstants.STARTED_FROM_MAIN_INTENT); + } + + @Test + @SmallTest + public void testEngagementNotTracked() { + mCustomTabActivityTestRule.startCustomTabActivityWithIntent( + CustomTabsTestUtils.createMinimalCustomTabIntent( + InstrumentationRegistry.getTargetContext(), + ContentUrlConstants.ABOUT_BLANK_DISPLAY_URL)); + verify(mTracker, never()).notifyEvent(EventConstants.STARTED_FROM_MAIN_INTENT); + } + + @Test + @SmallTest + public void testEngagementTrackedWhenDisabled() { + setReengagementNotificationEnabled(false); + mTabbedActivityTestRule.startMainActivityFromLauncher(); + verify(mTracker, times(1)).notifyEvent(EventConstants.STARTED_FROM_MAIN_INTENT); + } + + @Test + @SmallTest + public void testEngagementNotTrackedDueToIntentOpeningTab() { + mTabbedActivityTestRule.startMainActivityWithURL( + UrlUtils.encodeHtmlDataUri("<html><head></head><body>foo</body></html>")); + verify(mTracker, never()).notifyEvent(EventConstants.STARTED_FROM_MAIN_INTENT); + } + + @Test + @MediumTest + public void testEngagementNotificationNotSentDueToDisabled() { + setReengagementNotificationEnabled(false); + DefaultBrowserInfo.setDefaultInfoForTests( + createDefaultInfo(/* passesPrecondition = */ true)); + mCustomTabActivityTestRule.startCustomTabActivityWithIntent( + CustomTabsTestUtils.createMinimalCustomTabIntent( + InstrumentationRegistry.getTargetContext(), + ContentUrlConstants.ABOUT_BLANK_DISPLAY_URL)); + verifyHasNoNotifications(); + verify(mTracker, never()) + .shouldTriggerHelpUI(FeatureConstants.CHROME_REENGAGEMENT_NOTIFICATION_1_FEATURE); + verify(mTracker, never()) + .shouldTriggerHelpUI(FeatureConstants.CHROME_REENGAGEMENT_NOTIFICATION_2_FEATURE); + verify(mTracker, never()) + .shouldTriggerHelpUI(FeatureConstants.CHROME_REENGAGEMENT_NOTIFICATION_3_FEATURE); + verify(mTracker, never()) + .dismissed(FeatureConstants.CHROME_REENGAGEMENT_NOTIFICATION_1_FEATURE); + verify(mTracker, never()) + .dismissed(FeatureConstants.CHROME_REENGAGEMENT_NOTIFICATION_2_FEATURE); + verify(mTracker, never()) + .dismissed(FeatureConstants.CHROME_REENGAGEMENT_NOTIFICATION_3_FEATURE); + } + + @Test + @MediumTest + public void testReengagementActivity() throws Exception { + mTabbedActivityTestRule.startMainActivityOnBlankPage(); + int initialTabCount = + mTabbedActivityTestRule.getActivity().getTabModelSelector().getTotalTabCount(); + + final CallbackHelper tabAddedCallback = new CallbackHelper(); + TabModelSelectorObserver selectorObserver = new EmptyTabModelSelectorObserver() { + @Override + public void onNewTabCreated(Tab tab, @TabCreationState int creationState) { + tabAddedCallback.notifyCalled(); + } + }; + mTabbedActivityTestRule.getActivity().getTabModelSelector().addObserver(selectorObserver); + + Intent intent = + new Intent(InstrumentationRegistry.getTargetContext(), ReengagementActivity.class); + intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); + intent.setAction(ReengagementNotificationController.LAUNCH_NTP_ACTION); + InstrumentationRegistry.getInstrumentation().startActivitySync(intent); + + tabAddedCallback.waitForCallback(0); + Tab tab = TestThreadUtils.runOnUiThreadBlocking( + () -> mTabbedActivityTestRule.getActivity().getActivityTab()); + Assert.assertTrue(NewTabPage.isNTPUrl(tab.getUrl())); + Assert.assertFalse(tab.isIncognito()); + Assert.assertEquals(initialTabCount + 1, + mTabbedActivityTestRule.getActivity().getTabModelSelector().getTotalTabCount()); + } + + private void verifyNotification(@StringRes int title, @StringRes int description) { + if (Build.VERSION.SDK_INT < Build.VERSION_CODES.M) return; + + CriteriaHelper.pollUiThread(() -> { return findNotification(title, description); }); + } + + private void verifyHasNoNotifications() { + if (Build.VERSION.SDK_INT < Build.VERSION_CODES.M) return; + + Assert.assertFalse(hasNotifications()); + } + + @TargetApi(Build.VERSION_CODES.M) + private static boolean findNotification(@StringRes int title, @StringRes int description) { + Context context = InstrumentationRegistry.getTargetContext(); + StatusBarNotification[] notifications = + ((NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE)) + .getActiveNotifications(); + + String titleStr = context.getString(title); + String descriptionStr = context.getString(description); + + for (StatusBarNotification notification : notifications) { + CharSequence notifTitle = + notification.getNotification().extras.getCharSequence(Notification.EXTRA_TITLE); + CharSequence notifDescription = + notification.getNotification().extras.getCharSequence(Notification.EXTRA_TEXT); + if (TextUtils.equals(titleStr, notifTitle) + && TextUtils.equals(descriptionStr, notifDescription)) { + return true; + } + } + + return false; + } + + @TargetApi(Build.VERSION_CODES.M) + private static boolean hasNotifications() { + Context context = InstrumentationRegistry.getTargetContext(); + StatusBarNotification[] notifications = + ((NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE)) + .getActiveNotifications(); + + for (StatusBarNotification notification : notifications) { + String tag = notification.getTag(); + if (TextUtils.equals(ReengagementNotificationController.NOTIFICATION_TAG, tag)) { + return true; + } + } + + return false; + } + + @TargetApi(Build.VERSION_CODES.M) + private static void closeReengagementNotifications() { + if (!hasNotifications()) return; + + Context context = InstrumentationRegistry.getTargetContext(); + ((NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE)) + .cancel(ReengagementNotificationController.NOTIFICATION_TAG, + ReengagementNotificationController.NOTIFICATION_ID); + } + + private DefaultBrowserInfo.DefaultInfo createDefaultInfo(boolean passesPrecondition) { + int browserCount = passesPrecondition ? 2 : 1; + return new DefaultBrowserInfo.DefaultInfo(/* isChromeSystem = */ true, + /* isChromeDefault = */ true, + /* isDefaultSystem = */ true, /* hasDefault = */ true, browserCount, + /* systemCount = */ 0); + } + + private static void setReengagementNotificationEnabled(boolean enabled) { + Map<String, Boolean> features = new HashMap<>(); + features.put(ChromeFeatureList.REENGAGEMENT_NOTIFICATION, enabled); + // TODO(crbug.com/1111584): Remove these overrides when FeatureList#isInitialized() works + // as expected with test values. + features.put(ChromeFeatureList.SEARCH_ENGINE_PROMO_EXISTING_DEVICE, false); + features.put(ChromeFeatureList.OMNIBOX_SEARCH_ENGINE_LOGO, false); + FeatureList.setTestFeatures(features); + } +} \ No newline at end of file
diff --git a/chrome/android/junit/DEPS b/chrome/android/junit/DEPS index 0063f1b..6e5c1e9 100644 --- a/chrome/android/junit/DEPS +++ b/chrome/android/junit/DEPS
@@ -15,6 +15,7 @@ "+components/browser_ui/notifications/android", "+components/browser_ui/widget/android", "+components/dom_distiller/core", + "+components/feature_engagement/public/android", "+components/offline_items_collection/core/android/java/src", "+components/omnibox/browser/android/java/src/org/chromium/components/omnibox", "+components/payments/content/android/java/src/org/chromium/components/payments",
diff --git a/chrome/android/junit/src/org/chromium/chrome/browser/feed/v2/FeedStreamSurfaceTest.java b/chrome/android/junit/src/org/chromium/chrome/browser/feed/v2/FeedStreamSurfaceTest.java index 11325020..e5904df6 100644 --- a/chrome/android/junit/src/org/chromium/chrome/browser/feed/v2/FeedStreamSurfaceTest.java +++ b/chrome/android/junit/src/org/chromium/chrome/browser/feed/v2/FeedStreamSurfaceTest.java
@@ -39,9 +39,11 @@ import org.mockito.ArgumentMatchers; import org.mockito.Captor; import org.mockito.Mock; +import org.mockito.Mockito; import org.mockito.MockitoAnnotations; import org.robolectric.Robolectric; import org.robolectric.annotation.Config; +import org.robolectric.shadows.ShadowLog; import org.chromium.base.Callback; import org.chromium.base.test.BaseRobolectricTestRunner; @@ -130,13 +132,15 @@ AppHooks.setInstanceForTesting(mAppHooks); Profile.setLastUsedProfileForTesting(mProfileMock); - mFeedStreamSurface = new FeedStreamSurface(mActivity, false, mSnackbarManager, - mPageNavigationDelegate, mBottomSheetController, mHelpAndFeedback); + mFeedStreamSurface = Mockito.spy(new FeedStreamSurface(mActivity, false, mSnackbarManager, + mPageNavigationDelegate, mBottomSheetController, mHelpAndFeedback)); mContentManager = mFeedStreamSurface.getFeedListContentManagerForTesting(); - - mRecyclerView = (RecyclerView) mFeedStreamSurface.getView(); + mFeedStreamSurface.mRootView = Mockito.spy(mFeedStreamSurface.mRootView); + mRecyclerView = mFeedStreamSurface.mRootView; mLayoutManager = new FakeLinearLayoutManager(mActivity); mRecyclerView.setLayoutManager(mLayoutManager); + // Print logs to stdout. + ShadowLog.stream = System.out; } @After @@ -398,7 +402,7 @@ @SmallTest public void testNavigateTab() { when(mPageNavigationDelegate.openUrl(anyInt(), any())).thenReturn(new MockTab(1, false)); - mFeedStreamSurface.navigateTab(TEST_URL); + mFeedStreamSurface.navigateTab(TEST_URL, null); verify(mPageNavigationDelegate) .openUrl(ArgumentMatchers.eq(WindowOpenDisposition.CURRENT_TAB), any()); } @@ -594,6 +598,146 @@ verify(mProcessScope).resetAccount(); } + @Test + @SmallTest + public void testFindChildViewContainingDescendentNullParameters() { + View v = new View(mActivity); + assertEquals(null, mFeedStreamSurface.findChildViewContainingDescendent(null, v)); + assertEquals(null, mFeedStreamSurface.findChildViewContainingDescendent(v, null)); + } + + @Test + @SmallTest + public void testFindChildViewContainingDescendentNotADescendent() { + View v1 = new View(mActivity); + LinearLayout v2 = new LinearLayout(mActivity); + View v2Child = new View(mActivity); + v2.addView(v2Child); + + assertEquals(null, mFeedStreamSurface.findChildViewContainingDescendent(v1, v2)); + assertEquals(null, mFeedStreamSurface.findChildViewContainingDescendent(v1, v2Child)); + } + + @Test + @SmallTest + public void testFindChildViewContainingDescendentDirectDescendent() { + LinearLayout parent = new LinearLayout(mActivity); + View child = new View(mActivity); + parent.addView(child); + + assertEquals(child, mFeedStreamSurface.findChildViewContainingDescendent(parent, child)); + } + + @Test + @SmallTest + public void testFindChildViewContainingDescendentIndirectDescendent() { + LinearLayout parent = new LinearLayout(mActivity); + LinearLayout child = new LinearLayout(mActivity); + View grandChild = new View(mActivity); + parent.addView(child); + child.addView(grandChild); + + assertEquals( + child, mFeedStreamSurface.findChildViewContainingDescendent(parent, grandChild)); + } + + @Test + @SmallTest + public void testNavigateReportsCorrectSlice() { + StreamUpdate update = StreamUpdate.newBuilder() + .addUpdatedSlices(createSliceUpdateForNewXSurfaceSlice("a")) + .addUpdatedSlices(createSliceUpdateForNewXSurfaceSlice("b")) + .build(); + mFeedStreamSurface.onStreamUpdated(update.toByteArray()); + + View childA = new View(mActivity); + mRecyclerView.addView(childA); + View childB = new View(mActivity); + mRecyclerView.addView(childB); + + // findChildViewContainingDescendent() won't work on its own because mRecyclerView is a + // mockito spy, and therefore child.getParent() != mRecyclerView. + Mockito.doReturn(childA) + .when(mFeedStreamSurface) + .findChildViewContainingDescendent(mRecyclerView, childA); + Mockito.doReturn(childB) + .when(mFeedStreamSurface) + .findChildViewContainingDescendent(mRecyclerView, childB); + Mockito.doReturn(0).when(mRecyclerView).getChildAdapterPosition(childA); + Mockito.doReturn(1).when(mRecyclerView).getChildAdapterPosition(childB); + + mFeedStreamSurface.navigateTab("http://someurl", childB); + mFeedStreamSurface.navigateNewTab("http://someurl", childA); + + verify(mFeedStreamSurfaceJniMock) + .reportOpenAction(anyLong(), any(FeedStreamSurface.class), eq("b")); + verify(mFeedStreamSurfaceJniMock) + .reportOpenInNewTabAction(anyLong(), any(FeedStreamSurface.class), eq("a")); + } + + @Test + @SmallTest + public void testNavigateFromBottomSheetReportsCorrectSlice() { + StreamUpdate update = StreamUpdate.newBuilder() + .addUpdatedSlices(createSliceUpdateForNewXSurfaceSlice("a")) + .addUpdatedSlices(createSliceUpdateForNewXSurfaceSlice("b")) + .build(); + mFeedStreamSurface.onStreamUpdated(update.toByteArray()); + + View childA = new View(mActivity); + mRecyclerView.addView(childA); + View childB = new View(mActivity); + mRecyclerView.addView(childB); + LinearLayout bottomSheetView = new LinearLayout(mActivity); + View menuItem = new View(mActivity); + bottomSheetView.addView(menuItem); + + // findChildViewContainingDescendent() won't work on its own because mRecyclerView is a + // mockito spy, and therefore child.getParent() != mRecyclerView. + Mockito.doReturn(childA) + .when(mFeedStreamSurface) + .findChildViewContainingDescendent(mRecyclerView, childA); + Mockito.doReturn(childB) + .when(mFeedStreamSurface) + .findChildViewContainingDescendent(mRecyclerView, childB); + Mockito.doReturn(0).when(mRecyclerView).getChildAdapterPosition(childA); + Mockito.doReturn(1).when(mRecyclerView).getChildAdapterPosition(childB); + + mFeedStreamSurface.showBottomSheet(bottomSheetView, childB); + mFeedStreamSurface.navigateTab("http://someurl", menuItem); + mFeedStreamSurface.dismissBottomSheet(); + mFeedStreamSurface.navigateNewTab("http://someurl", menuItem); + + verify(mFeedStreamSurfaceJniMock) + .reportOpenAction(anyLong(), any(FeedStreamSurface.class), eq("b")); + // Bottom sheet closed for this navigation, so slice cannot be found. + verify(mFeedStreamSurfaceJniMock) + .reportOpenInNewTabAction(anyLong(), any(FeedStreamSurface.class), eq("")); + } + + @Test + @SmallTest + public void testNavigateNoSliceFound() { + StreamUpdate update = StreamUpdate.newBuilder() + .addUpdatedSlices(createSliceUpdateForNewXSurfaceSlice("a")) + .addUpdatedSlices(createSliceUpdateForNewXSurfaceSlice("b")) + .build(); + mFeedStreamSurface.onStreamUpdated(update.toByteArray()); + + View nonConnectedView = new View(mActivity); + + // findChildViewContainingDescendent() won't work on its own because mRecyclerView is a + // mockito spy, and therefore child.getParent() != mRecyclerView. + Mockito.doReturn(null) + .when(mFeedStreamSurface) + .findChildViewContainingDescendent(mRecyclerView, nonConnectedView); + + mFeedStreamSurface.navigateTab("http://someurl", nonConnectedView); + + verify(mFeedStreamSurfaceJniMock) + .reportOpenAction(anyLong(), any(FeedStreamSurface.class), eq("")); + } + private SliceUpdate createSliceUpdateForExistingSlice(String sliceId) { return SliceUpdate.newBuilder().setSliceId(sliceId).build(); }
diff --git a/chrome/android/junit/src/org/chromium/chrome/browser/reengagement/ReengagementNotificationControllerTest.java b/chrome/android/junit/src/org/chromium/chrome/browser/reengagement/ReengagementNotificationControllerTest.java new file mode 100644 index 0000000..52dfba61 --- /dev/null +++ b/chrome/android/junit/src/org/chromium/chrome/browser/reengagement/ReengagementNotificationControllerTest.java
@@ -0,0 +1,279 @@ +// 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.reengagement; + +import static org.mockito.Mockito.doReturn; +import static org.mockito.Mockito.times; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.verifyNoMoreInteractions; + +import android.app.Activity; +import android.app.Notification; +import android.app.NotificationManager; +import android.content.Context; +import android.os.Handler; +import android.text.TextUtils; + +import androidx.test.core.app.ApplicationProvider; + +import org.junit.After; +import org.junit.Assert; +import org.junit.Before; +import org.junit.Rule; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.mockito.Mock; +import org.mockito.junit.MockitoJUnit; +import org.mockito.junit.MockitoRule; +import org.robolectric.Shadows; +import org.robolectric.annotation.Config; +import org.robolectric.shadows.ShadowNotificationManager; + +import org.chromium.base.Callback; +import org.chromium.base.FeatureList; +import org.chromium.base.metrics.test.ShadowRecordHistogram; +import org.chromium.base.test.BaseRobolectricTestRunner; +import org.chromium.chrome.R; +import org.chromium.chrome.browser.DefaultBrowserInfo; +import org.chromium.chrome.browser.flags.ChromeFeatureList; +import org.chromium.chrome.browser.notifications.NotificationUmaTracker; +import org.chromium.components.feature_engagement.FeatureConstants; +import org.chromium.components.feature_engagement.Tracker; + +import java.util.Collections; + +/** Unit tests for {@link ReengagementNotificationController}. */ +@RunWith(BaseRobolectricTestRunner.class) +@Config(shadows = {ShadowNotificationManager.class, ShadowRecordHistogram.class}) +public class ReengagementNotificationControllerTest { + @Rule + public MockitoRule mMockitoRule = MockitoJUnit.rule(); + + @Mock + public Tracker mTracker; + + private Context mContext; + private ShadowNotificationManager mShadowNotificationManager; + + private class TestingReengagementNotificationController + extends ReengagementNotificationController { + private DefaultBrowserInfo.DefaultInfo mInfo; + + TestingReengagementNotificationController(DefaultBrowserInfo.DefaultInfo info) { + super(mContext, mTracker, Activity.class); + mInfo = info; + } + + @Override + protected void getDefaultBrowserInfo(Callback<DefaultBrowserInfo.DefaultInfo> callback) { + new Handler().post(() -> callback.onResult(mInfo)); + } + } + + @Before + public void setUp() throws Exception { + FeatureList.setTestFeatures( + Collections.singletonMap(ChromeFeatureList.REENGAGEMENT_NOTIFICATION, true)); + mContext = ApplicationProvider.getApplicationContext(); + mShadowNotificationManager = Shadows.shadowOf( + (NotificationManager) mContext.getSystemService(Context.NOTIFICATION_SERVICE)); + ShadowRecordHistogram.reset(); + } + + @After + public void tearDown() { + ShadowRecordHistogram.reset(); + } + + @Test + public void testReengagementFirstFeature() { + ReengagementNotificationController controller = + new TestingReengagementNotificationController( + createDefaultInfo(/* passesPrecondition = */ true)); + doReturn(true).when(mTracker).shouldTriggerHelpUI( + FeatureConstants.CHROME_REENGAGEMENT_NOTIFICATION_1_FEATURE); + doReturn(false).when(mTracker).shouldTriggerHelpUI( + FeatureConstants.CHROME_REENGAGEMENT_NOTIFICATION_2_FEATURE); + doReturn(false).when(mTracker).shouldTriggerHelpUI( + FeatureConstants.CHROME_REENGAGEMENT_NOTIFICATION_3_FEATURE); + controller.tryToReengageTheUser(); + + testFeatureShowed(FeatureConstants.CHROME_REENGAGEMENT_NOTIFICATION_1_FEATURE); + } + + @Test + public void testReengagementSecondFeature() { + ReengagementNotificationController controller = + new TestingReengagementNotificationController( + createDefaultInfo(/* passesPrecondition = */ true)); + doReturn(false).when(mTracker).shouldTriggerHelpUI( + FeatureConstants.CHROME_REENGAGEMENT_NOTIFICATION_1_FEATURE); + doReturn(true).when(mTracker).shouldTriggerHelpUI( + FeatureConstants.CHROME_REENGAGEMENT_NOTIFICATION_2_FEATURE); + doReturn(false).when(mTracker).shouldTriggerHelpUI( + FeatureConstants.CHROME_REENGAGEMENT_NOTIFICATION_3_FEATURE); + controller.tryToReengageTheUser(); + + testFeatureShowed(FeatureConstants.CHROME_REENGAGEMENT_NOTIFICATION_2_FEATURE); + } + + @Test + public void testReengagementThirdFeature() { + ReengagementNotificationController controller = + new TestingReengagementNotificationController( + createDefaultInfo(/* passesPrecondition = */ true)); + doReturn(false).when(mTracker).shouldTriggerHelpUI( + FeatureConstants.CHROME_REENGAGEMENT_NOTIFICATION_1_FEATURE); + doReturn(false).when(mTracker).shouldTriggerHelpUI( + FeatureConstants.CHROME_REENGAGEMENT_NOTIFICATION_2_FEATURE); + doReturn(true).when(mTracker).shouldTriggerHelpUI( + FeatureConstants.CHROME_REENGAGEMENT_NOTIFICATION_3_FEATURE); + controller.tryToReengageTheUser(); + + testFeatureShowed(FeatureConstants.CHROME_REENGAGEMENT_NOTIFICATION_3_FEATURE); + } + + @Test + public void testReengagementTwoFeaturesMet() { + ReengagementNotificationController controller = + new TestingReengagementNotificationController( + createDefaultInfo(/* passesPrecondition = */ true)); + doReturn(false).when(mTracker).shouldTriggerHelpUI( + FeatureConstants.CHROME_REENGAGEMENT_NOTIFICATION_1_FEATURE); + doReturn(true).when(mTracker).shouldTriggerHelpUI( + FeatureConstants.CHROME_REENGAGEMENT_NOTIFICATION_2_FEATURE); + doReturn(true).when(mTracker).shouldTriggerHelpUI( + FeatureConstants.CHROME_REENGAGEMENT_NOTIFICATION_3_FEATURE); + controller.tryToReengageTheUser(); + + testFeatureShowed(FeatureConstants.CHROME_REENGAGEMENT_NOTIFICATION_2_FEATURE); + } + + @Test + public void testReengagementAllFeaturesMet() { + ReengagementNotificationController controller = + new TestingReengagementNotificationController( + createDefaultInfo(/* passesPrecondition = */ true)); + doReturn(true).when(mTracker).shouldTriggerHelpUI( + FeatureConstants.CHROME_REENGAGEMENT_NOTIFICATION_1_FEATURE); + doReturn(true).when(mTracker).shouldTriggerHelpUI( + FeatureConstants.CHROME_REENGAGEMENT_NOTIFICATION_2_FEATURE); + doReturn(true).when(mTracker).shouldTriggerHelpUI( + FeatureConstants.CHROME_REENGAGEMENT_NOTIFICATION_3_FEATURE); + controller.tryToReengageTheUser(); + + testFeatureShowed(FeatureConstants.CHROME_REENGAGEMENT_NOTIFICATION_1_FEATURE); + } + + @Test + public void testReengagementNoFeatures() { + ReengagementNotificationController controller = + new TestingReengagementNotificationController( + createDefaultInfo(/* passesPrecondition = */ true)); + doReturn(false).when(mTracker).shouldTriggerHelpUI( + FeatureConstants.CHROME_REENGAGEMENT_NOTIFICATION_1_FEATURE); + doReturn(false).when(mTracker).shouldTriggerHelpUI( + FeatureConstants.CHROME_REENGAGEMENT_NOTIFICATION_2_FEATURE); + doReturn(false).when(mTracker).shouldTriggerHelpUI( + FeatureConstants.CHROME_REENGAGEMENT_NOTIFICATION_3_FEATURE); + controller.tryToReengageTheUser(); + new Handler().post( + () + -> Assert.assertEquals( + 0, mShadowNotificationManager.getAllNotifications().size())); + } + + @Test + public void testReengagementNoPreconditions() { + ReengagementNotificationController controller = + new TestingReengagementNotificationController( + createDefaultInfo(/* passesPrecondition = */ false)); + controller.tryToReengageTheUser(); + verifyNoMoreInteractions(mTracker); + Assert.assertEquals(0, mShadowNotificationManager.getAllNotifications().size()); + } + + @Test + public void testReengagementUnavailablePreconditions() { + ReengagementNotificationController controller = + new TestingReengagementNotificationController(null); + controller.tryToReengageTheUser(); + verifyNoMoreInteractions(mTracker); + Assert.assertEquals(0, mShadowNotificationManager.getAllNotifications().size()); + } + + private void testFeatureShowed(String feature) { + Assert.assertEquals(1, + ShadowRecordHistogram.getHistogramValueCountForTesting( + "Mobile.SystemNotification.Shown", getNotificationType(feature))); + + verify(mTracker, times(1)).shouldTriggerHelpUI(feature); + verify(mTracker, times(1)).dismissed(feature); + Notification notification = mShadowNotificationManager.getAllNotifications().get(0); + + new Handler().post(() -> { + Assert.assertEquals(getNotificationTitle(feature), + notification.extras.getCharSequence(Notification.EXTRA_TITLE).toString()); + Assert.assertEquals(getNotificationDescription(feature), + notification.extras.getCharSequence(Notification.EXTRA_TEXT).toString()); + }); + } + + private @NotificationUmaTracker.SystemNotificationType int getNotificationType(String feature) { + if (TextUtils.equals( + feature, FeatureConstants.CHROME_REENGAGEMENT_NOTIFICATION_1_FEATURE)) { + return NotificationUmaTracker.SystemNotificationType.CHROME_REENGAGEMENT_1; + } else if (TextUtils.equals( + feature, FeatureConstants.CHROME_REENGAGEMENT_NOTIFICATION_2_FEATURE)) { + return NotificationUmaTracker.SystemNotificationType.CHROME_REENGAGEMENT_2; + } else if (TextUtils.equals( + feature, FeatureConstants.CHROME_REENGAGEMENT_NOTIFICATION_3_FEATURE)) { + return NotificationUmaTracker.SystemNotificationType.CHROME_REENGAGEMENT_3; + } + + assert false : "Invalid feature, cannot find notification type."; + return NotificationUmaTracker.SystemNotificationType.UNKNOWN; + } + + private String getNotificationTitle(String feature) { + if (TextUtils.equals( + feature, FeatureConstants.CHROME_REENGAGEMENT_NOTIFICATION_1_FEATURE)) { + return mContext.getString(R.string.chrome_reengagement_notification_1_title); + } else if (TextUtils.equals( + feature, FeatureConstants.CHROME_REENGAGEMENT_NOTIFICATION_2_FEATURE)) { + return mContext.getString(R.string.chrome_reengagement_notification_2_title); + } else if (TextUtils.equals( + feature, FeatureConstants.CHROME_REENGAGEMENT_NOTIFICATION_3_FEATURE)) { + return mContext.getString(R.string.chrome_reengagement_notification_3_title); + } + + assert false : "Invalid feature, cannot find notification title."; + return null; + } + + private String getNotificationDescription(String feature) { + if (TextUtils.equals( + feature, FeatureConstants.CHROME_REENGAGEMENT_NOTIFICATION_1_FEATURE)) { + return mContext.getString(R.string.chrome_reengagement_notification_1_description); + } else if (TextUtils.equals( + feature, FeatureConstants.CHROME_REENGAGEMENT_NOTIFICATION_2_FEATURE)) { + return mContext.getString(R.string.chrome_reengagement_notification_2_description); + } else if (TextUtils.equals( + feature, FeatureConstants.CHROME_REENGAGEMENT_NOTIFICATION_3_FEATURE)) { + return mContext.getString(R.string.chrome_reengagement_notification_3_description); + } + + assert false : "Invalid feature, cannot find notification description."; + return null; + } + + private DefaultBrowserInfo.DefaultInfo createDefaultInfo(boolean passesPrecondition) { + int browserCount = passesPrecondition ? 2 : 1; + return new DefaultBrowserInfo.DefaultInfo(/* isChromeSystem = */ true, + /* isChromeDefault = */ true, + /* isDefaultSystem = */ true, /* hasDefault = */ true, browserCount, + /* systemCount = */ 0); + } +} \ No newline at end of file
diff --git a/chrome/app/shared_settings_strings.grdp b/chrome/app/shared_settings_strings.grdp index f9da5eb..5c50f71 100644 --- a/chrome/app/shared_settings_strings.grdp +++ b/chrome/app/shared_settings_strings.grdp
@@ -108,9 +108,45 @@ <message name="IDS_SETTINGS_NEARBY_SHARE_EDIT_DEVICE_NAME" desc="Label for the button that opens the dialog which allows a user to set the name of their device which is shown to other devices for the Nearby Share feature."> Change name </message> - <message name="IDS_SETTINGS_NEARBY_SHARE_DEVICE_NAME_ARIA_DESCRIPTION" desc="Description for screen readers, not displayed in UI, specifying the current device name which is shown to other devices for the Nearby Share feature."> + <message name="IDS_SETTINGS_NEARBY_SHARE_DEVICE_NAME_ARIA_DESCRIPTION" desc="Description for screen readers, not displayed in UI, specifying the current device name which is shown to other devices for the Nearby Share feature." is_accessibility_with_no_ui="true"> Current device name is <ph name="DEVICE_NAME">$1<ex>Michael's Chromebook</ex></ph> </message> + <message name="IDS_SETTINGS_NEARBY_SHARE_EDIT_DATA_USAGE" desc="Label for the button that brings up a dialog to allow a user to edit the data usage setting for the Nearby Share feature."> + Edit + </message> + <message name="IDS_SETTINGS_NEARBY_SHARE_UPDATE_DATA_USAGE" desc="Label for the button that allows a user to confirm their choice of data usage setting for the Nearby Share feature."> + Update + </message> + <message name="IDS_SETTINGS_NEARBY_SHARE_DATA_USAGE_DIALOG_TITLE" desc="Title for the dialog where a user can select the data usage setting for the Nearby Share feature."> + Data usage + </message> + <message name="IDS_SETTINGS_NEARBY_SHARE_DATA_USAGE_WIFI_ONLY_LABEL" desc="Label for the data usage setting where only Wi-Fi is to be used for transfers for the Nearby Share feature."> + Wi-Fi only + </message> + <message name="IDS_SETTINGS_NEARBY_SHARE_DATA_USAGE_WIFI_ONLY_DESCRIPTION" desc="Description of the data usage setting where only Wi-Fi is to be used for transfers for the Nearby Share feature."> + Never use data to transfer + </message> + <message name="IDS_SETTINGS_NEARBY_SHARE_DATA_USAGE_DATA_LABEL" desc="Label for the data usage setting where Wi-Fi or cell data may be used for transfers for the Nearby Share feature."> + Data + </message> + <message name="IDS_SETTINGS_NEARBY_SHARE_DATA_USAGE_DATA_DESCRIPTION" desc="Description of the data usage setting where Wi-Fi or cell data may be used for transfers for the Nearby Share feature."> + May incur data charges + </message> + <message name="IDS_SETTINGS_NEARBY_SHARE_DATA_USAGE_OFFLINE_LABEL" desc="Label for the data usage setting where transfers will only take place offline for the Nearby Share feature."> + Without internet + </message> + <message name="IDS_SETTINGS_NEARBY_SHARE_DATA_USAGE_OFFLINE_DESCRIPTION" desc="Description of the data usage setting where transfers will only take place offline for the Nearby Share feature."> + Files will always be shared offline + </message> + <message name="IDS_SETTINGS_NEARBY_SHARE_DATA_USAGE_EDIT_BUTTON_DATA_DESCRIPTION" desc="Description for scren readers, not displayed in UI, specifying the current data usage setting where Wi-Fi or cell data may be used for transfers for the Nearby Share feature." is_accessibility_with_no_ui="true"> + Current data usage setting is Data + </message> + <message name="IDS_SETTINGS_NEARBY_SHARE_DATA_USAGE_EDIT_BUTTON_WIFI_ONLY_DESCRIPTION" desc="Description for screen readers, not displayed in UI, specifying the current data usage setting where only Wi-Fi is to be used for transfers for the Nearby Share feature." is_accessibility_with_no_ui="true"> + Current data usage setting is Wi-Fi only + </message> + <message name="IDS_SETTINGS_NEARBY_SHARE_DATA_USAGE_EDIT_BUTTON_OFFLINE_DESCRIPTION" desc="Description for scren readers, not displayed in UI, specifying the current data usage setting where transfers will only take place offline for the Nearby Share feature." is_accessibility_with_no_ui="true"> + Current data usage setting is Without internet + </message> <!-- Personalization Options SubPage (strings used by the <settings-personalization-options> element) --> <message name="IDS_SETTINGS_ENABLE_URL_KEYED_ANONYMIZED_DATA_COLLECTION" desc="The label of the checkbox to enable/disable url keyed anonymized data collection.">
diff --git a/chrome/app/shared_settings_strings_grdp/IDS_SETTINGS_NEARBY_SHARE_DATA_USAGE_DATA_DESCRIPTION.png.sha1 b/chrome/app/shared_settings_strings_grdp/IDS_SETTINGS_NEARBY_SHARE_DATA_USAGE_DATA_DESCRIPTION.png.sha1 new file mode 100644 index 0000000..68c706b --- /dev/null +++ b/chrome/app/shared_settings_strings_grdp/IDS_SETTINGS_NEARBY_SHARE_DATA_USAGE_DATA_DESCRIPTION.png.sha1
@@ -0,0 +1 @@ +195af5e0921ac2a400f10ec42277b23e4bef53c3 \ No newline at end of file
diff --git a/chrome/app/shared_settings_strings_grdp/IDS_SETTINGS_NEARBY_SHARE_DATA_USAGE_DATA_LABEL.png.sha1 b/chrome/app/shared_settings_strings_grdp/IDS_SETTINGS_NEARBY_SHARE_DATA_USAGE_DATA_LABEL.png.sha1 new file mode 100644 index 0000000..e09ac0f --- /dev/null +++ b/chrome/app/shared_settings_strings_grdp/IDS_SETTINGS_NEARBY_SHARE_DATA_USAGE_DATA_LABEL.png.sha1
@@ -0,0 +1 @@ +b4d934df09874220ecec60b0a4a4ae7d2adc2842 \ No newline at end of file
diff --git a/chrome/app/shared_settings_strings_grdp/IDS_SETTINGS_NEARBY_SHARE_DATA_USAGE_DIALOG_TITLE.png.sha1 b/chrome/app/shared_settings_strings_grdp/IDS_SETTINGS_NEARBY_SHARE_DATA_USAGE_DIALOG_TITLE.png.sha1 new file mode 100644 index 0000000..0baf28cc --- /dev/null +++ b/chrome/app/shared_settings_strings_grdp/IDS_SETTINGS_NEARBY_SHARE_DATA_USAGE_DIALOG_TITLE.png.sha1
@@ -0,0 +1 @@ +1f2fa3cd2911458ea45ba78531c659552ca04117 \ No newline at end of file
diff --git a/chrome/app/shared_settings_strings_grdp/IDS_SETTINGS_NEARBY_SHARE_DATA_USAGE_OFFLINE_DESCRIPTION.png.sha1 b/chrome/app/shared_settings_strings_grdp/IDS_SETTINGS_NEARBY_SHARE_DATA_USAGE_OFFLINE_DESCRIPTION.png.sha1 new file mode 100644 index 0000000..019a36762 --- /dev/null +++ b/chrome/app/shared_settings_strings_grdp/IDS_SETTINGS_NEARBY_SHARE_DATA_USAGE_OFFLINE_DESCRIPTION.png.sha1
@@ -0,0 +1 @@ +94b8a2dff669a62ef804c52cf52e1c072b021137 \ No newline at end of file
diff --git a/chrome/app/shared_settings_strings_grdp/IDS_SETTINGS_NEARBY_SHARE_DATA_USAGE_OFFLINE_LABEL.png.sha1 b/chrome/app/shared_settings_strings_grdp/IDS_SETTINGS_NEARBY_SHARE_DATA_USAGE_OFFLINE_LABEL.png.sha1 new file mode 100644 index 0000000..d98aa4f --- /dev/null +++ b/chrome/app/shared_settings_strings_grdp/IDS_SETTINGS_NEARBY_SHARE_DATA_USAGE_OFFLINE_LABEL.png.sha1
@@ -0,0 +1 @@ +690d352fcbf93dff02fed0274f47f58be8190ecd \ No newline at end of file
diff --git a/chrome/app/shared_settings_strings_grdp/IDS_SETTINGS_NEARBY_SHARE_DATA_USAGE_WIFI_ONLY_DESCRIPTION.png.sha1 b/chrome/app/shared_settings_strings_grdp/IDS_SETTINGS_NEARBY_SHARE_DATA_USAGE_WIFI_ONLY_DESCRIPTION.png.sha1 new file mode 100644 index 0000000..50f0884 --- /dev/null +++ b/chrome/app/shared_settings_strings_grdp/IDS_SETTINGS_NEARBY_SHARE_DATA_USAGE_WIFI_ONLY_DESCRIPTION.png.sha1
@@ -0,0 +1 @@ +09badd352fbad328a0c94b38bdbe3b00ef60c02b \ No newline at end of file
diff --git a/chrome/app/shared_settings_strings_grdp/IDS_SETTINGS_NEARBY_SHARE_DATA_USAGE_WIFI_ONLY_LABEL.png.sha1 b/chrome/app/shared_settings_strings_grdp/IDS_SETTINGS_NEARBY_SHARE_DATA_USAGE_WIFI_ONLY_LABEL.png.sha1 new file mode 100644 index 0000000..eaddad8 --- /dev/null +++ b/chrome/app/shared_settings_strings_grdp/IDS_SETTINGS_NEARBY_SHARE_DATA_USAGE_WIFI_ONLY_LABEL.png.sha1
@@ -0,0 +1 @@ +6b67fb5332f15222774ba8ef9d64ee571e68ba81 \ No newline at end of file
diff --git a/chrome/app/shared_settings_strings_grdp/IDS_SETTINGS_NEARBY_SHARE_DEVICE_NAME_ARIA_DESCRIPTION.png.sha1 b/chrome/app/shared_settings_strings_grdp/IDS_SETTINGS_NEARBY_SHARE_DEVICE_NAME_ARIA_DESCRIPTION.png.sha1 deleted file mode 100644 index d5ab53d..0000000 --- a/chrome/app/shared_settings_strings_grdp/IDS_SETTINGS_NEARBY_SHARE_DEVICE_NAME_ARIA_DESCRIPTION.png.sha1 +++ /dev/null
@@ -1 +0,0 @@ -b7cf3b1dfec2c0bfe12ddad390708579dc06387c \ No newline at end of file
diff --git a/chrome/app/shared_settings_strings_grdp/IDS_SETTINGS_NEARBY_SHARE_EDIT_DATA_USAGE.png.sha1 b/chrome/app/shared_settings_strings_grdp/IDS_SETTINGS_NEARBY_SHARE_EDIT_DATA_USAGE.png.sha1 new file mode 100644 index 0000000..8a61528e --- /dev/null +++ b/chrome/app/shared_settings_strings_grdp/IDS_SETTINGS_NEARBY_SHARE_EDIT_DATA_USAGE.png.sha1
@@ -0,0 +1 @@ +ae1b70c839e49eecb528a4ef35246acb6ff7a5ea \ No newline at end of file
diff --git a/chrome/app/shared_settings_strings_grdp/IDS_SETTINGS_NEARBY_SHARE_UPDATE_DATA_USAGE.png.sha1 b/chrome/app/shared_settings_strings_grdp/IDS_SETTINGS_NEARBY_SHARE_UPDATE_DATA_USAGE.png.sha1 new file mode 100644 index 0000000..5079dac2 --- /dev/null +++ b/chrome/app/shared_settings_strings_grdp/IDS_SETTINGS_NEARBY_SHARE_UPDATE_DATA_USAGE.png.sha1
@@ -0,0 +1 @@ +3989dd9c90c1742c7c9aa9c14d603ca3ae5bab12 \ No newline at end of file
diff --git a/chrome/browser/BUILD.gn b/chrome/browser/BUILD.gn index 739fdd9..2db01ab 100644 --- a/chrome/browser/BUILD.gn +++ b/chrome/browser/BUILD.gn
@@ -3333,9 +3333,12 @@ "nearby_sharing/nearby_confirmation_manager.cc", "nearby_sharing/nearby_confirmation_manager.h", "nearby_sharing/nearby_connection.h", + "nearby_sharing/nearby_connection_impl.cc", + "nearby_sharing/nearby_connection_impl.h", "nearby_sharing/nearby_connections_manager.h", "nearby_sharing/nearby_connections_manager_impl.cc", "nearby_sharing/nearby_connections_manager_impl.h", + "nearby_sharing/nearby_notification_delegate.h", "nearby_sharing/nearby_notification_handler.cc", "nearby_sharing/nearby_notification_handler.h", "nearby_sharing/nearby_notification_manager.cc", @@ -5620,16 +5623,6 @@ "//chrome/common:supervised_user_commands_mojom", ] } - if (enable_supervised_users && !is_android) { - sources += [ - # TODO(bauerb): The legacy code should be removed(on desktop) once child - # account support has launched(https://crbug.com/505443). - "supervised_user/legacy/custodian_profile_downloader_service.cc", - "supervised_user/legacy/custodian_profile_downloader_service.h", - "supervised_user/legacy/custodian_profile_downloader_service_factory.cc", - "supervised_user/legacy/custodian_profile_downloader_service_factory.h", - ] - } if (enable_supervised_users && enable_extensions) { sources += [ "supervised_user/supervised_user_extensions_delegate_impl.cc",
diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc index 7cd9d1f..2318944 100644 --- a/chrome/browser/about_flags.cc +++ b/chrome/browser/about_flags.cc
@@ -3576,11 +3576,11 @@ FEATURE_VALUE_TYPE(features::kGdiTextPrinting)}, #endif // defined(OS_WIN) -#if defined(OS_WIN) +#if defined(OS_WIN) || defined(OS_MAC) {"new-usb-backend", flag_descriptions::kNewUsbBackendName, - flag_descriptions::kNewUsbBackendDescription, kOsWin, + flag_descriptions::kNewUsbBackendDescription, kOsWin | kOsMac, FEATURE_VALUE_TYPE(device::kNewUsbBackend)}, -#endif // defined(OS_WIN) +#endif // defined(OS_WIN) || defined(OS_MAC) #if defined(OS_ANDROID) {"omnibox-adaptive-suggestions-count", @@ -6170,6 +6170,14 @@ MULTI_VALUE_TYPE(kFrameThrottleFpsChoices)} #endif // defined(OS_CHROMEOS) +#if defined(OS_ANDROID) + {"filling-passwords-from-any-origin", + flag_descriptions::kFillingPasswordsFromAnyOriginName, + flag_descriptions::kFillingPasswordsFromAnyOriginDescription, kOsAndroid, + FEATURE_VALUE_TYPE( + password_manager::features::kFillingPasswordsFromAnyOrigin)}, +#endif // OS_ANDROID + // NOTE: Adding a new flag requires adding a corresponding entry to enum // "LoginCustomFlags" in tools/metrics/histograms/enums.xml. See "Flag // Histograms" in tools/metrics/histograms/README.md (run the
diff --git a/chrome/browser/chrome_browser_interface_binders.cc b/chrome/browser/chrome_browser_interface_binders.cc index db133346..50e3116 100644 --- a/chrome/browser/chrome_browser_interface_binders.cc +++ b/chrome/browser/chrome_browser_interface_binders.cc
@@ -171,6 +171,7 @@ #endif #if defined(OS_CHROMEOS) && !defined(OFFICIAL_BUILD) +#include "chromeos/components/telemetry_extension_ui/mojom/diagnostics_service.mojom.h" #include "chromeos/components/telemetry_extension_ui/mojom/probe_service.mojom.h" #include "chromeos/components/telemetry_extension_ui/telemetry_extension_ui.h" #endif @@ -600,6 +601,9 @@ #if defined(OS_CHROMEOS) && !defined(OFFICIAL_BUILD) if (base::FeatureList::IsEnabled(chromeos::features::kTelemetryExtension)) { RegisterWebUIControllerInterfaceBinder< + chromeos::health::mojom::DiagnosticsService, + chromeos::TelemetryExtensionUI>(map); + RegisterWebUIControllerInterfaceBinder< chromeos::health::mojom::ProbeService, chromeos::TelemetryExtensionUI>( map); }
diff --git a/chrome/browser/chromeos/mobile/mobile_activator.cc b/chrome/browser/chromeos/mobile/mobile_activator.cc index bfb7b92..f235d4f4 100644 --- a/chrome/browser/chromeos/mobile/mobile_activator.cc +++ b/chrome/browser/chromeos/mobile/mobile_activator.cc
@@ -195,7 +195,6 @@ // again. if (success && state_ == PLAN_ACTIVATION_SHOWING_PAYMENT) { SignalCellularPlanPayment(); - UMA_HISTOGRAM_COUNTS_1M("Cellular.PaymentReceived", 1); const NetworkState* network = GetNetworkState(service_path_); if (network && IsSimpleActivationFlow(network)) { state_ = PLAN_ACTIVATION_DONE; @@ -204,8 +203,6 @@ } else { StartOTASP(); } - } else { - UMA_HISTOGRAM_COUNTS_1M("Cellular.PaymentFailed", 1); } } @@ -258,7 +255,6 @@ } void MobileActivator::StartActivation() { - UMA_HISTOGRAM_COUNTS_1M("Cellular.MobileSetupStart", 1); const NetworkState* network = GetNetworkState(service_path_); // Check if we can start activation process. if (!network) { @@ -865,7 +861,6 @@ case PLAN_ACTIVATION_DONE: DCHECK(network); CompleteActivation(); - UMA_HISTOGRAM_COUNTS_1M("Cellular.MobileSetupSucceeded", 1); break; case PLAN_ACTIVATION_ERROR: CompleteActivation();
diff --git a/chrome/browser/chromeos/remote_apps/remote_apps_manager_browsertest.cc b/chrome/browser/chromeos/remote_apps/remote_apps_manager_browsertest.cc index abdf4d25..d374ae1 100644 --- a/chrome/browser/chromeos/remote_apps/remote_apps_manager_browsertest.cc +++ b/chrome/browser/chromeos/remote_apps/remote_apps_manager_browsertest.cc
@@ -30,6 +30,7 @@ #include "chrome/browser/profiles/profile.h" #include "chrome/browser/ui/app_list/app_list_syncable_service_factory.h" #include "chrome/browser/ui/ash/launcher/chrome_launcher_controller.h" +#include "chrome/common/chrome_features.h" #include "chromeos/constants/chromeos_switches.h" #include "chromeos/login/auth/user_context.h" #include "components/account_id/account_id.h" @@ -294,7 +295,11 @@ EXPECT_FALSE(item->is_folder()); EXPECT_EQ(name, item->name()); // kShared uses size hint 64 dip. - apps::ApplyIconEffects(apps::IconEffects::kResizeAndPad, 64, &icon); + apps::IconEffects icon_effects = + base::FeatureList::IsEnabled(features::kAppServiceAdaptiveIcon) + ? apps::IconEffects::kCrOsStandardIcon + : apps::IconEffects::kResizeAndPad; + apps::ApplyIconEffects(icon_effects, 64, &icon); CheckIconsEqual(icon, item->GetIcon(ash::AppListConfigType::kShared)); }
diff --git a/chrome/browser/devtools/devtools_ui_bindings.cc b/chrome/browser/devtools/devtools_ui_bindings.cc index 8566576e..597ff552 100644 --- a/chrome/browser/devtools/devtools_ui_bindings.cc +++ b/chrome/browser/devtools/devtools_ui_bindings.cc
@@ -100,6 +100,7 @@ static const char kDevToolsActionTakenHistogram[] = "DevTools.ActionTaken"; static const char kDevToolsPanelShownHistogram[] = "DevTools.PanelShown"; +static const char kDevToolsPanelClosedHistogram[] = "DevTools.PanelClosed"; static const char kDevToolsKeyboardShortcutFiredHistogram[] = "DevTools.KeyboardShortcutFired"; static const char kDevToolsIssuesPanelOpenedFromHistogram[] = @@ -1259,6 +1260,8 @@ base::UmaHistogramExactLinear(name, sample, boundary_value); else if (name == kDevToolsPanelShownHistogram) base::UmaHistogramExactLinear(name, sample, boundary_value); + else if (name == kDevToolsPanelClosedHistogram) + base::UmaHistogramExactLinear(name, sample, boundary_value); else if (name == kDevToolsKeyboardShortcutFiredHistogram) base::UmaHistogramExactLinear(name, sample, boundary_value); else if (name == kDevToolsIssuesPanelOpenedFromHistogram)
diff --git a/chrome/browser/download/android/java/res/layout/download_later_dialog.xml b/chrome/browser/download/android/java/res/layout/download_later_dialog.xml index 577380f9..463f818 100644 --- a/chrome/browser/download/android/java/res/layout/download_later_dialog.xml +++ b/chrome/browser/download/android/java/res/layout/download_later_dialog.xml
@@ -68,9 +68,8 @@ android:layout_marginTop="@dimen/download_dialog_checkbox_margin_top" android:layout_marginBottom="11dp" android:layout_marginStart="@dimen/download_dialog_checkbox_margin_start" - android:paddingStart="@dimen/download_dialog_checkbox_padding_start" android:text="@string/download_location_dialog_checkbox" - style="@style/TextAppearance.TextMedium.Secondary" + style="@style/DefaultCheckboxStyle" android:visibility="gone" /> <TextView
diff --git a/chrome/browser/download/android/java/res/layout/download_location_dialog.xml b/chrome/browser/download/android/java/res/layout/download_location_dialog.xml index 58650114..d933e48 100644 --- a/chrome/browser/download/android/java/res/layout/download_location_dialog.xml +++ b/chrome/browser/download/android/java/res/layout/download_location_dialog.xml
@@ -76,9 +76,8 @@ android:layout_height="wrap_content" android:layout_marginTop="@dimen/download_dialog_checkbox_margin_top" android:layout_marginStart="@dimen/download_dialog_checkbox_margin_start" - android:paddingStart="@dimen/download_dialog_checkbox_padding_start" android:text="@string/download_location_dialog_checkbox" - style="@style/TextAppearance.TextMedium.Secondary"/> + style="@style/DefaultCheckboxStyle"/> </LinearLayout>
diff --git a/chrome/browser/download/android/java/res/values-v17/dimens.xml b/chrome/browser/download/android/java/res/values-v17/dimens.xml index e584175f..2766d71 100644 --- a/chrome/browser/download/android/java/res/values-v17/dimens.xml +++ b/chrome/browser/download/android/java/res/values-v17/dimens.xml
@@ -9,5 +9,4 @@ <dimen name="download_dialog_radio_button_margin_start">-5dp</dimen> <dimen name="download_dialog_checkbox_margin_start">-5dp</dimen> <dimen name="download_dialog_checkbox_margin_top">16dp</dimen> - <dimen name="download_dialog_checkbox_padding_start">16dp</dimen> </resources>
diff --git a/chrome/browser/extensions/api/identity/gaia_remote_consent_flow.cc b/chrome/browser/extensions/api/identity/gaia_remote_consent_flow.cc index ec8496c..7b0c21f 100644 --- a/chrome/browser/extensions/api/identity/gaia_remote_consent_flow.cc +++ b/chrome/browser/extensions/api/identity/gaia_remote_consent_flow.cc
@@ -156,7 +156,15 @@ } void GaiaRemoteConsentFlow::OnEndBatchOfRefreshTokenStateChanges() { +// On ChromeOS, new accounts are added through the account manager. They need to +// be pushed to the partition used by this flow explicitly. +// On Desktop, sign-in happens on the Web and a new account is directly added to +// this partition's cookie jar. An extra update triggered from here might change +// cookies order in the middle of the flow. This may lead to a bug like +// https://crbug.com/1112343. +#if defined(OS_CHROMEOS) SetAccountsInCookie(); +#endif } void GaiaRemoteConsentFlow::SetWebAuthFlowForTesting(
diff --git a/chrome/browser/extensions/api/safe_browsing_private/safe_browsing_private_event_router.cc b/chrome/browser/extensions/api/safe_browsing_private/safe_browsing_private_event_router.cc index aadc301..4317c5f 100644 --- a/chrome/browser/extensions/api/safe_browsing_private/safe_browsing_private_event_router.cc +++ b/chrome/browser/extensions/api/safe_browsing_private/safe_browsing_private_event_router.cc
@@ -288,6 +288,7 @@ event.SetStringKey(kKeyEventResult, safe_browsing::EventResultToString( safe_browsing::EventResult::BYPASSED)); + event.SetBoolKey(kKeyClickedThrough, true); return event; }, params.url, params.file_name, params.download_digest_sha256, @@ -448,6 +449,9 @@ event.SetStringKey( kKeyEventResult, safe_browsing::EventResultToString(event_result)); + event.SetBoolKey( + kKeyClickedThrough, + event_result == safe_browsing::EventResult::BYPASSED); return event; }, url.spec(), file_name, download_digest_sha256, GetProfileUserName(), @@ -492,6 +496,9 @@ event.SetStringKey( kKeyEventResult, safe_browsing::EventResultToString(event_result)); + event.SetBoolKey( + kKeyClickedThrough, + event_result == safe_browsing::EventResult::BYPASSED); AddAnalysisConnectorVerdictToEvent(result, &event); @@ -543,6 +550,7 @@ event.SetStringKey(kKeyEventResult, safe_browsing::EventResultToString( safe_browsing::EventResult::BYPASSED)); + event.SetBoolKey(kKeyClickedThrough, true); AddAnalysisConnectorVerdictToEvent(result, &event); @@ -594,6 +602,9 @@ event.SetStringKey( kKeyEventResult, safe_browsing::EventResultToString(event_result)); + event.SetBoolKey( + kKeyClickedThrough, + event_result == safe_browsing::EventResult::BYPASSED); return event; }, url.spec(), file_name, download_digest_sha256, GetProfileUserName(),
diff --git a/chrome/browser/extensions/api/settings_private/prefs_util.cc b/chrome/browser/extensions/api/settings_private/prefs_util.cc index 3cc6589..869d900 100644 --- a/chrome/browser/extensions/api/settings_private/prefs_util.cc +++ b/chrome/browser/extensions/api/settings_private/prefs_util.cc
@@ -312,6 +312,8 @@ settings_api::PrefType::PREF_TYPE_BOOLEAN; (*s_whitelist)[::prefs::kNearbySharingDeviceNamePrefName] = settings_api::PrefType::PREF_TYPE_STRING; + (*s_whitelist)[::prefs::kNearbySharingDataUsageName] = + settings_api::PrefType::PREF_TYPE_NUMBER; // Search page. (*s_whitelist)[DefaultSearchManager::kDefaultSearchProviderDataPrefName] =
diff --git a/chrome/browser/flag-metadata.json b/chrome/browser/flag-metadata.json index 495c3c6..e144396 100644 --- a/chrome/browser/flag-metadata.json +++ b/chrome/browser/flag-metadata.json
@@ -1992,11 +1992,6 @@ "expiry_milestone": -1 }, { - "name": "enable-send-tab-to-self", - "owners": [ "//components/send_tab_to_self/OWNERS" ], - "expiry_milestone": 77 - }, - { "name": "enable-send-tab-to-self-omnibox-sending-animation", "owners": [ "//components/send_tab_to_self/OWNERS" ], "expiry_milestone": 84 @@ -2451,6 +2446,11 @@ "expiry_milestone": 87 }, { + "name": "filling-passwords-from-any-origin", + "owners": [ "fhorschig" ], + "expiry_milestone": 87 + }, + { "name": "focus-mode", "owners": [ "dfried", "pbos", "yiningwang@google.com" ], "expiry_milestone": 82 @@ -3054,7 +3054,7 @@ { "name": "new-usb-backend", "owners": [ "reillyg@chromium.org" ], - "expiry_milestone": 86 + "expiry_milestone": 87 }, { "name": "notification-scheduler-debug-options",
diff --git a/chrome/browser/flag_descriptions.cc b/chrome/browser/flag_descriptions.cc index d9d60b6..6a89f82 100644 --- a/chrome/browser/flag_descriptions.cc +++ b/chrome/browser/flag_descriptions.cc
@@ -1373,7 +1373,7 @@ const char kNewUsbBackendName[] = "Enable new USB backend"; const char kNewUsbBackendDescription[] = - "Enables the new experimental USB backend for Windows."; + "Enables the new experimental USB backends for macOS and Windows"; const char kNewTabstripAnimationName[] = "New tabstrip animations"; const char kNewTabstripAnimationDescription[] = @@ -2713,6 +2713,13 @@ const char kExploreSitesDescription[] = "Enables portal from new tab page to explore websites."; +const char kFillingPasswordsFromAnyOriginName[] = + "Filling passwords from any origin"; +const char kFillingPasswordsFromAnyOriginDescription[] = + "Enabling this flag adds a button to the password fallback sheet. The " + "button opens a different sheet that allows filling a password from any " + "origin."; + const char kGamesHubName[] = "Games Hub"; const char kGamesHubDescription[] = "Enables viewing and usage of the Games Hub.";
diff --git a/chrome/browser/flag_descriptions.h b/chrome/browser/flag_descriptions.h index f6c6a00..5719c9d2 100644 --- a/chrome/browser/flag_descriptions.h +++ b/chrome/browser/flag_descriptions.h
@@ -1570,6 +1570,9 @@ extern const char kExploreSitesName[]; extern const char kExploreSitesDescription[]; +extern const char kFillingPasswordsFromAnyOriginName[]; +extern const char kFillingPasswordsFromAnyOriginDescription[]; + extern const char kGamesHubName[]; extern const char kGamesHubDescription[];
diff --git a/chrome/browser/flags/android/chrome_feature_list.cc b/chrome/browser/flags/android/chrome_feature_list.cc index 581bf82..a261849 100644 --- a/chrome/browser/flags/android/chrome_feature_list.cc +++ b/chrome/browser/flags/android/chrome_feature_list.cc
@@ -182,6 +182,7 @@ &kProbabilisticCryptidRenderer, &kReachedCodeProfiler, &kReaderModeInCCT, + &kReengagementNotification, &kRelatedSearches, &kRevampedContextMenu, &kSearchEnginePromoExistingDevice, @@ -548,6 +549,9 @@ const base::Feature kReaderModeInCCT{"ReaderModeInCCT", base::FEATURE_ENABLED_BY_DEFAULT}; +const base::Feature kReengagementNotification{ + "ReengagementNotification", base::FEATURE_DISABLED_BY_DEFAULT}; + const base::Feature kRelatedSearches{"RelatedSearches", base::FEATURE_DISABLED_BY_DEFAULT};
diff --git a/chrome/browser/flags/android/chrome_feature_list.h b/chrome/browser/flags/android/chrome_feature_list.h index b171718..8b78e99 100644 --- a/chrome/browser/flags/android/chrome_feature_list.h +++ b/chrome/browser/flags/android/chrome_feature_list.h
@@ -99,6 +99,7 @@ extern const base::Feature kPhotoPickerZoom; extern const base::Feature kProbabilisticCryptidRenderer; extern const base::Feature kReachedCodeProfiler; +extern const base::Feature kReengagementNotification; extern const base::Feature kReaderModeInCCT; extern const base::Feature kRelatedSearches; extern const base::Feature kRevampedContextMenu;
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 89a69fc..010c5c3 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
@@ -292,6 +292,7 @@ public static final String EPHEMERAL_TAB_USING_BOTTOM_SHEET = "EphemeralTabUsingBottomSheet"; public static final String EXPLICIT_LANGUAGE_ASK = "ExplicitLanguageAsk"; public static final String EXPLORE_SITES = "ExploreSites"; + public static final String FILLING_PASSWORDS_FROM_ANY_ORIGIN = "FillingPasswordsFromAnyOrigin"; public static final String FOCUS_OMNIBOX_IN_INCOGNITO_TAB_INTENTS = "FocusOmniboxInIncognitoTabIntents"; public static final String GRANT_NOTIFICATIONS_TO_DSE = "GrantNotificationsToDSE"; @@ -377,6 +378,7 @@ public static final String REACHED_CODE_PROFILER = "ReachedCodeProfiler"; public static final String READER_MODE_IN_CCT = "ReaderModeInCCT"; public static final String RECOVER_FROM_NEVER_SAVE_ANDROID = "RecoverFromNeverSaveAndroid"; + public static final String REENGAGEMENT_NOTIFICATION = "ReengagementNotification"; public static final String REMOVE_NAVIGATION_HISTORY = "RemoveNavigationHistory"; public static final String RELATED_SEARCHES = "RelatedSearches"; public static final String REPORT_FEED_USER_ACTIONS = "ReportFeedUserActions";
diff --git a/chrome/browser/nearby_sharing/fake_nearby_connection.cc b/chrome/browser/nearby_sharing/fake_nearby_connection.cc index 93a07d3..36bc464 100644 --- a/chrome/browser/nearby_sharing/fake_nearby_connection.cc +++ b/chrome/browser/nearby_sharing/fake_nearby_connection.cc
@@ -8,36 +8,39 @@ FakeNearbyConnection::~FakeNearbyConnection() = default; void FakeNearbyConnection::Read(ReadCallback callback) { + DCHECK(!closed_); callback_ = std::move(callback); MaybeRunCallback(); } -void FakeNearbyConnection::Write(std::vector<uint8_t> bytes, - WriteCallback callback) { +void FakeNearbyConnection::Write(std::vector<uint8_t> bytes) { + DCHECK(!closed_); NOTIMPLEMENTED(); } void FakeNearbyConnection::Close() { + DCHECK(!closed_); closed_ = true; if (callback_) std::move(callback_).Run(base::nullopt); -} - -bool FakeNearbyConnection::IsClosed() const { - return closed_; + for (auto& disconnect_listener : disconnect_listeners_) + std::move(disconnect_listener).Run(); } void FakeNearbyConnection::RegisterForDisconnection( - base::OnceClosure callback) { - NOTIMPLEMENTED(); + base::OnceClosure listener) { + DCHECK(!closed_); + disconnect_listeners_.push_back(std::move(listener)); } void FakeNearbyConnection::AppendReadableData(std::vector<uint8_t> bytes) { + DCHECK(!closed_); data_.push(std::move(bytes)); MaybeRunCallback(); } void FakeNearbyConnection::MaybeRunCallback() { + DCHECK(!closed_); if (!callback_ || data_.empty()) return; auto item = std::move(data_.front());
diff --git a/chrome/browser/nearby_sharing/fake_nearby_connection.h b/chrome/browser/nearby_sharing/fake_nearby_connection.h index 9c3f188..07980c18 100644 --- a/chrome/browser/nearby_sharing/fake_nearby_connection.h +++ b/chrome/browser/nearby_sharing/fake_nearby_connection.h
@@ -15,11 +15,12 @@ FakeNearbyConnection(); ~FakeNearbyConnection() override; + // NearbyConnection: void Read(ReadCallback callback) override; - void Write(std::vector<uint8_t> bytes, WriteCallback callback) override; + void Write(std::vector<uint8_t> bytes) override; void Close() override; - bool IsClosed() const override; - void RegisterForDisconnection(base::OnceClosure callback) override; + void RegisterForDisconnection(base::OnceClosure listener) override; + void AppendReadableData(std::vector<uint8_t> bytes); private: @@ -28,6 +29,7 @@ bool closed_ = false; ReadCallback callback_; std::queue<std::vector<uint8_t>> data_; + std::vector<base::OnceClosure> disconnect_listeners_; }; #endif // CHROME_BROWSER_NEARBY_SHARING_FAKE_NEARBY_CONNECTION_H_
diff --git a/chrome/browser/nearby_sharing/fake_nearby_connections_manager.cc b/chrome/browser/nearby_sharing/fake_nearby_connections_manager.cc index 53778985..5581e22 100644 --- a/chrome/browser/nearby_sharing/fake_nearby_connections_manager.cc +++ b/chrome/browser/nearby_sharing/fake_nearby_connections_manager.cc
@@ -4,38 +4,6 @@ #include "chrome/browser/nearby_sharing/fake_nearby_connections_manager.h" -FakeNearbyConnectionsManager::FakeNearbyConnection::FakeNearbyConnection() = - default; - -FakeNearbyConnectionsManager::FakeNearbyConnection::~FakeNearbyConnection() = - default; - -void FakeNearbyConnectionsManager::FakeNearbyConnection::Read( - ReadCallback callback) { - // TODO(alexchau): Implement. -} - -void FakeNearbyConnectionsManager::FakeNearbyConnection::Write( - std::vector<uint8_t> bytes, - WriteCallback callback) { - // TODO(alexchau): Implement. -} - -void FakeNearbyConnectionsManager::FakeNearbyConnection::Close() { - is_closed_ = true; - if (!disconnection_callback_.is_null()) - std::move(disconnection_callback_).Run(); -} - -bool FakeNearbyConnectionsManager::FakeNearbyConnection::IsClosed() const { - return is_closed_; -} - -void FakeNearbyConnectionsManager::FakeNearbyConnection:: - RegisterForDisconnection(base::OnceClosure callback) { - disconnection_callback_ = std::move(callback); -} - FakeNearbyConnectionsManager::FakeNearbyConnectionsManager() = default; FakeNearbyConnectionsManager::~FakeNearbyConnectionsManager() = default; @@ -111,7 +79,7 @@ // TODO(alexchau): Implement. } -FakeNearbyConnectionsManager::PayloadPtr +FakeNearbyConnectionsManager::Payload* FakeNearbyConnectionsManager::GetIncomingPayload(int64_t payload_id) { DCHECK(!IsShutdown()); // TODO(alexchau): Implement.
diff --git a/chrome/browser/nearby_sharing/fake_nearby_connections_manager.h b/chrome/browser/nearby_sharing/fake_nearby_connections_manager.h index 5a17170..70b1445 100644 --- a/chrome/browser/nearby_sharing/fake_nearby_connections_manager.h +++ b/chrome/browser/nearby_sharing/fake_nearby_connections_manager.h
@@ -15,22 +15,6 @@ // Fake NearbyConnectionsManager for testing. class FakeNearbyConnectionsManager : public NearbyConnectionsManager { public: - class FakeNearbyConnection : public NearbyConnection { - public: - FakeNearbyConnection(); - ~FakeNearbyConnection() override; - - // NearbyConnection: - void Read(ReadCallback callback) override; - void Write(std::vector<uint8_t> bytes, WriteCallback callback) override; - void Close() override; - bool IsClosed() const override; - void RegisterForDisconnection(base::OnceClosure callback) override; - - private: - bool is_closed_{false}; - base::OnceClosure disconnection_callback_; - }; FakeNearbyConnectionsManager(); ~FakeNearbyConnectionsManager() override; @@ -58,7 +42,7 @@ ConnectionsCallback callback) override; void RegisterPayloadStatusListener(int64_t payload_id, PayloadStatusListener* listener) override; - PayloadPtr GetIncomingPayload(int64_t payload_id) override; + Payload* GetIncomingPayload(int64_t payload_id) override; void Cancel(int64_t payload_id, ConnectionsCallback callback) override; void ClearIncomingPayloads() override; base::Optional<std::vector<uint8_t>> GetRawAuthenticationToken(
diff --git a/chrome/browser/nearby_sharing/incoming_frames_reader.cc b/chrome/browser/nearby_sharing/incoming_frames_reader.cc index 7d7248c..9f4f4ae 100644 --- a/chrome/browser/nearby_sharing/incoming_frames_reader.cc +++ b/chrome/browser/nearby_sharing/incoming_frames_reader.cc
@@ -36,6 +36,9 @@ DCHECK(connection_); nearby_process_observer_.Add(process_manager); + connection->RegisterForDisconnection( + base::BindOnce(&IncomingFramesReader::OnConnectionClosed, + weak_ptr_factory_.GetWeakPtr())); } IncomingFramesReader::~IncomingFramesReader() = default; @@ -48,6 +51,10 @@ DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); DCHECK(!callback_); DCHECK(!is_process_stopped_); + if (!connection_) { + std::move(callback).Run(base::nullopt); + return; + } callback_ = std::move(callback); frame_type_ = frame_type; @@ -154,3 +161,7 @@ std::move(callback_).Run(std::move(frame)); } } + +void IncomingFramesReader::OnConnectionClosed() { + connection_ = nullptr; +}
diff --git a/chrome/browser/nearby_sharing/incoming_frames_reader.h b/chrome/browser/nearby_sharing/incoming_frames_reader.h index fe362ab..b9505b71 100644 --- a/chrome/browser/nearby_sharing/incoming_frames_reader.h +++ b/chrome/browser/nearby_sharing/incoming_frames_reader.h
@@ -51,6 +51,7 @@ void OnFrameDecoded(sharing::mojom::FramePtr mojo_frame); void OnTimeout(); void Done(base::Optional<sharing::mojom::V1FramePtr> frame); + void OnConnectionClosed(); NearbyProcessManager* process_manager_; Profile* profile_;
diff --git a/chrome/browser/nearby_sharing/incoming_frames_reader_unittest.cc b/chrome/browser/nearby_sharing/incoming_frames_reader_unittest.cc index 0a03a1a..33d6709 100644 --- a/chrome/browser/nearby_sharing/incoming_frames_reader_unittest.cc +++ b/chrome/browser/nearby_sharing/incoming_frames_reader_unittest.cc
@@ -179,46 +179,30 @@ run_loop_introduction.Run(); } -TEST_F(IncomingFramesReaderTest, ReadAfterTimeout) { +TEST_F(IncomingFramesReaderTest, ReadAfterConnectionClosed) { EXPECT_CALL(decoder(), DecodeFrame(testing::_, testing::_)).Times(0); - base::RunLoop run_loop_timeout; + base::RunLoop run_loop_before_close; frames_reader().ReadFrame( sharing::mojom::V1Frame::Tag::INTRODUCTION, base::BindLambdaForTesting( [&](base::Optional<sharing::mojom::V1FramePtr> frame) { EXPECT_FALSE(frame); - run_loop_timeout.Quit(); + run_loop_before_close.Quit(); }), kTimeout); - run_loop_timeout.Run(); - std::vector<uint8_t> introduction_frame = GetIntroductionFrame(); - connection().AppendReadableData(introduction_frame); + connection().Close(); + run_loop_before_close.Run(); - EXPECT_CALL(decoder(), - DecodeFrame(testing::Eq(introduction_frame), testing::_)) - .WillOnce(testing::Invoke( - [&](const std::vector<uint8_t>& data, - MockNearbySharingDecoder::DecodeFrameCallback callback) { - sharing::mojom::V1FramePtr mojo_v1frame = - sharing::mojom::V1Frame::New(); - mojo_v1frame->set_introduction( - sharing::mojom::IntroductionFrame::New()); - - sharing::mojom::FramePtr mojo_frame = sharing::mojom::Frame::New(); - mojo_frame->set_v1(std::move(mojo_v1frame)); - std::move(callback).Run(std::move(mojo_frame)); - })); - - base::RunLoop run_loop; + base::RunLoop run_loop_after_close; frames_reader().ReadFrame( sharing::mojom::V1Frame::Tag::INTRODUCTION, base::BindLambdaForTesting( [&](base::Optional<sharing::mojom::V1FramePtr> frame) { - ExpectIntroductionFrame(frame); - run_loop.Quit(); + EXPECT_FALSE(frame); + run_loop_after_close.Quit(); }), kTimeout); - run_loop.Run(); + run_loop_after_close.Run(); }
diff --git a/chrome/browser/nearby_sharing/mock_nearby_connections.h b/chrome/browser/nearby_sharing/mock_nearby_connections.h index a2e80bf..7a7170de 100644 --- a/chrome/browser/nearby_sharing/mock_nearby_connections.h +++ b/chrome/browser/nearby_sharing/mock_nearby_connections.h
@@ -15,6 +15,8 @@ location::nearby::connections::mojom::DiscoveryOptionsPtr; using EndpointDiscoveryListener = location::nearby::connections::mojom::EndpointDiscoveryListener; +using ConnectionLifecycleListener = + location::nearby::connections::mojom::ConnectionLifecycleListener; class MockNearbyConnections : public NearbyConnectionsMojom { public: @@ -34,6 +36,18 @@ StopDiscovery, (StopDiscoveryCallback callback), (override)); + MOCK_METHOD(void, + RequestConnection, + (const std::vector<uint8_t>& endpoint_info, + const std::string& endpoint_id, + mojo::PendingRemote<ConnectionLifecycleListener> listener, + RequestConnectionCallback callback), + (override)); + MOCK_METHOD(void, + DisconnectFromEndpoint, + (const std::string& endpoint_id, + DisconnectFromEndpointCallback callback), + (override)); }; #endif // CHROME_BROWSER_NEARBY_SHARING_MOCK_NEARBY_CONNECTIONS_H_
diff --git a/chrome/browser/nearby_sharing/mock_nearby_sharing_service.h b/chrome/browser/nearby_sharing/mock_nearby_sharing_service.h index 83a00c0a..fca3c8e 100644 --- a/chrome/browser/nearby_sharing/mock_nearby_sharing_service.h +++ b/chrome/browser/nearby_sharing/mock_nearby_sharing_service.h
@@ -6,9 +6,11 @@ #define CHROME_BROWSER_NEARBY_SHARING_MOCK_NEARBY_SHARING_SERVICE_H_ #include "chrome/browser/nearby_sharing/nearby_sharing_service.h" +#include "components/keyed_service/core/keyed_service.h" #include "testing/gmock/include/gmock/gmock.h" -class MockNearbySharingService : public NearbySharingService { +class MockNearbySharingService : public NearbySharingService, + public KeyedService { public: MockNearbySharingService(); ~MockNearbySharingService() override; @@ -58,6 +60,10 @@ Open, (const ShareTarget&, StatusCodesCallback), (override)); + MOCK_METHOD(NearbyNotificationDelegate*, + GetNotificationDelegate, + (const std::string&), + (override)); MOCK_METHOD(NearbyShareSettings*, GetSettings, (), (override)); MOCK_METHOD(NearbyShareHttpNotifier*, GetHttpNotifier, (), (override)); MOCK_METHOD(NearbyShareLocalDeviceDataManager*,
diff --git a/chrome/browser/nearby_sharing/nearby_connection.h b/chrome/browser/nearby_sharing/nearby_connection.h index 7f51ba5..645c1b81 100644 --- a/chrome/browser/nearby_sharing/nearby_connection.h +++ b/chrome/browser/nearby_sharing/nearby_connection.h
@@ -18,29 +18,26 @@ public: using ReadCallback = base::OnceCallback<void(base::Optional<std::vector<uint8_t>> bytes)>; - using WriteCallback = base::OnceCallback<void(bool result)>; virtual ~NearbyConnection() = default; // Reads a stream of bytes from the remote device. Invoke |callback| when - // there is incoming data or when the socket is closed. + // there is incoming data or when the socket is closed. Previously set + // callback will be replaced by |callback|. Must not be used on a already + // closed connection. virtual void Read(ReadCallback callback) = 0; // Writes an outgoing stream of bytes to the remote device asynchronously. - // Invoke |callback| with True if successful, False if failed or socket is - // closed. - virtual void Write(std::vector<uint8_t> bytes, WriteCallback callback) = 0; + // Must not be used on a already closed connection. + virtual void Write(std::vector<uint8_t> bytes) = 0; // Closes the socket and disconnects from the remote device. This object will // be invalidated after |callback| in RegisterForDisconnection is invoked. virtual void Close() = 0; - // Return True if the socket is closed, False otherwise. - virtual bool IsClosed() const = 0; - // Listens to the socket being closed. Invoke |callback| when the socket is - // closed. This object will be invalidated after |callback| is invoked. - virtual void RegisterForDisconnection(base::OnceClosure callback) = 0; + // closed. This object will be invalidated after |listener| is invoked. + virtual void RegisterForDisconnection(base::OnceClosure listener) = 0; }; #endif // CHROME_BROWSER_NEARBY_SHARING_NEARBY_CONNECTION_H_
diff --git a/chrome/browser/nearby_sharing/nearby_connection_impl.cc b/chrome/browser/nearby_sharing/nearby_connection_impl.cc new file mode 100644 index 0000000..3670f17f --- /dev/null +++ b/chrome/browser/nearby_sharing/nearby_connection_impl.cc
@@ -0,0 +1,70 @@ +// 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/nearby_sharing/nearby_connection_impl.h" + +#include "chrome/browser/nearby_sharing/nearby_connections_manager.h" +#include "crypto/random.h" + +NearbyConnectionImpl::NearbyConnectionImpl( + NearbyConnectionsManager* nearby_connections_manager, + const std::string& endpoint_id) + : nearby_connections_manager_(nearby_connections_manager), + endpoint_id_(endpoint_id) {} + +NearbyConnectionImpl::~NearbyConnectionImpl() { + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); + if (read_callback_) + std::move(read_callback_).Run(base::nullopt); + + for (auto& disconnect_listener : disconnect_listeners_) + std::move(disconnect_listener).Run(); +} + +void NearbyConnectionImpl::Read(ReadCallback callback) { + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); + read_callback_ = std::move(callback); + + if (reads_.empty()) + return; + + std::vector<uint8_t> bytes = std::move(reads_.front()); + reads_.pop(); + std::move(read_callback_).Run(std::move(bytes)); +} + +void NearbyConnectionImpl::Write(std::vector<uint8_t> bytes) { + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); + + NearbyConnectionsManager::PayloadPtr payload = + NearbyConnectionsManager::Payload::New(); + crypto::RandBytes(&payload->id, sizeof(payload->id)); + payload->content = + PayloadContent::NewBytes(BytesPayload::New(std::move(bytes))); + nearby_connections_manager_->Send(endpoint_id_, std::move(payload), + /*listener=*/nullptr, base::DoNothing()); +} + +void NearbyConnectionImpl::Close() { + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); + // As |this| therefore endpoint_id_ will be distroyed in Disconnect, make a + // copy of |endpoint_id| as the parameter is a const ref. + nearby_connections_manager_->Disconnect(std::string(endpoint_id_)); +} + +void NearbyConnectionImpl::RegisterForDisconnection( + base::OnceClosure listener) { + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); + disconnect_listeners_.push_back(std::move(listener)); +} + +void NearbyConnectionImpl::WriteMessage(std::vector<uint8_t> bytes) { + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); + if (read_callback_) { + std::move(read_callback_).Run(std::move(bytes)); + return; + } + + reads_.push(std::move(bytes)); +}
diff --git a/chrome/browser/nearby_sharing/nearby_connection_impl.h b/chrome/browser/nearby_sharing/nearby_connection_impl.h new file mode 100644 index 0000000..42f9e6f --- /dev/null +++ b/chrome/browser/nearby_sharing/nearby_connection_impl.h
@@ -0,0 +1,48 @@ +// 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_NEARBY_SHARING_NEARBY_CONNECTION_IMPL_H_ +#define CHROME_BROWSER_NEARBY_SHARING_NEARBY_CONNECTION_IMPL_H_ + +#include "chrome/browser/nearby_sharing/nearby_connection.h" + +#include <queue> +#include <vector> +#include "base/sequence_checker.h" +#include "chrome/services/sharing/public/mojom/nearby_connections_types.mojom.h" + +class NearbyConnectionsManager; + +class NearbyConnectionImpl : public NearbyConnection { + public: + NearbyConnectionImpl(NearbyConnectionsManager* nearby_connections_manager, + const std::string& endpoint_id); + ~NearbyConnectionImpl() override; + + // NearbyConnection: + void Read(ReadCallback callback) override; + void Write(std::vector<uint8_t> bytes) override; + void Close() override; + void RegisterForDisconnection(base::OnceClosure listener) override; + + // Add |bytes| to the read queue, notifying ReadCallback. + void WriteMessage(std::vector<uint8_t> bytes); + + private: + using PayloadContent = location::nearby::connections::mojom::PayloadContent; + using BytesPayload = location::nearby::connections::mojom::BytesPayload; + + SEQUENCE_CHECKER(sequence_checker_); + + NearbyConnectionsManager* nearby_connections_manager_; + std::string endpoint_id_; + ReadCallback read_callback_; + std::vector<base::OnceClosure> disconnect_listeners_; + + // A read queue. The data that we've read from the remote device ends up here + // until Read() is called to dequeue it. + std::queue<std::vector<uint8_t>> reads_; +}; + +#endif // CHROME_BROWSER_NEARBY_SHARING_NEARBY_CONNECTION_IMPL_H_
diff --git a/chrome/browser/nearby_sharing/nearby_connections_manager.h b/chrome/browser/nearby_sharing/nearby_connections_manager.h index 76a78966..ca383b0 100644 --- a/chrome/browser/nearby_sharing/nearby_connections_manager.h +++ b/chrome/browser/nearby_sharing/nearby_connections_manager.h
@@ -18,6 +18,7 @@ // A wrapper around the Nearby Connections mojo API. class NearbyConnectionsManager { public: + using Payload = location::nearby::connections::mojom::Payload; using PayloadPtr = location::nearby::connections::mojom::PayloadPtr; using ConnectionsStatus = location::nearby::connections::mojom::Status; using ConnectionsCallback = @@ -112,7 +113,7 @@ PayloadStatusListener* listener) = 0; // Gets the payload associated with |payload_id| if available. - virtual PayloadPtr GetIncomingPayload(int64_t payload_id) = 0; + virtual Payload* GetIncomingPayload(int64_t payload_id) = 0; // Cancels a Payload currently in-flight to or from remote endpoints. virtual void Cancel(int64_t payload_id, ConnectionsCallback callback) = 0;
diff --git a/chrome/browser/nearby_sharing/nearby_connections_manager_impl.cc b/chrome/browser/nearby_sharing/nearby_connections_manager_impl.cc index 3c6a481..72c51ec0 100644 --- a/chrome/browser/nearby_sharing/nearby_connections_manager_impl.cc +++ b/chrome/browser/nearby_sharing/nearby_connections_manager_impl.cc
@@ -5,8 +5,10 @@ #include "chrome/browser/nearby_sharing/nearby_connections_manager_impl.h" #include "base/strings/string_number_conversions.h" +#include "base/unguessable_token.h" #include "chrome/browser/nearby_sharing/logging/logging.h" #include "chrome/services/sharing/public/mojom/nearby_connections_types.mojom.h" +#include "crypto/random.h" namespace { @@ -84,13 +86,45 @@ DataUsage data_usage, NearbyConnectionCallback callback) { // TOOD(crbug/1076008): Implement. + if (!nearby_connections_) { + std::move(callback).Run(nullptr); + return; + } + + // TODO(crbug/10706008): Add MediumSelector and bluetooth_mac_address. + nearby_connections_->RequestConnection( + endpoint_info, endpoint_id, + connection_lifecycle_listener_.BindNewPipeAndPassRemote(), + base::BindOnce(&NearbyConnectionsManagerImpl::OnConnectionRequested, + weak_ptr_factory_.GetWeakPtr(), endpoint_id, + std::move(callback))); +} + +void NearbyConnectionsManagerImpl::OnConnectionRequested( + const std::string& endpoint_id, + NearbyConnectionCallback callback, + ConnectionsStatus status) { + if (status != ConnectionsStatus::kSuccess) { + NS_LOG(ERROR) << "Failed to connect to the remote shareTarget: " << status; + nearby_connections_->DisconnectFromEndpoint(endpoint_id, base::DoNothing()); + std::move(callback).Run(nullptr); + return; + } + + auto result = + pending_outgoing_connections_.emplace(endpoint_id, std::move(callback)); + DCHECK(result.second); + + // TODO(crbug/1111458): Support TransferManager. } void NearbyConnectionsManagerImpl::Disconnect(const std::string& endpoint_id) { if (!nearby_connections_) return; - // TOOD(crbug/1076008): Implement. + nearby_connections_->DisconnectFromEndpoint(endpoint_id, base::DoNothing()); + OnDisconnected(endpoint_id); + NS_LOG(INFO) << "Disconnected from " << endpoint_id; } void NearbyConnectionsManagerImpl::Send(const std::string& endpoint_id, @@ -114,11 +148,8 @@ // TOOD(crbug/1076008): Implement. } -NearbyConnectionsManagerImpl::PayloadPtr +NearbyConnectionsManagerImpl::Payload* NearbyConnectionsManagerImpl::GetIncomingPayload(int64_t payload_id) { - if (!nearby_connections_) - return nullptr; - // TOOD(crbug/1076008): Implement. return nullptr; } @@ -134,20 +165,17 @@ } void NearbyConnectionsManagerImpl::ClearIncomingPayloads() { - if (!nearby_connections_) - return; - // TOOD(crbug/1076008): Implement. } base::Optional<std::vector<uint8_t>> NearbyConnectionsManagerImpl::GetRawAuthenticationToken( const std::string& endpoint_id) { - if (!nearby_connections_) + auto it = connection_info_map_.find(endpoint_id); + if (it == connection_info_map_.end()) return base::nullopt; - // TOOD(crbug/1076008): Implement. - return base::nullopt; + return it->second->raw_authentication_token; } void NearbyConnectionsManagerImpl::OnNearbyProfileChanged(Profile* profile) { @@ -210,6 +238,75 @@ NS_LOG(INFO) << "Endpoint " << endpoint_id << " lost over Nearby Connections"; } +void NearbyConnectionsManagerImpl::OnConnectionInitiated( + const std::string& endpoint_id, + ConnectionInfoPtr info) { + auto result = connection_info_map_.emplace(endpoint_id, std::move(info)); + DCHECK(result.second); + // TOOD(crbug/1076008): Implemnet AcceptConnection. + // nearby_connections_->AcceptConnection( + // endpoint_id, payload_listener_.BindNewPipeAndPassRemote()); +} + +void NearbyConnectionsManagerImpl::OnConnectionAccepted( + const std::string& endpoint_id) { + auto it = connection_info_map_.find(endpoint_id); + if (it == connection_info_map_.end()) + return; + + if (it->second->is_incoming_connection) { + // TOOD(crbug/1076008): Handle incoming connection. + } else { + auto it = pending_outgoing_connections_.find(endpoint_id); + if (it == pending_outgoing_connections_.end()) { + Disconnect(endpoint_id); + return; + } + + auto result = connections_.emplace( + endpoint_id, std::make_unique<NearbyConnectionImpl>(this, endpoint_id)); + DCHECK(result.second); + std::move(it->second).Run(result.first->second.get()); + pending_outgoing_connections_.erase(it); + } +} + +void NearbyConnectionsManagerImpl::OnConnectionRejected( + const std::string& endpoint_id, + Status status) { + connection_info_map_.erase(endpoint_id); + + auto it = pending_outgoing_connections_.find(endpoint_id); + if (it != pending_outgoing_connections_.end()) { + std::move(it->second).Run(nullptr); + pending_outgoing_connections_.erase(it); + } + + // TODO(crbug/1111458): Support TransferManager. +} + +void NearbyConnectionsManagerImpl::OnDisconnected( + const std::string& endpoint_id) { + connection_info_map_.erase(endpoint_id); + + auto it = pending_outgoing_connections_.find(endpoint_id); + if (it != pending_outgoing_connections_.end()) { + std::move(it->second).Run(nullptr); + pending_outgoing_connections_.erase(it); + } + + connections_.erase(endpoint_id); + + // TODO(crbug/1111458): Support TransferManager. +} + +void NearbyConnectionsManagerImpl::OnBandwidthChanged( + const std::string& endpoint_id, + int32_t quality) { + NS_LOG(VERBOSE) << __func__; + // TODO(crbug/1111458): Support TransferManager. +} + bool NearbyConnectionsManagerImpl::BindNearbyConnections() { if (!nearby_connections_) { nearby_connections_ =
diff --git a/chrome/browser/nearby_sharing/nearby_connections_manager_impl.h b/chrome/browser/nearby_sharing/nearby_connections_manager_impl.h index b660ec38..c39c818 100644 --- a/chrome/browser/nearby_sharing/nearby_connections_manager_impl.h +++ b/chrome/browser/nearby_sharing/nearby_connections_manager_impl.h
@@ -7,9 +7,11 @@ #include "chrome/browser/nearby_sharing/nearby_connections_manager.h" -#include <set> - +#include "base/containers/flat_map.h" +#include "base/containers/flat_set.h" #include "base/gtest_prod_util.h" +#include "base/memory/weak_ptr.h" +#include "chrome/browser/nearby_sharing/nearby_connection_impl.h" #include "chrome/browser/nearby_sharing/nearby_process_manager.h" #include "chrome/services/sharing/public/mojom/nearby_connections.mojom.h" #include "mojo/public/cpp/bindings/receiver.h" @@ -20,7 +22,8 @@ class NearbyConnectionsManagerImpl : public NearbyConnectionsManager, public NearbyProcessManager::Observer, - public location::nearby::connections::mojom::EndpointDiscoveryListener { + public location::nearby::connections::mojom::EndpointDiscoveryListener, + public location::nearby::connections::mojom::ConnectionLifecycleListener { public: NearbyConnectionsManagerImpl(NearbyProcessManager* process_manager, Profile* profile); @@ -52,7 +55,7 @@ ConnectionsCallback callback) override; void RegisterPayloadStatusListener(int64_t payload_id, PayloadStatusListener* listener) override; - PayloadPtr GetIncomingPayload(int64_t payload_id) override; + Payload* GetIncomingPayload(int64_t payload_id) override; void Cancel(int64_t payload_id, ConnectionsCallback callback) override; void ClearIncomingPayloads() override; base::Optional<std::vector<uint8_t>> GetRawAuthenticationToken( @@ -63,8 +66,14 @@ location::nearby::connections::mojom::DiscoveryOptions; using EndpointDiscoveryListener = location::nearby::connections::mojom::EndpointDiscoveryListener; + using ConnectionLifecycleListener = + location::nearby::connections::mojom::ConnectionLifecycleListener; using DiscoveredEndpointInfoPtr = location::nearby::connections::mojom::DiscoveredEndpointInfoPtr; + using ConnectionInfoPtr = + location::nearby::connections::mojom::ConnectionInfoPtr; + using Status = location::nearby::connections::mojom::Status; + FRIEND_TEST_ALL_PREFIXES(NearbyConnectionsManagerImplTest, DiscoveryProcessStopped); @@ -78,20 +87,44 @@ DiscoveredEndpointInfoPtr info) override; void OnEndpointLost(const std::string& endpoint_id) override; + // mojom::ConnectionLifecycleListener: + void OnConnectionInitiated(const std::string& endpoint_id, + ConnectionInfoPtr info) override; + void OnConnectionAccepted(const std::string& endpoint_id) override; + void OnConnectionRejected(const std::string& endpoint_id, + Status status) override; + void OnDisconnected(const std::string& endpoint_id) override; + void OnBandwidthChanged(const std::string& endpoint_id, + int32_t quality) override; + + void OnConnectionRequested(const std::string& endpoint_id, + NearbyConnectionCallback callback, + ConnectionsStatus status); bool BindNearbyConnections(); void Reset(); NearbyProcessManager* process_manager_; Profile* profile_; DiscoveryListener* discovery_listener_ = nullptr; - std::set<std::string> discovered_endpoints_; + base::flat_set<std::string> discovered_endpoints_; + // A map of endpoint_id to NearbyConnectionCallback. + base::flat_map<std::string, NearbyConnectionCallback> + pending_outgoing_connections_; + // A map of endpoint_id to ConnectionInfoPtr. + base::flat_map<std::string, ConnectionInfoPtr> connection_info_map_; + // A map of endpoint_id to NearbyConnection. + base::flat_map<std::string, std::unique_ptr<NearbyConnectionImpl>> + connections_; ScopedObserver<NearbyProcessManager, NearbyProcessManager::Observer> nearby_process_observer_{this}; mojo::Receiver<EndpointDiscoveryListener> endpoint_discovery_listener_{this}; + mojo::Receiver<ConnectionLifecycleListener> connection_lifecycle_listener_{ + this}; location::nearby::connections::mojom::NearbyConnections* nearby_connections_ = nullptr; + base::WeakPtrFactory<NearbyConnectionsManagerImpl> weak_ptr_factory_{this}; }; #endif // CHROME_BROWSER_NEARBY_SHARING_NEARBY_CONNECTIONS_MANAGER_IMPL_H_
diff --git a/chrome/browser/nearby_sharing/nearby_connections_manager_impl_unittest.cc b/chrome/browser/nearby_sharing/nearby_connections_manager_impl_unittest.cc index 925815b..8c6fd80 100644 --- a/chrome/browser/nearby_sharing/nearby_connections_manager_impl_unittest.cc +++ b/chrome/browser/nearby_sharing/nearby_connections_manager_impl_unittest.cc
@@ -7,9 +7,11 @@ #include <memory> #include "base/run_loop.h" +#include "base/test/bind_test_util.h" #include "base/test/mock_callback.h" #include "chrome/browser/nearby_sharing/mock_nearby_connections.h" #include "chrome/browser/nearby_sharing/mock_nearby_process_manager.h" +#include "chrome/browser/nearby_sharing/nearby_connection_impl.h" #include "chrome/services/sharing/public/mojom/nearby_connections_types.mojom.h" #include "chrome/test/base/testing_browser_process.h" #include "chrome/test/base/testing_profile.h" @@ -24,13 +26,20 @@ const location::nearby::connections::mojom::Strategy kStrategy = location::nearby::connections::mojom::Strategy::kP2pPointToPoint; const char kEndpointId[] = "endpoint_id"; +const char kRemoteEndpointId[] = "remote_endpoint_id"; const char kEndpointInfo[] = {0x0d, 0x07, 0x07, 0x07, 0x07}; +const char kRemoteEndpointInfo[] = {0x0d, 0x07, 0x06, 0x08, 0x09}; +const char kAuthenticationToken[] = "authentication_token"; +const char kRawAuthenticationToken[] = {0x00, 0x05, 0x04, 0x03, 0x02}; +const char kBytePayload[] = {0x08, 0x09, 0x06, 0x04, 0x0f}; +const char kBytePayload2[] = {0x0a, 0x0b, 0x0c, 0x0d, 0x0e}; } // namespace using Status = location::nearby::connections::mojom::Status; using DiscoveredEndpointInfo = location::nearby::connections::mojom::DiscoveredEndpointInfo; +using ConnectionInfo = location::nearby::connections::mojom::ConnectionInfo; class MockDiscoveryListener : public NearbyConnectionsManager::DiscoveryListener { @@ -47,7 +56,93 @@ }; class NearbyConnectionsManagerImplTest : public testing::Test { + public: + void SetUp() override { + EXPECT_CALL(nearby_process_manager_, + GetOrStartNearbyConnections(testing::Eq(&profile_))) + .WillRepeatedly(testing::Return(&nearby_connections_)); + } + protected: + void StartDiscovery( + mojo::Remote<EndpointDiscoveryListener>& listener_remote, + testing::NiceMock<MockDiscoveryListener>& discovery_listener) { + EXPECT_CALL(nearby_connections_, StartDiscovery) + .WillOnce([&listener_remote]( + const std::string& service_id, + DiscoveryOptionsPtr options, + mojo::PendingRemote<EndpointDiscoveryListener> listener, + NearbyConnectionsMojom::StartDiscoveryCallback callback) { + EXPECT_EQ(kServiceId, service_id); + EXPECT_EQ(kStrategy, options->strategy); + + listener_remote.Bind(std::move(listener)); + std::move(callback).Run(Status::kSuccess); + }); + base::MockCallback<NearbyConnectionsManager::ConnectionsCallback> callback; + EXPECT_CALL(callback, Run(testing::Eq(Status::kSuccess))); + nearby_connections_manager_.StartDiscovery(&discovery_listener, + callback.Get()); + } + + enum class ConnectionResponse { kAccepted, kRejceted, kDisconnected }; + + NearbyConnection* Connect( + mojo::Remote<ConnectionLifecycleListener>& listener_remote, + ConnectionResponse connection_response) { + const std::vector<uint8_t> local_endpoint_info(std::begin(kEndpointInfo), + std::end(kEndpointInfo)); + const std::vector<uint8_t> remote_endpoint_info( + std::begin(kRemoteEndpointInfo), std::end(kRemoteEndpointInfo)); + const std::vector<uint8_t> raw_authentication_token( + std::begin(kRawAuthenticationToken), std::end(kRawAuthenticationToken)); + + EXPECT_CALL(nearby_connections_, RequestConnection) + .WillOnce( + [&](const std::vector<uint8_t>& endpoint_info, + const std::string& endpoint_id, + mojo::PendingRemote<ConnectionLifecycleListener> listener, + NearbyConnectionsMojom::RequestConnectionCallback callback) { + EXPECT_EQ(local_endpoint_info, endpoint_info); + EXPECT_EQ(kRemoteEndpointId, endpoint_id); + + listener_remote.Bind(std::move(listener)); + std::move(callback).Run(Status::kSuccess); + }); + + base::RunLoop run_loop; + NearbyConnection* nearby_connection; + nearby_connections_manager_.Connect( + local_endpoint_info, kRemoteEndpointId, + /*bluetooth_mac_address=*/base::nullopt, DataUsage::kOffline, + base::BindLambdaForTesting([&](NearbyConnection* connection) { + nearby_connection = connection; + run_loop.Quit(); + })); + + listener_remote->OnConnectionInitiated( + kRemoteEndpointId, + ConnectionInfo::New(kAuthenticationToken, raw_authentication_token, + remote_endpoint_info, + /*is_incoming_connection=*/false)); + + switch (connection_response) { + case ConnectionResponse::kAccepted: + listener_remote->OnConnectionAccepted(kRemoteEndpointId); + break; + case ConnectionResponse::kRejceted: + listener_remote->OnConnectionRejected(kRemoteEndpointId, + Status::kConnectionRejected); + break; + case ConnectionResponse::kDisconnected: + listener_remote->OnDisconnected(kRemoteEndpointId); + break; + } + run_loop.Run(); + + return nearby_connection; + } + content::BrowserTaskEnvironment task_environment_; TestingProfile profile_; testing::NiceMock<MockNearbyConnections> nearby_connections_; @@ -60,28 +155,10 @@ const std::vector<uint8_t> endpoint_info(std::begin(kEndpointInfo), std::end(kEndpointInfo)); - EXPECT_CALL(nearby_process_manager_, - GetOrStartNearbyConnections(testing::Eq(&profile_))) - .WillRepeatedly(testing::Return(&nearby_connections_)); - // StartDiscovery will succeed. mojo::Remote<EndpointDiscoveryListener> listener_remote; - EXPECT_CALL(nearby_connections_, StartDiscovery) - .WillOnce([&listener_remote]( - const std::string& service_id, DiscoveryOptionsPtr options, - mojo::PendingRemote<EndpointDiscoveryListener> listener, - NearbyConnectionsMojom::StartDiscoveryCallback callback) { - EXPECT_EQ(kServiceId, service_id); - EXPECT_EQ(kStrategy, options->strategy); - - listener_remote.Bind(std::move(listener)); - std::move(callback).Run(Status::kSuccess); - }); testing::NiceMock<MockDiscoveryListener> discovery_listener; - base::MockCallback<NearbyConnectionsManager::ConnectionsCallback> callback; - EXPECT_CALL(callback, Run(testing::Eq(Status::kSuccess))); - nearby_connections_manager_.StartDiscovery(&discovery_listener, - callback.Get()); + StartDiscovery(listener_remote, discovery_listener); // Invoking OnEndpointFound over remote will invoke OnEndpointDiscovered. base::RunLoop discovered_run_loop; @@ -126,17 +203,7 @@ // StartDiscovery again will succeed. listener_remote.reset(); - EXPECT_CALL(nearby_connections_, StartDiscovery) - .WillOnce([&listener_remote]( - const std::string& service_id, DiscoveryOptionsPtr options, - mojo::PendingRemote<EndpointDiscoveryListener> listener, - NearbyConnectionsMojom::StartDiscoveryCallback callback) { - listener_remote.Bind(std::move(listener)); - std::move(callback).Run(Status::kSuccess); - }); - EXPECT_CALL(callback, Run(testing::Eq(Status::kSuccess))); - nearby_connections_manager_.StartDiscovery(&discovery_listener, - callback.Get()); + StartDiscovery(listener_remote, discovery_listener); // Same endpotinId can be discovered again. base::RunLoop discovered_run_loop_3; @@ -153,28 +220,10 @@ const std::vector<uint8_t> endpoint_info(std::begin(kEndpointInfo), std::end(kEndpointInfo)); - EXPECT_CALL(nearby_process_manager_, - GetOrStartNearbyConnections(testing::Eq(&profile_))) - .WillRepeatedly(testing::Return(&nearby_connections_)); - // StartDiscovery will succeed. mojo::Remote<EndpointDiscoveryListener> listener_remote; - EXPECT_CALL(nearby_connections_, StartDiscovery) - .WillOnce([&listener_remote]( - const std::string& service_id, DiscoveryOptionsPtr options, - mojo::PendingRemote<EndpointDiscoveryListener> listener, - NearbyConnectionsMojom::StartDiscoveryCallback callback) { - EXPECT_EQ(kServiceId, service_id); - EXPECT_EQ(kStrategy, options->strategy); - - listener_remote.Bind(std::move(listener)); - std::move(callback).Run(Status::kSuccess); - }); testing::NiceMock<MockDiscoveryListener> discovery_listener; - base::MockCallback<NearbyConnectionsManager::ConnectionsCallback> callback; - EXPECT_CALL(callback, Run(testing::Eq(Status::kSuccess))); - nearby_connections_manager_.StartDiscovery(&discovery_listener, - callback.Get()); + StartDiscovery(listener_remote, discovery_listener); nearby_connections_manager_.OnNearbyProcessStopped(); @@ -189,3 +238,246 @@ EXPECT_CALL(nearby_connections_, StopDiscovery).Times(0); nearby_connections_manager_.StopDiscovery(); } + +TEST_F(NearbyConnectionsManagerImplTest, ConnectRejected) { + // StartDiscovery will succeed. + mojo::Remote<EndpointDiscoveryListener> discovery_listener_remote; + testing::NiceMock<MockDiscoveryListener> discovery_listener; + StartDiscovery(discovery_listener_remote, discovery_listener); + + // RequestConnection will succeed. + mojo::Remote<ConnectionLifecycleListener> listener_remote; + NearbyConnection* nearby_connection = + Connect(listener_remote, ConnectionResponse::kRejceted); + EXPECT_FALSE(nearby_connection); + EXPECT_FALSE( + nearby_connections_manager_.GetRawAuthenticationToken(kRemoteEndpointId)); +} + +TEST_F(NearbyConnectionsManagerImplTest, ConnectDisconnted) { + // StartDiscovery will succeed. + mojo::Remote<EndpointDiscoveryListener> discovery_listener_remote; + testing::NiceMock<MockDiscoveryListener> discovery_listener; + StartDiscovery(discovery_listener_remote, discovery_listener); + + // RequestConnection will succeed. + mojo::Remote<ConnectionLifecycleListener> listener_remote; + NearbyConnection* nearby_connection = + Connect(listener_remote, ConnectionResponse::kDisconnected); + EXPECT_FALSE(nearby_connection); + EXPECT_FALSE( + nearby_connections_manager_.GetRawAuthenticationToken(kRemoteEndpointId)); +} + +TEST_F(NearbyConnectionsManagerImplTest, ConnectAccepted) { + const std::vector<uint8_t> raw_authentication_token( + std::begin(kRawAuthenticationToken), std::end(kRawAuthenticationToken)); + + // StartDiscovery will succeed. + mojo::Remote<EndpointDiscoveryListener> discovery_listener_remote; + testing::NiceMock<MockDiscoveryListener> discovery_listener; + StartDiscovery(discovery_listener_remote, discovery_listener); + + // RequestConnection will succeed. + mojo::Remote<ConnectionLifecycleListener> listener_remote; + NearbyConnection* nearby_connection = + Connect(listener_remote, ConnectionResponse::kAccepted); + EXPECT_TRUE(nearby_connection); + EXPECT_EQ( + raw_authentication_token, + nearby_connections_manager_.GetRawAuthenticationToken(kRemoteEndpointId)); +} + +TEST_F(NearbyConnectionsManagerImplTest, ConnectReadBeforeAppend) { + const std::vector<uint8_t> byte_payload(std::begin(kBytePayload), + std::end(kBytePayload)); + + // StartDiscovery will succeed. + mojo::Remote<EndpointDiscoveryListener> discovery_listener_remote; + testing::NiceMock<MockDiscoveryListener> discovery_listener; + StartDiscovery(discovery_listener_remote, discovery_listener); + + // RequestConnection will succeed. + mojo::Remote<ConnectionLifecycleListener> listener_remote; + NearbyConnection* nearby_connection = + Connect(listener_remote, ConnectionResponse::kAccepted); + ASSERT_TRUE(nearby_connection); + + // Read before message is appended should also succeed. + base::RunLoop read_run_loop; + nearby_connection->Read(base::BindLambdaForTesting( + [&](base::Optional<std::vector<uint8_t>> bytes) { + EXPECT_EQ(byte_payload, bytes); + read_run_loop.Quit(); + })); + // TOOD(crbug/1076008): Call from mojo instead of casting. + static_cast<NearbyConnectionImpl*>(nearby_connection) + ->WriteMessage(byte_payload); + read_run_loop.Run(); +} + +TEST_F(NearbyConnectionsManagerImplTest, ConnectReadAfterAppend) { + const std::vector<uint8_t> byte_payload(std::begin(kBytePayload), + std::end(kBytePayload)); + const std::vector<uint8_t> byte_payload_2(std::begin(kBytePayload2), + std::end(kBytePayload2)); + + // StartDiscovery will succeed. + mojo::Remote<EndpointDiscoveryListener> discovery_listener_remote; + testing::NiceMock<MockDiscoveryListener> discovery_listener; + StartDiscovery(discovery_listener_remote, discovery_listener); + + // RequestConnection will succeed. + mojo::Remote<ConnectionLifecycleListener> listener_remote; + NearbyConnection* nearby_connection = + Connect(listener_remote, ConnectionResponse::kAccepted); + ASSERT_TRUE(nearby_connection); + + // Read after message is appended should succeed. + // TOOD(crbug/1076008): Call from mojo instead of casting. + static_cast<NearbyConnectionImpl*>(nearby_connection) + ->WriteMessage(byte_payload); + static_cast<NearbyConnectionImpl*>(nearby_connection) + ->WriteMessage(byte_payload_2); + + base::RunLoop read_run_loop; + nearby_connection->Read(base::BindLambdaForTesting( + [&](base::Optional<std::vector<uint8_t>> bytes) { + EXPECT_EQ(byte_payload, bytes); + read_run_loop.Quit(); + })); + read_run_loop.Run(); + + base::RunLoop read_run_loop_2; + nearby_connection->Read(base::BindLambdaForTesting( + [&](base::Optional<std::vector<uint8_t>> bytes) { + EXPECT_EQ(byte_payload_2, bytes); + read_run_loop_2.Quit(); + })); + read_run_loop_2.Run(); +} + +TEST_F(NearbyConnectionsManagerImplTest, ConnectWrite) { + const std::vector<uint8_t> byte_payload(std::begin(kBytePayload), + std::end(kBytePayload)); + // StartDiscovery will succeed. + mojo::Remote<EndpointDiscoveryListener> discovery_listener_remote; + testing::NiceMock<MockDiscoveryListener> discovery_listener; + StartDiscovery(discovery_listener_remote, discovery_listener); + + // RequestConnection will succeed. + mojo::Remote<ConnectionLifecycleListener> listener_remote; + NearbyConnection* nearby_connection = + Connect(listener_remote, ConnectionResponse::kAccepted); + ASSERT_TRUE(nearby_connection); + + nearby_connection->Write(byte_payload); + // TOOD(crbug/1076008): Veriy that nearby_connections_.SendPayload is called. +} + +TEST_F(NearbyConnectionsManagerImplTest, ConnectClosed) { + // StartDiscovery will succeed. + mojo::Remote<EndpointDiscoveryListener> discovery_listener_remote; + testing::NiceMock<MockDiscoveryListener> discovery_listener; + StartDiscovery(discovery_listener_remote, discovery_listener); + + // RequestConnection will succeed. + mojo::Remote<ConnectionLifecycleListener> listener_remote; + NearbyConnection* nearby_connection = + Connect(listener_remote, ConnectionResponse::kAccepted); + ASSERT_TRUE(nearby_connection); + + // Close should invoke disconnection callback and read callback. + base::RunLoop close_run_loop; + nearby_connection->RegisterForDisconnection( + base::BindLambdaForTesting([&]() { close_run_loop.Quit(); })); + base::RunLoop read_run_loop_3; + nearby_connection->Read(base::BindLambdaForTesting( + [&](base::Optional<std::vector<uint8_t>> bytes) { + EXPECT_FALSE(bytes); + read_run_loop_3.Quit(); + })); + + EXPECT_CALL(nearby_connections_, DisconnectFromEndpoint) + .WillOnce( + [&](const std::string& endpoint_id, + NearbyConnectionsMojom::DisconnectFromEndpointCallback callback) { + EXPECT_EQ(kRemoteEndpointId, endpoint_id); + std::move(callback).Run(Status::kSuccess); + }); + nearby_connection->Close(); + close_run_loop.Run(); + read_run_loop_3.Run(); + + EXPECT_FALSE( + nearby_connections_manager_.GetRawAuthenticationToken(kRemoteEndpointId)); +} + +TEST_F(NearbyConnectionsManagerImplTest, ConnectClosedByRemote) { + // StartDiscovery will succeed. + mojo::Remote<EndpointDiscoveryListener> discovery_listener_remote; + testing::NiceMock<MockDiscoveryListener> discovery_listener; + StartDiscovery(discovery_listener_remote, discovery_listener); + + // RequestConnection will succeed. + mojo::Remote<ConnectionLifecycleListener> listener_remote; + NearbyConnection* nearby_connection = + Connect(listener_remote, ConnectionResponse::kAccepted); + ASSERT_TRUE(nearby_connection); + + // Remote closing should invoke disconnection callback and read callback. + base::RunLoop close_run_loop; + nearby_connection->RegisterForDisconnection( + base::BindLambdaForTesting([&]() { close_run_loop.Quit(); })); + base::RunLoop read_run_loop; + nearby_connection->Read(base::BindLambdaForTesting( + [&](base::Optional<std::vector<uint8_t>> bytes) { + EXPECT_FALSE(bytes); + read_run_loop.Quit(); + })); + + listener_remote->OnDisconnected(kRemoteEndpointId); + close_run_loop.Run(); + read_run_loop.Run(); + + EXPECT_FALSE( + nearby_connections_manager_.GetRawAuthenticationToken(kRemoteEndpointId)); +} + +TEST_F(NearbyConnectionsManagerImplTest, ConnectClosedByClient) { + // StartDiscovery will succeed. + mojo::Remote<EndpointDiscoveryListener> discovery_listener_remote; + testing::NiceMock<MockDiscoveryListener> discovery_listener; + StartDiscovery(discovery_listener_remote, discovery_listener); + + // RequestConnection will succeed. + mojo::Remote<ConnectionLifecycleListener> listener_remote; + NearbyConnection* nearby_connection = + Connect(listener_remote, ConnectionResponse::kAccepted); + ASSERT_TRUE(nearby_connection); + + // Remote closing should invoke disconnection callback and read callback. + base::RunLoop close_run_loop; + nearby_connection->RegisterForDisconnection( + base::BindLambdaForTesting([&]() { close_run_loop.Quit(); })); + base::RunLoop read_run_loop; + nearby_connection->Read(base::BindLambdaForTesting( + [&](base::Optional<std::vector<uint8_t>> bytes) { + EXPECT_FALSE(bytes); + read_run_loop.Quit(); + })); + + EXPECT_CALL(nearby_connections_, DisconnectFromEndpoint) + .WillOnce( + [&](const std::string& endpoint_id, + NearbyConnectionsMojom::DisconnectFromEndpointCallback callback) { + EXPECT_EQ(kRemoteEndpointId, endpoint_id); + std::move(callback).Run(Status::kSuccess); + }); + nearby_connections_manager_.Disconnect(kRemoteEndpointId); + close_run_loop.Run(); + read_run_loop.Run(); + + EXPECT_FALSE( + nearby_connections_manager_.GetRawAuthenticationToken(kRemoteEndpointId)); +}
diff --git a/chrome/browser/nearby_sharing/nearby_notification_delegate.h b/chrome/browser/nearby_sharing/nearby_notification_delegate.h new file mode 100644 index 0000000..f9a757d --- /dev/null +++ b/chrome/browser/nearby_sharing/nearby_notification_delegate.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 CHROME_BROWSER_NEARBY_SHARING_NEARBY_NOTIFICATION_DELEGATE_H_ +#define CHROME_BROWSER_NEARBY_SHARING_NEARBY_NOTIFICATION_DELEGATE_H_ + +#include <string> + +#include "base/optional.h" + +// Notification delegate that handles specific click and close events. +class NearbyNotificationDelegate { + public: + NearbyNotificationDelegate() = default; + virtual ~NearbyNotificationDelegate() = default; + + // Called when the user clicks on the notification with |notification_id|. + // When the click is on the notification itself |action_index| is nullopt. + // Otherwise |action_index| contains the index of the pressed button. + virtual void OnClick(const std::string& notification_id, + const base::Optional<int>& action_index) = 0; + + // Called when the notification with |notification_id| got closed by either + // the user, the system or Chrome itself. + virtual void OnClose(const std::string& notification_id) = 0; +}; + +#endif // CHROME_BROWSER_NEARBY_SHARING_NEARBY_NOTIFICATION_DELEGATE_H_
diff --git a/chrome/browser/nearby_sharing/nearby_notification_handler.cc b/chrome/browser/nearby_sharing/nearby_notification_handler.cc index ecd1a094..d6ccff1 100644 --- a/chrome/browser/nearby_sharing/nearby_notification_handler.cc +++ b/chrome/browser/nearby_sharing/nearby_notification_handler.cc
@@ -7,6 +7,42 @@ #include <utility> #include "base/callback.h" +#include "base/notreached.h" +#include "build/build_config.h" +#include "chrome/browser/nearby_sharing/logging/logging.h" +#include "chrome/browser/nearby_sharing/nearby_notification_delegate.h" +#include "chrome/browser/nearby_sharing/nearby_sharing_service.h" +#include "chrome/browser/nearby_sharing/nearby_sharing_service_factory.h" +#include "chrome/browser/notifications/notification_display_service.h" +#include "chrome/browser/notifications/notification_display_service_factory.h" +#include "chrome/browser/profiles/profile.h" + +#if defined(OS_CHROMEOS) +#include "chrome/browser/ui/settings_window_manager_chromeos.h" +#include "chrome/browser/ui/webui/settings/chromeos/constants/routes.mojom.h" +#endif + +namespace { + +NearbyNotificationDelegate* GetNotificationDelegate( + Profile* profile, + const std::string& notification_id) { + NearbySharingService* nearby_service = + NearbySharingServiceFactory::GetForBrowserContext(profile); + if (!nearby_service) + return nullptr; + + return nearby_service->GetNotificationDelegate(notification_id); +} + +void CloseNearbyNotification(Profile* profile, + const std::string& notification_id) { + NotificationDisplayServiceFactory::GetInstance() + ->GetForProfile(profile) + ->Close(NotificationHandler::Type::NEARBY_SHARE, notification_id); +} + +} // namespace NearbyNotificationHandler::NearbyNotificationHandler() = default; @@ -19,7 +55,17 @@ const base::Optional<int>& action_index, const base::Optional<base::string16>& reply, base::OnceClosure completed_closure) { - // TODO(crbug.com/1102348): Route to NearbySharingService. + NearbyNotificationDelegate* delegate = + GetNotificationDelegate(profile, notification_id); + if (!delegate) { + NS_LOG(VERBOSE) << "Ignoring notification click event for unknown id " + << notification_id; + CloseNearbyNotification(profile, notification_id); + std::move(completed_closure).Run(); + return; + } + + delegate->OnClick(notification_id, action_index); std::move(completed_closure).Run(); } @@ -28,11 +74,26 @@ const std::string& notification_id, bool by_user, base::OnceClosure completed_closure) { - // TODO(crbug.com/1102348): Route to NearbySharingService. + NearbyNotificationDelegate* delegate = + GetNotificationDelegate(profile, notification_id); + if (!delegate) { + NS_LOG(VERBOSE) << "Ignoring notification close event for unknown id " + << notification_id; + std::move(completed_closure).Run(); + return; + } + + delegate->OnClose(notification_id); std::move(completed_closure).Run(); } void NearbyNotificationHandler::OpenSettings(Profile* profile, const GURL& origin) { - // TODO(crbug.com/1102348): Route to NearbySharingService. +#if defined(OS_CHROMEOS) + chrome::SettingsWindowManager::GetInstance()->ShowOSSettings( + profile, chromeos::settings::mojom::kNearbyShareSubpagePath); +#else + // TODO(crbug.com/1102348): Open browser settings once there is a nearby page. + NOTREACHED(); +#endif }
diff --git a/chrome/browser/nearby_sharing/nearby_notification_manager.cc b/chrome/browser/nearby_sharing/nearby_notification_manager.cc index baca16e..79d3c73 100644 --- a/chrome/browser/nearby_sharing/nearby_notification_manager.cc +++ b/chrome/browser/nearby_sharing/nearby_notification_manager.cc
@@ -6,6 +6,7 @@ #include "base/strings/strcat.h" #include "base/strings/utf_string_conversions.h" +#include "build/build_config.h" #include "chrome/app/vector_icons/vector_icons.h" #include "chrome/browser/nearby_sharing/nearby_sharing_service.h" #include "chrome/browser/notifications/notification_display_service.h" @@ -36,6 +37,14 @@ /*optional_fields=*/{}, /*delegate=*/nullptr); notification.set_vector_small_image(kNearbyShareIcon); + + // TODO(crbug.com/1102348): Also show settings for other platforms once there + // is a nearby settings page in Chrome browser. +#if defined(OS_CHROMEOS) + notification.set_settings_button_handler( + message_center::SettingsButtonHandler::DELEGATE); +#endif + return notification; } @@ -164,6 +173,31 @@ return gfx::Image(); } +class ProgressNotificationDelegate : public NearbyNotificationDelegate { + public: + explicit ProgressNotificationDelegate(NearbyNotificationManager* manager) + : manager_(manager) {} + ~ProgressNotificationDelegate() override = default; + + // NearbyNotificationDelegate: + void OnClick(const std::string& notification_id, + const base::Optional<int>& action_index) override { + // Clicking on the notification is a noop. + if (!action_index) + return; + // Clicking on the only (cancel) button cancels the transfer. + DCHECK_EQ(0, *action_index); + manager_->CancelTransfer(); + } + + void OnClose(const std::string& notification_id) override { + manager_->CancelTransfer(); + } + + private: + NearbyNotificationManager* manager_; +}; + } // namespace NearbyNotificationManager::NearbyNotificationManager( @@ -187,6 +221,10 @@ void NearbyNotificationManager::OnTransferUpdate( const ShareTarget& share_target, const TransferMetadata& transfer_metadata) { + if (!share_target_) + share_target_ = share_target; + DCHECK_EQ(share_target_->id, share_target.id); + switch (transfer_metadata.status()) { case TransferMetadata::Status::kInProgress: ShowProgress(share_target, transfer_metadata); @@ -217,6 +255,9 @@ ShowFailure(share_target); break; } + + if (transfer_metadata.is_final_status()) + share_target_.reset(); } void NearbyNotificationManager::OnShareTargetDiscovered( @@ -249,6 +290,9 @@ notification_actions.emplace_back(l10n_util::GetStringUTF16(IDS_APP_CANCEL)); notification.set_buttons(notification_actions); + delegate_map_[notification.id()] = + std::make_unique<ProgressNotificationDelegate>(this); + notification_display_service_->Display( NotificationHandler::Type::NEARBY_SHARE, notification, /*metadata=*/nullptr); @@ -278,6 +322,9 @@ l10n_util::GetStringUTF16(IDS_NEARBY_NOTIFICATION_DECLINE_ACTION)); notification.set_buttons(notification_actions); + // TODO(crbug.com/1102348): Handle ConnectionRequest actions. + delegate_map_.erase(kNearbyNotificationId); + notification_display_service_->Display( NotificationHandler::Type::NEARBY_SHARE, notification, /*metadata=*/nullptr); @@ -306,6 +353,7 @@ notification.set_title(GetSuccessNotificationTitle(share_target)); // TODO(crbug.com/1102348): Show content specific actions and preview images. + delegate_map_.erase(kNearbyNotificationId); notification_display_service_->Display( NotificationHandler::Type::NEARBY_SHARE, notification, @@ -319,12 +367,29 @@ CreateNearbyNotification(kNearbyNotificationId); notification.set_title(GetFailureNotificationTitle(share_target)); + delegate_map_.erase(kNearbyNotificationId); + notification_display_service_->Display( NotificationHandler::Type::NEARBY_SHARE, notification, /*metadata=*/nullptr); } void NearbyNotificationManager::CloseTransfer() { + delegate_map_.erase(kNearbyNotificationId); notification_display_service_->Close(NotificationHandler::Type::NEARBY_SHARE, kNearbyNotificationId); } + +NearbyNotificationDelegate* NearbyNotificationManager::GetNotificationDelegate( + const std::string& notification_id) { + auto iter = delegate_map_.find(notification_id); + if (iter == delegate_map_.end()) + return nullptr; + + return iter->second.get(); +} + +void NearbyNotificationManager::CancelTransfer() { + CloseTransfer(); + nearby_service_->Cancel(*share_target_, base::DoNothing()); +}
diff --git a/chrome/browser/nearby_sharing/nearby_notification_manager.h b/chrome/browser/nearby_sharing/nearby_notification_manager.h index adad78e..65b0f0b 100644 --- a/chrome/browser/nearby_sharing/nearby_notification_manager.h +++ b/chrome/browser/nearby_sharing/nearby_notification_manager.h
@@ -5,9 +5,11 @@ #ifndef CHROME_BROWSER_NEARBY_SHARING_NEARBY_NOTIFICATION_MANAGER_H_ #define CHROME_BROWSER_NEARBY_SHARING_NEARBY_NOTIFICATION_MANAGER_H_ +#include "base/containers/flat_map.h" #include "base/optional.h" #include "base/strings/string16.h" #include "base/time/time.h" +#include "chrome/browser/nearby_sharing/nearby_notification_delegate.h" #include "chrome/browser/nearby_sharing/share_target.h" #include "chrome/browser/nearby_sharing/share_target_discovered_callback.h" #include "chrome/browser/nearby_sharing/transfer_metadata.h" @@ -61,9 +63,23 @@ // connection). void CloseTransfer(); + // Gets the currently registered delegate for |notification_id|. + NearbyNotificationDelegate* GetNotificationDelegate( + const std::string& notification_id); + + // Cancels the currently in progress transfer. + void CancelTransfer(); + private: NotificationDisplayService* notification_display_service_; NearbySharingService* nearby_service_; + + // Maps notification ids to notification delegates. + base::flat_map<std::string, std::unique_ptr<NearbyNotificationDelegate>> + delegate_map_; + + // ShareTarget of the current transfer. + base::Optional<ShareTarget> share_target_; }; #endif // CHROME_BROWSER_NEARBY_SHARING_NEARBY_NOTIFICATION_MANAGER_H_
diff --git a/chrome/browser/nearby_sharing/nearby_notification_manager_unittest.cc b/chrome/browser/nearby_sharing/nearby_notification_manager_unittest.cc index 9011732..ec0b6670 100644 --- a/chrome/browser/nearby_sharing/nearby_notification_manager_unittest.cc +++ b/chrome/browser/nearby_sharing/nearby_notification_manager_unittest.cc
@@ -13,6 +13,7 @@ #include "chrome/app/vector_icons/vector_icons.h" #include "chrome/browser/browser_features.h" #include "chrome/browser/nearby_sharing/mock_nearby_sharing_service.h" +#include "chrome/browser/nearby_sharing/nearby_sharing_service_factory.h" #include "chrome/browser/nearby_sharing/share_target.h" #include "chrome/browser/nearby_sharing/transfer_metadata.h" #include "chrome/browser/nearby_sharing/transfer_metadata_builder.h" @@ -28,6 +29,10 @@ namespace { +MATCHER_P(MatchesTarget, target, "") { + return arg.id == target.id; +} + TextAttachment CreateTextAttachment(TextAttachment::Type type) { return TextAttachment("text body", type, /*size=*/9); } @@ -39,13 +44,32 @@ /*mime_type=*/"example"); } +std::unique_ptr<KeyedService> CreateMockNearbySharingService( + content::BrowserContext* browser_context) { + return std::make_unique<testing::NiceMock<MockNearbySharingService>>(); +} + +MockNearbySharingService* CreateAndUseMockNearbySharingService( + content::BrowserContext* browser_context) { + return static_cast<MockNearbySharingService*>( + NearbySharingServiceFactory::GetInstance()->SetTestingFactoryAndUse( + browser_context, + base::BindRepeating(&CreateMockNearbySharingService))); +} + class NearbyNotificationManagerTest : public testing::Test { public: NearbyNotificationManagerTest() { scoped_feature_list_.InitAndEnableFeature(features::kNearbySharing); notification_tester_ = std::make_unique<NotificationDisplayServiceTester>(&profile_); + nearby_service_ = CreateAndUseMockNearbySharingService(&profile_); manager_ = CreateManager(); + EXPECT_CALL(*nearby_service_, GetNotificationDelegate(testing::_)) + .WillRepeatedly( + testing::Invoke([&](const std::string& notification_id) { + return manager_->GetNotificationDelegate(notification_id); + })); } ~NearbyNotificationManagerTest() override = default; @@ -60,7 +84,7 @@ NotificationDisplayService* notification_display_service = NotificationDisplayServiceFactory::GetForProfile(&profile_); return std::make_unique<NearbyNotificationManager>( - notification_display_service, &nearby_service_); + notification_display_service, nearby_service_); } protected: @@ -68,7 +92,7 @@ content::BrowserTaskEnvironment task_environment_; TestingProfile profile_; std::unique_ptr<NotificationDisplayServiceTester> notification_tester_; - testing::NiceMock<MockNearbySharingService> nearby_service_; + MockNearbySharingService* nearby_service_; std::unique_ptr<NearbyNotificationManager> manager_; }; @@ -137,14 +161,14 @@ ShareTargetDiscoveredCallback* send_discovery_callback = nullptr; EXPECT_CALL( - nearby_service_, + *nearby_service_, RegisterReceiveSurface( testing::_, NearbySharingService::ReceiveSurfaceState::kBackground)) .WillOnce(testing::DoAll( testing::SaveArg<0>(&receive_transfer_callback), testing::Return(NearbySharingService::StatusCodes::kOk))); EXPECT_CALL( - nearby_service_, + *nearby_service_, RegisterSendSurface(testing::_, testing::_, NearbySharingService::SendSurfaceState::kBackground)) .WillOnce(testing::DoAll( @@ -159,8 +183,8 @@ } TEST_F(NearbyNotificationManagerTest, UnregistersSurfaces) { - EXPECT_CALL(nearby_service_, UnregisterReceiveSurface(manager())); - EXPECT_CALL(nearby_service_, UnregisterSendSurface(manager(), manager())); + EXPECT_CALL(*nearby_service_, UnregisterReceiveSurface(manager())); + EXPECT_CALL(*nearby_service_, UnregisterSendSurface(manager(), manager())); manager_.reset(); } @@ -515,3 +539,83 @@ manager()->CloseTransfer(); EXPECT_EQ(1u, GetDisplayedNotifications().size()); } + +TEST_F(NearbyNotificationManagerTest, ProgressNotification_Cancel) { + ShareTarget share_target; + share_target.is_incoming = true; + TransferMetadata transfer_metadata = + TransferMetadataBuilder() + .set_status(TransferMetadata::Status::kInProgress) + .build(); + + // Simulate incoming transfer progress. + manager()->OnTransferUpdate(share_target, transfer_metadata); + + // Expect a notification with a cancel button. + std::vector<message_center::Notification> notifications = + GetDisplayedNotifications(); + ASSERT_EQ(1u, notifications.size()); + ASSERT_EQ(1u, notifications[0].buttons().size()); + EXPECT_EQ(l10n_util::GetStringUTF16(IDS_APP_CANCEL), + notifications[0].buttons()[0].title); + + // Expect call to Cancel on button click. + EXPECT_CALL(*nearby_service_, + Cancel(MatchesTarget(share_target), testing::_)); + notification_tester_->SimulateClick(NotificationHandler::Type::NEARBY_SHARE, + notifications[0].id(), /*action_index=*/0, + /*reply=*/base::nullopt); + + // Notification should be closed on button click. + EXPECT_EQ(0u, GetDisplayedNotifications().size()); +} + +TEST_F(NearbyNotificationManagerTest, ProgressNotification_Close) { + ShareTarget share_target; + share_target.is_incoming = true; + TransferMetadata transfer_metadata = + TransferMetadataBuilder() + .set_status(TransferMetadata::Status::kInProgress) + .build(); + + // Simulate incoming transfer progress. + manager()->OnTransferUpdate(share_target, transfer_metadata); + std::vector<message_center::Notification> notifications = + GetDisplayedNotifications(); + ASSERT_EQ(1u, notifications.size()); + + // Expect call to Cancel on notification close. + EXPECT_CALL(*nearby_service_, + Cancel(MatchesTarget(share_target), testing::_)); + notification_tester_->RemoveNotification( + NotificationHandler::Type::NEARBY_SHARE, notifications[0].id(), + /*by_user=*/true); + + // Notification should be closed. + EXPECT_EQ(0u, GetDisplayedNotifications().size()); +} + +TEST_F(NearbyNotificationManagerTest, ProgressNotification_Cancelled) { + ShareTarget share_target; + share_target.is_incoming = true; + TransferMetadata transfer_metadata = + TransferMetadataBuilder() + .set_status(TransferMetadata::Status::kInProgress) + .build(); + + // Simulate incoming transfer progress. + manager()->OnTransferUpdate(share_target, transfer_metadata); + std::vector<message_center::Notification> notifications = + GetDisplayedNotifications(); + ASSERT_EQ(1u, notifications.size()); + + // Simulate cancelled transfer. + manager()->OnTransferUpdate( + share_target, TransferMetadataBuilder() + .set_status(TransferMetadata::Status::kCancelled) + .set_is_final_status(true) + .build()); + + // Notification should be closed. + EXPECT_EQ(0u, GetDisplayedNotifications().size()); +}
diff --git a/chrome/browser/nearby_sharing/nearby_sharing_service.h b/chrome/browser/nearby_sharing/nearby_sharing_service.h index a83f3d4..97abce2 100644 --- a/chrome/browser/nearby_sharing/nearby_sharing_service.h +++ b/chrome/browser/nearby_sharing/nearby_sharing_service.h
@@ -14,6 +14,7 @@ #include "chrome/browser/nearby_sharing/share_target_discovered_callback.h" #include "chrome/browser/nearby_sharing/transfer_update_callback.h" +class NearbyNotificationDelegate; class NearbyShareContactManager; class NearbyShareCertificateManager; class NearbyShareHttpNotifier; @@ -101,6 +102,10 @@ virtual void Open(const ShareTarget& share_target, StatusCodesCallback status_codes_callback) = 0; + // Gets a delegate to handle events for |notification_id| or nullptr. + virtual NearbyNotificationDelegate* GetNotificationDelegate( + const std::string& notification_id) = 0; + virtual NearbyShareSettings* GetSettings() = 0; virtual NearbyShareHttpNotifier* GetHttpNotifier() = 0; virtual NearbyShareLocalDeviceDataManager* GetLocalDeviceDataManager() = 0;
diff --git a/chrome/browser/nearby_sharing/nearby_sharing_service_impl.cc b/chrome/browser/nearby_sharing/nearby_sharing_service_impl.cc index 6f16066c..4f88f9d 100644 --- a/chrome/browser/nearby_sharing/nearby_sharing_service_impl.cc +++ b/chrome/browser/nearby_sharing/nearby_sharing_service_impl.cc
@@ -312,6 +312,11 @@ std::move(status_codes_callback).Run(StatusCodes::kOk); } +NearbyNotificationDelegate* NearbySharingServiceImpl::GetNotificationDelegate( + const std::string& notification_id) { + return nearby_notification_manager_->GetNotificationDelegate(notification_id); +} + NearbyShareSettings* NearbySharingServiceImpl::GetSettings() { return &settings_; } @@ -713,7 +718,7 @@ std::vector<uint8_t> data(frame.ByteSize()); frame.SerializeToArray(data.data(), frame.ByteSize()); - connection.Write(std::move(data), base::DoNothing()); + connection.Write(std::move(data)); } void NearbySharingServiceImpl::Fail(const ShareTarget& share_target,
diff --git a/chrome/browser/nearby_sharing/nearby_sharing_service_impl.h b/chrome/browser/nearby_sharing/nearby_sharing_service_impl.h index e92b602..bf5aa3a 100644 --- a/chrome/browser/nearby_sharing/nearby_sharing_service_impl.h +++ b/chrome/browser/nearby_sharing/nearby_sharing_service_impl.h
@@ -90,6 +90,8 @@ StatusCodesCallback status_codes_callback) override; void Open(const ShareTarget& share_target, StatusCodesCallback status_codes_callback) override; + NearbyNotificationDelegate* GetNotificationDelegate( + const std::string& notification_id) override; NearbyShareSettings* GetSettings() override; // nearby_share::mojom::NearbyShareSettingsObserver:
diff --git a/chrome/browser/nearby_sharing/transfer_metadata_builder.cc b/chrome/browser/nearby_sharing/transfer_metadata_builder.cc index 9ad2bf104..4b457f5c 100644 --- a/chrome/browser/nearby_sharing/transfer_metadata_builder.cc +++ b/chrome/browser/nearby_sharing/transfer_metadata_builder.cc
@@ -8,6 +8,12 @@ TransferMetadataBuilder::~TransferMetadataBuilder() = default; +TransferMetadataBuilder& TransferMetadataBuilder::set_is_final_status( + bool is_final_status) { + is_final_status_ = is_final_status; + return *this; +} + TransferMetadataBuilder& TransferMetadataBuilder::set_progress( double progress) { progress_ = progress; @@ -28,6 +34,5 @@ TransferMetadata TransferMetadataBuilder::build() const { return TransferMetadata(status_, progress_, token_, - /*is_original=*/false, - /*is_final_status=*/false); + /*is_original=*/false, is_final_status_); }
diff --git a/chrome/browser/nearby_sharing/transfer_metadata_builder.h b/chrome/browser/nearby_sharing/transfer_metadata_builder.h index 7a5c4991..413efd4b6 100644 --- a/chrome/browser/nearby_sharing/transfer_metadata_builder.h +++ b/chrome/browser/nearby_sharing/transfer_metadata_builder.h
@@ -15,6 +15,8 @@ TransferMetadataBuilder(); ~TransferMetadataBuilder(); + TransferMetadataBuilder& set_is_final_status(bool is_final_status); + TransferMetadataBuilder& set_progress(double progress); TransferMetadataBuilder& set_status(TransferMetadata::Status status); @@ -24,6 +26,7 @@ TransferMetadata build() const; private: + bool is_final_status_ = false; double progress_ = 0; TransferMetadata::Status status_ = TransferMetadata::Status::kInProgress; base::Optional<std::string> token_;
diff --git a/chrome/browser/optimization_guide/hints_fetcher_browsertest.cc b/chrome/browser/optimization_guide/hints_fetcher_browsertest.cc index a1c42c75..76ae61a 100644 --- a/chrome/browser/optimization_guide/hints_fetcher_browsertest.cc +++ b/chrome/browser/optimization_guide/hints_fetcher_browsertest.cc
@@ -91,20 +91,6 @@ } } -int GetCountBucketSamples(const base::HistogramTester* histogram_tester, - const std::string& histogram_name, - size_t bucket_min) { - std::vector<base::Bucket> buckets = - histogram_tester->GetAllSamples(histogram_name); - - for (const auto& bucket : buckets) { - if (bucket_min == static_cast<size_t>(bucket.min)) - return bucket.count; - } - - return 0; -} - enum class HintsFetcherRemoteResponseType { kSuccessful = 0, kUnsuccessful = 1, @@ -665,20 +651,10 @@ ui_test_utils::NavigateToURL(browser(), https_url()); - // Verifies that the fetched hint is loaded and not the component hint as - // fetched hints are prioritized. - - histogram_tester->ExpectBucketCount( - "OptimizationGuide.HintCache.HintType.Loaded", - static_cast<int>(optimization_guide::OptimizationGuideStore:: - StoreEntryType::kFetchedHint), - 1); - - histogram_tester->ExpectBucketCount( - "OptimizationGuide.HintCache.HintType.Loaded", - static_cast<int>(optimization_guide::OptimizationGuideStore:: - StoreEntryType::kComponentHint), - 0); + // Verifies that the fetched hint is just used in memory and nothing is + // loaded. + histogram_tester->ExpectTotalCount( + "OptimizationGuide.HintCache.HintType.Loaded", 0); } IN_PROC_BROWSER_TEST_F( @@ -782,16 +758,11 @@ // Verifies that no Fetched Hint was added to the store, only the // Component hint is loaded. - histogram_tester->ExpectBucketCount( + histogram_tester->ExpectUniqueSample( "OptimizationGuide.HintCache.HintType.Loaded", static_cast<int>(optimization_guide::OptimizationGuideStore:: StoreEntryType::kComponentHint), 1); - histogram_tester->ExpectBucketCount( - "OptimizationGuide.HintCache.HintType.Loaded", - static_cast<int>(optimization_guide::OptimizationGuideStore:: - StoreEntryType::kFetchedHint), - 0); } IN_PROC_BROWSER_TEST_F( @@ -869,19 +840,10 @@ ui_test_utils::NavigateToURL(browser(), https_url()); - // Verifies that the fetched hint is loaded and not the component hint as - // fetched hints are prioritized. - EXPECT_LE(1, - GetCountBucketSamples( - histogram_tester, "OptimizationGuide.HintCache.HintType.Loaded", - static_cast<int>(optimization_guide::OptimizationGuideStore:: - StoreEntryType::kFetchedHint))); - - EXPECT_EQ(0, - GetCountBucketSamples( - histogram_tester, "OptimizationGuide.HintCache.HintType.Loaded", - static_cast<int>(optimization_guide::OptimizationGuideStore:: - StoreEntryType::kComponentHint))); + // Verifies that the fetched hint is used in-memory and no hint is loaded + // from store. + histogram_tester->ExpectTotalCount( + "OptimizationGuide.HintCache.HintType.Loaded", 0); // Wipe the browser history - clear all the fetched hints. browser()->profile()->Wipe(); @@ -891,18 +853,11 @@ ui_test_utils::NavigateToURL(browser(), https_url()); - // Fetched Hints count should not change. - EXPECT_LE(1, - GetCountBucketSamples( - histogram_tester, "OptimizationGuide.HintCache.HintType.Loaded", - static_cast<int>(optimization_guide::OptimizationGuideStore:: - StoreEntryType::kFetchedHint))); - - EXPECT_LE(0, - GetCountBucketSamples( - histogram_tester, "OptimizationGuide.HintCache.HintType.Loaded", - static_cast<int>(optimization_guide::OptimizationGuideStore:: - StoreEntryType::kComponentHint))); + histogram_tester->ExpectUniqueSample( + "OptimizationGuide.HintCache.HintType.Loaded", + static_cast<int>(optimization_guide::OptimizationGuideStore:: + StoreEntryType::kComponentHint), + 1); } IN_PROC_BROWSER_TEST_F(HintsFetcherBrowserTest, @@ -947,19 +902,9 @@ ui_test_utils::NavigateToURL(browser(), https_url()); - // Verifies that the fetched hint is loaded and not the component hint as - // fetched hints are prioritized. - histogram_tester->ExpectBucketCount( - "OptimizationGuide.HintCache.HintType.Loaded", - static_cast<int>(optimization_guide::OptimizationGuideStore:: - StoreEntryType::kFetchedHint), - 1); - - histogram_tester->ExpectBucketCount( - "OptimizationGuide.HintCache.HintType.Loaded", - static_cast<int>(optimization_guide::OptimizationGuideStore:: - StoreEntryType::kComponentHint), - 0); + // Verifies that the fetched hint is used from memory and no hints are loaded. + histogram_tester->ExpectTotalCount( + "OptimizationGuide.HintCache.HintType.Loaded", 0); } IN_PROC_BROWSER_TEST_F( @@ -1302,7 +1247,7 @@ EXPECT_EQ(2u, count_hints_requests_received()); RetryForHistogramUntilCountReached( histogram_tester, optimization_guide::kLoadedHintLocalHistogramString, - 2); + 1); histogram_tester->ExpectUniqueSample( "OptimizationGuide.HintsManager.RaceNavigationFetchAttemptStatus", optimization_guide::RaceNavigationFetchAttemptStatus:: @@ -1388,7 +1333,7 @@ EXPECT_EQ(2u, count_hints_requests_received()); RetryForHistogramUntilCountReached( histogram_tester, optimization_guide::kLoadedHintLocalHistogramString, - 2); + 1); histogram_tester->ExpectUniqueSample( "OptimizationGuide.HintsManager.RaceNavigationFetchAttemptStatus", optimization_guide::RaceNavigationFetchAttemptStatus:: @@ -1482,7 +1427,7 @@ EXPECT_EQ(2u, count_hints_requests_received()); RetryForHistogramUntilCountReached( histogram_tester, optimization_guide::kLoadedHintLocalHistogramString, - 2); + 1); histogram_tester->ExpectUniqueSample( "OptimizationGuide.HintsManager.RaceNavigationFetchAttemptStatus", optimization_guide::RaceNavigationFetchAttemptStatus::
diff --git a/chrome/browser/optimization_guide/optimization_guide_hints_manager.cc b/chrome/browser/optimization_guide/optimization_guide_hints_manager.cc index e1a5dcb1..7493218 100644 --- a/chrome/browser/optimization_guide/optimization_guide_hints_manager.cc +++ b/chrome/browser/optimization_guide/optimization_guide_hints_manager.cc
@@ -622,17 +622,20 @@ batch_update_hints_fetcher_->FetchOptimizationGuideServiceHints( top_hosts, std::vector<GURL>{}, registered_optimization_types_, optimization_guide::proto::CONTEXT_BATCH_UPDATE, - base::BindOnce(&OptimizationGuideHintsManager::OnTopHostsHintsFetched, - ui_weak_ptr_factory_.GetWeakPtr())); + base::BindOnce( + &OptimizationGuideHintsManager::OnTopHostsHintsFetched, + ui_weak_ptr_factory_.GetWeakPtr(), + base::flat_set<std::string>(top_hosts.begin(), top_hosts.end()))); } void OptimizationGuideHintsManager::OnTopHostsHintsFetched( + const base::flat_set<std::string>& hosts_fetched, base::Optional<std::unique_ptr<optimization_guide::proto::GetHintsResponse>> get_hints_response) { if (get_hints_response) { hint_cache_->UpdateFetchedHints( std::move(*get_hints_response), - clock_->Now() + kUpdateFetchedHintsDelay, + clock_->Now() + kUpdateFetchedHintsDelay, hosts_fetched, /*urls_fetched=*/{}, base::BindOnce( &OptimizationGuideHintsManager::OnFetchedTopHostsHintsStored, @@ -665,7 +668,7 @@ hint_cache_->UpdateFetchedHints( std::move(*get_hints_response), clock_->Now() + kUpdateFetchedHintsDelay, - page_navigation_urls_requested, + page_navigation_hosts_requested, page_navigation_urls_requested, base::BindOnce( &OptimizationGuideHintsManager::OnFetchedPageNavigationHintsStored, ui_weak_ptr_factory_.GetWeakPtr(), navigation_data_weak_ptr, @@ -698,9 +701,6 @@ CleanUpFetcherForNavigation(*navigation_url); PrepareToInvokeRegisteredCallbacks(*navigation_url); } - - for (const auto& host : page_navigation_hosts_requested) - LoadHintForHost(host, base::DoNothing()); } bool OptimizationGuideHintsManager::IsHintBeingFetchedForNavigation( @@ -853,9 +853,6 @@ &OptimizationGuideHintsManager::OnPageNavigationHintsFetched, ui_weak_ptr_factory_.GetWeakPtr(), nullptr, base::nullopt, target_urls, target_hosts)); - - for (const auto& host : target_hosts) - LoadHintForHost(host, base::DoNothing()); } void OptimizationGuideHintsManager::OnHintLoaded(
diff --git a/chrome/browser/optimization_guide/optimization_guide_hints_manager.h b/chrome/browser/optimization_guide/optimization_guide_hints_manager.h index d63c739..dc21fca 100644 --- a/chrome/browser/optimization_guide/optimization_guide_hints_manager.h +++ b/chrome/browser/optimization_guide/optimization_guide_hints_manager.h
@@ -269,6 +269,7 @@ // Optimization Guide Service and are ready for parsing. This is used when // fetching hints in batch mode. void OnTopHostsHintsFetched( + const base::flat_set<std::string>& hosts_fetched, base::Optional< std::unique_ptr<optimization_guide::proto::GetHintsResponse>> get_hints_response);
diff --git a/chrome/browser/profiles/android/java/src/org/chromium/chrome/browser/profiles/Profile.java b/chrome/browser/profiles/android/java/src/org/chromium/chrome/browser/profiles/Profile.java index 9148a66..0d42743 100644 --- a/chrome/browser/profiles/android/java/src/org/chromium/chrome/browser/profiles/Profile.java +++ b/chrome/browser/profiles/android/java/src/org/chromium/chrome/browser/profiles/Profile.java
@@ -7,6 +7,7 @@ import androidx.annotation.Nullable; import androidx.annotation.VisibleForTesting; +import org.chromium.base.ThreadUtils; import org.chromium.base.annotations.CalledByNative; import org.chromium.base.annotations.CheckDiscard; import org.chromium.base.annotations.NativeMethods; @@ -46,7 +47,7 @@ if (sLastUsedProfileForTesting != null) { return sLastUsedProfileForTesting; } - + assert ThreadUtils.runningOnUiThread(); // TODO(crbug.com/704025): turn this into an assert once the bug is fixed if (!ProfileManager.isInitialized()) { throw new IllegalStateException("Browser hasn't finished initialization yet!");
diff --git a/chrome/browser/resources/chromeos/accessibility/chromevox/background/desktop_automation_handler.js b/chrome/browser/resources/chromeos/accessibility/chromevox/background/desktop_automation_handler.js index a0726870..938dd4d 100644 --- a/chrome/browser/resources/chromeos/accessibility/chromevox/background/desktop_automation_handler.js +++ b/chrome/browser/resources/chromeos/accessibility/chromevox/background/desktop_automation_handler.js
@@ -423,7 +423,6 @@ this.lastValueChanged_ = new Date(); const output = new Output(); - output.withQueueMode(QueueMode.CATEGORY_FLUSH); if (fromDesktop && (!this.lastValueTarget_ || this.lastValueTarget_ !== t)) { @@ -435,6 +434,8 @@ output.format( '$if($value, $value, $if($valueForRange, $valueForRange))', t); } + + Output.forceModeForNextSpeechUtterance(QueueMode.INTERJECT); output.go(); } }
diff --git a/chrome/browser/resources/chromeos/accessibility/chromevox/background/logging/log_types.js b/chrome/browser/resources/chromeos/accessibility/chromevox/background/logging/log_types.js index 6297ead5..6db0879 100644 --- a/chrome/browser/resources/chromeos/accessibility/chromevox/background/logging/log_types.js +++ b/chrome/browser/resources/chromeos/accessibility/chromevox/background/logging/log_types.js
@@ -106,9 +106,11 @@ toString() { let logStr = 'Speak'; if (this.queueMode_ == QueueMode.FLUSH) { - logStr += ' (I)'; + logStr += ' (F)'; } else if (this.queueMode_ == QueueMode.CATEGORY_FLUSH) { logStr += ' (C)'; + } else if (this.queueMode_ == QueueMode.INTERJECT) { + logStr += ' (I)'; } else { logStr += ' (Q)'; }
diff --git a/chrome/browser/resources/chromeos/accessibility/chromevox/background/output.js b/chrome/browser/resources/chromeos/accessibility/chromevox/background/output.js index a939a08..15ead75 100644 --- a/chrome/browser/resources/chromeos/accessibility/chromevox/background/output.js +++ b/chrome/browser/resources/chromeos/accessibility/chromevox/background/output.js
@@ -126,12 +126,10 @@ * @param {QueueMode|undefined} mode */ static forceModeForNextSpeechUtterance(mode) { - // If previous calls to force the mode went unprocessed, try to honor the - // first caller's setting which is generally set by key and gesture events - // rather than automation events. Make an exception when a caller explicitly - // clears the mode .e.g in editing. if (Output.forceModeForNextSpeechUtterance_ === undefined || - mode === undefined) { + mode === undefined || + // Only allow setting to higher queue modes. + mode < Output.forceModeForNextSpeechUtterance_) { Output.forceModeForNextSpeechUtterance_ = mode; } }
diff --git a/chrome/browser/resources/chromeos/accessibility/chromevox/common/tts_background.js b/chrome/browser/resources/chromeos/accessibility/chromevox/common/tts_background.js index 6860d465..3ddc796 100644 --- a/chrome/browser/resources/chromeos/accessibility/chromevox/common/tts_background.js +++ b/chrome/browser/resources/chromeos/accessibility/chromevox/common/tts_background.js
@@ -24,9 +24,10 @@ * @param {string} textString The string of text to be spoken. * @param {Object} properties Speech properties to use for this utterance. */ - constructor(textString, properties) { + constructor(textString, properties, queueMode) { this.textString = textString; this.properties = properties; + this.queueMode = queueMode; this.id = Utterance.nextUtteranceId_++; } }; @@ -118,12 +119,17 @@ /** * The utterance queue. - * @type {Array<Utterance>} - * @private + * @private {!Array<Utterance>} */ this.utteranceQueue_ = []; /** + * Queue of utterances interrupted by interjected utterances. + * @private {!Array<Utterance>} + */ + this.utteranceQueueInterruptedByInterjection_ = []; + + /** * The current voice name. * @type {string} */ @@ -243,14 +249,19 @@ queueMode = QueueMode.FLUSH; } - const utterance = new Utterance(textString, mergedProperties); - this.speakUsingQueue_(utterance, queueMode); + const utterance = new Utterance(textString, mergedProperties, queueMode); + this.speakUsingQueue_(utterance); // Attempt to queue phonetic speech with property['delay']. This ensures // that phonetic hints are delayed when we process them. this.pronouncePhonetically_(originalTextString, properties); return this; } + /** @return {!Array<Utterance>} */ + getUtteranceQueueForTest() { + return this.utteranceQueue_; + } + /** * Split the given textString into smaller chunks and call this.speak() for * each chunks. @@ -311,17 +322,19 @@ /** * Use the speech queue to handle the given speech request. * @param {Utterance} utterance The utterance to speak. - * @param {QueueMode} queueMode The queue mode. * @private */ - speakUsingQueue_(utterance, queueMode) { + speakUsingQueue_(utterance) { + const queueMode = utterance.queueMode; + // First, take care of removing the current utterance and flushing // anything from the queue we need to. If we remove the current utterance, // make a note that we're going to stop speech. - if (queueMode == QueueMode.FLUSH || queueMode == QueueMode.CATEGORY_FLUSH) { + if (queueMode == QueueMode.FLUSH || queueMode == QueueMode.CATEGORY_FLUSH || + queueMode == QueueMode.INTERJECT) { (new PanelCommand(PanelCommandType.CLEAR_SPEECH)).send(); - if (this.shouldCancel_(this.currentUtterance_, utterance, queueMode)) { + if (this.shouldCancel_(this.currentUtterance_, utterance)) { // Clear timeout in case currentUtterance_ is a delayed utterance. this.clearTimeout_(); this.cancelUtterance_(this.currentUtterance_); @@ -329,7 +342,7 @@ } let i = 0; while (i < this.utteranceQueue_.length) { - if (this.shouldCancel_(this.utteranceQueue_[i], utterance, queueMode)) { + if (this.shouldCancel_(this.utteranceQueue_[i], utterance)) { this.cancelUtterance_(this.utteranceQueue_[i]); this.utteranceQueue_.splice(i, 1); } else { @@ -338,8 +351,36 @@ } } - // Next, add the new utterance to the queue. - this.utteranceQueue_.push(utterance); + // Now, some special handling for interjections. + if (queueMode == QueueMode.INTERJECT) { + // Move all utterances to a secondary queue to be restored later. + this.utteranceQueueInterruptedByInterjection_ = this.utteranceQueue_; + + // The interjection is the only utterance. + this.utteranceQueue_ = [utterance]; + + // Ensure to clear the current utterance and prepend it for it to repeat + // later. + if (this.currentUtterance_) { + this.utteranceQueueInterruptedByInterjection_.unshift( + this.currentUtterance_); + this.currentUtterance_ = null; + } + + // Restore the interrupted utterances after allowing all other utterances + // in this callstack to process. + setTimeout(() => { + // Utterances on the current queue are now also interjections. + for (let i = 0; i < this.utteranceQueue_.length; i++) { + this.utteranceQueue_[i].queueMode = QueueMode.INTERJECT; + } + this.utteranceQueue_ = this.utteranceQueue_.concat( + this.utteranceQueueInterruptedByInterjection_); + }, 0); + } else { + // Next, add the new utterance to the queue. + this.utteranceQueue_.push(utterance); + } // Now start speaking the next item in the queue. this.startSpeakingNextItemInQueue_(); @@ -485,20 +526,21 @@ * * @param {Utterance} utteranceToCancel The utterance in question. * @param {Utterance} newUtterance The new utterance we're enqueueing. - * @param {QueueMode} queueMode The queue mode. * @return {boolean} True if this utterance should be canceled. * @private */ - shouldCancel_(utteranceToCancel, newUtterance, queueMode) { + shouldCancel_(utteranceToCancel, newUtterance) { if (!utteranceToCancel) { return false; } if (utteranceToCancel.properties['doNotInterrupt']) { return false; } - switch (queueMode) { + switch (newUtterance.queueMode) { case QueueMode.QUEUE: return false; + case QueueMode.INTERJECT: + return utteranceToCancel.queueMode == QueueMode.INTERJECT; case QueueMode.FLUSH: return true; case QueueMode.CATEGORY_FLUSH: @@ -563,7 +605,13 @@ this.cancelUtterance_(this.utteranceQueue_[i]); } + for (let i = 0; i < this.utteranceQueueInterruptedByInterjection_.length; + i++) { + this.cancelUtterance_(this.utteranceQueueInterruptedByInterjection_[i]); + } + this.utteranceQueue_.length = 0; + this.utteranceQueueInterruptedByInterjection_.length = 0; (new PanelCommand(PanelCommandType.CLEAR_SPEECH)).send(); chrome.tts.stop();
diff --git a/chrome/browser/resources/chromeos/accessibility/chromevox/common/tts_background_test.js b/chrome/browser/resources/chromeos/accessibility/chromevox/common/tts_background_test.js index f29f113e..a87d98f 100644 --- a/chrome/browser/resources/chromeos/accessibility/chromevox/common/tts_background_test.js +++ b/chrome/browser/resources/chromeos/accessibility/chromevox/common/tts_background_test.js
@@ -10,11 +10,24 @@ /** * Test fixture. */ -ChromeVoxTtsBackgroundTest = class extends ChromeVoxE2ETest {}; +ChromeVoxTtsBackgroundTest = class extends ChromeVoxE2ETest { + /** @override */ + setUp() { + window.tts = new TtsBackground(); + } + expectUtteranceQueueIsLike(expectedObjects) { + const queue = tts.getUtteranceQueueForTest(); + assertEquals(expectedObjects.length, queue.length); + for (let i = 0; i < expectedObjects.length; i++) { + for (const key in expectedObjects[i]) { + assertEquals(expectedObjects[i][key], queue[i][key]); + } + } + } +}; SYNC_TEST_F('ChromeVoxTtsBackgroundTest', 'Preprocess', function() { - const tts = new TtsBackground(false); const preprocess = tts.preprocess.bind(tts); // Punctuation. @@ -47,7 +60,6 @@ }); TEST_F('ChromeVoxTtsBackgroundTest', 'UpdateVoice', function() { - const tts = new TtsBackground(false); const voices = [ {lang: 'zh-CN', voiceName: 'Chinese'}, {lang: 'zh-TW', voiceName: 'Chinese (Taiwan)'}, @@ -109,7 +121,6 @@ TEST_F( 'ChromeVoxTtsBackgroundTest', 'DISABLED_EmptyStringCallsCallbacks', function() { - const tts = new TtsBackground(false); let startCalls = 0, endCalls = 0; assertCallsCallbacks = function(text, speakCalls) { tts.speak(text, QueueMode.QUEUE, { @@ -132,7 +143,6 @@ SYNC_TEST_F( 'ChromeVoxTtsBackgroundTest', 'CapitalizeSingleLettersAfterNumbers', function() { - const tts = new TtsBackground(false); const preprocess = tts.preprocess.bind(tts); // Capitalize single letters if they appear directly after a number. @@ -149,7 +159,6 @@ }); SYNC_TEST_F('ChromeVoxTtsBackgroundTest', 'AnnounceCapitalLetters', function() { - const tts = new TtsBackground(false); const preprocess = tts.preprocess.bind(tts); assertEquals('A', preprocess('A')); @@ -165,7 +174,6 @@ }); SYNC_TEST_F('ChromeVoxTtsBackgroundTest', 'NumberReadingStyle', function() { - const tts = new TtsBackground(); let lastSpokenTextString = ''; tts.speakUsingQueue_ = function(utterance, _) { lastSpokenTextString = utterance.textString; @@ -191,7 +199,6 @@ }); SYNC_TEST_F('ChromeVoxTtsBackgroundTest', 'SplitLongText', function() { - const tts = new TtsBackground(); const spokenTextStrings = []; tts.speakUsingQueue_ = function(utterance, _) { spokenTextStrings.push(utterance.textString); @@ -248,7 +255,6 @@ }); SYNC_TEST_F('ChromeVoxTtsBackgroundTest', 'Phonetics', function() { - const tts = new TtsBackground(false); let spokenStrings = []; tts.speakUsingQueue_ = (utterance, ...rest) => { spokenStrings.push(utterance.textString); @@ -291,7 +297,6 @@ }); SYNC_TEST_F('ChromeVoxTtsBackgroundTest', 'PitchChanges', function() { - const tts = new TtsBackground(false); const preprocess = tts.preprocess.bind(tts); const props = {relativePitch: -0.3}; localStorage['usePitchChanges'] = 'true'; @@ -300,4 +305,102 @@ localStorage['usePitchChanges'] = 'false'; preprocess('Hello world', props); assertFalse(props.hasOwnProperty('relativePitch')); -}); \ No newline at end of file +}); + +SYNC_TEST_F('ChromeVoxTtsBackgroundTest', 'InterjectUtterances', function() { + // Fake out setTimeout for our purposes. + let lastSetTimeoutCallback; + window.setTimeout = (callback, delay) => { + lastSetTimeoutCallback = callback; + }; + + // Mock out to not trigger any events. + chrome.tts.speak = () => {}; + + // Flush and queue a few utterances to build the speech queue. + tts.speak('Hi', QueueMode.FLUSH, {}); + tts.speak('there.', QueueMode.QUEUE, {}); + tts.speak('How are you?', QueueMode.QUEUE, {}); + + // Verify the contents of the speech queue at this point. + this.expectUtteranceQueueIsLike([ + {textString: 'Hi', queueMode: QueueMode.FLUSH}, + {textString: 'there.', queueMode: QueueMode.QUEUE}, + {textString: 'How are you?', queueMode: QueueMode.QUEUE} + ]); + + // Interject a single utterance now. + tts.speak('Sorry; busy!', QueueMode.INTERJECT, {}); + this.expectUtteranceQueueIsLike( + [{textString: 'Sorry; busy!', queueMode: QueueMode.INTERJECT}]); + + // The above call should have resulted in a setTimeout; call it. + assertTrue(!!lastSetTimeoutCallback); + lastSetTimeoutCallback(); + lastSetTimeoutCallback = undefined; + + // The previous utterances should now be restored. + this.expectUtteranceQueueIsLike([ + {textString: 'Sorry; busy!', queueMode: QueueMode.INTERJECT}, + {textString: 'Hi', queueMode: QueueMode.FLUSH}, + {textString: 'there.', queueMode: QueueMode.QUEUE}, + {textString: 'How are you?', queueMode: QueueMode.QUEUE} + ]); + + // Try interjecting again. Notice it interrupts the previous interjection. + tts.speak('Actually, not busy after all!', QueueMode.INTERJECT, {}); + this.expectUtteranceQueueIsLike([{ + textString: 'Actually, not busy after all!', + queueMode: QueueMode.INTERJECT + }]); + + // Before the end of the current callstack, simulated by calling the callback + // to setTimeout, we can keep calling speak. These are also interjections (see + // below). + tts.speak('I am good.', QueueMode.QUEUE, {}); + tts.speak('How about you?', QueueMode.QUEUE, {}); + this.expectUtteranceQueueIsLike([ + { + textString: 'Actually, not busy after all!', + queueMode: QueueMode.INTERJECT + }, + {textString: 'I am good.', queueMode: QueueMode.QUEUE}, + {textString: 'How about you?', queueMode: QueueMode.QUEUE} + ]); + + // The above call should have resulted in a setTimeout; call it. + assertTrue(!!lastSetTimeoutCallback); + lastSetTimeoutCallback(); + lastSetTimeoutCallback = undefined; + + // The previous utterances should now be restored. + this.expectUtteranceQueueIsLike([ + { + textString: 'Actually, not busy after all!', + queueMode: QueueMode.INTERJECT + }, + {textString: 'I am good.', queueMode: QueueMode.INTERJECT}, + {textString: 'How about you?', queueMode: QueueMode.INTERJECT}, + {textString: 'Hi', queueMode: QueueMode.FLUSH}, + {textString: 'there.', queueMode: QueueMode.QUEUE}, + {textString: 'How are you?', queueMode: QueueMode.QUEUE} + ]); + + // Interject again. Notice all previous interjections get cancelled again. + // This is crucial to not leak utterances out of the chaining that some + // modules like Output do. + tts.speak('Sorry! Gotta go!', QueueMode.INTERJECT, {}); + this.expectUtteranceQueueIsLike( + [{textString: 'Sorry! Gotta go!', queueMode: QueueMode.INTERJECT}]); + assertTrue(!!lastSetTimeoutCallback); + lastSetTimeoutCallback(); + lastSetTimeoutCallback = undefined; + + // All other interjections except the last one are gone. + this.expectUtteranceQueueIsLike([ + {textString: 'Sorry! Gotta go!', queueMode: QueueMode.INTERJECT}, + {textString: 'Hi', queueMode: QueueMode.FLUSH}, + {textString: 'there.', queueMode: QueueMode.QUEUE}, + {textString: 'How are you?', queueMode: QueueMode.QUEUE} + ]); +});
diff --git a/chrome/browser/resources/chromeos/accessibility/chromevox/common/tts_interface.js b/chrome/browser/resources/chromeos/accessibility/chromevox/common/tts_interface.js index 0e131b95..54a1ad1 100644 --- a/chrome/browser/resources/chromeos/accessibility/chromevox/common/tts_interface.js +++ b/chrome/browser/resources/chromeos/accessibility/chromevox/common/tts_interface.js
@@ -30,21 +30,28 @@ }; /** - * Queue modes for calls to {@code TtsInterface.speak}. + * Queue modes for calls to {@code TtsInterface.speak}. The modes are listed in + * descending order of priority. * @enum */ QueueMode = { - /** Stop speech, clear everything, then speak this utterance. */ - FLUSH: 0, + /** + Prepend the current utterance (if any) to the queue, stop speech, and + speak this utterance. + */ + INTERJECT: 0, - /** Append this utterance to the end of the queue. */ - QUEUE: 1, + /** Stop speech, clear everything, then speak this utterance. */ + FLUSH: 1, /** * Clear any utterances of the same category (as set by * properties['category']) from the queue, then enqueue this utterance. */ - CATEGORY_FLUSH: 2 + CATEGORY_FLUSH: 2, + + /** Append this utterance to the end of the queue. */ + QUEUE: 3 }; /**
diff --git a/chrome/browser/resources/new_tab_page/customize_dialog.html b/chrome/browser/resources/new_tab_page/customize_dialog.html index 231ac1f6..5f00b41 100644 --- a/chrome/browser/resources/new_tab_page/customize_dialog.html +++ b/chrome/browser/resources/new_tab_page/customize_dialog.html
@@ -18,7 +18,8 @@ color: var(--ntp-primary-text-color); display: flex; flex-direction: row; - height: 58px; + height: 64px; + margin-top: 16px; padding: 0; }
diff --git a/chrome/browser/resources/settings/chromeos/os_settings.js b/chrome/browser/resources/settings/chromeos/os_settings.js index b054dcd..c4d69e53 100644 --- a/chrome/browser/resources/settings/chromeos/os_settings.js +++ b/chrome/browser/resources/settings/chromeos/os_settings.js
@@ -20,6 +20,7 @@ import './os_people_page/os_people_page.m.js'; export {LifetimeBrowserProxy, LifetimeBrowserProxyImpl} from '../lifetime_browser_proxy.m.js'; +export {dataUsageStringToEnum, NearbyShareDataUsage} from '../nearby_share_page/types.m.js'; export {AccountManagerBrowserProxy, AccountManagerBrowserProxyImpl} from '../people_page/account_manager_browser_proxy.m.js'; export {ParentalControlsBrowserProxyImpl, ParentalControlsBrowserProxy} from './parental_controls_page/parental_controls_browser_proxy.m.js'; export {CrSettingsPrefs} from '../prefs/prefs_types.m.js';
diff --git a/chrome/browser/resources/settings/chromeos/os_settings_resources_v3.grdp b/chrome/browser/resources/settings/chromeos/os_settings_resources_v3.grdp index 34c7744..e5c881b7 100644 --- a/chrome/browser/resources/settings/chromeos/os_settings_resources_v3.grdp +++ b/chrome/browser/resources/settings/chromeos/os_settings_resources_v3.grdp
@@ -407,6 +407,16 @@ use_base_dir="false" compress="false" type="BINDATA" /> + <include name="IDR_OS_SETTINGS_NEARBY_SHARE_DATA_USAGE_DIALOG_M_JS" + file="${root_gen_dir}/chrome/browser/resources/settings/nearby_share_page/nearby_share_data_usage_dialog.m.js" + use_base_dir="false" + compress="false" + type="BINDATA" /> + <include name="IDR_OS_SETTINGS_NEARBY_SHARE_TYPES_M_JS" + file="${root_gen_dir}/chrome/browser/resources/settings/nearby_share_page/types.m.js" + use_base_dir="false" + compress="false" + type="BINDATA" /> <include name="IDR_OS_SETTINGS_ROUTER_M_JS" file="${root_gen_dir}/chrome/browser/resources/settings/router.m.js" use_base_dir="false"
diff --git a/chrome/browser/resources/settings/nearby_share_page/BUILD.gn b/chrome/browser/resources/settings/nearby_share_page/BUILD.gn index 8792aec0..f4aa7cf6 100644 --- a/chrome/browser/resources/settings/nearby_share_page/BUILD.gn +++ b/chrome/browser/resources/settings/nearby_share_page/BUILD.gn
@@ -4,12 +4,29 @@ import("//third_party/closure_compiler/compile_js.gni") import("//tools/polymer/polymer.gni") +import("//ui/webui/resources/tools/js_modulizer.gni") import("../settings.gni") js_type_check("closure_compile") { deps = [ + ":nearby_share_data_usage_dialog", ":nearby_share_device_name_dialog", ":nearby_share_subpage", + ":types", + ] +} + +js_library("nearby_share_data_usage_dialog") { + deps = [ + ":types", + "../prefs", + "../prefs:prefs_behavior", + "../prefs:prefs_types", + "//ui/webui/resources/cr_elements/cr_button:cr_button", + "//ui/webui/resources/cr_elements/cr_dialog:cr_dialog", + "//ui/webui/resources/cr_elements/cr_radio_button:cr_radio_button", + "//ui/webui/resources/cr_elements/cr_radio_group:cr_radio_group", + "//ui/webui/resources/js:i18n_behavior", ] } @@ -27,7 +44,9 @@ js_library("nearby_share_subpage") { deps = [ + ":nearby_share_data_usage_dialog", ":nearby_share_device_name_dialog", + ":types", "../prefs", "../prefs:prefs_behavior", "../prefs:prefs_types", @@ -37,8 +56,13 @@ ] } +js_library("types") { +} + group("polymer3_elements") { public_deps = [ + ":modulize", + ":nearby_share_data_usage_dialog_module", ":nearby_share_device_name_dialog_module", ":nearby_share_subpage_module", "../controls:polymer3_elements", @@ -49,11 +73,28 @@ js_type_check("closure_compile_module") { is_polymer3 = true deps = [ + ":nearby_share_data_usage_dialog.m", ":nearby_share_device_name_dialog.m", ":nearby_share_subpage.m", ] } +js_library("nearby_share_data_usage_dialog.m") { + sources = [ "$root_gen_dir/chrome/browser/resources/settings/nearby_share_page/nearby_share_data_usage_dialog.m.js" ] + deps = [ + ":types.m", + "../prefs:prefs.m", + "../prefs:prefs_behavior.m", + "../prefs:prefs_types.m", + "//ui/webui/resources/cr_elements/cr_button:cr_button.m", + "//ui/webui/resources/cr_elements/cr_dialog:cr_dialog.m", + "//ui/webui/resources/cr_elements/cr_radio_button:cr_radio_button.m", + "//ui/webui/resources/cr_elements/cr_radio_group:cr_radio_group.m", + "//ui/webui/resources/js:i18n_behavior.m", + ] + extra_deps = [ ":nearby_share_data_usage_dialog_module" ] +} + js_library("nearby_share_device_name_dialog.m") { sources = [ "$root_gen_dir/chrome/browser/resources/settings/nearby_share_page/nearby_share_device_name_dialog.m.js" ] deps = [ @@ -71,7 +112,9 @@ js_library("nearby_share_subpage.m") { sources = [ "$root_gen_dir/chrome/browser/resources/settings/nearby_share_page/nearby_share_subpage.m.js" ] deps = [ + ":nearby_share_data_usage_dialog.m", ":nearby_share_device_name_dialog.m", + ":types.m", "../prefs:prefs.m", "../prefs:prefs_behavior.m", "../prefs:prefs_types.m", @@ -82,6 +125,24 @@ extra_deps = [ ":nearby_share_subpage_module" ] } +js_library("types.m") { + sources = [ "$root_gen_dir/chrome/browser/resources/settings/nearby_share_page/types.m.js" ] + extra_deps = [ ":modulize" ] +} + +js_modulizer("modulize") { + input_files = [ "types.js" ] + namespace_rewrites = settings_namespace_rewrites +} + +polymer_modulizer("nearby_share_data_usage_dialog") { + js_file = "nearby_share_data_usage_dialog.js" + html_file = "nearby_share_data_usage_dialog.html" + html_type = "dom-module" + namespace_rewrites = settings_namespace_rewrites + auto_imports = settings_auto_imports +} + polymer_modulizer("nearby_share_device_name_dialog") { js_file = "nearby_share_device_name_dialog.js" html_file = "nearby_share_device_name_dialog.html"
diff --git a/chrome/browser/resources/settings/nearby_share_page/nearby_share_data_usage_dialog.html b/chrome/browser/resources/settings/nearby_share_page/nearby_share_data_usage_dialog.html new file mode 100644 index 0000000..06667c5 --- /dev/null +++ b/chrome/browser/resources/settings/nearby_share_page/nearby_share_data_usage_dialog.html
@@ -0,0 +1,74 @@ +<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/cr_dialog/cr_dialog.html"> +<link rel="import" href="chrome://resources/cr_elements/cr_radio_button/cr_radio_button.html"> +<link rel="import" href="chrome://resources/cr_elements/cr_radio_group/cr_radio_group.html"> +<link rel="import" href="chrome://resources/html/i18n_behavior.html"> +<link rel="import" href="../prefs/prefs.html"> +<link rel="import" href="../prefs/prefs_behavior.html"> +<link rel="import" href="types.html"> + +<dom-module id="nearby-share-data-usage-dialog"> + <template> + <style> + .data-usage-name { + font-weight: 600; + } + </style> + <cr-dialog id="dialog"> + <div slot="title"> + $i18n{nearbyShareDataUsageDialogTitle} + </div> + <div slot="body"> + <cr-radio-group selected="[[selectedDataUsage_( + prefs.nearby_sharing.data_usage.value)]]"> + <cr-radio-button id="dataUsageWifiOnlyButton" + name="[[NearbyShareDataUsage.WIFI_ONLY]]" + aria-labelledby="dataUsageWifiOnlyLabel" + aria-describedby="dataUsageWifiOnlyDescription"> + <div id="dataUsageWifiOnlyLabel" class="data-usage-name" + aria-hidden="true"> + $i18n{nearbyShareDataUsageWifiOnlyLabel} + </div> + <div id="dataUsageWifiOnlyDescription" aria-hidden="true"> + $i18n{nearbyShareDataUsageWifiOnlyDescription} + </div> + </cr-radio-button> + <cr-radio-button id="dataUsageDataButton" + name="[[NearbyShareDataUsage.ONLINE]]" + aria-labelledby="dataUsageDataLabel" + aria-describedby="dataUsageDataDescription"> + <div id="dataUsageDataLabel" class="data-usage-name" + aria-hidden="true"> + $i18n{nearbyShareDataUsageDataLabel} + </div> + <div id="dataUsageDataDescription" aria-hidden="true"> + $i18n{nearbyShareDataUsageDataDescription} + </div> + </cr-radio-button> + <cr-radio-button id="dataUsageOfflineButton" + name="[[NearbyShareDataUsage.OFFLINE]]" + aria-labelledby="dataUsageOfflineLabel" + aria-describedby="dataUsageOfflineDescription"> + <div id="dataUsageOfflineLabel" class="data-usage-name" + aria-hidden="true"> + $i18n{nearbyShareDataUsageOfflineLabel} + </div> + <div id="dataUsageOfflineDescription" aria-hidden="true"> + $i18n{nearbyShareDataUsageOfflineDescription} + </div> + </cr-radio-button> + </cr-radio-group> + </div> + <div class="layout horizontal center" slot="button-container"> + <cr-button class="cancel-button" on-click="onCancelTap_"> + $i18n{cancel} + </cr-button> + <cr-button class="action-button" on-click="onUpdateTap_"> + $i18n{updateDataUsage} + </cr-button> + </cr-dialog> + </template> + <script src="nearby_share_data_usage_dialog.js"></script> +</dom-module>
diff --git a/chrome/browser/resources/settings/nearby_share_page/nearby_share_data_usage_dialog.js b/chrome/browser/resources/settings/nearby_share_page/nearby_share_data_usage_dialog.js new file mode 100644 index 0000000..4b14cf0 --- /dev/null +++ b/chrome/browser/resources/settings/nearby_share_page/nearby_share_data_usage_dialog.js
@@ -0,0 +1,69 @@ +// 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. + +/** + * @fileoverview + * 'nearby-share-data-usage-dialog' allows editing of the data usage setting + * when using Nearby Share. + */ +Polymer({ + is: 'nearby-share-data-usage-dialog', + + behaviors: [ + I18nBehavior, + PrefsBehavior, + ], + + properties: { + /** Preferences state. */ + prefs: { + type: Object, + notify: true, + }, + + /** @type {!Object<string, number>} */ + NearbyShareDataUsage: { + type: Object, + value: NearbyShareDataUsage, + }, + }, + + /** @override */ + attached() { + const dialog = /** @type {!CrDialogElement} */ (this.$.dialog); + if (!dialog.open) { + dialog.showModal(); + } + }, + + /** @private */ + close() { + const dialog = /** @type {!CrDialogElement} */ (this.$.dialog); + if (dialog.open) { + dialog.close(); + } + }, + + /** @private */ + onCancelTap_() { + this.close(); + }, + + /** @private */ + onUpdateTap_() { + this.setPrefValue( + 'nearby_sharing.data_usage', + dataUsageStringToEnum(this.$$('cr-radio-group').selected)); + this.close(); + }, + + /** @private */ + selectedDataUsage_(dataUsageValue) { + if (dataUsageValue === NearbyShareDataUsage.UNKNOWN) { + return NearbyShareDataUsage.WIFI_ONLY; + } + + return dataUsageValue; + }, +});
diff --git a/chrome/browser/resources/settings/nearby_share_page/nearby_share_subpage.html b/chrome/browser/resources/settings/nearby_share_page/nearby_share_subpage.html index ebf463dd..34b77a9 100644 --- a/chrome/browser/resources/settings/nearby_share_page/nearby_share_subpage.html +++ b/chrome/browser/resources/settings/nearby_share_page/nearby_share_subpage.html
@@ -8,6 +8,8 @@ <link rel="import" href="../prefs/prefs_behavior.html"> <link rel="import" href="../settings_shared_css.html"> <link rel="import" href="nearby_share_device_name_dialog.html"> +<link rel="import" href="nearby_share_data_usage_dialog.html"> +<link rel="import" href="types.html"> <dom-module id="settings-nearby-share-subpage"> <template> @@ -32,7 +34,6 @@ [[prefs.nearby_sharing.device_name.value]] </div> </div> - <div class="separator"></div> <cr-button id="editDeviceNameButton" on-click="onDeviceNameTap_" aria-description="[[getEditNameButtonAriaDescription_( prefs.nearby_sharing.device_name.value)]]"> @@ -44,6 +45,26 @@ on-close="onDeviceNameDialogClose_"> </nearby-share-device-name-dialog> </template> + <div class="settings-box two-line"> + <div class="start"> + <div aria-hidden="true"> + [[getDataUsageLabel_(prefs.nearby_sharing.data_usage.value)]] + </div> + <div aria-hidden="true" class="secondary"> + [[getDataUsageSubLabel_(prefs.nearby_sharing.data_usage.value)]] + </div> + </div> + <cr-button id="editDataUsageButton" on-click="onDataUsageTap_" + aria-description="[[getEditDataUsageButtonAriaDescription_( + prefs.nearby_sharing.data_usage.value)]]"> + $i18n{editDataUsage} + </cr-button> + </div> + <template is="dom-if" if="[[showDataUsageDialog_]]" restamp> + <nearby-share-data-usage-dialog prefs="{{prefs}}" id="dataUsageDialog" + on-close="onDataUsageDialogClose_"> + </nearby-share-data-usage-dialog> + </template> </template> <script src="nearby_share_subpage.js"></script> </dom-module>
diff --git a/chrome/browser/resources/settings/nearby_share_page/nearby_share_subpage.js b/chrome/browser/resources/settings/nearby_share_page/nearby_share_subpage.js index 7b460e6..14ed952 100644 --- a/chrome/browser/resources/settings/nearby_share_page/nearby_share_subpage.js +++ b/chrome/browser/resources/settings/nearby_share_page/nearby_share_subpage.js
@@ -7,7 +7,6 @@ * 'settings-nearby-share-subpage' is the settings subpage for managing the * Nearby Share feature. */ - Polymer({ is: 'settings-nearby-share-subpage', @@ -28,6 +27,12 @@ type: Boolean, value: false, }, + + /** @private {boolean} */ + showDataUsageDialog_: { + type: Boolean, + value: false, + }, }, /** @@ -41,9 +46,7 @@ event.stopPropagation(); }, - /** - * @private - */ + /** @private */ onDeviceNameTap_() { if (this.showDeviceNameDialog_) { return; @@ -51,6 +54,11 @@ this.showDeviceNameDialog_ = true; }, + /** @private */ + onDataUsageTap_() { + this.showDataUsageDialog_ = true; + }, + /** * @param {!Event} event * @private @@ -60,6 +68,14 @@ }, /** + * @param {!Event} event + * @private + */ + onDataUsageDialogClose_(event) { + this.showDataUsageDialog_ = false; + }, + + /** * @param {boolean} state boolean state that determines which string to show * @param {string} onstr string to show when state is true * @param {string} offstr string to show when state is false @@ -78,4 +94,55 @@ getEditNameButtonAriaDescription_(name) { return this.i18n('nearbyShareDeviceNameAriaDescription', name); }, + + /** + * * @param {string} dataUsageValue enum value of data usage setting. + * * @return {string} localized string + * * @private + * */ + getDataUsageLabel_(dataUsageValue) { + if (dataUsageStringToEnum(dataUsageValue) === NearbyShareDataUsage.ONLINE) { + return this.i18n('nearbyShareDataUsageDataLabel'); + } else if ( + dataUsageStringToEnum(dataUsageValue) === + NearbyShareDataUsage.OFFLINE) { + return this.i18n('nearbyShareDataUsageOfflineLabel'); + } else { + return this.i18n('nearbyShareDataUsageWifiOnlyLabel'); + } + }, + + /** + * * @param {string} dataUsageValue enum value of data usage setting. + * * @return {string} localized string + * * @private + * */ + getDataUsageSubLabel_(dataUsageValue) { + if (dataUsageStringToEnum(dataUsageValue) === NearbyShareDataUsage.ONLINE) { + return this.i18n('nearbyShareDataUsageDataDescription'); + } else if ( + dataUsageStringToEnum(dataUsageValue) === + NearbyShareDataUsage.OFFLINE) { + return this.i18n('nearbyShareDataUsageOfflineDescription'); + } else { + return this.i18n('nearbyShareDataUsageWifiOnlyDescription'); + } + }, + + /** + * * @param {string} dataUsageValue enum value of data usage setting. + * * @return {string} localized string + * * @private + * */ + getEditDataUsageButtonAriaDescription_(dataUsageValue) { + if (dataUsageStringToEnum(dataUsageValue) === NearbyShareDataUsage.ONLINE) { + return this.i18n('nearbyShareDataUsageDataEditButtonDescription'); + } else if ( + dataUsageStringToEnum(dataUsageValue) === + NearbyShareDataUsage.OFFLINE) { + return this.i18n('nearbyShareDataUsageOfflineEditButtonDescription'); + } else { + return this.i18n('nearbyShareDataUsageWifiOnlyEditButtonDescription'); + } + }, });
diff --git a/chrome/browser/resources/settings/nearby_share_page/types.html b/chrome/browser/resources/settings/nearby_share_page/types.html new file mode 100644 index 0000000..f769453 --- /dev/null +++ b/chrome/browser/resources/settings/nearby_share_page/types.html
@@ -0,0 +1 @@ +<script src="types.js"></script>
diff --git a/chrome/browser/resources/settings/nearby_share_page/types.js b/chrome/browser/resources/settings/nearby_share_page/types.js new file mode 100644 index 0000000..91ac255 --- /dev/null +++ b/chrome/browser/resources/settings/nearby_share_page/types.js
@@ -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. + +/** + * Enumeration of all possible data usage options for Nearby Share. + * Note: This must be kept in sync with DataUsage in + * chrome/browser/nearby_sharing/nearby_constants.h + * @enum {number} + */ +/* #export */ const NearbyShareDataUsage = { + UNKNOWN: 0, + OFFLINE: 1, + ONLINE: 2, + WIFI_ONLY: 3, +}; + +/** + * Takes a string and returns a value of the NearbyShareDataUsage enum. + * @param {string} s string representation of the data usage value + * @return {!NearbyShareDataUsage} enum value + */ +/* #export */ function dataUsageStringToEnum(s) { + switch (/** @type {!NearbyShareDataUsage} */ (parseInt(s, 10))) { + case NearbyShareDataUsage.OFFLINE: + return NearbyShareDataUsage.OFFLINE; + case NearbyShareDataUsage.ONLINE: + return NearbyShareDataUsage.ONLINE; + case NearbyShareDataUsage.WIFI_ONLY: + return NearbyShareDataUsage.WIFI_ONLY; + default: + return NearbyShareDataUsage.UNKNOWN; + } +}
diff --git a/chrome/browser/resources/settings/os_settings_resources.grd b/chrome/browser/resources/settings/os_settings_resources.grd index 944d9cc..d065fa6 100644 --- a/chrome/browser/resources/settings/os_settings_resources.grd +++ b/chrome/browser/resources/settings/os_settings_resources.grd
@@ -1280,6 +1280,18 @@ <structure name="IDR_OS_SETTINGS_NEARBY_SHARE_DEVICE_NAME_DIALOG_JS" file="nearby_share_page/nearby_share_device_name_dialog.js" compress="false" type="chrome_html" /> + <structure name="IDR_OS_SETTINGS_NEARBY_SHARE_DATA_USAGE_DIALOG_HTML" + file="nearby_share_page/nearby_share_data_usage_dialog.html" + compress="false" type="chrome_html" /> + <structure name="IDR_OS_SETTINGS_NEARBY_SHARE_DATA_USAGE_DIALOG_JS" + file="nearby_share_page/nearby_share_data_usage_dialog.js" + compress="false" type="chrome_html" /> + <structure name="IDR_OS_SETTINGS_NEARBY_SHARE_TYPES_HTML" + file="nearby_share_page/types.html" + compress="false" type="chrome_html" /> + <structure name="IDR_OS_SETTINGS_NEARBY_SHARE_TYPES_JS" + file="nearby_share_page/types.js" + compress="false" type="chrome_html" /> <structure name="IDR_OS_SETTINGS_NEARBY_SHARE_SUBPAGE_HTML" file="nearby_share_page/nearby_share_subpage.html" compress="false" type="chrome_html" />
diff --git a/chrome/browser/resources/settings/settings.gni b/chrome/browser/resources/settings/settings.gni index 0c82dda..d377c1cb 100644 --- a/chrome/browser/resources/settings/settings.gni +++ b/chrome/browser/resources/settings/settings.gni
@@ -133,6 +133,7 @@ "chrome/browser/resources/settings/extension_control_browser_proxy.html|ExtensionControlBrowserProxyImpl,ExtensionControlBrowserProxy", "chrome/browser/resources/settings/global_scroll_target_behavior.html|GlobalScrollTargetBehavior", "chrome/browser/resources/settings/i18n_setup.html|loadTimeData", + "chrome/browser/resources/settings/nearby_share_page/types.html|NearbyShareDataUsage,dataUsageStringToEnum", "chrome/browser/resources/settings/prefs/prefs_behavior.html|PrefsBehavior", "chrome/browser/resources/settings/prefs/prefs_types.html|CrSettingsPrefs", "chrome/browser/resources/settings/printing_page/printing_browser_proxy.html|PrintingBrowserProxyImpl",
diff --git a/chrome/browser/safe_browsing/android/java/res/xml/security_preferences.xml b/chrome/browser/safe_browsing/android/java/res/xml/security_preferences.xml index 6220780..d88dc0b 100644 --- a/chrome/browser/safe_browsing/android/java/res/xml/security_preferences.xml +++ b/chrome/browser/safe_browsing/android/java/res/xml/security_preferences.xml
@@ -10,7 +10,8 @@ android:key="safe_browsing_section" android:title="@string/prefs_section_safe_browsing_title"/> -<!-- TODO(crbug.com/1097310): Add managed text view for Safe Browsing preference. --> + <org.chromium.components.browser_ui.settings.TextMessagePreference + android:key="text_managed" /> <org.chromium.chrome.browser.safe_browsing.settings.RadioButtonGroupSafeBrowsingPreference android:key="safe_browsing_radio_button_group"
diff --git a/chrome/browser/safe_browsing/android/java/src/org/chromium/chrome/browser/safe_browsing/SafeBrowsingBridge.java b/chrome/browser/safe_browsing/android/java/src/org/chromium/chrome/browser/safe_browsing/SafeBrowsingBridge.java index fd745a6..d1ead1f 100644 --- a/chrome/browser/safe_browsing/android/java/src/org/chromium/chrome/browser/safe_browsing/SafeBrowsingBridge.java +++ b/chrome/browser/safe_browsing/android/java/src/org/chromium/chrome/browser/safe_browsing/SafeBrowsingBridge.java
@@ -60,6 +60,14 @@ } /** + * @return Whether the Safe Browsing preference is managed. It can be managed by either + * the SafeBrowsingEnabled policy(legacy) or the SafeBrowsingProtectionLevel policy(new). + */ + public static boolean isSafeBrowsingManaged() { + return SafeBrowsingBridgeJni.get().isSafeBrowsingManaged(); + } + + /** * @return Whether there is a Google account to use for the leak detection check. */ public static boolean hasAccountForLeakCheckRequest() { @@ -76,5 +84,6 @@ int getSafeBrowsingState(); void setSafeBrowsingState(@SafeBrowsingState int state); boolean hasAccountForLeakCheckRequest(); + boolean isSafeBrowsingManaged(); } }
diff --git a/chrome/browser/safe_browsing/android/java/src/org/chromium/chrome/browser/safe_browsing/settings/RadioButtonGroupSafeBrowsingPreference.java b/chrome/browser/safe_browsing/android/java/src/org/chromium/chrome/browser/safe_browsing/settings/RadioButtonGroupSafeBrowsingPreference.java index 1c185ce..f5500914 100644 --- a/chrome/browser/safe_browsing/android/java/src/org/chromium/chrome/browser/safe_browsing/settings/RadioButtonGroupSafeBrowsingPreference.java +++ b/chrome/browser/safe_browsing/android/java/src/org/chromium/chrome/browser/safe_browsing/settings/RadioButtonGroupSafeBrowsingPreference.java
@@ -15,6 +15,8 @@ import androidx.preference.PreferenceViewHolder; import org.chromium.chrome.browser.safe_browsing.SafeBrowsingState; +import org.chromium.components.browser_ui.settings.ManagedPreferenceDelegate; +import org.chromium.components.browser_ui.settings.ManagedPreferencesUtils; import org.chromium.components.browser_ui.widget.RadioButtonWithDescription; import org.chromium.components.browser_ui.widget.RadioButtonWithDescriptionAndAuxButton; import org.chromium.components.browser_ui.widget.RadioButtonWithDescriptionLayout; @@ -52,6 +54,7 @@ private @SafeBrowsingState int mSafeBrowsingState; private boolean mIsEnhancedProtectionEnabled; private OnSafeBrowsingModeDetailsRequested mSafeBrowsingModeDetailsRequestedListener; + private ManagedPreferenceDelegate mManagedPrefDelegate; public RadioButtonGroupSafeBrowsingPreference(Context context, AttributeSet attrs) { super(context, attrs); @@ -112,6 +115,16 @@ } mStandardProtection.setChecked(mSafeBrowsingState == SafeBrowsingState.STANDARD_PROTECTION); mNoProtection.setChecked(mSafeBrowsingState == SafeBrowsingState.NO_SAFE_BROWSING); + + // If Safe Browsing is managed, disable the radio button group, but keep the aux buttons + // enabled to disclose information. + if (mManagedPrefDelegate.isPreferenceClickDisabledByPolicy(this)) { + groupLayout.setEnabled(false); + if (mIsEnhancedProtectionEnabled) { + mEnhancedProtection.setAuxButtonEnabled(true); + } + mStandardProtection.setAuxButtonEnabled(true); + } } @Override @@ -139,6 +152,14 @@ mSafeBrowsingModeDetailsRequestedListener = listener; } + /** + * Sets the ManagedPreferenceDelegate which will determine whether this preference is managed. + */ + public void setManagedPreferenceDelegate(ManagedPreferenceDelegate delegate) { + mManagedPrefDelegate = delegate; + ManagedPreferencesUtils.initPreference(mManagedPrefDelegate, this); + } + @VisibleForTesting public @SafeBrowsingState int getSafeBrowsingStateForTesting() { return mSafeBrowsingState;
diff --git a/chrome/browser/safe_browsing/android/java/src/org/chromium/chrome/browser/safe_browsing/settings/SecuritySettingsFragment.java b/chrome/browser/safe_browsing/android/java/src/org/chromium/chrome/browser/safe_browsing/settings/SecuritySettingsFragment.java index 4d37cd21..941ba2c0 100644 --- a/chrome/browser/safe_browsing/android/java/src/org/chromium/chrome/browser/safe_browsing/settings/SecuritySettingsFragment.java +++ b/chrome/browser/safe_browsing/android/java/src/org/chromium/chrome/browser/safe_browsing/settings/SecuritySettingsFragment.java
@@ -12,9 +12,12 @@ import org.chromium.chrome.browser.flags.ChromeFeatureList; import org.chromium.chrome.browser.safe_browsing.SafeBrowsingBridge; import org.chromium.chrome.browser.safe_browsing.SafeBrowsingState; +import org.chromium.chrome.browser.settings.ChromeManagedPreferenceDelegate; import org.chromium.chrome.browser.settings.FragmentSettingsLauncher; import org.chromium.chrome.browser.settings.SettingsLauncher; +import org.chromium.components.browser_ui.settings.ManagedPreferenceDelegate; import org.chromium.components.browser_ui.settings.SettingsUtils; +import org.chromium.components.browser_ui.settings.TextMessagePreference; /** * Fragment containing security settings. @@ -23,7 +26,9 @@ implements FragmentSettingsLauncher, RadioButtonGroupSafeBrowsingPreference.OnSafeBrowsingModeDetailsRequested { @VisibleForTesting - public static final String PREF_SAFE_BROWSING = "safe_browsing_radio_button_group"; + static final String PREF_TEXT_MANAGED = "text_managed"; + @VisibleForTesting + static final String PREF_SAFE_BROWSING = "safe_browsing_radio_button_group"; // An instance of SettingsLauncher that is used to launch Safe Browsing subsections. private SettingsLauncher mSettingsLauncher; @@ -33,18 +38,26 @@ SettingsUtils.addPreferencesFromResource(this, R.xml.security_preferences); getActivity().setTitle(R.string.prefs_security_title); + ManagedPreferenceDelegate managedPreferenceDelegate = createManagedPreferenceDelegate(); + RadioButtonGroupSafeBrowsingPreference safeBrowsingPreference = findPreference(PREF_SAFE_BROWSING); safeBrowsingPreference.init(SafeBrowsingBridge.getSafeBrowsingState(), ChromeFeatureList.isEnabled( ChromeFeatureList.SAFE_BROWSING_ENHANCED_PROTECTION_ENABLED)); safeBrowsingPreference.setSafeBrowsingModeDetailsRequestedListener(this); + safeBrowsingPreference.setManagedPreferenceDelegate(managedPreferenceDelegate); safeBrowsingPreference.setOnPreferenceChangeListener((preference, newValue) -> { @SafeBrowsingState int newState = (int) newValue; SafeBrowsingBridge.setSafeBrowsingState(newState); return true; }); + + TextMessagePreference textManaged = findPreference(PREF_TEXT_MANAGED); + textManaged.setManagedPreferenceDelegate(managedPreferenceDelegate); + textManaged.setVisible(managedPreferenceDelegate.isPreferenceClickDisabledByPolicy( + safeBrowsingPreference)); } @Override @@ -64,4 +77,16 @@ public void setSettingsLauncher(SettingsLauncher settingsLauncher) { mSettingsLauncher = settingsLauncher; } + + private ChromeManagedPreferenceDelegate createManagedPreferenceDelegate() { + return preference -> { + String key = preference.getKey(); + if (PREF_TEXT_MANAGED.equals(key) || PREF_SAFE_BROWSING.equals(key)) { + return SafeBrowsingBridge.isSafeBrowsingManaged(); + } else { + assert false : "Should not be reached."; + } + return false; + }; + } }
diff --git a/chrome/browser/safe_browsing/android/javatests/src/org/chromium/chrome/browser/safe_browsing/settings/SecuritySettingsFragmentTest.java b/chrome/browser/safe_browsing/android/javatests/src/org/chromium/chrome/browser/safe_browsing/settings/SecuritySettingsFragmentTest.java index f912740..47143970 100644 --- a/chrome/browser/safe_browsing/android/javatests/src/org/chromium/chrome/browser/safe_browsing/settings/SecuritySettingsFragmentTest.java +++ b/chrome/browser/safe_browsing/android/javatests/src/org/chromium/chrome/browser/safe_browsing/settings/SecuritySettingsFragmentTest.java
@@ -16,22 +16,25 @@ import org.mockito.Mockito; import org.mockito.MockitoAnnotations; -import org.chromium.base.test.BaseJUnit4ClassRunner; import org.chromium.base.test.util.Feature; import org.chromium.chrome.browser.flags.ChromeFeatureList; +import org.chromium.chrome.browser.init.ChromeBrowserInitializer; import org.chromium.chrome.browser.safe_browsing.SafeBrowsingBridge; import org.chromium.chrome.browser.safe_browsing.SafeBrowsingState; import org.chromium.chrome.browser.settings.SettingsActivityTestRule; import org.chromium.chrome.browser.settings.SettingsLauncher; +import org.chromium.chrome.test.ChromeJUnit4ClassRunner; import org.chromium.chrome.test.util.browser.Features; +import org.chromium.components.browser_ui.settings.TextMessagePreference; import org.chromium.components.browser_ui.widget.RadioButtonWithDescription; import org.chromium.components.browser_ui.widget.RadioButtonWithDescriptionAndAuxButton; import org.chromium.content_public.browser.test.util.TestThreadUtils; +import org.chromium.policy.test.annotations.Policies; /** * Tests for {@link SecuritySettingsFragment}. */ -@RunWith(BaseJUnit4ClassRunner.class) +@RunWith(ChromeJUnit4ClassRunner.class) // clang-format off @Features.EnableFeatures({ChromeFeatureList.SAFE_BROWSING_SECURITY_SECTION_UI}) public class SecuritySettingsFragmentTest { @@ -55,11 +58,11 @@ private SecuritySettingsFragment mSecuritySettingsFragment; private RadioButtonGroupSafeBrowsingPreference mSafeBrowsingPreference; + private TextMessagePreference mManagedTextPreference; @Before public void setUp() { MockitoAnnotations.initMocks(this); - launchSettingsActivity(); } private void launchSettingsActivity() { @@ -67,8 +70,11 @@ mSecuritySettingsFragment = mTestRule.getFragment(); mSafeBrowsingPreference = mSecuritySettingsFragment.findPreference( SecuritySettingsFragment.PREF_SAFE_BROWSING); + mManagedTextPreference = mSecuritySettingsFragment.findPreference( + SecuritySettingsFragment.PREF_TEXT_MANAGED); Assert.assertNotNull( "Safe Browsing preference should not be null.", mSafeBrowsingPreference); + Assert.assertNotNull("Text managed preference should not be null.", mManagedTextPreference); } @Test @@ -76,6 +82,7 @@ @Feature({"SafeBrowsing"}) @Features.EnableFeatures(ChromeFeatureList.SAFE_BROWSING_ENHANCED_PROTECTION_ENABLED) public void testOnStartup() { + launchSettingsActivity(); TestThreadUtils.runOnUiThreadBlocking(() -> { @SafeBrowsingState int currentState = SafeBrowsingBridge.getSafeBrowsingState(); @@ -90,6 +97,7 @@ getStandardProtectionButton().isChecked()); Assert.assertEquals(ASSERT_RADIO_BUTTON_CHECKED, no_protection_checked, getNoProtectionButton().isChecked()); + Assert.assertFalse(mManagedTextPreference.isVisible()); }); } @@ -98,7 +106,9 @@ @Feature({"SafeBrowsing"}) @Features.EnableFeatures(ChromeFeatureList.SAFE_BROWSING_ENHANCED_PROTECTION_ENABLED) public void testCheckRadioButtons() { + launchSettingsActivity(); TestThreadUtils.runOnUiThreadBlocking(() -> { + Assert.assertFalse(mManagedTextPreference.isVisible()); // Click the Enhanced Protection button. getEnhancedProtectionButton().onClick(null); Assert.assertEquals(ASSERT_SAFE_BROWSING_STATE_RADIO_BUTTON_GROUP, @@ -144,6 +154,7 @@ @Feature({"SafeBrowsing"}) @Features.DisableFeatures(ChromeFeatureList.SAFE_BROWSING_ENHANCED_PROTECTION_ENABLED) public void testEnhancedProtectionDisabled() { + launchSettingsActivity(); Assert.assertNull(getEnhancedProtectionButton()); } @@ -152,6 +163,7 @@ @Feature({"SafeBrowsing"}) @Features.EnableFeatures(ChromeFeatureList.SAFE_BROWSING_ENHANCED_PROTECTION_ENABLED) public void testEnhancedProtectionAuxButtonClicked() { + launchSettingsActivity(); TestThreadUtils.runOnUiThreadBlocking(() -> { mSecuritySettingsFragment.setSettingsLauncher(mSettingsLauncher); getEnhancedProtectionButton().getAuxButtonForTests().performClick(); @@ -166,6 +178,7 @@ @Feature({"SafeBrowsing"}) @Features.EnableFeatures(ChromeFeatureList.SAFE_BROWSING_ENHANCED_PROTECTION_ENABLED) public void testStandardProtectionAuxButtonClicked() { + launchSettingsActivity(); TestThreadUtils.runOnUiThreadBlocking(() -> { mSecuritySettingsFragment.setSettingsLauncher(mSettingsLauncher); getStandardProtectionButton().getAuxButtonForTests().performClick(); @@ -175,6 +188,28 @@ }); } + @Test + @SmallTest + @Feature({"SafeBrowsing"}) + @Features.EnableFeatures(ChromeFeatureList.SAFE_BROWSING_ENHANCED_PROTECTION_ENABLED) + @Policies.Add({ @Policies.Item(key = "SafeBrowsingEnabled", string = "true") }) + public void testSafeBrowsingManaged() { + TestThreadUtils.runOnUiThreadBlocking( + () -> { ChromeBrowserInitializer.getInstance().handleSynchronousStartup(); }); + launchSettingsActivity(); + TestThreadUtils.runOnUiThreadBlocking(() -> { + Assert.assertTrue(SafeBrowsingBridge.isSafeBrowsingManaged()); + Assert.assertTrue(mManagedTextPreference.isVisible()); + Assert.assertFalse(getEnhancedProtectionButton().isEnabled()); + Assert.assertFalse(getStandardProtectionButton().isEnabled()); + Assert.assertFalse(getNoProtectionButton().isEnabled()); + Assert.assertEquals(SafeBrowsingState.STANDARD_PROTECTION, getSafeBrowsingState()); + // To disclose information, aux buttons should be enabled under managed mode. + Assert.assertTrue(getEnhancedProtectionButton().getAuxButtonForTests().isEnabled()); + Assert.assertTrue(getStandardProtectionButton().getAuxButtonForTests().isEnabled()); + }); + } + private @SafeBrowsingState int getSafeBrowsingState() { return mSafeBrowsingPreference.getSafeBrowsingStateForTesting(); }
diff --git a/chrome/browser/safe_browsing/android/safe_browsing_bridge.cc b/chrome/browser/safe_browsing/android/safe_browsing_bridge.cc index d01b6af..ea1edc3ef 100644 --- a/chrome/browser/safe_browsing/android/safe_browsing_bridge.cc +++ b/chrome/browser/safe_browsing/android/safe_browsing_bridge.cc
@@ -66,6 +66,10 @@ GetPrefService(), static_cast<SafeBrowsingState>(state)); } +static jboolean JNI_SafeBrowsingBridge_IsSafeBrowsingManaged(JNIEnv* env) { + return safe_browsing::IsSafeBrowsingPolicyManaged(*GetPrefService()); +} + static jboolean JNI_SafeBrowsingBridge_HasAccountForLeakCheckRequest( JNIEnv* env) { signin::IdentityManager* identity_manager =
diff --git a/chrome/browser/safe_browsing/cloud_content_scanning/binary_upload_service.cc b/chrome/browser/safe_browsing/cloud_content_scanning/binary_upload_service.cc index 1b21022..11a7030 100644 --- a/chrome/browser/safe_browsing/cloud_content_scanning/binary_upload_service.cc +++ b/chrome/browser/safe_browsing/cloud_content_scanning/binary_upload_service.cc
@@ -34,6 +34,7 @@ #include "components/prefs/pref_service.h" #include "components/safe_browsing/content/web_ui/safe_browsing_ui.h" #include "components/safe_browsing/core/common/safe_browsing_prefs.h" +#include "components/safe_browsing/core/features.h" #include "components/safe_browsing/core/proto/webprotect.pb.h" #include "content/public/browser/browser_task_traits.h" #include "content/public/browser/browser_thread.h" @@ -107,6 +108,14 @@ } // namespace +BinaryUploadService::BinaryUploadService(Profile* profile) + : url_loader_factory_(profile->GetURLLoaderFactory()), + binary_fcm_service_(BinaryFCMService::Create(profile)), + profile_(profile), + weakptr_factory_(this) { + DCHECK(base::FeatureList::IsEnabled(kSafeBrowsingSeparateNetworkContexts)); +} + BinaryUploadService::BinaryUploadService( scoped_refptr<network::SharedURLLoaderFactory> url_loader_factory, Profile* profile) @@ -351,7 +360,7 @@ if (result.has_tag() && !result.tag().empty()) { VLOG(1) << "Request " << request->request_token() << " finished scanning tag <" << result.tag() << ">"; - *received_connector_responses_[request].add_results() = result; + received_connector_results_[request][result.tag()] = result; } } @@ -382,10 +391,11 @@ void BinaryUploadService::MaybeFinishConnectorRequest(Request* request) { for (const std::string& tag : request->content_analysis_request().tags()) { - const auto& results = received_connector_responses_[request].results(); - if (std::none_of( - results.begin(), results.end(), - [&tag](const auto& result) { return result.tag() == tag; })) { + const auto& results = received_connector_results_[request]; + if (std::none_of(results.begin(), results.end(), + [&tag](const auto& tag_and_result) { + return tag_and_result.first == tag; + })) { VLOG(1) << "Request " << request->request_token() << " is waiting for <" << tag << "> scanning to complete."; return; @@ -393,9 +403,10 @@ } // It's OK to move here since the map entry is about to be removed. - enterprise_connectors::ContentAnalysisResponse response = - std::move(received_connector_responses_[request]); + enterprise_connectors::ContentAnalysisResponse response; response.set_request_token(request->request_token()); + for (auto& tag_and_result : received_connector_results_[request]) + *response.add_results() = std::move(tag_and_result.second); FinishConnectorRequest(request, Result::SUCCESS, std::move(response)); } @@ -494,7 +505,7 @@ active_uploads_.erase(request); received_malware_verdicts_.erase(request); received_dlp_verdicts_.erase(request); - received_connector_responses_.erase(request); + received_connector_results_.erase(request); auto token_it = active_tokens_.find(request); DCHECK(token_it != active_tokens_.end());
diff --git a/chrome/browser/safe_browsing/cloud_content_scanning/binary_upload_service.h b/chrome/browser/safe_browsing/cloud_content_scanning/binary_upload_service.h index 090d7c8..09e5a2d 100644 --- a/chrome/browser/safe_browsing/cloud_content_scanning/binary_upload_service.h +++ b/chrome/browser/safe_browsing/cloud_content_scanning/binary_upload_service.h
@@ -36,6 +36,8 @@ // The maximum size of data that can be uploaded via this service. constexpr static size_t kMaxUploadSizeBytes = 50 * 1024 * 1024; // 50 MB + explicit BinaryUploadService(Profile* profile); + BinaryUploadService( scoped_refptr<network::SharedURLLoaderFactory> url_loader_factory, Profile* profile); @@ -305,9 +307,12 @@ base::flat_map<Request*, std::unique_ptr<DlpDeepScanningVerdict>> received_dlp_verdicts_; - // Maps requests to each tag-result pair. - base::flat_map<Request*, enterprise_connectors::ContentAnalysisResponse> - received_connector_responses_; + // Maps requests to each corresponding tag-result pairs. + base::flat_map< + Request*, + base::flat_map<std::string, + enterprise_connectors::ContentAnalysisResponse::Result>> + received_connector_results_; // Indicates whether this browser can upload data for enterprise requests. // Advanced Protection scans are validated using the user's Advanced
diff --git a/chrome/browser/safe_browsing/cloud_content_scanning/binary_upload_service_factory.cc b/chrome/browser/safe_browsing/cloud_content_scanning/binary_upload_service_factory.cc index 648f78f3..213b918 100644 --- a/chrome/browser/safe_browsing/cloud_content_scanning/binary_upload_service_factory.cc +++ b/chrome/browser/safe_browsing/cloud_content_scanning/binary_upload_service_factory.cc
@@ -10,6 +10,7 @@ #include "chrome/browser/safe_browsing/cloud_content_scanning/binary_upload_service.h" #include "chrome/browser/safe_browsing/safe_browsing_service.h" #include "components/keyed_service/content/browser_context_dependency_manager.h" +#include "components/safe_browsing/core/features.h" #include "content/public/browser/browser_context.h" namespace safe_browsing { @@ -35,9 +36,13 @@ KeyedService* BinaryUploadServiceFactory::BuildServiceInstanceFor( content::BrowserContext* context) const { Profile* profile = Profile::FromBrowserContext(context); - return new BinaryUploadService( - g_browser_process->safe_browsing_service()->GetURLLoaderFactory(), - profile); + if (base::FeatureList::IsEnabled(kSafeBrowsingSeparateNetworkContexts)) { + return new BinaryUploadService(profile); + } else { + return new BinaryUploadService( + g_browser_process->safe_browsing_service()->GetURLLoaderFactory(), + profile); + } } content::BrowserContext* BinaryUploadServiceFactory::GetBrowserContextToUse(
diff --git a/chrome/browser/safe_browsing/cloud_content_scanning/multipart_uploader.cc b/chrome/browser/safe_browsing/cloud_content_scanning/multipart_uploader.cc index 090ce95d..1f4aa00f4b 100644 --- a/chrome/browser/safe_browsing/cloud_content_scanning/multipart_uploader.cc +++ b/chrome/browser/safe_browsing/cloud_content_scanning/multipart_uploader.cc
@@ -10,6 +10,7 @@ #include "base/memory/scoped_refptr.h" #include "base/metrics/histogram_functions.h" #include "base/time/time.h" +#include "components/safe_browsing/core/features.h" #include "content/public/browser/browser_task_traits.h" #include "content/public/browser/browser_thread.h" #include "net/base/mime_util.h" @@ -85,6 +86,10 @@ resource_request->method = "POST"; resource_request->headers.SetHeader("X-Goog-Upload-Protocol", "multipart"); + if (base::FeatureList::IsEnabled(kSafeBrowsingSeparateNetworkContexts)) { + resource_request->credentials_mode = network::mojom::CredentialsMode::kOmit; + } + url_loader_ = network::SimpleURLLoader::Create(std::move(resource_request), traffic_annotation_); url_loader_->SetAllowHttpErrorResults(true);
diff --git a/chrome/browser/supervised_user/legacy/custodian_profile_downloader_service.cc b/chrome/browser/supervised_user/legacy/custodian_profile_downloader_service.cc deleted file mode 100644 index 2f1ebc30..0000000 --- a/chrome/browser/supervised_user/legacy/custodian_profile_downloader_service.cc +++ /dev/null
@@ -1,95 +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 "chrome/browser/supervised_user/legacy/custodian_profile_downloader_service.h" - -#include "chrome/browser/profiles/profile.h" -#include "chrome/browser/signin/identity_manager_factory.h" -#include "chrome/common/pref_names.h" -#include "components/prefs/pref_service.h" -#include "components/signin/public/identity_manager/consent_level.h" -#include "components/signin/public/identity_manager/identity_manager.h" -#include "content/public/browser/storage_partition.h" -#include "google_apis/gaia/gaia_auth_util.h" - -CustodianProfileDownloaderService::CustodianProfileDownloaderService( - Profile* custodian_profile) - : custodian_profile_(custodian_profile) { -} - -CustodianProfileDownloaderService::~CustodianProfileDownloaderService() {} - -void CustodianProfileDownloaderService::Shutdown() { - profile_downloader_.reset(); -} - -void CustodianProfileDownloaderService::DownloadProfile( - const DownloadProfileCallback& callback) { - // The user must be logged in. "Unconsented" because this class doesn't care - // about browser sync consent. - if (!IdentityManagerFactory::GetForProfile(custodian_profile_) - ->HasPrimaryAccount(signin::ConsentLevel::kNotRequired)) { - return; - } - - download_callback_ = callback; - std::string current_email = custodian_profile_->GetProfileUserName(); - if (gaia::AreEmailsSame(last_downloaded_profile_email_, current_email)) { - // Profile was previously downloaded successfully, use it as it is unlikely - // that we will need to download it again. - OnProfileDownloadSuccess(profile_downloader_.get()); - return; - } - // If another profile download is in progress, drop it. It's not worth - // queueing them up, and more likely that the one that hasn't ended yet is - // failing somehow than that the new one won't succeed. - in_progress_profile_email_ = current_email; - profile_downloader_.reset(new ProfileDownloader(this)); - profile_downloader_->Start(); -} - -bool CustodianProfileDownloaderService::NeedsProfilePicture() const { - return false; -} - -int CustodianProfileDownloaderService::GetDesiredImageSideLength() const { - return 0; -} - -std::string CustodianProfileDownloaderService::GetCachedPictureURL() const { - return std::string(); -} - -signin::IdentityManager* -CustodianProfileDownloaderService::GetIdentityManager() { - DCHECK(custodian_profile_); - return IdentityManagerFactory::GetForProfile(custodian_profile_); -} - -network::mojom::URLLoaderFactory* -CustodianProfileDownloaderService::GetURLLoaderFactory() { - DCHECK(custodian_profile_); - return content::BrowserContext::GetDefaultStoragePartition(custodian_profile_) - ->GetURLLoaderFactoryForBrowserProcess() - .get(); -} - -bool CustodianProfileDownloaderService::IsPreSignin() const { - return false; -} - -void CustodianProfileDownloaderService::OnProfileDownloadSuccess( - ProfileDownloader* downloader) { - download_callback_.Run(downloader->GetProfileFullName()); - download_callback_.Reset(); - last_downloaded_profile_email_ = in_progress_profile_email_; -} - -void CustodianProfileDownloaderService::OnProfileDownloadFailure( - ProfileDownloader* downloader, - ProfileDownloaderDelegate::FailureReason reason) { - // Ignore failures; proceed without the custodian's name. - download_callback_.Reset(); - profile_downloader_.reset(); -}
diff --git a/chrome/browser/supervised_user/legacy/custodian_profile_downloader_service.h b/chrome/browser/supervised_user/legacy/custodian_profile_downloader_service.h deleted file mode 100644 index 5a1fc1c..0000000 --- a/chrome/browser/supervised_user/legacy/custodian_profile_downloader_service.h +++ /dev/null
@@ -1,63 +0,0 @@ -// Copyright 2014 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef CHROME_BROWSER_SUPERVISED_USER_LEGACY_CUSTODIAN_PROFILE_DOWNLOADER_SERVICE_H_ -#define CHROME_BROWSER_SUPERVISED_USER_LEGACY_CUSTODIAN_PROFILE_DOWNLOADER_SERVICE_H_ - -#include "base/callback.h" -#include "chrome/browser/profiles/profile_downloader.h" -#include "chrome/browser/profiles/profile_downloader_delegate.h" -#include "components/keyed_service/core/keyed_service.h" - -class Profile; - -class CustodianProfileDownloaderService : public KeyedService, - public ProfileDownloaderDelegate { - public: - // Callback for DownloadProfile() below. If the GAIA profile download is - // successful, the profile's full (display) name will be returned. - typedef base::Callback<void(const base::string16& /* full name */)> - DownloadProfileCallback; - - ~CustodianProfileDownloaderService() override; - - // KeyedService: - void Shutdown() override; - - // Downloads the GAIA account information for the |custodian_profile_|. - // This is a best-effort attempt with no error reporting nor timeout. - // If the download is successful, the profile's full (display) name will - // be returned via the callback. If the download fails or never completes, - // the callback will not be called. - void DownloadProfile(const DownloadProfileCallback& callback); - - // ProfileDownloaderDelegate: - bool NeedsProfilePicture() const override; - int GetDesiredImageSideLength() const override; - std::string GetCachedPictureURL() const override; - signin::IdentityManager* GetIdentityManager() override; - network::mojom::URLLoaderFactory* GetURLLoaderFactory() override; - bool IsPreSignin() const override; - void OnProfileDownloadSuccess(ProfileDownloader* downloader) override; - void OnProfileDownloadFailure( - ProfileDownloader* downloader, - ProfileDownloaderDelegate::FailureReason reason) override; - - private: - friend class CustodianProfileDownloaderServiceFactory; - // Use |CustodianProfileDownloaderServiceFactory::GetForProfile(...)| to - // get instances of this service. - explicit CustodianProfileDownloaderService(Profile* custodian_profile); - - std::unique_ptr<ProfileDownloader> profile_downloader_; - DownloadProfileCallback download_callback_; - - // Owns us via the KeyedService mechanism. - Profile* custodian_profile_; - - std::string last_downloaded_profile_email_; - std::string in_progress_profile_email_; -}; - -#endif // CHROME_BROWSER_SUPERVISED_USER_LEGACY_CUSTODIAN_PROFILE_DOWNLOADER_SERVICE_H_
diff --git a/chrome/browser/supervised_user/legacy/custodian_profile_downloader_service_factory.cc b/chrome/browser/supervised_user/legacy/custodian_profile_downloader_service_factory.cc deleted file mode 100644 index d715212..0000000 --- a/chrome/browser/supervised_user/legacy/custodian_profile_downloader_service_factory.cc +++ /dev/null
@@ -1,42 +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 "chrome/browser/supervised_user/legacy/custodian_profile_downloader_service_factory.h" - -#include "chrome/browser/profiles/profile.h" -#include "chrome/browser/signin/identity_manager_factory.h" -#include "chrome/browser/supervised_user/legacy/custodian_profile_downloader_service.h" -#include "components/keyed_service/content/browser_context_dependency_manager.h" - -// static -CustodianProfileDownloaderService* -CustodianProfileDownloaderServiceFactory::GetForProfile( - Profile* profile) { - return static_cast<CustodianProfileDownloaderService*>( - GetInstance()->GetServiceForBrowserContext(profile, true)); -} - -// static -CustodianProfileDownloaderServiceFactory* -CustodianProfileDownloaderServiceFactory::GetInstance() { - return base::Singleton<CustodianProfileDownloaderServiceFactory>::get(); -} - -CustodianProfileDownloaderServiceFactory:: -CustodianProfileDownloaderServiceFactory() - : BrowserContextKeyedServiceFactory( - "CustodianProfileDownloaderService", - BrowserContextDependencyManager::GetInstance()) { - // Indirect dependency via ProfileDownloader. - DependsOn(IdentityManagerFactory::GetInstance()); -} - -CustodianProfileDownloaderServiceFactory:: -~CustodianProfileDownloaderServiceFactory() {} - -KeyedService* CustodianProfileDownloaderServiceFactory::BuildServiceInstanceFor( - content::BrowserContext* profile) const { - return new CustodianProfileDownloaderService(static_cast<Profile*>(profile)); -} -
diff --git a/chrome/browser/supervised_user/legacy/custodian_profile_downloader_service_factory.h b/chrome/browser/supervised_user/legacy/custodian_profile_downloader_service_factory.h deleted file mode 100644 index 90181433..0000000 --- a/chrome/browser/supervised_user/legacy/custodian_profile_downloader_service_factory.h +++ /dev/null
@@ -1,33 +0,0 @@ -// Copyright 2014 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef CHROME_BROWSER_SUPERVISED_USER_LEGACY_CUSTODIAN_PROFILE_DOWNLOADER_SERVICE_FACTORY_H_ -#define CHROME_BROWSER_SUPERVISED_USER_LEGACY_CUSTODIAN_PROFILE_DOWNLOADER_SERVICE_FACTORY_H_ - -#include "base/memory/singleton.h" -#include "components/keyed_service/content/browser_context_keyed_service_factory.h" - -class CustodianProfileDownloaderService; -class Profile; - -class CustodianProfileDownloaderServiceFactory - : public BrowserContextKeyedServiceFactory { - public: - static CustodianProfileDownloaderService* GetForProfile(Profile* profile); - - static CustodianProfileDownloaderServiceFactory* GetInstance(); - - private: - friend struct base::DefaultSingletonTraits< - CustodianProfileDownloaderServiceFactory>; - - CustodianProfileDownloaderServiceFactory(); - ~CustodianProfileDownloaderServiceFactory() override; - - // BrowserContextKeyedServiceFactory: - KeyedService* BuildServiceInstanceFor( - content::BrowserContext* profile) const override; -}; - -#endif // CHROME_BROWSER_SUPERVISED_USER_LEGACY_CUSTODIAN_PROFILE_DOWNLOADER_SERVICE_FACTORY_H_
diff --git a/chrome/browser/supervised_user/supervised_user_service_unittest.cc b/chrome/browser/supervised_user/supervised_user_service_unittest.cc index ae00f50..ab14800 100644 --- a/chrome/browser/supervised_user/supervised_user_service_unittest.cc +++ b/chrome/browser/supervised_user/supervised_user_service_unittest.cc
@@ -22,8 +22,6 @@ #include "chrome/browser/chrome_notification_types.h" #include "chrome/browser/profiles/profile.h" #include "chrome/browser/signin/identity_test_environment_profile_adaptor.h" -#include "chrome/browser/supervised_user/legacy/custodian_profile_downloader_service.h" -#include "chrome/browser/supervised_user/legacy/custodian_profile_downloader_service_factory.h" #include "chrome/browser/supervised_user/permission_request_creator.h" #include "chrome/browser/supervised_user/supervised_user_features.h" #include "chrome/browser/supervised_user/supervised_user_service_factory.h" @@ -34,7 +32,6 @@ #include "chrome/test/base/testing_profile.h" #include "components/prefs/pref_service.h" #include "components/prefs/scoped_user_pref_update.h" -#include "components/signin/public/identity_manager/identity_test_environment.h" #include "components/version_info/version_info.h" #include "content/public/test/browser_task_environment.h" #include "content/public/test/test_utils.h" @@ -58,12 +55,6 @@ namespace { -#if !defined(OS_ANDROID) -void OnProfileDownloadedFail(const base::string16& full_name) { - ASSERT_TRUE(false) << "Profile download should not have succeeded."; -} -#endif - // Base class for helper objects that wait for certain events to happen. // This class will ensure that calls to QuitRunLoop() (triggered by a subclass) // are balanced with Wait() calls. @@ -206,10 +197,6 @@ base::Unretained(result_holder))); } - signin::IdentityTestEnvironment* identity_test_env() { - return identity_test_environment_adaptor_->identity_test_env(); - } - std::unique_ptr<IdentityTestEnvironmentProfileAdaptor> identity_test_environment_adaptor_; content::BrowserTaskEnvironment task_environment_; @@ -219,22 +206,6 @@ } // namespace -#if !defined(OS_ANDROID) -// Ensure that the CustodianProfileDownloaderService shuts down cleanly. If no -// DCHECK is hit when the service is destroyed, this test passed. -TEST_F(SupervisedUserServiceTest, ShutDownCustodianProfileDownloader) { - CustodianProfileDownloaderService* downloader_service = - CustodianProfileDownloaderServiceFactory::GetForProfile(profile_.get()); - - // Emulate being logged in, then start to download a profile so a - // ProfileDownloader gets created. - identity_test_env()->MakeUnconsentedPrimaryAccountAvailable( - "logged_in@gmail.com"); - - downloader_service->DownloadProfile(base::Bind(&OnProfileDownloadedFail)); -} -#endif - namespace { class MockPermissionRequestCreator : public PermissionRequestCreator {
diff --git a/chrome/browser/ui/android/strings/android_chrome_strings.grd b/chrome/browser/ui/android/strings/android_chrome_strings.grd index c840334..6d35bcf8 100644 --- a/chrome/browser/ui/android/strings/android_chrome_strings.grd +++ b/chrome/browser/ui/android/strings/android_chrome_strings.grd
@@ -251,7 +251,6 @@ <message name="IDS_NOTIFICATION_CATEGORY_ANNOUNCEMENT" desc="Label for announcements notifications, within a list of notification categories. [CHAR-LIMIT=32]"> Announcements </message> - <message name="IDS_NOTIFICATION_CATEGORY_PERMISSION_REQUESTS" desc="Label for permission requests, within a list of notification categories. [CHAR-LIMIT=32]"> Permission requests </message> @@ -3970,6 +3969,26 @@ <message name="IDS_LITE_MODE_HTTPS_IMAGE_COMPRESSION_SETTINGS_LINK" desc="This link opens the Lite Mode settings page to explain the feature and configure the settings."> Manage </message> + + <!-- Browser Promo Notification Strings --> + <message name="IDS_CHROME_REENGAGEMENT_NOTIFICATION_1_TITLE" desc="The title of a notification shown to suggest that users use Chrome. Users probably have not opened Chrome in a while. Promotes relevant articles Chrome has."> + Read today's news <ph name="NEWS_ICON">📰</ph> + </message> + <message name="IDS_CHROME_REENGAGEMENT_NOTIFICATION_1_DESCRIPTION" desc="The body text of a notification shown to suggest that users use Chrome. Users probably have not opened Chrome in a while. Promotes relevant articles Chrome has."> + Articles on your interests on Chrome + </message> + <message name="IDS_CHROME_REENGAGEMENT_NOTIFICATION_2_TITLE" desc="The title of a notification shown to suggest that users use Chrome. Users probably have not opened Chrome in a while. Promotes data savings."> + Save up to 60% data + </message> + <message name="IDS_CHROME_REENGAGEMENT_NOTIFICATION_2_DESCRIPTION" desc="The body text of a notification shown to suggest that users use Chrome. Users probably have not opened Chrome in a while. Promotes data savings."> + Use Lite mode on Google Chrome + </message> + <message name="IDS_CHROME_REENGAGEMENT_NOTIFICATION_3_TITLE" desc="The title of a notification shown to suggest that users use Chrome. Users probably have not opened Chrome in a while."> + Google recommends Chrome + </message> + <message name="IDS_CHROME_REENGAGEMENT_NOTIFICATION_3_DESCRIPTION" desc="The title of a notification shown to suggest that users use Chrome. Users probably have not opened Chrome in a while. Promotes data savings and relevant news."> + Save up to 60% data, read today's news + </message> </messages> </release> </grit>
diff --git a/chrome/browser/ui/android/strings/android_chrome_strings_grd/IDS_CHROME_REENGAGEMENT_NOTIFICATION_1_DESCRIPTION.png.sha1 b/chrome/browser/ui/android/strings/android_chrome_strings_grd/IDS_CHROME_REENGAGEMENT_NOTIFICATION_1_DESCRIPTION.png.sha1 new file mode 100644 index 0000000..7788a78 --- /dev/null +++ b/chrome/browser/ui/android/strings/android_chrome_strings_grd/IDS_CHROME_REENGAGEMENT_NOTIFICATION_1_DESCRIPTION.png.sha1
@@ -0,0 +1 @@ +b3dbd1f71c8a6fc1ef577635f1911408f199e454 \ No newline at end of file
diff --git a/chrome/browser/ui/android/strings/android_chrome_strings_grd/IDS_CHROME_REENGAGEMENT_NOTIFICATION_1_TITLE.png.sha1 b/chrome/browser/ui/android/strings/android_chrome_strings_grd/IDS_CHROME_REENGAGEMENT_NOTIFICATION_1_TITLE.png.sha1 new file mode 100644 index 0000000..7788a78 --- /dev/null +++ b/chrome/browser/ui/android/strings/android_chrome_strings_grd/IDS_CHROME_REENGAGEMENT_NOTIFICATION_1_TITLE.png.sha1
@@ -0,0 +1 @@ +b3dbd1f71c8a6fc1ef577635f1911408f199e454 \ No newline at end of file
diff --git a/chrome/browser/ui/android/strings/android_chrome_strings_grd/IDS_CHROME_REENGAGEMENT_NOTIFICATION_2_DESCRIPTION.png.sha1 b/chrome/browser/ui/android/strings/android_chrome_strings_grd/IDS_CHROME_REENGAGEMENT_NOTIFICATION_2_DESCRIPTION.png.sha1 new file mode 100644 index 0000000..491b792 --- /dev/null +++ b/chrome/browser/ui/android/strings/android_chrome_strings_grd/IDS_CHROME_REENGAGEMENT_NOTIFICATION_2_DESCRIPTION.png.sha1
@@ -0,0 +1 @@ +5dd70faf0f331c14946b65f4a4bfe1bc162dab8c \ No newline at end of file
diff --git a/chrome/browser/ui/android/strings/android_chrome_strings_grd/IDS_CHROME_REENGAGEMENT_NOTIFICATION_2_TITLE.png.sha1 b/chrome/browser/ui/android/strings/android_chrome_strings_grd/IDS_CHROME_REENGAGEMENT_NOTIFICATION_2_TITLE.png.sha1 new file mode 100644 index 0000000..491b792 --- /dev/null +++ b/chrome/browser/ui/android/strings/android_chrome_strings_grd/IDS_CHROME_REENGAGEMENT_NOTIFICATION_2_TITLE.png.sha1
@@ -0,0 +1 @@ +5dd70faf0f331c14946b65f4a4bfe1bc162dab8c \ No newline at end of file
diff --git a/chrome/browser/ui/android/strings/android_chrome_strings_grd/IDS_CHROME_REENGAGEMENT_NOTIFICATION_3_DESCRIPTION.png.sha1 b/chrome/browser/ui/android/strings/android_chrome_strings_grd/IDS_CHROME_REENGAGEMENT_NOTIFICATION_3_DESCRIPTION.png.sha1 new file mode 100644 index 0000000..09ef35c --- /dev/null +++ b/chrome/browser/ui/android/strings/android_chrome_strings_grd/IDS_CHROME_REENGAGEMENT_NOTIFICATION_3_DESCRIPTION.png.sha1
@@ -0,0 +1 @@ +ccca44d9cc78c3740be0fd0614cba89b3560a3fa \ No newline at end of file
diff --git a/chrome/browser/ui/android/strings/android_chrome_strings_grd/IDS_CHROME_REENGAGEMENT_NOTIFICATION_3_TITLE.png.sha1 b/chrome/browser/ui/android/strings/android_chrome_strings_grd/IDS_CHROME_REENGAGEMENT_NOTIFICATION_3_TITLE.png.sha1 new file mode 100644 index 0000000..09ef35c --- /dev/null +++ b/chrome/browser/ui/android/strings/android_chrome_strings_grd/IDS_CHROME_REENGAGEMENT_NOTIFICATION_3_TITLE.png.sha1
@@ -0,0 +1 @@ +ccca44d9cc78c3740be0fd0614cba89b3560a3fa \ No newline at end of file
diff --git a/chrome/browser/ui/app_list/arc/arc_app_utils.cc b/chrome/browser/ui/app_list/arc/arc_app_utils.cc index f31ebef..378134d 100644 --- a/chrome/browser/ui/app_list/arc/arc_app_utils.cc +++ b/chrome/browser/ui/app_list/arc/arc_app_utils.cc
@@ -709,16 +709,6 @@ return arc_prefs->GetAppIdByPackageName(package_name); } -bool IsArcAppSticky(const std::string& app_id, Profile* profile) { - ArcAppListPrefs* arc_prefs = ArcAppListPrefs::Get(profile); - std::unique_ptr<ArcAppListPrefs::AppInfo> app_info = - arc_prefs->GetApp(app_id); - - DCHECK(app_info) << "Couldn't retrieve ARC package name for AppID: " - << app_id; - return app_info->sticky; -} - void AddAppLaunchObserver(content::BrowserContext* context, AppLaunchObserver* observer) { class ProfileDestroyedObserver : public ProfileObserver {
diff --git a/chrome/browser/ui/app_list/arc/arc_app_utils.h b/chrome/browser/ui/app_list/arc/arc_app_utils.h index 5f07e25..3384e31c 100644 --- a/chrome/browser/ui/app_list/arc/arc_app_utils.h +++ b/chrome/browser/ui/app_list/arc/arc_app_utils.h
@@ -210,11 +210,6 @@ std::string ArcPackageNameToAppId(const std::string& package_name, Profile* profile); -// Returns true if the ARC app is sticky (not uninstallable). This function -// will DCHECK if app_id isn't installed. This functionality should eventually -// move to the App Service: (https://crbug.com/948408). -bool IsArcAppSticky(const std::string& app_id, Profile* profile); - // Add/remove an observer to be notified of app launches. void AddAppLaunchObserver(content::BrowserContext* context, AppLaunchObserver* observer);
diff --git a/chrome/browser/ui/ash/ambient/ambient_client_impl.cc b/chrome/browser/ui/ash/ambient/ambient_client_impl.cc index a501a47..770f3086 100644 --- a/chrome/browser/ui/ash/ambient/ambient_client_impl.cc +++ b/chrome/browser/ui/ash/ambient/ambient_client_impl.cc
@@ -24,6 +24,7 @@ #include "components/user_manager/user.h" #include "components/user_manager/user_manager.h" #include "content/public/browser/device_service.h" +#include "google_apis/gaia/gaia_auth_util.h" #include "google_apis/gaia/google_service_auth_error.h" #include "services/network/public/cpp/shared_url_loader_factory.h" @@ -37,12 +38,41 @@ return user_manager::UserManager::Get()->GetActiveUser(); } +const user_manager::User* GetPrimaryUser() { + return user_manager::UserManager::Get()->GetPrimaryUser(); +} + Profile* GetProfileForActiveUser() { const user_manager::User* const active_user = GetActiveUser(); DCHECK(active_user); return chromeos::ProfileHelper::Get()->GetProfileByUser(active_user); } +bool IsPrimaryUser() { + return GetActiveUser() == GetPrimaryUser(); +} + +bool HasPrimaryAccount(const Profile* profile) { + auto* identity_manager = + IdentityManagerFactory::GetForProfileIfExists(profile); + if (!identity_manager) + return false; + + return identity_manager->HasPrimaryAccount( + signin::ConsentLevel::kNotRequired); +} + +bool IsEmailDomainSupported(const user_manager::User* user) { + const std::string email = user->GetAccountId().GetUserEmail(); + DCHECK(!email.empty()); + + constexpr char kGmailDomain[] = "gmail.com"; + constexpr char kGooglemailDomain[] = "googlemail.com"; + return (gaia::ExtractDomainName(email) == kGmailDomain || + gaia::ExtractDomainName(email) == kGooglemailDomain || + gaia::IsGoogleInternalAccountEmail(email)); +} + } // namespace AmbientClientImpl::AmbientClientImpl() = default; @@ -59,14 +89,19 @@ if (!active_user || !active_user->HasGaiaAccount()) return false; + if (!IsPrimaryUser()) + return false; + + if (!IsEmailDomainSupported(active_user)) + return false; + auto* profile = GetProfileForActiveUser(); if (!profile) return false; - if (!profile->GetPrefs()->GetBoolean( - ash::ambient::prefs::kAmbientModeEnabled)) { + // Primary account might be missing during unittests. + if (!HasPrimaryAccount(profile)) return false; - } if (!profile->IsRegularProfile()) return false;
diff --git a/chrome/browser/ui/ash/ambient/ambient_client_impl_unittest.cc b/chrome/browser/ui/ash/ambient/ambient_client_impl_unittest.cc new file mode 100644 index 0000000..f607f6b --- /dev/null +++ b/chrome/browser/ui/ash/ambient/ambient_client_impl_unittest.cc
@@ -0,0 +1,119 @@ +// 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/ash/ambient/ambient_client_impl.h" + +#include <memory> + +#include "ash/public/cpp/ambient/ambient_client.h" +#include "base/strings/utf_string_conversions.h" +#include "base/test/scoped_feature_list.h" +#include "chrome/browser/chromeos/login/users/fake_chrome_user_manager.h" +#include "chrome/browser/chromeos/profiles/profile_helper.h" +#include "chrome/browser/signin/identity_test_environment_profile_adaptor.h" +#include "chrome/test/base/chrome_ash_test_base.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 "chromeos/constants/chromeos_features.h" +#include "components/user_manager/scoped_user_manager.h" + +constexpr char kTestProfileName[] = "user@gmail.com"; +constexpr char kTestGaiaId[] = "1234567890"; + +class AmbientClientImplTest : public ChromeAshTestBase { + public: + AmbientClientImplTest() = default; + ~AmbientClientImplTest() override = default; + + void SetUp() override { + scoped_feature_list_.InitAndEnableFeature( + chromeos::features::kAmbientModeFeature); + AshTestBase::SetUp(); + + ASSERT_TRUE(data_dir_.CreateUniqueTempDir()); + profile_manager_ = std::make_unique<TestingProfileManager>( + TestingBrowserProcess::GetGlobal()); + ASSERT_TRUE(profile_manager_->SetUp()); + + profile_ = profile_manager_->CreateTestingProfile( + kTestProfileName, /*prefs=*/{}, base::UTF8ToUTF16(kTestProfileName), + /*avatar_id=*/0, /*supervised_user_id=*/{}, + IdentityTestEnvironmentProfileAdaptor:: + GetIdentityTestEnvironmentFactories()); + identity_test_env_adaptor_ = + std::make_unique<IdentityTestEnvironmentProfileAdaptor>(profile_); + user_manager_enabler_ = std::make_unique<user_manager::ScopedUserManager>( + std::make_unique<chromeos::FakeChromeUserManager>()); + ambient_client_ = std::make_unique<AmbientClientImpl>(); + } + + void TearDown() override { + ambient_client_.reset(); + user_manager_enabler_.reset(); + identity_test_env_adaptor_.reset(); + profile_ = nullptr; + profile_manager_->DeleteTestingProfile(kTestProfileName); + profile_manager_.reset(); + AshTestBase::TearDown(); + } + + protected: + TestingProfile* profile() { return profile_; } + + chromeos::FakeChromeUserManager* GetFakeUserManager() const { + return static_cast<chromeos::FakeChromeUserManager*>( + user_manager::UserManager::Get()); + } + + void AddAndLoginUser(const AccountId& account_id) { + GetFakeUserManager()->AddUser(account_id); + GetFakeUserManager()->LoginUser(account_id); + GetFakeUserManager()->SwitchActiveUser(account_id); + MaybeMakeAccountAsPrimaryAccount(account_id); + } + + private: + signin::IdentityTestEnvironment* identity_test_env() { + return identity_test_env_adaptor_->identity_test_env(); + } + + void MaybeMakeAccountAsPrimaryAccount(const AccountId& account_id) { + if (!identity_test_env()->identity_manager()->HasPrimaryAccount( + signin::ConsentLevel::kNotRequired)) { + identity_test_env()->MakeUnconsentedPrimaryAccountAvailable( + account_id.GetUserEmail()); + } + } + + base::test::ScopedFeatureList scoped_feature_list_; + base::ScopedTempDir data_dir_; + std::unique_ptr<TestingProfileManager> profile_manager_; + // Owned by |profile_manager_| + TestingProfile* profile_ = nullptr; + std::unique_ptr<IdentityTestEnvironmentProfileAdaptor> + identity_test_env_adaptor_; + std::unique_ptr<user_manager::ScopedUserManager> user_manager_enabler_; + std::unique_ptr<AmbientClientImpl> ambient_client_; +}; + +TEST_F(AmbientClientImplTest, AllowedByPrimaryUser) { + AddAndLoginUser(AccountId::FromUserEmailGaiaId( + profile()->GetProfileUserName(), kTestGaiaId)); + EXPECT_TRUE(ash::AmbientClient::Get()->IsAmbientModeAllowed()); +} + +TEST_F(AmbientClientImplTest, DisallowedByNonPrimaryUser) { + AddAndLoginUser( + AccountId::FromUserEmailGaiaId("user2@gmail.com", kTestGaiaId)); + AddAndLoginUser(AccountId::FromUserEmailGaiaId( + profile()->GetProfileUserName(), kTestGaiaId)); + EXPECT_FALSE(ash::AmbientClient::Get()->IsAmbientModeAllowed()); +} + +TEST_F(AmbientClientImplTest, DisallowedByEmailDomain) { + AddAndLoginUser( + AccountId::FromUserEmailGaiaId("user@gmailtest.com", kTestGaiaId)); + EXPECT_FALSE(ash::AmbientClient::Get()->IsAmbientModeAllowed()); +}
diff --git a/chrome/browser/ui/ash/clipboard_history_browsertest.cc b/chrome/browser/ui/ash/clipboard_history_browsertest.cc index acda4e9..676b80c 100644 --- a/chrome/browser/ui/ash/clipboard_history_browsertest.cc +++ b/chrome/browser/ui/ash/clipboard_history_browsertest.cc
@@ -15,6 +15,8 @@ #include "components/user_manager/user_manager.h" #include "content/public/test/browser_test.h" #include "ui/base/clipboard/scoped_clipboard_writer.h" +#include "ui/events/test/event_generator.h" +#include "ui/views/controls/menu/menu_config.h" namespace { @@ -28,13 +30,42 @@ base::RunLoop().RunUntilIdle(); } -const std::list<ui::ClipboardData>& GetClipboardData() { - return ash::Shell::Get() - ->clipboard_history_controller() - ->clipboard_history() - ->GetItems(); +ash::ClipboardHistoryController* GetClipboardHistoryController() { + return ash::Shell::Get()->clipboard_history_controller(); } +const std::list<ui::ClipboardData>& GetClipboardData() { + return GetClipboardHistoryController()->clipboard_history()->GetItems(); +} + +gfx::Rect GetClipboardHistoryMenuScreenBounds() { + return GetClipboardHistoryController() + ->GetClipboardHistoryMenuBoundsForTest(); +} + +class ClipboardTestHelper { + public: + ClipboardTestHelper() = default; + ~ClipboardTestHelper() = default; + + void Init() { + event_generator_ = std::make_unique<ui::test::EventGenerator>( + ash::Shell::GetPrimaryRootWindow()); + } + + ui::test::EventGenerator* event_generator() { return event_generator_.get(); } + + void ShowContextMenuViaAccelerator() { + event_generator_->PressKey(ui::KeyboardCode::VKEY_COMMAND, ui::EF_NONE); + event_generator_->PressKey(ui::KeyboardCode::VKEY_V, ui::EF_COMMAND_DOWN); + event_generator_->ReleaseKey(ui::KeyboardCode::VKEY_V, ui::EF_COMMAND_DOWN); + event_generator_->ReleaseKey(ui::KeyboardCode::VKEY_COMMAND, ui::EF_NONE); + } + + private: + std::unique_ptr<ui::test::EventGenerator> event_generator_; +}; + } // namespace // Verify clipboard history's features in the multiprofile environment. @@ -51,11 +82,28 @@ ~ClipboardHistoryWithMultiProfileBrowserTest() override = default; + ui::test::EventGenerator* GetEventGenerator() { + return test_helper_->event_generator(); + } + protected: + void ShowContextMenuViaAccelerator() { + test_helper_->ShowContextMenuViaAccelerator(); + } + + void SetUpOnMainThread() override { + chromeos::LoginManagerTest::SetUpOnMainThread(); + + test_helper_ = std::make_unique<ClipboardTestHelper>(); + test_helper_->Init(); + } + AccountId account_id1_; AccountId account_id2_; chromeos::LoginManagerMixin login_mixin_{&mixin_host_}; + std::unique_ptr<ClipboardTestHelper> test_helper_; + base::test::ScopedFeatureList feature_list_; }; @@ -111,3 +159,33 @@ EXPECT_EQ(copypaste_data1, it->text()); } } + +// Verifies that the history menu is anchored at the cursor's location when +// not having any textfield. +IN_PROC_BROWSER_TEST_F(ClipboardHistoryWithMultiProfileBrowserTest, + ShowHistoryMenuWhenNoTextfieldExists) { + LoginUser(account_id1_); + + // Close the browser window to ensure that textfield does not exist. + CloseAllBrowsers(); + + // No clipboard data. So the clipboard history menu should not show. + ASSERT_TRUE(GetClipboardData().empty()); + ShowContextMenuViaAccelerator(); + EXPECT_FALSE(GetClipboardHistoryController()->IsMenuShowing()); + + SetClipboardText("test"); + + const gfx::Point mouse_location = + ash::Shell::Get()->GetPrimaryRootWindow()->bounds().CenterPoint(); + GetEventGenerator()->MoveMouseTo(mouse_location); + ShowContextMenuViaAccelerator(); + + // Verifies that the menu is anchored at the cursor's location. + ASSERT_TRUE(GetClipboardHistoryController()->IsMenuShowing()); + const gfx::Point menu_origin = GetClipboardHistoryMenuScreenBounds().origin(); + EXPECT_EQ(mouse_location.x() + + views::MenuConfig::instance().touchable_anchor_offset, + menu_origin.x()); + EXPECT_EQ(mouse_location.y(), menu_origin.y()); +}
diff --git a/chrome/browser/ui/views/download/download_item_view.cc b/chrome/browser/ui/views/download/download_item_view.cc index 6c73e4e..3d66176 100644 --- a/chrome/browser/ui/views/download/download_item_view.cc +++ b/chrome/browser/ui/views/download/download_item_view.cc
@@ -268,6 +268,7 @@ file_name_label->GetViewAccessibility().OverrideIsIgnored(true); const base::string16 filename = ElidedFilename(*file_name_label); file_name_label->SetText(filename); + file_name_label->set_can_process_events_within_subtree(false); file_name_label_ = AddChildView(std::move(file_name_label)); auto status_label = std::make_unique<views::Label>(
diff --git a/chrome/browser/ui/views/omnibox/omnibox_view_views.cc b/chrome/browser/ui/views/omnibox/omnibox_view_views.cc index 2a9b619..6e74d1a4 100644 --- a/chrome/browser/ui/views/omnibox/omnibox_view_views.cc +++ b/chrome/browser/ui/views/omnibox/omnibox_view_views.cc
@@ -140,6 +140,22 @@ ->IsMarkedByOriginatorAsConfidential(); } +// Draws a rectangle of dimensions and position |rect| in |canvas|, colored +// with a gradient from |start_color| to |end_color|. +void DrawGradientRect(const gfx::Rect& rect, + SkColor start_color, + SkColor end_color, + gfx::Canvas* canvas) { + SkColor colors[2] = {start_color, end_color}; + SkPoint points[2]; + points[0].iset(rect.origin().x(), rect.origin().y()); + points[1].iset(rect.right(), rect.y()); + cc::PaintFlags flags; + flags.setShader(cc::PaintShader::MakeLinearGradient(points, colors, nullptr, + 2, SkTileMode::kClamp)); + canvas->DrawRect(rect, flags); +} + } // namespace OmniboxViewViews::ElideAnimation::ElideAnimation(OmniboxViewViews* view, @@ -157,13 +173,30 @@ void OmniboxViewViews::ElideAnimation::Start( const gfx::Range& elide_to_bounds, uint32_t delay_ms, - const std::vector<gfx::Range>& ranges_to_color, + const std::vector<gfx::Range>& ranges_surrounding_simplified_domain, SkColor starting_color, SkColor ending_color) { - ranges_to_color_ = ranges_to_color; + DCHECK(ranges_surrounding_simplified_domain.size() == 1 || + ranges_surrounding_simplified_domain.size() == 2); + ranges_surrounding_simplified_domain_ = ranges_surrounding_simplified_domain; starting_color_ = starting_color; ending_color_ = ending_color; + // simplified_domain_bounds_ will be set to a rectangle surrounding the part + // of the URL that is never elided, on its original position before any + // animation runs. If ranges_surrounding_simplified_domain_ only contains one + // range it means we are not eliding on the right side, so we use the right + // side of elide_to_bounds as the range as it will always be the right limit + // of the simplified section. + gfx::Range simplified_domain_range( + ranges_surrounding_simplified_domain_[0].end(), + ranges_surrounding_simplified_domain_.size() == 2 + ? ranges_surrounding_simplified_domain_[1].start() + : elide_to_bounds.end()); + for (auto rect : render_text_->GetSubstringBounds(simplified_domain_range)) { + simplified_domain_bounds_.Union(rect - render_text_->GetLineOffset(0)); + } + // After computing |elide_to_rect_| below, |elide_to_bounds| aren't actually // need anymore for the animation. However, the bounds provide a convenient // way for the animation consumer to check if an animation is currently in @@ -248,15 +281,35 @@ gfx::Rect shifted_bounds(old_bounds.x(), old_bounds.y(), bounds.width(), old_bounds.height()); render_text_->SetDisplayRect(shifted_bounds); + current_offset_ = gfx::Tween::IntValueBetween(animation->GetCurrentValue(), + starting_display_offset_, + ending_display_offset_); + render_text_->SetDisplayOffset(current_offset_); - render_text_->SetDisplayOffset(gfx::Tween::IntValueBetween( - animation->GetCurrentValue(), starting_display_offset_, - ending_display_offset_)); - - for (const auto& range : ranges_to_color_) { + for (const auto& range : ranges_surrounding_simplified_domain_) { view_->ApplyColor(GetCurrentColor(), range); } + // The gradient mask should be a fixed width, except if that width would + // cause it to mask the unelided section. In that case we set it to the + // maximum width possible that won't cover the unelided section. + int unelided_left_bound = simplified_domain_bounds_.x() + current_offset_; + int unelided_right_bound = + unelided_left_bound + simplified_domain_bounds_.width(); + int left_gradient_width = kSmoothingGradientMaxWidth < unelided_left_bound + ? kSmoothingGradientMaxWidth + : unelided_left_bound; + int right_gradient_width = + shifted_bounds.right() - kSmoothingGradientMaxWidth > unelided_right_bound + ? kSmoothingGradientMaxWidth + : shifted_bounds.right() - unelided_right_bound; + + view_->elide_animation_smoothing_rect_left_ = gfx::Rect( + old_bounds.x(), old_bounds.y(), left_gradient_width, old_bounds.height()); + view_->elide_animation_smoothing_rect_right_ = + gfx::Rect(shifted_bounds.right() - right_gradient_width, old_bounds.y(), + right_gradient_width, old_bounds.height()); + view_->SchedulePaint(); } @@ -615,6 +668,22 @@ SCOPED_UMA_HISTOGRAM_TIMER("Omnibox.PaintTime"); Textfield::OnPaint(canvas); } + if ((hover_elide_or_unelide_animation_ && + hover_elide_or_unelide_animation_->IsAnimating()) || + (elide_after_web_contents_interaction_animation_ && + elide_after_web_contents_interaction_animation_->IsAnimating())) { + SkColor bg_color = GetBackgroundColor(); + // We can't use the SK_ColorTRANSPARENT constant here because for purposes + // of the gradient the R,G,B values of the transparent color do matter, and + // need to be identical to the background color (SK_ColorTRANSPARENT is a + // transparent black, and results in the gradient looking gray). + SkColor bg_transparent = SkColorSetARGB( + 0, SkColorGetR(bg_color), SkColorGetG(bg_color), SkColorGetB(bg_color)); + DrawGradientRect(elide_animation_smoothing_rect_left_, bg_color, + bg_transparent, canvas); + DrawGradientRect(elide_animation_smoothing_rect_right_, bg_transparent, + bg_color, canvas); + } } void OmniboxViewViews::ExecuteCommand(int command_id, int event_flags) { @@ -2280,10 +2349,10 @@ base::string16 text = GetText(); url::Component host = GetHostComponentAfterTrivialSubdomain(); - ranges_surrounding_simplified_domain->emplace_back(host.end(), text.size()); if (!OmniboxFieldTrial::ShouldElideToRegistrableDomain()) { ranges_surrounding_simplified_domain->emplace_back(0, host.begin); + ranges_surrounding_simplified_domain->emplace_back(host.end(), text.size()); return gfx::Range(host.begin, host.end()); } @@ -2295,6 +2364,7 @@ if (simplified_domain.empty()) { ranges_surrounding_simplified_domain->emplace_back(0, host.begin); + ranges_surrounding_simplified_domain->emplace_back(host.end(), text.size()); return gfx::Range(host.begin, host.end()); } @@ -2302,6 +2372,7 @@ text.find(base::ASCIIToUTF16(simplified_domain)); DCHECK_NE(simplified_domain_pos, std::string::npos); ranges_surrounding_simplified_domain->emplace_back(0, simplified_domain_pos); + ranges_surrounding_simplified_domain->emplace_back(host.end(), text.size()); return gfx::Range(simplified_domain_pos, host.end()); }
diff --git a/chrome/browser/ui/views/omnibox/omnibox_view_views.h b/chrome/browser/ui/views/omnibox/omnibox_view_views.h index 6ff5794..1fa2082 100644 --- a/chrome/browser/ui/views/omnibox/omnibox_view_views.h +++ b/chrome/browser/ui/views/omnibox/omnibox_view_views.h
@@ -21,6 +21,7 @@ #include "components/search_engines/template_url_service.h" #include "components/search_engines/template_url_service_observer.h" #include "content/public/browser/web_contents_observer.h" +#include "third_party/skia/include/core/SkColor.h" #include "ui/base/window_open_disposition.h" #include "ui/compositor/compositor.h" #include "ui/compositor/compositor_observer.h" @@ -71,6 +72,9 @@ static const int kMaxSendTabToSelfSubMenuCommandId = send_tab_to_self::SendTabToSelfSubMenuModel::kMaxCommandId; + // Max width of the gradient mask used to smooth ElideAnimation edges. + static const int kSmoothingGradientMaxWidth = 15; + OmniboxViewViews(OmniboxEditController* controller, std::unique_ptr<OmniboxClient> client, bool popup_window_mode, @@ -198,6 +202,7 @@ SameDocNavigations); FRIEND_TEST_ALL_PREFIXES(OmniboxViewViewsHideOnInteractionTest, SameDocNavigationDuringAnimation); + FRIEND_TEST_ALL_PREFIXES(OmniboxViewViewsHideOnInteractionTest, GradientMask); FRIEND_TEST_ALL_PREFIXES(OmniboxViewViewsHideOnInteractionTest, UserInteractionDuringAnimation); FRIEND_TEST_ALL_PREFIXES(OmniboxViewViewsHideOnInteractionTest, @@ -242,13 +247,18 @@ ~ElideAnimation() override; // Begin the elision animation targeting |elide_to_bounds|, after a delay of - // |delay_ms|. As the animation runs, each range in |ranges_to_color| will - // be faded from |starting_color| to |ending_color|. - void Start(const gfx::Range& elide_to_bounds, - uint32_t delay_ms, - const std::vector<gfx::Range>& ranges_to_color, - SkColor starting_color, - SkColor ending_color); + // |delay_ms|. |ranges_surrounding_simplified_domain| should contain 1 or 2 + // ranges surrounding the simplified domain part, they should be in order + // (i.e. the range on the left should be the first element). If only one + // element is set, it will be assumed we are only eliding from the left + // side. Those ranges will be faded from |starting_color| to + // |ending_color|. + void Start( + const gfx::Range& elide_to_bounds, + uint32_t delay_ms, + const std::vector<gfx::Range>& ranges_surrounding_simplified_domain, + SkColor starting_color, + SkColor ending_color); void Stop(); @@ -260,13 +270,16 @@ const gfx::Range& GetElideToBounds() const; // Returns the current color applied to each of the ranges in - // |ranges_to_color| passed in to Start(), if the animation is running or - // has completed running. Returns gfx::kPlaceholderColor if the animation - // has not starting running yet. + // |ranges_surrounding_simplified_domain| passed in to Start(), if the + // animation is running or has completed running. + // Returns gfx::kPlaceholderColor if the animation has not starting + // running yet. SkColor GetCurrentColor() const; gfx::MultiAnimation* GetAnimationForTesting(); + int GetCurrentOffsetForTesting() { return current_offset_; } + // views::AnimationDelegateViews: void AnimationProgressed(const gfx::Animation* animation) override; void AnimationEnded(const gfx::Animation* animation) override; @@ -284,13 +297,18 @@ gfx::Rect elide_to_rect_; // The starting display rect from which we are eliding or uneliding. gfx::Rect elide_from_rect_; + // The display rect surrounding the simplified domain. + gfx::Rect simplified_domain_bounds_; // The starting and ending display offsets for |render_text_|. int starting_display_offset_ = 0; int ending_display_offset_ = 0; - // As the animation runs, each range in |ranges_to_color_| fades from - // |starting_color_| to |ending_color_|. - std::vector<gfx::Range> ranges_to_color_; + // The current offset, exposed for testing. + int current_offset_; + + // Holds the ranges surrounding the simplified domain part. As the animation + // runs, each range fades from |starting_color_| to |ending_color_|. + std::vector<gfx::Range> ranges_surrounding_simplified_domain_; SkColor starting_color_; SkColor ending_color_; @@ -525,6 +543,11 @@ std::unique_ptr<ElideAnimation> elide_after_web_contents_interaction_animation_; + // If set, rectangles will be drawn as gradient masks over the omnibox text. + // Used to smooth color transition when an ElideAnimation is animating. + gfx::Rect elide_animation_smoothing_rect_left_; + gfx::Rect elide_animation_smoothing_rect_right_; + // Selection persisted across temporary text changes, like popup suggestions. std::vector<gfx::Range> saved_temporary_selection_;
diff --git a/chrome/browser/ui/views/omnibox/omnibox_view_views_unittest.cc b/chrome/browser/ui/views/omnibox/omnibox_view_views_unittest.cc index 821e2ca..d6bbb28 100644 --- a/chrome/browser/ui/views/omnibox/omnibox_view_views_unittest.cc +++ b/chrome/browser/ui/views/omnibox/omnibox_view_views_unittest.cc
@@ -2424,6 +2424,75 @@ render_text, kSimplifiedDomainDisplayUrl, path_bounds)); } +// Tests that gradient mask is set correctly. +TEST_P(OmniboxViewViewsHideOnInteractionTest, GradientMask) { + SetUpSimplifiedDomainTest(); + gfx::RenderText* render_text = omnibox_view()->GetRenderText(); + + content::MockNavigationHandle navigation; + navigation.set_is_same_document(false); + omnibox_view()->DidFinishNavigation(&navigation); + ASSERT_NO_FATAL_FAILURE(ExpectUnelidedFromSimplifiedDomain( + render_text, gfx::Range(kSimplifiedDomainDisplayUrlScheme.size(), + kSimplifiedDomainDisplayUrl.size()))); + + // Simulate a user interaction to begin animating to the simplified domain. + omnibox_view()->DidGetUserInteraction(blink::WebKeyboardEvent()); + OmniboxViewViews::ElideAnimation* elide_animation = + omnibox_view()->GetElideAfterInteractionAnimationForTesting(); + ASSERT_TRUE(elide_animation); + EXPECT_TRUE(elide_animation->IsAnimating()); + + // Advance the clock by 1ms until the full size gradient has been added. + gfx::AnimationContainerElement* elide_as_element = + elide_animation->GetAnimationForTesting(); + elide_as_element->SetStartTime(base::TimeTicks()); + uint32_t step = 1; + int max_gradient_width = OmniboxViewViews::kSmoothingGradientMaxWidth; + while (omnibox_view()->elide_animation_smoothing_rect_right_.width() < + max_gradient_width) { + elide_as_element->Step(base::TimeTicks() + + base::TimeDelta::FromMilliseconds(++step)); + } + // If we are eliding from the left, the other side gradient should also be + // full size at this point, otherwise it should be 0. + if (GetParam()) { + EXPECT_EQ(omnibox_view()->elide_animation_smoothing_rect_left_.width(), + max_gradient_width); + } else { + EXPECT_EQ(omnibox_view()->elide_animation_smoothing_rect_left_.width(), 0); + } + + // Get a bounding box for the unelided section of the URL. + std::vector<gfx::Range> ranges_surrounding_simplified_domain; + gfx::Range simplified_range = omnibox_view()->GetSimplifiedDomainBounds( + &ranges_surrounding_simplified_domain); + gfx::Rect simplified_rect; + for (auto rect : render_text->GetSubstringBounds(simplified_range)) { + simplified_rect.Union(rect - render_text->GetLineOffset(0)); + } + + // Advance the animation until both gradients start shrinking. + while (omnibox_view()->elide_animation_smoothing_rect_left_.width() == + max_gradient_width || + omnibox_view()->elide_animation_smoothing_rect_right_.width() == + max_gradient_width) { + elide_as_element->Step(base::TimeTicks() + + base::TimeDelta::FromMilliseconds(++step)); + } + int offset = elide_animation->GetCurrentOffsetForTesting(); + gfx::Rect display_rect = render_text->display_rect(); + // Check the expected size and positions for both gradients. + EXPECT_EQ(omnibox_view()->elide_animation_smoothing_rect_left_.width(), + simplified_rect.x() + offset); + EXPECT_EQ(omnibox_view()->elide_animation_smoothing_rect_left_.x(), + display_rect.x()); + EXPECT_EQ(omnibox_view()->elide_animation_smoothing_rect_right_.width(), + display_rect.right() - (simplified_rect.right() + offset)); + EXPECT_EQ(omnibox_view()->elide_animation_smoothing_rect_right_.x(), + simplified_rect.right() + offset); +} + // Tests that in the hide-on-interaction field trial, a second user interaction // does not interfere with an animation that is currently running. This is // similar to SameDocNavigationDuringAnimation except that this test checks that
diff --git a/chrome/browser/ui/views/tabs/alert_indicator.cc b/chrome/browser/ui/views/tabs/alert_indicator.cc index 92ebcb8..40131ef 100644 --- a/chrome/browser/ui/views/tabs/alert_indicator.cc +++ b/chrome/browser/ui/views/tabs/alert_indicator.cc
@@ -160,7 +160,9 @@ public: explicit FadeAnimationDelegate(AlertIndicator* indicator) : AnimationDelegateViews(indicator), indicator_(indicator) {} - ~FadeAnimationDelegate() override {} + FadeAnimationDelegate(const FadeAnimationDelegate&) = delete; + FadeAnimationDelegate& operator=(const FadeAnimationDelegate&) = delete; + ~FadeAnimationDelegate() override = default; private: // views::AnimationDelegateViews @@ -179,8 +181,6 @@ } AlertIndicator* const indicator_; - - DISALLOW_COPY_AND_ASSIGN(FadeAnimationDelegate); }; AlertIndicator::AlertIndicator(Tab* parent_tab)
diff --git a/chrome/browser/ui/views/tabs/alert_indicator.h b/chrome/browser/ui/views/tabs/alert_indicator.h index 57e35960..24bdc32e 100644 --- a/chrome/browser/ui/views/tabs/alert_indicator.h +++ b/chrome/browser/ui/views/tabs/alert_indicator.h
@@ -7,7 +7,6 @@ #include <memory> -#include "base/macros.h" #include "base/optional.h" #include "chrome/browser/ui/tabs/tab_utils.h" #include "ui/views/controls/image_view.h" @@ -25,6 +24,8 @@ class AlertIndicator : public views::ImageView { public: explicit AlertIndicator(Tab* parent_tab); + AlertIndicator(const AlertIndicator&) = delete; + AlertIndicator& operator=(const AlertIndicator&) = delete; ~AlertIndicator() override; // views::ImageView: @@ -60,8 +61,6 @@ std::unique_ptr<gfx::AnimationDelegate> fade_animation_delegate_; std::unique_ptr<gfx::Animation> fade_animation_; base::Optional<TabAlertState> showing_alert_state_; - - DISALLOW_COPY_AND_ASSIGN(AlertIndicator); }; #endif // CHROME_BROWSER_UI_VIEWS_TABS_ALERT_INDICATOR_H_
diff --git a/chrome/browser/ui/views/tabs/browser_tab_strip_controller.cc b/chrome/browser/ui/views/tabs/browser_tab_strip_controller.cc index 997aa5e..883377f 100644 --- a/chrome/browser/ui/views/tabs/browser_tab_strip_controller.cc +++ b/chrome/browser/ui/views/tabs/browser_tab_strip_controller.cc
@@ -13,7 +13,6 @@ #include "base/callback.h" #include "base/command_line.h" #include "base/feature_list.h" -#include "base/macros.h" #include "base/metrics/histogram_macros.h" #include "base/metrics/user_metrics.h" #include "build/build_config.h" @@ -118,6 +117,8 @@ views::MenuRunner::FORCE_VIEWS; menu_runner_ = std::make_unique<views::MenuRunner>(model_.get(), run_flags); } + TabContextMenuContents(const TabContextMenuContents&) = delete; + TabContextMenuContents& operator=(const TabContextMenuContents&) = delete; void Cancel() { controller_ = nullptr; } @@ -179,8 +180,6 @@ BrowserTabStripController* controller_; TabGroupsIPHController* const tab_groups_iph_controller_; - - DISALLOW_COPY_AND_ASSIGN(TabContextMenuContents); }; ////////////////////////////////////////////////////////////////////////////////
diff --git a/chrome/browser/ui/views/tabs/browser_tab_strip_controller.h b/chrome/browser/ui/views/tabs/browser_tab_strip_controller.h index eab9ab02..c23e8d1 100644 --- a/chrome/browser/ui/views/tabs/browser_tab_strip_controller.h +++ b/chrome/browser/ui/views/tabs/browser_tab_strip_controller.h
@@ -10,7 +10,6 @@ #include "base/callback_forward.h" #include "base/compiler_specific.h" -#include "base/macros.h" #include "chrome/browser/ui/tabs/hover_tab_selector.h" #include "chrome/browser/ui/tabs/tab_menu_model_factory.h" #include "chrome/browser/ui/tabs/tab_strip_model.h" @@ -44,6 +43,9 @@ BrowserView* browser_view, std::unique_ptr<TabMenuModelFactory> menu_model_factory_override = nullptr); + BrowserTabStripController(const BrowserTabStripController&) = delete; + BrowserTabStripController& operator=(const BrowserTabStripController&) = + delete; ~BrowserTabStripController() override; void InitFromModel(TabStrip* tabstrip); @@ -169,8 +171,6 @@ PrefChangeRegistrar local_pref_registrar_; std::unique_ptr<TabMenuModelFactory> menu_model_factory_; - - DISALLOW_COPY_AND_ASSIGN(BrowserTabStripController); }; #endif // CHROME_BROWSER_UI_VIEWS_TABS_BROWSER_TAB_STRIP_CONTROLLER_H_
diff --git a/chrome/browser/ui/views/tabs/color_picker_view.cc b/chrome/browser/ui/views/tabs/color_picker_view.cc index 4e87b49..9516e656 100644 --- a/chrome/browser/ui/views/tabs/color_picker_view.cc +++ b/chrome/browser/ui/views/tabs/color_picker_view.cc
@@ -36,6 +36,10 @@ class ColorPickerHighlightPathGenerator : public views::HighlightPathGenerator { public: ColorPickerHighlightPathGenerator() = default; + ColorPickerHighlightPathGenerator(const ColorPickerHighlightPathGenerator&) = + delete; + ColorPickerHighlightPathGenerator& operator=( + const ColorPickerHighlightPathGenerator&) = delete; // views::HighlightPathGenerator: SkPath GetHighlightPath(const views::View* view) override { @@ -45,9 +49,6 @@ const gfx::PointF center = bounds.CenterPoint(); return SkPath().addCircle(center.x(), center.y(), bounds.width() / 2.0f); } - - private: - DISALLOW_COPY_AND_ASSIGN(ColorPickerHighlightPathGenerator); }; } // namespace
diff --git a/chrome/browser/ui/views/tabs/fake_base_tab_strip_controller.h b/chrome/browser/ui/views/tabs/fake_base_tab_strip_controller.h index e9f929b..67bfef7 100644 --- a/chrome/browser/ui/views/tabs/fake_base_tab_strip_controller.h +++ b/chrome/browser/ui/views/tabs/fake_base_tab_strip_controller.h
@@ -9,7 +9,6 @@ #include <vector> #include "base/compiler_specific.h" -#include "base/macros.h" #include "base/optional.h" #include "chrome/browser/ui/views/tabs/tab_strip_controller.h" #include "components/tab_groups/tab_group_id.h" @@ -19,6 +18,9 @@ class FakeBaseTabStripController : public TabStripController { public: FakeBaseTabStripController(); + FakeBaseTabStripController(const FakeBaseTabStripController&) = delete; + FakeBaseTabStripController& operator=(const FakeBaseTabStripController&) = + delete; ~FakeBaseTabStripController() override; void AddTab(int index, bool is_active); @@ -101,8 +103,6 @@ std::vector<base::Optional<tab_groups::TabGroupId>> tab_groups_; ui::ListSelectionModel selection_model_; - - DISALLOW_COPY_AND_ASSIGN(FakeBaseTabStripController); }; #endif // CHROME_BROWSER_UI_VIEWS_TABS_FAKE_BASE_TAB_STRIP_CONTROLLER_H_
diff --git a/chrome/browser/ui/views/tabs/glow_hover_controller.h b/chrome/browser/ui/views/tabs/glow_hover_controller.h index b128bb52..f6aec89 100644 --- a/chrome/browser/ui/views/tabs/glow_hover_controller.h +++ b/chrome/browser/ui/views/tabs/glow_hover_controller.h
@@ -5,7 +5,6 @@ #ifndef CHROME_BROWSER_UI_VIEWS_TABS_GLOW_HOVER_CONTROLLER_H_ #define CHROME_BROWSER_UI_VIEWS_TABS_GLOW_HOVER_CONTROLLER_H_ -#include "base/macros.h" #include "chrome/browser/ui/tabs/tab_style.h" #include "ui/gfx/animation/slide_animation.h" #include "ui/views/animation/animation_delegate_views.h" @@ -29,6 +28,8 @@ class GlowHoverController : public views::AnimationDelegateViews { public: explicit GlowHoverController(views::View* view); + GlowHoverController(const GlowHoverController&) = delete; + GlowHoverController& operator=(const GlowHoverController&) = delete; ~GlowHoverController() override; // Sets the AnimationContainer used by the animation. @@ -73,8 +74,6 @@ gfx::Point location_; double opacity_scale_; double subtle_opacity_scale_; - - DISALLOW_COPY_AND_ASSIGN(GlowHoverController); }; #endif // CHROME_BROWSER_UI_VIEWS_TABS_GLOW_HOVER_CONTROLLER_H_
diff --git a/chrome/browser/ui/views/tabs/new_tab_button.cc b/chrome/browser/ui/views/tabs/new_tab_button.cc index 1496357..58a6212 100644 --- a/chrome/browser/ui/views/tabs/new_tab_button.cc +++ b/chrome/browser/ui/views/tabs/new_tab_button.cc
@@ -44,15 +44,14 @@ : public views::HighlightPathGenerator { public: HighlightPathGenerator() = default; + HighlightPathGenerator(const HighlightPathGenerator&) = delete; + HighlightPathGenerator& operator=(const HighlightPathGenerator&) = delete; // views::HighlightPathGenerator: SkPath GetHighlightPath(const views::View* view) override { return static_cast<const NewTabButton*>(view)->GetBorderPath( view->GetContentsBounds().origin(), 1.0f, false); } - - private: - DISALLOW_COPY_AND_ASSIGN(HighlightPathGenerator); }; NewTabButton::NewTabButton(TabStrip* tab_strip, views::ButtonListener* listener)
diff --git a/chrome/browser/ui/views/tabs/new_tab_button.h b/chrome/browser/ui/views/tabs/new_tab_button.h index ea2081a..414f841 100644 --- a/chrome/browser/ui/views/tabs/new_tab_button.h +++ b/chrome/browser/ui/views/tabs/new_tab_button.h
@@ -30,6 +30,8 @@ static const gfx::Size kButtonSize; NewTabButton(TabStrip* tab_strip, views::ButtonListener* listener); + NewTabButton(const NewTabButton&) = delete; + NewTabButton& operator=(const NewTabButton&) = delete; ~NewTabButton() override; // Called when the tab strip transitions to/from single tab mode, the frame @@ -90,8 +92,6 @@ // were we destroyed? bool* destroyed_ = nullptr; - - DISALLOW_COPY_AND_ASSIGN(NewTabButton); }; #endif // CHROME_BROWSER_UI_VIEWS_TABS_NEW_TAB_BUTTON_H_
diff --git a/chrome/browser/ui/views/tabs/stacked_tab_strip_layout.h b/chrome/browser/ui/views/tabs/stacked_tab_strip_layout.h index 97605a3..b7ec0c1 100644 --- a/chrome/browser/ui/views/tabs/stacked_tab_strip_layout.h +++ b/chrome/browser/ui/views/tabs/stacked_tab_strip_layout.h
@@ -7,7 +7,6 @@ #include <algorithm> -#include "base/macros.h" #include "ui/gfx/geometry/size.h" #include "ui/views/view_model.h" @@ -35,6 +34,8 @@ int stacked_padding, int max_stacked_count, views::ViewModelBase* view_model); + StackedTabStripLayout(const StackedTabStripLayout&) = delete; + StackedTabStripLayout& operator=(const StackedTabStripLayout&) = delete; ~StackedTabStripLayout(); // Sets the x-coordinate the normal tabs start at as well as the pinned tab @@ -238,8 +239,6 @@ // Index of the active tab. int active_index_ = -1; - - DISALLOW_COPY_AND_ASSIGN(StackedTabStripLayout); }; #endif // CHROME_BROWSER_UI_VIEWS_TABS_STACKED_TAB_STRIP_LAYOUT_H_
diff --git a/chrome/browser/ui/views/tabs/stacked_tab_strip_layout_unittest.cc b/chrome/browser/ui/views/tabs/stacked_tab_strip_layout_unittest.cc index 337d786d..3d65f5e8 100644 --- a/chrome/browser/ui/views/tabs/stacked_tab_strip_layout_unittest.cc +++ b/chrome/browser/ui/views/tabs/stacked_tab_strip_layout_unittest.cc
@@ -35,7 +35,10 @@ class StackedTabStripLayoutTest : public testing::Test { public: - StackedTabStripLayoutTest() {} + StackedTabStripLayoutTest() = default; + StackedTabStripLayoutTest(const StackedTabStripLayoutTest&) = delete; + StackedTabStripLayoutTest& operator=(const StackedTabStripLayoutTest&) = + delete; protected: void Reset(StackedTabStripLayout* layout, @@ -132,8 +135,6 @@ private: views::View view_; - - DISALLOW_COPY_AND_ASSIGN(StackedTabStripLayoutTest); }; // Random data.
diff --git a/chrome/browser/ui/views/tabs/tab.cc b/chrome/browser/ui/views/tabs/tab.cc index 16edc28..ce26d13 100644 --- a/chrome/browser/ui/views/tabs/tab.cc +++ b/chrome/browser/ui/views/tabs/tab.cc
@@ -14,7 +14,6 @@ #include "base/bind.h" #include "base/debug/alias.h" #include "base/i18n/rtl.h" -#include "base/macros.h" #include "base/metrics/user_metrics.h" #include "base/numerics/ranges.h" #include "base/numerics/safe_conversions.h" @@ -122,6 +121,10 @@ public: explicit TabStyleHighlightPathGenerator(TabStyle* tab_style) : tab_style_(tab_style) {} + TabStyleHighlightPathGenerator(const TabStyleHighlightPathGenerator&) = + delete; + TabStyleHighlightPathGenerator& operator=( + const TabStyleHighlightPathGenerator&) = delete; // views::HighlightPathGenerator: SkPath GetHighlightPath(const views::View* view) override { @@ -130,8 +133,6 @@ private: TabStyle* const tab_style_; - - DISALLOW_COPY_AND_ASSIGN(TabStyleHighlightPathGenerator); }; } // namespace @@ -146,6 +147,8 @@ DCHECK(close_button_); tab_close_button_observer_.Add(close_button_); } + TabCloseButtonObserver(const TabCloseButtonObserver&) = delete; + TabCloseButtonObserver& operator=(const TabCloseButtonObserver&) = delete; ~TabCloseButtonObserver() override { tab_close_button_observer_.Remove(close_button_); @@ -168,8 +171,6 @@ Tab* tab_; views::View* close_button_; TabController* controller_; - - DISALLOW_COPY_AND_ASSIGN(TabCloseButtonObserver); }; // Tab -------------------------------------------------------------------------
diff --git a/chrome/browser/ui/views/tabs/tab.h b/chrome/browser/ui/views/tabs/tab.h index 26cbfa1..1b24eb41 100644 --- a/chrome/browser/ui/views/tabs/tab.h +++ b/chrome/browser/ui/views/tabs/tab.h
@@ -10,7 +10,6 @@ #include <string> #include "base/gtest_prod_util.h" -#include "base/macros.h" #include "base/memory/ref_counted.h" #include "base/optional.h" #include "chrome/browser/ui/tabs/tab_renderer_data.h" @@ -68,6 +67,8 @@ static void SetShowHoverCardOnMouseHoverForTesting(bool value); explicit Tab(TabController* controller); + Tab(const Tab&) = delete; + Tab& operator=(const Tab&) = delete; ~Tab() override; // gfx::AnimationDelegate: @@ -277,8 +278,6 @@ // Focus ring for accessibility. views::FocusRing* focus_ring_; - - DISALLOW_COPY_AND_ASSIGN(Tab); }; #endif // CHROME_BROWSER_UI_VIEWS_TABS_TAB_H_
diff --git a/chrome/browser/ui/views/tabs/tab_animation.h b/chrome/browser/ui/views/tabs/tab_animation.h index aa9496d..679099e 100644 --- a/chrome/browser/ui/views/tabs/tab_animation.h +++ b/chrome/browser/ui/views/tabs/tab_animation.h
@@ -21,7 +21,8 @@ // Creates a TabAnimation for a tab with no active animations. explicit TabAnimation(TabAnimationState static_state); - + TabAnimation(const TabAnimation&) = delete; + TabAnimation& operator=(const TabAnimation&) = delete; ~TabAnimation(); // Returns whether this tab is currently animating closed. @@ -58,8 +59,6 @@ TabAnimationState target_state_; base::TimeTicks start_time_; base::TimeDelta duration_; - - DISALLOW_COPY_AND_ASSIGN(TabAnimation); }; #endif // CHROME_BROWSER_UI_VIEWS_TABS_TAB_ANIMATION_H_
diff --git a/chrome/browser/ui/views/tabs/tab_close_button.h b/chrome/browser/ui/views/tabs/tab_close_button.h index f2252abc..b8d101c 100644 --- a/chrome/browser/ui/views/tabs/tab_close_button.h +++ b/chrome/browser/ui/views/tabs/tab_close_button.h
@@ -26,6 +26,8 @@ // See note on SetTabColor. TabCloseButton(views::ButtonListener* listener, MouseEventCallback mouse_event_callback); + TabCloseButton(const TabCloseButton&) = delete; + TabCloseButton& operator=(const TabCloseButton&) = delete; ~TabCloseButton() override; // Returns the width of the tab close button. @@ -58,8 +60,6 @@ MouseEventCallback mouse_event_callback_; SkColor icon_color_ = gfx::kPlaceholderColor; - - DISALLOW_COPY_AND_ASSIGN(TabCloseButton); }; #endif // CHROME_BROWSER_UI_VIEWS_TABS_TAB_CLOSE_BUTTON_H_
diff --git a/chrome/browser/ui/views/tabs/tab_drag_controller.cc b/chrome/browser/ui/views/tabs/tab_drag_controller.cc index e23be20..8dde4ae9 100644 --- a/chrome/browser/ui/views/tabs/tab_drag_controller.cc +++ b/chrome/browser/ui/views/tabs/tab_drag_controller.cc
@@ -13,7 +13,6 @@ #include "base/bind.h" #include "base/callback.h" #include "base/i18n/rtl.h" -#include "base/macros.h" #include "base/numerics/ranges.h" #include "base/numerics/safe_conversions.h" #include "base/stl_util.h" @@ -224,6 +223,8 @@ event_monitor_ = views::EventMonitor::CreateApplicationMonitor( this, context, {ui::ET_KEY_PRESSED}); } + KeyEventTracker(const KeyEventTracker&) = delete; + KeyEventTracker& operator=(const KeyEventTracker&) = delete; ~KeyEventTracker() override = default; private: @@ -241,8 +242,6 @@ base::OnceClosure end_drag_callback_; base::OnceClosure revert_drag_callback_; std::unique_ptr<views::EventMonitor> event_monitor_; - - DISALLOW_COPY_AND_ASSIGN(KeyEventTracker); }; class TabDragController::SourceTabStripEmptinessTracker @@ -307,6 +306,10 @@ : public aura::WindowObserver { public: DeferredTargetTabstripObserver() = default; + DeferredTargetTabstripObserver(const DeferredTargetTabstripObserver&) = + delete; + DeferredTargetTabstripObserver& operator=( + const DeferredTargetTabstripObserver&) = delete; ~DeferredTargetTabstripObserver() override { if (deferred_target_context_) { GetWindowForTabDraggingProperties(deferred_target_context_) @@ -364,8 +367,6 @@ private: TabDragContext* deferred_target_context_ = nullptr; - - DISALLOW_COPY_AND_ASSIGN(DeferredTargetTabstripObserver); }; #endif
diff --git a/chrome/browser/ui/views/tabs/tab_drag_controller.h b/chrome/browser/ui/views/tabs/tab_drag_controller.h index 7a06075..7af113f 100644 --- a/chrome/browser/ui/views/tabs/tab_drag_controller.h +++ b/chrome/browser/ui/views/tabs/tab_drag_controller.h
@@ -10,7 +10,6 @@ #include <memory> #include <vector> -#include "base/macros.h" #include "base/memory/weak_ptr.h" #include "base/scoped_observer.h" #include "base/timer/timer.h" @@ -74,6 +73,8 @@ static const int kVerticalDetachMagnetism; TabDragController(); + TabDragController(const TabDragController&) = delete; + TabDragController& operator=(const TabDragController&) = delete; ~TabDragController() override; // Initializes TabDragController to drag the views in |dragging_views| @@ -226,6 +227,8 @@ // Stores the date associated with a single tab that is being dragged. struct TabDragData { TabDragData(); + TabDragData(const TabDragData&) = delete; + TabDragData& operator=(const TabDragData&) = delete; ~TabDragData(); TabDragData(TabDragData&&); @@ -256,9 +259,6 @@ // Stores the information of the group the tab is in, or nullopt if tab is // not grouped. base::Optional<TabGroupData> tab_group_data; - - private: - DISALLOW_COPY_AND_ASSIGN(TabDragData); }; typedef std::vector<TabDragData> DragData; @@ -696,8 +696,6 @@ ScopedObserver<views::Widget, views::WidgetObserver> widget_observer_{this}; base::WeakPtrFactory<TabDragController> weak_factory_{this}; - - DISALLOW_COPY_AND_ASSIGN(TabDragController); }; #endif // CHROME_BROWSER_UI_VIEWS_TABS_TAB_DRAG_CONTROLLER_H_
diff --git a/chrome/browser/ui/views/tabs/tab_drag_controller_interactive_uitest.cc b/chrome/browser/ui/views/tabs/tab_drag_controller_interactive_uitest.cc index fe892a1..1cefa66 100644 --- a/chrome/browser/ui/views/tabs/tab_drag_controller_interactive_uitest.cc +++ b/chrome/browser/ui/views/tabs/tab_drag_controller_interactive_uitest.cc
@@ -164,7 +164,9 @@ registrar_.Add(this, chrome::NOTIFICATION_TAB_DRAG_LOOP_DONE, content::NotificationService::AllSources()); } - ~QuitDraggingObserver() override {} + QuitDraggingObserver(const QuitDraggingObserver&) = delete; + QuitDraggingObserver& operator=(const QuitDraggingObserver&) = delete; + ~QuitDraggingObserver() override = default; void Observe(int type, const content::NotificationSource& source, @@ -180,8 +182,6 @@ private: content::NotificationRegistrar registrar_; base::RunLoop run_loop_; - - DISALLOW_COPY_AND_ASSIGN(QuitDraggingObserver); }; void SetID(WebContents* web_contents, int id) { @@ -340,7 +340,10 @@ BrowserView* browser_view) : DESKTOP_BROWSER_FRAME_AURA(browser_frame, browser_view), release_capture_(false) {} - ~TestDesktopBrowserFrameAura() override {} + TestDesktopBrowserFrameAura(const TestDesktopBrowserFrameAura&) = delete; + TestDesktopBrowserFrameAura& operator=(const TestDesktopBrowserFrameAura&) = + delete; + ~TestDesktopBrowserFrameAura() override = default; void ReleaseCaptureOnNextClear() { release_capture_ = true; @@ -357,23 +360,21 @@ private: // If true ReleaseCapture() is invoked in ClearNativeFocus(). bool release_capture_; - - DISALLOW_COPY_AND_ASSIGN(TestDesktopBrowserFrameAura); }; // Factory for creating a TestDesktopBrowserFrameAura. class TestNativeBrowserFrameFactory : public NativeBrowserFrameFactory { public: - TestNativeBrowserFrameFactory() {} - ~TestNativeBrowserFrameFactory() override {} + TestNativeBrowserFrameFactory() = default; + TestNativeBrowserFrameFactory(const TestNativeBrowserFrameFactory&) = delete; + TestNativeBrowserFrameFactory& operator=( + const TestNativeBrowserFrameFactory&) = delete; + ~TestNativeBrowserFrameFactory() override = default; NativeBrowserFrame* Create(BrowserFrame* browser_frame, BrowserView* browser_view) override { return new TestDesktopBrowserFrameAura(browser_frame, browser_view); } - - private: - DISALLOW_COPY_AND_ASSIGN(TestNativeBrowserFrameFactory); }; class TabDragCaptureLostTest : public TabDragControllerTest { @@ -381,9 +382,8 @@ TabDragCaptureLostTest() { NativeBrowserFrameFactory::Set(new TestNativeBrowserFrameFactory); } - - private: - DISALLOW_COPY_AND_ASSIGN(TabDragCaptureLostTest); + TabDragCaptureLostTest(const TabDragCaptureLostTest&) = delete; + TabDragCaptureLostTest& operator=(const TabDragCaptureLostTest&) = delete; }; // See description above for details. @@ -441,6 +441,10 @@ {features::kMixBrowserTypeTabs} /* enabled_features */, {features::kWebUITabStrip} /* disabled_features */); } + DetachToBrowserTabDragControllerTest( + const DetachToBrowserTabDragControllerTest&) = delete; + DetachToBrowserTabDragControllerTest& operator=( + const DetachToBrowserTabDragControllerTest&) = delete; void SetUpOnMainThread() override { #if defined(OS_CHROMEOS) @@ -656,8 +660,6 @@ #endif base::test::ScopedFeatureList scoped_feature_list_; base::Optional<web_app::AppId> tabbed_app_id_; - - DISALLOW_COPY_AND_ASSIGN(DetachToBrowserTabDragControllerTest); }; class DetachToBrowserTabDragControllerTestWithTabGroupsEnabled @@ -1431,7 +1433,9 @@ public: explicit CaptureLoseWindowFinder(TabStrip* tab_strip) : tab_strip_(tab_strip) {} - ~CaptureLoseWindowFinder() override {} + CaptureLoseWindowFinder(const CaptureLoseWindowFinder&) = delete; + CaptureLoseWindowFinder& operator=(const CaptureLoseWindowFinder&) = delete; + ~CaptureLoseWindowFinder() override = default; // WindowFinder: gfx::NativeWindow GetLocalProcessWindowAtPoint( @@ -1443,8 +1447,6 @@ private: TabStrip* tab_strip_; - - DISALLOW_COPY_AND_ASSIGN(CaptureLoseWindowFinder); }; } // namespace @@ -1493,6 +1495,9 @@ public: explicit MaximizedBrowserWindowWaiter(BrowserWindow* window) : window_(window) {} + MaximizedBrowserWindowWaiter(const MaximizedBrowserWindowWaiter&) = delete; + MaximizedBrowserWindowWaiter& operator=(const MaximizedBrowserWindowWaiter&) = + delete; ~MaximizedBrowserWindowWaiter() = default; // Blocks until the browser window becomes maximized. @@ -1527,8 +1532,6 @@ // The waiter's RunLoop quit closure. base::Closure quit_; - - DISALLOW_COPY_AND_ASSIGN(MaximizedBrowserWindowWaiter); }; } // namespace @@ -3045,7 +3048,8 @@ const gfx::Rect& bounds, const gfx::Point& end_point) : test_(test), end_bounds_(bounds), end_point_(end_point) {} - + DraggedWindowObserver(const DraggedWindowObserver&) = delete; + DraggedWindowObserver& operator=(const DraggedWindowObserver&) = delete; ~DraggedWindowObserver() override { if (window_) window_->RemoveObserver(this); @@ -3097,8 +3101,6 @@ gfx::Rect end_bounds_; // The position that the mouse/touch event will move to when the drag ends. gfx::Point end_point_; - - DISALLOW_COPY_AND_ASSIGN(DraggedWindowObserver); }; void DoNotObserveDraggedWidgetAfterDragEndsStep2( @@ -3549,6 +3551,10 @@ : public DetachToBrowserTabDragControllerTest { public: DetachToBrowserInSeparateDisplayTabDragControllerTest() {} + DetachToBrowserInSeparateDisplayTabDragControllerTest( + const DetachToBrowserInSeparateDisplayTabDragControllerTest&) = delete; + DetachToBrowserInSeparateDisplayTabDragControllerTest& operator=( + const DetachToBrowserInSeparateDisplayTabDragControllerTest&) = delete; virtual ~DetachToBrowserInSeparateDisplayTabDragControllerTest() {} void SetUpCommandLine(base::CommandLine* command_line) override { @@ -3557,10 +3563,6 @@ command_line->AppendSwitchASCII("ash-host-window-bounds", "0+0-800x600,800+0-800x600"); } - - private: - DISALLOW_COPY_AND_ASSIGN( - DetachToBrowserInSeparateDisplayTabDragControllerTest); }; namespace { @@ -3982,6 +3984,10 @@ : public DetachToBrowserTabDragControllerTest { public: DifferentDeviceScaleFactorDisplayTabDragControllerTest() {} + DifferentDeviceScaleFactorDisplayTabDragControllerTest( + const DifferentDeviceScaleFactorDisplayTabDragControllerTest&) = delete; + DifferentDeviceScaleFactorDisplayTabDragControllerTest& operator=( + const DifferentDeviceScaleFactorDisplayTabDragControllerTest&) = delete; virtual ~DifferentDeviceScaleFactorDisplayTabDragControllerTest() {} void SetUpCommandLine(base::CommandLine* command_line) override { @@ -3996,10 +4002,6 @@ ->GetCursor() .image_scale_factor(); } - - private: - DISALLOW_COPY_AND_ASSIGN( - DifferentDeviceScaleFactorDisplayTabDragControllerTest); }; namespace { @@ -4074,16 +4076,18 @@ : public DetachToBrowserTabDragControllerTest { public: DetachToBrowserInSeparateDisplayAndCancelTabDragControllerTest() {} + DetachToBrowserInSeparateDisplayAndCancelTabDragControllerTest( + const DetachToBrowserInSeparateDisplayAndCancelTabDragControllerTest&) = + delete; + DetachToBrowserInSeparateDisplayAndCancelTabDragControllerTest& operator=( + const DetachToBrowserInSeparateDisplayAndCancelTabDragControllerTest&) = + delete; void SetUpCommandLine(base::CommandLine* command_line) override { DetachToBrowserTabDragControllerTest::SetUpCommandLine(command_line); command_line->AppendSwitchASCII("ash-host-window-bounds", "0+0-800x600,800+0-800x600"); } - - private: - DISALLOW_COPY_AND_ASSIGN( - DetachToBrowserInSeparateDisplayAndCancelTabDragControllerTest); }; namespace { @@ -4205,12 +4209,13 @@ : public DetachToBrowserTabDragControllerTest { public: DetachToBrowserTabDragControllerTestTouch() {} + DetachToBrowserTabDragControllerTestTouch( + const DetachToBrowserTabDragControllerTestTouch&) = delete; + DetachToBrowserTabDragControllerTestTouch& operator=( + const DetachToBrowserTabDragControllerTestTouch&) = delete; virtual ~DetachToBrowserTabDragControllerTestTouch() {} void TearDown() override { ui::SetEventTickClockForTesting(nullptr); } - - private: - DISALLOW_COPY_AND_ASSIGN(DetachToBrowserTabDragControllerTestTouch); }; namespace {
diff --git a/chrome/browser/ui/views/tabs/tab_drag_controller_interactive_uitest.h b/chrome/browser/ui/views/tabs/tab_drag_controller_interactive_uitest.h index 81213f9..a941096 100644 --- a/chrome/browser/ui/views/tabs/tab_drag_controller_interactive_uitest.h +++ b/chrome/browser/ui/views/tabs/tab_drag_controller_interactive_uitest.h
@@ -7,7 +7,6 @@ #include <string> -#include "base/macros.h" #include "chrome/test/base/in_process_browser_test.h" #include "url/url_constants.h" @@ -30,6 +29,8 @@ class TabDragControllerTest : public InProcessBrowserTest { public: TabDragControllerTest(); + TabDragControllerTest(const TabDragControllerTest&) = delete; + TabDragControllerTest& operator=(const TabDragControllerTest&) = delete; ~TabDragControllerTest() override; // Cover for TabStrip::StopAnimating(true). @@ -60,9 +61,6 @@ // InProcessBrowserTest: void SetUp() override; - - private: - DISALLOW_COPY_AND_ASSIGN(TabDragControllerTest); }; namespace test {
diff --git a/chrome/browser/ui/views/tabs/tab_group_header.cc b/chrome/browser/ui/views/tabs/tab_group_header.cc index 5be5dff..7526e9d 100644 --- a/chrome/browser/ui/views/tabs/tab_group_header.cc +++ b/chrome/browser/ui/views/tabs/tab_group_header.cc
@@ -58,6 +58,10 @@ TabGroupHighlightPathGenerator(const views::View* chip, const views::View* title) : chip_(chip), title_(title) {} + TabGroupHighlightPathGenerator(const TabGroupHighlightPathGenerator&) = + delete; + TabGroupHighlightPathGenerator& operator=( + const TabGroupHighlightPathGenerator&) = delete; // views::HighlightPathGenerator: SkPath GetHighlightPath(const views::View* view) override { @@ -70,8 +74,6 @@ private: const views::View* const chip_; const views::View* const title_; - - DISALLOW_COPY_AND_ASSIGN(TabGroupHighlightPathGenerator); }; } // namespace
diff --git a/chrome/browser/ui/views/tabs/tab_group_header.h b/chrome/browser/ui/views/tabs/tab_group_header.h index 6ef1bb3..a9730df6 100644 --- a/chrome/browser/ui/views/tabs/tab_group_header.h +++ b/chrome/browser/ui/views/tabs/tab_group_header.h
@@ -28,6 +28,8 @@ public views::ViewTargeterDelegate { public: TabGroupHeader(TabStrip* tab_strip, const tab_groups::TabGroupId& group); + TabGroupHeader(const TabGroupHeader&) = delete; + TabGroupHeader& operator=(const TabGroupHeader&) = delete; ~TabGroupHeader() override; // TabSlotView: @@ -100,8 +102,6 @@ }; EditorBubbleTracker editor_bubble_tracker_; - - DISALLOW_COPY_AND_ASSIGN(TabGroupHeader); }; #endif // CHROME_BROWSER_UI_VIEWS_TABS_TAB_GROUP_HEADER_H_
diff --git a/chrome/browser/ui/views/tabs/tab_group_highlight.h b/chrome/browser/ui/views/tabs/tab_group_highlight.h index 58be510..0c6d204b 100644 --- a/chrome/browser/ui/views/tabs/tab_group_highlight.h +++ b/chrome/browser/ui/views/tabs/tab_group_highlight.h
@@ -17,6 +17,8 @@ public: TabGroupHighlight(TabGroupViews* tab_group_views, const tab_groups::TabGroupId& group); + TabGroupHighlight(const TabGroupHighlight&) = delete; + TabGroupHighlight& operator=(const TabGroupHighlight&) = delete; const tab_groups::TabGroupId& group() const { return group_; } @@ -30,8 +32,6 @@ TabGroupViews* const tab_group_views_; const tab_groups::TabGroupId group_; - - DISALLOW_COPY_AND_ASSIGN(TabGroupHighlight); }; #endif // CHROME_BROWSER_UI_VIEWS_TABS_TAB_GROUP_HIGHLIGHT_H_
diff --git a/chrome/browser/ui/views/tabs/tab_group_underline.h b/chrome/browser/ui/views/tabs/tab_group_underline.h index f494f3d..46decac 100644 --- a/chrome/browser/ui/views/tabs/tab_group_underline.h +++ b/chrome/browser/ui/views/tabs/tab_group_underline.h
@@ -20,6 +20,8 @@ TabGroupUnderline(TabGroupViews* tab_group_views, const tab_groups::TabGroupId& group); + TabGroupUnderline(const TabGroupUnderline&) = delete; + TabGroupUnderline& operator=(const TabGroupUnderline&) = delete; const tab_groups::TabGroupId& group() const { return group_; } @@ -46,8 +48,6 @@ TabGroupViews* const tab_group_views_; const tab_groups::TabGroupId group_; - - DISALLOW_COPY_AND_ASSIGN(TabGroupUnderline); }; #endif // CHROME_BROWSER_UI_VIEWS_TABS_TAB_GROUP_UNDERLINE_H_
diff --git a/chrome/browser/ui/views/tabs/tab_hover_card_bubble_view.cc b/chrome/browser/ui/views/tabs/tab_hover_card_bubble_view.cc index 36e1883..dd9f6d9 100644 --- a/chrome/browser/ui/views/tabs/tab_hover_card_bubble_view.cc +++ b/chrome/browser/ui/views/tabs/tab_hover_card_bubble_view.cc
@@ -145,6 +145,9 @@ widget_(hover_card), fade_animation_(std::make_unique<gfx::LinearAnimation>(this)) { } + WidgetFadeAnimationDelegate(const WidgetFadeAnimationDelegate&) = delete; + WidgetFadeAnimationDelegate& operator=(const WidgetFadeAnimationDelegate&) = + delete; ~WidgetFadeAnimationDelegate() override = default; enum class FadeAnimationState { @@ -248,8 +251,6 @@ #endif std::unique_ptr<gfx::LinearAnimation> fade_animation_; FadeAnimationState animation_state_ = FadeAnimationState::IDLE; - - DISALLOW_COPY_AND_ASSIGN(WidgetFadeAnimationDelegate); }; class TabHoverCardBubbleView::WidgetSlideAnimationDelegate @@ -262,7 +263,10 @@ slide_animation_(std::make_unique<gfx::LinearAnimation>(this)) { slide_animation_->SetDuration(base::TimeDelta::FromMilliseconds(75)); } - ~WidgetSlideAnimationDelegate() override {} + WidgetSlideAnimationDelegate(const WidgetSlideAnimationDelegate&) = delete; + WidgetSlideAnimationDelegate& operator=(const WidgetSlideAnimationDelegate&) = + delete; + ~WidgetSlideAnimationDelegate() override = default; void AnimateToAnchorView(views::View* desired_anchor_view) { DCHECK(!current_bubble_bounds_.IsEmpty()); @@ -326,8 +330,6 @@ gfx::Rect starting_bubble_bounds_; gfx::Rect target_bubble_bounds_; gfx::Rect current_bubble_bounds_; - - DISALLOW_COPY_AND_ASSIGN(WidgetSlideAnimationDelegate); }; // This is a label with two tweaks:
diff --git a/chrome/browser/ui/views/tabs/tab_hover_card_bubble_view.h b/chrome/browser/ui/views/tabs/tab_hover_card_bubble_view.h index 20c86bb5..2d3dd91 100644 --- a/chrome/browser/ui/views/tabs/tab_hover_card_bubble_view.h +++ b/chrome/browser/ui/views/tabs/tab_hover_card_bubble_view.h
@@ -29,7 +29,8 @@ class TabHoverCardBubbleView : public views::BubbleDialogDelegateView { public: explicit TabHoverCardBubbleView(Tab* tab); - + TabHoverCardBubbleView(const TabHoverCardBubbleView&) = delete; + TabHoverCardBubbleView& operator=(const TabHoverCardBubbleView&) = delete; ~TabHoverCardBubbleView() override; // Updates card content and anchoring and shows the tab hover card. @@ -122,8 +123,6 @@ bool waiting_for_decompress_ = false; base::OneShotTimer delayed_show_timer_; - - DISALLOW_COPY_AND_ASSIGN(TabHoverCardBubbleView); }; #endif // CHROME_BROWSER_UI_VIEWS_TABS_TAB_HOVER_CARD_BUBBLE_VIEW_H_
diff --git a/chrome/browser/ui/views/tabs/tab_hover_card_bubble_view_browsertest.cc b/chrome/browser/ui/views/tabs/tab_hover_card_bubble_view_browsertest.cc index 2d9a4e6..717d981d 100644 --- a/chrome/browser/ui/views/tabs/tab_hover_card_bubble_view_browsertest.cc +++ b/chrome/browser/ui/views/tabs/tab_hover_card_bubble_view_browsertest.cc
@@ -36,6 +36,10 @@ TabHoverCardBubbleView::disable_animations_for_testing_ = true; scoped_feature_list_.InitAndEnableFeature(features::kTabHoverCards); } + TabHoverCardBubbleViewBrowserTest(const TabHoverCardBubbleViewBrowserTest&) = + delete; + TabHoverCardBubbleViewBrowserTest& operator=( + const TabHoverCardBubbleViewBrowserTest&) = delete; ~TabHoverCardBubbleViewBrowserTest() override = default; void SetUpOnMainThread() override { @@ -91,8 +95,6 @@ base::test::ScopedFeatureList scoped_feature_list_; TabStrip* tab_strip_ = nullptr; - - DISALLOW_COPY_AND_ASSIGN(TabHoverCardBubbleViewBrowserTest); }; IN_PROC_BROWSER_TEST_F(TabHoverCardBubbleViewBrowserTest,
diff --git a/chrome/browser/ui/views/tabs/tab_hover_card_bubble_view_interactive_uitest.cc b/chrome/browser/ui/views/tabs/tab_hover_card_bubble_view_interactive_uitest.cc index 1cc2e97c..af5bf22 100644 --- a/chrome/browser/ui/views/tabs/tab_hover_card_bubble_view_interactive_uitest.cc +++ b/chrome/browser/ui/views/tabs/tab_hover_card_bubble_view_interactive_uitest.cc
@@ -26,7 +26,10 @@ TabHoverCardBubbleView::disable_animations_for_testing_ = true; scoped_feature_list_.InitAndEnableFeature(features::kTabHoverCards); } - + TabHoverCardBubbleViewInteractiveUiTest( + const TabHoverCardBubbleViewInteractiveUiTest&) = delete; + TabHoverCardBubbleViewInteractiveUiTest& operator=( + const TabHoverCardBubbleViewInteractiveUiTest&) = delete; ~TabHoverCardBubbleViewInteractiveUiTest() override = default; static TabHoverCardBubbleView* GetHoverCard(const TabStrip* tabstrip) { @@ -34,8 +37,6 @@ } private: - DISALLOW_COPY_AND_ASSIGN(TabHoverCardBubbleViewInteractiveUiTest); - base::test::ScopedFeatureList scoped_feature_list_; };
diff --git a/chrome/browser/ui/views/tabs/tab_icon.cc b/chrome/browser/ui/views/tabs/tab_icon.cc index f3bcff3..0c9e5b9 100644 --- a/chrome/browser/ui/views/tabs/tab_icon.cc +++ b/chrome/browser/ui/views/tabs/tab_icon.cc
@@ -58,6 +58,8 @@ explicit CrashAnimation(TabIcon* target) : gfx::LinearAnimation(base::TimeDelta::FromSeconds(1), 25, this), target_(target) {} + CrashAnimation(const CrashAnimation&) = delete; + CrashAnimation& operator=(const CrashAnimation&) = delete; ~CrashAnimation() override = default; // gfx::Animation overrides: @@ -75,8 +77,6 @@ private: TabIcon* target_; - - DISALLOW_COPY_AND_ASSIGN(CrashAnimation); }; TabIcon::TabIcon()
diff --git a/chrome/browser/ui/views/tabs/tab_icon.h b/chrome/browser/ui/views/tabs/tab_icon.h index 4e3c1c6..5e4bcaf 100644 --- a/chrome/browser/ui/views/tabs/tab_icon.h +++ b/chrome/browser/ui/views/tabs/tab_icon.h
@@ -5,7 +5,6 @@ #ifndef CHROME_BROWSER_UI_VIEWS_TABS_TAB_ICON_H_ #define CHROME_BROWSER_UI_VIEWS_TABS_TAB_ICON_H_ -#include "base/macros.h" #include "base/time/time.h" #include "chrome/browser/ui/tabs/tab_network_state.h" #include "ui/gfx/animation/linear_animation.h" @@ -40,6 +39,8 @@ }; TabIcon(); + TabIcon(const TabIcon&) = delete; + TabIcon& operator=(const TabIcon&) = delete; ~TabIcon() override; // Sets the tab data (network state, favicon, load progress, etc.) that are @@ -158,8 +159,6 @@ bool can_paint_to_layer_ = false; bool has_tab_renderer_data_ = false; - - DISALLOW_COPY_AND_ASSIGN(TabIcon); }; #endif // CHROME_BROWSER_UI_VIEWS_TABS_TAB_ICON_H_
diff --git a/chrome/browser/ui/views/tabs/tab_strip.cc b/chrome/browser/ui/views/tabs/tab_strip.cc index 5e75168a..4a208dd 100644 --- a/chrome/browser/ui/views/tabs/tab_strip.cc +++ b/chrome/browser/ui/views/tabs/tab_strip.cc
@@ -18,7 +18,6 @@ #include "base/containers/adapters.h" #include "base/containers/flat_map.h" #include "base/feature_list.h" -#include "base/macros.h" #include "base/metrics/histogram.h" #include "base/metrics/histogram_functions.h" #include "base/metrics/histogram_macros.h" @@ -190,6 +189,8 @@ TabStrip* tab_strip, TabSlotView* slot_view, OnAnimationProgressedCallback on_animation_progressed); + TabSlotAnimationDelegate(const TabSlotAnimationDelegate&) = delete; + TabSlotAnimationDelegate& operator=(const TabSlotAnimationDelegate&) = delete; ~TabSlotAnimationDelegate() override; void AnimationProgressed(const gfx::Animation* animation) override; @@ -202,8 +203,6 @@ TabStrip* const tab_strip_; TabSlotView* const slot_view_; OnAnimationProgressedCallback on_animation_progressed_; - - DISALLOW_COPY_AND_ASSIGN(TabSlotAnimationDelegate); }; TabSlotAnimationDelegate::TabSlotAnimationDelegate( @@ -229,13 +228,13 @@ TabStrip* tab_strip, Tab* tab, OnAnimationProgressedCallback on_animation_progressed); + ResetDraggingStateDelegate(const ResetDraggingStateDelegate&) = delete; + ResetDraggingStateDelegate& operator=(const ResetDraggingStateDelegate&) = + delete; ~ResetDraggingStateDelegate() override; void AnimationEnded(const gfx::Animation* animation) override; void AnimationCanceled(const gfx::Animation* animation) override; - - private: - DISALLOW_COPY_AND_ASSIGN(ResetDraggingStateDelegate); }; ResetDraggingStateDelegate::ResetDraggingStateDelegate( @@ -304,12 +303,11 @@ RemoveTabDelegate(TabStrip* tab_strip, Tab* tab, OnAnimationProgressedCallback on_animation_progressed); + RemoveTabDelegate(const RemoveTabDelegate&) = delete; + RemoveTabDelegate& operator=(const RemoveTabDelegate&) = delete; void AnimationEnded(const gfx::Animation* animation) override; void AnimationCanceled(const gfx::Animation* animation) override; - - private: - DISALLOW_COPY_AND_ASSIGN(RemoveTabDelegate); }; TabStrip::RemoveTabDelegate::RemoveTabDelegate(
diff --git a/chrome/browser/ui/views/tabs/tab_strip.h b/chrome/browser/ui/views/tabs/tab_strip.h index b3e2c4a..3a3e51a 100644 --- a/chrome/browser/ui/views/tabs/tab_strip.h +++ b/chrome/browser/ui/views/tabs/tab_strip.h
@@ -12,7 +12,6 @@ #include "base/compiler_specific.h" #include "base/gtest_prod_util.h" -#include "base/macros.h" #include "base/memory/ref_counted.h" #include "base/observer_list.h" #include "base/optional.h" @@ -85,6 +84,8 @@ public BrowserRootView::DropTarget { public: explicit TabStrip(std::unique_ptr<TabStripController> controller); + TabStrip(const TabStrip&) = delete; + TabStrip& operator=(const TabStrip&) = delete; ~TabStrip() override; void SetAvailableWidthCallback( @@ -379,6 +380,8 @@ DropArrow(const BrowserRootView::DropIndex& index, bool point_down, views::Widget* context); + DropArrow(const DropArrow&) = delete; + DropArrow& operator=(const DropArrow&) = delete; ~DropArrow() override; void set_index(const BrowserRootView::DropIndex& index) { index_ = index; } @@ -407,8 +410,6 @@ views::ImageView* arrow_view_ = nullptr; ScopedObserver<views::Widget, views::WidgetObserver> scoped_observer_{this}; - - DISALLOW_COPY_AND_ASSIGN(DropArrow); }; void Init(); @@ -783,8 +784,6 @@ std::unique_ptr<TabDragContextImpl> drag_context_; TabContextMenuController context_menu_controller_{this}; - - DISALLOW_COPY_AND_ASSIGN(TabStrip); }; #endif // CHROME_BROWSER_UI_VIEWS_TABS_TAB_STRIP_H_
diff --git a/chrome/browser/ui/views/tabs/tab_strip_layout_helper.h b/chrome/browser/ui/views/tabs/tab_strip_layout_helper.h index ccb9ba5..6260a8cf 100644 --- a/chrome/browser/ui/views/tabs/tab_strip_layout_helper.h +++ b/chrome/browser/ui/views/tabs/tab_strip_layout_helper.h
@@ -39,6 +39,8 @@ TabStripLayoutHelper(const TabStripController* controller, GetTabsCallback get_tabs_callback, GetGroupHeadersCallback get_group_headers_callback); + TabStripLayoutHelper(const TabStripLayoutHelper&) = delete; + TabStripLayoutHelper& operator=(const TabStripLayoutHelper&) = delete; ~TabStripLayoutHelper(); // Returns a vector of all tabs in the strip, including both closing tabs @@ -190,8 +192,6 @@ int first_non_pinned_tab_index_; int first_non_pinned_tab_x_; - - DISALLOW_COPY_AND_ASSIGN(TabStripLayoutHelper); }; #endif // CHROME_BROWSER_UI_VIEWS_TABS_TAB_STRIP_LAYOUT_HELPER_H_
diff --git a/chrome/browser/ui/views/tabs/tab_strip_unittest.cc b/chrome/browser/ui/views/tabs/tab_strip_unittest.cc index d6689c0..43c76043 100644 --- a/chrome/browser/ui/views/tabs/tab_strip_unittest.cc +++ b/chrome/browser/ui/views/tabs/tab_strip_unittest.cc
@@ -8,7 +8,6 @@ #include <string> #include "base/bind.h" -#include "base/macros.h" #include "base/test/task_environment.h" #include "base/timer/timer.h" #include "chrome/browser/ui/layout_constants.h" @@ -61,7 +60,8 @@ class TestAXEventObserver : public views::AXEventObserver { public: TestAXEventObserver() { views::AXEventManager::Get()->AddObserver(this); } - + TestAXEventObserver(const TestAXEventObserver&) = delete; + TestAXEventObserver& operator=(const TestAXEventObserver&) = delete; ~TestAXEventObserver() override { views::AXEventManager::Get()->RemoveObserver(this); } @@ -87,8 +87,6 @@ int add_count_ = 0; int change_count_ = 0; int remove_count_ = 0; - - DISALLOW_COPY_AND_ASSIGN(TestAXEventObserver); }; } // namespace @@ -98,7 +96,8 @@ explicit TestTabStripObserver(TabStrip* tab_strip) : tab_strip_(tab_strip) { tab_strip_->AddObserver(this); } - + TestTabStripObserver(const TestTabStripObserver&) = delete; + TestTabStripObserver& operator=(const TestTabStripObserver&) = delete; ~TestTabStripObserver() override { tab_strip_->RemoveObserver(this); } int last_tab_added() const { return last_tab_added_; } @@ -122,8 +121,6 @@ int last_tab_removed_ = -1; int last_tab_moved_from_ = -1; int last_tab_moved_to_ = -1; - - DISALLOW_COPY_AND_ASSIGN(TestTabStripObserver); }; class TabStripTest : public ChromeViewsTestBase, @@ -133,8 +130,9 @@ : touch_ui_scoper_(GetParam()), animation_mode_reset_(gfx::AnimationTestApi::SetRichAnimationRenderMode( gfx::Animation::RichAnimationRenderMode::FORCE_ENABLED)) {} - - ~TabStripTest() override {} + TabStripTest(const TabStripTest&) = delete; + TabStripTest& operator=(const TabStripTest&) = delete; + ~TabStripTest() override = default; void SetUp() override { ChromeViewsTestBase::SetUp(); @@ -281,8 +279,6 @@ ui::TouchUiController::TouchUiScoperForTesting touch_ui_scoper_; std::unique_ptr<base::AutoReset<gfx::Animation::RichAnimationRenderMode>> animation_mode_reset_; - - DISALLOW_COPY_AND_ASSIGN(TabStripTest); }; TEST_P(TabStripTest, GetModelCount) {
diff --git a/chrome/browser/ui/views/tabs/tab_style_views.cc b/chrome/browser/ui/views/tabs/tab_style_views.cc index 5f72713..41230a61 100644 --- a/chrome/browser/ui/views/tabs/tab_style_views.cc +++ b/chrome/browser/ui/views/tabs/tab_style_views.cc
@@ -46,6 +46,8 @@ class GM2TabStyle : public TabStyleViews { public: explicit GM2TabStyle(Tab* tab); + GM2TabStyle(const GM2TabStyle&) = delete; + GM2TabStyle& operator=(const GM2TabStyle&) = delete; protected: // TabStyle: @@ -153,8 +155,6 @@ std::unique_ptr<GlowHoverController> hover_controller_; gfx::FontList normal_font_; gfx::FontList heavy_font_; - - DISALLOW_COPY_AND_ASSIGN(GM2TabStyle); }; void DrawHighlight(gfx::Canvas* canvas,
diff --git a/chrome/browser/ui/views/tabs/tab_unittest.cc b/chrome/browser/ui/views/tabs/tab_unittest.cc index b130c5d..d0638a35 100644 --- a/chrome/browser/ui/views/tabs/tab_unittest.cc +++ b/chrome/browser/ui/views/tabs/tab_unittest.cc
@@ -9,7 +9,6 @@ #include <memory> #include <utility> -#include "base/macros.h" #include "base/strings/utf_string_conversions.h" #include "base/test/simple_test_tick_clock.h" #include "chrome/browser/ui/layout_constants.h" @@ -43,7 +42,9 @@ class FakeTabController : public TabController { public: - FakeTabController() {} + FakeTabController() = default; + FakeTabController(const FakeTabController&) = delete; + FakeTabController& operator=(const FakeTabController&) = delete; void set_active_tab(bool value) { active_tab_ = value; } void set_paint_throbber_to_layer(bool value) { @@ -157,8 +158,6 @@ SkColor tab_fg_color_active_ = gfx::kPlaceholderColor; SkColor tab_bg_color_inactive_ = gfx::kPlaceholderColor; SkColor tab_fg_color_inactive_ = gfx::kPlaceholderColor; - - DISALLOW_COPY_AND_ASSIGN(FakeTabController); }; class TabTest : public ChromeViewsTestBase { @@ -344,8 +343,10 @@ class AlertIndicatorTest : public ChromeViewsTestBase { public: - AlertIndicatorTest() {} - ~AlertIndicatorTest() override {} + AlertIndicatorTest() = default; + AlertIndicatorTest(const AlertIndicatorTest&) = delete; + AlertIndicatorTest& operator=(const AlertIndicatorTest&) = delete; + ~AlertIndicatorTest() override = default; void SetUp() override { ChromeViewsTestBase::SetUp(); @@ -395,9 +396,6 @@ FakeBaseTabStripController* controller_ = nullptr; TabStrip* tab_strip_ = nullptr; std::unique_ptr<views::Widget> widget_; - - private: - DISALLOW_COPY_AND_ASSIGN(AlertIndicatorTest); }; TEST_F(TabTest, HitTestTopPixel) {
diff --git a/chrome/browser/ui/views/tabs/window_finder.h b/chrome/browser/ui/views/tabs/window_finder.h index fdd680b4..b4f306eae 100644 --- a/chrome/browser/ui/views/tabs/window_finder.h +++ b/chrome/browser/ui/views/tabs/window_finder.h
@@ -7,7 +7,6 @@ #include <set> -#include "base/macros.h" #include "ui/gfx/native_widget_types.h" namespace gfx { @@ -23,15 +22,14 @@ class WindowFinder { public: WindowFinder() = default; + WindowFinder(const WindowFinder&) = delete; + WindowFinder& operator=(const WindowFinder&) = delete; virtual ~WindowFinder() = default; // See comment at display::Screen::GetLocalProcessWindowAtPoint(). virtual gfx::NativeWindow GetLocalProcessWindowAtPoint( const gfx::Point& screen_point, const std::set<gfx::NativeWindow>& ignore); - - private: - DISALLOW_COPY_AND_ASSIGN(WindowFinder); }; #endif // CHROME_BROWSER_UI_VIEWS_TABS_WINDOW_FINDER_H_
diff --git a/chrome/browser/ui/webui/settings/chromeos/internet_section.cc b/chrome/browser/ui/webui/settings/chromeos/internet_section.cc index c1f95be4..4f7531dd 100644 --- a/chrome/browser/ui/webui/settings/chromeos/internet_section.cc +++ b/chrome/browser/ui/webui/settings/chromeos/internet_section.cc
@@ -221,12 +221,6 @@ {.subpage = mojom::Subpage::kCellularDetails}, {IDS_OS_SETTINGS_TAG_CELLULAR_ALT1, IDS_OS_SETTINGS_TAG_CELLULAR_ALT2, IDS_OS_SETTINGS_TAG_CELLULAR_ALT3, SearchConcept::kAltTagEnd}}, - }); - return *tags; -} - -const std::vector<SearchConcept>& GetCellularOnSearchConcepts() { - static const base::NoDestructor<std::vector<SearchConcept>> tags({ {IDS_OS_SETTINGS_TAG_CELLULAR_SIM_LOCK, mojom::kCellularDetailsSubpagePath, mojom::SearchResultIcon::kCellular, @@ -240,6 +234,18 @@ mojom::SearchResultDefaultRank::kMedium, mojom::SearchResultType::kSetting, {.setting = mojom::Setting::kCellularRoaming}}, + {IDS_OS_SETTINGS_TAG_CELLULAR_APN, + mojom::kCellularDetailsSubpagePath, + mojom::SearchResultIcon::kCellular, + mojom::SearchResultDefaultRank::kMedium, + mojom::SearchResultType::kSetting, + {.setting = mojom::Setting::kCellularApn}}, + }); + return *tags; +} + +const std::vector<SearchConcept>& GetCellularOnSearchConcepts() { + static const base::NoDestructor<std::vector<SearchConcept>> tags({ {IDS_OS_SETTINGS_TAG_CELLULAR_TURN_OFF, mojom::kNetworkSectionPath, mojom::SearchResultIcon::kCellular, @@ -247,12 +253,6 @@ mojom::SearchResultType::kSetting, {.setting = mojom::Setting::kMobileOnOff}, {IDS_OS_SETTINGS_TAG_CELLULAR_TURN_OFF_ALT1, SearchConcept::kAltTagEnd}}, - {IDS_OS_SETTINGS_TAG_CELLULAR_APN, - mojom::kCellularDetailsSubpagePath, - mojom::SearchResultIcon::kCellular, - mojom::SearchResultDefaultRank::kMedium, - mojom::SearchResultType::kSetting, - {.setting = mojom::Setting::kCellularApn}}, }); return *tags; } @@ -504,7 +504,7 @@ // Fetch initial list of devices and active networks. FetchDeviceList(); - FetchActiveNetworks(); + FetchNetworkList(); } InternetSection::~InternetSection() = default; @@ -817,7 +817,7 @@ void InternetSection::OnActiveNetworksChanged( std::vector<network_config::mojom::NetworkStatePropertiesPtr> networks) { - OnActiveNetworks(std::move(networks)); + FetchNetworkList(); } void InternetSection::FetchDeviceList() { @@ -835,7 +835,6 @@ updater.RemoveSearchTags(GetWifiSearchConcepts()); updater.RemoveSearchTags(GetWifiOnSearchConcepts()); updater.RemoveSearchTags(GetWifiOffSearchConcepts()); - updater.RemoveSearchTags(GetCellularSearchConcepts()); updater.RemoveSearchTags(GetCellularOnSearchConcepts()); updater.RemoveSearchTags(GetCellularOffSearchConcepts()); updater.RemoveSearchTags(GetInstantTetheringSearchConcepts()); @@ -853,7 +852,9 @@ break; case NetworkType::kCellular: - updater.AddSearchTags(GetCellularSearchConcepts()); + // Note: Cellular search concepts all point to the cellular details + // page, which is only available if a cellular network exists. This + // check is in OnNetworkList(). if (device->device_state == DeviceStateType::kEnabled) updater.AddSearchTags(GetCellularOnSearchConcepts()); else if (device->device_state == DeviceStateType::kDisabled) @@ -876,16 +877,16 @@ } } -void InternetSection::FetchActiveNetworks() { +void InternetSection::FetchNetworkList() { cros_network_config_->GetNetworkStateList( network_config::mojom::NetworkFilter::New( network_config::mojom::FilterType::kVisible, network_config::mojom::NetworkType::kAll, network_config::mojom::kNoLimit), - base::Bind(&InternetSection::OnActiveNetworks, base::Unretained(this))); + base::Bind(&InternetSection::OnNetworkList, base::Unretained(this))); } -void InternetSection::OnActiveNetworks( +void InternetSection::OnNetworkList( std::vector<network_config::mojom::NetworkStatePropertiesPtr> networks) { using network_config::mojom::NetworkType; @@ -894,6 +895,7 @@ updater.RemoveSearchTags(GetEthernetConnectedSearchConcepts()); updater.RemoveSearchTags(GetWifiConnectedSearchConcepts()); updater.RemoveSearchTags(GetWifiMeteredSearchConcepts()); + updater.RemoveSearchTags(GetCellularSearchConcepts()); updater.RemoveSearchTags(GetCellularConnectedSearchConcepts()); updater.RemoveSearchTags(GetCellularMeteredSearchConcepts()); updater.RemoveSearchTags(GetInstantTetheringConnectedSearchConcepts()); @@ -909,8 +911,10 @@ for (const auto& network : networks) { // Special case: Some cellular search functionality is available even if the // network is not connected. - if (network->type == NetworkType::kCellular) + if (network->type == NetworkType::kCellular) { cellular_guid_ = network->guid; + updater.AddSearchTags(GetCellularSearchConcepts()); + } if (!IsConnected(network->connection_state)) continue;
diff --git a/chrome/browser/ui/webui/settings/chromeos/internet_section.h b/chrome/browser/ui/webui/settings/chromeos/internet_section.h index 397e11b..cbe3547 100644 --- a/chrome/browser/ui/webui/settings/chromeos/internet_section.h +++ b/chrome/browser/ui/webui/settings/chromeos/internet_section.h
@@ -62,8 +62,8 @@ void OnDeviceList( std::vector<network_config::mojom::DeviceStatePropertiesPtr> devices); - void FetchActiveNetworks(); - void OnActiveNetworks( + void FetchNetworkList(); + void OnNetworkList( std::vector<network_config::mojom::NetworkStatePropertiesPtr> networks); // Null if no cellular network exists.
diff --git a/chrome/browser/ui/webui/settings/chromeos/personalization_section.cc b/chrome/browser/ui/webui/settings/chromeos/personalization_section.cc index ffe1ca4..a49f06c 100644 --- a/chrome/browser/ui/webui/settings/chromeos/personalization_section.cc +++ b/chrome/browser/ui/webui/settings/chromeos/personalization_section.cc
@@ -4,6 +4,7 @@ #include "chrome/browser/ui/webui/settings/chromeos/personalization_section.h" +#include "ash/public/cpp/ambient/ambient_client.h" #include "ash/public/cpp/ambient/ambient_prefs.h" #include "base/bind.h" #include "base/no_destructor.h" @@ -111,7 +112,8 @@ } bool IsAmbientModeAllowed() { - return chromeos::features::IsAmbientModeEnabled(); + return chromeos::features::IsAmbientModeEnabled() && + ash::AmbientClient::Get()->IsAmbientModeAllowed(); } GURL GetGooglePhotosURL() {
diff --git a/chrome/browser/ui/webui/settings/shared_settings_localized_strings_provider.cc b/chrome/browser/ui/webui/settings/shared_settings_localized_strings_provider.cc index 7edc3ee0..721c9aa 100644 --- a/chrome/browser/ui/webui/settings/shared_settings_localized_strings_provider.cc +++ b/chrome/browser/ui/webui/settings/shared_settings_localized_strings_provider.cc
@@ -256,7 +256,29 @@ IDS_SETTINGS_NEARBY_SHARE_DEVICE_NAME_INPUT_LABEL}, {"nearbyShareEditDeviceName", IDS_SETTINGS_NEARBY_SHARE_EDIT_DEVICE_NAME}, {"nearbyShareDeviceNameAriaDescription", - IDS_SETTINGS_NEARBY_SHARE_DEVICE_NAME_ARIA_DESCRIPTION}}; + IDS_SETTINGS_NEARBY_SHARE_DEVICE_NAME_ARIA_DESCRIPTION}, + {"editDataUsage", IDS_SETTINGS_NEARBY_SHARE_EDIT_DATA_USAGE}, + {"updateDataUsage", IDS_SETTINGS_NEARBY_SHARE_UPDATE_DATA_USAGE}, + {"nearbyShareDataUsageDialogTitle", + IDS_SETTINGS_NEARBY_SHARE_DATA_USAGE_DIALOG_TITLE}, + {"nearbyShareDataUsageWifiOnlyLabel", + IDS_SETTINGS_NEARBY_SHARE_DATA_USAGE_WIFI_ONLY_LABEL}, + {"nearbyShareDataUsageWifiOnlyDescription", + IDS_SETTINGS_NEARBY_SHARE_DATA_USAGE_WIFI_ONLY_DESCRIPTION}, + {"nearbyShareDataUsageDataLabel", + IDS_SETTINGS_NEARBY_SHARE_DATA_USAGE_DATA_LABEL}, + {"nearbyShareDataUsageDataDescription", + IDS_SETTINGS_NEARBY_SHARE_DATA_USAGE_DATA_DESCRIPTION}, + {"nearbyShareDataUsageOfflineLabel", + IDS_SETTINGS_NEARBY_SHARE_DATA_USAGE_OFFLINE_LABEL}, + {"nearbyShareDataUsageOfflineDescription", + IDS_SETTINGS_NEARBY_SHARE_DATA_USAGE_OFFLINE_DESCRIPTION}, + {"nearbyShareDataUsageDataEditButtonDescription", + IDS_SETTINGS_NEARBY_SHARE_DATA_USAGE_EDIT_BUTTON_DATA_DESCRIPTION}, + {"nearbyShareDataUsageWifiOnlyEditButtonDescription", + IDS_SETTINGS_NEARBY_SHARE_DATA_USAGE_EDIT_BUTTON_WIFI_ONLY_DESCRIPTION}, + {"nearbyShareDataUsageOfflineEditButtonDescription", + IDS_SETTINGS_NEARBY_SHARE_DATA_USAGE_EDIT_BUTTON_OFFLINE_DESCRIPTION}}; AddLocalizedStringsBulk(html_source, kLocalizedStrings); html_source->AddBoolean(
diff --git a/chrome/browser/xsurface/android/java/src/org/chromium/chrome/browser/xsurface/SurfaceActionsHandler.java b/chrome/browser/xsurface/android/java/src/org/chromium/chrome/browser/xsurface/SurfaceActionsHandler.java index 502c1d41..95011dd 100644 --- a/chrome/browser/xsurface/android/java/src/org/chromium/chrome/browser/xsurface/SurfaceActionsHandler.java +++ b/chrome/browser/xsurface/android/java/src/org/chromium/chrome/browser/xsurface/SurfaceActionsHandler.java
@@ -14,13 +14,25 @@ /** * Navigates the current tab to a particular URL. + * @param url The url for which to navigate. + * @param actionSourceView The View from which the user tap originated. May be null. */ - default void navigateTab(String url) {} + default void navigateTab(String url, View actionSourceView) {} + @Deprecated + default void navigateTab(String url) { + navigateTab(url, null); + } /** * Navigates a new tab to a particular URL. + * @param url The url for which to navigate. + * @param actionSourceView The View from which the user tap originated. May be null. */ - default void navigateNewTab(String url) {} + default void navigateNewTab(String url, View actionSourceView) {} + @Deprecated + default void navigateNewTab(String url) { + navigateNewTab(url, null); + } /** * Navigate a new incognito tab to a URL. @@ -34,11 +46,22 @@ /** * Open a bottom sheet with the view as contents. + * @param view The bottom sheet contents view. + * @param actionSourceView The View from which the user tap originated. May be null. */ - default void showBottomSheet(View view) {} + default void showBottomSheet(View view, View actionSourceView) {} + @Deprecated + default void showBottomSheet(View view) { + showBottomSheet(view, null); + } /** * Dismiss the open bottom sheet (or do nothing if there isn't one). */ default void dismissBottomSheet() {} + + /** + * Indicates that the "Manage Interests" action was taken. Has no effect other than to log UMA. + */ + default void recordActionManageInterests() {} }
diff --git a/chrome/build/mac.pgo.txt b/chrome/build/mac.pgo.txt index b5b8ea3c..a388403 100644 --- a/chrome/build/mac.pgo.txt +++ b/chrome/build/mac.pgo.txt
@@ -1 +1 @@ -chrome-mac-master-1596434376-45a7a59068fd7ea7cf40a05d52ae81f0a49abd4e.profdata +chrome-mac-master-1596475240-d93356acbdf692b1bcca469d15900f1aa84583f0.profdata
diff --git a/chrome/build/win32.pgo.txt b/chrome/build/win32.pgo.txt index 8cb9a3c..f83c1477 100644 --- a/chrome/build/win32.pgo.txt +++ b/chrome/build/win32.pgo.txt
@@ -1 +1 @@ -chrome-win32-master-1596451854-145f78432e49c7c6a87ca8a74d340c029916cf4b.profdata +chrome-win32-master-1596470392-1db0b1fcfff2e5dea91624929cca8d9002b8d6ad.profdata
diff --git a/chrome/build/win64.pgo.txt b/chrome/build/win64.pgo.txt index 22befd3e..a88c0bc 100644 --- a/chrome/build/win64.pgo.txt +++ b/chrome/build/win64.pgo.txt
@@ -1 +1 @@ -chrome-win64-master-1596434376-e66572c4bd7519ea423a67f597bf938ae289c1f8.profdata +chrome-win64-master-1596455409-191726fecbe6a9b7fc8fb41afab59db6a1bbda42.profdata
diff --git a/chrome/chrome_cleaner/executables/chrome_cleaner_main.cc b/chrome/chrome_cleaner/executables/chrome_cleaner_main.cc index fc616d08..47c15da 100644 --- a/chrome/chrome_cleaner/executables/chrome_cleaner_main.cc +++ b/chrome/chrome_cleaner/executables/chrome_cleaner_main.cc
@@ -330,7 +330,7 @@ // Embedded libraries may have been extracted. Try to delete them and ignore // errors. base::FilePath exe_dir = exe_path.DirName(); - std::set<base::string16> embedded_libraries = + std::set<std::wstring> embedded_libraries = chrome_cleaner::GetLibrariesToLoad( chrome_cleaner::Settings::GetInstance()->engine()); for (const auto& library : embedded_libraries) { @@ -414,7 +414,7 @@ sandbox::SandboxFactory::GetTargetServices(); const bool is_sandbox_target = (sandbox_target_services != nullptr); - base::string16 log_suffix = + std::wstring log_suffix = command_line->HasSwitch(chrome_cleaner::kElevatedSwitch) ? kElevatedLogFileSuffix : L""; @@ -428,7 +428,7 @@ // Only start the crash reporter for the main process, the sandboxed process // will use the same crash reporter. if (is_sandbox_target) { - const base::string16 ipc_pipe_name = command_line->GetSwitchValueNative( + const std::wstring ipc_pipe_name = command_line->GetSwitchValueNative( chrome_cleaner::kUseCrashHandlerWithIdSwitch); CHECK(!ipc_pipe_name.empty()); UseCrashReporter(ipc_pipe_name); @@ -547,7 +547,7 @@ // GetNextLogFilePath returns the same file and never gets to return an // empty one. This might leave some log file behind, in very rare error // cases, but it's better than an infinite loop. - std::set<base::string16> log_files; + std::set<std::wstring> log_files; while (true) { base::FilePath log_file; registry_logger.GetNextLogFilePath(&log_file);
diff --git a/chrome/chrome_cleaner/executables/chrome_reporter_main.cc b/chrome/chrome_cleaner/executables/chrome_reporter_main.cc index eabbcaf7..efc53028 100644 --- a/chrome/chrome_cleaner/executables/chrome_reporter_main.cc +++ b/chrome/chrome_cleaner/executables/chrome_reporter_main.cc
@@ -21,7 +21,6 @@ #include "base/memory/weak_ptr.h" #include "base/message_loop/message_pump_type.h" #include "base/sequenced_task_runner.h" -#include "base/strings/string16.h" #include "base/strings/string_util.h" #include "base/task/single_thread_task_executor.h" #include "base/task/thread_pool/thread_pool_instance.h" @@ -172,7 +171,7 @@ // will use the handler process that was started by the reporter. if (command_line->HasSwitch(chrome_cleaner::kUseCrashHandlerWithIdSwitch)) { DCHECK(is_sandbox_target); - const base::string16 ipc_pipe_name = command_line->GetSwitchValueNative( + const std::wstring ipc_pipe_name = command_line->GetSwitchValueNative( chrome_cleaner::kUseCrashHandlerWithIdSwitch); CHECK(!ipc_pipe_name.empty()); UseCrashReporter(ipc_pipe_name); @@ -247,12 +246,12 @@ chrome_cleaner::InitializePUPDataWithCatalog(settings->engine()); - base::string16 interface_log_file; + std::wstring interface_log_file; if (command_line->HasSwitch(chrome_cleaner::kLogInterfaceCallsToSwitch)) { interface_log_file = command_line->GetSwitchValueNative( chrome_cleaner::kLogInterfaceCallsToSwitch); base::FilePath passed_name(interface_log_file); - std::vector<base::string16> components; + std::vector<std::wstring> components; passed_name.GetComponents(&components); if (components.size() != 1) { LOG(ERROR) << "Invalid file name passed for logging!";
diff --git a/chrome/chrome_cleaner/http/http_agent.h b/chrome/chrome_cleaner/http/http_agent.h index 9b5560e..bd1c1f60 100644 --- a/chrome/chrome_cleaner/http/http_agent.h +++ b/chrome/chrome_cleaner/http/http_agent.h
@@ -10,7 +10,6 @@ #include <memory> #include <string> -#include "base/strings/string16.h" #include "net/traffic_annotation/network_traffic_annotation.h" namespace chrome_cleaner { @@ -35,11 +34,11 @@ // @returns NULL if the request fails for any reason. Otherwise, returns an // HttpResponse that may be used to access the HTTP response. virtual std::unique_ptr<HttpResponse> Post( - const base::string16& host, + const std::wstring& host, uint16_t port, - const base::string16& path, + const std::wstring& path, bool secure, - const base::string16& extra_headers, + const std::wstring& extra_headers, const std::string& body, const net::NetworkTrafficAnnotationTag& traffic_annotation) = 0; @@ -55,11 +54,11 @@ // @returns NULL if the request fails for any reason. Otherwise, returns an // HttpResponse that may be used to access the HTTP response. virtual std::unique_ptr<HttpResponse> Get( - const base::string16& host, + const std::wstring& host, uint16_t port, - const base::string16& path, + const std::wstring& path, bool secure, - const base::string16& extra_headers, + const std::wstring& extra_headers, const net::NetworkTrafficAnnotationTag& traffic_annotation) = 0; };
diff --git a/chrome/chrome_cleaner/http/http_agent_impl.cc b/chrome/chrome_cleaner/http/http_agent_impl.cc index f6291bb..d7e2a8e 100644 --- a/chrome/chrome_cleaner/http/http_agent_impl.cc +++ b/chrome/chrome_cleaner/http/http_agent_impl.cc
@@ -18,7 +18,6 @@ #include "base/file_version_info.h" #include "base/logging.h" #include "base/macros.h" -#include "base/strings/string16.h" #include "base/strings/string_util.h" #include "base/system/sys_info.h" #include "base/win/scoped_handle.h" @@ -166,7 +165,7 @@ // Loads URL-specific proxy settings for |url| using |session|. Returns true // if auto-configuration is disabled or if the settings are successfully // loaded. - bool Load(HINTERNET session, const base::string16& url) { + bool Load(HINTERNET session, const std::wstring& url) { // http://msdn.microsoft.com/en-us/library/fze2ytx2(v=vs.110).aspx implies // that auto-detection is to be used before a specified configuration file. @@ -226,7 +225,7 @@ private: bool auto_detect_; - base::string16 auto_config_url_; + std::wstring auto_config_url_; bool is_valid_; WINHTTP_PROXY_INFO url_proxy_config_; @@ -241,22 +240,21 @@ // Issues the request defined by its parameters and, if successful, returns an // HttpResponse that may be used to access the response. See HttpAgent::Post // for a description of the parameters. - static std::unique_ptr<HttpResponse> Create( - const base::string16& user_agent, - const base::string16& host, - uint16_t port, - const base::string16& method, - const base::string16& path, - bool secure, - const base::string16& extra_headers, - const std::string& body); + static std::unique_ptr<HttpResponse> Create(const std::wstring& user_agent, + const std::wstring& host, + uint16_t port, + const std::wstring& method, + const std::wstring& path, + bool secure, + const std::wstring& extra_headers, + const std::string& body); // HttpResponse implementation. bool GetStatusCode(uint16_t* status_code) override; bool GetContentLength(bool* has_content_length, uint32_t* content_length) override; bool GetContentType(bool* has_content_type, - base::string16* content_type) override; + std::wstring* content_type) override; bool HasData(bool* has_data) override; bool ReadData(char* buffer, uint32_t* count) override; @@ -284,13 +282,13 @@ // static std::unique_ptr<HttpResponse> HttpResponseImpl::Create( - const base::string16& user_agent, - const base::string16& host, + const std::wstring& user_agent, + const std::wstring& host, uint16_t port, - const base::string16& method, - const base::string16& path, + const std::wstring& method, + const std::wstring& path, bool secure, - const base::string16& extra_headers, + const std::wstring& extra_headers, const std::string& body) { // Retrieve the user's proxy configuration. AutoWinHttpProxyConfig proxy_config; @@ -426,7 +424,7 @@ } bool HttpResponseImpl::GetContentType(bool* has_content_type, - base::string16* content_type) { + std::wstring* content_type) { DCHECK(has_content_type); DCHECK(content_type); @@ -492,7 +490,7 @@ return false; } -base::string16 GetWinHttpVersion() { +std::wstring GetWinHttpVersion() { HMODULE win_http_module = nullptr; if (::GetModuleHandleEx(0, L"winhttp.dll", &win_http_module)) { std::unique_ptr<FileVersionInfo> win_http_module_version_info( @@ -530,8 +528,8 @@ } // namespace -HttpAgentImpl::HttpAgentImpl(const base::string16& product_name, - const base::string16& product_version) { +HttpAgentImpl::HttpAgentImpl(const std::wstring& product_name, + const std::wstring& product_version) { UserAgent user_agent(product_name, product_version); user_agent.set_winhttp_version(GetWinHttpVersion()); GetOSAndCPU(&user_agent); @@ -541,11 +539,11 @@ HttpAgentImpl::~HttpAgentImpl() {} std::unique_ptr<HttpResponse> HttpAgentImpl::Post( - const base::string16& host, + const std::wstring& host, uint16_t port, - const base::string16& path, + const std::wstring& path, bool secure, - const base::string16& extra_headers, + const std::wstring& extra_headers, const std::string& body, const net::NetworkTrafficAnnotationTag& /*traffic_annotation*/) { return HttpResponseImpl::Create(user_agent_, host, port, L"POST", path, @@ -553,11 +551,11 @@ } std::unique_ptr<HttpResponse> HttpAgentImpl::Get( - const base::string16& host, + const std::wstring& host, uint16_t port, - const base::string16& path, + const std::wstring& path, bool secure, - const base::string16& extra_headers, + const std::wstring& extra_headers, const net::NetworkTrafficAnnotationTag& /*traffic_annotation*/) { return HttpResponseImpl::Create(user_agent_, host, port, L"GET", path, secure, extra_headers, "");
diff --git a/chrome/chrome_cleaner/http/http_agent_impl.h b/chrome/chrome_cleaner/http/http_agent_impl.h index 09191291..875b034c 100644 --- a/chrome/chrome_cleaner/http/http_agent_impl.h +++ b/chrome/chrome_cleaner/http/http_agent_impl.h
@@ -11,7 +11,6 @@ #include <string> #include "base/macros.h" -#include "base/strings/string16.h" #include "chrome/chrome_cleaner/http/http_agent.h" namespace chrome_cleaner { @@ -23,30 +22,30 @@ // @param product_name The product name to include in the User-Agent header. // @param product_version The product version to include in the User-Agent // header. - HttpAgentImpl(const base::string16& product_name, - const base::string16& product_version); + HttpAgentImpl(const std::wstring& product_name, + const std::wstring& product_version); ~HttpAgentImpl() override; // HttpAgent implementation std::unique_ptr<HttpResponse> Post( - const base::string16& host, + const std::wstring& host, uint16_t port, - const base::string16& path, + const std::wstring& path, bool secure, - const base::string16& extra_headers, + const std::wstring& extra_headers, const std::string& body, const net::NetworkTrafficAnnotationTag& traffic_annotation) override; std::unique_ptr<HttpResponse> Get( - const base::string16& host, + const std::wstring& host, uint16_t port, - const base::string16& path, + const std::wstring& path, bool secure, - const base::string16& extra_headers, + const std::wstring& extra_headers, const net::NetworkTrafficAnnotationTag& traffic_annotation) override; private: - base::string16 user_agent_; + std::wstring user_agent_; DISALLOW_COPY_AND_ASSIGN(HttpAgentImpl); };
diff --git a/chrome/chrome_cleaner/http/http_response.h b/chrome/chrome_cleaner/http/http_response.h index d1a0da85..912ede1 100644 --- a/chrome/chrome_cleaner/http/http_response.h +++ b/chrome/chrome_cleaner/http/http_response.h
@@ -6,7 +6,8 @@ #define CHROME_CHROME_CLEANER_HTTP_HTTP_RESPONSE_H_ #include <stdint.h> -#include "base/strings/string16.h" + +#include <string> namespace chrome_cleaner { @@ -37,7 +38,7 @@ // @returns true if the content type is retrieved or not specified in the // response. virtual bool GetContentType(bool* has_content_type, - base::string16* content_type) = 0; + std::wstring* content_type) = 0; // Checks the response body stream. // @param has_data Is set to true if data is available to read
diff --git a/chrome/chrome_cleaner/http/internet_helpers.cc b/chrome/chrome_cleaner/http/internet_helpers.cc index 9141ad1..cff596c 100644 --- a/chrome/chrome_cleaner/http/internet_helpers.cc +++ b/chrome/chrome_cleaner/http/internet_helpers.cc
@@ -24,14 +24,14 @@ // Returns the index of the closing quote of the string, if any. |start| points // at the opening quote. -size_t FindStringEnd(const base::string16& line, size_t start, wchar_t delim) { +size_t FindStringEnd(const std::wstring& line, size_t start, wchar_t delim) { DCHECK_LT(start, line.length()); DCHECK_EQ(line[start], delim); DCHECK((delim == L'"') || (delim == L'\'')); const wchar_t set[] = {delim, L'\\', L'\0'}; for (size_t end = line.find_first_of(set, start + 1); - end != base::string16::npos; end = line.find_first_of(set, end + 2)) { + end != std::wstring::npos; end = line.find_first_of(set, end + 2)) { if (line[end] != L'\\') return end; } @@ -44,8 +44,8 @@ return ::wcschr(kHttpLws, c) != NULL; } -void TrimLWS(base::string16::const_iterator* begin, - base::string16::const_iterator* end) { +void TrimLWS(std::wstring::const_iterator* begin, + std::wstring::const_iterator* end) { // Skip leading whitespace. while (*begin < *end && IsLWS((*begin)[0])) ++(*begin); @@ -57,21 +57,21 @@ } // namespace -void ParseContentType(const base::string16& content_type_str, - base::string16* mime_type, - base::string16* charset, +void ParseContentType(const std::wstring& content_type_str, + std::wstring* mime_type, + std::wstring* charset, bool* had_charset, - base::string16* boundary) { - const base::string16::const_iterator begin = content_type_str.begin(); + std::wstring* boundary) { + const std::wstring::const_iterator begin = content_type_str.begin(); // Trim leading and trailing whitespace from type. We include '(' in the // trailing trim set to catch media-type comments, which are not at all // standard, but may occur in rare cases. size_t type_val = content_type_str.find_first_not_of(kHttpLws); type_val = std::min(type_val, content_type_str.length()); - size_t type_end = content_type_str.find_first_of( - base::string16(kHttpLws) + L";(", type_val); - if (type_end == base::string16::npos) + size_t type_end = + content_type_str.find_first_of(std::wstring(kHttpLws) + L";(", type_val); + if (type_end == std::wstring::npos) type_end = content_type_str.length(); size_t charset_val = 0; @@ -81,21 +81,21 @@ // Iterate over parameters. size_t param_start = content_type_str.find_first_of(';', type_end); if (param_start != std::string::npos) { - base::StringTokenizerT<base::string16, base::string16::const_iterator> + base::StringTokenizerT<std::wstring, std::wstring::const_iterator> tokenizer(begin + param_start, content_type_str.end(), L";"); tokenizer.set_quote_chars(L"\""); while (tokenizer.GetNext()) { - base::string16::const_iterator equals_sign = + std::wstring::const_iterator equals_sign = std::find(tokenizer.token_begin(), tokenizer.token_end(), L'='); if (equals_sign == tokenizer.token_end()) continue; - base::string16::const_iterator param_name_begin = tokenizer.token_begin(); - base::string16::const_iterator param_name_end = equals_sign; + std::wstring::const_iterator param_name_begin = tokenizer.token_begin(); + std::wstring::const_iterator param_name_end = equals_sign; TrimLWS(¶m_name_begin, ¶m_name_end); - base::string16::const_iterator param_value_begin = equals_sign + 1; - base::string16::const_iterator param_value_end = tokenizer.token_end(); + std::wstring::const_iterator param_value_begin = equals_sign + 1; + std::wstring::const_iterator param_value_end = tokenizer.token_end(); DCHECK(param_value_begin <= tokenizer.token_end()); TrimLWS(¶m_value_begin, ¶m_value_end); @@ -127,7 +127,7 @@ DCHECK(charset_end >= charset_val); } else { charset_end = std::min(content_type_str.find_first_of( - base::string16(kHttpLws) + L";(", charset_val), + std::wstring(kHttpLws) + L";(", charset_val), charset_end); } } @@ -139,7 +139,7 @@ // not include a slash. Some servers give junk after the charset parameter, // which may include a comma, so this check makes us a bit more tolerant. if (content_type_str.length() != 0 && content_type_str != L"*/*" && - content_type_str.find_first_of(L'/') != base::string16::npos) { + content_type_str.find_first_of(L'/') != std::wstring::npos) { // The common case here is that mime_type is empty. bool eq = !mime_type->empty() && base::LowerCaseEqualsASCII( @@ -157,11 +157,11 @@ } } -bool DecomposeUrl(const base::string16& url, - base::string16* scheme, - base::string16* host, +bool DecomposeUrl(const std::wstring& url, + std::wstring* scheme, + std::wstring* host, uint16_t* port, - base::string16* path) { + std::wstring* path) { DCHECK(scheme); DCHECK(host); DCHECK(path); @@ -185,10 +185,10 @@ return true; } -base::string16 ComposeUrl(const base::string16& host, - uint16_t port, - const base::string16& path, - bool secure) { +std::wstring ComposeUrl(const std::wstring& host, + uint16_t port, + const std::wstring& path, + bool secure) { if (secure) { if (port == 443) return L"https://" + host + path; @@ -199,7 +199,7 @@ return L"http://" + host + L':' + base::NumberToWString(port) + path; } -base::string16 GenerateMultipartHttpRequestBoundary() { +std::wstring GenerateMultipartHttpRequestBoundary() { // The boundary has 27 '-' characters followed by 16 hex digits. static const wchar_t kBoundaryPrefix[] = L"---------------------------"; static const size_t kBoundaryLength = 27 + 16; @@ -213,19 +213,19 @@ ::swprintf(temp, sizeof(temp) / sizeof(*temp), L"%s%08X%08X", kBoundaryPrefix, r0, r1); - return base::string16(temp, kBoundaryLength); + return std::wstring(temp, kBoundaryLength); } -base::string16 GenerateMultipartHttpRequestContentTypeHeader( - const base::string16 boundary) { +std::wstring GenerateMultipartHttpRequestContentTypeHeader( + const std::wstring boundary) { return L"Content-Type: multipart/form-data; boundary=" + boundary; } std::string GenerateMultipartHttpRequestBody( - const std::map<base::string16, base::string16>& parameters, + const std::map<std::wstring, std::wstring>& parameters, const std::string& upload_file, - const base::string16& file_part_name, - const base::string16& boundary) { + const std::wstring& file_part_name, + const std::wstring& boundary) { DCHECK(!boundary.empty()); DCHECK(!file_part_name.empty()); std::string boundary_utf8 = base::WideToUTF8(boundary);
diff --git a/chrome/chrome_cleaner/http/internet_helpers.h b/chrome/chrome_cleaner/http/internet_helpers.h index 0a0a951c..469549a 100644 --- a/chrome/chrome_cleaner/http/internet_helpers.h +++ b/chrome/chrome_cleaner/http/internet_helpers.h
@@ -11,7 +11,6 @@ #include <map> #include <string> -#include "base/strings/string16.h" namespace chrome_cleaner { @@ -24,11 +23,11 @@ // Unmodified otherwise. // @param boundary Optional. Receives the (quoted) value of the boundary // parameter, if any. Unmodified otherwise. -void ParseContentType(const base::string16& content_type_str, - base::string16* mime_type, - base::string16* charset, +void ParseContentType(const std::wstring& content_type_str, + std::wstring* mime_type, + std::wstring* charset, bool* had_charset, - base::string16* boundary); + std::wstring* boundary); // Parses an URL. // @param url The URL to parse. @@ -37,32 +36,32 @@ // @param port Receives the parsed port (or the implicit default port). // @param path Receives the parsed path. // @returns true if the URL is successfully parsed. -bool DecomposeUrl(const base::string16& url, - base::string16* scheme, - base::string16* host, +bool DecomposeUrl(const std::wstring& url, + std::wstring* scheme, + std::wstring* host, uint16_t* port, - base::string16* path); + std::wstring* path); // Composes an HTTP or HTTPS URL. // @param host The URL host component. // @param port The URL port component. // @param path The URL path component. // @returns The composed URL. -base::string16 ComposeUrl(const base::string16& host, - uint16_t port, - const base::string16& path, - bool secure); +std::wstring ComposeUrl(const std::wstring& host, + uint16_t port, + const std::wstring& path, + bool secure); // @returns A random string to be used as a multipart MIME message boundary. -base::string16 GenerateMultipartHttpRequestBoundary(); +std::wstring GenerateMultipartHttpRequestBoundary(); // Generates an appropriate Content-Type header (starting with "Content-Type:") // for a multi-part HTTP message. // @param boundary The MIME boundary to use. // @returns An HTTP Content-Type header suitable for the multipart message // generated by GenerateMultipartHttpRequestBody. -base::string16 GenerateMultipartHttpRequestContentTypeHeader( - const base::string16 boundary); +std::wstring GenerateMultipartHttpRequestContentTypeHeader( + const std::wstring boundary); // Generates a multipart HTTP message body. // @param parameters HTTP request parameters to be encoded in the body. @@ -71,10 +70,10 @@ // @param boundary The MIME boundary to use. // @returns A multipart HTTP message body. std::string GenerateMultipartHttpRequestBody( - const std::map<base::string16, base::string16>& parameters, + const std::map<std::wstring, std::wstring>& parameters, const std::string& upload_file, - const base::string16& file_part_name, - const base::string16& boundary); + const std::wstring& file_part_name, + const std::wstring& boundary); } // namespace chrome_cleaner
diff --git a/chrome/chrome_cleaner/http/internet_helpers_unittest.cc b/chrome/chrome_cleaner/http/internet_helpers_unittest.cc index 5d9432c..f9a1358 100644 --- a/chrome/chrome_cleaner/http/internet_helpers_unittest.cc +++ b/chrome/chrome_cleaner/http/internet_helpers_unittest.cc
@@ -7,7 +7,6 @@ #include <string> #include "base/stl_util.h" -#include "base/strings/string16.h" #include "base/strings/utf_string_conversions.h" #include "chrome/chrome_cleaner/http/internet_unittest_helpers.h" #include "testing/gtest/include/gtest/gtest.h" @@ -45,10 +44,10 @@ false, L"WebKit-ada-df-dsf-adsfadsfs"}, }; for (size_t i = 0; i < base::size(tests); ++i) { - base::string16 mime_type; - base::string16 charset; + std::wstring mime_type; + std::wstring charset; bool had_charset = false; - base::string16 boundary; + std::wstring boundary; ParseContentType(tests[i].content_type, &mime_type, &charset, &had_charset, &boundary); EXPECT_EQ(tests[i].expected_mime_type, mime_type) << "i=" << i; @@ -73,7 +72,7 @@ {L"http://example.com/a/b/c", L"http", L"example.com", 80, L"/a/b/c"}, }; for (size_t i = 0; i < base::size(tests); ++i) { - base::string16 scheme, host, path; + std::wstring scheme, host, path; uint16_t port = 0; EXPECT_TRUE(DecomposeUrl(tests[i].url, &scheme, &host, &port, &path)) << "i=" << i; @@ -83,7 +82,7 @@ EXPECT_EQ(tests[i].path, path) << "i=" << i; EXPECT_EQ(tests[i].url, ComposeUrl(tests[i].host, tests[i].port, tests[i].path, - tests[i].scheme == base::string16(L"https"))); + tests[i].scheme == std::wstring(L"https"))); } const wchar_t* invalid_urls[] = { @@ -92,7 +91,7 @@ L"http:", L"http:/example.com", L"http:example.com"}; for (size_t i = 0; i < base::size(invalid_urls); ++i) { - base::string16 scheme, host, path; + std::wstring scheme, host, path; uint16_t port = 0; EXPECT_FALSE(DecomposeUrl(invalid_urls[i], &scheme, &host, &port, &path)) << "i=" << i; @@ -100,27 +99,27 @@ } TEST(InternetHelpersTest, GenerateMultipartHttpRequestBoundary) { - base::string16 boundary1 = GenerateMultipartHttpRequestBoundary(); - base::string16 boundary2 = GenerateMultipartHttpRequestBoundary(); + std::wstring boundary1 = GenerateMultipartHttpRequestBoundary(); + std::wstring boundary2 = GenerateMultipartHttpRequestBoundary(); EXPECT_FALSE(boundary1.empty()); EXPECT_FALSE(boundary2.empty()); EXPECT_NE(boundary1, boundary2); - ASSERT_EQ(base::string16::npos, + ASSERT_EQ(std::wstring::npos, boundary1.find_first_not_of(L"-0123456789abcdefABCDEF")); } TEST(InternetHelpersTest, GenerateMultipartHttpRequestContentTypeHeader) { - base::string16 boundary = GenerateMultipartHttpRequestBoundary(); - base::string16 content_type_header = + std::wstring boundary = GenerateMultipartHttpRequestBoundary(); + std::wstring content_type_header = GenerateMultipartHttpRequestContentTypeHeader(boundary); size_t semicolon = content_type_header.find(L':'); - ASSERT_NE(base::string16::npos, semicolon); + ASSERT_NE(std::wstring::npos, semicolon); - base::string16 mime_type, charset, parsed_boundary; + std::wstring mime_type, charset, parsed_boundary; bool had_charset = false; - ParseContentType(base::string16(content_type_header.begin() + semicolon + 1, - content_type_header.end()), + ParseContentType(std::wstring(content_type_header.begin() + semicolon + 1, + content_type_header.end()), &mime_type, &charset, &had_charset, &parsed_boundary); EXPECT_EQ(boundary, parsed_boundary); EXPECT_TRUE(charset.empty()); @@ -129,11 +128,11 @@ } TEST(InternetHelpersTest, GenerateMultipartHttpRequestBody) { - std::map<base::string16, base::string16> parameters; + std::map<std::wstring, std::wstring> parameters; parameters[L"param"] = L"value"; - base::string16 boundary = GenerateMultipartHttpRequestBoundary(); + std::wstring boundary = GenerateMultipartHttpRequestBoundary(); std::string file = "file contents"; - base::string16 file_part_name = L"file_name"; + std::wstring file_part_name = L"file_name"; std::string body = GenerateMultipartHttpRequestBody(parameters, file, file_part_name, boundary);
diff --git a/chrome/chrome_cleaner/http/internet_unittest_helpers.cc b/chrome/chrome_cleaner/http/internet_unittest_helpers.cc index 961ebfb..799f294 100644 --- a/chrome/chrome_cleaner/http/internet_unittest_helpers.cc +++ b/chrome/chrome_cleaner/http/internet_unittest_helpers.cc
@@ -12,8 +12,8 @@ namespace chrome_cleaner { void ExpectMultipartMimeMessageIsPlausible( - const base::string16& boundary, - const std::map<base::string16, base::string16>& parameters, + const std::wstring& boundary, + const std::map<std::wstring, std::wstring>& parameters, const std::string& file, const std::string& file_part_name, const std::string& body) {
diff --git a/chrome/chrome_cleaner/http/internet_unittest_helpers.h b/chrome/chrome_cleaner/http/internet_unittest_helpers.h index 6d44971..4b2d717 100644 --- a/chrome/chrome_cleaner/http/internet_unittest_helpers.h +++ b/chrome/chrome_cleaner/http/internet_unittest_helpers.h
@@ -8,8 +8,6 @@ #include <map> #include <string> -#include "base/strings/string16.h" - namespace chrome_cleaner { // Verifies that the supplied multipart MIME message body is plausibly @@ -20,8 +18,8 @@ // @param file The file contents that are expdected to be encoded in the body. // @param file_part_name The name expected to be assigned to the file parameter. void ExpectMultipartMimeMessageIsPlausible( - const base::string16& boundary, - const std::map<base::string16, base::string16>& parameters, + const std::wstring& boundary, + const std::map<std::wstring, std::wstring>& parameters, const std::string& file, const std::string& file_part_name, const std::string& body);
diff --git a/chrome/chrome_cleaner/http/mock_http_agent_factory.cc b/chrome/chrome_cleaner/http/mock_http_agent_factory.cc index 22f5204..65e7db2 100644 --- a/chrome/chrome_cleaner/http/mock_http_agent_factory.cc +++ b/chrome/chrome_cleaner/http/mock_http_agent_factory.cc
@@ -47,7 +47,7 @@ } bool GetContentType(bool* has_content_type, - base::string16* content_type) override { + std::wstring* content_type) override { ADD_FAILURE() << "This method should not be called."; return false; } @@ -91,11 +91,11 @@ // chrome_cleaner::HttpAgent: std::unique_ptr<chrome_cleaner::HttpResponse> Post( - const base::string16& host, + const std::wstring& host, uint16_t port, - const base::string16& path, + const std::wstring& path, bool secure, - const base::string16& extra_headers, + const std::wstring& extra_headers, const std::string& body, const net::NetworkTrafficAnnotationTag& /*traffic_annotation*/) override { const bool post_succeeds = config_->GetCurrentCalls().request_succeeds; @@ -115,11 +115,11 @@ // chrome_cleaner::HttpAgent: std::unique_ptr<chrome_cleaner::HttpResponse> Get( - const base::string16& host, + const std::wstring& host, uint16_t port, - const base::string16& path, + const std::wstring& path, bool secure, - const base::string16& extra_headers, + const std::wstring& extra_headers, const net::NetworkTrafficAnnotationTag& /*traffic_annotation*/) override { const bool get_succeeds = config_->GetCurrentCalls().request_succeeds; MockHttpAgentConfig::RequestData get_data;
diff --git a/chrome/chrome_cleaner/http/mock_http_agent_factory.h b/chrome/chrome_cleaner/http/mock_http_agent_factory.h index 5651079..1975542 100644 --- a/chrome/chrome_cleaner/http/mock_http_agent_factory.h +++ b/chrome/chrome_cleaner/http/mock_http_agent_factory.h
@@ -11,8 +11,8 @@ #include <string> #include <vector> +#include <string> #include "base/macros.h" -#include "base/strings/string16.h" #include "chrome/chrome_cleaner/http/http_agent_factory.h" #include "chrome/chrome_cleaner/http/http_status_codes.h" @@ -63,11 +63,11 @@ RequestData& operator=(const RequestData& other); - base::string16 host; + std::wstring host; uint16_t port; - base::string16 path; + std::wstring path; bool secure; - base::string16 extra_headers; + std::wstring extra_headers; std::string body; };
diff --git a/chrome/chrome_cleaner/http/user_agent.cc b/chrome/chrome_cleaner/http/user_agent.cc index d306728..42a7f04 100644 --- a/chrome/chrome_cleaner/http/user_agent.cc +++ b/chrome/chrome_cleaner/http/user_agent.cc
@@ -29,8 +29,8 @@ } // namespace -UserAgent::UserAgent(const base::string16& product_name, - const base::string16& product_version) +UserAgent::UserAgent(const std::wstring& product_name, + const std::wstring& product_version) : product_name_(product_name), product_version_(product_version), os_major_version_(0), @@ -39,7 +39,7 @@ UserAgent::~UserAgent() {} -base::string16 UserAgent::AsString() { +std::wstring UserAgent::AsString() { return product_name_ + L"/" + product_version_ + L" (Windows NT " + base::NumberToWString(os_major_version_) + L"." + base::NumberToWString(os_minor_version_) +
diff --git a/chrome/chrome_cleaner/http/user_agent.h b/chrome/chrome_cleaner/http/user_agent.h index f1072620c..171e69a 100644 --- a/chrome/chrome_cleaner/http/user_agent.h +++ b/chrome/chrome_cleaner/http/user_agent.h
@@ -6,8 +6,10 @@ #define CHROME_CHROME_CLEANER_HTTP_USER_AGENT_H_ #include <stdint.h> + +#include <string> + #include "base/macros.h" -#include "base/strings/string16.h" namespace chrome_cleaner { @@ -21,13 +23,13 @@ // attributes. The client must do so. // @param product_name The product name. // @param product_version The product version. - UserAgent(const base::string16& product_name, - const base::string16& product_version); + UserAgent(const std::wstring& product_name, + const std::wstring& product_version); ~UserAgent(); // @returns A string suitable for use as the value of a User-Agent header, and // incorporating the various properties of this class. - base::string16 AsString(); + std::wstring AsString(); // Sets the OS version. // @param major_version The OS major version number. @@ -45,17 +47,17 @@ // Sets the WinHttp library version. // @winhttp_version The WinHttp library version. - void set_winhttp_version(const base::string16& winhttp_version) { + void set_winhttp_version(const std::wstring& winhttp_version) { winhttp_version_ = winhttp_version; } private: - base::string16 product_name_; - base::string16 product_version_; + std::wstring product_name_; + std::wstring product_version_; int32_t os_major_version_; int32_t os_minor_version_; Architecture architecture_; - base::string16 winhttp_version_; + std::wstring winhttp_version_; DISALLOW_COPY_AND_ASSIGN(UserAgent); };
diff --git a/chrome/chrome_cleaner/ipc/chrome_prompt_ipc.h b/chrome/chrome_cleaner/ipc/chrome_prompt_ipc.h index cbc8b7e..824f3ccf 100644 --- a/chrome/chrome_cleaner/ipc/chrome_prompt_ipc.h +++ b/chrome/chrome_cleaner/ipc/chrome_prompt_ipc.h
@@ -11,7 +11,6 @@ #include "base/callback.h" #include "base/files/file_path.h" #include "base/sequence_checker.h" -#include "base/strings/string16.h" #include "components/chrome_cleaner/public/proto/chrome_prompt.pb.h" namespace chrome_cleaner { @@ -63,14 +62,14 @@ // response on the right thread. virtual void PostPromptUserTask( const std::vector<base::FilePath>& files_to_delete, - const std::vector<base::string16>& registry_keys, - const std::vector<base::string16>& extension_ids, + const std::vector<std::wstring>& registry_keys, + const std::vector<std::wstring>& extension_ids, PromptUserCallback callback) = 0; // Posts a PromptDisableExtensions() task to the IPC controller's thread. // Internal state must be State::kDoneInteraction when the posted task runs. virtual void PostDisableExtensionsTask( - const std::vector<base::string16>& extension_ids, + const std::vector<std::wstring>& extension_ids, DisableExtensionsCallback callback) = 0; // Calls |delete_allowed_callback| if the IPC version supports deleting
diff --git a/chrome/chrome_cleaner/ipc/ipc_test_util.cc b/chrome/chrome_cleaner/ipc/ipc_test_util.cc index 5cef565..19a1ff7 100644 --- a/chrome/chrome_cleaner/ipc/ipc_test_util.cc +++ b/chrome/chrome_cleaner/ipc/ipc_test_util.cc
@@ -90,7 +90,7 @@ } void ParentProcess::AppendSwitchNative(const std::string& switch_string, - const base::string16& value) { + const std::wstring& value) { command_line_.AppendSwitchNative(switch_string, value); }
diff --git a/chrome/chrome_cleaner/ipc/ipc_test_util.h b/chrome/chrome_cleaner/ipc/ipc_test_util.h index 1526a427..175837b 100644 --- a/chrome/chrome_cleaner/ipc/ipc_test_util.h +++ b/chrome/chrome_cleaner/ipc/ipc_test_util.h
@@ -40,7 +40,7 @@ void AppendSwitch(const std::string& switch_string); void AppendSwitch(const std::string& switch_string, const std::string& value); void AppendSwitchNative(const std::string& switch_string, - const base::string16& value); + const std::wstring& value); void AppendSwitchPath(const std::string& switch_string, const base::FilePath& value); void AppendSwitchHandleToShare(const std::string& switch_string,
diff --git a/chrome/chrome_cleaner/ipc/mock_chrome_prompt_ipc.cc b/chrome/chrome_cleaner/ipc/mock_chrome_prompt_ipc.cc index 6f74874..c47c800 100644 --- a/chrome/chrome_cleaner/ipc/mock_chrome_prompt_ipc.cc +++ b/chrome/chrome_cleaner/ipc/mock_chrome_prompt_ipc.cc
@@ -14,15 +14,15 @@ void MockChromePromptIPC::PostPromptUserTask( const std::vector<base::FilePath>& files_to_delete, - const std::vector<base::string16>& registry_keys, - const std::vector<base::string16>& extension_ids, + const std::vector<std::wstring>& registry_keys, + const std::vector<std::wstring>& extension_ids, PromptUserCallback callback) { MockPostPromptUserTask(files_to_delete, registry_keys, extension_ids, &callback); } void MockChromePromptIPC::PostDisableExtensionsTask( - const std::vector<base::string16>& extension_ids, + const std::vector<std::wstring>& extension_ids, DisableExtensionsCallback callback) { MockPostDisableExtensionsTask(extension_ids, &callback); }
diff --git a/chrome/chrome_cleaner/ipc/mock_chrome_prompt_ipc.h b/chrome/chrome_cleaner/ipc/mock_chrome_prompt_ipc.h index 06a78f3..5fd35e75 100644 --- a/chrome/chrome_cleaner/ipc/mock_chrome_prompt_ipc.h +++ b/chrome/chrome_cleaner/ipc/mock_chrome_prompt_ipc.h
@@ -28,20 +28,19 @@ // accept base::OnceCallback parameters. Will forward any calls to // MockPost*() and pass along a raw pointer for |callback|. void PostPromptUserTask(const std::vector<base::FilePath>& files_to_delete, - const std::vector<base::string16>& registry_keys, - const std::vector<base::string16>& extension_ids, + const std::vector<std::wstring>& registry_keys, + const std::vector<std::wstring>& extension_ids, PromptUserCallback callback) override; - void PostDisableExtensionsTask( - const std::vector<base::string16>& extension_ids, - DisableExtensionsCallback callback) override; + void PostDisableExtensionsTask(const std::vector<std::wstring>& extension_ids, + DisableExtensionsCallback callback) override; MOCK_METHOD4(MockPostPromptUserTask, void(const std::vector<base::FilePath>& files_to_delete, - const std::vector<base::string16>& registry_keys, - const std::vector<base::string16>& extension_ids, + const std::vector<std::wstring>& registry_keys, + const std::vector<std::wstring>& extension_ids, PromptUserCallback* callback)); MOCK_METHOD2(MockPostDisableExtensionsTask, - void(const std::vector<base::string16>& extension_ids, + void(const std::vector<std::wstring>& extension_ids, DisableExtensionsCallback* callback)); };
diff --git a/chrome/chrome_cleaner/ipc/mojo_chrome_prompt_ipc.cc b/chrome/chrome_cleaner/ipc/mojo_chrome_prompt_ipc.cc index 01b1ba9..2850333 100644 --- a/chrome/chrome_cleaner/ipc/mojo_chrome_prompt_ipc.cc +++ b/chrome/chrome_cleaner/ipc/mojo_chrome_prompt_ipc.cc
@@ -67,8 +67,8 @@ void MojoChromePromptIPC::PostPromptUserTask( const std::vector<base::FilePath>& files_to_delete, - const std::vector<base::string16>& registry_keys, - const std::vector<base::string16>& extension_ids, + const std::vector<std::wstring>& registry_keys, + const std::vector<std::wstring>& extension_ids, PromptUserCallback callback) { DCHECK(task_runner_); task_runner_->PostTask( @@ -79,7 +79,7 @@ } void MojoChromePromptIPC::PostDisableExtensionsTask( - const std::vector<base::string16>& extension_ids, + const std::vector<std::wstring>& extension_ids, DisableExtensionsCallback callback) { DCHECK(task_runner_); task_runner_->PostTask( @@ -159,8 +159,8 @@ void MojoChromePromptIPC::PromptUserCheckVersion( const std::vector<base::FilePath>& files_to_delete, - const std::vector<base::string16>& registry_keys, - const std::vector<base::string16>& extension_ids, + const std::vector<std::wstring>& registry_keys, + const std::vector<std::wstring>& extension_ids, mojom::ChromePrompt::PromptUserCallback callback, uint32_t version) { if (version >= 3) { @@ -179,8 +179,8 @@ void MojoChromePromptIPC::RunPromptUserTask( const std::vector<base::FilePath>& files_to_delete, - const std::vector<base::string16>& registry_keys, - const std::vector<base::string16>& extension_ids, + const std::vector<std::wstring>& registry_keys, + const std::vector<std::wstring>& extension_ids, PromptUserCallback callback) { DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); DCHECK(chrome_prompt_service_); @@ -212,7 +212,7 @@ } void MojoChromePromptIPC::RunDisableExtensionsTask( - const std::vector<base::string16>& extension_ids, + const std::vector<std::wstring>& extension_ids, DisableExtensionsCallback callback) { DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); DCHECK(chrome_prompt_service_);
diff --git a/chrome/chrome_cleaner/ipc/mojo_chrome_prompt_ipc.h b/chrome/chrome_cleaner/ipc/mojo_chrome_prompt_ipc.h index 996e1e3..81b0f17 100644 --- a/chrome/chrome_cleaner/ipc/mojo_chrome_prompt_ipc.h +++ b/chrome/chrome_cleaner/ipc/mojo_chrome_prompt_ipc.h
@@ -11,7 +11,6 @@ #include "base/callback_forward.h" #include "base/memory/ref_counted.h" #include "base/sequence_checker.h" -#include "base/strings/string16.h" #include "chrome/chrome_cleaner/ipc/chrome_prompt_ipc.h" #include "chrome/chrome_cleaner/ipc/mojo_task_runner.h" #include "chrome/chrome_cleaner/mojom/chrome_prompt.mojom.h" @@ -32,7 +31,7 @@ // chrome_prompt_ipc->Initialize(&error_handler); // ... // std::vector<base::FilePath> files_to_delete = ...; -// std::vector<base::string16> registry_keys = ...; +// std::vector<std::wstring> registry_keys = ...; // chrome_prompt_ipc->PostPromptUserTask( // files_to_delete, registry_keys, // base::BindOnce(&ReceivePromptResult)); @@ -56,15 +55,14 @@ // controller's thread; clients of this class are responsible for posting // response on the right thread. void PostPromptUserTask(const std::vector<base::FilePath>& files_to_delete, - const std::vector<base::string16>& registry_keys, - const std::vector<base::string16>& extension_ids, + const std::vector<std::wstring>& registry_keys, + const std::vector<std::wstring>& extension_ids, PromptUserCallback callback) override; // Posts a PromptDisableExtensions() task to the IPC controller's thread. // Internal state must be State::kDoneInteraction when the posted task runs. - void PostDisableExtensionsTask( - const std::vector<base::string16>& extension_ids, - DisableExtensionsCallback callback) override; + void PostDisableExtensionsTask(const std::vector<std::wstring>& extension_ids, + DisableExtensionsCallback callback) override; // Queries Chrome for its version of the ChromePrompt interface. If version // >= 3 calls |delete_allowed_callback|. Calls |delete_not_allowed_callback| @@ -86,13 +84,12 @@ // Runs |chrome_prompt_service_->PromptUser()|. Must be called on the IPC // thread. void RunPromptUserTask(const std::vector<base::FilePath>& files_to_delete, - const std::vector<base::string16>& registry_keys, - const std::vector<base::string16>& extension_ids, + const std::vector<std::wstring>& registry_keys, + const std::vector<std::wstring>& extension_ids, PromptUserCallback callback); - void RunDisableExtensionsTask( - const std::vector<base::string16>& extension_ids, - DisableExtensionsCallback callback); + void RunDisableExtensionsTask(const std::vector<std::wstring>& extension_ids, + DisableExtensionsCallback callback); // Callback for mojom::ChromePrompt::PromptUser, internal state must be // State::kWaitingForResponseFromChrome. Invokes callback(prompt_acceptance) @@ -113,8 +110,8 @@ void PromptUserCheckVersion( const std::vector<base::FilePath>& files_to_delete, - const std::vector<base::string16>& registry_keys, - const std::vector<base::string16>& extension_ids, + const std::vector<std::wstring>& registry_keys, + const std::vector<std::wstring>& extension_ids, mojom::ChromePrompt::PromptUserCallback callback, uint32_t version);
diff --git a/chrome/chrome_cleaner/ipc/mojo_chrome_prompt_ipc_unittest.cc b/chrome/chrome_cleaner/ipc/mojo_chrome_prompt_ipc_unittest.cc index be96613..d333c60 100644 --- a/chrome/chrome_cleaner/ipc/mojo_chrome_prompt_ipc_unittest.cc +++ b/chrome/chrome_cleaner/ipc/mojo_chrome_prompt_ipc_unittest.cc
@@ -40,8 +40,8 @@ "expected-parent-disconnected"; const base::FilePath kBadFilePath(L"/path/to/bad.dll"); -const base::string16 kBadRegistryKey(L"HKCU:32\\Software\\ugly-uws\\nasty"); -const base::string16 kExtensionId(L"expected-extension-id"); +const std::wstring kBadRegistryKey(L"HKCU:32\\Software\\ugly-uws\\nasty"); +const std::wstring kExtensionId(L"expected-extension-id"); // Possible moments when the parent process can disconnect from the IPC to // check connection error handling in the child process. @@ -96,8 +96,8 @@ void PromptUser( const std::vector<base::FilePath>& files_to_delete, - const base::Optional<std::vector<base::string16>>& registry_keys, - const base::Optional<std::vector<base::string16>>& extension_ids, + const base::Optional<std::vector<std::wstring>>& registry_keys, + const base::Optional<std::vector<std::wstring>>& extension_ids, mojom::ChromePrompt::PromptUserCallback callback) override { EXPECT_NE(test_config_.uws_expected, files_to_delete.empty()); if (test_config_.uws_expected) { @@ -112,7 +112,7 @@ CloseConnectionIf(ParentDisconnected::kOnDone); } - void DisableExtensions(const std::vector<base::string16>& extension_ids, + void DisableExtensions(const std::vector<std::wstring>& extension_ids, DisableExtensionsCallback callback) override { FAIL() << "No tests include UwE so DisableExtensions should not be called."; } @@ -174,8 +174,8 @@ CHECK(chrome_prompt_ipc); std::vector<base::FilePath> files_to_delete; - std::vector<base::string16> registry_keys; - std::vector<base::string16> extension_ids; + std::vector<std::wstring> registry_keys; + std::vector<std::wstring> extension_ids; if (uws_expected()) { files_to_delete.push_back(kBadFilePath); registry_keys.push_back(kBadRegistryKey);
diff --git a/chrome/chrome_cleaner/ipc/proto_chrome_prompt_ipc.cc b/chrome/chrome_cleaner/ipc/proto_chrome_prompt_ipc.cc index 50a110e..bda763d 100644 --- a/chrome/chrome_cleaner/ipc/proto_chrome_prompt_ipc.cc +++ b/chrome/chrome_cleaner/ipc/proto_chrome_prompt_ipc.cc
@@ -46,8 +46,8 @@ void ProtoChromePromptIPC::PostPromptUserTask( const std::vector<base::FilePath>& files_to_delete, - const std::vector<base::string16>& registry_keys, - const std::vector<base::string16>& extension_ids, + const std::vector<std::wstring>& registry_keys, + const std::vector<std::wstring>& extension_ids, PromptUserCallback callback) { DCHECK(task_runner_); task_runner_->PostTask( @@ -58,7 +58,7 @@ } void ProtoChromePromptIPC::PostDisableExtensionsTask( - const std::vector<base::string16>& extension_ids, + const std::vector<std::wstring>& extension_ids, DisableExtensionsCallback callback) { NOTIMPLEMENTED(); OnConnectionError(); @@ -82,8 +82,8 @@ void ProtoChromePromptIPC::RunPromptUserTask( const std::vector<base::FilePath>& files_to_delete, - const std::vector<base::string16>& registry_keys, - const std::vector<base::string16>& extension_ids, + const std::vector<std::wstring>& registry_keys, + const std::vector<std::wstring>& extension_ids, PromptUserCallback callback) { DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); DCHECK_NE(state_, State::kUninitialized); @@ -114,7 +114,7 @@ } } - for (const base::string16& registry_key : registry_keys) { + for (const std::wstring& registry_key : registry_keys) { std::string registry_key_utf8; if (!base::WideToUTF8(registry_key.c_str(), registry_key.size(), ®istry_key_utf8)) { @@ -125,7 +125,7 @@ } } - for (const base::string16& extension_id : extension_ids) { + for (const std::wstring& extension_id : extension_ids) { std::string extension_id_utf8; if (!base::WideToUTF8(extension_id.c_str(), extension_id.size(), &extension_id_utf8)) {
diff --git a/chrome/chrome_cleaner/ipc/proto_chrome_prompt_ipc.h b/chrome/chrome_cleaner/ipc/proto_chrome_prompt_ipc.h index b930554..4c1dfee 100644 --- a/chrome/chrome_cleaner/ipc/proto_chrome_prompt_ipc.h +++ b/chrome/chrome_cleaner/ipc/proto_chrome_prompt_ipc.h
@@ -28,13 +28,12 @@ void Initialize(ErrorHandler* error_handler) override; void PostPromptUserTask(const std::vector<base::FilePath>& files_to_delete, - const std::vector<base::string16>& registry_keys, - const std::vector<base::string16>& extension_ids, + const std::vector<std::wstring>& registry_keys, + const std::vector<std::wstring>& extension_ids, PromptUserCallback callback) override; - void PostDisableExtensionsTask( - const std::vector<base::string16>& extension_ids, - DisableExtensionsCallback callback) override; + void PostDisableExtensionsTask(const std::vector<std::wstring>& extension_ids, + DisableExtensionsCallback callback) override; void TryDeleteExtensions( base::OnceClosure delete_allowed_callback, @@ -46,8 +45,8 @@ void InitializeImpl(); void RunPromptUserTask(const std::vector<base::FilePath>& files_to_delete, - const std::vector<base::string16>& registry_keys, - const std::vector<base::string16>& extension_ids, + const std::vector<std::wstring>& registry_keys, + const std::vector<std::wstring>& extension_ids, PromptUserCallback callback); // Invokes error_handler_->OnConnectionClosed() and updates state_. This
diff --git a/chrome/chrome_cleaner/ipc/proto_chrome_prompt_ipc_unittest.cc b/chrome/chrome_cleaner/ipc/proto_chrome_prompt_ipc_unittest.cc index a8f78d4..fddab65 100644 --- a/chrome/chrome_cleaner/ipc/proto_chrome_prompt_ipc_unittest.cc +++ b/chrome/chrome_cleaner/ipc/proto_chrome_prompt_ipc_unittest.cc
@@ -44,11 +44,11 @@ 0xDFFF, 0xDBFF, 0}; const base::FilePath kInvalidFilePath(kInvalidUTF16String); const base::FilePath kNonASCIIFilePath(L"ééààçç"); -const base::string16 kInvalidRegistryKey(kInvalidUTF16String); -const base::string16 kInvalidExtensionID(kInvalidUTF16String); +const std::wstring kInvalidRegistryKey(kInvalidUTF16String); +const std::wstring kInvalidExtensionID(kInvalidUTF16String); const base::FilePath kBadFilePath(L"/path/to/bad.dll"); -const base::string16 kBadRegistryKey(L"HKCU:32\\Software\\ugly-uws\\nasty"); +const std::wstring kBadRegistryKey(L"HKCU:32\\Software\\ugly-uws\\nasty"); constexpr int kEarlyDisconnectionExitCode = 100; constexpr int kSuccessExitCode = 0; @@ -145,7 +145,7 @@ // Handles to inherit will be added to the LaunchOptions explicitly. security_attributes.bInheritHandle = false; - base::string16 pipe_name = base::UTF8ToWide( + std::wstring pipe_name = base::UTF8ToWide( base::StrCat({"\\\\.\\pipe\\chrome-cleaner-", base::UnguessableToken::Create().ToString()})); @@ -638,7 +638,7 @@ chrome_prompt_ipc.Initialize(error_handler.get()); std::vector<base::FilePath> files_to_delete; - std::vector<base::string16> registry_keys; + std::vector<std::wstring> registry_keys; if (test_config_.uws_expected) { files_to_delete.push_back(kBadFilePath); registry_keys.push_back(kBadRegistryKey);
diff --git a/chrome/chrome_cleaner/logging/cleaner_logging_service.cc b/chrome/chrome_cleaner/logging/cleaner_logging_service.cc index b764b741..fa15ad3 100644 --- a/chrome/chrome_cleaner/logging/cleaner_logging_service.cc +++ b/chrome/chrome_cleaner/logging/cleaner_logging_service.cc
@@ -5,6 +5,7 @@ #include "chrome/chrome_cleaner/logging/cleaner_logging_service.h" #include <memory> +#include <string> #include <vector> #include "base/bind.h" @@ -14,7 +15,6 @@ #include "base/files/file.h" #include "base/files/file_util.h" #include "base/logging.h" -#include "base/strings/string16.h" #include "base/strings/string_number_conversions.h" #include "base/strings/string_util.h" #include "base/strings/sys_string_conversions.h" @@ -264,10 +264,10 @@ const bool post_reboot = Rebooter::IsPostReboot(); - std::vector<base::string16> languages; + std::vector<std::wstring> languages; base::win::i18n::GetUserPreferredUILanguageList(&languages); - base::string16 chrome_version_string; + std::wstring chrome_version_string; bool chrome_version_string_succeeded = RetrieveChromeVersionAndInstalledDomain(&chrome_version_string, nullptr); @@ -468,7 +468,7 @@ } void CleanerLoggingService::AddLoadedModule( - const base::string16& name, + const std::wstring& name, ModuleHost module_host, const internal::FileInformation& file_information) { FileInformation reported_file_information; @@ -483,8 +483,8 @@ } void CleanerLoggingService::AddService( - const base::string16& display_name, - const base::string16& service_name, + const std::wstring& display_name, + const std::wstring& service_name, const internal::FileInformation& file_information) { FileInformation reported_file_information; FileInformationToProtoObject(file_information, &reported_file_information); @@ -510,7 +510,7 @@ } void CleanerLoggingService::AddProcess( - const base::string16& name, + const std::wstring& name, const internal::FileInformation& file_information) { FileInformation reported_file_information; FileInformationToProtoObject(file_information, &reported_file_information); @@ -543,7 +543,7 @@ } void CleanerLoggingService::AddLayeredServiceProvider( - const std::vector<base::string16>& guids, + const std::vector<std::wstring>& guids, const internal::FileInformation& file_information) { ChromeCleanerReport_SystemReport_LayeredServiceProvider layered_service_provider; @@ -560,9 +560,9 @@ } void CleanerLoggingService::SetWinInetProxySettings( - const base::string16& config, - const base::string16& bypass, - const base::string16& auto_config_url, + const std::wstring& config, + const std::wstring& bypass, + const std::wstring& auto_config_url, bool autodetect) { base::AutoLock lock(lock_); ChromeCleanerReport_SystemReport_SystemProxySettings* @@ -576,8 +576,8 @@ } void CleanerLoggingService::SetWinHttpProxySettings( - const base::string16& config, - const base::string16& bypass) { + const std::wstring& config, + const std::wstring& bypass) { base::AutoLock lock(lock_); ChromeCleanerReport_SystemReport_SystemProxySettings* win_http_proxy_settings = chrome_cleaner_report_.mutable_system_report() @@ -587,7 +587,7 @@ } void CleanerLoggingService::AddInstalledExtension( - const base::string16& extension_id, + const std::wstring& extension_id, ExtensionInstallMethod install_method, const std::vector<internal::FileInformation>& extension_files) { base::AutoLock lock(lock_); @@ -604,8 +604,8 @@ } void CleanerLoggingService::AddScheduledTask( - const base::string16& name, - const base::string16& description, + const std::wstring& name, + const std::wstring& description, const std::vector<internal::FileInformation>& actions) { ScheduledTask scheduled_task; scheduled_task.set_name(base::WideToUTF8(name)); @@ -623,10 +623,10 @@ } void CleanerLoggingService::AddShortcutData( - const base::string16& lnk_path, - const base::string16& executable_path, + const std::wstring& lnk_path, + const std::wstring& executable_path, const std::string& executable_hash, - const std::vector<base::string16>& command_line_arguments) { + const std::vector<std::wstring>& command_line_arguments) { base::AutoLock lock(lock_); ChromeCleanerReport_SystemReport_ShortcutData* shortcut_data = chrome_cleaner_report_.mutable_system_report()->add_shortcut_data(); @@ -662,7 +662,7 @@ if (uws.state() != UwS::REMOVABLE) continue; for (const MatchedFile& file : uws.files()) { - base::string16 sanitized_path = + std::wstring sanitized_path = base::UTF8ToWide(file.file_information().path()); RemovalStatus removal_status = status_updater->GetRemovalStatusOfSanitizedPath(sanitized_path);
diff --git a/chrome/chrome_cleaner/logging/cleaner_logging_service.h b/chrome/chrome_cleaner/logging/cleaner_logging_service.h index 1180ec1..0de9569 100644 --- a/chrome/chrome_cleaner/logging/cleaner_logging_service.h +++ b/chrome/chrome_cleaner/logging/cleaner_logging_service.h
@@ -16,7 +16,6 @@ #include "base/files/file_path.h" #include "base/memory/singleton.h" #include "base/memory/weak_ptr.h" -#include "base/strings/string16.h" #include "base/synchronization/lock.h" #include "base/threading/thread_checker.h" #include "base/values.h" @@ -69,41 +68,41 @@ void AddDetectedUwS(const UwS& uws) override; void SetExitCode(ResultCode exit_code) override; void AddLoadedModule( - const base::string16& name, + const std::wstring& name, ModuleHost host, const internal::FileInformation& file_information) override; void AddInstalledProgram(const base::FilePath& folder_path) override; - void AddService(const base::string16& display_name, - const base::string16& service_name, + void AddService(const std::wstring& display_name, + const std::wstring& service_name, const internal::FileInformation& file_information) override; - void AddProcess(const base::string16& name, + void AddProcess(const std::wstring& name, const internal::FileInformation& file_information) override; void AddRegistryValue( const internal::RegistryValue& registry_value, const std::vector<internal::FileInformation>& file_informations) override; void AddLayeredServiceProvider( - const std::vector<base::string16>& guids, + const std::vector<std::wstring>& guids, const internal::FileInformation& file_information) override; - void SetWinInetProxySettings(const base::string16& config, - const base::string16& bypass, - const base::string16& auto_config_url, + void SetWinInetProxySettings(const std::wstring& config, + const std::wstring& bypass, + const std::wstring& auto_config_url, bool autodetect) override; - void SetWinHttpProxySettings(const base::string16& config, - const base::string16& bypass) override; + void SetWinHttpProxySettings(const std::wstring& config, + const std::wstring& bypass) override; void AddInstalledExtension( - const base::string16& extension_id, + const std::wstring& extension_id, ExtensionInstallMethod install_method, const std::vector<internal::FileInformation>& extension_files) override; void AddScheduledTask( - const base::string16& name, - const base::string16& description, + const std::wstring& name, + const std::wstring& description, const std::vector<internal::FileInformation>& actions) override; void AddShortcutData( - const base::string16& lnk_path, - const base::string16& executable_path, + const std::wstring& lnk_path, + const std::wstring& executable_path, const std::string& executable_hash, - const std::vector<base::string16>& command_line_arguments) override; + const std::vector<std::wstring>& command_line_arguments) override; void SetFoundModifiedChromeShortcuts(bool found_modified_shortcuts) override; @@ -161,7 +160,7 @@ void UpdateFileRemovalStatuses(); // Cache of the strings extracted from the proper locale resource. - mutable std::map<uint32_t, base::string16> resource_strings_cache_; + mutable std::map<uint32_t, std::wstring> resource_strings_cache_; // Any access to |chrome_cleaner_report_|, |matched_files_|, and // |matched_folders_| must be protected by |lock_|. While under this lock, no
diff --git a/chrome/chrome_cleaner/logging/cleaner_logging_service_unittest.cc b/chrome/chrome_cleaner/logging/cleaner_logging_service_unittest.cc index 5ba24022..f873f5c 100644 --- a/chrome/chrome_cleaner/logging/cleaner_logging_service_unittest.cc +++ b/chrome/chrome_cleaner/logging/cleaner_logging_service_unittest.cc
@@ -923,7 +923,7 @@ FolderInformation folder_information = report.system_report().installed_programs(0).folder_information(); - const base::string16 sanitized_path = SanitizePath(installed_program_path); + const std::wstring sanitized_path = SanitizePath(installed_program_path); EXPECT_EQ(base::WideToUTF8(sanitized_path), folder_information.path()); EXPECT_FALSE(folder_information.creation_date().empty()); EXPECT_FALSE(folder_information.last_modified_date().empty()); @@ -994,7 +994,7 @@ ASSERT_TRUE(report.ParseFromString(logging_service_->RawReportContent())); ASSERT_EQ(0, report.system_report().layered_service_providers_size()); - std::vector<base::string16> guids; + std::vector<std::wstring> guids; guids.push_back(kGuid1); guids.push_back(kGuid2); logging_service_->AddLayeredServiceProvider(guids, kFileInformation1); @@ -1076,8 +1076,8 @@ ASSERT_EQ(report.system_report().installed_extensions_size(), 0); internal::FileInformation file1, file2; - const base::string16 kFilePath1 = L"path/file1"; - const base::string16 kFilePath2 = L"path/file2"; + const std::wstring kFilePath1 = L"path/file1"; + const std::wstring kFilePath2 = L"path/file2"; file1.path = kFilePath1; file2.path = kFilePath2; logging_service_->AddInstalledExtension( @@ -1509,12 +1509,11 @@ } TEST_P(CleanerLoggingServiceTest, AddShortcutData) { - const base::string16 kLnkPath = L"C:\\Users\\SomeUser"; - const base::string16 kExecutablePath1 = - L"C:\\executable_path\\executable.exe"; - const base::string16 kExecutablePath2 = L"C:\\executable_path\\bad_file.exe"; + const std::wstring kLnkPath = L"C:\\Users\\SomeUser"; + const std::wstring kExecutablePath1 = L"C:\\executable_path\\executable.exe"; + const std::wstring kExecutablePath2 = L"C:\\executable_path\\bad_file.exe"; const std::string kHash = "HASHSTRING"; - const std::vector<base::string16> kCommandLineArguments = { + const std::vector<std::wstring> kCommandLineArguments = { L"some-argument", L"-ha", L"-ha", L"-ha"}; logging_service_->AddShortcutData(kLnkPath, kExecutablePath1, kHash, {});
diff --git a/chrome/chrome_cleaner/logging/logging_service_api.cc b/chrome/chrome_cleaner/logging/logging_service_api.cc index 13bc16b..3d95df0 100644 --- a/chrome/chrome_cleaner/logging/logging_service_api.cc +++ b/chrome/chrome_cleaner/logging/logging_service_api.cc
@@ -36,7 +36,7 @@ logging_service_for_testing_ = logging_service; } -void LoggingServiceAPI::MaybeSaveLogsToFile(const base::string16& tag) { +void LoggingServiceAPI::MaybeSaveLogsToFile(const std::wstring& tag) { #if !defined(NDEBUG) // Always dump the raw logs in debug builds. const bool dump_raw_logs = true;
diff --git a/chrome/chrome_cleaner/logging/logging_service_api.h b/chrome/chrome_cleaner/logging/logging_service_api.h index 3c598eb..9a22d8ba 100644 --- a/chrome/chrome_cleaner/logging/logging_service_api.h +++ b/chrome/chrome_cleaner/logging/logging_service_api.h
@@ -9,7 +9,6 @@ #include <vector> #include "base/callback_forward.h" -#include "base/strings/string16.h" #include "base/values.h" #include "chrome/chrome_cleaner/logging/utils.h" #include "chrome/chrome_cleaner/os/disk_util_types.h" @@ -122,14 +121,14 @@ // Add a loaded module to the system report. virtual void AddLoadedModule( - const base::string16& name, + const std::wstring& name, ModuleHost host, const internal::FileInformation& file_information) = 0; // Add a running service to the system report. virtual void AddService( - const base::string16& display_name, - const base::string16& service_name, + const std::wstring& display_name, + const std::wstring& service_name, const internal::FileInformation& file_information) = 0; // Add an installed program to the system report. @@ -137,7 +136,7 @@ // Add a running process to the system report. virtual void AddProcess( - const base::string16& name, + const std::wstring& name, const internal::FileInformation& file_information) = 0; // Add a registry value |registry_value| which may have |file_informations| @@ -148,37 +147,37 @@ // Add a layered service provider to the system report. virtual void AddLayeredServiceProvider( - const std::vector<base::string16>& guids, + const std::vector<std::wstring>& guids, const internal::FileInformation& file_information) = 0; // Set the WinInetProxy settings of the system report. - virtual void SetWinInetProxySettings(const base::string16& config, - const base::string16& bypass, - const base::string16& auto_config_url, + virtual void SetWinInetProxySettings(const std::wstring& config, + const std::wstring& bypass, + const std::wstring& auto_config_url, bool autodetect) = 0; // Set the WinHttpProxy settings of the system report. - virtual void SetWinHttpProxySettings(const base::string16& config, - const base::string16& bypass) = 0; + virtual void SetWinHttpProxySettings(const std::wstring& config, + const std::wstring& bypass) = 0; // Add an installed extension to the system report. virtual void AddInstalledExtension( - const base::string16& extension_id, + const std::wstring& extension_id, ExtensionInstallMethod install_method, const std::vector<internal::FileInformation>& extension_files) = 0; // Add a scheduled task to the system report. virtual void AddScheduledTask( - const base::string16& name, - const base::string16& description, + const std::wstring& name, + const std::wstring& description, const std::vector<internal::FileInformation>& actions) = 0; // Add a ShortcutData to the system report. virtual void AddShortcutData( - const base::string16& lnk_path, - const base::string16& executable_path, + const std::wstring& lnk_path, + const std::wstring& executable_path, const std::string& executable_hash, - const std::vector<base::string16>& command_line_arguments) = 0; + const std::vector<std::wstring>& command_line_arguments) = 0; // Set |found_modified_shortcuts| in the |reporter_logs|. virtual void SetFoundModifiedChromeShortcuts( @@ -207,7 +206,7 @@ // If in debug mode or switch --dump-raw-logs is present, save the serialized // report proto to |executable||tag|.pb, where |executable| is the current // binary name. - virtual void MaybeSaveLogsToFile(const base::string16& tag); + virtual void MaybeSaveLogsToFile(const std::wstring& tag); private: static LoggingServiceAPI* logging_service_for_testing_;
diff --git a/chrome/chrome_cleaner/logging/message_builder.h b/chrome/chrome_cleaner/logging/message_builder.h index ed39b27..9e18d746 100644 --- a/chrome/chrome_cleaner/logging/message_builder.h +++ b/chrome/chrome_cleaner/logging/message_builder.h
@@ -8,7 +8,6 @@ #include <string> #include "base/macros.h" -#include "base/strings/string16.h" #include "base/strings/string_piece.h" namespace chrome_cleaner { @@ -113,7 +112,7 @@ MessageBuilder::ScopedIndent Indent(); - base::string16 content() const { return content_; } + std::wstring content() const { return content_; } protected: // Updates the current indentation level and appends a L'\n' if it's not the @@ -131,16 +130,16 @@ explicit MessageItem(base::StringPiece value); explicit MessageItem(int value); - const base::string16& value() const { return value_; } + const std::wstring& value() const { return value_; } private: - base::string16 value_; + std::wstring value_; }; void AddInternal(std::initializer_list<MessageItem> values); void IndentIfNewLine(); - base::string16 content_; + std::wstring content_; int indentation_level_ = 0; DISALLOW_COPY_AND_ASSIGN(MessageBuilder);
diff --git a/chrome/chrome_cleaner/logging/message_builder_unittest.cc b/chrome/chrome_cleaner/logging/message_builder_unittest.cc index 162e65b..331039b 100644 --- a/chrome/chrome_cleaner/logging/message_builder_unittest.cc +++ b/chrome/chrome_cleaner/logging/message_builder_unittest.cc
@@ -29,7 +29,7 @@ TEST(MessageBuilderTest, AddLine) { MessageBuilder builder; builder.AddLine(L"abc", L" ", 10).AddLine("xyz", L" ", false); - base::string16 expected = L"abc 10\nxyz 0\n"; + std::wstring expected = L"abc 10\nxyz 0\n"; EXPECT_EQ(expected, builder.content()); builder.AddLine(" test ", true).AddLine(false); @@ -40,7 +40,7 @@ TEST(MessageBuilderTest, ScopedIndentation) { MessageBuilder builder; builder.Add(L"*", L"*").NewLine(); - base::string16 expected = L"**\n"; + std::wstring expected = L"**\n"; EXPECT_EQ(expected, builder.content()); { @@ -105,7 +105,7 @@ TEST(MessageBuilderTest, AddHeaderLine) { MessageBuilder builder; builder.AddHeaderLine(L"Header1").AddHeaderLine(L"Header2"); - base::string16 expected = L"Header1:\nHeader2:\n"; + std::wstring expected = L"Header1:\nHeader2:\n"; EXPECT_EQ(expected, builder.content()); MessageBuilder::ScopedIndent scoped_indent(&builder); @@ -124,7 +124,7 @@ builder.AddFieldValueLine(L"Field1", "abc") .AddFieldValueLine(L"Field2", L"xyz"); - base::string16 expected = L"Field1: abc\nField2: xyz\n"; + std::wstring expected = L"Field1: abc\nField2: xyz\n"; EXPECT_EQ(expected, builder.content()); MessageBuilder::ScopedIndent scoped_indent(&builder);
diff --git a/chrome/chrome_cleaner/logging/mock_logging_service.h b/chrome/chrome_cleaner/logging/mock_logging_service.h index 46b40e35..f0494b5f 100644 --- a/chrome/chrome_cleaner/logging/mock_logging_service.h +++ b/chrome/chrome_cleaner/logging/mock_logging_service.h
@@ -8,7 +8,6 @@ #include <string> #include <vector> -#include "base/strings/string16.h" #include "base/values.h" #include "chrome/chrome_cleaner/logging/logging_service_api.h" #include "chrome/chrome_cleaner/logging/proto/shared_data.pb.h" @@ -46,46 +45,45 @@ MOCK_METHOD1(AddDetectedUwS, void(const UwS& uws)); MOCK_METHOD1(SetExitCode, void(ResultCode exit_code)); MOCK_METHOD3(AddLoadedModule, - void(const base::string16& name, + void(const std::wstring& name, ModuleHost host, const internal::FileInformation& file_information)); MOCK_METHOD1(AddInstalledProgram, void(const base::FilePath& folder_path)); MOCK_METHOD3(AddService, - void(const base::string16& display_name, - const base::string16& service_name, + void(const std::wstring& display_name, + const std::wstring& service_name, const internal::FileInformation& file_information)); MOCK_METHOD2(AddProcess, - void(const base::string16& name, + void(const std::wstring& name, const internal::FileInformation& file_information)); MOCK_METHOD2( AddRegistryValue, void(const internal::RegistryValue& registry_value, const std::vector<internal::FileInformation>& file_informations)); MOCK_METHOD2(AddLayeredServiceProvider, - void(const std::vector<base::string16>& guids, + void(const std::vector<std::wstring>& guids, const internal::FileInformation& file_information)); MOCK_METHOD4(SetWinInetProxySettings, - void(const base::string16& config, - const base::string16& bypass, - const base::string16& auto_config_url, + void(const std::wstring& config, + const std::wstring& bypass, + const std::wstring& auto_config_url, bool autodetect)); MOCK_METHOD2(SetWinHttpProxySettings, - void(const base::string16& config, - const base::string16& bypass)); + void(const std::wstring& config, const std::wstring& bypass)); MOCK_METHOD3( AddInstalledExtension, - void(const base::string16& extension_id, + void(const std::wstring& extension_id, ExtensionInstallMethod install_method, const std::vector<internal::FileInformation>& file_information)); MOCK_METHOD3(AddScheduledTask, - void(const base::string16& name, - const base::string16& description, + void(const std::wstring& name, + const std::wstring& description, const std::vector<internal::FileInformation>& actions)); MOCK_METHOD4(AddShortcutData, - void(const base::string16& lnk_path, - const base::string16& executable_path, + void(const std::wstring& lnk_path, + const std::wstring& executable_path, const std::string& executable_hash, - const std::vector<base::string16>& command_line_arguments)); + const std::vector<std::wstring>& command_line_arguments)); MOCK_METHOD1(SetFoundModifiedChromeShortcuts, void(bool found_modified_shortcuts)); MOCK_METHOD1(SetScannedLocations,
diff --git a/chrome/chrome_cleaner/logging/noop_logging_service.cc b/chrome/chrome_cleaner/logging/noop_logging_service.cc index d9233851..7501e3b 100644 --- a/chrome/chrome_cleaner/logging/noop_logging_service.cc +++ b/chrome/chrome_cleaner/logging/noop_logging_service.cc
@@ -57,20 +57,20 @@ void NoOpLoggingService::SetExitCode(ResultCode /*exit_code*/) {} void NoOpLoggingService::AddLoadedModule( - const base::string16& /*name*/, + const std::wstring& /*name*/, ModuleHost /*host*/, const internal::FileInformation& /*file_information*/) {} void NoOpLoggingService::AddService( - const base::string16& /*display_name*/, - const base::string16& /*service_name*/, + const std::wstring& /*display_name*/, + const std::wstring& /*service_name*/, const internal::FileInformation& /*file_information*/) {} void NoOpLoggingService::AddInstalledProgram( const base::FilePath& /*folder_path*/) {} void NoOpLoggingService::AddProcess( - const base::string16& /*name*/, + const std::wstring& /*name*/, const internal::FileInformation& /*file_information*/) {} void NoOpLoggingService::AddRegistryValue( @@ -78,34 +78,34 @@ const std::vector<internal::FileInformation>& /*file_informations*/) {} void NoOpLoggingService::AddLayeredServiceProvider( - const std::vector<base::string16>& /*guids*/, + const std::vector<std::wstring>& /*guids*/, const internal::FileInformation& /*file_information*/) {} void NoOpLoggingService::SetWinInetProxySettings( - const base::string16& /*config*/, - const base::string16& /*bypass*/, - const base::string16& /*auto_config_url*/, + const std::wstring& /*config*/, + const std::wstring& /*bypass*/, + const std::wstring& /*auto_config_url*/, bool /*autodetect*/) {} void NoOpLoggingService::SetWinHttpProxySettings( - const base::string16& /*config*/, - const base::string16& /*bypass*/) {} + const std::wstring& /*config*/, + const std::wstring& /*bypass*/) {} void NoOpLoggingService::AddInstalledExtension( - const base::string16& extension_id, + const std::wstring& extension_id, ExtensionInstallMethod install_method, const std::vector<internal::FileInformation>& extension_files) {} void NoOpLoggingService::AddScheduledTask( - const base::string16& /*name*/, - const base::string16& /*description*/, + const std::wstring& /*name*/, + const std::wstring& /*description*/, const std::vector<internal::FileInformation>& /*actions*/) {} void NoOpLoggingService::AddShortcutData( - const base::string16& /*lnk_path*/, - const base::string16& /*executable_path*/, + const std::wstring& /*lnk_path*/, + const std::wstring& /*executable_path*/, const std::string& /*executable _hash*/, - const std::vector<base::string16>& /*command_line_arguments*/) {} + const std::vector<std::wstring>& /*command_line_arguments*/) {} void NoOpLoggingService::SetFoundModifiedChromeShortcuts( bool /*found_modified_shortcuts*/) {}
diff --git a/chrome/chrome_cleaner/logging/noop_logging_service.h b/chrome/chrome_cleaner/logging/noop_logging_service.h index e2c217c..10b22a2a 100644 --- a/chrome/chrome_cleaner/logging/noop_logging_service.h +++ b/chrome/chrome_cleaner/logging/noop_logging_service.h
@@ -46,41 +46,41 @@ void AddDetectedUwS(const UwS& uws) override; void SetExitCode(ResultCode exit_code) override; void AddLoadedModule( - const base::string16& name, + const std::wstring& name, ModuleHost host, const internal::FileInformation& file_information) override; void AddInstalledProgram(const base::FilePath& folder_path) override; - void AddService(const base::string16& display_name, - const base::string16& service_name, + void AddService(const std::wstring& display_name, + const std::wstring& service_name, const internal::FileInformation& file_information) override; - void AddProcess(const base::string16& name, + void AddProcess(const std::wstring& name, const internal::FileInformation& file_information) override; void AddRegistryValue( const internal::RegistryValue& registry_value, const std::vector<internal::FileInformation>& file_informations) override; void AddLayeredServiceProvider( - const std::vector<base::string16>& guids, + const std::vector<std::wstring>& guids, const internal::FileInformation& file_information) override; - void SetWinInetProxySettings(const base::string16& config, - const base::string16& bypass, - const base::string16& auto_config_url, + void SetWinInetProxySettings(const std::wstring& config, + const std::wstring& bypass, + const std::wstring& auto_config_url, bool autodetect) override; - void SetWinHttpProxySettings(const base::string16& config, - const base::string16& bypass) override; + void SetWinHttpProxySettings(const std::wstring& config, + const std::wstring& bypass) override; void AddInstalledExtension( - const base::string16& extension_id, + const std::wstring& extension_id, ExtensionInstallMethod install_method, const std::vector<internal::FileInformation>& extension_files) override; void AddScheduledTask( - const base::string16& name, - const base::string16& description, + const std::wstring& name, + const std::wstring& description, const std::vector<internal::FileInformation>& actions) override; void AddShortcutData( - const base::string16& lnk_path, - const base::string16& executable_path, + const std::wstring& lnk_path, + const std::wstring& executable_path, const std::string& executable_hash, - const std::vector<base::string16>& command_line_arguments) override; + const std::vector<std::wstring>& command_line_arguments) override; void SetFoundModifiedChromeShortcuts(bool found_modified_shortcuts) override; void SetScannedLocations(const std::vector<UwS::TraceLocation>&) override;
diff --git a/chrome/chrome_cleaner/logging/pending_logs_service.cc b/chrome/chrome_cleaner/logging/pending_logs_service.cc index 70ca915..190aab8 100644 --- a/chrome/chrome_cleaner/logging/pending_logs_service.cc +++ b/chrome/chrome_cleaner/logging/pending_logs_service.cc
@@ -29,14 +29,14 @@ bool PendingLogsService::retrying_ = false; // static. -base::string16 PendingLogsService::LogsUploadRetryTaskName( - const base::string16& product_shortname) { +std::wstring PendingLogsService::LogsUploadRetryTaskName( + const std::wstring& product_shortname) { return product_shortname + L" logs upload retry"; } // static. void PendingLogsService::ScheduleLogsUploadTask( - const base::string16& product_shortname, + const std::wstring& product_shortname, const ChromeCleanerReport& chrome_cleaner_report, base::FilePath* log_file, RegistryLogger* registry_logger) { @@ -105,7 +105,7 @@ // static. void PendingLogsService::ClearPendingLogFile( - const base::string16& product_shortname, + const std::wstring& product_shortname, const base::FilePath& log_file, RegistryLogger* registry_logger) { DCHECK(registry_logger); @@ -130,7 +130,7 @@ PendingLogsService::~PendingLogsService() = default; void PendingLogsService::RetryNextPendingLogsUpload( - const base::string16& product_shortname, + const std::wstring& product_shortname, base::OnceCallback<void(bool)> done_callback, RegistryLogger* registry_logger) { DCHECK_CALLED_ON_VALID_THREAD(thread_checker_); @@ -168,7 +168,7 @@ } void PendingLogsService::UploadResultCallback( - const base::string16& product_shortname, + const std::wstring& product_shortname, RegistryLogger* registry_logger, bool success) { DCHECK_CALLED_ON_VALID_THREAD(thread_checker_);
diff --git a/chrome/chrome_cleaner/logging/pending_logs_service.h b/chrome/chrome_cleaner/logging/pending_logs_service.h index 1e537852..5e4a1dd 100644 --- a/chrome/chrome_cleaner/logging/pending_logs_service.h +++ b/chrome/chrome_cleaner/logging/pending_logs_service.h
@@ -5,9 +5,10 @@ #ifndef CHROME_CHROME_CLEANER_LOGGING_PENDING_LOGS_SERVICE_H_ #define CHROME_CHROME_CLEANER_LOGGING_PENDING_LOGS_SERVICE_H_ +#include <string> + #include "base/callback.h" #include "base/files/file_path.h" -#include "base/strings/string16.h" #include "base/threading/thread_checker.h" namespace chrome_cleaner { @@ -22,8 +23,8 @@ public: // Returns the name of a task to run hourly, until logs upload for the // product named |product_shortname| succeeded. - static base::string16 LogsUploadRetryTaskName( - const base::string16& product_shortname); + static std::wstring LogsUploadRetryTaskName( + const std::wstring& product_shortname); // TODO(csharp): Many of these methods receive a RegistryLogger. Maybe we // should turn it into a singleton. @@ -32,7 +33,7 @@ // again. Return the path to the temporary file where the logs were saved in // |log_file|. Caller specifies |registry_logger| so it can be mocked. static void ScheduleLogsUploadTask( - const base::string16& product_shortname, + const std::wstring& product_shortname, const ChromeCleanerReport& chrome_cleaner_report, base::FilePath* log_file, RegistryLogger* registry_logger); @@ -40,7 +41,7 @@ // Clear the specified log file from pending logs upload, and also remove // the scheduled task if there are no pending logs files in there. Caller // specifies |registry_logger| so it can be mocked. - static void ClearPendingLogFile(const base::string16& product_shortname, + static void ClearPendingLogFile(const std::wstring& product_shortname, const base::FilePath& log_file, RegistryLogger* registry_logger); @@ -51,13 +52,13 @@ // success/failure result of the logs upload, when it's done, which can be // synchronously on some failures, and asynchronously upon success. Caller // specifies |registry_logger| so it can be mocked. - void RetryNextPendingLogsUpload(const base::string16& product_shortname, + void RetryNextPendingLogsUpload(const std::wstring& product_shortname, base::OnceCallback<void(bool)> done_callback, RegistryLogger* registry_logger); private: // Callback to be registered in the logging service. - void UploadResultCallback(const base::string16& product_shortname, + void UploadResultCallback(const std::wstring& product_shortname, RegistryLogger* registry_logger, bool success);
diff --git a/chrome/chrome_cleaner/logging/registry_logger.cc b/chrome/chrome_cleaner/logging/registry_logger.cc index e1dc3ee1..7c3ac48 100644 --- a/chrome/chrome_cleaner/logging/registry_logger.cc +++ b/chrome/chrome_cleaner/logging/registry_logger.cc
@@ -60,7 +60,7 @@ return version_number; } -void CreateRegKey(base::win::RegKey* reg_key, const base::string16& path) { +void CreateRegKey(base::win::RegKey* reg_key, const std::wstring& path) { if (reg_key->Create(HKEY_CURRENT_USER, path.c_str(), KEY_SET_VALUE | KEY_QUERY_VALUE) != ERROR_SUCCESS) { PLOG(ERROR) << "Failed to open registry key" << path; @@ -165,7 +165,7 @@ void RegistryLogger::AppendLogUploadResult(bool success) { if (logging_key_.Valid()) { - base::string16 upload_results; + std::wstring upload_results; // Ignore the return value, if this fails, just overwrite what is there. LONG result = logging_key_.ReadValue(kUploadResultsValueName, &upload_results); @@ -202,8 +202,8 @@ if (!logging_key_.Valid()) return false; - base::string16 registry_value; - std::vector<base::string16> log_files; + std::wstring registry_value; + std::vector<std::wstring> log_files; if (ReadPendingLogFiles(&log_files, nullptr)) { log_files.push_back(log_file.value()); registry_value = @@ -217,7 +217,7 @@ LONG result = logging_key_.WriteValue( kPendingLogFilesValue, reinterpret_cast<const void*>(registry_value.c_str()), - registry_value.size() * sizeof(base::string16::value_type), REG_MULTI_SZ); + registry_value.size() * sizeof(std::wstring::value_type), REG_MULTI_SZ); if (result != ERROR_SUCCESS) { PLOG(ERROR) << "Failed to write '" << registry_value << "' to pending logs registry entry. Error: " << result; @@ -234,7 +234,7 @@ if (!logging_key_.Valid() || !logging_key_.HasValue(kPendingLogFilesValue)) return; - std::vector<base::string16> log_files; + std::vector<std::wstring> log_files; RegistryError registry_error = RegistryError::SUCCESS; if (!ReadPendingLogFiles(&log_files, ®istry_error)) { PLOG(WARNING) @@ -256,7 +256,7 @@ if (!logging_key_.HasValue(kPendingLogFilesValue)) return false; - std::vector<base::string16> log_files; + std::vector<std::wstring> log_files; RegistryError registry_error = RegistryError::SUCCESS; if (!ReadPendingLogFiles(&log_files, ®istry_error)) { PLOG(WARNING) << "Empty pending log files registry entry when trying to " @@ -266,7 +266,7 @@ return false; } - std::vector<base::string16>::const_iterator iter = + std::vector<std::wstring>::const_iterator iter = std::find(log_files.begin(), log_files.end(), log_file.value()); if (iter == log_files.end()) { PLOG(WARNING) << "Requested log file '" << SanitizePath(log_file) @@ -282,14 +282,14 @@ return false; } - base::string16 registry_value( + std::wstring registry_value( base::JoinString(log_files, base::WStringPiece(&kMultiSzSeparator, 1))); // REG_MULTI_SZ requires an extra \0 at the end of the string. registry_value.append(1, L'\0'); LONG result = logging_key_.WriteValue( kPendingLogFilesValue, reinterpret_cast<const void*>(registry_value.c_str()), - registry_value.size() * sizeof(base::string16::value_type), REG_MULTI_SZ); + registry_value.size() * sizeof(std::wstring::value_type), REG_MULTI_SZ); if (result != ERROR_SUCCESS) { LOG(ERROR) << "Failed to write '" << registry_value << "' to pending logs registry entry. Error: " << std::hex @@ -304,7 +304,7 @@ } bool RegistryLogger::RecordFoundPUPs(const std::vector<UwSId>& pups_to_store) { - base::string16 multi_sz_value; + std::wstring multi_sz_value; for (UwSId pup_to_store : pups_to_store) { multi_sz_value += base::NumberToWString(pup_to_store); multi_sz_value += kMultiSzSeparator; @@ -313,7 +313,7 @@ LONG result = logging_key_.WriteValue( kFoundUwsValueName, reinterpret_cast<const void*>(multi_sz_value.c_str()), - multi_sz_value.size() * sizeof(base::string16::value_type), REG_MULTI_SZ); + multi_sz_value.size() * sizeof(std::wstring::value_type), REG_MULTI_SZ); if (result != ERROR_SUCCESS) { LOG(ERROR) << "Failed to write '" << multi_sz_value @@ -351,33 +351,33 @@ } } -base::string16 RegistryLogger::GetLoggingKeyPath(Mode mode) const { - base::string16 key_path = base::string16(kSoftwareRemovalToolRegistryKey); +std::wstring RegistryLogger::GetLoggingKeyPath(Mode mode) const { + std::wstring key_path = std::wstring(kSoftwareRemovalToolRegistryKey); if (mode == Mode::REMOVER) - key_path += base::string16(L"\\") + kCleanerSubKey; + key_path += std::wstring(L"\\") + kCleanerSubKey; if (!suffix_.empty()) - key_path += base::string16(L"\\") + suffix_; + key_path += std::wstring(L"\\") + suffix_; return key_path; } -base::string16 RegistryLogger::GetScanTimesKeyPath(Mode mode) const { +std::wstring RegistryLogger::GetScanTimesKeyPath(Mode mode) const { return base::StrCat({GetLoggingKeyPath(mode), L"\\", kScanTimesSubKey}); } -base::string16 RegistryLogger::GetKeySuffix() const { +std::wstring RegistryLogger::GetKeySuffix() const { return suffix_; } // static. bool RegistryLogger::ReadValues(const base::win::RegKey& logging_key, const wchar_t* name, - std::vector<base::string16>* values, + std::vector<std::wstring>* values, RegistryError* registry_error) { DCHECK(name); DCHECK(values); values->clear(); - base::string16 content; + std::wstring content; uint32_t content_type; if (!ReadRegistryValue(logging_key, name, &content, &content_type, registry_error) || @@ -393,7 +393,7 @@ const wchar_t* buffer_end = entry + content.size(); while (entry < buffer_end && entry[0] != '\0') { const wchar_t* entry_end = std::find(entry, buffer_end, L'\0'); - base::string16 value(entry, entry_end); + std::wstring value(entry, entry_end); DCHECK(!value.empty()); values->push_back(value); entry = entry_end + 1; @@ -402,7 +402,7 @@ return true; } -bool RegistryLogger::ReadPendingLogFiles(std::vector<base::string16>* log_files, +bool RegistryLogger::ReadPendingLogFiles(std::vector<std::wstring>* log_files, RegistryError* registry_error) { DCHECK(log_files); if (!ReadValues(logging_key_, kPendingLogFilesValue, log_files,
diff --git a/chrome/chrome_cleaner/logging/registry_logger.h b/chrome/chrome_cleaner/logging/registry_logger.h index 77b5506..2222f917 100644 --- a/chrome/chrome_cleaner/logging/registry_logger.h +++ b/chrome/chrome_cleaner/logging/registry_logger.h
@@ -9,7 +9,6 @@ #include <vector> #include "base/macros.h" -#include "base/strings/string16.h" #include "base/threading/thread_checker.h" #include "base/win/registry.h" #include "chrome/chrome_cleaner/logging/safe_browsing_reporter.h" @@ -109,19 +108,19 @@ protected: // Return the full path of the key where the cleaner / reporter info is // stored. Exposed for tests. - base::string16 GetLoggingKeyPath(Mode mode) const; + std::wstring GetLoggingKeyPath(Mode mode) const; // Return the full path of the key where the PUP scan times are // stored. Exposed for tests. - base::string16 GetScanTimesKeyPath(Mode mode) const; + std::wstring GetScanTimesKeyPath(Mode mode) const; // Return the registry key suffix. Exposed for tests. - base::string16 GetKeySuffix() const; + std::wstring GetKeySuffix() const; // Read values from the given registry key. Exposed for tests. static bool ReadValues(const base::win::RegKey& logging_key, const wchar_t* name, - std::vector<base::string16>* values, + std::vector<std::wstring>* values, RegistryError* registry_error); // Exposed for testing. @@ -129,14 +128,14 @@ static const size_t kMaxUploadResultLength; private: - bool ReadPendingLogFiles(std::vector<base::string16>* log_files, + bool ReadPendingLogFiles(std::vector<std::wstring>* log_files, RegistryError* registry_error); THREAD_CHECKER(thread_checker_); base::win::RegKey logging_key_; base::win::RegKey scan_times_key_; Mode mode_; - base::string16 suffix_; + std::wstring suffix_; DISALLOW_COPY_AND_ASSIGN(RegistryLogger); };
diff --git a/chrome/chrome_cleaner/logging/registry_logger_unittest.cc b/chrome/chrome_cleaner/logging/registry_logger_unittest.cc index 1662147..0ec7cc6 100644 --- a/chrome/chrome_cleaner/logging/registry_logger_unittest.cc +++ b/chrome/chrome_cleaner/logging/registry_logger_unittest.cc
@@ -53,11 +53,11 @@ if (!logging_key.Valid()) return false; - std::vector<base::string16> existing_pups; + std::vector<std::wstring> existing_pups; bool success = true; if (logger.ReadValues(logging_key, kFoundUwsValueName, &existing_pups, nullptr)) { - for (base::string16 pup_id_string : existing_pups) { + for (std::wstring pup_id_string : existing_pups) { UwSId pup_id = 0; if (base::StringToUint(pup_id_string, &pup_id)) stored_pups->insert(pup_id); @@ -110,7 +110,7 @@ base::win::RegKey logging_key; ASSERT_TRUE(OpenLoggingRegKey(&logging_key, logger, KEY_QUERY_VALUE, mode)); - base::string16 upload_results; + std::wstring upload_results; LONG result = logging_key.ReadValue(kUploadResultsValueName, &upload_results); EXPECT_EQ(ERROR_SUCCESS, result); EXPECT_STREQ(L"1;0;0;", upload_results.c_str()); @@ -145,11 +145,11 @@ base::win::RegKey logging_key; ASSERT_TRUE(OpenLoggingRegKey(&logging_key, logger, KEY_QUERY_VALUE, mode)); - base::string16 upload_results; + std::wstring upload_results; LONG result = logging_key.ReadValue(kUploadResultsValueName, &upload_results); EXPECT_EQ(ERROR_SUCCESS, result); - base::string16 expected_string; + std::wstring expected_string; for (size_t i = 0; i < kMaxNumUploadResults; ++i) expected_string += L"1;"; @@ -336,8 +336,7 @@ // This checks directly for the company name Google, instead of using // COMPANY_SHORTNAME_STRING, because it's used for communication with Chrome // so it needs to use Chrome's company name. - const base::string16 expected_name = - L"Software\\Google\\Software Removal Tool"; + const std::wstring expected_name = L"Software\\Google\\Software Removal Tool"; EXPECT_EQ(expected_name, logger.GetLoggingKeyPath(mode)); } @@ -346,15 +345,15 @@ TestRegistryLogger logger(mode, kTestSuffix); TestRegistryLogger no_suffix_logger(mode); - base::string16 key_name = no_suffix_logger.GetLoggingKeyPath(mode); - EXPECT_EQ(base::string16::npos, + std::wstring key_name = no_suffix_logger.GetLoggingKeyPath(mode); + EXPECT_EQ(std::wstring::npos, key_name.find(base::UTF8ToWide(kTestSuffix).c_str())); // This checks directly for the company name Google, instead of using // COMPANY_SHORTNAME_STRING, because it's used for communication with Chrome // so it needs to use Chrome's company name. key_name = logger.GetLoggingKeyPath(mode); - const base::string16 expected_name = + const std::wstring expected_name = base::StrCat({L"Software\\Google\\Software Removal Tool\\", base::UTF8ToWide(kTestSuffix)}); EXPECT_EQ(expected_name, key_name);
diff --git a/chrome/chrome_cleaner/logging/reporter_logging_service.cc b/chrome/chrome_cleaner/logging/reporter_logging_service.cc index ecb92a08..9c54859 100644 --- a/chrome/chrome_cleaner/logging/reporter_logging_service.cc +++ b/chrome/chrome_cleaner/logging/reporter_logging_service.cc
@@ -121,15 +121,15 @@ void ReporterLoggingService::Initialize(RegistryLogger* registry_logger) { DCHECK(!initialized_) << "LoggingService already initialized."; - std::vector<base::string16> languages; + std::vector<std::wstring> languages; base::win::i18n::GetUserPreferredUILanguageList(&languages); - base::string16 version_string; + std::wstring version_string; bool version_string_succeeded = RetrieveChromeVersionAndInstalledDomain(&version_string, nullptr); int channel = 0; bool has_chrome_channel = GetChromeChannelFromCommandLine(&channel); Settings* settings = Settings::GetInstance(); - base::string16 session_id = settings->session_id(); + std::wstring session_id = settings->session_id(); const Engine::Name engine = settings->engine(); const std::string engine_version = settings->engine_version(); @@ -243,20 +243,20 @@ } void ReporterLoggingService::AddLoadedModule( - const base::string16& /*name*/, + const std::wstring& /*name*/, ModuleHost /*host*/, const internal::FileInformation& /*file_information*/) {} void ReporterLoggingService::AddService( - const base::string16& /*display_name*/, - const base::string16& /*service_name*/, + const std::wstring& /*display_name*/, + const std::wstring& /*service_name*/, const internal::FileInformation& /*file_information*/) {} void ReporterLoggingService::AddInstalledProgram( const base::FilePath& /*folder_path*/) {} void ReporterLoggingService::AddProcess( - const base::string16& /*name*/, + const std::wstring& /*name*/, const internal::FileInformation& /*file_information*/) {} void ReporterLoggingService::AddRegistryValue( @@ -264,34 +264,34 @@ const std::vector<internal::FileInformation>& /*file_informations*/) {} void ReporterLoggingService::AddLayeredServiceProvider( - const std::vector<base::string16>& /*guids*/, + const std::vector<std::wstring>& /*guids*/, const internal::FileInformation& /*file_information*/) {} void ReporterLoggingService::SetWinInetProxySettings( - const base::string16& /*config*/, - const base::string16& /*bypass*/, - const base::string16& /*auto_config_url*/, + const std::wstring& /*config*/, + const std::wstring& /*bypass*/, + const std::wstring& /*auto_config_url*/, bool /*autodetect*/) {} void ReporterLoggingService::SetWinHttpProxySettings( - const base::string16& /*config*/, - const base::string16& /*bypass*/) {} + const std::wstring& /*config*/, + const std::wstring& /*bypass*/) {} void ReporterLoggingService::AddInstalledExtension( - const base::string16& extension_id, + const std::wstring& extension_id, ExtensionInstallMethod install_method, const std::vector<internal::FileInformation>& extension_files) {} void ReporterLoggingService::AddScheduledTask( - const base::string16& /*name*/, - const base::string16& /*description*/, + const std::wstring& /*name*/, + const std::wstring& /*description*/, const std::vector<internal::FileInformation>& /*actions*/) {} void ReporterLoggingService::AddShortcutData( - const base::string16& /*lnk_path*/, - const base::string16& /*executable_path*/, + const std::wstring& /*lnk_path*/, + const std::wstring& /*executable_path*/, const std::string& /*executable _hash*/, - const std::vector<base::string16>& /*command_line_arguments*/) {} + const std::vector<std::wstring>& /*command_line_arguments*/) {} void ReporterLoggingService::SetFoundModifiedChromeShortcuts( bool found_modified_shortcuts) {
diff --git a/chrome/chrome_cleaner/logging/reporter_logging_service.h b/chrome/chrome_cleaner/logging/reporter_logging_service.h index b9c8b2ab..504f785 100644 --- a/chrome/chrome_cleaner/logging/reporter_logging_service.h +++ b/chrome/chrome_cleaner/logging/reporter_logging_service.h
@@ -50,41 +50,41 @@ void AddDetectedUwS(const UwS& uws) override; void SetExitCode(ResultCode exit_code) override; void AddLoadedModule( - const base::string16& name, + const std::wstring& name, ModuleHost host, const internal::FileInformation& file_information) override; void AddInstalledProgram(const base::FilePath& folder_path) override; - void AddService(const base::string16& display_name, - const base::string16& service_name, + void AddService(const std::wstring& display_name, + const std::wstring& service_name, const internal::FileInformation& file_information) override; - void AddProcess(const base::string16& name, + void AddProcess(const std::wstring& name, const internal::FileInformation& file_information) override; void AddRegistryValue( const internal::RegistryValue& registry_value, const std::vector<internal::FileInformation>& file_informations) override; void AddLayeredServiceProvider( - const std::vector<base::string16>& guids, + const std::vector<std::wstring>& guids, const internal::FileInformation& file_information) override; - void SetWinInetProxySettings(const base::string16& config, - const base::string16& bypass, - const base::string16& auto_config_url, + void SetWinInetProxySettings(const std::wstring& config, + const std::wstring& bypass, + const std::wstring& auto_config_url, bool autodetect) override; - void SetWinHttpProxySettings(const base::string16& config, - const base::string16& bypass) override; + void SetWinHttpProxySettings(const std::wstring& config, + const std::wstring& bypass) override; void AddInstalledExtension( - const base::string16& extension_id, + const std::wstring& extension_id, ExtensionInstallMethod install_method, const std::vector<internal::FileInformation>& extension_files) override; void AddScheduledTask( - const base::string16& name, - const base::string16& description, + const std::wstring& name, + const std::wstring& description, const std::vector<internal::FileInformation>& actions) override; void AddShortcutData( - const base::string16& lnk_path, - const base::string16& executable_path, + const std::wstring& lnk_path, + const std::wstring& executable_path, const std::string& executable_hash, - const std::vector<base::string16>& command_line_arguments) override; + const std::vector<std::wstring>& command_line_arguments) override; void SetFoundModifiedChromeShortcuts(bool found_modified_shortcuts) override;
diff --git a/chrome/chrome_cleaner/logging/scoped_logging.h b/chrome/chrome_cleaner/logging/scoped_logging.h index 5caacee..868f11b 100644 --- a/chrome/chrome_cleaner/logging/scoped_logging.h +++ b/chrome/chrome_cleaner/logging/scoped_logging.h
@@ -5,14 +5,15 @@ #ifndef CHROME_CHROME_CLEANER_LOGGING_SCOPED_LOGGING_H_ #define CHROME_CHROME_CLEANER_LOGGING_SCOPED_LOGGING_H_ +#include <string> + #include "base/files/file_path.h" #include "base/macros.h" -#include "base/strings/string16.h" namespace chrome_cleaner { // A utility to print the "Null" string for null wchar_t*. -base::string16 ConvertIfNull(const wchar_t* str); +std::wstring ConvertIfNull(const wchar_t* str); // Un/Initialize the logging machinery. A |suffix| can be appended to the log // file name if necessary.
diff --git a/chrome/chrome_cleaner/logging/utils_unittest.cc b/chrome/chrome_cleaner/logging/utils_unittest.cc index 301cb53..f8fa39c4 100644 --- a/chrome/chrome_cleaner/logging/utils_unittest.cc +++ b/chrome/chrome_cleaner/logging/utils_unittest.cc
@@ -68,7 +68,7 @@ // Returns all files in |files| that start with a fixed pattern. class PrefixInfoSampler : public InfoSampler { public: - explicit PrefixInfoSampler(const base::string16& prefix) : prefix_(prefix) {} + explicit PrefixInfoSampler(const std::wstring& prefix) : prefix_(prefix) {} void SelectPathSetToSample(const FilePathSet& files, FilePathSet* sampled_file_paths) override { @@ -81,7 +81,7 @@ } private: - const base::string16 prefix_; + const std::wstring prefix_; }; class PUPToUwSTest : public ::testing::TestWithParam<bool> { @@ -118,7 +118,7 @@ test_pup_data_.AddPUP(kTestPUPId, PUPData::FLAGS_NONE, nullptr, PUPData::kMaxFilesToRemoveSmallUwS); for (const auto& expectation : expectations_) { - const base::string16 filename = expectation.first; + const std::wstring filename = expectation.first; test_pup_data_.AddDiskFootprint(kTestPUPId, CSIDL_STARTUP, filename.c_str(), PUPData::DISK_MATCH_ANY_FILE); @@ -133,7 +133,7 @@ PUPData::PUP* pup = PUPData::GetPUP(kTestPUPId); DCHECK(pup); for (const auto& expectation : expectations_) { - const base::string16 filename = expectation.first; + const std::wstring filename = expectation.first; pup->AddDiskFootprint(temp_dir_.GetPath().Append(filename)); } return pup; @@ -143,7 +143,7 @@ bool is_cleaning_; PrefixInfoSampler sampler_; - std::map<base::string16, FileFlags> expectations_; + std::map<std::wstring, FileFlags> expectations_; base::ScopedTempDir temp_dir_; TestPUPData test_pup_data_; }; @@ -158,13 +158,13 @@ // Loop through all converted files and make sure each was converted // correctly. - std::vector<base::string16> converted_files; + std::vector<std::wstring> converted_files; for (int i = 0; i < uws.files_size(); ++i) { ASSERT_TRUE(uws.files(i).has_file_information()); const FileInformation& file_info = uws.files(i).file_information(); ASSERT_TRUE(file_info.has_path()); base::FilePath file_path(base::UTF8ToWide(file_info.path())); - base::string16 uws_filename = + std::wstring uws_filename = base::ToLowerASCII(file_path.BaseName().value()); converted_files.push_back(uws_filename); @@ -177,7 +177,7 @@ EXPECT_EQ(expectation->second.has_details, file_info.has_sha256()); } - std::vector<base::string16> expected_files; + std::vector<std::wstring> expected_files; for (const auto& expectation : expectations_) expected_files.push_back(expectation.first); EXPECT_THAT(converted_files,
diff --git a/chrome/chrome_cleaner/mojom/typemaps/footprints.typemap b/chrome/chrome_cleaner/mojom/typemaps/footprints.typemap index a51286b..f477dda 100644 --- a/chrome/chrome_cleaner/mojom/typemaps/footprints.typemap +++ b/chrome/chrome_cleaner/mojom/typemaps/footprints.typemap
@@ -3,10 +3,7 @@ # found in the LICENSE file. mojom = "//chrome/chrome_cleaner/mojom/footprints.mojom" -public_headers = [ - "//base/files/file_path.h", - "//base/strings/string16.h", -] +public_headers = [ "//base/files/file_path.h" ] traits_headers = [ "//chrome/chrome_cleaner/mojom/typemaps/footprints_mojom_traits.h" ] sources =
diff --git a/chrome/services/sharing/nearby/nearby_connections.cc b/chrome/services/sharing/nearby/nearby_connections.cc index 4002638..e008a4f 100644 --- a/chrome/services/sharing/nearby/nearby_connections.cc +++ b/chrome/services/sharing/nearby/nearby_connections.cc
@@ -171,6 +171,73 @@ core_->StopDiscovery(ResultCallbackFromMojom(std::move(callback))); } +void NearbyConnections::RequestConnection( + const std::vector<uint8_t>& endpoint_info, + const std::string& endpoint_id, + mojo::PendingRemote<mojom::ConnectionLifecycleListener> listener, + RequestConnectionCallback callback) { + mojo::SharedRemote<mojom::ConnectionLifecycleListener> remote( + std::move(listener)); + ConnectionRequestInfo connection_request_info{ + .name = std::string(endpoint_info.begin(), endpoint_info.end()), + .listener = { + .initiated_cb = + [remote](const std::string& endpoint_id, + const ConnectionResponseInfo& info) { + if (!remote) + return; + + remote->OnConnectionInitiated( + endpoint_id, + mojom::ConnectionInfo::New( + info.authentication_token, + ByteArrayToMojom(info.raw_authentication_token), + ByteArrayToMojom(info.endpoint_info), + info.is_incoming_connection)); + }, + .accepted_cb = + [remote](const std::string& endpoint_id) { + if (!remote) + return; + + remote->OnConnectionAccepted(endpoint_id); + }, + .rejected_cb = + [remote](const std::string& endpoint_id, Status status) { + if (!remote) + return; + + remote->OnConnectionRejected(endpoint_id, + StatusToMojom(status.value)); + }, + .disconnected_cb = + [remote](const std::string& endpoint_id) { + if (!remote) + return; + + remote->OnDisconnected(endpoint_id); + }, + .bandwidth_changed_cb = + [remote](const std::string& endpoint_id, std::int32_t quality) { + if (!remote) + return; + + remote->OnBandwidthChanged(endpoint_id, quality); + }, + }}; + ResultCallback result_callback = ResultCallbackFromMojom(std::move(callback)); + + core_->RequestConnection(endpoint_id, std::move(connection_request_info), + std::move(result_callback)); +} + +void NearbyConnections::DisconnectFromEndpoint( + const std::string& endpoint_id, + DisconnectFromEndpointCallback callback) { + core_->DisconnectFromEndpoint(endpoint_id, + ResultCallbackFromMojom(std::move(callback))); +} + } // namespace connections } // namespace nearby } // namespace location
diff --git a/chrome/services/sharing/nearby/nearby_connections.h b/chrome/services/sharing/nearby/nearby_connections.h index 33a96bc..5535561 100644 --- a/chrome/services/sharing/nearby/nearby_connections.h +++ b/chrome/services/sharing/nearby/nearby_connections.h
@@ -61,6 +61,13 @@ mojo::PendingRemote<mojom::EndpointDiscoveryListener> listener, StartDiscoveryCallback callback) override; void StopDiscovery(StopDiscoveryCallback callback) override; + void RequestConnection( + const std::vector<uint8_t>& endpoint_info, + const std::string& endpoint_id, + mojo::PendingRemote<mojom::ConnectionLifecycleListener> listener, + RequestConnectionCallback callback) override; + void DisconnectFromEndpoint(const std::string& endpoint_id, + DisconnectFromEndpointCallback callback) override; private: void OnDisconnect();
diff --git a/chrome/services/sharing/nearby/nearby_connections_conversions.cc b/chrome/services/sharing/nearby/nearby_connections_conversions.cc index 0f86124a..a9afab5a 100644 --- a/chrome/services/sharing/nearby/nearby_connections_conversions.cc +++ b/chrome/services/sharing/nearby/nearby_connections_conversions.cc
@@ -4,6 +4,8 @@ #include "chrome/services/sharing/nearby/nearby_connections_conversions.h" +#include <utility> + #include "base/callback.h" #include "base/files/file_path.h" #include "chrome/services/sharing/public/mojom/nearby_connections.mojom.h" @@ -74,6 +76,11 @@ }}; } +std::vector<uint8_t> ByteArrayToMojom(const ByteArray& byte_array) { + return std::vector<uint8_t>(byte_array.data(), + byte_array.data() + byte_array.size()); +} + } // namespace connections } // namespace nearby } // namespace location
diff --git a/chrome/services/sharing/nearby/nearby_connections_conversions.h b/chrome/services/sharing/nearby/nearby_connections_conversions.h index 18fdd4a..cd045da 100644 --- a/chrome/services/sharing/nearby/nearby_connections_conversions.h +++ b/chrome/services/sharing/nearby/nearby_connections_conversions.h
@@ -26,6 +26,8 @@ ResultCallback ResultCallbackFromMojom(StatusCallback callback); +std::vector<uint8_t> ByteArrayToMojom(const ByteArray& byte_array); + } // namespace connections } // namespace nearby } // namespace location
diff --git a/chrome/services/sharing/nearby/nearby_connections_unittest.cc b/chrome/services/sharing/nearby/nearby_connections_unittest.cc index cda2b37d..b1ffd31 100644 --- a/chrome/services/sharing/nearby/nearby_connections_unittest.cc +++ b/chrome/services/sharing/nearby/nearby_connections_unittest.cc
@@ -4,6 +4,7 @@ #include "chrome/services/sharing/nearby/nearby_connections.h" +#include <stdint.h> #include <memory> #include <utility> @@ -31,7 +32,11 @@ const char kServiceId[] = "service-id"; const char kRemoteEndpointId[] = "remote_endpoint_id"; +const char kEndpointInfo[] = {0x0d, 0x07, 0x07, 0x07, 0x07}; const char kRemoteEndpointInfo[] = {0x0d, 0x07, 0x06, 0x08, 0x09}; +const char kAuthenticationToken[] = "authentication_token"; +const char kRawAuthenticationToken[] = {0x00, 0x05, 0x04, 0x03, 0x02}; +const int32_t kQuality = 5201314; } // namespace @@ -54,6 +59,45 @@ base::DoNothing(); }; +class FakeConnectionLifecycleListener + : public mojom::ConnectionLifecycleListener { + public: + void OnConnectionInitiated(const std::string& endpoint_id, + mojom::ConnectionInfoPtr info) override { + initiated_cb.Run(endpoint_id, std::move(info)); + } + + void OnConnectionAccepted(const std::string& endpoint_id) override { + accepted_cb.Run(endpoint_id); + } + + void OnConnectionRejected(const std::string& endpoint_id, + mojom::Status status) override { + rejected_cb.Run(endpoint_id, status); + } + + void OnDisconnected(const std::string& endpoint_id) override { + disconnected_cb.Run(endpoint_id); + } + + void OnBandwidthChanged(const std::string& endpoint_id, + int32_t quality) override { + bandwidth_changed_cb.Run(endpoint_id, quality); + } + + mojo::Receiver<mojom::ConnectionLifecycleListener> receiver{this}; + base::RepeatingCallback<void(const std::string&, mojom::ConnectionInfoPtr)> + initiated_cb = base::DoNothing(); + base::RepeatingCallback<void(const std::string&)> accepted_cb = + base::DoNothing(); + base::RepeatingCallback<void(const std::string&, mojom::Status)> rejected_cb = + base::DoNothing(); + base::RepeatingCallback<void(const std::string&)> disconnected_cb = + base::DoNothing(); + base::RepeatingCallback<void(const std::string&, int32_t)> + bandwidth_changed_cb = base::DoNothing(); +}; + class NearbyConnectionsTest : public testing::Test { public: NearbyConnectionsTest() { @@ -190,6 +234,178 @@ EXPECT_CALL(*service_controller_ptr_, StopDiscovery(testing::_)).Times(1); } +TEST_F(NearbyConnectionsTest, RequestConnection) { + FakeConnectionLifecycleListener fake_connection_life_cycle_listener; + + EXPECT_CALL(*service_controller_ptr_, StartDiscovery) + .WillOnce([](ClientProxy* client, const std::string& service_id, + const ConnectionOptions& options, + const DiscoveryListener& listener) { + client->StartedDiscovery(service_id, options.strategy, listener, + /*mediums=*/{}); + client->OnEndpointFound(kServiceId, kRemoteEndpointId, + std::string(std::begin(kRemoteEndpointInfo), + std::end(kRemoteEndpointInfo)), + /*mediums=*/{}); + return Status{Status::kSuccess}; + }); + + base::RunLoop start_discovery_run_loop; + FakeEndpointDiscoveryListener fake_discovery_listener; + nearby_connections_->StartDiscovery( + kServiceId, + mojom::DiscoveryOptions::New(mojom::Strategy::kP2pPointToPoint), + fake_discovery_listener.receiver.BindNewPipeAndPassRemote(), + base::BindLambdaForTesting([&](mojom::Status status) { + EXPECT_EQ(mojom::Status::kSuccess, status); + start_discovery_run_loop.Quit(); + })); + start_discovery_run_loop.Run(); + + ClientProxy* client_proxy; + ConnectionListener connections_listener; + EXPECT_CALL(*service_controller_ptr_, RequestConnection) + .WillOnce([&client_proxy, &connections_listener]( + ClientProxy* client, const std::string& endpoint_id, + const ConnectionRequestInfo& info) { + client_proxy = client; + connections_listener = info.listener; + EXPECT_EQ(kRemoteEndpointId, endpoint_id); + EXPECT_EQ( + std::string(std::begin(kEndpointInfo), std::end(kEndpointInfo)), + info.name); + return Status{Status::kSuccess}; + }); + + base::RunLoop request_connection_run_loop; + nearby_connections_->RequestConnection( + std::vector<uint8_t>(std::begin(kEndpointInfo), std::end(kEndpointInfo)), + kRemoteEndpointId, + fake_connection_life_cycle_listener.receiver.BindNewPipeAndPassRemote(), + base::BindLambdaForTesting([&](mojom::Status status) { + EXPECT_EQ(mojom::Status::kSuccess, status); + request_connection_run_loop.Quit(); + })); + request_connection_run_loop.Run(); + + base::RunLoop initiated_run_loop; + fake_connection_life_cycle_listener.initiated_cb = base::BindLambdaForTesting( + [&](const std::string& endpoint_id, mojom::ConnectionInfoPtr info) { + EXPECT_EQ(kRemoteEndpointId, endpoint_id); + EXPECT_EQ(kAuthenticationToken, info->authentication_token); + EXPECT_EQ(std::vector<uint8_t>(std::begin(kRawAuthenticationToken), + std::end(kRawAuthenticationToken)), + info->raw_authentication_token); + EXPECT_EQ(std::vector<uint8_t>(std::begin(kRemoteEndpointInfo), + std::end(kRemoteEndpointInfo)), + info->endpoint_info); + EXPECT_FALSE(info->is_incoming_connection); + initiated_run_loop.Quit(); + }); + client_proxy->OnConnectionInitiated( + kRemoteEndpointId, + {.authentication_token = kAuthenticationToken, + .raw_authentication_token = + ByteArray(kRawAuthenticationToken, sizeof(kRawAuthenticationToken)), + .endpoint_info = + ByteArray(kRemoteEndpointInfo, sizeof(kRemoteEndpointInfo)), + .is_incoming_connection = false}, + connections_listener); + initiated_run_loop.Run(); + + base::RunLoop rejected_run_loop; + fake_connection_life_cycle_listener.rejected_cb = base::BindLambdaForTesting( + [&](const std::string& endpoint_id, mojom::Status status) { + EXPECT_EQ(kRemoteEndpointId, endpoint_id); + EXPECT_EQ(mojom::Status::kConnectionRejected, status); + rejected_run_loop.Quit(); + }); + client_proxy->OnConnectionRejected(kRemoteEndpointId, + {Status::kConnectionRejected}); + rejected_run_loop.Run(); + + // Initiate connection again to test accepted flow. + base::RunLoop initiated_run_loop_2; + fake_connection_life_cycle_listener.initiated_cb = base::BindLambdaForTesting( + [&](const std::string& endpoint_id, mojom::ConnectionInfoPtr info) { + EXPECT_EQ(kRemoteEndpointId, endpoint_id); + EXPECT_FALSE(info->is_incoming_connection); + initiated_run_loop_2.Quit(); + }); + client_proxy->OnConnectionInitiated(kRemoteEndpointId, + {.is_incoming_connection = false}, + connections_listener); + initiated_run_loop_2.Run(); + + base::RunLoop accepted_run_loop; + fake_connection_life_cycle_listener.accepted_cb = + base::BindLambdaForTesting([&](const std::string& endpoint_id) { + EXPECT_EQ(kRemoteEndpointId, endpoint_id); + accepted_run_loop.Quit(); + }); + client_proxy->OnConnectionAccepted(kRemoteEndpointId); + accepted_run_loop.Run(); + + base::RunLoop bandwidth_changed_run_loop; + fake_connection_life_cycle_listener.bandwidth_changed_cb = + base::BindLambdaForTesting( + [&](const std::string& endpoint_id, int32_t quality) { + EXPECT_EQ(kRemoteEndpointId, endpoint_id); + EXPECT_EQ(kQuality, quality); + bandwidth_changed_run_loop.Quit(); + }); + client_proxy->OnBandwidthChanged(kRemoteEndpointId, kQuality); + bandwidth_changed_run_loop.Run(); + + base::RunLoop disconnected_run_loop; + fake_connection_life_cycle_listener.disconnected_cb = + base::BindLambdaForTesting([&](const std::string& endpoint_id) { + EXPECT_EQ(kRemoteEndpointId, endpoint_id); + disconnected_run_loop.Quit(); + }); + client_proxy->OnDisconnected(kRemoteEndpointId, /*notify=*/true); + disconnected_run_loop.Run(); + + // Initiate and accept connection again to test DisconnectFromEndpoint. + base::RunLoop initiated_run_loop_3; + fake_connection_life_cycle_listener.initiated_cb = base::BindLambdaForTesting( + [&](const std::string& endpoint_id, mojom::ConnectionInfoPtr info) { + EXPECT_EQ(kRemoteEndpointId, endpoint_id); + EXPECT_FALSE(info->is_incoming_connection); + initiated_run_loop_3.Quit(); + }); + client_proxy->OnConnectionInitiated(kRemoteEndpointId, + {.is_incoming_connection = false}, + connections_listener); + initiated_run_loop_3.Run(); + + base::RunLoop accepted_run_loop_2; + fake_connection_life_cycle_listener.accepted_cb = + base::BindLambdaForTesting([&](const std::string& endpoint_id) { + EXPECT_EQ(kRemoteEndpointId, endpoint_id); + accepted_run_loop_2.Quit(); + }); + client_proxy->OnConnectionAccepted(kRemoteEndpointId); + accepted_run_loop_2.Run(); + + EXPECT_CALL(*service_controller_ptr_, DisconnectFromEndpoint) + .WillOnce([](ClientProxy* client, const std::string& endpoint_id) { + EXPECT_EQ(kRemoteEndpointId, endpoint_id); + return Status{Status::kSuccess}; + }); + + base::RunLoop disconnect_from_endpoint_run_loop; + nearby_connections_->DisconnectFromEndpoint( + kRemoteEndpointId, base::BindLambdaForTesting([&](mojom::Status status) { + EXPECT_EQ(mojom::Status::kSuccess, status); + disconnect_from_endpoint_run_loop.Quit(); + })); + disconnect_from_endpoint_run_loop.Run(); + + // DisconnectFromEndpoint is also called when Core is destroyed. + EXPECT_CALL(*service_controller_ptr_, DisconnectFromEndpoint).Times(1); +} + } // namespace connections } // namespace nearby } // namespace location
diff --git a/chrome/services/sharing/public/mojom/nearby_connections.mojom b/chrome/services/sharing/public/mojom/nearby_connections.mojom index 864afff..ac9379d 100644 --- a/chrome/services/sharing/public/mojom/nearby_connections.mojom +++ b/chrome/services/sharing/public/mojom/nearby_connections.mojom
@@ -43,6 +43,54 @@ OnEndpointLost(string endpoint_id); }; +// Listener for lifecycle events associated with a connection to a remote +// endpoint. Methods in this interface are called from utiltiiy process, and is +// used by the browser process to listen for connection status associated with +// remote endpoints. +interface ConnectionLifecycleListener { + // A basic encrypted channel has been created between this device and the + // the remote endpoint. Both sides are now asked if they wish to accept or + // reject the connection before any data can be sent over this channel. + // + // Optionally, caller can verify if this device is connected to the correct + // remote before accepting the connection. Typically this involves showing + // ConnectionInfo::authentication_token on both devices and having the users + // manually compare and confirm. Both devices are given an identical + // authentication token. + // + // Call NearbyConnections::AcceptConnection() to accept the connection, or + // NearbyConnections::RejectConnection() to close the connection. + // + // endpoint_id - The identifier for the remote endpoint. + // info - Other relevant information about the connection. + OnConnectionInitiated(string endpoint_id, ConnectionInfo info); + + // Called after both sides have accepted the connection. + // + // endpoint_id - The identifier for the remote endpoint. + OnConnectionAccepted(string endpoint_id); + + // Called when either side rejected the connection. + // Call NearbyConnections::DisconnectFromEndpoint() to terminate connection. + // + // endpoint_id - The identifier for the remote endpoint. + // status - The result of the connection. Valid values are + // Status::kSuccess and Status::kConnectionRejected}. + OnConnectionRejected(string endpoint_id, Status status); + + // Called when a remote endpoint is disconnected or has become unreachable. + // At this point service (re-)discovery may start again. + // + // endpoint_id - The identifier for the remote endpoint. + OnDisconnected(string endpoint_id); + + // Called when the connection's available bandwidth has changed. + // + // endpoint_id - The identifier for the remote endpoint. + // quality - The new quality for the connection. + OnBandwidthChanged(string endpoint_id, int32 quality); +}; + // Main interface to control the NearbyConnections library. Implemented in a // sandboxed process. This interface is used by the browser process to connect // to remote devices and send / receive raw data packets. Parsing of those @@ -73,6 +121,38 @@ // Possible return values include: // Status::kSuccess returned after discovery got stopped. StopDiscovery() => (Status status); + + // Sends a request to connect to a remote endpoint. + // + // endpoint_info - The local info including a human readable name to appear on + // the remote endpoint. + // endpoint_id - The identifier for the remote endpoint to which a + // connection request will be sent. Should match the value + // provided in a call to + // EndpointDiscoveryListener::OnEndpointFound(). + // listener - A callback notified when the remote endpoint sends a + // response to the connection request. + // Possible return values include: + // Status::kSuccess if the connection request was sent. + // Status::kAlreadyConnectedToEndpoint if the app already + // has a connection to the specified endpoint. + // Status::kBluetoothError if we failed to connect because of an + // issue with Bluetooth. + // Status::kWifiLanError if we failed to connect because of an + // issue with WiFi. + // Status::kError if we failed to connect for any other reason. + // TODO(crbug/1076008): Add MediumSelector and bluetooth_mac_address. + RequestConnection(array<uint8> endpoint_info, string endpoint_id, + pending_remote<ConnectionLifecycleListener> listener) + => (Status status); + + // Disconnects from a remote endpoint. Payloads can no longer be sent + // to or received from the endpoint after this method is called. + // + // endpoint_id - The identifier for the remote endpoint to disconnect from. + // Possible return values include: + // Status::kSuccess disconnected successfully. + DisconnectFromEndpoint(string endpoint_id) => (Status status); }; // Provide all the dependencies that NearbyConnections library requires.
diff --git a/chrome/services/sharing/public/mojom/nearby_connections_types.mojom b/chrome/services/sharing/public/mojom/nearby_connections_types.mojom index eb63e1fe..d8bf472 100644 --- a/chrome/services/sharing/public/mojom/nearby_connections_types.mojom +++ b/chrome/services/sharing/public/mojom/nearby_connections_types.mojom
@@ -52,8 +52,6 @@ // Information about a connection that is being initiated. struct ConnectionInfo { - // The name of the remote device we're connecting to. - string remote_endpoint_name; // A short human-readable authentication token that has been given to both // devices. string authentication_token; @@ -62,11 +60,11 @@ // typically on devices with no output capabilities, where the authentication // is purely programmatic and does not have the luxury of human intervention. array<uint8> raw_authentication_token; + // Information that represents the remote device. + array<uint8> endpoint_info; // True if the connection request was initiated from a remote device. False if // this device was the one to try and initiate the connection. bool is_incoming_connection; - // Information that represents the remote device. - array<uint8> endpoint_info; }; // Information about an endpoint when it's discovered.
diff --git a/chrome/test/BUILD.gn b/chrome/test/BUILD.gn index 54e41e45..93771f4f 100644 --- a/chrome/test/BUILD.gn +++ b/chrome/test/BUILD.gn
@@ -4607,6 +4607,7 @@ "../browser/ui/app_list/test/fake_app_list_model_updater.h", "../browser/ui/ash/accessibility/accessibility_controller_client_unittest.cc", "../browser/ui/ash/accessibility/ax_tree_source_aura_unittest.cc", + "../browser/ui/ash/ambient/ambient_client_impl_unittest.cc", "../browser/ui/ash/assistant/assistant_state_client_unittest.cc", "../browser/ui/ash/assistant/conversation_starters_parser_unittest.cc", "../browser/ui/ash/assistant/device_actions_unittest.cc",
diff --git a/chrome/test/data/android/tabstest/tabs_test.html b/chrome/test/data/android/tabstest/tabs_test.html index 4deccca2..630b69a 100644 --- a/chrome/test/data/android/tabstest/tabs_test.html +++ b/chrome/test/data/android/tabstest/tabs_test.html
@@ -3,11 +3,11 @@ <meta name="viewport" content="width=device-width" /> <title>Data file for TabsTest</title> </head> -<body> +<body style="display: block; height: 2000px;"> <textarea id="textarea" rows="4" cols="10">helloworld</textarea> <button type="button" id="button" onclick='window.open("about:blank");'>Click me!</button> <br> <input type="text" id="input_text"></input> Data file for TabsTest. </body> -</html> \ No newline at end of file +</html>
diff --git a/chrome/test/data/webui/settings/chromeos/nearby_share_subpage_tests.js b/chrome/test/data/webui/settings/chromeos/nearby_share_subpage_tests.js index 59e9e02..8598164 100644 --- a/chrome/test/data/webui/settings/chromeos/nearby_share_subpage_tests.js +++ b/chrome/test/data/webui/settings/chromeos/nearby_share_subpage_tests.js
@@ -26,6 +26,9 @@ 'enabled': { value: true, }, + 'data_usage': { + value: 3, + }, 'device_name': { value: '', } @@ -81,4 +84,17 @@ assertEquals(newName, subpage.prefs.nearby_sharing.device_name.value); }); + + test('update data usage preference', function() { + assertEquals(3, subpage.prefs.nearby_sharing.data_usage.value); + + subpage.$$('#editDataUsageButton').click(); + Polymer.dom.flush(); + + const dialog = subpage.$$('nearby-share-data-usage-dialog'); + dialog.$$('#dataUsageDataButton').click(); + dialog.$$('.action-button').click(); + + assertEquals(2, subpage.prefs.nearby_sharing.data_usage.value); + }); });
diff --git a/chrome/test/data/webui/settings/safety_check_chrome_cleaner_test.js b/chrome/test/data/webui/settings/safety_check_chrome_cleaner_test.js index 50941b8..580ca77 100644 --- a/chrome/test/data/webui/settings/safety_check_chrome_cleaner_test.js +++ b/chrome/test/data/webui/settings/safety_check_chrome_cleaner_test.js
@@ -65,7 +65,7 @@ suite('SafetyCheckChromeCleanerUiTests', function() { /** - * @implements {BrowserProxy} + * @implements {ChromeCleanupProxy} * @extends {TestBrowserProxy} */ let chromeCleanupBrowserProxy = null;
diff --git a/chromeos/components/telemetry_extension_ui/BUILD.gn b/chromeos/components/telemetry_extension_ui/BUILD.gn index 827fc163..87ed39a 100644 --- a/chromeos/components/telemetry_extension_ui/BUILD.gn +++ b/chromeos/components/telemetry_extension_ui/BUILD.gn
@@ -8,6 +8,10 @@ source_set("telemetry_extension_ui") { sources = [ + "diagnostics_service.cc", + "diagnostics_service.h", + "diagnostics_service_converters.cc", + "diagnostics_service_converters.h", "probe_service.cc", "probe_service.h", "probe_service_converters.cc", @@ -28,6 +32,7 @@ "//chromeos/services/cros_healthd/public/cpp", "//chromeos/services/cros_healthd/public/mojom", "//content/public/browser", + "//mojo/public/js:resources", "//ui/webui", ] }
diff --git a/chromeos/components/telemetry_extension_ui/DEPS b/chromeos/components/telemetry_extension_ui/DEPS index e794317..e048463 100644 --- a/chromeos/components/telemetry_extension_ui/DEPS +++ b/chromeos/components/telemetry_extension_ui/DEPS
@@ -3,6 +3,7 @@ "+chromeos/grit/chromeos_telemetry_extension_resources.h", "+content/public/browser", "+content/public/common", + "+mojo/public/js/grit", "+ui/base/resource/resource_bundle.h", "+ui/webui", ]
diff --git a/chromeos/components/telemetry_extension_ui/diagnostics_service.cc b/chromeos/components/telemetry_extension_ui/diagnostics_service.cc new file mode 100644 index 0000000..ad1f7a3 --- /dev/null +++ b/chromeos/components/telemetry_extension_ui/diagnostics_service.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 "chromeos/components/telemetry_extension_ui/diagnostics_service.h" + +#include <utility> +#include <vector> + +#include "base/bind.h" +#include "chromeos/components/telemetry_extension_ui/diagnostics_service_converters.h" +#include "chromeos/services/cros_healthd/public/cpp/service_connection.h" +#include "chromeos/services/cros_healthd/public/mojom/cros_healthd_diagnostics.mojom.h" + +namespace chromeos { + +DiagnosticsService::DiagnosticsService( + mojo::PendingReceiver<health::mojom::DiagnosticsService> receiver) + : receiver_(this, std::move(receiver)) {} + +DiagnosticsService::~DiagnosticsService() = default; + +cros_healthd::mojom::CrosHealthdDiagnosticsService* +DiagnosticsService::GetService() { + if (!service_ || !service_.is_connected()) { + cros_healthd::ServiceConnection::GetInstance()->GetDiagnosticsService( + service_.BindNewPipeAndPassReceiver()); + service_.set_disconnect_handler(base::BindOnce( + &DiagnosticsService::OnDisconnect, base::Unretained(this))); + } + return service_.get(); +} + +void DiagnosticsService::OnDisconnect() { + service_.reset(); +} + +void DiagnosticsService::GetAvailableRoutines( + GetAvailableRoutinesCallback callback) { + GetService()->GetAvailableRoutines(base::BindOnce( + [](health::mojom::DiagnosticsService::GetAvailableRoutinesCallback + callback, + const std::vector<cros_healthd::mojom::DiagnosticRoutineEnum>& + routines) { + std::move(callback).Run( + diagnostics_service_converters::Convert(routines)); + }, + std::move(callback))); +} + +} // namespace chromeos
diff --git a/chromeos/components/telemetry_extension_ui/diagnostics_service.h b/chromeos/components/telemetry_extension_ui/diagnostics_service.h new file mode 100644 index 0000000..6991f95 --- /dev/null +++ b/chromeos/components/telemetry_extension_ui/diagnostics_service.h
@@ -0,0 +1,49 @@ +// 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 CHROMEOS_COMPONENTS_TELEMETRY_EXTENSION_UI_DIAGNOSTICS_SERVICE_H_ +#define CHROMEOS_COMPONENTS_TELEMETRY_EXTENSION_UI_DIAGNOSTICS_SERVICE_H_ + +#if defined(OFFICIAL_BUILD) +#error Diagnostics service should only be included in unofficial builds. +#endif + +#include "chromeos/components/telemetry_extension_ui/mojom/diagnostics_service.mojom.h" +#include "chromeos/services/cros_healthd/public/mojom/cros_healthd.mojom.h" +#include "mojo/public/cpp/bindings/pending_receiver.h" +#include "mojo/public/cpp/bindings/receiver.h" +#include "mojo/public/cpp/bindings/remote.h" + +namespace chromeos { + +class DiagnosticsService : public health::mojom::DiagnosticsService { + public: + explicit DiagnosticsService( + mojo::PendingReceiver<health::mojom::DiagnosticsService> receiver); + DiagnosticsService(const DiagnosticsService&) = delete; + DiagnosticsService& operator=(const DiagnosticsService&) = delete; + ~DiagnosticsService() override; + + private: + void GetAvailableRoutines(GetAvailableRoutinesCallback callback) override; + + // Ensures that |service_| created and connected to the + // CrosHealthdProbeService. + cros_healthd::mojom::CrosHealthdDiagnosticsService* GetService(); + + void OnDisconnect(); + + // Pointer to real implementation. + mojo::Remote<cros_healthd::mojom::CrosHealthdDiagnosticsService> service_; + + // We must destroy |receiver_| before destroying |service_|, so we will close + // interface pipe before destroying pending response callbacks owned by + // |service_|. It is an error to drop response callbacks which still + // correspond to an open interface pipe. + mojo::Receiver<health::mojom::DiagnosticsService> receiver_; +}; + +} // namespace chromeos + +#endif // CHROMEOS_COMPONENTS_TELEMETRY_EXTENSION_UI_DIAGNOSTICS_SERVICE_H_
diff --git a/chromeos/components/telemetry_extension_ui/diagnostics_service_converters.cc b/chromeos/components/telemetry_extension_ui/diagnostics_service_converters.cc new file mode 100644 index 0000000..afc6456 --- /dev/null +++ b/chromeos/components/telemetry_extension_ui/diagnostics_service_converters.cc
@@ -0,0 +1,67 @@ +// 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 "chromeos/components/telemetry_extension_ui/diagnostics_service_converters.h" + +#include "base/notreached.h" +#include "base/optional.h" +#include "chromeos/components/telemetry_extension_ui/mojom/diagnostics_service.mojom.h" +#include "chromeos/services/cros_healthd/public/mojom/cros_healthd_diagnostics.mojom.h" + +namespace chromeos { +namespace diagnostics_service_converters { + +namespace { + +base::Optional<health::mojom::DiagnosticRoutineEnum> Convert( + cros_healthd::mojom::DiagnosticRoutineEnum input) { + switch (input) { + case cros_healthd::mojom::DiagnosticRoutineEnum::kBatteryCapacity: + return health::mojom::DiagnosticRoutineEnum::kBatteryCapacity; + case cros_healthd::mojom::DiagnosticRoutineEnum::kBatteryHealth: + return health::mojom::DiagnosticRoutineEnum::kBatteryHealth; + case cros_healthd::mojom::DiagnosticRoutineEnum::kUrandom: + return health::mojom::DiagnosticRoutineEnum::kUrandom; + case cros_healthd::mojom::DiagnosticRoutineEnum::kSmartctlCheck: + return health::mojom::DiagnosticRoutineEnum::kSmartctlCheck; + case cros_healthd::mojom::DiagnosticRoutineEnum::kAcPower: + return health::mojom::DiagnosticRoutineEnum::kAcPower; + case cros_healthd::mojom::DiagnosticRoutineEnum::kCpuCache: + return health::mojom::DiagnosticRoutineEnum::kCpuCache; + case cros_healthd::mojom::DiagnosticRoutineEnum::kCpuStress: + return health::mojom::DiagnosticRoutineEnum::kCpuStress; + case cros_healthd::mojom::DiagnosticRoutineEnum::kFloatingPointAccuracy: + return health::mojom::DiagnosticRoutineEnum::kFloatingPointAccuracy; + case cros_healthd::mojom::DiagnosticRoutineEnum::kNvmeWearLevel: + return health::mojom::DiagnosticRoutineEnum::kNvmeWearLevel; + case cros_healthd::mojom::DiagnosticRoutineEnum::kNvmeSelfTest: + return health::mojom::DiagnosticRoutineEnum::kNvmeSelfTest; + case cros_healthd::mojom::DiagnosticRoutineEnum::kDiskRead: + return health::mojom::DiagnosticRoutineEnum::kDiskRead; + case cros_healthd::mojom::DiagnosticRoutineEnum::kPrimeSearch: + return health::mojom::DiagnosticRoutineEnum::kPrimeSearch; + case cros_healthd::mojom::DiagnosticRoutineEnum::kBatteryDischarge: + return health::mojom::DiagnosticRoutineEnum::kBatteryDischarge; + } + NOTREACHED(); + return base::nullopt; +} + +} // namespace + +std::vector<health::mojom::DiagnosticRoutineEnum> Convert( + const std::vector<cros_healthd::mojom::DiagnosticRoutineEnum>& input) { + std::vector<health::mojom::DiagnosticRoutineEnum> output; + for (const auto element : input) { + base::Optional<health::mojom::DiagnosticRoutineEnum> converted = + Convert(element); + if (converted.has_value()) { + output.push_back(converted.value()); + } + } + return output; +} + +} // namespace diagnostics_service_converters +} // namespace chromeos
diff --git a/chromeos/components/telemetry_extension_ui/diagnostics_service_converters.h b/chromeos/components/telemetry_extension_ui/diagnostics_service_converters.h new file mode 100644 index 0000000..be10cd6 --- /dev/null +++ b/chromeos/components/telemetry_extension_ui/diagnostics_service_converters.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 CHROMEOS_COMPONENTS_TELEMETRY_EXTENSION_UI_DIAGNOSTICS_SERVICE_CONVERTERS_H_ +#define CHROMEOS_COMPONENTS_TELEMETRY_EXTENSION_UI_DIAGNOSTICS_SERVICE_CONVERTERS_H_ + +#if defined(OFFICIAL_BUILD) +#error Diagnostics service should only be included in unofficial builds. +#endif + +#include <vector> + +#include "chromeos/components/telemetry_extension_ui/mojom/diagnostics_service.mojom-forward.h" +#include "chromeos/services/cros_healthd/public/mojom/cros_healthd_diagnostics.mojom-forward.h" + +namespace chromeos { +namespace diagnostics_service_converters { + +// This file contains helper functions used by DiagnosticsService to convert its +// types to/from cros_healthd DiagnosticsService types. + +std::vector<health::mojom::DiagnosticRoutineEnum> Convert( + const std::vector<cros_healthd::mojom::DiagnosticRoutineEnum>& input); + +} // namespace diagnostics_service_converters +} // namespace chromeos + +#endif // CHROMEOS_COMPONENTS_TELEMETRY_EXTENSION_UI_DIAGNOSTICS_SERVICE_CONVERTERS_H_
diff --git a/chromeos/components/telemetry_extension_ui/mojom/BUILD.gn b/chromeos/components/telemetry_extension_ui/mojom/BUILD.gn index 9abf3be..882cb5b 100644 --- a/chromeos/components/telemetry_extension_ui/mojom/BUILD.gn +++ b/chromeos/components/telemetry_extension_ui/mojom/BUILD.gn
@@ -5,5 +5,8 @@ import("//mojo/public/tools/bindings/mojom.gni") mojom("mojom") { - sources = [ "probe_service.mojom" ] + sources = [ + "diagnostics_service.mojom", + "probe_service.mojom", + ] }
diff --git a/chromeos/components/telemetry_extension_ui/mojom/diagnostics_service.mojom b/chromeos/components/telemetry_extension_ui/mojom/diagnostics_service.mojom new file mode 100644 index 0000000..7b4c6bd --- /dev/null +++ b/chromeos/components/telemetry_extension_ui/mojom/diagnostics_service.mojom
@@ -0,0 +1,43 @@ +// 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. +// +// cros_healthd daemon implements DiagnosticsService interface, but since +// callers are third-party Telemetry Extensions, we have PII filtering +// in the middle that lives in Chrome. +// +// Currently we expose this interface to WebUI only in Chrome OS and on +// non-official builds so that we can prototype Telemetry Extension, while we +// decide how to expose API to third parties. +// +// This Mojo interface will go through security review before shipping. +// +// This is a subset of the cros_healthd diagnostics service interface which is +// located in src/platform2/diagnostics/mojo/cros_healthd_diagnostics.mojom. + +module chromeos.health.mojom; + +// Interface for exposing diagnostics service. +interface DiagnosticsService { + // Returns an array of all diagnostic routines that the platform supports. + GetAvailableRoutines() + => (array<DiagnosticRoutineEnum> available_routines); +}; + +// Enumeration of each of the diagnostics routines the platform may support. +[Extensible] +enum DiagnosticRoutineEnum { + kBatteryCapacity = 0, + kBatteryHealth = 1, + kUrandom = 2, + kSmartctlCheck = 3, + kAcPower = 4, + kCpuCache = 5, + kCpuStress = 6, + kFloatingPointAccuracy = 7, + kNvmeWearLevel = 8, + kNvmeSelfTest = 9, + kDiskRead = 10, + kPrimeSearch = 11, + kBatteryDischarge = 12, +};
diff --git a/chromeos/components/telemetry_extension_ui/resources/index.html b/chromeos/components/telemetry_extension_ui/resources/index.html index 57c3227..84ca774 100644 --- a/chromeos/components/telemetry_extension_ui/resources/index.html +++ b/chromeos/components/telemetry_extension_ui/resources/index.html
@@ -10,5 +10,6 @@ <!-- Below mojo script required to run browser tests --> <script src="chrome://resources/mojo/mojo/public/js/mojo_bindings_lite.js"></script> +<script src="diagnostics_service.mojom-lite.js"></script> <script src="probe_service.mojom-lite.js"></script> <script src="trusted_scripts.js"></script>
diff --git a/chromeos/components/telemetry_extension_ui/resources/message_types.js b/chromeos/components/telemetry_extension_ui/resources/message_types.js index af9fd72..6f42dbd4 100644 --- a/chromeos/components/telemetry_extension_ui/resources/message_types.js +++ b/chromeos/components/telemetry_extension_ui/resources/message_types.js
@@ -13,9 +13,26 @@ * @enum {string} */ const Message = { + DIAGNOSTICS_AVAILABLE_ROUTINES: 'DiagnosticsService.GetAvailableRoutines', PROBE_TELEMETRY_INFO: 'ProbeService.ProbeTelemetryInfo', }; + +/** + * Request message sent by the unprivileged context to request the privileged + * context to diagnostics to get available routines. + * @typedef {null} + */ +let DiagnosticsGetAvailableRoutinesRequest; + +/** + * Response message sent by the privileged context containing diagnostic + * routine enums. + * @typedef {{availableRoutines: + * !Array<!chromeos.health.mojom.DiagnosticRoutineEnum>}} + */ +let DiagnosticsGetAvailableRoutinesResponse; + /** * Request message sent by the unprivileged context to request the privileged * context to probe telemetry information
diff --git a/chromeos/components/telemetry_extension_ui/resources/telemetry_extension_resources.grd b/chromeos/components/telemetry_extension_ui/resources/telemetry_extension_resources.grd index dadca5cb..af1f4ad 100644 --- a/chromeos/components/telemetry_extension_ui/resources/telemetry_extension_resources.grd +++ b/chromeos/components/telemetry_extension_ui/resources/telemetry_extension_resources.grd
@@ -19,6 +19,7 @@ <include name="IDR_TELEMETRY_EXTENSION_MANIFEST" file="manifest.json" type="BINDATA" compress="gzip" /> <include name="IDR_TELEMETRY_EXTENSION_ICON_96" file="app_icon_96.png" type="BINDATA" compress="gzip" /> <include name="IDR_TELEMETRY_EXTENSION_TRUSTED_SCRIPTS_JS" file="trusted_scripts.js" flattenhtml="true" type="BINDATA" compress="gzip" /> + <include name="IDR_TELEMETRY_EXTENSION_DIAGNOSTICS_SERVICE_MOJO_LITE_JS" file="${root_gen_dir}/chromeos/components/telemetry_extension_ui/mojom/diagnostics_service.mojom-lite.js" compress="gzip" use_base_dir="false" type="BINDATA" /> <include name="IDR_TELEMETRY_EXTENSION_PROBE_SERVICE_MOJO_LITE_JS" file="${root_gen_dir}/chromeos/components/telemetry_extension_ui/mojom/probe_service.mojom-lite.js" compress="gzip" use_base_dir="false" type="BINDATA" /> <!-- Untrusted app contents. -->
diff --git a/chromeos/components/telemetry_extension_ui/resources/trusted.js b/chromeos/components/telemetry_extension_ui/resources/trusted.js index 548e840..fe65e6cd 100644 --- a/chromeos/components/telemetry_extension_ui/resources/trusted.js +++ b/chromeos/components/telemetry_extension_ui/resources/trusted.js
@@ -3,16 +3,27 @@ // found in the LICENSE file. /** + * Pointer to remote implementation of diagnostics service. + * @type {!chromeos.health.mojom.DiagnosticsServiceRemote} + */ +const diagnosticsService = chromeos.health.mojom.DiagnosticsService.getRemote(); + +/** * Pointer to remote implementation of probe service. * @type {!chromeos.health.mojom.ProbeServiceRemote} */ const probeService = chromeos.health.mojom.ProbeService.getRemote(); const untrustedMessagePipe = - new MessagePipe('chrome-untrusted://telemetry-extension'); + new MessagePipe('chrome-untrusted://telemetry-extension'); + +untrustedMessagePipe.registerHandler(Message.DIAGNOSTICS_AVAILABLE_ROUTINES, + async () => { + return await diagnosticsService.getAvailableRoutines(); + }); untrustedMessagePipe.registerHandler(Message.PROBE_TELEMETRY_INFO, async () => { const response = await probeService.probeTelemetryInfo( - [chromeos.health.mojom.ProbeCategoryEnum.kBattery]); - return {telemetryInfo: response.telemetryInfo}; + [chromeos.health.mojom.ProbeCategoryEnum.kBattery]); + return { telemetryInfo: response.telemetryInfo }; });
diff --git a/chromeos/components/telemetry_extension_ui/resources/untrusted.html b/chromeos/components/telemetry_extension_ui/resources/untrusted.html index 403df7c..4556a41 100644 --- a/chromeos/components/telemetry_extension_ui/resources/untrusted.html +++ b/chromeos/components/telemetry_extension_ui/resources/untrusted.html
@@ -6,4 +6,6 @@ <meta charset="utf-8"> <title>Untrusted Telemetry Extension</title> <h1 id='untrusted-title'>Telemetry Extension</h1> +<script src="mojo_bindings_lite.js"></script> +<script src="diagnostics_service.mojom-lite.js"></script> <script src="untrusted_scripts.js"></script>
diff --git a/chromeos/components/telemetry_extension_ui/resources/untrusted.js b/chromeos/components/telemetry_extension_ui/resources/untrusted.js index f98509c8e..52dd61c 100644 --- a/chromeos/components/telemetry_extension_ui/resources/untrusted.js +++ b/chromeos/components/telemetry_extension_ui/resources/untrusted.js
@@ -15,3 +15,14 @@ await parentMessagePipe.sendMessage(Message.PROBE_TELEMETRY_INFO)); return response; } + +/** + * Requests a list of available routines. + * @return {!Promise<DiagnosticsGetAvailableRoutinesResponse>} + */ +async function getAvailableRoutines() { + const response = /** @type {!DiagnosticsGetAvailableRoutinesResponse} */ ( + await parentMessagePipe.sendMessage( + Message.DIAGNOSTICS_AVAILABLE_ROUTINES)); + return response; +}
diff --git a/chromeos/components/telemetry_extension_ui/telemetry_extension_ui.cc b/chromeos/components/telemetry_extension_ui/telemetry_extension_ui.cc index 9905d22..f0bcb96 100644 --- a/chromeos/components/telemetry_extension_ui/telemetry_extension_ui.cc +++ b/chromeos/components/telemetry_extension_ui/telemetry_extension_ui.cc
@@ -7,6 +7,8 @@ #include <utility> #include "base/memory/ptr_util.h" +#include "chromeos/components/telemetry_extension_ui/diagnostics_service.h" +#include "chromeos/components/telemetry_extension_ui/mojom/diagnostics_service.mojom.h" #include "chromeos/components/telemetry_extension_ui/mojom/probe_service.mojom.h" #include "chromeos/components/telemetry_extension_ui/probe_service.h" #include "chromeos/components/telemetry_extension_ui/telemetry_extension_untrusted_source.h" @@ -15,6 +17,7 @@ #include "content/public/browser/web_ui.h" #include "content/public/browser/web_ui_data_source.h" #include "content/public/common/url_constants.h" +#include "mojo/public/js/grit/mojo_bindings_resources.h" #include "services/network/public/mojom/content_security_policy.mojom.h" namespace chromeos { @@ -35,6 +38,9 @@ trusted_source->AddResourcePath("trusted_scripts.js", IDR_TELEMETRY_EXTENSION_TRUSTED_SCRIPTS_JS); trusted_source->AddResourcePath( + "diagnostics_service.mojom-lite.js", + IDR_TELEMETRY_EXTENSION_DIAGNOSTICS_SERVICE_MOJO_LITE_JS); + trusted_source->AddResourcePath( "probe_service.mojom-lite.js", IDR_TELEMETRY_EXTENSION_PROBE_SERVICE_MOJO_LITE_JS); @@ -66,6 +72,11 @@ "untrusted_scripts.js", IDR_TELEMETRY_EXTENSION_UNTRUSTED_SCRIPTS_JS); untrusted_source->AddResourcePath( "untrusted_worker.js", IDR_TELEMETRY_EXTENSION_UNTRUSTED_WORKER_JS); + untrusted_source->AddResourcePath("mojo_bindings_lite.js", + IDR_MOJO_MOJO_BINDINGS_LITE_JS); + untrusted_source->AddResourcePath( + "diagnostics_service.mojom-lite.js", + IDR_TELEMETRY_EXTENSION_DIAGNOSTICS_SERVICE_MOJO_LITE_JS); untrusted_source->OverrideContentSecurityPolicy( network::mojom::CSPDirectiveName::FrameAncestors, @@ -99,6 +110,12 @@ probe_service_ = std::make_unique<ProbeService>(std::move(receiver)); } +void TelemetryExtensionUI::BindInterface( + mojo::PendingReceiver<health::mojom::DiagnosticsService> receiver) { + diagnostics_service_ = + std::make_unique<DiagnosticsService>(std::move(receiver)); +} + WEB_UI_CONTROLLER_TYPE_IMPL(TelemetryExtensionUI) } // namespace chromeos
diff --git a/chromeos/components/telemetry_extension_ui/telemetry_extension_ui.h b/chromeos/components/telemetry_extension_ui/telemetry_extension_ui.h index a9372244..bec8296 100644 --- a/chromeos/components/telemetry_extension_ui/telemetry_extension_ui.h +++ b/chromeos/components/telemetry_extension_ui/telemetry_extension_ui.h
@@ -11,6 +11,7 @@ #include "memory" +#include "chromeos/components/telemetry_extension_ui/mojom/diagnostics_service.mojom-forward.h" #include "chromeos/components/telemetry_extension_ui/mojom/probe_service.mojom-forward.h" #include "mojo/public/cpp/bindings/pending_receiver.h" #include "ui/webui/mojo_web_ui_controller.h" @@ -26,10 +27,14 @@ ~TelemetryExtensionUI() override; void BindInterface( + mojo::PendingReceiver<health::mojom::DiagnosticsService> receiver); + + void BindInterface( mojo::PendingReceiver<health::mojom::ProbeService> receiver); private: // Replaced when |BindInterface| is called. + std::unique_ptr<health::mojom::DiagnosticsService> diagnostics_service_; std::unique_ptr<health::mojom::ProbeService> probe_service_; WEB_UI_CONTROLLER_TYPE_DECL();
diff --git a/chromeos/components/telemetry_extension_ui/test/BUILD.gn b/chromeos/components/telemetry_extension_ui/test/BUILD.gn index eaebdfe8..8926a60 100644 --- a/chromeos/components/telemetry_extension_ui/test/BUILD.gn +++ b/chromeos/components/telemetry_extension_ui/test/BUILD.gn
@@ -33,6 +33,7 @@ "../:telemetry_extension_ui", "//chrome/test:test_support_ui", "//chromeos/components/web_applications/test:test_support", + "//chromeos/dbus/cros_healthd:cros_healthd", ] data = [
diff --git a/chromeos/components/telemetry_extension_ui/test/telemetry_extension_ui_browsertest.cc b/chromeos/components/telemetry_extension_ui/test/telemetry_extension_ui_browsertest.cc index 66e32f4e..081b80c5 100644 --- a/chromeos/components/telemetry_extension_ui/test/telemetry_extension_ui_browsertest.cc +++ b/chromeos/components/telemetry_extension_ui/test/telemetry_extension_ui_browsertest.cc
@@ -7,6 +7,8 @@ #include "base/files/file_path.h" #include "chromeos/components/telemetry_extension_ui/url_constants.h" #include "chromeos/components/web_applications/test/sandboxed_web_ui_test_base.h" +#include "chromeos/dbus/cros_healthd/cros_healthd_client.h" +#include "chromeos/dbus/cros_healthd/fake_cros_healthd_client.h" namespace { @@ -38,3 +40,30 @@ base::FilePath(kUntrustedTestCases)}) {} TelemetryExtensionUiBrowserTest::~TelemetryExtensionUiBrowserTest() = default; + +void TelemetryExtensionUiBrowserTest::SetUpOnMainThread() { + { + namespace cros_diagnostics = ::chromeos::cros_healthd::mojom; + + std::vector<cros_diagnostics::DiagnosticRoutineEnum> input{ + cros_diagnostics::DiagnosticRoutineEnum::kBatteryCapacity, + cros_diagnostics::DiagnosticRoutineEnum::kBatteryHealth, + cros_diagnostics::DiagnosticRoutineEnum::kUrandom, + cros_diagnostics::DiagnosticRoutineEnum::kSmartctlCheck, + cros_diagnostics::DiagnosticRoutineEnum::kAcPower, + cros_diagnostics::DiagnosticRoutineEnum::kCpuCache, + cros_diagnostics::DiagnosticRoutineEnum::kCpuStress, + cros_diagnostics::DiagnosticRoutineEnum::kFloatingPointAccuracy, + cros_diagnostics::DiagnosticRoutineEnum::kNvmeWearLevel, + cros_diagnostics::DiagnosticRoutineEnum::kNvmeSelfTest, + cros_diagnostics::DiagnosticRoutineEnum::kDiskRead, + cros_diagnostics::DiagnosticRoutineEnum::kPrimeSearch, + cros_diagnostics::DiagnosticRoutineEnum::kBatteryDischarge, + }; + + chromeos::cros_healthd::FakeCrosHealthdClient::Get() + ->SetAvailableRoutinesForTesting(input); + } + + SandboxedWebUiAppTestBase::SetUpOnMainThread(); +}
diff --git a/chromeos/components/telemetry_extension_ui/test/telemetry_extension_ui_browsertest.h b/chromeos/components/telemetry_extension_ui/test/telemetry_extension_ui_browsertest.h index 0cce62e..cd1c9347 100644 --- a/chromeos/components/telemetry_extension_ui/test/telemetry_extension_ui_browsertest.h +++ b/chromeos/components/telemetry_extension_ui/test/telemetry_extension_ui_browsertest.h
@@ -18,6 +18,8 @@ delete; TelemetryExtensionUiBrowserTest& operator=( const TelemetryExtensionUiBrowserTest&) = delete; + + void SetUpOnMainThread() override; }; #endif // CHROMEOS_COMPONENTS_TELEMETRY_EXTENSION_UI_TEST_TELEMETRY_EXTENSION_UI_BROWSERTEST_H_
diff --git a/chromeos/components/telemetry_extension_ui/test/telemetry_extension_ui_browsertest.js b/chromeos/components/telemetry_extension_ui/test/telemetry_extension_ui_browsertest.js index e47ec9f9..8237e91 100644 --- a/chromeos/components/telemetry_extension_ui/test/telemetry_extension_ui_browsertest.js +++ b/chromeos/components/telemetry_extension_ui/test/telemetry_extension_ui_browsertest.js
@@ -81,3 +81,10 @@ await runTestInUntrusted('UntrustedRequestTelemetryInfo'); testDone(); }); + +TEST_F( + 'TelemetryExtensionUIBrowserTest', 'UntrustedRequestAvailableRoutines', + async () => { + await runTestInUntrusted('UntrustedRequestAvailableRoutines'); + testDone(); + });
diff --git a/chromeos/components/telemetry_extension_ui/test/untrusted_browsertest.js b/chromeos/components/telemetry_extension_ui/test/untrusted_browsertest.js index b2f0962..9bbb3dd 100644 --- a/chromeos/components/telemetry_extension_ui/test/untrusted_browsertest.js +++ b/chromeos/components/telemetry_extension_ui/test/untrusted_browsertest.js
@@ -71,3 +71,27 @@ } }); }); + +// Tests that array of available routines can be successfully +// requested from chrome-untrusted://. +UNTRUSTED_TEST('UntrustedRequestAvailableRoutines', async () => { + /** @type {!DiagnosticsGetAvailableRoutinesResponse} */ + const response = await getAvailableRoutines(); + assertDeepEquals(response, { + 'availableRoutines': [ + chromeos.health.mojom.DiagnosticRoutineEnum.kBatteryCapacity, + chromeos.health.mojom.DiagnosticRoutineEnum.kBatteryHealth, + chromeos.health.mojom.DiagnosticRoutineEnum.kUrandom, + chromeos.health.mojom.DiagnosticRoutineEnum.kSmartctlCheck, + chromeos.health.mojom.DiagnosticRoutineEnum.kAcPower, + chromeos.health.mojom.DiagnosticRoutineEnum.kCpuCache, + chromeos.health.mojom.DiagnosticRoutineEnum.kCpuStress, + chromeos.health.mojom.DiagnosticRoutineEnum.kFloatingPointAccuracy, + chromeos.health.mojom.DiagnosticRoutineEnum.kNvmeWearLevel, + chromeos.health.mojom.DiagnosticRoutineEnum.kNvmeSelfTest, + chromeos.health.mojom.DiagnosticRoutineEnum.kDiskRead, + chromeos.health.mojom.DiagnosticRoutineEnum.kPrimeSearch, + chromeos.health.mojom.DiagnosticRoutineEnum.kBatteryDischarge, + ] + }); +});
diff --git a/components/autofill/core/common/autofill_payments_features.cc b/components/autofill/core/common/autofill_payments_features.cc index 517d7448..ebabe10 100644 --- a/components/autofill/core/common/autofill_payments_features.cc +++ b/components/autofill/core/common/autofill_payments_features.cc
@@ -88,7 +88,7 @@ // app, Autofill will surface these nicknames in suggestions. const base::Feature kAutofillEnableSurfacingServerCardNickname{ "AutofillEnableSurfacingServerCardNickname", - base::FEATURE_DISABLED_BY_DEFAULT}; + base::FEATURE_ENABLED_BY_DEFAULT}; // When enabled, Autofill data related icons will be shown in the status // chip in toolbar along with the avatar toolbar button.
diff --git a/components/browser_ui/styles/android/java/res/values/styles.xml b/components/browser_ui/styles/android/java/res/values/styles.xml index cd0136ae..9b2806da 100644 --- a/components/browser_ui/styles/android/java/res/values/styles.xml +++ b/components/browser_ui/styles/android/java/res/values/styles.xml
@@ -102,4 +102,10 @@ <item name="android:paddingEnd">16dp</item> <item name="android:background">?attr/listChoiceBackgroundIndicator</item> </style> + + <!-- Checkbox styles. --> + <style name="DefaultCheckboxStyle" parent="TextAppearance.TextMedium.Secondary"> + <!-- The space between the checkbox and text. --> + <item name="android:paddingStart">16dp</item> + </style> </resources>
diff --git a/components/crash/core/app/crashpad_mac.mm b/components/crash/core/app/crashpad_mac.mm index 0b594d0..aa7c330 100644 --- a/components/crash/core/app/crashpad_mac.mm +++ b/components/crash/core/app/crashpad_mac.mm
@@ -39,10 +39,14 @@ std::map<std::string, std::string> process_annotations; @autoreleasepool { NSBundle* outer_bundle = base::mac::OuterBundle(); +#if BUILDFLAG(GOOGLE_CHROME_BRANDING) + process_annotations["prod"] = "Chrome_Mac"; +#else NSString* product = base::mac::ObjCCast<NSString>([outer_bundle objectForInfoDictionaryKey:base::mac::CFToNSCast(kCFBundleNameKey)]); process_annotations["prod"] = base::SysNSStringToUTF8(product).append("_Mac"); +#endif #if BUILDFLAG(GOOGLE_CHROME_BRANDING) // Empty means stable.
diff --git a/components/feature_engagement/public/android/java/src/org/chromium/components/feature_engagement/EventConstants.java b/components/feature_engagement/public/android/java/src/org/chromium/components/feature_engagement/EventConstants.java index 7aa9ffc..c2a9f311a 100644 --- a/components/feature_engagement/public/android/java/src/org/chromium/components/feature_engagement/EventConstants.java +++ b/components/feature_engagement/public/android/java/src/org/chromium/components/feature_engagement/EventConstants.java
@@ -172,6 +172,9 @@ public static final String NTP_SHOWN = "ntp_shown"; public static final String NTP_HOME_BUTTON_CLICKED = "ntp_homebutton_clicked"; + /** Reengagement events. */ + public static final String STARTED_FROM_MAIN_INTENT = "started_from_main_intent"; + /** * Do not instantiate. */
diff --git a/components/feature_engagement/public/android/java/src/org/chromium/components/feature_engagement/FeatureConstants.java b/components/feature_engagement/public/android/java/src/org/chromium/components/feature_engagement/FeatureConstants.java index 3c9cd0d..232f051a 100644 --- a/components/feature_engagement/public/android/java/src/org/chromium/components/feature_engagement/FeatureConstants.java +++ b/components/feature_engagement/public/android/java/src/org/chromium/components/feature_engagement/FeatureConstants.java
@@ -40,7 +40,10 @@ FeatureConstants.FEED_CARD_MENU_FEATURE, FeatureConstants.IDENTITY_DISC_FEATURE, FeatureConstants.TAB_GROUPS_DRAG_AND_DROP_FEATURE, FeatureConstants.QUIET_NOTIFICATION_PROMPTS_FEATURE, - FeatureConstants.HOMEPAGE_PROMO_CARD_FEATURE, FeatureConstants.FEED_HEADER_MENU_FEATURE}) + FeatureConstants.HOMEPAGE_PROMO_CARD_FEATURE, FeatureConstants.FEED_HEADER_MENU_FEATURE, + FeatureConstants.CHROME_REENGAGEMENT_NOTIFICATION_1_FEATURE, + FeatureConstants.CHROME_REENGAGEMENT_NOTIFICATION_2_FEATURE, + FeatureConstants.CHROME_REENGAGEMENT_NOTIFICATION_3_FEATURE}) @Retention(RetentionPolicy.SOURCE) public @interface FeatureConstants { String DOWNLOAD_PAGE_FEATURE = "IPH_DownloadPage"; @@ -154,4 +157,19 @@ * An IPH feature to show on the feed header menu button of the FeedNewTabPage. */ String FEED_HEADER_MENU_FEATURE = "IPH_FeedHeaderMenu"; + + /** + * An IPH feature to show the first re-engagement notification. + */ + String CHROME_REENGAGEMENT_NOTIFICATION_1_FEATURE = "IPH_ChromeReengagementNotification1"; + + /** + * An IPH feature to show the second re-engagement notification. + */ + String CHROME_REENGAGEMENT_NOTIFICATION_2_FEATURE = "IPH_ChromeReengagementNotification2"; + + /** + * An IPH feature to show the third re-engagement notification. + */ + String CHROME_REENGAGEMENT_NOTIFICATION_3_FEATURE = "IPH_ChromeReengagementNotification3"; }
diff --git a/components/feature_engagement/public/feature_constants.cc b/components/feature_engagement/public/feature_constants.cc index c61bb54..7105a8c 100644 --- a/components/feature_engagement/public/feature_constants.cc +++ b/components/feature_engagement/public/feature_constants.cc
@@ -101,6 +101,12 @@ "IPH_ExploreSitesTile", base::FEATURE_DISABLED_BY_DEFAULT}; const base::Feature kIPHFeedHeaderMenuFeature{ "IPH_FeedHeaderMenu", base::FEATURE_DISABLED_BY_DEFAULT}; +const base::Feature kIPHChromeReengagementNotification1{ + "IPH_ChromeReengagementNotification1", base::FEATURE_DISABLED_BY_DEFAULT}; +const base::Feature kIPHChromeReengagementNotification2{ + "IPH_ChromeReengagementNotification2", base::FEATURE_DISABLED_BY_DEFAULT}; +const base::Feature kIPHChromeReengagementNotification3{ + "IPH_ChromeReengagementNotification3", base::FEATURE_DISABLED_BY_DEFAULT}; #endif // defined(OS_ANDROID) #if defined(OS_IOS)
diff --git a/components/feature_engagement/public/feature_constants.h b/components/feature_engagement/public/feature_constants.h index 7e1ff11..6b610744 100644 --- a/components/feature_engagement/public/feature_constants.h +++ b/components/feature_engagement/public/feature_constants.h
@@ -69,6 +69,9 @@ extern const base::Feature kIPHTranslateMenuButtonFeature; extern const base::Feature kIPHExploreSitesTileFeature; extern const base::Feature kIPHFeedHeaderMenuFeature; +extern const base::Feature kIPHChromeReengagementNotification1; +extern const base::Feature kIPHChromeReengagementNotification2; +extern const base::Feature kIPHChromeReengagementNotification3; #endif // defined(OS_ANDROID) #if defined(OS_IOS)
diff --git a/components/feed/core/v2/feed_stream.cc b/components/feed/core/v2/feed_stream.cc index 73d4895..08e69fb0 100644 --- a/components/feed/core/v2/feed_stream.cc +++ b/components/feed/core/v2/feed_stream.cc
@@ -181,7 +181,8 @@ void FeedStream::InitialStreamLoadComplete(LoadStreamTask::Result result) { PopulateDebugStreamData(result, *profile_prefs_); metrics_reporter_->OnLoadStream(result.load_from_store_status, - result.final_status); + result.final_status, + std::move(result.latencies)); model_loading_in_progress_ = false; @@ -308,6 +309,7 @@ DLOG(ERROR) << "Calling CreateEphemeralChange before the model is loaded"; return {}; } + metrics_reporter_->EphemeralStreamChange(); return model_->CreateEphemeralChange(std::move(operations)); } @@ -327,6 +329,7 @@ bool FeedStream::RejectEphemeralChange(EphemeralChangeId id) { if (!model_) return false; + metrics_reporter_->EphemeralStreamChangeRejected(); return model_->RejectEphemeralChange(id); }
diff --git a/components/feed/core/v2/feed_stream_unittest.cc b/components/feed/core/v2/feed_stream_unittest.cc index d85f3dff..e036d5f 100644 --- a/components/feed/core/v2/feed_stream_unittest.cc +++ b/components/feed/core/v2/feed_stream_unittest.cc
@@ -397,11 +397,13 @@ MetricsReporter::ContentSliceViewed(surface_id, index_in_stream); } void OnLoadStream(LoadStreamStatus load_from_store_status, - LoadStreamStatus final_status) override { + LoadStreamStatus final_status, + std::unique_ptr<LoadLatencyTimes> latencies) override { load_stream_status = final_status; LOG(INFO) << "OnLoadStream: " << final_status << " (store status: " << load_from_store_status << ")"; - MetricsReporter::OnLoadStream(load_from_store_status, final_status); + MetricsReporter::OnLoadStream(load_from_store_status, final_status, + std::move(latencies)); } void OnLoadMore(LoadStreamStatus final_status) override { load_more_status = final_status;
diff --git a/components/feed/core/v2/metrics_reporter.cc b/components/feed/core/v2/metrics_reporter.cc index f31abb7c..8cea43f 100644 --- a/components/feed/core/v2/metrics_reporter.cc +++ b/components/feed/core/v2/metrics_reporter.cc
@@ -47,6 +47,30 @@ action_type); } +std::string LoadLatencyStepName(LoadLatencyTimes::StepKind kind) { + switch (kind) { + case LoadLatencyTimes::kTaskExecution: + return "TaskStart"; + case LoadLatencyTimes::kLoadFromStore: + return "LoadFromStore"; + case LoadLatencyTimes::kUploadActions: + return "ActionUpload"; + case LoadLatencyTimes::kQueryRequest: + return "QueryRequest"; + case LoadLatencyTimes::kStreamViewed: + return "StreamView"; + } +} + +void ReportLoadLatencies(std::unique_ptr<LoadLatencyTimes> latencies) { + for (const LoadLatencyTimes::Step& step : latencies->steps()) { + base::UmaHistogramCustomTimes( + "ContentSuggestions.Feed.LoadStepLatency." + + LoadLatencyStepName(step.kind), + step.latency, base::TimeDelta::FromMilliseconds(50), kLoadTimeout, 50); + } +} + } // namespace MetricsReporter::MetricsReporter(const base::TickClock* clock, @@ -146,7 +170,17 @@ int index_in_stream) { base::UmaHistogramExactLinear("NewTabPage.ContentSuggestions.Shown", index_in_stream, kMaxSuggestionsTotal); - + if (load_latencies_) { + load_latencies_->StepComplete(LoadLatencyTimes::kStreamViewed); + if (!load_latencies_recorded_) { + // Use |load_latencies_recorded_| to only report load latencies once. + // This generally will be the worst-case, since caches are likely to be + // cold, a network request is more likely to be required, and Chrome + // may be working on initializing other systems. + load_latencies_recorded_ = true; + ReportLoadLatencies(std::move(load_latencies_)); + } + } ReportOpenFeedIfNeeded(surface_id, true); } @@ -231,6 +265,14 @@ "ContentSuggestions.Feed.CardAction.ContextMenu")); } +void MetricsReporter::EphemeralStreamChange() { + ReportUserActionHistogram(FeedUserActionType::kEphemeralChange); +} + +void MetricsReporter::EphemeralStreamChangeRejected() { + ReportUserActionHistogram(FeedUserActionType::kEphemeralChangeRejected); +} + void MetricsReporter::SurfaceOpened(SurfaceId surface_id) { ReportPersistentDataIfDayIsDone(); @@ -344,10 +386,13 @@ } } -void MetricsReporter::OnLoadStream(LoadStreamStatus load_from_store_status, - LoadStreamStatus final_status) { +void MetricsReporter::OnLoadStream( + LoadStreamStatus load_from_store_status, + LoadStreamStatus final_status, + std::unique_ptr<LoadLatencyTimes> load_latencies) { DVLOG(1) << "OnLoadStream load_from_store_status=" << load_from_store_status << " final_status=" << final_status; + load_latencies_ = std::move(load_latencies); base::UmaHistogramEnumeration( "ContentSuggestions.Feed.LoadStreamStatus.Initial", final_status); if (load_from_store_status != LoadStreamStatus::kNoStatus) {
diff --git a/components/feed/core/v2/metrics_reporter.h b/components/feed/core/v2/metrics_reporter.h index e42a05e2c..27d31a4 100644 --- a/components/feed/core/v2/metrics_reporter.h +++ b/components/feed/core/v2/metrics_reporter.h
@@ -47,7 +47,9 @@ // User action not reported here. See Suggestions.SurfaceVisible. kOpenedFeedSurface = 10, kTappedOpenInNewIncognitoTab = 11, - kMaxValue = kTappedOpenInNewIncognitoTab, + kEphemeralChange = 12, + kEphemeralChangeRejected = 13, + kMaxValue = kEphemeralChangeRejected, }; } // namespace internal @@ -77,6 +79,9 @@ void NotInterestedInAction(); void ManageInterestsAction(); void ContextMenuOpened(); + void EphemeralStreamChange(); + void EphemeralStreamChangeRejected(); + // Indicates the user scrolled the feed by |distance_dp| and then stopped // scrolling. void StreamScrolled(int distance_dp); @@ -94,7 +99,8 @@ // Stream events. virtual void OnLoadStream(LoadStreamStatus load_from_store_status, - LoadStreamStatus final_status); + LoadStreamStatus final_status, + std::unique_ptr<LoadLatencyTimes> load_latencies); virtual void OnBackgroundRefresh(LoadStreamStatus final_status); void OnLoadMoreBegin(SurfaceId surface_id); virtual void OnLoadMore(LoadStreamStatus final_status); @@ -151,6 +157,9 @@ base::Optional<base::TimeTicks> time_in_feed_start_; // For TimeSpentOnFeed. base::TimeDelta tracked_visit_time_in_feed_; + // Non-null only directly after a stream load. + std::unique_ptr<LoadLatencyTimes> load_latencies_; + bool load_latencies_recorded_ = false; base::WeakPtrFactory<MetricsReporter> weak_ptr_factory_{this}; };
diff --git a/components/feed/core/v2/metrics_reporter_unittest.cc b/components/feed/core/v2/metrics_reporter_unittest.cc index 3b1e5e79..0b20b1a3 100644 --- a/components/feed/core/v2/metrics_reporter_unittest.cc +++ b/components/feed/core/v2/metrics_reporter_unittest.cc
@@ -161,7 +161,8 @@ TEST_F(MetricsReporterTest, ReportsLoadStreamStatus) { reporter_->OnLoadStream(LoadStreamStatus::kDataInStoreIsStale, - LoadStreamStatus::kLoadedFromNetwork); + LoadStreamStatus::kLoadedFromNetwork, + std::make_unique<LoadLatencyTimes>()); histogram_.ExpectUniqueSample( "ContentSuggestions.Feed.LoadStreamStatus.Initial", @@ -173,7 +174,8 @@ TEST_F(MetricsReporterTest, ReportsLoadStreamStatusIgnoresNoStatusFromStore) { reporter_->OnLoadStream(LoadStreamStatus::kNoStatus, - LoadStreamStatus::kLoadedFromNetwork); + LoadStreamStatus::kLoadedFromNetwork, + std::make_unique<LoadLatencyTimes>()); histogram_.ExpectUniqueSample( "ContentSuggestions.Feed.LoadStreamStatus.Initial", @@ -182,6 +184,32 @@ "ContentSuggestions.Feed.LoadStreamStatus.InitialFromStore", 0); } +TEST_F(MetricsReporterTest, ReportsLoadStepLatenciesOnFirstView) { + { + auto latencies = std::make_unique<LoadLatencyTimes>(); + task_environment_.FastForwardBy(base::TimeDelta::FromMilliseconds(150)); + latencies->StepComplete(LoadLatencyTimes::kLoadFromStore); + task_environment_.FastForwardBy(base::TimeDelta::FromMilliseconds(50)); + latencies->StepComplete(LoadLatencyTimes::kUploadActions); + reporter_->OnLoadStream(LoadStreamStatus::kNoStatus, + LoadStreamStatus::kLoadedFromNetwork, + std::move(latencies)); + } + task_environment_.FastForwardBy(base::TimeDelta::FromMilliseconds(300)); + reporter_->ContentSliceViewed(kSurfaceId, 0); + reporter_->ContentSliceViewed(kSurfaceId, 1); + + histogram_.ExpectUniqueTimeSample( + "ContentSuggestions.Feed.LoadStepLatency.LoadFromStore", + base::TimeDelta::FromMilliseconds(150), 1); + histogram_.ExpectUniqueTimeSample( + "ContentSuggestions.Feed.LoadStepLatency.ActionUpload", + base::TimeDelta::FromMilliseconds(50), 1); + histogram_.ExpectUniqueTimeSample( + "ContentSuggestions.Feed.LoadStepLatency.StreamView", + base::TimeDelta::FromMilliseconds(300), 1); +} + TEST_F(MetricsReporterTest, ReportsLoadMoreStatus) { reporter_->OnLoadMore(LoadStreamStatus::kLoadedFromNetwork);
diff --git a/components/feed/core/v2/tasks/load_stream_task.cc b/components/feed/core/v2/tasks/load_stream_task.cc index 44d321b..fdf0e66 100644 --- a/components/feed/core/v2/tasks/load_stream_task.cc +++ b/components/feed/core/v2/tasks/load_stream_task.cc
@@ -42,19 +42,22 @@ Result::Result() = default; Result::Result(LoadStreamStatus status) : final_status(status) {} Result::~Result() = default; -Result::Result(const Result&) = default; -Result& Result::operator=(const Result&) = default; +Result::Result(Result&&) = default; +Result& Result::operator=(Result&&) = default; LoadStreamTask::LoadStreamTask(LoadType load_type, FeedStream* stream, base::OnceCallback<void(Result)> done_callback) : load_type_(load_type), stream_(stream), - done_callback_(std::move(done_callback)) {} + done_callback_(std::move(done_callback)) { + latencies_ = std::make_unique<LoadLatencyTimes>(); +} LoadStreamTask::~LoadStreamTask() = default; void LoadStreamTask::Run() { + latencies_->StepComplete(LoadLatencyTimes::kTaskExecution); // Phase 1: Try to load from persistent storage. // TODO(harringtond): We're checking ShouldAttemptLoad() here and before the @@ -83,6 +86,8 @@ void LoadStreamTask::LoadFromStoreComplete( LoadStreamFromStoreTask::Result result) { load_from_store_status_ = result.status; + latencies_->StepComplete(LoadLatencyTimes::kLoadFromStore); + // Phase 2. // - If loading from store works, update the model. // - Otherwise, try to load from the network. @@ -110,6 +115,7 @@ } void LoadStreamTask::UploadActionsComplete(UploadActionsTask::Result result) { + latencies_->StepComplete(LoadLatencyTimes::kUploadActions); stream_->GetNetwork()->SendQueryRequest( CreateFeedQueryRefreshRequest( GetRequestReason(load_type_), stream_->GetRequestMetadata(), @@ -119,6 +125,8 @@ void LoadStreamTask::QueryRequestComplete( FeedNetwork::QueryRequestResult result) { + latencies_->StepComplete(LoadLatencyTimes::kQueryRequest); + DCHECK(!stream_->GetModel()); network_response_info_ = result.response_info; @@ -166,7 +174,8 @@ result.load_type = load_type_; result.network_response_info = network_response_info_; result.loaded_new_content_from_network = loaded_new_content_from_network_; - std::move(done_callback_).Run(result); + result.latencies = std::move(latencies_); + std::move(done_callback_).Run(std::move(result)); TaskComplete(); }
diff --git a/components/feed/core/v2/tasks/load_stream_task.h b/components/feed/core/v2/tasks/load_stream_task.h index 41c97ef..67aef56 100644 --- a/components/feed/core/v2/tasks/load_stream_task.h +++ b/components/feed/core/v2/tasks/load_stream_task.h
@@ -40,8 +40,8 @@ Result(); explicit Result(LoadStreamStatus status); ~Result(); - Result(const Result&); - Result& operator=(const Result&); + Result(Result&&); + Result& operator=(Result&&); // Final status of loading the stream. LoadStreamStatus final_status = LoadStreamStatus::kNoStatus; @@ -52,6 +52,7 @@ // Information about the network request, if one was made. base::Optional<NetworkResponseInfo> network_response_info; bool loaded_new_content_from_network = false; + std::unique_ptr<LoadLatencyTimes> latencies; }; LoadStreamTask(LoadType load_type, @@ -81,6 +82,8 @@ base::Optional<NetworkResponseInfo> network_response_info_; bool loaded_new_content_from_network_ = false; + std::unique_ptr<LoadLatencyTimes> latencies_; + base::TimeTicks task_creation_time_; base::TimeTicks fetch_start_time_; base::OnceCallback<void(Result)> done_callback_; std::unique_ptr<UploadActionsTask> upload_actions_task_;
diff --git a/components/feed/core/v2/types.cc b/components/feed/core/v2/types.cc index 44694c6..797f0fb8 100644 --- a/components/feed/core/v2/types.cc +++ b/components/feed/core/v2/types.cc
@@ -138,4 +138,12 @@ return result; } +LoadLatencyTimes::LoadLatencyTimes() : last_time_(base::TimeTicks::Now()) {} +LoadLatencyTimes::~LoadLatencyTimes() = default; +void LoadLatencyTimes::StepComplete(StepKind kind) { + auto now = base::TimeTicks::Now(); + steps_.push_back(Step{kind, now - last_time_}); + last_time_ = now; +} + } // namespace feed
diff --git a/components/feed/core/v2/types.h b/components/feed/core/v2/types.h index d157e160..883effa 100644 --- a/components/feed/core/v2/types.h +++ b/components/feed/core/v2/types.h
@@ -7,6 +7,7 @@ #include <string> +#include "base/time/time.h" #include "base/util/type_safety/id_type.h" #include "base/values.h" #include "components/feed/core/v2/public/types.h" @@ -52,6 +53,40 @@ base::Value PersistentMetricsDataToValue(const PersistentMetricsData& data); PersistentMetricsData PersistentMetricsDataFromValue(const base::Value& value); +class LoadLatencyTimes { + public: + enum StepKind { + // Time from when the LoadStreamTask was created to when it is executed. + kTaskExecution, + // Time spent loading the stream state from storage. + kLoadFromStore, + // Time spent querying for and uploading stored actions. Recorded even if + // no actions are uploaded. + kUploadActions, + // Time spent making the FeedQuery request. + kQueryRequest, + // A view was reported in the stream, indicating the stream was shown. + kStreamViewed, + }; + struct Step { + StepKind kind; + base::TimeDelta latency; + }; + + LoadLatencyTimes(); + ~LoadLatencyTimes(); + LoadLatencyTimes(const LoadLatencyTimes&) = delete; + LoadLatencyTimes& operator=(const LoadLatencyTimes&) = delete; + + void StepComplete(StepKind kind); + + const std::vector<Step>& steps() const { return steps_; } + + private: + base::TimeTicks last_time_; + std::vector<Step> steps_; +}; + } // namespace feed #endif // COMPONENTS_FEED_CORE_V2_TYPES_H_
diff --git a/components/optimization_guide/hint_cache.cc b/components/optimization_guide/hint_cache.cc index 00559b0..c7b883a 100644 --- a/components/optimization_guide/hint_cache.cc +++ b/components/optimization_guide/hint_cache.cc
@@ -80,6 +80,7 @@ void HintCache::UpdateFetchedHints( std::unique_ptr<proto::GetHintsResponse> get_hints_response, base::Time update_time, + const base::flat_set<std::string>& hosts_fetched, const base::flat_set<GURL>& urls_fetched, base::OnceClosure callback) { std::unique_ptr<StoreUpdateData> fetched_hints_update_data = @@ -117,29 +118,50 @@ optimization_guide_store_->ClearFetchedHintsFromDatabase(); } -bool HintCache::HasHint(const std::string& host) const { +bool HintCache::HasHint(const std::string& host) { DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); - OptimizationGuideStore::EntryKey hint_entry_key; - return optimization_guide_store_->FindHintEntryKey(host, &hint_entry_key); + + auto hint_it = host_keyed_cache_.Get(host); + if (hint_it == host_keyed_cache_.end()) { + // If not in-memory, check database. + OptimizationGuideStore::EntryKey hint_entry_key; + return optimization_guide_store_->FindHintEntryKey(host, &hint_entry_key); + } + + // The hint for |host| was requested but no hint was returned. + if (!hint_it->second) + return false; + + MemoryHint* hint = hint_it->second.get(); + if (!hint->expiry_time() || *hint->expiry_time() > clock_->Now()) + return true; + + // The hint is expired so remove it from the cache. + host_keyed_cache_.Erase(hint_it); + return false; } void HintCache::LoadHint(const std::string& host, HintLoadedCallback callback) { DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); - OptimizationGuideStore::EntryKey hint_entry_key; - if (!optimization_guide_store_->FindHintEntryKey(host, &hint_entry_key)) { - std::move(callback).Run(nullptr); - return; - } - // Search for the entry key in the host-keyed cache; if it is not already // there, then asynchronously load it from the store and return. - auto hint_it = host_keyed_cache_.Get(hint_entry_key); + auto hint_it = host_keyed_cache_.Get(host); if (hint_it == host_keyed_cache_.end()) { + OptimizationGuideStore::EntryKey hint_entry_key; + if (!optimization_guide_store_->FindHintEntryKey(host, &hint_entry_key)) { + std::move(callback).Run(nullptr); + return; + } optimization_guide_store_->LoadHint( hint_entry_key, base::BindOnce(&HintCache::OnLoadStoreHint, base::Unretained(this), - std::move(callback))); + host, std::move(callback))); + return; + } + + if (!hint_it->second) { + std::move(callback).Run(nullptr); return; } @@ -151,19 +173,16 @@ const std::string& host) { DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); - // Try to retrieve the hint entry key for the host. If no hint exists for the - // host, then simply return. - OptimizationGuideStore::EntryKey hint_entry_key; - if (!optimization_guide_store_->FindHintEntryKey(host, &hint_entry_key)) - return nullptr; - // Find the hint within the host-keyed cache. It will only be available here // if it has been loaded recently enough to be retained within the MRU cache. - auto hint_it = host_keyed_cache_.Get(hint_entry_key); - if (hint_it == host_keyed_cache_.end()) + auto hint_it = host_keyed_cache_.Get(host); + if (hint_it == host_keyed_cache_.end() || !hint_it->second) return nullptr; MemoryHint* hint = hint_it->second.get(); + if (!hint) + return nullptr; + // Make sure the hint is not expired before propagating it up. if (hint->expiry_time().has_value() && *hint->expiry_time() < clock_->Now()) { // The hint is expired so remove it from the cache. @@ -235,6 +254,7 @@ } void HintCache::OnLoadStoreHint( + const std::string& host, HintLoadedCallback callback, const OptimizationGuideStore::EntryKey& hint_entry_key, std::unique_ptr<MemoryHint> hint) { @@ -247,11 +267,14 @@ // Check if the hint was cached in the host-keyed cache after the load was // requested from the store. This can occur if multiple loads for the same // entry key occur consecutively prior to any returning. - auto hint_it = host_keyed_cache_.Get(hint_entry_key); - if (hint_it == host_keyed_cache_.end()) { - hint_it = host_keyed_cache_.Put(hint_entry_key, std::move(hint)); - } + auto hint_it = host_keyed_cache_.Get(host); + if (hint_it == host_keyed_cache_.end()) + hint_it = host_keyed_cache_.Put(host, std::move(hint)); + if (!hint_it->second) { + std::move(callback).Run(nullptr); + return; + } std::move(callback).Run(hint_it->second.get()->hint()); } @@ -285,6 +308,11 @@ switch (hint.key_representation()) { case proto::HOST_SUFFIX: case proto::HOST: + host_keyed_cache_.Put( + hint_key, + std::make_unique<MemoryHint>( + expiry_time, + std::make_unique<optimization_guide::proto::Hint>(hint))); update_data->MoveHintIntoUpdateData(std::move(hint)); processed_hints_to_store = true; break;
diff --git a/components/optimization_guide/hint_cache.h b/components/optimization_guide/hint_cache.h index 6407657..3cbd625 100644 --- a/components/optimization_guide/hint_cache.h +++ b/components/optimization_guide/hint_cache.h
@@ -74,13 +74,14 @@ // Process |get_hints_response| to be stored in the hint cache store. // |callback| is asynchronously run when the hints are successfully stored or // if the store is not available. |update_time| specifies when the hints - // within |get_hints_response| will need to be updated next. |urls_fetched| - // specifies the URLs for which specific hints were requested to be fetched. - // It is expected for |this| to keep track of the result, even if a hint was - // not returned for the URL. + // within |get_hints_response| will need to be updated next. |hosts_fetched| + // and |urls_fetched| specifies the hosts and URLs for which specific hints + // were requested to be fetched. It is expected for |this| to keep track of + // the result, even if a hint was not returned for the URL. void UpdateFetchedHints( std::unique_ptr<proto::GetHintsResponse> get_hints_response, base::Time update_time, + const base::flat_set<std::string>& hosts_fetched, const base::flat_set<GURL>& urls_fetched, base::OnceClosure callback); @@ -98,7 +99,7 @@ // Returns whether the cache has a hint data for |host| locally (whether // in the host-keyed cache or persisted on disk). - bool HasHint(const std::string& host) const; + bool HasHint(const std::string& host); // Requests that hint data for |host| be loaded asynchronously and passed to // |callback| if/when loaded. @@ -145,8 +146,7 @@ private: using HostKeyedHintCache = - base::HashingMRUCache<OptimizationGuideStore::EntryKey, - std::unique_ptr<MemoryHint>>; + base::HashingMRUCache<std::string, std::unique_ptr<MemoryHint>>; using URLKeyedHintCache = base::HashingMRUCache<std::string, std::unique_ptr<MemoryHint>>; @@ -160,6 +160,7 @@ // used element, and then runs the callback initially provided by the // LoadHint() call. void OnLoadStoreHint( + const std::string& host, HintLoadedCallback callback, const OptimizationGuideStore::EntryKey& store_hint_entry_key, std::unique_ptr<MemoryHint> hint);
diff --git a/components/optimization_guide/hint_cache_unittest.cc b/components/optimization_guide/hint_cache_unittest.cc index 6409d8d..51a0d394 100644 --- a/components/optimization_guide/hint_cache_unittest.cc +++ b/components/optimization_guide/hint_cache_unittest.cc
@@ -96,10 +96,11 @@ void UpdateFetchedHintsAndWait( std::unique_ptr<proto::GetHintsResponse> get_hints_response, base::Time stored_time, + const base::flat_set<std::string>& hosts_fetched, const base::flat_set<GURL>& urls_fetched) { are_fetched_hints_updated_ = false; hint_cache_->UpdateFetchedHints( - std::move(get_hints_response), stored_time, urls_fetched, + std::move(get_hints_response), stored_time, hosts_fetched, urls_fetched, base::BindOnce(&HintCacheTest::OnHintsUpdated, base::Unretained(this))); while (!are_fetched_hints_updated_) @@ -541,7 +542,8 @@ page_hint->set_page_pattern("page pattern"); base::Time stored_time = base::Time().Now(); - UpdateFetchedHintsAndWait(std::move(get_hints_response), stored_time, {}); + UpdateFetchedHintsAndWait(std::move(get_hints_response), stored_time, + {"host.domain.org"}, {}); EXPECT_TRUE(are_fetched_hints_updated()); // Next update time for hints should be updated. @@ -556,14 +558,13 @@ std::unique_ptr<proto::GetHintsResponse> get_hints_response = std::make_unique<proto::GetHintsResponse>(); - UpdateFetchedHintsAndWait(std::move(get_hints_response), stored_time, {}); + UpdateFetchedHintsAndWait(std::move(get_hints_response), stored_time, {}, {}); // Empty Fetched Hints causes the metadata entry to be updated. EXPECT_TRUE(are_fetched_hints_updated()); EXPECT_EQ(hint_cache()->GetFetchedHintsUpdateTime(), stored_time); } TEST_F(HintCacheTest, StoreValidFetchedHintsWithServerProvidedExpiryTime) { - base::HistogramTester histogram_tester; const int kMemoryCacheSize = 5; const int kFetchedHintExpirationSecs = 60; CreateAndInitializeHintCache(kMemoryCacheSize); @@ -585,22 +586,22 @@ base::Time stored_time = base::Time().Now(); GURL navigation_url("https://foo.com"); UpdateFetchedHintsAndWait(std::move(get_hints_response), stored_time, - {navigation_url}); + {"host.domain.org"}, {navigation_url}); EXPECT_TRUE(are_fetched_hints_updated()); // Next update time for hints should be updated. EXPECT_EQ(hint_cache()->GetFetchedHintsUpdateTime(), stored_time); - LoadHint("host.domain.org"); - // HISTOGRAM TEST! - histogram_tester.ExpectTimeBucketCount( - "OptimizationGuide.HintCache.FetchedHint.TimeToExpiration", - base::TimeDelta::FromSeconds(kFetchedHintExpirationSecs), 1); - EXPECT_FALSE(hint_cache()->GetURLKeyedHint(navigation_url)); + // Should be loaded right when response is received. + EXPECT_TRUE(hint_cache()->GetHostKeyedHintIfLoaded("host.domain.org")); + + // Set time so hint should be expired. + MoveClockForwardBy( + base::TimeDelta::FromSeconds(kFetchedHintExpirationSecs + 1)); + EXPECT_FALSE(hint_cache()->GetHostKeyedHintIfLoaded("host.domain.org")); } TEST_F(HintCacheTest, StoreValidFetchedHintsWithDefaultExpiryTime) { - base::HistogramTester histogram_tester; const int kMemoryCacheSize = 5; CreateAndInitializeHintCache(kMemoryCacheSize); @@ -617,16 +618,21 @@ page_hint->set_page_pattern("page pattern"); base::Time stored_time = base::Time().Now(); - UpdateFetchedHintsAndWait(std::move(get_hints_response), stored_time, {}); + UpdateFetchedHintsAndWait(std::move(get_hints_response), stored_time, + {"host.domain.org"}, {}); EXPECT_TRUE(are_fetched_hints_updated()); // Next update time for hints should be updated. EXPECT_EQ(hint_cache()->GetFetchedHintsUpdateTime(), stored_time); - LoadHint("host.domain.org"); - histogram_tester.ExpectTimeBucketCount( - "OptimizationGuide.HintCache.FetchedHint.TimeToExpiration", - optimization_guide::features::StoredFetchedHintsFreshnessDuration(), 1); + // Should be loaded right when response is received. + EXPECT_TRUE(hint_cache()->GetHostKeyedHintIfLoaded("host.domain.org")); + + // Set time so hint should be expired. + MoveClockForwardBy( + optimization_guide::features::StoredFetchedHintsFreshnessDuration() + + base::TimeDelta::FromSeconds(1)); + EXPECT_FALSE(hint_cache()->GetHostKeyedHintIfLoaded("host.domain.org")); } TEST_F(HintCacheTest, CacheValidURLKeyedHint) { @@ -702,7 +708,8 @@ page_hint2->set_page_pattern("page pattern"); base::Time stored_time = base::Time().Now(); - UpdateFetchedHintsAndWait(std::move(get_hints_response), stored_time, {}); + UpdateFetchedHintsAndWait(std::move(get_hints_response), stored_time, + {"shouldpurge.com", "notpurged.com"}, {}); EXPECT_TRUE(are_fetched_hints_updated()); EXPECT_TRUE(hint_cache()->HasHint("shouldpurge.com")); EXPECT_TRUE(hint_cache()->HasHint("notpurged.com")); @@ -741,7 +748,8 @@ page_hint->set_page_pattern("page pattern"); base::Time stored_time = base::Time().Now(); - UpdateFetchedHintsAndWait(std::move(get_hints_response), stored_time, {}); + UpdateFetchedHintsAndWait(std::move(get_hints_response), stored_time, + {"host.com"}, {}); EXPECT_TRUE(are_fetched_hints_updated()); LoadHint(host); @@ -824,7 +832,7 @@ base::Time stored_time = base::Time().Now(); UpdateFetchedHintsAndWait(std::move(get_hints_response), stored_time, - {https_url_without_hint}); + {"host.com"}, {https_url_without_hint}); EXPECT_TRUE(hint_cache()->HasURLKeyedEntryForURL(https_url_with_hint)); EXPECT_TRUE(hint_cache()->HasURLKeyedEntryForURL(https_url_with_hint));
diff --git a/components/password_manager/core/common/password_manager_features.cc b/components/password_manager/core/common/password_manager_features.cc index f098838..eceeaa3 100644 --- a/components/password_manager/core/common/password_manager_features.cc +++ b/components/password_manager/core/common/password_manager_features.cc
@@ -46,6 +46,12 @@ "EnablePasswordGenerationForClearTextFields", base::FEATURE_DISABLED_BY_DEFAULT}; +// Enables showing UI button in password fallback sheet. +// The button opens a different sheet that allows filling a password from any +// origin. +const base::Feature kFillingPasswordsFromAnyOrigin{ + "FillingPasswordsFromAnyOrigin", base::FEATURE_DISABLED_BY_DEFAULT}; + // Enables the experiment for the password manager to only fill on account // selection, rather than autofilling on page load, with highlighting of fields. const base::Feature kFillOnAccountSelect = {"fill-on-account-select",
diff --git a/components/password_manager/core/common/password_manager_features.h b/components/password_manager/core/common/password_manager_features.h index 36995752..039b6af 100644 --- a/components/password_manager/core/common/password_manager_features.h +++ b/components/password_manager/core/common/password_manager_features.h
@@ -24,6 +24,7 @@ extern const base::Feature kEnableOverwritingPlaceholderUsernames; extern const base::Feature kEnablePasswordsAccountStorage; extern const base::Feature KEnablePasswordGenerationForClearTextFields; +extern const base::Feature kFillingPasswordsFromAnyOrigin; extern const base::Feature kFillOnAccountSelect; extern const base::Feature kGooglePasswordManager; extern const base::Feature kPasswordChange;
diff --git a/components/performance_manager/DEPS b/components/performance_manager/DEPS index d9b0a7ff..eb9f102 100644 --- a/components/performance_manager/DEPS +++ b/components/performance_manager/DEPS
@@ -10,6 +10,7 @@ "+services/service_manager/public/cpp", "+third_party/blink/public/common/tokens", "+third_party/blink/public/mojom/favicon", + "+third_party/blink/public/mojom/performance_manager", "+third_party/blink/public/mojom/service_worker", "+third_party/blink/public/mojom/tokens", "+third_party/leveldatabase",
diff --git a/components/performance_manager/public/v8_memory/v8_per_frame_memory_decorator.h b/components/performance_manager/public/v8_memory/v8_per_frame_memory_decorator.h index 038761bd..11087007 100644 --- a/components/performance_manager/public/v8_memory/v8_per_frame_memory_decorator.h +++ b/components/performance_manager/public/v8_memory/v8_per_frame_memory_decorator.h
@@ -20,7 +20,7 @@ #include "components/performance_manager/public/graph/process_node.h" #include "components/performance_manager/public/render_process_host_id.h" #include "content/public/browser/global_routing_id.h" -#include "content/public/common/performance_manager/v8_per_frame_memory.mojom.h" +#include "third_party/blink/public/mojom/performance_manager/v8_per_frame_memory.mojom.h" namespace performance_manager { @@ -493,7 +493,7 @@ // communicate with the given process. Exposed so that it can be overridden to // implement the interface with a test fake. using BindV8PerFrameMemoryReporterCallback = base::RepeatingCallback<void( - mojo::PendingReceiver<performance_manager::mojom::V8PerFrameMemoryReporter>, + mojo::PendingReceiver<blink::mojom::V8PerFrameMemoryReporter>, RenderProcessHostProxy)>; // Sets a callback that will be used to bind the V8PerFrameMemoryReporter
diff --git a/components/performance_manager/v8_memory/v8_per_frame_memory_decorator.cc b/components/performance_manager/v8_memory/v8_per_frame_memory_decorator.cc index 86e7274..7e2772de 100644 --- a/components/performance_manager/v8_memory/v8_per_frame_memory_decorator.cc +++ b/components/performance_manager/v8_memory/v8_per_frame_memory_decorator.cc
@@ -49,7 +49,7 @@ // Forwards the pending receiver to the RenderProcessHost and binds it on the // UI thread. void BindReceiverOnUIThread( - mojo::PendingReceiver<performance_manager::mojom::V8PerFrameMemoryReporter> + mojo::PendingReceiver<blink::mojom::V8PerFrameMemoryReporter> pending_receiver, RenderProcessHostProxy proxy) { auto* render_process_host = proxy.Get(); @@ -157,12 +157,11 @@ void StartMeasurement(); void EnsureRemote(); void OnPerFrameV8MemoryUsageData( - performance_manager::mojom::PerProcessV8MemoryUsageDataPtr result); + blink::mojom::PerProcessV8MemoryUsageDataPtr result); const ProcessNode* const process_node_; - mojo::Remote<performance_manager::mojom::V8PerFrameMemoryReporter> - resource_usage_reporter_; + mojo::Remote<blink::mojom::V8PerFrameMemoryReporter> resource_usage_reporter_; enum class State { kWaiting, // Waiting to take a measurement. @@ -243,7 +242,7 @@ } void NodeAttachedProcessData::OnPerFrameV8MemoryUsageData( - performance_manager::mojom::PerProcessV8MemoryUsageDataPtr result) { + blink::mojom::PerProcessV8MemoryUsageDataPtr result) { DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); DCHECK_EQ(state_, State::kMeasuring); @@ -254,14 +253,15 @@ uint64_t unassociated_v8_bytes_used = result->unassociated_bytes_used; // Create a mapping from token to per-frame usage for the merge below. - std::vector<std::pair<FrameToken, mojom::PerFrameV8MemoryUsageDataPtr>> tmp; + std::vector<std::pair<FrameToken, blink::mojom::PerFrameV8MemoryUsageDataPtr>> + tmp; for (auto& entry : result->associated_memory) { tmp.emplace_back( std::make_pair(FrameToken(entry->frame_token), std::move(entry))); } DCHECK_EQ(tmp.size(), result->associated_memory.size()); - base::flat_map<FrameToken, mojom::PerFrameV8MemoryUsageDataPtr> + base::flat_map<FrameToken, blink::mojom::PerFrameV8MemoryUsageDataPtr> associated_memory(std::move(tmp)); // Validate that the frame tokens were all unique. If there are duplicates, // the map will arbirarily drop all but one record per unique token. @@ -315,7 +315,7 @@ return; // This interface is implemented in //content/renderer/performance_manager. - mojo::PendingReceiver<performance_manager::mojom::V8PerFrameMemoryReporter> + mojo::PendingReceiver<blink::mojom::V8PerFrameMemoryReporter> pending_receiver = resource_usage_reporter_.BindNewPipeAndPassReceiver(); RenderProcessHostProxy proxy = process_node_->GetRenderProcessHostProxy();
diff --git a/components/performance_manager/v8_memory/v8_per_frame_memory_decorator_unittest.cc b/components/performance_manager/v8_memory/v8_per_frame_memory_decorator_unittest.cc index 844985e44..13f7b09c 100644 --- a/components/performance_manager/v8_memory/v8_per_frame_memory_decorator_unittest.cc +++ b/components/performance_manager/v8_memory/v8_per_frame_memory_decorator_unittest.cc
@@ -45,7 +45,7 @@ namespace { class LenientMockV8PerFrameMemoryReporter - : public mojom::V8PerFrameMemoryReporter { + : public blink::mojom::V8PerFrameMemoryReporter { public: LenientMockV8PerFrameMemoryReporter() : receiver_(this) {} @@ -54,13 +54,13 @@ (GetPerFrameV8MemoryUsageDataCallback callback), (override)); - void Bind( - mojo::PendingReceiver<mojom::V8PerFrameMemoryReporter> pending_receiver) { + void Bind(mojo::PendingReceiver<blink::mojom::V8PerFrameMemoryReporter> + pending_receiver) { return receiver_.Bind(std::move(pending_receiver)); } private: - mojo::Receiver<mojom::V8PerFrameMemoryReporter> receiver_; + mojo::Receiver<blink::mojom::V8PerFrameMemoryReporter> receiver_; }; using MockV8PerFrameMemoryReporter = @@ -122,7 +122,7 @@ GetMainThreadTaskRunner() = 0; void ReplyWithData( - mojom::PerProcessV8MemoryUsageDataPtr data, + blink::mojom::PerProcessV8MemoryUsageDataPtr data, MockV8PerFrameMemoryReporter::GetPerFrameV8MemoryUsageDataCallback callback) { std::move(callback).Run(std::move(data)); @@ -130,7 +130,7 @@ void DelayedReplyWithData( const base::TimeDelta& delay, - mojom::PerProcessV8MemoryUsageDataPtr data, + blink::mojom::PerProcessV8MemoryUsageDataPtr data, MockV8PerFrameMemoryReporter::GetPerFrameV8MemoryUsageDataCallback callback) { GetMainThreadTaskRunner()->PostDelayedTask( @@ -152,16 +152,17 @@ } void ExpectQueryAndReply(MockV8PerFrameMemoryReporter* mock_reporter, - mojom::PerProcessV8MemoryUsageDataPtr data) { + blink::mojom::PerProcessV8MemoryUsageDataPtr data) { ExpectQuery( mock_reporter, base::BindRepeating(&V8PerFrameMemoryDecoratorTestBase::ReplyWithData, base::Unretained(this), base::Passed(&data))); } - void ExpectQueryAndDelayReply(MockV8PerFrameMemoryReporter* mock_reporter, - const base::TimeDelta& delay, - mojom::PerProcessV8MemoryUsageDataPtr data) { + void ExpectQueryAndDelayReply( + MockV8PerFrameMemoryReporter* mock_reporter, + const base::TimeDelta& delay, + blink::mojom::PerProcessV8MemoryUsageDataPtr data) { ExpectQuery(mock_reporter, base::BindRepeating( &V8PerFrameMemoryDecoratorTestBase::DelayedReplyWithData, @@ -170,26 +171,25 @@ void ExpectBindAndRespondToQuery( MockV8PerFrameMemoryReporter* mock_reporter, - mojom::PerProcessV8MemoryUsageDataPtr data, + blink::mojom::PerProcessV8MemoryUsageDataPtr data, RenderProcessHostId expected_process_id = kTestProcessID) { // Wrap the move-only |data| in a callback for the expectation below. ExpectQueryAndReply(mock_reporter, std::move(data)); EXPECT_CALL(*this, BindReceiverWithProxyHost(_, _)) - .WillOnce([mock_reporter, expected_process_id]( - mojo::PendingReceiver< - performance_manager::mojom::V8PerFrameMemoryReporter> - pending_receiver, - RenderProcessHostProxy proxy) { - DCHECK_EQ(expected_process_id, proxy.render_process_host_id()); - mock_reporter->Bind(std::move(pending_receiver)); - }); + .WillOnce( + [mock_reporter, expected_process_id]( + mojo::PendingReceiver<blink::mojom::V8PerFrameMemoryReporter> + pending_receiver, + RenderProcessHostProxy proxy) { + DCHECK_EQ(expected_process_id, proxy.render_process_host_id()); + mock_reporter->Bind(std::move(pending_receiver)); + }); } MOCK_METHOD(void, BindReceiverWithProxyHost, - (mojo::PendingReceiver< - performance_manager::mojom::V8PerFrameMemoryReporter> + (mojo::PendingReceiver<blink::mojom::V8PerFrameMemoryReporter> pending_receiver, RenderProcessHostProxy proxy), (const)); @@ -197,8 +197,7 @@ // Always bind the receiver callback on the main sequence. internal::BindV8PerFrameMemoryReporterCallback bind_callback_ = base::BindLambdaForTesting( - [this](mojo::PendingReceiver< - performance_manager::mojom::V8PerFrameMemoryReporter> + [this](mojo::PendingReceiver<blink::mojom::V8PerFrameMemoryReporter> pending_receiver, RenderProcessHostProxy proxy) { this->GetMainThreadTaskRunner()->PostTask( @@ -211,11 +210,12 @@ base::TimeTicks last_query_time_; }; -void AddPerFrameIsolateMemoryUsage(FrameToken frame_token, - int64_t world_id, - uint64_t bytes_used, - mojom::PerProcessV8MemoryUsageData* data) { - mojom::PerFrameV8MemoryUsageData* per_frame_data = nullptr; +void AddPerFrameIsolateMemoryUsage( + FrameToken frame_token, + int64_t world_id, + uint64_t bytes_used, + blink::mojom::PerProcessV8MemoryUsageData* data) { + blink::mojom::PerFrameV8MemoryUsageData* per_frame_data = nullptr; for (auto& datum : data->associated_memory) { if (datum->frame_token == frame_token.value()) { per_frame_data = datum.get(); @@ -224,15 +224,15 @@ } if (!per_frame_data) { - mojom::PerFrameV8MemoryUsageDataPtr datum = - mojom::PerFrameV8MemoryUsageData::New(); + blink::mojom::PerFrameV8MemoryUsageDataPtr datum = + blink::mojom::PerFrameV8MemoryUsageData::New(); datum->frame_token = frame_token.value(); per_frame_data = datum.get(); data->associated_memory.push_back(std::move(datum)); } ASSERT_FALSE(base::Contains(per_frame_data->associated_bytes, world_id)); - auto isolated_world_usage = mojom::V8IsolatedWorldMemoryUsage::New(); + auto isolated_world_usage = blink::mojom::V8IsolatedWorldMemoryUsage::New(); isolated_world_usage->bytes_used = bytes_used; per_frame_data->associated_bytes[world_id] = std::move(isolated_world_usage); } @@ -267,7 +267,7 @@ V8PerFrameMemoryRequest memory_request(kMinTimeBetweenRequests, graph()); MockV8PerFrameMemoryReporter mock_reporter; - auto data = mojom::PerProcessV8MemoryUsageData::New(); + auto data = blink::mojom::PerProcessV8MemoryUsageData::New(); data->unassociated_bytes_used = kUnassociatedBytes; ExpectBindAndRespondToQuery(&mock_reporter, std::move(data)); @@ -296,7 +296,7 @@ RenderProcessHostProxy::CreateForTesting(kTestProcessID)); MockV8PerFrameMemoryReporter mock_reporter; - auto data = mojom::PerProcessV8MemoryUsageData::New(); + auto data = blink::mojom::PerProcessV8MemoryUsageData::New(); data->unassociated_bytes_used = kUnassociatedBytes; ExpectBindAndRespondToQuery(&mock_reporter, std::move(data)); @@ -341,7 +341,7 @@ MockV8PerFrameMemoryReporter mock_reporter; { - auto data = mojom::PerProcessV8MemoryUsageData::New(); + auto data = blink::mojom::PerProcessV8MemoryUsageData::New(); // Response to request 1. data->unassociated_bytes_used = 1; ExpectBindAndRespondToQuery(&mock_reporter, std::move(data)); @@ -384,7 +384,7 @@ // Expect another query once completing the query above. { - auto data = mojom::PerProcessV8MemoryUsageData::New(); + auto data = blink::mojom::PerProcessV8MemoryUsageData::New(); // Response to request 3. data->unassociated_bytes_used = 3; ExpectQueryAndReply(&mock_reporter, std::move(data)); @@ -392,7 +392,7 @@ // Reply to the request above. { - auto data = mojom::PerProcessV8MemoryUsageData::New(); + auto data = blink::mojom::PerProcessV8MemoryUsageData::New(); // Response to request 2. data->unassociated_bytes_used = 2; std::move(callback).Run(std::move(data)); @@ -417,7 +417,7 @@ // Create a process node and validate that it gets a request. MockV8PerFrameMemoryReporter reporter1; { - auto data = mojom::PerProcessV8MemoryUsageData::New(); + auto data = blink::mojom::PerProcessV8MemoryUsageData::New(); data->unassociated_bytes_used = 1; ExpectBindAndRespondToQuery(&reporter1, std::move(data)); } @@ -432,7 +432,7 @@ // Create a second process node and validate that it gets a request. MockV8PerFrameMemoryReporter reporter2; { - auto data = mojom::PerProcessV8MemoryUsageData::New(); + auto data = blink::mojom::PerProcessV8MemoryUsageData::New(); data->unassociated_bytes_used = 2; ExpectBindAndRespondToQuery(&reporter2, std::move(data)); } @@ -457,7 +457,8 @@ MockV8PerFrameMemoryReporter::GetPerFrameV8MemoryUsageDataCallback callback) { *request_time = base::TimeTicks::Now(); - std::move(callback).Run(mojom::PerProcessV8MemoryUsageData::New()); + std::move(callback).Run( + blink::mojom::PerProcessV8MemoryUsageData::New()); }; base::TimeTicks process1_request_time; @@ -483,7 +484,7 @@ MockV8PerFrameMemoryReporter reporter; { - auto data = mojom::PerProcessV8MemoryUsageData::New(); + auto data = blink::mojom::PerProcessV8MemoryUsageData::New(); // Add data for an unknown frame. AddPerFrameIsolateMemoryUsage(FrameToken(base::UnguessableToken::Create()), 0, 1024u, data.get()); @@ -514,7 +515,7 @@ auto frame2 = CreateNode<FrameNodeImpl>(process.get(), page.get(), nullptr, 3, 4, frame2_id); { - auto data = mojom::PerProcessV8MemoryUsageData::New(); + auto data = blink::mojom::PerProcessV8MemoryUsageData::New(); AddPerFrameIsolateMemoryUsage(frame1_id, 0, 1001u, data.get()); AddPerFrameIsolateMemoryUsage(frame2_id, 0, 1002u, data.get()); ExpectQueryAndReply(&reporter, std::move(data)); @@ -535,7 +536,7 @@ // Now verify that data is cleared for any frame that doesn't get an update, // plus verify that unknown frame data toes to unassociated bytes. { - auto data = mojom::PerProcessV8MemoryUsageData::New(); + auto data = blink::mojom::PerProcessV8MemoryUsageData::New(); AddPerFrameIsolateMemoryUsage(frame1_id, 0, 1003u, data.get()); AddPerFrameIsolateMemoryUsage(FrameToken(base::UnguessableToken::Create()), 0, 2233u, data.get()); @@ -577,7 +578,7 @@ // frequency. MockV8PerFrameMemoryReporter mock_reporter; { - auto data = mojom::PerProcessV8MemoryUsageData::New(); + auto data = blink::mojom::PerProcessV8MemoryUsageData::New(); data->unassociated_bytes_used = 1U; ExpectBindAndRespondToQuery(&mock_reporter, std::move(data)); } @@ -598,7 +599,7 @@ // Another measurement should be taken after the shortest interval. EXPECT_EQ(kShortInterval, decorator->GetMinTimeBetweenRequestsPerProcess()); { - auto data = mojom::PerProcessV8MemoryUsageData::New(); + auto data = blink::mojom::PerProcessV8MemoryUsageData::New(); data->unassociated_bytes_used = 2U; ExpectQueryAndReply(&mock_reporter, std::move(data)); @@ -612,7 +613,7 @@ short_memory_request.reset(); EXPECT_EQ(kMediumInterval, decorator->GetMinTimeBetweenRequestsPerProcess()); { - auto data = mojom::PerProcessV8MemoryUsageData::New(); + auto data = blink::mojom::PerProcessV8MemoryUsageData::New(); data->unassociated_bytes_used = 3U; ExpectQueryAndReply(&mock_reporter, std::move(data)); @@ -629,7 +630,7 @@ long_memory_request.reset(); EXPECT_EQ(kMediumInterval, decorator->GetMinTimeBetweenRequestsPerProcess()); { - auto data = mojom::PerProcessV8MemoryUsageData::New(); + auto data = blink::mojom::PerProcessV8MemoryUsageData::New(); data->unassociated_bytes_used = 4U; ExpectQueryAndReply(&mock_reporter, std::move(data)); @@ -642,7 +643,7 @@ medium_memory_request.reset(); EXPECT_TRUE(decorator->GetMinTimeBetweenRequestsPerProcess().is_zero()); { - auto data = mojom::PerProcessV8MemoryUsageData::New(); + auto data = blink::mojom::PerProcessV8MemoryUsageData::New(); data->unassociated_bytes_used = 5U; ExpectQueryAndReply(&mock_reporter, std::move(data)); @@ -662,7 +663,7 @@ ->unassociated_v8_bytes_used()); { - auto data = mojom::PerProcessV8MemoryUsageData::New(); + auto data = blink::mojom::PerProcessV8MemoryUsageData::New(); data->unassociated_bytes_used = 6U; ExpectQueryAndReply(&mock_reporter, std::move(data)); @@ -679,7 +680,7 @@ EXPECT_EQ(kMediumInterval, decorator->GetMinTimeBetweenRequestsPerProcess()); { - auto data = mojom::PerProcessV8MemoryUsageData::New(); + auto data = blink::mojom::PerProcessV8MemoryUsageData::New(); data->unassociated_bytes_used = 7U; ExpectQueryAndReply(&mock_reporter, std::move(data)); @@ -689,7 +690,7 @@ } { - auto data = mojom::PerProcessV8MemoryUsageData::New(); + auto data = blink::mojom::PerProcessV8MemoryUsageData::New(); data->unassociated_bytes_used = 8U; ExpectQueryAndReply(&mock_reporter, std::move(data)); @@ -713,7 +714,7 @@ EXPECT_EQ(kMediumInterval, decorator->GetMinTimeBetweenRequestsPerProcess()); { - auto data = mojom::PerProcessV8MemoryUsageData::New(); + auto data = blink::mojom::PerProcessV8MemoryUsageData::New(); data->unassociated_bytes_used = 9U; ExpectQueryAndReply(&mock_reporter, std::move(data)); @@ -729,7 +730,7 @@ EXPECT_EQ(kMediumInterval, decorator->GetMinTimeBetweenRequestsPerProcess()); { - auto data = mojom::PerProcessV8MemoryUsageData::New(); + auto data = blink::mojom::PerProcessV8MemoryUsageData::New(); data->unassociated_bytes_used = 10U; ExpectQueryAndReply(&mock_reporter, std::move(data)); @@ -744,7 +745,7 @@ EXPECT_EQ(kLongInterval, decorator->GetMinTimeBetweenRequestsPerProcess()); { - auto data = mojom::PerProcessV8MemoryUsageData::New(); + auto data = blink::mojom::PerProcessV8MemoryUsageData::New(); data->unassociated_bytes_used = 11U; ExpectQueryAndReply(&mock_reporter, std::move(data)); @@ -758,7 +759,7 @@ EXPECT_EQ(kLongInterval, decorator->GetMinTimeBetweenRequestsPerProcess()); { - auto data = mojom::PerProcessV8MemoryUsageData::New(); + auto data = blink::mojom::PerProcessV8MemoryUsageData::New(); data->unassociated_bytes_used = 12U; ExpectQueryAndReply(&mock_reporter, std::move(data)); @@ -788,7 +789,7 @@ // and QueryAndDelayReply expectations. MockV8PerFrameMemoryReporter mock_reporter; { - auto data = mojom::PerProcessV8MemoryUsageData::New(); + auto data = blink::mojom::PerProcessV8MemoryUsageData::New(); data->unassociated_bytes_used = 0U; ExpectBindAndRespondToQuery(&mock_reporter, std::move(data)); } @@ -803,7 +804,7 @@ // update GetMinTimeBetweenRequestsPerProcess but not start a new // measurement until the existing measurement finishes. { - auto data = mojom::PerProcessV8MemoryUsageData::New(); + auto data = blink::mojom::PerProcessV8MemoryUsageData::New(); data->unassociated_bytes_used = 1U; ExpectQueryAndDelayReply(&mock_reporter, kMeasurementLength, std::move(data)); @@ -828,7 +829,7 @@ // Next measurement should start kMediumInterval secs after the START of the // last measurement. { - auto data = mojom::PerProcessV8MemoryUsageData::New(); + auto data = blink::mojom::PerProcessV8MemoryUsageData::New(); data->unassociated_bytes_used = 2U; ExpectQueryAndDelayReply(&mock_reporter, kMeasurementLength, std::move(data)); @@ -850,7 +851,7 @@ // Create a request that would be sent in the middle of a measurement. It // should start immediately after the measurement finishes. { - auto data = mojom::PerProcessV8MemoryUsageData::New(); + auto data = blink::mojom::PerProcessV8MemoryUsageData::New(); data->unassociated_bytes_used = 3U; ExpectQueryAndDelayReply(&mock_reporter, kMeasurementLength, std::move(data)); @@ -869,7 +870,7 @@ EXPECT_EQ(last_query_time_, measurement_start_time); { - auto data = mojom::PerProcessV8MemoryUsageData::New(); + auto data = blink::mojom::PerProcessV8MemoryUsageData::New(); data->unassociated_bytes_used = 4U; ExpectQueryAndDelayReply(&mock_reporter, kMeasurementLength, std::move(data)); @@ -896,7 +897,7 @@ // Delete the last request while a measurement is in process. The // measurement should finish successfully but no more should be sent. { - auto data = mojom::PerProcessV8MemoryUsageData::New(); + auto data = blink::mojom::PerProcessV8MemoryUsageData::New(); data->unassociated_bytes_used = 5U; ExpectQueryAndDelayReply(&mock_reporter, kMeasurementLength, std::move(data)); @@ -931,7 +932,7 @@ MockV8PerFrameMemoryReporter mock_reporter; { - auto data = mojom::PerProcessV8MemoryUsageData::New(); + auto data = blink::mojom::PerProcessV8MemoryUsageData::New(); data->unassociated_bytes_used = 1U; ExpectBindAndRespondToQuery(&mock_reporter, std::move(data)); } @@ -962,7 +963,7 @@ // measurement is available for it. MockV8PerFrameMemoryReporter reporter1; { - auto data = mojom::PerProcessV8MemoryUsageData::New(); + auto data = blink::mojom::PerProcessV8MemoryUsageData::New(); data->unassociated_bytes_used = 1U; ExpectBindAndRespondToQuery(&reporter1, std::move(data)); } @@ -984,12 +985,12 @@ // for process2 and the second measurement for process1 will arrive. MockV8PerFrameMemoryReporter reporter2; { - auto data = mojom::PerProcessV8MemoryUsageData::New(); + auto data = blink::mojom::PerProcessV8MemoryUsageData::New(); data->unassociated_bytes_used = 2U; ExpectBindAndRespondToQuery(&reporter2, std::move(data)); } { - auto data = mojom::PerProcessV8MemoryUsageData::New(); + auto data = blink::mojom::PerProcessV8MemoryUsageData::New(); data->unassociated_bytes_used = 3U; ExpectQueryAndReply(&reporter1, std::move(data)); } @@ -1012,12 +1013,12 @@ // Remove an observer and make sure the other is still notified after the // next measurement. { - auto data = mojom::PerProcessV8MemoryUsageData::New(); + auto data = blink::mojom::PerProcessV8MemoryUsageData::New(); data->unassociated_bytes_used = 4U; ExpectQueryAndReply(&reporter1, std::move(data)); } { - auto data = mojom::PerProcessV8MemoryUsageData::New(); + auto data = blink::mojom::PerProcessV8MemoryUsageData::New(); data->unassociated_bytes_used = 5U; ExpectQueryAndReply(&reporter2, std::move(data)); } @@ -1047,7 +1048,7 @@ // Create a process node and move past the initial request to it. MockV8PerFrameMemoryReporter reporter; { - auto data = mojom::PerProcessV8MemoryUsageData::New(); + auto data = blink::mojom::PerProcessV8MemoryUsageData::New(); data->unassociated_bytes_used = 1U; ExpectBindAndRespondToQuery(&reporter, std::move(data)); } @@ -1064,7 +1065,7 @@ // Start the next measurement. { - auto data = mojom::PerProcessV8MemoryUsageData::New(); + auto data = blink::mojom::PerProcessV8MemoryUsageData::New(); data->unassociated_bytes_used = 2U; ExpectQueryAndDelayReply(&reporter, kMinTimeBetweenRequests, std::move(data)); @@ -1148,7 +1149,7 @@ MockV8PerFrameMemoryReporter reporter; { - auto data = mojom::PerProcessV8MemoryUsageData::New(); + auto data = blink::mojom::PerProcessV8MemoryUsageData::New(); data->unassociated_bytes_used = kUnassociatedBytes; AddPerFrameIsolateMemoryUsage(frame_token, 0, kAssociatedBytes, data.get()); ExpectBindAndRespondToQuery(&reporter, std::move(data), process_id);
diff --git a/components/policy/resources/policy_templates.json b/components/policy/resources/policy_templates.json index 709f3b6..74746620 100644 --- a/components/policy/resources/policy_templates.json +++ b/components/policy/resources/policy_templates.json
@@ -4095,11 +4095,21 @@ 'id': 26, 'caption': '''Supported authentication schemes''', 'tags': [], - 'desc': '''Specifies which HTTP authentication schemes are supported by <ph name="PRODUCT_NAME">$1<ex>Google Chrome</ex></ph>. + 'desc': '''Setting the policy specifies which HTTP authentication schemes <ph name="PRODUCT_NAME">$1<ex>Google Chrome</ex></ph> supports. - Possible values are 'basic', 'digest', 'ntlm' and 'negotiate'. Separate multiple values with commas. + Leaving the policy unset employs all 4 schemes. - If this policy is left not set, all four schemes will be used.''', + Valid values: + + * basic + + * digest + + * ntlm + + * negotiate + + Note: Separate multiple values with commas.''', }, { 'name': 'DisableAuthNegotiateCnameLookup', @@ -4115,11 +4125,9 @@ 'id': 27, 'caption': '''Disable CNAME lookup when negotiating Kerberos authentication''', 'tags': [], - 'desc': '''Specifies whether the generated Kerberos SPN is based on the canonical DNS name or the original name entered. + 'desc': '''Setting the policy to Enabled skips CNAME lookup. The server name is used as entered when generating the Kerberos SPN. - If you enable this setting, CNAME lookup will be skipped and the server name will be used as entered. - - If you disable this setting or leave it not set, the canonical name of the server will be determined via CNAME lookup.''', + Setting the policy to Disabled or leaving it unset means CNAME lookup determines the canonical name of the server when generating the Kerberos SPN.''', }, { 'name': 'EnableAuthNegotiatePort', @@ -4135,11 +4143,9 @@ 'id': 28, 'caption': '''Include non-standard port in Kerberos SPN''', 'tags': [], - 'desc': '''Specifies whether the generated Kerberos SPN should include a non-standard port. + 'desc': '''Setting the policy to Enabled and entering a nonstandard port (in other words, a port other than 80 or 443) includes it in the generated Kerberos SPN. - If you enable this setting, and a non-standard port (i.e., a port other than 80 or 443) is entered, it will be included in the generated Kerberos SPN. - - If you disable this setting or leave it not set, the generated Kerberos SPN will not include a port in any case.''', + Setting the policy to Disabled or leaving it unset means the generated Kerberos SPN won't include a port.''', }, { 'name': 'AuthServerWhitelist', @@ -4158,11 +4164,11 @@ 'tags': [], 'desc': '''This policy is deprecated, please use the '<ph name="AUTH_SERVER_ALLOWLIST_POLICY_NAME">AuthServerAllowlist</ph>' policy instead. - Specifies which servers should be allowed for integrated authentication. Integrated authentication is only enabled when <ph name="PRODUCT_NAME">$1<ex>Google Chrome</ex></ph> receives an authentication challenge from a proxy or from a server which is in this permitted list. + Setting the policy specifies which servers should be allowed for integrated authentication. Integrated authentication is only on when <ph name="PRODUCT_NAME">$1<ex>Google Chrome</ex></ph> gets an authentication challenge from a proxy or from a server in this permitted list. - Separate multiple server names with commas. Wildcards (*) are allowed. + Leaving the policy unset means <ph name="PRODUCT_NAME">$1<ex>Google Chrome</ex></ph> tries to detect if a server is on the intranet. Only then will it respond to IWA requests. If a server is detected as internet, then <ph name="PRODUCT_NAME">$1<ex>Google Chrome</ex></ph> ignores IWA requests from it. - If you leave this policy not set <ph name="PRODUCT_NAME">$1<ex>Google Chrome</ex></ph> will try to detect if a server is on the Intranet and only then will it respond to IWA requests. If a server is detected as Internet then IWA requests from it will be ignored by <ph name="PRODUCT_NAME">$1<ex>Google Chrome</ex></ph>.''', + Note: Separate multiple server names with commas. Wildcards, <ph name="WILDCARD_VALUE">*</ph>, are allowed.''', }, { 'name': 'AuthServerAllowlist', @@ -4178,11 +4184,11 @@ 'id': 747, 'caption': '''Authentication server allowlist''', 'tags': [], - 'desc': '''Specifies which servers should be allowed for integrated authentication. Integrated authentication is only enabled when <ph name="PRODUCT_NAME">$1<ex>Google Chrome</ex></ph> receives an authentication challenge from a proxy or from a server which is in this permitted list. + 'desc': '''Setting the policy specifies which servers should be allowed for integrated authentication. Integrated authentication is only on when <ph name="PRODUCT_NAME">$1<ex>Google Chrome</ex></ph> gets an authentication challenge from a proxy or from a server in this permitted list. - Separate multiple server names with commas. Wildcards (*) are allowed. + Leaving the policy unset means <ph name="PRODUCT_NAME">$1<ex>Google Chrome</ex></ph> tries to detect if a server is on the intranet. Only then will it respond to IWA requests. If a server is detected as internet, then <ph name="PRODUCT_NAME">$1<ex>Google Chrome</ex></ph> ignores IWA requests from it. - If you leave this policy not set <ph name="PRODUCT_NAME">$1<ex>Google Chrome</ex></ph> will try to detect if a server is on the Intranet and only then will it respond to IWA requests. If a server is detected as Internet then IWA requests from it will be ignored by <ph name="PRODUCT_NAME">$1<ex>Google Chrome</ex></ph>.''', + Note: Separate multiple server names with commas. Wildcards, <ph name="WILDCARD_VALUE">*</ph>, are allowed.''', }, { 'name': 'AuthNegotiateDelegateWhitelist', @@ -4201,11 +4207,9 @@ 'tags': [], 'desc': '''This policy is deprecated, please use the '<ph name="AUTH_NEGOCIATE_DELEGATE_ALLOWLIST_POLICY_NAME">AuthNegotiateDelegateAllowlist</ph>' policy instead. - Servers that <ph name="PRODUCT_NAME">$1<ex>Google Chrome</ex></ph> may delegate to. + Setting the policy assigns servers that <ph name="PRODUCT_NAME">$1<ex>Google Chrome</ex></ph> may delegate to. Separate multiple server names with commas. Wildcards, <ph name="WILDCARD_VALUE">*</ph>, are allowed. - Separate multiple server names with commas. Wildcards (*) are allowed. - - If you leave this policy not set <ph name="PRODUCT_NAME">$1<ex>Google Chrome</ex></ph> will not delegate user credentials even if a server is detected as Intranet.''', + Leaving the policy unset means <ph name="PRODUCT_NAME">$1<ex>Google Chrome</ex></ph> won't delegate user credentials, even if a server is detected as intranet.''', }, { 'name': 'AuthNegotiateDelegateAllowlist', @@ -4221,11 +4225,9 @@ 'id': 746, 'caption': '''Kerberos delegation server allowlist''', 'tags': [], - 'desc': '''Servers that <ph name="PRODUCT_NAME">$1<ex>Google Chrome</ex></ph> may delegate to. + 'desc': '''Setting the policy assigns servers that <ph name="PRODUCT_NAME">$1<ex>Google Chrome</ex></ph> may delegate to. Separate multiple server names with commas. Wildcards, <ph name="WILDCARD_VALUE">*</ph>, are allowed. - Separate multiple server names with commas. Wildcards (*) are allowed. - - If you leave this policy not set <ph name="PRODUCT_NAME">$1<ex>Google Chrome</ex></ph> will not delegate user credentials even if a server is detected as Intranet.''', + Leaving the policy unset means <ph name="PRODUCT_NAME">$1<ex>Google Chrome</ex></ph> won't delegate user credentials, even if a server is detected as intranet.''', }, { 'name': 'AuthNegotiateDelegateByKdcPolicy', @@ -4241,13 +4243,11 @@ 'id': 528, 'caption': '''Use KDC policy to delegate credentials.''', 'tags': ['website-sharing'], - 'desc': '''Controls whether approval by KDC policy is respected to decide whether to delegate <ph name="KERBEROS">Kerberos</ph> tickets. + 'desc': '''Setting the policy to Enabled means HTTP authentication respects approval by KDC policy. In other words, <ph name="PRODUCT_NAME">$1<ex>Google Chrome</ex></ph> delegates credentials if the KDC sets <ph name="OK_AS_DELEGATE">OK-AS-DELEGATE</ph> on a service ticket. See RFC 5896 ( https://tools.ietf.org/html/rfc5896.html ). Service should match <ph name="AUTH_NEGOTIATE_DELEGATE_ALLOWLIST_POLICY_NAME">AuthNegotiateDelegateAllowlist</ph>. - If this policy is true, HTTP authentication respects approval by KDC policy, i.e. Chrome only delegates credentials if the KDC sets <ph name="OK_AS_DELEGATE">OK-AS-DELEGATE</ph> on a service ticket. Please see https://tools.ietf.org/html/rfc5896.html for more information. Service should also match 'AuthNegotiateDelegateAllowlist' policy. + Setting the policy to Disabled or leaving it unset means KDC policy is ignored on supported platforms and only <ph name="AUTH_NEGOTIATE_DELEGATE_ALLOWLIST_POLICY_NAME">AuthNegotiateDelegateAllowlist</ph> is respected. - If this policy is not set or set to false, KDC policy is ignored on supported platforms and 'AuthNegotiateDelegateAllowlist' policy only is respected. - - On Windows KDC policy is always respected.''', + On <ph name="MS_WIN_NAME">Microsoft® Windows®</ph>, KDC policy is always respected.''', }, { 'name': 'GSSAPILibraryName', @@ -4263,9 +4263,9 @@ 'id': 31, 'caption': '''GSSAPI library name''', 'tags': [], - 'desc': '''Specifies which GSSAPI library to use for HTTP authentication. You can set either just a library name, or a full path. + 'desc': '''Setting the policy specifies which GSSAPI library to use for HTTP authentication. Set the policy to either a library name or a full path. - If no setting is provided, <ph name="PRODUCT_NAME">$1<ex>Google Chrome</ex></ph> will fall back to using a default library name.''', + Leaving the policy unset means <ph name="PRODUCT_NAME">$1<ex>Google Chrome</ex></ph> uses a default library name.''', }, { 'name': 'AuthAndroidNegotiateAccountType', @@ -4281,9 +4281,9 @@ 'id': 305, 'caption': '''Account type for <ph name="HTTP_NEGOTIATE">HTTP Negotiate</ph> authentication''', 'tags': [], - 'desc': '''Specifies the account type of the accounts provided by the Android authentication app that supports <ph name="HTTP_NEGOTIATE">HTTP Negotiate</ph> authentication (e.g. Kerberos authentication). This information should be available from the supplier of the authentication app. For more details see https://goo.gl/hajyfN. + 'desc': '''Setting the policy specifies the type of accounts provided by the Android authentication app that supports <ph name="HTTP_NEGOTIATE">HTTP Negotiate</ph> authentication (such as Kerberos authentication). This information should be available from the supplier of the authentication app. For details, see The Chromium Projects ( https://goo.gl/hajyfN ) - If no setting is provided, <ph name="HTTP_NEGOTIATE">HTTP Negotiate</ph> authentication is disabled on Android.''', + Leaving the policy unset turns off <ph name="HTTP_NEGOTIATE">HTTP Negotiate</ph> authentication on Android.''', }, { 'name': 'AllowCrossOriginAuthPrompt', @@ -4299,9 +4299,11 @@ 'id': 89, 'caption': '''Cross-origin HTTP Basic Auth prompts''', 'tags': ['website-sharing'], - 'desc': '''Controls whether third-party sub-content on a page is allowed to pop-up an HTTP Basic Auth dialog box. + 'desc': '''Setting the policy to Enabled allows third-party subcontent on a page to open an HTTP Basic Auth pop-up. - Typically this is disabled as a phishing defense. If this policy is not set, this is disabled and third-party sub-content will not be allowed to pop up a HTTP Basic Auth dialog box.''', + Setting the policy to Disabled or leaving it unset renders third-party subcontent unable to open an HTTP Basic Auth pop-up. + + Typically, this policy is Disabled as a phishing defense.''', }, { 'name': 'NtlmV2Enabled', @@ -4317,11 +4319,11 @@ 'id': 393, 'caption': '''Enable NTLMv2 authentication.''', 'tags': ['website-sharing'], - 'desc': '''Controls whether NTLMv2 is enabled. + 'desc': '''Setting the policy to Enabled or leaving it unset turns NTLMv2 on. - All recent versions of Samba and Windows servers support NTLMv2. This should only be disabled for backwards compatibility and reduces the security of authentication. + Setting the policy to Disabled turns NTLMv2 off. - If this policy is not set, the default is true and NTLMv2 is enabled.''', + All recent versions of Samba and <ph name="MS_WIN_NAME">Microsoft® Windows®</ph> servers support NTLMv2. This should only be turned off for backward compatibility as it reduces the security of authentication.''', }, { 'name': 'ExtensionInstallBlacklist', @@ -9615,9 +9617,9 @@ 'id': 163, 'caption': '''Device-local accounts''', 'tags': [], - 'desc': '''Specifies the list of device-local accounts to be shown on the login screen. + 'desc': '''Setting the policy specifies the list of device-local accounts to display on the sign-in screen. Identifiers tell the different device-local accounts apart. - Every list entry specifies an identifier, which is used internally to tell the different device-local accounts apart.''', + If the policy is unset or an empty list, there are no device-local accounts.''', }, { 'name': 'DeviceLocalAccountAutoLoginId', @@ -9634,11 +9636,9 @@ 'id': 194, 'caption': '''Device-local account for auto-login''', 'tags': [], - 'desc': '''A device-local account to auto-login after a delay. + 'desc': '''Setting the policy means the specified session is automatically signed if there is no user interaction at the sign-in screen within the time specified in <ph name="DEVICE_LOCAL_ACCOUNT_AUTO_LOGIN_DELAY_POLICY_NAME">DeviceLocalAccountAutoLoginDelay</ph>. The device-local account must already be set up (see <ph name="DEVICE_LOCAL_ACCOUNTS_POLICY_NAME">DeviceLocalAccounts</ph>). - If this policy is set, the specified session will be automatically logged in after a period of time has elapsed at the login screen without user interaction. The device-local account must already be configured (see |DeviceLocalAccounts|). - - If this policy is unset, there will be no auto-login.''', + Leaving it unset means there's no automatic sign-in.''', }, { 'name': 'DeviceLocalAccountAutoLoginDelay', @@ -9655,15 +9655,11 @@ 'id': 195, 'caption': '''Device-local account auto-login timer''', 'tags': [], - 'desc': '''The device-local account auto-login delay. + 'desc': '''Setting the policy determines the amount of time in milliseconds without user activity before automatically signing in to the device-local account specified by the <ph name="DEVICE_LOCAL_ACCOUNT_AUTO_LOGIN_ID_POLICY_NAME">DeviceLocalAccountAutoLoginId</ph> policy. - If the |DeviceLocalAccountAutoLoginId| policy is unset, this policy has no effect. Otherwise: + Leaving it unset means 0 milliseconds is used as the timeout. - If this policy is set, it determines the amount of time without user activity that should elapse before automatically logging into the device-local account specified by the |DeviceLocalAccountAutoLoginId| policy. - - If this policy is unset, 0 milliseconds will be used as the timeout. - - This policy is specified in milliseconds.''' + If the <ph name="DEVICE_LOCAL_ACCOUNT_AUTO_LOGIN_ID_POLICY_NAME">DeviceLocalAccountAutoLoginId</ph> policy is unset, this policy has no effect.''' }, { 'name': 'DeviceLocalAccountAutoLoginBailoutEnabled', @@ -9680,11 +9676,9 @@ 'id': 202, 'caption': '''Enable bailout keyboard shortcut for auto-login''', 'tags': [], - 'desc': '''Enable bailout keyboard shortcut for auto-login. + 'desc': '''Setting the policy to Enabled or leaving it unset means a device-local account is set up for zero-delay, automatic sign-in. <ph name="PRODUCT_OS_NAME">$2<ex>Google Chrome OS</ex></ph> honors the keyboard shortcut Ctrl+Alt+S for bypassing automatic sign-in and showing the sign-in screen. - If this policy is unset or set to True and a device-local account is configured for zero-delay auto-login, <ph name="PRODUCT_OS_NAME">$2<ex>Google Chrome OS</ex></ph> will honor the keyboard shortcut Ctrl+Alt+S for bypassing auto-login and showing the login screen. - - If this policy is set to False, zero-delay auto-login (if configured) cannot be bypassed.''' + Setting the policy to Disabled means users can't bypass zero-delay automatic sign-in (if configured).''' }, { 'name': 'DeviceLocalAccountPromptForNetworkWhenOffline', @@ -9701,11 +9695,9 @@ 'id': 250, 'caption': '''Enable network configuration prompt when offline''', 'tags': [], - 'desc': '''Enable network configuration prompt when offline. + 'desc': '''Setting the policy to Enabled or leaving it unset means when a device is offline, if a device-local account is set for zero-delay, automatic sign-in, <ph name="PRODUCT_OS_NAME">$2<ex>Google Chrome OS</ex></ph> shows a network-configuration prompt. - If this policy is unset or set to True and a device-local account is configured for zero-delay auto-login and the device does not have access to the Internet, <ph name="PRODUCT_OS_NAME">$2<ex>Google Chrome OS</ex></ph> will show a network configuration prompt. - - If this policy is set to False, an error message will be displayed instead of the network configuration prompt.''' + Setting the policy to Disabled has an error message displayed instead.''' }, { 'name': 'DeviceLocalAccountManagedSessionEnabled', @@ -13999,15 +13991,11 @@ 'id': 319, 'caption': '''Allow the auto launched with zero delay kiosk app to control <ph name="PRODUCT_OS_NAME">$2<ex>Google Chrome OS</ex></ph> version''', 'tags': ['system-security'], - 'desc': '''Whether to allow the auto launched with zero delay kiosk app to control <ph name="PRODUCT_OS_NAME">$2<ex>Google Chrome OS</ex></ph> version. + 'desc': '''Setting the policy to Enabled means the value of the <ph name="REQUIRED_PLATFORM_VERSION">required_platform_version</ph> manifest key of the zero-delay, autolaunched kiosk app is used as the autoupdate target version prefix. - This policy controls whether to allow the auto launched with zero delay kiosk app to control <ph name="PRODUCT_OS_NAME">$2<ex>Google Chrome OS</ex></ph> version by declaring a required_platform_version in its manifest and use it as the auto update target version prefix. + Setting the policy to Disabled or leaving it unset means the <ph name="REQUIRED_PLATFORM_VERSION">required_platform_version</ph> manifest key is ignored and autoupdate proceeds as normal. - If the policy is set to true, the value of required_platform_version manifest key of the auto launched with zero delay kiosk app is used as auto update target version prefix. - - If the policy is not configured or set to false, the required_platform_version manifest key is ignored and auto update proceeds as normal. - - Warning: It is not recommended to delegate control of the <ph name="PRODUCT_OS_NAME">$2<ex>Google Chrome OS</ex></ph> version to a kiosk app as it may prevent the device from receiving software updates and critical security fixes. Delegating control of the <ph name="PRODUCT_OS_NAME">$2<ex>Google Chrome OS</ex></ph> version might leave users at risk.''', + Warning: Do not delegate control of the <ph name="PRODUCT_OS_NAME">$2<ex>Google Chrome OS</ex></ph> version to a kiosk app, because it might prevent the device from getting software updates and critical security fixes. Delegating control of the <ph name="PRODUCT_OS_NAME">$2<ex>Google Chrome OS</ex></ph> version might leave users at risk.''', 'arc_support': 'If the kiosk app is an Android app, it will have no control over the <ph name="PRODUCT_OS_NAME">$2<ex>Google Chrome OS</ex></ph> version, even if this policy is set to <ph name="TRUE">True</ph>.', }, { @@ -16106,6 +16094,7 @@ 'type': 'main', 'schema': { 'type': 'boolean'}, 'supported_on': ['chrome.*:75-'], + 'future_on': ['ios'], 'features': { 'dynamic_refresh': False, 'per_profile': False,
diff --git a/components/safe_browsing/core/common/safe_browsing_prefs.cc b/components/safe_browsing/core/common/safe_browsing_prefs.cc index e0b3f47..d73acc34 100644 --- a/components/safe_browsing/core/common/safe_browsing_prefs.cc +++ b/components/safe_browsing/core/common/safe_browsing_prefs.cc
@@ -185,6 +185,11 @@ return prefs.IsManagedPreference(prefs::kSafeBrowsingScoutReportingEnabled); } +bool IsSafeBrowsingPolicyManaged(const PrefService& prefs) { + return prefs.IsManagedPreference(prefs::kSafeBrowsingEnabled) || + prefs.IsManagedPreference(prefs::kSafeBrowsingEnhanced); +} + void RecordExtendedReportingMetrics(const PrefService& prefs) { // This metric tracks the extended browsing opt-in based on whichever setting // the user is currently seeing. It tells us whether extended reporting is
diff --git a/components/safe_browsing/core/common/safe_browsing_prefs.h b/components/safe_browsing/core/common/safe_browsing_prefs.h index ba20f9ca..9482089 100644 --- a/components/safe_browsing/core/common/safe_browsing_prefs.h +++ b/components/safe_browsing/core/common/safe_browsing_prefs.h
@@ -291,6 +291,11 @@ // enterprise policy, meaning the user can't change it. bool IsExtendedReportingPolicyManaged(const PrefService& prefs); +// Return whether the Safe Browsing preference is managed. It can be managed by +// either the SafeBrowsingEnabled policy(legacy) or the +// SafeBrowsingProtectionLevel policy(new). +bool IsSafeBrowsingPolicyManaged(const PrefService& prefs); + // Updates UMA metrics about Safe Browsing Extended Reporting states. void RecordExtendedReportingMetrics(const PrefService& prefs);
diff --git a/components/signin/ios/browser/account_consistency_service.h b/components/signin/ios/browser/account_consistency_service.h index 3d53f0a..d19a44a 100644 --- a/components/signin/ios/browser/account_consistency_service.h +++ b/components/signin/ios/browser/account_consistency_service.h
@@ -19,6 +19,7 @@ #include "components/signin/ios/browser/active_state_manager.h" #import "components/signin/ios/browser/manage_accounts_delegate.h" #import "components/signin/public/identity_manager/identity_manager.h" +#include "net/cookies/cookie_access_result.h" namespace content_settings { class CookieSettings; @@ -33,18 +34,18 @@ class AccountReconcilor; class PrefService; -@class AccountConsistencyNavigationDelegate; -@class WKWebView; - // Handles actions necessary for Account Consistency to work on iOS. This // includes setting the Account Consistency cookie (informing Gaia that the // Account Consistency is on). -// -// This is currently only used when WKWebView is enabled. class AccountConsistencyService : public KeyedService, public signin::IdentityManager::Observer, public ActiveStateManager::Observer { public: + // Name of the cookie that is managed by AccountConsistencyService and is used + // to inform Google web properties that the browser is connected and that + // Google authentication cookies are managed by |AccountReconcilor|). + static const char kChromeConnectedCookieName[]; + // Name of the preference property that persists the domains that have a // CHROME_CONNECTED cookie set by this service. static const char kDomainsWithCookiePref[]; @@ -125,17 +126,11 @@ // Applies the pending CHROME_CONNECTED cookie requests one by one. void ApplyCookieRequests(); + void FinishedSetCookie(net::CookieAccessResult cookie_access_result); + // Called when the current CHROME_CONNECTED cookie request is done. void FinishedApplyingCookieRequest(bool success); - // Returns the cached WKWebView if it exists, or creates one if necessary. - // Can return nil if the browser state is not active. - WKWebView* GetWKWebView(); - // Actually creates a WKWebView. Virtual for testing. - virtual WKWebView* BuildWKWebView(); - // Stops any page loading in the WKWebView currently in use and releases it. - void ResetWKWebView(); - // Returns whether the CHROME_CONNECTED cookie should be added to |domain|. // If the cookie is already on |domain|, this function will return false // unless |force_update_if_too_old| is true. In this case, it will return true @@ -156,9 +151,8 @@ // ActiveStateManager::Observer implementation. void OnActive() override; - void OnInactive() override; - // Browser state associated with the service, used to create WKWebViews. + // Browser state associated with the service. web::BrowserState* browser_state_; // Used to update kDomainsWithCookiePref. PrefService* prefs_; @@ -180,12 +174,6 @@ // the time when the cookie was last updated. std::map<std::string, base::Time> last_cookie_update_map_; - // Web view used to apply the CHROME_CONNECTED cookie requests. - __strong WKWebView* web_view_; - // Navigation delegate of |web_view_| that informs the service when a cookie - // request has been applied. - AccountConsistencyNavigationDelegate* navigation_delegate_; - // Handlers reacting on GAIA responses with the X-Chrome-Manage-Accounts // header set. std::map<web::WebState*, std::unique_ptr<web::WebStatePolicyDecider>>
diff --git a/components/signin/ios/browser/account_consistency_service.mm b/components/signin/ios/browser/account_consistency_service.mm index 53195c1..b6ce342 100644 --- a/components/signin/ios/browser/account_consistency_service.mm +++ b/components/signin/ios/browser/account_consistency_service.mm
@@ -37,17 +37,6 @@ // should be added again on a domain it was previously set. const int kHoursThresholdToReAddCookie = 24; -// JavaScript template used to set (or delete) the CHROME_CONNECTED cookie. -// It takes 3 arguments: the domain of the cookie, its value and its expiration -// date. It also clears the legacy X-CHROME-CONNECTED cookie. -NSString* const kChromeConnectedCookieTemplate = - @"<html><script>domain=\"%@\";" - "document.cookie=\"X-CHROME-CONNECTED=; path=/; domain=\" + domain + \";" - " expires=Thu, 01-Jan-1970 00:00:01 GMT\";" - "document.cookie=\"CHROME_CONNECTED=%@; path=/; domain=\" + domain + \";" - " expires=\" + new Date(%f).toGMTString() + \"; secure;" - " samesite=lax;\"</script></html>"; - // WebStatePolicyDecider that monitors the HTTP headers on Gaia responses, // reacting on the X-Chrome-Manage-Accounts header and notifying its delegate. // It also notifies the AccountConsistencyService of domains it should add the @@ -158,45 +147,8 @@ account_consistency_service_->RemoveWebStateHandler(web_state()); } -// WKWebView navigation delegate that calls its callback every time a navigation -// has finished. -@interface AccountConsistencyNavigationDelegate : NSObject<WKNavigationDelegate> - -// Designated initializer. |callback| will be called every time a navigation has -// finished. |callback| must not be empty. -- (instancetype)initWithCallback:(const base::RepeatingClosure&)callback - NS_DESIGNATED_INITIALIZER; - -- (instancetype)init NS_UNAVAILABLE; -@end - -@implementation AccountConsistencyNavigationDelegate { - // Callback that will be called every time a navigation has finished. - base::RepeatingClosure _callback; -} - -- (instancetype)initWithCallback:(const base::RepeatingClosure&)callback { - self = [super init]; - if (self) { - DCHECK(!callback.is_null()); - _callback = callback; - } - return self; -} - -- (instancetype)init { - NOTREACHED(); - return nil; -} - -#pragma mark - WKNavigationDelegate - -- (void)webView:(WKWebView*)webView - didFinishNavigation:(WKNavigation*)navigation { - _callback.Run(); -} - -@end +const char AccountConsistencyService::kChromeConnectedCookieName[] = + "CHROME_CONNECTED"; const char AccountConsistencyService::kDomainsWithCookiePref[] = "signin.domains_with_cookie"; @@ -251,8 +203,6 @@ } AccountConsistencyService::~AccountConsistencyService() { - DCHECK(!web_view_); - DCHECK(!navigation_delegate_); } // static @@ -344,7 +294,6 @@ void AccountConsistencyService::Shutdown() { identity_manager_->RemoveObserver(this); ActiveStateManager::FromBrowserState(browser_state_)->RemoveObserver(this); - ResetWKWebView(); web_state_handlers_.clear(); } @@ -365,10 +314,8 @@ applying_cookie_requests_ = true; const GURL url("https://" + cookie_requests_.front().domain); - std::string cookie_value = ""; - // Expiration date of the cookie in the JavaScript convention of time, a - // number of milliseconds since the epoch. - double expiration_date = 0; + std::string cookie_value; + base::Time expiration_date; switch (cookie_requests_.front().request_type) { case ADD_CHROME_CONNECTED_COOKIE: cookie_value = signin::BuildMirrorRequestCookieIfPossible( @@ -382,22 +329,43 @@ return; } // Create expiration date of Now+2y to roughly follow the SAPISID cookie. - expiration_date = - (base::Time::Now() + base::TimeDelta::FromDays(730)).ToJsTime(); + expiration_date = base::Time::Now() + base::TimeDelta::FromDays(730); break; case REMOVE_CHROME_CONNECTED_COOKIE: - // Nothing to do. Default values correspond to removing the cookie (no - // value, expiration date in the past). + // Default values correspond to removing the cookie (no value, expiration + // date in the past). + expiration_date = base::Time::UnixEpoch(); break; } - NSString* html = [NSString - stringWithFormat:kChromeConnectedCookieTemplate, - base::SysUTF8ToNSString(url.host()), - base::SysUTF8ToNSString(cookie_value), expiration_date]; - // Load an HTML string with embedded JavaScript that will set or remove the - // cookie. By setting the base URL to |url|, this effectively allows to modify - // cookies on the correct domain without having to do a network request. - [GetWKWebView() loadHTMLString:html baseURL:net::NSURLWithGURL(url)]; + + std::unique_ptr<net::CanonicalCookie> cookie = + net::CanonicalCookie::CreateSanitizedCookie( + url, + /*name=*/kChromeConnectedCookieName, cookie_value, + /*domain=*/url.host(), + /*path=*/std::string(), + /*creation_time=*/base::Time::Now(), expiration_date, + /*last_access_time=*/base::Time(), + /*secure=*/true, + /*httponly=*/false, net::CookieSameSite::LAX_MODE, + net::COOKIE_PRIORITY_DEFAULT); + net::CookieOptions options; + options.set_include_httponly(); + options.set_same_site_cookie_context( + net::CookieOptions::SameSiteCookieContext::MakeInclusive()); + + network::mojom::CookieManager* cookie_manager = + browser_state_->GetCookieManager(); + cookie_manager->SetCanonicalCookie( + *cookie, url, options, + base::BindOnce(&AccountConsistencyService::FinishedSetCookie, + base::Unretained(this))); +} + +void AccountConsistencyService::FinishedSetCookie( + net::CookieAccessResult cookie_access_result) { + DCHECK(cookie_access_result.status.IsInclude()); + FinishedApplyingCookieRequest(true); } void AccountConsistencyService::FinishedApplyingCookieRequest(bool success) { @@ -427,35 +395,6 @@ } } -WKWebView* AccountConsistencyService::GetWKWebView() { - if (!ActiveStateManager::FromBrowserState(browser_state_)->IsActive()) { - // |browser_state_| is not active, WKWebView linked to this browser state - // should not exist or be created. - return nil; - } - if (!web_view_) { - web_view_ = BuildWKWebView(); - navigation_delegate_ = [[AccountConsistencyNavigationDelegate alloc] - initWithCallback:base::BindRepeating(&AccountConsistencyService:: - FinishedApplyingCookieRequest, - base::Unretained(this), true)]; - [web_view_ setNavigationDelegate:navigation_delegate_]; - } - return web_view_; -} - -WKWebView* AccountConsistencyService::BuildWKWebView() { - return web::BuildWKWebView(CGRectZero, browser_state_); -} - -void AccountConsistencyService::ResetWKWebView() { - [web_view_ setNavigationDelegate:nil]; - [web_view_ stopLoading]; - web_view_ = nil; - navigation_delegate_ = nil; - applying_cookie_requests_ = false; -} - void AccountConsistencyService::AddChromeConnectedCookies() { DCHECK(!browser_state_->IsOffTheRecord()); // These cookie request are preventive and not a strong signal (unlike @@ -469,7 +408,6 @@ void AccountConsistencyService::OnBrowsingDataRemoved() { // CHROME_CONNECTED cookies have been removed, update internal state // accordingly. - ResetWKWebView(); for (auto& cookie_request : cookie_requests_) { base::OnceClosure callback(std::move(cookie_request.callback)); if (!callback.is_null()) { @@ -510,9 +448,3 @@ // to apply. ApplyCookieRequests(); } - -void AccountConsistencyService::OnInactive() { - // |browser_state_| is now inactive. Stop using |web_view_| and don't create - // a new one until it is active. - ResetWKWebView(); -}
diff --git a/components/signin/ios/browser/account_consistency_service_unittest.mm b/components/signin/ios/browser/account_consistency_service_unittest.mm index 97f244a..a054686 100644 --- a/components/signin/ios/browser/account_consistency_service_unittest.mm +++ b/components/signin/ios/browser/account_consistency_service_unittest.mm
@@ -10,6 +10,8 @@ #include "base/bind.h" #include "base/bind_helpers.h" +#include "base/test/bind_test_util.h" +#import "base/test/ios/wait_util.h" #include "base/values.h" #include "components/content_settings/core/browser/cookie_settings.h" #include "components/content_settings/core/browser/host_content_settings_map.h" @@ -49,6 +51,25 @@ const char* kGoogleDomain = "google.com"; // Youtube domain. const char* kYoutubeDomain = "youtube.com"; +// Google domain where the CHROME_CONNECTED cookie is set/removed. +const char* kCountryGoogleDomain = "google.de"; + +// Returns true if |cookies| contains a cookie with |name| and |domain|. +// +// Note: If |domain| is the empty string, then it returns true if any cookie +// with |name| is found. +bool ContainsCookie(const std::vector<net::CanonicalCookie>& cookies, + const std::string& name, + const std::string& domain) { + for (const auto& cookie : cookies) { + if (cookie.Name() == + AccountConsistencyService::kChromeConnectedCookieName) { + if (domain.empty() || cookie.Domain() == domain) + return true; + } + } + return false; +} // AccountConsistencyService specialization that fakes the creation of the // WKWebView in order to mock it. This allows tests to intercept the calls to @@ -67,14 +88,6 @@ cookie_settings, identity_manager) {} - private: - WKWebView* BuildWKWebView() override { - if (!mock_web_view_) { - mock_web_view_ = [OCMockObject niceMockForClass:[WKWebView class]]; - } - return mock_web_view_; - } - id mock_web_view_; }; // Mock AccountReconcilor to catch call to OnReceivedManageAccountsResponse. @@ -130,7 +143,6 @@ public: void OnRemoveChromeConnectedCookieFinished() { EXPECT_FALSE(remove_cookie_callback_called_); - EXPECT_EQ(0, web_view_load_expection_count_); remove_cookie_callback_called_ = true; } @@ -142,7 +154,6 @@ content_settings::CookieSettings::RegisterProfilePrefs(prefs_.registry()); HostContentSettingsMap::RegisterProfilePrefs(prefs_.registry()); - web_view_load_expection_count_ = 0; signin_client_.reset( new TestSigninClient(&prefs_, &test_url_loader_factory_)); identity_test_env_.reset(new signin::IdentityTestEnvironment( @@ -160,8 +171,6 @@ } void TearDown() override { - EXPECT_EQ(0, web_view_load_expection_count_); - EXPECT_OCMOCK_VERIFY(GetMockWKWebView()); account_consistency_service_->Shutdown(); settings_map_->ShutdownOnUIThread(); ActiveStateManager::FromBrowserState(&browser_state_)->SetActive(false); @@ -169,25 +178,6 @@ PlatformTest::TearDown(); } - // Adds an expectation for |url| to be loaded in the web view of - // |account_consistency_service_|. - // |continue_navigation| controls whether navigation will continue or be - // stopped on page load. - void AddPageLoadedExpectation(NSURL* url, bool continue_navigation) { - ++web_view_load_expection_count_; - void (^continueBlock)(NSInvocation*) = ^(NSInvocation* invocation) { - --web_view_load_expection_count_; - if (!continue_navigation) - return; - __unsafe_unretained WKWebView* web_view = nil; - [invocation getArgument:&web_view atIndex:0]; - [GetNavigationDelegate() webView:web_view didFinishNavigation:nil]; - }; - [static_cast<WKWebView*>([[GetMockWKWebView() expect] andDo:continueBlock]) - loadHTMLString:[OCMArg any] - baseURL:url]; - } - void ResetAccountConsistencyService() { if (account_consistency_service_) { account_consistency_service_->Shutdown(); @@ -197,28 +187,26 @@ identity_test_env_->identity_manager())); } + void WaitUntilAllCookieRequestsAreApplied() { + // Spinning the runloop is needed to ensure that the cookie manager requests + // are executed. + base::RunLoop().RunUntilIdle(); + + if (ActiveStateManager::FromBrowserState(&browser_state_)->IsActive()) + EXPECT_TRUE(account_consistency_service_->cookie_requests_.empty()); + } + void SignIn() { signin::MakePrimaryAccountAvailable(identity_test_env_->identity_manager(), "user@gmail.com"); - EXPECT_EQ(0, web_view_load_expection_count_); + WaitUntilAllCookieRequestsAreApplied(); } void SignOutAndSimulateGaiaCookieManagerServiceLogout() { signin::ClearPrimaryAccount(identity_test_env_->identity_manager(), signin::ClearPrimaryAccountPolicy::DEFAULT); - SimulateGaiaCookieManagerServiceLogout(true); - } - - id GetWKWebView() { return account_consistency_service_->GetWKWebView(); } - - id GetMockWKWebView() { - // Should use BuildWKWebView() to always have the mock instance, even when - // the |account_consistency_service_| is inactive. - return account_consistency_service_->BuildWKWebView(); - } - - id GetNavigationDelegate() { - return account_consistency_service_->navigation_delegate_; + SimulateGaiaCookieManagerServiceLogout(); + WaitUntilAllCookieRequestsAreApplied(); } bool ShouldAddCookieToDomain(const std::string& domain, @@ -227,21 +215,53 @@ domain, should_check_last_update_time); } - void CheckDomainHasCookie(const std::string& domain) { + std::vector<net::CanonicalCookie> GetCookiesInCookieJar() { + std::vector<net::CanonicalCookie> cookies_out; + base::RunLoop run_loop; + network::mojom::CookieManager* cookie_manager = + browser_state_.GetCookieManager(); + cookie_manager->GetAllCookies(base::BindOnce(base::BindLambdaForTesting( + [&run_loop, + &cookies_out](const std::vector<net::CanonicalCookie>& cookies) { + cookies_out = cookies; + run_loop.Quit(); + }))); + run_loop.Run(); + + return cookies_out; + } + + void CheckDomainHasChromeConnectedCookie(const std::string& domain) { + EXPECT_TRUE(ContainsCookie( + GetCookiesInCookieJar(), + AccountConsistencyService::kChromeConnectedCookieName, "." + domain)); EXPECT_GE( account_consistency_service_->last_cookie_update_map_.count(domain), 1u); } - void SimulateGaiaCookieManagerServiceLogout( - bool expect_remove_cookie_callback) { - // Simulate the action of the action GaiaCookieManagerService to cleanup - // the cookies once the sign-out is done. - remove_cookie_callback_called_ = false; - account_consistency_service_->RemoveChromeConnectedCookies(base::BindOnce( - &AccountConsistencyServiceTest::OnRemoveChromeConnectedCookieFinished, - base::Unretained(this))); - EXPECT_EQ(expect_remove_cookie_callback, remove_cookie_callback_called_); + void CheckNoChromeConnectedCookieForDomain(const std::string& domain) { + EXPECT_FALSE(ContainsCookie( + GetCookiesInCookieJar(), + AccountConsistencyService::kChromeConnectedCookieName, "." + domain)); + EXPECT_EQ(0U, account_consistency_service_->last_cookie_update_map_.count( + domain)); + } + + void CheckNoChromeConnectedCookies() { + EXPECT_FALSE( + ContainsCookie(GetCookiesInCookieJar(), + AccountConsistencyService::kChromeConnectedCookieName, + /*domain=*/std::string())); + } + + // Simulate the action of the action GaiaCookieManagerService to cleanup + // the cookies once the sign-out is done. + void SimulateGaiaCookieManagerServiceLogout() { + base::RunLoop run_loop; + account_consistency_service_->RemoveChromeConnectedCookies( + run_loop.QuitClosure()); + run_loop.Run(); } // Creates test threads, necessary for ActiveStateManager that needs a UI @@ -261,27 +281,29 @@ scoped_refptr<HostContentSettingsMap> settings_map_; scoped_refptr<content_settings::CookieSettings> cookie_settings_; bool remove_cookie_callback_called_; - int web_view_load_expection_count_; }; -// Tests whether the WKWebView is actually stopped when the browser state is -// inactive. -TEST_F(AccountConsistencyServiceTest, OnInactive) { - [[GetMockWKWebView() expect] stopLoading]; - // Loads the webview. - EXPECT_TRUE(GetWKWebView()); - ActiveStateManager::FromBrowserState(&browser_state_)->SetActive(false); +// Tests that main domains are added to the internal map when cookies are set in +// reaction to signin. +TEST_F(AccountConsistencyServiceTest, SigninAddCookieOnMainDomains) { + SignIn(); + CheckDomainHasChromeConnectedCookie(kGoogleDomain); + CheckDomainHasChromeConnectedCookie(kYoutubeDomain); + + const base::DictionaryValue* dict = + prefs_.GetDictionary(AccountConsistencyService::kDomainsWithCookiePref); + EXPECT_EQ(2u, dict->size()); + EXPECT_TRUE(dict->GetBooleanWithoutPathExpansion("google.com", nullptr)); + EXPECT_TRUE(dict->GetBooleanWithoutPathExpansion("youtube.com", nullptr)); } // Tests that cookies that are added during SignIn and subsequent navigations // are correctly removed during the SignOut. TEST_F(AccountConsistencyServiceTest, SignInSignOut) { - // Check that main Google domains are added. - AddPageLoadedExpectation(kGoogleUrl, true /* continue_navigation */); - AddPageLoadedExpectation(kYoutubeUrl, true /* continue_navigation */); SignIn(); - // Check that other Google domains are added on navigation. - AddPageLoadedExpectation(kCountryGoogleUrl, true /* continue_navigation */); + CheckDomainHasChromeConnectedCookie(kGoogleDomain); + CheckDomainHasChromeConnectedCookie(kYoutubeDomain); + CheckNoChromeConnectedCookieForDomain(kCountryGoogleDomain); id delegate = [OCMockObject mockForProtocol:@protocol(ManageAccountsDelegate)]; @@ -291,23 +313,26 @@ statusCode:200 HTTPVersion:@"HTTP/1.1" headerFields:headers]; - web_view_load_expection_count_ = 1; account_consistency_service_->SetWebStateHandler(&web_state_, delegate); EXPECT_TRUE( web_state_.ShouldAllowResponse(response, /* for_main_frame = */ true)); web_state_.WebStateDestroyed(); - EXPECT_EQ(0, web_view_load_expection_count_); - // Check that all domains are removed. - AddPageLoadedExpectation(kGoogleUrl, true /* continue_navigation */); - AddPageLoadedExpectation(kYoutubeUrl, true /* continue_navigation */); - AddPageLoadedExpectation(kCountryGoogleUrl, true /* continue_navigation */); + // Check that cookies was also added for |kCountryGoogleDomain|. + CheckDomainHasChromeConnectedCookie(kGoogleDomain); + CheckDomainHasChromeConnectedCookie(kYoutubeDomain); + CheckDomainHasChromeConnectedCookie(kCountryGoogleDomain); + SignOutAndSimulateGaiaCookieManagerServiceLogout(); + CheckNoChromeConnectedCookies(); } // Tests that signing out with no domains known, still call the callback. TEST_F(AccountConsistencyServiceTest, SignOutWithoutDomains) { + CheckNoChromeConnectedCookies(); + SignOutAndSimulateGaiaCookieManagerServiceLogout(); + CheckNoChromeConnectedCookies(); } // Tests that pending cookie requests are correctly applied when the browser @@ -315,27 +340,13 @@ TEST_F(AccountConsistencyServiceTest, ApplyOnActive) { // No request is made until the browser state is active, then a WKWebView and // its navigation delegate are created, and the requests are processed. - [[GetMockWKWebView() expect] setNavigationDelegate:[OCMArg isNotNil]]; ActiveStateManager::FromBrowserState(&browser_state_)->SetActive(false); SignIn(); - AddPageLoadedExpectation(kGoogleUrl, true /* continue_navigation */); - AddPageLoadedExpectation(kYoutubeUrl, true /* continue_navigation */); - ActiveStateManager::FromBrowserState(&browser_state_)->SetActive(true); -} + CheckNoChromeConnectedCookies(); -// Tests that cookie request being processed is correctly cancelled when the -// browser state becomes inactives and correctly re-started later when the -// browser state becomes active. -TEST_F(AccountConsistencyServiceTest, CancelOnInactiveReApplyOnActive) { - // The first request starts to get applied and get cancelled as the browser - // state becomes inactive. It is resumed after the browser state becomes - // active again. - AddPageLoadedExpectation(kGoogleUrl, false /* continue_navigation */); - SignIn(); - ActiveStateManager::FromBrowserState(&browser_state_)->SetActive(false); - AddPageLoadedExpectation(kGoogleUrl, true /* continue_navigation */); - AddPageLoadedExpectation(kYoutubeUrl, true /* continue_navigation */); ActiveStateManager::FromBrowserState(&browser_state_)->SetActive(true); + CheckDomainHasChromeConnectedCookie(kGoogleDomain); + CheckDomainHasChromeConnectedCookie(kYoutubeDomain); } // Tests that the X-Chrome-Manage-Accounts header is ignored unless it comes @@ -408,42 +419,30 @@ EXPECT_OCMOCK_VERIFY(delegate); } -// Tests that domains with cookie are added to the prefs only after the request -// has been applied. -TEST_F(AccountConsistencyServiceTest, DomainsWithCookiePrefsOnApplied) { - // Second request is not completely applied. Ensure prefs reflect that. - AddPageLoadedExpectation(kGoogleUrl, true /* continue_navigation */); - AddPageLoadedExpectation(kYoutubeUrl, false /* continue_navigation */); - SignIn(); - - const base::DictionaryValue* dict = - prefs_.GetDictionary(AccountConsistencyService::kDomainsWithCookiePref); - EXPECT_EQ(1u, dict->size()); - EXPECT_TRUE(dict->GetBooleanWithoutPathExpansion("google.com", nullptr)); - EXPECT_FALSE(dict->GetBooleanWithoutPathExpansion("youtube.com", nullptr)); -} - // Tests that domains with cookie are correctly loaded from the prefs on service // startup. TEST_F(AccountConsistencyServiceTest, DomainsWithCookieLoadedFromPrefs) { - AddPageLoadedExpectation(kGoogleUrl, true /* continue_navigation */); - AddPageLoadedExpectation(kYoutubeUrl, true /* continue_navigation */); SignIn(); + CheckDomainHasChromeConnectedCookie(kGoogleDomain); + CheckDomainHasChromeConnectedCookie(kYoutubeDomain); ResetAccountConsistencyService(); - AddPageLoadedExpectation(kGoogleUrl, true /* continue_navigation */); - AddPageLoadedExpectation(kYoutubeUrl, true /* continue_navigation */); + CheckDomainHasChromeConnectedCookie(kGoogleDomain); + CheckDomainHasChromeConnectedCookie(kYoutubeDomain); + SignOutAndSimulateGaiaCookieManagerServiceLogout(); + CheckNoChromeConnectedCookies(); } // Tests that domains with cookie are cleared when browsing data is removed. TEST_F(AccountConsistencyServiceTest, DomainsClearedOnBrowsingDataRemoved) { - AddPageLoadedExpectation(kGoogleUrl, true /* continue_navigation */); - AddPageLoadedExpectation(kYoutubeUrl, true /* continue_navigation */); SignIn(); - const base::DictionaryValue* dict = - prefs_.GetDictionary(AccountConsistencyService::kDomainsWithCookiePref); - EXPECT_EQ(2u, dict->size()); + CheckDomainHasChromeConnectedCookie(kGoogleDomain); + CheckDomainHasChromeConnectedCookie(kYoutubeDomain); + EXPECT_EQ( + 2u, + prefs_.GetDictionary(AccountConsistencyService::kDomainsWithCookiePref) + ->size()); // Sets Response to get IdentityManager::Observer::OnAccountsInCookieUpdated // through GaiaCookieManagerService::OnCookieChange. @@ -456,36 +455,20 @@ // AccountsCookieMutator::ForceTriggerOnCookieChange and finally // IdentityManager::Observer::OnAccountsInCookieUpdated is called. account_consistency_service_->OnBrowsingDataRemoved(); + EXPECT_EQ( + 0u, + prefs_.GetDictionary(AccountConsistencyService::kDomainsWithCookiePref) + ->size()); run_loop.Run(); - dict = - prefs_.GetDictionary(AccountConsistencyService::kDomainsWithCookiePref); - EXPECT_EQ(0u, dict->size()); -} - -// Tests that remove cookie call back is called when the signout is interrupted -// by removing the browser data. -TEST_F(AccountConsistencyServiceTest, DomainsClearedOnBrowsingDataRemoved2) { - AddPageLoadedExpectation(kGoogleUrl, true /* continue_navigation */); - AddPageLoadedExpectation(kYoutubeUrl, true /* continue_navigation */); - SignIn(); - - AddPageLoadedExpectation(kGoogleUrl, false /* continue_navigation */); - SimulateGaiaCookieManagerServiceLogout(false); - - // Sets Response to get IdentityManager::Observer::OnAccountsInCookieUpdated - // through GaiaCookieManagerService::OnCookieChange. - signin::SetListAccountsResponseNoAccounts(&test_url_loader_factory_); - - base::RunLoop run_loop; - identity_test_env_->identity_manager_observer() - ->SetOnAccountsInCookieUpdatedCallback(run_loop.QuitClosure()); - // OnBrowsingDataRemoved triggers - // AccountsCookieMutator::ForceTriggerOnCookieChange and finally - // IdentityManager::Observer::OnAccountsInCookieUpdated is called. - account_consistency_service_->OnBrowsingDataRemoved(); - run_loop.Run(); - EXPECT_TRUE(remove_cookie_callback_called_); + // AccountConsistency service is supposed to rebuild the CHROME_CONNECTED + // cookies when browsing data is removed. + CheckDomainHasChromeConnectedCookie(kGoogleDomain); + CheckDomainHasChromeConnectedCookie(kYoutubeDomain); + EXPECT_EQ( + 2u, + prefs_.GetDictionary(AccountConsistencyService::kDomainsWithCookiePref) + ->size()); } // Tests that cookie requests are correctly processed or ignored when the update @@ -494,15 +477,16 @@ EXPECT_TRUE(ShouldAddCookieToDomain(kGoogleDomain, false)); EXPECT_TRUE(ShouldAddCookieToDomain(kYoutubeDomain, false)); - AddPageLoadedExpectation(kGoogleUrl, true /* continue_navigation */); - AddPageLoadedExpectation(kYoutubeUrl, true /* continue_navigation */); SignIn(); - + CheckDomainHasChromeConnectedCookie(kGoogleDomain); + CheckDomainHasChromeConnectedCookie(kYoutubeDomain); EXPECT_FALSE(ShouldAddCookieToDomain(kGoogleDomain, false)); EXPECT_FALSE(ShouldAddCookieToDomain(kYoutubeDomain, false)); ResetAccountConsistencyService(); + CheckDomainHasChromeConnectedCookie(kGoogleDomain); + CheckDomainHasChromeConnectedCookie(kYoutubeDomain); EXPECT_FALSE(ShouldAddCookieToDomain(kGoogleDomain, false)); EXPECT_FALSE(ShouldAddCookieToDomain(kYoutubeDomain, false)); } @@ -513,26 +497,17 @@ EXPECT_TRUE(ShouldAddCookieToDomain(kGoogleDomain, true)); EXPECT_TRUE(ShouldAddCookieToDomain(kYoutubeDomain, true)); - AddPageLoadedExpectation(kGoogleUrl, true /* continue_navigation */); - AddPageLoadedExpectation(kYoutubeUrl, true /* continue_navigation */); SignIn(); + CheckDomainHasChromeConnectedCookie(kGoogleDomain); + CheckDomainHasChromeConnectedCookie(kYoutubeDomain); EXPECT_FALSE(ShouldAddCookieToDomain(kGoogleDomain, true)); EXPECT_FALSE(ShouldAddCookieToDomain(kYoutubeDomain, true)); ResetAccountConsistencyService(); + CheckDomainHasChromeConnectedCookie(kGoogleDomain); + CheckDomainHasChromeConnectedCookie(kYoutubeDomain); EXPECT_TRUE(ShouldAddCookieToDomain(kGoogleDomain, true)); EXPECT_TRUE(ShouldAddCookieToDomain(kYoutubeDomain, true)); } - -// Tests that main domains are added to the internal map when cookies are set in -// reaction to signin. -TEST_F(AccountConsistencyServiceTest, SigninAddCookieOnMainDomains) { - AddPageLoadedExpectation(kGoogleUrl, true /* continue_navigation */); - AddPageLoadedExpectation(kYoutubeUrl, true /* continue_navigation */); - SignIn(); - - CheckDomainHasCookie(kGoogleDomain); - CheckDomainHasCookie(kYoutubeDomain); -}
diff --git a/content/browser/frame_host/render_frame_proxy_host.cc b/content/browser/frame_host/render_frame_proxy_host.cc index 2797ff6..053b3543 100644 --- a/content/browser/frame_host/render_frame_proxy_host.cc +++ b/content/browser/frame_host/render_frame_proxy_host.cc
@@ -172,9 +172,7 @@ } RenderViewHostImpl* RenderFrameProxyHost::GetRenderViewHost() { - return frame_tree_node_->frame_tree() - ->GetRenderViewHost(site_instance_.get()) - .get(); + return render_view_host_.get(); } RenderWidgetHostView* RenderFrameProxyHost::GetRenderWidgetHostView() {
diff --git a/content/browser/webauth/authenticator_impl_unittest.cc b/content/browser/webauth/authenticator_impl_unittest.cc index 15eca9e6..91ea8c0b 100644 --- a/content/browser/webauth/authenticator_impl_unittest.cc +++ b/content/browser/webauth/authenticator_impl_unittest.cc
@@ -392,6 +392,18 @@ return std::move(parsed_auth_data.value()); } +url::Origin GetTestOrigin() { + const GURL test_relying_party_url(kTestOrigin1); + CHECK(test_relying_party_url.is_valid()); + return url::Origin::Create(test_relying_party_url); +} + +std::string GetTestClientDataJSON(std::string type) { + return device::SerializeCollectedClientDataToJson( + std::move(type), GetTestOrigin().Serialize(), GetTestChallengeBytes(), + /*is_cross_origin=*/false); +} + } // namespace class AuthenticatorTestBase : public content::RenderViewHostTestHarness { @@ -443,13 +455,6 @@ content::RenderViewHostTestHarness::NavigateAndCommit(url); } - // Simulates navigating to a page and getting the page contents and language - // for that navigation. - void SimulateNavigation(const GURL& url) { - if (main_rfh()->GetLastCommittedURL() != url) - NavigateAndCommit(url); - } - mojo::Remote<blink::mojom::Authenticator> ConnectToAuthenticator() { authenticator_impl_ = std::make_unique<AuthenticatorImpl>(main_rfh()); mojo::Remote<blink::mojom::Authenticator> authenticator; @@ -457,43 +462,94 @@ return authenticator; } - url::Origin GetTestOrigin() { - const GURL test_relying_party_url(kTestOrigin1); - CHECK(test_relying_party_url.is_valid()); - return url::Origin::Create(test_relying_party_url); + struct MakeCredentialResult { + AuthenticatorStatus status; + MakeCredentialAuthenticatorResponsePtr response; + }; + + MakeCredentialResult AuthenticatorMakeCredential() { + return AuthenticatorMakeCredential( + GetTestPublicKeyCredentialCreationOptions()); } - std::string GetTestClientDataJSON(std::string type) { - return device::SerializeCollectedClientDataToJson( - std::move(type), GetTestOrigin().Serialize(), GetTestChallengeBytes(), - /*is_cross_origin*/ false); + MakeCredentialResult AuthenticatorMakeCredential( + PublicKeyCredentialCreationOptionsPtr options) { + mojo::Remote<blink::mojom::Authenticator> authenticator = + ConnectToAuthenticator(); + TestMakeCredentialCallback callback_receiver; + authenticator->MakeCredential(std::move(options), + callback_receiver.callback()); + callback_receiver.WaitForCallback(); + AuthenticatorStatus status; + MakeCredentialAuthenticatorResponsePtr response; + std::tie(status, response) = callback_receiver.TakeResult(); + return {status, std::move(response)}; } - std::string SerializeClientDataJSON(const std::string& type, - const std::string& origin, - base::span<const uint8_t> challenge, - bool is_cross_origin) { - return device::SerializeCollectedClientDataToJson(type, origin, challenge, - is_cross_origin); + MakeCredentialResult AuthenticatorMakeCredentialAndWaitForTimeout( + PublicKeyCredentialCreationOptionsPtr options) { + mojo::Remote<blink::mojom::Authenticator> authenticator = + ConnectToAuthenticator(); + TestMakeCredentialCallback callback_receiver; + authenticator->MakeCredential(std::move(options), + callback_receiver.callback()); + task_environment()->FastForwardBy(kTestTimeout); + callback_receiver.WaitForCallback(); + AuthenticatorStatus status; + MakeCredentialAuthenticatorResponsePtr response; + std::tie(status, response) = callback_receiver.TakeResult(); + return {status, std::move(response)}; + } + + struct GetAssertionResult { + AuthenticatorStatus status; + GetAssertionAuthenticatorResponsePtr response; + }; + + GetAssertionResult AuthenticatorGetAssertion() { + return AuthenticatorGetAssertion( + GetTestPublicKeyCredentialRequestOptions()); + } + + GetAssertionResult AuthenticatorGetAssertion( + PublicKeyCredentialRequestOptionsPtr options) { + mojo::Remote<blink::mojom::Authenticator> authenticator = + ConnectToAuthenticator(); + TestGetAssertionCallback callback_receiver; + authenticator->GetAssertion(std::move(options), + callback_receiver.callback()); + callback_receiver.WaitForCallback(); + AuthenticatorStatus status; + GetAssertionAuthenticatorResponsePtr response; + std::tie(status, response) = callback_receiver.TakeResult(); + return {status, std::move(response)}; + } + + GetAssertionResult AuthenticatorGetAssertionAndWaitForTimeout( + PublicKeyCredentialRequestOptionsPtr options) { + mojo::Remote<blink::mojom::Authenticator> authenticator = + ConnectToAuthenticator(); + TestGetAssertionCallback callback_receiver; + authenticator->GetAssertion(std::move(options), + callback_receiver.callback()); + task_environment()->FastForwardBy(kTestTimeout); + AuthenticatorStatus status; + GetAssertionAuthenticatorResponsePtr response; + std::tie(status, response) = callback_receiver.TakeResult(); + return {status, std::move(response)}; } AuthenticatorStatus TryAuthenticationWithAppId(const std::string& origin, const std::string& appid) { const GURL origin_url(origin); NavigateAndCommit(origin_url); - mojo::Remote<blink::mojom::Authenticator> authenticator = - ConnectToAuthenticator(); + PublicKeyCredentialRequestOptionsPtr options = GetTestPublicKeyCredentialRequestOptions(); options->relying_party_id = origin_url.host(); options->appid = appid; - TestGetAssertionCallback callback_receiver; - authenticator->GetAssertion(std::move(options), - callback_receiver.callback()); - callback_receiver.WaitForCallback(); - - return callback_receiver.status(); + return AuthenticatorGetAssertion(std::move(options)).status; } AuthenticatorStatus TryRegistrationWithAppIdExclude( @@ -501,19 +557,13 @@ const std::string& appid_exclude) { const GURL origin_url(origin); NavigateAndCommit(origin_url); - mojo::Remote<blink::mojom::Authenticator> authenticator = - ConnectToAuthenticator(); + PublicKeyCredentialCreationOptionsPtr options = GetTestPublicKeyCredentialCreationOptions(); options->relying_party.id = origin_url.host(); options->appid_exclude = appid_exclude; - TestMakeCredentialCallback callback_receiver; - authenticator->MakeCredential(std::move(options), - callback_receiver.callback()); - callback_receiver.WaitForCallback(); - - return callback_receiver.status(); + return AuthenticatorMakeCredential(std::move(options)).status; } void EnableFeature(const base::Feature& feature) { @@ -547,7 +597,8 @@ // the returned value. std::vector<uint8_t> challenge_bytes = {1, 2, 3}; EXPECT_TRUE( - SerializeClientDataJSON("t\x05ype", "ori\"gin", challenge_bytes, false) + device::SerializeCollectedClientDataToJson("t\x05ype", "ori\"gin", + challenge_bytes, false) .find("{\"type\":\"t\\u0005ype\",\"challenge\":\"AQID\",\"origin\":" "\"ori\\\"gin\",\"crossOrigin\":false") == 0); @@ -582,7 +633,7 @@ for (const auto& test : kTestCases) { SCOPED_TRACE(num++); - const std::string json = SerializeClientDataJSON( + const std::string json = device::SerializeCollectedClientDataToJson( test.type, test.origin, test.challenge, test.is_cross_origin); const auto parsed = base::JSONReader::Read(json); @@ -613,16 +664,12 @@ std::string(test_case.origin)); NavigateAndCommit(GURL(test_case.origin)); - mojo::Remote<blink::mojom::Authenticator> authenticator = - ConnectToAuthenticator(); PublicKeyCredentialCreationOptionsPtr options = GetTestPublicKeyCredentialCreationOptions(); options->relying_party.id = test_case.claimed_authority; - TestMakeCredentialCallback callback_receiver; - authenticator->MakeCredential(std::move(options), - callback_receiver.callback()); - callback_receiver.WaitForCallback(); - EXPECT_EQ(test_case.expected_status, callback_receiver.status()); + + EXPECT_EQ(AuthenticatorMakeCredential(std::move(options)).status, + test_case.expected_status); } } @@ -649,8 +696,7 @@ {GURL("invalid:/url"), bad}, }; - SimulateNavigation(GURL(kTestOrigin1)); - auto authenticator = ConnectToAuthenticator(); + NavigateAndCommit(GURL(kTestOrigin1)); for (const bool test_user_icon : {false, true}) { for (auto test_case : kTestCases) { @@ -665,11 +711,8 @@ options->relying_party.icon_url = test_case.first; } - TestMakeCredentialCallback callback_receiver; - authenticator->MakeCredential(std::move(options), - callback_receiver.callback()); - callback_receiver.WaitForCallback(); - EXPECT_EQ(test_case.second, callback_receiver.status()); + EXPECT_EQ(AuthenticatorMakeCredential(std::move(options)).status, + test_case.second); } } } @@ -677,60 +720,42 @@ // Test that MakeCredential request times out with NOT_ALLOWED_ERROR if user // verification is required for U2F devices. TEST_F(AuthenticatorImplTest, MakeCredentialUserVerification) { - SimulateNavigation(GURL(kTestOrigin1)); - auto authenticator = ConnectToAuthenticator(); + NavigateAndCommit(GURL(kTestOrigin1)); PublicKeyCredentialCreationOptionsPtr options = GetTestPublicKeyCredentialCreationOptions(); options->authenticator_selection->SetUserVerificationRequirementForTesting( device::UserVerificationRequirement::kRequired); - TestMakeCredentialCallback callback_receiver; - authenticator->MakeCredential(std::move(options), - callback_receiver.callback()); - task_environment()->FastForwardBy(kTestTimeout); - callback_receiver.WaitForCallback(); - EXPECT_EQ(AuthenticatorStatus::NOT_ALLOWED_ERROR, callback_receiver.status()); + EXPECT_EQ( + AuthenticatorMakeCredentialAndWaitForTimeout(std::move(options)).status, + AuthenticatorStatus::NOT_ALLOWED_ERROR); } -// Test that MakeCredential request returns if resident -// key is requested on create(). -TEST_F(AuthenticatorImplTest, MakeCredentialResidentKey) { - SimulateNavigation(GURL(kTestOrigin1)); - auto authenticator = ConnectToAuthenticator(); +TEST_F(AuthenticatorImplTest, MakeCredentialResidentKeyUnsupported) { + NavigateAndCommit(GURL(kTestOrigin1)); PublicKeyCredentialCreationOptionsPtr options = GetTestPublicKeyCredentialCreationOptions(); options->authenticator_selection->SetRequireResidentKeyForTesting(true); - TestMakeCredentialCallback callback_receiver; - authenticator->MakeCredential(std::move(options), - callback_receiver.callback()); - task_environment()->FastForwardBy(kTestTimeout); - callback_receiver.WaitForCallback(); - EXPECT_EQ(AuthenticatorStatus::RESIDENT_CREDENTIALS_UNSUPPORTED, - callback_receiver.status()); - - // TODO add CTAP device + EXPECT_EQ(AuthenticatorMakeCredential(std::move(options)).status, + AuthenticatorStatus::RESIDENT_CREDENTIALS_UNSUPPORTED); } // Test that MakeCredential request times out with NOT_ALLOWED_ERROR if a // platform authenticator is requested for U2F devices. TEST_F(AuthenticatorImplTest, MakeCredentialPlatformAuthenticator) { - SimulateNavigation(GURL(kTestOrigin1)); - auto authenticator = ConnectToAuthenticator(); + NavigateAndCommit(GURL(kTestOrigin1)); PublicKeyCredentialCreationOptionsPtr options = GetTestPublicKeyCredentialCreationOptions(); options->authenticator_selection->SetAuthenticatorAttachmentForTesting( device::AuthenticatorAttachment::kPlatform); - TestMakeCredentialCallback callback_receiver; - authenticator->MakeCredential(std::move(options), - callback_receiver.callback()); - task_environment()->FastForwardBy(kTestTimeout); - callback_receiver.WaitForCallback(); - EXPECT_EQ(AuthenticatorStatus::NOT_ALLOWED_ERROR, callback_receiver.status()); + EXPECT_EQ( + AuthenticatorMakeCredentialAndWaitForTimeout(std::move(options)).status, + AuthenticatorStatus::NOT_ALLOWED_ERROR); } // Parses its arguments as JSON and expects that all the keys in the first are @@ -763,12 +788,12 @@ } // Test that client data serializes to JSON properly. -TEST_F(AuthenticatorImplTest, TestSerializedRegisterClientData) { +TEST(ClientDataSerializationTest, Register) { CheckJSONIsSubsetOfJSON(kTestRegisterClientDataJsonString, GetTestClientDataJSON(client_data::kCreateType)); } -TEST_F(AuthenticatorImplTest, TestSerializedSignClientData) { +TEST(ClientDataSerializationTest, Sign) { CheckJSONIsSubsetOfJSON(kTestSignClientDataJsonString, GetTestClientDataJSON(client_data::kGetType)); } @@ -779,18 +804,14 @@ AuthenticatorEnvironmentImpl::GetInstance() ->ReplaceDefaultDiscoveryFactoryForTesting( std::make_unique<device::FidoDiscoveryFactory>()); - SimulateNavigation(GURL(kTestOrigin1)); + NavigateAndCommit(GURL(kTestOrigin1)); + PublicKeyCredentialCreationOptionsPtr options = GetTestPublicKeyCredentialCreationOptions(); - TestMakeCredentialCallback callback_receiver; - auto authenticator = ConnectToAuthenticator(); - authenticator->MakeCredential(std::move(options), - callback_receiver.callback()); - - task_environment()->FastForwardBy(kTestTimeout); - callback_receiver.WaitForCallback(); - EXPECT_EQ(AuthenticatorStatus::NOT_ALLOWED_ERROR, callback_receiver.status()); + EXPECT_EQ( + AuthenticatorMakeCredentialAndWaitForTimeout(std::move(options)).status, + AuthenticatorStatus::NOT_ALLOWED_ERROR); } // Verify behavior for various combinations of origins and RP IDs. @@ -803,17 +824,13 @@ std::string(test_case.origin)); NavigateAndCommit(GURL(test_case.origin)); - mojo::Remote<blink::mojom::Authenticator> authenticator = - ConnectToAuthenticator(); + PublicKeyCredentialRequestOptionsPtr options = GetTestPublicKeyCredentialRequestOptions(); options->relying_party_id = test_case.claimed_authority; - TestGetAssertionCallback callback_receiver; - authenticator->GetAssertion(std::move(options), - callback_receiver.callback()); - callback_receiver.WaitForCallback(); - EXPECT_EQ(test_case.expected_status, callback_receiver.status()); + EXPECT_EQ(AuthenticatorGetAssertion(std::move(options)).status, + test_case.expected_status); } } @@ -881,7 +898,7 @@ // Verify that a request coming from Cryptotoken bypasses origin checks. TEST_F(AuthenticatorImplTest, CryptotokenBypass) { { - SimulateNavigation(GURL(kCryptotokenOrigin)); + NavigateAndCommit(GURL(kCryptotokenOrigin)); // First, verify that the Cryptotoken request succeeds with the appid. PublicKeyCredentialRequestOptionsPtr options = GetTestPublicKeyCredentialRequestOptions(); @@ -893,20 +910,14 @@ options->appid = kTestOrigin1; - TestGetAssertionCallback callback_receiver; - auto authenticator = ConnectToAuthenticator(); - authenticator->GetAssertion(std::move(options), - callback_receiver.callback()); - callback_receiver.WaitForCallback(); - ASSERT_EQ(AuthenticatorStatus::SUCCESS, callback_receiver.status()); - - EXPECT_EQ(true, callback_receiver.value()->echo_appid_extension); - EXPECT_EQ(true, callback_receiver.value()->appid_extension); + GetAssertionResult result = AuthenticatorGetAssertion(std::move(options)); + EXPECT_EQ(result.response->echo_appid_extension, true); + EXPECT_EQ(result.response->appid_extension, true); } { ResetVirtualDevice(); - SimulateNavigation(GURL(kTestExtensionOrigin)); + NavigateAndCommit(GURL(kTestExtensionOrigin)); // Next, verify that other extensions cannot bypass the origin checks. PublicKeyCredentialRequestOptionsPtr options = GetTestPublicKeyCredentialRequestOptions(); @@ -918,12 +929,8 @@ options->appid = kTestOrigin1; - TestGetAssertionCallback callback_receiver; - auto authenticator = ConnectToAuthenticator(); - authenticator->GetAssertion(std::move(options), - callback_receiver.callback()); - callback_receiver.WaitForCallback(); - ASSERT_EQ(AuthenticatorStatus::INVALID_DOMAIN, callback_receiver.status()); + EXPECT_EQ(AuthenticatorGetAssertion(std::move(options)).status, + AuthenticatorStatus::INVALID_DOMAIN); } } @@ -932,18 +939,13 @@ TEST_F(AuthenticatorImplTest, CryptoTokenMakeCredentialU2fDevice) { virtual_device_factory_->SetSupportedProtocol(device::ProtocolVersion::kU2f); - SimulateNavigation(GURL(kCryptotokenOrigin)); - auto authenticator = ConnectToAuthenticator(); + NavigateAndCommit(GURL(kCryptotokenOrigin)); PublicKeyCredentialCreationOptionsPtr options = GetTestPublicKeyCredentialCreationOptions(); options->relying_party.id = kTestOrigin1; - TestMakeCredentialCallback callback_receiver; - authenticator->MakeCredential(std::move(options), - callback_receiver.callback()); - callback_receiver.WaitForCallback(); - - EXPECT_EQ(AuthenticatorStatus::SUCCESS, callback_receiver.status()); + EXPECT_EQ(AuthenticatorMakeCredential(std::move(options)).status, + AuthenticatorStatus::SUCCESS); } // MakeCredential requests from cryptotoken to an authentictor that does not @@ -951,43 +953,33 @@ TEST_F(AuthenticatorImplTest, CryptoTokenMakeCredentialCtap2Device) { virtual_device_factory_->SetSupportedProtocol( device::ProtocolVersion::kCtap2); + NavigateAndCommit(GURL(kCryptotokenOrigin)); - SimulateNavigation(GURL(kCryptotokenOrigin)); - auto authenticator = ConnectToAuthenticator(); PublicKeyCredentialCreationOptionsPtr options = GetTestPublicKeyCredentialCreationOptions(); options->relying_party.id = kTestOrigin1; - TestMakeCredentialCallback callback_receiver; - authenticator->MakeCredential(std::move(options), - callback_receiver.callback()); - task_environment()->FastForwardBy(kTestTimeout); - callback_receiver.WaitForCallback(); - - EXPECT_EQ(AuthenticatorStatus::NOT_ALLOWED_ERROR, callback_receiver.status()); + EXPECT_EQ( + AuthenticatorMakeCredentialAndWaitForTimeout(std::move(options)).status, + AuthenticatorStatus::NOT_ALLOWED_ERROR); } // GetAssertion requests from cryptotoken to a U2F/CTAP authenticator should // use the U2F interface. TEST_F(AuthenticatorImplTest, CryptoTokenMakeCredentialDualProtocolDevice) { + NavigateAndCommit(GURL(kCryptotokenOrigin)); virtual_device_factory_->SetSupportedProtocol( device::ProtocolVersion::kCtap2); device::VirtualCtap2Device::Config config; config.u2f_support = true; virtual_device_factory_->SetCtap2Config(config); - SimulateNavigation(GURL(kCryptotokenOrigin)); - auto authenticator = ConnectToAuthenticator(); PublicKeyCredentialCreationOptionsPtr options = GetTestPublicKeyCredentialCreationOptions(); options->relying_party.id = kTestOrigin1; - TestMakeCredentialCallback callback_receiver; - authenticator->MakeCredential(std::move(options), - callback_receiver.callback()); - callback_receiver.WaitForCallback(); - - EXPECT_EQ(AuthenticatorStatus::SUCCESS, callback_receiver.status()); + EXPECT_EQ(AuthenticatorMakeCredential(std::move(options)).status, + AuthenticatorStatus::SUCCESS); ASSERT_EQ(virtual_device_factory_->mutable_state()->registrations.size(), 1u); EXPECT_TRUE(virtual_device_factory_->mutable_state() ->registrations.begin() @@ -997,7 +989,7 @@ // GetAssertion requests from cryptotoken to a U2F authenticator should // succeed. TEST_F(AuthenticatorImplTest, CryptoTokenGetAssertionU2fDevice) { - SimulateNavigation(GURL(kCryptotokenOrigin)); + NavigateAndCommit(GURL(kCryptotokenOrigin)); virtual_device_factory_->SetSupportedProtocol(device::ProtocolVersion::kU2f); PublicKeyCredentialRequestOptionsPtr options = @@ -1006,19 +998,14 @@ options->allow_credentials[0].id(), kTestOrigin1)); options->appid = kTestOrigin1; - TestGetAssertionCallback callback_receiver; - auto authenticator = ConnectToAuthenticator(); - authenticator->GetAssertion(std::move(options), callback_receiver.callback()); - - callback_receiver.WaitForCallback(); - - EXPECT_EQ(AuthenticatorStatus::SUCCESS, callback_receiver.status()); + EXPECT_EQ(AuthenticatorGetAssertion(std::move(options)).status, + AuthenticatorStatus::SUCCESS); } // GetAssertion requests from cryptotoken to an authentictor that does not // support U2F should fail. TEST_F(AuthenticatorImplTest, CryptoTokenGetAssertionCtap2Device) { - SimulateNavigation(GURL(kCryptotokenOrigin)); + NavigateAndCommit(GURL(kCryptotokenOrigin)); virtual_device_factory_->SetSupportedProtocol( device::ProtocolVersion::kCtap2); @@ -1028,20 +1015,15 @@ options->allow_credentials[0].id(), kTestOrigin1)); options->appid = kTestOrigin1; - TestGetAssertionCallback callback_receiver; - auto authenticator = ConnectToAuthenticator(); - authenticator->GetAssertion(std::move(options), callback_receiver.callback()); - - task_environment()->FastForwardBy(kTestTimeout); - callback_receiver.WaitForCallback(); - - EXPECT_EQ(AuthenticatorStatus::NOT_ALLOWED_ERROR, callback_receiver.status()); + EXPECT_EQ( + AuthenticatorGetAssertionAndWaitForTimeout(std::move(options)).status, + AuthenticatorStatus::NOT_ALLOWED_ERROR); } // GetAssertion requests from cryptotoken should challenge credential on a // U2F/CTAP authenticator via the U2F interface. TEST_F(AuthenticatorImplTest, CryptoTokenGetAssertionDualProtocolDevice) { - SimulateNavigation(GURL(kCryptotokenOrigin)); + NavigateAndCommit(GURL(kCryptotokenOrigin)); virtual_device_factory_->SetSupportedProtocol( device::ProtocolVersion::kCtap2); device::VirtualCtap2Device::Config config; @@ -1055,18 +1037,14 @@ options->allow_credentials[0].id(), kTestOrigin1)); options->appid = kTestOrigin1; - TestGetAssertionCallback callback_receiver; - auto authenticator = ConnectToAuthenticator(); - authenticator->GetAssertion(std::move(options), callback_receiver.callback()); - callback_receiver.WaitForCallback(); - - EXPECT_EQ(AuthenticatorStatus::SUCCESS, callback_receiver.status()); + EXPECT_EQ(AuthenticatorGetAssertion(std::move(options)).status, + AuthenticatorStatus::SUCCESS); } // Test that Cryptotoken requests should only be dispatched to USB // authenticators. TEST_F(AuthenticatorImplTest, CryptotokenUsbOnly) { - SimulateNavigation(GURL(kCryptotokenOrigin)); + NavigateAndCommit(GURL(kCryptotokenOrigin)); // caBLE and platform discoveries cannot be instantiated through // VirtualFidoDeviceFactory, so we don't test them here. @@ -1085,27 +1063,21 @@ PublicKeyCredentialCreationOptionsPtr options = GetTestPublicKeyCredentialCreationOptions(); - auto authenticator = ConnectToAuthenticator(); - TestMakeCredentialCallback callback_receiver; - authenticator->MakeCredential(std::move(options), - callback_receiver.callback()); if (transport == device::FidoTransportProtocol::kUsbHumanInterfaceDevice) { - callback_receiver.WaitForCallback(); - EXPECT_EQ(AuthenticatorStatus::SUCCESS, callback_receiver.status()); + EXPECT_EQ(AuthenticatorMakeCredential(std::move(options)).status, + AuthenticatorStatus::SUCCESS); } else { - task_environment()->FastForwardBy(kTestTimeout); - callback_receiver.WaitForCallback(); - EXPECT_EQ(AuthenticatorStatus::NOT_ALLOWED_ERROR, - callback_receiver.status()); + EXPECT_EQ(AuthenticatorMakeCredentialAndWaitForTimeout(std::move(options)) + .status, + AuthenticatorStatus::NOT_ALLOWED_ERROR); } } } // Verify that a credential registered with U2F can be used via webauthn. TEST_F(AuthenticatorImplTest, AppIdExtension) { - SimulateNavigation(GURL(kTestOrigin1)); - auto authenticator = ConnectToAuthenticator(); + NavigateAndCommit(GURL(kTestOrigin1)); { // First, test that the appid extension isn't echoed at all when not @@ -1115,13 +1087,9 @@ ASSERT_TRUE(virtual_device_factory_->mutable_state()->InjectRegistration( options->allow_credentials[0].id(), kTestRelyingPartyId)); - TestGetAssertionCallback callback_receiver; - authenticator->GetAssertion(std::move(options), - callback_receiver.callback()); - callback_receiver.WaitForCallback(); - ASSERT_EQ(AuthenticatorStatus::SUCCESS, callback_receiver.status()); - - EXPECT_EQ(false, callback_receiver.value()->echo_appid_extension); + GetAssertionResult result = AuthenticatorGetAssertion(std::move(options)); + ASSERT_EQ(result.status, AuthenticatorStatus::SUCCESS); + EXPECT_EQ(result.response->echo_appid_extension, false); } { @@ -1137,14 +1105,10 @@ // first. options->appid = kTestOrigin1; - TestGetAssertionCallback callback_receiver; - authenticator->GetAssertion(std::move(options), - callback_receiver.callback()); - callback_receiver.WaitForCallback(); - ASSERT_EQ(AuthenticatorStatus::SUCCESS, callback_receiver.status()); - - EXPECT_EQ(true, callback_receiver.value()->echo_appid_extension); - EXPECT_EQ(false, callback_receiver.value()->appid_extension); + GetAssertionResult result = AuthenticatorGetAssertion(std::move(options)); + ASSERT_EQ(result.status, AuthenticatorStatus::SUCCESS); + EXPECT_EQ(result.response->echo_appid_extension, true); + EXPECT_EQ(result.response->appid_extension, false); } { @@ -1158,14 +1122,10 @@ options->appid = kTestOrigin1; - TestGetAssertionCallback callback_receiver; - authenticator->GetAssertion(std::move(options), - callback_receiver.callback()); - callback_receiver.WaitForCallback(); - ASSERT_EQ(AuthenticatorStatus::SUCCESS, callback_receiver.status()); - - EXPECT_EQ(true, callback_receiver.value()->echo_appid_extension); - EXPECT_EQ(true, callback_receiver.value()->appid_extension); + GetAssertionResult result = AuthenticatorGetAssertion(std::move(options)); + ASSERT_EQ(result.status, AuthenticatorStatus::SUCCESS); + EXPECT_EQ(result.response->echo_appid_extension, true); + EXPECT_EQ(result.response->appid_extension, true); } { @@ -1187,20 +1147,15 @@ options->appid = kTestOrigin1; - TestGetAssertionCallback callback_receiver; - authenticator->GetAssertion(std::move(options), - callback_receiver.callback()); - callback_receiver.WaitForCallback(); - ASSERT_EQ(AuthenticatorStatus::SUCCESS, callback_receiver.status()); - - EXPECT_EQ(true, callback_receiver.value()->echo_appid_extension); - EXPECT_EQ(true, callback_receiver.value()->appid_extension); + GetAssertionResult result = AuthenticatorGetAssertion(std::move(options)); + ASSERT_EQ(result.status, AuthenticatorStatus::SUCCESS); + EXPECT_EQ(result.response->echo_appid_extension, true); + EXPECT_EQ(result.response->appid_extension, true); } } TEST_F(AuthenticatorImplTest, AppIdExcludeExtension) { - SimulateNavigation(GURL(kTestOrigin1)); - auto authenticator = ConnectToAuthenticator(); + NavigateAndCommit(GURL(kTestOrigin1)); // Attempt to register a credential using the appidExclude extension. It // should fail when the registration already exists on the authenticator. @@ -1226,16 +1181,13 @@ options->exclude_credentials[0].id(), kTestOrigin1)); } - TestMakeCredentialCallback callback_receiver; - authenticator->MakeCredential(std::move(options), - callback_receiver.callback()); - callback_receiver.WaitForCallback(); + MakeCredentialResult result = + AuthenticatorMakeCredential(std::move(options)); if (credential_already_exists) { - ASSERT_EQ(AuthenticatorStatus::CREDENTIAL_EXCLUDED, - callback_receiver.status()); + ASSERT_EQ(result.status, AuthenticatorStatus::CREDENTIAL_EXCLUDED); } else { - ASSERT_EQ(AuthenticatorStatus::SUCCESS, callback_receiver.status()); + ASSERT_EQ(result.status, AuthenticatorStatus::SUCCESS); } } } @@ -1249,11 +1201,8 @@ GetTestPublicKeyCredentialCreationOptions(); options->appid_exclude = kTestOrigin1; options->exclude_credentials.clear(); - TestMakeCredentialCallback callback_receiver; - authenticator->MakeCredential(std::move(options), - callback_receiver.callback()); - callback_receiver.WaitForCallback(); - ASSERT_EQ(AuthenticatorStatus::SUCCESS, callback_receiver.status()); + EXPECT_EQ(AuthenticatorMakeCredential(std::move(options)).status, + AuthenticatorStatus::SUCCESS); } { @@ -1273,11 +1222,8 @@ ASSERT_GT(cred.id().size(), config.max_credential_id_length); } - TestMakeCredentialCallback callback_receiver; - authenticator->MakeCredential(std::move(options), - callback_receiver.callback()); - callback_receiver.WaitForCallback(); - ASSERT_EQ(AuthenticatorStatus::SUCCESS, callback_receiver.status()); + EXPECT_EQ(AuthenticatorMakeCredential(std::move(options)).status, + AuthenticatorStatus::SUCCESS); } } @@ -1287,17 +1233,13 @@ AuthenticatorEnvironmentImpl::GetInstance() ->ReplaceDefaultDiscoveryFactoryForTesting( std::make_unique<device::FidoDiscoveryFactory>()); - SimulateNavigation(GURL(kTestOrigin1)); + NavigateAndCommit(GURL(kTestOrigin1)); PublicKeyCredentialRequestOptionsPtr options = GetTestPublicKeyCredentialRequestOptions(); - TestGetAssertionCallback callback_receiver; - auto authenticator = ConnectToAuthenticator(); - authenticator->GetAssertion(std::move(options), callback_receiver.callback()); - - task_environment()->FastForwardBy(kTestTimeout); - callback_receiver.WaitForCallback(); - EXPECT_EQ(AuthenticatorStatus::NOT_ALLOWED_ERROR, callback_receiver.status()); + EXPECT_EQ( + AuthenticatorGetAssertionAndWaitForTimeout(std::move(options)).status, + AuthenticatorStatus::NOT_ALLOWED_ERROR); } TEST_F(AuthenticatorImplTest, OversizedCredentialId) { @@ -1308,9 +1250,7 @@ for (const size_t size : kSizes) { SCOPED_TRACE(size); - SimulateNavigation(GURL(kTestOrigin1)); - mojo::Remote<blink::mojom::Authenticator> authenticator = - ConnectToAuthenticator(); + NavigateAndCommit(GURL(kTestOrigin1)); PublicKeyCredentialRequestOptionsPtr options = GetTestPublicKeyCredentialRequestOptions(); device::PublicKeyCredentialDescriptor credential; @@ -1327,17 +1267,9 @@ options->allow_credentials.emplace_back(credential); - TestGetAssertionCallback callback_receiver; - authenticator->GetAssertion(std::move(options), - callback_receiver.callback()); - callback_receiver.WaitForCallback(); - - if (should_be_valid) { - EXPECT_EQ(AuthenticatorStatus::SUCCESS, callback_receiver.status()); - } else { - EXPECT_EQ(AuthenticatorStatus::NOT_ALLOWED_ERROR, - callback_receiver.status()); - } + EXPECT_EQ(AuthenticatorGetAssertion(std::move(options)).status, + should_be_valid ? AuthenticatorStatus::SUCCESS + : AuthenticatorStatus::NOT_ALLOWED_ERROR); } } @@ -1345,7 +1277,7 @@ // https://crbug.com/954355 EnableFeature(features::kWebAuthCable); - SimulateNavigation(GURL(kTestOrigin1)); + NavigateAndCommit(GURL(kTestOrigin1)); for (bool is_cable_device : {false, true}) { ResetVirtualDevice(); @@ -1371,63 +1303,41 @@ ASSERT_TRUE(virtual_device_factory_->mutable_state()->InjectRegistration( options->allow_credentials[0].id(), kTestRelyingPartyId)); - TestGetAssertionCallback callback_receiver; - mojo::Remote<blink::mojom::Authenticator> authenticator = - ConnectToAuthenticator(); - authenticator->GetAssertion(std::move(options), - callback_receiver.callback()); - callback_receiver.WaitForCallback(); - - if (is_cable_device) { - EXPECT_EQ(AuthenticatorStatus::SUCCESS, callback_receiver.status()); - } else { - // If a caBLE device is not simulated then silent requests should be used. - // The virtual device will return an error because - // |reject_silent_authentication_requests| is true and then it'll - // immediately resolve the touch request. - EXPECT_EQ(AuthenticatorStatus::NOT_ALLOWED_ERROR, - callback_receiver.status()); - } + // If a caBLE device is not simulated then silent requests should be used. + // The virtual device will return an error because + // |reject_silent_authentication_requests| is true and then it'll + // immediately resolve the touch request. + EXPECT_EQ(AuthenticatorGetAssertion(std::move(options)).status, + is_cable_device ? AuthenticatorStatus::SUCCESS + : AuthenticatorStatus::NOT_ALLOWED_ERROR); } } TEST_F(AuthenticatorImplTest, TestGetAssertionU2fDeviceBackwardsCompatibility) { - SimulateNavigation(GURL(kTestOrigin1)); + NavigateAndCommit(GURL(kTestOrigin1)); PublicKeyCredentialRequestOptionsPtr options = GetTestPublicKeyCredentialRequestOptions(); - TestGetAssertionCallback callback_receiver; - auto authenticator = ConnectToAuthenticator(); // Inject credential ID to the virtual device so that successful sign in is // possible. ASSERT_TRUE(virtual_device_factory_->mutable_state()->InjectRegistration( options->allow_credentials[0].id(), kTestRelyingPartyId)); - authenticator->GetAssertion(std::move(options), callback_receiver.callback()); - - callback_receiver.WaitForCallback(); - EXPECT_EQ(AuthenticatorStatus::SUCCESS, callback_receiver.status()); + EXPECT_EQ(AuthenticatorGetAssertion(std::move(options)).status, + AuthenticatorStatus::SUCCESS); } TEST_F(AuthenticatorImplTest, GetAssertionWithEmptyAllowCredentials) { - SimulateNavigation(GURL(kTestOrigin1)); + NavigateAndCommit(GURL(kTestOrigin1)); PublicKeyCredentialRequestOptionsPtr options = GetTestPublicKeyCredentialRequestOptions(); options->allow_credentials.clear(); - TestGetAssertionCallback callback_receiver; - auto authenticator = ConnectToAuthenticator(); - authenticator->GetAssertion(std::move(options), callback_receiver.callback()); - - task_environment()->FastForwardBy(kTestTimeout); - callback_receiver.WaitForCallback(); - EXPECT_EQ(AuthenticatorStatus::RESIDENT_CREDENTIALS_UNSUPPORTED, - callback_receiver.status()); + EXPECT_EQ(AuthenticatorGetAssertion(std::move(options)).status, + AuthenticatorStatus::RESIDENT_CREDENTIALS_UNSUPPORTED); } TEST_F(AuthenticatorImplTest, MakeCredentialAlreadyRegistered) { - SimulateNavigation(GURL(kTestOrigin1)); - mojo::Remote<blink::mojom::Authenticator> authenticator = - ConnectToAuthenticator(); + NavigateAndCommit(GURL(kTestOrigin1)); PublicKeyCredentialCreationOptionsPtr options = GetTestPublicKeyCredentialCreationOptions(); @@ -1436,17 +1346,12 @@ ASSERT_TRUE(virtual_device_factory_->mutable_state()->InjectRegistration( options->exclude_credentials[0].id(), kTestRelyingPartyId)); - TestMakeCredentialCallback callback_receiver; - authenticator->MakeCredential(std::move(options), - callback_receiver.callback()); - callback_receiver.WaitForCallback(); - - EXPECT_EQ(AuthenticatorStatus::CREDENTIAL_EXCLUDED, - callback_receiver.status()); + EXPECT_EQ(AuthenticatorMakeCredential(std::move(options)).status, + AuthenticatorStatus::CREDENTIAL_EXCLUDED); } TEST_F(AuthenticatorImplTest, MakeCredentialPendingRequest) { - SimulateNavigation(GURL(kTestOrigin1)); + NavigateAndCommit(GURL(kTestOrigin1)); mojo::Remote<blink::mojom::Authenticator> authenticator = ConnectToAuthenticator(); @@ -1473,7 +1378,7 @@ } TEST_F(AuthenticatorImplTest, GetAssertionPendingRequest) { - SimulateNavigation(GURL(kTestOrigin1)); + NavigateAndCommit(GURL(kTestOrigin1)); mojo::Remote<blink::mojom::Authenticator> authenticator = ConnectToAuthenticator(); @@ -1499,7 +1404,7 @@ } TEST_F(AuthenticatorImplTest, NavigationDuringOperation) { - SimulateNavigation(GURL(kTestOrigin1)); + NavigateAndCommit(GURL(kTestOrigin1)); mojo::Remote<blink::mojom::Authenticator> authenticator = ConnectToAuthenticator(); @@ -1517,7 +1422,7 @@ base::BindLambdaForTesting([&](device::VirtualFidoDevice* device) { base::ThreadTaskRunnerHandle::Get()->PostTask( FROM_HERE, base::BindLambdaForTesting( - [&]() { SimulateNavigation(GURL(kTestOrigin2)); })); + [&]() { NavigateAndCommit(GURL(kTestOrigin2)); })); return false; }); @@ -1526,37 +1431,27 @@ TEST_F(AuthenticatorImplTest, InvalidResponse) { virtual_device_factory_->mutable_state()->simulate_invalid_response = true; - SimulateNavigation(GURL(kTestOrigin1)); - - auto authenticator = ConnectToAuthenticator(); + NavigateAndCommit(GURL(kTestOrigin1)); { PublicKeyCredentialRequestOptionsPtr options = GetTestPublicKeyCredentialRequestOptions(); - TestGetAssertionCallback callback_receiver; - authenticator->GetAssertion(std::move(options), - callback_receiver.callback()); - task_environment()->FastForwardBy(kTestTimeout); - callback_receiver.WaitForCallback(); - EXPECT_EQ(AuthenticatorStatus::NOT_ALLOWED_ERROR, - callback_receiver.status()); + EXPECT_EQ( + AuthenticatorGetAssertionAndWaitForTimeout(std::move(options)).status, + AuthenticatorStatus::NOT_ALLOWED_ERROR); } { PublicKeyCredentialCreationOptionsPtr options = GetTestPublicKeyCredentialCreationOptions(); - TestMakeCredentialCallback callback_receiver; - authenticator->MakeCredential(std::move(options), - callback_receiver.callback()); - task_environment()->FastForwardBy(kTestTimeout); - callback_receiver.WaitForCallback(); - EXPECT_EQ(AuthenticatorStatus::NOT_ALLOWED_ERROR, - callback_receiver.status()); + EXPECT_EQ( + AuthenticatorMakeCredentialAndWaitForTimeout(std::move(options)).status, + AuthenticatorStatus::NOT_ALLOWED_ERROR); } } TEST_F(AuthenticatorImplTest, Ctap2AssertionWithUnknownCredential) { - SimulateNavigation(GURL(kTestOrigin1)); + NavigateAndCommit(GURL(kTestOrigin1)); for (bool return_immediate_invalid_credential_error : {false, true}) { SCOPED_TRACE(::testing::Message() @@ -1577,14 +1472,10 @@ }, &pressed); - TestGetAssertionCallback callback_receiver; - mojo::Remote<blink::mojom::Authenticator> authenticator = - ConnectToAuthenticator(); - authenticator->GetAssertion(GetTestPublicKeyCredentialRequestOptions(), - callback_receiver.callback()); - callback_receiver.WaitForCallback(); - EXPECT_EQ(AuthenticatorStatus::NOT_ALLOWED_ERROR, - callback_receiver.status()); + EXPECT_EQ( + AuthenticatorGetAssertion(GetTestPublicKeyCredentialRequestOptions()) + .status, + AuthenticatorStatus::NOT_ALLOWED_ERROR); // The user must have pressed the authenticator for the operation to // resolve. EXPECT_TRUE(pressed); @@ -1600,15 +1491,11 @@ ASSERT_TRUE(virtual_device_factory_->mutable_state()->InjectRegistration( options->allow_credentials[0].id(), kTestRelyingPartyId)); - SimulateNavigation(GURL(kTestOrigin1)); - auto authenticator = ConnectToAuthenticator(); - TestGetAssertionCallback callback_receiver; + NavigateAndCommit(GURL(kTestOrigin1)); - authenticator->GetAssertion(std::move(options), callback_receiver.callback()); - - task_environment()->FastForwardBy(kTestTimeout); - callback_receiver.WaitForCallback(); - EXPECT_EQ(AuthenticatorStatus::NOT_ALLOWED_ERROR, callback_receiver.status()); + EXPECT_EQ( + AuthenticatorGetAssertionAndWaitForTimeout(std::move(options)).status, + AuthenticatorStatus::NOT_ALLOWED_ERROR); } #if defined(OS_WIN) @@ -1620,7 +1507,7 @@ AuthenticatorEnvironmentImpl::GetInstance() ->ReplaceDefaultDiscoveryFactoryForTesting(std::move(discovery_factory)); - SimulateNavigation(GURL(kTestOrigin1)); + NavigateAndCommit(GURL(kTestOrigin1)); mojo::Remote<blink::mojom::Authenticator> authenticator = ConnectToAuthenticator(); @@ -1645,7 +1532,7 @@ #if defined(OS_CHROMEOS) TEST_F(AuthenticatorImplTest, IsUVPAA) { - SimulateNavigation(GURL(kTestOrigin1)); + NavigateAndCommit(GURL(kTestOrigin1)); for (const bool flag_enabled : {false, true}) { SCOPED_TRACE(::testing::Message() << "flag_enabled=" << flag_enabled); base::test::ScopedFeatureList scoped_feature_list; @@ -1712,10 +1599,7 @@ const std::string extension_origin = std::string("chrome-extension://") + kExtensionId; const std::string extension_page = extension_origin + "/test.html"; - SimulateNavigation(GURL(extension_page)); - - mojo::Remote<blink::mojom::Authenticator> authenticator = - ConnectToAuthenticator(); + NavigateAndCommit(GURL(extension_page)); std::vector<uint8_t> credential_id; { @@ -1723,12 +1607,10 @@ GetTestPublicKeyCredentialCreationOptions(); options->relying_party.id = kExtensionId; - TestMakeCredentialCallback callback_receiver; - authenticator->MakeCredential(std::move(options), - callback_receiver.callback()); - callback_receiver.WaitForCallback(); - ASSERT_EQ(AuthenticatorStatus::SUCCESS, callback_receiver.status()); - credential_id = callback_receiver.value()->info->raw_id; + MakeCredentialResult result = + AuthenticatorMakeCredential(std::move(options)); + EXPECT_EQ(result.status, AuthenticatorStatus::SUCCESS); + credential_id = result.response->info->raw_id; } { @@ -1738,11 +1620,8 @@ options->allow_credentials[0] = device::PublicKeyCredentialDescriptor( device::CredentialType::kPublicKey, std::move(credential_id)); - TestGetAssertionCallback callback_receiver; - authenticator->GetAssertion(std::move(options), - callback_receiver.callback()); - callback_receiver.WaitForCallback(); - ASSERT_EQ(AuthenticatorStatus::SUCCESS, callback_receiver.status()); + EXPECT_EQ(AuthenticatorGetAssertion(std::move(options)).status, + AuthenticatorStatus::SUCCESS); } } @@ -1941,9 +1820,6 @@ } void RunTestCases(const std::vector<TestCase>& tests) { - mojo::Remote<blink::mojom::Authenticator> authenticator = - ConnectToAuthenticator(); - for (size_t i = 0; i < tests.size(); i++) { const auto& test = tests[i]; if (test.attestation_consent != AttestationConsent::NOT_USED) { @@ -1967,11 +1843,10 @@ options->timeout = base::TimeDelta::FromSeconds(1); options->attestation = ConvertAttestationConveyancePreference(test.attestation_requested); - TestMakeCredentialCallback callback_receiver; - authenticator->MakeCredential(std::move(options), - callback_receiver.callback()); - callback_receiver.WaitForCallback(); - ASSERT_EQ(test.expected_status, callback_receiver.status()); + + MakeCredentialResult result = + AuthenticatorMakeCredential(std::move(options)); + EXPECT_EQ(result.status, test.expected_status); if (test.expected_status != AuthenticatorStatus::SUCCESS) { ASSERT_EQ(AttestationType::ANY, test.expected_attestation); @@ -1979,10 +1854,10 @@ } const device::AuthenticatorData auth_data = - AuthDataFromMakeCredentialResponse(callback_receiver.value()); + AuthDataFromMakeCredentialResponse(result.response); base::Optional<Value> attestation_value = - Reader::Read(callback_receiver.value()->attestation_object); + Reader::Read(result.response->attestation_object); ASSERT_TRUE(attestation_value); ASSERT_TRUE(attestation_value->is_map()); const auto& attestation = attestation_value->GetMap(); @@ -2322,29 +2197,21 @@ config.support_enterprise_attestation = true; virtual_device_factory_->SetCtap2Config(config); - mojo::Remote<blink::mojom::Authenticator> authenticator = - ConnectToAuthenticator(); - const auto options = GetTestPublicKeyCredentialCreationOptions(); - { - TestMakeCredentialCallback create_callback; - authenticator->MakeCredential(GetTestPublicKeyCredentialCreationOptions(), - create_callback.callback()); - base::RunLoop().RunUntilIdle(); - create_callback.WaitForCallback(); - EXPECT_EQ(create_callback.status(), AuthenticatorStatus::SUCCESS); + EXPECT_EQ( + AuthenticatorMakeCredential(GetTestPublicKeyCredentialCreationOptions()) + .status, + AuthenticatorStatus::SUCCESS); } config.always_return_enterprise_attestation = true; virtual_device_factory_->SetCtap2Config(config); { - TestMakeCredentialCallback create_callback; - authenticator->MakeCredential(GetTestPublicKeyCredentialCreationOptions(), - create_callback.callback()); - base::RunLoop().RunUntilIdle(); - create_callback.WaitForCallback(); - EXPECT_EQ(create_callback.status(), AuthenticatorStatus::NOT_ALLOWED_ERROR); + EXPECT_EQ( + AuthenticatorMakeCredential(GetTestPublicKeyCredentialCreationOptions()) + .status, + AuthenticatorStatus::NOT_ALLOWED_ERROR); } } @@ -2647,20 +2514,16 @@ test_client_.is_focused = false; NavigateAndCommit(GURL(kTestOrigin1)); - mojo::Remote<blink::mojom::Authenticator> authenticator = - ConnectToAuthenticator(); { - TestMakeCredentialCallback cb; TestRequestStartedCallback request_started; test_client_.action_callbacks_registered_callback = request_started.callback(); - authenticator->MakeCredential(GetTestPublicKeyCredentialCreationOptions(), - cb.callback()); - cb.WaitForCallback(); - - EXPECT_EQ(AuthenticatorStatus::NOT_FOCUSED, cb.status()); + EXPECT_EQ( + AuthenticatorMakeCredential(GetTestPublicKeyCredentialCreationOptions()) + .status, + AuthenticatorStatus::NOT_FOCUSED); EXPECT_FALSE(request_started.was_called()); } @@ -2677,15 +2540,12 @@ GetTestPublicKeyCredentialRequestOptions(); options->allow_credentials.emplace_back(credential); - TestGetAssertionCallback cb; TestRequestStartedCallback request_started; test_client_.action_callbacks_registered_callback = request_started.callback(); - authenticator->GetAssertion(std::move(options), cb.callback()); - cb.WaitForCallback(); - - EXPECT_EQ(AuthenticatorStatus::SUCCESS, cb.status()); + EXPECT_EQ(AuthenticatorGetAssertion(std::move(options)).status, + AuthenticatorStatus::SUCCESS); EXPECT_TRUE(request_started.was_called()); } } @@ -2693,34 +2553,25 @@ TEST_F(AuthenticatorContentBrowserClientTest, NullDelegate_RejectsWithPendingRequest) { test_client_.return_null_delegate = true; - NavigateAndCommit(GURL(kTestOrigin1)); - mojo::Remote<blink::mojom::Authenticator> authenticator = - ConnectToAuthenticator(); { PublicKeyCredentialCreationOptionsPtr options = GetTestPublicKeyCredentialCreationOptions(); - - TestMakeCredentialCallback cb; - authenticator->MakeCredential(std::move(options), cb.callback()); - cb.WaitForCallback(); - EXPECT_EQ(AuthenticatorStatus::PENDING_REQUEST, cb.status()); + EXPECT_EQ(AuthenticatorMakeCredential(std::move(options)).status, + AuthenticatorStatus::PENDING_REQUEST); } { PublicKeyCredentialRequestOptionsPtr options = GetTestPublicKeyCredentialRequestOptions(); - - TestGetAssertionCallback cb; - authenticator->GetAssertion(std::move(options), cb.callback()); - cb.WaitForCallback(); - EXPECT_EQ(AuthenticatorStatus::PENDING_REQUEST, cb.status()); + EXPECT_EQ(AuthenticatorGetAssertion(std::move(options)).status, + AuthenticatorStatus::PENDING_REQUEST); } } TEST_F(AuthenticatorContentBrowserClientTest, IsUVPAAOverride) { - SimulateNavigation(GURL(kTestOrigin1)); + NavigateAndCommit(GURL(kTestOrigin1)); mojo::Remote<blink::mojom::Authenticator> authenticator = ConnectToAuthenticator(); @@ -2737,7 +2588,7 @@ TEST_F(AuthenticatorContentBrowserClientTest, CryptotokenBypassesAttestationConsentPrompt) { - SimulateNavigation(GURL(kCryptotokenOrigin)); + NavigateAndCommit(GURL(kCryptotokenOrigin)); virtual_device_factory_->SetSupportedProtocol(device::ProtocolVersion::kU2f); PublicKeyCredentialCreationOptionsPtr options = @@ -2748,14 +2599,8 @@ options->attestation = device::AttestationConveyancePreference::kDirect; test_client_.attestation_consent = AttestationConsent::NOT_USED; - auto authenticator = ConnectToAuthenticator(); - TestMakeCredentialCallback callback_receiver; - authenticator->MakeCredential(std::move(options), - callback_receiver.callback()); - - callback_receiver.WaitForCallback(); - - EXPECT_EQ(AuthenticatorStatus::SUCCESS, callback_receiver.status()); + EXPECT_EQ(AuthenticatorMakeCredential(std::move(options)).status, + AuthenticatorStatus::SUCCESS); } TEST_F(AuthenticatorContentBrowserClientTest, @@ -2766,7 +2611,7 @@ // environment, Chrome's AuthenticatorRequestClientDelegate will show an // informative error and wait for the user to cancel the request.) EnableFeature(features::kWebAuthCable); - SimulateNavigation(GURL(kTestOrigin1)); + NavigateAndCommit(GURL(kTestOrigin1)); PublicKeyCredentialRequestOptionsPtr options = GetTestPublicKeyCredentialRequestOptions(); @@ -2777,13 +2622,8 @@ options->allow_credentials.emplace_back(device::CredentialType::kPublicKey, std::move(id), std::move(transports)); - TestGetAssertionCallback callback_receiver; - mojo::Remote<blink::mojom::Authenticator> authenticator = - ConnectToAuthenticator(); - authenticator->GetAssertion(std::move(options), callback_receiver.callback()); - callback_receiver.WaitForCallback(); - - EXPECT_EQ(AuthenticatorStatus::NOT_ALLOWED_ERROR, callback_receiver.status()); + EXPECT_EQ(AuthenticatorGetAssertion(std::move(options)).status, + AuthenticatorStatus::NOT_ALLOWED_ERROR); } class MockAuthenticatorRequestDelegateObserver @@ -2885,7 +2725,7 @@ AuthenticatorEnvironmentImpl::GetInstance() ->ReplaceDefaultDiscoveryFactoryForTesting(std::move(discovery_factory)); - SimulateNavigation(GURL(kTestOrigin1)); + NavigateAndCommit(GURL(kTestOrigin1)); PublicKeyCredentialRequestOptionsPtr options = GetTestPublicKeyCredentialRequestOptions(); TestGetAssertionCallback callback_receiver; @@ -2931,7 +2771,7 @@ AuthenticatorEnvironmentImpl::GetInstance() ->ReplaceDefaultDiscoveryFactoryForTesting( std::make_unique<device::FidoDiscoveryFactory>()); - SimulateNavigation(GURL(kTestOrigin1)); + NavigateAndCommit(GURL(kTestOrigin1)); FailureReasonCallbackReceiver failure_reason_receiver; auto mock_delegate = std::make_unique< @@ -2956,7 +2796,7 @@ TEST_F(AuthenticatorImplRequestDelegateTest, FailureReasonForDuplicateRegistration) { - SimulateNavigation(GURL(kTestOrigin1)); + NavigateAndCommit(GURL(kTestOrigin1)); FailureReasonCallbackReceiver failure_reason_receiver; auto mock_delegate = std::make_unique< @@ -2986,7 +2826,7 @@ TEST_F(AuthenticatorImplRequestDelegateTest, FailureReasonForMissingRegistration) { - SimulateNavigation(GURL(kTestOrigin1)); + NavigateAndCommit(GURL(kTestOrigin1)); FailureReasonCallbackReceiver failure_reason_receiver; auto mock_delegate = std::make_unique< @@ -3009,8 +2849,6 @@ TEST_F(AuthenticatorImplTest, Transports) { NavigateAndCommit(GURL(kTestOrigin1)); - mojo::Remote<blink::mojom::Authenticator> authenticator = - ConnectToAuthenticator(); for (auto protocol : {device::ProtocolVersion::kU2f, device::ProtocolVersion::kCtap2}) { @@ -3027,16 +2865,11 @@ blink::mojom::AuthenticatorTransport::NFC}})) { virtual_device_factory_->SetTransport(transport.first); - PublicKeyCredentialCreationOptionsPtr options = - GetTestPublicKeyCredentialCreationOptions(); - TestMakeCredentialCallback callback_receiver; - authenticator->MakeCredential(std::move(options), - callback_receiver.callback()); - callback_receiver.WaitForCallback(); - EXPECT_EQ(AuthenticatorStatus::SUCCESS, callback_receiver.status()); + MakeCredentialResult result = AuthenticatorMakeCredential(); + EXPECT_EQ(result.status, AuthenticatorStatus::SUCCESS); const std::vector<device::FidoTransportProtocol>& transports( - callback_receiver.value()->transports); + result.response->transports); ASSERT_EQ(1u, transports.size()); EXPECT_EQ(transport.first, transports[0]); } @@ -3055,19 +2888,15 @@ config.hmac_secret_support = authenticator_support; virtual_device_factory_->SetCtap2Config(config); - mojo::Remote<blink::mojom::Authenticator> authenticator = - ConnectToAuthenticator(); PublicKeyCredentialCreationOptionsPtr options = GetTestPublicKeyCredentialCreationOptions(); options->hmac_create_secret = include_extension; - TestMakeCredentialCallback callback_receiver; - authenticator->MakeCredential(std::move(options), - callback_receiver.callback()); - callback_receiver.WaitForCallback(); - EXPECT_EQ(AuthenticatorStatus::SUCCESS, callback_receiver.status()); + MakeCredentialResult result = + AuthenticatorMakeCredential(std::move(options)); + EXPECT_EQ(result.status, AuthenticatorStatus::SUCCESS); device::AuthenticatorData parsed_auth_data = - AuthDataFromMakeCredentialResponse(callback_receiver.value()); + AuthDataFromMakeCredentialResponse(result.response); // The virtual CTAP2 device always echos the hmac-secret extension on // registrations. Therefore, if |hmac_secret| was set above it should be @@ -3114,14 +2943,8 @@ ASSERT_TRUE(virtual_device_factory_->mutable_state()->InjectRegistration( options->exclude_credentials.back().id(), kTestRelyingPartyId)); } - TestMakeCredentialCallback callback_receiver; - mojo::Remote<blink::mojom::Authenticator> authenticator = - ConnectToAuthenticator(); - authenticator->MakeCredential(std::move(options), - callback_receiver.callback()); - callback_receiver.WaitForCallback(); - EXPECT_EQ(callback_receiver.status(), + EXPECT_EQ(AuthenticatorMakeCredential(std::move(options)).status, has_excluded_credential ? AuthenticatorStatus::CREDENTIAL_EXCLUDED : AuthenticatorStatus::SUCCESS); } @@ -3142,9 +2965,6 @@ config.reject_large_allow_and_exclude_lists = true; virtual_device_factory_->SetCtap2Config(config); - mojo::Remote<blink::mojom::Authenticator> authenticator = - ConnectToAuthenticator(); - PublicKeyCredentialRequestOptionsPtr options = GetTestPublicKeyCredentialRequestOptions(); options->allow_credentials = GetTestCredentials(/*num_credentials=*/10); @@ -3153,11 +2973,7 @@ options->allow_credentials.back().id(), kTestRelyingPartyId)); } - TestGetAssertionCallback callback_receiver; - authenticator->GetAssertion(std::move(options), - callback_receiver.callback()); - callback_receiver.WaitForCallback(); - EXPECT_EQ(callback_receiver.status(), + EXPECT_EQ(AuthenticatorGetAssertion(std::move(options)).status, has_allowed_credential ? AuthenticatorStatus::SUCCESS : AuthenticatorStatus::NOT_ALLOWED_ERROR); } @@ -3181,9 +2997,6 @@ config.reject_silent_authentication_requests = true; virtual_device_factory_->SetCtap2Config(config); - mojo::Remote<blink::mojom::Authenticator> authenticator = - ConnectToAuthenticator(); - auto test_credentials = GetTestCredentials(/*num_credentials=*/1); ASSERT_TRUE(virtual_device_factory_->mutable_state()->InjectRegistration( test_credentials.front().id(), kTestRelyingPartyId)); @@ -3192,12 +3005,8 @@ GetTestPublicKeyCredentialRequestOptions(); options->allow_credentials = std::move(test_credentials); - TestGetAssertionCallback callback_receiver; - authenticator->GetAssertion(std::move(options), - callback_receiver.callback()); - callback_receiver.WaitForCallback(); - - EXPECT_EQ(callback_receiver.status(), AuthenticatorStatus::SUCCESS); + EXPECT_EQ(AuthenticatorGetAssertion(std::move(options)).status, + AuthenticatorStatus::SUCCESS); } } @@ -3218,9 +3027,6 @@ config.reject_silent_authentication_requests = true; virtual_device_factory_->SetCtap2Config(config); - mojo::Remote<blink::mojom::Authenticator> authenticator = - ConnectToAuthenticator(); - auto test_credentials = GetTestCredentials( /*num_credentials=*/kBatchSize + (allow_list_fits_single_batch ? 0 : 1)); @@ -3231,12 +3037,7 @@ GetTestPublicKeyCredentialRequestOptions(); options->allow_credentials = std::move(test_credentials); - TestGetAssertionCallback callback_receiver; - authenticator->GetAssertion(std::move(options), - callback_receiver.callback()); - callback_receiver.WaitForCallback(); - - EXPECT_EQ(callback_receiver.status(), + EXPECT_EQ(AuthenticatorGetAssertion(std::move(options)).status, allow_list_fits_single_batch ? AuthenticatorStatus::SUCCESS : AuthenticatorStatus::NOT_ALLOWED_ERROR); @@ -3248,7 +3049,6 @@ // whether an authenticator returns credential information when the allowlist // only has a single entry. NavigateAndCommit(GURL(kTestOrigin1)); - auto authenticator = ConnectToAuthenticator(); for (const auto behavior : {device::VirtualCtap2Device::Config::IncludeCredential::ONLY_IF_NEEDED, @@ -3295,17 +3095,14 @@ GetTestPublicKeyCredentialRequestOptions(); options->allow_credentials = std::move(test_credentials); - TestGetAssertionCallback callback_receiver; - authenticator->GetAssertion(std::move(options), - callback_receiver.callback()); if (should_timeout) { - task_environment()->FastForwardBy(kTestTimeout); + EXPECT_EQ( + AuthenticatorGetAssertionAndWaitForTimeout(std::move(options)).status, + AuthenticatorStatus::NOT_ALLOWED_ERROR); + } else { + EXPECT_EQ(AuthenticatorGetAssertion(std::move(options)).status, + AuthenticatorStatus::SUCCESS); } - callback_receiver.WaitForCallback(); - - EXPECT_EQ(callback_receiver.status(), - should_timeout ? AuthenticatorStatus::NOT_ALLOWED_ERROR - : AuthenticatorStatus::SUCCESS); } } @@ -3327,9 +3124,6 @@ ASSERT_TRUE(virtual_device_factory_->mutable_state()->InjectRegistration( cred_id, kTestRelyingPartyId)); - mojo::Remote<blink::mojom::Authenticator> authenticator = - ConnectToAuthenticator(); - for (const bool has_app_id : {false, true}) { SCOPED_TRACE(has_app_id); virtual_device_factory_->mutable_state()->allow_list_sizes.clear(); @@ -3342,12 +3136,8 @@ options->allow_credentials = {device::PublicKeyCredentialDescriptor( device::CredentialType::kPublicKey, cred_id)}; - TestGetAssertionCallback callback_receiver; - authenticator->GetAssertion(std::move(options), - callback_receiver.callback()); - callback_receiver.WaitForCallback(); - EXPECT_EQ(AuthenticatorStatus::NOT_ALLOWED_ERROR, - callback_receiver.status()); + EXPECT_EQ(AuthenticatorGetAssertion(std::move(options)).status, + AuthenticatorStatus::NOT_ALLOWED_ERROR); const auto& allow_list_sizes = virtual_device_factory_->mutable_state()->allow_list_sizes; // No empty allow-list requests should have been made. @@ -3363,27 +3153,17 @@ config.add_extra_extension = true; virtual_device_factory_->SetCtap2Config(config); - mojo::Remote<blink::mojom::Authenticator> authenticator = - ConnectToAuthenticator(); - // Check that extra authenticator extensions are rejected when creating a // credential. - TestMakeCredentialCallback create_callback; - authenticator->MakeCredential(GetTestPublicKeyCredentialCreationOptions(), - create_callback.callback()); - create_callback.WaitForCallback(); - EXPECT_EQ(create_callback.status(), AuthenticatorStatus::NOT_ALLOWED_ERROR); + EXPECT_EQ(AuthenticatorMakeCredential().status, + AuthenticatorStatus::NOT_ALLOWED_ERROR); // Extensions should also be rejected when getting an assertion. PublicKeyCredentialRequestOptionsPtr assertion_options = GetTestPublicKeyCredentialRequestOptions(); ASSERT_TRUE(virtual_device_factory_->mutable_state()->InjectRegistration( assertion_options->allow_credentials.back().id(), kTestRelyingPartyId)); - TestGetAssertionCallback assertion_callback; - authenticator->GetAssertion(std::move(assertion_options), - assertion_callback.callback()); - assertion_callback.WaitForCallback(); - EXPECT_EQ(assertion_callback.status(), + EXPECT_EQ(AuthenticatorGetAssertion(std::move(assertion_options)).status, AuthenticatorStatus::NOT_ALLOWED_ERROR); } @@ -3394,26 +3174,16 @@ config.reject_all_extensions = true; virtual_device_factory_->SetCtap2Config(config); - mojo::Remote<blink::mojom::Authenticator> authenticator = - ConnectToAuthenticator(); - // Check that no unexpected client extensions are sent to the authenticator. - TestMakeCredentialCallback create_callback; - authenticator->MakeCredential(GetTestPublicKeyCredentialCreationOptions(), - create_callback.callback()); - create_callback.WaitForCallback(); - EXPECT_EQ(create_callback.status(), AuthenticatorStatus::SUCCESS); + EXPECT_EQ(AuthenticatorMakeCredential().status, AuthenticatorStatus::SUCCESS); // No extensions should be sent when getting an assertion either. PublicKeyCredentialRequestOptionsPtr assertion_options = GetTestPublicKeyCredentialRequestOptions(); ASSERT_TRUE(virtual_device_factory_->mutable_state()->InjectRegistration( assertion_options->allow_credentials.back().id(), kTestRelyingPartyId)); - TestGetAssertionCallback assertion_callback; - authenticator->GetAssertion(std::move(assertion_options), - assertion_callback.callback()); - assertion_callback.WaitForCallback(); - EXPECT_EQ(assertion_callback.status(), AuthenticatorStatus::SUCCESS); + EXPECT_EQ(AuthenticatorGetAssertion(std::move(assertion_options)).status, + AuthenticatorStatus::SUCCESS); } TEST_F(AuthenticatorImplTest, AndroidClientDataExtension) { @@ -3424,24 +3194,14 @@ config.support_android_client_data_extension = true; virtual_device_factory_->SetCtap2Config(config); - mojo::Remote<blink::mojom::Authenticator> authenticator = - ConnectToAuthenticator(); - - TestMakeCredentialCallback create_callback; - authenticator->MakeCredential(GetTestPublicKeyCredentialCreationOptions(), - create_callback.callback()); - create_callback.WaitForCallback(); - EXPECT_EQ(create_callback.status(), AuthenticatorStatus::SUCCESS); + EXPECT_EQ(AuthenticatorMakeCredential().status, AuthenticatorStatus::SUCCESS); PublicKeyCredentialRequestOptionsPtr assertion_options = GetTestPublicKeyCredentialRequestOptions(); ASSERT_TRUE(virtual_device_factory_->mutable_state()->InjectRegistration( assertion_options->allow_credentials.back().id(), kTestRelyingPartyId)); - TestGetAssertionCallback assertion_callback; - authenticator->GetAssertion(std::move(assertion_options), - assertion_callback.callback()); - assertion_callback.WaitForCallback(); - EXPECT_EQ(assertion_callback.status(), AuthenticatorStatus::SUCCESS); + EXPECT_EQ(AuthenticatorGetAssertion(std::move(assertion_options)).status, + AuthenticatorStatus::SUCCESS); } TEST_F(AuthenticatorImplTest, UnsolicitedAndroidClientDataExtensionReponse) { @@ -3452,26 +3212,16 @@ config.send_unsolicited_android_client_data_extension = true; virtual_device_factory_->SetCtap2Config(config); - mojo::Remote<blink::mojom::Authenticator> authenticator = - ConnectToAuthenticator(); - // An unsolicited androidClientData extension response results in an error. - TestMakeCredentialCallback create_callback; - authenticator->MakeCredential(GetTestPublicKeyCredentialCreationOptions(), - create_callback.callback()); - create_callback.WaitForCallback(); - EXPECT_EQ(create_callback.status(), AuthenticatorStatus::NOT_ALLOWED_ERROR); + EXPECT_EQ(AuthenticatorMakeCredential().status, + AuthenticatorStatus::NOT_ALLOWED_ERROR); // The same goes for getAssertion. PublicKeyCredentialRequestOptionsPtr assertion_options = GetTestPublicKeyCredentialRequestOptions(); ASSERT_TRUE(virtual_device_factory_->mutable_state()->InjectRegistration( assertion_options->allow_credentials.back().id(), kTestRelyingPartyId)); - TestGetAssertionCallback assertion_callback; - authenticator->GetAssertion(std::move(assertion_options), - assertion_callback.callback()); - assertion_callback.WaitForCallback(); - EXPECT_EQ(assertion_callback.status(), + EXPECT_EQ(AuthenticatorGetAssertion(std::move(assertion_options)).status, AuthenticatorStatus::NOT_ALLOWED_ERROR); } @@ -3506,18 +3256,13 @@ test_credentials.back().id(), kTestRelyingPartyId)); } - mojo::Remote<blink::mojom::Authenticator> authenticator = - ConnectToAuthenticator(); PublicKeyCredentialCreationOptionsPtr options = GetTestPublicKeyCredentialCreationOptions(); options->exclude_credentials = std::move(test_credentials); - TestMakeCredentialCallback callback; - authenticator->MakeCredential(std::move(options), callback.callback()); - callback.WaitForCallback(); - - EXPECT_EQ(callback.status(), authenticator_has_excluded_credential - ? AuthenticatorStatus::CREDENTIAL_EXCLUDED - : AuthenticatorStatus::SUCCESS); + EXPECT_EQ(AuthenticatorMakeCredential(std::move(options)).status, + authenticator_has_excluded_credential + ? AuthenticatorStatus::CREDENTIAL_EXCLUDED + : AuthenticatorStatus::SUCCESS); } } @@ -3527,9 +3272,6 @@ virtual_device_factory_->SetCtap2Config(config); NavigateAndCommit(GURL(kTestOrigin1)); - mojo::Remote<blink::mojom::Authenticator> authenticator = - ConnectToAuthenticator(); - static constexpr struct { device::CoseAlgorithmIdentifier algo; base::Optional<int> evp_id; @@ -3545,12 +3287,11 @@ GetTestPublicKeyCredentialCreationOptions(); options->public_key_parameters = GetTestPublicKeyCredentialParameters(static_cast<int32_t>(test.algo)); - TestMakeCredentialCallback callback; - authenticator->MakeCredential(std::move(options), callback.callback()); - callback.WaitForCallback(); - ASSERT_EQ(callback.status(), AuthenticatorStatus::SUCCESS); - const auto& response = callback.value(); + MakeCredentialResult result = + AuthenticatorMakeCredential(std::move(options)); + ASSERT_EQ(result.status, AuthenticatorStatus::SUCCESS); + const auto& response = result.response; EXPECT_EQ(response->public_key_algo, static_cast<int32_t>(test.algo)); EXPECT_FALSE(response->info->authenticator_data.empty()); @@ -3587,16 +3328,11 @@ return false; }); - auto authenticator = ConnectToAuthenticator(); PublicKeyCredentialCreationOptionsPtr options = GetTestPublicKeyCredentialCreationOptions(); - TestMakeCredentialCallback callback; - authenticator->MakeCredential(std::move(options), callback.callback()); - - task_environment()->FastForwardBy(kTestTimeout); - - callback.WaitForCallback(); - EXPECT_EQ(callback.status(), AuthenticatorStatus::NOT_ALLOWED_ERROR); + EXPECT_EQ( + AuthenticatorMakeCredentialAndWaitForTimeout(std::move(options)).status, + AuthenticatorStatus::NOT_ALLOWED_ERROR); } static constexpr char kTestPIN[] = "1234"; @@ -3718,17 +3454,15 @@ } } - static bool HasUV(const TestMakeCredentialCallback& callback) { - DCHECK_EQ(AuthenticatorStatus::SUCCESS, callback.status()); - return AuthDataFromMakeCredentialResponse(callback.value()) + static bool HasUV(const MakeCredentialAuthenticatorResponsePtr& response) { + return AuthDataFromMakeCredentialResponse(response) .obtained_user_verification(); } - static bool HasUV(const TestGetAssertionCallback& callback) { - DCHECK_EQ(AuthenticatorStatus::SUCCESS, callback.status()); + static bool HasUV(const GetAssertionAuthenticatorResponsePtr& response) { base::Optional<device::AuthenticatorData> auth_data = device::AuthenticatorData::DecodeAuthenticatorData( - callback.value()->info->authenticator_data); + response->info->authenticator_data); return auth_data->obtained_user_verification(); } @@ -3951,34 +3685,26 @@ NOTREACHED(); } - mojo::Remote<blink::mojom::Authenticator> authenticator = - ConnectToAuthenticator(); - TestMakeCredentialCallback callback_receiver; - authenticator->MakeCredential( - make_credential_options(kUVLevel[uv_level]), - callback_receiver.callback()); - callback_receiver.WaitForCallback(); + MakeCredentialResult result = AuthenticatorMakeCredential( + make_credential_options(kUVLevel[uv_level])); switch (expected[support_level][uv_level]) { case kFailure: - EXPECT_EQ(AuthenticatorStatus::NOT_ALLOWED_ERROR, - callback_receiver.status()); + EXPECT_EQ(AuthenticatorStatus::NOT_ALLOWED_ERROR, result.status); break; case kNoPIN: - EXPECT_EQ(AuthenticatorStatus::SUCCESS, - callback_receiver.status()); + EXPECT_EQ(AuthenticatorStatus::SUCCESS, result.status); EXPECT_EQ("", virtual_device_factory_->mutable_state()->pin); - EXPECT_FALSE(HasUV(callback_receiver)); + EXPECT_FALSE(HasUV(result.response)); break; case kSetPIN: case kUsePIN: - EXPECT_EQ(AuthenticatorStatus::SUCCESS, - callback_receiver.status()); + EXPECT_EQ(AuthenticatorStatus::SUCCESS, result.status); EXPECT_EQ(kTestPIN, virtual_device_factory_->mutable_state()->pin); - EXPECT_TRUE(HasUV(callback_receiver)); + EXPECT_TRUE(HasUV(result.response)); break; default: @@ -3996,13 +3722,8 @@ device::kMaxPinRetries; test_client_.expected = {{8, "wrong"}, {7, "wrong"}, {6, "wrong"}}; - mojo::Remote<blink::mojom::Authenticator> authenticator = - ConnectToAuthenticator(); - TestMakeCredentialCallback callback_receiver; - authenticator->MakeCredential(make_credential_options(), - callback_receiver.callback()); - callback_receiver.WaitForCallback(); - EXPECT_EQ(AuthenticatorStatus::NOT_ALLOWED_ERROR, callback_receiver.status()); + EXPECT_EQ(AuthenticatorMakeCredential(make_credential_options()).status, + AuthenticatorStatus::NOT_ALLOWED_ERROR); EXPECT_EQ(5, virtual_device_factory_->mutable_state()->pin_retries); EXPECT_TRUE(virtual_device_factory_->mutable_state()->soft_locked); ASSERT_TRUE(test_client_.failure_reason.has_value()); @@ -4015,13 +3736,8 @@ virtual_device_factory_->mutable_state()->pin_retries = 1; test_client_.expected = {{1, "wrong"}}; - mojo::Remote<blink::mojom::Authenticator> authenticator = - ConnectToAuthenticator(); - TestMakeCredentialCallback callback_receiver; - authenticator->MakeCredential(make_credential_options(), - callback_receiver.callback()); - callback_receiver.WaitForCallback(); - EXPECT_EQ(AuthenticatorStatus::NOT_ALLOWED_ERROR, callback_receiver.status()); + EXPECT_EQ(AuthenticatorMakeCredential().status, + AuthenticatorStatus::NOT_ALLOWED_ERROR); EXPECT_EQ(0, virtual_device_factory_->mutable_state()->pin_retries); ASSERT_TRUE(test_client_.failure_reason.has_value()); EXPECT_EQ(InterestingFailureReason::kHardPINBlock, @@ -4086,32 +3802,24 @@ NOTREACHED(); } - mojo::Remote<blink::mojom::Authenticator> authenticator = - ConnectToAuthenticator(); - TestGetAssertionCallback callback_receiver; - authenticator->GetAssertion( - get_credential_options(kUVLevel[uv_level]), - callback_receiver.callback()); - callback_receiver.WaitForCallback(); + GetAssertionResult result = AuthenticatorGetAssertion( + get_credential_options(kUVLevel[uv_level])); switch (expected[support_level][uv_level]) { case kFailure: - EXPECT_EQ(AuthenticatorStatus::NOT_ALLOWED_ERROR, - callback_receiver.status()); + EXPECT_EQ(AuthenticatorStatus::NOT_ALLOWED_ERROR, result.status); break; case kNoPIN: - EXPECT_EQ(AuthenticatorStatus::SUCCESS, - callback_receiver.status()); - EXPECT_FALSE(HasUV(callback_receiver)); + EXPECT_EQ(AuthenticatorStatus::SUCCESS, result.status); + EXPECT_FALSE(HasUV(result.response)); break; case kUsePIN: - EXPECT_EQ(AuthenticatorStatus::SUCCESS, - callback_receiver.status()); + EXPECT_EQ(AuthenticatorStatus::SUCCESS, result.status); EXPECT_EQ(kTestPIN, virtual_device_factory_->mutable_state()->pin); - EXPECT_TRUE(HasUV(callback_receiver)); + EXPECT_TRUE(HasUV(result.response)); break; default: @@ -4133,12 +3841,8 @@ options->allow_credentials[0].id(), kTestRelyingPartyId)); test_client_.expected = {{8, "wrong"}, {7, "wrong"}, {6, "wrong"}}; - mojo::Remote<blink::mojom::Authenticator> authenticator = - ConnectToAuthenticator(); - TestGetAssertionCallback callback_receiver; - authenticator->GetAssertion(std::move(options), callback_receiver.callback()); - callback_receiver.WaitForCallback(); - EXPECT_EQ(AuthenticatorStatus::NOT_ALLOWED_ERROR, callback_receiver.status()); + EXPECT_EQ(AuthenticatorGetAssertion(std::move(options)).status, + AuthenticatorStatus::NOT_ALLOWED_ERROR); EXPECT_EQ(5, virtual_device_factory_->mutable_state()->pin_retries); EXPECT_TRUE(virtual_device_factory_->mutable_state()->soft_locked); ASSERT_TRUE(test_client_.failure_reason.has_value()); @@ -4155,12 +3859,8 @@ options->allow_credentials[0].id(), kTestRelyingPartyId)); test_client_.expected = {{1, "wrong"}}; - mojo::Remote<blink::mojom::Authenticator> authenticator = - ConnectToAuthenticator(); - TestGetAssertionCallback callback_receiver; - authenticator->GetAssertion(std::move(options), callback_receiver.callback()); - callback_receiver.WaitForCallback(); - EXPECT_EQ(AuthenticatorStatus::NOT_ALLOWED_ERROR, callback_receiver.status()); + EXPECT_EQ(AuthenticatorGetAssertion(std::move(options)).status, + AuthenticatorStatus::NOT_ALLOWED_ERROR); EXPECT_EQ(0, virtual_device_factory_->mutable_state()->pin_retries); ASSERT_TRUE(test_client_.failure_reason.has_value()); EXPECT_EQ(InterestingFailureReason::kHardPINBlock, @@ -4168,7 +3868,7 @@ } TEST_F(PINAuthenticatorImplTest, MakeCredentialNoSupportedAlgorithm) { - SimulateNavigation(GURL(kTestOrigin1)); + NavigateAndCommit(GURL(kTestOrigin1)); for (int i = 0; i < 3; i++) { SCOPED_TRACE(i); @@ -4206,7 +3906,6 @@ device::ProtocolVersion::kU2f); } - auto authenticator = ConnectToAuthenticator(); PublicKeyCredentialCreationOptionsPtr options = GetTestPublicKeyCredentialCreationOptions(); // Set uv=discouraged so that U2F fallback is possible. @@ -4216,20 +3915,16 @@ GetTestPublicKeyCredentialParameters(static_cast<int32_t>( device::CoseAlgorithmIdentifier::kInvalidForTesting)); - TestMakeCredentialCallback callback_receiver; - authenticator->MakeCredential(std::move(options), - callback_receiver.callback()); - callback_receiver.WaitForCallback(); - EXPECT_EQ(expected_to_succeed ? AuthenticatorStatus::SUCCESS - : AuthenticatorStatus::NOT_ALLOWED_ERROR, - callback_receiver.status()); + EXPECT_EQ(AuthenticatorMakeCredential(std::move(options)).status, + expected_to_succeed ? AuthenticatorStatus::SUCCESS + : AuthenticatorStatus::NOT_ALLOWED_ERROR); } } TEST_F(PINAuthenticatorImplTest, PRFCreatedOnCTAP2) { // Check that credential creation requests that include the PRF extension use // CTAP2 if possible. - SimulateNavigation(GURL(kTestOrigin1)); + NavigateAndCommit(GURL(kTestOrigin1)); for (int i = 0; i < 3; i++) { SCOPED_TRACE(i); @@ -4270,13 +3965,8 @@ virtual_device_factory_->SetCtap2Config(config); - TestMakeCredentialCallback create_callback; - mojo::Remote<blink::mojom::Authenticator> authenticator = - ConnectToAuthenticator(); - authenticator->MakeCredential(std::move(options), - create_callback.callback()); - create_callback.WaitForCallback(); - EXPECT_EQ(AuthenticatorStatus::SUCCESS, create_callback.status()); + EXPECT_EQ(AuthenticatorMakeCredential(std::move(options)).status, + AuthenticatorStatus::SUCCESS); } } @@ -4335,9 +4025,6 @@ }; TEST_F(InternalUVAuthenticatorImplTest, MakeCredential) { - mojo::Remote<blink::mojom::Authenticator> authenticator = - ConnectToAuthenticator(); - for (const auto test_case : GetTestCases()) { ConfigureDevice(test_case); @@ -4350,17 +4037,14 @@ options->timeout = base::TimeDelta::FromMilliseconds(100); } - TestMakeCredentialCallback callback_receiver; - authenticator->MakeCredential(std::move(options), - callback_receiver.callback()); - callback_receiver.WaitForCallback(); + MakeCredentialResult result = + AuthenticatorMakeCredential(std::move(options)); if (should_timeout) { - EXPECT_EQ(AuthenticatorStatus::NOT_ALLOWED_ERROR, - callback_receiver.status()); + EXPECT_EQ(AuthenticatorStatus::NOT_ALLOWED_ERROR, result.status); } else { - EXPECT_EQ(AuthenticatorStatus::SUCCESS, callback_receiver.status()); - EXPECT_EQ(test_case.fingerprints_enrolled, HasUV(callback_receiver)); + EXPECT_EQ(AuthenticatorStatus::SUCCESS, result.status); + EXPECT_EQ(test_case.fingerprints_enrolled, HasUV(result.response)); } } } @@ -4368,9 +4052,6 @@ // Test falling back to PIN for devices that support internal user verification // but not uv token. TEST_F(InternalUVAuthenticatorImplTest, MakeCredentialFallBackToPin) { - mojo::Remote<blink::mojom::Authenticator> authenticator = - ConnectToAuthenticator(); - device::VirtualCtap2Device::Config config; config.internal_uv_support = true; config.pin_support = true; @@ -4384,33 +4065,26 @@ auto options = make_credential_options(device::UserVerificationRequirement::kRequired); - TestMakeCredentialCallback callback_receiver; - authenticator->MakeCredential(std::move(options), - callback_receiver.callback()); - callback_receiver.WaitForCallback(); + MakeCredentialResult result = AuthenticatorMakeCredential(std::move(options)); - EXPECT_EQ(AuthenticatorStatus::SUCCESS, callback_receiver.status()); - EXPECT_TRUE(HasUV(callback_receiver)); + EXPECT_EQ(AuthenticatorStatus::SUCCESS, result.status); + EXPECT_TRUE(HasUV(result.response)); EXPECT_TRUE(test_client_.collected_pin()); } TEST_F(InternalUVAuthenticatorImplTest, MakeCredentialCryptotoken) { - SimulateNavigation(GURL(kCryptotokenOrigin)); - auto authenticator = ConnectToAuthenticator(); + NavigateAndCommit(GURL(kCryptotokenOrigin)); for (const auto fingerprints_enrolled : {false, true}) { SCOPED_TRACE(::testing::Message() << "fingerprints_enrolled=" << fingerprints_enrolled); virtual_device_factory_->mutable_state()->fingerprints_enrolled = fingerprints_enrolled; - TestMakeCredentialCallback callback_receiver; - authenticator->MakeCredential( - make_credential_options( - device::UserVerificationRequirement::kPreferred), - callback_receiver.callback()); - - callback_receiver.WaitForCallback(); - EXPECT_EQ(AuthenticatorStatus::SUCCESS, callback_receiver.status()); + EXPECT_EQ(AuthenticatorMakeCredential( + make_credential_options( + device::UserVerificationRequirement::kPreferred)) + .status, + AuthenticatorStatus::SUCCESS); // The credential should have been created over U2F. for (const auto& registration : virtual_device_factory_->mutable_state()->registrations) { @@ -4422,9 +4096,6 @@ // Test making a credential on an authenticator that supports biometric // enrollment but has no fingerprints enrolled. TEST_F(InternalUVAuthenticatorImplTest, MakeCredentialInlineBioEnrollment) { - mojo::Remote<blink::mojom::Authenticator> authenticator = - ConnectToAuthenticator(); - device::VirtualCtap2Device::Config config; config.internal_uv_support = true; config.pin_support = true; @@ -4436,16 +4107,11 @@ virtual_device_factory_->mutable_state()->fingerprints_enrolled = false; virtual_device_factory_->SetCtap2Config(config); - auto options = - make_credential_options(device::UserVerificationRequirement::kRequired); + MakeCredentialResult result = AuthenticatorMakeCredential( + make_credential_options(device::UserVerificationRequirement::kRequired)); - TestMakeCredentialCallback callback_receiver; - authenticator->MakeCredential(std::move(options), - callback_receiver.callback()); - callback_receiver.WaitForCallback(); - - EXPECT_EQ(AuthenticatorStatus::SUCCESS, callback_receiver.status()); - EXPECT_TRUE(HasUV(callback_receiver)); + EXPECT_EQ(AuthenticatorStatus::SUCCESS, result.status); + EXPECT_TRUE(HasUV(result.response)); EXPECT_TRUE(test_client_.collected_pin()); EXPECT_TRUE(test_client_.did_bio_enrollment()); EXPECT_TRUE(virtual_device_factory_->mutable_state()->fingerprints_enrolled); @@ -4454,8 +4120,6 @@ // Test making a credential skipping biometric enrollment during credential // creation. TEST_F(InternalUVAuthenticatorImplTest, MakeCredentialSkipInlineBioEnrollment) { - mojo::Remote<blink::mojom::Authenticator> authenticator = - ConnectToAuthenticator(); test_client_.set_cancel_bio_enrollment(true); device::VirtualCtap2Device::Config config; @@ -4469,31 +4133,23 @@ virtual_device_factory_->mutable_state()->fingerprints_enrolled = false; virtual_device_factory_->SetCtap2Config(config); - auto options = - make_credential_options(device::UserVerificationRequirement::kRequired); + MakeCredentialResult result = AuthenticatorMakeCredential( + make_credential_options(device::UserVerificationRequirement::kRequired)); - TestMakeCredentialCallback callback_receiver; - authenticator->MakeCredential(std::move(options), - callback_receiver.callback()); - callback_receiver.WaitForCallback(); - - EXPECT_EQ(AuthenticatorStatus::SUCCESS, callback_receiver.status()); - EXPECT_TRUE(HasUV(callback_receiver)); + EXPECT_EQ(AuthenticatorStatus::SUCCESS, result.status); + EXPECT_TRUE(HasUV(result.response)); EXPECT_TRUE(test_client_.collected_pin()); EXPECT_TRUE(test_client_.did_bio_enrollment()); EXPECT_FALSE(virtual_device_factory_->mutable_state()->fingerprints_enrolled); } TEST_F(InternalUVAuthenticatorImplTest, GetAssertion) { - mojo::Remote<blink::mojom::Authenticator> authenticator = - ConnectToAuthenticator(); ASSERT_TRUE(virtual_device_factory_->mutable_state()->InjectRegistration( get_credential_options()->allow_credentials[0].id(), kTestRelyingPartyId)); for (const auto test_case : GetTestCases()) { ConfigureDevice(test_case); - auto options = get_credential_options(test_case.uv); // Without a fingerprint enrolled we assume that a UV=required request // cannot be satisfied by an authenticator that cannot do UV. It is // possible for a credential to be created without UV and then later @@ -4503,20 +4159,17 @@ !test_case.fingerprints_enrolled && test_case.uv == device::UserVerificationRequirement::kRequired; - TestGetAssertionCallback callback_receiver; - authenticator->GetAssertion(std::move(options), - callback_receiver.callback()); - callback_receiver.WaitForCallback(); + GetAssertionResult result = + AuthenticatorGetAssertion(get_credential_options(test_case.uv)); if (should_be_unrecognized) { - EXPECT_EQ(AuthenticatorStatus::NOT_ALLOWED_ERROR, - callback_receiver.status()); + EXPECT_EQ(AuthenticatorStatus::NOT_ALLOWED_ERROR, result.status); } else { - EXPECT_EQ(AuthenticatorStatus::SUCCESS, callback_receiver.status()); + EXPECT_EQ(AuthenticatorStatus::SUCCESS, result.status); EXPECT_EQ( test_case.fingerprints_enrolled && test_case.uv != device::UserVerificationRequirement::kDiscouraged, - HasUV(callback_receiver)); + HasUV(result.response)); } } } @@ -4524,9 +4177,6 @@ // Test falling back to PIN for devices that support internal user verification // but not uv token. TEST_F(InternalUVAuthenticatorImplTest, GetAssertionFallbackToPIN) { - mojo::Remote<blink::mojom::Authenticator> authenticator = - ConnectToAuthenticator(); - device::VirtualCtap2Device::Config config; config.internal_uv_support = true; config.pin_support = true; @@ -4541,20 +4191,16 @@ get_credential_options()->allow_credentials[0].id(), kTestRelyingPartyId)); - auto options = - get_credential_options(device::UserVerificationRequirement::kRequired); + GetAssertionResult result = AuthenticatorGetAssertion( + get_credential_options(device::UserVerificationRequirement::kRequired)); - TestGetAssertionCallback callback_receiver; - authenticator->GetAssertion(std::move(options), callback_receiver.callback()); - callback_receiver.WaitForCallback(); - - EXPECT_EQ(AuthenticatorStatus::SUCCESS, callback_receiver.status()); - EXPECT_TRUE(HasUV(callback_receiver)); + EXPECT_EQ(AuthenticatorStatus::SUCCESS, result.status); + EXPECT_TRUE(HasUV(result.response)); EXPECT_TRUE(test_client_.collected_pin()); } TEST_F(InternalUVAuthenticatorImplTest, GetAssertionCryptotoken) { - SimulateNavigation(GURL(kCryptotokenOrigin)); + NavigateAndCommit(GURL(kCryptotokenOrigin)); ASSERT_TRUE(virtual_device_factory_->mutable_state()->InjectRegistration( get_credential_options()->allow_credentials[0].id(), kTestRelyingPartyId)); @@ -4564,14 +4210,11 @@ << "fingerprints_enrolled=" << fingerprints_enrolled); virtual_device_factory_->mutable_state()->fingerprints_enrolled = fingerprints_enrolled; - auto authenticator = ConnectToAuthenticator(); - TestGetAssertionCallback callback_receiver; - authenticator->GetAssertion( - get_credential_options(device::UserVerificationRequirement::kPreferred), - callback_receiver.callback()); - - callback_receiver.WaitForCallback(); - EXPECT_EQ(AuthenticatorStatus::SUCCESS, callback_receiver.status()); + EXPECT_EQ(AuthenticatorGetAssertion( + get_credential_options( + device::UserVerificationRequirement::kPreferred)) + .status, + AuthenticatorStatus::SUCCESS); } } @@ -4592,8 +4235,6 @@ }; TEST_F(UVTokenAuthenticatorImplTest, GetAssertionUVToken) { - mojo::Remote<blink::mojom::Authenticator> authenticator = - ConnectToAuthenticator(); ASSERT_TRUE(virtual_device_factory_->mutable_state()->InjectRegistration( get_credential_options()->allow_credentials[0].id(), kTestRelyingPartyId)); @@ -4609,7 +4250,6 @@ device::UserVerificationRequirement::kRequired}) { SCOPED_TRACE(UVToString(uv)); - auto options = get_credential_options(uv); // Without a fingerprint enrolled we assume that a UV=required request // cannot be satisfied by an authenticator that cannot do UV. It is // possible for a credential to be created without UV and then later @@ -4619,19 +4259,16 @@ !fingerprints_enrolled && uv == device::UserVerificationRequirement::kRequired; - TestGetAssertionCallback callback_receiver; - authenticator->GetAssertion(std::move(options), - callback_receiver.callback()); - callback_receiver.WaitForCallback(); + GetAssertionResult result = + AuthenticatorGetAssertion(get_credential_options(uv)); if (should_be_unrecognized) { - EXPECT_EQ(AuthenticatorStatus::NOT_ALLOWED_ERROR, - callback_receiver.status()); + EXPECT_EQ(AuthenticatorStatus::NOT_ALLOWED_ERROR, result.status); } else { - EXPECT_EQ(AuthenticatorStatus::SUCCESS, callback_receiver.status()); + EXPECT_EQ(AuthenticatorStatus::SUCCESS, result.status); EXPECT_EQ(fingerprints_enrolled && uv != device::UserVerificationRequirement::kDiscouraged, - HasUV(callback_receiver)); + HasUV(result.response)); } } } @@ -4640,8 +4277,6 @@ // Test exhausting all internal user verification attempts on an authenticator // that does not support PINs. TEST_F(UVTokenAuthenticatorImplTest, GetAssertionUvFails) { - mojo::Remote<blink::mojom::Authenticator> authenticator = - ConnectToAuthenticator(); device::VirtualCtap2Device::Config config; config.ctap2_versions = {device::Ctap2Version::kCtap2_1}; config.internal_uv_support = true; @@ -4663,20 +4298,14 @@ return true; }); - auto options = get_credential_options(); - TestGetAssertionCallback callback_receiver; - authenticator->GetAssertion(std::move(options), callback_receiver.callback()); - callback_receiver.WaitForCallback(); - + EXPECT_EQ(AuthenticatorGetAssertion(get_credential_options()).status, + AuthenticatorStatus::NOT_ALLOWED_ERROR); EXPECT_EQ(0, expected_retries); - EXPECT_EQ(AuthenticatorStatus::NOT_ALLOWED_ERROR, callback_receiver.status()); } // Test exhausting all internal user verification attempts on an authenticator // that supports PINs. TEST_F(UVTokenAuthenticatorImplTest, GetAssertionFallBackToPin) { - mojo::Remote<blink::mojom::Authenticator> authenticator = - ConnectToAuthenticator(); device::VirtualCtap2Device::Config config; config.ctap2_versions = {device::Ctap2Version::kCtap2_1}; config.internal_uv_support = true; @@ -4699,22 +4328,16 @@ return true; }); - auto options = get_credential_options(); - TestGetAssertionCallback callback_receiver; - authenticator->GetAssertion(std::move(options), callback_receiver.callback()); - callback_receiver.WaitForCallback(); - + EXPECT_EQ(AuthenticatorGetAssertion(get_credential_options()).status, + AuthenticatorStatus::SUCCESS); EXPECT_EQ(0, expected_retries); EXPECT_TRUE(test_client_.collected_pin()); EXPECT_EQ(5, virtual_device_factory_->mutable_state()->uv_retries); - EXPECT_EQ(AuthenticatorStatus::SUCCESS, callback_receiver.status()); } // Tests that a device supporting UV token with UV blocked at the start of a get // assertion request gets a touch and then falls back to PIN. TEST_F(UVTokenAuthenticatorImplTest, GetAssertionUvBlockedFallBackToPin) { - mojo::Remote<blink::mojom::Authenticator> authenticator = - ConnectToAuthenticator(); device::VirtualCtap2Device::Config config; config.ctap2_versions = {device::Ctap2Version::kCtap2_1}; config.internal_uv_support = true; @@ -4730,20 +4353,13 @@ get_credential_options()->allow_credentials[0].id(), kTestRelyingPartyId)); - auto options = get_credential_options(); - TestGetAssertionCallback callback_receiver; - authenticator->GetAssertion(std::move(options), callback_receiver.callback()); - callback_receiver.WaitForCallback(); - + EXPECT_EQ(AuthenticatorGetAssertion(get_credential_options()).status, + AuthenticatorStatus::SUCCESS); EXPECT_TRUE(test_client_.collected_pin()); EXPECT_EQ(5, virtual_device_factory_->mutable_state()->uv_retries); - EXPECT_EQ(AuthenticatorStatus::SUCCESS, callback_receiver.status()); } TEST_F(UVTokenAuthenticatorImplTest, MakeCredentialUVToken) { - mojo::Remote<blink::mojom::Authenticator> authenticator = - ConnectToAuthenticator(); - for (const auto fingerprints_enrolled : {false, true}) { SCOPED_TRACE(::testing::Message() << "fingerprints_enrolled=" << fingerprints_enrolled); @@ -4755,26 +4371,21 @@ device::UserVerificationRequirement::kRequired}) { SCOPED_TRACE(UVToString(uv)); - auto options = make_credential_options(uv); // UV cannot be satisfied without fingerprints. const bool should_timeout = !fingerprints_enrolled && uv == device::UserVerificationRequirement::kRequired; - if (should_timeout) { - options->timeout = base::TimeDelta::FromMilliseconds(100); - } - - TestMakeCredentialCallback callback_receiver; - authenticator->MakeCredential(std::move(options), - callback_receiver.callback()); - callback_receiver.WaitForCallback(); if (should_timeout) { EXPECT_EQ(AuthenticatorStatus::NOT_ALLOWED_ERROR, - callback_receiver.status()); + AuthenticatorMakeCredentialAndWaitForTimeout( + make_credential_options(uv)) + .status); } else { - EXPECT_EQ(AuthenticatorStatus::SUCCESS, callback_receiver.status()); - EXPECT_EQ(fingerprints_enrolled, HasUV(callback_receiver)); + MakeCredentialResult result = + AuthenticatorMakeCredential(make_credential_options(uv)); + EXPECT_EQ(AuthenticatorStatus::SUCCESS, result.status); + EXPECT_EQ(fingerprints_enrolled, HasUV(result.response)); } } } @@ -4783,8 +4394,6 @@ // Test exhausting all internal user verification attempts on an authenticator // that does not support PINs. TEST_F(UVTokenAuthenticatorImplTest, MakeCredentialUvFails) { - mojo::Remote<blink::mojom::Authenticator> authenticator = - ConnectToAuthenticator(); device::VirtualCtap2Device::Config config; config.ctap2_versions = {device::Ctap2Version::kCtap2_1}; config.internal_uv_support = true; @@ -4806,21 +4415,14 @@ return true; }); - auto options = make_credential_options(); - TestMakeCredentialCallback callback_receiver; - authenticator->MakeCredential(std::move(options), - callback_receiver.callback()); - callback_receiver.WaitForCallback(); - + EXPECT_EQ(AuthenticatorMakeCredential(make_credential_options()).status, + AuthenticatorStatus::NOT_ALLOWED_ERROR); EXPECT_EQ(0, expected_retries); - EXPECT_EQ(AuthenticatorStatus::NOT_ALLOWED_ERROR, callback_receiver.status()); } // Test exhausting all internal user verification attempts on an authenticator // that supports PINs. TEST_F(UVTokenAuthenticatorImplTest, MakeCredentialFallBackToPin) { - mojo::Remote<blink::mojom::Authenticator> authenticator = - ConnectToAuthenticator(); device::VirtualCtap2Device::Config config; config.ctap2_versions = {device::Ctap2Version::kCtap2_1}; config.internal_uv_support = true; @@ -4843,23 +4445,16 @@ return true; }); - auto options = make_credential_options(); - TestMakeCredentialCallback callback_receiver; - authenticator->MakeCredential(std::move(options), - callback_receiver.callback()); - callback_receiver.WaitForCallback(); - + EXPECT_EQ(AuthenticatorMakeCredential(make_credential_options()).status, + AuthenticatorStatus::SUCCESS); EXPECT_EQ(0, expected_retries); EXPECT_TRUE(test_client_.collected_pin()); EXPECT_EQ(5, virtual_device_factory_->mutable_state()->uv_retries); - EXPECT_EQ(AuthenticatorStatus::SUCCESS, callback_receiver.status()); } // Tests that a device supporting UV token with UV blocked at the start of a get // assertion request gets a touch and then falls back to PIN. TEST_F(UVTokenAuthenticatorImplTest, MakeCredentialUvBlockedFallBackToPin) { - mojo::Remote<blink::mojom::Authenticator> authenticator = - ConnectToAuthenticator(); device::VirtualCtap2Device::Config config; config.ctap2_versions = {device::Ctap2Version::kCtap2_1}; config.internal_uv_support = true; @@ -4875,15 +4470,10 @@ get_credential_options()->allow_credentials[0].id(), kTestRelyingPartyId)); - auto options = make_credential_options(); - TestMakeCredentialCallback callback_receiver; - authenticator->MakeCredential(std::move(options), - callback_receiver.callback()); - callback_receiver.WaitForCallback(); - + EXPECT_EQ(AuthenticatorMakeCredential(make_credential_options()).status, + AuthenticatorStatus::SUCCESS); EXPECT_TRUE(test_client_.collected_pin()); EXPECT_EQ(5, virtual_device_factory_->mutable_state()->uv_retries); - EXPECT_EQ(AuthenticatorStatus::SUCCESS, callback_receiver.status()); } // ResidentKeyTestAuthenticatorRequestDelegate is a delegate that: @@ -5034,9 +4624,6 @@ }; TEST_F(ResidentKeyAuthenticatorImplTest, MakeCredential) { - mojo::Remote<blink::mojom::Authenticator> authenticator = - ConnectToAuthenticator(); - for (const bool internal_uv : {false, true}) { SCOPED_TRACE(::testing::Message() << "internal_uv=" << internal_uv); test_client_.might_create_resident_credential = false; @@ -5049,14 +4636,12 @@ virtual_device_factory_->mutable_state()->fingerprints_enrolled = true; } - TestMakeCredentialCallback callback_receiver; - authenticator->MakeCredential(make_credential_options(), - callback_receiver.callback()); - callback_receiver.WaitForCallback(); - EXPECT_EQ(AuthenticatorStatus::SUCCESS, callback_receiver.status()); + MakeCredentialResult result = + AuthenticatorMakeCredential(make_credential_options()); + EXPECT_EQ(AuthenticatorStatus::SUCCESS, result.status); EXPECT_TRUE(test_client_.might_create_resident_credential); - EXPECT_TRUE(HasUV(callback_receiver)); + EXPECT_TRUE(HasUV(result.response)); ASSERT_EQ(1u, virtual_device_factory_->mutable_state()->registrations.size()); const device::VirtualFidoDevice::RegistrationData& registration = @@ -5072,9 +4657,6 @@ } TEST_F(ResidentKeyAuthenticatorImplTest, StorageFull) { - mojo::Remote<blink::mojom::Authenticator> authenticator = - ConnectToAuthenticator(); - device::VirtualCtap2Device::Config config; config.resident_key_support = true; config.internal_uv_support = true; @@ -5087,11 +4669,8 @@ /*credential_id=*/{{4, 3, 2, 1}}, kTestRelyingPartyId, /*user_id=*/{{1, 1, 1, 1}}, "test@example.com", "Test User")); - TestMakeCredentialCallback callback_receiver; - authenticator->MakeCredential(make_credential_options(), - callback_receiver.callback()); - callback_receiver.WaitForCallback(); - EXPECT_EQ(AuthenticatorStatus::NOT_ALLOWED_ERROR, callback_receiver.status()); + EXPECT_EQ(AuthenticatorMakeCredential(make_credential_options()).status, + AuthenticatorStatus::NOT_ALLOWED_ERROR); ASSERT_TRUE(test_client_.failure_reason.has_value()); EXPECT_EQ(AuthenticatorRequestClientDelegate::InterestingFailureReason:: kStorageFull, @@ -5103,18 +4682,15 @@ /*credential_id=*/{{4, 3, 2, 1}}, kTestRelyingPartyId, /*user_id=*/{{1, 2, 3, 4}}, base::nullopt, base::nullopt)); - mojo::Remote<blink::mojom::Authenticator> authenticator = - ConnectToAuthenticator(); - TestGetAssertionCallback callback_receiver; // |SelectAccount| should not be called when there's only a single response // with no identifying user info because the UI is bad in that case: we can // only display the single choice of "Unknown user". test_client_.expected_accounts = "<invalid>"; - authenticator->GetAssertion(get_credential_options(), - callback_receiver.callback()); - callback_receiver.WaitForCallback(); - EXPECT_EQ(AuthenticatorStatus::SUCCESS, callback_receiver.status()); - EXPECT_TRUE(HasUV(callback_receiver)); + GetAssertionResult result = + AuthenticatorGetAssertion(get_credential_options()); + + EXPECT_EQ(AuthenticatorStatus::SUCCESS, result.status); + EXPECT_TRUE(HasUV(result.response)); } TEST_F(ResidentKeyAuthenticatorImplTest, GetAssertionSingleWithPII) { @@ -5122,17 +4698,13 @@ /*credential_id=*/{{4, 3, 2, 1}}, kTestRelyingPartyId, /*user_id=*/{{1, 2, 3, 4}}, base::nullopt, "Test User")); - mojo::Remote<blink::mojom::Authenticator> authenticator = - ConnectToAuthenticator(); - TestGetAssertionCallback callback_receiver; // |SelectAccount| should be called when PII is available. test_client_.expected_accounts = "01020304::Test User"; test_client_.selected_user_id = {1, 2, 3, 4}; - authenticator->GetAssertion(get_credential_options(), - callback_receiver.callback()); - callback_receiver.WaitForCallback(); - EXPECT_EQ(AuthenticatorStatus::SUCCESS, callback_receiver.status()); - EXPECT_TRUE(HasUV(callback_receiver)); + GetAssertionResult result = + AuthenticatorGetAssertion(get_credential_options()); + EXPECT_EQ(AuthenticatorStatus::SUCCESS, result.status); + EXPECT_TRUE(HasUV(result.response)); } TEST_F(ResidentKeyAuthenticatorImplTest, GetAssertionMulti) { @@ -5143,18 +4715,16 @@ /*credential_id=*/{{4, 3, 2, 2}}, kTestRelyingPartyId, /*user_id=*/{{5, 6, 7, 8}}, "test2@example.com", "Test User 2")); - mojo::Remote<blink::mojom::Authenticator> authenticator = - ConnectToAuthenticator(); - TestGetAssertionCallback callback_receiver; test_client_.expected_accounts = "01020304:test@example.com:Test User/" "05060708:test2@example.com:Test User 2"; test_client_.selected_user_id = {1, 2, 3, 4}; - authenticator->GetAssertion(get_credential_options(), - callback_receiver.callback()); - callback_receiver.WaitForCallback(); - EXPECT_EQ(AuthenticatorStatus::SUCCESS, callback_receiver.status()); - EXPECT_TRUE(HasUV(callback_receiver)); + + GetAssertionResult result = + AuthenticatorGetAssertion(get_credential_options()); + + EXPECT_EQ(AuthenticatorStatus::SUCCESS, result.status); + EXPECT_TRUE(HasUV(result.response)); } TEST_F(ResidentKeyAuthenticatorImplTest, GetAssertionUVDiscouraged) { @@ -5169,21 +4739,19 @@ /*credential_id=*/{{4, 3, 2, 1}}, kTestRelyingPartyId, /*user_id=*/{{1, 2, 3, 4}}, base::nullopt, base::nullopt)); - mojo::Remote<blink::mojom::Authenticator> authenticator = - ConnectToAuthenticator(); - TestGetAssertionCallback callback_receiver; // |SelectAccount| should not be called when there's only a single response // without identifying information. test_client_.expected_accounts = "<invalid>"; PublicKeyCredentialRequestOptionsPtr options(get_credential_options()); options->user_verification = device::UserVerificationRequirement::kDiscouraged; - authenticator->GetAssertion(std::move(options), callback_receiver.callback()); - callback_receiver.WaitForCallback(); - EXPECT_EQ(AuthenticatorStatus::SUCCESS, callback_receiver.status()); + + GetAssertionResult result = AuthenticatorGetAssertion(std::move(options)); + + EXPECT_EQ(AuthenticatorStatus::SUCCESS, result.status); // The UV=discouraged should have been ignored for a resident-credential // request. - EXPECT_TRUE(HasUV(callback_receiver)); + EXPECT_TRUE(HasUV(result.response)); } static const char* ProtectionPolicyDescription( @@ -5212,9 +4780,6 @@ } TEST_F(ResidentKeyAuthenticatorImplTest, CredProtectRegistration) { - mojo::Remote<blink::mojom::Authenticator> authenticator = - ConnectToAuthenticator(); - const auto UNSPECIFIED = blink::mojom::ProtectionPolicy::UNSPECIFIED; const auto NONE = blink::mojom::ProtectionPolicy::NONE; const auto UV_OR_CRED = @@ -5303,14 +4868,12 @@ test.uv ? device::UserVerificationRequirement::kRequired : device::UserVerificationRequirement::kDiscouraged); - TestMakeCredentialCallback callback_receiver; - authenticator->MakeCredential(std::move(options), - callback_receiver.callback()); - callback_receiver.WaitForCallback(); + AuthenticatorStatus status = + AuthenticatorMakeCredential(std::move(options)).status; switch (test.expected_outcome) { case kOk: { - EXPECT_EQ(AuthenticatorStatus::SUCCESS, callback_receiver.status()); + EXPECT_EQ(AuthenticatorStatus::SUCCESS, status); ASSERT_EQ( 1u, virtual_device_factory_->mutable_state()->registrations.size()); const device::CredProtect result = @@ -5335,12 +4898,10 @@ break; } case kNonsense: - EXPECT_EQ(AuthenticatorStatus::PROTECTION_POLICY_INCONSISTENT, - callback_receiver.status()); + EXPECT_EQ(AuthenticatorStatus::PROTECTION_POLICY_INCONSISTENT, status); break; case kNotAllow: - EXPECT_EQ(AuthenticatorStatus::NOT_ALLOWED_ERROR, - callback_receiver.status()); + EXPECT_EQ(AuthenticatorStatus::NOT_ALLOWED_ERROR, status); break; default: NOTREACHED(); @@ -5352,9 +4913,6 @@ // Some authenticators are expected to set the credProtect extension ad // libitum. Therefore we should only require that the returned extension is at // least as restrictive as requested, but perhaps not exactly equal. - mojo::Remote<blink::mojom::Authenticator> authenticator = - ConnectToAuthenticator(); - constexpr blink::mojom::ProtectionPolicy kMojoLevels[] = { blink::mojom::ProtectionPolicy::NONE, blink::mojom::ProtectionPolicy::UV_OR_CRED_ID_REQUIRED, @@ -5385,13 +4943,11 @@ ->SetUserVerificationRequirementForTesting( device::UserVerificationRequirement::kRequired); - TestMakeCredentialCallback callback_receiver; - authenticator->MakeCredential(std::move(options), - callback_receiver.callback()); - callback_receiver.WaitForCallback(); + AuthenticatorStatus status = + AuthenticatorMakeCredential(std::move(options)).status; if (requested_level <= forced_level) { - EXPECT_EQ(AuthenticatorStatus::SUCCESS, callback_receiver.status()); + EXPECT_EQ(AuthenticatorStatus::SUCCESS, status); ASSERT_EQ( 1u, virtual_device_factory_->mutable_state()->registrations.size()); const base::Optional<device::CredProtect> result = @@ -5400,8 +4956,7 @@ ->second.protection; EXPECT_EQ(*result, config.force_cred_protect); } else { - EXPECT_EQ(AuthenticatorStatus::NOT_ALLOWED_ERROR, - callback_receiver.status()); + EXPECT_EQ(AuthenticatorStatus::NOT_ALLOWED_ERROR, status); } } } @@ -5410,9 +4965,6 @@ TEST_F(ResidentKeyAuthenticatorImplTest, AuthenticatorDefaultCredProtect) { // Some authenticators may have a default credProtect level that isn't // kUVOptional. This has complex interactions that are tested here. - mojo::Remote<blink::mojom::Authenticator> authenticator = - ConnectToAuthenticator(); - constexpr struct { blink::mojom::ProtectionPolicy requested_level; device::CredProtect authenticator_default; @@ -5480,12 +5032,8 @@ options->authenticator_selection->SetUserVerificationRequirementForTesting( device::UserVerificationRequirement::kRequired); - TestMakeCredentialCallback callback_receiver; - authenticator->MakeCredential(std::move(options), - callback_receiver.callback()); - callback_receiver.WaitForCallback(); - - EXPECT_EQ(AuthenticatorStatus::SUCCESS, callback_receiver.status()); + EXPECT_EQ(AuthenticatorMakeCredential(std::move(options)).status, + AuthenticatorStatus::SUCCESS); ASSERT_EQ(1u, virtual_device_factory_->mutable_state()->registrations.size()); const device::CredProtect result = virtual_device_factory_->mutable_state() @@ -5512,9 +5060,6 @@ ->registrations.begin() ->second.protection = device::CredProtect::kUVRequired; - mojo::Remote<blink::mojom::Authenticator> authenticator = - ConnectToAuthenticator(); - TestGetAssertionCallback callback_receiver; // |SelectAccount| should not be called when there's only a single response. test_client_.expected_accounts = "<invalid>"; @@ -5522,10 +5067,10 @@ options->allow_credentials = GetTestCredentials(5); options->allow_credentials[0].GetIdForTesting() = {4, 3, 2, 1}; - authenticator->GetAssertion(std::move(options), callback_receiver.callback()); - callback_receiver.WaitForCallback(); - EXPECT_EQ(AuthenticatorStatus::SUCCESS, callback_receiver.status()); - EXPECT_TRUE(HasUV(callback_receiver)); + GetAssertionResult result = AuthenticatorGetAssertion(std::move(options)); + + EXPECT_EQ(AuthenticatorStatus::SUCCESS, result.status); + EXPECT_TRUE(HasUV(result.response)); } TEST_F(ResidentKeyAuthenticatorImplTest, WithAppIDExtension) { @@ -5540,9 +5085,6 @@ /*credential_id=*/{{4, 3, 2, 1}}, kTestRelyingPartyId, /*user_id=*/{{1, 2, 3, 4}}, base::nullopt, base::nullopt)); - mojo::Remote<blink::mojom::Authenticator> authenticator = - ConnectToAuthenticator(); - TestGetAssertionCallback callback_receiver; // |SelectAccount| should not be called when there's only a single response // without identifying information. test_client_.expected_accounts = "<invalid>"; @@ -5550,10 +5092,10 @@ PublicKeyCredentialRequestOptionsPtr options = get_credential_options(); options->appid = kTestOrigin1; - authenticator->GetAssertion(std::move(options), callback_receiver.callback()); - callback_receiver.WaitForCallback(); - EXPECT_EQ(AuthenticatorStatus::SUCCESS, callback_receiver.status()); - EXPECT_TRUE(HasUV(callback_receiver)); + GetAssertionResult result = AuthenticatorGetAssertion(std::move(options)); + + EXPECT_EQ(AuthenticatorStatus::SUCCESS, result.status); + EXPECT_TRUE(HasUV(result.response)); } #if defined(OS_WIN) @@ -5583,14 +5125,7 @@ blink::mojom::ProtectionPolicy::UV_OR_CRED_ID_REQUIRED; options->enforce_protection_policy = true; - TestMakeCredentialCallback callback_receiver; - mojo::Remote<blink::mojom::Authenticator> authenticator = - ConnectToAuthenticator(); - authenticator->MakeCredential(std::move(options), - callback_receiver.callback()); - callback_receiver.WaitForCallback(); - - EXPECT_EQ(callback_receiver.status(), + EXPECT_EQ(AuthenticatorMakeCredential(std::move(options)).status, supports_cred_protect ? AuthenticatorStatus::SUCCESS : AuthenticatorStatus::NOT_ALLOWED_ERROR); } @@ -5601,7 +5136,6 @@ NavigateAndCommit(GURL(kTestOrigin1)); base::Optional<device::PublicKeyCredentialDescriptor> credential; - mojo::Remote<blink::mojom::Authenticator> authenticator; for (bool hmac_secret_supported : {false, true}) { // Setting the PRF extension on an authenticator that doesn't support it // should cause the extension to be echoed, but with enabled=false. @@ -5613,7 +5147,6 @@ config.pin_support = true; config.resident_key_support = true; virtual_device_factory_->SetCtap2Config(config); - authenticator = ConnectToAuthenticator(); PublicKeyCredentialCreationOptionsPtr options = GetTestPublicKeyCredentialCreationOptions(); @@ -5623,25 +5156,22 @@ options->user.id = {1, 2, 3, 4}; options->user.name = "name"; options->user.display_name = "displayName"; - TestMakeCredentialCallback create_callback; - authenticator->MakeCredential(std::move(options), - create_callback.callback()); - create_callback.WaitForCallback(); - EXPECT_EQ(AuthenticatorStatus::SUCCESS, create_callback.status()); + MakeCredentialResult result = + AuthenticatorMakeCredential(std::move(options)); + EXPECT_EQ(result.status, AuthenticatorStatus::SUCCESS); - ASSERT_TRUE(create_callback.value()->echo_prf); - ASSERT_EQ(hmac_secret_supported, create_callback.value()->prf); + ASSERT_TRUE(result.response->echo_prf); + ASSERT_EQ(result.response->prf, hmac_secret_supported); if (hmac_secret_supported) { device::AuthenticatorData auth_data = - AuthDataFromMakeCredentialResponse(create_callback.value()); + AuthDataFromMakeCredentialResponse(result.response); credential.emplace(device::CredentialType::kPublicKey, auth_data.GetCredentialId()); } } - auto assertion = [&credential, &authenticator]( - std::vector<blink::mojom::PRFValuesPtr> inputs, + auto assertion = [&](std::vector<blink::mojom::PRFValuesPtr> inputs, unsigned allow_list_size = 1) -> blink::mojom::PRFValuesPtr { PublicKeyCredentialRequestOptionsPtr options = @@ -5658,14 +5188,12 @@ options->allow_credentials.push_back(*credential); } - TestGetAssertionCallback assert_callback; - authenticator->GetAssertion(std::move(options), assert_callback.callback()); - assert_callback.WaitForCallback(); + GetAssertionResult result = AuthenticatorGetAssertion(std::move(options)); - EXPECT_EQ(AuthenticatorStatus::SUCCESS, assert_callback.status()); - CHECK(assert_callback.value()->prf_results); - CHECK(!assert_callback.value()->prf_results->id); - return std::move(assert_callback.value()->prf_results); + EXPECT_EQ(result.status, AuthenticatorStatus::SUCCESS); + CHECK(result.response->prf_results); + CHECK(!result.response->prf_results->id); + return std::move(result.response->prf_results); }; const std::vector<uint8_t> salt1(32, 1); @@ -5942,7 +5470,7 @@ }; TEST_F(TouchIdAuthenticatorImplTest, IsUVPAA) { - SimulateNavigation(GURL(kTestOrigin1)); + NavigateAndCommit(GURL(kTestOrigin1)); mojo::Remote<blink::mojom::Authenticator> authenticator = ConnectToAuthenticator();
diff --git a/content/child/runtime_features.cc b/content/child/runtime_features.cc index 8e99f16..f7e3a39 100644 --- a/content/child/runtime_features.cc +++ b/content/child/runtime_features.cc
@@ -378,7 +378,6 @@ kUseFeatureState}, {"FeaturePolicyForClientHints", features::kFeaturePolicyForClientHints, kUseFeatureState}, - {"FlexGaps", blink::features::kFlexGaps, kEnableOnly}, {"FontAccess", blink::features::kFontAccess, kUseFeatureState}, {"FontSrcLocalMatching", features::kFontSrcLocalMatching, kUseFeatureState},
diff --git a/content/public/common/BUILD.gn b/content/public/common/BUILD.gn index 33df376..b745fe9 100644 --- a/content/public/common/BUILD.gn +++ b/content/public/common/BUILD.gn
@@ -309,7 +309,6 @@ "browser_controls_state.mojom", "drop_data.mojom", "fullscreen_video_element.mojom", - "performance_manager/v8_per_frame_memory.mojom", "resource_usage_reporter.mojom", "was_activated_option.mojom", "webplugininfo.mojom",
diff --git a/content/renderer/BUILD.gn b/content/renderer/BUILD.gn index 484b5e0..a5403d6e 100644 --- a/content/renderer/BUILD.gn +++ b/content/renderer/BUILD.gn
@@ -189,8 +189,6 @@ "navigation_state.h", "net_info_helper.cc", "net_info_helper.h", - "performance_manager/v8_per_frame_memory_reporter_impl.cc", - "performance_manager/v8_per_frame_memory_reporter_impl.h", "peripheral_content_heuristic.cc", "peripheral_content_heuristic.h", "queue_message_swap_promise.cc",
diff --git a/content/renderer/browser_exposed_renderer_interfaces.cc b/content/renderer/browser_exposed_renderer_interfaces.cc index 8267a81..47f8a897 100644 --- a/content/renderer/browser_exposed_renderer_interfaces.cc +++ b/content/renderer/browser_exposed_renderer_interfaces.cc
@@ -33,10 +33,6 @@ #include "mojo/public/cpp/bindings/self_owned_receiver.h" #include "v8/include/v8.h" -#if !defined(OS_ANDROID) -#include "content/renderer/performance_manager/v8_per_frame_memory_reporter_impl.h" -#endif - namespace content { namespace { @@ -225,14 +221,6 @@ binders->Add(base::BindRepeating(&CreateFrameFactory), base::ThreadTaskRunnerHandle::Get()); -#if !defined(OS_ANDROID) - // Currently nothing on Android samples V8PerFrameMemory, so only initialize - // the reporter on desktop to save memory. - binders->Add(base::BindRepeating( - &performance_manager::V8PerFrameMemoryReporterImpl::Create), - base::SequencedTaskRunnerHandle::Get()); -#endif - GetContentClient()->renderer()->ExposeInterfacesToBrowser(binders); }
diff --git a/content/renderer/performance_manager/v8_per_frame_memory_reporter_impl.h b/content/renderer/performance_manager/v8_per_frame_memory_reporter_impl.h deleted file mode 100644 index 8b67670..0000000 --- a/content/renderer/performance_manager/v8_per_frame_memory_reporter_impl.h +++ /dev/null
@@ -1,24 +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 CONTENT_RENDERER_PERFORMANCE_MANAGER_V8_PER_FRAME_MEMORY_REPORTER_IMPL_H_ -#define CONTENT_RENDERER_PERFORMANCE_MANAGER_V8_PER_FRAME_MEMORY_REPORTER_IMPL_H_ - -#include "content/public/common/performance_manager/v8_per_frame_memory.mojom.h" - -namespace performance_manager { - -// Exposes V8 per-frame associated memory metrics to the browser. -class V8PerFrameMemoryReporterImpl : public mojom::V8PerFrameMemoryReporter { - public: - static void Create( - mojo::PendingReceiver<mojom::V8PerFrameMemoryReporter> receiver); - - void GetPerFrameV8MemoryUsageData( - GetPerFrameV8MemoryUsageDataCallback callback) override; -}; - -} // namespace performance_manager - -#endif // CONTENT_RENDERER_PERFORMANCE_MANAGER_V8_PER_FRAME_MEMORY_REPORTER_IMPL_H_
diff --git a/content/shell/browser/shell_devtools_bindings.cc b/content/shell/browser/shell_devtools_bindings.cc index c77d805..e52411eb 100644 --- a/content/shell/browser/shell_devtools_bindings.cc +++ b/content/shell/browser/shell_devtools_bindings.cc
@@ -352,7 +352,7 @@ std::string name; if (!params->GetString(0, &name)) return; - preferences_.RemoveWithoutPathExpansion(name, nullptr); + preferences_.RemoveKey(name); } else if (method == "requestFileSystems") { web_contents()->GetMainFrame()->ExecuteJavaScriptForTests( base::ASCIIToUTF16("DevToolsAPI.fileSystemsLoaded([]);"),
diff --git a/device/base/features.cc b/device/base/features.cc index 4e26ee5..bf9a135 100644 --- a/device/base/features.cc +++ b/device/base/features.cc
@@ -8,9 +8,12 @@ namespace device { -#if defined(OS_WIN) +#if defined(OS_MAC) || defined(OS_WIN) const base::Feature kNewUsbBackend{"NewUsbBackend", base::FEATURE_DISABLED_BY_DEFAULT}; +#endif // defined(OS_MAC) || defined(OS_WIN) + +#if defined(OS_WIN) const base::Feature kNewBLEWinImplementation{"NewBLEWinImplementation", base::FEATURE_ENABLED_BY_DEFAULT};
diff --git a/device/base/features.h b/device/base/features.h index 7c24b68..e017e52 100644 --- a/device/base/features.h +++ b/device/base/features.h
@@ -12,8 +12,11 @@ namespace device { -#if defined(OS_WIN) +#if defined(OS_WIN) || defined(OS_MAC) DEVICE_BASE_EXPORT extern const base::Feature kNewUsbBackend; +#endif // defined(OS_WIN) || defined(OS_MAC) + +#if defined(OS_WIN) DEVICE_BASE_EXPORT extern const base::Feature kNewBLEWinImplementation; DEVICE_BASE_EXPORT extern const base::Feature kNewBLEGattSessionHandling; #endif // defined(OS_WIN)
diff --git a/fuchsia/runners/cast/data/receiver.html b/fuchsia/runners/cast/data/receiver.html index 628b9dd..29a914e1 100644 --- a/fuchsia/runners/cast/data/receiver.html +++ b/fuchsia/runners/cast/data/receiver.html
@@ -19,9 +19,16 @@ <body> <video src="data:cast_streaming_receiver" autoplay> - <!-- TODO(crbug.com/1087528): This should not be necessary. Figure out why - autoplay is not enough here. --> <script> + // The Cast Streaming session must stop when the stream is no longer visible. crbug.com/1111886 + document.addEventListener('visibilitychange', function(e) { + if (document.hidden) { + window.close(); + } + }); + + // TODO(crbug.com/1087528): This should not be necessary. Figure out why + // autoplay is not enough here. var video = document.querySelector('video'); video.play(); </script>
diff --git a/gpu/command_buffer/common/shared_image_usage.h b/gpu/command_buffer/common/shared_image_usage.h index ba0148e..ff788eb 100644 --- a/gpu/command_buffer/common/shared_image_usage.h +++ b/gpu/command_buffer/common/shared_image_usage.h
@@ -39,6 +39,10 @@ SHARED_IMAGE_USAGE_VIDEO_DECODE = 1 << 10, // Image will be used as a WebGPU swapbuffer SHARED_IMAGE_USAGE_WEBGPU_SWAP_CHAIN_TEXTURE = 1 << 11, + // Image will be used by VideoToolbox on macOS. If this is set, then + // GLImage::DisableInUseByWindowServer should be called on any GLImages that + // use this SharedImage. + SHARED_IMAGE_USAGE_MACOS_VIDEO_TOOLBOX = 1 << 12, }; } // namespace gpu
diff --git a/gpu/command_buffer/service/shared_image_backing_gl_texture.cc b/gpu/command_buffer/service/shared_image_backing_gl_texture.cc index efffee5..bb72877 100644 --- a/gpu/command_buffer/service/shared_image_backing_gl_texture.cc +++ b/gpu/command_buffer/service/shared_image_backing_gl_texture.cc
@@ -281,6 +281,8 @@ #endif // DCHECK_IS_ON() if (color_space.IsValid()) image->SetColorSpace(color_space); + if (usage & SHARED_IMAGE_USAGE_MACOS_VIDEO_TOOLBOX) + image->DisableInUseByWindowServer(); viz::ResourceFormat format = viz::GetResourceFormat(buffer_format); const bool for_framebuffer_attachment = @@ -522,6 +524,8 @@ level_info_internal_format = image->GetInternalFormat(); if (color_space.IsValid()) image->SetColorSpace(color_space); + if (usage & SHARED_IMAGE_USAGE_MACOS_VIDEO_TOOLBOX) + image->DisableInUseByWindowServer(); } InitializeGLTextureParams params;
diff --git a/infra/config/PRESUBMIT.py b/infra/config/PRESUBMIT.py index 409b54a4..358d02e 100644 --- a/infra/config/PRESUBMIT.py +++ b/infra/config/PRESUBMIT.py
@@ -9,23 +9,6 @@ """ -# TODO(crbug.com/1109980): Remove this once the production freeze is over, which -# is expected to be on August 3rd. -def EnforceProductionFreeze(input_api, output_api): - footers = input_api.change.GitFootersFromDescription() - if footers.get('Ignore-Cq-Freeze'): - return [] - - message = """ - Your change is modifying files which may impact the Chromium CQ. The Chromium - CQ is currently in a production freeze. Please get a review from someone in - the //infra/OWNERS file (preferably a trooper), and then add the - 'Ignore-CQ-Freeze' git footer to your CL. See https://crbug.com/1109980 for - more details. - """ - return [output_api.PresubmitError(message)] - - def _CommonChecks(input_api, output_api): commands = [] @@ -58,7 +41,6 @@ results.extend(input_api.RunTests(commands)) results.extend(input_api.canned_checks.CheckChangedLUCIConfigs( input_api, output_api)) - results.extend(EnforceProductionFreeze(input_api, output_api)) return results
diff --git a/infra/config/dev/dev.star b/infra/config/dev/dev.star index 5ef01fa4..439be9c 100755 --- a/infra/config/dev/dev.star +++ b/infra/config/dev/dev.star
@@ -42,4 +42,16 @@ logo = 'https://storage.googleapis.com/chrome-infra-public/logo/chromium.svg', ) +# An all-purpose public realm. +luci.realm( + name = 'public', + bindings = [ + luci.binding( + roles = 'role/buildbucket.reader', + groups = 'all', + ), + # Other roles are inherited from @root which grants them to group:all. + ], +) + exec('//dev/subprojects/chromium/subproject.star')
diff --git a/infra/config/generated/cr-buildbucket.cfg b/infra/config/generated/cr-buildbucket.cfg index 87343bcd..c524068b 100644 --- a/infra/config/generated/cr-buildbucket.cfg +++ b/infra/config/generated/cr-buildbucket.cfg
@@ -10676,6 +10676,35 @@ } } builders { + name: "linux-lacros-builder-rel" + swarming_host: "chromium-swarm.appspot.com" + swarming_tags: "vpython:native-python-wrapper" + dimensions: "builderless:1" + dimensions: "cores:8" + dimensions: "cpu:x86-64" + dimensions: "os:Ubuntu-16.04" + dimensions: "pool:luci.chromium.ci" + dimensions: "ssd:0" + exe { + cipd_package: "infra/recipe_bundles/chromium.googlesource.com/chromium/tools/build" + cipd_version: "refs/heads/master" + cmd: "recipes" + } + properties: "{\"$build/chromium_tests\":{\"bucketed_triggers\":true},\"$build/goma\":{\"enable_ats\":true,\"rpc_extra_params\":\"?prod\",\"server_host\":\"goma.chromium.org\"},\"$kitchen\":{\"devshell\":true,\"git_auth\":true},\"mastername\":\"chromium.chromiumos\",\"recipe\":\"chromium\"}" + execution_timeout_secs: 10800 + build_numbers: YES + service_account: "chromium-ci-builder@chops-service-accounts.iam.gserviceaccount.com" + resultdb { + enable: true + bq_exports { + project: "luci-resultdb" + dataset: "chromium" + table: "ci_test_results" + test_results {} + } + } + } + builders { name: "linux-lacros-tester-fyi-rel" swarming_host: "chromium-swarm.appspot.com" swarming_tags: "vpython:native-python-wrapper" @@ -10705,6 +10734,35 @@ } } builders { + name: "linux-lacros-tester-rel" + swarming_host: "chromium-swarm.appspot.com" + swarming_tags: "vpython:native-python-wrapper" + dimensions: "builderless:1" + dimensions: "cores:8" + dimensions: "cpu:x86-64" + dimensions: "os:Ubuntu-16.04" + dimensions: "pool:luci.chromium.ci" + dimensions: "ssd:0" + exe { + cipd_package: "infra/recipe_bundles/chromium.googlesource.com/chromium/tools/build" + cipd_version: "refs/heads/master" + cmd: "recipes" + } + properties: "{\"$build/chromium_tests\":{\"bucketed_triggers\":true},\"$build/goma\":{\"enable_ats\":true,\"rpc_extra_params\":\"?prod\",\"server_host\":\"goma.chromium.org\"},\"$kitchen\":{\"devshell\":true,\"git_auth\":true},\"mastername\":\"chromium.chromiumos\",\"recipe\":\"chromium\"}" + execution_timeout_secs: 10800 + build_numbers: YES + service_account: "chromium-ci-builder@chops-service-accounts.iam.gserviceaccount.com" + resultdb { + enable: true + bq_exports { + project: "luci-resultdb" + dataset: "chromium" + table: "ci_test_results" + test_results {} + } + } + } + builders { name: "linux-official" swarming_host: "chromium-swarm.appspot.com" swarming_tags: "vpython:native-python-wrapper"
diff --git a/infra/config/generated/luci-milo.cfg b/infra/config/generated/luci-milo.cfg index 45645ec..8a90fead 100644 --- a/infra/config/generated/luci-milo.cfg +++ b/infra/config/generated/luci-milo.cfg
@@ -331,6 +331,16 @@ short_name: "dbg" } builders { + name: "buildbucket/luci.chromium.ci/linux-lacros-builder-rel" + category: "chromium.chromiumos|default" + short_name: "lcr" + } + builders { + name: "buildbucket/luci.chromium.ci/linux-lacros-tester-rel" + category: "chromium.chromiumos|default" + short_name: "lcr" + } + builders { name: "buildbucket/luci.chromium.ci/chromeos-arm-generic-rel" category: "chromium.chromiumos|simple|release" short_name: "arm" @@ -2288,6 +2298,16 @@ short_name: "dbg" } builders { + name: "buildbucket/luci.chromium.ci/linux-lacros-builder-rel" + category: "chromium.chromiumos|default" + short_name: "lcr" + } + builders { + name: "buildbucket/luci.chromium.ci/linux-lacros-tester-rel" + category: "chromium.chromiumos|default" + short_name: "lcr" + } + builders { name: "buildbucket/luci.chromium.ci/chromeos-arm-generic-rel" category: "chromium.chromiumos|simple|release" short_name: "arm" @@ -6416,6 +6436,16 @@ short_name: "dbg" } builders { + name: "buildbucket/luci.chromium.ci/linux-lacros-builder-rel" + category: "default" + short_name: "lcr" + } + builders { + name: "buildbucket/luci.chromium.ci/linux-lacros-tester-rel" + category: "default" + short_name: "lcr" + } + builders { name: "buildbucket/luci.chromium.ci/chromeos-arm-generic-rel" category: "simple|release" short_name: "arm"
diff --git a/infra/config/generated/luci-scheduler.cfg b/infra/config/generated/luci-scheduler.cfg index d04ad1b..a2ec036 100644 --- a/infra/config/generated/luci-scheduler.cfg +++ b/infra/config/generated/luci-scheduler.cfg
@@ -8926,6 +8926,16 @@ } } job { + id: "ci-linux-lacros-builder-rel" + realm: "ci" + acl_sets: "ci" + buildbucket { + server: "cr-buildbucket.appspot.com" + bucket: "luci.chromium.ci" + builder: "linux-lacros-builder-rel" + } +} +job { id: "ci-linux-lacros-tester-fyi-rel" realm: "ci" acls { @@ -8940,6 +8950,20 @@ } } job { + id: "ci-linux-lacros-tester-rel" + realm: "ci" + acls { + role: TRIGGERER + granted_to: "chromium-ci-builder@chops-service-accounts.iam.gserviceaccount.com" + } + acl_sets: "ci" + buildbucket { + server: "cr-buildbucket.appspot.com" + bucket: "luci.chromium.ci" + builder: "linux-lacros-tester-rel" + } +} +job { id: "ci-linux-official" realm: "ci" acl_sets: "ci" @@ -11928,6 +11952,16 @@ } } job { + id: "linux-lacros-builder-rel" + realm: "ci" + acl_sets: "ci" + buildbucket { + server: "cr-buildbucket.appspot.com" + bucket: "luci.chromium.ci" + builder: "linux-lacros-builder-rel" + } +} +job { id: "linux-lacros-tester-fyi-rel" realm: "ci" acls { @@ -11942,6 +11976,20 @@ } } job { + id: "linux-lacros-tester-rel" + realm: "ci" + acls { + role: TRIGGERER + granted_to: "chromium-ci-builder@chops-service-accounts.iam.gserviceaccount.com" + } + acl_sets: "ci" + buildbucket { + server: "cr-buildbucket.appspot.com" + bucket: "luci.chromium.ci" + builder: "linux-lacros-tester-rel" + } +} +job { id: "linux-official" realm: "ci" acl_sets: "ci" @@ -13000,6 +13048,7 @@ triggers: "linux-fieldtrial-rel" triggers: "linux-gcc-rel" triggers: "linux-lacros-builder-fyi-rel" + triggers: "linux-lacros-builder-rel" triggers: "ci-linux-official" triggers: "ci-linux-ozone-rel" triggers: "linux-perfetto-rel"
diff --git a/infra/config/generated/realms-dev.cfg b/infra/config/generated/realms-dev.cfg index d496291..c05f7f0 100644 --- a/infra/config/generated/realms-dev.cfg +++ b/infra/config/generated/realms-dev.cfg
@@ -47,3 +47,10 @@ principals: "user:luci-scheduler-dev@appspot.gserviceaccount.com" } } +realms { + name: "public" + bindings { + role: "role/buildbucket.reader" + principals: "group:all" + } +}
diff --git a/infra/config/generated/realms.cfg b/infra/config/generated/realms.cfg index bc00b54..36ed79d8 100644 --- a/infra/config/generated/realms.cfg +++ b/infra/config/generated/realms.cfg
@@ -145,6 +145,13 @@ } } realms { + name: "public" + bindings { + role: "role/buildbucket.reader" + principals: "group:all" + } +} +realms { name: "try" bindings { role: "role/buildbucket.builderServiceAccount"
diff --git a/infra/config/main.star b/infra/config/main.star index bdb9273..d2801f4 100755 --- a/infra/config/main.star +++ b/infra/config/main.star
@@ -90,6 +90,18 @@ tree_closing_enabled = True, ) +# An all-purpose public realm. +luci.realm( + name = 'public', + bindings = [ + luci.binding( + roles = 'role/buildbucket.reader', + groups = 'all', + ), + # Other roles are inherited from @root which grants them to group:all. + ], +) + exec('//recipes.star') exec('//notifiers.star')
diff --git a/infra/config/subprojects/chromium/ci.star b/infra/config/subprojects/chromium/ci.star index 80498136..3722db1 100644 --- a/infra/config/subprojects/chromium/ci.star +++ b/infra/config/subprojects/chromium/ci.star
@@ -587,6 +587,28 @@ main_console_view = settings.main_console_name, ) +ci.chromiumos_builder( + name = 'linux-lacros-builder-rel', + console_view_entry = ci.console_view_entry( + category = 'default', + short_name = 'lcr', + ), + main_console_view = settings.main_console_name, + # TODO(crbug.com/1104291): Enable tree closing. + tree_closing = False, +) + +ci.chromiumos_builder( + name = 'linux-lacros-tester-rel', + console_view_entry = ci.console_view_entry( + category = 'default', + short_name = 'lcr', + ), + main_console_view = settings.main_console_name, + triggered_by = ['linux-lacros-builder-rel'], + # TODO(crbug.com/1104291): Enable tree closing. + tree_closing = False, +) ci.dawn_builder( name = 'Dawn Linux x64 DEPS Builder',
diff --git a/ios/build/bots/scripts/test_apps.py b/ios/build/bots/scripts/test_apps.py index 6b7a5c7..6b01824e 100644 --- a/ios/build/bots/scripts/test_apps.py +++ b/ios/build/bots/scripts/test_apps.py
@@ -429,8 +429,7 @@ 'TestHostPath': '%s' % self.test_app_path, 'TestingEnvironmentVariables': { 'DYLD_INSERT_LIBRARIES': - '__PLATFORMS__/iPhoneOS.platform/Developer/usr/lib/' - 'libXCTestBundleInject.dylib', + '__TESTHOST__/Frameworks/libXCTestBundleInject.dylib', 'DYLD_LIBRARY_PATH': '__PLATFORMS__/iPhoneOS.platform/Developer/Library', 'DYLD_FRAMEWORK_PATH':
diff --git a/ios/chrome/app/application_delegate/BUILD.gn b/ios/chrome/app/application_delegate/BUILD.gn index be36affd..cca72bc 100644 --- a/ios/chrome/app/application_delegate/BUILD.gn +++ b/ios/chrome/app/application_delegate/BUILD.gn
@@ -134,10 +134,16 @@ ] } +source_set("app_state_header") { + configs += [ "//build/config/compiler:enable_arc" ] + sources = [ "app_state.h" ] + public_deps = [ "//ios/chrome/browser/ui/scoped_ui_blocker" ] +} + source_set("application_delegate_internal") { configs += [ "//build/config/compiler:enable_arc" ] + public_deps = [ ":app_state_header" ] sources = [ - "app_state.h", "app_state.mm", "browser_launcher.h", "metrics_mediator.h", @@ -204,7 +210,6 @@ "//ui/base", "//url", ] - public_deps = [ "//ios/chrome/browser/ui/scoped_ui_blocker" ] frameworks = [ "CoreSpotlight.framework",
diff --git a/ios/chrome/app/application_delegate/app_state.h b/ios/chrome/app/application_delegate/app_state.h index 9e9d41e1..c0d157b 100644 --- a/ios/chrome/app/application_delegate/app_state.h +++ b/ios/chrome/app/application_delegate/app_state.h
@@ -32,6 +32,9 @@ // Called after the app exits safe mode. - (void)appStateDidExitSafeMode:(AppState*)appState; +// Called when |AppState.lastTappedWindow| changes. +- (void)appState:(AppState*)appState lastTappedWindowChanged:(UIWindow*)window; + @end // Represents the application state and responds to application state changes @@ -66,6 +69,9 @@ // is shown. When there is no blocking UI shown in any scene, this is nil. @property(nonatomic, weak, readonly) SceneState* sceneShowingBlockingUI; +// The last window which received a tap. +@property(nonatomic, weak) UIWindow* lastTappedWindow; + // Saves the launchOptions to be used from -newTabFromLaunchOptions. If the // application is in background, initialize the browser to basic. If not, launch // the browser.
diff --git a/ios/chrome/app/application_delegate/app_state.mm b/ios/chrome/app/application_delegate/app_state.mm index ff2b75d..4177c91 100644 --- a/ios/chrome/app/application_delegate/app_state.mm +++ b/ios/chrome/app/application_delegate/app_state.mm
@@ -564,6 +564,14 @@ } } +- (void)setLastTappedWindow:(UIWindow*)window { + if (_lastTappedWindow == window) { + return; + } + _lastTappedWindow = window; + [self.observers appState:self lastTappedWindowChanged:window]; +} + #pragma mark - SafeModeCoordinatorDelegate Implementation - (void)coordinatorDidExitSafeMode:(nonnull SafeModeCoordinator*)coordinator {
diff --git a/ios/chrome/browser/autofill/BUILD.gn b/ios/chrome/browser/autofill/BUILD.gn index 5951b9c..6389a64 100644 --- a/ios/chrome/browser/autofill/BUILD.gn +++ b/ios/chrome/browser/autofill/BUILD.gn
@@ -164,6 +164,7 @@ "//components/keyed_service/core", "//components/password_manager/ios", "//components/security_state/ios", + "//ios/chrome/app/application_delegate:app_state_header", "//ios/chrome/browser", "//ios/chrome/browser/browser_state:test_support", "//ios/chrome/browser/infobars",
diff --git a/ios/chrome/browser/autofill/autofill_controller_unittest.mm b/ios/chrome/browser/autofill/autofill_controller_unittest.mm index 1122a953..e00b91d 100644 --- a/ios/chrome/browser/autofill/autofill_controller_unittest.mm +++ b/ios/chrome/browser/autofill/autofill_controller_unittest.mm
@@ -285,7 +285,8 @@ delegate:nil webStateList:NULL personalDataManager:NULL - passwordStore:nullptr]; + passwordStore:nullptr + appState:nil]; [accessory_mediator_ injectWebState:web_state()]; [accessory_mediator_ injectProvider:suggestion_controller_];
diff --git a/ios/chrome/browser/autofill/form_suggestion_controller_unittest.mm b/ios/chrome/browser/autofill/form_suggestion_controller_unittest.mm index 98b5373..d23dda6 100644 --- a/ios/chrome/browser/autofill/form_suggestion_controller_unittest.mm +++ b/ios/chrome/browser/autofill/form_suggestion_controller_unittest.mm
@@ -15,6 +15,7 @@ #import "components/autofill/ios/form_util/form_activity_observer_bridge.h" #include "components/autofill/ios/form_util/form_activity_params.h" #include "components/autofill/ios/form_util/test_form_activity_tab_helper.h" +#import "ios/chrome/app/application_delegate/app_state.h" #import "ios/chrome/browser/autofill/form_suggestion_view.h" #import "ios/chrome/browser/ui/autofill/form_input_accessory/form_input_accessory_consumer.h" #import "ios/chrome/browser/ui/autofill/form_input_accessory/form_input_accessory_mediator.h" @@ -175,7 +176,7 @@ JsSuggestionManager:mock_js_suggestion_manager_]; [suggestion_controller_ setWebViewProxy:mock_web_view_proxy_]; - id mock_consumer_ = [OCMockObject + id mock_consumer = [OCMockObject niceMockForProtocol:@protocol(FormInputAccessoryConsumer)]; // Mock the consumer to verify the suggestion views. void (^mockShow)(NSInvocation*) = ^(NSInvocation* invocation) { @@ -183,7 +184,7 @@ [invocation getArgument:&suggestions atIndex:2]; received_suggestions_ = suggestions; }; - [[[mock_consumer_ stub] andDo:mockShow] + [[[mock_consumer stub] andDo:mockShow] showAccessorySuggestions:[OCMArg any] suggestionClient:[OCMArg any]]; @@ -191,14 +192,25 @@ void (^mockRestore)(NSInvocation*) = ^(NSInvocation* invocation) { received_suggestions_ = nil; }; - [[[mock_consumer_ stub] andDo:mockRestore] restoreOriginalKeyboardView]; + [[[mock_consumer stub] andDo:mockRestore] restoreOriginalKeyboardView]; + + id mock_window = OCMClassMock([UIWindow class]); + + id mock_web_state_view = OCMClassMock([UIView class]); + OCMStub([mock_web_state_view window]).andReturn(mock_window); + + test_web_state_.SetView(mock_web_state_view); + + id mock_app_state = OCMClassMock([AppState class]); + OCMStub([mock_app_state lastTappedWindow]).andReturn(mock_window); accessory_mediator_ = - [[FormInputAccessoryMediator alloc] initWithConsumer:mock_consumer_ + [[FormInputAccessoryMediator alloc] initWithConsumer:mock_consumer delegate:nil webStateList:NULL personalDataManager:NULL - passwordStore:nullptr]; + passwordStore:nullptr + appState:mock_app_state]; [accessory_mediator_ injectWebState:&test_web_state_]; [accessory_mediator_ injectProvider:suggestion_controller_];
diff --git a/ios/chrome/browser/crash_report/crash_reporter_url_observer_unittest.mm b/ios/chrome/browser/crash_report/crash_reporter_url_observer_unittest.mm index 2c0e5186..52fe1e1 100644 --- a/ios/chrome/browser/crash_report/crash_reporter_url_observer_unittest.mm +++ b/ios/chrome/browser/crash_report/crash_reporter_url_observer_unittest.mm
@@ -23,6 +23,8 @@ #error "This file requires ARC support." #endif +namespace { + class TestWebState : public web::TestWebState { public: void LoadURL(const GURL& url) { @@ -53,6 +55,8 @@ std::unique_ptr<web::NavigationItem> pending_item_; }; +} // namespace + @interface DictionaryParameterSetter : NSObject <CrashReporterParameterSetter> @property(nonatomic) NSMutableDictionary* params; @end
diff --git a/ios/chrome/browser/passwords/password_controller_unittest.mm b/ios/chrome/browser/passwords/password_controller_unittest.mm index c1b3571..e41a07f 100644 --- a/ios/chrome/browser/passwords/password_controller_unittest.mm +++ b/ios/chrome/browser/passwords/password_controller_unittest.mm
@@ -309,9 +309,10 @@ accessoryMediator_ = [[FormInputAccessoryMediator alloc] initWithConsumer:nil delegate:nil - webStateList:NULL - personalDataManager:NULL - passwordStore:nullptr]; + webStateList:nullptr + personalDataManager:nullptr + passwordStore:nullptr + appState:nil]; [accessoryMediator_ injectWebState:web_state()]; [accessoryMediator_ injectProvider:suggestionController_]; }
diff --git a/ios/chrome/browser/reading_list/reading_list_web_state_observer_unittest.mm b/ios/chrome/browser/reading_list/reading_list_web_state_observer_unittest.mm index 8bfb764c..95a6aec 100644 --- a/ios/chrome/browser/reading_list/reading_list_web_state_observer_unittest.mm +++ b/ios/chrome/browser/reading_list/reading_list_web_state_observer_unittest.mm
@@ -26,7 +26,6 @@ const char kTestTitle[] = "title"; const char kTestDistilledPath[] = "distilled/page.html"; const char kTestDistilledURL[] = "http://foo.bar/distilled"; -} // A Test navigation manager that checks if Reload was called. class TestNavigationManager : public web::TestNavigationManager { @@ -60,6 +59,8 @@ GURL last_opened_url_; }; +} // namespace + // Test fixture to test loading of Reading list entries. class ReadingListWebStateObserverTest : public web::WebTest { public:
diff --git a/ios/chrome/browser/signin/gaia_auth_fetcher_ios_ns_url_session_bridge.mm b/ios/chrome/browser/signin/gaia_auth_fetcher_ios_ns_url_session_bridge.mm index 02d5ef37..eb90f40 100644 --- a/ios/chrome/browser/signin/gaia_auth_fetcher_ios_ns_url_session_bridge.mm +++ b/ios/chrome/browser/signin/gaia_auth_fetcher_ios_ns_url_session_bridge.mm
@@ -10,6 +10,7 @@ #include "base/bind_helpers.h" #include "base/mac/foundation_util.h" #include "base/strings/sys_string_conversions.h" +#include "components/signin/ios/browser/account_consistency_service.h" #include "ios/chrome/browser/signin/feature_flags.h" #include "ios/net/cookies/system_cookie_util.h" #include "ios/web/common/features.h" @@ -20,13 +21,6 @@ #error "This file requires ARC support." #endif -namespace { -// Name of the cookie that is managed by AccountConsistencyService and is used -// to inform Google web properties that the browser is connected and that Google -// authentication cookies are managed by |AccountReconcilor|). -const char kChromeConnectedCookieName[] = "CHROME_CONNECTED"; -} - @interface GaiaAuthFetcherIOSURLSessionDelegate : NSObject <NSURLSessionTaskDelegate> @@ -159,8 +153,10 @@ // |CHROME_CONNECTED| cookie is attached to all web requests to Google web // properties. Requests initiated from the browser services (e.g. // GaiaCookieManagerService) must not include this cookie. - if (cookie_with_access_result.cookie.Name() == kChromeConnectedCookieName) + if (cookie_with_access_result.cookie.Name() == + AccountConsistencyService::kChromeConnectedCookieName) { continue; + } [http_cookies addObject:net::SystemCookieFromCanonicalCookie( cookie_with_access_result.cookie)]; }
diff --git a/ios/chrome/browser/ui/autofill/form_input_accessory/BUILD.gn b/ios/chrome/browser/ui/autofill/form_input_accessory/BUILD.gn index 8f7c3bc..e9dc16bf 100644 --- a/ios/chrome/browser/ui/autofill/form_input_accessory/BUILD.gn +++ b/ios/chrome/browser/ui/autofill/form_input_accessory/BUILD.gn
@@ -21,6 +21,7 @@ "//components/autofill/ios/form_util", "//components/keyed_service/core", "//components/password_manager/core/browser", + "//ios/chrome/app/application_delegate:app_state_header", "//ios/chrome/app/strings:ios_strings_grit", "//ios/chrome/browser/autofill:autofill", "//ios/chrome/browser/autofill:autofill_shared", @@ -31,6 +32,7 @@ "//ios/chrome/browser/ui/autofill/manual_fill", "//ios/chrome/browser/ui/autofill/manual_fill:manual_fill_ui", "//ios/chrome/browser/ui/coordinators:chrome_coordinators", + "//ios/chrome/browser/ui/main:scene_state_header", "//ios/chrome/browser/ui/util", "//ios/chrome/browser/web_state_list", "//ios/chrome/common/ui/util",
diff --git a/ios/chrome/browser/ui/autofill/form_input_accessory/form_input_accessory_coordinator.mm b/ios/chrome/browser/ui/autofill/form_input_accessory/form_input_accessory_coordinator.mm index acbaf90..7236a44 100644 --- a/ios/chrome/browser/ui/autofill/form_input_accessory/form_input_accessory_coordinator.mm +++ b/ios/chrome/browser/ui/autofill/form_input_accessory/form_input_accessory_coordinator.mm
@@ -24,6 +24,8 @@ #import "ios/chrome/browser/ui/autofill/manual_fill/manual_fill_accessory_view_controller.h" #import "ios/chrome/browser/ui/autofill/manual_fill/manual_fill_injection_handler.h" #import "ios/chrome/browser/ui/autofill/manual_fill/manual_fill_password_coordinator.h" +#import "ios/chrome/browser/ui/main/scene_state.h" +#import "ios/chrome/browser/ui/main/scene_state_browser_agent.h" #include "ios/chrome/browser/ui/util/ui_util.h" #import "ios/chrome/browser/web_state_list/web_state_list.h" #import "ios/web/public/web_state.h" @@ -80,12 +82,16 @@ autofill::PersonalDataManagerFactory::GetForBrowserState( self.browser->GetBrowserState()->GetOriginalChromeBrowserState()); + AppState* appState = SceneStateBrowserAgent::FromBrowser(self.browser) + ->GetSceneState() + .appState; _formInputAccessoryMediator = [[FormInputAccessoryMediator alloc] initWithConsumer:self.formInputAccessoryViewController delegate:self webStateList:self.browser->GetWebStateList() personalDataManager:personalDataManager - passwordStore:passwordStore]; + passwordStore:passwordStore + appState:appState]; } - (void)stop {
diff --git a/ios/chrome/browser/ui/autofill/form_input_accessory/form_input_accessory_mediator.h b/ios/chrome/browser/ui/autofill/form_input_accessory/form_input_accessory_mediator.h index 828e49c8..6dbc880 100644 --- a/ios/chrome/browser/ui/autofill/form_input_accessory/form_input_accessory_mediator.h +++ b/ios/chrome/browser/ui/autofill/form_input_accessory/form_input_accessory_mediator.h
@@ -12,6 +12,7 @@ #import "ios/chrome/browser/web_state_list/web_state_list_observer_bridge.h" #import "ios/web/public/web_state_observer_bridge.h" +@class AppState; @class ChromeCoordinator; @protocol FormInputAccessoryConsumer; @class FormInputAccessoryMediator; @@ -55,7 +56,8 @@ webStateList:(WebStateList*)webStateList personalDataManager:(autofill::PersonalDataManager*)personalDataManager passwordStore: - (scoped_refptr<password_manager::PasswordStore>)passwordStore; + (scoped_refptr<password_manager::PasswordStore>)passwordStore + appState:(AppState*)appState; // Unavailable, use initWithConsumer:webStateList: instead. - (instancetype)init NS_UNAVAILABLE;
diff --git a/ios/chrome/browser/ui/autofill/form_input_accessory/form_input_accessory_mediator.mm b/ios/chrome/browser/ui/autofill/form_input_accessory/form_input_accessory_mediator.mm index c5bfdb5..a46cf5f 100644 --- a/ios/chrome/browser/ui/autofill/form_input_accessory/form_input_accessory_mediator.mm +++ b/ios/chrome/browser/ui/autofill/form_input_accessory/form_input_accessory_mediator.mm
@@ -5,6 +5,7 @@ #import "ios/chrome/browser/ui/autofill/form_input_accessory/form_input_accessory_mediator.h" #include "base/ios/block_types.h" +#include "base/ios/ios_util.h" #include "base/mac/foundation_util.h" #import "base/strings/sys_string_conversions.h" #include "components/autofill/core/browser/personal_data_manager.h" @@ -13,6 +14,7 @@ #import "components/autofill/ios/browser/personal_data_manager_observer_bridge.h" #import "components/autofill/ios/form_util/form_activity_observer_bridge.h" #include "components/autofill/ios/form_util/form_activity_params.h" +#import "ios/chrome/app/application_delegate/app_state.h" #import "ios/chrome/browser/autofill/form_input_accessory_view_handler.h" #import "ios/chrome/browser/autofill/form_input_suggestions_provider.h" #import "ios/chrome/browser/autofill/form_suggestion_tab_helper.h" @@ -36,7 +38,8 @@ #error "This file requires ARC support." #endif -@interface FormInputAccessoryMediator () <FormActivityObserver, +@interface FormInputAccessoryMediator () <AppStateObserver, + FormActivityObserver, FormInputAccessoryViewDelegate, CRWWebStateObserver, KeyboardObserverHelperConsumer, @@ -83,6 +86,10 @@ // The WebState this instance is observing. Can be null. @property(nonatomic, assign) web::WebState* webState; +// Contains information about the application state, for example the last window +// that was tapped. +@property(nonatomic, weak) AppState* appState; + @end @implementation FormInputAccessoryMediator { @@ -124,7 +131,8 @@ webStateList:(WebStateList*)webStateList personalDataManager:(autofill::PersonalDataManager*)personalDataManager passwordStore: - (scoped_refptr<password_manager::PasswordStore>)passwordStore { + (scoped_refptr<password_manager::PasswordStore>)passwordStore + appState:(AppState*)appState { self = [super init]; if (self) { _consumer = consumer; @@ -208,6 +216,10 @@ consumer.creditCardButtonHidden = YES; consumer.addressButtonHidden = YES; } + _appState = appState; + if (!base::ios::IsRunningOnIOS14OrLater()) { + [_appState addObserver:self]; + } } return self; } @@ -232,6 +244,9 @@ _webStateListObserver.reset(); _webStateList = nullptr; } + if (!base::ios::IsRunningOnIOS14OrLater()) { + [_appState removeObserver:self]; + } } - (void)detachFromWebState { @@ -544,6 +559,16 @@ UIView* webStateContainerView = self.webState->GetView(); BOOL webStateInKeyWindow = webStateContainerView.window.isKeyWindow; + if (!base::ios::IsRunningOnIOS14OrLater()) { + // This is a workaround for a bug in iOS multiwindow, in which you can touch + // a webView without the window getting the keyboard focus. The result is + // that you focus a field in the new window gains focus, but keyboard typing + // continue to happen in the other window. + // TODO(crbug.com/1109124): Remove this workaround. + webStateInKeyWindow = + webStateInKeyWindow && + webStateContainerView.window == self.appState.lastTappedWindow; + } if (webStateInKeyWindow) { UIResponder* firstResponder = GetFirstResponder(); while (firstResponder) { @@ -603,6 +628,11 @@ _personalDataManager->GetProfilesToSuggest().empty(); } +#pragma mark - AppStateObserver +- (void)appState:(AppState*)appState lastTappedWindowChanged:(UIWindow*)window { + [self verifyFirstResponderAndUpdateCustomKeyboardView]; +} + #pragma mark - Tests - (void)injectWebState:(web::WebState*)webState {
diff --git a/ios/chrome/browser/ui/browser_view/BUILD.gn b/ios/chrome/browser/ui/browser_view/BUILD.gn index 930f058..8052be9 100644 --- a/ios/chrome/browser/ui/browser_view/BUILD.gn +++ b/ios/chrome/browser/ui/browser_view/BUILD.gn
@@ -35,6 +35,7 @@ "//components/translate/core/browser", "//components/url_formatter", "//ios/chrome/app:tests_hook", + "//ios/chrome/app/application_delegate:app_state_header", "//ios/chrome/app/strings", "//ios/chrome/browser", "//ios/chrome/browser/app_launcher", @@ -106,6 +107,7 @@ "//ios/chrome/browser/ui/infobars:public", "//ios/chrome/browser/ui/keyboard", "//ios/chrome/browser/ui/location_bar:location_bar_model_delegate", + "//ios/chrome/browser/ui/main:scene_state_header", "//ios/chrome/browser/ui/main_content:main_content_ui", "//ios/chrome/browser/ui/main_content:main_content_ui_broadcasting_util", "//ios/chrome/browser/ui/ntp", @@ -234,6 +236,7 @@ "//ios/chrome/browser/ui/commands", "//ios/chrome/browser/ui/download:features", "//ios/chrome/browser/ui/fullscreen:feature_flags", + "//ios/chrome/browser/ui/main:scene_state_header", "//ios/chrome/browser/ui/toolbar/public", "//ios/chrome/browser/ui/toolbar/test", "//ios/chrome/browser/ui/util",
diff --git a/ios/chrome/browser/ui/browser_view/browser_coordinator_unittest.mm b/ios/chrome/browser/ui/browser_view/browser_coordinator_unittest.mm index 422481d..1093f4e8 100644 --- a/ios/chrome/browser/ui/browser_view/browser_coordinator_unittest.mm +++ b/ios/chrome/browser/ui/browser_view/browser_coordinator_unittest.mm
@@ -13,6 +13,8 @@ #import "ios/chrome/browser/ui/commands/command_dispatcher.h" #import "ios/chrome/browser/ui/download/features.h" #import "ios/chrome/browser/ui/fullscreen/fullscreen_features.h" +#import "ios/chrome/browser/ui/main/scene_state.h" +#import "ios/chrome/browser/ui/main/scene_state_browser_agent.h" #import "ios/chrome/browser/url_loading/url_loading_notifier_browser_agent.h" #include "ios/web/public/test/web_task_environment.h" #include "testing/gtest/include/gtest/gtest.h" @@ -30,8 +32,10 @@ protected: BrowserCoordinatorTest() : base_view_controller_([[UIViewController alloc] init]), - browser_(std::make_unique<TestBrowser>()) { + browser_(std::make_unique<TestBrowser>()), + scene_state_([[SceneState alloc] initWithAppState:nil]) { UrlLoadingNotifierBrowserAgent::CreateForBrowser(browser_.get()); + SceneStateBrowserAgent::CreateForBrowser(browser_.get(), scene_state_); } BrowserCoordinator* GetBrowserCoordinator() { @@ -43,6 +47,7 @@ web::WebTaskEnvironment task_environment_; UIViewController* base_view_controller_; std::unique_ptr<TestBrowser> browser_; + SceneState* scene_state_; }; // Tests if the URL to open the downlads directory from files.app is valid.
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 1a0cc76..4207fa2 100644 --- a/ios/chrome/browser/ui/browser_view/browser_view_controller.mm +++ b/ios/chrome/browser/ui/browser_view/browser_view_controller.mm
@@ -28,6 +28,7 @@ #import "components/signin/ios/browser/manage_accounts_delegate.h" #include "components/strings/grit/components_strings.h" #include "components/translate/core/browser/translate_manager.h" +#import "ios/chrome/app/application_delegate/app_state.h" #include "ios/chrome/browser/browser_state/chrome_browser_state.h" #include "ios/chrome/browser/chrome_url_constants.h" #import "ios/chrome/browser/download/download_manager_tab_helper.h" @@ -94,6 +95,8 @@ #import "ios/chrome/browser/ui/infobars/infobar_feature.h" #import "ios/chrome/browser/ui/infobars/infobar_positioner.h" #include "ios/chrome/browser/ui/location_bar/location_bar_model_delegate_ios.h" +#import "ios/chrome/browser/ui/main/scene_state.h" +#import "ios/chrome/browser/ui/main/scene_state_browser_agent.h" #import "ios/chrome/browser/ui/main_content/main_content_ui.h" #import "ios/chrome/browser/ui/main_content/main_content_ui_broadcasting_util.h" #import "ios/chrome/browser/ui/main_content/main_content_ui_state.h" @@ -2516,6 +2519,15 @@ _lastTapPoint = [[view superview] convertPoint:viewCoordinate toView:self.view]; _lastTapTime = CACurrentMediaTime(); + + // This is a workaround for a bug in iOS multiwindow, in which you can touch a + // webView without the window getting the keyboard focus. + // The result is that a field in the new window gains focus, but keyboard + // typing continue to happen in the other window. + // TODO(crbug.com/1109124): Remove this workaround. + SceneStateBrowserAgent::FromBrowser(self.browser) + ->GetSceneState() + .appState.lastTappedWindow = view.window; } #pragma mark - Private Methods: Tab creation and selection
diff --git a/ios/chrome/browser/ui/infobars/modals/infobar_save_card_table_view_controller.mm b/ios/chrome/browser/ui/infobars/modals/infobar_save_card_table_view_controller.mm index 76f14add..2eef2119 100644 --- a/ios/chrome/browser/ui/infobars/modals/infobar_save_card_table_view_controller.mm +++ b/ios/chrome/browser/ui/infobars/modals/infobar_save_card_table_view_controller.mm
@@ -220,7 +220,7 @@ #pragma mark - InfobarSaveCardModalConsumer - (void)setupModalViewControllerWithPrefs:(NSDictionary*)prefs { - self.cardholderName = [prefs[kCardholderNamePrefKey] stringValue]; + self.cardholderName = prefs[kCardholderNamePrefKey]; self.cardIssuerIcon = prefs[kCardIssuerIconNamePrefKey]; self.cardNumber = prefs[kCardNumberPrefKey]; self.expirationMonth = prefs[kExpirationMonthPrefKey];
diff --git a/ios/chrome/browser/ui/main/BUILD.gn b/ios/chrome/browser/ui/main/BUILD.gn index c3de1ad..6b7875e1 100644 --- a/ios/chrome/browser/ui/main/BUILD.gn +++ b/ios/chrome/browser/ui/main/BUILD.gn
@@ -23,6 +23,19 @@ frameworks = [ "UIKit.framework" ] } +source_set("scene_state_header") { + configs += [ "//build/config/compiler:enable_arc" ] + sources = [ + "scene_state.h", + "scene_state_browser_agent.h", + ] + public_deps = [ + "//ios/chrome/browser/main:public", + "//ios/chrome/browser/ui/scoped_ui_blocker", + "//ios/chrome/browser/window_activities", + ] +} + source_set("scene") { configs += [ "//build/config/compiler:enable_arc" ] sources = [ @@ -31,7 +44,6 @@ "scene_controller.mm", "scene_delegate.h", "scene_delegate.mm", - "scene_state.h", "scene_state.mm", "ui_blocker_scene_agent.h", "ui_blocker_scene_agent.mm", @@ -48,6 +60,7 @@ "//ios/chrome/app:blocking_scene_commands", "//ios/chrome/app:mode", "//ios/chrome/app:tests_hook", + "//ios/chrome/app/application_delegate:app_state_header", "//ios/chrome/app/application_delegate:tab_opening", "//ios/chrome/app/application_delegate:url_opener_params", "//ios/chrome/browser", @@ -88,8 +101,7 @@ "//ios/public/provider/chrome/browser/signin", "//ios/public/provider/chrome/browser/user_feedback", ] - public_deps = [ "//ios/chrome/browser/ui/scoped_ui_blocker" ] - + public_deps = [ ":scene_state_header" ] allow_circular_includes_from = [ ":main", @@ -108,7 +120,6 @@ "browser_view_wrangler.mm", "bvc_container_view_controller.h", "bvc_container_view_controller.mm", - "scene_state_browser_agent.h", "scene_state_browser_agent.mm", ] deps = [ @@ -162,6 +173,8 @@ deps += [ "//ios/chrome/app/resources:base_scene_storyboard" ] } + public_deps = [ ":scene_state_header" ] + # TODO(crbug.com/1103553): remove circular dependency. allow_circular_includes_from = [ "//ios/chrome/browser/ui/settings/sync" ]
diff --git a/ios/chrome/browser/ui/main/scene_controller.mm b/ios/chrome/browser/ui/main/scene_controller.mm index d7b121c..ae7b10ee 100644 --- a/ios/chrome/browser/ui/main/scene_controller.mm +++ b/ios/chrome/browser/ui/main/scene_controller.mm
@@ -1422,6 +1422,20 @@ } - (BOOL)shouldOpenNTPTabOnActivationOfBrowser:(Browser*)browser { + // Check if there are pending actions that would result in opening a new tab. + // In that case, it is not useful to open another tab. + if (@available(iOS 13, *)) { + for (NSUserActivity* activity in self.sceneState.connectionOptions + .userActivities) { + if (ActivityIsURLLoad(activity)) { + return NO; + } + } + } + if (self.startupParameters) { + return NO; + } + if (self.tabSwitcherIsActive) { Browser* mainBrowser = self.mainInterface.browser; Browser* otrBrowser = self.incognitoInterface.browser; @@ -1447,24 +1461,11 @@ return YES; } - BOOL hasPendingURL = NO; - - if (@available(iOS 13, *)) { - // Only consider normal mode load as this function always returns NO for - // incognito browser. - for (NSUserActivity* activity in self.sceneState.connectionOptions - .userActivities) { - if (ActivityIsURLLoadInNormalMode(activity)) { - hasPendingURL = YES; - break; - } - } - } // If there is a URLLoading activity, avoid opening a new tab as the NTP would // flash before the target URL is loaded. return browser->GetWebStateList()->empty() && - !(browser->GetBrowserState()->IsOffTheRecord()) && !hasPendingURL; + !(browser->GetBrowserState()->IsOffTheRecord()); } #pragma mark - SceneURLLoadingServiceDelegate
diff --git a/ios/chrome/browser/ui/menu/action_factory.h b/ios/chrome/browser/ui/menu/action_factory.h index 85dd03b..150c60cc 100644 --- a/ios/chrome/browser/ui/menu/action_factory.h +++ b/ios/chrome/browser/ui/menu/action_factory.h
@@ -46,12 +46,22 @@ - (UIAction*)actionToOpenInNewTabWithURL:(const GURL)URL completion:(ProceduralBlock)completion; +// Creates a UIAction instance whose title and icon are configured for opening a +// URL in a new tab. When triggered, the action will invoke the |block| which +// needs to open a URL in a new tab. +- (UIAction*)actionToOpenInNewTabWithBlock:(ProceduralBlock)block; + // Creates a UIAction instance configured for opening the |URL| in a new // incognito tab and which will invoke the given |completion| block after // execution. - (UIAction*)actionToOpenInNewIncognitoTabWithURL:(const GURL)URL completion:(ProceduralBlock)completion; +// Creates a UIAction instance whose title and icon are configured for opening a +// URL in a new incognito tab. When triggered, the action will invoke the +// |block| which needs to open a URL in a new incognito tab. +- (UIAction*)actionToOpenInNewIncognitoTabWithBlock:(ProceduralBlock)block; + // Creates a UIAction instance configured for opening the |URL| in a new window // from |activityOrigin|, and which will invoke the given |completion| block // after execution.
diff --git a/ios/chrome/browser/ui/menu/action_factory.mm b/ios/chrome/browser/ui/menu/action_factory.mm index 8b484d0d..8f65dca 100644 --- a/ios/chrome/browser/ui/menu/action_factory.mm +++ b/ios/chrome/browser/ui/menu/action_factory.mm
@@ -82,16 +82,20 @@ UrlLoadParams params = UrlLoadParams::InNewTab(URL); UrlLoadingBrowserAgent* loadingAgent = UrlLoadingBrowserAgent::FromBrowser(self.browser); + return [self actionToOpenInNewTabWithBlock:^{ + loadingAgent->Load(params); + if (completion) { + completion(); + } + }]; +} + +- (UIAction*)actionToOpenInNewTabWithBlock:(ProceduralBlock)block { return [self actionWithTitle:l10n_util::GetNSString( IDS_IOS_CONTENT_CONTEXT_OPENLINKNEWTAB) image:[UIImage systemImageNamed:@"plus"] type:MenuActionType::OpenInNewTab - block:^{ - loadingAgent->Load(params); - if (completion) { - completion(); - } - }]; + block:block]; } - (UIAction*)actionToOpenInNewIncognitoTabWithURL:(const GURL)URL @@ -100,17 +104,21 @@ params.in_incognito = YES; UrlLoadingBrowserAgent* loadingAgent = UrlLoadingBrowserAgent::FromBrowser(self.browser); + return [self actionToOpenInNewIncognitoTabWithBlock:^{ + loadingAgent->Load(params); + if (completion) { + completion(); + } + }]; +} + +- (UIAction*)actionToOpenInNewIncognitoTabWithBlock:(ProceduralBlock)block { return [self actionWithTitle:l10n_util::GetNSString( IDS_IOS_CONTENT_CONTEXT_OPENLINKNEWINCOGNITOTAB) image:nil type:MenuActionType::OpenInNewIncognitoTab - block:^{ - loadingAgent->Load(params); - if (completion) { - completion(); - } - }]; + block:block]; } - (UIAction*)actionToOpenInNewWindowWithURL:(const GURL)URL
diff --git a/ios/chrome/browser/ui/menu/action_factory_unittest.mm b/ios/chrome/browser/ui/menu/action_factory_unittest.mm index 3371c406..e827677 100644 --- a/ios/chrome/browser/ui/menu/action_factory_unittest.mm +++ b/ios/chrome/browser/ui/menu/action_factory_unittest.mm
@@ -127,8 +127,8 @@ } } -// Tests that the Open in New Tab action has the right title and image. -TEST_F(ActionFactoryTest, OpenInNewTabAction) { +// Tests that the Open in New Tab actions have the right titles and images. +TEST_F(ActionFactoryTest, OpenInNewTabAction_URL) { if (@available(iOS 13.0, *)) { ActionFactory* factory = [[ActionFactory alloc] initWithBrowser:test_browser_.get() @@ -140,17 +140,20 @@ NSString* expectedTitle = l10n_util::GetNSString(IDS_IOS_CONTENT_CONTEXT_OPENLINKNEWTAB); - UIAction* action = [factory actionToOpenInNewTabWithURL:testURL - completion:nil]; + UIAction* actionWithURL = [factory actionToOpenInNewTabWithURL:testURL + completion:nil]; + EXPECT_TRUE([expectedTitle isEqualToString:actionWithURL.title]); + EXPECT_EQ(expectedImage, actionWithURL.image); - EXPECT_TRUE([expectedTitle isEqualToString:action.title]); - EXPECT_EQ(expectedImage, action.image); + UIAction* actionWithBlock = [factory actionToOpenInNewTabWithBlock:nil]; + EXPECT_TRUE([expectedTitle isEqualToString:actionWithBlock.title]); + EXPECT_EQ(expectedImage, actionWithBlock.image); } } -// Tests that the Open in New Incognito Tab action has the right title and -// image. -TEST_F(ActionFactoryTest, OpenInNewIncognitoTabAction) { +// Tests that the Open in New Incognito Tab actions have the right titles +// and images. +TEST_F(ActionFactoryTest, OpenInNewIncognitoTabAction_URL) { if (@available(iOS 13.0, *)) { ActionFactory* factory = [[ActionFactory alloc] initWithBrowser:test_browser_.get() @@ -161,11 +164,15 @@ NSString* expectedTitle = l10n_util::GetNSString(IDS_IOS_CONTENT_CONTEXT_OPENLINKNEWINCOGNITOTAB); - UIAction* action = [factory actionToOpenInNewIncognitoTabWithURL:testURL - completion:nil]; + UIAction* actionWithURL = + [factory actionToOpenInNewIncognitoTabWithURL:testURL completion:nil]; + EXPECT_TRUE([expectedTitle isEqualToString:actionWithURL.title]); + EXPECT_FALSE(!!actionWithURL.image); - EXPECT_TRUE([expectedTitle isEqualToString:action.title]); - EXPECT_FALSE(!!action.image); + UIAction* actionWithBlock = + [factory actionToOpenInNewIncognitoTabWithBlock:nil]; + EXPECT_TRUE([expectedTitle isEqualToString:actionWithBlock.title]); + EXPECT_FALSE(!!actionWithBlock.image); } }
diff --git a/ios/chrome/browser/ui/popup_menu/request_desktop_mobile_site_egtest.mm b/ios/chrome/browser/ui/popup_menu/request_desktop_mobile_site_egtest.mm index 77f0c8c..8963505 100644 --- a/ios/chrome/browser/ui/popup_menu/request_desktop_mobile_site_egtest.mm +++ b/ios/chrome/browser/ui/popup_menu/request_desktop_mobile_site_egtest.mm
@@ -122,6 +122,40 @@ @implementation RequestDesktopMobileSiteTestCase +#pragma mark - Helpers + +- (BOOL)isMobileByDefault { + return web::features::UseWebClientDefaultUserAgent() + ? ![ChromeEarlGrey isIPadIdiom] + : YES; +} + +- (GREYElementInteraction*)defaultRequestButton { + if ([self isMobileByDefault]) + return RequestDesktopButton(); + return RequestMobileButton(); +} + +- (GREYElementInteraction*)nonDefaultRequestButton { + if ([self isMobileByDefault]) + return RequestMobileButton(); + return RequestDesktopButton(); +} + +- (std::string)defaultLabel { + if ([self isMobileByDefault]) + return kMobileSiteLabel; + return kDesktopSiteLabel; +} + +- (std::string)nonDefaultLabel { + if ([self isMobileByDefault]) + return kDesktopSiteLabel; + return kMobileSiteLabel; +} + +#pragma mark - Tests + // Tests that requesting desktop site of a page works and the user agent // propagates to the next navigations in the same tab. - (void)testRequestDesktopSitePropagatesToNextNavigations { @@ -131,17 +165,17 @@ [ChromeEarlGrey loadURL:web::test::HttpServer::MakeUrl("http://1.com")]; // Verify initial reception of the mobile site. - [ChromeEarlGrey waitForWebStateContainingText:kMobileSiteLabel]; + [ChromeEarlGrey waitForWebStateContainingText:[self defaultLabel]]; // Request and verify reception of the desktop site. [ChromeEarlGreyUI openToolsMenu]; - [RequestDesktopButton() performAction:grey_tap()]; - [ChromeEarlGrey waitForWebStateContainingText:kDesktopSiteLabel + [[self defaultRequestButton] performAction:grey_tap()]; + [ChromeEarlGrey waitForWebStateContainingText:[self nonDefaultLabel] timeout:kWaitForUserAgentChangeTimeout]; // Verify that desktop user agent propagates. [ChromeEarlGrey loadURL:web::test::HttpServer::MakeUrl("http://2.com")]; - [ChromeEarlGrey waitForWebStateContainingText:kDesktopSiteLabel]; + [ChromeEarlGrey waitForWebStateContainingText:[self nonDefaultLabel]]; } // Tests that requesting desktop site of a page works and the requested user @@ -153,12 +187,12 @@ [ChromeEarlGrey loadURL:web::test::HttpServer::MakeUrl("http://1.com")]; // Verify initial reception of the mobile site. - [ChromeEarlGrey waitForWebStateContainingText:kMobileSiteLabel]; + [ChromeEarlGrey waitForWebStateContainingText:[self defaultLabel]]; // Request and verify reception of the desktop site. [ChromeEarlGreyUI openToolsMenu]; - [RequestDesktopButton() performAction:grey_tap()]; - [ChromeEarlGrey waitForWebStateContainingText:kDesktopSiteLabel + [[self defaultRequestButton] performAction:grey_tap()]; + [ChromeEarlGrey waitForWebStateContainingText:[self nonDefaultLabel] timeout:kWaitForUserAgentChangeTimeout]; // Close all tabs and undo, trigerring a restoration. @@ -174,8 +208,8 @@ // Verify that desktop user agent propagates. [ChromeEarlGreyUI openToolsMenu]; - [RequestMobileButton() assertWithMatcher:grey_notNil()]; - [ChromeEarlGrey waitForWebStateContainingText:kDesktopSiteLabel]; + [[self nonDefaultRequestButton] assertWithMatcher:grey_notNil()]; + [ChromeEarlGrey waitForWebStateContainingText:[self nonDefaultLabel]]; } // Tests that requesting desktop site of a page works and desktop user agent @@ -187,18 +221,18 @@ [ChromeEarlGrey loadURL:web::test::HttpServer::MakeUrl("http://1.com")]; // Verify initial reception of the mobile site. - [ChromeEarlGrey waitForWebStateContainingText:kMobileSiteLabel]; + [ChromeEarlGrey waitForWebStateContainingText:[self defaultLabel]]; // Request and verify reception of the desktop site. [ChromeEarlGreyUI openToolsMenu]; - [RequestDesktopButton() performAction:grey_tap()]; - [ChromeEarlGrey waitForWebStateContainingText:kDesktopSiteLabel + [[self defaultRequestButton] performAction:grey_tap()]; + [ChromeEarlGrey waitForWebStateContainingText:[self nonDefaultLabel] timeout:kWaitForUserAgentChangeTimeout]; // Verify that desktop user agent does not propagate to new tab. [ChromeEarlGreyUI openNewTab]; [ChromeEarlGrey loadURL:web::test::HttpServer::MakeUrl("http://2.com")]; - [ChromeEarlGrey waitForWebStateContainingText:kMobileSiteLabel]; + [ChromeEarlGrey waitForWebStateContainingText:[self defaultLabel]]; } // Tests that requesting desktop site of a page works and going back re-opens @@ -211,18 +245,18 @@ [ChromeEarlGrey loadURL:web::test::HttpServer::MakeUrl("http://1.com")]; // Verify initial reception of the mobile site. - [ChromeEarlGrey waitForWebStateContainingText:kMobileSiteLabel]; + [ChromeEarlGrey waitForWebStateContainingText:[self defaultLabel]]; // Request and verify reception of the desktop site. [ChromeEarlGreyUI openToolsMenu]; - [RequestDesktopButton() performAction:grey_tap()]; - [ChromeEarlGrey waitForWebStateContainingText:kDesktopSiteLabel + [[self defaultRequestButton] performAction:grey_tap()]; + [ChromeEarlGrey waitForWebStateContainingText:[self nonDefaultLabel] timeout:kWaitForUserAgentChangeTimeout]; // Verify that going back returns to the mobile site. [[EarlGrey selectElementWithMatcher:chrome_test_util::BackButton()] performAction:grey_tap()]; - [ChromeEarlGrey waitForWebStateContainingText:kMobileSiteLabel]; + [ChromeEarlGrey waitForWebStateContainingText:[self defaultLabel]]; } // Tests that when requesting desktop on another page and coming back to a page @@ -241,14 +275,14 @@ [ChromeEarlGrey loadURL:web::test::HttpServer::MakeUrl( "http://" + std::string(kPurgeURL))]; // Verify initial reception of the mobile site. - [ChromeEarlGrey waitForWebStateContainingText:kMobileSiteLabel]; + [ChromeEarlGrey waitForWebStateContainingText:[self defaultLabel]]; [ChromeEarlGrey loadURL:web::test::HttpServer::MakeUrl("http://2.com")]; // Request and verify reception of the desktop site. [ChromeEarlGreyUI openToolsMenu]; - [RequestDesktopButton() performAction:grey_tap()]; - [ChromeEarlGrey waitForWebStateContainingText:kDesktopSiteLabel + [[self defaultRequestButton] performAction:grey_tap()]; + [ChromeEarlGrey waitForWebStateContainingText:[self nonDefaultLabel] timeout:kWaitForUserAgentChangeTimeout]; // Verify that going back returns to the mobile site. @@ -261,32 +295,23 @@ "reloaded"; }), @"Page did not reload"); - [ChromeEarlGrey waitForWebStateContainingText:kMobileSiteLabel]; + [ChromeEarlGrey waitForWebStateContainingText:[self defaultLabel]]; } // Tests that navigating forward to a page not using the default mode from a // restored session is using the mode used in the past session. - (void)testNavigateForwardToDesktopMode { - BOOL isMobileByDefault = web::features::UseWebClientDefaultUserAgent() - ? ![ChromeEarlGrey isIPadIdiom] - : YES; - std::unique_ptr<web::DataResponseProvider> provider( new UserAgentResponseProvider()); web::test::SetUpHttpServer(std::move(provider)); // Load the page in the non-default mode. [ChromeEarlGrey loadURL:web::test::HttpServer::MakeUrl("http://1.com")]; - [ChromeEarlGrey waitForWebStateContainingText:isMobileByDefault - ? kMobileSiteLabel - : kDesktopSiteLabel]; + [ChromeEarlGrey waitForWebStateContainingText:[self defaultLabel]]; [ChromeEarlGreyUI openToolsMenu]; - [isMobileByDefault ? RequestDesktopButton() : RequestMobileButton() - performAction:grey_tap()]; - [ChromeEarlGrey waitForWebStateContainingText:isMobileByDefault - ? kDesktopSiteLabel - : kMobileSiteLabel]; + [[self defaultRequestButton] performAction:grey_tap()]; + [ChromeEarlGrey waitForWebStateContainingText:[self nonDefaultLabel]]; // Go back to NTP to restore the session from there. [ChromeEarlGrey goBack]; @@ -298,12 +323,9 @@ // The session is restored, navigate forward and check the mode. [ChromeEarlGrey goForward]; - [ChromeEarlGrey waitForWebStateContainingText:isMobileByDefault - ? kDesktopSiteLabel - : kMobileSiteLabel]; + [ChromeEarlGrey waitForWebStateContainingText:[self nonDefaultLabel]]; [ChromeEarlGreyUI openToolsMenu]; - [isMobileByDefault ? RequestMobileButton() : RequestDesktopButton() - assertWithMatcher:grey_notNil()]; + [[self nonDefaultRequestButton] assertWithMatcher:grey_notNil()]; } // Tests that requesting mobile site of a page works and the user agent @@ -315,23 +337,23 @@ [ChromeEarlGrey loadURL:web::test::HttpServer::MakeUrl("http://1.com")]; // Verify initial reception of the mobile site. - [ChromeEarlGrey waitForWebStateContainingText:kMobileSiteLabel]; + [ChromeEarlGrey waitForWebStateContainingText:[self defaultLabel]]; // Request and verify reception of the desktop site. [ChromeEarlGreyUI openToolsMenu]; - [RequestDesktopButton() performAction:grey_tap()]; - [ChromeEarlGrey waitForWebStateContainingText:kDesktopSiteLabel + [[self defaultRequestButton] performAction:grey_tap()]; + [ChromeEarlGrey waitForWebStateContainingText:[self nonDefaultLabel] timeout:kWaitForUserAgentChangeTimeout]; // Request and verify reception of the mobile site. [ChromeEarlGreyUI openToolsMenu]; - [RequestMobileButton() performAction:grey_tap()]; - [ChromeEarlGrey waitForWebStateContainingText:kMobileSiteLabel + [[self nonDefaultRequestButton] performAction:grey_tap()]; + [ChromeEarlGrey waitForWebStateContainingText:[self defaultLabel] timeout:kWaitForUserAgentChangeTimeout]; // Verify that mobile user agent propagates. [ChromeEarlGrey loadURL:web::test::HttpServer::MakeUrl("http://2.com")]; - [ChromeEarlGrey waitForWebStateContainingText:kMobileSiteLabel]; + [ChromeEarlGrey waitForWebStateContainingText:[self defaultLabel]]; } // Tests that requesting mobile site of a page works and going back re-opens @@ -344,24 +366,24 @@ [ChromeEarlGrey loadURL:web::test::HttpServer::MakeUrl("http://1.com")]; // Verify initial reception of the mobile site. - [ChromeEarlGrey waitForWebStateContainingText:kMobileSiteLabel]; + [ChromeEarlGrey waitForWebStateContainingText:[self defaultLabel]]; // Request and verify reception of the desktop site. [ChromeEarlGreyUI openToolsMenu]; - [RequestDesktopButton() performAction:grey_tap()]; - [ChromeEarlGrey waitForWebStateContainingText:kDesktopSiteLabel + [[self defaultRequestButton] performAction:grey_tap()]; + [ChromeEarlGrey waitForWebStateContainingText:[self nonDefaultLabel] timeout:kWaitForUserAgentChangeTimeout]; // Request and verify reception of the mobile site. [ChromeEarlGreyUI openToolsMenu]; - [RequestMobileButton() performAction:grey_tap()]; - [ChromeEarlGrey waitForWebStateContainingText:kMobileSiteLabel + [[self nonDefaultRequestButton] performAction:grey_tap()]; + [ChromeEarlGrey waitForWebStateContainingText:[self defaultLabel] timeout:kWaitForUserAgentChangeTimeout]; // Verify that going back returns to the desktop site. [[EarlGrey selectElementWithMatcher:chrome_test_util::BackButton()] performAction:grey_tap()]; - [ChromeEarlGrey waitForWebStateContainingText:kDesktopSiteLabel]; + [ChromeEarlGrey waitForWebStateContainingText:[self nonDefaultLabel]]; } // Tests that requesting desktop site button is not enabled on new tab pages. @@ -390,29 +412,37 @@ web::test::SetUpFileBasedHttpServer(); [ChromeEarlGrey loadURL:web::test::HttpServer::MakeUrl(kUserAgentTestURL)]; // Verify initial reception of the mobile site. - [ChromeEarlGrey waitForWebStateContainingText:kMobileSiteLabel]; + [ChromeEarlGrey waitForWebStateContainingText:[self defaultLabel]]; - std::string platform = - base::SysNSStringToUTF8([[UIDevice currentDevice] model]); - [ChromeEarlGrey waitForWebStateContainingText:platform]; + std::string defaultPlatform; + std::string nonDefaultPlatform; + if ([self isMobileByDefault]) { + defaultPlatform = base::SysNSStringToUTF8([[UIDevice currentDevice] model]); + if (@available(iOS 13, *)) { + nonDefaultPlatform = kDesktopPlatformLabel; + } else { + nonDefaultPlatform = defaultPlatform; + } + } else { + defaultPlatform = kDesktopPlatformLabel; + nonDefaultPlatform = + base::SysNSStringToUTF8([[UIDevice currentDevice] model]); + } + [ChromeEarlGrey waitForWebStateContainingText:defaultPlatform]; // Request and verify reception of the desktop site. [ChromeEarlGreyUI openToolsMenu]; - [RequestDesktopButton() performAction:grey_tap()]; - [ChromeEarlGrey waitForWebStateContainingText:kDesktopSiteLabel + [[self defaultRequestButton] performAction:grey_tap()]; + [ChromeEarlGrey waitForWebStateContainingText:[self nonDefaultLabel] timeout:kWaitForUserAgentChangeTimeout]; - if (@available(iOS 13, *)) { - [ChromeEarlGrey waitForWebStateContainingText:kDesktopPlatformLabel]; - } else { - [ChromeEarlGrey waitForWebStateContainingText:platform]; - } + [ChromeEarlGrey waitForWebStateContainingText:nonDefaultPlatform]; // Request and verify reception of the mobile site. [ChromeEarlGreyUI openToolsMenu]; - [RequestMobileButton() performAction:grey_tap()]; - [ChromeEarlGrey waitForWebStateContainingText:kMobileSiteLabel + [[self nonDefaultRequestButton] performAction:grey_tap()]; + [ChromeEarlGrey waitForWebStateContainingText:[self defaultLabel] timeout:kWaitForUserAgentChangeTimeout]; - [ChromeEarlGrey waitForWebStateContainingText:platform]; + [ChromeEarlGrey waitForWebStateContainingText:defaultPlatform]; } @end
diff --git a/ios/chrome/browser/ui/reading_list/BUILD.gn b/ios/chrome/browser/ui/reading_list/BUILD.gn index 59b1349..c02514b 100644 --- a/ios/chrome/browser/ui/reading_list/BUILD.gn +++ b/ios/chrome/browser/ui/reading_list/BUILD.gn
@@ -55,6 +55,7 @@ "//ios/chrome/browser/ui/table_view:styler", "//ios/chrome/browser/ui/table_view/cells", "//ios/chrome/browser/ui/util", + "//ios/chrome/browser/ui/util:multiwindow_util", "//ios/chrome/browser/url_loading", "//ios/chrome/browser/web_state_list", "//ios/chrome/browser/window_activities",
diff --git a/ios/chrome/browser/ui/reading_list/reading_list_coordinator.mm b/ios/chrome/browser/ui/reading_list/reading_list_coordinator.mm index 52f1940f..c2bef78 100644 --- a/ios/chrome/browser/ui/reading_list/reading_list_coordinator.mm +++ b/ios/chrome/browser/ui/reading_list/reading_list_coordinator.mm
@@ -38,6 +38,7 @@ #import "ios/chrome/browser/ui/table_view/table_view_navigation_controller.h" #import "ios/chrome/browser/ui/table_view/table_view_navigation_controller_constants.h" #import "ios/chrome/browser/ui/table_view/table_view_presentation_controller.h" +#import "ios/chrome/browser/ui/util/multi_window_support.h" #import "ios/chrome/browser/ui/util/pasteboard_util.h" #import "ios/chrome/browser/url_loading/url_loading_browser_agent.h" #import "ios/chrome/browser/url_loading/url_loading_params.h" @@ -438,9 +439,36 @@ initWithBrowser:strongSelf.browser scenario:MenuScenario::kReadingListEntry]; - UIAction* copyAction = [actionFactory actionToCopyURL:item.entryURL]; + NSMutableArray<UIMenuElement*>* menuElements = + [[NSMutableArray alloc] init]; - return [UIMenu menuWithTitle:@"" children:@[ copyAction ]]; + // Copy URL action. + [menuElements addObject:[actionFactory actionToCopyURL:item.entryURL]]; + + // "Open in" actions. + [menuElements addObject:[actionFactory actionToOpenInNewTabWithBlock:^{ + [weakSelf loadEntryURL:item.entryURL + withOfflineURL:GURL::EmptyGURL() + inNewTab:YES + incognito:NO]; + }]]; + [menuElements + addObject:[actionFactory actionToOpenInNewIncognitoTabWithBlock:^{ + [weakSelf loadEntryURL:item.entryURL + withOfflineURL:GURL::EmptyGURL() + inNewTab:YES + incognito:YES]; + }]]; + if (IsMultipleScenesSupported()) { + [menuElements + addObject:[actionFactory + actionToOpenInNewWindowWithURL:item.entryURL + activityOrigin: + WindowActivityReadingListOrigin + completion:nil]]; + } + + return [UIMenu menuWithTitle:@"" children:menuElements]; }; return
diff --git a/ios/chrome/browser/ui/settings/sync/BUILD.gn b/ios/chrome/browser/ui/settings/sync/BUILD.gn index 2348c0b..ffc333ec 100644 --- a/ios/chrome/browser/ui/settings/sync/BUILD.gn +++ b/ios/chrome/browser/ui/settings/sync/BUILD.gn
@@ -37,6 +37,7 @@ "//ios/chrome/browser/ui/collection_view/cells", "//ios/chrome/browser/ui/colors", "//ios/chrome/browser/ui/commands", + "//ios/chrome/browser/ui/main:scene_state_header", "//ios/chrome/browser/ui/scoped_ui_blocker", "//ios/chrome/browser/ui/settings:settings_root", "//ios/chrome/browser/ui/settings/cells",
diff --git a/ios/chrome/browser/web/content_mode_egtest.mm b/ios/chrome/browser/web/content_mode_egtest.mm index 2d9aa98..cffcb68 100644 --- a/ios/chrome/browser/web/content_mode_egtest.mm +++ b/ios/chrome/browser/web/content_mode_egtest.mm
@@ -9,6 +9,7 @@ #import "ios/chrome/test/earl_grey/chrome_test_case.h" #import "ios/testing/earl_grey/earl_grey_test.h" #include "ios/testing/embedded_test_server_handlers.h" +#include "ios/web/common/features.h" #include "net/test/embedded_test_server/default_handlers.h" #include "net/test/embedded_test_server/http_request.h" #include "net/test/embedded_test_server/http_response.h" @@ -79,7 +80,12 @@ // Returns the platform name of the current device. std::string platform() { - return base::SysNSStringToUTF8([[UIDevice currentDevice] model]); + BOOL isMobileByDefault = web::features::UseWebClientDefaultUserAgent() + ? ![ChromeEarlGrey isIPadIdiom] + : YES; + return isMobileByDefault + ? base::SysNSStringToUTF8([[UIDevice currentDevice] model]) + : "MacIntel"; } } // namespace
diff --git a/ios/chrome/browser/window_activities/window_activity_helpers.h b/ios/chrome/browser/window_activities/window_activity_helpers.h index 27d69f5..2dbe97f 100644 --- a/ios/chrome/browser/window_activities/window_activity_helpers.h +++ b/ios/chrome/browser/window_activities/window_activity_helpers.h
@@ -60,10 +60,6 @@ // new tab page in a new tab). bool ActivityIsURLLoad(NSUserActivity* activity); -// true if |activity| is one that indicates a URL load (including loading the -// new tab page in a new tab) in normal mode. -bool ActivityIsURLLoadInNormalMode(NSUserActivity* activity); - // true if |activity| is one that indicates a tab move. bool ActivityIsTabMove(NSUserActivity* activity);
diff --git a/ios/chrome/browser/window_activities/window_activity_helpers.mm b/ios/chrome/browser/window_activities/window_activity_helpers.mm index 22a8a1d..0c6c748 100644 --- a/ios/chrome/browser/window_activities/window_activity_helpers.mm +++ b/ios/chrome/browser/window_activities/window_activity_helpers.mm
@@ -80,10 +80,6 @@ [activity.activityType isEqualToString:kLoadIncognitoURLActivityType]; } -bool ActivityIsURLLoadInNormalMode(NSUserActivity* activity) { - return [activity.activityType isEqualToString:kLoadURLActivityType]; -} - bool ActivityIsTabMove(NSUserActivity* activity) { return [activity.activityType isEqualToString:kMoveTabActivityType]; }
diff --git a/ios/chrome/test/data/policy/policy_test_cases.json b/ios/chrome/test/data/policy/policy_test_cases.json index a57ea3c..cf96ace 100644 --- a/ios/chrome/test/data/policy/policy_test_cases.json +++ b/ios/chrome/test/data/policy/policy_test_cases.json
@@ -68,6 +68,8 @@ ] }, + "CloudPolicyOverridesPlatformPolicy": {}, + "DefaultPopupsSetting": { "os": [ "ios" ], "note": "TODO(crbug.com/106682): Flag this with can_be_recommended",
diff --git a/ios/components/security_interstitials/lookalikes/lookalike_url_blocking_page_unittest.mm b/ios/components/security_interstitials/lookalikes/lookalike_url_blocking_page_unittest.mm index 6c44dc2..f1ef133 100644 --- a/ios/components/security_interstitials/lookalikes/lookalike_url_blocking_page_unittest.mm +++ b/ios/components/security_interstitials/lookalikes/lookalike_url_blocking_page_unittest.mm
@@ -33,6 +33,7 @@ using base::test::ios::kSpinDelaySeconds; namespace { + // Constants used for testing metrics. const char kInterstitialDecisionMetric[] = "interstitial.lookalike.decision"; const char kInterstitialInteractionMetric[] = @@ -53,7 +54,6 @@ std::make_unique<LookalikeUrlControllerClient>(web_state, safe_url, request_url, "en-US")); } -} // namespace // A Test web state that sets the visible URL to the last opened URL. class TestWebState : public web::TestWebState { @@ -63,6 +63,8 @@ } }; +} // namespace + // Test fixture for SafeBrowsingBlockingPage. class LookalikeUrlBlockingPageTest : public PlatformTest { public:
diff --git a/media/gpu/mac/vt_video_decode_accelerator_mac.cc b/media/gpu/mac/vt_video_decode_accelerator_mac.cc index ce0534cc..fe2a8cb 100644 --- a/media/gpu/mac/vt_video_decode_accelerator_mac.cc +++ b/media/gpu/mac/vt_video_decode_accelerator_mac.cc
@@ -1395,6 +1395,7 @@ NOTIFY_STATUS("Failed to initialize GLImageIOSurface", PLATFORM_FAILURE, SFT_PLATFORM_ERROR); } + gl_image->DisableInUseByWindowServer(); gfx::ColorSpace color_space = GetImageBufferColorSpace(frame.image); gl_image->SetColorSpaceForYUVToRGBConversion(color_space);
diff --git a/mojo/public/java/system/javatests/src/org/chromium/mojo/system/impl/CoreImplTest.java b/mojo/public/java/system/javatests/src/org/chromium/mojo/system/impl/CoreImplTest.java index da1e1093..44ec78c3 100644 --- a/mojo/public/java/system/javatests/src/org/chromium/mojo/system/impl/CoreImplTest.java +++ b/mojo/public/java/system/javatests/src/org/chromium/mojo/system/impl/CoreImplTest.java
@@ -13,9 +13,9 @@ import org.junit.runner.RunWith; import org.chromium.base.test.BaseJUnit4ClassRunner; +import org.chromium.base.test.util.Batch; import org.chromium.mojo.MojoTestRule; import org.chromium.mojo.system.Core; -import org.chromium.mojo.system.Core.HandleSignals; import org.chromium.mojo.system.DataPipe; import org.chromium.mojo.system.Handle; import org.chromium.mojo.system.InvalidHandle; @@ -32,25 +32,16 @@ import java.util.Collections; import java.util.List; import java.util.Random; -import java.util.concurrent.Executors; -import java.util.concurrent.ScheduledExecutorService; /** * Testing the core API. */ @RunWith(BaseJUnit4ClassRunner.class) +@Batch(Batch.UNIT_TESTS) public class CoreImplTest { @Rule public MojoTestRule mTestRule = new MojoTestRule(); - private static final long RUN_LOOP_TIMEOUT_MS = 5; - - private static final ScheduledExecutorService WORKER = - Executors.newSingleThreadScheduledExecutor(); - - private static final HandleSignals ALL_SIGNALS = - HandleSignals.none().setPeerClosed(true).setReadable(true).setWritable(true); - private List<Handle> mHandlesToClose = new ArrayList<Handle>(); /**
diff --git a/net/BUILD.gn b/net/BUILD.gn index 5c45fd1..3331c59c 100644 --- a/net/BUILD.gn +++ b/net/BUILD.gn
@@ -1464,6 +1464,7 @@ } if (is_fuchsia) { + deps += [ "//third_party/fuchsia-sdk/sdk/pkg/async-loop-cpp" ] public_deps += [ "//third_party/fuchsia-sdk/sdk/fidl/fuchsia.netstack" ] sources += [ "base/network_change_notifier_fuchsia.cc",
diff --git a/net/base/network_change_notifier_fuchsia.cc b/net/base/network_change_notifier_fuchsia.cc index e5cde07..f1578ddd 100644 --- a/net/base/network_change_notifier_fuchsia.cc +++ b/net/base/network_change_notifier_fuchsia.cc
@@ -4,7 +4,9 @@ #include "net/base/network_change_notifier_fuchsia.h" +#include <lib/async-loop/cpp/loop.h> #include <lib/sys/cpp/component_context.h> + #include <algorithm> #include <string> #include <utility> @@ -28,7 +30,7 @@ required_features) {} NetworkChangeNotifierFuchsia::NetworkChangeNotifierFuchsia( - fuchsia::netstack::NetstackPtr netstack, + fidl::InterfaceHandle<fuchsia::netstack::Netstack> netstack, uint32_t required_features, SystemDnsConfigChangeNotifier* system_dns_config_notifier) : NetworkChangeNotifier(NetworkChangeCalculatorParams(), @@ -36,35 +38,29 @@ required_features_(required_features) { DCHECK(netstack); - // Temporarily re-wrap our Netstack channel so we can query the interfaces - // and routing table synchronously to populate the initial state. - fuchsia::netstack::NetstackSyncPtr sync_netstack; - sync_netstack.Bind(netstack.Unbind()); - DCHECK(sync_netstack); - - // Manually fetch the interfaces and routes. - std::vector<fuchsia::netstack::NetInterface> interfaces; - zx_status_t status = sync_netstack->GetInterfaces(&interfaces); - ZX_CHECK(status == ZX_OK, status) << "synchronous GetInterfaces()"; - std::vector<fuchsia::netstack::RouteTableEntry> routes; - status = sync_netstack->GetRouteTable(&routes); - ZX_CHECK(status == ZX_OK, status) << "synchronous GetInterfaces()"; - // This will Notify internal observers like the NetworkChangeCalculator - // to be properly updated. - OnRouteTableReceived(std::move(interfaces), std::move(routes)); - - // Re-wrap Netstack back into an asynchronous pointer. - netstack_.Bind(sync_netstack.Unbind()); - DCHECK(netstack_); netstack_.set_error_handler([](zx_status_t status) { - // TODO(https://crbug.com/901092): Unit tests that use NetworkService are - // crashing because NetworkService does not clean up properly, and the - // netstack connection is cancelled, causing this fatal error. - // When the NetworkService cleanup is fixed, we should make this log FATAL. - ZX_LOG(ERROR, status) << "Lost connection to netstack."; + ZX_LOG(FATAL, status) << "Lost connection to netstack."; }); + netstack_.events().OnInterfacesChanged = fit::bind_member( this, &NetworkChangeNotifierFuchsia::ProcessInterfaceList); + + // Temporarily bind to a local dispatcher so we can synchronously wait for the + // synthetic event to populate the initial state. + async::Loop loop(&kAsyncLoopConfigNeverAttachToThread); + zx_status_t status = netstack_.Bind(std::move(netstack), loop.dispatcher()); + ZX_CHECK(status == ZX_OK, status) << "Bind()"; + on_initial_interfaces_received_ = + base::BindOnce(&async::Loop::Quit, base::Unretained(&loop)); + status = loop.Run(); + ZX_CHECK(status == ZX_ERR_CANCELED, status) << "loop.Run()"; + + // Bind to the dispatcher for the thread's MessagePump. + // + // Note this must be done before |loop| is destroyed, since that would close + // the interface handle underlying |netstack_|. + status = netstack_.Bind(netstack_.Unbind()); + ZX_CHECK(status == ZX_OK, status) << "Bind()"; } NetworkChangeNotifierFuchsia::~NetworkChangeNotifierFuchsia() { @@ -148,6 +144,10 @@ base::subtle::Release_Store(&cached_connection_type_, connection_type); NotifyObserversOfConnectionTypeChange(); } + + if (on_initial_interfaces_received_) { + std::move(on_initial_interfaces_received_).Run(); + } } } // namespace net
diff --git a/net/base/network_change_notifier_fuchsia.h b/net/base/network_change_notifier_fuchsia.h index c730198..bae7d84d 100644 --- a/net/base/network_change_notifier_fuchsia.h +++ b/net/base/network_change_notifier_fuchsia.h
@@ -9,6 +9,7 @@ #include <lib/fidl/cpp/binding.h> #include "base/atomicops.h" +#include "base/callback.h" #include "base/containers/flat_set.h" #include "base/gtest_prod_util.h" #include "base/threading/thread_checker.h" @@ -37,7 +38,7 @@ // Interfaces can be filtered out by passing in |required_features|, which is // defined in fuchsia::hardware::ethernet. NetworkChangeNotifierFuchsia( - fuchsia::netstack::NetstackPtr netstack, + fidl::InterfaceHandle<fuchsia::netstack::Netstack> netstack, uint32_t required_features, SystemDnsConfigChangeNotifier* system_dns_config_notifier = nullptr); @@ -59,6 +60,10 @@ fuchsia::netstack::NetstackPtr netstack_; + // Used to allow the constructor to block until the initial state is received + // from |netstack_|. + base::OnceClosure on_initial_interfaces_received_; + // The ConnectionType of the default network interface, stored as an atomic // 32-bit int for safe concurrent access. base::subtle::Atomic32 cached_connection_type_ = CONNECTION_UNKNOWN;
diff --git a/net/base/network_change_notifier_fuchsia_unittest.cc b/net/base/network_change_notifier_fuchsia_unittest.cc index f6354fad..cf18b3c 100644 --- a/net/base/network_change_notifier_fuchsia_unittest.cc +++ b/net/base/network_change_notifier_fuchsia_unittest.cc
@@ -102,26 +102,27 @@ // Partial fake implementation of a Netstack. class FakeNetstack : public fuchsia::netstack::testing::Netstack_TestBase { public: - explicit FakeNetstack( - fidl::InterfaceRequest<fuchsia::netstack::Netstack> netstack_request) - : binding_(this) { - CHECK_EQ(ZX_OK, binding_.Bind(std::move(netstack_request))); - } + explicit FakeNetstack() : binding_(this) {} ~FakeNetstack() override = default; + void Bind( + fidl::InterfaceRequest<fuchsia::netstack::Netstack> netstack_request) { + CHECK_EQ(ZX_OK, binding_.Bind(std::move(netstack_request))); + binding_.events().OnInterfacesChanged(CloneNetInterfaces(interfaces_)); + } + // Sets the interfaces reported by the fake Netstack and sends an // OnInterfacesChanged() event to the client. void SetInterfaces(std::vector<fuchsia::netstack::NetInterface> interfaces) { interfaces_ = std::move(interfaces); - binding_.events().OnInterfacesChanged(CloneNetInterfaces(interfaces_)); + if (binding_.is_bound()) { + binding_.events().OnInterfacesChanged(CloneNetInterfaces(interfaces_)); + } } private: - void GetInterfaces(GetInterfacesCallback callback) override { - callback(CloneNetInterfaces(interfaces_)); - } - void GetRouteTable(GetRouteTableCallback callback) override { + CHECK(binding_.is_bound()); std::vector<fuchsia::netstack::RouteTableEntry> table(2); table[0].nicid = kDefaultInterfaceId; @@ -149,16 +150,18 @@ class FakeNetstackAsync { public: - explicit FakeNetstackAsync( - fidl::InterfaceRequest<fuchsia::netstack::Netstack> netstack_request) - : thread_("Netstack Thread") { + explicit FakeNetstackAsync() : thread_("Netstack Thread") { base::Thread::Options options(base::MessagePumpType::IO, 0); CHECK(thread_.StartWithOptions(options)); - netstack_ = base::SequenceBound<FakeNetstack>(thread_.task_runner(), - std::move(netstack_request)); + netstack_ = base::SequenceBound<FakeNetstack>(thread_.task_runner()); } ~FakeNetstackAsync() = default; + void Bind( + fidl::InterfaceRequest<fuchsia::netstack::Netstack> netstack_request) { + netstack_.Post(FROM_HERE, &FakeNetstack::Bind, std::move(netstack_request)); + } + // Asynchronously update the state of the netstack. void SetInterfaces( const std::vector<fuchsia::netstack::NetInterface>& interfaces) { @@ -291,7 +294,7 @@ class NetworkChangeNotifierFuchsiaTest : public testing::Test { public: - NetworkChangeNotifierFuchsiaTest() : netstack_(netstack_ptr_.NewRequest()) {} + NetworkChangeNotifierFuchsiaTest() {} ~NetworkChangeNotifierFuchsiaTest() override = default; // Creates a NetworkChangeNotifier and spins the MessageLoop to allow it to @@ -303,11 +306,14 @@ // notifier queries it. netstack_.FlushNetstackThread(); + CHECK(!netstack_handle_); + netstack_.Bind(netstack_handle_.NewRequest()); + // Use a noop DNS notifier. dns_config_notifier_ = std::make_unique<SystemDnsConfigChangeNotifier>( nullptr /* task_runner */, nullptr /* dns_config_service */); notifier_.reset(new NetworkChangeNotifierFuchsia( - std::move(netstack_ptr_), required_features, + std::move(netstack_handle_), required_features, dns_config_notifier_.get())); type_observer_ = std::make_unique<FakeConnectionTypeObserver>(); @@ -324,7 +330,7 @@ base::test::SingleThreadTaskEnvironment task_environment_{ base::test::SingleThreadTaskEnvironment::MainThreadType::IO}; - fuchsia::netstack::NetstackPtr netstack_ptr_; + fidl::InterfaceHandle<fuchsia::netstack::Netstack> netstack_handle_; FakeNetstackAsync netstack_; // Allows us to allocate our own NetworkChangeNotifier for unit testing.
diff --git a/net/url_request/url_request_context_getter.h b/net/url_request/url_request_context_getter.h index 6726c8c..3c59f5e 100644 --- a/net/url_request/url_request_context_getter.h +++ b/net/url_request/url_request_context_getter.h
@@ -16,10 +16,6 @@ class SingleThreadTaskRunner; } // namespace base -namespace content { -class WebSocketManager; -} - #if defined(OS_IOS) namespace web { class NetworkContextOwner; @@ -69,11 +65,9 @@ void NotifyContextShuttingDown(); private: - // AddObserver and RemoveObserver are deprecated. Friend URLFetcherCore, - // content::WebSocketManager, and web::NetworkContextOwner to restrict - // visibility. + // AddObserver and RemoveObserver are deprecated. Friend URLFetcherCore and + // web::NetworkContextOwner to restrict visibility. friend class URLFetcherCore; - friend class content::WebSocketManager; #if defined(OS_IOS) friend class web::NetworkContextOwner;
diff --git a/remoting/host/heartbeat_sender.cc b/remoting/host/heartbeat_sender.cc index ba0c27b..6795fbe7 100644 --- a/remoting/host/heartbeat_sender.cc +++ b/remoting/host/heartbeat_sender.cc
@@ -10,7 +10,7 @@ #include <utility> #include "base/bind.h" -#include "base/hash/md5.h" +#include "base/hash/sha1.h" #include "base/rand_util.h" #include "base/strings/string_number_conversions.h" #include "base/strings/stringize_macros.h" @@ -397,7 +397,7 @@ // a Linux OS. #if defined(OS_LINUX) && !defined(OS_CHROMEOS) if (is_googler_) { - heartbeat->set_hostname_hash(base::MD5String(net::GetHostName())); + heartbeat->set_hostname_hash(base::SHA1HashString(net::GetHostName())); } #endif return heartbeat;
diff --git a/services/device/usb/BUILD.gn b/services/device/usb/BUILD.gn index d754b63..d2941e4 100644 --- a/services/device/usb/BUILD.gn +++ b/services/device/usb/BUILD.gn
@@ -36,6 +36,8 @@ "usb_device_handle_win.h", "usb_device_linux.cc", "usb_device_linux.h", + "usb_device_mac.cc", + "usb_device_mac.h", "usb_device_win.cc", "usb_device_win.h", "usb_endpoint_android.cc", @@ -46,6 +48,8 @@ "usb_service.h", "usb_service_android.cc", "usb_service_android.h", + "usb_service_mac.cc", + "usb_service_mac.h", "usb_service_win.cc", "usb_service_win.h", "webusb_descriptors.cc",
diff --git a/services/device/usb/usb_descriptors.cc b/services/device/usb/usb_descriptors.cc index 65b28e9c..a707fb0 100644 --- a/services/device/usb/usb_descriptors.cc +++ b/services/device/usb/usb_descriptors.cc
@@ -110,8 +110,7 @@ scoped_refptr<base::RefCountedBytes> buffer, size_t length) { if (status == UsbTransferStatus::COMPLETED) { - if (!desc->Parse( - std::vector<uint8_t>(buffer->front(), buffer->front() + length))) { + if (!desc->Parse(base::make_span(buffer->front(), length))) { LOG(ERROR) << "Failed to parse configuration descriptor."; } } else { @@ -157,8 +156,7 @@ } std::unique_ptr<UsbDeviceDescriptor> desc(new UsbDeviceDescriptor()); - if (!desc->Parse( - std::vector<uint8_t>(buffer->front(), buffer->front() + length))) { + if (!desc->Parse(base::make_span(buffer->front(), length))) { LOG(ERROR) << "Device descriptor parsing error."; std::move(callback).Run(nullptr); return; @@ -262,7 +260,7 @@ UsbDeviceDescriptor::~UsbDeviceDescriptor() = default; -bool UsbDeviceDescriptor::Parse(const std::vector<uint8_t>& buffer) { +bool UsbDeviceDescriptor::Parse(base::span<const uint8_t> buffer) { mojom::UsbConfigurationInfo* last_config = nullptr; mojom::UsbInterfaceInfo* last_interface = nullptr; mojom::UsbEndpointInfo* last_endpoint = nullptr;
diff --git a/services/device/usb/usb_descriptors.h b/services/device/usb/usb_descriptors.h index ba173395..482bf4fa 100644 --- a/services/device/usb/usb_descriptors.h +++ b/services/device/usb/usb_descriptors.h
@@ -41,7 +41,7 @@ // be used to populate this struct's fields. This function may be called more // than once (i.e. for multiple buffers containing a configuration descriptor // each). - bool Parse(const std::vector<uint8_t>& buffer); + bool Parse(base::span<const uint8_t> buffer); uint8_t i_manufacturer = 0; uint8_t i_product = 0;
diff --git a/services/device/usb/usb_device.h b/services/device/usb/usb_device.h index 35b6c5d6..6851cb69 100644 --- a/services/device/usb/usb_device.h +++ b/services/device/usb/usb_device.h
@@ -150,6 +150,7 @@ friend class UsbServiceAndroid; friend class UsbServiceImpl; friend class UsbServiceLinux; + friend class UsbServiceMac; friend class UsbServiceWin; void OnDisconnect();
diff --git a/services/device/usb/usb_device_impl.cc b/services/device/usb/usb_device_impl.cc index ed25941..94f2d9c 100644 --- a/services/device/usb/usb_device_impl.cc +++ b/services/device/usb/usb_device_impl.cc
@@ -78,7 +78,7 @@ continue; } - if (!usb_descriptor.Parse(std::vector<uint8_t>(buffer, buffer + rv))) + if (!usb_descriptor.Parse(base::make_span(buffer, rv))) USB_LOG(EVENT) << "Config descriptor index " << i << " was corrupt."; free(buffer);
diff --git a/services/device/usb/usb_device_mac.cc b/services/device/usb/usb_device_mac.cc new file mode 100644 index 0000000..40667a3f --- /dev/null +++ b/services/device/usb/usb_device_mac.cc
@@ -0,0 +1,24 @@ +// 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 "services/device/usb/usb_device_mac.h" + +#include <utility> + +#include "services/device/usb/usb_descriptors.h" +#include "services/device/usb/usb_device_handle.h" + +namespace device { + +UsbDeviceMac::UsbDeviceMac(uint64_t entry_id, + mojom::UsbDeviceInfoPtr device_info) + : UsbDevice(std::move(device_info)), entry_id_(entry_id) {} + +UsbDeviceMac::~UsbDeviceMac() = default; + +void UsbDeviceMac::Open(OpenCallback callback) { + std::move(callback).Run(nullptr); +} + +} // namespace device
diff --git a/services/device/usb/usb_device_mac.h b/services/device/usb/usb_device_mac.h new file mode 100644 index 0000000..1d45ea56 --- /dev/null +++ b/services/device/usb/usb_device_mac.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 SERVICES_DEVICE_USB_USB_DEVICE_MAC_H_ +#define SERVICES_DEVICE_USB_USB_DEVICE_MAC_H_ + +#include "services/device/usb/usb_device.h" + +namespace device { + +class UsbDeviceMac : public UsbDevice { + public: + UsbDeviceMac(uint64_t entry_id, mojom::UsbDeviceInfoPtr device_info); + UsbDeviceMac(const UsbDeviceMac&) = delete; + UsbDeviceMac& operator=(const UsbDeviceMac&) = delete; + + // UsbDevice implementation: + void Open(OpenCallback callback) override; + + uint64_t entry_id() const { return entry_id_; } + + protected: + friend class UsbServiceMac; + + ~UsbDeviceMac() override; + + private: + const uint64_t entry_id_; +}; + +} // namespace device + +#endif // SERVICES_DEVICE_USB_USB_DEVICE_MAC_H_
diff --git a/services/device/usb/usb_service.cc b/services/device/usb/usb_service.cc index cd038e0..94be02c 100644 --- a/services/device/usb/usb_service.cc +++ b/services/device/usb/usb_service.cc
@@ -4,6 +4,8 @@ #include "services/device/usb/usb_service.h" +#include <utility> + #include "base/bind.h" #include "base/feature_list.h" #include "base/location.h" @@ -21,7 +23,9 @@ #elif defined(USE_UDEV) #include "services/device/usb/usb_service_linux.h" #else -#if defined(OS_WIN) +#if defined(OS_MAC) +#include "services/device/usb/usb_service_mac.h" +#elif defined(OS_WIN) #include "services/device/usb/usb_service_win.h" #endif #include "services/device/usb/usb_service_impl.h" @@ -55,7 +59,10 @@ else return base::WrapUnique(new UsbServiceImpl()); #elif defined(OS_MAC) - return base::WrapUnique(new UsbServiceImpl()); + if (base::FeatureList::IsEnabled(kNewUsbBackend)) + return base::WrapUnique(new UsbServiceMac()); + else + return base::WrapUnique(new UsbServiceImpl()); #else return nullptr; #endif
diff --git a/services/device/usb/usb_service_mac.cc b/services/device/usb/usb_service_mac.cc new file mode 100644 index 0000000..a968239 --- /dev/null +++ b/services/device/usb/usb_service_mac.cc
@@ -0,0 +1,326 @@ +// 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 "services/device/usb/usb_service_mac.h" + +#include <CoreFoundation/CFBase.h> +#include <CoreFoundation/CoreFoundation.h> +#include <IOKit/IOCFPlugIn.h> +#include <IOKit/IOReturn.h> + +#include <memory> +#include <string> +#include <utility> +#include <vector> + +#include "base/mac/foundation_util.h" +#include "base/mac/scoped_ioplugininterface.h" +#include "base/optional.h" +#include "base/strings/stringprintf.h" +#include "base/strings/sys_string_conversions.h" +#include "base/strings/utf_string_conversions.h" +#include "components/device_event_log/device_event_log.h" +#include "services/device/usb/usb_descriptors.h" +#include "services/device/usb/usb_device_mac.h" + +namespace device { + +namespace { + +// USB class codes are defined by the USB specification. +// https://www.usb.org/defined-class-codes +constexpr uint8_t kDeviceClassHub = 0x09; + +// These methods are similar to the ones used by HidServiceMac. +// TODO(https://crbug.com/1104271): Move these methods into a shared utility +// file. +base::Optional<base::string16> GetStringProperty(io_service_t service, + CFStringRef key) { + base::ScopedCFTypeRef<CFStringRef> ref(base::mac::CFCast<CFStringRef>( + IORegistryEntryCreateCFProperty(service, key, kCFAllocatorDefault, 0))); + + if (!ref) + return base::nullopt; + + return base::SysCFStringRefToUTF16(ref); +} + +base::Optional<uint16_t> GetUint16Property(io_service_t service, + CFStringRef property) { + base::ScopedCFTypeRef<CFNumberRef> cf_number( + base::mac::CFCast<CFNumberRef>(IORegistryEntryCreateCFProperty( + service, property, kCFAllocatorDefault, 0))); + + if (!cf_number) + return base::nullopt; + if (CFGetTypeID(cf_number) != CFNumberGetTypeID()) + return base::nullopt; + uint16_t value; + if (!CFNumberGetValue((CFNumberRef)cf_number, kCFNumberSInt16Type, &value)) + return base::nullopt; + return value; +} + +base::Optional<uint8_t> GetUint8Property(io_service_t service, + CFStringRef property) { + base::ScopedCFTypeRef<CFNumberRef> cf_number( + base::mac::CFCast<CFNumberRef>(IORegistryEntryCreateCFProperty( + service, property, kCFAllocatorDefault, 0))); + + bool success = false; + uint8_t value; + if (cf_number) { + if (CFGetTypeID(cf_number) == CFNumberGetTypeID()) { + success = + CFNumberGetValue((CFNumberRef)cf_number, kCFNumberSInt8Type, &value); + } + } + + if (success) + return value; + + return base::nullopt; +} + +} // namespace + +UsbServiceMac::UsbServiceMac() { + notify_port_.reset(IONotificationPortCreate(kIOMasterPortDefault)); + CFRunLoopAddSource(CFRunLoopGetMain(), + IONotificationPortGetRunLoopSource(notify_port_.get()), + kCFRunLoopDefaultMode); + + IOReturn result = IOServiceAddMatchingNotification( + notify_port_.get(), kIOFirstMatchNotification, + IOServiceMatching(kIOUSBDeviceClassName), FirstMatchCallback, this, + devices_added_iterator_.InitializeInto()); + if (result != kIOReturnSuccess) { + USB_LOG(ERROR) << "Failed to listen for device arrival: " << std::hex + << result << "."; + return; + } + // Drain |devices_added_iterator_| to arm the notification. + AddDevices(); + + result = IOServiceAddMatchingNotification( + notify_port_.get(), kIOTerminatedNotification, + IOServiceMatching(kIOUSBDeviceClassName), TerminatedCallback, this, + devices_removed_iterator_.InitializeInto()); + if (result != kIOReturnSuccess) { + USB_LOG(ERROR) << "Failed to listen for device removal: " << std::hex + << result << "."; + return; + } + + // Drain |devices_removed_iterator_| to arm the notification. + RemoveDevices(); +} + +UsbServiceMac::~UsbServiceMac() = default; + +// static +void UsbServiceMac::FirstMatchCallback(void* context, io_iterator_t iterator) { + DCHECK_EQ(CFRunLoopGetMain(), CFRunLoopGetCurrent()); + UsbServiceMac* service = reinterpret_cast<UsbServiceMac*>(context); + DCHECK_EQ(service->devices_added_iterator_, iterator); + service->AddDevices(); +} + +// static +void UsbServiceMac::TerminatedCallback(void* context, io_iterator_t iterator) { + DCHECK_EQ(CFRunLoopGetMain(), CFRunLoopGetCurrent()); + UsbServiceMac* service = reinterpret_cast<UsbServiceMac*>(context); + DCHECK_EQ(service->devices_removed_iterator_, iterator); + service->RemoveDevices(); +} + +void UsbServiceMac::AddDevices() { + base::mac::ScopedIOObject<io_service_t> device; + while (device.reset(IOIteratorNext(devices_added_iterator_)), device) { + AddDevice(device); + } +} + +void UsbServiceMac::AddDevice(io_service_t device) { + base::mac::ScopedIOPluginInterface<IOCFPlugInInterface> plugin_interface; + int32_t score; + + // This call fails sometimes due to a resource shortage. + // TODO(richardmachado): Figure out what is causing this failure. + IOReturn kr = IOCreatePlugInInterfaceForService( + device, kIOUSBDeviceUserClientTypeID, kIOCFPlugInInterfaceID, + plugin_interface.InitializeInto(), &score); + + if ((kr != kIOReturnSuccess) || !plugin_interface.get()) { + USB_LOG(ERROR) << "Unable to create a plug-in: " << std::hex << kr << "."; + return; + } + + base::mac::ScopedIOPluginInterface<IOUSBDeviceInterface182> device_interface; + IOReturn result = + (*plugin_interface) + ->QueryInterface( + plugin_interface.get(), + CFUUIDGetUUIDBytes(kIOUSBDeviceInterfaceID), + reinterpret_cast<LPVOID*>(device_interface.InitializeInto())); + + if (result || !device_interface) { + USB_LOG(ERROR) << "Couldn’t create a device interface."; + return; + } + + uint8_t device_class; + if ((*device_interface)->GetDeviceClass(device_interface, &device_class) != + kIOReturnSuccess) { + return; + } + + // We don't want to enumerate hubs. + if (device_class == kDeviceClassHub) + return; + + uint16_t vendor_id; + if ((*device_interface)->GetDeviceVendor(device_interface, &vendor_id) != + kIOReturnSuccess) { + return; + } + + uint16_t product_id; + if ((*device_interface)->GetDeviceProduct(device_interface, &product_id) != + kIOReturnSuccess) { + return; + } + + uint8_t device_protocol; + if ((*device_interface) + ->GetDeviceProtocol(device_interface, &device_protocol) != + kIOReturnSuccess) { + return; + } + + uint8_t device_subclass; + if ((*device_interface) + ->GetDeviceSubClass(device_interface, &device_subclass) != + kIOReturnSuccess) { + return; + } + + uint16_t device_version; + if ((*device_interface) + ->GetDeviceReleaseNumber(device_interface, &device_version) != + kIOReturnSuccess) { + return; + } + + uint32_t location_id; + if ((*device_interface)->GetLocationID(device_interface, &location_id) != + kIOReturnSuccess) { + return; + } + + uint64_t entry_id; + if (IORegistryEntryGetRegistryEntryID(device, &entry_id) != kIOReturnSuccess) + return; + + base::Optional<uint8_t> property_uint8 = + GetUint8Property(device, CFSTR("PortNum")); + if (!property_uint8.has_value()) + return; + uint8_t port_number = property_uint8.value(); + + base::Optional<uint16_t> property_uint16 = + GetUint16Property(device, CFSTR("bcdUSB")); + uint16_t usb_version; + if (!property_uint16.has_value()) + return; + usb_version = property_uint16.value(); + + base::Optional<base::string16> property_string16 = + GetStringProperty(device, CFSTR(kUSBVendorString)); + base::string16 manufacturer_string; + if (property_string16.has_value()) + manufacturer_string = property_string16.value(); + + property_string16 = GetStringProperty(device, CFSTR(kUSBSerialNumberString)); + base::string16 serial_number_string; + if (property_string16.has_value()) + serial_number_string = property_string16.value(); + + property_string16 = GetStringProperty(device, CFSTR(kUSBProductString)); + base::string16 product_string; + if (property_string16.has_value()) + product_string = property_string16.value(); + + uint8_t num_config; + if ((*device_interface) + ->GetNumberOfConfigurations(device_interface, &num_config) != + kIOReturnSuccess) { + return; + } + + // Populate device descriptor with all necessary configuration info. + auto descriptor = std::make_unique<UsbDeviceDescriptor>(); + IOUSBConfigurationDescriptorPtr desc; + for (uint8_t i = 0; i < num_config; i++) { + if ((*device_interface) + ->GetConfigurationDescriptorPtr(device_interface, i, &desc) != + kIOReturnSuccess) { + return; + } + if (!descriptor->Parse(base::make_span(reinterpret_cast<uint8_t*>(desc), + desc->wTotalLength))) { + return; + } + } + + descriptor->device_info->usb_version_major = usb_version >> 8; + descriptor->device_info->usb_version_minor = usb_version >> 4 & 0xf; + descriptor->device_info->usb_version_subminor = usb_version & 0xf; + descriptor->device_info->class_code = device_class; + descriptor->device_info->subclass_code = device_subclass; + descriptor->device_info->protocol_code = device_protocol; + descriptor->device_info->vendor_id = vendor_id; + descriptor->device_info->product_id = product_id; + descriptor->device_info->device_version_major = device_version >> 8; + descriptor->device_info->device_version_minor = device_version >> 4 & 0xf; + descriptor->device_info->device_version_subminor = device_version & 0xf; + descriptor->device_info->manufacturer_name = manufacturer_string; + descriptor->device_info->product_name = product_string; + descriptor->device_info->serial_number = serial_number_string; + descriptor->device_info->bus_number = location_id >> 24; + descriptor->device_info->port_number = port_number; + + scoped_refptr<UsbDeviceMac> mac_device = + new UsbDeviceMac(entry_id, std::move(descriptor->device_info)); + + device_map_[entry_id] = mac_device; + devices()[mac_device->guid()] = mac_device; + + NotifyDeviceAdded(mac_device); +} + +void UsbServiceMac::RemoveDevices() { + base::mac::ScopedIOObject<io_service_t> device; + while (device.reset(IOIteratorNext(devices_removed_iterator_)), device) { + uint64_t entry_id; + + if (kIOReturnSuccess != + IORegistryEntryGetRegistryEntryID(device, &entry_id)) { + continue; + } + + auto it = device_map_.find(entry_id); + if (it == device_map_.end()) + continue; + + auto mac_device = it->second; + device_map_.erase(it); + + auto by_guid_it = devices().find(mac_device->guid()); + devices().erase(by_guid_it); + NotifyDeviceRemoved(mac_device); + } +} + +} // namespace device
diff --git a/services/device/usb/usb_service_mac.h b/services/device/usb/usb_service_mac.h new file mode 100644 index 0000000..41457029 --- /dev/null +++ b/services/device/usb/usb_service_mac.h
@@ -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. + +#ifndef SERVICES_DEVICE_USB_USB_SERVICE_MAC_H_ +#define SERVICES_DEVICE_USB_USB_SERVICE_MAC_H_ + +#include <CoreFoundation/CoreFoundation.h> +#include <IOKit/IOKitLib.h> +#include <IOKit/usb/IOUSBLib.h> + +#include <string> +#include <unordered_map> + +#include "base/mac/foundation_util.h" +#include "base/mac/scoped_ionotificationportref.h" +#include "base/mac/scoped_ioobject.h" +#include "base/memory/weak_ptr.h" +#include "services/device/usb/usb_service.h" + +namespace device { + +class UsbDeviceMac; + +// The USB service is responsible for device discovery on the system, which +// allows it to re-use device handles to prevent competition for the same USB +// device. +class UsbServiceMac final : public UsbService { + public: + UsbServiceMac(); + UsbServiceMac(const UsbServiceMac&) = delete; + UsbServiceMac& operator=(const UsbServiceMac&) = delete; + ~UsbServiceMac() override; + + private: + // IOService matching callbacks. + static void FirstMatchCallback(void* context, io_iterator_t iterator); + static void TerminatedCallback(void* context, io_iterator_t iterator); + + void AddDevices(); + void AddDevice(io_service_t device); + void RemoveDevices(); + + std::unordered_map<uint64_t, scoped_refptr<UsbDeviceMac>> device_map_; + + base::mac::ScopedIONotificationPortRef notify_port_; + base::mac::ScopedIOObject<io_iterator_t> devices_added_iterator_; + base::mac::ScopedIOObject<io_iterator_t> devices_removed_iterator_; + + base::WeakPtrFactory<UsbServiceMac> weak_factory_{this}; +}; + +} // namespace device + +#endif // SERVICES_DEVICE_USB_USB_SERVICE_MAC_H_
diff --git a/services/network/websocket.h b/services/network/websocket.h index 4d4f3ef..c7eca7f 100644 --- a/services/network/websocket.h +++ b/services/network/websocket.h
@@ -79,8 +79,6 @@ void StartReceiving() override; void StartClosingHandshake(uint16_t code, const std::string& reason) override; - bool handshake_succeeded() const { return handshake_succeeded_; } - // Whether to allow sending/setting cookies during WebSocket handshakes for // |url|. This decision is based on the |options_| and |origin_| this // WebSocket was created with. @@ -202,8 +200,6 @@ // For 3rd-party cookie permission checking. net::SiteForCookies site_for_cookies_; - // handshake_succeeded_ is used by WebSocketManager to manage counters for - // per-renderer WebSocket throttling. bool handshake_succeeded_ = false; const HasRawHeadersAccess has_raw_headers_access_;
diff --git a/services/network/websocket_throttler.h b/services/network/websocket_throttler.h index 510c057..7497b2d 100644 --- a/services/network/websocket_throttler.h +++ b/services/network/websocket_throttler.h
@@ -103,8 +103,6 @@ // This class is for throttling WebSocket connections. WebSocketThrottler is // a set of per-renderer throttlers. -// This class is only used in the network service. content::WebSocketManager -// uses WebSocketPerProcessThrottler directly. class COMPONENT_EXPORT(NETWORK_SERVICE) WebSocketThrottler final { public: using PendingConnection = WebSocketPerProcessThrottler::PendingConnection;
diff --git a/testing/buildbot/PRESUBMIT.py b/testing/buildbot/PRESUBMIT.py index c95fec5..e63e50e 100644 --- a/testing/buildbot/PRESUBMIT.py +++ b/testing/buildbot/PRESUBMIT.py
@@ -9,23 +9,6 @@ """ -# TODO(crbug.com/1109980): Remove this once the production freeze is over, which -# is expected to be on August 3rd. -def EnforceProductionFreeze(input_api, output_api): - footers = input_api.change.GitFootersFromDescription() - if footers.get('Ignore-Cq-Freeze'): - return [] - - message = """ - Your change is modifying files which may impact the Chromium CQ. The Chromium - CQ is currently in a production freeze. Please get a review from someone in - the //infra/OWNERS file (preferably a trooper), and then add the - 'Ignore-CQ-Freeze' git footer to your CL. See https://crbug.com/1109980 for - more details. - """ - return [output_api.PresubmitError(message)] - - def CommonChecks(input_api, output_api): commands = [ input_api.Command( @@ -59,7 +42,6 @@ messages = [] messages.extend(input_api.RunTests(commands)) - messages.extend(EnforceProductionFreeze(input_api, output_api)) return messages
diff --git a/testing/buildbot/chrome.ci.json b/testing/buildbot/chrome.ci.json index a5d7e98..b93019d7 100644 --- a/testing/buildbot/chrome.ci.json +++ b/testing/buildbot/chrome.ci.json
@@ -1365,8 +1365,7 @@ "gtest_tests": [ { "args": [ - "--test-launcher-filter-file=../../testing/buildbot/filters/chromeos.base_unittests.filter", - "--flash" + "--test-launcher-filter-file=../../testing/buildbot/filters/chromeos.base_unittests.filter" ], "merge": { "args": [], @@ -1390,9 +1389,6 @@ } }, { - "args": [ - "--flash" - ], "merge": { "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -1416,9 +1412,6 @@ } }, { - "args": [ - "--flash" - ], "merge": { "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -1442,8 +1435,7 @@ }, { "args": [ - "--strip-chrome", - "--flash" + "--strip-chrome" ], "merge": { "script": "//tools/perf/process_perf_results.py" @@ -1472,8 +1464,7 @@ "args": [ "--browser=cros-chrome", "--remote=variable_chromeos_device_hostname", - "--xvfb", - "--flash" + "--xvfb" ], "isolate_name": "telemetry_perf_unittests", "merge": { @@ -1503,8 +1494,7 @@ "args": [ "--browser=cros-chrome", "--remote=variable_chromeos_device_hostname", - "--jobs=1", - "--flash" + "--jobs=1" ], "isolate_name": "telemetry_unittests", "merge": { @@ -1539,8 +1529,7 @@ "gtest_tests": [ { "args": [ - "--test-launcher-filter-file=../../testing/buildbot/filters/chromeos.base_unittests.filter", - "--flash" + "--test-launcher-filter-file=../../testing/buildbot/filters/chromeos.base_unittests.filter" ], "merge": { "args": [], @@ -1564,9 +1553,6 @@ } }, { - "args": [ - "--flash" - ], "merge": { "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -1590,9 +1576,6 @@ } }, { - "args": [ - "--flash" - ], "merge": { "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -1616,8 +1599,7 @@ }, { "args": [ - "--strip-chrome", - "--flash" + "--strip-chrome" ], "merge": { "script": "//tools/perf/process_perf_results.py"
diff --git a/testing/buildbot/chrome.json b/testing/buildbot/chrome.json index ad4906a..0a34ccd 100644 --- a/testing/buildbot/chrome.json +++ b/testing/buildbot/chrome.json
@@ -735,8 +735,7 @@ "gtest_tests": [ { "args": [ - "--test-launcher-filter-file=../../testing/buildbot/filters/chromeos.base_unittests.filter", - "--flash" + "--test-launcher-filter-file=../../testing/buildbot/filters/chromeos.base_unittests.filter" ], "merge": { "args": [], @@ -760,9 +759,6 @@ } }, { - "args": [ - "--flash" - ], "merge": { "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -786,9 +782,6 @@ } }, { - "args": [ - "--flash" - ], "merge": { "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -812,8 +805,7 @@ }, { "args": [ - "--strip-chrome", - "--flash" + "--strip-chrome" ], "merge": { "script": "//tools/perf/process_perf_results.py" @@ -842,8 +834,7 @@ "args": [ "--browser=cros-chrome", "--remote=variable_chromeos_device_hostname", - "--xvfb", - "--flash" + "--xvfb" ], "isolate_name": "telemetry_perf_unittests", "merge": { @@ -873,8 +864,7 @@ "args": [ "--browser=cros-chrome", "--remote=variable_chromeos_device_hostname", - "--jobs=1", - "--flash" + "--jobs=1" ], "isolate_name": "telemetry_unittests", "merge": { @@ -909,8 +899,7 @@ "gtest_tests": [ { "args": [ - "--test-launcher-filter-file=../../testing/buildbot/filters/chromeos.base_unittests.filter", - "--flash" + "--test-launcher-filter-file=../../testing/buildbot/filters/chromeos.base_unittests.filter" ], "merge": { "args": [], @@ -934,9 +923,6 @@ } }, { - "args": [ - "--flash" - ], "merge": { "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -960,9 +946,6 @@ } }, { - "args": [ - "--flash" - ], "merge": { "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -986,8 +969,7 @@ }, { "args": [ - "--strip-chrome", - "--flash" + "--strip-chrome" ], "merge": { "script": "//tools/perf/process_perf_results.py"
diff --git a/testing/buildbot/chromium.chromiumos.json b/testing/buildbot/chromium.chromiumos.json index a785e250..e0a7dea 100644 --- a/testing/buildbot/chromium.chromiumos.json +++ b/testing/buildbot/chromium.chromiumos.json
@@ -747,8 +747,7 @@ "gtest_tests": [ { "args": [ - "--test-launcher-filter-file=../../testing/buildbot/filters/chromeos.base_unittests.filter", - "--flash" + "--test-launcher-filter-file=../../testing/buildbot/filters/chromeos.base_unittests.filter" ], "merge": { "args": [], @@ -772,9 +771,6 @@ } }, { - "args": [ - "--flash" - ], "merge": { "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -798,9 +794,6 @@ } }, { - "args": [ - "--flash" - ], "merge": { "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -828,8 +821,7 @@ "args": [ "--browser=cros-chrome", "--remote=variable_chromeos_device_hostname", - "--xvfb", - "--flash" + "--xvfb" ], "isolate_name": "telemetry_perf_unittests", "merge": { @@ -859,8 +851,7 @@ "args": [ "--browser=cros-chrome", "--remote=variable_chromeos_device_hostname", - "--jobs=1", - "--flash" + "--jobs=1" ], "isolate_name": "telemetry_unittests", "merge": {
diff --git a/testing/buildbot/chromium.ci.json b/testing/buildbot/chromium.ci.json index 7d2e5b3..57578f8d 100644 --- a/testing/buildbot/chromium.ci.json +++ b/testing/buildbot/chromium.ci.json
@@ -17051,8 +17051,7 @@ { "args": [ "--use-gpu-in-tests", - "--test-launcher-retry-limit=0", - "--flash" + "--test-launcher-retry-limit=0" ], "merge": { "args": [], @@ -17088,8 +17087,7 @@ "--passthrough", "-v", "--extra-browser-args=--log-level=0 --js-flags=--expose-gc --use-cmd-decoder=validating", - "--remote=variable_chromeos_device_hostname", - "--flash" + "--remote=variable_chromeos_device_hostname" ], "isolate_name": "telemetry_gpu_integration_test", "merge": { @@ -17125,8 +17123,7 @@ "--passthrough", "-v", "--extra-browser-args=--log-level=0 --js-flags=--expose-gc", - "--remote=variable_chromeos_device_hostname", - "--flash" + "--remote=variable_chromeos_device_hostname" ], "isolate_name": "telemetry_gpu_integration_test", "merge": { @@ -17162,8 +17159,7 @@ "--passthrough", "-v", "--extra-browser-args=--log-level=0 --js-flags=--expose-gc", - "--remote=variable_chromeos_device_hostname", - "--flash" + "--remote=variable_chromeos_device_hostname" ], "isolate_name": "telemetry_gpu_integration_test", "merge": { @@ -17199,8 +17195,7 @@ "--passthrough", "-v", "--extra-browser-args=--log-level=0 --js-flags=--expose-gc", - "--remote=variable_chromeos_device_hostname", - "--flash" + "--remote=variable_chromeos_device_hostname" ], "isolate_name": "telemetry_gpu_integration_test", "merge": { @@ -17240,8 +17235,7 @@ "0", "--expected-device-id", "0", - "--remote=variable_chromeos_device_hostname", - "--flash" + "--remote=variable_chromeos_device_hostname" ], "isolate_name": "telemetry_gpu_integration_test", "merge": { @@ -17281,8 +17275,7 @@ "--test-machine-name", "${buildername}", "--remote=variable_chromeos_device_hostname", - "--git-revision=${got_revision}", - "--flash" + "--git-revision=${got_revision}" ], "isolate_name": "telemetry_gpu_integration_test", "merge": { @@ -17327,8 +17320,7 @@ "--test-machine-name", "${buildername}", "--remote=variable_chromeos_device_hostname", - "--git-revision=${got_revision}", - "--flash" + "--git-revision=${got_revision}" ], "isolate_name": "telemetry_gpu_integration_test", "merge": { @@ -17370,8 +17362,7 @@ "-v", "--extra-browser-args=--log-level=0 --js-flags=--expose-gc --use-cmd-decoder=validating", "--dont-restore-color-profile-after-test", - "--remote=variable_chromeos_device_hostname", - "--flash" + "--remote=variable_chromeos_device_hostname" ], "isolate_name": "telemetry_gpu_integration_test", "merge": { @@ -17407,8 +17398,7 @@ "--passthrough", "-v", "--extra-browser-args=--log-level=0 --js-flags=--expose-gc", - "--remote=variable_chromeos_device_hostname", - "--flash" + "--remote=variable_chromeos_device_hostname" ], "isolate_name": "telemetry_gpu_integration_test", "merge": { @@ -17445,8 +17435,7 @@ "-v", "--extra-browser-args=--log-level=0 --js-flags=--expose-gc --use-cmd-decoder=validating --force_high_performance_gpu", "--read-abbreviated-json-results-from=../../content/test/data/gpu/webgl_conformance_tests_output.json", - "--remote=variable_chromeos_device_hostname", - "--flash" + "--remote=variable_chromeos_device_hostname" ], "isolate_name": "telemetry_gpu_integration_test", "merge": { @@ -198206,8 +198195,7 @@ "gtest_tests": [ { "args": [ - "--test-launcher-filter-file=../../testing/buildbot/filters/chromeos.base_unittests.filter", - "--flash" + "--test-launcher-filter-file=../../testing/buildbot/filters/chromeos.base_unittests.filter" ], "merge": { "args": [], @@ -198231,9 +198219,6 @@ } }, { - "args": [ - "--flash" - ], "merge": { "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -198257,9 +198242,6 @@ } }, { - "args": [ - "--flash" - ], "merge": { "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -198287,8 +198269,7 @@ "args": [ "--browser=cros-chrome", "--remote=variable_chromeos_device_hostname", - "--xvfb", - "--flash" + "--xvfb" ], "isolate_name": "telemetry_perf_unittests", "merge": { @@ -198318,8 +198299,7 @@ "args": [ "--browser=cros-chrome", "--remote=variable_chromeos_device_hostname", - "--jobs=1", - "--flash" + "--jobs=1" ], "isolate_name": "telemetry_unittests", "merge": { @@ -254854,6 +254834,729 @@ } ] }, + "linux-lacros-tester-rel": { + "additional_compile_targets": [ + "chrome", + "chrome_sandbox", + "linux_symbols", + "symupload" + ], + "gtest_tests": [ + { + "merge": { + "args": [], + "script": "//testing/merge_scripts/standard_gtest_merge.py" + }, + "swarming": { + "can_use_on_swarming_builders": true, + "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" + }, + "test": "absl_hardening_tests", + "test_id_prefix": "ninja://third_party/abseil-cpp:absl_hardening_tests/" + }, + { + "merge": { + "args": [], + "script": "//testing/merge_scripts/standard_gtest_merge.py" + }, + "swarming": { + "can_use_on_swarming_builders": true, + "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" + }, + "test": "accessibility_unittests", + "test_id_prefix": "ninja://ui/accessibility:accessibility_unittests/" + }, + { + "merge": { + "args": [], + "script": "//testing/merge_scripts/standard_gtest_merge.py" + }, + "swarming": { + "can_use_on_swarming_builders": true, + "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" + }, + "test": "angle_unittests", + "test_id_prefix": "ninja://third_party/angle/src/tests:angle_unittests/" + }, + { + "merge": { + "args": [], + "script": "//testing/merge_scripts/standard_gtest_merge.py" + }, + "swarming": { + "can_use_on_swarming_builders": true, + "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" + }, + "test": "base_unittests", + "test_id_prefix": "ninja://base:base_unittests/" + }, + { + "merge": { + "args": [], + "script": "//testing/merge_scripts/standard_gtest_merge.py" + }, + "swarming": { + "can_use_on_swarming_builders": true, + "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" + }, + "test": "base_util_unittests", + "test_id_prefix": "ninja://base/util:base_util_unittests/" + }, + { + "merge": { + "args": [], + "script": "//testing/merge_scripts/standard_gtest_merge.py" + }, + "swarming": { + "can_use_on_swarming_builders": true, + "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" + }, + "test": "blink_common_unittests", + "test_id_prefix": "ninja://third_party/blink/common:blink_common_unittests/" + }, + { + "merge": { + "args": [], + "script": "//testing/merge_scripts/standard_gtest_merge.py" + }, + "swarming": { + "can_use_on_swarming_builders": true, + "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" + }, + "test": "blink_fuzzer_unittests", + "test_id_prefix": "ninja://third_party/blink/renderer/platform:blink_fuzzer_unittests/" + }, + { + "merge": { + "args": [], + "script": "//testing/merge_scripts/standard_gtest_merge.py" + }, + "swarming": { + "can_use_on_swarming_builders": true, + "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" + }, + "test": "blink_heap_unittests", + "test_id_prefix": "ninja://third_party/blink/renderer/platform/heap:blink_heap_unittests/" + }, + { + "merge": { + "args": [], + "script": "//testing/merge_scripts/standard_gtest_merge.py" + }, + "swarming": { + "can_use_on_swarming_builders": true, + "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" + }, + "test": "blink_platform_unittests", + "test_id_prefix": "ninja://third_party/blink/renderer/platform:blink_platform_unittests/" + }, + { + "merge": { + "args": [], + "script": "//testing/merge_scripts/standard_gtest_merge.py" + }, + "name": "webkit_unit_tests", + "swarming": { + "can_use_on_swarming_builders": true, + "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" + }, + "test": "blink_unittests", + "test_id_prefix": "ninja://third_party/blink/renderer/controller:blink_unittests/" + }, + { + "merge": { + "args": [], + "script": "//testing/merge_scripts/standard_gtest_merge.py" + }, + "swarming": { + "can_use_on_swarming_builders": true, + "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" + }, + "test": "boringssl_crypto_tests", + "test_id_prefix": "ninja://third_party/boringssl:boringssl_crypto_tests/" + }, + { + "merge": { + "args": [], + "script": "//testing/merge_scripts/standard_gtest_merge.py" + }, + "swarming": { + "can_use_on_swarming_builders": true, + "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" + }, + "test": "boringssl_ssl_tests", + "test_id_prefix": "ninja://third_party/boringssl:boringssl_ssl_tests/" + }, + { + "args": [ + "--gtest_filter=-*UsingRealWebcam*" + ], + "merge": { + "args": [], + "script": "//testing/merge_scripts/standard_gtest_merge.py" + }, + "swarming": { + "can_use_on_swarming_builders": true, + "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" + }, + "test": "capture_unittests", + "test_id_prefix": "ninja://media/capture:capture_unittests/" + }, + { + "merge": { + "args": [], + "script": "//testing/merge_scripts/standard_gtest_merge.py" + }, + "swarming": { + "can_use_on_swarming_builders": true, + "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" + }, + "test": "cast_unittests", + "test_id_prefix": "ninja://media/cast:cast_unittests/" + }, + { + "merge": { + "args": [], + "script": "//testing/merge_scripts/standard_gtest_merge.py" + }, + "swarming": { + "can_use_on_swarming_builders": true, + "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" + }, + "test": "cc_unittests", + "test_id_prefix": "ninja://cc:cc_unittests/" + }, + { + "merge": { + "args": [], + "script": "//testing/merge_scripts/standard_gtest_merge.py" + }, + "swarming": { + "can_use_on_swarming_builders": true, + "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" + }, + "test": "chrome_app_unittests", + "test_id_prefix": "ninja://chrome/test:chrome_app_unittests/" + }, + { + "merge": { + "args": [], + "script": "//testing/merge_scripts/standard_gtest_merge.py" + }, + "swarming": { + "can_use_on_swarming_builders": true, + "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" + }, + "test": "chromedriver_unittests", + "test_id_prefix": "ninja://chrome/test/chromedriver:chromedriver_unittests/" + }, + { + "experiment_percentage": 100, + "merge": { + "args": [], + "script": "//testing/merge_scripts/standard_gtest_merge.py" + }, + "swarming": { + "can_use_on_swarming_builders": true, + "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" + }, + "test": "content_unittests", + "test_id_prefix": "ninja://content/test:content_unittests/" + }, + { + "merge": { + "args": [], + "script": "//testing/merge_scripts/standard_gtest_merge.py" + }, + "swarming": { + "can_use_on_swarming_builders": true, + "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" + }, + "test": "crypto_unittests", + "test_id_prefix": "ninja://crypto:crypto_unittests/" + }, + { + "merge": { + "args": [], + "script": "//testing/merge_scripts/standard_gtest_merge.py" + }, + "swarming": { + "can_use_on_swarming_builders": true, + "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" + }, + "test": "device_unittests", + "test_id_prefix": "ninja://device:device_unittests/" + }, + { + "merge": { + "args": [], + "script": "//testing/merge_scripts/standard_gtest_merge.py" + }, + "swarming": { + "can_use_on_swarming_builders": true, + "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" + }, + "test": "display_unittests", + "test_id_prefix": "ninja://ui/display:display_unittests/" + }, + { + "merge": { + "args": [], + "script": "//testing/merge_scripts/standard_gtest_merge.py" + }, + "swarming": { + "can_use_on_swarming_builders": true, + "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" + }, + "test": "events_unittests", + "test_id_prefix": "ninja://ui/events:events_unittests/" + }, + { + "merge": { + "args": [], + "script": "//testing/merge_scripts/standard_gtest_merge.py" + }, + "swarming": { + "can_use_on_swarming_builders": true, + "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" + }, + "test": "filesystem_service_unittests", + "test_id_prefix": "ninja://components/services/filesystem:filesystem_service_unittests/" + }, + { + "merge": { + "args": [], + "script": "//testing/merge_scripts/standard_gtest_merge.py" + }, + "swarming": { + "can_use_on_swarming_builders": true, + "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" + }, + "test": "gcm_unit_tests", + "test_id_prefix": "ninja://google_apis/gcm:gcm_unit_tests/" + }, + { + "merge": { + "args": [], + "script": "//testing/merge_scripts/standard_gtest_merge.py" + }, + "swarming": { + "can_use_on_swarming_builders": true, + "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" + }, + "test": "gfx_unittests", + "test_id_prefix": "ninja://ui/gfx:gfx_unittests/" + }, + { + "merge": { + "args": [], + "script": "//testing/merge_scripts/standard_gtest_merge.py" + }, + "swarming": { + "can_use_on_swarming_builders": true, + "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" + }, + "test": "gin_unittests", + "test_id_prefix": "ninja://gin:gin_unittests/" + }, + { + "merge": { + "args": [], + "script": "//testing/merge_scripts/standard_gtest_merge.py" + }, + "swarming": { + "can_use_on_swarming_builders": true, + "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" + }, + "test": "google_apis_unittests", + "test_id_prefix": "ninja://google_apis:google_apis_unittests/" + }, + { + "merge": { + "args": [], + "script": "//testing/merge_scripts/standard_gtest_merge.py" + }, + "swarming": { + "can_use_on_swarming_builders": true, + "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" + }, + "test": "gpu_unittests", + "test_id_prefix": "ninja://gpu:gpu_unittests/" + }, + { + "merge": { + "args": [], + "script": "//testing/merge_scripts/standard_gtest_merge.py" + }, + "swarming": { + "can_use_on_swarming_builders": true, + "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" + }, + "test": "gwp_asan_unittests", + "test_id_prefix": "ninja://components/gwp_asan:gwp_asan_unittests/" + }, + { + "merge": { + "args": [], + "script": "//testing/merge_scripts/standard_gtest_merge.py" + }, + "swarming": { + "can_use_on_swarming_builders": true, + "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" + }, + "test": "ipc_tests", + "test_id_prefix": "ninja://ipc:ipc_tests/" + }, + { + "merge": { + "args": [], + "script": "//testing/merge_scripts/standard_gtest_merge.py" + }, + "swarming": { + "can_use_on_swarming_builders": true, + "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" + }, + "test": "jingle_unittests", + "test_id_prefix": "ninja://jingle:jingle_unittests/" + }, + { + "merge": { + "args": [], + "script": "//testing/merge_scripts/standard_gtest_merge.py" + }, + "swarming": { + "can_use_on_swarming_builders": true, + "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" + }, + "test": "latency_unittests", + "test_id_prefix": "ninja://ui/latency:latency_unittests/" + }, + { + "merge": { + "args": [], + "script": "//testing/merge_scripts/standard_gtest_merge.py" + }, + "swarming": { + "can_use_on_swarming_builders": true, + "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" + }, + "test": "libjingle_xmpp_unittests", + "test_id_prefix": "ninja://third_party/libjingle_xmpp:libjingle_xmpp_unittests/" + }, + { + "merge": { + "args": [], + "script": "//testing/merge_scripts/standard_gtest_merge.py" + }, + "swarming": { + "can_use_on_swarming_builders": true, + "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" + }, + "test": "media_blink_unittests", + "test_id_prefix": "ninja://media/blink:media_blink_unittests/" + }, + { + "merge": { + "args": [], + "script": "//testing/merge_scripts/standard_gtest_merge.py" + }, + "swarming": { + "can_use_on_swarming_builders": true, + "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" + }, + "test": "media_unittests", + "test_id_prefix": "ninja://media:media_unittests/" + }, + { + "merge": { + "args": [], + "script": "//testing/merge_scripts/standard_gtest_merge.py" + }, + "swarming": { + "can_use_on_swarming_builders": true, + "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" + }, + "test": "midi_unittests", + "test_id_prefix": "ninja://media/midi:midi_unittests/" + }, + { + "merge": { + "args": [], + "script": "//testing/merge_scripts/standard_gtest_merge.py" + }, + "swarming": { + "can_use_on_swarming_builders": true, + "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" + }, + "test": "mojo_core_unittests", + "test_id_prefix": "ninja://mojo/core:mojo_core_unittests/" + }, + { + "merge": { + "args": [], + "script": "//testing/merge_scripts/standard_gtest_merge.py" + }, + "swarming": { + "can_use_on_swarming_builders": true, + "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" + }, + "test": "mojo_unittests", + "test_id_prefix": "ninja://mojo:mojo_unittests/" + }, + { + "merge": { + "args": [], + "script": "//testing/merge_scripts/standard_gtest_merge.py" + }, + "swarming": { + "can_use_on_swarming_builders": true, + "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" + }, + "test": "nacl_helper_nonsfi_unittests", + "test_id_prefix": "ninja://components/nacl/loader:nacl_helper_nonsfi_unittests/" + }, + { + "merge": { + "args": [], + "script": "//testing/merge_scripts/standard_gtest_merge.py" + }, + "swarming": { + "can_use_on_swarming_builders": true, + "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" + }, + "test": "nacl_loader_unittests", + "test_id_prefix": "ninja://components/nacl/loader:nacl_loader_unittests/" + }, + { + "merge": { + "args": [], + "script": "//testing/merge_scripts/standard_gtest_merge.py" + }, + "swarming": { + "can_use_on_swarming_builders": true, + "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" + }, + "test": "native_theme_unittests", + "test_id_prefix": "ninja://ui/native_theme:native_theme_unittests/" + }, + { + "merge": { + "args": [], + "script": "//testing/merge_scripts/standard_gtest_merge.py" + }, + "swarming": { + "can_use_on_swarming_builders": true, + "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" + }, + "test": "net_unittests", + "test_id_prefix": "ninja://net:net_unittests/" + }, + { + "merge": { + "args": [], + "script": "//testing/merge_scripts/standard_gtest_merge.py" + }, + "swarming": { + "can_use_on_swarming_builders": true, + "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" + }, + "test": "pdf_unittests", + "test_id_prefix": "ninja://pdf:pdf_unittests/" + }, + { + "merge": { + "args": [], + "script": "//testing/merge_scripts/standard_gtest_merge.py" + }, + "swarming": { + "can_use_on_swarming_builders": true, + "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" + }, + "test": "perfetto_unittests", + "test_id_prefix": "ninja://third_party/perfetto:perfetto_unittests/" + }, + { + "merge": { + "args": [], + "script": "//testing/merge_scripts/standard_gtest_merge.py" + }, + "swarming": { + "can_use_on_swarming_builders": true, + "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" + }, + "test": "ppapi_unittests", + "test_id_prefix": "ninja://ppapi:ppapi_unittests/" + }, + { + "merge": { + "args": [], + "script": "//testing/merge_scripts/standard_gtest_merge.py" + }, + "swarming": { + "can_use_on_swarming_builders": true, + "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" + }, + "test": "printing_unittests", + "test_id_prefix": "ninja://printing:printing_unittests/" + }, + { + "merge": { + "args": [], + "script": "//testing/merge_scripts/standard_gtest_merge.py" + }, + "swarming": { + "can_use_on_swarming_builders": true, + "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" + }, + "test": "remoting_unittests", + "test_id_prefix": "ninja://remoting:remoting_unittests/" + }, + { + "merge": { + "args": [], + "script": "//testing/merge_scripts/standard_gtest_merge.py" + }, + "swarming": { + "can_use_on_swarming_builders": true, + "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" + }, + "test": "sandbox_linux_unittests", + "test_id_prefix": "ninja://sandbox/linux:sandbox_linux_unittests/" + }, + { + "merge": { + "args": [], + "script": "//testing/merge_scripts/standard_gtest_merge.py" + }, + "swarming": { + "can_use_on_swarming_builders": true, + "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" + }, + "test": "service_manager_unittests", + "test_id_prefix": "ninja://services/service_manager/tests:service_manager_unittests/" + }, + { + "merge": { + "args": [], + "script": "//testing/merge_scripts/standard_gtest_merge.py" + }, + "swarming": { + "can_use_on_swarming_builders": true, + "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" + }, + "test": "services_unittests", + "test_id_prefix": "ninja://services:services_unittests/" + }, + { + "merge": { + "args": [], + "script": "//testing/merge_scripts/standard_gtest_merge.py" + }, + "swarming": { + "can_use_on_swarming_builders": true, + "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" + }, + "test": "shell_dialogs_unittests", + "test_id_prefix": "ninja://ui/shell_dialogs:shell_dialogs_unittests/" + }, + { + "merge": { + "args": [], + "script": "//testing/merge_scripts/standard_gtest_merge.py" + }, + "swarming": { + "can_use_on_swarming_builders": true, + "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" + }, + "test": "skia_unittests", + "test_id_prefix": "ninja://skia:skia_unittests/" + }, + { + "merge": { + "args": [], + "script": "//testing/merge_scripts/standard_gtest_merge.py" + }, + "swarming": { + "can_use_on_swarming_builders": true, + "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" + }, + "test": "sql_unittests", + "test_id_prefix": "ninja://sql:sql_unittests/" + }, + { + "merge": { + "args": [], + "script": "//testing/merge_scripts/standard_gtest_merge.py" + }, + "swarming": { + "can_use_on_swarming_builders": true, + "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" + }, + "test": "storage_unittests", + "test_id_prefix": "ninja://storage:storage_unittests/" + }, + { + "merge": { + "args": [], + "script": "//testing/merge_scripts/standard_gtest_merge.py" + }, + "swarming": { + "can_use_on_swarming_builders": true, + "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" + }, + "test": "traffic_annotation_auditor_unittests", + "test_id_prefix": "ninja://tools/traffic_annotation/auditor:traffic_annotation_auditor_unittests/" + }, + { + "merge": { + "args": [], + "script": "//testing/merge_scripts/standard_gtest_merge.py" + }, + "swarming": { + "can_use_on_swarming_builders": true, + "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" + }, + "test": "ui_base_unittests", + "test_id_prefix": "ninja://ui/base:ui_base_unittests/" + }, + { + "merge": { + "args": [], + "script": "//testing/merge_scripts/standard_gtest_merge.py" + }, + "swarming": { + "can_use_on_swarming_builders": true, + "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" + }, + "test": "ui_touch_selection_unittests", + "test_id_prefix": "ninja://ui/touch_selection:ui_touch_selection_unittests/" + }, + { + "merge": { + "args": [], + "script": "//testing/merge_scripts/standard_gtest_merge.py" + }, + "swarming": { + "can_use_on_swarming_builders": true, + "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" + }, + "test": "viz_unittests", + "test_id_prefix": "ninja://components/viz:viz_unittests/" + }, + { + "merge": { + "args": [], + "script": "//testing/merge_scripts/standard_gtest_merge.py" + }, + "swarming": { + "can_use_on_swarming_builders": true, + "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" + }, + "test": "wtf_unittests", + "test_id_prefix": "ninja://third_party/blink/renderer/platform/wtf:wtf_unittests/" + } + ] + }, "linux-official": { "additional_compile_targets": [ "all"
diff --git a/testing/buildbot/chromium.fyi.json b/testing/buildbot/chromium.fyi.json index f212524..3c245bd8 100644 --- a/testing/buildbot/chromium.fyi.json +++ b/testing/buildbot/chromium.fyi.json
@@ -61068,6 +61068,729 @@ } ] }, + "linux-lacros-tester-rel": { + "additional_compile_targets": [ + "chrome", + "chrome_sandbox", + "linux_symbols", + "symupload" + ], + "gtest_tests": [ + { + "merge": { + "args": [], + "script": "//testing/merge_scripts/standard_gtest_merge.py" + }, + "swarming": { + "can_use_on_swarming_builders": true, + "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" + }, + "test": "absl_hardening_tests", + "test_id_prefix": "ninja://third_party/abseil-cpp:absl_hardening_tests/" + }, + { + "merge": { + "args": [], + "script": "//testing/merge_scripts/standard_gtest_merge.py" + }, + "swarming": { + "can_use_on_swarming_builders": true, + "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" + }, + "test": "accessibility_unittests", + "test_id_prefix": "ninja://ui/accessibility:accessibility_unittests/" + }, + { + "merge": { + "args": [], + "script": "//testing/merge_scripts/standard_gtest_merge.py" + }, + "swarming": { + "can_use_on_swarming_builders": true, + "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" + }, + "test": "angle_unittests", + "test_id_prefix": "ninja://third_party/angle/src/tests:angle_unittests/" + }, + { + "merge": { + "args": [], + "script": "//testing/merge_scripts/standard_gtest_merge.py" + }, + "swarming": { + "can_use_on_swarming_builders": true, + "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" + }, + "test": "base_unittests", + "test_id_prefix": "ninja://base:base_unittests/" + }, + { + "merge": { + "args": [], + "script": "//testing/merge_scripts/standard_gtest_merge.py" + }, + "swarming": { + "can_use_on_swarming_builders": true, + "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" + }, + "test": "base_util_unittests", + "test_id_prefix": "ninja://base/util:base_util_unittests/" + }, + { + "merge": { + "args": [], + "script": "//testing/merge_scripts/standard_gtest_merge.py" + }, + "swarming": { + "can_use_on_swarming_builders": true, + "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" + }, + "test": "blink_common_unittests", + "test_id_prefix": "ninja://third_party/blink/common:blink_common_unittests/" + }, + { + "merge": { + "args": [], + "script": "//testing/merge_scripts/standard_gtest_merge.py" + }, + "swarming": { + "can_use_on_swarming_builders": true, + "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" + }, + "test": "blink_fuzzer_unittests", + "test_id_prefix": "ninja://third_party/blink/renderer/platform:blink_fuzzer_unittests/" + }, + { + "merge": { + "args": [], + "script": "//testing/merge_scripts/standard_gtest_merge.py" + }, + "swarming": { + "can_use_on_swarming_builders": true, + "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" + }, + "test": "blink_heap_unittests", + "test_id_prefix": "ninja://third_party/blink/renderer/platform/heap:blink_heap_unittests/" + }, + { + "merge": { + "args": [], + "script": "//testing/merge_scripts/standard_gtest_merge.py" + }, + "swarming": { + "can_use_on_swarming_builders": true, + "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" + }, + "test": "blink_platform_unittests", + "test_id_prefix": "ninja://third_party/blink/renderer/platform:blink_platform_unittests/" + }, + { + "merge": { + "args": [], + "script": "//testing/merge_scripts/standard_gtest_merge.py" + }, + "name": "webkit_unit_tests", + "swarming": { + "can_use_on_swarming_builders": true, + "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" + }, + "test": "blink_unittests", + "test_id_prefix": "ninja://third_party/blink/renderer/controller:blink_unittests/" + }, + { + "merge": { + "args": [], + "script": "//testing/merge_scripts/standard_gtest_merge.py" + }, + "swarming": { + "can_use_on_swarming_builders": true, + "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" + }, + "test": "boringssl_crypto_tests", + "test_id_prefix": "ninja://third_party/boringssl:boringssl_crypto_tests/" + }, + { + "merge": { + "args": [], + "script": "//testing/merge_scripts/standard_gtest_merge.py" + }, + "swarming": { + "can_use_on_swarming_builders": true, + "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" + }, + "test": "boringssl_ssl_tests", + "test_id_prefix": "ninja://third_party/boringssl:boringssl_ssl_tests/" + }, + { + "args": [ + "--gtest_filter=-*UsingRealWebcam*" + ], + "merge": { + "args": [], + "script": "//testing/merge_scripts/standard_gtest_merge.py" + }, + "swarming": { + "can_use_on_swarming_builders": true, + "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" + }, + "test": "capture_unittests", + "test_id_prefix": "ninja://media/capture:capture_unittests/" + }, + { + "merge": { + "args": [], + "script": "//testing/merge_scripts/standard_gtest_merge.py" + }, + "swarming": { + "can_use_on_swarming_builders": true, + "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" + }, + "test": "cast_unittests", + "test_id_prefix": "ninja://media/cast:cast_unittests/" + }, + { + "merge": { + "args": [], + "script": "//testing/merge_scripts/standard_gtest_merge.py" + }, + "swarming": { + "can_use_on_swarming_builders": true, + "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" + }, + "test": "cc_unittests", + "test_id_prefix": "ninja://cc:cc_unittests/" + }, + { + "merge": { + "args": [], + "script": "//testing/merge_scripts/standard_gtest_merge.py" + }, + "swarming": { + "can_use_on_swarming_builders": true, + "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" + }, + "test": "chrome_app_unittests", + "test_id_prefix": "ninja://chrome/test:chrome_app_unittests/" + }, + { + "merge": { + "args": [], + "script": "//testing/merge_scripts/standard_gtest_merge.py" + }, + "swarming": { + "can_use_on_swarming_builders": true, + "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" + }, + "test": "chromedriver_unittests", + "test_id_prefix": "ninja://chrome/test/chromedriver:chromedriver_unittests/" + }, + { + "experiment_percentage": 100, + "merge": { + "args": [], + "script": "//testing/merge_scripts/standard_gtest_merge.py" + }, + "swarming": { + "can_use_on_swarming_builders": true, + "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" + }, + "test": "content_unittests", + "test_id_prefix": "ninja://content/test:content_unittests/" + }, + { + "merge": { + "args": [], + "script": "//testing/merge_scripts/standard_gtest_merge.py" + }, + "swarming": { + "can_use_on_swarming_builders": true, + "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" + }, + "test": "crypto_unittests", + "test_id_prefix": "ninja://crypto:crypto_unittests/" + }, + { + "merge": { + "args": [], + "script": "//testing/merge_scripts/standard_gtest_merge.py" + }, + "swarming": { + "can_use_on_swarming_builders": true, + "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" + }, + "test": "device_unittests", + "test_id_prefix": "ninja://device:device_unittests/" + }, + { + "merge": { + "args": [], + "script": "//testing/merge_scripts/standard_gtest_merge.py" + }, + "swarming": { + "can_use_on_swarming_builders": true, + "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" + }, + "test": "display_unittests", + "test_id_prefix": "ninja://ui/display:display_unittests/" + }, + { + "merge": { + "args": [], + "script": "//testing/merge_scripts/standard_gtest_merge.py" + }, + "swarming": { + "can_use_on_swarming_builders": true, + "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" + }, + "test": "events_unittests", + "test_id_prefix": "ninja://ui/events:events_unittests/" + }, + { + "merge": { + "args": [], + "script": "//testing/merge_scripts/standard_gtest_merge.py" + }, + "swarming": { + "can_use_on_swarming_builders": true, + "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" + }, + "test": "filesystem_service_unittests", + "test_id_prefix": "ninja://components/services/filesystem:filesystem_service_unittests/" + }, + { + "merge": { + "args": [], + "script": "//testing/merge_scripts/standard_gtest_merge.py" + }, + "swarming": { + "can_use_on_swarming_builders": true, + "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" + }, + "test": "gcm_unit_tests", + "test_id_prefix": "ninja://google_apis/gcm:gcm_unit_tests/" + }, + { + "merge": { + "args": [], + "script": "//testing/merge_scripts/standard_gtest_merge.py" + }, + "swarming": { + "can_use_on_swarming_builders": true, + "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" + }, + "test": "gfx_unittests", + "test_id_prefix": "ninja://ui/gfx:gfx_unittests/" + }, + { + "merge": { + "args": [], + "script": "//testing/merge_scripts/standard_gtest_merge.py" + }, + "swarming": { + "can_use_on_swarming_builders": true, + "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" + }, + "test": "gin_unittests", + "test_id_prefix": "ninja://gin:gin_unittests/" + }, + { + "merge": { + "args": [], + "script": "//testing/merge_scripts/standard_gtest_merge.py" + }, + "swarming": { + "can_use_on_swarming_builders": true, + "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" + }, + "test": "google_apis_unittests", + "test_id_prefix": "ninja://google_apis:google_apis_unittests/" + }, + { + "merge": { + "args": [], + "script": "//testing/merge_scripts/standard_gtest_merge.py" + }, + "swarming": { + "can_use_on_swarming_builders": true, + "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" + }, + "test": "gpu_unittests", + "test_id_prefix": "ninja://gpu:gpu_unittests/" + }, + { + "merge": { + "args": [], + "script": "//testing/merge_scripts/standard_gtest_merge.py" + }, + "swarming": { + "can_use_on_swarming_builders": true, + "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" + }, + "test": "gwp_asan_unittests", + "test_id_prefix": "ninja://components/gwp_asan:gwp_asan_unittests/" + }, + { + "merge": { + "args": [], + "script": "//testing/merge_scripts/standard_gtest_merge.py" + }, + "swarming": { + "can_use_on_swarming_builders": true, + "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" + }, + "test": "ipc_tests", + "test_id_prefix": "ninja://ipc:ipc_tests/" + }, + { + "merge": { + "args": [], + "script": "//testing/merge_scripts/standard_gtest_merge.py" + }, + "swarming": { + "can_use_on_swarming_builders": true, + "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" + }, + "test": "jingle_unittests", + "test_id_prefix": "ninja://jingle:jingle_unittests/" + }, + { + "merge": { + "args": [], + "script": "//testing/merge_scripts/standard_gtest_merge.py" + }, + "swarming": { + "can_use_on_swarming_builders": true, + "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" + }, + "test": "latency_unittests", + "test_id_prefix": "ninja://ui/latency:latency_unittests/" + }, + { + "merge": { + "args": [], + "script": "//testing/merge_scripts/standard_gtest_merge.py" + }, + "swarming": { + "can_use_on_swarming_builders": true, + "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" + }, + "test": "libjingle_xmpp_unittests", + "test_id_prefix": "ninja://third_party/libjingle_xmpp:libjingle_xmpp_unittests/" + }, + { + "merge": { + "args": [], + "script": "//testing/merge_scripts/standard_gtest_merge.py" + }, + "swarming": { + "can_use_on_swarming_builders": true, + "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" + }, + "test": "media_blink_unittests", + "test_id_prefix": "ninja://media/blink:media_blink_unittests/" + }, + { + "merge": { + "args": [], + "script": "//testing/merge_scripts/standard_gtest_merge.py" + }, + "swarming": { + "can_use_on_swarming_builders": true, + "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" + }, + "test": "media_unittests", + "test_id_prefix": "ninja://media:media_unittests/" + }, + { + "merge": { + "args": [], + "script": "//testing/merge_scripts/standard_gtest_merge.py" + }, + "swarming": { + "can_use_on_swarming_builders": true, + "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" + }, + "test": "midi_unittests", + "test_id_prefix": "ninja://media/midi:midi_unittests/" + }, + { + "merge": { + "args": [], + "script": "//testing/merge_scripts/standard_gtest_merge.py" + }, + "swarming": { + "can_use_on_swarming_builders": true, + "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" + }, + "test": "mojo_core_unittests", + "test_id_prefix": "ninja://mojo/core:mojo_core_unittests/" + }, + { + "merge": { + "args": [], + "script": "//testing/merge_scripts/standard_gtest_merge.py" + }, + "swarming": { + "can_use_on_swarming_builders": true, + "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" + }, + "test": "mojo_unittests", + "test_id_prefix": "ninja://mojo:mojo_unittests/" + }, + { + "merge": { + "args": [], + "script": "//testing/merge_scripts/standard_gtest_merge.py" + }, + "swarming": { + "can_use_on_swarming_builders": true, + "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" + }, + "test": "nacl_helper_nonsfi_unittests", + "test_id_prefix": "ninja://components/nacl/loader:nacl_helper_nonsfi_unittests/" + }, + { + "merge": { + "args": [], + "script": "//testing/merge_scripts/standard_gtest_merge.py" + }, + "swarming": { + "can_use_on_swarming_builders": true, + "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" + }, + "test": "nacl_loader_unittests", + "test_id_prefix": "ninja://components/nacl/loader:nacl_loader_unittests/" + }, + { + "merge": { + "args": [], + "script": "//testing/merge_scripts/standard_gtest_merge.py" + }, + "swarming": { + "can_use_on_swarming_builders": true, + "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" + }, + "test": "native_theme_unittests", + "test_id_prefix": "ninja://ui/native_theme:native_theme_unittests/" + }, + { + "merge": { + "args": [], + "script": "//testing/merge_scripts/standard_gtest_merge.py" + }, + "swarming": { + "can_use_on_swarming_builders": true, + "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" + }, + "test": "net_unittests", + "test_id_prefix": "ninja://net:net_unittests/" + }, + { + "merge": { + "args": [], + "script": "//testing/merge_scripts/standard_gtest_merge.py" + }, + "swarming": { + "can_use_on_swarming_builders": true, + "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" + }, + "test": "pdf_unittests", + "test_id_prefix": "ninja://pdf:pdf_unittests/" + }, + { + "merge": { + "args": [], + "script": "//testing/merge_scripts/standard_gtest_merge.py" + }, + "swarming": { + "can_use_on_swarming_builders": true, + "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" + }, + "test": "perfetto_unittests", + "test_id_prefix": "ninja://third_party/perfetto:perfetto_unittests/" + }, + { + "merge": { + "args": [], + "script": "//testing/merge_scripts/standard_gtest_merge.py" + }, + "swarming": { + "can_use_on_swarming_builders": true, + "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" + }, + "test": "ppapi_unittests", + "test_id_prefix": "ninja://ppapi:ppapi_unittests/" + }, + { + "merge": { + "args": [], + "script": "//testing/merge_scripts/standard_gtest_merge.py" + }, + "swarming": { + "can_use_on_swarming_builders": true, + "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" + }, + "test": "printing_unittests", + "test_id_prefix": "ninja://printing:printing_unittests/" + }, + { + "merge": { + "args": [], + "script": "//testing/merge_scripts/standard_gtest_merge.py" + }, + "swarming": { + "can_use_on_swarming_builders": true, + "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" + }, + "test": "remoting_unittests", + "test_id_prefix": "ninja://remoting:remoting_unittests/" + }, + { + "merge": { + "args": [], + "script": "//testing/merge_scripts/standard_gtest_merge.py" + }, + "swarming": { + "can_use_on_swarming_builders": true, + "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" + }, + "test": "sandbox_linux_unittests", + "test_id_prefix": "ninja://sandbox/linux:sandbox_linux_unittests/" + }, + { + "merge": { + "args": [], + "script": "//testing/merge_scripts/standard_gtest_merge.py" + }, + "swarming": { + "can_use_on_swarming_builders": true, + "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" + }, + "test": "service_manager_unittests", + "test_id_prefix": "ninja://services/service_manager/tests:service_manager_unittests/" + }, + { + "merge": { + "args": [], + "script": "//testing/merge_scripts/standard_gtest_merge.py" + }, + "swarming": { + "can_use_on_swarming_builders": true, + "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" + }, + "test": "services_unittests", + "test_id_prefix": "ninja://services:services_unittests/" + }, + { + "merge": { + "args": [], + "script": "//testing/merge_scripts/standard_gtest_merge.py" + }, + "swarming": { + "can_use_on_swarming_builders": true, + "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" + }, + "test": "shell_dialogs_unittests", + "test_id_prefix": "ninja://ui/shell_dialogs:shell_dialogs_unittests/" + }, + { + "merge": { + "args": [], + "script": "//testing/merge_scripts/standard_gtest_merge.py" + }, + "swarming": { + "can_use_on_swarming_builders": true, + "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" + }, + "test": "skia_unittests", + "test_id_prefix": "ninja://skia:skia_unittests/" + }, + { + "merge": { + "args": [], + "script": "//testing/merge_scripts/standard_gtest_merge.py" + }, + "swarming": { + "can_use_on_swarming_builders": true, + "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" + }, + "test": "sql_unittests", + "test_id_prefix": "ninja://sql:sql_unittests/" + }, + { + "merge": { + "args": [], + "script": "//testing/merge_scripts/standard_gtest_merge.py" + }, + "swarming": { + "can_use_on_swarming_builders": true, + "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" + }, + "test": "storage_unittests", + "test_id_prefix": "ninja://storage:storage_unittests/" + }, + { + "merge": { + "args": [], + "script": "//testing/merge_scripts/standard_gtest_merge.py" + }, + "swarming": { + "can_use_on_swarming_builders": true, + "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" + }, + "test": "traffic_annotation_auditor_unittests", + "test_id_prefix": "ninja://tools/traffic_annotation/auditor:traffic_annotation_auditor_unittests/" + }, + { + "merge": { + "args": [], + "script": "//testing/merge_scripts/standard_gtest_merge.py" + }, + "swarming": { + "can_use_on_swarming_builders": true, + "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" + }, + "test": "ui_base_unittests", + "test_id_prefix": "ninja://ui/base:ui_base_unittests/" + }, + { + "merge": { + "args": [], + "script": "//testing/merge_scripts/standard_gtest_merge.py" + }, + "swarming": { + "can_use_on_swarming_builders": true, + "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" + }, + "test": "ui_touch_selection_unittests", + "test_id_prefix": "ninja://ui/touch_selection:ui_touch_selection_unittests/" + }, + { + "merge": { + "args": [], + "script": "//testing/merge_scripts/standard_gtest_merge.py" + }, + "swarming": { + "can_use_on_swarming_builders": true, + "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" + }, + "test": "viz_unittests", + "test_id_prefix": "ninja://components/viz:viz_unittests/" + }, + { + "merge": { + "args": [], + "script": "//testing/merge_scripts/standard_gtest_merge.py" + }, + "swarming": { + "can_use_on_swarming_builders": true, + "service_account": "chromium-tester@chops-service-accounts.iam.gserviceaccount.com" + }, + "test": "wtf_unittests", + "test_id_prefix": "ninja://third_party/blink/renderer/platform/wtf:wtf_unittests/" + } + ] + }, "linux-perfetto-rel": { "additional_compile_targets": [ "chrome"
diff --git a/testing/buildbot/chromium.gpu.fyi.json b/testing/buildbot/chromium.gpu.fyi.json index 1ca54a64e..65b101df 100644 --- a/testing/buildbot/chromium.gpu.fyi.json +++ b/testing/buildbot/chromium.gpu.fyi.json
@@ -7916,8 +7916,7 @@ { "args": [ "--use-gpu-in-tests", - "--test-launcher-retry-limit=0", - "--flash" + "--test-launcher-retry-limit=0" ], "merge": { "args": [], @@ -7953,8 +7952,7 @@ "--passthrough", "-v", "--extra-browser-args=--log-level=0 --js-flags=--expose-gc --use-cmd-decoder=validating", - "--remote=variable_chromeos_device_hostname", - "--flash" + "--remote=variable_chromeos_device_hostname" ], "isolate_name": "telemetry_gpu_integration_test", "merge": { @@ -7990,8 +7988,7 @@ "--passthrough", "-v", "--extra-browser-args=--log-level=0 --js-flags=--expose-gc", - "--remote=variable_chromeos_device_hostname", - "--flash" + "--remote=variable_chromeos_device_hostname" ], "isolate_name": "telemetry_gpu_integration_test", "merge": { @@ -8027,8 +8024,7 @@ "--passthrough", "-v", "--extra-browser-args=--log-level=0 --js-flags=--expose-gc", - "--remote=variable_chromeos_device_hostname", - "--flash" + "--remote=variable_chromeos_device_hostname" ], "isolate_name": "telemetry_gpu_integration_test", "merge": { @@ -8064,8 +8060,7 @@ "--passthrough", "-v", "--extra-browser-args=--log-level=0 --js-flags=--expose-gc", - "--remote=variable_chromeos_device_hostname", - "--flash" + "--remote=variable_chromeos_device_hostname" ], "isolate_name": "telemetry_gpu_integration_test", "merge": { @@ -8105,8 +8100,7 @@ "0", "--expected-device-id", "0", - "--remote=variable_chromeos_device_hostname", - "--flash" + "--remote=variable_chromeos_device_hostname" ], "isolate_name": "telemetry_gpu_integration_test", "merge": { @@ -8146,8 +8140,7 @@ "--test-machine-name", "${buildername}", "--remote=variable_chromeos_device_hostname", - "--git-revision=${got_revision}", - "--flash" + "--git-revision=${got_revision}" ], "isolate_name": "telemetry_gpu_integration_test", "merge": { @@ -8192,8 +8185,7 @@ "--test-machine-name", "${buildername}", "--remote=variable_chromeos_device_hostname", - "--git-revision=${got_revision}", - "--flash" + "--git-revision=${got_revision}" ], "isolate_name": "telemetry_gpu_integration_test", "merge": { @@ -8235,8 +8227,7 @@ "-v", "--extra-browser-args=--log-level=0 --js-flags=--expose-gc --use-cmd-decoder=validating", "--dont-restore-color-profile-after-test", - "--remote=variable_chromeos_device_hostname", - "--flash" + "--remote=variable_chromeos_device_hostname" ], "isolate_name": "telemetry_gpu_integration_test", "merge": { @@ -8272,8 +8263,7 @@ "--passthrough", "-v", "--extra-browser-args=--log-level=0 --js-flags=--expose-gc", - "--remote=variable_chromeos_device_hostname", - "--flash" + "--remote=variable_chromeos_device_hostname" ], "isolate_name": "telemetry_gpu_integration_test", "merge": { @@ -8310,8 +8300,7 @@ "-v", "--extra-browser-args=--log-level=0 --js-flags=--expose-gc --use-cmd-decoder=validating --force_high_performance_gpu", "--read-abbreviated-json-results-from=../../content/test/data/gpu/webgl_conformance_tests_output.json", - "--remote=variable_chromeos_device_hostname", - "--flash" + "--remote=variable_chromeos_device_hostname" ], "isolate_name": "telemetry_gpu_integration_test", "merge": {
diff --git a/testing/buildbot/chromium.perf.json b/testing/buildbot/chromium.perf.json index e09c0a5..5dd8d810 100644 --- a/testing/buildbot/chromium.perf.json +++ b/testing/buildbot/chromium.perf.json
@@ -484,7 +484,7 @@ { "args": [ "-v", - "--browser=android-chrome", + "--browser=android-chrome-64-bundle", "--upload-results", "--test-shard-map-filename=android-pixel2-perf_map.json" ],
diff --git a/testing/buildbot/generate_buildbot_json.py b/testing/buildbot/generate_buildbot_json.py index 9de56d1..63252de 100755 --- a/testing/buildbot/generate_buildbot_json.py +++ b/testing/buildbot/generate_buildbot_json.py
@@ -671,9 +671,6 @@ test['trigger_script'] = { 'script': '//testing/trigger_scripts/chromeos_device_trigger.py', } - args = test.get('args', []) - args.append('--flash') - test['args'] = args def add_android_presentation_args(self, tester_config, test_name, result): args = result.get('args', [])
diff --git a/testing/buildbot/generate_buildbot_json_unittest.py b/testing/buildbot/generate_buildbot_json_unittest.py index 54c2fc9..ac8b990 100755 --- a/testing/buildbot/generate_buildbot_json_unittest.py +++ b/testing/buildbot/generate_buildbot_json_unittest.py
@@ -1734,9 +1734,6 @@ "Fake Tester": { "gtest_tests": [ { - "args": [ - "--flash" - ], "merge": { "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py"
diff --git a/testing/buildbot/test_suite_exceptions.pyl b/testing/buildbot/test_suite_exceptions.pyl index ae4b4862..d7599c4 100644 --- a/testing/buildbot/test_suite_exceptions.pyl +++ b/testing/buildbot/test_suite_exceptions.pyl
@@ -92,6 +92,16 @@ 'Linux FYI Release (AMD R7 240)', ], }, + 'app_shell_unittests': { + 'remove_from': [ + 'linux-lacros-tester-rel', # https://crbug.com/1111979 + ], + }, + 'aura_unittests': { + 'remove_from': [ + 'linux-lacros-tester-rel', # https://crbug.com/1111979 + ], + }, 'blink_platform_unittests': { 'modifications': { # TODO(crbug.com/1108121): Remove this filter @@ -435,6 +445,7 @@ 'Mac10.13 Tests', # https://crbug.com/1042757 'Linux TSan Tests', # https://crbug.com/368525 'Win10 Tests x64 (dbg)', + 'linux-lacros-tester-rel', # https://crbug.com/1111979 ], 'modifications': { 'CrWinAsan': { @@ -793,6 +804,7 @@ 'components_browsertests': { 'remove_from': [ 'android-code-coverage-native', # crbug/1018434 + 'linux-lacros-tester-rel', # https://crbug.com/1111979 ], }, 'components_unittests': { @@ -804,6 +816,7 @@ 'fuchsia-fyi-arm64-rel', # https://crbug.com/961457 'fuchsia-fyi-x64-dbg', # https://crbug.com/961457 'fuchsia-fyi-x64-rel', # https://crbug.com/961457 + 'linux-lacros-tester-rel', # https://crbug.com/1111979 ], 'modifications': { 'Linux ASan LSan Tests (1)': { @@ -832,6 +845,11 @@ }, }, }, + 'compositor_unittests': { + 'remove_from': [ + 'linux-lacros-tester-rel', # https://crbug.com/1111979 + ], + }, 'content_browsertests': { 'remove_from': [ 'CrWinAsan(dll)', # https://crbug.com/935598 @@ -841,6 +859,7 @@ # http://crbug.com/1060245#c30: due to low utility and capacity. 'android-marshmallow-arm64-rel', 'android-marshmallow-x86-rel', # crbug.com/1098111 + 'linux-lacros-tester-rel', # https://crbug.com/1111979 ], 'modifications': { 'Cast Audio Linux': { @@ -1089,6 +1108,11 @@ 'Linux FYI Release (AMD R7 240)', # https://crbug.com/915430 ], }, + 'dbus_unittests': { + 'remove_from': [ + 'linux-lacros-tester-rel', # https://crbug.com/1111979 + ], + }, 'depth_capture_tests': { # TODO(https://crbug.com/850107): Remove the Android FYI Release (Pixel 2) # exception once there is enough capacity to run these tests. @@ -1114,6 +1138,7 @@ 'extensions_browsertests': { 'remove_from': [ 'CrWinAsan(dll)', # https://crbug.com/935598 + 'linux-lacros-tester-rel', # https://crbug.com/1111979 ], 'modifications': { 'Win10 Tests x64 (dbg)': { @@ -1121,6 +1146,11 @@ }, }, }, + 'extensions_unittests': { + 'remove_from': [ + 'linux-lacros-tester-rel', # https://crbug.com/1111979 + ], + }, 'gin_unittests': { 'remove_from': [ 'ToTLinuxASan', # https://crbug.com/831667 @@ -1349,6 +1379,7 @@ 'remove_from': [ 'CrWinAsan(dll)', # https://crbug.com/935598 'linux-lacros-tester-fyi-rel', # https://crbug.com/1106980 + 'linux-lacros-tester-rel', # https://crbug.com/1106980 ], 'modifications': { 'Linux - Future (dbg)': { # client.v8.chromium @@ -1509,6 +1540,11 @@ }, }, }, + 'message_center_unittests': { + 'remove_from': [ + 'linux-lacros-tester-rel', # https://crbug.com/1111979 + ], + }, 'mojo_unittests': { 'modifications': { 'android-asan': { @@ -2252,7 +2288,15 @@ }, }, }, + 'snapshot_unittests': { + 'remove_from': [ + 'linux-lacros-tester-rel', # https://crbug.com/1111979 + ], + }, 'storage_service_unsandboxed_content_browsertests': { + 'remove_from': [ + 'linux-lacros-tester-rel', # https://crbug.com/1111979 + ], 'modifications': { 'Linux Tests (dbg)(1)': { 'swarming': { @@ -2266,6 +2310,11 @@ }, }, }, + 'storage_service_unsandboxed_extensions_browsertests': { + 'remove_from': [ + 'linux-lacros-tester-rel', # https://crbug.com/1111979 + ], + }, 'storage_service_unsandboxed_interactive_ui_tests': { 'remove_from': [ 'linux-lacros-tester-fyi-rel', # https://crbug.com/1106980 @@ -2291,6 +2340,7 @@ 'sync_integration_tests': { 'remove_from': [ 'CrWinAsan(dll)', # https://crbug.com/935598 + 'linux-lacros-tester-rel', # https://crbug.com/1111979 ], 'modifications': { 'Linux ASan LSan Tests (1)': { @@ -2459,6 +2509,7 @@ # There's no need to run unit_tests on both lollipop and marshmallow # on the CQ. https://crbug.com/1026487. 'android-marshmallow-arm64-rel', + 'linux-lacros-tester-rel', # https://crbug.com/1111979 ], 'modifications': { 'Linux ASan LSan Tests (1)': { @@ -2526,6 +2577,7 @@ 'remove_from': [ # crbug.com/1054240 'Fuchsia ARM64', + 'linux-lacros-tester-rel', # https://crbug.com/1111979 ], }, 'video_decode_accelerator_gl_unittest': { @@ -2538,6 +2590,11 @@ 'Win10 FYI x64 Exp Release (Intel HD 630)', ], }, + 'views_unittests': { + 'remove_from': [ + 'linux-lacros-tester-rel', # https://crbug.com/1111979 + ], + }, 'views_unittests_wayland': { 'modifications': { 'Linux Ozone Tester (Wayland)': { @@ -2760,6 +2817,11 @@ }, }, }, + 'wm_unittests': { + 'remove_from': [ + 'linux-lacros-tester-rel', # https://crbug.com/1111979 + ], + }, 'xr_browser_tests': { 'remove_from': [ # Randomly hangs indefinitely https://crbug.com/1018896.
diff --git a/testing/buildbot/waterfalls.pyl b/testing/buildbot/waterfalls.pyl index 95c7e2ec..4495481 100644 --- a/testing/buildbot/waterfalls.pyl +++ b/testing/buildbot/waterfalls.pyl
@@ -2291,6 +2291,17 @@ 'gtest_tests': 'linux_lacros_gtests', }, }, + 'linux-lacros-tester-rel': { + 'additional_compile_targets': [ + 'chrome', + 'chrome_sandbox', + 'linux_symbols', + 'symupload' + ], + 'test_suites': { + 'gtest_tests': 'linux_lacros_gtests', + }, + }, 'linux-perfetto-rel': { 'additional_compile_targets': [ 'chrome' ], 'mixins': [
diff --git a/testing/variations/fieldtrial_testing_config.json b/testing/variations/fieldtrial_testing_config.json index 0002bca3..b8b5b1a0 100644 --- a/testing/variations/fieldtrial_testing_config.json +++ b/testing/variations/fieldtrial_testing_config.json
@@ -374,25 +374,6 @@ ] } ], - "AndroidNightMode": [ - { - "platforms": [ - "android", - "android_weblayer" - ], - "experiments": [ - { - "name": "Enabled_20190503", - "params": { - "u'default_light_theme": "true" - }, - "enable_features": [ - "AndroidNightMode" - ] - } - ] - } - ], "AndroidPartnerCustomizationPhenotype": [ { "platforms": [ @@ -1620,36 +1601,6 @@ ] } ], - "ChromeosVideoDecoder": [ - { - "platforms": [ - "chromeos" - ], - "experiments": [ - { - "name": "Enabled", - "enable_features": [ - "ChromeosVideoDecoder" - ] - } - ] - } - ], - "ClearSyncedData": [ - { - "platforms": [ - "ios" - ], - "experiments": [ - { - "name": "Enabled_20200407", - "enable_features": [ - "ClearSyncedData" - ] - } - ] - } - ], "ClickPointerEvent": [ { "platforms": [ @@ -1690,24 +1641,6 @@ ] } ], - "ClipboardMaximumAge": [ - { - "platforms": [ - "android" - ], - "experiments": [ - { - "name": "Enabled_V2", - "params": { - "UIClipboardMaximumAge": "600" - }, - "enable_features": [ - "ClipboardMaximumAge" - ] - } - ] - } - ], "CodeCacheDeletionWithoutFilter": [ { "platforms": [ @@ -2030,22 +1963,6 @@ ] } ], - "DataReductionProxyBlockOnBadGatewayResponse": [ - { - "platforms": [ - "android", - "android_weblayer" - ], - "experiments": [ - { - "name": "Enabled", - "enable_features": [ - "DataReductionProxyBlockOnBadGatewayResponse" - ] - } - ] - } - ], "DataReductionProxyFREPromo": [ { "platforms": [ @@ -4432,24 +4349,6 @@ ] } ], - "MirroringService": [ - { - "platforms": [ - "chromeos", - "linux", - "mac", - "windows" - ], - "experiments": [ - { - "name": "Enabled", - "enable_features": [ - "MirroringService" - ] - } - ] - } - ], "MyChromeEverywhere": [ { "platforms": [ @@ -4830,7 +4729,6 @@ "OmniboxRichEntitySuggestions", "OmniboxUIExperimentMaxAutocompleteMatches", "OmniboxZeroSuggestionsOnNTP", - "QueryInOmnibox", "SearchSuggestChips" ] } @@ -5036,25 +4934,6 @@ ] } ], - "OmniboxSteadyStateElisions": [ - { - "platforms": [ - "windows", - "mac", - "chromeos", - "linux" - ], - "experiments": [ - { - "name": "Enabled", - "enable_features": [ - "OmniboxUIExperimentHideSteadyStateUrlScheme", - "OmniboxUIExperimentHideSteadyStateUrlTrivialSubdomains" - ] - } - ] - } - ], "OmniboxSuggestionsRecyclerView": [ { "platforms": [ @@ -5535,32 +5414,6 @@ ] } ], - "PreviewsLitePageRedirect": [ - { - "platforms": [ - "android" - ], - "experiments": [ - { - "name": "Enabled_OverridePH_20190221", - "params": { - "availability": "any", - "blacklisted_path_suffixes": ".apk,.avi,.gif,.gifv,.jpeg,.jpg,.mp3,.mp4,.mpeg,.pdf,.png,.webm,.webp", - "event_preview_loaded": "name:preview_page_load;comparator:>=1;window:90;storage:360", - "event_trigger": "name:previews_verbose_iph_triggered;comparator:<2;window:90;storage:360", - "event_used": "name:previews_verbose_status_opened;comparator:==0;window:90;storage:360", - "override_pagehints": "true", - "session_rate": "==0", - "tracking_only": "true" - }, - "enable_features": [ - "AndroidOmniboxPreviewsBadge", - "LitePageServerPreviews" - ] - } - ] - } - ], "PreviewsNoScript": [ { "platforms": [ @@ -5686,7 +5539,7 @@ ] } ], - "QRCodeGeneratorDesktopStudy": [ + "QRCodeGenerator": [ { "platforms": [ "chromeos", @@ -5731,21 +5584,6 @@ ] } ], - "QueryInOmnibox": [ - { - "platforms": [ - "android" - ], - "experiments": [ - { - "name": "Enabled", - "enable_features": [ - "QueryInOmnibox" - ] - } - ] - } - ], "QueryTiles": [ { "platforms": [ @@ -5889,6 +5727,72 @@ ] } ], + "ReengagementNotification1": [ + { + "platforms": [ + "android" + ], + "experiments": [ + { + "name": "EnabledTracking1", + "params": { + "availability": "any", + "event_trigger": "name:reengagement_notification_1_trigger;comparator:==0;window:90;storage:360", + "event_used": "name:started_from_main_intent;comparator:==0;window:7;storage:360", + "session_rate": "<=1", + "tracking_only": "true" + }, + "enable_features": [ + "IPH_ChromeReengagementNotification1" + ] + } + ] + } + ], + "ReengagementNotification2": [ + { + "platforms": [ + "android" + ], + "experiments": [ + { + "name": "EnabledTracking2", + "params": { + "availability": "any", + "event_trigger": "name:reengagement_notification_2_trigger;comparator:==0;window:90;storage:360", + "event_used": "name:started_from_main_intent;comparator:==0;window:7;storage:360", + "session_rate": "<=1", + "tracking_only": "true" + }, + "enable_features": [ + "IPH_ChromeReengagementNotification2" + ] + } + ] + } + ], + "ReengagementNotification3": [ + { + "platforms": [ + "android" + ], + "experiments": [ + { + "name": "EnabledTracking3", + "params": { + "availability": "any", + "event_trigger": "name:reengagement_notification_3_trigger;comparator:==0;window:90;storage:360", + "event_used": "name:started_from_main_intent;comparator:==0;window:7;storage:360", + "session_rate": "<=1", + "tracking_only": "true" + }, + "enable_features": [ + "IPH_ChromeReengagementNotification3" + ] + } + ] + } + ], "RenderDocument": [ { "platforms": [ @@ -6224,27 +6128,6 @@ ] } ], - "SafeBrowsingCommittedInterstitials": [ - { - "platforms": [ - "android", - "android_weblayer", - "android_webview", - "chromeos", - "linux", - "mac", - "windows" - ], - "experiments": [ - { - "name": "Enabled", - "enable_features": [ - "SafeBrowsingCommittedInterstitials" - ] - } - ] - } - ], "SafeBrowsingPasswordProtectionForSavedPasswords": [ { "platforms": [ @@ -6298,38 +6181,6 @@ ] } ], - "SafeBrowsingPasswordProtectionOnFocusPingAndroid": [ - { - "platforms": [ - "android", - "android_weblayer" - ], - "experiments": [ - { - "name": "Enabled", - "enable_features": [ - "SafeBrowsingSendOnFocusPing" - ] - } - ] - } - ], - "SafeBrowsingPasswordProtectionPasswordReusePingAndroid": [ - { - "platforms": [ - "android", - "android_weblayer" - ], - "experiments": [ - { - "name": "Enabled", - "enable_features": [ - "SafeBrowsingSendPasswordReusePing" - ] - } - ] - } - ], "SafeBrowsingPasswordProtectionShowDomainsForSavedPasswords": [ { "platforms": [ @@ -6488,25 +6339,6 @@ ] } ], - "SafeBrowsingUseLocalBlacklistsV2": [ - { - "platforms": [ - "android", - "android_weblayer" - ], - "experiments": [ - { - "name": "Enabled", - "params": { - "local_blacklists_update_interval_in_secs": "900" - }, - "enable_features": [ - "SafeBrowsingUseLocalBlacklistsV2" - ] - } - ] - } - ], "SameSiteByDefaultCookies_AndroidAw": [ { "platforms": [ @@ -7697,28 +7529,6 @@ ] } ], - "V8LowMemoryModeForSubframes": [ - { - "platforms": [ - "android", - "android_weblayer" - ], - "experiments": [ - { - "name": "Enabled", - "enable_features": [ - "V8LowMemoryModeForSubframes" - ] - }, - { - "name": "Disabled", - "disable_features": [ - "V8LowMemoryModeForSubframes" - ] - } - ] - } - ], "V8SiteIsolatedCodeCache": [ { "platforms": [ @@ -7739,21 +7549,6 @@ ] } ], - "VaapiH264AMDEncoder": [ - { - "platforms": [ - "chromeos" - ], - "experiments": [ - { - "name": "Enabled", - "enable_features": [ - "VaapiH264AMDEncoder" - ] - } - ] - } - ], "VideoCaptureService": [ { "platforms": [ @@ -8355,22 +8150,6 @@ ] } ], - "WebXrPermissionsApi": [ - { - "platforms": [ - "android", - "windows" - ], - "experiments": [ - { - "name": "Enabled", - "enable_features": [ - "WebXrPermissionsApi" - ] - } - ] - } - ], "WindowsHybridSpellCheck": [ { "platforms": [
diff --git a/third_party/blink/common/features.cc b/third_party/blink/common/features.cc index 7f0ea90..19b991a 100644 --- a/third_party/blink/common/features.cc +++ b/third_party/blink/common/features.cc
@@ -567,7 +567,6 @@ const base::FeatureParam<int> kFontPreloadingDelaysRenderingParam{ &kFontPreloadingDelaysRendering, "delay-in-ms", 50}; -const base::Feature kFlexGaps{"FlexGaps", base::FEATURE_DISABLED_BY_DEFAULT}; const base::Feature kFlexNG{"FlexNG", base::FEATURE_ENABLED_BY_DEFAULT}; const base::Feature kKeepScriptResourceAlive{"KeepScriptResourceAlive",
diff --git a/third_party/blink/public/common/features.h b/third_party/blink/public/common/features.h index 1e2fc23..5eaa322 100644 --- a/third_party/blink/public/common/features.h +++ b/third_party/blink/public/common/features.h
@@ -181,7 +181,6 @@ BLINK_COMMON_EXPORT extern const base::FeatureParam<int> kFontPreloadingDelaysRenderingParam; -BLINK_COMMON_EXPORT extern const base::Feature kFlexGaps; BLINK_COMMON_EXPORT extern const base::Feature kFlexNG; BLINK_COMMON_EXPORT extern const base::Feature kKeepScriptResourceAlive;
diff --git a/third_party/blink/public/mojom/BUILD.gn b/third_party/blink/public/mojom/BUILD.gn index e7246b8..50bf90a 100644 --- a/third_party/blink/public/mojom/BUILD.gn +++ b/third_party/blink/public/mojom/BUILD.gn
@@ -116,6 +116,7 @@ "page/widget.mojom", "payments/payment_app.mojom", "peerconnection/peer_connection_tracker.mojom", + "performance_manager/v8_per_frame_memory.mojom", "permissions/permission.mojom", "permissions/permission_automation.mojom", "permissions/permission_status.mojom",
diff --git a/content/public/common/performance_manager/OWNERS b/third_party/blink/public/mojom/performance_manager/OWNERS similarity index 100% rename from content/public/common/performance_manager/OWNERS rename to third_party/blink/public/mojom/performance_manager/OWNERS
diff --git a/content/public/common/performance_manager/v8_per_frame_memory.mojom b/third_party/blink/public/mojom/performance_manager/v8_per_frame_memory.mojom similarity index 98% rename from content/public/common/performance_manager/v8_per_frame_memory.mojom rename to third_party/blink/public/mojom/performance_manager/v8_per_frame_memory.mojom index 6e0d5a3..f6088b5d 100644 --- a/content/public/common/performance_manager/v8_per_frame_memory.mojom +++ b/third_party/blink/public/mojom/performance_manager/v8_per_frame_memory.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. -module performance_manager.mojom; +module blink.mojom; import "mojo/public/mojom/base/unguessable_token.mojom";
diff --git a/third_party/blink/renderer/build/scripts/core/css/css_properties.py b/third_party/blink/renderer/build/scripts/core/css/css_properties.py index 66b3f9d..881f48b 100755 --- a/third_party/blink/renderer/build/scripts/core/css/css_properties.py +++ b/third_party/blink/renderer/build/scripts/core/css/css_properties.py
@@ -378,6 +378,10 @@ return self._last_unresolved_property_id @property + def property_id_bit_length(self): + return int.bit_length(self._last_unresolved_property_id) + + @property def alias_offset(self): return self._alias_offset
diff --git a/third_party/blink/renderer/build/scripts/core/css/make_css_property_names.py b/third_party/blink/renderer/build/scripts/core/css/make_css_property_names.py index e20639a..899730db 100755 --- a/third_party/blink/renderer/build/scripts/core/css/make_css_property_names.py +++ b/third_party/blink/renderer/build/scripts/core/css/make_css_property_names.py
@@ -47,6 +47,8 @@ self._css_properties.last_property_id, 'last_unresolved_property_id': self._css_properties.last_unresolved_property_id, + 'property_id_bit_length': + self._css_properties.property_id_bit_length, 'max_name_length': max(map(len, self._css_properties.properties_by_id)), }
diff --git a/third_party/blink/renderer/build/scripts/core/css/templates/css_property_names.h.tmpl b/third_party/blink/renderer/build/scripts/core/css/templates/css_property_names.h.tmpl index da7252f..1da8f0f 100644 --- a/third_party/blink/renderer/build/scripts/core/css/templates/css_property_names.h.tmpl +++ b/third_party/blink/renderer/build/scripts/core/css/templates/css_property_names.h.tmpl
@@ -37,6 +37,11 @@ const CSSPropertyID lastUnresolvedCSSProperty = static_cast<CSSPropertyID>({{last_unresolved_property_id}}); const int numCSSPropertyIDs = static_cast<int>(lastUnresolvedCSSProperty) + 1; const size_t maxCSSPropertyNameLength = {{max_name_length}}; +constexpr size_t kCSSPropertyIDBitLength = {{property_id_bit_length}}; + +static_assert((static_cast<size_t>(1) << kCSSPropertyIDBitLength) > + static_cast<size_t>(lastUnresolvedCSSProperty), + "kCSSPropertyIDBitLength has enough bits"); inline int GetCSSPropertyIDIndex(CSSPropertyID id) { DCHECK_GE(id, firstCSSProperty);
diff --git a/third_party/blink/renderer/config.gni b/third_party/blink/renderer/config.gni index e2b18ed..22e51ec7 100644 --- a/third_party/blink/renderer/config.gni +++ b/third_party/blink/renderer/config.gni
@@ -42,7 +42,7 @@ # If true, the new implementation (experimental) of Blink-V8 bindings # (of IDL interface) is used. - use_blink_v8_binding_new_idl_interface = true + use_blink_v8_binding_new_idl_interface = false } # feature_defines_list ---------------------------------------------------------
diff --git a/third_party/blink/renderer/controller/BUILD.gn b/third_party/blink/renderer/controller/BUILD.gn index fbfd5591..5f504fb7 100644 --- a/third_party/blink/renderer/controller/BUILD.gn +++ b/third_party/blink/renderer/controller/BUILD.gn
@@ -61,6 +61,11 @@ "oom_intervention_impl.cc", "oom_intervention_impl.h", ] + } else { + sources += [ + "performance_manager/v8_per_frame_memory_reporter_impl.cc", + "performance_manager/v8_per_frame_memory_reporter_impl.h", + ] } if (is_win) { sources += [
diff --git a/third_party/blink/renderer/controller/blink_initializer.cc b/third_party/blink/renderer/controller/blink_initializer.cc index ad42a29..640825a 100644 --- a/third_party/blink/renderer/controller/blink_initializer.cc +++ b/third_party/blink/renderer/controller/blink_initializer.cc
@@ -63,6 +63,8 @@ #if defined(OS_ANDROID) #include "third_party/blink/renderer/controller/crash_memory_metrics_reporter_impl.h" #include "third_party/blink/renderer/controller/oom_intervention_impl.h" +#else +#include "third_party/blink/renderer/controller/performance_manager/v8_per_frame_memory_reporter_impl.h" #endif #if defined(OS_LINUX) @@ -203,7 +205,14 @@ binders.Add(ConvertToBaseRepeatingCallback(CrossThreadBindRepeating( &CrashMemoryMetricsReporterImpl::Bind)), main_thread->GetTaskRunner()); +#else + // Currently nothing on Android samples V8PerFrameMemory, so only initialize + // the reporter on desktop to save memory. + binders.Add(ConvertToBaseRepeatingCallback(CrossThreadBindRepeating( + &V8PerFrameMemoryReporterImpl::Create)), + main_thread->GetTaskRunner()); #endif + #if defined(OS_LINUX) binders.Add(ConvertToBaseRepeatingCallback( CrossThreadBindRepeating(&MemoryUsageMonitorPosix::Bind)),
diff --git a/content/renderer/performance_manager/OWNERS b/third_party/blink/renderer/controller/performance_manager/OWNERS similarity index 100% rename from content/renderer/performance_manager/OWNERS rename to third_party/blink/renderer/controller/performance_manager/OWNERS
diff --git a/content/renderer/performance_manager/v8_per_frame_memory_reporter_impl.cc b/third_party/blink/renderer/controller/performance_manager/v8_per_frame_memory_reporter_impl.cc similarity index 61% rename from content/renderer/performance_manager/v8_per_frame_memory_reporter_impl.cc rename to third_party/blink/renderer/controller/performance_manager/v8_per_frame_memory_reporter_impl.cc index 3d350549..200f48c 100644 --- a/content/renderer/performance_manager/v8_per_frame_memory_reporter_impl.cc +++ b/third_party/blink/renderer/controller/performance_manager/v8_per_frame_memory_reporter_impl.cc
@@ -2,24 +2,35 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "content/renderer/performance_manager/v8_per_frame_memory_reporter_impl.h" +#include "third_party/blink/renderer/controller/performance_manager/v8_per_frame_memory_reporter_impl.h" -#include "base/containers/flat_map.h" -#include "content/public/common/isolated_world_ids.h" #include "mojo/public/cpp/bindings/self_owned_receiver.h" #include "third_party/blink/public/platform/web_isolated_world_info.h" #include "third_party/blink/public/web/web_local_frame.h" #include "third_party/blink/public/web/web_local_frame_client.h" +#include "third_party/blink/renderer/platform/bindings/dom_wrapper_world.h" +#include "third_party/blink/renderer/platform/wtf/hash_map.h" #include "v8/include/v8.h" -namespace performance_manager { +namespace WTF { +template <> +struct HashTraits<::blink::mojom::blink::PerFrameV8MemoryUsageDataPtr> + : GenericHashTraits<::blink::mojom::blink::PerFrameV8MemoryUsageDataPtr> { + // The default PeekOutType is a value type that requires a copy constructor + // in the at() getter. Override it to a reference. + typedef const ::blink::mojom::blink::PerFrameV8MemoryUsageDataPtr& + PeekOutType; +}; +} // namespace WTF + +namespace blink { namespace { class FrameAssociatedMeasurementDelegate : public v8::MeasureMemoryDelegate { public: - using GetPerFrameV8MemoryUsageDataCallback = - mojom::V8PerFrameMemoryReporter::GetPerFrameV8MemoryUsageDataCallback; + using GetPerFrameV8MemoryUsageDataCallback = mojom::blink:: + V8PerFrameMemoryReporter::GetPerFrameV8MemoryUsageDataCallback; explicit FrameAssociatedMeasurementDelegate( GetPerFrameV8MemoryUsageDataCallback&& callback) @@ -27,7 +38,8 @@ ~FrameAssociatedMeasurementDelegate() override { if (callback_) { - std::move(callback_).Run(mojom::PerProcessV8MemoryUsageData::New()); + std::move(callback_).Run( + mojom::blink::PerProcessV8MemoryUsageData::New()); } } @@ -41,13 +53,14 @@ const std::vector<std::pair<v8::Local<v8::Context>, size_t>>& context_sizes_in_bytes, size_t unattributed_size_in_bytes) override { - mojom::PerProcessV8MemoryUsageDataPtr result = - mojom::PerProcessV8MemoryUsageData::New(); + mojom::blink::PerProcessV8MemoryUsageDataPtr result = + mojom::blink::PerProcessV8MemoryUsageData::New(); result->unassociated_bytes_used = unattributed_size_in_bytes; // Keep track of the per-frame data throughout this loop. - base::flat_map<blink::WebLocalFrame*, mojom::PerFrameV8MemoryUsageDataPtr> + WTF::HashMap<blink::WebLocalFrame*, + mojom::blink::PerFrameV8MemoryUsageDataPtr> frames; for (const auto& context_and_size : context_sizes_in_bytes) { const v8::Local<v8::Context>& context = context_and_size.first; @@ -63,45 +76,45 @@ ++(result->num_unassociated_contexts); result->unassociated_context_bytes_used += size; } else { - mojom::PerFrameV8MemoryUsageData* per_frame_resources = - frames[frame].get(); + mojom::blink::PerFrameV8MemoryUsageData* per_frame_resources = + frames.at(frame).get(); if (!per_frame_resources) { #if DCHECK_IS_ON() // Check that the frame token didn't already occur. for (const auto& entry : frames) { // This frame was already added to the map by frames[frame] above. - if (frame == entry.first) + if (frame == entry.key) continue; - DCHECK_NE(entry.first->GetFrameToken(), frame->GetFrameToken()); + DCHECK_NE(entry.key->GetFrameToken(), frame->GetFrameToken()); } #endif - auto new_resources = mojom::PerFrameV8MemoryUsageData::New(); + auto new_resources = mojom::blink::PerFrameV8MemoryUsageData::New(); new_resources->frame_token = frame->GetFrameToken(); per_frame_resources = new_resources.get(); - frames[frame] = std::move(new_resources); + frames.Set(frame, std::move(new_resources)); } - mojom::V8IsolatedWorldMemoryUsagePtr isolated_world_usage = - mojom::V8IsolatedWorldMemoryUsage::New(); + mojom::blink::V8IsolatedWorldMemoryUsagePtr isolated_world_usage = + mojom::blink::V8IsolatedWorldMemoryUsage::New(); isolated_world_usage->bytes_used = size; int32_t world_id = frame->GetScriptContextWorldId(context); - if (world_id != content::ISOLATED_WORLD_ID_GLOBAL) { + if (world_id != DOMWrapperWorld::WorldId::kMainWorldId) { isolated_world_usage->stable_id = - blink::GetIsolatedWorldStableId(context).Utf8(); + blink::GetIsolatedWorldStableId(context); isolated_world_usage->human_readable_name = - blink::GetIsolatedWorldHumanReadableName(context).Utf8(); + blink::GetIsolatedWorldHumanReadableName(context); } DCHECK( !base::Contains(per_frame_resources->associated_bytes, world_id)); - per_frame_resources->associated_bytes[world_id] = - std::move(isolated_world_usage); + per_frame_resources->associated_bytes.Set( + world_id, std::move(isolated_world_usage)); } } // Move the per-frame memory values to the result. for (auto& entry : frames) - result->associated_memory.push_back(std::move(entry.second)); + result->associated_memory.push_back(std::move(entry.value)); std::move(callback_).Run(std::move(result)); } @@ -113,7 +126,7 @@ // static void V8PerFrameMemoryReporterImpl::Create( - mojo::PendingReceiver<mojom::V8PerFrameMemoryReporter> receiver) { + mojo::PendingReceiver<mojom::blink::V8PerFrameMemoryReporter> receiver) { mojo::MakeSelfOwnedReceiver(std::make_unique<V8PerFrameMemoryReporterImpl>(), std::move(receiver)); } @@ -122,7 +135,7 @@ GetPerFrameV8MemoryUsageDataCallback callback) { v8::Isolate* isolate = v8::Isolate::GetCurrent(); if (!isolate) { - std::move(callback).Run(mojom::PerProcessV8MemoryUsageData::New()); + std::move(callback).Run(mojom::blink::PerProcessV8MemoryUsageData::New()); } else { std::unique_ptr<FrameAssociatedMeasurementDelegate> delegate = std::make_unique<FrameAssociatedMeasurementDelegate>( @@ -132,4 +145,4 @@ } } -} // namespace performance_manager +} // namespace blink
diff --git a/third_party/blink/renderer/controller/performance_manager/v8_per_frame_memory_reporter_impl.h b/third_party/blink/renderer/controller/performance_manager/v8_per_frame_memory_reporter_impl.h new file mode 100644 index 0000000..18cd9d1 --- /dev/null +++ b/third_party/blink/renderer/controller/performance_manager/v8_per_frame_memory_reporter_impl.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 THIRD_PARTY_BLINK_RENDERER_CONTROLLER_PERFORMANCE_MANAGER_V8_PER_FRAME_MEMORY_REPORTER_IMPL_H_ +#define THIRD_PARTY_BLINK_RENDERER_CONTROLLER_PERFORMANCE_MANAGER_V8_PER_FRAME_MEMORY_REPORTER_IMPL_H_ + +#include "third_party/blink/public/mojom/performance_manager/v8_per_frame_memory.mojom-blink.h" + +namespace blink { + +// Exposes V8 per-frame associated memory metrics to the browser. +class V8PerFrameMemoryReporterImpl + : public mojom::blink::V8PerFrameMemoryReporter { + public: + static void Create( + mojo::PendingReceiver<mojom::blink::V8PerFrameMemoryReporter> receiver); + + void GetPerFrameV8MemoryUsageData( + GetPerFrameV8MemoryUsageDataCallback callback) override; +}; + +} // namespace blink + +#endif // THIRD_PARTY_BLINK_CONTROLLER_PERFORMANCE_MANAGER_V8_PER_FRAME_MEMORY_REPORTER_IMPL_H_
diff --git a/third_party/blink/renderer/core/dom/increment_load_event_delay_count.h b/third_party/blink/renderer/core/dom/increment_load_event_delay_count.h index ca66a45..a4f0a3f 100644 --- a/third_party/blink/renderer/core/dom/increment_load_event_delay_count.h +++ b/third_party/blink/renderer/core/dom/increment_load_event_delay_count.h
@@ -17,7 +17,7 @@ class Document; // A helper class that will increment a document's loadEventDelayCount on -// contruction and decrement it on destruction (semantics similar to RefPtr). +// construction and decrement it on destruction (semantics similar to RefPtr). class CORE_EXPORT IncrementLoadEventDelayCount { USING_FAST_MALLOC(IncrementLoadEventDelayCount);
diff --git a/third_party/blink/renderer/core/frame/local_frame_view.cc b/third_party/blink/renderer/core/frame/local_frame_view.cc index 422e473..adcc5e5 100644 --- a/third_party/blink/renderer/core/frame/local_frame_view.cc +++ b/third_party/blink/renderer/core/frame/local_frame_view.cc
@@ -380,7 +380,7 @@ if (!child_local_frame) continue; if (LocalFrameView* child_view = child_local_frame->View()) - child_view->ForAllNonThrottledLocalFrameViews(function); + child_view->ForAllThrottledLocalFrameViews(function); } } @@ -2859,6 +2859,8 @@ ForAllThrottledLocalFrameViews( [](LocalFrameView& frame_view) { frame_view.MarkIneligibleToPaint(); }); + bool needs_clear_repaint_flags = false; + if (RuntimeEnabledFeatures::CompositeAfterPaintEnabled()) { if (!paint_controller_) paint_controller_ = std::make_unique<PaintController>(); @@ -2917,6 +2919,7 @@ DCHECK(!visual_viewport_needs_repaint_); paint_controller_->CommitNewDisplayItems(); + needs_clear_repaint_flags = true; } } else { // A null graphics layer can occur for painting of SVG images that are not @@ -2931,16 +2934,22 @@ // changed which will affect the mapped hit test geometry. if (GetScrollingCoordinator()) GetScrollingCoordinator()->NotifyGeometryChanged(this); + needs_clear_repaint_flags = true; } + } else { + needs_clear_repaint_flags = true; } } - ForAllNonThrottledLocalFrameViews([](LocalFrameView& frame_view) { - frame_view.Lifecycle().AdvanceTo(DocumentLifecycle::kPaintClean); - if (auto* layout_view = frame_view.GetLayoutView()) - layout_view->Layer()->ClearNeedsRepaintRecursively(); - frame_view.GetPaintTimingDetector().NotifyPaintFinished(); - }); + ForAllNonThrottledLocalFrameViews( + [needs_clear_repaint_flags](LocalFrameView& frame_view) { + frame_view.Lifecycle().AdvanceTo(DocumentLifecycle::kPaintClean); + if (needs_clear_repaint_flags) { + if (auto* layout_view = frame_view.GetLayoutView()) + layout_view->Layer()->ClearNeedsRepaintRecursively(); + } + frame_view.GetPaintTimingDetector().NotifyPaintFinished(); + }); PaintController::ReportUMACounts(); }
diff --git a/third_party/blink/renderer/core/layout/flexible_box_algorithm.cc b/third_party/blink/renderer/core/layout/flexible_box_algorithm.cc index 341c3623..e95d019d 100644 --- a/third_party/blink/renderer/core/layout/flexible_box_algorithm.cc +++ b/third_party/blink/renderer/core/layout/flexible_box_algorithm.cc
@@ -586,8 +586,6 @@ LayoutUnit FlexLayoutAlgorithm::GapBetweenItems( const ComputedStyle& style, LogicalSize percent_resolution_sizes) { - if (!RuntimeEnabledFeatures::FlexGapsEnabled()) - return LayoutUnit(); DCHECK_GE(percent_resolution_sizes.inline_size, 0); if (IsColumnFlow(style)) { if (const base::Optional<Length>& row_gap = style.RowGap()) { @@ -607,8 +605,6 @@ LayoutUnit FlexLayoutAlgorithm::GapBetweenLines( const ComputedStyle& style, LogicalSize percent_resolution_sizes) { - if (!RuntimeEnabledFeatures::FlexGapsEnabled()) - return LayoutUnit(); DCHECK_GE(percent_resolution_sizes.inline_size, 0); if (!IsColumnFlow(style)) { if (const base::Optional<Length>& row_gap = style.RowGap()) {
diff --git a/third_party/blink/renderer/core/layout/layout_box.cc b/third_party/blink/renderer/core/layout/layout_box.cc index 31c84f3..068728f1b 100644 --- a/third_party/blink/renderer/core/layout/layout_box.cc +++ b/third_party/blink/renderer/core/layout/layout_box.cc
@@ -6760,6 +6760,22 @@ GetLayoutBox().PhysicalSelfVisualOverflowRect(); } +void LayoutBox::MutableForPainting::SetPreviousSizeAndLayoutOverflowRect( + const LayoutSize& previous_size, + const PhysicalRect& previous_layout_overflow_rect) { + GetLayoutBox().previous_size_ = previous_size; + if (!previous_layout_overflow_rect.offset.IsZero() || + previous_layout_overflow_rect.size != + PhysicalSizeToBeNoop(previous_size)) { + auto& rare_data = GetLayoutBox().EnsureRareData(); + rare_data.has_previous_content_box_and_overflow_rects_ = true; + rare_data.previous_physical_layout_overflow_rect_ = + previous_layout_overflow_rect; + // Other previous_* fields don't matter because they are used for paint + // invalidation and we always do full paint invalidation on reattachment. + } +} + RasterEffectOutset LayoutBox::VisualRectOutsetForRasterEffects() const { // If the box has subpixel visual effect outsets, as the visual effect may be // painted along the pixel-snapped border box, the pixels on the anti-aliased
diff --git a/third_party/blink/renderer/core/layout/layout_box.h b/third_party/blink/renderer/core/layout/layout_box.h index 7acd06c..10a69f21 100644 --- a/third_party/blink/renderer/core/layout/layout_box.h +++ b/third_party/blink/renderer/core/layout/layout_box.h
@@ -1619,6 +1619,13 @@ false; } + // Called from LayoutShiftTracker when we attach this LayoutBox to a node + // for which we saved these values when the node was detached from its + // original LayoutBox. + void SetPreviousSizeAndLayoutOverflowRect( + const LayoutSize& previous_size, + const PhysicalRect& previous_layout_overflow_rect); + protected: friend class LayoutBox; MutableForPainting(const LayoutBox& box)
diff --git a/third_party/blink/renderer/core/layout/layout_object.cc b/third_party/blink/renderer/core/layout/layout_object.cc index fbb5a7b4..1d99fda 100644 --- a/third_party/blink/renderer/core/layout/layout_object.cc +++ b/third_party/blink/renderer/core/layout/layout_object.cc
@@ -177,7 +177,6 @@ Member<void*> members[1]; // The following fields are in FragmentData. PhysicalOffset paint_offset_; - PhysicalRect visual_rect_for_layout_shift_tracking; std::unique_ptr<int> rare_data_; };
diff --git a/third_party/blink/renderer/core/layout/layout_shift_tracker.cc b/third_party/blink/renderer/core/layout/layout_shift_tracker.cc index c0a2f1d..bde56304 100644 --- a/third_party/blink/renderer/core/layout/layout_shift_tracker.cc +++ b/third_party/blink/renderer/core/layout/layout_shift_tracker.cc
@@ -31,6 +31,9 @@ using ReattachHook = LayoutShiftTracker::ReattachHook; +using ContainingBlockScope = LayoutShiftTracker::ContainingBlockScope; +ContainingBlockScope* ContainingBlockScope::top_ = nullptr; + namespace { ReattachHook& GetReattachHook() { @@ -42,33 +45,56 @@ constexpr base::TimeDelta kTimerDelay = base::TimeDelta::FromMilliseconds(500); const float kMovementThreshold = 3.0; // CSS pixels. -FloatPoint LogicalStart(const FloatRect& rect, const LayoutObject& object) { - const ComputedStyle* style = object.Style(); - DCHECK(style); - auto logical = - PhysicalToLogical<float>(style->GetWritingMode(), style->Direction(), - rect.Y(), rect.MaxX(), rect.MaxY(), rect.X()); - return FloatPoint(logical.InlineStart(), logical.BlockStart()); +// Calculates the physical coordinates of the starting point in the current +// coordinate space. |paint_offset| is the physical offset of the top-left +// corner. The starting point can be any of the four corners of the box, +// depending on the writing mode and text direction. Note that the result is +// still in physical coordinates, just may be of a different corner. +// See https://wicg.github.io/layout-instability/#starting-point. +FloatPoint StartingPoint(const PhysicalOffset& paint_offset, + const LayoutBox& box, + const LayoutSize& size) { + PhysicalOffset starting_point = paint_offset; + auto writing_direction = box.StyleRef().GetWritingDirection(); + if (UNLIKELY(writing_direction.IsFlippedBlocks())) + starting_point.left += size.Width(); + if (UNLIKELY(writing_direction.IsRtl())) { + if (writing_direction.IsHorizontal()) + starting_point.left += size.Width(); + else + starting_point.top += size.Height(); + } + return FloatPoint(starting_point); } -float GetMoveDistance(const FloatRect& old_rect, - const FloatRect& new_rect, - const LayoutObject& object) { - FloatSize location_delta = - LogicalStart(new_rect, object) - LogicalStart(old_rect, object); +// Returns the part a rect logically below a starting point. +PhysicalRect RectBelowStartingPoint(const PhysicalRect& rect, + const PhysicalOffset& starting_point, + WritingDirectionMode writing_direction) { + PhysicalRect result = rect; + if (writing_direction.IsHorizontal()) + result.ShiftTopEdgeTo(starting_point.top); + else if (writing_direction.IsFlippedBlocks()) + result.ShiftRightEdgeTo(starting_point.left); + else + result.ShiftLeftEdgeTo(starting_point.left); + return result; +} + +float GetMoveDistance(const FloatPoint& old_starting_point, + const FloatPoint& new_starting_point) { + FloatSize location_delta = new_starting_point - old_starting_point; return std::max(fabs(location_delta.Width()), fabs(location_delta.Height())); } bool EqualWithinMovementThreshold(const FloatPoint& a, const FloatPoint& b, - const LayoutObject& object) { - float threshold_physical_px = - kMovementThreshold * object.StyleRef().EffectiveZoom(); + float threshold_physical_px) { return fabs(a.X() - b.X()) < threshold_physical_px && fabs(a.Y() - b.Y()) < threshold_physical_px; } -bool SmallerThanRegionGranularity(const FloatRect& rect) { +bool SmallerThanRegionGranularity(const PhysicalRect& rect) { // The region uses integer coordinates, so the rects are snapped to // pixel boundaries. Ignore rects smaller than half a pixel. return rect.Width() < 0.5 || rect.Height() < 0.5; @@ -110,6 +136,10 @@ LayoutShiftTracker::LayoutShiftTracker(LocalFrameView* frame_view) : frame_view_(frame_view), + // This eliminates noise from the private Page object created by + // SVGImage::DataChanged. + is_active_( + !frame_view_->GetFrame().GetChromeClient().IsSVGImageChromeClient()), score_(0.0), weighted_score_(0.0), timer_(frame_view->GetFrame().GetTaskRunner(TaskType::kInternalDefault), @@ -120,105 +150,138 @@ observed_input_or_scroll_(false), most_recent_input_timestamp_initialized_(false) {} -void LayoutShiftTracker::ObjectShifted( - const LayoutObject& source, - const PropertyTreeStateOrAlias& property_tree_state, - FloatRect old_rect, - FloatRect new_rect) { - if (old_rect.IsEmpty() || new_rect.IsEmpty()) - return; +bool LayoutShiftTracker::NeedsToTrack(const LayoutObject& object) const { + if (!is_active_) + return false; - if (EqualWithinMovementThreshold(LogicalStart(old_rect, source), - LogicalStart(new_rect, source), source)) + // SVG elements don't participate in the normal layout algorithms and are + // more likely to be used for animations. + if (object.IsSVGChild()) + return false; + + if (object.IsText()) + return ContainingBlockScope::top_; + + if (!object.IsBox()) + return false; + + // Don't report shift of anonymous objects. Will report the children because + // we want report real DOM nodes. + if (object.IsAnonymous()) + return true; + + // Ignore layout objects that move (in the coordinate space of the paint + // invalidation container) on scroll. + // TODO(skobes): Find a way to detect when these objects shift. + if (object.IsFixedPositioned() || object.IsStickyPositioned()) + return false; + + if (object.IsLayoutView()) + return false; + + if (Element* element = DynamicTo<Element>(object.GetNode())) { + if (element->IsSliderThumbElement()) + return false; + } + + return true; +} + +void LayoutShiftTracker::ObjectShifted( + const LayoutObject& object, + const PropertyTreeStateOrAlias& property_tree_state, + const PhysicalRect& old_rect, + const PhysicalRect& new_rect, + const FloatPoint& old_starting_point, + const FloatPoint& new_starting_point) { + // The caller should ensure these conditions. + DCHECK(!old_rect.IsEmpty()); + DCHECK(!new_rect.IsEmpty()); + + float threshold_physical_px = + kMovementThreshold * object.StyleRef().EffectiveZoom(); + + if (EqualWithinMovementThreshold(old_starting_point, new_starting_point, + threshold_physical_px)) return; if (SmallerThanRegionGranularity(old_rect) && SmallerThanRegionGranularity(new_rect)) return; - // Ignore layout objects that move (in the coordinate space of the paint - // invalidation container) on scroll. - // TODO(skobes): Find a way to detect when these objects shift. - if (source.IsFixedPositioned() || source.IsStickyPositioned()) - return; - - // SVG elements don't participate in the normal layout algorithms and are - // more likely to be used for animations. - if (source.IsSVG()) - return; - - if (Element* element = DynamicTo<Element>(source.GetNode())) { - if (element->IsSliderThumbElement()) - return; - } - const auto& root_state = - source.View()->FirstFragment().LocalBorderBoxProperties(); + object.View()->FirstFragment().LocalBorderBoxProperties(); FloatClipRect clip_rect = GeometryMapper::LocalToAncestorClipRect(property_tree_state, root_state); + clip_rect.Intersect(FloatClipRect(FloatRect( + FloatPoint(), + FloatSize( + frame_view_->GetScrollableArea()->VisibleContentRect().Size())))); // If the clip region is empty, then the resulting layout shift isn't visible // in the viewport so ignore it. - if (!clip_rect.IsInfinite() && clip_rect.Rect().IsEmpty()) + if (clip_rect.Rect().IsEmpty()) return; - GeometryMapper::SourceToDestinationRect(property_tree_state.Transform(), - root_state.Transform(), old_rect); - GeometryMapper::SourceToDestinationRect(property_tree_state.Transform(), - root_state.Transform(), new_rect); + auto transform = GeometryMapper::SourceToDestinationProjection( + property_tree_state.Transform(), root_state.Transform()); + FloatPoint old_starting_point_in_root = + transform.MapPoint(old_starting_point); + FloatPoint new_starting_point_in_root = + transform.MapPoint(new_starting_point); - if (EqualWithinMovementThreshold(old_rect.Location(), new_rect.Location(), - source)) { + if (EqualWithinMovementThreshold(old_starting_point_in_root, + new_starting_point_in_root, + threshold_physical_px)) return; - } - if (EqualWithinMovementThreshold(old_rect.Location() + frame_scroll_delta_, - new_rect.Location(), source)) { + if (EqualWithinMovementThreshold( + old_starting_point_in_root + frame_scroll_delta_, + new_starting_point_in_root, threshold_physical_px)) { // TODO(skobes): Checking frame_scroll_delta_ is an imperfect solution to // allowing counterscrolled layout shifts. Ideally, we would map old_rect // to viewport coordinates using the previous frame's scroll tree. return; } - FloatRect clipped_old_rect(old_rect), clipped_new_rect(new_rect); - if (!clip_rect.IsInfinite()) { - clipped_old_rect.Intersect(clip_rect.Rect()); - clipped_new_rect.Intersect(clip_rect.Rect()); - } + FloatRect old_rect_in_root(old_rect); + transform.MapRect(old_rect_in_root); + FloatRect new_rect_in_root(new_rect); + transform.MapRect(new_rect_in_root); - IntRect viewport = - IntRect(IntPoint(), - frame_view_->GetScrollableArea()->VisibleContentRect().Size()); - - IntRect visible_old_rect = RoundedIntRect(clipped_old_rect); - visible_old_rect.Intersect(viewport); - IntRect visible_new_rect = RoundedIntRect(clipped_new_rect); - visible_new_rect.Intersect(viewport); - + IntRect visible_old_rect = + RoundedIntRect(Intersection(old_rect_in_root, clip_rect.Rect())); + IntRect visible_new_rect = + RoundedIntRect(Intersection(new_rect_in_root, clip_rect.Rect())); if (visible_old_rect.IsEmpty() && visible_new_rect.IsEmpty()) return; // Compute move distance based on unclipped rects, to accurately determine how // much the element moved. - float move_distance = GetMoveDistance(old_rect, new_rect, source); + float move_distance = + GetMoveDistance(old_starting_point_in_root, new_starting_point_in_root); frame_max_distance_ = std::max(frame_max_distance_, move_distance); #if DCHECK_IS_ON() LocalFrame& frame = frame_view_->GetFrame(); if (ShouldLog(frame)) { DVLOG(2) << "in " << (frame.IsMainFrame() ? "" : "subframe ") - << frame.GetDocument()->Url().GetString() << ", " - << source.DebugName() << " moved from " << old_rect.ToString() - << " to " << new_rect.ToString() << " (visible from " - << visible_old_rect.ToString() << " to " - << visible_new_rect.ToString() << ")"; + << frame.GetDocument()->Url() << ", " << object << " moved from " + << old_rect_in_root << " to " << new_rect_in_root + << " (visible from " << visible_old_rect << " to " + << visible_new_rect << ")"; + if (old_starting_point_in_root != old_rect_in_root.Location() || + new_starting_point_in_root != new_rect_in_root.Location()) { + DVLOG(2) << " (starting point from " << old_starting_point_in_root + << " to " << new_starting_point_in_root << ")"; + } } #endif region_.AddRect(visible_old_rect); region_.AddRect(visible_new_rect); - if (Node* node = source.GetNode()) { + if (Node* node = object.GetNode()) { MaybeRecordAttribution( {DOMNodeIds::IdForNode(node), visible_old_rect, visible_new_rect}); } @@ -273,16 +336,60 @@ *smallest = attribution; } -void LayoutShiftTracker::NotifyObjectPrePaint( - const LayoutObject& object, +void LayoutShiftTracker::NotifyBoxPrePaint( + const LayoutBox& box, const PropertyTreeStateOrAlias& property_tree_state, - const PhysicalRect& old_visual_rect, - const PhysicalRect& new_visual_rect) { - if (!IsActive()) + const PhysicalRect& old_rect, + const PhysicalRect& new_rect, + const PhysicalOffset& old_paint_offset, + const PhysicalOffset& new_paint_offset) { + DCHECK(NeedsToTrack(box)); + ObjectShifted(box, property_tree_state, old_rect, new_rect, + StartingPoint(old_paint_offset, box, box.PreviousSize()), + StartingPoint(new_paint_offset, box, box.Size())); +} + +void LayoutShiftTracker::NotifyTextPrePaint( + const LayoutText& text, + const PropertyTreeStateOrAlias& property_tree_state, + const LogicalOffset& old_starting_point, + const LogicalOffset& new_starting_point, + const PhysicalOffset& old_paint_offset, + const PhysicalOffset& new_paint_offset) { + DCHECK(NeedsToTrack(text)); + auto* block = ContainingBlockScope::top_; + DCHECK(block); + LayoutUnit distance = std::max( + (new_starting_point.inline_offset - old_starting_point.inline_offset) + .Abs(), + (new_starting_point.block_offset - old_starting_point.block_offset) + .Abs()); + if (distance <= block->max_text_shift_distance_) return; - ObjectShifted(object, property_tree_state, FloatRect(old_visual_rect), - FloatRect(new_visual_rect)); + block->max_text_shift_distance_ = distance; + auto writing_direction = text.StyleRef().GetWritingDirection(); + PhysicalOffset old_physical_starting_point = + old_paint_offset + old_starting_point.ConvertToPhysical(writing_direction, + block->old_size_, + PhysicalSize()); + PhysicalOffset new_physical_starting_point = + new_paint_offset + new_starting_point.ConvertToPhysical(writing_direction, + block->new_size_, + PhysicalSize()); + + PhysicalRect old_rect = RectBelowStartingPoint( + block->old_rect_, old_physical_starting_point, writing_direction); + if (old_rect.IsEmpty()) + return; + PhysicalRect new_rect = RectBelowStartingPoint( + block->new_rect_, new_physical_starting_point, writing_direction); + if (new_rect.IsEmpty()) + return; + + ObjectShifted(text, property_tree_state, old_rect, new_rect, + FloatPoint(old_physical_starting_point), + FloatPoint(new_physical_starting_point)); } double LayoutShiftTracker::SubframeWeightingFactor() const { @@ -311,7 +418,7 @@ } void LayoutShiftTracker::NotifyPrePaintFinished() { - if (!IsActive()) + if (!is_active_) return; if (region_.IsEmpty()) return; @@ -339,7 +446,7 @@ LocalFrame& frame = frame_view_->GetFrame(); if (ShouldLog(frame)) { DVLOG(1) << "in " << (frame.IsMainFrame() ? "" : "subframe ") - << frame.GetDocument()->Url().GetString() << ", viewport was " + << frame.GetDocument()->Url() << ", viewport was " << (impact_fraction * 100) << "% impacted with distance fraction " << move_distance_factor; } @@ -492,14 +599,6 @@ UpdateInputTimestamp(base::TimeTicks::Now()); } -bool LayoutShiftTracker::IsActive() { - // This eliminates noise from the private Page object created by - // SVGImage::DataChanged. - if (frame_view_->GetFrame().GetChromeClient().IsSVGImageChromeClient()) - return false; - return true; -} - std::unique_ptr<TracedValue> LayoutShiftTracker::PerFrameTraceData( double score_delta, bool input_detected) const { @@ -577,7 +676,7 @@ auto& hook = GetReattachHook(); hook.scope_ = outer_; if (!outer_) - hook.visual_rects_.clear(); + hook.geometries_before_detach_.clear(); } } @@ -586,17 +685,19 @@ if (!hook.scope_) return; auto* layout_object = node.GetLayoutObject(); - if (!layout_object) + if (!layout_object || !layout_object->IsBox()) return; - auto& map = hook.visual_rects_; + auto& map = hook.geometries_before_detach_; auto& fragment = layout_object->GetMutableForPainting().FirstFragment(); // Save the visual rect for restoration on future reattachment. - PhysicalRect visual_rect = fragment.VisualRectForLayoutShiftTracking(); - if (visual_rect.IsEmpty()) + const auto& box = ToLayoutBox(*layout_object); + PhysicalRect layout_overflow_rect = box.PreviousPhysicalLayoutOverflowRect(); + if (layout_overflow_rect.IsEmpty()) return; - map.Set(&node, visual_rect); + map.Set(&node, Geometry{layout_overflow_rect, fragment.PaintOffset(), + box.PreviousSize()}); } void ReattachHook::NotifyAttach(const Node& node) { @@ -604,20 +705,25 @@ if (!hook.scope_) return; auto* layout_object = node.GetLayoutObject(); - if (!layout_object) + if (!layout_object || !layout_object->IsBox()) return; - auto& map = hook.visual_rects_; + auto& map = hook.geometries_before_detach_; auto& fragment = layout_object->GetMutableForPainting().FirstFragment(); - // Restore the visual rect that was saved during detach. + // Restore geometries that was saved during detach. Note: this does not + // affect paint invalidation; we will fully invalidate the new layout object. auto iter = map.find(&node); if (iter == map.end()) return; - fragment.SetVisualRectForLayoutShiftTracking(iter->value); + ToLayoutBox(layout_object) + ->GetMutableForPainting() + .SetPreviousSizeAndLayoutOverflowRect(iter->value.size, + iter->value.layout_overflow_rect); + fragment.SetPaintOffset(iter->value.paint_offset); } void ReattachHook::Trace(Visitor* visitor) const { - visitor->Trace(visual_rects_); + visitor->Trace(geometries_before_detach_); } } // namespace blink
diff --git a/third_party/blink/renderer/core/layout/layout_shift_tracker.h b/third_party/blink/renderer/core/layout/layout_shift_tracker.h index e855351..10d3cc0 100644 --- a/third_party/blink/renderer/core/layout/layout_shift_tracker.h +++ b/third_party/blink/renderer/core/layout/layout_shift_tracker.h
@@ -18,12 +18,13 @@ namespace blink { +class LayoutBox; class LayoutObject; +class LayoutText; class LocalFrameView; class PropertyTreeStateOrAlias; class TracedValue; class WebInputEvent; -struct PhysicalRect; // Tracks "layout shifts" from layout objects changing their visual location // between animation frames. See https://github.com/WICG/layout-instability. @@ -32,26 +33,38 @@ public: explicit LayoutShiftTracker(LocalFrameView*); ~LayoutShiftTracker() = default; - // |old_visual_rect| and |new_visual_rect| are in the local transform space: - // |property_tree_state.Transform()|. As we don't save the old property tree - // state, the caller should adjust |old_visual_rect| as if the difference - // between the old and new additional offsets to the layout shift root[1] - // caused the difference between the locations of |old_visual_rect| and - // |new_visual_rect|, in addition to that caused by the difference between - // the old and new paint offsets in the local transform space, so that we can - // calculate the total shift from the layout shift root by comparing locations - // of |old_visual_rect| and |new_visual_rect|. - // [1] See PaintPropertyTreeBuilderFragmentContext::ContainingBlockContext - // ::additional_offset_to_layout_shift_root_delta. - void NotifyObjectPrePaint(const LayoutObject& object, - const PropertyTreeStateOrAlias& property_tree_state, - const PhysicalRect& old_visual_rect, - const PhysicalRect& new_visual_rect); + + bool NeedsToTrack(const LayoutObject&) const; + + // |old_rect| and |new_rect| are layout overflow rects if the box has layout + // overflow and doesn't clip overflow, or border box rect, in the local + // transform space (property_tree_state.Transform()). |old_paint_offset| and + // |new_paint_offset| are the offsets of the border box rect in the local + // transform space, which are the same as |old_rect.offset| and + // |new_rect.offset| respectively if the rects are border box rects. + // As we don't save the old property tree state, the caller should adjust + // |old_rect| and |old_paint_offset| so that we can calculate the correct old + // visual representation and old starting point in the initial containing + // block and the viewport with the new property tree state in most cases. + void NotifyBoxPrePaint(const LayoutBox& box, + const PropertyTreeStateOrAlias& property_tree_state, + const PhysicalRect& old_rect, + const PhysicalRect& new_rect, + const PhysicalOffset& old_paint_offset, + const PhysicalOffset& new_paint_offset); + + void NotifyTextPrePaint(const LayoutText& text, + const PropertyTreeStateOrAlias& property_tree_state, + const LogicalOffset& old_starting_point, + const LogicalOffset& new_starting_point, + const PhysicalOffset& old_paint_offset, + const PhysicalOffset& new_paint_offset); + void NotifyPrePaintFinished(); void NotifyInput(const WebInputEvent&); void NotifyScroll(mojom::blink::ScrollType, ScrollOffset delta); void NotifyViewportSizeChanged(); - bool IsActive(); + bool IsActive() const { return is_active_; } double Score() const { return score_; } double WeightedScore() const { return weighted_score_; } float OverallMaxDistance() const { return overall_max_distance_; } @@ -83,14 +96,51 @@ private: Scope* scope_ = nullptr; - HeapHashMap<Member<const Node>, PhysicalRect> visual_rects_; + struct Geometry { + PhysicalRect layout_overflow_rect; + PhysicalOffset paint_offset; + LayoutSize size; + }; + HeapHashMap<Member<const Node>, Geometry> geometries_before_detach_; + }; + + class CORE_EXPORT ContainingBlockScope { + public: + // |old_size| and |new_size| are the border box sizes. + // |old_rect| and |new_rect| have the same definition as in + // NotifyBoxPrePaint(). + explicit ContainingBlockScope(const PhysicalSize& old_size, + const PhysicalSize& new_size, + const PhysicalRect& old_rect, + const PhysicalRect& new_rect) + : outer_(top_), + old_size_(old_size), + new_size_(new_size), + old_rect_(old_rect), + new_rect_(new_rect) { + top_ = this; + } + ~ContainingBlockScope() { top_ = outer_; } + + private: + friend class LayoutShiftTracker; + ContainingBlockScope* outer_; + static ContainingBlockScope* top_; + PhysicalSize old_size_; + PhysicalSize new_size_; + PhysicalRect old_rect_; + PhysicalRect new_rect_; + LayoutUnit max_text_shift_distance_; }; private: void ObjectShifted(const LayoutObject&, const PropertyTreeStateOrAlias&, - FloatRect old_rect, - FloatRect new_rect); + const PhysicalRect& old_rect, + const PhysicalRect& new_rect, + const FloatPoint& old_starting_point, + const FloatPoint& new_starting_point); + void ReportShift(double score_delta, double weighted_score_delta); void TimerFired(TimerBase*) {} std::unique_ptr<TracedValue> PerFrameTraceData(double score_delta, @@ -103,6 +153,7 @@ void SubmitPerformanceEntry(double score_delta, bool input_detected) const; Member<LocalFrameView> frame_view_; + bool is_active_; // The document cumulative layout shift (DCLS) score for this LocalFrame, // unweighted, with move distance applied.
diff --git a/third_party/blink/renderer/core/layout/layout_text.cc b/third_party/blink/renderer/core/layout/layout_text.cc index 6d286c25..ded42b7 100644 --- a/third_party/blink/renderer/core/layout/layout_text.cc +++ b/third_party/blink/renderer/core/layout/layout_text.cc
@@ -84,10 +84,11 @@ struct SameSizeAsLayoutText : public LayoutObject { uint32_t bitfields : 12; + DOMNodeId node_id; float widths[4]; String text; void* pointers[2]; - DOMNodeId node_id; + PhysicalOffset previous_starting_point; }; ASSERT_SIZE(LayoutText, SameSizeAsLayoutText); @@ -1690,6 +1691,25 @@ return PhysicalOffset(); } +LogicalOffset LayoutText::LogicalStartingPoint() const { + if (IsInLayoutNGInlineFormattingContext()) { + NGInlineCursor cursor; + cursor.MoveTo(*this); + if (!cursor) + return LogicalOffset(); + PhysicalOffset physical_offset = cursor.Current().OffsetInContainerBlock(); + if (StyleRef().GetWritingDirection().IsHorizontalLtr()) + return {physical_offset.left, physical_offset.top}; + return physical_offset.ConvertToLogical( + StyleRef().GetWritingDirection(), + PhysicalSizeToBeNoop(ContainingBlock()->Size()), + cursor.Current().Size()); + } + if (const auto* text_box = FirstTextBox()) + return {text_box->LogicalLeft(), text_box->LogicalTop()}; + return LogicalOffset(); +} + bool LayoutText::CanOptimizeSetText() const { // If we have only one line of text and "contain: layout size" we can avoid // doing a layout and only paint in the SetText() operation.
diff --git a/third_party/blink/renderer/core/layout/layout_text.h b/third_party/blink/renderer/core/layout/layout_text.h index 0ebfc63..989653f 100644 --- a/third_party/blink/renderer/core/layout/layout_text.h +++ b/third_party/blink/renderer/core/layout/layout_text.h
@@ -332,6 +332,24 @@ void DetachAbstractInlineTextBoxesIfNeeded(); + // Returns the logical location of the first line box. + LogicalOffset LogicalStartingPoint() const; + + // For LayoutShiftTracker. Saves the value of LogicalStartingPoint() value + // during the previous paint invalidation. + LogicalOffset PreviousLogicalStartingPoint() const { + return previous_logical_starting_point_; + } + // This is const because LayoutObjects are const for paint invalidation. + void SetPreviousLogicalStartingPoint(const LogicalOffset& point) const { + DCHECK_EQ(GetDocument().Lifecycle().GetState(), + DocumentLifecycle::kInPrePaint); + previous_logical_starting_point_ = point; + } + static LogicalOffset UninitializedLogicalStartingPoint() { + return {LayoutUnit::Max(), LayoutUnit::Max()}; + } + protected: void WillBeDestroyed() override; @@ -448,6 +466,9 @@ // Used for LayoutNG with accessibility. True if inline fragments are // associated to |NGAbstractInlineTextBox|. unsigned has_abstract_inline_text_box_ : 1; + + DOMNodeId node_id_ = kInvalidDOMNodeId; + float min_width_; float max_width_; float first_line_min_width_; @@ -455,6 +476,10 @@ String text_; + // This is mutable for paint invalidation. + mutable LogicalOffset previous_logical_starting_point_ = + UninitializedLogicalStartingPoint(); + union { // The line boxes associated with this object. // Read the LINE BOXES OWNERSHIP section in the class header comment. @@ -468,7 +493,6 @@ // Valid only when IsInLayoutNGInlineFormattingContext(). wtf_size_t first_fragment_item_index_; }; - DOMNodeId node_id_ = kInvalidDOMNodeId; }; inline InlineTextBoxList& LayoutText::MutableTextBoxes() {
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 cbd4c0b..4207af62 100644 --- a/third_party/blink/renderer/core/paint/box_paint_invalidator.cc +++ b/third_party/blink/renderer/core/paint/box_paint_invalidator.cc
@@ -400,8 +400,9 @@ box_.ContentSize() != box_.Size()) return true; if ((BackgroundGeometryDependsOnLayoutOverflowRect() || - BackgroundPaintsOntoScrollingContentsLayer()) && - box_.LayoutOverflowRect() != box_.BorderBoxRect()) + BackgroundPaintsOntoScrollingContentsLayer() || + !box_.HasOverflowClip()) && + box_.HasLayoutOverflow()) return true; return false;
diff --git a/third_party/blink/renderer/core/paint/fragment_data.h b/third_party/blink/renderer/core/paint/fragment_data.h index f4a3ab0..a4fa933 100644 --- a/third_party/blink/renderer/core/paint/fragment_data.h +++ b/third_party/blink/renderer/core/paint/fragment_data.h
@@ -35,14 +35,6 @@ paint_offset_ = paint_offset; } - // Visual rect in the space of the the local transform space. - const PhysicalRect& VisualRectForLayoutShiftTracking() const { - return visual_rect_for_layout_shift_tracking_; - } - void SetVisualRectForLayoutShiftTracking(const PhysicalRect& rect) { - visual_rect_for_layout_shift_tracking_ = rect; - } - // An id for this object that is unique for the lifetime of the WebView. UniqueObjectId UniqueId() const { DCHECK(rare_data_); @@ -250,8 +242,6 @@ RareData& EnsureRareData(); PhysicalOffset paint_offset_; - PhysicalRect visual_rect_for_layout_shift_tracking_; - std::unique_ptr<RareData> rare_data_; };
diff --git a/third_party/blink/renderer/core/paint/ng/ng_box_fragment_painter.cc b/third_party/blink/renderer/core/paint/ng/ng_box_fragment_painter.cc index 19a550f..388338d 100644 --- a/third_party/blink/renderer/core/paint/ng/ng_box_fragment_painter.cc +++ b/third_party/blink/renderer/core/paint/ng/ng_box_fragment_painter.cc
@@ -755,19 +755,28 @@ void NGBoxFragmentPainter::PaintFloatingItems(const PaintInfo& paint_info, NGInlineCursor* cursor) { - for (; *cursor; cursor->MoveToNext()) { + while (*cursor) { const NGFragmentItem* item = cursor->Current().Item(); DCHECK(item); const NGPhysicalBoxFragment* child_fragment = item->BoxFragment(); - if (!child_fragment || child_fragment->HasSelfPaintingLayer() || - !child_fragment->IsFloating()) - continue; - if (child_fragment->CanTraverse()) { - NGBoxFragmentPainter(*child_fragment).Paint(paint_info); + if (!child_fragment) { + cursor->MoveToNext(); continue; } - ObjectPainter(*child_fragment->GetLayoutObject()) - .PaintAllPhasesAtomically(paint_info); + if (child_fragment->HasSelfPaintingLayer()) { + cursor->MoveToNextSkippingChildren(); + continue; + } + if (child_fragment->IsFloating()) { + if (child_fragment->CanTraverse()) { + NGBoxFragmentPainter(*child_fragment).Paint(paint_info); + } else { + ObjectPainter(*child_fragment->GetLayoutObject()) + .PaintAllPhasesAtomically(paint_info); + } + } + DCHECK(child_fragment->IsInlineBox() || !cursor->Current().HasChildren()); + cursor->MoveToNext(); } } @@ -1462,6 +1471,8 @@ for (; *children; children->MoveToNextSkippingChildren()) { const NGFragmentItem* child_item = children->CurrentItem(); DCHECK(child_item); + if (child_item->IsFloating()) + continue; // Check if CullRect intersects with this child, only in block direction // because soft-wrap and <br> needs to paint outside of InkOverflow() in @@ -1496,6 +1507,7 @@ if (const NGPhysicalBoxFragment* child_fragment = child_item->BoxFragment()) { + DCHECK(!child_fragment->IsOutOfFlowPositioned()); if (child_fragment->IsListMarker()) { PaintBoxItem(*child_item, *child_fragment, *children, paint_info, paint_offset);
diff --git a/third_party/blink/renderer/core/paint/paint_invalidator.cc b/third_party/blink/renderer/core/paint/paint_invalidator.cc index e92d928..02f7af7 100644 --- a/third_party/blink/renderer/core/paint/paint_invalidator.cc +++ b/third_party/blink/renderer/core/paint/paint_invalidator.cc
@@ -141,45 +141,129 @@ DCHECK(context.painting_layer == object.PaintingLayer()); } -void PaintInvalidator::UpdateForPaintOffsetChange( - const LayoutObject& object, - FragmentData& fragment_data, +void PaintInvalidator::UpdateFromTreeBuilderContext( + const PaintPropertyTreeBuilderFragmentContext& tree_builder_context, PaintInvalidatorContext& context) { - const auto* tree_context = context.tree_builder_context_; - DCHECK(tree_context); - DCHECK_EQ(tree_context->current.paint_offset, fragment_data.PaintOffset()); - - // LayoutShiftTracker doesn't track SVG children. Also the visual rect - // calculation below works for non-SVG-child objects only. - if (!object.IsSVGChild()) { - PhysicalRect new_visual_rect = object.LocalVisualRect(); - new_visual_rect.Move(fragment_data.PaintOffset()); - // If the layout shift root has changed, LayoutShiftTracker can't use the - // current paint property tree to map the old visual rect. - if (!tree_context->current.layout_shift_root_changed) { - // Adjust old_visual_rect so that LayoutShiftTracker can see the change of - // offset caused by change of transforms below the 2d translation root. - PhysicalRect old_visual_rect = - fragment_data.VisualRectForLayoutShiftTracking(); - old_visual_rect.Move( - -tree_context->current.additional_offset_to_layout_shift_root_delta); - object.GetFrameView()->GetLayoutShiftTracker().NotifyObjectPrePaint( - object, - PropertyTreeStateOrAlias(*tree_context->current.transform, - *tree_context->current.clip, - *tree_context->current_effect), - old_visual_rect, new_visual_rect); - } - fragment_data.SetVisualRectForLayoutShiftTracking(new_visual_rect); - } + DCHECK_EQ(tree_builder_context.current.paint_offset, + context.fragment_data->PaintOffset()); // For performance, we ignore subpixel movement of composited layers for paint // invalidation. This will result in imperfect pixel-snapped painting. // See crbug.com/833083 for details. - if (tree_context->current + if (tree_builder_context.current .directly_composited_container_paint_offset_subpixel_delta == - fragment_data.PaintOffset() - context.old_paint_offset) - context.old_paint_offset = fragment_data.PaintOffset(); + tree_builder_context.current.paint_offset - + tree_builder_context.old_paint_offset) { + context.old_paint_offset = tree_builder_context.current.paint_offset; + } else { + context.old_paint_offset = tree_builder_context.old_paint_offset; + } + + context.transform_ = tree_builder_context.current.transform; +} + +void PaintInvalidator::UpdateLayoutShiftTracking( + const LayoutObject& object, + const PaintPropertyTreeBuilderFragmentContext& tree_builder_context, + PaintInvalidatorContext& context) { + if (!object.ShouldCheckGeometryForPaintInvalidation()) + return; + + auto& layout_shift_tracker = object.GetFrameView()->GetLayoutShiftTracker(); + if (!layout_shift_tracker.NeedsToTrack(object)) + return; + + PropertyTreeStateOrAlias property_tree_state( + *tree_builder_context.current.transform, + *tree_builder_context.current.clip, *tree_builder_context.current_effect); + + if (object.IsText()) { + const auto& text = ToLayoutText(object); + LogicalOffset new_starting_point = text.LogicalStartingPoint(); + LogicalOffset old_starting_point = text.PreviousLogicalStartingPoint(); + if (new_starting_point == old_starting_point) + return; + text.SetPreviousLogicalStartingPoint(new_starting_point); + if (old_starting_point == LayoutText::UninitializedLogicalStartingPoint()) + return; + // If the layout shift root has changed, LayoutShiftTracker can't use the + // current paint property tree to map the old rect. + if (tree_builder_context.current.layout_shift_root_changed) + return; + + layout_shift_tracker.NotifyTextPrePaint( + text, property_tree_state, old_starting_point, new_starting_point, + // Similar to the adjustment of old_paint_offset for LayoutBox. + context.old_paint_offset - + tree_builder_context.current + .additional_offset_to_layout_shift_root_delta, + tree_builder_context.current.paint_offset); + return; + } + + DCHECK(object.IsBox()); + const auto& box = ToLayoutBox(object); + + PhysicalRect new_rect = box.HasOverflowClip() + ? box.PhysicalBorderBoxRect() + : box.PhysicalLayoutOverflowRect(); + // If we didn't save the previous physical layout overflow rect, (e.g. if + // there was no layout overflow or we clipped overflow and there was no other + // reason for saving the value) this is the previous PhysicalBorderBoxRect(), + // so it is mostly the correct previous rect for layout shift tracking. + PhysicalRect old_rect = box.PreviousPhysicalLayoutOverflowRect(); + + bool should_report_layout_shift = [&]() -> bool { + // If the layout shift root has changed, LayoutShiftTracker can't use the + // current paint property tree to map the old rect. + if (tree_builder_context.current.layout_shift_root_changed) + return false; + if (new_rect.IsEmpty() || old_rect.IsEmpty()) + return false; + // The parent of out-of-flow-positioned object may not be its container. + if (object.IsOutOfFlowPositioned()) + return true; + // We don't report shift for anonymous objects but report for the children. + if (object.Parent()->IsAnonymous()) + return true; + // Report if the parent is in a different transform space. + const auto* parent_context = context.ParentContext(); + if (!parent_context || !parent_context->transform_ || + parent_context->transform_ != tree_builder_context.current.transform) + return true; + // Report if this object has local movement (i.e. delta of paint offset is + // different from that of the parent). + return parent_context->fragment_data->PaintOffset() - + parent_context->old_paint_offset != + tree_builder_context.current.paint_offset - context.old_paint_offset; + }(); + + if (!should_report_layout_shift && !box.ChildrenInline()) + return; + + new_rect.Move(tree_builder_context.current.paint_offset); + old_rect.Move(context.old_paint_offset); + // Adjust old_visual_rect so that LayoutShiftTracker can see the change of + // offset caused by change of transforms below the 2d translation root. + old_rect.Move(-tree_builder_context.current + .additional_offset_to_layout_shift_root_delta); + + if (box.ChildrenInline()) { + // For layout shift tracking of contained LayoutTexts. + context.containing_block_scope_.emplace( + PhysicalSizeToBeNoop(box.PreviousSize()), + PhysicalSizeToBeNoop(box.Size()), old_rect, new_rect); + if (!should_report_layout_shift) + return; + } + + // Adjust old_paint_offset similarly. + PhysicalOffset old_paint_offset = + context.old_paint_offset - + tree_builder_context.current.additional_offset_to_layout_shift_root_delta; + layout_shift_tracker.NotifyBoxPrePaint( + box, property_tree_state, old_rect, new_rect, old_paint_offset, + tree_builder_context.current.paint_offset); } bool PaintInvalidator::InvalidatePaint( @@ -222,12 +306,11 @@ if (tree_builder_context) { DCHECK_EQ(tree_builder_context->fragments.size(), 1u); - context.tree_builder_context_ = &tree_builder_context->fragments[0]; - context.old_paint_offset = - context.tree_builder_context_->old_paint_offset; - UpdateForPaintOffsetChange(object, fragment_data, context); + const auto& fragment_tree_builder_context = + tree_builder_context->fragments[0]; + UpdateFromTreeBuilderContext(fragment_tree_builder_context, context); + UpdateLayoutShiftTracking(object, fragment_tree_builder_context, context); } else { - context.tree_builder_context_ = nullptr; context.old_paint_offset = fragment_data.PaintOffset(); } @@ -244,13 +327,12 @@ tree_builder_index < tree_builder_context->fragments.size()); if (tree_builder_context) { - context.tree_builder_context_ = - &tree_builder_context->fragments[tree_builder_index]; - context.old_paint_offset = - context.tree_builder_context_->old_paint_offset; - UpdateForPaintOffsetChange(object, *fragment_data, context); + const auto& fragment_tree_builder_context = + tree_builder_context->fragments[tree_builder_index]; + UpdateFromTreeBuilderContext(fragment_tree_builder_context, context); + UpdateLayoutShiftTracking(object, fragment_tree_builder_context, + context); } else { - context.tree_builder_context_ = nullptr; context.old_paint_offset = fragment_data->PaintOffset(); }
diff --git a/third_party/blink/renderer/core/paint/paint_invalidator.h b/third_party/blink/renderer/core/paint/paint_invalidator.h index 3417989c..9b49aced 100644 --- a/third_party/blink/renderer/core/paint/paint_invalidator.h +++ b/third_party/blink/renderer/core/paint/paint_invalidator.h
@@ -6,6 +6,7 @@ #define THIRD_PARTY_BLINK_RENDERER_CORE_PAINT_PAINT_INVALIDATOR_H_ #include "third_party/blink/renderer/core/layout/layout_object.h" +#include "third_party/blink/renderer/core/layout/layout_shift_tracker.h" #include "third_party/blink/renderer/core/paint/paint_property_tree_builder.h" #include "third_party/blink/renderer/platform/geometry/layout_rect.h" #include "third_party/blink/renderer/platform/graphics/paint_invalidation_reason.h" @@ -103,8 +104,9 @@ private: friend class PaintInvalidator; - const PaintPropertyTreeBuilderFragmentContext* tree_builder_context_ = - nullptr; + base::Optional<LayoutShiftTracker::ContainingBlockScope> + containing_block_scope_; + const TransformPaintPropertyNodeOrAlias* transform_ = nullptr; }; class PaintInvalidator { @@ -134,9 +136,13 @@ ALWAYS_INLINE void UpdateDirectlyCompositedContainer(const LayoutObject&, PaintInvalidatorContext&, bool is_ng_painting); - ALWAYS_INLINE void UpdateForPaintOffsetChange(const LayoutObject&, - FragmentData&, - PaintInvalidatorContext&); + ALWAYS_INLINE void UpdateFromTreeBuilderContext( + const PaintPropertyTreeBuilderFragmentContext&, + PaintInvalidatorContext&); + ALWAYS_INLINE void UpdateLayoutShiftTracking( + const LayoutObject&, + const PaintPropertyTreeBuilderFragmentContext&, + PaintInvalidatorContext&); Vector<const LayoutObject*> pending_delayed_paint_invalidations_; };
diff --git a/third_party/blink/renderer/core/paint/paint_layer_painter.cc b/third_party/blink/renderer/core/paint/paint_layer_painter.cc index 26e6244..ee715e7 100644 --- a/third_party/blink/renderer/core/paint/paint_layer_painter.cc +++ b/third_party/blink/renderer/core/paint/paint_layer_painter.cc
@@ -120,6 +120,12 @@ if (!paint_layer.SupportsSubsequenceCaching()) return false; + // Don't create subsequence during special painting to avoid cache conflict + // with normal painting. + if (painting_info.GetGlobalPaintFlags() & + kGlobalPaintFlattenCompositingLayers) + return false; + // Don't create subsequence for a composited layer because if it can be // cached, we can skip the whole painting in GraphicsLayer::paint() with // CachedDisplayItemList. This also avoids conflict of @@ -129,12 +135,6 @@ paint_layer.GetCompositingState() == kPaintsIntoOwnBacking) return false; - // Don't create subsequence during special painting to avoid cache conflict - // with normal painting. - if (painting_info.GetGlobalPaintFlags() & - kGlobalPaintFlattenCompositingLayers) - return false; - return true; } @@ -378,6 +378,8 @@ PhysicalOffset subpixel_accumulation = (!RuntimeEnabledFeatures::CompositeAfterPaintEnabled() && + !(painting_info.GetGlobalPaintFlags() & + kGlobalPaintFlattenCompositingLayers) && paint_layer_.GetCompositingState() == kPaintsIntoOwnBacking) ? paint_layer_.SubpixelAccumulation() : painting_info.sub_pixel_accumulation;
diff --git a/third_party/blink/renderer/core/paint/svg_object_painter.cc b/third_party/blink/renderer/core/paint/svg_object_painter.cc index d3fe7d5..2d3a14aa 100644 --- a/third_party/blink/renderer/core/paint/svg_object_painter.cc +++ b/third_party/blink/renderer/core/paint/svg_object_painter.cc
@@ -15,7 +15,8 @@ DCHECK(!layout_object_.NeedsLayout()); PaintInfo info(context, LayoutRect::InfiniteIntRect(), - PaintPhase::kForeground, kGlobalPaintNormalPhase, + PaintPhase::kForeground, + kGlobalPaintNormalPhase | kGlobalPaintFlattenCompositingLayers, kPaintLayerPaintingRenderingResourceSubtree, &layout_object_.PaintingLayer()->GetLayoutObject()); layout_object_.Paint(info);
diff --git a/third_party/blink/renderer/core/svg/properties/svg_animated_property.h b/third_party/blink/renderer/core/svg/properties/svg_animated_property.h index 857e00b..56847e9 100644 --- a/third_party/blink/renderer/core/svg/properties/svg_animated_property.h +++ b/third_party/blink/renderer/core/svg/properties/svg_animated_property.h
@@ -100,12 +100,9 @@ private: static_assert(kNumberOfAnimatedPropertyTypes <= (1u << 5), "enough bits for AnimatedPropertyType (type_)"); - static constexpr int kCssPropertyBits = 10; - static_assert((1u << kCssPropertyBits) - 1 >= kIntLastCSSProperty, - "enough bits for CSS property ids"); const unsigned type_ : 5; - const unsigned css_property_id_ : kCssPropertyBits; + const unsigned css_property_id_ : kCSSPropertyIDBitLength; const unsigned initial_value_storage_ : kInitialValueStorageBits; unsigned base_value_needs_synchronization_ : 1;
diff --git a/third_party/blink/renderer/modules/mediastream/webmediaplayer_ms.cc b/third_party/blink/renderer/modules/mediastream/webmediaplayer_ms.cc index 2a516fab0..96b32f75 100644 --- a/third_party/blink/renderer/modules/mediastream/webmediaplayer_ms.cc +++ b/third_party/blink/renderer/modules/mediastream/webmediaplayer_ms.cc
@@ -182,7 +182,8 @@ #endif // defined(OS_ANDROID) if (!gpu_memory_buffer_pool_) { - EnqueueFrame(frame, frame); + int original_frame_id = frame->unique_id(); + EnqueueFrame(original_frame_id, std::move(frame)); return; } @@ -201,7 +202,8 @@ // frames is unnecessary, because the frames are not going to be shown for // the time period. if (render_frame_suspended_ || skip_creating_gpu_memory_buffer) { - EnqueueFrame(frame, frame); + int original_frame_id = frame->unique_id(); + EnqueueFrame(original_frame_id, std::move(frame)); // If there are any existing MaybeCreateHardwareFrame() calls, we do not // want those frames to be placed after the current one, so just drop // them. @@ -209,6 +211,8 @@ return; } + int original_frame_id = frame->unique_id(); + // |gpu_memory_buffer_pool_| deletion is going to be posted to // |media_task_runner_|. base::Unretained() usage is fine since // |gpu_memory_buffer_pool_| outlives the task. @@ -219,10 +223,10 @@ FROM_HERE, base::BindOnce( &media::GpuMemoryBufferVideoFramePool::MaybeCreateHardwareFrame, - base::Unretained(gpu_memory_buffer_pool_.get()), frame, - media::BindToCurrentLoop( - base::BindOnce(&FrameDeliverer::EnqueueFrame, - weak_factory_for_pool_.GetWeakPtr(), frame)))); + base::Unretained(gpu_memory_buffer_pool_.get()), std::move(frame), + media::BindToCurrentLoop(base::BindOnce( + &FrameDeliverer::EnqueueFrame, + weak_factory_for_pool_.GetWeakPtr(), original_frame_id)))); } void SetRenderFrameSuspended(bool render_frame_suspended) { @@ -240,7 +244,7 @@ private: friend class WebMediaPlayerMS; - void EnqueueFrame(scoped_refptr<media::VideoFrame> original_frame, + void EnqueueFrame(int original_frame_id, scoped_refptr<media::VideoFrame> frame) { DCHECK_CALLED_ON_VALID_THREAD(io_thread_checker_); @@ -257,7 +261,7 @@ } } - bool is_copy = original_frame != frame; + bool is_copy = original_frame_id != frame->unique_id(); enqueue_frame_cb_.Run(std::move(frame), is_copy); }
diff --git a/third_party/blink/renderer/modules/webaudio/offline_audio_destination_node.cc b/third_party/blink/renderer/modules/webaudio/offline_audio_destination_node.cc index 73494d0..a6c542f 100644 --- a/third_party/blink/renderer/modules/webaudio/offline_audio_destination_node.cc +++ b/third_party/blink/renderer/modules/webaudio/offline_audio_destination_node.cc
@@ -90,6 +90,12 @@ if (!IsInitialized()) return; + // See https://crbug.com/1110035 and https://crbug.com/1080821. Resetting the + // thread unique pointer multiple times or not-resetting at all causes a + // mysterious CHECK failure or a crash. + if (render_thread_) + render_thread_.reset(); + AudioHandler::Uninitialize(); }
diff --git a/third_party/blink/renderer/platform/bindings/trace_wrapper_v8_reference.h b/third_party/blink/renderer/platform/bindings/trace_wrapper_v8_reference.h index a635b0adb..ad4a382 100644 --- a/third_party/blink/renderer/platform/bindings/trace_wrapper_v8_reference.h +++ b/third_party/blink/renderer/platform/bindings/trace_wrapper_v8_reference.h
@@ -40,6 +40,7 @@ } bool IsEmpty() const { return handle_.IsEmpty(); } + bool IsEmptySafe() const { return handle_.IsEmptyThreadSafe(); } void Clear() { handle_.Reset(); } ALWAYS_INLINE const v8::TracedReference<T>& Get() const { return handle_; } ALWAYS_INLINE v8::TracedReference<T>& Get() { return handle_; } @@ -137,6 +138,14 @@ static const bool kCanClearUnusedSlotsWithMemset = true; static const bool kCanCopyWithMemcpy = false; static const bool kCanMoveWithMemcpy = false; + static constexpr bool kCanTraceConcurrently = true; +}; + +template <typename T> +struct HashTraits<blink::TraceWrapperV8Reference<T>> + : GenericHashTraits<blink::TraceWrapperV8Reference<T>> { + STATIC_ONLY(HashTraits); + static constexpr bool kCanTraceConcurrently = true; }; } // namespace WTF
diff --git a/third_party/blink/renderer/platform/heap/unified_heap_marking_visitor.cc b/third_party/blink/renderer/platform/heap/unified_heap_marking_visitor.cc index 62f9340..00a9bc2 100644 --- a/third_party/blink/renderer/platform/heap/unified_heap_marking_visitor.cc +++ b/third_party/blink/renderer/platform/heap/unified_heap_marking_visitor.cc
@@ -29,6 +29,8 @@ void UnifiedHeapMarkingVisitorBase::VisitImpl( const TraceWrapperV8Reference<v8::Value>& v8_reference) { DCHECK(isolate_); + if (v8_reference.IsEmptySafe()) + return; if (task_id_ != WorklistTaskId::MutatorThread) { // This is a temporary solution. Pushing directly from concurrent threads // to V8 marking worklist will currently result in data races. This @@ -38,8 +40,6 @@ v8_references_worklist_.Push(&v8_reference); return; } - if (v8_reference.Get().IsEmpty()) - return; controller_->RegisterEmbedderReference( v8_reference.template Cast<v8::Data>().Get()); }
diff --git a/third_party/blink/renderer/platform/runtime_enabled_features.json5 b/third_party/blink/renderer/platform/runtime_enabled_features.json5 index 7a53670..24b7e78 100644 --- a/third_party/blink/renderer/platform/runtime_enabled_features.json5 +++ b/third_party/blink/renderer/platform/runtime_enabled_features.json5
@@ -787,10 +787,6 @@ status: "stable", }, { - name: "FlexGaps", - status: "stable", - }, - { name: "FocuslessSpatialNavigation", settable_from_internals: true, },
diff --git a/third_party/blink/tools/blinkpy/common/config/builders.json b/third_party/blink/tools/blinkpy/common/config/builders.json index 5577528..f5756465 100644 --- a/third_party/blink/tools/blinkpy/common/config/builders.json +++ b/third_party/blink/tools/blinkpy/common/config/builders.json
@@ -101,12 +101,6 @@ "specifiers": ["Mac10.13", "Release"], "is_try_builder": true }, - "mac10.13_retina-blink-rel": { - "master": "tryserver.blink", - "port_name": "mac-retina", - "specifiers": ["Retina", "Release"], - "is_try_builder": true - }, "mac10.14-blink-rel": { "master": "tryserver.blink", "port_name": "mac-mac10.14",
diff --git a/third_party/blink/web_tests/TestExpectations b/third_party/blink/web_tests/TestExpectations index 58ec5aa..39b19ae 100644 --- a/third_party/blink/web_tests/TestExpectations +++ b/third_party/blink/web_tests/TestExpectations
@@ -742,8 +742,6 @@ crbug.com/1081802 external/wpt/css/css-flexbox/overflow-area-002.html [ Failure ] crbug.com/807497 external/wpt/css/css-flexbox/anonymous-flex-item-005.html [ Failure ] crbug.com/1111708 external/wpt/css/css-flexbox/flexbox_justifycontent-center-overflow.html [ Failure ] -crbug.com/1111710 external/wpt/css/css-flexbox/getcomputedstyle/flexbox_computedstyle_flex-basis-0percent.html [ Failure ] -crbug.com/1111710 external/wpt/css/css-flexbox/getcomputedstyle/flexbox_computedstyle_flex-shorthand-number.html [ Failure ] # These testcases are incorrect, mark them as failing until they're fixed in the testsuite. # https://lists.w3.org/Archives/Public/www-style/2016Jan/0275.html @@ -2104,6 +2102,10 @@ crbug.com/796619 [ Win10 ] external/wpt/css/css-fonts/matching/stretch-distance-over-weight-distance.html [ Failure ] crbug.com/796619 [ Win10 ] external/wpt/css/css-fonts/matching/style-ranges-over-weight-direction.html [ Failure ] +# CSS Font Feature Resolution is not implemented yet +crbug.com/450619 external/wpt/css/css-fonts/font-feature-resolution-001.html [ Failure ] +crbug.com/450619 external/wpt/css/css-fonts/font-feature-resolution-002.html [ Failure ] + # These need a rebaseline due crbug.com/504745 on Windows when they are activated again. crbug.com/521124 crbug.com/410145 [ Win7 ] fast/css/font-weight-1.html [ Pass Failure ] @@ -3440,8 +3442,6 @@ crbug.com/626703 external/wpt/css/vendor-imports/mozilla/mozilla-central-reftests/counter-styles-3/descriptor-symbols.html [ Failure ] crbug.com/626703 external/wpt/css/vendor-imports/mozilla/mozilla-central-reftests/counter-styles-3/system-extends-invalid.html [ Failure ] crbug.com/626703 external/wpt/css/vendor-imports/mozilla/mozilla-central-reftests/counter-styles-3/redefine-builtin.html [ Failure ] -crbug.com/626703 external/wpt/css/css-fonts/font-feature-resolution-001.html [ Failure ] -crbug.com/626703 external/wpt/css/css-fonts/font-feature-resolution-002.html [ Failure ] crbug.com/626703 external/wpt/css/css-fonts/font-variant-05.xht [ Failure ] crbug.com/626703 external/wpt/css/css-fonts/font-variant-06.xht [ Failure ] crbug.com/626703 external/wpt/css/mediaqueries/viewport-script-dynamic.html [ Failure ] @@ -3477,8 +3477,6 @@ crbug.com/626703 external/wpt/html/rendering/non-replaced-elements/the-page/body-margin-2j.html [ Failure ] crbug.com/626703 external/wpt/html/rendering/non-replaced-elements/the-page/body-margin-2k.html [ Failure ] crbug.com/626703 external/wpt/html/rendering/non-replaced-elements/the-page/body-margin-2l.html [ Failure ] -crbug.com/626703 external/wpt/webaudio/the-audio-api/the-analysernode-interface/test-analyser-minimum.html [ Timeout ] -crbug.com/626703 external/wpt/webaudio/the-audio-api/the-analysernode-interface/test-analyser-output.html [ Timeout ] crbug.com/626703 external/wpt/css/css-fonts/font-synthesis-01.html [ Failure ] crbug.com/626703 external/wpt/css/css-fonts/font-synthesis-02.html [ Failure ] crbug.com/626703 external/wpt/css/css-fonts/font-synthesis-03.html [ Failure ]
diff --git a/third_party/blink/web_tests/animations/animationworklet/animator-registration.html b/third_party/blink/web_tests/animations/animationworklet/animator-registration.html index bfafd033..d766cd6 100644 --- a/third_party/blink/web_tests/animations/animationworklet/animator-registration.html +++ b/third_party/blink/web_tests/animations/animationworklet/animator-registration.html
@@ -19,7 +19,7 @@ </script> <script id="no_class" type="text/worklet"> -const expectedError = "TypeError: Failed to execute 'registerAnimator' on 'AnimationWorkletGlobalScope': parameter 2 is not of type 'Function'." +const expectedError = "The callback provided as parameter 2 is not a function"; let receivedError = undefined; try { registerAnimator("no_class", "");
diff --git a/third_party/blink/web_tests/bindings/idl-dictionary-unittest-expected.txt b/third_party/blink/web_tests/bindings/idl-dictionary-unittest-expected.txt index 72b47a1..15ce8035 100644 --- a/third_party/blink/web_tests/bindings/idl-dictionary-unittest-expected.txt +++ b/third_party/blink/web_tests/bindings/idl-dictionary-unittest-expected.txt
@@ -152,8 +152,8 @@ Test for passing invalid dictionary values -PASS dictionaryTest.set(42) threw exception TypeError: Failed to execute 'set' on 'DictionaryTest': cannot convert to dictionary.. -PASS dictionaryTest.set('string') threw exception TypeError: Failed to execute 'set' on 'DictionaryTest': cannot convert to dictionary.. +PASS dictionaryTest.set(42) threw exception TypeError: Failed to execute 'set' on 'DictionaryTest': parameter 1 ('testingDictionary') is not an object.. +PASS dictionaryTest.set('string') threw exception TypeError: Failed to execute 'set' on 'DictionaryTest': parameter 1 ('testingDictionary') is not an object.. Test for [Clamp] and [EnforceRange] member
diff --git a/third_party/blink/web_tests/external/wpt/WebIDL/ecmascript-binding/constructors-expected.txt b/third_party/blink/web_tests/external/wpt/WebIDL/ecmascript-binding/constructors-expected.txt index bf840da..ebb7dde 100644 --- a/third_party/blink/web_tests/external/wpt/WebIDL/ecmascript-binding/constructors-expected.txt +++ b/third_party/blink/web_tests/external/wpt/WebIDL/ecmascript-binding/constructors-expected.txt
@@ -2,12 +2,12 @@ PASS Realm for constructed objects PASS Normal constructor in parent window PASS Normal constructor in child window -PASS Constructor in child window with normal NewTarget from parent window -PASS Constructor in parent window with normal NewTarget from child window +FAIL Constructor in child window with normal NewTarget from parent window assert_equals: expected "child window" but got "parent window" +FAIL Constructor in parent window with normal NewTarget from child window assert_equals: expected "parent window" but got "child window" PASS Subclass constructor in parent window PASS Subclass constructor in child window -PASS Subclass constructor in parent window with parent class in child window -PASS Subclass constructor in child window with parent class in parent window +FAIL Subclass constructor in parent window with parent class in child window assert_equals: expected "child window" but got "parent window" +FAIL Subclass constructor in child window with parent class in parent window assert_equals: expected "parent window" but got "child window" FAIL Constructor in child window with bad NewTarget from parent window assert_equals: expected object "[object DOMParser]" but got object "[object Object]" FAIL Constructor in parent window with bad NewTarget from child window assert_equals: expected object "[object DOMParser]" but got object "[object Object]" FAIL Constructor in parent window with bad NewTarget from parent window that's a bound child window function assert_equals: expected object "[object DOMParser]" but got object "[object Object]"
diff --git a/third_party/blink/web_tests/external/wpt/css/CSS2/floats/float-in-self-painting-inline.html b/third_party/blink/web_tests/external/wpt/css/CSS2/floats/float-in-self-painting-inline.html new file mode 100644 index 0000000..6ff47d3 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/css/CSS2/floats/float-in-self-painting-inline.html
@@ -0,0 +1,13 @@ +<!DOCTYPE html> +<title>Floats in self-painting inline box should not crash</title> +<link rel="help" href="https://crbug.com/1109565"> +<link rel="author" href="kojii@chromium.org"> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<span style='opacity: 0.5'> + <div style="float: right">X</div> +</span> +<img title="ABC"> +<script> +test(() => {}, "Pass if not crashes"); +</script>
diff --git a/third_party/blink/web_tests/external/wpt/css/css-animations/event-dispatch.tentative-expected.txt b/third_party/blink/web_tests/external/wpt/css/css-animations/event-dispatch.tentative-expected.txt index 0feefd2..a4512f6 100644 --- a/third_party/blink/web_tests/external/wpt/css/css-animations/event-dispatch.tentative-expected.txt +++ b/third_party/blink/web_tests/external/wpt/css/css-animations/event-dispatch.tentative-expected.txt
@@ -4,7 +4,7 @@ PASS Before -> Active PASS Before -> After PASS Active -> Idle, display: none -FAIL Active -> Idle, setting Animation.timeline = null promise_test: Unhandled rejection with value: object "TypeError: Cannot set property timeline of #<Animation> which has only a getter" +FAIL Active -> Idle, setting Animation.timeline = null promise_test: Unhandled rejection with value: object "TypeError: Cannot assign to read only property 'timeline' of object '#<CSSAnimation>'" PASS Active -> Idle, calling Animation.cancel() PASS Active -> Before PASS Active -> After @@ -23,7 +23,7 @@ PASS Call Animation.cancel after canceling animation. PASS Restart animation after canceling animation immediately. PASS Call Animation.cancel after restarting animation immediately. -FAIL Set timeline and play transition after clearing the timeline. promise_test: Unhandled rejection with value: object "TypeError: Cannot set property timeline of #<Animation> which has only a getter" +FAIL Set timeline and play transition after clearing the timeline. promise_test: Unhandled rejection with value: object "TypeError: Cannot assign to read only property 'timeline' of object '#<CSSAnimation>'" PASS Set null target effect after canceling the animation. PASS Cancel the animation after clearing the target effect. Harness: the test ran to completion.
diff --git a/third_party/blink/web_tests/external/wpt/css/css-flexbox/getcomputedstyle/flexbox_computedstyle_flex-basis-0percent.html b/third_party/blink/web_tests/external/wpt/css/css-flexbox/getcomputedstyle/flexbox_computedstyle_flex-basis-0percent.html index abdd030d..6abbc50 100644 --- a/third_party/blink/web_tests/external/wpt/css/css-flexbox/getcomputedstyle/flexbox_computedstyle_flex-basis-0percent.html +++ b/third_party/blink/web_tests/external/wpt/css/css-flexbox/getcomputedstyle/flexbox_computedstyle_flex-basis-0percent.html
@@ -17,6 +17,6 @@ var body = document.body; assert_equals(getComputedStyle(body).getPropertyValue("flex-basis"), - "0px"); + "0%"); }); </script>
diff --git a/third_party/blink/web_tests/external/wpt/css/css-flexbox/getcomputedstyle/flexbox_computedstyle_flex-shorthand-number.html b/third_party/blink/web_tests/external/wpt/css/css-flexbox/getcomputedstyle/flexbox_computedstyle_flex-shorthand-number.html index 413a94f0..a356222 100644 --- a/third_party/blink/web_tests/external/wpt/css/css-flexbox/getcomputedstyle/flexbox_computedstyle_flex-shorthand-number.html +++ b/third_party/blink/web_tests/external/wpt/css/css-flexbox/getcomputedstyle/flexbox_computedstyle_flex-shorthand-number.html
@@ -21,6 +21,6 @@ assert_equals(getComputedStyle(body).getPropertyValue("flex-shrink"), "1"); assert_equals(getComputedStyle(body).getPropertyValue("flex-basis"), - "0px"); + "0%"); }); </script>
diff --git a/third_party/blink/web_tests/external/wpt/css/css-transitions/event-dispatch.tentative-expected.txt b/third_party/blink/web_tests/external/wpt/css/css-transitions/event-dispatch.tentative-expected.txt index cbabf0d1..180a68fa 100644 --- a/third_party/blink/web_tests/external/wpt/css/css-transitions/event-dispatch.tentative-expected.txt +++ b/third_party/blink/web_tests/external/wpt/css/css-transitions/event-dispatch.tentative-expected.txt
@@ -4,15 +4,15 @@ PASS Idle or Pending -> Active PASS Idle or Pending -> After PASS Before -> Idle (display: none) -FAIL Before -> Idle (Animation.timeline = null) promise_test: Unhandled rejection with value: object "TypeError: Cannot set property timeline of #<Animation> which has only a getter" +FAIL Before -> Idle (Animation.timeline = null) promise_test: Unhandled rejection with value: object "TypeError: Cannot assign to read only property 'timeline' of object '#<CSSTransition>'" PASS Before -> Active PASS Before -> After PASS Active -> Idle, no delay (display: none) -FAIL Active -> Idle, no delay (Animation.timeline = null) promise_test: Unhandled rejection with value: object "TypeError: Cannot set property timeline of #<Animation> which has only a getter" +FAIL Active -> Idle, no delay (Animation.timeline = null) promise_test: Unhandled rejection with value: object "TypeError: Cannot assign to read only property 'timeline' of object '#<CSSTransition>'" PASS Active -> Idle, with positive delay (display: none) -FAIL Active -> Idle, with positive delay (Animation.timeline = null) promise_test: Unhandled rejection with value: object "TypeError: Cannot set property timeline of #<Animation> which has only a getter" +FAIL Active -> Idle, with positive delay (Animation.timeline = null) promise_test: Unhandled rejection with value: object "TypeError: Cannot assign to read only property 'timeline' of object '#<CSSTransition>'" PASS Active -> Idle, with negative delay (display: none) -FAIL Active -> Idle, with negative delay (Animation.timeline = null) promise_test: Unhandled rejection with value: object "TypeError: Cannot set property timeline of #<Animation> which has only a getter" +FAIL Active -> Idle, with negative delay (Animation.timeline = null) promise_test: Unhandled rejection with value: object "TypeError: Cannot assign to read only property 'timeline' of object '#<CSSTransition>'" PASS Active -> Before PASS Active -> After PASS After -> Before @@ -22,7 +22,7 @@ PASS Call Animation.cancel after canceling transition. PASS Restart transition after canceling transition immediately PASS Call Animation.cancel after restarting transition immediately -FAIL Set timeline and play transition after clear the timeline promise_test: Unhandled rejection with value: object "TypeError: Cannot set property timeline of #<Animation> which has only a getter" +FAIL Set timeline and play transition after clear the timeline promise_test: Unhandled rejection with value: object "TypeError: Cannot assign to read only property 'timeline' of object '#<CSSTransition>'" PASS Set null target effect after canceling the transition PASS Cancel the transition after clearing the target effect Harness: the test ran to completion.
diff --git a/third_party/blink/web_tests/external/wpt/dom/collections/HTMLCollection-delete-expected.txt b/third_party/blink/web_tests/external/wpt/dom/collections/HTMLCollection-delete-expected.txt new file mode 100644 index 0000000..4e83310 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/dom/collections/HTMLCollection-delete-expected.txt
@@ -0,0 +1,13 @@ +This is a testharness.js-based test. +PASS Loose id +FAIL Strict id assert_throws_js: function "function() { + "use strict"; + delete c[0]; + }" did not throw +PASS Loose name +FAIL Strict name assert_throws_js: function "function() { + "use strict"; + delete c.foo; + }" did not throw +Harness: the test ran to completion. +
diff --git a/third_party/blink/web_tests/external/wpt/dom/collections/HTMLCollection-own-props-expected.txt b/third_party/blink/web_tests/external/wpt/dom/collections/HTMLCollection-own-props-expected.txt new file mode 100644 index 0000000..4d2dd7f --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/dom/collections/HTMLCollection-own-props-expected.txt
@@ -0,0 +1,13 @@ +This is a testharness.js-based test. +FAIL Setting non-array index while named property exists (loose) assert_equals: expected (object) Element node <a id="named"></a> but got (string) "foo" +FAIL Setting non-array index while named property exists (strict) assert_throws_js: function "function() { + c[name] = "foo"; + }" did not throw +PASS Setting non-array index while named property doesn't exist (loose) +PASS Setting non-array index while named property doesn't exist (strict) +PASS Setting array index while indexed property exists (loose) +PASS Setting array index while indexed property exists (strict) +PASS Setting array index while indexed property doesn't exist (loose) +PASS Setting array index while indexed property doesn't exist (strict) +Harness: the test ran to completion. +
diff --git a/third_party/blink/web_tests/external/wpt/dom/collections/HTMLCollection-supported-property-indices-expected.txt b/third_party/blink/web_tests/external/wpt/dom/collections/HTMLCollection-supported-property-indices-expected.txt new file mode 100644 index 0000000..be034fa --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/dom/collections/HTMLCollection-supported-property-indices-expected.txt
@@ -0,0 +1,16 @@ +This is a testharness.js-based test. +PASS Handling of property names that look like negative integers +PASS Handling of property names that look like small nonnegative integers +PASS Handling of property names that look like integers around 2^31 +PASS Handling of property names that look like integers around 2^32 +FAIL Trying to set an expando that would shadow an already-existing indexed property assert_throws_js: function "function() { + "use strict"; + delete elements[0]; + }" did not throw +PASS Trying to set an expando with an indexed property name past the end of the list +FAIL Trying to delete an indexed property name should never work assert_throws_js: function "function() { + "use strict"; + delete elements[0]; + }" did not throw +Harness: the test ran to completion. +
diff --git a/third_party/blink/web_tests/external/wpt/dom/collections/HTMLCollection-supported-property-names-expected.txt b/third_party/blink/web_tests/external/wpt/dom/collections/HTMLCollection-supported-property-names-expected.txt new file mode 100644 index 0000000..30d2dd4 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/dom/collections/HTMLCollection-supported-property-names-expected.txt
@@ -0,0 +1,9 @@ +This is a testharness.js-based test. +PASS Object.getOwnPropertyNames on HTMLCollection +PASS Object.getOwnPropertyNames on HTMLCollection with non-HTML namespace +PASS Object.getOwnPropertyNames on HTMLCollection with expando object +FAIL Trying to set an expando that would shadow an already-existing named property assert_equals: expected (object) Element node <span id="some-id"></span> but got (number) 5 +PASS Trying to set an expando that shadows a named property that gets added later +PASS Trying to set a non-configurable expando that shadows a named property that gets added later +Harness: the test ran to completion. +
diff --git a/third_party/blink/web_tests/external/wpt/dom/idlharness.window_exclude=Node-expected.txt b/third_party/blink/web_tests/external/wpt/dom/idlharness.window_exclude=Node-expected.txt index 58f17fc2..0aa1687 100644 --- a/third_party/blink/web_tests/external/wpt/dom/idlharness.window_exclude=Node-expected.txt +++ b/third_party/blink/web_tests/external/wpt/dom/idlharness.window_exclude=Node-expected.txt
@@ -1,5 +1,5 @@ This is a testharness.js-based test. -Found 1252 tests; 1232 PASS, 20 FAIL, 0 TIMEOUT, 0 NOTRUN. +Found 1252 tests; 1228 PASS, 24 FAIL, 0 TIMEOUT, 0 NOTRUN. PASS idl_test setup PASS idl_test validation PASS Partial interface Window: original interface defined @@ -261,7 +261,7 @@ PASS Document interface object name PASS Document interface: existence and properties of interface prototype object PASS Document interface: existence and properties of interface prototype object's "constructor" property -FAIL Document interface: existence and properties of interface prototype object's @@unscopables property assert_not_equals: Document.prototype[Symbol.unscopables] has unexpected property "fullscreen" got disallowed value -1 +FAIL Document interface: existence and properties of interface prototype object's @@unscopables property assert_false: Document.prototype[Symbol.unscopables] should not be writable expected false got true PASS Document interface: attribute implementation PASS Document interface: attribute URL PASS Document interface: attribute documentURI @@ -481,7 +481,7 @@ PASS DocumentType interface object name PASS DocumentType interface: existence and properties of interface prototype object PASS DocumentType interface: existence and properties of interface prototype object's "constructor" property -PASS DocumentType interface: existence and properties of interface prototype object's @@unscopables property +FAIL DocumentType interface: existence and properties of interface prototype object's @@unscopables property assert_false: DocumentType.prototype[Symbol.unscopables] should not be writable expected false got true PASS DocumentType interface: attribute name PASS DocumentType interface: attribute publicId PASS DocumentType interface: attribute systemId @@ -512,7 +512,7 @@ PASS DocumentFragment interface object name PASS DocumentFragment interface: existence and properties of interface prototype object PASS DocumentFragment interface: existence and properties of interface prototype object's "constructor" property -PASS DocumentFragment interface: existence and properties of interface prototype object's @@unscopables property +FAIL DocumentFragment interface: existence and properties of interface prototype object's @@unscopables property assert_false: DocumentFragment.prototype[Symbol.unscopables] should not be writable expected false got true PASS DocumentFragment interface: operation getElementById(DOMString) PASS DocumentFragment interface: attribute children PASS DocumentFragment interface: attribute firstElementChild @@ -561,7 +561,7 @@ PASS Element interface object name PASS Element interface: existence and properties of interface prototype object PASS Element interface: existence and properties of interface prototype object's "constructor" property -PASS Element interface: existence and properties of interface prototype object's @@unscopables property +FAIL Element interface: existence and properties of interface prototype object's @@unscopables property assert_false: Element.prototype[Symbol.unscopables] should not be writable expected false got true PASS Element interface: attribute namespaceURI PASS Element interface: attribute prefix PASS Element interface: attribute localName @@ -750,7 +750,7 @@ PASS CharacterData interface object name PASS CharacterData interface: existence and properties of interface prototype object PASS CharacterData interface: existence and properties of interface prototype object's "constructor" property -PASS CharacterData interface: existence and properties of interface prototype object's @@unscopables property +FAIL CharacterData interface: existence and properties of interface prototype object's @@unscopables property assert_false: CharacterData.prototype[Symbol.unscopables] should not be writable expected false got true PASS CharacterData interface: attribute data PASS CharacterData interface: attribute length PASS CharacterData interface: operation substringData(unsigned long, unsigned long)
diff --git a/third_party/blink/web_tests/external/wpt/html/browsers/browsing-the-web/history-traversal/api-availability-expected.txt b/third_party/blink/web_tests/external/wpt/html/browsers/browsing-the-web/history-traversal/api-availability-expected.txt new file mode 100644 index 0000000..8676e6ed --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/html/browsers/browsing-the-web/history-traversal/api-availability-expected.txt
@@ -0,0 +1,4 @@ +This is a testharness.js-based test. +FAIL API availability following history traversal Cannot read property 'history' of null +Harness: the test ran to completion. +
diff --git a/third_party/blink/web_tests/external/wpt/html/browsers/history/the-location-interface/location-protocol-setter-non-broken-expected.txt b/third_party/blink/web_tests/external/wpt/html/browsers/history/the-location-interface/location-protocol-setter-non-broken-expected.txt index 4d1f8a9a..73507dc 100644 --- a/third_party/blink/web_tests/external/wpt/html/browsers/history/the-location-interface/location-protocol-setter-non-broken-expected.txt +++ b/third_party/blink/web_tests/external/wpt/html/browsers/history/the-location-interface/location-protocol-setter-non-broken-expected.txt
@@ -7,6 +7,8 @@ PASS Set data URL frame location.protocol to file PASS Set HTTP URL frame location.protocol to ftp PASS Set data URL frame location.protocol to ftp +PASS Set HTTP URL frame location.protocol to gopher +PASS Set data URL frame location.protocol to gopher PASS Set HTTP URL frame location.protocol to http+x PASS Set data URL frame location.protocol to http+x Harness: the test ran to completion.
diff --git a/third_party/blink/web_tests/external/wpt/html/browsers/history/the-location-interface/location-prototype-setting-same-origin-expected.txt b/third_party/blink/web_tests/external/wpt/html/browsers/history/the-location-interface/location-prototype-setting-same-origin-expected.txt new file mode 100644 index 0000000..f1e424f8 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/html/browsers/history/the-location-interface/location-prototype-setting-same-origin-expected.txt
@@ -0,0 +1,15 @@ +This is a testharness.js-based test. +PASS Same-origin prerequisite check: the original prototype is accessible +FAIL Same-origin: setting the prototype to an empty object via Object.setPrototypeOf should throw a TypeError assert_throws_js: function "() => { + Object.setPrototypeOf(target, newValue); + }" did not throw +FAIL Same-origin: setting the prototype to an empty object via __proto__ should throw a TypeError assert_throws_js: function "function() { + target.__proto__ = newValue; + }" did not throw +FAIL Same-origin: setting the prototype to an empty object via Reflect.setPrototypeOf should return false assert_false: expected false got true +FAIL Same-origin: the prototype must still be its original value assert_equals: expected object "[object Location]" but got object "[object Object]" +PASS Same-origin: setting the prototype to its original value via Object.setPrototypeOf should not throw +PASS Same-origin: setting the prototype to its original value via __proto__ should not throw +PASS Same-origin: setting the prototype to its original value via Reflect.setPrototypeOf should return true +Harness: the test ran to completion. +
diff --git a/third_party/blink/web_tests/external/wpt/html/browsers/history/the-location-interface/location-stringifier-expected.txt b/third_party/blink/web_tests/external/wpt/html/browsers/history/the-location-interface/location-stringifier-expected.txt new file mode 100644 index 0000000..59612a1b --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/html/browsers/history/the-location-interface/location-stringifier-expected.txt
@@ -0,0 +1,9 @@ +This is a testharness.js-based test. +PASS Location stringifier +PASS Location stringifier 1 +PASS Location stringifier 2 +PASS Location stringifier 3 +PASS Location stringifier 4 +FAIL Location stringifier 5 assert_equals: expected "function" but got "undefined" +Harness: the test ran to completion. +
diff --git a/third_party/blink/web_tests/external/wpt/html/browsers/history/the-location-interface/location-valueof-expected.txt b/third_party/blink/web_tests/external/wpt/html/browsers/history/the-location-interface/location-valueof-expected.txt new file mode 100644 index 0000000..1086fb9 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/html/browsers/history/the-location-interface/location-valueof-expected.txt
@@ -0,0 +1,4 @@ +This is a testharness.js-based test. +FAIL Location valueOf assert_equals: expected function "function valueOf() { [native code] }" but got function "function valueOf() { [native code] }" +Harness: the test ran to completion. +
diff --git a/third_party/blink/web_tests/external/wpt/html/browsers/the-window-object/named-access-on-the-window-object/prototype-expected.txt b/third_party/blink/web_tests/external/wpt/html/browsers/the-window-object/named-access-on-the-window-object/prototype-expected.txt new file mode 100644 index 0000000..312d0a1 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/html/browsers/the-window-object/named-access-on-the-window-object/prototype-expected.txt
@@ -0,0 +1,7 @@ +This is a testharness.js-based test. +PASS Property on window. +PASS Property on Window.prototype. +FAIL Property on EventTarget.prototype. assert_equals: expected (undefined) undefined but got (object) object "[object Object]" +FAIL Property on Object.prototype. assert_equals: expected (undefined) undefined but got (object) object "[object Object]" +Harness: the test ran to completion. +
diff --git a/third_party/blink/web_tests/external/wpt/html/browsers/the-window-object/window-indexed-properties-expected.txt b/third_party/blink/web_tests/external/wpt/html/browsers/the-window-object/window-indexed-properties-expected.txt new file mode 100644 index 0000000..f958b38 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/html/browsers/the-window-object/window-indexed-properties-expected.txt
@@ -0,0 +1,8 @@ +This is a testharness.js-based test. +PASS Indexed properties of the window object (non-strict mode) +PASS Ensure indexed properties have the correct configuration +FAIL Indexed properties of the window object (non-strict mode) 1 assert_equals: expected false but got true +PASS Indexed properties of the window object (non-strict mode) 2 +PASS Indexed properties of the window object (non-strict mode) 3 +Harness: the test ran to completion. +
diff --git a/third_party/blink/web_tests/external/wpt/html/browsers/the-window-object/window-indexed-properties-strict-expected.txt b/third_party/blink/web_tests/external/wpt/html/browsers/the-window-object/window-indexed-properties-strict-expected.txt new file mode 100644 index 0000000..24149dd --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/html/browsers/the-window-object/window-indexed-properties-strict-expected.txt
@@ -0,0 +1,7 @@ +This is a testharness.js-based test. +PASS Indexed properties of the window object (strict mode) +FAIL Indexed properties of the window object (strict mode) 1 assert_throws_js: function "() => delete window[0]" did not throw +PASS Indexed properties of the window object (strict mode) 2 +PASS Indexed properties of the window object (strict mode) 3 +Harness: the test ran to completion. +
diff --git a/third_party/blink/web_tests/external/wpt/html/browsers/the-window-object/window-properties.https-expected.txt b/third_party/blink/web_tests/external/wpt/html/browsers/the-window-object/window-properties.https-expected.txt index 90301e0..76418e8 100644 --- a/third_party/blink/web_tests/external/wpt/html/browsers/the-window-object/window-properties.https-expected.txt +++ b/third_party/blink/web_tests/external/wpt/html/browsers/the-window-object/window-properties.https-expected.txt
@@ -1,5 +1,5 @@ This is a testharness.js-based test. -Found 174 tests; 173 PASS, 1 FAIL, 0 TIMEOUT, 0 NOTRUN. +Found 174 tests; 165 PASS, 9 FAIL, 0 TIMEOUT, 0 NOTRUN. PASS Value Properties of the Global Object PASS Value Property: NaN PASS Value Property: Infinity @@ -75,7 +75,7 @@ PASS Window readonly attribute: localStorage PASS Window attribute: name PASS Window attribute: status -PASS Window attribute: opener +FAIL Window attribute: opener assert_equals: expected "function" but got "undefined" PASS Window attribute: onabort PASS Window attribute: onafterprint PASS Window attribute: onbeforeprint @@ -143,21 +143,21 @@ PASS Window attribute: onunload PASS Window attribute: onvolumechange PASS Window attribute: onwaiting -PASS Window unforgeable attribute: window +FAIL Window unforgeable attribute: window assert_equals: expected "function" but got "undefined" PASS Window unforgeable attribute: document -PASS Window unforgeable attribute: location -PASS Window unforgeable attribute: top -PASS Window replaceable attribute: self +FAIL Window unforgeable attribute: location assert_equals: expected "function" but got "undefined" +FAIL Window unforgeable attribute: top assert_equals: expected "function" but got "undefined" +FAIL Window replaceable attribute: self assert_equals: expected "function" but got "undefined" PASS Window replaceable attribute: locationbar PASS Window replaceable attribute: menubar PASS Window replaceable attribute: personalbar PASS Window replaceable attribute: scrollbars PASS Window replaceable attribute: statusbar PASS Window replaceable attribute: toolbar -PASS Window replaceable attribute: frames -PASS Window replaceable attribute: parent +FAIL Window replaceable attribute: frames assert_equals: expected "function" but got "undefined" +FAIL Window replaceable attribute: parent assert_equals: expected "function" but got "undefined" PASS Window replaceable attribute: external -PASS Window replaceable attribute: length +FAIL Window replaceable attribute: length assert_equals: expected "function" but got "undefined" PASS Window replaceable attribute: origin PASS Window replaceable attribute: screen PASS Window replaceable attribute: scrollX
diff --git a/third_party/blink/web_tests/external/wpt/html/browsers/windows/auxiliary-browsing-contexts/opener-setter.window-expected.txt b/third_party/blink/web_tests/external/wpt/html/browsers/windows/auxiliary-browsing-contexts/opener-setter.window-expected.txt new file mode 100644 index 0000000..8dfee380 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/html/browsers/windows/auxiliary-browsing-contexts/opener-setter.window-expected.txt
@@ -0,0 +1,10 @@ +This is a testharness.js-based test. +FAIL Setting window.opener to undefined assert_own_property: expected property "get" missing +FAIL Setting window.opener to 42 assert_own_property: expected property "get" missing +FAIL Setting window.opener to function() { return "hi" } assert_own_property: expected property "get" missing +FAIL Setting window.opener to hi assert_own_property: expected property "get" missing +FAIL Setting window.opener to [object Object] assert_own_property: expected property "get" missing +FAIL Setting window.opener to assert_own_property: expected property "get" missing +FAIL Setting window.opener to Symbol() assert_own_property: expected property "get" missing +Harness: the test ran to completion. +
diff --git a/third_party/blink/web_tests/external/wpt/html/browsers/windows/embedded-opener-expected.txt b/third_party/blink/web_tests/external/wpt/html/browsers/windows/embedded-opener-expected.txt new file mode 100644 index 0000000..16481744 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/html/browsers/windows/embedded-opener-expected.txt
@@ -0,0 +1,4 @@ +This is a testharness.js-based test. +FAIL opener and embedded documents; using window.open() openerGet is not a function +Harness: the test ran to completion. +
diff --git a/third_party/blink/web_tests/external/wpt/html/browsers/windows/embedded-opener-remove-frame-expected.txt b/third_party/blink/web_tests/external/wpt/html/browsers/windows/embedded-opener-remove-frame-expected.txt index 36c9182..1d304732 100644 --- a/third_party/blink/web_tests/external/wpt/html/browsers/windows/embedded-opener-remove-frame-expected.txt +++ b/third_party/blink/web_tests/external/wpt/html/browsers/windows/embedded-opener-remove-frame-expected.txt
@@ -1,5 +1,5 @@ This is a testharness.js-based test. -FAIL opener of discarded nested browsing context assert_equals: expected (string) "immaterial" but got (undefined) undefined -FAIL opener of discarded auxiliary browsing context assert_equals: expected (string) "immaterial" but got (undefined) undefined +FAIL opener of discarded nested browsing context openerGet is not a function +FAIL opener of discarded auxiliary browsing context openerGet is not a function Harness: the test ran to completion.
diff --git a/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/2d.getcontext.extraargs-expected.txt b/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/2d.getcontext.extraargs-expected.txt new file mode 100644 index 0000000..7212cb8 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/the-offscreen-canvas/2d.getcontext.extraargs-expected.txt
@@ -0,0 +1,4 @@ +This is a testharness.js-based test. +FAIL The 2D context ignores extra getContext arguments Failed to execute 'getContext' on 'OffscreenCanvas': parameter 2 ('attributes') is not an object. +Harness: the test ran to completion. +
diff --git a/third_party/blink/web_tests/external/wpt/html/dom/elements/global-attributes/dataset-binding.window-expected.txt b/third_party/blink/web_tests/external/wpt/html/dom/elements/global-attributes/dataset-binding.window-expected.txt new file mode 100644 index 0000000..0f3419e --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/html/dom/elements/global-attributes/dataset-binding.window-expected.txt
@@ -0,0 +1,7 @@ +This is a testharness.js-based test. +FAIL Getting property descriptor for key 9 assert_equals: expected "value for Getting property descriptor for key 9" but got "9" +PASS Setting property for key 9 with accessor property on prototype +PASS Getting property descriptor for key x +PASS Setting property for key x with accessor property on prototype +Harness: the test ran to completion. +
diff --git "a/third_party/blink/web_tests/external/wpt/html/dom/idlharness.https_exclude=\050Document_Window_HTML._\051-expected.txt" "b/third_party/blink/web_tests/external/wpt/html/dom/idlharness.https_exclude=\050Document_Window_HTML._\051-expected.txt" index 7968f855..9f3049c 100644 --- "a/third_party/blink/web_tests/external/wpt/html/dom/idlharness.https_exclude=\050Document_Window_HTML._\051-expected.txt" +++ "b/third_party/blink/web_tests/external/wpt/html/dom/idlharness.https_exclude=\050Document_Window_HTML._\051-expected.txt"
@@ -1,5 +1,5 @@ This is a testharness.js-based test. -Found 1412 tests; 1328 PASS, 84 FAIL, 0 TIMEOUT, 0 NOTRUN. +Found 1412 tests; 1327 PASS, 85 FAIL, 0 TIMEOUT, 0 NOTRUN. PASS idl_test setup PASS idl_test validation PASS Partial interface Document: original interface defined @@ -889,7 +889,7 @@ FAIL Location interface: stringifier assert_own_property: interface prototype object missing non-static operation expected property "toString" missing PASS Location must be primary interface of window.location PASS Stringification of window.location -PASS Location interface: window.location must have own property "href" +FAIL Location interface: window.location must have own property "href" assert_false: property descriptor should not have a "value" field expected false got true PASS Location interface: window.location must have own property "origin" PASS Location interface: window.location must have own property "protocol" PASS Location interface: window.location must have own property "host"
diff --git "a/third_party/blink/web_tests/external/wpt/html/dom/idlharness.https_include=\050Document_Window\051-expected.txt" "b/third_party/blink/web_tests/external/wpt/html/dom/idlharness.https_include=\050Document_Window\051-expected.txt" index ecc0d989..2a60f996 100644 --- "a/third_party/blink/web_tests/external/wpt/html/dom/idlharness.https_include=\050Document_Window\051-expected.txt" +++ "b/third_party/blink/web_tests/external/wpt/html/dom/idlharness.https_include=\050Document_Window\051-expected.txt"
@@ -1,5 +1,5 @@ This is a testharness.js-based test. -Found 963 tests; 946 PASS, 17 FAIL, 0 TIMEOUT, 0 NOTRUN. +Found 963 tests; 937 PASS, 26 FAIL, 0 TIMEOUT, 0 NOTRUN. PASS idl_test setup PASS idl_test validation PASS Partial interface Document: original interface defined @@ -180,7 +180,7 @@ PASS Window interface: internal [[SetPrototypeOf]] method of interface prototype object - setting to its original value via Reflect.setPrototypeOf should return true PASS Window interface: existence and properties of interface prototype object's "constructor" property PASS Window interface: existence and properties of interface prototype object's @@unscopables property -PASS Window interface: attribute self +FAIL Window interface: attribute self assert_equals: "self" must have a getter expected "function" but got "undefined" PASS Window interface: attribute name PASS Window interface: attribute history PASS Window interface: attribute customElements @@ -192,14 +192,14 @@ PASS Window interface: attribute toolbar PASS Window interface: attribute status PASS Window interface: operation close() -PASS Window interface: attribute closed +FAIL Window interface: attribute closed assert_equals: "closed" must have a getter expected "function" but got "undefined" PASS Window interface: operation stop() PASS Window interface: operation focus() PASS Window interface: operation blur() -PASS Window interface: attribute frames -PASS Window interface: attribute length -PASS Window interface: attribute opener -PASS Window interface: attribute parent +FAIL Window interface: attribute frames assert_equals: "frames" must have a getter expected "function" but got "undefined" +FAIL Window interface: attribute length assert_equals: "length" must have a getter expected "function" but got "undefined" +FAIL Window interface: attribute opener assert_equals: "opener" must have a getter expected "function" but got "undefined" +FAIL Window interface: attribute parent assert_equals: "parent" must have a getter expected "function" but got "undefined" PASS Window interface: attribute frameElement PASS Window interface: operation open(optional USVString, optional DOMString, optional DOMString) PASS Window interface: attribute navigator @@ -319,11 +319,11 @@ PASS Window interface: internal [[SetPrototypeOf]] method of global platform object - setting to its original value via Reflect.setPrototypeOf should return true PASS Window must be primary interface of window PASS Stringification of window -PASS Window interface: window must have own property "window" +FAIL Window interface: window must have own property "window" assert_false: property descriptor should not have a "value" field expected false got true PASS Window interface: window must inherit property "self" with the proper type PASS Window interface: window must have own property "document" PASS Window interface: window must inherit property "name" with the proper type -PASS Window interface: window must have own property "location" +FAIL Window interface: window must have own property "location" assert_false: property descriptor should not have a "value" field expected false got true PASS Window interface: window must inherit property "history" with the proper type PASS Window interface: window must inherit property "customElements" with the proper type PASS Window interface: window must inherit property "locationbar" with the proper type @@ -340,7 +340,7 @@ PASS Window interface: window must inherit property "blur()" with the proper type PASS Window interface: window must inherit property "frames" with the proper type PASS Window interface: window must inherit property "length" with the proper type -PASS Window interface: window must have own property "top" +FAIL Window interface: window must have own property "top" assert_false: property descriptor should not have a "value" field expected false got true PASS Window interface: window must inherit property "opener" with the proper type PASS Window interface: window must inherit property "parent" with the proper type PASS Window interface: window must inherit property "frameElement" with the proper type
diff --git a/third_party/blink/web_tests/external/wpt/html/semantics/forms/the-form-element/form-indexed-element-expected.txt b/third_party/blink/web_tests/external/wpt/html/semantics/forms/the-form-element/form-indexed-element-expected.txt new file mode 100644 index 0000000..c25ec2f --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/html/semantics/forms/the-form-element/form-indexed-element-expected.txt
@@ -0,0 +1,8 @@ +This is a testharness.js-based test. +PASS form.elements should be accessed correctly by index +FAIL Trying to delete an indexed property name should never work assert_throws_js: function "function() { + "use strict"; + delete form[0]; + }" did not throw +Harness: the test ran to completion. +
diff --git a/third_party/blink/web_tests/external/wpt/html/semantics/forms/the-form-element/form-nameditem-expected.txt b/third_party/blink/web_tests/external/wpt/html/semantics/forms/the-form-element/form-nameditem-expected.txt index 9075895..86a0d67 100644 --- a/third_party/blink/web_tests/external/wpt/html/semantics/forms/the-form-element/form-nameditem-expected.txt +++ b/third_party/blink/web_tests/external/wpt/html/semantics/forms/the-form-element/form-nameditem-expected.txt
@@ -1,7 +1,7 @@ This is a testharness.js-based test. PASS Forms should not have an item method PASS Forms should not have a namedItem method -PASS Name for a single element should work +FAIL Name for a single element should work assert_false: expected false got true PASS Calling item() on the NodeList returned from the named getter should work PASS Indexed getter on the NodeList returned from the named getter should work PASS Invoking a legacycaller on the NodeList returned from the named getter should not work @@ -10,12 +10,9 @@ PASS Named items outside the form should not be returned (no children) PASS Named items outside the form should not be returned (one child) PASS The form attribute should be taken into account for named getters (single element) -PASS The form attribute should be taken into account for named getters (multiple elements) +FAIL The form attribute should be taken into account for named getters (multiple elements) assert_false: expected false got true PASS Input should only be a named property on the innermost form that contains it -FAIL Trying to set an expando that would shadow an already-existing named property assert_throws_js: function "function() { - "use strict"; - delete form["l1"]; - }" did not throw +FAIL Trying to set an expando that would shadow an already-existing named property assert_false: expected false got true FAIL Trying to set an expando that shadows a named property that gets added later assert_equals: expected (number) 5 but got (object) Element node <input name="new-name"></input> FAIL Trying to set a non-configurable expando that shadows a named property that gets added later assert_equals: expected (number) 5 but got (object) Element node <input name="new-name2"></input> PASS Past names map should work correctly
diff --git a/third_party/blink/web_tests/external/wpt/layout-instability/inline-flow-shift-vertical-rl.html b/third_party/blink/web_tests/external/wpt/layout-instability/inline-flow-shift-vertical-rl.html new file mode 100644 index 0000000..06bc34c --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/layout-instability/inline-flow-shift-vertical-rl.html
@@ -0,0 +1,44 @@ +<!DOCTYPE html> +<title>Layout Instability: simple block movement is detected</title> +<link rel="help" href="https://wicg.github.io/layout-instability/" /> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="resources/util.js"></script> +<body style="writing-mode: vertical-rl"> +<div style="height: 200px; font-size: 20px; line-height: 25px"> + 1AAAAAAA<br> + 2AAAAAAA<br> + 3AAAAAAA<br> + <div id="inline-block" style="display: inline-block; width: 50px">4AAAAAAA</div><br> + 5AAAAAAA<br> + 6AAAAAAA<br> + 7AAAAAAA<br> +</div> +<script> + +promise_test(async () => { + const watcher = new ScoreWatcher; + + // Wait for the initial render to complete. + await waitForAnimationFrames(2); + + // Modify the position of the div. + const inline_block = document.querySelector("#inline-block"); + inline_block.style.width = '100px'; + + // The lines below the inline-block are shifted down by 50px. + // The implementation may measure the real width of the shifted text + // or use the available width (i.e. width of the containing block). + // Also tolerate extra 10% error. + const text_width = inline_block.offsetWidth; + const expectedScoreMin = computeExpectedScore(text_width * (30 * 3 + 50), 50) * 0.9; + const expectedScoreMax = computeExpectedScore(200 * (30 * 3 + 50), 50) * 1.1; + + // Observer fires after the frame is painted. + assert_equals(watcher.score, 0); + await watcher.promise; + assert_between_exclusive(watcher.score, expectedScoreMin, expectedScoreMax); +}, 'Inline flow movement.'); + +</script> +</body>
diff --git a/third_party/blink/web_tests/external/wpt/layout-instability/inline-flow-shift.html b/third_party/blink/web_tests/external/wpt/layout-instability/inline-flow-shift.html new file mode 100644 index 0000000..39550da --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/layout-instability/inline-flow-shift.html
@@ -0,0 +1,42 @@ +<!DOCTYPE html> +<title>Layout Instability: simple block movement is detected</title> +<link rel="help" href="https://wicg.github.io/layout-instability/" /> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="resources/util.js"></script> +<div style="width: 200px; font-size: 20px; line-height: 25px"> + 1AAAAAAA<br> + 2AAAAAAA<br> + 3AAAAAAA<br> + <div id="inline-block" style="display: inline-block; height: 50px">4AAAAAAA</div><br> + 5AAAAAAA<br> + 6AAAAAAA<br> + 7AAAAAAA<br> +</div> +<script> + +promise_test(async () => { + const watcher = new ScoreWatcher; + + // Wait for the initial render to complete. + await waitForAnimationFrames(2); + + // Modify the position of the div. + const inline_block = document.querySelector("#inline-block"); + inline_block.style.height = '100px'; + + // The lines below the inline-block are shifted down by 50px. + // The implementation may measure the real width of the shifted text + // or use the available width (i.e. width of the containing block). + // Also tolerate extra 10% error. + const text_width = inline_block.offsetWidth; + const expectedScoreMin = computeExpectedScore(text_width * (30 * 3 + 50), 50) * 0.9; + const expectedScoreMax = computeExpectedScore(200 * (30 * 3 + 50), 50) * 1.1; + + // Observer fires after the frame is painted. + assert_equals(watcher.score, 0); + await watcher.promise; + assert_between_exclusive(watcher.score, expectedScoreMin, expectedScoreMax); +}, 'Inline flow movement.'); + +</script>
diff --git a/third_party/blink/web_tests/external/wpt/layout-instability/outline.html b/third_party/blink/web_tests/external/wpt/layout-instability/outline.html new file mode 100644 index 0000000..1fed8e9 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/layout-instability/outline.html
@@ -0,0 +1,21 @@ +<!DOCTYPE html> +<title>Layout Instability: outline doesn't contribute to layout shift</title> +<link rel="help" href="https://wicg.github.io/layout-instability/" /> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="resources/util.js"></script> +<div id="target" style="width: 300px; height: 300px"></div> +<script> +promise_test(async () => { + const watcher = new ScoreWatcher; + + // Wait for the initial render to complete. + await waitForAnimationFrames(2); + + // Add outline for target. This should not generate a shift. + target.style.outline = "10px solid blue"; + + await waitForAnimationFrames(3); + assert_equals(watcher.score, 0); +}, "Outline."); +</script>
diff --git a/third_party/blink/web_tests/external/wpt/native-file-system/idlharness.https.any-expected.txt b/third_party/blink/web_tests/external/wpt/native-file-system/idlharness.https.any-expected.txt new file mode 100644 index 0000000..fd08a2bb --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/native-file-system/idlharness.https.any-expected.txt
@@ -0,0 +1,62 @@ +This is a testharness.js-based test. +Found 58 tests; 57 PASS, 1 FAIL, 0 TIMEOUT, 0 NOTRUN. +PASS idl_test setup +PASS idl_test validation +PASS Partial interface Window: original interface defined +PASS Partial interface Window: member names are unique +PASS Partial interface mixin WindowOrWorkerGlobalScope: original interface mixin defined +PASS Partial interface mixin WindowOrWorkerGlobalScope: member names are unique +PASS Partial interface Window[2]: member names are unique +PASS Window includes GlobalEventHandlers: member names are unique +PASS Window includes WindowEventHandlers: member names are unique +PASS Window includes WindowOrWorkerGlobalScope: member names are unique +PASS Window includes AnimationFrameProvider: member names are unique +PASS Window includes WindowSessionStorage: member names are unique +PASS Window includes WindowLocalStorage: member names are unique +PASS WorkerGlobalScope includes WindowOrWorkerGlobalScope: member names are unique +PASS FileSystemHandle interface: existence and properties of interface object +PASS FileSystemHandle interface object length +PASS FileSystemHandle interface object name +PASS FileSystemHandle interface: existence and properties of interface prototype object +PASS FileSystemHandle interface: existence and properties of interface prototype object's "constructor" property +PASS FileSystemHandle interface: existence and properties of interface prototype object's @@unscopables property +PASS FileSystemHandle interface: attribute kind +PASS FileSystemHandle interface: attribute name +PASS FileSystemHandle interface: operation isSameEntry(FileSystemHandle) +PASS FileSystemHandle interface: operation queryPermission(optional FileSystemHandlePermissionDescriptor) +PASS FileSystemHandle interface: operation requestPermission(optional FileSystemHandlePermissionDescriptor) +PASS FileSystemFileHandle interface: existence and properties of interface object +PASS FileSystemFileHandle interface object length +PASS FileSystemFileHandle interface object name +PASS FileSystemFileHandle interface: existence and properties of interface prototype object +PASS FileSystemFileHandle interface: existence and properties of interface prototype object's "constructor" property +PASS FileSystemFileHandle interface: existence and properties of interface prototype object's @@unscopables property +PASS FileSystemFileHandle interface: operation getFile() +PASS FileSystemFileHandle interface: operation createWritable(optional FileSystemCreateWritableOptions) +PASS FileSystemDirectoryHandle interface: existence and properties of interface object +PASS FileSystemDirectoryHandle interface object length +PASS FileSystemDirectoryHandle interface object name +PASS FileSystemDirectoryHandle interface: existence and properties of interface prototype object +PASS FileSystemDirectoryHandle interface: existence and properties of interface prototype object's "constructor" property +PASS FileSystemDirectoryHandle interface: existence and properties of interface prototype object's @@unscopables property +FAIL FileSystemDirectoryHandle interface: async iterable<USVString, FileSystemHandle> assert_equals: entries method should be the same as @@asyncIterator method expected function "function entries() { [native code] }" but got function "function entries() { [native code] }" +PASS FileSystemDirectoryHandle interface: operation getFileHandle(USVString, optional FileSystemGetFileOptions) +PASS FileSystemDirectoryHandle interface: operation getDirectoryHandle(USVString, optional FileSystemGetDirectoryOptions) +PASS FileSystemDirectoryHandle interface: operation removeEntry(USVString, optional FileSystemRemoveOptions) +PASS FileSystemDirectoryHandle interface: operation resolve(FileSystemHandle) +PASS FileSystemWritableFileStream interface: existence and properties of interface object +PASS FileSystemWritableFileStream interface object length +PASS FileSystemWritableFileStream interface object name +PASS FileSystemWritableFileStream interface: existence and properties of interface prototype object +PASS FileSystemWritableFileStream interface: existence and properties of interface prototype object's "constructor" property +PASS FileSystemWritableFileStream interface: existence and properties of interface prototype object's @@unscopables property +PASS FileSystemWritableFileStream interface: operation write(FileSystemWriteChunkType) +PASS FileSystemWritableFileStream interface: operation seek(unsigned long long) +PASS FileSystemWritableFileStream interface: operation truncate(unsigned long long) +PASS Window interface: operation showOpenFilePicker(optional OpenFilePickerOptions) +PASS Window interface: operation showSaveFilePicker(optional SaveFilePickerOptions) +PASS Window interface: operation showDirectoryPicker(optional DirectoryPickerOptions) +PASS Window interface: operation getOriginPrivateDirectory() +PASS WorkerGlobalScope interface: existence and properties of interface object +Harness: the test ran to completion. +
diff --git a/third_party/blink/web_tests/external/wpt/native-file-system/idlharness.https.any.worker-expected.txt b/third_party/blink/web_tests/external/wpt/native-file-system/idlharness.https.any.worker-expected.txt new file mode 100644 index 0000000..0b3ae0d --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/native-file-system/idlharness.https.any.worker-expected.txt
@@ -0,0 +1,59 @@ +This is a testharness.js-based test. +Found 55 tests; 54 PASS, 1 FAIL, 0 TIMEOUT, 0 NOTRUN. +PASS idl_test setup +PASS idl_test validation +PASS Partial interface Window: original interface defined +PASS Partial interface Window: member names are unique +PASS Partial interface mixin WindowOrWorkerGlobalScope: original interface mixin defined +PASS Partial interface mixin WindowOrWorkerGlobalScope: member names are unique +PASS Partial interface Window[2]: member names are unique +PASS Window includes GlobalEventHandlers: member names are unique +PASS Window includes WindowEventHandlers: member names are unique +PASS Window includes WindowOrWorkerGlobalScope: member names are unique +PASS Window includes AnimationFrameProvider: member names are unique +PASS Window includes WindowSessionStorage: member names are unique +PASS Window includes WindowLocalStorage: member names are unique +PASS WorkerGlobalScope includes WindowOrWorkerGlobalScope: member names are unique +PASS FileSystemHandle interface: existence and properties of interface object +PASS FileSystemHandle interface object length +PASS FileSystemHandle interface object name +PASS FileSystemHandle interface: existence and properties of interface prototype object +PASS FileSystemHandle interface: existence and properties of interface prototype object's "constructor" property +PASS FileSystemHandle interface: existence and properties of interface prototype object's @@unscopables property +PASS FileSystemHandle interface: attribute kind +PASS FileSystemHandle interface: attribute name +PASS FileSystemHandle interface: operation isSameEntry(FileSystemHandle) +PASS FileSystemHandle interface: operation queryPermission(optional FileSystemHandlePermissionDescriptor) +PASS FileSystemHandle interface: operation requestPermission(optional FileSystemHandlePermissionDescriptor) +PASS FileSystemFileHandle interface: existence and properties of interface object +PASS FileSystemFileHandle interface object length +PASS FileSystemFileHandle interface object name +PASS FileSystemFileHandle interface: existence and properties of interface prototype object +PASS FileSystemFileHandle interface: existence and properties of interface prototype object's "constructor" property +PASS FileSystemFileHandle interface: existence and properties of interface prototype object's @@unscopables property +PASS FileSystemFileHandle interface: operation getFile() +PASS FileSystemFileHandle interface: operation createWritable(optional FileSystemCreateWritableOptions) +PASS FileSystemDirectoryHandle interface: existence and properties of interface object +PASS FileSystemDirectoryHandle interface object length +PASS FileSystemDirectoryHandle interface object name +PASS FileSystemDirectoryHandle interface: existence and properties of interface prototype object +PASS FileSystemDirectoryHandle interface: existence and properties of interface prototype object's "constructor" property +PASS FileSystemDirectoryHandle interface: existence and properties of interface prototype object's @@unscopables property +FAIL FileSystemDirectoryHandle interface: async iterable<USVString, FileSystemHandle> assert_equals: entries method should be the same as @@asyncIterator method expected function "function entries() { [native code] }" but got function "function entries() { [native code] }" +PASS FileSystemDirectoryHandle interface: operation getFileHandle(USVString, optional FileSystemGetFileOptions) +PASS FileSystemDirectoryHandle interface: operation getDirectoryHandle(USVString, optional FileSystemGetDirectoryOptions) +PASS FileSystemDirectoryHandle interface: operation removeEntry(USVString, optional FileSystemRemoveOptions) +PASS FileSystemDirectoryHandle interface: operation resolve(FileSystemHandle) +PASS FileSystemWritableFileStream interface: existence and properties of interface object +PASS FileSystemWritableFileStream interface object length +PASS FileSystemWritableFileStream interface object name +PASS FileSystemWritableFileStream interface: existence and properties of interface prototype object +PASS FileSystemWritableFileStream interface: existence and properties of interface prototype object's "constructor" property +PASS FileSystemWritableFileStream interface: existence and properties of interface prototype object's @@unscopables property +PASS FileSystemWritableFileStream interface: operation write(FileSystemWriteChunkType) +PASS FileSystemWritableFileStream interface: operation seek(unsigned long long) +PASS FileSystemWritableFileStream interface: operation truncate(unsigned long long) +PASS Window interface: existence and properties of interface object +PASS WorkerGlobalScope interface: operation getOriginPrivateDirectory() +Harness: the test ran to completion. +
diff --git a/third_party/blink/web_tests/external/wpt/service-workers/service-worker/detached-context.https-expected.txt b/third_party/blink/web_tests/external/wpt/service-workers/service-worker/detached-context.https-expected.txt new file mode 100644 index 0000000..904eaa7c --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/service-workers/service-worker/detached-context.https-expected.txt
@@ -0,0 +1,8 @@ +This is a testharness.js-based test. +FAIL accessing a ServiceWorkerRegistration from a removed iframe assert_equals: expected (string) "activated" but got (undefined) undefined +PASS accessing a ServiceWorker object from a removed iframe +PASS accessing navigator.serviceWorker on a detached iframe +PASS accessing navigator on a removed frame +PASS accessing navigator.serviceWorker on a removed about:blank frame +Harness: the test ran to completion. +
diff --git a/third_party/blink/web_tests/external/wpt/web-animations/interfaces/Animatable/animate-no-browsing-context-expected.txt b/third_party/blink/web_tests/external/wpt/web-animations/interfaces/Animatable/animate-no-browsing-context-expected.txt index 91238a4..de9770be 100644 --- a/third_party/blink/web_tests/external/wpt/web-animations/interfaces/Animatable/animate-no-browsing-context-expected.txt +++ b/third_party/blink/web_tests/external/wpt/web-animations/interfaces/Animatable/animate-no-browsing-context-expected.txt
@@ -1,7 +1,7 @@ This is a testharness.js-based test. PASS Element.animate() creates an animation with the correct timeline when called on an element in a document without a browsing context PASS The timeline associated with an animation trigger on an element in a document without a browsing context is inactive -FAIL Replacing the timeline of an animation targetting an element in a document without a browsing context leaves it in the pending state promise_test: Unhandled rejection with value: object "TypeError: Cannot set property timeline of #<Animation> which has only a getter" -FAIL Replacing the timeline of an animation targetting an element in a document without a browsing context and then adopting that element causes it to start updating style promise_test: Unhandled rejection with value: object "TypeError: Cannot set property timeline of #<Animation> which has only a getter" +FAIL Replacing the timeline of an animation targetting an element in a document without a browsing context leaves it in the pending state promise_test: Unhandled rejection with value: object "TypeError: Cannot assign to read only property 'timeline' of object '#<Animation>'" +FAIL Replacing the timeline of an animation targetting an element in a document without a browsing context and then adopting that element causes it to start updating style promise_test: Unhandled rejection with value: object "TypeError: Cannot assign to read only property 'timeline' of object '#<Animation>'" Harness: the test ran to completion.
diff --git a/third_party/blink/web_tests/external/wpt/web-animations/interfaces/Animation/style-change-events-expected.txt b/third_party/blink/web_tests/external/wpt/web-animations/interfaces/Animation/style-change-events-expected.txt index a618fd7..ae99c09 100644 --- a/third_party/blink/web_tests/external/wpt/web-animations/interfaces/Animation/style-change-events-expected.txt +++ b/third_party/blink/web_tests/external/wpt/web-animations/interfaces/Animation/style-change-events-expected.txt
@@ -9,17 +9,17 @@ PASS Animation.id produces expected style change events PASS Animation.onfinish produces expected style change events PASS Animation.oncancel produces expected style change events -PASS Animation.cancel produces expected style change events PASS Animation.finish produces expected style change events -PASS Animation.pause produces expected style change events PASS Animation.play produces expected style change events +PASS Animation.pause produces expected style change events PASS Animation.reverse produces expected style change events PASS Animation.updatePlaybackRate produces expected style change events -FAIL Animation.timeline produces expected style change events promise_test: Unhandled rejection with value: object "TypeError: Cannot set property timeline of #<Animation> which has only a getter" -PASS Animation.replaceState produces expected style change events -PASS Animation.onremove produces expected style change events +PASS Animation.cancel produces expected style change events PASS Animation.finished produces expected style change events PASS Animation.ready produces expected style change events +PASS Animation.replaceState produces expected style change events +FAIL Animation.timeline produces expected style change events promise_test: Unhandled rejection with value: object "TypeError: Cannot assign to read only property 'timeline' of object '#<Animation>'" +PASS Animation.onremove produces expected style change events PASS Animation.commitStyles produces expected style change events PASS Animation.persist produces expected style change events PASS Animation.Animation constructor produces expected style change events
diff --git a/third_party/blink/web_tests/external/wpt/web-animations/interfaces/KeyframeEffect/style-change-events-expected.txt b/third_party/blink/web_tests/external/wpt/web-animations/interfaces/KeyframeEffect/style-change-events-expected.txt index a3ce452..ea37248 100644 --- a/third_party/blink/web_tests/external/wpt/web-animations/interfaces/KeyframeEffect/style-change-events-expected.txt +++ b/third_party/blink/web_tests/external/wpt/web-animations/interfaces/KeyframeEffect/style-change-events-expected.txt
@@ -1,11 +1,11 @@ This is a testharness.js-based test. -FAIL All property keys are recognized assert_in_array: Test property 'iterationComposite' should be one of the properties on KeyframeEffect value "iterationComposite" not in array ["getComputedTiming", "getTiming", "updateTiming", "target", "pseudoElement", "composite", "getKeyframes", "setKeyframes", "KeyframeEffect constructor", "KeyframeEffect copy constructor"] -PASS KeyframeEffect.getComputedTiming does NOT trigger a style change event +FAIL All property keys are recognized assert_in_array: Test property 'iterationComposite' should be one of the properties on KeyframeEffect value "iterationComposite" not in array ["getTiming", "getComputedTiming", "updateTiming", "target", "composite", "pseudoElement", "getKeyframes", "setKeyframes", "KeyframeEffect constructor", "KeyframeEffect copy constructor"] PASS KeyframeEffect.getTiming does NOT trigger a style change event +PASS KeyframeEffect.getComputedTiming does NOT trigger a style change event PASS KeyframeEffect.updateTiming does NOT trigger a style change event PASS KeyframeEffect.target does NOT trigger a style change event -PASS KeyframeEffect.pseudoElement does NOT trigger a style change event PASS KeyframeEffect.composite does NOT trigger a style change event +PASS KeyframeEffect.pseudoElement does NOT trigger a style change event PASS KeyframeEffect.getKeyframes does NOT trigger a style change event PASS KeyframeEffect.setKeyframes does NOT trigger a style change event PASS KeyframeEffect.KeyframeEffect constructor does NOT trigger a style change event
diff --git a/third_party/blink/web_tests/external/wpt/web-animations/timing-model/animations/setting-the-timeline-of-an-animation-expected.txt b/third_party/blink/web_tests/external/wpt/web-animations/timing-model/animations/setting-the-timeline-of-an-animation-expected.txt index 305bfa27..1b685b0 100644 --- a/third_party/blink/web_tests/external/wpt/web-animations/timing-model/animations/setting-the-timeline-of-an-animation-expected.txt +++ b/third_party/blink/web_tests/external/wpt/web-animations/timing-model/animations/setting-the-timeline-of-an-animation-expected.txt
@@ -1,19 +1,19 @@ This is a testharness.js-based test. -FAIL After setting timeline on paused animation it is still paused Cannot set property timeline of #<Animation> which has only a getter -FAIL After setting timeline on animation paused outside active interval it is still paused Cannot set property timeline of #<Animation> which has only a getter -FAIL After setting timeline on an idle animation without a start time it is still idle Cannot set property timeline of #<Animation> which has only a getter -FAIL After setting timeline on an idle animation with a start time it is running Cannot set property timeline of #<Animation> which has only a getter -FAIL After setting timeline on an idle animation with a sufficiently ancient start time it is finished Cannot set property timeline of #<Animation> which has only a getter -FAIL After setting timeline on a play-pending animation it begins playing after pending promise_test: Unhandled rejection with value: object "TypeError: Cannot set property timeline of #<Animation> which has only a getter" -FAIL After setting timeline on a pause-pending animation it becomes paused after pending promise_test: Unhandled rejection with value: object "TypeError: Cannot set property timeline of #<Animation> which has only a getter" -FAIL After clearing timeline on paused animation it is still paused Cannot set property timeline of #<Animation> which has only a getter -FAIL After clearing timeline on finished animation it is idle Cannot set property timeline of #<Animation> which has only a getter -FAIL After clearing timeline on running animation it is idle Cannot set property timeline of #<Animation> which has only a getter -FAIL After clearing timeline on idle animation it is still idle Cannot set property timeline of #<Animation> which has only a getter -FAIL After clearing timeline on play-pending animation it is still pending Cannot set property timeline of #<Animation> which has only a getter -FAIL After clearing and re-setting timeline on play-pending animation it begins to play promise_test: Unhandled rejection with value: object "TypeError: Cannot set property timeline of #<Animation> which has only a getter" -FAIL After clearing timeline on a pause-pending animation it is still pending Cannot set property timeline of #<Animation> which has only a getter -FAIL After clearing and re-setting timeline on a pause-pending animation it completes pausing promise_test: Unhandled rejection with value: object "TypeError: Cannot set property timeline of #<Animation> which has only a getter" -FAIL After clearing and re-setting timeline on an animation in the middle of an aborted pause, it continues playing using the same start time promise_test: Unhandled rejection with value: object "TypeError: Cannot set property timeline of #<Animation> which has only a getter" +FAIL After setting timeline on paused animation it is still paused Cannot assign to read only property 'timeline' of object '#<Animation>' +FAIL After setting timeline on animation paused outside active interval it is still paused Cannot assign to read only property 'timeline' of object '#<Animation>' +FAIL After setting timeline on an idle animation without a start time it is still idle Cannot assign to read only property 'timeline' of object '#<Animation>' +FAIL After setting timeline on an idle animation with a start time it is running Cannot assign to read only property 'timeline' of object '#<Animation>' +FAIL After setting timeline on an idle animation with a sufficiently ancient start time it is finished Cannot assign to read only property 'timeline' of object '#<Animation>' +FAIL After setting timeline on a play-pending animation it begins playing after pending promise_test: Unhandled rejection with value: object "TypeError: Cannot assign to read only property 'timeline' of object '#<Animation>'" +FAIL After setting timeline on a pause-pending animation it becomes paused after pending promise_test: Unhandled rejection with value: object "TypeError: Cannot assign to read only property 'timeline' of object '#<Animation>'" +FAIL After clearing timeline on paused animation it is still paused Cannot assign to read only property 'timeline' of object '#<Animation>' +FAIL After clearing timeline on finished animation it is idle Cannot assign to read only property 'timeline' of object '#<Animation>' +FAIL After clearing timeline on running animation it is idle Cannot assign to read only property 'timeline' of object '#<Animation>' +FAIL After clearing timeline on idle animation it is still idle Cannot assign to read only property 'timeline' of object '#<Animation>' +FAIL After clearing timeline on play-pending animation it is still pending Cannot assign to read only property 'timeline' of object '#<Animation>' +FAIL After clearing and re-setting timeline on play-pending animation it begins to play promise_test: Unhandled rejection with value: object "TypeError: Cannot assign to read only property 'timeline' of object '#<Animation>'" +FAIL After clearing timeline on a pause-pending animation it is still pending Cannot assign to read only property 'timeline' of object '#<Animation>' +FAIL After clearing and re-setting timeline on a pause-pending animation it completes pausing promise_test: Unhandled rejection with value: object "TypeError: Cannot assign to read only property 'timeline' of object '#<Animation>'" +FAIL After clearing and re-setting timeline on an animation in the middle of an aborted pause, it continues playing using the same start time promise_test: Unhandled rejection with value: object "TypeError: Cannot assign to read only property 'timeline' of object '#<Animation>'" Harness: the test ran to completion.
diff --git a/third_party/blink/web_tests/external/wpt/web-animations/timing-model/timelines/update-and-send-events-replacement-expected.txt b/third_party/blink/web_tests/external/wpt/web-animations/timing-model/timelines/update-and-send-events-replacement-expected.txt index 888d29a1..d583a4f 100644 --- a/third_party/blink/web_tests/external/wpt/web-animations/timing-model/timelines/update-and-send-events-replacement-expected.txt +++ b/third_party/blink/web_tests/external/wpt/web-animations/timing-model/timelines/update-and-send-events-replacement-expected.txt
@@ -9,8 +9,8 @@ PASS Removes an animation after updating its fill mode PASS Removes an animation after updating another animation's effect to one with different timing PASS Removes an animation after updating its effect to one with different timing -FAIL Removes an animation after updating another animation's timeline promise_test: Unhandled rejection with value: object "TypeError: Cannot set property timeline of #<Animation> which has only a getter" -FAIL Removes an animation after updating its timeline promise_test: Unhandled rejection with value: object "TypeError: Cannot set property timeline of #<Animation> which has only a getter" +FAIL Removes an animation after updating another animation's timeline promise_test: Unhandled rejection with value: object "TypeError: Cannot assign to read only property 'timeline' of object '#<Animation>'" +FAIL Removes an animation after updating its timeline promise_test: Unhandled rejection with value: object "TypeError: Cannot assign to read only property 'timeline' of object '#<Animation>'" PASS Removes an animation after updating another animation's effect's properties PASS Removes an animation after updating its effect's properties PASS Removes an animation after updating another animation's effect to one with different properties @@ -32,11 +32,11 @@ PASS Does NOT dispatch a remove event twice PASS Does NOT remove an animation after making a redundant change to another animation's current time PASS Does NOT remove an animation after making a redundant change to its current time -FAIL Does NOT remove an animation after making a redundant change to another animation's timeline promise_test: Unhandled rejection with value: object "TypeError: Cannot set property timeline of #<Animation> which has only a getter" -FAIL Does NOT remove an animation after making a redundant change to its timeline promise_test: Unhandled rejection with value: object "TypeError: Cannot set property timeline of #<Animation> which has only a getter" +FAIL Does NOT remove an animation after making a redundant change to another animation's timeline promise_test: Unhandled rejection with value: object "TypeError: Cannot assign to read only property 'timeline' of object '#<Animation>'" +FAIL Does NOT remove an animation after making a redundant change to its timeline promise_test: Unhandled rejection with value: object "TypeError: Cannot assign to read only property 'timeline' of object '#<Animation>'" PASS Does NOT remove an animation after making a redundant change to another animation's effect's properties PASS Does NOT remove an animation after making a redundant change to its effect's properties -FAIL Updates ALL timelines before checking for replacement promise_test: Unhandled rejection with value: object "TypeError: Cannot set property timeline of #<Animation> which has only a getter" +FAIL Updates ALL timelines before checking for replacement promise_test: Unhandled rejection with value: object "TypeError: Cannot assign to read only property 'timeline' of object '#<Animation>'" PASS Dispatches remove events after finish events FAIL Fires remove event before requestAnimationFrame assert_true: Not expecting event, but got remove event expected true got false PASS Queues all remove events before running them
diff --git a/third_party/blink/web_tests/external/wpt/webaudio/js/helpers.js b/third_party/blink/web_tests/external/wpt/webaudio/js/helpers.js index 3819d12..413c720 100644 --- a/third_party/blink/web_tests/external/wpt/webaudio/js/helpers.js +++ b/third_party/blink/web_tests/external/wpt/webaudio/js/helpers.js
@@ -159,8 +159,8 @@ function testOnNormalContext(callback) { function testOutput(nodeToInspect, expectedBuffers, callback) { testLength = 0; - var sp = context.createScriptProcessor(expectedBuffers[0].length, gTest.numberOfChannels, 0); - nodeToInspect.connect(sp); + var sp = context.createScriptProcessor(expectedBuffers[0].length, gTest.numberOfChannels, 1); + nodeToInspect.connect(sp).connect(context.destination); sp.onaudioprocess = function(e) { var expectedBuffer = expectedBuffers.shift(); testLength += expectedBuffer.length;
diff --git a/third_party/blink/web_tests/external/wpt/webaudio/the-audio-api/the-analysernode-interface/test-analyser-minimum.html b/third_party/blink/web_tests/external/wpt/webaudio/the-audio-api/the-analysernode-interface/test-analyser-minimum.html index 3b9e573..ab0fe6b 100644 --- a/third_party/blink/web_tests/external/wpt/webaudio/the-audio-api/the-analysernode-interface/test-analyser-minimum.html +++ b/third_party/blink/web_tests/external/wpt/webaudio/the-audio-api/the-analysernode-interface/test-analyser-minimum.html
@@ -11,13 +11,13 @@ var ac = new AudioContext(); var analyser = ac.createAnalyser(); var constant = ac.createConstantSource(); - var sp = ac.createScriptProcessor(2048, 1, 0); + var sp = ac.createScriptProcessor(2048, 1, 1); constant.offset.value = 0.0; constant.connect(analyser).connect(ac.destination); - constant.connect(sp); + constant.connect(sp).connect(ac.destination); var buf = new Float32Array(analyser.frequencyBinCount); var iteration_count = 10;
diff --git a/third_party/blink/web_tests/external/wpt/webrtc/RTCPeerConnection-iceGatheringState-expected.txt b/third_party/blink/web_tests/external/wpt/webrtc/RTCPeerConnection-iceGatheringState-expected.txt index b8da1700..db32c8e1 100644 --- a/third_party/blink/web_tests/external/wpt/webrtc/RTCPeerConnection-iceGatheringState-expected.txt +++ b/third_party/blink/web_tests/external/wpt/webrtc/RTCPeerConnection-iceGatheringState-expected.txt
@@ -5,6 +5,6 @@ PASS setLocalDescription(reoffer) with a new transport should cause iceGatheringState to go to "checking" and then "complete" PASS sRD does not cause ICE gathering state changes FAIL renegotiation that closes all transports should result in ICE gathering state "new" promise_test: Unhandled rejection with value: object "TypeError: pc1.getTransceivers(...)[0].stop is not a function" -PASS connection with one data channel should eventually have connected connection state +FAIL connection with one data channel should eventually have connected connection state assert_equals: Expect ICE transport to be in checking gatheringState when iceGatheringState is checking expected (string) "gathering" but got (undefined) undefined Harness: the test ran to completion.
diff --git a/third_party/blink/web_tests/external/wpt/webvtt/api/VTTCue/region-expected.txt b/third_party/blink/web_tests/external/wpt/webvtt/api/VTTCue/region-expected.txt index 305af88..bbc8739 100644 --- a/third_party/blink/web_tests/external/wpt/webvtt/api/VTTCue/region-expected.txt +++ b/third_party/blink/web_tests/external/wpt/webvtt/api/VTTCue/region-expected.txt
@@ -1,4 +1,4 @@ This is a testharness.js-based test. -FAIL VTTCue.region, script-created cue Failed to set the 'region' property on 'VTTCue': Failed to convert value to 'VTTRegion'. +FAIL VTTCue.region, script-created cue Failed to set the 'region' property on 'VTTCue': The provided value is not of type 'VTTRegion'. Harness: the test ran to completion.
diff --git a/third_party/blink/web_tests/fast/dom/MutationObserver/mutation-observer-constructor-expected.txt b/third_party/blink/web_tests/fast/dom/MutationObserver/mutation-observer-constructor-expected.txt index 237a9f9c..4b07ca02 100644 --- a/third_party/blink/web_tests/fast/dom/MutationObserver/mutation-observer-constructor-expected.txt +++ b/third_party/blink/web_tests/fast/dom/MutationObserver/mutation-observer-constructor-expected.txt
@@ -7,10 +7,10 @@ PASS typeof WebKitMutationObserver.prototype.disconnect is "function" PASS typeof observer.observe is "function" PASS typeof observer.disconnect is "function" -PASS new MutationObserver({ handleEvent: function() {} }) threw exception TypeError: Failed to construct 'MutationObserver': parameter 1 is not of type 'Function'.. -PASS new MutationObserver({}) threw exception TypeError: Failed to construct 'MutationObserver': parameter 1 is not of type 'Function'.. -PASS new MutationObserver(42) threw exception TypeError: Failed to construct 'MutationObserver': parameter 1 is not of type 'Function'.. -PASS new MutationObserver("foo") threw exception TypeError: Failed to construct 'MutationObserver': parameter 1 is not of type 'Function'.. +PASS new MutationObserver({ handleEvent: function() {} }) threw exception TypeError: Failed to construct 'MutationObserver': The callback provided as parameter 1 is not a function.. +PASS new MutationObserver({}) threw exception TypeError: Failed to construct 'MutationObserver': The callback provided as parameter 1 is not a function.. +PASS new MutationObserver(42) threw exception TypeError: Failed to construct 'MutationObserver': The callback provided as parameter 1 is not a function.. +PASS new MutationObserver("foo") threw exception TypeError: Failed to construct 'MutationObserver': The callback provided as parameter 1 is not a function.. PASS successfullyParsed is true TEST COMPLETE
diff --git a/third_party/blink/web_tests/fast/dom/TreeWalker/TreeWalker-currentNode-expected.txt b/third_party/blink/web_tests/fast/dom/TreeWalker/TreeWalker-currentNode-expected.txt index 8aa3184..397c4e1a 100644 --- a/third_party/blink/web_tests/fast/dom/TreeWalker/TreeWalker-currentNode-expected.txt +++ b/third_party/blink/web_tests/fast/dom/TreeWalker/TreeWalker-currentNode-expected.txt
@@ -13,9 +13,9 @@ Test that setting the currentNode to non-Node values throws. -PASS w.currentNode = null threw exception TypeError: Failed to set the 'currentNode' property on 'TreeWalker': Failed to convert value to 'Node'.. -PASS w.currentNode = {} threw exception TypeError: Failed to set the 'currentNode' property on 'TreeWalker': Failed to convert value to 'Node'.. -PASS w.currentNode = window threw exception TypeError: Failed to set the 'currentNode' property on 'TreeWalker': Failed to convert value to 'Node'.. +PASS w.currentNode = null threw exception TypeError: Failed to set the 'currentNode' property on 'TreeWalker': The provided value is not of type 'Node'.. +PASS w.currentNode = {} threw exception TypeError: Failed to set the 'currentNode' property on 'TreeWalker': The provided value is not of type 'Node'.. +PASS w.currentNode = window threw exception TypeError: Failed to set the 'currentNode' property on 'TreeWalker': The provided value is not of type 'Node'.. Test that we handle setting the currentNode to arbitrary nodes not under the root element.
diff --git a/third_party/blink/web_tests/fast/dom/Window/property-access-in-closure-after-navigation-expected.txt b/third_party/blink/web_tests/fast/dom/Window/property-access-in-closure-after-navigation-expected.txt index 75f8a5f1..1579b43 100644 --- a/third_party/blink/web_tests/fast/dom/Window/property-access-in-closure-after-navigation-expected.txt +++ b/third_party/blink/web_tests/fast/dom/Window/property-access-in-closure-after-navigation-expected.txt
@@ -6,7 +6,7 @@ PASS window is frames PASS parent is top PASS window is non-null. -PASS self is non-null. -PASS frames is non-null. -PASS parent is non-null. -PASS top is non-null. +FAIL self should be non-null. Was null +FAIL frames should be non-null. Was null +PASS parent is null. +PASS top is null.
diff --git a/third_party/blink/web_tests/fast/dom/Window/property-access-on-cached-properties-after-frame-navigated.html b/third_party/blink/web_tests/fast/dom/Window/property-access-on-cached-properties-after-frame-navigated.html index 411301b..8e27624 100644 --- a/third_party/blink/web_tests/fast/dom/Window/property-access-on-cached-properties-after-frame-navigated.html +++ b/third_party/blink/web_tests/fast/dom/Window/property-access-on-cached-properties-after-frame-navigated.html
@@ -13,9 +13,6 @@ { if (path.length < 2) return; - // It's expected that performance.eventCounts.size is non-zero. - if (getPropertyPath(path, path.length) == "performance.eventCounts.size") - return; var propertyDir = getPropertyPath(path, path.length - 1); var cachedPropertyDir = "cached_" + propertyDir.replace('.', '_'); window[cachedPropertyDir] = eval("childWindow." + propertyDir);
diff --git a/third_party/blink/web_tests/fast/dom/Window/property-access-on-cached-properties-after-frame-removed-and-gced.html b/third_party/blink/web_tests/fast/dom/Window/property-access-on-cached-properties-after-frame-removed-and-gced.html index 07f2fd6..1f45780 100644 --- a/third_party/blink/web_tests/fast/dom/Window/property-access-on-cached-properties-after-frame-removed-and-gced.html +++ b/third_party/blink/web_tests/fast/dom/Window/property-access-on-cached-properties-after-frame-removed-and-gced.html
@@ -13,9 +13,6 @@ { if (path.length < 2) return; - // It's expected that performance.eventCounts.size is non-zero. - if (getPropertyPath(path, path.length) == "performance.eventCounts.size") - return; var propertyDir = getPropertyPath(path, path.length - 1); var cachedPropertyDir = "cached_" + propertyDir.replace('.', '_'); window[cachedPropertyDir] = eval("childWindow." + propertyDir);
diff --git a/third_party/blink/web_tests/fast/dom/Window/property-access-on-cached-properties-after-frame-removed.html b/third_party/blink/web_tests/fast/dom/Window/property-access-on-cached-properties-after-frame-removed.html index e158acd..fbe9aae8 100644 --- a/third_party/blink/web_tests/fast/dom/Window/property-access-on-cached-properties-after-frame-removed.html +++ b/third_party/blink/web_tests/fast/dom/Window/property-access-on-cached-properties-after-frame-removed.html
@@ -12,9 +12,6 @@ { if (path.length < 2) return; - // It's expected that performance.eventCounts.size is non-zero. - if (getPropertyPath(path, path.length) == "performance.eventCounts.size") - return; var propertyDir = getPropertyPath(path, path.length - 1); var cachedPropertyDir = "cached_" + propertyDir.replace('.', '_'); window[cachedPropertyDir] = eval("childWindow." + propertyDir);
diff --git a/third_party/blink/web_tests/fast/dom/Window/property-access-on-cached-window-after-frame-navigated-expected.txt b/third_party/blink/web_tests/fast/dom/Window/property-access-on-cached-window-after-frame-navigated-expected.txt index 12687be..ecb298c 100644 --- a/third_party/blink/web_tests/fast/dom/Window/property-access-on-cached-window-after-frame-navigated-expected.txt +++ b/third_party/blink/web_tests/fast/dom/Window/property-access-on-cached-window-after-frame-navigated-expected.txt
@@ -191,7 +191,6 @@ PASS oldChildWindow.outerWidth is newChildWindow.outerWidth PASS oldChildWindow.pageXOffset is newChildWindow.pageXOffset PASS oldChildWindow.pageYOffset is newChildWindow.pageYOffset -PASS oldChildWindow.performance.eventCounts.size is newChildWindow.performance.eventCounts.size PASS oldChildWindow.performance.navigation.redirectCount is newChildWindow.performance.navigation.redirectCount PASS oldChildWindow.performance.navigation.type is newChildWindow.performance.navigation.type PASS oldChildWindow.performance.onresourcetimingbufferfull is newChildWindow.performance.onresourcetimingbufferfull
diff --git a/third_party/blink/web_tests/fast/dom/Window/property-access-on-cached-window-after-frame-removed-and-gced-expected.txt b/third_party/blink/web_tests/fast/dom/Window/property-access-on-cached-window-after-frame-removed-and-gced-expected.txt index 7514b234..bd9309f27 100644 --- a/third_party/blink/web_tests/fast/dom/Window/property-access-on-cached-window-after-frame-removed-and-gced-expected.txt +++ b/third_party/blink/web_tests/fast/dom/Window/property-access-on-cached-window-after-frame-removed-and-gced-expected.txt
@@ -12,7 +12,6 @@ PASS childWindow.innerWidth is 0 PASS childWindow.isSecureContext is false PASS childWindow.length is 0 -FAIL childWindow.location.href should be about:blank (of type string). Was undefined (of type undefined). PASS childWindow.locationbar.visible is false PASS childWindow.menubar.visible is false PASS childWindow.name is '' @@ -24,6 +23,8 @@ PASS childWindow.navigator.hardwareConcurrency is window.navigator.hardwareConcurrency PASS childWindow.navigator.language is window.navigator.language PASS childWindow.navigator.maxTouchPoints is 0 +PASS childWindow.navigator.mediaSession.metadata is null +PASS childWindow.navigator.mediaSession.playbackState is 'none' PASS childWindow.navigator.onLine is window.navigator.onLine PASS childWindow.navigator.platform is window.navigator.platform PASS childWindow.navigator.product is window.navigator.product
diff --git a/third_party/blink/web_tests/fast/dom/Window/property-access-on-cached-window-after-frame-removed-expected.txt b/third_party/blink/web_tests/fast/dom/Window/property-access-on-cached-window-after-frame-removed-expected.txt index bbd0949..74def1f 100644 --- a/third_party/blink/web_tests/fast/dom/Window/property-access-on-cached-window-after-frame-removed-expected.txt +++ b/third_party/blink/web_tests/fast/dom/Window/property-access-on-cached-window-after-frame-removed-expected.txt
@@ -12,7 +12,6 @@ PASS childWindow.innerWidth is 0 PASS childWindow.isSecureContext is false PASS childWindow.length is 0 -FAIL childWindow.location.href should be about:blank (of type string). Was undefined (of type undefined). PASS childWindow.locationbar.visible is false PASS childWindow.menubar.visible is false PASS childWindow.name is '' @@ -24,6 +23,8 @@ PASS childWindow.navigator.hardwareConcurrency is window.navigator.hardwareConcurrency PASS childWindow.navigator.language is window.navigator.language PASS childWindow.navigator.maxTouchPoints is 0 +PASS childWindow.navigator.mediaSession.metadata is null +PASS childWindow.navigator.mediaSession.playbackState is 'none' PASS childWindow.navigator.onLine is window.navigator.onLine PASS childWindow.navigator.platform is window.navigator.platform PASS childWindow.navigator.product is window.navigator.product
diff --git a/third_party/blink/web_tests/fast/dom/Window/resources/property-access-in-closure-after-navigation-child.html b/third_party/blink/web_tests/fast/dom/Window/resources/property-access-in-closure-after-navigation-child.html index 4ff5d1f..e9dff7d 100644 --- a/third_party/blink/web_tests/fast/dom/Window/resources/property-access-in-closure-after-navigation-child.html +++ b/third_party/blink/web_tests/fast/dom/Window/resources/property-access-in-closure-after-navigation-child.html
@@ -35,10 +35,8 @@ // WindowProxy. // https://html.spec.whatwg.org/multipage/browsers.html#dom-top // https://html.spec.whatwg.org/multipage/browsers.html#dom-parent - // However, when navigated, the WindowProxy's browsing context still exists. - // When the iframe is removed, |parent| and |top| are null. - shouldBeNonNull(parent, "parent"); - shouldBeNonNull(top, "top"); + shouldBeNull(parent, "parent"); + shouldBeNull(top, "top"); }; location = 'data:text/html,<body>Testing...</body>'; }
diff --git a/third_party/blink/web_tests/fast/dom/Window/window-constructor.html b/third_party/blink/web_tests/fast/dom/Window/window-constructor.html index 497ed74..f4fbbb6 100644 --- a/third_party/blink/web_tests/fast/dom/Window/window-constructor.html +++ b/third_party/blink/web_tests/fast/dom/Window/window-constructor.html
@@ -16,7 +16,9 @@ assert_throws_js(TypeError, () => { new window.__proto__.constructor; }, "Window.prototype constructor must be non-callable."); - assert_equals(window.__proto__.__proto__.constructor, EventTarget, - "WindowProperties constructor is EventTarget."); + assert_throws_js(TypeError, () => { window.__proto__.__proto__.constructor(); }, + "WindowProperties constructor must be non-callable."); + assert_throws_js(TypeError, () => { new window.__proto__.__proto__.constructor; }, + "WindowProperties constructor must be non-callable."); }, "Test Window and its prototype chain's constructors."); </script>
diff --git a/third_party/blink/web_tests/fast/dom/Window/window-custom-prototype-expected.txt b/third_party/blink/web_tests/fast/dom/Window/window-custom-prototype-expected.txt index bea5911..4b3902b 100644 --- a/third_party/blink/web_tests/fast/dom/Window/window-custom-prototype-expected.txt +++ b/third_party/blink/web_tests/fast/dom/Window/window-custom-prototype-expected.txt
@@ -14,7 +14,7 @@ PASS __proto__ = originalWindowPrototype; __proto__ is originalWindowPrototype PASS anotherObject.__proto__ = window; anotherObject.__proto__ is window PASS __proto__ = null; __proto__ threw exception TypeError: Immutable prototype object '#<Window>' cannot have their prototype set. -PASS location.__proto__.__proto__ = location threw exception TypeError: Immutable prototype object '#<Location>' cannot have their prototype set. +PASS location.__proto__.__proto__ = location threw exception TypeError: Cyclic __proto__ value. PASS successfullyParsed is true TEST COMPLETE
diff --git a/third_party/blink/web_tests/fast/dom/Window/window-custom-prototype.html b/third_party/blink/web_tests/fast/dom/Window/window-custom-prototype.html index 5fc9b6e0..733f169 100644 --- a/third_party/blink/web_tests/fast/dom/Window/window-custom-prototype.html +++ b/third_party/blink/web_tests/fast/dom/Window/window-custom-prototype.html
@@ -24,7 +24,7 @@ shouldBe("__proto__ = originalWindowPrototype; __proto__", "originalWindowPrototype"); shouldBe("anotherObject.__proto__ = window; anotherObject.__proto__", "window"); shouldThrow("__proto__ = null; __proto__", error); -shouldThrow("location.__proto__.__proto__ = location", "'TypeError: Immutable prototype object \\'#<Location>\\' cannot have their prototype set'"); +shouldThrow("location.__proto__.__proto__ = location", "'TypeError: Cyclic __proto__ value'"); </script> </body> </html>
diff --git a/third_party/blink/web_tests/fast/dom/Window/window-postmessage-clone-deep-array-expected.txt b/third_party/blink/web_tests/fast/dom/Window/window-postmessage-clone-deep-array-expected.txt index 6cdf2ba..af7bea55 100644 --- a/third_party/blink/web_tests/fast/dom/Window/window-postmessage-clone-deep-array-expected.txt +++ b/third_party/blink/web_tests/fast/dom/Window/window-postmessage-clone-deep-array-expected.txt
@@ -1,4 +1,5 @@ +CONSOLE ERROR: line 11: Uncaught RangeError: Maximum call stack size exceeded Tests that we support cloning deep(ish) arrays. -FAIL: 'postMessage(deepArray)' should not throw but threw RangeError: Maximum call stack size exceeded + PASS: eventData is done of type string
diff --git a/third_party/blink/web_tests/fast/dom/Window/window-properties-performance-expected.txt b/third_party/blink/web_tests/fast/dom/Window/window-properties-performance-expected.txt index 3a451c0..3249f61 100644 --- a/third_party/blink/web_tests/fast/dom/Window/window-properties-performance-expected.txt +++ b/third_party/blink/web_tests/fast/dom/Window/window-properties-performance-expected.txt
@@ -12,7 +12,6 @@ window.performance.eventCounts.get [function] window.performance.eventCounts.has [function] window.performance.eventCounts.keys [function] -window.performance.eventCounts.size [number] window.performance.eventCounts.values [function] window.performance.getEntries [function] window.performance.getEntriesByName [function]
diff --git a/third_party/blink/web_tests/fast/dom/Window/window-scroll-arguments-expected.txt b/third_party/blink/web_tests/fast/dom/Window/window-scroll-arguments-expected.txt index 1217f52..5407f07 100644 --- a/third_party/blink/web_tests/fast/dom/Window/window-scroll-arguments-expected.txt +++ b/third_party/blink/web_tests/fast/dom/Window/window-scroll-arguments-expected.txt
@@ -10,7 +10,7 @@ Testing - scrollTo with 0 arguments PASS window.scrollTo() did not throw exception. Testing - scrollTo with 1 non-dictionary argument -PASS window.scrollTo(x) threw exception TypeError: Failed to execute 'scrollTo' on 'Window': cannot convert to dictionary.. +PASS window.scrollTo(x) threw exception TypeError: Failed to execute 'scrollTo' on 'Window': parameter 1 ('options') is not an object.. Testing - scrollTo with a valid ScrollToOptions argument PASS window.scrollTo({ }) did not throw exception. PASS window.scrollTo({ left: x }) did not throw exception. @@ -34,7 +34,7 @@ Testing - scroll with 0 arguments PASS window.scroll() did not throw exception. Testing - scroll with 1 argument -PASS window.scroll(x) threw exception TypeError: Failed to execute 'scroll' on 'Window': cannot convert to dictionary.. +PASS window.scroll(x) threw exception TypeError: Failed to execute 'scroll' on 'Window': parameter 1 ('options') is not an object.. Testing - scroll with a valid ScrollToOptions argument PASS window.scroll({ }) did not throw exception. PASS window.scroll({ left: x }) did not throw exception. @@ -58,7 +58,7 @@ Testing - scrollBy with 0 arguments PASS window.scrollBy() did not throw exception. Testing - scrollBy with 1 argument -PASS window.scrollBy(x) threw exception TypeError: Failed to execute 'scrollBy' on 'Window': cannot convert to dictionary.. +PASS window.scrollBy(x) threw exception TypeError: Failed to execute 'scrollBy' on 'Window': parameter 1 ('options') is not an object.. Testing - scrollBy with a valid ScrollOptions argument PASS window.scrollBy({ }) did not throw exception. PASS window.scrollBy({ left: x }) did not throw exception.
diff --git a/third_party/blink/web_tests/fast/dom/collection-item-must-not-be-overridden-by-own-property-expected.txt b/third_party/blink/web_tests/fast/dom/collection-item-should-be-overridden-by-own-property-expected.txt similarity index 61% rename from third_party/blink/web_tests/fast/dom/collection-item-must-not-be-overridden-by-own-property-expected.txt rename to third_party/blink/web_tests/fast/dom/collection-item-should-be-overridden-by-own-property-expected.txt index b1d5929d..272e47a 100644 --- a/third_party/blink/web_tests/fast/dom/collection-item-must-not-be-overridden-by-own-property-expected.txt +++ b/third_party/blink/web_tests/fast/dom/collection-item-should-be-overridden-by-own-property-expected.txt
@@ -1,13 +1,13 @@ -This test ensures the collection item obtained by named property getter is NOT overridden by object's own property. +This test ensures the collection item obtained by named property getter is overridden by object's own property. On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". PASS document.all.foo is document.getElementById('element0') -PASS document.all.foo is document.getElementById('element0') +PASS document.all.foo is 1 PASS document.styleSheets.link1 is document.styleSheets[0] -PASS document.styleSheets.link1 is document.styleSheets[0] +PASS document.styleSheets.link1 is 1 PASS document.body.attributes.style is document.body.attributes['style'] -PASS document.body.attributes.style is document.body.attributes['style'] +PASS document.body.attributes.style is 1 PASS successfullyParsed is true TEST COMPLETE
diff --git a/third_party/blink/web_tests/fast/dom/collection-item-must-not-be-overridden-by-own-property.html b/third_party/blink/web_tests/fast/dom/collection-item-should-be-overridden-by-own-property.html similarity index 74% rename from third_party/blink/web_tests/fast/dom/collection-item-must-not-be-overridden-by-own-property.html rename to third_party/blink/web_tests/fast/dom/collection-item-should-be-overridden-by-own-property.html index cc4db4a..e6875780 100644 --- a/third_party/blink/web_tests/fast/dom/collection-item-must-not-be-overridden-by-own-property.html +++ b/third_party/blink/web_tests/fast/dom/collection-item-should-be-overridden-by-own-property.html
@@ -10,19 +10,20 @@ <input type="text" id="element1" name="bar"> </div> <script> -description("This test ensures the collection item obtained by named property getter is NOT overridden by object's own property."); +description("This test ensures the collection item obtained by named property getter is overridden by object's own property."); shouldBe("document.all.foo", "document.getElementById('element0')"); document.all.foo = 1; -shouldBe("document.all.foo", "document.getElementById('element0')"); +shouldBe("document.all.foo", "1"); shouldBe("document.styleSheets.link1", "document.styleSheets[0]"); document.styleSheets.link1 = 1; -shouldBe("document.styleSheets.link1", "document.styleSheets[0]"); +shouldBe("document.styleSheets.link1", "1"); shouldBe("document.body.attributes.style", "document.body.attributes['style']"); document.body.attributes.style = 1; -shouldBe("document.body.attributes.style", "document.body.attributes['style']"); +shouldBe("document.body.attributes.style", "1"); + document.getElementById('testElements').style.display = 'none';
diff --git a/third_party/blink/web_tests/fast/dom/dataset-xhtml-expected.txt b/third_party/blink/web_tests/fast/dom/dataset-xhtml-expected.txt index 705a0cb..938c8c2 100644 --- a/third_party/blink/web_tests/fast/dom/dataset-xhtml-expected.txt +++ b/third_party/blink/web_tests/fast/dom/dataset-xhtml-expected.txt
@@ -24,9 +24,9 @@ PASS testSet('à', 'data-à') is true -PASS testSet('-foo', 'dummy') threw exception SyntaxError: '-foo' is not a valid property name.. -PASS testSet('foo ', 'dummy') threw exception InvalidCharacterError: 'data-foo ' is not a valid attribute name.. -PASS testSet('foo豈', 'dummy') threw exception InvalidCharacterError: 'data-foo豈' is not a valid attribute name.. +PASS testSet('-foo', 'dummy') threw exception SyntaxError: Failed to set the '-foo' property on 'DOMStringMap': '-foo' is not a valid property name.. +PASS testSet('foo ', 'dummy') threw exception InvalidCharacterError: Failed to set the 'foo ' property on 'DOMStringMap': 'data-foo ' is not a valid attribute name.. +FAIL testSet('foo豈', 'dummy') should throw InvalidCharacterError: Failed to set the 'foo豈' property on 'DOMStringMap': 'data-foo豈' is not a valid attribute name.. Threw exception InvalidCharacterError: Failed to set the 'fooï¤Â€' property on 'DOMStringMap': 'data-foo豈' is not a valid attribute name.. PASS testDelete('data-foo', 'foo') is true
diff --git a/third_party/blink/web_tests/fast/dom/dataset-xhtml.xhtml b/third_party/blink/web_tests/fast/dom/dataset-xhtml.xhtml index e9d9301..522f32c 100644 --- a/third_party/blink/web_tests/fast/dom/dataset-xhtml.xhtml +++ b/third_party/blink/web_tests/fast/dom/dataset-xhtml.xhtml
@@ -55,9 +55,9 @@ shouldBeTrue("testSet('\xE0', 'data-\xE0')"); debug(""); -shouldThrow("testSet('-foo', 'dummy')", '"SyntaxError: \'-foo\' is not a valid property name."'); -shouldThrow("testSet('foo\x20', 'dummy')", '"InvalidCharacterError: \'data-foo\x20\' is not a valid attribute name."'); -shouldThrow("testSet('foo\uF900', 'dummy')", '"InvalidCharacterError: \'data-foo\uF900\' is not a valid attribute name."'); +shouldThrow("testSet('-foo', 'dummy')", '"SyntaxError: Failed to set the \'-foo\' property on \'DOMStringMap\': \'-foo\' is not a valid property name."'); +shouldThrow("testSet('foo\x20', 'dummy')", '"InvalidCharacterError: Failed to set the \'foo\x20\' property on \'DOMStringMap\': \'data-foo\x20\' is not a valid attribute name."'); +shouldThrow("testSet('foo\uF900', 'dummy')", '"InvalidCharacterError: Failed to set the \'foo\uF900\' property on \'DOMStringMap\': \'data-foo\uF900\' is not a valid attribute name."'); debug(""); function testDelete(attr, prop)
diff --git a/third_party/blink/web_tests/fast/dom/setter-type-enforcement-expected.txt b/third_party/blink/web_tests/fast/dom/setter-type-enforcement-expected.txt index c4229739..59afcd0 100644 --- a/third_party/blink/web_tests/fast/dom/setter-type-enforcement-expected.txt +++ b/third_party/blink/web_tests/fast/dom/setter-type-enforcement-expected.txt
@@ -2,7 +2,7 @@ On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". -PASS document.body = nodelist; threw exception TypeError: Failed to set the 'body' property on 'Document': Failed to convert value to 'HTMLElement'.. +PASS document.body = nodelist; threw exception TypeError: Failed to set the 'body' property on 'Document': The provided value is not of type 'HTMLElement'.. PASS successfullyParsed is true TEST COMPLETE
diff --git a/third_party/blink/web_tests/fast/events/constructors/event-constructors-expected.txt b/third_party/blink/web_tests/fast/events/constructors/event-constructors-expected.txt index b7ff3cf..079d34b 100644 --- a/third_party/blink/web_tests/fast/events/constructors/event-constructors-expected.txt +++ b/third_party/blink/web_tests/fast/events/constructors/event-constructors-expected.txt
@@ -20,7 +20,7 @@ PASS (new Event('eventType', null)).cancelable is false PASS (new Event('eventType', undefined)).bubbles is false PASS (new Event('eventType', undefined)).cancelable is false -PASS new Event('eventType', 0) threw exception TypeError: Failed to construct 'Event': cannot convert to dictionary.. +PASS new Event('eventType', 0) threw exception TypeError: Failed to construct 'Event': parameter 2 ('eventInitDict') is not an object.. PASS (new Event('eventType', window)).bubbles is false PASS (new Event('eventType', window)).cancelable is false PASS (new Event('eventType', window)).bubbles is true
diff --git a/third_party/blink/web_tests/fast/files/url-null-expected.txt b/third_party/blink/web_tests/fast/files/url-null-expected.txt index f9fc5d25..681eb428 100644 --- a/third_party/blink/web_tests/fast/files/url-null-expected.txt +++ b/third_party/blink/web_tests/fast/files/url-null-expected.txt
@@ -2,8 +2,8 @@ On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". -PASS URL.createObjectURL(null) threw exception TypeError: Failed to execute 'createObjectURL' on 'URL': Overload resolution failed.. -PASS URL.createObjectURL(undefined) threw exception TypeError: Failed to execute 'createObjectURL' on 'URL': Overload resolution failed.. +PASS URL.createObjectURL(null) threw exception TypeError: Failed to execute 'createObjectURL' on 'URL': No function was found that matched the signature provided.. +PASS URL.createObjectURL(undefined) threw exception TypeError: Failed to execute 'createObjectURL' on 'URL': No function was found that matched the signature provided.. PASS URL.revokeObjectURL(null) did not throw exception. PASS URL.revokeObjectURL(undefined) did not throw exception. PASS successfullyParsed is true
diff --git a/third_party/blink/web_tests/fast/filesystem/flags-passing-expected.txt b/third_party/blink/web_tests/fast/filesystem/flags-passing-expected.txt index 29740b2e..94ef5cc 100644 --- a/third_party/blink/web_tests/fast/filesystem/flags-passing-expected.txt +++ b/third_party/blink/web_tests/fast/filesystem/flags-passing-expected.txt
@@ -6,7 +6,7 @@ * Passing JSON Flags object (with exclusive=true). * Passing null as a flags parameter. * Passing a number as a flags parameter. -Caught exception: TypeError: Failed to execute 'getFile' on 'DirectoryEntry': cannot convert to dictionary. +Caught exception: TypeError: Failed to execute 'getFile' on 'DirectoryEntry': parameter 2 ('options') is not an object. Finished running tests. PASS expectedCallbacksCount is 1 PASS unexpectedCallbacksCount is 0
diff --git a/third_party/blink/web_tests/fast/forms/file/input-file-write-files-expected.txt b/third_party/blink/web_tests/fast/forms/file/input-file-write-files-expected.txt index 6e3b98b..e128483 100644 --- a/third_party/blink/web_tests/fast/forms/file/input-file-write-files-expected.txt +++ b/third_party/blink/web_tests/fast/forms/file/input-file-write-files-expected.txt
@@ -3,7 +3,7 @@ On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". PASS file1.files.length is 1 -PASS file1.files = 'foo' threw exception TypeError: Failed to set the 'files' property on 'HTMLInputElement': Failed to convert value to 'FileList'.. +PASS file1.files = 'foo' threw exception TypeError: Failed to set the 'files' property on 'HTMLInputElement': The provided value is not of type 'FileList'.. PASS file1.files.length is 1 PASS file1.files.item(0).name is "foo.txt" PASS file1.files.length is 1
diff --git a/third_party/blink/web_tests/fast/forms/select/collection-setter-getter-expected.txt b/third_party/blink/web_tests/fast/forms/select/collection-setter-getter-expected.txt index d7ced82..db45630 100644 --- a/third_party/blink/web_tests/fast/forms/select/collection-setter-getter-expected.txt +++ b/third_party/blink/web_tests/fast/forms/select/collection-setter-getter-expected.txt
@@ -12,7 +12,7 @@ 4) trying to set an element to a non-Option value: null PASS set_options.length is 3 5) trying to set an element to a non-Option value: form (object of incorrect type) -PASS set_options[10] = my_form threw exception TypeError: Failed to set an indexed property on 'HTMLOptionsCollection': parameter 3 is not of type 'HTMLOptionElement'.. +PASS set_options[10] = my_form threw exception TypeError: Failed to set an indexed property on 'HTMLOptionsCollection': The provided value is not of type 'HTMLOptionElement'.. PASS set_options.length is 3 PASS successfullyParsed is true
diff --git a/third_party/blink/web_tests/fast/forms/select/exceptions-expected.txt b/third_party/blink/web_tests/fast/forms/select/exceptions-expected.txt index ab6ab6b..108821bc 100644 --- a/third_party/blink/web_tests/fast/forms/select/exceptions-expected.txt +++ b/third_party/blink/web_tests/fast/forms/select/exceptions-expected.txt
@@ -2,7 +2,7 @@ On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". -PASS el[1] = 0; threw exception TypeError: Failed to set an indexed property on 'HTMLSelectElement': parameter 3 is not of type 'HTMLOptionElement'.. +PASS el[1] = 0; threw exception TypeError: Failed to set an indexed property on 'HTMLSelectElement': The provided value is not of type 'HTMLOptionElement'.. PASS el.namedItem() threw exception TypeError: Failed to execute 'namedItem' on 'HTMLSelectElement': 1 argument required, but only 0 present.. PASS successfullyParsed is true
diff --git a/third_party/blink/web_tests/fast/forms/select/select-selectedIndex-expected.txt b/third_party/blink/web_tests/fast/forms/select/select-selectedIndex-expected.txt index 514621e..e0f0530 100644 --- a/third_party/blink/web_tests/fast/forms/select/select-selectedIndex-expected.txt +++ b/third_party/blink/web_tests/fast/forms/select/select-selectedIndex-expected.txt
@@ -59,7 +59,7 @@ PASS mySelect.options.length is 10 PASS mySelect.selectedIndex is -1 19) trying to set an element that's not an option: select element -PASS mySelect.options[10] = mySelect; threw exception TypeError: Failed to set an indexed property on 'HTMLOptionsCollection': parameter 3 is not of type 'HTMLOptionElement'.. +PASS mySelect.options[10] = mySelect; threw exception TypeError: Failed to set an indexed property on 'HTMLOptionsCollection': The provided value is not of type 'HTMLOptionElement'.. PASS mySelect.options.length is 10 PASS mySelect.selectedIndex is -1 20) trying to set a option element using an invalid index: negative infinity
diff --git a/third_party/blink/web_tests/fast/forms/select/select-selectedIndex-multiple-expected.txt b/third_party/blink/web_tests/fast/forms/select/select-selectedIndex-multiple-expected.txt index e51ec9d..e10e140b 100644 --- a/third_party/blink/web_tests/fast/forms/select/select-selectedIndex-multiple-expected.txt +++ b/third_party/blink/web_tests/fast/forms/select/select-selectedIndex-multiple-expected.txt
@@ -59,7 +59,7 @@ PASS mySelect.options.length is 10 PASS mySelect.selectedIndex is 0 19) trying to set an element that's not an option: select element -PASS mySelect.options[10] = mySelect; threw exception TypeError: Failed to set an indexed property on 'HTMLOptionsCollection': parameter 3 is not of type 'HTMLOptionElement'.. +PASS mySelect.options[10] = mySelect; threw exception TypeError: Failed to set an indexed property on 'HTMLOptionsCollection': The provided value is not of type 'HTMLOptionElement'.. PASS mySelect.options.length is 10 PASS mySelect.selectedIndex is 0 20) trying to set a option element using an invalid index: negative infinity
diff --git a/third_party/blink/web_tests/fast/js/Promise-bindings-check-exception-expected.txt b/third_party/blink/web_tests/fast/js/Promise-bindings-check-exception-expected.txt index af2a622..c46b88bf 100644 --- a/third_party/blink/web_tests/fast/js/Promise-bindings-check-exception-expected.txt +++ b/third_party/blink/web_tests/fast/js/Promise-bindings-check-exception-expected.txt
@@ -10,7 +10,7 @@ PASS Resolved as expected: convert(boolean) PASS Rejected as expected: type error(Dictionary) PASS reason instanceof Error is true -TypeError: Failed to execute 'promiseCheck' on 'Internals': parameter 3 is not of type 'object'. +TypeError: Failed to execute 'promiseCheck' on 'Internals': Failed to convert value to 'object'. PASS Resolved as expected: convert(String) PASS Rejected as expected: conversion error(toString) PASS reason instanceof Error is true @@ -28,7 +28,7 @@ PASS Resolved as expected: valid arguments PASS Rejected as expected: type error(Dictionary) PASS reason instanceof Error is true -TypeError: Failed to execute 'promiseCheckWithoutExceptionState' on 'Internals': parameter 1 is not of type 'object'. +TypeError: Failed to execute 'promiseCheckWithoutExceptionState' on 'Internals': Failed to convert value to 'object'. PASS Resolved as expected: convert(String...) PASS Rejected as expected: conversion error(String...) PASS reason instanceof Error is true @@ -41,10 +41,10 @@ PASS Resolved as expected: valid argument (Location, long, long) PASS Rejected as expected: type error (Object) PASS reason instanceof Error is true -TypeError: Failed to execute 'promiseCheckOverload' on 'Internals': Overload resolution failed. +TypeError: Failed to execute 'promiseCheckOverload' on 'Internals': No function was found that matched the signature provided. PASS Rejected as expected: type error (Location, long) PASS reason instanceof Error is true -TypeError: Failed to execute 'promiseCheckOverload' on 'Internals': Overload resolution failed. +TypeError: Failed to execute 'promiseCheckOverload' on 'Internals': Valid arities are: [1, 3], but 2 arguments provided. PASS successfullyParsed is true TEST COMPLETE
diff --git a/third_party/blink/web_tests/fast/js/getOwnPropertyDescriptor-expected.txt b/third_party/blink/web_tests/fast/js/getOwnPropertyDescriptor-expected.txt index 5cfaa7b5..81b2aec7 100644 --- a/third_party/blink/web_tests/fast/js/getOwnPropertyDescriptor-expected.txt +++ b/third_party/blink/web_tests/fast/js/getOwnPropertyDescriptor-expected.txt
@@ -33,6 +33,11 @@ PASS Object.getOwnPropertyDescriptor(document.__proto__.__proto__, 'createElement').hasOwnProperty('set') is false PASS Object.getOwnPropertyDescriptor(document.__proto__.__proto__, 'createElement').enumerable is true PASS Object.getOwnPropertyDescriptor(document.__proto__.__proto__, 'createElement').configurable is true +PASS Object.getOwnPropertyDescriptor(window, 'location').value is window.location +PASS Object.getOwnPropertyDescriptor(window, 'location').hasOwnProperty('get') is false +PASS Object.getOwnPropertyDescriptor(window, 'location').hasOwnProperty('set') is false +PASS Object.getOwnPropertyDescriptor(window, 'location').enumerable is true +PASS Object.getOwnPropertyDescriptor(window, 'location').configurable is false PASS Object.getOwnPropertyDescriptor(Number, 'NEGATIVE_INFINITY').value is Number.NEGATIVE_INFINITY PASS Object.getOwnPropertyDescriptor(Number, 'NEGATIVE_INFINITY').hasOwnProperty('get') is false PASS Object.getOwnPropertyDescriptor(Number, 'NEGATIVE_INFINITY').hasOwnProperty('set') is false @@ -118,11 +123,21 @@ PASS Object.getOwnPropertyDescriptor(global, 'Infinity').hasOwnProperty('set') is false PASS Object.getOwnPropertyDescriptor(global, 'Infinity').enumerable is false PASS Object.getOwnPropertyDescriptor(global, 'Infinity').configurable is false +PASS Object.getOwnPropertyDescriptor(global, 'window').value is global +PASS Object.getOwnPropertyDescriptor(global, 'window').hasOwnProperty('get') is false +PASS Object.getOwnPropertyDescriptor(global, 'window').hasOwnProperty('set') is false +PASS Object.getOwnPropertyDescriptor(global, 'window').enumerable is true +PASS Object.getOwnPropertyDescriptor(global, 'window').configurable is false PASS Object.getOwnPropertyDescriptor(global, 'XMLHttpRequest').value is XMLHttpRequest PASS Object.getOwnPropertyDescriptor(global, 'XMLHttpRequest').hasOwnProperty('get') is false PASS Object.getOwnPropertyDescriptor(global, 'XMLHttpRequest').hasOwnProperty('set') is false PASS Object.getOwnPropertyDescriptor(global, 'XMLHttpRequest').enumerable is false PASS Object.getOwnPropertyDescriptor(global, 'XMLHttpRequest').configurable is true +PASS Object.getOwnPropertyDescriptor(global, 'length').value is global.length +PASS Object.getOwnPropertyDescriptor(global, 'length').hasOwnProperty('get') is false +PASS Object.getOwnPropertyDescriptor(global, 'length').hasOwnProperty('set') is false +PASS Object.getOwnPropertyDescriptor(global, 'length').enumerable is true +FAIL Object.getOwnPropertyDescriptor(global, 'length').configurable should be false. Was true. PASS Object.getOwnPropertyDescriptor(global, 0).value is global[0] PASS Object.getOwnPropertyDescriptor(global, 0).hasOwnProperty('get') is false PASS Object.getOwnPropertyDescriptor(global, 0).hasOwnProperty('set') is false
diff --git a/third_party/blink/web_tests/fast/js/resources/getOwnPropertyDescriptor.js b/third_party/blink/web_tests/fast/js/resources/getOwnPropertyDescriptor.js index b27f4aba..f4406c41 100644 --- a/third_party/blink/web_tests/fast/js/resources/getOwnPropertyDescriptor.js +++ b/third_party/blink/web_tests/fast/js/resources/getOwnPropertyDescriptor.js
@@ -24,6 +24,7 @@ descriptorShouldBe("String.prototype", "'concat'", {writable: true, enumerable: false, configurable: true, value:"String.prototype.concat"}); descriptorShouldBe("RegExp.prototype", "'exec'", {writable: true, enumerable: false, configurable: true, value:"RegExp.prototype.exec"}); descriptorShouldBe("document.__proto__.__proto__", "'createElement'", {writable: true, enumerable: true, configurable: true, value:"document.createElement"}); +descriptorShouldBe("window", "'location'", {writable: false, enumerable: true, configurable: false, value: "window.location"}); descriptorShouldBe("Number", "'NEGATIVE_INFINITY'", {writable: false, enumerable: false, configurable: false, value:"Number.NEGATIVE_INFINITY"}); descriptorShouldBe("RegExp", "'$_'", {writable: true, enumerable: false, configurable: true, value:"RegExp.$_"}); descriptorShouldBe("/a/g", "'global'", {writable: true, enumerable: false, configurable: false, value:true}); @@ -42,7 +43,9 @@ descriptorShouldBe("global", "'undefined'", {writable: false, enumerable: false, configurable: false, value:"undefined"}); descriptorShouldBe("global", "'NaN'", {writable: false, enumerable: false, configurable: false, value:"NaN"}); descriptorShouldBe("global", "'Infinity'", {writable: false, enumerable: false, configurable: false, value:"Infinity"}); +descriptorShouldBe("global", "'window'", {writable: false, enumerable: true, configurable: false, value:"global"}); descriptorShouldBe("global", "'XMLHttpRequest'", {writable: true, enumerable: false, configurable: true, value:"XMLHttpRequest"}); +descriptorShouldBe("global", "'length'", {writable: true, enumerable: true, configurable: false, value:"global.length"}); descriptorShouldBe("global", "0", {writable: false, enumerable: true, configurable: true, value:"global[0]"}); var objectWithGetter = {};
diff --git a/third_party/blink/web_tests/fast/mediastream/argument-types-expected.txt b/third_party/blink/web_tests/fast/mediastream/argument-types-expected.txt index d5998ce..b6f91cb 100644 --- a/third_party/blink/web_tests/fast/mediastream/argument-types-expected.txt +++ b/third_party/blink/web_tests/fast/mediastream/argument-types-expected.txt
@@ -8,32 +8,32 @@ PASS navigator.webkitGetUserMedia({video: true}, callbackFunction, callbackFunction) did not throw exception. PASS navigator.webkitGetUserMedia({audio: true}, callbackFunction, callbackFunction) did not throw exception. PASS navigator.webkitGetUserMedia({audio: true, video: true}, callbackFunction, callbackFunction) did not throw exception. -PASS navigator.webkitGetUserMedia(-Infinity, emptyFunction, emptyFunction) threw exception TypeError: Failed to execute 'webkitGetUserMedia' on 'Navigator': cannot convert to dictionary.. -PASS navigator.webkitGetUserMedia(42, emptyFunction, emptyFunction) threw exception TypeError: Failed to execute 'webkitGetUserMedia' on 'Navigator': cannot convert to dictionary.. -PASS navigator.webkitGetUserMedia(Infinity, emptyFunction, emptyFunction) threw exception TypeError: Failed to execute 'webkitGetUserMedia' on 'Navigator': cannot convert to dictionary.. +PASS navigator.webkitGetUserMedia(-Infinity, emptyFunction, emptyFunction) threw exception TypeError: Failed to execute 'webkitGetUserMedia' on 'Navigator': parameter 1 ('constraints') is not an object.. +PASS navigator.webkitGetUserMedia(42, emptyFunction, emptyFunction) threw exception TypeError: Failed to execute 'webkitGetUserMedia' on 'Navigator': parameter 1 ('constraints') is not an object.. +PASS navigator.webkitGetUserMedia(Infinity, emptyFunction, emptyFunction) threw exception TypeError: Failed to execute 'webkitGetUserMedia' on 'Navigator': parameter 1 ('constraints') is not an object.. PASS navigator.webkitGetUserMedia(emptyFunction, emptyFunction, emptyFunction) threw exception TypeError: Failed to execute 'webkitGetUserMedia' on 'Navigator': At least one of audio and video must be requested. PASS navigator.webkitGetUserMedia(null, emptyFunction, emptyFunction) threw exception TypeError: Failed to execute 'webkitGetUserMedia' on 'Navigator': At least one of audio and video must be requested. -PASS navigator.webkitGetUserMedia(true, emptyFunction, emptyFunction) threw exception TypeError: Failed to execute 'webkitGetUserMedia' on 'Navigator': cannot convert to dictionary.. +PASS navigator.webkitGetUserMedia(true, emptyFunction, emptyFunction) threw exception TypeError: Failed to execute 'webkitGetUserMedia' on 'Navigator': parameter 1 ('constraints') is not an object.. PASS navigator.webkitGetUserMedia(undefined, emptyFunction, emptyFunction) threw exception TypeError: Failed to execute 'webkitGetUserMedia' on 'Navigator': At least one of audio and video must be requested. PASS navigator.webkitGetUserMedia({ }, emptyFunction, emptyFunction) threw exception TypeError: Failed to execute 'webkitGetUserMedia' on 'Navigator': At least one of audio and video must be requested. PASS navigator.webkitGetUserMedia({foo: true }, emptyFunction, emptyFunction) threw exception TypeError: Failed to execute 'webkitGetUserMedia' on 'Navigator': At least one of audio and video must be requested. -PASS navigator.webkitGetUserMedia({audio:true, video:true}, emptyFunction, undefined) threw exception TypeError: Failed to execute 'webkitGetUserMedia' on 'Navigator': parameter 3 is not of type 'Function'.. -PASS navigator.webkitGetUserMedia({video: true}, "foobar", emptyFunction) threw exception TypeError: Failed to execute 'webkitGetUserMedia' on 'Navigator': parameter 2 is not of type 'Function'.. -PASS navigator.webkitGetUserMedia({video: true}, -Infinity, emptyFunction) threw exception TypeError: Failed to execute 'webkitGetUserMedia' on 'Navigator': parameter 2 is not of type 'Function'.. -PASS navigator.webkitGetUserMedia({video: true}, 42, emptyFunction) threw exception TypeError: Failed to execute 'webkitGetUserMedia' on 'Navigator': parameter 2 is not of type 'Function'.. -PASS navigator.webkitGetUserMedia({video: true}, Infinity, emptyFunction) threw exception TypeError: Failed to execute 'webkitGetUserMedia' on 'Navigator': parameter 2 is not of type 'Function'.. -PASS navigator.webkitGetUserMedia({video: true}, emptyFunction, "video") threw exception TypeError: Failed to execute 'webkitGetUserMedia' on 'Navigator': parameter 3 is not of type 'Function'.. -PASS navigator.webkitGetUserMedia({video: true}, emptyFunction, -Infinity) threw exception TypeError: Failed to execute 'webkitGetUserMedia' on 'Navigator': parameter 3 is not of type 'Function'.. -PASS navigator.webkitGetUserMedia({video: true}, emptyFunction, 42) threw exception TypeError: Failed to execute 'webkitGetUserMedia' on 'Navigator': parameter 3 is not of type 'Function'.. -PASS navigator.webkitGetUserMedia({video: true}, emptyFunction, Infinity) threw exception TypeError: Failed to execute 'webkitGetUserMedia' on 'Navigator': parameter 3 is not of type 'Function'.. -PASS navigator.webkitGetUserMedia({video: true}, emptyFunction, null) threw exception TypeError: Failed to execute 'webkitGetUserMedia' on 'Navigator': parameter 3 is not of type 'Function'.. -PASS navigator.webkitGetUserMedia({video: true}, emptyFunction, true) threw exception TypeError: Failed to execute 'webkitGetUserMedia' on 'Navigator': parameter 3 is not of type 'Function'.. -PASS navigator.webkitGetUserMedia({video: true}, emptyFunction, undefined) threw exception TypeError: Failed to execute 'webkitGetUserMedia' on 'Navigator': parameter 3 is not of type 'Function'.. -PASS navigator.webkitGetUserMedia({video: true}, emptyFunction, {}) threw exception TypeError: Failed to execute 'webkitGetUserMedia' on 'Navigator': parameter 3 is not of type 'Function'.. -PASS navigator.webkitGetUserMedia({video: true}, null, emptyFunction) threw exception TypeError: Failed to execute 'webkitGetUserMedia' on 'Navigator': parameter 2 is not of type 'Function'.. -PASS navigator.webkitGetUserMedia({video: true}, true, emptyFunction) threw exception TypeError: Failed to execute 'webkitGetUserMedia' on 'Navigator': parameter 2 is not of type 'Function'.. -PASS navigator.webkitGetUserMedia({video: true}, undefined, emptyFunction) threw exception TypeError: Failed to execute 'webkitGetUserMedia' on 'Navigator': parameter 2 is not of type 'Function'.. -PASS navigator.webkitGetUserMedia({video: true}, {}, emptyFunction) threw exception TypeError: Failed to execute 'webkitGetUserMedia' on 'Navigator': parameter 2 is not of type 'Function'.. +PASS navigator.webkitGetUserMedia({audio:true, video:true}, emptyFunction, undefined) threw exception TypeError: Failed to execute 'webkitGetUserMedia' on 'Navigator': The callback provided as parameter 3 is not a function.. +PASS navigator.webkitGetUserMedia({video: true}, "foobar", emptyFunction) threw exception TypeError: Failed to execute 'webkitGetUserMedia' on 'Navigator': The callback provided as parameter 2 is not a function.. +PASS navigator.webkitGetUserMedia({video: true}, -Infinity, emptyFunction) threw exception TypeError: Failed to execute 'webkitGetUserMedia' on 'Navigator': The callback provided as parameter 2 is not a function.. +PASS navigator.webkitGetUserMedia({video: true}, 42, emptyFunction) threw exception TypeError: Failed to execute 'webkitGetUserMedia' on 'Navigator': The callback provided as parameter 2 is not a function.. +PASS navigator.webkitGetUserMedia({video: true}, Infinity, emptyFunction) threw exception TypeError: Failed to execute 'webkitGetUserMedia' on 'Navigator': The callback provided as parameter 2 is not a function.. +PASS navigator.webkitGetUserMedia({video: true}, emptyFunction, "video") threw exception TypeError: Failed to execute 'webkitGetUserMedia' on 'Navigator': The callback provided as parameter 3 is not a function.. +PASS navigator.webkitGetUserMedia({video: true}, emptyFunction, -Infinity) threw exception TypeError: Failed to execute 'webkitGetUserMedia' on 'Navigator': The callback provided as parameter 3 is not a function.. +PASS navigator.webkitGetUserMedia({video: true}, emptyFunction, 42) threw exception TypeError: Failed to execute 'webkitGetUserMedia' on 'Navigator': The callback provided as parameter 3 is not a function.. +PASS navigator.webkitGetUserMedia({video: true}, emptyFunction, Infinity) threw exception TypeError: Failed to execute 'webkitGetUserMedia' on 'Navigator': The callback provided as parameter 3 is not a function.. +PASS navigator.webkitGetUserMedia({video: true}, emptyFunction, null) threw exception TypeError: Failed to execute 'webkitGetUserMedia' on 'Navigator': The callback provided as parameter 3 is not a function.. +PASS navigator.webkitGetUserMedia({video: true}, emptyFunction, true) threw exception TypeError: Failed to execute 'webkitGetUserMedia' on 'Navigator': The callback provided as parameter 3 is not a function.. +PASS navigator.webkitGetUserMedia({video: true}, emptyFunction, undefined) threw exception TypeError: Failed to execute 'webkitGetUserMedia' on 'Navigator': The callback provided as parameter 3 is not a function.. +PASS navigator.webkitGetUserMedia({video: true}, emptyFunction, {}) threw exception TypeError: Failed to execute 'webkitGetUserMedia' on 'Navigator': The callback provided as parameter 3 is not a function.. +PASS navigator.webkitGetUserMedia({video: true}, null, emptyFunction) threw exception TypeError: Failed to execute 'webkitGetUserMedia' on 'Navigator': The callback provided as parameter 2 is not a function.. +PASS navigator.webkitGetUserMedia({video: true}, true, emptyFunction) threw exception TypeError: Failed to execute 'webkitGetUserMedia' on 'Navigator': The callback provided as parameter 2 is not a function.. +PASS navigator.webkitGetUserMedia({video: true}, undefined, emptyFunction) threw exception TypeError: Failed to execute 'webkitGetUserMedia' on 'Navigator': The callback provided as parameter 2 is not a function.. +PASS navigator.webkitGetUserMedia({video: true}, {}, emptyFunction) threw exception TypeError: Failed to execute 'webkitGetUserMedia' on 'Navigator': The callback provided as parameter 2 is not a function.. PASS successfullyParsed is true TEST COMPLETE
diff --git a/third_party/blink/web_tests/fast/peerconnection/RTCPeerConnection-expected.txt b/third_party/blink/web_tests/fast/peerconnection/RTCPeerConnection-expected.txt index fd69d8b..e53daa9 100644 --- a/third_party/blink/web_tests/fast/peerconnection/RTCPeerConnection-expected.txt +++ b/third_party/blink/web_tests/fast/peerconnection/RTCPeerConnection-expected.txt
@@ -11,7 +11,7 @@ PASS new RTCPeerConnection(undefined); did not throw exception. PASS new RTCPeerConnection({}); did not throw exception. PASS new RTCPeerConnection(); did not throw exception. -PASS new RTCPeerConnection(''); threw exception TypeError: Failed to construct 'RTCPeerConnection': cannot convert to dictionary.. +PASS new RTCPeerConnection(''); threw exception TypeError: Failed to construct 'RTCPeerConnection': parameter 1 ('configuration') is not an object.. PASS new RTCPeerConnection({iceServers:[]}); did not throw exception. PASS new RTCPeerConnection({iceServers:[{url:'stun:foo.com'}]}); did not throw exception. PASS new RTCPeerConnection({iceServers:[{url:'turn:foo.com', username:'x', credential:'x'}]}); did not throw exception.
diff --git a/third_party/blink/web_tests/fast/peerconnection/RTCSessionDescription-expected.txt b/third_party/blink/web_tests/fast/peerconnection/RTCSessionDescription-expected.txt index 31b17aac..e348671 100644 --- a/third_party/blink/web_tests/fast/peerconnection/RTCSessionDescription-expected.txt +++ b/third_party/blink/web_tests/fast/peerconnection/RTCSessionDescription-expected.txt
@@ -11,8 +11,8 @@ PASS sessionDescription.sdp is "foobar" PASS new RTCSessionDescription(); did not throw exception. PASS new RTCSessionDescription({}); did not throw exception. -PASS new RTCSessionDescription(5); threw exception TypeError: Failed to construct 'RTCSessionDescription': cannot convert to dictionary.. -PASS new RTCSessionDescription('foobar'); threw exception TypeError: Failed to construct 'RTCSessionDescription': cannot convert to dictionary.. +PASS new RTCSessionDescription(5); threw exception TypeError: Failed to construct 'RTCSessionDescription': parameter 1 ('descriptionInitDict') is not an object.. +PASS new RTCSessionDescription('foobar'); threw exception TypeError: Failed to construct 'RTCSessionDescription': parameter 1 ('descriptionInitDict') is not an object.. PASS new RTCSessionDescription({type:'foobar', sdp:'x'}); threw exception TypeError: Failed to construct 'RTCSessionDescription': The provided value 'foobar' is not a valid enum value of type RTCSdpType.. PASS new RTCSessionDescription({type:'offer', sdp:''}); did not throw exception. PASS new RTCSessionDescription({type:'offer', sdp:'x'}); did not throw exception.
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/basic/001-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/basic/001-expected.png new file mode 100644 index 0000000..85c1365 --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/basic/001-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/basic/002-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/basic/002-expected.png new file mode 100644 index 0000000..e7ef917 --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/basic/002-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/basic/003-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/basic/003-expected.png new file mode 100644 index 0000000..9dc3625 --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/basic/003-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/basic/004-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/basic/004-expected.png new file mode 100644 index 0000000..3242ad5 --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/basic/004-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/basic/005-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/basic/005-expected.png new file mode 100644 index 0000000..11b16ef5 --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/basic/005-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/basic/006-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/basic/006-expected.png new file mode 100644 index 0000000..54d3e37f --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/basic/006-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/basic/007-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/basic/007-expected.png new file mode 100644 index 0000000..97d40049 --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/basic/007-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/basic/008-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/basic/008-expected.png new file mode 100644 index 0000000..b58e128 --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/basic/008-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/basic/009-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/basic/009-expected.png new file mode 100644 index 0000000..54d3e37f --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/basic/009-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/basic/010-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/basic/010-expected.png new file mode 100644 index 0000000..12524630 --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/basic/010-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/basic/011-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/basic/011-expected.png new file mode 100644 index 0000000..f1f900f --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/basic/011-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/basic/012-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/basic/012-expected.png new file mode 100644 index 0000000..b2358b5 --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/basic/012-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/basic/013-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/basic/013-expected.png new file mode 100644 index 0000000..5c3cca7 --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/basic/013-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/basic/014-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/basic/014-expected.png new file mode 100644 index 0000000..029b70a --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/basic/014-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/basic/015-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/basic/015-expected.png new file mode 100644 index 0000000..f9d92f3 --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/basic/015-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/basic/016-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/basic/016-expected.png new file mode 100644 index 0000000..d9402d8 --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/basic/016-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/basic/018-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/basic/018-expected.png new file mode 100644 index 0000000..efe9cc3 --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/basic/018-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/basic/019-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/basic/019-expected.png new file mode 100644 index 0000000..e730c00 --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/basic/019-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/basic/020-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/basic/020-expected.png new file mode 100644 index 0000000..01b72ed --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/basic/020-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/basic/021-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/basic/021-expected.png new file mode 100644 index 0000000..2f347172 --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/basic/021-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/basic/adding-near-anonymous-block-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/basic/adding-near-anonymous-block-expected.png new file mode 100644 index 0000000..c8d5b97 --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/basic/adding-near-anonymous-block-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/basic/fieldset-stretch-to-legend-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/basic/fieldset-stretch-to-legend-expected.png new file mode 100644 index 0000000..81f3e0e --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/basic/fieldset-stretch-to-legend-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/basic/min-pref-width-nowrap-floats-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/basic/min-pref-width-nowrap-floats-expected.png new file mode 100644 index 0000000..db1be9146 --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/basic/min-pref-width-nowrap-floats-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/basic/minheight-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/basic/minheight-expected.png new file mode 100644 index 0000000..c5d4c68e --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/basic/minheight-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/basic/percent-height-inside-anonymous-block-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/basic/percent-height-inside-anonymous-block-expected.png new file mode 100644 index 0000000..4037896 --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/basic/percent-height-inside-anonymous-block-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/basic/quirk-height-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/basic/quirk-height-expected.png new file mode 100644 index 0000000..e1e7637 --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/basic/quirk-height-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/basic/quirk-percent-height-grandchild-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/basic/quirk-percent-height-grandchild-expected.png new file mode 100644 index 0000000..626a5c7 --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/basic/quirk-percent-height-grandchild-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/basic/quirk-percent-height-table-cell-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/basic/quirk-percent-height-table-cell-expected.png new file mode 100644 index 0000000..e35d8036 --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/basic/quirk-percent-height-table-cell-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/basic/text-indent-rtl-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/basic/text-indent-rtl-expected.png new file mode 100644 index 0000000..a3fa72c --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/basic/text-indent-rtl-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/basic/truncation-rtl-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/basic/truncation-rtl-expected.png new file mode 100644 index 0000000..af70022 --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/basic/truncation-rtl-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/basic/white-space-pre-wraps-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/basic/white-space-pre-wraps-expected.png new file mode 100644 index 0000000..586fa46a --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/basic/white-space-pre-wraps-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/do-not-strip-anonymous-blocks-when-block-child-becomes-float-and-continuation-on-line-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/do-not-strip-anonymous-blocks-when-block-child-becomes-float-and-continuation-on-line-expected.png new file mode 100644 index 0000000..9375de5c --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/do-not-strip-anonymous-blocks-when-block-child-becomes-float-and-continuation-on-line-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/do-not-strip-anonymous-blocks-when-block-child-becomes-float-and-other-block-on-line-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/do-not-strip-anonymous-blocks-when-block-child-becomes-float-and-other-block-on-line-expected.png new file mode 100644 index 0000000..d535d660 --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/do-not-strip-anonymous-blocks-when-block-child-becomes-float-and-other-block-on-line-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/001-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/001-expected.png new file mode 100644 index 0000000..6b4ece1a --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/001-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/002-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/002-expected.png new file mode 100644 index 0000000..a6c66dd --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/002-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/003-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/003-expected.png new file mode 100644 index 0000000..f2e4513 --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/003-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/004-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/004-expected.png new file mode 100644 index 0000000..09effadc --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/004-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/005-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/005-expected.png new file mode 100644 index 0000000..31e9bd65 --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/005-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/006-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/006-expected.png new file mode 100644 index 0000000..53fc18ce --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/006-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/007-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/007-expected.png new file mode 100644 index 0000000..e2a554e --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/007-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/008-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/008-expected.png new file mode 100644 index 0000000..c54a9a79 --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/008-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/009-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/009-expected.png new file mode 100644 index 0000000..68dc2cd --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/009-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/010-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/010-expected.png new file mode 100644 index 0000000..c9abf728 --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/010-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/011-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/011-expected.png new file mode 100644 index 0000000..0b4d88d --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/011-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/012-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/012-expected.png new file mode 100644 index 0000000..32fe44b --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/012-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/013-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/013-expected.png new file mode 100644 index 0000000..815b4c8 --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/013-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/014-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/014-expected.png new file mode 100644 index 0000000..f6b222a --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/014-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/015-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/015-expected.png new file mode 100644 index 0000000..8cca453c --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/015-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/016-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/016-expected.png new file mode 100644 index 0000000..795a76e --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/016-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/017-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/017-expected.png new file mode 100644 index 0000000..bf198e4 --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/017-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/018-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/018-expected.png new file mode 100644 index 0000000..a6961ad9 --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/018-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/019-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/019-expected.png new file mode 100644 index 0000000..01d855c --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/019-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/020-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/020-expected.png new file mode 100644 index 0000000..a375265 --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/020-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/021-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/021-expected.png new file mode 100644 index 0000000..d65c47b --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/021-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/022-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/022-expected.png new file mode 100644 index 0000000..813f4cd8 --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/022-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/023-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/023-expected.png new file mode 100644 index 0000000..872672d1 --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/023-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/024-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/024-expected.png new file mode 100644 index 0000000..d6dae75 --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/024-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/025-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/025-expected.png new file mode 100644 index 0000000..92fa266d --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/025-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/026-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/026-expected.png new file mode 100644 index 0000000..d2d8d8b --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/026-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/027-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/027-expected.png new file mode 100644 index 0000000..92fa266d --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/027-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/028-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/028-expected.png new file mode 100644 index 0000000..d2d8d8b --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/028-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/029-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/029-expected.png new file mode 100644 index 0000000..b55a9a18e7 --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/029-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/030-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/030-expected.png new file mode 100644 index 0000000..b9959e2c --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/030-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/031-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/031-expected.png new file mode 100644 index 0000000..1ab16c6 --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/031-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/032-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/032-expected.png new file mode 100644 index 0000000..1089080 --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/032-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/033-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/033-expected.png new file mode 100644 index 0000000..54c1b77 --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/033-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/034-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/034-expected.png new file mode 100644 index 0000000..71e902c --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/034-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/035-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/035-expected.png new file mode 100644 index 0000000..7cdaf29 --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/035-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/4145535Crash-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/4145535Crash-expected.png new file mode 100644 index 0000000..0ad21d1d --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/4145535Crash-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/add-inline-between-floats-with-preceding-anonymous-box-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/add-inline-between-floats-with-preceding-anonymous-box-expected.png new file mode 100644 index 0000000..1988f25 --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/add-inline-between-floats-with-preceding-anonymous-box-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/add-inline-to-block-flow-with-block-children-that-do-not-need-anonymous-boxes-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/add-inline-to-block-flow-with-block-children-that-do-not-need-anonymous-boxes-expected.png new file mode 100644 index 0000000..75199d7 --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/add-inline-to-block-flow-with-block-children-that-do-not-need-anonymous-boxes-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/avoidance-percent-width-compat-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/avoidance-percent-width-compat-expected.png new file mode 100644 index 0000000..8bf7cab --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/avoidance-percent-width-compat-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/avoidance-percent-width-strict-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/avoidance-percent-width-strict-expected.png new file mode 100644 index 0000000..0c47dc52 --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/avoidance-percent-width-strict-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/avoidance-rtl-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/avoidance-rtl-expected.png new file mode 100644 index 0000000..0cb0ab05 --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/avoidance-rtl-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/avoiding-float-centered-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/avoiding-float-centered-expected.png new file mode 100644 index 0000000..09ab2a3 --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/avoiding-float-centered-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/br-with-clear-2-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/br-with-clear-2-expected.png new file mode 100644 index 0000000..3408d413 --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/br-with-clear-2-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/br-with-clear-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/br-with-clear-expected.png new file mode 100644 index 0000000..626a5c7 --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/br-with-clear-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/centered-float-avoidance-complexity-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/centered-float-avoidance-complexity-expected.png new file mode 100644 index 0000000..be21c0f --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/centered-float-avoidance-complexity-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/clamped-right-float-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/clamped-right-float-expected.png new file mode 100644 index 0000000..bf4bfcd --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/clamped-right-float-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/clear-element-too-wide-for-containing-block-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/clear-element-too-wide-for-containing-block-expected.png new file mode 100644 index 0000000..672c3ef --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/clear-element-too-wide-for-containing-block-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/clear-to-fit-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/clear-to-fit-expected.png new file mode 100644 index 0000000..8000a8e --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/clear-to-fit-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/dynamic-unfloat-pref-width-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/dynamic-unfloat-pref-width-expected.png new file mode 100644 index 0000000..3954af6 --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/dynamic-unfloat-pref-width-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/editable-text-overlapping-float-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/editable-text-overlapping-float-expected.png new file mode 100644 index 0000000..464fdbe --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/editable-text-overlapping-float-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/fit_line_below_floats-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/fit_line_below_floats-expected.png new file mode 100644 index 0000000..c6bfbf0 --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/fit_line_below_floats-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/float-avoidance-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/float-avoidance-expected.png new file mode 100644 index 0000000..b29cb91f --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/float-avoidance-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/float-forced-below-other-floats-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/float-forced-below-other-floats-expected.png new file mode 100644 index 0000000..e4aa954 --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/float-forced-below-other-floats-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/float-in-float-hit-testing-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/float-in-float-hit-testing-expected.png new file mode 100644 index 0000000..b3a27f66 --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/float-in-float-hit-testing-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/float-in-float-painting-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/float-in-float-painting-expected.png new file mode 100644 index 0000000..84c55ef --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/float-in-float-painting-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/float-not-removed-from-next-sibling-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/float-not-removed-from-next-sibling-expected.png new file mode 100644 index 0000000..1aca454 --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/float-not-removed-from-next-sibling-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/float-not-removed-from-next-sibling2-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/float-not-removed-from-next-sibling2-expected.png new file mode 100644 index 0000000..1aca454 --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/float-not-removed-from-next-sibling2-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/float-not-removed-from-next-sibling3-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/float-not-removed-from-next-sibling3-expected.png new file mode 100644 index 0000000..d945ece --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/float-not-removed-from-next-sibling3-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/float-on-zero-height-line-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/float-on-zero-height-line-expected.png new file mode 100644 index 0000000..673d7079 --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/float-on-zero-height-line-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/float-overflow-hidden-containing-block-width-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/float-overflow-hidden-containing-block-width-expected.png new file mode 100644 index 0000000..73a6823 --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/float-overflow-hidden-containing-block-width-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/float-overhangs-root-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/float-overhangs-root-expected.png new file mode 100644 index 0000000..93e8d2f7 --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/float-overhangs-root-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/floats-and-text-indent-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/floats-and-text-indent-expected.png new file mode 100644 index 0000000..30ca09de --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/floats-and-text-indent-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/floats-and-text-indent-rl-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/floats-and-text-indent-rl-expected.png new file mode 100644 index 0000000..733a46b --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/floats-and-text-indent-rl-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/in-margin-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/in-margin-expected.png new file mode 100644 index 0000000..9fd6b840 --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/in-margin-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/independent-align-positioning-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/independent-align-positioning-expected.png new file mode 100644 index 0000000..db756ac8 --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/independent-align-positioning-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/intruding-float-add-in-sibling-block-on-static-position-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/intruding-float-add-in-sibling-block-on-static-position-expected.png new file mode 100644 index 0000000..f18887c4 --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/intruding-float-add-in-sibling-block-on-static-position-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/intruding-float-add-in-sibling-block-on-static-position2-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/intruding-float-add-in-sibling-block-on-static-position2-expected.png new file mode 100644 index 0000000..f18887c4 --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/intruding-float-add-in-sibling-block-on-static-position2-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/intruding-float-remove-from-sibling-block-on-absolute-position-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/intruding-float-remove-from-sibling-block-on-absolute-position-expected.png new file mode 100644 index 0000000..a26a0ac --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/intruding-float-remove-from-sibling-block-on-absolute-position-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/intruding-float-remove-from-sibling-block-on-absolute-position2-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/intruding-float-remove-from-sibling-block-on-absolute-position2-expected.png new file mode 100644 index 0000000..a26a0ac --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/intruding-float-remove-from-sibling-block-on-absolute-position2-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/intruding-float-remove-from-sibling-block-on-fixed-position-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/intruding-float-remove-from-sibling-block-on-fixed-position-expected.png new file mode 100644 index 0000000..a26a0ac --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/intruding-float-remove-from-sibling-block-on-fixed-position-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/intruding-float-remove-from-sibling-block-on-fixed-position2-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/intruding-float-remove-from-sibling-block-on-fixed-position2-expected.png new file mode 100644 index 0000000..a26a0ac --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/intruding-float-remove-from-sibling-block-on-fixed-position2-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/intruding-painted-twice-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/intruding-painted-twice-expected.png new file mode 100644 index 0000000..3afd322 --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/intruding-painted-twice-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/marquee-shrink-to-avoid-floats-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/marquee-shrink-to-avoid-floats-expected.png new file mode 100644 index 0000000..48c0c64 --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/marquee-shrink-to-avoid-floats-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/multiple-float-positioning-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/multiple-float-positioning-expected.png new file mode 100644 index 0000000..c3df170 --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/multiple-float-positioning-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/narrow-after-wide-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/narrow-after-wide-expected.png new file mode 100644 index 0000000..9a5ff00 --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/narrow-after-wide-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/negative-margin-clear-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/negative-margin-clear-expected.png new file mode 100644 index 0000000..2fc26aa --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/negative-margin-clear-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/nested-clearance-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/nested-clearance-expected.png new file mode 100644 index 0000000..3799a2f --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/nested-clearance-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/nestedAnonymousBlocks-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/nestedAnonymousBlocks-expected.png new file mode 100644 index 0000000..ce1eb11 --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/nestedAnonymousBlocks-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/nestedAnonymousBlocks2-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/nestedAnonymousBlocks2-expected.png new file mode 100644 index 0000000..c326fcc --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/nestedAnonymousBlocks2-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/nopaint-after-layer-destruction-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/nopaint-after-layer-destruction-expected.png new file mode 100644 index 0000000..1ec9112778 --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/nopaint-after-layer-destruction-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/nopaint-after-layer-destruction2-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/nopaint-after-layer-destruction2-expected.png new file mode 100644 index 0000000..901e74da --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/nopaint-after-layer-destruction2-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/nowrap-clear-min-width-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/nowrap-clear-min-width-expected.png new file mode 100644 index 0000000..626a5c7 --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/nowrap-clear-min-width-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/overhanging-after-height-decrease-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/overhanging-after-height-decrease-expected.png new file mode 100644 index 0000000..84075cf6 --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/overhanging-after-height-decrease-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/overhanging-after-height-decrease-offsets-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/overhanging-after-height-decrease-offsets-expected.png new file mode 100644 index 0000000..460e2add --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/overhanging-after-height-decrease-offsets-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/overhanging-float-add-in-static-position-block-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/overhanging-float-add-in-static-position-block-expected.png new file mode 100644 index 0000000..f18887c4 --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/overhanging-float-add-in-static-position-block-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/overhanging-float-add-in-static-position-block2-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/overhanging-float-add-in-static-position-block2-expected.png new file mode 100644 index 0000000..f18887c4 --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/overhanging-float-add-in-static-position-block2-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/overhanging-float-remove-from-absolute-position-block-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/overhanging-float-remove-from-absolute-position-block-expected.png new file mode 100644 index 0000000..9f956504 --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/overhanging-float-remove-from-absolute-position-block-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/overhanging-float-remove-from-absolute-position-block2-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/overhanging-float-remove-from-absolute-position-block2-expected.png new file mode 100644 index 0000000..9f956504 --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/overhanging-float-remove-from-absolute-position-block2-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/overhanging-float-remove-from-fixed-position-block-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/overhanging-float-remove-from-fixed-position-block-expected.png new file mode 100644 index 0000000..d899b3fb --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/overhanging-float-remove-from-fixed-position-block-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/overhanging-float-remove-from-fixed-position-block2-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/overhanging-float-remove-from-fixed-position-block2-expected.png new file mode 100644 index 0000000..d899b3fb --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/overhanging-float-remove-from-fixed-position-block2-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/overhanging-tall-block-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/overhanging-tall-block-expected.png new file mode 100644 index 0000000..9875b0d --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/overhanging-tall-block-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/overlapping-floats-with-overflow-hidden-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/overlapping-floats-with-overflow-hidden-expected.png new file mode 100644 index 0000000..7ece924 --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/overlapping-floats-with-overflow-hidden-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/relative-painted-twice-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/relative-painted-twice-expected.png new file mode 100644 index 0000000..b5adb67 --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/relative-painted-twice-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/shrink-to-avoid-float-complexity-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/shrink-to-avoid-float-complexity-expected.png new file mode 100644 index 0000000..6249ff7 --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/shrink-to-avoid-float-complexity-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/shrink-to-fit-width-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/shrink-to-fit-width-expected.png new file mode 100644 index 0000000..6a77157 --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/shrink-to-fit-width-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/table-relayout-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/table-relayout-expected.png new file mode 100644 index 0000000..73a1e98e --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/table-relayout-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/vertical-move-relayout-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/vertical-move-relayout-expected.png new file mode 100644 index 0000000..a3c2df2 --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/vertical-move-relayout-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/width-update-after-clear-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/width-update-after-clear-expected.png new file mode 100644 index 0000000..8a060e4 --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/float/width-update-after-clear-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/line-layout/negative-max-height-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/line-layout/negative-max-height-expected.png new file mode 100644 index 0000000..626a5c7 --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/line-layout/negative-max-height-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/margin-collapse/001-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/margin-collapse/001-expected.png new file mode 100644 index 0000000..b23170f --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/margin-collapse/001-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/margin-collapse/002-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/margin-collapse/002-expected.png new file mode 100644 index 0000000..5402b53 --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/margin-collapse/002-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/margin-collapse/003-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/margin-collapse/003-expected.png new file mode 100644 index 0000000..06ec0b4 --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/margin-collapse/003-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/margin-collapse/004-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/margin-collapse/004-expected.png new file mode 100644 index 0000000..5402b53 --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/margin-collapse/004-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/margin-collapse/005-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/margin-collapse/005-expected.png new file mode 100644 index 0000000..b23170f --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/margin-collapse/005-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/margin-collapse/block-inside-inline/006-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/margin-collapse/006-expected.png similarity index 100% rename from third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/margin-collapse/block-inside-inline/006-expected.png rename to third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/margin-collapse/006-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/margin-collapse/010-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/margin-collapse/010-expected.png new file mode 100644 index 0000000..ed7ac711 --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/margin-collapse/010-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/margin-collapse/011-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/margin-collapse/011-expected.png new file mode 100644 index 0000000..ed7ac711 --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/margin-collapse/011-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/margin-collapse/012-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/margin-collapse/012-expected.png new file mode 100644 index 0000000..7657582 --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/margin-collapse/012-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/margin-collapse/015-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/margin-collapse/015-expected.png new file mode 100644 index 0000000..754674f4 --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/margin-collapse/015-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/margin-collapse/016-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/margin-collapse/016-expected.png new file mode 100644 index 0000000..4799ea48 --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/margin-collapse/016-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/margin-collapse/017-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/margin-collapse/017-expected.png new file mode 100644 index 0000000..89fce59 --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/margin-collapse/017-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/margin-collapse/018-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/margin-collapse/018-expected.png new file mode 100644 index 0000000..b2bbd01 --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/margin-collapse/018-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/margin-collapse/019-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/margin-collapse/019-expected.png new file mode 100644 index 0000000..cb388bb --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/margin-collapse/019-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/margin-collapse/020-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/margin-collapse/020-expected.png new file mode 100644 index 0000000..83420849 --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/margin-collapse/020-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/margin-collapse/021-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/margin-collapse/021-expected.png new file mode 100644 index 0000000..ae88020 --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/margin-collapse/021-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/margin-collapse/022-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/margin-collapse/022-expected.png new file mode 100644 index 0000000..ae88020 --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/margin-collapse/022-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/margin-collapse/025-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/margin-collapse/025-expected.png new file mode 100644 index 0000000..ae88020 --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/margin-collapse/025-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/margin-collapse/026-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/margin-collapse/026-expected.png new file mode 100644 index 0000000..a29aae57 --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/margin-collapse/026-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/margin-collapse/027-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/margin-collapse/027-expected.png new file mode 100644 index 0000000..9629b659 --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/margin-collapse/027-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/margin-collapse/028-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/margin-collapse/028-expected.png new file mode 100644 index 0000000..a29aae57 --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/margin-collapse/028-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/margin-collapse/029-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/margin-collapse/029-expected.png new file mode 100644 index 0000000..a29aae57 --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/margin-collapse/029-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/margin-collapse/032-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/margin-collapse/032-expected.png new file mode 100644 index 0000000..9d862c5 --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/margin-collapse/032-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/margin-collapse/033-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/margin-collapse/033-expected.png new file mode 100644 index 0000000..65cc107 --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/margin-collapse/033-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/margin-collapse/034-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/margin-collapse/034-expected.png new file mode 100644 index 0000000..220f909 --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/margin-collapse/034-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/margin-collapse/035-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/margin-collapse/035-expected.png new file mode 100644 index 0000000..a29aae57 --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/margin-collapse/035-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/margin-collapse/037-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/margin-collapse/037-expected.png new file mode 100644 index 0000000..6b0163a35 --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/margin-collapse/037-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/margin-collapse/039-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/margin-collapse/039-expected.png new file mode 100644 index 0000000..281a09e --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/margin-collapse/039-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/margin-collapse/040-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/margin-collapse/040-expected.png new file mode 100644 index 0000000..281a09e --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/margin-collapse/040-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/margin-collapse/041-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/margin-collapse/041-expected.png new file mode 100644 index 0000000..b2199d8 --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/margin-collapse/041-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/margin-collapse/042-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/margin-collapse/042-expected.png new file mode 100644 index 0000000..9c99c3d --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/margin-collapse/042-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/margin-collapse/043-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/margin-collapse/043-expected.png new file mode 100644 index 0000000..3319e34f --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/margin-collapse/043-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/margin-collapse/044-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/margin-collapse/044-expected.png new file mode 100644 index 0000000..a9f4d9f --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/margin-collapse/044-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/margin-collapse/045-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/margin-collapse/045-expected.png new file mode 100644 index 0000000..b913210 --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/margin-collapse/045-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/margin-collapse/055-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/margin-collapse/055-expected.png new file mode 100644 index 0000000..84c0c1d --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/margin-collapse/055-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/margin-collapse/056-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/margin-collapse/056-expected.png new file mode 100644 index 0000000..d7daffb8 --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/margin-collapse/056-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/margin-collapse/057-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/margin-collapse/057-expected.png new file mode 100644 index 0000000..697dafc --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/margin-collapse/057-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/margin-collapse/058-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/margin-collapse/058-expected.png new file mode 100644 index 0000000..cc8b125 --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/margin-collapse/058-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/margin-collapse/059-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/margin-collapse/059-expected.png new file mode 100644 index 0000000..01abd6b --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/margin-collapse/059-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/margin-collapse/062-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/margin-collapse/062-expected.png new file mode 100644 index 0000000..4a4a68a --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/margin-collapse/062-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/margin-collapse/063-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/margin-collapse/063-expected.png new file mode 100644 index 0000000..07fbde01 --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/margin-collapse/063-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/margin-collapse/100-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/margin-collapse/100-expected.png new file mode 100644 index 0000000..c9d50e5 --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/margin-collapse/100-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/margin-collapse/101-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/margin-collapse/101-expected.png new file mode 100644 index 0000000..f1487cba --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/margin-collapse/101-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/margin-collapse/102-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/margin-collapse/102-expected.png new file mode 100644 index 0000000..baede28 --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/margin-collapse/102-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/margin-collapse/103-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/margin-collapse/103-expected.png new file mode 100644 index 0000000..15df831 --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/margin-collapse/103-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/margin-collapse/104-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/margin-collapse/104-expected.png new file mode 100644 index 0000000..3bad75ff --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/margin-collapse/104-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/margin-collapse/empty-clear-blocks-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/margin-collapse/empty-clear-blocks-expected.png new file mode 100644 index 0000000..1e328122 --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/margin-collapse/empty-clear-blocks-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/margin-collapse/negative-margins-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/margin-collapse/negative-margins-expected.png new file mode 100644 index 0000000..14edb87 --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/margin-collapse/negative-margins-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/001-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/001-expected.png new file mode 100644 index 0000000..0f6c3cb --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/001-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/003-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/003-expected.png new file mode 100644 index 0000000..626a5c7 --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/003-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/004-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/004-expected.png new file mode 100644 index 0000000..626a5c7 --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/004-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/005-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/005-expected.png new file mode 100644 index 0000000..87973882 --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/005-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/006-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/006-expected.png new file mode 100644 index 0000000..87973882 --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/006-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/007-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/007-expected.png new file mode 100644 index 0000000..626a5c7 --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/007-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/008-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/008-expected.png new file mode 100644 index 0000000..626a5c7 --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/008-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/009-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/009-expected.png new file mode 100644 index 0000000..87973882 --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/009-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/010-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/010-expected.png new file mode 100644 index 0000000..87973882 --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/010-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/011-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/011-expected.png new file mode 100644 index 0000000..87973882 --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/011-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/012-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/012-expected.png new file mode 100644 index 0000000..87973882 --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/012-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/013-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/013-expected.png new file mode 100644 index 0000000..87973882 --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/013-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/014-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/014-expected.png new file mode 100644 index 0000000..626a5c7 --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/014-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/015-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/015-expected.png new file mode 100644 index 0000000..87973882 --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/015-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/016-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/016-expected.png new file mode 100644 index 0000000..a0a5dbb --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/016-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/017-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/017-expected.png new file mode 100644 index 0000000..626a5c7 --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/017-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/018-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/018-expected.png new file mode 100644 index 0000000..626a5c7 --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/018-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/019-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/019-expected.png new file mode 100644 index 0000000..626a5c7 --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/019-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/020-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/020-expected.png new file mode 100644 index 0000000..87973882 --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/020-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/021-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/021-expected.png new file mode 100644 index 0000000..87973882 --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/021-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/022-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/022-expected.png new file mode 100644 index 0000000..87973882 --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/022-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/023-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/023-expected.png new file mode 100644 index 0000000..87973882 --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/023-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/024-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/024-expected.png new file mode 100644 index 0000000..87973882 --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/024-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/025-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/025-expected.png new file mode 100644 index 0000000..a0a5dbb --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/025-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/026-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/026-expected.png new file mode 100644 index 0000000..599a86b --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/026-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/027-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/027-expected.png new file mode 100644 index 0000000..599a86b --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/027-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/028-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/028-expected.png new file mode 100644 index 0000000..599a86b --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/028-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/029-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/029-expected.png new file mode 100644 index 0000000..2bf3a71 --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/029-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/030-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/030-expected.png new file mode 100644 index 0000000..2bf3a71 --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/030-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/031-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/031-expected.png new file mode 100644 index 0000000..2bf3a71 --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/031-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/032-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/032-expected.png new file mode 100644 index 0000000..87973882 --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/032-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/033-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/033-expected.png new file mode 100644 index 0000000..87973882 --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/033-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/034-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/034-expected.png new file mode 100644 index 0000000..87973882 --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/034-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/035-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/035-expected.png new file mode 100644 index 0000000..626a5c7 --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/035-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/036-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/036-expected.png new file mode 100644 index 0000000..87973882 --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/036-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/037-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/037-expected.png new file mode 100644 index 0000000..87973882 --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/037-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/038-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/038-expected.png new file mode 100644 index 0000000..626a5c7 --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/038-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/039-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/039-expected.png new file mode 100644 index 0000000..626a5c7 --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/039-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/040-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/040-expected.png new file mode 100644 index 0000000..79482c5 --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/040-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/041-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/041-expected.png new file mode 100644 index 0000000..87973882 --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/041-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/042-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/042-expected.png new file mode 100644 index 0000000..87973882 --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/042-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/043-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/043-expected.png new file mode 100644 index 0000000..a0a5dbb --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/043-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/044-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/044-expected.png new file mode 100644 index 0000000..87973882 --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/044-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/045-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/045-expected.png new file mode 100644 index 0000000..87973882 --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/045-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/046-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/046-expected.png new file mode 100644 index 0000000..a0a5dbb --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/046-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/047-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/047-expected.png new file mode 100644 index 0000000..39a80d6 --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/047-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/048-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/048-expected.png new file mode 100644 index 0000000..5fefe4de --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/048-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/049-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/049-expected.png new file mode 100644 index 0000000..46b9251 --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/049-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/050-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/050-expected.png new file mode 100644 index 0000000..e444619 --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/050-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/051-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/051-expected.png new file mode 100644 index 0000000..cc93bac9 --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/051-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/052-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/052-expected.png new file mode 100644 index 0000000..545d01d --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/052-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/053-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/053-expected.png new file mode 100644 index 0000000..d338db6 --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/053-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/054-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/054-expected.png new file mode 100644 index 0000000..ff030da --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/054-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/055-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/055-expected.png new file mode 100644 index 0000000..16a1b32f --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/055-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/056-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/056-expected.png new file mode 100644 index 0000000..0753ef9 --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/056-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/057-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/057-expected.png new file mode 100644 index 0000000..23e33be --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/057-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/058-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/058-expected.png new file mode 100644 index 0000000..b8af15d --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/058-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/059-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/059-expected.png new file mode 100644 index 0000000..0d9fc70 --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/059-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/060-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/060-expected.png new file mode 100644 index 0000000..255ab7d --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/060-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/061-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/061-expected.png new file mode 100644 index 0000000..d23a755 --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/061-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/062-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/062-expected.png new file mode 100644 index 0000000..599a86b --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/062-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/abs-inside-inline-rel-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/abs-inside-inline-rel-expected.png new file mode 100644 index 0000000..8563303 --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/abs-inside-inline-rel-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/absolute-in-inline-ltr-2-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/absolute-in-inline-ltr-2-expected.png new file mode 100644 index 0000000..cdd4fc0 --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/absolute-in-inline-ltr-2-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/absolute-in-inline-ltr-3-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/absolute-in-inline-ltr-3-expected.png new file mode 100644 index 0000000..6831ed3 --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/absolute-in-inline-ltr-3-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/absolute-in-inline-ltr-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/absolute-in-inline-ltr-expected.png new file mode 100644 index 0000000..00f5d47 --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/absolute-in-inline-ltr-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/absolute-in-inline-rtl-2-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/absolute-in-inline-rtl-2-expected.png new file mode 100644 index 0000000..ad17260 --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/absolute-in-inline-rtl-2-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/absolute-in-inline-rtl-3-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/absolute-in-inline-rtl-3-expected.png new file mode 100644 index 0000000..7c45a8f --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/absolute-in-inline-rtl-3-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/absolute-in-inline-rtl-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/absolute-in-inline-rtl-expected.png new file mode 100644 index 0000000..d5f071a --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/absolute-in-inline-rtl-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/absolute-in-inline-short-ltr-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/absolute-in-inline-short-ltr-expected.png new file mode 100644 index 0000000..dd5118b --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/absolute-in-inline-short-ltr-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/absolute-in-inline-short-rtl-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/absolute-in-inline-short-rtl-expected.png new file mode 100644 index 0000000..1107b5bc --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/absolute-in-inline-short-rtl-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/absolute-length-of-neg-666666-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/absolute-length-of-neg-666666-expected.png new file mode 100644 index 0000000..420602bb --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/absolute-length-of-neg-666666-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/absolute-position-direction-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/absolute-position-direction-expected.png new file mode 100644 index 0000000..58a6a339 --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/absolute-position-direction-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/absolute-positioned-overconstrained-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/absolute-positioned-overconstrained-expected.png new file mode 100644 index 0000000..ffff81a0 --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/absolute-positioned-overconstrained-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/absolute-positioning-no-scrollbar-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/absolute-positioning-no-scrollbar-expected.png new file mode 100644 index 0000000..d07ac8a --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/absolute-positioning-no-scrollbar-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/absolute-with-html-border-quirks-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/absolute-with-html-border-quirks-expected.png new file mode 100644 index 0000000..451db3f --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/absolute-with-html-border-quirks-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/absolute-with-html-border-strict-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/absolute-with-html-border-strict-expected.png new file mode 100644 index 0000000..9b39d7d4 --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/absolute-with-html-border-strict-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/auto-height-with-top-and-bottom-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/auto-height-with-top-and-bottom-expected.png new file mode 100644 index 0000000..83ceeaa --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/auto-height-with-top-and-bottom-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/auto/001-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/auto/001-expected.png new file mode 100644 index 0000000..7611383 --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/auto/001-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/auto/002-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/auto/002-expected.png new file mode 100644 index 0000000..ee7a7be --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/auto/002-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/auto/003-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/auto/003-expected.png new file mode 100644 index 0000000..ee7a7be --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/auto/003-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/auto/004-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/auto/004-expected.png new file mode 100644 index 0000000..ee7a7be --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/auto/004-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/auto/005-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/auto/005-expected.png new file mode 100644 index 0000000..068179b --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/auto/005-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/auto/006-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/auto/006-expected.png new file mode 100644 index 0000000..d14612b --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/auto/006-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/auto/007-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/auto/007-expected.png new file mode 100644 index 0000000..302d997 --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/auto/007-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/auto/vertical-lr/001-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/auto/vertical-lr/001-expected.png new file mode 100644 index 0000000..824d483 --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/auto/vertical-lr/001-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/auto/vertical-lr/002-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/auto/vertical-lr/002-expected.png new file mode 100644 index 0000000..03f9011 --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/auto/vertical-lr/002-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/auto/vertical-lr/003-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/auto/vertical-lr/003-expected.png new file mode 100644 index 0000000..03f9011 --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/auto/vertical-lr/003-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/auto/vertical-lr/004-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/auto/vertical-lr/004-expected.png new file mode 100644 index 0000000..03f9011 --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/auto/vertical-lr/004-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/auto/vertical-lr/005-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/auto/vertical-lr/005-expected.png new file mode 100644 index 0000000..54a90e2 --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/auto/vertical-lr/005-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/auto/vertical-lr/006-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/auto/vertical-lr/006-expected.png new file mode 100644 index 0000000..222521e --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/auto/vertical-lr/006-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/auto/vertical-lr/007-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/auto/vertical-lr/007-expected.png new file mode 100644 index 0000000..406527a --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/auto/vertical-lr/007-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/auto/vertical-rl/001-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/auto/vertical-rl/001-expected.png new file mode 100644 index 0000000..6500fab --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/auto/vertical-rl/001-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/auto/vertical-rl/002-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/auto/vertical-rl/002-expected.png new file mode 100644 index 0000000..4e459f2da6 --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/auto/vertical-rl/002-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/auto/vertical-rl/003-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/auto/vertical-rl/003-expected.png new file mode 100644 index 0000000..8876458 --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/auto/vertical-rl/003-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/auto/vertical-rl/004-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/auto/vertical-rl/004-expected.png new file mode 100644 index 0000000..8876458 --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/auto/vertical-rl/004-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/auto/vertical-rl/005-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/auto/vertical-rl/005-expected.png new file mode 100644 index 0000000..a57eb8f4 --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/auto/vertical-rl/005-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/auto/vertical-rl/006-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/auto/vertical-rl/006-expected.png new file mode 100644 index 0000000..fe9dbbc1 --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/auto/vertical-rl/006-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/auto/vertical-rl/007-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/auto/vertical-rl/007-expected.png new file mode 100644 index 0000000..4cecad1 --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/auto/vertical-rl/007-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/child-of-absolute-with-auto-height-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/child-of-absolute-with-auto-height-expected.png new file mode 100644 index 0000000..da57e54 --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/child-of-absolute-with-auto-height-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/complex-positioned-movement-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/complex-positioned-movement-expected.png new file mode 100644 index 0000000..dde64be9 --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/complex-positioned-movement-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/fixed-position-stacking-context-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/fixed-position-stacking-context-expected.png new file mode 100644 index 0000000..a0a5dbb --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/fixed-position-stacking-context-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/fixed-position-stacking-context2-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/fixed-position-stacking-context2-expected.png new file mode 100644 index 0000000..87973882 --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/fixed-position-stacking-context2-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/fixed-positioning-scrollbar-bug-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/fixed-positioning-scrollbar-bug-expected.png new file mode 100644 index 0000000..b5f73b5 --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/fixed-positioning-scrollbar-bug-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/height-change-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/height-change-expected.png new file mode 100644 index 0000000..f572db8b --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/height-change-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/hiding-inside-relpositioned-inline-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/hiding-inside-relpositioned-inline-expected.png new file mode 100644 index 0000000..22b08bf0 --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/hiding-inside-relpositioned-inline-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/inline-block-relposition-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/inline-block-relposition-expected.png new file mode 100644 index 0000000..dc3956c --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/inline-block-relposition-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/leftmargin-topmargin-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/leftmargin-topmargin-expected.png new file mode 100644 index 0000000..64715e7 --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/leftmargin-topmargin-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/move-with-auto-width-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/move-with-auto-width-expected.png new file mode 100644 index 0000000..6731300 --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/move-with-auto-width-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/negative-rel-position-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/negative-rel-position-expected.png new file mode 100644 index 0000000..420d2a4 --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/negative-rel-position-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/negative-right-pos-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/negative-right-pos-expected.png new file mode 100644 index 0000000..6695c74 --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/negative-right-pos-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/padding-percent-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/padding-percent-expected.png new file mode 100644 index 0000000..429e7a45 --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/padding-percent-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/pref-width-change-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/pref-width-change-expected.png new file mode 100644 index 0000000..d3ae504 --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/pref-width-change-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/relative-overconstrained-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/relative-overconstrained-expected.png new file mode 100644 index 0000000..e3ad95a --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/relative-overconstrained-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/relative-overflow-block-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/relative-overflow-block-expected.png new file mode 100644 index 0000000..03b005b --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/relative-overflow-block-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/relative-overflow-replaced-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/relative-overflow-replaced-expected.png new file mode 100644 index 0000000..49e5b30 --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/relative-overflow-replaced-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/relative-overflow-replaced-float-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/relative-overflow-replaced-float-expected.png new file mode 100644 index 0000000..4422ffa --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/relative-overflow-replaced-float-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/relative-positioned-inline-container-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/relative-positioned-inline-container-expected.png new file mode 100644 index 0000000..42bb06e --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/relative-positioned-inline-container-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/relayout-on-position-change-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/relayout-on-position-change-expected.png new file mode 100644 index 0000000..4beb61a --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/relayout-on-position-change-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/replaced-inside-fixed-top-bottom-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/replaced-inside-fixed-top-bottom-expected.png new file mode 100644 index 0000000..7235267 --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/replaced-inside-fixed-top-bottom-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/rtl-fixed-positioning-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/rtl-fixed-positioning-expected.png new file mode 100644 index 0000000..7aea771a --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/rtl-fixed-positioning-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/rtl-static-positioning-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/rtl-static-positioning-expected.png new file mode 100644 index 0000000..b4e18374 --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/rtl-static-positioning-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/rtl-static-positioning-inline-block-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/rtl-static-positioning-inline-block-expected.png new file mode 100644 index 0000000..b4e18374 --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/rtl-static-positioning-inline-block-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/start-ignoring-before-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/start-ignoring-before-expected.png new file mode 100644 index 0000000..7017a34 --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/start-ignoring-before-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/static-distance-with-positioned-ancestor-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/static-distance-with-positioned-ancestor-expected.png new file mode 100644 index 0000000..0d29ff3 --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/static-distance-with-positioned-ancestor-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/static-inline-position-dynamic-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/static-inline-position-dynamic-expected.png new file mode 100644 index 0000000..b7eaaa5 --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/static-inline-position-dynamic-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/table-cell-static-position-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/table-cell-static-position-expected.png new file mode 100644 index 0000000..dc48f83 --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/table-cell-static-position-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/trailing-space-test-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/trailing-space-test-expected.png new file mode 100644 index 0000000..1c479863 --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/trailing-space-test-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/vertical-lr/001-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/vertical-lr/001-expected.png new file mode 100644 index 0000000..6b7cf46 --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/vertical-lr/001-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/vertical-lr/002-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/vertical-lr/002-expected.png new file mode 100644 index 0000000..7a4111a --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/vertical-lr/002-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/vertical-lr/003-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/vertical-lr/003-expected.png new file mode 100644 index 0000000..626a5c7 --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/vertical-lr/003-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/vertical-lr/004-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/vertical-lr/004-expected.png new file mode 100644 index 0000000..626a5c7 --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/vertical-lr/004-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/vertical-lr/005-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/vertical-lr/005-expected.png new file mode 100644 index 0000000..87973882 --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/vertical-lr/005-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/vertical-lr/006-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/vertical-lr/006-expected.png new file mode 100644 index 0000000..87973882 --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/vertical-lr/006-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/vertical-rl/001-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/vertical-rl/001-expected.png new file mode 100644 index 0000000..59bd40d --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/vertical-rl/001-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/vertical-rl/002-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/vertical-rl/002-expected.png new file mode 100644 index 0000000..a0592b4 --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/vertical-rl/002-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/vertical-rl/003-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/vertical-rl/003-expected.png new file mode 100644 index 0000000..8edc883f --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/vertical-rl/003-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/vertical-rl/004-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/vertical-rl/004-expected.png new file mode 100644 index 0000000..8edc883f --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/vertical-rl/004-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/vertical-rl/005-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/vertical-rl/005-expected.png new file mode 100644 index 0000000..fde8650 --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/vertical-rl/005-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/vertical-rl/006-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/vertical-rl/006-expected.png new file mode 100644 index 0000000..fde8650 --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/vertical-rl/006-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/vertical-rl/fixed-positioning-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/vertical-rl/fixed-positioning-expected.png new file mode 100644 index 0000000..cb5ef03 --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/vertical-rl/fixed-positioning-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/window-height-change-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/window-height-change-expected.png new file mode 100644 index 0000000..4aa02866 --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/fast/block/positioning/window-height-change-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/virtual/layout_ng_fragment_traversal/fast/block/float/overhanging-tall-block-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/virtual/layout_ng_fragment_traversal/fast/block/float/overhanging-tall-block-expected.png new file mode 100644 index 0000000..9875b0d --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/virtual/layout_ng_fragment_traversal/fast/block/float/overhanging-tall-block-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/virtual/layout_ng_fragment_traversal/fast/block/positioning/auto/vertical-lr/007-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/virtual/layout_ng_fragment_traversal/fast/block/positioning/auto/vertical-lr/007-expected.png new file mode 100644 index 0000000..406527a --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/virtual/layout_ng_fragment_traversal/fast/block/positioning/auto/vertical-lr/007-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/virtual/layout_ng_fragment_traversal/fast/block/positioning/auto/vertical-rl/007-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/virtual/layout_ng_fragment_traversal/fast/block/positioning/auto/vertical-rl/007-expected.png new file mode 100644 index 0000000..4cecad1 --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/virtual/layout_ng_fragment_traversal/fast/block/positioning/auto/vertical-rl/007-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/virtual/layout_ng_fragment_traversal/fast/block/positioning/vertical-lr/001-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/virtual/layout_ng_fragment_traversal/fast/block/positioning/vertical-lr/001-expected.png new file mode 100644 index 0000000..6b7cf46 --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/virtual/layout_ng_fragment_traversal/fast/block/positioning/vertical-lr/001-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/virtual/layout_ng_fragment_traversal/fast/block/positioning/vertical-rl/001-expected.png b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/virtual/layout_ng_fragment_traversal/fast/block/positioning/vertical-rl/001-expected.png new file mode 100644 index 0000000..59bd40d --- /dev/null +++ b/third_party/blink/web_tests/flag-specific/force-device-scale-factor=1.5/virtual/layout_ng_fragment_traversal/fast/block/positioning/vertical-rl/001-expected.png Binary files differ
diff --git a/third_party/blink/web_tests/geolocation-api/argument-types-expected.txt b/third_party/blink/web_tests/geolocation-api/argument-types-expected.txt index ccc7ad4..7257eed1 100644 --- a/third_party/blink/web_tests/geolocation-api/argument-types-expected.txt +++ b/third_party/blink/web_tests/geolocation-api/argument-types-expected.txt
@@ -3,38 +3,38 @@ On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". PASS navigator.geolocation.getCurrentPosition() threw exception TypeError: Failed to execute 'getCurrentPosition' on 'Geolocation': 1 argument required, but only 0 present.. -PASS navigator.geolocation.getCurrentPosition(undefined) threw exception TypeError: Failed to execute 'getCurrentPosition' on 'Geolocation': parameter 1 is not of type 'Function'.. -PASS navigator.geolocation.getCurrentPosition(null) threw exception TypeError: Failed to execute 'getCurrentPosition' on 'Geolocation': parameter 1 is not of type 'Function'.. -PASS navigator.geolocation.getCurrentPosition({}) threw exception TypeError: Failed to execute 'getCurrentPosition' on 'Geolocation': parameter 1 is not of type 'Function'.. -PASS navigator.geolocation.getCurrentPosition(objectThrowingException) threw exception TypeError: Failed to execute 'getCurrentPosition' on 'Geolocation': parameter 1 is not of type 'Function'.. +PASS navigator.geolocation.getCurrentPosition(undefined) threw exception TypeError: Failed to execute 'getCurrentPosition' on 'Geolocation': The callback provided as parameter 1 is not a function.. +PASS navigator.geolocation.getCurrentPosition(null) threw exception TypeError: Failed to execute 'getCurrentPosition' on 'Geolocation': The callback provided as parameter 1 is not a function.. +PASS navigator.geolocation.getCurrentPosition({}) threw exception TypeError: Failed to execute 'getCurrentPosition' on 'Geolocation': The callback provided as parameter 1 is not a function.. +PASS navigator.geolocation.getCurrentPosition(objectThrowingException) threw exception TypeError: Failed to execute 'getCurrentPosition' on 'Geolocation': The callback provided as parameter 1 is not a function.. PASS navigator.geolocation.getCurrentPosition(emptyFunction) did not throw exception. PASS navigator.geolocation.getCurrentPosition(Math.abs) did not throw exception. -PASS navigator.geolocation.getCurrentPosition(true) threw exception TypeError: Failed to execute 'getCurrentPosition' on 'Geolocation': parameter 1 is not of type 'Function'.. -PASS navigator.geolocation.getCurrentPosition(42) threw exception TypeError: Failed to execute 'getCurrentPosition' on 'Geolocation': parameter 1 is not of type 'Function'.. -PASS navigator.geolocation.getCurrentPosition(Infinity) threw exception TypeError: Failed to execute 'getCurrentPosition' on 'Geolocation': parameter 1 is not of type 'Function'.. -PASS navigator.geolocation.getCurrentPosition(-Infinity) threw exception TypeError: Failed to execute 'getCurrentPosition' on 'Geolocation': parameter 1 is not of type 'Function'.. -PASS navigator.geolocation.getCurrentPosition("string") threw exception TypeError: Failed to execute 'getCurrentPosition' on 'Geolocation': parameter 1 is not of type 'Function'.. +PASS navigator.geolocation.getCurrentPosition(true) threw exception TypeError: Failed to execute 'getCurrentPosition' on 'Geolocation': The callback provided as parameter 1 is not a function.. +PASS navigator.geolocation.getCurrentPosition(42) threw exception TypeError: Failed to execute 'getCurrentPosition' on 'Geolocation': The callback provided as parameter 1 is not a function.. +PASS navigator.geolocation.getCurrentPosition(Infinity) threw exception TypeError: Failed to execute 'getCurrentPosition' on 'Geolocation': The callback provided as parameter 1 is not a function.. +PASS navigator.geolocation.getCurrentPosition(-Infinity) threw exception TypeError: Failed to execute 'getCurrentPosition' on 'Geolocation': The callback provided as parameter 1 is not a function.. +PASS navigator.geolocation.getCurrentPosition("string") threw exception TypeError: Failed to execute 'getCurrentPosition' on 'Geolocation': The callback provided as parameter 1 is not a function.. PASS navigator.geolocation.getCurrentPosition(emptyFunction, undefined) did not throw exception. PASS navigator.geolocation.getCurrentPosition(emptyFunction, null) did not throw exception. -PASS navigator.geolocation.getCurrentPosition(emptyFunction, {}) threw exception TypeError: Failed to execute 'getCurrentPosition' on 'Geolocation': parameter 2 is not of type 'Function'.. -PASS navigator.geolocation.getCurrentPosition(emptyFunction, objectThrowingException) threw exception TypeError: Failed to execute 'getCurrentPosition' on 'Geolocation': parameter 2 is not of type 'Function'.. +PASS navigator.geolocation.getCurrentPosition(emptyFunction, {}) threw exception TypeError: Failed to execute 'getCurrentPosition' on 'Geolocation': The callback provided as parameter 2 is not a function.. +PASS navigator.geolocation.getCurrentPosition(emptyFunction, objectThrowingException) threw exception TypeError: Failed to execute 'getCurrentPosition' on 'Geolocation': The callback provided as parameter 2 is not a function.. PASS navigator.geolocation.getCurrentPosition(emptyFunction, emptyFunction) did not throw exception. PASS navigator.geolocation.getCurrentPosition(emptyFunction, Math.abs) did not throw exception. -PASS navigator.geolocation.getCurrentPosition(emptyFunction, true) threw exception TypeError: Failed to execute 'getCurrentPosition' on 'Geolocation': parameter 2 is not of type 'Function'.. -PASS navigator.geolocation.getCurrentPosition(emptyFunction, 42) threw exception TypeError: Failed to execute 'getCurrentPosition' on 'Geolocation': parameter 2 is not of type 'Function'.. -PASS navigator.geolocation.getCurrentPosition(emptyFunction, Infinity) threw exception TypeError: Failed to execute 'getCurrentPosition' on 'Geolocation': parameter 2 is not of type 'Function'.. -PASS navigator.geolocation.getCurrentPosition(emptyFunction, -Infinity) threw exception TypeError: Failed to execute 'getCurrentPosition' on 'Geolocation': parameter 2 is not of type 'Function'.. -PASS navigator.geolocation.getCurrentPosition(emptyFunction, "string") threw exception TypeError: Failed to execute 'getCurrentPosition' on 'Geolocation': parameter 2 is not of type 'Function'.. +PASS navigator.geolocation.getCurrentPosition(emptyFunction, true) threw exception TypeError: Failed to execute 'getCurrentPosition' on 'Geolocation': The callback provided as parameter 2 is not a function.. +PASS navigator.geolocation.getCurrentPosition(emptyFunction, 42) threw exception TypeError: Failed to execute 'getCurrentPosition' on 'Geolocation': The callback provided as parameter 2 is not a function.. +PASS navigator.geolocation.getCurrentPosition(emptyFunction, Infinity) threw exception TypeError: Failed to execute 'getCurrentPosition' on 'Geolocation': The callback provided as parameter 2 is not a function.. +PASS navigator.geolocation.getCurrentPosition(emptyFunction, -Infinity) threw exception TypeError: Failed to execute 'getCurrentPosition' on 'Geolocation': The callback provided as parameter 2 is not a function.. +PASS navigator.geolocation.getCurrentPosition(emptyFunction, "string") threw exception TypeError: Failed to execute 'getCurrentPosition' on 'Geolocation': The callback provided as parameter 2 is not a function.. PASS navigator.geolocation.getCurrentPosition(emptyFunction, undefined, undefined) did not throw exception. PASS navigator.geolocation.getCurrentPosition(emptyFunction, undefined, null) did not throw exception. PASS navigator.geolocation.getCurrentPosition(emptyFunction, undefined, {}) did not throw exception. PASS navigator.geolocation.getCurrentPosition(emptyFunction, undefined, objectThrowingException) threw exception Error: enableHighAccuracy getter exception. PASS navigator.geolocation.getCurrentPosition(emptyFunction, undefined, emptyFunction) did not throw exception. -PASS navigator.geolocation.getCurrentPosition(emptyFunction, undefined, true) threw exception TypeError: Failed to execute 'getCurrentPosition' on 'Geolocation': cannot convert to dictionary.. -PASS navigator.geolocation.getCurrentPosition(emptyFunction, undefined, 42) threw exception TypeError: Failed to execute 'getCurrentPosition' on 'Geolocation': cannot convert to dictionary.. -PASS navigator.geolocation.getCurrentPosition(emptyFunction, undefined, Infinity) threw exception TypeError: Failed to execute 'getCurrentPosition' on 'Geolocation': cannot convert to dictionary.. -PASS navigator.geolocation.getCurrentPosition(emptyFunction, undefined, -Infinity) threw exception TypeError: Failed to execute 'getCurrentPosition' on 'Geolocation': cannot convert to dictionary.. -PASS navigator.geolocation.getCurrentPosition(emptyFunction, undefined, "string") threw exception TypeError: Failed to execute 'getCurrentPosition' on 'Geolocation': cannot convert to dictionary.. +PASS navigator.geolocation.getCurrentPosition(emptyFunction, undefined, true) threw exception TypeError: Failed to execute 'getCurrentPosition' on 'Geolocation': parameter 3 ('options') is not an object.. +PASS navigator.geolocation.getCurrentPosition(emptyFunction, undefined, 42) threw exception TypeError: Failed to execute 'getCurrentPosition' on 'Geolocation': parameter 3 ('options') is not an object.. +PASS navigator.geolocation.getCurrentPosition(emptyFunction, undefined, Infinity) threw exception TypeError: Failed to execute 'getCurrentPosition' on 'Geolocation': parameter 3 ('options') is not an object.. +PASS navigator.geolocation.getCurrentPosition(emptyFunction, undefined, -Infinity) threw exception TypeError: Failed to execute 'getCurrentPosition' on 'Geolocation': parameter 3 ('options') is not an object.. +PASS navigator.geolocation.getCurrentPosition(emptyFunction, undefined, "string") threw exception TypeError: Failed to execute 'getCurrentPosition' on 'Geolocation': parameter 3 ('options') is not an object.. PASS navigator.geolocation.getCurrentPosition(emptyFunction, undefined, {dummyProperty:undefined}) did not throw exception. PASS navigator.geolocation.getCurrentPosition(emptyFunction, undefined, {dummyProperty:null}) did not throw exception. PASS navigator.geolocation.getCurrentPosition(emptyFunction, undefined, {dummyProperty:{}}) did not throw exception.
diff --git a/third_party/blink/web_tests/html/tabular_data/table_exceptions-expected.txt b/third_party/blink/web_tests/html/tabular_data/table_exceptions-expected.txt index 526b6168..57ee3d4 100644 --- a/third_party/blink/web_tests/html/tabular_data/table_exceptions-expected.txt +++ b/third_party/blink/web_tests/html/tabular_data/table_exceptions-expected.txt
@@ -2,13 +2,13 @@ On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". -PASS t.caption = document.body threw exception TypeError: Failed to set the 'caption' property on 'HTMLTableElement': Failed to convert value to 'HTMLTableCaptionElement'.. -PASS t.tHead = document.body threw exception TypeError: Failed to set the 'tHead' property on 'HTMLTableElement': Failed to convert value to 'HTMLTableSectionElement'.. +PASS t.caption = document.body threw exception TypeError: Failed to set the 'caption' property on 'HTMLTableElement': The provided value is not of type 'HTMLTableCaptionElement'.. +PASS t.tHead = document.body threw exception TypeError: Failed to set the 'tHead' property on 'HTMLTableElement': The provided value is not of type 'HTMLTableSectionElement'.. PASS t.createTFoot() is t.tFoot PASS t.tFoot is non-null. PASS t.tFoot = null did not throw exception. PASS t.tFoot is null -PASS t.tFoot = document.body threw exception TypeError: Failed to set the 'tFoot' property on 'HTMLTableElement': Failed to convert value to 'HTMLTableSectionElement'.. +PASS t.tFoot = document.body threw exception TypeError: Failed to set the 'tFoot' property on 'HTMLTableElement': The provided value is not of type 'HTMLTableSectionElement'.. PASS t.insertRow(-2) threw exception IndexSizeError: Failed to execute 'insertRow' on 'HTMLTableElement': The index provided (-2) is less than -1.. PASS t.insertRow(1) threw exception IndexSizeError: Failed to execute 'insertRow' on 'HTMLTableElement': The index provided (1) is greater than the number of rows in the table (0).. PASS t.deleteRow(-2) threw exception IndexSizeError: Failed to execute 'deleteRow' on 'HTMLTableElement': The index provided (-2) is less than -1..
diff --git a/third_party/blink/web_tests/http/tests/devtools/console/alert-toString-exception-expected.txt b/third_party/blink/web_tests/http/tests/devtools/console/alert-toString-exception-expected.txt index 671f46b..c58926336 100644 --- a/third_party/blink/web_tests/http/tests/devtools/console/alert-toString-exception-expected.txt +++ b/third_party/blink/web_tests/http/tests/devtools/console/alert-toString-exception-expected.txt
@@ -2,5 +2,6 @@ Page reloaded. alert-toString-exception.html:2 Uncaught Exception in toString(). +toString @ alert-toString-exception.html:2 (anonymous) @ alert-toString-exception.html:2
diff --git a/third_party/blink/web_tests/http/tests/devtools/console/console-log-side-effects-expected.txt b/third_party/blink/web_tests/http/tests/devtools/console/console-log-side-effects-expected.txt index a5cef76..28fc728 100644 --- a/third_party/blink/web_tests/http/tests/devtools/console/console-log-side-effects-expected.txt +++ b/third_party/blink/web_tests/http/tests/devtools/console/console-log-side-effects-expected.txt
@@ -13,7 +13,7 @@ console-log-side-effects.js:34 Boolean {true} console-log-side-effects.js:35 String {"foo"} console-log-side-effects.js:36 {} -console-log-side-effects.js:37 Window {window: Window, self: Window, document: document, name: "", location: Location, …} +console-log-side-effects.js:37 Window {parent: Window, opener: null, top: Window, length: 0, frames: Window, …} console-log-side-effects.js:43 console-log-side-effects.js:47 {foo: 1, bar: 2} console-log-side-effects.js:48 (3) [1, 2, 3]
diff --git a/third_party/blink/web_tests/http/tests/dom/location-stringify.html b/third_party/blink/web_tests/http/tests/dom/location-stringify.html index 2a852a7..547d9c1 100644 --- a/third_party/blink/web_tests/http/tests/dom/location-stringify.html +++ b/third_party/blink/web_tests/http/tests/dom/location-stringify.html
@@ -24,7 +24,7 @@ assertEqual( "stringify", JSON.stringify(window.location), - '{"ancestorOrigins":{},"href":"http://127.0.0.1:8000/dom/location-stringify.html","origin":"http://127.0.0.1:8000","protocol":"http:","host":"127.0.0.1:8000","hostname":"127.0.0.1","port":"8000","pathname":"/dom/location-stringify.html","search":"","hash":""}'); + '{"href":"http://127.0.0.1:8000/dom/location-stringify.html","ancestorOrigins":{},"origin":"http://127.0.0.1:8000","protocol":"http:","host":"127.0.0.1:8000","hostname":"127.0.0.1","port":"8000","pathname":"/dom/location-stringify.html","search":"","hash":""}'); } </script> </head>
diff --git a/third_party/blink/web_tests/http/tests/security/cross-frame-access-enumeration-expected.txt b/third_party/blink/web_tests/http/tests/security/cross-frame-access-enumeration-expected.txt index 2c1f9d59..4a4de46 100644 --- a/third_party/blink/web_tests/http/tests/security/cross-frame-access-enumeration-expected.txt +++ b/third_party/blink/web_tests/http/tests/security/cross-frame-access-enumeration-expected.txt
@@ -4,6 +4,6 @@ PASS: Cross frame access by getting the keys of the window object was denied. PASS: Cross frame access by getting the property names of the window object was denied. PASS: Cross frame access by enumerating the Location object revealed no properties. -PASS: Cross frame access by getting the keys of the Location object revealed only whitelisted keys. +FAIL: Cross frame access by getting the keys of the Location object returned non-whitelisted key: href PASS: Cross frame access by getting the property names of the Location object revealed no custom properties.
diff --git a/third_party/blink/web_tests/http/tests/serviceworker/service-worker-gc-expected.txt b/third_party/blink/web_tests/http/tests/serviceworker/service-worker-gc-expected.txt index b686c4d..226b651 100644 --- a/third_party/blink/web_tests/http/tests/serviceworker/service-worker-gc-expected.txt +++ b/third_party/blink/web_tests/http/tests/serviceworker/service-worker-gc-expected.txt
@@ -5,7 +5,7 @@ PASS registrationObservation.wasCollected is false PASS swObservation.wasCollected is false PASS registrationObservation.wasCollected is false -PASS swObservation.wasCollected is true +PASS swObservation.wasCollected is false PASS successfullyParsed is true TEST COMPLETE
diff --git a/third_party/blink/web_tests/http/tests/serviceworker/service-worker-gc.html b/third_party/blink/web_tests/http/tests/serviceworker/service-worker-gc.html index 22f2ab4f..dfe7b5a 100644 --- a/third_party/blink/web_tests/http/tests/serviceworker/service-worker-gc.html +++ b/third_party/blink/web_tests/http/tests/serviceworker/service-worker-gc.html
@@ -83,7 +83,7 @@ // once the new worker is activated, check that the old worker is gc'd. gc(); shouldBeFalse('registrationObservation.wasCollected'); - shouldBeTrue('swObservation.wasCollected'); + shouldBeFalse('swObservation.wasCollected'); finishJSTest(); } </script>
diff --git a/third_party/blink/web_tests/images/image-document-remove-listener.html b/third_party/blink/web_tests/images/image-document-remove-listener.html index b353afcc..e162cd2 100644 --- a/third_party/blink/web_tests/images/image-document-remove-listener.html +++ b/third_party/blink/web_tests/images/image-document-remove-listener.html
@@ -13,7 +13,7 @@ try { newWindow.removeEventListener("resize", 2); } catch (e) { - assert_equals(e.message, "Failed to execute 'removeEventListener' on 'EventTarget': parameter 2 is not of type 'Object'."); + assert_equals(e.message, "Failed to execute 'removeEventListener' on 'EventTarget': The callback provided as parameter 2 is not an object."); } }); });
diff --git a/third_party/blink/web_tests/storage/indexeddb/create-object-store-options-expected.txt b/third_party/blink/web_tests/storage/indexeddb/create-object-store-options-expected.txt index 590a7dac..55c091b 100644 --- a/third_party/blink/web_tests/storage/indexeddb/create-object-store-options-expected.txt +++ b/third_party/blink/web_tests/storage/indexeddb/create-object-store-options-expected.txt
@@ -13,10 +13,10 @@ trans.objectStore('a').put({'a': 0}) Expecting TypeError exception from db.createObjectStore('d', 'bar'); PASS Exception was thrown. -PASS db.createObjectStore('d', 'bar'); threw TypeError: Failed to execute 'createObjectStore' on 'IDBDatabase': cannot convert to dictionary. +PASS db.createObjectStore('d', 'bar'); threw TypeError: Failed to execute 'createObjectStore' on 'IDBDatabase': parameter 2 ('options') is not an object. Expecting TypeError exception from db.createObjectStore('e', false); PASS Exception was thrown. -PASS db.createObjectStore('e', false); threw TypeError: Failed to execute 'createObjectStore' on 'IDBDatabase': cannot convert to dictionary. +PASS db.createObjectStore('e', false); threw TypeError: Failed to execute 'createObjectStore' on 'IDBDatabase': parameter 2 ('options') is not an object. trans.objectStore('b').put({'a': 0}, 0) trans.objectStore('a').get(0) PASS event.target.result.a is {a: 0}
diff --git a/third_party/blink/web_tests/storage/indexeddb/index-basics-expected.txt b/third_party/blink/web_tests/storage/indexeddb/index-basics-expected.txt index 31d5858..861f4c9 100644 --- a/third_party/blink/web_tests/storage/indexeddb/index-basics-expected.txt +++ b/third_party/blink/web_tests/storage/indexeddb/index-basics-expected.txt
@@ -17,10 +17,10 @@ PASS indexObject3.unique is true Expecting TypeError exception from store.createIndex('failureIndex', 'zzz', true) PASS Exception was thrown. -PASS store.createIndex('failureIndex', 'zzz', true) threw TypeError: Failed to execute 'createIndex' on 'IDBObjectStore': cannot convert to dictionary. +PASS store.createIndex('failureIndex', 'zzz', true) threw TypeError: Failed to execute 'createIndex' on 'IDBObjectStore': parameter 3 ('options') is not an object. Expecting TypeError exception from store.createIndex('failureIndex', 'zzz', 'string') PASS Exception was thrown. -PASS store.createIndex('failureIndex', 'zzz', 'string') threw TypeError: Failed to execute 'createIndex' on 'IDBObjectStore': cannot convert to dictionary. +PASS store.createIndex('failureIndex', 'zzz', 'string') threw TypeError: Failed to execute 'createIndex' on 'IDBObjectStore': parameter 3 ('options') is not an object. PASS 'name' in indexObject is true PASS indexObject.name is "indexName" PASS 'objectStore' in indexObject is true
diff --git a/third_party/blink/web_tests/storage/indexeddb/index-basics-workers-expected.txt b/third_party/blink/web_tests/storage/indexeddb/index-basics-workers-expected.txt index f0ad73b2..7c2096f 100644 --- a/third_party/blink/web_tests/storage/indexeddb/index-basics-workers-expected.txt +++ b/third_party/blink/web_tests/storage/indexeddb/index-basics-workers-expected.txt
@@ -17,10 +17,10 @@ PASS [Worker] indexObject3.unique is true [Worker] Expecting TypeError exception from store.createIndex('failureIndex', 'zzz', true) PASS [Worker] Exception was thrown. -PASS [Worker] store.createIndex('failureIndex', 'zzz', true) threw TypeError: Failed to execute 'createIndex' on 'IDBObjectStore': cannot convert to dictionary. +PASS [Worker] store.createIndex('failureIndex', 'zzz', true) threw TypeError: Failed to execute 'createIndex' on 'IDBObjectStore': parameter 3 ('options') is not an object. [Worker] Expecting TypeError exception from store.createIndex('failureIndex', 'zzz', 'string') PASS [Worker] Exception was thrown. -PASS [Worker] store.createIndex('failureIndex', 'zzz', 'string') threw TypeError: Failed to execute 'createIndex' on 'IDBObjectStore': cannot convert to dictionary. +PASS [Worker] store.createIndex('failureIndex', 'zzz', 'string') threw TypeError: Failed to execute 'createIndex' on 'IDBObjectStore': parameter 3 ('options') is not an object. PASS [Worker] 'name' in indexObject is true PASS [Worker] indexObject.name is "indexName" PASS [Worker] 'objectStore' in indexObject is true
diff --git a/third_party/blink/web_tests/svg/dom/SVGNumberList-basics-expected.txt b/third_party/blink/web_tests/svg/dom/SVGNumberList-basics-expected.txt index e3ebaed..ee01331 100644 --- a/third_party/blink/web_tests/svg/dom/SVGNumberList-basics-expected.txt +++ b/third_party/blink/web_tests/svg/dom/SVGNumberList-basics-expected.txt
@@ -90,10 +90,10 @@ Test uncommon values for indexed setter -PASS text1.rotate.baseVal[0] = 30 threw exception TypeError: Failed to set an indexed property on 'SVGNumberList': parameter 3 is not of type 'SVGNumber'.. -PASS text1.rotate.baseVal[0] = 'aString' threw exception TypeError: Failed to set an indexed property on 'SVGNumberList': parameter 3 is not of type 'SVGNumber'.. -PASS text1.rotate.baseVal[0] = text1 threw exception TypeError: Failed to set an indexed property on 'SVGNumberList': parameter 3 is not of type 'SVGNumber'.. -PASS text1.rotate.baseVal[0] = null threw exception TypeError: Failed to set an indexed property on 'SVGNumberList': parameter 3 is not of type 'SVGNumber'.. +PASS text1.rotate.baseVal[0] = 30 threw exception TypeError: Failed to set an indexed property on 'SVGNumberList': The provided value is not of type 'SVGNumber'.. +PASS text1.rotate.baseVal[0] = 'aString' threw exception TypeError: Failed to set an indexed property on 'SVGNumberList': The provided value is not of type 'SVGNumber'.. +PASS text1.rotate.baseVal[0] = text1 threw exception TypeError: Failed to set an indexed property on 'SVGNumberList': The provided value is not of type 'SVGNumber'.. +PASS text1.rotate.baseVal[0] = null threw exception TypeError: Failed to set an indexed property on 'SVGNumberList': The provided value is not of type 'SVGNumber'.. PASS text1.rotate.baseVal.replaceItem(text1.rotate.baseVal.getItem(0), 0) is text1.rotate.baseVal.getItem(0) PASS text1.rotate.baseVal.numberOfItems is 4 PASS text1.rotate.baseVal.getItem(0).value is 1
diff --git a/third_party/blink/web_tests/svg/dom/SVGPointList-basics-expected.txt b/third_party/blink/web_tests/svg/dom/SVGPointList-basics-expected.txt index a475e28..9c30ae4 100644 --- a/third_party/blink/web_tests/svg/dom/SVGPointList-basics-expected.txt +++ b/third_party/blink/web_tests/svg/dom/SVGPointList-basics-expected.txt
@@ -103,10 +103,10 @@ Test uncommon values for indexed setter -PASS poly1.points[0] = 30 threw exception TypeError: Failed to set an indexed property on 'SVGPointList': parameter 3 is not of type 'SVGPoint'.. -PASS poly1.points[0] = 'aString' threw exception TypeError: Failed to set an indexed property on 'SVGPointList': parameter 3 is not of type 'SVGPoint'.. -PASS poly1.points[0] = poly1 threw exception TypeError: Failed to set an indexed property on 'SVGPointList': parameter 3 is not of type 'SVGPoint'.. -PASS poly1.points[0] = null threw exception TypeError: Failed to set an indexed property on 'SVGPointList': parameter 3 is not of type 'SVGPoint'.. +PASS poly1.points[0] = 30 threw exception TypeError: Failed to set an indexed property on 'SVGPointList': The provided value is not of type 'SVGPoint'.. +PASS poly1.points[0] = 'aString' threw exception TypeError: Failed to set an indexed property on 'SVGPointList': The provided value is not of type 'SVGPoint'.. +PASS poly1.points[0] = poly1 threw exception TypeError: Failed to set an indexed property on 'SVGPointList': The provided value is not of type 'SVGPoint'.. +PASS poly1.points[0] = null threw exception TypeError: Failed to set an indexed property on 'SVGPointList': The provided value is not of type 'SVGPoint'.. Test uncommon arguments for replaceItem() and xml-dom synchronization
diff --git a/third_party/blink/web_tests/virtual/not-site-per-process/external/wpt/html/browsers/history/the-location-interface/allow_prototype_cycle_through_location.sub-expected.txt b/third_party/blink/web_tests/virtual/not-site-per-process/external/wpt/html/browsers/history/the-location-interface/allow_prototype_cycle_through_location.sub-expected.txt deleted file mode 100644 index c5e1c42a..0000000 --- a/third_party/blink/web_tests/virtual/not-site-per-process/external/wpt/html/browsers/history/the-location-interface/allow_prototype_cycle_through_location.sub-expected.txt +++ /dev/null
@@ -1,7 +0,0 @@ -This is a testharness.js-based test. -FAIL same-origin, same-window location cycle Immutable prototype object '#<Location>' cannot have their prototype set -PASS cross-origin location has null prototype -FAIL same-origin, different-window location cycle Immutable prototype object '[object Location]' cannot have their prototype set -FAIL cross-origin, but joined via document.domain, location cycle Immutable prototype object '[object Location]' cannot have their prototype set -Harness: the test ran to completion. -
diff --git a/third_party/blink/web_tests/virtual/not-site-per-process/external/wpt/html/browsers/history/the-location-interface/location-prototype-setting-same-origin-domain.sub-expected.txt b/third_party/blink/web_tests/virtual/not-site-per-process/external/wpt/html/browsers/history/the-location-interface/location-prototype-setting-same-origin-domain.sub-expected.txt index dcd0d65..93fac7b 100644 --- a/third_party/blink/web_tests/virtual/not-site-per-process/external/wpt/html/browsers/history/the-location-interface/location-prototype-setting-same-origin-domain.sub-expected.txt +++ b/third_party/blink/web_tests/virtual/not-site-per-process/external/wpt/html/browsers/history/the-location-interface/location-prototype-setting-same-origin-domain.sub-expected.txt
@@ -1,9 +1,13 @@ This is a testharness.js-based test. PASS Same-origin-domain prerequisite check: the original prototype is accessible -PASS Same-origin-domain: setting the prototype to an empty object via Object.setPrototypeOf should throw a TypeError -PASS Same-origin-domain: setting the prototype to an empty object via __proto__ should throw a TypeError -PASS Same-origin-domain: setting the prototype to an empty object via Reflect.setPrototypeOf should return false -PASS Same-origin-domain: the prototype must still be its original value +FAIL Same-origin-domain: setting the prototype to an empty object via Object.setPrototypeOf should throw a TypeError assert_throws_js: function "() => { + Object.setPrototypeOf(target, newValue); + }" did not throw +FAIL Same-origin-domain: setting the prototype to an empty object via __proto__ should throw a TypeError assert_throws_js: function "function() { + target.__proto__ = newValue; + }" did not throw +FAIL Same-origin-domain: setting the prototype to an empty object via Reflect.setPrototypeOf should return false assert_false: expected false got true +FAIL Same-origin-domain: the prototype must still be its original value assert_equals: expected object "[object Location]" but got object "[object Object]" PASS Same-origin-domain: setting the prototype to its original value via Object.setPrototypeOf should not throw PASS Same-origin-domain: setting the prototype to its original value via __proto__ should not throw PASS Same-origin-domain: setting the prototype to its original value via Reflect.setPrototypeOf should return true
diff --git a/third_party/blink/web_tests/virtual/stable/fast/dom/Window/property-access-on-cached-window-after-frame-navigated-expected.txt b/third_party/blink/web_tests/virtual/stable/fast/dom/Window/property-access-on-cached-window-after-frame-navigated-expected.txt index d1c9ca42..f1080ca 100644 --- a/third_party/blink/web_tests/virtual/stable/fast/dom/Window/property-access-on-cached-window-after-frame-navigated-expected.txt +++ b/third_party/blink/web_tests/virtual/stable/fast/dom/Window/property-access-on-cached-window-after-frame-navigated-expected.txt
@@ -170,7 +170,6 @@ PASS oldChildWindow.outerWidth is newChildWindow.outerWidth PASS oldChildWindow.pageXOffset is newChildWindow.pageXOffset PASS oldChildWindow.pageYOffset is newChildWindow.pageYOffset -PASS oldChildWindow.performance.eventCounts.size is newChildWindow.performance.eventCounts.size PASS oldChildWindow.performance.navigation.redirectCount is newChildWindow.performance.navigation.redirectCount PASS oldChildWindow.performance.navigation.type is newChildWindow.performance.navigation.type PASS oldChildWindow.performance.onresourcetimingbufferfull is newChildWindow.performance.onresourcetimingbufferfull
diff --git a/third_party/blink/web_tests/virtual/stable/fast/dom/Window/property-access-on-cached-window-after-frame-removed-and-gced-expected.txt b/third_party/blink/web_tests/virtual/stable/fast/dom/Window/property-access-on-cached-window-after-frame-removed-and-gced-expected.txt index 41ad130..e9d66ba 100644 --- a/third_party/blink/web_tests/virtual/stable/fast/dom/Window/property-access-on-cached-window-after-frame-removed-and-gced-expected.txt +++ b/third_party/blink/web_tests/virtual/stable/fast/dom/Window/property-access-on-cached-window-after-frame-removed-and-gced-expected.txt
@@ -11,7 +11,6 @@ PASS childWindow.innerWidth is 0 PASS childWindow.isSecureContext is false PASS childWindow.length is 0 -FAIL childWindow.location.href should be about:blank (of type string). Was undefined (of type undefined). PASS childWindow.locationbar.visible is false PASS childWindow.menubar.visible is false PASS childWindow.name is '' @@ -23,6 +22,8 @@ PASS childWindow.navigator.hardwareConcurrency is window.navigator.hardwareConcurrency PASS childWindow.navigator.language is window.navigator.language PASS childWindow.navigator.maxTouchPoints is 0 +PASS childWindow.navigator.mediaSession.metadata is null +PASS childWindow.navigator.mediaSession.playbackState is 'none' PASS childWindow.navigator.onLine is window.navigator.onLine PASS childWindow.navigator.platform is window.navigator.platform PASS childWindow.navigator.product is window.navigator.product
diff --git a/third_party/blink/web_tests/virtual/stable/fast/dom/Window/property-access-on-cached-window-after-frame-removed-expected.txt b/third_party/blink/web_tests/virtual/stable/fast/dom/Window/property-access-on-cached-window-after-frame-removed-expected.txt index c2b19c9..bc99058 100644 --- a/third_party/blink/web_tests/virtual/stable/fast/dom/Window/property-access-on-cached-window-after-frame-removed-expected.txt +++ b/third_party/blink/web_tests/virtual/stable/fast/dom/Window/property-access-on-cached-window-after-frame-removed-expected.txt
@@ -11,7 +11,6 @@ PASS childWindow.innerWidth is 0 PASS childWindow.isSecureContext is false PASS childWindow.length is 0 -FAIL childWindow.location.href should be about:blank (of type string). Was undefined (of type undefined). PASS childWindow.locationbar.visible is false PASS childWindow.menubar.visible is false PASS childWindow.name is '' @@ -23,6 +22,8 @@ PASS childWindow.navigator.hardwareConcurrency is window.navigator.hardwareConcurrency PASS childWindow.navigator.language is window.navigator.language PASS childWindow.navigator.maxTouchPoints is 0 +PASS childWindow.navigator.mediaSession.metadata is null +PASS childWindow.navigator.mediaSession.playbackState is 'none' PASS childWindow.navigator.onLine is window.navigator.onLine PASS childWindow.navigator.platform is window.navigator.platform PASS childWindow.navigator.product is window.navigator.product
diff --git a/third_party/blink/web_tests/virtual/stable/fast/dom/Window/window-properties-performance-expected.txt b/third_party/blink/web_tests/virtual/stable/fast/dom/Window/window-properties-performance-expected.txt index 7b10e0c..b241cd9 100644 --- a/third_party/blink/web_tests/virtual/stable/fast/dom/Window/window-properties-performance-expected.txt +++ b/third_party/blink/web_tests/virtual/stable/fast/dom/Window/window-properties-performance-expected.txt
@@ -12,7 +12,6 @@ window.performance.eventCounts.get [function] window.performance.eventCounts.has [function] window.performance.eventCounts.keys [function] -window.performance.eventCounts.size [number] window.performance.eventCounts.values [function] window.performance.getEntries [function] window.performance.getEntriesByName [function]
diff --git a/third_party/blink/web_tests/virtual/stable/webexposed/global-interface-listing-expected.txt b/third_party/blink/web_tests/virtual/stable/webexposed/global-interface-listing-expected.txt index 7aae3e6..19f47de1 100644 --- a/third_party/blink/web_tests/virtual/stable/webexposed/global-interface-listing-expected.txt +++ b/third_party/blink/web_tests/virtual/stable/webexposed/global-interface-listing-expected.txt
@@ -452,7 +452,6 @@ attribute @@toStringTag getter cssRules getter name - method @@iterator method appendRule method constructor method deleteRule @@ -2705,7 +2704,6 @@ setter size interface HTMLFormControlsCollection : HTMLCollection attribute @@toStringTag - method @@iterator method constructor method namedItem interface HTMLFormElement : HTMLElement @@ -5539,7 +5537,6 @@ interface RadioNodeList : NodeList attribute @@toStringTag getter value - method @@iterator method constructor setter value interface Range @@ -9373,6 +9370,7 @@ attribute @@toStringTag getter src getter weight + method constructor setter src setter weight interface webkitSpeechGrammarList @@ -9381,6 +9379,7 @@ method @@iterator method addFromString method addFromUri + method constructor method item interface webkitSpeechRecognition : EventTarget attribute @@toStringTag @@ -9401,6 +9400,7 @@ getter onspeechstart getter onstart method abort + method constructor method start method stop setter continuous @@ -9423,12 +9423,14 @@ attribute @@toStringTag getter error getter message + method constructor interface webkitSpeechRecognitionEvent : Event attribute @@toStringTag getter emma getter interpretation getter resultIndex getter results + method constructor interface webkitURL static method createObjectURL static method revokeObjectURL @@ -9462,17 +9464,25 @@ attribute GCController attribute accessibilityController attribute chrome + attribute closed attribute console attribute eventSender + attribute frames attribute gamepadController attribute globalThis attribute internals + attribute length + attribute location + attribute opener + attribute parent attribute propertyNamesInGlobal + attribute self attribute testRunner attribute textInputController + attribute top + attribute window getter caches getter clientInformation - getter closed getter crypto getter customElements getter defaultStatus @@ -9482,15 +9492,12 @@ getter event getter external getter frameElement - getter frames getter history getter indexedDB getter innerHeight getter innerWidth getter isSecureContext - getter length getter localStorage - getter location getter locationbar getter menubar getter name @@ -9604,13 +9611,11 @@ getter onwebkitanimationstart getter onwebkittransitionend getter onwheel - getter opener getter origin getter outerHeight getter outerWidth getter pageXOffset getter pageYOffset - getter parent getter performance getter personalbar getter screen @@ -9621,18 +9626,15 @@ getter scrollX getter scrollY getter scrollbars - getter self getter sessionStorage getter speechSynthesis getter status getter statusbar getter styleMedia getter toolbar - getter top getter trustedTypes getter visualViewport getter webkitStorageInfo - getter window method NodeFilter method alert method atob @@ -9682,11 +9684,8 @@ setter devicePixelRatio setter event setter external - setter frames setter innerHeight setter innerWidth - setter length - setter location setter locationbar setter menubar setter name @@ -9799,13 +9798,11 @@ setter onwebkitanimationstart setter onwebkittransitionend setter onwheel - setter opener setter origin setter outerHeight setter outerWidth setter pageXOffset setter pageYOffset - setter parent setter performance setter personalbar setter screen @@ -9816,7 +9813,6 @@ setter scrollX setter scrollY setter scrollbars - setter self setter status setter statusbar setter toolbar
diff --git "a/third_party/blink/web_tests/virtual/web-components-v0-disabled/external/wpt/html/dom/idlharness.https_exclude=\050Document_Window_HTML._\051-expected.txt" "b/third_party/blink/web_tests/virtual/web-components-v0-disabled/external/wpt/html/dom/idlharness.https_exclude=\050Document_Window_HTML._\051-expected.txt" new file mode 100644 index 0000000..9f3049c --- /dev/null +++ "b/third_party/blink/web_tests/virtual/web-components-v0-disabled/external/wpt/html/dom/idlharness.https_exclude=\050Document_Window_HTML._\051-expected.txt"
@@ -0,0 +1,1416 @@ +This is a testharness.js-based test. +Found 1412 tests; 1327 PASS, 85 FAIL, 0 TIMEOUT, 0 NOTRUN. +PASS idl_test setup +PASS idl_test validation +PASS Partial interface Document: original interface defined +PASS Partial interface Document: member names are unique +PASS Partial interface mixin DocumentOrShadowRoot: original interface mixin defined +PASS Partial interface mixin DocumentOrShadowRoot: member names are unique +PASS Partial interface mixin NavigatorID: original interface mixin defined +PASS Partial interface mixin NavigatorID: member names are unique +PASS Partial interface HTMLAnchorElement: original interface defined +PASS Partial interface HTMLAnchorElement: member names are unique +PASS Partial interface HTMLAreaElement: original interface defined +PASS Partial interface HTMLAreaElement: member names are unique +PASS Partial interface HTMLBodyElement: original interface defined +PASS Partial interface HTMLBodyElement: member names are unique +PASS Partial interface HTMLBRElement: original interface defined +PASS Partial interface HTMLBRElement: member names are unique +PASS Partial interface HTMLTableCaptionElement: original interface defined +PASS Partial interface HTMLTableCaptionElement: member names are unique +PASS Partial interface HTMLTableColElement: original interface defined +PASS Partial interface HTMLTableColElement: member names are unique +PASS Partial interface HTMLDivElement: original interface defined +PASS Partial interface HTMLDivElement: member names are unique +PASS Partial interface HTMLDListElement: original interface defined +PASS Partial interface HTMLDListElement: member names are unique +PASS Partial interface HTMLEmbedElement: original interface defined +PASS Partial interface HTMLEmbedElement: member names are unique +PASS Partial interface HTMLHeadingElement: original interface defined +PASS Partial interface HTMLHeadingElement: member names are unique +PASS Partial interface HTMLHRElement: original interface defined +PASS Partial interface HTMLHRElement: member names are unique +PASS Partial interface HTMLHtmlElement: original interface defined +PASS Partial interface HTMLHtmlElement: member names are unique +PASS Partial interface HTMLIFrameElement: original interface defined +PASS Partial interface HTMLIFrameElement: member names are unique +PASS Partial interface HTMLImageElement: original interface defined +PASS Partial interface HTMLImageElement: member names are unique +PASS Partial interface HTMLInputElement: original interface defined +PASS Partial interface HTMLInputElement: member names are unique +PASS Partial interface HTMLLegendElement: original interface defined +PASS Partial interface HTMLLegendElement: member names are unique +PASS Partial interface HTMLLIElement: original interface defined +PASS Partial interface HTMLLIElement: member names are unique +PASS Partial interface HTMLLinkElement: original interface defined +PASS Partial interface HTMLLinkElement: member names are unique +PASS Partial interface HTMLMenuElement: original interface defined +PASS Partial interface HTMLMenuElement: member names are unique +PASS Partial interface HTMLMetaElement: original interface defined +PASS Partial interface HTMLMetaElement: member names are unique +PASS Partial interface HTMLObjectElement: original interface defined +PASS Partial interface HTMLObjectElement: member names are unique +PASS Partial interface HTMLOListElement: original interface defined +PASS Partial interface HTMLOListElement: member names are unique +PASS Partial interface HTMLParagraphElement: original interface defined +PASS Partial interface HTMLParagraphElement: member names are unique +PASS Partial interface HTMLParamElement: original interface defined +PASS Partial interface HTMLParamElement: member names are unique +PASS Partial interface HTMLPreElement: original interface defined +PASS Partial interface HTMLPreElement: member names are unique +PASS Partial interface HTMLStyleElement: original interface defined +PASS Partial interface HTMLStyleElement: member names are unique +PASS Partial interface HTMLScriptElement: original interface defined +PASS Partial interface HTMLScriptElement: member names are unique +PASS Partial interface HTMLTableElement: original interface defined +PASS Partial interface HTMLTableElement: member names are unique +PASS Partial interface HTMLTableSectionElement: original interface defined +PASS Partial interface HTMLTableSectionElement: member names are unique +PASS Partial interface HTMLTableCellElement: original interface defined +PASS Partial interface HTMLTableCellElement: member names are unique +PASS Partial interface HTMLTableRowElement: original interface defined +PASS Partial interface HTMLTableRowElement: member names are unique +PASS Partial interface HTMLUListElement: original interface defined +PASS Partial interface HTMLUListElement: member names are unique +PASS Partial interface Document[2]: original interface defined +PASS Partial interface Document[2]: member names are unique +PASS Partial interface Window: original interface defined +PASS Partial interface Window: member names are unique +PASS Partial interface Document[3]: member names are unique +PASS Partial interface mixin DocumentOrShadowRoot[2]: member names are unique +PASS Partial interface UIEvent: member names are unique +PASS Document includes GlobalEventHandlers: member names are unique +PASS Document includes DocumentAndElementEventHandlers: member names are unique +PASS Document includes NonElementParentNode: member names are unique +PASS Document includes DocumentOrShadowRoot: member names are unique +PASS Document includes ParentNode: member names are unique +PASS Document includes XPathEvaluatorBase: member names are unique +PASS HTMLElement includes GlobalEventHandlers: member names are unique +PASS HTMLElement includes DocumentAndElementEventHandlers: member names are unique +PASS HTMLElement includes ElementContentEditable: member names are unique +PASS HTMLElement includes HTMLOrSVGElement: member names are unique +PASS HTMLElement includes ElementCSSInlineStyle: member names are unique +PASS HTMLLinkElement includes LinkStyle: member names are unique +PASS HTMLStyleElement includes LinkStyle: member names are unique +PASS HTMLBodyElement includes WindowEventHandlers: member names are unique +PASS HTMLAnchorElement includes HTMLHyperlinkElementUtils: member names are unique +PASS HTMLAreaElement includes HTMLHyperlinkElementUtils: member names are unique +PASS CanvasRenderingContext2D includes CanvasState: member names are unique +PASS CanvasRenderingContext2D includes CanvasTransform: member names are unique +PASS CanvasRenderingContext2D includes CanvasCompositing: member names are unique +PASS CanvasRenderingContext2D includes CanvasImageSmoothing: member names are unique +PASS CanvasRenderingContext2D includes CanvasFillStrokeStyles: member names are unique +PASS CanvasRenderingContext2D includes CanvasShadowStyles: member names are unique +PASS CanvasRenderingContext2D includes CanvasFilters: member names are unique +PASS CanvasRenderingContext2D includes CanvasRect: member names are unique +PASS CanvasRenderingContext2D includes CanvasDrawPath: member names are unique +PASS CanvasRenderingContext2D includes CanvasUserInterface: member names are unique +PASS CanvasRenderingContext2D includes CanvasText: member names are unique +PASS CanvasRenderingContext2D includes CanvasDrawImage: member names are unique +PASS CanvasRenderingContext2D includes CanvasImageData: member names are unique +PASS CanvasRenderingContext2D includes CanvasPathDrawingStyles: member names are unique +PASS CanvasRenderingContext2D includes CanvasTextDrawingStyles: member names are unique +PASS CanvasRenderingContext2D includes CanvasPath: member names are unique +PASS Path2D includes CanvasPath: member names are unique +PASS OffscreenCanvasRenderingContext2D includes CanvasState: member names are unique +PASS OffscreenCanvasRenderingContext2D includes CanvasTransform: member names are unique +PASS OffscreenCanvasRenderingContext2D includes CanvasCompositing: member names are unique +PASS OffscreenCanvasRenderingContext2D includes CanvasImageSmoothing: member names are unique +PASS OffscreenCanvasRenderingContext2D includes CanvasFillStrokeStyles: member names are unique +PASS OffscreenCanvasRenderingContext2D includes CanvasShadowStyles: member names are unique +PASS OffscreenCanvasRenderingContext2D includes CanvasFilters: member names are unique +PASS OffscreenCanvasRenderingContext2D includes CanvasRect: member names are unique +PASS OffscreenCanvasRenderingContext2D includes CanvasDrawPath: member names are unique +PASS OffscreenCanvasRenderingContext2D includes CanvasText: member names are unique +PASS OffscreenCanvasRenderingContext2D includes CanvasDrawImage: member names are unique +PASS OffscreenCanvasRenderingContext2D includes CanvasImageData: member names are unique +PASS OffscreenCanvasRenderingContext2D includes CanvasPathDrawingStyles: member names are unique +PASS OffscreenCanvasRenderingContext2D includes CanvasTextDrawingStyles: member names are unique +PASS OffscreenCanvasRenderingContext2D includes CanvasPath: member names are unique +PASS Window includes GlobalEventHandlers: member names are unique +PASS Window includes WindowEventHandlers: member names are unique +PASS Window includes WindowOrWorkerGlobalScope: member names are unique +PASS Window includes AnimationFrameProvider: member names are unique +PASS Window includes WindowSessionStorage: member names are unique +PASS Window includes WindowLocalStorage: member names are unique +PASS WorkerGlobalScope includes WindowOrWorkerGlobalScope: member names are unique +PASS Navigator includes NavigatorID: member names are unique +PASS Navigator includes NavigatorLanguage: member names are unique +PASS Navigator includes NavigatorOnLine: member names are unique +PASS Navigator includes NavigatorContentUtils: member names are unique +PASS Navigator includes NavigatorCookies: member names are unique +PASS Navigator includes NavigatorPlugins: member names are unique +PASS Navigator includes NavigatorConcurrentHardware: member names are unique +PASS DedicatedWorkerGlobalScope includes AnimationFrameProvider: member names are unique +PASS Worker includes AbstractWorker: member names are unique +PASS SharedWorker includes AbstractWorker: member names are unique +PASS WorkerNavigator includes NavigatorID: member names are unique +PASS WorkerNavigator includes NavigatorLanguage: member names are unique +PASS WorkerNavigator includes NavigatorOnLine: member names are unique +PASS WorkerNavigator includes NavigatorConcurrentHardware: member names are unique +PASS HTMLFrameSetElement includes WindowEventHandlers: member names are unique +PASS SVGElement includes GlobalEventHandlers: member names are unique +PASS SVGElement includes DocumentAndElementEventHandlers: member names are unique +PASS SVGElement includes SVGElementInstance: member names are unique +PASS SVGElement includes HTMLOrSVGElement: member names are unique +PASS SVGElement includes ElementCSSInlineStyle: member names are unique +PASS SVGGraphicsElement includes SVGTests: member names are unique +PASS SVGSVGElement includes SVGFitToViewBox: member names are unique +PASS SVGSVGElement includes WindowEventHandlers: member names are unique +PASS SVGImageElement includes SVGURIReference: member names are unique +PASS SVGScriptElement includes SVGURIReference: member names are unique +PASS SVGAElement includes SVGURIReference: member names are unique +FAIL SVGAElement includes HTMLHyperlinkElementUtils: member names are unique assert_true: member href is unique expected true got false +PASS DocumentFragment includes NonElementParentNode: member names are unique +PASS DocumentFragment includes ParentNode: member names are unique +PASS ShadowRoot includes DocumentOrShadowRoot: member names are unique +PASS Element includes ParentNode: member names are unique +PASS Element includes NonDocumentTypeChildNode: member names are unique +PASS Element includes ChildNode: member names are unique +PASS Element includes Slottable: member names are unique +PASS RadioNodeList interface: existence and properties of interface object +PASS RadioNodeList interface object length +PASS RadioNodeList interface object name +PASS RadioNodeList interface: existence and properties of interface prototype object +PASS RadioNodeList interface: existence and properties of interface prototype object's "constructor" property +PASS RadioNodeList interface: existence and properties of interface prototype object's @@unscopables property +PASS RadioNodeList interface: attribute value +PASS DOMStringList interface: existence and properties of interface object +PASS DOMStringList interface object length +PASS DOMStringList interface object name +PASS DOMStringList interface: existence and properties of interface prototype object +PASS DOMStringList interface: existence and properties of interface prototype object's "constructor" property +PASS DOMStringList interface: existence and properties of interface prototype object's @@unscopables property +PASS DOMStringList interface: attribute length +PASS DOMStringList interface: operation item(unsigned long) +PASS DOMStringList interface: operation contains(DOMString) +PASS DOMStringList must be primary interface of location.ancestorOrigins +PASS Stringification of location.ancestorOrigins +PASS DOMStringList interface: location.ancestorOrigins must inherit property "length" with the proper type +PASS DOMStringList interface: location.ancestorOrigins must inherit property "item(unsigned long)" with the proper type +PASS DOMStringList interface: calling item(unsigned long) on location.ancestorOrigins with too few arguments must throw TypeError +PASS DOMStringList interface: location.ancestorOrigins must inherit property "contains(DOMString)" with the proper type +PASS DOMStringList interface: calling contains(DOMString) on location.ancestorOrigins with too few arguments must throw TypeError +PASS DOMStringMap interface: existence and properties of interface object +PASS DOMStringMap interface object length +PASS DOMStringMap interface object name +PASS DOMStringMap interface: existence and properties of interface prototype object +PASS DOMStringMap interface: existence and properties of interface prototype object's "constructor" property +PASS DOMStringMap interface: existence and properties of interface prototype object's @@unscopables property +PASS DOMStringMap must be primary interface of document.head.dataset +PASS Stringification of document.head.dataset +PASS MediaError interface: existence and properties of interface object +PASS MediaError interface object length +PASS MediaError interface object name +PASS MediaError interface: existence and properties of interface prototype object +PASS MediaError interface: existence and properties of interface prototype object's "constructor" property +PASS MediaError interface: existence and properties of interface prototype object's @@unscopables property +PASS MediaError interface: constant MEDIA_ERR_ABORTED on interface object +PASS MediaError interface: constant MEDIA_ERR_ABORTED on interface prototype object +PASS MediaError interface: constant MEDIA_ERR_NETWORK on interface object +PASS MediaError interface: constant MEDIA_ERR_NETWORK on interface prototype object +PASS MediaError interface: constant MEDIA_ERR_DECODE on interface object +PASS MediaError interface: constant MEDIA_ERR_DECODE on interface prototype object +PASS MediaError interface: constant MEDIA_ERR_SRC_NOT_SUPPORTED on interface object +PASS MediaError interface: constant MEDIA_ERR_SRC_NOT_SUPPORTED on interface prototype object +PASS MediaError interface: attribute code +PASS MediaError interface: attribute message +PASS MediaError must be primary interface of errorVideo.error +PASS Stringification of errorVideo.error +PASS MediaError interface: errorVideo.error must inherit property "MEDIA_ERR_ABORTED" with the proper type +PASS MediaError interface: errorVideo.error must inherit property "MEDIA_ERR_NETWORK" with the proper type +PASS MediaError interface: errorVideo.error must inherit property "MEDIA_ERR_DECODE" with the proper type +PASS MediaError interface: errorVideo.error must inherit property "MEDIA_ERR_SRC_NOT_SUPPORTED" with the proper type +PASS MediaError interface: errorVideo.error must inherit property "code" with the proper type +PASS MediaError interface: errorVideo.error must inherit property "message" with the proper type +PASS AudioTrackList interface: existence and properties of interface object +PASS AudioTrackList interface object length +PASS AudioTrackList interface object name +PASS AudioTrackList interface: existence and properties of interface prototype object +PASS AudioTrackList interface: existence and properties of interface prototype object's "constructor" property +PASS AudioTrackList interface: existence and properties of interface prototype object's @@unscopables property +PASS AudioTrackList interface: attribute length +PASS AudioTrackList interface: operation getTrackById(DOMString) +PASS AudioTrackList interface: attribute onchange +PASS AudioTrackList interface: attribute onaddtrack +PASS AudioTrackList interface: attribute onremovetrack +PASS AudioTrack interface: existence and properties of interface object +PASS AudioTrack interface object length +PASS AudioTrack interface object name +PASS AudioTrack interface: existence and properties of interface prototype object +PASS AudioTrack interface: existence and properties of interface prototype object's "constructor" property +PASS AudioTrack interface: existence and properties of interface prototype object's @@unscopables property +PASS AudioTrack interface: attribute id +PASS AudioTrack interface: attribute kind +PASS AudioTrack interface: attribute label +PASS AudioTrack interface: attribute language +PASS AudioTrack interface: attribute enabled +PASS VideoTrackList interface: existence and properties of interface object +PASS VideoTrackList interface object length +PASS VideoTrackList interface object name +PASS VideoTrackList interface: existence and properties of interface prototype object +PASS VideoTrackList interface: existence and properties of interface prototype object's "constructor" property +PASS VideoTrackList interface: existence and properties of interface prototype object's @@unscopables property +PASS VideoTrackList interface: attribute length +PASS VideoTrackList interface: operation getTrackById(DOMString) +PASS VideoTrackList interface: attribute selectedIndex +PASS VideoTrackList interface: attribute onchange +PASS VideoTrackList interface: attribute onaddtrack +PASS VideoTrackList interface: attribute onremovetrack +PASS VideoTrack interface: existence and properties of interface object +PASS VideoTrack interface object length +PASS VideoTrack interface object name +PASS VideoTrack interface: existence and properties of interface prototype object +PASS VideoTrack interface: existence and properties of interface prototype object's "constructor" property +PASS VideoTrack interface: existence and properties of interface prototype object's @@unscopables property +PASS VideoTrack interface: attribute id +PASS VideoTrack interface: attribute kind +PASS VideoTrack interface: attribute label +PASS VideoTrack interface: attribute language +PASS VideoTrack interface: attribute selected +PASS TextTrackList interface: existence and properties of interface object +PASS TextTrackList interface object length +PASS TextTrackList interface object name +PASS TextTrackList interface: existence and properties of interface prototype object +PASS TextTrackList interface: existence and properties of interface prototype object's "constructor" property +PASS TextTrackList interface: existence and properties of interface prototype object's @@unscopables property +PASS TextTrackList interface: attribute length +PASS TextTrackList interface: operation getTrackById(DOMString) +PASS TextTrackList interface: attribute onchange +PASS TextTrackList interface: attribute onaddtrack +PASS TextTrackList interface: attribute onremovetrack +PASS TextTrackList must be primary interface of document.createElement("video").textTracks +PASS Stringification of document.createElement("video").textTracks +PASS TextTrackList interface: document.createElement("video").textTracks must inherit property "length" with the proper type +PASS TextTrackList interface: document.createElement("video").textTracks must inherit property "getTrackById(DOMString)" with the proper type +PASS TextTrackList interface: calling getTrackById(DOMString) on document.createElement("video").textTracks with too few arguments must throw TypeError +PASS TextTrackList interface: document.createElement("video").textTracks must inherit property "onchange" with the proper type +PASS TextTrackList interface: document.createElement("video").textTracks must inherit property "onaddtrack" with the proper type +PASS TextTrackList interface: document.createElement("video").textTracks must inherit property "onremovetrack" with the proper type +PASS TextTrack interface: existence and properties of interface object +PASS TextTrack interface object length +PASS TextTrack interface object name +PASS TextTrack interface: existence and properties of interface prototype object +PASS TextTrack interface: existence and properties of interface prototype object's "constructor" property +PASS TextTrack interface: existence and properties of interface prototype object's @@unscopables property +PASS TextTrack interface: attribute kind +PASS TextTrack interface: attribute label +PASS TextTrack interface: attribute language +PASS TextTrack interface: attribute id +FAIL TextTrack interface: attribute inBandMetadataTrackDispatchType assert_true: The prototype object must have a property "inBandMetadataTrackDispatchType" expected true got false +PASS TextTrack interface: attribute mode +PASS TextTrack interface: attribute cues +PASS TextTrack interface: attribute activeCues +PASS TextTrack interface: operation addCue(TextTrackCue) +PASS TextTrack interface: operation removeCue(TextTrackCue) +PASS TextTrack interface: attribute oncuechange +PASS TextTrack must be primary interface of document.createElement("track").track +PASS Stringification of document.createElement("track").track +PASS TextTrack interface: document.createElement("track").track must inherit property "kind" with the proper type +PASS TextTrack interface: document.createElement("track").track must inherit property "label" with the proper type +PASS TextTrack interface: document.createElement("track").track must inherit property "language" with the proper type +PASS TextTrack interface: document.createElement("track").track must inherit property "id" with the proper type +FAIL TextTrack interface: document.createElement("track").track must inherit property "inBandMetadataTrackDispatchType" with the proper type assert_inherits: property "inBandMetadataTrackDispatchType" not found in prototype chain +PASS TextTrack interface: document.createElement("track").track must inherit property "mode" with the proper type +PASS TextTrack interface: document.createElement("track").track must inherit property "cues" with the proper type +PASS TextTrack interface: document.createElement("track").track must inherit property "activeCues" with the proper type +PASS TextTrack interface: document.createElement("track").track must inherit property "addCue(TextTrackCue)" with the proper type +PASS TextTrack interface: calling addCue(TextTrackCue) on document.createElement("track").track with too few arguments must throw TypeError +PASS TextTrack interface: document.createElement("track").track must inherit property "removeCue(TextTrackCue)" with the proper type +PASS TextTrack interface: calling removeCue(TextTrackCue) on document.createElement("track").track with too few arguments must throw TypeError +PASS TextTrack interface: document.createElement("track").track must inherit property "oncuechange" with the proper type +PASS TextTrackCueList interface: existence and properties of interface object +PASS TextTrackCueList interface object length +PASS TextTrackCueList interface object name +PASS TextTrackCueList interface: existence and properties of interface prototype object +PASS TextTrackCueList interface: existence and properties of interface prototype object's "constructor" property +PASS TextTrackCueList interface: existence and properties of interface prototype object's @@unscopables property +PASS TextTrackCueList interface: attribute length +PASS TextTrackCueList interface: operation getCueById(DOMString) +PASS TextTrackCueList must be primary interface of document.createElement("video").addTextTrack("subtitles").cues +PASS Stringification of document.createElement("video").addTextTrack("subtitles").cues +PASS TextTrackCueList interface: document.createElement("video").addTextTrack("subtitles").cues must inherit property "length" with the proper type +PASS TextTrackCueList interface: document.createElement("video").addTextTrack("subtitles").cues must inherit property "getCueById(DOMString)" with the proper type +PASS TextTrackCueList interface: calling getCueById(DOMString) on document.createElement("video").addTextTrack("subtitles").cues with too few arguments must throw TypeError +PASS TextTrackCue interface: existence and properties of interface object +PASS TextTrackCue interface object length +PASS TextTrackCue interface object name +PASS TextTrackCue interface: existence and properties of interface prototype object +PASS TextTrackCue interface: existence and properties of interface prototype object's "constructor" property +PASS TextTrackCue interface: existence and properties of interface prototype object's @@unscopables property +PASS TextTrackCue interface: attribute track +PASS TextTrackCue interface: attribute id +PASS TextTrackCue interface: attribute startTime +PASS TextTrackCue interface: attribute endTime +PASS TextTrackCue interface: attribute pauseOnExit +PASS TextTrackCue interface: attribute onenter +PASS TextTrackCue interface: attribute onexit +PASS TimeRanges interface: existence and properties of interface object +PASS TimeRanges interface object length +PASS TimeRanges interface object name +PASS TimeRanges interface: existence and properties of interface prototype object +PASS TimeRanges interface: existence and properties of interface prototype object's "constructor" property +PASS TimeRanges interface: existence and properties of interface prototype object's @@unscopables property +PASS TimeRanges interface: attribute length +PASS TimeRanges interface: operation start(unsigned long) +PASS TimeRanges interface: operation end(unsigned long) +PASS TimeRanges must be primary interface of document.createElement("video").buffered +PASS Stringification of document.createElement("video").buffered +PASS TimeRanges interface: document.createElement("video").buffered must inherit property "length" with the proper type +PASS TimeRanges interface: document.createElement("video").buffered must inherit property "start(unsigned long)" with the proper type +PASS TimeRanges interface: calling start(unsigned long) on document.createElement("video").buffered with too few arguments must throw TypeError +PASS TimeRanges interface: document.createElement("video").buffered must inherit property "end(unsigned long)" with the proper type +PASS TimeRanges interface: calling end(unsigned long) on document.createElement("video").buffered with too few arguments must throw TypeError +PASS TrackEvent interface: existence and properties of interface object +PASS TrackEvent interface object length +PASS TrackEvent interface object name +PASS TrackEvent interface: existence and properties of interface prototype object +PASS TrackEvent interface: existence and properties of interface prototype object's "constructor" property +PASS TrackEvent interface: existence and properties of interface prototype object's @@unscopables property +PASS TrackEvent interface: attribute track +PASS TrackEvent must be primary interface of new TrackEvent("addtrack", {track:document.createElement("track").track}) +PASS Stringification of new TrackEvent("addtrack", {track:document.createElement("track").track}) +PASS TrackEvent interface: new TrackEvent("addtrack", {track:document.createElement("track").track}) must inherit property "track" with the proper type +PASS ValidityState interface: existence and properties of interface object +PASS ValidityState interface object length +PASS ValidityState interface object name +PASS ValidityState interface: existence and properties of interface prototype object +PASS ValidityState interface: existence and properties of interface prototype object's "constructor" property +PASS ValidityState interface: existence and properties of interface prototype object's @@unscopables property +PASS ValidityState interface: attribute valueMissing +PASS ValidityState interface: attribute typeMismatch +PASS ValidityState interface: attribute patternMismatch +PASS ValidityState interface: attribute tooLong +PASS ValidityState interface: attribute tooShort +PASS ValidityState interface: attribute rangeUnderflow +PASS ValidityState interface: attribute rangeOverflow +PASS ValidityState interface: attribute stepMismatch +PASS ValidityState interface: attribute badInput +PASS ValidityState interface: attribute customError +PASS ValidityState interface: attribute valid +PASS ValidityState must be primary interface of document.createElement("input").validity +PASS Stringification of document.createElement("input").validity +PASS ValidityState interface: document.createElement("input").validity must inherit property "valueMissing" with the proper type +PASS ValidityState interface: document.createElement("input").validity must inherit property "typeMismatch" with the proper type +PASS ValidityState interface: document.createElement("input").validity must inherit property "patternMismatch" with the proper type +PASS ValidityState interface: document.createElement("input").validity must inherit property "tooLong" with the proper type +PASS ValidityState interface: document.createElement("input").validity must inherit property "tooShort" with the proper type +PASS ValidityState interface: document.createElement("input").validity must inherit property "rangeUnderflow" with the proper type +PASS ValidityState interface: document.createElement("input").validity must inherit property "rangeOverflow" with the proper type +PASS ValidityState interface: document.createElement("input").validity must inherit property "stepMismatch" with the proper type +PASS ValidityState interface: document.createElement("input").validity must inherit property "badInput" with the proper type +PASS ValidityState interface: document.createElement("input").validity must inherit property "customError" with the proper type +PASS ValidityState interface: document.createElement("input").validity must inherit property "valid" with the proper type +PASS SubmitEvent interface: existence and properties of interface object +PASS SubmitEvent interface object length +PASS SubmitEvent interface object name +PASS SubmitEvent interface: existence and properties of interface prototype object +PASS SubmitEvent interface: existence and properties of interface prototype object's "constructor" property +PASS SubmitEvent interface: existence and properties of interface prototype object's @@unscopables property +PASS SubmitEvent interface: attribute submitter +PASS FormDataEvent interface: existence and properties of interface object +PASS FormDataEvent interface object length +PASS FormDataEvent interface object name +PASS FormDataEvent interface: existence and properties of interface prototype object +PASS FormDataEvent interface: existence and properties of interface prototype object's "constructor" property +PASS FormDataEvent interface: existence and properties of interface prototype object's @@unscopables property +PASS FormDataEvent interface: attribute formData +PASS FormDataEvent must be primary interface of new FormDataEvent("formdata", { formData: new FormData() }) +PASS Stringification of new FormDataEvent("formdata", { formData: new FormData() }) +PASS FormDataEvent interface: new FormDataEvent("formdata", { formData: new FormData() }) must inherit property "formData" with the proper type +PASS CanvasRenderingContext2D interface: existence and properties of interface object +PASS CanvasRenderingContext2D interface object length +PASS CanvasRenderingContext2D interface object name +PASS CanvasRenderingContext2D interface: existence and properties of interface prototype object +PASS CanvasRenderingContext2D interface: existence and properties of interface prototype object's "constructor" property +PASS CanvasRenderingContext2D interface: existence and properties of interface prototype object's @@unscopables property +PASS CanvasRenderingContext2D interface: attribute canvas +PASS CanvasRenderingContext2D interface: operation getContextAttributes() +PASS CanvasRenderingContext2D interface: operation save() +PASS CanvasRenderingContext2D interface: operation restore() +PASS CanvasRenderingContext2D interface: operation scale(unrestricted double, unrestricted double) +PASS CanvasRenderingContext2D interface: operation rotate(unrestricted double) +PASS CanvasRenderingContext2D interface: operation translate(unrestricted double, unrestricted double) +PASS CanvasRenderingContext2D interface: operation transform(unrestricted double, unrestricted double, unrestricted double, unrestricted double, unrestricted double, unrestricted double) +PASS CanvasRenderingContext2D interface: operation getTransform() +PASS CanvasRenderingContext2D interface: operation setTransform(unrestricted double, unrestricted double, unrestricted double, unrestricted double, unrestricted double, unrestricted double) +PASS CanvasRenderingContext2D interface: operation setTransform(optional DOMMatrix2DInit) +PASS CanvasRenderingContext2D interface: operation resetTransform() +PASS CanvasRenderingContext2D interface: attribute globalAlpha +PASS CanvasRenderingContext2D interface: attribute globalCompositeOperation +PASS CanvasRenderingContext2D interface: attribute imageSmoothingEnabled +PASS CanvasRenderingContext2D interface: attribute imageSmoothingQuality +PASS CanvasRenderingContext2D interface: attribute strokeStyle +PASS CanvasRenderingContext2D interface: attribute fillStyle +PASS CanvasRenderingContext2D interface: operation createLinearGradient(double, double, double, double) +PASS CanvasRenderingContext2D interface: operation createRadialGradient(double, double, double, double, double, double) +PASS CanvasRenderingContext2D interface: operation createPattern(CanvasImageSource, DOMString) +PASS CanvasRenderingContext2D interface: attribute shadowOffsetX +PASS CanvasRenderingContext2D interface: attribute shadowOffsetY +PASS CanvasRenderingContext2D interface: attribute shadowBlur +PASS CanvasRenderingContext2D interface: attribute shadowColor +PASS CanvasRenderingContext2D interface: attribute filter +PASS CanvasRenderingContext2D interface: operation clearRect(unrestricted double, unrestricted double, unrestricted double, unrestricted double) +PASS CanvasRenderingContext2D interface: operation fillRect(unrestricted double, unrestricted double, unrestricted double, unrestricted double) +PASS CanvasRenderingContext2D interface: operation strokeRect(unrestricted double, unrestricted double, unrestricted double, unrestricted double) +PASS CanvasRenderingContext2D interface: operation beginPath() +PASS CanvasRenderingContext2D interface: operation fill(optional CanvasFillRule) +PASS CanvasRenderingContext2D interface: operation fill(Path2D, optional CanvasFillRule) +PASS CanvasRenderingContext2D interface: operation stroke() +PASS CanvasRenderingContext2D interface: operation stroke(Path2D) +PASS CanvasRenderingContext2D interface: operation clip(optional CanvasFillRule) +PASS CanvasRenderingContext2D interface: operation clip(Path2D, optional CanvasFillRule) +PASS CanvasRenderingContext2D interface: operation isPointInPath(unrestricted double, unrestricted double, optional CanvasFillRule) +PASS CanvasRenderingContext2D interface: operation isPointInPath(Path2D, unrestricted double, unrestricted double, optional CanvasFillRule) +PASS CanvasRenderingContext2D interface: operation isPointInStroke(unrestricted double, unrestricted double) +PASS CanvasRenderingContext2D interface: operation isPointInStroke(Path2D, unrestricted double, unrestricted double) +PASS CanvasRenderingContext2D interface: operation drawFocusIfNeeded(Element) +PASS CanvasRenderingContext2D interface: operation drawFocusIfNeeded(Path2D, Element) +PASS CanvasRenderingContext2D interface: operation scrollPathIntoView() +PASS CanvasRenderingContext2D interface: operation scrollPathIntoView(Path2D) +PASS CanvasRenderingContext2D interface: operation fillText(DOMString, unrestricted double, unrestricted double, optional unrestricted double) +PASS CanvasRenderingContext2D interface: operation strokeText(DOMString, unrestricted double, unrestricted double, optional unrestricted double) +PASS CanvasRenderingContext2D interface: operation measureText(DOMString) +PASS CanvasRenderingContext2D interface: operation drawImage(CanvasImageSource, unrestricted double, unrestricted double) +PASS CanvasRenderingContext2D interface: operation drawImage(CanvasImageSource, unrestricted double, unrestricted double, unrestricted double, unrestricted double) +PASS CanvasRenderingContext2D interface: operation drawImage(CanvasImageSource, unrestricted double, unrestricted double, unrestricted double, unrestricted double, unrestricted double, unrestricted double, unrestricted double, unrestricted double) +PASS CanvasRenderingContext2D interface: operation createImageData(long, long) +PASS CanvasRenderingContext2D interface: operation createImageData(ImageData) +PASS CanvasRenderingContext2D interface: operation getImageData(long, long, long, long) +PASS CanvasRenderingContext2D interface: operation putImageData(ImageData, long, long) +PASS CanvasRenderingContext2D interface: operation putImageData(ImageData, long, long, long, long, long, long) +PASS CanvasRenderingContext2D interface: attribute lineWidth +PASS CanvasRenderingContext2D interface: attribute lineCap +PASS CanvasRenderingContext2D interface: attribute lineJoin +PASS CanvasRenderingContext2D interface: attribute miterLimit +PASS CanvasRenderingContext2D interface: operation setLineDash(sequence<unrestricted double>) +PASS CanvasRenderingContext2D interface: operation getLineDash() +PASS CanvasRenderingContext2D interface: attribute lineDashOffset +PASS CanvasRenderingContext2D interface: attribute font +PASS CanvasRenderingContext2D interface: attribute textAlign +PASS CanvasRenderingContext2D interface: attribute textBaseline +PASS CanvasRenderingContext2D interface: attribute direction +PASS CanvasRenderingContext2D interface: operation closePath() +PASS CanvasRenderingContext2D interface: operation moveTo(unrestricted double, unrestricted double) +PASS CanvasRenderingContext2D interface: operation lineTo(unrestricted double, unrestricted double) +PASS CanvasRenderingContext2D interface: operation quadraticCurveTo(unrestricted double, unrestricted double, unrestricted double, unrestricted double) +PASS CanvasRenderingContext2D interface: operation bezierCurveTo(unrestricted double, unrestricted double, unrestricted double, unrestricted double, unrestricted double, unrestricted double) +PASS CanvasRenderingContext2D interface: operation arcTo(unrestricted double, unrestricted double, unrestricted double, unrestricted double, unrestricted double) +PASS CanvasRenderingContext2D interface: operation rect(unrestricted double, unrestricted double, unrestricted double, unrestricted double) +PASS CanvasRenderingContext2D interface: operation arc(unrestricted double, unrestricted double, unrestricted double, unrestricted double, unrestricted double, optional boolean) +PASS CanvasRenderingContext2D interface: operation ellipse(unrestricted double, unrestricted double, unrestricted double, unrestricted double, unrestricted double, unrestricted double, unrestricted double, optional boolean) +PASS CanvasRenderingContext2D must be primary interface of document.createElement("canvas").getContext("2d") +PASS Stringification of document.createElement("canvas").getContext("2d") +PASS CanvasRenderingContext2D interface: document.createElement("canvas").getContext("2d") must inherit property "canvas" with the proper type +PASS CanvasRenderingContext2D interface: document.createElement("canvas").getContext("2d") must inherit property "getContextAttributes()" with the proper type +PASS CanvasRenderingContext2D interface: document.createElement("canvas").getContext("2d") must inherit property "save()" with the proper type +PASS CanvasRenderingContext2D interface: document.createElement("canvas").getContext("2d") must inherit property "restore()" with the proper type +PASS CanvasRenderingContext2D interface: document.createElement("canvas").getContext("2d") must inherit property "scale(unrestricted double, unrestricted double)" with the proper type +PASS CanvasRenderingContext2D interface: calling scale(unrestricted double, unrestricted double) on document.createElement("canvas").getContext("2d") with too few arguments must throw TypeError +PASS CanvasRenderingContext2D interface: document.createElement("canvas").getContext("2d") must inherit property "rotate(unrestricted double)" with the proper type +PASS CanvasRenderingContext2D interface: calling rotate(unrestricted double) on document.createElement("canvas").getContext("2d") with too few arguments must throw TypeError +PASS CanvasRenderingContext2D interface: document.createElement("canvas").getContext("2d") must inherit property "translate(unrestricted double, unrestricted double)" with the proper type +PASS CanvasRenderingContext2D interface: calling translate(unrestricted double, unrestricted double) on document.createElement("canvas").getContext("2d") with too few arguments must throw TypeError +PASS CanvasRenderingContext2D interface: document.createElement("canvas").getContext("2d") must inherit property "transform(unrestricted double, unrestricted double, unrestricted double, unrestricted double, unrestricted double, unrestricted double)" with the proper type +PASS CanvasRenderingContext2D interface: calling transform(unrestricted double, unrestricted double, unrestricted double, unrestricted double, unrestricted double, unrestricted double) on document.createElement("canvas").getContext("2d") with too few arguments must throw TypeError +PASS CanvasRenderingContext2D interface: document.createElement("canvas").getContext("2d") must inherit property "getTransform()" with the proper type +PASS CanvasRenderingContext2D interface: document.createElement("canvas").getContext("2d") must inherit property "setTransform(unrestricted double, unrestricted double, unrestricted double, unrestricted double, unrestricted double, unrestricted double)" with the proper type +PASS CanvasRenderingContext2D interface: calling setTransform(unrestricted double, unrestricted double, unrestricted double, unrestricted double, unrestricted double, unrestricted double) on document.createElement("canvas").getContext("2d") with too few arguments must throw TypeError +PASS CanvasRenderingContext2D interface: document.createElement("canvas").getContext("2d") must inherit property "setTransform(optional DOMMatrix2DInit)" with the proper type +PASS CanvasRenderingContext2D interface: calling setTransform(optional DOMMatrix2DInit) on document.createElement("canvas").getContext("2d") with too few arguments must throw TypeError +PASS CanvasRenderingContext2D interface: document.createElement("canvas").getContext("2d") must inherit property "resetTransform()" with the proper type +PASS CanvasRenderingContext2D interface: document.createElement("canvas").getContext("2d") must inherit property "globalAlpha" with the proper type +PASS CanvasRenderingContext2D interface: document.createElement("canvas").getContext("2d") must inherit property "globalCompositeOperation" with the proper type +PASS CanvasRenderingContext2D interface: document.createElement("canvas").getContext("2d") must inherit property "imageSmoothingEnabled" with the proper type +PASS CanvasRenderingContext2D interface: document.createElement("canvas").getContext("2d") must inherit property "imageSmoothingQuality" with the proper type +PASS CanvasRenderingContext2D interface: document.createElement("canvas").getContext("2d") must inherit property "strokeStyle" with the proper type +PASS CanvasRenderingContext2D interface: document.createElement("canvas").getContext("2d") must inherit property "fillStyle" with the proper type +PASS CanvasRenderingContext2D interface: document.createElement("canvas").getContext("2d") must inherit property "createLinearGradient(double, double, double, double)" with the proper type +PASS CanvasRenderingContext2D interface: calling createLinearGradient(double, double, double, double) on document.createElement("canvas").getContext("2d") with too few arguments must throw TypeError +PASS CanvasRenderingContext2D interface: document.createElement("canvas").getContext("2d") must inherit property "createRadialGradient(double, double, double, double, double, double)" with the proper type +PASS CanvasRenderingContext2D interface: calling createRadialGradient(double, double, double, double, double, double) on document.createElement("canvas").getContext("2d") with too few arguments must throw TypeError +PASS CanvasRenderingContext2D interface: document.createElement("canvas").getContext("2d") must inherit property "createPattern(CanvasImageSource, DOMString)" with the proper type +PASS CanvasRenderingContext2D interface: calling createPattern(CanvasImageSource, DOMString) on document.createElement("canvas").getContext("2d") with too few arguments must throw TypeError +PASS CanvasRenderingContext2D interface: document.createElement("canvas").getContext("2d") must inherit property "shadowOffsetX" with the proper type +PASS CanvasRenderingContext2D interface: document.createElement("canvas").getContext("2d") must inherit property "shadowOffsetY" with the proper type +PASS CanvasRenderingContext2D interface: document.createElement("canvas").getContext("2d") must inherit property "shadowBlur" with the proper type +PASS CanvasRenderingContext2D interface: document.createElement("canvas").getContext("2d") must inherit property "shadowColor" with the proper type +PASS CanvasRenderingContext2D interface: document.createElement("canvas").getContext("2d") must inherit property "filter" with the proper type +PASS CanvasRenderingContext2D interface: document.createElement("canvas").getContext("2d") must inherit property "clearRect(unrestricted double, unrestricted double, unrestricted double, unrestricted double)" with the proper type +PASS CanvasRenderingContext2D interface: calling clearRect(unrestricted double, unrestricted double, unrestricted double, unrestricted double) on document.createElement("canvas").getContext("2d") with too few arguments must throw TypeError +PASS CanvasRenderingContext2D interface: document.createElement("canvas").getContext("2d") must inherit property "fillRect(unrestricted double, unrestricted double, unrestricted double, unrestricted double)" with the proper type +PASS CanvasRenderingContext2D interface: calling fillRect(unrestricted double, unrestricted double, unrestricted double, unrestricted double) on document.createElement("canvas").getContext("2d") with too few arguments must throw TypeError +PASS CanvasRenderingContext2D interface: document.createElement("canvas").getContext("2d") must inherit property "strokeRect(unrestricted double, unrestricted double, unrestricted double, unrestricted double)" with the proper type +PASS CanvasRenderingContext2D interface: calling strokeRect(unrestricted double, unrestricted double, unrestricted double, unrestricted double) on document.createElement("canvas").getContext("2d") with too few arguments must throw TypeError +PASS CanvasRenderingContext2D interface: document.createElement("canvas").getContext("2d") must inherit property "beginPath()" with the proper type +PASS CanvasRenderingContext2D interface: document.createElement("canvas").getContext("2d") must inherit property "fill(optional CanvasFillRule)" with the proper type +PASS CanvasRenderingContext2D interface: calling fill(optional CanvasFillRule) on document.createElement("canvas").getContext("2d") with too few arguments must throw TypeError +PASS CanvasRenderingContext2D interface: document.createElement("canvas").getContext("2d") must inherit property "fill(Path2D, optional CanvasFillRule)" with the proper type +PASS CanvasRenderingContext2D interface: calling fill(Path2D, optional CanvasFillRule) on document.createElement("canvas").getContext("2d") with too few arguments must throw TypeError +PASS CanvasRenderingContext2D interface: document.createElement("canvas").getContext("2d") must inherit property "stroke()" with the proper type +PASS CanvasRenderingContext2D interface: document.createElement("canvas").getContext("2d") must inherit property "stroke(Path2D)" with the proper type +PASS CanvasRenderingContext2D interface: calling stroke(Path2D) on document.createElement("canvas").getContext("2d") with too few arguments must throw TypeError +PASS CanvasRenderingContext2D interface: document.createElement("canvas").getContext("2d") must inherit property "clip(optional CanvasFillRule)" with the proper type +PASS CanvasRenderingContext2D interface: calling clip(optional CanvasFillRule) on document.createElement("canvas").getContext("2d") with too few arguments must throw TypeError +PASS CanvasRenderingContext2D interface: document.createElement("canvas").getContext("2d") must inherit property "clip(Path2D, optional CanvasFillRule)" with the proper type +PASS CanvasRenderingContext2D interface: calling clip(Path2D, optional CanvasFillRule) on document.createElement("canvas").getContext("2d") with too few arguments must throw TypeError +PASS CanvasRenderingContext2D interface: document.createElement("canvas").getContext("2d") must inherit property "isPointInPath(unrestricted double, unrestricted double, optional CanvasFillRule)" with the proper type +PASS CanvasRenderingContext2D interface: calling isPointInPath(unrestricted double, unrestricted double, optional CanvasFillRule) on document.createElement("canvas").getContext("2d") with too few arguments must throw TypeError +PASS CanvasRenderingContext2D interface: document.createElement("canvas").getContext("2d") must inherit property "isPointInPath(Path2D, unrestricted double, unrestricted double, optional CanvasFillRule)" with the proper type +PASS CanvasRenderingContext2D interface: calling isPointInPath(Path2D, unrestricted double, unrestricted double, optional CanvasFillRule) on document.createElement("canvas").getContext("2d") with too few arguments must throw TypeError +PASS CanvasRenderingContext2D interface: document.createElement("canvas").getContext("2d") must inherit property "isPointInStroke(unrestricted double, unrestricted double)" with the proper type +PASS CanvasRenderingContext2D interface: calling isPointInStroke(unrestricted double, unrestricted double) on document.createElement("canvas").getContext("2d") with too few arguments must throw TypeError +PASS CanvasRenderingContext2D interface: document.createElement("canvas").getContext("2d") must inherit property "isPointInStroke(Path2D, unrestricted double, unrestricted double)" with the proper type +PASS CanvasRenderingContext2D interface: calling isPointInStroke(Path2D, unrestricted double, unrestricted double) on document.createElement("canvas").getContext("2d") with too few arguments must throw TypeError +PASS CanvasRenderingContext2D interface: document.createElement("canvas").getContext("2d") must inherit property "drawFocusIfNeeded(Element)" with the proper type +PASS CanvasRenderingContext2D interface: calling drawFocusIfNeeded(Element) on document.createElement("canvas").getContext("2d") with too few arguments must throw TypeError +PASS CanvasRenderingContext2D interface: document.createElement("canvas").getContext("2d") must inherit property "drawFocusIfNeeded(Path2D, Element)" with the proper type +PASS CanvasRenderingContext2D interface: calling drawFocusIfNeeded(Path2D, Element) on document.createElement("canvas").getContext("2d") with too few arguments must throw TypeError +PASS CanvasRenderingContext2D interface: document.createElement("canvas").getContext("2d") must inherit property "scrollPathIntoView()" with the proper type +PASS CanvasRenderingContext2D interface: document.createElement("canvas").getContext("2d") must inherit property "scrollPathIntoView(Path2D)" with the proper type +PASS CanvasRenderingContext2D interface: calling scrollPathIntoView(Path2D) on document.createElement("canvas").getContext("2d") with too few arguments must throw TypeError +PASS CanvasRenderingContext2D interface: document.createElement("canvas").getContext("2d") must inherit property "fillText(DOMString, unrestricted double, unrestricted double, optional unrestricted double)" with the proper type +PASS CanvasRenderingContext2D interface: calling fillText(DOMString, unrestricted double, unrestricted double, optional unrestricted double) on document.createElement("canvas").getContext("2d") with too few arguments must throw TypeError +PASS CanvasRenderingContext2D interface: document.createElement("canvas").getContext("2d") must inherit property "strokeText(DOMString, unrestricted double, unrestricted double, optional unrestricted double)" with the proper type +PASS CanvasRenderingContext2D interface: calling strokeText(DOMString, unrestricted double, unrestricted double, optional unrestricted double) on document.createElement("canvas").getContext("2d") with too few arguments must throw TypeError +PASS CanvasRenderingContext2D interface: document.createElement("canvas").getContext("2d") must inherit property "measureText(DOMString)" with the proper type +PASS CanvasRenderingContext2D interface: calling measureText(DOMString) on document.createElement("canvas").getContext("2d") with too few arguments must throw TypeError +PASS CanvasRenderingContext2D interface: document.createElement("canvas").getContext("2d") must inherit property "drawImage(CanvasImageSource, unrestricted double, unrestricted double)" with the proper type +PASS CanvasRenderingContext2D interface: calling drawImage(CanvasImageSource, unrestricted double, unrestricted double) on document.createElement("canvas").getContext("2d") with too few arguments must throw TypeError +PASS CanvasRenderingContext2D interface: document.createElement("canvas").getContext("2d") must inherit property "drawImage(CanvasImageSource, unrestricted double, unrestricted double, unrestricted double, unrestricted double)" with the proper type +PASS CanvasRenderingContext2D interface: calling drawImage(CanvasImageSource, unrestricted double, unrestricted double, unrestricted double, unrestricted double) on document.createElement("canvas").getContext("2d") with too few arguments must throw TypeError +PASS CanvasRenderingContext2D interface: document.createElement("canvas").getContext("2d") must inherit property "drawImage(CanvasImageSource, unrestricted double, unrestricted double, unrestricted double, unrestricted double, unrestricted double, unrestricted double, unrestricted double, unrestricted double)" with the proper type +PASS CanvasRenderingContext2D interface: calling drawImage(CanvasImageSource, unrestricted double, unrestricted double, unrestricted double, unrestricted double, unrestricted double, unrestricted double, unrestricted double, unrestricted double) on document.createElement("canvas").getContext("2d") with too few arguments must throw TypeError +PASS CanvasRenderingContext2D interface: document.createElement("canvas").getContext("2d") must inherit property "createImageData(long, long)" with the proper type +PASS CanvasRenderingContext2D interface: calling createImageData(long, long) on document.createElement("canvas").getContext("2d") with too few arguments must throw TypeError +PASS CanvasRenderingContext2D interface: document.createElement("canvas").getContext("2d") must inherit property "createImageData(ImageData)" with the proper type +PASS CanvasRenderingContext2D interface: calling createImageData(ImageData) on document.createElement("canvas").getContext("2d") with too few arguments must throw TypeError +PASS CanvasRenderingContext2D interface: document.createElement("canvas").getContext("2d") must inherit property "getImageData(long, long, long, long)" with the proper type +PASS CanvasRenderingContext2D interface: calling getImageData(long, long, long, long) on document.createElement("canvas").getContext("2d") with too few arguments must throw TypeError +PASS CanvasRenderingContext2D interface: document.createElement("canvas").getContext("2d") must inherit property "putImageData(ImageData, long, long)" with the proper type +PASS CanvasRenderingContext2D interface: calling putImageData(ImageData, long, long) on document.createElement("canvas").getContext("2d") with too few arguments must throw TypeError +PASS CanvasRenderingContext2D interface: document.createElement("canvas").getContext("2d") must inherit property "putImageData(ImageData, long, long, long, long, long, long)" with the proper type +PASS CanvasRenderingContext2D interface: calling putImageData(ImageData, long, long, long, long, long, long) on document.createElement("canvas").getContext("2d") with too few arguments must throw TypeError +PASS CanvasRenderingContext2D interface: document.createElement("canvas").getContext("2d") must inherit property "lineWidth" with the proper type +PASS CanvasRenderingContext2D interface: document.createElement("canvas").getContext("2d") must inherit property "lineCap" with the proper type +PASS CanvasRenderingContext2D interface: document.createElement("canvas").getContext("2d") must inherit property "lineJoin" with the proper type +PASS CanvasRenderingContext2D interface: document.createElement("canvas").getContext("2d") must inherit property "miterLimit" with the proper type +PASS CanvasRenderingContext2D interface: document.createElement("canvas").getContext("2d") must inherit property "setLineDash(sequence<unrestricted double>)" with the proper type +PASS CanvasRenderingContext2D interface: calling setLineDash(sequence<unrestricted double>) on document.createElement("canvas").getContext("2d") with too few arguments must throw TypeError +PASS CanvasRenderingContext2D interface: document.createElement("canvas").getContext("2d") must inherit property "getLineDash()" with the proper type +PASS CanvasRenderingContext2D interface: document.createElement("canvas").getContext("2d") must inherit property "lineDashOffset" with the proper type +PASS CanvasRenderingContext2D interface: document.createElement("canvas").getContext("2d") must inherit property "font" with the proper type +PASS CanvasRenderingContext2D interface: document.createElement("canvas").getContext("2d") must inherit property "textAlign" with the proper type +PASS CanvasRenderingContext2D interface: document.createElement("canvas").getContext("2d") must inherit property "textBaseline" with the proper type +PASS CanvasRenderingContext2D interface: document.createElement("canvas").getContext("2d") must inherit property "direction" with the proper type +PASS CanvasRenderingContext2D interface: document.createElement("canvas").getContext("2d") must inherit property "closePath()" with the proper type +PASS CanvasRenderingContext2D interface: document.createElement("canvas").getContext("2d") must inherit property "moveTo(unrestricted double, unrestricted double)" with the proper type +PASS CanvasRenderingContext2D interface: calling moveTo(unrestricted double, unrestricted double) on document.createElement("canvas").getContext("2d") with too few arguments must throw TypeError +PASS CanvasRenderingContext2D interface: document.createElement("canvas").getContext("2d") must inherit property "lineTo(unrestricted double, unrestricted double)" with the proper type +PASS CanvasRenderingContext2D interface: calling lineTo(unrestricted double, unrestricted double) on document.createElement("canvas").getContext("2d") with too few arguments must throw TypeError +PASS CanvasRenderingContext2D interface: document.createElement("canvas").getContext("2d") must inherit property "quadraticCurveTo(unrestricted double, unrestricted double, unrestricted double, unrestricted double)" with the proper type +PASS CanvasRenderingContext2D interface: calling quadraticCurveTo(unrestricted double, unrestricted double, unrestricted double, unrestricted double) on document.createElement("canvas").getContext("2d") with too few arguments must throw TypeError +PASS CanvasRenderingContext2D interface: document.createElement("canvas").getContext("2d") must inherit property "bezierCurveTo(unrestricted double, unrestricted double, unrestricted double, unrestricted double, unrestricted double, unrestricted double)" with the proper type +PASS CanvasRenderingContext2D interface: calling bezierCurveTo(unrestricted double, unrestricted double, unrestricted double, unrestricted double, unrestricted double, unrestricted double) on document.createElement("canvas").getContext("2d") with too few arguments must throw TypeError +PASS CanvasRenderingContext2D interface: document.createElement("canvas").getContext("2d") must inherit property "arcTo(unrestricted double, unrestricted double, unrestricted double, unrestricted double, unrestricted double)" with the proper type +PASS CanvasRenderingContext2D interface: calling arcTo(unrestricted double, unrestricted double, unrestricted double, unrestricted double, unrestricted double) on document.createElement("canvas").getContext("2d") with too few arguments must throw TypeError +PASS CanvasRenderingContext2D interface: document.createElement("canvas").getContext("2d") must inherit property "rect(unrestricted double, unrestricted double, unrestricted double, unrestricted double)" with the proper type +PASS CanvasRenderingContext2D interface: calling rect(unrestricted double, unrestricted double, unrestricted double, unrestricted double) on document.createElement("canvas").getContext("2d") with too few arguments must throw TypeError +PASS CanvasRenderingContext2D interface: document.createElement("canvas").getContext("2d") must inherit property "arc(unrestricted double, unrestricted double, unrestricted double, unrestricted double, unrestricted double, optional boolean)" with the proper type +PASS CanvasRenderingContext2D interface: calling arc(unrestricted double, unrestricted double, unrestricted double, unrestricted double, unrestricted double, optional boolean) on document.createElement("canvas").getContext("2d") with too few arguments must throw TypeError +PASS CanvasRenderingContext2D interface: document.createElement("canvas").getContext("2d") must inherit property "ellipse(unrestricted double, unrestricted double, unrestricted double, unrestricted double, unrestricted double, unrestricted double, unrestricted double, optional boolean)" with the proper type +PASS CanvasRenderingContext2D interface: calling ellipse(unrestricted double, unrestricted double, unrestricted double, unrestricted double, unrestricted double, unrestricted double, unrestricted double, optional boolean) on document.createElement("canvas").getContext("2d") with too few arguments must throw TypeError +PASS CanvasGradient interface: existence and properties of interface object +PASS CanvasGradient interface object length +PASS CanvasGradient interface object name +PASS CanvasGradient interface: existence and properties of interface prototype object +PASS CanvasGradient interface: existence and properties of interface prototype object's "constructor" property +PASS CanvasGradient interface: existence and properties of interface prototype object's @@unscopables property +PASS CanvasGradient interface: operation addColorStop(double, DOMString) +PASS CanvasPattern interface: existence and properties of interface object +PASS CanvasPattern interface object length +PASS CanvasPattern interface object name +PASS CanvasPattern interface: existence and properties of interface prototype object +PASS CanvasPattern interface: existence and properties of interface prototype object's "constructor" property +PASS CanvasPattern interface: existence and properties of interface prototype object's @@unscopables property +PASS CanvasPattern interface: operation setTransform(optional DOMMatrix2DInit) +PASS TextMetrics interface: existence and properties of interface object +PASS TextMetrics interface object length +PASS TextMetrics interface object name +PASS TextMetrics interface: existence and properties of interface prototype object +PASS TextMetrics interface: existence and properties of interface prototype object's "constructor" property +PASS TextMetrics interface: existence and properties of interface prototype object's @@unscopables property +PASS TextMetrics interface: attribute width +PASS TextMetrics interface: attribute actualBoundingBoxLeft +PASS TextMetrics interface: attribute actualBoundingBoxRight +PASS TextMetrics interface: attribute fontBoundingBoxAscent +PASS TextMetrics interface: attribute fontBoundingBoxDescent +PASS TextMetrics interface: attribute actualBoundingBoxAscent +PASS TextMetrics interface: attribute actualBoundingBoxDescent +PASS TextMetrics interface: attribute emHeightAscent +PASS TextMetrics interface: attribute emHeightDescent +FAIL TextMetrics interface: attribute hangingBaseline assert_true: The prototype object must have a property "hangingBaseline" expected true got false +FAIL TextMetrics interface: attribute alphabeticBaseline assert_true: The prototype object must have a property "alphabeticBaseline" expected true got false +FAIL TextMetrics interface: attribute ideographicBaseline assert_true: The prototype object must have a property "ideographicBaseline" expected true got false +PASS ImageData interface: existence and properties of interface object +PASS ImageData interface object length +PASS ImageData interface object name +PASS ImageData interface: existence and properties of interface prototype object +PASS ImageData interface: existence and properties of interface prototype object's "constructor" property +PASS ImageData interface: existence and properties of interface prototype object's @@unscopables property +PASS ImageData interface: attribute width +PASS ImageData interface: attribute height +PASS ImageData interface: attribute data +PASS ImageData must be primary interface of new ImageData(10, 10) +PASS Stringification of new ImageData(10, 10) +PASS ImageData interface: new ImageData(10, 10) must inherit property "width" with the proper type +PASS ImageData interface: new ImageData(10, 10) must inherit property "height" with the proper type +FAIL ImageData interface: new ImageData(10, 10) must inherit property "data" with the proper type assert_inherits: property "data" found on object expected in prototype chain +PASS Path2D interface: existence and properties of interface object +PASS Path2D interface object length +PASS Path2D interface object name +PASS Path2D interface: existence and properties of interface prototype object +PASS Path2D interface: existence and properties of interface prototype object's "constructor" property +PASS Path2D interface: existence and properties of interface prototype object's @@unscopables property +PASS Path2D interface: operation addPath(Path2D, optional DOMMatrix2DInit) +PASS Path2D interface: operation closePath() +PASS Path2D interface: operation moveTo(unrestricted double, unrestricted double) +PASS Path2D interface: operation lineTo(unrestricted double, unrestricted double) +PASS Path2D interface: operation quadraticCurveTo(unrestricted double, unrestricted double, unrestricted double, unrestricted double) +PASS Path2D interface: operation bezierCurveTo(unrestricted double, unrestricted double, unrestricted double, unrestricted double, unrestricted double, unrestricted double) +PASS Path2D interface: operation arcTo(unrestricted double, unrestricted double, unrestricted double, unrestricted double, unrestricted double) +PASS Path2D interface: operation rect(unrestricted double, unrestricted double, unrestricted double, unrestricted double) +PASS Path2D interface: operation arc(unrestricted double, unrestricted double, unrestricted double, unrestricted double, unrestricted double, optional boolean) +PASS Path2D interface: operation ellipse(unrestricted double, unrestricted double, unrestricted double, unrestricted double, unrestricted double, unrestricted double, unrestricted double, optional boolean) +PASS ImageBitmapRenderingContext interface: existence and properties of interface object +PASS ImageBitmapRenderingContext interface object length +PASS ImageBitmapRenderingContext interface object name +PASS ImageBitmapRenderingContext interface: existence and properties of interface prototype object +PASS ImageBitmapRenderingContext interface: existence and properties of interface prototype object's "constructor" property +PASS ImageBitmapRenderingContext interface: existence and properties of interface prototype object's @@unscopables property +PASS ImageBitmapRenderingContext interface: attribute canvas +PASS ImageBitmapRenderingContext interface: operation transferFromImageBitmap(ImageBitmap?) +PASS OffscreenCanvas interface: existence and properties of interface object +PASS OffscreenCanvas interface object length +PASS OffscreenCanvas interface object name +PASS OffscreenCanvas interface: existence and properties of interface prototype object +PASS OffscreenCanvas interface: existence and properties of interface prototype object's "constructor" property +PASS OffscreenCanvas interface: existence and properties of interface prototype object's @@unscopables property +PASS OffscreenCanvas interface: attribute width +PASS OffscreenCanvas interface: attribute height +PASS OffscreenCanvas interface: operation getContext(OffscreenRenderingContextId, optional any) +PASS OffscreenCanvas interface: operation transferToImageBitmap() +PASS OffscreenCanvas interface: operation convertToBlob(optional ImageEncodeOptions) +PASS OffscreenCanvasRenderingContext2D interface: existence and properties of interface object +PASS OffscreenCanvasRenderingContext2D interface object length +PASS OffscreenCanvasRenderingContext2D interface object name +PASS OffscreenCanvasRenderingContext2D interface: existence and properties of interface prototype object +PASS OffscreenCanvasRenderingContext2D interface: existence and properties of interface prototype object's "constructor" property +PASS OffscreenCanvasRenderingContext2D interface: existence and properties of interface prototype object's @@unscopables property +PASS OffscreenCanvasRenderingContext2D interface: operation commit() +PASS OffscreenCanvasRenderingContext2D interface: attribute canvas +PASS OffscreenCanvasRenderingContext2D interface: operation save() +PASS OffscreenCanvasRenderingContext2D interface: operation restore() +PASS OffscreenCanvasRenderingContext2D interface: operation scale(unrestricted double, unrestricted double) +PASS OffscreenCanvasRenderingContext2D interface: operation rotate(unrestricted double) +PASS OffscreenCanvasRenderingContext2D interface: operation translate(unrestricted double, unrestricted double) +PASS OffscreenCanvasRenderingContext2D interface: operation transform(unrestricted double, unrestricted double, unrestricted double, unrestricted double, unrestricted double, unrestricted double) +PASS OffscreenCanvasRenderingContext2D interface: operation getTransform() +PASS OffscreenCanvasRenderingContext2D interface: operation setTransform(unrestricted double, unrestricted double, unrestricted double, unrestricted double, unrestricted double, unrestricted double) +PASS OffscreenCanvasRenderingContext2D interface: operation setTransform(optional DOMMatrix2DInit) +PASS OffscreenCanvasRenderingContext2D interface: operation resetTransform() +PASS OffscreenCanvasRenderingContext2D interface: attribute globalAlpha +PASS OffscreenCanvasRenderingContext2D interface: attribute globalCompositeOperation +PASS OffscreenCanvasRenderingContext2D interface: attribute imageSmoothingEnabled +PASS OffscreenCanvasRenderingContext2D interface: attribute imageSmoothingQuality +PASS OffscreenCanvasRenderingContext2D interface: attribute strokeStyle +PASS OffscreenCanvasRenderingContext2D interface: attribute fillStyle +PASS OffscreenCanvasRenderingContext2D interface: operation createLinearGradient(double, double, double, double) +PASS OffscreenCanvasRenderingContext2D interface: operation createRadialGradient(double, double, double, double, double, double) +PASS OffscreenCanvasRenderingContext2D interface: operation createPattern(CanvasImageSource, DOMString) +PASS OffscreenCanvasRenderingContext2D interface: attribute shadowOffsetX +PASS OffscreenCanvasRenderingContext2D interface: attribute shadowOffsetY +PASS OffscreenCanvasRenderingContext2D interface: attribute shadowBlur +PASS OffscreenCanvasRenderingContext2D interface: attribute shadowColor +PASS OffscreenCanvasRenderingContext2D interface: attribute filter +PASS OffscreenCanvasRenderingContext2D interface: operation clearRect(unrestricted double, unrestricted double, unrestricted double, unrestricted double) +PASS OffscreenCanvasRenderingContext2D interface: operation fillRect(unrestricted double, unrestricted double, unrestricted double, unrestricted double) +PASS OffscreenCanvasRenderingContext2D interface: operation strokeRect(unrestricted double, unrestricted double, unrestricted double, unrestricted double) +PASS OffscreenCanvasRenderingContext2D interface: operation beginPath() +PASS OffscreenCanvasRenderingContext2D interface: operation fill(optional CanvasFillRule) +PASS OffscreenCanvasRenderingContext2D interface: operation fill(Path2D, optional CanvasFillRule) +PASS OffscreenCanvasRenderingContext2D interface: operation stroke() +PASS OffscreenCanvasRenderingContext2D interface: operation stroke(Path2D) +PASS OffscreenCanvasRenderingContext2D interface: operation clip(optional CanvasFillRule) +PASS OffscreenCanvasRenderingContext2D interface: operation clip(Path2D, optional CanvasFillRule) +PASS OffscreenCanvasRenderingContext2D interface: operation isPointInPath(unrestricted double, unrestricted double, optional CanvasFillRule) +PASS OffscreenCanvasRenderingContext2D interface: operation isPointInPath(Path2D, unrestricted double, unrestricted double, optional CanvasFillRule) +PASS OffscreenCanvasRenderingContext2D interface: operation isPointInStroke(unrestricted double, unrestricted double) +PASS OffscreenCanvasRenderingContext2D interface: operation isPointInStroke(Path2D, unrestricted double, unrestricted double) +PASS OffscreenCanvasRenderingContext2D interface: operation fillText(DOMString, unrestricted double, unrestricted double, optional unrestricted double) +PASS OffscreenCanvasRenderingContext2D interface: operation strokeText(DOMString, unrestricted double, unrestricted double, optional unrestricted double) +PASS OffscreenCanvasRenderingContext2D interface: operation measureText(DOMString) +PASS OffscreenCanvasRenderingContext2D interface: operation drawImage(CanvasImageSource, unrestricted double, unrestricted double) +PASS OffscreenCanvasRenderingContext2D interface: operation drawImage(CanvasImageSource, unrestricted double, unrestricted double, unrestricted double, unrestricted double) +PASS OffscreenCanvasRenderingContext2D interface: operation drawImage(CanvasImageSource, unrestricted double, unrestricted double, unrestricted double, unrestricted double, unrestricted double, unrestricted double, unrestricted double, unrestricted double) +PASS OffscreenCanvasRenderingContext2D interface: operation createImageData(long, long) +PASS OffscreenCanvasRenderingContext2D interface: operation createImageData(ImageData) +PASS OffscreenCanvasRenderingContext2D interface: operation getImageData(long, long, long, long) +PASS OffscreenCanvasRenderingContext2D interface: operation putImageData(ImageData, long, long) +PASS OffscreenCanvasRenderingContext2D interface: operation putImageData(ImageData, long, long, long, long, long, long) +PASS OffscreenCanvasRenderingContext2D interface: attribute lineWidth +PASS OffscreenCanvasRenderingContext2D interface: attribute lineCap +PASS OffscreenCanvasRenderingContext2D interface: attribute lineJoin +PASS OffscreenCanvasRenderingContext2D interface: attribute miterLimit +PASS OffscreenCanvasRenderingContext2D interface: operation setLineDash(sequence<unrestricted double>) +PASS OffscreenCanvasRenderingContext2D interface: operation getLineDash() +PASS OffscreenCanvasRenderingContext2D interface: attribute lineDashOffset +PASS OffscreenCanvasRenderingContext2D interface: attribute font +PASS OffscreenCanvasRenderingContext2D interface: attribute textAlign +PASS OffscreenCanvasRenderingContext2D interface: attribute textBaseline +PASS OffscreenCanvasRenderingContext2D interface: attribute direction +PASS OffscreenCanvasRenderingContext2D interface: operation closePath() +PASS OffscreenCanvasRenderingContext2D interface: operation moveTo(unrestricted double, unrestricted double) +PASS OffscreenCanvasRenderingContext2D interface: operation lineTo(unrestricted double, unrestricted double) +PASS OffscreenCanvasRenderingContext2D interface: operation quadraticCurveTo(unrestricted double, unrestricted double, unrestricted double, unrestricted double) +PASS OffscreenCanvasRenderingContext2D interface: operation bezierCurveTo(unrestricted double, unrestricted double, unrestricted double, unrestricted double, unrestricted double, unrestricted double) +PASS OffscreenCanvasRenderingContext2D interface: operation arcTo(unrestricted double, unrestricted double, unrestricted double, unrestricted double, unrestricted double) +PASS OffscreenCanvasRenderingContext2D interface: operation rect(unrestricted double, unrestricted double, unrestricted double, unrestricted double) +PASS OffscreenCanvasRenderingContext2D interface: operation arc(unrestricted double, unrestricted double, unrestricted double, unrestricted double, unrestricted double, optional boolean) +PASS OffscreenCanvasRenderingContext2D interface: operation ellipse(unrestricted double, unrestricted double, unrestricted double, unrestricted double, unrestricted double, unrestricted double, unrestricted double, optional boolean) +PASS CustomElementRegistry interface: existence and properties of interface object +PASS CustomElementRegistry interface object length +PASS CustomElementRegistry interface object name +PASS CustomElementRegistry interface: existence and properties of interface prototype object +PASS CustomElementRegistry interface: existence and properties of interface prototype object's "constructor" property +PASS CustomElementRegistry interface: existence and properties of interface prototype object's @@unscopables property +PASS CustomElementRegistry interface: operation define(DOMString, CustomElementConstructor, optional ElementDefinitionOptions) +PASS CustomElementRegistry interface: operation get(DOMString) +PASS CustomElementRegistry interface: operation whenDefined(DOMString) +PASS CustomElementRegistry interface: operation upgrade(Node) +PASS ElementInternals interface: existence and properties of interface object +PASS ElementInternals interface object length +PASS ElementInternals interface object name +PASS ElementInternals interface: existence and properties of interface prototype object +PASS ElementInternals interface: existence and properties of interface prototype object's "constructor" property +PASS ElementInternals interface: existence and properties of interface prototype object's @@unscopables property +PASS ElementInternals interface: operation setFormValue((File or USVString or FormData)?, optional (File or USVString or FormData)?) +PASS ElementInternals interface: attribute form +FAIL ElementInternals interface: operation setValidity(optional ValidityStateFlags, optional DOMString, optional HTMLElement) assert_equals: property has wrong .length expected 0 but got 1 +PASS ElementInternals interface: attribute willValidate +PASS ElementInternals interface: attribute validity +PASS ElementInternals interface: attribute validationMessage +PASS ElementInternals interface: operation checkValidity() +PASS ElementInternals interface: operation reportValidity() +PASS ElementInternals interface: attribute labels +PASS DataTransfer interface: existence and properties of interface object +PASS DataTransfer interface object length +PASS DataTransfer interface object name +PASS DataTransfer interface: existence and properties of interface prototype object +PASS DataTransfer interface: existence and properties of interface prototype object's "constructor" property +PASS DataTransfer interface: existence and properties of interface prototype object's @@unscopables property +PASS DataTransfer interface: attribute dropEffect +PASS DataTransfer interface: attribute effectAllowed +PASS DataTransfer interface: attribute items +PASS DataTransfer interface: operation setDragImage(Element, long, long) +PASS DataTransfer interface: attribute types +PASS DataTransfer interface: operation getData(DOMString) +PASS DataTransfer interface: operation setData(DOMString, DOMString) +PASS DataTransfer interface: operation clearData(optional DOMString) +PASS DataTransfer interface: attribute files +PASS DataTransferItemList interface: existence and properties of interface object +PASS DataTransferItemList interface object length +PASS DataTransferItemList interface object name +PASS DataTransferItemList interface: existence and properties of interface prototype object +PASS DataTransferItemList interface: existence and properties of interface prototype object's "constructor" property +PASS DataTransferItemList interface: existence and properties of interface prototype object's @@unscopables property +PASS DataTransferItemList interface: attribute length +PASS DataTransferItemList interface: operation add(DOMString, DOMString) +PASS DataTransferItemList interface: operation add(File) +PASS DataTransferItemList interface: operation remove(unsigned long) +PASS DataTransferItemList interface: operation clear() +PASS DataTransferItem interface: existence and properties of interface object +PASS DataTransferItem interface object length +PASS DataTransferItem interface object name +PASS DataTransferItem interface: existence and properties of interface prototype object +PASS DataTransferItem interface: existence and properties of interface prototype object's "constructor" property +PASS DataTransferItem interface: existence and properties of interface prototype object's @@unscopables property +PASS DataTransferItem interface: attribute kind +PASS DataTransferItem interface: attribute type +PASS DataTransferItem interface: operation getAsString(FunctionStringCallback?) +PASS DataTransferItem interface: operation getAsFile() +PASS DragEvent interface: existence and properties of interface object +PASS DragEvent interface object length +PASS DragEvent interface object name +PASS DragEvent interface: existence and properties of interface prototype object +PASS DragEvent interface: existence and properties of interface prototype object's "constructor" property +PASS DragEvent interface: existence and properties of interface prototype object's @@unscopables property +PASS DragEvent interface: attribute dataTransfer +PASS BarProp interface: existence and properties of interface object +PASS BarProp interface object length +PASS BarProp interface object name +PASS BarProp interface: existence and properties of interface prototype object +PASS BarProp interface: existence and properties of interface prototype object's "constructor" property +PASS BarProp interface: existence and properties of interface prototype object's @@unscopables property +PASS BarProp interface: attribute visible +PASS History interface: existence and properties of interface object +PASS History interface object length +PASS History interface object name +PASS History interface: existence and properties of interface prototype object +PASS History interface: existence and properties of interface prototype object's "constructor" property +PASS History interface: existence and properties of interface prototype object's @@unscopables property +PASS History interface: attribute length +PASS History interface: attribute scrollRestoration +PASS History interface: attribute state +PASS History interface: operation go(optional long) +PASS History interface: operation back() +PASS History interface: operation forward() +PASS History interface: operation pushState(any, DOMString, optional USVString?) +PASS History interface: operation replaceState(any, DOMString, optional USVString?) +PASS History must be primary interface of window.history +PASS Stringification of window.history +PASS History interface: window.history must inherit property "length" with the proper type +PASS History interface: window.history must inherit property "scrollRestoration" with the proper type +PASS History interface: window.history must inherit property "state" with the proper type +PASS History interface: window.history must inherit property "go(optional long)" with the proper type +PASS History interface: calling go(optional long) on window.history with too few arguments must throw TypeError +PASS History interface: window.history must inherit property "back()" with the proper type +PASS History interface: window.history must inherit property "forward()" with the proper type +PASS History interface: window.history must inherit property "pushState(any, DOMString, optional USVString?)" with the proper type +PASS History interface: calling pushState(any, DOMString, optional USVString?) on window.history with too few arguments must throw TypeError +PASS History interface: window.history must inherit property "replaceState(any, DOMString, optional USVString?)" with the proper type +PASS History interface: calling replaceState(any, DOMString, optional USVString?) on window.history with too few arguments must throw TypeError +PASS Location interface: existence and properties of interface object +PASS Location interface object length +PASS Location interface object name +PASS Location interface: existence and properties of interface prototype object +PASS Location interface: existence and properties of interface prototype object's "constructor" property +PASS Location interface: existence and properties of interface prototype object's @@unscopables property +FAIL Location interface: stringifier assert_own_property: interface prototype object missing non-static operation expected property "toString" missing +PASS Location must be primary interface of window.location +PASS Stringification of window.location +FAIL Location interface: window.location must have own property "href" assert_false: property descriptor should not have a "value" field expected false got true +PASS Location interface: window.location must have own property "origin" +PASS Location interface: window.location must have own property "protocol" +PASS Location interface: window.location must have own property "host" +PASS Location interface: window.location must have own property "hostname" +PASS Location interface: window.location must have own property "port" +PASS Location interface: window.location must have own property "pathname" +PASS Location interface: window.location must have own property "search" +PASS Location interface: window.location must have own property "hash" +PASS Location interface: window.location must have own property "assign" +PASS Location interface: calling assign(USVString) on window.location with too few arguments must throw TypeError +PASS Location interface: window.location must have own property "replace" +PASS Location interface: calling replace(USVString) on window.location with too few arguments must throw TypeError +PASS Location interface: window.location must have own property "reload" +PASS Location interface: window.location must have own property "ancestorOrigins" +PASS PopStateEvent interface: existence and properties of interface object +PASS PopStateEvent interface object length +PASS PopStateEvent interface object name +PASS PopStateEvent interface: existence and properties of interface prototype object +PASS PopStateEvent interface: existence and properties of interface prototype object's "constructor" property +PASS PopStateEvent interface: existence and properties of interface prototype object's @@unscopables property +PASS PopStateEvent interface: attribute state +PASS PopStateEvent must be primary interface of new PopStateEvent("popstate", { data: {} }) +PASS Stringification of new PopStateEvent("popstate", { data: {} }) +PASS PopStateEvent interface: new PopStateEvent("popstate", { data: {} }) must inherit property "state" with the proper type +PASS HashChangeEvent interface: existence and properties of interface object +PASS HashChangeEvent interface object length +PASS HashChangeEvent interface object name +PASS HashChangeEvent interface: existence and properties of interface prototype object +PASS HashChangeEvent interface: existence and properties of interface prototype object's "constructor" property +PASS HashChangeEvent interface: existence and properties of interface prototype object's @@unscopables property +PASS HashChangeEvent interface: attribute oldURL +PASS HashChangeEvent interface: attribute newURL +PASS PageTransitionEvent interface: existence and properties of interface object +PASS PageTransitionEvent interface object length +PASS PageTransitionEvent interface object name +PASS PageTransitionEvent interface: existence and properties of interface prototype object +PASS PageTransitionEvent interface: existence and properties of interface prototype object's "constructor" property +PASS PageTransitionEvent interface: existence and properties of interface prototype object's @@unscopables property +PASS PageTransitionEvent interface: attribute persisted +PASS BeforeUnloadEvent interface: existence and properties of interface object +PASS BeforeUnloadEvent interface object length +PASS BeforeUnloadEvent interface object name +PASS BeforeUnloadEvent interface: existence and properties of interface prototype object +PASS BeforeUnloadEvent interface: existence and properties of interface prototype object's "constructor" property +PASS BeforeUnloadEvent interface: existence and properties of interface prototype object's @@unscopables property +PASS BeforeUnloadEvent interface: attribute returnValue +FAIL ApplicationCache interface: existence and properties of interface object assert_own_property: self does not have own property "ApplicationCache" expected property "ApplicationCache" missing +FAIL ApplicationCache interface object length assert_own_property: self does not have own property "ApplicationCache" expected property "ApplicationCache" missing +FAIL ApplicationCache interface object name assert_own_property: self does not have own property "ApplicationCache" expected property "ApplicationCache" missing +FAIL ApplicationCache interface: existence and properties of interface prototype object assert_own_property: self does not have own property "ApplicationCache" expected property "ApplicationCache" missing +FAIL ApplicationCache interface: existence and properties of interface prototype object's "constructor" property assert_own_property: self does not have own property "ApplicationCache" expected property "ApplicationCache" missing +FAIL ApplicationCache interface: existence and properties of interface prototype object's @@unscopables property assert_own_property: self does not have own property "ApplicationCache" expected property "ApplicationCache" missing +FAIL ApplicationCache interface: constant UNCACHED on interface object assert_own_property: self does not have own property "ApplicationCache" expected property "ApplicationCache" missing +FAIL ApplicationCache interface: constant UNCACHED on interface prototype object assert_own_property: self does not have own property "ApplicationCache" expected property "ApplicationCache" missing +FAIL ApplicationCache interface: constant IDLE on interface object assert_own_property: self does not have own property "ApplicationCache" expected property "ApplicationCache" missing +FAIL ApplicationCache interface: constant IDLE on interface prototype object assert_own_property: self does not have own property "ApplicationCache" expected property "ApplicationCache" missing +FAIL ApplicationCache interface: constant CHECKING on interface object assert_own_property: self does not have own property "ApplicationCache" expected property "ApplicationCache" missing +FAIL ApplicationCache interface: constant CHECKING on interface prototype object assert_own_property: self does not have own property "ApplicationCache" expected property "ApplicationCache" missing +FAIL ApplicationCache interface: constant DOWNLOADING on interface object assert_own_property: self does not have own property "ApplicationCache" expected property "ApplicationCache" missing +FAIL ApplicationCache interface: constant DOWNLOADING on interface prototype object assert_own_property: self does not have own property "ApplicationCache" expected property "ApplicationCache" missing +FAIL ApplicationCache interface: constant UPDATEREADY on interface object assert_own_property: self does not have own property "ApplicationCache" expected property "ApplicationCache" missing +FAIL ApplicationCache interface: constant UPDATEREADY on interface prototype object assert_own_property: self does not have own property "ApplicationCache" expected property "ApplicationCache" missing +FAIL ApplicationCache interface: constant OBSOLETE on interface object assert_own_property: self does not have own property "ApplicationCache" expected property "ApplicationCache" missing +FAIL ApplicationCache interface: constant OBSOLETE on interface prototype object assert_own_property: self does not have own property "ApplicationCache" expected property "ApplicationCache" missing +FAIL ApplicationCache interface: attribute status assert_own_property: self does not have own property "ApplicationCache" expected property "ApplicationCache" missing +FAIL ApplicationCache interface: operation update() assert_own_property: self does not have own property "ApplicationCache" expected property "ApplicationCache" missing +FAIL ApplicationCache interface: operation abort() assert_own_property: self does not have own property "ApplicationCache" expected property "ApplicationCache" missing +FAIL ApplicationCache interface: operation swapCache() assert_own_property: self does not have own property "ApplicationCache" expected property "ApplicationCache" missing +FAIL ApplicationCache interface: attribute onchecking assert_own_property: self does not have own property "ApplicationCache" expected property "ApplicationCache" missing +FAIL ApplicationCache interface: attribute onerror assert_own_property: self does not have own property "ApplicationCache" expected property "ApplicationCache" missing +FAIL ApplicationCache interface: attribute onnoupdate assert_own_property: self does not have own property "ApplicationCache" expected property "ApplicationCache" missing +FAIL ApplicationCache interface: attribute ondownloading assert_own_property: self does not have own property "ApplicationCache" expected property "ApplicationCache" missing +FAIL ApplicationCache interface: attribute onprogress assert_own_property: self does not have own property "ApplicationCache" expected property "ApplicationCache" missing +FAIL ApplicationCache interface: attribute onupdateready assert_own_property: self does not have own property "ApplicationCache" expected property "ApplicationCache" missing +FAIL ApplicationCache interface: attribute oncached assert_own_property: self does not have own property "ApplicationCache" expected property "ApplicationCache" missing +FAIL ApplicationCache interface: attribute onobsolete assert_own_property: self does not have own property "ApplicationCache" expected property "ApplicationCache" missing +FAIL ApplicationCache must be primary interface of window.applicationCache assert_equals: wrong typeof object expected "object" but got "undefined" +FAIL Stringification of window.applicationCache assert_equals: wrong typeof object expected "object" but got "undefined" +FAIL ApplicationCache interface: window.applicationCache must inherit property "UNCACHED" with the proper type assert_equals: wrong typeof object expected "object" but got "undefined" +FAIL ApplicationCache interface: window.applicationCache must inherit property "IDLE" with the proper type assert_equals: wrong typeof object expected "object" but got "undefined" +FAIL ApplicationCache interface: window.applicationCache must inherit property "CHECKING" with the proper type assert_equals: wrong typeof object expected "object" but got "undefined" +FAIL ApplicationCache interface: window.applicationCache must inherit property "DOWNLOADING" with the proper type assert_equals: wrong typeof object expected "object" but got "undefined" +FAIL ApplicationCache interface: window.applicationCache must inherit property "UPDATEREADY" with the proper type assert_equals: wrong typeof object expected "object" but got "undefined" +FAIL ApplicationCache interface: window.applicationCache must inherit property "OBSOLETE" with the proper type assert_equals: wrong typeof object expected "object" but got "undefined" +FAIL ApplicationCache interface: window.applicationCache must inherit property "status" with the proper type assert_equals: wrong typeof object expected "object" but got "undefined" +FAIL ApplicationCache interface: window.applicationCache must inherit property "update()" with the proper type assert_equals: wrong typeof object expected "object" but got "undefined" +FAIL ApplicationCache interface: window.applicationCache must inherit property "abort()" with the proper type assert_equals: wrong typeof object expected "object" but got "undefined" +FAIL ApplicationCache interface: window.applicationCache must inherit property "swapCache()" with the proper type assert_equals: wrong typeof object expected "object" but got "undefined" +FAIL ApplicationCache interface: window.applicationCache must inherit property "onchecking" with the proper type assert_equals: wrong typeof object expected "object" but got "undefined" +FAIL ApplicationCache interface: window.applicationCache must inherit property "onerror" with the proper type assert_equals: wrong typeof object expected "object" but got "undefined" +FAIL ApplicationCache interface: window.applicationCache must inherit property "onnoupdate" with the proper type assert_equals: wrong typeof object expected "object" but got "undefined" +FAIL ApplicationCache interface: window.applicationCache must inherit property "ondownloading" with the proper type assert_equals: wrong typeof object expected "object" but got "undefined" +FAIL ApplicationCache interface: window.applicationCache must inherit property "onprogress" with the proper type assert_equals: wrong typeof object expected "object" but got "undefined" +FAIL ApplicationCache interface: window.applicationCache must inherit property "onupdateready" with the proper type assert_equals: wrong typeof object expected "object" but got "undefined" +FAIL ApplicationCache interface: window.applicationCache must inherit property "oncached" with the proper type assert_equals: wrong typeof object expected "object" but got "undefined" +FAIL ApplicationCache interface: window.applicationCache must inherit property "onobsolete" with the proper type assert_equals: wrong typeof object expected "object" but got "undefined" +PASS ErrorEvent interface: existence and properties of interface object +PASS ErrorEvent interface object length +PASS ErrorEvent interface object name +PASS ErrorEvent interface: existence and properties of interface prototype object +PASS ErrorEvent interface: existence and properties of interface prototype object's "constructor" property +PASS ErrorEvent interface: existence and properties of interface prototype object's @@unscopables property +PASS ErrorEvent interface: attribute message +PASS ErrorEvent interface: attribute filename +PASS ErrorEvent interface: attribute lineno +PASS ErrorEvent interface: attribute colno +PASS ErrorEvent interface: attribute error +PASS PromiseRejectionEvent interface: existence and properties of interface object +PASS PromiseRejectionEvent interface object length +PASS PromiseRejectionEvent interface object name +PASS PromiseRejectionEvent interface: existence and properties of interface prototype object +PASS PromiseRejectionEvent interface: existence and properties of interface prototype object's "constructor" property +PASS PromiseRejectionEvent interface: existence and properties of interface prototype object's @@unscopables property +PASS PromiseRejectionEvent interface: attribute promise +PASS PromiseRejectionEvent interface: attribute reason +PASS DOMParser interface: existence and properties of interface object +PASS DOMParser interface object length +PASS DOMParser interface object name +PASS DOMParser interface: existence and properties of interface prototype object +PASS DOMParser interface: existence and properties of interface prototype object's "constructor" property +PASS DOMParser interface: existence and properties of interface prototype object's @@unscopables property +PASS DOMParser interface: operation parseFromString(DOMString, DOMParserSupportedType) +PASS DOMParser must be primary interface of new DOMParser() +PASS Stringification of new DOMParser() +PASS DOMParser interface: new DOMParser() must inherit property "parseFromString(DOMString, DOMParserSupportedType)" with the proper type +PASS DOMParser interface: calling parseFromString(DOMString, DOMParserSupportedType) on new DOMParser() with too few arguments must throw TypeError +PASS Navigator interface: existence and properties of interface object +PASS Navigator interface object length +PASS Navigator interface object name +PASS Navigator interface: existence and properties of interface prototype object +PASS Navigator interface: existence and properties of interface prototype object's "constructor" property +PASS Navigator interface: existence and properties of interface prototype object's @@unscopables property +PASS Navigator interface: attribute appCodeName +PASS Navigator interface: attribute appName +PASS Navigator interface: attribute appVersion +PASS Navigator interface: attribute platform +PASS Navigator interface: attribute product +PASS Navigator interface: attribute productSub +PASS Navigator interface: attribute userAgent +PASS Navigator interface: attribute vendor +PASS Navigator interface: attribute vendorSub +FAIL Navigator interface: operation taintEnabled() assert_own_property: interface prototype object missing non-static operation expected property "taintEnabled" missing +FAIL Navigator interface: attribute oscpu assert_true: The prototype object must have a property "oscpu" expected true got false +PASS Navigator interface: attribute language +PASS Navigator interface: attribute languages +PASS Navigator interface: attribute onLine +FAIL Navigator interface: operation registerProtocolHandler(DOMString, USVString) assert_equals: property has wrong .length expected 2 but got 3 +PASS Navigator interface: operation unregisterProtocolHandler(DOMString, USVString) +PASS Navigator interface: attribute cookieEnabled +PASS Navigator interface: attribute plugins +PASS Navigator interface: attribute mimeTypes +PASS Navigator interface: operation javaEnabled() +PASS Navigator interface: attribute hardwareConcurrency +PASS Navigator must be primary interface of window.navigator +PASS Stringification of window.navigator +PASS Navigator interface: window.navigator must inherit property "appCodeName" with the proper type +PASS Navigator interface: window.navigator must inherit property "appName" with the proper type +PASS Navigator interface: window.navigator must inherit property "appVersion" with the proper type +PASS Navigator interface: window.navigator must inherit property "platform" with the proper type +PASS Navigator interface: window.navigator must inherit property "product" with the proper type +PASS Navigator interface: window.navigator must inherit property "productSub" with the proper type +PASS Navigator interface: window.navigator must inherit property "userAgent" with the proper type +PASS Navigator interface: window.navigator must inherit property "vendor" with the proper type +PASS Navigator interface: window.navigator must inherit property "vendorSub" with the proper type +FAIL Navigator interface: window.navigator must inherit property "taintEnabled()" with the proper type assert_inherits: property "taintEnabled" not found in prototype chain +FAIL Navigator interface: window.navigator must inherit property "oscpu" with the proper type assert_inherits: property "oscpu" not found in prototype chain +PASS Navigator interface: window.navigator must inherit property "language" with the proper type +PASS Navigator interface: window.navigator must inherit property "languages" with the proper type +PASS Navigator interface: window.navigator must inherit property "onLine" with the proper type +PASS Navigator interface: window.navigator must inherit property "registerProtocolHandler(DOMString, USVString)" with the proper type +PASS Navigator interface: calling registerProtocolHandler(DOMString, USVString) on window.navigator with too few arguments must throw TypeError +PASS Navigator interface: window.navigator must inherit property "unregisterProtocolHandler(DOMString, USVString)" with the proper type +PASS Navigator interface: calling unregisterProtocolHandler(DOMString, USVString) on window.navigator with too few arguments must throw TypeError +PASS Navigator interface: window.navigator must inherit property "cookieEnabled" with the proper type +PASS Navigator interface: window.navigator must inherit property "plugins" with the proper type +PASS Navigator interface: window.navigator must inherit property "mimeTypes" with the proper type +PASS Navigator interface: window.navigator must inherit property "javaEnabled()" with the proper type +PASS Navigator interface: window.navigator must inherit property "hardwareConcurrency" with the proper type +PASS PluginArray interface: existence and properties of interface object +PASS PluginArray interface object length +PASS PluginArray interface object name +PASS PluginArray interface: existence and properties of interface prototype object +PASS PluginArray interface: existence and properties of interface prototype object's "constructor" property +PASS PluginArray interface: existence and properties of interface prototype object's @@unscopables property +PASS PluginArray interface: operation refresh(optional boolean) +PASS PluginArray interface: attribute length +PASS PluginArray interface: operation item(unsigned long) +PASS PluginArray interface: operation namedItem(DOMString) +PASS MimeTypeArray interface: existence and properties of interface object +PASS MimeTypeArray interface object length +PASS MimeTypeArray interface object name +PASS MimeTypeArray interface: existence and properties of interface prototype object +PASS MimeTypeArray interface: existence and properties of interface prototype object's "constructor" property +PASS MimeTypeArray interface: existence and properties of interface prototype object's @@unscopables property +PASS MimeTypeArray interface: attribute length +PASS MimeTypeArray interface: operation item(unsigned long) +PASS MimeTypeArray interface: operation namedItem(DOMString) +PASS Plugin interface: existence and properties of interface object +PASS Plugin interface object length +PASS Plugin interface object name +PASS Plugin interface: existence and properties of interface prototype object +PASS Plugin interface: existence and properties of interface prototype object's "constructor" property +PASS Plugin interface: existence and properties of interface prototype object's @@unscopables property +PASS Plugin interface: attribute name +PASS Plugin interface: attribute description +PASS Plugin interface: attribute filename +PASS Plugin interface: attribute length +PASS Plugin interface: operation item(unsigned long) +PASS Plugin interface: operation namedItem(DOMString) +PASS MimeType interface: existence and properties of interface object +PASS MimeType interface object length +PASS MimeType interface object name +PASS MimeType interface: existence and properties of interface prototype object +PASS MimeType interface: existence and properties of interface prototype object's "constructor" property +PASS MimeType interface: existence and properties of interface prototype object's @@unscopables property +PASS MimeType interface: attribute type +PASS MimeType interface: attribute description +PASS MimeType interface: attribute suffixes +PASS MimeType interface: attribute enabledPlugin +PASS ImageBitmap interface: existence and properties of interface object +PASS ImageBitmap interface object length +PASS ImageBitmap interface object name +PASS ImageBitmap interface: existence and properties of interface prototype object +PASS ImageBitmap interface: existence and properties of interface prototype object's "constructor" property +PASS ImageBitmap interface: existence and properties of interface prototype object's @@unscopables property +PASS ImageBitmap interface: attribute width +PASS ImageBitmap interface: attribute height +PASS ImageBitmap interface: operation close() +PASS MessageEvent interface: existence and properties of interface object +PASS MessageEvent interface object length +PASS MessageEvent interface object name +PASS MessageEvent interface: existence and properties of interface prototype object +PASS MessageEvent interface: existence and properties of interface prototype object's "constructor" property +PASS MessageEvent interface: existence and properties of interface prototype object's @@unscopables property +PASS MessageEvent interface: attribute data +PASS MessageEvent interface: attribute origin +PASS MessageEvent interface: attribute lastEventId +PASS MessageEvent interface: attribute source +PASS MessageEvent interface: attribute ports +PASS MessageEvent interface: operation initMessageEvent(DOMString, optional boolean, optional boolean, optional any, optional USVString, optional DOMString, optional MessageEventSource?, optional sequence<MessagePort>) +PASS MessageEvent must be primary interface of new MessageEvent("message", { data: 5 }) +PASS Stringification of new MessageEvent("message", { data: 5 }) +PASS MessageEvent interface: new MessageEvent("message", { data: 5 }) must inherit property "data" with the proper type +PASS MessageEvent interface: new MessageEvent("message", { data: 5 }) must inherit property "origin" with the proper type +PASS MessageEvent interface: new MessageEvent("message", { data: 5 }) must inherit property "lastEventId" with the proper type +PASS MessageEvent interface: new MessageEvent("message", { data: 5 }) must inherit property "source" with the proper type +PASS MessageEvent interface: new MessageEvent("message", { data: 5 }) must inherit property "ports" with the proper type +PASS MessageEvent interface: new MessageEvent("message", { data: 5 }) must inherit property "initMessageEvent(DOMString, optional boolean, optional boolean, optional any, optional USVString, optional DOMString, optional MessageEventSource?, optional sequence<MessagePort>)" with the proper type +PASS MessageEvent interface: calling initMessageEvent(DOMString, optional boolean, optional boolean, optional any, optional USVString, optional DOMString, optional MessageEventSource?, optional sequence<MessagePort>) on new MessageEvent("message", { data: 5 }) with too few arguments must throw TypeError +PASS EventSource interface: existence and properties of interface object +PASS EventSource interface object length +PASS EventSource interface object name +PASS EventSource interface: existence and properties of interface prototype object +PASS EventSource interface: existence and properties of interface prototype object's "constructor" property +PASS EventSource interface: existence and properties of interface prototype object's @@unscopables property +PASS EventSource interface: attribute url +PASS EventSource interface: attribute withCredentials +PASS EventSource interface: constant CONNECTING on interface object +PASS EventSource interface: constant CONNECTING on interface prototype object +PASS EventSource interface: constant OPEN on interface object +PASS EventSource interface: constant OPEN on interface prototype object +PASS EventSource interface: constant CLOSED on interface object +PASS EventSource interface: constant CLOSED on interface prototype object +PASS EventSource interface: attribute readyState +PASS EventSource interface: attribute onopen +PASS EventSource interface: attribute onmessage +PASS EventSource interface: attribute onerror +PASS EventSource interface: operation close() +PASS WebSocket interface: existence and properties of interface object +PASS WebSocket interface object length +PASS WebSocket interface object name +PASS WebSocket interface: existence and properties of interface prototype object +PASS WebSocket interface: existence and properties of interface prototype object's "constructor" property +PASS WebSocket interface: existence and properties of interface prototype object's @@unscopables property +PASS WebSocket interface: attribute url +PASS WebSocket interface: constant CONNECTING on interface object +PASS WebSocket interface: constant CONNECTING on interface prototype object +PASS WebSocket interface: constant OPEN on interface object +PASS WebSocket interface: constant OPEN on interface prototype object +PASS WebSocket interface: constant CLOSING on interface object +PASS WebSocket interface: constant CLOSING on interface prototype object +PASS WebSocket interface: constant CLOSED on interface object +PASS WebSocket interface: constant CLOSED on interface prototype object +PASS WebSocket interface: attribute readyState +PASS WebSocket interface: attribute bufferedAmount +PASS WebSocket interface: attribute onopen +PASS WebSocket interface: attribute onerror +PASS WebSocket interface: attribute onclose +PASS WebSocket interface: attribute extensions +PASS WebSocket interface: attribute protocol +PASS WebSocket interface: operation close(optional unsigned short, optional USVString) +PASS WebSocket interface: attribute onmessage +PASS WebSocket interface: attribute binaryType +PASS WebSocket interface: operation send(USVString) +PASS WebSocket interface: operation send(Blob) +PASS WebSocket interface: operation send(ArrayBuffer) +PASS WebSocket interface: operation send(ArrayBufferView) +PASS WebSocket must be primary interface of new WebSocket("wss://nonexistent.web-platform.test") +PASS Stringification of new WebSocket("wss://nonexistent.web-platform.test") +PASS WebSocket interface: new WebSocket("wss://nonexistent.web-platform.test") must inherit property "url" with the proper type +PASS WebSocket interface: new WebSocket("wss://nonexistent.web-platform.test") must inherit property "CONNECTING" with the proper type +PASS WebSocket interface: new WebSocket("wss://nonexistent.web-platform.test") must inherit property "OPEN" with the proper type +PASS WebSocket interface: new WebSocket("wss://nonexistent.web-platform.test") must inherit property "CLOSING" with the proper type +PASS WebSocket interface: new WebSocket("wss://nonexistent.web-platform.test") must inherit property "CLOSED" with the proper type +PASS WebSocket interface: new WebSocket("wss://nonexistent.web-platform.test") must inherit property "readyState" with the proper type +PASS WebSocket interface: new WebSocket("wss://nonexistent.web-platform.test") must inherit property "bufferedAmount" with the proper type +PASS WebSocket interface: new WebSocket("wss://nonexistent.web-platform.test") must inherit property "onopen" with the proper type +PASS WebSocket interface: new WebSocket("wss://nonexistent.web-platform.test") must inherit property "onerror" with the proper type +PASS WebSocket interface: new WebSocket("wss://nonexistent.web-platform.test") must inherit property "onclose" with the proper type +PASS WebSocket interface: new WebSocket("wss://nonexistent.web-platform.test") must inherit property "extensions" with the proper type +PASS WebSocket interface: new WebSocket("wss://nonexistent.web-platform.test") must inherit property "protocol" with the proper type +PASS WebSocket interface: new WebSocket("wss://nonexistent.web-platform.test") must inherit property "close(optional unsigned short, optional USVString)" with the proper type +PASS WebSocket interface: calling close(optional unsigned short, optional USVString) on new WebSocket("wss://nonexistent.web-platform.test") with too few arguments must throw TypeError +PASS WebSocket interface: new WebSocket("wss://nonexistent.web-platform.test") must inherit property "onmessage" with the proper type +PASS WebSocket interface: new WebSocket("wss://nonexistent.web-platform.test") must inherit property "binaryType" with the proper type +PASS WebSocket interface: new WebSocket("wss://nonexistent.web-platform.test") must inherit property "send(USVString)" with the proper type +PASS WebSocket interface: calling send(USVString) on new WebSocket("wss://nonexistent.web-platform.test") with too few arguments must throw TypeError +PASS WebSocket interface: new WebSocket("wss://nonexistent.web-platform.test") must inherit property "send(Blob)" with the proper type +PASS WebSocket interface: calling send(Blob) on new WebSocket("wss://nonexistent.web-platform.test") with too few arguments must throw TypeError +PASS WebSocket interface: new WebSocket("wss://nonexistent.web-platform.test") must inherit property "send(ArrayBuffer)" with the proper type +PASS WebSocket interface: calling send(ArrayBuffer) on new WebSocket("wss://nonexistent.web-platform.test") with too few arguments must throw TypeError +PASS WebSocket interface: new WebSocket("wss://nonexistent.web-platform.test") must inherit property "send(ArrayBufferView)" with the proper type +PASS WebSocket interface: calling send(ArrayBufferView) on new WebSocket("wss://nonexistent.web-platform.test") with too few arguments must throw TypeError +PASS CloseEvent interface: existence and properties of interface object +PASS CloseEvent interface object length +PASS CloseEvent interface object name +PASS CloseEvent interface: existence and properties of interface prototype object +PASS CloseEvent interface: existence and properties of interface prototype object's "constructor" property +PASS CloseEvent interface: existence and properties of interface prototype object's @@unscopables property +PASS CloseEvent interface: attribute wasClean +PASS CloseEvent interface: attribute code +PASS CloseEvent interface: attribute reason +PASS CloseEvent must be primary interface of new CloseEvent("close") +PASS Stringification of new CloseEvent("close") +PASS CloseEvent interface: new CloseEvent("close") must inherit property "wasClean" with the proper type +PASS CloseEvent interface: new CloseEvent("close") must inherit property "code" with the proper type +PASS CloseEvent interface: new CloseEvent("close") must inherit property "reason" with the proper type +PASS MessageChannel interface: existence and properties of interface object +PASS MessageChannel interface object length +PASS MessageChannel interface object name +PASS MessageChannel interface: existence and properties of interface prototype object +PASS MessageChannel interface: existence and properties of interface prototype object's "constructor" property +PASS MessageChannel interface: existence and properties of interface prototype object's @@unscopables property +PASS MessageChannel interface: attribute port1 +PASS MessageChannel interface: attribute port2 +PASS MessagePort interface: existence and properties of interface object +PASS MessagePort interface object length +PASS MessagePort interface object name +PASS MessagePort interface: existence and properties of interface prototype object +PASS MessagePort interface: existence and properties of interface prototype object's "constructor" property +PASS MessagePort interface: existence and properties of interface prototype object's @@unscopables property +PASS MessagePort interface: operation postMessage(any, sequence<object>) +PASS MessagePort interface: operation postMessage(any, optional PostMessageOptions) +PASS MessagePort interface: operation start() +PASS MessagePort interface: operation close() +PASS MessagePort interface: attribute onmessage +PASS MessagePort interface: attribute onmessageerror +PASS BroadcastChannel interface: existence and properties of interface object +PASS BroadcastChannel interface object length +PASS BroadcastChannel interface object name +PASS BroadcastChannel interface: existence and properties of interface prototype object +PASS BroadcastChannel interface: existence and properties of interface prototype object's "constructor" property +PASS BroadcastChannel interface: existence and properties of interface prototype object's @@unscopables property +PASS BroadcastChannel interface: attribute name +PASS BroadcastChannel interface: operation postMessage(any) +PASS BroadcastChannel interface: operation close() +PASS BroadcastChannel interface: attribute onmessage +PASS BroadcastChannel interface: attribute onmessageerror +PASS WorkerGlobalScope interface: existence and properties of interface object +PASS DedicatedWorkerGlobalScope interface: existence and properties of interface object +PASS SharedWorkerGlobalScope interface: existence and properties of interface object +PASS Worker interface: existence and properties of interface object +PASS Worker interface object length +PASS Worker interface object name +PASS Worker interface: existence and properties of interface prototype object +PASS Worker interface: existence and properties of interface prototype object's "constructor" property +PASS Worker interface: existence and properties of interface prototype object's @@unscopables property +PASS Worker interface: operation terminate() +PASS Worker interface: operation postMessage(any, sequence<object>) +PASS Worker interface: operation postMessage(any, optional PostMessageOptions) +PASS Worker interface: attribute onmessage +FAIL Worker interface: attribute onmessageerror assert_true: The prototype object must have a property "onmessageerror" expected true got false +PASS Worker interface: attribute onerror +PASS SharedWorker interface: existence and properties of interface object +PASS SharedWorker interface object length +PASS SharedWorker interface object name +PASS SharedWorker interface: existence and properties of interface prototype object +PASS SharedWorker interface: existence and properties of interface prototype object's "constructor" property +PASS SharedWorker interface: existence and properties of interface prototype object's @@unscopables property +PASS SharedWorker interface: attribute port +PASS SharedWorker interface: attribute onerror +PASS WorkerNavigator interface: existence and properties of interface object +PASS WorkerLocation interface: existence and properties of interface object +PASS Storage interface: existence and properties of interface object +PASS Storage interface object length +PASS Storage interface object name +PASS Storage interface: existence and properties of interface prototype object +PASS Storage interface: existence and properties of interface prototype object's "constructor" property +PASS Storage interface: existence and properties of interface prototype object's @@unscopables property +PASS Storage interface: attribute length +PASS Storage interface: operation key(unsigned long) +PASS Storage interface: operation getItem(DOMString) +PASS Storage interface: operation setItem(DOMString, DOMString) +PASS Storage interface: operation removeItem(DOMString) +PASS Storage interface: operation clear() +PASS StorageEvent interface: existence and properties of interface object +PASS StorageEvent interface object length +PASS StorageEvent interface object name +PASS StorageEvent interface: existence and properties of interface prototype object +PASS StorageEvent interface: existence and properties of interface prototype object's "constructor" property +PASS StorageEvent interface: existence and properties of interface prototype object's @@unscopables property +PASS StorageEvent interface: attribute key +PASS StorageEvent interface: attribute oldValue +PASS StorageEvent interface: attribute newValue +PASS StorageEvent interface: attribute url +PASS StorageEvent interface: attribute storageArea +PASS StorageEvent interface: operation initStorageEvent(DOMString, optional boolean, optional boolean, optional DOMString?, optional DOMString?, optional DOMString?, optional USVString, optional Storage?) +PASS External interface: existence and properties of interface object +PASS External interface object length +PASS External interface object name +PASS External interface: existence and properties of interface prototype object +PASS External interface: existence and properties of interface prototype object's "constructor" property +PASS External interface: existence and properties of interface prototype object's @@unscopables property +PASS External interface: operation AddSearchProvider() +PASS External interface: operation IsSearchProviderInstalled() +PASS External must be primary interface of window.external +PASS Stringification of window.external +PASS External interface: window.external must inherit property "AddSearchProvider()" with the proper type +PASS External interface: window.external must inherit property "IsSearchProviderInstalled()" with the proper type +PASS SVGElement interface: attribute onabort +PASS SVGElement interface: attribute onauxclick +PASS SVGElement interface: attribute onblur +PASS SVGElement interface: attribute oncancel +PASS SVGElement interface: attribute oncanplay +PASS SVGElement interface: attribute oncanplaythrough +PASS SVGElement interface: attribute onchange +PASS SVGElement interface: attribute onclick +PASS SVGElement interface: attribute onclose +PASS SVGElement interface: attribute oncontextmenu +PASS SVGElement interface: attribute oncuechange +PASS SVGElement interface: attribute ondblclick +PASS SVGElement interface: attribute ondrag +PASS SVGElement interface: attribute ondragend +PASS SVGElement interface: attribute ondragenter +FAIL SVGElement interface: attribute ondragexit assert_true: The prototype object must have a property "ondragexit" expected true got false +PASS SVGElement interface: attribute ondragleave +PASS SVGElement interface: attribute ondragover +PASS SVGElement interface: attribute ondragstart +PASS SVGElement interface: attribute ondrop +PASS SVGElement interface: attribute ondurationchange +PASS SVGElement interface: attribute onemptied +PASS SVGElement interface: attribute onended +PASS SVGElement interface: attribute onerror +PASS SVGElement interface: attribute onfocus +PASS SVGElement interface: attribute onformdata +PASS SVGElement interface: attribute oninput +PASS SVGElement interface: attribute oninvalid +PASS SVGElement interface: attribute onkeydown +PASS SVGElement interface: attribute onkeypress +PASS SVGElement interface: attribute onkeyup +PASS SVGElement interface: attribute onload +PASS SVGElement interface: attribute onloadeddata +PASS SVGElement interface: attribute onloadedmetadata +PASS SVGElement interface: attribute onloadstart +PASS SVGElement interface: attribute onmousedown +PASS SVGElement interface: attribute onmouseenter +PASS SVGElement interface: attribute onmouseleave +PASS SVGElement interface: attribute onmousemove +PASS SVGElement interface: attribute onmouseout +PASS SVGElement interface: attribute onmouseover +PASS SVGElement interface: attribute onmouseup +PASS SVGElement interface: attribute onpause +PASS SVGElement interface: attribute onplay +PASS SVGElement interface: attribute onplaying +PASS SVGElement interface: attribute onprogress +PASS SVGElement interface: attribute onratechange +PASS SVGElement interface: attribute onreset +PASS SVGElement interface: attribute onresize +PASS SVGElement interface: attribute onscroll +FAIL SVGElement interface: attribute onsecuritypolicyviolation assert_true: The prototype object must have a property "onsecuritypolicyviolation" expected true got false +PASS SVGElement interface: attribute onseeked +PASS SVGElement interface: attribute onseeking +PASS SVGElement interface: attribute onselect +FAIL SVGElement interface: attribute onslotchange assert_true: The prototype object must have a property "onslotchange" expected true got false +PASS SVGElement interface: attribute onstalled +PASS SVGElement interface: attribute onsubmit +PASS SVGElement interface: attribute onsuspend +PASS SVGElement interface: attribute ontimeupdate +PASS SVGElement interface: attribute ontoggle +PASS SVGElement interface: attribute onvolumechange +PASS SVGElement interface: attribute onwaiting +PASS SVGElement interface: attribute onwebkitanimationend +PASS SVGElement interface: attribute onwebkitanimationiteration +PASS SVGElement interface: attribute onwebkitanimationstart +PASS SVGElement interface: attribute onwebkittransitionend +PASS SVGElement interface: attribute onwheel +PASS SVGElement interface: attribute oncopy +PASS SVGElement interface: attribute oncut +PASS SVGElement interface: attribute onpaste +PASS SVGElement interface: attribute dataset +PASS SVGElement interface: attribute nonce +PASS SVGElement interface: attribute autofocus +PASS SVGElement interface: attribute tabIndex +PASS SVGElement interface: operation focus(optional FocusOptions) +PASS SVGElement interface: operation blur() +FAIL SVGSVGElement interface: attribute onafterprint assert_true: The prototype object must have a property "onafterprint" expected true got false +FAIL SVGSVGElement interface: attribute onbeforeprint assert_true: The prototype object must have a property "onbeforeprint" expected true got false +FAIL SVGSVGElement interface: attribute onbeforeunload assert_true: The prototype object must have a property "onbeforeunload" expected true got false +FAIL SVGSVGElement interface: attribute onhashchange assert_true: The prototype object must have a property "onhashchange" expected true got false +FAIL SVGSVGElement interface: attribute onlanguagechange assert_true: The prototype object must have a property "onlanguagechange" expected true got false +FAIL SVGSVGElement interface: attribute onmessage assert_true: The prototype object must have a property "onmessage" expected true got false +FAIL SVGSVGElement interface: attribute onmessageerror assert_true: The prototype object must have a property "onmessageerror" expected true got false +FAIL SVGSVGElement interface: attribute onoffline assert_true: The prototype object must have a property "onoffline" expected true got false +FAIL SVGSVGElement interface: attribute ononline assert_true: The prototype object must have a property "ononline" expected true got false +FAIL SVGSVGElement interface: attribute onpagehide assert_true: The prototype object must have a property "onpagehide" expected true got false +FAIL SVGSVGElement interface: attribute onpageshow assert_true: The prototype object must have a property "onpageshow" expected true got false +FAIL SVGSVGElement interface: attribute onpopstate assert_true: The prototype object must have a property "onpopstate" expected true got false +FAIL SVGSVGElement interface: attribute onrejectionhandled assert_true: The prototype object must have a property "onrejectionhandled" expected true got false +FAIL SVGSVGElement interface: attribute onstorage assert_true: The prototype object must have a property "onstorage" expected true got false +FAIL SVGSVGElement interface: attribute onunhandledrejection assert_true: The prototype object must have a property "onunhandledrejection" expected true got false +FAIL SVGSVGElement interface: attribute onunload assert_true: The prototype object must have a property "onunload" expected true got false +PASS ShadowRoot interface: attribute activeElement +Harness: the test ran to completion. +
diff --git a/third_party/blink/web_tests/editing/selection/modify_move/move_backward_line_import_crash.html b/third_party/blink/web_tests/web-components-v0-only/editing-selection/modify_move/move_backward_line_import_crash.html similarity index 100% rename from third_party/blink/web_tests/editing/selection/modify_move/move_backward_line_import_crash.html rename to third_party/blink/web_tests/web-components-v0-only/editing-selection/modify_move/move_backward_line_import_crash.html
diff --git a/third_party/blink/web_tests/fast/css/media-query-in-html-import.html b/third_party/blink/web_tests/web-components-v0-only/fast-css/media-query-in-html-import.html similarity index 100% rename from third_party/blink/web_tests/fast/css/media-query-in-html-import.html rename to third_party/blink/web_tests/web-components-v0-only/fast-css/media-query-in-html-import.html
diff --git a/third_party/blink/web_tests/fast/loader/javascript-detached-frame-no-crash-expected.txt b/third_party/blink/web_tests/web-components-v0-only/fast-loader/javascript-detached-frame-no-crash-expected.txt similarity index 100% rename from third_party/blink/web_tests/fast/loader/javascript-detached-frame-no-crash-expected.txt rename to third_party/blink/web_tests/web-components-v0-only/fast-loader/javascript-detached-frame-no-crash-expected.txt
diff --git a/third_party/blink/web_tests/fast/loader/javascript-detached-frame-no-crash.html b/third_party/blink/web_tests/web-components-v0-only/fast-loader/javascript-detached-frame-no-crash.html similarity index 100% rename from third_party/blink/web_tests/fast/loader/javascript-detached-frame-no-crash.html rename to third_party/blink/web_tests/web-components-v0-only/fast-loader/javascript-detached-frame-no-crash.html
diff --git a/third_party/blink/web_tests/fast/loader/resources/javascript-detached-frame-iframe.html b/third_party/blink/web_tests/web-components-v0-only/fast-loader/resources/javascript-detached-frame-iframe.html similarity index 100% rename from third_party/blink/web_tests/fast/loader/resources/javascript-detached-frame-iframe.html rename to third_party/blink/web_tests/web-components-v0-only/fast-loader/resources/javascript-detached-frame-iframe.html
diff --git a/third_party/blink/web_tests/shadow-dom/crashes/offsetParent-layoutObject-lifecycle.html b/third_party/blink/web_tests/web-components-v0-only/shadow-dom-crashes/offsetParent-layoutObject-lifecycle.html similarity index 100% rename from third_party/blink/web_tests/shadow-dom/crashes/offsetParent-layoutObject-lifecycle.html rename to third_party/blink/web_tests/web-components-v0-only/shadow-dom-crashes/offsetParent-layoutObject-lifecycle.html
diff --git a/third_party/blink/web_tests/webaudio/dom-exceptions-expected.txt b/third_party/blink/web_tests/webaudio/dom-exceptions-expected.txt index 6fe52b40..9c3aca383 100644 --- a/third_party/blink/web_tests/webaudio/dom-exceptions-expected.txt +++ b/third_party/blink/web_tests/webaudio/dom-exceptions-expected.txt
@@ -161,7 +161,7 @@ PASS > [waveshaper] PASS node.oversample = "9x" did not throw an exception. PASS node.oversample is equal to none. -PASS node.curve = {} threw TypeError: "Failed to set the 'curve' property on 'WaveShaperNode': Failed to convert value to 'Float32Array'.". +PASS node.curve = {} threw TypeError: "Failed to set the 'curve' property on 'WaveShaperNode': The provided value is not of type 'Float32Array'.". PASS node.curve = new Float32Array(1) threw InvalidAccessError: "Failed to set the 'curve' property on 'WaveShaperNode': The curve length provided (1) is less than the minimum bound (2).". PASS node.curve is equal to null. PASS node.curve = new Float32Array(2) did not throw an exception. @@ -233,7 +233,7 @@ PASS > [convolver] PASS oc = new OfflineAudioContext(1, 44100, 44100) did not throw an exception. PASS conv = oc.createConvolver() did not throw an exception. -PASS conv.buffer = {} threw TypeError: "Failed to set the 'buffer' property on 'ConvolverNode': Failed to convert value to 'AudioBuffer'.". +PASS conv.buffer = {} threw TypeError: "Failed to set the 'buffer' property on 'ConvolverNode': The provided value is not of type 'AudioBuffer'.". PASS conv.buffer = oc.createBuffer(1, 100, 22050) threw NotSupportedError: "Failed to set the 'buffer' property on 'ConvolverNode': The buffer sample rate of 22050 does not match the context rate of 44100 Hz.". PASS conv.buffer is equal to null. PASS < [convolver] All assertions passed. (total 5 assertions)
diff --git a/third_party/blink/web_tests/webexposed/global-interface-listing-expected.txt b/third_party/blink/web_tests/webexposed/global-interface-listing-expected.txt index 39559ec..9bf0771 100644 --- a/third_party/blink/web_tests/webexposed/global-interface-listing-expected.txt +++ b/third_party/blink/web_tests/webexposed/global-interface-listing-expected.txt
@@ -672,7 +672,6 @@ attribute @@toStringTag getter cssRules getter name - method @@iterator method appendRule method constructor method deleteRule @@ -3236,7 +3235,6 @@ setter size interface HTMLFormControlsCollection : HTMLCollection attribute @@toStringTag - method @@iterator method constructor method namedItem interface HTMLFormElement : HTMLElement @@ -6620,7 +6618,6 @@ interface RadioNodeList : NodeList attribute @@toStringTag getter value - method @@iterator method constructor setter value interface Range @@ -11649,6 +11646,7 @@ attribute @@toStringTag getter src getter weight + method constructor setter src setter weight interface webkitSpeechGrammarList @@ -11657,6 +11655,7 @@ method @@iterator method addFromString method addFromUri + method constructor method item interface webkitSpeechRecognition : EventTarget attribute @@toStringTag @@ -11677,6 +11676,7 @@ getter onspeechstart getter onstart method abort + method constructor method start method stop setter continuous @@ -11699,12 +11699,14 @@ attribute @@toStringTag getter error getter message + method constructor interface webkitSpeechRecognitionEvent : Event attribute @@toStringTag getter emma getter interpretation getter resultIndex getter results + method constructor interface webkitURL static method createObjectURL static method revokeObjectURL @@ -11738,17 +11740,25 @@ attribute GCController attribute accessibilityController attribute chrome + attribute closed attribute console attribute eventSender + attribute frames attribute gamepadController attribute globalThis attribute internals + attribute length + attribute location + attribute opener + attribute parent attribute propertyNamesInGlobal + attribute self attribute testRunner attribute textInputController + attribute top + attribute window getter caches getter clientInformation - getter closed getter cookieStore getter crossOriginIsolated getter crypto @@ -11760,16 +11770,13 @@ getter event getter external getter frameElement - getter frames getter history getter indexedDB getter innerHeight getter innerWidth getter isSecureContext getter launchQueue - getter length getter localStorage - getter location getter locationbar getter menubar getter name @@ -11889,7 +11896,6 @@ getter onwebkitanimationstart getter onwebkittransitionend getter onwheel - getter opener getter origin getter originIsolationRestricted getter originPolicyIds @@ -11897,7 +11903,6 @@ getter outerWidth getter pageXOffset getter pageYOffset - getter parent getter performance getter personalbar getter portalHost @@ -11910,18 +11915,15 @@ getter scrollX getter scrollY getter scrollbars - getter self getter sessionStorage getter speechSynthesis getter status getter statusbar getter styleMedia getter toolbar - getter top getter trustedTypes getter visualViewport getter webkitStorageInfo - getter window method NodeFilter method alert method atob @@ -11930,7 +11932,6 @@ method cancelAnimationFrame method cancelIdleCallback method captureEvents - method chooseFileSystemEntries method clearInterval method clearTimeout method close @@ -11982,11 +11983,8 @@ setter devicePixelRatio setter event setter external - setter frames setter innerHeight setter innerWidth - setter length - setter location setter locationbar setter menubar setter name @@ -12104,13 +12102,11 @@ setter onwebkitanimationstart setter onwebkittransitionend setter onwheel - setter opener setter origin setter outerHeight setter outerWidth setter pageXOffset setter pageYOffset - setter parent setter performance setter personalbar setter scheduler @@ -12122,7 +12118,6 @@ setter scrollX setter scrollY setter scrollbars - setter self setter status setter statusbar setter toolbar
diff --git a/third_party/breakpad/BUILD.gn b/third_party/breakpad/BUILD.gn index d5f3948..cd2a60b 100644 --- a/third_party/breakpad/BUILD.gn +++ b/third_party/breakpad/BUILD.gn
@@ -342,7 +342,13 @@ executable("symupload") { sources = [ + "breakpad/src/common/mac/HTTPGetRequest.m", "breakpad/src/common/mac/HTTPMultipartUpload.m", + "breakpad/src/common/mac/HTTPPutRequest.m", + "breakpad/src/common/mac/HTTPRequest.m", + "breakpad/src/common/mac/HTTPSimplePostRequest.m", + "breakpad/src/common/mac/SymbolCollectorClient.m", + "breakpad/src/common/mac/encoding_util.m", "breakpad/src/tools/mac/symupload/symupload.m", ] @@ -1032,6 +1038,8 @@ "breakpad/src/common/convert_UTF.h", "breakpad/src/common/long_string_dictionary.cc", "breakpad/src/common/mac/HTTPMultipartUpload.m", + "breakpad/src/common/mac/HTTPRequest.m", + "breakpad/src/common/mac/encoding_util.m", "breakpad/src/common/mac/file_id.cc", "breakpad/src/common/mac/file_id.h", "breakpad/src/common/mac/macho_id.cc",
diff --git a/tools/mb/PRESUBMIT.py b/tools/mb/PRESUBMIT.py index ba3d0cc2..838d3c39 100644 --- a/tools/mb/PRESUBMIT.py +++ b/tools/mb/PRESUBMIT.py
@@ -3,23 +3,6 @@ # found in the LICENSE file. -# TODO(crbug.com/1109980): Remove this once the production freeze is over, which -# is expected to be on August 3rd. -def EnforceProductionFreeze(input_api, output_api): - footers = input_api.change.GitFootersFromDescription() - if footers.get('Ignore-Cq-Freeze'): - return [] - - message = """ - Your change is modifying files which may impact the Chromium CQ. The Chromium - CQ is currently in a production freeze. Please get a review from someone in - the //infra/OWNERS file (preferably a trooper), and then add the - 'Ignore-CQ-Freeze' git footer to your CL. See https://crbug.com/1109980 for - more details. - """ - return [output_api.PresubmitError(message)] - - def _CommonChecks(input_api, output_api): results = [] @@ -38,7 +21,6 @@ input_api.Command(name='mb_validate', cmd=cmd, kwargs=kwargs, message=output_api.PresubmitError)])) - results.extend(EnforceProductionFreeze(input_api, output_api)) return results
diff --git a/tools/mb/mb.py b/tools/mb/mb.py index c6fa636b..20a6b01 100755 --- a/tools/mb/mb.py +++ b/tools/mb/mb.py
@@ -1476,6 +1476,7 @@ cmdline += [ '../../testing/test_env.py', os.path.join('bin', 'run_%s' % target), + '--flash', ] elif use_xvfb and test_type == 'windowed_test_launcher': extra_files.append('../../testing/xvfb.py') @@ -1515,6 +1516,8 @@ cmdline += [ os.path.join('bin', 'cros_test_wrapper'), '--logs-dir=${ISOLATED_OUTDIR}', + '--flash', + '--', ] cmdline += [ '../../testing/test_env.py',
diff --git a/tools/mb/mb_config.pyl b/tools/mb/mb_config.pyl index efe9e000..2f4569c6 100644 --- a/tools/mb/mb_config.pyl +++ b/tools/mb/mb_config.pyl
@@ -134,6 +134,8 @@ 'chromeos-kevin-rel': 'chromeos_kevin', 'linux-chromeos-rel': 'chromeos_with_codecs_release_bot', 'linux-chromeos-dbg': 'chromeos_with_codecs_debug_bot', + 'linux-lacros-builder-rel': 'lacros_on_linux_release_bot', + 'linux-lacros-tester-rel': 'lacros_on_linux_release_bot', }, 'chromium.clang': {
diff --git a/tools/metrics/histograms/enums.xml b/tools/metrics/histograms/enums.xml index 859ad44c..cce01093 100644 --- a/tools/metrics/histograms/enums.xml +++ b/tools/metrics/histograms/enums.xml
@@ -28886,6 +28886,12 @@ <int value="8" label="Tapped Open in New Tab"/> <int value="9" label="Opened context menu"/> <int value="10" label="Opened feed surface"/> + <int value="11" label="Tapped Open in Incognito tab"/> + <int value="12" + label="Ephemeral change, likely due to hide story or not interested in"/> + <int value="13" + label="Ephemeral change undone, likely due to pressing 'undo' on the + snackbar"/> </enum> <enum name="FeedZeroStateShowReason"> @@ -41468,6 +41474,7 @@ <int value="-396046249" label="PhotoPickerVideoSupport:enabled"/> <int value="-395606844" label="enable-site-settings"/> <int value="-395454065" label="DisablePostScriptPrinting:disabled"/> + <int value="-394734604" label="FillingPasswordsFromAnyOrigin:disabled"/> <int value="-389664522" label="OmniboxUIExperimentHideSteadyStateUrlPathQueryAndRefOnInteraction:enabled"/> <int value="-387606010" label="ArcBootCompletedBroadcast:enabled"/> @@ -42184,6 +42191,7 @@ <int value="393704200" label="account-consistency"/> <int value="398903399" label="GenericSensorExtraClasses:disabled"/> <int value="399039205" label="enable-webrtc-hw-vp9-encoding"/> + <int value="399177140" label="FillingPasswordsFromAnyOrigin:enabled"/> <int value="399398207" label="OmniboxUIExperimentVerticalMarginLimitToNonTouchOnly:enabled"/> <int value="400272381" label="LazyFrameLoading:disabled"/> @@ -68556,6 +68564,11 @@ <int value="20" label="Permission Requests High"/> <int value="21" label="Announcement"/> <int value="22" label="Share Save Image"/> + <int value="23" label="TWA Disclosure Initial"/> + <int value="24" label="TWA Disclosure Subsequent"/> + <int value="25" label="Chrome Reengagement 1"/> + <int value="26" label="Chrome Reengagement 2"/> + <int value="27" label="Chrome Reengagement 3"/> </enum> <enum name="TabBackgroundLoadStatus">
diff --git a/tools/metrics/histograms/histograms.xml b/tools/metrics/histograms/histograms.xml index b3b0fa7f..77bf44e 100644 --- a/tools/metrics/histograms/histograms.xml +++ b/tools/metrics/histograms/histograms.xml
@@ -5060,9 +5060,9 @@ </histogram> <histogram name="Android.WebView.ClearProxyOverride" units="units" - expires_after="2020-08-13"> + expires_after="2021-08-01"> <owner>laisminchillo@chromium.org</owner> - <owner>tobiasjs@chromium.org</owner> + <owner>src/android_webview/OWNERS</owner> <summary>Records ClearProxyOverride calls.</summary> </histogram> @@ -5550,27 +5550,27 @@ </histogram> <histogram name="Android.WebView.SetProxyOverride.BypassRules" - enum="BooleanPresent" expires_after="2020-08-13"> + enum="BooleanPresent" expires_after="2021-08-01"> <owner>laisminchillo@chromium.org</owner> - <owner>tobiasjs@chromium.org</owner> + <owner>src/android_webview/OWNERS</owner> <summary> Records whether bypass rules were present in SetProxyOverride calls. </summary> </histogram> <histogram name="Android.WebView.SetProxyOverride.ProxySchemeFilterType" - enum="AndroidWebViewProxySchemeFilterType" expires_after="2020-08-13"> + enum="AndroidWebViewProxySchemeFilterType" expires_after="2021-08-01"> <owner>laisminchillo@chromium.org</owner> - <owner>tobiasjs@chromium.org</owner> + <owner>src/android_webview/OWNERS</owner> <summary> Records the type of scheme filter in SetProxyOverride calls. </summary> </histogram> <histogram name="Android.WebView.SetProxyOverride.ProxyUrlType" - enum="AndroidWebViewProxyUrlType" expires_after="2020-08-13"> + enum="AndroidWebViewProxyUrlType" expires_after="2021-08-01"> <owner>laisminchillo@chromium.org</owner> - <owner>tobiasjs@chromium.org</owner> + <owner>src/android_webview/OWNERS</owner> <summary>Records the type of url in SetProxyOverride calls.</summary> </histogram> @@ -25392,6 +25392,9 @@ </histogram> <histogram name="Cellular.ActivationTry" units="units" expires_after="M85"> + <obsolete> + Removed 07/2020 because the histogram is neither logged nor owned. + </obsolete> <owner>Please list the metric's owners. Add more owner tags as needed.</owner> <summary>The count of cellular device activation tries (Chrome OS).</summary> </histogram> @@ -25430,6 +25433,9 @@ </histogram> <histogram name="Cellular.MobileSetupStart" units="units" expires_after="M77"> + <obsolete> + Removed 07/2020 because it is unowned and did not appear to be needed. + </obsolete> <owner>Please list the metric's owners. Add more owner tags as needed.</owner> <summary> The count of initiated cellular device setup starts (Chrome OS). @@ -25439,7 +25445,8 @@ <histogram name="Cellular.MobileSetupSucceeded" units="units" expires_after="2016-04-29"> <obsolete> - Removed 04/2016 as doesn't have data nor owner. + Removed logging on 07/2020; the histogram is unowned and has been marked as + obsolete since 04/2016. </obsolete> <owner>Please list the metric's owners. Add more owner tags as needed.</owner> <summary>The count of failed cellular plan setup tries (Chrome OS).</summary> @@ -25448,7 +25455,8 @@ <histogram name="Cellular.PaymentFailed" units="units" expires_after="2016-04-29"> <obsolete> - Removed 04/2016 as doesn't have data nor owner. + Removed logging on 07/2020; the histogram is unowned and has been marked as + obsolete since 04/2016. </obsolete> <owner>Please list the metric's owners. Add more owner tags as needed.</owner> <summary>The count of failed cellular plan purchases (Chrome OS).</summary> @@ -25457,7 +25465,8 @@ <histogram name="Cellular.PaymentReceived" units="units" expires_after="2016-04-29"> <obsolete> - Removed 04/2016 as doesn't have data nor owner. + Removed logging on 07/2020; the histogram is unowned and has been marked as + obsolete since 04/2016. </obsolete> <owner>Please list the metric's owners. Add more owner tags as needed.</owner> <summary> @@ -28150,7 +28159,7 @@ <histogram name="Compositing.Browser.HitTestTimeToFindClosestLayer" units="microseconds" expires_after="2020-12-01"> - <owner>yigu@chromium.org</owner> + <owner>flackr@chromium.org</owner> <owner>animations-dev@chromium.org</owner> <summary> Time spent finding the closest matching layer to a given point whenever we @@ -28957,7 +28966,7 @@ <histogram name="Compositing.Renderer.HitTestTimeToFindClosestLayer" units="microseconds" expires_after="2020-12-01"> - <owner>yigu@chromium.org</owner> + <owner>flackr@chromium.org</owner> <owner>animations-dev@chromium.org</owner> <summary> Time spent finding the closest matching layer to a given point whenever we @@ -30896,6 +30905,20 @@ </summary> </histogram> +<histogram base="true" name="ContentSuggestions.Feed.LoadStepLatency" + units="ms" expires_after="2021-06-01"> + <owner>harringtond@chromium.org</owner> + <owner>feed@chromium.org</owner> + <summary> + Latencies for individual steps taken to load the feed. This is reported at + most once per Chrome execution, and only reported for a Feed load operation + that ends with the Feed showing up on the UI. All steps added together tally + to the total time taken. + + Feed v2 only. + </summary> +</histogram> + <histogram name="ContentSuggestions.Feed.LoadStreamStatus.BackgroundRefresh" enum="FeedLoadStreamStatus" expires_after="2021-05-01"> <owner>harringtond@chromium.org</owner> @@ -39447,6 +39470,13 @@ </summary> </histogram> +<histogram name="DevTools.PanelClosed" enum="DevToolsPanel" expires_after="M87"> + <owner>yangguo@chromium.org</owner> + <owner>joselea@microsoft.com</owner> + <owner>shanejc@microsoft.com</owner> + <summary>Specified DevTools panel was closed.</summary> +</histogram> + <histogram name="DevTools.PanelShown" enum="DevToolsPanel" expires_after="M85"> <owner>alph@chromium.org</owner> <owner>yangguo@chromium.org</owner> @@ -204178,6 +204208,22 @@ <affected-histogram name="ContentSuggestions.Feed.TokenFailedToCompleted"/> </histogram_suffixes> +<histogram_suffixes name="FeedLoadLatencyStep" separator="."> + <suffix name="ActionUpload" + label="Time taken read stored actions and upload them if necessary."/> + <suffix name="LoadFromStore" + label="Time taken to load the feed content from local storage."/> + <suffix name="QueryRequest" + label="Time taken to request fresh feed content from the network."/> + <suffix name="StreamView" + label="Time taken to receive feedback that a Feed item was shown. Time + begins after feed data is loaded from the network or local + storage"/> + <suffix name="TaskStart" + label="Time taken to begin executing the load stream task."/> + <affected-histogram name="ContentSuggestions.Feed.LoadStepLatency"/> +</histogram_suffixes> + <histogram_suffixes name="FeedNetworkRequestType" separator="."> <suffix name="FeedQuery" label="Requests to fetch new feed content"/> <suffix name="UploadActions" label="Requests to upload user action data"/>
diff --git a/tools/perf/core/minidump_unittest.py b/tools/perf/core/minidump_unittest.py index b8ae08d..9acffb59 100644 --- a/tools/perf/core/minidump_unittest.py +++ b/tools/perf/core/minidump_unittest.py
@@ -35,6 +35,7 @@ # still read-only, so skip the test in that case. @decorators.Disabled( 'chromeos-local', + 'linux', # https://crbug.com/1108432 'win' # https://crbug.com/1084931 ) def testSymbolizeMinidump(self): @@ -80,6 +81,7 @@ # still read-only, so skip the test in that case. @decorators.Disabled( 'chromeos-local', + 'linux', # https://crbug.com/1108432 'win' # https://crbug.com/1084931 ) def testMultipleCrashMinidumps(self):
diff --git a/tools/perf/core/perf_data_generator.py b/tools/perf/core/perf_data_generator.py index d13ddc51..dfe0cc9 100755 --- a/tools/perf/core/perf_data_generator.py +++ b/tools/perf/core/perf_data_generator.py
@@ -464,7 +464,7 @@ 'tests': [{ 'isolate': 'performance_test_suite', }], - 'platform': 'android-chrome', + 'platform': 'android-chrome-64-bundle', 'dimension': { 'pool': 'chrome.tests.perf', 'os': 'Android',
diff --git a/tools/perf/core/perf_json_config_validator.py b/tools/perf/core/perf_json_config_validator.py index 3c7500a..b8c44fc 100644 --- a/tools/perf/core/perf_json_config_validator.py +++ b/tools/perf/core/perf_json_config_validator.py
@@ -97,11 +97,9 @@ "%s must use 'android-webview' or 'android-webview-google' " "browser" % builder_name) elif 'Android' in builder_name or 'android' in builder_name: - android_browsers = ( - 'android-chromium', - 'android-chrome', - 'android-chrome-bundle', - 'exact') + android_browsers = ('android-chromium', 'android-chrome', + 'android-chrome-bundle', 'android-chrome-64-bundle', + 'exact') if browser_options.browser not in android_browsers: raise ValueError( 'The browser type for %s must be one of %s' % ( builder_name, ', '.join(android_browsers)))
diff --git a/tools/perf/core/perfetto_binary_roller/binary_deps.json b/tools/perf/core/perfetto_binary_roller/binary_deps.json index 30875a3..4c56e1c 100644 --- a/tools/perf/core/perfetto_binary_roller/binary_deps.json +++ b/tools/perf/core/perfetto_binary_roller/binary_deps.json
@@ -1,16 +1,16 @@ { "trace_processor_shell": { "win": { - "hash": "85538d973c3e2f37c43b8eeead2944aa61227bc9", - "remote_path": "perfetto_binaries/trace_processor_shell/win/fce06b20005cdc2e98d266719088811c65eecf0f/trace_processor_shell.exe" + "hash": "fc3c5a7106021819cc2cf6aeae42231f8c7282c4", + "remote_path": "perfetto_binaries/trace_processor_shell/win/c6f029c304cac3a9a22e9e99b644335fbc7b060a/trace_processor_shell.exe" }, "mac": { "hash": "d91a66af4c71d73ae41ad3be3ba83eeeb5ea228a", - "remote_path": "perfetto_binaries/trace_processor_shell/mac/0f08cdebc12b8d432cff424393901a53e98feef1/trace_processor_shell" + "remote_path": "perfetto_binaries/trace_processor_shell/mac/c6f029c304cac3a9a22e9e99b644335fbc7b060a/trace_processor_shell" }, "linux": { - "hash": "f19c2e845634058155c317f40f583a3145f9338a", - "remote_path": "perfetto_binaries/trace_processor_shell/linux/4b656a010be50665d73995d66c5f5a544262b10f/trace_processor_shell" + "hash": "a2171c90c8fb1b7de6a3e82599b8bf7bdc8cc2e5", + "remote_path": "perfetto_binaries/trace_processor_shell/linux/b5aa09d7531bcf44d51064f8e31be6bd2f86667f/trace_processor_shell" } }, "power_profile.sql": {
diff --git a/tools/win/IdleWakeups/README.md b/tools/win/IdleWakeups/README.md new file mode 100644 index 0000000..841df0a --- /dev/null +++ b/tools/win/IdleWakeups/README.md
@@ -0,0 +1,29 @@ +This tool is designed to measure and aggregate a few key performance metrics +for all Chrome processes over time. The tool supports other browsers such as +Edge or Firefox, or in fact any other processes. The inclusion of processes +is based on a simple partial process image name match against the image name +argument (optional, chrome.exe is the default image name used when no +argument is provided). + +# Compilation +Open IdleWakeups.sln in Visual Studio and select Build > Build Solution (F7). +IdleWakeups.exe can then be found in src/tools/win/IdleWakeups/x64/Debug/. + +# Usage +"IdleWakeups.exe" to match all Chrome processes. +"IdleWakeups.exe Firefox" to match all Firefox processes. +"IdleWakeups.exe msedge" to match all Edge processes. + +The process matching the provided parameter is identified by case-sensitive +string prefix, e.g., "some_process" and "some_process.exe" would both work. + +When the tool starts it begins gathering and aggregating CPU usage, private +working set size, number of context switches / sec, and power usage for all +matched processes. Hit Ctrl-C to stop the measurements and print average and +median values over the entire measurement interval. + +CPU usage is normalized to one CPU core, with 100% meaning one CPU core is +fully utilized. + +Intel Power Gadget is required to allow IdleWakeups tool to query power usage. +https://software.intel.com/en-us/articles/intel-power-gadget-20
diff --git a/tools/win/IdleWakeups/ReadMe.txt b/tools/win/IdleWakeups/ReadMe.txt deleted file mode 100644 index e48f798..0000000 --- a/tools/win/IdleWakeups/ReadMe.txt +++ /dev/null
@@ -1,23 +0,0 @@ -This tool is designed to measure and aggregate a few key performance metrics -for all Chrome processes over time. The tool supports other browsers such as -Edge or Firefox, or in fact any other processes. The inclusion of processes -is based on a simple partial process image name match against the image name -argument (optional, Chrome.exe is the default image name used when no -argument is provided). - -Sample usage: - -"IdleWakeups.exe" to match all Chrome.exe processes. -"IdleWakeups.exe" firefox to match Firefox process. -"IdleWakeups.exe MicrosoftEdge" to match all Edge processes. - -When the tool starts it begins gathering and aggregating CPU usage, private -working set size, number of context switches / sec, and power usage for all -matched processes. Hit Ctrl+C to stop the measurements and print average and -median values over the entire measurement interval. - -CPU usage is normalized to one CPU core with 100% meaning one CPU core is -fully utilized. - -Intel Power Gadget is required to allow IdleWakeups tool to query power usage. -https://software.intel.com/en-us/articles/intel-power-gadget-20
diff --git a/ui/android/java/src/org/chromium/ui/base/SelectFileDialog.java b/ui/android/java/src/org/chromium/ui/base/SelectFileDialog.java index 57c19f1..972a2190 100644 --- a/ui/android/java/src/org/chromium/ui/base/SelectFileDialog.java +++ b/ui/android/java/src/org/chromium/ui/base/SelectFileDialog.java
@@ -697,9 +697,10 @@ @Override public Boolean doInBackground() { File file = new File(mFilePath); + File dataDir = new File(PathUtils.getDataDirectory()); try { // Don't allow files under private data dir to be uploaded. - if (!file.getCanonicalPath().startsWith(PathUtils.getDataDirectory())) { + if (!file.getCanonicalPath().startsWith(dataDir.getCanonicalPath())) { return true; } } catch (Exception e) {
diff --git a/ui/android/junit/src/org/chromium/ui/base/SelectFileDialogTest.java b/ui/android/junit/src/org/chromium/ui/base/SelectFileDialogTest.java index a7e3103c..cd5fe37 100644 --- a/ui/android/junit/src/org/chromium/ui/base/SelectFileDialogTest.java +++ b/ui/android/junit/src/org/chromium/ui/base/SelectFileDialogTest.java
@@ -22,6 +22,7 @@ import org.chromium.base.test.BaseRobolectricTestRunner; import java.io.File; +import java.io.IOException; import java.nio.file.Path; import java.util.ArrayList; import java.util.Arrays; @@ -160,10 +161,11 @@ } @Test - public void testFilePathSelected() { + public void testFilePathSelected() throws IOException { SelectFileDialog selectFileDialog = new SelectFileDialog(0); PathUtils.setPrivateDataDirectorySuffix("test"); - String dataDir = PathUtils.getDataDirectory(); + String dataDir = new File(PathUtils.getDataDirectory()).getCanonicalPath(); + SelectFileDialog.FilePathSelectedTask task = selectFileDialog.new FilePathSelectedTask( ContextUtils.getApplicationContext(), dataDir, null); assertFalse(task.doInBackground());
diff --git a/ui/gl/gl_image.cc b/ui/gl/gl_image.cc index d68b745..768a48f 100644 --- a/ui/gl/gl_image.cc +++ b/ui/gl/gl_image.cc
@@ -118,6 +118,10 @@ return false; } +void GLImage::DisableInUseByWindowServer() { + NOTIMPLEMENTED(); +} + GLImage::Type GLImage::GetType() const { return Type::NONE; }
diff --git a/ui/gl/gl_image.h b/ui/gl/gl_image.h index 538065d5..7058195 100644 --- a/ui/gl/gl_image.h +++ b/ui/gl/gl_image.h
@@ -134,6 +134,9 @@ // storage for the image. virtual bool IsInUseByWindowServer() const; + // If called, then IsInUseByWindowServer will always return false. + virtual void DisableInUseByWindowServer(); + #if defined(OS_ANDROID) // Provides the buffer backing this image, if it is backed by an // AHardwareBuffer. The ScopedHardwareBuffer returned may include a fence
diff --git a/ui/gl/gl_image_io_surface.h b/ui/gl/gl_image_io_surface.h index c5dd041..e78cb1a 100644 --- a/ui/gl/gl_image_io_surface.h +++ b/ui/gl/gl_image_io_surface.h
@@ -70,6 +70,7 @@ const std::string& dump_name) override; bool EmulatingRGB() const override; bool IsInUseByWindowServer() const override; + void DisableInUseByWindowServer() override; gfx::GenericSharedMemoryId io_surface_id() const { return io_surface_id_; } base::ScopedCFTypeRef<IOSurfaceRef> io_surface(); @@ -112,6 +113,8 @@ // The default value of Rec. 601 is based on historical shader code. gfx::ColorSpace color_space_for_yuv_to_rgb_ = gfx::ColorSpace::CreateREC601(); + bool disable_in_use_by_window_server_ = false; + DISALLOW_COPY_AND_ASSIGN(GLImageIOSurface); };
diff --git a/ui/gl/gl_image_io_surface.mm b/ui/gl/gl_image_io_surface.mm index 8cde928..7c1d651 100644 --- a/ui/gl/gl_image_io_surface.mm +++ b/ui/gl/gl_image_io_surface.mm
@@ -433,11 +433,15 @@ // IOSurfaceIsInUse() will always return true if the IOSurface is wrapped in // a CVPixelBuffer. Ignore the signal for such IOSurfaces (which are the ones // output by hardware video decode). - if (cv_pixel_buffer_) + if (disable_in_use_by_window_server_) return false; return IOSurfaceIsInUse(io_surface_.get()); } +void GLImageIOSurface::DisableInUseByWindowServer() { + disable_in_use_by_window_server_ = true; +} + void GLImageIOSurface::SetColorSpaceForYUVToRGBConversion( const gfx::ColorSpace& color_space) { DCHECK(color_space.IsValid());
diff --git a/ui/message_center/message_center_impl.cc b/ui/message_center/message_center_impl.cc index eb61bf4e..55eacef7 100644 --- a/ui/message_center/message_center_impl.cc +++ b/ui/message_center/message_center_impl.cc
@@ -247,10 +247,14 @@ scoped_refptr<NotificationDelegate> delegate = notification_list_->GetNotificationDelegate(copied_id); + + // Remove notification before calling the Close method in case it calls + // RemoveNotification reentrantly. + notification_list_->RemoveNotification(copied_id); + if (delegate.get()) delegate->Close(by_user); - notification_list_->RemoveNotification(copied_id); visible_notifications_ = notification_list_->GetVisibleNotifications(blockers_); for (auto& observer : observer_list_)
diff --git a/ui/message_center/message_center_impl_unittest.cc b/ui/message_center/message_center_impl_unittest.cc index 4d37841..c12ef6d 100644 --- a/ui/message_center/message_center_impl_unittest.cc +++ b/ui/message_center/message_center_impl_unittest.cc
@@ -136,6 +136,28 @@ DISALLOW_COPY_AND_ASSIGN(TestDelegate); }; +class DeleteOnCloseDelegate : public NotificationDelegate { + public: + DeleteOnCloseDelegate(MessageCenter* message_center, + const std::string& notification_id) + : message_center_(message_center), notification_id_(notification_id) {} + DeleteOnCloseDelegate(const DeleteOnCloseDelegate&) = delete; + DeleteOnCloseDelegate& operator=(const DeleteOnCloseDelegate&) = delete; + + void Close(bool by_user) override { + // Removing the same notification inside Close should be a noop. + message_center_->RemoveNotification(notification_id_, false /* by_user */); + } + void Click(const base::Optional<int>& button_index, + const base::Optional<base::string16>& reply) override {} + + private: + ~DeleteOnCloseDelegate() override = default; + + MessageCenter* message_center_; + std::string notification_id_; +}; + // The default app id used to create simple notifications. const std::string kDefaultAppId = "app1"; @@ -912,6 +934,24 @@ EXPECT_EQ(0u, message_center()->GetVisibleNotifications().size()); } +TEST_F(MessageCenterImplTest, RemoveInCloseHandler) { + std::string id("id1"); + + // Create a notification that calls RemoveNotification() on close. + auto notification = std::make_unique<Notification>( + NOTIFICATION_TYPE_SIMPLE, id, UTF8ToUTF16("title"), UTF8ToUTF16(id), + gfx::Image() /* icon */, base::string16() /* display_source */, GURL(), + NotifierId(NotifierType::APPLICATION, kDefaultAppId), + RichNotificationData(), + base::MakeRefCounted<DeleteOnCloseDelegate>(message_center(), id)); + message_center()->AddNotification(std::move(notification)); + EXPECT_TRUE(message_center()->FindVisibleNotificationById(id)); + + // Then remove the notification which calls RemoveNotification() reentrantly. + message_center()->RemoveNotification(id, true /* by_user */); + EXPECT_FALSE(message_center()->FindVisibleNotificationById(id)); +} + TEST_F(MessageCenterImplTest, FindNotificationsByAppId) { message_center()->SetHasMessageCenterView(true);
diff --git a/ui/ozone/platform/wayland/host/wayland_output.cc b/ui/ozone/platform/wayland/host/wayland_output.cc index 701f167..7a4067d 100644 --- a/ui/ozone/platform/wayland/host/wayland_output.cc +++ b/ui/ozone/platform/wayland/host/wayland_output.cc
@@ -11,7 +11,7 @@ namespace ui { -WaylandOutput::WaylandOutput(const uint32_t output_id, wl_output* output) +WaylandOutput::WaylandOutput(uint32_t output_id, wl_output* output) : output_id_(output_id), output_(output), scale_factor_(kDefaultScaleFactor), @@ -31,7 +31,7 @@ wl_output_add_listener(output_.get(), &output_listener, this); } -void WaylandOutput::TriggerDelegateNotification() const { +void WaylandOutput::TriggerDelegateNotifications() const { DCHECK(!rect_in_physical_pixels_.IsEmpty()); delegate_->OnOutputHandleMetrics(output_id_, rect_in_physical_pixels_, scale_factor_); @@ -67,9 +67,8 @@ // static void WaylandOutput::OutputHandleDone(void* data, struct wl_output* wl_output) { - WaylandOutput* wayland_output = static_cast<WaylandOutput*>(data); - if (wayland_output) - wayland_output->TriggerDelegateNotification(); + if (auto* output = static_cast<WaylandOutput*>(data)) + output->TriggerDelegateNotifications(); } // static
diff --git a/ui/ozone/platform/wayland/host/wayland_output.h b/ui/ozone/platform/wayland/host/wayland_output.h index 36f8c89..3bda676 100644 --- a/ui/ozone/platform/wayland/host/wayland_output.h +++ b/ui/ozone/platform/wayland/host/wayland_output.h
@@ -20,23 +20,23 @@ public: class Delegate { public: - virtual ~Delegate() {} - virtual void OnOutputHandleMetrics(uint32_t output_id, const gfx::Rect& new_bounds, int32_t scale_factor) = 0; + + protected: + virtual ~Delegate() = default; }; - WaylandOutput(const uint32_t output_id, wl_output* output); + WaylandOutput(uint32_t output_id, wl_output* output); ~WaylandOutput(); void Initialize(Delegate* delegate); - void TriggerDelegateNotification() const; - uint32_t output_id() const { return output_id_; } bool has_output(wl_output* output) const { return output_.get() == output; } int32_t scale_factor() const { return scale_factor_; } + gfx::Rect bounds() const { return rect_in_physical_pixels_; } // Tells if the output has already received physical screen dimensions in the // global compositor space. @@ -45,6 +45,8 @@ private: static constexpr int32_t kDefaultScaleFactor = 1; + void TriggerDelegateNotifications() const; + // Callback functions used for setting geometric properties of the output // and available modes. static void OutputHandleGeometry(void* data,
diff --git a/ui/ozone/platform/wayland/host/wayland_output_manager.cc b/ui/ozone/platform/wayland/host/wayland_output_manager.cc index 1f403f4..4d71d142 100644 --- a/ui/ozone/platform/wayland/host/wayland_output_manager.cc +++ b/ui/ozone/platform/wayland/host/wayland_output_manager.cc
@@ -4,6 +4,8 @@ #include "ui/ozone/platform/wayland/host/wayland_output_manager.h" +#include <algorithm> +#include <cstdint> #include <memory> #include "ui/ozone/platform/wayland/host/wayland_connection.h" @@ -15,13 +17,16 @@ WaylandOutputManager::~WaylandOutputManager() = default; +// Output is considered ready when at least one wl_output is fully configured +// (i.e: wl_output::done received), so that WaylandOutputManager is able to +// instantiate a valid WaylandScreen when requested by the upper layer. bool WaylandOutputManager::IsOutputReady() const { - if (output_list_.empty()) - return false; - return output_list_.front()->is_ready(); + return std::find_if(output_list_.begin(), output_list_.end(), + [](const auto& output) { return output->is_ready(); }) != + output_list_.end(); } -void WaylandOutputManager::AddWaylandOutput(const uint32_t output_id, +void WaylandOutputManager::AddWaylandOutput(uint32_t output_id, wl_output* output) { // Make sure an output with |output_id| has not been added yet. It's very // unlikely to happen, unless a compositor has a bug in the numeric names @@ -29,26 +34,26 @@ auto output_it = GetOutputItById(output_id); DCHECK(output_it == output_list_.end()); auto wayland_output = std::make_unique<WaylandOutput>(output_id, output); - WaylandOutput* wayland_output_ptr = wayland_output.get(); - output_list_.push_back(std::move(wayland_output)); - - OnWaylandOutputAdded(output_id); // Even if WaylandScreen has not been created, the output still must be // initialized, which results in setting up a wl_listener and getting the // geometry and the scaling factor from the Wayland Compositor. - wayland_output_ptr->Initialize(this); + wayland_output->Initialize(this); + DCHECK(!wayland_output->is_ready()); + + output_list_.push_back(std::move(wayland_output)); } -void WaylandOutputManager::RemoveWaylandOutput(const uint32_t output_id) { +void WaylandOutputManager::RemoveWaylandOutput(uint32_t output_id) { auto output_it = GetOutputItById(output_id); // Check the comment in the WaylandConnetion::GlobalRemove. if (output_it == output_list_.end()) return; + if (wayland_screen_) + wayland_screen_->OnOutputRemoved(output_id); output_list_.erase(output_it); - OnWaylandOutputRemoved(output_id); } std::unique_ptr<WaylandScreen> WaylandOutputManager::CreateWaylandScreen( @@ -64,10 +69,10 @@ // OutOutputHandleScale. All the other hot geometry and scale changes are done // automatically, and the |wayland_screen_| is notified immediately about the // changes. - if (!output_list_.empty()) { - for (auto& output : output_list_) { - OnWaylandOutputAdded(output->output_id()); - output->TriggerDelegateNotification(); + for (const auto& output : output_list_) { + if (output->is_ready()) { + wayland_screen->OnOutputAddedOrUpdated( + output->output_id(), output->bounds(), output->scale_factor()); } } @@ -90,22 +95,13 @@ return output_it->get(); } -void WaylandOutputManager::OnWaylandOutputAdded(uint32_t output_id) { - if (wayland_screen_) - wayland_screen_->OnOutputAdded(output_id); -} - -void WaylandOutputManager::OnWaylandOutputRemoved(uint32_t output_id) { - if (wayland_screen_) - wayland_screen_->OnOutputRemoved(output_id); -} - void WaylandOutputManager::OnOutputHandleMetrics(uint32_t output_id, const gfx::Rect& new_bounds, int32_t scale_factor) { - if (wayland_screen_) - wayland_screen_->OnOutputMetricsChanged(output_id, new_bounds, + if (wayland_screen_) { + wayland_screen_->OnOutputAddedOrUpdated(output_id, new_bounds, scale_factor); + } } WaylandOutputManager::OutputList::const_iterator
diff --git a/ui/ozone/platform/wayland/host/wayland_output_manager.h b/ui/ozone/platform/wayland/host/wayland_output_manager.h index f05828a6..e02f1097 100644 --- a/ui/ozone/platform/wayland/host/wayland_output_manager.h +++ b/ui/ozone/platform/wayland/host/wayland_output_manager.h
@@ -44,9 +44,6 @@ WaylandScreen* wayland_screen() const { return wayland_screen_.get(); } private: - void OnWaylandOutputAdded(uint32_t output_id); - void OnWaylandOutputRemoved(uint32_t output_id); - // WaylandOutput::Delegate: void OnOutputHandleMetrics(uint32_t output_id, const gfx::Rect& new_bounds,
diff --git a/ui/ozone/platform/wayland/host/wayland_screen.cc b/ui/ozone/platform/wayland/host/wayland_screen.cc index 81af627..fc4d4fa 100644 --- a/ui/ozone/platform/wayland/host/wayland_screen.cc +++ b/ui/ozone/platform/wayland/host/wayland_screen.cc
@@ -10,8 +10,10 @@ #include "base/stl_util.h" #include "ui/display/display.h" #include "ui/display/display_finder.h" +#include "ui/display/display_list.h" #include "ui/display/display_observer.h" #include "ui/gfx/geometry/point.h" +#include "ui/gfx/geometry/rect.h" #include "ui/gfx/native_widget_types.h" #include "ui/ozone/platform/wayland/host/wayland_connection.h" #include "ui/ozone/platform/wayland/host/wayland_cursor_position.h" @@ -26,9 +28,10 @@ WaylandScreen::~WaylandScreen() = default; -void WaylandScreen::OnOutputAdded(uint32_t output_id) { - display_list_.AddDisplay(display::Display(output_id), - display::DisplayList::Type::NOT_PRIMARY); +void WaylandScreen::OnOutputAddedOrUpdated(uint32_t output_id, + const gfx::Rect& bounds, + int32_t scale) { + AddOrUpdateDisplay(output_id, bounds, scale); } void WaylandScreen::OnOutputRemoved(uint32_t output_id) { @@ -49,41 +52,32 @@ display_list_.RemoveDisplay(output_id); } -void WaylandScreen::OnOutputMetricsChanged(uint32_t output_id, - const gfx::Rect& new_bounds, - int32_t device_pixel_ratio) { +void WaylandScreen::AddOrUpdateDisplay(uint32_t output_id, + const gfx::Rect& new_bounds, + int32_t scale_factor) { display::Display changed_display(output_id); if (!display::Display::HasForceDeviceScaleFactor()) - changed_display.set_device_scale_factor(device_pixel_ratio); + changed_display.set_device_scale_factor(scale_factor); changed_display.set_bounds(new_bounds); changed_display.set_work_area(new_bounds); - bool is_primary = false; - display::Display display_nearest_origin = - GetDisplayNearestPoint(gfx::Point(0, 0)); - // If bounds of the nearest to origin display are empty, it must have been the - // very first and the same display added before. - if (display_nearest_origin.bounds().IsEmpty()) { - DCHECK_EQ(display_nearest_origin.id(), changed_display.id()); - is_primary = true; - } else if (changed_display.bounds().origin() < - display_nearest_origin.bounds().origin()) { - // If changed display is nearer to the origin than the previous display, - // that one must become a primary display. - is_primary = true; - } else if (changed_display.bounds().OffsetFromOrigin() == - display_nearest_origin.bounds().OffsetFromOrigin()) { - // If changed display has the same origin as the nearest to origin display, - // |changed_display| must become a primary one or it has already been the - // primary one. If a user changed positions of two displays (the second at - // x,x was set to 0,0), the second change will modify geometry of the - // display, which used to be the one nearest to the origin. - is_primary = true; + // There are 2 cases where |changed_display| must be set as primary: + // 1. When it is the first one being added to the |display_list_|. Or + // 2. If it is nearest the origin than the previous primary or has the same + // origin as it. When an user, for example, swaps two side-by-side displays, + // at some point, as the notification come in, both will have the same + // origin. + auto type = display::DisplayList::Type::NOT_PRIMARY; + if (display_list_.displays().empty()) { + type = display::DisplayList::Type::PRIMARY; + } else { + auto nearest_origin = GetDisplayNearestPoint({0, 0}).bounds().origin(); + auto changed_origin = changed_display.bounds().origin(); + if (changed_origin < nearest_origin || changed_origin == nearest_origin) + type = display::DisplayList::Type::PRIMARY; } - display_list_.UpdateDisplay( - changed_display, is_primary ? display::DisplayList::Type::PRIMARY - : display::DisplayList::Type::NOT_PRIMARY); + display_list_.AddOrUpdateDisplay(changed_display, type); auto* wayland_window_manager = connection_->wayland_window_manager(); for (auto* window : wayland_window_manager->GetWindowsOnOutput(output_id))
diff --git a/ui/ozone/platform/wayland/host/wayland_screen.h b/ui/ozone/platform/wayland/host/wayland_screen.h index 8d65dd81..55993fc 100644 --- a/ui/ozone/platform/wayland/host/wayland_screen.h +++ b/ui/ozone/platform/wayland/host/wayland_screen.h
@@ -14,6 +14,10 @@ #include "ui/gfx/geometry/point.h" #include "ui/ozone/public/platform_screen.h" +namespace gfx { +class Rect; +} + namespace ui { class WaylandConnection; @@ -26,11 +30,10 @@ WaylandScreen& operator=(const WaylandScreen&) = delete; ~WaylandScreen() override; - void OnOutputAdded(uint32_t output_id); - void OnOutputRemoved(uint32_t output_id); - void OnOutputMetricsChanged(uint32_t output_id, + void OnOutputAddedOrUpdated(uint32_t output_id, const gfx::Rect& bounds, int32_t output_scale); + void OnOutputRemoved(uint32_t output_id); base::WeakPtr<WaylandScreen> GetWeakPtr(); @@ -53,6 +56,10 @@ void RemoveObserver(display::DisplayObserver* observer) override; private: + void AddOrUpdateDisplay(uint32_t output_id, + const gfx::Rect& bounds, + int32_t scale); + WaylandConnection* connection_ = nullptr; display::DisplayList display_list_;
diff --git a/ui/ozone/platform/wayland/host/wayland_screen_unittest.cc b/ui/ozone/platform/wayland/host/wayland_screen_unittest.cc index e7ff85e..46b30f4 100644 --- a/ui/ozone/platform/wayland/host/wayland_screen_unittest.cc +++ b/ui/ozone/platform/wayland/host/wayland_screen_unittest.cc
@@ -10,12 +10,15 @@ #include "testing/gtest/include/gtest/gtest.h" #include "ui/display/display_observer.h" #include "ui/display/display_switches.h" +#include "ui/gfx/geometry/rect.h" #include "ui/gfx/native_widget_types.h" #include "ui/ozone/platform/wayland/host/wayland_connection.h" +#include "ui/ozone/platform/wayland/host/wayland_output.h" #include "ui/ozone/platform/wayland/host/wayland_output_manager.h" #include "ui/ozone/platform/wayland/host/wayland_screen.h" #include "ui/ozone/platform/wayland/test/mock_pointer.h" #include "ui/ozone/platform/wayland/test/mock_surface.h" +#include "ui/ozone/platform/wayland/test/test_output.h" #include "ui/ozone/platform/wayland/test/test_wayland_server_thread.h" #include "ui/ozone/platform/wayland/test/wayland_test.h" #include "ui/platform_window/platform_window_init_properties.h" @@ -68,15 +71,19 @@ class WaylandScreenTest : public WaylandTest { public: - WaylandScreenTest() {} - ~WaylandScreenTest() override {} + WaylandScreenTest() = default; + ~WaylandScreenTest() override = default; void SetUp() override { output_ = server_.output(); - output_->SetRect(gfx::Rect(0, 0, kOutputWidth, kOutputHeight)); WaylandTest::SetUp(); + output_->SetRect({kOutputWidth, kOutputHeight}); + output_->SetScale(1); + output_->Flush(); + Sync(); + output_manager_ = connection_->wayland_output_manager(); ASSERT_TRUE(output_manager_); @@ -98,17 +105,6 @@ std::move(properties)); } - void UpdateOutputGeometry(wl_resource* output_resource, - const gfx::Rect& new_rect) { - wl_output_send_geometry(output_resource, new_rect.x(), new_rect.y(), - 0 /* physical_width */, 0 /* physical_height */, - 0 /* subpixel */, "unknown_make", "unknown_model", - 0 /* transform */); - wl_output_send_mode(output_resource, WL_OUTPUT_MODE_CURRENT, - new_rect.width(), new_rect.height(), 0 /* refresh */); - wl_output_send_done(output_resource); - } - void ValidateTheDisplayForWidget(gfx::AcceleratedWidget widget, int64_t expected_display_id) { display::Display display_for_widget = @@ -146,18 +142,18 @@ const int64_t old_primary_display_id = platform_screen_->GetPrimaryDisplay().id(); + gfx::Rect output1_rect = server_.output()->GetRect(); // Add a second display. wl::TestOutput* output2 = server_.CreateAndInitializeOutput(); Sync(); - // Update rect of that display. - gfx::Rect output1_rect = server_.output()->GetRect(); - gfx::Rect output2_rect(output1_rect.width(), 0, 800, 600); // The second display is located to the right of first display like // | || |. - UpdateOutputGeometry(output2->resource(), output2_rect); + gfx::Rect output2_rect(output1_rect.width(), 0, 800, 600); + output2->SetRect(output2_rect); + output2->Flush(); Sync(); @@ -179,7 +175,8 @@ Sync(); // Updates rect again. - UpdateOutputGeometry(output2->resource(), output2_rect); + output2->SetRect(output2_rect); + output2->Flush(); Sync(); @@ -187,11 +184,14 @@ added_display_id = observer.GetDisplay().id(); EXPECT_NE(platform_screen_->GetPrimaryDisplay().id(), added_display_id); - // Now, rearrange displays so that second display becomes a primary one. + // Now, rearrange displays so that second display becomes the primary one. output1_rect = gfx::Rect(1024, 0, 1024, 768); + output_->SetRect(output1_rect); + output_->Flush(); + output2_rect = gfx::Rect(0, 0, 1024, 768); - UpdateOutputGeometry(server_.output()->resource(), output1_rect); - UpdateOutputGeometry(output2->resource(), output2_rect); + output2->SetRect(output2_rect); + output2->Flush(); Sync(); @@ -215,25 +215,24 @@ TestDisplayObserver observer; platform_screen_->AddObserver(&observer); - const gfx::Rect new_rect(0, 0, 800, 600); - UpdateOutputGeometry(output_->resource(), new_rect); + gfx::Rect new_rect{100, 100}; + output_->SetRect(new_rect); + output_->Flush(); Sync(); - uint32_t changed_values = 0; - changed_values |= display::DisplayObserver::DISPLAY_METRIC_BOUNDS; - changed_values |= display::DisplayObserver::DISPLAY_METRIC_WORK_AREA; + uint32_t changed_values = display::DisplayObserver::DISPLAY_METRIC_BOUNDS | + display::DisplayObserver::DISPLAY_METRIC_WORK_AREA; EXPECT_EQ(observer.GetAndClearChangedMetrics(), changed_values); EXPECT_EQ(observer.GetDisplay().bounds(), new_rect); const int32_t new_scale_value = 2; output_->SetScale(new_scale_value); + output_->Flush(); Sync(); - changed_values = 0; - changed_values |= - display::DisplayObserver::DISPLAY_METRIC_DEVICE_SCALE_FACTOR; + changed_values = display::DisplayObserver::DISPLAY_METRIC_DEVICE_SCALE_FACTOR; EXPECT_EQ(observer.GetAndClearChangedMetrics(), changed_values); EXPECT_EQ(observer.GetDisplay().device_scale_factor(), new_scale_value); @@ -329,7 +328,8 @@ // Place it on the right side of the primary display. const gfx::Rect output2_rect = gfx::Rect(primary_display.bounds().width(), 0, 1024, 768); - UpdateOutputGeometry(output2->resource(), output2_rect); + output2->SetRect(output2_rect); + output2->Flush(); Sync(); @@ -360,10 +360,10 @@ platform_screen_->GetDisplayMatching(gfx::Rect(1019, 0, 10, 10)).id()); // Place second display 700 pixels below along y axis (1024:700,1024x768) - UpdateOutputGeometry( - output2->resource(), + output2->SetRect( gfx::Rect(gfx::Point(output2_rect.x(), output2_rect.y() + 700), output2_rect.size())); + output2->Flush(); Sync(); @@ -388,6 +388,8 @@ platform_screen_->GetDisplayMatching(gfx::Rect(0, 0, 0, 0)).id()); platform_screen_->RemoveObserver(&observer); + output2->DestroyGlobal(); + Sync(); } TEST_P(WaylandScreenTest, GetDisplayForAcceleratedWidget) { @@ -406,7 +408,8 @@ // display. const gfx::Rect output2_rect = gfx::Rect(primary_display.bounds().width(), 0, 1024, 768); - UpdateOutputGeometry(output2->resource(), output2_rect); + output2->SetRect(output2_rect); + output2->Flush(); Sync(); @@ -455,6 +458,9 @@ // The id of the entered display must correspond to the second output. ValidateTheDisplayForWidget(widget, secondary_display.id()); + + output2->DestroyGlobal(); + Sync(); } TEST_P(WaylandScreenTest, GetCursorScreenPoint) { @@ -618,6 +624,7 @@ const int32_t kTripleScale = 3; EXPECT_CALL(*surface_, SetBufferScale(kTripleScale)); output_->SetScale(kTripleScale); + output_->Flush(); Sync(); @@ -639,6 +646,7 @@ EXPECT_NE(kForcedUIScale, kDoubleScale); EXPECT_CALL(*surface_, SetBufferScale(kDoubleScale)); output_->SetScale(kDoubleScale); + output_->Flush(); Sync(); @@ -648,11 +656,92 @@ display::Display::ResetForceDeviceScaleFactorForTesting(); } +namespace { + +class LazilyConfiguredScreenTest + : public WaylandTest, + public wl::TestWaylandServerThread::OutputDelegate { + public: + LazilyConfiguredScreenTest() = default; + LazilyConfiguredScreenTest(const LazilyConfiguredScreenTest&) = delete; + LazilyConfiguredScreenTest& operator=(const LazilyConfiguredScreenTest&) = + delete; + ~LazilyConfiguredScreenTest() override = default; + + void SetUp() override { + // Being the server's output delegate allows LazilyConfiguredScreenTest to + // manipulate wl_outputs during the server's global objects initialization + // phase. See SetupOutputs() function below. + server_.set_output_delegate(this); + + WaylandTest::SetUp(); + + output_manager_ = connection_->wayland_output_manager(); + ASSERT_TRUE(output_manager_); + } + + void TearDown() override { + WaylandTest::TearDown(); + server_.set_output_delegate(nullptr); + } + + protected: + // wl::TestWaylandServerThread::OutputDelegate: + void SetupOutputs(wl::TestOutput* primary) override { + // Keep the first wl_output announced "unconfigured" and just caches it for + // now, so we can exercise WaylandOutputManager::IsOutputReady() function + // when wl_output events come in unordered. + primary_output_ = primary; + + // Create/announce a second wl_output object and makes it the first one to + // get configuration events (eg: geometry, done, etc). This is achieved by + // setting its bounds here. + aux_output_ = server_.CreateAndInitializeOutput(); + aux_output_->SetRect({0, 0, 800, 600}); + } + + wl::TestOutput* primary_output_ = nullptr; + wl::TestOutput* aux_output_ = nullptr; + WaylandOutputManager* output_manager_ = nullptr; + bool auto_configure; +}; + +} // namespace + +// Ensures WaylandOutputManager and WaylandScreen properly handle scenarios +// where multiple wl_output objects are announced but not "configured" (ie: +// size, position, mode, etc sent to client) at bind time. +TEST_P(LazilyConfiguredScreenTest, DualOutput) { + // Ensure WaylandScreen got properly created and fed with a single display + // object, ie: |aux_output_| at server side. + EXPECT_TRUE(output_manager_->IsOutputReady()); + EXPECT_TRUE(screen_); + EXPECT_EQ(1u, screen_->GetAllDisplays().size()); + Sync(); + + // Send wl_output configuration events for the first advertised wl_output + // object. ie: |primary_output_| at server side. + primary_output_->SetRect({800, 0, kOutputWidth, kOutputHeight}); + primary_output_->SetScale(1); + primary_output_->Flush(); + Sync(); + + // And make sure it makes its way into the WaylandScreen's display list at + // client side. + EXPECT_EQ(2u, screen_->GetAllDisplays().size()); +} + INSTANTIATE_TEST_SUITE_P(XdgVersionStableTest, WaylandScreenTest, ::testing::Values(kXdgShellStable)); INSTANTIATE_TEST_SUITE_P(XdgVersionV6Test, WaylandScreenTest, ::testing::Values(kXdgShellV6)); +INSTANTIATE_TEST_SUITE_P(XdgVersionStableTest, + LazilyConfiguredScreenTest, + ::testing::Values(kXdgShellStable)); +INSTANTIATE_TEST_SUITE_P(XdgVersionV6Test, + LazilyConfiguredScreenTest, + ::testing::Values(kXdgShellV6)); } // namespace ui
diff --git a/ui/ozone/platform/wayland/host/wayland_window_manager_unittests.cc b/ui/ozone/platform/wayland/host/wayland_window_manager_unittests.cc index 38282eb..8237298 100644 --- a/ui/ozone/platform/wayland/host/wayland_window_manager_unittests.cc +++ b/ui/ozone/platform/wayland/host/wayland_window_manager_unittests.cc
@@ -159,7 +159,15 @@ TEST_P(WaylandWindowManagerTest, GetWindowsOnOutput) { MockPlatformWindowDelegate delegate; + // Create a second wl_output. wl::TestOutput* output = server_.CreateAndInitializeOutput(); + Sync(); + + // Place it at the right of the first output. + int x = server_.output()->GetRect().x(); + output->SetRect({x, 0, 800, 600}); + output->Flush(); + Sync(); auto window1 = CreateWaylandWindowWithParams(PlatformWindowType::kWindow, kDefaultBounds, &delegate); @@ -195,6 +203,9 @@ windows_on_output = manager_->GetWindowsOnOutput(output_id); EXPECT_EQ(2u, windows_on_output.size()); + + output->DestroyGlobal(); + Sync(); } TEST_P(WaylandWindowManagerTest, GetAllWindows) {
diff --git a/ui/ozone/platform/wayland/test/test_output.cc b/ui/ozone/platform/wayland/test/test_output.cc index 1718d0d..e83e597 100644 --- a/ui/ozone/platform/wayland/test/test_output.cc +++ b/ui/ozone/platform/wayland/test/test_output.cc
@@ -6,6 +6,8 @@ #include <wayland-server-protocol.h> +#include "base/optional.h" + namespace wl { namespace { @@ -17,23 +19,48 @@ TestOutput::~TestOutput() = default; -// Notify clients of the change for output position. -void TestOutput::OnBind() { - if (rect_.IsEmpty()) - return; - - const char* kUnknownMake = "unknown"; - const char* kUnknownModel = "unknown"; - wl_output_send_geometry(resource(), rect_.x(), rect_.y(), 0, 0, 0, - kUnknownMake, kUnknownModel, 0); - wl_output_send_mode(resource(), WL_OUTPUT_MODE_CURRENT, rect_.width(), - rect_.height(), 0); - wl_output_send_done(resource()); +void TestOutput::SetRect(const gfx::Rect& rect) { + pending_rect_ = rect; } void TestOutput::SetScale(int32_t factor) { - wl_output_send_scale(resource(), factor); + pending_scale_ = factor; +} + +void TestOutput::Flush() { + constexpr char kUnknownMake[] = "unknown_make"; + constexpr char kUnknownModel[] = "unknown_model"; + + if (!pending_rect_ && !pending_scale_) + return; + + if (pending_rect_) { + rect_ = std::move(pending_rect_.value()); + wl_output_send_geometry(resource(), rect_.x(), rect_.y(), + 0 /* physical_width */, 0 /* physical_height */, + 0 /* subpixel */, kUnknownMake, kUnknownModel, + 0 /* transform */); + wl_output_send_mode(resource(), WL_OUTPUT_MODE_CURRENT, rect_.width(), + rect_.height(), 0); + } + + if (pending_scale_) { + scale_ = std::move(pending_scale_.value()); + wl_output_send_scale(resource(), scale_); + } wl_output_send_done(resource()); } +// Notifies clients about the changes in the output configuration, if any. Doing +// this at bind time is the most common behavior among Wayland compositors. But +// there are some compositors that do it "lazily". An example is ChromeOS' +// Exosphere. +// +// Such behavior can be emulated with this class, by just instantiating an +// object with no setter calls. Such calls might then be done later on demand, +// so clients get notified about such changes when Flush() is called. +void TestOutput::OnBind() { + Flush(); +} + } // namespace wl
diff --git a/ui/ozone/platform/wayland/test/test_output.h b/ui/ozone/platform/wayland/test/test_output.h index 8dffd41..a44c0157 100644 --- a/ui/ozone/platform/wayland/test/test_output.h +++ b/ui/ozone/platform/wayland/test/test_output.h
@@ -5,7 +5,10 @@ #ifndef UI_OZONE_PLATFORM_WAYLAND_TEST_TEST_OUTPUT_H_ #define UI_OZONE_PLATFORM_WAYLAND_TEST_TEST_OUTPUT_H_ +#include <cstdint> + #include "base/macros.h" +#include "base/optional.h" #include "ui/gfx/geometry/rect.h" #include "ui/ozone/platform/wayland/test/global_object.h" @@ -16,14 +19,22 @@ public: TestOutput(); ~TestOutput() override; - void SetRect(const gfx::Rect rect) { rect_ = rect; } - const gfx::Rect GetRect() { return rect_; } - void OnBind() override; + const gfx::Rect GetRect() { return rect_; } + void SetRect(const gfx::Rect& rect); void SetScale(int32_t factor); + void Flush(); + + protected: + void OnBind() override; + private: gfx::Rect rect_; + int32_t scale_; + + base::Optional<gfx::Rect> pending_rect_ = base::nullopt; + base::Optional<int32_t> pending_scale_ = base::nullopt; DISALLOW_COPY_AND_ASSIGN(TestOutput); };
diff --git a/ui/ozone/platform/wayland/test/test_wayland_server_thread.cc b/ui/ozone/platform/wayland/test/test_wayland_server_thread.cc index a16655c..c6f0fe7c 100644 --- a/ui/ozone/platform/wayland/test/test_wayland_server_thread.cc +++ b/ui/ozone/platform/wayland/test/test_wayland_server_thread.cc
@@ -4,10 +4,12 @@ #include "ui/ozone/platform/wayland/test/test_wayland_server_thread.h" -#include <stdlib.h> #include <sys/socket.h> #include <wayland-server.h> + +#include <cstdlib> #include <memory> +#include <utility> #include "base/bind.h" #include "base/files/file_util.h" @@ -50,10 +52,6 @@ base::ScopedFD server_fd(fd[0]); base::ScopedFD client_fd(fd[1]); - // If client has not specified rect before, user standard ones. - if (output_.GetRect().IsEmpty()) - output_.SetRect(gfx::Rect(0, 0, 800, 600)); - if (wl_display_init_shm(display_.get()) < 0) return false; if (!compositor_.Initialize(display_.get())) @@ -62,6 +60,8 @@ return false; if (!output_.Initialize(display_.get())) return false; + SetupOutputs(); + if (!data_device_manager_.Initialize(display_.get())) return false; if (!seat_.Initialize(display_.get())) @@ -115,6 +115,18 @@ return nullptr; } +// By default, just make sure primary screen has bounds set. Otherwise delegates +// it, making it possible to emulate different scenarios, such as, multi-screen, +// lazy configuration, arbitrary ordering of the outputs metadata sending, etc. +void TestWaylandServerThread::SetupOutputs() { + if (output_delegate_) { + output_delegate_->SetupOutputs(&output_); + return; + } + if (output_.GetRect().IsEmpty()) + output_.SetRect(gfx::Rect{0, 0, 800, 600}); +} + void TestWaylandServerThread::DoPause() { base::RunLoop().RunUntilIdle(); pause_event_.Signal();
diff --git a/ui/ozone/platform/wayland/test/test_wayland_server_thread.h b/ui/ozone/platform/wayland/test/test_wayland_server_thread.h index 75a5b8d..e3d4d48 100644 --- a/ui/ozone/platform/wayland/test/test_wayland_server_thread.h +++ b/ui/ozone/platform/wayland/test/test_wayland_server_thread.h
@@ -5,9 +5,10 @@ #ifndef UI_OZONE_PLATFORM_WAYLAND_TEST_TEST_WAYLAND_SERVER_THREAD_H_ #define UI_OZONE_PLATFORM_WAYLAND_TEST_TEST_WAYLAND_SERVER_THREAD_H_ +#include <wayland-server-core.h> + #include <memory> #include <vector> -#include <wayland-server-core.h> #include "base/message_loop/message_pump_libevent.h" #include "base/synchronization/waitable_event.h" @@ -37,6 +38,8 @@ class TestWaylandServerThread : public base::Thread, base::MessagePumpLibevent::FdWatcher { public: + class OutputDelegate; + TestWaylandServerThread(); ~TestWaylandServerThread() override; @@ -84,7 +87,12 @@ wl_display* display() const { return display_.get(); } + void set_output_delegate(OutputDelegate* delegate) { + output_delegate_ = delegate; + } + private: + void SetupOutputs(); void DoPause(); std::unique_ptr<base::MessagePump> CreateMessagePump(); @@ -116,9 +124,22 @@ base::MessagePumpLibevent::FdWatchController controller_; + OutputDelegate* output_delegate_ = nullptr; + DISALLOW_COPY_AND_ASSIGN(TestWaylandServerThread); }; +class TestWaylandServerThread::OutputDelegate { + public: + // Tests may implement this such that it emulates different display/output + // test scenarios. For example, multi-screen, lazy configuration, arbitrary + // ordering of the outputs metadata events, etc. + virtual void SetupOutputs(TestOutput* primary_output) = 0; + + protected: + virtual ~OutputDelegate() = default; +}; + } // namespace wl #endif // UI_OZONE_PLATFORM_WAYLAND_TEST_TEST_WAYLAND_SERVER_THREAD_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 b90b046..55259bd 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
@@ -376,7 +376,9 @@ // Test that the TopmostWindowFinder finds windows which belong to menus // (which may or may not belong to Chrome). -TEST_F(X11TopmostWindowFinderTest, Menu) { +// +// Flakes (https://crbug.com/955316) +TEST_F(X11TopmostWindowFinderTest, DISABLED_Menu) { x11::Window window = CreateAndShowXWindow(gfx::Rect(100, 100, 100, 100)); x11::Window root = ui::GetX11RootWindow();
diff --git a/ui/webui/resources/cr_elements/cr_search_field/cr_search_field_behavior.js b/ui/webui/resources/cr_elements/cr_search_field/cr_search_field_behavior.js index 86adfdd..99ec783 100644 --- a/ui/webui/resources/cr_elements/cr_search_field/cr_search_field_behavior.js +++ b/ui/webui/resources/cr_elements/cr_search_field/cr_search_field_behavior.js
@@ -137,3 +137,37 @@ return true; }, }; + +/** @interface */ +/* #export */ class CrSearchFieldBehaviorInterface { + constructor() { + /** @type {string} */ + this.label; + + /** @type {string} */ + this.clearLabel; + + /** @type {boolean} */ + this.hasSearchText; + } + + /** + * @return {!HTMLInputElement} The input field element the behavior should + * use. + */ + getSearchInput() {} + + /** @return {string} The value of the search field. */ + getValue() {} + + /** + * @param {string} value + * @param {boolean=} opt_noEvent Whether to prevent a 'search-changed' event + * firing for this change. + */ + setValue(value, opt_noEvent) {} + + onSearchTermSearch() {} + + onSearchTermInput() {} +}
diff --git a/weblayer/BUILD.gn b/weblayer/BUILD.gn index defb7db..ac5121e 100644 --- a/weblayer/BUILD.gn +++ b/weblayer/BUILD.gn
@@ -629,6 +629,7 @@ "//components/infobars/core", "//components/translate/core/browser", "//content/public/browser", + "//content/public/test/android:content_native_test_support", "//content/test:test_support", "//testing/gtest", "//weblayer/browser/java:test_jni", @@ -701,11 +702,15 @@ shared_library("libweblayer_test") { testonly = true - sources = [ "app/entry_point.cc" ] + sources = [ + "$target_gen_dir/browser/java/test_weblayer_jni_registration.h", + "app/entry_point.cc", + ] deps = [ ":weblayer_lib_webview_test", "//base", "//content/public/app", + "//weblayer/browser/java:test_weblayer_jni_registration", ] configs -= [ "//build/config/android:hide_all_but_jni_onload" ] configs += [ "//build/config/android:hide_all_but_jni" ]
diff --git a/weblayer/app/entry_point.cc b/weblayer/app/entry_point.cc index 2b8535d..f54fe90 100644 --- a/weblayer/app/entry_point.cc +++ b/weblayer/app/entry_point.cc
@@ -5,6 +5,8 @@ #include "base/android/jni_android.h" #include "base/android/library_loader/library_loader_hooks.h" #include "weblayer/app/jni_onload.h" +#include "weblayer/browser/java/test_weblayer_jni_registration.h" +#include "weblayer/browser/web_view_compatibility_helper_impl.h" namespace { @@ -16,6 +18,12 @@ JNI_EXPORT jint JNI_OnLoad(JavaVM* vm, void* reserved) { base::android::InitVM(vm); + JNIEnv* env = base::android::AttachCurrentThread(); + if (!weblayer_test::RegisterNonMainDexNatives(env) || + !weblayer_test::RegisterMainDexNatives(env) || + !weblayer::MaybeRegisterNatives()) { + return -1; + } base::android::SetNativeInitializationHook(&NativeInit); return JNI_VERSION_1_4; }
diff --git a/weblayer/browser/java/BUILD.gn b/weblayer/browser/java/BUILD.gn index 4e8e426..9db9f1e6 100644 --- a/weblayer/browser/java/BUILD.gn +++ b/weblayer/browser/java/BUILD.gn
@@ -256,6 +256,13 @@ annotation_processor_deps = [ "//base/android/jni_generator:jni_processor" ] } +generate_jni_registration("test_weblayer_jni_registration") { + testonly = true + targets = [ ":test_java" ] + header_output = "$target_gen_dir/$target_name.h" + namespace = "weblayer_test" +} + generate_jni("test_jni") { testonly = true sources = [
diff --git a/weblayer/public/java/org/chromium/weblayer/ChildProcessService.java b/weblayer/public/java/org/chromium/weblayer/ChildProcessService.java index 9d72a37..2103c19a 100644 --- a/weblayer/public/java/org/chromium/weblayer/ChildProcessService.java +++ b/weblayer/public/java/org/chromium/weblayer/ChildProcessService.java
@@ -27,6 +27,7 @@ public void onCreate() { super.onCreate(); try { + WebLayer.disableWebViewCompatibilityMode(); Context appContext = getApplicationContext(); Context remoteContext = WebLayer.getOrCreateRemoteContext(appContext); if (WebLayer.getSupportedMajorVersion(appContext) < 81) {
diff --git a/weblayer/public/java/org/chromium/weblayer/WebLayer.java b/weblayer/public/java/org/chromium/weblayer/WebLayer.java index b47b68e..aa06e21e 100644 --- a/weblayer/public/java/org/chromium/weblayer/WebLayer.java +++ b/weblayer/public/java/org/chromium/weblayer/WebLayer.java
@@ -14,7 +14,6 @@ import android.os.RemoteException; import android.util.AndroidRuntimeException; import android.util.Log; -import android.util.Pair; import android.webkit.ValueCallback; import androidx.annotation.NonNull; @@ -38,7 +37,6 @@ import java.lang.reflect.Method; import java.util.ArrayList; import java.util.List; -import java.util.concurrent.Callable; /** * WebLayer is responsible for initializing state necessary to use any of the classes in web layer. @@ -56,16 +54,19 @@ private static Context sRemoteContext; @Nullable + private static ClassLoader sRemoteClassLoader; + + @Nullable private static Context sAppContext; @Nullable private static WebLayerLoader sLoader; + private static boolean sDisableWebViewCompatibilityMode; + @NonNull private final IWebLayer mImpl; - private static Callable<ClassLoader> sWebViewCompatClassLoaderGetter; - /** The result of calling {@link #initializeWebViewCompatibilityMode}. */ public enum WebViewCompatibilityResult { /** Compatibility mode has been successfully set up. */ @@ -100,31 +101,13 @@ } /** - * Performs initialization needed to run WebView and WebLayer in the same process. - * - * @param appContext The hosting application's Context. + * Deprecated. This is no longer necessary since WebView compatibility mode is now enabled by + * default. This will be removed once the client app is updated. */ public static WebViewCompatibilityResult initializeWebViewCompatibilityMode( @NonNull Context appContext) { ThreadCheck.ensureOnUiThread(); - if (sWebViewCompatClassLoaderGetter != null) { - throw new AndroidRuntimeException( - "initializeWebViewCompatibilityMode() has already been called."); - } - if (sLoader != null) { - throw new AndroidRuntimeException( - "initializeWebViewCompatibilityMode() must be called before WebLayer is " - + "loaded."); - } - try { - Pair<Callable<ClassLoader>, WebLayer.WebViewCompatibilityResult> result = - WebViewCompatibilityHelper.initialize(appContext); - sWebViewCompatClassLoaderGetter = result.first; - return result.second; - } catch (Exception e) { - Log.e(TAG, "Unable to initialize WebView compatibility", e); - return WebViewCompatibilityResult.FAILURE_OTHER; - } + return WebViewCompatibilityResult.SUCCESS; } /** @@ -266,19 +249,13 @@ * Creates WebLayerLoader. This does a minimal amount of loading */ public WebLayerLoader(@NonNull Context appContext) { - ClassLoader remoteClassLoader = null; boolean available = false; int majorVersion = -1; String version = "<unavailable>"; try { - if (sWebViewCompatClassLoaderGetter != null) { - remoteClassLoader = sWebViewCompatClassLoaderGetter.call(); - } - if (remoteClassLoader == null) { - remoteClassLoader = getOrCreateRemoteContext(appContext).getClassLoader(); - } - Class factoryClass = remoteClassLoader.loadClass( - "org.chromium.weblayer_private.WebLayerFactoryImpl"); + Class factoryClass = + getOrCreateRemoteClassLoader(appContext) + .loadClass("org.chromium.weblayer_private.WebLayerFactoryImpl"); mFactory = IWebLayerFactory.Stub.asInterface( (IBinder) factoryClass .getMethod("create", String.class, int.class, int.class) @@ -600,10 +577,22 @@ } /** - * Forces setting the cached remote context. + * Creates a ClassLoader for the remote (weblayer implementation) side. */ - static void setRemoteContext(Context remoteContext) { - sRemoteContext = remoteContext; + static ClassLoader getOrCreateRemoteClassLoader(Context appContext) + throws PackageManager.NameNotFoundException, ReflectiveOperationException { + if (sRemoteClassLoader != null) { + return sRemoteClassLoader; + } + + // Child processes do not need WebView compatibility since there is no chance + // WebView will run in the same process. + if (sDisableWebViewCompatibilityMode) { + sRemoteClassLoader = getOrCreateRemoteContext(appContext).getClassLoader(); + } else { + sRemoteClassLoader = WebViewCompatibilityHelper.initialize(appContext); + } + return sRemoteClassLoader; } /** @@ -632,6 +621,10 @@ return sRemoteContext; } + /* package */ static void disableWebViewCompatibilityMode() { + sDisableWebViewCompatibilityMode = true; + } + /** * Creates a Context for the remote (weblayer implementation) side * using a specified package name as the implementation. This is only
diff --git a/weblayer/public/java/org/chromium/weblayer/WebViewCompatibilityHelper.java b/weblayer/public/java/org/chromium/weblayer/WebViewCompatibilityHelper.java index e2a7da1..c334de6 100644 --- a/weblayer/public/java/org/chromium/weblayer/WebViewCompatibilityHelper.java +++ b/weblayer/public/java/org/chromium/weblayer/WebViewCompatibilityHelper.java
@@ -11,7 +11,6 @@ import android.os.Build; import android.os.StrictMode; import android.text.TextUtils; -import android.util.Pair; import dalvik.system.BaseDexClassLoader; import dalvik.system.PathClassLoader; @@ -19,92 +18,50 @@ import java.io.File; import java.util.ArrayList; import java.util.List; -import java.util.concurrent.Callable; /** Helper class which performs initialization needed for WebView compatibility. */ final class WebViewCompatibilityHelper { /** Creates a the ClassLoader to use for WebView compatibility. */ - static Pair<Callable<ClassLoader>, WebLayer.WebViewCompatibilityResult> initialize( - Context appContext) + static ClassLoader initialize(Context appContext) throws PackageManager.NameNotFoundException, ReflectiveOperationException { Context remoteContext = WebLayer.getOrCreateRemoteContext(appContext); PackageInfo info = appContext.getPackageManager().getPackageInfo(remoteContext.getPackageName(), PackageManager.GET_SHARED_LIBRARY_FILES | PackageManager.MATCH_UNINSTALLED_PACKAGES); - int majorVersion = parseMajorVersion(info.versionName); - if (!isSupportedVersion(majorVersion)) { - return Pair.create( - null, WebLayer.WebViewCompatibilityResult.FAILURE_UNSUPPORTED_VERSION); - } - if (majorVersion >= 84) { - // Recreate the context without code to avoid wasting memory by accidentally using the - // class loader. - remoteContext = appContext.createPackageContext( - remoteContext.getPackageName(), Context.CONTEXT_IGNORE_SECURITY); - WebLayer.setRemoteContext(remoteContext); - } + String[] libraryPaths = getLibraryPaths(remoteContext.getClassLoader()); // Prepend "/." to all library paths. This changes the library path while still pointing to // the same directory, allowing us to get around a check in the JVM. This is only necessary // for N+, where we rely on linker namespaces. - String[] libraryPaths; if (Build.VERSION.SDK_INT > Build.VERSION_CODES.M) { - // Even if the context was recreated without code above, on N+ the library path list - // still contains the necessary paths to load WebLayer. - libraryPaths = getLibraryPaths(remoteContext.getClassLoader()); for (int i = 0; i < libraryPaths.length; i++) { assert libraryPaths[i].startsWith("/"); libraryPaths[i] = "/." + libraryPaths[i]; } - } else { - // Android M- only need the native lib dir, since standalone WebView stores native libs - // compressed and they get extracted here. Standalone WebView also doesn't depend on any - // shared library APKs like Trichrome WebView. - libraryPaths = new String[] {info.applicationInfo.nativeLibraryDir}; } String dexPath = getAllApkPaths(info.applicationInfo); String librarySearchPath = TextUtils.join(File.pathSeparator, libraryPaths); - Callable<ClassLoader> classLoaderGetter = () -> { - // TODO(cduvall): PathClassLoader may call stat on the library paths, consider moving - // this to a background thread. - StrictMode.ThreadPolicy oldPolicy = StrictMode.allowThreadDiskReads(); - try { - return new PathClassLoader( - dexPath, librarySearchPath, ClassLoader.getSystemClassLoader()); - } finally { - StrictMode.setThreadPolicy(oldPolicy); - } - }; - return Pair.create(classLoaderGetter, WebLayer.WebViewCompatibilityResult.SUCCESS); - } - - /** - * Returns if the version of the WebLayer implementation supports WebView compatibility. We - * can't use WebLayer.getSupportedMajorVersion() here because the loader depends on - * WebView compatibility already being set up. - */ - static boolean isSupportedVersion(int majorVersion) { - // M- only supports WebView compat via copying the libraries on 81, so only support 82+. - if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.M) { - return majorVersion >= 82; - } - return majorVersion >= 81; - } - - /** Parses the version name into an integer version number. */ - static int parseMajorVersion(String versionName) { - if (versionName == null) { - return -1; - } - String[] parts = versionName.split("\\.", -1); - if (parts.length < 4) { - return -1; - } + // TODO(cduvall): PathClassLoader may call stat on the library paths, consider moving + // this to a background thread. + StrictMode.ThreadPolicy oldPolicy = StrictMode.allowThreadDiskReads(); try { - return Integer.parseInt(parts[0]); - } catch (NumberFormatException e) { - return -1; + return new PathClassLoader( + dexPath, librarySearchPath, ClassLoader.getSystemClassLoader()) { + @Override + public Class<?> loadClass(String name) throws ClassNotFoundException { + // TODO(crbug.com/1112001): Investigate why loading classes causes strict mode + // violations in some situations. + StrictMode.ThreadPolicy oldPolicy = StrictMode.allowThreadDiskReads(); + try { + return super.loadClass(name); + } finally { + StrictMode.setThreadPolicy(oldPolicy); + } + } + }; + } finally { + StrictMode.setThreadPolicy(oldPolicy); } }
diff --git a/weblayer/public/javatests/org/chromium/weblayer/WebViewCompatibilityHelperTest.java b/weblayer/public/javatests/org/chromium/weblayer/WebViewCompatibilityHelperTest.java index 998f0907..4bad2b8 100644 --- a/weblayer/public/javatests/org/chromium/weblayer/WebViewCompatibilityHelperTest.java +++ b/weblayer/public/javatests/org/chromium/weblayer/WebViewCompatibilityHelperTest.java
@@ -7,7 +7,6 @@ import android.content.Context; import android.os.Build; import android.support.test.InstrumentationRegistry; -import android.util.Pair; import androidx.test.filters.SmallTest; @@ -18,8 +17,6 @@ import org.chromium.base.test.BaseJUnit4ClassRunner; import org.chromium.base.test.util.MinAndroidSdkLevel; -import java.util.concurrent.Callable; - /** * Tests for (@link WebViewCompatibilityHelper}. */ @@ -30,34 +27,10 @@ @MinAndroidSdkLevel(Build.VERSION_CODES.N) public void testLibraryPaths() throws Exception { Context appContext = InstrumentationRegistry.getTargetContext(); - Pair<Callable<ClassLoader>, WebLayer.WebViewCompatibilityResult> result = - WebViewCompatibilityHelper.initialize(appContext); - Assert.assertEquals(result.second, WebLayer.WebViewCompatibilityResult.SUCCESS); - String[] libraryPaths = WebViewCompatibilityHelper.getLibraryPaths(result.first.call()); + ClassLoader classLoader = WebViewCompatibilityHelper.initialize(appContext); + String[] libraryPaths = WebViewCompatibilityHelper.getLibraryPaths(classLoader); for (String path : libraryPaths) { Assert.assertTrue(path.startsWith("/./")); } } - - @Test - @SmallTest - public void testSupportedVersion() throws Exception { - if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.M) { - Assert.assertFalse(WebViewCompatibilityHelper.isSupportedVersion( - WebViewCompatibilityHelper.parseMajorVersion("81.0.2.5"))); - } else { - Assert.assertTrue(WebViewCompatibilityHelper.isSupportedVersion( - WebViewCompatibilityHelper.parseMajorVersion("81.0.2.5"))); - } - Assert.assertTrue(WebViewCompatibilityHelper.isSupportedVersion( - WebViewCompatibilityHelper.parseMajorVersion("82.0.2.5"))); - Assert.assertFalse(WebViewCompatibilityHelper.isSupportedVersion( - WebViewCompatibilityHelper.parseMajorVersion("80.0.2.5"))); - Assert.assertFalse(WebViewCompatibilityHelper.isSupportedVersion( - WebViewCompatibilityHelper.parseMajorVersion(""))); - Assert.assertFalse(WebViewCompatibilityHelper.isSupportedVersion( - WebViewCompatibilityHelper.parseMajorVersion("82.0"))); - Assert.assertFalse(WebViewCompatibilityHelper.isSupportedVersion( - WebViewCompatibilityHelper.parseMajorVersion(null))); - } }
diff --git a/weblayer/public/javatestutil/org/chromium/weblayer/TestWebLayer.java b/weblayer/public/javatestutil/org/chromium/weblayer/TestWebLayer.java index 14615a9..cee8da7 100644 --- a/weblayer/public/javatestutil/org/chromium/weblayer/TestWebLayer.java +++ b/weblayer/public/javatestutil/org/chromium/weblayer/TestWebLayer.java
@@ -34,9 +34,8 @@ } private TestWebLayer(@NonNull Context appContext) { - ClassLoader remoteClassLoader; try { - remoteClassLoader = WebLayer.getOrCreateRemoteContext(appContext).getClassLoader(); + ClassLoader remoteClassLoader = WebLayer.getOrCreateRemoteClassLoader(appContext); Class TestWebLayerClass = remoteClassLoader.loadClass( "org.chromium.weblayer_private.test.TestWebLayerImpl"); mITestWebLayer = ITestWebLayer.Stub.asInterface( @@ -118,4 +117,8 @@ public String getDisplayedUrl(View urlBarView) throws RemoteException { return mITestWebLayer.getDisplayedUrl(ObjectWrapper.wrap(urlBarView)); } + + public static void disableWebViewCompatibilityMode() { + WebLayer.disableWebViewCompatibilityMode(); + } }
diff --git a/weblayer/shell/android/BUILD.gn b/weblayer/shell/android/BUILD.gn index 9109070..4614888 100644 --- a/weblayer/shell/android/BUILD.gn +++ b/weblayer/shell/android/BUILD.gn
@@ -202,6 +202,11 @@ # default upstream safebrowsing related classes deps += [ "//weblayer/browser/java:gms_bridge_upstream_impl_java" ] + # Add the Chromium linker for WebView compatibility support on L-M. + deps += [ "//base/android/linker:chromium_android_linker" ] + loadable_modules = + [ "$root_out_dir/libchromium_android_linker$shlib_extension" ] + apk_name = "WebLayerSupport" android_manifest = weblayer_support_manifest min_sdk_version = 21
diff --git a/weblayer/shell/android/browsertests_apk/src/org/chromium/weblayer_browsertests_apk/WebLayerBrowserTestsActivity.java b/weblayer/shell/android/browsertests_apk/src/org/chromium/weblayer_browsertests_apk/WebLayerBrowserTestsActivity.java index ecc26c1..7a93c55 100644 --- a/weblayer/shell/android/browsertests_apk/src/org/chromium/weblayer_browsertests_apk/WebLayerBrowserTestsActivity.java +++ b/weblayer/shell/android/browsertests_apk/src/org/chromium/weblayer_browsertests_apk/WebLayerBrowserTestsActivity.java
@@ -25,6 +25,7 @@ import org.chromium.weblayer.Profile; import org.chromium.weblayer.Tab; import org.chromium.weblayer.TabCallback; +import org.chromium.weblayer.TestWebLayer; import org.chromium.weblayer.WebLayer; import java.io.File; @@ -50,6 +51,9 @@ }); try { + // Browser tests cannot be run in WebView compatibility mode since the class loader + // WebLayer uses needs to match the class loader used for setup. + TestWebLayer.disableWebViewCompatibilityMode(); WebLayer.loadAsync(getApplication(), webLayer -> { mWebLayer = webLayer; createShell();
diff --git a/weblayer/test/BUILD.gn b/weblayer/test/BUILD.gn index 7138cae..3aa575c 100644 --- a/weblayer/test/BUILD.gn +++ b/weblayer/test/BUILD.gn
@@ -47,6 +47,7 @@ "//weblayer/browser/java", "//weblayer/browser/java:gms_bridge_java", "//weblayer/public/java", + "//weblayer/public/javatestutil:test_java", ] annotation_processor_deps = [ "//base/android/jni_generator:jni_processor" ]